Skip to content

Commit

Permalink
docs: update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kanitw committed Mar 25, 2020
1 parent 793e898 commit 433dcbb
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 23 deletions.
4 changes: 2 additions & 2 deletions examples/specs/geo_constant_value.vl.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"mark": "square",
"encoding": {
"longitude": {
"value": -122.335167
"datum": -122.335167
},
"latitude": {
"field": "latitude",
Expand All @@ -54,7 +54,7 @@
"type": "quantitative"
},
"latitude": {
"value": 47.608013
"datum": 47.608013
},
"size": {
"value": 1
Expand Down
29 changes: 9 additions & 20 deletions examples/specs/layer_bar_annotations.vl.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,40 +35,29 @@
],
"encoding": {
"x": {"field": "Day", "type": "ordinal"},
"y": {"field": "baseline", "type": "quantitative"},
"y": {"field": "baseline", "type": "quantitative", "title": "PM2.5 Value"},
"y2": {"field": "Value"},
"color": {"value": "#e45755"}
}
}
]}, {
"data": {
"values": [
{"ThresholdValue": 300, "Threshold": "hazardous"}
]
"values": [{}]
},
"encoding": {
"y": {"datum": 300}
},
"layer": [{
"mark": "rule",
"encoding": {
"y": {"field": "ThresholdValue", "type": "quantitative"}
}
"mark": "rule"
}, {
"mark": {
"type": "text",
"align": "right",
"baseline": "bottom",
"dx": -2,
"dy": -2
},
"encoding": {
"x": {
"value": "width"
},
"y": {
"field": "ThresholdValue",
"type": "quantitative",
"axis": {"title": "PM2.5 Value"}
},
"text": {"field": "Threshold", "type": "ordinal"}
"dy": -2,
"x": "width",
"text": "hazardous"
}
}]
}
Expand Down
21 changes: 21 additions & 0 deletions examples/specs/layer_line_datum_rule.vl.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"layer": [
{
"data": {"url": "data/stocks.csv"},
"mark": "line",
"encoding": {
"x": {"field": "date", "type": "temporal"},
"y": {"field": "price", "type": "quantitative"},
"color": {"field": "symbol", "type": "nominal"}
}
},
{
"data": {"values": [{}]},
"mark": {"type": "rule", "strokeDash": [2, 2], "size": 2},
"encoding": {
"y": {"datum": 300}
}
}
]
}
7 changes: 6 additions & 1 deletion examples/specs/repeat_layer.vl.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
"y": {
"aggregate": "mean",
"field": {"repeat": "layer"},
"type": "quantitative"
"type": "quantitative",
"title": "Mean of US and Worldwide Gross"
},
"color": {
"datum": {"repeat": "layer"},
"type": "nominal"
}
}
}
Expand Down

0 comments on commit 433dcbb

Please sign in to comment.