Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: broken position adding #59

Merged
merged 2 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hetpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@



__version__ = '1.0.3'
__version__ = '1.0.3a'
__author__ = 'Fabian Kneissl'
__credits__ = 'Database Systems Research Group | Heidelberg University'

Expand Down
12 changes: 6 additions & 6 deletions hetpy/models/hetGraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,19 +460,19 @@ def export_to_json(self, filepath: str, layout_function='auto'):
"""
layout = self.graph.layout(layout=layout_function)
edges_json = []
for index, edge in enumerate(self.edges):
for edge in self.edges:
edge_dict = {e: getattr(edge, e) for e in dir(edge) if not e.startswith('__') and e != "nodes"}
edge_dict["source"] = edge.source.id
edge_dict["target"] = edge.target.id
edge_dict["position"] = {
"x": layout.coords[index][0],
"y": layout.coords[index][0]
}
edges_json.append(edge_dict)

nodes_json = []
for node in self.nodes:
for index, node in enumerate(self.nodes):
node_dict = {n: getattr(node, n) for n in dir(node) if not n.startswith('__')}
node_dict["position"] = {
"x": layout.coords[index][0],
"y": layout.coords[index][0]
}
nodes_json.append(node_dict)

path_definitions = []
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='hetpy',
version='1.0.3',
version='1.0.3a',
description='A package to handle heterogeneous information networks',
url='https://github.com/codingfabi/hetpy',
author='Fabian Kneissl',
Expand Down