From 5bfd7dc835ae8d1cdd1864fd57bb7ec72c09c990 Mon Sep 17 00:00:00 2001 From: "D. Berge" Date: Tue, 28 Sep 2021 18:11:43 +0200 Subject: [PATCH] Add preferences support to DougalGraphGunsDepth --- .../source/src/components/graph-guns-depth.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/www/client/source/src/components/graph-guns-depth.vue b/lib/www/client/source/src/components/graph-guns-depth.vue index e56ceb5..9af9e32 100644 --- a/lib/www/client/source/src/components/graph-guns-depth.vue +++ b/lib/www/client/source/src/components/graph-guns-depth.vue @@ -50,7 +50,7 @@ import * as aes from '@/lib/graphs/aesthetics.js'; export default { name: 'DougalGraphGunsDepth', - props: [ "data" ], + props: [ "data", "settings" ], data () { 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 () { if (this.violinplot) { this.plotViolin(); } + this.$emit("update:settings", {[`${this.$options.name}.violinplot`]: this.violinplot}); } },