Created
July 16, 2015 17:54
-
-
Save tonyfast/635714a234703d187452 to your computer and use it in GitHub Desktop.
Bokeh Plotting with NetworkX http://nbviewer.ipython.org/gist/tonyfast/635714a234703d187452
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# NetworkX" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"> This notebook as been adapted from the [original notebook](https://github.com/jdwittenauer/ipython-notebooks/blob/master/NetworkX.ipynb) to plot with [Bokeh](bokeh.pydata.org) instead of matplotlib.\n", | |
"\n", | |
"NetworkX is a Python language software package for the creation, manipulation, and study of the structure, dynamics, and function of complex networks.\n", | |
"\n", | |
"With NetworkX you can load and store networks in standard and nonstandard data formats, generate many types of random and classic networks, analyze network structure, build network models, design new network algorithms, draw networks, and much more.\n", | |
"\n", | |
"Library documentation: <a>https://networkx.github.io/</a>" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"import networkx as nx\n", | |
"G = nx.Graph()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"# basic add nodes\n", | |
"G.add_node(1)\n", | |
"G.add_nodes_from([2, 3])" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 3, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"# add a group of nodes at once\n", | |
"H = nx.path_graph(10)\n", | |
"G.add_nodes_from(H)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 4, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"# add another graph itself as a node\n", | |
"G.add_node(H)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 5, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"# add edges using similar methods\n", | |
"G.add_edge(1, 2)\n", | |
"e = (2, 3)\n", | |
"G.add_edge(*e)\n", | |
"G.add_edges_from([(1, 2), (1, 3)])\n", | |
"G.add_edges_from(H.edges())" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 6, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"# can also remove or clear\n", | |
"G.remove_node(H)\n", | |
"G.clear()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 7, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"# repeats are ignored\n", | |
"G.add_edges_from([(1,2),(1,3)])\n", | |
"G.add_node(1)\n", | |
"G.add_edge(1,2)\n", | |
"G.add_node('spam') # adds node \"spam\"\n", | |
"G.add_nodes_from('spam') # adds 4 nodes: 's', 'p', 'a', 'm'" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 8, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"(8, 2)" | |
] | |
}, | |
"execution_count": 8, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# get the number of nodes and edges\n", | |
"G.number_of_nodes(), G.number_of_edges()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 9, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"{2: {}, 3: {}}" | |
] | |
}, | |
"execution_count": 9, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# access graph edges\n", | |
"G[1]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 10, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"{}" | |
] | |
}, | |
"execution_count": 10, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"G[1][2]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 11, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"# set an attribute of an edge\n", | |
"G.add_edge(1,3)\n", | |
"G[1][3]['color'] = 'blue'" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 12, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"(1, 2, 0.125)\n", | |
"(2, 1, 0.125)\n", | |
"(3, 4, 0.375)\n", | |
"(4, 3, 0.375)\n" | |
] | |
} | |
], | |
"source": [ | |
"FG = nx.Graph()\n", | |
"FG.add_weighted_edges_from([(1, 2, 0.125), (1, 3, 0.75), (2, 4, 1.2), (3, 4, 0.375)])\n", | |
"for n, nbrs in FG.adjacency_iter():\n", | |
" for nbr, eattr in nbrs.items():\n", | |
" data = eattr['weight']\n", | |
" if data < 0.5: print('(%d, %d, %.3f)' % (n, nbr, data))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 13, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"{'day': 'Friday'}" | |
] | |
}, | |
"execution_count": 13, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# graph attribte\n", | |
"G = nx.Graph(day='Friday')\n", | |
"G.graph" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 14, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"{'day': 'Monday'}" | |
] | |
}, | |
"execution_count": 14, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# modifying an attribute\n", | |
"G.graph['day'] = 'Monday'\n", | |
"G.graph" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 15, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"[(1, {'room': 714, 'time': '5pm'}), (3, {'time': '2pm'})]" | |
] | |
}, | |
"execution_count": 15, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# node attributes\n", | |
"G.add_node(1, time='5pm')\n", | |
"G.add_nodes_from([3], time='2pm')\n", | |
"G.node[1]['room'] = 714\n", | |
"G.nodes(data=True)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 16, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"# edge attributes (weight is a special numeric attribute)\n", | |
"G.add_edge(1, 2, weight=4.7)\n", | |
"G.add_edges_from([(3, 4), (4, 5)], color='red')\n", | |
"G.add_edges_from([(1, 2 ,{'color': 'blue'}), (2, 3, {'weight' :8})])\n", | |
"G[1][2]['weight'] = 4.7\n", | |
"G.edge[1][2]['weight'] = 4" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 17, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"0.5" | |
] | |
}, | |
"execution_count": 17, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# directed graph\n", | |
"DG = nx.DiGraph()\n", | |
"DG.add_weighted_edges_from([(1, 2 ,0.5), (3, 1, 0.75)])\n", | |
"DG.out_degree(1, weight='weight')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 18, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"1.25" | |
] | |
}, | |
"execution_count": 18, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"DG.degree(1, weight='weight')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 19, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"[2]" | |
] | |
}, | |
"execution_count": 19, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"DG.successors(1)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 20, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"[3]" | |
] | |
}, | |
"execution_count": 20, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"DG.predecessors(1)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 21, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [], | |
"source": [ | |
"# convert to undirected graph\n", | |
"H = nx.Graph(G)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 22, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
" \n", | |
" <link rel=\"stylesheet\" href=\"http://cdn.pydata.org/bokeh/release/bokeh-0.9.1.min.css\" type=\"text/css\" />\n", | |
" <script type=\"text/javascript\" src=\"http://cdn.pydata.org/bokeh/release/bokeh-0.9.1.min.js\"></script>\n", | |
" <script type=\"text/javascript\">\n", | |
" Bokeh.set_log_level(\"info\");\n", | |
" </script>\n", | |
" <div>\n", | |
" <a href=\"http://bokeh.pydata.org\" target=\"_blank\" class=\"bk-logo bk-logo-small bk-logo-notebook\"></a>\n", | |
" <span>BokehJS successfully loaded.</span>\n", | |
" </div>" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"from bokeh.plotting import figure, show\n", | |
"from bokeh.resources import CDN\n", | |
"from bokeh.io import output_notebook\n", | |
"output_notebook( resources=CDN )" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Explore NetworkX Graph Layouts\n", | |
"\n", | |
"There are a few [layouts available in NetworkX graphs.](https://networkx.github.io/documentation/latest/reference/generated/networkx.drawing.layout.circular_layout.html)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Circular Layout" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 23, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<script type=\"text/javascript\">\n", | |
" Bokeh.$(function() {\n", | |
" var all_models = [{\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"e7b9b263-232b-4313-b036-54e466da8273\", \"type\": \"ColumnDataSource\"}, \"id\": \"c1a13822-6c0b-480e-bd8b-0a805915be8a\", \"glyph\": {\"id\": \"ec4d22d8-1197-446a-b98f-cd99dc86bb58\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"519b54bb-2166-4a0d-b04e-b5441c9f1051\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"c1a13822-6c0b-480e-bd8b-0a805915be8a\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"405a5308-bb66-4ea7-88ac-d89544066cfc\", \"type\": \"ColumnDataSource\"}, \"id\": \"ec1284c4-816d-4244-8a20-0471beb1d364\", \"glyph\": {\"id\": \"b741ff97-7ba4-4af3-a11b-a350d9e517ed\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"8f698fff-6470-4ea7-85f9-c650f0ff7708\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"ec1284c4-816d-4244-8a20-0471beb1d364\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"6e46994b-83f6-41e8-ac39-d9d8a245b53f\", \"data\": {\"x\": [0.9510565996170044], \"y\": [0.5]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"6e46994b-83f6-41e8-ac39-d9d8a245b53f\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"c88498c2-29a2-4ccc-a4e5-03f6cc2dfa18\", \"tags\": []}, \"id\": \"c88498c2-29a2-4ccc-a4e5-03f6cc2dfa18\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"f2d22c9b-0d1d-4a41-a9f3-66c660d9eece\", \"tags\": []}, \"id\": \"f2d22c9b-0d1d-4a41-a9f3-66c660d9eece\", \"type\": \"Circle\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"6e46994b-83f6-41e8-ac39-d9d8a245b53f\", \"type\": \"ColumnDataSource\"}, \"id\": \"04ffb652-4901-4a5d-8715-c341ece33110\", \"glyph\": {\"id\": \"a290ed6d-4491-406f-82b9-52c75b620bf7\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"e0a5c035-33c6-4139-91f2-09c065edba00\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"04ffb652-4901-4a5d-8715-c341ece33110\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"75d7f5f9-f337-42eb-8ad0-6dcbecc831de\", \"tags\": []}, \"id\": \"75d7f5f9-f337-42eb-8ad0-6dcbecc831de\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"8f698fff-6470-4ea7-85f9-c650f0ff7708\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"8f698fff-6470-4ea7-85f9-c650f0ff7708\", \"type\": \"Line\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"d5a571ec-20c0-452c-ab1d-e26557dbafb3\", \"type\": \"Plot\"}, \"id\": \"d961cfbf-015f-4bae-b6a3-ef28e54e8f78\", \"tags\": []}, \"id\": \"d961cfbf-015f-4bae-b6a3-ef28e54e8f78\", \"type\": \"HelpTool\"}, {\"attributes\": {\"doc\": null, \"id\": \"aa61b3e2-968e-49ae-aaef-f9267bde1c50\", \"geometries\": [], \"tags\": []}, \"id\": \"aa61b3e2-968e-49ae-aaef-f9267bde1c50\", \"type\": \"ToolEvents\"}, {\"attributes\": {\"start\": -0.1, \"callback\": null, \"id\": \"09220e88-9236-41b0-83fe-0a3c401aec55\", \"doc\": null, \"tags\": [], \"end\": 1.1}, \"id\": \"09220e88-9236-41b0-83fe-0a3c401aec55\", \"type\": \"Range1d\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"bfa87761-babb-4dda-891d-407b706e538d\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"bfa87761-babb-4dda-891d-407b706e538d\", \"type\": \"Line\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"519b54bb-2166-4a0d-b04e-b5441c9f1051\", \"tags\": []}, \"id\": \"519b54bb-2166-4a0d-b04e-b5441c9f1051\", \"type\": \"Circle\"}, {\"attributes\": {\"doc\": null, \"plot_width\": 400, \"extra_x_ranges\": {}, \"id\": \"d5a571ec-20c0-452c-ab1d-e26557dbafb3\", \"right\": [], \"above\": [], \"left\": [{\"id\": \"a44b4dbd-8cdf-46fb-8e9b-2d9eb68476de\", \"type\": \"LinearAxis\"}], \"plot_height\": 400, \"x_range\": {\"id\": \"09220e88-9236-41b0-83fe-0a3c401aec55\", \"type\": \"Range1d\"}, \"y_range\": {\"id\": \"f6031504-2385-484a-8b4b-e8f5f3604c79\", \"type\": \"Range1d\"}, \"tool_events\": {\"id\": \"aa61b3e2-968e-49ae-aaef-f9267bde1c50\", \"type\": \"ToolEvents\"}, \"renderers\": [{\"id\": \"ad31a542-f378-4a46-b428-cb2f7d706421\", \"type\": \"LinearAxis\"}, {\"id\": \"603e737a-e5e1-4f16-9f15-3871e3e60006\", \"type\": \"Grid\"}, {\"id\": \"a44b4dbd-8cdf-46fb-8e9b-2d9eb68476de\", \"type\": \"LinearAxis\"}, {\"id\": \"e933aa5c-04d8-452f-8198-9e5948aa52aa\", \"type\": \"Grid\"}, {\"id\": \"ec1284c4-816d-4244-8a20-0471beb1d364\", \"type\": \"GlyphRenderer\"}, {\"id\": \"df4fe983-b979-4767-bec9-5b24bf71e815\", \"type\": \"GlyphRenderer\"}, {\"id\": \"afcd3848-d699-4b94-a253-3f6f74e95755\", \"type\": \"GlyphRenderer\"}, {\"id\": \"c4cf19f7-2c1d-456c-8286-07b508290102\", \"type\": \"GlyphRenderer\"}, {\"id\": \"04ffb652-4901-4a5d-8715-c341ece33110\", \"type\": \"GlyphRenderer\"}, {\"id\": \"805fc09b-cdaa-43a7-93e7-38308db31e5f\", \"type\": \"GlyphRenderer\"}, {\"id\": \"39a235bf-3492-44fa-bcef-5c9dcf965051\", \"type\": \"GlyphRenderer\"}, {\"id\": \"c1a13822-6c0b-480e-bd8b-0a805915be8a\", \"type\": \"GlyphRenderer\"}, {\"id\": \"621ee406-4d5f-4599-add9-8af68fe5b80d\", \"type\": \"GlyphRenderer\"}], \"extra_y_ranges\": {}, \"below\": [{\"id\": \"ad31a542-f378-4a46-b428-cb2f7d706421\", \"type\": \"LinearAxis\"}], \"tags\": [], \"tools\": [{\"id\": \"7248f56d-fa61-43ad-bd0d-f26b807d469d\", \"type\": \"PanTool\"}, {\"id\": \"72311b24-efef-47e3-9aa0-48850732e38a\", \"type\": \"WheelZoomTool\"}, {\"id\": \"ec65efb3-7900-48d9-b33e-63326bff451c\", \"type\": \"BoxZoomTool\"}, {\"id\": \"1da867e4-55e6-414c-a0cd-8f3da0f9dc1e\", \"type\": \"PreviewSaveTool\"}, {\"id\": \"7e075798-0aaa-4bb8-8057-0e2357a7b3b9\", \"type\": \"ResizeTool\"}, {\"id\": \"036383fd-230d-4175-9ee8-6f6f6513d7c5\", \"type\": \"ResetTool\"}, {\"id\": \"d961cfbf-015f-4bae-b6a3-ef28e54e8f78\", \"type\": \"HelpTool\"}]}, \"subtype\": \"Figure\", \"id\": \"d5a571ec-20c0-452c-ab1d-e26557dbafb3\", \"type\": \"Plot\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"ec4d22d8-1197-446a-b98f-cd99dc86bb58\", \"tags\": []}, \"id\": \"ec4d22d8-1197-446a-b98f-cd99dc86bb58\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"b741ff97-7ba4-4af3-a11b-a350d9e517ed\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"b741ff97-7ba4-4af3-a11b-a350d9e517ed\", \"type\": \"Line\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"95652dad-4319-4023-833b-3f0759019cae\", \"type\": \"ColumnDataSource\"}, \"id\": \"39a235bf-3492-44fa-bcef-5c9dcf965051\", \"glyph\": {\"id\": \"6dff28e9-970c-497f-a79d-fb286036a65a\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"d451d970-545c-4173-9171-7f427b82f5d4\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"39a235bf-3492-44fa-bcef-5c9dcf965051\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"d451d970-545c-4173-9171-7f427b82f5d4\", \"tags\": []}, \"id\": \"d451d970-545c-4173-9171-7f427b82f5d4\", \"type\": \"Circle\"}, {\"attributes\": {\"start\": -0.1, \"callback\": null, \"id\": \"f6031504-2385-484a-8b4b-e8f5f3604c79\", \"doc\": null, \"tags\": [], \"end\": 1.1}, \"id\": \"f6031504-2385-484a-8b4b-e8f5f3604c79\", \"type\": \"Range1d\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"a7f6c736-e8f5-4e87-be8c-d77b7f57f32d\", \"type\": \"ColumnDataSource\"}, \"id\": \"805fc09b-cdaa-43a7-93e7-38308db31e5f\", \"glyph\": {\"id\": \"75d7f5f9-f337-42eb-8ad0-6dcbecc831de\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"0a2bf01e-efc3-461a-8858-061de5aac626\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"805fc09b-cdaa-43a7-93e7-38308db31e5f\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"tags\": [], \"id\": \"8bb66ac0-b683-4ad0-88c5-da10e010c299\"}, \"id\": \"8bb66ac0-b683-4ad0-88c5-da10e010c299\", \"type\": \"BasicTickFormatter\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"d5a571ec-20c0-452c-ab1d-e26557dbafb3\", \"type\": \"Plot\"}, \"id\": \"7248f56d-fa61-43ad-bd0d-f26b807d469d\", \"dimensions\": [\"width\", \"height\"], \"tags\": []}, \"id\": \"7248f56d-fa61-43ad-bd0d-f26b807d469d\", \"type\": \"PanTool\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"2e8d4a24-dfb0-4580-b1cb-80197ab12b78\", \"data\": {\"x\": [0.5877853035926819, 0.0], \"y\": [1.0, 0.80901700258255]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"2e8d4a24-dfb0-4580-b1cb-80197ab12b78\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"405a5308-bb66-4ea7-88ac-d89544066cfc\", \"data\": {\"x\": [0.9510565996170044, 0.5877853035926819], \"y\": [0.5, 1.0]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"405a5308-bb66-4ea7-88ac-d89544066cfc\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"c71698b5-413d-496b-8504-b4f474ae5247\", \"type\": \"ColumnDataSource\"}, \"id\": \"afcd3848-d699-4b94-a253-3f6f74e95755\", \"glyph\": {\"id\": \"ae929c0f-0cc6-48f6-8c6a-71765654bc59\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"a22464f0-430a-4347-9398-ec8688aee317\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"afcd3848-d699-4b94-a253-3f6f74e95755\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"e0a5c035-33c6-4139-91f2-09c065edba00\", \"tags\": []}, \"id\": \"e0a5c035-33c6-4139-91f2-09c065edba00\", \"type\": \"Circle\"}, {\"attributes\": {\"ticker\": {\"id\": \"87b9f337-712d-449c-90d0-4566926bb8b0\", \"type\": \"BasicTicker\"}, \"id\": \"ad31a542-f378-4a46-b428-cb2f7d706421\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"d5a571ec-20c0-452c-ab1d-e26557dbafb3\", \"type\": \"Plot\"}, \"doc\": null, \"formatter\": {\"id\": \"3b3256e3-c771-4a19-a90f-59bb94c3bdad\", \"type\": \"BasicTickFormatter\"}, \"tags\": []}, \"id\": \"ad31a542-f378-4a46-b428-cb2f7d706421\", \"type\": \"LinearAxis\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"d5a571ec-20c0-452c-ab1d-e26557dbafb3\", \"type\": \"Plot\"}, \"id\": \"036383fd-230d-4175-9ee8-6f6f6513d7c5\", \"tags\": []}, \"id\": \"036383fd-230d-4175-9ee8-6f6f6513d7c5\", \"type\": \"ResetTool\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"6dff28e9-970c-497f-a79d-fb286036a65a\", \"tags\": []}, \"id\": \"6dff28e9-970c-497f-a79d-fb286036a65a\", \"type\": \"Circle\"}, {\"attributes\": {\"num_minor_ticks\": 5, \"doc\": null, \"id\": \"87b9f337-712d-449c-90d0-4566926bb8b0\", \"tags\": [], \"mantissas\": [2, 5, 10]}, \"id\": \"87b9f337-712d-449c-90d0-4566926bb8b0\", \"type\": \"BasicTicker\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"95652dad-4319-4023-833b-3f0759019cae\", \"data\": {\"x\": [0.0], \"y\": [0.80901700258255]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"95652dad-4319-4023-833b-3f0759019cae\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"4166f382-9e1b-4e77-8575-2ff1735d44af\", \"type\": \"ColumnDataSource\"}, \"id\": \"621ee406-4d5f-4599-add9-8af68fe5b80d\", \"glyph\": {\"id\": \"c88498c2-29a2-4ccc-a4e5-03f6cc2dfa18\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"f2d22c9b-0d1d-4a41-a9f3-66c660d9eece\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"621ee406-4d5f-4599-add9-8af68fe5b80d\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"d5a571ec-20c0-452c-ab1d-e26557dbafb3\", \"type\": \"Plot\"}, \"id\": \"7e075798-0aaa-4bb8-8057-0e2357a7b3b9\", \"tags\": []}, \"id\": \"7e075798-0aaa-4bb8-8057-0e2357a7b3b9\", \"type\": \"ResizeTool\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"35c17abe-d517-432f-9d6b-f28fbe2cb090\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"35c17abe-d517-432f-9d6b-f28fbe2cb090\", \"type\": \"Line\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"634d207a-0dc5-4964-9241-3b3a37063776\", \"type\": \"ColumnDataSource\"}, \"id\": \"c4cf19f7-2c1d-456c-8286-07b508290102\", \"glyph\": {\"id\": \"bfa87761-babb-4dda-891d-407b706e538d\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"0ce74cc6-7cfb-41ab-8f70-99c7165eed55\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"c4cf19f7-2c1d-456c-8286-07b508290102\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"dimension\": 0, \"ticker\": {\"id\": \"87b9f337-712d-449c-90d0-4566926bb8b0\", \"type\": \"BasicTicker\"}, \"id\": \"603e737a-e5e1-4f16-9f15-3871e3e60006\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"d5a571ec-20c0-452c-ab1d-e26557dbafb3\", \"type\": \"Plot\"}, \"doc\": null, \"tags\": []}, \"id\": \"603e737a-e5e1-4f16-9f15-3871e3e60006\", \"type\": \"Grid\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"4166f382-9e1b-4e77-8575-2ff1735d44af\", \"data\": {\"x\": [0.5877853631973267], \"y\": [0.0]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"4166f382-9e1b-4e77-8575-2ff1735d44af\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"c71698b5-413d-496b-8504-b4f474ae5247\", \"data\": {\"x\": [0.0, 6.26720364493849e-08], \"y\": [0.80901700258255, 0.19098293781280518]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"c71698b5-413d-496b-8504-b4f474ae5247\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"tags\": [], \"id\": \"3b3256e3-c771-4a19-a90f-59bb94c3bdad\"}, \"id\": \"3b3256e3-c771-4a19-a90f-59bb94c3bdad\", \"type\": \"BasicTickFormatter\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"a22464f0-430a-4347-9398-ec8688aee317\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"a22464f0-430a-4347-9398-ec8688aee317\", \"type\": \"Line\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"db732f51-98dc-4c3a-8d50-9753bf976403\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"db732f51-98dc-4c3a-8d50-9753bf976403\", \"type\": \"Line\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"ae929c0f-0cc6-48f6-8c6a-71765654bc59\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"ae929c0f-0cc6-48f6-8c6a-71765654bc59\", \"type\": \"Line\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"a7f6c736-e8f5-4e87-be8c-d77b7f57f32d\", \"data\": {\"x\": [0.5877853035926819], \"y\": [1.0]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"a7f6c736-e8f5-4e87-be8c-d77b7f57f32d\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"2e8d4a24-dfb0-4580-b1cb-80197ab12b78\", \"type\": \"ColumnDataSource\"}, \"id\": \"df4fe983-b979-4767-bec9-5b24bf71e815\", \"glyph\": {\"id\": \"db732f51-98dc-4c3a-8d50-9753bf976403\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"35c17abe-d517-432f-9d6b-f28fbe2cb090\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"df4fe983-b979-4767-bec9-5b24bf71e815\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"d5a571ec-20c0-452c-ab1d-e26557dbafb3\", \"type\": \"Plot\"}, \"id\": \"72311b24-efef-47e3-9aa0-48850732e38a\", \"dimensions\": [\"width\", \"height\"], \"tags\": []}, \"id\": \"72311b24-efef-47e3-9aa0-48850732e38a\", \"type\": \"WheelZoomTool\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"d5a571ec-20c0-452c-ab1d-e26557dbafb3\", \"type\": \"Plot\"}, \"id\": \"1da867e4-55e6-414c-a0cd-8f3da0f9dc1e\", \"tags\": []}, \"id\": \"1da867e4-55e6-414c-a0cd-8f3da0f9dc1e\", \"type\": \"PreviewSaveTool\"}, {\"attributes\": {\"dimension\": 1, \"ticker\": {\"id\": \"e7873066-6d0b-44c1-8515-3ab5356a6393\", \"type\": \"BasicTicker\"}, \"id\": \"e933aa5c-04d8-452f-8198-9e5948aa52aa\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"d5a571ec-20c0-452c-ab1d-e26557dbafb3\", \"type\": \"Plot\"}, \"doc\": null, \"tags\": []}, \"id\": \"e933aa5c-04d8-452f-8198-9e5948aa52aa\", \"type\": \"Grid\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"0ce74cc6-7cfb-41ab-8f70-99c7165eed55\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"0ce74cc6-7cfb-41ab-8f70-99c7165eed55\", \"type\": \"Line\"}, {\"attributes\": {\"ticker\": {\"id\": \"e7873066-6d0b-44c1-8515-3ab5356a6393\", \"type\": \"BasicTicker\"}, \"id\": \"a44b4dbd-8cdf-46fb-8e9b-2d9eb68476de\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"d5a571ec-20c0-452c-ab1d-e26557dbafb3\", \"type\": \"Plot\"}, \"doc\": null, \"formatter\": {\"id\": \"8bb66ac0-b683-4ad0-88c5-da10e010c299\", \"type\": \"BasicTickFormatter\"}, \"tags\": []}, \"id\": \"a44b4dbd-8cdf-46fb-8e9b-2d9eb68476de\", \"type\": \"LinearAxis\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"634d207a-0dc5-4964-9241-3b3a37063776\", \"data\": {\"x\": [6.26720364493849e-08, 0.5877853631973267], \"y\": [0.19098293781280518, 0.0]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"634d207a-0dc5-4964-9241-3b3a37063776\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"d5a571ec-20c0-452c-ab1d-e26557dbafb3\", \"type\": \"Plot\"}, \"id\": \"ec65efb3-7900-48d9-b33e-63326bff451c\", \"dimensions\": [\"width\", \"height\"], \"tags\": []}, \"id\": \"ec65efb3-7900-48d9-b33e-63326bff451c\", \"type\": \"BoxZoomTool\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"e7b9b263-232b-4313-b036-54e466da8273\", \"data\": {\"x\": [6.26720364493849e-08], \"y\": [0.19098293781280518]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"e7b9b263-232b-4313-b036-54e466da8273\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"0a2bf01e-efc3-461a-8858-061de5aac626\", \"tags\": []}, \"id\": \"0a2bf01e-efc3-461a-8858-061de5aac626\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"a290ed6d-4491-406f-82b9-52c75b620bf7\", \"tags\": []}, \"id\": \"a290ed6d-4491-406f-82b9-52c75b620bf7\", \"type\": \"Circle\"}, {\"attributes\": {\"num_minor_ticks\": 5, \"doc\": null, \"id\": \"e7873066-6d0b-44c1-8515-3ab5356a6393\", \"tags\": [], \"mantissas\": [2, 5, 10]}, \"id\": \"e7873066-6d0b-44c1-8515-3ab5356a6393\", \"type\": \"BasicTicker\"}];\n", | |
" Bokeh.load_models(all_models);\n", | |
" var plots = [{'modelid': 'd5a571ec-20c0-452c-ab1d-e26557dbafb3', 'elementid': '#99616fc1-537e-45f7-a7f5-881f50deb33f', 'modeltype': 'Plot'}];\n", | |
" for (idx in plots) {\n", | |
" \tvar plot = plots[idx];\n", | |
" \tvar model = Bokeh.Collections(plot.modeltype).get(plot.modelid);\n", | |
" \tBokeh.logger.info('Realizing plot:')\n", | |
" \tBokeh.logger.info(' - modeltype: ' + plot.modeltype);\n", | |
" \tBokeh.logger.info(' - modelid: ' + plot.modelid);\n", | |
" \tBokeh.logger.info(' - elementid: ' + plot.elementid);\n", | |
" \tvar view = new model.default_view({\n", | |
" \t\tmodel: model,\n", | |
" \t\tel: plot.elementid\n", | |
" \t});\n", | |
" \tBokeh.index[plot.modelid] = view;\n", | |
" }\n", | |
" });\n", | |
" </script>\n", | |
"<div class=\"plotdiv\" id=\"99616fc1-537e-45f7-a7f5-881f50deb33f\"></div>\n", | |
"\n" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"pts = nx.circular_layout(G)\n", | |
"p = figure(\n", | |
" x_range = (-.1,1.1),\n", | |
" y_range = (-.1,1.1),\n", | |
" height= 400,\n", | |
" width= 400,\n", | |
")\n", | |
"for edge in G.edges():\n", | |
" p.line( \n", | |
" x= [pts[pt][0] for pt in edge],\n", | |
" y= [pts[pt][1] for pt in edge],\n", | |
" )\n", | |
"\n", | |
"for node in G.nodes():\n", | |
" p.circle( \n", | |
" x= [pts[node][0]],\n", | |
" y= [pts[node][1]],\n", | |
" radius=.05\n", | |
" )\n", | |
"show(p)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Random Layout" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 24, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<script type=\"text/javascript\">\n", | |
" Bokeh.$(function() {\n", | |
" var all_models = [{\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"5d3f9891-ddd4-402c-8870-a8a5cb6b0b22\", \"data\": {\"x\": [0.06418447941541672], \"y\": [0.7674893736839294]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"5d3f9891-ddd4-402c-8870-a8a5cb6b0b22\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"40808139-6f17-4ff0-b590-a4a1c931d163\", \"tags\": []}, \"id\": \"40808139-6f17-4ff0-b590-a4a1c931d163\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"b0f1375f-8eb1-4805-b1ea-9ab39a400b96\", \"tags\": []}, \"id\": \"b0f1375f-8eb1-4805-b1ea-9ab39a400b96\", \"type\": \"Circle\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"3eae7f62-9521-4629-ba73-c5cd0107ce1b\", \"type\": \"Plot\"}, \"id\": \"99bdc995-dacf-4acf-ab84-f7fa7b764f95\", \"dimensions\": [\"width\", \"height\"], \"tags\": []}, \"id\": \"99bdc995-dacf-4acf-ab84-f7fa7b764f95\", \"type\": \"PanTool\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"3eae7f62-9521-4629-ba73-c5cd0107ce1b\", \"type\": \"Plot\"}, \"id\": \"2363c096-0951-41d5-a406-42994bd5ab13\", \"tags\": []}, \"id\": \"2363c096-0951-41d5-a406-42994bd5ab13\", \"type\": \"HelpTool\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"6956599b-1072-4cf8-9636-6edb953122fc\", \"tags\": []}, \"id\": \"6956599b-1072-4cf8-9636-6edb953122fc\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"fe3e98a9-2a17-48a5-b6aa-a7f1b8425f02\", \"tags\": []}, \"id\": \"fe3e98a9-2a17-48a5-b6aa-a7f1b8425f02\", \"type\": \"Circle\"}, {\"attributes\": {\"doc\": null, \"plot_width\": 400, \"extra_x_ranges\": {}, \"id\": \"3eae7f62-9521-4629-ba73-c5cd0107ce1b\", \"right\": [], \"above\": [], \"left\": [{\"id\": \"92e9ff4a-1e71-46dd-9732-7526c70e450f\", \"type\": \"LinearAxis\"}], \"plot_height\": 400, \"x_range\": {\"id\": \"3eafc1dc-d087-4891-941b-c2903e8bacf4\", \"type\": \"Range1d\"}, \"y_range\": {\"id\": \"85d79f98-6ef8-4e50-94b1-11fd84329f21\", \"type\": \"Range1d\"}, \"tool_events\": {\"id\": \"e534a4d2-7695-49ce-94d0-d5acc6218c43\", \"type\": \"ToolEvents\"}, \"renderers\": [{\"id\": \"b3023ec6-97e7-4400-8f67-d07582c0ad68\", \"type\": \"LinearAxis\"}, {\"id\": \"8865d652-2049-4501-b9ad-641916a49ee1\", \"type\": \"Grid\"}, {\"id\": \"92e9ff4a-1e71-46dd-9732-7526c70e450f\", \"type\": \"LinearAxis\"}, {\"id\": \"fa9a8fe6-3141-4f95-962c-ad443a63429d\", \"type\": \"Grid\"}, {\"id\": \"345b0d4c-48d8-477b-ac1c-66ab2aefcc05\", \"type\": \"GlyphRenderer\"}, {\"id\": \"77e37e41-50d6-45ab-af72-bc503b7541af\", \"type\": \"GlyphRenderer\"}, {\"id\": \"dafe45f1-59f3-4d15-9c25-da3f750318e1\", \"type\": \"GlyphRenderer\"}, {\"id\": \"128e2072-bf0d-4b00-b8d9-23dd2b761db5\", \"type\": \"GlyphRenderer\"}, {\"id\": \"c5c66e03-7b0f-4781-819c-476149ef16ec\", \"type\": \"GlyphRenderer\"}, {\"id\": \"cfbd645c-9420-4045-a4b5-f333e543d8c4\", \"type\": \"GlyphRenderer\"}, {\"id\": \"b3337e93-258f-412e-a393-488d1fe56b80\", \"type\": \"GlyphRenderer\"}, {\"id\": \"f7816ae5-29d1-45a1-b93e-24d963e79d20\", \"type\": \"GlyphRenderer\"}, {\"id\": \"afbb380e-c539-4959-a8a1-0326f946fd0e\", \"type\": \"GlyphRenderer\"}], \"extra_y_ranges\": {}, \"below\": [{\"id\": \"b3023ec6-97e7-4400-8f67-d07582c0ad68\", \"type\": \"LinearAxis\"}], \"tags\": [], \"tools\": [{\"id\": \"99bdc995-dacf-4acf-ab84-f7fa7b764f95\", \"type\": \"PanTool\"}, {\"id\": \"04c10e68-4792-428a-87f0-87be70c83377\", \"type\": \"WheelZoomTool\"}, {\"id\": \"2f17ecce-ab3e-474e-8dd6-3a50231e979d\", \"type\": \"BoxZoomTool\"}, {\"id\": \"575bec2e-ff6e-4f72-ba26-1ce98638c900\", \"type\": \"PreviewSaveTool\"}, {\"id\": \"b609f81c-1ae2-4189-a84a-39704e4f0087\", \"type\": \"ResizeTool\"}, {\"id\": \"24e3fc45-57ac-4be4-9286-751b18fe8c85\", \"type\": \"ResetTool\"}, {\"id\": \"2363c096-0951-41d5-a406-42994bd5ab13\", \"type\": \"HelpTool\"}]}, \"subtype\": \"Figure\", \"id\": \"3eae7f62-9521-4629-ba73-c5cd0107ce1b\", \"type\": \"Plot\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"3790211d-4fe5-42b3-acc0-b8a4ce1cdb36\", \"type\": \"ColumnDataSource\"}, \"id\": \"128e2072-bf0d-4b00-b8d9-23dd2b761db5\", \"glyph\": {\"id\": \"3147770f-3f50-4b60-af26-c999760c93c7\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"3802c9fd-d5d2-4bfb-82e1-c3f726a144af\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"128e2072-bf0d-4b00-b8d9-23dd2b761db5\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"3b1ccf22-c201-4b1c-bfab-0b5525290197\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"3b1ccf22-c201-4b1c-bfab-0b5525290197\", \"type\": \"Line\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"9decc3f7-2d9b-474d-8e91-492616aa8eec\", \"type\": \"ColumnDataSource\"}, \"id\": \"cfbd645c-9420-4045-a4b5-f333e543d8c4\", \"glyph\": {\"id\": \"4de0df3a-5683-4db1-a37e-0425f11eebfd\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"b0f1375f-8eb1-4805-b1ea-9ab39a400b96\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"cfbd645c-9420-4045-a4b5-f333e543d8c4\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"d697e9a2-18b9-4e29-a115-7917479e0507\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"d697e9a2-18b9-4e29-a115-7917479e0507\", \"type\": \"Line\"}, {\"attributes\": {\"doc\": null, \"id\": \"e534a4d2-7695-49ce-94d0-d5acc6218c43\", \"geometries\": [], \"tags\": []}, \"id\": \"e534a4d2-7695-49ce-94d0-d5acc6218c43\", \"type\": \"ToolEvents\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"8659d146-1158-4876-ae2a-9a8e1decab19\", \"type\": \"ColumnDataSource\"}, \"id\": \"f7816ae5-29d1-45a1-b93e-24d963e79d20\", \"glyph\": {\"id\": \"40808139-6f17-4ff0-b590-a4a1c931d163\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"6956599b-1072-4cf8-9636-6edb953122fc\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"f7816ae5-29d1-45a1-b93e-24d963e79d20\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"3eae7f62-9521-4629-ba73-c5cd0107ce1b\", \"type\": \"Plot\"}, \"id\": \"2f17ecce-ab3e-474e-8dd6-3a50231e979d\", \"dimensions\": [\"width\", \"height\"], \"tags\": []}, \"id\": \"2f17ecce-ab3e-474e-8dd6-3a50231e979d\", \"type\": \"BoxZoomTool\"}, {\"attributes\": {\"dimension\": 0, \"ticker\": {\"id\": \"45e4bff1-de4f-4829-94b9-35d1e3ffe7dc\", \"type\": \"BasicTicker\"}, \"id\": \"8865d652-2049-4501-b9ad-641916a49ee1\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"3eae7f62-9521-4629-ba73-c5cd0107ce1b\", \"type\": \"Plot\"}, \"doc\": null, \"tags\": []}, \"id\": \"8865d652-2049-4501-b9ad-641916a49ee1\", \"type\": \"Grid\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"9dcb5f8d-ff9b-4e9c-a5ed-0c97a5b48e9f\", \"tags\": []}, \"id\": \"9dcb5f8d-ff9b-4e9c-a5ed-0c97a5b48e9f\", \"type\": \"Circle\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"59a83e94-6fc6-48ce-8f86-571b7f43c5eb\", \"data\": {\"x\": [0.06526412069797516], \"y\": [0.3997838497161865]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"59a83e94-6fc6-48ce-8f86-571b7f43c5eb\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"bf756e4a-c808-4661-bba5-0105d6ab90c0\", \"tags\": []}, \"id\": \"bf756e4a-c808-4661-bba5-0105d6ab90c0\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"1b474322-91b2-490d-b111-ef2dae1e5783\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"1b474322-91b2-490d-b111-ef2dae1e5783\", \"type\": \"Line\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"4e4b7cb3-79cd-4151-abb6-42ab47c6244b\", \"type\": \"ColumnDataSource\"}, \"id\": \"345b0d4c-48d8-477b-ac1c-66ab2aefcc05\", \"glyph\": {\"id\": \"3b1ccf22-c201-4b1c-bfab-0b5525290197\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"8e209ce0-c07b-45d7-bcc7-657e05409d6e\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"345b0d4c-48d8-477b-ac1c-66ab2aefcc05\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"5b749a72-89c0-42bb-a33c-101f9aa91300\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"5b749a72-89c0-42bb-a33c-101f9aa91300\", \"type\": \"Line\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"4e4b7cb3-79cd-4151-abb6-42ab47c6244b\", \"data\": {\"x\": [0.7655856013298035, 0.4092262089252472], \"y\": [0.44976332783699036, 0.7563562989234924]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"4e4b7cb3-79cd-4151-abb6-42ab47c6244b\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"59a83e94-6fc6-48ce-8f86-571b7f43c5eb\", \"type\": \"ColumnDataSource\"}, \"id\": \"afbb380e-c539-4959-a8a1-0326f946fd0e\", \"glyph\": {\"id\": \"fe3e98a9-2a17-48a5-b6aa-a7f1b8425f02\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"9dcb5f8d-ff9b-4e9c-a5ed-0c97a5b48e9f\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"afbb380e-c539-4959-a8a1-0326f946fd0e\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"3eae7f62-9521-4629-ba73-c5cd0107ce1b\", \"type\": \"Plot\"}, \"id\": \"b609f81c-1ae2-4189-a84a-39704e4f0087\", \"tags\": []}, \"id\": \"b609f81c-1ae2-4189-a84a-39704e4f0087\", \"type\": \"ResizeTool\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"17e952c5-4e12-418e-9f58-da82f9f430e6\", \"data\": {\"x\": [0.7655856013298035], \"y\": [0.44976332783699036]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"17e952c5-4e12-418e-9f58-da82f9f430e6\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"8e209ce0-c07b-45d7-bcc7-657e05409d6e\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"8e209ce0-c07b-45d7-bcc7-657e05409d6e\", \"type\": \"Line\"}, {\"attributes\": {\"ticker\": {\"id\": \"45e4bff1-de4f-4829-94b9-35d1e3ffe7dc\", \"type\": \"BasicTicker\"}, \"id\": \"b3023ec6-97e7-4400-8f67-d07582c0ad68\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"3eae7f62-9521-4629-ba73-c5cd0107ce1b\", \"type\": \"Plot\"}, \"doc\": null, \"formatter\": {\"id\": \"70d6f0a3-f3a4-4ba0-8020-f902fb14f174\", \"type\": \"BasicTickFormatter\"}, \"tags\": []}, \"id\": \"b3023ec6-97e7-4400-8f67-d07582c0ad68\", \"type\": \"LinearAxis\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"53096420-5ad7-45af-8efa-e90fe55bdf37\", \"data\": {\"x\": [0.06418447941541672, 0.3063741624355316], \"y\": [0.7674893736839294, 0.6662241220474243]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"53096420-5ad7-45af-8efa-e90fe55bdf37\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"num_minor_ticks\": 5, \"doc\": null, \"id\": \"45e4bff1-de4f-4829-94b9-35d1e3ffe7dc\", \"tags\": [], \"mantissas\": [2, 5, 10]}, \"id\": \"45e4bff1-de4f-4829-94b9-35d1e3ffe7dc\", \"type\": \"BasicTicker\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"3147770f-3f50-4b60-af26-c999760c93c7\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"3147770f-3f50-4b60-af26-c999760c93c7\", \"type\": \"Line\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"17e952c5-4e12-418e-9f58-da82f9f430e6\", \"type\": \"ColumnDataSource\"}, \"id\": \"c5c66e03-7b0f-4781-819c-476149ef16ec\", \"glyph\": {\"id\": \"bf756e4a-c808-4661-bba5-0105d6ab90c0\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"5682e72c-b662-4cc6-a3b7-36e407d46623\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"c5c66e03-7b0f-4781-819c-476149ef16ec\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"3802c9fd-d5d2-4bfb-82e1-c3f726a144af\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"3802c9fd-d5d2-4bfb-82e1-c3f726a144af\", \"type\": \"Line\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"5d3f9891-ddd4-402c-8870-a8a5cb6b0b22\", \"type\": \"ColumnDataSource\"}, \"id\": \"b3337e93-258f-412e-a393-488d1fe56b80\", \"glyph\": {\"id\": \"273a55a3-94f3-47fc-9c81-04ce9c058916\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"1f3f3573-8bc0-47e7-bb93-a2b95b5dd652\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"b3337e93-258f-412e-a393-488d1fe56b80\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"ticker\": {\"id\": \"6f8c1fd7-b7f5-43b8-9ab1-62673ad67e65\", \"type\": \"BasicTicker\"}, \"id\": \"92e9ff4a-1e71-46dd-9732-7526c70e450f\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"3eae7f62-9521-4629-ba73-c5cd0107ce1b\", \"type\": \"Plot\"}, \"doc\": null, \"formatter\": {\"id\": \"4e30bd3d-bc38-4ebb-8168-1ffdcda9627a\", \"type\": \"BasicTickFormatter\"}, \"tags\": []}, \"id\": \"92e9ff4a-1e71-46dd-9732-7526c70e450f\", \"type\": \"LinearAxis\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"343dcb19-116b-467b-aa36-c66387d8f765\", \"type\": \"ColumnDataSource\"}, \"id\": \"77e37e41-50d6-45ab-af72-bc503b7541af\", \"glyph\": {\"id\": \"d697e9a2-18b9-4e29-a115-7917479e0507\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"1b474322-91b2-490d-b111-ef2dae1e5783\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"77e37e41-50d6-45ab-af72-bc503b7541af\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"tags\": [], \"id\": \"4e30bd3d-bc38-4ebb-8168-1ffdcda9627a\"}, \"id\": \"4e30bd3d-bc38-4ebb-8168-1ffdcda9627a\", \"type\": \"BasicTickFormatter\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"53096420-5ad7-45af-8efa-e90fe55bdf37\", \"type\": \"ColumnDataSource\"}, \"id\": \"dafe45f1-59f3-4d15-9c25-da3f750318e1\", \"glyph\": {\"id\": \"9a800b04-81e6-42f8-babc-316079e16a3c\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"5b749a72-89c0-42bb-a33c-101f9aa91300\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"dafe45f1-59f3-4d15-9c25-da3f750318e1\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"343dcb19-116b-467b-aa36-c66387d8f765\", \"data\": {\"x\": [0.4092262089252472, 0.06418447941541672], \"y\": [0.7563562989234924, 0.7674893736839294]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"343dcb19-116b-467b-aa36-c66387d8f765\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"9a800b04-81e6-42f8-babc-316079e16a3c\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"9a800b04-81e6-42f8-babc-316079e16a3c\", \"type\": \"Line\"}, {\"attributes\": {\"doc\": null, \"tags\": [], \"id\": \"70d6f0a3-f3a4-4ba0-8020-f902fb14f174\"}, \"id\": \"70d6f0a3-f3a4-4ba0-8020-f902fb14f174\", \"type\": \"BasicTickFormatter\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"3eae7f62-9521-4629-ba73-c5cd0107ce1b\", \"type\": \"Plot\"}, \"id\": \"24e3fc45-57ac-4be4-9286-751b18fe8c85\", \"tags\": []}, \"id\": \"24e3fc45-57ac-4be4-9286-751b18fe8c85\", \"type\": \"ResetTool\"}, {\"attributes\": {\"dimension\": 1, \"ticker\": {\"id\": \"6f8c1fd7-b7f5-43b8-9ab1-62673ad67e65\", \"type\": \"BasicTicker\"}, \"id\": \"fa9a8fe6-3141-4f95-962c-ad443a63429d\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"3eae7f62-9521-4629-ba73-c5cd0107ce1b\", \"type\": \"Plot\"}, \"doc\": null, \"tags\": []}, \"id\": \"fa9a8fe6-3141-4f95-962c-ad443a63429d\", \"type\": \"Grid\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"3eae7f62-9521-4629-ba73-c5cd0107ce1b\", \"type\": \"Plot\"}, \"id\": \"04c10e68-4792-428a-87f0-87be70c83377\", \"dimensions\": [\"width\", \"height\"], \"tags\": []}, \"id\": \"04c10e68-4792-428a-87f0-87be70c83377\", \"type\": \"WheelZoomTool\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"5682e72c-b662-4cc6-a3b7-36e407d46623\", \"tags\": []}, \"id\": \"5682e72c-b662-4cc6-a3b7-36e407d46623\", \"type\": \"Circle\"}, {\"attributes\": {\"num_minor_ticks\": 5, \"doc\": null, \"id\": \"6f8c1fd7-b7f5-43b8-9ab1-62673ad67e65\", \"tags\": [], \"mantissas\": [2, 5, 10]}, \"id\": \"6f8c1fd7-b7f5-43b8-9ab1-62673ad67e65\", \"type\": \"BasicTicker\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"1f3f3573-8bc0-47e7-bb93-a2b95b5dd652\", \"tags\": []}, \"id\": \"1f3f3573-8bc0-47e7-bb93-a2b95b5dd652\", \"type\": \"Circle\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"9decc3f7-2d9b-474d-8e91-492616aa8eec\", \"data\": {\"x\": [0.4092262089252472], \"y\": [0.7563562989234924]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"9decc3f7-2d9b-474d-8e91-492616aa8eec\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"3eae7f62-9521-4629-ba73-c5cd0107ce1b\", \"type\": \"Plot\"}, \"id\": \"575bec2e-ff6e-4f72-ba26-1ce98638c900\", \"tags\": []}, \"id\": \"575bec2e-ff6e-4f72-ba26-1ce98638c900\", \"type\": \"PreviewSaveTool\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"273a55a3-94f3-47fc-9c81-04ce9c058916\", \"tags\": []}, \"id\": \"273a55a3-94f3-47fc-9c81-04ce9c058916\", \"type\": \"Circle\"}, {\"attributes\": {\"start\": -0.1, \"callback\": null, \"id\": \"3eafc1dc-d087-4891-941b-c2903e8bacf4\", \"doc\": null, \"tags\": [], \"end\": 1.1}, \"id\": \"3eafc1dc-d087-4891-941b-c2903e8bacf4\", \"type\": \"Range1d\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"4de0df3a-5683-4db1-a37e-0425f11eebfd\", \"tags\": []}, \"id\": \"4de0df3a-5683-4db1-a37e-0425f11eebfd\", \"type\": \"Circle\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"3790211d-4fe5-42b3-acc0-b8a4ce1cdb36\", \"data\": {\"x\": [0.3063741624355316, 0.06526412069797516], \"y\": [0.6662241220474243, 0.3997838497161865]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"3790211d-4fe5-42b3-acc0-b8a4ce1cdb36\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"8659d146-1158-4876-ae2a-9a8e1decab19\", \"data\": {\"x\": [0.3063741624355316], \"y\": [0.6662241220474243]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"8659d146-1158-4876-ae2a-9a8e1decab19\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"start\": -0.1, \"callback\": null, \"id\": \"85d79f98-6ef8-4e50-94b1-11fd84329f21\", \"doc\": null, \"tags\": [], \"end\": 1.1}, \"id\": \"85d79f98-6ef8-4e50-94b1-11fd84329f21\", \"type\": \"Range1d\"}];\n", | |
" Bokeh.load_models(all_models);\n", | |
" var plots = [{'modelid': '3eae7f62-9521-4629-ba73-c5cd0107ce1b', 'elementid': '#7180f043-3f3f-425c-9b0c-f4e67ed0be9a', 'modeltype': 'Plot'}];\n", | |
" for (idx in plots) {\n", | |
" \tvar plot = plots[idx];\n", | |
" \tvar model = Bokeh.Collections(plot.modeltype).get(plot.modelid);\n", | |
" \tBokeh.logger.info('Realizing plot:')\n", | |
" \tBokeh.logger.info(' - modeltype: ' + plot.modeltype);\n", | |
" \tBokeh.logger.info(' - modelid: ' + plot.modelid);\n", | |
" \tBokeh.logger.info(' - elementid: ' + plot.elementid);\n", | |
" \tvar view = new model.default_view({\n", | |
" \t\tmodel: model,\n", | |
" \t\tel: plot.elementid\n", | |
" \t});\n", | |
" \tBokeh.index[plot.modelid] = view;\n", | |
" }\n", | |
" });\n", | |
" </script>\n", | |
"<div class=\"plotdiv\" id=\"7180f043-3f3f-425c-9b0c-f4e67ed0be9a\"></div>\n", | |
"\n" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"pts = nx.random_layout(G)\n", | |
"p = figure(\n", | |
" x_range = (-.1,1.1),\n", | |
" y_range = (-.1,1.1),\n", | |
" height= 400,\n", | |
" width= 400,\n", | |
")\n", | |
"for edge in G.edges():\n", | |
" p.line( \n", | |
" x= [pts[pt][0] for pt in edge],\n", | |
" y= [pts[pt][1] for pt in edge],\n", | |
" )\n", | |
"\n", | |
"for node in G.nodes():\n", | |
" p.circle( \n", | |
" x= [pts[node][0]],\n", | |
" y= [pts[node][1]],\n", | |
" radius=.05\n", | |
" )\n", | |
"show(p)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Shell Layout" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 25, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<script type=\"text/javascript\">\n", | |
" Bokeh.$(function() {\n", | |
" var all_models = [{\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"40b1c4e9-c389-42d6-b49a-0730dbc3fb76\", \"type\": \"Plot\"}, \"id\": \"578b64d4-f151-48b5-8a73-e26b032534c1\", \"tags\": []}, \"id\": \"578b64d4-f151-48b5-8a73-e26b032534c1\", \"type\": \"HelpTool\"}, {\"attributes\": {\"doc\": null, \"id\": \"6c67d2da-8ffc-470b-9ae0-38a500575435\", \"geometries\": [], \"tags\": []}, \"id\": \"6c67d2da-8ffc-470b-9ae0-38a500575435\", \"type\": \"ToolEvents\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"c5fe8e1c-1abf-4f40-97a4-e2bfb612fccf\", \"data\": {\"x\": [0.3090171217918396], \"y\": [-0.9510564804077148]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"c5fe8e1c-1abf-4f40-97a4-e2bfb612fccf\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"11399360-4e4c-444e-b245-dd32501186d4\", \"type\": \"ColumnDataSource\"}, \"id\": \"96a88b32-0b35-4963-b548-859dbe849655\", \"glyph\": {\"id\": \"97f8b4b6-3fa6-4be3-b287-142628d48bb6\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"03aa24c4-f864-4c49-995a-306ec95a65ff\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"96a88b32-0b35-4963-b548-859dbe849655\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"cc23db2b-3c87-4c3a-9d8f-9f6714681b78\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"cc23db2b-3c87-4c3a-9d8f-9f6714681b78\", \"type\": \"Line\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"82b49032-f054-4872-98e4-22feb3f221c4\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"82b49032-f054-4872-98e4-22feb3f221c4\", \"type\": \"Line\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"285ecaf1-4d9b-4487-8d7d-783359e97b9c\", \"type\": \"ColumnDataSource\"}, \"id\": \"e91c7929-966a-4a40-b3e4-a70c8c63cff6\", \"glyph\": {\"id\": \"81b4b602-db1c-4554-827f-fc423162f335\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"652a46d7-95c1-4680-b6de-4dee4c07d70b\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"e91c7929-966a-4a40-b3e4-a70c8c63cff6\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"38073180-0e25-40d1-a56f-eeed3c462382\", \"data\": {\"x\": [-0.8090169429779053, 0.3090171217918396], \"y\": [-0.5877853631973267, -0.9510564804077148]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"38073180-0e25-40d1-a56f-eeed3c462382\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"f317eda0-49b5-4c23-92c7-560c5728f587\", \"type\": \"ColumnDataSource\"}, \"id\": \"44265505-0987-4c0e-b72a-0c296a37673c\", \"glyph\": {\"id\": \"82b49032-f054-4872-98e4-22feb3f221c4\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"ea183012-1e67-4bf4-8bc4-7ecc54d5e4f6\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"44265505-0987-4c0e-b72a-0c296a37673c\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"97f8b4b6-3fa6-4be3-b287-142628d48bb6\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"97f8b4b6-3fa6-4be3-b287-142628d48bb6\", \"type\": \"Line\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"38073180-0e25-40d1-a56f-eeed3c462382\", \"type\": \"ColumnDataSource\"}, \"id\": \"ed2be92a-fe1b-427b-8fec-e6c8cd0f999e\", \"glyph\": {\"id\": \"cc23db2b-3c87-4c3a-9d8f-9f6714681b78\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"13efd8ac-40d6-41c9-a637-56dadb26fa0d\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"ed2be92a-fe1b-427b-8fec-e6c8cd0f999e\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"a4321f05-a306-4209-b47f-c2549780937e\", \"type\": \"ColumnDataSource\"}, \"id\": \"3cdcfdea-e946-4557-8be4-95ef1cdd3579\", \"glyph\": {\"id\": \"9fc0727c-02b2-4f6c-9fb1-acb4f37cbe30\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"6b45fc68-0eea-469e-8076-1182f611a301\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"3cdcfdea-e946-4557-8be4-95ef1cdd3579\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"tags\": [], \"id\": \"19b7c8bc-5090-4ee5-be42-923d938796d7\"}, \"id\": \"19b7c8bc-5090-4ee5-be42-923d938796d7\", \"type\": \"BasicTickFormatter\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"13efd8ac-40d6-41c9-a637-56dadb26fa0d\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"13efd8ac-40d6-41c9-a637-56dadb26fa0d\", \"type\": \"Line\"}, {\"attributes\": {\"start\": -1.1, \"callback\": null, \"id\": \"de2c8ae5-f1e3-4806-a8b9-f4a35f5d9a66\", \"doc\": null, \"tags\": [], \"end\": 1.1}, \"id\": \"de2c8ae5-f1e3-4806-a8b9-f4a35f5d9a66\", \"type\": \"Range1d\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"652a46d7-95c1-4680-b6de-4dee4c07d70b\", \"tags\": []}, \"id\": \"652a46d7-95c1-4680-b6de-4dee4c07d70b\", \"type\": \"Circle\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"1527cb91-bd20-426a-9318-cd8bae3065d2\", \"type\": \"ColumnDataSource\"}, \"id\": \"f7243abd-ce1a-4edd-abf3-bbd003a30fd8\", \"glyph\": {\"id\": \"27fd4824-0e91-4f32-bf36-70ac283e7870\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"a4b12a55-4531-4b01-8e59-f484bdef2b70\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"f7243abd-ce1a-4edd-abf3-bbd003a30fd8\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"dimension\": 0, \"ticker\": {\"id\": \"ef2797d3-f9cf-4023-bb21-d60d5e310724\", \"type\": \"BasicTicker\"}, \"id\": \"d456b048-3d0c-4eb2-8a87-e82215b9afc5\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"40b1c4e9-c389-42d6-b49a-0730dbc3fb76\", \"type\": \"Plot\"}, \"doc\": null, \"tags\": []}, \"id\": \"d456b048-3d0c-4eb2-8a87-e82215b9afc5\", \"type\": \"Grid\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"a4b12a55-4531-4b01-8e59-f484bdef2b70\", \"tags\": []}, \"id\": \"a4b12a55-4531-4b01-8e59-f484bdef2b70\", \"type\": \"Circle\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"40b1c4e9-c389-42d6-b49a-0730dbc3fb76\", \"type\": \"Plot\"}, \"id\": \"e9e5cdb5-2320-49ac-849d-3a02be598c94\", \"dimensions\": [\"width\", \"height\"], \"tags\": []}, \"id\": \"e9e5cdb5-2320-49ac-849d-3a02be598c94\", \"type\": \"PanTool\"}, {\"attributes\": {\"num_minor_ticks\": 5, \"doc\": null, \"id\": \"31dc52f6-f313-4311-9448-2fca0238a907\", \"tags\": [], \"mantissas\": [2, 5, 10]}, \"id\": \"31dc52f6-f313-4311-9448-2fca0238a907\", \"type\": \"BasicTicker\"}, {\"attributes\": {\"ticker\": {\"id\": \"ef2797d3-f9cf-4023-bb21-d60d5e310724\", \"type\": \"BasicTicker\"}, \"id\": \"79918ca8-ae96-4bbe-8741-0845d3920818\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"40b1c4e9-c389-42d6-b49a-0730dbc3fb76\", \"type\": \"Plot\"}, \"doc\": null, \"formatter\": {\"id\": \"9d21e28c-283d-42ef-9b35-d034993e548d\", \"type\": \"BasicTickFormatter\"}, \"tags\": []}, \"id\": \"79918ca8-ae96-4bbe-8741-0845d3920818\", \"type\": \"LinearAxis\"}, {\"attributes\": {\"dimension\": 1, \"ticker\": {\"id\": \"31dc52f6-f313-4311-9448-2fca0238a907\", \"type\": \"BasicTicker\"}, \"id\": \"e438469f-7f04-4d7c-8988-6debb7b26c43\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"40b1c4e9-c389-42d6-b49a-0730dbc3fb76\", \"type\": \"Plot\"}, \"doc\": null, \"tags\": []}, \"id\": \"e438469f-7f04-4d7c-8988-6debb7b26c43\", \"type\": \"Grid\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"6ca6139a-83bb-40f3-93a4-de4b1e478f87\", \"tags\": []}, \"id\": \"6ca6139a-83bb-40f3-93a4-de4b1e478f87\", \"type\": \"Circle\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"1527cb91-bd20-426a-9318-cd8bae3065d2\", \"data\": {\"x\": [0.30901697278022766], \"y\": [0.9510565400123596]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"1527cb91-bd20-426a-9318-cd8bae3065d2\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"plot_width\": 400, \"extra_x_ranges\": {}, \"id\": \"40b1c4e9-c389-42d6-b49a-0730dbc3fb76\", \"right\": [], \"above\": [], \"left\": [{\"id\": \"fcf1221a-f19f-41de-a9e1-93fb026140e1\", \"type\": \"LinearAxis\"}], \"plot_height\": 400, \"x_range\": {\"id\": \"de2c8ae5-f1e3-4806-a8b9-f4a35f5d9a66\", \"type\": \"Range1d\"}, \"y_range\": {\"id\": \"586dbf1d-5b37-497b-888b-9a9b0052b451\", \"type\": \"Range1d\"}, \"tool_events\": {\"id\": \"6c67d2da-8ffc-470b-9ae0-38a500575435\", \"type\": \"ToolEvents\"}, \"renderers\": [{\"id\": \"79918ca8-ae96-4bbe-8741-0845d3920818\", \"type\": \"LinearAxis\"}, {\"id\": \"d456b048-3d0c-4eb2-8a87-e82215b9afc5\", \"type\": \"Grid\"}, {\"id\": \"fcf1221a-f19f-41de-a9e1-93fb026140e1\", \"type\": \"LinearAxis\"}, {\"id\": \"e438469f-7f04-4d7c-8988-6debb7b26c43\", \"type\": \"Grid\"}, {\"id\": \"7262c9ad-7889-4815-bcd1-03f755e0bd7d\", \"type\": \"GlyphRenderer\"}, {\"id\": \"96a88b32-0b35-4963-b548-859dbe849655\", \"type\": \"GlyphRenderer\"}, {\"id\": \"44265505-0987-4c0e-b72a-0c296a37673c\", \"type\": \"GlyphRenderer\"}, {\"id\": \"ed2be92a-fe1b-427b-8fec-e6c8cd0f999e\", \"type\": \"GlyphRenderer\"}, {\"id\": \"35a9f438-7a0d-4625-941b-a2ffdec72337\", \"type\": \"GlyphRenderer\"}, {\"id\": \"f7243abd-ce1a-4edd-abf3-bbd003a30fd8\", \"type\": \"GlyphRenderer\"}, {\"id\": \"3cdcfdea-e946-4557-8be4-95ef1cdd3579\", \"type\": \"GlyphRenderer\"}, {\"id\": \"e91c7929-966a-4a40-b3e4-a70c8c63cff6\", \"type\": \"GlyphRenderer\"}, {\"id\": \"de00ed24-0ea8-45ea-a834-e314438d57f5\", \"type\": \"GlyphRenderer\"}], \"extra_y_ranges\": {}, \"below\": [{\"id\": \"79918ca8-ae96-4bbe-8741-0845d3920818\", \"type\": \"LinearAxis\"}], \"tags\": [], \"tools\": [{\"id\": \"e9e5cdb5-2320-49ac-849d-3a02be598c94\", \"type\": \"PanTool\"}, {\"id\": \"213cc1f1-3740-4da9-b1ff-1e74e0b3caf4\", \"type\": \"WheelZoomTool\"}, {\"id\": \"b600f5d3-f43c-4f7b-a02a-097364b1a7c5\", \"type\": \"BoxZoomTool\"}, {\"id\": \"c6739687-ae15-4cab-bbf3-d713bbef691d\", \"type\": \"PreviewSaveTool\"}, {\"id\": \"ca797c97-dee1-4987-b0f1-c17ecc75998e\", \"type\": \"ResizeTool\"}, {\"id\": \"e5a4422d-ef25-44d2-a349-2850c36515ff\", \"type\": \"ResetTool\"}, {\"id\": \"578b64d4-f151-48b5-8a73-e26b032534c1\", \"type\": \"HelpTool\"}]}, \"subtype\": \"Figure\", \"id\": \"40b1c4e9-c389-42d6-b49a-0730dbc3fb76\", \"type\": \"Plot\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"40b1c4e9-c389-42d6-b49a-0730dbc3fb76\", \"type\": \"Plot\"}, \"id\": \"c6739687-ae15-4cab-bbf3-d713bbef691d\", \"tags\": []}, \"id\": \"c6739687-ae15-4cab-bbf3-d713bbef691d\", \"type\": \"PreviewSaveTool\"}, {\"attributes\": {\"doc\": null, \"tags\": [], \"id\": \"9d21e28c-283d-42ef-9b35-d034993e548d\"}, \"id\": \"9d21e28c-283d-42ef-9b35-d034993e548d\", \"type\": \"BasicTickFormatter\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"d3475a74-d9fa-4a0c-ba56-32a69a4a206f\", \"data\": {\"x\": [1.0], \"y\": [0.0]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"d3475a74-d9fa-4a0c-ba56-32a69a4a206f\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"11399360-4e4c-444e-b245-dd32501186d4\", \"data\": {\"x\": [0.30901697278022766, -0.8090170621871948], \"y\": [0.9510565400123596, 0.5877851843833923]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"11399360-4e4c-444e-b245-dd32501186d4\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"6b45fc68-0eea-469e-8076-1182f611a301\", \"tags\": []}, \"id\": \"6b45fc68-0eea-469e-8076-1182f611a301\", \"type\": \"Circle\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"f317eda0-49b5-4c23-92c7-560c5728f587\", \"data\": {\"x\": [-0.8090170621871948, -0.8090169429779053], \"y\": [0.5877851843833923, -0.5877853631973267]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"f317eda0-49b5-4c23-92c7-560c5728f587\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"c5fe8e1c-1abf-4f40-97a4-e2bfb612fccf\", \"type\": \"ColumnDataSource\"}, \"id\": \"de00ed24-0ea8-45ea-a834-e314438d57f5\", \"glyph\": {\"id\": \"8b28d7e1-3294-40e9-bd98-f81eede86c72\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"6ca6139a-83bb-40f3-93a4-de4b1e478f87\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"de00ed24-0ea8-45ea-a834-e314438d57f5\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"40b1c4e9-c389-42d6-b49a-0730dbc3fb76\", \"type\": \"Plot\"}, \"id\": \"b600f5d3-f43c-4f7b-a02a-097364b1a7c5\", \"dimensions\": [\"width\", \"height\"], \"tags\": []}, \"id\": \"b600f5d3-f43c-4f7b-a02a-097364b1a7c5\", \"type\": \"BoxZoomTool\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"40b1c4e9-c389-42d6-b49a-0730dbc3fb76\", \"type\": \"Plot\"}, \"id\": \"e5a4422d-ef25-44d2-a349-2850c36515ff\", \"tags\": []}, \"id\": \"e5a4422d-ef25-44d2-a349-2850c36515ff\", \"type\": \"ResetTool\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"d3475a74-d9fa-4a0c-ba56-32a69a4a206f\", \"type\": \"ColumnDataSource\"}, \"id\": \"35a9f438-7a0d-4625-941b-a2ffdec72337\", \"glyph\": {\"id\": \"67cd65ce-85f5-4962-8d59-88ef72794650\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"847c0be1-e457-4d1a-ad06-b0436d3f308c\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"35a9f438-7a0d-4625-941b-a2ffdec72337\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"5b939a37-3504-4713-8c4e-98b38039e686\", \"type\": \"ColumnDataSource\"}, \"id\": \"7262c9ad-7889-4815-bcd1-03f755e0bd7d\", \"glyph\": {\"id\": \"676b37a4-cc5c-47a2-bbda-351416dd6e1f\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"7ad26c74-ec91-4291-a37a-bb5c0e22c582\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"7262c9ad-7889-4815-bcd1-03f755e0bd7d\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"a4321f05-a306-4209-b47f-c2549780937e\", \"data\": {\"x\": [-0.8090170621871948], \"y\": [0.5877851843833923]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"a4321f05-a306-4209-b47f-c2549780937e\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"5b939a37-3504-4713-8c4e-98b38039e686\", \"data\": {\"x\": [1.0, 0.30901697278022766], \"y\": [0.0, 0.9510565400123596]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"5b939a37-3504-4713-8c4e-98b38039e686\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"285ecaf1-4d9b-4487-8d7d-783359e97b9c\", \"data\": {\"x\": [-0.8090169429779053], \"y\": [-0.5877853631973267]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"285ecaf1-4d9b-4487-8d7d-783359e97b9c\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"7ad26c74-ec91-4291-a37a-bb5c0e22c582\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"7ad26c74-ec91-4291-a37a-bb5c0e22c582\", \"type\": \"Line\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"67cd65ce-85f5-4962-8d59-88ef72794650\", \"tags\": []}, \"id\": \"67cd65ce-85f5-4962-8d59-88ef72794650\", \"type\": \"Circle\"}, {\"attributes\": {\"start\": -1.1, \"callback\": null, \"id\": \"586dbf1d-5b37-497b-888b-9a9b0052b451\", \"doc\": null, \"tags\": [], \"end\": 1.1}, \"id\": \"586dbf1d-5b37-497b-888b-9a9b0052b451\", \"type\": \"Range1d\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"ea183012-1e67-4bf4-8bc4-7ecc54d5e4f6\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"ea183012-1e67-4bf4-8bc4-7ecc54d5e4f6\", \"type\": \"Line\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"676b37a4-cc5c-47a2-bbda-351416dd6e1f\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"676b37a4-cc5c-47a2-bbda-351416dd6e1f\", \"type\": \"Line\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"8b28d7e1-3294-40e9-bd98-f81eede86c72\", \"tags\": []}, \"id\": \"8b28d7e1-3294-40e9-bd98-f81eede86c72\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"27fd4824-0e91-4f32-bf36-70ac283e7870\", \"tags\": []}, \"id\": \"27fd4824-0e91-4f32-bf36-70ac283e7870\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"03aa24c4-f864-4c49-995a-306ec95a65ff\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"03aa24c4-f864-4c49-995a-306ec95a65ff\", \"type\": \"Line\"}, {\"attributes\": {\"ticker\": {\"id\": \"31dc52f6-f313-4311-9448-2fca0238a907\", \"type\": \"BasicTicker\"}, \"id\": \"fcf1221a-f19f-41de-a9e1-93fb026140e1\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"40b1c4e9-c389-42d6-b49a-0730dbc3fb76\", \"type\": \"Plot\"}, \"doc\": null, \"formatter\": {\"id\": \"19b7c8bc-5090-4ee5-be42-923d938796d7\", \"type\": \"BasicTickFormatter\"}, \"tags\": []}, \"id\": \"fcf1221a-f19f-41de-a9e1-93fb026140e1\", \"type\": \"LinearAxis\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"81b4b602-db1c-4554-827f-fc423162f335\", \"tags\": []}, \"id\": \"81b4b602-db1c-4554-827f-fc423162f335\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"9fc0727c-02b2-4f6c-9fb1-acb4f37cbe30\", \"tags\": []}, \"id\": \"9fc0727c-02b2-4f6c-9fb1-acb4f37cbe30\", \"type\": \"Circle\"}, {\"attributes\": {\"num_minor_ticks\": 5, \"doc\": null, \"id\": \"ef2797d3-f9cf-4023-bb21-d60d5e310724\", \"tags\": [], \"mantissas\": [2, 5, 10]}, \"id\": \"ef2797d3-f9cf-4023-bb21-d60d5e310724\", \"type\": \"BasicTicker\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"40b1c4e9-c389-42d6-b49a-0730dbc3fb76\", \"type\": \"Plot\"}, \"id\": \"213cc1f1-3740-4da9-b1ff-1e74e0b3caf4\", \"dimensions\": [\"width\", \"height\"], \"tags\": []}, \"id\": \"213cc1f1-3740-4da9-b1ff-1e74e0b3caf4\", \"type\": \"WheelZoomTool\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"40b1c4e9-c389-42d6-b49a-0730dbc3fb76\", \"type\": \"Plot\"}, \"id\": \"ca797c97-dee1-4987-b0f1-c17ecc75998e\", \"tags\": []}, \"id\": \"ca797c97-dee1-4987-b0f1-c17ecc75998e\", \"type\": \"ResizeTool\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"847c0be1-e457-4d1a-ad06-b0436d3f308c\", \"tags\": []}, \"id\": \"847c0be1-e457-4d1a-ad06-b0436d3f308c\", \"type\": \"Circle\"}];\n", | |
" Bokeh.load_models(all_models);\n", | |
" var plots = [{'modelid': '40b1c4e9-c389-42d6-b49a-0730dbc3fb76', 'elementid': '#770e5309-114f-45b0-9bb6-2d271a9f8bf7', 'modeltype': 'Plot'}];\n", | |
" for (idx in plots) {\n", | |
" \tvar plot = plots[idx];\n", | |
" \tvar model = Bokeh.Collections(plot.modeltype).get(plot.modelid);\n", | |
" \tBokeh.logger.info('Realizing plot:')\n", | |
" \tBokeh.logger.info(' - modeltype: ' + plot.modeltype);\n", | |
" \tBokeh.logger.info(' - modelid: ' + plot.modelid);\n", | |
" \tBokeh.logger.info(' - elementid: ' + plot.elementid);\n", | |
" \tvar view = new model.default_view({\n", | |
" \t\tmodel: model,\n", | |
" \t\tel: plot.elementid\n", | |
" \t});\n", | |
" \tBokeh.index[plot.modelid] = view;\n", | |
" }\n", | |
" });\n", | |
" </script>\n", | |
"<div class=\"plotdiv\" id=\"770e5309-114f-45b0-9bb6-2d271a9f8bf7\"></div>\n", | |
"\n" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"pts = nx.shell_layout(G)\n", | |
"p = figure(\n", | |
" x_range = (-1.1,1.1),\n", | |
" y_range = (-1.1,1.1),\n", | |
" height= 400,\n", | |
" width= 400,\n", | |
")\n", | |
"for edge in G.edges():\n", | |
" p.line( \n", | |
" x= [pts[pt][0] for pt in edge],\n", | |
" y= [pts[pt][1] for pt in edge],\n", | |
" )\n", | |
"\n", | |
"for node in G.nodes():\n", | |
" p.circle( \n", | |
" x= [pts[node][0]],\n", | |
" y= [pts[node][1]],\n", | |
" radius=.05\n", | |
" )\n", | |
"show(p)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Spring Layout" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 26, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<script type=\"text/javascript\">\n", | |
" Bokeh.$(function() {\n", | |
" var all_models = [{\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"92ea20ff-5576-4400-8954-b1b1cc7a11d0\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"92ea20ff-5576-4400-8954-b1b1cc7a11d0\", \"type\": \"Line\"}, {\"attributes\": {\"doc\": null, \"tags\": [], \"id\": \"44603456-25d0-4ef8-abf7-b4e5aac21eea\"}, \"id\": \"44603456-25d0-4ef8-abf7-b4e5aac21eea\", \"type\": \"BasicTickFormatter\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"479955d5-a7b1-425c-8122-92694ec400b7\", \"tags\": []}, \"id\": \"479955d5-a7b1-425c-8122-92694ec400b7\", \"type\": \"Circle\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"8d8645b7-2b3f-45f2-ba1a-9e82b316d097\", \"type\": \"ColumnDataSource\"}, \"id\": \"d1316fc7-4b01-4582-9e1e-346b02c7dbdb\", \"glyph\": {\"id\": \"ffe74d6c-95fc-45a7-8dbf-d2ea8d9b722a\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"cd282e85-1203-4420-bd19-7d8d0e43418a\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"d1316fc7-4b01-4582-9e1e-346b02c7dbdb\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"21f69f3c-c9e8-4b2c-950a-42cc1b246a98\", \"type\": \"ColumnDataSource\"}, \"id\": \"4ea440b4-b20a-4dce-9c5b-bad53834575f\", \"glyph\": {\"id\": \"a04ebfa8-d113-44b7-aac6-88a823a9cb3a\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"ac3e71e3-d070-4725-b1dd-1ba4450bf7cd\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"4ea440b4-b20a-4dce-9c5b-bad53834575f\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"5d366509-1197-45ac-96da-89cf3a2fcbd9\", \"data\": {\"x\": [0.4080482321516604], \"y\": [0.0]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"5d366509-1197-45ac-96da-89cf3a2fcbd9\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"5d366509-1197-45ac-96da-89cf3a2fcbd9\", \"type\": \"ColumnDataSource\"}, \"id\": \"c7f78a73-1c60-4c92-8eff-00396cf65970\", \"glyph\": {\"id\": \"ebe6fb07-ed8b-45fe-8c21-4a77ce265e15\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"47f905e2-2ae0-4393-8f95-e58abd616d89\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"c7f78a73-1c60-4c92-8eff-00396cf65970\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"a04ebfa8-d113-44b7-aac6-88a823a9cb3a\", \"tags\": []}, \"id\": \"a04ebfa8-d113-44b7-aac6-88a823a9cb3a\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"d841d909-5109-4f8c-9c20-57313aa9f06f\", \"tags\": []}, \"id\": \"d841d909-5109-4f8c-9c20-57313aa9f06f\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"47f905e2-2ae0-4393-8f95-e58abd616d89\", \"tags\": []}, \"id\": \"47f905e2-2ae0-4393-8f95-e58abd616d89\", \"type\": \"Circle\"}, {\"attributes\": {\"num_minor_ticks\": 5, \"doc\": null, \"id\": \"8399b32a-dfbb-4ed2-91b8-f499b2e1a0cd\", \"tags\": [], \"mantissas\": [2, 5, 10]}, \"id\": \"8399b32a-dfbb-4ed2-91b8-f499b2e1a0cd\", \"type\": \"BasicTicker\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"ac3e71e3-d070-4725-b1dd-1ba4450bf7cd\", \"tags\": []}, \"id\": \"ac3e71e3-d070-4725-b1dd-1ba4450bf7cd\", \"type\": \"Circle\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"8520bd29-5285-40d0-9145-5f2c91fbe11b\", \"data\": {\"x\": [0.4080482321516604, 0.14217413065045498], \"y\": [0.0, 0.1733710780091455]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"8520bd29-5285-40d0-9145-5f2c91fbe11b\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"541ef108-b0dc-4731-b9f9-151ea606246b\", \"type\": \"Plot\"}, \"id\": \"b75e80d9-fcd9-40f3-a39b-c0a31a48ed8d\", \"tags\": []}, \"id\": \"b75e80d9-fcd9-40f3-a39b-c0a31a48ed8d\", \"type\": \"ResizeTool\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"28184055-23ea-45d5-9eee-9d57739665d2\", \"data\": {\"x\": [0.04707099679988219], \"y\": [0.9527516704280242]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"28184055-23ea-45d5-9eee-9d57739665d2\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"dimension\": 0, \"ticker\": {\"id\": \"b6884e76-ae54-497f-8d81-7952602f0550\", \"type\": \"BasicTicker\"}, \"id\": \"1128bcf8-5d88-42c4-ab8a-b8cfe8cc97ac\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"541ef108-b0dc-4731-b9f9-151ea606246b\", \"type\": \"Plot\"}, \"doc\": null, \"tags\": []}, \"id\": \"1128bcf8-5d88-42c4-ab8a-b8cfe8cc97ac\", \"type\": \"Grid\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"6e587667-3479-4e68-9d9e-5d5515f3fd88\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"6e587667-3479-4e68-9d9e-5d5515f3fd88\", \"type\": \"Line\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"04be11c1-6905-4ceb-bfad-a9318addb3bd\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"04be11c1-6905-4ceb-bfad-a9318addb3bd\", \"type\": \"Line\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"d33067d4-5bf6-4829-afb7-de89f2bc8727\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"d33067d4-5bf6-4829-afb7-de89f2bc8727\", \"type\": \"Line\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"541ef108-b0dc-4731-b9f9-151ea606246b\", \"type\": \"Plot\"}, \"id\": \"bb61ba2d-b9bc-43d8-a345-4f9b2de8147c\", \"tags\": []}, \"id\": \"bb61ba2d-b9bc-43d8-a345-4f9b2de8147c\", \"type\": \"PreviewSaveTool\"}, {\"attributes\": {\"dimension\": 1, \"ticker\": {\"id\": \"8399b32a-dfbb-4ed2-91b8-f499b2e1a0cd\", \"type\": \"BasicTicker\"}, \"id\": \"94d0b1f4-be38-4799-896d-5a32df192f0c\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"541ef108-b0dc-4731-b9f9-151ea606246b\", \"type\": \"Plot\"}, \"doc\": null, \"tags\": []}, \"id\": \"94d0b1f4-be38-4799-896d-5a32df192f0c\", \"type\": \"Grid\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"541ef108-b0dc-4731-b9f9-151ea606246b\", \"type\": \"Plot\"}, \"id\": \"4493ac28-817a-47e5-85f1-f724f5bb8a2b\", \"dimensions\": [\"width\", \"height\"], \"tags\": []}, \"id\": \"4493ac28-817a-47e5-85f1-f724f5bb8a2b\", \"type\": \"PanTool\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"28184055-23ea-45d5-9eee-9d57739665d2\", \"type\": \"ColumnDataSource\"}, \"id\": \"4626b3ab-5671-47f5-9038-c93f66cf1137\", \"glyph\": {\"id\": \"d043ea98-a0af-4c91-aa2a-b0bf21ef3653\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"d841d909-5109-4f8c-9c20-57313aa9f06f\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"4626b3ab-5671-47f5-9038-c93f66cf1137\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"ffe74d6c-95fc-45a7-8dbf-d2ea8d9b722a\", \"tags\": []}, \"id\": \"ffe74d6c-95fc-45a7-8dbf-d2ea8d9b722a\", \"type\": \"Circle\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"2849cd4b-1596-4c41-b86f-ac380a36466d\", \"data\": {\"x\": [0.5065575687841685], \"y\": [1.0]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"2849cd4b-1596-4c41-b86f-ac380a36466d\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"c148f6b0-e0f1-4624-8b47-32f9141cf0ca\", \"tags\": []}, \"id\": \"c148f6b0-e0f1-4624-8b47-32f9141cf0ca\", \"type\": \"Circle\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"e4f4c0fc-97e0-4b8a-873f-289af34d386f\", \"data\": {\"x\": [0.0, 0.04707099679988219], \"y\": [0.3983372746930259, 0.9527516704280242]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"e4f4c0fc-97e0-4b8a-873f-289af34d386f\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"c558c508-ea9b-4a7c-a036-9161f6428bda\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"c558c508-ea9b-4a7c-a036-9161f6428bda\", \"type\": \"Line\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"61b8876a-29d9-4a62-8b91-fe2e336dbf20\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"61b8876a-29d9-4a62-8b91-fe2e336dbf20\", \"type\": \"Line\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"2849cd4b-1596-4c41-b86f-ac380a36466d\", \"type\": \"ColumnDataSource\"}, \"id\": \"9b8d55a8-83b0-4553-a8cf-a6932f76d8e0\", \"glyph\": {\"id\": \"479955d5-a7b1-425c-8122-92694ec400b7\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"c148f6b0-e0f1-4624-8b47-32f9141cf0ca\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"9b8d55a8-83b0-4553-a8cf-a6932f76d8e0\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"start\": -0.1, \"callback\": null, \"id\": \"0c8f9cb7-da08-4c9d-a9d6-4ff9b5d13dba\", \"doc\": null, \"tags\": [], \"end\": 1.1}, \"id\": \"0c8f9cb7-da08-4c9d-a9d6-4ff9b5d13dba\", \"type\": \"Range1d\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"e4f4c0fc-97e0-4b8a-873f-289af34d386f\", \"type\": \"ColumnDataSource\"}, \"id\": \"fe596ed1-64fd-40d9-a8fc-ef322d0c9043\", \"glyph\": {\"id\": \"6e587667-3479-4e68-9d9e-5d5515f3fd88\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"d3ac986c-8438-4fb3-beb8-496cc57de50b\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"fe596ed1-64fd-40d9-a8fc-ef322d0c9043\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"plot_width\": 400, \"extra_x_ranges\": {}, \"id\": \"541ef108-b0dc-4731-b9f9-151ea606246b\", \"right\": [], \"above\": [], \"left\": [{\"id\": \"9bfb21b3-0896-40ba-afbe-7665631797e3\", \"type\": \"LinearAxis\"}], \"plot_height\": 400, \"x_range\": {\"id\": \"0c8f9cb7-da08-4c9d-a9d6-4ff9b5d13dba\", \"type\": \"Range1d\"}, \"y_range\": {\"id\": \"41454110-1b59-4746-a7a6-68fc16580a2d\", \"type\": \"Range1d\"}, \"tool_events\": {\"id\": \"e5818281-caed-440c-8241-9d26e0d3e93e\", \"type\": \"ToolEvents\"}, \"renderers\": [{\"id\": \"2c866a9a-28be-4e1c-9174-36bf8cf862d7\", \"type\": \"LinearAxis\"}, {\"id\": \"1128bcf8-5d88-42c4-ab8a-b8cfe8cc97ac\", \"type\": \"Grid\"}, {\"id\": \"9bfb21b3-0896-40ba-afbe-7665631797e3\", \"type\": \"LinearAxis\"}, {\"id\": \"94d0b1f4-be38-4799-896d-5a32df192f0c\", \"type\": \"Grid\"}, {\"id\": \"19429b6b-885e-44c8-98cf-9da081d5eb91\", \"type\": \"GlyphRenderer\"}, {\"id\": \"eeef7621-3fa2-490d-82b1-ae51d4dfad4c\", \"type\": \"GlyphRenderer\"}, {\"id\": \"fe596ed1-64fd-40d9-a8fc-ef322d0c9043\", \"type\": \"GlyphRenderer\"}, {\"id\": \"6c67b11a-9dc0-410a-92d5-4bb04b675917\", \"type\": \"GlyphRenderer\"}, {\"id\": \"c7f78a73-1c60-4c92-8eff-00396cf65970\", \"type\": \"GlyphRenderer\"}, {\"id\": \"4ea440b4-b20a-4dce-9c5b-bad53834575f\", \"type\": \"GlyphRenderer\"}, {\"id\": \"d1316fc7-4b01-4582-9e1e-346b02c7dbdb\", \"type\": \"GlyphRenderer\"}, {\"id\": \"4626b3ab-5671-47f5-9038-c93f66cf1137\", \"type\": \"GlyphRenderer\"}, {\"id\": \"9b8d55a8-83b0-4553-a8cf-a6932f76d8e0\", \"type\": \"GlyphRenderer\"}], \"extra_y_ranges\": {}, \"below\": [{\"id\": \"2c866a9a-28be-4e1c-9174-36bf8cf862d7\", \"type\": \"LinearAxis\"}], \"tags\": [], \"tools\": [{\"id\": \"4493ac28-817a-47e5-85f1-f724f5bb8a2b\", \"type\": \"PanTool\"}, {\"id\": \"124a1c8e-70a5-4843-90f2-942ddc32eff2\", \"type\": \"WheelZoomTool\"}, {\"id\": \"a080b482-b8a6-41c1-9379-cbc6552a5f3c\", \"type\": \"BoxZoomTool\"}, {\"id\": \"bb61ba2d-b9bc-43d8-a345-4f9b2de8147c\", \"type\": \"PreviewSaveTool\"}, {\"id\": \"b75e80d9-fcd9-40f3-a39b-c0a31a48ed8d\", \"type\": \"ResizeTool\"}, {\"id\": \"e0ee032e-e0cb-48da-a6ab-8c5b4660fdb3\", \"type\": \"ResetTool\"}, {\"id\": \"e85e3b0c-ebf3-4303-89c7-bf86832d5767\", \"type\": \"HelpTool\"}]}, \"subtype\": \"Figure\", \"id\": \"541ef108-b0dc-4731-b9f9-151ea606246b\", \"type\": \"Plot\"}, {\"attributes\": {\"doc\": null, \"tags\": [], \"id\": \"da39eee7-3f76-4600-9d38-85428f663969\"}, \"id\": \"da39eee7-3f76-4600-9d38-85428f663969\", \"type\": \"BasicTickFormatter\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"541ef108-b0dc-4731-b9f9-151ea606246b\", \"type\": \"Plot\"}, \"id\": \"a080b482-b8a6-41c1-9379-cbc6552a5f3c\", \"dimensions\": [\"width\", \"height\"], \"tags\": []}, \"id\": \"a080b482-b8a6-41c1-9379-cbc6552a5f3c\", \"type\": \"BoxZoomTool\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"541ef108-b0dc-4731-b9f9-151ea606246b\", \"type\": \"Plot\"}, \"id\": \"e85e3b0c-ebf3-4303-89c7-bf86832d5767\", \"tags\": []}, \"id\": \"e85e3b0c-ebf3-4303-89c7-bf86832d5767\", \"type\": \"HelpTool\"}, {\"attributes\": {\"num_minor_ticks\": 5, \"doc\": null, \"id\": \"b6884e76-ae54-497f-8d81-7952602f0550\", \"tags\": [], \"mantissas\": [2, 5, 10]}, \"id\": \"b6884e76-ae54-497f-8d81-7952602f0550\", \"type\": \"BasicTicker\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"63d24ab8-2644-4d5d-b672-d6c926ff2c26\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"63d24ab8-2644-4d5d-b672-d6c926ff2c26\", \"type\": \"Line\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"8520bd29-5285-40d0-9145-5f2c91fbe11b\", \"type\": \"ColumnDataSource\"}, \"id\": \"19429b6b-885e-44c8-98cf-9da081d5eb91\", \"glyph\": {\"id\": \"63d24ab8-2644-4d5d-b672-d6c926ff2c26\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"92ea20ff-5576-4400-8954-b1b1cc7a11d0\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"19429b6b-885e-44c8-98cf-9da081d5eb91\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"6004476c-07f0-41a7-8e69-13ee7ffcd4cc\", \"data\": {\"x\": [0.04707099679988219, 0.5065575687841685], \"y\": [0.9527516704280242, 1.0]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"6004476c-07f0-41a7-8e69-13ee7ffcd4cc\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"id\": \"e5818281-caed-440c-8241-9d26e0d3e93e\", \"geometries\": [], \"tags\": []}, \"id\": \"e5818281-caed-440c-8241-9d26e0d3e93e\", \"type\": \"ToolEvents\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"fb521495-928b-473f-97b3-705932ce90f0\", \"type\": \"ColumnDataSource\"}, \"id\": \"eeef7621-3fa2-490d-82b1-ae51d4dfad4c\", \"glyph\": {\"id\": \"61b8876a-29d9-4a62-8b91-fe2e336dbf20\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"d33067d4-5bf6-4829-afb7-de89f2bc8727\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"eeef7621-3fa2-490d-82b1-ae51d4dfad4c\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"fb521495-928b-473f-97b3-705932ce90f0\", \"data\": {\"x\": [0.14217413065045498, 0.0], \"y\": [0.1733710780091455, 0.3983372746930259]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"fb521495-928b-473f-97b3-705932ce90f0\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"21f69f3c-c9e8-4b2c-950a-42cc1b246a98\", \"data\": {\"x\": [0.14217413065045498], \"y\": [0.1733710780091455]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"21f69f3c-c9e8-4b2c-950a-42cc1b246a98\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"541ef108-b0dc-4731-b9f9-151ea606246b\", \"type\": \"Plot\"}, \"id\": \"124a1c8e-70a5-4843-90f2-942ddc32eff2\", \"dimensions\": [\"width\", \"height\"], \"tags\": []}, \"id\": \"124a1c8e-70a5-4843-90f2-942ddc32eff2\", \"type\": \"WheelZoomTool\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"cd282e85-1203-4420-bd19-7d8d0e43418a\", \"tags\": []}, \"id\": \"cd282e85-1203-4420-bd19-7d8d0e43418a\", \"type\": \"Circle\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"541ef108-b0dc-4731-b9f9-151ea606246b\", \"type\": \"Plot\"}, \"id\": \"e0ee032e-e0cb-48da-a6ab-8c5b4660fdb3\", \"tags\": []}, \"id\": \"e0ee032e-e0cb-48da-a6ab-8c5b4660fdb3\", \"type\": \"ResetTool\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"ebe6fb07-ed8b-45fe-8c21-4a77ce265e15\", \"tags\": []}, \"id\": \"ebe6fb07-ed8b-45fe-8c21-4a77ce265e15\", \"type\": \"Circle\"}, {\"attributes\": {\"ticker\": {\"id\": \"8399b32a-dfbb-4ed2-91b8-f499b2e1a0cd\", \"type\": \"BasicTicker\"}, \"id\": \"9bfb21b3-0896-40ba-afbe-7665631797e3\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"541ef108-b0dc-4731-b9f9-151ea606246b\", \"type\": \"Plot\"}, \"doc\": null, \"formatter\": {\"id\": \"da39eee7-3f76-4600-9d38-85428f663969\", \"type\": \"BasicTickFormatter\"}, \"tags\": []}, \"id\": \"9bfb21b3-0896-40ba-afbe-7665631797e3\", \"type\": \"LinearAxis\"}, {\"attributes\": {\"ticker\": {\"id\": \"b6884e76-ae54-497f-8d81-7952602f0550\", \"type\": \"BasicTicker\"}, \"id\": \"2c866a9a-28be-4e1c-9174-36bf8cf862d7\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"541ef108-b0dc-4731-b9f9-151ea606246b\", \"type\": \"Plot\"}, \"doc\": null, \"formatter\": {\"id\": \"44603456-25d0-4ef8-abf7-b4e5aac21eea\", \"type\": \"BasicTickFormatter\"}, \"tags\": []}, \"id\": \"2c866a9a-28be-4e1c-9174-36bf8cf862d7\", \"type\": \"LinearAxis\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"d3ac986c-8438-4fb3-beb8-496cc57de50b\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"d3ac986c-8438-4fb3-beb8-496cc57de50b\", \"type\": \"Line\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"d043ea98-a0af-4c91-aa2a-b0bf21ef3653\", \"tags\": []}, \"id\": \"d043ea98-a0af-4c91-aa2a-b0bf21ef3653\", \"type\": \"Circle\"}, {\"attributes\": {\"start\": -0.1, \"callback\": null, \"id\": \"41454110-1b59-4746-a7a6-68fc16580a2d\", \"doc\": null, \"tags\": [], \"end\": 1.1}, \"id\": \"41454110-1b59-4746-a7a6-68fc16580a2d\", \"type\": \"Range1d\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"8d8645b7-2b3f-45f2-ba1a-9e82b316d097\", \"data\": {\"x\": [0.0], \"y\": [0.3983372746930259]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"8d8645b7-2b3f-45f2-ba1a-9e82b316d097\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"6004476c-07f0-41a7-8e69-13ee7ffcd4cc\", \"type\": \"ColumnDataSource\"}, \"id\": \"6c67b11a-9dc0-410a-92d5-4bb04b675917\", \"glyph\": {\"id\": \"04be11c1-6905-4ceb-bfad-a9318addb3bd\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"c558c508-ea9b-4a7c-a036-9161f6428bda\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"6c67b11a-9dc0-410a-92d5-4bb04b675917\", \"type\": \"GlyphRenderer\"}];\n", | |
" Bokeh.load_models(all_models);\n", | |
" var plots = [{'modelid': '541ef108-b0dc-4731-b9f9-151ea606246b', 'elementid': '#6fbaf3b9-4d7e-42ed-9521-28ef1047cb23', 'modeltype': 'Plot'}];\n", | |
" for (idx in plots) {\n", | |
" \tvar plot = plots[idx];\n", | |
" \tvar model = Bokeh.Collections(plot.modeltype).get(plot.modelid);\n", | |
" \tBokeh.logger.info('Realizing plot:')\n", | |
" \tBokeh.logger.info(' - modeltype: ' + plot.modeltype);\n", | |
" \tBokeh.logger.info(' - modelid: ' + plot.modelid);\n", | |
" \tBokeh.logger.info(' - elementid: ' + plot.elementid);\n", | |
" \tvar view = new model.default_view({\n", | |
" \t\tmodel: model,\n", | |
" \t\tel: plot.elementid\n", | |
" \t});\n", | |
" \tBokeh.index[plot.modelid] = view;\n", | |
" }\n", | |
" });\n", | |
" </script>\n", | |
"<div class=\"plotdiv\" id=\"6fbaf3b9-4d7e-42ed-9521-28ef1047cb23\"></div>\n", | |
"\n" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"pts = nx.spring_layout(G)\n", | |
"p = figure(\n", | |
" x_range = (-.1,1.1),\n", | |
" y_range = (-.1,1.1),\n", | |
" height= 400,\n", | |
" width= 400,\n", | |
")\n", | |
"for edge in G.edges():\n", | |
" p.line( \n", | |
" x= [pts[pt][0] for pt in edge],\n", | |
" y= [pts[pt][1] for pt in edge],\n", | |
" )\n", | |
"\n", | |
"for node in G.nodes():\n", | |
" p.circle( \n", | |
" x= [pts[node][0]],\n", | |
" y= [pts[node][1]],\n", | |
" radius=.05,\n", | |
" )\n", | |
"show(p)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Spectral Layout" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 27, | |
"metadata": { | |
"collapsed": false | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<script type=\"text/javascript\">\n", | |
" Bokeh.$(function() {\n", | |
" var all_models = [{\"attributes\": {\"doc\": null, \"tags\": [], \"id\": \"8dc12ddf-a88d-48d3-ac49-7e3409094b5c\"}, \"id\": \"8dc12ddf-a88d-48d3-ac49-7e3409094b5c\", \"type\": \"BasicTickFormatter\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"64034369-4aec-4e7f-a4e8-922f8becc753\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"64034369-4aec-4e7f-a4e8-922f8becc753\", \"type\": \"Line\"}, {\"attributes\": {\"doc\": null, \"id\": \"b2d31a0f-6492-42f9-a671-c2da33de87b7\", \"geometries\": [], \"tags\": []}, \"id\": \"b2d31a0f-6492-42f9-a671-c2da33de87b7\", \"type\": \"ToolEvents\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"bbb546dc-1bee-4aea-9622-22771dd27083\", \"tags\": []}, \"id\": \"bbb546dc-1bee-4aea-9622-22771dd27083\", \"type\": \"Circle\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"07c78551-9549-4280-95a4-466e3e19bbda\", \"type\": \"ColumnDataSource\"}, \"id\": \"4b9ef6df-575b-47b5-a567-d89f0c2bc191\", \"glyph\": {\"id\": \"7daa3d31-3be0-4570-a5d2-0d95a199220b\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"06aa10f1-88ea-4f5c-99be-217cbdea5a0a\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"4b9ef6df-575b-47b5-a567-d89f0c2bc191\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"ticker\": {\"id\": \"febb6bcb-bded-4d56-963b-a5bb55213dbe\", \"type\": \"BasicTicker\"}, \"id\": \"dbe3dc0d-9b27-41ee-9939-f594d21c47be\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"bc0de009-0207-4098-9b4f-61db942afe5a\", \"type\": \"Plot\"}, \"doc\": null, \"formatter\": {\"id\": \"8dc12ddf-a88d-48d3-ac49-7e3409094b5c\", \"type\": \"BasicTickFormatter\"}, \"tags\": []}, \"id\": \"dbe3dc0d-9b27-41ee-9939-f594d21c47be\", \"type\": \"LinearAxis\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"ea646c0c-e585-4970-b5fb-58b9a58ccde2\", \"type\": \"ColumnDataSource\"}, \"id\": \"d7ad7886-21f4-4ded-95bd-5bdc1ca4c1a0\", \"glyph\": {\"id\": \"1852265e-3887-4688-90c0-cd59c2631c94\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"1631a7a1-5fe4-4fc3-a1f8-11d00892e78f\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"d7ad7886-21f4-4ded-95bd-5bdc1ca4c1a0\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"2b4c78a5-47b1-430d-aded-26297b1c25f5\", \"type\": \"ColumnDataSource\"}, \"id\": \"279a9e89-44f2-4fc4-9de9-e881c3890be1\", \"glyph\": {\"id\": \"b974370d-7e24-443d-9017-a6b8e176b1a8\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"383ff541-90df-462f-9a49-69e795f5ddd3\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"279a9e89-44f2-4fc4-9de9-e881c3890be1\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"07c78551-9549-4280-95a4-466e3e19bbda\", \"data\": {\"x\": [0.0], \"y\": [0.7979293402756517]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"07c78551-9549-4280-95a4-466e3e19bbda\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"7147b176-d6a7-4f4f-9e72-97db1b21850b\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"7147b176-d6a7-4f4f-9e72-97db1b21850b\", \"type\": \"Line\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"bc0de009-0207-4098-9b4f-61db942afe5a\", \"type\": \"Plot\"}, \"id\": \"78135d75-1796-46c0-9550-b1cd48dbdc25\", \"dimensions\": [\"width\", \"height\"], \"tags\": []}, \"id\": \"78135d75-1796-46c0-9550-b1cd48dbdc25\", \"type\": \"PanTool\"}, {\"attributes\": {\"doc\": null, \"tags\": [], \"id\": \"337118b4-2577-4ba3-a577-bfb70dbb9d43\"}, \"id\": \"337118b4-2577-4ba3-a577-bfb70dbb9d43\", \"type\": \"BasicTickFormatter\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"383ff541-90df-462f-9a49-69e795f5ddd3\", \"tags\": []}, \"id\": \"383ff541-90df-462f-9a49-69e795f5ddd3\", \"type\": \"Circle\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"ea646c0c-e585-4970-b5fb-58b9a58ccde2\", \"data\": {\"x\": [0.5361542318115881, 0.8536223874667421], \"y\": [0.0, 1.0]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"ea646c0c-e585-4970-b5fb-58b9a58ccde2\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"start\": -0.1, \"callback\": null, \"id\": \"e4374d74-efc6-46fa-9614-b171a12fe89e\", \"doc\": null, \"tags\": [], \"end\": 1.1}, \"id\": \"e4374d74-efc6-46fa-9614-b171a12fe89e\", \"type\": \"Range1d\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"e0f91f1d-32fb-4b92-8419-3c751cec51e6\", \"type\": \"ColumnDataSource\"}, \"id\": \"cf2ed527-c43e-4bab-a0f6-21e1e3c7315c\", \"glyph\": {\"id\": \"695b9b3f-4f91-48c8-96b5-da1b6c07aa24\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"bbb546dc-1bee-4aea-9622-22771dd27083\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"cf2ed527-c43e-4bab-a0f6-21e1e3c7315c\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"bc0de009-0207-4098-9b4f-61db942afe5a\", \"type\": \"Plot\"}, \"id\": \"8a7fff94-c539-4ce1-a8bf-b6e383246e2a\", \"tags\": []}, \"id\": \"8a7fff94-c539-4ce1-a8bf-b6e383246e2a\", \"type\": \"ResetTool\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"1977637d-4e7a-447d-be9e-d1058f4fb0ef\", \"data\": {\"x\": [0.5361542318115881], \"y\": [0.0]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"1977637d-4e7a-447d-be9e-d1058f4fb0ef\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"bc0de009-0207-4098-9b4f-61db942afe5a\", \"type\": \"Plot\"}, \"id\": \"836d040c-57e1-40a9-a8ec-01cf9e7997a8\", \"tags\": []}, \"id\": \"836d040c-57e1-40a9-a8ec-01cf9e7997a8\", \"type\": \"PreviewSaveTool\"}, {\"attributes\": {\"num_minor_ticks\": 5, \"doc\": null, \"id\": \"ca73b2cb-4e05-46d7-91a9-ba9117de7e46\", \"tags\": [], \"mantissas\": [2, 5, 10]}, \"id\": \"ca73b2cb-4e05-46d7-91a9-ba9117de7e46\", \"type\": \"BasicTicker\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"bc0de009-0207-4098-9b4f-61db942afe5a\", \"type\": \"Plot\"}, \"id\": \"e07e0ef5-9ca8-4238-b82f-22895a89faff\", \"tags\": []}, \"id\": \"e07e0ef5-9ca8-4238-b82f-22895a89faff\", \"type\": \"ResizeTool\"}, {\"attributes\": {\"doc\": null, \"plot_width\": 400, \"extra_x_ranges\": {}, \"id\": \"bc0de009-0207-4098-9b4f-61db942afe5a\", \"right\": [], \"above\": [], \"left\": [{\"id\": \"dbe3dc0d-9b27-41ee-9939-f594d21c47be\", \"type\": \"LinearAxis\"}], \"plot_height\": 400, \"x_range\": {\"id\": \"4310ae15-d546-4883-af0e-d5b47b5b3553\", \"type\": \"Range1d\"}, \"y_range\": {\"id\": \"e4374d74-efc6-46fa-9614-b171a12fe89e\", \"type\": \"Range1d\"}, \"tool_events\": {\"id\": \"b2d31a0f-6492-42f9-a671-c2da33de87b7\", \"type\": \"ToolEvents\"}, \"renderers\": [{\"id\": \"a452b4bd-c7b8-43f2-a692-3d5f1fdece67\", \"type\": \"LinearAxis\"}, {\"id\": \"53349012-645d-4447-827a-bb86c5d6fcaa\", \"type\": \"Grid\"}, {\"id\": \"dbe3dc0d-9b27-41ee-9939-f594d21c47be\", \"type\": \"LinearAxis\"}, {\"id\": \"fad90266-cefd-4f7f-a3ee-b1f1bb856512\", \"type\": \"Grid\"}, {\"id\": \"ac1e4a90-289f-498f-87de-b63856406e5b\", \"type\": \"GlyphRenderer\"}, {\"id\": \"833d4b25-9e1a-4d33-9700-33b3d0e955d3\", \"type\": \"GlyphRenderer\"}, {\"id\": \"76bbcec7-421e-4c79-94e1-b09a867f9349\", \"type\": \"GlyphRenderer\"}, {\"id\": \"d7ad7886-21f4-4ded-95bd-5bdc1ca4c1a0\", \"type\": \"GlyphRenderer\"}, {\"id\": \"4b9ef6df-575b-47b5-a567-d89f0c2bc191\", \"type\": \"GlyphRenderer\"}, {\"id\": \"7df45f54-118c-4e2c-9665-a9d519e16360\", \"type\": \"GlyphRenderer\"}, {\"id\": \"279a9e89-44f2-4fc4-9de9-e881c3890be1\", \"type\": \"GlyphRenderer\"}, {\"id\": \"c5880eed-ac1a-4837-9282-9cfcefc779a0\", \"type\": \"GlyphRenderer\"}, {\"id\": \"cf2ed527-c43e-4bab-a0f6-21e1e3c7315c\", \"type\": \"GlyphRenderer\"}], \"extra_y_ranges\": {}, \"below\": [{\"id\": \"a452b4bd-c7b8-43f2-a692-3d5f1fdece67\", \"type\": \"LinearAxis\"}], \"tags\": [], \"tools\": [{\"id\": \"78135d75-1796-46c0-9550-b1cd48dbdc25\", \"type\": \"PanTool\"}, {\"id\": \"35f13204-d4f1-4c4d-9748-ba465850e41e\", \"type\": \"WheelZoomTool\"}, {\"id\": \"3be625e3-83fc-434e-af47-20341a702a5d\", \"type\": \"BoxZoomTool\"}, {\"id\": \"836d040c-57e1-40a9-a8ec-01cf9e7997a8\", \"type\": \"PreviewSaveTool\"}, {\"id\": \"e07e0ef5-9ca8-4238-b82f-22895a89faff\", \"type\": \"ResizeTool\"}, {\"id\": \"8a7fff94-c539-4ce1-a8bf-b6e383246e2a\", \"type\": \"ResetTool\"}, {\"id\": \"df936dab-4fc6-4bc8-8029-d23f1f8f076d\", \"type\": \"HelpTool\"}]}, \"subtype\": \"Figure\", \"id\": \"bc0de009-0207-4098-9b4f-61db942afe5a\", \"type\": \"Plot\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"b974370d-7e24-443d-9017-a6b8e176b1a8\", \"tags\": []}, \"id\": \"b974370d-7e24-443d-9017-a6b8e176b1a8\", \"type\": \"Circle\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"bc0de009-0207-4098-9b4f-61db942afe5a\", \"type\": \"Plot\"}, \"id\": \"3be625e3-83fc-434e-af47-20341a702a5d\", \"dimensions\": [\"width\", \"height\"], \"tags\": []}, \"id\": \"3be625e3-83fc-434e-af47-20341a702a5d\", \"type\": \"BoxZoomTool\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"b8b96806-b9b2-4ede-89f9-479218ca7968\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"b8b96806-b9b2-4ede-89f9-479218ca7968\", \"type\": \"Line\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"5bddb28a-2a1a-4ea3-bf59-0b9762ad91cd\", \"type\": \"ColumnDataSource\"}, \"id\": \"ac1e4a90-289f-498f-87de-b63856406e5b\", \"glyph\": {\"id\": \"b8b96806-b9b2-4ede-89f9-479218ca7968\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"70d227e1-e193-4ccd-8412-13b56da1b14e\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"ac1e4a90-289f-498f-87de-b63856406e5b\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"dimension\": 0, \"ticker\": {\"id\": \"ca73b2cb-4e05-46d7-91a9-ba9117de7e46\", \"type\": \"BasicTicker\"}, \"id\": \"53349012-645d-4447-827a-bb86c5d6fcaa\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"bc0de009-0207-4098-9b4f-61db942afe5a\", \"type\": \"Plot\"}, \"doc\": null, \"tags\": []}, \"id\": \"53349012-645d-4447-827a-bb86c5d6fcaa\", \"type\": \"Grid\"}, {\"attributes\": {\"num_minor_ticks\": 5, \"doc\": null, \"id\": \"febb6bcb-bded-4d56-963b-a5bb55213dbe\", \"tags\": [], \"mantissas\": [2, 5, 10]}, \"id\": \"febb6bcb-bded-4d56-963b-a5bb55213dbe\", \"type\": \"BasicTicker\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"1852265e-3887-4688-90c0-cd59c2631c94\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"1852265e-3887-4688-90c0-cd59c2631c94\", \"type\": \"Line\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"ff1c73e0-8d7c-4329-8fdb-b2895bb76202\", \"data\": {\"x\": [0.04381100135895837, 0.08446103050759407], \"y\": [0.6792294813113713, 0.5990936282354037]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"ff1c73e0-8d7c-4329-8fdb-b2895bb76202\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"7daa3d31-3be0-4570-a5d2-0d95a199220b\", \"tags\": []}, \"id\": \"7daa3d31-3be0-4570-a5d2-0d95a199220b\", \"type\": \"Circle\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"a9bb9925-70fd-4de2-af08-78ab4694f2fd\", \"type\": \"ColumnDataSource\"}, \"id\": \"7df45f54-118c-4e2c-9665-a9d519e16360\", \"glyph\": {\"id\": \"fb0ac8fd-c6c1-4d75-9d00-8701c8612beb\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"7c6e6c51-a6e7-4c9a-842c-6cbdcd88ec97\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"7df45f54-118c-4e2c-9665-a9d519e16360\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"06aa10f1-88ea-4f5c-99be-217cbdea5a0a\", \"tags\": []}, \"id\": \"06aa10f1-88ea-4f5c-99be-217cbdea5a0a\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"1631a7a1-5fe4-4fc3-a1f8-11d00892e78f\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"1631a7a1-5fe4-4fc3-a1f8-11d00892e78f\", \"type\": \"Line\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"bc0de009-0207-4098-9b4f-61db942afe5a\", \"type\": \"Plot\"}, \"id\": \"35f13204-d4f1-4c4d-9748-ba465850e41e\", \"dimensions\": [\"width\", \"height\"], \"tags\": []}, \"id\": \"35f13204-d4f1-4c4d-9748-ba465850e41e\", \"type\": \"WheelZoomTool\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"fb0ac8fd-c6c1-4d75-9d00-8701c8612beb\", \"tags\": []}, \"id\": \"fb0ac8fd-c6c1-4d75-9d00-8701c8612beb\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"dcab00d7-4150-4a6d-8aa2-0ecc08402282\", \"tags\": []}, \"id\": \"dcab00d7-4150-4a6d-8aa2-0ecc08402282\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"7c6e6c51-a6e7-4c9a-842c-6cbdcd88ec97\", \"tags\": []}, \"id\": \"7c6e6c51-a6e7-4c9a-842c-6cbdcd88ec97\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"c3dbaeec-145b-477c-a262-68b46f7c8950\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"c3dbaeec-145b-477c-a262-68b46f7c8950\", \"type\": \"Line\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"70d227e1-e193-4ccd-8412-13b56da1b14e\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"70d227e1-e193-4ccd-8412-13b56da1b14e\", \"type\": \"Line\"}, {\"attributes\": {\"dimension\": 1, \"ticker\": {\"id\": \"febb6bcb-bded-4d56-963b-a5bb55213dbe\", \"type\": \"BasicTicker\"}, \"id\": \"fad90266-cefd-4f7f-a3ee-b1f1bb856512\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"bc0de009-0207-4098-9b4f-61db942afe5a\", \"type\": \"Plot\"}, \"doc\": null, \"tags\": []}, \"id\": \"fad90266-cefd-4f7f-a3ee-b1f1bb856512\", \"type\": \"Grid\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"80e634ac-a0fb-4273-8cb5-78b5fbb92a61\", \"type\": \"ColumnDataSource\"}, \"id\": \"76bbcec7-421e-4c79-94e1-b09a867f9349\", \"glyph\": {\"id\": \"c3dbaeec-145b-477c-a262-68b46f7c8950\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"7147b176-d6a7-4f4f-9e72-97db1b21850b\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"76bbcec7-421e-4c79-94e1-b09a867f9349\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"2b4c78a5-47b1-430d-aded-26297b1c25f5\", \"data\": {\"x\": [0.08446103050759407], \"y\": [0.5990936282354037]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"2b4c78a5-47b1-430d-aded-26297b1c25f5\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"e0f91f1d-32fb-4b92-8419-3c751cec51e6\", \"data\": {\"x\": [0.8536223874667421], \"y\": [1.0]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"e0f91f1d-32fb-4b92-8419-3c751cec51e6\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"start\": -0.1, \"callback\": null, \"id\": \"4310ae15-d546-4883-af0e-d5b47b5b3553\", \"doc\": null, \"tags\": [], \"end\": 1.1}, \"id\": \"4310ae15-d546-4883-af0e-d5b47b5b3553\", \"type\": \"Range1d\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"line_color\": {\"value\": \"#1f77b4\"}, \"doc\": null, \"id\": \"0dadf2cd-4f88-43a5-91d6-47549ad7fdc9\", \"x\": {\"field\": \"x\"}, \"y\": {\"field\": \"y\"}, \"tags\": []}, \"id\": \"0dadf2cd-4f88-43a5-91d6-47549ad7fdc9\", \"type\": \"Line\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"5bddb28a-2a1a-4ea3-bf59-0b9762ad91cd\", \"data\": {\"x\": [0.0, 0.04381100135895837], \"y\": [0.7979293402756517, 0.6792294813113713]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"5bddb28a-2a1a-4ea3-bf59-0b9762ad91cd\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"ff1c73e0-8d7c-4329-8fdb-b2895bb76202\", \"type\": \"ColumnDataSource\"}, \"id\": \"833d4b25-9e1a-4d33-9700-33b3d0e955d3\", \"glyph\": {\"id\": \"0dadf2cd-4f88-43a5-91d6-47549ad7fdc9\", \"type\": \"Line\"}, \"nonselection_glyph\": {\"id\": \"64034369-4aec-4e7f-a4e8-922f8becc753\", \"type\": \"Line\"}, \"tags\": []}, \"id\": \"833d4b25-9e1a-4d33-9700-33b3d0e955d3\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"80e634ac-a0fb-4273-8cb5-78b5fbb92a61\", \"data\": {\"x\": [0.08446103050759407, 0.5361542318115881], \"y\": [0.5990936282354037, 0.0]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"80e634ac-a0fb-4273-8cb5-78b5fbb92a61\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"doc\": null, \"plot\": {\"subtype\": \"Figure\", \"id\": \"bc0de009-0207-4098-9b4f-61db942afe5a\", \"type\": \"Plot\"}, \"id\": \"df936dab-4fc6-4bc8-8029-d23f1f8f076d\", \"tags\": []}, \"id\": \"df936dab-4fc6-4bc8-8029-d23f1f8f076d\", \"type\": \"HelpTool\"}, {\"attributes\": {\"line_alpha\": {\"value\": 1.0}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 1.0}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"695b9b3f-4f91-48c8-96b5-da1b6c07aa24\", \"tags\": []}, \"id\": \"695b9b3f-4f91-48c8-96b5-da1b6c07aa24\", \"type\": \"Circle\"}, {\"attributes\": {\"line_alpha\": {\"value\": 0.1}, \"doc\": null, \"x\": {\"field\": \"x\"}, \"line_color\": {\"value\": \"#1f77b4\"}, \"y\": {\"field\": \"y\"}, \"radius\": {\"value\": 0.05, \"units\": \"data\"}, \"fill_alpha\": {\"value\": 0.1}, \"fill_color\": {\"value\": \"#1f77b4\"}, \"id\": \"921c3dfc-be42-443f-9a91-677db8e4b5de\", \"tags\": []}, \"id\": \"921c3dfc-be42-443f-9a91-677db8e4b5de\", \"type\": \"Circle\"}, {\"attributes\": {\"selection_glyph\": null, \"doc\": null, \"data_source\": {\"id\": \"1977637d-4e7a-447d-be9e-d1058f4fb0ef\", \"type\": \"ColumnDataSource\"}, \"id\": \"c5880eed-ac1a-4837-9282-9cfcefc779a0\", \"glyph\": {\"id\": \"dcab00d7-4150-4a6d-8aa2-0ecc08402282\", \"type\": \"Circle\"}, \"nonselection_glyph\": {\"id\": \"921c3dfc-be42-443f-9a91-677db8e4b5de\", \"type\": \"Circle\"}, \"tags\": []}, \"id\": \"c5880eed-ac1a-4837-9282-9cfcefc779a0\", \"type\": \"GlyphRenderer\"}, {\"attributes\": {\"doc\": null, \"selected\": {\"2d\": {\"indices\": []}, \"1d\": {\"indices\": []}, \"0d\": {\"flag\": false, \"indices\": []}}, \"callback\": null, \"id\": \"a9bb9925-70fd-4de2-af08-78ab4694f2fd\", \"data\": {\"x\": [0.04381100135895837], \"y\": [0.6792294813113713]}, \"tags\": [], \"column_names\": [\"x\", \"y\"]}, \"id\": \"a9bb9925-70fd-4de2-af08-78ab4694f2fd\", \"type\": \"ColumnDataSource\"}, {\"attributes\": {\"ticker\": {\"id\": \"ca73b2cb-4e05-46d7-91a9-ba9117de7e46\", \"type\": \"BasicTicker\"}, \"id\": \"a452b4bd-c7b8-43f2-a692-3d5f1fdece67\", \"plot\": {\"subtype\": \"Figure\", \"id\": \"bc0de009-0207-4098-9b4f-61db942afe5a\", \"type\": \"Plot\"}, \"doc\": null, \"formatter\": {\"id\": \"337118b4-2577-4ba3-a577-bfb70dbb9d43\", \"type\": \"BasicTickFormatter\"}, \"tags\": []}, \"id\": \"a452b4bd-c7b8-43f2-a692-3d5f1fdece67\", \"type\": \"LinearAxis\"}];\n", | |
" Bokeh.load_models(all_models);\n", | |
" var plots = [{'modelid': 'bc0de009-0207-4098-9b4f-61db942afe5a', 'elementid': '#44bf5575-0ee6-4868-89f3-7ba83d0a1649', 'modeltype': 'Plot'}];\n", | |
" for (idx in plots) {\n", | |
" \tvar plot = plots[idx];\n", | |
" \tvar model = Bokeh.Collections(plot.modeltype).get(plot.modelid);\n", | |
" \tBokeh.logger.info('Realizing plot:')\n", | |
" \tBokeh.logger.info(' - modeltype: ' + plot.modeltype);\n", | |
" \tBokeh.logger.info(' - modelid: ' + plot.modelid);\n", | |
" \tBokeh.logger.info(' - elementid: ' + plot.elementid);\n", | |
" \tvar view = new model.default_view({\n", | |
" \t\tmodel: model,\n", | |
" \t\tel: plot.elementid\n", | |
" \t});\n", | |
" \tBokeh.index[plot.modelid] = view;\n", | |
" }\n", | |
" });\n", | |
" </script>\n", | |
"<div class=\"plotdiv\" id=\"44bf5575-0ee6-4868-89f3-7ba83d0a1649\"></div>\n", | |
"\n" | |
] | |
}, | |
"metadata": {}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"pts = nx.spectral_layout(G)\n", | |
"p = figure(\n", | |
" x_range = (-.1,1.1),\n", | |
" y_range = (-.1,1.1),\n", | |
" height= 400,\n", | |
" width= 400,\n", | |
")\n", | |
"for edge in G.edges():\n", | |
" p.line( \n", | |
" x= [pts[pt][0] for pt in edge],\n", | |
" y= [pts[pt][1] for pt in edge],\n", | |
" )\n", | |
"\n", | |
"for node in G.nodes():\n", | |
" p.circle( \n", | |
" x= [pts[node][0]],\n", | |
" y= [pts[node][1]],\n", | |
" radius=.05,\n", | |
" )\n", | |
"show(p)" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.4.3" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment