plotly.js icon indicating copy to clipboard operation
plotly.js copied to clipboard

Offer JavaScript support for built-in colorways or scales defined by name (i.e. 'Qualitative Dark')

Open cs-manughian opened this issue 4 years ago • 3 comments

It would be convenient not to have to manually define the colorway or scales for certain plots, such as bubble plots, with an array of colors. I'd like to specify it via import or string, for example:

layout = {
              xaxis: {
                range: ...
              },
              yaxis: {
                range: ...
              },
              title: 'My plot',
              colorway: ['#f3cec9', '#e7a4b6', '#cd7eaf', '#a262a9', '#6f4d96', '#3d3b72', '#182844'], // Here is where I'd like to just specify a theme basically
           }

cs-manughian avatar Feb 23 '21 04:02 cs-manughian

This is something Plotly has in Python https://plotly.com/python/templates/ but not JS. I really hope this gets ported over.

jacksongoode avatar Jun 15 '23 23:06 jacksongoode

I end up with a hard code with the color code from here: https://github.com/plotly/plotly.py/blob/master/packages/python/plotly/_plotly_utils/colors/qualitative.py

see the render effect for all color sequences here: https://plotly.com/python/discrete-color/#color-sequences-in-plotly-express

Lexachoc avatar Feb 02 '24 23:02 Lexachoc

I think the primary purpose in my mind would be complex color schemas like dark mode when then user defined colorways could exist as a layer on top.

jacksongoode avatar Feb 06 '24 04:02 jacksongoode

Is there anyone from the Plotly team to explain why the design decision was made not to expose preset themes to the js lib?

jacksongoode avatar Mar 05 '24 17:03 jacksongoode