Cube.js Analytics Framework

Intro

Visit Cubejs

Cubejs is an open source analytics framework that greatly simplifies running analytics queries. Cubejs comprises of a frontend library and backend analytical server infrastructure that Wisdom fully manages for you. Like many modern analytics frameworks, Cubejs differentiates between data dimensions (time, browser) and data measures (user count, unique page views).

Cubes

Cube NameCube Description
atomic.person
atomic.session
atomic.events
atomic.mail_inbox
virtual.pageviews
rollup

Example Code

JavaScript
import React from 'react';
import cubejs from '@cubejs-client/core';
import { QueryRenderer } from '@cubejs-client/react';
import { Spin } from 'antd';
import { Chart, Axis, Tooltip, Geom } from 'bizcharts';
import moment from 'moment';
const HACKER_NEWS_API_KEY = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpIjozODU5NH0.5wEbQo-VG2DEjR2nBpRpoJeIcE_oJqnrm78yUo9lasw';
const Example = (
<QueryRenderer
cubejsApi={cubejs(HACKER_NEWS_API_KEY)}
query={{
measures: ['Stories.count'],
dimensions: ['Stories.time.month']
}}
render={({ resultSet }) => {
if (!resultSet) return (<Spin />);
return (
<Chart
data={resultSet.chartPivot()}
scale={{ category: { tickCount: 8 } }}
height={400}
forceFit
>
<Axis name="category" label={{ formatter: v => moment(v).format("MMM 'YY") }} />
<Tooltip crosshairs={{ type: 'y' }} />
<Geom position="category*Stories.count" type="line" size={2} />
</Chat>
);
}}
/>;
);
export default Example;
;
Last updated on by John Gracey