-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Chart does not resize/not responsive when parent container is resized #182
Comments
@dez1729 I believe you're looking to something like this: https://www.npmjs.com/package/@thalesrc/resize-manager A library using it: https://www.npmjs.com/package/@thalesrc/ng-utils#user-content-resize |
I've done just that actually (with built in event from the component I was using), and in my subscription call "window.dispatchEvent(new Event('resize'))" I got from another thread. However, this produces a noticeable lag. Is there a native call that the chart would respond directly instead of being triggered a round-about way. |
you could use the constructor(public plotlyService: PlotlyService) {}
this.resizeService.observe(this.el.nativeElement).subscribe(async ({width, height}) => {
const plotly = await this.plotlyService.getPlotly();
/** Here you have the plotly object from plotly.js */
/** ... */
}); Then you can use the functions from |
@dez1729 Same problem here: |
"window.dispatchEvent(new Event('resize'))" Just write this statement in the function which opens the side panel for you or resizes parent container for you. |
Seems the responsiveness only applies when the browser is resized, but not if the container is resize (say using angular-split or resize under material component etc), so the chart will not resize unless manually trigger the browser resize event in code. Is there any way to listen for resize event within a container?
The text was updated successfully, but these errors were encountered: