diff --git a/dist/vis/Plot.d.ts.map b/dist/vis/Plot.d.ts.map index 9af4091b5..c7177b14f 100644 --- a/dist/vis/Plot.d.ts.map +++ b/dist/vis/Plot.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Plot.d.ts","sourceRoot":"","sources":["../../src/vis/Plot.tsx"],"names":[],"mappings":";AASA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAKxC,eAAO,MAAM,eAAe,qEAAgC,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"Plot.d.ts","sourceRoot":"","sources":["../../src/vis/Plot.tsx"],"names":[],"mappings":";AASA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAIxC,eAAO,MAAM,eAAe,qEAAgC,CAAC;AAG7D,OAAO,EAAE,MAAM,EAAE,CAAC"} \ No newline at end of file diff --git a/dist/vis/Plot.js b/dist/vis/Plot.js index 28efd5155..a784896cb 100644 --- a/dist/vis/Plot.js +++ b/dist/vis/Plot.js @@ -7,10 +7,9 @@ if (typeof window.URL.createObjectURL === 'undefined') { } // Use minified bundle: https://github.com/plotly/react-plotly.js#customizing-the-plotlyjs-bundle import Plotly from 'plotly.js-dist-min'; -// Use your own `Plotly` object import createPlotlyComponent from 'react-plotly.js/factory'; -// tslint:disable-next-line:variable-name +// And use it for our own `Plotly` object export const PlotlyComponent = createPlotlyComponent(Plotly); -// Reexport plotly with proper typings, i.e. see tsd.d.ts +// Reexport the minified plotly with proper typings export { Plotly }; //# sourceMappingURL=Plot.js.map \ No newline at end of file diff --git a/dist/vis/Plot.js.map b/dist/vis/Plot.js.map index 14d103ab4..5f73d86b4 100644 --- a/dist/vis/Plot.js.map +++ b/dist/vis/Plot.js.map @@ -1 +1 @@ -{"version":3,"file":"Plot.js","sourceRoot":"","sources":["../../src/vis/Plot.tsx"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,eAAe,KAAK,WAAW,EAAE;IACrD,aAAa;IACb,MAAM,CAAC,GAAG,CAAC,eAAe,GAAG,GAAG,EAAE;QAChC,2CAA2C;IAC7C,CAAC,CAAC;CACH;AAED,iGAAiG;AACjG,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,+BAA+B;AAC/B,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,yCAAyC;AACzC,MAAM,CAAC,MAAM,eAAe,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAC7D,yDAAyD;AACzD,OAAO,EAAE,MAAM,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"Plot.js","sourceRoot":"","sources":["../../src/vis/Plot.tsx"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,IAAI,OAAO,MAAM,CAAC,GAAG,CAAC,eAAe,KAAK,WAAW,EAAE;IACrD,aAAa;IACb,MAAM,CAAC,GAAG,CAAC,eAAe,GAAG,GAAG,EAAE;QAChC,2CAA2C;IAC7C,CAAC,CAAC;CACH;AAED,iGAAiG;AACjG,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAE5D,yCAAyC;AACzC,MAAM,CAAC,MAAM,eAAe,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAE7D,mDAAmD;AACnD,OAAO,EAAE,MAAM,EAAE,CAAC"} \ No newline at end of file diff --git a/package.json b/package.json index 1cc0fc979..8c7541cde 100644 --- a/package.json +++ b/package.json @@ -118,6 +118,7 @@ "@types/react": "^16.9.23", "@types/react-dom": "^16.9.5", "@types/papaparse": "~5.2.4", + "@types/plotly.js-dist-min": "^2.3.0", "@typescript-eslint/eslint-plugin": "^5.9.0", "@typescript-eslint/parser": "^5.9.0", "eslint": "^8.7.0", diff --git a/src/vis/Plot.tsx b/src/vis/Plot.tsx index f6b38fe1c..0a86e9af1 100644 --- a/src/vis/Plot.tsx +++ b/src/vis/Plot.tsx @@ -8,10 +8,10 @@ if (typeof window.URL.createObjectURL === 'undefined') { // Use minified bundle: https://github.com/plotly/react-plotly.js#customizing-the-plotlyjs-bundle import Plotly from 'plotly.js-dist-min'; - -// Use your own `Plotly` object import createPlotlyComponent from 'react-plotly.js/factory'; -// tslint:disable-next-line:variable-name + +// Use the minified version for our own `Plotly` object export const PlotlyComponent = createPlotlyComponent(Plotly); -// Reexport plotly with proper typings, i.e. see tsd.d.ts + +// Reexport the minified plotly with proper typings export { Plotly }; diff --git a/tsd.d.ts b/tsd.d.ts index d50450f25..48de6616f 100644 --- a/tsd.d.ts +++ b/tsd.d.ts @@ -22,8 +22,3 @@ declare module '*.xml' { const content: string; export default content; } - -declare module "plotly.js-dist-min" { - import * as Plotly from "plotly.js"; - export default Plotly; -}