diff --git a/web/blueprint/src/lib/components/schemaView/Histogram.svelte b/web/blueprint/src/lib/components/schemaView/Histogram.svelte index 4dd92465..d088ea80 100644 --- a/web/blueprint/src/lib/components/schemaView/Histogram.svelte +++ b/web/blueprint/src/lib/components/schemaView/Histogram.svelte @@ -5,7 +5,7 @@ export let field: LilacField; export let counts: Array<[LeafValue, number]>; export let bins: Record | null; - $: maxCount = Math.max(...counts.map(([_, count]) => count)); + $: maxCount = Math.max(...counts.filter(val => val[0] != null).map(([_, count]) => count)); // Sort the counts by the index of their value in the named bins. $: binKeys = bins != null ? (Object.keys(bins) as LeafValue[]) : []; @@ -37,8 +37,9 @@
{#each sortedCounts as [value, count]} {@const groupName = formatValueOrBin(value)} - {@const barWidth = `${(count / maxCount) * 100}%`} + {@const barWidth = `${Math.min(1, count / maxCount) * 100}%`} {@const formattedCount = formatValue(count)} + {@const backgroundColor = value != null ? 'bg-indigo-200' : 'bg-gray-200'}