Skip to content

Remove some unused imports #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/lib/core/Facet.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<script lang="ts">
import { setContext, type Snippet } from 'svelte';
import { resolveChannel } from '../helpers/resolve.js';
import type { BaseMarkProps, DataRecord, PlotScale, RawValue } from '../types.js';
import { identity } from '$lib/helpers';
import type { BaseMarkProps, DataRecord, RawValue } from '../types.js';

let {
fx,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/core/FacetGrid.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
marks for each facet domain value
-->
<script lang="ts">
import { getContext, setContext, type Snippet } from 'svelte';
import { getContext, type Snippet } from 'svelte';
import type { PlotContext, GenericMarkOptions, Mark } from '../types.js';
import { scaleBand } from 'd3-scale';
import Facet from './Facet.svelte';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/helpers/facets.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { GenericMarkOptions, Mark, PlotScale, RawValue } from '$lib/types.js';
import type { GenericMarkOptions, Mark, RawValue } from '$lib/types.js';
import { resolveChannel } from './resolve.js';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/helpers/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { coalesce, isObject, pick, omit } from './index';
import { coalesce, isObject, omit } from './index';
import { describe, it, expect } from 'vitest';

describe('coalesce', () => {
Expand Down
1 change: 0 additions & 1 deletion src/lib/helpers/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type {
BaseMarkProps,
ChannelAccessor,
ChannelName,
DataRecord,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/helpers/projection.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { geoClipRectangle, geoPath, geoTransform } from 'd3-geo';

import { constant, isObject, isValid } from './index.js';
import { constant, isObject } from './index.js';

const identity = constant({ stream: (stream) => stream });

Expand Down
2 changes: 1 addition & 1 deletion src/lib/helpers/reduce.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, it, expect } from 'vitest';
import { reduceOutputs, type ReducerName } from './reduce.js';
import type { ChannelAccessor, ChannelName, RawValue } from '$lib/types.js';
import type { ChannelAccessor, ChannelName } from '$lib/types.js';

describe('reduceOutputs', () => {
it('should correctly reduce outputs', () => {
Expand Down
3 changes: 1 addition & 2 deletions src/lib/helpers/reduce.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type {
ChannelAccessor,
ChannelName,
Channels,
DataRecord,
DataRow,
RawValue
} from '$lib/types.js';
import { min, max, mode, sum, mean, median, variance, deviation, quantile, range } from 'd3-array';
import { min, max, mode, sum, mean, median, variance, deviation, quantile } from 'd3-array';
import { resolveChannel } from './resolve.js';
import { POSITION_CHANNELS } from './index.js';

Expand Down
1 change: 0 additions & 1 deletion src/lib/helpers/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import isDataRecord from '$lib/helpers/isDataRecord.js';
import isRawValue from '$lib/helpers/isRawValue.js';
import type { MarkStyleProps, PlotState, ScaledDataRecord } from '$lib/types.js';
import { isValid } from './isValid.js';
import { pick } from 'es-toolkit';

import type {
ScaleName,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/helpers/scales.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { extent, range as d3Range, ascending } from 'd3-array';
import { extent, ascending } from 'd3-array';

import {
isColorOrNull,
Expand Down
1 change: 0 additions & 1 deletion src/lib/marks/Arrow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
BaseMarkProps,
ConstantAccessor,
ChannelAccessor,
FacetContext,
RawValue
} from '../types.js';
import { resolveChannel, resolveProp, resolveStyles } from '../helpers/resolve.js';
Expand Down
2 changes: 0 additions & 2 deletions src/lib/marks/AxisY.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
PlotContext,
BaseMarkProps,
RawValue,
DataRecord,
FacetContext,
DefaultOptions
} from '../types.js';
import getBaseStyles from '$lib/helpers/getBaseStyles.js';
import autoTimeFormat from '$lib/helpers/autoTimeFormat.js';
import type { ConstantAccessor } from '$lib/types.js';
import { autoTicks } from '$lib/helpers/autoTicks.js';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/marks/CellX.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import Cell from './Cell.svelte';
import { recordizeX, recordizeY } from '$lib/index.js';
import { recordizeY } from '$lib/index.js';
import type { BaseMarkProps, DataRow, RectMarkProps } from '../types.js';
import type { ChannelAccessor } from '$lib/types.js';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/marks/ColorLegend.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { getContext } from 'svelte';
import { Plot, AxisX, Frame } from '$lib/index.js';
import { symbol as d3Symbol, symbol } from 'd3-shape';
import { symbol as d3Symbol } from 'd3-shape';
import { range as d3Range, extent } from 'd3-array';
import { maybeSymbol } from '$lib/helpers/symbols.js';

Expand Down
1 change: 0 additions & 1 deletion src/lib/marks/DifferenceY.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import type {
BaseMarkProps,
ChannelAccessor,
ConstantAccessor,
CurveName,
DataRecord,
PlotContext
Expand Down
2 changes: 1 addition & 1 deletion src/lib/marks/Dot.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import { sort } from '$lib/index.js';
import Mark from '../Mark.svelte';
import DotCanvas from './helpers/DotCanvas.svelte';
import { maybeData, testFilter, isValid } from '$lib/helpers/index.js';
import { maybeData, isValid } from '$lib/helpers/index.js';
import { recordizeXY } from '$lib/transforms/recordize.js';
import { addEventHandlers } from './helpers/events.js';

Expand Down
4 changes: 1 addition & 3 deletions src/lib/marks/Geo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
DataRecord,
PlotContext,
BaseMarkProps,
FacetContext,
ConstantAccessor,
UsedScales
ConstantAccessor
} from '../types.js';
import Mark from '../Mark.svelte';
import { geoPath } from 'd3-geo';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/marks/GridY.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { getContext } from 'svelte';
import Mark from '../Mark.svelte';
import type { PlotContext, BaseMarkProps, RawValue, DataRecord } from '../types.js';
import type { PlotContext, BaseMarkProps, RawValue } from '../types.js';
import { resolveChannel, resolveStyles } from '../helpers/resolve.js';
import { autoTicks } from '$lib/helpers/autoTicks.js';
import { testFilter } from '$lib/helpers/index.js';
Expand Down
3 changes: 0 additions & 3 deletions src/lib/marks/Rect.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,13 @@
import Mark from '../Mark.svelte';
import { getContext } from 'svelte';
import { intervalX, intervalY } from '$lib/index.js';
import { resolveProp, resolveStyles } from '../helpers/resolve.js';
import { coalesce, maybeNumber } from '../helpers/index.js';
import type {
PlotContext,
DataRecord,
BaseMarkProps,
BaseRectMarkProps,
ChannelAccessor
} from '../types.js';
import { addEventHandlers } from './helpers/events.js';
import GroupMultiple from './helpers/GroupMultiple.svelte';
import RectPath from './helpers/RectPath.svelte';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/marks/helpers/BaseAxisY.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { getContext, tick, untrack } from 'svelte';
import { getContext, untrack } from 'svelte';
import { randomId, testFilter } from '$lib/helpers/index.js';
import { resolveProp, resolveStyles } from '$lib/helpers/resolve.js';
import { max } from 'd3-array';
Expand Down
1 change: 0 additions & 1 deletion src/lib/marks/helpers/DotCanvas.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
ScaledDataRecord,
PlotContext
} from '$lib/types.js';
import { CSS_VAR } from '$lib/constants.js';
import { resolveProp } from '$lib/helpers/resolve.js';
import { maybeSymbol } from '$lib/helpers/symbols.js';
import { symbol as d3Symbol } from 'd3-shape';
Expand Down
2 changes: 1 addition & 1 deletion src/lib/marks/helpers/GeoCanvas.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
} from '$lib/types.js';
import { CSS_VAR } from '$lib/constants.js';
import { resolveProp, resolveScaledStyleProps } from '$lib/helpers/resolve.js';
import { getContext, untrack } from 'svelte';
import { getContext } from 'svelte';
import { type GeoPath } from 'd3-geo';
import CanvasLayer from './CanvasLayer.svelte';
import type { Attachment } from 'svelte/attachments';
Expand Down
4 changes: 2 additions & 2 deletions src/lib/marks/helpers/events.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { BaseMarkProps, DataRecord, PlotScale, PlotScales, PlotState } from '$lib/types.js';
import type { BaseMarkProps, DataRecord, PlotScale, PlotState } from '$lib/types.js';
import type { MouseEventHandler } from 'svelte/elements';
import { invert, pick } from 'es-toolkit';
import { pick } from 'es-toolkit';
import { RAW_VALUE } from '$lib/transforms/recordize.js';
import { INDEX } from '$lib/constants.js';

Expand Down
3 changes: 1 addition & 2 deletions src/lib/transforms/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import { maybeInterval } from '$lib/helpers/autoTicks.js';
import {
bin as d3Bin,
extent,
groups as d3Groups,
thresholdFreedmanDiaconis,
thresholdScott,
thresholdSturges,
type ThresholdCountGenerator
} from 'd3-array';
import { Reducer, reduceOutputs, type ReducerName } from '$lib/helpers/reduce.js';
import { reduceOutputs, type ReducerName } from '$lib/helpers/reduce.js';
import { groupFacetsAndZ } from '$lib/helpers/group.js';
import { isDate } from '$lib/helpers/typeChecks.js';

Expand Down
2 changes: 1 addition & 1 deletion src/lib/transforms/interval.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect, vi } from 'vitest';
import { describe, it, expect } from 'vitest';
import { intervalX, intervalY } from './interval.js';

describe('intervalX', () => {
Expand Down
4 changes: 1 addition & 3 deletions src/lib/transforms/rename.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { describe, it, expect } from 'vitest';
import { renameChannels, renameChannelsAndData, replaceChannels } from './rename.js';
import { renameChannels } from './rename.js';
import type { DataRecord } from '$lib/types.js';
import { csvParse } from 'd3-dsv';
import { readFileSync } from 'fs';

const inputData: DataRecord[] = [
{ year: 2000, facet: 'A', value: 10 },
Expand Down
2 changes: 1 addition & 1 deletion src/lib/transforms/shift.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { resolveChannel } from '$lib/helpers/resolve.js';
import { maybeTimeInterval } from '$lib/helpers/time.js';
import type { ChannelName, DataRecord, TransformArg } from '$lib/types.js';
import type { DataRecord, TransformArg } from '$lib/types.js';

type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> &
{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/transforms/window.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { maybeInterval } from '$lib/helpers/autoTicks.js';
import { isValid } from '$lib/helpers/index.js';
import { Reducer, mayberReducer, type ReducerName } from '$lib/helpers/reduce.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 { groups as d3Groups } from 'd3-array';
Expand Down
1 change: 0 additions & 1 deletion src/routes/marks/bar/BarPlot.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import { Plot, BarY, RuleY } from 'svelteplot';
import { getContext } from 'svelte';

import { page } from '$app/stores';
let { alphabet } = $derived($page.data.data);
Expand Down
1 change: 0 additions & 1 deletion src/routes/marks/bar/StackedBarPlot.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import { Plot, BarX } from 'svelteplot';
import { getContext } from 'svelte';
import { rollups } from 'd3-array';

import { page } from '$app/stores';
Expand Down
2 changes: 1 addition & 1 deletion src/routes/marks/line/CO2Decades.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { Plot, Line, Pointer, Text, RectY, RuleY, Dot, selectLast } from '$lib/index.js';
import { groups, range } from 'd3-array';
import { range } from 'd3-array';
import { page } from '$app/stores';

let { co2 } = $derived($page.data.data);
Expand Down
6 changes: 1 addition & 5 deletions src/routes/marks/rule/__+page.svelte
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
<script lang="ts">
import { Plot, Frame, Line, RuleX, RuleY } from '$lib/index.js';
import { Plot, Line, RuleX, RuleY } from '$lib/index.js';
import type { Datasets } from '$lib/types.js';
import { range } from 'd3-array';
import { getContext } from 'svelte';
import SineRules from './SineRules.svelte';
import BarcodeExample from './BarcodeExample.svelte';
import CandlestickExample from './CandlestickExample.svelte';
import { randomNormal, randomLcg } from 'd3-random';
import Code from '../../Code.svelte';

const seededNormal = randomNormal.source(randomLcg(0.1234));

const { aapl } = getContext<Datasets>('data');

type AAPL = (typeof aapl)[0];
Expand Down
4 changes: 2 additions & 2 deletions src/routes/tests/marks/ForceExample.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { Plot, Arrow, Dot, Text, LineY, RuleY } from '$lib/index.js';
import { Plot, Arrow, Dot, LineY, RuleY } from '$lib/index.js';
import { json } from 'd3-fetch';
import { range } from 'd3-array';
// import { range } from 'd3-array';
import { noise } from './noise.js';
import { forceSimulation, forceLink, forceManyBody, forceCenter } from 'd3-force';

Expand Down
2 changes: 1 addition & 1 deletion src/tests/line.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { describe, it, expect, test } from 'vitest';
import { describe, it, expect } from 'vitest';
import { render } from '@testing-library/svelte';
import LineTest from './line.test.svelte';

Expand Down
2 changes: 1 addition & 1 deletion src/tests/plot.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import { render, screen } from '@testing-library/svelte';
import { render } from '@testing-library/svelte';
import PlotTest from './plot.test.svelte';
import ResizeObserver from 'resize-observer-polyfill';

Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy