File tree Expand file tree Collapse file tree 2 files changed +28
-5
lines changed
components/dash-core-components/src/fragments Expand file tree Collapse file tree 2 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1111## Fixed
1212- [#3353](https://github.com/plotly/dash/pull/3353) Support pattern-matching/dict ids in `dcc.Loading` `target_components`
1313- [#3371](https://github.com/plotly/dash/pull/3371) Fix allow_optional triggering a warning for not found input.
14+ - [#3379](https://github.com/plotly/dash/pull/3379) Fix dcc.Graph backward compatibility with dash 2.0 for ddk.Graph
1415
1516# [3.1.1] - 2025-06-29
1617
Original file line number Diff line number Diff line change @@ -13,11 +13,10 @@ import {
1313import PropTypes from 'prop-types' ;
1414import { graphPropTypes , graphDefaultProps } from '../components/Graph.react' ;
1515
16- import LoadingElement from '../utils/LoadingElement' ;
17-
1816/* global Plotly:true */
1917
2018import ResizeDetector from '../utils/ResizeDetector' ;
19+ import LoadingElement from '../utils/LoadingElement' ;
2120
2221/**
2322 * `autosize: true` causes Plotly.js to conform to the parent element size.
@@ -537,23 +536,46 @@ class PlotlyGraph extends Component {
537536 }
538537
539538 render ( ) {
540- const { className, id} = this . props ;
539+ const { className, id, loading_state } = this . props ;
541540 const style = this . getStyle ( ) ;
542541
542+ if ( window . dash_component_api ) {
543+ return (
544+ < LoadingElement
545+ id = { id }
546+ key = { id }
547+ className = { className }
548+ style = { style }
549+ ref = { this . parentElement }
550+ >
551+ < ResizeDetector
552+ onResize = { this . graphResize }
553+ targets = { [ this . parentElement , this . gd ] }
554+ />
555+ < div
556+ ref = { this . gd }
557+ style = { { height : '100%' , width : '100%' } }
558+ />
559+ </ LoadingElement >
560+ ) ;
561+ }
543562 return (
544- < LoadingElement
563+ < div
545564 id = { id }
546565 key = { id }
547566 className = { className }
548567 style = { style }
549568 ref = { this . parentElement }
569+ data-dash-is-loading = {
570+ ( loading_state && loading_state . is_loading ) || undefined
571+ }
550572 >
551573 < ResizeDetector
552574 onResize = { this . graphResize }
553575 targets = { [ this . parentElement , this . gd ] }
554576 />
555577 < div ref = { this . gd } style = { { height : '100%' , width : '100%' } } />
556- </ LoadingElement >
578+ </ div >
557579 ) ;
558580 }
559581}
You can’t perform that action at this time.
0 commit comments