Skip to content

Commit f37635e

Browse files
committed
add jitter examples
1 parent 7841ea5 commit f37635e

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Jittering also works for temporal data. When jittering Date objects, random time
121121
}))
122122
);
123123
124-
let type = $state('uniform');
124+
let type = $state('normal');
125125
let width = $state('1 month');
126126
127127
const timeIntervals = [
@@ -163,6 +163,25 @@ Jittering also works for temporal data. When jittering Date objects, random time
163163
</Plot>
164164
```
165165

166+
```svelte
167+
<Plot y={{ grid: true }}>
168+
<Dot
169+
{...jitterX(
170+
{
171+
data,
172+
x: 'year',
173+
y: 'bmi'
174+
},
175+
{
176+
type: 'normal',
177+
std: '1 month'
178+
}
179+
)} />
180+
</Plot>
181+
```
182+
183+
[fork](https://svelte.dev/playground/6938e854283d4e56893ceca748393f6f?version=5)
184+
166185
This example shows how jittering can be applied to date values in the x-axis, which can be useful when multiple events occur at the same date and would otherwise overlap.
167186

168187
## Custom random sources
@@ -190,6 +209,8 @@ For reproducible jittering or specialized random distributions, you can provide
190209
</Plot>
191210
```
192211

212+
[fork](https://svelte.dev/playground/ef02e12058354e53a9da72ae249ad359?version=5.30.2)
213+
193214
This is particularly useful for:
194215

195216
- Testing and debugging visualizations

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