Skip to content

Commit 5bab8e7

Browse files
Motion examples using showField.svelte do not show/start until in view. (#821)
* Motion examples using showField.svelte do not show/start until in view. used runed useIntersectionObserver 1 second delay after visibility fires only once added wrapping divs for reserved height for simplechart w/comment removed TODO FIXED.md - old, never used, github takes precedence * Motion examples using showField.svelte do not show/start until in view. used runed useIntersectionObserver 1 second delay after visibility fires only once added wrapping divs for reserved height for simplechart w/comment updated MotionPathControls to use showField gave showfield option for "inline" not absolutely positioning removed TODO FIXED.md - old, never used, github takes precedence * Motion examples using showField.svelte do not show/start until in view. updated multicontrols to use showField.svelte where appropriate. updated additonal motion examples using those controls.
1 parent e795e9a commit 5bab8e7

41 files changed

Lines changed: 201 additions & 869 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/ TODO FIXES.md

Lines changed: 0 additions & 777 deletions
This file was deleted.

docs/src/examples/components/Arc/playground.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import ArcPlaygroundControls from '$lib/components/controls/ArcPlaygroundControls.svelte';
44
55
let config = $state({
6-
show: true,
6+
show: false,
77
value: 60,
88
spring: true,
99
domain: [0, 100] as [number, number],

docs/src/examples/components/Arc/tween-value-on-mount.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { Arc, Chart, Layer } from 'layerchart';
44
import ShowControl from '$lib/components/controls/fields/ShowField.svelte';
55
6-
let show = $state(true);
6+
let show = $state();
77
const data = {
88
arcs: [
99
{ initialValue: 0, value: 40, fillClass: 'fill-red-500', trackClass: 'fill-red-500/10' },

docs/src/examples/components/ArcChart/series-motion-spring.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
];
1010
export { data };
1111
12-
let show = $state(true);
12+
let show = $state();
1313
</script>
1414

1515
<ShowField bind:show label="Show Arcs" />
1616

17+
<!-- Note wrapping div is for demo purposes only (Toggling visibility), it is not required in your code. -->
1718
<div style:height="180px">
1819
{#if show}
1920
<ArcChart
@@ -31,6 +32,7 @@
3132
outerRadius={-25}
3233
innerRadius={-20}
3334
cornerRadius={10}
35+
height={180}
3436
/>
3537
{/if}
3638
</div>

docs/src/examples/components/ArcChart/series-motion-tween.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
];
1010
export { data };
1111
12-
let show = $state(true);
12+
let show = $state();
1313
</script>
1414

1515
<ShowControl bind:show label="Show Arcs" />
1616

17+
<!-- Note wrapping div is for demo purposes only (Toggling visibility), it is not required in your code. -->
1718
<div style:height="180px">
1819
{#if show}
1920
<ArcChart
@@ -31,6 +32,7 @@
3132
outerRadius={-25}
3233
innerRadius={-20}
3334
cornerRadius={10}
35+
height={180}
3436
/>
3537
{/if}
3638
</div>

docs/src/examples/components/Area/clip-tween-on-mount.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
import { createDateSeries } from '$lib/utils/data.js';
77
8-
let show = $state(true);
8+
let show = $state();
99
const data = createDateSeries({ count: 30, min: 50, max: 100, value: 'integer' });
1010
1111
export { data };

docs/src/examples/components/Area/tween-on-mount.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import ShowControl from '$lib/components/controls/fields/ShowField.svelte';
44
import { createDateSeries } from '$lib/utils/data.js';
55
6-
let show = $state(true);
6+
let show = $state();
77
const data = createDateSeries({ count: 30, min: 50, max: 100, value: 'integer' });
88
export { data };
99
</script>

docs/src/examples/components/AreaChart/motion-tween.svelte

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,23 @@
33
import ShowControl from '$lib/components/controls/fields/ShowField.svelte';
44
import { createDateSeries } from '$lib/utils/data.js';
55
6-
let show = $state(true);
6+
let show = $state();
77
const data = createDateSeries({ count: 30, min: 50, max: 100, value: 'integer' });
88
export { data };
99
</script>
1010

1111
<ShowControl bind:show label="Show Chart" />
1212

13-
{#if show}
14-
<AreaChart
15-
{data}
16-
x="date"
17-
y="value"
18-
props={{ area: { motion: 'tween' } }}
19-
padding={defaultChartPadding({ right: 10 })}
20-
height={300}
21-
/>
22-
{/if}
13+
<!-- Note wrapping div is for demo purposes only (Toggling visibility), it is not required in your code. -->
14+
<div style:height="300px">
15+
{#if show}
16+
<AreaChart
17+
{data}
18+
x="date"
19+
y="value"
20+
props={{ area: { motion: 'tween' } }}
21+
padding={defaultChartPadding({ right: 10 })}
22+
height={300}
23+
/>
24+
{/if}
25+
</div>

docs/src/examples/components/BarChart/motion-tween.svelte

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@
33
import ShowControl from '$lib/components/controls/fields/ShowField.svelte';
44
import { createDateSeries } from '$lib/utils/data.js';
55
6-
let show = $state(true);
6+
let show = $state();
77
const data = createDateSeries({ count: 10, min: 20, max: 100, value: 'integer' });
88
export { data };
99
</script>
1010

1111
<ShowControl bind:show label="Show Chart" />
1212

13-
{#if show}
14-
<BarChart
15-
{data}
16-
x="date"
17-
y="value"
18-
props={{ bars: { motion: { type: 'tween', duration: 500 } } }}
19-
height={300}
20-
/>
21-
{/if}
13+
<!-- Note wrapping div is for demo purposes only (Toggling visibility), it is not required in your code. -->
14+
<div style:height="300px">
15+
{#if show}
16+
<BarChart
17+
{data}
18+
x="date"
19+
y="value"
20+
props={{ bars: { motion: { type: 'tween', duration: 500 } } }}
21+
height={300}
22+
/>
23+
{/if}
24+
</div>

docs/src/examples/components/Bars/horizontal-stagger-tween-on-mount.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
keys: ['value', 'baseline']
1414
});
1515
16-
let show = $state(true);
16+
let show = $state();
1717
1818
export { data };
1919
</script>

0 commit comments

Comments
 (0)