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 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 grapihcs.
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
@@ -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 grapihcs.
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.
@@ -471,7 +471,7 @@
471
471
  data-testid={testid}>
472
472
  {#if header}
473
473
  <div class="plot-header">
474
- {#if header}{@render header()}{/if}
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
- {#if footer}{@render footer()}{/if}
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 wether
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
- * porperty setter functions on the result.
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 {};
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Helper function to call a D3 "function class" while also calling
3
- * porperty setter functions on the result.
3
+ * property setter functions on the result.
4
4
  */
5
5
  export default function (d3func, args, props = {}) {
6
6
  const res = d3func(...args);
@@ -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 explicitely or implicitely be exempt from being
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 the scale is supposed to be used
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;
@@ -247,9 +247,9 @@ const scaledChannelNames = [
247
247
  'length'
248
248
  ];
249
249
  /**
250
- * Mark channels can explicitely or implicitely be exempt from being
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 the scale is supposed to be used
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
- // efficiantly, in observable plot, all data points of a mark are projected using
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({
@@ -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 GrixXMarkProps = BaseMarkProps & {
10
+ type GridXMarkProps = BaseMarkProps & {
11
11
  data?: RawValue[];
12
12
  automatic?: boolean;
13
13
  };
14
14
 
15
- let { data = [], automatic = false, ...options }: GrixXMarkProps = $props();
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 GrixXMarkProps = BaseMarkProps & {
2
+ type GridXMarkProps = BaseMarkProps & {
3
3
  data?: RawValue[];
4
4
  automatic?: boolean;
5
5
  };
6
- declare const GridX: import("svelte").Component<GrixXMarkProps, {}, "">;
6
+ declare const GridX: import("svelte").Component<GridXMarkProps, {}, "">;
7
7
  type GridX = ReturnType<typeof GridX>;
8
8
  export default GridX;
@@ -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 preceeding tick that was not hidden
91
+ // find the preceding tick that was not hidden
92
92
  do {
93
93
  j--;
94
94
  } while (j >= 0 && tickObjects[j].hidden);
@@ -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 preceeding tick that was not hidden
73
+ // find the preceding tick that was not hidden
74
74
  do {
75
75
  j--;
76
76
  } while (j >= 0 && tickObjects[j].hidden);
@@ -25,7 +25,7 @@
25
25
  datum: DataRecord;
26
26
  /**
27
27
  * the marker shape to use at the start of the path, defaults to
28
- * cirlce
28
+ * circle
29
29
  */
30
30
  markerStart?: boolean | MarkerShape;
31
31
  /**
@@ -8,7 +8,7 @@ type MarkerPathProps = BaseMarkProps & {
8
8
  datum: DataRecord;
9
9
  /**
10
10
  * the marker shape to use at the start of the path, defaults to
11
- * cirlce
11
+ * circle
12
12
  */
13
13
  markerStart?: boolean | MarkerShape;
14
14
  /**
@@ -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 simulatenously
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 {};
@@ -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 simulatenously
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelteplot",
3
- "version": "0.2.6-next.0",
3
+ "version": "0.2.6-next.1",
4
4
  "license": "ISC",
5
5
  "author": {
6
6
  "name": "Gregor Aisch",