@semcore/d3-chart 16.4.2 → 16.5.0-prerelease.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 +12 -0
- package/README.md +4 -4
- package/lib/cjs/Area.js +11 -11
- package/lib/cjs/Axis.js +15 -15
- package/lib/cjs/Bar.js +16 -16
- package/lib/cjs/Bubble.js +15 -15
- package/lib/cjs/Bubble.js.map +1 -1
- package/lib/cjs/CompactHorizontalBar.js +21 -19
- package/lib/cjs/CompactHorizontalBar.js.map +1 -1
- package/lib/cjs/Donut.js +12 -11
- package/lib/cjs/Donut.js.map +1 -1
- package/lib/cjs/Dots.js +8 -8
- package/lib/cjs/HorizontalBar.js +16 -16
- package/lib/cjs/Hover.js +7 -7
- package/lib/cjs/Hover.js.map +1 -1
- package/lib/cjs/Line.js +9 -9
- package/lib/cjs/Plot.js +3 -3
- package/lib/cjs/Radar.js +21 -21
- package/lib/cjs/Radar.js.map +1 -1
- package/lib/cjs/RadialTree.js +24 -24
- package/lib/cjs/RadialTree.js.map +1 -1
- package/lib/cjs/Reference.js +12 -12
- package/lib/cjs/ScatterPlot.js +12 -11
- package/lib/cjs/ScatterPlot.js.map +1 -1
- package/lib/cjs/Tooltip.js +9 -9
- package/lib/cjs/Venn.js +12 -11
- package/lib/cjs/Venn.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yModule.js +5 -5
- package/lib/cjs/a11y/PlotA11yModule.js.map +1 -1
- package/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/lib/cjs/component/Chart/AbstractChart.js +119 -35
- package/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/lib/cjs/component/Chart/AreaChart.js +5 -29
- package/lib/cjs/component/Chart/AreaChart.js.map +1 -1
- package/lib/cjs/component/Chart/BarChart.js +5 -29
- package/lib/cjs/component/Chart/BarChart.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.js +0 -4
- package/lib/cjs/component/Chart/BubbleChart.js.map +1 -1
- package/lib/cjs/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.js +96 -59
- package/lib/cjs/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/cjs/component/Chart/CigaretteChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.js +1 -6
- package/lib/cjs/component/Chart/DonutChart.js.map +1 -1
- package/lib/cjs/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/HistogramChart.js +4 -28
- package/lib/cjs/component/Chart/HistogramChart.js.map +1 -1
- package/lib/cjs/component/Chart/LineChart.js +5 -29
- package/lib/cjs/component/Chart/LineChart.js.map +1 -1
- package/lib/cjs/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.js +1 -5
- package/lib/cjs/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/cjs/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.js +0 -4
- package/lib/cjs/component/Chart/VennChart.js.map +1 -1
- package/lib/cjs/component/Chart/VennChart.type.js.map +1 -1
- package/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/lib/cjs/style/abstract-chart.shadow.css +12 -0
- package/lib/es6/Area.js +11 -11
- package/lib/es6/Axis.js +15 -15
- package/lib/es6/Bar.js +16 -16
- package/lib/es6/Bubble.js +15 -15
- package/lib/es6/Bubble.js.map +1 -1
- package/lib/es6/CompactHorizontalBar.js +21 -19
- package/lib/es6/CompactHorizontalBar.js.map +1 -1
- package/lib/es6/Donut.js +12 -11
- package/lib/es6/Donut.js.map +1 -1
- package/lib/es6/Dots.js +8 -8
- package/lib/es6/HorizontalBar.js +16 -16
- package/lib/es6/Hover.js +7 -7
- package/lib/es6/Hover.js.map +1 -1
- package/lib/es6/Line.js +9 -9
- package/lib/es6/Plot.js +3 -3
- package/lib/es6/Radar.js +21 -21
- package/lib/es6/Radar.js.map +1 -1
- package/lib/es6/RadialTree.js +24 -24
- package/lib/es6/RadialTree.js.map +1 -1
- package/lib/es6/Reference.js +12 -12
- package/lib/es6/ScatterPlot.js +12 -11
- package/lib/es6/ScatterPlot.js.map +1 -1
- package/lib/es6/Tooltip.js +9 -9
- package/lib/es6/Venn.js +12 -11
- package/lib/es6/Venn.js.map +1 -1
- package/lib/es6/a11y/PlotA11yModule.js +4 -4
- package/lib/es6/a11y/PlotA11yModule.js.map +1 -1
- package/lib/es6/a11y/PlotA11yView.js +2 -2
- package/lib/es6/component/Chart/AbstractChart.js +119 -31
- package/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/lib/es6/component/Chart/AreaChart.js +5 -29
- package/lib/es6/component/Chart/AreaChart.js.map +1 -1
- package/lib/es6/component/Chart/BarChart.js +5 -29
- package/lib/es6/component/Chart/BarChart.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.js +0 -4
- package/lib/es6/component/Chart/BubbleChart.js.map +1 -1
- package/lib/es6/component/Chart/BubbleChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.js +100 -61
- package/lib/es6/component/Chart/CigaretteChart.js.map +1 -1
- package/lib/es6/component/Chart/CigaretteChart.type.js.map +1 -1
- package/lib/es6/component/Chart/CompactHorizontalBarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.js +1 -6
- package/lib/es6/component/Chart/DonutChart.js.map +1 -1
- package/lib/es6/component/Chart/DonutChart.type.js.map +1 -1
- package/lib/es6/component/Chart/HistogramChart.js +4 -28
- package/lib/es6/component/Chart/HistogramChart.js.map +1 -1
- package/lib/es6/component/Chart/LineChart.js +5 -29
- package/lib/es6/component/Chart/LineChart.js.map +1 -1
- package/lib/es6/component/Chart/RadarChart.type.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.js +1 -5
- package/lib/es6/component/Chart/ScatterPlotChart.js.map +1 -1
- package/lib/es6/component/Chart/ScatterPlotChart.type.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.js +0 -4
- package/lib/es6/component/Chart/VennChart.js.map +1 -1
- package/lib/es6/component/Chart/VennChart.type.js.map +1 -1
- package/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +17 -17
- package/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/lib/es6/style/abstract-chart.shadow.css +12 -0
- package/lib/esm/Area.mjs +12 -12
- package/lib/esm/Axis.mjs +16 -16
- package/lib/esm/Bar.mjs +17 -17
- package/lib/esm/Bubble.mjs +16 -16
- package/lib/esm/CompactHorizontalBar.mjs +21 -20
- package/lib/esm/Donut.mjs +12 -12
- package/lib/esm/Dots.mjs +9 -9
- package/lib/esm/HorizontalBar.mjs +17 -17
- package/lib/esm/Hover.mjs +8 -8
- package/lib/esm/Line.mjs +10 -10
- package/lib/esm/Plot.mjs +4 -4
- package/lib/esm/Radar.mjs +22 -22
- package/lib/esm/RadialTree.mjs +27 -27
- package/lib/esm/Reference.mjs +13 -13
- package/lib/esm/ScatterPlot.mjs +12 -12
- package/lib/esm/Tooltip.mjs +10 -10
- package/lib/esm/Venn.mjs +12 -12
- package/lib/esm/a11y/PlotA11yModule.mjs +5 -5
- package/lib/esm/a11y/PlotA11yView.mjs +3 -3
- package/lib/esm/component/Chart/AbstractChart.mjs +103 -19
- package/lib/esm/component/Chart/AreaChart.mjs +5 -27
- package/lib/esm/component/Chart/BarChart.mjs +6 -28
- package/lib/esm/component/Chart/BubbleChart.mjs +0 -4
- package/lib/esm/component/Chart/CigaretteChart.mjs +78 -45
- package/lib/esm/component/Chart/DonutChart.mjs +1 -4
- package/lib/esm/component/Chart/HistogramChart.mjs +5 -27
- package/lib/esm/component/Chart/LineChart.mjs +5 -27
- package/lib/esm/component/Chart/ScatterPlotChart.mjs +1 -4
- package/lib/esm/component/Chart/VennChart.mjs +0 -4
- package/lib/esm/component/ChartLegend/LegendFlex/LegendFlex.mjs +5 -5
- package/lib/esm/component/ChartLegend/LegendItem/LegendItem.mjs +18 -18
- package/lib/esm/component/ChartLegend/LegendTable/LegendTable.mjs +7 -7
- package/lib/esm/style/abstract-chart.shadow.css +12 -0
- package/lib/types/a11y/PlotA11yModule.d.ts +1 -1
- package/lib/types/component/Chart/AbstractChart.d.ts +11 -1
- package/lib/types/component/Chart/BubbleChart.type.d.ts +1 -1
- package/lib/types/component/Chart/CigaretteChart.type.d.ts +2 -0
- package/lib/types/component/Chart/CompactHorizontalBarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/DonutChart.type.d.ts +1 -1
- package/lib/types/component/Chart/RadarChart.type.d.ts +1 -1
- package/lib/types/component/Chart/ScatterPlotChart.type.d.ts +1 -1
- package/lib/types/component/Chart/VennChart.type.d.ts +1 -1
- package/package.json +5 -5
|
@@ -11,14 +11,14 @@ import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
|
11
11
|
import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
12
12
|
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
13
13
|
import Divider from "@semcore/divider";
|
|
14
|
-
import {
|
|
14
|
+
import { Box, Flex } from "@semcore/flex-box";
|
|
15
15
|
import { Text } from "@semcore/typography";
|
|
16
16
|
import { scaleBand, scaleLinear } from "d3-scale";
|
|
17
17
|
import React from "react";
|
|
18
18
|
import Plot from "../../Plot.mjs";
|
|
19
19
|
import { HoverRect } from "../../Hover.mjs";
|
|
20
20
|
import { interpolateValue, scaleToBand } from "../../utils.mjs";
|
|
21
|
-
import { AbstractChart } from "./AbstractChart.mjs";
|
|
21
|
+
import { NOT_A_VALUE, AbstractChart } from "./AbstractChart.mjs";
|
|
22
22
|
import AnimatedClipPath from "../../AnimatedClipPath.mjs";
|
|
23
23
|
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
24
24
|
import Cigarette from "../Cigarette/Cigarette.mjs";
|
|
@@ -121,9 +121,10 @@ var CigaretteChartComponent = /* @__PURE__ */ (function(_AbstractChart) {
|
|
|
121
121
|
}, {
|
|
122
122
|
key: "renderTooltip",
|
|
123
123
|
value: function renderTooltip() {
|
|
124
|
-
var _this3 = this;
|
|
125
|
-
var _this$asProps2 = this.asProps, data = _this$asProps2.data,
|
|
124
|
+
var _ref = this.asProps, _this3 = this;
|
|
125
|
+
var _this$asProps2 = this.asProps, data = _this$asProps2.data, invertAxis = _this$asProps2.invertAxis, tooltipTitle = _this$asProps2.tooltipTitle, tooltipViewType = _this$asProps2.tooltipViewType, showPercentValueInTooltip = _this$asProps2.showPercentValueInTooltip, styles = _this$asProps2.styles, showTooltip = _this$asProps2.showTooltip;
|
|
126
126
|
var dataDefinitions = this.state.dataDefinitions;
|
|
127
|
+
var STooltipChildrenWrapper = Box;
|
|
127
128
|
if (!showTooltip) {
|
|
128
129
|
return null;
|
|
129
130
|
}
|
|
@@ -133,9 +134,11 @@ var CigaretteChartComponent = /* @__PURE__ */ (function(_AbstractChart) {
|
|
|
133
134
|
wMin: 100,
|
|
134
135
|
hideHoverLine: true
|
|
135
136
|
}, function(tooltipProps) {
|
|
137
|
+
var _ref4;
|
|
136
138
|
var dataKey = invertAxis ? tooltipProps.xIndex : tooltipProps.yIndex;
|
|
137
|
-
var
|
|
139
|
+
var showPercentColumn = showPercentValueInTooltip && _this3.totalValue(data) !== 0;
|
|
138
140
|
if (tooltipViewType === "single") {
|
|
141
|
+
var _ref3;
|
|
139
142
|
var item = dataDefinitions.find(function(dataDefItem) {
|
|
140
143
|
return dataDefItem.id === dataKey;
|
|
141
144
|
});
|
|
@@ -143,42 +146,71 @@ var CigaretteChartComponent = /* @__PURE__ */ (function(_AbstractChart) {
|
|
|
143
146
|
return null;
|
|
144
147
|
}
|
|
145
148
|
return {
|
|
146
|
-
children: /* @__PURE__ */ React.createElement(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}, /* @__PURE__ */ React.createElement(HoverRect.Tooltip.Dot, {
|
|
150
|
-
mr:
|
|
149
|
+
children: (_ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(STooltipChildrenWrapper, _ref3.cn("STooltipChildrenWrapper", _objectSpread({}, assignProps({
|
|
150
|
+
"columnsCount": showPercentColumn ? "3" : "2",
|
|
151
|
+
"__excludeProps": ["data"]
|
|
152
|
+
}, _ref))), /* @__PURE__ */ React.createElement(HoverRect.Tooltip.Dot, {
|
|
153
|
+
mr: 2,
|
|
151
154
|
color: item.color
|
|
152
|
-
}, item.label), /* @__PURE__ */ React.createElement(Text, {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
+
}, item.label), showPercentColumn && /* @__PURE__ */ React.createElement(Text, _ref3.cn("Text", {
|
|
156
|
+
"textAlign": "end",
|
|
157
|
+
"color": "text-secondary"
|
|
158
|
+
}), _this3.percentValue(data, item.id)), /* @__PURE__ */ React.createElement(Text, _ref3.cn("Text", {
|
|
159
|
+
"textAlign": "end",
|
|
160
|
+
"bold": true
|
|
161
|
+
}), _this3.tooltipValueFormatter(data[item.id]))))
|
|
155
162
|
};
|
|
156
163
|
}
|
|
157
164
|
return {
|
|
158
|
-
children:
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
+
children: (_ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(Flex, _ref4.cn("Flex", {
|
|
166
|
+
"direction": "column"
|
|
167
|
+
}), tooltipTitle && /* @__PURE__ */ React.createElement(HoverRect.Tooltip.Title, null, "Some tooltip title"), /* @__PURE__ */ React.createElement(STooltipChildrenWrapper, _ref4.cn("STooltipChildrenWrapper", _objectSpread({}, assignProps({
|
|
168
|
+
"columnsCount": showPercentColumn ? "3" : "2",
|
|
169
|
+
"__excludeProps": ["data"]
|
|
170
|
+
}, _ref))), dataDefinitions.map(function(item2) {
|
|
171
|
+
var style = {
|
|
172
|
+
opacity: item2.id === dataKey ? 1 : 0.3
|
|
173
|
+
};
|
|
174
|
+
return item2.checked && /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
175
|
+
key: item2.id
|
|
165
176
|
}, /* @__PURE__ */ React.createElement(HoverRect.Tooltip.Dot, {
|
|
166
|
-
mr:
|
|
167
|
-
color: item2.color
|
|
168
|
-
|
|
169
|
-
|
|
177
|
+
mr: 2,
|
|
178
|
+
color: item2.color,
|
|
179
|
+
style
|
|
180
|
+
}, item2.label), showPercentColumn && /* @__PURE__ */ React.createElement(Text, {
|
|
181
|
+
textAlign: "end",
|
|
182
|
+
color: "text-secondary",
|
|
183
|
+
style
|
|
184
|
+
}, _this3.percentValue(data, item2.id)), /* @__PURE__ */ React.createElement(Text, {
|
|
185
|
+
textAlign: "end",
|
|
186
|
+
bold: true,
|
|
187
|
+
style
|
|
170
188
|
}, _this3.tooltipValueFormatter(data[item2.id])));
|
|
171
|
-
}),
|
|
172
|
-
mt: 2,
|
|
173
|
-
justifyContent: "space-between"
|
|
174
|
-
}, /* @__PURE__ */ React.createElement(Box, {
|
|
175
|
-
mr: 4
|
|
176
|
-
}, "Total"), /* @__PURE__ */ React.createElement(Text, {
|
|
177
|
-
bold: true
|
|
178
|
-
}, total)))
|
|
189
|
+
}), _this3.renderTooltipTotalLine(data))))
|
|
179
190
|
};
|
|
180
191
|
});
|
|
181
192
|
}
|
|
193
|
+
}, {
|
|
194
|
+
key: "renderTooltipTotalLine",
|
|
195
|
+
value: function renderTooltipTotalLine(dataItem) {
|
|
196
|
+
var _this$asProps3 = this.asProps, showTotalInTooltip = _this$asProps3.showTotalInTooltip, showPercentValueInTooltip = _this$asProps3.showPercentValueInTooltip;
|
|
197
|
+
if (!showTotalInTooltip) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
var total = this.totalValue(dataItem);
|
|
201
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, {
|
|
202
|
+
mt: 2,
|
|
203
|
+
mr: 2
|
|
204
|
+
}, "Total"), showPercentValueInTooltip && total !== 0 && /* @__PURE__ */ React.createElement(Text, {
|
|
205
|
+
mt: 2,
|
|
206
|
+
textAlign: "end",
|
|
207
|
+
color: "text-secondary"
|
|
208
|
+
}, Number.isNaN(total) ? NOT_A_VALUE : "100%"), /* @__PURE__ */ React.createElement(Text, {
|
|
209
|
+
mt: 2,
|
|
210
|
+
textAlign: "end",
|
|
211
|
+
bold: true
|
|
212
|
+
}, Number.isNaN(total) ? NOT_A_VALUE : total));
|
|
213
|
+
}
|
|
182
214
|
}, {
|
|
183
215
|
key: "renderHeader",
|
|
184
216
|
value: function renderHeader() {
|
|
@@ -188,19 +220,19 @@ var CigaretteChartComponent = /* @__PURE__ */ (function(_AbstractChart) {
|
|
|
188
220
|
}, {
|
|
189
221
|
key: "render",
|
|
190
222
|
value: function render() {
|
|
191
|
-
var
|
|
223
|
+
var _ref2 = this.asProps, _ref6;
|
|
192
224
|
var SChart = Flex;
|
|
193
|
-
var _this$
|
|
225
|
+
var _this$asProps4 = this.asProps, styles = _this$asProps4.styles, plotWidth = _this$asProps4.plotWidth, plotHeight = _this$asProps4.plotHeight, data = _this$asProps4.data, patterns = _this$asProps4.patterns, invertAxis = _this$asProps4.invertAxis, a11yAltTextConfig = _this$asProps4.a11yAltTextConfig;
|
|
194
226
|
var header = this.renderHeader();
|
|
195
227
|
if (invertAxis) {
|
|
196
|
-
var
|
|
197
|
-
return
|
|
228
|
+
var _ref5;
|
|
229
|
+
return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SChart, _ref5.cn("SChart", _objectSpread({}, assignProps({
|
|
198
230
|
"gap": 6,
|
|
199
231
|
"direction": "column",
|
|
200
232
|
"__excludeProps": ["onClick", "data"]
|
|
201
|
-
},
|
|
233
|
+
}, _ref2))), /* @__PURE__ */ React.createElement(Flex, _ref5.cn("Flex", {
|
|
202
234
|
"direction": "column"
|
|
203
|
-
}), header, /* @__PURE__ */ React.createElement(Plot,
|
|
235
|
+
}), header, /* @__PURE__ */ React.createElement(Plot, _ref5.cn("Plot", {
|
|
204
236
|
"data": data,
|
|
205
237
|
"scale": [this.xScale, this.yScale],
|
|
206
238
|
"width": plotWidth,
|
|
@@ -210,10 +242,10 @@ var CigaretteChartComponent = /* @__PURE__ */ (function(_AbstractChart) {
|
|
|
210
242
|
"a11yAltTextConfig": a11yAltTextConfig
|
|
211
243
|
}), this.renderTooltip(), this.renderChart())), this.renderLegend());
|
|
212
244
|
}
|
|
213
|
-
return
|
|
245
|
+
return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SChart, _ref6.cn("SChart", _objectSpread({}, assignProps({
|
|
214
246
|
"gap": 6,
|
|
215
247
|
"__excludeProps": ["onClick", "data"]
|
|
216
|
-
},
|
|
248
|
+
}, _ref2))), /* @__PURE__ */ React.createElement(Plot, _ref6.cn("Plot", {
|
|
217
249
|
"data": data,
|
|
218
250
|
"scale": [this.xScale, this.yScale],
|
|
219
251
|
"width": plotWidth,
|
|
@@ -221,10 +253,10 @@ var CigaretteChartComponent = /* @__PURE__ */ (function(_AbstractChart) {
|
|
|
221
253
|
"dataHints": this.dataHints,
|
|
222
254
|
"patterns": patterns,
|
|
223
255
|
"a11yAltTextConfig": a11yAltTextConfig
|
|
224
|
-
}), this.renderTooltip(), this.renderChart()), /* @__PURE__ */ React.createElement(Flex,
|
|
256
|
+
}), this.renderTooltip(), this.renderChart()), /* @__PURE__ */ React.createElement(Flex, _ref6.cn("Flex", {
|
|
225
257
|
"direction": "column",
|
|
226
258
|
"gap": 2
|
|
227
|
-
}), header && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box,
|
|
259
|
+
}), header && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Box, _ref6.cn("Box", {}), header), /* @__PURE__ */ React.createElement(Divider, _ref6.cn("Divider", {}))), this.renderLegend()));
|
|
228
260
|
}
|
|
229
261
|
}, {
|
|
230
262
|
key: "getLegendAriaLabel",
|
|
@@ -250,14 +282,14 @@ var CigaretteChartComponent = /* @__PURE__ */ (function(_AbstractChart) {
|
|
|
250
282
|
}, {
|
|
251
283
|
key: "categoryScale",
|
|
252
284
|
get: function get() {
|
|
253
|
-
var _this$
|
|
285
|
+
var _this$asProps5 = this.asProps, plotWidth = _this$asProps5.plotWidth, plotHeight = _this$asProps5.plotHeight, invertAxis = _this$asProps5.invertAxis;
|
|
254
286
|
var range = invertAxis ? [plotHeight, 0] : [0, plotWidth];
|
|
255
287
|
return scaleBand([0], range);
|
|
256
288
|
}
|
|
257
289
|
}, {
|
|
258
290
|
key: "valueScale",
|
|
259
291
|
get: function get() {
|
|
260
|
-
var _this$
|
|
292
|
+
var _this$asProps6 = this.asProps, plotWidth = _this$asProps6.plotWidth, plotHeight = _this$asProps6.plotHeight, invertAxis = _this$asProps6.invertAxis;
|
|
261
293
|
var max = 0;
|
|
262
294
|
this.selectedData.forEach(function(value) {
|
|
263
295
|
max = max + value;
|
|
@@ -280,7 +312,8 @@ _defineProperty(CigaretteChartComponent, "defaultProps", function(props) {
|
|
|
280
312
|
marginY: 0,
|
|
281
313
|
duration: 500,
|
|
282
314
|
plotWidth: !invertAxis && !props.plotWidth ? 44 : props.plotWidth,
|
|
283
|
-
plotHeight: invertAxis && !props.plotHeight ? 28 : props.plotHeight
|
|
315
|
+
plotHeight: invertAxis && !props.plotHeight ? 28 : props.plotHeight,
|
|
316
|
+
showPercentValueInTooltip: false
|
|
284
317
|
};
|
|
285
318
|
});
|
|
286
319
|
_defineProperty(CigaretteChartComponent, "enhance", [resolveColorEnhance(), uniqueIDEnhancement(), i18nEnhance(localizedMessages)]);
|
|
@@ -69,11 +69,8 @@ var DonutChartComponent = /* @__PURE__ */ (function(_AbstractChart) {
|
|
|
69
69
|
key: "renderTooltip",
|
|
70
70
|
value: function renderTooltip() {
|
|
71
71
|
var _this = this;
|
|
72
|
-
var
|
|
72
|
+
var data = this.asProps.data;
|
|
73
73
|
var dataDefinitions = this.state.dataDefinitions;
|
|
74
|
-
if (!showTooltip) {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
74
|
return /* @__PURE__ */ React.createElement(Donut.Tooltip, null, function(_ref) {
|
|
78
75
|
var dataKey = _ref.dataKey;
|
|
79
76
|
var title = dataDefinitions.find(function(item) {
|
|
@@ -8,8 +8,6 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
9
|
import { createComponent } from "@semcore/core";
|
|
10
10
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
11
|
-
import { Flex, Box } from "@semcore/flex-box";
|
|
12
|
-
import { Text } from "@semcore/typography";
|
|
13
11
|
import { scaleTime, scaleBand, scaleLinear } from "d3-scale";
|
|
14
12
|
import React from "react";
|
|
15
13
|
import Bar from "../../Bar.mjs";
|
|
@@ -109,40 +107,20 @@ var HistogramChartComponent = /* @__PURE__ */ (function(_AbstractChart) {
|
|
|
109
107
|
key: "renderTooltip",
|
|
110
108
|
value: function renderTooltip() {
|
|
111
109
|
var _this = this;
|
|
112
|
-
var _this$asProps4 = this.asProps, data = _this$asProps4.data, groupKey = _this$asProps4.groupKey,
|
|
113
|
-
var dataDefinitions = this.state.dataDefinitions;
|
|
114
|
-
if (!showTooltip) {
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
110
|
+
var _this$asProps4 = this.asProps, data = _this$asProps4.data, groupKey = _this$asProps4.groupKey, invertAxis = _this$asProps4.invertAxis;
|
|
117
111
|
return /* @__PURE__ */ React.createElement(HoverRect.Tooltip, {
|
|
118
112
|
x: invertAxis ? void 0 : groupKey,
|
|
119
113
|
y: invertAxis ? groupKey : void 0,
|
|
120
114
|
wMin: 100
|
|
121
115
|
}, function(_ref) {
|
|
122
|
-
var _dataItem$groupKey;
|
|
123
116
|
var xIndex = _ref.xIndex, yIndex = _ref.yIndex;
|
|
124
117
|
var index = invertAxis ? yIndex : xIndex;
|
|
125
118
|
var dataItem = data[index];
|
|
126
|
-
var total = _this.totalValue(dataItem);
|
|
127
119
|
return {
|
|
128
|
-
children:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}, /* @__PURE__ */ React.createElement(HoverRect.Tooltip.Dot, {
|
|
133
|
-
mr: 4,
|
|
134
|
-
color: item.color
|
|
135
|
-
}, item.label), /* @__PURE__ */ React.createElement(Text, {
|
|
136
|
-
bold: true
|
|
137
|
-
}, _this.tooltipValueFormatter(dataItem[item.id])));
|
|
138
|
-
}), showTotalInTooltip === true && /* @__PURE__ */ React.createElement(Flex, {
|
|
139
|
-
mt: 2,
|
|
140
|
-
justifyContent: "space-between"
|
|
141
|
-
}, /* @__PURE__ */ React.createElement(Box, {
|
|
142
|
-
mr: 4
|
|
143
|
-
}, "Total"), /* @__PURE__ */ React.createElement(Text, {
|
|
144
|
-
bold: true
|
|
145
|
-
}, total)))
|
|
120
|
+
children: _this.getTooltipChildren({
|
|
121
|
+
Tooltip: HoverRect.Tooltip,
|
|
122
|
+
dataItem
|
|
123
|
+
})
|
|
146
124
|
};
|
|
147
125
|
});
|
|
148
126
|
}
|
|
@@ -7,8 +7,6 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
8
|
import { createComponent } from "@semcore/core";
|
|
9
9
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
10
|
-
import { Flex, Box } from "@semcore/flex-box";
|
|
11
|
-
import { Text } from "@semcore/typography";
|
|
12
10
|
import { scaleTime, scaleLinear } from "d3-scale";
|
|
13
11
|
import React from "react";
|
|
14
12
|
import Line from "../../Line.mjs";
|
|
@@ -77,38 +75,18 @@ var LineChartComponent = /* @__PURE__ */ (function(_AbstractChart) {
|
|
|
77
75
|
key: "renderTooltip",
|
|
78
76
|
value: function renderTooltip() {
|
|
79
77
|
var _this = this;
|
|
80
|
-
var _this$asProps4 = this.asProps, data = _this$asProps4.data, groupKey = _this$asProps4.groupKey
|
|
81
|
-
var dataDefinitions = this.state.dataDefinitions;
|
|
82
|
-
if (!showTooltip) {
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
78
|
+
var _this$asProps4 = this.asProps, data = _this$asProps4.data, groupKey = _this$asProps4.groupKey;
|
|
85
79
|
return /* @__PURE__ */ React.createElement(HoverLine.Tooltip, {
|
|
86
80
|
x: groupKey,
|
|
87
81
|
wMin: 100
|
|
88
82
|
}, function(_ref) {
|
|
89
|
-
var _dataItem$groupKey;
|
|
90
83
|
var xIndex = _ref.xIndex;
|
|
91
84
|
var dataItem = data[xIndex];
|
|
92
|
-
var total = _this.totalValue(dataItem);
|
|
93
85
|
return {
|
|
94
|
-
children:
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}, /* @__PURE__ */ React.createElement(HoverLine.Tooltip.Dot, {
|
|
99
|
-
mr: 4,
|
|
100
|
-
color: item.color
|
|
101
|
-
}, item.label), /* @__PURE__ */ React.createElement(Text, {
|
|
102
|
-
bold: true
|
|
103
|
-
}, _this.tooltipValueFormatter(dataItem[item.id])));
|
|
104
|
-
}), showTotalInTooltip === true && /* @__PURE__ */ React.createElement(Flex, {
|
|
105
|
-
mt: 2,
|
|
106
|
-
justifyContent: "space-between"
|
|
107
|
-
}, /* @__PURE__ */ React.createElement(Box, {
|
|
108
|
-
mr: 4
|
|
109
|
-
}, "Total"), /* @__PURE__ */ React.createElement(Text, {
|
|
110
|
-
bold: true
|
|
111
|
-
}, total)))
|
|
86
|
+
children: _this.getTooltipChildren({
|
|
87
|
+
Tooltip: HoverLine.Tooltip,
|
|
88
|
+
dataItem
|
|
89
|
+
})
|
|
112
90
|
};
|
|
113
91
|
});
|
|
114
92
|
}
|
|
@@ -92,11 +92,8 @@ var ScatterPlotChartComponent = /* @__PURE__ */ (function(_AbstractChart) {
|
|
|
92
92
|
key: "renderTooltip",
|
|
93
93
|
value: function renderTooltip() {
|
|
94
94
|
var _this = this;
|
|
95
|
-
var _this$asProps5 = this.asProps, data = _this$asProps5.data, groupKey = _this$asProps5.groupKey
|
|
95
|
+
var _this$asProps5 = this.asProps, data = _this$asProps5.data, groupKey = _this$asProps5.groupKey;
|
|
96
96
|
var dataDefinitions = this.state.dataDefinitions;
|
|
97
|
-
if (!showTooltip) {
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
100
97
|
return dataDefinitions.filter(function(item) {
|
|
101
98
|
return item.checked;
|
|
102
99
|
}).map(function(item) {
|
|
@@ -105,10 +105,6 @@ var VennChartComponent = /* @__PURE__ */ (function(_AbstractChart) {
|
|
|
105
105
|
}, {
|
|
106
106
|
key: "renderTooltip",
|
|
107
107
|
value: function renderTooltip() {
|
|
108
|
-
var showTooltip = this.asProps.showTooltip;
|
|
109
|
-
if (!showTooltip) {
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
112
108
|
return /* @__PURE__ */ React.createElement(Venn.Tooltip, null, function(_ref) {
|
|
113
109
|
var name = _ref.name, dataKey = _ref.dataKey, data = _ref.data;
|
|
114
110
|
return {
|
|
@@ -18,14 +18,14 @@ var style = (
|
|
|
18
18
|
/*__reshadow_css_start__*/
|
|
19
19
|
(sstyled.insert(
|
|
20
20
|
/*__inner_css_start__*/
|
|
21
|
-
".
|
|
21
|
+
".___SLegendFlex_qzq5k_gg_._direction_row_qzq5k_gg_{align-items:flex-start;align-content:flex-start;flex-wrap:wrap;gap:8px 16px}.___SLegendFlex_qzq5k_gg_._direction_column_qzq5k_gg_{align-items:flex-start;flex-wrap:wrap;gap:8px}",
|
|
22
22
|
/*__inner_css_end__*/
|
|
23
|
-
"
|
|
23
|
+
"qzq5k_gg_"
|
|
24
24
|
), /*__reshadow_css_end__*/
|
|
25
25
|
{
|
|
26
|
-
"__SLegendFlex": "
|
|
27
|
-
"_direction_row": "
|
|
28
|
-
"_direction_column": "
|
|
26
|
+
"__SLegendFlex": "___SLegendFlex_qzq5k_gg_",
|
|
27
|
+
"_direction_row": "_direction_row_qzq5k_gg_",
|
|
28
|
+
"_direction_column": "_direction_column_qzq5k_gg_"
|
|
29
29
|
})
|
|
30
30
|
);
|
|
31
31
|
var LegendFlexRoot = /* @__PURE__ */ (function(_BaseLegend) {
|
|
@@ -21,27 +21,27 @@ var style = (
|
|
|
21
21
|
/*__reshadow_css_start__*/
|
|
22
22
|
(sstyled.insert(
|
|
23
23
|
/*__inner_css_start__*/
|
|
24
|
-
'.
|
|
24
|
+
'.___SLegendItem_g4xlu_gg_{min-width:0;align-items:flex-start}@media (hover:hover){.___SLegendItem_g4xlu_gg_:hover{cursor:pointer}.___SLegendItem_g4xlu_gg_.__disabled_g4xlu_gg_:hover{cursor:default}}.___SPointShape_g4xlu_gg_.__color_g4xlu_gg_{background-color:var(--color_g4xlu);margin-right:8px;flex-shrink:0}.___SPointShape_g4xlu_gg_._shape_Circle_g4xlu_gg_._size_l_g4xlu_gg_{width:16px;height:16px;border-radius:8px;margin-top:4px}.___SPointShape_g4xlu_gg_._shape_Circle_g4xlu_gg_._size_m_g4xlu_gg_{width:12px;height:12px;border-radius:6px;margin-top:4px}.___SPointShape_g4xlu_gg_._shape_Line_g4xlu_gg_._size_l_g4xlu_gg_{width:16px;height:4px;border-radius:3px;margin-top:9px}.___SPointShape_g4xlu_gg_._shape_Line_g4xlu_gg_._size_m_g4xlu_gg_{width:12px;height:4px;border-radius:3px;margin-top:8px}.___SPointShape_g4xlu_gg_._shape_Square_g4xlu_gg_._size_l_g4xlu_gg_{width:16px;height:16px;border-radius:2px;margin-top:4px}.___SPointShape_g4xlu_gg_._shape_Square_g4xlu_gg_._size_m_g4xlu_gg_{width:12px;height:12px;border-radius:2px;margin-top:4px}.___SPointShape_g4xlu_gg_._shape_Pattern_g4xlu_gg_{background-color:transparent;margin-right:4px}.___SIcon_g4xlu_gg_{line-height:0;margin-right:4px}.___SIcon_g4xlu_gg_._size_l_g4xlu_gg_{margin-top:4px}.___SIcon_g4xlu_gg_._size_m_g4xlu_gg_{margin-top:2px}.___SLabel_g4xlu_gg_{min-width:0}.___SAdditionalLabel_g4xlu_gg_._size_l_g4xlu_gg_,.___SCount_g4xlu_gg_._size_l_g4xlu_gg_,.___SLabel_g4xlu_gg_._size_l_g4xlu_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SAdditionalLabel_g4xlu_gg_._size_m_g4xlu_gg_,.___SCount_g4xlu_gg_._size_m_g4xlu_gg_,.___SLabel_g4xlu_gg_._size_m_g4xlu_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SAdditionalLabel_g4xlu_gg_,.___SCount_g4xlu_gg_{margin-left:4px}.___SAdditionalLabel_g4xlu_gg_{white-space:nowrap;display:flex;align-items:flex-start}.___SAdditionalLabel_g4xlu_gg_::before{content:"";display:inline-block;background-color:var(--intergalactic-text-secondary, #6c6e79);height:4px;width:4px;border-radius:2px;margin-right:4px}.___SAdditionalLabel_g4xlu_gg_._size_l_g4xlu_gg_::before{margin-top:10px}.___SAdditionalLabel_g4xlu_gg_._size_m_g4xlu_gg_::before{margin-top:8px}.___SPatternSymbol_g4xlu_gg_{transform:scale(.8)}',
|
|
25
25
|
/*__inner_css_end__*/
|
|
26
|
-
"
|
|
26
|
+
"g4xlu_gg_"
|
|
27
27
|
), /*__reshadow_css_end__*/
|
|
28
28
|
{
|
|
29
|
-
"__SLegendItem": "
|
|
30
|
-
"_disabled": "
|
|
31
|
-
"__SPointShape": "
|
|
32
|
-
"_color": "
|
|
33
|
-
"--color": "--
|
|
34
|
-
"_shape_Circle": "
|
|
35
|
-
"_size_l": "
|
|
36
|
-
"_size_m": "
|
|
37
|
-
"_shape_Line": "
|
|
38
|
-
"_shape_Square": "
|
|
39
|
-
"_shape_Pattern": "
|
|
40
|
-
"__SIcon": "
|
|
41
|
-
"__SLabel": "
|
|
42
|
-
"__SAdditionalLabel": "
|
|
43
|
-
"__SCount": "
|
|
44
|
-
"__SPatternSymbol": "
|
|
29
|
+
"__SLegendItem": "___SLegendItem_g4xlu_gg_",
|
|
30
|
+
"_disabled": "__disabled_g4xlu_gg_",
|
|
31
|
+
"__SPointShape": "___SPointShape_g4xlu_gg_",
|
|
32
|
+
"_color": "__color_g4xlu_gg_",
|
|
33
|
+
"--color": "--color_g4xlu",
|
|
34
|
+
"_shape_Circle": "_shape_Circle_g4xlu_gg_",
|
|
35
|
+
"_size_l": "_size_l_g4xlu_gg_",
|
|
36
|
+
"_size_m": "_size_m_g4xlu_gg_",
|
|
37
|
+
"_shape_Line": "_shape_Line_g4xlu_gg_",
|
|
38
|
+
"_shape_Square": "_shape_Square_g4xlu_gg_",
|
|
39
|
+
"_shape_Pattern": "_shape_Pattern_g4xlu_gg_",
|
|
40
|
+
"__SIcon": "___SIcon_g4xlu_gg_",
|
|
41
|
+
"__SLabel": "___SLabel_g4xlu_gg_",
|
|
42
|
+
"__SAdditionalLabel": "___SAdditionalLabel_g4xlu_gg_",
|
|
43
|
+
"__SCount": "___SCount_g4xlu_gg_",
|
|
44
|
+
"__SPatternSymbol": "___SPatternSymbol_g4xlu_gg_"
|
|
45
45
|
})
|
|
46
46
|
);
|
|
47
47
|
var enhance = [resolveColorEnhance(), uniqueIDEnhancement()];
|
|
@@ -14,16 +14,16 @@ var style = (
|
|
|
14
14
|
/*__reshadow_css_start__*/
|
|
15
15
|
(sstyled.insert(
|
|
16
16
|
/*__inner_css_start__*/
|
|
17
|
-
'.
|
|
17
|
+
'.___SLegendTable_12151_gg_.__columns-count_12151_gg_{font-feature-settings:"tnum";font-variant-numeric:tabular-nums;display:grid;grid-template-columns:auto .2fr;align-items:center;height:-moz-fit-content;height:fit-content;grid-column-gap:16px;grid-row-gap:8px}.___SColumnItem_12151_gg_._size_l_12151_gg_{font-size:var(--intergalactic-fs-300, 16px);text-align:right}.___SColumnItem_12151_gg_._size_m_12151_gg_{font-size:var(--intergalactic-fs-200, 14px);text-align:right}',
|
|
18
18
|
/*__inner_css_end__*/
|
|
19
|
-
"
|
|
19
|
+
"12151_gg_"
|
|
20
20
|
), /*__reshadow_css_end__*/
|
|
21
21
|
{
|
|
22
|
-
"__SLegendTable": "
|
|
23
|
-
"_columns-count": "__columns-
|
|
24
|
-
"__SColumnItem": "
|
|
25
|
-
"_size_l": "
|
|
26
|
-
"_size_m": "
|
|
22
|
+
"__SLegendTable": "___SLegendTable_12151_gg_",
|
|
23
|
+
"_columns-count": "__columns-count_12151_gg_",
|
|
24
|
+
"__SColumnItem": "___SColumnItem_12151_gg_",
|
|
25
|
+
"_size_l": "_size_l_12151_gg_",
|
|
26
|
+
"_size_m": "_size_m_12151_gg_"
|
|
27
27
|
})
|
|
28
28
|
);
|
|
29
29
|
var LegendTableRoot = /* @__PURE__ */ (function(_BaseLegend) {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
STooltipChildrenWrapper {
|
|
2
|
+
display: grid;
|
|
3
|
+
column-gap: var(--intergalactic-spacing-2x, 8px);
|
|
4
|
+
|
|
5
|
+
&[columnsCount='2'] {
|
|
6
|
+
grid-template-columns: auto minmax(28px, max-content);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
&[columnsCount='3'] {
|
|
10
|
+
grid-template-columns: auto minmax(28px, max-content) minmax(28px, max-content);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -9,4 +9,4 @@ export type A11yViewProps = {
|
|
|
9
9
|
config: PartialDataSummarizationConfig;
|
|
10
10
|
plotRef: React.RefObject<HTMLElement>;
|
|
11
11
|
};
|
|
12
|
-
export declare
|
|
12
|
+
export declare function PlotA11yModule(props: A11yViewProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
@@ -2,6 +2,7 @@ import { Component } from '@semcore/core';
|
|
|
2
2
|
import type { ScaleBand, ScaleLinear, ScaleTime } from 'd3-scale';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import type { BaseChartProps, BaseLegendProps, ListData, ObjectData } from './AbstractChart.type';
|
|
5
|
+
import type { HoverLine, HoverRect } from '../..';
|
|
5
6
|
import { interpolateValue } from '../../utils';
|
|
6
7
|
import type { LegendItem } from '../ChartLegend/LegendItem/LegendItem.type';
|
|
7
8
|
type ChartState = {
|
|
@@ -11,8 +12,11 @@ type ChartState = {
|
|
|
11
12
|
highlightedLine: number;
|
|
12
13
|
withTrend: boolean;
|
|
13
14
|
};
|
|
15
|
+
export declare const NOT_A_VALUE = "n/a";
|
|
14
16
|
export declare abstract class AbstractChart<D extends ListData | ObjectData, T extends BaseChartProps<D>, E extends readonly ((...args: any[]) => any)[] = []> extends Component<T, {}, ChartState, E> {
|
|
15
|
-
static style: {
|
|
17
|
+
static style: {
|
|
18
|
+
[key: string]: string;
|
|
19
|
+
};
|
|
16
20
|
static defaultProps: Partial<BaseChartProps<any>>;
|
|
17
21
|
/**
|
|
18
22
|
* Padding from the end's of chart to the container (except axis sides)
|
|
@@ -36,6 +40,7 @@ export declare abstract class AbstractChart<D extends ListData | ObjectData, T e
|
|
|
36
40
|
protected get flatValues(): Set<number>;
|
|
37
41
|
protected get maxStackedValue(): number;
|
|
38
42
|
protected totalValue(data: ObjectData): number;
|
|
43
|
+
protected percentValue(data: ObjectData, key: string): string;
|
|
39
44
|
protected getValueScale(values: number[]): number;
|
|
40
45
|
protected setHighlightedLine(index: number): void;
|
|
41
46
|
protected handleChangeVisible(id: string, isVisible: boolean): void;
|
|
@@ -47,6 +52,11 @@ export declare abstract class AbstractChart<D extends ListData | ObjectData, T e
|
|
|
47
52
|
protected defaultLegendProps(): Partial<BaseLegendProps>;
|
|
48
53
|
protected renderLegend(): React.JSX.Element | null;
|
|
49
54
|
protected renderAxis(): React.ReactNode;
|
|
55
|
+
protected getTooltipChildren<D extends ObjectData>(options: {
|
|
56
|
+
Tooltip: typeof HoverLine['Tooltip'] | typeof HoverRect['Tooltip'];
|
|
57
|
+
dataItem: D;
|
|
58
|
+
}): React.ReactNode;
|
|
59
|
+
protected renderTooltipTotalLine<D extends ObjectData>(dataItem: D): React.JSX.Element | null;
|
|
50
60
|
render(): React.ReactNode;
|
|
51
61
|
}
|
|
52
62
|
export {};
|
|
@@ -13,7 +13,7 @@ export type BubbleChartData = Array<{
|
|
|
13
13
|
label?: string;
|
|
14
14
|
color?: string;
|
|
15
15
|
}>;
|
|
16
|
-
export type BubbleChartProps = BaseChartProps<BubbleChartData> & {
|
|
16
|
+
export type BubbleChartProps = Intergalactic.InternalTypings.EfficientOmit<BaseChartProps<BubbleChartData>, 'showTotalInTooltip'> & {
|
|
17
17
|
/** Field name that groups the data points */
|
|
18
18
|
groupKey?: never;
|
|
19
19
|
/** Custom x-axis scale */
|
|
@@ -9,6 +9,8 @@ export type CigaretteChartProps = Intergalactic.InternalTypings.EfficientOmit<Ba
|
|
|
9
9
|
tooltipTitle?: string;
|
|
10
10
|
/** Controls whether the tooltip shows all data or single item data */
|
|
11
11
|
tooltipViewType?: 'all' | 'single';
|
|
12
|
+
/** Show percent value in tooltip */
|
|
13
|
+
showPercentValueInTooltip?: boolean;
|
|
12
14
|
/** Header content for the chart */
|
|
13
15
|
header?: React.ReactNode;
|
|
14
16
|
/** Animation duration in milliseconds */
|
|
@@ -5,7 +5,7 @@ import type React from 'react';
|
|
|
5
5
|
import type { BaseChartProps } from './AbstractChart.type';
|
|
6
6
|
type BarKey = string;
|
|
7
7
|
export type CompactHorizontalBarChartData = Array<Record<BarKey, number | string>>;
|
|
8
|
-
export type CompactHorizontalBarChartProps = BaseChartProps<CompactHorizontalBarChartData> & {
|
|
8
|
+
export type CompactHorizontalBarChartProps = Intergalactic.InternalTypings.EfficientOmit<BaseChartProps<CompactHorizontalBarChartData>, 'showTotalInTooltip'> & {
|
|
9
9
|
/** Field name from data array for the x-axis values */
|
|
10
10
|
x: string;
|
|
11
11
|
/** Field name from data array for the y-axis values */
|
|
@@ -5,7 +5,7 @@ import type React from 'react';
|
|
|
5
5
|
import type { BaseChartProps } from './AbstractChart.type';
|
|
6
6
|
export type DataKey = string;
|
|
7
7
|
export type DonutChartData = Record<DataKey, number>;
|
|
8
|
-
export type DonutChartProps = BaseChartProps<DonutChartData> & {
|
|
8
|
+
export type DonutChartProps = Intergalactic.InternalTypings.EfficientOmit<BaseChartProps<DonutChartData>, 'showTotalInTooltip'> & {
|
|
9
9
|
/** Internal */
|
|
10
10
|
groupKey?: never;
|
|
11
11
|
/** Custom x-axis scale */
|
|
@@ -3,7 +3,7 @@ import type { Flex } from '@semcore/flex-box';
|
|
|
3
3
|
import type { ScaleLinear } from 'd3-scale';
|
|
4
4
|
import type { BaseChartProps } from './AbstractChart.type';
|
|
5
5
|
export type RadarChartData = Record<string, string[] | number[]>;
|
|
6
|
-
export type RadarChartProps = BaseChartProps<RadarChartData> & {
|
|
6
|
+
export type RadarChartProps = Intergalactic.InternalTypings.EfficientOmit<BaseChartProps<RadarChartData>, 'showTotalInTooltip' | 'showPercentValueInTooltip'> & {
|
|
7
7
|
groupKey: string;
|
|
8
8
|
scale?: ScaleLinear<any, any>;
|
|
9
9
|
xScale?: never;
|
|
@@ -4,7 +4,7 @@ import type { ScaleLinear, ScaleTime } from 'd3-scale';
|
|
|
4
4
|
import type { BaseChartProps } from './AbstractChart.type';
|
|
5
5
|
import type { interpolateValue } from '../../utils';
|
|
6
6
|
export type ScatterPlotChartData = Array<Record<string, number | typeof interpolateValue | Date>>;
|
|
7
|
-
export type ScatterPlotChartProps = BaseChartProps<ScatterPlotChartData> & {
|
|
7
|
+
export type ScatterPlotChartProps = Intergalactic.InternalTypings.EfficientOmit<BaseChartProps<ScatterPlotChartData>, 'showTotalInTooltip'> & {
|
|
8
8
|
/** Field name that groups the data points */
|
|
9
9
|
groupKey: string;
|
|
10
10
|
/** Custom x-axis scale */
|
|
@@ -4,7 +4,7 @@ import type { ScaleLinear } from 'd3-scale';
|
|
|
4
4
|
import type { BaseChartProps } from './AbstractChart.type';
|
|
5
5
|
export type DataKey = string;
|
|
6
6
|
export type VennChartData = Record<DataKey, number>;
|
|
7
|
-
export type VennChartProps = BaseChartProps<VennChartData> & {
|
|
7
|
+
export type VennChartProps = Intergalactic.InternalTypings.EfficientOmit<BaseChartProps<VennChartData>, 'showTotalInTooltip'> & {
|
|
8
8
|
/** Internal */
|
|
9
9
|
groupKey?: never;
|
|
10
10
|
/** Custom x-axis scale */
|