| Jun | JUL | Aug |
| 16 | ||
| 2019 | 2020 | 2021 |
COLLECTED BY
Collection: top_domains-02500
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';
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.category']
}}
render={({ resultSet }) => {
if (!resultSet) return <Spin />;
return (
<Chart data={resultSet.chartPivot()} height={400} forceFit>
<Axis name="category" />
<Axis name="Stories.count" />
<Tooltip />
<Geom type="interval" position="category*Stories.count" />
</Chart>
);
}}
/>;
export default Example;
Cube.js Data Schema
cube(`Stories`, {
sql: `select * from \`bigquery-public-data\`.hacker_news.stories`,
measures: {
count: {
type: `count`
}
},
dimensions: {
category: {
type: `string`,
case: {
when: [
{ sql: `STARTS_WITH(${title}, "Show HN")`,
label: `Show` },
{ sql: `STARTS_WITH(${title}, "Ask HN")`,
label: `Ask` }
],
else: { label: `Other` }
}
},
time: {
sql: `time_ts`,
type: `time`
},
title: {
sql: `title`,
type: `string`
}
}
});
Generated SQL
SQL Code Organization
Sooner or later, modeling even a dozen metrics with a dozen dimensions using pure SQL queries becomes a maintenance nightmare, which ends with you building a modeling framework.
Infrastructure
Cube.js provides key components every production-ready analytics solution requires: analytic SQL generation, query results caching and execution orchestration, data pre-aggregation, security, and API for query results fetch.
Performance
Cube.js has necessary infrastructure for every analytic application that heavily relies on its caching and pre-aggregation layer to provide sub-second API response times on a scale of a trillion data points.
Cube Cloud is a toolset that helps you leverage queries insights to improve your Cube.js performance. It identifies problems within your data
and points out to the solutions.
$ npm install -g cubejs-cli
2. Connect to Your Database
Connect to your existing data warehouse or set up a new one.
$ cubejs create hello-world -d postgres
3. Define Your Data Schema
Use Cube.js Schema to model raw data into meaningful business definitions.
Learn more
4. Visualize Results
Now you can use Cube.js client libraries and API to build analytics features directly into your apps.
Learn more
Get Started
Sign up for Cube.js Releases and Updates
Awesome product updates; no spam