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 1ad5b78ef9b3589f41c79e4c701ee1dfb10368b8..f969c459791b27b24243635601d886aa16409c27 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 @@ -171,8 +171,10 @@ export class Graph2DComponent { target: '#graph2D-container', width: bounding.width, height: bounding.height, - tip: { color: 'green' }, - xAxis: { label: 'x - axis', + tip: { + color: 'green' + }, + xAxis: { scale: 'linear', domain: { initial: [-4, 4], type: 'discrete' }, @@ -198,7 +200,6 @@ export class Graph2DComponent { height: bounding.height, grid: true, xAxis: { - label: 'x - axis', scale: 'linear', domain: { initial: [-10, 10], @@ -242,7 +243,6 @@ export class Graph2DComponent { height: bounding.height, grid: true, xAxis: { - label: 'x - axis', scale: 'linear', domain: { initial: [-10, 10], @@ -282,7 +282,11 @@ export class Graph2DComponent { * @desc get the measures of the container of the graph */ private getBounding = function() { - const {width, height} = this.graph2DRef.nativeElement.getBoundingClientRect(); + var {width, height} = this.graph2DRef.nativeElement.getBoundingClientRect(); + if (width === 0) { + width = document.getElementById('graph2D-container').querySelector('svg').width.baseVal.value; + height = document.getElementById('graph2D-container').querySelector('svg').height.baseVal.value; + } return {width, height} } diff --git a/Frontend Angular 4/src/app/shared/services/ghci.service.ts b/Frontend Angular 4/src/app/shared/services/ghci.service.ts index af62279ce4af96d79cd8734318425d41be9a1b6f..31d1dc26af0331fe63595c32d30d23abe9b3c6da 100755 --- a/Frontend Angular 4/src/app/shared/services/ghci.service.ts +++ b/Frontend Angular 4/src/app/shared/services/ghci.service.ts @@ -302,7 +302,7 @@ export class GHCIService { this.messages.next(json_server_message); } else if (json_server_message.tipo == 'canvas3D' || json_server_message.tipo == 'animacion3D') { - document.getElementById("FigurasBtn3D").click() + document.getElementById("FigurasBtn3D").click() this.focusConsole(); this.messages.next(json_server_message); }