Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions schema/view.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -863,19 +863,19 @@
"type": "object",
"properties": {
"uiSelectionGroup": {
"description": "Name of the UI from which this view can be selected.",
"$ref": "#/definitions/name"
"description": "Name of the UI from which this view can be selected. You have to either specify uiSelectionGroup or uiSelectionGroups.",
"$ref": "#/definitions/name"
},

"uiSelectionGroups": {
"description": "Name of multiple UI elements from which this view can be selected. Values specified here will be
added in addition to the value in 'uiSelectionGroup.'",
"description": "Name of multiple UI elements from which this view can be selected. You have to either specify uiSelectionGroup or uiSelectionGroups",
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/name"
"$ref": "#/definitions/name",
"minItems": 1
}
}
},

"isExclusive": {
"type": "boolean",
Expand Down Expand Up @@ -914,6 +914,9 @@
"$ref": "#/definitions/viewerTransform"
}
},
"required": ["isExclusive", "uiSelectionGroup"],
"oneOf": [
{"required": ["isExclusive", "uiSelectionGroup"]},
{"required": ["isExclusive", "uiSelectionGroups"]}
],
"additionalProperties": false
}
91 changes: 91 additions & 0 deletions specs/examples/single_source_view_selection_groups.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"default": {
"isExclusive": false,
"sourceDisplays": [
{
"imageDisplay": {
"blendingMode": "sum",
"color": "r255-g255-b255-a255",
"contrastLimits": [
290,
23000
],
"name": "em-overview",
"opacity": 1.0,
"sources": [
"em-overview"
]
}
}
],
"sourceTransforms": [
{
"affine": {
"name": "MapScaleMat",
"parameters": [
-0.10198378825464686,
-0.9710562907353596,
0.0,
0.0,
-0.9846441741918877,
0.11862126451903302,
0.0,
0.0,
0.0,
0.0,
29.30832356389215,
0.0
],
"sources": [
"em-overview"
]
}
},
{
"affine": {
"name": "Translation",
"parameters": [
1.0,
0.0,
0.0,
481.249,
0.0,
1.0,
0.0,
493.667,
0.0,
0.0,
1.0,
0.0
],
"sources": [
"em-overview"
]
}
},
{
"affine": {
"name": "manual_shift_a3",
"parameters": [
1.0,
0.0,
0.0,
1.7940359100750243,
0.0,
1.0,
0.0,
-6.6635619517072655,
0.0,
0.0,
1.0,
0.0
],
"sources": [
"em-overview"
]
}
}
],
"uiSelectionGroups": ["bookmark", "view"]
}
}
4 changes: 3 additions & 1 deletion test/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ def test_source(self):
jsonschema.validate(instance=source, schema=schema)

def test_view(self):
examples = ["single_source_view.json", "grid_view.json", "advanced_fig2c.json"]
examples = [
"single_source_view.json", "grid_view.json", "advanced_fig2c.json", "single_source_view_selection_groups.json"
]
self._test_schema("view", examples)

def test_views(self):
Expand Down