Spaces:
Paused
Paused
Download frontend/lib/load-plotly.ts from yrlllllllllll/MindPulse: direct link, hf CLI and curl.
- Browser
- Download file 552 Bytes
-
https://huggingface.co/spaces/yrlllllllllll/MindPulse/resolve/main/frontend/lib/load-plotly.ts
- Command line
-
hf download hf://spaces/yrlllllllllll/MindPulse/frontend/lib/load-plotly.ts
-
curl -L -o load-plotly.ts https://huggingface.co/spaces/yrlllllllllll/MindPulse/resolve/main/frontend/lib/load-plotly.ts
552 Bytes
| let plotlyPromise: Promise<any> | null = null | |
| export function loadPlotly() { | |
| if (!plotlyPromise) { | |
| plotlyPromise = Promise.all([ | |
| import('plotly.js/lib/core'), | |
| import('plotly.js/lib/heatmap'), | |
| import('plotly.js/lib/scatter'), | |
| ]).then(([coreModule, heatmapModule, scatterModule]) => { | |
| const Plotly = coreModule.default ?? coreModule | |
| Plotly.register([ | |
| heatmapModule.default ?? heatmapModule, | |
| scatterModule.default ?? scatterModule, | |
| ]) | |
| return Plotly | |
| }) | |
| } | |
| return plotlyPromise | |
| } | |