OneAI analytics package


Keywords
react, typescript, oneAI
License
MIT
Install
npm install oneai-analytics@0.2.311

Documentation

One AI Analytics Treemap

One AI is a NLP as a service platform. Our API enables language comprehension in context, transforming texts from any source into structured data to use in code.

This treemap component is an easy API to display the results of our clustering skill.

Documentation

See the documentation

Getting started

Installation

npm install oneai-analytics

or using yarn

yarn add oneai-analytics

Example

See the online example

import { AnalyticsTreemap } from 'oneai-analytics-treemap';

const MyAnalyticsComponent = () => {
  return (
    <div style={{ display: 'grid', minHeight: '80vh' }}>
      <AnalyticsTreemap clusters={clusters} />
    </div>
  );
};

// clusters are the result of our clustering skill API
const clusters = [
  {
    skill: 'CLUSTER-TOPICS',
    text: 'Buy the dip',
    items_count: 12,
    span_text: 'Buy the dip',
    phrases: [
      {
        text: 'Buy the dip',
        items_count: 9,
        phrases: {
          'Buy the dip': 6,
          'I bought the dip': 2,
          'Buy the dips and hold': 1,
        },
      },
      {
        text: 'Buying The Dip πŸ’Žβœ‹',
        items_count: 3,
        phrases: {
          'Buying The Dip πŸ’Žβœ‹': 1,
          'Bought the Dip πŸš€πŸ¦': 1,
          'BUYING THE DIP! πŸš€πŸš€πŸš€': 1,
        },
      },
    ],
  },
  {
    skill: 'CLUSTER-TOPICS',
    text: 'SndlπŸš€πŸš€πŸš€',
    items_count: 4,
    span_text: 'SndlπŸš€πŸš€πŸš€',
    phrases: [
      {
        text: 'SndlπŸš€πŸš€πŸš€',
        items_count: 2,
        phrases: {
          'SndlπŸš€πŸš€πŸš€': 1,
          'πŸ’Ž': 1,
        },
      },
      {
        text: 'πŸ’ŽπŸ™ŒπŸ™ŒπŸ™ŒπŸ’Ž. πŸ¦πŸš€',
        items_count: 2,
        phrases: {
          'πŸ’ŽπŸ™ŒπŸ™ŒπŸ™ŒπŸ’Ž. πŸ¦πŸš€': 1,
          '🦍. πŸ’ŽπŸ™Œ': 1,
        },
      },
    ],
  },
];

Support

Feel free to submit issues in this repo, contact us at devrel@oneai.com, or chat with us on Discord

Contribute

PRs are welcomed!

First, clone the repo and install dependencies.

Develop:

yarn start

Test:

yarn test

Publish:

yarn publish

Run the exmaple:

cd example
yarn install
yarn start