Skip to content

Commit e9d5b1e

Browse files
committed
changes
1 parent 2330523 commit e9d5b1e

1 file changed

Lines changed: 53 additions & 48 deletions

File tree

trackio/frontend/src/pages/Metrics.svelte

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -326,55 +326,57 @@
326326
</div>
327327
{/if}
328328

329-
{#each Object.entries(group.subgroups) as [subName, subMetrics]}
330-
{@const subKey = `${groupName}:${subName}`}
331-
{@const orderedSub = getOrderedMetrics(subKey, subMetrics)}
332-
<Accordion
333-
label="{subName} ({subMetrics.length})"
334-
open={true}
335-
hidden={!showHeaders}
336-
>
337-
<div class="plot-grid">
338-
{#each orderedSub as metric, i}
339-
{@const plotResult = plotDataByMetric.get(metric) ?? { data: [], yExtent: undefined }}
340-
{@const plotData = plotResult.data}
341-
{@const yExtent = plotResult.yExtent}
342-
{@const useBar = singlePointMetrics.has(metric)}
343-
{@const subTitle = showHeaders ? metric.split("/").slice(2).join("/") || metric : metric}
344-
{#if plotData.length > 0}
345-
{#if useBar}
346-
<BarPlot
347-
data={plotData}
348-
y={metric}
349-
title={subTitle}
350-
{colorMap}
351-
draggable={true}
352-
ondragstart={(e) => handleDragStart(subKey, i, e)}
353-
ondragover={(e) => handleDragOver(subKey, i, e)}
354-
ondrop={(e) => handleDrop(subKey, i, orderedSub, e)}
355-
/>
356-
{:else}
357-
<LinePlot
358-
data={plotData}
359-
x={xColumn}
360-
y={metric}
361-
title={subTitle}
362-
{colorMap}
363-
{xLim}
364-
{yExtent}
365-
onSelect={handlePlotSelect}
366-
onResetZoom={handleResetZoom}
367-
draggable={true}
368-
ondragstart={(e) => handleDragStart(subKey, i, e)}
369-
ondragover={(e) => handleDragOver(subKey, i, e)}
370-
ondrop={(e) => handleDrop(subKey, i, orderedSub, e)}
371-
/>
329+
<div class="subgroup-list">
330+
{#each Object.entries(group.subgroups) as [subName, subMetrics]}
331+
{@const subKey = `${groupName}:${subName}`}
332+
{@const orderedSub = getOrderedMetrics(subKey, subMetrics)}
333+
<Accordion
334+
label="{subName} ({subMetrics.length})"
335+
open={true}
336+
hidden={!showHeaders}
337+
>
338+
<div class="plot-grid">
339+
{#each orderedSub as metric, i}
340+
{@const plotResult = plotDataByMetric.get(metric) ?? { data: [], yExtent: undefined }}
341+
{@const plotData = plotResult.data}
342+
{@const yExtent = plotResult.yExtent}
343+
{@const useBar = singlePointMetrics.has(metric)}
344+
{@const subTitle = showHeaders ? metric.split("/").slice(2).join("/") || metric : metric}
345+
{#if plotData.length > 0}
346+
{#if useBar}
347+
<BarPlot
348+
data={plotData}
349+
y={metric}
350+
title={subTitle}
351+
{colorMap}
352+
draggable={true}
353+
ondragstart={(e) => handleDragStart(subKey, i, e)}
354+
ondragover={(e) => handleDragOver(subKey, i, e)}
355+
ondrop={(e) => handleDrop(subKey, i, orderedSub, e)}
356+
/>
357+
{:else}
358+
<LinePlot
359+
data={plotData}
360+
x={xColumn}
361+
y={metric}
362+
title={subTitle}
363+
{colorMap}
364+
{xLim}
365+
{yExtent}
366+
onSelect={handlePlotSelect}
367+
onResetZoom={handleResetZoom}
368+
draggable={true}
369+
ondragstart={(e) => handleDragStart(subKey, i, e)}
370+
ondragover={(e) => handleDragOver(subKey, i, e)}
371+
ondrop={(e) => handleDrop(subKey, i, orderedSub, e)}
372+
/>
373+
{/if}
372374
{/if}
373-
{/if}
374-
{/each}
375-
</div>
376-
</Accordion>
377-
{/each}
375+
{/each}
376+
</div>
377+
</Accordion>
378+
{/each}
379+
</div>
378380
</Accordion>
379381
{/each}
380382
{/if}
@@ -392,6 +394,9 @@
392394
flex-wrap: wrap;
393395
gap: 16px;
394396
}
397+
.subgroup-list {
398+
margin-top: 16px;
399+
}
395400
.empty-state {
396401
max-width: 640px;
397402
padding: 40px 24px;

0 commit comments

Comments
 (0)