diff --git a/packages/frontend/src/cleanup/components/viewer/FilterActiveRow.vue b/packages/frontend/src/cleanup/components/viewer/FilterActiveRow.vue deleted file mode 100644 index e69de29bb..000000000 diff --git a/packages/frontend/src/cleanup/components/viewer/FilterActive.vue b/packages/frontend/src/cleanup/components/viewer/FilterCategoryActive.vue similarity index 82% rename from packages/frontend/src/cleanup/components/viewer/FilterActive.vue rename to packages/frontend/src/cleanup/components/viewer/FilterCategoryActive.vue index 78c8155f2..7b2eb1d8d 100644 --- a/packages/frontend/src/cleanup/components/viewer/FilterActive.vue +++ b/packages/frontend/src/cleanup/components/viewer/FilterCategoryActive.vue @@ -2,7 +2,12 @@
- + mdi-palette @@ -22,21 +27,21 @@ {{ type.name }}
null - }, - active: { type: Boolean, default: false } + } }, data() { return { @@ -84,7 +88,7 @@ export default { typeMap: [], colorBy: false, appliedFilter: {}, - legend: null + legend: {} } }, watch: { @@ -96,7 +100,6 @@ export default { ? { type: 'category', property: this.filter.targetKey } : null let res = await window.__viewer.applyFilter(this.appliedFilter) - console.log(res) this.mashColorLegend(res.colorLegend) } }, @@ -107,9 +110,18 @@ export default { window.__viewer.applyFilter(null) }, methods: { - mashColorLegend(thanksCristi) { - if (!thanksCristi) return - // TODO + mashColorLegend(colorLegend) { + // just adds to our colors + if (!colorLegend) return + let keys = Object.keys(colorLegend) + for (const key of keys) { + if (!this.legend[key]) this.$set(this.legend, key, colorLegend[key]) + //this.legend[key] = colorLegend[key] + // const idx = this.legend.indexOf((o) => o.name === key) + // if (idx === -1) { + // this.legend.push({ name: key, color: colorLegend[key] }) + // } + } }, async toggleFilter(type) { let indx = this.filtered.indexOf(type) @@ -117,9 +129,10 @@ export default { else this.filtered.splice(indx, 1) this.hidden.splice(0, this.hidden.length) if (this.filtered.length === 0) { - window.__viewer.applyFilter( + let res = window.__viewer.applyFilter( this.colorBy ? { colorBy: { type: 'category', property: this.filter.targetKey } } : null ) + this.mashColorLegend(res.colorLegend) this.appliedFilter = {} } else { let filterObj = { @@ -139,9 +152,10 @@ export default { else this.hidden.splice(indx, 1) this.filtered.splice(0, this.filtered.length) if (this.hidden.length === 0) { - window.__viewer.applyFilter( + let res = await window.__viewer.applyFilter( this.colorBy ? { colorBy: { type: 'category', property: this.filter.targetKey } } : null ) + this.mashColorLegend(res.colorLegend) this.appliedFilter = {} } else { let filterObj = { diff --git a/packages/frontend/src/cleanup/components/viewer/FilterNumericActive.vue b/packages/frontend/src/cleanup/components/viewer/FilterNumericActive.vue new file mode 100644 index 000000000..c48a3194a --- /dev/null +++ b/packages/frontend/src/cleanup/components/viewer/FilterNumericActive.vue @@ -0,0 +1,143 @@ + + + diff --git a/packages/frontend/src/cleanup/components/viewer/FilterRowSelect.vue b/packages/frontend/src/cleanup/components/viewer/FilterRowSelect.vue new file mode 100644 index 000000000..279cccb2a --- /dev/null +++ b/packages/frontend/src/cleanup/components/viewer/FilterRowSelect.vue @@ -0,0 +1,42 @@ + + + diff --git a/packages/frontend/src/cleanup/components/viewer/FilterSingle.vue b/packages/frontend/src/cleanup/components/viewer/FilterSingle.vue deleted file mode 100644 index 851d33c0a..000000000 --- a/packages/frontend/src/cleanup/components/viewer/FilterSingle.vue +++ /dev/null @@ -1,119 +0,0 @@ - - - diff --git a/packages/frontend/src/cleanup/components/viewer/Filters.vue b/packages/frontend/src/cleanup/components/viewer/Filters.vue index 21b2e495c..49a057d48 100644 --- a/packages/frontend/src/cleanup/components/viewer/Filters.vue +++ b/packages/frontend/src/cleanup/components/viewer/Filters.vue @@ -39,8 +39,11 @@
-
- +
+ +
+
+
TODO: reccommended filters @@ -56,7 +59,7 @@ style="position: sticky; top: 110px; z-index: 6" />
- +
@@ -67,8 +70,9 @@