forked from antvis/AVA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
149 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<img src="https://gw.alipayobjects.com/zos/antfincdn/R8sN%24GNdh6/language.svg" width="18"> [English](../README.md) | 简体中文 | ||
|
||
<h1 align="center"> | ||
<p>Chart Knowledge Base (CKB)</p> | ||
<span style="font-size: 24px;">AVA/knowledge</span> | ||
</h1> | ||
|
||
<div align="center"> | ||
|
||
数据可视化图表知识库 | ||
|
||
[![Version](https://badgen.net/npm/v/@antv/knowledge)](https://www.npmjs.com/@antv/knowledge) | ||
[![NPM downloads](http://img.shields.io/npm/dm/@antv/knowledge.svg)](http://npmjs.com/@antv/knowledge) | ||
![Latest commit](https://badgen.net/github/last-commit/antvis/knowledge) | ||
|
||
</div> | ||
|
||
Chart Knowledge Base (CKB) 是一个提供图表经验的知识库,它的形式基于 JSON。每个图表的知识结构类似这样: | ||
|
||
```js | ||
{ | ||
single_line_chart: { | ||
id: 'single_line_chart', | ||
name: 'Single Line Chart', | ||
alias: ['Line', 'Line Chart', 'Basic Line Chart'], | ||
family: ['LineCharts'], | ||
def: | ||
'A single line chart is a chart that uses one line with segments to show changes in data in a ordinal dimension.', | ||
purpose: ['Trend'], | ||
coord: ['Cartesian2D'], | ||
category: ['Statistic'], | ||
shape: ['Lines'], | ||
dataPres: [ | ||
{ minQty: 1, maxQty: 1, fieldConditions: ['Time', 'Ordinal'] }, | ||
{ minQty: 1, maxQty: 1, fieldConditions: ['Interval'] }, | ||
], | ||
channel: ['Position', 'Direction'], | ||
}, | ||
|
||
... | ||
} | ||
``` | ||
|
||
## 特性 | ||
|
||
### 图表分类信息的一致性 | ||
|
||
CKB 希望能解决目前可视化研究环境(特别是中文环境)中概念、术语不统一的问题。降低领域内研究和讨论的沟通成本。 | ||
|
||
我们基于数据可视化社区来共建一个图表知识库。每个参与者都可以提出自己对于图表的认识。我们会一起讨论来制定图表的名称、定义、分类和各种属性。 | ||
|
||
### 快速构建图表选择类产品 | ||
|
||
使用 CKB,你可以快速开发诸如图表类型字典、图表筛选、图表百科之类的产品和应用。比如: <img src="https://gw.alipayobjects.com/zos/antfincdn/1yMwFkBvyV/chartcube-logo-cube.svg" width="18"> [ChartCube](https://chartcube.alipay.com/guide) | ||
|
||
<div align="center"> | ||
<img src="https://gw.alipayobjects.com/zos/antfincdn/Q70gxQ1Tde/Screen%252520Shot%2525202020-02-18%252520at%2525207.14.29%252520AM.png" width="600" /> | ||
</div> | ||
|
||
### 智能图表推荐的基石 | ||
|
||
AVA 的智能图表推荐的能力是以 CKB 为依托的。有了 CKB,你也可以在它的基础上,指定自定义规则,搭建自己的图表推荐系统。 | ||
|
||
## 安装 | ||
|
||
```bash | ||
$ npm install @antv/knowledge | ||
``` | ||
|
||
## 用法 | ||
|
||
```js | ||
import { CKBJson } from '@antv/knowledge'; | ||
|
||
|
||
// 得到全量的英文图表知识库 | ||
const knowledgeBase = CKBJson(); | ||
|
||
// 得到只包含完整信息的图表构成的中文图表知识库 | ||
const zhCompletedKB = CKBJson('zh-CN', true); | ||
``` | ||
|
||
## 文档 | ||
|
||
更多用法请见 [API Reference](../API.md). | ||
|
||
## 证书 | ||
|
||
MIT | ||
|
||
## 友情链接 | ||
|
||
<img src="https://gw.alipayobjects.com/zos/antfincdn/1yMwFkBvyV/chartcube-logo-cube.svg" width="18"> [ChartCube](https://chartcube.alipay.com/) - 基于 [G2Plot](https://github.com/antvis/G2Plot) 的在线图表制作工具,交互简单,一键导出图表代码! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters