{"id":16282306,"url":"https://github.com/zsailer/nx_altair","last_synced_at":"2025-04-05T15:05:59.294Z","repository":{"id":32423715,"uuid":"133192635","full_name":"Zsailer/nx_altair","owner":"Zsailer","description":"Draw interactive NetworkX graphs with Altair","archived":false,"fork":false,"pushed_at":"2023-09-27T23:13:07.000Z","size":2788,"stargazers_count":224,"open_issues_count":10,"forks_count":26,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-29T14:08:40.706Z","etag":null,"topics":["altair","networkx","pandas","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zsailer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-05-13T00:10:12.000Z","updated_at":"2024-11-05T07:22:47.000Z","dependencies_parsed_at":"2022-08-07T17:30:18.348Z","dependency_job_id":"9752c3d7-f6b0-4688-831e-12acc843a4db","html_url":"https://github.com/Zsailer/nx_altair","commit_stats":{"total_commits":41,"total_committers":3,"mean_commits":"13.666666666666666","dds":0.2682926829268293,"last_synced_commit":"689467605b902a8214fa07ad3f1cc6d85d8f5150"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zsailer%2Fnx_altair","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zsailer%2Fnx_altair/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zsailer%2Fnx_altair/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zsailer%2Fnx_altair/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zsailer","download_url":"https://codeload.github.com/Zsailer/nx_altair/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353731,"owners_count":20925329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["altair","networkx","pandas","python"],"created_at":"2024-10-10T19:10:19.121Z","updated_at":"2025-04-05T15:05:59.259Z","avatar_url":"https://github.com/Zsailer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nx_altair\n\n*Draw NetworkX graphs with Altair*\n\n[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/nx_altair/Lobby?utm_source=share-link\u0026utm_medium=link\u0026utm_campaign=share-link)\n\n**nx_altair** offers a similar **draw** API to NetworkX but returns Altair Charts instead.\n\nIf you'd like to contribute, join the [Gitter chatroom](https://gitter.im/nx_altair/Lobby?utm_source=share-link\u0026utm_medium=link\u0026utm_campaign=share-link) and share your ideas! Also, checkout the [to-do list](#todo-list) below.\n\n## Examples\n\nIf you'd like to start playing with nx_altair, download [this notebook](examples/nx_altair-tutorial.ipynb)!\n\n### Simple graph\n\n```python\nimport networkx as nx\nimport nx_altair as nxa\n\n# Generate a random graph\nG = nx.fast_gnp_random_graph(n=20, p=0.25)\n\n# Compute positions for viz.\npos = nx.spring_layout(G)\n\n# Draw the graph using Altair\nviz = nxa.draw_networkx(G, pos=pos)\n\n# Show it as an interactive plot!\nviz.interactive()\n```\n\n\u003cimg src=\"docs/_img/readme.png\" width=\"350\"\u003e\n\n### Leverage Altair\n\n\u003cimg src=\"docs/_img/interactivity.gif\"\u003e\n\n\n### Customize the visualization\n\n**nx_altair** also supports many of the same arguments from NetworkX for styling your network--with an Altair twist! Map visualization attributes in a declarative manner.\n\n```python\nimport numpy as np\n\n# Add weights to nodes and edges\nfor n in G.nodes():\n    G.nodes[n]['weight'] = np.random.randn()\n\nfor e in G.edges():\n    G.edges[e]['weight'] = np.random.uniform(1, 10)\n\n\n# Draw the graph using Altair\nviz = nxa.draw_networkx(\n    G, pos=pos,\n    node_color='weight',\n    cmap='viridis',\n    width='weight',\n    edge_color='black',\n)\n\n# Show it as an interactive plot!\nviz.interactive()\n```\n\u003cimg src=\"docs/_img/readme2.png\" width=\"450\"\u003e\n\n\n## Install\n\nTo install from PyPI:\n\n```\npip install nx_altair\n```\n\nTo install for development, clone this repos and install using pip\n```\npip install -e .\n```\n\n## Contributing\n\nWe welcome pull requests! If you find a bug, we'd love for you to submit a PR. If you're not sure how to do that, check out this [simple guide](https://github.com/Zsailer/guide-to-working-as-team-on-github).\n\nIf you have a feature request, please open an issue or submit a PR!\n\n## Todo list\n\nA list of things to-do (good ideas for PRs).\n\n- [ ] Add `draw` method that mirrors networkx (easy)\n- [ ] Node color scale vmix, vmax (easy)\n- [ ] Edge color scale vmix, vmax (easy)\n- [ ] Node labels (medium)\n- [ ] Edge labels (medium)\n- [ ] Mouse-hover interactivity (medium)\n- [ ] Arrows for edges (hard)\n- [ ] Support for large (\u003e1000 edge) networks (hard)\n- [ ] Force-directed interactivity (very hard---beyond altair's current support).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzsailer%2Fnx_altair","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzsailer%2Fnx_altair","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzsailer%2Fnx_altair/lists"}