diff --git a/CHANGELOG.md b/CHANGELOG.md index 10f494aa..44f81fc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ -# 3.1.0-beta.6 (1.07, 2017) +# 3.1.1 (1.18, 2017) +- update g2 3.0.4-beta.4. +- when data=null show g2 axis. + +# 3.1.0 (1.07, 2017) the release version which compate react16. # 3.1.0-beta.6 (12.29, 2017) diff --git a/package.json b/package.json index e9c56344..6b7e6ff4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bizcharts", - "version": "3.1.0", + "version": "3.1.1", "description": "A powerful React chart library based G2 for browser", "main": "umd/BizCharts.js", "browser": "umd/BizCharts.js", @@ -53,7 +53,7 @@ "react": "^15.0.0 || ^16.0.0" }, "dependencies": { - "@antv/g2": "3.0.4-beta.2", + "@antv/g2": "3.0.4-beta.4", "invariant": "^2.2.2", "warning": "^3.0.0", "prop-types": "^15.6.0" diff --git a/src/components/Chart/index.jsx b/src/components/Chart/index.jsx index 64bb75b7..f9ecb600 100644 --- a/src/components/Chart/index.jsx +++ b/src/components/Chart/index.jsx @@ -8,14 +8,10 @@ import PureChart from './purechart'; import Empty from './empty'; function hasSource(source) { - let flag; + let flag = true; if (source == null) { flag = false; - } else if (Util.isArray(source)) { - flag = source[0]; - } else { - flag = true; } return !!flag; @@ -43,9 +39,13 @@ export default class Chart extends (React.PureComponent || React.Component) { const { data, width, height, placeholder, className, style } = this.props; return (
{ - (hasSource(data) || this.hasViewSource()) ? + (hasSource(data) || this.hasViewSource() || !(placeholder === true)) ? : - + }
); } diff --git a/src/processor/configMerge.js b/src/processor/configMerge.js index 98844a0e..336d307a 100644 --- a/src/processor/configMerge.js +++ b/src/processor/configMerge.js @@ -1,8 +1,4 @@ -import { Util } from '../shared'; - -const notViewSelfProps = ['axises', 'coord', 'geoms', 'guide', 'children']; - const deleteFuncMap = { Chart: 'deleteChart', Coord: 'deleteCoord', @@ -73,7 +69,7 @@ const iMerge = { }, deleteLabel(config, id, parentId) { - if (!config || !config.geoms) return; + if (!config || !config.geoms || !config.geoms[parentId]) return; delete config.geoms[parentId].label; }, diff --git a/src/processor/processor.js b/src/processor/processor.js index 3f845839..e6b6c6ba 100644 --- a/src/processor/processor.js +++ b/src/processor/processor.js @@ -8,7 +8,6 @@ export default class Processor { constructor() { this.config = {}; this.elementInfos = {}; - this.idToName = {}; this.added = false; this.initedG2 = false; this.updated = false;