Add preferences support to DougalGraphGunsPressure

This commit is contained in:
D. Berge
2021-09-28 18:12:37 +02:00
parent 5bfd7dc835
commit 798203be9f

View File

@@ -50,7 +50,7 @@ import * as aes from '@/lib/graphs/aesthetics.js';
export default { export default {
name: 'DougalGraphGunsPressure', name: 'DougalGraphGunsPressure',
props: [ "data" ], props: [ "data", "settings" ],
data () { data () {
return { return {
@@ -80,10 +80,24 @@ export default {
} }
}, },
settings () {
for (const key in this.settings) {
this[key] = this.settings[key];
}
},
shotpoint () {
if (this.shotpoint) {
this.replot();
}
this.$emit("update:settings", {[`${this.$options.name}.shotpoint`]: this.shotpoint});
},
violinplot () { violinplot () {
if (this.violinplot) { if (this.violinplot) {
this.plotViolin(); this.plotViolin();
} }
this.$emit("update:settings", {[`${this.$options.name}.violinplot`]: this.violinplot});
} }
}, },