Skip to content

Commit 03e74cb

Browse files
committed
docs: add text example
1 parent 01f198d commit 03e74cb

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script module>
2+
export const title = 'Text';
3+
</script>
4+
5+
<h1>Text examples</h1>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<script module>
2+
export const title = 'Frame Anchor';
3+
</script>
4+
5+
<script lang="ts">
6+
import { setContext } from 'svelte';
7+
8+
import { Plot, Text } from 'svelteplot';
9+
import type { PlotDefaults } from 'svelteplot/types';
10+
setContext<Partial<PlotDefaults>>(
11+
'svelteplot/defaults',
12+
{
13+
frame: {
14+
strokeOpacity: 0.25
15+
}
16+
}
17+
);
18+
</script>
19+
20+
<Plot
21+
frame
22+
height={300}
23+
axes={false}
24+
x={{ domain: [0, 10] }}
25+
y={{ domain: [0, 10] }}>
26+
{#each ['top', 'bottom', 'center', 'left', 'right', 'top-left', 'top-right', 'bottom-left', 'bottom-right'] as frameAnchor}
27+
<Text
28+
{frameAnchor}
29+
fontSize={18}
30+
text={frameAnchor} />
31+
{/each}
32+
</Plot>

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