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

Save/Load layouted graph (backend) #40

Open
Shadow992 opened this issue Apr 11, 2018 · 1 comment
Open

Save/Load layouted graph (backend) #40

Shadow992 opened this issue Apr 11, 2018 · 1 comment
Assignees

Comments

@Shadow992
Copy link
Collaborator

We also want to save the layouted graph in backend. However this needs some MMT work. But at first TGView has to implement #38 to get an overview of dependencies and problems.

@Shadow992
Copy link
Collaborator Author

Shadow992 commented May 4, 2018

Ok finally I am quite sure what to save in backend and how. We should aim for a JSON file with the following structure:

{
	"nodes": 
	{
		[
			{
				"id": "id of node",
				"label [optional]": "text of node",
				"style [optional]": "style/class of node",
				"shape [optional]": "shape of node; neccessary for frontend",
				"mathml [optional]": "mathml if needed/wanted",
				"previewhtml [optional]": "HTML to show in node as preview",
				"url [optional]": "URL of node",
				"x [optional]": "x position of node",
				"y [optional]": "y position of node"
			},
			...
		]
	},
	"edges":
	{
		[
			{
				"id": "id of edge",
				"from": "Node to start edge from (source node)",
				"to": "Node to connect edge from (target node)",
				"label [optional]": "text of edge",
				"style [optional]": "style/class of edge",
				"weight [optional]": "Weight of edge",
				"url [optional]": "URL of edge"
			},
			...
		]
	},
	"cluster [optional]":
	{
		[
			{
				"id": "id of cluster",
				"nodeIds": ["id of node 1", "id of node 2", ...],
				"nodePositions": [{"x": "old x position of node 1 before clustering","y": "old y position of node 1 before clustering"}, ...],
				"label [optional]": "text for cluster",
				"type [optional]": "Type of cluster: lock nodes to region or create one new cluster node",
				"x [optional]": "x position of cluster",
				"y [optional]": "y position of cluster"
			},
			...
		]
	}
}

This structure is very similar to the current structure, which the backend delivers. Therefore it should be easy to extend the backend and frontend to produce/save/read this structure.

@Jazzpirate What do you think? Is this a good structure to start with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants