Skip to content

Commit

Permalink
renamed transform to helpers (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
blitzarx1 authored Sep 30, 2024
1 parent a790f45 commit 0602849
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use petgraph::{
};

use crate::draw::{DisplayEdge, DisplayNode};
use crate::{metadata::Metadata, transform, Edge, Node};
use crate::{DefaultEdgeShape, DefaultNodeShape};
use crate::{metadata::Metadata, Edge, Node};
use crate::{to_graph, DefaultEdgeShape, DefaultNodeShape};

type StableGraphType<N, E, Ty, Ix, Dn, De> =
StableGraph<Node<N, E, Ty, Ix, Dn>, Edge<N, E, Ty, Ix, Dn, De>, Ty, Ix>;
Expand Down Expand Up @@ -44,7 +44,7 @@ impl<
> From<&StableGraph<N, E, Ty, Ix>> for Graph<N, E, Ty, Ix, Dn, De>
{
fn from(g: &StableGraph<N, E, Ty, Ix>) -> Self {
transform::to_graph(g)
to_graph(g)
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/transform.rs → src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,14 @@ fn transform<

input.edge_indices().for_each(|input_e_idx| {
let (input_source_n_idx, input_target_n_idx) = input.edge_endpoints(input_e_idx).unwrap();
let user_e = input.edge_weight(input_e_idx).unwrap();
let input_e = input.edge_weight(input_e_idx).unwrap();

let input_source_n = *nidx_by_input_nidx.get(&input_source_n_idx).unwrap();
let input_target_n = *nidx_by_input_nidx.get(&input_target_n_idx).unwrap();

let order = g.edges_connecting(input_source_n, input_target_n).count();

let mut edge = Edge::new(user_e.clone());
let mut edge = Edge::new(input_e.clone());

edge.set_id(input_e_idx);
edge.set_order(order);
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@ mod draw;
mod elements;
mod graph;
mod graph_view;
mod helpers;
mod metadata;
mod settings;
mod transform;

pub use draw::{DefaultEdgeShape, DefaultNodeShape, DisplayEdge, DisplayNode, DrawContext};
pub use elements::{Edge, EdgeProps, Node, NodeProps};
pub use graph::Graph;
pub use graph_view::GraphView;
pub use metadata::Metadata;
pub use settings::{SettingsInteraction, SettingsNavigation, SettingsStyle};
pub use transform::{
pub use helpers::{
add_edge, add_edge_custom, add_node, add_node_custom, default_edge_transform,
default_node_transform, to_graph, to_graph_custom,
};
pub use metadata::Metadata;
pub use settings::{SettingsInteraction, SettingsNavigation, SettingsStyle};

#[cfg(feature = "events")]
pub mod events;

0 comments on commit 0602849

Please sign in to comment.