From 105295a23c94d840c95195996d1f729ef6da05d3 Mon Sep 17 00:00:00 2001 From: philippe Date: Wed, 27 Aug 2025 10:32:01 -0400 Subject: [PATCH] Fix responsive dcc.Graph infinite scaling --- .../src/fragments/Graph.react.js | 24 +------------------ 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/components/dash-core-components/src/fragments/Graph.react.js b/components/dash-core-components/src/fragments/Graph.react.js index c33feebf6f..554229788e 100644 --- a/components/dash-core-components/src/fragments/Graph.react.js +++ b/components/dash-core-components/src/fragments/Graph.react.js @@ -457,27 +457,6 @@ class PlotlyGraph extends Component { }); } - getStyle() { - const {responsive} = this.props; - let {style} = this.props; - - // When there is no forced responsive style, return the original style property - if (!responsive) { - return style; - } - - // Otherwise, if the height is not set, we make the graph size equal to the parent one - if (!style) { - style = {}; - } - - if (!style.height) { - return Object.assign({height: '100%'}, style); - } - - return style; - } - componentDidMount() { const p = this.plot(this.props); this._queue = this.amendTraces(p, {}, this.props); @@ -536,8 +515,7 @@ class PlotlyGraph extends Component { } render() { - const {className, id, loading_state} = this.props; - const style = this.getStyle(); + const {className, id, loading_state, style} = this.props; if (window.dash_component_api) { return (