-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: add base perf test case * refactor: remove CSSParsing support * refactor: remove enableDataset support * refactor: remove enableAttributeDashCased support * refactor: remove useless methods of StyleValueRegistry * feat: transform support array type * refactor: simplify CSSProperty * test: add test tsconfig and update test case * fix: remove dom event listenser * refactor: simpify utils * refactor: optimize display-object, style-value-registry * refactor: canvas support cleanUpOnDestroy config, fix memory leak after destroy * refactor: event target remove 3.0 compatible * feat: add fragment to support batch operations * refactor: node foreach remove assign params * refactor: scene graph service use shared variables * fix: fix crash after node destroyed * fix: fix parsedTransformToMat4 optimizer * refactor: cancel animation frame after canvas destroy
- Loading branch information
Showing
96 changed files
with
1,643 additions
and
4,083 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export { circles } from './circles'; | ||
export { rects } from './rect'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Rect, Group, Fragment } from '@antv/g'; | ||
import type { Canvas } from '@antv/g'; | ||
|
||
export async function rects(context: { canvas: Canvas }) { | ||
const { canvas } = context; | ||
|
||
await canvas.ready; | ||
|
||
const group1 = canvas.appendChild(new Group({ id: 'group1' })); | ||
const group2 = group1.appendChild(new Group({ id: 'group2' })); | ||
|
||
console.time('render'); | ||
|
||
const fragment = new Fragment(); | ||
|
||
for (let i = 0; i < 10_0000; i++) { | ||
const group = fragment.appendChild( | ||
new Group({ | ||
id: `group-${i}`, | ||
style: { | ||
transform: [['translate', Math.random() * 640, Math.random() * 640]], | ||
}, | ||
}), | ||
); | ||
|
||
group.appendChild( | ||
new Rect({ | ||
style: { | ||
width: 10, | ||
height: 10, | ||
fill: '#1890FF', | ||
stroke: '#F04864', | ||
lineWidth: 4, | ||
}, | ||
}), | ||
); | ||
} | ||
|
||
group2.appendChild(fragment); | ||
|
||
canvas.addEventListener( | ||
'rerender', | ||
() => { | ||
console.timeEnd('render'); | ||
}, | ||
{ once: true }, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"types": ["jest"], | ||
"moduleResolution": "node", | ||
"lib": ["ESNext", "DOM"] | ||
}, | ||
"extends": "../tsconfig.json" | ||
} |
Oops, something went wrong.