From 4c8f572fe96e1d67296236a2dc485c8500776169 Mon Sep 17 00:00:00 2001 From: naglepuff Date: Fri, 20 May 2022 15:10:19 -0400 Subject: [PATCH 1/5] Add `scaleWithZoom` property to heatmaps --- .../girder_large_image_annotation/models/annotation.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/girder_annotation/girder_large_image_annotation/models/annotation.py b/girder_annotation/girder_large_image_annotation/models/annotation.py index ef271a4eb..76c21d311 100644 --- a/girder_annotation/girder_large_image_annotation/models/annotation.py +++ b/girder_annotation/girder_large_image_annotation/models/annotation.py @@ -330,6 +330,14 @@ class AnnotationSchema: 'data. If false (the default), the rangeValues ' 'are the actual data values.', }, + 'scaleWithZoom': { + 'type': 'boolean', + 'description': + 'If true, scale the size of points with the ' + 'zoom level of the map. In this case, the ' + 'radius property refers to the size of points ' + 'at zoom level 0.' + } }, 'required': ['type', 'points'], 'additionalProperties': False, From 4bffe3a0371798dcc7379a71c7759ac13da0d4b1 Mon Sep 17 00:00:00 2001 From: naglepuff Date: Fri, 20 May 2022 15:48:38 -0400 Subject: [PATCH 2/5] Add `scaleWithZoom` to heatmap style dictionary --- .../web_client/annotations/convertFeatures.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/girder_annotation/girder_large_image_annotation/web_client/annotations/convertFeatures.js b/girder_annotation/girder_large_image_annotation/web_client/annotations/convertFeatures.js index 2c9f69d1e..9d979cd86 100644 --- a/girder_annotation/girder_large_image_annotation/web_client/annotations/convertFeatures.js +++ b/girder_annotation/girder_large_image_annotation/web_client/annotations/convertFeatures.js @@ -80,7 +80,8 @@ function convertHeatmap(record, properties, layer) { radius: record.radius || 25, blurRadius: 0, gaussian: true, - color: colorTable.color + color: colorTable.color, + scaleWithZoom: record.scaleWithZoom || false }, position: (d) => ({x: d[0], y: d[1], z: d[2]}), intensity: (d) => d[3] || 0, From 19c9685e7f334b10d72e44e9a0797968febdd6d7 Mon Sep 17 00:00:00 2001 From: naglepuff Date: Fri, 20 May 2022 16:40:17 -0400 Subject: [PATCH 3/5] Update documentation for `scaleWithZoom` --- girder_annotation/docs/annotations.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/girder_annotation/docs/annotations.rst b/girder_annotation/docs/annotations.rst index 2544abdff..cb29a96db 100644 --- a/girder_annotation/docs/annotations.rst +++ b/girder_annotation/docs/annotations.rst @@ -185,6 +185,9 @@ near by values aggregate together when viewed. "normalizeRange": true # If true, the rangeValues are normalized to [0, 1]. If # false, the rangeValues are in the # value domain. Defaults to true. Optional + "scaleWithZoom": true # If true, scale the size of points with the zoom level of + # the map. In this case, the radius property refers to the + # size of points at zoom level 0. Defaults to false. Optional } Grid Data From 615591c594e603a2634e5e83f5989f12aa0fc0ee Mon Sep 17 00:00:00 2001 From: naglepuff Date: Fri, 20 May 2022 16:48:50 -0400 Subject: [PATCH 4/5] Add comma for documentation consistency --- girder_annotation/docs/annotations.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/girder_annotation/docs/annotations.rst b/girder_annotation/docs/annotations.rst index cb29a96db..1df476b73 100644 --- a/girder_annotation/docs/annotations.rst +++ b/girder_annotation/docs/annotations.rst @@ -182,7 +182,7 @@ near by values aggregate together when viewed. # the rangeValues. Optional "rangeValues: [0, 1], # A list of range values corresponding to the colorRange list # and possibly normalized to a scale of [0, 1]. Optional - "normalizeRange": true # If true, the rangeValues are normalized to [0, 1]. If + "normalizeRange": true, # If true, the rangeValues are normalized to [0, 1]. If # false, the rangeValues are in the # value domain. Defaults to true. Optional "scaleWithZoom": true # If true, scale the size of points with the zoom level of From 12ffeb0dcd7b3d16b48f1f371737207a375d55fc Mon Sep 17 00:00:00 2001 From: naglepuff Date: Fri, 20 May 2022 17:02:25 -0400 Subject: [PATCH 5/5] Simplify description of `scaleWithZoom` property --- girder_annotation/docs/annotations.rst | 3 +-- .../girder_large_image_annotation/models/annotation.py | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/girder_annotation/docs/annotations.rst b/girder_annotation/docs/annotations.rst index 1df476b73..b664b3acf 100644 --- a/girder_annotation/docs/annotations.rst +++ b/girder_annotation/docs/annotations.rst @@ -186,8 +186,7 @@ near by values aggregate together when viewed. # false, the rangeValues are in the # value domain. Defaults to true. Optional "scaleWithZoom": true # If true, scale the size of points with the zoom level of - # the map. In this case, the radius property refers to the - # size of points at zoom level 0. Defaults to false. Optional + # the map. Defaults to false. Optional } Grid Data diff --git a/girder_annotation/girder_large_image_annotation/models/annotation.py b/girder_annotation/girder_large_image_annotation/models/annotation.py index 76c21d311..4fab8cde1 100644 --- a/girder_annotation/girder_large_image_annotation/models/annotation.py +++ b/girder_annotation/girder_large_image_annotation/models/annotation.py @@ -334,9 +334,7 @@ class AnnotationSchema: 'type': 'boolean', 'description': 'If true, scale the size of points with the ' - 'zoom level of the map. In this case, the ' - 'radius property refers to the size of points ' - 'at zoom level 0.' + 'zoom level of the map.' } }, 'required': ['type', 'points'],