Closed vojtamolda closed 4 years ago
Color scales can be constructed from array or dict literals and there's a lot of new built-in color scales.
Categorical color scales will be implemented as ColorWay
struct later. It doesn't fit the color scale paradigm that represents a smooth mapping.
Annoying angular and radial axes from the cyclical swatch can be removed only once #8 is fixed.
Implementation of the
ColorScale
enum currently lacks some of the options that are available in Python'splotly.express
module. It would be nice to include these in the Swift version too.Also since
ColorScale
is implemented as an enum it's not possible to write an extension that would define a new case. It would be better to transform it into a struct similar toOptionSet
with static members. This achieves the same level of user convenience and is more flexible. This would also allow a new convinient constructor that would take an array ofColor
s and translate it into a map with equal distances between the colors.For completeness here is the source code that holds the numeric values of the color-scales defined in the Python version:
https://github.com/plotly/plotly.py/blob/master/packages/python/plotly/_plotly_utils/colors/__init__.py https://github.com/plotly/plotly.py/blob/master/packages/python/plotly/_plotly_utils/colors/sequential.py
Another point worth considering is the support for categorical
ColorScale
s. There's a nice discussion here.