FIx row view chart on desktop
This commit is contained in:
1 parent
c87c429f28
commit
6802d6664a
1 file changed
+82
-77
@@ -260,68 +260,69 @@
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<!-- Metric rows -->
|
||||
<div class="rows" class:single={singleChamber !== null}>
|
||||
{#each metrics as m (m.key)}
|
||||
<div class="row" class:single={singleChamber !== null}>
|
||||
<div class="row-label">
|
||||
<span class="rl-name">{m.label}</span>
|
||||
<InfoHint
|
||||
title={m.hint(visibleChambers[0]).title}
|
||||
body={m.hint(visibleChambers[0]).body}
|
||||
side="bottom"
|
||||
open={openHintKey === m.key}
|
||||
onOpenChange={(open) => openHintKey = open ? m.key : null}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{#each visibleChambers as ch (ch.id)}
|
||||
{@const range = m.rangeFor(ch)}
|
||||
{@const suppressed = ch.burn_in && m.key === 'voc'}
|
||||
{@const scrubActive = isScrubbed(ch, m.key)}
|
||||
{@const displayVal = scrubActive && scrub
|
||||
? scrub.value
|
||||
: parseFloat(m.valueFor(ch))}
|
||||
{@const ok = inRange(displayVal, range)}
|
||||
|
||||
<div class="cell" class:scrubbing={scrubActive}>
|
||||
<div class="cell-top">
|
||||
<span class="cell-value font-serif" class:out={!ok && !suppressed} class:muted={suppressed}>
|
||||
{#if suppressed}
|
||||
—<span class="cell-unit">{m.unit}</span>
|
||||
{:else if scrubActive && scrub}
|
||||
{m.format(scrub.value)}<span class="cell-unit">{m.unit}</span>
|
||||
{:else}
|
||||
{m.valueFor(ch)}<span class="cell-unit">{m.unit}</span>
|
||||
{/if}
|
||||
</span>
|
||||
{#if scrubActive && scrub}
|
||||
<span class="cell-when font-serif italic">{formatRelative(scrub.ts)}</span>
|
||||
{:else if !suppressed}
|
||||
<span class="cell-chip" class:chip-ok={ok} class:chip-off={!ok}>
|
||||
<span class="chip-dot"></span>
|
||||
{ok ? 'in range' : 'drift'}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="cell-chart">
|
||||
<LineChart
|
||||
data={m.seriesFor(ch)}
|
||||
color={m.color}
|
||||
healthyRange={range}
|
||||
interactive
|
||||
onScrub={(p) => handleScrub(ch.id, m.key, p)}
|
||||
/>
|
||||
</div>
|
||||
<div class="cell-range">{m.rangeLabel(ch)}</div>
|
||||
<!-- Metric rows + radar wrapper -->
|
||||
<div class="metrics-wrap" class:single={singleChamber !== null}>
|
||||
<div class="rows" class:single={singleChamber !== null}>
|
||||
{#each metrics as m (m.key)}
|
||||
<div class="row" class:single={singleChamber !== null}>
|
||||
<div class="row-label">
|
||||
<span class="rl-name">{m.label}</span>
|
||||
<InfoHint
|
||||
title={m.hint(visibleChambers[0]).title}
|
||||
body={m.hint(visibleChambers[0]).body}
|
||||
side="bottom"
|
||||
open={openHintKey === m.key}
|
||||
onOpenChange={(open) => openHintKey = open ? m.key : null}
|
||||
/>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<!-- Gas fingerprint row -->
|
||||
<div class="row row-radar" class:single={singleChamber !== null}>
|
||||
{#each visibleChambers as ch (ch.id)}
|
||||
{@const range = m.rangeFor(ch)}
|
||||
{@const suppressed = ch.burn_in && m.key === 'voc'}
|
||||
{@const scrubActive = isScrubbed(ch, m.key)}
|
||||
{@const displayVal = scrubActive && scrub
|
||||
? scrub.value
|
||||
: parseFloat(m.valueFor(ch))}
|
||||
{@const ok = inRange(displayVal, range)}
|
||||
|
||||
<div class="cell" class:scrubbing={scrubActive}>
|
||||
<div class="cell-top">
|
||||
<span class="cell-value font-serif" class:out={!ok && !suppressed} class:muted={suppressed}>
|
||||
{#if suppressed}
|
||||
—<span class="cell-unit">{m.unit}</span>
|
||||
{:else if scrubActive && scrub}
|
||||
{m.format(scrub.value)}<span class="cell-unit">{m.unit}</span>
|
||||
{:else}
|
||||
{m.valueFor(ch)}<span class="cell-unit">{m.unit}</span>
|
||||
{/if}
|
||||
</span>
|
||||
{#if scrubActive && scrub}
|
||||
<span class="cell-when font-serif italic">{formatRelative(scrub.ts)}</span>
|
||||
{:else if !suppressed}
|
||||
<span class="cell-chip" class:chip-ok={ok} class:chip-off={!ok}>
|
||||
<span class="chip-dot"></span>
|
||||
{ok ? 'in range' : 'drift'}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="cell-chart">
|
||||
<LineChart
|
||||
data={m.seriesFor(ch)}
|
||||
color={m.color}
|
||||
healthyRange={range}
|
||||
interactive
|
||||
onScrub={(p) => handleScrub(ch.id, m.key, p)}
|
||||
/>
|
||||
</div>
|
||||
<div class="cell-range">{m.rangeLabel(ch)}</div>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
|
||||
<!-- Gas fingerprint row -->
|
||||
<div class="row row-radar" class:single={singleChamber !== null}>
|
||||
<div class="row-label">
|
||||
<span class="rl-name">Gas fingerprint</span>
|
||||
<InfoHint
|
||||
@@ -371,6 +372,7 @@
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
@@ -668,17 +670,21 @@
|
||||
|
||||
/* Single chamber desktop: side-by-side sparklines and radar */
|
||||
@media (min-width: 901px) {
|
||||
.rows.single {
|
||||
position: relative;
|
||||
padding-right: 210px; /* make room for radar column */
|
||||
.metrics-wrap.single {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: stretch;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.rows.single :global(.row-radar) {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
right: 0;
|
||||
.metrics-wrap.single .rows.single {
|
||||
flex: 1;
|
||||
min-width: 0; /* allow flex item to shrink below content size */
|
||||
}
|
||||
|
||||
.metrics-wrap.single .row-radar.single {
|
||||
width: 190px;
|
||||
height: calc(100% - 24px);
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-bottom: none;
|
||||
@@ -686,12 +692,12 @@
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.row-radar.single .row-label {
|
||||
.metrics-wrap.single .row-radar.single .row-label {
|
||||
justify-content: center;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.row-radar.single .cell-radar {
|
||||
.metrics-wrap.single .row-radar.single .cell-radar {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -701,7 +707,7 @@
|
||||
}
|
||||
|
||||
/* Calibrating placeholder fits the tighter space */
|
||||
.row-radar.single .calibrating {
|
||||
.metrics-wrap.single .row-radar.single .calibrating {
|
||||
min-height: 0;
|
||||
max-width: none;
|
||||
padding: 8px;
|
||||
@@ -735,13 +741,12 @@
|
||||
}
|
||||
|
||||
/* Reset single chamber side-by-side on mobile */
|
||||
.rows.single {
|
||||
padding-right: 0 !important;
|
||||
.metrics-wrap.single {
|
||||
display: block;
|
||||
}
|
||||
.rows.single :global(.row-radar) {
|
||||
position: static !important;
|
||||
width: auto !important;
|
||||
height: auto !important;
|
||||
.metrics-wrap.single .row-radar.single {
|
||||
width: auto;
|
||||
margin-top: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user