layerchart 0.13.3 → 0.13.4

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.
@@ -8,14 +8,13 @@ export let leftOffset = 10;
8
8
  export let contained = 'container'; // TODO: Support 'window' using getBoundingClientRect()
9
9
  export let animate = true;
10
10
  export let header = undefined;
11
- const { width, height, padding } = getContext('LayerCake');
11
+ const { containerWidth, containerHeight } = getContext('LayerCake');
12
12
  const tooltip = tooltipContext();
13
13
  let tooltipWidth = 0;
14
14
  let tooltipHeight = 0;
15
15
  let top = animate ? spring($tooltip.top) : writable($tooltip.top);
16
16
  $: if ($tooltip) {
17
- const containerHeight = $height + $padding.bottom;
18
- if (contained === 'container' && $tooltip.top + topOffset + tooltipHeight > containerHeight) {
17
+ if (contained === 'container' && $tooltip.top + topOffset + tooltipHeight > $containerHeight) {
19
18
  // change side
20
19
  $top = $tooltip.top - (topOffset + tooltipHeight);
21
20
  }
@@ -25,8 +24,7 @@ $: if ($tooltip) {
25
24
  }
26
25
  let left = animate ? spring($tooltip.left) : writable($tooltip.left);
27
26
  $: if ($tooltip) {
28
- const containerWidth = $width + $padding.right;
29
- if (contained === 'container' && $tooltip.left + leftOffset + tooltipWidth > containerWidth) {
27
+ if (contained === 'container' && $tooltip.left + leftOffset + tooltipWidth > $containerWidth) {
30
28
  // change side
31
29
  $left = $tooltip.left - (leftOffset + tooltipWidth);
32
30
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "author": "Sean Lynch <techniq35@gmail.com>",
4
4
  "license": "MIT",
5
5
  "repository": "techniq/layerchart",
6
- "version": "0.13.3",
6
+ "version": "0.13.4",
7
7
  "devDependencies": {
8
8
  "@rollup/plugin-dsv": "^3.0.2",
9
9
  "@sveltejs/adapter-vercel": "^1.0.5",