diff --git a/Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.component.ts b/Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.component.ts index f969c459791b27b24243635601d886aa16409c27..938b6ff6928654366c51201134ff25afb165c670 100755 --- a/Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.component.ts +++ b/Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.component.ts @@ -121,36 +121,51 @@ export class Graph2DComponent { } if(this.animation.boton && obj.conj.cod != 'Numer' && obj.conj.dom != 'Numer'){ - if(this.conjunto.length == 1){ - this.id = 1; - this.conjunto.unshift({radio: 2, dom:this.conjunto[0].baseDom, cod:this.conjunto[0].baseCod, baseCod:this.conjunto[0].baseCod, baseDom:this.conjunto[0].baseDom, sets:{fdom:this.conjunto[0].baseDom,fcod:this.conjunto[0].baseCod}}); - this.funciones[0].id = this.id; - - } - if (this.conjunto.length != 0){ - if (obj.conj.baseDom == 'R'){ - this.conjunto[0].baseDom = 'R'; - this.conjunto[0].dom = 'R'; - this.conjunto[0].sets.fdom = 'R'; - } - if (obj.conj.baseCod == 'R'){ - this.conjunto[0].baseCod = 'R'; - this.conjunto[0].cod = 'R'; - this.conjunto[0].sets.fcod = 'R'; + if(this.conjunto.length == 1 && (this.conjunto[0].cod == 'Numer' || this.conjunto[0].dom == 'Numer')){ + this.conjunto = []; + this.conjunto.push(obj.conj); + this.id = 0; + this.funciones = []; + this.funciones.push({ + id: this.funciones.length, + sampler: 'builtIn', + fn: function(scope) { + return fun(scope.x) + }, + graphType: tipoGraf, + color: color + }) + }else{ + if(this.conjunto.length == 1){ + this.id = 1; + this.conjunto.unshift({radio: 2, dom:this.conjunto[0].baseDom, cod:this.conjunto[0].baseCod, baseCod:this.conjunto[0].baseCod, baseDom:this.conjunto[0].baseDom, sets:{fdom:this.conjunto[0].baseDom,fcod:this.conjunto[0].baseCod}}); + this.funciones[0].id = this.id; + } - } - this.conjunto.push(obj.conj); - - this.funciones.push({ - id: this.funciones.length + this.id, - sampler: 'builtIn', - fn: function(scope) { - return fun(scope.x) - }, - graphType: tipoGraf, - color: color - }); - + if (this.conjunto.length != 0){ + if (obj.conj.baseDom == 'R'){ + this.conjunto[0].baseDom = 'R'; + this.conjunto[0].dom = 'R'; + this.conjunto[0].sets.fdom = 'R'; + } + if (obj.conj.baseCod == 'R'){ + this.conjunto[0].baseCod = 'R'; + this.conjunto[0].cod = 'R'; + this.conjunto[0].sets.fcod = 'R'; + } + } + this.conjunto.push(obj.conj); + + this.funciones.push({ + id: this.funciones.length + this.id, + sampler: 'builtIn', + fn: function(scope) { + return fun(scope.x) + }, + graphType: tipoGraf, + color: color + }); + } }else{ this.conjunto = []; this.conjunto.push(obj.conj);