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 {
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' ;
@@ -537,23 +535,32 @@ class PlotlyGraph extends Component {
537535 }
538536
539537 render ( ) {
540- const { className, id} = this . props ;
538+ const { className, id, loading_state } = this . props ;
541539 const style = this . getStyle ( ) ;
542540
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+
543549 return (
544- < LoadingElement
550+ < div
545551 id = { id }
546552 key = { id }
547553 className = { className }
548554 style = { style }
549555 ref = { this . parentElement }
556+ data-dash-is-loading = { isLoading ? true : undefined }
550557 >
551558 < ResizeDetector
552559 onResize = { this . graphResize }
553560 targets = { [ this . parentElement , this . gd ] }
554561 />
555562 < div ref = { this . gd } style = { { height : '100%' , width : '100%' } } />
556- </ LoadingElement >
563+ </ div >
557564 ) ;
558565 }
559566}
You can’t perform that action at this time.
0 commit comments