Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8272669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:12:23+00:00 2026-06-08T07:12:23+00:00

I am using Mike Bostock’s tree layout as the basis for a searchable tree.

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T07:12:24+00:00Added an answer on June 8, 2026 at 7:12 am

    If you code is based off the code from example you linked, then this should be pretty simple.

    When the page loads initially, call the toggle function for every node to ensure that all children are hidden. Now that all nodes except the root are hidden, you need to use the _children attribute of each node to find the children. Once you find the child that matches the name that is searched for, call toggle on it and every parent back up to the root. To re-display the graph with the toggled nodes call update.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Mike Bluestein's article, http://mikebluestein.wordpress.com/2009/09/27/using-monotouch-with-the-net-library-for-the-google-data-api/ , to build an application that communicates
I have created a basic site using ASP.NET routing according to Mike Ormond's example
Using import datetime in python, is it possible to take a formatted time/date string
When using the Ext.Lib Name Picker control connected to the NAB, the default is
I am using software which uses regular expressions to search text files. Files matching
Very strange results using NSPredicate combined with a search box on a tableview and
I am using JavaScript. I have var myobj = { "one": { "name": "paul",
I am trying to apply Mike Chen's answer here , using SDK 3.0. In
I'm currently working on a project using C++ and DirectX9 and I'm looking into
Recursive renaming files using PS is trivial (variation on example from Mike Ormond's blog

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.