Skip to content

Commit

Permalink
Added mock for window.URL.createObjectURL (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
puehringer authored Feb 15, 2022
1 parent a8e5d10 commit 3610f9b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 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.

7 changes: 7 additions & 0 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.

8 changes: 8 additions & 0 deletions src/vis/Plot.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/* eslint-disable import/first */
if (typeof window.URL.createObjectURL === 'undefined') {
// @ts-ignore
window.URL.createObjectURL = () => {
// Mock this function for mapbox-gl to work
};
}

// Use minified bundle: https://github.com/plotly/react-plotly.js#customizing-the-plotlyjs-bundle
import Plotly from 'plotly.js-dist-min';

Expand Down

0 comments on commit 3610f9b

Please sign in to comment.