deephaven / deephaven-plugins

Deephaven Plugins
11 stars 15 forks source link

Send colors to lower case #5

Open jnumainville opened 1 year ago

jnumainville commented 1 year ago

non lowercase colors do not render properly with webgl (which we use by default), but do with svg. This is technically a plotly bug, but we can have a workaround of send colors to lower case to fix

All black here:

import deephaven.plot.express as dx
my_table = dx.data.iris(ticking=False)
scatter_plot_color_map = dx.scatter(
    my_table,
    x="sepal_width",
    y="sepal_length",
    color="species",
    # set a series to a specific color
    color_discrete_map=[{"virginica":"LemonChiffon", "setosa": "CornflowerBlue", "versicolor":"Salmon"}]
)

Fine here:

import deephaven.plot.express as dx
my_table = dx.data.iris(ticking=False)
scatter_plot_color_map = dx.scatter(
    my_table,
    x="sepal_width",
    y="sepal_length",
    color="species",
    # set a series to a specific color
    color_discrete_map={"virginica":"lemonchiffon", "setosa": "cornflowerblue", "versicolor":"salmon"}
)
jnumainville commented 1 year ago

Plotly js issue: https://github.com/plotly/plotly.js/issues/6685

mofojed commented 5 months ago

Fixed in plotly: https://github.com/plotly/plotly.js/pull/6928 That made it into v2.30.1: https://github.com/plotly/plotly.js/releases/tag/v2.30.1 We should just update plotly to resolve this issue.