forked from alibaba/BizCharts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: plot legend positon 十二方位兼容; 分组图形默认isGroup配置兼容
- Loading branch information
Showing
13 changed files
with
113 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ registerEngine('svg', SVGEngine); | |
|
||
// @ts-ignore | ||
export * from '@antv/g2/lib/core'; | ||
export const VERSION = '4.1.6'; | ||
export const VERSION = '4.1.7-beta.2'; | ||
|
||
|
||
// fixme: supportCSSTransform 在[email protected] 后支持 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,10 @@ import { Radar, RadarOptions as options } from '@antv/g2plot/lib/plots/radar'; | |
import { MappingOptions } from '@antv/g2plot/lib/adaptor/geometries/base'; | ||
|
||
import createPlot, { BasePlotOptions } from '../createPlot'; | ||
import { polyfillOptions, replaceApi, replaceAxis } from './core/polyfill'; | ||
import { polyfillOptions, replaceApi } from './core/polyfill'; | ||
|
||
import { LengendAPIOptions, TooltipAPIOptions, LabelAPIOptions } from './core/interface'; | ||
import { deepMix } from '@antv/util'; | ||
|
||
const REPLACEAPILIST = [{ | ||
sourceKey: 'angleField', | ||
|
@@ -19,6 +20,14 @@ const REPLACEAPILIST = [{ | |
sourceKey: 'radiusField', | ||
targetKey: 'yField', | ||
notice: 'radiusField 是 [email protected]的属性,即将废弃,请使用yFeild替代', | ||
}, { | ||
sourceKey: 'angleAxis', | ||
targetKey: 'xAxis', | ||
notice: 'angleAxis 是 [email protected]的属性,即将废弃,请使用xAxis替代', | ||
}, { | ||
sourceKey: 'radiusAxis', | ||
targetKey: 'yAxis', | ||
notice: 'radiusAxis 是 [email protected]的属性,即将废弃,请使用yAxis替代', | ||
}]; | ||
|
||
interface LineAPIOptions { | ||
|
@@ -84,8 +93,9 @@ const replaceLineWithLinestyle = (options: RadarOptions) => { | |
|
||
|
||
const polyfill = (opt: RadarOptions): RadarOptions => { | ||
// 先转为统一的,在统一polyfill | ||
replaceApi(REPLACEAPILIST, opt); | ||
const options = polyfillOptions(opt); | ||
replaceApi(REPLACEAPILIST, options); // angleField,statusField api替换 | ||
|
||
if (get(options, 'area.visible') === false) { | ||
set(options, 'area', false); | ||
|
@@ -106,9 +116,6 @@ const polyfill = (opt: RadarOptions): RadarOptions => { | |
options.angleAxis.tickLine = get(options, 'angleAxis.tickLine', null); | ||
} | ||
|
||
replaceAxis(options, 'angleAxis', 'xAxis'); | ||
replaceAxis(options, 'radiusAxis', 'yAxis'); | ||
|
||
if (get(options, 'tooltip.visible') === false) { | ||
set(options, 'tooltip', false); | ||
} | ||
|
@@ -117,6 +124,15 @@ const polyfill = (opt: RadarOptions): RadarOptions => { | |
set(options, 'label', false); | ||
} | ||
|
||
if (get(options, 'yAxis.grid.line.type') === 'line') { | ||
deepMix(options, { | ||
xAxis: { | ||
line: null, | ||
tickLine: null, | ||
} | ||
}, options); | ||
} | ||
|
||
return options; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.