VBI
Express analytical intent with DSLs. Build charts, dashboards, and insights through Builders.
VBI is a headless core library for analytics applications. It stores chart types, dimensions, measures, filters, and layouts in DSLs, and exposes public Builders for configuring and building them. The same analytical capabilities can serve different interfaces and integrations.
Quick start · Chart examples · Try it online
Features
Quick start
Build a column chart of total sales by region, using VQuery to query in-memory data and then generating a VSeed DSL. Run the code blocks in order in a single module that supports top-level await.
Install
Install VBI and the query and visualization dependencies used in this example.
Connect data
A connector provides field information and a query method. This example uses inline JSON data; your application can call its own data service inside the connector.
Configure a chart
Create a Builder from an empty chart DSL, then add the region dimension and the sales measure.
Render
Add a <div id="chart"></div> container to the page, then convert the VSeed DSL into a VChart spec.
VBI configuration and building do not depend on the DOM; the rendering step above runs in a browser. Tables and pivot charts can use VTable; see the VSeed quick start.
Core concepts
DSLs: analysis state you can save
Charts, Dashboards, and Insights each have a DSL for their configuration and content. chart.build() returns the current chart DSL. To restore it, create another Builder and ensure its connector is registered.
Builders: operations that maintain configurations
Builders expose domain operations for dimensions, measures, filters, and more, while maintaining DSL consistency. Interfaces call public APIs and render the resulting configurations. Subscribe to chart configuration changes with observeDeep() and undo or redo edits through undoManager.
Connectors: linking analysis to data
discoverSchema() returns field information, and query() executes a query and returns data. Connectors integrate data sources; the default chart adapters translate VBI configurations into VQuery and VSeed DSLs.
From a chart to a dashboard
Use vbi.dashboard to organize multiple charts, Insights, and layouts. Register reusable chart and insight resources through vbi.resources. The core library manages analysis configurations, while React or another interface handles interaction and rendering.
Next steps
- Chart examples: explore chart switching, filters, themes, and more.
- Standard practice: try an analytics interface built with Builders.
- Playground: edit configurations and inspect results online.
- API reference: browse instances, Builders, and resource management APIs.
- Introducing VQuery: learn about the data query layer.