UNPKG

@antv/f2

Version:

Charts for mobile visualization.

35 lines 911 B
import { __assign } from "tslib"; import { jsx } from '@antv/f-engine'; import { deepMix } from '@antv/util'; export default (function (props, context) { var _a = props.theme, theme = _a === void 0 ? {} : _a; var _b = deepMix(__assign({}, theme.text), props), points = _b.points, style = _b.style, offsetX = _b.offsetX, offsetY = _b.offsetY, content = _b.content, animation = _b.animation; var _c = points[0] || {}, x = _c.x, y = _c.y; var offsetXNum = context.px2hd(offsetX); var offsetYNum = context.px2hd(offsetY); var posX = x + (offsetXNum || 0); var posY = y + (offsetYNum || 0); return jsx("text", { attrs: __assign({ text: "".concat(content), x: posX, y: posY }, style), animation: deepMix({ update: { easing: 'linear', duration: 450, property: ['x', 'y'] } }, animation) }); });