openDrawEditor(index) {
    const urlEditor = 'https://draw.io?embed=1&spin=1&libraries=1&ui=dark';
    const editorWindow = window.open(urlEditor, 'MxGraph Editor', 'width=1280, height=720');
    window.addEventListener('message', event => {
      if (event.origin !== 'https://www.draw.io') return;
      // when editor is open
      if (event.data === 'ready') {
        // send xml
        event.source.postMessage(this.flowcharts[index].data.xml, event.origin);
      } else {
        if (event.data !== undefined && event.data.length > 0) {
          this.flowcharts[index].redraw(event.data);
          this.sourceChanged();
          this.$scope.$apply();
          this.render();
        }
        if (event.data !== undefined || event.data.length === 0) {
          editorWindow.close();
        }
      }
    });
  }
/**
   *Open graph in draw.io
   *
   * @param {number} index - index of flowchart
   * @memberof FlowchartHandler
   */
Open graph in draw.io
@param {number} index - index of flowchart
@memberof FlowchartHandler
Open graph in draw . io @param { number } index - index of flowchart @memberof FlowchartHandler
openDrawEditor(index) {
    const urlEditor = 'https://draw.io?embed=1&spin=1&libraries=1&ui=dark';
    const editorWindow = window.open(urlEditor, 'MxGraph Editor', 'width=1280, height=720');
    window.addEventListener('message', event => {
      if (event.origin !== 'https://www.draw.io') return;
      if (event.data === 'ready') {
        event.source.postMessage(this.flowcharts[index].data.xml, event.origin);
      } else {
        if (event.data !== undefined && event.data.length > 0) {
          this.flowcharts[index].redraw(event.data);
          this.sourceChanged();
          this.$scope.$apply();
          this.render();
        }
        if (event.data !== undefined || event.data.length === 0) {
          editorWindow.close();
        }
      }
    });
  }
openDrawEditor ( index ) { const urlEditor = 'https://draw.io?embed=1&spin=1&libraries=1&ui=dark' ; const editorWindow = window . open ( urlEditor , 'MxGraph Editor' , 'width=1280, height=720' ) ; window . addEventListener ( 'message' , event => { if ( event . origin !== 'https://www.draw.io' ) return ; if ( event . data === 'ready' ) { event . source . postMessage ( this . flowcharts [ index ] . data . xml , event . origin ) ; } else { if ( event . data !== undefined && event . data . length > 0 ) { this . flowcharts [ index ] . redraw ( event . data ) ; this . sourceChanged ( ) ; this . $scope . $apply ( ) ; this . render ( ) ; } if ( event . data !== undefined || event . data . length === 0 ) { editorWindow . close ( ) ; } } } ) ; }
Open graph in draw.io
 @param {number} index - index of flowchart
 @memberof FlowchartHandler
Open graph in draw . io @param { number } index - index of flowchart @memberof FlowchartHandler
// when editor is open // send xml