Data Visualization SDK for Keen IO
npm install @keen.io/dataviz@keen.io/dataviz
The @keen.io/dataviz is abstraction layer that connects Keen API with visualization components.
It allows to seamlessly embed and deliver metrics within your user interface with minimal effort.
For Front-End applications use standard npm or yarn package manager.
``sh`
yarn add @keen.io/dataviz
For direct website integration embed a script with @keen.io/dataviz that is hosted on CDN.
`js`
Renders metrics based on specified settings and analysis results.
`typescript
const result = await client.query({
analysisType: 'count',
eventCollection: 'pageviews',
timeframe: 'this_14_days'
});
const chart = new DataViz({ type: 'bar', container: '#container' })
.render(result);
`
The presentationTimezone argument could be used to adjust visualizations to specified timezone or convert UTC ISO string dates based on defined offset in minutes.
`typescript
const result = await client.query({
analysisType: 'count',
eventCollection: 'pageviews',
interval: 'daily',
timeframe: 'this_7_days'
});
const chart = new DataViz({
type: 'area',
container: '#container',
presentationTimezone: 'America/New_York' // -600
}).render(result);
``
For more code examples check the Keen Storybook.
This project targeting all modern browsers.