devextreme
Version:
JavaScript/TypeScript Component Suite for Responsive Web Development
90 lines (88 loc) • 2.98 kB
JavaScript
/**
* DevExtreme (cjs/__internal/viz/series/points/bubble_point.js)
* Version: 25.2.5
* Build date: Fri Feb 20 2026
*
* Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _extend2 = require("../../../../core/utils/extend");
var _symbol_point = _interopRequireDefault(require("../../../viz/series/points/symbol_point"));
function _interopRequireDefault(e) {
return e && e.__esModule ? e : {
default: e
}
}
const _extend = _extend2.extend;
const MIN_BUBBLE_HEIGHT = 20;
var _default = exports.default = _extend({}, _symbol_point.default, {
correctCoordinates(diameter) {
this.bubbleSize = diameter / 2
},
_drawMarker(renderer, group, animationEnabled) {
const attr = _extend({
translateX: this.x,
translateY: this.y
}, this._getStyle());
this.graphic = renderer.circle(0, 0, animationEnabled ? 0 : this.bubbleSize).smartAttr(attr).data({
"chart-data-point": this
}).append(group)
},
getTooltipParams(location) {
const graphic = this.graphic;
if (!graphic) {
return
}
const height = graphic.getBBox().height;
return {
x: this.x,
y: this.y,
offset: height < 20 || "edge" === location ? height / 2 : 0
}
},
_getLabelFormatObject() {
const formatObject = _symbol_point.default._getLabelFormatObject.call(this);
formatObject.size = this.initialSize;
return formatObject
},
_updateData(data) {
_symbol_point.default._updateData.call(this, data);
this.size = this.initialSize = data.size
},
_getGraphicBBox() {
return this._getSymbolBBox(this.x, this.y, this.bubbleSize)
},
_updateMarker(animationEnabled, style) {
const that = this;
if (!animationEnabled) {
style = _extend({
r: that.bubbleSize,
translateX: that.x,
translateY: that.y
}, style)
}
that.graphic.smartAttr(style)
},
_getFormatObject(tooltip) {
const formatObject = _symbol_point.default._getFormatObject.call(this, tooltip);
formatObject.sizeText = tooltip.formatValue(this.initialSize);
return formatObject
},
_storeTrackerR() {
return this.bubbleSize
},
_getLabelCoords(label) {
let coords;
if ("inside" === label.getLayoutOptions().position) {
coords = this._getLabelCoordOfPosition(label, "inside")
} else {
coords = _symbol_point.default._getLabelCoords.call(this, label)
}
return coords
}
});