npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

echarts-jsx

v1.2.1

Published

A real JSX wrapper for ECharts based on TypeScript & Web components

Downloads

194

Readme

ECharts JSX

A real JSX wrapper for ECharts based on TypeScript & Web components

NPM Dependency CI & CD

NPM

Features

  • [x] All kinds of options & event handlers can be write in JSX syntax
  • [x] Tree shaking supported based on ECMAScript 6+ modules

Versions

| SemVer | branch | status | component API | | :----: | :------: | :----------: | :------------: | | >=1 | main | ✅developing | Web components | | <1 | master | ❌deprecated | React |

Installation

Core package

npm i echarts-jsx

View renderer

Any kinds of Render engines that you like can be used to render ECharts JSX tags.

React 19+

Old versions have a property bug of Custom elements: https://github.com/facebook/react/issues/11347

npm i react@^19 react-dom@^19

Preact

npm i preact

then configure your tool-chain: https://preactjs.com/guide/v10/getting-started#integrating-into-an-existing-pipeline

and write chart codes as this demo: https://idea2app.github.io/React-MobX-Bootstrap-ts/#/chart

DOM Renderer v2 & WebCell v3

npm i dom-renderer@^2

then configure your project as the demo code.

Vue 3

npm create vite vue-echarts-app -- --template vue-ts

then configure your Vite as following code:

import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';

export default defineConfig({
    plugins: [
        vue({
            template: {
                compilerOptions: {
                    isCustomElement: tag => tag.startsWith('ec-')
                }
            }
        })
    ]
});

and write chart codes as this demo: https://idea2app.github.io/Vue-Prime-ts/#/chart

Simple example

Origin: ECharts official example

Edit ECharts-JSX-1.0-demo

import { render } from 'react-dom';
import 'echarts-jsx';

render(
    <ec-svg-renderer theme="dark" style={{ width: '100%', height: '75vh' }}>
        <ec-title text="ECharts Getting Started Example" />

        <ec-legend data={['sales']} />

        <ec-tooltip />

        <ec-x-axis
            data={[
                'Shirts',
                'Cardigans',
                'Chiffons',
                'Pants',
                'Heels',
                'Socks'
            ]}
        />
        <ec-y-axis />

        <ec-bar-chart
            name="sales"
            data={[5, 20, 36, 10, 10, 20]}
            onClick={console.log}
        />
    </ec-svg-renderer>,
    document.body
);

Inspired by

  1. https://recharts.org/
  2. https://github.com/somonus/react-echarts
  3. https://github.com/idea2app/ECharts-model
  4. https://codesandbox.io/s/echarts-react-yoxstm

User cases

  1. China Open-source Map