📏 Adjusted histogram height
This commit is contained in:
@@ -11,7 +11,6 @@ export const Canvas = (data) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const context = canvas.current.getContext("2d");
|
const context = canvas.current.getContext("2d");
|
||||||
|
|
||||||
const guideHeight = 8;
|
const guideHeight = 8;
|
||||||
const startY = height - guideHeight;
|
const startY = height - guideHeight;
|
||||||
const dx = width / 256;
|
const dx = width / 256;
|
||||||
@@ -27,21 +26,21 @@ export const Canvas = (data) => {
|
|||||||
context.strokeStyle = "rgba(220,0,0,0.5)";
|
context.strokeStyle = "rgba(220,0,0,0.5)";
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.moveTo(x, startY);
|
context.moveTo(x, startY);
|
||||||
context.lineTo(x, startY - colorHistogramData.r[i] * dy);
|
context.lineTo(x, startY - colorHistogramData.r[i] / 10);
|
||||||
context.closePath();
|
context.closePath();
|
||||||
context.stroke();
|
context.stroke();
|
||||||
// Green
|
// Green
|
||||||
context.strokeStyle = "rgba(0,210,0,0.5)";
|
context.strokeStyle = "rgba(0,210,0,0.5)";
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.moveTo(x, startY);
|
context.moveTo(x, startY);
|
||||||
context.lineTo(x, startY - colorHistogramData.g[i] * dy);
|
context.lineTo(x, startY - colorHistogramData.g[i] / 10);
|
||||||
context.closePath();
|
context.closePath();
|
||||||
context.stroke();
|
context.stroke();
|
||||||
// Blue
|
// Blue
|
||||||
context.strokeStyle = "rgba(0,0,255,0.5)";
|
context.strokeStyle = "rgba(0,0,255,0.5)";
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.moveTo(x, startY);
|
context.moveTo(x, startY);
|
||||||
context.lineTo(x, startY - colorHistogramData.b[i] * dy);
|
context.lineTo(x, startY - colorHistogramData.b[i] / 10);
|
||||||
context.closePath();
|
context.closePath();
|
||||||
context.stroke();
|
context.stroke();
|
||||||
|
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ function fileOpsReducer(state = initialState, action) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
case IMG_ANALYSIS_DATA_FETCH_SUCCESS: {
|
case IMG_ANALYSIS_DATA_FETCH_SUCCESS: {
|
||||||
|
console.log(action)
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
imageAnalysisResults: action.result,
|
imageAnalysisResults: action.result,
|
||||||
|
|||||||
Reference in New Issue
Block a user