Add heatMap display type to GLQL
What does this MR do and why?
This MR adds the heatMap display type to GLQL. A GLQL block can now use display: heatMap with exactly two dimensions and one metric. The first dimension runs along the columns, the second down the rows.
The presenter owns the translation from a GLQL result into the semantic cells the chart takes, along with the value formatters and the description exposed to assistive technology. The chart component itself stays free of query-language concepts, mirroring the split already used by the bar list chart and its presenter.
In-cell values use the compact formatter, since a cell has little room; the tooltip uses full digits.
A heat map is the first display type that requires exactly two dimensions, so the shared chart validation gained a minDimensions lower bound. Without it, a one-dimension query fell through the routing shell and rendered nothing, with no error to explain why.
lib/analytics/glql/schema.rb is updated in step with the JavaScript changes, because a spec asserts the Ruby and JavaScript display-type lists agree.
displayConfig.description renders a description above the grid.
This MR is stacked on top of the MR that adds the underlying heat map chart component, and targets that MR's branch rather than master.
References
- Issue: https://gitlab.com/gitlab-org/gitlab/-/work_items/628031
- Parent MR (chart component): !254289 (merged)
- A follow-up will point the DAP Impact Adoption panel at this display type. That follow-up depends on !254195 (merged), which creates the Adoption panel.
How to set up and validate locally
In a GLQL view
-
Paste the following GLQL block into any issue description:
```glql display: heatMap mode: analytics query: type = CodeSuggestion and timestamp >= -30d dimensions: ideName, language metrics: totalCount ``` -
Confirm the grid renders.
-
Hover a cell and confirm the tooltip names that exact cell.
-
Change
dimensionsto a single dimension and confirm an error appears rather than an empty space.
On the DAP Impact dashboard
!254305 (merged) points the Adoption panel at this display type and is stacked on this MR. Check out that branch to see it in a real dashboard panel; it carries its own validation steps.
Tests
yarn jest spec/frontend/glqlbin/rspec spec/lib/analytics/glql/schema_spec.rb- 98 suites and 1433 frontend tests pass across the GLQL and dashboard visualization directories.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist.