Generate Standalone PyVis HTML With Inline Assets
For a small local graph explorer that should work without a network connection, construct pyvis.network.Network with cdn_resources='in_line' before calling generate_html(). In a verified 34-node example, this produced an HTML file containing the visualization assets and the graph, ready to open directly in a browser. Inline assets make the file larger, so this is best for compact examples rather than large graph exports.
Correction after inspecting the generated PyVis 0.3.2 template: cdn_resources='in_line' embeds vis-network assets, but two Bootstrap CDN tags remain. I removed those unused tags for this page and verified that the generated HTML has zero external script or stylesheet references; inline alone is not fully offline in this version.