Commit c424d7cb authored by Diego Rey's avatar Diego Rey
Browse files

Fixed bounding on 2d plots

parent 4dc37e1e
...@@ -33,7 +33,6 @@ import 'codemirror/mode/markdown/markdown'; ...@@ -33,7 +33,6 @@ import 'codemirror/mode/markdown/markdown';
import 'codemirror/lib/codemirror'; import 'codemirror/lib/codemirror';
import 'codemirror/addon/search/search'; import 'codemirror/addon/search/search';
import 'codemirror/addon/dialog/dialog'; import 'codemirror/addon/dialog/dialog';
import 'codemirror/addon/search/search'; import 'codemirror/addon/search/search';
import 'codemirror/addon/search/matchesonscrollbar'; import 'codemirror/addon/search/matchesonscrollbar';
...@@ -561,7 +560,6 @@ export class MateFunComponent { ...@@ -561,7 +560,6 @@ export class MateFunComponent {
}); });
} }
buildTreeFromList (archivos){ buildTreeFromList (archivos){
...@@ -585,7 +583,6 @@ export class MateFunComponent { ...@@ -585,7 +583,6 @@ export class MateFunComponent {
this.sessionService.setArchivosTree(tree); this.sessionService.setArchivosTree(tree);
} }
buildTree(archivos, root){ buildTree(archivos, root){
root.archivos = this.getArchivos(root.id,archivos); root.archivos = this.getArchivos(root.id,archivos);
for(var a in root.archivos){ for(var a in root.archivos){
...@@ -605,6 +602,4 @@ export class MateFunComponent { ...@@ -605,6 +602,4 @@ export class MateFunComponent {
}); });
} }
} }
...@@ -171,8 +171,10 @@ export class Graph2DComponent { ...@@ -171,8 +171,10 @@ export class Graph2DComponent {
target: '#graph2D-container', target: '#graph2D-container',
width: bounding.width, width: bounding.width,
height: bounding.height, height: bounding.height,
tip: { color: 'green' }, tip: {
xAxis: { label: 'x - axis', color: 'green'
},
xAxis: {
scale: 'linear', scale: 'linear',
domain: { initial: [-4, 4], domain: { initial: [-4, 4],
type: 'discrete' }, type: 'discrete' },
...@@ -198,7 +200,6 @@ export class Graph2DComponent { ...@@ -198,7 +200,6 @@ export class Graph2DComponent {
height: bounding.height, height: bounding.height,
grid: true, grid: true,
xAxis: { xAxis: {
label: 'x - axis',
scale: 'linear', scale: 'linear',
domain: { domain: {
initial: [-10, 10], initial: [-10, 10],
...@@ -242,7 +243,6 @@ export class Graph2DComponent { ...@@ -242,7 +243,6 @@ export class Graph2DComponent {
height: bounding.height, height: bounding.height,
grid: true, grid: true,
xAxis: { xAxis: {
label: 'x - axis',
scale: 'linear', scale: 'linear',
domain: { domain: {
initial: [-10, 10], initial: [-10, 10],
...@@ -282,7 +282,11 @@ export class Graph2DComponent { ...@@ -282,7 +282,11 @@ export class Graph2DComponent {
* @desc get the measures of the container of the graph * @desc get the measures of the container of the graph
*/ */
private getBounding = function() { 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} return {width, height}
} }
......
...@@ -302,7 +302,7 @@ export class GHCIService { ...@@ -302,7 +302,7 @@ export class GHCIService {
this.messages.next(json_server_message); this.messages.next(json_server_message);
} else if (json_server_message.tipo == 'canvas3D' || } else if (json_server_message.tipo == 'canvas3D' ||
json_server_message.tipo == 'animacion3D') { json_server_message.tipo == 'animacion3D') {
document.getElementById("FigurasBtn3D").click() document.getElementById("FigurasBtn3D").click()
this.focusConsole(); this.focusConsole();
this.messages.next(json_server_message); this.messages.next(json_server_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