Documentation
¶
Overview ¶
Package heatmap turns autocaptured $click events into a click-density grid for a page, plus the top clicked elements — computed at query time over the existing events, no new stored config and no screenshots. The engine only ever emits integer coordinates; any page image is an iframe rendered browser-side in the cloud app, never here (a static Go binary ships no headless browser).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
Path string `json:"path"`
Viewport string `json:"viewport"`
Cols int `json:"cols"`
RowPx int `json:"row_px"`
Clicks int `json:"clicks"` // total positioned clicks counted
Max int `json:"max"` // busiest cell (for canvas scaling)
MaxRow int `json:"max_row"` // tallest row index seen (grid height)
Cells []Cell `json:"cells"`
TopTargets []Target `json:"top_targets"`
Note string `json:"note,omitempty"`
}
Result is the heatmap for one page + viewport bucket.
func Compute ¶
Compute aggregates $click events on `path` into a density grid. viewport is ""/"all"/"mobile"/ "tablet"/"desktop" (bucketed by the captured viewport width). cols/rowPx default to 40/20. Pure and deterministic — cells and targets are emitted in a stable sort order — so /v1/heatmap and the MCP heatmap tool agree byte-for-byte, the same contract as every other report.