Commit 2ef491fa authored by Jean-Karim Heriche's avatar Jean-Karim Heriche

Forgot to commit some files

parent dbc4ebaf
......@@ -104,3 +104,11 @@
font-size: 12px;
font-family: Tahoma, Geneva, sans-serif;
}
.imageViewer-drawingLayer {
position: absolute;
z-index: 5;
width: 100%;
height:100%;
pointer-events: none;
}
......@@ -380,8 +380,34 @@ function Viewer(parent){
image.style.cursor = cursor;
previousMousePosition = getMouseXY(event);
Shiny.setInputValue("explore_module-image-pixelPosition", viewer.getPixelPosition(event));
image.onmousemove = viewer.dragImage;
if(event.shiftKey) {
console.log("shift pressed");
if(!document.getElementsByClassName("imageViewer-drawingLayer")[0]) {
drawingLayer = createElement('canvas', 'drawingLayer', canvas);
drawingLayer.width = canvas.offsetWidth;
drawingLayer.height = canvas.offsetHeight;
} else {
drawingLayer = document.getElementsByClassName("imageViewer-drawingLayer")[0];
var ctx = drawingLayer.getContext('2d');
ctx.fillStyle = 'cyan';
var mouseCoords = getMouseXY(event);
var imageCoords = getObjectXY(canvas);
coords = [Math.floor(mouseCoords[0]-imageCoords[0]) + 1, Math.floor(mouseCoords[1]-imageCoords[1]) + 1];
console.log("Mouse at: "+coords[0]+"x"+coords[1]);
var radius = 10;
ctx.moveTo(coords[0], coords[1]);
ctx.arc(coords[0], coords[1], radius, 0, Math.PI * 2, false);
ctx.fill();
}
} else {
if(document.getElementsByClassName("imageViewer-drawingLayer")[0]) {
document.getElementsByClassName("imageViewer-drawingLayer")[0].remove();
} else {
Shiny.setInputValue("explore_module-image-pixelPosition", viewer.getPixelPosition(event));
}
}
//image.onmousemove = viewer.dragImage;
}
......
......@@ -143,7 +143,6 @@ server <- function(input,output,session){
}
}, ignoreNULL = TRUE, ignoreInit = TRUE)
# dimensionality reduction
observeEvent(input$tabs_menu,{
if(input$tabs_menu=="dimensionality_reduction"){
......
......@@ -18,6 +18,9 @@ Custom CSS for the image data explorer
padding-right:5px !important;
padding-left:5px !important;
}
.box {
margin-bottom: 10px;
}
/* Change postion and size of notification box */
.shiny-notification {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment