File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
components/dash-core-components/src/fragments Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,6 @@ 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' ;
@@ -537,23 +535,32 @@ class PlotlyGraph extends Component {
537
535
}
538
536
539
537
render ( ) {
540
- const { className, id} = this . props ;
538
+ const { className, id, loading_state } = this . props ;
541
539
const style = this . getStyle ( ) ;
542
540
541
+ let isLoading ;
542
+ if ( window . dash_component_api !== undefined ) {
543
+ const ctx = window . dash_component_api . useDashContext ( ) ;
544
+ isLoading = ctx . useLoading ( ) ;
545
+ } else {
546
+ isLoading = loading_state && loading_state . is_loading ;
547
+ }
548
+
543
549
return (
544
- < LoadingElement
550
+ < div
545
551
id = { id }
546
552
key = { id }
547
553
className = { className }
548
554
style = { style }
549
555
ref = { this . parentElement }
556
+ data-dash-is-loading = { isLoading ? true : undefined }
550
557
>
551
558
< ResizeDetector
552
559
onResize = { this . graphResize }
553
560
targets = { [ this . parentElement , this . gd ] }
554
561
/>
555
562
< div ref = { this . gd } style = { { height : '100%' , width : '100%' } } />
556
- </ LoadingElement >
563
+ </ div >
557
564
) ;
558
565
}
559
566
}
You can’t perform that action at this time.
0 commit comments