UNPKG

@antv/s2

Version:

effective spreadsheet render core lib

46 lines (45 loc) 1.65 kB
/** * 基于 g 绘制简单 mini 图工具库 * https://github.com/antvis/g */ import type { DataCell } from '..'; import { type BaseChartData, type BulletValue, type MiniChartData, type S2CellType } from '../common/interface'; import type { RangeColors } from '../common/interface/theme'; interface FractionDigitsOptions { min: number; max: number; } /** * 坐标转换 */ export declare const scale: (chartData: BaseChartData, cell: S2CellType) => { points: [number, number][]; box: number[][]; }; /** * 过滤掉 NaN 值,返回有效的图表数据 */ export declare const filterValidChartData: (chartData: BaseChartData) => BaseChartData; /** * 绘制单元格内的 mini 折线图 */ export declare const drawLine: (chartData: BaseChartData, cell: S2CellType) => void; /** * 绘制单元格内的 mini 柱状图 */ export declare const drawBar: (chartData: BaseChartData, cell: S2CellType) => void; /** * 根据当前值和目标值获取子弹图填充色 */ export declare const getBulletRangeColor: (measure: number | string, target: number | string, rangeColors: RangeColors) => string; export declare const transformRatioToPercent: (ratio: number | string, fractionDigits?: FractionDigitsOptions | number) => string | number; /** * 绘制单元格内的 条件格式 柱图 */ export declare const drawInterval: (cell: DataCell) => import("@antv/g-lite").Rect | undefined; /** * 绘制单元格内的 mini 子弹图 */ export declare const drawBullet: (value: BulletValue, cell: S2CellType) => void; export declare const renderMiniChart: (cell: S2CellType, data?: MiniChartData) => void; export {};