Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/keller-mark/window-pixi
https://github.com/keller-mark/window-pixi
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/keller-mark/window-pixi
- Owner: keller-mark
- Created: 2020-12-01T01:14:53.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-01T01:16:06.000Z (about 4 years ago)
- Last Synced: 2024-12-14T01:34:18.380Z (about 1 month ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# window-pixi
In Vitessce, we want to lazy-load HiGlass, to reduce the bundle size, since we only need to use HiGlass when visualizing data with genomic coordinates.
It is difficult or impossible to use lazy loading when the consumer library (in this case Vitessce) also needs to be bundled and lazy loaded itself (in this case in the HuBMAP Portal).
One option is to use dynamic imports with absolute / external URLs to the HiGlass JavaScript bundle. However, HiGlass depends on PIXI.js. The PIXI JavaScript bundle is not compatible with dynamic imports because it sets PIXI as a module-scope variable (`var PIXI = ...`) [reference](https://lea.verou.me/2020/07/import-non-esm-libraries-in-es-modules-with-client-side-vanilla-js/).
So we just need to append the following line:
```js
window.PIXI = PIXI;
```