Projekt

Obecné

Profil

Stáhnout (1.62 KB) Statistiky
| Větev: | Tag: | Revize:
1
{
2
  "$schema": "https://vega.github.io/schema/vega/v5.json",
3
  "width": 1200,
4
  "height": 200,
5
  "padding": 5,
6

    
7
  "signals": [
8
    { "name": "shape", "value": "circle",
9
      "bind": {"input": "select", "options": [
10
        "arrow", "circle", "square", "cross", "diamond", "triangle",
11
        "triangle-up", "triangle-down", "triangle-right", "triangle-left",
12
        "wedge", "stroke",
13
        "M-1,-1H1V1H-1Z",
14
        "M0,.5L.6,.8L.5,.1L1,-.3L.3,-.4L0,-1L-.3,-.4L-1,-.3L-.5,.1L-.6,.8L0,.5Z"
15
      ]
16
      }
17
    }
18
  ],
19

    
20
  "data": [
21
    {
22
      "name": "table",
23
      "url": "data2.json",
24
      "transform": [
25
        {
26
          "type": "formula",
27
          "expr": "toDate(datum[\"time_stamp\"])",
28
          "as": "dateTime"
29
        }
30
      ]
31
    }
32
  ],
33

    
34
  "scales": [
35
    {
36
      "name": "xscale",
37
      "type": "time",
38
      "domain": {"data": "table", "field": "dateTime"},
39
      "range": "width"
40
    },
41
    {
42
      "name": "yscale",
43
      "type": "linear",
44
      "domain": {"data": "table", "field": "sensors[0].value"},
45
      "nice": true,
46
      "range": "height"
47
    }
48
  ],
49

    
50
  "axes": [
51
    { "orient": "bottom", "scale": "xscale", "tickCount": 3  },
52
    { "orient": "left", "scale": "yscale" }
53
  ],
54

    
55
  "marks": [
56
    {
57
      "type": "symbol",
58
      "from": {"data":"table"},
59
      "encode": {
60
        "enter": {
61
          "size": {"value": 10},
62
          "x": {"scale": "xscale", "field": "dateTime"},
63
          "y": {"scale": "yscale", "field": "sensors[0].value"},
64
          "color": {"value": "both"},
65
          "strokeWidth": {"value": 1}
66
        },
67
        "update": {
68
          "shape": {"signal": "shape"}
69
        }
70
      }
71
    }
72
  ]
73

    
74

    
75

    
76
}
(6-6/10)