-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add metadata and provenance infos #37; Sort files alphabetical by def…
- Loading branch information
Showing
3 changed files
with
264 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<script> | ||
export let data; | ||
import RecursiveDisplay from './RecursiveDisplay.svelte'; | ||
/** @type {Record<string, boolean>} */ | ||
let collapsed = {}; | ||
// Toggle collapse state for a given key | ||
/** | ||
* @param {string} key | ||
*/ | ||
function toggleCollapse(key) { | ||
collapsed[key] = !collapsed[key]; | ||
} | ||
</script> | ||
|
||
{#if typeof data === 'object' && !Array.isArray(data)} | ||
{#each Object.entries(data) as [key, value]} | ||
{#if key != 'NETCDF_DIM_time_VALUES'} | ||
<div | ||
class="ml-4 collapsible" | ||
role="button" | ||
tabindex="0" | ||
on:click={() => toggleCollapse(key)} | ||
on:keydown={(e) => e.key === 'Enter' && toggleCollapse(key)} | ||
> | ||
<strong>{key}:</strong> | ||
<div class={collapsed[key] ? 'collapsed' : ''}> | ||
<div class="content"> | ||
<RecursiveDisplay data={value} /> | ||
</div> | ||
</div> | ||
</div> | ||
{/if} | ||
{/each} | ||
{:else if Array.isArray(data)} | ||
<ul class="ml-4"> | ||
{#each data as item, index} | ||
<li> | ||
<div class="collapsible"> | ||
<div> | ||
<div class="content"> | ||
<RecursiveDisplay data={item} /> | ||
</div> | ||
</div> | ||
</div> | ||
</li> | ||
{/each} | ||
</ul> | ||
{:else} | ||
<span>{data}</span> | ||
{/if} | ||
|
||
<style> | ||
.collapsible { | ||
cursor: pointer; | ||
user-select: none; | ||
} | ||
.collapsed > .content { | ||
display: none; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script></script> | ||
|
||
<svg class="fill-white" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="20" | ||
><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path | ||
d="M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z" | ||
/></svg | ||
> | ||
|
||
<style></style> |
Oops, something went wrong.