Skip to content

Commit

Permalink
chore: add g-webgl renderer in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoiver committed Jul 21, 2023
1 parent 778cdf3 commit 14e84fa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
8 changes: 8 additions & 0 deletions __tests__/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Canvas } from '@antv/g';
import { Renderer as CanvasRenderer } from '@antv/g-canvas';
import { Plugin as DragAndDropPlugin } from '@antv/g-plugin-dragndrop';
import { Plugin as ControlPlugin } from '@antv/g-plugin-control';
import { Plugin as ThreeDPlugin } from '@antv/g-plugin-3d';
import { Renderer as SVGRenderer } from '@antv/g-svg';
import { Renderer as WebGLRenderer } from '@antv/g-webgl';
import { render } from '../src';
import { renderToMountedElement } from './utils/renderToMountedElement';
import * as statics from './plots/static';
Expand All @@ -21,6 +24,7 @@ const tests = {
const renderers = {
canvas: CanvasRenderer,
svg: SVGRenderer,
webgl: WebGLRenderer,
};
const app = document.getElementById('app') as HTMLElement;
let currentContainer = document.createElement('div');
Expand Down Expand Up @@ -147,6 +151,10 @@ function createSpecRender(object) {
renderer.registerPlugin(
new DragAndDropPlugin({ dragstartDistanceThreshold: 1 }),
);
if (selectRenderer.value === 'webgl') {
renderer.registerPlugin(new ControlPlugin());
renderer.registerPlugin(new ThreeDPlugin());
}
canvas = new Canvas({
container: document.createElement('div'),
width,
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
"dependencies": {
"@antv/coord": "^0.4.1",
"@antv/event-emitter": "^0.1.3",
"@antv/g": "^5.7.4",
"@antv/g-canvas": "^1.7.4",
"@antv/g-plugin-dragndrop": "^1.6.1",
"@antv/g": "^5.18.6",
"@antv/g-canvas": "^1.11.5",
"@antv/g-plugin-dragndrop": "^1.8.3",
"@antv/gui": "^0.5.0-alpha.22",
"@antv/path-util": "^3.0.1",
"@antv/scale": "^0.4.7",
Expand All @@ -74,7 +74,10 @@
"@antv/data-set": "^0.11.8",
"@antv/g-plugin-rough-canvas-renderer": "^1.7.9",
"@antv/g-plugin-rough-svg-renderer": "^1.7.9",
"@antv/g-svg": "^1.8.6",
"@antv/g-plugin-control": "^1.9.5",
"@antv/g-plugin-3d": "^1.9.5",
"@antv/g-svg": "^1.10.5",
"@antv/g-webgl": "^1.9.5",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^17.4.4",
"@rollup/plugin-commonjs": "^21.0.2",
Expand Down

0 comments on commit 14e84fa

Please sign in to comment.