svelteplot 0.2.5 → 0.2.6-next.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/Plot.svelte +3 -3
- package/dist/Plot.svelte.d.ts +1 -1
- package/dist/core/Plot.svelte +20 -20
- package/dist/helpers/autoScales.js +1 -1
- package/dist/helpers/callWithProps.d.ts +1 -1
- package/dist/helpers/callWithProps.js +1 -1
- package/dist/helpers/getBaseStyles.js +1 -0
- package/dist/helpers/scales.d.ts +2 -2
- package/dist/helpers/scales.js +3 -3
- package/dist/marks/GridX.svelte +2 -2
- package/dist/marks/GridX.svelte.d.ts +2 -2
- package/dist/marks/helpers/BaseAxisX.svelte +26 -12
- package/dist/marks/helpers/BaseAxisY.svelte +29 -13
- package/dist/marks/helpers/MarkerPath.svelte +1 -1
- package/dist/marks/helpers/MarkerPath.svelte.d.ts +1 -1
- package/dist/transforms/bin.d.ts +1 -1
- package/dist/transforms/bin.js +1 -1
- package/dist/types.d.ts +4 -3
- package/package.json +118 -117
package/dist/Plot.svelte
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
their data and channels and computes the shared scales.
|
|
5
5
|
|
|
6
6
|
The Plot component is split into two parts. This is the outer Plot which
|
|
7
|
-
provides convenient defaults and automatically adds axes etc to the
|
|
7
|
+
provides convenient defaults and automatically adds axes etc to the graphics.
|
|
8
8
|
The downside is that it adds a bunch of imports that you may not be using.
|
|
9
9
|
To help with this you can use the core/Plot component directly for a more
|
|
10
10
|
low-level Plot wrapper.
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
{#if restOptions.title}<h2>{restOptions.title}</h2>{/if}
|
|
75
75
|
{#if restOptions.subtitle}<h3>{restOptions.subtitle}</h3>{/if}
|
|
76
76
|
<!-- also pass on user header -->
|
|
77
|
-
{#if userHeader}{@render userHeader()}{/if}
|
|
77
|
+
{#if userHeader}{@render userHeader?.()}{/if}
|
|
78
78
|
{#if restOptions.color?.legend}
|
|
79
79
|
<ColorLegend />
|
|
80
80
|
{/if}
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
|
|
86
86
|
{#snippet footer()}
|
|
87
87
|
{#if restOptions.caption}<div>{restOptions.caption}</div>{/if}
|
|
88
|
-
{#if userFooter}{@render userFooter()}{/if}
|
|
88
|
+
{#if userFooter}{@render userFooter?.()}{/if}
|
|
89
89
|
{/snippet}
|
|
90
90
|
|
|
91
91
|
<!-- There's a bug triggering RangeError: Maximum call stack size exceeded
|
package/dist/Plot.svelte.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type { PlotOptions } from './types.js';
|
|
|
5
5
|
* their data and channels and computes the shared scales.
|
|
6
6
|
*
|
|
7
7
|
* The Plot component is split into two parts. This is the outer Plot which
|
|
8
|
-
* provides convenient defaults and automatically adds axes etc to the
|
|
8
|
+
* provides convenient defaults and automatically adds axes etc to the graphics.
|
|
9
9
|
* The downside is that it adds a bunch of imports that you may not be using.
|
|
10
10
|
* To help with this you can use the core/Plot component directly for a more
|
|
11
11
|
* low-level Plot wrapper.
|
package/dist/core/Plot.svelte
CHANGED
|
@@ -28,22 +28,6 @@
|
|
|
28
28
|
import mergeDeep from '../helpers/mergeDeep.js';
|
|
29
29
|
import { computeScales, projectXY } from '../helpers/scales.js';
|
|
30
30
|
import { CHANNEL_SCALE, SCALES } from '../constants.js';
|
|
31
|
-
import { scale } from 'svelte/transition';
|
|
32
|
-
|
|
33
|
-
let {
|
|
34
|
-
header,
|
|
35
|
-
footer,
|
|
36
|
-
overlay,
|
|
37
|
-
underlay,
|
|
38
|
-
children,
|
|
39
|
-
facetAxes,
|
|
40
|
-
testid,
|
|
41
|
-
facet,
|
|
42
|
-
class: className = '',
|
|
43
|
-
css,
|
|
44
|
-
width: fixedWidth,
|
|
45
|
-
...initialOpts
|
|
46
|
-
}: Partial<PlotOptions> = $props();
|
|
47
31
|
|
|
48
32
|
// automatic margins can be applied by the marks, registered
|
|
49
33
|
// with their respective unique identifier as keys
|
|
@@ -95,6 +79,21 @@
|
|
|
95
79
|
...getContext<Partial<PlotDefaults>>('svelteplot/defaults')
|
|
96
80
|
};
|
|
97
81
|
|
|
82
|
+
let {
|
|
83
|
+
header,
|
|
84
|
+
footer,
|
|
85
|
+
overlay,
|
|
86
|
+
underlay,
|
|
87
|
+
children,
|
|
88
|
+
facetAxes,
|
|
89
|
+
testid,
|
|
90
|
+
facet,
|
|
91
|
+
class: className = '',
|
|
92
|
+
css = DEFAULTS.css,
|
|
93
|
+
width: fixedWidth,
|
|
94
|
+
...initialOpts
|
|
95
|
+
}: Partial<PlotOptions> = $props();
|
|
96
|
+
|
|
98
97
|
let width = $state(DEFAULTS.initialWidth);
|
|
99
98
|
|
|
100
99
|
setContext('svelteplot/_defaults', DEFAULTS);
|
|
@@ -454,7 +453,8 @@
|
|
|
454
453
|
symbol: { type: 'ordinal' },
|
|
455
454
|
fx: { type: 'band', axis: 'top' },
|
|
456
455
|
fy: { type: 'band', axis: 'right' },
|
|
457
|
-
locale: DEFAULTS.locale
|
|
456
|
+
locale: DEFAULTS.locale,
|
|
457
|
+
css: DEFAULTS.css
|
|
458
458
|
};
|
|
459
459
|
}
|
|
460
460
|
|
|
@@ -471,7 +471,7 @@
|
|
|
471
471
|
data-testid={testid}>
|
|
472
472
|
{#if header}
|
|
473
473
|
<div class="plot-header">
|
|
474
|
-
{
|
|
474
|
+
{@render header?.()}
|
|
475
475
|
</div>
|
|
476
476
|
{/if}
|
|
477
477
|
<div class="plot-body" bind:this={plotBody}>
|
|
@@ -500,11 +500,11 @@
|
|
|
500
500
|
{/if}
|
|
501
501
|
</FacetGrid>
|
|
502
502
|
</svg>
|
|
503
|
-
{#if overlay}<div class="plot-overlay">{@render overlay()}</div>{/if}
|
|
503
|
+
{#if overlay}<div class="plot-overlay">{@render overlay?.()}</div>{/if}
|
|
504
504
|
</div>
|
|
505
505
|
{#if footer}
|
|
506
506
|
<figcaption class="plot-footer">
|
|
507
|
-
{
|
|
507
|
+
{@render footer?.()}
|
|
508
508
|
</figcaption>
|
|
509
509
|
{/if}
|
|
510
510
|
</figure>
|
|
@@ -193,7 +193,7 @@ function getScaleRange(name, scaleOptions, plotOptions, plotWidth, plotHeight, p
|
|
|
193
193
|
: name === 'r'
|
|
194
194
|
? [0, 10]
|
|
195
195
|
: name === 'symbol'
|
|
196
|
-
? // Plot is smart enough to pick different default shapes depending on
|
|
196
|
+
? // Plot is smart enough to pick different default shapes depending on whether
|
|
197
197
|
// or not there are filled dot marks in the plot, so we have to pass this
|
|
198
198
|
// information all the way here
|
|
199
199
|
plotHasFilledDotMarks
|
|
@@ -2,7 +2,7 @@ import type { RawValue } from '../types.js';
|
|
|
2
2
|
type Setter = (v: any) => void;
|
|
3
3
|
/**
|
|
4
4
|
* Helper function to call a D3 "function class" while also calling
|
|
5
|
-
*
|
|
5
|
+
* property setter functions on the result.
|
|
6
6
|
*/
|
|
7
7
|
export default function (d3func: () => Record<string, Setter>, args: RawValue[], props?: Record<string, RawValue>): Record<string, Setter>;
|
|
8
8
|
export {};
|
package/dist/helpers/scales.d.ts
CHANGED
|
@@ -30,9 +30,9 @@ export declare function createScale<T extends ScaleOptions>(name: ScaleName, sca
|
|
|
30
30
|
*/
|
|
31
31
|
export declare function inferScaleType(name: ScaleName, dataValues: RawValue[], markTypes: Set<MarkType>): ScaleType;
|
|
32
32
|
/**
|
|
33
|
-
* Mark channels can
|
|
33
|
+
* Mark channels can explicitly or implicitly be exempt from being
|
|
34
34
|
* mapped to a scale, so everywhere where values are being mapped to
|
|
35
|
-
* scales, we need to check if the
|
|
35
|
+
* scales, we need to check if the scale is supposed to be used
|
|
36
36
|
* not. That's what this function is used for.
|
|
37
37
|
*/
|
|
38
38
|
export declare function getUsedScales(plot: PlotState, options: GenericMarkOptions, mark: Mark<GenericMarkOptions>): UsedScales;
|
package/dist/helpers/scales.js
CHANGED
|
@@ -247,9 +247,9 @@ const scaledChannelNames = [
|
|
|
247
247
|
'length'
|
|
248
248
|
];
|
|
249
249
|
/**
|
|
250
|
-
* Mark channels can
|
|
250
|
+
* Mark channels can explicitly or implicitly be exempt from being
|
|
251
251
|
* mapped to a scale, so everywhere where values are being mapped to
|
|
252
|
-
* scales, we need to check if the
|
|
252
|
+
* scales, we need to check if the scale is supposed to be used
|
|
253
253
|
* not. That's what this function is used for.
|
|
254
254
|
*/
|
|
255
255
|
export function getUsedScales(plot, options, mark) {
|
|
@@ -277,7 +277,7 @@ function looksLikeOpacity(input) {
|
|
|
277
277
|
export function projectXY(scales, x, y, useXScale = true, useYScale = true) {
|
|
278
278
|
if (scales.projection) {
|
|
279
279
|
// TODO: pretty sure this is not how projection streams are supposed to be used
|
|
280
|
-
//
|
|
280
|
+
// efficiently, in observable plot, all data points of a mark are projected using
|
|
281
281
|
// the same stream
|
|
282
282
|
let x_, y_;
|
|
283
283
|
const stream = scales.projection.stream({
|
package/dist/marks/GridX.svelte
CHANGED
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
import { testFilter } from '../helpers/index.js';
|
|
8
8
|
import { RAW_VALUE } from '../transforms/recordize.js';
|
|
9
9
|
|
|
10
|
-
type
|
|
10
|
+
type GridXMarkProps = BaseMarkProps & {
|
|
11
11
|
data?: RawValue[];
|
|
12
12
|
automatic?: boolean;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
let { data = [], automatic = false, ...options }:
|
|
15
|
+
let { data = [], automatic = false, ...options }: GridXMarkProps = $props();
|
|
16
16
|
|
|
17
17
|
const { getPlotState } = getContext<PlotContext>('svelteplot');
|
|
18
18
|
const plot = $derived(getPlotState());
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { BaseMarkProps, RawValue } from '../types.js';
|
|
2
|
-
type
|
|
2
|
+
type GridXMarkProps = BaseMarkProps & {
|
|
3
3
|
data?: RawValue[];
|
|
4
4
|
automatic?: boolean;
|
|
5
5
|
};
|
|
6
|
-
declare const GridX: import("svelte").Component<
|
|
6
|
+
declare const GridX: import("svelte").Component<GridXMarkProps, {}, "">;
|
|
7
7
|
type GridX = ReturnType<typeof GridX>;
|
|
8
8
|
export default GridX;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
RawValue,
|
|
12
12
|
ScaleType
|
|
13
13
|
} from '../../types.js';
|
|
14
|
-
import {
|
|
14
|
+
import { resolveProp, resolveStyles } from '../../helpers/resolve.js';
|
|
15
15
|
import { max } from 'd3-array';
|
|
16
16
|
import { randomId, testFilter } from '../../helpers/index.js';
|
|
17
17
|
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
const T = tickObjects.length;
|
|
89
89
|
for (let i = 0; i < T; i++) {
|
|
90
90
|
let j = i;
|
|
91
|
-
// find the
|
|
91
|
+
// find the preceding tick that was not hidden
|
|
92
92
|
do {
|
|
93
93
|
j--;
|
|
94
94
|
} while (j >= 0 && tickObjects[j].hidden);
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
</script>
|
|
143
143
|
|
|
144
144
|
<g class="axis-x">
|
|
145
|
-
{#each positionedTicks as tick, t}
|
|
145
|
+
{#each positionedTicks as tick, t (t)}
|
|
146
146
|
{#if testFilter(tick.value, options) && !tick.hidden}
|
|
147
147
|
{@const textLines = tick.text}
|
|
148
148
|
{@const prevTextLines = t && positionedTicks[t - 1].text}
|
|
@@ -152,27 +152,41 @@
|
|
|
152
152
|
{@const moveDown =
|
|
153
153
|
(tickSize + tickPadding + (tickRotate !== 0 ? tickFontSize * 0.35 : 0)) *
|
|
154
154
|
(anchor === 'bottom' ? 1 : -1)}
|
|
155
|
+
{@const [textStyle, textClass] = resolveStyles(
|
|
156
|
+
plot,
|
|
157
|
+
tick,
|
|
158
|
+
{
|
|
159
|
+
fontVariant: isQuantitative ? 'tabular-nums' : 'normal',
|
|
160
|
+
...options,
|
|
161
|
+
fontSize: tickFontSize,
|
|
162
|
+
stroke: null
|
|
163
|
+
},
|
|
164
|
+
'fill',
|
|
165
|
+
{ x: true }
|
|
166
|
+
)}
|
|
155
167
|
<g
|
|
156
168
|
class="tick {tickClass_ || ''}"
|
|
157
169
|
transform="translate({tick.x + tick.dx}, {tickY + tick.dy})"
|
|
158
170
|
text-anchor={tickRotate < 0 ? 'end' : tickRotate > 0 ? 'start' : 'middle'}>
|
|
159
171
|
{#if tickSize}
|
|
172
|
+
{@const [tickLineStyle, tickLineClass] = resolveStyles(
|
|
173
|
+
plot,
|
|
174
|
+
tick,
|
|
175
|
+
options,
|
|
176
|
+
'stroke',
|
|
177
|
+
{ x: true }
|
|
178
|
+
)}
|
|
160
179
|
<line
|
|
161
|
-
style={
|
|
180
|
+
style={tickLineStyle}
|
|
181
|
+
class={tickLineClass}
|
|
162
182
|
y2={anchor === 'bottom' ? tickSize : -tickSize} />
|
|
163
183
|
{/if}
|
|
164
184
|
|
|
165
185
|
<text
|
|
166
186
|
bind:this={tickTextElements[t]}
|
|
167
187
|
transform="translate(0, {moveDown}) rotate({tickRotate})"
|
|
168
|
-
style
|
|
169
|
-
|
|
170
|
-
tick,
|
|
171
|
-
{ ...options, fontSize: tickFontSize, stroke: null },
|
|
172
|
-
{},
|
|
173
|
-
plot,
|
|
174
|
-
'fill'
|
|
175
|
-
)}
|
|
188
|
+
style={textStyle}
|
|
189
|
+
class={textClass}
|
|
176
190
|
x={0}
|
|
177
191
|
y={0}
|
|
178
192
|
dominant-baseline={tickRotate !== 0
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { getContext, untrack } from 'svelte';
|
|
2
|
+
import { getContext, tick, untrack } from 'svelte';
|
|
3
3
|
import { randomId, testFilter } from '../../helpers/index.js';
|
|
4
|
-
import { resolveProp,
|
|
4
|
+
import { resolveProp, resolveStyles } from '../../helpers/resolve.js';
|
|
5
5
|
import { max } from 'd3-array';
|
|
6
6
|
import type {
|
|
7
7
|
AutoMarginStores,
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
const T = tickObjects.length;
|
|
71
71
|
for (let i = 0; i < T; i++) {
|
|
72
72
|
let j = i;
|
|
73
|
-
// find the
|
|
73
|
+
// find the preceding tick that was not hidden
|
|
74
74
|
do {
|
|
75
75
|
j--;
|
|
76
76
|
} while (j >= 0 && tickObjects[j].hidden);
|
|
@@ -84,6 +84,8 @@
|
|
|
84
84
|
|
|
85
85
|
let tickTexts = $state([] as SVGTextElement[]);
|
|
86
86
|
|
|
87
|
+
const isQuantitative = $derived(scaleType !== 'point' && scaleType !== 'band');
|
|
88
|
+
|
|
87
89
|
// generate id used for registering margins
|
|
88
90
|
const id = randomId();
|
|
89
91
|
|
|
@@ -141,29 +143,43 @@
|
|
|
141
143
|
</script>
|
|
142
144
|
|
|
143
145
|
<g class="axis-y">
|
|
144
|
-
{#each positionedTicks as tick, t}
|
|
146
|
+
{#each positionedTicks as tick, t (t)}
|
|
145
147
|
{#if testFilter(tick.value, options) && !tick.hidden}
|
|
146
148
|
{@const tickClass_ = resolveProp(tickClass, tick.value)}
|
|
149
|
+
{@const [textStyle, textClass] = resolveStyles(
|
|
150
|
+
plot,
|
|
151
|
+
tick,
|
|
152
|
+
{
|
|
153
|
+
fontVariant: isQuantitative ? 'tabular-nums' : 'normal',
|
|
154
|
+
...options,
|
|
155
|
+
fontSize: tickFontSize,
|
|
156
|
+
stroke: null
|
|
157
|
+
},
|
|
158
|
+
'fill',
|
|
159
|
+
{ y: true }
|
|
160
|
+
)}
|
|
147
161
|
<g
|
|
148
162
|
class="tick {tickClass_ || ''}"
|
|
149
163
|
transform="translate({tick.dx +
|
|
150
164
|
marginLeft +
|
|
151
165
|
(anchor === 'left' ? 0 : width)},{tick.y + tick.dy})">
|
|
152
166
|
{#if tickSize}
|
|
167
|
+
{@const [tickLineStyle, tickLineClass] = resolveStyles(
|
|
168
|
+
plot,
|
|
169
|
+
tick,
|
|
170
|
+
options,
|
|
171
|
+
'stroke',
|
|
172
|
+
{ y: true }
|
|
173
|
+
)}
|
|
153
174
|
<line
|
|
154
|
-
style={
|
|
175
|
+
style={tickLineStyle}
|
|
176
|
+
class={tickLineClass}
|
|
155
177
|
x2={anchor === 'left' ? -tickSize : tickSize} />
|
|
156
178
|
{/if}
|
|
157
179
|
<text
|
|
158
180
|
bind:this={tickTexts[t]}
|
|
159
|
-
class={{ 'is-left': anchor === 'left' }}
|
|
160
|
-
style={
|
|
161
|
-
tick.value,
|
|
162
|
-
{ ...options, fontSize: tickFontSize, stroke: null },
|
|
163
|
-
{},
|
|
164
|
-
plot,
|
|
165
|
-
'fill'
|
|
166
|
-
)}
|
|
181
|
+
class={[textClass, { 'is-left': anchor === 'left' }]}
|
|
182
|
+
style={textStyle}
|
|
167
183
|
x={(tickSize + tickPadding) * (anchor === 'left' ? -1 : 1)}
|
|
168
184
|
dominant-baseline={LINE_ANCHOR[lineAnchor]}
|
|
169
185
|
>{Array.isArray(tick.text) ? tick.text.join(' ') : tick.text}</text>
|
package/dist/transforms/bin.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export declare function binX<T>({ data, ...channels }: TransformArg<T, DataRecor
|
|
|
45
45
|
*/
|
|
46
46
|
export declare function binY<T>({ data, ...channels }: TransformArg<T, DataRecord>, options?: BinYOptions): TransformArg<T, DataRecord>;
|
|
47
47
|
/**
|
|
48
|
-
* for binning in x and y dimension
|
|
48
|
+
* for binning in x and y dimension simultaneously
|
|
49
49
|
*/
|
|
50
50
|
export declare function bin<T>({ data, ...channels }: TransformArg<T, DataRecord>, options?: BinOptions): TransformArg<T, DataRecord>;
|
|
51
51
|
export {};
|
package/dist/transforms/bin.js
CHANGED
|
@@ -87,7 +87,7 @@ export function binY({ data, ...channels }, options = { thresholds: 'auto', cumu
|
|
|
87
87
|
return binBy('y', { data, ...channels }, options);
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
|
-
* for binning in x and y dimension
|
|
90
|
+
* for binning in x and y dimension simultaneously
|
|
91
91
|
*/
|
|
92
92
|
export function bin({ data, ...channels }, options = { thresholds: 'auto', cumulative: false }) {
|
|
93
93
|
const { domain, thresholds = 'auto', interval, cumulative = false } = options;
|
package/dist/types.d.ts
CHANGED
|
@@ -296,9 +296,9 @@ export type PlotOptions = {
|
|
|
296
296
|
*/
|
|
297
297
|
locale: string;
|
|
298
298
|
/**
|
|
299
|
-
*
|
|
299
|
+
* pass a @emotion/css function to style plot using dynamic classes
|
|
300
300
|
*/
|
|
301
|
-
css: (d: string) => string;
|
|
301
|
+
css: (d: string) => string | undefined;
|
|
302
302
|
};
|
|
303
303
|
export type PlotDefaults = {
|
|
304
304
|
axisXAnchor: AxisXAnchor;
|
|
@@ -339,6 +339,7 @@ export type PlotDefaults = {
|
|
|
339
339
|
*/
|
|
340
340
|
numberFormat: Intl.NumberFormatOptions;
|
|
341
341
|
markerDotRadius: number;
|
|
342
|
+
css: (d: string) => string | undefined;
|
|
342
343
|
};
|
|
343
344
|
export type GenericMarkOptions = Record<string, any>;
|
|
344
345
|
export type DataRecord = Record<string | symbol, RawValue> & {
|
|
@@ -583,7 +584,7 @@ export type TransformArgsRecord = Partial<Channels> & {
|
|
|
583
584
|
data: DataRecord[];
|
|
584
585
|
};
|
|
585
586
|
export type ColorScheme = 'brbg' | 'prgn' | 'piyg' | 'puor' | 'rdbu' | 'rdgy' | 'rdylbu' | 'rdylgn' | 'spectral' | 'burd' | 'buylrd' | 'blues' | 'greens' | 'grays' | 'greys' | 'oranges' | 'purples' | 'reds' | 'turbo' | 'viridis' | 'magma' | 'inferno' | 'plasma' | 'cividis' | 'cubehelix' | 'warm' | 'cool' | 'bugn' | 'bupu' | 'gnbu' | 'orrd' | 'pubu' | 'pubugn' | 'purd' | 'rdpu' | 'ylgn' | 'ylgnbu' | 'ylorbr' | 'ylorrd' | 'rainbow' | 'sinebow' | 'accent' | 'category10' | 'dark2' | 'paired' | 'pastel1' | 'pastel2' | 'set1' | 'set2' | 'set3' | 'tableau10' | 'observable10';
|
|
586
|
-
export type MarkStyleProps = 'strokeDasharray' | 'strokeLinejoin' | 'strokeLinecap' | 'opacity' | 'cursor' | 'pointerEvents' | 'blend' | 'fill' | 'fillOpacity' | 'fontWeight' | 'fontSize' | 'fontStyle' | 'stroke' | 'strokeWidth' | 'strokeOpacity' | 'x' | 'y' | 'clipPath' | 'mask' | 'filter' | 'angle' | 'radius' | 'symbol' | 'textAnchor' | 'width';
|
|
587
|
+
export type MarkStyleProps = 'strokeDasharray' | 'strokeLinejoin' | 'strokeLinecap' | 'opacity' | 'cursor' | 'pointerEvents' | 'blend' | 'fill' | 'fillOpacity' | 'fontWeight' | 'fontVariant' | 'fontSize' | 'fontStyle' | 'stroke' | 'strokeWidth' | 'strokeOpacity' | 'x' | 'y' | 'clipPath' | 'mask' | 'filter' | 'angle' | 'radius' | 'symbol' | 'textAnchor' | 'width';
|
|
587
588
|
export type AutoMarginStores = {
|
|
588
589
|
autoMarginTop: Writable<Map<string, number>>;
|
|
589
590
|
autoMarginLeft: Writable<Map<string, number>>;
|
package/package.json
CHANGED
|
@@ -1,123 +1,124 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"svelte": "./dist/index.js"
|
|
2
|
+
"name": "svelteplot",
|
|
3
|
+
"version": "0.2.6-next.1",
|
|
4
|
+
"license": "ISC",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Gregor Aisch",
|
|
7
|
+
"email": "gka@users.noreply.github.com"
|
|
13
8
|
},
|
|
14
|
-
"
|
|
15
|
-
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "vite dev",
|
|
11
|
+
"build": "vite build",
|
|
12
|
+
"preview": "vite preview",
|
|
13
|
+
"test": "npm run test:unit",
|
|
14
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
15
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
16
|
+
"lint": "prettier --check src && eslint src",
|
|
17
|
+
"format": "prettier --write .",
|
|
18
|
+
"test:unit": "vitest",
|
|
19
|
+
"prepack": "npx svelte-package",
|
|
20
|
+
"release-next": "npm version prerelease --preid next && npm publish && git push && git push --tags && sleep 1 && npm dist-tag add svelteplot@$(npm view . version) next",
|
|
21
|
+
"docs": "npm run build && cd build && rsync --recursive . vis4.net:svelteplot/alpha0/"
|
|
16
22
|
},
|
|
17
|
-
"
|
|
18
|
-
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"svelte": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./*.js": {
|
|
29
|
+
"import": "./dist/*.js"
|
|
30
|
+
},
|
|
31
|
+
"./*.svelte": {
|
|
32
|
+
"import": "./dist/*.svelte"
|
|
33
|
+
},
|
|
34
|
+
"./core/*.svelte": {
|
|
35
|
+
"import": "./dist/core/*.svelte"
|
|
36
|
+
},
|
|
37
|
+
"./marks/*.svelte": {
|
|
38
|
+
"import": "./dist/marks/*.svelte"
|
|
39
|
+
},
|
|
40
|
+
"./transforms": {
|
|
41
|
+
"import": "./dist/transforms/index.js"
|
|
42
|
+
}
|
|
19
43
|
},
|
|
20
|
-
"
|
|
21
|
-
|
|
44
|
+
"main": "./dist/index.js",
|
|
45
|
+
"files": [
|
|
46
|
+
"dist",
|
|
47
|
+
"!dist/**/*.test.*",
|
|
48
|
+
"!dist/**/*.spec.*"
|
|
49
|
+
],
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@aitodotai/json-stringify-pretty-compact": "^1.3.0",
|
|
52
|
+
"@emotion/css": "^11.13.5",
|
|
53
|
+
"@sveltejs/adapter-auto": "^6.0.1",
|
|
54
|
+
"@sveltejs/adapter-static": "^3.0.8",
|
|
55
|
+
"@sveltejs/eslint-config": "^8.2.0",
|
|
56
|
+
"@sveltejs/kit": "^2.21.0",
|
|
57
|
+
"@sveltejs/package": "^2.3.11",
|
|
58
|
+
"@sveltejs/vite-plugin-svelte": "5.0.3",
|
|
59
|
+
"@sveltepress/theme-default": "^6.0.3",
|
|
60
|
+
"@sveltepress/twoslash": "^1.2.2",
|
|
61
|
+
"@sveltepress/vite": "^1.2.2",
|
|
62
|
+
"@testing-library/svelte": "^5.2.7",
|
|
63
|
+
"@testing-library/user-event": "^14.6.1",
|
|
64
|
+
"@types/d3-array": "^3.2.1",
|
|
65
|
+
"@types/d3-color": "^3.1.3",
|
|
66
|
+
"@types/d3-dsv": "^3.0.7",
|
|
67
|
+
"@types/d3-geo": "^3.1.0",
|
|
68
|
+
"@types/d3-interpolate": "^3.0.4",
|
|
69
|
+
"@types/d3-path": "^3.1.1",
|
|
70
|
+
"@types/d3-random": "^3.0.3",
|
|
71
|
+
"@types/d3-scale": "^4.0.9",
|
|
72
|
+
"@types/d3-scale-chromatic": "^3.1.0",
|
|
73
|
+
"@types/d3-shape": "^3.1.7",
|
|
74
|
+
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
75
|
+
"@typescript-eslint/parser": "^8.32.1",
|
|
76
|
+
"csstype": "^3.1.3",
|
|
77
|
+
"d3-dsv": "^3.0.1",
|
|
78
|
+
"d3-fetch": "^3.0.1",
|
|
79
|
+
"d3-force": "^3.0.0",
|
|
80
|
+
"eslint": "^9.26.0",
|
|
81
|
+
"eslint-config-prettier": "^10.1.5",
|
|
82
|
+
"eslint-plugin-svelte": "3.7.0",
|
|
83
|
+
"jsdom": "^26.1.0",
|
|
84
|
+
"prettier": "^3.5.3",
|
|
85
|
+
"prettier-plugin-svelte": "^3.4.0",
|
|
86
|
+
"remark-code-extra": "^1.0.1",
|
|
87
|
+
"remark-code-frontmatter": "^1.0.0",
|
|
88
|
+
"resize-observer-polyfill": "^1.5.1",
|
|
89
|
+
"sass": "^1.89.0",
|
|
90
|
+
"svelte-check": "^4.2.1",
|
|
91
|
+
"svelte-eslint-parser": "1.2.0",
|
|
92
|
+
"svelte-highlight": "^7.8.3",
|
|
93
|
+
"svg-path-parser": "^1.1.0",
|
|
94
|
+
"topojson-client": "^3.1.0",
|
|
95
|
+
"tslib": "^2.8.1",
|
|
96
|
+
"typedoc": "^0.28.4",
|
|
97
|
+
"typedoc-plugin-markdown": "^4.6.3",
|
|
98
|
+
"typescript": "^5.8.3",
|
|
99
|
+
"vite": "^6.3.5",
|
|
100
|
+
"vitest": "^3.1.3",
|
|
101
|
+
"vitest-matchmedia-mock": "^2.0.3"
|
|
22
102
|
},
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
103
|
+
"types": "./dist/index.d.ts",
|
|
104
|
+
"type": "module",
|
|
105
|
+
"dependencies": {
|
|
106
|
+
"d3-array": "^3.2.4",
|
|
107
|
+
"d3-color": "^3.1.0",
|
|
108
|
+
"d3-format": "^3.1.0",
|
|
109
|
+
"d3-geo": "^3.1.1",
|
|
110
|
+
"d3-interpolate": "^3.0.1",
|
|
111
|
+
"d3-path": "^3.1.0",
|
|
112
|
+
"d3-quadtree": "^3.0.1",
|
|
113
|
+
"d3-random": "^3.0.1",
|
|
114
|
+
"d3-regression": "^1.3.10",
|
|
115
|
+
"d3-scale": "^4.0.2",
|
|
116
|
+
"d3-scale-chromatic": "^3.1.0",
|
|
117
|
+
"d3-shape": "^3.2.0",
|
|
118
|
+
"d3-time": "^3.1.0",
|
|
119
|
+
"es-toolkit": "^1.37.2",
|
|
120
|
+
"fast-equals": "^5.2.2",
|
|
121
|
+
"merge-deep": "^3.0.3",
|
|
122
|
+
"svelte": "5.30.1"
|
|
28
123
|
}
|
|
29
|
-
|
|
30
|
-
"main": "./dist/index.js",
|
|
31
|
-
"files": [
|
|
32
|
-
"dist",
|
|
33
|
-
"!dist/**/*.test.*",
|
|
34
|
-
"!dist/**/*.spec.*"
|
|
35
|
-
],
|
|
36
|
-
"devDependencies": {
|
|
37
|
-
"@aitodotai/json-stringify-pretty-compact": "^1.3.0",
|
|
38
|
-
"@emotion/css": "^11.13.5",
|
|
39
|
-
"@sveltejs/adapter-auto": "^6.0.1",
|
|
40
|
-
"@sveltejs/adapter-static": "^3.0.8",
|
|
41
|
-
"@sveltejs/eslint-config": "^8.2.0",
|
|
42
|
-
"@sveltejs/kit": "^2.21.0",
|
|
43
|
-
"@sveltejs/package": "^2.3.11",
|
|
44
|
-
"@sveltejs/vite-plugin-svelte": "5.0.3",
|
|
45
|
-
"@sveltepress/theme-default": "^6.0.3",
|
|
46
|
-
"@sveltepress/twoslash": "^1.2.2",
|
|
47
|
-
"@sveltepress/vite": "^1.2.2",
|
|
48
|
-
"@testing-library/svelte": "^5.2.7",
|
|
49
|
-
"@testing-library/user-event": "^14.6.1",
|
|
50
|
-
"@types/d3-array": "^3.2.1",
|
|
51
|
-
"@types/d3-color": "^3.1.3",
|
|
52
|
-
"@types/d3-dsv": "^3.0.7",
|
|
53
|
-
"@types/d3-geo": "^3.1.0",
|
|
54
|
-
"@types/d3-interpolate": "^3.0.4",
|
|
55
|
-
"@types/d3-path": "^3.1.1",
|
|
56
|
-
"@types/d3-random": "^3.0.3",
|
|
57
|
-
"@types/d3-scale": "^4.0.9",
|
|
58
|
-
"@types/d3-scale-chromatic": "^3.1.0",
|
|
59
|
-
"@types/d3-shape": "^3.1.7",
|
|
60
|
-
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
61
|
-
"@typescript-eslint/parser": "^8.32.1",
|
|
62
|
-
"csstype": "^3.1.3",
|
|
63
|
-
"d3-dsv": "^3.0.1",
|
|
64
|
-
"d3-fetch": "^3.0.1",
|
|
65
|
-
"d3-force": "^3.0.0",
|
|
66
|
-
"eslint": "^9.26.0",
|
|
67
|
-
"eslint-config-prettier": "^10.1.5",
|
|
68
|
-
"eslint-plugin-svelte": "3.7.0",
|
|
69
|
-
"jsdom": "^26.1.0",
|
|
70
|
-
"prettier": "^3.5.3",
|
|
71
|
-
"prettier-plugin-svelte": "^3.4.0",
|
|
72
|
-
"remark-code-extra": "^1.0.1",
|
|
73
|
-
"remark-code-frontmatter": "^1.0.0",
|
|
74
|
-
"resize-observer-polyfill": "^1.5.1",
|
|
75
|
-
"sass": "^1.89.0",
|
|
76
|
-
"svelte-check": "^4.2.1",
|
|
77
|
-
"svelte-eslint-parser": "1.2.0",
|
|
78
|
-
"svelte-highlight": "^7.8.3",
|
|
79
|
-
"svg-path-parser": "^1.1.0",
|
|
80
|
-
"topojson-client": "^3.1.0",
|
|
81
|
-
"tslib": "^2.8.1",
|
|
82
|
-
"typedoc": "^0.28.4",
|
|
83
|
-
"typedoc-plugin-markdown": "^4.6.3",
|
|
84
|
-
"typescript": "^5.8.3",
|
|
85
|
-
"vite": "^6.3.5",
|
|
86
|
-
"vitest": "^3.1.3",
|
|
87
|
-
"vitest-matchmedia-mock": "^2.0.3"
|
|
88
|
-
},
|
|
89
|
-
"types": "./dist/index.d.ts",
|
|
90
|
-
"type": "module",
|
|
91
|
-
"dependencies": {
|
|
92
|
-
"d3-array": "^3.2.4",
|
|
93
|
-
"d3-color": "^3.1.0",
|
|
94
|
-
"d3-format": "^3.1.0",
|
|
95
|
-
"d3-geo": "^3.1.1",
|
|
96
|
-
"d3-interpolate": "^3.0.1",
|
|
97
|
-
"d3-path": "^3.1.0",
|
|
98
|
-
"d3-quadtree": "^3.0.1",
|
|
99
|
-
"d3-random": "^3.0.1",
|
|
100
|
-
"d3-regression": "^1.3.10",
|
|
101
|
-
"d3-scale": "^4.0.2",
|
|
102
|
-
"d3-scale-chromatic": "^3.1.0",
|
|
103
|
-
"d3-shape": "^3.2.0",
|
|
104
|
-
"d3-time": "^3.1.0",
|
|
105
|
-
"es-toolkit": "^1.37.2",
|
|
106
|
-
"fast-equals": "^5.2.2",
|
|
107
|
-
"merge-deep": "^3.0.3",
|
|
108
|
-
"svelte": "5.30.1"
|
|
109
|
-
},
|
|
110
|
-
"scripts": {
|
|
111
|
-
"dev": "vite dev",
|
|
112
|
-
"build": "vite build",
|
|
113
|
-
"preview": "vite preview",
|
|
114
|
-
"test": "npm run test:unit",
|
|
115
|
-
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
116
|
-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
117
|
-
"lint": "prettier --check src && eslint src",
|
|
118
|
-
"format": "prettier --write .",
|
|
119
|
-
"test:unit": "vitest",
|
|
120
|
-
"release-next": "npm version prerelease --preid next && npm publish && git push && git push --tags && sleep 1 && npm dist-tag add svelteplot@$(npm view . version) next",
|
|
121
|
-
"docs": "npm run build && cd build && rsync --recursive . vis4.net:svelteplot/alpha0/"
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
+
}
|