@carbon/charts-react 0.59.0-beta.0 → 1.0.1
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 +49 -282
- package/LICENSE.md +201 -0
- package/README.md +5 -1
- package/{dist/alluvial-chart.d.ts → alluvial-chart.d.ts} +0 -0
- package/{dist/alluvial-chart.js → alluvial-chart.js} +0 -0
- package/{dist/area-chart-stacked.d.ts → area-chart-stacked.d.ts} +0 -0
- package/{dist/area-chart-stacked.js → area-chart-stacked.js} +0 -0
- package/{dist/area-chart.d.ts → area-chart.d.ts} +0 -0
- package/{dist/area-chart.js → area-chart.js} +0 -0
- package/{dist/bar-chart-grouped.d.ts → bar-chart-grouped.d.ts} +0 -0
- package/{dist/bar-chart-grouped.js → bar-chart-grouped.js} +0 -0
- package/{dist/bar-chart-simple.d.ts → bar-chart-simple.d.ts} +0 -0
- package/{dist/bar-chart-simple.js → bar-chart-simple.js} +0 -0
- package/{dist/bar-chart-stacked.d.ts → bar-chart-stacked.d.ts} +0 -0
- package/{dist/bar-chart-stacked.js → bar-chart-stacked.js} +0 -0
- package/{dist/base-chart.d.ts → base-chart.d.ts} +0 -0
- package/{dist/base-chart.js → base-chart.js} +0 -0
- package/{dist/boxplot-chart.d.ts → boxplot-chart.d.ts} +0 -0
- package/{dist/boxplot-chart.js → boxplot-chart.js} +0 -0
- package/{dist/bubble-chart.d.ts → bubble-chart.d.ts} +0 -0
- package/{dist/bubble-chart.js → bubble-chart.js} +0 -0
- package/{dist/bullet-chart.d.ts → bullet-chart.d.ts} +0 -0
- package/{dist/bullet-chart.js → bullet-chart.js} +0 -0
- package/{dist/bundle.js → bundle.js} +0 -0
- package/{dist/circle-pack-chart.d.ts → circle-pack-chart.d.ts} +0 -0
- package/{dist/circle-pack-chart.js → circle-pack-chart.js} +0 -0
- package/{dist/combo-chart.d.ts → combo-chart.d.ts} +0 -0
- package/{dist/combo-chart.js → combo-chart.js} +0 -0
- package/{dist/diagrams → diagrams}/CardNode/CardNode.d.ts +0 -0
- package/{dist/diagrams → diagrams}/CardNode/CardNode.js +0 -0
- package/{dist/diagrams → diagrams}/CardNode/CardNodeColumn.d.ts +0 -0
- package/{dist/diagrams → diagrams}/CardNode/CardNodeColumn.js +0 -0
- package/{dist/diagrams → diagrams}/CardNode/CardNodeLabel.d.ts +0 -0
- package/{dist/diagrams → diagrams}/CardNode/CardNodeLabel.js +0 -0
- package/{dist/diagrams → diagrams}/CardNode/CardNodeSubtitle.d.ts +0 -0
- package/{dist/diagrams → diagrams}/CardNode/CardNodeSubtitle.js +0 -0
- package/{dist/diagrams → diagrams}/CardNode/CardNodeTitle.d.ts +0 -0
- package/{dist/diagrams → diagrams}/CardNode/CardNodeTitle.js +0 -0
- package/{dist/diagrams → diagrams}/CardNode/index.d.ts +0 -0
- package/{dist/diagrams → diagrams}/CardNode/index.js +0 -0
- package/{dist/diagrams → diagrams}/Edge/Edge.d.ts +0 -0
- package/{dist/diagrams → diagrams}/Edge/Edge.js +0 -0
- package/{dist/diagrams → diagrams}/Edge/index.d.ts +0 -0
- package/{dist/diagrams → diagrams}/Edge/index.js +0 -0
- package/{dist/diagrams → diagrams}/Marker/Marker.d.ts +0 -0
- package/{dist/diagrams → diagrams}/Marker/Marker.js +0 -0
- package/{dist/diagrams → diagrams}/Marker/index.d.ts +0 -0
- package/{dist/diagrams → diagrams}/Marker/index.js +0 -0
- package/{dist/diagrams → diagrams}/ShapeNode/ShapeNode.d.ts +0 -0
- package/{dist/diagrams → diagrams}/ShapeNode/ShapeNode.js +0 -0
- package/{dist/diagrams → diagrams}/ShapeNode/index.d.ts +0 -0
- package/{dist/diagrams → diagrams}/ShapeNode/index.js +0 -0
- package/{dist/diagrams → diagrams}/configs.d.ts +0 -0
- package/{dist/diagrams → diagrams}/configs.js +0 -0
- package/{dist/donut-chart.d.ts → donut-chart.d.ts} +0 -0
- package/{dist/donut-chart.js → donut-chart.js} +0 -0
- package/{dist/gauge-chart.d.ts → gauge-chart.d.ts} +0 -0
- package/{dist/gauge-chart.js → gauge-chart.js} +0 -0
- package/{dist/heatmap-chart.d.ts → heatmap-chart.d.ts} +0 -0
- package/{dist/heatmap-chart.js → heatmap-chart.js} +0 -0
- package/{dist/histogram-chart.d.ts → histogram-chart.d.ts} +0 -0
- package/{dist/histogram-chart.js → histogram-chart.js} +0 -0
- package/{dist/index.d.ts → index.d.ts} +0 -0
- package/{dist/index.js → index.js} +0 -0
- package/{dist/line-chart.d.ts → line-chart.d.ts} +0 -0
- package/{dist/line-chart.js → line-chart.js} +0 -0
- package/{dist/lollipop-chart.d.ts → lollipop-chart.d.ts} +0 -0
- package/{dist/lollipop-chart.js → lollipop-chart.js} +0 -0
- package/{dist/meter-chart.d.ts → meter-chart.d.ts} +0 -0
- package/{dist/meter-chart.js → meter-chart.js} +0 -0
- package/package.json +106 -106
- package/{dist/pie-chart.d.ts → pie-chart.d.ts} +0 -0
- package/{dist/pie-chart.js → pie-chart.js} +0 -0
- package/{dist/radar-chart.d.ts → radar-chart.d.ts} +0 -0
- package/{dist/radar-chart.js → radar-chart.js} +0 -0
- package/{dist/scatter-chart.d.ts → scatter-chart.d.ts} +0 -0
- package/{dist/scatter-chart.js → scatter-chart.js} +0 -0
- package/{dist/tree-chart.d.ts → tree-chart.d.ts} +0 -0
- package/{dist/tree-chart.js → tree-chart.js} +0 -0
- package/{dist/treemap-chart.d.ts → treemap-chart.d.ts} +0 -0
- package/{dist/treemap-chart.js → treemap-chart.js} +0 -0
- package/{dist/utils.d.ts → utils.d.ts} +0 -0
- package/{dist/utils.js → utils.js} +0 -0
- package/{dist/wordcloud-chart.d.ts → wordcloud-chart.d.ts} +0 -0
- package/{dist/wordcloud-chart.js → wordcloud-chart.js} +0 -0
- package/.babelrc +0 -4
- package/.prettierignore +0 -1
- package/.storybook/addons.js +0 -2
- package/.storybook/assets/logo.svg +0 -1
- package/.storybook/assets/share.png +0 -0
- package/.storybook/assets/welcome.png +0 -0
- package/.storybook/config.js +0 -22
- package/.storybook/main.js +0 -24
- package/.storybook/manager-head.html +0 -42
- package/.storybook/preview-head.html +0 -10
- package/build.sh +0 -20
- package/carbon.yml +0 -275
- package/carbon__charts-react-tests.tsx +0 -83
- package/demo/bundle/favicon.ico +0 -0
- package/demo/bundle/index.html +0 -22
- package/demo/bundle/logo.svg +0 -1
- package/demo/bundle/main.4a87b5852cddf04c8e9a.bundle.js +0 -1
- package/demo/bundle/runtime~main.6b70b35614cf83eab770.bundle.js +0 -1
- package/demo/bundle/sb_dll/storybook_ui-manifest.json +0 -1
- package/demo/bundle/sb_dll/storybook_ui_dll.LICENCE +0 -113
- package/demo/bundle/sb_dll/storybook_ui_dll.js +0 -2
- package/demo/bundle/share.png +0 -0
- package/demo/bundle/vendors~main.9ceec0efe2f3ef413ade.bundle.js +0 -111
- package/demo/bundle/welcome.png +0 -0
- package/dist/CHANGELOG.md +0 -2150
- package/dist/README.md +0 -56
- package/dist/package.json +0 -107
- package/helpers/commons.js +0 -30
- package/rollup.config.js +0 -18
- package/src/alluvial-chart.tsx +0 -30
- package/src/area-chart-stacked.tsx +0 -33
- package/src/area-chart.tsx +0 -30
- package/src/bar-chart-grouped.tsx +0 -30
- package/src/bar-chart-simple.tsx +0 -30
- package/src/bar-chart-stacked.tsx +0 -30
- package/src/base-chart.tsx +0 -45
- package/src/boxplot-chart.tsx +0 -30
- package/src/bubble-chart.tsx +0 -30
- package/src/bullet-chart.tsx +0 -30
- package/src/circle-pack-chart.tsx +0 -30
- package/src/combo-chart.tsx +0 -30
- package/src/diagrams/CardNode/CardNode.tsx +0 -121
- package/src/diagrams/CardNode/CardNodeColumn.tsx +0 -38
- package/src/diagrams/CardNode/CardNodeLabel.tsx +0 -32
- package/src/diagrams/CardNode/CardNodeSubtitle.tsx +0 -32
- package/src/diagrams/CardNode/CardNodeTitle.tsx +0 -32
- package/src/diagrams/CardNode/index.tsx +0 -13
- package/src/diagrams/Edge/Edge.tsx +0 -137
- package/src/diagrams/Edge/index.tsx +0 -2
- package/src/diagrams/Marker/Marker.tsx +0 -121
- package/src/diagrams/Marker/index.tsx +0 -9
- package/src/diagrams/ShapeNode/ShapeNode.tsx +0 -153
- package/src/diagrams/ShapeNode/index.tsx +0 -2
- package/src/diagrams/configs.ts +0 -1
- package/src/donut-chart.tsx +0 -30
- package/src/gauge-chart.tsx +0 -30
- package/src/heatmap-chart.tsx +0 -30
- package/src/histogram-chart.tsx +0 -30
- package/src/index.ts +0 -51
- package/src/line-chart.tsx +0 -30
- package/src/lollipop-chart.tsx +0 -30
- package/src/meter-chart.tsx +0 -30
- package/src/pie-chart.tsx +0 -30
- package/src/radar-chart.tsx +0 -30
- package/src/scatter-chart.tsx +0 -30
- package/src/tree-chart.tsx +0 -30
- package/src/treemap-chart.tsx +0 -30
- package/src/utils.ts +0 -7
- package/src/wordcloud-chart.tsx +0 -30
- package/stories/0_intro.stories.js +0 -60
- package/stories/1_gettingStarted.stories.js +0 -74
- package/stories/1_gettingStarted_content.js +0 -121
- package/stories/all.stories.js +0 -110
- package/stories/diagrams/0_Diagrams.stories.js +0 -259
- package/stories/diagrams/CardNode.stories.js +0 -106
- package/stories/diagrams/Edge.stories.js +0 -94
- package/stories/diagrams/Marker.stories.js +0 -95
- package/stories/diagrams/ShapeNode.stories.js +0 -42
- package/tsconfig.json +0 -20
package/src/donut-chart.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { DonutChart as DC } from '@carbon/charts';
|
|
3
|
-
import BaseChart from './base-chart';
|
|
4
|
-
import { ChartConfig, DonutChartOptions } from '@carbon/charts/interfaces';
|
|
5
|
-
import { hasChartBeenInitialized } from './utils';
|
|
6
|
-
|
|
7
|
-
type DonutChartProps = ChartConfig<DonutChartOptions>;
|
|
8
|
-
|
|
9
|
-
export default class DonutChart extends BaseChart<DonutChartOptions> {
|
|
10
|
-
chartRef!: HTMLDivElement;
|
|
11
|
-
props!: DonutChartProps;
|
|
12
|
-
chart!: DC;
|
|
13
|
-
|
|
14
|
-
componentDidMount() {
|
|
15
|
-
if (hasChartBeenInitialized(this.chartRef) === false) {
|
|
16
|
-
this.chart = new DC(this.chartRef, {
|
|
17
|
-
data: this.props.data,
|
|
18
|
-
options: this.props.options,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
ref={(chartRef) => (this.chartRef = chartRef!)}
|
|
27
|
-
className="chart-holder"></div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
package/src/gauge-chart.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { GaugeChart as GC } from '@carbon/charts';
|
|
3
|
-
import BaseChart from './base-chart';
|
|
4
|
-
import { ChartConfig, GaugeChartOptions } from '@carbon/charts/interfaces';
|
|
5
|
-
import { hasChartBeenInitialized } from './utils';
|
|
6
|
-
|
|
7
|
-
type GaugeChartProps = ChartConfig<GaugeChartOptions>;
|
|
8
|
-
|
|
9
|
-
export default class GaugeChart extends BaseChart<GaugeChartOptions> {
|
|
10
|
-
chartRef!: HTMLDivElement;
|
|
11
|
-
props!: GaugeChartProps;
|
|
12
|
-
chart!: GC;
|
|
13
|
-
|
|
14
|
-
componentDidMount() {
|
|
15
|
-
if (hasChartBeenInitialized(this.chartRef) === false) {
|
|
16
|
-
this.chart = new GC(this.chartRef, {
|
|
17
|
-
data: this.props.data,
|
|
18
|
-
options: this.props.options,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
ref={(chartRef) => (this.chartRef = chartRef!)}
|
|
27
|
-
className="chart-holder"></div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
package/src/heatmap-chart.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { HeatmapChart as HMC } from '@carbon/charts';
|
|
3
|
-
import BaseChart from './base-chart';
|
|
4
|
-
import { ChartConfig, HeatmapChartOptions } from '@carbon/charts/interfaces';
|
|
5
|
-
import { hasChartBeenInitialized } from './utils';
|
|
6
|
-
|
|
7
|
-
type HeatmapChartProps = ChartConfig<HeatmapChartOptions>;
|
|
8
|
-
|
|
9
|
-
export default class HeatmapChart extends BaseChart<HeatmapChartOptions> {
|
|
10
|
-
chartRef!: HTMLDivElement;
|
|
11
|
-
props!: HeatmapChartProps;
|
|
12
|
-
chart!: HMC;
|
|
13
|
-
|
|
14
|
-
componentDidMount() {
|
|
15
|
-
if (hasChartBeenInitialized(this.chartRef) === false) {
|
|
16
|
-
this.chart = new HMC(this.chartRef, {
|
|
17
|
-
data: this.props.data,
|
|
18
|
-
options: this.props.options,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
ref={(chartRef) => (this.chartRef = chartRef!)}
|
|
27
|
-
className="chart-holder"></div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
package/src/histogram-chart.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { HistogramChart as HC } from '@carbon/charts';
|
|
3
|
-
import BaseChart from './base-chart';
|
|
4
|
-
import { ChartConfig, HistogramChartOptions } from '@carbon/charts/interfaces';
|
|
5
|
-
import { hasChartBeenInitialized } from './utils';
|
|
6
|
-
|
|
7
|
-
type HistogramChartProps = ChartConfig<HistogramChartOptions>;
|
|
8
|
-
|
|
9
|
-
export default class HistogramChart extends BaseChart<HistogramChartOptions> {
|
|
10
|
-
chartRef!: HTMLDivElement;
|
|
11
|
-
props!: HistogramChartProps;
|
|
12
|
-
chart!: HC;
|
|
13
|
-
|
|
14
|
-
componentDidMount() {
|
|
15
|
-
if (hasChartBeenInitialized(this.chartRef) === false) {
|
|
16
|
-
this.chart = new HC(this.chartRef, {
|
|
17
|
-
data: this.props.data,
|
|
18
|
-
options: this.props.options,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
ref={(chartRef) => (this.chartRef = chartRef!)}
|
|
27
|
-
className="chart-holder"></div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import AreaChart from './area-chart';
|
|
2
|
-
import StackedAreaChart from './area-chart-stacked';
|
|
3
|
-
import GroupedBarChart from './bar-chart-grouped';
|
|
4
|
-
import SimpleBarChart from './bar-chart-simple';
|
|
5
|
-
import StackedBarChart from './bar-chart-stacked';
|
|
6
|
-
import BoxplotChart from './boxplot-chart';
|
|
7
|
-
import BubbleChart from './bubble-chart';
|
|
8
|
-
import BulletChart from './bullet-chart';
|
|
9
|
-
import DonutChart from './donut-chart';
|
|
10
|
-
import GaugeChart from './gauge-chart';
|
|
11
|
-
import HistogramChart from './histogram-chart';
|
|
12
|
-
import LineChart from './line-chart';
|
|
13
|
-
import LollipopChart from './lollipop-chart';
|
|
14
|
-
import PieChart from './pie-chart';
|
|
15
|
-
import ScatterChart from './scatter-chart';
|
|
16
|
-
import MeterChart from './meter-chart';
|
|
17
|
-
import RadarChart from './radar-chart';
|
|
18
|
-
import ComboChart from './combo-chart';
|
|
19
|
-
import TreeChart from './tree-chart';
|
|
20
|
-
import TreemapChart from './treemap-chart';
|
|
21
|
-
import CirclePackChart from './circle-pack-chart';
|
|
22
|
-
import WordCloudChart from './wordcloud-chart';
|
|
23
|
-
import AlluvialChart from './alluvial-chart';
|
|
24
|
-
import HeatmapChart from './heatmap-chart';
|
|
25
|
-
|
|
26
|
-
export {
|
|
27
|
-
AreaChart,
|
|
28
|
-
StackedAreaChart,
|
|
29
|
-
GroupedBarChart,
|
|
30
|
-
SimpleBarChart,
|
|
31
|
-
StackedBarChart,
|
|
32
|
-
BoxplotChart,
|
|
33
|
-
BubbleChart,
|
|
34
|
-
BulletChart,
|
|
35
|
-
DonutChart,
|
|
36
|
-
GaugeChart,
|
|
37
|
-
HistogramChart,
|
|
38
|
-
LineChart,
|
|
39
|
-
LollipopChart,
|
|
40
|
-
PieChart,
|
|
41
|
-
ScatterChart,
|
|
42
|
-
MeterChart,
|
|
43
|
-
RadarChart,
|
|
44
|
-
ComboChart,
|
|
45
|
-
TreeChart,
|
|
46
|
-
TreemapChart,
|
|
47
|
-
CirclePackChart,
|
|
48
|
-
WordCloudChart,
|
|
49
|
-
AlluvialChart,
|
|
50
|
-
HeatmapChart,
|
|
51
|
-
};
|
package/src/line-chart.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { LineChart as LC } from '@carbon/charts';
|
|
3
|
-
import { ChartConfig, LineChartOptions } from '@carbon/charts/interfaces';
|
|
4
|
-
import BaseChart from './base-chart';
|
|
5
|
-
import { hasChartBeenInitialized } from './utils';
|
|
6
|
-
|
|
7
|
-
type LineChartProps = ChartConfig<LineChartOptions>;
|
|
8
|
-
|
|
9
|
-
export default class LineChart extends BaseChart<LineChartOptions> {
|
|
10
|
-
chartRef!: HTMLDivElement;
|
|
11
|
-
props!: LineChartProps;
|
|
12
|
-
chart!: LC;
|
|
13
|
-
|
|
14
|
-
componentDidMount() {
|
|
15
|
-
if (hasChartBeenInitialized(this.chartRef) === false) {
|
|
16
|
-
this.chart = new LC(this.chartRef!, {
|
|
17
|
-
data: this.props.data as any,
|
|
18
|
-
options: this.props.options!,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
ref={(chartRef) => (this.chartRef = chartRef!)}
|
|
27
|
-
className="chart-holder"></div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
package/src/lollipop-chart.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { LollipopChart as LC } from '@carbon/charts';
|
|
3
|
-
import { ChartConfig, LollipopChartOptions } from '@carbon/charts/interfaces';
|
|
4
|
-
import BaseChart from './base-chart';
|
|
5
|
-
import { hasChartBeenInitialized } from './utils';
|
|
6
|
-
|
|
7
|
-
type LollipopChartProps = ChartConfig<LollipopChartOptions>;
|
|
8
|
-
|
|
9
|
-
export default class LollipopChart extends BaseChart<LollipopChartOptions> {
|
|
10
|
-
chartRef!: HTMLDivElement;
|
|
11
|
-
props!: LollipopChartProps;
|
|
12
|
-
chart!: LC;
|
|
13
|
-
|
|
14
|
-
componentDidMount() {
|
|
15
|
-
if (hasChartBeenInitialized(this.chartRef) === false) {
|
|
16
|
-
this.chart = new LC(this.chartRef!, {
|
|
17
|
-
data: this.props.data as any,
|
|
18
|
-
options: this.props.options!,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
ref={(chartRef) => (this.chartRef = chartRef!)}
|
|
27
|
-
className="chart-holder"></div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
package/src/meter-chart.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { MeterChart as MC } from '@carbon/charts';
|
|
3
|
-
import BaseChart from './base-chart';
|
|
4
|
-
import { ChartConfig, MeterChartOptions } from '@carbon/charts/interfaces';
|
|
5
|
-
import { hasChartBeenInitialized } from './utils';
|
|
6
|
-
|
|
7
|
-
type MeterChartProps = ChartConfig<MeterChartOptions>;
|
|
8
|
-
|
|
9
|
-
export default class MeterChart extends BaseChart<MeterChartOptions> {
|
|
10
|
-
chartRef!: HTMLDivElement;
|
|
11
|
-
props!: MeterChartProps;
|
|
12
|
-
chart!: MC;
|
|
13
|
-
|
|
14
|
-
componentDidMount() {
|
|
15
|
-
if (hasChartBeenInitialized(this.chartRef) === false) {
|
|
16
|
-
this.chart = new MC(this.chartRef, {
|
|
17
|
-
data: this.props.data,
|
|
18
|
-
options: this.props.options,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
ref={(chartRef) => (this.chartRef = chartRef!)}
|
|
27
|
-
className="chart-holder"></div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
package/src/pie-chart.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PieChart as PC } from '@carbon/charts';
|
|
3
|
-
import BaseChart from './base-chart';
|
|
4
|
-
import { ChartConfig, PieChartOptions } from '@carbon/charts/interfaces';
|
|
5
|
-
import { hasChartBeenInitialized } from './utils';
|
|
6
|
-
|
|
7
|
-
type PieChartProps = ChartConfig<PieChartOptions>;
|
|
8
|
-
|
|
9
|
-
export default class PieChart extends BaseChart<PieChartOptions> {
|
|
10
|
-
chartRef!: HTMLDivElement;
|
|
11
|
-
props!: PieChartProps;
|
|
12
|
-
chart!: PC;
|
|
13
|
-
|
|
14
|
-
componentDidMount() {
|
|
15
|
-
if (hasChartBeenInitialized(this.chartRef) === false) {
|
|
16
|
-
this.chart = new PC(this.chartRef, {
|
|
17
|
-
data: this.props.data,
|
|
18
|
-
options: this.props.options,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
ref={(chartRef) => (this.chartRef = chartRef!)}
|
|
27
|
-
className="chart-holder"></div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
package/src/radar-chart.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { RadarChart as RC } from '@carbon/charts';
|
|
3
|
-
import BaseChart from './base-chart';
|
|
4
|
-
import { ChartConfig, RadarChartOptions } from '@carbon/charts/interfaces';
|
|
5
|
-
import { hasChartBeenInitialized } from './utils';
|
|
6
|
-
|
|
7
|
-
type RadarChartProps = ChartConfig<RadarChartOptions>;
|
|
8
|
-
|
|
9
|
-
export default class RadarChart extends BaseChart<RadarChartOptions> {
|
|
10
|
-
chartRef!: HTMLDivElement;
|
|
11
|
-
props!: RadarChartProps;
|
|
12
|
-
chart!: RC;
|
|
13
|
-
|
|
14
|
-
componentDidMount() {
|
|
15
|
-
if (hasChartBeenInitialized(this.chartRef) === false) {
|
|
16
|
-
this.chart = new RC(this.chartRef, {
|
|
17
|
-
data: this.props.data,
|
|
18
|
-
options: this.props.options,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
ref={(chartRef) => (this.chartRef = chartRef!)}
|
|
27
|
-
className="chart-holder"></div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
package/src/scatter-chart.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ScatterChart as SC } from '@carbon/charts';
|
|
3
|
-
import { ChartConfig, ScatterChartOptions } from '@carbon/charts/interfaces';
|
|
4
|
-
import BaseChart from './base-chart';
|
|
5
|
-
import { hasChartBeenInitialized } from './utils';
|
|
6
|
-
|
|
7
|
-
type ScatterChartProps = ChartConfig<ScatterChartOptions>;
|
|
8
|
-
|
|
9
|
-
export default class ScatterChart extends BaseChart<ScatterChartOptions> {
|
|
10
|
-
chartRef!: HTMLDivElement;
|
|
11
|
-
props!: ScatterChartProps;
|
|
12
|
-
chart!: SC;
|
|
13
|
-
|
|
14
|
-
componentDidMount() {
|
|
15
|
-
if (hasChartBeenInitialized(this.chartRef) === false) {
|
|
16
|
-
this.chart = new SC(this.chartRef, {
|
|
17
|
-
data: this.props.data as any,
|
|
18
|
-
options: this.props.options!,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
ref={(chartRef) => (this.chartRef = chartRef!)}
|
|
27
|
-
className="chart-holder"></div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
package/src/tree-chart.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TreeChart as TC } from '@carbon/charts';
|
|
3
|
-
import BaseChart from './base-chart';
|
|
4
|
-
import { ChartConfig, TreeChartOptions } from '@carbon/charts/interfaces';
|
|
5
|
-
import { hasChartBeenInitialized } from './utils';
|
|
6
|
-
|
|
7
|
-
type TreeChartProps = ChartConfig<TreeChartOptions>;
|
|
8
|
-
|
|
9
|
-
export default class TreeChart extends BaseChart<TreeChartOptions> {
|
|
10
|
-
chartRef!: HTMLDivElement;
|
|
11
|
-
props!: TreeChartProps;
|
|
12
|
-
chart!: TC;
|
|
13
|
-
|
|
14
|
-
componentDidMount() {
|
|
15
|
-
if (hasChartBeenInitialized(this.chartRef) === false) {
|
|
16
|
-
this.chart = new TC(this.chartRef, {
|
|
17
|
-
data: this.props.data,
|
|
18
|
-
options: this.props.options,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
ref={(chartRef) => (this.chartRef = chartRef!)}
|
|
27
|
-
className="chart-holder"></div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
package/src/treemap-chart.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TreemapChart as TC } from '@carbon/charts';
|
|
3
|
-
import BaseChart from './base-chart';
|
|
4
|
-
import { ChartConfig, TreemapChartOptions } from '@carbon/charts/interfaces';
|
|
5
|
-
import { hasChartBeenInitialized } from './utils';
|
|
6
|
-
|
|
7
|
-
type TreemapChartProps = ChartConfig<TreemapChartOptions>;
|
|
8
|
-
|
|
9
|
-
export default class TreemapChart extends BaseChart<TreemapChartOptions> {
|
|
10
|
-
chartRef!: HTMLDivElement;
|
|
11
|
-
props!: TreemapChartProps;
|
|
12
|
-
chart!: TC;
|
|
13
|
-
|
|
14
|
-
componentDidMount() {
|
|
15
|
-
if (hasChartBeenInitialized(this.chartRef) === false) {
|
|
16
|
-
this.chart = new TC(this.chartRef, {
|
|
17
|
-
data: this.props.data,
|
|
18
|
-
options: this.props.options,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
ref={(chartRef) => (this.chartRef = chartRef!)}
|
|
27
|
-
className="chart-holder"></div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
package/src/utils.ts
DELETED
package/src/wordcloud-chart.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { WordCloudChart as WCC } from '@carbon/charts';
|
|
3
|
-
import BaseChart from './base-chart';
|
|
4
|
-
import { ChartConfig, WorldCloudChartOptions } from '@carbon/charts/interfaces';
|
|
5
|
-
import { hasChartBeenInitialized } from './utils';
|
|
6
|
-
|
|
7
|
-
type WordCloudChartProps = ChartConfig<WorldCloudChartOptions>;
|
|
8
|
-
|
|
9
|
-
export default class WordCloudChart extends BaseChart<WorldCloudChartOptions> {
|
|
10
|
-
chartRef!: HTMLDivElement;
|
|
11
|
-
props!: WordCloudChartProps;
|
|
12
|
-
chart!: WCC;
|
|
13
|
-
|
|
14
|
-
componentDidMount() {
|
|
15
|
-
if (hasChartBeenInitialized(this.chartRef) === false) {
|
|
16
|
-
this.chart = new WCC(this.chartRef, {
|
|
17
|
-
data: this.props.data,
|
|
18
|
-
options: this.props.options,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
render() {
|
|
24
|
-
return (
|
|
25
|
-
<div
|
|
26
|
-
ref={(chartRef) => (this.chartRef = chartRef!)}
|
|
27
|
-
className="chart-holder"></div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
const introStories = storiesOf('Docs|Getting Started', module);
|
|
5
|
-
|
|
6
|
-
// Loop through the demos for the group
|
|
7
|
-
introStories.add('Welcome', () => (
|
|
8
|
-
<div className="container intro">
|
|
9
|
-
<div
|
|
10
|
-
className="welcome__container"
|
|
11
|
-
style={{
|
|
12
|
-
background: 'url(./welcome.png) no-repeat center center fixed',
|
|
13
|
-
backgroundSize: 'cover',
|
|
14
|
-
}}>
|
|
15
|
-
<div className="welcome__content">
|
|
16
|
-
<h2 className="welcome__heading">Carbon Charts</h2>
|
|
17
|
-
<h4 className="welcome__heading welcome__heading--subtitle">(React)</h4>
|
|
18
|
-
<h5 className="welcome__heading welcome__heading--other">
|
|
19
|
-
Other versions
|
|
20
|
-
</h5>
|
|
21
|
-
<ul>
|
|
22
|
-
<li>
|
|
23
|
-
<a
|
|
24
|
-
href="https://charts.carbondesignsystem.com"
|
|
25
|
-
className="welcome__heading welcome__heading--other">
|
|
26
|
-
vanilla
|
|
27
|
-
</a>
|
|
28
|
-
</li>
|
|
29
|
-
<li>
|
|
30
|
-
<a
|
|
31
|
-
href="https://charts.carbondesignsystem.com/angular"
|
|
32
|
-
className="welcome__heading welcome__heading--other">
|
|
33
|
-
Angular
|
|
34
|
-
</a>
|
|
35
|
-
</li>
|
|
36
|
-
<li>
|
|
37
|
-
<a
|
|
38
|
-
href="https://charts.carbondesignsystem.com/vue"
|
|
39
|
-
className="welcome__heading welcome__heading--other">
|
|
40
|
-
Vue
|
|
41
|
-
</a>
|
|
42
|
-
</li>
|
|
43
|
-
<li>
|
|
44
|
-
<a
|
|
45
|
-
href="https://charts.carbondesignsystem.com/svelte"
|
|
46
|
-
className="welcome__heading welcome__heading--other">
|
|
47
|
-
Svelte
|
|
48
|
-
</a>
|
|
49
|
-
</li>
|
|
50
|
-
</ul>
|
|
51
|
-
<span className="netlify">
|
|
52
|
-
Deploys by{' '}
|
|
53
|
-
<a href="https://netlify.com" target="_blank">
|
|
54
|
-
Netlify
|
|
55
|
-
</a>
|
|
56
|
-
</span>
|
|
57
|
-
</div>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
));
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { storiesOf } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
// import tutorial MD strings
|
|
5
|
-
import { reactGettingStartedTutorial } from './1_gettingStarted_content';
|
|
6
|
-
import * as TUTORIALS from '../../core/stories/tutorials/index';
|
|
7
|
-
|
|
8
|
-
// Syntax highlighting
|
|
9
|
-
const hljs = require('highlight.js');
|
|
10
|
-
hljs.registerLanguage('js', require('highlight.js/lib/languages/javascript'));
|
|
11
|
-
hljs.registerLanguage('bash', require('highlight.js/lib/languages/bash'));
|
|
12
|
-
|
|
13
|
-
hljs.registerLanguage(
|
|
14
|
-
'typescript',
|
|
15
|
-
require('highlight.js/lib/languages/typescript')
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
const gettingStartedStories = storiesOf('Docs|Getting Started', module);
|
|
19
|
-
const tutorialStories = storiesOf('Docs|Tutorials', module);
|
|
20
|
-
|
|
21
|
-
gettingStartedStories.add('Instructions', () => {
|
|
22
|
-
const demoRef = React.useRef(null);
|
|
23
|
-
|
|
24
|
-
// Add syntax highlighting
|
|
25
|
-
React.useEffect(() => {
|
|
26
|
-
if (demoRef.current) {
|
|
27
|
-
const container = demoRef.current;
|
|
28
|
-
container.querySelectorAll('pre code').forEach((block) => {
|
|
29
|
-
hljs.highlightBlock(block);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}, [demoRef]);
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<div
|
|
36
|
-
ref={demoRef}
|
|
37
|
-
className="container tutorial"
|
|
38
|
-
dangerouslySetInnerHTML={{
|
|
39
|
-
__html: reactGettingStartedTutorial.content,
|
|
40
|
-
}}></div>
|
|
41
|
-
);
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
// Add tutorial stories
|
|
45
|
-
Object.keys(TUTORIALS).forEach((tutorialKey) => {
|
|
46
|
-
const tutorial = TUTORIALS[tutorialKey];
|
|
47
|
-
|
|
48
|
-
if (tutorial.type !== 'getting-started' && tutorial.name !== 'API') {
|
|
49
|
-
const storiesToAddTo = tutorialStories;
|
|
50
|
-
|
|
51
|
-
storiesToAddTo.add(tutorial.name, () => {
|
|
52
|
-
const demoRef = React.useRef(null);
|
|
53
|
-
|
|
54
|
-
// Add syntax highlighting
|
|
55
|
-
React.useEffect(() => {
|
|
56
|
-
if (demoRef.current) {
|
|
57
|
-
const container = demoRef.current;
|
|
58
|
-
container.querySelectorAll('pre code').forEach((block) => {
|
|
59
|
-
hljs.highlightBlock(block);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
}, [demoRef]);
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<div
|
|
66
|
-
ref={demoRef}
|
|
67
|
-
className="container tutorial"
|
|
68
|
-
dangerouslySetInnerHTML={{
|
|
69
|
-
__html: tutorial.content,
|
|
70
|
-
}}></div>
|
|
71
|
-
);
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
});
|