-
Notifications
You must be signed in to change notification settings - Fork 185
color, opacity and radius legends #432
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
Conversation
The color legend should inherit the scale’s automatic label, no? E.g., here both the x-axis and color legend should be labeled with “random”, without you needing to specify a label explicitly. Plot.plot({
color: {
legend: true,
width: 120,
nice: true
},
marks: [
Plot.dot({length: 100}, {
x: Object.assign(() => Math.random(), {label: "random"}),
fill: Object.assign(() => Math.random(), {label: "random"})
})
]
}) |
Thank you for the review! I should have marked this as a Draft because there's quite a lot of screws to tighten. I think this shows that the "scale options" object (returned as plot.scales.color etc) should contain all the options that we passed and that were not consumed when building the scale. Also, I want more unit tests—for example I realize that calling Plot.scale on a diverging scale will crash if we don't tell it that the key is "color". |
deferring to #484 |
see #665 |
sequel of #425
build at https://observablehq.com/d/c324a9a466e66329
todo:
closes #23
closes #236
related: #397 #92