layerchart 0.28.0-next.2 → 0.28.0-next.3
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/Area.svelte.d.ts +2 -2
- package/dist/components/Axis.svelte.d.ts +2 -3
- package/dist/components/Bounds.svelte +1 -1
- package/dist/components/Calendar.svelte.d.ts +2 -2
- package/dist/components/Chart.svelte.d.ts +2 -2
- package/dist/components/Circle.svelte +1 -0
- package/dist/components/Graticule.svelte +2 -2
- package/dist/components/Graticule.svelte.d.ts +2 -2
- package/dist/components/Highlight.svelte.d.ts +20 -12
- package/dist/components/Legend.svelte.d.ts +1 -2
- package/dist/components/Line.svelte +1 -0
- package/dist/components/Points.svelte.d.ts +2 -2
- package/dist/components/Rect.svelte +1 -0
- package/dist/components/Rule.svelte +2 -2
- package/dist/components/Spline.svelte +10 -1
- package/dist/components/TileImage.svelte +1 -7
- package/dist/components/TooltipItem.svelte.d.ts +1 -2
- package/dist/docs/Code.svelte +3 -3
- package/dist/docs/Code.svelte.d.ts +1 -1
- package/dist/docs/GeoDebug.svelte +1 -1
- package/dist/docs/Preview.svelte.d.ts +1 -1
- package/dist/utils/stack.js +1 -1
- package/dist/utils/ticks.d.ts +1 -1
- package/dist/utils/ticks.js +15 -16
- package/package.json +45 -39
- package/dist/utils/string.d.ts +0 -4
|
@@ -14,7 +14,7 @@ declare const __propDef: {
|
|
|
14
14
|
clipPath?: string | undefined;
|
|
15
15
|
curve?: CurveFactory | undefined;
|
|
16
16
|
defined?: Parameters<Area<any>['defined']>[0] | undefined;
|
|
17
|
-
line?: boolean | {
|
|
17
|
+
line?: boolean | Partial<{
|
|
18
18
|
[x: string]: any;
|
|
19
19
|
data?: any;
|
|
20
20
|
pathData?: string | null | undefined;
|
|
@@ -24,7 +24,7 @@ declare const __propDef: {
|
|
|
24
24
|
draw?: boolean | import("svelte/transition").DrawParams | undefined;
|
|
25
25
|
curve?: CurveFactory | import("d3-shape").CurveFactoryLineOnly | undefined;
|
|
26
26
|
defined?: ((d: any, index: number, data: any[]) => boolean) | undefined;
|
|
27
|
-
} | undefined;
|
|
27
|
+
}> | undefined;
|
|
28
28
|
};
|
|
29
29
|
events: {
|
|
30
30
|
click: MouseEvent;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import { type ComponentProps } from 'svelte';
|
|
3
3
|
import type { SVGAttributes } from 'svelte/elements';
|
|
4
|
-
import { type FormatType } from 'svelte-ux';
|
|
5
4
|
import Text from './Text.svelte';
|
|
6
5
|
declare const __propDef: {
|
|
7
6
|
props: {
|
|
@@ -10,8 +9,8 @@ declare const __propDef: {
|
|
|
10
9
|
/** Draw a grid lines */ grid?: boolean | SVGAttributes<SVGLineElement> | undefined;
|
|
11
10
|
/** Control the number of ticks*/ ticks?: number | any[] | Function | undefined;
|
|
12
11
|
/** Length of the tick line */ tickSize?: number | undefined;
|
|
13
|
-
format?:
|
|
14
|
-
labelProps?: ComponentProps<Text
|
|
12
|
+
format?: any;
|
|
13
|
+
labelProps?: Partial<ComponentProps<Text>> | undefined;
|
|
15
14
|
};
|
|
16
15
|
events: {
|
|
17
16
|
[evt: string]: CustomEvent<any>;
|
|
@@ -9,7 +9,7 @@ export let tweened = undefined;
|
|
|
9
9
|
function getExtents(extents, axis, fallback) {
|
|
10
10
|
const resolvedExtents = typeof extents === 'function' ? extents({ width: $width, height: $height }) : extents;
|
|
11
11
|
return [
|
|
12
|
-
resolvedExtents?.[axis + '0'] ?? 0,
|
|
12
|
+
resolvedExtents?.[axis + '0'] ?? 0, // x0 or y0
|
|
13
13
|
resolvedExtents?.[axis + '1'] ?? fallback // x1 or y1, fallback as $width or $height
|
|
14
14
|
];
|
|
15
15
|
}
|
|
@@ -6,11 +6,11 @@ declare const __propDef: {
|
|
|
6
6
|
start: Date;
|
|
7
7
|
end: Date;
|
|
8
8
|
cellSize?: number | [number, number] | undefined;
|
|
9
|
-
monthPath?: boolean | {
|
|
9
|
+
monthPath?: boolean | Partial<{
|
|
10
10
|
[x: string]: any;
|
|
11
11
|
date: Date;
|
|
12
12
|
cellSize: number | [number, number];
|
|
13
|
-
} | undefined;
|
|
13
|
+
}> | undefined;
|
|
14
14
|
tooltip?: TooltipContextValue | undefined;
|
|
15
15
|
};
|
|
16
16
|
events: {
|
|
@@ -16,8 +16,8 @@ declare const __propDef: {
|
|
|
16
16
|
yScale?: Function | undefined;
|
|
17
17
|
xBaseline?: number | null | undefined;
|
|
18
18
|
yBaseline?: number | null | undefined;
|
|
19
|
-
tooltip?: ComponentProps<TooltipContext
|
|
20
|
-
geo?: ComponentProps<GeoContext
|
|
19
|
+
tooltip?: Partial<ComponentProps<TooltipContext>> | boolean | undefined;
|
|
20
|
+
geo?: Partial<ComponentProps<GeoContext>> | undefined;
|
|
21
21
|
};
|
|
22
22
|
events: {
|
|
23
23
|
[evt: string]: CustomEvent<any>;
|
|
@@ -16,11 +16,11 @@ $: graticule.step(step);
|
|
|
16
16
|
|
|
17
17
|
{#if lines}
|
|
18
18
|
{#each graticule.lines() as line}
|
|
19
|
-
<GeoPath geojson={line} {...lines} />
|
|
19
|
+
<GeoPath geojson={line} {...typeof lines === 'object' ? lines : null} />
|
|
20
20
|
{/each}
|
|
21
21
|
{/if}
|
|
22
22
|
|
|
23
23
|
{#if outline}
|
|
24
|
-
<GeoPath geojson={graticule.outline()} {...outline} />
|
|
24
|
+
<GeoPath geojson={graticule.outline()} {...typeof outline === 'object' ? outline : null} />
|
|
25
25
|
{/if}
|
|
26
26
|
</g>
|
|
@@ -4,8 +4,8 @@ import GeoPath from './GeoPath.svelte';
|
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
6
|
[x: string]: any;
|
|
7
|
-
lines?:
|
|
8
|
-
outline?:
|
|
7
|
+
lines?: Partial<ComponentProps<GeoPath>> | boolean | undefined;
|
|
8
|
+
outline?: Partial<ComponentProps<GeoPath>> | boolean | undefined;
|
|
9
9
|
step?: [number, number] | undefined;
|
|
10
10
|
};
|
|
11
11
|
events: {
|
|
@@ -2,7 +2,7 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
axis?: 'x' | 'y' | 'both' | 'none' | undefined;
|
|
5
|
-
/** Show points and pass props to Circles */ points?: boolean | {
|
|
5
|
+
/** Show points and pass props to Circles */ points?: boolean | Partial<{
|
|
6
6
|
[x: string]: any;
|
|
7
7
|
cx?: number | undefined;
|
|
8
8
|
initialCx?: number | undefined;
|
|
@@ -12,8 +12,8 @@ declare const __propDef: {
|
|
|
12
12
|
initialR?: number | undefined;
|
|
13
13
|
spring?: boolean | import("svelte/motion").SpringOpts | undefined;
|
|
14
14
|
tweened?: boolean | import("svelte/motion").TweenedOptions<unknown> | undefined;
|
|
15
|
-
} | undefined;
|
|
16
|
-
/** Show lines and pass props to Lines */ lines?: boolean | {
|
|
15
|
+
}> | undefined;
|
|
16
|
+
/** Show lines and pass props to Lines */ lines?: boolean | Partial<{
|
|
17
17
|
[x: string]: any;
|
|
18
18
|
x1: number;
|
|
19
19
|
initialX1?: number | undefined;
|
|
@@ -25,8 +25,8 @@ declare const __propDef: {
|
|
|
25
25
|
initialY2?: number | undefined;
|
|
26
26
|
spring?: boolean | import("svelte/motion").SpringOpts | undefined;
|
|
27
27
|
tweened?: boolean | import("svelte/motion").TweenedOptions<unknown> | undefined;
|
|
28
|
-
} | undefined;
|
|
29
|
-
/** Show area and pass props to Rect */ area?: boolean | {
|
|
28
|
+
}> | undefined;
|
|
29
|
+
/** Show area and pass props to Rect */ area?: boolean | Partial<{
|
|
30
30
|
[x: string]: any;
|
|
31
31
|
x?: number | undefined;
|
|
32
32
|
initialX?: number | undefined;
|
|
@@ -42,8 +42,8 @@ declare const __propDef: {
|
|
|
42
42
|
tweened?: boolean | import("svelte/motion").TweenedOptions<unknown> | {
|
|
43
43
|
[prop: string]: import("svelte/motion").TweenedOptions<unknown> | undefined;
|
|
44
44
|
} | undefined;
|
|
45
|
-
} | undefined;
|
|
46
|
-
/** Show bar and pass props to Rect */ bar?: boolean | {
|
|
45
|
+
}> | undefined;
|
|
46
|
+
/** Show bar and pass props to Rect */ bar?: boolean | Partial<{
|
|
47
47
|
[x: string]: any;
|
|
48
48
|
x?: number | undefined;
|
|
49
49
|
initialX?: number | undefined;
|
|
@@ -59,7 +59,7 @@ declare const __propDef: {
|
|
|
59
59
|
tweened?: boolean | import("svelte/motion").TweenedOptions<unknown> | {
|
|
60
60
|
[prop: string]: import("svelte/motion").TweenedOptions<unknown> | undefined;
|
|
61
61
|
} | undefined;
|
|
62
|
-
} | undefined;
|
|
62
|
+
}> | undefined;
|
|
63
63
|
};
|
|
64
64
|
events: {
|
|
65
65
|
click: MouseEvent;
|
|
@@ -76,7 +76,7 @@ declare const __propDef: {
|
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
78
|
bar: {
|
|
79
|
-
bar: boolean | {
|
|
79
|
+
bar: boolean | Partial<{
|
|
80
80
|
[x: string]: any;
|
|
81
81
|
x?: number | undefined;
|
|
82
82
|
initialX?: number | undefined;
|
|
@@ -92,13 +92,21 @@ declare const __propDef: {
|
|
|
92
92
|
tweened?: boolean | import("svelte/motion").TweenedOptions<unknown> | {
|
|
93
93
|
[prop: string]: import("svelte/motion").TweenedOptions<unknown> | undefined;
|
|
94
94
|
} | undefined;
|
|
95
|
-
}
|
|
95
|
+
}>;
|
|
96
96
|
};
|
|
97
97
|
lines: {
|
|
98
|
-
lines:
|
|
98
|
+
lines: {
|
|
99
|
+
x1: number;
|
|
100
|
+
y1: number;
|
|
101
|
+
x2: number;
|
|
102
|
+
y2: number;
|
|
103
|
+
}[];
|
|
99
104
|
};
|
|
100
105
|
points: {
|
|
101
|
-
points:
|
|
106
|
+
points: {
|
|
107
|
+
x: number;
|
|
108
|
+
y: number;
|
|
109
|
+
}[];
|
|
102
110
|
};
|
|
103
111
|
};
|
|
104
112
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import { type FormatType } from 'svelte-ux';
|
|
3
2
|
declare const __propDef: {
|
|
4
3
|
props: {
|
|
5
4
|
[x: string]: any;
|
|
@@ -8,7 +7,7 @@ declare const __propDef: {
|
|
|
8
7
|
width?: number | undefined;
|
|
9
8
|
height?: number | undefined;
|
|
10
9
|
ticks?: number | undefined;
|
|
11
|
-
tickFormat?:
|
|
10
|
+
tickFormat?: any;
|
|
12
11
|
tickValues?: any[] | undefined;
|
|
13
12
|
tickFontSize?: number | undefined;
|
|
14
13
|
tickSize?: number | undefined;
|
|
@@ -5,7 +5,7 @@ declare const __propDef: {
|
|
|
5
5
|
r?: number | undefined;
|
|
6
6
|
offsetX?: number | ((value: number, context: any) => number) | undefined;
|
|
7
7
|
offsetY?: number | ((value: number, context: any) => number) | undefined;
|
|
8
|
-
links?: boolean | {
|
|
8
|
+
links?: boolean | Partial<{
|
|
9
9
|
[x: string]: any;
|
|
10
10
|
data?: any;
|
|
11
11
|
sankey?: boolean | undefined;
|
|
@@ -16,7 +16,7 @@ declare const __propDef: {
|
|
|
16
16
|
y?: ((d: any) => any) | undefined;
|
|
17
17
|
curve?: import("d3-shape").CurveFactory | undefined;
|
|
18
18
|
tweened?: boolean | import("svelte/motion").TweenedOptions<unknown> | undefined;
|
|
19
|
-
} | undefined;
|
|
19
|
+
}> | undefined;
|
|
20
20
|
};
|
|
21
21
|
events: {
|
|
22
22
|
[evt: string]: CustomEvent<any>;
|
|
@@ -31,7 +31,7 @@ export let y = false;
|
|
|
31
31
|
y1={$yRange[0] || 0}
|
|
32
32
|
y2={$yRange[1] || 0}
|
|
33
33
|
{...$$restProps}
|
|
34
|
-
class={cls('stroke-
|
|
34
|
+
class={cls('stroke-surface-content/50', $$props.class)}
|
|
35
35
|
/>
|
|
36
36
|
{/if}
|
|
37
37
|
|
|
@@ -42,7 +42,7 @@ export let y = false;
|
|
|
42
42
|
y1={y === true || y === 'bottom' ? yRangeMax : y === 'top' ? yRangeMin : $yScale(y)}
|
|
43
43
|
y2={y === true || y === 'bottom' ? yRangeMax : y === 'top' ? yRangeMin : $yScale(y)}
|
|
44
44
|
{...$$restProps}
|
|
45
|
-
class={cls('stroke-
|
|
45
|
+
class={cls('stroke-surface-content/50', $$props.class)}
|
|
46
46
|
/>
|
|
47
47
|
{/if}
|
|
48
48
|
</g>
|
|
@@ -22,6 +22,15 @@ export let y = undefined; // TODO: Update Type
|
|
|
22
22
|
export let tweened = undefined;
|
|
23
23
|
/** Draw path over time. Works best without `tweened` enabled */
|
|
24
24
|
export let draw = undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Curve of spline drawn. Imported via d3-shape.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* import { curveNatural } from 'd3-shape';
|
|
30
|
+
* <Spline curve={curveNatrual} />
|
|
31
|
+
*
|
|
32
|
+
* @type {CurveFactory | CurveFactoryLineOnly | undefined}
|
|
33
|
+
*/
|
|
25
34
|
export let curve = undefined;
|
|
26
35
|
export let defined = undefined;
|
|
27
36
|
let d = '';
|
|
@@ -81,7 +90,7 @@ $: {
|
|
|
81
90
|
<path
|
|
82
91
|
d={$tweened_d}
|
|
83
92
|
{...$$restProps}
|
|
84
|
-
class={cls('path-line fill-none', !$$props.stroke && 'stroke-
|
|
93
|
+
class={cls('path-line fill-none', !$$props.stroke && 'stroke-surface-content', $$props.class)}
|
|
85
94
|
in:drawTransition|global={typeof draw === 'object' ? draw : undefined}
|
|
86
95
|
on:click
|
|
87
96
|
on:mousemove
|
|
@@ -65,13 +65,7 @@ $: if (!disableCache) {
|
|
|
65
65
|
/>
|
|
66
66
|
<image xlink:href={href} x={(x + tx) * k} y={(y + ty) * k} width={k} height={k} />
|
|
67
67
|
{#if debug}
|
|
68
|
-
<rect
|
|
69
|
-
x={(x + tx) * k}
|
|
70
|
-
y={(y + ty) * k}
|
|
71
|
-
width={k}
|
|
72
|
-
height={k}
|
|
73
|
-
class="stroke-red-500/50 fill-none"
|
|
74
|
-
/>
|
|
68
|
+
<rect x={(x + tx) * k} y={(y + ty) * k} width={k} height={k} class="stroke-danger/50 fill-none" />
|
|
75
69
|
<Text
|
|
76
70
|
x={(x + tx) * k}
|
|
77
71
|
y={(y + ty) * k}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import { type FormatType } from 'svelte-ux';
|
|
3
2
|
declare const __propDef: {
|
|
4
3
|
props: {
|
|
5
4
|
[x: string]: any;
|
|
6
5
|
label: any;
|
|
7
6
|
value?: any;
|
|
8
|
-
format?:
|
|
7
|
+
format?: any;
|
|
9
8
|
valueAlign?: "center" | "left" | "right" | undefined;
|
|
10
9
|
classes?: {
|
|
11
10
|
label?: string | undefined;
|
package/dist/docs/Code.svelte
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script>import Prism from 'prismjs';
|
|
2
2
|
import 'prism-svelte';
|
|
3
|
-
import { CopyButton, cls,
|
|
3
|
+
import { CopyButton, cls, getComponentClasses } from 'svelte-ux';
|
|
4
4
|
export let source = null;
|
|
5
5
|
export let language = 'svelte';
|
|
6
6
|
export let highlightedSource = source
|
|
7
7
|
? Prism.highlight(source, Prism.languages[language] ?? Prism.languages.text, language)
|
|
8
8
|
: '';
|
|
9
9
|
export let classes = {};
|
|
10
|
-
const
|
|
10
|
+
const settingsClasses = getComponentClasses('Code');
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
|
-
<div class={cls('Code', 'rounded',
|
|
13
|
+
<div class={cls('Code', 'rounded', settingsClasses.root, classes.root, $$props.class)}>
|
|
14
14
|
{#if source}
|
|
15
15
|
<div class="relative">
|
|
16
16
|
<pre
|
|
@@ -39,6 +39,6 @@ let showCenter = false;
|
|
|
39
39
|
|
|
40
40
|
{#if showCenter}
|
|
41
41
|
<div
|
|
42
|
-
class="absolute w-2 h-2 bg-
|
|
42
|
+
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"
|
|
43
43
|
/>
|
|
44
44
|
{/if}
|
package/dist/utils/stack.js
CHANGED
|
@@ -16,7 +16,7 @@ export function createStackData(data, options) {
|
|
|
16
16
|
//console.log({ series })
|
|
17
17
|
return series.flatMap((s) => {
|
|
18
18
|
return {
|
|
19
|
-
...itemData[0],
|
|
19
|
+
...itemData[0], // TODO: More than one should use stacks or aggregate values?
|
|
20
20
|
keys: options.stackBy ? [...groupKeys, series.key] : groupKeys,
|
|
21
21
|
values: options.stackBy ? [s[0], s[1]] : [0, sum(itemData, (d) => d.value)],
|
|
22
22
|
};
|
package/dist/utils/ticks.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare function getMajorTicks(start: Date, end: Date): import("d3-time").TimeInterval | null;
|
|
2
|
-
export declare function formatMajorTick(date: Date, rangeStart: Date, rangeEnd: Date):
|
|
2
|
+
export declare function formatMajorTick(date: Date, rangeStart: Date, rangeEnd: Date): string;
|
|
3
3
|
export declare function getMinorTicks(start: Date, end: Date): import("d3-time").TimeInterval | null;
|
package/dist/utils/ticks.js
CHANGED
|
@@ -1,34 +1,33 @@
|
|
|
1
1
|
import { timeYear, timeMonth, timeWeek, timeDay, timeHour, timeMinute, timeSecond, timeMillisecond, } from 'd3-time';
|
|
2
2
|
import { format } from 'date-fns';
|
|
3
|
-
import { formatDate, PeriodType } from 'svelte-ux
|
|
4
|
-
import { getDuration } from 'svelte-ux/utils/duration';
|
|
3
|
+
import { formatDate, PeriodType, getDuration } from 'svelte-ux';
|
|
5
4
|
import { fail } from 'svelte-ux';
|
|
6
5
|
// TODO: Use PeriodType along with Duration to format (and possibly select intervals)
|
|
7
6
|
const majorTicks = [
|
|
8
7
|
{
|
|
9
|
-
predicate: (duration) => duration == null,
|
|
10
|
-
interval: timeYear.every(1),
|
|
8
|
+
predicate: (duration) => duration == null, // Unknown
|
|
9
|
+
interval: timeYear.every(1), // Better than rendering a lot of items
|
|
11
10
|
format: (date) => date.toString(),
|
|
12
11
|
},
|
|
13
12
|
{
|
|
14
13
|
predicate: (duration) => duration.years > 1,
|
|
15
14
|
interval: timeYear.every(1),
|
|
16
|
-
format: (date) => formatDate(date, PeriodType.CalendarYear, 'short'),
|
|
15
|
+
format: (date) => formatDate(date, PeriodType.CalendarYear, { variant: 'short' }),
|
|
17
16
|
},
|
|
18
17
|
{
|
|
19
18
|
predicate: (duration) => duration.years,
|
|
20
19
|
interval: timeMonth.every(1),
|
|
21
|
-
format: (date) => formatDate(date, PeriodType.Month, 'short'),
|
|
20
|
+
format: (date) => formatDate(date, PeriodType.Month, { variant: 'short' }),
|
|
22
21
|
},
|
|
23
22
|
{
|
|
24
23
|
predicate: (duration) => duration.days > 30,
|
|
25
24
|
interval: timeMonth.every(1),
|
|
26
|
-
format: (date) => formatDate(date, PeriodType.Month, 'short'),
|
|
25
|
+
format: (date) => formatDate(date, PeriodType.Month, { variant: 'short' }),
|
|
27
26
|
},
|
|
28
27
|
{
|
|
29
28
|
predicate: (duration) => duration.days,
|
|
30
29
|
interval: timeDay.every(1),
|
|
31
|
-
format: (date) => formatDate(date, PeriodType.Day, 'short'),
|
|
30
|
+
format: (date) => formatDate(date, PeriodType.Day, { variant: 'short' }),
|
|
32
31
|
},
|
|
33
32
|
{
|
|
34
33
|
predicate: (duration) => duration.hours,
|
|
@@ -56,36 +55,36 @@ const majorTicks = [
|
|
|
56
55
|
format: (date) => format(date, 'h:mm:ss'),
|
|
57
56
|
},
|
|
58
57
|
{
|
|
59
|
-
predicate: (duration) => true,
|
|
58
|
+
predicate: (duration) => true, // 0 or more milliseconds
|
|
60
59
|
interval: timeMillisecond.every(100),
|
|
61
60
|
format: (date) => format(date, 'h:mm:ss.SSS'),
|
|
62
61
|
},
|
|
63
62
|
];
|
|
64
63
|
const minorTicks = [
|
|
65
64
|
{
|
|
66
|
-
predicate: (duration) => duration == null,
|
|
67
|
-
interval: timeYear.every(1),
|
|
65
|
+
predicate: (duration) => duration == null, // Unknown
|
|
66
|
+
interval: timeYear.every(1), // Better than rendering a lot of items
|
|
68
67
|
format: (date) => date.toString(),
|
|
69
68
|
},
|
|
70
69
|
{
|
|
71
70
|
predicate: (duration) => duration.years,
|
|
72
71
|
interval: timeMonth.every(1),
|
|
73
|
-
format: (date) => formatDate(date, PeriodType.Month, 'short'),
|
|
72
|
+
format: (date) => formatDate(date, PeriodType.Month, { variant: 'short' }),
|
|
74
73
|
},
|
|
75
74
|
{
|
|
76
75
|
predicate: (duration) => duration.days > 90,
|
|
77
76
|
interval: timeMonth.every(1),
|
|
78
|
-
format: (date) => formatDate(date, PeriodType.Month, 'short'),
|
|
77
|
+
format: (date) => formatDate(date, PeriodType.Month, { variant: 'short' }),
|
|
79
78
|
},
|
|
80
79
|
{
|
|
81
80
|
predicate: (duration) => duration.days > 30,
|
|
82
81
|
interval: timeWeek.every(1),
|
|
83
|
-
format: (date) => formatDate(date, PeriodType.WeekSun, 'short'),
|
|
82
|
+
format: (date) => formatDate(date, PeriodType.WeekSun, { variant: 'short' }),
|
|
84
83
|
},
|
|
85
84
|
{
|
|
86
85
|
predicate: (duration) => duration.days > 7,
|
|
87
86
|
interval: timeDay.every(1),
|
|
88
|
-
format: (date) => formatDate(date, PeriodType.Day, 'short'),
|
|
87
|
+
format: (date) => formatDate(date, PeriodType.Day, { variant: 'short' }),
|
|
89
88
|
},
|
|
90
89
|
{
|
|
91
90
|
predicate: (duration) => duration.days > 3,
|
|
@@ -123,7 +122,7 @@ const minorTicks = [
|
|
|
123
122
|
format: (date) => format(date, 'h:mm:ss'),
|
|
124
123
|
},
|
|
125
124
|
{
|
|
126
|
-
predicate: (duration) => true,
|
|
125
|
+
predicate: (duration) => true, // 0 or more milliseconds
|
|
127
126
|
interval: timeMillisecond.every(10),
|
|
128
127
|
format: (date) => format(date, 'h:mm:ss.SSS'),
|
|
129
128
|
},
|
package/package.json
CHANGED
|
@@ -4,24 +4,14 @@
|
|
|
4
4
|
"author": "Sean Lynch <techniq35@gmail.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "techniq/layerchart",
|
|
7
|
-
"version": "0.28.0-next.
|
|
8
|
-
"scripts": {
|
|
9
|
-
"dev": "vite dev",
|
|
10
|
-
"build": "vite build",
|
|
11
|
-
"preview": "vite preview",
|
|
12
|
-
"package": "svelte-package",
|
|
13
|
-
"prepublishOnly": "svelte-package",
|
|
14
|
-
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
15
|
-
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
|
|
16
|
-
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. .",
|
|
17
|
-
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. .",
|
|
18
|
-
"prepare": "svelte-kit sync"
|
|
19
|
-
},
|
|
7
|
+
"version": "0.28.0-next.3",
|
|
20
8
|
"devDependencies": {
|
|
9
|
+
"@changesets/cli": "^2.27.1",
|
|
10
|
+
"@mdi/js": "^7.4.47",
|
|
21
11
|
"@rollup/plugin-dsv": "^3.0.4",
|
|
22
|
-
"@sveltejs/adapter-auto": "^
|
|
23
|
-
"@sveltejs/kit": "^
|
|
24
|
-
"@sveltejs/package": "^2.2.
|
|
12
|
+
"@sveltejs/adapter-auto": "^3.1.0",
|
|
13
|
+
"@sveltejs/kit": "^2.3.2",
|
|
14
|
+
"@sveltejs/package": "^2.2.5",
|
|
25
15
|
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
|
|
26
16
|
"@tailwindcss/typography": "^0.5.10",
|
|
27
17
|
"@types/d3-array": "^3.2.1",
|
|
@@ -31,43 +21,49 @@
|
|
|
31
21
|
"@types/d3-hierarchy": "^3.1.6",
|
|
32
22
|
"@types/d3-interpolate": "^3.0.4",
|
|
33
23
|
"@types/d3-interpolate-path": "^2.0.3",
|
|
34
|
-
"@types/d3-quadtree": "^3.0.
|
|
24
|
+
"@types/d3-quadtree": "^3.0.6",
|
|
35
25
|
"@types/d3-random": "^3.0.3",
|
|
36
26
|
"@types/d3-sankey": "^0.12.4",
|
|
37
27
|
"@types/d3-scale": "^4.0.8",
|
|
38
|
-
"@types/d3-scale-chromatic": "^3.0.
|
|
39
|
-
"@types/d3-shape": "^3.1.
|
|
40
|
-
"@types/
|
|
28
|
+
"@types/d3-scale-chromatic": "^3.0.3",
|
|
29
|
+
"@types/d3-shape": "^3.1.6",
|
|
30
|
+
"@types/d3-time": "^3.0.2",
|
|
31
|
+
"@types/lodash-es": "^4.17.12",
|
|
41
32
|
"@types/marked": "^6.0.0",
|
|
33
|
+
"@types/prismjs": "^1.26.3",
|
|
42
34
|
"@types/shapefile": "^0.6.4",
|
|
43
35
|
"@types/topojson-client": "^3.1.4",
|
|
44
36
|
"autoprefixer": "^10.4.16",
|
|
45
|
-
"
|
|
37
|
+
"d3-color": "^3.1.0",
|
|
46
38
|
"execa": "^8.0.1",
|
|
47
|
-
"marked": "^
|
|
39
|
+
"marked": "^11.1.1",
|
|
48
40
|
"mdsvex": "^0.11.0",
|
|
49
|
-
"
|
|
50
|
-
"prettier
|
|
41
|
+
"posthog-js": "^1.95.1",
|
|
42
|
+
"prettier": "^3.2.2",
|
|
43
|
+
"prettier-plugin-svelte": "^3.1.2",
|
|
44
|
+
"prism-svelte": "^0.5.0",
|
|
51
45
|
"prism-themes": "^1.9.0",
|
|
46
|
+
"prismjs": "^1.29.0",
|
|
52
47
|
"rehype-slug": "^6.0.0",
|
|
53
|
-
"
|
|
54
|
-
"svelte
|
|
48
|
+
"shapefile": "^0.6.6",
|
|
49
|
+
"svelte": "^4.2.8",
|
|
50
|
+
"svelte-check": "^3.6.3",
|
|
55
51
|
"svelte-json-tree": "^2.2.0",
|
|
56
|
-
"svelte-preprocess": "^5.1.
|
|
57
|
-
"svelte2tsx": "^0.
|
|
58
|
-
"tailwindcss": "^3.
|
|
52
|
+
"svelte-preprocess": "^5.1.3",
|
|
53
|
+
"svelte2tsx": "^0.7.0",
|
|
54
|
+
"tailwindcss": "^3.4.1",
|
|
55
|
+
"topojson-client": "^3.1.0",
|
|
59
56
|
"tslib": "^2.6.2",
|
|
60
|
-
"typescript": "^5.
|
|
57
|
+
"typescript": "^5.3.3",
|
|
61
58
|
"unist-util-visit": "^5.0.0",
|
|
62
59
|
"us-atlas": "^3.0.1",
|
|
63
|
-
"vite": "^
|
|
60
|
+
"vite": "^5.0.11"
|
|
64
61
|
},
|
|
65
62
|
"type": "module",
|
|
66
63
|
"dependencies": {
|
|
67
|
-
"@
|
|
68
|
-
"@mdi/js": "^7.3.67",
|
|
69
|
-
"@types/d3-time": "^3.0.2",
|
|
64
|
+
"@sveltejs/vite-plugin-svelte": "^3.0.1",
|
|
70
65
|
"d3-array": "^3.2.4",
|
|
66
|
+
"d3-color": "^3.1.0",
|
|
71
67
|
"d3-delaunay": "^6.0.4",
|
|
72
68
|
"d3-dsv": "^3.0.1",
|
|
73
69
|
"d3-geo": "^3.1.0",
|
|
@@ -82,12 +78,12 @@
|
|
|
82
78
|
"d3-shape": "^3.2.0",
|
|
83
79
|
"d3-tile": "^1.0.0",
|
|
84
80
|
"d3-time": "^3.1.0",
|
|
85
|
-
"date-fns": "^2.
|
|
81
|
+
"date-fns": "^3.2.0",
|
|
86
82
|
"layercake": "^8.0.2",
|
|
87
83
|
"lodash-es": "^4.17.21",
|
|
88
|
-
"posthog-js": "^1.
|
|
84
|
+
"posthog-js": "^1.100.0",
|
|
89
85
|
"shapefile": "^0.6.6",
|
|
90
|
-
"svelte-ux": "0.58.0-next.
|
|
86
|
+
"svelte-ux": "0.58.0-next.13",
|
|
91
87
|
"topojson-client": "^3.1.0"
|
|
92
88
|
},
|
|
93
89
|
"peerDependencies": {
|
|
@@ -103,5 +99,15 @@
|
|
|
103
99
|
"files": [
|
|
104
100
|
"dist"
|
|
105
101
|
],
|
|
106
|
-
"svelte": "./dist/index.js"
|
|
107
|
-
|
|
102
|
+
"svelte": "./dist/index.js",
|
|
103
|
+
"scripts": {
|
|
104
|
+
"dev": "vite dev",
|
|
105
|
+
"build": "vite build",
|
|
106
|
+
"preview": "vite preview",
|
|
107
|
+
"package": "svelte-package",
|
|
108
|
+
"check": "svelte-check --tsconfig ./tsconfig.json",
|
|
109
|
+
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
|
|
110
|
+
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. .",
|
|
111
|
+
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ."
|
|
112
|
+
}
|
|
113
|
+
}
|
package/dist/utils/string.d.ts
DELETED