From 0405ec82da263e64485f119a48d46790be770bb1 Mon Sep 17 00:00:00 2001 From: Laura Fuentes Grau Date: Sun, 24 Jan 2021 16:43:19 +0100 Subject: [PATCH] make graph downloadable #265 --- src/ic/ic-dialog.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ic/ic-dialog.js b/src/ic/ic-dialog.js index bdd4488..591db53 100644 --- a/src/ic/ic-dialog.js +++ b/src/ic/ic-dialog.js @@ -4,7 +4,7 @@ import Dialog from '../common/dialogs/dialog'; import Icon from "../common/icon"; import ConfirmCommand from './confirm-command'; import JsonView from 'react-json-view'; - +import FileSaver from 'file-saver'; class ICDialog extends React.Component { @@ -53,6 +53,10 @@ class ICDialog extends React.Component { this.setState({confirmCommand: false, command: ''}); } + downloadGraph(url){ + FileSaver.saveAs(url, this.props.ic.name + ".svg"); +} + render() { @@ -63,11 +67,6 @@ class ICDialog extends React.Component { if(typeof this.props.icGraph !== "undefined") { objectURL = this.props.icGraph.objectURL } - - let spanStyle = { - display: 'inline-block', - width: '130px' - } return ( +
+ +
Graph:
{objectURL !== '' ? (