bumbeishvili / org-chart

Highly customizable org chart. Integrations available for Angular, React, Vue
https://stackblitz.com/edit/web-platform-o5t1ha
MIT License
928 stars 330 forks source link

nodeButtonWidth is not a function, same for Height, nodeButtonX and Y. #410

Open jaofrod opened 6 months ago

jaofrod commented 6 months ago

Here's my code:

 const chart = new OrgChart()
      .container('#professional-progression-board-container');

    // layout positions
    chart.layout('left')
      .svgHeight(window.innerHeight - 240)
      .compact(false)
      .rootMargin(50)
      .setActiveNodeCentered(false);

    // node
    chart.nodeContent(({ data }) => this.nodeContent({ data }));
    chart.nodeHeight(() => 150).nodeWidth(() => 150);

    // button
    chart.buttonContent((d) => this.buttonContent(d));
    chart.nodeButtonWidth(() => 60); // <- chart.nodeButtonWidth is not a function

    // link
    chart.linkUpdate((d) => this.linkUpdate(d));

    // render data
    chart.data(flattenedData).render();

I also tried the attr directly: chart.nodeButtonWidth(60), but got the same error.

The same happens for nodeButtonHeight, nodeButtonX and nodeButtonY, is there something im doing wrong?

bumbeishvili commented 6 months ago

@jaofrod can you provide an online sample where the issue is reproduced?

You can try extending this sample - https://stackblitz.com/edit/js-mfzkbs?file=index.html

jaofrod commented 5 months ago

@bumbeishvili maybe the problem is the way im loading the package?

the error occurs if i install the package via npm: https://stackblitz.com/edit/js-lxrwko?file=index.js