Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@visactor/vchart-theme-converter

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@visactor/vchart-theme-converter

VChart theme converter between popular visualization libraries

latest
Source
npmnpm
Version
1.12.2
Version published
Maintainers
0
Created
Source

@visactor/vchart-theme-converter

Description

This plugin currently supports the mutual conversion between VChart themes and ECharts themes. Currently supported features include():

  • series theme config: line/area/bar/pie/funnel
  • component theme config: axis/crosshair/tooltip/title/discreteLegend

It is important to note that the theme conversion tool cannot completely cover the visual differences between the two chart libraries.

Usage

import { echartsToVChart, vchartToEcharts } from '@visactor/vchart-theme-converter';
import { VChart } from '@visactor/vchart';


// convert echarts theme to vchart theme
{
  const echartsTheme = {...}
  const vchartTheme = echartsToVChart(echartsTheme);
}

// convert vchart runtime theme to echarts theme
{
  const vchartTheme = VChart.ThemeManager.getCurrentTheme()
  const echartsTheme = vchartToEcharts(echartsTheme);
}

// convert custom vchart theme to echarts theme
{
  /**
   * When registering a custom VChart theme, it merges with the default theme to form a complete theme
   * configuration;
   * Therefore, it is recommended to register the custom theme first and obtain the complete theme configuration
   * before converting a custom VChart theme.
   */
  const vchartTheme = {...};
  VChart.ThemeManager.registerTheme('myTheme', vchartTheme);
  const echartsTheme = vchartToEcharts(VChart.ThemeManager.getTheme('myTheme'));
}

FAQs

Package last updated on 28 Oct 2024

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