Search code examples
angularjsd3.jsontologyjson-ldgraph-visualization

jsonLD to graphical representationnot working


I am trying to draw a graph from my ontology which is in RDF format.I am following "https://github.com/scienceai/jsonld-vis" repositry to develop.I am getting error when trying to replicate the above github code.I am adding my code for the aobve implemetation HERE

I came across many comments saying above github repositry works.But i am not to figure it out. Please help

d3.jsonldVis(mockData, '#graph', {
  w: 800,
  h: 600,
  maxLabelWidth: 250,
  tipClassName: 'tip-class'
});

If there are any other libraries i can use to implement the above in angularjs,javascript environment please mention.


Solution

  • I'm not sure if this is to be answered but anyway with minor changes the example can be reproduced:

    Minor Changes:

    1. The MAIN code to initiate jsonld-vis index.js wasn't being included
    2. CSS included as a script??? Probably a mistake. Added a link tag to include it.
    3. The library is based on d3 version 3 and you were trying to include the latest (i.e. v5.6)
    4. You don't need to use the import statements here. Read more about import here or here

    Fork: https://plnkr.co/edit/KkNHWQa0xxiotB4tN7Ru?p=preview

    Suggestions? d3 Collapsible Tree is a great viz that you can refer to and customize as per your requirements.