@@ -21,7 +21,6 @@ import {getAppState} from './reducers/constants';
2121import { STATUS } from './constants/constants' ;
2222import { getLoadingState , getLoadingHash } from './utils/TreeContainer' ;
2323import wait from './utils/wait' ;
24- import { ConfigContext } from './config' ;
2524
2625export const DashContext = createContext ( { } ) ;
2726
@@ -73,6 +72,14 @@ const UnconnectedContainer = props => {
7372 }
7473 } ) ;
7574
75+ useEffect ( ( ) => {
76+ if ( config . serve_locally ) {
77+ window . _dashPlotlyJSURL = `${ config . requests_pathname_prefix } _dash-component-suites/plotly/package_data/plotly.min.js` ;
78+ } else {
79+ window . _dashPlotlyJSURL = config . plotlyjs_url ;
80+ }
81+ } , [ ] ) ;
82+
7683 let content ;
7784 if (
7885 layoutRequest . status &&
@@ -90,22 +97,20 @@ const UnconnectedContainer = props => {
9097
9198 content = (
9299 < DashContext . Provider value = { provider . current } >
93- < ConfigContext . Provider value = { config } >
94- < TreeContainer
95- _dashprivate_error = { error }
96- _dashprivate_layout = { layout }
97- _dashprivate_loadingState = { getLoadingState (
98- layout ,
99- [ ] ,
100- loadingMap
101- ) }
102- _dashprivate_loadingStateHash = { getLoadingHash (
103- [ ] ,
104- loadingMap
105- ) }
106- _dashprivate_path = { JSON . stringify ( [ ] ) }
107- />
108- </ ConfigContext . Provider >
100+ < TreeContainer
101+ _dashprivate_error = { error }
102+ _dashprivate_layout = { layout }
103+ _dashprivate_loadingState = { getLoadingState (
104+ layout ,
105+ [ ] ,
106+ loadingMap
107+ ) }
108+ _dashprivate_loadingStateHash = { getLoadingHash (
109+ [ ] ,
110+ loadingMap
111+ ) }
112+ _dashprivate_path = { JSON . stringify ( [ ] ) }
113+ />
109114 </ DashContext . Provider >
110115 ) ;
111116 } else {
0 commit comments