Show axis units on blur plot
This commit is contained in:
+7
-5
@@ -52,17 +52,17 @@ const formatAperture = (value) => {
|
|||||||
const getAxisConfig = (plotType) => {
|
const getAxisConfig = (plotType) => {
|
||||||
switch (plotType) {
|
switch (plotType) {
|
||||||
case PlotTypes.DISTANCE:
|
case PlotTypes.DISTANCE:
|
||||||
return { label: 'Scene distance (m)', accessor: (point) => point.sceneDistance };
|
return { label: 'Scene distance (m)', accessor: (point) => point.sceneDistance, ticksuffix: ' m' };
|
||||||
case PlotTypes.ZOOMED:
|
case PlotTypes.ZOOMED:
|
||||||
return { label: 'Scene distance (m)', accessor: (point) => point.sceneDistance };
|
return { label: 'Scene distance (m)', accessor: (point) => point.sceneDistance, ticksuffix: ' m' };
|
||||||
case PlotTypes.NORMALIZED:
|
case PlotTypes.NORMALIZED:
|
||||||
return { label: 'Scene distance ÷ subject distance', accessor: (point) => point.normalizedDistance };
|
return { label: 'Scene distance ÷ subject distance', accessor: (point) => point.normalizedDistance };
|
||||||
case PlotTypes.SEPARATION:
|
case PlotTypes.SEPARATION:
|
||||||
return { label: 'Focus-relative distance (m)', accessor: (point) => point.focusOffset };
|
return { label: 'Focus-relative distance (m)', accessor: (point) => point.focusOffset, ticksuffix: ' m' };
|
||||||
case PlotTypes.DIOPTER:
|
case PlotTypes.DIOPTER:
|
||||||
return { label: 'Diopter difference (1/m)', accessor: (point) => point.diopterDifference };
|
return { label: 'Diopter difference (1/m)', accessor: (point) => point.diopterDifference, ticksuffix: ' 1/m' };
|
||||||
default:
|
default:
|
||||||
return { label: 'Scene distance (m)', accessor: (point) => point.sceneDistance };
|
return { label: 'Scene distance (m)', accessor: (point) => point.sceneDistance, ticksuffix: ' m' };
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -144,6 +144,7 @@ const PlotSection = ({ lensCurves, plotType, setPlotType }) => {
|
|||||||
title: axisConfig.label,
|
title: axisConfig.label,
|
||||||
gridcolor: 'rgba(148, 163, 184, 0.2)',
|
gridcolor: 'rgba(148, 163, 184, 0.2)',
|
||||||
zerolinecolor: 'rgba(148, 163, 184, 0.4)',
|
zerolinecolor: 'rgba(148, 163, 184, 0.4)',
|
||||||
|
...(axisConfig.ticksuffix ? { ticksuffix: axisConfig.ticksuffix } : {}),
|
||||||
},
|
},
|
||||||
yaxis: {
|
yaxis: {
|
||||||
title: 'Blur radius (% of sensor diagonal)',
|
title: 'Blur radius (% of sensor diagonal)',
|
||||||
@@ -151,6 +152,7 @@ const PlotSection = ({ lensCurves, plotType, setPlotType }) => {
|
|||||||
gridcolor: 'rgba(148, 163, 184, 0.2)',
|
gridcolor: 'rgba(148, 163, 184, 0.2)',
|
||||||
zerolinecolor: 'rgba(148, 163, 184, 0.4)',
|
zerolinecolor: 'rgba(148, 163, 184, 0.4)',
|
||||||
range: [0, maxY * 1.1],
|
range: [0, maxY * 1.1],
|
||||||
|
ticksuffix: ' %',
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
useResizeHandler
|
useResizeHandler
|
||||||
|
|||||||
Reference in New Issue
Block a user