jquery.flowchart icon indicating copy to clipboard operation
jquery.flowchart copied to clipboard

Clear Flowchart Data but Maintain Settings

Open Rob-ModernAnalytics opened this issue 8 years ago • 1 comments

Hi,

Great work on this plugin! Is there a way to clear the flowchart data but maintain the other properties? I've used setData: {} and that clears the flowchart data but when a new operator is added the ID is not reset to 0 as I would expect.

Thanks!

Rob

Rob-ModernAnalytics avatar Jan 11 '18 17:01 Rob-ModernAnalytics

Hi,

I ended up solving this issue by adding a new method to the control:

	clearCanvas: function () {
                    this._clearOperatorsLayer();
		this._clearLinksLayer();
                     this.data.operatorTypes = {};
                     this.data.links = {};
                     this.data.operators = {};
                     this.redrawLinksLayer();
	},

btw what I call "canvas" is your flowchart-container.

Rob-ModernAnalytics avatar May 12 '18 16:05 Rob-ModernAnalytics