layerchart 2.0.0-next.20 → 2.0.0-next.22

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.
@@ -55,7 +55,7 @@
55
55
  <script lang="ts">
56
56
  import { min } from 'd3-array';
57
57
  import { Delaunay } from 'd3-delaunay';
58
- // @ts-expect-error
58
+ // @ts-expect-error - no types available
59
59
  import { geoVoronoi } from 'd3-geo-voronoi';
60
60
  import { curveLinearClosed } from 'd3-shape';
61
61
  import { cls } from '@layerstack/tailwind';
@@ -270,7 +270,7 @@
270
270
  }
271
271
  }
272
272
 
273
- function showTooltip(e: PointerEvent, tooltipData?: any) {
273
+ function showTooltip(e: PointerEvent | MouseEvent | TouchEvent, tooltipData?: any) {
274
274
  // Cancel hiding tooltip if from previous event loop
275
275
  if (hideTimeoutId) {
276
276
  clearTimeout(hideTimeoutId);
@@ -511,6 +511,24 @@
511
511
  const triggerPointerEvents = $derived(
512
512
  ['bisect-x', 'bisect-y', 'bisect-band', 'quadtree'].includes(mode)
513
513
  );
514
+
515
+ function onPointerEnter(e: PointerEvent | MouseEvent | TouchEvent) {
516
+ isHoveringTooltipArea = true;
517
+ if (triggerPointerEvents) {
518
+ showTooltip(e);
519
+ }
520
+ }
521
+
522
+ function onPointerMove(e: PointerEvent | MouseEvent | TouchEvent) {
523
+ if (triggerPointerEvents) {
524
+ showTooltip(e);
525
+ }
526
+ }
527
+
528
+ function onPointerLeave(e: PointerEvent | MouseEvent | TouchEvent) {
529
+ isHoveringTooltipArea = false;
530
+ hideTooltip();
531
+ }
514
532
  </script>
515
533
 
516
534
  <!-- svelte-ignore a11y_no_static_element_interactions -->
@@ -521,25 +539,15 @@
521
539
  style:height="{ctx.height}px"
522
540
  class={cls(
523
541
  layerClass('tooltip-context'),
524
- 'absolute touch-none',
542
+ 'absolute',
525
543
  debug && triggerPointerEvents && 'bg-danger/10 outline outline-danger'
526
544
  )}
527
- onpointerenter={(e) => {
528
- isHoveringTooltipArea = true;
529
- if (triggerPointerEvents) {
530
- showTooltip(e);
531
- }
532
- }}
533
- onpointermove={(e) => {
534
- if (triggerPointerEvents) {
535
- showTooltip(e);
536
- }
537
- }}
538
- onpointerleave={(e) => {
539
- isHoveringTooltipArea = false;
540
-
541
- hideTooltip();
542
- }}
545
+ onmouseenter={onPointerEnter}
546
+ ontouchstart={onPointerEnter}
547
+ onmousemove={onPointerMove}
548
+ ontouchmove={onPointerMove}
549
+ onmouseleave={onPointerLeave}
550
+ ontouchend={onPointerLeave}
543
551
  onclick={(e) => {
544
552
  // Ignore clicks without data (triggered from Legend clicks, for example)
545
553
  if (triggerPointerEvents && tooltipContext.data != null) {
package/package.json CHANGED
@@ -4,19 +4,19 @@
4
4
  "author": "Sean Lynch <techniq35@gmail.com>",
5
5
  "license": "MIT",
6
6
  "repository": "techniq/layerchart",
7
- "version": "2.0.0-next.20",
7
+ "version": "2.0.0-next.22",
8
8
  "devDependencies": {
9
9
  "@changesets/cli": "^2.29.4",
10
- "@iconify-json/lucide": "^1.2.44",
10
+ "@iconify-json/lucide": "^1.2.48",
11
11
  "@mdi/js": "^7.4.47",
12
12
  "@rollup/plugin-dsv": "^3.0.5",
13
- "@sveltejs/adapter-cloudflare": "^7.0.3",
14
- "@sveltejs/kit": "^2.21.1",
13
+ "@sveltejs/adapter-cloudflare": "^7.0.4",
14
+ "@sveltejs/kit": "^2.21.5",
15
15
  "@sveltejs/package": "^2.3.11",
16
- "@sveltejs/vite-plugin-svelte": "^5.0.3",
16
+ "@sveltejs/vite-plugin-svelte": "^5.1.0",
17
17
  "@svitejs/changesets-changelog-github-compact": "^1.2.0",
18
18
  "@tailwindcss/typography": "^0.5.16",
19
- "@tailwindcss/vite": "^4.1.7",
19
+ "@tailwindcss/vite": "^4.1.10",
20
20
  "@types/d3": "^7.4.3",
21
21
  "@types/d3-array": "^3.2.1",
22
22
  "@types/d3-color": "^3.1.3",
@@ -41,9 +41,9 @@
41
41
  "@types/topojson-client": "^3.1.5",
42
42
  "@types/topojson-simplify": "^3.0.3",
43
43
  "@types/topojson-specification": "^1.0.5",
44
- "marked": "^15.0.11",
44
+ "marked": "^15.0.12",
45
45
  "mdsvex": "^0.12.3",
46
- "posthog-js": "^1.245.1",
46
+ "posthog-js": "^1.252.0",
47
47
  "prettier": "^3.5.3",
48
48
  "prettier-plugin-svelte": "^3.4.0",
49
49
  "prism-svelte": "^0.5.0",
@@ -53,12 +53,12 @@
53
53
  "rollup-plugin-visualizer": "^6.0.3",
54
54
  "shapefile": "^0.6.6",
55
55
  "solar-calculator": "^0.3.0",
56
- "svelte": "5.32.1",
56
+ "svelte": "5.34.1",
57
57
  "svelte-check": "^4.2.1",
58
58
  "svelte-json-tree": "^2.2.0",
59
- "svelte-ux": "2.0.0-next.8",
59
+ "svelte-ux": "2.0.0-next.11",
60
60
  "svelte2tsx": "^0.7.39",
61
- "tailwindcss": "^4.1.7",
61
+ "tailwindcss": "^4.1.10",
62
62
  "topojson-client": "^3.1.0",
63
63
  "topojson-simplify": "^3.0.3",
64
64
  "tslib": "^2.8.1",
@@ -67,16 +67,16 @@
67
67
  "unplugin-icons": "^22.1.0",
68
68
  "us-atlas": "^3.0.1",
69
69
  "vite": "^6.3.5",
70
- "vite-plugin-devtools-json": "^0.1.0",
71
- "vitest": "^3.1.4"
70
+ "vite-plugin-devtools-json": "^0.2.0",
71
+ "vitest": "^3.2.3"
72
72
  },
73
73
  "type": "module",
74
74
  "dependencies": {
75
75
  "@dagrejs/dagre": "^1.1.4",
76
- "@layerstack/svelte-actions": "1.0.1-next.11",
77
- "@layerstack/svelte-state": "0.1.0-next.16",
78
- "@layerstack/tailwind": "2.0.0-next.13",
79
- "@layerstack/utils": "2.0.0-next.11",
76
+ "@layerstack/svelte-actions": "1.0.1-next.12",
77
+ "@layerstack/svelte-state": "0.1.0-next.17",
78
+ "@layerstack/tailwind": "2.0.0-next.15",
79
+ "@layerstack/utils": "2.0.0-next.12",
80
80
  "d3-array": "^3.2.4",
81
81
  "d3-color": "^3.1.0",
82
82
  "d3-delaunay": "^6.0.4",