Create new named color scales in config section
See original GitHub issueIs it possible to add new named color scales in config section? Like this example:
"config":{
. . .
"newColorScaleName":["#800000","#FF0000","#FFA07A"]
. . .
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Continuous color scales and color bars in Python - Plotly
How to set, create and control continuous color scales and color bars in scatter, bar, map and heatmap figures. New to Plotly?
Read more >How to create color scales [Conditional Formatting]
To create a new color scale and also edit settings before creation then follow these steps: Select cells. Go to tab "Home" on...
Read more ><named-color> - CSS: Cascading Style Sheets | MDN
The <named-color> CSS data type is the name of a color, such as red , blue , black , or lightseagreen . Syntactically,...
Read more >Python Plotly: How to set up a color palette? - GeeksforGeeks
Let's see a few approaches to how we can set up a color palette. Method 1: Setting up the color palette for continuous...
Read more >12.6 Using a Manually Defined Palette for a Continuous ...
In the example here, we'll specify the colors for a continuous variable using various gradient scales (Figure 12.12). The colors can be named, ......
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
I believe the issue is that here the spec is defining new named scale ranges and then trying to look them up dynamically. However, named ranges like
"category10"
are added to the specification at parse time, and so can not be accessed at runtime using signals.While schemes can be dynamically added (via the Vega API) we do not currently support defining new scheme entries directly in the config. In general this would be difficult to do, as schemes are not defined per-view but rather for the entire Vega library. So if multiple specifications were used on the same page, they might conflict in their use of schemes. We’d have to invent a tiered approach that allowed schemes to be name-spaced within a View only.
As a way of avoiding all of this, I would recommend defining your custom color palettes in an individual signal instead, and then looking them up by key to provide dynamic scale ranges. Here’s an example.
As far as I understand the issue is that
does not create a new color scale but instead sets the default range. I marked this issue as a feature request since I don’t know whether we support what you are asking for right now.