layerchart 0.13.2 → 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.
@@ -1,5 +1,5 @@
1
1
  <script>import { getContext } from 'svelte';
2
- import { Area, area as d3Area } from 'd3-shape';
2
+ import { area as d3Area } from 'd3-shape';
3
3
  import { min, max } from 'd3-array';
4
4
  import { interpolatePath } from 'd3-interpolate-path';
5
5
  import { motionStore } from '../stores/motionStore';
@@ -7,10 +7,10 @@ import { getContext } from 'svelte';
7
7
  import { scaleBand } from 'd3-scale';
8
8
  import { max, min } from 'd3-array';
9
9
  import Text from './Text.svelte';
10
- import { formatNumberAsStyle, FormatNumberStyle } from 'svelte-ux/utils/number';
10
+ import { formatNumberAsStyle } from 'svelte-ux/utils/number';
11
11
  import { isScaleBand } from '../utils/scales';
12
12
  import { greatestAbs, unique } from 'svelte-ux/utils/array';
13
- import { format as formatValue, FormatType } from 'svelte-ux/utils/format';
13
+ import { format as formatValue } from 'svelte-ux/utils/format';
14
14
  const { flatData, xGet, yRange, xScale, yScale, x, y, custom } = getContext('LayerCake');
15
15
  export let orientation = 'auto';
16
16
  export let significantDigits = 3;
@@ -1,6 +1,6 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import { FormatNumberStyle } from 'svelte-ux/utils/number';
3
- import { FormatType } from 'svelte-ux/utils/format';
2
+ import { type FormatNumberStyle } from 'svelte-ux/utils/number';
3
+ import { type FormatType } from 'svelte-ux/utils/format';
4
4
  declare const __propDef: {
5
5
  props: {
6
6
  [x: string]: any;
@@ -1,4 +1,4 @@
1
- <script>import { motionStore, resolveOptions, SpringOptions, TweenedOptions } from '../stores/motionStore';
1
+ <script>import { motionStore, resolveOptions } from '../stores/motionStore';
2
2
  export let x = 0;
3
3
  export let y = 0;
4
4
  export let width;
@@ -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
  }
@@ -1,5 +1,5 @@
1
1
  <script>import { getContext } from 'svelte';
2
- import { HierarchyPointNode, tree as d3Tree } from 'd3-hierarchy';
2
+ import { tree as d3Tree } from 'd3-hierarchy';
3
3
  const { data, width, height, padding } = getContext('LayerCake');
4
4
  /**
5
5
  * Sets this tree layout’s node size to the specified two-element array of numbers `[width, height]`.
@@ -1,5 +1,5 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import { HierarchyPointNode } from 'd3-hierarchy';
2
+ import { type HierarchyPointNode } from 'd3-hierarchy';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  /**
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.2",
6
+ "version": "0.13.4",
7
7
  "devDependencies": {
8
8
  "@rollup/plugin-dsv": "^3.0.2",
9
9
  "@sveltejs/adapter-vercel": "^1.0.5",