-
vizulyJanuary 4, 2018 at 12:37 pm #8131
Hello Chetan,
I just saw this post, sorry about the delayed response.
To do the above you would want to apply a filter to the data set you are passing into the tree. Once you filter the data you would simply do something like this:
viz.data(myFilteredData).update();
Cheers,
Tom
ankit255February 4, 2018 at 6:19 am #8141Code below fails when I add the filter line – any ideas? ‘Dt’ is a variable.
viz.data(data) // Expects hierarchical array of objects. .width(600) // Width of component .height(600) // Height of component .children(function (d) { return d.values }) // Denotes the property that holds child object array .key(function (d) { return d.id }) // Unique key .value(function (d) { return Number(d["agg_" + valueField]) }) // The property of the datum that will be used for the branch and node size .fixedSpan(-1) // fixedSpan > 0 will use this pixel value for horizontal spread versus auto size based on viz width .branchPadding(.07) .filter(function (d) { return d.Dept== Dt;}) .label(function (d) { // returns label for each node. return trimLabel(d.key)}) .on("measure",onMeasure) // Make any measurement changes .on("mouseover",onMouseOver) // mouseover callback - all viz components issue these events .on("mouseout",onMouseOut) // mouseout callback - all viz components issue these events .on("click",onClick);
vizulyFebruary 5, 2018 at 10:13 am #8142Hello Chetan,
The Weighted Tree does not support a filter operation directly as you are declaring it.
What you would want to do is apply that filter to your data array directly before passing it into the tree.
Cheers,
Tom
-
|
Viewing 2 reply threads
You must be logged in to reply to this topic.