layerchart 0.4.0 → 0.4.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.
@@ -1,4 +1,4 @@
1
- <script >/*
1
+ <script>/*
2
2
  TODO:
3
3
  - [ ] Allow spring/tweened to be reactive (but ignore value)
4
4
  */
@@ -1,4 +1,4 @@
1
- <script >import { getContext } from 'svelte';
1
+ <script>import { getContext } from 'svelte';
2
2
  import { area as d3Area } from 'd3-shape';
3
3
  import { interpolatePath } from 'd3-interpolate-path';
4
4
  import { createMotionStore } from '../stores/motionStore';
@@ -1,4 +1,4 @@
1
- <script >import { getContext } from 'svelte';
1
+ <script>import { getContext } from 'svelte';
2
2
  import Area from './Area.svelte';
3
3
  import Path from './Path.svelte';
4
4
  const { data, yScale, zGet } = getContext('LayerCake');
@@ -1,4 +1,4 @@
1
- <script >import { getContext } from 'svelte';
1
+ <script>import { getContext } from 'svelte';
2
2
  import { format } from 'svelte-ux/utils/format';
3
3
  import Text from './Text.svelte';
4
4
  import { isScaleBand } from '../utils/scales';
@@ -39,7 +39,7 @@ $: tickVals = Array.isArray(ticks)
39
39
  {/each}
40
40
  </g>
41
41
 
42
- <style >
42
+ <style>
43
43
  .tick {
44
44
  font-size: 0.725em;
45
45
  font-weight: 200;
@@ -1,4 +1,4 @@
1
- <script >import { getContext } from 'svelte';
1
+ <script>import { getContext } from 'svelte';
2
2
  import { format } from 'svelte-ux/utils/format';
3
3
  import Text from './Text.svelte';
4
4
  import { isScaleBand } from '../utils/scales';
@@ -53,7 +53,7 @@ $: tickVals = Array.isArray(ticks)
53
53
  {/each}
54
54
  </g>
55
55
 
56
- <style >
56
+ <style>
57
57
  .tick {
58
58
  font-size: 0.725em;
59
59
  font-weight: 200;
@@ -1,4 +1,4 @@
1
- <script >import { getContext } from 'svelte';
1
+ <script>import { getContext } from 'svelte';
2
2
  import { scaleBand } from 'd3-scale';
3
3
  import { max, min } from 'd3-array';
4
4
  import { unique } from 'svelte-ux/utils/array';
@@ -1,4 +1,4 @@
1
- <script >import { getContext } from 'svelte';
1
+ <script>import { getContext } from 'svelte';
2
2
  const { xRange, yScale, yRange } = getContext('LayerCake');
3
3
  export let x = false;
4
4
  export let y = false;
@@ -14,7 +14,7 @@ export let y = false;
14
14
  {/if}
15
15
  </g>
16
16
 
17
- <style >
17
+ <style>
18
18
  .baseline {
19
19
  stroke: #777;
20
20
  }
@@ -1,8 +1,8 @@
1
- <script context="module" >import { LayerCake, Svg, Html } from 'layercake';
1
+ <script context="module">import { LayerCake, Svg, Html } from 'layercake';
2
2
  export { Svg, Html };
3
3
  </script>
4
4
 
5
- <script >import { max, min } from 'd3-array';
5
+ <script>import { max, min } from 'd3-array';
6
6
  import { get } from 'lodash-es';
7
7
  /**
8
8
  * Resolve a value from data based on the accessor type
@@ -1,4 +1,4 @@
1
- <script >import { getContext } from 'svelte';
1
+ <script>import { getContext } from 'svelte';
2
2
  import RectClipPath from './RectClipPath.svelte';
3
3
  const { width, height, padding } = getContext('LayerCake');
4
4
  </script>
@@ -1,4 +1,4 @@
1
- <script >import { createMotionStore } from '../stores/motionStore';
1
+ <script>import { createMotionStore } from '../stores/motionStore';
2
2
  export let cx;
3
3
  export let cy;
4
4
  export let r;
@@ -1,4 +1,4 @@
1
- <script >import { uniqueId } from 'svelte-ux/utils/string';
1
+ <script>import { uniqueId } from 'svelte-ux/utils/string';
2
2
  import ClipPath from './ClipPath.svelte';
3
3
  import Circle from './Circle.svelte';
4
4
  /** Unique id for clipPath */
@@ -1,4 +1,4 @@
1
- <script >import { uniqueId } from 'svelte-ux/utils/string';
1
+ <script>import { uniqueId } from 'svelte-ux/utils/string';
2
2
  /** Unique id for clipPath */
3
3
  export let id = uniqueId('clipPath-');
4
4
  </script>
@@ -1,4 +1,4 @@
1
- <script >/*
1
+ <script>/*
2
2
  TODO:
3
3
  - [ ] Consider becoming LinkLine using d3-path buider https://github.com/d3/d3-path
4
4
  - https://github.com/airbnb/visx/blob/master/packages/visx-shape/src/shapes/link/line/LinkHorizontalLine.tsx
@@ -1,4 +1,4 @@
1
- <script >import { getContext } from 'svelte';
1
+ <script>import { getContext } from 'svelte';
2
2
  import { createMotionStore } from '../stores/motionStore';
3
3
  const { width, height } = getContext('LayerCake');
4
4
  /**
@@ -1,4 +1,4 @@
1
- <script >import { getContext } from 'svelte';
1
+ <script>import { getContext } from 'svelte';
2
2
  import { get } from 'svelte/store';
3
3
  import Circle from './Circle.svelte';
4
4
  import Line from './Line.svelte';
@@ -1,4 +1,4 @@
1
- <script >import { getContext } from 'svelte';
1
+ <script>import { getContext } from 'svelte';
2
2
  import { isScaleBand } from '../utils/scales';
3
3
  import Rect from './Rect.svelte';
4
4
  export let data;
@@ -1,4 +1,4 @@
1
- <script >/*
1
+ <script>/*
2
2
  * TODO
3
3
  * - [ ] Support step curves (center like scaleBand())
4
4
  * - [ ] Support multiple values (threshold, stacks, etc)
@@ -1,4 +1,4 @@
1
- <script >import { createMotionStore } from '../stores/motionStore';
1
+ <script>import { createMotionStore } from '../stores/motionStore';
2
2
  export let x1;
3
3
  export let y1;
4
4
  export let x2;
@@ -1,4 +1,4 @@
1
- <script >export let id;
1
+ <script>export let id;
2
2
  export let from;
3
3
  export let via; // TODO: Currently --tw-gradient-via is not the color but the full stops
4
4
  export let to;
@@ -1,4 +1,4 @@
1
- <script >import { link as d3Link, curveBumpX, curveBumpY } from 'd3-shape';
1
+ <script>import { link as d3Link, curveBumpX, curveBumpY } from 'd3-shape';
2
2
  import { interpolatePath } from 'd3-interpolate-path';
3
3
  import { createMotionStore } from '../stores/motionStore';
4
4
  // Properties to override what is used from context
@@ -1,4 +1,4 @@
1
- <script >/*
1
+ <script>/*
2
2
  TODO:
3
3
  - [ ] Show path progressively show / animated in on load. Also fix sliding in from left side (at last in from bottom)
4
4
  */
@@ -35,7 +35,7 @@ $: {
35
35
 
36
36
  <path class="path-line" d={$tweened_d} stroke={color} stroke-width={width} {...$$restProps} />
37
37
 
38
- <style >
38
+ <style>
39
39
  .path-line {
40
40
  fill: none;
41
41
  stroke-linejoin: round;
@@ -1,4 +1,4 @@
1
- <script >// https://developer.mozilla.org/en-US/docs/Web/SVG/Element/pattern
1
+ <script>// https://developer.mozilla.org/en-US/docs/Web/SVG/Element/pattern
2
2
  // https://airbnb.io/visx/patterns
3
3
  // https://github.com/airbnb/visx/tree/master/packages/visx-pattern/src/patterns
4
4
  export let id;
@@ -1,4 +1,4 @@
1
- <script >import { getContext } from 'svelte';
1
+ <script>import { getContext } from 'svelte';
2
2
  import { pie as d3pie } from 'd3-shape';
3
3
  import Arc from './Arc.svelte';
4
4
  import Group from './Group.svelte';
@@ -1,4 +1,4 @@
1
- <script >import { getContext } from 'svelte';
1
+ <script>import { getContext } from 'svelte';
2
2
  import Circle from './Circle.svelte';
3
3
  import { isScaleBand } from '../utils/scales';
4
4
  const context = getContext('LayerCake');
@@ -1,4 +1,4 @@
1
- <script >import { createMotionStore } from '../stores/motionStore';
1
+ <script>import { createMotionStore } from '../stores/motionStore';
2
2
  export let x = 0;
3
3
  export let y = 0;
4
4
  export let width;
@@ -1,4 +1,4 @@
1
- <script >import { uniqueId } from 'svelte-ux/utils/string';
1
+ <script>import { uniqueId } from 'svelte-ux/utils/string';
2
2
  import ClipPath from './ClipPath.svelte';
3
3
  import Rect from './Rect.svelte';
4
4
  /** Unique id for clipPath */
@@ -1,4 +1,4 @@
1
- <script >// https://github.com/d3/d3-sankey
1
+ <script>// https://github.com/d3/d3-sankey
2
2
  import { createEventDispatcher, getContext } from 'svelte';
3
3
  import { sankey as d3Sankey, sankeyLeft, sankeyCenter, sankeyRight, sankeyJustify } from 'd3-sankey';
4
4
  const dispatch = createEventDispatcher();
@@ -1,4 +1,4 @@
1
- <script >import { getStringWidth } from '../utils/string';
1
+ <script>import { getStringWidth } from '../utils/string';
2
2
  /*
3
3
  TODO:
4
4
  - [ ] Handle styled text (use <slot /> to measure?)
@@ -1,4 +1,4 @@
1
- <script >/*
1
+ <script>/*
2
2
  See also:
3
3
  - https://observablehq.com/@d3/difference-chart
4
4
  - https://github.com/airbnb/visx/issues/245
@@ -1,4 +1,4 @@
1
- <script >import { getContext, createEventDispatcher } from 'svelte';
1
+ <script>import { getContext, createEventDispatcher } from 'svelte';
2
2
  import { spring } from 'svelte/motion';
3
3
  import { fade } from 'svelte/transition';
4
4
  import { writable } from 'svelte/store';
@@ -1,4 +1,4 @@
1
- <script >import { getContext } from 'svelte';
1
+ <script>import { getContext } from 'svelte';
2
2
  import { tree as d3Tree } from 'd3-hierarchy';
3
3
  const { data, width, height, padding } = getContext('LayerCake');
4
4
  /**
@@ -1,4 +1,4 @@
1
- <script >/**
1
+ <script>/**
2
2
  * TODO:
3
3
  * - [ ] Improve zoomable nested (apply extent ratio? const extentRatio = ($extents.y1 - $extents.y0) / $height;
4
4
  */
@@ -1,4 +1,4 @@
1
- <script >import { getContext } from 'svelte';
1
+ <script>import { getContext } from 'svelte';
2
2
  import { spring } from 'svelte/motion';
3
3
  const { width, height, padding } = getContext('LayerCake');
4
4
  let dragging = false;
@@ -1,4 +1,4 @@
1
- <script >import Prism from 'prismjs';
1
+ <script>import Prism from 'prismjs';
2
2
  import 'prism-svelte';
3
3
  export let code = null;
4
4
  export let language = 'svelte';
package/package.json CHANGED
@@ -3,38 +3,38 @@
3
3
  "author": "Sean Lynch <techniq35@gmail.com>",
4
4
  "license": "MIT",
5
5
  "repository": "techniq/layerchart",
6
- "version": "0.4.0",
6
+ "version": "0.4.1",
7
7
  "devDependencies": {
8
8
  "@rollup/plugin-dsv": "^2.0.3",
9
- "@sveltejs/adapter-vercel": "^1.0.0-next.47",
10
- "@sveltejs/kit": "^1.0.0-next.303",
9
+ "@sveltejs/adapter-vercel": "^1.0.0-next.58",
10
+ "@sveltejs/kit": "^1.0.0-next.350",
11
11
  "@tailwindcss/typography": "^0.5.2",
12
- "@types/d3-array": "^3.0.2",
12
+ "@types/d3-array": "^3.0.3",
13
13
  "@types/d3-dsv": "^3.0.0",
14
- "@types/d3-hierarchy": "^3.0.2",
14
+ "@types/d3-hierarchy": "^3.1.0",
15
15
  "@types/d3-sankey": "^0.11.2",
16
16
  "@types/d3-scale": "^4.0.2",
17
- "@types/d3-shape": "^3.0.2",
17
+ "@types/d3-shape": "^3.1.0",
18
18
  "@types/lodash-es": "^4.17.6",
19
- "autoprefixer": "^10.4.4",
20
- "mdsvex": "^0.10.5",
21
- "prettier": "^2.6.1",
22
- "prettier-plugin-svelte": "^2.6.0",
19
+ "autoprefixer": "^10.4.7",
20
+ "mdsvex": "^0.10.6",
21
+ "prettier": "^2.6.2",
22
+ "prettier-plugin-svelte": "^2.7.0",
23
23
  "prism-themes": "^1.9.0",
24
- "svelte": "^3.46.6",
25
- "svelte-check": "^2.4.6",
26
- "svelte-preprocess": "^4.10.4",
27
- "svelte2tsx": "^0.5.6",
28
- "tailwindcss": "^3.0.23",
29
- "tslib": "^2.3.1",
30
- "typescript": "^4.6.3",
24
+ "svelte": "^3.48.0",
25
+ "svelte-check": "^2.7.2",
26
+ "svelte-preprocess": "^4.10.7",
27
+ "svelte2tsx": "^0.5.10",
28
+ "tailwindcss": "^3.1.0",
29
+ "tslib": "^2.4.0",
30
+ "typescript": "^4.7.3",
31
31
  "unist-util-visit": "^4.1.0",
32
32
  "vite-plugin-sveld": "^1.0.3"
33
33
  },
34
34
  "type": "module",
35
35
  "dependencies": {
36
- "@mdi/js": "^6.6.96",
37
- "d3-array": "^3.1.1",
36
+ "@mdi/js": "^6.7.96",
37
+ "d3-array": "^3.1.6",
38
38
  "d3-dsv": "^3.0.1",
39
39
  "d3-hierarchy": "^3.1.2",
40
40
  "d3-interpolate-path": "^2.2.3",
@@ -45,7 +45,7 @@
45
45
  "date-fns": "^2.28.0",
46
46
  "layercake": "^6.1.0",
47
47
  "lodash-es": "^4.17.21",
48
- "svelte-ux": "^0.5.0"
48
+ "svelte-ux": "^0.5.1"
49
49
  },
50
50
  "exports": {
51
51
  "./package.json": "./package.json",