layerchart 2.0.0-next.44 → 2.0.0-next.46
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/LICENSE +1 -1
- package/dist/components/AnnotationLine.svelte +1 -1
- package/dist/components/AnnotationPoint.svelte +1 -1
- package/dist/components/AnnotationRange.svelte +16 -15
- package/dist/components/Arc.svelte +10 -10
- package/dist/components/Arc.svelte.d.ts +4 -4
- package/dist/components/Arc.svelte.test.d.ts +1 -0
- package/dist/components/Arc.svelte.test.js +868 -0
- package/dist/components/Area.svelte +9 -7
- package/dist/components/Axis.svelte +2 -1
- package/dist/components/Axis.svelte.d.ts +1 -0
- package/dist/components/Bar.svelte +3 -3
- package/dist/components/Bars.svelte +1 -1
- package/dist/components/Blur.svelte +3 -3
- package/dist/components/Bounds.svelte +1 -1
- package/dist/components/BrushContext.svelte +1 -1
- package/dist/components/Calendar.svelte +2 -2
- package/dist/components/Calendar.svelte.d.ts +1 -1
- package/dist/components/Chart.svelte +63 -137
- package/dist/components/Chart.svelte.d.ts +23 -88
- package/dist/components/ChartClipPath.svelte +1 -1
- package/dist/components/Circle.svelte +17 -8
- package/dist/components/Circle.svelte.d.ts +3 -0
- package/dist/components/ClipPath.svelte +4 -4
- package/dist/components/Connector.svelte +4 -4
- package/dist/components/Connector.svelte.d.ts +3 -3
- package/dist/components/Ellipse.svelte +7 -7
- package/dist/components/Frame.svelte +1 -1
- package/dist/components/GeoContext.svelte +4 -20
- package/dist/components/GeoContext.svelte.d.ts +2 -6
- package/dist/components/GeoEdgeFade.svelte +1 -1
- package/dist/components/GeoPath.svelte +42 -107
- package/dist/components/GeoPath.svelte.d.ts +5 -4
- package/dist/components/GeoPoint.svelte +5 -5
- package/dist/components/GeoSpline.svelte +2 -14
- package/dist/components/GeoSpline.svelte.d.ts +1 -1
- package/dist/components/GeoTile.svelte +7 -6
- package/dist/components/GeoVisible.svelte +1 -1
- package/dist/components/Graticule.svelte +4 -7
- package/dist/components/Graticule.svelte.d.ts +2 -1
- package/dist/components/Grid.svelte +1 -1
- package/dist/components/Group.svelte +8 -8
- package/dist/components/Highlight.svelte +18 -16
- package/dist/components/Hull.svelte +2 -2
- package/dist/components/Labels.svelte +1 -1
- package/dist/components/Legend.svelte +1 -1
- package/dist/components/Line.svelte +9 -7
- package/dist/components/LinearGradient.svelte +8 -7
- package/dist/components/MonthPath.svelte +5 -11
- package/dist/components/MonthPath.svelte.d.ts +2 -2
- package/dist/components/Pack.svelte +4 -6
- package/dist/components/Pack.svelte.d.ts +2 -4
- package/dist/components/Partition.svelte +4 -3
- package/dist/components/Partition.svelte.d.ts +2 -1
- package/dist/components/Path.svelte +344 -0
- package/dist/components/Path.svelte.d.ts +72 -0
- package/dist/components/Pattern.svelte +6 -6
- package/dist/components/Pie.svelte +2 -2
- package/dist/components/Pie.svelte.d.ts +1 -1
- package/dist/components/Point.svelte +1 -1
- package/dist/components/Points.svelte +1 -1
- package/dist/components/Polygon.svelte +8 -6
- package/dist/components/RadialGradient.svelte +7 -7
- package/dist/components/Rect.svelte +32 -10
- package/dist/components/Rect.svelte.d.ts +4 -1
- package/dist/components/Rule.svelte +1 -1
- package/dist/components/Sankey.svelte +1 -1
- package/dist/components/Spline.svelte +13 -337
- package/dist/components/Spline.svelte.d.ts +10 -73
- package/dist/components/Text.svelte +9 -7
- package/dist/components/Threshold.svelte +3 -3
- package/dist/components/TransformContext.svelte +10 -143
- package/dist/components/TransformControls.svelte +2 -2
- package/dist/components/TransformControls.svelte.d.ts +1 -1
- package/dist/components/Tree.svelte +4 -3
- package/dist/components/Tree.svelte.d.ts +2 -1
- package/dist/components/Treemap.svelte +4 -3
- package/dist/components/Treemap.svelte.d.ts +2 -1
- package/dist/components/Voronoi.svelte +5 -5
- package/dist/components/charts/ArcChart.svelte +14 -6
- package/dist/components/charts/ArcChart.svelte.d.ts +1 -1
- package/dist/components/charts/AreaChart.svelte +12 -6
- package/dist/components/charts/BarChart.svelte +12 -6
- package/dist/components/charts/DefaultTooltip.svelte +1 -1
- package/dist/components/charts/LineChart.svelte +12 -6
- package/dist/components/charts/PieChart.svelte +14 -6
- package/dist/components/charts/PieChart.svelte.d.ts +1 -1
- package/dist/components/charts/ScatterChart.svelte +11 -9
- package/dist/components/charts/types.d.ts +7 -6
- package/dist/components/index.d.ts +14 -12
- package/dist/components/index.js +14 -12
- package/dist/components/{layout → layers}/Canvas.svelte +13 -60
- package/dist/components/{layout → layers}/Canvas.svelte.d.ts +2 -32
- package/dist/components/{layout → layers}/Html.svelte +18 -3
- package/dist/components/{layout → layers}/Html.svelte.d.ts +7 -0
- package/dist/components/layers/Layer.svelte +85 -0
- package/dist/components/{layout → layers}/Layer.svelte.d.ts +7 -3
- package/dist/components/{layout → layers}/Svg.svelte +18 -3
- package/dist/components/{layout → layers}/Svg.svelte.d.ts +7 -0
- package/dist/components/{layout → layers}/WebGL.svelte +1 -1
- package/dist/components/{layout → layers}/WebGL.svelte.d.ts +3 -3
- package/dist/components/tests/TestHarness.svelte +76 -0
- package/dist/components/tests/TestHarness.svelte.d.ts +19 -0
- package/dist/components/tooltip/Tooltip.svelte +3 -3
- package/dist/components/tooltip/Tooltip.svelte.d.ts +1 -1
- package/dist/components/tooltip/TooltipContext.svelte +13 -45
- package/dist/components/tooltip/TooltipContext.svelte.d.ts +2 -14
- package/dist/components/tooltip/tooltipMetaContext.d.ts +2 -2
- package/dist/components/tooltip/tooltipMetaContext.js +2 -2
- package/dist/contexts/canvas.d.ts +33 -0
- package/dist/contexts/canvas.js +14 -0
- package/dist/contexts/chart.d.ts +84 -0
- package/dist/contexts/chart.js +10 -0
- package/dist/contexts/geo.d.ts +6 -0
- package/dist/contexts/geo.js +12 -0
- package/dist/contexts/index.d.ts +6 -0
- package/dist/contexts/index.js +6 -0
- package/dist/contexts/layer.d.ts +3 -0
- package/dist/contexts/layer.js +8 -0
- package/dist/contexts/settings.d.ts +4 -0
- package/dist/contexts/settings.js +10 -0
- package/dist/contexts/tooltip.d.ts +15 -0
- package/dist/contexts/tooltip.js +8 -0
- package/dist/contexts/transform.d.ts +95 -0
- package/dist/contexts/transform.js +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/states/settings.svelte.d.ts +12 -0
- package/dist/states/settings.svelte.js +10 -0
- package/dist/states/transform.svelte.d.ts +9 -0
- package/dist/states/transform.svelte.js +31 -0
- package/dist/utils/arcText.svelte.d.ts +1 -1
- package/dist/utils/canvas.d.ts +7 -3
- package/dist/utils/canvas.js +78 -11
- package/dist/utils/common.d.ts +8 -1
- package/dist/utils/common.js +9 -10
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/motion.svelte.js +0 -1
- package/dist/utils/rect.svelte.d.ts +1 -1
- package/dist/utils/rect.svelte.js +17 -9
- package/dist/utils/scales.svelte.js +2 -2
- package/dist/utils/string.d.ts +3 -1
- package/package.json +32 -54
- package/README.md +0 -41
- package/dist/components/layout/Layer.svelte +0 -41
- package/dist/docs/Blockquote.svelte +0 -17
- package/dist/docs/Blockquote.svelte.d.ts +0 -5
- package/dist/docs/Code.svelte +0 -80
- package/dist/docs/Code.svelte.d.ts +0 -14
- package/dist/docs/ConnectorSweepMenuField.svelte +0 -17
- package/dist/docs/ConnectorSweepMenuField.svelte.d.ts +0 -7
- package/dist/docs/ConnectorTypeMenuField.svelte +0 -17
- package/dist/docs/ConnectorTypeMenuField.svelte.d.ts +0 -7
- package/dist/docs/CurveMenuField.svelte +0 -44
- package/dist/docs/CurveMenuField.svelte.d.ts +0 -9
- package/dist/docs/GeoDebug.svelte +0 -60
- package/dist/docs/GeoDebug.svelte.d.ts +0 -4
- package/dist/docs/Header1.svelte +0 -16
- package/dist/docs/Header1.svelte.d.ts +0 -5
- package/dist/docs/Json.svelte +0 -36
- package/dist/docs/Json.svelte.d.ts +0 -10
- package/dist/docs/Layout.svelte +0 -21
- package/dist/docs/Layout.svelte.d.ts +0 -8
- package/dist/docs/Link.svelte +0 -9
- package/dist/docs/Link.svelte.d.ts +0 -5
- package/dist/docs/PathDataMenuField.svelte +0 -78
- package/dist/docs/PathDataMenuField.svelte.d.ts +0 -9
- package/dist/docs/Preview.svelte +0 -104
- package/dist/docs/Preview.svelte.d.ts +0 -13
- package/dist/docs/TilesetField.svelte +0 -136
- package/dist/docs/TilesetField.svelte.d.ts +0 -6
- package/dist/docs/TransformDebug.svelte +0 -22
- package/dist/docs/TransformDebug.svelte.d.ts +0 -20
- package/dist/docs/ViewSourceButton.svelte +0 -53
- package/dist/docs/ViewSourceButton.svelte.d.ts +0 -11
- package/dist/utils/graph/dagre.d.ts +0 -34
- /package/dist/{utils → contexts}/legendPayload.d.ts +0 -0
- /package/dist/{utils → contexts}/legendPayload.js +0 -0
package/package.json
CHANGED
|
@@ -5,23 +5,18 @@
|
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "techniq/layerchart",
|
|
7
7
|
"homepage": "https://layerchart.com",
|
|
8
|
-
"version": "2.0.0-next.
|
|
8
|
+
"version": "2.0.0-next.46",
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@changesets/cli": "^2.29.
|
|
11
|
-
"@
|
|
12
|
-
"@
|
|
13
|
-
"@sveltejs/
|
|
14
|
-
"@sveltejs/
|
|
15
|
-
"@sveltejs/package": "^2.4.1",
|
|
16
|
-
"@sveltejs/vite-plugin-svelte": "^6.1.2",
|
|
10
|
+
"@changesets/cli": "^2.29.8",
|
|
11
|
+
"@sveltejs/adapter-auto": "^7.0.1",
|
|
12
|
+
"@sveltejs/kit": "^2.52.2",
|
|
13
|
+
"@sveltejs/package": "^2.5.7",
|
|
14
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
17
15
|
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
|
|
18
|
-
"@tailwindcss/typography": "^0.5.16",
|
|
19
|
-
"@tailwindcss/vite": "^4.1.12",
|
|
20
16
|
"@types/d3": "^7.4.3",
|
|
21
|
-
"@types/d3-array": "^3.2.
|
|
17
|
+
"@types/d3-array": "^3.2.2",
|
|
22
18
|
"@types/d3-color": "^3.1.3",
|
|
23
19
|
"@types/d3-delaunay": "^6.0.4",
|
|
24
|
-
"@types/d3-dsv": "^3.0.7",
|
|
25
20
|
"@types/d3-force": "^3.0.10",
|
|
26
21
|
"@types/d3-geo": "^3.1.0",
|
|
27
22
|
"@types/d3-hierarchy": "^3.1.7",
|
|
@@ -30,49 +25,33 @@
|
|
|
30
25
|
"@types/d3-path": "^3.1.1",
|
|
31
26
|
"@types/d3-quadtree": "^3.0.6",
|
|
32
27
|
"@types/d3-random": "^3.0.3",
|
|
33
|
-
"@types/d3-sankey": "^0.12.
|
|
28
|
+
"@types/d3-sankey": "^0.12.5",
|
|
34
29
|
"@types/d3-scale": "^4.0.9",
|
|
35
30
|
"@types/d3-scale-chromatic": "^3.1.0",
|
|
36
|
-
"@types/d3-shape": "^3.1.
|
|
31
|
+
"@types/d3-shape": "^3.1.8",
|
|
37
32
|
"@types/d3-time": "^3.0.4",
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"rehype-slug": "^6.0.0",
|
|
48
|
-
"rollup-plugin-visualizer": "^6.0.3",
|
|
49
|
-
"shapefile": "^0.6.6",
|
|
50
|
-
"shiki": "^3.9.2",
|
|
51
|
-
"solar-calculator": "^0.3.0",
|
|
52
|
-
"svelte": "^5.38.2",
|
|
53
|
-
"svelte-check": "^4.3.1",
|
|
54
|
-
"svelte-json-tree": "^2.2.0",
|
|
55
|
-
"svelte-ux": "2.0.0-next.17",
|
|
56
|
-
"svelte2tsx": "^0.7.42",
|
|
57
|
-
"tailwindcss": "^4.1.12",
|
|
58
|
-
"topojson-client": "^3.1.0",
|
|
59
|
-
"topojson-simplify": "^3.0.3",
|
|
33
|
+
"@vitest/browser": "^4.0.18",
|
|
34
|
+
"@vitest/browser-playwright": "^4.0.18",
|
|
35
|
+
"@vitest/ui": "^4.0.18",
|
|
36
|
+
"playwright": "^1.58.2",
|
|
37
|
+
"prettier": "^3.8.1",
|
|
38
|
+
"prettier-plugin-svelte": "^3.5.0",
|
|
39
|
+
"svelte": "5.53.0",
|
|
40
|
+
"svelte-check": "^4.4.1",
|
|
41
|
+
"svelte2tsx": "^0.7.49",
|
|
60
42
|
"tslib": "^2.8.1",
|
|
61
|
-
"typescript": "^5.9.
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"vite": "^7.1.2",
|
|
66
|
-
"vite-plugin-devtools-json": "^1.0.0",
|
|
67
|
-
"vitest": "^3.2.4"
|
|
43
|
+
"typescript": "^5.9.3",
|
|
44
|
+
"vite": "^7.3.1",
|
|
45
|
+
"vitest": "^4.0.18",
|
|
46
|
+
"vitest-browser-svelte": "^2.0.2"
|
|
68
47
|
},
|
|
69
48
|
"type": "module",
|
|
70
49
|
"dependencies": {
|
|
71
|
-
"@dagrejs/dagre": "^
|
|
72
|
-
"@layerstack/svelte-actions": "1.0.1-next.
|
|
73
|
-
"@layerstack/svelte-state": "0.1.0-next.
|
|
74
|
-
"@layerstack/tailwind": "2.0.0-next.
|
|
75
|
-
"@layerstack/utils": "2.0.0-next.
|
|
50
|
+
"@dagrejs/dagre": "^2.0.4",
|
|
51
|
+
"@layerstack/svelte-actions": "1.0.1-next.18",
|
|
52
|
+
"@layerstack/svelte-state": "0.1.0-next.23",
|
|
53
|
+
"@layerstack/tailwind": "2.0.0-next.21",
|
|
54
|
+
"@layerstack/utils": "2.0.0-next.18",
|
|
76
55
|
"d3-array": "^3.2.4",
|
|
77
56
|
"d3-color": "^3.1.0",
|
|
78
57
|
"d3-delaunay": "^6.0.4",
|
|
@@ -92,9 +71,8 @@
|
|
|
92
71
|
"d3-shape": "^3.2.0",
|
|
93
72
|
"d3-tile": "^1.0.0",
|
|
94
73
|
"d3-time": "^3.1.0",
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"runed": "^0.31.1"
|
|
74
|
+
"memoize": "^10.2.0",
|
|
75
|
+
"runed": "^0.37.1"
|
|
98
76
|
},
|
|
99
77
|
"peerDependencies": {
|
|
100
78
|
"svelte": "^5.0.0"
|
|
@@ -121,13 +99,13 @@
|
|
|
121
99
|
],
|
|
122
100
|
"svelte": "./dist/index.js",
|
|
123
101
|
"scripts": {
|
|
124
|
-
"dev": "
|
|
125
|
-
"build": "vite build",
|
|
126
|
-
"preview": "vite preview",
|
|
102
|
+
"dev": "pnpm package:watch",
|
|
127
103
|
"package": "svelte-package",
|
|
104
|
+
"package:watch": "svelte-package --watch",
|
|
128
105
|
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
129
106
|
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
|
|
130
107
|
"test:unit": "TZ=UTC-5 vitest",
|
|
108
|
+
"test:ui": "TZ=UTC-5 vitest --ui",
|
|
131
109
|
"lint": "prettier --check .",
|
|
132
110
|
"format": "prettier --write ."
|
|
133
111
|
}
|
package/README.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# LayerChart
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
[](https://www.npmjs.com/package/layerchart)
|
|
5
|
-

|
|
6
|
-
|
|
7
|
-

|
|
8
|
-
[](https://discord.gg/697JhMPD3t)
|
|
9
|
-
|
|
10
|
-
A large collection of composable Svelte chart components to build a wide range of visualizations
|
|
11
|
-
|
|
12
|
-
- Cartesian (Bar, Area, Stack, Scatter)
|
|
13
|
-
- Radial (Pie, Arc, Sunburst)
|
|
14
|
-
- Hierarchy (Pack, Tree, Treemap, Sunburst)
|
|
15
|
-
- Graph (Sankey)
|
|
16
|
-
- Geo (Choropleth, Spike, Bubble, Point, Globe)
|
|
17
|
-
|
|
18
|
-
Interactions
|
|
19
|
-
|
|
20
|
-
- Tooltip, Highlights, Pan/Zoom
|
|
21
|
-
|
|
22
|
-
SVG
|
|
23
|
-
|
|
24
|
-
- Basic (Arc, Circle, Group, Line, Spline, Text)
|
|
25
|
-
- Gradients and Patterns
|
|
26
|
-
- ClipPath
|
|
27
|
-
- Multi-line text
|
|
28
|
-
|
|
29
|
-
Others
|
|
30
|
-
|
|
31
|
-
- Legends including ColorRamps
|
|
32
|
-
|
|
33
|
-
See also [Svelte UX](http://svelte-ux.techniq.dev) for a large collection of components, actions, stores, and utilities to build highly interactive applications.
|
|
34
|
-
|
|
35
|
-
## Publishing
|
|
36
|
-
|
|
37
|
-
- `npm run changeset` for each changelog worthy change
|
|
38
|
-
- `npm run version` to bump `package.json` version based on changesets, materialize changesets into CHANGELOG.md
|
|
39
|
-
- Commit as `Version bump to x.y.z` (TODO: automate)
|
|
40
|
-
- `npm run publish` to publish version to npm
|
|
41
|
-
- `git push --tags` to publish tags to Github
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<script lang="ts" module>
|
|
2
|
-
import type { ComponentProps } from 'svelte';
|
|
3
|
-
|
|
4
|
-
export type CanvasLayerProps = {
|
|
5
|
-
type: 'canvas';
|
|
6
|
-
} & Omit<ComponentProps<typeof Canvas>, 'type' | 'onpointermove'>;
|
|
7
|
-
|
|
8
|
-
export type HtmlLayerProps = {
|
|
9
|
-
type: 'html';
|
|
10
|
-
} & Omit<ComponentProps<typeof Html>, 'type' | 'onpointermove'>;
|
|
11
|
-
|
|
12
|
-
export type SvgLayerProps = {
|
|
13
|
-
type: 'svg';
|
|
14
|
-
} & Omit<ComponentProps<typeof Svg>, 'type' | 'onpointermove'>;
|
|
15
|
-
|
|
16
|
-
export type LayerProps = (CanvasLayerProps | HtmlLayerProps | SvgLayerProps) & {
|
|
17
|
-
onpointermove?: (e: PointerEvent) => void;
|
|
18
|
-
};
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<script lang="ts">
|
|
22
|
-
import Canvas from './Canvas.svelte';
|
|
23
|
-
import Html from './Html.svelte';
|
|
24
|
-
import Svg from './Svg.svelte';
|
|
25
|
-
|
|
26
|
-
let { type, children, ...restProps }: LayerProps = $props();
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
{#if type === 'canvas'}
|
|
30
|
-
<Canvas {...restProps as ComponentProps<typeof Canvas>}>
|
|
31
|
-
{@render children?.()}
|
|
32
|
-
</Canvas>
|
|
33
|
-
{:else if type === 'svg'}
|
|
34
|
-
<Svg {...restProps as ComponentProps<typeof Svg>}>
|
|
35
|
-
{@render children?.()}
|
|
36
|
-
</Svg>
|
|
37
|
-
{:else if type === 'html'}
|
|
38
|
-
<Html {...restProps as ComponentProps<typeof Html>}>
|
|
39
|
-
{@render children?.()}
|
|
40
|
-
</Html>
|
|
41
|
-
{/if}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { cls } from '@layerstack/tailwind';
|
|
3
|
-
|
|
4
|
-
import LucideInfo from '~icons/lucide/info';
|
|
5
|
-
|
|
6
|
-
const { children } = $props();
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<div
|
|
10
|
-
class={cls(
|
|
11
|
-
'bg-primary/10 border border-l-[6px] border-primary/30 border-l-primary text-primary px-4 py-2 my-4 rounded-sm flex items-center gap-2 text-sm',
|
|
12
|
-
'[&>a]:font-medium [&>a]:underline [&>a]:decoration-dashed [&>a]:decoration-primary/50 [&>a]:underline-offset-2'
|
|
13
|
-
)}
|
|
14
|
-
>
|
|
15
|
-
<LucideInfo class="text-primary" />
|
|
16
|
-
{@render children()}
|
|
17
|
-
</div>
|
package/dist/docs/Code.svelte
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
<script module>
|
|
2
|
-
import { createHighlighter } from 'shiki';
|
|
3
|
-
|
|
4
|
-
const highlighter = createHighlighter({
|
|
5
|
-
themes: ['github-light-default', 'github-dark-default'],
|
|
6
|
-
langs: ['svelte', 'javascript', 'ts', 'typescript', 'json', 'sh'],
|
|
7
|
-
});
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<script lang="ts">
|
|
11
|
-
import { CopyButton } from 'svelte-ux';
|
|
12
|
-
import { cls } from '@layerstack/tailwind';
|
|
13
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
14
|
-
|
|
15
|
-
interface Props {
|
|
16
|
-
source?: string | null;
|
|
17
|
-
language?: string;
|
|
18
|
-
classes?: { root?: string; pre?: string; code?: string };
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
let {
|
|
22
|
-
source = null,
|
|
23
|
-
language = 'svelte',
|
|
24
|
-
classes = {},
|
|
25
|
-
class: className,
|
|
26
|
-
}: Props & HTMLAttributes<HTMLDivElement> = $props();
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<div
|
|
30
|
-
class={cls(
|
|
31
|
-
'Code',
|
|
32
|
-
'relative bg-surface-200 dark:bg-surface-300 p-4 overflow-auto not-prose',
|
|
33
|
-
classes.root,
|
|
34
|
-
className
|
|
35
|
-
)}
|
|
36
|
-
>
|
|
37
|
-
{#if source}
|
|
38
|
-
<pre class={cls('whitespace-normal overflow-auto', classes.pre)}>
|
|
39
|
-
<code class={cls('text-xs', classes.code)}>
|
|
40
|
-
{#await highlighter}
|
|
41
|
-
<div>Loading...</div>
|
|
42
|
-
{:then h}
|
|
43
|
-
{@html h.codeToHtml(source, {
|
|
44
|
-
lang: language,
|
|
45
|
-
themes: {
|
|
46
|
-
light: 'github-light-default',
|
|
47
|
-
dark: 'github-dark-default',
|
|
48
|
-
},
|
|
49
|
-
})}
|
|
50
|
-
{:catch error}
|
|
51
|
-
<div class="text-red-500">Error loading code highlighting: {error.message}</div>
|
|
52
|
-
{/await}
|
|
53
|
-
|
|
54
|
-
</code>
|
|
55
|
-
</pre>
|
|
56
|
-
|
|
57
|
-
<div class="absolute top-0 right-0 p-2 z-10">
|
|
58
|
-
<CopyButton
|
|
59
|
-
value={source ?? ''}
|
|
60
|
-
class="text-surface-content/70 hover:bg-surface-100/20 py-1 backdrop-blur-md"
|
|
61
|
-
size="sm"
|
|
62
|
-
/>
|
|
63
|
-
</div>
|
|
64
|
-
{/if}
|
|
65
|
-
</div>
|
|
66
|
-
|
|
67
|
-
<style>
|
|
68
|
-
:global(.shiki) {
|
|
69
|
-
background-color: transparent !important;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
:global(html.dark .shiki),
|
|
73
|
-
:global(html.dark .shiki span) {
|
|
74
|
-
color: var(--shiki-dark) !important;
|
|
75
|
-
/* background-color: var(--shiki-dark-bg) !important; */
|
|
76
|
-
font-style: var(--shiki-dark-font-style) !important;
|
|
77
|
-
font-weight: var(--shiki-dark-font-weight) !important;
|
|
78
|
-
text-decoration: var(--shiki-dark-text-decoration) !important;
|
|
79
|
-
}
|
|
80
|
-
</style>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
2
|
-
interface Props {
|
|
3
|
-
source?: string | null;
|
|
4
|
-
language?: string;
|
|
5
|
-
classes?: {
|
|
6
|
-
root?: string;
|
|
7
|
-
pre?: string;
|
|
8
|
-
code?: string;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
type $$ComponentProps = Props & HTMLAttributes<HTMLDivElement>;
|
|
12
|
-
declare const Code: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
13
|
-
type Code = ReturnType<typeof Code>;
|
|
14
|
-
export default Code;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { MenuField } from 'svelte-ux';
|
|
3
|
-
import type { ConnectorSweep } from '../utils/connectorUtils.js';
|
|
4
|
-
|
|
5
|
-
let {
|
|
6
|
-
value = $bindable('horizontal-vertical'),
|
|
7
|
-
}: {
|
|
8
|
-
value?: ConnectorSweep;
|
|
9
|
-
} = $props();
|
|
10
|
-
|
|
11
|
-
const options = ['horizontal-vertical', 'vertical-horizontal', 'none'].map((type) => ({
|
|
12
|
-
label: type,
|
|
13
|
-
value: type,
|
|
14
|
-
}));
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<MenuField label="Connector Sweep" {options} bind:value stepper classes={{ menuIcon: 'hidden' }} />
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ConnectorSweep } from '../utils/connectorUtils.js';
|
|
2
|
-
type $$ComponentProps = {
|
|
3
|
-
value?: ConnectorSweep;
|
|
4
|
-
};
|
|
5
|
-
declare const ConnectorSweepMenuField: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
6
|
-
type ConnectorSweepMenuField = ReturnType<typeof ConnectorSweepMenuField>;
|
|
7
|
-
export default ConnectorSweepMenuField;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { MenuField } from 'svelte-ux';
|
|
3
|
-
import type { ConnectorType } from '../utils/connectorUtils.js';
|
|
4
|
-
|
|
5
|
-
let {
|
|
6
|
-
value = $bindable('rounded'),
|
|
7
|
-
}: {
|
|
8
|
-
value?: ConnectorType;
|
|
9
|
-
} = $props();
|
|
10
|
-
|
|
11
|
-
const options = ['straight', 'square', 'beveled', 'rounded', 'd3'].map((type) => ({
|
|
12
|
-
label: type,
|
|
13
|
-
value: type,
|
|
14
|
-
}));
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<MenuField label="Connector Type" {options} bind:value stepper classes={{ menuIcon: 'hidden' }} />
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ConnectorType } from '../utils/connectorUtils.js';
|
|
2
|
-
type $$ComponentProps = {
|
|
3
|
-
value?: ConnectorType;
|
|
4
|
-
};
|
|
5
|
-
declare const ConnectorTypeMenuField: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
6
|
-
type ConnectorTypeMenuField = ReturnType<typeof ConnectorTypeMenuField>;
|
|
7
|
-
export default ConnectorTypeMenuField;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import * as d3shapes from 'd3-shape';
|
|
3
|
-
|
|
4
|
-
import { MenuField } from 'svelte-ux';
|
|
5
|
-
import { entries } from '@layerstack/utils';
|
|
6
|
-
import type { ComponentProps } from 'svelte';
|
|
7
|
-
|
|
8
|
-
let {
|
|
9
|
-
value = $bindable(),
|
|
10
|
-
showOpenClosed = false,
|
|
11
|
-
...restProps
|
|
12
|
-
}: {
|
|
13
|
-
value?: any;
|
|
14
|
-
showOpenClosed?: boolean;
|
|
15
|
-
} & ComponentProps<MenuField> = $props();
|
|
16
|
-
|
|
17
|
-
if (value === undefined) {
|
|
18
|
-
value = d3shapes['curveLinear'];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const options = entries(d3shapes)
|
|
22
|
-
.filter(([key]) => {
|
|
23
|
-
return (
|
|
24
|
-
key.startsWith('curve') &&
|
|
25
|
-
(showOpenClosed ? true : !key.endsWith('Open') && !key.endsWith('Closed')) &&
|
|
26
|
-
!key.includes('Bundle') // Not compatibile with area
|
|
27
|
-
);
|
|
28
|
-
})
|
|
29
|
-
.map(([key, value]) => {
|
|
30
|
-
return {
|
|
31
|
-
label: key.replace('curve', ''),
|
|
32
|
-
value: value,
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<MenuField
|
|
38
|
-
label="Curve"
|
|
39
|
-
{options}
|
|
40
|
-
bind:value
|
|
41
|
-
stepper
|
|
42
|
-
classes={{ menuIcon: 'hidden' }}
|
|
43
|
-
{...restProps}
|
|
44
|
-
/>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MenuField } from 'svelte-ux';
|
|
2
|
-
import type { ComponentProps } from 'svelte';
|
|
3
|
-
type $$ComponentProps = {
|
|
4
|
-
value?: any;
|
|
5
|
-
showOpenClosed?: boolean;
|
|
6
|
-
} & ComponentProps<MenuField>;
|
|
7
|
-
declare const CurveMenuField: import("svelte").Component<$$ComponentProps, {}, "value">;
|
|
8
|
-
type CurveMenuField = ReturnType<typeof CurveMenuField>;
|
|
9
|
-
export default CurveMenuField;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { Checkbox } from 'svelte-ux';
|
|
3
|
-
import { cls } from '@layerstack/tailwind';
|
|
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';
|
|
8
|
-
|
|
9
|
-
const ctx = getChartContext();
|
|
10
|
-
const geoCtx = getGeoContext();
|
|
11
|
-
|
|
12
|
-
let { class: className }: HTMLAttributes<HTMLElement> = $props();
|
|
13
|
-
|
|
14
|
-
let showCenter = $state(false);
|
|
15
|
-
</script>
|
|
16
|
-
|
|
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>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
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}
|
|
60
|
-
{/if}
|
package/dist/docs/Header1.svelte
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { SectionDivider } from 'svelte-ux';
|
|
3
|
-
|
|
4
|
-
let { children, ...restProps } = $props();
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<!--
|
|
8
|
-
TODO:
|
|
9
|
-
- [ ] Set id based on slot value
|
|
10
|
-
- Needed for #examples, #api, etc
|
|
11
|
-
- Maybe possible to set/get props from markdown/mdsvex
|
|
12
|
-
- Example: `#API { id: 'api' }
|
|
13
|
-
-->
|
|
14
|
-
<SectionDivider {...restProps}>
|
|
15
|
-
{@render children()}
|
|
16
|
-
</SectionDivider>
|
package/dist/docs/Json.svelte
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import { type ComponentProps } from 'svelte';
|
|
3
|
-
import JsonTree from 'svelte-json-tree';
|
|
4
|
-
import { cls } from '@layerstack/tailwind';
|
|
5
|
-
|
|
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();
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<div class={cls('overflow-auto px-4 py-2 bg-[#1e1e1e]', className)}>
|
|
18
|
-
<JsonTree
|
|
19
|
-
{value}
|
|
20
|
-
{defaultExpandedPaths}
|
|
21
|
-
shouldTreatIterableAsObject
|
|
22
|
-
--json-tree-property-color="#72a2d3"
|
|
23
|
-
--json-tree-string-color="#6cd1c7"
|
|
24
|
-
--json-tree-symbol-color="#6cd1c7"
|
|
25
|
-
--json-tree-boolean-color="#9681f7"
|
|
26
|
-
--json-tree-function-color="#e59b6f"
|
|
27
|
-
--json-tree-number-color="#9681f7"
|
|
28
|
-
--json-tree-label-color="#9ca0a5"
|
|
29
|
-
--json-tree-arrow-color="#e8eaed"
|
|
30
|
-
--json-tree-null-color="#81868a"
|
|
31
|
-
--json-tree-undefined-color="#81868a"
|
|
32
|
-
--json-tree-date-color="#9ca0a5"
|
|
33
|
-
--json-tree-operator-color="#e8eaed"
|
|
34
|
-
--json-tree-regex-color="#6cd1c7"
|
|
35
|
-
/>
|
|
36
|
-
</div>
|
|
@@ -1,10 +0,0 @@
|
|
|
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;
|
|
7
|
-
};
|
|
8
|
-
declare const Json: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
|
-
type Json = ReturnType<typeof Json>;
|
|
10
|
-
export default Json;
|
package/dist/docs/Layout.svelte
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<script module>
|
|
2
|
-
// Custom components: https://mdsvex.com/docs#custom-components
|
|
3
|
-
import blockquote from './Blockquote.svelte';
|
|
4
|
-
import a from './Link.svelte';
|
|
5
|
-
import h1 from './Header1.svelte';
|
|
6
|
-
|
|
7
|
-
export { a, blockquote };
|
|
8
|
-
</script>
|
|
9
|
-
|
|
10
|
-
<script lang="ts">
|
|
11
|
-
let {
|
|
12
|
-
// frontmatter: https://mdsvex.com/docs#frontmatter-1
|
|
13
|
-
// name,
|
|
14
|
-
// sourceUrl,
|
|
15
|
-
// docUrl,
|
|
16
|
-
// description,
|
|
17
|
-
children,
|
|
18
|
-
} = $props();
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
{@render children()}
|
package/dist/docs/Link.svelte
DELETED