I couldn't find a straightforward way to run d3 in JupyterLab, but when I load it this way:
%%html
<script src="https://d3js.org/d3.v7.min.js"></script>
This works:
%%javascript
d3.select(element)
.append("text")
.text("Hello World!");
Hello World!
Now I am trying to load a CSV file like this one:
Name,Count
A,10
B,15
C,14
To do so, I run this:
%%javascript
d3.csv("df.csv", function(data){
console.log(data);
});
This does not work and output is something like this:
What's the correct way to load CSV into JupyterLab using d3?