Created
November 13, 2019 22:15
-
-
Save anelson-vidscale/087b248659044811acdeedd196ad190e to your computer and use it in GitHub Desktop.
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
{ | |
"$schema": "https://vega.github.io/schema/vega/v3.json", | |
"width": 300, | |
"height": 240, | |
"padding": 5, | |
"data": [ | |
{ | |
"name": "table", | |
"values": [ | |
{"category":"A", "position":0, "value":0.1}, | |
{"category":"A", "position":1, "value":0.6}, | |
{"category":"A", "position":2, "value":0.9}, | |
{"category":"A", "position":3, "value":0.4}, | |
{"category":"B", "position":0, "value":0.7}, | |
{"category":"B", "position":1, "value":0.2}, | |
{"category":"B", "position":2, "value":1.1}, | |
{"category":"B", "position":3, "value":0.8}, | |
{"category":"C", "position":0, "value":0.6}, | |
{"category":"C", "position":1, "value":0.1}, | |
{"category":"C", "position":2, "value":0.2}, | |
{"category":"C", "position":3, "value":0.7} | |
] | |
} | |
], | |
"scales": [ | |
{ | |
"name": "color", | |
"type": "ordinal", | |
"domain": {"data": "table", "field": "position"}, | |
"range": {"scheme": "category20"} | |
} | |
], | |
"legends": [ | |
{ | |
"title" : "Colors for me", | |
"type" : "symbol", | |
"orient" : "bottom", | |
"fill": "color", | |
"offset": 50, | |
"direction": "horizontal", | |
"encode": { | |
"title": { "update": { "fontSize": {"value": 20} } }, | |
"symbols": { | |
"update": { | |
"shape" : {"value": "square" }, | |
"stroke": {"value": "transparent"} | |
} | |
}, | |
"labels": { | |
"interactive": true, | |
"update": { | |
"fontSize": {"value": 30}, | |
"fill": { "scale": "color", "field" : "value" } | |
} | |
} | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment