1
|
import {Graph} from "./graph";
|
2
|
|
3
|
declare var require: any
|
4
|
|
5
|
/**
|
6
|
* A graph with no sensors to display
|
7
|
*/
|
8
|
export class EmptyGraph implements Graph{
|
9
|
|
10
|
/**
|
11
|
* Message in the middle of the graph
|
12
|
*/
|
13
|
message: string;
|
14
|
|
15
|
constructor(message) {
|
16
|
this.message = message;
|
17
|
}
|
18
|
|
19
|
/**
|
20
|
* Returns vega configuration
|
21
|
*/
|
22
|
getConfig(): {} {
|
23
|
return require('/src/vega/config/config.json');
|
24
|
}
|
25
|
|
26
|
/**
|
27
|
* Returns vega specification
|
28
|
*/
|
29
|
getSpec(): {} {
|
30
|
const lodash = require('lodash/object');
|
31
|
const rvalue: any = {};
|
32
|
let base = require('/src/vega/base/empty.json');
|
33
|
lodash.merge(rvalue, base);
|
34
|
rvalue.signals[0].value = this.message;
|
35
|
return rvalue;
|
36
|
}
|
37
|
|
38
|
}
|