Node and edge styles#
Node styles#
Use Node Styles for the base appearance of nodes:
- Size: fixed value or numeric field-driven sizing.
- Color: fixed value or field-driven color with native Grafana thresholds.
- Fill opacity
- Text label
- Arc sections: extra metric segments when your topology uses them.
This is the foundation for group escalation. Node groups do not replace Grafana field config. They build on top of it.
For field-driven Size, Min is the rendered size assigned to the lowest metric and Max is the size assigned to the highest metric. Set Min greater than Max when lower metric values should appear larger. The same direction rule applies to field-driven edge and arc line widths.
Arc sections adapt to the selected configuration:
- Two or more sections keep the existing equal-section donut around the node.
- One fixed-color section remains a full fixed-color ring.
- One field-driven section becomes a circular gradient gauge. Its compact radial bars start at 12 o'clock and fill clockwise according to the metric's effective Min and Max. Filled bars use the selected field's Standard options -> Color scheme; unfilled bars stay subdued. A thin outer circle shows the full configured color range, and carries the restrained glow.
The gauge supports native Grafana continuous by-value schemes and From thresholds. Configure Min, Max, Color scheme, and thresholds through Grafana standard field options or field overrides; Mapgl does not define a separate gauge color scale.
In both Geo and abstract node graph modes, the center of a single field-driven gauge shows the same metric through Grafana's display formatting, including units, decimals, value mappings, prefixes, suffixes, and configured no-value text. A node group without a configured icon shows the value normally. When a group has an icon, the center shows either that icon or the value: switching off the Icon visibility layer reveals the value.
Node groups#
Node groups are the most specific styling system in Mapgl. A group can define:
- legend label
- SVG icon
- color override
- fixed node size
- fixed line width
- dashed edge line
- icon render mode
- matching rules
Turn on Node Groups -> Apply to use configured group rules.
Matching#
Each group contains one or more match conditions. A condition can target:
- any query field from your dataframe
- the special
thrColorfield
thrColor is an internal value injected by Mapgl during rendering. You do not create a dataframe field with that name.
It is derived from the current node color result, usually from the node metric field and native Grafana thresholds.
Group resolution is cascading. In short:
- Node Styles establish the base color, size, and label behavior
- matching groups can provide icons, fixed sizes, fixed widths, and color overrides
- matching groups can mark matching edges as dashed
- color can come from a different matching group than the icon
- if no matching group provides a color override, Grafana threshold color remains in effect
Exact precedence and matching rules are documented in Node styling rules.
Icon render mode#
icon render mode controls whether the selected SVG icon should stay unchanged or be recolored from the resolved node color.
Available modes:
- None: use the original icon colors from the SVG file.
- Markup recolor: rewrite SVG
fillandstrokevalues in the markup and replace them with the resolved color. - Canvas tint: draw the icon to a canvas and tint the rendered pixels with the resolved color.
Use Markup recolor for SVG icons that should use a single color. Use Canvas tint when markup replacement is unreliable but rendered-pixel tinting looks correct. Use None when the icon should preserve its original multicolor artwork.
Recommended pattern#
For most dashboards, the cleanest setup is:
- Use Node Styles -> Color with a metric field and Grafana thresholds.
- Add node groups that match on
thrColorfor severity-aware behavior. - Add extra field matches such as site, role, vendor, or status class when you need more specific icons or sizing.
- Only set group color when you intentionally want to override threshold color.
Example#
Assume:
- node color metric is
severity - Grafana thresholds make
severity=0green,1yellow,2red - group
Routersmatchesrole=routerand sets iconrouter - group
CriticalmatchesthrColor=redand sets colorred
Result:
- a healthy router gets the router icon from
Routers - a critical router gets the router icon from
Routers - the same critical router gets the red color from
Critical - a non-router critical node still stays red because thresholds already resolved it red
Node tags#
In Markers and links → Node Groups, enable Apply and map Tags to a field containing a string or string[]. The legend lists tags by visible node group; tags shared between groups appear once in Shared. Tag selections filter nodes alongside node-group visibility; reset a row to clear its selection. Links and arcs remain visible only when both endpoints pass node filters. Layers without a Tags mapping do not contribute legend items and pass the tag filter.
Edge styles#
Use Edge Styles when Vertex B is configured:
- arrow direction and flow animation
- line width
- color
- text for edge labels
Arrow direction controls flow direction. Forward moves from source to target, Reverse moves toward the source, and Both moves from the complete curve's midpoint toward both ends. Focused edges animate by default. Arc-link blob animation runs on every visible arrowed arc regardless of Other -> Edge labels and animation always on. That option keeps labels visible and enables idle animation for routed curves; while focus is active, only focused edges animate.
If you enable Arc styles, Mapgl can style side A and side B independently and use a capacity field for metric normalization. Each side has its own Text label and Font size controls: side A labels the source end and side B the target end. Fixed, Field and Template text can use a different field from the side's color. Grafana units, mappings and decimals still apply. Edge Styles -> Text label supplies the middle label in routed and non-routed modes.
Focusing an edge reveals and emphasizes its configured labels even when Other -> Edge labels and animation always on is off. The setting shows labels without focus and controls idle routed-curve animation. The Label layer and graph/group/edge visibility still apply. Dense focused labels can move or stack to stay visible; blank labels are omitted.
An Arc link tapers continuously from side A's line width at the source to side B's line width at the target.
Field-driven line width uses the same endpoint semantics as node size: Min is rendered at the normalized low end and Max at the normalized high end. A Min value greater than Max creates a descending scale.
For paths crossing several namespaces, select a namespace array field in Vertex A namespace. Each array lists one namespace per path node in order, including both endpoints; coordinate waypoints do not consume entries. JSON string arrays are supported. Vertex B namespace remains visible when Vertex B is configured; array rows ignore its value. Existing scalar namespace fields keep their A/B behavior and saved configuration paths.
If an array names an unknown namespace, all path nodes fall back to the first entry's namespace. Ensure those node IDs exist there; invalid array shapes and unresolved nodes appear in graph diagnostics.