Open keithpjolley opened 2 years ago
Can you create an example that uses fetched data? I'm trying to do something like:
var myChart = d3.x3d.chart.scatterPlot() .mappings({ x: 'x', y: 'y', z: 'z', size: 'size', color: 'color' }) .colors(d3.schemeRdYlGn[8]) .sizeRange([0.1, 1.5]); var chartHolder = d3.select("#chartholder"); const refreshChart = () => { var myData = d3.x3d.randomData.dataset6(200); chartHolder.datum(myData).call(myChart); }; d3.select("#refresh").attr("onclick", "refreshChart2()"); refreshChart(); d3.json('data1.json').then((data) => { //refreshChart(); }).catch(() => { console.log('fail'); });
but I can't figure out why the above works but if I comment out the first refreshChart() and uncomment out the second it fails.
refreshChart()
And yes I'm aware that the refreshChart() doesn't actually use the data I'm pulling. I wanted to eliminate that as a source of error.
Can you create an example that uses fetched data? I'm trying to do something like:
but I can't figure out why the above works but if I comment out the first
refreshChart()
and uncomment out the second it fails.