Meta data sync, and library #5225
Replies: 1 comment
-
Great use-case — here’s what’s possible today, what isn’t, and the cleanest setup to get 90% of what you want. What works today
Add device fields via Right-click → Edit Data… (key/value pairs). Use those values in labels or tooltips with placeholders, e.g. label: %(model)% – %(ip)%, tooltip: %(type)% | %(vendor)% | IP: %(ip)%. You can bulk copy these via Format panel → Style → Set as default style or save them into a custom library entry.
Use View → Layers. Put each network/overlay on its own layer (LAN/WAN/OT/Guest, etc.). Toggle visibility/lock to show slices or the full map. For “filters,” add tags (bottom of the Style panel) or a data field (e.g., network=OT) and use Edit → Find… to select/hide.
Host a custom library (.xml or .drawio library) in a stable URL (Confluence page attachment, raw GitHub, Google Drive share link). Load it via Extras → Manage Libraries → + → URL. Everyone gets the same palette, and updates to the library file appear for all users on reload. Important limitation Live updates to already-placed shapes (❌, with nuance): Best-effort pattern to maximize reuse If your custom library defines stencil shapes (style includes shape=mxgraph..), changing the stencil drawing itself can reflect on diagrams that still reference that stencil when reopened. However, size/label/overrides in each placed shape won’t update. Publish your library as stencils, not just SVG blobs. Avoid ungrouping/convert-to-shape on placed items (keeps the shape=mxgraph… reference). Test by updating a stencil path → reopen a diagram that uses it. Practical workflow for your goals Build the library as stencils + defaults For each device: make a stencil entry with a clean shape=mxgraph.devices. plus default Edit Data keys (ip, type, model, vendor, mgmtUrl, fw, mac). Add tooltip template using placeholders (e.g., %(type)% • %(model)% • %(ip)%). Host library at a URL and distribute via Manage Libraries → URL. Use layers + tags Layers for network overlays (L2/L3/VPN/OT/etc.). Tags or a network data field for selective find/hide. Keep metadata portable Put all per-device values in Edit Data (not label text). Labels/tooltips then render from placeholders — so later you can change the label format globally by updating the default style in the library (new drops get it). When a design must change globally Visual tweaks to icon paths: change the stencil → reopen diagrams (most will re-render to new path if the stencil reference remains). Structural/metadata changes: for existing diagrams, use Edit → Find (by tag or type=modelX) to multi-select and apply a new style, or run a small XML transform script to replace styles/keys in batch exports. Cloud/Confluence team libraries In Confluence, store the library in the DRAWIOCONFIG space as a team library (attachment). Everyone in that space will load the same palette automatically. What’s not available (today) A true “linked symbol” that propagates any change (visual + metadata) to all already-placed instances across multiple diagrams. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I’m building a networking library for specific devices (PLCs, gateways, routers, IoT thermostats, actuators, temperature sensors, etc.).
Each device is represented as an SVG symbol/image.
I’d like to:
Define standard metadata attributes for all devices, so I can use the tooltip feature to display details (IP, type, model, etc.).
Have a way to assign attributes/layers so that different networks can overlap, allowing me to view the entire network or just parts of it.
Maintain one large central library that automatically syncs across multiple diagrams.
Problem
Right now, when I create a custom library in draw.io (.xml or .lib file), it doesn’t behave like a global shape template. If I edit a shape in the library, existing shapes in diagrams don’t update automatically. This makes it hard to maintain consistency when the library changes.
Proposed Solution
Support global custom libraries stored locally or in cloud storage (Google Drive, OneDrive).
Allow shapes in diagrams to be linked to their library definition so that changes in the library propagate to all diagrams that use them.
Add the ability to define standard metadata fields (key-value pairs) for shapes, usable for tooltips and data overlays.
Enable layer-based attributes for shapes to control visibility of different networks.
Example Workflow
Create a custom library with SVG shapes and metadata attributes.
Save the library in Google Drive/OneDrive.
Insert shapes from the library into multiple diagrams.
Update a shape’s design or metadata in the library → all diagrams using it get updated automatically.
Benefits
Consistency across all diagrams.
Easier updates and maintenance of large libraries.
Ability to visualize networks dynamically by filtering layers.
Beta Was this translation helpful? Give feedback.
All reactions