Skip to content

Fix/ci lint and publish report - #49

Open
luke-kustra wants to merge 11 commits into
esnet:2.1.1from
luke-kustra:fix/ci-lint-and-publish-report
Open

Fix/ci lint and publish report#49
luke-kustra wants to merge 11 commits into
esnet:2.1.1from
luke-kustra:fix/ci-lint-and-publish-report

Conversation

@luke-kustra

Copy link
Copy Markdown

No description provided.

luke-kustra and others added 8 commits July 17, 2026 16:37
…ements

Cells & interaction: rounded corners + surface-gap spacers, hover cross-highlight
(dim other cells, bold matching axis labels), distinct null vs no-data rendering,
tooltip fix + value-led hierarchy.

Color: built-in sequential (default) and diverging color modes with theme-aware
neutrals; standard-options mode preserved.

Layout & reading: sort by marginal total, category-group background bands,
fit-to-panel sizing, frozen axis labels, marginal total bars, size-encodes-value
(dual encoding). Axis margins now sized to measured label width so labels are no
longer clipped; pixel-accurate truncation.

Legend: range legend gains a title and start/mid/end ticks.

Adds sample-data/ CSV fixtures and makeover.md documenting the changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Clarity: legend null/no-data key; continuous gradient legend for
sequential/diverging modes with labeled min/max and a diverging midpoint tick;
guided empty/onboarding states that explain what's missing instead of a bare
"No Data".

Analytical: cluster ordering (dependency-free spectral seriation) as a third
row/column sort mode; explicit/shared manual color domain for comparable panels;
value-threshold focus that dims or hides cells outside a range.

Interaction & accessibility: keyboard navigation (roving tabindex, arrow keys,
Enter/Space to pin, Escape), focus parity with hover, ARIA grid roles + per-cell
labels, accessible HTML table-view fallback, interactive legend (hover to
highlight matching cells), click-to-pin row/column, and auto-horizontal column
labels when they fit.

Also: render hook is now called unconditionally for stable React hook order
(fixes a crash when toggling the table view), with a hardened createViz guard.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two runtime bugs found while adding regression tests:

- makeRamp threw on non-finite input (NaN/Infinity) by dereferencing rgb[NaN],
  which could blank the whole panel. Now clamps the index and falls back to the
  low end of the ramp for non-finite t.

- Color domain was extracted with Object.values(field.values), which returns the
  internal buffer (not the values) when field.values is a Vector rather than a
  plain array — leaving the domain empty and rendering sequential/diverging cells
  as a single flat color. Added fieldValuesArray() that handles plain arrays,
  Vectors (toArray) and Vector-like (length+get) uniformly, used for both the
  color domain and the categorical legend.

Adds src/verify.test.tsx exercising parseData across all color/sort/grouping/
focus/null-vs-no-data/empty combinations; these assertions catch both bugs.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- matrix.js: replace sanitize-html import with Grafana's textUtil.sanitize,
  matching upstream 2.1.1 which drops the sanitize-html dependency (keeps the
  branch buildable after merging 2.1.1).
- dataParser.ts: guard the static Row/Column list against undefined/empty input
  and trim whitespace, so enabling "Use Static Row/Column Lists" before filling
  the fields no longer throws and " a, b " no longer yields phantom/padded keys.
- makeover.md: correct the Verifying section — no demo dashboard is bundled in
  the repo; describe adding the panel + a sample CSV manually.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts:
#	src/EsnetMatrix.tsx
#	src/dataParser.ts
#	src/matrix.d.ts
#	src/matrix.js
#	src/module.ts
Taking the makeover's matrix.js reverted 2.1.1's block-scoped-variable and
strict-equality refactor, so `yarn lint` (a CI gate) failed on it. Restore that
cleanliness without changing behavior:
- var -> let/const
- == -> === (legendType check)
- add the same `/* eslint-disable react-hooks/rules-of-hooks */` upstream uses
  for the d3 render entry point.

All authored source is now lint-clean (0 errors). The only remaining lint
output is src/d3.min.js, which is byte-identical to upstream 2.1.1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The CI run was red for two independent reasons.

Lint: all 2618 errors came from src/d3.min.js, a 280 KB vendored copy of
minified d3 v7.9.0 that ESLint was linting as ordinary source. Every other
file was clean. Because `build` failed here, the e2e jobs were skipped.

matrix.js was the only d3 consumer and only used select, local and
selection.transition(), so replace the vendored file with the npm modules.
Import d3-selection and d3-transition rather than bare `d3`: the scaffolding
lists 'd3' as a webpack external, so `import * as d3 from 'd3'` would emit
zero bytes and silently depend on Grafana's runtime-provided d3. The
submodules bundle normally and keep the plugin self-contained.

dist/module.js drops from 326,241 to 84,220 bytes.

Both packages are pinned to range "3", which matches lock entries that
already existed via the transitive d3 devDependency, so yarn.lock is
unchanged and `yarn install --frozen-lockfile` still passes.

Jest's scaffolded transform allowlist covers `d3` but not these ESM-only
submodules, so extend transformIgnorePatterns. Add d3Imports.test.js, which
imports matrix.js and asserts selection.transition() is present -- it fails
if the d3-transition side-effect import is ever dropped.

publish-report: the job had `if: always() && !cancelled()`, so it ran even
after every upstream job was skipped, force-pushed an empty orphan gh-pages
branch, then failed on `actions/checkout ref: gh-pages` with git exit 128.
It cannot deliver anything on this fork -- GitHub Pages is disabled, the
upload step passes upload-report: false so no HTML report is produced, and
there are no e2e spec files. Remove the job and its orphaned upload step.

Verified on Node 22: install, typecheck, lint (0 errors), 18 tests and build
all pass. In Grafana all four demo panels render and tooltips fade in/out.

Co-Authored-By: Claude <noreply@anthropic.com>
CustomScrollbar is deprecated in favour of ScrollContainer, which uses
native scrollbars. This was the last thing producing lint warnings; the
lint run is now completely clean (0 errors, 0 warnings).

autoHeightMin="100%" maps to minHeight="100%" -- ScrollContainer already
defaults to maxHeight: '100%'.

@grafana/ui is a webpack external, so the panel uses the host Grafana's
copy at runtime rather than the 12.4.2 it compiles against. Verified
against the running Grafana 13.1.0 that its @grafana/ui does export
ScrollContainer, so the swap is safe across that version gap.

Note: the visual layout of the two scroll containers has NOT been
confirmed in a browser -- typecheck, lint, tests and build all pass, but
the local Grafana would not paint panels in a backgrounded Chrome window.
Worth an eyeball on both the SVG view and the table view (showTableView).

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 25, 2026 00:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@luke-kustra

Copy link
Copy Markdown
Author

fixed legend issues including the lower bound threshold and having the "no data" legend to the right of the actual legend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants