Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@eternum/chartisan_react

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eternum/chartisan_react

React adapter for any chartisan front-end on the web

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@eternum/chartisan_react

React adapter for any chartisan front-end on the web

NPM JavaScript Style Guide

Install

npm install @eternum/chartisan_react

Usage

First create a Chart component and pass the Chartisan instance of your desired front-end library.

import React, { FC } from 'react'
import { Chartisan, CC } from '@chartisan/echarts'
import { ChartisanChart, ChartProps } from '@chartisan/react'

export { useChartControls } from '@chartisan/react'
export type { CC }

export const Chart: FC<ChartProps<CC>> = (props) => {
  return <ChartisanChart chartisan={Chartisan} {...props} />
}

Then you can use the Chart as a component and give it the needed options. You can also use the chart controls to create, update or destroy charts.

import React from 'react'

import { Chart, useChartControls, CC } from './Chart'

const options = { url: `http://127.0.0.1:9000` }
const updateOptions = { background: true }

const App = () => {
  const controls = useChartControls<CC>({ initOnDemand: true })
  return (
    <>
      <button onClick={() => controls.create()}>Create Chart</button>
      <button onClick={() => controls.update()}>Update Chart</button>
      <button onClick={() => controls.destroy()}>Destroy Chart</button>
      <Chart height={500} options={options} updateOptions={updateOptions} controls={controls} />
    </>
  )
}

export default App

License

MIT © ConsoleTVs

FAQs

Package last updated on 28 Jun 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc