svelteplot 0.3.1 → 0.3.2-pr-113.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/Mark.svelte +25 -27
- package/dist/Mark.svelte.d.ts +87 -17
- package/dist/Plot.svelte +1 -2
- package/dist/Plot.svelte.d.ts +1 -1
- package/dist/core/Facet.svelte +1 -1
- package/dist/core/Facet.svelte.d.ts +1 -1
- package/dist/core/FacetAxes.svelte +1 -1
- package/dist/core/FacetGrid.svelte +1 -1
- package/dist/core/FacetGrid.svelte.d.ts +1 -1
- package/dist/core/Plot.svelte +1 -1
- package/dist/core/Plot.svelte.d.ts +1 -1
- package/dist/helpers/autoTicks.js +1 -1
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/getBaseStyles.d.ts +2 -0
- package/dist/helpers/getBaseStyles.js +8 -0
- package/dist/helpers/index.d.ts +2 -2
- package/dist/helpers/projection.d.ts +1 -1
- package/dist/helpers/resolve.d.ts +1 -1
- package/dist/helpers/scales.d.ts +1 -1
- package/dist/helpers/typeChecks.d.ts +4 -4
- package/dist/marks/Area.svelte +14 -17
- package/dist/marks/Area.svelte.d.ts +91 -19
- package/dist/marks/AreaX.svelte +15 -12
- package/dist/marks/AreaX.svelte.d.ts +94 -3
- package/dist/marks/AreaY.svelte +15 -15
- package/dist/marks/AreaY.svelte.d.ts +94 -3
- package/dist/marks/Arrow.svelte +16 -19
- package/dist/marks/Arrow.svelte.d.ts +110 -38
- package/dist/marks/AxisX.svelte +41 -41
- package/dist/marks/AxisX.svelte.d.ts +97 -25
- package/dist/marks/AxisY.svelte +40 -40
- package/dist/marks/AxisY.svelte.d.ts +98 -27
- package/dist/marks/BarX.svelte +28 -30
- package/dist/marks/BarX.svelte.d.ts +89 -17
- package/dist/marks/BarY.svelte +27 -27
- package/dist/marks/BarY.svelte.d.ts +88 -16
- package/dist/marks/BollingerX.svelte +21 -16
- package/dist/marks/BollingerX.svelte.d.ts +17 -16
- package/dist/marks/BollingerY.svelte +21 -16
- package/dist/marks/BollingerY.svelte.d.ts +17 -16
- package/dist/marks/BoxX.svelte +5 -7
- package/dist/marks/BoxX.svelte.d.ts +5 -3
- package/dist/marks/BoxY.svelte +13 -16
- package/dist/marks/BoxY.svelte.d.ts +41 -28
- package/dist/marks/Brush.svelte +27 -30
- package/dist/marks/Brush.svelte.d.ts +20 -15
- package/dist/marks/BrushX.svelte +9 -7
- package/dist/marks/BrushX.svelte.d.ts +5 -2
- package/dist/marks/BrushY.svelte +9 -7
- package/dist/marks/BrushY.svelte.d.ts +5 -2
- package/dist/marks/Cell.svelte +17 -18
- package/dist/marks/Cell.svelte.d.ts +80 -8
- package/dist/marks/CellX.svelte +12 -8
- package/dist/marks/CellX.svelte.d.ts +5 -2
- package/dist/marks/CellY.svelte +12 -8
- package/dist/marks/CellY.svelte.d.ts +5 -2
- package/dist/marks/ColorLegend.svelte +5 -8
- package/dist/marks/ColorLegend.svelte.d.ts +2 -2
- package/dist/marks/CustomMark.svelte +23 -16
- package/dist/marks/CustomMark.svelte.d.ts +17 -14
- package/dist/marks/CustomMarkHTML.svelte +20 -18
- package/dist/marks/CustomMarkHTML.svelte.d.ts +29 -15
- package/dist/marks/DifferenceY.svelte +54 -18
- package/dist/marks/DifferenceY.svelte.d.ts +59 -28
- package/dist/marks/Dot.svelte +13 -14
- package/dist/marks/Dot.svelte.d.ts +84 -12
- package/dist/marks/DotX.svelte +9 -9
- package/dist/marks/DotX.svelte.d.ts +86 -4
- package/dist/marks/DotY.svelte +10 -9
- package/dist/marks/DotY.svelte.d.ts +87 -5
- package/dist/marks/Frame.svelte +20 -27
- package/dist/marks/Frame.svelte.d.ts +24 -10
- package/dist/marks/Geo.svelte +22 -15
- package/dist/marks/Geo.svelte.d.ts +97 -13
- package/dist/marks/Graticule.svelte +16 -19
- package/dist/marks/Graticule.svelte.d.ts +3 -3
- package/dist/marks/GridX.svelte +5 -8
- package/dist/marks/GridX.svelte.d.ts +79 -7
- package/dist/marks/GridY.svelte +5 -8
- package/dist/marks/GridY.svelte.d.ts +79 -7
- package/dist/marks/HTMLTooltip.svelte +9 -14
- package/dist/marks/HTMLTooltip.svelte.d.ts +25 -12
- package/dist/marks/Line.svelte +24 -29
- package/dist/marks/Line.svelte.d.ts +97 -25
- package/dist/marks/LineX.svelte +9 -4
- package/dist/marks/LineX.svelte.d.ts +99 -3
- package/dist/marks/LineY.svelte +11 -5
- package/dist/marks/LineY.svelte.d.ts +100 -4
- package/dist/marks/Link.svelte +35 -19
- package/dist/marks/Link.svelte.d.ts +107 -18
- package/dist/marks/Pointer.svelte +13 -18
- package/dist/marks/Pointer.svelte.d.ts +34 -21
- package/dist/marks/Rect.svelte +19 -19
- package/dist/marks/Rect.svelte.d.ts +86 -13
- package/dist/marks/RectX.svelte +10 -9
- package/dist/marks/RectX.svelte.d.ts +22 -6
- package/dist/marks/RectY.svelte +9 -10
- package/dist/marks/RectY.svelte.d.ts +22 -6
- package/dist/marks/RegressionX.svelte +1 -1
- package/dist/marks/RegressionX.svelte.d.ts +1 -1
- package/dist/marks/RegressionY.svelte +1 -1
- package/dist/marks/RegressionY.svelte.d.ts +1 -1
- package/dist/marks/RuleX.svelte +14 -16
- package/dist/marks/RuleX.svelte.d.ts +84 -12
- package/dist/marks/RuleY.svelte +12 -15
- package/dist/marks/RuleY.svelte.d.ts +84 -12
- package/dist/marks/Sphere.svelte +6 -7
- package/dist/marks/Sphere.svelte.d.ts +3 -2
- package/dist/marks/Spike.svelte +17 -9
- package/dist/marks/Spike.svelte.d.ts +94 -4
- package/dist/marks/SymbolLegend.svelte +1 -1
- package/dist/marks/Text.svelte +36 -125
- package/dist/marks/Text.svelte.d.ts +101 -20
- package/dist/marks/TickX.svelte +12 -13
- package/dist/marks/TickX.svelte.d.ts +92 -20
- package/dist/marks/TickY.svelte +11 -14
- package/dist/marks/TickY.svelte.d.ts +92 -20
- package/dist/marks/Vector.svelte +19 -23
- package/dist/marks/Vector.svelte.d.ts +93 -21
- package/dist/marks/helpers/AreaCanvas.svelte +1 -1
- package/dist/marks/helpers/AreaCanvas.svelte.d.ts +1 -1
- package/dist/marks/helpers/BaseAxisX.svelte +1 -2
- package/dist/marks/helpers/BaseAxisX.svelte.d.ts +1 -1
- package/dist/marks/helpers/BaseAxisY.svelte +2 -3
- package/dist/marks/helpers/BaseAxisY.svelte.d.ts +1 -1
- package/dist/marks/helpers/CanvasLayer.svelte +1 -1
- package/dist/marks/helpers/DotCanvas.svelte +1 -1
- package/dist/marks/helpers/DotCanvas.svelte.d.ts +1 -1
- package/dist/marks/helpers/GeoCanvas.svelte +1 -1
- package/dist/marks/helpers/GeoCanvas.svelte.d.ts +1 -1
- package/dist/marks/helpers/LineCanvas.svelte +1 -1
- package/dist/marks/helpers/LineCanvas.svelte.d.ts +1 -1
- package/dist/marks/helpers/LinearGradientX.svelte +1 -1
- package/dist/marks/helpers/LinearGradientX.svelte.d.ts +1 -1
- package/dist/marks/helpers/LinearGradientY.svelte +1 -1
- package/dist/marks/helpers/LinearGradientY.svelte.d.ts +1 -1
- package/dist/marks/helpers/MarkerPath.svelte +1 -1
- package/dist/marks/helpers/MarkerPath.svelte.d.ts +1 -41
- package/dist/marks/helpers/MultilineText.svelte +158 -0
- package/dist/marks/helpers/MultilineText.svelte.d.ts +12 -0
- package/dist/marks/helpers/RectPath.svelte +29 -26
- package/dist/marks/helpers/RectPath.svelte.d.ts +39 -26
- package/dist/marks/helpers/Regression.svelte +7 -2
- package/dist/marks/helpers/Regression.svelte.d.ts +2 -5
- package/dist/transforms/bollinger.d.ts +1 -66
- package/dist/transforms/centroid.d.ts +7 -65
- package/dist/transforms/centroid.js +10 -7
- package/dist/transforms/group.d.ts +4 -12
- package/dist/transforms/interval.d.ts +2 -122
- package/dist/transforms/map.d.ts +4 -184
- package/dist/transforms/normalize.d.ts +3 -123
- package/dist/transforms/select.d.ts +7 -427
- package/dist/transforms/sort.d.ts +3 -242
- package/dist/transforms/window.d.ts +2 -130
- package/dist/types/channel.d.ts +11 -0
- package/dist/types/channel.js +1 -0
- package/dist/types/colorScheme.d.ts +1 -0
- package/dist/types/colorScheme.js +1 -0
- package/dist/types/data.d.ts +13 -0
- package/dist/types/data.js +1 -0
- package/dist/types/facet.d.ts +50 -0
- package/dist/types/facet.js +1 -0
- package/dist/types/index.d.ts +58 -0
- package/dist/types/index.js +7 -0
- package/dist/types/mark.d.ts +123 -0
- package/dist/types/mark.js +1 -0
- package/dist/types/plot.d.ts +459 -0
- package/dist/types/plot.js +1 -0
- package/dist/types/scale.d.ts +143 -0
- package/dist/types/scale.js +1 -0
- package/dist/types.d.ts +120 -127
- package/package.json +125 -120
package/dist/marks/Geo.svelte
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
<!-- @component
|
|
2
2
|
Renders geographical data using projections and GeoJSON geometries
|
|
3
3
|
-->
|
|
4
|
-
<script
|
|
5
|
-
|
|
6
|
-
data:
|
|
4
|
+
<script lang="ts" generics="Datum = DataRecord | GeoJSON.GeoJsonObject">
|
|
5
|
+
interface GeoMarkProps extends BaseMarkProps<Datum>, LinkableMarkProps<Datum> {
|
|
6
|
+
data?: Datum[] | { type: 'Sphere' }[];
|
|
7
7
|
geoType?: 'sphere' | 'graticule';
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
/**
|
|
9
|
+
* todo: implement?
|
|
10
|
+
*/
|
|
11
|
+
dragRotate?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* toggle canvas rendering mode
|
|
14
|
+
*/
|
|
15
|
+
canvas?: boolean;
|
|
10
16
|
/**
|
|
11
17
|
* simple browser tooltip to be displayed on mouseover
|
|
12
18
|
*/
|
|
13
|
-
title
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
title?: ConstantAccessor<string, Datum>;
|
|
20
|
+
/**
|
|
21
|
+
* radius for point features
|
|
22
|
+
*/
|
|
23
|
+
r?: ChannelAccessor<Datum>;
|
|
24
|
+
}
|
|
19
25
|
import { getContext } from 'svelte';
|
|
20
26
|
import type {
|
|
21
27
|
DataRecord,
|
|
@@ -23,13 +29,14 @@
|
|
|
23
29
|
BaseMarkProps,
|
|
24
30
|
ConstantAccessor,
|
|
25
31
|
LinkableMarkProps,
|
|
26
|
-
PlotDefaults
|
|
27
|
-
|
|
32
|
+
PlotDefaults,
|
|
33
|
+
ChannelAccessor
|
|
34
|
+
} from '../types/index.js';
|
|
28
35
|
import Mark from '../Mark.svelte';
|
|
29
36
|
import { geoPath } from 'd3-geo';
|
|
30
37
|
import { resolveChannel, resolveProp, resolveStyles } from '../helpers/resolve.js';
|
|
31
38
|
import callWithProps from '../helpers/callWithProps.js';
|
|
32
|
-
import { sort } from '../
|
|
39
|
+
import { sort } from '../transforms';
|
|
33
40
|
import { addEventHandlers } from './helpers/events.js';
|
|
34
41
|
import GeoCanvas from './helpers/GeoCanvas.svelte';
|
|
35
42
|
import { recordize } from '../transforms/recordize.js';
|
|
@@ -46,7 +53,7 @@
|
|
|
46
53
|
};
|
|
47
54
|
|
|
48
55
|
const {
|
|
49
|
-
data = [{}],
|
|
56
|
+
data = [{} as Datum],
|
|
50
57
|
canvas = false,
|
|
51
58
|
geoType,
|
|
52
59
|
dragRotate,
|
|
@@ -1,15 +1,99 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import type { DataRecord, ConstantAccessor, LinkableMarkProps, ChannelAccessor } from '../types/index.js';
|
|
2
|
+
declare class __sveltets_Render<Datum = DataRecord | GeoJSON.GeoJsonObject> {
|
|
3
|
+
props(): Partial<{
|
|
4
|
+
filter?: ConstantAccessor<boolean, Datum>;
|
|
5
|
+
facet?: "auto" | "include" | "exclude";
|
|
6
|
+
fx: ChannelAccessor<Datum>;
|
|
7
|
+
fy: ChannelAccessor<Datum>;
|
|
8
|
+
dx: ConstantAccessor<number, Datum>;
|
|
9
|
+
dy: ConstantAccessor<number, Datum>;
|
|
10
|
+
fill: ChannelAccessor<Datum>;
|
|
11
|
+
fillOpacity: ConstantAccessor<number, Datum>;
|
|
12
|
+
sort: {
|
|
13
|
+
channel: string;
|
|
14
|
+
order?: "ascending" | "descending";
|
|
15
|
+
} | ((a: import("../types/data.js").RawValue, b: import("../types/data.js").RawValue) => number) | ConstantAccessor<import("../types/data.js").RawValue, Datum>;
|
|
16
|
+
stroke: ChannelAccessor<Datum>;
|
|
17
|
+
strokeWidth: ConstantAccessor<number, Datum>;
|
|
18
|
+
strokeOpacity: ConstantAccessor<number, Datum>;
|
|
19
|
+
strokeLinejoin: ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
|
|
20
|
+
strokeLinecap: ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
|
|
21
|
+
strokeMiterlimit: ConstantAccessor<number, Datum>;
|
|
22
|
+
opacity: ChannelAccessor<Datum>;
|
|
23
|
+
strokeDasharray: ConstantAccessor<string, Datum>;
|
|
24
|
+
strokeDashoffset: ConstantAccessor<number, Datum>;
|
|
25
|
+
mixBlendMode: ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
|
|
26
|
+
clipPath: string;
|
|
27
|
+
imageFilter: ConstantAccessor<string, Datum>;
|
|
28
|
+
shapeRendering: ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
|
|
29
|
+
paintOrder: ConstantAccessor<string, Datum>;
|
|
30
|
+
onclick?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
31
|
+
ondblclick?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
32
|
+
onmouseup?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
33
|
+
onmousedown?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
34
|
+
onmouseenter?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
35
|
+
onmousemove?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
36
|
+
onmouseleave?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
37
|
+
onmouseout?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
38
|
+
onmouseover?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
39
|
+
onpointercancel?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
40
|
+
onpointerdown?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
41
|
+
onpointerup?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
42
|
+
onpointerenter?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
43
|
+
onpointerleave?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
44
|
+
onpointermove?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
45
|
+
onpointerover?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
46
|
+
onpointerout?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
47
|
+
ondrag?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
48
|
+
ondrop?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
49
|
+
ondragstart?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
50
|
+
ondragenter?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
51
|
+
ondragleave?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
52
|
+
ondragover?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
53
|
+
ondragend?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
54
|
+
ontouchstart?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
55
|
+
ontouchmove?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
56
|
+
ontouchend?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
57
|
+
ontouchcancel?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
58
|
+
oncontextmenu?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
59
|
+
onwheel?: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
60
|
+
class: string | null;
|
|
61
|
+
cursor: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
62
|
+
}> & LinkableMarkProps<Datum> & {
|
|
63
|
+
data?: Datum[] | {
|
|
64
|
+
type: "Sphere";
|
|
65
|
+
}[] | undefined;
|
|
66
|
+
geoType?: "sphere" | "graticule";
|
|
67
|
+
/**
|
|
68
|
+
* todo: implement?
|
|
69
|
+
*/
|
|
70
|
+
dragRotate?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* toggle canvas rendering mode
|
|
73
|
+
*/
|
|
74
|
+
canvas?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* simple browser tooltip to be displayed on mouseover
|
|
77
|
+
*/
|
|
78
|
+
title?: ConstantAccessor<string, Datum>;
|
|
79
|
+
/**
|
|
80
|
+
* radius for point features
|
|
81
|
+
*/
|
|
82
|
+
r?: ChannelAccessor<Datum>;
|
|
83
|
+
};
|
|
84
|
+
events(): {};
|
|
85
|
+
slots(): {};
|
|
86
|
+
bindings(): "";
|
|
87
|
+
exports(): {};
|
|
88
|
+
}
|
|
89
|
+
interface $$IsomorphicComponent {
|
|
90
|
+
new <Datum = DataRecord | GeoJSON.GeoJsonObject>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Datum>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Datum>['props']>, ReturnType<__sveltets_Render<Datum>['events']>, ReturnType<__sveltets_Render<Datum>['slots']>> & {
|
|
91
|
+
$$bindings?: ReturnType<__sveltets_Render<Datum>['bindings']>;
|
|
92
|
+
} & ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
93
|
+
<Datum = DataRecord | GeoJSON.GeoJsonObject>(internal: unknown, props: ReturnType<__sveltets_Render<Datum>['props']> & {}): ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
94
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
95
|
+
}
|
|
12
96
|
/** Renders geographical data using projections and GeoJSON geometries */
|
|
13
|
-
declare const Geo:
|
|
14
|
-
type Geo =
|
|
97
|
+
declare const Geo: $$IsomorphicComponent;
|
|
98
|
+
type Geo<Datum = DataRecord | GeoJSON.GeoJsonObject> = InstanceType<typeof Geo<Datum>>;
|
|
15
99
|
export default Geo;
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
<!-- @component
|
|
2
2
|
Renders a geographic graticule grid with customizable step sizes
|
|
3
3
|
-->
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
interface GraticuleMarkProps
|
|
7
|
+
extends Omit<
|
|
8
|
+
BaseMarkProps<GeoJSON.GeoJsonObject>,
|
|
9
|
+
'fill' | 'fillOpacity' | 'paintOrder' | 'title' | 'href' | 'target' | 'cursor'
|
|
10
|
+
> {
|
|
10
11
|
step?: number;
|
|
11
12
|
stepX?: number;
|
|
12
13
|
stepY?: number;
|
|
13
|
-
}
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<script lang="ts">
|
|
14
|
+
}
|
|
17
15
|
import Geo from './Geo.svelte';
|
|
18
16
|
import { geoGraticule } from 'd3-geo';
|
|
19
17
|
import { getContext } from 'svelte';
|
|
20
|
-
import type { PlotDefaults } from '../types.js';
|
|
18
|
+
import type { BaseMarkProps, PlotDefaults } from '../types/index.js';
|
|
21
19
|
|
|
22
20
|
let markProps: GraticuleMarkProps = $props();
|
|
23
21
|
|
|
@@ -26,20 +24,19 @@
|
|
|
26
24
|
...getContext<PlotDefaults>('svelteplot/_defaults').graticule
|
|
27
25
|
};
|
|
28
26
|
|
|
29
|
-
const {
|
|
30
|
-
data = [{}],
|
|
31
|
-
class: className = '',
|
|
32
|
-
...options
|
|
33
|
-
}: GraticuleMarkProps = $derived({
|
|
27
|
+
const { class: className = '', ...options }: GraticuleMarkProps = $derived({
|
|
34
28
|
...DEFAULTS,
|
|
35
29
|
...markProps
|
|
36
30
|
});
|
|
37
31
|
|
|
38
|
-
|
|
32
|
+
const graticule = $derived.by(() => {
|
|
39
33
|
const graticule = geoGraticule();
|
|
40
|
-
graticule.stepMinor([
|
|
34
|
+
graticule.stepMinor([
|
|
35
|
+
options.stepX ?? options.step ?? DEFAULTS.step,
|
|
36
|
+
options.stepY ?? options.step ?? DEFAULTS.step
|
|
37
|
+
]);
|
|
41
38
|
return graticule;
|
|
42
39
|
});
|
|
43
40
|
</script>
|
|
44
41
|
|
|
45
|
-
<Geo data={[graticule()]} {...options} geoType="graticule"
|
|
42
|
+
<Geo data={[graticule()]} {...options} geoType="graticule" />
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { BaseMarkProps } from '../types.js';
|
|
2
|
-
|
|
1
|
+
import type { BaseMarkProps } from '../types/index.js';
|
|
2
|
+
interface GraticuleMarkProps extends Omit<BaseMarkProps<GeoJSON.GeoJsonObject>, 'fill' | 'fillOpacity' | 'paintOrder' | 'title' | 'href' | 'target' | 'cursor'> {
|
|
3
3
|
step?: number;
|
|
4
4
|
stepX?: number;
|
|
5
5
|
stepY?: number;
|
|
6
|
-
}
|
|
6
|
+
}
|
|
7
7
|
/** Renders a geographic graticule grid with customizable step sizes */
|
|
8
8
|
declare const Graticule: import("svelte").Component<GraticuleMarkProps, {}, "">;
|
|
9
9
|
type Graticule = ReturnType<typeof Graticule>;
|
package/dist/marks/GridX.svelte
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
<!-- @component
|
|
2
2
|
Renders vertical gridlines at x-axis tick positions
|
|
3
3
|
-->
|
|
4
|
-
<script
|
|
5
|
-
|
|
6
|
-
data?:
|
|
4
|
+
<script lang="ts" generics="Datum = RawValue">
|
|
5
|
+
interface GridXMarkProps extends Omit<BaseMarkProps<Datum>, 'fill' | 'fillOpacity'> {
|
|
6
|
+
data?: Datum[];
|
|
7
7
|
automatic?: boolean;
|
|
8
|
-
}
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<script lang="ts">
|
|
8
|
+
}
|
|
12
9
|
import { getContext } from 'svelte';
|
|
13
10
|
import Mark from '../Mark.svelte';
|
|
14
|
-
import type { PlotContext, BaseMarkProps, RawValue, PlotDefaults } from '../types.js';
|
|
11
|
+
import type { PlotContext, BaseMarkProps, RawValue, PlotDefaults } from '../types/index.js';
|
|
15
12
|
import { resolveChannel, resolveStyles } from '../helpers/resolve.js';
|
|
16
13
|
import { autoTicks } from '../helpers/autoTicks.js';
|
|
17
14
|
import { testFilter } from '../helpers/index.js';
|
|
@@ -1,9 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { RawValue } from '../types/index.js';
|
|
2
|
+
declare class __sveltets_Render<Datum = RawValue> {
|
|
3
|
+
props(): Omit<Partial<{
|
|
4
|
+
filter?: import("../types/index.js").ConstantAccessor<boolean, Datum>;
|
|
5
|
+
facet?: "auto" | "include" | "exclude";
|
|
6
|
+
fx: import("../types/channel").ChannelAccessor<Datum>;
|
|
7
|
+
fy: import("../types/channel").ChannelAccessor<Datum>;
|
|
8
|
+
dx: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
9
|
+
dy: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
10
|
+
fill: import("../types/channel").ChannelAccessor<Datum>;
|
|
11
|
+
fillOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
12
|
+
sort: {
|
|
13
|
+
channel: string;
|
|
14
|
+
order?: "ascending" | "descending";
|
|
15
|
+
} | ((a: RawValue, b: RawValue) => number) | import("../types/index.js").ConstantAccessor<RawValue, Datum>;
|
|
16
|
+
stroke: import("../types/channel").ChannelAccessor<Datum>;
|
|
17
|
+
strokeWidth: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
18
|
+
strokeOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
19
|
+
strokeLinejoin: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
|
|
20
|
+
strokeLinecap: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
|
|
21
|
+
strokeMiterlimit: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
22
|
+
opacity: import("../types/channel").ChannelAccessor<Datum>;
|
|
23
|
+
strokeDasharray: import("../types/index.js").ConstantAccessor<string, Datum>;
|
|
24
|
+
strokeDashoffset: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
25
|
+
mixBlendMode: import("../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
|
|
26
|
+
clipPath: string;
|
|
27
|
+
imageFilter: import("../types/index.js").ConstantAccessor<string, Datum>;
|
|
28
|
+
shapeRendering: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
|
|
29
|
+
paintOrder: import("../types/index.js").ConstantAccessor<string, Datum>;
|
|
30
|
+
onclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
31
|
+
ondblclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
32
|
+
onmouseup?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
33
|
+
onmousedown?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
34
|
+
onmouseenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
35
|
+
onmousemove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
36
|
+
onmouseleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
37
|
+
onmouseout?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
38
|
+
onmouseover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
39
|
+
onpointercancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
40
|
+
onpointerdown?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
41
|
+
onpointerup?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
42
|
+
onpointerenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
43
|
+
onpointerleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
44
|
+
onpointermove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
45
|
+
onpointerover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
46
|
+
onpointerout?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
47
|
+
ondrag?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
48
|
+
ondrop?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
49
|
+
ondragstart?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
50
|
+
ondragenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
51
|
+
ondragleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
52
|
+
ondragover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
53
|
+
ondragend?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
54
|
+
ontouchstart?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
55
|
+
ontouchmove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
56
|
+
ontouchend?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
57
|
+
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
58
|
+
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
59
|
+
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
60
|
+
class: string | null;
|
|
61
|
+
cursor: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
62
|
+
}>, "fill" | "fillOpacity"> & {
|
|
63
|
+
data?: Datum[] | undefined;
|
|
64
|
+
automatic?: boolean;
|
|
65
|
+
};
|
|
66
|
+
events(): {};
|
|
67
|
+
slots(): {};
|
|
68
|
+
bindings(): "";
|
|
69
|
+
exports(): {};
|
|
70
|
+
}
|
|
71
|
+
interface $$IsomorphicComponent {
|
|
72
|
+
new <Datum = RawValue>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Datum>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Datum>['props']>, ReturnType<__sveltets_Render<Datum>['events']>, ReturnType<__sveltets_Render<Datum>['slots']>> & {
|
|
73
|
+
$$bindings?: ReturnType<__sveltets_Render<Datum>['bindings']>;
|
|
74
|
+
} & ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
75
|
+
<Datum = RawValue>(internal: unknown, props: ReturnType<__sveltets_Render<Datum>['props']> & {}): ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
76
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
77
|
+
}
|
|
6
78
|
/** Renders vertical gridlines at x-axis tick positions */
|
|
7
|
-
declare const GridX:
|
|
8
|
-
type GridX =
|
|
79
|
+
declare const GridX: $$IsomorphicComponent;
|
|
80
|
+
type GridX<Datum = RawValue> = InstanceType<typeof GridX<Datum>>;
|
|
9
81
|
export default GridX;
|
package/dist/marks/GridY.svelte
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
<!-- @component
|
|
2
2
|
Renders horizontal gridlines at y-axis tick positions
|
|
3
3
|
-->
|
|
4
|
-
<script
|
|
5
|
-
|
|
6
|
-
data?:
|
|
4
|
+
<script lang="ts" generics="Datum = RawValue">
|
|
5
|
+
interface GridYMarkProps extends Omit<BaseMarkProps<Datum>, 'fill' | 'fillOpacity'> {
|
|
6
|
+
data?: Datum[];
|
|
7
7
|
automatic?: boolean;
|
|
8
|
-
}
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<script lang="ts">
|
|
8
|
+
}
|
|
12
9
|
import { getContext } from 'svelte';
|
|
13
10
|
import Mark from '../Mark.svelte';
|
|
14
|
-
import type { PlotContext, BaseMarkProps, RawValue, PlotDefaults } from '../types.js';
|
|
11
|
+
import type { PlotContext, BaseMarkProps, RawValue, PlotDefaults } from '../types/index.js';
|
|
15
12
|
import { resolveChannel, resolveStyles } from '../helpers/resolve.js';
|
|
16
13
|
import { autoTicks } from '../helpers/autoTicks.js';
|
|
17
14
|
import { testFilter } from '../helpers/index.js';
|
|
@@ -1,9 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { RawValue } from '../types/index.js';
|
|
2
|
+
declare class __sveltets_Render<Datum = RawValue> {
|
|
3
|
+
props(): Omit<Partial<{
|
|
4
|
+
filter?: import("../types/index.js").ConstantAccessor<boolean, Datum>;
|
|
5
|
+
facet?: "auto" | "include" | "exclude";
|
|
6
|
+
fx: import("../types/channel").ChannelAccessor<Datum>;
|
|
7
|
+
fy: import("../types/channel").ChannelAccessor<Datum>;
|
|
8
|
+
dx: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
9
|
+
dy: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
10
|
+
fill: import("../types/channel").ChannelAccessor<Datum>;
|
|
11
|
+
fillOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
12
|
+
sort: {
|
|
13
|
+
channel: string;
|
|
14
|
+
order?: "ascending" | "descending";
|
|
15
|
+
} | ((a: RawValue, b: RawValue) => number) | import("../types/index.js").ConstantAccessor<RawValue, Datum>;
|
|
16
|
+
stroke: import("../types/channel").ChannelAccessor<Datum>;
|
|
17
|
+
strokeWidth: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
18
|
+
strokeOpacity: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
19
|
+
strokeLinejoin: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
|
|
20
|
+
strokeLinecap: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
|
|
21
|
+
strokeMiterlimit: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
22
|
+
opacity: import("../types/channel").ChannelAccessor<Datum>;
|
|
23
|
+
strokeDasharray: import("../types/index.js").ConstantAccessor<string, Datum>;
|
|
24
|
+
strokeDashoffset: import("../types/index.js").ConstantAccessor<number, Datum>;
|
|
25
|
+
mixBlendMode: import("../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
|
|
26
|
+
clipPath: string;
|
|
27
|
+
imageFilter: import("../types/index.js").ConstantAccessor<string, Datum>;
|
|
28
|
+
shapeRendering: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
|
|
29
|
+
paintOrder: import("../types/index.js").ConstantAccessor<string, Datum>;
|
|
30
|
+
onclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
31
|
+
ondblclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
32
|
+
onmouseup?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
33
|
+
onmousedown?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
34
|
+
onmouseenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
35
|
+
onmousemove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
36
|
+
onmouseleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
37
|
+
onmouseout?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
38
|
+
onmouseover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
39
|
+
onpointercancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
40
|
+
onpointerdown?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
41
|
+
onpointerup?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
42
|
+
onpointerenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
43
|
+
onpointerleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
44
|
+
onpointermove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
45
|
+
onpointerover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
46
|
+
onpointerout?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
47
|
+
ondrag?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
48
|
+
ondrop?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
49
|
+
ondragstart?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
50
|
+
ondragenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
51
|
+
ondragleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
52
|
+
ondragover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
53
|
+
ondragend?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
54
|
+
ontouchstart?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
55
|
+
ontouchmove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
56
|
+
ontouchend?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
57
|
+
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
58
|
+
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
59
|
+
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
60
|
+
class: string | null;
|
|
61
|
+
cursor: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
62
|
+
}>, "fill" | "fillOpacity"> & {
|
|
63
|
+
data?: Datum[] | undefined;
|
|
64
|
+
automatic?: boolean;
|
|
65
|
+
};
|
|
66
|
+
events(): {};
|
|
67
|
+
slots(): {};
|
|
68
|
+
bindings(): "";
|
|
69
|
+
exports(): {};
|
|
70
|
+
}
|
|
71
|
+
interface $$IsomorphicComponent {
|
|
72
|
+
new <Datum = RawValue>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Datum>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Datum>['props']>, ReturnType<__sveltets_Render<Datum>['events']>, ReturnType<__sveltets_Render<Datum>['slots']>> & {
|
|
73
|
+
$$bindings?: ReturnType<__sveltets_Render<Datum>['bindings']>;
|
|
74
|
+
} & ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
75
|
+
<Datum = RawValue>(internal: unknown, props: ReturnType<__sveltets_Render<Datum>['props']> & {}): ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
76
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
77
|
+
}
|
|
6
78
|
/** Renders horizontal gridlines at y-axis tick positions */
|
|
7
|
-
declare const GridY:
|
|
8
|
-
type GridY =
|
|
79
|
+
declare const GridY: $$IsomorphicComponent;
|
|
80
|
+
type GridY<Datum = RawValue> = InstanceType<typeof GridY<Datum>>;
|
|
9
81
|
export default GridY;
|
|
@@ -2,21 +2,16 @@
|
|
|
2
2
|
@component
|
|
3
3
|
For showing custom HTML tooltips positioned at x/y coordinates
|
|
4
4
|
-->
|
|
5
|
-
<script
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
children: Snippet<[{ datum: DataRow }]>;
|
|
14
|
-
};
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<script lang="ts">
|
|
5
|
+
<script lang="ts" generics="Datum = DataRow">
|
|
6
|
+
interface HTMLTooltipMarkProps {
|
|
7
|
+
data: Datum[];
|
|
8
|
+
x?: ChannelAccessor<Datum>;
|
|
9
|
+
y?: ChannelAccessor<Datum>;
|
|
10
|
+
r?: ChannelAccessor<Datum>;
|
|
11
|
+
children: Snippet<[{ datum: Datum }]>;
|
|
12
|
+
}
|
|
18
13
|
import { getContext, type Snippet } from 'svelte';
|
|
19
|
-
import type { PlotContext } from '../types.js';
|
|
14
|
+
import type { ChannelAccessor, DataRow, PlotContext } from '../types/index.js';
|
|
20
15
|
|
|
21
16
|
const { getPlotState } = getContext<PlotContext>('svelteplot');
|
|
22
17
|
let plot = $derived(getPlotState());
|
|
@@ -1,15 +1,28 @@
|
|
|
1
|
-
import type { ChannelAccessor, DataRow } from '../types.js';
|
|
2
|
-
export type HTMLTooltipMarkProps = {
|
|
3
|
-
data: DataRow[];
|
|
4
|
-
x?: ChannelAccessor;
|
|
5
|
-
y?: ChannelAccessor;
|
|
6
|
-
r?: ChannelAccessor;
|
|
7
|
-
children: Snippet<[{
|
|
8
|
-
datum: DataRow;
|
|
9
|
-
}]>;
|
|
10
|
-
};
|
|
11
1
|
import { type Snippet } from 'svelte';
|
|
2
|
+
import type { ChannelAccessor, DataRow } from '../types/index.js';
|
|
3
|
+
declare class __sveltets_Render<Datum = DataRow> {
|
|
4
|
+
props(): {
|
|
5
|
+
data: Datum[];
|
|
6
|
+
x?: ChannelAccessor<Datum>;
|
|
7
|
+
y?: ChannelAccessor<Datum>;
|
|
8
|
+
r?: ChannelAccessor<Datum>;
|
|
9
|
+
children: Snippet<[{
|
|
10
|
+
datum: Datum;
|
|
11
|
+
}]>;
|
|
12
|
+
};
|
|
13
|
+
events(): {};
|
|
14
|
+
slots(): {};
|
|
15
|
+
bindings(): "";
|
|
16
|
+
exports(): {};
|
|
17
|
+
}
|
|
18
|
+
interface $$IsomorphicComponent {
|
|
19
|
+
new <Datum = DataRow>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Datum>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Datum>['props']>, ReturnType<__sveltets_Render<Datum>['events']>, ReturnType<__sveltets_Render<Datum>['slots']>> & {
|
|
20
|
+
$$bindings?: ReturnType<__sveltets_Render<Datum>['bindings']>;
|
|
21
|
+
} & ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
22
|
+
<Datum = DataRow>(internal: unknown, props: ReturnType<__sveltets_Render<Datum>['props']> & {}): ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
23
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
24
|
+
}
|
|
12
25
|
/** For showing custom HTML tooltips positioned at x/y coordinates */
|
|
13
|
-
declare const HtmlTooltip:
|
|
14
|
-
type HtmlTooltip =
|
|
26
|
+
declare const HtmlTooltip: $$IsomorphicComponent;
|
|
27
|
+
type HtmlTooltip<Datum = DataRow> = InstanceType<typeof HtmlTooltip<Datum>>;
|
|
15
28
|
export default HtmlTooltip;
|
package/dist/marks/Line.svelte
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
<!-- @component
|
|
2
2
|
Creates line charts with connecting points in a dataset with customizable curves and markers
|
|
3
3
|
-->
|
|
4
|
-
<script
|
|
4
|
+
<script lang="ts" generics="Datum extends DataRecord">
|
|
5
|
+
interface LineMarkProps extends MarkerOptions, BaseMarkProps<Datum> {
|
|
6
|
+
data?: Datum[];
|
|
7
|
+
x?: ChannelAccessor<Datum>;
|
|
8
|
+
y?: ChannelAccessor<Datum>;
|
|
9
|
+
z?: ChannelAccessor<Datum>;
|
|
10
|
+
outlineStroke?: string;
|
|
11
|
+
outlineStrokeWidth?: number;
|
|
12
|
+
outlineStrokeOpacity?: number;
|
|
13
|
+
curve?: CurveName | CurveFactory | 'auto';
|
|
14
|
+
tension?: number;
|
|
15
|
+
sort?: ConstantAccessor<RawValue, Datum> | { channel: 'stroke' | 'fill' };
|
|
16
|
+
text?: ConstantAccessor<string, Datum>;
|
|
17
|
+
textFill?: ConstantAccessor<string, Datum>;
|
|
18
|
+
textStroke?: ConstantAccessor<string, Datum>;
|
|
19
|
+
textStartOffset?: ConstantAccessor<string, Datum>;
|
|
20
|
+
textStrokeWidth?: ConstantAccessor<number, Datum>;
|
|
21
|
+
lineClass?: ConstantAccessor<string, Datum>;
|
|
22
|
+
canvas?: boolean;
|
|
23
|
+
}
|
|
5
24
|
import type {
|
|
6
25
|
CurveName,
|
|
7
26
|
PlotContext,
|
|
@@ -11,31 +30,7 @@
|
|
|
11
30
|
ChannelAccessor,
|
|
12
31
|
MarkerOptions,
|
|
13
32
|
ScaledDataRecord
|
|
14
|
-
} from '../types.js';
|
|
15
|
-
|
|
16
|
-
export type LineMarkProps = {
|
|
17
|
-
data: DataRecord[];
|
|
18
|
-
x?: ChannelAccessor;
|
|
19
|
-
y?: ChannelAccessor;
|
|
20
|
-
z?: ChannelAccessor;
|
|
21
|
-
outlineStroke?: string;
|
|
22
|
-
outlineStrokeWidth?: number;
|
|
23
|
-
outlineStrokeOpacity?: number;
|
|
24
|
-
curve?: CurveName | CurveFactory | 'auto';
|
|
25
|
-
tension?: number;
|
|
26
|
-
sort?: ConstantAccessor<RawValue> | { channel: 'stroke' | 'fill' };
|
|
27
|
-
text?: ConstantAccessor<string>;
|
|
28
|
-
textFill?: ConstantAccessor<string>;
|
|
29
|
-
textStroke?: ConstantAccessor<string>;
|
|
30
|
-
textStartOffset?: ConstantAccessor<string>;
|
|
31
|
-
textStrokeWidth?: ConstantAccessor<number>;
|
|
32
|
-
lineClass?: ConstantAccessor<string>;
|
|
33
|
-
canvas?: boolean;
|
|
34
|
-
} & MarkerOptions &
|
|
35
|
-
BaseMarkProps;
|
|
36
|
-
</script>
|
|
37
|
-
|
|
38
|
-
<script lang="ts">
|
|
33
|
+
} from '../types/index.js';
|
|
39
34
|
import Mark from '../Mark.svelte';
|
|
40
35
|
import MarkerPath from './helpers/MarkerPath.svelte';
|
|
41
36
|
import { getContext } from 'svelte';
|
|
@@ -47,7 +42,7 @@
|
|
|
47
42
|
import { pick } from 'es-toolkit';
|
|
48
43
|
import LineCanvas from './helpers/LineCanvas.svelte';
|
|
49
44
|
|
|
50
|
-
import type { RawValue, PlotDefaults } from '../types.js';
|
|
45
|
+
import type { RawValue, PlotDefaults } from '../types/index.js';
|
|
51
46
|
import { isValid } from '../helpers/index.js';
|
|
52
47
|
import { sort } from '../transforms/sort.js';
|
|
53
48
|
import { recordizeXY } from '../transforms/recordize.js';
|
|
@@ -61,11 +56,11 @@
|
|
|
61
56
|
canvas: false,
|
|
62
57
|
class: null,
|
|
63
58
|
lineClass: null,
|
|
64
|
-
...getContext<PlotDefaults
|
|
59
|
+
...getContext<Partial<PlotDefaults>>('svelteplot/_defaults').line
|
|
65
60
|
};
|
|
66
61
|
|
|
67
62
|
const {
|
|
68
|
-
data = [{}],
|
|
63
|
+
data = [{} as Datum],
|
|
69
64
|
curve,
|
|
70
65
|
tension,
|
|
71
66
|
text,
|