layerchart 0.3.2 → 0.3.3

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,7 +8,6 @@ import { cubicOut } from 'svelte/easing';
8
8
  import * as d3 from 'd3-hierarchy';
9
9
  import { scaleLinear } from 'd3-scale';
10
10
  import { group } from 'd3-array';
11
- import Group from './Group.svelte';
12
11
  import RectClipPath from './RectClipPath.svelte';
13
12
  import { aspectTile } from '../utils/treemap';
14
13
  const { data, width, height } = getContext('LayerCake');
@@ -84,21 +83,16 @@ $: yScale = scaleLinear().domain([$extents.y0, $extents.y1]).rangeRound([0, $hei
84
83
  {#each Array.from(nodesByHeight) as [height, nodes]}
85
84
  <g>
86
85
  {#each nodes as node}
87
- {@const nodeWidth = xScale(node.x1) - xScale(node.x0)}
88
- {@const nodeHeight = yScale(node.y1) - yScale(node.y0)}
89
- <Group x={xScale(node.x0)} y={yScale(node.y0)}>
90
- <RectClipPath width={nodeWidth} height={nodeHeight}>
91
- <slot
92
- {node}
93
- rect={{
94
- x: 0, // applied by Group
95
- y: 0, // applied by Group
96
- width: nodeWidth,
97
- height: nodeHeight
98
- }}
99
- />
100
- </RectClipPath>
101
- </Group>
86
+ <slot
87
+ name="node"
88
+ {node}
89
+ rect={{
90
+ x: xScale(node.x0),
91
+ y: yScale(node.y0),
92
+ width: xScale(node.x1) - xScale(node.x0),
93
+ height: yScale(node.y1) - yScale(node.y0)
94
+ }}
95
+ />
102
96
  {/each}
103
97
  </g>
104
98
  {/each}
@@ -16,13 +16,13 @@ declare const __propDef: {
16
16
  [evt: string]: CustomEvent<any>;
17
17
  };
18
18
  slots: {
19
- default: {
19
+ node: {
20
20
  node: d3.HierarchyRectangularNode<unknown>;
21
21
  rect: {
22
22
  x: number;
23
23
  y: number;
24
- width: any;
25
- height: any;
24
+ width: number;
25
+ height: number;
26
26
  };
27
27
  };
28
28
  };
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.3.2",
6
+ "version": "0.3.3",
7
7
  "devDependencies": {
8
8
  "@sveltejs/adapter-vercel": "^1.0.0-next.47",
9
9
  "@sveltejs/kit": "^1.0.0-next.303",