Component Icon System Overview
Applies to: CoModel cloud modeling & simulation platform (v1.15+)
1. Overview
CoModel's icon system provides an SVG icon for every modeling component. Icons are a component's visual identity; they appear in:
- Component Library page cards and lists
- The expanded component details on the My MTK Components page
- The component sidebar and canvas nodes in graphical modeling
- The component detail dialog
In addition, the port anchors on an icon determine the exact connection points on the canvas (see Component Icons & Port Anchors).
This guide answers three questions: where icons come from, how to create icons, and how to use icons.
![]()
2. Where icons come from
| Source | Identifier | Visibility | Description |
|---|---|---|---|
| System preset | system |
All users | Default icons for MTK standard library components, batch-generated from templates and maintained automatically by the platform |
| Official | official |
All users | Icons published by platform administrators |
| User uploaded | user |
Only you by default | Icons you draw in the editor or upload |
The Icons page separates visibility with two tabs:
- Public Icons: system presets + official icons + personal icons that have been made public
- My Icons: all icons you uploaded (including private ones)
Personal icons are private by default; toggle Public / Private in the icon detail dialog to publish one. Once public, every user can see it and Save as my icon.
FMU / AI components get platform-generated placeholder icons by default; to customize, assign an icon through the Edit Meta Info icon field as well (see Section 6).
3. Icon categories: identical to component categories
- The left side of the Icons page is a category tree with exactly the same structure, names, and order as the Component Library page (built-in → user → official, with Uncategorized at the end)
- Each category node shows an icon count that updates in real time with the active tab and search text
- When uploading or editing an icon, the category dropdown lists the same component categories you can see; leaving it empty files the icon under Uncategorized
- Administrator changes to component categories — adding, renaming, reordering — sync to icon categories immediately, with no migration step
![]()
4. Icon specification (validated automatically on save)
Whenever an icon is saved or uploaded, the platform validates the following rules and reports a specific error when one is violated:
| Rule | Requirement |
|---|---|
| Format | Valid SVG (XML) with a <svg> root element |
| viewBox | Must be "0 0 64 64" |
| File size | ≤ 50 KB |
| Port anchors | At least 1 <circle data-port="..."> marker |
| Forbidden content | <script>, <foreignObject>, inline event attributes (on*) |
Rendering safety: every icon passes the platform's sanitization (scripts and event attributes removed) before display, so icons from Public Icons are safe to use.
Port anchors are colored by physical domain; the same colors apply to editor anchors and canvas connections:
| Domain | Color |
|---|---|
| electrical | #AFCC2A green |
| mechanical | #F5A623 orange |
| thermal | #E8282B red |
| hydraulic | #3D7ABF blue |
| magnetic | #8E5BD0 purple |
| signal | #555555 gray |
| Other / unspecified | #9AA5B4 gray-blue |
Background: the 146 standard library icons are batch-generated from 6 built-in templates (OnePort / TwoPort / Sensor / Source / Ground / SignalBlock). Custom icons need not follow the templates — they only have to satisfy the specification above.
5. Three ways to create icons
5.1 Draw in the icon editor
Entry points: New Icon at the top right of the Icons page; or Edit on an existing icon in its detail dialog.
The editor has two views, switchable at any time:
- Draw mode: insert rectangles / circles / lines / text, and adjust fill, stroke, and position in the properties panel
- SVG Code mode: edit the SVG source directly (handy for tweaking code copied from an external tool)
Port anchor operations:
- Add port places anchors one at a time; set the port name and physical domain for each
- Drag anchors in the preview to reposition them (they snap to edges)
- Import ports from component: pick a component and generate anchors in bulk from its port list — port names stay consistent with the component automatically (recommended)
- On export, anchors are written as invisible
<circle r="0" data-port="..."/>markers
![]()
5.2 Upload an SVG file
Upload SVG at the top right of the Icons page: drag in or select a .svg file; the system runs every check from Section 4 and reports specific errors (for example, that the viewBox must be "0 0 64 64" or that at least one port anchor is required). Then set the name, category, and visibility, and save.
5.3 Save as
For another user's icon in Public Icons, Save as my icon in the detail dialog copies it into your personal library and opens the editor, so you can modify the copy.
5.4 Start from a component (recommended)
In a component's Edit Meta Info dialog, the icon field offers New Icon: the editor pre-loads the component's port anchors (see Component Icons & Port Anchors, Section 3) and pre-fills the category and name; on save the icon links to the component automatically and you return to the list. When building an icon for a specific component from scratch, this is the fastest path.
6. Using icons: assigning to components
The only entry point for icon assignment is Edit Meta Info (the pencil button) in the actions column of the page the component lives on — supported on all three pages: My MTK Components, FMU Components, and AI Components.
Depending on how many components the file contains, the UI takes two forms:
- Single-component files (typical for components created graphically or online): an icon field sits under the name —
- Unset: shows No icon set with an Assign icon button
- Set: shows a thumbnail and the icon name, with Change and Remove
- Both states also offer the New Icon shortcut (see Section 5.4)
- Multi-component files (an uploaded .jl library may parse into several components): each component gets a table row, with independent assign / change / remove per row, each also with New Icon
Clicking Assign icon / Change opens the icon picker: a category tree on the left (auto-navigates to the component's current category) and an icon grid on the right, searchable by name.
Save behavior:
- Clicking Save in the dialog applies all changes at once; Cancel discards them (nothing is written immediately)
- If the selected icon was deleted by someone else, saving shows "This icon is no longer available. Please pick another."; the dialog stays open for re-selection
- A component binds one primary icon; components without one use the platform's default placeholder icon
Icon assignment has been consolidated into Edit Meta Info: the icon buttons on the Component Library detail page and in the graphical component editor were removed; the detail page icon is display-only.
7. Checking where an icon is used
On the Icons page, click any icon card to open its details; the Usage section answers "who is using this icon":
- "Used by N component(s)" — a live count of components that are valid and visible to you
- Component list: up to 5 are listed flat; beyond that the list collapses behind Show all ({count}); searchable by component name keyword
- Clicking any component entry opens the same component detail dialog as the Component Library (same permissions as there)
Check the impact here before deleting an icon; afterwards, linked components automatically fall back to the default placeholder icon.
8. Icons page quick reference
| Action | Entry point | Notes |
|---|---|---|
| Browse | Public Icons / My Icons tabs | Combined with the category tree and search box on the left |
| Create / draw | New Icon | Draw in the editor, see Section 5.1 |
| Upload | Upload SVG | File upload + automatic validation, see Section 5.2 |
| Edit | Icon detail → Edit | Your own icons only |
| Public / private | Icon detail → toggle | Takes effect immediately |
| Save as | Another user's icon detail → Save as my icon | Copies into your library |
| View usage | Icon detail → Usage | See Section 7 |
| Delete | Icon detail → Delete | Linked components fall back to the default icon |
9. Next: port anchors
Icons decide what a component "looks like"; port anchors decide where connections attach. For the anchor format, port name matching rules, and fallback behavior, see Component Icons & Port Anchors.
10. FAQ
Why doesn't my custom component show my icon after I drag it onto the canvas?
Check in order:
- Whether you saved the icon assignment on the My MTK Components page through Edit Meta Info (Section 6)
- Whether the icon SVG passed platform validation (Section 4)
- Whether the icon was deleted — after deletion the component falls back to the default icon and must be reassigned
Can I share a personal icon with other users?
Yes: turn on Public in the icon details and the icon enters everyone's Public Icons; others can copy and modify it via Save as my icon. Switch back to Private to withdraw it (copies already saved by others are unaffected).
Do port positions get scrambled when a component is rotated?
No. The SVG icon is transformed as a whole through CSS transform, and port anchors rotate with it inside the SVG coordinate system; connection routing is inferred automatically from the rotated anchor positions.