Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
keen-react-charts
Advanced tools
npm install keen-react-charts --save
Use this component to create charts from the data received from the Keen's API. Charts expect a results prop of the response from the query or a raw object. All the configuration properties could be passed in props.
import React from 'react';
import ReactDOM from 'react-dom';
import Chart from 'keen-react-charts';
import KeenAnalysis from 'keen-analysis';
import 'keen-dataviz/dist/keen-dataviz.css';
import './styles/style.css';
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
type: 'funnel',
title: 'Actions and purchases',
labelMapping: {
pageviews: 'Pageviews',
banner_visibility: 'Banner visibility',
banner_clicks: 'Banner clicks',
signups: 'Signups',
},
funnel: {
lines: false,
percents: {
show: true,
},
resultValues: false
},
renderOnVisible: true
};
}
componentDidMount() {
const client = new KeenAnalysis({
projectId: 'YOUR_PROJECT_ID',
readKey: 'YOUR_READ_KEY'
})
.query({
analysis_type: 'funnel',
steps: [
{
event_collection: 'pageviews',
actor_property: 'user.uuid',
timeframe: {
start: '2019-03-13T00:00:00.000Z',
end: '2019-08-14T00:00:00.000Z'
}
},
{
event_collection: 'banner_visibility',
actor_property: 'user.uuid',
timeframe: {
start: '2019-03-13T00:00:00.000Z',
end: '2019-08-14T00:00:00.000Z'
}
},
{
event_collection: 'banner_clicks',
actor_property: 'user.uuid',
timeframe: {
start: '2019-03-13T00:00:00.000Z',
end: '2019-08-14T00:00:00.000Z'
}
},
{
event_collection: 'signups',
actor_property: 'user.uuid',
timeframe: {
start: '2019-03-13T00:00:00.000Z',
end: '2019-08-14T00:00:00.000Z'
}
}
],
})
.then((results) => {
this.setState({
results,
});
});
}
render() {
return (
<Chart {...this.state} />
);
}
}
ReactDOM.render(<App />, document.getElementById('app'));
Charts configurations you can check here: keen-dataviz.js
FAQs
React component of Data Visualization SDK for Keen IO
The npm package keen-react-charts receives a total of 198 weekly downloads. As such, keen-react-charts popularity was classified as not popular.
We found that keen-react-charts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.