-
vizulyApril 17, 2016 at 6:02 pm #6111
Hi Paul,
You are headed in the right direction. Typically you want to use the theme/skin to adjust the styles of the visualization and the viz code to update to update layout. Something like the stroke-width is a little of both. In this case, the stroke width is being set in the viz/weightedtree.js file, in the update() routine at line 322:
link.transition() .duration(scope.duration) .attr("d", diagonal) .style("stroke-width",function (d) { return nodeRadius(d.target)*2});
You have two choices. You can either modify this core file OR adjust it after the fact in the theme file (theme/weightedtree.js) at line 119:
selection.selectAll(".vz-weighted_tree-link") .style("stroke",function (d) { return skin.link_stroke(d) }) .style("stroke-opacity", function (d) { return skin.link_stroke_opacity(d)});
Probably best to make both changes in the theme file. For the stroke color you could simply do something link this in the theme file.
selection.selectAll(".vz-weighted_tree-link") .style("stroke-width",function (d) { return myConstantWidth; }) .style("stroke",function (d) { return (d.myValue > 0 && d.myValue < 4) ? "#0F0" : (d.myValue >=4 && d.myValue <=7) ? "#FF0" : "#F00" })
(I am just writing this off the top of my head as an example, so you would want to test it out.
I hope that helps.
– Tom
You must be logged in to reply to this topic.
© 2024 — vizuly.io