layerchart 0.27.0 → 0.28.0-next.1
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 +7 -7
- package/dist/components/Calendar.svelte +1 -1
- package/dist/components/Highlight.svelte +7 -4
- package/dist/components/Labels.svelte +1 -1
- package/dist/components/Legend.svelte +2 -2
- package/dist/components/Link.svelte +2 -2
- package/dist/components/MonthPath.svelte +1 -1
- package/dist/components/Points.svelte +7 -3
- package/dist/components/Text.svelte +10 -2
- package/dist/components/Tooltip.svelte +4 -1
- package/dist/docs/Blockquote.svelte +6 -4
- package/dist/docs/Code.svelte +15 -7
- package/dist/docs/Code.svelte.d.ts +5 -0
- package/dist/docs/GeoDebug.svelte +7 -5
- package/dist/docs/Link.svelte +1 -1
- package/dist/docs/Preview.svelte +15 -18
- package/dist/docs/Preview.svelte.d.ts +1 -0
- package/dist/docs/TilesetField.svelte +6 -6
- package/dist/docs/ViewSourceButton.svelte +5 -5
- package/dist/docs/ZoomControls.svelte +11 -7
- package/package.json +5 -4
|
@@ -91,7 +91,7 @@ function getDefaultLabelProps() {
|
|
|
91
91
|
y1={$yRange[0] || 0}
|
|
92
92
|
y2={$yRange[1] || 0}
|
|
93
93
|
{...lineProps}
|
|
94
|
-
class={cls('rule stroke-
|
|
94
|
+
class={cls('rule stroke-surface-content/50', lineProps?.class)}
|
|
95
95
|
/>
|
|
96
96
|
{/if}
|
|
97
97
|
|
|
@@ -102,7 +102,7 @@ function getDefaultLabelProps() {
|
|
|
102
102
|
y1={placement === 'top' ? yRangeMin : yRangeMax}
|
|
103
103
|
y2={placement === 'top' ? yRangeMin : yRangeMax}
|
|
104
104
|
{...lineProps}
|
|
105
|
-
class={cls('rule stroke-
|
|
105
|
+
class={cls('rule stroke-surface-content/50', lineProps?.class)}
|
|
106
106
|
/>
|
|
107
107
|
{/if}
|
|
108
108
|
{/if}
|
|
@@ -119,7 +119,7 @@ function getDefaultLabelProps() {
|
|
|
119
119
|
x2={tickCoords.x}
|
|
120
120
|
y2={yRangeMax}
|
|
121
121
|
{...lineProps}
|
|
122
|
-
class={cls('grid stroke-
|
|
122
|
+
class={cls('grid stroke-surface-content/10', lineProps?.class)}
|
|
123
123
|
/>
|
|
124
124
|
{:else if orientation === 'vertical'}
|
|
125
125
|
<line
|
|
@@ -128,7 +128,7 @@ function getDefaultLabelProps() {
|
|
|
128
128
|
x2={$width}
|
|
129
129
|
y2={tickCoords.y}
|
|
130
130
|
{...lineProps}
|
|
131
|
-
class={cls('grid stroke-
|
|
131
|
+
class={cls('grid stroke-surface-content/10', lineProps?.class)}
|
|
132
132
|
/>
|
|
133
133
|
{/if}
|
|
134
134
|
{/if}
|
|
@@ -140,7 +140,7 @@ function getDefaultLabelProps() {
|
|
|
140
140
|
y1={tickCoords.y}
|
|
141
141
|
x2={tickCoords.x}
|
|
142
142
|
y2={tickCoords.y + (placement === 'top' ? -tickSize : tickSize)}
|
|
143
|
-
class="tick stroke-
|
|
143
|
+
class="tick stroke-surface-content/50"
|
|
144
144
|
/>
|
|
145
145
|
{:else if orientation === 'vertical'}
|
|
146
146
|
<line
|
|
@@ -148,7 +148,7 @@ function getDefaultLabelProps() {
|
|
|
148
148
|
y1={tickCoords.y}
|
|
149
149
|
x2={tickCoords.x + (placement === 'left' ? -tickSize : tickSize)}
|
|
150
150
|
y2={tickCoords.y}
|
|
151
|
-
class="tick stroke-
|
|
151
|
+
class="tick stroke-surface-content/50"
|
|
152
152
|
/>
|
|
153
153
|
{/if}
|
|
154
154
|
|
|
@@ -159,7 +159,7 @@ function getDefaultLabelProps() {
|
|
|
159
159
|
{...getDefaultLabelProps()}
|
|
160
160
|
{...labelProps}
|
|
161
161
|
class={cls(
|
|
162
|
-
'label text-[10px] stroke-
|
|
162
|
+
'label text-[10px] stroke-surface-100 [stroke-width:2px] font-light',
|
|
163
163
|
labelProps?.class
|
|
164
164
|
)}
|
|
165
165
|
/>
|
|
@@ -167,7 +167,10 @@ $: if ($tooltip.data) {
|
|
|
167
167
|
spring
|
|
168
168
|
{..._area}
|
|
169
169
|
{...typeof area === 'object' ? area : null}
|
|
170
|
-
class={cls(
|
|
170
|
+
class={cls(
|
|
171
|
+
!area.fill && 'fill-surface-content/5',
|
|
172
|
+
typeof area === 'object' ? area.class : null
|
|
173
|
+
)}
|
|
171
174
|
on:click
|
|
172
175
|
/>
|
|
173
176
|
</slot>
|
|
@@ -184,7 +187,7 @@ $: if ($tooltip.data) {
|
|
|
184
187
|
strokeWidth={typeof bar === 'object' ? bar.strokeWidth : null}
|
|
185
188
|
radius={typeof bar === 'object' ? bar.radius : null}
|
|
186
189
|
bar={$tooltip.data}
|
|
187
|
-
class={cls(!bar.fill && 'fill-
|
|
190
|
+
class={cls(!bar.fill && 'fill-primary', typeof bar === 'object' ? bar.class : null)}
|
|
188
191
|
on:click
|
|
189
192
|
/>
|
|
190
193
|
</slot>
|
|
@@ -201,7 +204,7 @@ $: if ($tooltip.data) {
|
|
|
201
204
|
y2={line.y2}
|
|
202
205
|
{...typeof lines === 'object' ? lines : null}
|
|
203
206
|
class={cls(
|
|
204
|
-
'stroke-
|
|
207
|
+
'stroke-surface-content/20 stroke-2 [stroke-dasharray:2,2] pointer-events-none',
|
|
205
208
|
typeof lines === 'object' ? lines.class : null
|
|
206
209
|
)}
|
|
207
210
|
/>
|
|
@@ -223,7 +226,7 @@ $: if ($tooltip.data) {
|
|
|
223
226
|
{...typeof points === 'object' ? points : null}
|
|
224
227
|
class={cls(
|
|
225
228
|
'stroke-[6] stroke-white [paint-order:stroke] drop-shadow',
|
|
226
|
-
!fill && 'fill-
|
|
229
|
+
!fill && 'fill-primary',
|
|
227
230
|
typeof points === 'object' ? points.class : null
|
|
228
231
|
)}
|
|
229
232
|
/>
|
|
@@ -101,7 +101,7 @@ $: getTextProps = (item) => {
|
|
|
101
101
|
<!-- TODO: Add labels for each item when array/stack? Use `getValue(item)` instead and iterate -->
|
|
102
102
|
<Text
|
|
103
103
|
value={getFormattedValue(item)}
|
|
104
|
-
class="text-xs stroke-
|
|
104
|
+
class="text-xs stroke-surface-100 [stroke-width:2px]"
|
|
105
105
|
{...getTextProps(item)}
|
|
106
106
|
{...$$restProps}
|
|
107
107
|
/>
|
|
@@ -147,7 +147,7 @@ else {
|
|
|
147
147
|
x={xScale(tick) + tickLabelOffset}
|
|
148
148
|
y={height + tickSize + tickFontSize}
|
|
149
149
|
style:font-size={tickFontSize}
|
|
150
|
-
class={classes.label}
|
|
150
|
+
class={cls('fill-surface-content', classes.label)}
|
|
151
151
|
>
|
|
152
152
|
{tickFormat ? format(tick, tickFormat) : tick}
|
|
153
153
|
</text>
|
|
@@ -158,7 +158,7 @@ else {
|
|
|
158
158
|
y1={0}
|
|
159
159
|
x2={xScale(tick)}
|
|
160
160
|
y2={height + tickSize}
|
|
161
|
-
class={cls('stroke-
|
|
161
|
+
class={cls('stroke-surface-content', classes.tick)}
|
|
162
162
|
/>
|
|
163
163
|
{/if}
|
|
164
164
|
{/each}
|
|
@@ -11,8 +11,8 @@ export let source = sankey ? (d) => [d.source.x1, d.y0] : (d) => d.source;
|
|
|
11
11
|
export let target = sankey ? (d) => [d.target.x0, d.y1] : (d) => d.target;
|
|
12
12
|
/** Convenient property to swap x/y accessor logic */
|
|
13
13
|
export let orientation = sankey ? 'horizontal' : 'vertical';
|
|
14
|
-
export let x =
|
|
15
|
-
export let y =
|
|
14
|
+
export let x = (d) => (sankey ? d[0] : orientation === 'horizontal' ? d.y : d.x);
|
|
15
|
+
export let y = (d) => (sankey ? d[1] : orientation === 'horizontal' ? d.x : d.y);
|
|
16
16
|
export let curve = orientation === 'horizontal' ? curveBumpX : curveBumpY;
|
|
17
17
|
export let tweened = undefined;
|
|
18
18
|
$: tweenedOptions = tweened ? { interpolate: interpolatePath, ...tweened } : false;
|
|
@@ -78,11 +78,11 @@ $: _links = $data.flatMap((d) => {
|
|
|
78
78
|
const y = $yGet(d) + getOffset($yGet(d), offsetY, $yScale);
|
|
79
79
|
return {
|
|
80
80
|
source: {
|
|
81
|
-
x: xMin + getOffset(xMin, offsetX, $xScale),
|
|
81
|
+
x: xMin + getOffset(xMin, offsetX, $xScale) + r,
|
|
82
82
|
y,
|
|
83
83
|
},
|
|
84
84
|
target: {
|
|
85
|
-
x: xMax + getOffset(xMax, offsetX, $xScale),
|
|
85
|
+
x: xMax + getOffset(xMax, offsetX, $xScale) - r,
|
|
86
86
|
y: y,
|
|
87
87
|
},
|
|
88
88
|
};
|
|
@@ -112,7 +112,11 @@ $: _links = $data.flatMap((d) => {
|
|
|
112
112
|
{#if links}
|
|
113
113
|
<g class="link-group">
|
|
114
114
|
{#each _links as link}
|
|
115
|
-
<Link
|
|
115
|
+
<Link
|
|
116
|
+
data={link}
|
|
117
|
+
class="stroke-surface-content/50"
|
|
118
|
+
{...typeof links === 'object' ? links : null}
|
|
119
|
+
/>
|
|
116
120
|
{/each}
|
|
117
121
|
</g>
|
|
118
122
|
{/if}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { cls } from 'svelte-ux';
|
|
2
|
+
import { getStringWidth } from '../utils/string';
|
|
2
3
|
/*
|
|
3
4
|
TODO:
|
|
4
5
|
- [ ] Handle styled text (use <slot /> to measure?)
|
|
@@ -123,7 +124,14 @@ function isValidXOrY(xOrY) {
|
|
|
123
124
|
<!-- `paint-order: stroke` supports stroke outlining text -->
|
|
124
125
|
<svg x={dx} y={dy} class="overflow-visible [paint-order:stroke]">
|
|
125
126
|
{#if isValidXOrY(x) && isValidXOrY(y)}
|
|
126
|
-
<text
|
|
127
|
+
<text
|
|
128
|
+
{x}
|
|
129
|
+
{y}
|
|
130
|
+
{transform}
|
|
131
|
+
text-anchor={textAnchor}
|
|
132
|
+
{...$$restProps}
|
|
133
|
+
class={cls('fill-surface-content', $$props.class)}
|
|
134
|
+
>
|
|
127
135
|
{#each wordsByLines as line, index}
|
|
128
136
|
<tspan {x} dy={index === 0 ? startDy : lineHeight}>
|
|
129
137
|
{line.words.join(' ')}
|
|
@@ -119,7 +119,10 @@ $: if ($tooltip?.data) {
|
|
|
119
119
|
'bg-gray-900/90 backdrop-filter backdrop-blur-[2px] text-white',
|
|
120
120
|
'[&_.label]:text-white/75',
|
|
121
121
|
],
|
|
122
|
-
light: [
|
|
122
|
+
light: [
|
|
123
|
+
'bg-white text-gray-800 border border-gray-500',
|
|
124
|
+
'[&_.label]:text-surface-content/50',
|
|
125
|
+
],
|
|
123
126
|
none: '',
|
|
124
127
|
}[variant],
|
|
125
128
|
classes.container,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
<script>import { mdiInformation } from '@mdi/js';
|
|
2
|
-
import { Icon } from 'svelte-ux';
|
|
3
|
-
// console.log($$props, $$slots);
|
|
2
|
+
import { Icon, cls } from 'svelte-ux';
|
|
4
3
|
</script>
|
|
5
4
|
|
|
6
5
|
<div
|
|
7
|
-
class=
|
|
6
|
+
class={cls(
|
|
7
|
+
'bg-primary/10 border border-l-[6px] border-primary/30 border-l-primary text-primary px-4 py-2 my-4 rounded flex items-center gap-2 text-sm',
|
|
8
|
+
'[&>a]:font-medium [&>a]:underline [&>a]:decoration-dashed [&>a]:decoration-primary/50 [&>a]:underline-offset-2'
|
|
9
|
+
)}
|
|
8
10
|
>
|
|
9
|
-
<Icon data={mdiInformation} class="text-
|
|
11
|
+
<Icon data={mdiInformation} class="text-primary" />
|
|
10
12
|
<slot />
|
|
11
13
|
</div>
|
package/dist/docs/Code.svelte
CHANGED
|
@@ -1,22 +1,30 @@
|
|
|
1
1
|
<script>import Prism from 'prismjs';
|
|
2
2
|
import 'prism-svelte';
|
|
3
|
-
import { CopyButton, cls } from 'svelte-ux';
|
|
3
|
+
import { CopyButton, cls, getComponentTheme } from 'svelte-ux';
|
|
4
4
|
export let source = null;
|
|
5
5
|
export let language = 'svelte';
|
|
6
6
|
export let highlightedSource = source
|
|
7
|
-
? Prism.highlight(source, Prism.languages[language], language)
|
|
7
|
+
? Prism.highlight(source, Prism.languages[language] ?? Prism.languages.text, language)
|
|
8
8
|
: '';
|
|
9
|
+
export let classes = {};
|
|
10
|
+
const theme = getComponentTheme('Code');
|
|
9
11
|
</script>
|
|
10
12
|
|
|
11
|
-
<div class={cls('rounded', $$
|
|
13
|
+
<div class={cls('Code', 'rounded', theme.root, classes.root, $$props.class)}>
|
|
12
14
|
{#if source}
|
|
13
15
|
<div class="relative">
|
|
14
|
-
<pre
|
|
15
|
-
|
|
16
|
+
<pre
|
|
17
|
+
class={cls('language-{language} rounded', classes.pre)}
|
|
18
|
+
style="margin: 0; white-space: normal;">
|
|
19
|
+
<code class={cls('language-{language}', classes.code)}>{@html highlightedSource}</code>
|
|
16
20
|
</pre>
|
|
17
21
|
|
|
18
|
-
<div class="absolute top-0 right-0 p-2">
|
|
19
|
-
<CopyButton
|
|
22
|
+
<div class="absolute top-0 right-0 p-2 z-10">
|
|
23
|
+
<CopyButton
|
|
24
|
+
value={source ?? ''}
|
|
25
|
+
class="text-white/70 hover:bg-surface-100/20 py-1 backdrop-blur-md"
|
|
26
|
+
size="sm"
|
|
27
|
+
/>
|
|
20
28
|
</div>
|
|
21
29
|
</div>
|
|
22
30
|
{/if}
|
|
@@ -6,6 +6,11 @@ declare const __propDef: {
|
|
|
6
6
|
source?: string | null | undefined;
|
|
7
7
|
language?: string | undefined;
|
|
8
8
|
highlightedSource?: any;
|
|
9
|
+
classes?: {
|
|
10
|
+
root?: string | undefined;
|
|
11
|
+
pre?: string | undefined;
|
|
12
|
+
code?: string | undefined;
|
|
13
|
+
} | undefined;
|
|
9
14
|
};
|
|
10
15
|
events: {
|
|
11
16
|
[evt: string]: CustomEvent<any>;
|
|
@@ -8,26 +8,28 @@ let showCenter = false;
|
|
|
8
8
|
|
|
9
9
|
<div class={cls('bg-black/5 rounded m-1 backdrop-blur p-2', $$props.class)}>
|
|
10
10
|
<div class="grid gap-2 ml-2 text-xs">
|
|
11
|
-
<div><span class="text-
|
|
11
|
+
<div><span class="text-surface-content/50">scale:</span> {format($geo.scale(), 'decimal')}</div>
|
|
12
12
|
|
|
13
13
|
<div>
|
|
14
|
-
<span class="text-
|
|
14
|
+
<span class="text-surface-content/50">translate:</span>
|
|
15
15
|
{#each $geo.translate() as coord}
|
|
16
16
|
<div class="ml-2">{format(coord, 'decimal')}</div>
|
|
17
17
|
{/each}
|
|
18
18
|
</div>
|
|
19
19
|
|
|
20
20
|
<div>
|
|
21
|
-
<span class="text-
|
|
21
|
+
<span class="text-surface-content/50">rotate:</span>
|
|
22
22
|
{#each $geo.rotate() as angle}
|
|
23
23
|
<div class="ml-2">{format(angle, 'decimal')}</div>
|
|
24
24
|
{/each}
|
|
25
25
|
</div>
|
|
26
26
|
|
|
27
|
-
<div><span class="text-
|
|
27
|
+
<div><span class="text-surface-content/50">center:</span> {$geo.center?.()}</div>
|
|
28
28
|
|
|
29
29
|
<div>
|
|
30
|
-
<span class="text-
|
|
30
|
+
<span class="text-surface-content/50"
|
|
31
|
+
>long/lat: <Checkbox bind:checked={showCenter} size="xs" /></span
|
|
32
|
+
>
|
|
31
33
|
{#each $geo.invert?.([$width / 2, $height / 2]) as coord}
|
|
32
34
|
<div class="ml-2">{format(coord, 'decimal')}</div>
|
|
33
35
|
{/each}
|
package/dist/docs/Link.svelte
CHANGED
package/dist/docs/Preview.svelte
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
import Prism from 'prismjs';
|
|
4
4
|
import 'prism-svelte';
|
|
5
5
|
import { mdiCodeTags, mdiTable } from '@mdi/js';
|
|
6
|
-
import { Button, CopyButton, Dialog, Toggle, Tooltip } from 'svelte-ux';
|
|
6
|
+
import { Button, CopyButton, Dialog, Toggle, Tooltip, cls } from 'svelte-ux';
|
|
7
|
+
import Code from './Code.svelte';
|
|
7
8
|
import Json from './Json.svelte';
|
|
8
9
|
export let code = undefined;
|
|
9
10
|
export let data = undefined;
|
|
@@ -20,36 +21,32 @@ catch (e) {
|
|
|
20
21
|
}
|
|
21
22
|
</script>
|
|
22
23
|
|
|
23
|
-
<div class=
|
|
24
|
+
<div class={cls('Preview border rounded bg-surface-100', $$props.class)}>
|
|
24
25
|
<div class="p-4">
|
|
25
26
|
<slot />
|
|
26
27
|
</div>
|
|
27
28
|
|
|
28
29
|
{#if code && showCode}
|
|
29
|
-
<div class="
|
|
30
|
-
<pre
|
|
31
|
-
class="language-{language} rounded"
|
|
32
|
-
style="margin: 0; white-space: normal;"
|
|
33
|
-
transition:slide|local>
|
|
34
|
-
<code class="language-{language}">{@html highlightedCode}</code>
|
|
35
|
-
</pre>
|
|
36
|
-
|
|
37
|
-
<div class="absolute top-0 right-0 p-2">
|
|
38
|
-
<CopyButton value={code} class="text-white/70 hover:bg-white/20 py-1" size="sm" />
|
|
39
|
-
</div>
|
|
30
|
+
<div transition:slide class="bg-surface-200">
|
|
31
|
+
<Code source={code} highlightedSource={highlightedCode} classes={{ pre: 'rounded-t-none' }} />
|
|
40
32
|
</div>
|
|
41
33
|
{/if}
|
|
42
34
|
</div>
|
|
43
35
|
|
|
44
36
|
{#if code}
|
|
45
|
-
<Button
|
|
46
|
-
{
|
|
37
|
+
<Button
|
|
38
|
+
icon={mdiCodeTags}
|
|
39
|
+
class="text-surface-content/70 py-1"
|
|
40
|
+
on:click={() => (showCode = !showCode)}
|
|
41
|
+
>
|
|
42
|
+
{showCode ? 'Hide' : 'Show'} Code
|
|
47
43
|
</Button>
|
|
48
44
|
{/if}
|
|
49
45
|
|
|
50
46
|
{#if data}
|
|
51
47
|
<Toggle let:on={open} let:toggle>
|
|
52
|
-
<Button icon={mdiTable} class="
|
|
48
|
+
<Button icon={mdiTable} class="text-surface-content/70 py-1" on:click={toggle}>View data</Button
|
|
49
|
+
>
|
|
53
50
|
<Dialog
|
|
54
51
|
{open}
|
|
55
52
|
on:close={toggle}
|
|
@@ -62,7 +59,7 @@ catch (e) {
|
|
|
62
59
|
|
|
63
60
|
{#if copyValue}
|
|
64
61
|
<Tooltip title="Copy">
|
|
65
|
-
<CopyButton value={copyValue} variant="fill-light" color="
|
|
62
|
+
<CopyButton value={copyValue} variant="fill-light" color="primary" />
|
|
66
63
|
</Tooltip>
|
|
67
64
|
{/if}
|
|
68
65
|
</div>
|
|
@@ -70,7 +67,7 @@ catch (e) {
|
|
|
70
67
|
<Json value={data} />
|
|
71
68
|
|
|
72
69
|
<div slot="actions">
|
|
73
|
-
<Button variant="fill" color="
|
|
70
|
+
<Button variant="fill" color="primary">Close</Button>
|
|
74
71
|
</div>
|
|
75
72
|
</Dialog>
|
|
76
73
|
</Toggle>
|
|
@@ -34,7 +34,7 @@ $: serviceOptions = {
|
|
|
34
34
|
'satelllite-v9': mapboxv1('satellite-v9'),
|
|
35
35
|
'satelllite-streets-v12': mapboxv1('satellite-streets-v12'),
|
|
36
36
|
'navigation-day-v1': mapboxv1('navigation-day-v1'),
|
|
37
|
-
'navigation-night-v1': mapboxv1('navigation-night-v1')
|
|
37
|
+
'navigation-night-v1': mapboxv1('navigation-night-v1'),
|
|
38
38
|
},
|
|
39
39
|
'mapbox v4': {
|
|
40
40
|
'natural-earth-2': mapboxv4('mapbox.natural-earth-2'),
|
|
@@ -42,7 +42,7 @@ $: serviceOptions = {
|
|
|
42
42
|
streets: mapboxv4('mapbox.mapbox-streets-v8'),
|
|
43
43
|
terrain: mapboxv4('mapbox.mapbox-terrain-v2'),
|
|
44
44
|
'terrain-dem': mapboxv4('mapbox.mapbox-terrain-dem-v1'),
|
|
45
|
-
traffic: mapboxv4('mapbox.mapbox-traffic-v1')
|
|
45
|
+
traffic: mapboxv4('mapbox.mapbox-traffic-v1'),
|
|
46
46
|
// 'transit (mapbox v4)': mapboxv4('mapbox.transit-v2'),
|
|
47
47
|
},
|
|
48
48
|
'National Map Services': {
|
|
@@ -50,7 +50,7 @@ $: serviceOptions = {
|
|
|
50
50
|
'USGS Imagery Topo Base Map': nationalmap('USGSImageryTopo'),
|
|
51
51
|
'USGS Imagery Only Base Map': nationalmap('USGSImageryOnly'),
|
|
52
52
|
'USGS Shaded Relief': nationalmap('USGSShadedReliefOnly'),
|
|
53
|
-
'USGS Topo Base Map': nationalmap('USGSTopo')
|
|
53
|
+
'USGS Topo Base Map': nationalmap('USGSTopo'),
|
|
54
54
|
},
|
|
55
55
|
ArcGIS: {
|
|
56
56
|
'USA Topo Map': arcgis('USA_Topo_Maps'),
|
|
@@ -60,8 +60,8 @@ $: serviceOptions = {
|
|
|
60
60
|
'World Shaded Relief': arcgis('World_Shaded_Relief'),
|
|
61
61
|
'World Street Map': arcgis('World_Street_Map'),
|
|
62
62
|
'World Terrain Base': arcgis('World_Terrain_Base'),
|
|
63
|
-
'World Topo Map': arcgis('World_Topo_Map')
|
|
64
|
-
}
|
|
63
|
+
'World Topo Map': arcgis('World_Topo_Map'),
|
|
64
|
+
},
|
|
65
65
|
// 'ArcGIS Vector': {
|
|
66
66
|
// 'Community Map', url: arcgisVector('World_Basemap_v2'),
|
|
67
67
|
// }
|
|
@@ -87,7 +87,7 @@ $: serviceUrl = getServiceUrl(selected);
|
|
|
87
87
|
{/each}
|
|
88
88
|
</select>
|
|
89
89
|
<div slot="append">
|
|
90
|
-
<div class="text-[10px] text-
|
|
90
|
+
<div class="text-[10px] text-surface-content/50 text-center">2x</div>
|
|
91
91
|
<Switch bind:checked={doubleScale} size="md" />
|
|
92
92
|
</div>
|
|
93
93
|
</Field>
|
|
@@ -9,7 +9,7 @@ export let icon;
|
|
|
9
9
|
|
|
10
10
|
{#if source}
|
|
11
11
|
<Toggle let:on={open} let:toggle>
|
|
12
|
-
<Button {icon} on:click={toggle} variant="fill-light" color="
|
|
12
|
+
<Button {icon} on:click={toggle} variant="fill-light" color="primary" size="sm">{label}</Button>
|
|
13
13
|
<Dialog
|
|
14
14
|
{open}
|
|
15
15
|
on:close={toggle}
|
|
@@ -18,11 +18,11 @@ export let icon;
|
|
|
18
18
|
<div class="grid grid-cols-[1fr,auto] gap-3 items-center p-4">
|
|
19
19
|
<div class="overflow-auto">
|
|
20
20
|
<div class="text-lg font-semibold">{label}</div>
|
|
21
|
-
<div class="text-xs text-
|
|
21
|
+
<div class="text-xs text-surface-content/50 truncate">{href}</div>
|
|
22
22
|
</div>
|
|
23
23
|
|
|
24
24
|
{#if href}
|
|
25
|
-
<Button icon={mdiGithub} variant="fill-light" color="
|
|
25
|
+
<Button icon={mdiGithub} variant="fill-light" color="primary" {href} target="_blank">
|
|
26
26
|
View on Github
|
|
27
27
|
</Button>
|
|
28
28
|
{/if}
|
|
@@ -33,13 +33,13 @@ export let icon;
|
|
|
33
33
|
</div>
|
|
34
34
|
|
|
35
35
|
<div slot="actions">
|
|
36
|
-
<Button variant="fill" color="
|
|
36
|
+
<Button variant="fill" color="primary">Close</Button>
|
|
37
37
|
</div>
|
|
38
38
|
</Dialog>
|
|
39
39
|
</Toggle>
|
|
40
40
|
{:else if href}
|
|
41
41
|
<Tooltip title="Edit this page">
|
|
42
|
-
<Button {icon} {href} target="_blank" variant="fill-light" color="
|
|
42
|
+
<Button {icon} {href} target="_blank" variant="fill-light" color="primary" size="sm">
|
|
43
43
|
{label}
|
|
44
44
|
</Button>
|
|
45
45
|
</Tooltip>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import { Button, Tooltip, cls } from 'svelte-ux';
|
|
2
|
-
import { mdiArrowULeftTop, mdiMagnifyPlusOutline, mdiMagnifyMinusOutline, mdiImageFilterCenterFocus } from '@mdi/js';
|
|
2
|
+
import { mdiArrowULeftTop, mdiMagnifyPlusOutline, mdiMagnifyMinusOutline, mdiImageFilterCenterFocus, } from '@mdi/js';
|
|
3
3
|
export let zoom;
|
|
4
4
|
export let placement = 'top-right';
|
|
5
5
|
export let orientation = 'vertical';
|
|
@@ -7,7 +7,7 @@ export let orientation = 'vertical';
|
|
|
7
7
|
|
|
8
8
|
<div
|
|
9
9
|
class={cls(
|
|
10
|
-
'bg-
|
|
10
|
+
'bg-surface-content/5 rounded-full m-1 backdrop-blur z-10 flex',
|
|
11
11
|
orientation === 'vertical' && 'flex-col',
|
|
12
12
|
{
|
|
13
13
|
'top-left': 'absolute top-0 left-0',
|
|
@@ -18,7 +18,7 @@ export let orientation = 'vertical';
|
|
|
18
18
|
right: 'absolute top-1/2 right-0 -translate-y-1/2',
|
|
19
19
|
'bottom-left': 'absolute bottom-0 left-0',
|
|
20
20
|
bottom: 'absolute bottom-0 left-1/2 -translate-x-1/2',
|
|
21
|
-
'bottom-right': 'absolute bottom-0 right-0'
|
|
21
|
+
'bottom-right': 'absolute bottom-0 right-0',
|
|
22
22
|
}[placement]
|
|
23
23
|
)}
|
|
24
24
|
>
|
|
@@ -26,24 +26,28 @@ export let orientation = 'vertical';
|
|
|
26
26
|
<Button
|
|
27
27
|
icon={mdiMagnifyPlusOutline}
|
|
28
28
|
on:click={() => zoom.increase()}
|
|
29
|
-
class="text-
|
|
29
|
+
class="text-surface-content/50 p-2"
|
|
30
30
|
/>
|
|
31
31
|
</Tooltip>
|
|
32
32
|
<Tooltip title="Zoom out">
|
|
33
33
|
<Button
|
|
34
34
|
icon={mdiMagnifyMinusOutline}
|
|
35
35
|
on:click={() => zoom.decrease()}
|
|
36
|
-
class="text-
|
|
36
|
+
class="text-surface-content/50 p-2"
|
|
37
37
|
/>
|
|
38
38
|
</Tooltip>
|
|
39
39
|
<Tooltip title="Center">
|
|
40
40
|
<Button
|
|
41
41
|
icon={mdiImageFilterCenterFocus}
|
|
42
42
|
on:click={() => zoom.translateCenter()}
|
|
43
|
-
class="text-
|
|
43
|
+
class="text-surface-content/50 p-2"
|
|
44
44
|
/>
|
|
45
45
|
</Tooltip>
|
|
46
46
|
<Tooltip title="Reset">
|
|
47
|
-
<Button
|
|
47
|
+
<Button
|
|
48
|
+
icon={mdiArrowULeftTop}
|
|
49
|
+
on:click={() => zoom.reset()}
|
|
50
|
+
class="text-surface-content/50 p-2"
|
|
51
|
+
/>
|
|
48
52
|
</Tooltip>
|
|
49
53
|
</div>
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"author": "Sean Lynch <techniq35@gmail.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "techniq/layerchart",
|
|
7
|
-
"version": "0.
|
|
7
|
+
"version": "0.28.0-next.1",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"dev": "vite dev",
|
|
10
10
|
"build": "vite build",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@rollup/plugin-dsv": "^3.0.4",
|
|
22
|
-
"@sveltejs/adapter-
|
|
22
|
+
"@sveltejs/adapter-auto": "^2.1.1",
|
|
23
23
|
"@sveltejs/kit": "^1.27.6",
|
|
24
24
|
"@sveltejs/package": "^2.2.2",
|
|
25
25
|
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"@types/shapefile": "^0.6.4",
|
|
43
43
|
"@types/topojson-client": "^3.1.4",
|
|
44
44
|
"autoprefixer": "^10.4.16",
|
|
45
|
+
"daisyui": "^4.4.19",
|
|
45
46
|
"execa": "^8.0.1",
|
|
46
47
|
"marked": "^10.0.0",
|
|
47
48
|
"mdsvex": "^0.11.0",
|
|
@@ -66,7 +67,6 @@
|
|
|
66
67
|
"@changesets/cli": "^2.26.2",
|
|
67
68
|
"@mdi/js": "^7.3.67",
|
|
68
69
|
"@types/d3-time": "^3.0.2",
|
|
69
|
-
"@vercel/analytics": "^1.1.1",
|
|
70
70
|
"d3-array": "^3.2.4",
|
|
71
71
|
"d3-delaunay": "^6.0.4",
|
|
72
72
|
"d3-dsv": "^3.0.1",
|
|
@@ -85,8 +85,9 @@
|
|
|
85
85
|
"date-fns": "^2.30.0",
|
|
86
86
|
"layercake": "^8.0.2",
|
|
87
87
|
"lodash-es": "^4.17.21",
|
|
88
|
+
"posthog-js": "^1.95.1",
|
|
88
89
|
"shapefile": "^0.6.6",
|
|
89
|
-
"svelte-ux": "
|
|
90
|
+
"svelte-ux": "0.58.0-next.3",
|
|
90
91
|
"topojson-client": "^3.1.0"
|
|
91
92
|
},
|
|
92
93
|
"peerDependencies": {
|