@semcore/d3-chart 3.18.1 → 3.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -1
- package/README.md +1 -1
- package/lib/cjs/Area.js +9 -9
- package/lib/cjs/Axis.js +14 -14
- package/lib/cjs/Bar.js +8 -8
- package/lib/cjs/Bubble.js +10 -10
- package/lib/cjs/Donut.js +7 -7
- package/lib/cjs/Dots.js +10 -10
- package/lib/cjs/HorizontalBar.js +8 -8
- package/lib/cjs/Hover.js +3 -3
- package/lib/cjs/Line.js +13 -11
- package/lib/cjs/Line.js.map +1 -1
- package/lib/cjs/Plot.js +3 -3
- package/lib/cjs/Radar.js +17 -17
- package/lib/cjs/RadialTree.js +10 -10
- package/lib/cjs/ReferenceLine.js +9 -9
- package/lib/cjs/ScatterPlot.js +8 -8
- package/lib/cjs/ScatterPlot.js.map +1 -1
- package/lib/cjs/Tooltip.js +8 -8
- package/lib/cjs/Venn.js +7 -7
- package/lib/cjs/a11y/PlotA11yModule.js +2 -2
- package/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/lib/cjs/component/Chart/AbstractChart.js +420 -0
- package/lib/cjs/component/Chart/AbstractChart.js.map +1 -0
- package/lib/cjs/component/Chart/AbstractChart.type.js +2 -0
- package/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -0
- package/lib/cjs/component/Chart/AreaChart.js +160 -0
- package/lib/cjs/component/Chart/AreaChart.js.map +1 -0
- package/lib/cjs/component/Chart/AreaChart.type.js +2 -0
- package/lib/cjs/component/Chart/AreaChart.type.js.map +1 -0
- package/lib/cjs/component/Chart/BarChart.js +253 -0
- package/lib/cjs/component/Chart/BarChart.js.map +1 -0
- package/lib/cjs/component/Chart/BarChart.type.js +2 -0
- package/lib/cjs/component/Chart/BarChart.type.js.map +1 -0
- package/lib/cjs/component/Chart/BubbleChart.js +145 -0
- package/lib/cjs/component/Chart/BubbleChart.js.map +1 -0
- package/lib/cjs/component/Chart/BubbleChart.type.js +2 -0
- package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -0
- package/lib/cjs/component/Chart/DonutChart.js +117 -0
- package/lib/cjs/component/Chart/DonutChart.js.map +1 -0
- package/lib/cjs/component/Chart/DonutChart.type.js +2 -0
- package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -0
- package/lib/cjs/component/Chart/HistogramChart.js +189 -0
- package/lib/cjs/component/Chart/HistogramChart.js.map +1 -0
- package/lib/cjs/component/Chart/HistogramChart.type.js +2 -0
- package/lib/cjs/component/Chart/HistogramChart.type.js.map +1 -0
- package/lib/cjs/component/Chart/LineChart.js +147 -0
- package/lib/cjs/component/Chart/LineChart.js.map +1 -0
- package/lib/cjs/component/Chart/LineChart.type.js +2 -0
- package/lib/cjs/component/Chart/LineChart.type.js.map +1 -0
- package/lib/cjs/component/Chart/RadarChart.js +121 -0
- package/lib/cjs/component/Chart/RadarChart.js.map +1 -0
- package/lib/cjs/component/Chart/RadarChart.type.js +2 -0
- package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -0
- package/lib/cjs/component/Chart/ScatterPlotChart.js +159 -0
- package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -0
- package/lib/cjs/component/Chart/ScatterPlotChart.type.js +2 -0
- package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -0
- package/lib/cjs/component/Chart/VennChart.js +144 -0
- package/lib/cjs/component/Chart/VennChart.js.map +1 -0
- package/lib/cjs/component/Chart/VennChart.type.js +2 -0
- package/lib/cjs/component/Chart/VennChart.type.js.map +1 -0
- package/lib/cjs/component/Chart/index.js +28 -0
- package/lib/cjs/component/Chart/index.js.map +1 -0
- package/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +20 -17
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -7
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendTable/legend-table.shadow.css +5 -2
- package/lib/cjs/index.js +7 -0
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/donut.shadow.css +3 -0
- package/lib/cjs/types/Line.d.js.map +1 -1
- package/lib/cjs/types/index.d.js +130 -1
- package/lib/cjs/types/index.d.js.map +1 -1
- package/lib/es6/Area.js +9 -9
- package/lib/es6/Axis.js +14 -14
- package/lib/es6/Bar.js +8 -8
- package/lib/es6/Bubble.js +10 -10
- package/lib/es6/Donut.js +7 -7
- package/lib/es6/Dots.js +10 -10
- package/lib/es6/HorizontalBar.js +8 -8
- package/lib/es6/Hover.js +3 -3
- package/lib/es6/Line.js +13 -11
- package/lib/es6/Line.js.map +1 -1
- package/lib/es6/Plot.js +3 -3
- package/lib/es6/Radar.js +17 -17
- package/lib/es6/RadialTree.js +10 -10
- package/lib/es6/ReferenceLine.js +9 -9
- package/lib/es6/ScatterPlot.js +8 -8
- package/lib/es6/ScatterPlot.js.map +1 -1
- package/lib/es6/Tooltip.js +8 -8
- package/lib/es6/Venn.js +7 -7
- package/lib/es6/a11y/PlotA11yModule.js +2 -2
- package/lib/es6/a11y/PlotA11yView.js +2 -2
- package/lib/es6/component/Chart/AbstractChart.js +412 -0
- package/lib/es6/component/Chart/AbstractChart.js.map +1 -0
- package/lib/es6/component/Chart/AbstractChart.type.js +2 -0
- package/lib/es6/component/Chart/AbstractChart.type.js.map +1 -0
- package/lib/es6/component/Chart/AreaChart.js +152 -0
- package/lib/es6/component/Chart/AreaChart.js.map +1 -0
- package/lib/es6/component/Chart/AreaChart.type.js +2 -0
- package/lib/es6/component/Chart/AreaChart.type.js.map +1 -0
- package/lib/es6/component/Chart/BarChart.js +245 -0
- package/lib/es6/component/Chart/BarChart.js.map +1 -0
- package/lib/es6/component/Chart/BarChart.type.js +2 -0
- package/lib/es6/component/Chart/BarChart.type.js.map +1 -0
- package/lib/es6/component/Chart/BubbleChart.js +137 -0
- package/lib/es6/component/Chart/BubbleChart.js.map +1 -0
- package/lib/es6/component/Chart/BubbleChart.type.js +2 -0
- package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -0
- package/lib/es6/component/Chart/DonutChart.js +109 -0
- package/lib/es6/component/Chart/DonutChart.js.map +1 -0
- package/lib/es6/component/Chart/DonutChart.type.js +2 -0
- package/lib/es6/component/Chart/DonutChart.type.js.map +1 -0
- package/lib/es6/component/Chart/HistogramChart.js +181 -0
- package/lib/es6/component/Chart/HistogramChart.js.map +1 -0
- package/lib/es6/component/Chart/HistogramChart.type.js +2 -0
- package/lib/es6/component/Chart/HistogramChart.type.js.map +1 -0
- package/lib/es6/component/Chart/LineChart.js +139 -0
- package/lib/es6/component/Chart/LineChart.js.map +1 -0
- package/lib/es6/component/Chart/LineChart.type.js +2 -0
- package/lib/es6/component/Chart/LineChart.type.js.map +1 -0
- package/lib/es6/component/Chart/RadarChart.js +113 -0
- package/lib/es6/component/Chart/RadarChart.js.map +1 -0
- package/lib/es6/component/Chart/RadarChart.type.js +2 -0
- package/lib/es6/component/Chart/RadarChart.type.js.map +1 -0
- package/lib/es6/component/Chart/ScatterPlotChart.js +151 -0
- package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -0
- package/lib/es6/component/Chart/ScatterPlotChart.type.js +2 -0
- package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -0
- package/lib/es6/component/Chart/VennChart.js +136 -0
- package/lib/es6/component/Chart/VennChart.js.map +1 -0
- package/lib/es6/component/Chart/VennChart.type.js +2 -0
- package/lib/es6/component/Chart/VennChart.type.js.map +1 -0
- package/lib/es6/component/Chart/index.js +21 -0
- package/lib/es6/component/Chart/index.js.map +1 -0
- package/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +20 -17
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -7
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendTable/legend-table.shadow.css +5 -2
- package/lib/es6/index.js +1 -0
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/donut.shadow.css +3 -0
- package/lib/es6/types/Line.d.js.map +1 -1
- package/lib/es6/types/index.d.js +12 -0
- package/lib/es6/types/index.d.js.map +1 -1
- package/lib/types/Line.d.ts +7 -2
- package/lib/types/component/Chart/AbstractChart.d.ts +50 -0
- package/lib/types/component/Chart/AbstractChart.type.d.ts +161 -0
- package/lib/types/component/Chart/AreaChart.d.ts +2 -0
- package/lib/types/component/Chart/AreaChart.type.d.ts +16 -0
- package/lib/types/component/Chart/BarChart.d.ts +2 -0
- package/lib/types/component/Chart/BarChart.type.d.ts +19 -0
- package/lib/types/component/Chart/BubbleChart.d.ts +2 -0
- package/lib/types/component/Chart/BubbleChart.type.d.ts +17 -0
- package/lib/types/component/Chart/DonutChart.d.ts +2 -0
- package/lib/types/component/Chart/DonutChart.type.d.ts +15 -0
- package/lib/types/component/Chart/HistogramChart.d.ts +2 -0
- package/lib/types/component/Chart/HistogramChart.type.d.ts +11 -0
- package/lib/types/component/Chart/LineChart.d.ts +2 -0
- package/lib/types/component/Chart/LineChart.type.d.ts +24 -0
- package/lib/types/component/Chart/RadarChart.d.ts +2 -0
- package/lib/types/component/Chart/RadarChart.type.d.ts +14 -0
- package/lib/types/component/Chart/ScatterPlotChart.d.ts +2 -0
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +13 -0
- package/lib/types/component/Chart/VennChart.d.ts +2 -0
- package/lib/types/component/Chart/VennChart.type.d.ts +11 -0
- package/lib/types/component/Chart/index.d.ts +12 -0
- package/lib/types/component/ChartLegend/BaseLegend.type.d.ts +2 -2
- package/lib/types/index.d.ts +13 -0
- package/package.json +2 -2
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.VennChart = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
11
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
var _react = _interopRequireDefault(require("react"));
|
|
14
|
+
var _core = _interopRequireDefault(require("@semcore/core"));
|
|
15
|
+
var _d3Scale = require("d3-scale");
|
|
16
|
+
var _ = require("../..");
|
|
17
|
+
var _AbstractChart2 = require("./AbstractChart");
|
|
18
|
+
var _typography = require("@semcore/typography");
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
var VennChartComponent = /*#__PURE__*/function (_AbstractChart) {
|
|
21
|
+
(0, _inherits2["default"])(VennChartComponent, _AbstractChart);
|
|
22
|
+
var _super = (0, _createSuper2["default"])(VennChartComponent);
|
|
23
|
+
function VennChartComponent() {
|
|
24
|
+
(0, _classCallCheck2["default"])(this, VennChartComponent);
|
|
25
|
+
return _super.apply(this, arguments);
|
|
26
|
+
}
|
|
27
|
+
(0, _createClass2["default"])(VennChartComponent, [{
|
|
28
|
+
key: "xScale",
|
|
29
|
+
get: function get() {
|
|
30
|
+
var xScale = this.asProps.xScale;
|
|
31
|
+
if (xScale) {
|
|
32
|
+
return xScale;
|
|
33
|
+
}
|
|
34
|
+
return (0, _d3Scale.scaleLinear)();
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
key: "yScale",
|
|
38
|
+
get: function get() {
|
|
39
|
+
var yScale = this.asProps.yScale;
|
|
40
|
+
if (yScale) {
|
|
41
|
+
return yScale;
|
|
42
|
+
}
|
|
43
|
+
return (0, _d3Scale.scaleLinear)();
|
|
44
|
+
}
|
|
45
|
+
}, {
|
|
46
|
+
key: "dataKeys",
|
|
47
|
+
get: function get() {
|
|
48
|
+
var _this$props = this.props,
|
|
49
|
+
data = _this$props.data,
|
|
50
|
+
groupKey = _this$props.groupKey;
|
|
51
|
+
var legendKeys = Object.keys(data).filter(function (item) {
|
|
52
|
+
var isIntersection = /\//.test(item);
|
|
53
|
+
return !isIntersection;
|
|
54
|
+
});
|
|
55
|
+
return legendKeys;
|
|
56
|
+
}
|
|
57
|
+
}, {
|
|
58
|
+
key: "defaultLegendProps",
|
|
59
|
+
value: function defaultLegendProps() {
|
|
60
|
+
return {
|
|
61
|
+
legendType: 'Table'
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
key: "renderChart",
|
|
66
|
+
value: function renderChart() {
|
|
67
|
+
var data = this.asProps.data;
|
|
68
|
+
var _this$state = this.state,
|
|
69
|
+
dataDefinitions = _this$state.dataDefinitions,
|
|
70
|
+
highlightedLine = _this$state.highlightedLine;
|
|
71
|
+
var checkedLegendItems = dataDefinitions.filter(function (item) {
|
|
72
|
+
return item.checked;
|
|
73
|
+
});
|
|
74
|
+
var checkedLegendItemsMap = checkedLegendItems.reduce(function (result, item) {
|
|
75
|
+
result[item.id] = item;
|
|
76
|
+
return result;
|
|
77
|
+
}, {});
|
|
78
|
+
var intersections = Object.keys(data).reduce(function (result, dataKey) {
|
|
79
|
+
var isIntersection = /\//.test(dataKey);
|
|
80
|
+
if (isIntersection) {
|
|
81
|
+
result.push(dataKey);
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
}, []);
|
|
85
|
+
return /*#__PURE__*/_react["default"].createElement(_.Venn, null, checkedLegendItems.map(function (item, index) {
|
|
86
|
+
return /*#__PURE__*/_react["default"].createElement(_.Venn.Circle, {
|
|
87
|
+
key: item.id,
|
|
88
|
+
dataKey: item.id,
|
|
89
|
+
name: item.label,
|
|
90
|
+
color: item.color,
|
|
91
|
+
transparent: highlightedLine !== -1 && highlightedLine !== index
|
|
92
|
+
});
|
|
93
|
+
}), intersections.map(function (intersectionKey) {
|
|
94
|
+
var intersectionKeys = intersectionKey.split('/');
|
|
95
|
+
var hasDisabledItems = intersectionKeys.some(function (key) {
|
|
96
|
+
return checkedLegendItemsMap[key] === undefined;
|
|
97
|
+
});
|
|
98
|
+
if (hasDisabledItems) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
var name = intersectionKeys.map(function (id) {
|
|
102
|
+
var _dataDefinitions$find;
|
|
103
|
+
return ((_dataDefinitions$find = dataDefinitions.find(function (legendItem) {
|
|
104
|
+
return legendItem.id === id;
|
|
105
|
+
})) === null || _dataDefinitions$find === void 0 ? void 0 : _dataDefinitions$find.label) || '';
|
|
106
|
+
}).join(' & ');
|
|
107
|
+
return /*#__PURE__*/_react["default"].createElement(_.Venn.Intersection, {
|
|
108
|
+
key: intersectionKey,
|
|
109
|
+
dataKey: intersectionKey,
|
|
110
|
+
name: name
|
|
111
|
+
});
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
}, {
|
|
115
|
+
key: "renderTooltip",
|
|
116
|
+
value: function renderTooltip() {
|
|
117
|
+
var showTooltip = this.asProps.showTooltip;
|
|
118
|
+
if (!showTooltip) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
return /*#__PURE__*/_react["default"].createElement(_.Venn.Tooltip, null, function (_ref) {
|
|
122
|
+
var name = _ref.name,
|
|
123
|
+
dataKey = _ref.dataKey,
|
|
124
|
+
data = _ref.data;
|
|
125
|
+
return {
|
|
126
|
+
children: /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_.Venn.Tooltip.Title, null, name), /*#__PURE__*/_react["default"].createElement(_typography.Text, {
|
|
127
|
+
bold: true
|
|
128
|
+
}, data[dataKey]))
|
|
129
|
+
};
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}]);
|
|
133
|
+
return VennChartComponent;
|
|
134
|
+
}(_AbstractChart2.AbstractChart);
|
|
135
|
+
(0, _defineProperty2["default"])(VennChartComponent, "displayName", 'Chart.Venn');
|
|
136
|
+
(0, _defineProperty2["default"])(VennChartComponent, "defaultProps", {
|
|
137
|
+
direction: 'row-reverse',
|
|
138
|
+
alignItems: 'flex-start',
|
|
139
|
+
marginY: 0,
|
|
140
|
+
marginX: 0
|
|
141
|
+
});
|
|
142
|
+
var VennChart = (0, _core["default"])(VennChartComponent);
|
|
143
|
+
exports.VennChart = VennChart;
|
|
144
|
+
//# sourceMappingURL=VennChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VennChart.js","names":["_react","_interopRequireDefault","require","_core","_d3Scale","_","_AbstractChart2","_typography","VennChartComponent","_AbstractChart","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","get","xScale","asProps","scaleLinear","yScale","_this$props","props","data","groupKey","legendKeys","Object","keys","filter","item","isIntersection","test","value","defaultLegendProps","legendType","renderChart","_this$state","state","dataDefinitions","highlightedLine","checkedLegendItems","checked","checkedLegendItemsMap","reduce","result","id","intersections","dataKey","push","createElement","Venn","map","index","Circle","name","label","color","transparent","intersectionKey","intersectionKeys","split","hasDisabledItems","some","undefined","_dataDefinitions$find","find","legendItem","join","Intersection","renderTooltip","showTooltip","Tooltip","_ref","children","Fragment","Title","Text","bold","AbstractChart","_defineProperty2","direction","alignItems","marginY","marginX","VennChart","createComponent","exports"],"sources":["../../../../src/component/Chart/VennChart.tsx"],"sourcesContent":["import React from 'react';\nimport createComponent from '@semcore/core';\nimport { BaseChartProps } from './AbstractChart.type';\nimport { scaleLinear } from 'd3-scale';\n// @ts-ignore\nimport { Venn } from '../..';\nimport { AbstractChart } from './AbstractChart';\nimport { Text } from '@semcore/typography';\nimport { VennChartData, VennChartProps, VennChartType } from './VennChart.type';\nimport { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';\n\nclass VennChartComponent extends AbstractChart<VennChartData, VennChartProps> {\n static displayName = 'Chart.Venn';\n\n static defaultProps: Partial<BaseChartProps<VennChartData>> = {\n direction: 'row-reverse',\n alignItems: 'flex-start',\n marginY: 0,\n marginX: 0,\n };\n\n get xScale() {\n const { xScale } = this.asProps;\n\n if (xScale) {\n return xScale;\n }\n\n return scaleLinear();\n }\n\n get yScale() {\n const { yScale } = this.asProps;\n\n if (yScale) {\n return yScale;\n }\n\n return scaleLinear();\n }\n\n protected get dataKeys(): string[] {\n const { data, groupKey } = this.props;\n\n const legendKeys: string[] = Object.keys(data).filter((item) => {\n const isIntersection = /\\//.test(item);\n\n return !isIntersection;\n });\n\n return legendKeys;\n }\n\n defaultLegendProps() {\n return {\n legendType: 'Table' as const,\n };\n }\n\n renderChart() {\n const { data } = this.asProps;\n const { dataDefinitions, highlightedLine } = this.state;\n\n const checkedLegendItems = dataDefinitions.filter((item) => item.checked);\n const checkedLegendItemsMap = checkedLegendItems.reduce<Record<string, LegendItem>>(\n (result, item) => {\n result[item.id] = item;\n\n return result;\n },\n {},\n );\n\n const intersections = Object.keys(data).reduce<string[]>((result, dataKey) => {\n const isIntersection = /\\//.test(dataKey);\n\n if (isIntersection) {\n result.push(dataKey);\n }\n\n return result;\n }, []);\n\n return (\n <Venn>\n {checkedLegendItems.map((item, index) => {\n return (\n <Venn.Circle\n key={item.id}\n dataKey={item.id}\n name={item.label}\n color={item.color}\n transparent={highlightedLine !== -1 && highlightedLine !== index}\n />\n );\n })}\n\n {intersections.map((intersectionKey) => {\n const intersectionKeys = intersectionKey.split('/');\n\n const hasDisabledItems = intersectionKeys.some((key) => {\n return checkedLegendItemsMap[key] === undefined;\n });\n\n if (hasDisabledItems) {\n return null;\n }\n\n const name = intersectionKeys\n .map((id) => {\n return dataDefinitions.find((legendItem) => legendItem.id === id)?.label || '';\n })\n .join(' & ');\n\n return <Venn.Intersection key={intersectionKey} dataKey={intersectionKey} name={name} />;\n })}\n </Venn>\n );\n }\n\n renderTooltip() {\n const { showTooltip } = this.asProps;\n\n if (!showTooltip) {\n return null;\n }\n\n return (\n <Venn.Tooltip>\n {({ name, dataKey, data }: any) => {\n return {\n children: (\n <>\n <Venn.Tooltip.Title>{name}</Venn.Tooltip.Title>\n <Text bold>{data[dataKey]}</Text>\n </>\n ),\n };\n }}\n </Venn.Tooltip>\n );\n }\n}\n\nexport const VennChart: VennChartType = createComponent(VennChartComponent);\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,CAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAHA;AAAA,IAOMM,kBAAkB,0BAAAC,cAAA;EAAA,IAAAC,UAAA,aAAAF,kBAAA,EAAAC,cAAA;EAAA,IAAAE,MAAA,OAAAC,aAAA,aAAAJ,kBAAA;EAAA,SAAAA,mBAAA;IAAA,IAAAK,gBAAA,mBAAAL,kBAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAA,IAAAC,aAAA,aAAAR,kBAAA;IAAAS,GAAA;IAAAC,GAAA,EAUtB,SAAAA,IAAA,EAAa;MACX,IAAQC,MAAM,GAAK,IAAI,CAACC,OAAO,CAAvBD,MAAM;MAEd,IAAIA,MAAM,EAAE;QACV,OAAOA,MAAM;MACf;MAEA,OAAO,IAAAE,oBAAW,GAAE;IACtB;EAAC;IAAAJ,GAAA;IAAAC,GAAA,EAED,SAAAA,IAAA,EAAa;MACX,IAAQI,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BzE,kBAAkB,kBAGwC;EAC5D0E,SAAS,EAAE,aAAa;EACxBC,UAAU,EAAE,YAAY;EACxBC,OAAO,EAAE,CAAC;EACVC,OAAO,EAAE;AACX,CAAC;AA6HI,IAAMC,SAAwB,GAAG,IAAAC,gBAAe,EAAC/E,kBAAkB,CAAC;AAACgF,OAAA,CAAAF,SAAA,GAAAA,SAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VennChart.type.js","names":[],"sources":["../../../../src/component/Chart/VennChart.type.ts"],"sourcesContent":["import { Intergalactic } from '@semcore/core';\nimport { Flex } from '@semcore/flex-box';\nimport { ScaleLinear } from 'd3-scale';\nimport { BaseChartProps } from './AbstractChart.type';\n\nexport type VennChartData = Record<string, number>;\n\nexport type VennChartProps = BaseChartProps<VennChartData> & {\n groupKey?: never;\n xScale?: ScaleLinear<any, any>;\n yScale?: ScaleLinear<any, any>;\n};\n\nexport type VennChartType = Intergalactic.Component<typeof Flex, VennChartProps>;\n"],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _LineChart = require("./LineChart");
|
|
8
|
+
var _BarChart = require("./BarChart");
|
|
9
|
+
var _HistogramChart = require("./HistogramChart");
|
|
10
|
+
var _ScatterPlotChart = require("./ScatterPlotChart");
|
|
11
|
+
var _AreaChart = require("./AreaChart");
|
|
12
|
+
var _BubbleChart = require("./BubbleChart");
|
|
13
|
+
var _DonutChart = require("./DonutChart");
|
|
14
|
+
var _VennChart = require("./VennChart");
|
|
15
|
+
var _RadarChart = require("./RadarChart");
|
|
16
|
+
var _default = {
|
|
17
|
+
Line: _LineChart.LineChart,
|
|
18
|
+
Bar: _BarChart.BarChart,
|
|
19
|
+
Histogram: _HistogramChart.HistogramChart,
|
|
20
|
+
ScatterPlot: _ScatterPlotChart.ScatterPlotChart,
|
|
21
|
+
Area: _AreaChart.AreaChart,
|
|
22
|
+
Bubble: _BubbleChart.BubbleChart,
|
|
23
|
+
Donut: _DonutChart.DonutChart,
|
|
24
|
+
Venn: _VennChart.VennChart,
|
|
25
|
+
Radar: _RadarChart.RadarChart
|
|
26
|
+
};
|
|
27
|
+
exports["default"] = _default;
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_LineChart","require","_BarChart","_HistogramChart","_ScatterPlotChart","_AreaChart","_BubbleChart","_DonutChart","_VennChart","_RadarChart","_default","Line","LineChart","Bar","BarChart","Histogram","HistogramChart","ScatterPlot","ScatterPlotChart","Area","AreaChart","Bubble","BubbleChart","Donut","DonutChart","Venn","VennChart","Radar","RadarChart","exports"],"sources":["../../../../src/component/Chart/index.ts"],"sourcesContent":["import { LineChart } from './LineChart';\nimport { BarChart } from './BarChart';\nimport { HistogramChart } from './HistogramChart';\nimport { ScatterPlotChart } from './ScatterPlotChart';\nimport { AreaChart } from './AreaChart';\nimport { BubbleChart } from './BubbleChart';\nimport { DonutChart } from './DonutChart';\nimport { VennChart } from './VennChart';\nimport { RadarChart } from './RadarChart';\n\nexport default {\n Line: LineChart,\n Bar: BarChart,\n Histogram: HistogramChart,\n ScatterPlot: ScatterPlotChart,\n Area: AreaChart,\n Bubble: BubbleChart,\n Donut: DonutChart,\n Venn: VennChart,\n Radar: RadarChart,\n};\n"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AAA0C,IAAAS,QAAA,GAE3B;EACbC,IAAI,EAAEC,oBAAS;EACfC,GAAG,EAAEC,kBAAQ;EACbC,SAAS,EAAEC,8BAAc;EACzBC,WAAW,EAAEC,kCAAgB;EAC7BC,IAAI,EAAEC,oBAAS;EACfC,MAAM,EAAEC,wBAAW;EACnBC,KAAK,EAAEC,sBAAU;EACjBC,IAAI,EAAEC,oBAAS;EACfC,KAAK,EAAEC;AACT,CAAC;AAAAC,OAAA,cAAAnB,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseLegend.type.js","names":[],"sources":["../../../../src/component/ChartLegend/BaseLegend.type.ts"],"sourcesContent":["import { BoxProps } from '@semcore/flex-box';\nimport { LegendItem, LegendItemKey, ShapeType } from './LegendItem/LegendItem.type';\nimport { DataStructureHints } from '../../a11y/hints';\n\nexport type LSize = 'm' | 'l';\n\nexport type BaseChartLegendProps = {\n /**\n * Size for legend items\n */\n size?: LSize;\n /**\n * Shape of data item on Legend panel\n */\n shape?: ShapeType;\n /**\n * Handler for change visible for data items. Doesn't work if Shape one of 'Circle' | 'Line' | 'Square'\n */\n onChangeVisibleItem?: (key: LegendItemKey, isVisible: boolean) => void;\n\n onMouseEnterItem?: (key: LegendItemKey, e?: React.SyntheticEvent) => void;\n\n onMouseLeaveItem?: (key: LegendItemKey, e?: React.SyntheticEvent) => void;\n\n dataHints?: DataStructureHints;\n};\n\nexport type LegendProps = BoxProps &\n BaseChartLegendProps & {\n /**\n * Legend items\n */\n items: LegendItem[];\n };\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"BaseLegend.type.js","names":[],"sources":["../../../../src/component/ChartLegend/BaseLegend.type.ts"],"sourcesContent":["import { BoxProps, FlexProps } from '@semcore/flex-box';\nimport { LegendItem, LegendItemKey, ShapeType } from './LegendItem/LegendItem.type';\nimport { DataStructureHints } from '../../a11y/hints';\n\nexport type LSize = 'm' | 'l';\n\nexport type BaseChartLegendProps = FlexProps & {\n /**\n * Size for legend items\n */\n size?: LSize;\n /**\n * Shape of data item on Legend panel\n */\n shape?: ShapeType;\n /**\n * Handler for change visible for data items. Doesn't work if Shape one of 'Circle' | 'Line' | 'Square'\n */\n onChangeVisibleItem?: (key: LegendItemKey, isVisible: boolean) => void;\n\n onMouseEnterItem?: (key: LegendItemKey, e?: React.SyntheticEvent) => void;\n\n onMouseLeaveItem?: (key: LegendItemKey, e?: React.SyntheticEvent) => void;\n\n dataHints?: DataStructureHints;\n};\n\nexport type LegendProps = BoxProps &\n BaseChartLegendProps & {\n /**\n * Legend items\n */\n items: LegendItem[];\n };\n"],"mappings":""}
|
|
@@ -22,10 +22,10 @@ var _BaseLegend2 = require("../BaseLegend");
|
|
|
22
22
|
var _intergalacticDynamicLocales = require("../../../translations/__intergalactic-dynamic-locales");
|
|
23
23
|
var _i18nEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/i18nEnhance"));
|
|
24
24
|
/*__reshadow-styles__:"./legend-flex.shadow.css"*/
|
|
25
|
-
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
|
26
|
-
"__SLegendFlex": "
|
|
27
|
-
"_direction_row": "
|
|
28
|
-
"_direction_column": "
|
|
25
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SLegendFlex_gusls_gg_._direction_row_gusls_gg_{align-items:center;flex-wrap:wrap;gap:8px 16px}.___SLegendFlex_gusls_gg_._direction_column_gusls_gg_{align-items:flex-start;flex-wrap:wrap;gap:8px}" /*__inner_css_end__*/, "gusls_gg_") /*__reshadow_css_end__*/, {
|
|
26
|
+
"__SLegendFlex": "___SLegendFlex_gusls_gg_",
|
|
27
|
+
"_direction_row": "_direction_row_gusls_gg_",
|
|
28
|
+
"_direction_column": "_direction_column_gusls_gg_"
|
|
29
29
|
});
|
|
30
30
|
var LegendFlexRoot = /*#__PURE__*/function (_BaseLegend) {
|
|
31
31
|
(0, _inherits2["default"])(LegendFlexRoot, _BaseLegend);
|
|
@@ -19,23 +19,24 @@ var _flexBox = require("@semcore/flex-box");
|
|
|
19
19
|
var _checkbox = _interopRequireDefault(require("@semcore/checkbox"));
|
|
20
20
|
var _typography = require("@semcore/typography");
|
|
21
21
|
var _LegendItem = require("./LegendItem.type");
|
|
22
|
+
var _resolveColorEnhance = _interopRequireDefault(require("@semcore/utils/src/enhances/resolveColorEnhance"));
|
|
22
23
|
var _excluded = ["color"];
|
|
23
24
|
/*__reshadow-styles__:"./legend-item.shadow.css"*/
|
|
24
|
-
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
|
25
|
-
"__SLegendItem": "
|
|
26
|
-
"_disabled": "
|
|
27
|
-
"__SPointShape": "
|
|
28
|
-
"_color": "
|
|
29
|
-
"--color": "--
|
|
30
|
-
"_shape_Circle": "
|
|
31
|
-
"_size_l": "
|
|
32
|
-
"_size_m": "
|
|
33
|
-
"_shape_Line": "
|
|
34
|
-
"_shape_Square": "
|
|
35
|
-
"__SIcon": "
|
|
36
|
-
"__SLabel": "
|
|
37
|
-
"__SAdditionalLabel": "
|
|
38
|
-
"__SCount": "
|
|
25
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SLegendItem_1dy0i_gg_{align-items:flex-start}@media (hover:hover){.___SLegendItem_1dy0i_gg_:hover{cursor:pointer}.___SLegendItem_1dy0i_gg_.__disabled_1dy0i_gg_:hover{cursor:default}}.___SPointShape_1dy0i_gg_.__color_1dy0i_gg_{background-color:var(--color_1dy0i);margin-right:8px}.___SPointShape_1dy0i_gg_._shape_Circle_1dy0i_gg_._size_l_1dy0i_gg_{width:16px;height:16px;border-radius:8px;margin-top:4px}.___SPointShape_1dy0i_gg_._shape_Circle_1dy0i_gg_._size_m_1dy0i_gg_{width:12px;height:12px;border-radius:6px;margin-top:4px}.___SPointShape_1dy0i_gg_._shape_Line_1dy0i_gg_._size_l_1dy0i_gg_{width:16px;height:4px;border-radius:3px;margin-top:9px}.___SPointShape_1dy0i_gg_._shape_Line_1dy0i_gg_._size_m_1dy0i_gg_{width:12px;height:4px;border-radius:3px;margin-top:8px}.___SPointShape_1dy0i_gg_._shape_Square_1dy0i_gg_._size_l_1dy0i_gg_{width:16px;height:16px;border-radius:2px;margin-top:4px}.___SPointShape_1dy0i_gg_._shape_Square_1dy0i_gg_._size_m_1dy0i_gg_{width:12px;height:12px;border-radius:2px;margin-top:4px}.___SIcon_1dy0i_gg_{line-height:0;margin-right:4px}.___SIcon_1dy0i_gg_._size_l_1dy0i_gg_{margin-top:4px}.___SIcon_1dy0i_gg_._size_m_1dy0i_gg_{margin-top:2px}.___SAdditionalLabel_1dy0i_gg_._size_l_1dy0i_gg_,.___SCount_1dy0i_gg_._size_l_1dy0i_gg_,.___SLabel_1dy0i_gg_._size_l_1dy0i_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SAdditionalLabel_1dy0i_gg_._size_m_1dy0i_gg_,.___SCount_1dy0i_gg_._size_m_1dy0i_gg_,.___SLabel_1dy0i_gg_._size_m_1dy0i_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SAdditionalLabel_1dy0i_gg_,.___SCount_1dy0i_gg_{margin-left:4px}.___SAdditionalLabel_1dy0i_gg_{white-space:nowrap;display:flex;align-items:flex-start}.___SAdditionalLabel_1dy0i_gg_::before{content:\"\";display:inline-block;background-color:var(--intergalactic-text-secondary, #6c6e79);height:4px;width:4px;border-radius:2px;margin-right:4px}.___SAdditionalLabel_1dy0i_gg_._size_l_1dy0i_gg_::before{margin-top:10px}.___SAdditionalLabel_1dy0i_gg_._size_m_1dy0i_gg_::before{margin-top:8px}" /*__inner_css_end__*/, "1dy0i_gg_") /*__reshadow_css_end__*/, {
|
|
26
|
+
"__SLegendItem": "___SLegendItem_1dy0i_gg_",
|
|
27
|
+
"_disabled": "__disabled_1dy0i_gg_",
|
|
28
|
+
"__SPointShape": "___SPointShape_1dy0i_gg_",
|
|
29
|
+
"_color": "__color_1dy0i_gg_",
|
|
30
|
+
"--color": "--color_1dy0i",
|
|
31
|
+
"_shape_Circle": "_shape_Circle_1dy0i_gg_",
|
|
32
|
+
"_size_l": "_size_l_1dy0i_gg_",
|
|
33
|
+
"_size_m": "_size_m_1dy0i_gg_",
|
|
34
|
+
"_shape_Line": "_shape_Line_1dy0i_gg_",
|
|
35
|
+
"_shape_Square": "_shape_Square_1dy0i_gg_",
|
|
36
|
+
"__SIcon": "___SIcon_1dy0i_gg_",
|
|
37
|
+
"__SLabel": "___SLabel_1dy0i_gg_",
|
|
38
|
+
"__SAdditionalLabel": "___SAdditionalLabel_1dy0i_gg_",
|
|
39
|
+
"__SCount": "___SCount_1dy0i_gg_"
|
|
39
40
|
});
|
|
40
41
|
var LegendItemRoot = /*#__PURE__*/function (_Component) {
|
|
41
42
|
(0, _inherits2["default"])(LegendItemRoot, _Component);
|
|
@@ -54,13 +55,14 @@ var LegendItemRoot = /*#__PURE__*/function (_Component) {
|
|
|
54
55
|
label = _this$asProps.label,
|
|
55
56
|
id = _this$asProps.id,
|
|
56
57
|
size = _this$asProps.size,
|
|
57
|
-
onClick = _this$asProps.onClick
|
|
58
|
+
onClick = _this$asProps.onClick,
|
|
59
|
+
resolveColor = _this$asProps.resolveColor;
|
|
58
60
|
return {
|
|
59
61
|
id: id,
|
|
60
62
|
label: label,
|
|
61
63
|
shape: shape,
|
|
62
64
|
checked: checked,
|
|
63
|
-
color: color,
|
|
65
|
+
color: resolveColor(color),
|
|
64
66
|
size: size,
|
|
65
67
|
onKeyUp: function onKeyUp(e) {
|
|
66
68
|
if (onClick && e.key === ' ') {
|
|
@@ -127,6 +129,7 @@ var LegendItemRoot = /*#__PURE__*/function (_Component) {
|
|
|
127
129
|
}(_core.Component);
|
|
128
130
|
(0, _defineProperty2["default"])(LegendItemRoot, "displayName", 'LegendItem');
|
|
129
131
|
(0, _defineProperty2["default"])(LegendItemRoot, "style", style);
|
|
132
|
+
(0, _defineProperty2["default"])(LegendItemRoot, "enhance", [(0, _resolveColorEnhance["default"])()]);
|
|
130
133
|
(0, _defineProperty2["default"])(LegendItemRoot, "defaultProps", function () {
|
|
131
134
|
return {
|
|
132
135
|
children: /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(LegendItemComponent.Shape, null), /*#__PURE__*/_react["default"].createElement(LegendItemComponent.Icon, null), /*#__PURE__*/_react["default"].createElement(LegendItemComponent.Label, null), /*#__PURE__*/_react["default"].createElement(LegendItemComponent.AdditionalLabel, null), /*#__PURE__*/_react["default"].createElement(LegendItemComponent.Count, null))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendItem.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_flexBox","_checkbox","_typography","_LegendItem","_excluded","style","sstyled","insert","LegendItemRoot","_Component","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","value","getShapeProps","_this$asProps","asProps","checked","color","shape","label","id","size","onClick","onKeyUp","e","getIconProps","props","_objectSpread2","children","icon","getLabelProps","_this$asProps2","_objectWithoutProperties2","getAdditionalLabelProps","additionalInfo","concat","undefined","getCountProps","count","render","_ref","_ref7","SLegendItem","Flex","_this$asProps3","styles","Children","disabled","StaticShapes","includes","createElement","cn","assignProps","Component","_defineProperty2","Fragment","LegendItemComponent","Shape","Icon","Label","AdditionalLabel","Count","_ref2","arguments[0]","_ref8","SPointShape","Box","hasChildren","theme","_ref13","_ref3","_ref9","SIcon","displayName","_ref14","_ref4","_ref10","SLabel","TypographyText","_ref15","_ref5","_ref11","SAdditionalLabel","_ref16","_ref6","_ref12","SCount","createComponent","exports"],"sources":["../../../../../src/component/ChartLegend/LegendItem/LegendItem.tsx"],"sourcesContent":["import React, { DOMAttributes } from 'react';\nimport createComponent, { Component, sstyled, Root, IRootComponentProps } from '@semcore/core';\nimport { Flex, Box } from '@semcore/flex-box';\nimport Checkbox, { CheckboxProps } from '@semcore/checkbox';\nimport { Text as TypographyText } from '@semcore/typography';\n\nimport style from './legend-item.shadow.css';\nimport {\n ShapeProps,\n LegendItemProps,\n LegendItemType,\n LegendItem,\n StaticShapes,\n} from './LegendItem.type';\n\nclass LegendItemRoot extends Component<LegendItemProps> {\n static displayName = 'LegendItem';\n static style = style;\n\n static defaultProps = () => ({\n children: (\n <>\n <LegendItemComponent.Shape />\n <LegendItemComponent.Icon />\n <LegendItemComponent.Label />\n <LegendItemComponent.AdditionalLabel />\n <LegendItemComponent.Count />\n </>\n ),\n });\n\n getShapeProps(): ShapeProps & DOMAttributes<HTMLLabelElement> {\n const { checked, color, shape, label, id, size, onClick } = this.asProps;\n\n return {\n id,\n label,\n shape,\n checked,\n color,\n size,\n onKeyUp: (e: React.KeyboardEvent<HTMLLabelElement>) => {\n if (onClick && e.key === ' ') {\n onClick();\n }\n },\n };\n }\n\n getIconProps(): LegendItem & IRootComponentProps {\n const props = this.asProps;\n\n return {\n ...props,\n children: props.icon,\n };\n }\n\n getLabelProps(): Omit<LegendItem, 'color'> & IRootComponentProps {\n const { color, ...props } = this.asProps;\n\n return {\n ...props,\n children: props.label,\n };\n }\n\n getAdditionalLabelProps(): LegendItem & IRootComponentProps {\n const props = this.asProps;\n\n const { additionalInfo } = props;\n\n return {\n ...props,\n children: additionalInfo && 'label' in additionalInfo ? `${additionalInfo.label}` : undefined,\n };\n }\n\n getCountProps(): LegendItem & IRootComponentProps {\n const props = this.asProps;\n\n const { additionalInfo } = props;\n\n return {\n ...props,\n children:\n additionalInfo && 'count' in additionalInfo ? `(${additionalInfo.count})` : undefined,\n };\n }\n\n render() {\n const SLegendItem = Root;\n const { styles, Children, shape } = this.asProps;\n\n // @ts-ignore\n const disabled = StaticShapes.includes(shape);\n\n return sstyled(styles)(\n <SLegendItem render={Flex} disabled={disabled}>\n <Children />\n </SLegendItem>,\n );\n }\n}\n\nfunction Shape(props: IRootComponentProps & ShapeProps & DOMAttributes<HTMLLabelElement>) {\n const SPointShape = Root;\n const {\n styles,\n size,\n shape,\n checked,\n color,\n Children,\n children: hasChildren,\n onKeyUp,\n label,\n } = props;\n\n if (hasChildren) {\n return <Children />;\n }\n\n if (shape === 'Checkbox') {\n return (\n <Checkbox\n size={size}\n checked={checked}\n theme={checked ? color : undefined}\n onKeyUp={onKeyUp}\n aria-label={label}\n />\n );\n }\n\n return sstyled(styles)(\n <SPointShape render={Box}>\n <Children />\n </SPointShape>,\n );\n}\n\nfunction Icon({ styles, children: hasChildren, Children }: IRootComponentProps) {\n const SIcon = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SIcon render={Box} tag={'span'}>\n <Children />\n </SIcon>,\n );\n}\nIcon.displayName = 'Icon';\n\nfunction Label({ styles, children: hasChildren, Children }: IRootComponentProps) {\n const SLabel = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SLabel render={TypographyText} use={'primary'}>\n <Children />\n </SLabel>,\n );\n}\nLabel.displayName = 'Label';\n\nfunction AdditionalLabel({ styles, children: hasChildren, Children }: IRootComponentProps) {\n const SAdditionalLabel = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SAdditionalLabel render={TypographyText} use={'secondary'}>\n <Children />\n </SAdditionalLabel>,\n );\n}\nAdditionalLabel.displayName = 'AdditionalLabel';\n\nfunction Count({ styles, children: hasChildren, Children }: IRootComponentProps) {\n const SCount = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SCount render={TypographyText} use={'secondary'}>\n <Children />\n </SCount>,\n );\n}\nCount.displayName = 'Count';\n\nexport const LegendItemComponent: LegendItemType = createComponent(LegendItemRoot, {\n Shape,\n Icon,\n Label,\n AdditionalLabel,\n Count,\n});\n"],"mappings":";;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA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,CAACY,WAAW,GAAG,OAAO;AAEpB,IAAMjB,mBAAmC,GAAG,IAAA+B,gBAAe,EAACrF,cAAc,EAAE;EACjFuD,KAAK,EAALA,KAAK;EACLC,IAAI,EAAJA,IAAI;EACJC,KAAK,EAALA,KAAK;EACLC,eAAe,EAAfA,eAAe;EACfC,KAAK,EAALA;AACF,CAAC,CAAC;AAAC2B,OAAA,CAAAhC,mBAAA,GAAAA,mBAAA"}
|
|
1
|
+
{"version":3,"file":"LegendItem.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_flexBox","_checkbox","_typography","_LegendItem","_resolveColorEnhance","_excluded","style","sstyled","insert","LegendItemRoot","_Component","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","value","getShapeProps","_this$asProps","asProps","checked","color","shape","label","id","size","onClick","resolveColor","onKeyUp","e","getIconProps","props","_objectSpread2","children","icon","getLabelProps","_this$asProps2","_objectWithoutProperties2","getAdditionalLabelProps","additionalInfo","concat","undefined","getCountProps","count","render","_ref","_ref7","SLegendItem","Flex","_this$asProps3","styles","Children","disabled","StaticShapes","includes","createElement","cn","assignProps","Component","_defineProperty2","resolveColorEnhance","Fragment","LegendItemComponent","Shape","Icon","Label","AdditionalLabel","Count","_ref2","arguments[0]","_ref8","SPointShape","Box","hasChildren","theme","_ref13","_ref3","_ref9","SIcon","displayName","_ref14","_ref4","_ref10","SLabel","TypographyText","_ref15","_ref5","_ref11","SAdditionalLabel","_ref16","_ref6","_ref12","SCount","createComponent","exports"],"sources":["../../../../../src/component/ChartLegend/LegendItem/LegendItem.tsx"],"sourcesContent":["import React, { DOMAttributes } from 'react';\nimport createComponent, { Component, sstyled, Root, IRootComponentProps } from '@semcore/core';\nimport { Flex, Box } from '@semcore/flex-box';\nimport Checkbox from '@semcore/checkbox';\nimport { Text as TypographyText } from '@semcore/typography';\n\nimport style from './legend-item.shadow.css';\nimport {\n ShapeProps,\n LegendItemProps,\n LegendItemType,\n LegendItem,\n StaticShapes,\n} from './LegendItem.type';\nimport resolveColorEnhance from '@semcore/utils/src/enhances/resolveColorEnhance';\n\nclass LegendItemRoot extends Component<\n LegendItemProps & { resolveColor: ReturnType<typeof resolveColorEnhance> }\n> {\n static displayName = 'LegendItem';\n static style = style;\n\n static enhance = [resolveColorEnhance()];\n\n static defaultProps = () => ({\n children: (\n <>\n <LegendItemComponent.Shape />\n <LegendItemComponent.Icon />\n <LegendItemComponent.Label />\n <LegendItemComponent.AdditionalLabel />\n <LegendItemComponent.Count />\n </>\n ),\n });\n\n getShapeProps(): ShapeProps & DOMAttributes<HTMLLabelElement> {\n const { checked, color, shape, label, id, size, onClick, resolveColor } = this.asProps;\n\n return {\n id,\n label,\n shape,\n checked,\n color: resolveColor(color),\n size,\n onKeyUp: (e: React.KeyboardEvent<HTMLLabelElement>) => {\n if (onClick && e.key === ' ') {\n onClick();\n }\n },\n };\n }\n\n getIconProps(): LegendItem & IRootComponentProps {\n const props = this.asProps;\n\n return {\n ...props,\n children: props.icon,\n };\n }\n\n getLabelProps(): Omit<LegendItem, 'color'> & IRootComponentProps {\n const { color, ...props } = this.asProps;\n\n return {\n ...props,\n children: props.label,\n };\n }\n\n getAdditionalLabelProps(): LegendItem & IRootComponentProps {\n const props = this.asProps;\n\n const { additionalInfo } = props;\n\n return {\n ...props,\n children: additionalInfo && 'label' in additionalInfo ? `${additionalInfo.label}` : undefined,\n };\n }\n\n getCountProps(): LegendItem & IRootComponentProps {\n const props = this.asProps;\n\n const { additionalInfo } = props;\n\n return {\n ...props,\n children:\n additionalInfo && 'count' in additionalInfo ? `(${additionalInfo.count})` : undefined,\n };\n }\n\n render() {\n const SLegendItem = Root;\n const { styles, Children, shape } = this.asProps;\n\n // @ts-ignore\n const disabled = StaticShapes.includes(shape);\n\n return sstyled(styles)(\n <SLegendItem render={Flex} disabled={disabled}>\n <Children />\n </SLegendItem>,\n );\n }\n}\n\nfunction Shape(props: IRootComponentProps & ShapeProps & DOMAttributes<HTMLLabelElement>) {\n const SPointShape = Root;\n const {\n styles,\n size,\n shape,\n checked,\n color,\n Children,\n children: hasChildren,\n onKeyUp,\n label,\n } = props;\n\n if (hasChildren) {\n return <Children />;\n }\n\n if (shape === 'Checkbox') {\n return (\n <Checkbox\n size={size}\n checked={checked}\n theme={checked ? color : undefined}\n onKeyUp={onKeyUp}\n aria-label={label}\n />\n );\n }\n\n return sstyled(styles)(\n <SPointShape render={Box}>\n <Children />\n </SPointShape>,\n );\n}\n\nfunction Icon({ styles, children: hasChildren, Children }: IRootComponentProps) {\n const SIcon = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SIcon render={Box} tag={'span'}>\n <Children />\n </SIcon>,\n );\n}\nIcon.displayName = 'Icon';\n\nfunction Label({ styles, children: hasChildren, Children }: IRootComponentProps) {\n const SLabel = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SLabel render={TypographyText} use={'primary'}>\n <Children />\n </SLabel>,\n );\n}\nLabel.displayName = 'Label';\n\nfunction AdditionalLabel({ styles, children: hasChildren, Children }: IRootComponentProps) {\n const SAdditionalLabel = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SAdditionalLabel render={TypographyText} use={'secondary'}>\n <Children />\n </SAdditionalLabel>,\n );\n}\nAdditionalLabel.displayName = 'AdditionalLabel';\n\nfunction Count({ styles, children: hasChildren, Children }: IRootComponentProps) {\n const SCount = Root;\n\n if (!hasChildren) {\n return null;\n }\n\n return sstyled(styles)(\n <SCount render={TypographyText} use={'secondary'}>\n <Children />\n </SCount>,\n );\n}\nCount.displayName = 'Count';\n\nexport const LegendItemComponent: LegendItemType = createComponent(LegendItemRoot, {\n Shape,\n Icon,\n Label,\n AdditionalLabel,\n Count,\n});\n"],"mappings":";;;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,QAAA,GA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B,cAAA,qBAAAxC,KAAA,CAAAiE,WAAA;IAAA,OAA8B;EAAW,GAAAiC,KAAA,kBAC9C/F,MAAA,YAAA4D,aAAA,CAACJ,QAAQ,EAAAwC,MAAA,CAAAnC,EAAA,iBAAG,CACL;AAEb;AACAW,KAAK,CAACY,WAAW,GAAG,OAAO;AAEpB,IAAMjB,mBAAmC,GAAG,IAAA+B,gBAAe,EAACvF,cAAc,EAAE;EACjFyD,KAAK,EAALA,KAAK;EACLC,IAAI,EAAJA,IAAI;EACJC,KAAK,EAALA,KAAK;EACLC,eAAe,EAAfA,eAAe;EACfC,KAAK,EAALA;AACF,CAAC,CAAC;AAAC2B,OAAA,CAAAhC,mBAAA,GAAAA,mBAAA"}
|
|
@@ -18,13 +18,12 @@ var _flexBox = require("@semcore/flex-box");
|
|
|
18
18
|
var _LegendItem = require("../LegendItem/LegendItem");
|
|
19
19
|
var _BaseLegend2 = require("../BaseLegend");
|
|
20
20
|
/*__reshadow-styles__:"./legend-table.shadow.css"*/
|
|
21
|
-
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
|
22
|
-
"__SLegendTable": "
|
|
23
|
-
"_columns-count": "__columns-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"_size_m": "_size_m_9p6c1_gg_"
|
|
21
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SLegendTable_16qmu_gg_.__columns-count_16qmu_gg_{font-feature-settings:\"tnum\";font-variant-numeric:tabular-nums;display:grid;grid-template-columns:auto .2fr .2fr;align-items:center;height:-moz-fit-content;height:fit-content;grid-column-gap:16px;grid-row-gap:8px}.___SColumnItem_16qmu_gg_._size_l_16qmu_gg_{font-size:var(--intergalactic-fs-300, 16px);text-align:right}.___SColumnItem_16qmu_gg_._size_m_16qmu_gg_{font-size:var(--intergalactic-fs-200, 14px);text-align:right}" /*__inner_css_end__*/, "16qmu_gg_") /*__reshadow_css_end__*/, {
|
|
22
|
+
"__SLegendTable": "___SLegendTable_16qmu_gg_",
|
|
23
|
+
"_columns-count": "__columns-count_16qmu_gg_",
|
|
24
|
+
"__SColumnItem": "___SColumnItem_16qmu_gg_",
|
|
25
|
+
"_size_l": "_size_l_16qmu_gg_",
|
|
26
|
+
"_size_m": "_size_m_16qmu_gg_"
|
|
28
27
|
});
|
|
29
28
|
var LegendTableRoot = /*#__PURE__*/function (_BaseLegend) {
|
|
30
29
|
(0, _inherits2["default"])(LegendTableRoot, _BaseLegend);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendTable.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_flexBox","_LegendItem","_BaseLegend2","style","sstyled","insert","LegendTableRoot","_BaseLegend","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","value","render","_ref","asProps","_ref3","_items$","SLegendTable","Box","_this$asProps","styles","Children","_this$asProps$size","size","items","columnsCount","columns","length","createElement","cn","_objectSpread2","assignProps","map","_ref5","index","id","_ref5$columns","Fragment","item","concat","LegendTable","Column","BaseLegend","_defineProperty2","children","LegendItem","ColumnComponent","props","_ref2","arguments[0]","_ref4","SColumnItem","gridColumnStart","gridColumnEnd","createComponent","LegendItemComponent","exports"],"sources":["../../../../../src/component/ChartLegend/LegendTable/LegendTable.tsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { sstyled, Root, IRootComponentProps } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport { LegendTableType, LegendTableProps, LegendColumnProps } from './LegendTable.type';\nimport style from './legend-table.shadow.css';\nimport { LegendItemComponent } from '../LegendItem/LegendItem';\nimport { BaseLegend } from '../BaseLegend';\n\nclass LegendTableRoot extends BaseLegend<LegendTableProps> {\n static displayName = 'LegendTable';\n static style = style;\n\n static defaultProps = () => ({\n children: <LegendTable.LegendItem />,\n });\n\n render() {\n const SLegendTable = Root;\n const { styles, Children, size = 'm', items } = this.asProps;\n const columnsCount = items[0]?.columns.length;\n\n return sstyled(styles)(\n <SLegendTable render={Box} columns-count={columnsCount + 1}>\n {items.map(({ id, columns = [] }, index) => {\n return (\n <React.Fragment key={id}>\n <Children />\n {columns.map((item, index) => {\n return (\n <React.Fragment key={`${id}__${index}`}>\n <LegendTable.Column index={index} size={size} styles={styles}>\n {item}\n </LegendTable.Column>\n </React.Fragment>\n );\n })}\n </React.Fragment>\n );\n })}\n </SLegendTable>,\n );\n }\n}\n\nfunction ColumnComponent(props: LegendColumnProps & IRootComponentProps) {\n const SColumnItem = Root;\n const { styles, index, size, Children } = props;\n\n return sstyled(styles)(\n <SColumnItem\n style={{ gridColumnStart: `${index + 2}`, gridColumnEnd: `${index + 3}` }}\n render={Box}\n size={size}\n >\n <Children />\n </SColumnItem>,\n );\n}\n\nexport const LegendTable: LegendTableType = createComponent(LegendTableRoot, {\n LegendItem: LegendItemComponent,\n Column: ColumnComponent,\n});\n"],"mappings":";;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AAGA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAA2C;AAAA,IAAAM,KAAA,+BAAAR,KAAA,CAAAS,OAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;
|
|
1
|
+
{"version":3,"file":"LegendTable.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_flexBox","_LegendItem","_BaseLegend2","style","sstyled","insert","LegendTableRoot","_BaseLegend","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","value","render","_ref","asProps","_ref3","_items$","SLegendTable","Box","_this$asProps","styles","Children","_this$asProps$size","size","items","columnsCount","columns","length","createElement","cn","_objectSpread2","assignProps","map","_ref5","index","id","_ref5$columns","Fragment","item","concat","LegendTable","Column","BaseLegend","_defineProperty2","children","LegendItem","ColumnComponent","props","_ref2","arguments[0]","_ref4","SColumnItem","gridColumnStart","gridColumnEnd","createComponent","LegendItemComponent","exports"],"sources":["../../../../../src/component/ChartLegend/LegendTable/LegendTable.tsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { sstyled, Root, IRootComponentProps } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\nimport { LegendTableType, LegendTableProps, LegendColumnProps } from './LegendTable.type';\nimport style from './legend-table.shadow.css';\nimport { LegendItemComponent } from '../LegendItem/LegendItem';\nimport { BaseLegend } from '../BaseLegend';\n\nclass LegendTableRoot extends BaseLegend<LegendTableProps> {\n static displayName = 'LegendTable';\n static style = style;\n\n static defaultProps = () => ({\n children: <LegendTable.LegendItem />,\n });\n\n render() {\n const SLegendTable = Root;\n const { styles, Children, size = 'm', items } = this.asProps;\n const columnsCount = items[0]?.columns.length;\n\n return sstyled(styles)(\n <SLegendTable render={Box} columns-count={columnsCount + 1}>\n {items.map(({ id, columns = [] }, index) => {\n return (\n <React.Fragment key={id}>\n <Children />\n {columns.map((item, index) => {\n return (\n <React.Fragment key={`${id}__${index}`}>\n <LegendTable.Column index={index} size={size} styles={styles}>\n {item}\n </LegendTable.Column>\n </React.Fragment>\n );\n })}\n </React.Fragment>\n );\n })}\n </SLegendTable>,\n );\n }\n}\n\nfunction ColumnComponent(props: LegendColumnProps & IRootComponentProps) {\n const SColumnItem = Root;\n const { styles, index, size, Children } = props;\n\n return sstyled(styles)(\n <SColumnItem\n style={{ gridColumnStart: `${index + 2}`, gridColumnEnd: `${index + 3}` }}\n render={Box}\n size={size}\n >\n <Children />\n </SColumnItem>,\n );\n}\n\nexport const LegendTable: LegendTableType = createComponent(LegendTableRoot, {\n LegendItem: LegendItemComponent,\n Column: ColumnComponent,\n});\n"],"mappings":";;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAA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,CAA/Bb,KAAK;IAAEX,IAAI,GAAewB,KAAK,CAAxBxB,IAAI;IAAEF,QAAQ,GAAK0B,KAAK,CAAlB1B,QAAQ;EAErC,OAAA6B,KAAA,GAAO,IAAAnD,aAAO,EAACqB,MAAM,CAAC,eACpB3B,MAAA,YAAAmC,aAAA,CAACuB,WAAW,EAAAD,KAAA,CAAArB,EAAA,oBAAAC,cAAA,qBAAAxC,KAAA,CAAAyC,WAAA;IAAA,SACH;MAAEqB,eAAe,KAAAb,MAAA,CAAKL,KAAK,GAAG,CAAC,CAAE;MAAEmB,aAAa,KAAAd,MAAA,CAAKL,KAAK,GAAG,CAAC;IAAG,CAAC;IAAA,QAEnEX;EAAI,GAAAyB,KAAA,kBAEVvD,MAAA,YAAAmC,aAAA,CAACP,QAAQ,EAAA6B,KAAA,CAAArB,EAAA,iBAAG,CACA;AAElB;AAEO,IAAMW,WAA4B,GAAG,IAAAc,gBAAe,EAACrD,eAAe,EAAE;EAC3E4C,UAAU,EAAEU,+BAAmB;EAC/Bd,MAAM,EAAEK;AACV,CAAC,CAAC;AAACU,OAAA,CAAAhB,WAAA,GAAAA,WAAA"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
SLegendTable[columns-count] {
|
|
2
|
+
font-variant-numeric: tabular-nums;
|
|
2
3
|
display: grid;
|
|
3
|
-
grid-template-columns:
|
|
4
|
+
grid-template-columns: auto 0.2fr 0.2fr;
|
|
4
5
|
align-items: center;
|
|
5
6
|
height: fit-content;
|
|
6
|
-
grid-column-gap:
|
|
7
|
+
grid-column-gap: 16px;
|
|
7
8
|
grid-row-gap: 8px;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
SColumnItem[size='l'] {
|
|
11
12
|
font-size: var(--intergalactic-fs-300, 16px);
|
|
13
|
+
text-align: right;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
SColumnItem[size='m'] {
|
|
15
17
|
font-size: var(--intergalactic-fs-200, 14px);
|
|
18
|
+
text-align: right;
|
|
16
19
|
}
|
package/lib/cjs/index.js
CHANGED
|
@@ -23,6 +23,12 @@ Object.defineProperty(exports, "Bubble", {
|
|
|
23
23
|
return _Bubble["default"];
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
+
Object.defineProperty(exports, "Chart", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function get() {
|
|
29
|
+
return _Chart["default"];
|
|
30
|
+
}
|
|
31
|
+
});
|
|
26
32
|
Object.defineProperty(exports, "ChartLegend", {
|
|
27
33
|
enumerable: true,
|
|
28
34
|
get: function get() {
|
|
@@ -175,6 +181,7 @@ Object.defineProperty(exports, "minMax", {
|
|
|
175
181
|
});
|
|
176
182
|
var _Plot = _interopRequireDefault(require("./Plot"));
|
|
177
183
|
var _ChartLegend = require("./component/ChartLegend");
|
|
184
|
+
var _Chart = _interopRequireDefault(require("./component/Chart"));
|
|
178
185
|
var _Axis = require("./Axis");
|
|
179
186
|
var _Line = _interopRequireDefault(require("./Line"));
|
|
180
187
|
var _Bar = _interopRequireDefault(require("./Bar"));
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_Plot","_interopRequireDefault","require","_ChartLegend","_Axis","_Line","_Bar","_HorizontalBar","_GroupBar","_StackBar","_Area","_StackedArea","_ScatterPlot","_Bubble","_RadialTree","_Donut","_Venn","_Radar","_interopRequireWildcard","_Tooltip","_ResponsiveContainer","_ReferenceLine","_Hover","_utils","_color","_hints"],"sources":["../../src/index.js"],"sourcesContent":["export { default as Plot } from './Plot';\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\nexport { XAxis, YAxis } from './Axis';\n\nexport { default as Line } from './Line';\n\nexport { default as Bar } from './Bar';\nexport { default as HorizontalBar } from './HorizontalBar';\nexport { default as GroupBar } from './GroupBar';\nexport { default as StackBar } from './StackBar';\nexport { default as Area } from './Area';\nexport { default as StackedArea } from './StackedArea';\nexport { default as ScatterPlot } from './ScatterPlot';\nexport { default as Bubble } from './Bubble';\nexport { default as RadialTree } from './RadialTree';\nexport { default as Donut } from './Donut';\nexport { default as Venn } from './Venn';\nexport { default as Radar, getLabelOffsetPosition } from './Radar';\n\nexport { default as Tooltip } from './Tooltip';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport { default as ReferenceLine } from './ReferenceLine';\n\nexport { HoverLine, HoverRect } from './Hover';\n\nexport { minMax, interpolateValue } from './utils';\nexport { colors } from './color';\n\nexport { makeDataHintsContainer } from './a11y/hints';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Plot","_interopRequireDefault","require","_ChartLegend","_Chart","_Axis","_Line","_Bar","_HorizontalBar","_GroupBar","_StackBar","_Area","_StackedArea","_ScatterPlot","_Bubble","_RadialTree","_Donut","_Venn","_Radar","_interopRequireWildcard","_Tooltip","_ResponsiveContainer","_ReferenceLine","_Hover","_utils","_color","_hints"],"sources":["../../src/index.js"],"sourcesContent":["export { default as Plot } from './Plot';\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\nexport { default as Chart } from './component/Chart';\nexport { XAxis, YAxis } from './Axis';\n\nexport { default as Line } from './Line';\n\nexport { default as Bar } from './Bar';\nexport { default as HorizontalBar } from './HorizontalBar';\nexport { default as GroupBar } from './GroupBar';\nexport { default as StackBar } from './StackBar';\nexport { default as Area } from './Area';\nexport { default as StackedArea } from './StackedArea';\nexport { default as ScatterPlot } from './ScatterPlot';\nexport { default as Bubble } from './Bubble';\nexport { default as RadialTree } from './RadialTree';\nexport { default as Donut } from './Donut';\nexport { default as Venn } from './Venn';\nexport { default as Radar, getLabelOffsetPosition } from './Radar';\n\nexport { default as Tooltip } from './Tooltip';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport { default as ReferenceLine } from './ReferenceLine';\n\nexport { HoverLine, HoverRect } from './Hover';\n\nexport { minMax, interpolateValue } from './utils';\nexport { colors } from './color';\n\nexport { makeDataHintsContainer } from './a11y/hints';\n"],"mappings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AAAwB,MAAA,GAAAxB,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Line.d.js","names":[],"sources":["../../../src/types/Line.d.ts"],"sourcesContent":["import { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport { curveCardinal, CurveFactory } from 'd3-shape';\nimport { FadeInOutProps } from '@semcore/animation';\nimport { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface ILineProps extends LineProps, UnknownProperties {}\nexport type LineProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Line color */\n color?: string;\n /** Element hide property */\n hide?: boolean;\n /** Curve method */\n curve?: CurveFactory;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Enables element transparency */\n transparent?: boolean;\n};\n\n/** @deprecated */\nexport interface ILineDotsProps extends LineDotsProps, UnknownProperties {}\nexport type LineDotsProps = Context &\n Omit<FadeInOutProps, 'display'> & {\n /** Show all Dot */\n display?: boolean;\n /** Hide property */\n hide?: boolean;\n /** Index active of element */\n activeIndex?: number;\n /** Dot radius, radius of active dot is 4/3 times larger\n * @default 6\n */\n radius?: number;\n };\n\n/** @deprecated */\nexport interface ILineDotsContext extends LineDotsContext, UnknownProperties {}\nexport type LineDotsContext = {\n /** Value element of data */\n /** @deprecated */\n value?: any;\n /** Index element of data */\n index?: number;\n};\n\n/** @deprecated */\nexport interface ILineNullProps extends LineNullProps, UnknownProperties {}\nexport type LineNullProps = Context & {\n /** Hide property */\n hide?: boolean;\n};\n\nexport type LineAreaProps = Omit<LineProps, 'transparent'> & {\n /**\n * Field name from `data` array for y0 point by the YAxis for the Area\n */\n y0: string;\n /**\n * Field name from `data` array for y1 point by the YAxis for the Area\n */\n y1: string;\n};\n\ndeclare const Line: IntergalacticD3Component<'line', LineProps, Context> & {\n Dots: IntergalacticD3Component<'circle', LineDotsProps, LineDotsContext>;\n Null: IntergalacticD3Component<'path', LineNullProps>;\n Area: IntergalacticD3Component<'path', LineAreaProps>;\n};\n\nexport default Line;\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Line.d.js","names":[],"sources":["../../../src/types/Line.d.ts"],"sourcesContent":["import { UnknownProperties } from '@semcore/core';\nimport { Context } from './context';\nimport { curveCardinal, CurveFactory } from 'd3-shape';\nimport { FadeInOutProps } from '@semcore/animation';\nimport { IntergalacticD3Component } from './Plot';\n\n/** @deprecated */\nexport interface ILineProps extends LineProps, UnknownProperties {}\nexport type LineProps = Context & {\n /** Field name from `data` array item for the XAxis */\n x?: string;\n /** Field name from `data` array item for the YAxis */\n y?: string;\n /** Line color */\n color?: string;\n /** Element hide property */\n hide?: boolean;\n /** Curve method */\n curve?: CurveFactory;\n /** Animation duration in ms\n * @default 500\n */\n duration?: number;\n /** Enables element transparency */\n transparent?: boolean;\n};\n\n/** @deprecated */\nexport interface ILineDotsProps extends LineDotsProps, UnknownProperties {}\nexport type LineDotsProps = Context &\n Omit<FadeInOutProps, 'display'> & {\n /** Show all Dot */\n display?: boolean;\n /** Hide property */\n hide?: boolean;\n /** Index active of element */\n activeIndex?: number;\n /** Dot radius, radius of active dot is 4/3 times larger\n * @default 6\n */\n radius?: number;\n };\n\n/** @deprecated */\nexport interface ILineDotsContext extends LineDotsContext, UnknownProperties {}\nexport type LineDotsContext = {\n /** Value element of data */\n /** @deprecated */\n value?: any;\n /** Index element of data */\n index?: number;\n};\n\n/** @deprecated */\nexport interface ILineNullProps extends LineNullProps, UnknownProperties {}\nexport type LineNullProps = Context & {\n /** Hide property */\n hide?: boolean;\n};\n\nexport type LineAreaProps = Omit<LineProps, 'transparent'> & {\n /**\n * Field name from `data` (or from `area`, if passed) array for y0 point by the YAxis for the Area\n */\n y0: string;\n /**\n * Field name from `data` (or from `area`, if passed) array for y1 point by the YAxis for the Area\n */\n y1: string;\n\n /**\n * Optional data for render area\n */\n area?: Array<{ [key: string]: number }>;\n};\n\ndeclare const Line: IntergalacticD3Component<'line', LineProps, Context> & {\n Dots: IntergalacticD3Component<'circle', LineDotsProps, LineDotsContext>;\n Null: IntergalacticD3Component<'path', LineNullProps>;\n Area: IntergalacticD3Component<'path', LineAreaProps>;\n};\n\nexport default Line;\n"],"mappings":""}
|