From c864630c1900bc5dde64ea1744b195267caf2c9d Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Wed, 11 Apr 2018 12:03:35 +0800 Subject: [PATCH 1/8] Fix undefined type --- src/components/Charts/ChartCard/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Charts/ChartCard/index.js b/src/components/Charts/ChartCard/index.js index c7875b06..c3ee1865 100644 --- a/src/components/Charts/ChartCard/index.js +++ b/src/components/Charts/ChartCard/index.js @@ -7,7 +7,7 @@ import styles from './index.less'; const renderTotal = total => { let totalDom; switch (typeof total) { - case undefined: + case 'undefined': totalDom = null; break; case 'function': From c86c321c46a7ae865eec18e3b70c288cc27f4c81 Mon Sep 17 00:00:00 2001 From: mdluo Date: Thu, 12 Apr 2018 19:26:38 +0800 Subject: [PATCH 2/8] Fix TimelineChart time format issue (#1283) --- src/components/Charts/TimelineChart/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Charts/TimelineChart/index.js b/src/components/Charts/TimelineChart/index.js index f00c9bb6..e7ab6b11 100644 --- a/src/components/Charts/TimelineChart/index.js +++ b/src/components/Charts/TimelineChart/index.js @@ -71,8 +71,8 @@ export default class TimelineChart extends React.Component { const timeScale = { type: 'time', - tickCount: 10, - mask: 'HH:MM', + tickInterval: 60 * 60 * 1000, + mask: 'HH:mm', range: [0, 1], }; From fe1aeb2e949e74b8c1a1e68a1c4fbf8b4c108340 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 17 Apr 2018 17:43:51 +0800 Subject: [PATCH 3/8] Fix charts api, margin => padding --- src/components/Charts/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Charts/index.md b/src/components/Charts/index.md index e292a247..cb7c9c96 100644 --- a/src/components/Charts/index.md +++ b/src/components/Charts/index.md @@ -1,5 +1,5 @@ --- -title: +title: en-US: Charts zh-CN: Charts subtitle: 图表 @@ -59,7 +59,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https |----------|------------------------------------------|-------------|-------| | title | 图表标题 | ReactNode\|string | - | | color | 图表颜色 | string | `rgba(24, 144, 255, 0.85)` | -| margin | 图表内部间距 | array | \[32, 0, 32, 40\] | +| padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` | | height | 图表高度 | number | - | | data | 数据 | array<{x, y}> | - | | autoLabel | 在宽度不足时,自动隐藏 x 轴的 label | boolean | `true` | @@ -72,7 +72,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https | color | 图表颜色 | string | `rgba(24, 144, 255, 0.85)` | | height | 图表高度 | number | - | | hasLegend | 是否显示 legend | boolean | `false` | -| margin | 图表内部间距 | array | \[24, 0, 24, 0\] | +| padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` | | percent | 占比 | number | - | | tooltip | 是否显示 tooltip | boolean | true | | valueFormat | 显示值的格式化函数 | function | - | @@ -87,7 +87,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https | title | 图表标题 | ReactNode\|string | - | | height | 图表高度 | number | - | | hasLegend | 是否显示 legend | boolean | `false` | -| margin | 图表内部间距 | array | \[24, 30, 16, 30\] | +| padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` | | data | 图标数据 | array<{name,label,value}> | - | ### Gauge From 3bc5c54cc9dc416d5f1beced289c36e4a8f33581 Mon Sep 17 00:00:00 2001 From: ddcat1115 Date: Thu, 19 Apr 2018 17:24:21 +0800 Subject: [PATCH 4/8] add default Charts export - to support: import Charts from 'ant-design-pro/lib/Charts'; --- src/components/Charts/index.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/components/Charts/index.js b/src/components/Charts/index.js index 0fbf0144..cacedbce 100644 --- a/src/components/Charts/index.js +++ b/src/components/Charts/index.js @@ -15,7 +15,24 @@ import TimelineChart from './TimelineChart'; const yuan = val => `¥ ${numeral(val).format('0,0')}`; +const Charts = { + yuan, + Bar, + Pie, + Gauge, + Radar, + MiniBar, + MiniArea, + MiniProgress, + ChartCard, + Field, + WaterWave, + TagCloud, + TimelineChart, +}; + export { + Charts as default, yuan, Bar, Pie, From 2d47f4b00a00d2d42b2c9549ea33e9c8f31e494a Mon Sep 17 00:00:00 2001 From: ddcat1115 Date: Fri, 20 Apr 2018 00:10:21 +0800 Subject: [PATCH 5/8] bump 1.3.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 102a2d2c..0f59fa22 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-pro", - "version": "1.2.1", + "version": "1.3.0", "description": "An out-of-box UI solution for enterprise applications", "private": true, "scripts": { From 7c7fb5e3d0e5cca2e54c10eaf3644e44144eb6a5 Mon Sep 17 00:00:00 2001 From: Rupeshiya <31209617+Rupeshiya@users.noreply.github.com> Date: Fri, 20 Apr 2018 22:33:29 +0530 Subject: [PATCH 6/8] Update index.js (#1335) corrected spelling in src/components/chart/pie/index.js --- src/components/Charts/Pie/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Charts/Pie/index.js b/src/components/Charts/Pie/index.js index ac7248d7..0d0dc3c5 100644 --- a/src/components/Charts/Pie/index.js +++ b/src/components/Charts/Pie/index.js @@ -19,7 +19,7 @@ export default class Pie extends Component { }; componentDidMount() { - this.getLengendData(); + this.getLegendData(); this.resize(); window.addEventListener('resize', this.resize); } @@ -33,7 +33,7 @@ export default class Pie extends Component { legendData: [...this.state.legendData], }, () => { - this.getLengendData(); + this.getLegendData(); } ); } @@ -49,7 +49,7 @@ export default class Pie extends Component { }; // for custom lengend view - getLengendData = () => { + getLegendData = () => { if (!this.chart) return; const geom = this.chart.getAllGeoms()[0]; // 获取所有的图形 const items = geom.get('dataArray') || []; // 获取图形对应的 From 80ba0b86b810d975a3fe2eb09805cd60d90630f2 Mon Sep 17 00:00:00 2001 From: chencheng Date: Mon, 23 Apr 2018 12:29:35 +0800 Subject: [PATCH 7/8] fix: babel transform failed with transform-decorators-legacy --- .webpackrc.js | 1 - 1 file changed, 1 deletion(-) diff --git a/.webpackrc.js b/.webpackrc.js index db3421fd..ce65d311 100755 --- a/.webpackrc.js +++ b/.webpackrc.js @@ -3,7 +3,6 @@ const path = require('path'); export default { entry: 'src/index.js', extraBabelPlugins: [ - 'transform-decorators-legacy', ['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }], ], env: { From 42e226774dee6c7a70af894775c914d6d980e69d Mon Sep 17 00:00:00 2001 From: chencheng Date: Mon, 23 Apr 2018 12:32:18 +0800 Subject: [PATCH 8/8] remove deps --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 0f59fa22..b2c4e9ec 100755 --- a/package.json +++ b/package.json @@ -53,7 +53,6 @@ "babel-plugin-dva-hmr": "^0.4.1", "babel-plugin-import": "^1.6.7", "babel-plugin-module-resolver": "^3.1.1", - "babel-plugin-transform-decorators-legacy": "^1.3.4", "cross-env": "^5.1.1", "cross-port-killer": "^1.0.1", "enzyme": "^3.1.0",