-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix: disable memoize during interpolation #1618 * chore: commit changeset
Showing
22 changed files
with
284 additions
and
34 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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
'@antv/g-web-animations-api': patch | ||
'@antv/g-lite': patch | ||
--- | ||
|
||
Disable memoize during interpolation to avoid OOM. |
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,28 @@ | ||
import { Circle, runtime } from '../../../packages/g'; | ||
|
||
export async function circles(context) { | ||
runtime.enableCSSParsing = false; | ||
|
||
const { canvas } = context; | ||
await canvas.ready; | ||
|
||
for (let i = 0; i < 50000; i++) { | ||
const circle = new Circle({ | ||
style: { | ||
cx: Math.random() * 500, | ||
cy: Math.random() * 500, | ||
r: 5, | ||
fill: 'red', | ||
stroke: 'blue', | ||
}, | ||
}); | ||
canvas.appendChild(circle); | ||
|
||
circle.addEventListener('mouseenter', () => { | ||
circle.style.fill = 'green'; | ||
}); | ||
circle.addEventListener('mouseleave', () => { | ||
circle.style.fill = 'red'; | ||
}); | ||
} | ||
} |
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 @@ | ||
export { spring } from './spring'; |
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,14 @@ | ||
import { runtime } from '../../../packages/g'; | ||
import { loadAnimation } from '../../../packages/g-lottie-player'; | ||
import * as d3 from 'd3'; | ||
|
||
export async function spring(context) { | ||
runtime.enableCSSParsing = true; | ||
|
||
const { canvas } = context; | ||
await canvas.ready; | ||
|
||
const data = await d3.json('/lottie/spring.json'); | ||
const animation = loadAnimation(data, { loop: true, autoplay: true }); | ||
const wrapper = animation.render(canvas); | ||
} |
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
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
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
Oops, something went wrong.