diff --git a/.dumi/pages/case/index.en.tsx b/.dumi/pages/case/index.en.tsx index 3162ba81f..50097c1aa 100644 --- a/.dumi/pages/case/index.en.tsx +++ b/.dumi/pages/case/index.en.tsx @@ -1,8 +1,8 @@ -import Case from './index' import React from 'react'; +import Case from './index'; const CaseIndex: React.FC = () => { - return + return ; }; -export default CaseIndex +export default CaseIndex; diff --git a/.dumi/pages/case/index.tsx b/.dumi/pages/case/index.tsx index fa5daeb98..f1cf22259 100644 --- a/.dumi/pages/case/index.tsx +++ b/.dumi/pages/case/index.tsx @@ -1,9 +1,9 @@ -import React from 'react'; import SEO from '@antv/dumi-theme-antv/dist/common/SEO'; -import ShowCase from 'site/components/ShowCase/ShowCase'; -import { useIntl, useLocale } from 'dumi'; -import { Header } from '@antv/dumi-theme-antv/dist/slots/Header'; import { Footer } from '@antv/dumi-theme-antv/dist/slots/Footer'; +import { Header } from '@antv/dumi-theme-antv/dist/slots/Header'; +import { useIntl, useLocale } from 'dumi'; +import React from 'react'; +import ShowCase from 'site/components/ShowCase/ShowCase'; const CaseIndex: React.FC = () => { const locale = useLocale(); diff --git a/.dumi/pages/quick/index.en.tsx b/.dumi/pages/quick/index.en.tsx index cdc42fadb..eab80b405 100644 --- a/.dumi/pages/quick/index.en.tsx +++ b/.dumi/pages/quick/index.en.tsx @@ -1,8 +1,8 @@ -import Case from './index' import React from 'react'; +import Case from './index'; const QuickIssueIndex: React.FC = () => { - return + return ; }; -export default QuickIssueIndex +export default QuickIssueIndex; diff --git a/.dumi/pages/quick/index.tsx b/.dumi/pages/quick/index.tsx index 4b5f38eba..6f83e3ee4 100644 --- a/.dumi/pages/quick/index.tsx +++ b/.dumi/pages/quick/index.tsx @@ -1,8 +1,8 @@ -import React from 'react'; import SEO from '@antv/dumi-theme-antv/dist/common/SEO'; -import { useIntl, useLocale } from 'dumi'; -import { Header } from '@antv/dumi-theme-antv/dist/slots/Header'; import { Footer } from '@antv/dumi-theme-antv/dist/slots/Footer'; +import { Header } from '@antv/dumi-theme-antv/dist/slots/Header'; +import { useIntl, useLocale } from 'dumi'; +import React from 'react'; import QuickIssue from 'site/components/quickIssue/QuickIssue'; const QuickIssueIndex: React.FC = () => { diff --git a/.dumi/theme/locales/en.json b/.dumi/theme/locales/en.json index 3df6da8f5..836d0c47c 100644 --- a/.dumi/theme/locales/en.json +++ b/.dumi/theme/locales/en.json @@ -329,11 +329,11 @@ "邻近顺序色板,均基于分类色板生长而来,为加大辨识度也可使用邻近色相,通过明度或饱和度的渐变,常用来表示同一事物中的数值大小或梯度变化,如排行榜等级变化、一个国家或地区的新增人口数对比、风险等级变化等。": "Adjacent sequential color palette, all based on the growth of the classification color palette, in order to increase the recognition can also use adjacent colors, through the gradual change of brightness or saturation, commonly used to represent the value size or gradient change in the same thing, such as ranking change, comparison of the number of new population in a country or region, risk level change.", "点再到正向值的连续变化区间,显示相对立的两个值的大小关系,常用于气温的冷热、海拔高低、股票涨跌等。": "The continuous change interval from the point to the positive value shows the size relationship between the two opposite values, which is often used for the cold and hot temperature, altitude, stock rise and fall, etc.", "柱形图、饼图、关系图、地图、多维表格等260+丰富图表随心选用": "Column、Pie、Graph、Map、Dimensions Table and other 260+ rich chart choice at will.", - + "设计语言与研发框架": "Design language and R&D framework", "资产一览,让你快速搭建网站应用": "Assets list, let you quickly build a website application.", "Ant Design / AntV 设计负责人": "Ant Design / AntV Design Leader", "地理空间数据": "For Geospacial Data", "267 全系 F 版": "F2、6、7", "蚂蚁企业级数据可视化解决方案,让人们在数据世界里获得视觉化思考能力": "Ant enterprise data visualization solutions, so that people in the data world to get the ability to think visually." -} \ No newline at end of file +} diff --git a/.dumi/theme/locales/zh.json b/.dumi/theme/locales/zh.json index 2bc9dc01c..39b8457f8 100644 --- a/.dumi/theme/locales/zh.json +++ b/.dumi/theme/locales/zh.json @@ -328,4 +328,4 @@ "地理空间数据": "地理空间数据", "267 全系 F 版": "267 全系 F 版", "蚂蚁企业级数据可视化解决方案,让人们在数据世界里获得视觉化思考能力": "蚂蚁企业级数据可视化解决方案,让人们在数据世界里获得视觉化思考能力" -} \ No newline at end of file +} diff --git a/.dumirc.ts b/.dumirc.ts index cd513c231..3b5ac54cd 100644 --- a/.dumirc.ts +++ b/.dumirc.ts @@ -1,32 +1,39 @@ import { defineConfig } from 'dumi'; -import { repository, version, homepage } from './package.json'; +import { homepage, repository } from './package.json'; export default defineConfig({ - locales: [{ id: 'zh', name: '中文' }, { id: 'en', name: 'English' }], - favicons: ['https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*7svFR6wkPMoAAAAAAAAAAAAADmJ7AQ/original'], // 网站 favicon - metas: [ // 自定义 meta 标签 + locales: [ + { id: 'zh', name: '中文' }, + { id: 'en', name: 'English' }, + ], + favicons: [ + 'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*7svFR6wkPMoAAAAAAAAAAAAADmJ7AQ/original', + ], // 网站 favicon + metas: [ + // 自定义 meta 标签 { name: 'keywords', content: 'AntV' }, { name: 'description', content: 'Ant Visualization solution' }, ], themeConfig: { title: 'AntV', description: 'Ant Visualization solution', - defaultLanguage: 'zh', // 默认语言 - isAntVSite: true, // 是否是 AntV 的大官网 + defaultLanguage: 'zh', // 默认语言 + isAntVSite: true, // 是否是 AntV 的大官网 footerTheme: 'light', - siteUrl: homepage, // 官网地址 - githubUrl: repository.url, // GitHub 地址 - showSearch: true, // 是否显示搜索框 - showGithubCorner: true, // 是否显示头部的 GitHub icon - showAntVProductsCard: true, // 是否显示 AntV 产品汇总的卡片 - showLanguageSwitcher: true, // 是否显示官网语言切换 - showWxQrcode: true, // 是否显示头部菜单的微信公众号 - docsearchOptions: { // 头部搜索框配置 + siteUrl: homepage, // 官网地址 + githubUrl: repository.url, // GitHub 地址 + showSearch: true, // 是否显示搜索框 + showGithubCorner: true, // 是否显示头部的 GitHub icon + showAntVProductsCard: true, // 是否显示 AntV 产品汇总的卡片 + showLanguageSwitcher: true, // 是否显示官网语言切换 + showWxQrcode: true, // 是否显示头部菜单的微信公众号 + docsearchOptions: { + // 头部搜索框配置 apiKey: '9d1cd586972bb492b7b41b13a949ef30', indexName: 'antv_g6', }, navs: [ { - slug: 'docs/specification', + slug: 'docs/specification/principles/basic', title: { zh: '设计语言', en: 'Design', @@ -43,12 +50,12 @@ export default defineConfig({ slug: 'quick', title: { zh: '提交 Issue', - en: 'Quick Issue' - } - } + en: 'Quick Issue', + }, + }, ], - ecosystems: [ // 头部的菜单中的「周边生态」 - + ecosystems: [ + // 头部的菜单中的「周边生态」 ], docs: [ { @@ -118,8 +125,7 @@ export default defineConfig({ order: 1, }, ], - examples: [ - ], + examples: [], mdPlayground: { // 第一个分块的大小 splitPaneMainSize: '62%', @@ -152,8 +158,6 @@ export default defineConfig({ // 百度统计的 key // baidu: 'baidu_tongji_key', }, - links: [ - ], - scripts: [ - ], + links: [], + scripts: [], }); diff --git a/docs/specification/language/basic.en.md b/docs/specification/language/basic.en.md index 501d1ba8d..e4888db5f 100644 --- a/docs/specification/language/basic.en.md +++ b/docs/specification/language/basic.en.md @@ -3,4 +3,4 @@ title: Visual order: 0 --- - + diff --git a/docs/specification/language/interact.en.md b/docs/specification/language/interact.en.md index d364965c2..ced40ab67 100644 --- a/docs/specification/language/interact.en.md +++ b/docs/specification/language/interact.en.md @@ -3,4 +3,4 @@ title: Interact order: 2 --- - + diff --git a/docs/specification/language/interact.zh.md b/docs/specification/language/interact.zh.md index c19bd951c..71c014123 100644 --- a/docs/specification/language/interact.zh.md +++ b/docs/specification/language/interact.zh.md @@ -11,11 +11,9 @@ Shneiderman [1] 提出了经典的可视化信息交互策略:概览、缩放 经过业务的实践和沉淀,AntV 从用户视角出发,按照用户的目标和行为对可视化交互进行梳理。我们发现用户在进行可视化数据分析时,通常会经历三个步骤,分别为「看数-分析-洞察」。 -**看数:** 主要指用户获取数据并初步可视化加工和阅读查看的行为。 -**分析:** 主要指用户对数据进行调整,从更多角度进行看数的行为。 -**洞察:** 主要指用户通过交互强化洞见,并对结果进行流转的行为。 +**看数:** 主要指用户获取数据并初步可视化加工和阅读查看的行为。 **分析:** 主要指用户对数据进行调整,从更多角度进行看数的行为。 **洞察:** 主要指用户通过交互强化洞见,并对结果进行流转的行为。 -基于更多的业务调研和桌面调研,我们总结出常见的24类可视化交互,这是我们从用户视角出发的最全归纳。 +基于更多的业务调研和桌面调研,我们总结出常见的 24 类可视化交互,这是我们从用户视角出发的最全归纳。 @@ -53,24 +51,24 @@ AntV 5.0 的设计价目标是让用户更有信任感、轻松感和意义感 除了少思考和少操作以外,我们建议可以提供类似右键菜单的能力,让用户产生分析意图时即可所见即所得的获取分析工具,并对对象快速进行分析探索。 -### 意义感 +### 意义感 增强分析的能力,让用户更易洞察。 -用户在分析探索时,适时的画龙点睛之笔可以让洞察更直观的展现在分析者面前,一条辅助线和一块参考区间便可以快速的将机会点或者风险点清晰的暴露出来。但是如果这个时候如果用户需要填写复杂的表单才能记录自己的洞察,那么在复杂的操作间,灵感可能会稍纵即逝。 -我们建议为用户匹配更直观的交互语言,让用户抓住时机,快速沉淀洞察记录观点。如上图:用户在标注辅助线时原需要填写复杂的表单才能完成诉求,如果我们支持用直接长按坐标轴X即可添加辅助线,那么用户将获得更自由的交互体验,洞察也可被更快获取。 +用户在分析探索时,适时的画龙点睛之笔可以让洞察更直观的展现在分析者面前,一条辅助线和一块参考区间便可以快速的将机会点或者风险点清晰的暴露出来。但是如果这个时候如果用户需要填写复杂的表单才能记录自己的洞察,那么在复杂的操作间,灵感可能会稍纵即逝。我们建议为用户匹配更直观的交互语言,让用户抓住时机,快速沉淀洞察记录观点。如上图:用户在标注辅助线时原需要填写复杂的表单才能完成诉求,如果我们支持用直接长按坐标轴 X 即可添加辅助线,那么用户将获得更自由的交互体验,洞察也可被更快获取。   + ## 03 设计策略 -带着上面三个目标,我们对24种常见交互进行了设计迭代,沉淀了9+设计策略和20+设计案例,且会持续更新。 -本篇将对每个策略挑选一个案例进行简单说明。 +带着上面三个目标,我们对 24 种常见交互进行了设计迭代,沉淀了 9+设计策略和 20+设计案例,且会持续更新。本篇将对每个策略挑选一个案例进行简单说明。   + ### 信任感 #### 👀 有前馈 @@ -122,7 +120,7 @@ AntV 5.0 的设计价目标是让用户更有信任感、轻松感和意义感   -更多设计案例和设计Tips可查看: AntV 交互设计工具箱 +更多设计案例和设计 Tips 可查看: AntV 交互设计工具箱   @@ -146,6 +144,7 @@ AntV 5.0 的设计价目标是让用户更有信任感、轻松感和意义感   + ### 分析 @@ -176,6 +175,7 @@ AntV 5.0 的设计价目标是让用户更有信任感、轻松感和意义感
  + ### 洞察 @@ -189,9 +189,4 @@ AntV 5.0 的设计价目标是让用户更有信任感、轻松感和意义感 ## 参考文献 -[1] Schneiderman B. The eyes have it: a task by data type taxonomy forinformation\visualizations[J]. Craft of Information Visualization, 1996:364-371. -[2] Dix, Alan, Ellis, Geoffrey. Starting simple: adding value to static visualisation throughsimple interaction[J]. 1998. -[3]李洪海,齐兵.界面设计中交互行为的分类[J].艺术与设计:理论,2013(11):119-121. -[4]Landesberger T V, Fiebig S, Bremm S, et al. Interaction Taxonomy for Tracking of UserActions in Visual Analytics Applications[J]. 2014:653-670. -[5] Gotz D, Zhou M X. Characterizing users' visual analytic activity for insightprovenance[C]// IEEE Symposium on Visual Analytics Science & Technology. 2008. -[6]:Donald A.Norman.《设计心理学1》[M]. +[1] Schneiderman B. The eyes have it: a task by data type taxonomy forinformation\visualizations[J]. Craft of Information Visualization, 1996:364-371. [2] Dix, Alan, Ellis, Geoffrey. Starting simple: adding value to static visualisation throughsimple interaction[J]. 1998. [3]李洪海,齐兵.界面设计中交互行为的分类[J].艺术与设计:理论,2013(11):119-121. [4]Landesberger T V, Fiebig S, Bremm S, et al. Interaction Taxonomy for Tracking of UserActions in Visual Analytics Applications[J]. 2014:653-670. [5] Gotz D, Zhou M X. Characterizing users' visual analytic activity for insightprovenance[C]// IEEE Symposium on Visual Analytics Science & Technology. 2008. [6]:Donald A.Norman.《设计心理学 1》[M]. diff --git a/docs/specification/language/media.en.md b/docs/specification/language/media.en.md index b2830a909..d37bcd15b 100644 --- a/docs/specification/language/media.en.md +++ b/docs/specification/language/media.en.md @@ -3,89 +3,4 @@ title: Media order: 3 --- -## 为什么需要响应式 - -数据可视化始终面对无限(海量)数据与有限屏幕空间的冲突,如何解决不同端、不同屏幕尺寸下内容的适配问题,在有限的空间内帮助用户更快地理解信息和获取洞见,是我们一直致力研究的问题。如果可视化图表缺少合适的布局方案,看似美好的设计稿,在灌入未知体量的数据或者改变尺寸时会变得惨不忍睹。 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*J33ZRbJy4swAAAAAAAAAAAAAARQnAQ) - -## 挑战 - -- 图表本身构成复杂; -- 数据体量不可预知; -- 设计者对显示的不足做点状修补,无法给出体系化的解决方案; -- 开发者欠缺专业的可视化知识; -- 开发者依赖底层组件能力,无法二次改造。 - -## 如何解决 - -### 信息响应原则 - -- **宏观:**保证核心信息优先展示,体现数据主要特征。 - -折线图展现趋势和变化,柱形图展现排名和分布,饼图展示占比。 - -- **微观:**空间有限时,体现主要信息,保留图形特征。 - -所有尺寸下细节信息都能通过交互获取到。 - -### 对应技术方案 - -数据可视化的响应式设计包括“响应式”与“自适应” - -- Responsive design 响应式:缩放图表其结构和外观保持不变,能适应显示区域。 -- Adaptive design 自适应:根据显示区域调整图表的结构和外观,如图表布局、信息密度、交互方式等。 - -![111.gif](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*kI7lQqlScEAAAAAAAAAAAAAAARQnAQ) - -## 设计流程 - -不同于传统的 UI 组件,图表的多端适配显示既要考虑报表的整体与页面其他元素/图表的响应式布局,也要考虑图表内组件之间的自适应布局。在 Ant Design 的可视化体系中,我们自研出一套适用于全量图表的布局适应规则,从整体图表、图表内原子组件梳理了适用于所有图表的布局适应体系,设计流程如下图: - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*QbsmSp_lWIAAAAAAAAAAAAAAARQnAQ) - -### 1.定义经典布局 - -考虑到信息展现地尽量完整和美观,图表的布局规则会相对灵活和细致。同时,PC 端,移动端和大屏,不同端的交互方式也要求图表的组件做到相应的转换和适配。 - -作为开始,我们可以针对图表,找到最频繁显示图表的屏幕尺寸。如 PC 端一行放三个图表,560px 的宽度,和移动端一行放一个图表,350px 的宽度。本示例中还包含了极小尺寸下的迷你布局。 - -对三种尺寸的图表(PC、Mobile、Mini),分别定义经典布局。 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*yrLpSLLqDpUAAAAAAAAAAAAAARQnAQ) - -### 2. 拆解构成 - -取单个经典布局,拆解为图表组件级的构成。如下图,统计图表 Chart&Plot 可以拆解为 Title,Toolbar,Axes,Element,Label,InfoComponent-legend,Guideline 等。之后我们将对每个图表组件、以及组件之间的关系为切入点,约束布局。 - -![视觉-平面构成.jpg](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*PAoUTJTT6BgAAAAAAAAAAAAAARQnAQ) - -### 3. 确定信息优先级 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*UAXeQJbDyrkAAAAAAAAAAAAAARQnAQ) - -### 4. 明确约束条件 - -**外部约束:**包含屏幕尺寸和设备属性。前者可拆解出断点范围,后者进一步约束了交互状态。 - -**内部约束:**包含组件所在的大小,组件内元素个数和间距。 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*CdDuRpbruiUAAAAAAAAAAAAAARQnAQ) - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*83S4RrimvY0AAAAAAAAAAAAAARQnAQ) - -### 5. 采取响应策略 - -其中,省略、换行、旋转、抽样,依赖于数据属性。转化方式依赖于设备的限制。 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*A29USbqd4LkAAAAAAAAAAAAAARQnAQ) - -### 6. 布局适应规则 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*ooAbTblu2YEAAAAAAAAAAAAAARQnAQ) - -## - -## 案例 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*HU3-TYt4628AAAAAAAAAAAAAARQnAQ) + diff --git a/docs/specification/language/palette.en.md b/docs/specification/language/palette.en.md index 4f313dc1d..716fbea93 100644 --- a/docs/specification/language/palette.en.md +++ b/docs/specification/language/palette.en.md @@ -3,4 +3,4 @@ title: Color Palette order: 1 --- - + diff --git a/docs/specification/language/palette.zh.md b/docs/specification/language/palette.zh.md index e53fe855b..a65f688ec 100644 --- a/docs/specification/language/palette.zh.md +++ b/docs/specification/language/palette.zh.md @@ -141,8 +141,7 @@ AntV 色板以蚂蚁极客蓝为起始主色,根据不同数据类型、使用 -![秋日橙主题.png](https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*8g3IQLdwuyQAAAAAAAAAAAAADmJ7AQ/original) -![秋日橙.gif](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*4eQ-Q7NX-wIAAAAAAAAAAAAAARQnAQ) +![秋日橙主题.png](https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*8g3IQLdwuyQAAAAAAAAAAAAADmJ7AQ/original) ![秋日橙.gif](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*4eQ-Q7NX-wIAAAAAAAAAAAAAARQnAQ) ### 马卡龙主题 @@ -150,9 +149,7 @@ AntV 色板以蚂蚁极客蓝为起始主色,根据不同数据类型、使用 - -![马卡龙主题.png](https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*Gt1AToxkmZoAAAAAAAAAAAAADmJ7AQ/original) -![马卡龙.gif](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*PhfqRLQmq4QAAAAAAAAAAAAAARQnAQ) +![马卡龙主题.png](https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*Gt1AToxkmZoAAAAAAAAAAAAADmJ7AQ/original) ![马卡龙.gif](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*PhfqRLQmq4QAAAAAAAAAAAAAARQnAQ) ### 强对比主题 @@ -231,5 +228,5 @@ AntV 色板在做无障碍验证时,得出以下几点取色建议 : ## 扩展阅读 - [AntV 色彩体系的搭建](https://zhuanlan.zhihu.com/p/70121039) -- 想自定义色板?查看 [色板生成教程](https://antv.vision/zh/docs/specification/tool/createrColor) +- 想自定义色板?查看 [色板生成教程](https://antv.vision/zh/docs/specification/tool/creator-color) - [下载色板资源](/specification/resources) diff --git a/docs/specification/module/annotation.en.md b/docs/specification/module/annotation.en.md index 43147ef4b..75f0bad6f 100644 --- a/docs/specification/module/annotation.en.md +++ b/docs/specification/module/annotation.en.md @@ -3,95 +3,4 @@ title: Annotation order: 6 --- -## 定义 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*ce2ERJSPjxgAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=608&margin=%5Bobject%20Object%5D&name=image.png&originHeight=608&originWidth=1450&size=183854&status=done&style=none&width=1450) - -“辅助标记”指为帮助浏览者阅读图表更易理解图表信息,而添加的对图表整体或者部分元素的注解信息。 - -## 何时使用 - -辅助标记在以下两种场景可帮助用户理解图表: - -1. 对于无分析经验或时间较少的用户,直接获取有用的信息。例:有分析经验的用户手动标注异常或重要的数据 -1. 对于通过可视分析获取洞见的用户,提升分析效率。例:系统智能高亮波动并分析原因 - -## 常见类型 - -单一数据注解 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*GXHvS7_7kYkAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=220&margin=%5Bobject%20Object%5D&name=image.png&originHeight=712&originWidth=2980&size=498448&status=done&style=none&width=920) - -区间数据注解:对某一区间范围(时间、数据、对象等)做注解 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*iyLcSIRcGlAAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=314&margin=%5Bobject%20Object%5D&name=image.png&originHeight=750&originWidth=2198&size=318697&status=done&style=none&width=920) - -数据对比注解:统计指标、值域区间、辅助区间 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*xUeeRL3sDKEAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=206&margin=%5Bobject%20Object%5D&name=image.png&originHeight=720&originWidth=3214&size=435267&status=done&style=none&width=920) - -多数据指定区域注解 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*5EZiT5OG9B0AAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=298&margin=%5Bobject%20Object%5D&name=image.png&originHeight=724&originWidth=2232&size=342427&status=done&style=none&width=920) - -多数据批量注解 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*SVFISpBA2pYAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=303&margin=%5Bobject%20Object%5D&name=image.png&originHeight=780&originWidth=2366&size=244394&status=done&style=none&width=920) - -## 构成元素 - -辅助标记的可选元素包括:文本,拉线,数据点,区间,辅助线,标记点 - -用户可针对不同的标记内容,选取不同的元素 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*MSEfTq_olakAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=287&margin=%5Bobject%20Object%5D&name=image.png&originHeight=954&originWidth=3062&size=544833&status=done&style=none&width=920) - -注意:当无法避免与其他组件碰撞时,保持注解内容位于其他**组件最上层** - -### 文本 - -**设计建议** - -1. 在空间的允许下,尽可能显示文本,直观表达标注内容。如果不显示文本需显示 icon,用户可通过点击查看 -1. 当文本内容宽度大于等于图表宽度 1/2 时,**隐藏文本显示文本 icon** -1. 文本内容较多时,需设定最大宽度(例:10 个字符),超出显示「...」,用户可通过 hover 查看全部 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*jDkbQ7ivESIAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=289&margin=%5Bobject%20Object%5D&name=image.png&originHeight=854&originWidth=2716&size=361464&status=done&style=none&width=920) - -### 拉线 - -**设计建议** - -1. 通常建议加上拉线来加强标注与图表的关联 -1. 默认方向**与值域趋势方向一致**,方向视空间而定。建议:上 > 下 > 延长 > 折角 > 隐藏 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*rKJMQJH3KyQAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=299&margin=%5Bobject%20Object%5D&name=image.png&originHeight=846&originWidth=2606&size=443779&status=done&style=none&width=920) - -### 数据点 - -**设计建议** - -1. 在单一数据注解或多数据统一注解的场景,建议加上数据点,以突出标注的数据 -1. 样式上建议区分已标注与未标注 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*C2TGSptoiZMAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=296&margin=%5Bobject%20Object%5D&name=image.png&originHeight=792&originWidth=2460&size=460335&status=done&style=none&width=920) - -### 区间 - -**设计建议** - -1. 对某一区域/范围做批注时,建议显示区间。区间底色需与图形样式做区分 -1. 区间的使用不宜重叠,且区间面积不宜过多,避免干扰用户阅读图表信息 - -### 辅助线 - -**设计建议** - -1. 辅助线的样式需与图表样式做区分,且辅助线的数目不宜过多 -1. 辅助线需配合文本表达含义 - -### 标记点 - -**设计建议** - -1. 在对多数据做批量批注时,建议在文本附近显示标记点作为提示 + diff --git a/docs/specification/module/axis.en.md b/docs/specification/module/axis.en.md index cf59421aa..262688a4f 100644 --- a/docs/specification/module/axis.en.md +++ b/docs/specification/module/axis.en.md @@ -3,67 +3,4 @@ title: Axis order: 3 --- -## 定义 - -坐标轴指二维空间中统计图表中的轴,它用来定义坐标系中数据在方向和值的映射关系的图表组件。 - -## 何时使用 - -在二维笛卡尔坐标系中,轴通常为水平方向的横轴(x 轴)和竖直方向的纵轴(y 轴)。极坐标系中,轴分为切向的切向轴(angle)和径向轴(radius)。 - -## 构成元素 - -坐标轴主要构成元素包括:轴标题、轴标签、轴线、轴刻度线、坐标网格线。 - -![](https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*o8XoSJZQRDcAAAAAAAAAAABkARQnAQ#align=left&display=inline&height=780&margin=%5Bobject%20Object%5D&originHeight=780&originWidth=2204&status=done&style=none&width=2204) - -### 轴标题 - -**设计建议** - -- 通常都建议加上轴标题解释轴的含义。当图表其他部分的内容(图表标题,图形标签,注释,轴标签文字等)已能充分显示轴的意义,可以略去轴标题,精简画面元素。 -- 除了数值百分比(%),科学计数法单位(k/m/g)、日期时间(年/月/日)单位和其他情况的数据单位建议在轴标题中显示,在各个轴标签中略去;例:生产总值(亿元)。 - -![](https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*LL6zQ6sIxwQAAAAAAAAAAABkARQnAQ#align=left&display=inline&height=710&margin=%5Bobject%20Object%5D&originHeight=710&originWidth=2194&status=done&style=none&width=2194) - -## - -### 轴标签 - -**设计建议:** - -- 可根据图表类型设置轴标签是否显示、旋转角度以及显示间隔。 -- 对文本数据:不建议开启抽样。 -- 对数值数据:不建议开启尾部省略。 -- 连续轴、时间轴默认自动抽样 + 不旋转; -- 分类轴默认自动旋转 + 自动省略。 - -![](https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*Ii5XTb5oHIUAAAAAAAAAAABkARQnAQ#align=left&display=inline&height=1392&margin=%5Bobject%20Object%5D&originHeight=1392&originWidth=2266&status=done&style=none&width=2266) - -轴标签「若图形区域内有数据标签」,则轴标签可以考虑隐藏,如下图: - -![](https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*C2QwTo41DyUAAAAAAAAAAABkARQnAQ#align=left&display=inline&height=806&margin=%5Bobject%20Object%5D&originHeight=806&originWidth=2378&status=done&style=none&width=2378) - -## 轴类型 - -映射轴的数据类型可分为 - -![](https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*OcosRYoYmDAAAAAAAAAAAABkARQnAQ#align=left&display=inline&height=480&margin=%5Bobject%20Object%5D&originHeight=480&originWidth=1832&status=done&style=none&width=1832) - -与此对应,轴可以分为:分类轴,时间轴,连续轴。 - -![](https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*zc8XRKCr4hEAAAAAAAAAAABkARQnAQ#align=left&display=inline&height=546&margin=%5Bobject%20Object%5D&originHeight=546&originWidth=1710&status=done&style=none&width=1710) - -## - -## 双轴图如何设计? - -顾名思义,双轴图共用 Y 轴值域区间,它含有两个 Y 轴左标轴,左右各一个。双轴图的使用大大提高了屏效。 - -**设计建议** - -- 尽量保证基线从「0」开始,且左右 Y 轴分段数量一致; -- 建议两组数据的 Y 轴单位是不同的,比如一组为「人数」,一组为「百分比」; -- 建议开启轴标题。 - -![](https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*s0xhQZmQMH8AAAAAAAAAAABkARQnAQ#align=left&display=inline&height=614&margin=%5Bobject%20Object%5D&originHeight=614&originWidth=2348&status=done&style=none&width=2348) + diff --git a/docs/specification/module/axisNavigator.en.md b/docs/specification/module/axisNavigator.en.md index eeb76c675..d2423804b 100644 --- a/docs/specification/module/axisNavigator.en.md +++ b/docs/specification/module/axisNavigator.en.md @@ -3,4 +3,4 @@ title: Axis Navigator order: 4 --- - + diff --git a/docs/specification/module/element.en.md b/docs/specification/module/element.en.md index d9bb99738..0b7385c76 100644 --- a/docs/specification/module/element.en.md +++ b/docs/specification/module/element.en.md @@ -3,63 +3,4 @@ title: Element order: 1 --- -## 定义 - -图形是统计图表的视觉通道在形状上映射的视觉展现,是图表的主体部分。图表中其他组件的目的皆是帮助读者更好地理解数据在图形上的映射关系。 - -## 何时使用 - -图形可以通过视觉特征更快地被读者感知和接受。从认知学的角度,人眼在对图形的获取效率远高于对抽象意符的理解。所以图形是数据可视化的必备元素,承载着数据背后蕴含的信息。 - -图形是可视化图表区别于表格和文本的最重要元素。是每个可视化通常必须包含的组件,且通常很大程度上决定了该可视化的有效性与美观度。一个优秀的可视化作品,其图形必定能准确、清晰地呈现背后的数据,带给读者启发和信息。一个优美的可视化作品,其图形是标题信息之后首先被读者注意到的部分,是 data-storytelling 过程戏剧张力和引发读者注意力的载体。 - -可视化设计中,较图形的美观度更重要的,是作者想表达的数据特性能否被准确地通过图形表达出来。数据特性和用户的认知水平可以帮助可视化设计师决定有效的图形映射类型和视觉映射通道,设计师再通过读者阅读的媒介、设备和环境决定可视化作品的人机交互方式,最后考虑到图形的美观度设计。 - -## 类型 - -按照基础图表类型,图形可分为:折线,面积,散点,气泡,饼/环,柱形,条形。 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*TuBQT76fCmwAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=551&margin=%5Bobject%20Object%5D&name=image.png&originHeight=1102&originWidth=1794&size=81842&status=done&style=none&width=897) - -## 样式 - -二维空间内的统计图表图形属性遵循计算机视觉元素构成,有 填充,描边,阴影等样式。 - -## 用法建议 - -#### 图形比例 - -以柱条形图为例,柱形/条形比例和两边间距的比例为 1:2:1,柱子宽度为总宽度的 60%。 - -直方图中的柱形会相比之下排布更加密集,柱子之间间距恒定为 1px。 - -环形图扇区的外半径和内半径比例为 5:3, 外半径和画布尺寸的 80%。 - -#### - -#### 填充样式 - -根据图形元素在实际图表中的面积占比,我们定义了相应的填充样式。图形占比越大的图表,对应填充的透明度越高。如,在柱/条形图中,图形的填充比例为 95%;在面积图中,图形的填充比例为 25%;在折线图中,可以通过渐变填充的方式强调线条的位置。 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*BsLlTZMjZzgAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=164&margin=%5Bobject%20Object%5D&name=image.png&originHeight=396&originWidth=579&size=19005&status=done&style=none&width=240)![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*BpLySKzrilEAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=164&margin=%5Bobject%20Object%5D&name=image.png&originHeight=396&originWidth=580&size=38749&status=done&style=none&width=240)![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*c22ERo00WQUAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=164&margin=%5Bobject%20Object%5D&name=image.png&originHeight=396&originWidth=580&size=21727&status=done&style=none&width=240) - -#### - -#### 与交互状态关联 - -图形可以吸引用户的注意力,因而在交互语法中,图形在正常态、悬浮态、选中态、被动高亮态,都有显著的视觉样式区别,交互状态的变化基于图形设计,保证了整个可视化设计体系和体验的一致。 - -| mouse-event | null | hover | click | click | -| --- | --- | --- | --- | --- | -| visual-state | default | highlighted | active | de-active | -| Style | ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*yMgBTp-7rSIAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=124&margin=%5Bobject%20Object%5D&name=image.png&originHeight=248&originWidth=248&size=23181&status=done&style=none&width=124) | ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*QYIkQqbquRgAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=124&margin=%5Bobject%20Object%5D&name=image.png&originHeight=248&originWidth=248&size=20398&status=done&style=none&width=124) | ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*HMFdQb6Gk7EAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=124&margin=%5Bobject%20Object%5D&name=image.png&originHeight=248&originWidth=248&size=20694&status=done&style=none&width=124) | ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*wFFnTrSJPMIAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=124&margin=%5Bobject%20Object%5D&name=image.png&originHeight=248&originWidth=248&size=20106&status=done&style=none&width=124) | - -#### - -#### 为信息重要性服务 - -在不同尺寸下的响应式布局中,依据图形对应代表的信息优先级,决定图形的展现策略。 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*TlnxRIJrZ24AAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=235&margin=%5Bobject%20Object%5D&name=image.png&originHeight=235&originWidth=995&size=53572&status=done&style=none&width=995) - -持续更新中,敬请期待… + diff --git a/docs/specification/module/info.en.md b/docs/specification/module/info.en.md index 9325f03c7..57bc31f36 100644 --- a/docs/specification/module/info.en.md +++ b/docs/specification/module/info.en.md @@ -3,4 +3,4 @@ title: Info Component order: 7 --- - + diff --git a/docs/specification/module/info.zh.md b/docs/specification/module/info.zh.md index 92d80f6da..3db49e624 100644 --- a/docs/specification/module/info.zh.md +++ b/docs/specification/module/info.zh.md @@ -13,20 +13,16 @@ order: 7 过去,我们设计图表的思路是特图特做,比如设计 PC 端折线图鼠标 hover 时,折线上方显示悬浮提示 Tooltip 组件。在移动端,因为没有鼠标 hover 操作,需将原来悬浮出现的 Tooltip 提示信息转化为更直观的组件,比如指标卡 Index Card 平铺显示。
- -![data-presentation-insights diagram.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*NzhrRp5OMtUAAAAAAAAAAAAAARQnAQ) +![data-presentation-insights diagram.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*NzhrRp5OMtUAAAAAAAAAAAAAARQnAQ)
有了信息组件,我们可以不必为 PC 端指定一种组件悬浮提示 Tooltip,为移动端指定一种组件指标卡 Index Card。信息组件可识别不同端,不同的设备,甚至不同的尺寸,在信息不丢失的情况下做组件形态的转变。 # 信息组件构成 -信息组件由三类元素组合构成,它们分别是 -**视觉标记 Visual Mark** ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*fAYgQqVrQUsAAAAAAAAAAAAAARQnAQ)、 -**文本标签 Label** ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*V7IxT62HnSEAAAAAAAAAAAAAARQnAQ)、 -**数值标签 Value** ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*5fNPQ4wtYAQAAAAAAAAAAAAAARQnAQ)。 +信息组件由三类元素组合构成,它们分别是 **视觉标记 Visual Mark** ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*fAYgQqVrQUsAAAAAAAAAAAAAARQnAQ)、 **文本标签 Label** ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*V7IxT62HnSEAAAAAAAAAAAAAARQnAQ)、 **数值标签 Value** ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*5fNPQ4wtYAQAAAAAAAAAAAAAARQnAQ)。 -## 视觉标记 +## 视觉标记 视觉标记是视觉通道映射的载体,常见的为颜色、形状等,具体详见 [视觉篇](../language/basic) 和 [色板篇](../language/palette)。 @@ -36,19 +32,17 @@ order: 7 | 形状 | ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*4MTpRrcgDz4AAAAAAAAAAAAAARQnAQ) | | 尺寸 | ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*3P2URImQOnQAAAAAAAAAAAAAARQnAQ) | -## 文本标签 +## 文本标签 文本标签此处特指显示数据标签名称的文本组件。样式详见 全局样式-数据标签。 -## 数值标签 +## 数值标签 文本标签此处特指显示数据数值的文本组件。样式详见全局样式-数据标签。 # 常见形态 -**视觉标记 Visual Mark** ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*fAYgQqVrQUsAAAAAAAAAAAAAARQnAQ)、 -**文本标签 Label** ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*V7IxT62HnSEAAAAAAAAAAAAAARQnAQ)、 -**数值标签 Value** ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*5fNPQ4wtYAQAAAAAAAAAAAAAARQnAQ) 可组合变换出 N 种形态,常见的形态有以下 4 种: +**视觉标记 Visual Mark** ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*fAYgQqVrQUsAAAAAAAAAAAAAARQnAQ)、 **文本标签 Label** ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*V7IxT62HnSEAAAAAAAAAAAAAARQnAQ)、 **数值标签 Value** ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*5fNPQ4wtYAQAAAAAAAAAAAAAARQnAQ) 可组合变换出 N 种形态,常见的形态有以下 4 种: 1. 标签提示(Label) 2. 图例(Legend) @@ -59,9 +53,7 @@ order: 7 # 1.标签提示 Label -在图表中,标签是对当前的一组数据进行的内容标注。在图表中常见表现为中心文本,坐标提示,图形标签,注释标记。图形标签和注释标记详见 [标签 Label](./label) 和 [标注 Annotation](./annotation)
-
-![1.标签提示.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*C8NyRKDfAPsAAAAAAAAAAAAAARQnAQ) +在图表中,标签是对当前的一组数据进行的内容标注。在图表中常见表现为中心文本,坐标提示,图形标签,注释标记。图形标签和注释标记详见 [标签 Label](./label) 和 [标注 Annotation](./annotation)

![1.标签提示.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*C8NyRKDfAPsAAAAAAAAAAAAAARQnAQ) ## 中心文本 @@ -76,6 +68,7 @@ order: 7 | **元素** | **适合设备** | **出现位置** | **适合图表类型** | | --- | --- | --- | --- | | Value | PC 端、移动端均可 | 轴上,覆盖轴标签 | 散点图、气泡图等笛卡尔坐标系图表 | +
![3.坐标提示.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*1lRmSIgd_bUAAAAAAAAAAAAAARQnAQ) @@ -84,7 +77,7 @@ order: 7 ## 分类图例 Categorical Legend -分类图例用于解释图表中的分类维度信息。依据视觉标记的不同,分类图例可分为颜色图例和形状图例。 +分类图例用于解释图表中的分类维度信息。依据视觉标记的不同,分类图例可分为颜色图例和形状图例。 ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*J7IEQJJtG6AAAAAAAAAAAAAAARQnAQ) @@ -96,9 +89,9 @@ order: 7 **布局** -图例遵循流式布局,横向和纵向排列时超出区域,可以启用翻页。 +图例遵循流式布局,横向和纵向排列时超出区域,可以启用翻页。 -**1. 图例超出时翻页** 在 G2Plot 中,图例如果占据了图表大部分的位置,你可以发现内置提供了翻页功能。 +**1. 图例超出时翻页** 在 G2Plot 中,图例如果占据了图表大部分的位置,你可以发现内置提供了翻页功能。 ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*e_9hSL9BUt8AAAAAAAAAAAAAARQnAQ) @@ -106,23 +99,19 @@ order: 7 图例是对图形本身的概括。通常人的视觉动线是从上至下,从左到右。默认把图例放在左上角去做一个通用的方案看起来似乎很稳妥。但这样是最优做法吗? -更好的做法:**缩短用户对照图例看图形的本能路径,提升信息获取效率。** -
+更好的做法:**缩短用户对照图例看图形的本能路径,提升信息获取效率。**
虽然图例的位置从技术上支持了 12 个位置,我们总结了图例在不同的图表类型中不同的位置后,经过克制收敛为两类,并应用在统计图表类库 G2Plot 以及智能生成图表 AVA 中。 -设计者和观看者甚至并不会感知到位置的变化,但获取信息的效率就在不经意间提升了。 -
+设计者和观看者甚至并不会感知到位置的变化,但获取信息的效率就在不经意间提升了。
![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*HIgXSrHrbm0AAAAAAAAAAAAAARQnAQ) ## 连续图例 Continuous Legend -连续图例用于提供图表中度量值的参考。 -
+连续图例用于提供图表中度量值的参考。
-依据视觉标记的不同,连续图例可分为连续颜色图例和连续尺寸图例。连续图例通常适用于静态图表,提供大致的数据映射等级参考。在交互状态下用户依照 Tooltip 或 Label 查看详细信息更为方便。 -
+依据视觉标记的不同,连续图例可分为连续颜色图例和连续尺寸图例。连续图例通常适用于静态图表,提供大致的数据映射等级参考。在交互状态下用户依照 Tooltip 或 Label 查看详细信息更为方便。
![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*HA7wQqZyihIAAAAAAAAAAAAAARQnAQ) @@ -132,8 +121,7 @@ order: 7 **示例** 敬请期待此处的地图和关系图等复杂图表图例示例 -**布局** 连续图例的布局规则与分类图例基本一致,可以位于图表上下左右的 12 个方位,也可以位于图表上方。 -
+**布局** 连续图例的布局规则与分类图例基本一致,可以位于图表上下左右的 12 个方位,也可以位于图表上方。
![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*e_9hSL9BUt8AAAAAAAAAAAAAARQnAQ) @@ -151,8 +139,7 @@ order: 7 ![Tooltip构成.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*DwQjTpXZZ_QAAAAAAAAAAAAAARQnAQ) -Tooltip 的基本元素包括:视觉标记图形,文本标签,数值标记等。 Tooltip 的可选元素:所在的 UI 容器还可以和其他 UI 组件配合使用,完成过滤,下钻等自助分析功能。 -
+Tooltip 的基本元素包括:视觉标记图形,文本标签,数值标记等。 Tooltip 的可选元素:所在的 UI 容器还可以和其他 UI 组件配合使用,完成过滤,下钻等自助分析功能。
# 4.指标卡 Index Card @@ -170,11 +157,11 @@ Tooltip 的基本元素包括:视觉标记图形,文本标签,数值标记 ## 高阶图例 -### 带数值 +### 带数值 -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*baNBQYfa31sAAAAAAAAAAAAAARQnAQ) +![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*baNBQYfa31sAAAAAAAAAAAAAARQnAQ) -### 带操作 +### 带操作 ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*wqzmS799Gm4AAAAAAAAAAAAAARQnAQ) diff --git a/docs/specification/module/label.en.md b/docs/specification/module/label.en.md index ec8003fcf..fcdc0bba0 100644 --- a/docs/specification/module/label.en.md +++ b/docs/specification/module/label.en.md @@ -3,34 +3,4 @@ title: Label order: 2 --- -## 定义 - -在图表中,标签是对当前的一组数据进行的内容标注。 - -## 元素 - -包括数据点、拉线、文本数值等元素,根据不同的图表类型选择使用。 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*48m4QpCnyp8AAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=309&name=image.png&originHeight=618&originWidth=2190&size=85460&status=done&width=1095) - -## 显示策略 - -通常标签显示在图形外,但在「堆叠类」图表中,标签会显示在图形内。如下图: - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*_mkHQKT8bogAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=262&name=image.png&originHeight=716&originWidth=1030&size=51288&status=done&width=377) - -标签的文本和图形经常需要交叠展示,所以可读性需要足够良好,所以通过对 HS 值的判断,决定文字的颜色。这样对比度就在可控范围内,不会出现可读性的问题。 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*yTziRrxxIgwAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=318&name=image.png&originHeight=636&originWidth=500&size=44263&status=done&width=250) - -## 常见问题 - -### 问题 1:图表标签重叠时怎么办? - -标签重叠时,g2plot 的默认方案为动态计算的抽样显示,在标签重叠时,自动隐藏其中一个,同时当 Hover 图表时,显示被隐藏的对应的数据。这样保证了图表的清晰度,也保证了信息的完整性。 - - - -### 问题 2:我可以自定义标签吗? - -可以,通过配置项你可以修改标签的样式,包括点的形状、文字大小等,但我们还是建议您使用默认方案。 + diff --git a/docs/specification/module/timeBar.en.md b/docs/specification/module/timeBar.en.md index 4c27fd5e6..053fb6ba3 100644 --- a/docs/specification/module/timeBar.en.md +++ b/docs/specification/module/timeBar.en.md @@ -3,4 +3,4 @@ title: TimeBar order: 5 --- - + diff --git a/docs/specification/module/titleNote.en.md b/docs/specification/module/titleNote.en.md index 96d22fddc..93602213c 100644 --- a/docs/specification/module/titleNote.en.md +++ b/docs/specification/module/titleNote.en.md @@ -3,30 +3,4 @@ title: Title and annotation order: 0 --- -## 定义 - -标题是对图表的主题进行阐述的一段话。 - -注释是表明数据来源,让图表看起来来源清晰、可靠。 - -## 何时使用 - -让阅读者直观地阅读当前图表的主题,了解当前内容的来源。 - -## 内容和位置 - -**标题内容:**言简意赅,尽量避免被截断; - -**标题位置:**正、副标题一般放置于卡片左上角,标题宽度不超过卡片宽度。 - -**注释内容:**引用内容、数据来源等,保证正确性; - -**注释位置:**一般放置于卡片左下角 - -## 常见问题 - -### 1、标题过长怎么办? - -尽量精简标题内容,当标题过长且超过了卡片宽度时,请省略标题中间的文字,保住首尾,如“我是...标题”。 - -若副标题过长时,最多折 2 行,高度不超过卡片的 30%。 + diff --git a/docs/specification/module/viewToolBar.en.md b/docs/specification/module/viewToolBar.en.md index 17ed5fdf5..7f1ee251b 100644 --- a/docs/specification/module/viewToolBar.en.md +++ b/docs/specification/module/viewToolBar.en.md @@ -3,90 +3,4 @@ title: View ToolBar order: 8 --- -## 定义 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*c5L6TIo4WB4AAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=320&margin=%5Bobject%20Object%5D&name=image.png&originHeight=320&originWidth=1562&size=993022&status=done&style=none&width=1562) - -视图控制栏是用户与数据进行交互的载体,当用户操作视图工具栏时,可对视图可视区间缩放、平移、对数据进行检索、过滤等。 - -## 何时使用 - -以下两种情况,建议设计时开启视图控制栏。 - -- 数据绘制区域超过屏幕可视区域,为方便用户能以全局视角观察数据,建议开启视图控制栏。例:地图上的视图控制栏; -- 用户需要频繁与视图上的数据进行交互,比如放大、缩小视图空间,快速定位检索数据点等。例:公安通过关系网核查犯罪嫌疑人; - -## 构成元素 - -![01.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*E3pES4vv9D0AAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=352&margin=%5Bobject%20Object%5D&name=01.png&originHeight=352&originWidth=1884&size=36221&status=done&style=none&width=1884) - -以下每组元素都为选配项 - -- 搜索; -- 画布控制按钮组:+、—、百分比、Mini Map 迷你视图(可选配); -- 自定义组:可定制视图工具栏按钮,比如全屏、定位当前位置等操作。 - -## 常见类型 - -![02.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*I8dMQK3jwh8AAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=424&margin=%5Bobject%20Object%5D&name=02.png&originHeight=424&originWidth=1884&size=62857&status=done&style=none&width=1884) - -## 出现位置 - -- z-index 层级:层级高于画布,但低于视图中的 Tooltip 提示信息组件; -- 水平边距:距两边边距均为 8 的倍数; -- 位置:视布局需要,八个方向均可配置。 - -![03.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*89aDRrBlnV0AAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=812&margin=%5Bobject%20Object%5D&name=03.png&originHeight=812&originWidth=1884&size=50732&status=done&style=none&width=1884) - -## 交互说明 - -### 搜索 - -- 键盘操作:输入后,enter 执行搜索操作,按键盘 esc 可退出搜索框,搜索恢复 normal 态。 - -![04.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*XPsyQ4f1jRwAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=696&margin=%5Bobject%20Object%5D&name=04.png&originHeight=696&originWidth=1884&size=106974&status=done&style=none&width=1884) - -### 画布控制按纽组 - -- 点击“+”,0 以上默认增幅 25%,100% 以上默认增幅 50%,建议最大值 200%; -- 点击”—“,100%~200% 之间,默认降幅 50%,100% 以下默认降幅 25%,建议早小值 25%; -- 百分比字体:Roboto Condensed; -- 键盘操作:按 esc 可退出已激活的下拉框。 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*RJs7T67ptNUAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=1024&margin=%5Bobject%20Object%5D&name=image.png&originHeight=1024&originWidth=1884&size=220672&status=done&style=none&width=1884) - -### Mini Map - -- 键盘操作:按 esc 可退出已显示的 Mini Map。 - -![06.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*jSwQQaWl9OYAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=1020&margin=%5Bobject%20Object%5D&name=06.png&originHeight=1020&originWidth=1884&size=180155&status=done&style=none&width=1884) - -## 设计建议 - -### 按钮分组显示 - -建议视图控制栏按钮按照格式塔原理分组显示。 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*NZOfT6iidTMAAAAAAAAAAAAAARQnAQ#align=left&display=inline&height=416&margin=%5Bobject%20Object%5D&name=image.png&originHeight=416&originWidth=1884&size=111992&status=done&style=none&width=1884) - -### 遵循用户阅读习惯 - -画布初始位置,建议符合从左至右,从上至下的阅读习惯,而不是一刀切显示视图的正中间。比如: - -- 思维导图建议贴左,垂直居中; -- 关系图将起始节点居中显示; -- DAG 流程图建议贴上,水平居中; - -### 效率优先 - -建议视图增快捷操作,提升使用效率 - -- 放大 +:Ctrl/⌘ + + -- 缩小 -:Ctrl/⌘ + — -- 100% 1:1 等比例显示:Ctrl/⌘ + 0 -- 适应画布显示:Ctrl/⌘ + 1 - -### 全场景考虑 - -- 建议补充移动端样式及交互; -- 补充 Dark Mode 模式。 + diff --git a/docs/specification/principles/basic.en.md b/docs/specification/principles/basic.en.md index 94511399a..bc8cacec3 100644 --- a/docs/specification/principles/basic.en.md +++ b/docs/specification/principles/basic.en.md @@ -1,8 +1,87 @@ ---- -title: Principles -order: 0 -redirect_from: - - /en/docs/specification ---- - - +The design values of AntV for data visualization are derived from the Ant Design design system (Ant Design) and serve as guiding principles with characteristics of data visualization. While adhering to the design values of Ant Design, it offers a further interpretation in the field of data visualization. + +AntV's design language initially defined four design values: "Accuracy, Clarity, Effectiveness, and Beauty". After several years of extensive project practice in internal business and with the changes in users' demands for data analysis, new requirements have been put forward for charts. + +Today, we have shifted from the "object perspective" to the "user perspective" and reexamined the AntV design values. In the past, the essence of "accuracy" and "effectiveness" for charts was to build users' "sense of trust". The essence of "clarity" and "beauty" for charts was to build users' "sense of ease". As a carrier for transmitting data information, the most important value of charts is to inspire and provide insights for users. In the past, there was a lack of "sense of meaning", and today we have added it, thus resulting in the upgrade of the values today. + +![image.png](https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*AFdPQp5GDeQAAAAAAAAAAAAADmJ7AQ/original) + +  + +## Sense of Trust + +If we compare a chart to a person, its visible appearance, the behavioral feedback during interaction, and even the sounds it makes are all ways to build a sense of trust with users. The sense of trust means that when users first see a chart from a distance, they can be attracted by its reliable appearance. When presenting data, it should not distort, mislead, or omit information, but accurately and truthfully reflect the characteristic information of the data. Only in this way can users trust the data in the chart with confidence, bravely approach, explore, and understand it, and be bold enough to analyze the data. + +
+ + + + + + + + + + + + + + + +
🙅 Not Recommended👍 Recommended
The overflowing labels and messy information can easily make users question whether the data is maintained and whether the chart data is real and usable.Display the required data information step by step according to users' purposes of analyzing data. For example, for a relationship diagram, users can view the overall picture when it is zoomed out and view the details of individual data when it is zoomed in.
+ + + +
+ +## Sense of Ease + +The beauty of data is like a symphony of the visual and interactive aspects of a chart. Use an appropriate amount of visual elements to present data, group data according to the Gestalt principles, focus on conveying information without redundancy, and use the most appropriate data-ink ratio to express the most useful information for users, enabling users to quickly obtain information. Meanwhile, it can also create an orderly and regular beauty. Coupled with timely feedback and appropriately emerging interactions, they jointly play a clear, elegant, and intuitive beauty of data, allowing users to easily understand the data. + + + + + + + + + + + + + + + + + +
🙅 Not Recommended👍 Recommended
The color contrast among graphics, texts, labels, and the background, as well as between graphics, is too low, resulting in a hazy chart that makes it unclear and uneasy for users to read.Strengthen the color contrast among graphics, texts, labels, and the background and between graphics. Use an appropriate amount of ink and proper interactions to help users easily understand the data.
+ + + +
+ +## Sense of Meaning + +Truly effective communication is like a two-way exchange stage. When users stop to look at a chart, it would be wonderful if they suddenly have an "aha" moment, as if a light bulb has been lit! It's as if they suddenly understand something. Charts can not only help users clearly see the patterns of data at a glance but also stimulate their insight and inspire new views and ideas. Such communication is not only interesting but also brings practical work significance and gains for users. So, don't forget to make your charts shine and make your information more vivid and convincing. + + + + + + + + + + + + + + + + + +
🙅 Not Recommended👍 Recommended
The seemingly neat and error-free data chart only depicts the most basic presentation of data, and it's difficult for users to intuitively understand the reasons behind the rises and falls.There is no analysis without comparison. Add an appropriate amount of comparable mean reference auxiliary lines and event markers to assist in trend interpretation, along with overall intelligent insights, to help users quickly understand the patterns of data.
+ + + +
diff --git a/docs/specification/principles/basic.zh.md b/docs/specification/principles/basic.zh.md index 97f9f5301..243ac9678 100644 --- a/docs/specification/principles/basic.zh.md +++ b/docs/specification/principles/basic.zh.md @@ -1,8 +1,6 @@ --- title: 设计价值观 order: 0 -redirect_from: - - /zh/docs/specification --- 数据可视化 AntV 的设计价值观是基于 Ant Design 设计体系衍生的,具有数据可视化特性的指导原则。它在遵循 Ant Design 设计价值观的同时,对数据可视化领域的进一步解读。 @@ -91,4 +89,4 @@ AntV 设计语言初建定义了四条设计价值观「准确、清晰、有效 - \ No newline at end of file + diff --git a/docs/specification/reference.en.md b/docs/specification/reference.en.md index 2fd1ef3df..762d9dc55 100644 --- a/docs/specification/reference.en.md +++ b/docs/specification/reference.en.md @@ -3,164 +3,4 @@ title: Classical Literatures order: 11 --- - - -在数据可视化的研究和实现中,《数据可视化》、《The Grammar of Graphics》、《深入浅出统计学》、《计算机图形学几何工具算法详解》、《Visualization Analysis and Design》 、《ggplot2:数据分析与图形艺术》等书籍给了我们很多的启示,帮助我们奠定了扎实的理论基础,进而去实现各种创新。如果您想了解更多数据可视化相关的内容,建议您阅读这些非常棒的书籍。 - -
-
-
-
-
-
- -
-
- 《数据可视化》 -
- 作者:陈为 / 沈则潜 - 出版社:电子工业出版社 -
-
-
-
-
-
-
-
-
- -
-
- 《The Grammar of Graphics》 -
- 作者:Leland Wilkinson - 出版社:Springer -
-
-
-
-
-
-
-
-
- -
-
- 《深入浅出统计学》 -
- 译者:李芳 - 出版社:电子工业出版社 -
-
-
-
-
-
-
-
-
- -
-
- 《计算机图形学几何工具算法详解》 -
- 译者:周长发 - 出版社:电子工业出版社 -
-
-
-
-
-
-
-
-
- -
-
- 《Visualization Analysis & Design》 -
- 作者:Tamara Munzner - 出版社:A K Peters/CRC Press -
-
-
-
-
-
-
-
-
- -
-
- 《ggplot2:数据分析与图形艺术》 -
- 译者:统计之都 - 出版社:西安交通大学出版社 -
-
-
-
-
-
-
+ diff --git a/docs/specification/resources.en.md b/docs/specification/resources.en.md index 7de6ee4eb..61084d131 100644 --- a/docs/specification/resources.en.md +++ b/docs/specification/resources.en.md @@ -3,88 +3,4 @@ title: Resources order: 10 --- - - -We provide design resources and tools as below: - -
- - - - AntV Charts 4.0 - Chart components as Sketch template - - - - - - AntV Charts Icons - Logos and icons - - - - - - AntV Color Palette 2.0 - Color palette for visualization 2.0 - - -
+ diff --git a/docs/specification/standby/antvColorList.en.md b/docs/specification/standby/antvColorList.en.md index f5f3a54bf..fa716b8cf 100644 --- a/docs/specification/standby/antvColorList.en.md +++ b/docs/specification/standby/antvColorList.en.md @@ -3,136 +3,4 @@ title: AntV Color Board order: 0 --- -## 分类色板 - -**官方默认色板,分为 10 色和 20 色** - -| 色板名称 | 例 | 色值 | 色板名称 | 例 | 色值 | -| --- | --- | --- | --- | --- | --- | -| PaletteQualitative10-1 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667373415-c6b5238d-fc04-4ca0-ad9f-51131ac5dace.png#align=left&display=inline&height=24&name=image.png&originHeight=100&originWidth=100&size=409&status=done&style=none&width=24) | #5B8FF9 | PaletteQualitative20-1 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667373415-c6b5238d-fc04-4ca0-ad9f-51131ac5dace.png#align=left&display=inline&height=24&name=image.png&originHeight=100&originWidth=100&size=409&status=done&style=none&width=24) | #5B8FF9 | -| PaletteQualitative10-2 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667387861-c1343ddc-34ab-4d49-9e29-44eead0e3a7f.png#align=left&display=inline&height=24&name=image.png&originHeight=106&originWidth=106&size=445&status=done&style=none&width=24) | #61DDAA | PaletteQualitative20-2 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581931341653-be214cfa-a217-468c-a859-f602d25071e9.png#align=left&display=inline&height=21&name=image.png&originHeight=42&originWidth=44&size=158&status=done&style=none&width=22) | #CDDDFD | -| PaletteQualitative10-3 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667400477-dc42a605-67ee-45cd-852e-9b81cd508d15.png#align=left&display=inline&height=24&name=image.png&originHeight=100&originWidth=100&size=410&status=done&style=none&width=24) | #65789B | PaletteQualitative20-3 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667387861-c1343ddc-34ab-4d49-9e29-44eead0e3a7f.png#align=left&display=inline&height=24&name=image.png&originHeight=106&originWidth=106&size=445&status=done&style=none&width=24) | #61DDAA | -| PaletteQualitative10-4 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667419248-a502a18a-0d28-4bf0-88ab-47076ed9a132.png#align=left&display=inline&height=57&name=image.png&originHeight=114&originWidth=104&size=463&status=done&style=none&width=52) | #F6BD16 | PaletteQualitative20-4 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581931352638-73a87eaf-5692-49ed-953f-edac2ac65c8c.png#align=left&display=inline&height=20&name=image.png&originHeight=40&originWidth=40&size=153&status=done&style=none&width=20) | #CDF3E4 | -| PaletteQualitative10-5 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1603097915585-b6ac7f2b-1680-4188-b2e1-e514d37a4a63.png#align=left&display=inline&height=75&margin=%5Bobject%20Object%5D&name=image.png&originHeight=150&originWidth=150&size=3964&status=done&style=none&width=75) | #7262fd | PaletteQualitative20-5 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667400477-dc42a605-67ee-45cd-852e-9b81cd508d15.png#align=left&display=inline&height=24&name=image.png&originHeight=100&originWidth=100&size=410&status=done&style=none&width=24) | #65789B | -| PaletteQualitative10-6 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667433701-f74b31a1-a332-4415-b270-e73d932fc600.png#align=left&display=inline&height=51&name=image.png&originHeight=102&originWidth=104&size=424&status=done&style=none&width=52) | #78D3F8 | PaletteQualitative20-6 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581931466348-1f7e3f7a-0ebb-4218-a220-1c1bd505cd96.png#align=left&display=inline&height=25&name=image.png&originHeight=50&originWidth=46&size=174&status=done&style=none&width=23) | #CED4DE | -| PaletteQualitative10-7 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667440954-dcbb6b3f-e07b-4208-8137-2df92f7e6a4a.png#align=left&display=inline&height=50&name=image.png&originHeight=100&originWidth=106&size=425&status=done&style=none&width=53) | #9661BC | PaletteQualitative20-7 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667419248-a502a18a-0d28-4bf0-88ab-47076ed9a132.png#align=left&display=inline&height=57&name=image.png&originHeight=114&originWidth=104&size=463&status=done&style=none&width=52) | #F6BD16 | -| PaletteQualitative10-8 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667447050-bea49bd8-e505-4c7c-89e8-a91c0b719692.png#align=left&display=inline&height=53&name=image.png&originHeight=106&originWidth=104&size=435&status=done&style=none&width=52) | #F6903D | PaletteQualitative20-8 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581931498184-fb10c88f-9c28-4696-9065-dd1f66807a83.png#align=left&display=inline&height=23&name=image.png&originHeight=46&originWidth=42&size=165&status=done&style=none&width=21) | #FCEBB9 | -| PaletteQualitative10-9 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667455031-a89acef3-a0d8-4586-8ad1-cd674c179e29.png#align=left&display=inline&height=48&name=image.png&originHeight=96&originWidth=98&size=391&status=done&style=none&width=49) | #008685 | PaletteQualitative20-9 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1603097925805-4168724c-647f-41fe-aeb5-613555513e6f.png#align=left&display=inline&height=75&margin=%5Bobject%20Object%5D&name=image.png&originHeight=150&originWidth=150&size=3964&status=done&style=none&width=75) | #7262fd | -| PaletteQualitative10-10 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667462743-3d9bfc8c-773d-46fe-bb1d-58bf6617c3ea.png#align=left&display=inline&height=51&name=image.png&originHeight=102&originWidth=106&size=431&status=done&style=none&width=53) | #F08BB4 | PaletteQualitative20-10 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1603097969931-d18bb77b-47fb-4958-ba90-f7de84c79326.png#align=left&display=inline&height=41&margin=%5Bobject%20Object%5D&name=image.png&originHeight=82&originWidth=82&size=2210&status=done&style=none&width=41) | #D3CEFD | -| | | | PaletteQualitative20-11 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667433701-f74b31a1-a332-4415-b270-e73d932fc600.png#align=left&display=inline&height=51&name=image.png&originHeight=102&originWidth=104&size=424&status=done&style=none&width=52) | #78D3F8 | -| | | | PaletteQualitative20-12 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581931523218-250fab05-3568-4440-8b59-ee418c95cd3b.png#align=left&display=inline&height=25&name=image.png&originHeight=50&originWidth=44&size=170&status=done&style=none&width=22) | #D3EEF9 | -| | | | PaletteQualitative20-13 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667440954-dcbb6b3f-e07b-4208-8137-2df92f7e6a4a.png#align=left&display=inline&height=50&name=image.png&originHeight=100&originWidth=106&size=425&status=done&style=none&width=53) | #9661BC | -| | | | PaletteQualitative20-14 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581931539706-0ff7787b-bb01-43df-a097-e1924b1351cc.png#align=left&display=inline&height=22&name=image.png&originHeight=44&originWidth=38&size=159&status=done&style=none&width=19) | #DECFEA | -| | | | PaletteQualitative20-15 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667447050-bea49bd8-e505-4c7c-89e8-a91c0b719692.png#align=left&display=inline&height=53&name=image.png&originHeight=106&originWidth=104&size=435&status=done&style=none&width=52) | #F6903D | -| | | | PaletteQualitative20-16 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581931558551-75870146-ee48-4df6-a8f1-1f74c2b0ef1c.png#align=left&display=inline&height=24&name=image.png&originHeight=48&originWidth=42&size=167&status=done&style=none&width=21) | #FFE0C7 | -| | | | PaletteQualitative20-17 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667455031-a89acef3-a0d8-4586-8ad1-cd674c179e29.png#align=left&display=inline&height=48&name=image.png&originHeight=96&originWidth=98&size=391&status=done&style=none&width=49) | #008685 | -| | | | PaletteQualitative20-18 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581931594066-4f952449-8e4f-41a3-b7e8-a8cbb8eb978d.png#align=left&display=inline&height=24&name=image.png&originHeight=48&originWidth=46&size=168&status=done&style=none&width=23) | #BBDEDE | -| | | | PaletteQualitative20-19 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667462743-3d9bfc8c-773d-46fe-bb1d-58bf6617c3ea.png#align=left&display=inline&height=51&name=image.png&originHeight=102&originWidth=106&size=431&status=done&style=none&width=53) | #F08BB4 | -| | | | PaletteQualitative20-20 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581931623591-b3e9f66e-f2f0-44ea-81e3-5f05b0716655.png#align=left&display=inline&height=22&name=image.png&originHeight=44&originWidth=42&size=161&status=done&style=none&width=21) | #FFE0ED | - -**
**
**新增三套主题色,适用于黑白场** - -| PaletteQualitative-Autumn | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/73157/1602817967367-d2501123-82da-4f06-aeb3-166f966cefab.png#align=left&display=inline&height=11&margin=%5Bobject%20Object%5D&name=image.png&originHeight=21&originWidth=210&size=364&status=done&style=none&width=105) | 10 色#FF6B3B #626681 #FFC100 #9FB40F #76523B #DAD5B5 #0E8E89 #E19348 #F383A2 #247FEA | -| --- | --- | --- | -| | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/73157/1602817936610-bf9ea586-2d27-461d-89ce-ccea952f7f5d.png#align=left&display=inline&height=11&margin=%5Bobject%20Object%5D&name=image.png&originHeight=21&originWidth=420&size=698&status=done&style=none&width=210) | 20 色
#FF6B3B #626681 #FFC100 #9FB40F #76523B #DAD5B5 #0E8E89 #E19348 #F383A2 #247FEA 
#2BCB95 #B1ABF4 #1D42C2 #1D9ED1 #D64BC0 #255634 #8C8C47 #8CDAE5 #8E283B #791DC9 | -| PaletteQualitative-Macaron | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/73157/1602818647659-4bf5fbff-513a-4615-8b7f-7abde70ae2f9.png#align=left&display=inline&height=11&margin=%5Bobject%20Object%5D&name=image.png&originHeight=21&originWidth=210&size=364&status=done&style=none&width=105) | 10 色#025DF4 #DB6BCF #2498D1 #BBBDE6 #4045B2 #21A97A #FF745A #007E99 #FFA8A8 #2391FF  | -| | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/73157/1602818656906-112cfbdc-44f1-4678-a80e-e606d5e10513.png#align=left&display=inline&height=11&margin=%5Bobject%20Object%5D&name=image.png&originHeight=21&originWidth=420&size=696&status=done&style=none&width=210) | 20 色
#025DF4 #DB6BCF #2498D1 #BBBDE6 #4045B2 #21A97A #FF745A #007E99 #FFA8A8 #2391FF 
#FFC328 #A0DC2C #946DFF #626681 #EB4185 #CD8150  #36BCCB #327039 #803488 #83BC99  | -| PaletteQualitative-Contrasting Orange | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/73157/1602818815891-5ee1be7f-5b9e-40c0-be5c-33a25b8a2cb0.png#align=left&display=inline&height=11&margin=%5Bobject%20Object%5D&name=image.png&originHeight=21&originWidth=210&size=364&status=done&style=none&width=105) | 10 色
#FF4500 #1AAF8B #406C85 #F6BD16 #B40F0F #2FB8FC #4435FF #FF5CA2 #BBE800 #FE8A26 | -| | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/73157/1602818804638-1269325f-6486-4be4-ae70-9ea78a1b57f0.png#align=left&display=inline&height=11&margin=%5Bobject%20Object%5D&name=image.png&originHeight=21&originWidth=420&size=699&status=done&style=none&width=210) | 20 色
#FF4500 #1AAF8B #406C85 #F6BD16 #B40F0F #2FB8FC #4435FF #FF5CA2 #BBE800 #FE8A26
#946DFF #6C3E00 #6193FF #FF988E #36BCCB #004988 #FFCF9D #CCDC8A #8D00A1 #1CC25E | - -
- -## 顺序色板 - -#### 单一顺序色板(最多支持 8 色,最少支持 2 色) - -| 色板名称 | 例 | 色值 | -| --- | --- | --- | -| PaletteSequential-Geek Blue | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/181989/1605070627755-c6b060d0-ee3c-4b1d-a7d0-425cfb770e08.png#align=left&display=inline&height=39&margin=%5Bobject%20Object%5D&name=image.png&originHeight=78&originWidth=588&size=14236&status=done&style=none&width=294) | #B8E1FF #9AC5FF #7DAAFF #5B8FF9 #3D76DD
#085EC0 #0047A5 #00318A #001D70 | -| PaletteSequential-Cyan | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/181989/1605070640708-ce2c17fb-64a4-4f8d-afe9-7c59f6604d06.png#align=left&display=inline&height=39&margin=%5Bobject%20Object%5D&name=image.png&originHeight=78&originWidth=586&size=13914&status=done&style=none&width=293) | #9DF5CA #61DDAA #42C090 #19A576 #008A5D
#006F45 #00562F #003E19 #002800 | -| PaletteSequential-Grey | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/181989/1605070650742-a0842ec4-83d8-4198-900b-e9fba917eb27.png#align=left&display=inline&height=40&margin=%5Bobject%20Object%5D&name=image.png&originHeight=80&originWidth=584&size=9848&status=done&style=none&width=292) | #D0E4FF #B4C8ED #99ADD1 #7E92B5 #65789B
#4C6080 #334867 #1B324F #021D38 | -| PaletteSequential-Sunrise Yellow | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/181989/1605070662673-9431934f-8a5f-4c3b-af69-3bf52104ed90.png#align=left&display=inline&height=37&margin=%5Bobject%20Object%5D&name=image.png&originHeight=74&originWidth=584&size=13408&status=done&style=none&uid=1605070662630-0&width=292) | #FFD83B #F6BD16 #D7A100 #B98700 #9C6E00
#7F5600 #633F00 #482900 #2F1400 | -| PaletteSequential-Deep Purple | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/181989/1605071698237-9c76a794-3379-4026-9bed-a356b688df89.png#align=left&display=inline&height=36&margin=%5Bobject%20Object%5D&name=image.png&originHeight=72&originWidth=582&size=11628&status=done&style=none&width=291) | #EBCCFF #CCB0FF #AE95FF #907BFF #7262FD
#5349E0 #2F32C3 #001BA7 #00068C | -| PaletteSequential-Daybreak Blue | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/181989/1605072380911-48dcd291-adb8-4d7c-9a92-ed60655009d5.png#align=left&display=inline&height=38&margin=%5Bobject%20Object%5D&name=image.png&originHeight=76&originWidth=586&size=13422&status=done&style=none&width=293) | #95F0FF #78D3F8 #5AB8DB #3A9DBF #0A82A4
#00698A #005170 #003958 #002440 | -| PaletteSequential-Golden Purple | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/181989/1605072404396-4c6e387e-585d-45cb-bbe4-d7a77a82fbf9.png#align=left&display=inline&height=39&margin=%5Bobject%20Object%5D&name=image.png&originHeight=78&originWidth=584&size=10731&status=done&style=none&width=292) | #FFCCFF #EBB0FF #CE95F5 #B27AD8 #9661BC
#7B48A1 #613086 #48186C #2E0054 | -| PaletteSequential-Sunset Orange | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/181989/1605072426530-b2ce1842-a3f9-473e-aa49-628e1bec9aff.png#align=left&display=inline&height=38&margin=%5Bobject%20Object%5D&name=image.png&originHeight=76&originWidth=582&size=13864&status=done&style=none&width=291) | #FFC771 #FFAB57 #F6903D #D77622 #B85C00
#9B4300 #7D2A00 #601000 #450000 | -| PaletteSequential-Dark Green | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/181989/1605072444549-2a06cef9-caf9-4ce9-bb20-a6e5c31ab2ac.png#align=left&display=inline&height=37&margin=%5Bobject%20Object%5D&name=image.png&originHeight=74&originWidth=582&size=12608&status=done&style=none&width=291) | #8CF4F2 #6FD8D6 #52BCBA #31A09F #008685
#006C6C #005354 #003B3D #002627 | -| PaletteSequential-Magenta | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/181989/1605072463803-fd0996df-449b-4a25-970d-93e8b9cc8c11.png#align=left&display=inline&height=37&margin=%5Bobject%20Object%5D&name=image.png&originHeight=74&originWidth=582&size=10580&status=done&style=none&width=291) | #FFC2EC #FFA6D0 #F08BB4 #D37099 #B65680
#9A3C67 #7E214F #630038 #490022 | -| PaletteSequential-Dust Red | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/181989/1605072481852-85491459-69ae-4624-a531-cc6ac0ae1f92.png#align=left&display=inline&height=40&margin=%5Bobject%20Object%5D&name=image.png&originHeight=80&originWidth=586&size=13797&status=done&style=none&width=293) | #FFBB95 #FF9E7B #FF8362 #E8684A #C84D32
#AA311C #8C1104 #6F0000 #510000 | -| PaletteSequential-Dark | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/181989/1605072496468-3d403fd6-3af4-438b-82ee-12d2b21676e1.png#align=left&display=inline&height=38&margin=%5Bobject%20Object%5D&name=image.png&originHeight=76&originWidth=584&size=5954&status=done&style=none&width=292) | #E2E2E2 #C6C6C6 #ABABAB #919191 #777777
#5E5E5E #474747 #303030 #1B1B1B | - -#### - -#### 邻近色顺序色板 - -最多支持 9 色,最少支持 2 色 - -| 色板名称 | 例 | 色值 | -| --- | --- | --- | -| PaletteSequential-Sunset Orange | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582706835452-ef15be90-3710-42d8-a8a0-386d3e5ed492.png#align=left&display=inline&height=49&name=image.png&originHeight=98&originWidth=776&size=19974&status=done&style=none&width=388) | #FDEDBE #FFDF80 #FFCB33 #FFB200 #FF8C00 #FF6500 #E6450F #B22C00 #661900 | -| PaletteSequential-Leaf Yellow | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582707005945-970022cb-f798-46ff-b66e-11cd05b52430.png#align=left&display=inline&height=42&name=image.png&originHeight=84&originWidth=598&size=16628&status=done&style=none&width=299) | #FFEBB0 #FFDF80 #FACA3E #E6B80B #B5AC23 #6A9A48 #20876B #06746B #044E48 | -| PaletteSequential-Golden Purple | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582707131451-1b6c1380-787e-4a3c-a7f2-c9f5c1036a47.png#align=left&display=inline&height=55&name=image.png&originHeight=110&originWidth=840&size=20026&status=done&style=none&width=420) | #FACDAA #F4A49E #EE7B91 #E85285 #BE408C #942D93 #6A1B9A #56167D #42105F | -| PaletteSequential-Geek Blue | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582707111274-6ea8b3e6-e11d-4158-9f19-8ca4b5448bc0.png#align=left&display=inline&height=59&name=image.png&originHeight=118&originWidth=846&size=21177&status=done&style=none&width=423) | #D2EDC8 #A9DACC #75C6D1 #42B3D5 #3993C2 #3073AE #27539B #1E3388 #171E6D | - -
- -## 发散色板 - -最多支持 17 色,最少支持 3 色 - -| 色板名称 | 例 | 色值 | -| --- | --- | --- | -| PaletteDiverging-Cyan/Yellow | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1603098373381-aac507a9-c414-4333-9466-8af1450c4b16.png#align=left&display=inline&height=41&margin=%5Bobject%20Object%5D&name=image.png&originHeight=102&originWidth=462&size=20303&status=done&style=none&width=185) | #215B77 #227BA2 #1B9CD0 #22BAED #61C9FF #8AD4FF #ABDFFF #C9E9FF 
#EFF3DE #FFE9B8 #FFDE94 #FFD470 #FFC741 #EDB40A #D09C10 #A37B16 #795B16 | -| PaletteDiverging-Green/Red | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1603098086728-e552417d-9108-4c98-be85-77e2e17e9b8b.png#align=left&display=inline&height=43&margin=%5Bobject%20Object%5D&name=image.png&originHeight=85&originWidth=371&size=18314&status=done&style=none&width=185.5) | #014c63 #10686c #168575 #16a37e #0bc286 #65cf9b #96dcb0 #c1e8c5
#F2EAEA #FFC5AC #FFA884 #FF895D #FF6836 #F3470D #D13808 #A4300C #7A270E | -| PaletteDiverging-Green/Yellow | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582711081552-eac446e3-68a9-4e55-8b4a-76557c5d792c.png#align=left&display=inline&height=46&name=image.png&originHeight=92&originWidth=1184&size=23763&status=done&style=none&width=592) | #003F7F #004C99 #0059B2 #0072E5 #1A8CFF #4DA6FF #80BFFF #B3D9FF #EAE9EB #FFD5B1 #FFC08C #FFAB66 #FF963E #F17F0B #D16A0C #A45411 #794012
| -| PaletteDiverging-Grow | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1583055027341-8f5acc74-73e0-44ef-9870-fcf831d3c947.png#align=left&display=inline&height=52&margin=%5Bobject%20Object%5D&name=image.png&originHeight=104&originWidth=1412&size=31976&status=done&style=none&width=706) |
#014c63 #10686c #168575 #16a37e #0bc286 #65cf9b #96dcb0 #c1e8c5 #eaf3db
#f1e3af #f3d282 #f2c354 #eeb311 #de9111 #cd6e10 #bb490f #a8190d | -| PaletteDiverging-Magic | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582711923218-9abcd8a8-233f-4f3e-a950-32e569cbccf7.png#align=left&display=inline&height=49&name=image.png&originHeight=98&originWidth=1254&size=33563&status=done&style=none&width=627) | #661900 #B22C00 #E6450F #FF6500 #FF8C00 #FFB200 #FFCB33 #FFDF80 #FFE2DC #EAACFF #DD78FF #C53FFF #A700FF #8500FF #620BE1 #3607C2 #27029A | -| PaletteDiverging-Classic | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582711954878-09b6198f-7ac2-453e-9741-d6ee18f3c2c2.png#align=left&display=inline&height=48&name=image.png&originHeight=96&originWidth=1246&size=31502&status=done&style=none&uid=1582711954493-0&width=623) | #661900 #B22C00 #E6450F #FF6500 #FF8C00 #FFB200 #FFCB33 #FFDF80 #E0F2EB #66D8FF #1AC5FF #00A5FF #007FFF #0059FF #0040FF #002CB2 #001F7F | - -
- -## 叠加色板 - -双变量用色,最多支持 9 色,最少 2 色 - -| 色板名称 | 例 | 色值 | -| --- | --- | --- | -| PaletteBlend-MYG | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582714713557-9d7e15fb-edc3-46e9-8d0b-c7ba0aa0eb5c.png#align=left&display=inline&height=112&name=image.png&originHeight=418&originWidth=420&size=57199&status=done&style=none&width=113) | #DFE9C1 #7AC675 #168D38 #DFCA62 #7AAC3C #167B1C #B5950E #637E08 #115A04 | -| PaletteBlend-MPC | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582714991914-49db46b6-bf1c-42f2-a720-edf436e520f6.png#align=left&display=inline&height=113&name=image.png&originHeight=396&originWidth=396&size=51652&status=done&style=none&width=113) | #D7D1FF #A0BFFF #209FED #B78DFF #8881FF #1B6BED #8D43FF #693EFF #1533ED | -| PaletteBlend-MBG | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582714203268-cc97f28b-4969-4538-9394-722d1ae61b35.png#align=left&display=inline&height=111&name=image.png&originHeight=340&originWidth=334&size=21086&status=done&style=none&width=109) | #BBDFE1 #66BD89 #128742 #6FB6E1 #3D9B89 #0B6E42 #1685E1 #0C7189 #025142 | -| PaletteBlend-MOB | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582714219926-aaae5b3e-f253-482e-a3a5-61a6de5788de.png#align=left&display=inline&height=109&name=image.png&originHeight=334&originWidth=334&size=20275&status=done&style=none&width=109) | #D6D6D8 #80AFD8 #1A80D8 #D6B08C #808F8C #1A698C #D6893E #80703E #1A523E | - -
**强调色板  **分为 9 色和 19 色 - -| 色板名称 | 例 | 色值 | 色板名称 | 例 | 色值 | -| --- | --- | --- | --- | --- | --- | -| PaletteUnderline9-1 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667373415-c6b5238d-fc04-4ca0-ad9f-51131ac5dace.png#align=left&display=inline&height=24&name=image.png&originHeight=100&originWidth=100&size=409&status=done&style=none&width=24) | #5B8FF9 | PaletteUnderline19-1 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667373415-c6b5238d-fc04-4ca0-ad9f-51131ac5dace.png#align=left&display=inline&height=24&name=image.png&originHeight=100&originWidth=100&size=409&status=done&style=none&width=24) | #5B8FF9 | -| PaletteUnderline9-2 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667440954-dcbb6b3f-e07b-4208-8137-2df92f7e6a4a.png#align=left&display=inline&height=50&name=image.png&originHeight=100&originWidth=106&size=425&status=done&style=none&width=53) | #945FB9 | PaletteUnderline19-2 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667440954-dcbb6b3f-e07b-4208-8137-2df92f7e6a4a.png#align=left&display=inline&height=50&name=image.png&originHeight=100&originWidth=106&size=425&status=done&style=none&width=53) | #945FB9 | -| PaletteUnderline9-3 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667427711-28cd3943-969c-4c19-8d79-310b76d29ff2.png#align=left&display=inline&height=48&name=image.png&originHeight=96&originWidth=102&size=402&status=done&style=none&width=51) | #E86452 | PaletteUnderline19-3 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667427711-28cd3943-969c-4c19-8d79-310b76d29ff2.png#align=left&display=inline&height=48&name=image.png&originHeight=96&originWidth=102&size=402&status=done&style=none&width=51) | #E86452 | -| PaletteUnderline9-4 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667455031-a89acef3-a0d8-4586-8ad1-cd674c179e29.png#align=left&display=inline&height=48&name=image.png&originHeight=96&originWidth=98&size=391&status=done&style=none&width=49) | #1E9493 | PaletteUnderline19-4 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667455031-a89acef3-a0d8-4586-8ad1-cd674c179e29.png#align=left&display=inline&height=48&name=image.png&originHeight=96&originWidth=98&size=391&status=done&style=none&width=49) | #1E9493 | -| PaletteUnderline9-5 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582715590911-aed310f9-018e-46e2-b1d9-0da07de23c24.png#align=left&display=inline&height=52&name=image.png&originHeight=104&originWidth=102&size=1770&status=done&style=none&width=51) | #BEDED1 | PaletteUnderline19-5 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667387861-c1343ddc-34ab-4d49-9e29-44eead0e3a7f.png#align=left&display=inline&height=24&name=image.png&originHeight=106&originWidth=106&size=445&status=done&style=none&width=24) | #5AD8A6 | -| PaletteUnderline9-6 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582715598741-da28cced-887b-4fb3-bfa4-84a430309ab3.png#align=left&display=inline&height=56&name=image.png&originHeight=112&originWidth=104&size=2556&status=done&style=none&width=52) | #EFE0B5 | PaletteUnderline19-6 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667419248-a502a18a-0d28-4bf0-88ab-47076ed9a132.png#align=left&display=inline&height=57&name=image.png&originHeight=114&originWidth=104&size=463&status=done&style=none&width=52) | #F6BD16 | -| PaletteUnderline9-7 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582715605951-4932d4a5-3a4e-4d31-acf0-f4ac07232bd4.png#align=left&display=inline&height=56&name=image.png&originHeight=112&originWidth=106&size=2607&status=done&style=none&width=53) | #B5D7E5 | PaletteUnderline19-7 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667433701-f74b31a1-a332-4415-b270-e73d932fc600.png#align=left&display=inline&height=51&name=image.png&originHeight=102&originWidth=104&size=424&status=done&style=none&width=52) | #6DC8EC | -| PaletteUnderline9-8 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582715614061-f9763d53-ea96-4468-99bc-674a6367c1cc.png#align=left&display=inline&height=53&name=image.png&originHeight=106&originWidth=108&size=2626&status=done&style=none&width=54) | #F4DBC6 | PaletteUnderline19-8 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667447050-bea49bd8-e505-4c7c-89e8-a91c0b719692.png#align=left&display=inline&height=53&name=image.png&originHeight=106&originWidth=104&size=435&status=done&style=none&width=52) | #FF9845 | -| PaletteUnderline9-9 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582715626747-400f6c60-d456-4233-b4f2-acca01ccdb34.png#align=left&display=inline&height=55&name=image.png&originHeight=110&originWidth=106&size=2255&status=done&style=none&width=53) | #F2CADA | PaletteUnderline19-9 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667462743-3d9bfc8c-773d-46fe-bb1d-58bf6617c3ea.png#align=left&display=inline&height=51&name=image.png&originHeight=102&originWidth=106&size=431&status=done&style=none&width=53) | #FF99C3 | -| | | | PaletteUnderline19-10 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581931341653-be214cfa-a217-468c-a859-f602d25071e9.png#align=left&display=inline&height=21&name=image.png&originHeight=42&originWidth=44&size=158&status=done&style=none&width=22) | #CDDDFD | -| | | | PaletteUnderline19-11 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582715590911-aed310f9-018e-46e2-b1d9-0da07de23c24.png#align=left&display=inline&height=52&name=image.png&originHeight=104&originWidth=102&size=1770&status=done&style=none&width=51) | #BEDED1 | -| | | | PaletteUnderline19-12 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581931466348-1f7e3f7a-0ebb-4218-a220-1c1bd505cd96.png#align=left&display=inline&height=25&name=image.png&originHeight=50&originWidth=46&size=174&status=done&style=none&width=23) | #CED4DE | -| | | | PaletteUnderline19-13 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581931498184-fb10c88f-9c28-4696-9065-dd1f66807a83.png#align=left&display=inline&height=23&name=image.png&originHeight=46&originWidth=42&size=165&status=done&style=none&width=21) | #FCEBB9 | -| | | | PaletteUnderline19-14 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581931505504-10f04722-4ebb-493b-889b-ab7ce73b8cbe.png#align=left&display=inline&height=24&name=image.png&originHeight=48&originWidth=46&size=170&status=done&style=none&width=23) | #F8D0CB | -| | | | PaletteUnderline19-15 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582715605951-4932d4a5-3a4e-4d31-acf0-f4ac07232bd4.png#align=left&display=inline&height=56&name=image.png&originHeight=112&originWidth=106&size=2607&status=done&style=none&width=53) | #B5D7E5 | -| | | | PaletteUnderline19-16 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581931539706-0ff7787b-bb01-43df-a097-e1924b1351cc.png#align=left&display=inline&height=22&name=image.png&originHeight=44&originWidth=38&size=159&status=done&style=none&width=19) | #DECFEA | -| | | | PaletteUnderline19-17 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581931558551-75870146-ee48-4df6-a8f1-1f74c2b0ef1c.png#align=left&display=inline&height=24&name=image.png&originHeight=48&originWidth=42&size=167&status=done&style=none&width=21) | #FFE0C7 | -| | | | PaletteUnderline19-18 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582716098221-9d86ff35-0cb2-4bb1-9c53-8d0830aabc42.png#align=left&display=inline&height=44&name=image.png&originHeight=88&originWidth=84&size=2750&status=done&style=none&width=42) | #AAD8D8 | -| | | | PaletteUnderline19-19 | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/185301/1582715626747-400f6c60-d456-4233-b4f2-acca01ccdb34.png#align=left&display=inline&height=55&name=image.png&originHeight=110&originWidth=106&size=2255&status=done&style=none&width=53) | #F2CADA | -| | | | | | | - -## 语义色板 - -分为 3 色 - -| 色板名称 | 例 | 色值 | -| --- | --- | --- | -| PaletteSemantic-red | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581667679677-6d139bcb-8b39-40b9-befa-b782f84d1fe5.png#align=left&display=inline&height=52&name=image.png&originHeight=104&originWidth=104&size=431&status=done&style=none&width=52) | #F4664A | -| PaletteSemantic-green | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581669179361-888e43fc-2e6e-49d8-8969-45678457fb93.png#align=left&display=inline&height=48&name=image.png&originHeight=96&originWidth=100&size=397&status=done&style=none&width=50) | #30BF78 | -| PaletteSemantic-yellow | ![image.png](https://intranetproxy.alipay.com/skylark/lark/0/2020/png/56/1581669198149-8e18284b-5828-4231-9a57-beb9d5ec5aba.png#align=left&display=inline&height=51&name=image.png&originHeight=102&originWidth=98&size=411&status=done&style=none&width=49) | #FAAD14 | + diff --git a/docs/specification/strategy/analysis.en.md b/docs/specification/strategy/analysis.en.md index ba076e847..ff3dbdda0 100644 --- a/docs/specification/strategy/analysis.en.md +++ b/docs/specification/strategy/analysis.en.md @@ -3,29 +3,4 @@ title: Analysis Module order: 1 --- -## 概览 - -数据可视化是一个相对的过程,你想要用户看到什么取决于他能看到什么。设计者通过对数据进行编码设计,阅读者再对数据进行解码,去理解可视化背后的数据。 - -- **设计者,**从数据到图表——数据元素到视觉编码的映射过程 -- **阅读者,**从图表到数据——视觉解码还原为数据结构的过程 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*twtrS6DuNsAAAAAAAAAAAAAAARQnAQ) - -## 分析模型 - -我们设计数据可视化时,应当站在用户的角度换位思考。用户面对可视化时,通常会套用一个固化的分析思路,它们环环相扣形成闭环,是固定的分析模式,我们称之“分析模型”。 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*pwHGQJNBAd4AAAAAAAAAAAAAARQnAQ) - -> 5W 模型最早由 IBM 提出,作为通用分析模型指引分析师进行工作。 - -“发生了什么”、“为什么会发生”、“接下来会发生什么”、“我能做什么”、“我的计划是什么” 这几个问题越往前越浅显偏现象、越往后越偏本质及解决方案,中间有任何卡壳都会影响用户的分析思路甚至导致分析流程中断。 - -1. 发生了什么?有没有“冲突”? -1. 为什么会发生?“冲突”的原因是什么?为什么会发生? -1. 接下来会发生什么?有没有特征线索表明“冲突”会持续下去? -1. 我能做什么?怎么避免“冲突”继续 发生或者让“冲突”反转? -1. 我的计划是什么?针对“冲突”我能做什么? - -所以在可视化设计时,应当甄别用户可能会遇到的问题、以看问题的视角来确定数据的展示顺序及视图关系,设计上突显需阐述的道理或规律,让其可以帮助用户透过现象看本质甚至预测未来。 + diff --git a/docs/specification/strategy/analysis.zh.md b/docs/specification/strategy/analysis.zh.md index ebff4171c..671545fc1 100644 --- a/docs/specification/strategy/analysis.zh.md +++ b/docs/specification/strategy/analysis.zh.md @@ -7,8 +7,8 @@ order: 1 数据可视化是一个相对的过程,你想要用户看到什么取决于他能看到什么。设计者通过对数据进行编码设计,阅读者再对数据进行解码,去理解可视化背后的数据。 -- **设计者,**从数据到图表——数据元素到视觉编码的映射过程 -- **阅读者,**从图表到数据——视觉解码还原为数据结构的过程 +- **设计者**:从数据到图表——数据元素到视觉编码的映射过程 +- **阅读者**:从图表到数据——视觉解码还原为数据结构的过程 ![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*twtrS6DuNsAAAAAAAAAAAAAAARQnAQ) diff --git a/docs/specification/strategy/modal.en.md b/docs/specification/strategy/modal.en.md index 6277bcc4a..7e2ea749e 100644 --- a/docs/specification/strategy/modal.en.md +++ b/docs/specification/strategy/modal.en.md @@ -3,46 +3,4 @@ title: Design Module order: 0 --- -## 总览 - -2005 年,英国设计协会(The British Design Council)首次提出“双钻设计模型”(double-diamond design process model),他们将设计过程分为 4 个阶段(探索 > 聚焦 > 设计 > 评估)。该双钻模型同样适合于数据可视化设计。 - - - -值得注意的是,数据可视化中,如果一个双钻流程没能拿到结果,那么我们再次探索、聚焦,直至找到满意的可视化解决方案。 - -## 探索 - -设计师在接到可视化设计任务时,切忌马上开始画稿。AntV 提倡从“提问题开始设计”。不断提问,扩大问题范围,进一步检测问题之下的根本原因,然后聚焦于其中一个问题的描述。 - -- **业务背景:**业务方是谁?可视化的目的是什么? -- **产品分析:**产品是什么?投放在哪?是否需要跨端适配? -- **了解用户:**给谁看?年龄?知识构成? -- **观察数据:**数据来自哪里?数据结构如何?数据极值情况如何?数据产出时效、质量如何? - -## 聚焦 - -经过第一阶段的探索,第二阶段我们需要聚焦。可视化作品可以传达什么?我们用户想要在可视化上看到什么? - -- **用户目标:**可视化解决什么问题?用户关注哪些核心指标?在使用链路上是否需要协作? -- **设计目标:**如何凸显用户关注的核心指标?我们期望用户看到什么? - -## 设计 - -接下来,我们要开始画图了,但我们还得反问我们自己:我们应该阐述什么样的观点?用什么图表类型阐述比较合适呢?视觉设计上面需要注意什么?用户需要与可视化进行交互吗?交互上需要注意什么? - -- **图表类型:**数据类型(地理可视化数据、图数据、常规统计数据)、用户分析目地(看关系、看分布、看趋势、看比较、分析整体与部分关系)决定图表类型。AntV 提供图表分类导航决策树,借助它,我们可以快速定位我们可以使用的图表; -- **视觉设计:**AntV 有一套完成的视觉设计体系,包括”布局“、”色板“、”字体“。详见[视觉设计指引](https://ava.antv.antgroup.com/en/docs/specification/language/basic); -- **交互设计:**屏幕空间很小?数据放不下怎么办,用户能否与数据进行交互?是否要为多端设计。详见[交互设计指引](https://ava.antv.antgroup.com/en/docs/specification/language/interact); -- **观点阐述:**数据反映出来的趋势或者关系分布能否总结出来?异常数据是否需要标记出来?你可能需要用到[标注组件](https://ava.antv.antgroup.com/en/docs/specification/module/annotation)。 - -![image.png](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*Ql9TT6WcvuQAAAAAAAAAAAAAARQnAQ)
- -## 评估 - -设计好的可视化作品,用户看得懂吗?AntV 的四条核心原则:准确、清晰、有效、美,这四条原则也是评估可视化作品的四点准则;
![设计原则.jpg](https://gw.alipayobjects.com/mdn/rms_a8a5bf/afts/img/A*8x7ORJcLj9YAAAAAAAAAAAAAARQnAQ) - -- **测试:**找用户或者身边同事,让他们扫视你的作品,描述他们第一眼感觉,看能否匹配你的设计预期。再让他们点一点、操作一下,能否找到自己想要的数据; -- **迭代**:如果不能,建议反问用户、反问自己问题出在哪里,并开始新一轮的迭代优化。 - -#### + diff --git a/docs/specification/tool/createrColor.en.md b/docs/specification/tool/createrColor.en.md deleted file mode 100644 index d28551209..000000000 --- a/docs/specification/tool/createrColor.en.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -title: Creat Self Color -order: 0 ---- - - diff --git a/docs/specification/tool/creator-color.en.md b/docs/specification/tool/creator-color.en.md new file mode 100644 index 000000000..31f23a5c9 --- /dev/null +++ b/docs/specification/tool/creator-color.en.md @@ -0,0 +1,6 @@ +--- +title: Creat Self Color +order: 0 +--- + + diff --git a/docs/specification/tool/createrColor.zh.md b/docs/specification/tool/creator-color.zh.md similarity index 67% rename from docs/specification/tool/createrColor.zh.md rename to docs/specification/tool/creator-color.zh.md index 9a2c41f47..284e8804c 100644 --- a/docs/specification/tool/createrColor.zh.md +++ b/docs/specification/tool/creator-color.zh.md @@ -5,9 +5,9 @@ order: 0 可视化色板是数据驱动的,色彩背后还承载着数据信息,不能单纯依靠美丑评判好坏,一套优秀的可视化色板应该让用户信任数据,轻松阅读数据,并能启发用户发掘数据背后的意义。基于新的设计价值观和考虑帮助设计师上手一套色板设计,我们将色板设计流程化的同时,提炼设计规则量化为色彩算法,实现用户输入品牌色即可轻松得到一整套可视化色板,实现人人都可以是专业的可视化设计师。 -## AntV可视化色彩体系 +## AntV 可视化色彩体系 -了解了可视化色板的业务特点后,接下来让我们深入了解antv的可视化色彩体系,根据不同的业务场景,antv总共有6套不同的色板,其中最关键的是分类色板,其他色板都是分类色板根据一定的映射关系衍生而来,因此本次升级会以分类色板作为抓手进行升级。 +了解了可视化色板的业务特点后,接下来让我们深入了解 antv 的可视化色彩体系,根据不同的业务场景,antv 总共有 6 套不同的色板,其中最关键的是分类色板,其他色板都是分类色板根据一定的映射关系衍生而来,因此本次升级会以分类色板作为抓手进行升级。 @@ -15,7 +15,7 @@ order: 0 ## 升级的原因是什么? -本次色板升级主要有两个原因:首先是antv5.0从人的视角重新提出了三个价值观,新的价值观对可视化色板提出了更多要求。其次是5.0开放了系统灵活度,支持用户自定义主题色来生成专属的可视化色板,需要一套可被算法实现的取色逻辑。 +本次色板升级主要有两个原因:首先是 antv5.0 从人的视角重新提出了三个价值观,新的价值观对可视化色板提出了更多要求。其次是 5.0 开放了系统灵活度,支持用户自定义主题色来生成专属的可视化色板,需要一套可被算法实现的取色逻辑。 @@ -23,16 +23,15 @@ order: 0 ## 现状分析 -明确了升级的原因后,让我们带着新的价值观来看看当前色板有哪些问题。 -信任感要求色彩应该避免让用户产生歧义,4.0色板中的灰色会红色分别会让用户误以为是对比数据和警告数据,从而造成用户疑惑。 +明确了升级的原因后,让我们带着新的价值观来看看当前色板有哪些问题。信任感要求色彩应该避免让用户产生歧义,4.0 色板中的灰色会红色分别会让用户误以为是对比数据和警告数据,从而造成用户疑惑。 -轻松感要求色板应该清晰容易识别,3.0色板整体与白色的对比较小,色彩运用到图形上不够清晰,图形上的文字不易阅读。 +轻松感要求色板应该清晰容易识别,3.0 色板整体与白色的对比较小,色彩运用到图形上不够清晰,图形上的文字不易阅读。 -意义感要求色彩帮助用户更好的理解数据,对于这一点,antv5.0会在官网消费侧通过色板使用指南帮助设计师正确的使用可视化色板。 +意义感要求色彩帮助用户更好的理解数据,对于这一点,antv5.0 会在官网消费侧通过色板使用指南帮助设计师正确的使用可视化色板。 @@ -40,10 +39,7 @@ order: 0 ## 设计流程 -明确了升级原因和当前的问题后,我们主要会从下面三个步骤进行优化: -第一步是确定取色逻辑:通过参考经典的配色理论来确定取色规律并得到色板初稿; -第二步是基线检测:通过量化和测试的方式去检验色板是否满足价值观的要求; -第三步是感性调整:在理性的推导之上加上感性的调整让色彩和谐舒; +明确了升级原因和当前的问题后,我们主要会从下面三个步骤进行优化:第一步是确定取色逻辑:通过参考经典的配色理论来确定取色规律并得到色板初稿;第二步是基线检测:通过量化和测试的方式去检验色板是否满足价值观的要求;第三步是感性调整:在理性的推导之上加上感性的调整让色彩和谐舒; @@ -51,11 +47,11 @@ order: 0 ## Step1:确定取色逻辑 -首先进入到第一步,我们先来看一下4.0色板的取色逻辑是什么,如图所示,4.0色板在色彩的选取上有一定的逻辑,包括相邻色彩之间的明暗间隔,色彩之间的距离等,5.0会在4.0的基础上继续优化,同时对取色逻辑进行量化用于后期的拓展和算法实现。 +首先进入到第一步,我们先来看一下 4.0 色板的取色逻辑是什么,如图所示,4.0 色板在色彩的选取上有一定的逻辑,包括相邻色彩之间的明暗间隔,色彩之间的距离等,5.0 会在 4.0 的基础上继续优化,同时对取色逻辑进行量化用于后期的拓展和算法实现。 -为了得到一套可被量化同时又具有色彩搭配美感的取色方式,我们参考了经典的配色理论,包括「邻近取色」「对比取色」「分裂互补取色」从支付宝的品牌色出发依次使用三种配色方式得到三组色板。其中邻近取色沿着一个方向,按照相同的夹角取色,其优点是色彩具有很强的规律感和和谐度,缺点是整体区分度比较低。对比取色是相邻两个色彩是一组成180度的对比色,其优点是色板具有很强的区分度,缺点是相邻两色会误以为是一组对比数据,分裂互补取色是三个一组取色,前两个颜色是一组邻近色,第三个颜色是前两个颜色共同的对比色,这种取色方式兼顾了邻近色的和谐同时又有较高的区分度,没有明显的劣势。**因此5.0确定以分裂互补取色方式作为取色逻辑。** +为了得到一套可被量化同时又具有色彩搭配美感的取色方式,我们参考了经典的配色理论,包括「邻近取色」「对比取色」「分裂互补取色」从支付宝的品牌色出发依次使用三种配色方式得到三组色板。其中邻近取色沿着一个方向,按照相同的夹角取色,其优点是色彩具有很强的规律感和和谐度,缺点是整体区分度比较低。对比取色是相邻两个色彩是一组成 180 度的对比色,其优点是色板具有很强的区分度,缺点是相邻两色会误以为是一组对比数据,分裂互补取色是三个一组取色,前两个颜色是一组邻近色,第三个颜色是前两个颜色共同的对比色,这种取色方式兼顾了邻近色的和谐同时又有较高的区分度,没有明显的劣势。**因此 5.0 确定以分裂互补取色方式作为取色逻辑。** @@ -63,7 +59,7 @@ order: 0 ## Step2:基线矫正 -根据取色方式得到色板初稿后,还需要通过4个基线矫正来让色彩满足价值观的要求。 +根据取色方式得到色板初稿后,还需要通过 4 个基线矫正来让色彩满足价值观的要求。 ### 色彩不存在歧义 @@ -73,13 +69,13 @@ order: 0 ### 色彩足够清晰 -无论作为元素还是容器,色彩与其相交的内容的对比度都应满足W3C可访问标准。 +无论作为元素还是容器,色彩与其相交的内容的对比度都应满足 W3C 可访问标准。 ### 色彩间有区分 -色彩之间具有足够的区分度,通过在Lab模型下计算色彩之间的欧几里得距离来量化区分度,并确保该值大于可区分阈值。 +色彩之间具有足够的区分度,通过在 Lab 模型下计算色彩之间的欧几里得距离来量化区分度,并确保该值大于可区分阈值。 diff --git a/package.json b/package.json index dc7575678..0c01c2516 100644 --- a/package.json +++ b/package.json @@ -50,8 +50,8 @@ "license": "MIT", "scripts": { "start": "npm run develop", - "build": "NODE_OPTIONS=--max-old-space-size=4096 dumi build", - "develop": "NODE_OPTIONS=--max-old-space-size=4096 dumi dev", + "build": "dumi build", + "dev": "dumi dev", "deploy": " npm run build && npm run gh-pages", "gh-pages": "gh-pages -d dist", "copy-mirror-action": "mkdir -p public/.github/workflows && cp .github/workflows/mirror.yml public/.github/workflows", diff --git a/site/components/Banner/Banner.module.less b/site/components/Banner/Banner.module.less index 01c8a682a..5afcb53d3 100644 --- a/site/components/Banner/Banner.module.less +++ b/site/components/Banner/Banner.module.less @@ -23,7 +23,7 @@ background-repeat: no-repeat; background-size: contain; - >img { + > img { position: absolute; } } @@ -130,13 +130,13 @@ margin-top: 138px; font-family: AlibabaPuHuiTiRHeavy; - >span { - color: #691EFF; + > span { + color: #691eff; } } .subTitle { - color: #424E66; + color: #424e66; text-align: center; font-size: 18px; margin-top: 8px; @@ -157,8 +157,8 @@ top: 350px; width: 100%; - >div, - >a { + > div, + > a { &:extend(.commonFlexConfig); height: 54px; width: 166px; @@ -169,28 +169,26 @@ box-shadow: 0 8px 28px 0 #f2f2f2; margin: 0 11.5px; - >img { + > img { margin-right: 6px; } } .start { font-size: 18px; - background-color: #691EFF; - color: #FFFFFF; + background-color: #691eff; + color: #ffffff; .startIcon { width: 20px; height: 20px; margin-right: 6px; - background-image: - url(https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*lo_5RYdqKLsAAAAAAAAAAAAADmJ7AQ/original), + background-image: url(https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*lo_5RYdqKLsAAAAAAAAAAAAADmJ7AQ/original), url(https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*UcuoSovQjxAAAAAAAAAAAAAADmJ7AQ/original), url(https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*3VvbT7spBhIAAAAAAAAAAAAADmJ7AQ/original), url(https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*PI67SoRSfgsAAAAAAAAAAAAADmJ7AQ/original), url(https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*sP-zRZweTJcAAAAAAAAAAAAADmJ7AQ/original), - url(https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*SFfnTachgWgAAAAAAAAAAAAADmJ7AQ/original), - ; + url(https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*SFfnTachgWgAAAAAAAAAAAAADmJ7AQ/original); background-repeat: no-repeat; background-position-y: 0, 20px, 40px, 60px, 80px, 100px; } @@ -206,11 +204,11 @@ .design { font-size: 18px; - background-color: #FFFFFF; - border: 1px solid #E8E8E8; + background-color: #ffffff; + border: 1px solid #e8e8e8; &:hover { - color: #691EFF; + color: #691eff; } } } @@ -229,9 +227,9 @@ width: calc((100vw - 360px - 26px) / 3); min-width: 338px; max-width: 551px; - background-color: #FFFFFF; - border: 1px solid #E5E8EF; - transition: all .2s; + background-color: #ffffff; + border: 1px solid #e5e8ef; + transition: all 0.2s; padding: 16px; box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.05); border-radius: 16px; @@ -241,12 +239,12 @@ .messageTitle { font-weight: 500; font-size: 18px; - color: #1D2129; + color: #1d2129; margin-bottom: 8px; text-align: center; position: relative; - >img { + > img { width: 24px; height: 24px; position: relative; @@ -256,13 +254,13 @@ .messageSubTitle { font-size: 14px; - color: #86909C; + color: #86909c; text-align: center; } &:hover { transform: translateY(-8px); - box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.10); + box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.1); .messageTitle { color: rgba(105, 30, 255, 1); @@ -300,4 +298,4 @@ 100% { background-position-y: -100px, -80px, -60px, -40px, -20px, 0px; } -} \ No newline at end of file +} diff --git a/site/components/Banner/Banner.tsx b/site/components/Banner/Banner.tsx index e094cc60d..98e471321 100644 --- a/site/components/Banner/Banner.tsx +++ b/site/components/Banner/Banner.tsx @@ -1,4 +1,4 @@ -import { useLocale, useIntl } from 'dumi'; +import { useIntl, useLocale } from 'dumi'; import React, { useEffect, useState } from 'react'; import { ActiveIcon } from '../common'; import { ANCHORNAME } from '../ProjectCard'; @@ -11,10 +11,10 @@ export default () => { const language: 'zh' | 'en' = locale.id.includes('zh') ? 'zh' : 'en'; - const intl = useIntl() + const intl = useIntl(); const useT = (transformedMessage: string) => { return intl.formatMessage({ - id: transformedMessage + id: transformedMessage, }); }; @@ -29,48 +29,80 @@ export default () => { // 跳转到 丰富图表,选用自如 const scrollToAnchor = () => { const anchorElement = document.getElementById(ANCHORNAME); - if (anchorElement) { anchorElement.scrollIntoView({ block: 'start', behavior: 'smooth' }); } - } + if (anchorElement) { + anchorElement.scrollIntoView({ block: 'start', behavior: 'smooth' }); + } + }; return (
-
- waffle - bug +
+ waffle + bug
-
- chips - cookie +
+ chips + cookie
-
AntV{useT("·让数据栩栩如生")}
-
{useT("蚂蚁企业级数据可视化解决方案,让人们在数据世界里获得视觉化思考能力")}
+
+ AntV + {useT('·让数据栩栩如生')} +
+
+ {useT( + '蚂蚁企业级数据可视化解决方案,让人们在数据世界里获得视觉化思考能力', + )} +
-
+
- {useT("开始使用")} + {useT('开始使用')}
- { - message.map(({ title, subTitle, img, link }) => { - return ( - -
message_title {title[language]}
-
{subTitle[language]}
-
- ); - }) - } + {message.map(({ title, subTitle, img, link }) => { + return ( + +
+ message_title {title[language]} +
+
+ {subTitle[language]} +
+
+ ); + })}
diff --git a/site/components/Banner/helper.ts b/site/components/Banner/helper.ts index 28514b5d5..8abd9fe02 100644 --- a/site/components/Banner/helper.ts +++ b/site/components/Banner/helper.ts @@ -1,6 +1,6 @@ import { map } from 'lodash'; -import bannerLinks from 'site/data/banner-link.json'; import bannerInfo from 'site/data/banner-info.json'; +import bannerLinks from 'site/data/banner-link.json'; /** * 获取真实的 url。根据是否国内镜像进行调整 diff --git a/site/components/ComplexCharts/index.module.less b/site/components/ComplexCharts/index.module.less index 6e548296b..5cc544970 100644 --- a/site/components/ComplexCharts/index.module.less +++ b/site/components/ComplexCharts/index.module.less @@ -13,7 +13,7 @@ .title { height: 48px; font-size: 40px; - color: #1D2129; + color: #1d2129; margin-bottom: 48px; font-family: AlibabaPuHuiTiB; } @@ -28,46 +28,46 @@ height: 52px; width: 160px; cursor: pointer; - background-color: #FFFFFF; - border: 2px solid #E5E8EF; + background-color: #ffffff; + border: 2px solid #e5e8ef; border-radius: 8px; margin-right: 20px; line-height: 52px; font-size: 18px; - >img { + > img { margin-right: 8px; } &:hover { font-weight: 500; - border: 2px solid #691EFF; + border: 2px solid #691eff; } } .isSelect { font-weight: 500; - border: 2px solid #691EFF; - color: #691EFF; + border: 2px solid #691eff; + color: #691eff; } } .content { width: calc(100vw - 360px); - height: calc((100vw - 360px) * (571 /1680)); + height: calc((100vw - 360px) * (571 / 1680)); max-width: 1680px; min-width: 1040px; max-height: 571px; min-height: 353px; border-radius: 16px; box-sizing: border-box; - box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.20); + box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.2); overflow: hidden; - >video { + > video { width: 100%; height: 100%; background-size: cover; } } -} \ No newline at end of file +} diff --git a/site/components/ComplexCharts/index.tsx b/site/components/ComplexCharts/index.tsx index 82f6a65d0..6b64a3415 100644 --- a/site/components/ComplexCharts/index.tsx +++ b/site/components/ComplexCharts/index.tsx @@ -1,9 +1,9 @@ +import { useChinaMirrorHost } from '@antv/dumi-theme-antv/dist/slots/hooks'; import classNames from 'classnames'; +import { useIntl, useLocale } from 'dumi'; import React, { useState } from 'react'; -import { useLocale, useIntl } from 'dumi'; -import { useChinaMirrorHost } from '@antv/dumi-theme-antv/dist/slots/hooks'; -import { transformUrl } from '../Products/getProducts'; import COMPLEX_DATAS from '../../data/complex-charts.json'; +import { transformUrl } from '../Products/getProducts'; import styles from './index.module.less'; @@ -17,7 +17,7 @@ export function ComplexCharts() { const intl = useIntl(); const useT = (transformedMessage: string) => { return intl.formatMessage({ - id: transformedMessage + id: transformedMessage, }); }; @@ -25,26 +25,27 @@ export function ComplexCharts() { return (
-
{useT("性能飞跃,专业优雅")}
+
{useT('性能飞跃,专业优雅')}
- { - COMPLEX_DATAS.map((data) => { - const isSelect = select.text === data.text; - return
{ + const isSelect = select.text === data.text; + return ( +
setSelect(data)} > - {data.text} {useT(data.text)} + {data.text}{' '} + {useT(data.text)}
- }) - } + ); + })}
))} diff --git a/site/components/Describe/Describe.tsx b/site/components/Describe/Describe.tsx index 8e9dde9f4..857fc7b27 100644 --- a/site/components/Describe/Describe.tsx +++ b/site/components/Describe/Describe.tsx @@ -6,13 +6,13 @@ const gridBackgroundImg = 'https://gw.alipayobjects.com/zos/basement_prod/31366ec3-a932-4e29-9e84-44ae0d6e6815.svg'; const Describe = () => { - const intl = useIntl() + const intl = useIntl(); const useT = (transformedMessage: string) => { return intl.formatMessage({ - id: transformedMessage - }) - } + id: transformedMessage, + }); + }; let title = 'AntV 企业级可视化解决方案'; let description = 'AntV 3.0 已全新升级,主要包含 G2、G6、F2、L7 以及一套完整的图表使用和设计规范。得益于丰富的业务场景和用户需求挑战,AntV 经历多年积累与不断打磨,已支撑阿里集团内外 20000+ 业务系统,通过了日均千万级 UV 产品的严苛考验后方敢与君见。'; diff --git a/site/components/FamousPersons/index.module.less b/site/components/FamousPersons/index.module.less index 208a2e7c0..138faeaac 100644 --- a/site/components/FamousPersons/index.module.less +++ b/site/components/FamousPersons/index.module.less @@ -23,29 +23,29 @@ height: calc((1680px - 100vw) / 10 + 370px); max-height: 377px; min-height: 350px; - width: calc((100vw - 380px - 84px)/ 4); + width: calc((100vw - 380px - 84px) / 4); min-width: 239px; max-width: 399px; padding: 29px 20px 20px; position: relative; margin: 0 14px; letter-spacing: 0; - transition: all .2s; + transition: all 0.2s; background-color: #fff; - border: 1px solid #E5E8EF; + border: 1px solid #e5e8ef; box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.05); border-radius: 16px; &:hover { transform: translateY(-8px); - box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.10); + box-shadow: 0 8px 20px 0 rgba(0, 0, 0, 0.1); } .image { position: relative; overflow: hidden; - >img { + > img { height: 60px; width: 60px; } @@ -62,7 +62,7 @@ .name { margin: 4px 0; font-size: 20px; - color: #1D2129; + color: #1d2129; font-weight: 500; font-family: PingFangSC; } @@ -71,7 +71,7 @@ line-height: 28px; height: 56px; font-size: 14px; - color: #424E66; + color: #424e66; overflow: hidden; text-overflow: ellipsis; -webkit-line-clamp: 2; @@ -86,16 +86,16 @@ } .msg { - color: #86909C; + color: #86909c; flex: 1; overflow: hidden; } } } - + &.en { .famousAuction { height: 377px; } } -} \ No newline at end of file +} diff --git a/site/components/FamousPersons/index.tsx b/site/components/FamousPersons/index.tsx index 0df606dfb..5f0c0d298 100644 --- a/site/components/FamousPersons/index.tsx +++ b/site/components/FamousPersons/index.tsx @@ -1,9 +1,9 @@ -import { debounce } from 'lodash'; -import React, { useEffect, useRef, useState } from 'react'; import classNames from 'classnames'; import { useIntl, useLocale } from 'dumi'; -import { ModuleTitle as Title, OverflowedText } from '../common'; +import { debounce } from 'lodash'; +import React, { useEffect, useRef, useState } from 'react'; import FAMOUS_PERSONS_DATAS from '../../data/famous-persons.json'; +import { OverflowedText, ModuleTitle as Title } from '../common'; import styles from './index.module.less'; @@ -46,39 +46,52 @@ export function FamousPersons() { return () => { window.removeEventListener('resize', changeSize); - } + }; }, []); return ( -
- - <div className={styles.famousAuctions} > - { - FAMOUS_PERSONS_DATAS.map((data) => { - const filter = `drop-shadow(${data.color} 80px 0)`; - return <div className={styles.famousAuction}> + <div + className={classNames(styles.famousPersons, { + [styles.en]: language === 'en', + })} + > + <Title + title={useT('专家之声')} + subTitle={useT('来自数据可视化专家的专业认可与推荐')} + /> + <div className={styles.famousAuctions}> + {FAMOUS_PERSONS_DATAS.map((data) => { + const filter = `drop-shadow(${data.color} 80px 0)`; + return ( + <div className={styles.famousAuction}> <div className={styles.image}> - <img src={data.image} alt='image' /> + <img src={data.image} alt="image" /> <img - src='https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*XGF5T7Atc7kAAAAAAAAAAAAADmJ7AQ/original' + src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*XGF5T7Atc7kAAAAAAAAAAAAADmJ7AQ/original" className={styles.icon} style={{ filter }} - alt='icon' + alt="icon" /> </div> <div className={styles.name}>{useT(data.name)}</div> <div className={styles.text} ref={textRef}> - <OverflowedText text={useT(data.text)} {...textSize} style={{ fontSize: 14, lineHeight: 2 }} /> + <OverflowedText + text={useT(data.text)} + {...textSize} + style={{ fontSize: 14, lineHeight: 2 }} + /> </div> <div className={styles.hr} /> <div className={styles.msg} ref={msgRef}> - <OverflowedText text={useT(data.msg)} {...msgSize} style={{ fontSize: 14, lineHeight: 2 }} /> + <OverflowedText + text={useT(data.msg)} + {...msgSize} + style={{ fontSize: 14, lineHeight: 2 }} + /> </div> </div> - }) - } + ); + })} </div> </div> ); diff --git a/site/components/LinkCharts/index.module.less b/site/components/LinkCharts/index.module.less index 6e7b162f1..311b4fc4f 100644 --- a/site/components/LinkCharts/index.module.less +++ b/site/components/LinkCharts/index.module.less @@ -39,12 +39,12 @@ flex-direction: column; height: 361px; padding: 0 20px; - background-color: #F7F8FD; + background-color: #f7f8fd; border-radius: 16px; letter-spacing: 0; position: relative; margin: 0 14px; - transition: all .2s; + transition: all 0.2s; cursor: pointer; &:hover { @@ -55,15 +55,15 @@ .title { height: 32px; font-size: 24px; - color: #1D2129; + color: #1d2129; line-height: 32px; margin: 18px 0 8px 0; - font-family: AlibabaPuHuiTiB; + font-family: AlibabaPuHuiTiB; } .subTitle { font-size: 14px; - color: #424E66; + color: #424e66; line-height: 22px; margin-bottom: 18px; overflow: hidden; @@ -83,13 +83,12 @@ right: 0; border-radius: 0 8px 0 8px; color: #fff; - } .image { height: 231px; width: 341px; - background-color: #FFFFFF; + background-color: #ffffff; border-radius: 12px; background-position: center; background-repeat: no-repeat; @@ -109,13 +108,13 @@ height: 44px; width: 44px; border-radius: 50%; - background-color: #F2F3F5; + background-color: #f2f3f5; margin: 0 8px; - color: #424E66; + color: #424e66; cursor: pointer; &:hover { - background-color: #E5E8EF; + background-color: #e5e8ef; } } @@ -123,4 +122,4 @@ transform: rotate(180deg); } } -} \ No newline at end of file +} diff --git a/site/components/LinkCharts/index.tsx b/site/components/LinkCharts/index.tsx index 2ea3366fc..4ef9ead6d 100644 --- a/site/components/LinkCharts/index.tsx +++ b/site/components/LinkCharts/index.tsx @@ -1,10 +1,10 @@ +import { useChinaMirrorHost } from '@antv/dumi-theme-antv/dist/slots/hooks'; import classNames from 'classnames'; -import { useLocale, useIntl } from 'dumi'; +import { useIntl, useLocale } from 'dumi'; import React, { useCallback, useState } from 'react'; -import { useChinaMirrorHost } from '@antv/dumi-theme-antv/dist/slots/hooks'; -import { transformUrl } from '../Products/getProducts'; -import { ModuleTitle as Title, OverflowedText } from '../common'; import CHARTS_DATAS from '../../data/link-charts.json'; +import { transformUrl } from '../Products/getProducts'; +import { OverflowedText, ModuleTitle as Title } from '../common'; import styles from './index.module.less'; @@ -17,61 +17,92 @@ export function LinkCharts() { const locale = useLocale(); const [isChinaMirrorHost] = useChinaMirrorHost(); - const intl = useIntl() + const intl = useIntl(); const useT = (transformedMessage: string) => { return intl.formatMessage({ - id: transformedMessage + id: transformedMessage, }); }; const language: 'zh' | 'en' = locale.id.includes('zh') ? 'zh' : 'en'; // 滑动 - const onClick = useCallback((position) => { - if (loading) return; - setPosition(position); - setLoading(true); - const length = data.length; - setTimeout(() => { - setData((data) => { - return position === 'left' ? - [...data.slice(length - 3), ...data.slice(0, length - 3)] : - [...data.slice(3), ...data.slice(0, 3)]; - }); - setPosition('center'); - setLoading(false); - }, 1000); - }, [loading]); + const onClick = useCallback( + (position) => { + if (loading) return; + setPosition(position); + setLoading(true); + const length = data.length; + setTimeout(() => { + setData((data) => { + return position === 'left' + ? [...data.slice(length - 3), ...data.slice(0, length - 3)] + : [...data.slice(3), ...data.slice(0, 3)]; + }); + setPosition('center'); + setLoading(false); + }, 1000); + }, + [loading], + ); return ( <div className={styles.linkCharts}> - <Title title={useT('丰富图表,选用自如')} subTitle={useT('柱形图、饼图、关系图、地图、多维表格等260+丰富图表随心选用')} /> + <Title + title={useT('丰富图表,选用自如')} + subTitle={useT( + '柱形图、饼图、关系图、地图、多维表格等260+丰富图表随心选用', + )} + /> <div className={styles.charts}> <div className={classNames(styles.box, { [styles.left]: position === 'left', [styles.right]: position === 'right', - [styles.center]: position === 'center' + [styles.center]: position === 'center', })} style={{ width: data.length * 409 + 'px' }} > - { - data.map((data) => { - return <a className={styles.chart} href={transformUrl({ url: data.link, language, isChinaMirrorHost })} target='_blank' > + {data.map((data) => { + return ( + <a + className={styles.chart} + href={transformUrl({ + url: data.link, + language, + isChinaMirrorHost, + })} + target="_blank" + > <div className={styles.title}>{useT(data.title)}</div> <div className={styles.subTitle}> <OverflowedText text={useT(data.subTitle)} maxWidth={341} /> </div> - <div className={styles.antv} style={{ background: data.color }} >{data.antv}</div> - <div className={styles.image} style={{ backgroundImage: `url(${data.image})` }} /> + <div className={styles.antv} style={{ background: data.color }}> + {data.antv} + </div> + <div + className={styles.image} + style={{ backgroundImage: `url(${data.image})` }} + /> </a> - }) - } + ); + })} </div> </div> <div className={styles.buttons}> - <div className={styles.left} onClick={() => onClick('left')} ><img alt='left_icon' src='https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*Q4WbQ5DCXEAAAAAAAAAAAAAADmJ7AQ/original' /></div> - <div className={styles.right} onClick={() => onClick('right')}><img alt='right_icon' src='https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*Q4WbQ5DCXEAAAAAAAAAAAAAADmJ7AQ/original' /></div> + <div className={styles.left} onClick={() => onClick('left')}> + <img + alt="left_icon" + src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*Q4WbQ5DCXEAAAAAAAAAAAAAADmJ7AQ/original" + /> + </div> + <div className={styles.right} onClick={() => onClick('right')}> + <img + alt="right_icon" + src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*Q4WbQ5DCXEAAAAAAAAAAAAAADmJ7AQ/original" + /> + </div> </div> </div> ); diff --git a/site/components/Products/Products.tsx b/site/components/Products/Products.tsx index 50a17379a..42fc19e9e 100644 --- a/site/components/Products/Products.tsx +++ b/site/components/Products/Products.tsx @@ -1,20 +1,20 @@ -import React from 'react'; -import { Row, Col } from 'antd'; -import { useIntl, useLocale } from 'dumi' -import classNames from 'classnames'; import { useChinaMirrorHost } from '@antv/dumi-theme-antv/dist/slots/hooks'; +import { Col, Row } from 'antd'; +import classNames from 'classnames'; +import { useIntl, useLocale } from 'dumi'; +import React from 'react'; import { CATEGORIES, ProductType, getProducts } from './getProducts'; import styles from './Products.module.less'; const Products = () => { - const locale = useLocale() - const intl = useIntl() + const locale = useLocale(); + const intl = useIntl(); const useT = (transformedMessage: string) => { return intl.formatMessage({ - id: transformedMessage - }) - } + id: transformedMessage, + }); + }; const [isChinaMirrorHost] = useChinaMirrorHost(); const [products, setProducts] = React.useState<ProductType[]>([]); diff --git a/site/components/Products/getProducts.tsx b/site/components/Products/getProducts.tsx index afdbfaa47..8345b017d 100644 --- a/site/components/Products/getProducts.tsx +++ b/site/components/Products/getProducts.tsx @@ -1,26 +1,26 @@ -import React from 'react'; import { each } from 'lodash'; +import React from 'react'; import { getActualUrl } from '../Banner/helper'; const tuple = <T extends string[]>(...args: T) => args; const CATEGORY_TYPE = tuple('basic', 'extension', 'mobile', 'ecology'); export const CATEGORIES: Array<{ - type: typeof CATEGORY_TYPE[number]; + type: (typeof CATEGORY_TYPE)[number]; name: string; }> = [ - { type: 'basic', name: '标准版基础产品' }, - { type: 'extension', name: '标准版扩展产品' }, - { type: 'mobile', name: '移动定制(F版)产品' }, - { type: 'ecology', name: '周边生态' }, - ]; + { type: 'basic', name: '标准版基础产品' }, + { type: 'extension', name: '标准版扩展产品' }, + { type: 'mobile', name: '移动定制(F版)产品' }, + { type: 'ecology', name: '周边生态' }, +]; export interface ProductItem { title: string; icon?: React.ReactNode; slogan?: string; description: string; - category: typeof CATEGORY_TYPE[number]; + category: (typeof CATEGORY_TYPE)[number]; links?: Array<{ icon?: React.ReactNode; title: React.ReactNode; @@ -84,6 +84,8 @@ export function transformUrl({ language: 'zh' | 'en'; isChinaMirrorHost: boolean; }) { - const languageUrl = url.replace(/\/(zh|en)/, '').replace(/([http|https]\:\/\/).+?\//, (v) => `${v}${language}/`); + const languageUrl = url + .replace(/\/(zh|en)/, '') + .replace(/([http|https]\:\/\/).+?\//, (v) => `${v}${language}/`); return getActualUrl(languageUrl, isChinaMirrorHost); } diff --git a/site/components/ProjectCard/index.module.less b/site/components/ProjectCard/index.module.less index 533679f7b..130d47140 100644 --- a/site/components/ProjectCard/index.module.less +++ b/site/components/ProjectCard/index.module.less @@ -10,15 +10,15 @@ flex-direction: column; height: 782px; overflow: hidden; - font-family: PingFangSC; + font-family: PingFangSC; .cards { height: 520px; width: calc(100vw - 360px); max-width: 1680px; min-width: 1040px; - background-image: linear-gradient(114deg, #332F4F 0%, #28243F 100%); - box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.20); + background-image: linear-gradient(114deg, #332f4f 0%, #28243f 100%); + box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.2); border-radius: 16px; padding: 24px; letter-spacing: 0; @@ -29,7 +29,7 @@ height: 70px; border-radius: 8px; margin-bottom: 16px; - color: #FFFFFF; + color: #ffffff; position: relative; .cardTitle { @@ -90,7 +90,7 @@ cursor: default; .divider { - border-color: rgba(255, 255, 255, 0.20); + border-color: rgba(255, 255, 255, 0.2); :global(.ant-divider-inner-text) { padding: 0; @@ -101,7 +101,7 @@ font-family: AlibabaPuHuiTiR; margin: 0 6px; font-size: 16px; - color: #FFFFFF; + color: #ffffff; opacity: 0.45; font-size: 16px; } @@ -140,20 +140,20 @@ .msgTitle { font-weight: 600; font-size: 20px; - color: #1D2129; + color: #1d2129; margin-right: 6px; } .msgSubTitle { font-size: 14px; - color: #86909C; + color: #86909c; } } .msgChart { height: 125px; width: 274px; - border: 1px solid #D8D8D8; + border: 1px solid #d8d8d8; background-color: #fff; border-radius: 4px; margin: 12px 0; @@ -167,10 +167,10 @@ justify-content: space-between; width: 274px; - >a { + > a { &:extend(.commonFlexConfig); font-size: 14px; - color: #1D2129; + color: #1d2129; .link { > img { @@ -180,8 +180,8 @@ } &:hover { - color: #691EFF; + color: #691eff; } } } -} \ No newline at end of file +} diff --git a/site/components/ProjectCard/index.tsx b/site/components/ProjectCard/index.tsx index b68846a67..3d777820b 100644 --- a/site/components/ProjectCard/index.tsx +++ b/site/components/ProjectCard/index.tsx @@ -1,11 +1,15 @@ +import { useChinaMirrorHost } from '@antv/dumi-theme-antv/dist/slots/hooks'; +import { Col, ConfigProvider, Divider, Popover, Row } from 'antd'; import classNames from 'classnames'; -import { useLocale, useIntl } from 'dumi'; +import { useIntl, useLocale } from 'dumi'; import React, { useCallback, useState } from 'react'; -import { Row, Col, Divider, Popover, ConfigProvider } from 'antd'; -import { useChinaMirrorHost } from '@antv/dumi-theme-antv/dist/slots/hooks'; -import { ModuleTitle as Title, ActiveIcon } from '../common'; import ANTV_LINKS from '../../data/project-card-popover.json'; -import { ProductType, getProducts, transformUrl } from '../Products/getProducts'; +import { ActiveIcon, ModuleTitle as Title } from '../common'; +import { + ProductType, + getProducts, + transformUrl, +} from '../Products/getProducts'; import styles from './index.module.less'; @@ -39,15 +43,17 @@ type PrejectData = { // 不放入 data 变为 json 是因为 占比需要 styles 进行修改。 const PROJECT_DATAS: PrejectData = [ - [{ - title: 'AVA', - subTitle: '智能洞察', - span: 24, - classNames: styles.AVA, - icon: 'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*L58VTIXV8MwAAAAAAAAAAAAADmJ7AQ/original', - img: 'https://gw.alipayobjects.com/mdn/rms_fabca5/afts/img/A*TOjFQ6PQwyEAAAAAAAAAAAAAARQnAQ', - url: 'https://ava.antv.antgroup.com', - }], + [ + { + title: 'AVA', + subTitle: '智能洞察', + span: 24, + classNames: styles.AVA, + icon: 'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*L58VTIXV8MwAAAAAAAAAAAAADmJ7AQ/original', + img: 'https://gw.alipayobjects.com/mdn/rms_fabca5/afts/img/A*TOjFQ6PQwyEAAAAAAAAAAAAAARQnAQ', + url: 'https://ava.antv.antgroup.com', + }, + ], [ { title: 'Ant Design Charts', @@ -122,7 +128,12 @@ const PROJECT_DATAS: PrejectData = [ url: 'https://f6.antv.vision', img: 'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*q3muQq70-dUAAAAAAAAAAAAADmJ7AQ/original', }, - { title: 'F7', subTitle: '移动地图', span: 3, classNames: classNames(styles.chartEngine, styles.f7) }, + { + title: 'F7', + subTitle: '移动地图', + span: 3, + classNames: classNames(styles.chartEngine, styles.f7), + }, ], [ { title: '常用统计数据', span: 6, classNames: styles.sort, isSort: true }, @@ -161,10 +172,10 @@ export function ProjectCard() { const language: 'zh' | 'en' = locale.id.includes('zh') ? 'zh' : 'en'; - const intl = useIntl() + const intl = useIntl(); const useT = (transformedMessage: string) => { return intl.formatMessage({ - id: transformedMessage + id: transformedMessage, }); }; @@ -177,45 +188,53 @@ export function ProjectCard() { // 弹出框内容 const getContent = useCallback(({ title, subTitle, img, links, url }) => { - - return <div className={styles.content}> - <div className={styles.msg}> - <div className={styles.msgTitle}>{title}</div> - <div className={styles.msgSubTitle}>{subTitle}</div> - </div> - <div className={styles.msgChart} style={{ backgroundImage: `url(${img})` }} /> - <div className={styles.links}> - { - ANTV_LINKS.map((link) => { - let href = links[link.href]?.url.replace(/https:\/\/.+?\//, `${url}/`); + return ( + <div className={styles.content}> + <div className={styles.msg}> + <div className={styles.msgTitle}>{title}</div> + <div className={styles.msgSubTitle}>{subTitle}</div> + </div> + <div + className={styles.msgChart} + style={{ backgroundImage: `url(${img})` }} + /> + <div className={styles.links}> + {ANTV_LINKS.map((link) => { + let href = links[link.href]?.url.replace( + /https:\/\/.+?\//, + `${url}/`, + ); // Ant Design Charts 本身跳转 https://charts.ant.design/example 为 404, 修改为 https://ant-design-charts.antgroup.com/examples if (title === 'Ant Design Charts') { - href = link.href === 'home' ? url : `${url}/${language}/${{ - example: 'examples', - api: 'options/plots/overview', - }[link.href]}`; + href = + link.href === 'home' + ? url + : `${url}/${language}/${ + { + example: 'examples', + api: 'options/plots/overview', + }[link.href] + }`; } if (title === 'F6' && link.href === 'api') { href = href + '/Graph'; } - return <a - href={href} - target='_blank' - > - <ActiveIcon - className={styles.link} - img={link.img} - text={useT(link.text)} - activeImg={link.activeImg} - /> - </a> - } - ) - } + return ( + <a href={href} target="_blank"> + <ActiveIcon + className={styles.link} + img={link.img} + text={useT(link.text)} + activeImg={link.activeImg} + /> + </a> + ); + })} + </div> </div> - </div> + ); }, []); return ( @@ -226,38 +245,44 @@ export function ProjectCard() { /> <div className={styles.cards}> <div className={styles.box}> - { - PROJECT_DATAS.map((cols) => (<Row gutter={16}> - { - cols.map((col) => { - const { span, img, title, subTitle, isSort, icon, url } = col; + {PROJECT_DATAS.map((cols) => ( + <Row gutter={16}> + {cols.map((col) => { + const { span, img, title, subTitle, isSort, icon, url } = col; - const product = products.find((product) => product.title === title); + const product = products.find( + (product) => product.title === title, + ); - const links = product?.links; - const newTitle = useT(title); - const newSubTitle = subTitle && useT(subTitle); - const children = <a + const links = product?.links; + const newTitle = useT(title); + const newSubTitle = subTitle && useT(subTitle); + const children = ( + <a className={classNames(col.classNames, styles.card)} - href={url && transformUrl({ url, language, isChinaMirrorHost })} + href={ + url && transformUrl({ url, language, isChinaMirrorHost }) + } style={{ cursor: url ? 'pointer' : 'default' }} - target='_blank' + target="_blank" > {icon && <img src={icon} alt={newTitle} />} - {isSort ? + {isSort ? ( <Divider dashed={true} className={styles.divider}> <div className={styles.cardTitle}>{newTitle}</div> - </Divider> : + </Divider> + ) : ( <div className={styles.cardTitle}>{newTitle}</div> - } - {subTitle && <div className={styles.cardSubTitle}>{newSubTitle}</div>} - </a>; + )} + {subTitle && ( + <div className={styles.cardSubTitle}>{newSubTitle}</div> + )} + </a> + ); - return <Col - key={title} - span={span} - > - {links ? + return ( + <Col key={title} span={span}> + {links ? ( <ConfigProvider prefixCls="antd5"> <Popover content={getContent({ @@ -270,13 +295,15 @@ export function ProjectCard() { > {children} </Popover> - </ConfigProvider> : - children} + </ConfigProvider> + ) : ( + children + )} </Col> - }) - } - </Row>)) - } + ); + })} + </Row> + ))} </div> </div> </div> diff --git a/site/components/Quotes/Quotes.tsx b/site/components/Quotes/Quotes.tsx index 3aece61be..eea415690 100644 --- a/site/components/Quotes/Quotes.tsx +++ b/site/components/Quotes/Quotes.tsx @@ -1,5 +1,5 @@ +import { Col, Row } from 'antd'; import React from 'react'; -import { Row, Col } from 'antd'; import QuoteCard from '../quoteCard/quoteCard'; import styles from './Quotes.module.less'; diff --git a/site/components/ResourceCard/ResourceCard.tsx b/site/components/ResourceCard/ResourceCard.tsx index a51f77a2d..d8fd366a7 100644 --- a/site/components/ResourceCard/ResourceCard.tsx +++ b/site/components/ResourceCard/ResourceCard.tsx @@ -1,7 +1,7 @@ -import React from 'react'; import classNames from 'classnames'; -import styles from './ResourceCard.module.less'; import { useIntl } from 'dumi'; +import React from 'react'; +import styles from './ResourceCard.module.less'; interface Props { cardContent: { @@ -14,13 +14,13 @@ interface Props { } const ResourceCard = (props: Props) => { - const intl = useIntl() + const intl = useIntl(); const useT = (transformedMessage: string) => { return intl.formatMessage({ - id: transformedMessage - }) - } + id: transformedMessage, + }); + }; let detailLinkStr = '查看详情'; return ( <div className={styles.card}> diff --git a/site/components/Resources/Resources.tsx b/site/components/Resources/Resources.tsx index 12a28c4b8..a913e6545 100644 --- a/site/components/Resources/Resources.tsx +++ b/site/components/Resources/Resources.tsx @@ -1,9 +1,9 @@ +import { Col, Row } from 'antd'; +import { useIntl } from 'dumi'; import React from 'react'; +import { getLang } from '../../utils'; import ResourceCard from '../ResourceCard/ResourceCard'; -import { Col, Row } from 'antd'; import styles from './Resources.module.less'; -import { getLang } from '../../utils'; -import { useIntl } from 'dumi'; const circleBackImg = 'https://gw.alipayobjects.com/zos/basement_prod/e63aad85-573e-484b-94dd-dc8ea2334c09.svg'; @@ -11,19 +11,18 @@ const diamandBackImg = 'https://gw.alipayobjects.com/zos/basement_prod/bd846fce-bf9b-47f0-abba-87bb9bbd2982.svg'; const ResourcesPage = () => { - const lang = getLang() - const intl = useIntl() + const lang = getLang(); + const intl = useIntl(); const useT = (transformedMessage: string) => { return intl.formatMessage({ - id: transformedMessage - }) - } + id: transformedMessage, + }); + }; const cards = [ { index: 0, - icon: - 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*icqYSbEiNxIAAAAAAAAAAABkARQnAQ', + icon: 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*icqYSbEiNxIAAAAAAAAAAABkARQnAQ', title: useT('图表用法'), description: useT( '从数据出发,从功能角度对常见图表进行分类,提供规范使用指引。', @@ -32,8 +31,7 @@ const ResourcesPage = () => { }, { index: 1, - icon: - 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*mt47RKxGy8kAAAAAAAAAAABkARQnAQ', + icon: 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*mt47RKxGy8kAAAAAAAAAAABkARQnAQ', title: useT('设计价值观'), description: useT( '对数据图形进行拆解、提炼,抽象出一套数据图形可视化交互视觉规范。', @@ -42,8 +40,7 @@ const ResourcesPage = () => { }, { index: 2, - icon: - 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*zBDKTaSg-7AAAAAAAAAAAABkARQnAQ', + icon: 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*zBDKTaSg-7AAAAAAAAAAAABkARQnAQ', title: useT('工具资源'), description: useT( '在进行模式、组件和语言的整理过程中发现的优秀书籍和资源。', diff --git a/site/components/ShowCase/ShowCase.tsx b/site/components/ShowCase/ShowCase.tsx index 37870ba83..bd416beb5 100644 --- a/site/components/ShowCase/ShowCase.tsx +++ b/site/components/ShowCase/ShowCase.tsx @@ -1,9 +1,9 @@ // 场景案例模版 -import React, { useState, useEffect } from 'react'; -import { Layout as AntLayout, BackTop } from 'antd'; -import { useLocale } from 'dumi'; import { VerticalAlignTopOutlined } from '@ant-design/icons'; import Article from '@antv/dumi-theme-antv/dist/slots/Article'; +import { Layout as AntLayout, BackTop } from 'antd'; +import { useLocale } from 'dumi'; +import React, { useEffect, useState } from 'react'; import styles from '@antv/dumi-theme-antv/dist/slots/ManualContent/index.module.less'; @@ -16,7 +16,7 @@ interface ShowCaseProps { } export default () => { - const locale = useLocale() + const locale = useLocale(); const lang = locale.id.includes('zh') ? 'zh' : 'en'; const showCaseUrl = `https://assets.antv.antgroup.com/antv/show-cases-${lang}.json`; diff --git a/site/components/ThemeCharts/Charts/Column/index.tsx b/site/components/ThemeCharts/Charts/Column/index.tsx index f385009d3..1f1244423 100644 --- a/site/components/ThemeCharts/Charts/Column/index.tsx +++ b/site/components/ThemeCharts/Charts/Column/index.tsx @@ -1,5 +1,5 @@ import { Column } from '@antv/g2plot'; -import React, { useEffect, useRef, useMemo } from 'react'; +import React, { useEffect, useMemo, useRef } from 'react'; import styles from '../index.module.less'; @@ -31,7 +31,7 @@ export const DARK_THEME_CONFIG = { }, }, xAxis: { - line:{ + line: { style: { stroke: '#A8B7C1', }, @@ -73,7 +73,7 @@ export const LIGHT_THEME_CONFIG = { }, }, xAxis: { - line:{ + line: { style: { stroke: '#A4AEBA', }, @@ -95,62 +95,62 @@ const DATA = [ { x: '10-13', y: 590, - type: 'PD' + type: 'PD', }, { x: '10-13', y: 500, - type: 'FE' + type: 'FE', }, { x: '10-13', y: 300, - type: 'UX' + type: 'UX', }, { x: '10-14', y: 220, - type: 'PD' + type: 'PD', }, { x: '10-14', y: 400, - type: 'FE' + type: 'FE', }, { x: '10-14', y: 580, - type: 'UX' + type: 'UX', }, { x: '10-15', y: 344, - type: 'PD' + type: 'PD', }, { x: '10-15', y: 133, - type: 'FE' + type: 'FE', }, { x: '10-15', y: 222, - type: 'UX' + type: 'UX', }, { x: '10-16', y: 455, - type: 'PD' + type: 'PD', }, { x: '10-16', y: 600, - type: 'FE' + type: 'FE', }, { x: '10-16', y: 120, - type: 'UX' + type: 'UX', }, ]; @@ -182,7 +182,7 @@ export function ColumnChart(props: ColumnProps) { seriesField: 'type', // 分组柱状图 组内柱子间的间距 (像素级别) dodgePadding: 2, - ...themeConfig + ...themeConfig, }); plotRef.current?.render(); @@ -196,5 +196,5 @@ export function ColumnChart(props: ColumnProps) { <div className={styles.container}> <div ref={containerRef} /> </div> - ) + ); } diff --git a/site/components/ThemeCharts/Charts/Gauge/index.tsx b/site/components/ThemeCharts/Charts/Gauge/index.tsx index 40a206549..3a67f0443 100644 --- a/site/components/ThemeCharts/Charts/Gauge/index.tsx +++ b/site/components/ThemeCharts/Charts/Gauge/index.tsx @@ -1,13 +1,13 @@ +import { Gauge } from '@antv/g2plot'; import { useIntl } from 'dumi'; import { get } from 'lodash'; -import { Gauge } from '@antv/g2plot'; import React, { useEffect, useMemo, useRef } from 'react'; import styles from '../index.module.less'; type GaugeProps = { theme?: any; -} +}; // 仪表盘 export function GaugeChart(props: GaugeProps) { @@ -19,7 +19,7 @@ export function GaugeChart(props: GaugeProps) { const intl = useIntl(); const useT = (transformedMessage: string) => { return intl.formatMessage({ - id: transformedMessage + id: transformedMessage, }); }; @@ -39,15 +39,23 @@ export function GaugeChart(props: GaugeProps) { customHtml: () => { return ` <div> - <img alt="icon" style="width: 36px; height: 36px;margin-bottom: 12px;" src="${isDark ? 'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*hINPQYnKaIAAAAAAAAAAAAAADmJ7AQ/original' : 'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*BjKVTp2kKSQAAAAAAAAAAAAADmJ7AQ/original'}" /> - <div style="font-size: 12px;color: ${isDark ? 'rgba(255,255,255,0.65)' : '#424E66'};" >${useT('用户总量')}</div> - <div style="font-size: 32px;color: ${isDark ? '#fff' : '#1D2129'}; line-height: 45px;font-family: AlibabaPuHuiTiB;" >1,320</div> + <img alt="icon" style="width: 36px; height: 36px;margin-bottom: 12px;" src="${ + isDark + ? 'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*hINPQYnKaIAAAAAAAAAAAAAADmJ7AQ/original' + : 'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*BjKVTp2kKSQAAAAAAAAAAAAADmJ7AQ/original' + }" /> + <div style="font-size: 12px;color: ${ + isDark ? 'rgba(255,255,255,0.65)' : '#424E66' + };" >${useT('用户总量')}</div> + <div style="font-size: 32px;color: ${ + isDark ? '#fff' : '#1D2129' + }; line-height: 45px;font-family: AlibabaPuHuiTiB;" >1,320</div> </div> `; }, }, }, - } + }; if (!plotRef.current) { plotRef.current = new Gauge(containerRef.current, { @@ -71,5 +79,5 @@ export function GaugeChart(props: GaugeProps) { <div className={styles.container}> <div ref={containerRef} /> </div> - ) + ); } diff --git a/site/components/ThemeCharts/Charts/Graph/index.tsx b/site/components/ThemeCharts/Charts/Graph/index.tsx index dd43f2dbf..c690f8e7c 100644 --- a/site/components/ThemeCharts/Charts/Graph/index.tsx +++ b/site/components/ThemeCharts/Charts/Graph/index.tsx @@ -1,6 +1,6 @@ import { Graph } from '@antv/g6'; import { debounce } from 'lodash'; -import React, { useEffect, useRef, useMemo, useCallback } from 'react'; +import React, { useCallback, useEffect, useMemo, useRef } from 'react'; import styles from '../index.module.less'; @@ -10,13 +10,69 @@ type GraphProps = { const DATA = { nodes: [ - { id: 'node0', size: 32, style: { fill: '#2486FF' }, label: 'host', type: 0, x: 150, y: 150 }, - { id: 'node1', size: 32, style: { fill: '#00C7C7' }, label: 'item', type: 1, x: 400, y: 0 }, - { id: 'node2', size: 32, style: { fill: '#00C7C7' }, label: 'item ', type: 1, x: 400, y: 150 }, - { id: 'node3', size: 32, style: { fill: '#00C7C7' }, label: 'item', type: 1, x: 400, y: 300 }, - { id: 'node4', size: 32, style: { fill: '#F58C58' }, label: 'file', type: 2, x: 0, y: 0 }, - { id: 'node5', size: 32, style: { fill: '#F58C58' }, label: 'file', type: 2, x: 0, y: 150 }, - { id: 'node6', size: 32, style: { fill: '#F58C58' }, label: 'file', type: 2, x: 0, y: 300 }, + { + id: 'node0', + size: 32, + style: { fill: '#2486FF' }, + label: 'host', + type: 0, + x: 150, + y: 150, + }, + { + id: 'node1', + size: 32, + style: { fill: '#00C7C7' }, + label: 'item', + type: 1, + x: 400, + y: 0, + }, + { + id: 'node2', + size: 32, + style: { fill: '#00C7C7' }, + label: 'item ', + type: 1, + x: 400, + y: 150, + }, + { + id: 'node3', + size: 32, + style: { fill: '#00C7C7' }, + label: 'item', + type: 1, + x: 400, + y: 300, + }, + { + id: 'node4', + size: 32, + style: { fill: '#F58C58' }, + label: 'file', + type: 2, + x: 0, + y: 0, + }, + { + id: 'node5', + size: 32, + style: { fill: '#F58C58' }, + label: 'file', + type: 2, + x: 0, + y: 150, + }, + { + id: 'node6', + size: 32, + style: { fill: '#F58C58' }, + label: 'file', + type: 2, + x: 0, + y: 300, + }, ], edges: [ { source: 'node0', target: 'node1' }, @@ -38,84 +94,93 @@ export function GraphChart(props: GraphProps) { const containerRef = useRef<HTMLDivElement>(null); const plotRef = React.useRef<any>(null); - const data = useMemo(() => ({ - ...DATA, - nodes: DATA.nodes.map((item) => ({ - ...item, - style: { - fill: colors10[item.type], - }, - icon: { - show: true, - img: [ - 'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*Q2piT7W5HCMAAAAAAAAAAAAADmJ7AQ/original', - 'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*I-Q8Ta_r9T4AAAAAAAAAAAAADmJ7AQ/original', - 'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*mNDaSa5JIuQAAAAAAAAAAAAADmJ7AQ/original', - ][item.type], - }, - })), - }), [colors10]); - - const defaultNode = useMemo(() => ({ - color: '#fff', - labelCfg: { - position: 'bottom', - style: { - fill: isDark ? 'rgba(255,255,255,0.45)' : '#86909C', - }, - }, - }), [isDark]); - - const create = useCallback((container: HTMLDivElement | null) => { - if (!container) return; - const width = container.clientWidth; - const height = container.clientHeight; - - // 限制范围 - const onTick = () => { - data.nodes.forEach((node) => { - node.x = Math.min(Math.max(5, node.x), width - 10); - node.y = Math.min(Math.max(18, node.y), height - 36); - }); - }; - - plotRef.current = new Graph({ - container, - width, - height, - defaultNode, - layout: { - type: 'force', - linkDistance: (d: any) => { - if (['node2', 'node5'].includes(d.target.id)) return 130; - return 100; + const data = useMemo( + () => ({ + ...DATA, + nodes: DATA.nodes.map((item) => ({ + ...item, + style: { + fill: colors10[item.type], + }, + icon: { + show: true, + img: [ + 'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*Q2piT7W5HCMAAAAAAAAAAAAADmJ7AQ/original', + 'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*I-Q8Ta_r9T4AAAAAAAAAAAAADmJ7AQ/original', + 'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*mNDaSa5JIuQAAAAAAAAAAAAADmJ7AQ/original', + ][item.type], + }, + })), + }), + [colors10], + ); + + const defaultNode = useMemo( + () => ({ + color: '#fff', + labelCfg: { + position: 'bottom', + style: { + fill: isDark ? 'rgba(255,255,255,0.45)' : '#86909C', }, - onTick, }, - }); + }), + [isDark], + ); + + const create = useCallback( + (container: HTMLDivElement | null) => { + if (!container) return; + const width = container.clientWidth; + const height = container.clientHeight; + + // 限制范围 + const onTick = () => { + data.nodes.forEach((node) => { + node.x = Math.min(Math.max(5, node.x), width - 10); + node.y = Math.min(Math.max(18, node.y), height - 36); + }); + }; + + plotRef.current = new Graph({ + container, + width, + height, + defaultNode, + layout: { + type: 'force', + linkDistance: (d: any) => { + if (['node2', 'node5'].includes(d.target.id)) return 130; + return 100; + }, + onTick, + }, + }); - plotRef.current.data(data); + plotRef.current.data(data); - plotRef.current.render(); + plotRef.current.render(); - function refreshDragedNodePosition(e: any) { - const model = e.item.get('model'); - model.fx = e.x; - model.fy = e.y; - } + function refreshDragedNodePosition(e: any) { + const model = e.item.get('model'); + model.fx = e.x; + model.fy = e.y; + } - plotRef.current.on('node:dragstart', (e: any) => { - plotRef.current.layout(); - refreshDragedNodePosition(e); - }); - plotRef.current.on('node:drag', (e: any) => { - refreshDragedNodePosition(e); - }); - plotRef.current.on('node:dragend', (e: any) => { - e.item.get('model').fx = null; - e.item.get('model').fy = null; - }); - }, [data, defaultNode]); + plotRef.current.on('node:dragstart', (e: any) => { + plotRef.current.layout(); + refreshDragedNodePosition(e); + }); + plotRef.current.on('node:drag', (e: any) => { + refreshDragedNodePosition(e); + }); + plotRef.current.on('node:dragend', (e: any) => { + e.item.get('model').fx = null; + e.item.get('model').fy = null; + }); + }, + [data, defaultNode], + ); useEffect(() => { if (containerRef.current) { @@ -142,12 +207,12 @@ export function GraphChart(props: GraphProps) { } return () => { window.removeEventListener('resize', onResize); - } + }; }, [containerRef]); return ( <div className={styles.container}> <div ref={containerRef} /> </div> - ) + ); } diff --git a/site/components/ThemeCharts/Charts/Line/index.tsx b/site/components/ThemeCharts/Charts/Line/index.tsx index 06a4d85dd..e493dbe28 100644 --- a/site/components/ThemeCharts/Charts/Line/index.tsx +++ b/site/components/ThemeCharts/Charts/Line/index.tsx @@ -1,5 +1,5 @@ import { Line } from '@antv/g2plot'; -import React, { useEffect, useRef, useMemo } from 'react'; +import React, { useEffect, useMemo, useRef } from 'react'; import { DARK_THEME_CONFIG, LIGHT_THEME_CONFIG } from '../Column'; import styles from '../index.module.less'; @@ -12,42 +12,42 @@ const DATA = [ { x: '10-13', y: 590, - type: 'PD' + type: 'PD', }, { x: '10-13', y: 500, - type: 'FE' + type: 'FE', }, { x: '10-14', y: 220, - type: 'PD' + type: 'PD', }, { x: '10-14', y: 400, - type: 'FE' + type: 'FE', }, { x: '10-15', y: 344, - type: 'PD' + type: 'PD', }, { x: '10-15', y: 133, - type: 'FE' + type: 'FE', }, { x: '10-16', y: 455, - type: 'PD' + type: 'PD', }, { x: '10-16', y: 600, - type: 'FE' + type: 'FE', }, ]; @@ -92,5 +92,5 @@ export function LineChart(props: LineProps) { <div className={styles.container}> <div ref={containerRef} /> </div> - ) + ); } diff --git a/site/components/ThemeCharts/Charts/Pie/index.tsx b/site/components/ThemeCharts/Charts/Pie/index.tsx index 824bb005f..f5a94222d 100644 --- a/site/components/ThemeCharts/Charts/Pie/index.tsx +++ b/site/components/ThemeCharts/Charts/Pie/index.tsx @@ -1,6 +1,6 @@ -import { useIntl } from 'dumi'; import { Pie } from '@antv/g2plot'; -import React, { useEffect, useRef, useMemo } from 'react'; +import { useIntl } from 'dumi'; +import React, { useEffect, useMemo, useRef } from 'react'; import { DARK_THEME_CONFIG, LIGHT_THEME_CONFIG } from '../Column'; import styles from '../index.module.less'; @@ -25,7 +25,7 @@ export function PieChart(props: PieProps) { const intl = useIntl(); const useT = (transformedMessage: string) => { return intl.formatMessage({ - id: transformedMessage + id: transformedMessage, }); }; @@ -35,14 +35,14 @@ export function PieChart(props: PieProps) { useEffect(() => { if (containerRef.current) { const themeConfig = { - theme:{ + theme: { colors10, }, legend: { ...(isDark ? DARK_THEME_CONFIG : LIGHT_THEME_CONFIG)['legend'], position: 'bottom', }, - pieStyle:{ + pieStyle: { lineWidth: 0, }, statistic: { @@ -60,7 +60,7 @@ export function PieChart(props: PieProps) { style: { fontFamily: 'AlibabaPuHuiTiB', fontSize: '20px', - color: isDark ? '#fff' : '#1D2129' + color: isDark ? '#fff' : '#1D2129', }, }, }, @@ -81,12 +81,24 @@ export function PieChart(props: PieProps) { type: 'pie-statistic-active', cfg: { start: [ - { trigger: 'element:mouseenter', action: 'pie-statistic:change' }, - { trigger: 'legend-item:mouseenter', action: 'pie-statistic:change' }, + { + trigger: 'element:mouseenter', + action: 'pie-statistic:change', + }, + { + trigger: 'legend-item:mouseenter', + action: 'pie-statistic:change', + }, ], end: [ - { trigger: 'element:mouseleave', action: 'pie-statistic:reset' }, - { trigger: 'legend-item:mouseleave', action: 'pie-statistic:reset' }, + { + trigger: 'element:mouseleave', + action: 'pie-statistic:reset', + }, + { + trigger: 'legend-item:mouseleave', + action: 'pie-statistic:reset', + }, ], }, }, @@ -105,5 +117,5 @@ export function PieChart(props: PieProps) { <div className={styles.container}> <div ref={containerRef} /> </div> - ) + ); } diff --git a/site/components/ThemeCharts/Charts/StackedColumn/index.tsx b/site/components/ThemeCharts/Charts/StackedColumn/index.tsx index f4561e3cb..a47f81103 100644 --- a/site/components/ThemeCharts/Charts/StackedColumn/index.tsx +++ b/site/components/ThemeCharts/Charts/StackedColumn/index.tsx @@ -1,5 +1,5 @@ import { Column } from '@antv/g2plot'; -import React, { useEffect, useRef, useMemo } from 'react'; +import React, { useEffect, useMemo, useRef } from 'react'; import { DARK_THEME_CONFIG, LIGHT_THEME_CONFIG } from '../Column'; import styles from '../index.module.less'; @@ -12,82 +12,82 @@ const DATA = [ { x: '10-13', y: 300, - type: 'PD' + type: 'PD', }, { x: '10-13', y: 100, - type: 'FE' + type: 'FE', }, { x: '10-13', y: 100, - type: 'UX' + type: 'UX', }, { x: '10-13', y: 100, - type: 'UE' + type: 'UE', }, { x: '10-14', y: 220, - type: 'PD' + type: 'PD', }, { x: '10-14', y: 80, - type: 'FE' + type: 'FE', }, { x: '10-14', y: 50, - type: 'UX' + type: 'UX', }, { x: '10-14', y: 250, - type: 'UE' + type: 'UE', }, { x: '10-15', y: 120, - type: 'PD' + type: 'PD', }, { x: '10-15', y: 180, - type: 'FE' + type: 'FE', }, { x: '10-15', y: 200, - type: 'UX' + type: 'UX', }, { x: '10-15', y: 100, - type: 'UE' + type: 'UE', }, { x: '10-16', y: 250, - type: 'PD' + type: 'PD', }, { x: '10-16', y: 50, - type: 'FE' + type: 'FE', }, { x: '10-16', y: 120, - type: 'UX' + type: 'UX', }, { x: '10-16', y: 180, - type: 'UE' + type: 'UE', }, ]; @@ -131,5 +131,5 @@ export function StackedColumnChart(props: StackedColumnProps) { <div className={styles.container}> <div ref={containerRef} /> </div> - ) + ); } diff --git a/site/components/ThemeCharts/Charts/index.module.less b/site/components/ThemeCharts/Charts/index.module.less index 7706416ab..f94c91d0c 100644 --- a/site/components/ThemeCharts/Charts/index.module.less +++ b/site/components/ThemeCharts/Charts/index.module.less @@ -2,8 +2,8 @@ width: 100%; height: 100%; - >div { + > div { width: 100%; height: 100%; } -} \ No newline at end of file +} diff --git a/site/components/ThemeCharts/Charts/index.tsx b/site/components/ThemeCharts/Charts/index.tsx index 7b6ac9fc1..88b5d0e16 100644 --- a/site/components/ThemeCharts/Charts/index.tsx +++ b/site/components/ThemeCharts/Charts/index.tsx @@ -1,6 +1,6 @@ -export { PieChart } from './Pie'; -export { LineChart } from './Line'; +export { ColumnChart } from './Column'; export { GaugeChart } from './Gauge'; export { GraphChart } from './Graph'; -export { ColumnChart } from './Column'; +export { LineChart } from './Line'; +export { PieChart } from './Pie'; export { StackedColumnChart } from './StackedColumn'; diff --git a/site/components/ThemeCharts/index.module.less b/site/components/ThemeCharts/index.module.less index fb5704887..2d5cb93e3 100644 --- a/site/components/ThemeCharts/index.module.less +++ b/site/components/ThemeCharts/index.module.less @@ -18,7 +18,7 @@ height: 48px; line-height: 1em; font-size: 40px; - color: #1D2129; + color: #1d2129; font-family: AlibabaPuHuiTiB; margin-bottom: 48px; } @@ -34,13 +34,13 @@ width: 160px; cursor: pointer; font-size: 18px; - background-color: #FFFFFF; - border: 2px solid #E5E8EF; + background-color: #ffffff; + border: 2px solid #e5e8ef; border-radius: 8px; margin-right: 20px; line-height: 52px; - >img { + > img { height: 24px; width: 24px; margin-right: 8px; @@ -48,14 +48,14 @@ &:hover { font-weight: 500; - border: 2px solid #691EFF; + border: 2px solid #691eff; } } .isTheme { font-weight: 500; - border: 2px solid #691EFF; - color: #691EFF; + border: 2px solid #691eff; + color: #691eff; } } @@ -64,8 +64,8 @@ width: calc(100vw - 360px); max-width: 1680px; min-width: 1040px; - background-color: #FAFBFC; - border: 1px solid #E5E8EF; + background-color: #fafbfc; + border: 1px solid #e5e8ef; box-shadow: 0 8px 28px 0 rgba(0, 0, 0, 0.05); border-radius: 16px; box-sizing: border-box; @@ -83,7 +83,7 @@ .msgTitle { width: 85px; font-size: 20px; - color: #1D2129; + color: #1d2129; font-family: AlibabaPuHuiTiB; } @@ -111,7 +111,7 @@ height: 24px; font-weight: 500; font-size: 16px; - color: #1D2129; + color: #1d2129; letter-spacing: 0; line-height: 24px; } @@ -132,7 +132,7 @@ .download { font-size: 16px; - color: #424E66; + color: #424e66; letter-spacing: 0; line-height: 24px; cursor: pointer; @@ -140,12 +140,12 @@ position: relative; &:hover { - color: #691EFF; + color: #691eff; - >img { + > img { position: relative; left: -80px; - filter: drop-shadow(#691EFF 80px 0); + filter: drop-shadow(#691eff 80px 0); } } } @@ -159,7 +159,6 @@ } &.dark { - .title { color: #fff; } @@ -168,12 +167,12 @@ .button { background: rgba(0, 0, 0, 0); color: #fff; - opacity: .2; + opacity: 0.2; border-color: #fff; &:hover { font-weight: 500; - opacity: .9; + opacity: 0.9; } } @@ -210,7 +209,6 @@ } .acquire { - .download { img { position: relative; @@ -248,4 +246,4 @@ :last-child { margin-right: 0px; } -} \ No newline at end of file +} diff --git a/site/components/ThemeCharts/index.tsx b/site/components/ThemeCharts/index.tsx index 7bc72873a..0aab68ae7 100644 --- a/site/components/ThemeCharts/index.tsx +++ b/site/components/ThemeCharts/index.tsx @@ -1,21 +1,24 @@ -import { useIntl } from 'dumi'; -import classNames from 'classnames'; import { ColorPicker } from 'antd'; +import classNames from 'classnames'; +import { useIntl } from 'dumi'; import React, { useCallback, useMemo, useState } from 'react'; -import { GaugeChart, ColumnChart, LineChart, GraphChart, StackedColumnChart, PieChart } from './Charts'; import THEME_DATAS from '../../data/theme-charts.json'; import THEME_COLORS1 from '../../data/theme-colors1.json'; import THEME_COLORS2 from '../../data/theme-colors2.json'; import THEME_COLORS3 from '../../data/theme-colors3.json'; +import { + ColumnChart, + GaugeChart, + GraphChart, + LineChart, + PieChart, + StackedColumnChart, +} from './Charts'; import styles from './index.module.less'; // 已经生成的主题 json 文件 -const themeColors = [ - THEME_COLORS1, - THEME_COLORS2, - THEME_COLORS3, -]; +const themeColors = [THEME_COLORS1, THEME_COLORS2, THEME_COLORS3]; // 自定义主题,暂时不显示,需要时添加到 theme-charts.json 中 // { @@ -28,37 +31,37 @@ const themeColors = [ const CHARTS = [ { - msg: "仪表盘", + msg: '仪表盘', chart: (theme: any) => <GaugeChart theme={theme} />, }, { - msg: "分组柱形图", + msg: '分组柱形图', chart: (theme: any) => <ColumnChart theme={theme} />, }, { - msg: "力导向图布局", + msg: '力导向图布局', chart: (theme: any) => <GraphChart theme={theme} />, }, { - msg: "折线图", + msg: '折线图', chart: (theme: any) => <LineChart theme={theme} />, }, { - msg: "堆叠柱形图", + msg: '堆叠柱形图', chart: (theme: any) => <StackedColumnChart theme={theme} />, }, { - msg: "环形图", + msg: '环形图', chart: (theme: any) => <PieChart theme={theme} />, }, -] +]; // 定制主题,一键生成 export function ThemeCharts() { const intl = useIntl(); const useT = (transformedMessage: string) => { return intl.formatMessage({ - id: transformedMessage + id: transformedMessage, }); }; @@ -113,13 +116,13 @@ export function ThemeCharts() { })} style={{ backgroundImage: `url(${select.background})` }} > - <div className={styles.title}>{useT("定制主题,一键生成")}</div> + <div className={styles.title}>{useT('定制主题,一键生成')}</div> <div className={styles.themeButtons}> - { - THEME_DATAS.map((data, index) => { - const isTheme = select.text === data.text; + {THEME_DATAS.map((data, index) => { + const isTheme = select.text === data.text; - const button = (<div + const button = ( + <div className={classNames(styles.button, { [styles.isTheme]: isTheme, })} @@ -128,57 +131,78 @@ export function ThemeCharts() { setColorsJson(themeColors[index]); }} > - <img src={isDark ? data.darkImg : (isTheme ? data.activeImg : data.img)} alt='theme_icon' /> {useT(data.text)} - </div>); + <img + src={ + isDark ? data.darkImg : isTheme ? data.activeImg : data.img + } + alt="theme_icon" + />{' '} + {useT(data.text)} + </div> + ); - return index === 3 && isTheme ? - <ColorPicker - disabledAlpha - trigger='hover' - // onChange={(v: any, color: string) => setColors10(pick(color, true))} - panelRender={(panel: React.ReactNode) => <div className="custom-panel"> + return index === 3 && isTheme ? ( + <ColorPicker + disabledAlpha + trigger="hover" + // onChange={(v: any, color: string) => setColors10(pick(color, true))} + panelRender={(panel: React.ReactNode) => ( + <div className="custom-panel"> <div className={styles.colors}> { // colors10.map((color) => <div className={styles.color} style={{ background: color }} />) } </div> {panel} - </div>} - > - {button} - </ColorPicker> : - button - }) - } + </div> + )} + > + {button} + </ColorPicker> + ) : ( + button + ); + })} </div> <div className={styles.themeChart} style={{ backgroundImage: `url(${select.backgroundChart})` }} > <div className={styles.msg}> - <img src='https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*U3AfQq_cQMYAAAAAAAAAAAAADmJ7AQ/original' alt='antv' /> + <img + src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*U3AfQq_cQMYAAAAAAAAAAAAADmJ7AQ/original" + alt="antv" + /> <div className={styles.msgTitle}>AntV 5.0</div> <div className={styles.segmentation} /> <div className={styles.msgText}>{useT(select.text)}</div> </div> <div className={styles.charts}> - { - CHARTS.map((chart, index) => { - return <div + {CHARTS.map((chart, index) => { + return ( + <div className={classNames(styles.chart, { [styles.rightChart]: (index + 1) % 3 === 0, })} > <div className={styles.chartMsg}>{useT(chart.msg)}</div> - <div className={styles.content}>{chart.chart({ ...colorsJson, value: select.theme })}</div> + <div className={styles.content}> + {chart.chart({ ...colorsJson, value: select.theme })} + </div> </div> - }) - } + ); + })} </div> </div> <div className={styles.acquire}> - <div className={styles.download} onClick={onDownload}><img alt='download' src='https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*coOuTKR_NDMAAAAAAAAAAAAADmJ7AQ/original' /> {useT("规范下载")}</div> + <div className={styles.download} onClick={onDownload}> + <img + alt="download" + src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*coOuTKR_NDMAAAAAAAAAAAAADmJ7AQ/original" + />{' '} + {useT('规范下载')} + </div> </div> </div> - ) + ); } diff --git a/site/components/common/ActiveIcon/index.module.less b/site/components/common/ActiveIcon/index.module.less index 61a66364e..cb97f0106 100644 --- a/site/components/common/ActiveIcon/index.module.less +++ b/site/components/common/ActiveIcon/index.module.less @@ -21,4 +21,4 @@ display: block; } } -} \ No newline at end of file +} diff --git a/site/components/common/ActiveIcon/index.tsx b/site/components/common/ActiveIcon/index.tsx index 84f2a3790..06d8ae26d 100644 --- a/site/components/common/ActiveIcon/index.tsx +++ b/site/components/common/ActiveIcon/index.tsx @@ -1,5 +1,5 @@ -import React from 'react'; import classNames from 'classnames'; +import React from 'react'; import styles from './index.module.less'; @@ -17,10 +17,14 @@ export default function ActiveIcon(props: ActiveIconProps) { const { img, activeImg, className, text, href, target } = props; return ( - <a className={classNames(className, styles.activeIcon)} href={href} target={target} > - <img className={styles.inactive} src={img} alt='inactive_icon' /> - <img className={styles.active} src={activeImg} alt='active_icon' /> + <a + className={classNames(className, styles.activeIcon)} + href={href} + target={target} + > + <img className={styles.inactive} src={img} alt="inactive_icon" /> + <img className={styles.active} src={activeImg} alt="active_icon" /> {text} </a> - ) + ); } diff --git a/site/components/common/ModuleTitle/index.module.less b/site/components/common/ModuleTitle/index.module.less index e94c0c5b2..4d606858a 100644 --- a/site/components/common/ModuleTitle/index.module.less +++ b/site/components/common/ModuleTitle/index.module.less @@ -7,17 +7,17 @@ .title { height: 48px; font-size: 40px; - color: #1D2129; + color: #1d2129; margin-bottom: 16px; - font-family: AlibabaPuHuiTiB; + font-family: AlibabaPuHuiTiB; } .subTitle { font-family: PingFangSC; - color: #424E66; + color: #424e66; letter-spacing: 0; line-height: 24px; margin-bottom: 32px; max-width: 800px; } -} \ No newline at end of file +} diff --git a/site/components/common/ModuleTitle/index.tsx b/site/components/common/ModuleTitle/index.tsx index 59061ffef..825413b67 100644 --- a/site/components/common/ModuleTitle/index.tsx +++ b/site/components/common/ModuleTitle/index.tsx @@ -5,7 +5,7 @@ import styles from './index.module.less'; type ModuleTitleProps = { title: string; subTitle?: string; -} +}; // 公共标题 export default function ModuleTitle(props: ModuleTitleProps) { @@ -15,5 +15,5 @@ export default function ModuleTitle(props: ModuleTitleProps) { <div className={styles.title}>{title}</div> {subTitle && <div className={styles.subTitle}>{subTitle}</div>} </div> - ) + ); } diff --git a/site/components/common/OverflowedText/index.tsx b/site/components/common/OverflowedText/index.tsx index 87a9d3355..6dff6bde8 100644 --- a/site/components/common/OverflowedText/index.tsx +++ b/site/components/common/OverflowedText/index.tsx @@ -1,7 +1,7 @@ +import { ConfigProvider, Tooltip } from 'antd'; import cx from 'classnames'; +import { isNumber, isString, omit, toNumber } from 'lodash'; import React, { PureComponent } from 'react'; -import { Tooltip, ConfigProvider } from 'antd'; -import { isNumber, isString, toNumber, omit } from 'lodash'; import './index.less'; diff --git a/site/components/common/index.tsx b/site/components/common/index.tsx index a440a6939..a2b78a820 100644 --- a/site/components/common/index.tsx +++ b/site/components/common/index.tsx @@ -2,8 +2,4 @@ import ActiveIcon from './ActiveIcon'; import ModuleTitle from './ModuleTitle'; import { OverflowedText } from './OverflowedText'; -export { - ActiveIcon, - ModuleTitle, - OverflowedText, -}; +export { ActiveIcon, ModuleTitle, OverflowedText }; diff --git a/site/components/quickIssue/QuickIssue.module.less b/site/components/quickIssue/QuickIssue.module.less index e97fa9af2..dc07eaf8a 100644 --- a/site/components/quickIssue/QuickIssue.module.less +++ b/site/components/quickIssue/QuickIssue.module.less @@ -1,4 +1,4 @@ -.markdown{ +.markdown { font-size: 14px; line-height: 2; min-height: 910px; @@ -16,7 +16,7 @@ align-items: baseline; justify-content: space-evenly; - .button{ + .button { width: 450px; } } @@ -28,7 +28,6 @@ .titleInput { width: 400px; } - } @media (max-width: 1800px) { @@ -55,7 +54,7 @@ align-items: center !important; flex-direction: column; - .button{ + .button { width: 300px !important; } } @@ -63,5 +62,4 @@ .titleInput { width: 250px !important; } - -} \ No newline at end of file +} diff --git a/site/components/quickIssue/QuickIssue.tsx b/site/components/quickIssue/QuickIssue.tsx index 7a5edc491..09876c0bb 100644 --- a/site/components/quickIssue/QuickIssue.tsx +++ b/site/components/quickIssue/QuickIssue.tsx @@ -1,20 +1,22 @@ // 场景案例模版 -import React, { useState, useMemo, useEffect } from 'react'; -import { Layout as AntLayout, Button, Form, Input, Select, Space } from 'antd'; import Article from '@antv/dumi-theme-antv/dist/slots/Article'; -import style from './QuickIssue.module.less' -import { GITHUB_URL, ISSUE_TYPE } from './data'; -import newGithubIssueUrl from 'new-github-issue-url'; -import GitHubButton from 'react-github-btn' +import { Layout as AntLayout, Button, Form, Input, Select, Space } from 'antd'; import { useLocale } from 'dumi'; +import newGithubIssueUrl from 'new-github-issue-url'; +import React, { useEffect, useMemo, useState } from 'react'; +import GitHubButton from 'react-github-btn'; +import style from './QuickIssue.module.less'; +import { GITHUB_URL, ISSUE_TYPE } from './data'; -type url = { - label: string; - gitUrl: string; - api: string; - chartDemo: string; - assignee: string; -} | undefined +type url = + | { + label: string; + gitUrl: string; + api: string; + chartDemo: string; + assignee: string; + } + | undefined; const formItemLayout = { labelCol: { @@ -27,19 +29,19 @@ const formItemLayout = { }, }; export default () => { - const [url, setUrl] = useState<url>(undefined) + const [url, setUrl] = useState<url>(undefined); const [windowSize, setWindowSize] = useState(getWindowSize()); - const locale = useLocale() + const locale = useLocale(); const lang = locale.id.includes('zh') ? 'zh' : 'en'; const options = useMemo(() => { return GITHUB_URL.map((item) => { return { label: item.label, - value: item.gitUrl - } - }) - }, []) + value: item.gitUrl, + }; + }); + }, []); useEffect(() => { function handleWindowResize() { @@ -60,11 +62,10 @@ export default () => { const onChange = (e: string) => { const findData = GITHUB_URL.find((item) => { - return item.gitUrl === e - }) - setUrl(findData) - } - + return item.gitUrl === e; + }); + setUrl(findData); + }; const onFinish = (values: any) => { const toUrl = newGithubIssueUrl({ @@ -74,76 +75,114 @@ export default () => { labels: [values.type, 'QuickIssue'], assignee: url?.assignee, }); - window.open(toUrl) - } + window.open(toUrl); + }; const text = useMemo(() => { if (lang === 'en') { - return <div> - <h3>Before You Start...</h3> - <p> If you open an issue that does not conform to the requirements, it will be closed immediately</p> - <p>For usage questions, please use the following resources:</p> + return ( + <div> + <h3>Before You Start...</h3> + <p> + {' '} + If you open an issue that does not conform to the requirements, it + will be closed immediately + </p> + <p>For usage questions, please use the following resources:</p> + <ul> + <li>Read the introduce and components documentation</li> + <li> + Make sure you have search your question in FAQ and changelog + </li> + <li>Look for / ask questions on StackOverflow</li> + </ul> + </div> + ); + } + return ( + <div> + <h3>在你开始之前...</h3> + <p> + AntV的issue如果你开的 issue 不符合规定,它将会被 + <strong>立刻关闭。</strong> + </p> + <p>对于使用中遇到的问题,请使用以下资源:</p> <ul> - <li>Read the introduce and components documentation</li> - <li>Make sure you have search your question in FAQ and changelog</li> - <li>Look for / ask questions on StackOverflow</li> + <li>仔细阅读对应的 API文档 和 图标。</li> + <li>提问前确保你在 常见问题 和 更新日志 中搜索过</li> + <li>在 StackOverflow (英文) 或是 SegmentFault(中文)搜索和提问</li> </ul> </div> - } - return <div> - <h3>在你开始之前...</h3> - <p>AntV的issue如果你开的 issue 不符合规定,它将会被<strong>立刻关闭。</strong></p> - <p>对于使用中遇到的问题,请使用以下资源:</p> - <ul> - <li>仔细阅读对应的 API文档 和 图标。</li> - <li>提问前确保你在 常见问题 和 更新日志 中搜索过</li> - <li>在 StackOverflow (英文) 或是 SegmentFault(中文)搜索和提问</li> - </ul> - </div> - }, [lang]) + ); + }, [lang]); return ( <> <AntLayout hasSider> <Article className={style.markdown}> - <div style={{ height: '100%', width: '100%', display: 'flex', justifyContent: 'center' }}> + <div + style={{ + height: '100%', + width: '100%', + display: 'flex', + justifyContent: 'center', + }} + > <div className={style.content}> {text} - <Form onFinish={onFinish} {...windowSize.innerWidth < 960 ? {} : formItemLayout} > + <Form + onFinish={onFinish} + {...(windowSize.innerWidth < 960 ? {} : formItemLayout)} + > <div className={style.flex}> <Form.Item label={lang === 'zh' ? '仓库' : 'Repositorie'} name={'gitHub'} rules={[{ required: true }]} > - <Select style={{ width: 250 }} options={options} onChange={onChange} /> + <Select + style={{ width: 250 }} + options={options} + onChange={onChange} + /> </Form.Item> - {url ? <Form.Item> - <div className={style.button}> - <Space> - <Button onClick={() => { - window.open(url?.api) - }}>{'API'}</Button> - <Button onClick={() => { - window.open(url?.chartDemo) - }}>{lang === 'zh' ? '图表示例' : 'Demo'}</Button> - <div style={{ paddingTop: 6 }}> - <GitHubButton - href={`https://github.com/antvis/${url.label}`} - data-icon="octicon-star" - data-size="large" - data-show-count="true" - aria-label={`Star antvis/${url.label} on GitHub`} + {url ? ( + <Form.Item> + <div className={style.button}> + <Space> + <Button + onClick={() => { + window.open(url?.api); + }} > - Star - </GitHubButton> - </div> - </Space> - </div> - </Form.Item> : <div className={style.button}></div> - } + {'API'} + </Button> + <Button + onClick={() => { + window.open(url?.chartDemo); + }} + > + {lang === 'zh' ? '图表示例' : 'Demo'} + </Button> + <div style={{ paddingTop: 6 }}> + <GitHubButton + href={`https://github.com/antvis/${url.label}`} + data-icon="octicon-star" + data-size="large" + data-show-count="true" + aria-label={`Star antvis/${url.label} on GitHub`} + > + Star + </GitHubButton> + </div> + </Space> + </div> + </Form.Item> + ) : ( + <div className={style.button}></div> + )} </div> - <div className={style.flex} > + <div className={style.flex}> <Form.Item label={lang === 'zh' ? '类型' : 'type'} name={'type'} @@ -158,12 +197,25 @@ export default () => { name={'title'} rules={[{ required: true }]} > - <Input placeholder={lang === 'zh' ? '请填写标题' : 'Please fill in the title'} className={style.titleInput} /> + <Input + placeholder={ + lang === 'zh' + ? '请填写标题' + : 'Please fill in the title' + } + className={style.titleInput} + /> </Form.Item> </div> - <div style={{ textAlign: 'center' }} > - <p style={{ color: '#a1a1a1' }}>{lang === 'zh' ? 'issue正文内容,请点击下方按钮跳转到 Github 页面填写' : 'Please click the button below to be redirected to the GitHub page where you can fill in the content for the main issue'}</p> - <Button htmlType='submit' type='primary'>{lang === 'zh' ? '前往GitHub创建issue' : 'create issue'}</Button> + <div style={{ textAlign: 'center' }}> + <p style={{ color: '#a1a1a1' }}> + {lang === 'zh' + ? 'issue正文内容,请点击下方按钮跳转到 Github 页面填写' + : 'Please click the button below to be redirected to the GitHub page where you can fill in the content for the main issue'} + </p> + <Button htmlType="submit" type="primary"> + {lang === 'zh' ? '前往GitHub创建issue' : 'create issue'} + </Button> </div> </Form> </div> diff --git a/site/components/quickIssue/data.ts b/site/components/quickIssue/data.ts index 6663cb15a..310e99bfb 100644 --- a/site/components/quickIssue/data.ts +++ b/site/components/quickIssue/data.ts @@ -4,44 +4,44 @@ export const GITHUB_URL = [ gitUrl: 'https://github.com/antvis/G2', api: 'https://g2.antv.antgroup.com/api/overview', chartDemo: 'https://g2.antv.antgroup.com/examples', - assignee:'pearmini', + assignee: 'pearmini', }, { label: 'G6', gitUrl: 'https://github.com/antvis/G6', api: 'https://g6.antv.antgroup.com/api/overview', chartDemo: 'https://g6.antv.antgroup.com/examples', - assignee:'Yanyan-Wang', + assignee: 'Yanyan-Wang', }, { label: 'X6', gitUrl: 'https://github.com/antvis/X6', api: 'https://x6.antv.antgroup.com/api/graph/graph', chartDemo: 'https://x6.antv.antgroup.com/examples', - assignee:"NewByVector" + assignee: 'NewByVector', }, { label: 'L7', gitUrl: 'https://github.com/antvis/L7', api: 'https://l7.antv.antgroup.com/api/scene', chartDemo: 'https://l7.antv.antgroup.com/examples', - assignee:'lzxue', + assignee: 'lzxue', }, { label: 'F2', gitUrl: 'https://github.com/antvis/F2', api: 'https://f2.antv.antgroup.com/api/f2', chartDemo: 'https://f2.antv.antgroup.com/examples', - assignee:'zengyue', + assignee: 'zengyue', }, { label: 'S2', gitUrl: 'https://github.com/antvis/S2', api: 'https://s2.antv.antgroup.com/api/general/s2-data-config', chartDemo: 'https://s2.antv.antgroup.com/examples', - assignee:'lijinke666', - } -] + assignee: 'lijinke666', + }, +]; export const ISSUE_TYPE = [ { @@ -64,4 +64,4 @@ export const ISSUE_TYPE = [ label: '问题讨论', value: 'discussion', }, -] \ No newline at end of file +]; diff --git a/site/components/quoteCard/quoteCard.tsx b/site/components/quoteCard/quoteCard.tsx index 288e2c3ac..ac0068f37 100644 --- a/site/components/quoteCard/quoteCard.tsx +++ b/site/components/quoteCard/quoteCard.tsx @@ -1,8 +1,8 @@ -import React from 'react'; import { Avatar } from 'antd'; -import styles from './quoteCard.module.less'; import classNames from 'classnames'; import { useIntl } from 'dumi'; +import React from 'react'; +import styles from './quoteCard.module.less'; const leftpad = 'https://gw.alipayobjects.com/zos/basement_prod/50fbdc16-bac3-4ecd-8210-f4ed2c116fdb.svg'; @@ -24,13 +24,13 @@ interface Props { } const QuoteCard = (props: Props) => { - const intl = useIntl() + const intl = useIntl(); const useT = (transformedMessage: string) => { return intl.formatMessage({ - id: transformedMessage - }) - } + id: transformedMessage, + }); + }; const borderSlicer: Array<object> = []; if (props.hasBorder) { borderSlicer.push( diff --git a/site/data/famous-persons.json b/site/data/famous-persons.json index 41cdedf54..c7f44d435 100644 --- a/site/data/famous-persons.json +++ b/site/data/famous-persons.json @@ -27,4 +27,4 @@ "image": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*gwZ1S6Yc8IkAAAAAAAAAAAAADmJ7AQ/original", "color": "#D580FF" } -] \ No newline at end of file +] diff --git a/site/data/link-charts.json b/site/data/link-charts.json index 9a4a999ff..6169d1789 100644 --- a/site/data/link-charts.json +++ b/site/data/link-charts.json @@ -103,4 +103,4 @@ "antv": "F2", "color": "rgba(198,86,253)" } -] \ No newline at end of file +] diff --git a/site/data/theme-charts.json b/site/data/theme-charts.json index 509803eb9..534188c5f 100644 --- a/site/data/theme-charts.json +++ b/site/data/theme-charts.json @@ -1,4 +1,5 @@ -[{ +[ + { "text": "日常分析", "img": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*_QoYRowGM50AAAAAAAAAAAAADmJ7AQ/original", "activeImg": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*q5g5Qp2D7GYAAAAAAAAAAAAADmJ7AQ/original", @@ -23,4 +24,4 @@ "backgroundChart": "https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*SPGHSrSfT1UAAAAAAAAAAAAADmJ7AQ/original", "theme": "dark" } -] \ No newline at end of file +] diff --git a/site/data/theme-colors1.json b/site/data/theme-colors1.json index cb06f8d41..256f7cd14 100644 --- a/site/data/theme-colors1.json +++ b/site/data/theme-colors1.json @@ -367,4 +367,4 @@ ] ] } -} \ No newline at end of file +} diff --git a/site/data/theme-colors2.json b/site/data/theme-colors2.json index 543f13499..6f7c8761c 100644 --- a/site/data/theme-colors2.json +++ b/site/data/theme-colors2.json @@ -367,4 +367,4 @@ ] ] } -} \ No newline at end of file +} diff --git a/site/data/theme-colors3.json b/site/data/theme-colors3.json index 1efe93b52..fac85c955 100644 --- a/site/data/theme-colors3.json +++ b/site/data/theme-colors3.json @@ -367,4 +367,4 @@ ] ] } -} \ No newline at end of file +} diff --git a/site/utils.ts b/site/utils.ts index b66bcddeb..e9e177542 100644 --- a/site/utils.ts +++ b/site/utils.ts @@ -1,8 +1,8 @@ /** * Translate函数 */ -import { useLocale } from "dumi" +import { useLocale } from 'dumi'; export const getLang = () => { - return useLocale().id -} + return useLocale().id; +};