layerchart 0.33.0 → 0.34.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.
- package/dist/components/Axis.svelte +8 -6
- package/dist/components/Axis.svelte.d.ts +1 -1
- package/dist/components/GeoCircle.svelte +1 -1
- package/dist/components/GeoCircle.svelte.d.ts +4 -0
- package/dist/components/Legend.svelte +6 -6
- package/dist/components/Legend.svelte.d.ts +1 -1
- package/package.json +2 -2
|
@@ -18,7 +18,7 @@ export let grid = false;
|
|
|
18
18
|
/** Control the number of ticks*/
|
|
19
19
|
export let ticks = placement === 'left' || placement === 'right' ? 4 : undefined;
|
|
20
20
|
/** Length of the tick line */
|
|
21
|
-
export let
|
|
21
|
+
export let tickLength = 4;
|
|
22
22
|
export let format = undefined;
|
|
23
23
|
export let labelProps = undefined;
|
|
24
24
|
export let spring = undefined;
|
|
@@ -38,9 +38,11 @@ $: [xRangeMin, xRangeMax] = extent($xRange);
|
|
|
38
38
|
$: [yRangeMin, yRangeMax] = extent($yRange);
|
|
39
39
|
$: tickVals = Array.isArray(ticks)
|
|
40
40
|
? ticks
|
|
41
|
-
:
|
|
42
|
-
? scale
|
|
43
|
-
:
|
|
41
|
+
: typeof ticks === 'function'
|
|
42
|
+
? ticks(scale)
|
|
43
|
+
: isScaleBand(scale)
|
|
44
|
+
? scale.domain()
|
|
45
|
+
: scale.ticks(ticks);
|
|
44
46
|
function getCoords(tick) {
|
|
45
47
|
switch (placement) {
|
|
46
48
|
case 'top':
|
|
@@ -222,7 +224,7 @@ function getDefaultLabelProps(tick) {
|
|
|
222
224
|
x1={tickCoords.x}
|
|
223
225
|
y1={tickCoords.y}
|
|
224
226
|
x2={tickCoords.x}
|
|
225
|
-
y2={tickCoords.y + (placement === 'top' ? -
|
|
227
|
+
y2={tickCoords.y + (placement === 'top' ? -tickLength : tickLength)}
|
|
226
228
|
{tweened}
|
|
227
229
|
{spring}
|
|
228
230
|
class="tick stroke-surface-content/50"
|
|
@@ -231,7 +233,7 @@ function getDefaultLabelProps(tick) {
|
|
|
231
233
|
<Line
|
|
232
234
|
x1={tickCoords.x}
|
|
233
235
|
y1={tickCoords.y}
|
|
234
|
-
x2={tickCoords.x + (placement === 'left' ? -
|
|
236
|
+
x2={tickCoords.x + (placement === 'left' ? -tickLength : tickLength)}
|
|
235
237
|
y2={tickCoords.y}
|
|
236
238
|
{tweened}
|
|
237
239
|
{spring}
|
|
@@ -11,7 +11,7 @@ declare const __propDef: {
|
|
|
11
11
|
/** Draw a rule line. Use Rule component for greater rendering order control */ rule?: boolean | SVGAttributes<SVGLineElement> | undefined;
|
|
12
12
|
/** Draw a grid lines */ grid?: boolean | SVGAttributes<SVGLineElement> | undefined;
|
|
13
13
|
/** Control the number of ticks*/ ticks?: number | any[] | Function | undefined;
|
|
14
|
-
/** Length of the tick line */
|
|
14
|
+
/** Length of the tick line */ tickLength?: number | undefined;
|
|
15
15
|
format?: FormatType | undefined;
|
|
16
16
|
labelProps?: Partial<ComponentProps<Text>> | undefined;
|
|
17
17
|
spring?: boolean | Parameters<typeof springStore>[1];
|
|
@@ -14,7 +14,7 @@ export let ticks = width / 64;
|
|
|
14
14
|
export let tickFormat = undefined;
|
|
15
15
|
export let tickValues = undefined;
|
|
16
16
|
export let tickFontSize = 10;
|
|
17
|
-
export let
|
|
17
|
+
export let tickLength = 4;
|
|
18
18
|
export let placement = undefined;
|
|
19
19
|
export let classes = {};
|
|
20
20
|
$: if (scale == null && rScale) {
|
|
@@ -96,7 +96,7 @@ else {
|
|
|
96
96
|
tickValues = scale.domain();
|
|
97
97
|
tickLabelOffset = xScale.bandwidth() / 2;
|
|
98
98
|
tickLine = false;
|
|
99
|
-
|
|
99
|
+
tickLength = 0;
|
|
100
100
|
}
|
|
101
101
|
</script>
|
|
102
102
|
|
|
@@ -126,8 +126,8 @@ else {
|
|
|
126
126
|
<slot values={tickValues} {scale}>
|
|
127
127
|
<svg
|
|
128
128
|
{width}
|
|
129
|
-
height={height +
|
|
130
|
-
viewBox="0 0 {width} {height +
|
|
129
|
+
height={height + tickLength + tickFontSize}
|
|
130
|
+
viewBox="0 0 {width} {height + tickLength + tickFontSize}"
|
|
131
131
|
class="overflow-visible"
|
|
132
132
|
>
|
|
133
133
|
<g>
|
|
@@ -145,7 +145,7 @@ else {
|
|
|
145
145
|
<text
|
|
146
146
|
text-anchor="middle"
|
|
147
147
|
x={xScale(tick) + tickLabelOffset}
|
|
148
|
-
y={height +
|
|
148
|
+
y={height + tickLength + tickFontSize}
|
|
149
149
|
style:font-size={tickFontSize}
|
|
150
150
|
class={cls('fill-surface-content', classes.label)}
|
|
151
151
|
>
|
|
@@ -157,7 +157,7 @@ else {
|
|
|
157
157
|
x1={xScale(tick)}
|
|
158
158
|
y1={0}
|
|
159
159
|
x2={xScale(tick)}
|
|
160
|
-
y2={height +
|
|
160
|
+
y2={height + tickLength}
|
|
161
161
|
class={cls('stroke-surface-content', classes.tick)}
|
|
162
162
|
/>
|
|
163
163
|
{/if}
|
|
@@ -11,7 +11,7 @@ declare const __propDef: {
|
|
|
11
11
|
tickFormat?: FormatType | undefined;
|
|
12
12
|
tickValues?: any[] | undefined;
|
|
13
13
|
tickFontSize?: number | undefined;
|
|
14
|
-
|
|
14
|
+
tickLength?: number | undefined;
|
|
15
15
|
placement?: ("center" | "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right") | undefined;
|
|
16
16
|
classes?: {
|
|
17
17
|
root?: string | undefined;
|
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.34.0",
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"@changesets/cli": "^2.27.1",
|
|
10
10
|
"@mdi/js": "^7.4.47",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"lodash-es": "^4.17.21",
|
|
84
84
|
"posthog-js": "^1.116.0",
|
|
85
85
|
"shapefile": "^0.6.6",
|
|
86
|
-
"svelte-ux": "^0.
|
|
86
|
+
"svelte-ux": "^0.62.0",
|
|
87
87
|
"topojson-client": "^3.1.0"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|