@visactor/vchart
Version:
charts lib based @visactor/VGrammar
45 lines (30 loc) • 1.95 kB
JavaScript
import { SeriesTypeEnum } from "../../series/interface/type";
import { BarChart } from "../bar";
import { registerWaterfallSeries } from "../../series/waterfall/waterfall";
import { Factory } from "../../core/factory";
import { WaterfallChartSpecTransformer } from "./waterfall-transformer";
import { registerDimensionHover } from "../../interaction/triggers/dimension-hover";
import { registerDimensionEvents } from "../../event/events";
import { getCartesianDimensionInfo, getDimensionInfoByValue } from "../../event/events/dimension/util/cartesian";
import { getCartesianCrosshairRect } from "../../component/crosshair/utils/cartesian";
import { registerDimensionTooltipProcessor } from "../../component/tooltip/processor/dimension-tooltip";
import { registerMarkTooltipProcessor } from "../../component/tooltip/processor/mark-tooltip";
import { registerGroupTooltipProcessor } from "../../component/tooltip/processor/group-tooltip";
export class WaterfallChart extends BarChart {
constructor() {
super(...arguments), this.transformerConstructor = WaterfallChartSpecTransformer,
this.type = "waterfall", this.seriesType = SeriesTypeEnum.waterfall;
}
_setModelOption() {
this._modelOption.getDimensionInfo = getCartesianDimensionInfo, this._modelOption.getDimensionInfoByValue = getDimensionInfoByValue,
this._modelOption.getRectByDimensionData = getCartesianCrosshairRect;
}
}
WaterfallChart.type = "waterfall", WaterfallChart.seriesType = SeriesTypeEnum.waterfall,
WaterfallChart.transformerConstructor = WaterfallChartSpecTransformer;
export const registerWaterfallChart = () => {
registerDimensionTooltipProcessor(), registerMarkTooltipProcessor(), registerGroupTooltipProcessor(),
registerDimensionEvents(), registerDimensionHover(), registerWaterfallSeries(),
Factory.registerChart(WaterfallChart.type, WaterfallChart);
};
//# sourceMappingURL=waterfall.js.map