layerchart 2.0.0-next.2 → 2.0.0-next.21
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/AnnotationLine.svelte +17 -29
- package/dist/components/AnnotationLine.svelte.d.ts +4 -2
- package/dist/components/AnnotationPoint.svelte +11 -13
- package/dist/components/AnnotationPoint.svelte.d.ts +4 -2
- package/dist/components/AnnotationRange.svelte +3 -3
- package/dist/components/Arc.svelte +2 -2
- package/dist/components/Axis.svelte +52 -24
- package/dist/components/Axis.svelte.d.ts +14 -3
- package/dist/components/Bar.svelte +7 -4
- package/dist/components/Bar.svelte.d.ts +4 -1
- package/dist/components/Bars.svelte +9 -6
- package/dist/components/Bars.svelte.d.ts +3 -3
- package/dist/components/Blur.svelte +20 -12
- package/dist/components/Blur.svelte.d.ts +2 -5
- package/dist/components/Calendar.svelte +10 -6
- package/dist/components/Calendar.svelte.d.ts +2 -1
- package/dist/components/Chart.svelte +2 -2
- package/dist/components/ClipPath.svelte +14 -9
- package/dist/components/Connector.svelte +2 -2
- package/dist/components/Connector.svelte.d.ts +1 -1
- package/dist/components/Ellipse.svelte +187 -0
- package/dist/components/Ellipse.svelte.d.ts +64 -0
- package/dist/components/ForceSimulation.svelte +168 -50
- package/dist/components/ForceSimulation.svelte.d.ts +80 -21
- package/dist/components/GeoEdgeFade.svelte +4 -3
- package/dist/components/GeoEdgeFade.svelte.d.ts +2 -2
- package/dist/components/GeoPath.svelte +12 -5
- package/dist/components/GeoPoint.svelte +1 -2
- package/dist/components/GeoSpline.svelte +4 -4
- package/dist/components/GeoSpline.svelte.d.ts +1 -1
- package/dist/components/Graticule.svelte +3 -2
- package/dist/components/Grid.svelte +8 -7
- package/dist/components/Grid.svelte.d.ts +2 -1
- package/dist/components/Group.svelte +45 -5
- package/dist/components/Group.svelte.d.ts +32 -4
- package/dist/components/Highlight.svelte +1 -1
- package/dist/components/Hull.svelte +4 -4
- package/dist/components/Hull.svelte.d.ts +2 -2
- package/dist/components/Labels.svelte +6 -4
- package/dist/components/Labels.svelte.d.ts +2 -2
- package/dist/components/Legend.svelte +8 -5
- package/dist/components/Legend.svelte.d.ts +3 -3
- package/dist/components/MonthPath.svelte +14 -11
- package/dist/components/MonthPath.svelte.d.ts +4 -3
- package/dist/components/Polygon.svelte +285 -0
- package/dist/components/Polygon.svelte.d.ts +115 -0
- package/dist/components/RadialGradient.svelte +1 -3
- package/dist/components/Rule.svelte +3 -2
- package/dist/components/Spline.svelte +30 -18
- package/dist/components/Spline.svelte.d.ts +12 -4
- package/dist/components/Text.svelte +60 -48
- package/dist/components/Text.svelte.d.ts +6 -0
- package/dist/components/Treemap.svelte +63 -26
- package/dist/components/Treemap.svelte.d.ts +11 -11
- package/dist/components/Voronoi.svelte +55 -36
- package/dist/components/Voronoi.svelte.d.ts +5 -3
- package/dist/components/charts/ArcChart.svelte +2 -2
- package/dist/components/charts/AreaChart.svelte +9 -10
- package/dist/components/charts/BarChart.svelte +63 -53
- package/dist/components/charts/DefaultTooltip.svelte +1 -1
- package/dist/components/charts/LineChart.svelte +8 -5
- package/dist/components/charts/PieChart.svelte +2 -2
- package/dist/components/charts/ScatterChart.svelte +0 -2
- package/dist/components/charts/utils.svelte.d.ts +3 -3
- package/dist/components/charts/utils.svelte.js +7 -3
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +4 -0
- package/dist/components/layout/Canvas.svelte +67 -49
- package/dist/components/layout/Canvas.svelte.d.ts +6 -0
- package/dist/components/layout/Layer.svelte +6 -4
- package/dist/components/layout/Layer.svelte.d.ts +6 -4
- package/dist/components/tooltip/Tooltip.svelte +14 -7
- package/dist/components/tooltip/TooltipContext.svelte +25 -8
- package/dist/components/tooltip/TooltipContext.svelte.d.ts +1 -1
- package/dist/components/tooltip/TooltipHeader.svelte +5 -4
- package/dist/components/tooltip/TooltipHeader.svelte.d.ts +3 -3
- package/dist/components/tooltip/TooltipItem.svelte +5 -4
- package/dist/components/tooltip/TooltipItem.svelte.d.ts +3 -3
- package/dist/components/tooltip/TooltipList.svelte +1 -1
- package/dist/components/tooltip/tooltipMetaContext.d.ts +2 -2
- package/dist/docs/Blockquote.svelte +3 -1
- package/dist/docs/Blockquote.svelte.d.ts +4 -19
- package/dist/docs/Code.svelte +20 -12
- package/dist/docs/Code.svelte.d.ts +9 -23
- package/dist/docs/Header1.svelte +4 -2
- package/dist/docs/Header1.svelte.d.ts +4 -28
- package/dist/docs/Json.svelte +11 -3
- package/dist/docs/Json.svelte.d.ts +9 -21
- package/dist/docs/Layout.svelte +10 -7
- package/dist/docs/Layout.svelte.d.ts +4 -19
- package/dist/docs/Link.svelte +7 -3
- package/dist/docs/Link.svelte.d.ts +4 -38
- package/dist/docs/TilesetField.svelte +20 -19
- package/dist/docs/TilesetField.svelte.d.ts +5 -22
- package/dist/docs/ViewSourceButton.svelte +7 -4
- package/dist/docs/ViewSourceButton.svelte.d.ts +7 -21
- package/dist/utils/arcText.svelte.js +4 -4
- package/dist/utils/canvas.d.ts +77 -0
- package/dist/utils/canvas.js +105 -41
- package/dist/utils/genData.d.ts +14 -0
- package/dist/utils/genData.js +24 -6
- package/dist/utils/path.d.ts +10 -0
- package/dist/utils/path.js +30 -0
- package/dist/utils/scales.svelte.d.ts +3 -2
- package/dist/utils/scales.svelte.js +7 -3
- package/dist/utils/shape.d.ts +43 -0
- package/dist/utils/shape.js +59 -0
- package/dist/utils/string.d.ts +49 -0
- package/dist/utils/string.js +4 -2
- package/dist/utils/ticks.d.ts +4 -4
- package/dist/utils/ticks.js +106 -159
- package/dist/utils/ticks.test.js +6 -16
- package/dist/utils/treemap.d.ts +1 -1
- package/package.json +27 -24
- package/dist/utils/object.js +0 -2
|
@@ -1,29 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
(internal: unknown, props: Props & {
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
15
|
-
default: any;
|
|
16
|
-
} ? Props extends Record<string, never> ? any : {
|
|
17
|
-
children?: any;
|
|
18
|
-
} : {});
|
|
19
|
-
declare const Header1: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
20
|
-
[x: string]: any;
|
|
21
|
-
}, {
|
|
22
|
-
default: {};
|
|
23
|
-
}>, {
|
|
24
|
-
[evt: string]: CustomEvent<any>;
|
|
25
|
-
}, {
|
|
26
|
-
default: {};
|
|
27
|
-
}, {}, string>;
|
|
28
|
-
type Header1 = InstanceType<typeof Header1>;
|
|
1
|
+
declare const Header1: import("svelte").Component<{
|
|
2
|
+
children: any;
|
|
3
|
+
} & Record<string, any>, {}, "">;
|
|
4
|
+
type Header1 = ReturnType<typeof Header1>;
|
|
29
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,22 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const Json: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
-
[x: string]: any;
|
|
16
|
-
value: any;
|
|
17
|
-
defaultExpandedPaths?: string[] | undefined;
|
|
18
|
-
}, {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
}, {}, {}, string>;
|
|
21
|
-
type Json = InstanceType<typeof Json>;
|
|
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>;
|
|
22
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,23 +1,8 @@
|
|
|
1
1
|
import blockquote from './Blockquote.svelte';
|
|
2
2
|
import a from './Link.svelte';
|
|
3
3
|
export { a, blockquote };
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
(internal: unknown, props: {
|
|
9
|
-
$$events?: Events;
|
|
10
|
-
$$slots?: Slots;
|
|
11
|
-
}): Exports & {
|
|
12
|
-
$set?: any;
|
|
13
|
-
$on?: any;
|
|
14
|
-
};
|
|
15
|
-
z_$$bindings?: Bindings;
|
|
16
|
-
}
|
|
17
|
-
declare const Layout: $$__sveltets_2_IsomorphicComponent<any, {
|
|
18
|
-
[evt: string]: CustomEvent<any>;
|
|
19
|
-
}, {
|
|
20
|
-
default: {};
|
|
21
|
-
}, {}, string>;
|
|
22
|
-
type Layout = InstanceType<typeof Layout>;
|
|
4
|
+
declare const Layout: import("svelte").Component<{
|
|
5
|
+
children: any;
|
|
6
|
+
}, {}, "">;
|
|
7
|
+
type Layout = ReturnType<typeof Layout>;
|
|
23
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,39 +1,5 @@
|
|
|
1
|
+
declare const Link: import("svelte").Component<{
|
|
2
|
+
children: any;
|
|
3
|
+
} & Record<string, any>, {}, "">;
|
|
4
|
+
type Link = ReturnType<typeof Link>;
|
|
1
5
|
export default Link;
|
|
2
|
-
type Link = SvelteComponent<$$__sveltets_2_PropsWithChildren<{
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
}, {
|
|
5
|
-
default: {};
|
|
6
|
-
}>, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {
|
|
9
|
-
default: {};
|
|
10
|
-
}> & {
|
|
11
|
-
$$bindings?: string | undefined;
|
|
12
|
-
};
|
|
13
|
-
declare const Link: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
14
|
-
[x: string]: any;
|
|
15
|
-
}, {
|
|
16
|
-
default: {};
|
|
17
|
-
}>, {
|
|
18
|
-
[evt: string]: CustomEvent<any>;
|
|
19
|
-
}, {
|
|
20
|
-
default: {};
|
|
21
|
-
}, {}, string>;
|
|
22
|
-
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
23
|
-
default: any;
|
|
24
|
-
} ? Props extends Record<string, never> ? any : {
|
|
25
|
-
children?: any;
|
|
26
|
-
} : {});
|
|
27
|
-
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
28
|
-
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
29
|
-
$$bindings?: Bindings;
|
|
30
|
-
} & Exports;
|
|
31
|
-
(internal: unknown, props: Props & {
|
|
32
|
-
$$events?: Events;
|
|
33
|
-
$$slots?: Slots;
|
|
34
|
-
}): Exports & {
|
|
35
|
-
$set?: any;
|
|
36
|
-
$on?: any;
|
|
37
|
-
};
|
|
38
|
-
z_$$bindings?: Bindings;
|
|
39
|
-
}
|
|
@@ -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,23 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
$$events?: Events;
|
|
7
|
-
$$slots?: Slots;
|
|
8
|
-
}): Exports & {
|
|
9
|
-
$set?: any;
|
|
10
|
-
$on?: any;
|
|
11
|
-
};
|
|
12
|
-
z_$$bindings?: Bindings;
|
|
13
|
-
}
|
|
14
|
-
declare const TilesetField: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
-
doubleScale?: boolean;
|
|
16
|
-
serviceUrl?: Function;
|
|
17
|
-
}, {
|
|
18
|
-
click: MouseEvent;
|
|
19
|
-
} & {
|
|
20
|
-
[evt: string]: CustomEvent<any>;
|
|
21
|
-
}, {}, {}, string>;
|
|
22
|
-
type TilesetField = InstanceType<typeof TilesetField>;
|
|
1
|
+
declare const TilesetField: import("svelte").Component<{
|
|
2
|
+
doubleScale?: any;
|
|
3
|
+
serviceUrl?: any;
|
|
4
|
+
}, {}, "doubleScale" | "serviceUrl">;
|
|
5
|
+
type TilesetField = ReturnType<typeof TilesetField>;
|
|
23
6
|
export default TilesetField;
|
|
@@ -5,10 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
import Code from './Code.svelte';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const {
|
|
9
|
+
label,
|
|
10
|
+
source,
|
|
11
|
+
href,
|
|
12
|
+
icon,
|
|
13
|
+
}: { label: string; source?: string; href?: string; icon: ComponentProps<Button>['icon'] } =
|
|
14
|
+
$props();
|
|
12
15
|
</script>
|
|
13
16
|
|
|
14
17
|
{#if source}
|
|
@@ -1,25 +1,11 @@
|
|
|
1
1
|
import type { ComponentProps } from 'svelte';
|
|
2
2
|
import { Button } from 'svelte-ux';
|
|
3
|
-
|
|
4
|
-
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
|
-
$$bindings?: Bindings;
|
|
6
|
-
} & Exports;
|
|
7
|
-
(internal: unknown, props: Props & {
|
|
8
|
-
$$events?: Events;
|
|
9
|
-
$$slots?: Slots;
|
|
10
|
-
}): Exports & {
|
|
11
|
-
$set?: any;
|
|
12
|
-
$on?: any;
|
|
13
|
-
};
|
|
14
|
-
z_$$bindings?: Bindings;
|
|
15
|
-
}
|
|
16
|
-
declare const ViewSourceButton: $$__sveltets_2_IsomorphicComponent<{
|
|
3
|
+
type $$ComponentProps = {
|
|
17
4
|
label: string;
|
|
18
|
-
source?: string
|
|
19
|
-
href?: string
|
|
20
|
-
icon: ComponentProps<Button>[
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
type ViewSourceButton = InstanceType<typeof ViewSourceButton>;
|
|
5
|
+
source?: string;
|
|
6
|
+
href?: string;
|
|
7
|
+
icon: ComponentProps<Button>['icon'];
|
|
8
|
+
};
|
|
9
|
+
declare const ViewSourceButton: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
10
|
+
type ViewSourceButton = ReturnType<typeof ViewSourceButton>;
|
|
25
11
|
export default ViewSourceButton;
|
|
@@ -216,7 +216,7 @@ export function createArcTextProps(props, opts = {}, position) {
|
|
|
216
216
|
x: x,
|
|
217
217
|
y: y,
|
|
218
218
|
textAnchor,
|
|
219
|
-
|
|
219
|
+
dominantBaseline: 'middle',
|
|
220
220
|
};
|
|
221
221
|
});
|
|
222
222
|
const current = $derived.by(() => {
|
|
@@ -224,21 +224,21 @@ export function createArcTextProps(props, opts = {}, position) {
|
|
|
224
224
|
return {
|
|
225
225
|
path: innerPath.current,
|
|
226
226
|
...sharedProps,
|
|
227
|
-
|
|
227
|
+
dominantBaseline: innerDominantBaseline,
|
|
228
228
|
};
|
|
229
229
|
}
|
|
230
230
|
else if (position === 'outer') {
|
|
231
231
|
return {
|
|
232
232
|
path: outerPath.current,
|
|
233
233
|
...sharedProps,
|
|
234
|
-
|
|
234
|
+
dominantBaseline: outerDominantBaseline,
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
237
|
else if (position === 'middle') {
|
|
238
238
|
return {
|
|
239
239
|
path: middlePath.current,
|
|
240
240
|
...sharedProps,
|
|
241
|
-
|
|
241
|
+
dominantBaseline: 'middle',
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
244
|
else if (position === 'centroid') {
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { ClassValue } from 'svelte/elements';
|
|
2
|
+
import type { PatternShape } from '../components/Pattern.svelte';
|
|
3
|
+
export declare const DEFAULT_FILL = "rgb(0, 0, 0)";
|
|
4
|
+
type StyleOptions = Partial<Omit<CSSStyleDeclaration, 'fillOpacity' | 'strokeWidth' | 'opacity'> & {
|
|
5
|
+
fillOpacity?: number | string;
|
|
6
|
+
strokeWidth?: number | string;
|
|
7
|
+
opacity?: number | string;
|
|
8
|
+
}>;
|
|
9
|
+
export type ComputedStylesOptions = {
|
|
10
|
+
styles?: StyleOptions;
|
|
11
|
+
classes?: ClassValue | null;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Appends or reuses `<svg>` element below `<canvas>` to resolve CSS variables and classes (ex. `stroke: var(--color-primary)` => `stroke: rgb(...)` )
|
|
15
|
+
*/
|
|
16
|
+
export declare function _getComputedStyles(canvas: HTMLCanvasElement, { styles, classes }?: ComputedStylesOptions): CSSStyleDeclaration;
|
|
17
|
+
export declare const getComputedStyles: any;
|
|
18
|
+
/** Render SVG path data onto canvas context. Supports CSS variables and classes by tranferring to hidden `<svg>` element before retrieval) */
|
|
19
|
+
export declare function renderPathData(ctx: CanvasRenderingContext2D, pathData: string | null | undefined, styleOptions?: ComputedStylesOptions): void;
|
|
20
|
+
export declare function renderText(ctx: CanvasRenderingContext2D, text: string | number | null | undefined, coords: {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
}, styleOptions?: ComputedStylesOptions): void;
|
|
24
|
+
export declare function renderRect(ctx: CanvasRenderingContext2D, coords: {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
}, styleOptions?: ComputedStylesOptions): void;
|
|
30
|
+
export declare function renderCircle(ctx: CanvasRenderingContext2D, coords: {
|
|
31
|
+
cx: number;
|
|
32
|
+
cy: number;
|
|
33
|
+
r: number;
|
|
34
|
+
}, styleOptions?: ComputedStylesOptions): void;
|
|
35
|
+
export declare function renderEllipse(ctx: CanvasRenderingContext2D, coords: {
|
|
36
|
+
cx: number;
|
|
37
|
+
cy: number;
|
|
38
|
+
rx: number;
|
|
39
|
+
ry: number;
|
|
40
|
+
}, styleOptions?: ComputedStylesOptions): void;
|
|
41
|
+
/** Clear canvas accounting for Canvas `context.translate(...)` */
|
|
42
|
+
export declare function clearCanvasContext(ctx: CanvasRenderingContext2D, options: {
|
|
43
|
+
containerWidth: number;
|
|
44
|
+
containerHeight: number;
|
|
45
|
+
padding: {
|
|
46
|
+
top: number;
|
|
47
|
+
bottom: number;
|
|
48
|
+
left: number;
|
|
49
|
+
right: number;
|
|
50
|
+
};
|
|
51
|
+
}): void;
|
|
52
|
+
/**
|
|
53
|
+
Scales a canvas for high DPI / retina displays.
|
|
54
|
+
@see: https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio#examples
|
|
55
|
+
@see: https://web.dev/articles/canvas-hidipi
|
|
56
|
+
*/
|
|
57
|
+
export declare function scaleCanvas(ctx: CanvasRenderingContext2D, width: number, height: number): {
|
|
58
|
+
width: number;
|
|
59
|
+
height: number;
|
|
60
|
+
};
|
|
61
|
+
/** Get pixel color (r,g,b,a) at canvas coordinates */
|
|
62
|
+
export declare function getPixelColor(ctx: CanvasRenderingContext2D, x: number, y: number): {
|
|
63
|
+
r: number;
|
|
64
|
+
g: number;
|
|
65
|
+
b: number;
|
|
66
|
+
a: number;
|
|
67
|
+
};
|
|
68
|
+
export declare function _createLinearGradient(ctx: CanvasRenderingContext2D, x0: number, y0: number, x1: number, y1: number, stops: {
|
|
69
|
+
offset: number;
|
|
70
|
+
color: string;
|
|
71
|
+
}[]): CanvasGradient;
|
|
72
|
+
/** Create linear gradient and memoize result to fix reactivity */
|
|
73
|
+
export declare const createLinearGradient: any;
|
|
74
|
+
export declare function _createPattern(ctx: CanvasRenderingContext2D, width: number, height: number, shapes: PatternShape[], background?: string): CanvasPattern | null;
|
|
75
|
+
/** Create pattern and memoize result to fix reactivity */
|
|
76
|
+
export declare const createPattern: any;
|
|
77
|
+
export {};
|