Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley committed Sep 19, 2023
1 parent ab79324 commit 0ed1c44
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default {
// Assign colors
this.layers.forEach((layerName) => {
if (!this.compositeLayerInfo[layerName].palette) {
const channelColor = getChannelColor(layerName)
const channelColor = getChannelColor(layerName);
if (channelColor) {
this.compositeLayerInfo[layerName].palette = channelColor;
usedColors.push(channelColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
data() {
return {
value: this.currentValue,
merge: this.maxMerge,
merge: this.maxMerge
};
},
watch: {
Expand All @@ -16,10 +16,10 @@ export default {
this.$emit('updateValue', v);
},
maxMerge(v) {
this.merge = v;
this.merge = v;
},
merge(v) {
this.$emit('updateMaxMerge', v);
this.$emit('updateMaxMerge', v);
}
}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
import Vue from 'vue';
import { getChannelColor } from '../utils/colors';
import {getChannelColor} from '../utils/colors';
import CompositeLayers from './CompositeLayers.vue';
import DualInput from './DualInput.vue';
Expand Down Expand Up @@ -92,64 +93,63 @@ export default Vue.extend({
// rerun update maxmerge?
let style = this.currentModeId > 1 ? Object.assign({}, this.style[this.currentModeId]) : undefined;
if (style && style.preset) delete style.preset;
style = this.maxMergeStyle(style)
style = this.maxMergeStyle(style);
this.frameUpdate(frame, style);
},
maxMergeStyle(style) {
let bandsArray = (style ? style.bands : []) || []
let newBandsArray = []
let frameDeltas = []
const bandsArray = (style ? style.bands : []) || [];
let newBandsArray = [];
let frameDeltas = [];
Object.entries(this.indexInfo).forEach(([indexName, {range, stride, maxMerge}]) => {
if (this.currentModeId === 2 && indexName === 'IndexC') {
// channel compositing is already in bandsArray
// skip permutations for this axis
} else if (maxMerge) {
const axisFrameDeltas = [...Array(range + 1).keys()].map((i) => i*stride)
const axisFrameDeltas = [...Array(range + 1).keys()].map((i) => i * stride);
if (frameDeltas.length) {
const newFrameDeltas = []
const newFrameDeltas = [];
frameDeltas.forEach((d) => {
axisFrameDeltas.forEach((a) => {
newFrameDeltas.push(d+a)
})
})
frameDeltas = newFrameDeltas
newFrameDeltas.push(d + a);
});
});
frameDeltas = newFrameDeltas;
} else {
frameDeltas = axisFrameDeltas
frameDeltas = axisFrameDeltas;
}
}
})
});
if(frameDeltas.length) {
if (frameDeltas.length) {
if (bandsArray.length) {
// some style already applied, add permutations
bandsArray.forEach((b) => {
frameDeltas.forEach((framedelta) => {
newBandsArray.push(
Object.assign({}, b, {framedelta: b.framedelta + framedelta})
)
})
})
);
});
});
} else {
// no style applied yet, create new permutations list
const { bands } = this.metadata
const {bands} = this.metadata;
bands.forEach((b, i) => {
const bandPalette = getChannelColor(b)
const bandPalette = getChannelColor(b);
frameDeltas.forEach((framedelta) => {
newBandsArray.push({
band: i+1,
band: i + 1,
framedelta,
palette: bandPalette
})
})
})
});
});
});
}
} else {
// no max merge permutations to apply, keep old bandsArray
newBandsArray = bandsArray
newBandsArray = bandsArray;
}
console.log(newBandsArray)
return {bands: newBandsArray}
return {bands: newBandsArray};
},
fillMetadata() {
if (!this.metadata.frames) {
Expand Down

0 comments on commit 0ed1c44

Please sign in to comment.