diff --git a/src/App.jsx b/src/App.jsx index 0feebd6..f423f6f 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -133,6 +133,62 @@ const filterDatasetForPlotType = (dataset, plotType) => { return dataset; }; +const PreviewPanel = ({ lensCurves }) => { + const previewItems = lensCurves.map((curve) => { + const infinityStat = curve.checkpointStats.find((stat) => !Number.isFinite(stat.separation)); + const blurPercent = infinityStat?.blurPercentOfDiagonal ?? 0; + + return { + lens: curve.lens, + blurPercent, + colorIndex: curve.colorIndex, + }; + }); + + const maxBlurPercent = previewItems.reduce((maxValue, item) => Math.max(maxValue, item.blurPercent), 0); + const denominator = maxBlurPercent > 0 ? maxBlurPercent : 1; + + return ( +
+

Bokeh preview

+ {previewItems.length === 0 ? ( +
Select at least one lens to preview its blur at infinity.
+ ) : ( +
+ {previewItems.map((item) => { + const normalized = Math.min(item.blurPercent / denominator, 1); + const diameter = Math.max(18, 30 + normalized * 70); + const paletteColor = COLOR_PALETTE[item.colorIndex % COLOR_PALETTE.length]; + + return ( +
+
+ {item.lens.name} +
+
+
{item.lens.name}
+
+ ∞ blur {formatNumber(item.blurPercent, 2)}% +
+
+
+ ); + })} +
+ )} +
+ ); +}; + const PlotSection = ({ lensCurves, plotType, setPlotType }) => { const axisConfig = getAxisConfig(plotType); @@ -704,6 +760,7 @@ const App = () => { />
+ {