array-to-relational-converter

1.0.0 • Public • Published

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.

Package Sidebar

Install

npm i array-to-relational-converter

Weekly Downloads

0

Version

1.0.0

License

GPL

Unpacked Size

60.9 kB

Total Files

15

Last publish

Collaborators

  • redaty