@react-magma/charts 16.0.0-next.1 → 16.0.0-v6-next.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/dist/charts.js +1517 -114
- package/dist/charts.js.map +1 -1
- package/dist/charts.modern.module.js +1519 -117
- package/dist/charts.modern.module.js.map +1 -1
- package/dist/charts.umd.js +49696 -28876
- package/dist/charts.umd.js.map +1 -1
- package/dist/components/CarbonChart/CarbonChart.d.ts +1 -1
- package/dist/components/CarbonChart/CarbonChartArea.stories.d.ts +310 -0
- package/dist/components/CarbonChart/CarbonChartAreaStacked.stories.d.ts +136 -0
- package/dist/components/CarbonChart/CarbonChartBar.stories.d.ts +232 -0
- package/dist/components/CarbonChart/CarbonChartBarFloating.stories.d.ts +82 -0
- package/dist/components/CarbonChart/CarbonChartBarGrouped.stories.d.ts +234 -0
- package/dist/components/CarbonChart/CarbonChartBarStacked.stories.d.ts +266 -0
- package/dist/components/CarbonChart/CarbonChartBoxplot.stories.d.ts +53 -0
- package/dist/components/CarbonChart/CarbonChartBubble.stories.d.ts +196 -0
- package/dist/components/CarbonChart/CarbonChartBullet.stories.d.ts +35 -0
- package/dist/components/CarbonChart/CarbonChartCombo.stories.d.ts +580 -0
- package/dist/components/CarbonChart/CarbonChartDonut.stories.d.ts +120 -0
- package/dist/components/CarbonChart/CarbonChartGauge.stories.d.ts +43 -0
- package/dist/components/CarbonChart/CarbonChartHistogram.stories.d.ts +89 -0
- package/dist/components/CarbonChart/CarbonChartLine.stories.d.ts +577 -0
- package/dist/components/CarbonChart/CarbonChartLollipop.stories.d.ts +55 -0
- package/dist/components/CarbonChart/CarbonChartMeter.stories.d.ts +127 -0
- package/dist/components/CarbonChart/CarbonChartPie.stories.d.ts +101 -0
- package/dist/components/CarbonChart/CarbonChartRadar.stories.d.ts +98 -0
- package/dist/components/CarbonChart/CarbonChartScatter.stories.d.ts +173 -0
- package/dist/components/CarbonChart/CarbonChartSparkline.stories.d.ts +51 -0
- package/dist/components/CarbonChart/CarbonChartStep.stories.d.ts +38 -0
- package/dist/components/ChartTable/ChartTable.stories.d.ts +166 -0
- package/dist/components/LineChart/Chart.d.ts +27 -0
- package/dist/components/LineChart/ChartDataTable.d.ts +17 -0
- package/dist/components/LineChart/CustomAxisComponent.d.ts +3 -0
- package/dist/components/LineChart/CustomPointComponent.d.ts +17 -0
- package/dist/components/LineChart/DataTable.d.ts +5 -0
- package/dist/components/LineChart/GraphTooltip.d.ts +3 -0
- package/dist/components/LineChart/LegendButton.d.ts +6 -0
- package/dist/components/LineChart/LineChart.d.ts +67 -0
- package/dist/components/LineChart/LineChart.stories.d.ts +113 -0
- package/dist/components/LineChart/index.d.ts +1 -0
- package/dist/components/LineChart/magma-charts.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +21 -24
- package/src/components/CarbonChart/CarbonChart.test.js +256 -172
- package/src/components/CarbonChart/CarbonChart.tsx +44 -39
- package/src/components/CarbonChart/CarbonChartArea.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartAreaStacked.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartBar.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartBarFloating.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartBarGrouped.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartBarStacked.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartBoxplot.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartBubble.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartBullet.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartCombo.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartDonut.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartGauge.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartHistogram.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartLine.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartLollipop.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartMeter.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartPie.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartRadar.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartScatter.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartSparkline.stories.tsx +5 -3
- package/src/components/CarbonChart/CarbonChartStep.stories.tsx +5 -3
- package/src/components/ChartTable/ChartDataTable.tsx +0 -3
- package/src/components/ChartTable/ChartMoreOptionsButton.tsx +0 -1
- package/src/components/ChartTable/ChartTable.test.js +0 -8
- package/src/components/ChartTable/ChartTableButton.tsx +0 -1
- package/src/components/ChartTable/ChartToolbar.tsx +0 -1
- package/src/components/ChartTable/chartToolbarI18n.ts +1 -1
- package/src/components/LineChart/Chart.tsx +241 -0
- package/src/components/LineChart/ChartDataTable.test.js +165 -0
- package/src/components/LineChart/ChartDataTable.tsx +135 -0
- package/src/components/LineChart/CustomAxisComponent.tsx +30 -0
- package/src/components/LineChart/CustomPointComponent.tsx +93 -0
- package/src/components/LineChart/DataTable.tsx +57 -0
- package/src/components/LineChart/GraphTooltip.tsx +100 -0
- package/src/components/LineChart/LegendButton.tsx +77 -0
- package/src/components/LineChart/LineChart.stories.tsx +399 -0
- package/src/components/LineChart/LineChart.test.js +501 -0
- package/src/components/LineChart/LineChart.tsx +669 -0
- package/src/components/LineChart/index.ts +1 -0
- package/src/components/LineChart/magma-charts.ts +279 -0
- package/src/components/LineChart/test/exampleChartData.js +289 -0
- package/src/hooks/useCarbonModalFocusManagement.ts +0 -12
- package/src/index.ts +1 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
titleLevel: {
|
|
22
24
|
control: { type: 'select' },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { StoryFn, Meta } from '@storybook/react-
|
|
3
|
+
import { StoryFn, Meta } from '@storybook/react/types-6-0';
|
|
4
4
|
import { Card } from 'react-magma-dom';
|
|
5
5
|
|
|
6
6
|
import { CarbonChart, CarbonChartProps, CarbonChartType } from '.';
|
|
@@ -15,8 +15,10 @@ export default {
|
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
type: {
|
|
18
|
-
control: {
|
|
19
|
-
|
|
18
|
+
control: {
|
|
19
|
+
type: 'select',
|
|
20
|
+
options: CarbonChartType,
|
|
21
|
+
},
|
|
20
22
|
},
|
|
21
23
|
},
|
|
22
24
|
} as Meta;
|
|
@@ -32,7 +32,6 @@ function deriveColumns(
|
|
|
32
32
|
dataSet: Array<Record<string, React.ReactNode>>
|
|
33
33
|
): ChartDataTableColumn[] {
|
|
34
34
|
if (!dataSet.length) return [];
|
|
35
|
-
|
|
36
35
|
return Object.keys(dataSet[0]).map(key => ({
|
|
37
36
|
header: key.charAt(0).toUpperCase() + key.slice(1),
|
|
38
37
|
key,
|
|
@@ -45,7 +44,6 @@ export function ChartDataTable({
|
|
|
45
44
|
isInverse,
|
|
46
45
|
}: ChartDataTableProps) {
|
|
47
46
|
const resolvedColumns = columns || deriveColumns(dataSet);
|
|
48
|
-
|
|
49
47
|
return (
|
|
50
48
|
<Table isInverse={isInverse}>
|
|
51
49
|
<TableHead>
|
|
@@ -60,7 +58,6 @@ export function ChartDataTable({
|
|
|
60
58
|
const rowKey = resolvedColumns
|
|
61
59
|
.map(col => String(row[col.key] ?? ''))
|
|
62
60
|
.join('-');
|
|
63
|
-
|
|
64
61
|
return (
|
|
65
62
|
<TableRow key={`${rowKey}-${index}`}>
|
|
66
63
|
{resolvedColumns.map(col => (
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import '@testing-library/jest-dom';
|
|
4
3
|
import {
|
|
5
4
|
act,
|
|
6
5
|
render,
|
|
@@ -63,7 +62,6 @@ describe('ChartDataTable', () => {
|
|
|
63
62
|
{ header: 'Category', key: 'group' },
|
|
64
63
|
{ header: 'Count', key: 'value' },
|
|
65
64
|
];
|
|
66
|
-
|
|
67
65
|
render(<ChartDataTable columns={columns} dataSet={dataSet} />);
|
|
68
66
|
|
|
69
67
|
expect(
|
|
@@ -168,7 +166,6 @@ describe('ChartTableModal', () => {
|
|
|
168
166
|
it('calls onClose when close button is activated', async () => {
|
|
169
167
|
jest.useFakeTimers();
|
|
170
168
|
const onClose = jest.fn();
|
|
171
|
-
|
|
172
169
|
render(
|
|
173
170
|
<ChartTableModal
|
|
174
171
|
dataSet={dataSet}
|
|
@@ -220,7 +217,6 @@ describe('ChartTableButton', () => {
|
|
|
220
217
|
);
|
|
221
218
|
|
|
222
219
|
const button = screen.getByRole('button', { name: 'Overall Performance' });
|
|
223
|
-
|
|
224
220
|
expect(button).toHaveAttribute('aria-haspopup', 'dialog');
|
|
225
221
|
expect(button).toHaveAttribute('color', 'subtle');
|
|
226
222
|
});
|
|
@@ -257,7 +253,6 @@ describe('ChartTableButton', () => {
|
|
|
257
253
|
|
|
258
254
|
it('calls onClick when activated', () => {
|
|
259
255
|
const onClick = jest.fn();
|
|
260
|
-
|
|
261
256
|
render(
|
|
262
257
|
<ChartTableButton
|
|
263
258
|
ariaLabel="Overall Performance"
|
|
@@ -285,7 +280,6 @@ describe('ChartTableButton', () => {
|
|
|
285
280
|
);
|
|
286
281
|
|
|
287
282
|
const button = screen.getByRole('button', { name: 'Overall Performance' });
|
|
288
|
-
|
|
289
283
|
fireEvent.mouseEnter(button);
|
|
290
284
|
|
|
291
285
|
await waitFor(() => {
|
|
@@ -311,14 +305,12 @@ describe('ChartFullscreenButton', () => {
|
|
|
311
305
|
const button = screen.getByRole('button', {
|
|
312
306
|
name: 'View chart in full screen',
|
|
313
307
|
});
|
|
314
|
-
|
|
315
308
|
expect(button).not.toHaveAttribute('aria-haspopup');
|
|
316
309
|
expect(button).toHaveAttribute('color', 'subtle');
|
|
317
310
|
});
|
|
318
311
|
|
|
319
312
|
it('calls onClick when activated', () => {
|
|
320
313
|
const onClick = jest.fn();
|
|
321
|
-
|
|
322
314
|
render(
|
|
323
315
|
<ChartFullscreenButton
|
|
324
316
|
ariaLabel="View chart in full screen"
|
|
@@ -32,7 +32,7 @@ const defaults: ChartToolbarI18n = {
|
|
|
32
32
|
* Reads chart toolbar i18n strings from the I18nContext if available,
|
|
33
33
|
* falling back to English defaults.
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
// eslint-disable-next-line complexity
|
|
36
36
|
export function useChartToolbarI18n(): ChartToolbarI18n {
|
|
37
37
|
const i18n = React.useContext(I18nContext);
|
|
38
38
|
const toolbar = (i18n.charts as { toolbar?: Partial<ChartToolbarI18n> })
|