maple-DrawioSupport 1.1.8

dotnet add package maple-DrawioSupport --version 1.1.8
                    
NuGet\Install-Package maple-DrawioSupport -Version 1.1.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="maple-DrawioSupport" Version="1.1.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="maple-DrawioSupport" Version="1.1.8" />
                    
Directory.Packages.props
<PackageReference Include="maple-DrawioSupport" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add maple-DrawioSupport --version 1.1.8
                    
#r "nuget: maple-DrawioSupport, 1.1.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package maple-DrawioSupport@1.1.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=maple-DrawioSupport&version=1.1.8
                    
Install as a Cake Addin
#tool nuget:?package=maple-DrawioSupport&version=1.1.8
                    
Install as a Cake Tool

Readme DrawioSupport

Overview

DrawioSupport provides utilities for rendering, processing, and extracting information from draw.io diagram files. It includes classes for rendering diagrams to images, extracting tab names, and parsing diagram content.

Main Classes

DIOModelExtractor

Provides static methods for extracting tab names, parsing models, and extracting text elements from draw.io files.

Example: Extract Tab Names

using (FileStream stream = File.Open("diagram.drawio", FileMode.Open)) 
{ 
	var tabNames = DIOModelExtractor.GetTabNames(stream).ToArray(); // tabNames: ["Page-1", "Page-2"] 
}

Example: Extract Text Elements

var xml = "<mxfile><diagram><mxCell value='Element1' /></diagram></mxfile>"; 
var xdoc = DIOModelExtractor.LoadModel(xml); 
var elements = DIOModelExtractor.GetTextElements(xdoc); // elements: ["Element1"]

Example: Strip HTML Tags

var result = DIOModelExtractor.StripHtmlTags("<p>This is a <b>test</b></p>"); // result: "This is a test"

DrawIOFileEnumerator

Fast crawler that finds drawio files in a given directory.

class TestEnumerator(string directory) 
        : DrawIOFileEnumerator<Result>(directory)
    {
        protected override Result TransformEx(ref FileSystemEntry entry, FS.IFileInfo fileInfo, DIOFileTypes fileType)
        {
            return new Result { FileInfo = fileInfo, FileType = fileType };
        }
    }

    public record Result
    {
        /// <summary>Location of file found</summary>
        public required FS.IFileInfo FileInfo { get; set; }


        /// <summary>Type of file found (e.g. .drawio, .drawio.png, ...)</summary>
        public required DIOFileTypes FileType { get; set; }
    }

List<DIOCrawlResult> files = new();
var enumerator = new TestEnumerator(TestDataHelper.ResolveTestdataDirectory("DrawIO"));
while (enumerator.MoveNext())
{
	Result current = enumerator.Current;
	files.Add(current);
}

DrawioRenderer

Render a draw.io diagram to png/svg file format. Each tab in the draw.io file will be rendered to a separate image file. The output files will be named according to the source file name appended with the sequence nr (e.g. -1.drawio.png, -2.drawio.svg ).

IFileInfo sourceFile = new FileInfo("diagram.drawio");
IDirectoryInfo targetDir = new DirectoryInfo("c:\\output");

IEnumerable<RenderResult> res = DrawioRenderer.ConvertTo(sourceFile, targetDir);
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.8 140 8/20/2025
1.1.7 136 8/20/2025
1.1.6 136 8/18/2025
1.1.5 112 8/9/2025
1.1.4 155 8/8/2025
1.1.3 154 8/8/2025
0.1.2 155 8/8/2025
0.1.1 157 8/8/2025
0.1.0 166 8/8/2025