Skip to content

Click the node and get data from API Dynamically #201

@ahmetsezen

Description

@ahmetsezen

Thank you for taking the time to report an issue with react-d3-tree!

Feel free to delete any questions that do not apply.

What is the behavior/output you expect?

We want to make our graph with API. We have a binary system as shown in figure below.
Screenshot from 2019-04-03 12-21-55

API link format: www.localhost.com/id/123 (example)
Our API format like that: this info related with 123. user (example)

[{
        name: 'Ali',
        user_id: 123,
        children: [
          {
            name: 'Veli',
            user_id:101,
            children: []
          },
          {
            name: 'Hasan',
            user_id:104,
            children: []
          },
]}]

this info related with 101. user

[{
        name: 'Veli',
        user_id: 101,
        children: [
          {
            name: 'Ahmet',
            user_id:998,
            children: []
          },
          {
            name: 'Mehmet',
            user_id:505,
            children: []
          },
]}]

For example, when we click the first node we want to send the request to our API then we want to show their children then we want to click their children then we want to get their children's children dynamically.Is it possible ? I hope you could get idea what we want.
Thanks from now.

Can you consistently reproduce the issue/create a reproduction case (e.g. on https://codesandbox.io)?

[Replace with your answer if relevant]

What version of react-d3-tree are you using?

"react-d3-tree": "^1.12.3",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions