Skip to content

Commit 0141f17

Browse files
committed
fix: improve visuals of the demo page
1 parent 9678e2a commit 0141f17

File tree

1 file changed

+42
-30
lines changed

1 file changed

+42
-30
lines changed

src/routes/+page.svelte

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -60,33 +60,37 @@
6060
}
6161
</script>
6262

63-
<Plot
64-
{data}
65-
{fillParent}
66-
{debounce}
67-
{config}
68-
layout={{
69-
margin: { t: 0 }
70-
}}
71-
libPlotly={useDefaultLib ? undefined : null}
72-
on:click={console.log}
73-
on:relayout={console.log}
74-
/>
63+
<main>
64+
<section class="plot">
65+
<Plot
66+
{data}
67+
{fillParent}
68+
{debounce}
69+
{config}
70+
layout={{
71+
margin: { t: 0 }
72+
}}
73+
libPlotly={useDefaultLib ? undefined : null}
74+
on:click={console.log}
75+
on:relayout={console.log}
76+
/>
77+
</section>
7578

76-
<div class="controls">
77-
<button on:click={addData}>Add trace</button>
78-
<button on:click={changeY0}>Increase y<sub>0</sub></button>
79-
<button on:click={() => (useDefaultLib = !useDefaultLib)}>Swap lib</button>
80-
<button on:click={() => (fillParent = false)}>Fixed size</button>
81-
<button on:click={() => (fillParent = true)}>Fill parent</button>
82-
<button on:click={() => (fillParent = 'width')}>Fill width</button>
83-
<button on:click={() => (fillParent = 'height')}>Fill height</button>
84-
<button on:click={() => (debounce = undefined)}>Don't debounce</button>
85-
<button on:click={() => (debounce = 500)}>Debounce 500ms</button>
86-
<button on:click={() => (debounce = { wait: 500, maxWait: 2000 })}
87-
>Debounce 500ms, max wait 2s</button
88-
>
89-
</div>
79+
<section class="controls">
80+
<button on:click={addData}>Add trace</button>
81+
<button on:click={changeY0}>Increase y<sub>0</sub></button>
82+
<button on:click={() => (useDefaultLib = !useDefaultLib)}>Swap lib</button>
83+
<button on:click={() => (fillParent = false)}>Fixed size</button>
84+
<button on:click={() => (fillParent = true)}>Fill parent</button>
85+
<button on:click={() => (fillParent = 'width')}>Fill width</button>
86+
<button on:click={() => (fillParent = 'height')}>Fill height</button>
87+
<button on:click={() => (debounce = undefined)}>Don't debounce</button>
88+
<button on:click={() => (debounce = 500)}>Debounce 500ms</button>
89+
<button on:click={() => (debounce = { wait: 500, maxWait: 2000 })}
90+
>Debounce 500ms, max wait 2s</button
91+
>
92+
</section>
93+
</main>
9094

9195
<style lang="scss">
9296
:global(html, body, body > div) {
@@ -95,9 +99,17 @@
9599
width: 100vw;
96100
height: 100vh;
97101
}
98-
.controls {
99-
position: absolute;
100-
left: 0;
101-
bottom: 0;
102+
main {
103+
display: flex;
104+
flex-direction: column;
105+
justify-items: stretch;
106+
107+
width: 100vw;
108+
height: 100vh;
109+
110+
.plot {
111+
flex-grow: 1;
112+
margin: 1rem;
113+
}
102114
}
103115
</style>

0 commit comments

Comments
 (0)