@react-magma/charts 12.0.0-next.2 → 12.0.0-next.4
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 +11 -8
- package/dist/charts.js +1 -1
- package/dist/charts.js.map +1 -1
- package/dist/charts.map +1 -1
- package/dist/charts.modern.module.js +1 -1
- package/dist/charts.modern.module.js.map +1 -1
- package/dist/charts.umd.js +1 -1
- package/dist/charts.umd.js.map +1 -1
- package/dist/components/CarbonChart/CarbonChart.d.ts +2 -1
- package/dist/components/CarbonChart/CarbonChartArea.stories.d.ts +1 -0
- package/dist/components/CarbonChart/CarbonChartBoxplot.stories.d.ts +1 -0
- package/dist/components/CarbonChart/CarbonChartBubble.stories.d.ts +5 -0
- package/dist/components/CarbonChart/CarbonChartCombo.stories.d.ts +11 -0
- package/dist/components/CarbonChart/CarbonChartGauge.stories.d.ts +1 -0
- package/dist/components/CarbonChart/CarbonChartHistogram.stories.d.ts +2 -0
- package/dist/components/CarbonChart/CarbonChartMeter.stories.d.ts +4 -0
- package/dist/components/CarbonChart/CarbonChartRadar.stories.d.ts +3 -0
- package/dist/components/CarbonChart/CarbonChartScatter.stories.d.ts +5 -0
- package/package.json +2 -2
- package/src/components/CarbonChart/CarbonChart.tsx +29 -5
- package/src/components/CarbonChart/CarbonChartArea.stories.tsx +101 -0
- package/src/components/CarbonChart/CarbonChartBar.stories.tsx +10 -0
- package/src/components/CarbonChart/CarbonChartBoxplot.stories.tsx +120 -122
- package/src/components/CarbonChart/CarbonChartBubble.stories.tsx +475 -477
- package/src/components/CarbonChart/CarbonChartCombo.stories.tsx +1282 -1284
- package/src/components/CarbonChart/CarbonChartGauge.stories.tsx +24 -26
- package/src/components/CarbonChart/CarbonChartHistogram.stories.tsx +593 -595
- package/src/components/CarbonChart/CarbonChartMeter.stories.tsx +147 -149
- package/src/components/CarbonChart/CarbonChartRadar.stories.tsx +375 -377
- package/src/components/CarbonChart/CarbonChartScatter.stories.tsx +363 -365
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { ChartOptions } from '@carbon/charts-react';
|
|
2
3
|
import { ThemeInterface } from 'react-magma-dom';
|
|
3
4
|
import './styles.min.css';
|
|
4
5
|
export declare enum CarbonChartType {
|
|
@@ -27,7 +28,7 @@ export interface CarbonChartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
27
28
|
/**
|
|
28
29
|
* For a complete list of options, see Carbon Charts documentation
|
|
29
30
|
*/
|
|
30
|
-
options:
|
|
31
|
+
options: ChartOptions;
|
|
31
32
|
testId?: string;
|
|
32
33
|
/**
|
|
33
34
|
* @internal
|
|
@@ -9,3 +9,4 @@ export declare const AreaMultipleBoundedAreasNaturalCurve: import("@storybook/cs
|
|
|
9
9
|
export declare const AreaMultipleBoundedAreasNaturalCurveZoomBarEnabled: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
10
10
|
export declare const AreaSkeleton: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
11
11
|
export declare const AreaEmptyState: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
12
|
+
export declare const AreaTimeSeriesWithCustomColors: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
@@ -2,3 +2,4 @@ import { CarbonChartProps } from '.';
|
|
|
2
2
|
declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react/types-6-0").ReactFramework, import("@storybook/react/types-6-0").Args>;
|
|
3
3
|
export default _default;
|
|
4
4
|
export declare const HorizontalBoxplot: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
5
|
+
export declare const VerticalBoxplot: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
@@ -2,3 +2,8 @@ import { CarbonChartProps } from '.';
|
|
|
2
2
|
declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react/types-6-0").ReactFramework, import("@storybook/react/types-6-0").Args>;
|
|
3
3
|
export default _default;
|
|
4
4
|
export declare const BubbleLinear: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
5
|
+
export declare const BubbleTimeSeries: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
6
|
+
export declare const BubbleDiscrete: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
7
|
+
export declare const BubbleDualDiscreteAxes: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
8
|
+
export declare const BubbleEmptyState: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
9
|
+
export declare const BubbleSkeleton: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
@@ -2,3 +2,14 @@ import { CarbonChartProps } from '.';
|
|
|
2
2
|
declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react/types-6-0").ReactFramework, import("@storybook/react/types-6-0").Args>;
|
|
3
3
|
export default _default;
|
|
4
4
|
export declare const ComboLineAndSimpleBarCustomConfigs: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
5
|
+
export declare const ComboLineAndStackedBar: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
6
|
+
export declare const ComboLineAndGroupedBarCustomConfigs: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
7
|
+
export declare const ComboLineAndFloatingBar: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
8
|
+
export declare const ComboHorizontalLineAndGroupedBar: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
9
|
+
export declare const HorizontalComboLineAndSimpleBar: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
10
|
+
export declare const ComboLineAndArea: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
11
|
+
export declare const ComboStackedAreaAndLine: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
12
|
+
export declare const ComboLineAndScatterAndBar: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
13
|
+
export declare const ComboLineAndAreaTimeSeries: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
14
|
+
export declare const ComboChartEmpty: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
15
|
+
export declare const ComboChartLoading: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
@@ -2,3 +2,4 @@ import { CarbonChartProps } from '.';
|
|
|
2
2
|
declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react/types-6-0").ReactFramework, import("@storybook/react/types-6-0").Args>;
|
|
3
3
|
export default _default;
|
|
4
4
|
export declare const GaugeSemicircularDangerStatus: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
5
|
+
export declare const GaugeCircularWarningStatus: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
@@ -2,3 +2,5 @@ import { CarbonChartProps } from '.';
|
|
|
2
2
|
declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react/types-6-0").ReactFramework, import("@storybook/react/types-6-0").Args>;
|
|
3
3
|
export default _default;
|
|
4
4
|
export declare const HistogramLinear: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
5
|
+
export declare const HistogramDefinedBinsNumberLinear: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
6
|
+
export declare const HistogramDefinedBinsLinear: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
@@ -2,3 +2,7 @@ import { CarbonChartProps } from '.';
|
|
|
2
2
|
declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react/types-6-0").ReactFramework, import("@storybook/react/types-6-0").Args>;
|
|
3
3
|
export default _default;
|
|
4
4
|
export declare const MeterChartWithStatuses: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
5
|
+
export declare const MeterChartNoStatus: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
6
|
+
export declare const ProportionalMeterChart: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
7
|
+
export declare const ProportionalMeterChartPeakAndStatuses: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
8
|
+
export declare const ProportionalMeterChartTruncated: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
@@ -2,3 +2,6 @@ import { CarbonChartProps } from '.';
|
|
|
2
2
|
declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react/types-6-0").ReactFramework, import("@storybook/react/types-6-0").Args>;
|
|
3
3
|
export default _default;
|
|
4
4
|
export declare const Radar: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
5
|
+
export declare const RadarCentered: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
6
|
+
export declare const RadarMissingDatapoints: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
7
|
+
export declare const RadarDense: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
@@ -2,3 +2,8 @@ import { CarbonChartProps } from '.';
|
|
|
2
2
|
declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react/types-6-0").ReactFramework, import("@storybook/react/types-6-0").Args>;
|
|
3
3
|
export default _default;
|
|
4
4
|
export declare const ScatterLinearXAndY: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
5
|
+
export declare const ScatterTimeSeries: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
6
|
+
export declare const ScatterDiscrete: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
7
|
+
export declare const ScatterDualAxes: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
8
|
+
export declare const ScatterEmptyState: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
|
9
|
+
export declare const ScatterSkeleton: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react/types-6-0").ReactFramework, CarbonChartProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-magma/charts",
|
|
3
|
-
"version": "12.0.0-next.
|
|
3
|
+
"version": "12.0.0-next.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./src",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"d3": "^7.9.0",
|
|
29
29
|
"d3-cloud": "^1.2.7",
|
|
30
30
|
"d3-sankey": "^0.12.3",
|
|
31
|
-
"victory": "^
|
|
31
|
+
"victory": "^37.3.6"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@emotion/react": "^11.13.0",
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
MeterChart,
|
|
20
20
|
ScatterChart,
|
|
21
21
|
ComboChart,
|
|
22
|
+
ChartOptions,
|
|
22
23
|
} from '@carbon/charts-react';
|
|
23
24
|
import styled from '@emotion/styled';
|
|
24
25
|
import { transparentize } from 'polished';
|
|
@@ -52,7 +53,7 @@ export interface CarbonChartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
52
53
|
/**
|
|
53
54
|
* For a complete list of options, see Carbon Charts documentation
|
|
54
55
|
*/
|
|
55
|
-
options:
|
|
56
|
+
options: ChartOptions;
|
|
56
57
|
testId?: string;
|
|
57
58
|
/**
|
|
58
59
|
* @internal
|
|
@@ -66,6 +67,7 @@ export interface CarbonChartProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
66
67
|
|
|
67
68
|
const CarbonChartWrapper = styled.div<{
|
|
68
69
|
isInverse?: boolean;
|
|
70
|
+
groupsLength: number;
|
|
69
71
|
theme: ThemeInterface;
|
|
70
72
|
}>`
|
|
71
73
|
.cds--data-table thead tr th {
|
|
@@ -289,6 +291,22 @@ const CarbonChartWrapper = styled.div<{
|
|
|
289
291
|
transition: 0.1s all linear;
|
|
290
292
|
stroke-width: 1.1em;
|
|
291
293
|
}
|
|
294
|
+
|
|
295
|
+
.cds--cc--tooltip {
|
|
296
|
+
${props => {
|
|
297
|
+
const chartColors =
|
|
298
|
+
(props.isInverse
|
|
299
|
+
? props.theme.chartColorsInverse
|
|
300
|
+
: props.theme.chartColors) || [];
|
|
301
|
+
|
|
302
|
+
return chartColors.reduce((result, color, index) => {
|
|
303
|
+
const indexNum = index + 1;
|
|
304
|
+
|
|
305
|
+
result += `.tooltip-${props.groupsLength}-1-${indexNum} { background-color: ${color}; }`;
|
|
306
|
+
|
|
307
|
+
return result;
|
|
308
|
+
}, '');
|
|
309
|
+
}}
|
|
292
310
|
|
|
293
311
|
.cds--overflow-menu-options__btn:focus {
|
|
294
312
|
outline-color: ${props =>
|
|
@@ -480,7 +498,6 @@ interface ColorsObject {
|
|
|
480
498
|
export const CarbonChart = React.forwardRef<HTMLDivElement, CarbonChartProps>(
|
|
481
499
|
(props, ref) => {
|
|
482
500
|
const {
|
|
483
|
-
children,
|
|
484
501
|
testId,
|
|
485
502
|
isInverse: isInverseProp,
|
|
486
503
|
type,
|
|
@@ -520,12 +537,15 @@ export const CarbonChart = React.forwardRef<HTMLDivElement, CarbonChartProps>(
|
|
|
520
537
|
const uniqueGroups = allGroups.filter(
|
|
521
538
|
(g, index) => allGroups.indexOf(g) === index
|
|
522
539
|
);
|
|
540
|
+
const customColors = ((options as any).colors as string[]) || [];
|
|
541
|
+
const allColors = [...customColors, ...theme.chartColors];
|
|
542
|
+
const allInverseColors = [...customColors, ...theme.chartColorsInverse];
|
|
523
543
|
|
|
524
544
|
uniqueGroups.forEach((group, i) => {
|
|
525
|
-
if (uniqueGroups.length <=
|
|
545
|
+
if (uniqueGroups.length <= allColors.length) {
|
|
526
546
|
return (scaleColorsObj[group || ('null' as any)] = isInverse
|
|
527
|
-
?
|
|
528
|
-
:
|
|
547
|
+
? allInverseColors[i]
|
|
548
|
+
: allColors[i]);
|
|
529
549
|
}
|
|
530
550
|
return {};
|
|
531
551
|
});
|
|
@@ -540,6 +560,7 @@ export const CarbonChart = React.forwardRef<HTMLDivElement, CarbonChartProps>(
|
|
|
540
560
|
scale: buildColors(),
|
|
541
561
|
},
|
|
542
562
|
tooltip: {
|
|
563
|
+
...(options?.tooltip || {}),
|
|
543
564
|
truncation: {
|
|
544
565
|
type: 'none',
|
|
545
566
|
},
|
|
@@ -555,6 +576,8 @@ export const CarbonChart = React.forwardRef<HTMLDivElement, CarbonChartProps>(
|
|
|
555
576
|
});
|
|
556
577
|
});
|
|
557
578
|
|
|
579
|
+
const groupsLength = Object.keys(buildColors()).length;
|
|
580
|
+
|
|
558
581
|
return (
|
|
559
582
|
<CarbonChartWrapper
|
|
560
583
|
data-testid={testId}
|
|
@@ -562,6 +585,7 @@ export const CarbonChart = React.forwardRef<HTMLDivElement, CarbonChartProps>(
|
|
|
562
585
|
isInverse={isInverse}
|
|
563
586
|
theme={theme}
|
|
564
587
|
className="carbon-chart-wrapper"
|
|
588
|
+
groupsLength={groupsLength < 6 ? groupsLength : 14}
|
|
565
589
|
{...rest}
|
|
566
590
|
>
|
|
567
591
|
<ChartType data={dataSet} options={newOptions} />
|
|
@@ -629,3 +629,104 @@ AreaEmptyState.args = {
|
|
|
629
629
|
height: '400px',
|
|
630
630
|
},
|
|
631
631
|
};
|
|
632
|
+
|
|
633
|
+
export const AreaTimeSeriesWithCustomColors = Template.bind({});
|
|
634
|
+
AreaTimeSeriesWithCustomColors.args = {
|
|
635
|
+
isInverse: false,
|
|
636
|
+
type: CarbonChartType.area,
|
|
637
|
+
dataSet: [
|
|
638
|
+
{
|
|
639
|
+
group: 'Dataset 1',
|
|
640
|
+
date: '2019-01-01T05:00:00.000Z',
|
|
641
|
+
value: 0,
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
group: 'Dataset 1',
|
|
645
|
+
date: '2019-01-06T05:00:00.000Z',
|
|
646
|
+
value: 57312,
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
group: 'Dataset 1',
|
|
650
|
+
date: '2019-01-08T05:00:00.000Z',
|
|
651
|
+
value: 21432,
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
group: 'Dataset 1',
|
|
655
|
+
date: '2019-01-15T05:00:00.000Z',
|
|
656
|
+
value: 70323,
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
group: 'Dataset 1',
|
|
660
|
+
date: '2019-01-19T05:00:00.000Z',
|
|
661
|
+
value: 21300,
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
group: 'Dataset 2',
|
|
665
|
+
date: '2019-01-01T05:00:00.000Z',
|
|
666
|
+
value: 50000,
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
group: 'Dataset 2',
|
|
670
|
+
date: '2019-01-05T05:00:00.000Z',
|
|
671
|
+
value: 15000,
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
group: 'Dataset 2',
|
|
675
|
+
date: '2019-01-08T05:00:00.000Z',
|
|
676
|
+
value: 20000,
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
group: 'Dataset 2',
|
|
680
|
+
date: '2019-01-13T05:00:00.000Z',
|
|
681
|
+
value: 39213,
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
group: 'Dataset 2',
|
|
685
|
+
date: '2019-01-19T05:00:00.000Z',
|
|
686
|
+
value: 61213,
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
group: 'Dataset 3',
|
|
690
|
+
date: '2019-01-02T05:00:00.000Z',
|
|
691
|
+
value: 10,
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
group: 'Dataset 3',
|
|
695
|
+
date: '2019-01-06T05:00:00.000Z',
|
|
696
|
+
value: 37312,
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
group: 'Dataset 3',
|
|
700
|
+
date: '2019-01-08T05:00:00.000Z',
|
|
701
|
+
value: 51432,
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
group: 'Dataset 3',
|
|
705
|
+
date: '2019-01-13T05:00:00.000Z',
|
|
706
|
+
value: 40323,
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
group: 'Dataset 3',
|
|
710
|
+
date: '2019-01-19T05:00:00.000Z',
|
|
711
|
+
value: 31300,
|
|
712
|
+
},
|
|
713
|
+
],
|
|
714
|
+
|
|
715
|
+
options: {
|
|
716
|
+
title: 'Area (time series) with custom colors',
|
|
717
|
+
axes: {
|
|
718
|
+
bottom: {
|
|
719
|
+
title: '2019 Annual Sales Figures',
|
|
720
|
+
mapsTo: 'date',
|
|
721
|
+
scaleType: 'time',
|
|
722
|
+
},
|
|
723
|
+
left: {
|
|
724
|
+
mapsTo: 'value',
|
|
725
|
+
title: 'Conversion rate',
|
|
726
|
+
scaleType: 'linear',
|
|
727
|
+
},
|
|
728
|
+
},
|
|
729
|
+
height: '400px',
|
|
730
|
+
colors: ['red', 'green'],
|
|
731
|
+
},
|
|
732
|
+
};
|
|
@@ -67,6 +67,16 @@ VerticalSimpleBarDiscrete.args = {
|
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
69
|
height: '400px',
|
|
70
|
+
tooltip: {
|
|
71
|
+
valueFormatter: (value /*, label */) =>
|
|
72
|
+
typeof value === 'number'
|
|
73
|
+
? value.toLocaleString(undefined, {
|
|
74
|
+
minimumFractionDigits: 20,
|
|
75
|
+
maximumFractionDigits: 20,
|
|
76
|
+
})
|
|
77
|
+
: String(value),
|
|
78
|
+
enabled: false,
|
|
79
|
+
},
|
|
70
80
|
},
|
|
71
81
|
};
|
|
72
82
|
|
|
@@ -150,125 +150,123 @@ HorizontalBoxplot.args = {
|
|
|
150
150
|
},
|
|
151
151
|
};
|
|
152
152
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
// },
|
|
274
|
-
// };
|
|
153
|
+
export const VerticalBoxplot = Template.bind({});
|
|
154
|
+
VerticalBoxplot.args = {
|
|
155
|
+
isInverse: false,
|
|
156
|
+
type: CarbonChartType.boxplot,
|
|
157
|
+
dataSet: [
|
|
158
|
+
{
|
|
159
|
+
group: 'Q1',
|
|
160
|
+
key: 'Monday',
|
|
161
|
+
value: 65000,
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
group: 'Q1',
|
|
165
|
+
key: 'Tuesday',
|
|
166
|
+
value: 29123,
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
group: 'Q1',
|
|
170
|
+
key: 'Wednesday',
|
|
171
|
+
value: 35213,
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
group: 'Q1',
|
|
175
|
+
key: 'Thursday',
|
|
176
|
+
value: 51213,
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
group: 'Q1',
|
|
180
|
+
key: 'Friday',
|
|
181
|
+
value: 16932,
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
group: 'Q2',
|
|
185
|
+
key: 'Monday',
|
|
186
|
+
value: 32432,
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
group: 'Q2',
|
|
190
|
+
key: 'Tuesday',
|
|
191
|
+
value: 14312,
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
group: 'Q2',
|
|
195
|
+
key: 'Wednesday',
|
|
196
|
+
value: 66456,
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
group: 'Q2',
|
|
200
|
+
key: 'Thursday',
|
|
201
|
+
value: 21312,
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
group: 'Q2',
|
|
205
|
+
key: 'Friday',
|
|
206
|
+
value: 37234,
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
group: 'Q3',
|
|
210
|
+
key: 'Monday',
|
|
211
|
+
value: 5312,
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
group: 'Q3',
|
|
215
|
+
key: 'Tuesday',
|
|
216
|
+
value: 23232,
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
group: 'Q3',
|
|
220
|
+
key: 'Wednesday',
|
|
221
|
+
value: 34232,
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
group: 'Q3',
|
|
225
|
+
key: 'Thursday',
|
|
226
|
+
value: 12312,
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
group: 'Q3',
|
|
230
|
+
key: 'Friday',
|
|
231
|
+
value: 44234,
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
group: 'Q4',
|
|
235
|
+
key: 'Monday',
|
|
236
|
+
value: 32423,
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
group: 'Q4',
|
|
240
|
+
key: 'Tuesday',
|
|
241
|
+
value: 21313,
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
group: 'Q4',
|
|
245
|
+
key: 'Wednesday',
|
|
246
|
+
value: 64353,
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
group: 'Q4',
|
|
250
|
+
key: 'Thursday',
|
|
251
|
+
value: 24134,
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
group: 'Q4',
|
|
255
|
+
key: 'Friday',
|
|
256
|
+
value: 45134,
|
|
257
|
+
},
|
|
258
|
+
],
|
|
259
|
+
options: {
|
|
260
|
+
title: 'Vertical box plot',
|
|
261
|
+
axes: {
|
|
262
|
+
left: {
|
|
263
|
+
mapsTo: 'value',
|
|
264
|
+
},
|
|
265
|
+
bottom: {
|
|
266
|
+
scaleType: 'labels',
|
|
267
|
+
mapsTo: 'group',
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
height: '400px',
|
|
271
|
+
},
|
|
272
|
+
};
|