Reterics / array-to-relational-converter

Create force data structure for force graphs of sankeys from array of objects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Array to Relational Converter

We can create Relational Data ({ nodes, links }) for graphs from Array of Objects. ([ {}, {} ])

For Relation based graphs, like Force Graph or Sankey we need to have this kind of data structure. Very useful for D3 js visualisations.


##Usage You can find example usage in example.js too. ###Method name: createForceFromArray()

const result = createForceFromArray(data, {
	paths:[
		{
			source:'sourceKey',
			target:'targetKey',
		},
		{
			source:'secondSourceKey',
			target:'secondTargetKey'
		}
	],
	circular:false,
	targetType:"id", //This can be 'id' or 'name' or 'reference'
	includedKeys:['extra'] //Keys connected to nodes
});

#Roadmap


Documentation is not detailed yet, because the project in under construction, but i will put more examples and explanation here and in my webpage.

About

Create force data structure for force graphs of sankeys from array of objects.

License:GNU General Public License v3.0


Languages

Language:JavaScript 100.0%