PackedBubblePoint.js 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* *
  2. *
  3. * (c) 2010-2021 Grzegorz Blachlinski, Sebastian Bochan
  4. *
  5. * License: www.highcharts.com/license
  6. *
  7. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  8. *
  9. * */
  10. 'use strict';
  11. var __extends = (this && this.__extends) || (function () {
  12. var extendStatics = function (d, b) {
  13. extendStatics = Object.setPrototypeOf ||
  14. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  15. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16. return extendStatics(d, b);
  17. };
  18. return function (d, b) {
  19. extendStatics(d, b);
  20. function __() { this.constructor = d; }
  21. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  22. };
  23. })();
  24. import Chart from '../../Core/Chart/Chart.js';
  25. import Point from '../../Core/Series/Point.js';
  26. import SeriesRegistry from '../../Core/Series/SeriesRegistry.js';
  27. var BubbleSeries = SeriesRegistry.seriesTypes.bubble;
  28. /* *
  29. *
  30. * Class
  31. *
  32. * */
  33. var PackedBubblePoint = /** @class */ (function (_super) {
  34. __extends(PackedBubblePoint, _super);
  35. function PackedBubblePoint() {
  36. /* *
  37. *
  38. * Properties
  39. *
  40. * */
  41. var _this = _super !== null && _super.apply(this, arguments) || this;
  42. _this.degree = NaN;
  43. _this.mass = NaN;
  44. _this.radius = NaN;
  45. _this.options = void 0;
  46. _this.series = void 0;
  47. _this.value = null;
  48. return _this;
  49. /* eslint-enable valid-jsdoc */
  50. }
  51. /* *
  52. *
  53. * Functions
  54. *
  55. * */
  56. /* eslint-disable valid-jsdoc */
  57. /**
  58. * Destroy point.
  59. * Then remove point from the layout.
  60. * @private
  61. */
  62. PackedBubblePoint.prototype.destroy = function () {
  63. if (this.series.layout) {
  64. this.series.layout.removeElementFromCollection(this, this.series.layout.nodes);
  65. }
  66. return Point.prototype.destroy.apply(this, arguments);
  67. };
  68. PackedBubblePoint.prototype.firePointEvent = function () {
  69. var point = this, series = this.series, seriesOptions = series.options;
  70. if (this.isParentNode && seriesOptions.parentNode) {
  71. var temp = seriesOptions.allowPointSelect;
  72. seriesOptions.allowPointSelect = seriesOptions.parentNode.allowPointSelect;
  73. Point.prototype.firePointEvent.apply(this, arguments);
  74. seriesOptions.allowPointSelect = temp;
  75. }
  76. else {
  77. Point.prototype.firePointEvent.apply(this, arguments);
  78. }
  79. };
  80. PackedBubblePoint.prototype.select = function () {
  81. var point = this, series = this.series, chart = series.chart;
  82. if (point.isParentNode) {
  83. chart.getSelectedPoints = chart.getSelectedParentNodes;
  84. Point.prototype.select.apply(this, arguments);
  85. chart.getSelectedPoints = Chart.prototype.getSelectedPoints;
  86. }
  87. else {
  88. Point.prototype.select.apply(this, arguments);
  89. }
  90. };
  91. return PackedBubblePoint;
  92. }(BubbleSeries.prototype.pointClass));
  93. /* *
  94. *
  95. * Default Export
  96. *
  97. * */
  98. export default PackedBubblePoint;