Skip to content

Experiment/canvas chart prototype#1184

Closed
TheMasterOfDisasters wants to merge 9 commits into
GyulyVGC:mainfrom
TheMasterOfDisasters:experiment/canvas-chart-prototype
Closed

Experiment/canvas chart prototype#1184
TheMasterOfDisasters wants to merge 9 commits into
GyulyVGC:mainfrom
TheMasterOfDisasters:experiment/canvas-chart-prototype

Conversation

@TheMasterOfDisasters
Copy link
Copy Markdown
Contributor

Summary

This PR improves chart compatibility with Sniffnet's tiny-skia software renderer fallback while preserving the existing default-renderer behavior.

The Overview traffic chart now uses a renderer-compatible Iced geometry widget with hover support. This avoids relying on plotters-iced2 for the interactive Overview chart path and keeps rendering inside Iced's selected renderer.

For the initial adapter page, the default renderer keeps the existing plotters preview charts. Under ICED_BACKEND=tiny-skia, adapter preview charts are replaced with lightweight incoming/outgoing packet-rate indicators. This avoids the tiny-skia geometry/clipping artifacts found when rendering chart geometry inside scrollable adapter cards.

Why

The original goal was to prototype an interactive chart replacement without making Sniffnet more dependent on GPU-only rendering.

During testing, the Overview chart worked correctly with both the default renderer and tiny-skia after switching to an Iced-native geometry widget.

Adapter preview charts exposed a separate tiny-skia issue: chart geometry inside the scrollable adapter list could render, but its clipping/damage tracking did not consistently follow scrolling or page changes. Multiple geometry and Canvas approaches were tested, but the reliable tiny-skia-compatible solution was to avoid chart geometry in that scrollable list.

Changes

  • Added a renderer-compatible Overview line chart widget.
  • Added hover detection and tooltip-style value display for Overview traffic points.
  • Kept the existing plotters preview charts for the default renderer.
  • Added a tiny-skia-specific adapter preview fallback using lightweight text indicators.
  • Extended traffic preview data to track incoming and outgoing packet counts separately.
  • Removed the experimental adapter Canvas preview chart after validating it was not reliable under tiny-skia in scrollable content.
  • Kept packet capture behavior unchanged for normal capture flows.

Testing

  • cargo fmt
  • cargo check
  • cargo test
  • cargo build --release
  • Manual test with default renderer
  • Manual test with ICED_BACKEND=tiny-skia

@TheMasterOfDisasters TheMasterOfDisasters marked this pull request as draft May 10, 2026 04:52
@TheMasterOfDisasters
Copy link
Copy Markdown
Contributor Author

Hi @GyulyVGC , I opened the PR as a draft for now because it partially addresses #1042 and became broader than expected during implementation.

The initial goal was to prototype an interactive replacement for the Overview line-series chart, since the current plotters-iced path is a blocker for hover-based chart interactions. This PR moves the Overview traffic chart to a custom Iced-native widget and adds hover support for per-tick incoming/outgoing values.

While working on it, I ran into renderer compatibility issues with tiny-skia, so the PR also includes changes to keep the new chart path compatible with Sniffnet’s software renderer fallback. In particular, the adapter preview charts stay on the existing default-renderer path, while ICED_BACKEND=tiny-skia uses lightweight packet-rate indicators to avoid scrollable chart geometry artifacts.

I don’t think this fully closes #1042 yet. It should give us the foundation for future improvements that would close it, especially adding donut segment hover and richer line-chart hover details such as involved hosts, services, and notifications for each point in time.

I’m keeping it in draft until I do more manual testing and add screenshots before requesting review.

@GyulyVGC
Copy link
Copy Markdown
Owner

Hey @TheMasterOfDisasters thanks for your time implementing this, but I prefer not moving forward with this feature for two reasons:

  • iced is replacing tiny-skia with vello_cpu
  • I already have plans to improve charts using iced_aksel with the help of @mahlquistj

In general, if you are planning to do considerable changes to the codebase, I suggest you to verify that the related GitHub issue isn't assigned to someone yet.

You can also check issues with the help wanted Extra attention is needed label to see what I'd love help with.

@GyulyVGC GyulyVGC closed this May 10, 2026
@GyulyVGC GyulyVGC added the wontfix This will not be worked on label May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants