Commit 57c91e47 authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

Added id filter feature to boxplot

parent 4c054452
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
<svg :width="width" <svg :width="width"
:height="height"> :height="height">
<rect x="0" y="0" :height="height" :width="width" style="opacity: 0;" @click="resetFilter"></rect>
<g :transform="`translate(${margin.left}, ${margin.top})`"> <g :transform="`translate(${margin.left}, ${margin.top})`">
<g class="fjs-boxplot-axis fjs-x-axis" :transform="`translate(0, ${padded.height})`"></g> <g class="fjs-boxplot-axis fjs-x-axis" :transform="`translate(0, ${padded.height})`"></g>
<g class="fjs-boxplot-axis fjs-y-axis"></g> <g class="fjs-boxplot-axis fjs-y-axis"></g>
...@@ -35,6 +36,7 @@ ...@@ -35,6 +36,7 @@
v-tooltip="{position: 'bottom'}" v-tooltip="{position: 'bottom'}"
:title="label" :title="label"
:data-label="label" :data-label="label"
@click="setIDFilter(label)"
@mouseenter="showTooltip(label)" @mouseenter="showTooltip(label)"
@mouseleave="hideTooltip(label)" @mouseleave="hideTooltip(label)"
v-for="label in labels" > v-for="label in labels" >
...@@ -135,6 +137,7 @@ ...@@ -135,6 +137,7 @@
height: 0, height: 0,
numData: [], numData: [],
catData: [], catData: [],
hasSetFilter: false,
tooltips: { tooltips: {
boxes: {} boxes: {}
}, },
...@@ -303,9 +306,10 @@ ...@@ -303,9 +306,10 @@
}, },
'args': { 'args': {
handler: function () { handler: function () {
if (this.validArgs) { if (this.validArgs && !this.hasSetFilter) {
this.runAnalysisWrapper(this.args) this.runAnalysisWrapper(this.args)
} }
this.hasSetFilter = false
} }
}, },
'axis': { 'axis': {
...@@ -346,6 +350,14 @@ ...@@ -346,6 +350,14 @@
update_catData (ids) { update_catData (ids) {
this.catData = ids this.catData = ids
}, },
setIDFilter (label) {
store.dispatch('setFilter', {filter: 'ids', value: this.points[label].map(d => d.id)})
this.hasSetFilter = true
},
resetFilter () {
store.dispatch('setFilter', {filter: 'ids', value: []})
this.hasSetFilter = true
},
resize ({height, width}) { resize ({height, width}) {
this.height = height this.height = height
this.width = width this.width = width
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment