Spaces:
Running
Running
Collapse dataframes by default in table view.
Browse files
web/src/NodeWithTableView.svelte
CHANGED
@@ -3,12 +3,14 @@
|
|
3 |
import LynxKiteNode from './LynxKiteNode.svelte';
|
4 |
type $$Props = NodeProps;
|
5 |
export let data: $$Props['data'];
|
|
|
6 |
</script>
|
7 |
|
8 |
<LynxKiteNode {...$$props}>
|
9 |
{#if data.view}
|
10 |
{#each Object.entries(data.view.dataframes) as [name, df]}
|
11 |
-
<div class="df-head">{name}</div>
|
|
|
12 |
<table>
|
13 |
<tr>
|
14 |
{#each df.columns as column}
|
@@ -23,6 +25,7 @@
|
|
23 |
</tr>
|
24 |
{/each}
|
25 |
</table>
|
|
|
26 |
{/each}
|
27 |
{/if}
|
28 |
</LynxKiteNode>
|
@@ -31,6 +34,7 @@
|
|
31 |
font-weight: bold;
|
32 |
padding: 8px;
|
33 |
background: #f0f0f0;
|
|
|
34 |
}
|
35 |
table {
|
36 |
margin: 8px;
|
|
|
3 |
import LynxKiteNode from './LynxKiteNode.svelte';
|
4 |
type $$Props = NodeProps;
|
5 |
export let data: $$Props['data'];
|
6 |
+
const open = {};
|
7 |
</script>
|
8 |
|
9 |
<LynxKiteNode {...$$props}>
|
10 |
{#if data.view}
|
11 |
{#each Object.entries(data.view.dataframes) as [name, df]}
|
12 |
+
<div class="df-head" on:click={() => open[name] = !open[name]}>{name}</div>
|
13 |
+
{#if open[name]}
|
14 |
<table>
|
15 |
<tr>
|
16 |
{#each df.columns as column}
|
|
|
25 |
</tr>
|
26 |
{/each}
|
27 |
</table>
|
28 |
+
{/if}
|
29 |
{/each}
|
30 |
{/if}
|
31 |
</LynxKiteNode>
|
|
|
34 |
font-weight: bold;
|
35 |
padding: 8px;
|
36 |
background: #f0f0f0;
|
37 |
+
cursor: pointer;
|
38 |
}
|
39 |
table {
|
40 |
margin: 8px;
|