Commit 08d596d
committed
fix(animate): commit update layout at animation end
VChart resize updates write the new layout into finalAttribute and pass the
layout delta through context.diffAttrs for the built-in update animation. The
animation frames interpolate correctly, but automatic close-out restores from
baseAttributes. Before this change, baseAttributes still held the pre-resize
layout, so restoreStaticAttribute pulled attribute and finalAttribute back to the
old bar size after the update animation ended.
The built-in update animation now treats its diffAttrs as an explicit end commit
for upper-layer layout changes. It commits those attrs to static truth only when
the update animation naturally ends, leaving in-flight frames transient and
preserving ordinary self-driven animations that should restore to the old base.
Constraint: D3 static truth remains baseAttributes + resolvedStatePatch -> attribute
Constraint: Animation frames stay transient until an explicit end commit
Rejected: Sync all setFinalAttributes calls to base | breaks custom target caches
Rejected: Restore from finalAttribute directly | reintroduces finalAttribute as truth
Confidence: high
Scope-risk: narrow
Directive: Keep update layout commits in Update.onEnd, not generic restore paths
Tested: packages/vrender-animate rushx test --runInBand
Tested: packages/vrender-core targeted static truth/state suites under Node 22.18.0
Tested: rush compile -t @visactor/vrender-animate
Tested: rush build -t @visactor/vrender-animate
Tested: rush build -t @visactor/vrender
Tested: built aggregate CJS resize-update repro keeps resized y/y1/width after end
Not-tested: Full VChart browser smoke against local packages1 parent 74c676f commit 08d596d
2 files changed
Lines changed: 87 additions & 1 deletion
File tree
- packages/vrender-animate
- __tests__/unit
- src/custom
Lines changed: 74 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
308 | 382 | | |
309 | 383 | | |
310 | 384 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
40 | 52 | | |
41 | 53 | | |
42 | 54 | | |
| |||
0 commit comments