Commit 2583060
committed
fix(morph): always use polygon-resample for cross-type morph + radialBar linecap
The 'commands' algorithm produced visible "wings/flips" mid-frame for any
pair whose source and target have very different anchor-point counts
(bar rect ↔ pie wedge / radial arc). The 'polygons' algorithm doesn't
have this failure mode, so the user-facing algorithm choice is dropped —
all cross-type morphs now use polygon resample + rotation-search
alignment.
Within-type morphs (bar updates with new data) continue to use the
per-command lerp via Animations.morphSVG's default path; morphPaths
stays in PathMorphing.js for that use.
Also adds `stroke.lineCap: 'butt'` to radialBar() defaults. bar()
defaults set lineCap='square'; without this override, a chart that
started as bar carried 'square' across to radialBar after a morph,
making each value arc's stroke extend half a stroke-width *past* the
arc endpoint via the square cap. The "leftmost edge extends suddenly"
visible at the end of every bar/pie → radialBar morph was that cap
becoming visible at the swap moment (donut-segment polygon during morph
has stroke-width 0, so its linecap is invisible; the stroked open arc
after the swap has stroke-width=21 and the square cap shows).
Removes:
- `chart.animations.chartTypeMorph.algorithm` config + matching type
- `MorphTypeChange.getAlgorithm()`
- the algorithm radio toggle from the chart-type-morph demo
Renderer call sites in Pie/Radial/Animations now pass the literal
'polygons' when a cross-type morph is active.1 parent 9348ac2 commit 2583060
29 files changed
Lines changed: 141 additions & 262 deletions
File tree
- dist
- features
- samples
- source/misc
- vanilla-js/misc
- src
- charts
- modules
- settings
- types
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3019 | 3019 | | |
3020 | 3020 | | |
3021 | 3021 | | |
| 3022 | + | |
| 3023 | + | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
3022 | 3032 | | |
3023 | 3033 | | |
3024 | 3034 | | |
| |||
3362 | 3372 | | |
3363 | 3373 | | |
3364 | 3374 | | |
3365 | | - | |
3366 | | - | |
3367 | | - | |
3368 | | - | |
3369 | | - | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
3370 | 3383 | | |
3371 | | - | |
3372 | | - | |
3373 | | - | |
3374 | | - | |
3375 | | - | |
3376 | | - | |
3377 | | - | |
3378 | | - | |
3379 | | - | |
| 3384 | + | |
3380 | 3385 | | |
3381 | 3386 | | |
3382 | 3387 | | |
| |||
6500 | 6505 | | |
6501 | 6506 | | |
6502 | 6507 | | |
6503 | | - | |
| 6508 | + | |
6504 | 6509 | | |
6505 | 6510 | | |
6506 | 6511 | | |
| |||
6523 | 6528 | | |
6524 | 6529 | | |
6525 | 6530 | | |
6526 | | - | |
6527 | | - | |
| 6531 | + | |
| 6532 | + | |
6528 | 6533 | | |
6529 | 6534 | | |
6530 | 6535 | | |
| |||
27631 | 27636 | | |
27632 | 27637 | | |
27633 | 27638 | | |
27634 | | - | |
27635 | | - | |
27636 | | - | |
27637 | | - | |
27638 | | - | |
27639 | | - | |
27640 | | - | |
27641 | | - | |
27642 | | - | |
27643 | | - | |
27644 | | - | |
27645 | | - | |
27646 | | - | |
27647 | 27639 | | |
27648 | 27640 | | |
27649 | 27641 | | |
| |||
32282 | 32274 | | |
32283 | 32275 | | |
32284 | 32276 | | |
32285 | | - | |
32286 | 32277 | | |
32287 | | - | |
| 32278 | + | |
32288 | 32279 | | |
32289 | 32280 | | |
32290 | 32281 | | |
| |||
33677 | 33668 | | |
33678 | 33669 | | |
33679 | 33670 | | |
33680 | | - | |
33681 | 33671 | | |
33682 | 33672 | | |
33683 | 33673 | | |
| |||
33693 | 33683 | | |
33694 | 33684 | | |
33695 | 33685 | | |
33696 | | - | |
| 33686 | + | |
33697 | 33687 | | |
33698 | 33688 | | |
33699 | 33689 | | |
| |||
33705 | 33695 | | |
33706 | 33696 | | |
33707 | 33697 | | |
33708 | | - | |
| 33698 | + | |
33709 | 33699 | | |
33710 | 33700 | | |
33711 | 33701 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3023 | 3023 | | |
3024 | 3024 | | |
3025 | 3025 | | |
| 3026 | + | |
| 3027 | + | |
| 3028 | + | |
| 3029 | + | |
| 3030 | + | |
| 3031 | + | |
| 3032 | + | |
| 3033 | + | |
| 3034 | + | |
| 3035 | + | |
3026 | 3036 | | |
3027 | 3037 | | |
3028 | 3038 | | |
| |||
3366 | 3376 | | |
3367 | 3377 | | |
3368 | 3378 | | |
3369 | | - | |
3370 | | - | |
3371 | | - | |
3372 | | - | |
3373 | | - | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
3374 | 3387 | | |
3375 | | - | |
3376 | | - | |
3377 | | - | |
3378 | | - | |
3379 | | - | |
3380 | | - | |
3381 | | - | |
3382 | | - | |
3383 | | - | |
| 3388 | + | |
3384 | 3389 | | |
3385 | 3390 | | |
3386 | 3391 | | |
| |||
6504 | 6509 | | |
6505 | 6510 | | |
6506 | 6511 | | |
6507 | | - | |
| 6512 | + | |
6508 | 6513 | | |
6509 | 6514 | | |
6510 | 6515 | | |
| |||
6527 | 6532 | | |
6528 | 6533 | | |
6529 | 6534 | | |
6530 | | - | |
6531 | | - | |
| 6535 | + | |
| 6536 | + | |
6532 | 6537 | | |
6533 | 6538 | | |
6534 | 6539 | | |
| |||
27635 | 27640 | | |
27636 | 27641 | | |
27637 | 27642 | | |
27638 | | - | |
27639 | | - | |
27640 | | - | |
27641 | | - | |
27642 | | - | |
27643 | | - | |
27644 | | - | |
27645 | | - | |
27646 | | - | |
27647 | | - | |
27648 | | - | |
27649 | | - | |
27650 | | - | |
27651 | 27643 | | |
27652 | 27644 | | |
27653 | 27645 | | |
| |||
32286 | 32278 | | |
32287 | 32279 | | |
32288 | 32280 | | |
32289 | | - | |
32290 | 32281 | | |
32291 | | - | |
| 32282 | + | |
32292 | 32283 | | |
32293 | 32284 | | |
32294 | 32285 | | |
| |||
33681 | 33672 | | |
33682 | 33673 | | |
33683 | 33674 | | |
33684 | | - | |
33685 | 33675 | | |
33686 | 33676 | | |
33687 | 33677 | | |
| |||
33697 | 33687 | | |
33698 | 33688 | | |
33699 | 33689 | | |
33700 | | - | |
| 33690 | + | |
33701 | 33691 | | |
33702 | 33692 | | |
33703 | 33693 | | |
| |||
33709 | 33699 | | |
33710 | 33700 | | |
33711 | 33701 | | |
33712 | | - | |
| 33702 | + | |
33713 | 33703 | | |
33714 | 33704 | | |
33715 | 33705 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3039 | 3039 | | |
3040 | 3040 | | |
3041 | 3041 | | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
| 3050 | + | |
| 3051 | + | |
3042 | 3052 | | |
3043 | 3053 | | |
3044 | 3054 | | |
| |||
3382 | 3392 | | |
3383 | 3393 | | |
3384 | 3394 | | |
3385 | | - | |
3386 | | - | |
3387 | | - | |
3388 | | - | |
3389 | | - | |
| 3395 | + | |
| 3396 | + | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
| 3400 | + | |
| 3401 | + | |
| 3402 | + | |
3390 | 3403 | | |
3391 | | - | |
3392 | | - | |
3393 | | - | |
3394 | | - | |
3395 | | - | |
3396 | | - | |
3397 | | - | |
3398 | | - | |
3399 | | - | |
| 3404 | + | |
3400 | 3405 | | |
3401 | 3406 | | |
3402 | 3407 | | |
| |||
6520 | 6525 | | |
6521 | 6526 | | |
6522 | 6527 | | |
6523 | | - | |
| 6528 | + | |
6524 | 6529 | | |
6525 | 6530 | | |
6526 | 6531 | | |
| |||
6543 | 6548 | | |
6544 | 6549 | | |
6545 | 6550 | | |
6546 | | - | |
6547 | | - | |
| 6551 | + | |
| 6552 | + | |
6548 | 6553 | | |
6549 | 6554 | | |
6550 | 6555 | | |
| |||
27651 | 27656 | | |
27652 | 27657 | | |
27653 | 27658 | | |
27654 | | - | |
27655 | | - | |
27656 | | - | |
27657 | | - | |
27658 | | - | |
27659 | | - | |
27660 | | - | |
27661 | | - | |
27662 | | - | |
27663 | | - | |
27664 | | - | |
27665 | | - | |
27666 | | - | |
27667 | 27659 | | |
27668 | 27660 | | |
27669 | 27661 | | |
| |||
32302 | 32294 | | |
32303 | 32295 | | |
32304 | 32296 | | |
32305 | | - | |
32306 | 32297 | | |
32307 | | - | |
| 32298 | + | |
32308 | 32299 | | |
32309 | 32300 | | |
32310 | 32301 | | |
| |||
33697 | 33688 | | |
33698 | 33689 | | |
33699 | 33690 | | |
33700 | | - | |
33701 | 33691 | | |
33702 | 33692 | | |
33703 | 33693 | | |
| |||
33713 | 33703 | | |
33714 | 33704 | | |
33715 | 33705 | | |
33716 | | - | |
| 33706 | + | |
33717 | 33707 | | |
33718 | 33708 | | |
33719 | 33709 | | |
| |||
33725 | 33715 | | |
33726 | 33716 | | |
33727 | 33717 | | |
33728 | | - | |
| 33718 | + | |
33729 | 33719 | | |
33730 | 33720 | | |
33731 | 33721 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments