Skip to content

Commit

Permalink
docs(Text): Fix example after adding getRenderContext()
Browse files Browse the repository at this point in the history
  • Loading branch information
techniq committed Feb 21, 2025
1 parent 03496e3 commit 57272bb
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions packages/layerchart/src/routes/docs/components/Text/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { Text } from 'layerchart';
import { Chart, Svg, Text } from 'layerchart';
import type { ComponentProps } from 'svelte';
import { Field, RangeField, Switch, TextField, ToggleGroup, ToggleOption } from 'svelte-ux';
Expand Down Expand Up @@ -62,21 +62,25 @@
</div>

<div class="flex items-center justify-center bg-surface-100 p-4">
<svg width={resizeSvg ? width : 300} class="h-56 border border-surface-content/10">
<Text
{value}
{x}
{y}
{width}
{textAnchor}
{verticalAnchor}
{lineHeight}
{rotate}
{scaleToFit}
/>
<div class="h-56 border border-surface-content/10" style:width="{resizeSvg ? width : 300}px">
<Chart>
<Svg>
<Text
{value}
{x}
{y}
{width}
{textAnchor}
{verticalAnchor}
{lineHeight}
{rotate}
{scaleToFit}
/>

{#if showAnchor}
<circle cx={x} cy={y} r="2" fill="red" />
{/if}
</svg>
{#if showAnchor}
<circle cx={x} cy={y} r="2" fill="red" />
{/if}
</Svg>
</Chart>
</div>
</div>

0 comments on commit 57272bb

Please sign in to comment.