layerchart 0.93.5 → 0.93.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.
@@ -71,10 +71,10 @@
71
71
  export let innerRadius: number | undefined = undefined;
72
72
 
73
73
  /**
74
- * Define outerRadius. Defaults to smallest width (xRange) or height (yRange) dimension (/ 2)
74
+ * Define outerRadius. Defaults to smallest width (xRange) or height (yRange) dimension (/2)
75
75
  * • value >= 1: discrete value
76
- * • value < 1: percent of chart height / 2
77
- * • value < 0: offset of chart height / 2
76
+ * • value < 1: percent of chart width or height (smallest) / 2
77
+ * • value < 0: offset of chart width or height (smallest) / 2
78
78
  */
79
79
  export let outerRadius: number | undefined = undefined;
80
80
 
@@ -144,6 +144,15 @@
144
144
  e.stopPropagation();
145
145
 
146
146
  const startPoint = localPoint(rootEl, e);
147
+
148
+ if (
149
+ startPoint &&
150
+ (startPoint.x < 0 || startPoint.x > $width || startPoint.y < 0 || startPoint.y > $height)
151
+ ) {
152
+ logger.debug('ignoring click as outside of chart bounds', { startPoint, $width, $height });
153
+ return;
154
+ }
155
+
147
156
  const start = {
148
157
  xDomain: [xDomain?.[0] ?? xDomainMin, xDomain?.[1] ?? xDomainMax] as [number, number],
149
158
  yDomain: [yDomain?.[0] ?? yDomainMin, yDomain?.[1] ?? yDomainMax] as [number, number],
@@ -153,7 +153,7 @@
153
153
  context = element?.getContext('2d', { willReadFrequently }) as CanvasRenderingContext2D;
154
154
 
155
155
  hitCanvasContext = hitCanvasElement?.getContext('2d', {
156
- willReadFrequently: true,
156
+ willReadFrequently: false, // Explicitly set to `false` to resolve pixel artifacts between fill and stroke with the same color (issue #372)
157
157
  }) as CanvasRenderingContext2D;
158
158
  });
159
159
 
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "author": "Sean Lynch <techniq35@gmail.com>",
5
5
  "license": "MIT",
6
6
  "repository": "techniq/layerchart",
7
- "version": "0.93.5",
7
+ "version": "0.93.7",
8
8
  "devDependencies": {
9
9
  "@changesets/cli": "^2.27.12",
10
10
  "@mdi/js": "^7.4.47",