Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Treantjs]: Grouping same node included by different parent - is it possible? #118

Open
egor-progger opened this issue Dec 22, 2024 · 0 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed treantjs Issue from treantjs repository

Comments

@egor-progger
Copy link
Owner

Description from treantjs issue

This is my tree: Screenshot from 2019-06-27 09-42-40

Is it possible to not repeat the treantAss1 node, but rather make it appear once and be referenced directly from: treantAss2 and treantMap2 nodes?

This is JS config:

var treantAss1 = {
  "text": {
    "number": "treantAss1"
  },
  "children": [
    {
      "text": {
        "number": "treantMap1"
      },
      "children": [
        {
          "text": {
            "number": "treantPN1"
          }
        }
      ]
    },
    {
      "text": {
        "number": "treantPN2"
      }
    }
  ]
};

var nodeStructure =
{
  "text": {
    "number": "treantAss3"
  },
  "children": [
    {
      "text": {
        "number": "treantAss2"
      },
      "children": [
        {
          "text": {
            "number": "treantPN3"
          }
        },
        treantAss1
      ]
    },
    {
      "text": {
        "number": "treantMap2"
      },
      "children": [
        treantAss1
      ]
    }
  ]
};


var chart_config = {
    chart: {
        rootOrientation: "WEST",
        container: "#basic-example",

      animateOnInit: true,

        node: {
            collapsable: true
        },
        animation: {
            nodeAnimation: "easeOutBounce",
            nodeSpeed: 700,
            connectorsAnimation: "bounce",
            connectorsSpeed: 700
        }
    },
    nodeStructure: nodeStructure
};

Treantjs issue link

fperucic/treant-js#148

@egor-progger egor-progger added help wanted Extra attention is needed good first issue Good for newcomers treantjs Issue from treantjs repository labels Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed treantjs Issue from treantjs repository
Projects
None yet
Development

No branches or pull requests

1 participant