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

Fixed Graph2D component namespace

parent 9c418d5f
This diff is collapsed.
...@@ -74,22 +74,22 @@ ...@@ -74,22 +74,22 @@
</ng-template> </ng-template>
</ngb-tab> </ngb-tab>
<ngb-tab id="FigurasBtn" title="Figuras"> <ngb-tab id="FigurasBtn" title="Figuras OLD">
<ng-template ngbTabContent> <ng-template ngbTabContent>
<canvas-component (canvasComp)=canvasC></canvas-component> <canvas-component (canvasComp)=canvasC></canvas-component>
</ng-template> </ng-template>
</ngb-tab> </ngb-tab>
<ngb-tab id="FigurasBtn2" title="Figuras 3D"> <ngb-tab id="FigurasBtn2" title="Figuras 2D">
<ng-template ngbTabContent> <ng-template ngbTabContent>
<graph3d-component (graph3DComp)=graph3DComp></graph3d-component> <graph2D-component (graph2DComp)=graph2DComp></graph2D-component>
</ng-template> </ng-template>
</ngb-tab> </ngb-tab>
<ngb-tab id="FigurasBtn3" title="Figuras 3D">
<ngb-tab id="FigurasBtn2" title="Figuras New">
<ng-template ngbTabContent> <ng-template ngbTabContent>
<plotter-component (plotterComp)=plotterC></plotter-component> <graph3d-component (graph3DComp)=graph3DComp></graph3d-component>
</ng-template> </ng-template>
</ngb-tab> </ngb-tab>
</ngb-tabset> </ngb-tabset>
</div> </div>
......
import { Component, NgModule, ViewChild, HostListener, ElementRef, ComponentRef, TemplateRef } from '@angular/core'; import { Component, NgModule, ViewChild, HostListener, ElementRef, ComponentRef, TemplateRef } from '@angular/core';
import { CanvasModule} from '../canvas/canvas.module'; import { CanvasModule} from '../canvas/canvas.module';
import { CanvasComponent } from '../canvas/canvas.component'; import { CanvasComponent } from '../canvas/canvas.component';
import { PlotterModule } from '../plotter/plotter.module';
import { PlotterComponent } from '../plotter/plotter.component';
import { Http, JsonpModule } from '@angular/http'; import { Http, JsonpModule } from '@angular/http';
import { Headers, RequestOptions } from '@angular/http'; import { Headers, RequestOptions } from '@angular/http';
import { HaskellService } from '../../shared/services/haskell.service'; import { HaskellService } from '../../shared/services/haskell.service';
...@@ -21,6 +19,8 @@ import { CodemirrorComponent } from 'ng2-codemirror'; ...@@ -21,6 +19,8 @@ import { CodemirrorComponent } from 'ng2-codemirror';
import { NgbPopoverConfig, NgbPopover} from '@ng-bootstrap/ng-bootstrap'; import { NgbPopoverConfig, NgbPopover} from '@ng-bootstrap/ng-bootstrap';
import { NgbPopoverWindow } from '@ng-bootstrap/ng-bootstrap/popover/popover'; import { NgbPopoverWindow } from '@ng-bootstrap/ng-bootstrap/popover/popover';
import { NotificacionService } from '../../shared/services/notificacion.service'; import { NotificacionService } from '../../shared/services/notificacion.service';
import { Graph2DModule } from '../plotter/graph2D/graph2D.module';
import { Graph2DComponent } from '../plotter/graph2D/graph2D.component';
import { Graph3DComponent } from '../plotter/graph3D/graph3D.component'; import { Graph3DComponent } from '../plotter/graph3D/graph3D.component';
import 'rxjs/add/operator/catch'; import 'rxjs/add/operator/catch';
...@@ -356,7 +356,7 @@ export class MateFunComponent { ...@@ -356,7 +356,7 @@ export class MateFunComponent {
@ViewChild(CanvasComponent) canvasC: CanvasComponent; @ViewChild(CanvasComponent) canvasC: CanvasComponent;
@ViewChild(Graph3DComponent) graph3DComp: Graph3DComponent; @ViewChild(Graph3DComponent) graph3DComp: Graph3DComponent;
@ViewChild(PlotterComponent) plotterC: PlotterComponent; @ViewChild(Graph2DComponent) graph2DComp: Graph2DComponent;
funcionSTR: string = 'Math.sin(x)*x*x-20'; funcionSTR: string = 'Math.sin(x)*x*x-20';
consola: string = ''; consola: string = '';
......
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { CanvasModule } from '../canvas/canvas.module' import { CanvasModule } from '../canvas/canvas.module'
import { PlotterModule } from '../plotter/plotter.module'
import { MateFunComponent } from './matefun.component'; import { MateFunComponent } from './matefun.component';
import { BootstrapModalModule } from 'ng2-bootstrap-modal'; import { BootstrapModalModule } from 'ng2-bootstrap-modal';
import { ConfirmComponent } from './confirm.component'; import { ConfirmComponent } from './confirm.component';
...@@ -10,7 +9,8 @@ import { CommonModule } from '@angular/common'; ...@@ -10,7 +9,8 @@ import { CommonModule } from '@angular/common';
import { MateFunRoutingModule } from './matefun-routing.module'; import { MateFunRoutingModule } from './matefun-routing.module';
import { CodemirrorModule } from 'ng2-codemirror'; import { CodemirrorModule } from 'ng2-codemirror';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { NotificacionModule } from '../../notificacion/notificacion.module'; import { NotificacionModule } from '../../notificacion/notificacion.module';
import { Graph2DModule } from '../plotter/graph2D/graph2D.module';
import { Graph3DModule } from '../plotter/graph3D/graph3D.module'; import { Graph3DModule } from '../plotter/graph3D/graph3D.module';
@NgModule({ @NgModule({
...@@ -18,7 +18,7 @@ import { Graph3DModule } from '../plotter/graph3D/graph3D.module'; ...@@ -18,7 +18,7 @@ import { Graph3DModule } from '../plotter/graph3D/graph3D.module';
CommonModule, CommonModule,
FormsModule, FormsModule,
CanvasModule, CanvasModule,
PlotterModule, Graph2DModule,
Graph3DModule, Graph3DModule,
NotificacionModule, NotificacionModule,
MateFunRoutingModule, MateFunRoutingModule,
......
<div class="card"> <div class="card">
<div class="card-block contenedor-canvas" > <div class="card-block contenedor-canvas" >
<div id="plotter-container" style="height: 100%; width: 100%;"> <div id="graph2D-container" style="height: 100%; width: 100%;">
</div> </div>
</div> </div>
</div> </div>
\ No newline at end of file
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { GHCIService } from '../../shared/services/ghci.service'; import { GHCIService } from '../../../shared/services/ghci.service';
import functionPlot from 'function-plot'; import functionPlot from 'function-plot';
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
selector: 'plotter-component', selector: 'graph2D-component',
templateUrl: './plotter.component.html', templateUrl: './graph2D.component.html',
host: { host: {
} }
}) })
export class PlotterComponent { export class Graph2DComponent {
public constructor(private ghciService: GHCIService) { public constructor(private ghciService: GHCIService) {
ghciService.messages.subscribe( ghciService.messages.subscribe(
canvas=>{ canvas=>{
...@@ -20,7 +20,7 @@ export class PlotterComponent { ...@@ -20,7 +20,7 @@ export class PlotterComponent {
functionPlot({ functionPlot({
target: '#plotter-container', target: '#graph2D-container',
width: 770, width: 770,
height: 720, height: 720,
tip: { tip: {
...@@ -44,7 +44,7 @@ export class PlotterComponent { ...@@ -44,7 +44,7 @@ export class PlotterComponent {
}) })
// functionPlot({ // functionPlot({
// target: '#plotter-container', // target: '#graph2D-container',
// width: 620, // width: 620,
// height: 450, // height: 450,
// data: [{ // data: [{
......
...@@ -3,12 +3,12 @@ import { CommonModule } from '@angular/common' ...@@ -3,12 +3,12 @@ import { CommonModule } from '@angular/common'
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { PlotterComponent } from './plotter.component'; import { Graph2DComponent } from './graph2D.component';
@NgModule({ @NgModule({
imports: [FormsModule, RouterModule, CommonModule, NgbModule], imports: [FormsModule, RouterModule, CommonModule, NgbModule],
declarations: [PlotterComponent], declarations: [Graph2DComponent],
exports: [PlotterComponent] exports: [Graph2DComponent]
}) })
export class PlotterModule { } export class Graph2DModule { }
\ No newline at end of file \ No newline at end of file
import { Route } from '@angular/router';
import { Graph2DComponent } from '.';
export const Graph2DRoutes: Route[] = [
{
path: 'graph2D',
component: Graph2DComponent
}
];
/** /**
* This barrel file provides the export for the lazy loaded BlankpageComponent. * This barrel file provides the export for the lazy loaded BlankpageComponent.
*/ */
export * from './plotter.component'; export * from './graph2D.component';
export * from './plotter.routes'; export * from './graph2D.routes';
import { Route } from '@angular/router';
import { PlotterComponent } from './index';
export const PlotterRoutes: Route[] = [
{
path: 'plotter',
component: PlotterComponent
}
];
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