@empoweredvote/ev-ui 0.8.5 → 0.8.7
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 +45 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +45 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -109,7 +109,9 @@ function RadarChartCore({
|
|
|
109
109
|
tightFit = false,
|
|
110
110
|
activeSpoke = null,
|
|
111
111
|
writeIns = {},
|
|
112
|
-
darkMode = false
|
|
112
|
+
darkMode = false,
|
|
113
|
+
lineColor,
|
|
114
|
+
ringColor
|
|
113
115
|
}) {
|
|
114
116
|
var _a;
|
|
115
117
|
const radius = size / 2 - 40;
|
|
@@ -221,7 +223,7 @@ function RadarChartCore({
|
|
|
221
223
|
ring.push(`${centerX + radius * scale * Math.sin(angle)},${centerY - radius * scale * Math.cos(angle)}`);
|
|
222
224
|
}
|
|
223
225
|
guidePolygons.push(
|
|
224
|
-
/* @__PURE__ */ import_react.default.createElement("polygon", { key: level, points: ring.join(" "), fill: "none", stroke: darkMode ? "#555" : "#ccc" })
|
|
226
|
+
/* @__PURE__ */ import_react.default.createElement("polygon", { key: level, points: ring.join(" "), fill: "none", stroke: ringColor != null ? ringColor : darkMode ? "#555" : "#ccc" })
|
|
225
227
|
);
|
|
226
228
|
}
|
|
227
229
|
const getStanceText = (shortTitle, value) => {
|
|
@@ -258,7 +260,7 @@ function RadarChartCore({
|
|
|
258
260
|
y1: centerY,
|
|
259
261
|
x2: endX,
|
|
260
262
|
y2: endY,
|
|
261
|
-
stroke: isUnanswered ? "#9ca3af" : darkMode ? "#bbb" : "#888",
|
|
263
|
+
stroke: isUnanswered ? "#9ca3af" : lineColor != null ? lineColor : darkMode ? "#bbb" : "#888",
|
|
262
264
|
strokeDasharray: isUnanswered ? "4 3" : void 0,
|
|
263
265
|
opacity: isUnanswered ? 0.6 : 1
|
|
264
266
|
}
|
|
@@ -339,9 +341,7 @@ function RadarChartCore({
|
|
|
339
341
|
fill: matches ? "#fed12e" : "#7C6B9E",
|
|
340
342
|
stroke: "#FFFFFF",
|
|
341
343
|
strokeWidth: 3,
|
|
342
|
-
style: {
|
|
343
|
-
onMouseEnter: () => setTooltip({ x: cx, y: cy, text: getStanceText(shortTitle, userVal) }),
|
|
344
|
-
onMouseLeave: () => setTooltip(null)
|
|
344
|
+
style: { pointerEvents: "none" }
|
|
345
345
|
}
|
|
346
346
|
);
|
|
347
347
|
}),
|
|
@@ -376,9 +376,7 @@ function RadarChartCore({
|
|
|
376
376
|
fill: matches ? "#fed12e" : "#5A9A6E",
|
|
377
377
|
stroke: "#FFFFFF",
|
|
378
378
|
strokeWidth: 3,
|
|
379
|
-
style: {
|
|
380
|
-
onMouseEnter: () => setTooltip({ x: cx, y: cy, text: getStanceText(shortTitle, compareVal) }),
|
|
381
|
-
onMouseLeave: () => setTooltip(null)
|
|
379
|
+
style: { pointerEvents: "none" }
|
|
382
380
|
}
|
|
383
381
|
);
|
|
384
382
|
}),
|
|
@@ -402,6 +400,44 @@ function RadarChartCore({
|
|
|
402
400
|
}
|
|
403
401
|
);
|
|
404
402
|
}),
|
|
403
|
+
pointsArr.map(([cx, cy], i) => {
|
|
404
|
+
const shortTitle = spokes[i][0];
|
|
405
|
+
const userVal = spokes[i][1];
|
|
406
|
+
if (!userVal || Number(userVal) === 0) return null;
|
|
407
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
408
|
+
"circle",
|
|
409
|
+
{
|
|
410
|
+
key: `user-sensor-${i}`,
|
|
411
|
+
cx,
|
|
412
|
+
cy,
|
|
413
|
+
r: 14,
|
|
414
|
+
fill: "transparent",
|
|
415
|
+
stroke: "none",
|
|
416
|
+
style: { cursor: "default" },
|
|
417
|
+
onMouseEnter: () => setTooltip({ x: cx, y: cy, text: getStanceText(shortTitle, userVal) }),
|
|
418
|
+
onMouseLeave: () => setTooltip(null)
|
|
419
|
+
}
|
|
420
|
+
);
|
|
421
|
+
}),
|
|
422
|
+
hasCompareData && compareCoords && compareCoords.map(([cx, cy], i) => {
|
|
423
|
+
const shortTitle = spokes[i][0];
|
|
424
|
+
const compareVal = compareData[shortTitle];
|
|
425
|
+
if (!compareVal || Number(compareVal) === 0) return null;
|
|
426
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
427
|
+
"circle",
|
|
428
|
+
{
|
|
429
|
+
key: `compare-sensor-${i}`,
|
|
430
|
+
cx,
|
|
431
|
+
cy,
|
|
432
|
+
r: 14,
|
|
433
|
+
fill: "transparent",
|
|
434
|
+
stroke: "none",
|
|
435
|
+
style: { cursor: "default" },
|
|
436
|
+
onMouseEnter: () => setTooltip({ x: cx, y: cy, text: getStanceText(shortTitle, compareVal) }),
|
|
437
|
+
onMouseLeave: () => setTooltip(null)
|
|
438
|
+
}
|
|
439
|
+
);
|
|
440
|
+
}),
|
|
405
441
|
tooltip && (() => {
|
|
406
442
|
const tipW = 190;
|
|
407
443
|
const tipH = 70;
|