guard render to check for children

This commit is contained in:
pngwn 2022-03-29 13:57:04 +01:00
parent 1a500bff43
commit aeec89c8a9
2 changed files with 4 additions and 2 deletions

View File

@ -42,7 +42,7 @@
{theme}
{root}
>
{#if children.length}
{#if children && children.length}
{#each children as { component, id, props, children, has_modes }}
<svelte:self
{component}

View File

@ -1,7 +1,7 @@
<script lang="ts">
import { getNextColor } from "./utils";
export let value: Array<[string, string | number]>;
export let value: Array<[string, string | number]> = [];
export let theme: string = "default";
export let show_legend: boolean = false;
export let color_map: Record<string, string> = {};
@ -51,6 +51,8 @@
}
}
}
correct_color_map();
</script>
<div class="output-highlightedtext" {theme}>