Node styling rules#
Node style base#
Node Styles define the initial node appearance:
- size
- color
- opacity
- text
- arc sections
Node group matching and escalation happen after this base style is resolved.
Node arc and gradient-gauge rules#
- No configured Arc sections renders no donut decoration.
- Two or more configured sections render the existing equal-section donut. Field-driven and fixed-color sections can be mixed.
- Exactly one fixed-color section renders the existing full ring.
- Exactly one field-driven section renders a circular gradient gauge in the existing donut band.
- The gauge radial bars with narrow separators fill begins at 12 o'clock, advances clockwise by whole bars, and is normalized against the selected field's effective Grafana Min and Max.
- The Arc editor shows Bar width factor when at least one Arc section is configured. It shows Segments, Segment spacing, and Show thresholds only for exactly one field-driven Arc; it additionally shows Gradient when that Arc field uses From thresholds.
- Bar width factor scales Arc radial thickness inward while retaining the node's outer footprint. Segments and Segment spacing control gauge bar count and gaps. Disabling Show thresholds removes the outer full-range reference circle and its glow.
- Arc presentation settings are resolved per node from its originating Markers and links layer.
- When Segments is
1, the single radial bar covers the full circle for any finite metric value and uses the active field Color scheme color at its normalized value rather than the inactive track color. Missing or invalid values retain the subdued track behavior. - A thin outer reference circle displays the field's complete configured color range; the value controls which inner bars are active and does not truncate the reference circle.
- Values below Min clamp to an empty gauge; values above Max clamp to a complete circle.
- A null, missing, non-finite value, missing selected field, or non-positive effective range renders only the subdued gauge track, without an active bar or glow.
- The active bar uses the metric field's native Standard options -> Color scheme. Continuous by-value schemes render their Grafana gradient; From thresholds uses native absolute or percentage threshold positions and theme-resolved colors. For a single metric Arc using From thresholds, the optional Gradient setting defaults to enabled and interpolates between those stops; when disabled, the gauge uses piecewise-constant threshold levels with sharp boundaries. The setting is hidden for non-threshold schemes, which retain their existing behavior. Non-by-value schemes render a solid Grafana-resolved field color.
- Discrete threshold levels are visualized in the gauge bars and, when Show thresholds is enabled, in the outer reference circle.
- In both Geo and abstract node graph modes, a single field-driven gauge resolves a center display string through the selected field's existing Grafana display processor. The result includes configured units, decimals, value mappings, prefixes, suffixes, and no-value text.
- Center icon/value visibility is resolved per node. A gauge node without a configured group icon shows its value. A gauge node with a configured group icon shows the icon and suppresses the value while the Icon visibility layer is on; switching that layer off suppresses the icon and reveals the value. Mixed icon and no-icon groups in the same node layer are handled independently.
- The Label visibility layer, graph-layer visibility, group and layer filters, and focus behavior still apply to gauge center values. Multi-section and fixed-color donuts retain their existing center placeholder behavior.
- Gauge rendering does not add a separate threshold, Min/Max, palette, or gauge-style configuration to Mapgl.
- Gauge and donut rendering retain the same node size, inner icon opening, selection scaling, focus opacity, collision, filtering, and picking behavior.
Field-driven size scaling#
- Min is the rendered size or line width at normalized percentage
0. - Max is the rendered size or line width at normalized percentage
1. - For ordinary field scaling, those percentages correspond to the selected metric field's minimum and maximum.
- For capacity-relative arc scaling, they correspond to zero and the row's capacity.
- When Min is less than Max, lower metrics render smaller and higher metrics render larger.
- When Min is greater than Max, lower metrics render larger and higher metrics render smaller.
- When Min equals Max, the rendered size is constant.
- Min and Max are independently limited to the style editor's allowed size range; they are not reordered.
thrColor#
thrColoris injected by Mapgl during rendering.- Users do not add a dataframe column named
thrColor. thrColoris derived from the current node color result.- If Node Styles -> Color uses a metric field,
thrColorusually comes from native Grafana thresholds for that field. - If Node Styles -> Color is fixed, the fixed color becomes the starting color.
Node groups#
Ephemeral and non-ephemeral groups#
Mapgl evaluates two kinds of groups during node styling:
- Non-ephemeral groups are the groups users configure in Node Groups.
- Ephemeral groups are internal groups Mapgl creates while rendering.
A matching user-created group becomes the non-ephemeral color source only when its group color is set. That single group color covers every node matched by the group.
An ephemeral thrColor match means Mapgl created an internal threshold or fixed-color group for the node's resolved color. These groups are not stored in panel configuration and are not edited in Node Groups. They exist so threshold/fixed colors can still participate in fallback coloring, group indexing, legends, and filtering when no user-created group provides an explicit override.
If a user-created group matches but does not set a group color, the node can still take non-color properties from that group, such as icon, size, width, or tint mode. Its color falls back to the resolved ephemeral threshold color. In that case, the user-created group label does not appear in the groups legend because Mapgl does not have a stable defined color to show for that group.
Priority rule of thumb:
- user-created groups are preferred for icons, sizes, widths, and tint behavior
- a matching user-created group with an explicit color is preferred over internal threshold groups for color
- internal threshold groups preserve Grafana threshold color as the fallback
Node tag filtering#
When config.style.useGroups is enabled and config.tags names a dataframe field, a string or string[] value is normalized into the node's tags array. Nodes without tag data pass the tag filter. Edges and arcs remain visible only when both endpoints pass all node filters.
Node group matching#
Each node group can match on:
- any query field
- the special
thrColorvalue
Matching behavior:
- Conditions inside one group are combined with AND.
- A group with no conditions matches every node with lowest priority.
- String values are comma-separated.
- Number values are comma-separated and parsed as integers.
thrColorvalues are selected from threshold colors.
Node groups can define:
- label
- icon
- color override
- fixed size
- fixed width
- dashed edge line
- icon render mode
For node-group rules, isDashed: true renders matching edge strokes with the current [4, 2] dash pattern, relative to stroke width. An absent value leaves the edge solid unless another matching rule supplies the dashed flag.
Node group priority#
Matching groups are sorted by priority before style resolution.
Highest priority signals:
- Vertex A field match plus
thrColor - Vertex A field match plus additional field matches
- Vertex A field match only
- multiple matched properties including
thrColor - user-created
thrColorcondition match - internally generated
thrColorfallback match - catch-all or other lowest-priority match
The Vertex A field match means a group condition whose field name is the field selected in Vertex A.
Node group precedence#
Resolution is cascading:
- Resolve the node's base color, size, opacity, and text from Node Styles.
- Find all matching node groups.
- Choose the base group from the highest-priority non-ephemeral match with a visual property.
- If no such group exists, use the highest-priority non-ephemeral match.
- If no non-ephemeral group matches, use the highest-priority matching group.
- Resolve color separately from the highest-priority matching user-created group that has an explicit group color.
- If no group color override matches, fall back to the original node color from Node Styles.
- Resolve icon tint mode from the highest-priority matching group that defines one.
Implication:
- icon can come from one matching group
- color can come from another matching group
- size and width can come from the base group
- dashed edge line can come from the base group
- if no group color override applies, color falls back to Grafana threshold output
Icon render mode#
icon render mode controls whether a custom SVG icon uses its original artwork or inherits the resolved node color.
Tint source:
- matching group color override, if present
- otherwise resolved threshold color
Modes:
- None: keep original SVG colors
- Markup recolor: rewrite SVG
fillandstroke - Canvas tint: tint the rendered icon image after drawing
Use:
- Markup recolor for SVGs that recolor cleanly through markup
- Canvas tint for SVGs that do not recolor reliably through markup but look correct when tinted as rendered pixels
- None when the original SVG artwork should stay unchanged