@empoweredvote/ev-ui 0.8.7 → 0.8.9
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 +21 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -111,7 +111,11 @@ function RadarChartCore({
|
|
|
111
111
|
writeIns = {},
|
|
112
112
|
darkMode = false,
|
|
113
113
|
lineColor,
|
|
114
|
-
ringColor
|
|
114
|
+
ringColor,
|
|
115
|
+
// replacedSpokes: short_titles of substitute spokes (not the user's original defaults)
|
|
116
|
+
replacedSpokes = {},
|
|
117
|
+
// boldOriginalSpokes: when true, bold spokes that are NOT replacements
|
|
118
|
+
boldOriginalSpokes = false
|
|
115
119
|
}) {
|
|
116
120
|
var _a;
|
|
117
121
|
const radius = size / 2 - 40;
|
|
@@ -292,6 +296,8 @@ function RadarChartCore({
|
|
|
292
296
|
if (isTop && lines.length > 1) labelY -= (lines.length - 1) * lineHeight;
|
|
293
297
|
const isActive = shortTitle === activeSpoke;
|
|
294
298
|
const isUnansweredLabel = !!unansweredSpokes[shortTitle];
|
|
299
|
+
const isReplaced = !!replacedSpokes[shortTitle];
|
|
300
|
+
const shouldBold = boldOriginalSpokes && !isReplaced;
|
|
295
301
|
const fSize = labelFontSize;
|
|
296
302
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
297
303
|
"text",
|
|
@@ -303,7 +309,7 @@ function RadarChartCore({
|
|
|
303
309
|
dominantBaseline: isBottom ? "hanging" : "auto",
|
|
304
310
|
onClick: () => onReplaceTopic(shortTitle),
|
|
305
311
|
fill: isActive ? "#E85D26" : isUnansweredLabel ? "#9ca3af" : darkMode ? "#D3D7DE" : "#555",
|
|
306
|
-
fontWeight: isActive ? "bold" : "normal",
|
|
312
|
+
fontWeight: isActive || shouldBold ? "bold" : "normal",
|
|
307
313
|
style: { cursor: "pointer", userSelect: "none", fontSize: fSize, fontFamily: "sans-serif" }
|
|
308
314
|
},
|
|
309
315
|
isUnansweredLabel && /* @__PURE__ */ import_react.default.createElement("title", null, "No stance on file for this topic."),
|
|
@@ -350,14 +356,24 @@ function RadarChartCore({
|
|
|
350
356
|
{
|
|
351
357
|
key: "compare-static",
|
|
352
358
|
points: comparePoints,
|
|
353
|
-
style: {
|
|
359
|
+
style: {
|
|
360
|
+
fill: darkMode ? "rgba(110, 210, 140, 0.55)" : "rgba(90, 154, 110, 0.45)",
|
|
361
|
+
stroke: darkMode ? "#6DD28C" : "#5A9A6E",
|
|
362
|
+
strokeWidth: 2,
|
|
363
|
+
mixBlendMode: darkMode ? "normal" : "multiply"
|
|
364
|
+
}
|
|
354
365
|
}
|
|
355
366
|
) : /* @__PURE__ */ import_react.default.createElement(
|
|
356
367
|
import_web.animated.polygon,
|
|
357
368
|
{
|
|
358
369
|
key: "compare-animated",
|
|
359
370
|
points: compareSpring.points,
|
|
360
|
-
style: {
|
|
371
|
+
style: {
|
|
372
|
+
fill: darkMode ? "rgba(110, 210, 140, 0.55)" : "rgba(90, 154, 110, 0.45)",
|
|
373
|
+
stroke: darkMode ? "#6DD28C" : "#5A9A6E",
|
|
374
|
+
strokeWidth: 2,
|
|
375
|
+
mixBlendMode: darkMode ? "normal" : "multiply"
|
|
376
|
+
}
|
|
361
377
|
}
|
|
362
378
|
) : null,
|
|
363
379
|
hasCompareData && compareCoords && compareCoords.map(([cx, cy], i) => {
|
|
@@ -373,7 +389,7 @@ function RadarChartCore({
|
|
|
373
389
|
cx,
|
|
374
390
|
cy,
|
|
375
391
|
r: matches ? 8 : 7,
|
|
376
|
-
fill: matches ? "#fed12e" : "#5A9A6E",
|
|
392
|
+
fill: matches ? "#fed12e" : darkMode ? "#6DD28C" : "#5A9A6E",
|
|
377
393
|
stroke: "#FFFFFF",
|
|
378
394
|
strokeWidth: 3,
|
|
379
395
|
style: { pointerEvents: "none" }
|