feat: graph header on gain panel
This commit is contained in:
@@ -24,4 +24,4 @@ export function TriangleDownIcon(props: React.SVGProps<SVGSVGElement>) {
|
|||||||
/>
|
/>
|
||||||
</svg>
|
</svg>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,23 +2,19 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
min-height: var(--card-control-height);
|
min-height: var(--card-control-height);
|
||||||
|
|
||||||
padding: 0 var(--space-4);
|
padding: 0 var(--space-4);
|
||||||
|
|
||||||
border: var(--border-width) solid transparent;
|
border: var(--border-width) solid transparent;
|
||||||
border-radius: var(--radius-sm);
|
border-radius: var(--radius-sm);
|
||||||
|
|
||||||
font-family: var(--font-ui);
|
font-family: var(--font-ui);
|
||||||
font-size: var(--font-md);
|
font-size: 13px;
|
||||||
font-weight: var(--font-weight-medium);
|
font-weight: var(--font-weight-medium);
|
||||||
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
font-size: 13px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn:disabled {
|
.btn:disabled {
|
||||||
@@ -26,27 +22,49 @@
|
|||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
/* Variants */
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
.btn-primary {
|
.btn-primary {
|
||||||
background: var(--accent-brand);
|
background: var(--accent-brand);
|
||||||
color: var(--bg-void);
|
color: var(--bg-void);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Ghost + Toggle */
|
||||||
.btn-ghost,
|
.btn-ghost,
|
||||||
.btn-toggle,
|
.btn-toggle {
|
||||||
.btn-outline {
|
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border-color: var(--border-hairline);
|
border-color: var(--border-hairline);
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Outline */
|
||||||
|
.btn-outline {
|
||||||
|
background: transparent;
|
||||||
|
border-color: var(--accent-brand);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
/* Hover */
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
.btn-ghost:hover:not(:disabled),
|
.btn-ghost:hover:not(:disabled),
|
||||||
.btn-toggle:hover:not(:disabled),
|
.btn-toggle:hover:not(:disabled) {
|
||||||
.btn-outline:hover:not(:disabled) {
|
|
||||||
background: var(--bg-raised);
|
background: var(--bg-raised);
|
||||||
color: var(--text-primary);
|
color: var(--text-primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Active toggle states */
|
.btn-outline:hover:not(:disabled) {
|
||||||
|
border-color: var(--accent-brand);
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
/* Active toggle states */
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
.btn-toggle.active-info {
|
.btn-toggle.active-info {
|
||||||
background: var(--accent-brand);
|
background: var(--accent-brand);
|
||||||
border-color: var(--accent-brand);
|
border-color: var(--accent-brand);
|
||||||
@@ -65,7 +83,10 @@
|
|||||||
color: var(--bg-void);
|
color: var(--bg-void);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Optional: active state hover */
|
/* ------------------------------------------------------------------ */
|
||||||
|
/* Active toggle hover */
|
||||||
|
/* ------------------------------------------------------------------ */
|
||||||
|
|
||||||
.btn-toggle.active-info:hover:not(:disabled) {
|
.btn-toggle.active-info:hover:not(:disabled) {
|
||||||
background: var(--accent-brand);
|
background: var(--accent-brand);
|
||||||
border-color: var(--accent-brand);
|
border-color: var(--accent-brand);
|
||||||
|
|||||||
@@ -1,18 +1,21 @@
|
|||||||
.channel-group {
|
.channel-group {
|
||||||
position: relative;
|
position: relative;
|
||||||
/* flex: 1 1 0; */
|
|
||||||
min-height: 0;
|
|
||||||
|
|
||||||
|
flex: 0 0 auto;
|
||||||
|
width: fit-content;
|
||||||
|
min-width: 0;
|
||||||
|
|
||||||
|
min-height: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
border: var(--border-width) solid var(--border-hairline);
|
border: var(--border-width) solid var(--border-hairline);
|
||||||
border-radius: var(--radius-md);
|
border-radius: var(--radius-md);
|
||||||
|
|
||||||
padding: 6cqh var(--space-3) 1cqh;
|
padding: 6cqh var(--space-3) 1cqh;
|
||||||
margin-bottom: 1cqh;
|
margin-bottom: 1cqh;
|
||||||
margin-top: 1cqh;
|
margin-top: 1cqh;
|
||||||
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow: visible; /* in case something upstream set hidden */
|
overflow: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.channel-group__label {
|
.channel-group__label {
|
||||||
@@ -36,6 +39,9 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
|
|
||||||
|
width: fit-content;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
gap: var(--space-1);
|
gap: var(--space-1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.choice-stepper__input:focus {
|
.choice-stepper__input:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.choice-stepper__arrows {
|
.choice-stepper__arrows {
|
||||||
|
|||||||
@@ -22,8 +22,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.gain-panels {
|
.gain-panels {
|
||||||
|
display: grid;
|
||||||
|
grid-auto-flow: column;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: flex;
|
|
||||||
gap: var(--space-2);
|
gap: var(--space-2);
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
}
|
}
|
||||||
@@ -106,37 +107,94 @@
|
|||||||
|
|
||||||
.gain-graph-title-row {
|
.gain-graph-title-row {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: stretch;
|
||||||
|
|
||||||
|
gap: 0.75cqh;
|
||||||
|
padding: 1cqh 1.5cqh;
|
||||||
|
|
||||||
|
min-width: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* First row: title left, Show stages right */
|
||||||
|
.gain-graph-title-line {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
gap: 1cqh;
|
gap: 1cqh;
|
||||||
padding: 1cqh 1.5cqh;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.gain-graph-title-row .gain-graph-title {
|
.gain-graph-title-line .gain-graph-title {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
min-width: 0;
|
||||||
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
|
text-align: left;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Compact button on the right */
|
||||||
|
.gain-stages-toggle {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
|
||||||
|
width: auto !important;
|
||||||
|
min-width: max-content;
|
||||||
|
|
||||||
|
padding: 0.4cqh 1cqh;
|
||||||
|
font-size: 1.8cqh;
|
||||||
|
line-height: 1.2;
|
||||||
|
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Channel Selector */
|
||||||
.magnitude-selector {
|
.magnitude-selector {
|
||||||
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
align-items: center;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
|
||||||
gap: 0.5cqh;
|
gap: 0.5cqh;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.magnitude-selector__chip {
|
.magnitude-selector__chip {
|
||||||
|
flex: 0 1 auto;
|
||||||
|
min-width: 0;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
gap: 0.6cqh;
|
gap: 0.6cqh;
|
||||||
|
|
||||||
font-family: var(--font-ui);
|
font-family: var(--font-ui);
|
||||||
font-size: 1.8cqh;
|
font-size: 1.8cqh;
|
||||||
|
|
||||||
padding: 0.4cqh 1cqh;
|
padding: 0.4cqh 1cqh;
|
||||||
|
|
||||||
background: var(--bg-void);
|
background: var(--bg-void);
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
|
|
||||||
border: var(--border-width) solid var(--border-hairline);
|
border: var(--border-width) solid var(--border-hairline);
|
||||||
border-radius: var(--radius-sm);
|
border-radius: var(--radius-sm);
|
||||||
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
|
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.magnitude-selector__chip.active {
|
.magnitude-selector__chip.active {
|
||||||
@@ -148,7 +206,17 @@
|
|||||||
.magnitude-selector__swatch {
|
.magnitude-selector__swatch {
|
||||||
width: 1.2cqh;
|
width: 1.2cqh;
|
||||||
height: 1.2cqh;
|
height: 1.2cqh;
|
||||||
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: var(--chip-color);
|
background: var(--chip-color);
|
||||||
|
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.magnitude-selector__label {
|
||||||
|
min-width: 0;
|
||||||
|
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ function buildCurvesForChannels<T extends string>(
|
|||||||
): Curve[] {
|
): Curve[] {
|
||||||
const curves: Curve[] = [];
|
const curves: Curve[] = [];
|
||||||
|
|
||||||
channels.forEach((channel) => {
|
[...channels].reverse().forEach((channel) => {
|
||||||
if (!selected.has(channel)) return;
|
if (!selected.has(channel)) return;
|
||||||
const { geq, peqCrossover, total } = getCurves(channel);
|
const { geq, peqCrossover, total } = getCurves(channel);
|
||||||
const color = colors[channel];
|
const color = colors[channel];
|
||||||
@@ -292,9 +292,10 @@ function ChannelSelector<T extends string>({
|
|||||||
className={`magnitude-selector__chip${isOn ? ' active' : ''}`}
|
className={`magnitude-selector__chip${isOn ? ' active' : ''}`}
|
||||||
style={{ '--chip-color': colors[channel] } as React.CSSProperties}
|
style={{ '--chip-color': colors[channel] } as React.CSSProperties}
|
||||||
onClick={() => onToggle(channel)}
|
onClick={() => onToggle(channel)}
|
||||||
|
title={labels[channel]}
|
||||||
>
|
>
|
||||||
<span className="magnitude-selector__swatch" />
|
<span className="magnitude-selector__swatch" />
|
||||||
{labels[channel]}
|
<span className="magnitude-selector__label">{labels[channel]}</span>
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
@@ -427,14 +428,16 @@ function GainSection({
|
|||||||
<div className="gain-linear-graph-section">
|
<div className="gain-linear-graph-section">
|
||||||
<div className="gain-graph-panel">
|
<div className="gain-graph-panel">
|
||||||
<div className="gain-graph-title-row">
|
<div className="gain-graph-title-row">
|
||||||
<div className="gain-graph-title">Input Response</div>
|
<div className="gain-graph-title-line">
|
||||||
<Button
|
<div className="gain-graph-title">Input Response</div>
|
||||||
variant="toggle"
|
<Button
|
||||||
className={showInputStages ? 'active' : ''}
|
variant={showInputStages ? 'outline' : 'ghost'}
|
||||||
onClick={() => setShowInputStages((v) => !v)}
|
className="gain-stages-toggle"
|
||||||
>
|
onClick={() => setShowInputStages((v) => !v)}
|
||||||
Show stages
|
>
|
||||||
</Button>
|
Show stages
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
<ChannelSelector
|
<ChannelSelector
|
||||||
channels={INPUT_ORDER}
|
channels={INPUT_ORDER}
|
||||||
labels={inputLabels}
|
labels={inputLabels}
|
||||||
@@ -471,14 +474,17 @@ function GainSection({
|
|||||||
|
|
||||||
<div className="gain-graph-panel">
|
<div className="gain-graph-panel">
|
||||||
<div className="gain-graph-title-row">
|
<div className="gain-graph-title-row">
|
||||||
<div className="gain-graph-title">Output Response</div>
|
<div className="gain-graph-title-line">
|
||||||
<Button
|
<div className="gain-graph-title">Output Response</div>
|
||||||
variant="toggle"
|
<Button
|
||||||
className={showOutputStages ? 'active' : ''}
|
variant={showOutputStages ? 'outline' : 'ghost'}
|
||||||
onClick={() => setShowOutputStages((v) => !v)}
|
className="gain-stages-toggle"
|
||||||
>
|
onClick={() => setShowOutputStages((v) => !v)}
|
||||||
Show stages
|
>
|
||||||
</Button>
|
Show stages
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<ChannelSelector
|
<ChannelSelector
|
||||||
channels={OUTPUT_ORDER}
|
channels={OUTPUT_ORDER}
|
||||||
labels={outputLabels}
|
labels={outputLabels}
|
||||||
|
|||||||
Reference in New Issue
Block a user