You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2020/05/27 02:31:04 UTC
[incubator-echarts] branch label-enhancement updated: fix(bar):
compat barBorderWidth
This is an automated email from the ASF dual-hosted git repository.
shenyi pushed a commit to branch label-enhancement
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git
The following commit(s) were added to refs/heads/label-enhancement by this push:
new bce7435 fix(bar): compat barBorderWidth
bce7435 is described below
commit bce74350da4b1930fe49ceaa40421455b46add01
Author: pissang <bm...@gmail.com>
AuthorDate: Wed May 27 10:29:56 2020 +0800
fix(bar): compat barBorderWidth
---
src/preprocessor/backwardCompat.ts | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/src/preprocessor/backwardCompat.ts b/src/preprocessor/backwardCompat.ts
index b83c529..c303624 100644
--- a/src/preprocessor/backwardCompat.ts
+++ b/src/preprocessor/backwardCompat.ts
@@ -71,19 +71,23 @@ const COMPATITABLE_COMPONENTS = [
'grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'
];
+const BAR_ITEM_STYLE_MAP = [
+ ['borderRadius', 'barBorderRadius'],
+ ['borderColor', 'barBorderColor'],
+ ['borderWidth', 'barBorderWidth']
+];
+
function compatBarItemStyle(option: Dictionary<any>) {
const itemStyle = option && option.itemStyle;
if (itemStyle) {
- if (itemStyle.barBorderRadius != null) {
- itemStyle.barderRadius = itemStyle.barBorderRadius;
- if (__DEV__) {
- deprecateLog('barBorderRadius has been changed to borderRadius.');
- }
- }
- if (itemStyle.barBorderColor != null) {
- itemStyle.borderColor = itemStyle.barBorderColor;
- if (__DEV__) {
- deprecateLog('barBorderColor has been changed to borderColor.');
+ for (let i = 0; i < BAR_ITEM_STYLE_MAP.length; i++) {
+ const oldName = BAR_ITEM_STYLE_MAP[i][1];
+ const newName = BAR_ITEM_STYLE_MAP[i][0];
+ if (itemStyle[oldName] != null) {
+ itemStyle[newName] = itemStyle[oldName];
+ if (__DEV__) {
+ deprecateLog(`${oldName} has been changed to ${newName}.`);
+ }
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org