Skip to content

Commit c7d466a

Browse files
evompmiclaude
andcommitted
feat(aequorin): plot-height slider for chart aspect ratio
Adds a "Plot height" SliderControl under the aequorin Style sidebar tile (250–800 px against a fixed 800 px width, default 420 ≈ 1.9 : 1). Persisted on VIS_INIT_AEQUORIN.plotHeight via the auto-prefs reducer and threaded through PlotPanel → Chart's vbH. Faceted view scales in lockstep — facet vbH = Math.round(260 · plotHeight / 420) — so one control drives the whole grid's ratio. Default value preserves the existing 800×420 / 400×260 layout exactly. Motivation: makes it easy to drop a more square chart into multi-panel figures without re-cropping the exported SVG. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9d74037 commit c7d466a

9 files changed

Lines changed: 37 additions & 14 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Added
1111

12+
- **Aequorin — "Plot height" slider** under the Style sidebar tile.
13+
Adjusts the curve plot's aspect ratio (250–800 px height against a
14+
fixed 800 px width, default 420 ≈ 1.9 : 1) so users can drop a more
15+
square chart into multi-panel figures. The faceted view scales
16+
proportionally — facet height = `260 · plotHeight / 420` — so the
17+
whole grid follows the same ratio.
1218
- **Module-layering CI gate** — the four-tier rule from
1319
`docs/architecture.md` §3 (`_core` ← `_shell` ← `tools/<tool>` ← `_app`)
1420
is now mechanically enforced by `dependency-cruiser`. New

‎tools/_app/chunks/app-PBK3SRXB.js.map‎

Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tools/_app/chunks/app-QPRZX2SG.js.map‎

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tools/_app/index.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tools/aequorin/app.tsx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ const VIS_INIT_AEQUORIN = {
4848
lineWidth: 2,
4949
ribbonOpacity: 0.3,
5050
gridColor: "#e0e0e0",
51+
// Chart height in SVG viewBox units. Width stays at 800; sliding this
52+
// changes the chart's aspect ratio (420 ≈ 1.9:1 default, 800 ≈ square).
53+
// Facets scale proportionally — facetVbH = 260 * plotHeight / 420.
54+
plotHeight: 420,
5155
timeStep: 1,
5256
baseUnit: "s",
5357
displayUnit: "s",
@@ -1968,6 +1972,7 @@ export function App() {
19681972
lineWidth={vis.lineWidth}
19691973
ribbonOpacity={vis.ribbonOpacity}
19701974
gridColor={vis.gridColor}
1975+
plotHeight={vis.plotHeight}
19711976
timeStep={vis.timeStep}
19721977
baseUnit={vis.baseUnit}
19731978
displayUnit={vis.displayUnit}

‎tools/aequorin/controls.tsx‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,15 @@ export function PlotControls({
300300
step={0.05}
301301
onChange={(v) => updVis({ ribbonOpacity: v })}
302302
/>
303+
<SliderControl
304+
label="Plot height"
305+
value={vis.plotHeight}
306+
displayValue={`${(vis.plotHeight / 800).toFixed(2)} : 1`}
307+
min={250}
308+
max={800}
309+
step={10}
310+
onChange={(v) => updVis({ plotHeight: v })}
311+
/>
303312
</ControlSection>
304313

305314
{/* Barplot controls */}

‎tools/aequorin/helpers.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ export interface AequorinVis {
419419
lineWidth: number;
420420
ribbonOpacity: number;
421421
gridColor: string;
422+
plotHeight: number;
422423
timeStep: number;
423424
baseUnit: string;
424425
displayUnit: string;
@@ -747,6 +748,7 @@ export interface PlotPanelProps {
747748
lineWidth: number;
748749
ribbonOpacity: number;
749750
gridColor: string;
751+
plotHeight: number;
750752
timeStep: number;
751753
baseUnit: string;
752754
displayUnit: string;

‎tools/aequorin/plot-area.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export const PlotPanel = React.forwardRef<PlotPanelHandle, PlotPanelProps>(funct
4747
lineWidth,
4848
ribbonOpacity,
4949
gridColor,
50+
plotHeight,
5051
timeStep,
5152
baseUnit,
5253
displayUnit,
@@ -635,7 +636,7 @@ export const PlotPanel = React.forwardRef<PlotPanelHandle, PlotPanelProps>(funct
635636
yMin,
636637
yMax,
637638
vbW: 400,
638-
vbH: 260,
639+
vbH: Math.max(80, Math.round((260 * plotHeight) / 420)),
639640
xLabel: xLabelText,
640641
yLabel: formula === "none" ? "RLU (raw)" : "[Ca²⁺] (µM)",
641642
plotBg,
@@ -674,7 +675,7 @@ export const PlotPanel = React.forwardRef<PlotPanelHandle, PlotPanelProps>(funct
674675
yMin={yMin}
675676
yMax={yMax}
676677
vbW={800}
677-
vbH={420}
678+
vbH={plotHeight}
678679
xLabel={xLabelText}
679680
yLabel={formula === "none" ? "RLU (raw)" : "[Ca²⁺] (µM)"}
680681
plotBg={plotBg}

0 commit comments

Comments
 (0)