array-to-relational-converter
v1.0.0
Published
This code can create Relational data (nodes,links) for graphs made by D3 js and others from Array of Objects.
Downloads
2
Maintainers
Readme
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.