Skip to content

Refactor/udpate package of vchart #3988

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/react-vchart/src/charts/BaseChart.tsx
Original file line number Diff line number Diff line change
@@ -302,7 +302,7 @@ export const createChart = <T extends Props>(
defaultProps.vchartConstrouctor.useRegisters(registers);
}

const Com = withContainer<ContainerProps, T>(BaseChart as any, componentName, (props: T) => {
const Com = withContainer<T>(BaseChart as any, componentName, (props: T) => {
if (defaultProps) {
return Object.assign(props, defaultProps);
}
6 changes: 4 additions & 2 deletions packages/react-vchart/src/charts/Pie3dChart.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import type React from 'react';
import type { IPie3dChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerPie3dChart, registerIndicator, registerLabel } from '@visactor/vchart';
import type { IVChartConstructor } from '@visactor/vchart';
import { VChart, registerIndicator, registerLabel } from '@visactor/vchart';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
import { registers } from './registers/simple';
import { registerPie3dChart } from '@visactor/vchart-extension';
import type { IPie3dChartSpec } from '@visactor/vchart-extension';

export interface Pie3dChartProps
extends Omit<BaseChartProps, 'container' | 'type' | 'data'>,
4 changes: 2 additions & 2 deletions packages/react-vchart/src/charts/WordCloud3dChart.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type React from 'react';
import type { IWordCloud3dChartSpec, IVChartConstructor } from '@visactor/vchart';
import { VChart, registerWordCloud3dChart } from '@visactor/vchart';
import type { IVChartConstructor } from '@visactor/vchart';
import { VChart } from '@visactor/vchart';
import { registers } from './registers/simple';
import type { BaseChartProps } from './BaseChart';
import { createChart } from './BaseChart';
12 changes: 6 additions & 6 deletions packages/react-vchart/src/containers/withContainer.tsx
Original file line number Diff line number Diff line change
@@ -7,13 +7,13 @@ export interface ContainerProps {
height?: number | string;
}

export default function withContainer<Props extends ContainerProps, CompProps>(
Comp: any,
export default function withContainer<P extends ContainerProps>(
Comp: React.ComponentType<any>,
name = 'ChartContainer',
getProps?: (props: any) => CompProps
getProps?: (props: any) => any
) {
const Cls = React.forwardRef<any, CompProps & Props>((props: CompProps & Props, ref) => {
const container = useRef();
const Cls = React.forwardRef<any, P>((props, ref) => {
const container = useRef<HTMLDivElement>(null);
const [inited, setInited] = useState(false);
const { className, style, width, ...options } = props;

@@ -33,7 +33,7 @@ export default function withContainer<Props extends ContainerProps, CompProps>(
}}
>
{inited ? (
<Comp ref={ref} container={container.current} {...(getProps ? getProps(options) : (options as CompProps))} />
<Comp ref={ref} container={container.current} {...(getProps ? getProps(options) : options)} />
) : (
<></>
)}
12 changes: 8 additions & 4 deletions packages/react-vchart/src/context/chart.tsx
Original file line number Diff line number Diff line change
@@ -9,15 +9,19 @@ export interface ChartContextType {
const ChartContext = React.createContext<ChartContextType>(null);
ChartContext.displayName = 'ChartContext';

export function withChartInstance<T>(Component: typeof React.Component) {
const Com = React.forwardRef<any, T>((props: T, ref) => {
export function withChartInstance<T>(Component: React.ComponentType<T & { chart?: IVChart }>) {
const Com = React.forwardRef<any, T>((props, ref) => {
return (
<ChartContext.Consumer>
{(ctx: ChartContextType) => <Component ref={ref} chart={ctx.chart} {...props} />}
{(ctx: ChartContextType) => (
// Only pass ref if Component supports it (i.e., is a forwardRef component)
// Otherwise, omit ref to avoid type errors
<Component {...(props as T)} chart={ctx.chart} {...(ref ? { ref } : {})} />
)}
</ChartContext.Consumer>
);
});
Com.displayName = Component.name;
Com.displayName = Component.displayName || Component.name;
return Com;
}

16 changes: 12 additions & 4 deletions packages/react-vchart/src/context/stage.tsx
Original file line number Diff line number Diff line change
@@ -4,11 +4,19 @@ import type { IStage } from '@visactor/vrender-core';
const StageContext = React.createContext<IStage>(null);
StageContext.displayName = 'StageContext';

export function withStage<T>(Component: typeof React.Component) {
const Com = React.forwardRef<any, T>((props: T, ref) => {
return <StageContext.Consumer>{ctx => <Component ref={ref} stage={ctx} {...props} />}</StageContext.Consumer>;
export function withStage<T>(Component: React.ComponentType<T & { stage: IStage }>) {
const Com = React.forwardRef<any, T & { stage?: IStage }>((props, ref) => {
return (
<StageContext.Consumer>
{ctx => {
// Omit 'stage' from props to avoid prop type conflicts
const { stage, ...restProps } = props as { stage?: IStage };
return <Component {...(restProps as T)} stage={ctx} ref={ref} />;
}}
</StageContext.Consumer>
);
});
Com.displayName = Component.name;
Com.displayName = Component.displayName || Component.name;
return Com;
}

15 changes: 9 additions & 6 deletions packages/react-vchart/src/index.ts
Original file line number Diff line number Diff line change
@@ -11,25 +11,20 @@ export const version = __VERSION__;
export type {
IAreaChartSpec,
IBarChartSpec,
IBar3dChartSpec,
IBoxPlotChartSpec,
ICirclePackingChartSpec,
ICommonChartSpec,
IFunnelChartSpec,
IFunnel3dChartSpec,
IGaugeChartSpec,
IHeatmapChartSpec,
IHistogramChartSpec,
IHistogram3dChartSpec,
ILineChartSpec,
IMapChartSpec,
IPieChartSpec,
IPie3dChartSpec,
ICircularProgressChartSpec,
ILinearProgressChartSpec,
IRadarChartSpec,
IRangeColumnChartSpec,
IRangeColumn3dChartSpec,
IRangeAreaChartSpec,
IRoseChartSpec,
IScatterChartSpec,
@@ -40,7 +35,6 @@ export type {
IWaterfallChartSpec,
ICorrelationChartSpec,
ILiquidChartSpec,
IWordCloud3dChartSpec,
IWordCloudChartSpec,
IPolarChartSpec,
ICartesianChartSpec,
@@ -49,3 +43,12 @@ export type {
ISpec,
IVChart
} from '@visactor/vchart';

export type {
IBar3dChartSpec,
IFunnel3dChartSpec,
IHistogram3dChartSpec,
IPie3dChartSpec,
IRangeColumn3dChartSpec,
IWordCloud3dChartSpec
} from '@visactor/vchart-extension';
7 changes: 4 additions & 3 deletions packages/react-vchart/src/series/RangeColumn3d.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { BaseSeriesProps, createSeries } from './BaseSeries';
import type { IRangeColumn3dSeriesSpec } from '@visactor/vchart';
import { registerRangeColumn3dSeries } from '@visactor/vchart';
import type { BaseSeriesProps } from './BaseSeries';
import { createSeries } from './BaseSeries';
import type { IRangeColumn3dSeriesSpec } from '@visactor/vchart-extension';
import { registerRangeColumn3dSeries } from '@visactor/vchart-extension';

export type RangeColumn3dProps = BaseSeriesProps & Omit<IRangeColumn3dSeriesSpec, 'type'>;

1 change: 1 addition & 0 deletions packages/vchart-extension/package.json
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@
"@visactor/vrender-animate": "1.0.0-alpha.17",
"@visactor/vutils": "~1.0.6",
"@visactor/vdataset": "~1.0.6",
"@visactor/vlayouts": "~1.0.6",
"@visactor/vchart": "workspace:1.13.9"
},
"devDependencies": {
3 changes: 3 additions & 0 deletions packages/vchart-extension/src/charts/3d/layout.ts
Original file line number Diff line number Diff line change
@@ -3,11 +3,14 @@ import { Factory, isXAxis, isYAxis, Layout } from '@visactor/vchart';
import type { IBoundsLike } from '@visactor/vutils';

export class Layout3d extends Layout implements IBaseLayout {
declare recomputeWidth: boolean;
declare recomputeHeight: boolean;
static type = 'layout3d';

layoutItems(_chart: IChart, items: ILayoutItem[], chartLayoutRect: IRect, chartViewBox: IBoundsLike): void {
// 布局初始化
this._layoutInit(_chart, items, chartLayoutRect, chartViewBox);

const recompute = {
recomputeWidth: this.recomputeWidth,
recomputeHeight: this.recomputeHeight
1 change: 1 addition & 0 deletions packages/vchart-extension/src/charts/bar-3d/index.ts
Original file line number Diff line number Diff line change
@@ -2,3 +2,4 @@ export * from './chart';
export * from './chart-spec-transformer';
export * from './interface';
export * from './series';
export * from './series-spec-transformer';
1 change: 1 addition & 0 deletions packages/vchart-extension/src/charts/funnel-3d/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './chart';
export * from './series';
export * from './series-spec-transformer';
export * from './interface';
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BaseChartSpecTransformer } from '../base';
import { BaseChartSpecTransformer } from '@visactor/vchart';
import type { IImageCloudChartSpec } from './interface';

export class ImageCloudChartSpecTransformer<T extends IImageCloudChartSpec> extends BaseChartSpecTransformer<T> {
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import { SeriesTypeEnum } from '../../series/interface/type';
import { ChartTypeEnum } from '../interface/type';
import type { IImageCloudChartSpec } from './interface';
import { Factory } from '../../core/factory';

import { ImageCloudChartSpecTransformer } from './image-cloud-transformer';
import { registerImageCloudSeries } from '../../series/image-cloud/image-cloud';
import { BaseChart } from '../base';
import { BaseChart, Factory } from '@visactor/vchart';
import { registerImageCloudSeries } from './series/image-cloud';
import { IMAGE_CLOUD_CHART_TYPE, IMAGE_CLOUD_SERIES_TYPE } from './series/constant';

export class ImageCloudChart<T extends IImageCloudChartSpec = IImageCloudChartSpec> extends BaseChart<T> {
static readonly type: string = ChartTypeEnum.imageCloud;
static readonly seriesType: string = SeriesTypeEnum.imageCloud;
static readonly type: string = IMAGE_CLOUD_CHART_TYPE;
static readonly seriesType: string = IMAGE_CLOUD_SERIES_TYPE;
static readonly transformerConstructor = ImageCloudChartSpecTransformer;
readonly transformerConstructor = ImageCloudChart.transformerConstructor;
readonly type: string = ChartTypeEnum.imageCloud;
readonly seriesType: string = SeriesTypeEnum.imageCloud;
readonly type: string = IMAGE_CLOUD_CHART_TYPE;
readonly seriesType: string = IMAGE_CLOUD_SERIES_TYPE;
}

export const registerImageCloudChart = () => {
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IImageCloudSeriesSpec } from '../../series/image-cloud/interface';
import type { IChartExtendsSeriesSpec, IChartSpec } from '../../typings/spec/common';
import type { IChartExtendsSeriesSpec, IChartSpec } from '@visactor/vchart';
import type { IImageCloudSeriesSpec } from './series/interface';

export interface IImageCloudChartSpec extends IChartSpec, Omit<IChartExtendsSeriesSpec<IImageCloudSeriesSpec>, 'type'> {
type: 'imageCloud';
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { EasingType } from '@visactor/vrender-core';
import type { IAnimationConfig } from '../../animation/interface';
import { ACustomAnimate } from '@visactor/vrender-animate';
import { Factory } from '../../core';
import { isValidNumber } from '@visactor/vutils';
import { DEFAULT_ANIMATION_CONFIG } from '../../animation/config';
import type { IAnimationConfig } from '@visactor/vchart';
import { DEFAULT_ANIMATION_CONFIG, Factory } from '@visactor/vchart';

export class AxialRotateAnimation extends ACustomAnimate<{}> {
declare valid: boolean;
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { baseSeriesMark, MarkTypeEnum } from '@visactor/vchart';

export const IMAGE_CLOUD_CHART_TYPE = 'imageCloud';
export const IMAGE_CLOUD_SERIES_TYPE = 'imageCloud';

export const enum ImageCloudMarkNameEnum {
image = 'image',
imageMask = 'imageMask'
}

export const imageCloudSeriesMark = {
...baseSeriesMark,
[ImageCloudMarkNameEnum.image]: { name: ImageCloudMarkNameEnum.image, type: MarkTypeEnum.image },
[ImageCloudMarkNameEnum.imageMask]: { name: ImageCloudMarkNameEnum.imageMask, type: MarkTypeEnum.rect }
};
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
import { registerImageMark } from '../../mark/image';
import type { SeriesMarkMap } from '../interface';
import { SeriesMarkNameEnum, SeriesTypeEnum } from '../interface';
import type { IImageCloudSeriesSpec } from './interface';
import { imageCloudSeriesMark } from './constant';
import { BaseSeries } from '../base';
import { IMAGE_CLOUD_SERIES_TYPE, ImageCloudMarkNameEnum, imageCloudSeriesMark } from './constant';
import type { IPoint } from '@visactor/vutils';
import { isValid } from '@visactor/vutils';
import type { IImageMark, IMark, IRectMark } from '../../mark/interface';
import type { Datum, IPoint } from '../../typings';
import { AttributeLevel } from '../../constant/attribute';
import { imagecloudTransform } from '@visactor/vlayouts';
import type { GridLayoutConfig } from '@visactor/vlayouts';
import { DEFAULT_DATA_KEY, Factory, vglobal } from '../../core';
import { animationConfig, userAnimationConfig } from '../../animation/utils';
import { registerImageCloudAnimation } from './animation';
import { ImageCloudTooltipHelper } from './tooltip-helper';
import { createImage, type IGraphic } from '@visactor/vrender-core';
import { createImage } from '@visactor/vrender-core';
import type { Datum, IImageMark, IMark, IRectMark } from '@visactor/vchart';
import {
animationConfig,
AttributeLevel,
BaseSeries,
DEFAULT_DATA_KEY,
Factory,
registerImageMark,
userAnimationConfig,
vglobal
} from '@visactor/vchart';

export class ImageCloudSeries<T extends IImageCloudSeriesSpec> extends BaseSeries<T> {
static readonly type: string = SeriesTypeEnum.imageCloud;
type = SeriesTypeEnum.imageCloud;
static readonly type: string = IMAGE_CLOUD_SERIES_TYPE;
type = IMAGE_CLOUD_SERIES_TYPE;

static readonly mark: SeriesMarkMap = imageCloudSeriesMark;
static readonly mark = imageCloudSeriesMark;

protected _urlField: string;
protected _nameField?: string;
@@ -182,8 +185,8 @@ export class ImageCloudSeries<T extends IImageCloudSeriesSpec> extends BaseSerie
this._maskMark
.getProduct()
.getChildren()
.forEach(element => {
(element as IGraphic).setAttribute('background', inputImage);
.forEach((element: any) => {
element.setAttribute('background', inputImage);
});
}
if (maskImage && (this._spec.layoutConfig as GridLayoutConfig)?.placement === 'masked') {
@@ -215,7 +218,7 @@ export class ImageCloudSeries<T extends IImageCloudSeriesSpec> extends BaseSerie
mark.setAnimationConfig(
animationConfig(
Factory.getAnimationInKey('imageCloud')(params, appearPreset),
userAnimationConfig(SeriesMarkNameEnum.image, this._spec, this._markAttributeContext)
userAnimationConfig(ImageCloudMarkNameEnum.image, this._spec, this._markAttributeContext)
)
);
}
Original file line number Diff line number Diff line change
@@ -5,10 +5,9 @@ import type {
TextShapeMask
} from '@visactor/vlayouts';

import type { IImageMarkSpec, IMarkSpec, ISeriesSpec } from '../../typings';
import type { SeriesMarkNameEnum } from '../interface';
import type { IAnimationSpec } from '../../animation/spec';
import type { ImageCloudAppearPresetType } from './animation';
import type { IAnimationSpec, IImageMarkSpec, IMarkSpec, ISeriesSpec } from '@visactor/vchart';
import type { ImageCloudMarkNameEnum } from './constant';

export interface IImageCloudSeriesSpec extends ISeriesSpec, IAnimationSpec<'image', ImageCloudAppearPresetType> {
type: 'imageCloud';
@@ -77,7 +76,7 @@ export interface IImageCloudSeriesSpec extends ISeriesSpec, IAnimationSpec<'imag
* 图片图元配置
* @description 可以根据 datum._frequency 来区分图片是否为填充图片
*/
[SeriesMarkNameEnum.image]?: IMarkSpec<Partial<IImageMarkSpec>> & {
[ImageCloudMarkNameEnum.image]?: IMarkSpec<Partial<IImageMarkSpec>> & {
padding?: number;
};
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Datum } from '../../typings';
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
import type { Datum } from '@visactor/vchart';
import { BaseSeriesTooltipHelper } from '@visactor/vchart';
import type { ImageCloudSeries } from './image-cloud';

export class ImageCloudTooltipHelper extends BaseSeriesTooltipHelper {
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Factory } from '../../core/factory';
import { ElementHighlight } from './element-highlight';
import type { BaseEventParams } from '../../event/interface';
import { ElementHighlight, Factory, type BaseEventParams, type IMarkGraphic } from '@visactor/vchart';
import { isNil } from '@visactor/vutils';
import type { IMarkGraphic } from '../../mark/interface/common';

const type = 'element-highlight-by-graphic-name';

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { IMarkGraphic } from '../../mark/interface/common';
import { Factory } from '../../core/factory';
import { ElementSelect } from './element-select';
import type { IMarkGraphic } from '@visactor/vchart';
import { ElementSelect, Factory } from '@visactor/vchart';

const type = 'element-select-by-graphic-name';

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export * from './pictogram';
export * from './interface';
export * from './pictogram-transformer';
export * from './series/pictogram';
export * from './series/svg-source';
7 changes: 7 additions & 0 deletions packages/vchart-extension/src/charts/pictogram/interface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { IChartExtendsSeriesSpec, IChartSpec } from '@visactor/vchart';
import type { IPictogramSeriesSpec } from './series/interface';

export interface IPictogramChartSpec extends IChartSpec, IChartExtendsSeriesSpec<any> {
type: 'pictogram';
series?: IPictogramSeriesSpec[];
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
// eslint-disable-next-line no-duplicate-imports
import { SeriesTypeEnum } from '../../series';
import type { IPictogramSeriesSpec } from '../../series/pictogram/interface';
import type { RegionSpec, ISeriesSpec } from '../../typings';
import { BaseChartSpecTransformer } from '../base';

import type { RegionSpec } from '@visactor/vchart';
import { BaseChartSpecTransformer } from '@visactor/vchart';
import type { IPictogramChartSpec } from './interface';
import { PICTOGRAM_SERIES_TYPE } from './series/constant';
import type { IPictogramSeriesSpec } from './series/interface';

export class PictogramChartSpecTransformer<
T extends IPictogramChartSpec = IPictogramChartSpec
> extends BaseChartSpecTransformer<T> {
protected _isValidSeries(type: string) {
return type === SeriesTypeEnum.pictogram;
return type === PICTOGRAM_SERIES_TYPE;
}

protected _getDefaultSeriesSpec(spec: IPictogramChartSpec): IPictogramSeriesSpec {
20 changes: 20 additions & 0 deletions packages/vchart-extension/src/charts/pictogram/pictogram.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { BaseChart, Factory, registerMarkTooltipProcessor } from '@visactor/vchart';
import type { IPictogramChartSpec } from './interface';
import { PictogramChartSpecTransformer } from './pictogram-transformer';
import { PICTOGRAM_CHART_TYPE, PICTOGRAM_SERIES_TYPE } from './series/constant';
import { registerPictogramSeries } from './series/pictogram';

export class PictogramChart<T extends IPictogramChartSpec = IPictogramChartSpec> extends BaseChart<T> {
static readonly type: string = PICTOGRAM_SERIES_TYPE;
static readonly seriesType: string = PICTOGRAM_CHART_TYPE;
static readonly transformerConstructor = PictogramChartSpecTransformer;
readonly transformerConstructor = PictogramChartSpecTransformer;
readonly type: string = PICTOGRAM_CHART_TYPE;
readonly seriesType: string = PICTOGRAM_SERIES_TYPE;
}

export const registerPictogramChart = () => {
registerMarkTooltipProcessor();
registerPictogramSeries();
Factory.registerChart(PictogramChart.type, PictogramChart);
};
16 changes: 16 additions & 0 deletions packages/vchart-extension/src/charts/pictogram/series/constant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { baseSeriesMark, MarkTypeEnum } from '@visactor/vchart';

export const PICTOGRAM_CHART_TYPE = 'pictogram';
export const PICTOGRAM_SERIES_TYPE = 'pictogram';

export const ELEMENT_HIGHLIGHT_BY_GRPHIC_NAME = 'element-highlight-by-graphic-name';
export const ELEMENT_SELECT_BY_GRPHIC_NAME = 'element-select-by-graphic-name';

export const enum PictogramMarkNameEnum {
pictogram = 'pictogram'
}

export const PictogramSeriesMark = {
...baseSeriesMark,
[PictogramMarkNameEnum.pictogram]: { name: PictogramMarkNameEnum.pictogram, type: MarkTypeEnum.group }
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import type { IPathMarkSpec } from '../../typings/visual';
import type { IMarkSpec, IMarkTheme, ISeriesSpec } from '../../typings/spec/common';
import type { IAnimationSpec } from '../../animation/spec';
import type { IAnimationSpec, IMarkSpec, IMarkTheme, IPathMarkSpec, ISeriesSpec } from '@visactor/vchart';

export interface IPictogramSeriesSpec extends ISeriesSpec, IAnimationSpec<'pictogram', 'fadeIn'> {
/**
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { isValid } from '@visactor/vutils';
import type { ISeriesSpec } from '../../typings';
import { BaseSeriesSpecTransformer } from '../base';
import { svgSourceMap } from './svg-source';
import type { SVGParserResult } from '@visactor/vdataset';
import { BaseSeriesSpecTransformer, type ISeriesSpec } from '@visactor/vchart';

export class PictogramSeriesSpecTransformer<T extends ISeriesSpec, K> extends BaseSeriesSpecTransformer<T, K> {
protected _getDefaultSpecFromChart(chartSpec: any): any {
Original file line number Diff line number Diff line change
@@ -1,50 +1,59 @@
import { DataView } from '@visactor/vdataset';
import type { SVGParsedElement, SVGParserResult } from '@visactor/vdataset';
import type { PanEventParam, ZoomEventParam } from '../../core';
import { Factory } from '../../core';
import { GeoSeries } from '../geo/geo';
import type { ISeriesSeriesInfo, SeriesMarkMap } from '../interface';
import { SeriesTypeEnum } from '../interface';
import type { IPictogramSeriesSpec } from './interface';
import { PictogramSeriesMark } from './constant';
import {
ELEMENT_HIGHLIGHT_BY_GRPHIC_NAME,
ELEMENT_SELECT_BY_GRPHIC_NAME,
PICTOGRAM_SERIES_TYPE,
PictogramSeriesMark
} from './constant';
import { getSVGSource, registerSVGSource, svgSourceMap, unregisterSVGSource } from './svg-source';
import { lookup } from '../../data/transforms/lookup';
import { registerDataSetInstanceTransform } from '../../data/register';
import type { GroupMark } from '../../mark';
import { shouldMarkDoMorph } from '../../animation/utils';
import { AttributeLevel } from '../../constant/attribute';
import { PictogramSeriesSpecTransformer } from './pictogram-transformer';
import type { IMatrix } from '@visactor/vutils';
import type { IMatrix, IPoint, IPointLike } from '@visactor/vutils';
import { Bounds, Matrix, isValid, merge } from '@visactor/vutils';
import type { Datum } from '../../typings';
import { createRect } from '@visactor/vrender-core';
import type { GraphicEventType, Group, IGroup } from '@visactor/vrender-core';
import { ChartEvent, HOOK_EVENT } from '../../constant/event';
import type { IHoverSpec, ISelectSpec } from '../../interaction/interface/spec';
import { STATE_VALUE_ENUM } from '../../compile/mark';
import type { IGroupMark, IMark, ITextMark } from '../../mark/interface';
import { PictogramSeriesTooltipHelper } from './tooltip-helper';
import { graphicAttributeTransform, pictogram } from '../../data/transforms/pictogram';
import type { IPoint } from '../../typings/coordinate';
import { CompilableData } from '../../compile/data';
import { registerElementHighlightByGraphicName } from '../../interaction/triggers/element-highlight-by-graphic-name';
import { registerElementSelectByGraphicName } from '../../interaction/triggers/element-select-by-graphic-name';
import { TRIGGER_TYPE_ENUM } from '../../interaction/triggers/enum';
import type {
Datum,
IGroupMark,
IHoverSpec,
IMark,
ISelectSpec,
ISeriesSeriesInfo,
ITextMark,
PanEventParam,
ZoomEventParam
} from '@visactor/vchart';
import {
AttributeLevel,
ChartEvent,
CompilableData,
Factory,
GeoSeries,
lookup,
registerDataSetInstanceTransform,
shouldMarkDoMorph,
STATE_VALUE_ENUM
} from '@visactor/vchart';
import { registerElementHighlightByGraphicName } from '../element-highlight-by-graphic-name';
import { registerElementSelectByGraphicName } from '../element-select-by-graphic-name';
import { graphicAttributeTransform, pictogram } from './transform';
import type { IGroup, GraphicEventType } from '@visactor/vrender-core';

export interface SVGParsedElementExtend extends SVGParsedElement {
_finalAttributes: Record<string, any>;
_uniqueId: string; // 用于处理 svg 中 id 重复的情况
}

export class PictogramSeries<T extends IPictogramSeriesSpec = IPictogramSeriesSpec> extends GeoSeries<T> {
static readonly type: string = SeriesTypeEnum.pictogram;
type = SeriesTypeEnum.pictogram;
static readonly mark: SeriesMarkMap = PictogramSeriesMark;
static readonly type: string = PICTOGRAM_SERIES_TYPE;
type = PICTOGRAM_SERIES_TYPE;
static readonly mark = PictogramSeriesMark;
static readonly transformerConstructor = PictogramSeriesSpecTransformer;

svg!: string;

protected _pictogramMark: GroupMark;
protected _pictogramMark: IGroupMark;
protected _parsedSvgResult: SVGParserResult;
private _labelMark: ITextMark;

@@ -89,7 +98,7 @@ export class PictogramSeries<T extends IPictogramSeriesSpec = IPictogramSeriesSp

protected _defaultHoverConfig(finalHoverSpec: IHoverSpec) {
return {
type: TRIGGER_TYPE_ENUM.ELEMENT_HIGHLIGHT_BY_GRPHIC_NAME,
type: ELEMENT_HIGHLIGHT_BY_GRPHIC_NAME,
// trigger: finalHoverSpec.trigger as EventType,
trigger: finalHoverSpec.trigger as GraphicEventType,
triggerOff: 'pointerout' as GraphicEventType,
@@ -107,7 +116,7 @@ export class PictogramSeries<T extends IPictogramSeriesSpec = IPictogramSeriesSp
: ['empty', finalSelectSpec.trigger];

return {
type: TRIGGER_TYPE_ENUM.ELEMENT_SELECT_BY_GRPHIC_NAME,
type: ELEMENT_SELECT_BY_GRPHIC_NAME,
trigger: finalSelectSpec.trigger as GraphicEventType,
triggerOff: triggerOff as GraphicEventType,
reverseState: STATE_VALUE_ENUM.STATE_SELECTED_REVERSE,
@@ -127,7 +136,7 @@ export class PictogramSeries<T extends IPictogramSeriesSpec = IPictogramSeriesSp
{
morph: shouldMarkDoMorph(this._spec, PictogramSeries.mark.pictogram.name)
}
) as GroupMark;
) as IGroupMark;

if (!this._pictogramMark) {
return;
@@ -273,7 +282,7 @@ export class PictogramSeries<T extends IPictogramSeriesSpec = IPictogramSeriesSp
});
}

dataToPosition(datum: Datum, global = false): IPoint {
dataToPosition(datum: Datum, global = false): IPointLike {
if (!datum) {
return null;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { registerDataSetInstanceParser, warn } from '@visactor/vchart';
import { DataSet, DataView, svgParser } from '@visactor/vdataset';
import type { ISVGSourceOption } from '@visactor/vdataset';
import { registerDataSetInstanceParser } from '../../data/register';
import { warn } from '../../util';

export const svgSourceMap = new Map<string, DataView>();

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { ISeriesTooltipHelper } from '../interface';
import { BaseSeriesTooltipHelper } from '../base/tooltip-helper';
import type { Datum, ISeriesTooltipHelper, TooltipHandlerParams } from '@visactor/vchart';
import { BaseSeriesTooltipHelper } from '@visactor/vchart';
import type { PictogramSeries } from './pictogram';
import type { TooltipHandlerParams } from '../../component';
import type { Datum } from '../../typings';

export class PictogramSeriesTooltipHelper extends BaseSeriesTooltipHelper implements ISeriesTooltipHelper {
dimensionTooltipTitleCallback = (datum: any) => {
207 changes: 207 additions & 0 deletions packages/vchart-extension/src/charts/pictogram/series/transform.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
import { isValid, merge } from '@visactor/vutils';
import type { DataView, SVGParserResult } from '@visactor/vdataset';
import { DEFAULT_DATA_INDEX, measureText } from '@visactor/vchart';

function isValidStrokeOrFill(attr: any) {
return isValid(attr) && attr !== 'none' && !attr.includes?.('url');
}

const getLineWidth = (attributes: any) => {
const strokeWidth = parseFloat(attributes.strokeWidth);
if (!isNaN(strokeWidth)) {
return strokeWidth;
}

const stroke = attributes.stroke;
return stroke && isValidStrokeOrFill(stroke) ? 1 : 0;
};

const getFill = (attributes: any, defaultFill?: string) => {
const fill = attributes.fill ?? defaultFill;
return fill && isValidStrokeOrFill(fill) ? fill : undefined;
};

const getStroke = (attributes: any, defaultStroke?: string) => {
const stroke = attributes.stroke ?? defaultStroke;
return stroke && isValidStrokeOrFill(stroke) ? stroke : false;
};

const commonAttributes = (attributes: Record<string, any>) => {
return {
...attributes,
x: parseFloat(attributes.x) || undefined,
y: parseFloat(attributes.y) || undefined,
fillStrokeOrder: false,
fill: getFill(attributes),
lineWidth: getLineWidth(attributes),
stroke: getStroke(attributes)
};
};

export const graphicAttributeTransform = {
group: (attributes: Record<string, any>) => {
const common = commonAttributes(attributes) as any;
return {
...common,
visibleAll: common.visible !== false
};
},
rule: (attributes: Record<string, any>) => {
return {
...commonAttributes(attributes),
x: parseFloat(attributes.x1),
y: parseFloat(attributes.y1),
x1: parseFloat(attributes.x2),
y1: parseFloat(attributes.y2)
};
},
rect: (attributes: Record<string, any>) => {
return {
...commonAttributes(attributes),
// rect 在 chrome 下有默认黑色填充,这里保持效果一致
fill: getFill(attributes, '#000'),
width: parseFloat(attributes.width),
height: parseFloat(attributes.height)
};
},
polygon: (attributes: Record<string, any>) => {
return {
...commonAttributes(attributes),
// rect 在 chrome 下有默认黑色填充,这里保持效果一致
fill: getFill(attributes, '#000'),
points: attributes.points
.trim()
.split(/\s+/)
.map((pair: string) => {
const [x, y] = pair.split(',').map(Number);
return { x, y };
})
};
},
line: (attributes: Record<string, any>) => {
return {
...commonAttributes(attributes),
points: attributes.points
.trim()
.split(/\s+/)
.map((pair: string) => {
const [x, y] = pair.split(',').map(Number);
return { x, y };
})
};
},
path: (attributes: Record<string, any>) => {
return {
...commonAttributes(attributes),
path: attributes.d,
fillStrokeOrder: false,
fill: getFill(attributes, '#000')
};
},
arc: (attributes: Record<string, any>) => {
return {
...commonAttributes(attributes),
outerRadius: attributes.r ?? attributes.ry,
x: parseFloat(attributes.cx),
y: parseFloat(attributes.cy),
startAngle: 0,
endAngle: Math.PI * 2,
scaleX: parseFloat(attributes.rx) / parseFloat(attributes.ry) || 1,
fill: getFill(attributes, '#000')
};
},
text: (attributes: Record<string, any>, value: string) => {
return {
...commonAttributes(attributes),
text: value,
textAlign: attributes.textAlign ?? 'left',
textBaseLine: attributes.textAnchor ?? 'middle',
anchor: [0, 0],
fill: getFill(attributes, '#000')
};
}
};

export const pictogram = (data: DataView[]) => {
if (!data || !data[0]) {
return {};
}
const { elements } = data[0].latestData as SVGParserResult;

// 处理最终属性
if (elements && elements.length) {
// TODO: type
// elements.forEach((el: SVGParsedElementExtend, index: number) => {
elements.forEach((el: any, index: number) => {
el[DEFAULT_DATA_INDEX] = index;
el._uniqueId = `${el.id}-${index}`;
el.data = undefined;

const { graphicType: type, transform } = el;

const finalAttributes = {
visible: el.attributes.visibility !== 'hidden' && el.attributes.visibility !== 'collapse'
};

if (el.graphicType === 'text') {
merge(finalAttributes, el._inheritStyle, el.parent?._textGroupStyle, el.attributes);
} else if (el.graphicType !== 'group') {
merge(finalAttributes, el._inheritStyle, el.attributes);
}

if ((graphicAttributeTransform as any)[type]) {
el._finalAttributes = (graphicAttributeTransform as any)[type](finalAttributes, el.value);
} else {
el._finalAttributes = finalAttributes;
}

if (transform) {
el._finalAttributes.postMatrix = { ...transform };
}
});

// 处理文字布局
const texts = elements.filter(el => el.tagName === 'text');
for (let i = 0; i < texts.length; i++) {
const textId = texts[i]._uniqueId;
const children = elements.filter(el => {
let result = false;
let parent = el.parent;
while (parent) {
if (parent._uniqueId === textId) {
result = true;
break;
}
parent = parent.parent;
}
return result;
});

if (children && children.length) {
const startX = texts[i]._textGroupStyle?.x ?? 0;
let curX = startX;

for (let j = 0; j < children.length; j++) {
const currentChild = children[j];
if (currentChild.graphicType === 'group') {
curX = startX;
} else if (currentChild.value) {
if (currentChild.parent._textGroupStyle.x === undefined) {
const lastText = children
.slice(0, j)
.reverse()
.find(c => c.graphicType === 'text' && c.value);
if (lastText) {
const width = measureText(lastText.value, lastText._finalAttributes).width;
curX += width;
}
currentChild._finalAttributes.x = curX;
}
}
}
}
}
}

return elements;
};
1 change: 1 addition & 0 deletions packages/vchart-extension/src/charts/pie-3d/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from './chart-spec-transformer';
export * from './chart';
export * from './series';
export * from './series-spec-transformer';
export * from './interface';
3 changes: 3 additions & 0 deletions packages/vchart-extension/src/charts/range-column-3d/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
export * from './series';
export * from './series-spec-transformer';
export * from './chart';
export * from './chart-spec-transformer';
export * from './interface';
2 changes: 2 additions & 0 deletions packages/vchart-extension/src/charts/word-cloud-3d/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export * from './chart';
export * from './chart-spec-transformer';
export * from './series';
export * from './interface';
3 changes: 3 additions & 0 deletions packages/vchart-extension/src/index.ts
Original file line number Diff line number Diff line change
@@ -11,7 +11,10 @@ export * from './charts/histogram-3d';
export * from './charts/pie-3d';
export * from './charts/word-cloud-3d';
export * from './charts/axis-3d';
export * from './charts/range-column-3d';
export { register3DPlugin } from './charts/3d/plugin';
export * from './charts/pictogram';
export * from './charts/image-cloud';

export * from './components/series-break';
export * from './components/bar-link';
11 changes: 8 additions & 3 deletions packages/vchart/src/animation/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
export { registerAnimate as registerVRenderAnimate, registerCustomAnimate } from '@visactor/vrender-animate';
export { registerStateTransition } from './state-transition';
export { registerSequentialAnimate } from './sequential-animate';
export { registerPolygonAnimation, registerRectAnimation, registerArcAnimation } from './config';
export { animationConfig, userAnimationConfig } from './utils';
export {
registerPolygonAnimation,
registerRectAnimation,
registerArcAnimation,
DEFAULT_ANIMATION_CONFIG
} from './config';
export { animationConfig, userAnimationConfig, shouldMarkDoMorph } from './utils';
export type { IAnimationSpec } from './spec';
export type { IAnimationTypeConfig } from './interface';
export type { IAnimationTypeConfig, IAnimationConfig } from './interface';
16 changes: 3 additions & 13 deletions packages/vchart/src/chart/index.ts
Original file line number Diff line number Diff line change
@@ -63,10 +63,6 @@ import type { IVennChartSpec } from './venn';
import { VennChart, registerVennChart } from './venn';
import type { IMosaicChartSpec } from './mosaic';
import { MosaicChart, registerMosaicChart } from './mosaic';
import type { IPictogramChartSpec } from './pictogram/interface';
import { PictogramChart, registerPictogramChart } from './pictogram/pictogram';
import type { IImageCloudChartSpec } from './image-cloud';
import { ImageCloudChart, registerImageCloudChart } from './image-cloud';
import type { IChart } from './interface/chart';
import { BaseWordCloudChart } from './word-cloud/base/base';
import { BaseWordCloudChartSpecTransformer } from './word-cloud/base/word-cloud-base-transformer';
@@ -110,9 +106,7 @@ export {
TreemapChart,
VennChart,
BaseChart,
MosaicChart,
PictogramChart,
ImageCloudChart
MosaicChart
};

export {
@@ -145,9 +139,7 @@ export {
registerLiquidChart,
registerWordCloudShapeChart,
registerVennChart,
registerMosaicChart,
registerPictogramChart,
registerImageCloudChart
registerMosaicChart
};

export type {
@@ -182,7 +174,5 @@ export type {
IPolarChartSpec,
ICartesianChartSpec,
IVennChartSpec,
IMosaicChartSpec,
IPictogramChartSpec,
IImageCloudChartSpec
IMosaicChartSpec
};
4 changes: 1 addition & 3 deletions packages/vchart/src/chart/interface/type.ts
Original file line number Diff line number Diff line change
@@ -29,7 +29,5 @@ export const enum ChartTypeEnum {
correlation = 'correlation',
liquid = 'liquid',
venn = 'venn',
mosaic = 'mosaic',
pictogram = 'pictogram',
imageCloud = 'imageCloud'
mosaic = 'mosaic'
}
7 changes: 0 additions & 7 deletions packages/vchart/src/chart/pictogram/interface.ts

This file was deleted.

23 changes: 0 additions & 23 deletions packages/vchart/src/chart/pictogram/pictogram.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/vchart/src/component/player/player.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { builtinThemes } from './../../theme/builtin/index';
import { Factory } from './../../core/factory';
import type { INode, IGroup, IGraphic } from '@visactor/vrender-core';
import type { ContinuousPlayerAttributes, DiscretePlayerAttributes } from '@visactor/vrender-components';
@@ -29,7 +28,7 @@ export class Player extends BaseComponent<IPlayer> implements IComponent {
layoutZIndex: number = LayoutZIndex.Player;
layoutLevel: number = LayoutLevel.Player;

static readonly builtinThemes = {
static readonly builtInTheme = {
player
};

6 changes: 6 additions & 0 deletions packages/vchart/src/core/index.ts
Original file line number Diff line number Diff line change
@@ -29,6 +29,8 @@ export * from '../constant/data';
export * from '../constant/layout';
export { AttributeLevel } from '../constant/attribute';
export { TransformLevel } from '../data/initialize';
export { STATE_VALUE_ENUM } from '../compile/mark/interface';
export { ChartEvent } from '../constant/event';

/**
* spec
@@ -60,3 +62,7 @@ export { ManualTicker, StreamLight } from '@visactor/vrender-animate';
export * from '../util/space';
export { transformToGraphic } from '../util/style';
export { getSpecInfo } from '../component/util';
export { registerDataSetInstanceParser, registerDataSetInstanceTransform } from '../data/register';
export { lookup } from '../data/transforms/lookup';
export { warn } from '../util/debug';
export { measureText } from '../util/text';
14 changes: 2 additions & 12 deletions packages/vchart/src/core/vchart.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { ISeries } from '../series/interface/series';
import { arrayParser } from '../data/parser/array';
import type { ILayoutConstructor, LayoutCallBack } from '../layout/interface';
import type { IDataValues, IMarkStateSpec, IInitOption, ISeriesSpec } from '../typings/spec/common';
import type { IDataValues, IMarkStateSpec, IInitOption } from '../typings/spec/common';
// eslint-disable-next-line no-duplicate-imports
import { RenderModeEnum } from '../typings/spec/common';
import type { ISeriesConstructor, ISeriesTheme } from '../series/interface';
import type { ISeriesConstructor } from '../series/interface';
import {
ChartTypeEnum,
type DimensionIndexOption,
@@ -112,7 +112,6 @@ import type { IChartPluginService } from '../plugin/chart/interface';
import { ChartPluginService } from '../plugin/chart/plugin-service';
import type { IIndicator } from '../component/indicator';
import type { IGeoCoordinate } from '../component/geo';
import { getSVGSource } from '../series/pictogram/svg-source';
import { registerGesturePlugin } from '../plugin/other';
import { registerElementHighlight } from '../interaction/triggers/element-highlight';
import { registerElementSelect } from '../interaction/triggers/element-select';
@@ -275,15 +274,6 @@ export class VChart implements IVChart {
impl && impl(key);
}

/**
* 根据地图名称获取地图数据
* @param key 地图名称
* @returns 地图数据
*/
static getSVG(key: string): any {
return getSVGSource(key);
}

/**
* 全局关闭 tooltip
* @param excludeId 可选,指定不需要关闭 tooltip 的实例 id
5 changes: 3 additions & 2 deletions packages/vchart/src/interaction/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
export { registerElementHighlight } from './triggers/element-highlight';
export { registerElementSelect } from './triggers/element-select';
export { registerElementHighlight, ElementHighlight } from './triggers/element-highlight';
export { registerElementSelect, ElementSelect } from './triggers/element-select';
export { registerDimensionHover } from './triggers/dimension-hover';
export { registerElementActive } from './triggers/element-active';
export { registerElementActiveByLegend } from './triggers/element-active-by-legend';
export { registerElementHighlightByGroup } from './triggers/element-highlight-by-group';
export { registerElementHighlightByKey } from './triggers/element-highlight-by-key';
export { registerElementHighlightByLegend } from './triggers/element-highlight-by-legend';
export { registerElementHighlightByName } from './triggers/element-highlight-by-name';
export type { IHoverSpec, ISelectSpec } from './interface/spec';
4 changes: 1 addition & 3 deletions packages/vchart/src/interaction/triggers/enum.ts
Original file line number Diff line number Diff line change
@@ -2,7 +2,5 @@ export const enum TRIGGER_TYPE_ENUM {
DIMENSION_HOVER = 'dimension-hover',
ELEMENT_HIGHLIGHT = 'element-highlight',
ELEMENT_SELECT = 'element-select',
ELEMENT_ACTIVE = 'element-active',
ELEMENT_HIGHLIGHT_BY_GRPHIC_NAME = 'element-highlight-by-graphic-name',
ELEMENT_SELECT_BY_GRPHIC_NAME = 'element-select-by-graphic-name'
ELEMENT_ACTIVE = 'element-active'
}
4 changes: 2 additions & 2 deletions packages/vchart/src/mark/index.ts
Original file line number Diff line number Diff line change
@@ -44,8 +44,8 @@ export type {
ConvertToMarkStyleSpec
} from '../typings/visual';

export type { IMarkRaw, IMarkStyle } from './interface/common';
export type { ITextMark, ILabelMark, IRectMark, IRuleMark } from './interface/mark';
export type { IMarkRaw, IMark, IMarkStyle } from './interface/common';
export type { ITextMark, ILabelMark, IRectMark, IRuleMark, IImageMark, IGroupMark } from './interface/mark';

export {
MarkTypeEnum,
4 changes: 2 additions & 2 deletions packages/vchart/src/series/base/base-series.ts
Original file line number Diff line number Diff line change
@@ -827,7 +827,7 @@ export abstract class BaseSeries<T extends ISeriesSpec> extends BaseModel<T> imp

protected _defaultHoverConfig(finalHoverSpec: IHoverSpec) {
return {
type: TRIGGER_TYPE_ENUM.ELEMENT_HIGHLIGHT,
type: TRIGGER_TYPE_ENUM.ELEMENT_HIGHLIGHT as string,
trigger: finalHoverSpec.trigger as GraphicEventType,
triggerOff: finalHoverSpec.triggerOff as GraphicEventType,
blurState: STATE_VALUE_ENUM.STATE_HOVER_REVERSE,
@@ -843,7 +843,7 @@ export abstract class BaseSeries<T extends ISeriesSpec> extends BaseModel<T> imp
? ['empty']
: ['empty', finalSelectSpec.trigger];
return {
type: TRIGGER_TYPE_ENUM.ELEMENT_SELECT,
type: TRIGGER_TYPE_ENUM.ELEMENT_SELECT as string,
trigger: finalSelectSpec.trigger as GraphicEventType,
triggerOff: triggerOff as GraphicEventType,
reverseState: STATE_VALUE_ENUM.STATE_SELECTED_REVERSE,
2 changes: 1 addition & 1 deletion packages/vchart/src/series/geo/geo.ts
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import type { IMark } from '../../mark/interface';
import type { ICompilableData } from '../../compile/data';

export abstract class GeoSeries<T extends IGeoSeriesSpec = IGeoSeriesSpec> extends BaseSeries<T> implements IGeoSeries {
type = SeriesTypeEnum.geo;
type: string = SeriesTypeEnum.geo;
readonly coordinate = 'geo';

protected _mapViewData: ICompilableData;
10 changes: 0 additions & 10 deletions packages/vchart/src/series/image-cloud/constant.ts

This file was deleted.

22 changes: 9 additions & 13 deletions packages/vchart/src/series/index.ts
Original file line number Diff line number Diff line change
@@ -69,10 +69,6 @@ import type { IVennSeriesSpec } from './venn/interface';
import { VennSeries, registerVennSeries } from './venn/venn';
import type { IMosaicSeriesSpec } from './mosaic/interface';
import { MosaicSeries, registerMosaicSeries } from './mosaic/mosaic';
import type { IPictogramSeriesSpec } from './pictogram/interface';
import { PictogramSeries, registerPictogramSeries } from './pictogram/pictogram';
import { ImageCloudSeries, registerImageCloudSeries } from './image-cloud/image-cloud';
import type { IImageCloudSeriesSpec } from './image-cloud/interface';

import type { ISeries, ICartesianSeries, IPolarSeries, IGeoSeries } from './interface';
import { barGrowIn, barGrowOut, barPresetAnimation } from './bar/animation';
@@ -82,6 +78,9 @@ import { pieDisappear, pieEnter, pieExit, piePresetAnimation } from './pie/anima
import { PieSeriesSpecTransformer } from './pie/pie-transformer';
import { baseSeriesMark } from './base/constant';
import { FunnelSeriesSpecTransformer } from './funnel/funnel-transformer';
import { BaseSeriesTooltipHelper } from './base/tooltip-helper';
import { BaseSeriesSpecTransformer } from './base/base-series-transformer';
import { GeoSeries } from './geo/geo';

export {
PositionEnum,
@@ -96,6 +95,9 @@ export {
};

export {
GeoSeries,
BaseSeriesSpecTransformer,
BaseSeriesTooltipHelper,
WaterfallSeries,
BarSeries,
BarSeriesSpecTransformer,
@@ -135,9 +137,7 @@ export {
CorrelationSeries,
LiquidSeries,
VennSeries,
PictogramSeries,
MosaicSeries,
ImageCloudSeries
MosaicSeries
};

export {
@@ -168,9 +168,7 @@ export {
registerWordCloudSeries,
registerLiquidSeries,
registerVennSeries,
registerMosaicSeries,
registerPictogramSeries,
registerImageCloudSeries
registerMosaicSeries
};

export type {
@@ -219,9 +217,7 @@ export type {
ICorrelationSeriesSpec,
ILiquidSeriesSpec,
IVennSeriesSpec,
IMosaicSeriesSpec,
IPictogramSeriesSpec,
IImageCloudSeriesSpec
IMosaicSeriesSpec
};

export * from './interface';
8 changes: 2 additions & 6 deletions packages/vchart/src/series/interface/type.ts
Original file line number Diff line number Diff line change
@@ -31,8 +31,7 @@ export enum SeriesTypeEnum {
liquid = 'liquid',
venn = 'venn',
mosaic = 'mosaic',
pictogram = 'pictogram',
imageCloud = 'imageCloud'
pictogram = 'pictogram'
}

export const enum SeriesMarkNameEnum {
@@ -94,8 +93,5 @@ export const enum SeriesMarkNameEnum {
liquidOutline = 'liquidOutline',
circle = 'circle',
overlap = 'overlap',
overlapLabel = 'overlapLabel',
pictogram = 'pictogram',
image = 'image',
imageMask = 'imageMask'
overlapLabel = 'overlapLabel'
}
9 changes: 0 additions & 9 deletions packages/vchart/src/series/pictogram/constant.ts

This file was deleted.