Skip to content

Commit

Permalink
Merge pull request #288 from Kitware/unroll-layers
Browse files Browse the repository at this point in the history
Unroll layers.
  • Loading branch information
manthey authored Oct 10, 2022
2 parents 87f73ca + 4668b75 commit 1ae30d3
Show file tree
Hide file tree
Showing 7 changed files with 390 additions and 321 deletions.
37 changes: 28 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^6.0.1",
"geojs": "^1.10.4",
"geojs": "^1.10.11",
"node-sass": "^7.0.1",
"prettier": "^1.19.1",
"pug": "^3.0.1",
Expand Down
27 changes: 21 additions & 6 deletions src/components/AnnotationViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ export default class AnnotationViewer extends Vue {
@Prop()
readonly tileHeight: any;
@Prop()
readonly lowestLayer: any;
@Prop()
readonly layerCount: any;
get displayWorkerPreview() {
return this.propertiesStore.displayWorkerPreview;
}
Expand All @@ -92,12 +98,21 @@ export default class AnnotationViewer extends Vue {
}
get visibleChannels() {
return this.layers.reduce((channels: number[], layer: IDisplayLayer) => {
if (layer.visible && !channels.includes(layer.channel)) {
return [...channels, layer.channel];
}
return [...channels];
}, []);
return this.layers.reduce(
(channels: number[], layer: IDisplayLayer, idx: number) => {
if (
idx < this.lowestLayer ||
idx >= this.lowestLayer + this.layerCount
) {
return [...channels];
}
if (layer.visible && !channels.includes(layer.channel)) {
return [...channels, layer.channel];
}
return [...channels];
},
[]
);
}
get filteredAnnotations() {
Expand Down
Loading

0 comments on commit 1ae30d3

Please sign in to comment.