-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
initial implementation of layout.colorscale
#3274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
6b1b940
0e98c5b
6e61f3b
f5bcb71
a299ce0
2a20414
2460fc3
0c13592
93ce241
d263a7f
84f0ea8
ee222d5
75e8910
e50a6aa
dca4350
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -188,6 +188,29 @@ module.exports = { | |
editType: 'calc', | ||
description: 'Sets the default trace colors.' | ||
}, | ||
colorscale: { | ||
sequential: { | ||
valType: 'colorscale', | ||
dflt: false, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What would happen if we set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's another way of doing it and I think it's much better than the current approach. We'd have the defaults clearly defined in the attributes where they should be 🎉 |
||
role: 'style', | ||
editType: 'calc', | ||
description: 'Sets the default sequential colorscale for positive values.' | ||
}, | ||
sequentialminus: { | ||
valType: 'colorscale', | ||
dflt: false, | ||
role: 'style', | ||
editType: 'calc', | ||
description: 'Sets the default sequential colorscale for negative values.' | ||
}, | ||
diverging: { | ||
valType: 'colorscale', | ||
dflt: false, | ||
role: 'style', | ||
editType: 'calc', | ||
description: 'Sets the default diverging colorscale.' | ||
} | ||
}, | ||
datarevision: { | ||
valType: 'any', | ||
role: 'info', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's put these new attributes and default logic in the
Colorscale
component module.Create two new files:
and link their
exports
in src/components/colorscale/index.js aslayoutAttributes
andsupplyLayoutDefaults
. The latter will get automatically picked up inPlotly.supplyLayoutModuleDefaults
here:plotly.js/src/plots/plots.js
Lines 1512 to 1518 in 695f311