Move code into sunburst.js
-
Get the {width, height}
as options from the sunburst function instead of hard coding like this -
Modify the sunburst to handle different radiuses for each level. (Later, we'll see how to make these functions, not just values) -
Modify to use layer
instead of.append()
. See how it's implemented ingramex-network
-
Instead of .join("path")
, again uselayer()
. See code-
Avoid .attr("fill-opacity", 0.7)
, etc.
-
-
Return the path layer from sunburst()
-
In sales.html, use the returned layer and color that. The coloring should NOT be inside sunburst(). It should be outside in sales.html -
In sunburst()
, add a<g>
layer for the text, but don't add the text-
Avoid .attr("fill", "white")
and.style("font-size", "12px")
etc..
-
-
In sales.html, use the returned layer for text and add the text there -
In sunburst()
, add click interactivity