mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 11:57:08 +00:00
Add preferences support to DougalGraphArraysIJScatter
This commit is contained in:
@@ -51,7 +51,7 @@ import unpack from '@/lib/unpack.js';
|
||||
export default {
|
||||
name: 'DougalGraphArraysIJScatter',
|
||||
|
||||
props: [ "data" ],
|
||||
props: [ "data", "settings" ],
|
||||
|
||||
data () {
|
||||
return {
|
||||
@@ -72,8 +72,6 @@ export default {
|
||||
watch: {
|
||||
|
||||
data (newVal, oldVal) {
|
||||
console.log("scatter data changed");
|
||||
|
||||
if (newVal === null) {
|
||||
this.busy = true;
|
||||
} else {
|
||||
@@ -82,15 +80,21 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
settings () {
|
||||
for (const key in this.settings) {
|
||||
this[key] = this.settings[key];
|
||||
}
|
||||
},
|
||||
|
||||
histogram () {
|
||||
this.plot();
|
||||
this.saveUserPreference([`${this.$options.name}.histogram`, this.histogram]);
|
||||
this.$emit("update:settings", {[`${this.$options.name}.histogram`]: this.histogram});
|
||||
},
|
||||
|
||||
|
||||
scatterplot () {
|
||||
this.plot();
|
||||
this.saveUserPreference([`${this.$options.name}.scatterplot`, this.scatterplot]);
|
||||
this.$emit("update:settings", {[`${this.$options.name}.scatterplot`]: this.scatterplot});
|
||||
}
|
||||
},
|
||||
|
||||
@@ -331,8 +335,6 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
...mapActions(["loadUserPreference", "saveUserPreference"])
|
||||
|
||||
},
|
||||
|
||||
async mounted () {
|
||||
@@ -347,9 +349,6 @@ export default {
|
||||
this.resizeObserver.observe(this.$refs.graph0);
|
||||
this.resizeObserver.observe(this.$refs.graph1);
|
||||
this.resizeObserver.observe(this.$refs.graph2);
|
||||
|
||||
this.histogram = await this.loadUserPreference([`${this.$options.name}.histogram`, false]);
|
||||
this.scatterplot = await this.loadUserPreference([`${this.$options.name}.scatterplot`, false]);
|
||||
},
|
||||
|
||||
beforeDestroy () {
|
||||
|
||||
Reference in New Issue
Block a user