Skip to content

kmransom56/DrawIO_Network_Map_Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ DrawIO Automation Toolkit

License: MIT Python 3.13+ PowerShell

A comprehensive collection of automation tools for generating DrawIO diagrams, converting various image formats to DrawIO libraries, and extracting icons from Microsoft Visio stencil files.

🎯 Overview

This toolkit provides three main automation solutions:

  1. πŸ“Š XML to DrawIO Generator - Convert structured XML data into professional network diagrams
  2. πŸ–ΌοΈ Image to DrawIO Converter - Transform image collections into reusable DrawIO libraries
  3. 🎨 VSS to SVG Converter - Extract icons from Visio stencils for 3D design workflows

Perfect for network engineers, system administrators, and technical documentation teams who need to automate diagram creation and maintain consistent visual standards.

✨ Key Features

πŸ”§ XML to DrawIO Generator

  • Automated diagram creation from XML data sources
  • Azure network visualization with regions, VNETs, and Fortinet devices
  • CSV integration for dynamic interface details
  • Professional styling with organized layers and layouts

πŸ–ΌοΈ Image to DrawIO Converter

  • Multi-format support: PNG, JPG, SVG, GIF, BMP, WebP
  • Batch processing of entire image directories
  • Smart sizing with aspect ratio preservation
  • Base64 embedding for self-contained libraries

🎨 VSS to SVG Converter

  • Visio stencil extraction for official manufacturer icons
  • Multiple conversion methods (Python, PowerShell, Online)
  • Fortinet product coverage (15+ product categories)
  • Eraser AI integration ready for 3D icon creation

πŸ“‹ Table of Contents

πŸš€ Quick Start

Prerequisites

  • Python 3.13+ (for Python scripts)
  • PowerShell 5.1+ (for PowerShell scripts)
  • DrawIO Desktop (for importing generated libraries)

One-Command Setup

# Clone repository git clone <repository-url> cd drawio-automation-toolkit # Install Python dependencies pip install -r requirements.txt pip install -r image-converter-requirements.txt

πŸ› οΈ Tools Overview

1. XML to DrawIO Generator

File: generate-from-xml.ps1

Converts structured XML data into professional Azure Fortinet network diagrams.

# Generate diagram from XML data .\generate-from-xml.ps1 # Output: Azure_Fortinet_Template.drawio (ready to import into DrawIO)

Features:

  • βœ… Parses Fortinet node data from XML
  • βœ… Integrates CSV interface details
  • βœ… Creates East/West US regions with VNET layouts
  • βœ… Generates on-premises Fortigate nodes with labels
  • βœ… Professional styling and network connections

2. Image to DrawIO Converter

Files: image-to-drawio-converter.py | Convert-ImagesToDrawIO.ps1

Transforms image collections into reusable DrawIO libraries.

# Python version (cross-platform) python image-to-drawio-converter.py --input "icons/" --output "library.drawio" --name "My Icons" # PowerShell version (Windows) .\Convert-ImagesToDrawIO.ps1 -InputPath "icons/" -OutputPath "library.drawio" -LibraryName "My Icons"

Features:

  • βœ… Multi-format support: PNG, JPG, SVG, GIF, BMP, WebP
  • βœ… Batch processing with progress tracking
  • βœ… Smart sizing preserves original dimensions
  • βœ… Grid layout with customizable spacing
  • βœ… Base64 embedding for portable libraries

3. VSS to SVG Converter

Files: vss-to-svg-converter.py | vss-to-svg-libvisio.ps1

Extracts icons from Microsoft Visio stencil files for use in modern design tools.

# Python version with Aspose.Diagram python vss-to-svg-converter.py "FortiGate_Series_R22_2025Q2.vss" "FortiGate.svg" # PowerShell version with LibreOffice .\vss-to-svg-libvisio.ps1 -InputFile "FortiGate_Series_R22_2025Q2.vss" -OutputFile "FortiGate.svg"

Features:

  • βœ… Official Fortinet icons from 15+ product categories
  • βœ… Multiple conversion methods for maximum compatibility
  • βœ… Batch processing of entire stencil collections
  • βœ… Eraser AI integration ready for 3D conversion

πŸ“Έ Screenshots

Add screenshots here to showcase the tools in action

Before and After Examples

XML to DrawIO Generation

Input XML Data Generated DrawIO Diagram
Screenshot of XML structure Screenshot of generated network diagram

Image to DrawIO Library

Source Images Generated Library
Screenshot of icon folder Screenshot of DrawIO library interface

VSS to SVG Conversion

Visio Stencil Extracted SVG Icons
Screenshot of VSS file Screenshot of converted SVG files

Tool Interfaces

PowerShell Script Output

πŸ”„ Processing: FortiGate.svg βœ… FortiGate.svg (64x64) πŸ—οΈ Creating DrawIO library: Fortinet Icons βœ… Library created: fortinet-library.drawio πŸ“Š Summary: 1521 images β†’ fortinet-library.drawio 

Python Script Output

πŸ”„ Processing: 1u.svg ⚠️ Could not get size for fortinet_icons/1u.svg: cannot identify image file βœ… 1u.svg (64x64) βœ… Library created: test-library.drawio 

🎯 Usage Examples

Example 1: Generate Azure Network Diagram

# 1. Prepare your data # - Azure_All_Brands_Types.xml (network topology) # - fortigate-interfaces.csv (interface details) # 2. Generate diagram .\generate-from-xml.ps1 # 3. Import into DrawIO # File β†’ Open β†’ Azure_Fortinet_Template.drawio

Example 2: Convert Icon Collection to DrawIO Library

# Convert entire icon collection python image-to-drawio-converter.py --input "./fortinet_icons/" --output "fortinet-complete.drawio" --name "Complete Fortinet Library" # Import into DrawIO for use in diagrams

Example 3: Extract Visio Icons for 3D Design

# Convert Fortinet Visio stencils to SVG python vss-to-svg-converter.py "./fortinet_visio/" "./svg_output/" # Convert SVGs to DrawIO library python image-to-drawio-converter.py --input "./svg_output/" --output "fortinet-3d-ready.drawio" --name "Fortinet 3D Icons"

πŸ“ Project Structure

drawio-automation-toolkit/ β”œβ”€β”€ πŸ“Š Core Generators β”‚ β”œβ”€β”€ generate-from-xml.ps1 # XML β†’ DrawIO diagram generator β”‚ β”œβ”€β”€ image-to-drawio-converter.py # Python image converter β”‚ └── Convert-ImagesToDrawIO.ps1 # PowerShell image converter β”‚ β”œβ”€β”€ 🎨 Icon Processing β”‚ β”œβ”€β”€ vss-to-svg-converter.py # Python VSS β†’ SVG converter β”‚ β”œβ”€β”€ vss-to-svg-libvisio.ps1 # PowerShell VSS β†’ SVG converter β”‚ └── image-converter-requirements.txt # Python dependencies β”‚ β”œβ”€β”€ πŸ“š Documentation β”‚ β”œβ”€β”€ README.md # This file β”‚ β”œβ”€β”€ Image-to-DrawIO-README.md # Image converter guide β”‚ └── VSS-to-SVG-README.md # Visio converter guide β”‚ β”œβ”€β”€ πŸ—οΈ Build & Config β”‚ β”œβ”€β”€ requirements.txt # Core Python dependencies β”‚ └── image-converter-requirements.txt # Image processing dependencies β”‚ β”œβ”€β”€ πŸ“„ Data Files (Examples) β”‚ β”œβ”€β”€ Azure_All_Brands_Types.xml # Sample XML data β”‚ β”œβ”€β”€ fortigate-interfaces.csv # Sample interface data β”‚ └── fortinet_icons/ # Sample SVG icons (1000+ files) β”‚ └── 🎯 Output Examples β”œβ”€β”€ Azure_Fortinet_Template.drawio # Generated network diagram β”œβ”€β”€ test-library.drawio # Single icon test └── fortinet-batch-library.drawio # Batch conversion result 

πŸ”§ Installation

Python Dependencies

# Core requirements pip install -r requirements.txt # Image processing requirements pip install -r image-converter-requirements.txt # Optional: For advanced image support pip install imageio opencv-python

PowerShell Dependencies

# Install required modules (if needed) Install-Module -Name "RequiredModule" -Scope CurrentUser

External Tools (Optional)

For enhanced functionality, consider installing:

🎨 Workflow Integration

Network Documentation Workflow

graph TD A[XML Network Data] --> B[generate-from-xml.ps1] C[Interface CSV] --> B B --> D[Azure_Fortinet_Template.drawio] D --> E[DrawIO Import] E --> F[Professional Network Diagram] 
Loading

Icon Management Workflow

graph TD A[Image Collection] --> B[image-to-drawio-converter.py] C[Visio Stencils] --> D[vss-to-svg-converter.py] D --> E[SVG Icons] E --> B B --> F[DrawIO Library] F --> G[Reusable Icon Library] 
Loading

🚨 Troubleshooting

Common Issues

"Python module not found"

pip install -r requirements.txt

"PowerShell execution denied"

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

"VSS conversion fails"

"DrawIO import fails"

  • Validate XML syntax with online validator
  • Check base64 encoding integrity
  • Ensure DrawIO version 22.0.0+

Debug Mode

# Python with verbose output python image-to-drawio-converter.py --input "./test/" --output "debug.drawio" --verbose # PowerShell with detailed errors .\Convert-ImagesToDrawIO.ps1 -InputPath ".\test\" -OutputPath "debug.drawio" -Verbose

πŸ“Š Performance Benchmarks

Operation File Count Processing Time Output Size
Single Image 1 SVG < 1 second ~1 KB
Icon Batch 1521 SVGs ~30 seconds 322 KB
VSS Conversion 15 VSS files 2-10 sec each Varies
XML Generation 18 nodes < 1 second 15 KB

Performance measured on Intel i7, 16GB RAM, SSD storage

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Setup

# Clone your fork git clone <your-fork-url> cd drawio-automation-toolkit # Create virtual environment python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate # Install development dependencies pip install -r requirements.txt pip install -r image-converter-requirements.txt pip install pytest black flake8 # Optional: for testing and linting

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

Third-Party Components

  • Aspose.Diagram - Commercial license required for production use
  • LibreOffice - MPL 2.0 License (free)
  • Inkscape - GPL v2 License (free)

πŸ™ Acknowledgments

  • DrawIO Team for the excellent diagramming platform
  • Fortinet for providing comprehensive Visio stencils
  • Open Source Community for conversion libraries and tools

πŸ“ž Support

Issues and Bug Reports

Feature Requests

Documentation

πŸ—ΊοΈ Roadmap

Version 1.1 (Next Release)

  • Web Interface - Browser-based GUI for all tools
  • Docker Support - Containerized deployment
  • Cloud Integration - AWS/Azure storage support
  • Template Engine - Pre-built diagram templates

Version 1.2 (Future)

  • Real-time Collaboration - Multi-user editing support
  • Plugin System - Extensible architecture
  • AI Integration - Automated diagram suggestions
  • Mobile App - iOS/Android companions

Version 2.0 (Major Release)

  • Enterprise Features - LDAP integration, audit trails
  • Advanced Analytics - Usage metrics and insights
  • Custom Styling Engine - Brand-compliant themes
  • API-First Architecture - RESTful API for integrations

⭐ Star this repository if you find it helpful!

πŸš€ Quick Start β€’ πŸ“š Documentation β€’ πŸ› Report Issues

Made with ❀️ for the DrawIO and automation community

About

DrawIO_Network_Map_Generator - Network automation and management tool.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published