-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from jonmmease/jonmmease/hide_certain_text_labels
Skip text and rule instances that have null color
- Loading branch information
Showing
8 changed files
with
7,160 additions
and
19 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6,934 changes: 6,934 additions & 0 deletions
6,934
avenger-vega-test-data/vega-scenegraphs/text/lasagna_plot.sg.json
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
-21 Bytes
(100%)
avenger-vega-test-data/vega-scenegraphs/vl-convert/maptile_background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
134 changes: 134 additions & 0 deletions
134
avenger-vega-test-data/vega-specs/text/lasagna_plot.vg.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,134 @@ | ||
{ | ||
"$schema": "https://vega.github.io/schema/vega/v5.json", | ||
"background": "white", | ||
"padding": 5, | ||
"width": 300, | ||
"height": 100, | ||
"style": "cell", | ||
"data": [ | ||
{ | ||
"name": "source_0", | ||
"url": "https://cdn.jsdelivr.net/npm/[email protected]/data/stocks.csv", | ||
"format": {"type": "csv", "parse": {"date": "date"}, "delimiter": ","}, | ||
"transform": [ | ||
{"type": "filter", "expr": "(datum.symbol !== 'GOOG')"}, | ||
{ | ||
"field": "date", | ||
"type": "timeunit", | ||
"units": ["year", "month", "date"], | ||
"as": ["yearmonthdate_date", "yearmonthdate_date_end"] | ||
}, | ||
{ | ||
"type": "aggregate", | ||
"groupby": ["yearmonthdate_date", "symbol"], | ||
"ops": ["sum"], | ||
"fields": ["price"], | ||
"as": ["sum_price"] | ||
}, | ||
{ | ||
"type": "filter", | ||
"expr": "isValid(datum[\"sum_price\"]) && isFinite(+datum[\"sum_price\"])" | ||
} | ||
] | ||
} | ||
], | ||
"marks": [ | ||
{ | ||
"name": "marks", | ||
"type": "rect", | ||
"style": ["rect"], | ||
"from": {"data": "source_0"}, | ||
"encode": { | ||
"update": { | ||
"fill": {"scale": "color", "field": "sum_price"}, | ||
"description": { | ||
"signal": "\"Time: \" + (timeFormat(datum[\"yearmonthdate_date\"], '%Y')) + \"; symbol: \" + (isValid(datum[\"symbol\"]) ? datum[\"symbol\"] : \"\"+datum[\"symbol\"]) + \"; Price: \" + (format(datum[\"sum_price\"], \"\"))" | ||
}, | ||
"x": {"scale": "x", "field": "yearmonthdate_date"}, | ||
"width": {"signal": "max(0.25, bandwidth('x'))"}, | ||
"y": {"scale": "y", "field": "symbol"}, | ||
"height": {"signal": "max(0.25, bandwidth('y'))"} | ||
} | ||
} | ||
} | ||
], | ||
"scales": [ | ||
{ | ||
"name": "x", | ||
"type": "band", | ||
"domain": { | ||
"data": "source_0", | ||
"field": "yearmonthdate_date", | ||
"sort": true | ||
}, | ||
"range": [0, {"signal": "width"}], | ||
"paddingInner": 0, | ||
"paddingOuter": 0 | ||
}, | ||
{ | ||
"name": "y", | ||
"type": "band", | ||
"domain": {"data": "source_0", "field": "symbol", "sort": true}, | ||
"range": [0, {"signal": "height"}], | ||
"paddingInner": 0, | ||
"paddingOuter": 0 | ||
}, | ||
{ | ||
"name": "color", | ||
"type": "linear", | ||
"domain": {"data": "source_0", "field": "sum_price"}, | ||
"range": "heatmap", | ||
"interpolate": "hcl", | ||
"zero": false | ||
} | ||
], | ||
"axes": [ | ||
{ | ||
"scale": "x", | ||
"orient": "bottom", | ||
"grid": false, | ||
"title": "Time", | ||
"format": "%Y", | ||
"labelAngle": 0, | ||
"labelOverlap": false, | ||
"formatType": "time", | ||
"labelBaseline": "top", | ||
"tickMinStep": { | ||
"signal": "datetime(2001, 0, 2, 0, 0, 0, 0) - datetime(2001, 0, 1, 0, 0, 0, 0)" | ||
}, | ||
"encode": { | ||
"labels": { | ||
"update": { | ||
"fill": [ | ||
{ | ||
"test": "month(datum.value) == 1 && date(datum.value) == 1", | ||
"value": "black" | ||
}, | ||
{"value": null} | ||
] | ||
} | ||
}, | ||
"ticks": { | ||
"update": { | ||
"stroke": [ | ||
{ | ||
"test": "month(datum.value) == 1 && date(datum.value) == 1", | ||
"value": "black" | ||
}, | ||
{"value": null} | ||
] | ||
} | ||
} | ||
}, | ||
"zindex": 1 | ||
}, | ||
{"scale": "y", "orient": "left", "grid": false, "zindex": 1} | ||
], | ||
"legends": [ | ||
{ | ||
"title": "Price", | ||
"fill": "color", | ||
"gradientLength": {"signal": "clamp(height, 64, 200)"} | ||
} | ||
] | ||
} |
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
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