【发布时间】:2021-10-07 02:01:58
【问题描述】:
我找不到在 JupyterLab 中运行 d3 的直接方法,但是当我以这种方式加载它时:
%%html
<script src="https://d3js.org/d3.v7.min.js"></script>
这行得通:
%%javascript
d3.select(element)
.append("text")
.text("Hello World!");
Hello World!
现在我正在尝试加载这样的 CSV 文件:
Name,Count
A,10
B,15
C,14
为此,我运行这个:
%%javascript
d3.csv("df.csv", function(data){
console.log(data);
});
使用 d3 将 CSV 加载到 JupyterLab 的正确方法是什么?
【问题讨论】:
标签: javascript d3.js jupyter-notebook jupyter jupyter-lab