Skip to content

Commit

Permalink
Added proper plotly minified typings
Browse files Browse the repository at this point in the history
  • Loading branch information
puehringer committed Feb 17, 2022
1 parent 3610f9b commit 21bc23b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion dist/vis/Plot.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions dist/vis/Plot.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/vis/Plot.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions src/vis/Plot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
5 changes: 0 additions & 5 deletions tsd.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 21bc23b

Please sign in to comment.