Skip to content

Commit

Permalink
feat(pattern): 直方图、水波图、矩阵树图添加 pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
visiky committed Aug 15, 2021
1 parent 5847558 commit eb1ad9b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
14 changes: 13 additions & 1 deletion src/plots/histogram/adaptor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Params } from '../../core/adaptor';
import { tooltip, interaction, animation, theme, scale, state } from '../../adaptor/common';
import { pattern } from '../../adaptor/pattern';
import { findGeometry, deepAssign } from '../../utils';
import { flow, transformLabel } from '../../utils';
import { interval } from '../../adaptor/geometries';
Expand Down Expand Up @@ -114,5 +115,16 @@ function label(params: Params<HistogramOptions>): Params<HistogramOptions> {
*/
export function adaptor(params: Params<HistogramOptions>) {
// flow 的方式处理所有的配置到 G2 API
return flow(geometry, meta, axis, theme, state, label, tooltip, interaction, animation)(params);
return flow(
theme,
pattern('columnStyle'),
geometry,
meta,
axis,
state,
label,
tooltip,
interaction,
animation
)(params);
}
3 changes: 2 additions & 1 deletion src/plots/liquid/adaptor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Geometry } from '@antv/g2';
import { get, isNil } from '@antv/util';
import { interaction, animation, theme, scale } from '../../adaptor/common';
import { pattern } from '../../adaptor/pattern';
import { Params } from '../../core/adaptor';
import { flow, deepAssign, renderStatistic } from '../../utils';
import { interval } from '../../adaptor/geometries';
Expand Down Expand Up @@ -97,5 +98,5 @@ export function statistic(params: Params<LiquidOptions>, updated?: boolean): Par
*/
export function adaptor(params: Params<LiquidOptions>) {
// flow 的方式处理所有的配置到 G2 API (主题前置,会影响绘制的取色)
return flow(theme, geometry, statistic, scale({}), animation, interaction)(params);
return flow(theme, pattern('liquidStyle'), geometry, statistic, scale({}), animation, interaction)(params);
}
14 changes: 13 additions & 1 deletion src/plots/treemap/adaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { get } from '@antv/util';
import { polygon as basePolygon } from '../../adaptor/geometries/polygon';
import { Params } from '../../core/adaptor';
import { interaction as commonInteraction, animation, theme, legend, annotation, tooltip } from '../../adaptor/common';
import { pattern } from '../../adaptor/pattern';
import { flow, deepAssign } from '../../utils';
import { getAdjustAppendPadding } from '../../utils/padding';
import { transformData, findInteraction, enableDrillInteraction } from './utils';
Expand Down Expand Up @@ -145,5 +146,16 @@ export function interaction(params: Params<TreemapOptions>): Params<TreemapOptio
* @param options
*/
export function adaptor(params: Params<TreemapOptions>) {
return flow(defaultOptions, theme, geometry, axis, legend, tooltip, interaction, animation, annotation())(params);
return flow(
defaultOptions,
theme,
pattern('rectStyle'),
geometry,
axis,
legend,
tooltip,
interaction,
animation,
annotation()
)(params);
}

0 comments on commit eb1ad9b

Please sign in to comment.