Skip to content

Commit 9046e71

Browse files
committed
format
1 parent 7a6ec51 commit 9046e71

File tree

2 files changed

+57
-57
lines changed

2 files changed

+57
-57
lines changed

.github/workflows/preview-publish.yml

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
name: Publish PR Preview Package
22

33
on:
4-
pull_request:
5-
branches: [main]
6-
4+
pull_request:
5+
branches: [main]
6+
77
jobs:
8-
publish-preview:
9-
runs-on: ubuntu-latest
10-
permissions:
11-
contents: write
12-
issues: write
13-
pull-requests: write
14-
steps:
15-
- uses: actions/checkout@v4
16-
17-
- name: Set up Node.js
18-
uses: actions/setup-node@v4
19-
with:
20-
node-version: 20
21-
registry-url: 'https://registry.npmjs.org/'
22-
23-
- name: Install dependencies
24-
run: pnpm i
25-
26-
- name: Generate preview version
27-
run: |
28-
pr_number=${{ github.event.pull_request.number }}
29-
npm version prerelease --preid=pr-${pr_number} --no-git-tag-version
30-
31-
- name: Publish to npm
32-
environment:
33-
name: npm
34-
env:
35-
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH }}
36-
run: npm publish --tag pr-${{ github.event.pull_request.number }} --access public
37-
38-
- name: Comment on PR
39-
uses: marocchino/sticky-pull-request-comment@v2
40-
with:
41-
message: |
42-
📦 Preview package for this PR is published!
43-
44-
Install it with:
45-
```bash
46-
npm install svelteplot@pr-${{ github.event.pull_request.number }}
47-
```
8+
publish-preview:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
issues: write
13+
pull-requests: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
registry-url: 'https://registry.npmjs.org/'
22+
23+
- name: Install dependencies
24+
run: pnpm i
25+
26+
- name: Generate preview version
27+
run: |
28+
pr_number=${{ github.event.pull_request.number }}
29+
npm version prerelease --preid=pr-${pr_number} --no-git-tag-version
30+
31+
- name: Publish to npm
32+
environment:
33+
name: npm
34+
env:
35+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH }}
36+
run: npm publish --tag pr-${{ github.event.pull_request.number }} --access public
37+
38+
- name: Comment on PR
39+
uses: marocchino/sticky-pull-request-comment@v2
40+
with:
41+
message: |
42+
📦 Preview package for this PR is published!
43+
44+
Install it with:
45+
```bash
46+
npm install svelteplot@pr-${{ github.event.pull_request.number }}
47+
```

src/routes/transforms/jitter/+page.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Jitter transform
33
---
44

5-
The **jitter transform** adds random noise to data points, which is useful for revealing overlapping points in scatter plots and reducing overplotting.
5+
The **jitter transform** adds random noise to data points, which is useful for revealing overlapping points in scatter plots and reducing overplotting.
66

77
:::info
88
**Note:** The jitter transform works in data coordinates. To jitter in screen coordinates, you can use the `dx` and `dy` mark properties instead.
@@ -64,26 +64,26 @@ The jitter transform spreads out overlapping points by adding random noise. This
6464
The jitter transform accepts the following options:
6565

6666
- **type**: Distribution type, either `'uniform'` (default) or `'normal'`
67-
- `uniform`: Evenly distributed points within range [-width, width]
68-
- `normal`: Normal distribution centered at 0 with standard deviation `std`
67+
- `uniform`: Evenly distributed points within range [-width, width]
68+
- `normal`: Normal distribution centered at 0 with standard deviation `std`
6969
- **width**: Width of the uniform distribution (default: `0.35`); used when `type` is `'uniform'`
70-
- For numeric data: A number representing the range on either side of the original value
71-
- For date data: A time interval string (e.g., `'1 month'`, `'2 weeks'`, `'3 days'`)
70+
- For numeric data: A number representing the range on either side of the original value
71+
- For date data: A time interval string (e.g., `'1 month'`, `'2 weeks'`, `'3 days'`)
7272
- **std**: Standard deviation for the normal distribution (default: `0.15`); used when `type` is `'normal'`
73-
- For numeric data: A number representing the standard deviation
74-
- For date data: A time interval string (e.g., `'1 month'`, `'2 weeks'`, `'3 days'`)
73+
- For numeric data: A number representing the standard deviation
74+
- For date data: A time interval string (e.g., `'1 month'`, `'2 weeks'`, `'3 days'`)
7575
- **source**: Optional random number source that produces values in range [0,1)
76-
- Useful for deterministic jittering (testing or reproducibility)
77-
- Can be used with d3's random generators: `randomLcg()` from d3-random
76+
- Useful for deterministic jittering (testing or reproducibility)
77+
- Can be used with d3's random generators: `randomLcg()` from d3-random
7878

7979
The following time interval strings are supported for temporal jittering:
80+
8081
- `'1 day'`, `'3 days'`
8182
- `'1 week'`, `'2 weeks'`, `'3 weeks'`
82-
- `'1 month'`, `'2 months'`
83+
- `'1 month'`, `'2 months'`
8384
- `'1 quarter'`
8485
- `'1 year'`
8586

86-
8787
## jitterX
8888

8989
Jitters along the x dimension:
@@ -108,7 +108,6 @@ Jitters along the y dimension:
108108
)} />
109109
```
110110

111-
112111
## Temporal jittering
113112

114113
Jittering also works for temporal data. When jittering Date objects, random time offsets are added to each date value:
@@ -182,11 +181,11 @@ For reproducible jittering or specialized random distributions, you can provide
182181
<script>
183182
import { Plot, Dot, jitterX } from 'svelteplot';
184183
import { randomLcg } from 'd3-random';
185-
184+
186185
// Create a deterministic random source with a seed
187186
const seed = 42;
188187
const myRandomSource = randomLcg(seed);
189-
188+
190189
// This will produce the same jitter pattern every time
191190
const jitteredProps = jitterX(
192191
{ data, x: 'value' },
@@ -200,6 +199,7 @@ For reproducible jittering or specialized random distributions, you can provide
200199
```
201200

202201
This is particularly useful for:
202+
203203
- Testing and debugging visualizations
204204
- Creating reproducible figures for publications
205205
- Ensuring consistent visual appearance across renders

0 commit comments

Comments
 (0)
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