I am using Mike Bostock's tree layout as the basis for a searchable tree. I am wondering if it is possible for a user to input a name into a search box and the tree to open its nodes to the named node, if it found within the tree.
`{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},
{"name": "CommunityStructure", "size": 3812},
{"name": "HierarchicalCluster", "size": 6714},
{"name": "MergeEdge", "size": 743}
]
},
{
"name": "graph",
"children": [
{"name": "BetweennessCentrality", "size": 3534},
{"name": "LinkDistance", "size": 5731},
{"name": "MaxFlowMinCut", "size": 7840},
{"name": "ShortestPaths", "size": 5914},
{"name": "SpanningTree", "size": 3416}
]
},
{
"name": "optimization",
"children": [
{"name": "AspectRatioBanker", "size": 7074}
]
}
]
}, ...etc`
So for example the nodes are all closed down, only the root node "flare" is showing on screen and the user searches for "MergeEdge" which is found as a leaf node under "cluster" which is under "analytics". The tree would then open only those nodes required to show the children of "cluster" because that is where "MergeEdge" was found. I have tried with jsonpath.js but didn't get very far and with the answer to this question which I was getting returns with but only when the nodes are open displaying the one I'm searching for.
I want to use different json files that may have too many nodes to display all of them at once.