Now In Code
Get access

Dot-Matrix Decay Chart with Draggable Points

A dark monospace tool plots body caffeine over 24 hours as 8 px dots. Dragging a cup on the axis recomputes the peak, bedtime level and last-cup time; tapping the chart adds or removes a cup. HTML and Skia share one display list.

Inspired by a design posted on RedNoteRebuilt from scratch by Now In Code

Agent prompt

Add the Now In Code component "dot-matrix-decay-chart-draggable-points" to this project.

The full source is attached at the end of this prompt. Put the files under components/dot-matrix-decay-chart-draggable-points/, install the listed dependencies with `npx expo install`, and render it on a route I can open.

Keep the timing and easing values documented in the source comments. Replace the sample copy and artwork with content from my app, or leave placeholders and list what I still need to supply.

=== Source files are attached here for paid plans ===
Pro piece. The prompt includes the full source.Get access

Details

Platforms
iOS, Android, Web
Requires
Expo SDK 54+
Access
Pro
Updated
14 Nov 2026
License
Unlimited commercial projects
Original design
RedNote

Are you the designer? Ask us to change or remove this.

CLI and MCP server Coming soon

Add pieces from the terminal or let your agent fetch them. Until then, Copy prompt does the same job. Docs

What it does

A dark, monospace card that charts how much caffeine is in the body over 24 hours, drawn as a field of small dots. Three cups start on a time axis. Dragging a cup along the axis changes when it was drunk, and the curve, the peak value and time, the amount still in the body at a bedtime marker, and a "last cup by" time all update live. Tapping empty chart space adds a cup and tapping a cup's column removes it. Pressing on the chart shows a time and milligram readout. Rising dots are large and bright, decaying dots small and gray, and the vertical scale rescales to fit the peak.

How it's built

An absorption and elimination model with a five-hour half-life sums the contribution of each cup. A shared JavaScript core turns the state into a flat display list of dots, rings, rectangles and text, several thousand items per frame. A thin adapter draws that list: Canvas2D in the HTML preview, and in React Native a Skia PictureRecorder replayed inside a Skia Canvas. Gestures use PanResponder, the vertical scale eases with exponential smoothing, and a bundled mono font loads through useFont. No charting library is involved.

Good for

  • Caffeine, sleep or medication apps where users move dose times and see the effect
  • Any "drag an event on a timeline and watch the cumulative result" dashboard
  • Dot-matrix styled stat cards in health or analytics screens

Dependencies

@shopify/react-native-skiareact-native

Tags

Data and AnalyticsChartCursor FollowDark ModeData FillDragHealth and FitnessMinimalPixel RetroState Transition

Related