Skip to content

Conversation

@BYK
Copy link
Member

@BYK BYK commented Dec 12, 2025

Summary

Fix two issues with the Profiles tab under trace views:

  1. Sunburst chart showing byte sizes (e.g., '42kb'): The nanovis library interprets the size field as bytes. Added an overlay to cover the center text and display proper sample counts instead.

  2. Treemap and sunburst colors appearing white/invisible: rendering issue

Changes

  • Flamegraph: Renders immediately on load (triple rAF + direct draw call)
  • Treemap: Proper dimensions with explicit pixel sizing
  • Sunburst: Square aspect ratio with centered sample count overlay
  • Added sunburst center overlay showing sample counts
  • Fixed tooltip to show 'Samples' instead of 'Total Time'

- Update FRAME_COLOR constants with vibrant, high-contrast colors
- Update CSS theme variables for frame colors
- Add custom nanovis palette for Spotlight's dark theme
- Add overlay to fix sunburst center showing bytes instead of samples
- Fix tooltip to show sample counts properly
@vercel
Copy link

vercel bot commented Dec 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
spotlightjs Skipped Skipped Dec 12, 2025 8:12pm

@BYK BYK deployed to Preview December 12, 2025 14:56 — with GitHub Actions Active
@BYK BYK force-pushed the byk/fix/profile-visualization branch from 6804a76 to dbe49fc Compare December 12, 2025 16:56
@BYK BYK deployed to Preview December 12, 2025 16:56 — with GitHub Actions Active
@BYK BYK force-pushed the byk/fix/profile-visualization branch from dbe49fc to a29d5cb Compare December 12, 2025 19:01
@BYK BYK deployed to Preview December 12, 2025 19:01 — with GitHub Actions Active
@BYK BYK force-pushed the byk/fix/profile-visualization branch from a29d5cb to ba414b6 Compare December 12, 2025 19:04
@BYK BYK deployed to Preview December 12, 2025 19:05 — with GitHub Actions Active
@BYK BYK force-pushed the byk/fix/profile-visualization branch from ba414b6 to a9f647d Compare December 12, 2025 19:11
@BYK BYK deployed to Preview December 12, 2025 19:11 — with GitHub Actions Active
@BYK BYK force-pushed the byk/fix/profile-visualization branch from a9f647d to 87a68ca Compare December 12, 2025 19:14
@BYK BYK force-pushed the byk/fix/profile-visualization branch from 87a68ca to 779f122 Compare December 12, 2025 19:17
@BYK BYK changed the title fix(profiles): Fix visualization colors and sunburst display fix(profiles): Fix treemap and sunburst display issues Dec 12, 2025
@BYK BYK force-pushed the byk/fix/profile-visualization branch from a12fbdf to 3a9b844 Compare December 12, 2025 19:31
@BYK BYK deployed to Preview December 12, 2025 19:32 — with GitHub Actions Active
@BYK BYK force-pushed the byk/fix/profile-visualization branch from 3a9b844 to fe7f4c5 Compare December 12, 2025 19:51
@BYK BYK deployed to Preview December 12, 2025 19:52 — with GitHub Actions Active
@BYK BYK force-pushed the byk/fix/profile-visualization branch from fe7f4c5 to 0663bd6 Compare December 12, 2025 20:08
@BYK BYK deployed to Preview December 12, 2025 20:08 — with GitHub Actions Active
…ions

The nanovis library calls resize() in its constructor before the element
is appended to the DOM, resulting in 0 dimensions. Using ResizeObserver
ensures we call resize() only after the container has been laid out with
proper dimensions. This fixes the treemap being invisible on initial render.
@BYK BYK force-pushed the byk/fix/profile-visualization branch from 0663bd6 to 153fb21 Compare December 12, 2025 20:12
@BYK BYK deployed to Preview December 12, 2025 20:12 — with GitHub Actions Active
Copy link
Member

@betegon betegon left a comment

Choose a reason for hiding this comment

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

this looks good. i think we could benefit from moving some visualization code from TraceProfileTree.tsx if we add more visualization things, but we're good!

Comment on lines +81 to +88
palette: {
text: "#e0e7ff", // primary-100 for better visibility
fg: "#fff",
bg: "#1e1b4b", // primary-950
stroke: "#4338ca", // primary-700
fallback: "#9ca3af", // Gray-400 fallback
hover: "#ffffff33", // Semi-transparent white for hover
shadow: "#00000066", // Semi-transparent black for shadows
Copy link
Member

Choose a reason for hiding this comment

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

wonder if we should reuse these color fo other charts

@BYK BYK merged commit 99fd836 into main Dec 22, 2025
20 checks passed
@BYK BYK deleted the byk/fix/profile-visualization branch December 22, 2025 16:54
BYK pushed a commit that referenced this pull request Dec 23, 2025
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.


# Releases
## @spotlightjs/[email protected]

### Minor Changes

- Add support for continuous profiling (Profiling V2)
([#1202](#1202))

- Add self-documenting CLI commands with per-command help support
([#1206](#1206))

Each CLI command now provides its own metadata (short description,
usage, detailed help, and examples). The main help output is generated
dynamically from this metadata, and users can get detailed help for
specific commands via `spotlight help <command>` or `spotlight <command>
--help`.

### Patch Changes

- Remove dead code
([#1214](#1214))

- Fix profile visualization issues in trace views:
([#1203](#1203))

- Update frame colors to use vibrant, high-contrast colors for better
visibility
    -   Add custom nanovis palette for Spotlight's dark theme
    -   Fix sunburst center text showing bytes instead of sample counts
    -   Fix treemap visibility with proper color contrast

- added support for AI SDK v2 in AI Mode
([#1216](#1216))

- updated the empty pages of traces and envelopes
([#1213](#1213))

- open external links in default browser
([#1212](#1212))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants