redefine_global_view_state = (zoom_data, viewId, zoom, target) => {
var globalViewState
if (viewId === 'matrix') {
globalViewState = {
matrix: {
zoom: [zoom[0], zoom[1]],
target: [target[0], target[1]]
},
rows: {
zoom: [ini_zoom_x, zoom[1]],
target: [label_row_x, target[1]]
},
cols: {
zoom: [zoom[0], ini_zoom_y],
target: [target[0], label_col_y]
},
}
} else if (viewId === 'cols'){
globalViewState = {
matrix: {
zoom: [zoom[0], zoom_data.zoom_y],
target: [target[0], zoom_data.pan_y]
},
rows: {
zoom: [ini_zoom_x, zoom_data.zoom_y],
target: [label_row_x, zoom_data.pan_y]
},
cols: {
zoom: [zoom[0], ini_zoom_y],
target: [target[0], label_col_y]
},
}
} else if (viewId === 'rows'){
globalViewState = {
matrix: {
zoom: [zoom_data.zoom_x, zoom[1]],
target: [zoom_data.pan_x, target[1]]
},
rows: {
zoom: [ini_zoom_x, zoom[1]],
target: [label_row_x, target[1]]
},
cols: {
zoom: [zoom_data.zoom_x, ini_zoom_y],
target: [zoom_data.pan_x, label_col_y]
},
}
}
return globalViewState
}