Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use virtual-webgl to circumvent browser limits on WebGL contexts #2349

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import '@testing-library/jest-dom';
import { TextDecoder, TextEncoder } from 'util';
import { performance } from 'perf_hooks';
import 'jest-canvas-mock';
import 'jest-webgl-canvas-mock';
import './__mocks__/dh-core';
import Log from '@deephaven/log';
import { TestUtils } from '@deephaven/test-utils';
Expand Down
42 changes: 21 additions & 21 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"identity-obj-proxy": "^3.0.0",
"jasmine": "4.0.2",
"jest": "^29.3.1",
"jest-canvas-mock": "^2.4.0",
"jest-webgl-canvas-mock": "2.5.3",
"jest-environment-jsdom": "^29.3.1",
"jest-runner-eslint": "^1.1.0",
"jest-runner-stylelint": "^2.3.7",
Expand Down
13 changes: 13 additions & 0 deletions packages/chart/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
import Log from '@deephaven/log';
import { initializeVirtualWebGL } from './virtual-webgl';

const log = Log.module('@deephaven/chart index');

try {
// Used to show many WebGL plots on the same page
// https://github.com/plotly/plotly.js/?tab=readme-ov-file#need-to-have-several-webgl-graphs-on-a-page
initializeVirtualWebGL();
} catch (e) {
log.warn('Failed to initialize virtual WebGL', e);
}

export { default as Chart } from './LazyChart';
export { default as ChartModelFactory } from './ChartModelFactory';
export { default as ChartModel } from './ChartModel';
Expand Down
Loading
Loading