Revize 11efc186
Přidáno uživatelem Jakub Hlaváč před více než 3 roky(ů)
src/app/shared/graph-loading/graphloader.ts | ||
---|---|---|
8 | 8 |
|
9 | 9 |
if (sensorId >= 480000000 && sensorId < 490000000) { |
10 | 10 |
|
11 |
let rvalue: any = {};
|
|
12 |
let base = require('/src/vega/base/default.json');
|
|
13 |
let chart = require('/src/vega/body/barchart.json');
|
|
14 |
let tooltip = require('/src/vega/tooltip/samm-tooltip.json')
|
|
11 |
const rvalue: any = {};
|
|
12 |
const base = require('/src/vega/base/default.json');
|
|
13 |
const chart = require('/src/vega/body/barchart.json');
|
|
14 |
const tooltip = require('/src/vega/tooltip/samm-tooltip.json')
|
|
15 | 15 |
lodash.merge(rvalue, base, chart, tooltip); |
16 | 16 |
return rvalue; |
17 | 17 |
|
18 | 18 |
} else if ((sensorId >= 470020000 && sensorId < 470030000) || (sensorId >= 470060000 && sensorId < 470090000) || |
19 | 19 |
(sensorId >= 470130000 && sensorId < 470140000) || (sensorId >= 470180000 && sensorId < 470190000)) { |
20 | 20 |
|
21 |
let rvalue: any = {};
|
|
22 |
let base = require('/src/vega/base/default.json');
|
|
23 |
let chart = require('/src/vega/body/windchart.json');
|
|
24 |
let tooltip = require('/src/vega/tooltip/samm-tooltip.json')
|
|
21 |
const rvalue: any = {};
|
|
22 |
const base = require('/src/vega/base/default.json');
|
|
23 |
const chart = require('/src/vega/body/windchart.json');
|
|
24 |
const tooltip = require('/src/vega/tooltip/samm-tooltip.json')
|
|
25 | 25 |
lodash.merge(rvalue, base, chart, tooltip); |
26 | 26 |
return rvalue; |
27 | 27 |
|
28 | 28 |
} else { |
29 | 29 |
|
30 |
let rvalue: any = {};
|
|
31 |
let base = require('/src/vega/base/default.json');
|
|
32 |
let chart = require('/src/vega/body/linechart.json');
|
|
33 |
let tooltip = require('/src/vega/tooltip/samm-tooltip.json')
|
|
30 |
const rvalue: any = {};
|
|
31 |
const base = require('/src/vega/base/default.json');
|
|
32 |
const chart = require('/src/vega/body/linechart.json');
|
|
33 |
const tooltip = require('/src/vega/tooltip/samm-tooltip.json')
|
|
34 | 34 |
lodash.merge(rvalue, base, chart, tooltip); |
35 | 35 |
return rvalue; |
36 | 36 |
|
... | ... | |
38 | 38 |
} |
39 | 39 |
|
40 | 40 |
static getGraph(sensorId, data, interval, element) { |
41 |
let spec = this.getGraphType(sensorId);
|
|
41 |
const spec = this.getGraphType(sensorId);
|
|
42 | 42 |
const vega = require('vega'); |
43 | 43 |
const vegaTooltip = require('vega-tooltip'); |
44 | 44 |
const config = require('/src/vega/config.json'); |
... | ... | |
47 | 47 |
spec.signals[0].value = interval; |
48 | 48 |
|
49 | 49 |
|
50 |
let handler = new vegaTooltip.Handler();
|
|
50 |
const handler = new vegaTooltip.Handler();
|
|
51 | 51 |
|
52 | 52 |
const loc = vega.locale({ |
53 |
"decimal": ",",
|
|
54 |
"thousands": "\u00a0",
|
|
55 |
"grouping": [3],
|
|
56 |
"currency": ["", "\u00a0Kč"]
|
|
53 |
decimal: ',',
|
|
54 |
thousands: '\u00a0',
|
|
55 |
grouping: [3],
|
|
56 |
currency: ['', '\u00a0Kč']
|
|
57 | 57 |
},{ |
58 |
"dateTime": "%A,%e.%B %Y, %X",
|
|
59 |
"date": "%-d.%-m.%Y",
|
|
60 |
"time": "%H:%M:%S",
|
|
61 |
"periods": ["AM", "PM"],
|
|
62 |
"days": ["neděle", "pondělí", "úterý", "středa", "čvrtek", "pátek", "sobota"],
|
|
63 |
"shortDays": ["ne.", "po.", "út.", "st.", "čt.", "pá.", "so."],
|
|
64 |
"months": ["leden", "únor", "březen", "duben", "květen", "červen", "červenec", "srpen", "září", "říjen", "listopad", "prosinec"],
|
|
65 |
"shortMonths": ["led", "úno", "břez", "dub", "kvě", "čer", "červ", "srp", "zář", "říj", "list", "pros"]
|
|
58 |
dateTime: '%A,%e.%B %Y, %X',
|
|
59 |
date: '%-d.%-m.%Y',
|
|
60 |
time: '%H:%M:%S',
|
|
61 |
periods: ['AM', 'PM'],
|
|
62 |
days: ['neděle', 'pondělí', 'úterý', 'středa', 'čvrtek', 'pátek', 'sobota'],
|
|
63 |
shortDays: ['ne.', 'po.', 'út.', 'st.', 'čt.', 'pá.', 'so.'],
|
|
64 |
months: ['leden', 'únor', 'březen', 'duben', 'květen', 'červen', 'červenec', 'srpen', 'září', 'říjen', 'listopad', 'prosinec'],
|
|
65 |
shortMonths: ['led', 'úno', 'břez', 'dub', 'kvě', 'čer', 'červ', 'srp', 'zář', 'říj', 'list', 'pros']
|
|
66 | 66 |
}); |
67 | 67 |
|
68 |
let view = new vega.View(vega.parse(spec, config))
|
|
68 |
const view = new vega.View(vega.parse(spec, config))
|
|
69 | 69 |
.tooltip(handler.call) |
70 | 70 |
.initialize(element) |
71 | 71 |
.hover() |
Také k dispozici: Unified diff
Re #8792 - Sensor page - tweak
+ form and to input fields