{
let plt1, plt2;
plt1 = Plot.plot({
x: { nice: true },
y: { nice: true, domain: [-150, 0], label: "dB" },
grid: true,
color: { nice: true, legend: true, scheme: "Tableau10", columns: 6 },
marks: [
Plot.line(data, {
x: "freq",
y: (d) => Math.log10(Math.min(d.resp, 1.0)) * 20,
stroke: "name",
opacity: 0.5
}),
Plot.line(
data.filter((d) => d.name === select),
{
x: "freq",
y: (d) => Math.log10(Math.min(d.resp, 1.0)) * 20,
stroke: "black",
strokeWidth: 4
}
)
]
});
plt2 = Plot.plot({
x: { nice: true },
y: { nice: true },
grid: true,
color: { nice: true, legend: true, scheme: "Tableau10", columns: 6 },
marks: [
Plot.line(data, {
x: "time",
y: "amplitude",
stroke: "name",
opacity: 0.5
}),
Plot.line(
data.filter((d) => d.name === select),
{
x: "time",
y: "amplitude",
stroke: "black",
strokeWidth: 4
}
)
]
});
return htl.html`
<div style="display: flex">
${plt1}
${plt2}
</div>
`;
}