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]: how to add text on the connect edge? #122

Open
egor-progger opened this issue Dec 22, 2024 · 2 comments
Open

[Treantjs]: how to add text on the connect edge? #122

egor-progger opened this issue Dec 22, 2024 · 2 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

how to add text on the connect edge as the following? addtext

simple_chart_config = {
    chart: {
        container: "#tree-simple",
      rootOrientation: "WEST",
       levelSeparation: 450,
      nodeAlign: "BOTTOM",
       connectors: {
      type: "step",
      style: {
        "stroke-width": 2
      }
    },
    },
   
    nodeStructure: {
        text: { name: "Parent node" },
        children: [
            {
                text: { name: "First child" }
            },
            {
                text: { name: "Second child" }
            }
        ]
    }
};

var my_chart = new Treant(simple_chart_config);

Treantjs issue link

fperucic/treant-js#154

@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
@isidrohan
Copy link

To add text labels to the connectors (edges) between parent and child nodes in a Treant chart, we can use the HTMLclass property within the connectors configuration and then add CSS to style the labels.

@egor-progger
Copy link
Owner Author

To add text labels to the connectors (edges) between parent and child nodes in a Treant chart, we can use the HTMLclass property within the connectors configuration and then add CSS to style the labels.

@isidrohan , can you create pull request with your ideas?

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

2 participants