You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a search box, roughly you need to do the following:
Listen to seach input change event
In the handler function, get chart data
Find all nodes which match your search and set _expanded to it (you can also use _selected)
rerender graph
Rough implementation
functionhandleSearch(searchText){constdata=chart.data();data.forEach(d=>{if(d.nameOrOtherProperty.includes(searchText)){d._expanded=true;// if you just want expandd._selected=true;// if you also want it to be selected, not remember if it's possible to select multiple nodes so not sure if this will work}})chart.data(data).render()}
Yes, you can use following code. Probably not precise, but it will give you directions
function handleSearch(searchText) {
const data = chart.data();
data.forEach(d => {
if (d.value.includes(searchText)) {
d._expanded = true; // if you just want expand
d._selected = true; // if you also want it to be selected, not remember if it's possible to select multiple nodes so not sure if this will work
}
})
chart.data(data).render()
}
how can i lookup a node by the values of that node and focus it by expanding all parents and siblings
The text was updated successfully, but these errors were encountered: