Skip to content

Commit

Permalink
feat(tooltip): auto tooltip, update g version
Browse files Browse the repository at this point in the history
  • Loading branch information
dxq613 authored and simaQ committed Mar 20, 2020
1 parent b4a030a commit 8c3fda4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
"@antv/component": "^0.5.0",
"@antv/coord": "^0.2.1",
"@antv/event-emitter": "~0.1.0",
"@antv/g-base": "^0.3.1",
"@antv/g-canvas": "^0.3.1",
"@antv/g-svg": "^0.3.1",
"@antv/g-base": "^0.4.0",
"@antv/g-canvas": "^0.4.0",
"@antv/g-svg": "^0.4.0",
"@antv/matrix-util": "^2.0.4",
"@antv/path-util": "^2.0.3",
"@antv/scale": "^0.3.1",
Expand Down
4 changes: 2 additions & 2 deletions src/geometry/label/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface LabelPointCfg {
start?: Point;
color?: string;
content?: any;
textAlign?: string;
textAlign?: 'start' | 'center' | 'end' | 'left' | 'right';
rotate?: number;
angle?: number;
r?: number;
Expand All @@ -32,7 +32,7 @@ export interface LabelItem extends GeometryLabelCfg {
start?: Point;
color?: string;
content?: any;
textAlign?: string;
textAlign?: 'start' | 'center' | 'end' | 'left' | 'right';
rotate?: number;
angle?: number;
r?: number;
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ function isPointInView(context: IInteractionContext) {

// 注册 tooltip 的 interaction
registerInteraction('tooltip', {
start: [{ trigger: 'plot:mousemove', action: 'tooltip:show' }],
start: [{ trigger: 'plot:mousemove', action: 'tooltip:show', throttle: { wait: 50, leading: true, trailing: false } }],
end: [{ trigger: 'plot:mouseleave', action: 'tooltip:hide' }],
});

Expand Down
1 change: 1 addition & 0 deletions src/theme/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,7 @@ export function getThemeByStylesheet(styleSheet: StyleSheet) {
showMarkers: true,
shared: false,
enterable: false,
position: 'auto',
marker: {
symbol: 'circle',
stroke: '#fff',
Expand Down

0 comments on commit 8c3fda4

Please sign in to comment.