From 82f69aeee152470dec78e038e9c0709a458f8f54 Mon Sep 17 00:00:00 2001 From: gka Date: Wed, 18 Jun 2025 08:29:39 +0200 Subject: [PATCH 01/17] docs: add ticks inside example --- src/routes/examples/axis/ticks-inside.svelte | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/routes/examples/axis/ticks-inside.svelte diff --git a/src/routes/examples/axis/ticks-inside.svelte b/src/routes/examples/axis/ticks-inside.svelte new file mode 100644 index 00000000..8e41895e --- /dev/null +++ b/src/routes/examples/axis/ticks-inside.svelte @@ -0,0 +1,24 @@ + + + + + + + + From 62fb6e46703872d013c90ca837fc1f11802fb2ae Mon Sep 17 00:00:00 2001 From: gka Date: Wed, 18 Jun 2025 08:30:34 +0200 Subject: [PATCH 02/17] fix ts imports --- src/lib/constants.ts | 2 +- src/lib/helpers/autoScales.ts | 2 +- src/lib/helpers/autoTicks.ts | 2 +- src/lib/helpers/callWithProps.ts | 2 +- src/lib/helpers/colors.ts | 2 +- src/lib/helpers/curves.ts | 2 +- src/lib/helpers/facets.ts | 2 +- src/lib/helpers/getBaseStyles.ts | 4 ++-- src/lib/helpers/group.ts | 2 +- src/lib/helpers/index.ts | 2 +- src/lib/helpers/isDataRecord.ts | 2 +- src/lib/helpers/isRawValue.ts | 2 +- src/lib/helpers/reduce.test.ts | 2 +- src/lib/helpers/reduce.ts | 2 +- src/lib/helpers/regressionLoess.ts | 2 +- src/lib/helpers/resolve.ts | 4 ++-- src/lib/helpers/scales.ts | 2 +- src/lib/helpers/typeChecks.ts | 2 +- src/lib/marks/helpers/events.ts | 2 +- src/lib/transforms/bin.ts | 4 ++-- src/lib/transforms/bollinger.ts | 2 +- src/lib/transforms/centroid.ts | 2 +- src/lib/transforms/facet.ts | 2 +- src/lib/transforms/filter.ts | 2 +- src/lib/transforms/group.test.ts | 2 +- src/lib/transforms/group.ts | 2 +- src/lib/transforms/interval.ts | 2 +- src/lib/transforms/jitter.ts | 2 +- src/lib/transforms/map.ts | 2 +- src/lib/transforms/normalize.ts | 2 +- src/lib/transforms/recordize.test.ts | 2 +- src/lib/transforms/recordize.ts | 7 ++++++- src/lib/transforms/rename.test.ts | 2 +- src/lib/transforms/rename.ts | 4 ++-- src/lib/transforms/select.ts | 2 +- src/lib/transforms/shift.test.ts | 2 +- src/lib/transforms/shift.ts | 2 +- src/lib/transforms/sort.test.ts | 2 +- src/lib/transforms/sort.ts | 2 +- src/lib/transforms/stack.ts | 2 +- src/lib/transforms/window.ts | 2 +- src/routes/features/markers/+page.md | 4 ++-- src/routes/marks/line/+page.md | 6 +++--- src/routes/marks/rule/+page.md | 2 +- src/routes/tests/demos/bls/+page.md | 2 +- src/routes/transforms/interval/+page.md | 4 ++-- 46 files changed, 59 insertions(+), 54 deletions(-) diff --git a/src/lib/constants.ts b/src/lib/constants.ts index 81ddb142..a874f228 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -1,4 +1,4 @@ -import type { ScaleName, ScaleType, ScaledChannelName } from './types.js'; +import type { ScaleName, ScaleType, ScaledChannelName } from './types/index.js'; export const SCALE_TYPES: Record = { opacity: Symbol('opacity'), diff --git a/src/lib/helpers/autoScales.ts b/src/lib/helpers/autoScales.ts index b83272fb..893ec787 100644 --- a/src/lib/helpers/autoScales.ts +++ b/src/lib/helpers/autoScales.ts @@ -32,7 +32,7 @@ import type { ScaleName, ScaleOptions, ScaleType -} from '../types.js'; +} from '../types/index.js'; import { categoricalSchemes, isCategoricalScheme, diff --git a/src/lib/helpers/autoTicks.ts b/src/lib/helpers/autoTicks.ts index 2f597778..ef77a306 100644 --- a/src/lib/helpers/autoTicks.ts +++ b/src/lib/helpers/autoTicks.ts @@ -1,4 +1,4 @@ -import type { RawValue, ScaleType } from '$lib/types.js'; +import type { RawValue, ScaleType } from '$lib/types/index.js'; import { maybeTimeInterval } from './time.js'; import { extent, range as rangei } from 'd3-array'; diff --git a/src/lib/helpers/callWithProps.ts b/src/lib/helpers/callWithProps.ts index 25d707fb..3923aa51 100644 --- a/src/lib/helpers/callWithProps.ts +++ b/src/lib/helpers/callWithProps.ts @@ -1,4 +1,4 @@ -import type { RawValue } from '$lib/types.js'; +import type { RawValue } from '$lib/types/index.js'; type Setter = (v: any) => void; diff --git a/src/lib/helpers/colors.ts b/src/lib/helpers/colors.ts index 42315521..60dd356f 100644 --- a/src/lib/helpers/colors.ts +++ b/src/lib/helpers/colors.ts @@ -77,7 +77,7 @@ import { } from 'd3-scale-chromatic'; import { quantize } from 'd3-interpolate'; -import type { ColorScheme } from '$lib/types.js'; +import type { ColorScheme } from '$lib/types/index.js'; const schemeObservable10 = [ '#4269d0', diff --git a/src/lib/helpers/curves.ts b/src/lib/helpers/curves.ts index 4546092c..47dc56b6 100644 --- a/src/lib/helpers/curves.ts +++ b/src/lib/helpers/curves.ts @@ -1,4 +1,4 @@ -import type { Curve } from '../types.js'; +import type { Curve } from '../types/index.js'; import { curveBasis, curveBasisClosed, diff --git a/src/lib/helpers/facets.ts b/src/lib/helpers/facets.ts index 8ed7f1b5..a3789030 100644 --- a/src/lib/helpers/facets.ts +++ b/src/lib/helpers/facets.ts @@ -1,4 +1,4 @@ -import type { GenericMarkOptions, Mark, RawValue } from '$lib/types.js'; +import type { GenericMarkOptions, Mark, RawValue } from '$lib/types/index.js'; import { resolveChannel } from './resolve.js'; /** diff --git a/src/lib/helpers/getBaseStyles.ts b/src/lib/helpers/getBaseStyles.ts index 8b803464..81e291e8 100644 --- a/src/lib/helpers/getBaseStyles.ts +++ b/src/lib/helpers/getBaseStyles.ts @@ -1,5 +1,5 @@ -import type { Channels } from '$lib/types.js'; -import type { MarkStyleProps, DataRow } from '$lib/types.js'; +import type { Channels } from '$lib/types/index.js'; +import type { MarkStyleProps, DataRow } from '$lib/types/index.js'; import { resolveProp } from './resolve.js'; /** diff --git a/src/lib/helpers/group.ts b/src/lib/helpers/group.ts index e6664932..072ea676 100644 --- a/src/lib/helpers/group.ts +++ b/src/lib/helpers/group.ts @@ -1,5 +1,5 @@ import { resolveChannel } from '$lib/helpers/resolve.js'; -import type { ChannelName, Channels, DataRecord } from '$lib/types.js'; +import type { ChannelName, Channels, DataRecord } from '$lib/types/index.js'; import { groups as d3Groups } from 'd3-array'; /** diff --git a/src/lib/helpers/index.ts b/src/lib/helpers/index.ts index 7f51116e..8865f648 100644 --- a/src/lib/helpers/index.ts +++ b/src/lib/helpers/index.ts @@ -1,4 +1,4 @@ -import type { ChannelAccessor, ChannelName, DataRecord, RawValue } from '$lib/types.js'; +import type { ChannelAccessor, ChannelName, DataRecord, RawValue } from '$lib/types/index.js'; import type { Snippet } from 'svelte'; import { resolveProp } from './resolve.js'; import { isDate } from '$lib/helpers/typeChecks.js'; diff --git a/src/lib/helpers/isDataRecord.ts b/src/lib/helpers/isDataRecord.ts index d45d2f81..12505e57 100644 --- a/src/lib/helpers/isDataRecord.ts +++ b/src/lib/helpers/isDataRecord.ts @@ -1,4 +1,4 @@ -import type { DataRecord } from '../types.js'; +import type { DataRecord } from '../types/index.js'; export default function (value: any): value is DataRecord { if (typeof value !== 'object' || value === null) return false; diff --git a/src/lib/helpers/isRawValue.ts b/src/lib/helpers/isRawValue.ts index 8109e8c1..065a2a78 100644 --- a/src/lib/helpers/isRawValue.ts +++ b/src/lib/helpers/isRawValue.ts @@ -1,4 +1,4 @@ -import type { RawValue } from '$lib/types.js'; +import type { RawValue } from '$lib/types/index.js'; import { isDate } from '$lib/helpers/typeChecks.js'; export default function (value: any): value is RawValue { diff --git a/src/lib/helpers/reduce.test.ts b/src/lib/helpers/reduce.test.ts index 2ff3e409..798f5307 100644 --- a/src/lib/helpers/reduce.test.ts +++ b/src/lib/helpers/reduce.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from 'vitest'; import { reduceOutputs, type ReducerName } from './reduce.js'; -import type { ChannelAccessor, ChannelName } from '$lib/types.js'; +import type { ChannelAccessor, ChannelName } from '$lib/types/index.js'; describe('reduceOutputs', () => { it('should correctly reduce outputs', () => { diff --git a/src/lib/helpers/reduce.ts b/src/lib/helpers/reduce.ts index fdfa65d0..479e4c81 100644 --- a/src/lib/helpers/reduce.ts +++ b/src/lib/helpers/reduce.ts @@ -1,4 +1,4 @@ -import type { ChannelName, Channels, DataRecord, DataRow, RawValue } from '$lib/types.js'; +import type { ChannelName, Channels, DataRecord, DataRow, RawValue } from '$lib/types/index.js'; import { min, max, mode, sum, mean, median, variance, deviation, quantile } from 'd3-array'; import { resolveChannel } from './resolve.js'; import { POSITION_CHANNELS } from './index.js'; diff --git a/src/lib/helpers/regressionLoess.ts b/src/lib/helpers/regressionLoess.ts index ac8a64ef..d2ab3914 100644 --- a/src/lib/helpers/regressionLoess.ts +++ b/src/lib/helpers/regressionLoess.ts @@ -1,4 +1,4 @@ -import type { DataRow } from '$lib/types.js'; +import type { DataRow } from '$lib/types/index.js'; import Loess from 'loess'; type AccessorFn = (d: any) => number; diff --git a/src/lib/helpers/resolve.ts b/src/lib/helpers/resolve.ts index 6a24e2a5..59694ec7 100644 --- a/src/lib/helpers/resolve.ts +++ b/src/lib/helpers/resolve.ts @@ -1,7 +1,7 @@ import { CHANNEL_SCALE } from '$lib/constants.js'; import isDataRecord from '$lib/helpers/isDataRecord.js'; import isRawValue from '$lib/helpers/isRawValue.js'; -import type { MarkStyleProps, PlotState, ScaledDataRecord } from '$lib/types.js'; +import type { MarkStyleProps, PlotState, ScaledDataRecord } from '$lib/types/index.js'; import { isValid } from './isValid.js'; import type { @@ -13,7 +13,7 @@ import type { RawValue, DataRecord, ConstantAccessor -} from '../types.js'; +} from '../types/index.js'; import { getBaseStylesObject } from './getBaseStyles.js'; import { RAW_VALUE } from 'svelteplot/transforms/recordize.js'; diff --git a/src/lib/helpers/scales.ts b/src/lib/helpers/scales.ts index d8e01723..2596e13d 100644 --- a/src/lib/helpers/scales.ts +++ b/src/lib/helpers/scales.ts @@ -25,7 +25,7 @@ import type { ScaleType, ScaledChannelName, UsedScales -} from '../types.js'; +} from '../types/index.js'; import isDataRecord from './isDataRecord.js'; import { createProjection } from './projection.js'; diff --git a/src/lib/helpers/typeChecks.ts b/src/lib/helpers/typeChecks.ts index 8d2f985c..f726937f 100644 --- a/src/lib/helpers/typeChecks.ts +++ b/src/lib/helpers/typeChecks.ts @@ -1,4 +1,4 @@ -import type { RawValue } from '$lib/types.js'; +import type { RawValue } from '$lib/types/index.js'; import { isSymbol } from './symbols.js'; import { color } from 'd3-color'; import { diff --git a/src/lib/marks/helpers/events.ts b/src/lib/marks/helpers/events.ts index 044eb28e..5da2342b 100644 --- a/src/lib/marks/helpers/events.ts +++ b/src/lib/marks/helpers/events.ts @@ -1,4 +1,4 @@ -import type { BaseMarkProps, DataRecord, PlotScale, PlotState } from '$lib/types.js'; +import type { BaseMarkProps, DataRecord, PlotScale, PlotState } from '$lib/types/index.js'; import type { MouseEventHandler } from 'svelte/elements'; import { pick } from 'es-toolkit'; import { RAW_VALUE } from '$lib/transforms/recordize.js'; diff --git a/src/lib/transforms/bin.ts b/src/lib/transforms/bin.ts index 0c75331a..b24a1826 100644 --- a/src/lib/transforms/bin.ts +++ b/src/lib/transforms/bin.ts @@ -1,6 +1,6 @@ import { resolveChannel } from '$lib/helpers/resolve.js'; -import type { DataRecord, RawValue } from '$lib/types.js'; -import type { TransformArg } from '$lib/types.js'; +import type { DataRecord, RawValue } from '$lib/types/index.js'; +import type { TransformArg } from '$lib/types/index.js'; import { maybeInterval } from '$lib/helpers/autoTicks.js'; import { bin as d3Bin, diff --git a/src/lib/transforms/bollinger.ts b/src/lib/transforms/bollinger.ts index 7ebf6aae..6624b77b 100644 --- a/src/lib/transforms/bollinger.ts +++ b/src/lib/transforms/bollinger.ts @@ -1,5 +1,5 @@ import { resolveChannel } from '$lib/helpers/resolve.js'; -import type { DataRecord, TransformArg } from '$lib/types.js'; +import type { DataRecord, TransformArg } from '$lib/types/index.js'; export type BollingerOptions = { /** diff --git a/src/lib/transforms/centroid.ts b/src/lib/transforms/centroid.ts index c12f2d5a..12b5160c 100644 --- a/src/lib/transforms/centroid.ts +++ b/src/lib/transforms/centroid.ts @@ -1,5 +1,5 @@ import { resolveProp } from '$lib/helpers/resolve.js'; -import type { DataRecord, TransformArg } from '$lib/types.js'; +import type { DataRecord, TransformArg } from '$lib/types/index.js'; import { geoCentroid as d3GeoCentroid } from 'd3-geo'; import type { Channels } from 'svelteplot/types'; diff --git a/src/lib/transforms/facet.ts b/src/lib/transforms/facet.ts index 61951ab2..234521b3 100644 --- a/src/lib/transforms/facet.ts +++ b/src/lib/transforms/facet.ts @@ -1 +1 @@ -import type { DataRecord, TransformArg } from '$lib/types.js'; +import type { DataRecord, TransformArg } from '$lib/types/index.js'; diff --git a/src/lib/transforms/filter.ts b/src/lib/transforms/filter.ts index 8a4dd7c5..feebe361 100644 --- a/src/lib/transforms/filter.ts +++ b/src/lib/transforms/filter.ts @@ -1,5 +1,5 @@ import { testFilter } from '$lib/helpers/index.js'; -import type { DataRecord, TransformArg } from '$lib/types.js'; +import type { DataRecord, TransformArg } from '$lib/types/index.js'; export function filter({ data, ...channels }: TransformArg): TransformArg { return { diff --git a/src/lib/transforms/group.test.ts b/src/lib/transforms/group.test.ts index 60f97f4a..d15d6c31 100644 --- a/src/lib/transforms/group.test.ts +++ b/src/lib/transforms/group.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from 'vitest'; import { group, groupX, groupY, groupZ } from './group.js'; -import type { DataRecord } from '$lib/types.js'; +import type { DataRecord } from '$lib/types/index.js'; import { csvParse } from 'd3-dsv'; import { readFileSync } from 'fs'; diff --git a/src/lib/transforms/group.ts b/src/lib/transforms/group.ts index 877ccb46..4a5aa378 100644 --- a/src/lib/transforms/group.ts +++ b/src/lib/transforms/group.ts @@ -2,7 +2,7 @@ import { groupFacetsAndZ } from '$lib/helpers/group.js'; import { testFilter } from '$lib/helpers/index.js'; import { reduceOutputs, type ReducerName } from '$lib/helpers/reduce.js'; import { resolveChannel } from '$lib/helpers/resolve.js'; -import type { DataRecord, DataRow, RawValue, TransformArg } from '$lib/types.js'; +import type { DataRecord, DataRow, RawValue, TransformArg } from '$lib/types/index.js'; import { groups as d3Groups } from 'd3-array'; import { omit } from '$lib/helpers/index.js'; import { maybeInterval } from '$lib/helpers/autoTicks.js'; diff --git a/src/lib/transforms/interval.ts b/src/lib/transforms/interval.ts index c410306b..9202053a 100644 --- a/src/lib/transforms/interval.ts +++ b/src/lib/transforms/interval.ts @@ -1,6 +1,6 @@ import { maybeInterval } from '$lib/helpers/autoTicks.js'; import { resolveChannel } from '$lib/helpers/resolve.js'; -import type { PlotState, TransformArg } from '$lib/types.js'; +import type { PlotState, TransformArg } from '$lib/types/index.js'; export function intervalX(args: TransformArg, { plot }: { plot: PlotState }) { return interval('x', plot, args); diff --git a/src/lib/transforms/jitter.ts b/src/lib/transforms/jitter.ts index d362f22d..dddb4111 100644 --- a/src/lib/transforms/jitter.ts +++ b/src/lib/transforms/jitter.ts @@ -1,4 +1,4 @@ -import type { Channels, DataRecord, TransformArg } from '$lib/types.js'; +import type { Channels, DataRecord, TransformArg } from '$lib/types/index.js'; import { resolveChannel } from '$lib/helpers/resolve.js'; import { randomUniform, randomNormal } from 'd3-random'; import { isDate } from '$lib/helpers/typeChecks.js'; diff --git a/src/lib/transforms/map.ts b/src/lib/transforms/map.ts index 650fbfe6..68daa67b 100644 --- a/src/lib/transforms/map.ts +++ b/src/lib/transforms/map.ts @@ -7,7 +7,7 @@ import type { MapMethod, DataRecord, Channels -} from '$lib/types.js'; +} from '$lib/types/index.js'; import { count, rank } from 'd3-array'; import { groupFacetsAndZ } from '$lib/helpers/group.js'; import { resolveChannel } from '$lib/helpers/resolve.js'; diff --git a/src/lib/transforms/normalize.ts b/src/lib/transforms/normalize.ts index f011f85f..9d7dd6ee 100644 --- a/src/lib/transforms/normalize.ts +++ b/src/lib/transforms/normalize.ts @@ -1,5 +1,5 @@ import { mapX, mapY } from './map.js'; -import type { TransformArg, RawValue, MapIndexObject } from '$lib/types.js'; +import type { TransformArg, RawValue, MapIndexObject } from '$lib/types/index.js'; import { min, max, mean, median, sum, deviation, extent } from 'd3-array'; type NormalizeBasis = diff --git a/src/lib/transforms/recordize.test.ts b/src/lib/transforms/recordize.test.ts index 5715cd4f..760872d7 100644 --- a/src/lib/transforms/recordize.test.ts +++ b/src/lib/transforms/recordize.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from 'vitest'; import { recordizeXY, RAW_VALUE } from './recordize.js'; -import type { RawValue } from '$lib/types.js'; +import type { RawValue } from '$lib/types/index.js'; const coordsArray: [RawValue, RawValue][] = [ [0, 4], diff --git a/src/lib/transforms/recordize.ts b/src/lib/transforms/recordize.ts index b5125ae0..d1c40cc0 100644 --- a/src/lib/transforms/recordize.ts +++ b/src/lib/transforms/recordize.ts @@ -1,5 +1,10 @@ import isDataRecord from '$lib/helpers/isDataRecord.js'; -import type { DataRecord, TransformArgsRow, TransformArgsRecord, RawValue } from '$lib/types.js'; +import type { + DataRecord, + TransformArgsRow, + TransformArgsRecord, + RawValue +} from '$lib/types/index.js'; export const INDEX = Symbol('index'); export const RAW_VALUE = Symbol('originalValue'); diff --git a/src/lib/transforms/rename.test.ts b/src/lib/transforms/rename.test.ts index dfe06725..1472c463 100644 --- a/src/lib/transforms/rename.test.ts +++ b/src/lib/transforms/rename.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from 'vitest'; import { renameChannels } from './rename.js'; -import type { DataRecord } from '$lib/types.js'; +import type { DataRecord } from '$lib/types/index.js'; const inputData: DataRecord[] = [ { year: 2000, facet: 'A', value: 10 }, diff --git a/src/lib/transforms/rename.ts b/src/lib/transforms/rename.ts index 73251fe1..292ec920 100644 --- a/src/lib/transforms/rename.ts +++ b/src/lib/transforms/rename.ts @@ -1,5 +1,5 @@ -import type { DataRecord } from '$lib/types.js'; -import type { ScaledChannelName, TransformArg } from '$lib/types.js'; +import type { DataRecord } from '$lib/types/index.js'; +import type { ScaledChannelName, TransformArg } from '$lib/types/index.js'; type RenameChannelsOptions = Partial>; type ReplaceChannelsOptions = Partial>; diff --git a/src/lib/transforms/select.ts b/src/lib/transforms/select.ts index 5cc4c762..09ee8957 100644 --- a/src/lib/transforms/select.ts +++ b/src/lib/transforms/select.ts @@ -1,6 +1,6 @@ import { groupFacetsAndZ } from '$lib/helpers/group.js'; import { resolveChannel } from '$lib/helpers/resolve.js'; -import type { ChannelName, DataRecord, TransformArg } from '$lib/types.js'; +import type { ChannelName, DataRecord, TransformArg } from '$lib/types/index.js'; type AtLeastOne }> = Partial & U[keyof U]; diff --git a/src/lib/transforms/shift.test.ts b/src/lib/transforms/shift.test.ts index e5569886..78cfd1ce 100644 --- a/src/lib/transforms/shift.test.ts +++ b/src/lib/transforms/shift.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from 'vitest'; import { shiftX, shiftY } from './shift.js'; -import type { DataRecord } from '$lib/types.js'; +import type { DataRecord } from '$lib/types/index.js'; describe('shiftX', () => { it('should shift the x values by a number', () => { diff --git a/src/lib/transforms/shift.ts b/src/lib/transforms/shift.ts index 53bc35b8..271977d2 100644 --- a/src/lib/transforms/shift.ts +++ b/src/lib/transforms/shift.ts @@ -1,6 +1,6 @@ import { resolveChannel } from '$lib/helpers/resolve.js'; import { maybeTimeInterval } from '$lib/helpers/time.js'; -import type { DataRecord, TransformArg } from '$lib/types.js'; +import type { DataRecord, TransformArg } from '$lib/types/index.js'; type RequireAtLeastOne = Pick> & { diff --git a/src/lib/transforms/sort.test.ts b/src/lib/transforms/sort.test.ts index 4799e026..ef0d313d 100644 --- a/src/lib/transforms/sort.test.ts +++ b/src/lib/transforms/sort.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from 'vitest'; import { sort, shuffle } from './sort.js'; -import type { DataRecord } from '$lib/types.js'; +import type { DataRecord } from '$lib/types/index.js'; const data: DataRecord[] = [ { A: 1, B: 7 }, diff --git a/src/lib/transforms/sort.ts b/src/lib/transforms/sort.ts index 1278cb13..f2c93fe1 100644 --- a/src/lib/transforms/sort.ts +++ b/src/lib/transforms/sort.ts @@ -1,6 +1,6 @@ import isDataRecord from '$lib/helpers/isDataRecord.js'; import { resolveChannel } from '$lib/helpers/resolve.js'; -import type { DataRecord, DataRow, TransformArg } from '$lib/types.js'; +import type { DataRecord, DataRow, TransformArg } from '$lib/types/index.js'; import { shuffler } from 'd3-array'; import { randomLcg } from 'd3-random'; diff --git a/src/lib/transforms/stack.ts b/src/lib/transforms/stack.ts index fc0c7f80..4e35317f 100644 --- a/src/lib/transforms/stack.ts +++ b/src/lib/transforms/stack.ts @@ -7,7 +7,7 @@ import type { DataRecord, TransformArg, ChannelName -} from '$lib/types.js'; +} from '$lib/types/index.js'; import { stack, stackOffsetExpand, diff --git a/src/lib/transforms/window.ts b/src/lib/transforms/window.ts index d3585205..f76b0e3d 100644 --- a/src/lib/transforms/window.ts +++ b/src/lib/transforms/window.ts @@ -2,7 +2,7 @@ import { maybeInterval } from '$lib/helpers/autoTicks.js'; import { isValid } from '$lib/helpers/index.js'; import { mayberReducer, type ReducerName } from '$lib/helpers/reduce.js'; import { resolveChannel } from '$lib/helpers/resolve.js'; -import type { DataRecord, ScaledChannelName, TransformArg } from '$lib/types.js'; +import type { DataRecord, ScaledChannelName, TransformArg } from '$lib/types/index.js'; import { groups as d3Groups } from 'd3-array'; type WindowOptions = { diff --git a/src/routes/features/markers/+page.md b/src/routes/features/markers/+page.md index 87f690a3..a4c724fa 100644 --- a/src/routes/features/markers/+page.md +++ b/src/routes/features/markers/+page.md @@ -88,7 +88,7 @@ Note that for the interpolation methods `basis`, `bundle`, and `step`, the marke import { Plot, LineY, Dot } from 'svelteplot'; import Slider from '$lib/ui/Slider.svelte'; import Select from '$lib/ui/Select.svelte'; - import type { CurveName } from '$lib/types.js'; + import type { CurveName } from '$lib/types/index.js'; // curve demo const numbers = [ @@ -134,7 +134,7 @@ You can also specify a custom marker icon using the `marker` snippet: ```svelte live diff --git a/src/routes/marks/rule/+page.md b/src/routes/marks/rule/+page.md index be0ee46e..3facc9e7 100644 --- a/src/routes/marks/rule/+page.md +++ b/src/routes/marks/rule/+page.md @@ -39,7 +39,7 @@ Like most other marks, rules also accept data for displaying multiple lines at o ```svelte live @@ -17,7 +18,6 @@ tickSize={0} tickPadding={0} dy={-5} - title={false} lineAnchor="bottom" textAnchor="start" /> From 188987c23b0eb393f379f92bde2717ea8daffa95 Mon Sep 17 00:00:00 2001 From: gka Date: Wed, 18 Jun 2025 08:53:38 +0200 Subject: [PATCH 05/17] fix default axis opacity --- src/lib/marks/AxisX.svelte | 1 + src/lib/marks/AxisY.svelte | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/marks/AxisX.svelte b/src/lib/marks/AxisX.svelte index 28de621c..a3400ebb 100644 --- a/src/lib/marks/AxisX.svelte +++ b/src/lib/marks/AxisX.svelte @@ -58,6 +58,7 @@ tickPadding: 3, tickFontSize: 11, titleFontSize: 11, + opacity: 0.8, anchor: 'bottom', ...getContext('svelteplot/_defaults').axis, ...getContext('svelteplot/_defaults').axisX diff --git a/src/lib/marks/AxisY.svelte b/src/lib/marks/AxisY.svelte index 382a28da..5e8eb44f 100644 --- a/src/lib/marks/AxisY.svelte +++ b/src/lib/marks/AxisY.svelte @@ -58,6 +58,7 @@ tickSize: 6, tickPadding: 3, tickFontSize: 11, + opacity: 0.8, anchor: 'left', textAnchor: 'auto', ...getContext('svelteplot/_defaults').axis, @@ -196,7 +197,7 @@ x={anchor === 'left' ? 0 : plot.width} y={5} class="axis-x-title" - dominant-baseline="hanging">{options.opacity}-{useTitle} + dominant-baseline="hanging">{useTitle} {/if} {#if showAxis} Date: Wed, 18 Jun 2025 08:55:26 +0200 Subject: [PATCH 06/17] update screenshots --- static/examples/area/area-x.dark.png | Bin 32766 -> 32776 bytes static/examples/area/area-x.png | Bin 31941 -> 31937 bytes static/examples/area/area-y.dark.png | Bin 44925 -> 44895 bytes static/examples/area/area-y.png | Bin 43446 -> 43473 bytes static/examples/area/area.dark.png | Bin 32259 -> 32266 bytes static/examples/area/area.png | Bin 31504 -> 31520 bytes static/examples/area/streamgraph.dark.png | Bin 49746 -> 49739 bytes static/examples/area/streamgraph.png | Bin 49331 -> 49334 bytes static/examples/arrow/metro.dark.png | Bin 239849 -> 239564 bytes static/examples/arrow/metro.png | Bin 240370 -> 239404 bytes .../examples/axis/datawrapper-ticks.dark.png | Bin 44690 -> 44710 bytes static/examples/axis/datawrapper-ticks.png | Bin 43325 -> 43330 bytes static/examples/axis/major-minor.dark.png | Bin 40680 -> 40724 bytes static/examples/axis/major-minor.png | Bin 39422 -> 39426 bytes static/examples/axis/tick-count.dark.png | Bin 43143 -> 43151 bytes static/examples/axis/tick-count.png | Bin 41831 -> 41824 bytes static/examples/axis/tick-interval.dark.png | Bin 36467 -> 36473 bytes static/examples/axis/tick-interval.png | Bin 35198 -> 35218 bytes static/examples/axis/tick-spacing.dark.png | Bin 51758 -> 51779 bytes static/examples/axis/tick-spacing.png | Bin 50282 -> 50272 bytes static/examples/axis/ticks-inside.dark.png | Bin 35087 -> 37222 bytes static/examples/axis/ticks-inside.png | Bin 33798 -> 35959 bytes static/examples/bar/defaults.dark.png | Bin 10969 -> 11179 bytes static/examples/bar/defaults.png | Bin 10637 -> 10890 bytes static/examples/bar/linked-bars.dark.png | Bin 10826 -> 10813 bytes static/examples/bar/linked-bars.png | Bin 10761 -> 10759 bytes static/examples/bar/shuffled-bars.dark.png | Bin 36425 -> 36493 bytes static/examples/bar/shuffled-bars.png | Bin 36418 -> 36489 bytes static/examples/brush/constrained.dark.png | Bin 78055 -> 78057 bytes static/examples/brush/constrained.png | Bin 76193 -> 76206 bytes static/examples/brush/filter.dark.png | Bin 78055 -> 78057 bytes static/examples/brush/filter.png | Bin 76193 -> 76206 bytes .../examples/brush/overview-detail.dark.png | Bin 45794 -> 45767 bytes static/examples/brush/overview-detail.png | Bin 44795 -> 44792 bytes .../examples/brush/zoomable-scatter.dark.png | Bin 75172 -> 75180 bytes static/examples/brush/zoomable-scatter.png | Bin 74626 -> 74644 bytes static/examples/cell/simpsons.dark.png | Bin 521403 -> 521333 bytes static/examples/cell/simpsons.png | Bin 529621 -> 529542 bytes static/examples/cell/temperatures.dark.png | Bin 59885 -> 59912 bytes static/examples/cell/temperatures.png | Bin 59651 -> 59689 bytes static/examples/custom/custom-svg.dark.png | Bin 557813 -> 557695 bytes static/examples/custom/custom-svg.png | Bin 530761 -> 531173 bytes static/examples/dot/0-scatterplot.dark.png | Bin 72459 -> 72448 bytes static/examples/dot/0-scatterplot.png | Bin 67674 -> 67722 bytes .../dot/1-colored-scatterplot.dark.png | Bin 80506 -> 80489 bytes static/examples/dot/1-colored-scatterplot.png | Bin 77635 -> 77630 bytes static/examples/dot/2-symbol-channel.dark.png | Bin 82240 -> 82267 bytes static/examples/dot/2-symbol-channel.png | Bin 81580 -> 81612 bytes static/examples/dot/3-dot-plot.dark.png | Bin 92838 -> 92866 bytes static/examples/dot/3-dot-plot.png | Bin 92532 -> 92606 bytes static/examples/dot/bubble-matrix.dark.png | Bin 37974 -> 37958 bytes static/examples/dot/bubble-matrix.png | Bin 36290 -> 36298 bytes static/examples/geo/inset-aspect.png | Bin 33194 -> 33220 bytes .../geo/us-choropleth-canvas.dark.png | Bin 174246 -> 174241 bytes static/examples/geo/us-choropleth-canvas.png | Bin 168514 -> 169308 bytes static/examples/geo/us-choropleth.dark.png | Bin 128654 -> 128654 bytes static/examples/geo/us-choropleth.png | Bin 126167 -> 126168 bytes .../examples/grid/clipped-gridlines.dark.png | Bin 38828 -> 38823 bytes static/examples/grid/clipped-gridlines.png | Bin 37692 -> 37699 bytes static/examples/line/apple-stock.dark.png | Bin 37493 -> 37504 bytes static/examples/line/apple-stock.png | Bin 36204 -> 36209 bytes static/examples/line/gradient-line.dark.png | Bin 53093 -> 53052 bytes static/examples/line/gradient-line.png | Bin 50928 -> 50899 bytes static/examples/line/line-grouping.dark.png | Bin 36225 -> 36232 bytes static/examples/line/line-grouping.png | Bin 36192 -> 36183 bytes static/examples/line/tour-de-france.dark.png | Bin 49958 -> 49955 bytes static/examples/line/tour-de-france.png | Bin 48724 -> 48756 bytes static/examples/link/metros.dark.png | Bin 329151 -> 329154 bytes static/examples/link/metros.png | Bin 353604 -> 353589 bytes static/examples/rect/simple-rects.dark.png | Bin 15396 -> 15392 bytes static/examples/rect/simple-rects.png | Bin 15322 -> 15344 bytes static/examples/rect/stacked-rectx.dark.png | Bin 20066 -> 20048 bytes static/examples/rect/stacked-rectx.png | Bin 19880 -> 19914 bytes static/examples/rect/stacked-recty.dark.png | Bin 20291 -> 20283 bytes static/examples/rect/stacked-recty.png | Bin 20127 -> 20150 bytes static/examples/regression/cars.dark.png | Bin 81405 -> 81386 bytes static/examples/regression/cars.png | Bin 81098 -> 81112 bytes static/examples/regression/faceted.dark.png | Bin 85046 -> 83257 bytes static/examples/regression/faceted.png | Bin 83141 -> 81274 bytes static/examples/regression/grouped.dark.png | Bin 89952 -> 89945 bytes static/examples/regression/grouped.png | Bin 88426 -> 88428 bytes static/examples/regression/loess.dark.png | Bin 70288 -> 70232 bytes static/examples/regression/loess.png | Bin 69927 -> 69896 bytes static/examples/regression/log.dark.png | Bin 74539 -> 74539 bytes static/examples/regression/log.png | Bin 74202 -> 74217 bytes static/examples/rule/data-rules.dark.png | Bin 24761 -> 22288 bytes static/examples/rule/data-rules.png | Bin 24707 -> 22285 bytes static/examples/rule/min-max.dark.png | Bin 34872 -> 34876 bytes static/examples/rule/min-max.png | Bin 34546 -> 34535 bytes static/examples/rule/y-baseline.dark.png | Bin 36861 -> 36864 bytes static/examples/rule/y-baseline.png | Bin 35655 -> 35655 bytes 91 files changed, 0 insertions(+), 0 deletions(-) diff --git a/static/examples/area/area-x.dark.png b/static/examples/area/area-x.dark.png index 6e7a7bd1f4d6eb55218014ec54bd85054f1f45d3..e210174e6d3c7c33be8729ca98231fd4ccca3360 100644 GIT binary patch literal 32776 zcmcG$cUV(d*Z&QoFg6$)AP{iI5d;K8dT1&N(os;9s-Pesgh1%kinO32y(wK#5GkPq zP$2|FYUrUTkrJw*ciw$coSFN%uix)^-|Kq+iiVSOc3Erfy*~T9POyQV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