Skip to content

Commit 5c3ecdd

Browse files
swatch hover
1 parent c624f74 commit 5c3ecdd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: packages/python/plotly/_plotly_utils/colors/_swatches.py

+3
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ def _swatches_continuous(module_names, module_contents, template=None):
8282
orientation="h",
8383
y=[name] * n,
8484
x=[1] * n,
85+
customdata=[(x + 1) / n for x in range(n)],
8586
marker=dict(color=list(range(n)), colorscale=name, line_width=0),
87+
hovertemplate="%{customdata}",
88+
name=name,
8689
)
8790
for name, colors in reversed(sequences)
8891
],

0 commit comments

Comments
 (0)