Observable Plot is a high-level JavaScript plotting library built on top of (the low-level) d3.js. Uses the grammar of graphics style like ggplot2
.
Plot.plot({
// plot sizing
height: 800,
marginRight: 90,
marginLeft: 110,
x: { ticks: 0 }, // x-axis without labels
y: {
nice: true,
grid: true, // grid-lines
label: "y-label"
},
color: {type: "categorical"}, // colourscheme for stroke
marks: [
Plot.frame(), // box around the plot
Plot.dot(
data,
{
x: "variable",
y: "outcome_variable",
fy: "variable_to_facet", // facet y-direction
stroke: "categorical_variable",
}
)
]
})