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/).
11
11
## Fixed
12
12
- [#3353](https://github.com/plotly/dash/pull/3353) Support pattern-matching/dict ids in `dcc.Loading` `target_components`
13
13
- [#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
14
15
15
16
# [3.1.1] - 2025-06-29
16
17
Original file line number Diff line number Diff line change @@ -13,11 +13,10 @@ import {
13
13
import PropTypes from 'prop-types' ;
14
14
import { graphPropTypes , graphDefaultProps } from '../components/Graph.react' ;
15
15
16
- import LoadingElement from '../utils/LoadingElement' ;
17
-
18
16
/* global Plotly:true */
19
17
20
18
import ResizeDetector from '../utils/ResizeDetector' ;
19
+ import LoadingElement from '../utils/LoadingElement' ;
21
20
22
21
/**
23
22
* `autosize: true` causes Plotly.js to conform to the parent element size.
@@ -537,23 +536,46 @@ class PlotlyGraph extends Component {
537
536
}
538
537
539
538
render ( ) {
540
- const { className, id} = this . props ;
539
+ const { className, id, loading_state } = this . props ;
541
540
const style = this . getStyle ( ) ;
542
541
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
+ }
543
562
return (
544
- < LoadingElement
563
+ < div
545
564
id = { id }
546
565
key = { id }
547
566
className = { className }
548
567
style = { style }
549
568
ref = { this . parentElement }
569
+ data-dash-is-loading = {
570
+ ( loading_state && loading_state . is_loading ) || undefined
571
+ }
550
572
>
551
573
< ResizeDetector
552
574
onResize = { this . graphResize }
553
575
targets = { [ this . parentElement , this . gd ] }
554
576
/>
555
577
< div ref = { this . gd } style = { { height : '100%' , width : '100%' } } />
556
- </ LoadingElement >
578
+ </ div >
557
579
) ;
558
580
}
559
581
}
You can’t perform that action at this time.
0 commit comments