@oliasoft-open-source/charts-library 4.1.11 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -7
- package/dist/index.js.map +1 -1
- package/dist/src/components/common/common.interface.d.ts +1 -1
- package/dist/src/components/common/enums.d.ts +6 -1
- package/dist/src/components/common/helpers/custom-format-number.d.ts +1 -0
- package/dist/src/components/common/legend-component/legend-interface.d.ts +4 -3
- package/dist/src/components/pie-chart/pie-chart-defalut-props.interface.d.ts +1 -1
- package/dist/src/components/pie-chart/pie-chart.interface.d.ts +2 -2
- package/dist/src/components/pie-chart/use-pie-chart-config.d.ts +1 -1
- package/dist/src/components/scatter-chart/scatter-chart-default-props.interface.d.ts +69 -0
- package/dist/src/components/scatter-chart/scatter-chart-get-default-props.d.ts +3 -0
- package/dist/src/components/scatter-chart/scatter-chart.d.ts +3 -0
- package/dist/src/components/scatter-chart/scatter-chart.interface.d.ts +80 -0
- package/dist/src/components/scatter-chart/scatter-chart.stories.d.ts +205 -0
- package/dist/src/components/scatter-chart/utils/get-scales-config.d.ts +49 -0
- package/dist/src/components/scatter-chart/utils/get-tooltip-config.d.ts +20 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22757,6 +22757,9 @@ function TbArrowsMove(props) {
|
|
|
22757
22757
|
function TbBan(props) {
|
|
22758
22758
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "strokeWidth": "2", "stroke": "currentColor", "fill": "none", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "stroke": "none", "d": "M0 0h24v24H0z", "fill": "none" } }, { "tag": "path", "attr": { "d": "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" } }, { "tag": "path", "attr": { "d": "M5.7 5.7l12.6 12.6" } }] })(props);
|
|
22759
22759
|
}
|
|
22760
|
+
function TbCircleFilled(props) {
|
|
22761
|
+
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "strokeWidth": "2", "stroke": "currentColor", "fill": "none", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "stroke": "none", "d": "M0 0h24v24H0z", "fill": "none" } }, { "tag": "path", "attr": { "d": "M7 3.34a10 10 0 1 1 -4.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 4.995 -8.336z", "strokeWidth": "0", "fill": "currentColor" } }] })(props);
|
|
22762
|
+
}
|
|
22760
22763
|
function TbHandStop(props) {
|
|
22761
22764
|
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "strokeWidth": "2", "stroke": "currentColor", "fill": "none", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "stroke": "none", "d": "M0 0h24v24H0z", "fill": "none" } }, { "tag": "path", "attr": { "d": "M8 13v-7.5a1.5 1.5 0 0 1 3 0v6.5" } }, { "tag": "path", "attr": { "d": "M11 5.5v-2a1.5 1.5 0 1 1 3 0v8.5" } }, { "tag": "path", "attr": { "d": "M14 5.5a1.5 1.5 0 0 1 3 0v6.5" } }, { "tag": "path", "attr": { "d": "M17 7.5a1.5 1.5 0 0 1 3 0v8.5a6 6 0 0 1 -6 6h-2h.208a6 6 0 0 1 -5.012 -2.7a69.74 69.74 0 0 1 -.196 -.3c-.312 -.479 -1.407 -2.388 -3.286 -5.728a1.5 1.5 0 0 1 .536 -2.022a1.867 1.867 0 0 1 2.28 .28l1.47 1.47" } }] })(props);
|
|
22762
22765
|
}
|
|
@@ -25895,6 +25898,7 @@ var ChartType = /* @__PURE__ */ ((ChartType2) => {
|
|
|
25895
25898
|
ChartType2["LINE"] = "line";
|
|
25896
25899
|
ChartType2["BAR"] = "bar";
|
|
25897
25900
|
ChartType2["PIE"] = "pie";
|
|
25901
|
+
ChartType2["SCATTER"] = "scatter";
|
|
25898
25902
|
return ChartType2;
|
|
25899
25903
|
})(ChartType || {});
|
|
25900
25904
|
const circleSvg = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGNpcmNsZSBjeD0iMTIiIGN5PSIxMiIgcj0iMTIiIGZpbGw9ImN1cnJlbnRDb2xvciIgLz48L3N2Zz4=";
|
|
@@ -25977,6 +25981,8 @@ const renderLegendItemSymbol = (dataset, chartType) => {
|
|
|
25977
25981
|
return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemBox, children: /* @__PURE__ */ jsx(TbSquareFilled, { color: dataset.borderColor }) });
|
|
25978
25982
|
case ChartType.PIE:
|
|
25979
25983
|
return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemPoint, children: /* @__PURE__ */ jsx(Icon, { icon: circleSvg }) });
|
|
25984
|
+
case ChartType.SCATTER:
|
|
25985
|
+
return /* @__PURE__ */ jsx("span", { className: styles$2.legendItemPoint, children: /* @__PURE__ */ jsx(TbCircleFilled, { color: dataset.borderColor }) });
|
|
25980
25986
|
default:
|
|
25981
25987
|
return null;
|
|
25982
25988
|
}
|
|
@@ -26462,7 +26468,7 @@ const usePieChartConfig = (chart2) => {
|
|
|
26462
26468
|
const generatedDataset = {
|
|
26463
26469
|
label: ((_a2 = copyDataset == null ? void 0 : copyDataset[0]) == null ? void 0 : _a2.label) ?? "",
|
|
26464
26470
|
backgroundColor: [],
|
|
26465
|
-
borderColor:
|
|
26471
|
+
borderColor: "",
|
|
26466
26472
|
borderWidth: Number(copyDataset[0].borderWidth) || 1,
|
|
26467
26473
|
data: [],
|
|
26468
26474
|
borderDash: []
|
|
@@ -26475,20 +26481,18 @@ const usePieChartConfig = (chart2) => {
|
|
|
26475
26481
|
generatedDataset.backgroundColor.push(
|
|
26476
26482
|
(Array.isArray(backgroundColor) ? backgroundColor[labelIndex % ((borderColor == null ? void 0 : borderColor.length) || 1)] : backgroundColor) || COLORS[labelIndex] + `${99 - 10 * arcIndex}`
|
|
26477
26483
|
);
|
|
26478
|
-
generatedDataset.borderColor
|
|
26479
|
-
(Array.isArray(borderColor) ? borderColor[labelIndex % borderColor.length] : borderColor) || COLORS[labelIndex]
|
|
26480
|
-
);
|
|
26484
|
+
generatedDataset.borderColor = borderColor ?? "";
|
|
26481
26485
|
});
|
|
26482
26486
|
});
|
|
26483
26487
|
return [generatedDataset];
|
|
26484
26488
|
}
|
|
26485
26489
|
const generatedDatasets2 = copyDataset.map(
|
|
26486
26490
|
(pieDataset, index2) => {
|
|
26487
|
-
const { borderWidth: inputBorderWidth = "1"
|
|
26491
|
+
const { borderWidth: inputBorderWidth = "1" } = pieDataset ?? {};
|
|
26488
26492
|
const borderWidth = parseFloat(String(inputBorderWidth)) || 1;
|
|
26489
|
-
const color2 =
|
|
26493
|
+
const color2 = COLORS[index2];
|
|
26490
26494
|
const borderColor = pieDataset.borderColor || color2;
|
|
26491
|
-
const backgroundColor = pieDataset.backgroundColor ||
|
|
26495
|
+
const backgroundColor = pieDataset.backgroundColor || generateRandomColor(COLORS);
|
|
26492
26496
|
return {
|
|
26493
26497
|
...pieDataset,
|
|
26494
26498
|
borderWidth,
|