-
-
Notifications
You must be signed in to change notification settings - Fork 13
feature: add jitterX and jitterY transforms #65
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
Conversation
✅ Deploy Preview for svelteplot ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds new jitter transforms (jitterX and jitterY) to SveltePlot to reduce overplotting, along with documentation improvements, updated type annotations, and helper function updates for time and date handling. Key changes include:
- Implementation of the jitter transform using both uniform and normal distributions.
- Creation of new documentation pages and sidebar entries for the jitter transform.
- Updates to type checking and time helper functions for better type safety.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/routes/transforms/jitter/+page.ts | Adds a loader to fetch example datasets for the jitter page. |
src/routes/transforms/jitter/+page.md | New documentation explaining jitter transform usage. |
src/routes/transforms/interval/+page.md | Minor update: removal of an unused import. |
src/routes/transforms/bolliner/+page.md | Added a placeholder page for the Bollinger transform. |
src/routes/features/transforms/+page.md | Updates the list of available transforms to include jitter. |
src/lib/transforms/jitter.ts | Implements jitterX and jitterY transforms with random noise. |
src/lib/transforms/jitter.test.ts | Adds tests for jitter transform functionality. |
src/lib/transforms/index.ts | Exports the new jitter transforms for external use. |
src/lib/helpers/typeChecks.ts | Updates the isDate function to use a TypeScript type guard. |
src/lib/helpers/time.ts | Updates type annotations and exports durations and interval functions. |
config/sidebar.ts | Adds a sidebar entry for the jitter transform. |
Comments suppressed due to low confidence (1)
src/lib/transforms/jitter.test.ts:101
- [nitpick] The jitterY test uses a channel key 'y' with a value 'x', which may be confusing. Consider using a consistent naming convention (e.g., { data, y: 'y' }) to clarify that the jitter is applied to the y-axis.
const result = jitterY({ data, y: 'x' }, { source: mockRandom });
📦 Preview package for this PR is published! Version: Install it with: npm install svelteplot@pr-65
# or install the specific version
npm install svelteplot@0.2.7-pr-65.2 |
demo
This pull request introduces a new jitter transform to SveltePlot, along with related updates to documentation, type definitions, and helper functions.
The jitter transform adds random noise in data space, which is useful for reducing overplotting in visualizations. Additionally, various type annotations and exports have been updated for improved code clarity and maintainability.
New
jitter
Transform:jitterX
andjitterY
functions to implement thejitter
transform, which supports both uniform and normal distributions. These functions include options for width, standard deviation, and handling temporal data (src/lib/transforms/jitter.ts
).jitterX
andjitterY
fromsrc/lib/transforms/index.ts
for external use.jitter
transform inconfig/sidebar.ts
.Documentation Updates:
jitter
transform, explaining its usage, options, and examples for numeric and temporal data (src/routes/transforms/jitter/+page.md
).jitter
page to fetch example datasets (src/routes/transforms/jitter/+page.ts
).jitter
(src/routes/features/transforms/+page.md
).Type Annotations and Helper Updates:
src/lib/helpers/time.ts
, includingparseTimeInterval
,maybeTimeInterval
, andasInterval
. These updates improve type safety and clarity. [1] [2] [3]isDate
function insrc/lib/helpers/typeChecks.ts
to use a TypeScript type guard, improving type inference.Open issues