Import all Plotly visualizations (#6673)

- Accessible using the Custom chart type
- Disable 'fs' and 'path' modules which are available in node, but not
  on the frontend.

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Guido Petri <18634426+guidopetri@users.noreply.github.com>
This commit is contained in:
Eric Radman
2024-01-07 15:19:58 -05:00
committed by GitHub
parent 473cf29c9f
commit 1b1b9bd98d
5 changed files with 17 additions and 13 deletions

View File

@@ -178,6 +178,10 @@
"viz-lib/**"
]
},
"browser": {
"fs": false,
"path": false
},
"//": "browserslist set to 'Async functions' compatibility",
"browserslist": [
"Edge >= 15",

View File

@@ -111,5 +111,9 @@
"^@/(.*)": "<rootDir>/$1",
"\\.(css|less)$": "identity-obj-proxy"
}
},
"browser": {
"fs": false,
"path": false
}
}

View File

@@ -1,14 +1,4 @@
import Plotly from "plotly.js/lib/core";
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'plot... Remove this comment to see the full error message
import bar from "plotly.js/lib/bar";
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'plot... Remove this comment to see the full error message
import pie from "plotly.js/lib/pie";
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'plot... Remove this comment to see the full error message
import histogram from "plotly.js/lib/histogram";
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'plot... Remove this comment to see the full error message
import box from "plotly.js/lib/box";
// @ts-expect-error ts-migrate(7016) FIXME: Could not find a declaration file for module 'plot... Remove this comment to see the full error message
import heatmap from "plotly.js/lib/heatmap";
import * as Plotly from "plotly.js";
import prepareData from "./prepareData";
import prepareLayout from "./prepareLayout";
@@ -17,8 +7,6 @@ import updateAxes from "./updateAxes";
import updateChartSize from "./updateChartSize";
import { prepareCustomChartData, createCustomChartRenderer } from "./customChartUtils";
// @ts-expect-error ts-migrate(2339) FIXME: Property 'register' does not exist on type 'typeof... Remove this comment to see the full error message
Plotly.register([bar, pie, histogram, box, heatmap]);
// @ts-expect-error ts-migrate(2339) FIXME: Property 'setPlotConfig' does not exist on type 't... Remove this comment to see the full error message
Plotly.setPlotConfig({
modeBarButtonsToRemove: ["sendDataToCloud"],

View File

@@ -15,6 +15,10 @@ module.exports = {
resolve: {
symlinks: false,
extensions: [".js", ".jsx", ".ts", ".tsx"],
fallback: {
fs: false,
path: false
}
},
module: {
rules: [

View File

@@ -75,6 +75,10 @@ const config = {
filename: isProduction ? "[name].[chunkhash].js" : "[name].js",
publicPath: staticPath
},
node: {
fs: "empty",
path: "empty"
},
resolve: {
symlinks: false,
extensions: [".js", ".jsx", ".ts", ".tsx"],