Projekt

Obecné

Profil

Stáhnout (5.21 KB) Statistiky
| Větev: | Tag: | Revize:
1
{
2
  "data": [
3
    {},
4
    {},
5
    {},
6
    {},
7
    {
8
      "name": "timeunit",
9
      "source": "table",
10
      "transform": [
11
        {
12
          "type": "timeunit",
13
          "field": "dateTime",
14
          "units": ["year","month", "date", "hours", "minutes", "seconds"],
15
          "step": {"signal": "timeStep"}
16
        }
17
      ]
18
    },
19
    {
20
      "name": "lookup",
21
      "source": "timeunit",
22
      "transform":[
23
        {
24
          "type": "lookup",
25
          "from": "timeunit",
26
          "key": "unit0",
27
          "fields": ["unit1"],
28
          "as": ["obj"]
29
        }
30
      ]
31
    }
32
  ],
33
  "marks": [
34
    {
35
      "scales": [
36
        {},
37
        {
38
          "name": "yDetail",
39
          "type": "linear",
40
          "range": [390, 0],
41
          "domain": {"data": "range", "field": "valueMax"},
42
          "nice": true, "zero": true
43
        }
44
      ],
45
      "axes": [
46
        {},
47
        {"orient": "left", "scale": "yDetail"}
48
      ],
49
      "marks": [
50
        {
51
          "marks": [
52
            {
53
              "type": "symbol",
54
              "from": {"data":"table"},
55
              "encode": {
56
                "enter": {
57
                  "tooltip": {
58
                    "signal": "{title: timeFormat(datum.dateTime, '%A, %e. %B %Y, %X') }"
59
                  }},
60
                "update": {
61
                  "shape": {"value": "circle"},
62
                  "size": {"value": 30},
63
                  "x": {"scale": "xDetail", "field": "dateTime"},
64
                  "y": {"scale": "yDetail", "field": "value"},
65
                  "color": {"value": "both"},
66
                  "strokeWidth": {"value": 4},
67
                  "fill": {"value": "steelblue"}
68
                },
69
                "hover": {
70
                  "fill": {"value": "red"},
71
                  "size": {"value": 60}
72
                }
73
              }
74
            },
75
            {
76
              "type": "rule",
77
              "from": {
78
                "data": "lookup"
79
              },
80
              "encode": {
81
                "update": {
82
                  "x": {
83
                    "scale": "xDetail",
84
                    "field": "unit0"
85
                  },
86
                  "x2": [
87
                    {
88
                      "test": "isValid(datum.obj)",
89
                      "scale": "xDetail",
90
                      "field": "obj.unit0"
91
                    },
92
                    {
93
                      "scale": "xDetail",
94
                      "field": "unit0"
95
                    }
96
                  ],
97
                  "y": {
98
                    "scale": "yDetail",
99
                    "field": "value"
100
                  },
101
                  "y2": [
102
                    {
103
                      "test": "isValid(datum.obj)",
104
                      "scale": "yDetail",
105
                      "field": "obj.value"
106
                    },
107
                    {
108
                      "scale": "yDetail",
109
                      "field": "value"
110
                    }
111
                  ],
112
                  "stroke": {
113
                    "value": "steelblue"
114
                  },
115
                  "strokeWidth": {
116
                    "value": 1
117
                  }
118
                }
119
              }
120
            }
121
          ]
122
        }
123
      ]
124
    },
125
    {
126
      "signals": [
127
        {
128
          "value": 0,
129
          "on": [
130
            {},
131
            {
132
              "events": "@overview:mousedown",
133
              "update": "[x(), x()]"
134
            },
135
            {
136
              "events": "[@overview:mousedown, window:mouseup] > window:mousemove!",
137
              "update": "[brush[0], clamp(x(), 0, width)]"
138
            }
139
          ]
140
        }
141
      ],
142
      "marks": [
143
        {},
144
        {},
145
        {},
146
        {
147
          "type": "symbol",
148
          "from": {"data":"table"},
149
          "encode": {
150
            "update": {
151
              "shape": {"value": "circle"},
152
              "size": {"value": 10},
153
              "x": {"scale": "xOverview", "field": "dateTime"},
154
              "y": {"scale": "yOverview", "field": "value"},
155
              "color": {"value": "both"},
156
              "strokeWidth": {"value": 4}
157
            }
158
          }
159
        },
160
        {
161
          "type": "rule",
162
          "from": {
163
            "data": "lookup"
164
          },
165
          "encode": {
166
            "update": {
167
              "x": {
168
                "scale": "xOverview",
169
                "field": "unit0"
170
              },
171
              "x2": [
172
                {
173
                  "test": "isValid(datum.obj)",
174
                  "scale": "xOverview",
175
                  "field": "obj.unit0"
176
                },
177
                {
178
                  "scale": "xOverview",
179
                  "field": "unit0"
180
                }
181
              ],
182
              "y": {
183
                "scale": "yOverview",
184
                "field": "value"
185
              },
186
              "y2": [
187
                {
188
                  "test": "isValid(datum.obj)",
189
                  "scale": "yOverview",
190
                  "field": "obj.value"
191
                },
192
                {
193
                  "scale": "yOverview",
194
                  "field": "value"
195
                }
196
              ],
197
              "stroke": {
198
                "value": "steelblue"
199
              },
200
              "strokeWidth": {
201
                "value": 1
202
              }
203
            }
204
          }
205
        }
206
      ]
207
    }
208
  ]
209
}
    (1-1/1)