layerchart 0.26.0 → 0.26.1

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.
@@ -24,9 +24,9 @@ let tooltipWidth = 0;
24
24
  let tooltipHeight = 0;
25
25
  const xPos = animate ? spring($tooltip.x) : writable($tooltip.x);
26
26
  const yPos = animate ? spring($tooltip.y) : writable($tooltip.y);
27
- function alignValue(value, align, tooltipSize) {
27
+ function alignValue(value, align, addlOffset, tooltipSize) {
28
28
  const alignOffset = align === 'center' ? tooltipSize / 2 : align === 'end' ? tooltipSize : 0;
29
- return value + (align === 'end' ? -yOffset : yOffset) - alignOffset;
29
+ return value + (align === 'end' ? -addlOffset : addlOffset) - alignOffset;
30
30
  }
31
31
  $: if ($tooltip?.data) {
32
32
  const xValue = typeof x === 'number' ? x : x === 'data' ? $xGet($tooltip.data) + $padding.left : $tooltip.x;
@@ -68,8 +68,8 @@ $: if ($tooltip?.data) {
68
68
  break;
69
69
  }
70
70
  const rect = {
71
- top: alignValue(yValue, yAlign, tooltipHeight),
72
- left: alignValue(xValue, xAlign, tooltipWidth),
71
+ top: alignValue(yValue, yAlign, yOffset, tooltipHeight),
72
+ left: alignValue(xValue, xAlign, xOffset, tooltipWidth),
73
73
  // set below
74
74
  bottom: 0,
75
75
  right: 0,
@@ -79,17 +79,17 @@ $: if ($tooltip?.data) {
79
79
  // Check if outside of container and swap align side accordingly
80
80
  if (contained === 'container') {
81
81
  if ((xAlign === 'start' || xAlign === 'center') && rect.right > $containerWidth) {
82
- rect.left = alignValue(xValue, 'end', tooltipWidth);
82
+ rect.left = alignValue(xValue, 'end', xOffset, tooltipWidth);
83
83
  }
84
84
  if ((xAlign === 'end' || xAlign === 'center') && rect.left < $padding.left) {
85
- rect.left = alignValue(xValue, 'start', tooltipWidth);
85
+ rect.left = alignValue(xValue, 'start', xOffset, tooltipWidth);
86
86
  }
87
87
  rect.right = rect.left + tooltipWidth;
88
88
  if ((yAlign === 'start' || yAlign === 'center') && rect.bottom > $containerHeight) {
89
- rect.top = alignValue(yValue, 'end', tooltipHeight);
89
+ rect.top = alignValue(yValue, 'end', yOffset, tooltipHeight);
90
90
  }
91
91
  if ((yAlign === 'end' || yAlign === 'center') && rect.top < $padding.top) {
92
- rect.top = alignValue(yValue, 'start', tooltipHeight);
92
+ rect.top = alignValue(yValue, 'start', yOffset, tooltipHeight);
93
93
  }
94
94
  rect.bottom = rect.top + tooltipHeight;
95
95
  }
@@ -13,7 +13,7 @@ export { default as CircleClipPath } from './CircleClipPath.svelte';
13
13
  export { default as ClipPath } from './ClipPath.svelte';
14
14
  export { default as ColorRamp } from './ColorRamp.svelte';
15
15
  export { default as Frame } from './Frame.svelte';
16
- export { default as GeoContext } from './GeoContext.svelte';
16
+ export { default as GeoContext, geoContext } from './GeoContext.svelte';
17
17
  export { default as GeoPath } from './GeoPath.svelte';
18
18
  export { default as GeoPoint } from './GeoPoint.svelte';
19
19
  export { default as GeoTile } from './GeoTile.svelte';
@@ -13,7 +13,7 @@ export { default as CircleClipPath } from './CircleClipPath.svelte';
13
13
  export { default as ClipPath } from './ClipPath.svelte';
14
14
  export { default as ColorRamp } from './ColorRamp.svelte';
15
15
  export { default as Frame } from './Frame.svelte';
16
- export { default as GeoContext } from './GeoContext.svelte';
16
+ export { default as GeoContext, geoContext } from './GeoContext.svelte';
17
17
  export { default as GeoPath } from './GeoPath.svelte';
18
18
  export { default as GeoPoint } from './GeoPoint.svelte';
19
19
  export { default as GeoTile } from './GeoTile.svelte';
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.26.0",
7
+ "version": "0.26.1",
8
8
  "scripts": {
9
9
  "dev": "vite dev",
10
10
  "build": "vite build",
@@ -15,10 +15,6 @@
15
15
  "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
16
16
  "lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. .",
17
17
  "format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. .",
18
- "changeset": "changeset",
19
- "version": "changeset version",
20
- "version-status": "changeset status -v",
21
- "publish": "changeset publish",
22
18
  "prepare": "svelte-kit sync"
23
19
  },
24
20
  "devDependencies": {