@apexcura/ui-components 0.0.14-Beta133 → 0.0.14-Beta136
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 +19 -11
- package/dist/index.mjs +19 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1240,14 +1240,22 @@ var SemiCircleDonut = (props) => {
|
|
|
1240
1240
|
const height = bottom - top;
|
|
1241
1241
|
const centerX = left + width / 2;
|
|
1242
1242
|
const centerY = top + height / 1.5;
|
|
1243
|
+
const maxWidth = width * 0.8;
|
|
1243
1244
|
ctx.save();
|
|
1244
|
-
ctx.font = "16px Arial";
|
|
1245
1245
|
ctx.fillStyle = "black";
|
|
1246
1246
|
ctx.textAlign = "center";
|
|
1247
1247
|
ctx.textBaseline = "middle";
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1248
|
+
const drawText = (text, y, fontSize) => {
|
|
1249
|
+
ctx.font = `${fontSize}px Arial`;
|
|
1250
|
+
const textWidth = ctx.measureText(text).width;
|
|
1251
|
+
if (textWidth > maxWidth) {
|
|
1252
|
+
const newFontSize = fontSize * maxWidth / textWidth;
|
|
1253
|
+
ctx.font = `${newFontSize}px Arial`;
|
|
1254
|
+
}
|
|
1255
|
+
ctx.fillText(text, centerX, y);
|
|
1256
|
+
};
|
|
1257
|
+
drawText(props.fillText1, centerY - 10, 16);
|
|
1258
|
+
drawText(props.fillText2, centerY + 20, 8);
|
|
1251
1259
|
ctx.restore();
|
|
1252
1260
|
}
|
|
1253
1261
|
};
|
|
@@ -1266,7 +1274,7 @@ var HorizontalBarChart = (props) => {
|
|
|
1266
1274
|
{
|
|
1267
1275
|
data: [30, 10, 27, 40, 12, 24],
|
|
1268
1276
|
backgroundColor: "#6298D5",
|
|
1269
|
-
barThickness:
|
|
1277
|
+
barThickness: 15
|
|
1270
1278
|
}
|
|
1271
1279
|
]
|
|
1272
1280
|
};
|
|
@@ -1314,9 +1322,9 @@ var LineChart = (props) => {
|
|
|
1314
1322
|
const chartRef = (0, import_react34.useRef)(null);
|
|
1315
1323
|
const chartInstance = (0, import_react34.useRef)(null);
|
|
1316
1324
|
const data = [
|
|
1317
|
-
{ label: "ROI", data: [10,
|
|
1318
|
-
{ label: "Engagement Rate", data: [
|
|
1319
|
-
{ label: "Conversion Rate", data: [30, 50, 70, 90,
|
|
1325
|
+
{ label: "ROI", data: [10, 13, 20, 15, 10] },
|
|
1326
|
+
{ label: "Engagement Rate", data: [12, 15, 26, 28, 12] },
|
|
1327
|
+
{ label: "Conversion Rate", data: [30, 50, 70, 90, 30] }
|
|
1320
1328
|
];
|
|
1321
1329
|
const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
|
|
1322
1330
|
(0, import_react34.useEffect)(() => {
|
|
@@ -1407,14 +1415,14 @@ var DoubleBarChart = (props) => {
|
|
|
1407
1415
|
data: [60, 70, 50, 80, 65],
|
|
1408
1416
|
// Example data for male
|
|
1409
1417
|
backgroundColor: "#93B8E2",
|
|
1410
|
-
barThickness:
|
|
1418
|
+
barThickness: 10
|
|
1411
1419
|
},
|
|
1412
1420
|
{
|
|
1413
1421
|
label: "Conversion Rate",
|
|
1414
1422
|
data: [70, 65, 75, 55, 85],
|
|
1415
1423
|
// Example data for female
|
|
1416
1424
|
backgroundColor: "#4484CD",
|
|
1417
|
-
barThickness:
|
|
1425
|
+
barThickness: 10
|
|
1418
1426
|
}
|
|
1419
1427
|
]
|
|
1420
1428
|
},
|
|
@@ -1483,7 +1491,7 @@ var BarChart = () => {
|
|
|
1483
1491
|
],
|
|
1484
1492
|
datasets: [
|
|
1485
1493
|
{
|
|
1486
|
-
data: [70, 65, 75, 55, 85],
|
|
1494
|
+
data: [70, 65, 75, 55, 85, 20, 55],
|
|
1487
1495
|
// Example data for female
|
|
1488
1496
|
backgroundColor: "rgba(255, 99, 132, 0.5)",
|
|
1489
1497
|
borderColor: "rgba(255, 99, 132, 1)",
|
package/dist/index.mjs
CHANGED
|
@@ -1186,14 +1186,22 @@ var SemiCircleDonut = (props) => {
|
|
|
1186
1186
|
const height = bottom - top;
|
|
1187
1187
|
const centerX = left + width / 2;
|
|
1188
1188
|
const centerY = top + height / 1.5;
|
|
1189
|
+
const maxWidth = width * 0.8;
|
|
1189
1190
|
ctx.save();
|
|
1190
|
-
ctx.font = "16px Arial";
|
|
1191
1191
|
ctx.fillStyle = "black";
|
|
1192
1192
|
ctx.textAlign = "center";
|
|
1193
1193
|
ctx.textBaseline = "middle";
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1194
|
+
const drawText = (text, y, fontSize) => {
|
|
1195
|
+
ctx.font = `${fontSize}px Arial`;
|
|
1196
|
+
const textWidth = ctx.measureText(text).width;
|
|
1197
|
+
if (textWidth > maxWidth) {
|
|
1198
|
+
const newFontSize = fontSize * maxWidth / textWidth;
|
|
1199
|
+
ctx.font = `${newFontSize}px Arial`;
|
|
1200
|
+
}
|
|
1201
|
+
ctx.fillText(text, centerX, y);
|
|
1202
|
+
};
|
|
1203
|
+
drawText(props.fillText1, centerY - 10, 16);
|
|
1204
|
+
drawText(props.fillText2, centerY + 20, 8);
|
|
1197
1205
|
ctx.restore();
|
|
1198
1206
|
}
|
|
1199
1207
|
};
|
|
@@ -1218,7 +1226,7 @@ var HorizontalBarChart = (props) => {
|
|
|
1218
1226
|
{
|
|
1219
1227
|
data: [30, 10, 27, 40, 12, 24],
|
|
1220
1228
|
backgroundColor: "#6298D5",
|
|
1221
|
-
barThickness:
|
|
1229
|
+
barThickness: 15
|
|
1222
1230
|
}
|
|
1223
1231
|
]
|
|
1224
1232
|
};
|
|
@@ -1266,9 +1274,9 @@ var LineChart = (props) => {
|
|
|
1266
1274
|
const chartRef = useRef2(null);
|
|
1267
1275
|
const chartInstance = useRef2(null);
|
|
1268
1276
|
const data = [
|
|
1269
|
-
{ label: "ROI", data: [10,
|
|
1270
|
-
{ label: "Engagement Rate", data: [
|
|
1271
|
-
{ label: "Conversion Rate", data: [30, 50, 70, 90,
|
|
1277
|
+
{ label: "ROI", data: [10, 13, 20, 15, 10] },
|
|
1278
|
+
{ label: "Engagement Rate", data: [12, 15, 26, 28, 12] },
|
|
1279
|
+
{ label: "Conversion Rate", data: [30, 50, 70, 90, 30] }
|
|
1272
1280
|
];
|
|
1273
1281
|
const labels = ["Instagram", "Whatsapp", "Messages", "Telegram", "Linkedin"];
|
|
1274
1282
|
useEffect4(() => {
|
|
@@ -1359,14 +1367,14 @@ var DoubleBarChart = (props) => {
|
|
|
1359
1367
|
data: [60, 70, 50, 80, 65],
|
|
1360
1368
|
// Example data for male
|
|
1361
1369
|
backgroundColor: "#93B8E2",
|
|
1362
|
-
barThickness:
|
|
1370
|
+
barThickness: 10
|
|
1363
1371
|
},
|
|
1364
1372
|
{
|
|
1365
1373
|
label: "Conversion Rate",
|
|
1366
1374
|
data: [70, 65, 75, 55, 85],
|
|
1367
1375
|
// Example data for female
|
|
1368
1376
|
backgroundColor: "#4484CD",
|
|
1369
|
-
barThickness:
|
|
1377
|
+
barThickness: 10
|
|
1370
1378
|
}
|
|
1371
1379
|
]
|
|
1372
1380
|
},
|
|
@@ -1435,7 +1443,7 @@ var BarChart = () => {
|
|
|
1435
1443
|
],
|
|
1436
1444
|
datasets: [
|
|
1437
1445
|
{
|
|
1438
|
-
data: [70, 65, 75, 55, 85],
|
|
1446
|
+
data: [70, 65, 75, 55, 85, 20, 55],
|
|
1439
1447
|
// Example data for female
|
|
1440
1448
|
backgroundColor: "rgba(255, 99, 132, 0.5)",
|
|
1441
1449
|
borderColor: "rgba(255, 99, 132, 1)",
|