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
c8df5c9b
Commit
c8df5c9b
authored
Sep 24, 2018
by
jose.ignacio.fagian
Browse files
cambios leo email
parent
5b9a7f5e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Frontend Angular 4/package.json
View file @
c8df5c9b
...
...
@@ -24,7 +24,7 @@
"core-js"
:
"^2.4.1"
,
"d3"
:
"^4.12.2"
,
"font-awesome"
:
"^4.7.0"
,
"function-plot"
:
"git://github.com/diego-rey/function-plot.git#feature/
integration-domain-shape
"
,
"function-plot"
:
"git://github.com/diego-rey/function-plot.git#feature/
mutigraf
"
,
"graph3D"
:
"git://github.com/ifagian/graph3D#master"
,
"ionicons"
:
"^3.0.0"
,
"jq-console"
:
"^2.13.2"
,
...
...
Frontend Angular 4/src/app/layout/plotter/graph2D/graph2D.component.ts
View file @
c8df5c9b
...
...
@@ -17,6 +17,14 @@ export class Graph2DComponent {
private
instance
:
null
;
private
funciones
=
[];
private
boton
=
true
;
private
id
=
0
;
private
conjunto
=
[];
animation
:
Animation
=
{
data
:
[],
timer
:
null
,
...
...
@@ -39,7 +47,7 @@ export class Graph2DComponent {
let
fun
=
eval
(
this
.
generarFuncion
(
jsonCanvas
));
var
conjs
=
this
.
obtenerConjunto
(
jsonCanvas
.
funs
[
0
]);
var
d
=
conjs
+
"
}
"
;
var
d
=
conjs
+
"
}
"
;
//Leo
var
obj
=
JSON
.
parse
(
d
);
//Para las funciones
...
...
@@ -83,19 +91,60 @@ export class Graph2DComponent {
}
else
{
tipoGraf
=
'
polyline
'
;
}
this
.
instance
=
functionPlot
({
target
:
'
#graph2D-container
'
,
width
:
620
,
height
:
450
,
conj
:
obj
.
conj
,
data
:
[{
if
(
this
.
boton
){
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
'
;
}
}
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
);
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
});
}
this
.
instance
=
functionPlot
({
target
:
'
#graph2D-container
'
,
width
:
620
,
height
:
450
,
conj
:
this
.
conjunto
,
data
:
this
.
funciones
,
zoom
:
1000
,
plugins
:
[
functionPlot
.
plugins
.
zoomBox
()
]
...
...
@@ -272,6 +321,9 @@ export class Graph2DComponent {
if
(
this
.
animation
.
playing
)
{
this
.
stopAnimation
();
}
else
{
this
.
funciones
=
[];
this
.
conjunto
=
[];
this
.
id
=
0
;
this
.
instance
.
removeAllGraphs
();
}
}
...
...
@@ -677,8 +729,5 @@ export class Graph2DComponent {
return
funcionString
;
}
}
Frontend Angular 4/src/app/layout/plotter/graph3D/graph3D.component.ts
View file @
c8df5c9b
import
{
Component
,
OnInit
,
ViewChild
,
ElementRef
,
NgZone
}
from
'
@angular/core
'
;
import
{
Component
,
OnInit
,
ViewChild
,
ElementRef
,
NgZone
,
AfterViewInit
}
from
'
@angular/core
'
;
import
*
as
graph3DLib
from
'
graph3D
'
;
import
{
GHCIService
}
from
'
../../../shared/services/ghci.service
'
;
import
{
formatJSON
,
AnimationProps
,
Zoom3DType
,
GraphProps
,
Default_GraphProps
,
debounce
}
from
'
./graph3D.helper
'
;
...
...
@@ -11,7 +11,7 @@ import { formatJSON, AnimationProps, Zoom3DType, GraphProps, Default_GraphProps,
'
(window:resize)
'
:
'
onResize($event)
'
}
})
export
class
Graph3DComponent
{
export
class
Graph3DComponent
implements
AfterViewInit
{
private
ghciServiceSub
:
any
;
...
...
@@ -55,7 +55,13 @@ export class Graph3DComponent {
ngAfterViewInit
()
{
// this.zone.runOutsideAngular(() => {
graph3DLib
.
initialize
(
this
.
graph3DRef
.
nativeElement
);
graph3DLib
.
initialize
(
this
.
graph3DRef
.
nativeElement
,
true
);
(
function
render
()
{
console
.
info
(
"
ngAfterViewInit: ####### FIRED
"
);
//requestAnimationFrame(render);
graph3DLib
.
forceUpdateRenderer
();
}());
//})
}
...
...
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