Skip to content
Snippets Groups Projects
Select Git revision
  • 52188d72335cec26c1668cd81addefc7965f19fe
  • 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

graph3D.module.ts

Blame
  • graph2D.helper.ts 750 B
    export interface Animation {
    	data?: any,
    	timer?: any,
    	currentFrame: number,
    	speed: number,
    	playing: boolean,
    	init: boolean
    }
    
    export function toJSON(data: string) : string {
    	console.log('data',data);
    	const regexPts = /(?:\"pts\"\:\[(?:\((x),(y)\))+,?\])/g;
    	var dataJSON = data.replace(regexPts, (match, x, y) => {
    		return `"points": [[${x},${y}]]`
    	})
    	console.log('dataJSON', dataJSON);
    	return dataJSON;
    }
    
    export function triggerDownload(imgURI: string) {
    	var evt = new MouseEvent('click', {
    		view: window,
    		bubbles: false,
    		cancelable: true
    	});
    
    	var a = document.createElement('a');
    	a.setAttribute('download', 'Matefun_2D_plot.png');
    	a.setAttribute('href', imgURI);
    	a.setAttribute('target', '_blank');
    
    	a.dispatchEvent(evt);
    }