From cbc9410d8bbb23f720b8157198c31d881cd2b99d Mon Sep 17 00:00:00 2001 From: YukaUU Date: Thu, 28 Mar 2024 03:26:25 +0900 Subject: [PATCH 1/5] Saving Marks Should Include User's X, Y, Zoom, etc #844 --- apps/viewer/init.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/viewer/init.js b/apps/viewer/init.js index 8a0c8643d..a609cb0d9 100644 --- a/apps/viewer/init.js +++ b/apps/viewer/init.js @@ -223,6 +223,7 @@ function initCore() { // for support QUIP 2.0 const data = Array.isArray(e.data) ? e.data[e.data.selected] : e.data; + console.log("data", Array.isArray(e.data),data, e.data, e.data[e.data.selected]); const type = data.provenance.analysis.source; let body; let attributes; @@ -257,6 +258,13 @@ function initCore() { attributes = data.properties.annotations; if (area) attributes.area = area; if (circumference) attributes.circumference = circumference; + + const states = StatesHelper.getCurrentStates(isImageCoordinate = false); + if (!states) return; + attributes.X = states.x + attributes.Y = states.y + attributes.zoom = states.z + body = convertHumanAnnotationToPopupBody(attributes); if ( data.geometries && @@ -339,6 +347,7 @@ function initCore() { dataCopy.geometries, ); } + console.log("abc",$CAMIC.viewer); editAnnoCallback(id, slide, dataCopy); }); From 13efcd9b5e5e886086347988553440fb74ea61c9 Mon Sep 17 00:00:00 2001 From: YukaUU Date: Fri, 29 Mar 2024 00:26:34 +0900 Subject: [PATCH 2/5] fix image coordinate --- apps/viewer/init.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/viewer/init.js b/apps/viewer/init.js index a609cb0d9..69e1cdea0 100644 --- a/apps/viewer/init.js +++ b/apps/viewer/init.js @@ -247,7 +247,7 @@ function initCore() { data.geometries.features[data.selected] && data.geometries.features[data.selected].properties.circumference ) { - circumference = `${Math.round( + circumference = `${Math. round( data.geometries.features[data.selected].properties .circumference, )} μm`; @@ -259,12 +259,12 @@ function initCore() { if (area) attributes.area = area; if (circumference) attributes.circumference = circumference; - const states = StatesHelper.getCurrentStates(isImageCoordinate = false); + const states = StatesHelper.getCurrentStates(isImageCoordinate = true); if (!states) return; attributes.X = states.x attributes.Y = states.y attributes.zoom = states.z - + body = convertHumanAnnotationToPopupBody(attributes); if ( data.geometries && From b1a694edff9d6619f848c337e540c8dbc27e3012 Mon Sep 17 00:00:00 2001 From: YukaUU Date: Fri, 29 Mar 2024 01:27:10 +0900 Subject: [PATCH 3/5] delete console --- apps/viewer/init.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/viewer/init.js b/apps/viewer/init.js index 69e1cdea0..6d1fc5c2a 100644 --- a/apps/viewer/init.js +++ b/apps/viewer/init.js @@ -223,7 +223,6 @@ function initCore() { // for support QUIP 2.0 const data = Array.isArray(e.data) ? e.data[e.data.selected] : e.data; - console.log("data", Array.isArray(e.data),data, e.data, e.data[e.data.selected]); const type = data.provenance.analysis.source; let body; let attributes; @@ -347,7 +346,6 @@ function initCore() { dataCopy.geometries, ); } - console.log("abc",$CAMIC.viewer); editAnnoCallback(id, slide, dataCopy); }); From c89ca77ceb6cef998c56b0d196679798a9e3bbfd Mon Sep 17 00:00:00 2001 From: YukaUU Date: Fri, 29 Mar 2024 01:28:38 +0900 Subject: [PATCH 4/5] delete space --- apps/viewer/init.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/viewer/init.js b/apps/viewer/init.js index 6d1fc5c2a..a62ac342d 100644 --- a/apps/viewer/init.js +++ b/apps/viewer/init.js @@ -246,7 +246,7 @@ function initCore() { data.geometries.features[data.selected] && data.geometries.features[data.selected].properties.circumference ) { - circumference = `${Math. round( + circumference = `${Math.round( data.geometries.features[data.selected].properties .circumference, )} μm`; From 603f41333624dfe8eb012270be3e26885d4299ab Mon Sep 17 00:00:00 2001 From: YukaUU Date: Fri, 29 Mar 2024 01:34:42 +0900 Subject: [PATCH 5/5] fix lint error --- apps/viewer/init.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/viewer/init.js b/apps/viewer/init.js index a62ac342d..94f89c2b0 100644 --- a/apps/viewer/init.js +++ b/apps/viewer/init.js @@ -260,9 +260,9 @@ function initCore() { const states = StatesHelper.getCurrentStates(isImageCoordinate = true); if (!states) return; - attributes.X = states.x - attributes.Y = states.y - attributes.zoom = states.z + attributes.X = states.x; + attributes.Y = states.y; + attributes.zoom = states.z; body = convertHumanAnnotationToPopupBody(attributes); if (