Skip to content
37 changes: 37 additions & 0 deletions src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,43 @@ impl PyGraph {
/// fd.flush()
/// graph = rx.PyGraph.read_edge_list(path=path)
/// mpl_draw(graph)
///
/// For example for csv based data, you may use the below code::
///
Comment on lines +1373 to +1374
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// For example for csv based data, you may use the below code::
///
/// For example for csv based data, you may use the below code:
///
/// .. jupyter-execute::
///
/// import rustworkx as rx
/// from rustworkx.visualization import mpl_draw
///
/// file="/tmp/123.txt"
///
/// with open(file,"w+") as fd:
Comment on lines +1375 to +1380
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// import rustworkx as rx
/// from rustworkx.visualization import mpl_draw
///
/// file="/tmp/123.txt"
///
/// with open(file,"w+") as fd:
/// import tempfile
///
/// import rustworkx as rx
/// from rustworkx.visualization import mpl_draw
///
/// with tempfile.NamedTemporaryFile('wt') as fd:
/// fd.write('0,1,1.5\n')
/// fd.write('0,2,0.5\n')
/// fd.write('0,3,1\n')
/// fd.write('1,2,1\n')
/// fd.write('2,3,2\n')
/// fd.flush()
///
/// graph = rx.PyGraph.read_edge_list(path=file, deliminator=",")
/// mpl_draw(graph)
///
///
/// For Labels Based Data::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// For Labels Based Data::
/// For Labels Based Data:
///
/// .. jupyter-execute::
///
///
/// import rustworkx as rx
/// from rustworkx.visualization import mpl_draw
///
/// file="/tmp/123.txt"
///
/// with open(file,"w+") as fd:
Comment on lines +1394 to +1399
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// import rustworkx as rx
/// from rustworkx.visualization import mpl_draw
///
/// file="/tmp/123.txt"
///
/// with open(file,"w+") as fd:
/// import tempfile
///
/// import rustworkx as rx
/// from rustworkx.visualization import mpl_draw
///
/// with tempfile.NamedTemporaryFile('wt') as fd:
/// fd.write('A,B,1.5\n')
/// fd.write('A,C,0.5\n')
/// fd.write('A,D,1\n')
/// fd.write('A,C,1\n')
/// fd.write('C,D,2\n')
/// fd.flush()
///
/// graph = rx.PyGraph.read_edge_list(path=file, deliminator=",", labels=True)
/// mpl_draw(graph)
///
#[staticmethod]
#[pyo3(signature=(path, comment=None, deliminator=None, labels=false), text_signature = "(path, /, comment=None, deliminator=None, labels=False)")]
Expand Down