@empoweredvote/ev-ui 0.4.3 → 0.4.5
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 +39 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -133,8 +133,9 @@ function RadarChartCore({
|
|
|
133
133
|
const hasCompareData = Object.keys(compareData).length > 0;
|
|
134
134
|
const centerPoints = spokes.map(() => `${centerX},${centerY}`).join(" ");
|
|
135
135
|
let comparePoints = null;
|
|
136
|
+
let compareCoords = null;
|
|
136
137
|
if (hasCompareData) {
|
|
137
|
-
const
|
|
138
|
+
const ccoords = spokes.map(([shortTitle], index) => {
|
|
138
139
|
var _a, _b;
|
|
139
140
|
const value = (_a = compareData[shortTitle]) != null ? _a : 0;
|
|
140
141
|
const topic = topics.find((t) => t.short_title === shortTitle);
|
|
@@ -145,9 +146,10 @@ function RadarChartCore({
|
|
|
145
146
|
const r = adjusted / 10 * radius;
|
|
146
147
|
const x = centerX + r * Math.sin(angle);
|
|
147
148
|
const y = centerY - r * Math.cos(angle);
|
|
148
|
-
return
|
|
149
|
+
return [x, y];
|
|
149
150
|
});
|
|
150
|
-
|
|
151
|
+
compareCoords = ccoords;
|
|
152
|
+
comparePoints = ccoords.map((p) => p.join(",")).join(" ");
|
|
151
153
|
}
|
|
152
154
|
const hadCompareDataRef = (0, import_react2.useRef)(false);
|
|
153
155
|
const compareJustAppeared = hasCompareData && !hadCompareDataRef.current;
|
|
@@ -281,8 +283,8 @@ function RadarChartCore({
|
|
|
281
283
|
key: "user-static",
|
|
282
284
|
points: targetPoints,
|
|
283
285
|
style: {
|
|
284
|
-
fill: "rgba(
|
|
285
|
-
stroke: "
|
|
286
|
+
fill: "rgba(124, 107, 158, 0.4)",
|
|
287
|
+
stroke: "#7C6B9E",
|
|
286
288
|
strokeWidth: 3
|
|
287
289
|
}
|
|
288
290
|
}
|
|
@@ -292,20 +294,32 @@ function RadarChartCore({
|
|
|
292
294
|
key: "user-animated",
|
|
293
295
|
points: spring.points,
|
|
294
296
|
style: {
|
|
295
|
-
fill: "rgba(
|
|
296
|
-
stroke: "
|
|
297
|
+
fill: "rgba(124, 107, 158, 0.4)",
|
|
298
|
+
stroke: "#7C6B9E",
|
|
297
299
|
strokeWidth: 3
|
|
298
300
|
}
|
|
299
301
|
}
|
|
300
302
|
),
|
|
303
|
+
pointsArr.map(([cx, cy], i) => /* @__PURE__ */ import_react.default.createElement(
|
|
304
|
+
"circle",
|
|
305
|
+
{
|
|
306
|
+
key: `user-dot-${i}`,
|
|
307
|
+
cx,
|
|
308
|
+
cy,
|
|
309
|
+
r: 5,
|
|
310
|
+
fill: "#7C6B9E",
|
|
311
|
+
stroke: "#FFFFFF",
|
|
312
|
+
strokeWidth: 2
|
|
313
|
+
}
|
|
314
|
+
)),
|
|
301
315
|
hasCompareData && comparePoints ? countChanged || compareJustAppeared ? /* @__PURE__ */ import_react.default.createElement(
|
|
302
316
|
"polygon",
|
|
303
317
|
{
|
|
304
318
|
key: "compare-static",
|
|
305
319
|
points: comparePoints,
|
|
306
320
|
style: {
|
|
307
|
-
fill: "rgba(
|
|
308
|
-
stroke: "
|
|
321
|
+
fill: "rgba(90, 154, 110, 0.3)",
|
|
322
|
+
stroke: "#5A9A6E",
|
|
309
323
|
strokeWidth: 2
|
|
310
324
|
}
|
|
311
325
|
}
|
|
@@ -315,12 +329,24 @@ function RadarChartCore({
|
|
|
315
329
|
key: "compare-animated",
|
|
316
330
|
points: compareSpring.points,
|
|
317
331
|
style: {
|
|
318
|
-
fill: "rgba(
|
|
319
|
-
stroke: "
|
|
332
|
+
fill: "rgba(90, 154, 110, 0.3)",
|
|
333
|
+
stroke: "#5A9A6E",
|
|
320
334
|
strokeWidth: 2
|
|
321
335
|
}
|
|
322
336
|
}
|
|
323
337
|
) : null,
|
|
338
|
+
hasCompareData && compareCoords && compareCoords.map(([cx, cy], i) => /* @__PURE__ */ import_react.default.createElement(
|
|
339
|
+
"circle",
|
|
340
|
+
{
|
|
341
|
+
key: `compare-dot-${i}`,
|
|
342
|
+
cx,
|
|
343
|
+
cy,
|
|
344
|
+
r: 4,
|
|
345
|
+
fill: "#5A9A6E",
|
|
346
|
+
stroke: "#FFFFFF",
|
|
347
|
+
strokeWidth: 2
|
|
348
|
+
}
|
|
349
|
+
)),
|
|
324
350
|
spokes.map(([shortTitle], i) => {
|
|
325
351
|
const angle = 2 * Math.PI * i / numSpokes;
|
|
326
352
|
const x = centerX + radius * Math.sin(angle);
|
|
@@ -1596,7 +1622,8 @@ function PoliticianCard({
|
|
|
1596
1622
|
},
|
|
1597
1623
|
imageWrapper: {
|
|
1598
1624
|
width: isHorizontal ? "90px" : "100%",
|
|
1599
|
-
height: isHorizontal ?
|
|
1625
|
+
height: isHorizontal ? "100%" : "auto",
|
|
1626
|
+
maxHeight: isHorizontal ? "200px" : void 0,
|
|
1600
1627
|
aspectRatio: isHorizontal ? void 0 : "4/5",
|
|
1601
1628
|
flexShrink: 0,
|
|
1602
1629
|
overflow: "hidden"
|