Code
= FileAttachment("diamonds.csv").csv({ typed: true})
data data
= FileAttachment("diamonds.csv").csv({ typed: true})
data data
= Inputs.table(data) viewof raw_table
Pick the variable for point color.
= Inputs.select(["carat","cut","color","clarity","depth","table","price"],{value: "cut", multiple: false, label: "Color variable"}) viewof col
= Inputs.select(["carat","depth","table","price"], {value: "carat", multiple: false, label: "X1 axis"})
viewof x1 = Inputs.select(["carat","depth","table","price"], {value: "depth", multiple: false, label: "Y1 axis"}) viewof y1
.plot({
Plotcolor: {legend: true},
marks: [
.dot(data, {
Plotx: x1,
y: y1,
stroke: col,
tip: true,
channels: {cut: "cut", color: "color", clarity: "clarity"}
}),
]grid: true
})
= Inputs.select(["carat","depth","table","price"], {value: "carat", multiple: false, label: "X2 axis"})
viewof x2 = Inputs.select(["carat","depth","table","price"], {value: "price", multiple: false, label: "Y2 axis"}) viewof y2
.plot({
Plotcolor: {legend: true},
marks: [
.dot(data, {
Plotx: x2,
y: y2,
stroke: col,
tip: true,
channels: {cut: "cut", color: "color", clarity: "clarity"}
}),
]grid: true
})
Tooltips are documented here.