Skip to content
Snippets Groups Projects
Select Git revision
  • ef8ef4f1e21332e02394581de1d6d229dbc22f25
  • master default
  • dja
  • dja_various_fixes
  • dja_differentiate_same_user_connections
  • dja_fix_bugs
  • dja_guest
  • dja_guests
  • dja_sign_out_without_race_conditions
  • dja_subgroups
  • dua_subgroups
  • dja_groups_2
  • dja_groups
  • dja_heroku_11_7_2024
  • dja_share_files
  • dja_execute_files_aux_2
  • dja_execute_files_aux
  • dja_execute_files
  • dja_files_page
  • dja-create-main-button
  • feature/aristas-metadata-vertices
  • v2.0
  • v1.0
23 results

graph2D.component.ts

Blame
  • graph2D.component.ts 32.72 KiB
    import { Component, ViewChild, ElementRef } from '@angular/core';
    import { GHCIService } from '../../../shared/services/ghci.service';
    import functionPlot from 'function-plot';
    import { Animation, Setting, toJSON, triggerDownload } from './graph2D.helper';
    import { TranslateService } from '@ngx-translate/core';
    
    @Component({
        moduleId: module.id,
        selector: 'graph2D-component',
        templateUrl: './graph2D.component.html',
        styleUrls: ['./graph2D.component.scss'],
        host: {
            '(window:resize)': 'onResize($event)'
        }
    })
    export class Graph2DComponent {
    
        // Ghci Service
        private ghciServiceSub: any;
    
        // Chart Container - DOM Element
        @ViewChild('graph2DContainer')
        private graph2DRef: ElementRef;
    
        // Chart Instance
        private instance: any;
    
        // Settings
        settings: Setting = {
            axis: true,
            grid: true,
            tip: true
        }
    
        private funciones= [];
    
        private id = 0;
    
        private conjunto= [];
    
        // Animation state
        animation: Animation = {
            data: [],
            init: false,
            currentFrame: 0,
            fps: 10,
            playing: false,
            timeout: null,
            animationFrame: null,
            speedX: 10,
            boton: true,
            zoo: 2000
        };
        //Nuevo
    
        public easeInOutCubic = function(fps) {
            var t = fps < 6 ? 6 : fps;
            var k = t/60;
            var animation = k<.5 ? 60*(4*k*k*k) : 60*((k-1)*(2*k-2)*(2*k-2)+1);
            console.log(animation);
            return animation;
        }
    
        public setZoom = () => {
            this.animation.zoo = this.animation.zoo ;  
        }
        public multiGraf = () => { 
            this.animation.boton = !this.animation.boton;
        }
        public constructor(private ghciService: GHCIService, public translate: TranslateService) {