@coinbase/cds-web-visualization 3.4.0-beta.13 → 3.4.0-beta.15
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 +14 -0
- package/dts/chart/CartesianChart.d.ts +18 -1
- package/dts/chart/CartesianChart.d.ts.map +1 -1
- package/dts/chart/PeriodSelector.d.ts.map +1 -1
- package/dts/chart/area/AreaChart.d.ts.map +1 -1
- package/dts/chart/bar/Bar.d.ts +4 -0
- package/dts/chart/bar/Bar.d.ts.map +1 -1
- package/dts/chart/bar/BarChart.d.ts +4 -2
- package/dts/chart/bar/BarChart.d.ts.map +1 -1
- package/dts/chart/bar/BarStack.d.ts +11 -2
- package/dts/chart/bar/BarStack.d.ts.map +1 -1
- package/dts/chart/bar/DefaultBar.d.ts.map +1 -1
- package/dts/chart/index.d.ts +1 -0
- package/dts/chart/index.d.ts.map +1 -1
- package/dts/chart/legend/DefaultLegendEntry.d.ts +21 -0
- package/dts/chart/legend/DefaultLegendEntry.d.ts.map +1 -0
- package/dts/chart/legend/DefaultLegendShape.d.ts +7 -0
- package/dts/chart/legend/DefaultLegendShape.d.ts.map +1 -0
- package/dts/chart/legend/Legend.d.ts +169 -0
- package/dts/chart/legend/Legend.d.ts.map +1 -0
- package/dts/chart/legend/index.d.ts +4 -0
- package/dts/chart/legend/index.d.ts.map +1 -0
- package/dts/chart/line/LineChart.d.ts.map +1 -1
- package/dts/chart/scrubber/Scrubber.d.ts +8 -0
- package/dts/chart/scrubber/Scrubber.d.ts.map +1 -1
- package/dts/chart/utils/chart.d.ts +18 -0
- package/dts/chart/utils/chart.d.ts.map +1 -1
- package/esm/chart/CartesianChart.js +66 -34
- package/esm/chart/PeriodSelector.js +1 -0
- package/esm/chart/area/AreaChart.js +4 -2
- package/esm/chart/bar/Bar.js +2 -0
- package/esm/chart/bar/BarStack.js +7 -0
- package/esm/chart/bar/DefaultBar.js +2 -1
- package/esm/chart/index.js +1 -0
- package/esm/chart/legend/DefaultLegendEntry.css +1 -0
- package/esm/chart/legend/DefaultLegendEntry.js +50 -0
- package/esm/chart/legend/DefaultLegendShape.css +5 -0
- package/esm/chart/legend/DefaultLegendShape.js +47 -0
- package/esm/chart/legend/Legend.js +76 -0
- package/esm/chart/legend/index.js +3 -0
- package/esm/chart/line/LineChart.js +5 -3
- package/esm/chart/scrubber/Scrubber.js +2 -1
- package/esm/chart/utils/chart.js +13 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,20 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 3.4.0-beta.15 (1/27/2026 PST)
|
|
12
|
+
|
|
13
|
+
#### 🐞 Fixes
|
|
14
|
+
|
|
15
|
+
- Fix padding on PeriodSelector. [[#330](https://github.com/coinbase/cds/pull/330)]
|
|
16
|
+
|
|
17
|
+
## 3.4.0-beta.14 (1/22/2026 PST)
|
|
18
|
+
|
|
19
|
+
#### 🚀 Updates
|
|
20
|
+
|
|
21
|
+
- Add chart Legend component. [[#302](https://github.com/coinbase/cds/pull/302)]
|
|
22
|
+
- Add support for hideBeaconLabels in Scrubber. [[#302](https://github.com/coinbase/cds/pull/302)]
|
|
23
|
+
- Add support for custom bar components. [[#302](https://github.com/coinbase/cds/pull/302)]
|
|
24
|
+
|
|
11
25
|
## 3.4.0-beta.13 (1/20/2026 PST)
|
|
12
26
|
|
|
13
27
|
#### 🚀 Updates
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type BoxBaseProps, type BoxProps } from '@coinbase/cds-web/layout';
|
|
3
3
|
import { type ScrubberProviderProps } from './scrubber/ScrubberProvider';
|
|
4
|
-
import { type AxisConfigProps, type ChartInset, type Series } from './utils';
|
|
4
|
+
import { type AxisConfigProps, type ChartInset, type LegendPosition, type Series } from './utils';
|
|
5
5
|
export type CartesianChartBaseProps = BoxBaseProps &
|
|
6
6
|
Pick<ScrubberProviderProps, 'enableScrubbing' | 'onScrubberPositionChange'> & {
|
|
7
7
|
/**
|
|
@@ -26,6 +26,23 @@ export type CartesianChartBaseProps = BoxBaseProps &
|
|
|
26
26
|
* Inset around the entire chart (outside the axes).
|
|
27
27
|
*/
|
|
28
28
|
inset?: number | Partial<ChartInset>;
|
|
29
|
+
/**
|
|
30
|
+
* Whether to show the legend or a custom legend element.
|
|
31
|
+
* - `true` renders the default Legend component
|
|
32
|
+
* - A React element renders that element as the legend
|
|
33
|
+
* - `false` or omitted hides the legend
|
|
34
|
+
*/
|
|
35
|
+
legend?: boolean | React.ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* Position of the legend relative to the chart.
|
|
38
|
+
* @default 'bottom'
|
|
39
|
+
*/
|
|
40
|
+
legendPosition?: LegendPosition;
|
|
41
|
+
/**
|
|
42
|
+
* Accessibility label for the legend group.
|
|
43
|
+
* @default 'Legend'
|
|
44
|
+
*/
|
|
45
|
+
legendAccessibilityLabel?: string;
|
|
29
46
|
};
|
|
30
47
|
export type CartesianChartProps = Omit<BoxProps<'div'>, 'title'> &
|
|
31
48
|
CartesianChartBaseProps & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../src/chart/CartesianChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAI9E,OAAO,EAAO,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGjF,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../src/chart/CartesianChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAI9E,OAAO,EAAO,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGjF,O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ACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;OAEG;IACH,MAAM,CAAC,EAAE;QACP;;WAEG;QACH,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC3B;;WAEG;QACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KAC7B,CAAC;CACH,CAAC;AAEJ,eAAO,MAAM,cAAc,mIA2X1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PeriodSelector.d.ts","sourceRoot":"","sources":["../../src/chart/PeriodSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEvE,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,wBAAwB,EAE9B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAOxE,eAAO,MAAM,6BAA6B,4FAOrC,wBAAwB,
|
|
1
|
+
{"version":3,"file":"PeriodSelector.d.ts","sourceRoot":"","sources":["../../src/chart/PeriodSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEvE,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,wBAAwB,EAE9B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAOxE,eAAO,MAAM,6BAA6B,4FAOrC,wBAAwB,oDAyB5B,CAAC;AAEF,eAAO,MAAM,0BAA0B,SAAS,CAAC;AAEjD,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAC;AAE3E,MAAM,MAAM,qBAAqB,GAAG,aAAa,GAAG;IAClD;;;OAGG;IACH,KAAK,CAAC,EAAE,M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AG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,QAAQ,EAAE,cAAc,CAAC,GAAG;IAC/D;;OAEG;IACH,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,GAAG,sCAoDf,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type XAxisProps, type YAxisProps } from '../axis';
|
|
2
2
|
import { type CartesianChartBaseProps, type CartesianChartProps } from '../CartesianChart';
|
|
3
|
-
import { type AxisConfigProps
|
|
3
|
+
import { type AxisConfigProps } from '../utils';
|
|
4
4
|
import { type BarPlotProps } from './BarPlot';
|
|
5
|
+
import type { BarSeries } from './BarStack';
|
|
5
6
|
export type BarChartBaseProps = Omit<CartesianChartBaseProps, 'xAxis' | 'yAxis' | 'series'> &
|
|
6
7
|
Pick<
|
|
7
8
|
BarPlotProps,
|
|
@@ -20,8 +21,9 @@ export type BarChartBaseProps = Omit<CartesianChartBaseProps, 'xAxis' | 'yAxis'
|
|
|
20
21
|
> & {
|
|
21
22
|
/**
|
|
22
23
|
* Configuration objects that define how to visualize the data.
|
|
24
|
+
* Each series can optionally define its own BarComponent.
|
|
23
25
|
*/
|
|
24
|
-
series?: Array<
|
|
26
|
+
series?: Array<BarSeries>;
|
|
25
27
|
/**
|
|
26
28
|
* Whether to stack the areas on top of each other.
|
|
27
29
|
* When true, each series builds cumulative values on top of the previous series.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,UAAU,EAAS,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,
|
|
1
|
+
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,UAAU,EAAS,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,eAAe,EAAoD,MAAM,UAAU,CAAC;AAElG,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,uBAAuB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,GACzF,IAAI,CACF,YAAY,EACV,YAAY,GACZ,cAAc,GACd,aAAa,GACb,QAAQ,GACR,aAAa,GACb,cAAc,GACd,mBAAmB,GACnB,eAAe,GACf,UAAU,GACV,YAAY,GACZ,cAAc,GACd,YAAY,CACf,GAAG;IACF;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAC1B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;IAC9C;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;CAC/C,CAAC;AAEJ,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAC;AAE1D,eAAO,MAAM,QAAQ,2JA0HpB,CAAC"}
|
|
@@ -2,7 +2,16 @@ import React from 'react';
|
|
|
2
2
|
import type { Rect } from '@coinbase/cds-common';
|
|
3
3
|
import type { Transition } from 'framer-motion';
|
|
4
4
|
import type { ChartScaleFunction, Series } from '../utils';
|
|
5
|
-
import { type BarProps } from './Bar';
|
|
5
|
+
import { type BarComponent, type BarProps } from './Bar';
|
|
6
|
+
/**
|
|
7
|
+
* Extended series type that includes bar-specific properties.
|
|
8
|
+
*/
|
|
9
|
+
export type BarSeries = Series & {
|
|
10
|
+
/**
|
|
11
|
+
* Custom component to render bars for this series.
|
|
12
|
+
*/
|
|
13
|
+
BarComponent?: BarComponent;
|
|
14
|
+
};
|
|
6
15
|
export type BarStackBaseProps = Pick<
|
|
7
16
|
BarProps,
|
|
8
17
|
'BarComponent' | 'fillOpacity' | 'stroke' | 'strokeWidth' | 'borderRadius'
|
|
@@ -10,7 +19,7 @@ export type BarStackBaseProps = Pick<
|
|
|
10
19
|
/**
|
|
11
20
|
* Array of series configurations that belong to this stack.
|
|
12
21
|
*/
|
|
13
|
-
series:
|
|
22
|
+
series: BarSeries[];
|
|
14
23
|
/**
|
|
15
24
|
* The category index for this stack.
|
|
16
25
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarStack.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAG3D,OAAO,
|
|
1
|
+
{"version":3,"file":"BarStack.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/BarStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAG3D,OAAO,EAAO,KAAK,YAAY,EAAE,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAK9D;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAClC,QAAQ,EACR,cAAc,GAAG,aAAa,GAAG,QAAQ,GAAG,aAAa,GAAG,cAAc,CAC3E,GAAG;IACF;;OAEG;IACH,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,EAAE,kBAAkB,CAAC;IAC3B;;OAEG;IACH,IAAI,EAAE,IA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G;IAChD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"DefaultBar.d.ts","sourceRoot":"","sources":["../../../src/chart/bar/DefaultBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAM7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG;IAChD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,6CA0CtB,CAAC"}
|
package/dts/chart/index.d.ts
CHANGED
package/dts/chart/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chart/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chart/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type HStackDefaultElement, type HStackProps } from '@coinbase/cds-web/layout';
|
|
2
|
+
import type { LegendEntryProps } from './Legend';
|
|
3
|
+
export type DefaultLegendEntryProps = LegendEntryProps &
|
|
4
|
+
Omit<HStackProps<HStackDefaultElement>, 'children' | 'color'>;
|
|
5
|
+
export declare const DefaultLegendEntry: import('react').MemoExoticComponent<
|
|
6
|
+
({
|
|
7
|
+
seriesId,
|
|
8
|
+
label,
|
|
9
|
+
color,
|
|
10
|
+
shape,
|
|
11
|
+
ShapeComponent,
|
|
12
|
+
gap,
|
|
13
|
+
className,
|
|
14
|
+
classNames,
|
|
15
|
+
style,
|
|
16
|
+
styles,
|
|
17
|
+
testID,
|
|
18
|
+
...props
|
|
19
|
+
}: DefaultLegendEntryProps) => import('react/jsx-runtime').JSX.Element
|
|
20
|
+
>;
|
|
21
|
+
//# sourceMappingURL=DefaultLegendEntry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultLegendEntry.d.ts","sourceRoot":"","sources":["../../../src/chart/legend/DefaultLegendEntry.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAU,KAAK,oBAAoB,EAAE,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAK/F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAMjD,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,GACpD,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC;AAEhE,eAAO,MAAM,kBAAkB,uJAc1B,uBAAuB,6CAyB3B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type BoxProps } from '@coinbase/cds-web/layout';
|
|
3
|
+
import type { LegendShapeProps } from './Legend';
|
|
4
|
+
export type DefaultLegendShapeProps = LegendShapeProps &
|
|
5
|
+
Omit<BoxProps<'div'>, 'children' | 'color'>;
|
|
6
|
+
export declare const DefaultLegendShape: React.NamedExoticComponent<DefaultLegendShapeProps>;
|
|
7
|
+
//# sourceMappingURL=DefaultLegendShape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultLegendShape.d.ts","sourceRoot":"","sources":["../../../src/chart/legend/DefaultLegendShape.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAK9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AA2CjD,MAAM,MAAM,uBAAuB,GAAG,gBAAgB,GACpD,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC;AAE9C,eAAO,MAAM,kBAAkB,qDAY9B,CAAC"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { type BoxBaseProps, type BoxDefaultElement, type BoxProps } from '@coinbase/cds-web/layout';
|
|
2
|
+
import type { LegendShape } from '../utils';
|
|
3
|
+
export type LegendShapeProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Color of the legend shape.
|
|
6
|
+
* @default 'var(--color-fgPrimary)'
|
|
7
|
+
*/
|
|
8
|
+
color?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Shape to display. Can be a preset shape or a custom ReactNode.
|
|
11
|
+
* @default 'circle'
|
|
12
|
+
*/
|
|
13
|
+
shape?: LegendShape;
|
|
14
|
+
/**
|
|
15
|
+
* Custom class name for the shape element.
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Custom styles for the shape element.
|
|
20
|
+
*/
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
};
|
|
23
|
+
export type LegendShapeComponent = React.FC<LegendShapeProps>;
|
|
24
|
+
export type LegendEntryProps = {
|
|
25
|
+
/**
|
|
26
|
+
* Id of the series.
|
|
27
|
+
*/
|
|
28
|
+
seriesId: string;
|
|
29
|
+
/**
|
|
30
|
+
* Label of the series.
|
|
31
|
+
* If a ReactNode is provided, it replaces the default Text component.
|
|
32
|
+
*/
|
|
33
|
+
label: React.ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Color of the series.
|
|
36
|
+
* @default 'var(--color-fgPrimary)'
|
|
37
|
+
*/
|
|
38
|
+
color?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Shape of the series.
|
|
41
|
+
*/
|
|
42
|
+
shape?: LegendShape;
|
|
43
|
+
/**
|
|
44
|
+
* Custom component to render the legend shape.
|
|
45
|
+
* @default DefaultLegendShape
|
|
46
|
+
*/
|
|
47
|
+
ShapeComponent?: LegendShapeComponent;
|
|
48
|
+
/**
|
|
49
|
+
* Custom class name for the root element.
|
|
50
|
+
*/
|
|
51
|
+
className?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Custom class names for the component parts.
|
|
54
|
+
*/
|
|
55
|
+
classNames?: {
|
|
56
|
+
/**
|
|
57
|
+
* Custom class name for the root element.
|
|
58
|
+
*/
|
|
59
|
+
root?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Custom class name for the shape element.
|
|
62
|
+
*/
|
|
63
|
+
shape?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Custom class name for the label element.
|
|
66
|
+
* @note not applied when label is a ReactNode.
|
|
67
|
+
*/
|
|
68
|
+
label?: string;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Custom styles for the root element.
|
|
72
|
+
*/
|
|
73
|
+
style?: React.CSSProperties;
|
|
74
|
+
/**
|
|
75
|
+
* Custom styles for the component parts.
|
|
76
|
+
*/
|
|
77
|
+
styles?: {
|
|
78
|
+
/**
|
|
79
|
+
* Custom styles for the root element.
|
|
80
|
+
*/
|
|
81
|
+
root?: React.CSSProperties;
|
|
82
|
+
/**
|
|
83
|
+
* Custom styles for the shape element.
|
|
84
|
+
*/
|
|
85
|
+
shape?: React.CSSProperties;
|
|
86
|
+
/**
|
|
87
|
+
* Custom styles for the label element.
|
|
88
|
+
* @note not applied when label is a ReactNode.
|
|
89
|
+
*/
|
|
90
|
+
label?: React.CSSProperties;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export type LegendEntryComponent = React.FC<LegendEntryProps>;
|
|
94
|
+
export type LegendBaseProps = Omit<BoxBaseProps, 'children'> & {
|
|
95
|
+
/**
|
|
96
|
+
* Array of series IDs to display in the legend.
|
|
97
|
+
* By default, all series will be displayed.
|
|
98
|
+
*/
|
|
99
|
+
seriesIds?: string[];
|
|
100
|
+
/**
|
|
101
|
+
* Custom component to render each legend entry.
|
|
102
|
+
* @default DefaultLegendEntry
|
|
103
|
+
*/
|
|
104
|
+
EntryComponent?: LegendEntryComponent;
|
|
105
|
+
/**
|
|
106
|
+
* Custom component to render the legend shape within each entry.
|
|
107
|
+
* Only used when EntryComponent is not provided or is DefaultLegendEntry.
|
|
108
|
+
* @default DefaultLegendShape
|
|
109
|
+
*/
|
|
110
|
+
ShapeComponent?: LegendShapeComponent;
|
|
111
|
+
/**
|
|
112
|
+
* Accessibility label for the legend group.
|
|
113
|
+
* @default 'Legend'
|
|
114
|
+
*/
|
|
115
|
+
accessibilityLabel?: string;
|
|
116
|
+
};
|
|
117
|
+
export type LegendProps = Omit<BoxProps<BoxDefaultElement>, 'children'> &
|
|
118
|
+
LegendBaseProps & {
|
|
119
|
+
/**
|
|
120
|
+
* Custom class names for the component parts.
|
|
121
|
+
*/
|
|
122
|
+
classNames?: {
|
|
123
|
+
/**
|
|
124
|
+
* Custom class name for the root element.
|
|
125
|
+
*/
|
|
126
|
+
root?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Custom class name for each entry element.
|
|
129
|
+
*/
|
|
130
|
+
entry?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Custom class name for the shape element within each entry.
|
|
133
|
+
*/
|
|
134
|
+
entryShape?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Custom class name for the label element within each entry.
|
|
137
|
+
* @note not applied when label is a ReactNode.
|
|
138
|
+
*/
|
|
139
|
+
entryLabel?: string;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* Custom styles for the component parts.
|
|
143
|
+
*/
|
|
144
|
+
styles?: {
|
|
145
|
+
/**
|
|
146
|
+
* Custom styles for the root element.
|
|
147
|
+
*/
|
|
148
|
+
root?: React.CSSProperties;
|
|
149
|
+
/**
|
|
150
|
+
* Custom styles for each entry element.
|
|
151
|
+
*/
|
|
152
|
+
entry?: React.CSSProperties;
|
|
153
|
+
/**
|
|
154
|
+
* Custom styles for the shape element within each entry.
|
|
155
|
+
*/
|
|
156
|
+
entryShape?: React.CSSProperties;
|
|
157
|
+
/**
|
|
158
|
+
* Custom styles for the label element within each entry.
|
|
159
|
+
* @note not applied when label is a ReactNode.
|
|
160
|
+
*/
|
|
161
|
+
entryLabel?: React.CSSProperties;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
export declare const Legend: import('react').MemoExoticComponent<
|
|
165
|
+
import('react').ForwardRefExoticComponent<
|
|
166
|
+
Omit<LegendProps, 'ref'> & import('react').RefAttributes<HTMLDivElement>
|
|
167
|
+
>
|
|
168
|
+
>;
|
|
169
|
+
//# sourceMappingURL=Legend.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Legend.d.ts","sourceRoot":"","sources":["../../../src/chart/legend/Legend.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,YAAY,E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MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;IAC9C;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;CAC/C,CAAC;AAEJ,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAC7C,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAC;AAE1D,eAAO,MAAM,SAAS,4JA6HrB,CAAC"}
|
|
@@ -125,6 +125,10 @@ export type ScrubberBaseProps = SharedProps &
|
|
|
125
125
|
* By default, all series will be highlighted.
|
|
126
126
|
*/
|
|
127
127
|
seriesIds?: string[];
|
|
128
|
+
/**
|
|
129
|
+
* Hides the beacon labels while keeping the line label visible (if provided).
|
|
130
|
+
*/
|
|
131
|
+
hideBeaconLabels?: boolean;
|
|
128
132
|
/**
|
|
129
133
|
* Hides the scrubber line.
|
|
130
134
|
* @note This hides Scrubber's ReferenceLine including the label.
|
|
@@ -225,6 +229,10 @@ export declare const Scrubber: React.MemoExoticComponent<
|
|
|
225
229
|
* By default, all series will be highlighted.
|
|
226
230
|
*/
|
|
227
231
|
seriesIds?: string[];
|
|
232
|
+
/**
|
|
233
|
+
* Hides the beacon labels while keeping the line label visible (if provided).
|
|
234
|
+
*/
|
|
235
|
+
hideBeaconLabels?: boolean;
|
|
228
236
|
/**
|
|
229
237
|
* Hides the scrubber line.
|
|
230
238
|
* @note This hides Scrubber's ReferenceLine including the label.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scrubber.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/Scrubber.tsx"],"names":[],"mappings":"AAAA,OAAO,KA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ACY,MAAM;;IAIvB;;;OAGG;yBACkB,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7D;;OAEG;aACM;QACP,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC9B,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC3B,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KACnC;IACD;;OAEG;iBACU;QACX,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;iDA0LF,CAAC"}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import type { GradientDefinition } from './gradient';
|
|
2
2
|
export declare const defaultStackId = 'DEFAULT_STACK_ID';
|
|
3
|
+
/**
|
|
4
|
+
* Shape variants available for legend items.
|
|
5
|
+
*/
|
|
6
|
+
export type LegendShapeVariant = 'circle' | 'square' | 'squircle' | 'pill';
|
|
7
|
+
/**
|
|
8
|
+
* Shape for legend items. Can be a preset variant or a custom ReactNode.
|
|
9
|
+
*/
|
|
10
|
+
export type LegendShape = LegendShapeVariant | React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Position of the legend relative to the chart.
|
|
13
|
+
*/
|
|
14
|
+
export type LegendPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
3
15
|
export type AxisBounds = {
|
|
4
16
|
min: number;
|
|
5
17
|
max: number;
|
|
@@ -50,6 +62,12 @@ export type Series = {
|
|
|
50
62
|
* If not specified, the series will not be stacked.
|
|
51
63
|
*/
|
|
52
64
|
stackId?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Shape of the legend item for this series.
|
|
67
|
+
* Can be a preset shape variant or a custom ReactNode.
|
|
68
|
+
* @default 'circle'
|
|
69
|
+
*/
|
|
70
|
+
legendShape?: LegendShape;
|
|
53
71
|
};
|
|
54
72
|
/**
|
|
55
73
|
* Calculates the domain of a chart from series data.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/chart.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAEjD,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,OAAO,CAAC,UAAU,CAAC,KAAG,MAAM,IAAI,UAChB,CAAC;AAEvD,MAAM,MAAM,MAAM,GAAG;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7D;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/chart/utils/chart.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,eAAO,MAAM,cAAc,qBAAqB,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,UA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AAC,CA0E5C,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,GACtB,OAAO,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,KAC3D,KAAK,CAAC,MAAM,GAAG,IAAI,CAerB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,EAAE,EAChB,MAAM,MAAM,EACZ,MAAM,MAAM,KACX,OAAO,CAAC,UAAU,CA2EpB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,UAK/B,CAAC;AAEF;;;;;GAKG;AACH;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,EACpC,WAAW,UAAU,KACpB,UAuBF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["series", "children", "animate", "xAxis", "yAxis", "inset", "enableScrubbing", "onScrubberPositionChange", "width", "height", "className", "classNames", "style", "styles"];
|
|
1
|
+
const _excluded = ["series", "children", "animate", "xAxis", "yAxis", "inset", "enableScrubbing", "onScrubberPositionChange", "legend", "legendPosition", "legendAccessibilityLabel", "width", "height", "className", "classNames", "style", "styles", "accessibilityLabel"];
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -12,8 +12,9 @@ import { useDimensions } from '@coinbase/cds-web/hooks/useDimensions';
|
|
|
12
12
|
import { Box } from '@coinbase/cds-web/layout';
|
|
13
13
|
import { ScrubberProvider } from './scrubber/ScrubberProvider';
|
|
14
14
|
import { CartesianChartProvider } from './ChartProvider';
|
|
15
|
+
import { Legend } from './legend';
|
|
15
16
|
import { defaultAxisId, defaultChartInset, getAxisConfig, getAxisDomain, getAxisRange, getAxisScale, getChartInset, getStackedSeriesData as calculateStackedSeriesData, useTotalAxisPadding } from './utils';
|
|
16
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
18
|
const focusStylesCss = "cds-focusStylesCss-f4oy7ru";
|
|
18
19
|
export const CartesianChart = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
19
20
|
let {
|
|
@@ -25,12 +26,16 @@ export const CartesianChart = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, r
|
|
|
25
26
|
inset,
|
|
26
27
|
enableScrubbing,
|
|
27
28
|
onScrubberPositionChange,
|
|
29
|
+
legend,
|
|
30
|
+
legendPosition = 'bottom',
|
|
31
|
+
legendAccessibilityLabel,
|
|
28
32
|
width = '100%',
|
|
29
33
|
height = '100%',
|
|
30
34
|
className,
|
|
31
35
|
classNames,
|
|
32
36
|
style,
|
|
33
|
-
styles
|
|
37
|
+
styles,
|
|
38
|
+
accessibilityLabel
|
|
34
39
|
} = _ref,
|
|
35
40
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
36
41
|
const {
|
|
@@ -269,43 +274,70 @@ export const CartesianChart = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, r
|
|
|
269
274
|
}), [series, getSeries, getStackedSeriesData, animate, chartWidth, chartHeight, getXAxis, getYAxis, getXScale, getYScale, chartRect, dataLength, registerAxis, unregisterAxis, getAxisBounds]);
|
|
270
275
|
const rootClassNames = useMemo(() => cx(className, classNames === null || classNames === void 0 ? void 0 : classNames.root), [className, classNames]);
|
|
271
276
|
const rootStyles = useMemo(() => _objectSpread(_objectSpread({}, style), styles === null || styles === void 0 ? void 0 : styles.root), [style, styles === null || styles === void 0 ? void 0 : styles.root]);
|
|
277
|
+
const legendElement = useMemo(() => {
|
|
278
|
+
if (!legend) return;
|
|
279
|
+
if (legend === true) {
|
|
280
|
+
const isHorizontal = legendPosition === 'top' || legendPosition === 'bottom';
|
|
281
|
+
const flexDirection = isHorizontal ? 'row' : 'column';
|
|
282
|
+
return /*#__PURE__*/_jsx(Legend, {
|
|
283
|
+
accessibilityLabel: legendAccessibilityLabel,
|
|
284
|
+
flexDirection: flexDirection
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
return legend;
|
|
288
|
+
}, [legend, legendAccessibilityLabel, legendPosition]);
|
|
289
|
+
const rootBoxProps = useMemo(() => _objectSpread({
|
|
290
|
+
className: rootClassNames,
|
|
291
|
+
height,
|
|
292
|
+
style: rootStyles,
|
|
293
|
+
width
|
|
294
|
+
}, props), [rootClassNames, height, rootStyles, width, props]);
|
|
295
|
+
const chartContent = /*#__PURE__*/_jsx(Box, {
|
|
296
|
+
ref: node => {
|
|
297
|
+
observe(node);
|
|
298
|
+
},
|
|
299
|
+
height: legend ? undefined : height,
|
|
300
|
+
style: {
|
|
301
|
+
flex: 1,
|
|
302
|
+
minHeight: 0,
|
|
303
|
+
minWidth: 0
|
|
304
|
+
},
|
|
305
|
+
width: legend ? undefined : width,
|
|
306
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
307
|
+
ref: node => {
|
|
308
|
+
const svgElement = node;
|
|
309
|
+
svgRef.current = svgElement;
|
|
310
|
+
// Forward the ref to the user
|
|
311
|
+
if (ref) {
|
|
312
|
+
if (typeof ref === 'function') {
|
|
313
|
+
ref(svgElement);
|
|
314
|
+
} else {
|
|
315
|
+
ref.current = svgElement;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
accessibilityLabel: accessibilityLabel,
|
|
320
|
+
"aria-live": "polite",
|
|
321
|
+
as: "svg",
|
|
322
|
+
className: cx(enableScrubbing && focusStylesCss, classNames === null || classNames === void 0 ? void 0 : classNames.chart),
|
|
323
|
+
height: "100%",
|
|
324
|
+
style: styles === null || styles === void 0 ? void 0 : styles.chart,
|
|
325
|
+
tabIndex: enableScrubbing ? 0 : undefined,
|
|
326
|
+
width: "100%",
|
|
327
|
+
children: children
|
|
328
|
+
})
|
|
329
|
+
});
|
|
272
330
|
return /*#__PURE__*/_jsx(CartesianChartProvider, {
|
|
273
331
|
value: contextValue,
|
|
274
332
|
children: /*#__PURE__*/_jsx(ScrubberProvider, {
|
|
275
333
|
enableScrubbing: !!enableScrubbing,
|
|
276
334
|
onScrubberPositionChange: onScrubberPositionChange,
|
|
277
335
|
svgRef: svgRef,
|
|
278
|
-
children: /*#__PURE__*/
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
height: height,
|
|
284
|
-
style: rootStyles,
|
|
285
|
-
width: width
|
|
286
|
-
}, props), {}, {
|
|
287
|
-
children: /*#__PURE__*/_jsx(Box, {
|
|
288
|
-
ref: node => {
|
|
289
|
-
const svgElement = node;
|
|
290
|
-
svgRef.current = svgElement;
|
|
291
|
-
// Forward the ref to the user
|
|
292
|
-
if (ref) {
|
|
293
|
-
if (typeof ref === 'function') {
|
|
294
|
-
ref(svgElement);
|
|
295
|
-
} else {
|
|
296
|
-
ref.current = svgElement;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
"aria-live": "polite",
|
|
301
|
-
as: "svg",
|
|
302
|
-
className: cx(enableScrubbing && focusStylesCss, classNames === null || classNames === void 0 ? void 0 : classNames.chart),
|
|
303
|
-
height: "100%",
|
|
304
|
-
style: styles === null || styles === void 0 ? void 0 : styles.chart,
|
|
305
|
-
tabIndex: enableScrubbing ? 0 : undefined,
|
|
306
|
-
width: "100%",
|
|
307
|
-
children: children
|
|
308
|
-
})
|
|
336
|
+
children: legend ? /*#__PURE__*/_jsxs(Box, _objectSpread(_objectSpread({}, rootBoxProps), {}, {
|
|
337
|
+
flexDirection: legendPosition === 'top' || legendPosition === 'bottom' ? 'column' : 'row',
|
|
338
|
+
children: [(legendPosition === 'top' || legendPosition === 'left') && legendElement, chartContent, (legendPosition === 'bottom' || legendPosition === 'right') && legendElement]
|
|
339
|
+
})) : /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread({}, rootBoxProps), {}, {
|
|
340
|
+
children: chartContent
|
|
309
341
|
}))
|
|
310
342
|
})
|
|
311
343
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const _excluded = ["series", "stacked", "AreaComponent", "curve", "fillOpacity", "type", "connectNulls", "transition", "LineComponent", "strokeWidth", "showXAxis", "showYAxis", "showLines", "lineType", "xAxis", "yAxis", "inset", "children"],
|
|
2
2
|
_excluded2 = ["scaleType", "data", "categoryPadding", "domain", "domainLimit", "range"],
|
|
3
3
|
_excluded3 = ["scaleType", "data", "categoryPadding", "domain", "domainLimit", "range", "id"],
|
|
4
|
-
_excluded4 = ["id", "data", "label", "color", "yAxisId", "opacity", "LineComponent", "stackId", "transition"],
|
|
5
|
-
_excluded5 = ["id", "data", "label", "color", "yAxisId", "fill", "fillOpacity", "stackId", "type", "lineType", "transition"];
|
|
4
|
+
_excluded4 = ["id", "data", "label", "color", "yAxisId", "opacity", "LineComponent", "stackId", "legendShape", "transition"],
|
|
5
|
+
_excluded5 = ["id", "data", "label", "color", "yAxisId", "fill", "fillOpacity", "stackId", "legendShape", "type", "lineType", "transition"];
|
|
6
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -131,6 +131,7 @@ export const AreaChart = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) =
|
|
|
131
131
|
opacity,
|
|
132
132
|
LineComponent,
|
|
133
133
|
stackId,
|
|
134
|
+
legendShape,
|
|
134
135
|
transition: seriesTransition
|
|
135
136
|
} = _ref4,
|
|
136
137
|
areaPropsFromSeries = _objectWithoutProperties(_ref4, _excluded4);
|
|
@@ -153,6 +154,7 @@ export const AreaChart = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) =
|
|
|
153
154
|
fill,
|
|
154
155
|
fillOpacity,
|
|
155
156
|
stackId,
|
|
157
|
+
legendShape,
|
|
156
158
|
type,
|
|
157
159
|
// Area type (don't pass to Line)
|
|
158
160
|
lineType: seriesLineType,
|
package/esm/chart/bar/Bar.js
CHANGED
|
@@ -23,6 +23,7 @@ export const Bar = /*#__PURE__*/memo(_ref => {
|
|
|
23
23
|
originY,
|
|
24
24
|
dataX,
|
|
25
25
|
dataY,
|
|
26
|
+
seriesId,
|
|
26
27
|
BarComponent = DefaultBar,
|
|
27
28
|
fill = 'var(--color-fgPrimary)',
|
|
28
29
|
fillOpacity = 1,
|
|
@@ -51,6 +52,7 @@ export const Bar = /*#__PURE__*/memo(_ref => {
|
|
|
51
52
|
originY: effectiveOriginY,
|
|
52
53
|
roundBottom: roundBottom,
|
|
53
54
|
roundTop: roundTop,
|
|
55
|
+
seriesId: seriesId,
|
|
54
56
|
stroke: stroke,
|
|
55
57
|
strokeWidth: strokeWidth,
|
|
56
58
|
transition: transition,
|
|
@@ -10,6 +10,11 @@ import { Bar } from './Bar';
|
|
|
10
10
|
import { DefaultBarStack } from './DefaultBarStack';
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
const EPSILON = 1e-4;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Extended series type that includes bar-specific properties.
|
|
16
|
+
*/
|
|
17
|
+
|
|
13
18
|
/**
|
|
14
19
|
* BarStack component that renders a single stack of bars at a specific category index.
|
|
15
20
|
* Handles the stacking logic for bars within a single category.
|
|
@@ -158,6 +163,7 @@ export const BarStack = /*#__PURE__*/memo(_ref => {
|
|
|
158
163
|
// Check if the bar should be rounded based on the baseline, with an epsilon to handle floating-point rounding
|
|
159
164
|
roundTop: roundBaseline || Math.abs(barTop - baseline) >= EPSILON,
|
|
160
165
|
roundBottom: roundBaseline || Math.abs(barBottom - baseline) >= EPSILON,
|
|
166
|
+
BarComponent: s.BarComponent,
|
|
161
167
|
shouldApplyGap
|
|
162
168
|
});
|
|
163
169
|
});
|
|
@@ -533,6 +539,7 @@ export const BarStack = /*#__PURE__*/memo(_ref => {
|
|
|
533
539
|
originY: baseline,
|
|
534
540
|
roundBottom: bar.roundBottom,
|
|
535
541
|
roundTop: bar.roundTop,
|
|
542
|
+
seriesId: bar.seriesId,
|
|
536
543
|
stroke: (_bar$stroke = bar.stroke) !== null && _bar$stroke !== void 0 ? _bar$stroke : defaultStroke,
|
|
537
544
|
strokeWidth: (_bar$strokeWidth = bar.strokeWidth) !== null && _bar$strokeWidth !== void 0 ? _bar$strokeWidth : defaultStrokeWidth,
|
|
538
545
|
transition: transition,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["x", "width", "borderRadius", "roundTop", "roundBottom", "originY", "d", "fill", "fillOpacity", "dataX", "dataY", "transition"];
|
|
1
|
+
const _excluded = ["x", "width", "borderRadius", "roundTop", "roundBottom", "originY", "d", "fill", "fillOpacity", "dataX", "dataY", "seriesId", "transition"];
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -27,6 +27,7 @@ export const DefaultBar = /*#__PURE__*/memo(_ref => {
|
|
|
27
27
|
fillOpacity = 1,
|
|
28
28
|
dataX,
|
|
29
29
|
dataY,
|
|
30
|
+
seriesId,
|
|
30
31
|
transition
|
|
31
32
|
} = _ref,
|
|
32
33
|
props = _objectWithoutProperties(_ref, _excluded);
|
package/esm/chart/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.cds-legendEntryCss-l16mq69f{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const _excluded = ["seriesId", "label", "color", "shape", "ShapeComponent", "gap", "className", "classNames", "style", "styles", "testID"];
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
8
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
9
|
+
import { memo } from 'react';
|
|
10
|
+
import { cx } from '@coinbase/cds-web';
|
|
11
|
+
import { HStack } from '@coinbase/cds-web/layout';
|
|
12
|
+
import { Text } from '@coinbase/cds-web/typography';
|
|
13
|
+
import { DefaultLegendShape } from './DefaultLegendShape';
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const legendEntryCss = "cds-legendEntryCss-l16mq69f";
|
|
16
|
+
export const DefaultLegendEntry = /*#__PURE__*/memo(_ref => {
|
|
17
|
+
let {
|
|
18
|
+
seriesId,
|
|
19
|
+
label,
|
|
20
|
+
color,
|
|
21
|
+
shape,
|
|
22
|
+
ShapeComponent = DefaultLegendShape,
|
|
23
|
+
gap = 1,
|
|
24
|
+
className,
|
|
25
|
+
classNames,
|
|
26
|
+
style,
|
|
27
|
+
styles,
|
|
28
|
+
testID
|
|
29
|
+
} = _ref,
|
|
30
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
31
|
+
return /*#__PURE__*/_jsxs(HStack, _objectSpread(_objectSpread({
|
|
32
|
+
className: cx(legendEntryCss, className, classNames === null || classNames === void 0 ? void 0 : classNames.root),
|
|
33
|
+
"data-testid": testID,
|
|
34
|
+
gap: gap,
|
|
35
|
+
style: _objectSpread(_objectSpread({}, style), styles === null || styles === void 0 ? void 0 : styles.root)
|
|
36
|
+
}, props), {}, {
|
|
37
|
+
children: [/*#__PURE__*/_jsx(ShapeComponent, {
|
|
38
|
+
className: classNames === null || classNames === void 0 ? void 0 : classNames.shape,
|
|
39
|
+
color: color,
|
|
40
|
+
shape: shape,
|
|
41
|
+
style: styles === null || styles === void 0 ? void 0 : styles.shape
|
|
42
|
+
}), typeof label === 'string' ? /*#__PURE__*/_jsx(Text, {
|
|
43
|
+
className: classNames === null || classNames === void 0 ? void 0 : classNames.label,
|
|
44
|
+
font: "label1",
|
|
45
|
+
style: styles === null || styles === void 0 ? void 0 : styles.label,
|
|
46
|
+
children: label
|
|
47
|
+
}) : label]
|
|
48
|
+
}));
|
|
49
|
+
});
|
|
50
|
+
import "./DefaultLegendEntry.css";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
.cds-containerCss-c18taxk5{width:10px;height:24px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}
|
|
2
|
+
.cds-pillCss-p17vg36s{width:6px;height:24px;border-radius:3px;}
|
|
3
|
+
.cds-circleCss-cge4n06{width:10px;height:10px;border-radius:5px;}
|
|
4
|
+
.cds-squareCss-s4trv9b{width:10px;height:10px;}
|
|
5
|
+
.cds-squircleCss-s1e4cx3y{width:10px;height:10px;border-radius:2px;}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const _excluded = ["color", "shape", "className", "style"];
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
8
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
9
|
+
import React, { memo } from 'react';
|
|
10
|
+
import { cx } from '@coinbase/cds-web';
|
|
11
|
+
import { Box } from '@coinbase/cds-web/layout';
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
const containerCss = "cds-containerCss-c18taxk5";
|
|
14
|
+
const pillCss = "cds-pillCss-p17vg36s";
|
|
15
|
+
const circleCss = "cds-circleCss-cge4n06";
|
|
16
|
+
const squareCss = "cds-squareCss-s4trv9b";
|
|
17
|
+
const squircleCss = "cds-squircleCss-s1e4cx3y";
|
|
18
|
+
const stylesByVariant = {
|
|
19
|
+
pill: pillCss,
|
|
20
|
+
circle: circleCss,
|
|
21
|
+
square: squareCss,
|
|
22
|
+
squircle: squircleCss
|
|
23
|
+
};
|
|
24
|
+
const isVariantShape = shape => typeof shape === 'string' && shape in stylesByVariant;
|
|
25
|
+
export const DefaultLegendShape = /*#__PURE__*/memo(_ref => {
|
|
26
|
+
let {
|
|
27
|
+
color = 'var(--color-fgPrimary)',
|
|
28
|
+
shape = 'circle',
|
|
29
|
+
className,
|
|
30
|
+
style
|
|
31
|
+
} = _ref,
|
|
32
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
+
if (!isVariantShape(shape)) return shape;
|
|
34
|
+
const variantStyle = stylesByVariant[shape];
|
|
35
|
+
return /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread({
|
|
36
|
+
className: cx(containerCss, className),
|
|
37
|
+
style: style
|
|
38
|
+
}, props), {}, {
|
|
39
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
40
|
+
className: variantStyle,
|
|
41
|
+
style: {
|
|
42
|
+
backgroundColor: color
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
47
|
+
import "./DefaultLegendShape.css";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
const _excluded = ["flexDirection", "justifyContent", "alignItems", "flexWrap", "columnGap", "rowGap", "seriesIds", "EntryComponent", "ShapeComponent", "accessibilityLabel", "className", "classNames", "style", "styles"];
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
8
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
9
|
+
import { forwardRef, memo, useMemo } from 'react';
|
|
10
|
+
import { Box } from '@coinbase/cds-web/layout';
|
|
11
|
+
import { useCartesianChartContext } from '../ChartProvider';
|
|
12
|
+
import { DefaultLegendEntry } from './DefaultLegendEntry';
|
|
13
|
+
import { DefaultLegendShape } from './DefaultLegendShape';
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
export const Legend = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
16
|
+
var _classNames$root;
|
|
17
|
+
let {
|
|
18
|
+
flexDirection = 'row',
|
|
19
|
+
justifyContent = 'center',
|
|
20
|
+
alignItems = flexDirection === 'row' ? 'center' : 'flex-start',
|
|
21
|
+
flexWrap = 'wrap',
|
|
22
|
+
columnGap = 2,
|
|
23
|
+
rowGap = 0.75,
|
|
24
|
+
seriesIds,
|
|
25
|
+
EntryComponent = DefaultLegendEntry,
|
|
26
|
+
ShapeComponent = DefaultLegendShape,
|
|
27
|
+
accessibilityLabel = 'Legend',
|
|
28
|
+
className,
|
|
29
|
+
classNames,
|
|
30
|
+
style,
|
|
31
|
+
styles
|
|
32
|
+
} = _ref,
|
|
33
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
34
|
+
const {
|
|
35
|
+
series
|
|
36
|
+
} = useCartesianChartContext();
|
|
37
|
+
const filteredSeries = useMemo(() => {
|
|
38
|
+
if (seriesIds === undefined) return series;
|
|
39
|
+
return series.filter(s => seriesIds.includes(s.id));
|
|
40
|
+
}, [series, seriesIds]);
|
|
41
|
+
if (filteredSeries.length === 0) return;
|
|
42
|
+
return /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread({
|
|
43
|
+
ref: ref,
|
|
44
|
+
accessibilityLabel: accessibilityLabel,
|
|
45
|
+
alignItems: alignItems,
|
|
46
|
+
className: (_classNames$root = classNames === null || classNames === void 0 ? void 0 : classNames.root) !== null && _classNames$root !== void 0 ? _classNames$root : className,
|
|
47
|
+
columnGap: columnGap,
|
|
48
|
+
flexDirection: flexDirection,
|
|
49
|
+
flexWrap: flexWrap,
|
|
50
|
+
justifyContent: justifyContent,
|
|
51
|
+
role: "group",
|
|
52
|
+
rowGap: rowGap,
|
|
53
|
+
style: _objectSpread(_objectSpread({}, style), styles === null || styles === void 0 ? void 0 : styles.root)
|
|
54
|
+
}, props), {}, {
|
|
55
|
+
children: filteredSeries.map(s => {
|
|
56
|
+
var _s$label;
|
|
57
|
+
return /*#__PURE__*/_jsx(EntryComponent, {
|
|
58
|
+
ShapeComponent: ShapeComponent,
|
|
59
|
+
classNames: {
|
|
60
|
+
root: classNames === null || classNames === void 0 ? void 0 : classNames.entry,
|
|
61
|
+
shape: classNames === null || classNames === void 0 ? void 0 : classNames.entryShape,
|
|
62
|
+
label: classNames === null || classNames === void 0 ? void 0 : classNames.entryLabel
|
|
63
|
+
},
|
|
64
|
+
color: s.color,
|
|
65
|
+
label: (_s$label = s.label) !== null && _s$label !== void 0 ? _s$label : s.id,
|
|
66
|
+
seriesId: s.id,
|
|
67
|
+
shape: s.legendShape,
|
|
68
|
+
styles: {
|
|
69
|
+
root: styles === null || styles === void 0 ? void 0 : styles.entry,
|
|
70
|
+
shape: styles === null || styles === void 0 ? void 0 : styles.entryShape,
|
|
71
|
+
label: styles === null || styles === void 0 ? void 0 : styles.entryLabel
|
|
72
|
+
}
|
|
73
|
+
}, s.id);
|
|
74
|
+
})
|
|
75
|
+
}));
|
|
76
|
+
}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const _excluded = ["series", "showArea", "areaType", "type", "onPointClick", "LineComponent", "AreaComponent", "curve", "points", "strokeWidth", "strokeOpacity", "connectNulls", "transition", "opacity", "showXAxis", "showYAxis", "xAxis", "yAxis", "inset", "children"],
|
|
2
2
|
_excluded2 = ["scaleType", "data", "categoryPadding", "domain", "domainLimit", "range"],
|
|
3
3
|
_excluded3 = ["scaleType", "data", "categoryPadding", "domain", "domainLimit", "range", "id"],
|
|
4
|
-
_excluded4 = ["id", "data", "label", "color", "yAxisId"];
|
|
4
|
+
_excluded4 = ["id", "data", "label", "color", "yAxisId", "legendShape"];
|
|
5
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -51,7 +51,8 @@ export const LineChart = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) =
|
|
|
51
51
|
color: s.color,
|
|
52
52
|
yAxisId: s.yAxisId,
|
|
53
53
|
stackId: s.stackId,
|
|
54
|
-
gradient: s.gradient
|
|
54
|
+
gradient: s.gradient,
|
|
55
|
+
legendShape: s.legendShape
|
|
55
56
|
}));
|
|
56
57
|
}, [series]);
|
|
57
58
|
|
|
@@ -108,7 +109,8 @@ export const LineChart = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) =
|
|
|
108
109
|
data,
|
|
109
110
|
label,
|
|
110
111
|
color,
|
|
111
|
-
yAxisId
|
|
112
|
+
yAxisId,
|
|
113
|
+
legendShape
|
|
112
114
|
} = _ref4,
|
|
113
115
|
linePropsFromSeries = _objectWithoutProperties(_ref4, _excluded4);
|
|
114
116
|
return /*#__PURE__*/_jsx(Line, _objectSpread({
|
|
@@ -19,6 +19,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
19
19
|
export const Scrubber = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
|
|
20
20
|
let {
|
|
21
21
|
seriesIds,
|
|
22
|
+
hideBeaconLabels,
|
|
22
23
|
hideLine,
|
|
23
24
|
label,
|
|
24
25
|
accessibilityLabel,
|
|
@@ -180,7 +181,7 @@ export const Scrubber = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) =>
|
|
|
180
181
|
style: styles === null || styles === void 0 ? void 0 : styles.beacon,
|
|
181
182
|
testID: testID,
|
|
182
183
|
transitions: beaconTransitions
|
|
183
|
-
}), beaconLabels.length > 0 && /*#__PURE__*/_jsx(ScrubberBeaconLabelGroup, {
|
|
184
|
+
}), !hideBeaconLabels && beaconLabels.length > 0 && /*#__PURE__*/_jsx(ScrubberBeaconLabelGroup, {
|
|
184
185
|
BeaconLabelComponent: BeaconLabelComponent,
|
|
185
186
|
labelFont: beaconLabelFont,
|
|
186
187
|
labelHorizontalOffset: beaconLabelHorizontalOffset,
|
package/esm/chart/utils/chart.js
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { stack as d3Stack, stackOffsetDiverging, stackOrderNone } from 'd3-shape';
|
|
2
2
|
export const defaultStackId = 'DEFAULT_STACK_ID';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Shape variants available for legend items.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Shape for legend items. Can be a preset variant or a custom ReactNode.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Position of the legend relative to the chart.
|
|
14
|
+
*/
|
|
15
|
+
|
|
3
16
|
/**
|
|
4
17
|
* Type guard to check if bounds are complete with both min and max values.
|
|
5
18
|
* @param bounds - The bounds to validate
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-web-visualization",
|
|
3
|
-
"version": "3.4.0-beta.
|
|
3
|
+
"version": "3.4.0-beta.15",
|
|
4
4
|
"description": "Coinbase Design System - Web Sparkline",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"CHANGELOG"
|
|
39
39
|
],
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@coinbase/cds-common": "^8.
|
|
41
|
+
"@coinbase/cds-common": "^8.39.1",
|
|
42
42
|
"@coinbase/cds-lottie-files": "^3.3.4",
|
|
43
43
|
"@coinbase/cds-utils": "^2.3.5",
|
|
44
|
-
"@coinbase/cds-web": "^8.
|
|
44
|
+
"@coinbase/cds-web": "^8.39.1",
|
|
45
45
|
"react": "^18.3.1",
|
|
46
46
|
"react-dom": "^18.3.1"
|
|
47
47
|
},
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"@babel/preset-env": "^7.28.0",
|
|
59
59
|
"@babel/preset-react": "^7.27.1",
|
|
60
60
|
"@babel/preset-typescript": "^7.27.1",
|
|
61
|
-
"@coinbase/cds-common": "^8.
|
|
61
|
+
"@coinbase/cds-common": "^8.39.1",
|
|
62
62
|
"@coinbase/cds-lottie-files": "^3.3.4",
|
|
63
63
|
"@coinbase/cds-utils": "^2.3.5",
|
|
64
|
-
"@coinbase/cds-web": "^8.
|
|
64
|
+
"@coinbase/cds-web": "^8.39.1",
|
|
65
65
|
"@linaria/core": "^3.0.0-beta.22",
|
|
66
66
|
"@types/react": "^18.3.12",
|
|
67
67
|
"@types/react-dom": "^18.3.1"
|