diff --git a/src/components/BundleManager.vue b/src/components/BundleManager.vue index fb0e7b20..010969a7 100644 --- a/src/components/BundleManager.vue +++ b/src/components/BundleManager.vue @@ -4,12 +4,12 @@

You can set up several bundles and then inspect them more closely to compare.

-
Select a sequence
-
Active sequence: {{activeSeq.name}}
+
Select a sequence
+
Active sequence: {{activeSeq.name}}
-
Select a vizualizer
-
Active vizualizer: {{activeViz.name}}
+
Select a vizualizer
+
Active vizualizer: {{activeViz.name}}
@@ -19,6 +19,7 @@ v-bind:key="bundle.uid" v-bind:seq="bundle.seq" v-bind:viz="bundle.viz" + v-on:drawBundle="$emit('drawBundle', $event)" /> @@ -39,7 +40,7 @@ export default { }, computed: { readyToBundle: function() { - return this.activeSeq.name !== undefined && this.activeViz.name !== undefined; + return this.activeSeq.isValid !== undefined && this.activeViz.isValid !== undefined; } } } diff --git a/src/components/CanvasArea.vue b/src/components/CanvasArea.vue index 951a190b..347e4d20 100644 --- a/src/components/CanvasArea.vue +++ b/src/components/CanvasArea.vue @@ -1,6 +1,15 @@ @@ -13,39 +22,42 @@ export default { activeSeq: Object, activeViz: Object }, - methods:{ - draw: function(){ - console.log('Drawing with Visualizer: ', this.activeViz.name); - console.log('Drawing with Sequence', this.activeSeq.name); + mounted: function(){ + console.log('Drawing with Visualizer: ', this.activeViz.name); + console.log('Drawing with Sequence', this.activeSeq.name); - // params here are ID and finite - const activeSeq = this.activeSeq; - activeSeq.initialize(); + // params here are ID and finite + const activeSeq = this.activeSeq; + activeSeq.initialize(); - const activeViz = this.activeViz; - console.log(activeViz); + const activeViz = this.activeViz; + console.log(activeViz); - const drawing = new p5(function(sketch){ - activeViz.initialize(sketch, activeSeq); + const drawing = new p5(function(sketch){ + activeViz.initialize(sketch, activeSeq); - sketch.setup = function(){ - sketch.createCanvas(800, 800); - sketch.background("white"); - activeViz.setup(); - } + sketch.setup = function(){ + sketch.createCanvas(800, 800); + sketch.background("white"); + activeViz.setup(); + } - sketch.draw = function(){ - activeViz.draw(); - } + sketch.draw = function(){ + activeViz.draw(); + } }, 'p5-goes-here'); - drawing.setup(); - drawing.draw(); - } + drawing.setup(); + drawing.draw(); + }, } - diff --git a/src/components/VizualizationMenu.vue b/src/components/VizualizationMenu.vue index 1867075e..fba060f9 100644 --- a/src/components/VizualizationMenu.vue +++ b/src/components/VizualizationMenu.vue @@ -37,21 +37,21 @@ export default { }, methods: { openParamsModal: function() { - this.showModal = true; + this.showModal = true; }, closeParamsModal: function() { - this.showModal = false; + this.showModal = false; }, setParams: function(viz) { - this.liveVizualizer = new viz.vizualizer(); - this.openParamsModal(); + this.liveVizualizer = new viz.vizualizer(); + this.openParamsModal(); }, createViz: function() { const validationResult = this.liveVizualizer.validate(); if(validationResult.isValid) { - this.errors = []; - this.closeParamsModal(); - this.$emit("createViz", this.liveVizualizer); + this.errors = []; + this.closeParamsModal(); + this.$emit("createViz", this.liveVizualizer); } else { this.errors = validationResult.errors; } diff --git a/src/components/bundleCard.vue b/src/components/bundleCard.vue index e657d4d5..0d21e7e5 100644 --- a/src/components/bundleCard.vue +++ b/src/components/bundleCard.vue @@ -6,7 +6,8 @@
{{seq.name + ' + ' + viz.name}}

Some quick example text to build on the card title and make up the bulk of the card's content.

- Go somewhere + Draw + Remove diff --git a/src/sequences/sequenceClassDefault.ts b/src/sequences/sequenceClassDefault.ts index bf73bda1..0c429909 100644 --- a/src/sequences/sequenceClassDefault.ts +++ b/src/sequences/sequenceClassDefault.ts @@ -15,16 +15,16 @@ export class SequenceClassDefault implements SequenceInterface { description = 'A Base sequence class'; params: SequenceParamsSchema[] = [new SequenceParamsSchema('name', '', 'displayName', false, '0')]; ready: boolean; + isValid: boolean; private settings: { [key: string]: string|number|boolean} = {}; - private valid: boolean; constructor(ID: number, finite?: boolean) { this.ID = ID; this.cache = []; this.finite = finite || true; this.ready = false; - this.valid = false; + this.isValid = false; } /** @@ -34,7 +34,7 @@ export class SequenceClassDefault implements SequenceInterface { * @param paramsFromUser user settings for the sequence passed from the UI */ initialize(){ - if(this.valid) { + if(this.isValid) { this.ready = true; return } else { @@ -56,7 +56,7 @@ export class SequenceClassDefault implements SequenceInterface { }); if(this.settings['name'] !== undefined) { - this.valid = true; + this.isValid = true; return new ValidationStatus(true); } diff --git a/src/sequences/sequenceConstant.ts b/src/sequences/sequenceConstant.ts index 7c56c035..306d0c62 100644 --- a/src/sequences/sequenceConstant.ts +++ b/src/sequences/sequenceConstant.ts @@ -44,6 +44,7 @@ class SequenceConstant implements SequenceInterface{ }); if(this.settings['constantValue'] !== undefined) { + this.isValid = true; return new ValidationStatus(true); } else { return new ValidationStatus(false, ["No constant value was provided."]); diff --git a/src/views/ToolMain.vue b/src/views/ToolMain.vue index 69a660db..fd35fc00 100644 --- a/src/views/ToolMain.vue +++ b/src/views/ToolMain.vue @@ -1,6 +1,15 @@