AI Forecast Panel with Decision Tree
Tapping a weight chart's arrow opens a glass panel showing training stages, a loss curve, a decision tree and contribution bars, then a light beam runs along the forecast. HTML uses Canvas2D and SVG; React Native uses Skia and expo-blur.
export function Example() {
const progress = useSharedValue(0);
…
Agent prompt
Add the Now In Code component "ai-forecast-panel-with-decision-tree" to this project. The full source is attached at the end of this prompt. Put the files under components/ai-forecast-panel-with-decision-tree/, 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 ===
Details
- Platforms
- iOS, Android
- Requires
- Expo SDK 54+
- Access
- Pro
- Updated
- 10 Nov 2026
- License
- Unlimited commercial projects
- Original design
- RedNote
Are you the designer? Ask us to change or remove this.
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 health dashboard card with a gold weight chart and a fan of light beside an arrow that swings between two projected values. Tapping the arrow raises a floating frosted panel that walks through a model training run in stages: data preprocessing, feature engineering, training with a loss curve drawn point by point, cross-validation, building a tree ensemble, calibrating the prediction interval and inference. When it finishes, decision trees, feature contributions, a result of 64.0 kg and a written summary appear in turn and can be scrolled. The panel is flicked away, the estimate on the main card fades to the new value, a beam grows along the prediction line, flares and settles into a dashed line.
How it's built
A shared core turns time into a frame: panel position and dimming, header stage and percentage, the loss curve, tree nodes, contributions, the result and the scroll offset, plus drawing instructions for the glow. In React Native those instructions map to Skia elements with blur masks, dash effects, gradients and additive blending. The trees, loss chart and icons are react-native-svg, and the panel and tab bar glass are expo-blur views with a tint. Text baselines are aligned from measured ascenders after layout. The component takes props for autoplay, loop, a frozen time, speed and a finish callback. React Native cannot blur text, so the percentage roll uses movement and opacity only.
Good for
- Explaining an AI forecast or recommendation step by step inside a health or finance app
- Showing a model run, training progress or calculation as a staged panel
- Dashboard cards where a projected value should be shown with a glowing beam
Dependencies
@shopify/react-native-skiaexpo-blurreact-native-svgreact-native