@apexcura/ui-components 0.0.14-Beta126 → 0.0.14-Beta128
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.css +0 -3
- package/dist/index.js +75 -34
- package/dist/index.mjs +75 -34
- package/package.json +1 -1
package/dist/index.css
CHANGED
package/dist/index.js
CHANGED
|
@@ -1101,29 +1101,38 @@ var import_chart = require("chart.js");
|
|
|
1101
1101
|
import_chart.Chart.register(import_chart.DoughnutController, import_chart.ArcElement, import_chart.Tooltip, import_chart.Legend);
|
|
1102
1102
|
var CircleDonut = (props) => {
|
|
1103
1103
|
const data = {
|
|
1104
|
-
labels: [
|
|
1104
|
+
labels: [
|
|
1105
|
+
"Registration",
|
|
1106
|
+
"Book Appointment",
|
|
1107
|
+
"Diagnostic Tests",
|
|
1108
|
+
"Hospital Facility",
|
|
1109
|
+
"Others, Prescriptions"
|
|
1110
|
+
],
|
|
1105
1111
|
datasets: [
|
|
1106
1112
|
{
|
|
1107
1113
|
label: "Bot Conversation",
|
|
1108
|
-
data: [30, 10, 27, 40, 12
|
|
1114
|
+
data: [30, 10, 27, 40, 12],
|
|
1109
1115
|
backgroundColor: [
|
|
1110
1116
|
"#FFCB8A",
|
|
1111
1117
|
"#CADBBF",
|
|
1112
1118
|
"#8AC1BB",
|
|
1113
1119
|
"#FCB0CB",
|
|
1114
|
-
"#CEB0FA"
|
|
1115
|
-
|
|
1116
|
-
|
|
1120
|
+
"#CEB0FA"
|
|
1121
|
+
],
|
|
1122
|
+
borderWidth: 0
|
|
1117
1123
|
}
|
|
1118
1124
|
]
|
|
1119
1125
|
};
|
|
1120
1126
|
const options = {
|
|
1121
1127
|
responsive: true,
|
|
1122
|
-
|
|
1128
|
+
cutout: "80%",
|
|
1123
1129
|
plugins: {
|
|
1124
1130
|
legend: {
|
|
1125
1131
|
position: "left",
|
|
1126
1132
|
labels: {
|
|
1133
|
+
font: {
|
|
1134
|
+
size: 10
|
|
1135
|
+
},
|
|
1127
1136
|
boxWidth: 15,
|
|
1128
1137
|
generateLabels: (chart) => {
|
|
1129
1138
|
const dataset = chart.data.datasets[0];
|
|
@@ -1149,7 +1158,27 @@ var CircleDonut = (props) => {
|
|
|
1149
1158
|
}
|
|
1150
1159
|
}
|
|
1151
1160
|
};
|
|
1152
|
-
|
|
1161
|
+
const centerTextPlugin = {
|
|
1162
|
+
id: "centerText",
|
|
1163
|
+
beforeDraw: (chart) => {
|
|
1164
|
+
const { ctx, chartArea: { left, right, top, bottom } } = chart;
|
|
1165
|
+
const width = right - left;
|
|
1166
|
+
const height = bottom - top;
|
|
1167
|
+
const centerX = left + width / 2;
|
|
1168
|
+
const centerY = top + height / 2;
|
|
1169
|
+
ctx.save();
|
|
1170
|
+
ctx.font = "10px Arial";
|
|
1171
|
+
ctx.fillStyle = "blue";
|
|
1172
|
+
ctx.textAlign = "center";
|
|
1173
|
+
ctx.textBaseline = "middle";
|
|
1174
|
+
ctx.fillText("Total Sessions", centerX, centerY - 10);
|
|
1175
|
+
ctx.font = "30px Arial";
|
|
1176
|
+
ctx.fillStyle = "black";
|
|
1177
|
+
ctx.fillText("85", centerX, centerY + 20);
|
|
1178
|
+
ctx.restore();
|
|
1179
|
+
}
|
|
1180
|
+
};
|
|
1181
|
+
return /* @__PURE__ */ import_react31.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react31.default.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react31.default.createElement(import_react_chartjs_2.Doughnut, { data, options, plugins: [centerTextPlugin] }));
|
|
1153
1182
|
};
|
|
1154
1183
|
|
|
1155
1184
|
// src/Components/SemiCircleDonut.tsx
|
|
@@ -1159,19 +1188,25 @@ var import_chart2 = require("chart.js");
|
|
|
1159
1188
|
import_chart2.Chart.register(import_chart2.DoughnutController, import_chart2.ArcElement, import_chart2.Tooltip, import_chart2.Legend);
|
|
1160
1189
|
var SemiCircleDonut = (props) => {
|
|
1161
1190
|
const data = {
|
|
1162
|
-
labels: [
|
|
1191
|
+
labels: [
|
|
1192
|
+
"Registration",
|
|
1193
|
+
"Book Appointment",
|
|
1194
|
+
"Diagnostic Tests",
|
|
1195
|
+
"Hospital Facility",
|
|
1196
|
+
"Others, Prescriptions"
|
|
1197
|
+
],
|
|
1163
1198
|
datasets: [
|
|
1164
1199
|
{
|
|
1165
1200
|
label: "Bot Conversation",
|
|
1166
|
-
data: [30, 10, 27, 40, 12
|
|
1201
|
+
data: [30, 10, 27, 40, 12],
|
|
1167
1202
|
backgroundColor: [
|
|
1168
1203
|
"#FFCB8A",
|
|
1169
1204
|
"#CADBBF",
|
|
1170
1205
|
"#8AC1BB",
|
|
1171
1206
|
"#FCB0CB",
|
|
1172
|
-
"#CEB0FA"
|
|
1173
|
-
|
|
1174
|
-
|
|
1207
|
+
"#CEB0FA"
|
|
1208
|
+
],
|
|
1209
|
+
borderWidth: 0
|
|
1175
1210
|
}
|
|
1176
1211
|
]
|
|
1177
1212
|
};
|
|
@@ -1179,24 +1214,11 @@ var SemiCircleDonut = (props) => {
|
|
|
1179
1214
|
responsive: true,
|
|
1180
1215
|
circumference: 180,
|
|
1181
1216
|
rotation: -90,
|
|
1217
|
+
cutout: "80%",
|
|
1182
1218
|
plugins: {
|
|
1183
1219
|
legend: {
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
boxWidth: 15,
|
|
1187
|
-
generateLabels: (chart) => {
|
|
1188
|
-
const dataset = chart.data.datasets[0];
|
|
1189
|
-
return chart.data.labels.map((label, index) => {
|
|
1190
|
-
const value = dataset.data[index];
|
|
1191
|
-
return {
|
|
1192
|
-
text: `${label}: ${value}`,
|
|
1193
|
-
fillStyle: dataset.backgroundColor[index],
|
|
1194
|
-
hidden: isNaN(dataset.data[index]) || dataset.data[index] === null,
|
|
1195
|
-
index
|
|
1196
|
-
};
|
|
1197
|
-
});
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1220
|
+
display: false
|
|
1221
|
+
// Disable the legend
|
|
1200
1222
|
},
|
|
1201
1223
|
tooltip: {
|
|
1202
1224
|
enabled: true,
|
|
@@ -1210,7 +1232,26 @@ var SemiCircleDonut = (props) => {
|
|
|
1210
1232
|
}
|
|
1211
1233
|
}
|
|
1212
1234
|
};
|
|
1213
|
-
|
|
1235
|
+
const centerTextPlugin = {
|
|
1236
|
+
id: "centerText",
|
|
1237
|
+
beforeDraw: (chart) => {
|
|
1238
|
+
const { ctx, chartArea: { left, right, top, bottom } } = chart;
|
|
1239
|
+
const width = right - left;
|
|
1240
|
+
const height = bottom - top;
|
|
1241
|
+
const centerX = left + width / 2;
|
|
1242
|
+
const centerY = top + height / 1.5;
|
|
1243
|
+
ctx.save();
|
|
1244
|
+
ctx.font = "30px Arial";
|
|
1245
|
+
ctx.fillStyle = "black";
|
|
1246
|
+
ctx.textAlign = "center";
|
|
1247
|
+
ctx.textBaseline = "middle";
|
|
1248
|
+
ctx.fillText("High", centerX, centerY - 10);
|
|
1249
|
+
ctx.font = "13px Arial";
|
|
1250
|
+
ctx.fillText("Improve Chatbot Training Data", centerX, centerY + 20);
|
|
1251
|
+
ctx.restore();
|
|
1252
|
+
}
|
|
1253
|
+
};
|
|
1254
|
+
return /* @__PURE__ */ import_react32.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react32.default.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react32.default.createElement(import_react_chartjs_22.Doughnut, { data, options, plugins: [centerTextPlugin] }));
|
|
1214
1255
|
};
|
|
1215
1256
|
|
|
1216
1257
|
// src/Components/HorizontalBarChart.tsx
|
|
@@ -1224,14 +1265,14 @@ var HorizontalBarChart = (props) => {
|
|
|
1224
1265
|
datasets: [
|
|
1225
1266
|
{
|
|
1226
1267
|
data: [30, 10, 27, 40, 12, 24],
|
|
1227
|
-
backgroundColor: "#6298D5"
|
|
1268
|
+
backgroundColor: "#6298D5",
|
|
1269
|
+
barThickness: 20
|
|
1228
1270
|
}
|
|
1229
1271
|
]
|
|
1230
1272
|
};
|
|
1231
1273
|
const options = {
|
|
1232
1274
|
responsive: true,
|
|
1233
1275
|
indexAxis: "y",
|
|
1234
|
-
// This specifies that the bar chart is horizontal
|
|
1235
1276
|
scales: {
|
|
1236
1277
|
x: {
|
|
1237
1278
|
beginAtZero: true,
|
|
@@ -1244,7 +1285,6 @@ var HorizontalBarChart = (props) => {
|
|
|
1244
1285
|
y: {
|
|
1245
1286
|
grid: {
|
|
1246
1287
|
display: false
|
|
1247
|
-
// Hide y-axis grid lines
|
|
1248
1288
|
}
|
|
1249
1289
|
}
|
|
1250
1290
|
},
|
|
@@ -1261,11 +1301,10 @@ var HorizontalBarChart = (props) => {
|
|
|
1261
1301
|
},
|
|
1262
1302
|
legend: {
|
|
1263
1303
|
display: false
|
|
1264
|
-
// Hide the legend
|
|
1265
1304
|
}
|
|
1266
1305
|
}
|
|
1267
1306
|
};
|
|
1268
|
-
return /* @__PURE__ */ import_react33.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react33.default.createElement(import_react_chartjs_23.Bar, { data, options }));
|
|
1307
|
+
return /* @__PURE__ */ import_react33.default.createElement("div", { className: props.className }, /* @__PURE__ */ import_react33.default.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ import_react33.default.createElement(import_react_chartjs_23.Bar, { data, options }));
|
|
1269
1308
|
};
|
|
1270
1309
|
|
|
1271
1310
|
// src/Components/LineChart.tsx
|
|
@@ -1295,6 +1334,8 @@ var LineChart = (props) => {
|
|
|
1295
1334
|
datasets: data.map((dataset, index) => ({
|
|
1296
1335
|
label: dataset.label,
|
|
1297
1336
|
data: dataset.data,
|
|
1337
|
+
borderColor: index === 0 ? "blue" : index === 1 ? "green" : "yellow",
|
|
1338
|
+
// Custom line colors
|
|
1298
1339
|
backgroundColor: index === 0 ? "blue" : index === 1 ? "green" : "yellow",
|
|
1299
1340
|
// Circle color in legend
|
|
1300
1341
|
pointBackgroundColor: "white",
|
package/dist/index.mjs
CHANGED
|
@@ -1041,29 +1041,38 @@ import {
|
|
|
1041
1041
|
ChartJS.register(DoughnutController, ArcElement, Tooltip, Legend);
|
|
1042
1042
|
var CircleDonut = (props) => {
|
|
1043
1043
|
const data = {
|
|
1044
|
-
labels: [
|
|
1044
|
+
labels: [
|
|
1045
|
+
"Registration",
|
|
1046
|
+
"Book Appointment",
|
|
1047
|
+
"Diagnostic Tests",
|
|
1048
|
+
"Hospital Facility",
|
|
1049
|
+
"Others, Prescriptions"
|
|
1050
|
+
],
|
|
1045
1051
|
datasets: [
|
|
1046
1052
|
{
|
|
1047
1053
|
label: "Bot Conversation",
|
|
1048
|
-
data: [30, 10, 27, 40, 12
|
|
1054
|
+
data: [30, 10, 27, 40, 12],
|
|
1049
1055
|
backgroundColor: [
|
|
1050
1056
|
"#FFCB8A",
|
|
1051
1057
|
"#CADBBF",
|
|
1052
1058
|
"#8AC1BB",
|
|
1053
1059
|
"#FCB0CB",
|
|
1054
|
-
"#CEB0FA"
|
|
1055
|
-
|
|
1056
|
-
|
|
1060
|
+
"#CEB0FA"
|
|
1061
|
+
],
|
|
1062
|
+
borderWidth: 0
|
|
1057
1063
|
}
|
|
1058
1064
|
]
|
|
1059
1065
|
};
|
|
1060
1066
|
const options = {
|
|
1061
1067
|
responsive: true,
|
|
1062
|
-
|
|
1068
|
+
cutout: "80%",
|
|
1063
1069
|
plugins: {
|
|
1064
1070
|
legend: {
|
|
1065
1071
|
position: "left",
|
|
1066
1072
|
labels: {
|
|
1073
|
+
font: {
|
|
1074
|
+
size: 10
|
|
1075
|
+
},
|
|
1067
1076
|
boxWidth: 15,
|
|
1068
1077
|
generateLabels: (chart) => {
|
|
1069
1078
|
const dataset = chart.data.datasets[0];
|
|
@@ -1089,7 +1098,27 @@ var CircleDonut = (props) => {
|
|
|
1089
1098
|
}
|
|
1090
1099
|
}
|
|
1091
1100
|
};
|
|
1092
|
-
|
|
1101
|
+
const centerTextPlugin = {
|
|
1102
|
+
id: "centerText",
|
|
1103
|
+
beforeDraw: (chart) => {
|
|
1104
|
+
const { ctx, chartArea: { left, right, top, bottom } } = chart;
|
|
1105
|
+
const width = right - left;
|
|
1106
|
+
const height = bottom - top;
|
|
1107
|
+
const centerX = left + width / 2;
|
|
1108
|
+
const centerY = top + height / 2;
|
|
1109
|
+
ctx.save();
|
|
1110
|
+
ctx.font = "10px Arial";
|
|
1111
|
+
ctx.fillStyle = "blue";
|
|
1112
|
+
ctx.textAlign = "center";
|
|
1113
|
+
ctx.textBaseline = "middle";
|
|
1114
|
+
ctx.fillText("Total Sessions", centerX, centerY - 10);
|
|
1115
|
+
ctx.font = "30px Arial";
|
|
1116
|
+
ctx.fillStyle = "black";
|
|
1117
|
+
ctx.fillText("85", centerX, centerY + 20);
|
|
1118
|
+
ctx.restore();
|
|
1119
|
+
}
|
|
1120
|
+
};
|
|
1121
|
+
return /* @__PURE__ */ React31.createElement("div", { className: props.className }, /* @__PURE__ */ React31.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React31.createElement(Doughnut, { data, options, plugins: [centerTextPlugin] }));
|
|
1093
1122
|
};
|
|
1094
1123
|
|
|
1095
1124
|
// src/Components/SemiCircleDonut.tsx
|
|
@@ -1105,19 +1134,25 @@ import {
|
|
|
1105
1134
|
ChartJS2.register(DoughnutController2, ArcElement2, Tooltip2, Legend2);
|
|
1106
1135
|
var SemiCircleDonut = (props) => {
|
|
1107
1136
|
const data = {
|
|
1108
|
-
labels: [
|
|
1137
|
+
labels: [
|
|
1138
|
+
"Registration",
|
|
1139
|
+
"Book Appointment",
|
|
1140
|
+
"Diagnostic Tests",
|
|
1141
|
+
"Hospital Facility",
|
|
1142
|
+
"Others, Prescriptions"
|
|
1143
|
+
],
|
|
1109
1144
|
datasets: [
|
|
1110
1145
|
{
|
|
1111
1146
|
label: "Bot Conversation",
|
|
1112
|
-
data: [30, 10, 27, 40, 12
|
|
1147
|
+
data: [30, 10, 27, 40, 12],
|
|
1113
1148
|
backgroundColor: [
|
|
1114
1149
|
"#FFCB8A",
|
|
1115
1150
|
"#CADBBF",
|
|
1116
1151
|
"#8AC1BB",
|
|
1117
1152
|
"#FCB0CB",
|
|
1118
|
-
"#CEB0FA"
|
|
1119
|
-
|
|
1120
|
-
|
|
1153
|
+
"#CEB0FA"
|
|
1154
|
+
],
|
|
1155
|
+
borderWidth: 0
|
|
1121
1156
|
}
|
|
1122
1157
|
]
|
|
1123
1158
|
};
|
|
@@ -1125,24 +1160,11 @@ var SemiCircleDonut = (props) => {
|
|
|
1125
1160
|
responsive: true,
|
|
1126
1161
|
circumference: 180,
|
|
1127
1162
|
rotation: -90,
|
|
1163
|
+
cutout: "80%",
|
|
1128
1164
|
plugins: {
|
|
1129
1165
|
legend: {
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
boxWidth: 15,
|
|
1133
|
-
generateLabels: (chart) => {
|
|
1134
|
-
const dataset = chart.data.datasets[0];
|
|
1135
|
-
return chart.data.labels.map((label, index) => {
|
|
1136
|
-
const value = dataset.data[index];
|
|
1137
|
-
return {
|
|
1138
|
-
text: `${label}: ${value}`,
|
|
1139
|
-
fillStyle: dataset.backgroundColor[index],
|
|
1140
|
-
hidden: isNaN(dataset.data[index]) || dataset.data[index] === null,
|
|
1141
|
-
index
|
|
1142
|
-
};
|
|
1143
|
-
});
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1166
|
+
display: false
|
|
1167
|
+
// Disable the legend
|
|
1146
1168
|
},
|
|
1147
1169
|
tooltip: {
|
|
1148
1170
|
enabled: true,
|
|
@@ -1156,7 +1178,26 @@ var SemiCircleDonut = (props) => {
|
|
|
1156
1178
|
}
|
|
1157
1179
|
}
|
|
1158
1180
|
};
|
|
1159
|
-
|
|
1181
|
+
const centerTextPlugin = {
|
|
1182
|
+
id: "centerText",
|
|
1183
|
+
beforeDraw: (chart) => {
|
|
1184
|
+
const { ctx, chartArea: { left, right, top, bottom } } = chart;
|
|
1185
|
+
const width = right - left;
|
|
1186
|
+
const height = bottom - top;
|
|
1187
|
+
const centerX = left + width / 2;
|
|
1188
|
+
const centerY = top + height / 1.5;
|
|
1189
|
+
ctx.save();
|
|
1190
|
+
ctx.font = "30px Arial";
|
|
1191
|
+
ctx.fillStyle = "black";
|
|
1192
|
+
ctx.textAlign = "center";
|
|
1193
|
+
ctx.textBaseline = "middle";
|
|
1194
|
+
ctx.fillText("High", centerX, centerY - 10);
|
|
1195
|
+
ctx.font = "13px Arial";
|
|
1196
|
+
ctx.fillText("Improve Chatbot Training Data", centerX, centerY + 20);
|
|
1197
|
+
ctx.restore();
|
|
1198
|
+
}
|
|
1199
|
+
};
|
|
1200
|
+
return /* @__PURE__ */ React32.createElement("div", { className: props.className }, /* @__PURE__ */ React32.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React32.createElement(Doughnut2, { data, options, plugins: [centerTextPlugin] }));
|
|
1160
1201
|
};
|
|
1161
1202
|
|
|
1162
1203
|
// src/Components/HorizontalBarChart.tsx
|
|
@@ -1176,14 +1217,14 @@ var HorizontalBarChart = (props) => {
|
|
|
1176
1217
|
datasets: [
|
|
1177
1218
|
{
|
|
1178
1219
|
data: [30, 10, 27, 40, 12, 24],
|
|
1179
|
-
backgroundColor: "#6298D5"
|
|
1220
|
+
backgroundColor: "#6298D5",
|
|
1221
|
+
barThickness: 20
|
|
1180
1222
|
}
|
|
1181
1223
|
]
|
|
1182
1224
|
};
|
|
1183
1225
|
const options = {
|
|
1184
1226
|
responsive: true,
|
|
1185
1227
|
indexAxis: "y",
|
|
1186
|
-
// This specifies that the bar chart is horizontal
|
|
1187
1228
|
scales: {
|
|
1188
1229
|
x: {
|
|
1189
1230
|
beginAtZero: true,
|
|
@@ -1196,7 +1237,6 @@ var HorizontalBarChart = (props) => {
|
|
|
1196
1237
|
y: {
|
|
1197
1238
|
grid: {
|
|
1198
1239
|
display: false
|
|
1199
|
-
// Hide y-axis grid lines
|
|
1200
1240
|
}
|
|
1201
1241
|
}
|
|
1202
1242
|
},
|
|
@@ -1213,11 +1253,10 @@ var HorizontalBarChart = (props) => {
|
|
|
1213
1253
|
},
|
|
1214
1254
|
legend: {
|
|
1215
1255
|
display: false
|
|
1216
|
-
// Hide the legend
|
|
1217
1256
|
}
|
|
1218
1257
|
}
|
|
1219
1258
|
};
|
|
1220
|
-
return /* @__PURE__ */ React33.createElement("div", { className: props.className }, /* @__PURE__ */ React33.createElement(Bar, { data, options }));
|
|
1259
|
+
return /* @__PURE__ */ React33.createElement("div", { className: props.className }, /* @__PURE__ */ React33.createElement("h1", { className: props.labelClassName }, props.label), /* @__PURE__ */ React33.createElement(Bar, { data, options }));
|
|
1221
1260
|
};
|
|
1222
1261
|
|
|
1223
1262
|
// src/Components/LineChart.tsx
|
|
@@ -1247,6 +1286,8 @@ var LineChart = (props) => {
|
|
|
1247
1286
|
datasets: data.map((dataset, index) => ({
|
|
1248
1287
|
label: dataset.label,
|
|
1249
1288
|
data: dataset.data,
|
|
1289
|
+
borderColor: index === 0 ? "blue" : index === 1 ? "green" : "yellow",
|
|
1290
|
+
// Custom line colors
|
|
1250
1291
|
backgroundColor: index === 0 ? "blue" : index === 1 ? "green" : "yellow",
|
|
1251
1292
|
// Circle color in legend
|
|
1252
1293
|
pointBackgroundColor: "white",
|