-
Notifications
You must be signed in to change notification settings - Fork 623
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
GitHub Actions Bot
committed
May 24, 2024
1 parent
28731db
commit 32e677f
Showing
21 changed files
with
883 additions
and
0 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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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", | ||
"description": "A bubbleplot showing horsepower on x, miles per gallons on y, and binned acceleration on size.", | ||
"background": "white", | ||
"padding": 5, | ||
"width": 200, | ||
"height": 200, | ||
"style": "cell", | ||
"data": [ | ||
{ | ||
"name": "source_0", | ||
"url": "data/cars.json", | ||
"format": {"type": "json"}, | ||
"transform": [ | ||
{ | ||
"type": "filter", | ||
"expr": "isValid(datum[\"Horsepower\"]) && isFinite(+datum[\"Horsepower\"]) && isValid(datum[\"Miles_per_Gallon\"]) && isFinite(+datum[\"Miles_per_Gallon\"]) && isValid(datum[\"Acceleration\"]) && isFinite(+datum[\"Acceleration\"])" | ||
} | ||
] | ||
} | ||
], | ||
"marks": [ | ||
{ | ||
"name": "marks", | ||
"type": "symbol", | ||
"style": ["point"], | ||
"from": {"data": "source_0"}, | ||
"encode": { | ||
"update": { | ||
"opacity": {"value": 0.7}, | ||
"fill": {"value": "transparent"}, | ||
"stroke": {"value": "#4c78a8"}, | ||
"ariaRoleDescription": {"value": "point"}, | ||
"description": { | ||
"signal": "\"Horsepower: \" + (format(datum[\"Horsepower\"], \"\")) + \"; Miles_per_Gallon: \" + (format(datum[\"Miles_per_Gallon\"], \"\")) + \"; Acceleration: \" + (format(datum[\"Acceleration\"], \"\"))" | ||
}, | ||
"x": {"scale": "x", "field": "Horsepower"}, | ||
"y": {"scale": "y", "field": "Miles_per_Gallon"}, | ||
"size": {"scale": "size", "field": "Acceleration"} | ||
} | ||
} | ||
} | ||
], | ||
"scales": [ | ||
{ | ||
"name": "x", | ||
"type": "linear", | ||
"domain": {"data": "source_0", "field": "Horsepower"}, | ||
"range": [0, {"signal": "width"}], | ||
"nice": true, | ||
"zero": true | ||
}, | ||
{ | ||
"name": "y", | ||
"type": "linear", | ||
"domain": {"data": "source_0", "field": "Miles_per_Gallon"}, | ||
"range": [{"signal": "height"}, 0], | ||
"nice": true, | ||
"zero": true | ||
}, | ||
{ | ||
"name": "size", | ||
"type": "linear", | ||
"domain": {"data": "source_0", "field": "Acceleration"}, | ||
"range": [4, {"signal": "PI * pow(0.2 * sqrt(width * height)/2, 2)"}], | ||
"zero": true | ||
} | ||
], | ||
"axes": [ | ||
{ | ||
"scale": "x", | ||
"orient": "bottom", | ||
"gridScale": "y", | ||
"grid": true, | ||
"tickCount": {"signal": "ceil(width/40)"}, | ||
"domain": false, | ||
"labels": false, | ||
"aria": false, | ||
"maxExtent": 0, | ||
"minExtent": 0, | ||
"ticks": false, | ||
"zindex": 0 | ||
}, | ||
{ | ||
"scale": "y", | ||
"orient": "left", | ||
"gridScale": "x", | ||
"grid": true, | ||
"tickCount": {"signal": "ceil(height/40)"}, | ||
"domain": false, | ||
"labels": false, | ||
"aria": false, | ||
"maxExtent": 0, | ||
"minExtent": 0, | ||
"ticks": false, | ||
"zindex": 0 | ||
}, | ||
{ | ||
"scale": "x", | ||
"orient": "bottom", | ||
"grid": false, | ||
"title": "Horsepower", | ||
"labelFlush": true, | ||
"labelOverlap": true, | ||
"tickCount": {"signal": "ceil(width/40)"}, | ||
"zindex": 0 | ||
}, | ||
{ | ||
"scale": "y", | ||
"orient": "left", | ||
"grid": false, | ||
"title": "Miles_per_Gallon", | ||
"labelOverlap": true, | ||
"tickCount": {"signal": "ceil(height/40)"}, | ||
"zindex": 0 | ||
} | ||
], | ||
"legends": [ | ||
{ | ||
"size": "size", | ||
"symbolType": "circle", | ||
"title": "Acceleration", | ||
"encode": { | ||
"symbols": { | ||
"update": { | ||
"fill": {"value": "transparent"}, | ||
"stroke": {"value": "#4c78a8"}, | ||
"opacity": {"value": 0.7} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,121 @@ | ||
{ | ||
"$schema": "https://vega.github.io/schema/vega/v5.json", | ||
"background": "white", | ||
"padding": 5, | ||
"width": 300, | ||
"height": 200, | ||
"style": "cell", | ||
"data": [ | ||
{ | ||
"name": "source_0", | ||
"url": "data/cars.json", | ||
"format": {"type": "json"}, | ||
"transform": [ | ||
{ | ||
"type": "filter", | ||
"expr": "isValid(datum[\"Horsepower\"]) && isFinite(+datum[\"Horsepower\"]) && isValid(datum[\"Acceleration\"]) && isFinite(+datum[\"Acceleration\"])" | ||
} | ||
] | ||
} | ||
], | ||
"marks": [ | ||
{ | ||
"name": "marks", | ||
"type": "symbol", | ||
"style": ["point"], | ||
"from": {"data": "source_0"}, | ||
"encode": { | ||
"update": { | ||
"opacity": {"value": 0.7}, | ||
"fill": {"value": "transparent"}, | ||
"stroke": {"value": "#4c78a8"}, | ||
"ariaRoleDescription": {"value": "point"}, | ||
"description": { | ||
"signal": "\"Horsepower: \" + (format(datum[\"Horsepower\"], \"\")) + \"; Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Acceleration: \" + (format(datum[\"Acceleration\"], \"\"))" | ||
}, | ||
"x": {"scale": "x", "field": "Horsepower"}, | ||
"y": {"scale": "y", "field": "Cylinders"}, | ||
"size": {"scale": "size", "field": "Acceleration"} | ||
} | ||
} | ||
} | ||
], | ||
"scales": [ | ||
{ | ||
"name": "x", | ||
"type": "linear", | ||
"domain": {"data": "source_0", "field": "Horsepower"}, | ||
"range": [0, {"signal": "width"}], | ||
"nice": true, | ||
"zero": true | ||
}, | ||
{ | ||
"name": "y", | ||
"type": "point", | ||
"domain": {"data": "source_0", "field": "Cylinders", "sort": true}, | ||
"range": [0, {"signal": "height"}], | ||
"padding": 0.5 | ||
}, | ||
{ | ||
"name": "size", | ||
"type": "linear", | ||
"domain": {"data": "source_0", "field": "Acceleration"}, | ||
"range": [ | ||
4, | ||
{ | ||
"signal": "PI * pow(0.4 * sqrt(width * height / length(domain(\"y\")))/2, 2)" | ||
} | ||
], | ||
"zero": true | ||
} | ||
], | ||
"axes": [ | ||
{ | ||
"scale": "x", | ||
"orient": "bottom", | ||
"gridScale": "y", | ||
"grid": true, | ||
"tickCount": {"signal": "ceil(width/40)"}, | ||
"domain": false, | ||
"labels": false, | ||
"aria": false, | ||
"maxExtent": 0, | ||
"minExtent": 0, | ||
"ticks": false, | ||
"zindex": 0 | ||
}, | ||
{ | ||
"scale": "x", | ||
"orient": "bottom", | ||
"grid": false, | ||
"title": "Horsepower", | ||
"labelFlush": true, | ||
"labelOverlap": true, | ||
"tickCount": {"signal": "ceil(width/40)"}, | ||
"zindex": 0 | ||
}, | ||
{ | ||
"scale": "y", | ||
"orient": "left", | ||
"grid": false, | ||
"title": "Cylinders", | ||
"zindex": 0 | ||
} | ||
], | ||
"legends": [ | ||
{ | ||
"size": "size", | ||
"symbolType": "circle", | ||
"title": "Acceleration", | ||
"encode": { | ||
"symbols": { | ||
"update": { | ||
"fill": {"value": "transparent"}, | ||
"stroke": {"value": "#4c78a8"}, | ||
"opacity": {"value": 0.7} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
125 changes: 125 additions & 0 deletions
125
examples/compiled/point_relative_size_discrete_2.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,125 @@ | ||
{ | ||
"$schema": "https://vega.github.io/schema/vega/v5.json", | ||
"background": "white", | ||
"padding": 5, | ||
"width": 300, | ||
"height": 200, | ||
"style": "cell", | ||
"data": [ | ||
{ | ||
"name": "source_0", | ||
"url": "data/cars.json", | ||
"format": {"type": "json", "parse": {"Cylinders": "number"}}, | ||
"transform": [ | ||
{ | ||
"type": "filter", | ||
"expr": "indexof([3,4], datum[\"Cylinders\"]) !== -1" | ||
}, | ||
{ | ||
"type": "filter", | ||
"expr": "isValid(datum[\"Horsepower\"]) && isFinite(+datum[\"Horsepower\"]) && isValid(datum[\"Acceleration\"]) && isFinite(+datum[\"Acceleration\"])" | ||
} | ||
] | ||
} | ||
], | ||
"marks": [ | ||
{ | ||
"name": "marks", | ||
"type": "symbol", | ||
"style": ["point"], | ||
"from": {"data": "source_0"}, | ||
"encode": { | ||
"update": { | ||
"opacity": {"value": 0.7}, | ||
"fill": {"value": "transparent"}, | ||
"stroke": {"value": "#4c78a8"}, | ||
"ariaRoleDescription": {"value": "point"}, | ||
"description": { | ||
"signal": "\"Horsepower: \" + (format(datum[\"Horsepower\"], \"\")) + \"; Cylinders: \" + (isValid(datum[\"Cylinders\"]) ? datum[\"Cylinders\"] : \"\"+datum[\"Cylinders\"]) + \"; Acceleration: \" + (format(datum[\"Acceleration\"], \"\"))" | ||
}, | ||
"x": {"scale": "x", "field": "Horsepower"}, | ||
"y": {"scale": "y", "field": "Cylinders"}, | ||
"size": {"scale": "size", "field": "Acceleration"} | ||
} | ||
} | ||
} | ||
], | ||
"scales": [ | ||
{ | ||
"name": "x", | ||
"type": "linear", | ||
"domain": {"data": "source_0", "field": "Horsepower"}, | ||
"range": [0, {"signal": "width"}], | ||
"nice": true, | ||
"zero": true | ||
}, | ||
{ | ||
"name": "y", | ||
"type": "point", | ||
"domain": {"data": "source_0", "field": "Cylinders", "sort": true}, | ||
"range": [0, {"signal": "height"}], | ||
"padding": 0.5 | ||
}, | ||
{ | ||
"name": "size", | ||
"type": "linear", | ||
"domain": {"data": "source_0", "field": "Acceleration"}, | ||
"range": [ | ||
4, | ||
{ | ||
"signal": "PI * pow(0.4 * sqrt(width * height / length(domain(\"y\")))/2, 2)" | ||
} | ||
], | ||
"zero": true | ||
} | ||
], | ||
"axes": [ | ||
{ | ||
"scale": "x", | ||
"orient": "bottom", | ||
"gridScale": "y", | ||
"grid": true, | ||
"tickCount": {"signal": "ceil(width/40)"}, | ||
"domain": false, | ||
"labels": false, | ||
"aria": false, | ||
"maxExtent": 0, | ||
"minExtent": 0, | ||
"ticks": false, | ||
"zindex": 0 | ||
}, | ||
{ | ||
"scale": "x", | ||
"orient": "bottom", | ||
"grid": false, | ||
"title": "Horsepower", | ||
"labelFlush": true, | ||
"labelOverlap": true, | ||
"tickCount": {"signal": "ceil(width/40)"}, | ||
"zindex": 0 | ||
}, | ||
{ | ||
"scale": "y", | ||
"orient": "left", | ||
"grid": false, | ||
"title": "Cylinders", | ||
"zindex": 0 | ||
} | ||
], | ||
"legends": [ | ||
{ | ||
"size": "size", | ||
"symbolType": "circle", | ||
"title": "Acceleration", | ||
"encode": { | ||
"symbols": { | ||
"update": { | ||
"fill": {"value": "transparent"}, | ||
"stroke": {"value": "#4c78a8"}, | ||
"opacity": {"value": 0.7} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.