Projekt

Obecné

Profil

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