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}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Metric rows -->
|
<!-- Metric rows + radar wrapper -->
|
||||||
<div class="rows" class:single={singleChamber !== null}>
|
<div class="metrics-wrap" class:single={singleChamber !== null}>
|
||||||
{#each metrics as m (m.key)}
|
<div class="rows" class:single={singleChamber !== null}>
|
||||||
<div class="row" class:single={singleChamber !== null}>
|
{#each metrics as m (m.key)}
|
||||||
<div class="row-label">
|
<div class="row" class:single={singleChamber !== null}>
|
||||||
<span class="rl-name">{m.label}</span>
|
<div class="row-label">
|
||||||
<InfoHint
|
<span class="rl-name">{m.label}</span>
|
||||||
title={m.hint(visibleChambers[0]).title}
|
<InfoHint
|
||||||
body={m.hint(visibleChambers[0]).body}
|
title={m.hint(visibleChambers[0]).title}
|
||||||
side="bottom"
|
body={m.hint(visibleChambers[0]).body}
|
||||||
open={openHintKey === m.key}
|
side="bottom"
|
||||||
onOpenChange={(open) => openHintKey = open ? m.key : null}
|
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>
|
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
|
||||||
</div>
|
|
||||||
{/each}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Gas fingerprint row -->
|
{#each visibleChambers as ch (ch.id)}
|
||||||
<div class="row row-radar" class:single={singleChamber !== null}>
|
{@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">
|
<div class="row-label">
|
||||||
<span class="rl-name">Gas fingerprint</span>
|
<span class="rl-name">Gas fingerprint</span>
|
||||||
<InfoHint
|
<InfoHint
|
||||||
@@ -371,6 +372,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -668,17 +670,21 @@
|
|||||||
|
|
||||||
/* Single chamber desktop: side-by-side sparklines and radar */
|
/* Single chamber desktop: side-by-side sparklines and radar */
|
||||||
@media (min-width: 901px) {
|
@media (min-width: 901px) {
|
||||||
.rows.single {
|
.metrics-wrap.single {
|
||||||
position: relative;
|
display: flex;
|
||||||
padding-right: 210px; /* make room for radar column */
|
flex-direction: row;
|
||||||
|
align-items: stretch;
|
||||||
|
gap: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rows.single :global(.row-radar) {
|
.metrics-wrap.single .rows.single {
|
||||||
position: absolute;
|
flex: 1;
|
||||||
top: 12px;
|
min-width: 0; /* allow flex item to shrink below content size */
|
||||||
right: 0;
|
}
|
||||||
|
|
||||||
|
.metrics-wrap.single .row-radar.single {
|
||||||
width: 190px;
|
width: 190px;
|
||||||
height: calc(100% - 24px);
|
flex-shrink: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
@@ -686,12 +692,12 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.row-radar.single .row-label {
|
.metrics-wrap.single .row-radar.single .row-label {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 8px 0;
|
padding: 8px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.row-radar.single .cell-radar {
|
.metrics-wrap.single .row-radar.single .cell-radar {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -701,7 +707,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Calibrating placeholder fits the tighter space */
|
/* Calibrating placeholder fits the tighter space */
|
||||||
.row-radar.single .calibrating {
|
.metrics-wrap.single .row-radar.single .calibrating {
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
max-width: none;
|
max-width: none;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
@@ -735,13 +741,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Reset single chamber side-by-side on mobile */
|
/* Reset single chamber side-by-side on mobile */
|
||||||
.rows.single {
|
.metrics-wrap.single {
|
||||||
padding-right: 0 !important;
|
display: block;
|
||||||
}
|
}
|
||||||
.rows.single :global(.row-radar) {
|
.metrics-wrap.single .row-radar.single {
|
||||||
position: static !important;
|
width: auto;
|
||||||
width: auto !important;
|
margin-top: 12px;
|
||||||
height: auto !important;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in new issue
Block a user