layerchart 2.0.0-next.1 → 2.0.0-next.11
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/actions/movable.d.ts +28 -0
- package/dist/actions/movable.js +91 -0
- package/dist/components/AnnotationLine.svelte +143 -0
- package/dist/components/AnnotationLine.svelte.d.ts +30 -0
- package/dist/components/AnnotationPoint.svelte +119 -0
- package/dist/components/AnnotationPoint.svelte.d.ts +34 -0
- package/dist/components/AnnotationRange.svelte +147 -0
- package/dist/components/AnnotationRange.svelte.d.ts +40 -0
- package/dist/components/Arc.svelte +344 -151
- package/dist/components/Arc.svelte.d.ts +138 -0
- package/dist/components/Area.svelte +165 -149
- package/dist/components/Area.svelte.d.ts +45 -0
- package/dist/components/Axis.svelte +320 -179
- package/dist/components/Axis.svelte.d.ts +127 -0
- package/dist/components/Bar.svelte +166 -107
- package/dist/components/Bar.svelte.d.ts +51 -0
- package/dist/components/Bars.svelte +56 -67
- package/dist/components/Bars.svelte.d.ts +27 -0
- package/dist/components/Blur.svelte +42 -12
- package/dist/components/Blur.svelte.d.ts +23 -21
- package/dist/components/Bounds.svelte +49 -19
- package/dist/components/Bounds.svelte.d.ts +24 -50
- package/dist/components/BrushContext.svelte +296 -168
- package/dist/components/BrushContext.svelte.d.ts +97 -65
- package/dist/components/Calendar.svelte +116 -59
- package/dist/components/Calendar.svelte.d.ts +50 -31
- package/dist/components/Chart.svelte +1289 -398
- package/dist/components/Chart.svelte.d.ts +535 -410
- package/dist/components/ChartClipPath.svelte +37 -15
- package/dist/components/ChartClipPath.svelte.d.ts +21 -19
- package/dist/components/Circle.svelte +124 -85
- package/dist/components/Circle.svelte.d.ts +52 -0
- package/dist/components/CircleClipPath.svelte +76 -16
- package/dist/components/CircleClipPath.svelte.d.ts +46 -0
- package/dist/components/ClipPath.svelte +71 -21
- package/dist/components/ClipPath.svelte.d.ts +40 -27
- package/dist/components/ColorRamp.svelte +75 -9
- package/dist/components/ColorRamp.svelte.d.ts +37 -19
- package/dist/components/ComputedStyles.svelte +17 -5
- package/dist/components/ComputedStyles.svelte.d.ts +11 -19
- package/dist/components/Connector.svelte +149 -0
- package/dist/components/Connector.svelte.d.ts +51 -0
- package/dist/components/Dagre.svelte +211 -122
- package/dist/components/Dagre.svelte.d.ts +119 -56
- package/dist/components/ForceSimulation.svelte +215 -90
- package/dist/components/ForceSimulation.svelte.d.ts +82 -35
- package/dist/components/Frame.svelte +33 -13
- package/dist/components/Frame.svelte.d.ts +13 -17
- package/dist/components/GeoCircle.svelte +29 -16
- package/dist/components/GeoCircle.svelte.d.ts +22 -24
- package/dist/components/GeoContext.svelte +113 -72
- package/dist/components/GeoContext.svelte.d.ts +49 -41
- package/dist/components/GeoEdgeFade.svelte +49 -13
- package/dist/components/GeoEdgeFade.svelte.d.ts +17 -19
- package/dist/components/GeoPath.svelte +157 -127
- package/dist/components/GeoPath.svelte.d.ts +48 -36
- package/dist/components/GeoPoint.svelte +52 -20
- package/dist/components/GeoPoint.svelte.d.ts +25 -22
- package/dist/components/GeoSpline.svelte +75 -26
- package/dist/components/GeoSpline.svelte.d.ts +29 -20
- package/dist/components/GeoTile.svelte +100 -49
- package/dist/components/GeoTile.svelte.d.ts +38 -23
- package/dist/components/GeoVisible.svelte +17 -9
- package/dist/components/GeoVisible.svelte.d.ts +10 -18
- package/dist/components/Graticule.svelte +30 -14
- package/dist/components/Graticule.svelte.d.ts +11 -52
- package/dist/components/Grid.svelte +230 -117
- package/dist/components/Grid.svelte.d.ts +71 -0
- package/dist/components/Group.svelte +173 -106
- package/dist/components/Group.svelte.d.ts +81 -0
- package/dist/components/Highlight.svelte +410 -308
- package/dist/components/Highlight.svelte.d.ts +107 -0
- package/dist/components/Hull.svelte +97 -46
- package/dist/components/Hull.svelte.d.ts +40 -30
- package/dist/components/Labels.svelte +127 -47
- package/dist/components/Labels.svelte.d.ts +70 -27
- package/dist/components/Legend.svelte +374 -190
- package/dist/components/Legend.svelte.d.ts +95 -44
- package/dist/components/Line.svelte +163 -125
- package/dist/components/Line.svelte.d.ts +75 -0
- package/dist/components/LinearGradient.svelte +153 -78
- package/dist/components/LinearGradient.svelte.d.ts +66 -31
- package/dist/components/Link.svelte +160 -104
- package/dist/components/Link.svelte.d.ts +54 -0
- package/dist/components/Marker.svelte +100 -39
- package/dist/components/Marker.svelte.d.ts +59 -27
- package/dist/components/MarkerWrapper.svelte +35 -0
- package/dist/components/MarkerWrapper.svelte.d.ts +18 -0
- package/dist/components/MonthPath.svelte +65 -20
- package/dist/components/MonthPath.svelte.d.ts +23 -17
- package/dist/components/MotionPath.svelte +80 -24
- package/dist/components/MotionPath.svelte.d.ts +46 -27
- package/dist/components/Pack.svelte +53 -17
- package/dist/components/Pack.svelte.d.ts +42 -21
- package/dist/components/Partition.svelte +64 -22
- package/dist/components/Partition.svelte.d.ts +49 -26
- package/dist/components/Pattern.svelte +297 -11
- package/dist/components/Pattern.svelte.d.ts +103 -19
- package/dist/components/Pie.svelte +122 -76
- package/dist/components/Pie.svelte.d.ts +65 -51
- package/dist/components/Point.svelte +20 -9
- package/dist/components/Point.svelte.d.ts +16 -20
- package/dist/components/Points.svelte +148 -137
- package/dist/components/Points.svelte.d.ts +45 -34
- package/dist/components/RadialGradient.svelte +148 -77
- package/dist/components/RadialGradient.svelte.d.ts +69 -31
- package/dist/components/Rect.svelte +121 -102
- package/dist/components/Rect.svelte.d.ts +36 -0
- package/dist/components/RectClipPath.svelte +82 -18
- package/dist/components/RectClipPath.svelte.d.ts +55 -0
- package/dist/components/Rule.svelte +107 -63
- package/dist/components/Rule.svelte.d.ts +40 -19
- package/dist/components/Sankey.svelte +132 -55
- package/dist/components/Sankey.svelte.d.ts +61 -31
- package/dist/components/Spline.svelte +281 -218
- package/dist/components/Spline.svelte.d.ts +95 -0
- package/dist/components/Text.svelte +463 -197
- package/dist/components/Text.svelte.d.ts +136 -0
- package/dist/components/Threshold.svelte +48 -16
- package/dist/components/Threshold.svelte.d.ts +29 -31
- package/dist/components/TileImage.svelte +103 -30
- package/dist/components/TileImage.svelte.d.ts +48 -23
- package/dist/components/TransformContext.svelte +365 -171
- package/dist/components/TransformControls.svelte +50 -26
- package/dist/components/TransformControls.svelte.d.ts +27 -19
- package/dist/components/Tree.svelte +74 -33
- package/dist/components/Tree.svelte.d.ts +42 -30
- package/dist/components/Treemap.svelte +119 -42
- package/dist/components/Treemap.svelte.d.ts +75 -27
- package/dist/components/Voronoi.svelte +153 -103
- package/dist/components/Voronoi.svelte.d.ts +42 -41
- package/dist/components/charts/ArcChart.svelte +464 -0
- package/dist/components/charts/ArcChart.svelte.d.ts +90 -0
- package/dist/components/charts/AreaChart.svelte +444 -393
- package/dist/components/charts/AreaChart.svelte.d.ts +61 -0
- package/dist/components/charts/BarChart.svelte +463 -389
- package/dist/components/charts/BarChart.svelte.d.ts +76 -0
- package/dist/components/charts/ChartAnnotations.svelte +37 -0
- package/dist/components/charts/ChartAnnotations.svelte.d.ts +10 -0
- package/dist/components/charts/DefaultTooltip.svelte +60 -0
- package/dist/components/charts/DefaultTooltip.svelte.d.ts +10 -0
- package/dist/components/charts/LineChart.svelte +366 -315
- package/dist/components/charts/LineChart.svelte.d.ts +53 -0
- package/dist/components/charts/PieChart.svelte +458 -316
- package/dist/components/charts/PieChart.svelte.d.ts +137 -353
- package/dist/components/charts/ScatterChart.svelte +332 -296
- package/dist/components/charts/ScatterChart.svelte.d.ts +39 -0
- package/dist/components/charts/index.d.ts +8 -0
- package/dist/components/charts/index.js +7 -0
- package/dist/components/charts/types.d.ts +253 -0
- package/dist/components/charts/utils.svelte.d.ts +30 -0
- package/dist/components/charts/utils.svelte.js +59 -0
- package/dist/components/index.d.ts +76 -4
- package/dist/components/index.js +76 -5
- package/dist/components/layout/Canvas.svelte +347 -171
- package/dist/components/layout/Canvas.svelte.d.ts +110 -55
- package/dist/components/layout/Html.svelte +82 -42
- package/dist/components/layout/Html.svelte.d.ts +39 -28
- package/dist/components/layout/Layer.svelte +39 -0
- package/dist/components/layout/Layer.svelte.d.ts +17 -0
- package/dist/components/layout/Svg.svelte +122 -70
- package/dist/components/layout/Svg.svelte.d.ts +53 -34
- package/dist/components/layout/WebGL.svelte +135 -0
- package/dist/components/layout/WebGL.svelte.d.ts +50 -0
- package/dist/components/tooltip/Tooltip.svelte +253 -78
- package/dist/components/tooltip/Tooltip.svelte.d.ts +149 -31
- package/dist/components/tooltip/TooltipContext.svelte +426 -271
- package/dist/components/tooltip/TooltipContext.svelte.d.ts +86 -55
- package/dist/components/tooltip/TooltipHeader.svelte +100 -11
- package/dist/components/tooltip/TooltipHeader.svelte.d.ts +43 -23
- package/dist/components/tooltip/TooltipItem.svelte +167 -27
- package/dist/components/tooltip/TooltipItem.svelte.d.ts +63 -31
- package/dist/components/tooltip/TooltipList.svelte +22 -3
- package/dist/components/tooltip/TooltipList.svelte.d.ts +6 -17
- package/dist/components/tooltip/TooltipSeparator.svelte +27 -1
- package/dist/components/tooltip/TooltipSeparator.svelte.d.ts +6 -15
- package/dist/components/tooltip/index.d.ts +6 -0
- package/dist/components/tooltip/index.js +6 -0
- package/dist/components/tooltip/tooltipMetaContext.d.ts +79 -0
- package/dist/components/tooltip/tooltipMetaContext.js +139 -0
- package/dist/components/types.d.ts +1 -0
- package/dist/components/types.js +1 -0
- package/dist/docs/Blockquote.svelte +3 -1
- package/dist/docs/Blockquote.svelte.d.ts +5 -16
- package/dist/docs/Code.svelte +20 -12
- package/dist/docs/Code.svelte.d.ts +12 -22
- package/dist/docs/ConnectorSweepMenuField.svelte +17 -0
- package/dist/docs/ConnectorSweepMenuField.svelte.d.ts +7 -0
- package/dist/docs/ConnectorTypeMenuField.svelte +17 -0
- package/dist/docs/ConnectorTypeMenuField.svelte.d.ts +7 -0
- package/dist/docs/CurveMenuField.svelte +14 -3
- package/dist/docs/CurveMenuField.svelte.d.ts +9 -18
- package/dist/docs/GeoDebug.svelte +47 -42
- package/dist/docs/GeoDebug.svelte.d.ts +4 -16
- package/dist/docs/Header1.svelte +4 -2
- package/dist/docs/Header1.svelte.d.ts +5 -18
- package/dist/docs/Json.svelte +11 -3
- package/dist/docs/Json.svelte.d.ts +9 -17
- package/dist/docs/Layout.svelte +10 -7
- package/dist/docs/Layout.svelte.d.ts +5 -15
- package/dist/docs/Link.svelte +7 -3
- package/dist/docs/Link.svelte.d.ts +5 -27
- package/dist/docs/PathDataMenuField.svelte +14 -10
- package/dist/docs/PathDataMenuField.svelte.d.ts +8 -18
- package/dist/docs/Preview.svelte +20 -7
- package/dist/docs/Preview.svelte.d.ts +12 -22
- package/dist/docs/TilesetField.svelte +20 -19
- package/dist/docs/TilesetField.svelte.d.ts +6 -19
- package/dist/docs/TransformDebug.svelte +5 -6
- package/dist/docs/TransformDebug.svelte.d.ts +18 -14
- package/dist/docs/ViewSourceButton.svelte +7 -4
- package/dist/docs/ViewSourceButton.svelte.d.ts +8 -18
- package/dist/types/d3-shape-extentions.d.ts +7 -0
- package/dist/utils/afterTick.d.ts +5 -0
- package/dist/utils/afterTick.js +8 -0
- package/dist/utils/arcText.svelte.d.ts +57 -0
- package/dist/utils/arcText.svelte.js +262 -0
- package/dist/utils/array.d.ts +9 -1
- package/dist/utils/array.js +13 -0
- package/dist/utils/attributes.d.ts +29 -0
- package/dist/utils/attributes.js +40 -0
- package/dist/utils/canvas.js +47 -10
- package/dist/utils/chart.d.ts +78 -0
- package/dist/utils/chart.js +512 -0
- package/dist/utils/color.d.ts +1 -0
- package/dist/utils/color.js +8 -0
- package/dist/utils/common.d.ts +3 -5
- package/dist/utils/common.js +3 -2
- package/dist/utils/connectorUtils.d.ts +21 -0
- package/dist/utils/connectorUtils.js +111 -0
- package/dist/utils/createId.d.ts +7 -0
- package/dist/utils/createId.js +9 -0
- package/dist/utils/debug.d.ts +1 -0
- package/dist/utils/debug.js +84 -0
- package/dist/utils/filterObject.d.ts +9 -0
- package/dist/utils/filterObject.js +12 -0
- package/dist/utils/graph/dagre.d.ts +34 -0
- package/dist/utils/graph/dagre.js +78 -0
- package/dist/utils/graph/dagre.test.d.ts +1 -0
- package/dist/utils/{graph.test.js → graph/dagre.test.js} +19 -33
- package/dist/utils/graph/sankey.d.ts +28 -0
- package/dist/utils/{graph.js → graph/sankey.js} +13 -41
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.js +3 -1
- package/dist/utils/key.svelte.d.ts +3 -0
- package/dist/utils/key.svelte.js +11 -0
- package/dist/utils/legendPayload.d.ts +7 -0
- package/dist/utils/legendPayload.js +8 -0
- package/dist/utils/motion.svelte.d.ts +140 -0
- package/dist/utils/motion.svelte.js +180 -0
- package/dist/utils/motion.test.d.ts +1 -0
- package/dist/utils/motion.test.js +213 -0
- package/dist/utils/{rect.d.ts → rect.svelte.d.ts} +7 -4
- package/dist/utils/rect.svelte.js +105 -0
- package/dist/utils/scales.svelte.d.ts +91 -0
- package/dist/utils/scales.svelte.js +201 -0
- package/dist/utils/stack.d.ts +2 -3
- package/dist/utils/stack.js +1 -1
- package/dist/utils/string.js +87 -0
- package/dist/utils/ticks.d.ts +9 -3
- package/dist/utils/ticks.js +122 -147
- package/dist/utils/ticks.test.d.ts +1 -0
- package/dist/utils/ticks.test.js +57 -0
- package/dist/utils/types.d.ts +81 -0
- package/package.json +28 -24
- package/dist/components/ChartContext.svelte +0 -295
- package/dist/components/ChartContext.svelte.d.ts +0 -139
- package/dist/components/TransformContext.svelte.d.ts +0 -158
- package/dist/stores/motionStore.d.ts +0 -30
- package/dist/stores/motionStore.js +0 -62
- package/dist/utils/graph.d.ts +0 -37
- package/dist/utils/rect.js +0 -107
- package/dist/utils/scales.d.ts +0 -66
- package/dist/utils/scales.js +0 -136
- /package/dist/{utils/graph.test.d.ts → components/charts/types.js} +0 -0
|
@@ -2,54 +2,59 @@
|
|
|
2
2
|
import { Checkbox } from 'svelte-ux';
|
|
3
3
|
import { cls } from '@layerstack/tailwind';
|
|
4
4
|
import { format } from '@layerstack/utils';
|
|
5
|
+
import { getChartContext } from '../components/Chart.svelte';
|
|
6
|
+
import { getGeoContext } from '../components/GeoContext.svelte';
|
|
7
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
5
8
|
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
const ctx = getChartContext();
|
|
10
|
+
const geoCtx = getGeoContext();
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
const geo = geoContext();
|
|
12
|
+
let { class: className }: HTMLAttributes<HTMLElement> = $props();
|
|
11
13
|
|
|
12
|
-
let showCenter = false;
|
|
14
|
+
let showCenter = $state(false);
|
|
13
15
|
</script>
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
class={cls('bg-surface-300/50 rounded-sm m-1 backdrop-blur-sm p-2 tabular-nums',
|
|
17
|
-
>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<
|
|
46
|
-
|
|
17
|
+
{#if geoCtx.projection}
|
|
18
|
+
<div class={cls('bg-surface-300/50 rounded-sm m-1 backdrop-blur-sm p-2 tabular-nums', className)}>
|
|
19
|
+
<div class="grid gap-2 text-xs">
|
|
20
|
+
<div>
|
|
21
|
+
<span class="opacity-50">scale:</span>
|
|
22
|
+
{format(geoCtx.projection.scale(), 'decimal')}
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<div>
|
|
26
|
+
<span class="opacity-50">translate:</span>
|
|
27
|
+
{#each geoCtx.projection.translate() as coord}
|
|
28
|
+
<div class="text-right">{format(coord, 'decimal')}</div>
|
|
29
|
+
{/each}
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div>
|
|
33
|
+
<span class="opacity-50">rotate:</span>
|
|
34
|
+
{#each geoCtx.projection.rotate() as angle}
|
|
35
|
+
<div class="text-right">{format(angle, 'decimal')}</div>
|
|
36
|
+
{/each}
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="grid grid-cols-[auto_1fr]">
|
|
40
|
+
<span class="opacity-50">center:</span>
|
|
41
|
+
<span class="text-right">
|
|
42
|
+
{geoCtx.projection.center?.()}
|
|
43
|
+
</span>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div>
|
|
47
|
+
<span class="opacity-50">long/lat: <Checkbox bind:checked={showCenter} size="xs" /></span>
|
|
48
|
+
{#each geoCtx.projection.invert?.([ctx.width / 2, ctx.height / 2]) ?? [] as coord}
|
|
49
|
+
<div class="text-right">{format(coord, 'decimal')}</div>
|
|
50
|
+
{/each}
|
|
51
|
+
</div>
|
|
47
52
|
</div>
|
|
48
53
|
</div>
|
|
49
|
-
</div>
|
|
50
54
|
|
|
51
|
-
{#if showCenter}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
{#if showCenter}
|
|
56
|
+
<div
|
|
57
|
+
class="absolute w-2 h-2 bg-danger/80 rounded-full z-1 left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2"
|
|
58
|
+
></div>
|
|
59
|
+
{/if}
|
|
55
60
|
{/if}
|
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
events: {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
10
|
-
};
|
|
11
|
-
export type GeoDebugProps = typeof __propDef.props;
|
|
12
|
-
export type GeoDebugEvents = typeof __propDef.events;
|
|
13
|
-
export type GeoDebugSlots = typeof __propDef.slots;
|
|
14
|
-
export default class GeoDebug extends SvelteComponentTyped<GeoDebugProps, GeoDebugEvents, GeoDebugSlots> {
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
1
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
+
declare const GeoDebug: import("svelte").Component<HTMLAttributes<HTMLElement>, {}, "">;
|
|
3
|
+
type GeoDebug = ReturnType<typeof GeoDebug>;
|
|
4
|
+
export default GeoDebug;
|
package/dist/docs/Header1.svelte
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { SectionDivider } from 'svelte-ux';
|
|
3
|
+
|
|
4
|
+
let { children, ...restProps } = $props();
|
|
3
5
|
</script>
|
|
4
6
|
|
|
5
7
|
<!--
|
|
@@ -9,6 +11,6 @@
|
|
|
9
11
|
- Maybe possible to set/get props from markdown/mdsvex
|
|
10
12
|
- Example: `#API { id: 'api' }
|
|
11
13
|
-->
|
|
12
|
-
<SectionDivider {
|
|
13
|
-
|
|
14
|
+
<SectionDivider {...restProps}>
|
|
15
|
+
{@render children()}
|
|
14
16
|
</SectionDivider>
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
events: {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {
|
|
10
|
-
default: {};
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export type Header1Props = typeof __propDef.props;
|
|
14
|
-
export type Header1Events = typeof __propDef.events;
|
|
15
|
-
export type Header1Slots = typeof __propDef.slots;
|
|
16
|
-
export default class Header1 extends SvelteComponentTyped<Header1Props, Header1Events, Header1Slots> {
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
1
|
+
declare const Header1: import("svelte").Component<{
|
|
2
|
+
children: any;
|
|
3
|
+
} & Record<string, any>, {}, "">;
|
|
4
|
+
type Header1 = ReturnType<typeof Header1>;
|
|
5
|
+
export default Header1;
|
package/dist/docs/Json.svelte
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import { type ComponentProps } from 'svelte';
|
|
2
3
|
import JsonTree from 'svelte-json-tree';
|
|
3
4
|
import { cls } from '@layerstack/tailwind';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
const {
|
|
7
|
+
value,
|
|
8
|
+
defaultExpandedPaths = ['$'],
|
|
9
|
+
class: className,
|
|
10
|
+
}: {
|
|
11
|
+
value: ComponentProps<JsonTree>['value'];
|
|
12
|
+
defaultExpandedPaths?: ComponentProps<JsonTree>['defaultExpandedPaths'];
|
|
13
|
+
class?: string;
|
|
14
|
+
} = $props();
|
|
7
15
|
</script>
|
|
8
16
|
|
|
9
|
-
<div class={cls('overflow-auto px-4 py-2 bg-[#1e1e1e]',
|
|
17
|
+
<div class={cls('overflow-auto px-4 py-2 bg-[#1e1e1e]', className)}>
|
|
10
18
|
<JsonTree
|
|
11
19
|
{value}
|
|
12
20
|
{defaultExpandedPaths}
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
};
|
|
11
|
-
slots: {};
|
|
1
|
+
import { type ComponentProps } from 'svelte';
|
|
2
|
+
import JsonTree from 'svelte-json-tree';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
value: ComponentProps<JsonTree>['value'];
|
|
5
|
+
defaultExpandedPaths?: ComponentProps<JsonTree>['defaultExpandedPaths'];
|
|
6
|
+
class?: string;
|
|
12
7
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export
|
|
16
|
-
export default class Json extends SvelteComponentTyped<JsonProps, JsonEvents, JsonSlots> {
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
8
|
+
declare const Json: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
|
+
type Json = ReturnType<typeof Json>;
|
|
10
|
+
export default Json;
|
package/dist/docs/Layout.svelte
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script module>
|
|
2
2
|
// Custom components: https://mdsvex.com/docs#custom-components
|
|
3
3
|
import blockquote from './Blockquote.svelte';
|
|
4
4
|
import a from './Link.svelte';
|
|
@@ -8,11 +8,14 @@
|
|
|
8
8
|
</script>
|
|
9
9
|
|
|
10
10
|
<script lang="ts">
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
let {
|
|
12
|
+
// frontmatter: https://mdsvex.com/docs#frontmatter-1
|
|
13
|
+
// name,
|
|
14
|
+
// sourceUrl,
|
|
15
|
+
// docUrl,
|
|
16
|
+
// description,
|
|
17
|
+
children,
|
|
18
|
+
} = $props();
|
|
16
19
|
</script>
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
{@render children()}
|
|
@@ -1,18 +1,8 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
1
|
import blockquote from './Blockquote.svelte';
|
|
3
2
|
import a from './Link.svelte';
|
|
4
3
|
export { a, blockquote };
|
|
5
|
-
declare const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
slots: {
|
|
11
|
-
default: {};
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
export type LayoutProps = typeof __propDef.props;
|
|
15
|
-
export type LayoutEvents = typeof __propDef.events;
|
|
16
|
-
export type LayoutSlots = typeof __propDef.slots;
|
|
17
|
-
export default class Layout extends SvelteComponentTyped<LayoutProps, LayoutEvents, LayoutSlots> {
|
|
18
|
-
}
|
|
4
|
+
declare const Layout: import("svelte").Component<{
|
|
5
|
+
children: any;
|
|
6
|
+
}, {}, "">;
|
|
7
|
+
type Layout = ReturnType<typeof Layout>;
|
|
8
|
+
export default Layout;
|
package/dist/docs/Link.svelte
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
let { children, ...restProps } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
1
5
|
<!-- href provided by markdown/mdsvex -->
|
|
2
|
-
<!-- svelte-ignore
|
|
3
|
-
<a class="text-primary font-medium" {
|
|
4
|
-
|
|
6
|
+
<!-- svelte-ignore a11y_missing_attribute -->
|
|
7
|
+
<a class="text-primary font-medium" {...restProps}>
|
|
8
|
+
{@render children()}
|
|
5
9
|
</a>
|
|
@@ -1,27 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {
|
|
9
|
-
default: {};
|
|
10
|
-
}> {
|
|
11
|
-
}
|
|
12
|
-
export type LinkProps = typeof __propDef.props;
|
|
13
|
-
export type LinkEvents = typeof __propDef.events;
|
|
14
|
-
export type LinkSlots = typeof __propDef.slots;
|
|
15
|
-
import { SvelteComponentTyped } from "svelte";
|
|
16
|
-
declare const __propDef: {
|
|
17
|
-
props: {
|
|
18
|
-
[x: string]: any;
|
|
19
|
-
};
|
|
20
|
-
events: {
|
|
21
|
-
[evt: string]: CustomEvent<any>;
|
|
22
|
-
};
|
|
23
|
-
slots: {
|
|
24
|
-
default: {};
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
export {};
|
|
1
|
+
declare const Link: import("svelte").Component<{
|
|
2
|
+
children: any;
|
|
3
|
+
} & Record<string, any>, {}, "">;
|
|
4
|
+
type Link = ReturnType<typeof Link>;
|
|
5
|
+
export default Link;
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
3
|
import * as easings from 'svelte/easing';
|
|
4
|
-
|
|
5
4
|
import { MenuField } from 'svelte-ux';
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
let {
|
|
7
|
+
value = $bindable(),
|
|
8
|
+
amplitude = 1,
|
|
9
|
+
frequency = 10,
|
|
10
|
+
phase = 0,
|
|
11
|
+
}: {
|
|
12
|
+
value?: any;
|
|
13
|
+
amplitude?: number;
|
|
14
|
+
frequency?: number;
|
|
15
|
+
phase?: number;
|
|
16
|
+
} = $props();
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
const mathOptions = $derived([
|
|
15
19
|
{
|
|
16
20
|
label: 'sin',
|
|
17
21
|
group: 'math',
|
|
@@ -53,7 +57,7 @@
|
|
|
53
57
|
group: 'math',
|
|
54
58
|
value: (x: number) => amplitude * Math.pow(x, frequency) + phase,
|
|
55
59
|
},
|
|
56
|
-
];
|
|
60
|
+
]);
|
|
57
61
|
|
|
58
62
|
const easingOptions = Object.entries(easings).map(([key, value]) => {
|
|
59
63
|
return {
|
|
@@ -63,7 +67,7 @@
|
|
|
63
67
|
};
|
|
64
68
|
});
|
|
65
69
|
|
|
66
|
-
|
|
70
|
+
const options = $derived([...mathOptions, ...easingOptions]);
|
|
67
71
|
|
|
68
72
|
// Select initial option
|
|
69
73
|
onMount(() => {
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
frequency?: number;
|
|
7
|
-
phase?: number;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
value?: any;
|
|
3
|
+
amplitude?: number;
|
|
4
|
+
frequency?: number;
|
|
5
|
+
phase?: number;
|
|
13
6
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export
|
|
17
|
-
export default class PathDataMenuField extends SvelteComponentTyped<PathDataMenuFieldProps, PathDataMenuFieldEvents, PathDataMenuFieldSlots> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
7
|
+
declare const PathDataMenuField: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
8
|
+
type PathDataMenuField = ReturnType<typeof PathDataMenuField>;
|
|
9
|
+
export default PathDataMenuField;
|
package/dist/docs/Preview.svelte
CHANGED
|
@@ -10,12 +10,25 @@
|
|
|
10
10
|
|
|
11
11
|
import Code from './Code.svelte';
|
|
12
12
|
import Json from './Json.svelte';
|
|
13
|
+
import type { Snippet } from 'svelte';
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
let {
|
|
16
|
+
code,
|
|
17
|
+
data,
|
|
18
|
+
language = 'svelte',
|
|
19
|
+
highlightedCode = code ? Prism.highlight(code, Prism.languages.svelte, language) : '',
|
|
20
|
+
showCode = false,
|
|
21
|
+
class: className,
|
|
22
|
+
children,
|
|
23
|
+
}: {
|
|
24
|
+
code?: string;
|
|
25
|
+
data?: any;
|
|
26
|
+
language?: string;
|
|
27
|
+
highlightedCode?: string;
|
|
28
|
+
showCode?: boolean;
|
|
29
|
+
class?: string | null;
|
|
30
|
+
children: Snippet;
|
|
31
|
+
} = $props();
|
|
19
32
|
|
|
20
33
|
/**
|
|
21
34
|
* Custom JSON replacer (to use with JSON.stringify()) to convert `Date` instances to `new Date()`
|
|
@@ -41,9 +54,9 @@
|
|
|
41
54
|
}
|
|
42
55
|
</script>
|
|
43
56
|
|
|
44
|
-
<div class={cls('Preview border rounded-sm bg-surface-100',
|
|
57
|
+
<div class={cls('Preview border rounded-sm bg-surface-100', className)}>
|
|
45
58
|
<div class="p-4">
|
|
46
|
-
|
|
59
|
+
{@render children?.()}
|
|
47
60
|
</div>
|
|
48
61
|
|
|
49
62
|
{#if code && showCode}
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
1
|
import 'prism-svelte';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
events: {
|
|
13
|
-
[evt: string]: CustomEvent<any>;
|
|
14
|
-
};
|
|
15
|
-
slots: {
|
|
16
|
-
default: {};
|
|
17
|
-
};
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
code?: string;
|
|
5
|
+
data?: any;
|
|
6
|
+
language?: string;
|
|
7
|
+
highlightedCode?: string;
|
|
8
|
+
showCode?: boolean;
|
|
9
|
+
class?: string | null;
|
|
10
|
+
children: Snippet;
|
|
18
11
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export
|
|
22
|
-
export default class Preview extends SvelteComponentTyped<PreviewProps, PreviewEvents, PreviewSlots> {
|
|
23
|
-
}
|
|
24
|
-
export {};
|
|
12
|
+
declare const Preview: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
13
|
+
type Preview = ReturnType<typeof Preview>;
|
|
14
|
+
export default Preview;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { SelectField, Switch } from 'svelte-ux';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
let { doubleScale = $bindable(devicePixelRatio > 1), serviceUrl = $bindable() } = $props();
|
|
5
5
|
|
|
6
6
|
// TODO: Access via context, or possibly global state
|
|
7
7
|
const ACCESS_TOKEN =
|
|
8
8
|
'pk.eyJ1IjoidGVjaG5pcTM1IiwiYSI6ImNsZTR5cDd0ZjAyNm8zdnFvczhzdnFpcXkifQ.-LAr8sl5BZ3y-H0pDyD1qA';
|
|
9
9
|
|
|
10
10
|
// https://docs.mapbox.com/api/maps/styles/
|
|
11
|
-
|
|
11
|
+
const mapboxv1 = $derived((style: string) => (x: number, y: number, z: number) => {
|
|
12
12
|
return `https://api.mapbox.com/styles/v1/mapbox/${style}/tiles/${z}/${x}/${y}${
|
|
13
13
|
doubleScale ? '@2x' : ''
|
|
14
14
|
}?access_token=${ACCESS_TOKEN}`;
|
|
15
|
-
};
|
|
15
|
+
});
|
|
16
16
|
|
|
17
17
|
// https://docs.mapbox.com/api/maps/raster-tiles/
|
|
18
18
|
// https://docs.mapbox.com/data/tilesets/reference/mapbox-streets-v8/
|
|
19
|
-
|
|
19
|
+
const mapboxv4 = $derived((tileset: string) => (x: number, y: number, z: number) => {
|
|
20
20
|
return `https://${'abc'[Math.abs(x + y) % 3]}.tiles.mapbox.com/v4/${tileset}/${z}/${x}/${y}${
|
|
21
21
|
doubleScale ? '@2x' : ''
|
|
22
22
|
}.png?access_token=${ACCESS_TOKEN}`;
|
|
23
|
-
};
|
|
23
|
+
});
|
|
24
24
|
|
|
25
25
|
// https://apps.nationalmap.gov/services/
|
|
26
26
|
const nationalmap = (tileset: string) => (x: number, y: number, z: number) => {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
return `https://${s}.tile.opentopomap.org/${z}/${x}/${y}.png`;
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
const services = $derived<Record<string, Record<string, Function>>>({
|
|
58
58
|
'mapbox v1': {
|
|
59
59
|
'streets-v11': mapboxv1('streets-v11'),
|
|
60
60
|
'light-v10': mapboxv1('light-v10'),
|
|
@@ -100,24 +100,25 @@
|
|
|
100
100
|
// 'ArcGIS Vector': {
|
|
101
101
|
// 'Community Map', url: arcgisVector('World_Basemap_v2'),
|
|
102
102
|
// }
|
|
103
|
-
} as Record<string, Record<string, Function>>;
|
|
104
|
-
|
|
105
|
-
$: serviceOptions = Object.entries(services).flatMap(([group, service]) => {
|
|
106
|
-
return Object.entries(service).map(([label, value]) => {
|
|
107
|
-
return { label, value: `${group}:${label}`, group, serviceUrl: value };
|
|
108
|
-
});
|
|
109
103
|
});
|
|
110
104
|
|
|
111
|
-
|
|
112
|
-
|
|
105
|
+
const serviceOptions = $derived(
|
|
106
|
+
Object.entries(services).flatMap(([group, service]) => {
|
|
107
|
+
return Object.entries(service).map(([label, value]) => {
|
|
108
|
+
return { label, value: `${group}:${label}`, group, serviceUrl: value };
|
|
109
|
+
});
|
|
110
|
+
})
|
|
111
|
+
);
|
|
113
112
|
|
|
114
|
-
|
|
113
|
+
const getServiceUrl = $derived((option: string) => {
|
|
115
114
|
const [selectedService, selectedTileset] = selected.split(':');
|
|
116
115
|
return services[selectedService][selectedTileset];
|
|
117
|
-
};
|
|
116
|
+
});
|
|
118
117
|
|
|
119
|
-
let selected = 'mapbox v1:streets-v11';
|
|
120
|
-
|
|
118
|
+
let selected = $state('mapbox v1:streets-v11');
|
|
119
|
+
$effect(() => {
|
|
120
|
+
serviceUrl = getServiceUrl(selected);
|
|
121
|
+
});
|
|
121
122
|
</script>
|
|
122
123
|
|
|
123
124
|
<SelectField
|
|
@@ -128,7 +129,7 @@
|
|
|
128
129
|
toggleIcon={null}
|
|
129
130
|
stepper
|
|
130
131
|
>
|
|
131
|
-
<div slot="append"
|
|
132
|
+
<div slot="append" onclick={(e) => e.stopPropagation()} role="none">
|
|
132
133
|
<div class="text-[10px] text-surface-content/50 text-center">2x</div>
|
|
133
134
|
<Switch bind:checked={doubleScale} size="md" />
|
|
134
135
|
</div>
|
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
events: {
|
|
8
|
-
click: MouseEvent;
|
|
9
|
-
} & {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
13
|
-
};
|
|
14
|
-
export type TilesetFieldProps = typeof __propDef.props;
|
|
15
|
-
export type TilesetFieldEvents = typeof __propDef.events;
|
|
16
|
-
export type TilesetFieldSlots = typeof __propDef.slots;
|
|
17
|
-
export default class TilesetField extends SvelteComponentTyped<TilesetFieldProps, TilesetFieldEvents, TilesetFieldSlots> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
1
|
+
declare const TilesetField: import("svelte").Component<{
|
|
2
|
+
doubleScale?: any;
|
|
3
|
+
serviceUrl?: any;
|
|
4
|
+
}, {}, "doubleScale" | "serviceUrl">;
|
|
5
|
+
type TilesetField = ReturnType<typeof TilesetField>;
|
|
6
|
+
export default TilesetField;
|
|
@@ -2,22 +2,21 @@
|
|
|
2
2
|
import { cls } from '@layerstack/tailwind';
|
|
3
3
|
import { format } from '@layerstack/utils';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { getTransformContext } from '../components/TransformContext.svelte';
|
|
6
6
|
|
|
7
|
-
const transform =
|
|
8
|
-
const { translate, scale } = transform;
|
|
7
|
+
const transform = getTransformContext();
|
|
9
8
|
</script>
|
|
10
9
|
|
|
11
10
|
<div
|
|
12
11
|
class={cls('bg-surface-300/50 rounded-sm m-1 backdrop-blur-sm p-2 tabular-nums', $$props.class)}
|
|
13
12
|
>
|
|
14
13
|
<div class="grid gap-2 text-xs">
|
|
15
|
-
<div><span class="opacity-50">scale:</span> {format(
|
|
14
|
+
<div><span class="opacity-50">scale:</span> {format(transform.scale, 'decimal')}</div>
|
|
16
15
|
|
|
17
16
|
<div>
|
|
18
17
|
<span class="opacity-50">translate:</span>
|
|
19
|
-
<div class="text-right">{format(
|
|
20
|
-
<div class="text-right">{format(
|
|
18
|
+
<div class="text-right">{format(transform.translate.x, 'decimal')}</div>
|
|
19
|
+
<div class="text-right">{format(transform.translate.y, 'decimal')}</div>
|
|
21
20
|
</div>
|
|
22
21
|
</div>
|
|
23
22
|
</div>
|