svelteplot 0.3.4 → 0.3.5-pr-121.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/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/constants.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 +3 -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/autoScales.d.ts +1 -1
- package/dist/helpers/autoTicks.d.ts +1 -1
- package/dist/helpers/autoTicks.js +1 -1
- package/dist/helpers/callWithProps.d.ts +1 -1
- package/dist/helpers/colors.d.ts +2 -2
- package/dist/helpers/curves.d.ts +1 -1
- package/dist/helpers/facets.d.ts +1 -1
- package/dist/helpers/getBaseStyles.d.ts +2 -2
- package/dist/helpers/group.d.ts +1 -1
- package/dist/helpers/index.d.ts +3 -3
- package/dist/helpers/isDataRecord.d.ts +1 -1
- package/dist/helpers/isRawValue.d.ts +1 -1
- package/dist/helpers/projection.d.ts +1 -1
- package/dist/helpers/reduce.d.ts +1 -1
- package/dist/helpers/regressionLoess.d.ts +1 -1
- package/dist/helpers/resolve.d.ts +3 -3
- package/dist/helpers/scales.d.ts +2 -2
- package/dist/helpers/typeChecks.d.ts +5 -5
- 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 +60 -56
- package/dist/marks/AxisX.svelte.d.ts +98 -25
- package/dist/marks/AxisY.svelte +73 -54
- package/dist/marks/AxisY.svelte.d.ts +100 -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 +25 -23
- package/dist/marks/Text.svelte.d.ts +101 -25
- 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 +5 -3
- package/dist/marks/helpers/BaseAxisX.svelte.d.ts +1 -1
- package/dist/marks/helpers/BaseAxisY.svelte +10 -8
- package/dist/marks/helpers/BaseAxisY.svelte.d.ts +3 -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 +1 -1
- package/dist/marks/helpers/MultilineText.svelte.d.ts +1 -1
- 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/marks/helpers/events.d.ts +1 -1
- package/dist/transforms/bin.d.ts +2 -2
- package/dist/transforms/bollinger.d.ts +2 -67
- package/dist/transforms/centroid.d.ts +8 -66
- package/dist/transforms/centroid.js +10 -7
- package/dist/transforms/filter.d.ts +1 -1
- package/dist/transforms/group.d.ts +5 -13
- package/dist/transforms/interval.d.ts +3 -123
- package/dist/transforms/jitter.d.ts +1 -1
- package/dist/transforms/map.d.ts +4 -184
- package/dist/transforms/normalize.d.ts +3 -123
- package/dist/transforms/recordize.d.ts +1 -1
- package/dist/transforms/rename.d.ts +2 -2
- package/dist/transforms/select.d.ts +8 -428
- package/dist/transforms/shift.d.ts +1 -1
- package/dist/transforms/sort.d.ts +4 -243
- package/dist/transforms/stack.d.ts +1 -1
- package/dist/transforms/window.d.ts +3 -131
- package/dist/types/channel.d.ts +11 -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/package.json +125 -120
- package/dist/types.d.ts +0 -841
- /package/dist/{types.js → types/channel.js} +0 -0
package/dist/marks/Text.svelte
CHANGED
|
@@ -2,18 +2,23 @@
|
|
|
2
2
|
@component
|
|
3
3
|
Useful for adding SVG text labels to your plot.
|
|
4
4
|
-->
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
|
|
6
|
+
<script lang="ts" generics="Datum extends DataRecord">
|
|
7
|
+
interface TextMarkProps extends BaseMarkProps<Datum>, LinkableMarkProps<Datum> {
|
|
8
|
+
data: Datum[];
|
|
9
|
+
x: ChannelAccessor<Datum>;
|
|
10
|
+
y: ChannelAccessor<Datum>;
|
|
10
11
|
children?: Snippet;
|
|
11
|
-
text: ConstantAccessor<string>;
|
|
12
|
-
title?: ConstantAccessor<string>;
|
|
12
|
+
text: ConstantAccessor<string | null | false | undefined, Datum>;
|
|
13
|
+
title?: ConstantAccessor<string, Datum>;
|
|
14
|
+
/**
|
|
15
|
+
* the font size of the text
|
|
16
|
+
*/
|
|
17
|
+
fontSize?: ConstantAccessor<number, Datum>;
|
|
13
18
|
/**
|
|
14
19
|
* if you want to apply class names to individual text elements
|
|
15
20
|
*/
|
|
16
|
-
textClass?: ConstantAccessor<string>;
|
|
21
|
+
textClass?: ConstantAccessor<string, Datum>;
|
|
17
22
|
/**
|
|
18
23
|
* the line anchor for vertical position; top, bottom, or middle
|
|
19
24
|
*/
|
|
@@ -22,7 +27,7 @@
|
|
|
22
27
|
* line height as multiplier of font size
|
|
23
28
|
* @default 1.2
|
|
24
29
|
*/
|
|
25
|
-
lineHeight?: ConstantAccessor<number>;
|
|
30
|
+
lineHeight?: ConstantAccessor<number, Datum>;
|
|
26
31
|
frameAnchor?: ConstantAccessor<
|
|
27
32
|
| 'bottom'
|
|
28
33
|
| 'top'
|
|
@@ -31,12 +36,11 @@
|
|
|
31
36
|
| 'top-left'
|
|
32
37
|
| 'bottom-left'
|
|
33
38
|
| 'top-right'
|
|
34
|
-
| 'bottom-right'
|
|
39
|
+
| 'bottom-right',
|
|
40
|
+
Datum
|
|
35
41
|
>;
|
|
36
|
-
}
|
|
37
|
-
</script>
|
|
42
|
+
}
|
|
38
43
|
|
|
39
|
-
<script lang="ts">
|
|
40
44
|
import { getContext, type Snippet } from 'svelte';
|
|
41
45
|
import GroupMultiple from './helpers/GroupMultiple.svelte';
|
|
42
46
|
import type {
|
|
@@ -44,11 +48,15 @@
|
|
|
44
48
|
BaseMarkProps,
|
|
45
49
|
ConstantAccessor,
|
|
46
50
|
ChannelAccessor,
|
|
47
|
-
PlotDefaults
|
|
48
|
-
|
|
51
|
+
PlotDefaults,
|
|
52
|
+
TransformArg,
|
|
53
|
+
RawValue,
|
|
54
|
+
LinkableMarkProps
|
|
55
|
+
} from '../types/index.js';
|
|
49
56
|
import { resolveProp, resolveStyles } from '../helpers/resolve.js';
|
|
50
57
|
import Mark from '../Mark.svelte';
|
|
51
|
-
import { sort } from '
|
|
58
|
+
import { sort } from '..';
|
|
59
|
+
import Anchor from './helpers/Anchor.svelte';
|
|
52
60
|
|
|
53
61
|
import MultilineText from './helpers/MultilineText.svelte';
|
|
54
62
|
|
|
@@ -64,7 +72,7 @@
|
|
|
64
72
|
let markProps: TextMarkProps = $props();
|
|
65
73
|
|
|
66
74
|
const {
|
|
67
|
-
data = [{}],
|
|
75
|
+
data = [{} as Datum],
|
|
68
76
|
class: className = '',
|
|
69
77
|
...options
|
|
70
78
|
}: TextMarkProps = $derived({
|
|
@@ -107,9 +115,3 @@
|
|
|
107
115
|
</GroupMultiple>
|
|
108
116
|
{/snippet}
|
|
109
117
|
</Mark>
|
|
110
|
-
|
|
111
|
-
<style>
|
|
112
|
-
text {
|
|
113
|
-
paint-order: stroke fill;
|
|
114
|
-
}
|
|
115
|
-
</style>
|
|
@@ -1,28 +1,104 @@
|
|
|
1
|
-
export type TextMarkProps = BaseMarkProps & {
|
|
2
|
-
data: DataRecord[];
|
|
3
|
-
x: ChannelAccessor;
|
|
4
|
-
y: ChannelAccessor;
|
|
5
|
-
children?: Snippet;
|
|
6
|
-
text: ConstantAccessor<string>;
|
|
7
|
-
title?: ConstantAccessor<string>;
|
|
8
|
-
/**
|
|
9
|
-
* if you want to apply class names to individual text elements
|
|
10
|
-
*/
|
|
11
|
-
textClass?: ConstantAccessor<string>;
|
|
12
|
-
/**
|
|
13
|
-
* the line anchor for vertical position; top, bottom, or middle
|
|
14
|
-
*/
|
|
15
|
-
lineAnchor?: ConstantAccessor<'bottom' | 'top' | 'middle'>;
|
|
16
|
-
/**
|
|
17
|
-
* line height as multiplier of font size
|
|
18
|
-
* @default 1.2
|
|
19
|
-
*/
|
|
20
|
-
lineHeight?: ConstantAccessor<number>;
|
|
21
|
-
frameAnchor?: ConstantAccessor<'bottom' | 'top' | 'left' | 'right' | 'top-left' | 'bottom-left' | 'top-right' | 'bottom-right'>;
|
|
22
|
-
};
|
|
23
1
|
import { type Snippet } from 'svelte';
|
|
24
|
-
import type { DataRecord,
|
|
2
|
+
import type { DataRecord, ConstantAccessor, ChannelAccessor, RawValue, LinkableMarkProps } from '../types/index.js';
|
|
3
|
+
declare class __sveltets_Render<Datum extends DataRecord> {
|
|
4
|
+
props(): Partial<{
|
|
5
|
+
filter?: ConstantAccessor<boolean, Datum>;
|
|
6
|
+
facet?: "auto" | "include" | "exclude";
|
|
7
|
+
fx: ChannelAccessor<Datum>;
|
|
8
|
+
fy: ChannelAccessor<Datum>;
|
|
9
|
+
dx: ConstantAccessor<number, Datum>;
|
|
10
|
+
dy: ConstantAccessor<number, Datum>;
|
|
11
|
+
fill: ChannelAccessor<Datum>;
|
|
12
|
+
fillOpacity: ConstantAccessor<number, Datum>;
|
|
13
|
+
sort: {
|
|
14
|
+
channel: string;
|
|
15
|
+
order?: "ascending" | "descending";
|
|
16
|
+
} | ((a: RawValue, b: RawValue) => number) | ConstantAccessor<RawValue, Datum>;
|
|
17
|
+
stroke: ChannelAccessor<Datum>;
|
|
18
|
+
strokeWidth: ConstantAccessor<number, Datum>;
|
|
19
|
+
strokeOpacity: ConstantAccessor<number, Datum>;
|
|
20
|
+
strokeLinejoin: ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
|
|
21
|
+
strokeLinecap: ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
|
|
22
|
+
strokeMiterlimit: ConstantAccessor<number, Datum>;
|
|
23
|
+
opacity: ChannelAccessor<Datum>;
|
|
24
|
+
strokeDasharray: ConstantAccessor<string, Datum>;
|
|
25
|
+
strokeDashoffset: ConstantAccessor<number, Datum>;
|
|
26
|
+
mixBlendMode: ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
|
|
27
|
+
clipPath: string;
|
|
28
|
+
imageFilter: ConstantAccessor<string, Datum>;
|
|
29
|
+
shapeRendering: ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
|
|
30
|
+
paintOrder: ConstantAccessor<string, Datum>;
|
|
31
|
+
onclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
32
|
+
ondblclick?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
33
|
+
onmouseup?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
34
|
+
onmousedown?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
35
|
+
onmouseenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
36
|
+
onmousemove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
37
|
+
onmouseleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
38
|
+
onmouseout?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
39
|
+
onmouseover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
40
|
+
onpointercancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
41
|
+
onpointerdown?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
42
|
+
onpointerup?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
43
|
+
onpointerenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
44
|
+
onpointerleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
45
|
+
onpointermove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
46
|
+
onpointerover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
47
|
+
onpointerout?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
48
|
+
ondrag?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
49
|
+
ondrop?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
50
|
+
ondragstart?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
51
|
+
ondragenter?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
52
|
+
ondragleave?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
53
|
+
ondragover?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
54
|
+
ondragend?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
55
|
+
ontouchstart?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
56
|
+
ontouchmove?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
57
|
+
ontouchend?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
58
|
+
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
59
|
+
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
60
|
+
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement>;
|
|
61
|
+
class: string | null;
|
|
62
|
+
cursor: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
63
|
+
}> & LinkableMarkProps<Datum> & {
|
|
64
|
+
data: Datum[];
|
|
65
|
+
x: ChannelAccessor<Datum>;
|
|
66
|
+
y: ChannelAccessor<Datum>;
|
|
67
|
+
children?: Snippet;
|
|
68
|
+
text: ConstantAccessor<string | false | null | undefined, Datum>;
|
|
69
|
+
title?: ConstantAccessor<string, Datum>;
|
|
70
|
+
/**
|
|
71
|
+
* the font size of the text
|
|
72
|
+
*/
|
|
73
|
+
fontSize?: ConstantAccessor<number, Datum>;
|
|
74
|
+
/**
|
|
75
|
+
* if you want to apply class names to individual text elements
|
|
76
|
+
*/
|
|
77
|
+
textClass?: ConstantAccessor<string, Datum>;
|
|
78
|
+
/**
|
|
79
|
+
* the line anchor for vertical position; top, bottom, or middle
|
|
80
|
+
*/
|
|
81
|
+
lineAnchor?: ConstantAccessor<"bottom" | "top" | "middle">;
|
|
82
|
+
/**
|
|
83
|
+
* line height as multiplier of font size
|
|
84
|
+
* @default 1.2
|
|
85
|
+
*/
|
|
86
|
+
lineHeight?: ConstantAccessor<number, Datum>;
|
|
87
|
+
frameAnchor?: ConstantAccessor<"bottom" | "top" | "left" | "right" | "top-left" | "bottom-left" | "top-right" | "bottom-right", Datum>;
|
|
88
|
+
};
|
|
89
|
+
events(): {};
|
|
90
|
+
slots(): {};
|
|
91
|
+
bindings(): "";
|
|
92
|
+
exports(): {};
|
|
93
|
+
}
|
|
94
|
+
interface $$IsomorphicComponent {
|
|
95
|
+
new <Datum extends DataRecord>(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']>> & {
|
|
96
|
+
$$bindings?: ReturnType<__sveltets_Render<Datum>['bindings']>;
|
|
97
|
+
} & ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
98
|
+
<Datum extends DataRecord>(internal: unknown, props: ReturnType<__sveltets_Render<Datum>['props']> & {}): ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
99
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
100
|
+
}
|
|
25
101
|
/** Useful for adding SVG text labels to your plot. */
|
|
26
|
-
declare const Text:
|
|
27
|
-
type Text =
|
|
102
|
+
declare const Text: $$IsomorphicComponent;
|
|
103
|
+
type Text<Datum extends DataRecord> = InstanceType<typeof Text<Datum>>;
|
|
28
104
|
export default Text;
|
package/dist/marks/TickX.svelte
CHANGED
|
@@ -2,27 +2,25 @@
|
|
|
2
2
|
@component
|
|
3
3
|
The TickX mark is useful for showing one-dimensional distributions along the x axis. The y axis must be a band scale.
|
|
4
4
|
-->
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
|
|
6
|
+
<script lang="ts" generics="Datum extends DataRow">
|
|
7
|
+
interface TickXMarkProps extends Omit<BaseMarkProps<Datum>, 'fill' | 'fillOpacity'> {
|
|
8
|
+
data: Datum[];
|
|
8
9
|
/**
|
|
9
10
|
* the horizontal position; bound to the x scale
|
|
10
11
|
*/
|
|
11
|
-
x?: ChannelAccessor
|
|
12
|
+
x?: ChannelAccessor<Datum>;
|
|
12
13
|
/**
|
|
13
14
|
* the vertical position; bound to the y scale, which must be band. If the y channel
|
|
14
15
|
* is not specified, the tick will span the full vertical extent of the frame.
|
|
15
16
|
*/
|
|
16
|
-
y?: ChannelAccessor
|
|
17
|
+
y?: ChannelAccessor<Datum>;
|
|
17
18
|
/**
|
|
18
19
|
* if ticks are used on a non-bandwidth scale, this will determine the
|
|
19
20
|
* length of the tick. Defaults to 10 pixel
|
|
20
21
|
*/
|
|
21
|
-
tickLength?: ConstantAccessor<number>;
|
|
22
|
-
}
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<script lang="ts">
|
|
22
|
+
tickLength?: ConstantAccessor<number, Datum>;
|
|
23
|
+
}
|
|
26
24
|
import Mark from '../Mark.svelte';
|
|
27
25
|
import { getContext } from 'svelte';
|
|
28
26
|
import { resolveChannel, resolveProp, resolveScaledStyles } from '../helpers/resolve.js';
|
|
@@ -32,9 +30,10 @@
|
|
|
32
30
|
ChannelAccessor,
|
|
33
31
|
DataRow,
|
|
34
32
|
FacetContext,
|
|
35
|
-
PlotDefaults
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
PlotDefaults,
|
|
34
|
+
ConstantAccessor
|
|
35
|
+
} from '../types/index.js';
|
|
36
|
+
import { recordizeX } from '..';
|
|
38
37
|
import { projectX, projectY } from '../helpers/scales.js';
|
|
39
38
|
import { isValid } from '../helpers/isValid.js';
|
|
40
39
|
import { testFilter, parseInset } from '../helpers/index.js';
|
|
@@ -1,22 +1,94 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import type { ChannelAccessor, DataRow, ConstantAccessor } from '../types/index.js';
|
|
2
|
+
declare class __sveltets_Render<Datum extends DataRow> {
|
|
3
|
+
props(): Omit<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").RawValue, b: import("../types/data").RawValue) => number) | ConstantAccessor<import("../types/data").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").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: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
62
|
+
}>, "fill" | "fillOpacity"> & {
|
|
63
|
+
data: Datum[];
|
|
64
|
+
/**
|
|
65
|
+
* the horizontal position; bound to the x scale
|
|
66
|
+
*/
|
|
67
|
+
x?: ChannelAccessor<Datum>;
|
|
68
|
+
/**
|
|
69
|
+
* the vertical position; bound to the y scale, which must be band. If the y channel
|
|
70
|
+
* is not specified, the tick will span the full vertical extent of the frame.
|
|
71
|
+
*/
|
|
72
|
+
y?: ChannelAccessor<Datum>;
|
|
73
|
+
/**
|
|
74
|
+
* if ticks are used on a non-bandwidth scale, this will determine the
|
|
75
|
+
* length of the tick. Defaults to 10 pixel
|
|
76
|
+
*/
|
|
77
|
+
tickLength?: ConstantAccessor<number, Datum>;
|
|
78
|
+
};
|
|
79
|
+
events(): {};
|
|
80
|
+
slots(): {};
|
|
81
|
+
bindings(): "";
|
|
82
|
+
exports(): {};
|
|
83
|
+
}
|
|
84
|
+
interface $$IsomorphicComponent {
|
|
85
|
+
new <Datum extends 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']>> & {
|
|
86
|
+
$$bindings?: ReturnType<__sveltets_Render<Datum>['bindings']>;
|
|
87
|
+
} & ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
88
|
+
<Datum extends DataRow>(internal: unknown, props: ReturnType<__sveltets_Render<Datum>['props']> & {}): ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
89
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
90
|
+
}
|
|
19
91
|
/** The TickX mark is useful for showing one-dimensional distributions along the x axis. The y axis must be a band scale. */
|
|
20
|
-
declare const TickX:
|
|
21
|
-
type TickX =
|
|
92
|
+
declare const TickX: $$IsomorphicComponent;
|
|
93
|
+
type TickX<Datum extends DataRow> = InstanceType<typeof TickX<Datum>>;
|
|
22
94
|
export default TickX;
|
package/dist/marks/TickY.svelte
CHANGED
|
@@ -2,27 +2,24 @@
|
|
|
2
2
|
@component
|
|
3
3
|
The TickY mark is useful for showing one-dimensional distributions along the y axis. The x axis must be a band scale.
|
|
4
4
|
-->
|
|
5
|
-
<script
|
|
6
|
-
|
|
7
|
-
data:
|
|
5
|
+
<script lang="ts" generics="Datum extends DataRow">
|
|
6
|
+
interface TickYMarkProps extends Omit<BaseMarkProps<Datum>, 'fill' | 'fillOpacity'> {
|
|
7
|
+
data: Datum[];
|
|
8
8
|
/**
|
|
9
9
|
* the vertical position; bound to the x scale
|
|
10
10
|
*/
|
|
11
|
-
y?: ChannelAccessor
|
|
11
|
+
y?: ChannelAccessor<Datum>;
|
|
12
12
|
/**
|
|
13
|
-
* the horizontal position; bound to the
|
|
14
|
-
* is not specified, the tick will span the full
|
|
13
|
+
* the horizontal position; bound to the y scale, which must be band. If the y channel
|
|
14
|
+
* is not specified, the tick will span the full vertical extent of the frame.
|
|
15
15
|
*/
|
|
16
|
-
x?: ChannelAccessor
|
|
16
|
+
x?: ChannelAccessor<Datum>;
|
|
17
17
|
/**
|
|
18
18
|
* if ticks are used on a non-bandwidth scale, this will determine the
|
|
19
19
|
* length of the tick. Defaults to 10 pixel
|
|
20
20
|
*/
|
|
21
|
-
tickLength?: ConstantAccessor<number>;
|
|
22
|
-
}
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<script lang="ts">
|
|
21
|
+
tickLength?: ConstantAccessor<number, Datum>;
|
|
22
|
+
}
|
|
26
23
|
import Mark from '../Mark.svelte';
|
|
27
24
|
import { getContext } from 'svelte';
|
|
28
25
|
import { resolveChannel, resolveProp, resolveScaledStyles } from '../helpers/resolve.js';
|
|
@@ -34,8 +31,8 @@
|
|
|
34
31
|
FacetContext,
|
|
35
32
|
ConstantAccessor,
|
|
36
33
|
PlotDefaults
|
|
37
|
-
} from '../types.js';
|
|
38
|
-
import { recordizeY } from '
|
|
34
|
+
} from '../types/index.js';
|
|
35
|
+
import { recordizeY } from '..';
|
|
39
36
|
import { projectX, projectY } from '../helpers/scales.js';
|
|
40
37
|
import { isValid } from '../helpers/isValid.js';
|
|
41
38
|
import { testFilter, parseInset } from '../helpers/index.js';
|
|
@@ -1,22 +1,94 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import type { ChannelAccessor, DataRow, ConstantAccessor } from '../types/index.js';
|
|
2
|
+
declare class __sveltets_Render<Datum extends DataRow> {
|
|
3
|
+
props(): Omit<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").RawValue, b: import("../types/data").RawValue) => number) | ConstantAccessor<import("../types/data").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").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: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
62
|
+
}>, "fill" | "fillOpacity"> & {
|
|
63
|
+
data: Datum[];
|
|
64
|
+
/**
|
|
65
|
+
* the vertical position; bound to the x scale
|
|
66
|
+
*/
|
|
67
|
+
y?: ChannelAccessor<Datum>;
|
|
68
|
+
/**
|
|
69
|
+
* the horizontal position; bound to the y scale, which must be band. If the y channel
|
|
70
|
+
* is not specified, the tick will span the full vertical extent of the frame.
|
|
71
|
+
*/
|
|
72
|
+
x?: ChannelAccessor<Datum>;
|
|
73
|
+
/**
|
|
74
|
+
* if ticks are used on a non-bandwidth scale, this will determine the
|
|
75
|
+
* length of the tick. Defaults to 10 pixel
|
|
76
|
+
*/
|
|
77
|
+
tickLength?: ConstantAccessor<number, Datum>;
|
|
78
|
+
};
|
|
79
|
+
events(): {};
|
|
80
|
+
slots(): {};
|
|
81
|
+
bindings(): "";
|
|
82
|
+
exports(): {};
|
|
83
|
+
}
|
|
84
|
+
interface $$IsomorphicComponent {
|
|
85
|
+
new <Datum extends 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']>> & {
|
|
86
|
+
$$bindings?: ReturnType<__sveltets_Render<Datum>['bindings']>;
|
|
87
|
+
} & ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
88
|
+
<Datum extends DataRow>(internal: unknown, props: ReturnType<__sveltets_Render<Datum>['props']> & {}): ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
89
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
90
|
+
}
|
|
19
91
|
/** The TickY mark is useful for showing one-dimensional distributions along the y axis. The x axis must be a band scale. */
|
|
20
|
-
declare const TickY:
|
|
21
|
-
type TickY =
|
|
92
|
+
declare const TickY: $$IsomorphicComponent;
|
|
93
|
+
type TickY<Datum extends DataRow> = InstanceType<typeof TickY<Datum>>;
|
|
22
94
|
export default TickY;
|
package/dist/marks/Vector.svelte
CHANGED
|
@@ -3,49 +3,45 @@
|
|
|
3
3
|
The vector mark lets you place shapes (like arrows) on your plot.
|
|
4
4
|
-->
|
|
5
5
|
<script lang="ts" module>
|
|
6
|
-
import type {
|
|
7
|
-
PlotContext,
|
|
8
|
-
DataRecord,
|
|
9
|
-
BaseMarkProps,
|
|
10
|
-
ConstantAccessor,
|
|
11
|
-
ChannelAccessor,
|
|
12
|
-
FacetContext,
|
|
13
|
-
PlotDefaults
|
|
14
|
-
} from '../types.js';
|
|
15
|
-
|
|
16
6
|
type D3Path = ReturnType<typeof import('d3-path').path>;
|
|
17
|
-
|
|
18
7
|
export type ShapeRenderer = {
|
|
19
8
|
draw(context: D3Path, l: number, r: number): void;
|
|
20
9
|
};
|
|
10
|
+
</script>
|
|
21
11
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
<script lang="ts" generics="Datum extends DataRecord">
|
|
13
|
+
interface VectorMarkProps extends BaseMarkProps<Datum> {
|
|
14
|
+
data: Datum[];
|
|
15
|
+
x: ChannelAccessor<Datum>;
|
|
16
|
+
y: ChannelAccessor<Datum>;
|
|
26
17
|
r?: number;
|
|
27
|
-
length?: ChannelAccessor
|
|
28
|
-
rotate?: ChannelAccessor
|
|
18
|
+
length?: ChannelAccessor<Datum>;
|
|
19
|
+
rotate?: ChannelAccessor<Datum>;
|
|
29
20
|
/**
|
|
30
21
|
* Controls where the vector is anchored in relation to the x, y position.
|
|
31
22
|
* If set to 'start', the arrow will start at the x, y position. If set to
|
|
32
23
|
* 'middle', the arrow will be centered at the x, y position. If set to
|
|
33
24
|
* 'end', the arrow will end at the x, y position.
|
|
34
25
|
*/
|
|
35
|
-
anchor
|
|
26
|
+
anchor?: 'start' | 'middle' | 'end';
|
|
36
27
|
shape?: 'arrow' | 'spike' | 'arrow-filled' | ShapeRenderer;
|
|
37
28
|
children?: Snippet;
|
|
38
29
|
canvas?: boolean;
|
|
39
|
-
}
|
|
40
|
-
|
|
30
|
+
}
|
|
31
|
+
import type {
|
|
32
|
+
PlotContext,
|
|
33
|
+
DataRecord,
|
|
34
|
+
BaseMarkProps,
|
|
35
|
+
ChannelAccessor,
|
|
36
|
+
FacetContext,
|
|
37
|
+
PlotDefaults
|
|
38
|
+
} from '../types/index.js';
|
|
41
39
|
|
|
42
|
-
<script lang="ts">
|
|
43
40
|
import { getContext, type Snippet } from 'svelte';
|
|
44
41
|
import { pathRound as path } from 'd3-path';
|
|
45
42
|
|
|
46
43
|
import { resolveChannel, resolveProp, resolveStyles } from '../helpers/resolve.js';
|
|
47
|
-
import {
|
|
48
|
-
import { sort } from '../index.js';
|
|
44
|
+
import { sort } from '..';
|
|
49
45
|
import Mark from '../Mark.svelte';
|
|
50
46
|
//import DotCanvas from './helpers/DotCanvas.svelte';
|
|
51
47
|
import { maybeData, testFilter, isValid } from '../helpers/index.js';
|