- Welcome, Guest. Please Login or Register
  We are soon releasing MindFusion.JavaScript pack. Initial version includes chart, diagram, calendar, map, virtual keyboard, gauge and UI components. Here are the beta version and live demo for anyone interested.  
Page Index Toggle Pages: 1 Send Topic Print  
Diagramming for JavaScript, V3.2
Read 1724 times

Forum Admin   Offline
YaBB Administrator
Posts: 526
Gender: male
Rock and Roll

Diagramming for JavaScript, V3.2
Nov 8th, 2017 at 11:20am
We have released version 3.2 of MindFusion JavaScript Diagram library. It contains the following new features and improvements:

Export to SVG
The SvgExporter class creates a Scalable Vector Graphics (SVG) drawing from the content of a Diagram. The exportElement method returns a DOM <svg> element that can be directly added to the page. The exportString method returns an SVG string that can be saved in local storage or submitted to server.

function onExportSvg()
	var diagram = $find("diagram");
	var exporter = new MindFusion.Diagramming.SvgExporter();
	var svgElement = exporter.exportElement(diagram);
	svgElement.style.position = 'fixed';
	svgElement.style.zIndex = 100;

AMD module
The diagramming.js script can be loaded as an AMD module now. If it detects an AMD loader during startup, it will list common.js as its dependency, so it is enough to require only diagramming.js as application's direct dependency:

MindFusionImpl = "StandAlone";

   // create a Diagram component that wraps the "diagram" canvas
   var Diagram = MindFusion.Diagramming.Diagram;
   var element = document.getElementById("diagram");
   var diagram = Diagram.create(element);
   var node = diagram.factory.createShapeNode(10, 10, 40, 30);
   node.setText("Hello, world!");

  • Arc definitions in custom shapes now follow correct SVG syntax (A rx ry x-axis-rotation large-arc-flag sweep-flag x y) instead of specifying bounding box and angles;
  • Node's Stroke attribute is now also applied to shape decoration elements;
  • Underlined fonts can be applied to the text of links;
  • RowCount and ColumnCount properties now exposed by TableNode.

Distribution for the latest version can be downloaded here, or from the clients area on our site:

Updated scripts are also available as diagram-library NPM package.

IP Logged    
Page Index Toggle Pages: 1 Send Topic Print