Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
matefun
Frontend
Commits
beb9206d
Commit
beb9206d
authored
Jul 08, 2019
by
leonelrosano
Browse files
modificaciónes
parent
62ea701f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.component.ts
View file @
beb9206d
...
...
@@ -78,6 +78,7 @@ export class Graph2DComponent {
}
switch
(
canvas
.
tipo
)
{
case
'
graph
'
:
{
console
.
log
(
canvas
.
resultado
)
var
jsonCanvas
=
JSON
.
parse
(
canvas
.
resultado
);
var
conjs
=
this
.
obtenerConjunto
(
jsonCanvas
.
funs
[
0
]);
...
...
@@ -99,7 +100,6 @@ export class Graph2DComponent {
funcionString
=
'
var
'
+
funs
.
fun
+
'
= function(
'
+
funs
.
args
+
'
){
\n
return
'
+
this
.
generarExpresion
(
funs
.
bdy
)
+
'
}
\n
'
+
funcionString
;
}
funcionString
=
'
(x)=>{
\n
'
+
funcionString
+
'
}
'
;
console
.
log
(
funcionString
)
obj
.
conj
.
sets
.
fdom
=
eval
(
funcionString
);
...
...
@@ -158,8 +158,8 @@ export class Graph2DComponent {
let
fun
=
eval
(
funcionGenerada
);
var
colores
=
[
'
violet
'
,
'
red
'
,
'
blue
'
,
'
orange
'
,
'
green
'
,
'
black
'
,
''
]
var
num
=
this
.
getRandomArbitrary
(
0
,
4
);
var
colores
=
[
'
violet
'
,
'
red
'
,
'
blue
'
,
'
orange
'
,
'
green
'
,
'
black
'
]
var
num
=
this
.
getRandomArbitrary
(
0
,
5
);
var
color
=
colores
[
num
];
var
tipoGraf
;
...
...
@@ -233,6 +233,7 @@ export class Graph2DComponent {
}
else
{
this
.
funciones
.
push
({
id
:
this
.
funciones
.
length
,
sampler
:
'
builtIn
'
,
fn
:
function
(
scope
)
{
...
...
@@ -953,7 +954,9 @@ export class Graph2DComponent {
exp
.
fun
=
'
Math.sin
'
}
else
if
(
exp
.
fun
==
'
round
'
)
{
exp
.
fun
=
'
Math.round
'
}
}
else
if
(
exp
.
fun
==
'
sqrt
'
){
exp
.
fun
=
'
Math.sqrt
'
}
expresion
=
'
'
+
exp
.
fun
+
'
(
'
+
exp
.
args
.
map
(
e
=>
this
.
generarExpresion
(
e
)).
join
()
+
'
)
'
;
}
else
if
(
exp
.
kind
==
'
tup
'
)
{
...
...
@@ -1146,6 +1149,13 @@ generateFunctionAndExp = function (exp,graph,namefun6) {
aux6
[
0
]
=
aux26
;
aux6
[
1
]
=
aux16
;
myList
.
push
(
aux6
);
}
else
if
((
exp
.
fun
==
'
Math.sqrt
'
)
||
(
exp
.
fun
==
'
sqrt
'
)){
var
aux7
=
[];
var
aux17
=
'
Math.sqrt(
'
+
exp
.
args
.
map
(
e
=>
this
.
generarExpresion
(
e
)).
join
()
+
'
)
'
;
var
aux27
=
'
N
'
aux7
[
0
]
=
aux27
;
aux7
[
1
]
=
aux17
;
myList
.
push
(
aux7
);
}
else
{
if
(
!
namefun6
.
includes
(
exp
.
fun
)){
var
ListnameFNew
=
namefun6
;
...
...
@@ -1262,6 +1272,11 @@ createListExp = function (exp) {
expresion
=
'
'
+
exp
.
fun
+
'
(
'
+
exp
.
args
.
map
(
e
=>
this
.
generarExpresion
(
e
)).
join
()
+
'
)
'
;
funcione
.
push
(
expresion
)
}
else
if
(
exp
.
fun
==
'
Math.sqrt
'
)
{
exp
.
fun
=
'
Math.sqrt
'
expresion
=
'
'
+
exp
.
fun
+
'
(
'
+
exp
.
args
.
map
(
e
=>
this
.
generarExpresion
(
e
)).
join
()
+
'
)
'
;
funcione
.
push
(
expresion
)
}
else
{
expresion
=
'
'
+
exp
.
fun
+
'
(
'
+
exp
.
args
.
map
(
e
=>
this
.
generarExpresion
(
e
)).
join
()
+
'
)
'
;
funcione
.
push
(
expresion
)
...
...
@@ -1408,7 +1423,12 @@ createListExp = function (exp) {
expresion
=
'
'
+
exp
.
fun
+
'
(
'
+
exp
.
args
.
map
(
e
=>
this
.
generarExpresionDisc
(
e
,
grap
,
ListnameF
)).
join
()
+
'
)
'
;
funcione
.
push
(
expresion
)
}
else
{
}
else
if
(
exp
.
fun
==
'
Math.sqrt
'
)
{
exp
.
fun
=
'
Math.sqrt
'
expresion
=
'
'
+
exp
.
fun
+
'
(
'
+
exp
.
args
.
map
(
e
=>
this
.
generarExpresionDisc
(
e
,
grap
,
ListnameF
)).
join
()
+
'
)
'
;
funcione
.
push
(
expresion
)
}
else
{
if
(
!
ListnameF
.
includes
(
exp
.
fun
)){
...
...
@@ -1594,6 +1614,8 @@ createListExp = function (exp) {
exp
.
fun
=
'
Math.sin
'
}
else
if
(
exp
.
fun
==
'
round
'
)
{
exp
.
fun
=
'
Math.round
'
}
else
if
(
exp
.
fun
==
'
sqrt
'
){
exp
.
fun
=
'
Math.sqrt
'
}
expresion
=
'
'
+
exp
.
fun
+
'
(
'
+
exp
.
args
.
map
(
e
=>
this
.
generarF
(
e
)).
join
()
+
'
)
'
;
}
else
if
(
exp
.
kind
==
'
tup
'
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment