Files
Ely-GPUI-Components/examples/gallery/pages/finance/mod.rs
T
ZacharyZhang-NY 48c7b09d8d T44d Web · Gallery builds for wasm32: one story per section by URL, themed by the host
The gallery's entry runs natively or, on wasm32, from a wasm_bindgen start
through gpui_web, single-threaded with WebGL2 fallback. ?page, ?story and
?theme choose what shows; an unknown one fails in the page and the log.
set_theme switches the mode later. Pictures load from ELY_GALLERY_ASSETS.
scripts/stories.py writes examples/gallery/stories.json from the pages.
2026-09-29 19:16:41 -04:00

75 lines
2.1 KiB
Rust

mod assets;
mod book;
mod markets;
mod overview;
mod trading;
use gpui::{AnyElement, App, IntoElement, ParentElement, Window, div};
use super::Page;
use crate::step::Step;
pub const PAGE: Page = Page {
number: 16,
slug: "finance",
title: "Finance",
summary: "Market charts with the studies traders read, books, quotes, order entry and portfolios.",
render,
script: SCRIPT,
};
const SCRIPT: &[Step] = &[
Step::Rest,
Step::HoverAt("market", 520.0, 160.0),
Step::Wait(300),
Step::Shot("crosshair"),
Step::DownAt("drawings", 240.0, 210.0),
Step::DragTo("drawings", 620.0, 90.0),
Step::UpAt("drawings", 620.0, 90.0),
Step::Wait(300),
Step::Shot("drawn"),
Step::HoverAt("depth", 300.0, 150.0),
Step::Wait(300),
Step::Shot("depth"),
Step::HoverAt("payoff", 560.0, 120.0),
Step::Wait(300),
Step::Shot("payoff"),
Step::HoverAt("heatmap", 150.0, 150.0),
Step::Wait(300),
Step::Shot("heatmap"),
Step::DownAt("ticket", 170.0, 256.0),
Step::UpAt("ticket", 170.0, 256.0),
Step::Wait(400),
Step::Shot("confirm"),
Step::Key("escape"),
Step::Wait(300),
Step::Rest,
];
fn render(window: &mut Window, cx: &mut App) -> AnyElement {
div()
.child(markets::market(window, cx))
.child(markets::indicators(window, cx))
.child(markets::drawings(window, cx))
.child(markets::depth(cx))
.child(markets::profile(cx))
.child(markets::bricks(cx))
.child(markets::together(window, cx))
.child(book::quotes(cx))
.child(book::book(cx))
.child(book::tape(window, cx))
.child(trading::ticket(window, cx))
.child(trading::blotter(cx))
.child(trading::risk(window, cx))
.child(trading::options(window, cx))
.child(overview::watch(window, cx))
.child(overview::heatmap(cx))
.child(overview::screener(window, cx))
.child(overview::overview(cx))
.child(overview::calendars(window, cx))
.child(assets::portfolio(cx))
.child(assets::statements(cx))
.child(assets::money(window, cx))
.into_any_element()
}