Skip to content

Commit 37cea3d

Browse files
committed
Use plotly.js/dist/plotly
1 parent ca21e8d commit 37cea3d

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

packages/plotly-extension/src/index.tsx

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,9 @@ import {
1313
IRenderMime
1414
} from '@jupyterlab/rendermime-interfaces';
1515

16-
import '../style/index.css';
16+
import * as Plotly from 'plotly.js/dist/plotly';
1717

18-
namespace Private {
19-
20-
declare function require(moduleName: string): string;
21-
22-
/**
23-
* Is plotly.js being loaded?.
24-
*/
25-
export
26-
let loadingPlotly = false;
27-
28-
/**
29-
* Load plotly.js browser script.
30-
*/
31-
export
32-
function loadPlotly(): void {
33-
loadingPlotly = true;
34-
const script = document.createElement('script');
35-
script.type = 'text/javascript';
36-
script.text = require('raw-loader!plotly.js/dist/plotly.min.js');
37-
document.head.appendChild(script);
38-
}
39-
40-
}
18+
import '../style/index.css';
4119

4220
/**
4321
* The CSS class to add to the Plotly Widget.
@@ -72,7 +50,6 @@ class RenderedPlotly extends Widget implements IRenderMime.IRenderer {
7250
super();
7351
this.addClass(CSS_CLASS);
7452
this._mimeType = options.mimeType;
75-
if (!Private.loadingPlotly) Private.loadPlotly();
7653
}
7754

7855
/**

0 commit comments

Comments
 (0)