From 4d7f6d66da11a3ae6d89a4df1a5529107972ed32 Mon Sep 17 00:00:00 2001 From: Diego Rey <diego.despaux@izundo.com> Date: Tue, 3 Jul 2018 20:28:06 -0300 Subject: [PATCH] Added referencia a git branch personalizado de function-plot --- Frontend Angular 4/package.json | 2 +- .../app/layout/plotter/plotter.component.ts | 39 +++++++++++++++---- Frontend Angular 4/src/app/shared/config.ts | 7 +++- 3 files changed, 38 insertions(+), 10 deletions(-) diff --git a/Frontend Angular 4/package.json b/Frontend Angular 4/package.json index b3ae46f..ad159b1 100755 --- a/Frontend Angular 4/package.json +++ b/Frontend Angular 4/package.json @@ -24,7 +24,7 @@ "core-js": "^2.4.1", "d3": "^4.12.2", "font-awesome": "^4.7.0", - "function-plot": "^1.18.1", + "function-plot": "git+https://github.com/diego-rey/function-plot.git#feature/shape-type", "ionicons": "^3.0.0", "jq-console": "^2.13.2", "jquery": "^3.2.1", diff --git a/Frontend Angular 4/src/app/layout/plotter/plotter.component.ts b/Frontend Angular 4/src/app/layout/plotter/plotter.component.ts index c3056fa..38c7d4f 100755 --- a/Frontend Angular 4/src/app/layout/plotter/plotter.component.ts +++ b/Frontend Angular 4/src/app/layout/plotter/plotter.component.ts @@ -18,18 +18,43 @@ export class PlotterComponent { var jsonCanvas = JSON.parse(canvas.resultado); let fun = eval(this.generarFuncion(jsonCanvas)); + functionPlot({ target: '#plotter-container', - width: 620, - height: 450, + width: 770, + height: 720, + tip: { + color: 'green' + }, + xAxis: { + label: 'x - axis', + scale: 'linear', + domain: { + initial: [-4, 4], + type: 'discrete' + } + }, data: [{ - sampler: 'builtIn', - fn: function(scope) { - return fun(scope.x) - }, - graphType: 'polyline' + graphType: 'scatter', + fn: function (scope) { + // scope.x = Number + return fun(scope.x) + } }] }) + + // functionPlot({ + // target: '#plotter-container', + // width: 620, + // height: 450, + // data: [{ + // sampler: 'builtIn', + // fn: function(scope) { + // return fun(scope.x) + // }, + // graphType: 'polyline' + // }] + // }) } }, error=>{ diff --git a/Frontend Angular 4/src/app/shared/config.ts b/Frontend Angular 4/src/app/shared/config.ts index e8dc542..85af34a 100755 --- a/Frontend Angular 4/src/app/shared/config.ts +++ b/Frontend Angular 4/src/app/shared/config.ts @@ -4,9 +4,12 @@ //export const SERVER = 'http://localhost:9090'; //export const GHCI_URL = 'ws://localhost:9090/endpoint'; +export const SERVER = 'http://localhost:8080'; +export const GHCI_URL = 'ws://localhost:8080/endpoint'; + //Configuracion dinamica pensando en servidor con ip dinamica //export const SERVER = window.location.protocol + '//' + window.location.host;//'http://localhost:9090'; //export const GHCI_URL = window.location.protocol == 'http:'? 'ws://'+window.location.host+'/endpoint': 'wss://'+window.location.host+'/endpoint'; -export const SERVER = 'http://ec2-52-15-74-22.us-east-2.compute.amazonaws.com:9090'; -export const GHCI_URL = 'ws://ec2-52-15-74-22.us-east-2.compute.amazonaws.com:9090/endpoint'; \ No newline at end of file +//export const SERVER = 'http://ec2-52-15-74-22.us-east-2.compute.amazonaws.com:9090'; +//export const GHCI_URL = 'ws://ec2-52-15-74-22.us-east-2.compute.amazonaws.com:9090/endpoint'; \ No newline at end of file -- GitLab