RashmithaK Posted on Nov 23, 2021 In d3 how to calculate dynamically width and edge? #javascript #d3 #tree Nov 23 '21 Comments: 1 Answers: 0 0 How to calculate the dy and width value dynamically? if the tree strcture changes every time. code Used below width will suit for the provided Json for a demo purpose dy = 154.66666666666666 width = 928 but if the json dynamically? and the same code doesnt work for below json… Open Full Question Top comments (1) Subscribe Personal Trusted User Create template Templates let you quickly answer FAQs or store snippets for re-use. Submit Preview Dismiss Collapse Expand eerk eerk eerk Follow Creative technologist, lecturer at University for Applied sciences. Interests: Typescript, Machine Learning, React, Arduino, Front-end, CSS Location Rotterdam Education Bachelor of Arts Work Lecturer Joined Mar 2, 2017 • Nov 23 '21 Dropdown menu Copy link Hide I have been looking for a solution for this too. It seems not possible to set the chart's width based on the amount of data. You have to set the width beforehand. Code of Conduct • Report abuse Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse
Top comments (1)
I have been looking for a solution for this too. It seems not possible to set the chart's width based on the amount of data. You have to set the width beforehand.