Dashboard curve: Overlay as its own entry next to the single channels
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3a9059d420
commit
fe24b620bf
3 files changed
+27
-15
No files matched your search
+3
-2
@@ -1164,7 +1164,7 @@ const hasQ = type => [0, 4, 6, 7, 8].includes(type);
|
||||
const OUT_COLORS = ["#f97316", "#facc15", "#4ade80", "#e879f9", "#60a5fa", "#fb7185", "#2dd4bf", "#c084fc"];
|
||||
const chColor = (d, kind, i) => custColor(d, kind, i) || (kind === "in" ? IN_COLORS[i] : OUT_COLORS[i]);
|
||||
|
||||
// opts: { mode: "mag" | "phase", overlays: [{ ch, color }] }
|
||||
// opts: { mode: "mag" | "phase", overlays: [{ ch, color }], overlaysOnly: no curve or bands of `ch` itself }
|
||||
function drawCurve(canvas, ch, selBand, opts = canvas.curveOpts ? canvas.curveOpts() : {}) {
|
||||
const dpr = window.devicePixelRatio || 1, W = canvas.clientWidth, H = canvas.clientHeight;
|
||||
if (!W || !H) return null;
|
||||
@@ -1211,7 +1211,8 @@ function drawCurve(canvas, ch, selBand, opts = canvas.curveOpts ? canvas.curveOp
|
||||
g.strokeStyle = color; g.lineWidth = width; g.lineJoin = "round";
|
||||
for (const sg of segs) { g.beginPath(); sg.forEach(([x, y], i) => i ? g.lineTo(x, y) : g.moveTo(x, y)); g.stroke(); }
|
||||
};
|
||||
for (const o of opts.overlays || []) stroke(trace(f => channelH(o.ch, f)), o.color + "cc", 1.5);
|
||||
for (const o of opts.overlays || []) stroke(trace(f => channelH(o.ch, f)), o.color + "cc", opts.overlaysOnly ? 2 : 1.5);
|
||||
if (opts.overlaysOnly) return { fx, dy, W, H, phase }; // dashboard: only the compared channels
|
||||
const sb = ch.peq[selBand];
|
||||
if (!phase && sb && !sb.bypass && !ch.peq_bypass) { // selected band's own contribution, filled
|
||||
g.beginPath(); g.moveTo(0, dy(0));
|
||||
|
||||
Reference in new issue
Block a user