svelteplot 0.2.6-next.0 → 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 +3 -3
- 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/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 +1 -1
- package/dist/marks/helpers/BaseAxisY.svelte +1 -1
- 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/package.json +1 -1
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
|
@@ -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;
|
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;
|