layerchart 0.32.0 → 0.32.2
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.
- package/dist/components/Axis.svelte.d.ts +2 -2
- package/dist/components/Circle.svelte +1 -1
- package/dist/components/Circle.svelte.d.ts +1 -1
- package/dist/components/GeoContext.svelte +4 -4
- package/dist/components/GeoEdgeFade.svelte +22 -0
- package/dist/components/GeoEdgeFade.svelte.d.ts +21 -0
- package/dist/components/GeoPath.svelte +10 -6
- package/dist/components/GeoPath.svelte.d.ts +3 -5
- package/dist/components/GeoPoint.svelte +8 -3
- package/dist/components/GeoPoint.svelte.d.ts +4 -3
- package/dist/components/GeoSpline.svelte +37 -0
- package/dist/components/GeoSpline.svelte.d.ts +23 -0
- package/dist/components/Highlight.svelte.d.ts +1 -1
- package/dist/components/Legend.svelte.d.ts +2 -1
- package/dist/components/TooltipContext.svelte +2 -2
- package/dist/components/TooltipItem.svelte.d.ts +2 -1
- package/dist/components/Treemap.svelte.d.ts +1 -1
- package/dist/components/Voronoi.svelte +37 -15
- package/dist/components/Voronoi.svelte.d.ts +7 -6
- package/dist/components/Zoom.svelte +1 -1
- package/dist/components/Zoom.svelte.d.ts +2 -2
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/package.json +15 -15
|
@@ -3,7 +3,7 @@ import { type ComponentProps } from 'svelte';
|
|
|
3
3
|
import { fade } from 'svelte/transition';
|
|
4
4
|
import type { SVGAttributes } from 'svelte/elements';
|
|
5
5
|
import type { spring as springStore, tweened as tweenedStore } from 'svelte/motion';
|
|
6
|
-
import { type TransitionParams } from 'svelte-ux';
|
|
6
|
+
import { type FormatType, type TransitionParams } from 'svelte-ux';
|
|
7
7
|
import Text from './Text.svelte';
|
|
8
8
|
declare const __propDef: {
|
|
9
9
|
props: {
|
|
@@ -12,7 +12,7 @@ declare const __propDef: {
|
|
|
12
12
|
/** Draw a grid lines */ grid?: boolean | SVGAttributes<SVGLineElement> | undefined;
|
|
13
13
|
/** Control the number of ticks*/ ticks?: number | any[] | Function | undefined;
|
|
14
14
|
/** Length of the tick line */ tickSize?: number | undefined;
|
|
15
|
-
format?:
|
|
15
|
+
format?: FormatType | undefined;
|
|
16
16
|
labelProps?: Partial<ComponentProps<Text>> | undefined;
|
|
17
17
|
spring?: boolean | Parameters<typeof springStore>[1];
|
|
18
18
|
tweened?: boolean | Parameters<typeof tweenedStore>[1];
|
|
@@ -7,7 +7,7 @@ declare const __propDef: {
|
|
|
7
7
|
initialCx?: number | undefined;
|
|
8
8
|
cy?: number | undefined;
|
|
9
9
|
initialCy?: number | undefined;
|
|
10
|
-
r
|
|
10
|
+
r?: number | undefined;
|
|
11
11
|
initialR?: number | undefined;
|
|
12
12
|
spring?: boolean | Parameters<typeof springStore>[1];
|
|
13
13
|
tweened?: boolean | Parameters<typeof tweenedStore>[1];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script context="module">import { getContext, setContext } from 'svelte';
|
|
2
2
|
import { writable } from 'svelte/store';
|
|
3
|
-
import {
|
|
3
|
+
import {} from 'd3-geo';
|
|
4
4
|
export const geoContextKey = Symbol();
|
|
5
5
|
export function geoContext() {
|
|
6
6
|
return getContext(geoContextKey);
|
|
@@ -12,7 +12,7 @@ function setGeoContext(geo) {
|
|
|
12
12
|
|
|
13
13
|
<script>const { width, height } = getContext('LayerCake');
|
|
14
14
|
/** @type {Function} projection - A d3 projection function. Pass this in as an uncalled function, e.g. `projection={geoAlbersUsa}`. */
|
|
15
|
-
export let projection =
|
|
15
|
+
export let projection = undefined;
|
|
16
16
|
export let fitGeojson;
|
|
17
17
|
/** By default, the map fills to fit the $width and $height. If instead you want a fixed-aspect ratio, like for a server-side rendered map, set that here. */
|
|
18
18
|
export let fixedAspectRatio = undefined;
|
|
@@ -22,10 +22,10 @@ export let rotate = undefined;
|
|
|
22
22
|
export let scale = undefined;
|
|
23
23
|
export let translate = undefined;
|
|
24
24
|
export let center = undefined;
|
|
25
|
-
const geo = writable(projection());
|
|
25
|
+
const geo = writable(projection?.());
|
|
26
26
|
setGeoContext(geo);
|
|
27
27
|
$: fitSizeRange = (fixedAspectRatio ? [100, 100 / fixedAspectRatio] : [$width, $height]);
|
|
28
|
-
$: {
|
|
28
|
+
$: if (projection) {
|
|
29
29
|
const _projection = projection();
|
|
30
30
|
if (fitGeojson && 'fitSize' in _projection) {
|
|
31
31
|
_projection.fitSize(fitSizeRange, fitGeojson);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script>import { getContext } from 'svelte';
|
|
2
|
+
import { scaleLinear } from 'd3-scale';
|
|
3
|
+
import { geoDistance } from 'd3-geo';
|
|
4
|
+
import { geoContext } from './GeoContext.svelte';
|
|
5
|
+
export let link;
|
|
6
|
+
const { width, height } = getContext('LayerCake');
|
|
7
|
+
const geo = geoContext();
|
|
8
|
+
const fade = scaleLinear().domain([-0.1, 0]).range([0, 0.1]);
|
|
9
|
+
const clamper = scaleLinear().domain([0, 1]).range([0, 1]).clamp(true);
|
|
10
|
+
// $: center = $geo.invert([$width / 2, $height / 2]);
|
|
11
|
+
$: center = $geo.invert($geo.translate());
|
|
12
|
+
$: source = link.source;
|
|
13
|
+
$: target = link.target;
|
|
14
|
+
$: startDistance = 1.57 - geoDistance(source, center);
|
|
15
|
+
$: endDistance = 1.57 - geoDistance(target, center);
|
|
16
|
+
$: distance = startDistance < endDistance ? startDistance : endDistance;
|
|
17
|
+
$: opacity = clamper(fade(distance));
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<g {opacity}>
|
|
21
|
+
<slot />
|
|
22
|
+
</g>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
link: {
|
|
5
|
+
source: [number, number];
|
|
6
|
+
target: [number, number];
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {
|
|
13
|
+
default: {};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type GeoEdgeFadeProps = typeof __propDef.props;
|
|
17
|
+
export type GeoEdgeFadeEvents = typeof __propDef.events;
|
|
18
|
+
export type GeoEdgeFadeSlots = typeof __propDef.slots;
|
|
19
|
+
export default class GeoEdgeFade extends SvelteComponentTyped<GeoEdgeFadeProps, GeoEdgeFadeEvents, GeoEdgeFadeSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script>import { createEventDispatcher, getContext } from 'svelte';
|
|
2
2
|
import { geoPath as d3geoPath } from 'd3-geo';
|
|
3
|
-
import { geoContext } from './GeoContext.svelte';
|
|
4
3
|
import { scaleCanvas } from 'layercake';
|
|
4
|
+
import { cls } from 'svelte-ux';
|
|
5
|
+
import { geoContext } from './GeoContext.svelte';
|
|
5
6
|
export let geojson;
|
|
6
7
|
export let fill = undefined;
|
|
7
|
-
export let fillScale = undefined;
|
|
8
8
|
export let stroke = undefined;
|
|
9
9
|
export let strokeWidth = undefined;
|
|
10
10
|
/** Render to canvas */
|
|
@@ -32,7 +32,7 @@ $: if (renderContext === 'canvas' && $ctx) {
|
|
|
32
32
|
// Set the context here since setting it in `$: geoPath` is a circular reference
|
|
33
33
|
geoPath.context($ctx);
|
|
34
34
|
geoPath(geojson);
|
|
35
|
-
$ctx.fillStyle = fill ||
|
|
35
|
+
$ctx.fillStyle = fill || 'transparent';
|
|
36
36
|
$ctx.fill();
|
|
37
37
|
$ctx.lineWidth = strokeWidth;
|
|
38
38
|
$ctx.strokeStyle = stroke;
|
|
@@ -44,13 +44,17 @@ $: if (renderContext === 'canvas' && $ctx) {
|
|
|
44
44
|
{#if renderContext === 'svg'}
|
|
45
45
|
<slot {geoPath}>
|
|
46
46
|
<path
|
|
47
|
+
{...$$restProps}
|
|
47
48
|
d={geoPath(geojson)}
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
{fill}
|
|
50
|
+
{stroke}
|
|
50
51
|
on:mousemove={(e) => tooltip?.show(e, geojson)}
|
|
52
|
+
on:mousemove
|
|
51
53
|
on:mouseleave={(e) => tooltip?.hide()}
|
|
54
|
+
on:mouseleave
|
|
52
55
|
on:click={(event) => dispatch('click', { geoPath, event })}
|
|
53
|
-
|
|
56
|
+
on:click
|
|
57
|
+
class={cls($$props.fill == null && 'fill-transparent', $$props.class)}
|
|
54
58
|
/>
|
|
55
59
|
</slot>
|
|
56
60
|
{/if}
|
|
@@ -6,7 +6,6 @@ declare const __propDef: {
|
|
|
6
6
|
[x: string]: any;
|
|
7
7
|
geojson: GeoPermissibleObjects;
|
|
8
8
|
fill?: string | undefined;
|
|
9
|
-
fillScale?: Object | undefined;
|
|
10
9
|
stroke?: string | undefined;
|
|
11
10
|
strokeWidth?: number | string | undefined;
|
|
12
11
|
render?: ((ctx: CanvasRenderingContext2D, { geoPath: GeoPath }: {
|
|
@@ -15,10 +14,9 @@ declare const __propDef: {
|
|
|
15
14
|
tooltip?: TooltipContextValue | undefined;
|
|
16
15
|
};
|
|
17
16
|
events: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}>;
|
|
17
|
+
mousemove: MouseEvent;
|
|
18
|
+
mouseleave: MouseEvent;
|
|
19
|
+
click: CustomEvent<any>;
|
|
22
20
|
} & {
|
|
23
21
|
[evt: string]: CustomEvent<any>;
|
|
24
22
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>import { getContext } from 'svelte';
|
|
2
2
|
import { scaleCanvas } from 'layercake';
|
|
3
3
|
import { geoContext } from './GeoContext.svelte';
|
|
4
|
+
import Circle from './Circle.svelte';
|
|
4
5
|
/** Latitude */
|
|
5
6
|
export let lat;
|
|
6
7
|
/** Longitude */
|
|
@@ -22,7 +23,11 @@ $: if (renderContext === 'canvas' && $ctx) {
|
|
|
22
23
|
</script>
|
|
23
24
|
|
|
24
25
|
{#if renderContext === 'svg'}
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
|
|
26
|
+
{#if $$slots.default}
|
|
27
|
+
<g transform="translate({x},{y})">
|
|
28
|
+
<slot />
|
|
29
|
+
</g>
|
|
30
|
+
{:else}
|
|
31
|
+
<Circle cx={x} cy={y} {...$$restProps} />
|
|
32
|
+
{/if}
|
|
28
33
|
{/if}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
lat: number;
|
|
6
|
+
long: number;
|
|
7
|
+
render?: ((ctx: CanvasRenderingContext2D, coords: {
|
|
7
8
|
x: number;
|
|
8
9
|
y: number;
|
|
9
10
|
}) => any) | undefined;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script>import { getContext } from 'svelte';
|
|
2
|
+
import { curveNatural } from 'd3-shape';
|
|
3
|
+
import { geoOrthographic, geoInterpolate } from 'd3-geo';
|
|
4
|
+
import { geoContext } from './GeoContext.svelte';
|
|
5
|
+
import Spline from './Spline.svelte';
|
|
6
|
+
export let link;
|
|
7
|
+
/** Amount of loft to apply to the midle of the curve */
|
|
8
|
+
export let loft = 1.0;
|
|
9
|
+
/**
|
|
10
|
+
* Curve of spline drawn. Imported via d3-shape.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { curveNatural } from 'd3-shape';
|
|
14
|
+
* <GeoSpline curve={curveNatrual} />
|
|
15
|
+
*
|
|
16
|
+
* @type {CurveFactory | CurveFactoryLineOnly | undefined}
|
|
17
|
+
*/
|
|
18
|
+
export let curve = curveNatural;
|
|
19
|
+
const { width, height } = getContext('LayerCake');
|
|
20
|
+
const geo = geoContext();
|
|
21
|
+
$: loftedProjection = geoOrthographic()
|
|
22
|
+
.translate($geo.translate())
|
|
23
|
+
.rotate($geo.rotate())
|
|
24
|
+
.scale($geo.scale() * loft);
|
|
25
|
+
$: source = $geo(link.source);
|
|
26
|
+
$: target = $geo(link.target);
|
|
27
|
+
$: middle = loftedProjection(geoInterpolate(link.source, link.target)(0.5));
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<Spline
|
|
31
|
+
data={[source, middle, target]}
|
|
32
|
+
x={(d) => d[0]}
|
|
33
|
+
y={(d) => d[1]}
|
|
34
|
+
defined={(d) => $geo.invert(d)}
|
|
35
|
+
{curve}
|
|
36
|
+
{...$$restProps}
|
|
37
|
+
/>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import { type CurveFactory, type CurveFactoryLineOnly } from 'd3-shape';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
link: {
|
|
7
|
+
source: [number, number];
|
|
8
|
+
target: [number, number];
|
|
9
|
+
};
|
|
10
|
+
loft?: number | undefined;
|
|
11
|
+
curve?: CurveFactory | CurveFactoryLineOnly | undefined;
|
|
12
|
+
};
|
|
13
|
+
events: {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
};
|
|
16
|
+
slots: {};
|
|
17
|
+
};
|
|
18
|
+
export type GeoSplineProps = typeof __propDef.props;
|
|
19
|
+
export type GeoSplineEvents = typeof __propDef.events;
|
|
20
|
+
export type GeoSplineSlots = typeof __propDef.slots;
|
|
21
|
+
export default class GeoSpline extends SvelteComponentTyped<GeoSplineProps, GeoSplineEvents, GeoSplineSlots> {
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -8,7 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
initialCx?: number | undefined;
|
|
9
9
|
cy?: number | undefined;
|
|
10
10
|
initialCy?: number | undefined;
|
|
11
|
-
r
|
|
11
|
+
r?: number | undefined;
|
|
12
12
|
initialR?: number | undefined;
|
|
13
13
|
spring?: boolean | import("svelte/motion").SpringOpts | undefined;
|
|
14
14
|
tweened?: boolean | import("svelte/motion").TweenedOptions<unknown> | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import { type FormatType } from 'svelte-ux';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
[x: string]: any;
|
|
@@ -7,7 +8,7 @@ declare const __propDef: {
|
|
|
7
8
|
width?: number | undefined;
|
|
8
9
|
height?: number | undefined;
|
|
9
10
|
ticks?: number | undefined;
|
|
10
|
-
tickFormat?:
|
|
11
|
+
tickFormat?: FormatType | undefined;
|
|
11
12
|
tickValues?: any[] | undefined;
|
|
12
13
|
tickFontSize?: number | undefined;
|
|
13
14
|
tickSize?: number | undefined;
|
|
@@ -288,10 +288,10 @@ $: if (mode === 'bounds' || mode === 'band') {
|
|
|
288
288
|
{:else if mode === 'voronoi'}
|
|
289
289
|
<Svg>
|
|
290
290
|
<Voronoi
|
|
291
|
-
on:mousemove={(e) => showTooltip(e.detail.event, e.detail.
|
|
291
|
+
on:mousemove={(e) => showTooltip(e.detail.event, e.detail.data)}
|
|
292
292
|
on:mouseleave={hideTooltip}
|
|
293
293
|
on:click={(e) => {
|
|
294
|
-
onClick({ data: e.detail.
|
|
294
|
+
onClick({ data: e.detail.data });
|
|
295
295
|
}}
|
|
296
296
|
classes={{ path: cls(debug && 'fill-danger/10 stroke-danger') }}
|
|
297
297
|
/>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import { type FormatType } from 'svelte-ux';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
[x: string]: any;
|
|
5
6
|
label: any;
|
|
6
7
|
value?: any;
|
|
7
|
-
format?:
|
|
8
|
+
format?: FormatType | undefined;
|
|
8
9
|
valueAlign?: "center" | "left" | "right" | undefined;
|
|
9
10
|
classes?: {
|
|
10
11
|
label?: string | undefined;
|
|
@@ -2,7 +2,7 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
import * as d3 from 'd3-hierarchy';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
tile?: "slice" |
|
|
5
|
+
tile?: "slice" | "binary" | "dice" | d3.RatioSquarifyTilingFactory | "squarify" | "resquarify" | "sliceDice" | undefined;
|
|
6
6
|
padding?: number | undefined;
|
|
7
7
|
paddingInner?: number | undefined;
|
|
8
8
|
paddingOuter?: number | undefined;
|
|
@@ -1,33 +1,55 @@
|
|
|
1
1
|
<script>import { createEventDispatcher, getContext } from 'svelte';
|
|
2
2
|
import { draw as _drawTransition } from 'svelte/transition';
|
|
3
|
-
import { Delaunay } from 'd3-delaunay';
|
|
4
|
-
import { min } from 'd3-array';
|
|
5
3
|
import { cls } from 'svelte-ux';
|
|
6
|
-
|
|
4
|
+
import { min } from 'd3-array';
|
|
5
|
+
import { Delaunay } from 'd3-delaunay';
|
|
6
|
+
import { geoVoronoi } from 'd3-geo-voronoi';
|
|
7
|
+
import GeoPath from './GeoPath.svelte';
|
|
8
|
+
import { geoContext } from './GeoContext.svelte';
|
|
9
|
+
const { flatData, xGet, yGet, x: xContext, y: yContext, width, height } = getContext('LayerCake');
|
|
10
|
+
const geo = geoContext();
|
|
7
11
|
/** Override data instead of using context */
|
|
8
12
|
export let data = undefined;
|
|
9
13
|
export let classes = {};
|
|
10
14
|
const dispatch = createEventDispatcher();
|
|
11
15
|
$: points = (data ?? $flatData).map((d) => {
|
|
12
|
-
|
|
13
|
-
const
|
|
16
|
+
// geo voronoi needs raw latitude/longtude, not mapped to range (chart dimensions)
|
|
17
|
+
const xValue = $geo ? $xContext(d) : $xGet(d);
|
|
18
|
+
const yValue = $geo ? $yContext(d) : $yGet(d);
|
|
14
19
|
const x = Array.isArray(xValue) ? min(xValue) : xValue;
|
|
15
20
|
const y = Array.isArray(yValue) ? min(yValue) : yValue;
|
|
16
21
|
const point = [x, y];
|
|
17
22
|
point.data = d;
|
|
18
23
|
return point;
|
|
19
24
|
});
|
|
20
|
-
|
|
25
|
+
// Width and/or height can sometimes be negative (when loading data remotely and updately)
|
|
26
|
+
$: boundWidth = Math.max($width, 0);
|
|
27
|
+
$: boundHeight = Math.max($height, 0);
|
|
21
28
|
</script>
|
|
22
29
|
|
|
23
30
|
<g {...$$restProps} class={cls(classes.root, $$props.class)}>
|
|
24
|
-
{#
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
{#if $geo}
|
|
32
|
+
{@const polygons = geoVoronoi().polygons(points)}
|
|
33
|
+
{#each polygons.features as feature}
|
|
34
|
+
<GeoPath
|
|
35
|
+
geojson={feature}
|
|
36
|
+
class={cls('fill-transparent', classes.path)}
|
|
37
|
+
on:mousemove={(e) =>
|
|
38
|
+
dispatch('mousemove', { event: e, data: feature.properties.site.data, feature })}
|
|
39
|
+
on:mouseleave
|
|
40
|
+
on:click={(e) => dispatch('click', { data: feature.properties.site.data, feature })}
|
|
41
|
+
/>
|
|
42
|
+
{/each}
|
|
43
|
+
{:else}
|
|
44
|
+
{@const voronoi = Delaunay.from(points).voronoi([0, 0, boundWidth, boundHeight])}
|
|
45
|
+
{#each points as point, i}
|
|
46
|
+
<path
|
|
47
|
+
d={voronoi.renderCell(i)}
|
|
48
|
+
class={cls('fill-transparent', classes.path)}
|
|
49
|
+
on:mousemove={(e) => dispatch('mousemove', { event: e, data: point.data, point })}
|
|
50
|
+
on:mouseleave
|
|
51
|
+
on:click={(e) => dispatch('click', { data: point.data, point })}
|
|
52
|
+
/>
|
|
53
|
+
{/each}
|
|
54
|
+
{/if}
|
|
33
55
|
</g>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { GeoPermissibleObjects } from 'd3-geo';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
[x: string]: any;
|
|
@@ -11,15 +12,15 @@ declare const __propDef: {
|
|
|
11
12
|
events: {
|
|
12
13
|
mouseleave: MouseEvent;
|
|
13
14
|
click: CustomEvent<{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
data: any;
|
|
16
|
+
point?: [number, number] | undefined;
|
|
17
|
+
feature?: GeoPermissibleObjects | undefined;
|
|
17
18
|
}>;
|
|
18
19
|
mousemove: CustomEvent<{
|
|
19
|
-
point: {
|
|
20
|
-
data: any;
|
|
21
|
-
};
|
|
22
20
|
event: MouseEvent;
|
|
21
|
+
data: any;
|
|
22
|
+
point?: [number, number] | undefined;
|
|
23
|
+
feature?: GeoPermissibleObjects | undefined;
|
|
23
24
|
}>;
|
|
24
25
|
} & {
|
|
25
26
|
[evt: string]: CustomEvent<any>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { motionStore } from '../stores/motionStore.js';
|
|
3
3
|
const { width, height, padding } = getContext('LayerCake');
|
|
4
4
|
export let mode = 'svg';
|
|
5
|
-
export let translateOnScale;
|
|
5
|
+
export let translateOnScale = false;
|
|
6
6
|
export let spring = undefined;
|
|
7
7
|
export let tweened = undefined;
|
|
8
8
|
export let disablePointer = false;
|
|
@@ -3,11 +3,11 @@ import { motionStore } from '../stores/motionStore.js';
|
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
mode?: "svg" | "manual" | undefined;
|
|
6
|
-
translateOnScale
|
|
6
|
+
translateOnScale?: boolean | undefined;
|
|
7
7
|
spring?: boolean | Parameters<typeof motionStore>[1]['spring'];
|
|
8
8
|
tweened?: boolean | Parameters<typeof motionStore>[1]['tweened'];
|
|
9
9
|
disablePointer?: boolean | undefined;
|
|
10
|
-
scroll?: "
|
|
10
|
+
scroll?: "none" | "scale" | "translate" | undefined;
|
|
11
11
|
clickDistance?: number | undefined;
|
|
12
12
|
initialTranslate?: {
|
|
13
13
|
x: number;
|
|
@@ -15,8 +15,10 @@ export { default as ColorRamp } from './ColorRamp.svelte';
|
|
|
15
15
|
export { default as Frame } from './Frame.svelte';
|
|
16
16
|
export { default as GeoCircle } from './GeoCircle.svelte';
|
|
17
17
|
export { default as GeoContext, geoContext } from './GeoContext.svelte';
|
|
18
|
+
export { default as GeoEdgeFade } from './GeoEdgeFade.svelte';
|
|
18
19
|
export { default as GeoPath } from './GeoPath.svelte';
|
|
19
20
|
export { default as GeoPoint } from './GeoPoint.svelte';
|
|
21
|
+
export { default as GeoSpline } from './GeoSpline.svelte';
|
|
20
22
|
export { default as GeoTile } from './GeoTile.svelte';
|
|
21
23
|
export { default as Graticule } from './Graticule.svelte';
|
|
22
24
|
export { default as Group } from './Group.svelte';
|
package/dist/components/index.js
CHANGED
|
@@ -15,8 +15,10 @@ export { default as ColorRamp } from './ColorRamp.svelte';
|
|
|
15
15
|
export { default as Frame } from './Frame.svelte';
|
|
16
16
|
export { default as GeoCircle } from './GeoCircle.svelte';
|
|
17
17
|
export { default as GeoContext, geoContext } from './GeoContext.svelte';
|
|
18
|
+
export { default as GeoEdgeFade } from './GeoEdgeFade.svelte';
|
|
18
19
|
export { default as GeoPath } from './GeoPath.svelte';
|
|
19
20
|
export { default as GeoPoint } from './GeoPoint.svelte';
|
|
21
|
+
export { default as GeoSpline } from './GeoSpline.svelte';
|
|
20
22
|
export { default as GeoTile } from './GeoTile.svelte';
|
|
21
23
|
export { default as Graticule } from './Graticule.svelte';
|
|
22
24
|
export { default as Group } from './Group.svelte';
|
package/package.json
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
"author": "Sean Lynch <techniq35@gmail.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "techniq/layerchart",
|
|
7
|
-
"version": "0.32.
|
|
7
|
+
"version": "0.32.2",
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"@changesets/cli": "^2.27.1",
|
|
10
10
|
"@mdi/js": "^7.4.47",
|
|
11
11
|
"@rollup/plugin-dsv": "^3.0.4",
|
|
12
12
|
"@sveltejs/adapter-auto": "^3.1.1",
|
|
13
|
-
"@sveltejs/kit": "^2.5.
|
|
14
|
-
"@sveltejs/package": "^2.
|
|
13
|
+
"@sveltejs/kit": "^2.5.3",
|
|
14
|
+
"@sveltejs/package": "^2.3.0",
|
|
15
15
|
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
|
|
16
16
|
"@tailwindcss/typography": "^0.5.10",
|
|
17
17
|
"@types/d3-array": "^3.2.1",
|
|
@@ -32,14 +32,13 @@
|
|
|
32
32
|
"@types/prismjs": "^1.26.3",
|
|
33
33
|
"@types/shapefile": "^0.6.4",
|
|
34
34
|
"@types/topojson-client": "^3.1.4",
|
|
35
|
-
"autoprefixer": "^10.4.
|
|
36
|
-
"d3-color": "^3.1.0",
|
|
35
|
+
"autoprefixer": "^10.4.18",
|
|
37
36
|
"execa": "^8.0.1",
|
|
38
|
-
"marked": "^12.0.
|
|
37
|
+
"marked": "^12.0.1",
|
|
39
38
|
"mdsvex": "^0.11.0",
|
|
40
39
|
"posthog-js": "^1.95.1",
|
|
41
40
|
"prettier": "^3.2.5",
|
|
42
|
-
"prettier-plugin-svelte": "^3.2.
|
|
41
|
+
"prettier-plugin-svelte": "^3.2.2",
|
|
43
42
|
"prism-svelte": "^0.5.0",
|
|
44
43
|
"prism-themes": "^1.9.0",
|
|
45
44
|
"prismjs": "^1.29.0",
|
|
@@ -47,17 +46,17 @@
|
|
|
47
46
|
"shapefile": "^0.6.6",
|
|
48
47
|
"solar-calculator": "^0.3.0",
|
|
49
48
|
"svelte": "^4.2.12",
|
|
50
|
-
"svelte-check": "^3.6.
|
|
49
|
+
"svelte-check": "^3.6.6",
|
|
51
50
|
"svelte-json-tree": "^2.2.0",
|
|
52
51
|
"svelte-preprocess": "^5.1.3",
|
|
53
|
-
"svelte2tsx": "^0.7.
|
|
52
|
+
"svelte2tsx": "^0.7.3",
|
|
54
53
|
"tailwindcss": "^3.4.1",
|
|
55
54
|
"topojson-client": "^3.1.0",
|
|
56
55
|
"tslib": "^2.6.2",
|
|
57
|
-
"typescript": "^5.
|
|
56
|
+
"typescript": "^5.4.2",
|
|
58
57
|
"unist-util-visit": "^5.0.0",
|
|
59
58
|
"us-atlas": "^3.0.1",
|
|
60
|
-
"vite": "^5.1.
|
|
59
|
+
"vite": "^5.1.5"
|
|
61
60
|
},
|
|
62
61
|
"type": "module",
|
|
63
62
|
"dependencies": {
|
|
@@ -67,6 +66,7 @@
|
|
|
67
66
|
"d3-delaunay": "^6.0.4",
|
|
68
67
|
"d3-dsv": "^3.0.1",
|
|
69
68
|
"d3-geo": "^3.1.0",
|
|
69
|
+
"d3-geo-voronoi": "^2.0.1",
|
|
70
70
|
"d3-hierarchy": "^3.1.2",
|
|
71
71
|
"d3-interpolate": "^3.0.1",
|
|
72
72
|
"d3-interpolate-path": "^2.3.0",
|
|
@@ -78,12 +78,12 @@
|
|
|
78
78
|
"d3-shape": "^3.2.0",
|
|
79
79
|
"d3-tile": "^1.0.0",
|
|
80
80
|
"d3-time": "^3.1.0",
|
|
81
|
-
"date-fns": "^3.
|
|
82
|
-
"layercake": "^8.0.
|
|
81
|
+
"date-fns": "^3.4.0",
|
|
82
|
+
"layercake": "^8.0.3",
|
|
83
83
|
"lodash-es": "^4.17.21",
|
|
84
|
-
"posthog-js": "^1.
|
|
84
|
+
"posthog-js": "^1.113.0",
|
|
85
85
|
"shapefile": "^0.6.6",
|
|
86
|
-
"svelte-ux": "^0.61.
|
|
86
|
+
"svelte-ux": "^0.61.5",
|
|
87
87
|
"topojson-client": "^3.1.0"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|