<!DOCTYPE html>
<meta charset="utf-8">
<!-- load D3js -->
<script src="https://d3js.org/d3.v3.js"></script>
<!-- load D3plus after D3js -->
<script src="https://d3plus.org/js/d3plus.js"></script>
<!-- create container element for visualization -->
<div id="viz"></div>
<script>
// sample data array
d3.csv("DataVis.csv", function(data){
console.log(data);
});
// instantiate d3plus
var visualization = d3plus.viz()
.container("#viz") // container DIV to hold the visualization
.data(data) // data to use with the visualization
.type("tree_map") // visualization type
.id("Name") // key for which our data is unique on
.size("Amount Spent") // sizing of blocks
.draw() // finally, draw the visualization!
</script>
I keep getting the error "data is not defined" I attached my csv file here
I keep getting errors on this part and im not sure what to do. I would love any feedback
Data load will only be complete within the callback function. so you should only attempt to do something with that data after it's loaded.