setting color scheme in using vegalite
See original GitHub issueHi Guys,
Any idea why the following snippet shows the correct color scheme in a vega-lite editor, but when passing the snippet into folium.features.VegaLite, only the green color scheme is used?
screenshots below
{
"data": {
"values": [
{"value": 38,"variables": "median income"},
{"value": 43,"variables": "education"},
{"value": 16,"variables": "lone parent"},
{"value": 27,"variables": "unemployment rate"},
{
"value": 6,
"variables": "non speaking (eng or french)"
}
]
},
"description": "A simple bar chart with embedded data",
"encoding": {
"color": {
"field": "value",
"scale": {"domain": [1,55],"scheme": "yelloworangered"},
"type": "quantitative"
},
"x": {"field": "variables","type": "nominal"},
"y": {
"field": "value",
"type": "quantitative",
"scale": {"domain": [0,55]}
}
},
"mark": "bar"
}
In a vega-lite editor:
In folium,
vega = folium.features.VegaLite(snippet)
marker=folium.RegularPolygonMarker(ll)
popup = folium.Popup()
vega.add_to(popup)
popup.add_to(marker)
marker.add_to(m)
m
shows this:
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Color Schemes | Vega
Color schemes provide a set of named color palettes for both discrete and continuous color encodings. Vega provides a collection of perceptually-motivated color ......
Read more >How to color lines with specific colors in Vega-Lite?
You can set a custom Color Scheme using the scale.domain and scale.range arguments: "color": { "field": "symbol", "type": "nominal", ...
Read more >Vega Colour Schemes / Simon Lang - Observable
These schemes include both continuous color palettes, and a limited set of discrete palettes with a suffix that indicates the desired number of...
Read more >Tutorial · VegaLite.jl - Queryverse
What if we don't want to use a color scheme that signals any order? In that case we can change the type of...
Read more >Heatmaps with Vega-Lite – Codelibrary - Opendatasoft
Encoding block is the most important, it contains your axis settings, color and size settings, and the legend · quantitative : numerical values...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Conengmo Thanks Frank. You are correct. Setting the colour scheme works perfectly if I’m using Vega Lite 1 vernacular. For those who need it, here is an example:
This is a vegalite question and not folium. I am closing it b/c it is not actionable by our devs. Feel free to continue the discussion here though.