ag-charts-community
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
1,287 lines (1,260 loc) • 1.45 MB
JavaScript
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from2, except, desc) => {
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
for (let key of __getOwnPropNames(from2))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var __decorateClass = (decorators, target, key, kind) => {
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
for (var i = decorators.length - 1, decorator; i >= 0; i--)
if (decorator = decorators[i])
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
if (kind && result)
__defProp(target, key, result);
return result;
};
// packages/ag-charts-community/src/main-modules.ts
var main_modules_exports = {};
__export(main_modules_exports, {
AllCartesianCommunityModules: () => AllCartesianCommunityModules,
AllCommunityModules: () => AllCommunityModules,
AllPolarCommunityModules: () => AllPolarCommunityModules,
CartesianChartModule: () => CartesianChartModule,
CategoryAxisModule: () => CategoryAxisModule,
GroupedCategoryAxisModule: () => GroupedCategoryAxisModule,
LogAxisModule: () => LogAxisModule,
ModuleRegistry: () => import_ag_charts_core146.ModuleRegistry,
NewAreaSeriesModule: () => NewAreaSeriesModule,
NewBarSeriesModule: () => NewBarSeriesModule,
NewBubbleSeriesModule: () => NewBubbleSeriesModule,
NewDonutSeriesModule: () => NewDonutSeriesModule,
NewHistogramSeriesModule: () => NewHistogramSeriesModule,
NewLineSeriesModule: () => NewLineSeriesModule,
NewPieSeriesModule: () => NewPieSeriesModule,
NewScatterSeriesModule: () => NewScatterSeriesModule,
NumberAxisModule: () => NumberAxisModule,
PolarChartModule: () => PolarChartModule,
TimeAxisModule: () => TimeAxisModule,
UnitTimeAxisModule: () => UnitTimeAxisModule
});
module.exports = __toCommonJS(main_modules_exports);
// packages/ag-charts-community/src/api/preset/presetModules.ts
var import_ag_charts_core11 = require("ag-charts-core");
// packages/ag-charts-community/src/chart/commonOptionsDefs.ts
var import_ag_charts_core3 = require("ag-charts-core");
// packages/ag-charts-community/src/chart/axesOptionsDefs.ts
var import_ag_charts_core2 = require("ag-charts-core");
// packages/ag-charts-community/src/util/time/index.ts
var time_exports = {};
__export(time_exports, {
TimeInterval: () => TimeInterval,
day: () => day,
friday: () => friday,
hour: () => hour,
millisecond: () => millisecond,
minute: () => minute,
monday: () => monday,
month: () => month,
saturday: () => saturday,
second: () => second,
sunday: () => sunday,
thursday: () => thursday,
tuesday: () => tuesday,
utcDay: () => utcDay,
utcHour: () => utcHour,
utcMinute: () => utcMinute,
utcMonth: () => utcMonth,
utcYear: () => utcYear,
wednesday: () => wednesday,
year: () => year
});
// packages/ag-charts-community/src/util/time/duration.ts
var durationSecond = 1e3;
var durationMinute = durationSecond * 60;
var durationHour = durationMinute * 60;
var durationDay = durationHour * 24;
var durationWeek = durationDay * 7;
var durationMonth = durationDay * 30;
var durationYear = durationDay * 365;
// packages/ag-charts-community/src/util/time/interval.ts
var import_ag_charts_core = require("ag-charts-core");
var TimeInterval = class _TimeInterval {
constructor(unit, milliseconds, hierarchy, _encode, _decode, step = 1, _rangeCallback) {
this.unit = unit;
this.milliseconds = milliseconds;
this.hierarchy = hierarchy;
this._encode = _encode;
this._decode = _decode;
this.step = step;
this._rangeCallback = _rangeCallback;
}
static extent(start2, stop, visibleRange) {
if (start2.getTime() > stop.getTime()) {
[start2, stop] = [stop, start2];
if (visibleRange != null) {
visibleRange = [1 - visibleRange[1], 1 - visibleRange[0]];
}
}
if (visibleRange != null) {
const delta3 = stop.getTime() - start2.getTime();
const t0 = start2.getTime();
start2 = new Date(t0 + visibleRange[0] * delta3);
stop = new Date(t0 + visibleRange[1] * delta3);
}
return [start2, stop];
}
getOffset(snapTo, step) {
return Math.floor(this._encode(new Date(snapTo))) % step;
}
/**
* Returns a new date representing the latest interval boundary date before or equal to date.
* For example, `day.floor(date)` typically returns 12:00 AM local time on the given date.
* @param date
*/
floor(date5) {
const d = new Date(date5);
const e = this._encode(d);
return this._decode(e);
}
/**
* Returns a new date representing the earliest interval boundary date after or equal to date.
* @param date
*/
ceil(date5) {
const d = new Date(Number(date5) - 1);
const e = this._encode(d);
return this._decode(e + 1);
}
rangeIndices(start2, stop, { extend = false, visibleRange = [0, 1], limit }) {
[start2, stop] = _TimeInterval.extent(start2, stop, visibleRange);
const e0 = this._encode(extend ? this.floor(start2) : this.ceil(start2));
let e1 = this._encode(extend ? this.ceil(stop) : this.floor(stop));
if (limit != null && e1 - e0 > limit) {
e1 = e0 + limit;
}
return [e0, e1];
}
/**
* Returns an array of dates representing every interval boundary after or equal to start (inclusive) and before stop (exclusive).
* @param start Range start.
* @param stop Range end.
* @param extend If specified, the requested range will be extended to the closest "nice" values.
*/
range(start2, stop, params = {}) {
let rangeCallback;
if (start2.getTime() > stop.getTime()) {
rangeCallback = this._rangeCallback?.(stop, start2);
} else {
rangeCallback = this._rangeCallback?.(start2, stop);
}
const [e0, e1] = this.rangeIndices(start2, stop, params);
const range3 = [];
for (let e = e0; e <= e1; e++) {
const d = this._decode(e);
range3.push(d);
}
rangeCallback?.();
return range3;
}
previous(date5) {
return this._decode(this._encode(this.ceil(date5)) - 1);
}
next(date5) {
return this._decode(this._encode(this.floor(date5)) + 1);
}
rangeCount(start2, stop, params = {}) {
const [e0, e1] = this.rangeIndices(start2, stop, params);
return e1 - e0;
}
/**
* Returns a filtered view of this interval representing every step'th date.
* It can be a number of minutes, hours, days etc.
* Must be a positive integer.
* @param step
*/
every(step, options) {
if (step === 1 && options?.snapTo != null)
return this;
const { unit, milliseconds, hierarchy, step: baseStep } = this;
let offset4 = 0;
let rangeCallback;
const unsafeStep = step;
step = Math.max(1, Math.round(step));
if (unsafeStep !== step) {
import_ag_charts_core.Logger.warnOnce(`interval step of [${unsafeStep}] rounded to [${step}].`);
}
const { snapTo = "start" } = options ?? {};
if (typeof snapTo === "string") {
const initialOffset = offset4;
rangeCallback = (start2, stop) => {
const s = snapTo === "start" ? start2 : stop;
offset4 = this.getOffset(s, step);
return () => offset4 = initialOffset;
};
} else if (typeof snapTo === "number") {
offset4 = this.getOffset(new Date(snapTo), step);
} else if (snapTo instanceof Date) {
offset4 = this.getOffset(snapTo, step);
}
const encode13 = (date5) => Math.floor((this._encode(date5) - offset4) / step);
const decode13 = (encoded) => this._decode(encoded * step + offset4);
return new _TimeInterval(unit, milliseconds * step, hierarchy, encode13, decode13, baseStep * step, rangeCallback);
}
};
// packages/ag-charts-community/src/util/time/year.ts
function encode(date5) {
return date5.getFullYear();
}
function decode(encoded) {
const d = /* @__PURE__ */ new Date();
d.setFullYear(encoded);
d.setMonth(0, 1);
d.setHours(0, 0, 0, 0);
return d;
}
var yearMs = (365 + 1 / 4 - 1 / 100 + 1 / 400) * 24 * 60 * 60 * 1e3;
var year = new TimeInterval("year", yearMs, void 0, encode, decode);
// packages/ag-charts-community/src/util/time/month.ts
function encode2(date5) {
return date5.getFullYear() * 12 + date5.getMonth();
}
function decode2(encoded) {
const y = Math.floor(encoded / 12);
const month2 = encoded - y * 12;
return new Date(y, month2, 1);
}
var month = new TimeInterval("month", year.milliseconds / 12, year, encode2, decode2);
// packages/ag-charts-community/src/util/time/day.ts
function encode3(date5) {
const tzOffsetMs = date5.getTimezoneOffset() * durationMinute;
return Math.floor((date5.getTime() - tzOffsetMs) / durationDay);
}
function decode3(encoded) {
const d = new Date(1970, 0, 1);
d.setDate(d.getDate() + encoded);
return d;
}
var day = new TimeInterval("day", 24 * 60 * 60 * 1e3, month, encode3, decode3);
// packages/ag-charts-community/src/util/time/millisecond.ts
function encode4(date5) {
return date5.getTime();
}
function decode4(encoded) {
return new Date(encoded);
}
var millisecond = new TimeInterval("millisecond", 1, day, encode4, decode4);
// packages/ag-charts-community/src/util/time/second.ts
var offset = (/* @__PURE__ */ new Date()).getTimezoneOffset() * durationMinute;
function encode5(date5) {
return Math.floor((date5.getTime() - offset) / durationSecond);
}
function decode5(encoded) {
return new Date(offset + encoded * durationSecond);
}
var second = new TimeInterval("second", 1e3, day, encode5, decode5);
// packages/ag-charts-community/src/util/time/minute.ts
var offset2 = (/* @__PURE__ */ new Date()).getTimezoneOffset() * durationMinute;
function encode6(date5) {
return Math.floor((date5.getTime() - offset2) / durationMinute);
}
function decode6(encoded) {
return new Date(offset2 + encoded * durationMinute);
}
var minute = new TimeInterval("minute", 60 * 1e3, day, encode6, decode6);
// packages/ag-charts-community/src/util/time/hour.ts
var offset3 = (/* @__PURE__ */ new Date()).getTimezoneOffset() * durationMinute;
function encode7(date5) {
return Math.floor((date5.getTime() - offset3) / durationHour);
}
function decode7(encoded) {
return new Date(offset3 + encoded * durationHour);
}
var hour = new TimeInterval("hour", 60 * 60 * 1e3, day, encode7, decode7);
// packages/ag-charts-community/src/util/time/week.ts
function weekday(weekStart) {
const thursday2 = 4;
const dayShift = (7 + weekStart - thursday2) % 7;
function encode13(date5) {
const tzOffsetMs = date5.getTimezoneOffset() * durationMinute;
return Math.floor((date5.getTime() - tzOffsetMs) / durationWeek - dayShift / 7);
}
function decode13(encoded) {
const d = new Date(1970, 0, 1);
d.setDate(d.getDate() + encoded * 7 + dayShift);
return d;
}
return new TimeInterval("day", 7 * 24 * 60 * 60 * 1e3, month, encode13, decode13, 7);
}
var sunday = weekday(0);
var monday = weekday(1);
var tuesday = weekday(2);
var wednesday = weekday(3);
var thursday = weekday(4);
var friday = weekday(5);
var saturday = weekday(6);
// packages/ag-charts-community/src/util/time/utcYear.ts
function encode8(date5) {
return date5.getUTCFullYear();
}
function decode8(encoded) {
const d = /* @__PURE__ */ new Date();
d.setUTCFullYear(encoded);
d.setUTCMonth(0, 1);
d.setUTCHours(0, 0, 0, 0);
return d;
}
var utcYear = new TimeInterval("year", year.milliseconds, void 0, encode8, decode8);
// packages/ag-charts-community/src/util/time/utcMonth.ts
function encode9(date5) {
return date5.getUTCFullYear() * 12 + date5.getUTCMonth();
}
function decode9(encoded) {
const year2 = Math.floor(encoded / 12);
const m = encoded - year2 * 12;
return new Date(Date.UTC(year2, m, 1));
}
var utcMonth = new TimeInterval("month", month.milliseconds, utcYear, encode9, decode9);
// packages/ag-charts-community/src/util/time/utcDay.ts
function encode10(date5) {
return Math.floor(date5.getTime() / durationDay);
}
function decode10(encoded) {
const d = /* @__PURE__ */ new Date(0);
d.setUTCDate(d.getUTCDate() + encoded);
d.setUTCHours(0, 0, 0, 0);
return d;
}
var utcDay = new TimeInterval("day", 24 * 60 * 60 * 1e3, utcMonth, encode10, decode10);
// packages/ag-charts-community/src/util/time/utcMinute.ts
function encode11(date5) {
return Math.floor(date5.getTime() / durationMinute);
}
function decode11(encoded) {
return new Date(encoded * durationMinute);
}
var utcMinute = new TimeInterval("minute", 60 * 1e3, utcDay, encode11, decode11);
// packages/ag-charts-community/src/util/time/utcHour.ts
function encode12(date5) {
return Math.floor(date5.getTime() / durationHour);
}
function decode12(encoded) {
return new Date(encoded * durationHour);
}
var utcHour = new TimeInterval("hour", 60 * 60 * 1e3, utcDay, encode12, decode12);
// packages/ag-charts-community/src/chart/axesOptionsDefs.ts
var timeIntervalUnit = (0, import_ag_charts_core2.union)("millisecond", "second", "minute", "hour", "day", "month", "year");
var numberFormatValidator = (0, import_ag_charts_core2.attachDescription)(import_ag_charts_core2.isValidNumberFormat, "a valid number format string");
var commonCrossLineLabelOptionsDefs = {
enabled: import_ag_charts_core2.boolean,
text: import_ag_charts_core2.string,
padding: import_ag_charts_core2.number,
...import_ag_charts_core2.fontOptionsDef
};
var commonCrossLineOptionsDefs = (0, import_ag_charts_core2.attachDescription)(
{
enabled: import_ag_charts_core2.boolean,
type: (0, import_ag_charts_core2.required)((0, import_ag_charts_core2.union)("line", "range")),
range: (0, import_ag_charts_core2.and)(
(0, import_ag_charts_core2.attachDescription)((_, { options }) => options.type === "range", "crossLine type to be 'range'"),
(0, import_ag_charts_core2.arrayOf)(import_ag_charts_core2.defined),
(0, import_ag_charts_core2.arrayLength)(2, 2)
),
value: (0, import_ag_charts_core2.and)(
(0, import_ag_charts_core2.attachDescription)((_, { options }) => options.type === "line", "crossLine type to be 'line'"),
import_ag_charts_core2.defined
),
label: commonCrossLineLabelOptionsDefs,
fill: import_ag_charts_core2.string,
fillOpacity: import_ag_charts_core2.ratio,
...import_ag_charts_core2.strokeOptionsDef,
...import_ag_charts_core2.lineDashOptionsDef
},
"cross-line options"
);
var cartesianCrossLineOptionsDefs = {
...commonCrossLineOptionsDefs,
label: {
...commonCrossLineLabelOptionsDefs,
position: (0, import_ag_charts_core2.union)(
"top",
"left",
"right",
"bottom",
"top-left",
"top-right",
"bottom-left",
"bottom-right",
"inside",
"inside-left",
"inside-right",
"inside-top",
"inside-bottom",
"inside-top-left",
"inside-bottom-left",
"inside-top-right",
"inside-bottom-right"
),
rotation: import_ag_charts_core2.number
}
};
var commonAxisLabelOptionsDefs = {
enabled: import_ag_charts_core2.boolean,
rotation: import_ag_charts_core2.number,
avoidCollisions: import_ag_charts_core2.boolean,
minSpacing: import_ag_charts_core2.positiveNumber,
spacing: import_ag_charts_core2.positiveNumber,
formatter: import_ag_charts_core2.callback,
itemStyler: (0, import_ag_charts_core2.callbackDefs)({
...import_ag_charts_core2.fontOptionsDef,
spacing: import_ag_charts_core2.number
}),
...import_ag_charts_core2.fontOptionsDef
};
var cartesianAxisLabelOptionsDefs = {
autoRotate: import_ag_charts_core2.boolean,
autoRotateAngle: import_ag_charts_core2.number,
...commonAxisLabelOptionsDefs
};
var cartesianNumericAxisLabel = {
format: numberFormatValidator,
...cartesianAxisLabelOptionsDefs
};
var cartesianTimeAxisLabel = {
format: (0, import_ag_charts_core2.or)(import_ag_charts_core2.string, import_ag_charts_core2.object),
...cartesianAxisLabelOptionsDefs
};
var cartesianAxisTick = {
enabled: import_ag_charts_core2.boolean,
width: import_ag_charts_core2.positiveNumber,
size: import_ag_charts_core2.positiveNumber,
stroke: import_ag_charts_core2.color
};
var cartesianTimeAxisParentLevel = {
enabled: import_ag_charts_core2.boolean,
label: cartesianTimeAxisLabel,
tick: cartesianAxisTick
};
var commonAxisOptionsDefs = {
reverse: import_ag_charts_core2.boolean,
gridLine: {
enabled: import_ag_charts_core2.boolean,
width: import_ag_charts_core2.positiveNumber,
style: (0, import_ag_charts_core2.arrayOfDefs)(
{
stroke: (0, import_ag_charts_core2.or)(import_ag_charts_core2.color, import_ag_charts_core2.themeOperator),
lineDash: (0, import_ag_charts_core2.arrayOf)(import_ag_charts_core2.positiveNumber)
},
"a grid-line style object array"
)
},
interval: {
values: (0, import_ag_charts_core2.arrayOf)(import_ag_charts_core2.defined),
minSpacing: import_ag_charts_core2.positiveNumber
},
label: commonAxisLabelOptionsDefs,
line: {
enabled: import_ag_charts_core2.boolean,
width: import_ag_charts_core2.positiveNumber,
stroke: import_ag_charts_core2.color
},
tick: cartesianAxisTick
};
commonAxisOptionsDefs.context = (0, import_ag_charts_core2.undocumented)(() => true);
commonAxisOptionsDefs.layoutConstraints = (0, import_ag_charts_core2.undocumented)({
stacked: (0, import_ag_charts_core2.required)(import_ag_charts_core2.boolean),
align: (0, import_ag_charts_core2.required)((0, import_ag_charts_core2.union)("start", "end")),
unit: (0, import_ag_charts_core2.required)((0, import_ag_charts_core2.union)("percent", "px")),
width: (0, import_ag_charts_core2.required)(import_ag_charts_core2.positiveNumber)
});
var cartesianAxisOptionsDefs = {
...commonAxisOptionsDefs,
keys: (0, import_ag_charts_core2.arrayOf)(import_ag_charts_core2.string),
crossLines: (0, import_ag_charts_core2.arrayOfDefs)(cartesianCrossLineOptionsDefs, "a cross-line options array"),
position: (0, import_ag_charts_core2.union)("top", "right", "bottom", "left"),
thickness: import_ag_charts_core2.positiveNumber,
title: {
enabled: import_ag_charts_core2.boolean,
text: import_ag_charts_core2.string,
spacing: import_ag_charts_core2.positiveNumber,
formatter: import_ag_charts_core2.callback,
...import_ag_charts_core2.fontOptionsDef
}
};
cartesianAxisOptionsDefs.title._enabledFromTheme = (0, import_ag_charts_core2.undocumented)(import_ag_charts_core2.boolean);
function cartesianAxisCrosshairOptions(canFormat) {
const crosshairLabel = {
enabled: import_ag_charts_core2.boolean,
xOffset: import_ag_charts_core2.number,
yOffset: import_ag_charts_core2.number,
renderer: (0, import_ag_charts_core2.callbackOf)(
(0, import_ag_charts_core2.or)(
import_ag_charts_core2.string,
(0, import_ag_charts_core2.optionsDefs)(
{
text: import_ag_charts_core2.string,
color: import_ag_charts_core2.color,
backgroundColor: import_ag_charts_core2.color,
opacity: import_ag_charts_core2.ratio
},
"crosshair label renderer result object"
)
)
)
};
if (canFormat) {
crosshairLabel.format = import_ag_charts_core2.string;
}
return {
enabled: import_ag_charts_core2.boolean,
snap: import_ag_charts_core2.boolean,
label: crosshairLabel,
...import_ag_charts_core2.strokeOptionsDef,
...import_ag_charts_core2.lineDashOptionsDef
};
}
function continuousAxisOptions(validDatum, supportTimeInterval) {
return {
min: (0, import_ag_charts_core2.and)(validDatum, (0, import_ag_charts_core2.lessThan)("max")),
max: (0, import_ag_charts_core2.and)(validDatum, (0, import_ag_charts_core2.greaterThan)("min")),
nice: import_ag_charts_core2.boolean,
interval: {
step: supportTimeInterval ? (0, import_ag_charts_core2.or)(import_ag_charts_core2.positiveNumberNonZero, timeIntervalUnit, (0, import_ag_charts_core2.instanceOf)(TimeInterval)) : import_ag_charts_core2.positiveNumberNonZero,
values: (0, import_ag_charts_core2.arrayOf)(validDatum),
minSpacing: (0, import_ag_charts_core2.and)(import_ag_charts_core2.positiveNumber, (0, import_ag_charts_core2.lessThan)("maxSpacing")),
maxSpacing: (0, import_ag_charts_core2.and)(import_ag_charts_core2.positiveNumber, (0, import_ag_charts_core2.greaterThan)("minSpacing"))
}
};
}
// packages/ag-charts-community/src/chart/commonOptionsDefs.ts
var shapeValidator = (0, import_ag_charts_core3.or)(
(0, import_ag_charts_core3.union)("circle", "cross", "diamond", "heart", "plus", "pin", "square", "star", "triangle"),
import_ag_charts_core3.callback
);
var textWrapValidator = (0, import_ag_charts_core3.union)("never", "always", "hyphenate", "on-space");
var tooltipPlacementValidator = (0, import_ag_charts_core3.union)(
"top",
"right",
"bottom",
"left",
"top-right",
"bottom-right",
"bottom-left",
"top-left",
"center"
);
var tooltipDeprecatedTypeValidator = (0, import_ag_charts_core3.union)(
"pointer",
"node",
"top",
"right",
"bottom",
"left",
"top-left",
"top-right",
"bottom-left",
"bottom-right"
);
var rangeValidator = (0, import_ag_charts_core3.or)(import_ag_charts_core3.positiveNumber, (0, import_ag_charts_core3.union)("exact", "nearest"));
var zoomAnchorPoint = (0, import_ag_charts_core3.union)("pointer", "start", "middle", "end");
var chartCaptionOptionsDefs = {
enabled: import_ag_charts_core3.boolean,
text: import_ag_charts_core3.string,
textAlign: (0, import_ag_charts_core3.union)("left", "center", "right"),
wrapping: (0, import_ag_charts_core3.union)("never", "always", "hyphenate", "on-space"),
spacing: import_ag_charts_core3.positiveNumber,
maxWidth: import_ag_charts_core3.positiveNumber,
maxHeight: import_ag_charts_core3.positiveNumber,
...import_ag_charts_core3.fontOptionsDef
};
chartCaptionOptionsDefs.padding = (0, import_ag_charts_core3.undocumented)(import_ag_charts_core3.positiveNumber);
var chartOverlayOptionsDefs = {
enabled: import_ag_charts_core3.boolean,
text: import_ag_charts_core3.string,
renderer: (0, import_ag_charts_core3.callbackOf)((0, import_ag_charts_core3.or)(import_ag_charts_core3.string, import_ag_charts_core3.htmlElement))
};
var contextMenuItemLiterals = [
"defaults",
"download",
"zoom-to-cursor",
"pan-to-cursor",
"toggle-series-visibility",
"toggle-other-series",
"separator"
];
var contextMenuItemObjectDef = {
type: (0, import_ag_charts_core3.union)("action", "separator"),
showOn: (0, import_ag_charts_core3.union)("always", "series-area", "series-node", "legend-item"),
label: (0, import_ag_charts_core3.required)(import_ag_charts_core3.string),
enabled: import_ag_charts_core3.boolean,
action: import_ag_charts_core3.callback,
items: (value, context) => contextMenuItemsArray(value, context)
};
contextMenuItemObjectDef.iconUrl = (0, import_ag_charts_core3.undocumented)(import_ag_charts_core3.string);
var contextMenuItemObjectValidator = (0, import_ag_charts_core3.optionsDefs)(contextMenuItemObjectDef);
var contextMenuItemValidator = (0, import_ag_charts_core3.attachDescription)(
(value, context) => {
let result;
if (typeof value === "string") {
const allowedValues = contextMenuItemLiterals;
if (allowedValues.includes(value)) {
result = true;
} else {
result = { valid: false, invalid: [], cleared: null };
result.invalid.push(
new import_ag_charts_core3.ValidationError(
import_ag_charts_core3.ErrorType.Invalid,
`a context menu item string alias: ["${contextMenuItemLiterals.join('", "')}"]`,
value,
context.path
)
);
}
} else {
result = contextMenuItemObjectValidator(value, context);
}
return result;
},
`a context menu item object or string alias: [${contextMenuItemLiterals.join(", ")}]`
);
var contextMenuItemsArray = (0, import_ag_charts_core3.arrayOf)(contextMenuItemValidator, "a menu items array", false);
var contextMenuActionsArray = (0, import_ag_charts_core3.arrayOfDefs)(
{
label: (0, import_ag_charts_core3.required)(import_ag_charts_core3.string),
action: (0, import_ag_charts_core3.required)(import_ag_charts_core3.callback)
},
"a context menu actions array"
);
var toolbarButtonOptionsDefs = {
label: import_ag_charts_core3.string,
ariaLabel: import_ag_charts_core3.string,
tooltip: import_ag_charts_core3.string,
icon: (0, import_ag_charts_core3.union)(
"align-center",
"align-left",
"align-right",
"arrow-drawing",
"arrow-down-drawing",
"arrow-up-drawing",
"callout-annotation",
"candlestick-series",
"close",
"comment-annotation",
"date-range-drawing",
"date-price-range-drawing",
"delete",
"disjoint-channel-drawing",
"drag-handle",
"fill-color",
"line-style-solid",
"line-style-dashed",
"line-style-dotted",
"high-low-series",
"hlc-series",
"hollow-candlestick-series",
"horizontal-line-drawing",
"line-color",
"line-series",
"line-with-markers-series",
"locked",
"measurer-drawing",
"note-annotation",
"ohlc-series",
"pan-end",
"pan-left",
"pan-right",
"pan-start",
"parallel-channel-drawing",
"position-bottom",
"position-center",
"position-top",
"price-label-annotation",
"price-range-drawing",
"reset",
"settings",
"step-line-series",
"text-annotation",
"trend-line-drawing",
"fibonacci-retracement-drawing",
"fibonacci-retracement-trend-based-drawing",
"unlocked",
"vertical-line-drawing",
"zoom-in",
"zoom-out"
)
};
var commonChartOptionsDefs = {
width: import_ag_charts_core3.positiveNumber,
height: import_ag_charts_core3.positiveNumber,
minWidth: import_ag_charts_core3.positiveNumber,
minHeight: import_ag_charts_core3.positiveNumber,
suppressFieldDotNotation: import_ag_charts_core3.boolean,
title: chartCaptionOptionsDefs,
subtitle: chartCaptionOptionsDefs,
footnote: chartCaptionOptionsDefs,
padding: {
top: import_ag_charts_core3.positiveNumber,
right: import_ag_charts_core3.positiveNumber,
bottom: import_ag_charts_core3.positiveNumber,
left: import_ag_charts_core3.positiveNumber
},
seriesArea: {
clip: import_ag_charts_core3.boolean,
padding: {
top: import_ag_charts_core3.positiveNumber,
right: import_ag_charts_core3.positiveNumber,
bottom: import_ag_charts_core3.positiveNumber,
left: import_ag_charts_core3.positiveNumber
}
},
legend: {
enabled: import_ag_charts_core3.boolean,
position: (0, import_ag_charts_core3.union)("top", "right", "bottom", "left"),
orientation: (0, import_ag_charts_core3.union)("horizontal", "vertical"),
maxWidth: import_ag_charts_core3.positiveNumber,
maxHeight: import_ag_charts_core3.positiveNumber,
spacing: import_ag_charts_core3.positiveNumber,
preventHidingAll: import_ag_charts_core3.boolean,
reverseOrder: import_ag_charts_core3.boolean,
toggleSeries: import_ag_charts_core3.boolean,
item: {
marker: {
size: import_ag_charts_core3.positiveNumber,
shape: shapeValidator,
padding: import_ag_charts_core3.positiveNumber,
strokeWidth: import_ag_charts_core3.positiveNumber
},
line: {
length: import_ag_charts_core3.positiveNumber,
strokeWidth: import_ag_charts_core3.positiveNumber
},
label: {
maxLength: import_ag_charts_core3.positiveNumber,
formatter: import_ag_charts_core3.callback,
...import_ag_charts_core3.fontOptionsDef
},
maxWidth: import_ag_charts_core3.positiveNumber,
paddingX: import_ag_charts_core3.positiveNumber,
paddingY: import_ag_charts_core3.positiveNumber,
showSeriesStroke: import_ag_charts_core3.boolean
},
pagination: {
marker: {
size: import_ag_charts_core3.positiveNumber,
shape: shapeValidator,
padding: import_ag_charts_core3.positiveNumber
},
activeStyle: {
...import_ag_charts_core3.fillOptionsDef,
...import_ag_charts_core3.strokeOptionsDef
},
inactiveStyle: {
...import_ag_charts_core3.fillOptionsDef,
...import_ag_charts_core3.strokeOptionsDef
},
highlightStyle: {
...import_ag_charts_core3.fillOptionsDef,
...import_ag_charts_core3.strokeOptionsDef
},
label: import_ag_charts_core3.fontOptionsDef
},
listeners: {
legendItemClick: import_ag_charts_core3.callback,
legendItemDoubleClick: import_ag_charts_core3.callback
}
},
gradientLegend: {
enabled: import_ag_charts_core3.boolean,
position: (0, import_ag_charts_core3.union)("top", "right", "bottom", "left"),
spacing: import_ag_charts_core3.positiveNumber,
reverseOrder: import_ag_charts_core3.boolean,
gradient: {
preferredLength: import_ag_charts_core3.positiveNumber,
thickness: import_ag_charts_core3.positiveNumber
},
scale: {
label: {
...import_ag_charts_core3.fontOptionsDef,
format: numberFormatValidator,
formatter: import_ag_charts_core3.callback
},
padding: import_ag_charts_core3.positiveNumber,
interval: {
step: import_ag_charts_core3.number,
values: import_ag_charts_core3.array,
minSpacing: (0, import_ag_charts_core3.and)(import_ag_charts_core3.positiveNumber, (0, import_ag_charts_core3.lessThan)("maxSpacing")),
maxSpacing: (0, import_ag_charts_core3.and)(import_ag_charts_core3.positiveNumber, (0, import_ag_charts_core3.greaterThan)("minSpacing"))
}
}
},
listeners: {
seriesNodeClick: import_ag_charts_core3.callback,
seriesNodeDoubleClick: import_ag_charts_core3.callback,
seriesVisibilityChange: import_ag_charts_core3.callback,
click: import_ag_charts_core3.callback,
doubleClick: import_ag_charts_core3.callback,
annotations: import_ag_charts_core3.callback,
zoom: import_ag_charts_core3.callback
},
loadGoogleFonts: import_ag_charts_core3.boolean,
highlight: {
range: (0, import_ag_charts_core3.union)("tooltip", "node")
},
overlays: {
loading: chartOverlayOptionsDefs,
noData: chartOverlayOptionsDefs,
noVisibleSeries: chartOverlayOptionsDefs,
unsupportedBrowser: chartOverlayOptionsDefs
},
tooltip: {
enabled: import_ag_charts_core3.boolean,
showArrow: import_ag_charts_core3.boolean,
pagination: import_ag_charts_core3.boolean,
delay: import_ag_charts_core3.positiveNumber,
range: rangeValidator,
wrapping: textWrapValidator,
mode: (0, import_ag_charts_core3.union)("single", "shared", "compact"),
position: {
type: tooltipDeprecatedTypeValidator,
anchorTo: (0, import_ag_charts_core3.union)("pointer", "node", "chart"),
placement: (0, import_ag_charts_core3.or)(tooltipPlacementValidator, (0, import_ag_charts_core3.arrayOf)(tooltipPlacementValidator)),
xOffset: import_ag_charts_core3.number,
yOffset: import_ag_charts_core3.number
}
},
animation: {
enabled: import_ag_charts_core3.boolean,
duration: import_ag_charts_core3.positiveNumber
},
contextMenu: {
enabled: import_ag_charts_core3.boolean,
items: contextMenuItemsArray,
extraActions: contextMenuActionsArray,
extraSeriesAreaActions: contextMenuActionsArray,
extraNodeActions: contextMenuActionsArray,
extraLegendItemActions: contextMenuActionsArray
},
dataSource: {
getData: import_ag_charts_core3.callback
},
keyboard: {
enabled: import_ag_charts_core3.boolean,
tabIndex: import_ag_charts_core3.number
},
touch: {
dragAction: (0, import_ag_charts_core3.union)("none", "drag", "hover")
},
ranges: {
enabled: import_ag_charts_core3.boolean,
buttons: (0, import_ag_charts_core3.arrayOfDefs)(
{
...toolbarButtonOptionsDefs,
value: (0, import_ag_charts_core3.or)(import_ag_charts_core3.number, (0, import_ag_charts_core3.and)((0, import_ag_charts_core3.arrayOf)((0, import_ag_charts_core3.or)(import_ag_charts_core3.number, import_ag_charts_core3.date)), (0, import_ag_charts_core3.arrayLength)(2, 2)), import_ag_charts_core3.callback)
},
"range button options array"
)
},
// modules
locale: {
localeText: import_ag_charts_core3.object,
getLocaleText: (0, import_ag_charts_core3.callbackOf)(import_ag_charts_core3.string)
},
background: {
visible: import_ag_charts_core3.boolean,
fill: import_ag_charts_core3.color,
// enterprise
image: {
url: (0, import_ag_charts_core3.required)(import_ag_charts_core3.string),
top: import_ag_charts_core3.number,
right: import_ag_charts_core3.number,
bottom: import_ag_charts_core3.number,
left: import_ag_charts_core3.number,
width: import_ag_charts_core3.positiveNumber,
height: import_ag_charts_core3.positiveNumber,
opacity: import_ag_charts_core3.ratio
}
},
styleNonce: import_ag_charts_core3.string,
sync: {
enabled: import_ag_charts_core3.boolean,
groupId: import_ag_charts_core3.string,
axes: (0, import_ag_charts_core3.union)("x", "y", "xy"),
nodeInteraction: import_ag_charts_core3.boolean,
zoom: import_ag_charts_core3.boolean
},
zoom: {
enabled: import_ag_charts_core3.boolean,
enableAxisDragging: import_ag_charts_core3.boolean,
enableDoubleClickToReset: import_ag_charts_core3.boolean,
enablePanning: import_ag_charts_core3.boolean,
enableScrolling: import_ag_charts_core3.boolean,
enableSelecting: import_ag_charts_core3.boolean,
enableTwoFingerZoom: import_ag_charts_core3.boolean,
keepAspectRatio: import_ag_charts_core3.boolean,
anchorPointX: zoomAnchorPoint,
anchorPointY: zoomAnchorPoint,
axes: (0, import_ag_charts_core3.union)("x", "y", "xy"),
deceleration: (0, import_ag_charts_core3.or)((0, import_ag_charts_core3.union)("off", "short", "long"), import_ag_charts_core3.ratio),
minVisibleItems: import_ag_charts_core3.positiveNumber,
minVisibleItemsX: import_ag_charts_core3.positiveNumber,
minVisibleItemsY: import_ag_charts_core3.positiveNumber,
panKey: (0, import_ag_charts_core3.union)("alt", "ctrl", "meta", "shift"),
scrollingStep: import_ag_charts_core3.ratio,
autoScaling: {
enabled: import_ag_charts_core3.boolean,
padding: import_ag_charts_core3.ratio
},
buttons: {
enabled: import_ag_charts_core3.boolean,
buttons: (0, import_ag_charts_core3.arrayOfDefs)(
{
...toolbarButtonOptionsDefs,
value: (0, import_ag_charts_core3.union)("reset", "zoom-in", "zoom-out", "pan-left", "pan-right", "pan-start", "pan-end"),
section: import_ag_charts_core3.string
},
"zoom button options array"
),
visible: (0, import_ag_charts_core3.union)("always", "zoomed", "hover")
}
}
};
commonChartOptionsDefs.dataSource.requestThrottle = (0, import_ag_charts_core3.undocumented)(import_ag_charts_core3.positiveNumber);
commonChartOptionsDefs.dataSource.updateThrottle = (0, import_ag_charts_core3.undocumented)(import_ag_charts_core3.positiveNumber);
commonChartOptionsDefs.dataSource.updateDuringInteraction = (0, import_ag_charts_core3.undocumented)(import_ag_charts_core3.boolean);
commonChartOptionsDefs.zoom.enableIndependentAxes = (0, import_ag_charts_core3.undocumented)(import_ag_charts_core3.boolean);
commonChartOptionsDefs.statusBar = (0, import_ag_charts_core3.undocumented)(import_ag_charts_core3.defined);
commonChartOptionsDefs.foreground = (0, import_ag_charts_core3.undocumented)({
visible: import_ag_charts_core3.boolean,
text: import_ag_charts_core3.string,
image: {
url: import_ag_charts_core3.string,
top: import_ag_charts_core3.number,
right: import_ag_charts_core3.number,
bottom: import_ag_charts_core3.number,
left: import_ag_charts_core3.number,
width: import_ag_charts_core3.positiveNumber,
height: import_ag_charts_core3.positiveNumber,
opacity: import_ag_charts_core3.ratio
},
...import_ag_charts_core3.fillOptionsDef
});
commonChartOptionsDefs.context = (0, import_ag_charts_core3.undocumented)(() => true);
commonChartOptionsDefs.overrideDevicePixelRatio = (0, import_ag_charts_core3.undocumented)(import_ag_charts_core3.number);
commonChartOptionsDefs.sync.domainMode = (0, import_ag_charts_core3.undocumented)((0, import_ag_charts_core3.union)("direction", "position", "key"));
var commonSeriesThemeableOptionsDefs = {
cursor: import_ag_charts_core3.string,
showInLegend: import_ag_charts_core3.boolean,
nodeClickRange: rangeValidator,
listeners: {
nodeClick: import_ag_charts_core3.callback,
nodeDoubleClick: import_ag_charts_core3.callback
},
highlightStyle: {
item: { ...import_ag_charts_core3.fillOptionsDef, ...import_ag_charts_core3.strokeOptionsDef },
series: {
enabled: import_ag_charts_core3.boolean,
dimOpacity: import_ag_charts_core3.ratio,
strokeWidth: import_ag_charts_core3.positiveNumber
}
}
};
var commonSeriesOptionsDefs = {
...commonSeriesThemeableOptionsDefs,
id: import_ag_charts_core3.string,
visible: import_ag_charts_core3.boolean,
data: import_ag_charts_core3.array
};
commonSeriesOptionsDefs.context = (0, import_ag_charts_core3.undocumented)(() => true);
commonSeriesOptionsDefs.seriesGrouping = (0, import_ag_charts_core3.undocumented)(import_ag_charts_core3.defined);
commonSeriesOptionsDefs.highlight = (0, import_ag_charts_core3.undocumented)({ enabled: import_ag_charts_core3.boolean });
var markerOptionsDefs = {
enabled: import_ag_charts_core3.boolean,
shape: shapeValidator,
size: import_ag_charts_core3.positiveNumber,
itemStyler: (0, import_ag_charts_core3.callbackDefs)({
...import_ag_charts_core3.fillOptionsDef,
...import_ag_charts_core3.strokeOptionsDef,
...import_ag_charts_core3.lineDashOptionsDef,
shape: shapeValidator,
size: import_ag_charts_core3.positiveNumber
}),
...import_ag_charts_core3.fillOptionsDef,
...import_ag_charts_core3.strokeOptionsDef,
...import_ag_charts_core3.lineDashOptionsDef
};
var seriesLabelOptionsDefs = {
enabled: import_ag_charts_core3.boolean,
formatter: import_ag_charts_core3.callback,
...import_ag_charts_core3.fontOptionsDef
};
var autoSizedLabelOptionsDefs = {
...seriesLabelOptionsDefs,
lineHeight: import_ag_charts_core3.positiveNumber,
minimumFontSize: import_ag_charts_core3.positiveNumber,
wrapping: textWrapValidator,
overflowStrategy: (0, import_ag_charts_core3.union)("ellipsis", "hide")
};
var errorBarThemeableOptionsDefs = {
visible: import_ag_charts_core3.boolean,
cap: {
visible: import_ag_charts_core3.boolean,
length: import_ag_charts_core3.positiveNumber,
lengthRatio: import_ag_charts_core3.ratio,
...import_ag_charts_core3.strokeOptionsDef,
...import_ag_charts_core3.lineDashOptionsDef
},
...import_ag_charts_core3.strokeOptionsDef,
...import_ag_charts_core3.lineDashOptionsDef
};
var errorBarOptionsDefs = {
...errorBarThemeableOptionsDefs,
xLowerKey: import_ag_charts_core3.string,
xUpperKey: import_ag_charts_core3.string,
yLowerKey: import_ag_charts_core3.string,
yUpperKey: import_ag_charts_core3.string,
xLowerName: import_ag_charts_core3.string,
xUpperName: import_ag_charts_core3.string,
yLowerName: import_ag_charts_core3.string,
yUpperName: import_ag_charts_core3.string,
itemStyler: (0, import_ag_charts_core3.callbackDefs)({
visible: import_ag_charts_core3.boolean,
...import_ag_charts_core3.strokeOptionsDef,
...import_ag_charts_core3.lineDashOptionsDef,
cap: {
visible: import_ag_charts_core3.boolean,
length: import_ag_charts_core3.positiveNumber,
lengthRatio: import_ag_charts_core3.ratio,
...import_ag_charts_core3.strokeOptionsDef,
...import_ag_charts_core3.lineDashOptionsDef
}
})
};
var tooltipOptionsDefs = {
enabled: import_ag_charts_core3.boolean,
showArrow: import_ag_charts_core3.boolean,
range: rangeValidator,
renderer: (0, import_ag_charts_core3.callbackOf)(
(0, import_ag_charts_core3.or)(
import_ag_charts_core3.string,
(0, import_ag_charts_core3.optionsDefs)(
{
heading: import_ag_charts_core3.string,
title: import_ag_charts_core3.string,
data: (0, import_ag_charts_core3.arrayOfDefs)({
label: (0, import_ag_charts_core3.required)(import_ag_charts_core3.string),
value: (0, import_ag_charts_core3.required)(import_ag_charts_core3.string)
})
},
"tooltip renderer result object"
)
)
),
position: {
type: tooltipDeprecatedTypeValidator,
anchorTo: (0, import_ag_charts_core3.union)("node", "pointer", "chart"),
placement: (0, import_ag_charts_core3.or)(tooltipPlacementValidator, (0, import_ag_charts_core3.arrayOf)(tooltipPlacementValidator)),
xOffset: import_ag_charts_core3.number,
yOffset: import_ag_charts_core3.number
},
interaction: {
enabled: import_ag_charts_core3.boolean
}
};
tooltipOptionsDefs.position._seriesOverrideType = (0, import_ag_charts_core3.undocumented)(tooltipDeprecatedTypeValidator);
var shadowOptionsDefs = {
enabled: import_ag_charts_core3.boolean,
xOffset: import_ag_charts_core3.number,
yOffset: import_ag_charts_core3.number,
blur: import_ag_charts_core3.positiveNumber,
color: import_ag_charts_core3.color
};
var interpolationOptionsDefs = (0, import_ag_charts_core3.typeUnion)(
{
linear: {},
smooth: {
tension: import_ag_charts_core3.ratio
},
step: {
position: (0, import_ag_charts_core3.union)("start", "middle", "end")
}
},
"interpolation line options"
);
// packages/ag-charts-community/src/chart/series/cartesian/areaSeriesOptionsDef.ts
var import_ag_charts_core4 = require("ag-charts-core");
var areaSeriesThemeableOptionsDef = {
showInMiniChart: import_ag_charts_core4.boolean,
connectMissingData: import_ag_charts_core4.boolean,
interpolation: interpolationOptionsDefs,
label: seriesLabelOptionsDefs,
marker: markerOptionsDefs,
tooltip: tooltipOptionsDefs,
shadow: shadowOptionsDefs,
...commonSeriesThemeableOptionsDefs,
...import_ag_charts_core4.fillOptionsDef,
...import_ag_charts_core4.strokeOptionsDef,
...import_ag_charts_core4.lineDashOptionsDef
};
var areaSeriesOptionsDef = {
...areaSeriesThemeableOptionsDef,
...commonSeriesOptionsDefs,
type: (0, import_ag_charts_core4.required)((0, import_ag_charts_core4.constant)("area")),
xKey: (0, import_ag_charts_core4.required)(import_ag_charts_core4.string),
yKey: (0, import_ag_charts_core4.required)(import_ag_charts_core4.string),
xName: import_ag_charts_core4.string,
yName: import_ag_charts_core4.string,
stacked: import_ag_charts_core4.boolean,
stackGroup: import_ag_charts_core4.string,
normalizedTo: import_ag_charts_core4.number
};
// packages/ag-charts-community/src/chart/series/cartesian/barSeriesOptionsDef.ts
var import_ag_charts_core5 = require("ag-charts-core");
var barSeriesThemeableOptionsDef = {
direction: (0, import_ag_charts_core5.union)("horizontal", "vertical"),
showInMiniChart: import_ag_charts_core5.boolean,
cornerRadius: import_ag_charts_core5.positiveNumber,
itemStyler: (0, import_ag_charts_core5.callbackDefs)({
...import_ag_charts_core5.fillOptionsDef,
...import_ag_charts_core5.strokeOptionsDef,
...import_ag_charts_core5.lineDashOptionsDef,
cornerRadius: import_ag_charts_core5.positiveNumber
}),
crisp: import_ag_charts_core5.boolean,
label: {
...seriesLabelOptionsDefs,
placement: (0, import_ag_charts_core5.union)("inside-center", "inside-start", "inside-end", "outside-start", "outside-end"),
padding: import_ag_charts_core5.positiveNumber
},
errorBar: errorBarThemeableOptionsDefs,
shadow: shadowOptionsDefs,
tooltip: tooltipOptionsDefs,
...commonSeriesThemeableOptionsDefs,
...import_ag_charts_core5.fillOptionsDef,
...import_ag_charts_core5.strokeOptionsDef,
...import_ag_charts_core5.lineDashOptionsDef
};
barSeriesThemeableOptionsDef.sparklineMode = (0, import_ag_charts_core5.undocumented)(import_ag_charts_core5.boolean);
var barSeriesOptionsDef = {
...barSeriesThemeableOptionsDef,
...commonSeriesOptionsDefs,
type: (0, import_ag_charts_core5.required)((0, import_ag_charts_core5.constant)("bar")),
xKey: (0, import_ag_charts_core5.required)(import_ag_charts_core5.string),
yKey: (0, import_ag_charts_core5.required)(import_ag_charts_core5.string),
xName: import_ag_charts_core5.string,
yName: import_ag_charts_core5.string,
direction: (0, import_ag_charts_core5.union)("horizontal", "vertical"),
grouped: import_ag_charts_core5.boolean,
stacked: import_ag_charts_core5.boolean,
stackGroup: import_ag_charts_core5.string,
normalizedTo: import_ag_charts_core5.number,
legendItemName: import_ag_charts_core5.string,
errorBar: errorBarOptionsDefs
};
barSeriesOptionsDef.pickOutsideVisibleMinorAxis = (0, import_ag_charts_core5.undocumented)(import_ag_charts_core5.boolean);
barSeriesOptionsDef.fastDataProcessing = (0, import_ag_charts_core5.undocumented)(import_ag_charts_core5.boolean);
barSeriesOptionsDef.focusPriority = (0, import_ag_charts_core5.undocumented)(import_ag_charts_core5.number);
// packages/ag-charts-community/src/chart/series/cartesian/lineSeriesOptionsDef.ts
var import_ag_charts_core6 = require("ag-charts-core");
var lineSeriesThemeableOptionsDef = {
title: import_ag_charts_core6.string,
showInMiniChart: import_ag_charts_core6.boolean,
connectMissingData: import_ag_charts_core6.boolean,
interpolation: interpolationOptionsDefs,
label: seriesLabelOptionsDefs,
marker: markerOptionsDefs,
tooltip: tooltipOptionsDefs,
errorBar: errorBarThemeableOptionsDefs,
...commonSeriesThemeableOptionsDefs,
...import_ag_charts_core6.strokeOptionsDef,
...import_ag_charts_core6.lineDashOptionsDef
};
lineSeriesThemeableOptionsDef.sparklineMode = (0, import_ag_charts_core6.undocumented)(import_ag_charts_core6.boolean);
var lineSeriesOptionsDef = {
...lineSeriesThemeableOptionsDef,
...commonSeriesOptionsDefs,
type: (0, import_ag_charts_core6.constant)("line"),
xKey: (0, import_ag_charts_core6.required)(import_ag_charts_core6.string),
yKey: (0, import_ag_charts_core6.required)(import_ag_charts_core6.string),
xName: import_ag_charts_core6.string,
yName: import_ag_charts_core6.string,
stacked: import_ag_charts_core6.boolean,
stackGroup: import_ag_charts_core6.string,
normalizedTo: import_ag_charts_core6.number,
legendItemName: import_ag_charts_core6.string,
errorBar: errorBarOptionsDefs
};
lineSeriesOptionsDef.pickOutsideVisibleMinorAxis = (0, import_ag_charts_core6.undocumented)(import_ag_charts_core6.boolean);
lineSeriesOptionsDef.focusPriority = (0, import_ag_charts_core6.undocumented)(import_ag_charts_core6.number);
// packages/ag-charts-community/src/util/object.ts
var import_ag_charts_core7 = require("ag-charts-core");
// packages/ag-charts-community/src/util/decorator.ts
var BREAK_TRANSFORM_CHAIN = Symbol("BREAK");
var CONFIG_KEY = "__decorator_config";
var ACCESSORS_KEY = "__decorator_accessors";
function addFakeTransformToInstanceProperty(target, propertyKeyOrSymbol) {
initialiseConfig(target, propertyKeyOrSymbol).optional = true;
}
function initialiseConfig(target, propertyKeyOrSymbol) {
if (Object.getOwnPropertyDescriptor(target, CONFIG_KEY) == null) {
Object.defineProperty(target, CONFIG_KEY, { value: {} });
}
if (Object.getOwnPropertyDescriptor(target, ACCESSORS_KEY) == null) {
const parentAccessors = Object.getPrototypeOf(target)?.[ACCESSORS_KEY];
const accessors = parentAccessors?.slice() ?? [];
Object.defineProperty(target, ACCESSORS_KEY, { value: accessors });
}
const config = target[CONFIG_KEY];
const propertyKey = propertyKeyOrSymbol.toString();
if (config[propertyKey] != null) {
return config[propertyKey];
}
config[propertyKey] = { setters: [], getters: [], observers: [] };
const descriptor = Object.getOwnPropertyDescriptor(target, propertyKeyOrSymbol);
let prevGet = descriptor?.get;
let prevSet = descriptor?.set;
if (prevGet == null || prevSet == null) {
const accessors = target[ACCESSORS_KEY];
let index = accessors.indexOf(propertyKeyOrSymbol);
if (index === -1) {
index = accessors.push(propertyKeyOrSymbol) - 1;
}
prevGet ?? (prevGet = function() {
let accessorValues = this.__accessors;
if (accessorValues == null) {
accessorValues = accessors.slice().fill(void 0);
Object.defineProperty(this, "__accessors", { value: accessorValues });
}
return accessorValues[index];
});
prevSet ?? (prevSet = function(value) {
let accessorValues = this.__accessors;
if (accessorValues == null) {
accessorValues = accessors.slice().fill(void 0);
Object.defineProperty(this, "__accessors", { value: accessorValues });
}
accessorValues[index] = value;
});
}
const getter = function() {
let value = prevGet.call(this);
for (const transformFn of config[propertyKey].getters) {
value = transformFn(this, propertyKeyOrSymbol, value);
if (value === BREAK_TRANSFORM_CHAIN) {
return;
}
}
return value;
};
const setter = function(value) {
const { setters