feat(charts): Added resize observer and examples - #6528
Merged
Merged
Conversation
Collaborator
dlabrecq
force-pushed
the
5995-resize-observer
branch
from
October 29, 2021 17:23
470adf0 to
e13e4c3
Compare
dlabrecq
force-pushed
the
5995-resize-observer
branch
5 times, most recently
from
October 29, 2021 18:02
d0eff7d to
55030b0
Compare
dlabrecq
force-pushed
the
5995-resize-observer
branch
from
October 29, 2021 18:03
55030b0 to
1a60dcc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In order to resize charts, PatternFly examples currently use the window
resizeevent. However, this doesn't work with PatternFly's vertical navigation. For example,onNavToggledoesn't generate a window resize event when the nav pane is collapsed. This typically results in a chart that does not resize as expected.To resolve the issue, Cost Management has been using a
ResizeObserver. This resizes the chart whenever its parent container is resized. Not only for the window resize event, but it's also triggered by PatternFly's vertical navigationonNavToggle.We would like to contribute this code back to PatternFly and update the existing chart examples. Our
getResizeObservercode provides a workaround for Chrome and uses the window resize event as a fallback. The developer's existinghandleResizefunction remains unchanged.Fixes #5995
Area chart example
