svelteplot 0.3.8-pr-141.0 → 0.3.8-pr-144.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 CHANGED
@@ -270,9 +270,9 @@
270
270
 
271
271
  // apply dx/dy transform
272
272
  out[channel] =
273
- scale === 'x' && Number.isFinite(scaled) ? (scaled as number) + dx : scaled;
274
- out[channel] =
275
- scale === 'y' && Number.isFinite(scaled) ? (scaled as number) + dy : scaled;
273
+ Number.isFinite(scaled) && (scale === 'x' || scale === 'y')
274
+ ? scaled + (scale === 'x' ? dx : dy)
275
+ : scaled;
276
276
  } else if (defaults[channel]) {
277
277
  out[channel] = defaults[channel];
278
278
  }
@@ -23,7 +23,10 @@ export function isSnippet(value) {
23
23
  return typeof value === 'function' && value.length === 1;
24
24
  }
25
25
  export function isValid(value) {
26
- return value !== null && value !== undefined && !Number.isNaN(value);
26
+ return (value !== null &&
27
+ value !== undefined &&
28
+ !Number.isNaN(value) &&
29
+ (typeof value !== 'number' || Number.isFinite(value)));
27
30
  }
28
31
  export function maybeData(data) {
29
32
  // if (data.type === 'FeatureCollection') return data.features;
@@ -1,7 +1,7 @@
1
1
  import { CHANNEL_SCALE } from '../constants.js';
2
2
  import isDataRecord from './isDataRecord.js';
3
3
  import isRawValue from './isRawValue.js';
4
- import { isValid } from './isValid.js';
4
+ import { isValid } from './index.js';
5
5
  import { getBaseStylesObject } from './getBaseStyles.js';
6
6
  import { RAW_VALUE } from '../transforms/recordize.js';
7
7
  export function resolveProp(accessor, datum, _defaultValue = null) {
@@ -209,7 +209,9 @@
209
209
  )}
210
210
  x={plot.options.marginLeft +
211
211
  plot.plotWidth * (titleAlign === 'right' ? 1 : titleAlign === 'center' ? 0.5 : 0)}
212
- y={anchor === 'top' ? 13 : plot.height - 13}
212
+ y={anchor === 'top'
213
+ ? (options.titleFontSize || 11) + 5
214
+ : plot.height - (options.titleFontSize || 11) - 5}
213
215
  class="axis-x-title"
214
216
  dominant-baseline={anchor === 'top' ? 'auto' : 'hanging'}>{useTitle}</text>
215
217
  {/if}
@@ -26,7 +26,7 @@
26
26
  import { recordizeY, sort } from '../index.js';
27
27
  import { resolveChannel } from '../helpers/resolve.js';
28
28
 
29
- import { isValid } from '../helpers/isValid.js';
29
+ import { isValid } from '../helpers/index.js';
30
30
  import RectPath from './helpers/RectPath.svelte';
31
31
 
32
32
  let markProps: CellMarkProps = $props();
@@ -32,7 +32,6 @@
32
32
  import { recordizeXY } from '../transforms/recordize.js';
33
33
  import { addEventHandlers } from './helpers/events.js';
34
34
  import Anchor from './helpers/Anchor.svelte';
35
- import type { D } from 'vitest/dist/chunks/reporters.d.DL9pg5DB.js';
36
35
 
37
36
  const DEFAULTS = {
38
37
  ...getContext<PlotDefaults>('svelteplot/_defaults').dot
@@ -35,7 +35,7 @@
35
35
  } from '../types/index.js';
36
36
  import { recordizeX } from '../index.js';
37
37
  import { projectX, projectY } from '../helpers/scales.js';
38
- import { isValid } from '../helpers/isValid.js';
38
+ import { isValid } from '../helpers/index.js';
39
39
  import { testFilter, parseInset } from '../helpers/index.js';
40
40
 
41
41
  const { getPlotState } = getContext<PlotContext>('svelteplot');
@@ -34,7 +34,7 @@
34
34
  } from '../types/index.js';
35
35
  import { recordizeY } from '../index.js';
36
36
  import { projectX, projectY } from '../helpers/scales.js';
37
- import { isValid } from '../helpers/isValid.js';
37
+ import { isValid } from '../helpers/index.js';
38
38
  import { testFilter, parseInset } from '../helpers/index.js';
39
39
 
40
40
  const { getPlotState } = getContext<PlotContext>('svelteplot');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelteplot",
3
- "version": "0.3.8-pr-141.0",
3
+ "version": "0.3.8-pr-144.0",
4
4
  "license": "ISC",
5
5
  "author": {
6
6
  "name": "Gregor Aisch",
@@ -1,6 +0,0 @@
1
- /**
2
- * @deprecated import from helpers/index.ts instead!
3
- * @param value
4
- * @returns
5
- */
6
- export { isValid } from './index.js';
@@ -1,6 +0,0 @@
1
- /**
2
- * @deprecated import from helpers/index.ts instead!
3
- * @param value
4
- * @returns
5
- */
6
- export { isValid } from './index.js';