Search
MindFusion.Diagramming and Web Applications

MindFusion provides dedicated ASP.NET and ASP.NET MVC diagramming controls, which provides several output modes supporting varying degrees of interactivity. For more information, take a look at their respective web pages:

http://mindfusion.eu/netdiagram.html
https://mindfusion.eu/mvcdiagram.html

Nevertheless, you can still use the MindFusion.Diagramming Windows Forms components to render your diagrams in a browser. The Diagram class defined in MindFusion.Diagramming.dll can be used to build diagrams dynamically and send them as static bitmap images to the browser. Optionally, you can create HTML image maps that let you associate hyperlinks with nodes and links in the diagram images. To implement that, follow these steps:

  • Create a MindFusion.Diagramming.Diagram instance and store it in the Session object.
  • Use the Diagram instance to programmatically construct or edit diagrams, in response to web form events.
  • Create an aspx file that overrides the Page_Load event like this: setting the page ContentType to "image/jpeg", generating an image by performing CreateImage and returning that image to the browser by writing it into the Response.OutputStream object.
  • Add a web Image control and set its URL to point the aspx page.
  • Use HtmlBuilder to create a client side image map that lets you associate hyperlinks and JavaScript functions with the diagram elements.

Similar implementation is demonstrated in the WebApp sample coming with MindFusion.Diagramming. To try the sample, create a virtual IIS directory for it, name the directory WebApp, then build and run the sample project.

Alternatively, you could use SvgExporter to create an SVG drawing of the diagram and include the generated SVG content in web pages.