cluster_sim.app package¶
- class cluster_sim.app.BrowserState(shape=(5, 5, 5), p_err=0.09, layout='Grid3D', seed=None, path_clicks=0, removed_nodes=<factory>, log='', camera_state=<factory>, offset=(0, 0, 0), plot_options=<factory>)¶
Bases:
objectThis class controls the default values when the app is loaded.
This class contains a local state of the web app, representing a persistent state on the user’s local browsing section.
- Parameters:
- classmethod from_json(json_str)¶
- to_json()¶
- xoffset = 0¶
- yoffset = 0¶
- zoffset = 0¶
- class cluster_sim.app.Grid3D(browser_state)¶
Bases:
object- Parameters:
browser_state (
BrowserState)
- get_node_coords(index, log=False)¶
Get node coordinates from the grid shape and index.
- Parameters:
index (
int)
- get_node_index(x, y, z)¶
Get the index from the coordinates.
- update_graph_with_layout(g)¶
Add the current layout to the PyGraph.
- Parameters:
g (
PyGraph) – PyGraph
- cluster_sim.app.grid_graph_3d(shape)¶
Generate a Grid graph in rustworkx
- cluster_sim.app.rx_graph_to_plot(graph, browser_state)¶
Convert a rustworkx object to a plotly object.
- Parameters:
graph (
PyGraph)browser_state (
BrowserState)
- Return type:
- cluster_sim.app.update_plot_cytoscape(browser_state, G)¶
Main function that updates the plot.
- Parameters:
browser_state (
BrowserState)G (
ClusterState)
- cluster_sim.app.update_plot_plotly(plot_data, browser_state)¶
Main function that updates the plot.
- Parameters:
plot_data (
list[Scatter3d])browser_state (
BrowserState)
Submodules¶
cluster_sim.app.layout module¶
- class cluster_sim.app.layout.Grid3D(browser_state)¶
Bases:
object- Parameters:
browser_state (
BrowserState)
- get_node_coords(index, log=False)¶
Get node coordinates from the grid shape and index.
- Parameters:
index (
int)
- get_node_index(x, y, z)¶
Get the index from the coordinates.
- update_graph_with_layout(g)¶
Add the current layout to the PyGraph.
- Parameters:
g (
PyGraph) – PyGraph
- cluster_sim.app.layout.rx_graph_to_plot(graph, browser_state)¶
Convert a rustworkx object to a plotly object.
- Parameters:
graph (
PyGraph)browser_state (
BrowserState)
- Return type:
- cluster_sim.app.layout.update_plot_cytoscape(browser_state, G)¶
Main function that updates the plot.
- Parameters:
browser_state (
BrowserState)G (
ClusterState)
- cluster_sim.app.layout.update_plot_from_simulator(G, browser_state)¶
- Parameters:
G (
ClusterState)browser_state (
BrowserState)
- Return type:
list[Scatter3d]
- cluster_sim.app.layout.update_plot_plotly(plot_data, browser_state)¶
Main function that updates the plot.
- Parameters:
plot_data (
list[Scatter3d])browser_state (
BrowserState)
cluster_sim.app.state module¶
- class cluster_sim.app.state.BrowserState(shape=(5, 5, 5), p_err=0.09, layout='Grid3D', seed=None, path_clicks=0, removed_nodes=<factory>, log='', camera_state=<factory>, offset=(0, 0, 0), plot_options=<factory>)¶
Bases:
objectThis class controls the default values when the app is loaded.
This class contains a local state of the web app, representing a persistent state on the user’s local browsing section.
- Parameters:
- classmethod from_json(json_str)¶
- to_json()¶
- xoffset = 0¶
- yoffset = 0¶
- zoffset = 0¶