ogobrecht / d3-force-apex-plugin

Oracle APEX Region Type Plugin: D3 Force Network Chart

Home Page:https://ogobrecht.github.io/d3-force-apex-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Any way to have graph height always be 100% of available space?

twointum opened this issue · comments

Love the plugin, I don't understand the height attribute. I wish I could just have it be 100% of the div space. The size changes when I expand the sidebars and it is making the graph either too small or run off the page. Thank you!

Hi,

the main problem with dynamic SVGs like the D3 force Layout is that you need to define the height and the width of the resulting graph because there are many depending things in the background. It is unfortunately not as easy as it is with images.

I think your graph has the option keepAspectRatioOnResize set to true and therefore your graphs height is changing when the available horizontal space is changing.

image

Please set this to false and play around with the option useDomParentWidth. Both options can help to have the graph acting like an image when the available space is changing. The aspect ratio is calculated by your given initial height and width values.

Ther are a lot of options and API methods available - have a look in the docs. By the way: each option is a link to the docs - so a simple click will show you a description and examples.

If you want to have something like a full screen view (the graph should occupy all available height) then you need to use the graphs JavaScript API to change the height on each window resize event.

Please describe in more details what you are trying to achieve.

Best regards
Ottmar

Hi Aaron,

thank you for your feedback! I will close the issue.

Best regards
Ottmar