dp-widgets-framework 1.2.2 → 1.2.3
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.esm.js +6 -6
- package/dist/index.js +6 -6
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -36409,11 +36409,10 @@ function PieChartComponent({ pieChartState, styles, appendMessage, query, isFirs
|
|
|
36409
36409
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
36410
36410
|
const hasCalledRef = useRef(false);
|
|
36411
36411
|
const labels = ((_b = (_a = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.pie_chart_data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.labels) || ((_e = (_d = (_c = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.state) === null || _c === void 0 ? void 0 : _c.pie_chart_data) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.labels) || [];
|
|
36412
|
-
const
|
|
36413
|
-
|
|
36414
|
-
|
|
36415
|
-
const
|
|
36416
|
-
const units = ((_z = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.pie_chart_data) === null || _z === void 0 ? void 0 : _z.units) || ((_1 = (_0 = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.state) === null || _0 === void 0 ? void 0 : _0.pie_chart_data) === null || _1 === void 0 ? void 0 : _1.units) || "";
|
|
36412
|
+
const values = ((_g = (_f = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.pie_chart_data) === null || _f === void 0 ? void 0 : _f.data) === null || _g === void 0 ? void 0 : _g.values) || ((_k = (_j = (_h = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.state) === null || _h === void 0 ? void 0 : _h.pie_chart_data) === null || _j === void 0 ? void 0 : _j.data) === null || _k === void 0 ? void 0 : _k.values) || [];
|
|
36413
|
+
((_m = (_l = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.pie_chart_data) === null || _l === void 0 ? void 0 : _l.data) === null || _m === void 0 ? void 0 : _m.percentages) || ((_q = (_p = (_o = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.state) === null || _o === void 0 ? void 0 : _o.pie_chart_data) === null || _p === void 0 ? void 0 : _p.data) === null || _q === void 0 ? void 0 : _q.percentages) || [];
|
|
36414
|
+
const chartTitle = ((_r = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.pie_chart_data) === null || _r === void 0 ? void 0 : _r.title) || ((_t = (_s = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.state) === null || _s === void 0 ? void 0 : _s.pie_chart_data) === null || _t === void 0 ? void 0 : _t.title) || "";
|
|
36415
|
+
const units = ((_u = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.pie_chart_data) === null || _u === void 0 ? void 0 : _u.units) || ((_w = (_v = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.state) === null || _v === void 0 ? void 0 : _v.pie_chart_data) === null || _w === void 0 ? void 0 : _w.units) || "";
|
|
36417
36416
|
const isEmpty = labels.length === 0 || values.length === 0;
|
|
36418
36417
|
const handleRefresh = async () => {
|
|
36419
36418
|
if (query) {
|
|
@@ -36448,13 +36447,14 @@ function PieChartComponent({ pieChartState, styles, appendMessage, query, isFirs
|
|
|
36448
36447
|
if (isEmpty) {
|
|
36449
36448
|
return createLoadingComponent();
|
|
36450
36449
|
}
|
|
36450
|
+
const colors = ((_y = (_x = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.pie_chart_data) === null || _x === void 0 ? void 0 : _x.data) === null || _y === void 0 ? void 0 : _y.colors) || ((_1 = (_0 = (_z = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.state) === null || _z === void 0 ? void 0 : _z.pie_chart_data) === null || _0 === void 0 ? void 0 : _0.data) === null || _1 === void 0 ? void 0 : _1.colors) || labels.map((_, index) => backgroundColors[index % backgroundColors.length]);
|
|
36451
36451
|
const transformedData = {
|
|
36452
36452
|
labels: labels,
|
|
36453
36453
|
datasets: [
|
|
36454
36454
|
{
|
|
36455
36455
|
label: chartTitle || "Data",
|
|
36456
36456
|
data: values,
|
|
36457
|
-
backgroundColor: colors
|
|
36457
|
+
backgroundColor: colors,
|
|
36458
36458
|
borderWidth: 0,
|
|
36459
36459
|
},
|
|
36460
36460
|
],
|
package/dist/index.js
CHANGED
|
@@ -36436,11 +36436,10 @@ function PieChartComponent({ pieChartState, styles, appendMessage, query, isFirs
|
|
|
36436
36436
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
36437
36437
|
const hasCalledRef = React.useRef(false);
|
|
36438
36438
|
const labels = ((_b = (_a = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.pie_chart_data) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.labels) || ((_e = (_d = (_c = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.state) === null || _c === void 0 ? void 0 : _c.pie_chart_data) === null || _d === void 0 ? void 0 : _d.data) === null || _e === void 0 ? void 0 : _e.labels) || [];
|
|
36439
|
-
const
|
|
36440
|
-
|
|
36441
|
-
|
|
36442
|
-
const
|
|
36443
|
-
const units = ((_z = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.pie_chart_data) === null || _z === void 0 ? void 0 : _z.units) || ((_1 = (_0 = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.state) === null || _0 === void 0 ? void 0 : _0.pie_chart_data) === null || _1 === void 0 ? void 0 : _1.units) || "";
|
|
36439
|
+
const values = ((_g = (_f = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.pie_chart_data) === null || _f === void 0 ? void 0 : _f.data) === null || _g === void 0 ? void 0 : _g.values) || ((_k = (_j = (_h = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.state) === null || _h === void 0 ? void 0 : _h.pie_chart_data) === null || _j === void 0 ? void 0 : _j.data) === null || _k === void 0 ? void 0 : _k.values) || [];
|
|
36440
|
+
((_m = (_l = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.pie_chart_data) === null || _l === void 0 ? void 0 : _l.data) === null || _m === void 0 ? void 0 : _m.percentages) || ((_q = (_p = (_o = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.state) === null || _o === void 0 ? void 0 : _o.pie_chart_data) === null || _p === void 0 ? void 0 : _p.data) === null || _q === void 0 ? void 0 : _q.percentages) || [];
|
|
36441
|
+
const chartTitle = ((_r = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.pie_chart_data) === null || _r === void 0 ? void 0 : _r.title) || ((_t = (_s = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.state) === null || _s === void 0 ? void 0 : _s.pie_chart_data) === null || _t === void 0 ? void 0 : _t.title) || "";
|
|
36442
|
+
const units = ((_u = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.pie_chart_data) === null || _u === void 0 ? void 0 : _u.units) || ((_w = (_v = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.state) === null || _v === void 0 ? void 0 : _v.pie_chart_data) === null || _w === void 0 ? void 0 : _w.units) || "";
|
|
36444
36443
|
const isEmpty = labels.length === 0 || values.length === 0;
|
|
36445
36444
|
const handleRefresh = async () => {
|
|
36446
36445
|
if (query) {
|
|
@@ -36475,13 +36474,14 @@ function PieChartComponent({ pieChartState, styles, appendMessage, query, isFirs
|
|
|
36475
36474
|
if (isEmpty) {
|
|
36476
36475
|
return createLoadingComponent();
|
|
36477
36476
|
}
|
|
36477
|
+
const colors = ((_y = (_x = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.pie_chart_data) === null || _x === void 0 ? void 0 : _x.data) === null || _y === void 0 ? void 0 : _y.colors) || ((_1 = (_0 = (_z = pieChartState === null || pieChartState === void 0 ? void 0 : pieChartState.state) === null || _z === void 0 ? void 0 : _z.pie_chart_data) === null || _0 === void 0 ? void 0 : _0.data) === null || _1 === void 0 ? void 0 : _1.colors) || labels.map((_, index) => backgroundColors[index % backgroundColors.length]);
|
|
36478
36478
|
const transformedData = {
|
|
36479
36479
|
labels: labels,
|
|
36480
36480
|
datasets: [
|
|
36481
36481
|
{
|
|
36482
36482
|
label: chartTitle || "Data",
|
|
36483
36483
|
data: values,
|
|
36484
|
-
backgroundColor: colors
|
|
36484
|
+
backgroundColor: colors,
|
|
36485
36485
|
borderWidth: 0,
|
|
36486
36486
|
},
|
|
36487
36487
|
],
|