-
Notifications
You must be signed in to change notification settings - Fork 621
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: support repeat layer part of #1274 Note that repeat layer isn't very useful yet until we have `datum` support (#1601) * chore: update schema [CI] * chore: update examples [CI] * fix: fix comment * chore: update schema [CI] Co-authored-by: GitHub Actions Bot <vega-actions-bot@users.noreply.github.com>
- Loading branch information
Showing
17 changed files
with
1,544 additions
and
932 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
94 changes: 94 additions & 0 deletions
94
examples/specs/normalized/repeat_child_layer_normalized.vl.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
{ | ||
"data": {"url": "data/weather.csv"}, | ||
"align": "all", | ||
"$schema": "https://vega.github.io/schema/vega-lite/v4.json", | ||
"description": "Summarized and per year weather information for Seatle and New York.", | ||
"columns": 3, | ||
"concat": [ | ||
{ | ||
"layer": [ | ||
{ | ||
"mark": "line", | ||
"encoding": { | ||
"y": { | ||
"aggregate": "mean", | ||
"field": "temp_max", | ||
"type": "quantitative" | ||
}, | ||
"x": {"timeUnit": "month", "field": "date", "type": "ordinal"}, | ||
"detail": {"timeUnit": "year", "type": "temporal", "field": "date"}, | ||
"color": {"type": "nominal", "field": "location"}, | ||
"opacity": {"value": 0.2} | ||
} | ||
}, | ||
{ | ||
"mark": "line", | ||
"encoding": { | ||
"y": { | ||
"aggregate": "mean", | ||
"field": "temp_max", | ||
"type": "quantitative" | ||
}, | ||
"x": {"timeUnit": "month", "field": "date", "type": "ordinal"}, | ||
"color": {"type": "nominal", "field": "location"} | ||
} | ||
} | ||
], | ||
"name": "child__column_temp_max" | ||
}, | ||
{ | ||
"layer": [ | ||
{ | ||
"mark": "line", | ||
"encoding": { | ||
"y": { | ||
"aggregate": "mean", | ||
"field": "precipitation", | ||
"type": "quantitative" | ||
}, | ||
"x": {"timeUnit": "month", "field": "date", "type": "ordinal"}, | ||
"detail": {"timeUnit": "year", "type": "temporal", "field": "date"}, | ||
"color": {"type": "nominal", "field": "location"}, | ||
"opacity": {"value": 0.2} | ||
} | ||
}, | ||
{ | ||
"mark": "line", | ||
"encoding": { | ||
"y": { | ||
"aggregate": "mean", | ||
"field": "precipitation", | ||
"type": "quantitative" | ||
}, | ||
"x": {"timeUnit": "month", "field": "date", "type": "ordinal"}, | ||
"color": {"type": "nominal", "field": "location"} | ||
} | ||
} | ||
], | ||
"name": "child__column_precipitation" | ||
}, | ||
{ | ||
"layer": [ | ||
{ | ||
"mark": "line", | ||
"encoding": { | ||
"y": {"aggregate": "mean", "field": "wind", "type": "quantitative"}, | ||
"x": {"timeUnit": "month", "field": "date", "type": "ordinal"}, | ||
"detail": {"timeUnit": "year", "type": "temporal", "field": "date"}, | ||
"color": {"type": "nominal", "field": "location"}, | ||
"opacity": {"value": 0.2} | ||
} | ||
}, | ||
{ | ||
"mark": "line", | ||
"encoding": { | ||
"y": {"aggregate": "mean", "field": "wind", "type": "quantitative"}, | ||
"x": {"timeUnit": "month", "field": "date", "type": "ordinal"}, | ||
"color": {"type": "nominal", "field": "location"} | ||
} | ||
} | ||
], | ||
"name": "child__column_wind" | ||
} | ||
] | ||
} |
102 changes: 17 additions & 85 deletions
102
examples/specs/normalized/repeat_layer_normalized.vl.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,94 +1,26 @@ | ||
{ | ||
"data": {"url": "data/weather.csv"}, | ||
"align": "all", | ||
"$schema": "https://vega.github.io/schema/vega-lite/v4.json", | ||
"description": "Summarized and per year weather information for Seatle and New York.", | ||
"columns": 3, | ||
"concat": [ | ||
"data": {"url": "data/movies.json"}, | ||
"layer": [ | ||
{ | ||
"layer": [ | ||
{ | ||
"mark": "line", | ||
"encoding": { | ||
"y": { | ||
"aggregate": "mean", | ||
"field": "temp_max", | ||
"type": "quantitative" | ||
}, | ||
"x": {"timeUnit": "month", "field": "date", "type": "ordinal"}, | ||
"detail": {"timeUnit": "year", "type": "temporal", "field": "date"}, | ||
"color": {"type": "nominal", "field": "location"}, | ||
"opacity": {"value": 0.2} | ||
} | ||
}, | ||
{ | ||
"mark": "line", | ||
"encoding": { | ||
"y": { | ||
"aggregate": "mean", | ||
"field": "temp_max", | ||
"type": "quantitative" | ||
}, | ||
"x": {"timeUnit": "month", "field": "date", "type": "ordinal"}, | ||
"color": {"type": "nominal", "field": "location"} | ||
} | ||
} | ||
], | ||
"name": "child__column_temp_max" | ||
}, | ||
{ | ||
"layer": [ | ||
{ | ||
"mark": "line", | ||
"encoding": { | ||
"y": { | ||
"aggregate": "mean", | ||
"field": "precipitation", | ||
"type": "quantitative" | ||
}, | ||
"x": {"timeUnit": "month", "field": "date", "type": "ordinal"}, | ||
"detail": {"timeUnit": "year", "type": "temporal", "field": "date"}, | ||
"color": {"type": "nominal", "field": "location"}, | ||
"opacity": {"value": 0.2} | ||
} | ||
}, | ||
{ | ||
"mark": "line", | ||
"encoding": { | ||
"y": { | ||
"aggregate": "mean", | ||
"field": "precipitation", | ||
"type": "quantitative" | ||
}, | ||
"x": {"timeUnit": "month", "field": "date", "type": "ordinal"}, | ||
"color": {"type": "nominal", "field": "location"} | ||
} | ||
} | ||
], | ||
"name": "child__column_precipitation" | ||
"mark": "line", | ||
"encoding": { | ||
"x": {"bin": true, "field": "IMDB_Rating", "type": "quantitative"}, | ||
"y": {"aggregate": "mean", "field": "US_Gross", "type": "quantitative"} | ||
}, | ||
"name": "child__layer_US_Gross" | ||
}, | ||
{ | ||
"layer": [ | ||
{ | ||
"mark": "line", | ||
"encoding": { | ||
"y": {"aggregate": "mean", "field": "wind", "type": "quantitative"}, | ||
"x": {"timeUnit": "month", "field": "date", "type": "ordinal"}, | ||
"detail": {"timeUnit": "year", "type": "temporal", "field": "date"}, | ||
"color": {"type": "nominal", "field": "location"}, | ||
"opacity": {"value": 0.2} | ||
} | ||
}, | ||
{ | ||
"mark": "line", | ||
"encoding": { | ||
"y": {"aggregate": "mean", "field": "wind", "type": "quantitative"}, | ||
"x": {"timeUnit": "month", "field": "date", "type": "ordinal"}, | ||
"color": {"type": "nominal", "field": "location"} | ||
} | ||
"mark": "line", | ||
"encoding": { | ||
"x": {"bin": true, "field": "IMDB_Rating", "type": "quantitative"}, | ||
"y": { | ||
"aggregate": "mean", | ||
"field": "Worldwide_Gross", | ||
"type": "quantitative" | ||
} | ||
], | ||
"name": "child__column_wind" | ||
}, | ||
"name": "child__layer_Worldwide_Gross" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{ | ||
"$schema": "https://vega.github.io/schema/vega-lite/v4.json", | ||
"description": "Summarized and per year weather information for Seatle and New York.", | ||
"data": {"url": "data/weather.csv"}, | ||
"repeat": {"column": ["temp_max", "precipitation", "wind"]}, | ||
"spec": { | ||
"layer": [ | ||
{ | ||
"mark": "line", | ||
"encoding": { | ||
"y": { | ||
"aggregate": "mean", | ||
"field": {"repeat": "column"}, | ||
"type": "quantitative" | ||
}, | ||
"x": { | ||
"timeUnit": "month", | ||
"field": "date", | ||
"type": "ordinal" | ||
}, | ||
"detail": { | ||
"timeUnit": "year", | ||
"type": "temporal", | ||
"field": "date" | ||
}, | ||
"color": {"type": "nominal", "field": "location"}, | ||
"opacity": {"value": 0.2} | ||
} | ||
}, | ||
{ | ||
"mark": "line", | ||
"encoding": { | ||
"y": { | ||
"aggregate": "mean", | ||
"field": {"repeat": "column"}, | ||
"type": "quantitative" | ||
}, | ||
"x": { | ||
"timeUnit": "month", | ||
"field": "date", | ||
"type": "ordinal" | ||
}, | ||
"color": {"type": "nominal", "field": "location"} | ||
} | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,24 @@ | ||
{ | ||
"$schema": "https://vega.github.io/schema/vega-lite/v4.json", | ||
"description": "Summarized and per year weather information for Seatle and New York.", | ||
"data": {"url": "data/weather.csv"}, | ||
"repeat": {"column": ["temp_max", "precipitation", "wind"]}, | ||
"data": { | ||
"url": "data/movies.json" | ||
}, | ||
"repeat": { | ||
"layer": ["US_Gross", "Worldwide_Gross"] | ||
}, | ||
"spec": { | ||
"layer": [ | ||
{ | ||
"mark": "line", | ||
"encoding": { | ||
"y": { | ||
"aggregate": "mean", | ||
"field": {"repeat": "column"}, | ||
"type": "quantitative" | ||
}, | ||
"x": { | ||
"timeUnit": "month", | ||
"field": "date", | ||
"type": "ordinal" | ||
}, | ||
"detail": { | ||
"timeUnit": "year", | ||
"type": "temporal", | ||
"field": "date" | ||
}, | ||
"color": {"type": "nominal", "field": "location"}, | ||
"opacity": {"value": 0.2} | ||
} | ||
"mark": "line", | ||
"encoding": { | ||
"x": { | ||
"bin": true, | ||
"field": "IMDB_Rating", | ||
"type": "quantitative" | ||
}, | ||
{ | ||
"mark": "line", | ||
"encoding": { | ||
"y": { | ||
"aggregate": "mean", | ||
"field": {"repeat": "column"}, | ||
"type": "quantitative" | ||
}, | ||
"x": { | ||
"timeUnit": "month", | ||
"field": "date", | ||
"type": "ordinal" | ||
}, | ||
"color": {"type": "nominal", "field": "location"} | ||
} | ||
"y": { | ||
"aggregate": "mean", | ||
"field": {"repeat": "layer"}, | ||
"type": "quantitative" | ||
} | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.