JSPM

@visactor/vchart

1.12.16-alpha.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5298
  • Score
    100M100P100Q136754F
  • License MIT

charts lib based @visactor/VGrammar

Package Exports

  • @visactor/vchart
  • @visactor/vchart/build
  • @visactor/vchart/build/es5
  • @visactor/vchart/build/es5/index.js
  • @visactor/vchart/build/index.js
  • @visactor/vchart/cjs/index.js
  • @visactor/vchart/esm/component/interface/type
  • @visactor/vchart/esm/component/interface/type.js
  • @visactor/vchart/esm/index.js
  • @visactor/vchart/esm/plugin/base/base-plugin
  • @visactor/vchart/esm/plugin/base/base-plugin.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@visactor/vchart) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

VChart

VChart is a charting component library in VisActor visualization system. It wraps the charting logic based on visual grammar library VGrammar and the component encapsulation based on visual rendering engine VRender. The core capabilities are as follows:

  1. Cross-platform: Automatically adapt to desktop, H5, and multiple small program environments
  2. Storytelling: Comprehensive annotation, animation, flow control, narrative templates, and other enhanced features for visual storytelling
  3. Scenes: Deliver visual storytelling capabilities to end-users, unlock developer productivity

🔨 Usage

📦 Installation

# npm
$ npm install @visactor/vchart

# yarn
$ yarn add @visactor/vchart

📊 A Chart Example

import VChart from '@visactor/vchart';

const spec = {
  type: 'bar',
  data: [
    {
      id: 'barData',
      values: [
        { month: 'Monday', sales: 22 },
        { month: 'Tuesday', sales: 13 },
        { month: 'Wednesday', sales: 25 },
        { month: 'Thursday', sales: 29 },
        { month: 'Friday', sales: 38 }
      ]
    }
  ],
  xField: 'month',
  yField: 'sales',
  crosshair: {
    xField: { visible: true }
  }
};

// 'chart' is the id of your dom container, such as <div id="chart"></chart>
const vchart = new VChart(spec, { dom: 'chart' });
vchart.renderAsync();

⌨️ Development

First of all, please install @microsoft/rush

$ npm i --global @microsoft/rush

Then clone locally:

# clone
$ git clone git@github.com:VisActor/VChart.git
$ cd VChart
# install dependencies
$ rush update
# start vchart development server
$ rush start
# the another way to start react-vchart development server
$ rush run -p @visactor/vchart -s start
# unit test
$ rush run -p @visactor/vchart -s test