Manta Developers
GitHub
Menu

Manta Horns

Dashboards over the knowledge graph that render on the server and hydrate in any React app.

Manta Horns adds dashboards to your app. A Horn is a JSON document: a set of views, each pairing a query against the knowledge graph with something that draws its rows, laid out on a 12-column grid. The server runs the queries as the signed-in viewer and returns a snapshot, and React draws the snapshot. Horns ships as four packages:

Package What it gives you
@manta-eu/horns The Horn and HornView schemas, realm helpers and the library resolver
@manta-eu/horns-client The Horns pages and embeds for a React app: routes, providers, views
@manta-eu/horns-kit The snapshot renderer, on a server and when it hydrates in the browser
@manta-eu/horns-server The Hono routes a Cloudflare Worker mounts to serve Horns

How the pieces fit

  1. Your app holds a Horn, either saved in the datastore or built in code.
  2. @manta-eu/horns-client posts it to /api/d/<datastore>/horns/snapshot on your own origin.
  3. @manta-eu/horns-server checks the viewer may read that datastore, runs each view’s query, and answers with a HornSnapshot: the rows, the labels and links for every IRI in them, and the plans behind each view.
  4. @manta-eu/horns-kit lays the snapshot out on the grid and draws each view.

The browser never queries the graph itself, and the server never trusts a datastore id it has not checked.

Embedding in your own app

For the lightest embed, use @manta-eu/horns-kit: it renders a chart or view on the server and hydrates only that in your page.

If your app sets a Content Security Policy, allow your Manta deployment, by default https://app.hiremanta.com, in connect-src, or the hydrated views cannot fetch their data.