Blocks for building graphs in vertigo.
See Changelog for recent features.
Dependencies:
vertigo = "0.11"
vertigo-graphs = "0.1"Example:
use vertigo::{Computed, DomNode, dom, main};
use vertigo_graphs::{Graph, GraphData};
#[main]
fn app() -> DomNode {
let data = GraphData {
label: Computed::from(|_| "Graph".to_string()),
scale_x: Computed::from(|_| 100.0),
scale_y: Computed::from(|_| 100.0),
points: Computed::from(|_| {
vec![
(0.0, 0.0),
(20.0, 30.0),
(40.0, 10.0),
(60.0, 50.0),
(80.0, 30.0),
(100.0, 70.0),
]
}),
};
dom! {
<html>
<head />
<body>
<Graph data={data} />
</body>
</html>
}
}Install vertigo-cli:
cargo install vertigo-cli
Build and run storybook in watch mode:
vertigo watch vertigo-graphs-storybook
Eventually terminal will let you know that app is available under http://localhost:4444/
If you want to play around with the code, the browser will automatically refresh after the project has been recompiled.