Cube.js Analytics Framework
Intro
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 Name | Cube Description |
|---|---|
| atomic.person | |
| atomic.session | |
| atomic.events | |
| atomic.mail_inbox | |
| virtual.pageviews | |
| rollup |
Example Code
- JS Code
- Cubejs Schema
- Generated SQL
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 = (<QueryRenderercubejsApi={cubejs(HACKER_NEWS_API_KEY)}query={{measures: ['Stories.count'],dimensions: ['Stories.time.month']}}render={({ resultSet }) => {if (!resultSet) return (<Spin />);return (<Chartdata={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;