如何在 Observable Plot 的折线图上使用标记?
How to use markes on a line graph in Observable Plot?
与 Observable Plot, I stumbled across the markers section in the API documentation 一起工作时。
但是,我不知道如何让它发挥作用。
假设我有以下标记:
Plot.line(data, {x: "timestamp", y: "val", curve: "natural"})
如何为这条线上的每个数据点添加标记?我无法从 API 文档中提取该信息(一个例子会很好)。以下版本不工作
Plot.line(data, {x: "timestamp", y: "val", curve: "natural", marker: true, markerEnd: "circle"})
Plot.line(data, {x: "timestamp", y: "val", curve: "natural", marker: "circle"})
备注:我不是在寻找使用额外 Plot.dot 的解决方案。
备注2:交叉发布到ObservableHQ forum
ObservableHQ forum 收到以下答复:
Markers have been available in main for just a week, but not yet pushed to npm and Observable.
If you need them now, here’s how you can build Plot from source:
git clone https://github.com/observablehq/plot.git
cd plot
yarn
yarn prepublishOnly
The files will then be available in the dist/ folder. Upload dist/plot.umd.js as a File Attachment, then create a cell with:
Plot = require(await FileAttachment(“plot.umd.js”).url())
因此,要么等待发布新版本,要么自己构建源代码。
与 Observable Plot, I stumbled across the markers section in the API documentation 一起工作时。
但是,我不知道如何让它发挥作用。
假设我有以下标记:
Plot.line(data, {x: "timestamp", y: "val", curve: "natural"})
如何为这条线上的每个数据点添加标记?我无法从 API 文档中提取该信息(一个例子会很好)。以下版本不工作
Plot.line(data, {x: "timestamp", y: "val", curve: "natural", marker: true, markerEnd: "circle"})
Plot.line(data, {x: "timestamp", y: "val", curve: "natural", marker: "circle"})
备注:我不是在寻找使用额外 Plot.dot 的解决方案。
备注2:交叉发布到ObservableHQ forum
ObservableHQ forum 收到以下答复:
Markers have been available in main for just a week, but not yet pushed to npm and Observable.
If you need them now, here’s how you can build Plot from source:
git clone https://github.com/observablehq/plot.git cd plot yarn yarn prepublishOnly
The files will then be available in the dist/ folder. Upload dist/plot.umd.js as a File Attachment, then create a cell with:
Plot = require(await FileAttachment(“plot.umd.js”).url())
因此,要么等待发布新版本,要么自己构建源代码。