mirror of
https://gitee.com/antv/g6.git
synced 2024-11-30 18:58:34 +08:00
style: fix tsd
This commit is contained in:
parent
10f6cea317
commit
0605f25e28
@ -227,7 +227,7 @@ export default class ItemController {
|
||||
each(cfg, (val, key) => {
|
||||
if (model[key]) {
|
||||
if (isObject(val) && !isArray(val)) {
|
||||
cfg[key] = { ...model[key], ...cfg[key] };
|
||||
cfg[key] = { ...(model[key] as Object), ...(cfg[key] as Object) };
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -6,25 +6,18 @@ import { isNaN } from '../../util/base';
|
||||
import { IGraph } from '../../interface/graph';
|
||||
import { path2Absolute } from '@antv/path-util';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-implied-eval
|
||||
const mockRaf = (cb: TimerHandler) => setTimeout(cb, 16);
|
||||
const mockCaf = (reqId: number) => clearTimeout(reqId);
|
||||
|
||||
const helper = {
|
||||
// pollyfill
|
||||
requestAnimationFrame(callback: FrameRequestCallback) {
|
||||
const fn =
|
||||
window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
function setTimeout(cb: TimerHandler) {
|
||||
// eslint-disable-next-line
|
||||
return setTimeout(cb, 16);
|
||||
};
|
||||
const fn = window.requestAnimationFrame || window.webkitRequestAnimationFrame || mockRaf;
|
||||
return fn(callback);
|
||||
},
|
||||
cancelAnimationFrame(requestId: number) {
|
||||
const fn =
|
||||
window.cancelAnimationFrame ||
|
||||
window.webkitCancelAnimationFrame ||
|
||||
function clearTimeout(reqId: number) {
|
||||
return clearTimeout(reqId);
|
||||
};
|
||||
const fn = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || mockCaf;
|
||||
return fn(requestId);
|
||||
},
|
||||
};
|
||||
|
@ -28,6 +28,16 @@ interface TrendConfig {
|
||||
readonly areaStyle?: ShapeStyle;
|
||||
}
|
||||
|
||||
interface ExtendedTrendConfig {
|
||||
readonly data: number[];
|
||||
// 样式
|
||||
readonly smooth?: boolean;
|
||||
readonly isArea?: boolean;
|
||||
readonly backgroundStyle?: ShapeStyle;
|
||||
readonly lineStyle?: ShapeStyle;
|
||||
readonly areaStyle?: ShapeStyle;
|
||||
}
|
||||
|
||||
type TimeBarOption = Partial<{
|
||||
// position size
|
||||
readonly x: number;
|
||||
@ -55,6 +65,8 @@ type TimeBarOption = Partial<{
|
||||
readonly maxText: string;
|
||||
|
||||
readonly trend: TrendConfig;
|
||||
|
||||
readonly trendCfg: ExtendedTrendConfig;
|
||||
}>;
|
||||
|
||||
interface TimeBarConfig extends IPluginBaseConfig {
|
||||
|
Loading…
Reference in New Issue
Block a user