@vx/responsive withParentSize height issue
See original GitHub issueFairly new to React, (first time writing an issue on github) but am really like vx so far. I am having issues with responsive height for my graph. I have set up parentHeight
and parentWidth
the exact same way as outlined from examples. When running my program, the width of my graph is perfectly responsive to the size of the browser screen. However, I am getting some really weird numbers for parentHeight
which constantly increases even when the height of the browser screen stays the same.
Any ideas of the problem? Source.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Vuetify v-list does not respect the height of its parent when ...
The problem is however is that it is forcing its parent column to increase in size when the number of <v-list-item> elements is...
Read more >Make virtual list to use all parent height · Issue #51
The problem is that Remain must be set, yet a very common use case involves using the parent's height because of responsive layouts....
Read more >line-height - CSS: Cascading Style Sheets - MDN Web Docs
The line-height CSS property sets the height of a line box. It's commonly used to set the distance between lines of text.
Read more >Size - CSS width and height
In responsive web design, width and height properties are sized based on the content inside, but can be more specifically defined using pixels...
Read more >Sizing · Bootstrap v5.0
Easily make an element as wide or as tall with our width and height utilities. On this page. Relative to the parent; Relative...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, @williaster’s solution worked for me! Thanks!
Hi @gkunthara, thanks for checking out vx!
Looks like the chart’s
height
is being calculated based onparentWidth * aspectRatio
https://github.com/gkunthara/Ethereum-Chart/blob/master/src/App.js#L82. This would mean your height would change even though theparentHeight
has not changed. Could try changingheight
to beparentHeight * aspectRatio
and tune the aspect ratio value to something you’re happy with.Let me know if that doesn’t fix it, happy to take a closer look.