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

Dynamic container_height to match svg height #483

Open
jwcooper opened this issue Dec 22, 2024 · 2 comments
Open

Dynamic container_height to match svg height #483

jwcooper opened this issue Dec 22, 2024 · 2 comments

Comments

@jwcooper
Copy link

Is there a way on the main branch to set the container_height to match that of the svg?

In the code it appears the container_height is set to 300 by default, and that the gv-grid-height variable is set based on that value with px appended.

In the previous version of the code (likely 0.6.1) the height of the container would stretch to match the svg height.

@jwcooper
Copy link
Author

Quick hack for those looking:

    let style = document.querySelector(".gantt-container").style;
    style.setProperty(
      "--gv-grid-height",
      this.gantt.$svg.getBBox().height + "px",
    );

Will look at the code later to see if there is a better way to do this though.

@safwansamsudeen
Copy link
Collaborator

Hey, thanks - will add an auto option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants