UNPKG

@antv/f6

Version:

A Mobile Graph Visualization Framework in JavaScript

50 lines (49 loc) 1.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _default = { getDefaultCfg: function getDefaultCfg() { return { item: 'node', offset: 12, formatText: function formatText(model) { return model.label; } }; }, getEvents: function getEvents() { return { 'node:press': 'onPress', actionend: 'onPressEnd' }; }, onPress: function onPress(e) { var item = e.item; this.currentTarget = item; this.showTooltip(e); this.graph.emit('tooltipchange', { item: e.item, action: 'show' }); }, onPressEnd: function onPressEnd(e) { if (!this.shouldEnd(e)) { return; } this.hideTooltip(); this.graph.emit('tooltipchange', { item: this.currentTarget, action: 'hide' }); this.currentTarget = null; }, showTooltip: function showTooltip(e) { // 绘制tip }, hideTooltip: function hideTooltip() { // 隐藏tip } }; exports.default = _default;