If I change the value of the margin.top to say -700, which brings the chart into view, the height of the SVG is now changed to something considerably smaller and it is still not visible.
--> builder.js, line 28, let height = opts.height + opts.margin.top + opts.margin.bottom;
I'm confused. Is this the right way to align the SVG? I'm missing something.
Aligning the actual SVG is best done from "the outside" using CSS like you would any other div or object.
When initialising dTree the only thing you basically control is the size of the SVG.
Hi!
I'm confused about how to align the chart to the top of the browser/div and centering it. Here's what I have for dTree settings:
const w = window.innerWidth; const h = window.innerHeight; ... width: w,height: h, margin: { top: 0, right: 0, bottom: 0, left: 0 }
With the above settings, the chart is translated to w/2 and 0. It is not viewable:
--> builder.js, line 33, d3.event.transform.translate(width / 2, opts.margin.top)); --> builder.js, line 43, 'translate(' + width / 2 + ',' + opts.margin.top + ')'
If I change the value of the margin.top to say -700, which brings the chart into view, the height of the SVG is now changed to something considerably smaller and it is still not visible.
--> builder.js, line 28, let height = opts.height + opts.margin.top + opts.margin.bottom;
I'm confused. Is this the right way to align the SVG? I'm missing something.
Any help is appreciated.
Sheila