Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
## Fixed
- [#3353](https://github.com/plotly/dash/pull/3353) Support pattern-matching/dict ids in `dcc.Loading` `target_components`
- [#3371](https://github.com/plotly/dash/pull/3371) Fix allow_optional triggering a warning for not found input.
- [#3379](https://github.com/plotly/dash/pull/3379) Fix dcc.Graph backward compatibility with dash 2.0 for ddk.Graph

# [3.1.1] - 2025-06-29

Expand Down
32 changes: 27 additions & 5 deletions components/dash-core-components/src/fragments/Graph.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ import {
import PropTypes from 'prop-types';
import {graphPropTypes, graphDefaultProps} from '../components/Graph.react';

import LoadingElement from '../utils/LoadingElement';

/* global Plotly:true */

import ResizeDetector from '../utils/ResizeDetector';
import LoadingElement from '../utils/LoadingElement';

/**
* `autosize: true` causes Plotly.js to conform to the parent element size.
Expand Down Expand Up @@ -537,23 +536,46 @@ class PlotlyGraph extends Component {
}

render() {
const {className, id} = this.props;
const {className, id, loading_state} = this.props;
const style = this.getStyle();

if (window.dash_component_api) {
return (
<LoadingElement
id={id}
key={id}
className={className}
style={style}
ref={this.parentElement}
>
<ResizeDetector
onResize={this.graphResize}
targets={[this.parentElement, this.gd]}
/>
<div
ref={this.gd}
style={{height: '100%', width: '100%'}}
/>
</LoadingElement>
);
}
return (
<LoadingElement
<div
id={id}
key={id}
className={className}
style={style}
ref={this.parentElement}
data-dash-is-loading={
(loading_state && loading_state.is_loading) || undefined
}
>
<ResizeDetector
onResize={this.graphResize}
targets={[this.parentElement, this.gd]}
/>
<div ref={this.gd} style={{height: '100%', width: '100%'}} />
</LoadingElement>
</div>
);
}
}
Expand Down