Fixes #14: Lazy load additional metrics

This commit is contained in:
Lou Knauer
2022-07-08 12:23:24 +02:00
parent 9198d160a1
commit 772d37b093
3 changed files with 30 additions and 12 deletions

View File

@@ -12,7 +12,7 @@
export let padding = 10
let tableWidth = 0
const PLACEHOLDER = { magic: 'object' }
const isPlaceholder = x => x._is_placeholder === true
function tile(items, itemsPerRow) {
const rows = []
@@ -22,7 +22,7 @@
if (ri + ci < items.length)
row.push(items[ri + ci])
else
row.push(PLACEHOLDER)
row.push({ _is_placeholder: true, ri, ci })
}
rows.push(row)
@@ -40,7 +40,7 @@
<tr>
{#each row as item (item)}
<td>
{#if item != PLACEHOLDER && plotWidth > 0}
{#if !isPlaceholder(item) && plotWidth > 0}
<slot item={item} width={plotWidth}></slot>
{/if}
</td>