How to pass in layout positions to the visualization#
Add x, y columns to the node table
Add the url parameter “play=0” to prevent the page load to run clustering.
[1]:
import pandas as pd
import graphistry
# To specify Graphistry account & server, use:
# graphistry.register(api=3, username='...', password='...', protocol='https', server='hub.graphistry.com')
# For more options, see https://github.com/graphistry/pygraphistry#configure
1. Nodes should have columns “x”, “y”
[2]:
edges = pd.DataFrame({'s': [0,1,2, 3], 'd': [1,2,3, 0]})
nodes = pd.DataFrame({'n': [0,1,2, 3], 'x': [0, 0, 1, 1], 'y': [0, 5, 5, 0]})
2. The bindings should include “.settings(url_params={‘play’: 0})”
[3]:
graphistry\
.settings(url_params={'play': 0})\
.nodes(nodes).edges(edges)\
.bind(source='s', destination='d', node='n')\
.plot()
[3]:
[ ]: