From bb5c0c33860a769ed0399b7195f357b384fb05b1 Mon Sep 17 00:00:00 2001 From: xile611 Date: Thu, 9 Jan 2025 16:59:10 +0800 Subject: [PATCH] docs: add comments --- packages/vgrammar-core/src/types/animate.ts | 6 ++++ .../vgrammar-core/src/types/interaction.ts | 33 +++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/packages/vgrammar-core/src/types/animate.ts b/packages/vgrammar-core/src/types/animate.ts index 533323c2..c28084b4 100644 --- a/packages/vgrammar-core/src/types/animate.ts +++ b/packages/vgrammar-core/src/types/animate.ts @@ -82,7 +82,13 @@ export type IAnimationConfig = IAnimationTimeline | IAnimationTypeConfig; * state动画,暂时只支持简单配置 */ export interface IStateAnimationConfig { + /** + * 状态动画的动画时长 + */ duration?: number; + /** + * 状态动画的缓动函数类型 + */ easing?: EasingType; } diff --git a/packages/vgrammar-core/src/types/interaction.ts b/packages/vgrammar-core/src/types/interaction.ts index 8e20d45e..2311343a 100644 --- a/packages/vgrammar-core/src/types/interaction.ts +++ b/packages/vgrammar-core/src/types/interaction.ts @@ -474,41 +474,74 @@ export interface FishEyeOptions extends IBaseInteractionOptions { } export interface ElementActiveSpec extends ElementActiveOptions { + /** + * 设置交互的类型为 'element-active' + */ type: 'element-active'; } export interface ElementSelectSpec extends ElementSelectOptions { + /** + * 设置交互的类型为 'element-select' + */ type: 'element-select'; } export interface ElementHighlightSpec extends ElementHighlightOptions { + /** + * 设置交互的类型为 'element-highlight' + */ type: 'element-highlight'; } export interface ElementHighlightByKeySpec extends ElementHighlightOptions { + /** + * 设置交互的类型为 'element-highlight-by-key' + */ type: 'element-highlight-by-key'; } export interface ElementHighlightByGroupSpec extends ElementHighlightOptions { + /** + * 设置交互的类型为 'element-highlight-by-group' + */ type: 'element-highlight-by-group'; } export interface ElementActiveByLegendSpec extends ElementActiveByLegendOptions { + /** + * 设置交互的类型为 'element-active-by-legend' + */ type: 'element-active-by-legend'; } export interface ElementHighlightByLegendSpec extends ElementHighlightByLegendOptions { + /** + * 设置交互的类型为'element-highlight-by-legend' + */ type: 'element-highlight-by-legend'; } export interface ElementHighlightByNameSpec extends ElementHighlightByNameOptions { + /** + * 设置交互的类型为'element-highlight-by-name' + */ type: 'element-highlight-by-name'; } export interface BrushHighlightSpec extends BrushHighlightOptions { + /** + * 设置交互类型为'brush-highlight' + */ type: 'brush-highlight'; } export interface BrushActiveSpec extends BrushActiveOptions { + /** + * 设置交互类型为 'brush-active' + */ type: 'brush-active'; } export interface BrushFilterSpec extends BrushFilterOptions { + /** + * 设置交互类型为'brush-filter' + */ type: 'brush-filter'; }