0.3.0 • Public • Published


BODS-Dagre is a small javascript library for automatic generation of directed graphs representing Beneficial Ownership Data for the web. It relies on d3, dagre-d3 and bezier-js to do all the heavy lifting.

The tool accepts Beneficial Ownership Data (JSON) as input and outputs SVG content on a webpage which contains the appropriate placeholder HTML.

For a hosted version you can use directly, see our main website's installation

Installation & Usage

Through your package manager:

$ npm install @openownership/bods-dagre

Or as a script tag:

<script src="https://unpkg.com/@openownership/bods-dagre/dist/bods-dagre.js"></script>

Then in your application:

// Your BODS data
const data = JSON.parse('some JSON string');
// Where you want the SVG drawn
const container = document.getElementById('some-id');
// Where you're serving the bundled images from (see below)
const imagesPath = '/some/folder';
// Set a node limit above which labels will no longer be shown 
const labelLimit = 8

BODSDagre.draw(data, container, imagesPath);

Full demo applications are hosted from this repo:


The library includes license-free SVG images for world flags, as well as some generic icons from our Beneficial Ownership Visualisation System.

You can find these inside the dist/images folder, but you need to make them available at some URL path in your application and tell the library what that path is when you call it.


The functionality has been included for two zoom buttons. These must be added to the page, along with the placeholder, with the correct IDs for the code to pick them up:

<button id="zoom_in">+</button>
<button id="zoom_out">-</button>

Node types

At present the tool provides visualisation of the following entity types (based on personStatements and entityStatements):

  • knownPerson
  • anonymousPerson
  • unknownPerson
  • registeredEntity
  • registeredEntityListed
  • legalEntity
  • arrangement
  • anonymousEntity
  • unknownEntity
  • state
  • stateBody

If the entity type is not recognised then it will default to the unknown type.

Country flags

If the country is not present or is not recognised then no flag will be displayed.


Please see the developer guide for more information.







Apache License 2.0

Unpacked Size

4.86 MB

Total Files


Last publish


  • openownership-bot
  • steveday