📏 Adjusted histogram height

This commit is contained in:
2022-05-03 09:42:24 -07:00
parent bb54f3e107
commit c3d8a3db74
2 changed files with 4 additions and 4 deletions

View File

@@ -11,7 +11,6 @@ export const Canvas = (data) => {
useEffect(() => {
const context = canvas.current.getContext("2d");
const guideHeight = 8;
const startY = height - guideHeight;
const dx = width / 256;
@@ -27,21 +26,21 @@ export const Canvas = (data) => {
context.strokeStyle = "rgba(220,0,0,0.5)";
context.beginPath();
context.moveTo(x, startY);
context.lineTo(x, startY - colorHistogramData.r[i] * dy);
context.lineTo(x, startY - colorHistogramData.r[i] / 10);
context.closePath();
context.stroke();
// Green
context.strokeStyle = "rgba(0,210,0,0.5)";
context.beginPath();
context.moveTo(x, startY);
context.lineTo(x, startY - colorHistogramData.g[i] * dy);
context.lineTo(x, startY - colorHistogramData.g[i] / 10);
context.closePath();
context.stroke();
// Blue
context.strokeStyle = "rgba(0,0,255,0.5)";
context.beginPath();
context.moveTo(x, startY);
context.lineTo(x, startY - colorHistogramData.b[i] * dy);
context.lineTo(x, startY - colorHistogramData.b[i] / 10);
context.closePath();
context.stroke();

View File

@@ -170,6 +170,7 @@ function fileOpsReducer(state = initialState, action) {
};
}
case IMG_ANALYSIS_DATA_FETCH_SUCCESS: {
console.log(action)
return {
...state,
imageAnalysisResults: action.result,