@internetstiftelsen/charts 0.0.4 → 0.0.6
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/legend.js +5 -3
- package/package.json +1 -1
- package/theme.js +1 -1
- package/types.d.ts +1 -1
- package/y-axis.js +6 -1
package/legend.js
CHANGED
|
@@ -54,8 +54,10 @@ export class Legend {
|
|
|
54
54
|
return this.visibilityState.get(dataKey) ?? true;
|
|
55
55
|
}
|
|
56
56
|
getCheckmarkPath(size) {
|
|
57
|
-
const scale = size / 24;
|
|
58
|
-
|
|
57
|
+
const scale = (size / 24) * 0.7;
|
|
58
|
+
const offsetX = size * 0.15;
|
|
59
|
+
const offsetY = size * 0.15;
|
|
60
|
+
return `M ${4 * scale + offsetX} ${12 * scale + offsetY} L ${9 * scale + offsetX} ${17 * scale + offsetY} L ${20 * scale + offsetX} ${6 * scale + offsetY}`;
|
|
59
61
|
}
|
|
60
62
|
parseColor(color) {
|
|
61
63
|
// Handle hex colors
|
|
@@ -153,7 +155,7 @@ export class Legend {
|
|
|
153
155
|
const isVisible = this.visibilityState.get(d.dataKey) ?? true;
|
|
154
156
|
return isVisible ? d.color : theme.legend.uncheckedColor;
|
|
155
157
|
})
|
|
156
|
-
.attr('rx',
|
|
158
|
+
.attr('rx', 3);
|
|
157
159
|
// Add checkmark when visible
|
|
158
160
|
legendGroups
|
|
159
161
|
.append('path')
|
package/package.json
CHANGED
package/theme.js
CHANGED
package/types.d.ts
CHANGED
package/y-axis.js
CHANGED
|
@@ -42,7 +42,12 @@ export class YAxis {
|
|
|
42
42
|
const axis = axisLeft(y).tickSize(0).tickPadding(this.tickPadding);
|
|
43
43
|
// Apply tick formatting if specified
|
|
44
44
|
if (this.tickFormat) {
|
|
45
|
-
|
|
45
|
+
if (typeof this.tickFormat === 'function') {
|
|
46
|
+
axis.ticks(5).tickFormat(this.tickFormat);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
axis.ticks(5, this.tickFormat);
|
|
50
|
+
}
|
|
46
51
|
}
|
|
47
52
|
else {
|
|
48
53
|
axis.ticks(5);
|