
Setting | Type | Meaning |
|---|---|---|
GraphSeries::nodes | Vec<GraphNode> | Supplies identified and named nodes. |
GraphSeries::edges | Vec<GraphEdge> | Connects source IDs to target IDs. |
Chart::series | Vec<Series> | Adds the relationship series without Cartesian axes. |
use fission::charts::{Chart, GraphNode, GraphSeries};
use fission::charts::series::graph::GraphEdge;
let relationships = GraphSeries::new("Relationships")
.nodes(vec![
GraphNode {
id: "api".into(),
name: "API".into(),
value: 1.0,
},
GraphNode {
id: "search".into(),
name: "Search".into(),
value: 1.0,
},
GraphNode {
id: "billing".into(),
name: "Billing".into(),
value: 1.0,
},
])
.edges(vec![
GraphEdge {
source: "api".into(),
target: "search".into(),
},
GraphEdge {
source: "api".into(),
target: "billing".into(),
},
GraphEdge {
source: "search".into(),
target: "billing".into(),
},
]);
let chart = Chart::new()
.title("Relationships between product services")
.series(vec![relationships.into()]);
use fission::prelude::*;
use fission::charts::{Chart, GraphNode, GraphSeries};
use fission::charts::series::graph::GraphEdge;
// The parent resolves display labels from its translation bundles.
fission_component! {
pub CircularLikeGraphChart<()> {
props {
chart_title: String,
series_label: String,
nodes: Vec<GraphNode>,
edges: Vec<GraphEdge>,
}
}
view(graph, _state, _cx) =>
Chart(
title: Some(graph.chart_title.clone()),
series: vec![GraphSeries::new(&graph.series_label)
.nodes(graph.nodes.clone())
.edges(graph.edges.clone())
.into()],
)
}