plotly / plotly.js

Open-source JavaScript charting library behind Plotly and Dash
https://plotly.com/javascript/
MIT License
17.06k stars 1.87k forks source link

Offer JavaScript support for built-in colorways or scales defined by name #5519

Open cs-manughian opened 3 years ago

cs-manughian commented 3 years ago

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
           }
jacksongoode commented 1 year ago

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

Lexachoc commented 9 months ago

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

jacksongoode commented 9 months ago

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 commented 8 months ago

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