Commit 0cb6281d authored by jose.ignacio.fagian's avatar jose.ignacio.fagian
Browse files

Cambios de nomenclatura sen por sin y round. Arreglo de grafica de reales.

parent b496eed1
...@@ -60,6 +60,12 @@ export class Graph2DComponent { ...@@ -60,6 +60,12 @@ export class Graph2DComponent {
var num = this.getRandomArbitrary(0,4); var num = this.getRandomArbitrary(0,4);
var color = colores[num]; var color = colores[num];
var tipoGraf;
if (obj.conj.baseDom != 'R'){
tipoGraf = 'scatter';
}else{
tipoGraf = 'polyline';
}
functionPlot({ functionPlot({
target: '#graph2D-container', target: '#graph2D-container',
width: 620, width: 620,
...@@ -70,7 +76,7 @@ export class Graph2DComponent { ...@@ -70,7 +76,7 @@ export class Graph2DComponent {
fn: function(scope) { fn: function(scope) {
return fun(scope.x) return fun(scope.x)
}, },
graphType: 'scatter', graphType: tipoGraf,
color: color color: color
}] }]
}) })
...@@ -120,9 +126,9 @@ export class Graph2DComponent { ...@@ -120,9 +126,9 @@ export class Graph2DComponent {
} else if (exp.kind == 'app') { } else if (exp.kind == 'app') {
if (exp.fun == 'cos') { if (exp.fun == 'cos') {
exp.fun = 'Math.cos' exp.fun = 'Math.cos'
} else if (exp.fun == 'sen') { } else if (exp.fun == 'sin') {
exp.fun = 'Math.sin' exp.fun = 'Math.sin'
} else if (exp.fun == 'red') { } else if (exp.fun == 'round') {
exp.fun = 'Math.round' exp.fun = 'Math.round'
} }
expresion = ' ' + exp.fun + '(' + exp.args.map(e => this.generarExpresion(e)).join() + ') '; expresion = ' ' + exp.fun + '(' + exp.args.map(e => this.generarExpresion(e)).join() + ') ';
...@@ -261,7 +267,7 @@ export class Graph2DComponent { ...@@ -261,7 +267,7 @@ export class Graph2DComponent {
} else if (exp.kind == 'app') { } else if (exp.kind == 'app') {
if (exp.fun == 'cos') { if (exp.fun == 'cos') {
exp.fun = 'Math.cos' exp.fun = 'Math.cos'
} else if (exp.fun == 'sen') { } else if (exp.fun == 'sin') {
exp.fun = 'Math.sin' exp.fun = 'Math.sin'
} else if (exp.fun == 'round') { } else if (exp.fun == 'round') {
exp.fun = 'Math.round' exp.fun = 'Math.round'
......
...@@ -27,7 +27,6 @@ export class Graph3DComponent { ...@@ -27,7 +27,6 @@ export class Graph3DComponent {
speed: 1000 speed: 1000
}; };
constructor(ghciService: GHCIService, private zone: NgZone) { constructor(ghciService: GHCIService, private zone: NgZone) {
this.ghciServiceSub = ghciService.messages.subscribe( this.ghciServiceSub = ghciService.messages.subscribe(
message => { message => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment