synergycodes/ng-diagram/ng-diagram-minimap
Claude Code and agent skill by synergycodes/ng-diagram
- community
Checking that the SKILL.md file is still in the repository.
Use when adding or customizing the ng-diagram minimap - placement, size, zoom controls, nodeStyle colors, custom minimap node templates, edges or hidden nodes in it, a slow minimap, or a minimap that does not show up.
Install
npx vskill@latest install synergycodes/ng-diagram/ng-diagram-minimapSKILL.md
Minimap
The <ng-diagram-minimap> overview panel (since 1.0.0): placement, inputs, node styling, custom node templates, theming, performance, and building your own minimap with NgDiagramMinimapNavigationDirective. Viewport APIs (zoom, pan, fit) are in the ng-diagram-viewport skill.
Rules
- Place
<ng-diagram-minimap>next to<ng-diagram>, not inside it, in a wrapper withposition: relative, inside the component that hasprovideNgDiagram()(or below it).<ng-diagram>projects only<ng-diagram-background>, so a minimap placed inside it is never shown. The minimap isposition: absolutein the nearest positioned ancestor. - The minimap draws nodes only: no edges, labels or ports. Effectively hidden nodes (
computedHidden) are not drawn and do not enlarge the minimap bounds (since 1.4.0). - With virtualization enabled, the minimap draws no nodes at all. It shows the visible-area frame and a shaded rectangle for the whole diagram.
- Prefer the
nodeStylefunction or CSS variables.minimapNodeTemplateMaprenders one Angular component per node inside aforeignObject, which is slow on large diagrams. nodeStyleresults are cached per node object, and the cache is cleared only when the function (or the template map) is replaced. Read only the node inside it; to restyle from app state, pass a new function.- On large diagrams, set
[deferNodeUpdates]="true"(since 1.2.0).
Add a minimap
| Input | Type | Default | ||||
|---|---|---|---|---|---|---|
position | NgDiagramPanelPosition: `'top-left' \ | 'top-right' \ | 'bottom-left' \ | 'bottom-right'` | 'bottom-right' | |
width, height | number, pixels of the map area | 200, 150 | ||||
showZoomControls | boolean | true | ||||
nodeStyle | MinimapNodeStyleFn | none | ||||
minimapNodeTemplateMap | NgDiagramMinimapNodeTemplateMap | empty map | ||||
deferNodeUpdates (since 1.2.0) | boolean | false |
- Dragging on the minimap pans the diagram: the visible-area frame follows the pointer (mouse and touch). A click without moving does nothing; there is no jump-to-point.
- The zoom controls show
−, the zoom percent and+. Each click changes the scale by 0.1 (10 percentage points); a button is disabled when the next step would passzoom.min/zoom.max. They are not configurable; build your own buttons withNgDiagramViewportServiceif you need more. - The panel adds its padding and the zoom controls around
width×height. - The ngDiagram watermark moves out of the minimap's corner by itself (since 1.2.0). Pick its corner with
watermarkPosition(see theng-diagram-setupskill).
Color nodes by type or status
MinimapNodeStyle fields, all optional: shape ('rect' default, 'circle', 'ellipse'), fill, stroke, strokeWidth, opacity, cssClass. Returning null, undefined or {} keeps the CSS defaults.
Highlight nodes from app state
The style function runs again only for nodes whose object changed (moved, selected, data updated). For search results, filters or a "highlight type" toggle, give the minimap a new function whenever that state changes:
Style with a CSS class
cssClass is added next to minimap-node on the node's SVG <g>, which lives inside the minimap component. Write the rule in a global stylesheet, because your component styles do not reach it. fill set on the <g> is inherited by the shape:
Values from nodeStyle (fill, stroke, strokeWidth, opacity) are inline styles and win over class rules.
Custom node templates
The component is rendered inside a foreignObject with the node's position, size and rotation, so it only has to fill its box. It receives the node and the result of nodeStyle for that node.
Theme the minimap
Set these in a global stylesheet or on the wrapper (defaults in ng-diagram/styles.css; the full list is in the ng-diagram-styling skill, references/css-variables.md):
- Panel:
--ngd-minimap-background,--ngd-minimap-border-color,--ngd-minimap-shadow-color,--ngd-minimap-border-radius(1rem),--ngd-minimap-padding(0.5rem),--ngd-minimap-margin(1rem, distance from the corner). - Nodes:
--ngd-minimap-node-color,--ngd-minimap-node-opacity(0.8). - Visible-area frame:
--ngd-minimap-viewport-stroke-color,--ngd-minimap-viewport-stroke-width(1; the frame follows changes, but the inner padding derived from it is read once, when the minimap is created). - Diagram bounds (virtualization only):
--ngd-minimap-diagram-bounds-color,--ngd-minimap-diagram-bounds-opacity(0.3). - Zoom controls:
--ngd-nav-button-color,-size,-border-radius,-padding,-background-color-hover,-color-active,-color-disabled, and--ngd-zoom-controls-font-size,-font-weight,-color.
Panel and button colors come from theme tokens, so they follow data-theme="dark".
Build your own minimap
NgDiagramMinimapNavigationDirective ([ngDiagramMinimapNavigation]) is the drag-to-pan behavior of the built-in minimap. You need it only for a minimap of your own, for example one that also draws edges. Put it on your SVG with two required inputs: transform ({ scale, offsetX, offsetY }; only scale, minimap pixels per diagram unit, is read) and viewport (from NgDiagramViewportService.viewport()). Read references/custom-minimap.md for a complete component.
Edge cases
strokeWidthis in diagram units, because nodes are drawn inside a scaled group: on a big diagram a width of 2 becomes a fraction of a pixel. Highlight withfilloropacity, or return acssClass(sayoutlined) and add.minimap-node.outlined > * { vector-effect: non-scaling-stroke; }to a global stylesheet; the stroke width then counts in screen pixels.- The minimap frames the content and the visible area together. When you pan far away from the content, the minimap zooms out to show both.
deferNodeUpdatesfreezes the minimap nodes only while a node is dragged, resized or rotated. The frame keeps moving, and every change made during the gesture appears when it ends.- A node without a measured
sizeis drawn as 100 × 50 at itsposition, rotated by itsangle. - Nodes hidden with CSS still appear in the minimap; it only knows the model. Hide them with the
hiddenflag (see theng-diagram-visibilityskill). - The minimap pans even with
viewportPanningEnabled: false, and its drag skips the middleware chain. For a view that must not move, leave the minimap out.
Symptom → fix
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/ng-diagram-minimap/SKILL.md
Popularity
- Repository stars
- 583
- Repository forks
- 41
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/synergycodes/ng-diagram/ng-diagram-minimap)