Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions components/dash-core-components/src/fragments/Graph.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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 (
Expand Down