Module analyticsExperimental

@honua/sdk-js/analytics — the versioned linked-analytics and chart presentation contract.

Honua does not ship a chart suite. This entrypoint is the seam that lets a server-pushdown widget model, a bounded columnar reduction, a small accessible default presentation, and any specialist chart library share one filter / selection / temporal / capability / provenance model.

The barrel intentionally exports no chart adapters. Third-party adapters live behind their own subpath (@honua/sdk-js/analytics/uplot) and load their peer through a dynamic import, so an app that never charts pays nothing — which the /analytics bundle guard asserts structurally.

import { createWidgetSource } from "@honua/sdk-js/contract";
import {
acceptWidgetTimeSeriesArtifact,
createAnalyticsAdapterRegistry,
createAnalyticsLinkedSession,
createDefaultAnalyticsPresentation,
} from "@honua/sdk-js/analytics";

const widgets = createWidgetSource(source);
const response = await widgets.timeSeries({ field: "reported_at", interval: { unit: "day" } });
const artifact = acceptWidgetTimeSeriesArtifact(response, { artifactId: "incidents-by-day" });

const registry = createAnalyticsAdapterRegistry({
adapters: [createDefaultAnalyticsPresentation()],
});
const session = createAnalyticsLinkedSession({ view, artifact, registry });
await session.present({ target: panel });

Not yet covered by the SDK's semver contract — these shapes may change in any minor release prior to 1.0.0.

Index

Classes

Interfaces

Type Aliases

Variables

Functions