layerchart 0.55.0 → 0.57.0
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.
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
maxValue?: typeof maxValue;
|
|
25
25
|
outerRadius?: typeof outerRadius;
|
|
26
26
|
padAngle?: typeof padAngle;
|
|
27
|
+
center?: typeof center;
|
|
28
|
+
placement?: typeof placement;
|
|
27
29
|
props?: typeof props;
|
|
28
30
|
range?: typeof range;
|
|
29
31
|
series?: typeof series;
|
|
@@ -83,6 +85,12 @@
|
|
|
83
85
|
export let cornerRadius = 0;
|
|
84
86
|
export let padAngle = 0;
|
|
85
87
|
|
|
88
|
+
/** Placement of PieChart (default: 'center') */
|
|
89
|
+
export let placement: 'left' | 'center' | 'right' = 'center';
|
|
90
|
+
|
|
91
|
+
/** Center chart. Override and use `props.group` for more control */
|
|
92
|
+
export let center = placement === 'center';
|
|
93
|
+
|
|
86
94
|
export let props: {
|
|
87
95
|
pie?: Partial<ComponentProps<Pie>>;
|
|
88
96
|
group?: Partial<ComponentProps<Group>>;
|
|
@@ -143,11 +151,19 @@
|
|
|
143
151
|
tooltip,
|
|
144
152
|
}}
|
|
145
153
|
<slot {...slotProps}>
|
|
146
|
-
<Svg center>
|
|
154
|
+
<Svg {center}>
|
|
147
155
|
<slot name="belowMarks" {...slotProps} />
|
|
148
156
|
|
|
149
157
|
<slot name="marks" {...slotProps}>
|
|
150
|
-
<Group
|
|
158
|
+
<Group
|
|
159
|
+
x={placement === 'left'
|
|
160
|
+
? height / 2
|
|
161
|
+
: placement === 'right'
|
|
162
|
+
? width - height / 2
|
|
163
|
+
: undefined}
|
|
164
|
+
center={['left', 'right'].includes(placement) ? 'y' : undefined}
|
|
165
|
+
{...props.group}
|
|
166
|
+
>
|
|
151
167
|
{#each series as s, i}
|
|
152
168
|
{@const singleArc = s.data?.length === 1 || chartData.length === 1}
|
|
153
169
|
{#if singleArc}
|
|
@@ -222,6 +222,8 @@ declare class __sveltets_Render<TData> {
|
|
|
222
222
|
maxValue?: number | undefined;
|
|
223
223
|
outerRadius?: number | undefined;
|
|
224
224
|
padAngle?: number;
|
|
225
|
+
center?: boolean;
|
|
226
|
+
placement?: "center" | "left" | "right";
|
|
225
227
|
props?: {
|
|
226
228
|
pie?: Partial<ComponentProps<Pie>>;
|
|
227
229
|
group?: Partial<ComponentProps<Group>>;
|
|
@@ -39,6 +39,21 @@
|
|
|
39
39
|
// https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/tile/12/1572/1108.pbf
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
+
// https://github.com/leaflet-extras/leaflet-providers/blob/master/leaflet-providers.js#L79
|
|
43
|
+
// https://www.openstreetmap.org/
|
|
44
|
+
const openStreetMap = (tileset: string) => (x: number, y: number, z: number) => {
|
|
45
|
+
// CyclOSM: https://a.tile-cyclosm.openstreetmap.fr/cyclosm/9/142/197.png
|
|
46
|
+
// Cycle Map: https://b.tile.thunderforest.com/cycle/9/141/199@2x.png?apikey=6e5478c8a4f54c779f85573c0e399391
|
|
47
|
+
// TransportMap: https://b.tile.thunderforest.com/transport/9/136/195@2x.png?apikey=6e5478c8a4f54c779f85573c0e399391
|
|
48
|
+
return `https://tile.openstreetmap.org/${z}/${x}/${y}.png`;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// opentopomap.org/
|
|
52
|
+
const openTopoMap = (tileset: string) => (x: number, y: number, z: number) => {
|
|
53
|
+
const s = 'a';
|
|
54
|
+
return `https://${s}.tile.opentopomap.org/${z}/${x}/${y}.png`;
|
|
55
|
+
};
|
|
56
|
+
|
|
42
57
|
$: services = {
|
|
43
58
|
'mapbox v1': {
|
|
44
59
|
'streets-v11': mapboxv1('streets-v11'),
|
|
@@ -59,6 +74,12 @@
|
|
|
59
74
|
traffic: mapboxv4('mapbox.mapbox-traffic-v1'),
|
|
60
75
|
// 'transit (mapbox v4)': mapboxv4('mapbox.transit-v2'),
|
|
61
76
|
},
|
|
77
|
+
OpenStreetMap: {
|
|
78
|
+
Stardard: openStreetMap(''),
|
|
79
|
+
},
|
|
80
|
+
OpenTopoMap: {
|
|
81
|
+
Stardard: openTopoMap(''),
|
|
82
|
+
},
|
|
62
83
|
'National Map Services': {
|
|
63
84
|
Hydrography: nationalmap('USGSHydroCached'),
|
|
64
85
|
'USGS Imagery Topo Base Map': nationalmap('USGSImageryTopo'),
|