I want to create a table in D3, no csv at the moment.
I found this package called d3-table which can help me in the job. The problem is that then when I create the table I have the following error “TypeError: d3.table is not a function”.
Here below is the code that I have wrote
<script src="https://d3js.org/d3.v4.js"></script>
<script src='d3-selection.v1.min.js'></script>
<script src='d3-table.min.js'></script>
let table = d3.table(); // I use d3.table as suggested on the page of the package
table.data([
{ id: 0, name: 'Freddie', feature_one: 0.1 },
{ id: 1, name: 'Daphne', feature_one: 0.2 },
{ id: 3, name: 'Nathan', feature_one: 3}
]).columns([
function (person) { return person.name; },
function (person) { return person.feature_one; }
]);
table('#someTable');
What I am missing or I am doing wrong?