A complete rewrite of PyNode for the modern era.
PyNode Next allows you to easily create beautiful graph visualisations and animations.
Getting Started
To get started, download the latest version of PyNode Next and place the folder in your project’s directory.
You will also need to make sure you have installed AlgorithmX.
Then just create a new file with code from the demo below and change the stuff inside run()
to be your code.
An API Reference for the methods provided by PyNode Next can be found by clicking the link in the navigation bar at the top of this page.
Demo
from pynode_next import *
def run():
for i in 'abc':
graph.add_node(i)
pause(100)
pause(500)
graph.add_edge('a', 'b')
graph.add_edge('b', 'c')
begin_pynode_next(run)
Migrating from PyNode
PyNode Next has been designed to maintain the vast majority of all of the functions from the previous version of PyNode.
Switching to PyNode Next should be as simple as replacing from pynode.main import *
with from pynode_next import *
.
And adding a _next
to the begin_pynode
function call.
PyNode | PyNode Next |
---|---|
|
|
Differences from the original PyNode
- Certain methods are strongly typed. Meaning that they only accept input of specific types. This is due to how the overloading system works, and will be documented whenever it pops up.
- Keyword arguments (that’s stuff like the
id=
inadd_node(id="a")
) might be broken in some methods due to the overloading system. - outline options on methods don’t exist any more. Text no longer has any outlines.
- You can no longer compare nodes with other nodes like
NodeA > NodeB
. To do this now, you need to specify the priority:NodeA.priority() > NodeB.priority()
- The above also applies to edges.
graph.random()
has been drastically simplified to just takeorder
andsize
arguments.