HeatmapChart class
A 2D heatmap widget that maps grid values to colours via a ChartRamp.
Each cell in the grid is expected to be in the [0..1] range and is
rendered as a coloured terminal cell.
HeatmapChart(
grid: [
[0.1, 0.4, 0.8],
[0.3, 0.6, 0.9],
[0.5, 0.7, 1.0],
],
width: 30,
height: 10,
ramp: ChartRamp.thermal(),
)
- Inheritance
-
- Object
- Widget
- RenderObjectWidget
- LeafRenderObjectWidget
- HeatmapChart
Constructors
-
HeatmapChart({required List<
List< grid, int? width, int? height, ChartRamp? ramp, bool useBackground = true, String glyph = ' ', bool showGrid = false, int gridRows = 3, int gridCols = 3, UvStyle? gridStyle, List<double> >String> ? xLabels, List<String> ? yLabels, UvStyle? labelStyle, List<ChartLegendEntry> ? legendEntries, int legendColumns = 1, int legendRowGap = 0, ChartLegendPosition legendPosition = ChartLegendPosition.topRight, int legendPadding = 1, int? crosshairX, int? crosshairY, UvStyle? crosshairStyle, Key? key}) -
Creates a HeatmapChart with the given
griddata and display options.
Properties
-
children
→ List<
Widget> -
Child widgets that receive forwarded messages.
no setterinherited
- crosshairStyle → UvStyle?
-
Style for the crosshair lines.
final
- crosshairX → int?
-
X coordinate for crosshair overlay, or null to hide.
final
- crosshairY → int?
-
Y coordinate for crosshair overlay, or null to hide.
final
- debugRenderObjectPassthrough → bool
-
Whether this widget is intentionally transparent to render-object layouts.
no setterinherited
- focusable → bool
-
Whether this widget can receive keyboard focus.
no setterinherited
- glyph → String
-
Character placed in each cell (visible only when useBackground is false).
final
-
grid
→ List<
List< double> > -
The 2D array of values, each in
[0..1].final - gridCols → int
-
Number of vertical grid lines.
final
- gridRows → int
-
Number of horizontal grid lines.
final
- gridStyle → UvStyle?
-
Style for grid overlay lines.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → int?
-
The chart height in terminal rows, or null to fill available space.
final
- id → String
-
Unique identifier for this widget.
no setterinherited
- key → Key?
-
Key for preserving widget identity.
finalinherited
- labelStyle → UvStyle?
-
Style for axis labels.
final
- legendColumns → int
-
Number of legend columns.
final
-
legendEntries
→ List<
ChartLegendEntry> ? -
Optional legend entries rendered inside chart bounds.
final
- legendPadding → int
-
Inner padding from chart edges to legend area.
final
- legendPosition → ChartLegendPosition
-
Legend placement within chart bounds.
final
- legendRowGap → int
-
Empty rows inserted between legend rows.
final
- ramp → ChartRamp?
-
Colour ramp for value-to-colour mapping.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showGrid → bool
-
Whether to draw a grid overlay.
final
- theme → Theme
-
Access the current theme.
no setterinherited
- useBackground → bool
-
If true, applies colour as background; otherwise as foreground.
final
- width → int?
-
The chart width in terminal columns, or null to fill available space.
final
-
xLabels
→ List<
String> ? -
Labels along the bottom (X) axis.
final
-
yLabels
→ List<
String> ? -
Labels along the left (Y) axis.
final
Methods
-
buildCachedView<
T> (T builder(), Object? cacheKey) → T -
Returns a cached view if the cache key matches.
inherited
-
createRenderObject(
) → RenderObject -
override
-
didUnmountRenderObject(
RenderObject renderObject) → void -
inherited
-
handleInit(
) → Cmd? -
Override this instead of init for widget-specific initialization.
inherited
-
handleIntercept(
Msg msg) → (Widget, Cmd?) -
Override this to handle messages before they reach children.
inherited
-
handleUpdate(
Msg msg) → (Widget, Cmd?) -
Override this to handle messages specific to this widget.
inherited
-
init(
) → Cmd? -
Called once when the widget is first mounted.
inherited
-
invalidateCachedView(
) → void -
Clears any cached view for this widget.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
Msg msg) → (Model, Cmd?) -
Handles messages by forwarding to children then calling handleUpdate.
inherited
-
updateRenderObject(
RenderObject renderObject) → void -
override
-
view(
) → Object -
Renders the widget to a string or View.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited