UNPKG

2.57 kBJavaScriptView Raw
1/**
2 * A module which defines functionality related to Value Axis Break.
3 */
4import { __extends } from "tslib";
5/**
6 * ============================================================================
7 * IMPORTS
8 * ============================================================================
9 * @hidden
10 */
11import { AxisBreak } from "./AxisBreak";
12import { registry } from "../../core/Registry";
13/**
14 * ============================================================================
15 * MAIN CLASS
16 * ============================================================================
17 * @hidden
18 */
19/**
20 * Base class to define "breaks" on value axis.
21 *
22 * A "break" can be used to "cut out" specific ranges of the axis scale, e.g.
23 * when comparing columns with relatively similar values, it would make sense
24 * to cut out their mid section, so that their tip differences are more
25 * prominent.
26 *
27 * @see {@link IValueAxisBreakEvents} for a list of available events
28 * @see {@link IValueAxisBreakAdapters} for a list of available Adapters
29 * @important
30 */
31var ValueAxisBreak = /** @class */ (function (_super) {
32 __extends(ValueAxisBreak, _super);
33 /**
34 * Constructor
35 */
36 function ValueAxisBreak() {
37 var _this = _super.call(this) || this;
38 _this.className = "ValueAxisBreak";
39 _this.applyTheme();
40 return _this;
41 }
42 Object.defineProperty(ValueAxisBreak.prototype, "startPosition", {
43 /**
44 * Pixel position of the break's start.
45 *
46 * @return Position (px)
47 * @readonly
48 */
49 get: function () {
50 if (this.axis) {
51 return this.axis.valueToPosition(this.adjustedStartValue);
52 }
53 },
54 enumerable: true,
55 configurable: true
56 });
57 Object.defineProperty(ValueAxisBreak.prototype, "endPosition", {
58 /**
59 * Pixel position of the break's end.
60 *
61 * @return Position (px)
62 * @readonly
63 */
64 get: function () {
65 if (this.axis) {
66 return this.axis.valueToPosition(this.adjustedEndValue);
67 }
68 },
69 enumerable: true,
70 configurable: true
71 });
72 return ValueAxisBreak;
73}(AxisBreak));
74export { ValueAxisBreak };
75/**
76 * Register class in system, so that it can be instantiated using its name from
77 * anywhere.
78 *
79 * @ignore
80 */
81registry.registeredClasses["ValueAxisBreak"] = ValueAxisBreak;
82//# sourceMappingURL=ValueAxisBreak.js.map
\No newline at end of file