@apexcura/ui-components 0.0.14-Beta132 → 0.0.14-Beta135
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 +23 -15
- package/dist/index.mjs +23 -15
- 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)(() => {
|
|
@@ -1352,7 +1360,7 @@ var LineChart = (props) => {
|
|
|
1352
1360
|
scales: {
|
|
1353
1361
|
x: {
|
|
1354
1362
|
grid: {
|
|
1355
|
-
display:
|
|
1363
|
+
display: false
|
|
1356
1364
|
}
|
|
1357
1365
|
},
|
|
1358
1366
|
y: {
|
|
@@ -1364,7 +1372,7 @@ var LineChart = (props) => {
|
|
|
1364
1372
|
}
|
|
1365
1373
|
},
|
|
1366
1374
|
grid: {
|
|
1367
|
-
display:
|
|
1375
|
+
display: true
|
|
1368
1376
|
}
|
|
1369
1377
|
}
|
|
1370
1378
|
}
|
|
@@ -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
|
},
|
|
@@ -1422,7 +1430,7 @@ var DoubleBarChart = (props) => {
|
|
|
1422
1430
|
scales: {
|
|
1423
1431
|
x: {
|
|
1424
1432
|
grid: {
|
|
1425
|
-
display:
|
|
1433
|
+
display: false
|
|
1426
1434
|
// Display x-axis grid lines
|
|
1427
1435
|
}
|
|
1428
1436
|
},
|
|
@@ -1435,7 +1443,7 @@ var DoubleBarChart = (props) => {
|
|
|
1435
1443
|
}
|
|
1436
1444
|
},
|
|
1437
1445
|
grid: {
|
|
1438
|
-
display:
|
|
1446
|
+
display: true
|
|
1439
1447
|
}
|
|
1440
1448
|
}
|
|
1441
1449
|
},
|
|
@@ -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(() => {
|
|
@@ -1304,7 +1312,7 @@ var LineChart = (props) => {
|
|
|
1304
1312
|
scales: {
|
|
1305
1313
|
x: {
|
|
1306
1314
|
grid: {
|
|
1307
|
-
display:
|
|
1315
|
+
display: false
|
|
1308
1316
|
}
|
|
1309
1317
|
},
|
|
1310
1318
|
y: {
|
|
@@ -1316,7 +1324,7 @@ var LineChart = (props) => {
|
|
|
1316
1324
|
}
|
|
1317
1325
|
},
|
|
1318
1326
|
grid: {
|
|
1319
|
-
display:
|
|
1327
|
+
display: true
|
|
1320
1328
|
}
|
|
1321
1329
|
}
|
|
1322
1330
|
}
|
|
@@ -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
|
},
|
|
@@ -1374,7 +1382,7 @@ var DoubleBarChart = (props) => {
|
|
|
1374
1382
|
scales: {
|
|
1375
1383
|
x: {
|
|
1376
1384
|
grid: {
|
|
1377
|
-
display:
|
|
1385
|
+
display: false
|
|
1378
1386
|
// Display x-axis grid lines
|
|
1379
1387
|
}
|
|
1380
1388
|
},
|
|
@@ -1387,7 +1395,7 @@ var DoubleBarChart = (props) => {
|
|
|
1387
1395
|
}
|
|
1388
1396
|
},
|
|
1389
1397
|
grid: {
|
|
1390
|
-
display:
|
|
1398
|
+
display: true
|
|
1391
1399
|
}
|
|
1392
1400
|
}
|
|
1393
1401
|
},
|
|
@@ -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)",
|