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
- Your app holds a
Horn, either saved in the datastore or built in code. @manta-eu/horns-clientposts it to/api/d/<datastore>/horns/snapshoton your own origin.@manta-eu/horns-serverchecks the viewer may read that datastore, runs each view’s query, and answers with aHornSnapshot: the rows, the labels and links for every IRI in them, and the plans behind each view.@manta-eu/horns-kitlays 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.
A Horn names the realm it was written for, and in this release that must be a realm Manta hosts. Horns needs a Manta account and a datastore, the same as the rest of the SDK.
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.
A Horns view in an app outside Manta reads data with the viewer’s Manta session, so it only works for someone signed
in to Manta in the same browser. Read-only embeds that use a custom app token arrive with
Horns 0.2.3 and the next @manta-eu/react.
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.