diff --git a/bokeh/models/graphs.py b/bokeh/models/graphs.py
index <HASH>..<HASH> 100644
--- a/bokeh/models/graphs.py
+++ b/bokeh/models/graphs.py
@@ -53,9 +53,11 @@ def from_networkx(graph, layout_function, **kwargs):
         # inline import to prevent circular imports
         from ..models.renderers import GraphRenderer
         from ..models.graphs import StaticLayoutProvider
-
-        nodes = graph.nodes()
-        edges = graph.edges()
+        
+        # Handles nx 1.x vs 2.x data structure change
+        nodes = list(graph.nodes())
+        edges = list(graph.edges())
+    
         edges_start = [edge[0] for edge in edges]
         edges_end = [edge[1] for edge in edges]
Updated to handle networkx <I> Views (#<I>)

* Updated to handle networkx <I> Views



This is not backward compatible Views were added in nx <I>



* Added handling for nx 1.x and 2.x



* Changes to handling  for nx 1 and 2



Wrap graph nodes and edges in list for conversion to CDS(s)



* Handle nx <I> and <I>