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) {
- )
+ );
}
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 `
-

-
${useT('用户总量')}
-
1,320
+

+
${useT('用户总量')}
+
1,320
`;
},
},
},
- }
+ };
if (!plotRef.current) {
plotRef.current = new Gauge(containerRef.current, {
@@ -71,5 +79,5 @@ export function GaugeChart(props: GaugeProps) {
- )
+ );
}
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
(null);
const plotRef = React.useRef(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 (
- )
+ );
}
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) {
- )
+ );
}
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) {
- )
+ );
}
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) {
- )
+ );
}
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) => ,
},
{
- msg: "分组柱形图",
+ msg: '分组柱形图',
chart: (theme: any) => ,
},
{
- msg: "力导向图布局",
+ msg: '力导向图布局',
chart: (theme: any) => ,
},
{
- msg: "折线图",
+ msg: '折线图',
chart: (theme: any) => ,
},
{
- msg: "堆叠柱形图",
+ msg: '堆叠柱形图',
chart: (theme: any) => ,
},
{
- msg: "环形图",
+ msg: '环形图',
chart: (theme: any) => ,
},
-]
+];
// 定制主题,一键生成
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})` }}
>
- {useT("定制主题,一键生成")}
+ {useT('定制主题,一键生成')}
- {
- THEME_DATAS.map((data, index) => {
- const isTheme = select.text === data.text;
+ {THEME_DATAS.map((data, index) => {
+ const isTheme = select.text === data.text;
- const button = (
-

{useT(data.text)}
-
);
+

{' '}
+ {useT(data.text)}
+
+ );
- return index === 3 && isTheme ?
- setColors10(pick(color, true))}
- panelRender={(panel: React.ReactNode) =>
+ return index === 3 && isTheme ? (
+
setColors10(pick(color, true))}
+ panelRender={(panel: React.ReactNode) => (
+
{
// colors10.map((color) =>
)
}
{panel}
-
}
- >
- {button}
- :
- button
- })
- }
+
+ )}
+ >
+ {button}
+
+ ) : (
+ button
+ );
+ })}