I have a scatterplot where the stroke color for the points is a variable that can be selected from a dropdown. So, by default if a categorical variable is selected, the 10 color palette is used and if a continuous variable is selected, the turbo colormap is used. How do I set a custom palette and a custom colormap for both of these types of input in the same plot?
viewof x = Inputs.select(["depth","table","price"], {value: "depth", multiple: false, label: "X axis"})
viewof y = Inputs.select(["depth","table","price"], {value: "table", multiple: false, label: "Y axis"})
viewof col = Inputs.select(Object.keys(diamonds[0]).sort(), {value: "cut", multiple: false, label: "Color variable"})
Plot.plot({
color: {
legend: true
//type: "categorical",
//range: ["green", "purple", "orange", "yellow", "blue", "pink", "brown", "grey", "green", "lavender"]
},
marks: [
Plot.dot(diamonds, {
x: x,
y: y,
stroke: col,
tip: true,
channels: {Color: "color", Clarity: "clarity"}
})
],
grid: true
})
Here is a notebook that I am working with: