@coinbase/cds-mobile-visualization 3.6.1 → 3.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -8,6 +8,12 @@ All notable changes to this project will be documented in this file.
8
8
 
9
9
  <!-- template-start -->
10
10
 
11
+ ## 3.6.2 (4/20/2026 PST)
12
+
13
+ #### 🐞 Fixes
14
+
15
+ - Fix: bar chart enter animation clipping. [[#631](https://github.com/coinbase/cds/pull/631)]
16
+
11
17
  ## 3.6.1 (4/16/2026 PST)
12
18
 
13
19
  #### 🐞 Fixes
@@ -1 +1 @@
1
- {"version":3,"file":"BarPlot.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarPlot.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,kBAAkB,EAChB,YAAY,GACZ,cAAc,GACd,aAAa,GACb,QAAQ,GACR,aAAa,GACb,cAAc,GACd,eAAe,GACf,UAAU,GACV,YAAY,GACZ,cAAc,GACd,mBAAmB,CACtB,GAAG;IACF;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,gBAAgB,GACzC,IAAI,CAAC,kBAAkB,EAAE,aAAa,GAAG,YAAY,CAAC,CAAC;AAQzD;;;;;GAKG;AACH,eAAO,MAAM,OAAO,oDA2FnB,CAAC"}
1
+ {"version":3,"file":"BarPlot.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarPlot.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAG1D,MAAM,MAAM,gBAAgB,GAAG,IAAI,CACjC,kBAAkB,EAChB,YAAY,GACZ,cAAc,GACd,aAAa,GACb,QAAQ,GACR,aAAa,GACb,cAAc,GACd,eAAe,GACf,UAAU,GACV,YAAY,GACZ,cAAc,GACd,mBAAmB,CACtB,GAAG;IACF;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,gBAAgB,GACzC,IAAI,CAAC,kBAAkB,EAAE,aAAa,GAAG,YAAY,CAAC,CAAC;AAQzD;;;;;GAKG;AACH,eAAO,MAAM,OAAO,oDAmGnB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultBarStack.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/DefaultBarStack.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,eAAe,8DA2E3B,CAAC"}
1
+ {"version":3,"file":"DefaultBarStack.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/DefaultBarStack.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,eAAe,8DAqF3B,CAAC"}
@@ -65,12 +65,21 @@ export const BarPlot = /*#__PURE__*/memo(_ref => {
65
65
  from: prev.to,
66
66
  to: nextPath
67
67
  }));
68
- clipProgress.value = 0;
69
- clipProgress.value = buildTransition(1, animate ? clipUpdateTransition : null);
68
+ if (drawingArea.width || !drawingArea.height) {
69
+ clipProgress.value = 1;
70
+ } else {
71
+ clipProgress.value = 0;
72
+ clipProgress.value = buildTransition(1, animate ? clipUpdateTransition : null);
73
+ }
70
74
  // eslint-disable-next-line react-hooks/exhaustive-deps
71
75
  }, [drawingArea, animate, clipUpdateTransition]);
72
76
  const animatedClipPath = usePathInterpolation(clipProgress, [0, 1], [clipPaths.from, clipPaths.to]);
73
77
  if (!drawingArea) return;
78
+
79
+ // Clip path animation for bar is just for chart size changes, not for
80
+ // enter transition. One caveat, bar update transitions are staggered
81
+ // but clip path is not, so some bars could be clipped in rare cases
82
+
74
83
  return /*#__PURE__*/_jsx(Group, {
75
84
  clip: animatedClipPath,
76
85
  children: stackGroups.map((group, stackIndex) => /*#__PURE__*/_jsx(BarStackGroup, {
@@ -1,5 +1,5 @@
1
1
  import { memo, useMemo } from 'react';
2
- import { Group } from '@shopify/react-native-skia';
2
+ import { Group, Skia } from '@shopify/react-native-skia';
3
3
  import { useCartesianChartContext } from '../ChartProvider';
4
4
  import { getBarPath } from '../utils';
5
5
  import { defaultBarEnterTransition, getNormalizedStagger, getStackInitialClipRect, withStaggerDelayTransition } from '../utils/bar';
@@ -28,7 +28,8 @@ export const DefaultBarStack = /*#__PURE__*/memo(_ref => {
28
28
  layout
29
29
  } = useCartesianChartContext();
30
30
  const normalizedStagger = useMemo(() => getNormalizedStagger(layout, x, y, drawingArea), [layout, x, y, drawingArea]);
31
- const enterTransition = useMemo(() => withStaggerDelayTransition(getTransition(transitions == null ? void 0 : transitions.enter, animate, defaultBarEnterTransition), normalizedStagger), [animate, transitions == null ? void 0 : transitions.enter, normalizedStagger]);
31
+ const enterTransition = useMemo(() => getTransition(transitions == null ? void 0 : transitions.enter, animate, defaultBarEnterTransition), [transitions == null ? void 0 : transitions.enter, animate]);
32
+ const enterTransitionWithStagger = useMemo(() => withStaggerDelayTransition(enterTransition, normalizedStagger), [enterTransition, normalizedStagger]);
32
33
  const updateTransition = useMemo(() => withStaggerDelayTransition(getTransition((transitions == null ? void 0 : transitions.update) !== undefined ? transitions.update : transition, animate, defaultTransition), normalizedStagger), [animate, transitions == null ? void 0 : transitions.update, transition, normalizedStagger]);
33
34
 
34
35
  // Generate target clip path (full bar)
@@ -51,11 +52,15 @@ export const DefaultBarStack = /*#__PURE__*/memo(_ref => {
51
52
  currentPath: targetPath,
52
53
  initialPath,
53
54
  transitions: {
54
- enter: enterTransition,
55
+ enter: enterTransitionWithStagger,
55
56
  update: updateTransition
56
57
  }
57
58
  });
58
- const clipPath = animate ? animatedClipPath : targetPath;
59
+ const staticClipPath = useMemo(() => {
60
+ var _Skia$Path$MakeFromSV;
61
+ return (_Skia$Path$MakeFromSV = Skia.Path.MakeFromSVGString(targetPath)) != null ? _Skia$Path$MakeFromSV : Skia.Path.Make();
62
+ }, [targetPath]);
63
+ const clipPath = animate ? animatedClipPath : staticClipPath;
59
64
  return /*#__PURE__*/_jsx(Group, {
60
65
  clip: clipPath,
61
66
  children: children
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cds-mobile-visualization",
3
- "version": "3.6.1",
3
+ "version": "3.6.2",
4
4
  "description": "Coinbase Design System - Mobile Visualization Native",
5
5
  "repository": {
6
6
  "type": "git",