Theme Set Save

💄 Customize theme for G2, G2Plot of AntV(孵化中)

Project README

简体中文 | English

ThemeSet

📺 网站地址G2G2Plot

AntV ThemeSet 是一款在线主题构建工具,致力于帮助使用者(工程师或设计师)快速直观定制自己的主题配置文件

💡 如何使用

G2 提供了自定义主题机制以允许用户切换、定义图表主题。利用 ThemeSet 工具,工程师或者设计师可以在线设计图表通用主题规范,然后导出或复制主题配置,直接使用 registerTheme API 进行主题定制。

G2 中使用。详见:自定义主题 | G2

import { registerTheme } from '@antv/g2';

// 方式 1:
registerTheme('newTheme', {
  // 导出或复制出来的主题配置
});
chart.theme('newTheme');

// 方式 2:
chart.theme({
  // 导出或复制出来的主题配置
});

G2Plot 中使用。详见:图表主题 | G2Plot

import { G2 } from '@antv/g2plot';

// 方式 1:
G2.registerTheme('newTheme', {
  // 导出或复制出来的主题配置
});
const plot = new Line({
  // ... 折线图的其他配置
  theme: 'newTheme',
});
// 或者
plot.update({ theme: 'newTheme' });

// 方式 2:
const plot = new Line({
  // ... 折线图的其他配置
  theme: {
    // 导出或复制出来的主题配置
  },
});
// 或者
plot.update({
  theme: {
    // 导出或复制出来的主题配置
  },
});

⌨️ 参与贡献

# 克隆仓库
git clone [email protected]:antvis/theme-set.git

# 进入文件目录
cd theme-set

# 安装依赖和开始
npm install && npm start

# Open website: http://localhost:8000

📧 联系我们

钉钉群:30233731

Open Source Agenda is not affiliated with "Theme Set" Project. README Source: antvis/theme-set
Stars
35
Open Issues
0
Last Commit
2 years ago
Repository
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating