component
Hand matrix
The 13×13 range grid. Each cell is a stacked bar of action frequencies for one hand class.
The 13×13 grid. Each cell is a stacked bar of action frequencies for one hand class. Pass onSelect to make cells clickable. The range explorer renders it too. Shown here inside the limp range block.
Shown-hand only: limps that folded before showdown are invisible.
Installation
$ npx shadcn@latest add https://www.pokerstudy.ai/r/hand-matrix.jsonGenerative UI
A model can draw this with json-render. Install generative UI and spread its definitions into your catalog. The model reads the description and the schema below, and answers with a spec like the example.
HandMatrix
The 13×13 grid of hand classes, each a stacked bar of action frequencies. For a solver spot prefer RangeExplorer, which fetches the range itself.
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"cells": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"label": {
"type": "string"
},
"freqs": {
"type": "array",
"items": {
"type": "number"
}
}
},
"required": [
"label",
"freqs"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"description": "169 cells in grid order (AA, AKs, … 22). `freqs` is parallel to `colors`; null is \"not in range\"."
},
"colors": {
"type": "array",
"items": {
"type": "string"
}
},
"legend": {
"type": "array",
"items": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"color": {
"type": "string"
}
},
"required": [
"label",
"color"
],
"additionalProperties": false
}
},
"selected": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"description": "Highlighted hand, e.g. \"AKs\". Bind with $bindState to make cells clickable."
}
},
"required": [
"cells",
"colors",
"legend",
"selected"
],
"additionalProperties": false
}Props
Generated from the component source with react-docgen-typescript.
HandMatrix
| Prop | Type | Default | Description |
|---|---|---|---|
| aggressiveFirst | boolean | false | Draw the last action (the biggest raise) on the left of each cell and first in the legend. |
| cells * | (MatrixCell | null)[] | – | 169 cells, row-major A→2 by A→2 (suited above the diagonal). |
| colors * | string[] | – | Per-action colors, parallel to each cell's `freqs`. |
| foldIndex | number | – | Index of the fold action in `colors`; a cell that always folds gets a softer label. |
| legend * | { label: string; color: string; }[] | – | Legend entries under the grid, one per action. |
| onHover | ((label: string | null) => void) | – | Pointer over a cell, null when it leaves the grid. |
| onSelect | ((label: string) => void) | – | – |
| selected | string | null | – | Label of the highlighted cell, e.g. "AKs". |