@carbon/charts 1.11.17 → 1.11.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/dist/{_baseEach-9c20c3b4.mjs → _baseEach-76cda8a8.mjs} +2 -2
- package/dist/{_baseEach-9c20c3b4.mjs.map → _baseEach-76cda8a8.mjs.map} +1 -1
- package/dist/{angle-utils-edabc527.mjs → angle-utils-6b17e95b.mjs} +2 -2
- package/dist/{angle-utils-edabc527.mjs.map → angle-utils-6b17e95b.mjs.map} +1 -1
- package/dist/{choropleth-2ac5a535.mjs → choropleth-17b85d55.mjs} +4 -4
- package/dist/{choropleth-2ac5a535.mjs.map → choropleth-17b85d55.mjs.map} +1 -1
- package/dist/{color-scale-utils-149f8038.mjs → color-scale-utils-faf67b75.mjs} +799 -799
- package/dist/{color-scale-utils-149f8038.mjs.map → color-scale-utils-faf67b75.mjs.map} +1 -1
- package/dist/components/index.mjs +4 -4
- package/dist/demo/index.mjs +89 -94
- package/dist/demo/index.mjs.map +1 -1
- package/dist/{index-38625a66.mjs → index-b0e98af9.mjs} +3 -3
- package/dist/{index-38625a66.mjs.map → index-b0e98af9.mjs.map} +1 -1
- package/dist/index.mjs +8 -8
- package/dist/model/index.mjs +2 -2
- package/dist/services/index.mjs +3 -3
- package/dist/umd/bundle.umd.js +84 -0
- package/dist/umd/bundle.umd.js.map +1 -0
- package/package.json +27 -32
- package/dist/_baseEach-c254cbf6.js +0 -2
- package/dist/_baseEach-c254cbf6.js.map +0 -1
- package/dist/a11y-c7c9d087.js +0 -2
- package/dist/a11y-c7c9d087.js.map +0 -1
- package/dist/angle-utils-f4be8d20.js +0 -3
- package/dist/angle-utils-f4be8d20.js.map +0 -1
- package/dist/choropleth-684cc897.js +0 -82
- package/dist/choropleth-684cc897.js.map +0 -1
- package/dist/color-scale-utils-f797f768.js +0 -2
- package/dist/color-scale-utils-f797f768.js.map +0 -1
- package/dist/components/index.js +0 -2
- package/dist/components/index.js.map +0 -1
- package/dist/demo/index.js +0 -441
- package/dist/demo/index.js.map +0 -1
- package/dist/enums-aa2efd99.js +0 -2
- package/dist/enums-aa2efd99.js.map +0 -1
- package/dist/index-822564ed.js +0 -2
- package/dist/index-822564ed.js.map +0 -1
- package/dist/index-c5b4f8ab.js +0 -2
- package/dist/index-c5b4f8ab.js.map +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/interfaces/index.js +0 -2
- package/dist/interfaces/index.js.map +0 -1
- package/dist/model/index.js +0 -3
- package/dist/model/index.js.map +0 -1
- package/dist/services/index.js +0 -2
- package/dist/services/index.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ad as g, ae as f, af as D, ag as b, ah as H, W as se, s as z, g as l, I as Y, n as X, a9 as ie, K as oe } from "./color-scale-utils-
|
|
2
|
-
import { S as O, D as ae } from "./angle-utils-
|
|
1
|
+
import { ad as g, ae as f, af as D, ag as b, ah as H, W as se, s as z, g as l, I as Y, n as X, a9 as ie, K as oe } from "./color-scale-utils-faf67b75.mjs";
|
|
2
|
+
import { S as O, D as ae } from "./angle-utils-6b17e95b.mjs";
|
|
3
3
|
import { _ as B, e as u, i as k, S as d } from "./enums-a96ef472.mjs";
|
|
4
4
|
import { select as re, max as le, extent as q, scaleTime as ue, scaleLog as ce, scaleBand as me, scaleLinear as de, curveLinear as ge, curveLinearClosed as he, curveBasis as fe, curveBasisClosed as pe, curveBasisOpen as ve, curveBundle as xe, curveCardinal as De, curveCardinalClosed as ye, curveCardinalOpen as Oe, curveCatmullRom as Ae, curveCatmullRomClosed as Te, curveCatmullRomOpen as Me, curveMonotoneX as Se, curveMonotoneY as Pe, curveNatural as Re, curveStep as Be, curveStepAfter as Le, curveStepBefore as Ee } from "d3";
|
|
5
5
|
function J(i, e) {
|
|
@@ -746,4 +746,4 @@ export {
|
|
|
746
746
|
ut as b,
|
|
747
747
|
qe as f
|
|
748
748
|
};
|
|
749
|
-
//# sourceMappingURL=index-
|
|
749
|
+
//# sourceMappingURL=index-b0e98af9.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-38625a66.mjs","sources":["../../../node_modules/date-fns/esm/addDays/index.js","../../../node_modules/date-fns/esm/addMonths/index.js","../../../node_modules/date-fns/esm/addHours/index.js","../../../node_modules/date-fns/esm/startOfDay/index.js","../../../node_modules/date-fns/esm/differenceInCalendarDays/index.js","../../../node_modules/date-fns/esm/addMinutes/index.js","../../../node_modules/date-fns/esm/addSeconds/index.js","../../../node_modules/date-fns/esm/addYears/index.js","../../../node_modules/date-fns/esm/compareAsc/index.js","../../../node_modules/date-fns/esm/constants/index.js","../../../node_modules/date-fns/esm/differenceInCalendarMonths/index.js","../../../node_modules/date-fns/esm/differenceInCalendarYears/index.js","../../../node_modules/date-fns/esm/differenceInDays/index.js","../../../node_modules/date-fns/esm/differenceInMilliseconds/index.js","../../../node_modules/date-fns/esm/_lib/roundingMethods/index.js","../../../node_modules/date-fns/esm/differenceInHours/index.js","../../../node_modules/date-fns/esm/differenceInMinutes/index.js","../../../node_modules/date-fns/esm/endOfDay/index.js","../../../node_modules/date-fns/esm/endOfMonth/index.js","../../../node_modules/date-fns/esm/isLastDayOfMonth/index.js","../../../node_modules/date-fns/esm/differenceInMonths/index.js","../../../node_modules/date-fns/esm/differenceInSeconds/index.js","../../../node_modules/date-fns/esm/differenceInYears/index.js","../../../node_modules/date-fns/esm/subDays/index.js","../../../node_modules/date-fns/esm/subMonths/index.js","../../../node_modules/date-fns/esm/subHours/index.js","../../../node_modules/date-fns/esm/subMinutes/index.js","../../../node_modules/date-fns/esm/subSeconds/index.js","../../../node_modules/date-fns/esm/subYears/index.js","../../../node_modules/lodash-es/flatten.js","../src/services/canvas-zoom.ts","../src/services/essentials/events.ts","../src/services/essentials/files.ts","../src/services/essentials/transitions.ts","../src/services/scales-cartesian.ts","../src/services/curves.ts","../src/services/zoom.ts"],"sourcesContent":["import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} - the new date with the days added\n * @throws {TypeError} - 2 arguments required\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nexport default function addDays(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n date.setDate(date.getDate() + amount);\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the months added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n */\nexport default function addMonths(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n if (!amount) {\n // If 0 months, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n var dayOfMonth = date.getDate();\n\n // The JS Date object supports date math by accepting out-of-bounds values for\n // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we\n // want except that dates will wrap around the end of a month, meaning that\n // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n // we'll default to the end of the desired month by adding 1 to the desired\n // month and using a date of 0 to back up one day to the end of the desired\n // month.\n var endOfDesiredMonth = new Date(date.getTime());\n endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);\n var daysInMonth = endOfDesiredMonth.getDate();\n if (dayOfMonth >= daysInMonth) {\n // If we're already at the end of the month, then this is the correct date\n // and we're done.\n return endOfDesiredMonth;\n } else {\n // Otherwise, we now know that setting the original day-of-month value won't\n // cause an overflow, so set the desired day-of-month. Note that we can't\n // just set the date of `endOfDesiredMonth` because that object may have had\n // its time changed in the unusual case where where a DST transition was on\n // the last day of the month and its local time was in the hour skipped or\n // repeated next to a DST transition. So we use `date` instead which is\n // guaranteed to still have the original time.\n date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);\n return date;\n }\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_HOUR = 3600000;\n\n/**\n * @name addHours\n * @category Hour Helpers\n * @summary Add the specified number of hours to the given date.\n *\n * @description\n * Add the specified number of hours to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of hours to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the hours added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 2 hours to 10 July 2014 23:00:00:\n * const result = addHours(new Date(2014, 6, 10, 23, 0), 2)\n * //=> Fri Jul 11 2014 01:00:00\n */\nexport default function addHours(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_HOUR);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport default function startOfDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport startOfDay from \"../startOfDay/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_DAY = 86400000;\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar days\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport default function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var startOfDayLeft = startOfDay(dirtyDateLeft);\n var startOfDayRight = startOfDay(dirtyDateRight);\n var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_MINUTE = 60000;\n\n/**\n * @name addMinutes\n * @category Minute Helpers\n * @summary Add the specified number of minutes to the given date.\n *\n * @description\n * Add the specified number of minutes to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of minutes to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the minutes added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 30 minutes to 10 July 2014 12:00:00:\n * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 12:30:00\n */\nexport default function addMinutes(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addSeconds\n * @category Second Helpers\n * @summary Add the specified number of seconds to the given date.\n *\n * @description\n * Add the specified number of seconds to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the seconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 30 seconds to 10 July 2014 12:45:00:\n * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:45:30\n */\nexport default function addSeconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, amount * 1000);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMonths from \"../addMonths/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addYears\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of years to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the years added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * const result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\nexport default function addYears(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMonths(dirtyDate, amount * 12);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @param {Date|Number} dateLeft - the first date to compare\n * @param {Date|Number} dateRight - the second date to compare\n * @returns {Number} the result of the comparison\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\nexport default function compareAsc(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var diff = dateLeft.getTime() - dateRight.getTime();\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1;\n // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}","/**\n * Days in 1 week.\n *\n * @name daysInWeek\n * @constant\n * @type {number}\n * @default\n */\nexport var daysInWeek = 7;\n\n/**\n * Days in 1 year\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n *\n * @name daysInYear\n * @constant\n * @type {number}\n * @default\n */\nexport var daysInYear = 365.2425;\n\n/**\n * Maximum allowed time.\n *\n * @name maxTime\n * @constant\n * @type {number}\n * @default\n */\nexport var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * Milliseconds in 1 minute\n *\n * @name millisecondsInMinute\n * @constant\n * @type {number}\n * @default\n */\nexport var millisecondsInMinute = 60000;\n\n/**\n * Milliseconds in 1 hour\n *\n * @name millisecondsInHour\n * @constant\n * @type {number}\n * @default\n */\nexport var millisecondsInHour = 3600000;\n\n/**\n * Milliseconds in 1 second\n *\n * @name millisecondsInSecond\n * @constant\n * @type {number}\n * @default\n */\nexport var millisecondsInSecond = 1000;\n\n/**\n * Minimum allowed time.\n *\n * @name minTime\n * @constant\n * @type {number}\n * @default\n */\nexport var minTime = -maxTime;\n\n/**\n * Minutes in 1 hour\n *\n * @name minutesInHour\n * @constant\n * @type {number}\n * @default\n */\nexport var minutesInHour = 60;\n\n/**\n * Months in 1 quarter\n *\n * @name monthsInQuarter\n * @constant\n * @type {number}\n * @default\n */\nexport var monthsInQuarter = 3;\n\n/**\n * Months in 1 year\n *\n * @name monthsInYear\n * @constant\n * @type {number}\n * @default\n */\nexport var monthsInYear = 12;\n\n/**\n * Quarters in 1 year\n *\n * @name quartersInYear\n * @constant\n * @type {number}\n * @default\n */\nexport var quartersInYear = 4;\n\n/**\n * Seconds in 1 hour\n *\n * @name secondsInHour\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInHour = 3600;\n\n/**\n * Seconds in 1 minute\n *\n * @name secondsInMinute\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInMinute = 60;\n\n/**\n * Seconds in 1 day\n *\n * @name secondsInDay\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInDay = secondsInHour * 24;\n\n/**\n * Seconds in 1 week\n *\n * @name secondsInWeek\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInWeek = secondsInDay * 7;\n\n/**\n * Seconds in 1 year\n *\n * @name secondsInYear\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInYear = secondsInDay * daysInYear;\n\n/**\n * Seconds in 1 month\n *\n * @name secondsInMonth\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInMonth = secondsInYear / 12;\n\n/**\n * Seconds in 1 quarter\n *\n * @name secondsInQuarter\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInQuarter = secondsInMonth * 3;","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar months\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport default function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();\n var monthDiff = dateLeft.getMonth() - dateRight.getMonth();\n return yearDiff * 12 + monthDiff;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInCalendarYears\n * @category Year Helpers\n * @summary Get the number of calendar years between the given dates.\n *\n * @description\n * Get the number of calendar years between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar years\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInCalendarYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * )\n * //=> 2\n */\nexport default function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getFullYear() - dateRight.getFullYear();\n}","import toDate from \"../toDate/index.js\";\nimport differenceInCalendarDays from \"../differenceInCalendarDays/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\"; // Like `compareAsc` but uses local time not UTC, which is needed\n// for accurate equality comparisons of UTC timestamps that end up\n// having the same representation in local time, e.g. one hour before\n// DST ends vs. the instant that DST ends.\nfunction compareLocalAsc(dateLeft, dateRight) {\n var diff = dateLeft.getFullYear() - dateRight.getFullYear() || dateLeft.getMonth() - dateRight.getMonth() || dateLeft.getDate() - dateRight.getDate() || dateLeft.getHours() - dateRight.getHours() || dateLeft.getMinutes() - dateRight.getMinutes() || dateLeft.getSeconds() - dateRight.getSeconds() || dateLeft.getMilliseconds() - dateRight.getMilliseconds();\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1;\n // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}\n\n/**\n * @name differenceInDays\n * @category Day Helpers\n * @summary Get the number of full days between the given dates.\n *\n * @description\n * Get the number of full day periods between two dates. Fractional days are\n * truncated towards zero.\n *\n * One \"full day\" is the distance between a local time in one day to the same\n * local time on the next or previous day. A full day can sometimes be less than\n * or more than 24 hours if a daylight savings change happens between two dates.\n *\n * To ignore DST and only measure exact 24-hour periods, use this instead:\n * `Math.floor(differenceInHours(dateLeft, dateRight)/24)|0`.\n *\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full days according to the local timezone\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 365\n * // How many full days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 0\n * // How many full days are between\n * // 1 March 2020 0:00 and 1 June 2020 0:00 ?\n * // Note: because local time is used, the\n * // result will always be 92 days, even in\n * // time zones where DST starts and the\n * // period has only 92*24-1 hours.\n * const result = differenceInDays(\n * new Date(2020, 5, 1),\n * new Date(2020, 2, 1)\n * )\n//=> 92\n */\nexport default function differenceInDays(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareLocalAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight));\n dateLeft.setDate(dateLeft.getDate() - sign * difference);\n\n // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full\n // If so, result must be decreased by 1 in absolute value\n var isLastDayNotFull = Number(compareLocalAsc(dateLeft, dateRight) === -sign);\n var result = sign * (difference - isLastDayNotFull);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of milliseconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport default function differenceInMilliseconds(dateLeft, dateRight) {\n requiredArgs(2, arguments);\n return toDate(dateLeft).getTime() - toDate(dateRight).getTime();\n}","var roundingMap = {\n ceil: Math.ceil,\n round: Math.round,\n floor: Math.floor,\n trunc: function trunc(value) {\n return value < 0 ? Math.ceil(value) : Math.floor(value);\n } // Math.trunc is not supported by IE\n};\n\nvar defaultRoundingMethod = 'trunc';\nexport function getRoundingMethod(method) {\n return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];\n}","import { millisecondsInHour } from \"../constants/index.js\";\nimport differenceInMilliseconds from \"../differenceInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { getRoundingMethod } from \"../_lib/roundingMethods/index.js\";\n/**\n * @name differenceInHours\n * @category Hour Helpers\n * @summary Get the number of hours between the given dates.\n *\n * @description\n * Get the number of hours between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @param {Object} [options] - an object with options.\n * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)\n * @returns {Number} the number of hours\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?\n * const result = differenceInHours(\n * new Date(2014, 6, 2, 19, 0),\n * new Date(2014, 6, 2, 6, 50)\n * )\n * //=> 12\n */\nexport default function differenceInHours(dateLeft, dateRight, options) {\n requiredArgs(2, arguments);\n var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour;\n return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);\n}","import { millisecondsInMinute } from \"../constants/index.js\";\nimport differenceInMilliseconds from \"../differenceInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { getRoundingMethod } from \"../_lib/roundingMethods/index.js\";\n/**\n * @name differenceInMinutes\n * @category Minute Helpers\n * @summary Get the number of minutes between the given dates.\n *\n * @description\n * Get the signed number of full (rounded towards 0) minutes between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @param {Object} [options] - an object with options.\n * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)\n * @returns {Number} the number of minutes\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?\n * const result = differenceInMinutes(\n * new Date(2014, 6, 2, 12, 20, 0),\n * new Date(2014, 6, 2, 12, 7, 59)\n * )\n * //=> 12\n *\n * @example\n * // How many minutes are between 10:01:59 and 10:00:00\n * const result = differenceInMinutes(\n * new Date(2000, 0, 1, 10, 0, 0),\n * new Date(2000, 0, 1, 10, 1, 59)\n * )\n * //=> -1\n */\nexport default function differenceInMinutes(dateLeft, dateRight, options) {\n requiredArgs(2, arguments);\n var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;\n return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\nexport default function endOfDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nexport default function endOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var month = date.getMonth();\n date.setFullYear(date.getFullYear(), month + 1, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport endOfDay from \"../endOfDay/index.js\";\nimport endOfMonth from \"../endOfMonth/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isLastDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is the last day of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * const result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\nexport default function isLastDayOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n return endOfDay(date).getTime() === endOfMonth(date).getTime();\n}","import toDate from \"../toDate/index.js\";\nimport differenceInCalendarMonths from \"../differenceInCalendarMonths/index.js\";\nimport compareAsc from \"../compareAsc/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport isLastDayOfMonth from \"../isLastDayOfMonth/index.js\";\n/**\n * @name differenceInMonths\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @description\n * Get the number of full months between the given dates using trunc as a default rounding method.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full months\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\n * //=> 7\n */\nexport default function differenceInMonths(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight));\n var result;\n\n // Check for the difference of less than month\n if (difference < 1) {\n result = 0;\n } else {\n if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) {\n // This will check if the date is end of Feb and assign a higher end of month date\n // to compare it with Jan\n dateLeft.setDate(30);\n }\n dateLeft.setMonth(dateLeft.getMonth() - sign * difference);\n\n // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full\n // If so, result must be decreased by 1 in absolute value\n var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign;\n\n // Check for cases of one full calendar month\n if (isLastDayOfMonth(toDate(dirtyDateLeft)) && difference === 1 && compareAsc(dirtyDateLeft, dateRight) === 1) {\n isLastMonthNotFull = false;\n }\n result = sign * (difference - Number(isLastMonthNotFull));\n }\n\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}","import differenceInMilliseconds from \"../differenceInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { getRoundingMethod } from \"../_lib/roundingMethods/index.js\";\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @param {Object} [options] - an object with options.\n * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)\n * @returns {Number} the number of seconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport default function differenceInSeconds(dateLeft, dateRight, options) {\n requiredArgs(2, arguments);\n var diff = differenceInMilliseconds(dateLeft, dateRight) / 1000;\n return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);\n}","import toDate from \"../toDate/index.js\";\nimport differenceInCalendarYears from \"../differenceInCalendarYears/index.js\";\nimport compareAsc from \"../compareAsc/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInYears\n * @category Year Helpers\n * @summary Get the number of full years between the given dates.\n *\n * @description\n * Get the number of full years between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full years\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))\n * //=> 1\n */\nexport default function differenceInYears(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight));\n\n // Set both dates to a valid leap year for accurate comparison when dealing\n // with leap days\n dateLeft.setFullYear(1584);\n dateRight.setFullYear(1584);\n\n // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full\n // If so, result must be decreased by 1 in absolute value\n var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign;\n var result = sign * (difference - Number(isLastYearNotFull));\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}","import addDays from \"../addDays/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n/**\n * @name subDays\n * @category Day Helpers\n * @summary Subtract the specified number of days from the given date.\n *\n * @description\n * Subtract the specified number of days from the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the days subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 10 days from 1 September 2014:\n * const result = subDays(new Date(2014, 8, 1), 10)\n * //=> Fri Aug 22 2014 00:00:00\n */\nexport default function subDays(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addDays(dirtyDate, -amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMonths from \"../addMonths/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subMonths\n * @category Month Helpers\n * @summary Subtract the specified number of months from the given date.\n *\n * @description\n * Subtract the specified number of months from the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the months subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 5 months from 1 February 2015:\n * const result = subMonths(new Date(2015, 1, 1), 5)\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport default function subMonths(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMonths(dirtyDate, -amount);\n}","import addHours from \"../addHours/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n/**\n * @name subHours\n * @category Hour Helpers\n * @summary Subtract the specified number of hours from the given date.\n *\n * @description\n * Subtract the specified number of hours from the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of hours to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the hours subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 2 hours from 11 July 2014 01:00:00:\n * const result = subHours(new Date(2014, 6, 11, 1, 0), 2)\n * //=> Thu Jul 10 2014 23:00:00\n */\nexport default function subHours(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addHours(dirtyDate, -amount);\n}","import addMinutes from \"../addMinutes/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n/**\n * @name subMinutes\n * @category Minute Helpers\n * @summary Subtract the specified number of minutes from the given date.\n *\n * @description\n * Subtract the specified number of minutes from the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of minutes to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the minutes subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 30 minutes from 10 July 2014 12:00:00:\n * const result = subMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 11:30:00\n */\nexport default function subMinutes(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMinutes(dirtyDate, -amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addSeconds from \"../addSeconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subSeconds\n * @category Second Helpers\n * @summary Subtract the specified number of seconds from the given date.\n *\n * @description\n * Subtract the specified number of seconds from the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of seconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the seconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 30 seconds from 10 July 2014 12:45:00:\n * const result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:44:30\n */\nexport default function subSeconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addSeconds(dirtyDate, -amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addYears from \"../addYears/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subYears\n * @category Year Helpers\n * @summary Subtract the specified number of years from the given date.\n *\n * @description\n * Subtract the specified number of years from the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of years to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the years subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 5 years from 1 September 2014:\n * const result = subYears(new Date(2014, 8, 1), 5)\n * //=> Tue Sep 01 2009 00:00:00\n */\nexport default function subYears(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addYears(dirtyDate, -amount);\n}","import baseFlatten from './_baseFlatten.js';\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nexport default flatten;\n","import { select } from 'd3'\nimport { Service } from './service'\nimport { Events } from '@/interfaces/enums'\nimport { canvasZoomSettings } from '@/configuration'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\n\nexport class CanvasZoom extends Service {\n\tprotected model: any\n\n\t/**\n\t * focal: object to zoom into\n\t * canvasElements: all the elements to translate and zoom on the chart area\n\t * zoomSettings: object containing duration, easing and zoomlevel for the zoom behaviours\n\t * */\n\tzoomIn(focal: any, canvasElements: any, zoomSettings?: any) {\n\t\tlet x: number\n\t\tlet y: number\n\t\tlet zoomLevel: number\n\t\tconst settings = zoomSettings ? zoomSettings : canvasZoomSettings\n\n\t\tif (focal) {\n\t\t\tx = focal.x\n\t\t\ty = focal.y\n\t\t\tzoomLevel = 2\n\t\t}\n\n\t\t// the 'viewport' size of the chart\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.services.domUtils.getHolder(), {\n\t\t\tuseClientDimensions: true\n\t\t})\n\n\t\tcanvasElements\n\t\t\t.transition()\n\t\t\t.duration(settings.duration)\n\t\t\t.ease(settings.ease)\n\t\t\t.attr(\n\t\t\t\t'transform',\n\t\t\t\t`translate(${width / 2}, ${height / 2}) scale(${zoomLevel}) translate(${-x},${-y})`\n\t\t\t)\n\n\t\t// Dispatch canvas zoom in event\n\t\tthis.services.events.dispatchEvent(Events.CanvasZoom.CANVAS_ZOOM_IN, {\n\t\t\telement: select(focal)\n\t\t})\n\t}\n\n\tzoomOut(canvasElements: any, zoomSettings?: any) {\n\t\tconst settings = zoomSettings ? zoomSettings : canvasZoomSettings\n\t\tcanvasElements\n\t\t\t.transition()\n\t\t\t.duration(settings.duration)\n\t\t\t.ease(settings.ease)\n\t\t\t.attr('transform', '')\n\n\t\t// Dispatch canvas zoom out event\n\t\tthis.services.events.dispatchEvent(Events.CanvasZoom.CANVAS_ZOOM_OUT)\n\t}\n}\n","import { Service } from '@/services/service'\n\nexport class Events extends Service {\n\t// DOM Event target\n\tdocumentFragment: DocumentFragment\n\n\tinit() {\n\t\t// Setup the event fragment on the DOM\n\t\tthis.documentFragment = document.createDocumentFragment()\n\t}\n\n\taddEventListener(type: string, listener: EventListenerOrEventListenerObject) {\n\t\tthis.documentFragment.addEventListener(type, listener)\n\t}\n\n\tremoveEventListener(type: string, listener: EventListenerOrEventListenerObject) {\n\t\tthis.documentFragment.removeEventListener(type, listener)\n\t}\n\n\tdispatchEvent(eventType: string, eventDetail?: object) {\n\t\tlet newEvent: any\n\t\tif (eventDetail) {\n\t\t\tnewEvent = new CustomEvent(eventType, {\n\t\t\t\tdetail: eventDetail\n\t\t\t})\n\t\t} else {\n\t\t\tnewEvent = document.createEvent('Event')\n\t\t\tnewEvent.initEvent(eventType, false, true)\n\t\t}\n\n\t\tthis.documentFragment.dispatchEvent(newEvent)\n\t}\n}\n","import { Service } from '@/services/service'\nimport { ChartModel } from '@/model/model'\n\nexport class Files extends Service {\n\tconstructor(model: ChartModel, services: any) {\n\t\tsuper(model, services)\n\t}\n\n\tdownloadCSV(content: any, filename: string) {\n\t\tconst anchor = document.createElement('a')\n\t\tconst mimeType = 'text/csv;encoding:utf-8'\n\n\t\tif (navigator['msSaveBlob']) {\n\t\t\t// Internet Explorer 10\n\t\t\tnavigator['msSaveBlob'](\n\t\t\t\tnew Blob([content], {\n\t\t\t\t\ttype: mimeType\n\t\t\t\t}),\n\t\t\t\tfilename\n\t\t\t)\n\t\t} else if (URL && 'download' in anchor) {\n\t\t\t// HTML5\n\t\t\tconst href = URL.createObjectURL(\n\t\t\t\tnew Blob([content], {\n\t\t\t\t\ttype: mimeType\n\t\t\t\t})\n\t\t\t)\n\t\t\tanchor.href = href\n\t\t\tanchor.setAttribute('download', filename)\n\n\t\t\t// Add anchor to body\n\t\t\tdocument.body.appendChild(anchor)\n\n\t\t\t// Click anchor\n\t\t\tanchor.click()\n\n\t\t\t// Remove anchor from body\n\t\t\tdocument.body.removeChild(anchor)\n\t\t\tURL.revokeObjectURL(href)\n\t\t} else {\n\t\t\tlocation.href = `data:application/octet-stream,${encodeURIComponent(content)}`\n\t\t}\n\t}\n\n\tdownloadImage(uri: string, name: string) {\n\t\tconst link = document.createElement('a')\n\t\tlink.download = name\n\t\tlink.href = uri\n\t\tdocument.body.appendChild(link)\n\t\tlink.click()\n\t\tdocument.body.removeChild(link)\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { transitions as transitionConfigs } from '@/configuration'\nimport { Service } from '@/services/service'\nimport { Events } from '@/interfaces/enums'\nimport type { Transition } from 'd3'\n\nexport interface setupTransitionConfigs {\n\ttransition?: any // d3 types are causing issues here, hence why using `any`\n\tname?: string\n\tanimate?: boolean\n}\n\nexport class Transitions extends Service {\n\tpendingTransitions: Record<number, Transition<any, any, any, any>> = {}\n\n\tinit() {\n\t\tthis.services.events?.addEventListener(Events.Model.UPDATE, () => {\n\t\t\tthis.pendingTransitions = {}\n\t\t})\n\t}\n\n\tsetupTransition({ transition: t, name, animate }: setupTransitionConfigs) {\n\t\tthis.pendingTransitions[t._id] = t\n\t\tt.on('end interrupt cancel', () => {\n\t\t\tdelete this.pendingTransitions[t._id]\n\t\t})\n\n\t\tif (this.model.getOptions().animations === false || animate === false) {\n\t\t\treturn t.duration(0)\n\t\t}\n\n\t\treturn t.duration(getProperty(transitionConfigs, name, 'duration') || transitionConfigs.default.duration)\n\t}\n\n\tgetPendingTransitions() {\n\t\treturn this.pendingTransitions\n\t}\n}\n","import { extent, max, scaleBand, scaleLinear, scaleTime, scaleLog, type ScaleTime, type ScaleBand, type ScaleLinear } from 'd3'\nimport {\n\tdifferenceInYears,\n\taddYears,\n\tsubYears,\n\tdifferenceInMonths,\n\taddMonths,\n\tsubMonths,\n\tdifferenceInDays,\n\taddDays,\n\tsubDays,\n\tdifferenceInHours,\n\taddHours,\n\tsubHours,\n\tdifferenceInMinutes,\n\taddMinutes,\n\tsubMinutes,\n\tdifferenceInSeconds,\n\tsubSeconds,\n\taddSeconds\n} from 'date-fns'\nimport { flatten, uniq } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { axis as axisConfigs } from '@/configuration'\nimport { Service } from './service'\nimport { AxisPositions, CartesianOrientations, ScaleTypes } from '@/interfaces/enums'\nimport { ThresholdOptions } from '@/interfaces/components'\n\nexport type ScaleFunction = ScaleTime<number, number, never> | ScaleBand<string> | ScaleLinear<number, number, never>\n\nexport class CartesianScales extends Service {\n\tprotected scaleTypes = {\n\t\ttop: null as ScaleTypes,\n\t\tright: null as ScaleTypes,\n\t\tbottom: null as ScaleTypes,\n\t\tleft: null as ScaleTypes\n\t}\n\n\tprotected scales = { // null or function\n\t\ttop: null as ScaleLinear<number, number, never>,\n\t\tright: null as ScaleLinear<number, number, never>,\n\t\tbottom: null as ScaleLinear<number, number, never>,\n\t\tleft: null as ScaleLinear<number, number, never>\n\t}\n\n\tprotected domainAxisPosition: AxisPositions\n\tprotected rangeAxisPosition: AxisPositions\n\tprotected secondaryDomainAxisPosition: AxisPositions\n\tprotected secondaryRangeAxisPosition: AxisPositions\n\n\tprotected dualAxes: boolean\n\n\tprotected orientation: CartesianOrientations\n\n\tgetDomainAxisPosition({ datum = null }: { datum?: any } = {}) {\n\t\tif (this.dualAxes && datum) {\n\t\t\tconst options = this.model.getOptions()\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst axesOptions = getProperty(options, 'axes', this.secondaryDomainAxisPosition)\n\t\t\tconst dataset = datum[groupMapsTo]\n\t\t\tif (\n\t\t\t\taxesOptions?.correspondingDatasets &&\n\t\t\t\taxesOptions.correspondingDatasets.includes(dataset)\n\t\t\t) {\n\t\t\t\treturn this.secondaryDomainAxisPosition\n\t\t\t}\n\t\t}\n\t\treturn this.domainAxisPosition\n\t}\n\n\tgetRangeAxisPosition({ datum = null, groups = null }: { datum?: any, groups?: any } = {}) {\n\t\tif (this.dualAxes) {\n\t\t\tconst options = this.model.getOptions()\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst axisOptions = getProperty(options, 'axes', this.secondaryRangeAxisPosition)\n\t\t\tlet dataset\n\t\t\tif (datum !== null) {\n\t\t\t\tdataset = datum[groupMapsTo]\n\t\t\t} else if (groups && groups.length > 0) {\n\t\t\t\tdataset = groups[0]\n\t\t\t}\n\t\t\tif (\n\t\t\t\taxisOptions?.correspondingDatasets &&\n\t\t\t\taxisOptions.correspondingDatasets.includes(dataset)\n\t\t\t) {\n\t\t\t\treturn this.secondaryRangeAxisPosition\n\t\t\t}\n\t\t}\n\t\treturn this.rangeAxisPosition\n\t}\n\n\tgetAxisOptions(position: AxisPositions) {\n\t\treturn getProperty(this.model.getOptions(), 'axes', position)\n\t}\n\n\tgetDomainAxisOptions() {\n\t\tconst domainAxisPosition = this.getDomainAxisPosition()\n\t\treturn this.getAxisOptions(domainAxisPosition)\n\t}\n\n\tgetRangeAxisOptions() {\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition()\n\t\treturn this.getAxisOptions(rangeAxisPosition)\n\t}\n\n\tgetScaleLabel(position: AxisPositions) {\n\t\tconst axisOptions = this.getAxisOptions(position)\n\t\tconst title: string = axisOptions.title\n\t\tif (!title) {\n\t\t\tif (position === AxisPositions.BOTTOM || position === AxisPositions.TOP) {\n\t\t\t\treturn 'x-value'\n\t\t\t}\n\t\t\treturn 'y-value'\n\t\t}\n\t\treturn title\n\t}\n\n\tgetDomainLabel() {\n\t\treturn this.getScaleLabel(this.getDomainAxisPosition())\n\t}\n\n\tgetRangeLabel() {\n\t\treturn this.getScaleLabel(this.getRangeAxisPosition())\n\t}\n\n\tupdate() {\n\t\tthis.determineAxisDuality()\n\t\tthis.findDomainAndRangeAxes()\n\t\tthis.determineOrientation()\n\t\tconst axisPositions: AxisPositions[] = Object.keys(AxisPositions).map(\n\t\t\t(axisPositionKey: string) => AxisPositions[axisPositionKey as keyof typeof AxisPositions]\n\t\t)\n\t\taxisPositions.forEach((axisPosition) => {\n\t\t\tthis.scales[axisPosition] = this.createScale(axisPosition) as ScaleLinear<number, number, never>\n\t\t})\n\t}\n\n\tfindDomainAndRangeAxes() {\n\t\t// find main axes between (left & right) && (bottom & top)\n\t\tconst verticalAxesPositions = this.findVerticalAxesPositions()\n\t\tconst horizontalAxesPositions = this.findHorizontalAxesPositions()\n\n\t\t// Now we have horizontal & vertical main axes to choose domain & range axes from\n\t\tconst domainAndRangeAxesPositions = this.findDomainAndRangeAxesPositions(\n\t\t\tverticalAxesPositions,\n\t\t\thorizontalAxesPositions\n\t\t)\n\n\t\tthis.domainAxisPosition = domainAndRangeAxesPositions.primaryDomainAxisPosition\n\t\tthis.rangeAxisPosition = domainAndRangeAxesPositions.primaryRangeAxisPosition\n\n\t\tif (this.isDualAxes()) {\n\t\t\tthis.secondaryDomainAxisPosition = domainAndRangeAxesPositions.secondaryDomainAxisPosition\n\t\t\tthis.secondaryRangeAxisPosition = domainAndRangeAxesPositions.secondaryRangeAxisPosition\n\t\t}\n\t}\n\n\tdetermineOrientation() {\n\t\tif (\n\t\t\t(this.rangeAxisPosition === AxisPositions.LEFT ||\n\t\t\t\tthis.rangeAxisPosition === AxisPositions.RIGHT) &&\n\t\t\t(this.domainAxisPosition === AxisPositions.BOTTOM ||\n\t\t\t\tthis.domainAxisPosition === AxisPositions.TOP)\n\t\t) {\n\t\t\tthis.orientation = CartesianOrientations.VERTICAL\n\t\t} else {\n\t\t\tthis.orientation = CartesianOrientations.HORIZONTAL\n\t\t}\n\t}\n\n\tisDualAxes() {\n\t\treturn this.dualAxes\n\t}\n\n\t// if any of the axes objects have correspondingDatasets [] asserted we flag the chart as dual axes\n\t// it does not count as dual axes if it just has another axis turned on but is not actually using it to map a dataset\n\tdetermineAxisDuality() {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\n\t\tif (\n\t\t\t(axesOptions[AxisPositions.LEFT]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.RIGHT]) ||\n\t\t\t(axesOptions[AxisPositions.RIGHT]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.LEFT]) ||\n\t\t\t(axesOptions[AxisPositions.TOP]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.BOTTOM]) ||\n\t\t\t(axesOptions[AxisPositions.BOTTOM]?.correspondingDatasets && axesOptions[AxisPositions.TOP])\n\t\t) {\n\t\t\tthis.dualAxes = true\n\t\t}\n\t}\n\n\tgetCustomDomainValuesByposition(axisPosition: AxisPositions) {\n\t\tconst domain = getProperty(this.model.getOptions(), 'axes', axisPosition, 'domain')\n\n\t\t// Check if domain is an array\n\t\tif (domain && !Array.isArray(domain)) {\n\t\t\tthrow new Error(`Domain in ${axisPosition} axis is not a valid array`)\n\t\t}\n\n\t\t// Determine number of elements passed in domain depending on scale types\n\t\tif (Array.isArray(domain)) {\n\t\t\tif (\n\t\t\t\t(this.scaleTypes[axisPosition] === ScaleTypes.LINEAR ||\n\t\t\t\t\tthis.scaleTypes[axisPosition] === ScaleTypes.TIME) &&\n\t\t\t\tdomain.length !== 2\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`There can only be 2 elements in domain for scale type: ${this.scaleTypes[axisPosition]}`\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\treturn domain\n\t}\n\n\tgetOrientation() {\n\t\treturn this.orientation\n\t}\n\n\tgetScaleByPosition(axisPosition: AxisPositions) {\n\t\treturn this.scales[axisPosition]\n\t}\n\n\tgetScaleTypeByPosition(axisPosition: AxisPositions) {\n\t\treturn this.scaleTypes[axisPosition]\n\t}\n\n\tgetDomainAxisScaleType() {\n\t\tconst domainAxisPosition = this.getDomainAxisPosition()\n\t\treturn this.getScaleTypeByPosition(domainAxisPosition)\n\t}\n\n\tgetRangeAxisScaleType() {\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition()\n\t\treturn this.getScaleTypeByPosition(rangeAxisPosition)\n\t}\n\n\tgetDomainScale() {\n\t\treturn this.scales[this.domainAxisPosition]\n\t}\n\n\tgetRangeScale() {\n\t\treturn this.scales[this.rangeAxisPosition]\n\t}\n\n\t// Find the main x-axis out of the 2 x-axis on the chart (when 2D axis is used)\n\tgetMainXAxisPosition() {\n\t\tconst possibleXAxisPositions = [AxisPositions.BOTTOM, AxisPositions.TOP]\n\n\t\treturn [this.domainAxisPosition, this.rangeAxisPosition].find(\n\t\t\t(position) => possibleXAxisPositions.indexOf(position) > -1\n\t\t)\n\t}\n\n\t// Find the main y-axis out of the 2 y-axis on the chart (when 2D axis is used)\n\tgetMainYAxisPosition() {\n\t\tconst possibleYAxisPositions = [AxisPositions.LEFT, AxisPositions.RIGHT]\n\n\t\treturn [this.domainAxisPosition, this.rangeAxisPosition].find(\n\t\t\t(position) => possibleYAxisPositions.indexOf(position) > -1\n\t\t)\n\t}\n\n\tgetMainXScale() {\n\t\treturn this.scales[this.getMainXAxisPosition()]\n\t}\n\n\tgetMainYScale() {\n\t\treturn this.scales[this.getMainYAxisPosition()]\n\t}\n\n\tgetValueFromScale(scale: any, scaleType: ScaleTypes, axisPosition: AxisPositions, datum: any) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst axisOptions = axesOptions[axisPosition]\n\t\tconst { mapsTo } = axisOptions\n\t\tconst value = getProperty(datum, mapsTo) !== null ? datum[mapsTo] : datum\n\t\tlet scaledValue: number\n\t\tswitch (scaleType) {\n\t\t\tcase ScaleTypes.LABELS:\n\t\t\t\tscaledValue = scale(value) + scale.step() / 2\n\t\t\t\tbreak\n\t\t\tcase ScaleTypes.TIME:\n\t\t\t\tscaledValue = scale(new Date(value))\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tscaledValue = scale(value)\n\t\t}\n\t\treturn scaledValue\n\t}\n\n\tgetBoundedScaledValues(datum: any): number[] {\n\t\tconst { bounds } = this.model.getOptions()\n\t\tconst axisPosition = this.getRangeAxisPosition({ datum })\n\t\tconst scale = this.scales[axisPosition]\n\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst axisOptions = axesOptions[axisPosition]\n\t\tconst { mapsTo } = axisOptions\n\t\tconst value = datum[mapsTo] !== undefined ? datum[mapsTo] : datum\n\n\t\tconst boundedValues = [\n\t\t\tscale(\n\t\t\t\tgetProperty(datum, bounds.upperBoundMapsTo) !== null\n\t\t\t\t\t? datum[bounds.upperBoundMapsTo]\n\t\t\t\t\t: value\n\t\t\t),\n\t\t\tscale(\n\t\t\t\tgetProperty(datum, bounds.lowerBoundMapsTo) !== null\n\t\t\t\t\t? datum[bounds.lowerBoundMapsTo]\n\t\t\t\t\t: value\n\t\t\t)\n\t\t]\n\n\t\treturn boundedValues\n\t}\n\n\tgetValueThroughAxisPosition(axisPosition: AxisPositions, datum: any) {\n\t\tconst scaleType = this.scaleTypes[axisPosition] as ScaleTypes\n\t\tconst scale = this.scales[axisPosition]\n\n\t\treturn this.getValueFromScale(scale, scaleType, axisPosition, datum)\n\t}\n\n\tgetDomainValue(d: string | object) {\n\t\tconst axisPosition = this.getDomainAxisPosition({ datum: d })\n\t\treturn this.getValueThroughAxisPosition(axisPosition, d)\n\t}\n\n\tgetRangeValue(d: number | string | object) {\n\t\tconst axisPosition = this.getRangeAxisPosition({ datum: d })\n\t\treturn this.getValueThroughAxisPosition(axisPosition, d)\n\t}\n\n\tgetMainXScaleType() {\n\t\treturn this.getScaleTypeByPosition(this.getMainXAxisPosition())\n\t}\n\n\tgetMainYScaleType() {\n\t\treturn this.getScaleTypeByPosition(this.getMainYAxisPosition())\n\t}\n\n\tgetDomainIdentifier(datum?: any) {\n\t\tconst options = this.model.getOptions()\n\t\treturn getProperty(options, 'axes', this.getDomainAxisPosition({ datum: datum }), 'mapsTo')\n\t}\n\n\tgetRangeIdentifier(datum?: any) {\n\t\tconst options = this.model.getOptions()\n\t\treturn getProperty(options, 'axes', this.getRangeAxisPosition({ datum: datum }), 'mapsTo')\n\t}\n\n\textendsDomain(axisPosition: AxisPositions, domain: any) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\t\tif (axisOptions.scaleType === ScaleTypes.TIME) {\n\t\t\tconst spaceToAddToEdges = getProperty(options, 'timeScale', 'addSpaceOnEdges')\n\t\t\treturn addSpacingToTimeDomain(domain, spaceToAddToEdges)\n\t\t} else {\n\t\t\treturn addSpacingToContinuousDomain(domain, axisConfigs.paddingRatio, axisOptions.scaleType)\n\t\t}\n\t}\n\n\tprotected findVerticalAxesPositions() {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst dualAxes = this.isDualAxes()\n\n\t\t// If right axis has been specified as `main`\n\t\tif (\n\t\t\t(getProperty(axesOptions, AxisPositions.LEFT) === null &&\n\t\t\t\tgetProperty(axesOptions, AxisPositions.RIGHT) !== null) ||\n\t\t\tgetProperty(axesOptions, AxisPositions.RIGHT, 'main') === true ||\n\t\t\t(dualAxes && getProperty(axesOptions, AxisPositions.LEFT, 'correspondingDatasets'))\n\t\t) {\n\t\t\treturn {\n\t\t\t\tprimary: AxisPositions.RIGHT,\n\t\t\t\tsecondary: AxisPositions.LEFT\n\t\t\t}\n\t\t}\n\n\t\treturn { primary: AxisPositions.LEFT, secondary: AxisPositions.RIGHT }\n\t}\n\n\tprotected findHorizontalAxesPositions() {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst dualAxes = this.isDualAxes()\n\n\t\t// If top axis has been specified as `main`\n\t\tif (\n\t\t\t(getProperty(axesOptions, AxisPositions.BOTTOM) === null &&\n\t\t\t\tgetProperty(axesOptions, AxisPositions.TOP) !== null) ||\n\t\t\tgetProperty(axesOptions, AxisPositions.TOP, 'main') === true ||\n\t\t\t(dualAxes && getProperty(axesOptions, AxisPositions.BOTTOM, 'correspondingDatasets'))\n\t\t) {\n\t\t\treturn {\n\t\t\t\tprimary: AxisPositions.TOP,\n\t\t\t\tsecondary: AxisPositions.BOTTOM\n\t\t\t}\n\t\t}\n\n\t\treturn { primary: AxisPositions.BOTTOM, secondary: AxisPositions.TOP }\n\t}\n\n\tprotected findDomainAndRangeAxesPositions(\n\t\tverticalAxesPositions: any,\n\t\thorizontalAxesPositions: any\n\t) {\n\t\tconst options = this.model.getOptions()\n\n\t\tconst mainVerticalAxisOptions = getProperty(options, 'axes', verticalAxesPositions.primary)\n\t\tconst mainHorizontalAxisOptions = getProperty(options, 'axes', horizontalAxesPositions.primary)\n\n\t\tconst mainVerticalScaleType = mainVerticalAxisOptions.scaleType || ScaleTypes.LINEAR\n\t\tconst mainHorizontalScaleType = mainHorizontalAxisOptions.scaleType || ScaleTypes.LINEAR\n\n\t\tconst result = {\n\t\t\tprimaryDomainAxisPosition: null as AxisPositions,\n\t\t\tsecondaryDomainAxisPosition: null as AxisPositions,\n\t\t\tprimaryRangeAxisPosition: null as AxisPositions,\n\t\t\tsecondaryRangeAxisPosition: null as AxisPositions\n\t\t}\n\n\t\t// assign to to be a vertical chart by default\n\t\tresult.primaryDomainAxisPosition = horizontalAxesPositions.primary\n\t\tresult.primaryRangeAxisPosition = verticalAxesPositions.primary\n\t\t// secondary axes\n\t\tresult.secondaryDomainAxisPosition = horizontalAxesPositions.secondary\n\t\tresult.secondaryRangeAxisPosition = verticalAxesPositions.secondary\n\n\t\t// if neither the horizontal axes are label or time\n\t\t// and atleast one of the main vertical ones are labels or time then it should be horizontal\n\t\tif (\n\t\t\t(!(\n\t\t\t\tmainHorizontalScaleType === ScaleTypes.LABELS || mainHorizontalScaleType === ScaleTypes.TIME\n\t\t\t) &&\n\t\t\t\tmainVerticalScaleType === ScaleTypes.LABELS) ||\n\t\t\tmainVerticalScaleType === ScaleTypes.TIME\n\t\t) {\n\t\t\tresult.primaryDomainAxisPosition = verticalAxesPositions.primary\n\t\t\tresult.primaryRangeAxisPosition = horizontalAxesPositions.primary\n\t\t\t// secondary axes\n\t\t\tresult.secondaryDomainAxisPosition = verticalAxesPositions.secondary\n\t\t\tresult.secondaryRangeAxisPosition = horizontalAxesPositions.secondary\n\t\t}\n\n\t\treturn result\n\t}\n\n\tgetScaleDomain(axisPosition: AxisPositions) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\t\tconst bounds = getProperty(options, 'bounds')\n\t\tconst { includeZero } = axisOptions\n\t\tconst scaleType = getProperty(axisOptions, 'scaleType') || ScaleTypes.LINEAR\n\n\t\tif (this.model.isDataEmpty()) {\n\t\t\treturn []\n\t\t}\n\n\t\tif (axisOptions.binned) {\n\t\t\tconst { bins } = this.model.getBinConfigurations()\n\n\t\t\treturn [0, max(bins, (d: any) => d.length)]\n\t\t} else if (axisOptions.limitDomainToBins) {\n\t\t\tconst { bins } = this.model.getBinConfigurations()\n\t\t\tconst stackKeys = this.model.getStackKeys({ bins })\n\n\t\t\treturn [stackKeys[0].split('-')[0], stackKeys[stackKeys.length - 1].split('-')[1]]\n\t\t}\n\n\t\tconst displayData = this.model.getDisplayData()\n\t\tconst { extendLinearDomainBy, mapsTo, percentage, thresholds } = axisOptions\n\t\tconst { reference: ratioReference, compareTo: ratioCompareTo } = axisConfigs.ratio\n\n\t\t// If domain is specified return that domain\n\t\tif (axisOptions.domain) {\n\t\t\tif (scaleType === ScaleTypes.LABELS) {\n\t\t\t\treturn axisOptions.domain\n\t\t\t} else if (scaleType === ScaleTypes.TIME) {\n\t\t\t\taxisOptions.domain = axisOptions.domain.map((d: any) =>\n\t\t\t\t\td.getTime === undefined ? new Date(d) : d\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn this.extendsDomain(axisPosition, axisOptions.domain)\n\t\t}\n\n\t\t// Return [0, 100] for percentage axis scale\n\t\tif (percentage) {\n\t\t\treturn [0, 100]\n\t\t}\n\n\t\t// If scale is a LABELS scale, return some labels as the domain\n\t\tif (axisOptions && scaleType === ScaleTypes.LABELS) {\n\t\t\t// Get unique values\n\t\t\treturn uniq(displayData.map((d: any) => d[mapsTo]))\n\t\t}\n\n\t\t// Get the extent of the domain\n\t\tlet domain: any\n\t\tlet allDataValues: any\n\t\tconst dataGroupNames = this.model.getDataGroupNames()\n\n\t\tif (scaleType === ScaleTypes.LABELS_RATIO) {\n\t\t\treturn displayData.map((datum: any) => `${datum[ratioReference]}/${datum[ratioCompareTo]}`)\n\t\t} else if (scaleType === ScaleTypes.TIME) {\n\t\t\tallDataValues = displayData.map((datum: any) => +new Date(datum[mapsTo]))\n\t\t} else if (bounds && options.axes) {\n\t\t\tallDataValues = []\n\n\t\t\tdisplayData.forEach((datum: any) => {\n\t\t\t\tallDataValues.push(datum[mapsTo])\n\n\t\t\t\tif (datum[bounds.upperBoundMapsTo]) {\n\t\t\t\t\tallDataValues.push(datum[bounds.upperBoundMapsTo])\n\t\t\t\t}\n\t\t\t\tif (datum[bounds.lowerBoundMapsTo]) {\n\t\t\t\t\tallDataValues.push(datum[bounds.lowerBoundMapsTo])\n\t\t\t\t}\n\t\t\t})\n\t\t} else if (\n\t\t\taxisOptions.stacked === true &&\n\t\t\tdataGroupNames &&\n\t\t\taxisPosition === this.getRangeAxisPosition()\n\t\t) {\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst dataValuesGroupedByKeys = this.model.getDataValuesGroupedByKeys({\n\t\t\t\tgroups: dataGroupNames\n\t\t\t})\n\t\t\tconst nonStackedGroupsData = displayData.filter(\n\t\t\t\t(datum: any) => !dataGroupNames.includes(datum[groupMapsTo])\n\t\t\t)\n\n\t\t\tconst stackedValues: any[] = []\n\t\t\tdataValuesGroupedByKeys.forEach((dataValues: any) => {\n\t\t\t\tconst { ...numericalValues } = dataValues\n\n\t\t\t\tlet positiveSum = 0,\n\t\t\t\t\tnegativeSum = 0\n\t\t\t\tObject.values(numericalValues).forEach((value: number) => {\n\t\t\t\t\tif (!isNaN(value)) {\n\t\t\t\t\t\tif (value < 0) {\n\t\t\t\t\t\t\tnegativeSum += value\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpositiveSum += value\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tstackedValues.push([negativeSum, positiveSum])\n\t\t\t})\n\n\t\t\tallDataValues = [\n\t\t\t\t...flatten(stackedValues),\n\t\t\t\t...nonStackedGroupsData.map((datum: any) => datum[mapsTo])\n\t\t\t]\n\t\t} else {\n\t\t\tallDataValues = []\n\n\t\t\tdisplayData.forEach((datum: any) => {\n\t\t\t\tconst value = datum[mapsTo]\n\t\t\t\tif (Array.isArray(value) && value.length === 2) {\n\t\t\t\t\tallDataValues.push(value[0])\n\t\t\t\t\tallDataValues.push(value[1])\n\t\t\t\t} else {\n\t\t\t\t\tif (extendLinearDomainBy) {\n\t\t\t\t\t\tallDataValues.push(Math.max(datum[mapsTo], datum[extendLinearDomainBy]))\n\t\t\t\t\t}\n\t\t\t\t\tallDataValues.push(value)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\t// Time can never be 0 and log of base 0 is -Infinity\n\t\tif (scaleType !== ScaleTypes.TIME && scaleType !== ScaleTypes.LOG && includeZero) {\n\t\t\tallDataValues.push(0)\n\t\t}\n\n\t\t// Add threshold values into the scale\n\t\tif (thresholds && thresholds.length > 0) {\n\t\t\tthresholds.forEach((threshold: any) => {\n\t\t\t\tconst thresholdValue = getProperty(threshold, 'value')\n\t\t\t\tif (thresholdValue !== null) allDataValues.push(thresholdValue)\n\t\t\t})\n\t\t}\n\n\t\tdomain = extent(allDataValues)\n\t\tdomain = this.extendsDomain(axisPosition, domain)\n\n\t\treturn domain\n\t}\n\n\tprotected createScale(axisPosition: AxisPositions) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\n\t\tif (!axisOptions) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst scaleType = getProperty(axisOptions, 'scaleType') || ScaleTypes.LINEAR\n\t\tthis.scaleTypes[axisPosition] = scaleType\n\n\t\tlet scale: ScaleFunction\n\t\tif (scaleType === ScaleTypes.TIME) {\n\t\t\tscale = scaleTime()\n\t\t} else if (scaleType === ScaleTypes.LOG) {\n\t\t\tscale = scaleLog().base(axisOptions.base || 10)\n\t\t} else if (scaleType === ScaleTypes.LABELS || scaleType === ScaleTypes.LABELS_RATIO) {\n\t\t\tscale = scaleBand()\n\t\t} else {\n\t\t\tscale = scaleLinear()\n\t\t}\n\n\t\tscale.domain(this.getScaleDomain(axisPosition))\n\n\t\treturn scale\n\t}\n\n\tgetHighestDomainThreshold(): null | {\n\t\tthreshold: ThresholdOptions\n\t\tscaleValue: number\n\t} {\n\t\tconst axesOptions = getProperty(this.model.getOptions(), 'axes')\n\t\tconst domainAxisPosition = this.getDomainAxisPosition()\n\n\t\tconst { thresholds } = axesOptions[domainAxisPosition]\n\n\t\t// Check if thresholds exist & is not empty\n\t\tif (!Array.isArray(thresholds) || (Array.isArray(thresholds) && !thresholds.length)) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst domainScale = this.getDomainScale()\n\t\t// Find the highest threshold for the domain\n\t\tconst highestThreshold = thresholds.sort((a, b) => b.value - a.value)[0]\n\n\t\tconst scaleType = this.getScaleTypeByPosition(domainAxisPosition)\n\t\tif (\n\t\t\tscaleType === ScaleTypes.TIME &&\n\t\t\t(typeof highestThreshold.value === 'string' || highestThreshold.value.getTime === undefined)\n\t\t) {\n\t\t\thighestThreshold.value = new Date(highestThreshold.value)\n\t\t}\n\n\t\treturn {\n\t\t\tthreshold: highestThreshold,\n\t\t\tscaleValue: domainScale(highestThreshold.value)\n\t\t}\n\t}\n\n\tgetHighestRangeThreshold(): null | {\n\t\tthreshold: ThresholdOptions\n\t\tscaleValue: number\n\t} {\n\t\tconst axesOptions = getProperty(this.model.getOptions(), 'axes')\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition()\n\n\t\tconst { thresholds } = axesOptions[rangeAxisPosition]\n\n\t\t// Check if thresholds exist & is not empty\n\t\tif (!Array.isArray(thresholds) || (Array.isArray(thresholds) && !thresholds.length)) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst rangeScale = this.getRangeScale()\n\t\t// Find the highest threshold for the range\n\t\tconst highestThreshold = thresholds.sort((a, b) => b.value - a.value)[0]\n\n\t\treturn {\n\t\t\tthreshold: highestThreshold,\n\t\t\tscaleValue: rangeScale(highestThreshold.value)\n\t\t}\n\t}\n}\n\nfunction addSpacingToTimeDomain(domain: any, spaceToAddToEdges: number) {\n\tconst startDate = new Date(domain[0])\n\tconst endDate = new Date(domain[1])\n\n\tif (differenceInYears(endDate, startDate) > 1) {\n\t\treturn [subYears(startDate, spaceToAddToEdges), addYears(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInMonths(endDate, startDate) > 1) {\n\t\treturn [subMonths(startDate, spaceToAddToEdges), addMonths(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInDays(endDate, startDate) > 1) {\n\t\treturn [subDays(startDate, spaceToAddToEdges), addDays(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInHours(endDate, startDate) > 1) {\n\t\treturn [subHours(startDate, spaceToAddToEdges), addHours(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInMinutes(endDate, startDate) > 30) {\n\t\treturn [\n\t\t\tsubMinutes(startDate, spaceToAddToEdges * 30),\n\t\t\taddMinutes(endDate, spaceToAddToEdges * 30)\n\t\t]\n\t}\n\n\tif (differenceInMinutes(endDate, startDate) > 1) {\n\t\treturn [subMinutes(startDate, spaceToAddToEdges), addMinutes(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInSeconds(endDate, startDate) > 15) {\n\t\treturn [\n\t\t\tsubSeconds(startDate, spaceToAddToEdges * 15),\n\t\t\taddSeconds(endDate, spaceToAddToEdges * 15)\n\t\t]\n\t}\n\n\tif (differenceInSeconds(endDate, startDate) > 1) {\n\t\treturn [subSeconds(startDate, spaceToAddToEdges), addSeconds(endDate, spaceToAddToEdges)]\n\t}\n\n\treturn [startDate, endDate]\n}\n\nfunction addSpacingToContinuousDomain(\n\t[lower, upper]: number[],\n\tpaddingRatio: number,\n\tscaleType?: ScaleTypes\n) {\n\tconst domainLength = upper - lower\n\tconst padding = domainLength * paddingRatio\n\n\t// If padding crosses 0, keep 0 as new upper bound\n\tconst newUpper = upper <= 0 && upper + padding > 0 ? 0 : upper + padding\n\t// If padding crosses 0, keep 0 as new lower bound\n\tlet newLower = lower >= 0 && lower - padding < 0 ? 0 : lower - padding\n\n\t// Log of base 0 or a negative number is -Infinity\n\tif (scaleType === ScaleTypes.LOG && newLower <= 0) {\n\t\tif (lower <= 0) {\n\t\t\tthrow Error('Data must have values greater than 0 if log scale type is used.')\n\t\t}\n\t\tnewLower = lower\n\t}\n\n\treturn [newLower, newUpper]\n}\n","import {\n\tcurveBasis,\n\tcurveBasisClosed,\n\tcurveBasisOpen,\n\tcurveBundle,\n\tcurveCardinal,\n\tcurveCardinalClosed,\n\tcurveCardinalOpen,\n\tcurveCatmullRom,\n\tcurveCatmullRomClosed,\n\tcurveCatmullRomOpen,\n\tcurveLinear,\n\tcurveLinearClosed,\n\tcurveMonotoneX,\n\tcurveMonotoneY,\n\tcurveNatural,\n\tcurveStep,\n\tcurveStepAfter,\n\tcurveStepBefore\n} from 'd3'\nimport { Service } from './service'\n\nexport class Curves extends Service {\n\tcurveTypes = {\n\t\tcurveLinear,\n\t\tcurveLinearClosed,\n\t\tcurveBasis,\n\t\tcurveBasisClosed,\n\t\tcurveBasisOpen,\n\t\tcurveBundle,\n\t\tcurveCardinal,\n\t\tcurveCardinalClosed,\n\t\tcurveCardinalOpen,\n\t\tcurveCatmullRom,\n\t\tcurveCatmullRomClosed,\n\t\tcurveCatmullRomOpen,\n\t\tcurveMonotoneX,\n\t\tcurveMonotoneY,\n\t\tcurveNatural,\n\t\tcurveStep,\n\t\tcurveStepAfter,\n\t\tcurveStepBefore\n\t}\n\n\tgetD3Curve() {\n\t\tlet curveName = 'curveLinear' as keyof typeof this.curveTypes\n\t\tconst curveOptions = this.model.getOptions().curve\n\n\t\t// Parse curve type whether the user provided a string\n\t\t// Or an object with more options\n\t\tif (curveOptions) {\n\t\t\tif (typeof curveOptions === 'string') {\n\t\t\t\t// curve: 'string'\n\t\t\t\tcurveName = curveOptions as keyof typeof this.curveTypes\n\t\t\t} else {\n\t\t\t\t// curve: { name: 'string' }\n\t\t\t\tcurveName = curveOptions.name\n\t\t\t}\n\t\t}\n\n\t\tif (this.curveTypes[curveName]) {\n\t\t\t// Grab correct d3 curve function\n\t\t\tlet curve = this.curveTypes[curveName] as any\n\n\t\t\t// Apply user-provided options to the d3 curve\n\t\t\tif (curveOptions) {\n\t\t\t\tObject.keys(curveOptions).forEach((optionName) => {\n\t\t\t\t\tif (curve[optionName]) {\n\t\t\t\t\t\tcurve = curve[optionName](curveOptions[optionName])\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\n\t\t\treturn curve\n\t\t}\n\n\t\tconsole.warn(`The curve type '${curveName}' is invalid, using 'curveLinear' instead`)\n\t\treturn this.curveTypes['curveLinear']\n\t}\n}\n","import { extent } from 'd3'\nimport { getProperty } from '@/tools'\nimport { zoomBar as zoomBarConfigs } from '@/configuration'\nimport { AxisPositions, Events, ScaleTypes } from '@/interfaces/enums'\nimport { Service } from './service'\n\nimport type { ChartModelCartesian } from '../model'\n\nexport class Zoom extends Service {\n\tprotected model: ChartModelCartesian\n\n\tisZoomBarEnabled() {\n\t\t// CartesianScales service is only available in axis charts\n\t\tif (!this.services.cartesianScales) {\n\t\t\treturn false\n\t\t}\n\n\t\t// @todo - need to update this if zoom bar in other position (bottom, left, right) is supported\n\t\t// check configuration\n\t\tif (!getProperty(this.model.getOptions(), 'zoomBar', 'top', 'enabled')) {\n\t\t\treturn false\n\t\t}\n\n\t\t// @todo - Zoom Bar only supports main axis at BOTTOM axis and time scale for now\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes() // need to do this before getMainXAxisPosition()\n\t\tconst mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition()\n\t\tconst mainXScaleType = getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'axes',\n\t\t\tmainXAxisPosition,\n\t\t\t'scaleType'\n\t\t)\n\n\t\treturn mainXAxisPosition === AxisPositions.BOTTOM && mainXScaleType === ScaleTypes.TIME\n\t}\n\n\t// get display data for zoom bar\n\t// basically it's sum of value grouped by time\n\tgetZoomBarData() {\n\t\tconst customZoomBarData = this.model.getZoomBarData()\n\n\t\t// if user already defines zoom bar data, use it\n\t\tif (customZoomBarData && customZoomBarData.length > 1) {\n\t\t\treturn customZoomBarData\n\t\t} else {\n\t\t\t// use displayData if not defined\n\t\t\treturn this.model.getDisplayData()\n\t\t}\n\t}\n\n\tgetDefaultZoomBarDomain(zoomBarData?: any) {\n\t\tif (!this.services.zoom) throw new Error('Services zoom not defined')\n\t\tconst allZoomBarData = zoomBarData || this.services.zoom.getZoomBarData()\n\t\tconst { cartesianScales } = this.services\n\t\tif (!cartesianScales) throw new Error('Services cartesianScales undefined')\n\t\tconst mainXAxisPosition = cartesianScales.getMainXAxisPosition()\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\n\t\tconst customDomain = getProperty(this.model.getOptions(), 'axes', mainXAxisPosition, 'domain')\n\n\t\t// return custom domain if exists && valid\n\t\tif (Array.isArray(customDomain) && customDomain.length === 2) {\n\t\t\treturn customDomain\n\t\t}\n\n\t\t// default to full range with extended domain\n\t\tif (!mainXAxisPosition) throw new Error('Not defined: mainXAxisPosition')\n\t\treturn cartesianScales.extendsDomain(\n\t\t\tmainXAxisPosition,\n\t\t\textent(allZoomBarData, (d: any) => d[domainIdentifier])\n\t\t)\n\t}\n\n\thandleDomainChange(newDomain: any, configs = { dispatchEvent: true }) {\n\t\tthis.model.set({ zoomDomain: newDomain }, { animate: false })\n\t\tif (configs.dispatchEvent) {\n\t\t\tthis.services.events?.dispatchEvent(Events.ZoomDomain.CHANGE, {\n\t\t\t\tnewDomain\n\t\t\t})\n\t\t}\n\t}\n\n\tgetZoomRatio() {\n\t\treturn getProperty(this.model.getOptions(), 'zoomBar', 'zoomRatio')\n\t}\n\n\t// filter out data not inside zoom domain\n\t// to get better range value for axis label\n\tfilterDataForRangeAxis(displayData: object[], configs?: any) {\n\t\tconst zoomDomain = this.model.get('zoomDomain')\n\t\tconst mergedConfigs = Object.assign(\n\t\t\t{ stacked: false }, // default configs\n\t\t\tconfigs\n\t\t)\n\t\tconst shouldUpdateRangeAxis = getProperty(this.model.getOptions(), 'zoomBar', 'updateRangeAxis')\n\t\tif (this.isZoomBarEnabled() && shouldUpdateRangeAxis && zoomDomain) {\n\t\t\tconst domainIdentifier = mergedConfigs.stacked\n\t\t\t\t? 'sharedStackKey'\n\t\t\t\t: this.services.cartesianScales?.getDomainIdentifier()\n\t\t\tconst filteredData = displayData.filter(\n\t\t\t\t(datum: any) =>\n\t\t\t\t\tnew Date(datum[domainIdentifier]) >= zoomDomain[0] &&\n\t\t\t\t\tnew Date(datum[domainIdentifier]) <= zoomDomain[1]\n\t\t\t)\n\t\t\t// if no data in zoom domain, use all data to get full range value\n\t\t\t// so only return filteredData if length > 0\n\t\t\tif (filteredData.length > 0) {\n\t\t\t\treturn filteredData\n\t\t\t}\n\t\t}\n\t\t// return original data by default\n\t\treturn displayData\n\t}\n\n\tzoomIn(zoomRatio = this.getZoomRatio()) {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\tconst handleWidth = zoomBarConfigs.handleWidth\n\t\tconst xScale = this.services.cartesianScales?.getMainXScale().copy()\n\t\txScale.domain(this.getDefaultZoomBarDomain()) // reset domain to default full domain\n\n\t\t// use scale range (rather than domain) to calculate\n\t\t// current zoom bar handle x position\n\t\tconst currentX0 = xScale(currentZoomDomain[0])\n\t\tconst currentX1 = xScale(currentZoomDomain[1])\n\n\t\t// zoom bar handles are already too close\n\t\tif (currentX1 - currentX0 < handleWidth + 1) {\n\t\t\treturn\n\t\t}\n\t\tconst fullRange = xScale.range()\n\t\tconst gap = currentX1 - currentX0\n\t\tconst diff = Math.min(((fullRange[1] - fullRange[0]) / 2) * (zoomRatio / 2), gap / 2)\n\n\t\t// new zoom bar handle x position\n\t\tlet newX0 = currentX0 + diff\n\t\tlet newX1 = currentX1 - diff\n\t\t// if left handle becomes right side of right handle, just make them close to each other\n\t\tif (newX0 >= newX1) {\n\t\t\tnewX0 = currentX0 + gap / 2 - handleWidth / 2\n\t\t\tnewX1 = currentX1 - gap / 2 + handleWidth / 2\n\t\t}\n\n\t\tconst newDomain = [xScale.invert(newX0), xScale.invert(newX1)]\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain)\n\t\t}\n\t}\n\n\tzoomOut(zoomRatio = this.getZoomRatio()) {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\n\t\tif (!this.services.cartesianScales) throw new Error('Services cartesianScales undefined')\n\t\tconst xScale = this.services.cartesianScales.getMainXScale().copy()\n\n\t\txScale.domain(this.getDefaultZoomBarDomain()) // reset domain to default full domain\n\n\t\t// use scale range (rather than domain) to calculate\n\t\t// current zoom bar handle x position\n\t\tconst currentX0 = xScale(currentZoomDomain[0])\n\t\tconst currentX1 = xScale(currentZoomDomain[1])\n\n\t\tconst fullRange = xScale.range()\n\t\tconst diff = ((fullRange[1] - fullRange[0]) / 2) * (zoomRatio / 2)\n\n\t\t// new zoom bar handle x position\n\t\t// max to full range\n\t\tconst newX0 = Math.max(currentX0 - diff, fullRange[0])\n\t\tconst newX1 = Math.min(currentX1 + diff, fullRange[1])\n\n\t\tconst newDomain = [xScale.invert(newX0), xScale.invert(newX1)]\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain)\n\t\t}\n\t}\n\n\tresetZoomDomain() {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\tconst newDomain = this.getDefaultZoomBarDomain()\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain)\n\t\t}\n\t}\n\n\t// check if current zoom domain is already the min zoom domain\n\t// when toolbar is rendered, we don't render chart yet\n\t// don't depend on scale range\n\tisMinZoomDomain() {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\t// assume the max zoom domain is the default zoom bar domain\n\t\tconst maxZoomDomain = this.getDefaultZoomBarDomain()\n\t\tif (!currentZoomDomain || !maxZoomDomain) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst currentZoomDomainPeriod = currentZoomDomain[1].valueOf() - currentZoomDomain[0].valueOf()\n\t\tconst maxZoomDomainPeriod = maxZoomDomain[1].valueOf() - maxZoomDomain[0].valueOf()\n\t\tconst minZoomRatio = getProperty(this.model.getOptions(), 'zoomBar', 'minZoomRatio')\n\t\t// if current zoom domain is already smaller than minZoomRatio\n\t\tif (currentZoomDomainPeriod / maxZoomDomainPeriod < minZoomRatio) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\t// check if current zoom domain is already the max zoom domain\n\tisMaxZoomDomain() {\n\t\t// get current zoom domain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\t// assume the max zoom domain is the default zoom bar domain\n\t\tconst maxZoomDomain = this.getDefaultZoomBarDomain()\n\n\t\tif (\n\t\t\tcurrentZoomDomain &&\n\t\t\tmaxZoomDomain &&\n\t\t\tcurrentZoomDomain[0].valueOf() === maxZoomDomain[0].valueOf() &&\n\t\t\tcurrentZoomDomain[1].valueOf() === maxZoomDomain[1].valueOf()\n\t\t) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\tisEmptyState() {\n\t\treturn this.getZoomBarData().length === 0\n\t}\n\n\tisZoomBarLoading(position: any) {\n\t\treturn getProperty(this.model.getOptions(), 'zoomBar', position, 'loading')\n\t}\n\n\tisZoomBarLocked(position: any) {\n\t\treturn getProperty(this.model.getOptions(), 'zoomBar', position, 'locked')\n\t}\n}\n"],"names":["addDays","dirtyDate","dirtyAmount","requiredArgs","date","toDate","amount","toInteger","addMonths","dayOfMonth","endOfDesiredMonth","daysInMonth","MILLISECONDS_IN_HOUR","addHours","addMilliseconds","startOfDay","MILLISECONDS_IN_DAY","differenceInCalendarDays","dirtyDateLeft","dirtyDateRight","startOfDayLeft","startOfDayRight","timestampLeft","getTimezoneOffsetInMilliseconds","timestampRight","MILLISECONDS_IN_MINUTE","addMinutes","addSeconds","addYears","compareAsc","dateLeft","dateRight","diff","millisecondsInMinute","millisecondsInHour","differenceInCalendarMonths","yearDiff","monthDiff","differenceInCalendarYears","compareLocalAsc","differenceInDays","sign","difference","isLastDayNotFull","result","differenceInMilliseconds","roundingMap","value","defaultRoundingMethod","getRoundingMethod","method","differenceInHours","options","differenceInMinutes","endOfDay","endOfMonth","month","isLastDayOfMonth","differenceInMonths","isLastMonthNotFull","differenceInSeconds","differenceInYears","isLastYearNotFull","subDays","subMonths","subHours","subMinutes","subSeconds","subYears","flatten","array","length","baseFlatten","CanvasZoom","Service","focal","canvasElements","zoomSettings","x","y","zoomLevel","settings","canvasZoomSettings","width","height","DOMUtils","Events","select","type","listener","eventType","eventDetail","newEvent","Files","model","services","content","filename","anchor","mimeType","href","uri","name","link","Transitions","_a","t","animate","getProperty","transitionConfigs","CartesianScales","datum","groupMapsTo","axesOptions","dataset","groups","axisOptions","position","domainAxisPosition","rangeAxisPosition","title","AxisPositions","axisPositionKey","axisPosition","verticalAxesPositions","horizontalAxesPositions","domainAndRangeAxesPositions","CartesianOrientations","_b","_c","_d","domain","ScaleTypes","possibleXAxisPositions","possibleYAxisPositions","scale","scaleType","mapsTo","scaledValue","bounds","d","spaceToAddToEdges","addSpacingToTimeDomain","addSpacingToContinuousDomain","axisConfigs","dualAxes","mainVerticalAxisOptions","mainHorizontalAxisOptions","mainVerticalScaleType","mainHorizontalScaleType","includeZero","bins","max","stackKeys","displayData","extendLinearDomainBy","percentage","thresholds","ratioReference","ratioCompareTo","uniq","allDataValues","dataGroupNames","dataValuesGroupedByKeys","nonStackedGroupsData","stackedValues","dataValues","numericalValues","positiveSum","negativeSum","threshold","thresholdValue","extent","scaleTime","scaleLog","scaleBand","scaleLinear","domainScale","highestThreshold","a","b","rangeScale","startDate","endDate","lower","upper","paddingRatio","padding","newUpper","newLower","Curves","curveLinear","curveLinearClosed","curveBasis","curveBasisClosed","curveBasisOpen","curveBundle","curveCardinal","curveCardinalClosed","curveCardinalOpen","curveCatmullRom","curveCatmullRomClosed","curveCatmullRomOpen","curveMonotoneX","curveMonotoneY","curveNatural","curveStep","curveStepAfter","curveStepBefore","curveName","curveOptions","curve","optionName","Zoom","mainXAxisPosition","mainXScaleType","customZoomBarData","zoomBarData","allZoomBarData","cartesianScales","domainIdentifier","customDomain","newDomain","configs","zoomDomain","mergedConfigs","shouldUpdateRangeAxis","filteredData","zoomRatio","currentZoomDomain","handleWidth","zoomBarConfigs","xScale","currentX0","currentX1","fullRange","gap","newX0","newX1","maxZoomDomain","currentZoomDomainPeriod","maxZoomDomainPeriod","minZoomRatio"],"mappings":";;;;AAqBe,SAASA,EAAQC,GAAWC,GAAa;AACtD,EAAAC,EAAa,GAAG,SAAS;AACzB,MAAIC,IAAOC,EAAOJ,CAAS,GACvBK,IAASC,EAAUL,CAAW;AAClC,SAAI,MAAMI,CAAM,IACP,oBAAI,KAAK,GAAG,KAEhBA,KAILF,EAAK,QAAQA,EAAK,QAAS,IAAGE,CAAM,GAC7BF;AACT;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AAgBA,GAAe;AAC9B,WAAOT,EAAY,KAAK,MAAM,WAAc,GAAA,WAAWS,GAAU,QAAQ;AAAA,EAC1E;AACD;","x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29]}
|
|
1
|
+
{"version":3,"file":"index-b0e98af9.mjs","sources":["../../../node_modules/date-fns/esm/addDays/index.js","../../../node_modules/date-fns/esm/addMonths/index.js","../../../node_modules/date-fns/esm/addHours/index.js","../../../node_modules/date-fns/esm/startOfDay/index.js","../../../node_modules/date-fns/esm/differenceInCalendarDays/index.js","../../../node_modules/date-fns/esm/addMinutes/index.js","../../../node_modules/date-fns/esm/addSeconds/index.js","../../../node_modules/date-fns/esm/addYears/index.js","../../../node_modules/date-fns/esm/compareAsc/index.js","../../../node_modules/date-fns/esm/constants/index.js","../../../node_modules/date-fns/esm/differenceInCalendarMonths/index.js","../../../node_modules/date-fns/esm/differenceInCalendarYears/index.js","../../../node_modules/date-fns/esm/differenceInDays/index.js","../../../node_modules/date-fns/esm/differenceInMilliseconds/index.js","../../../node_modules/date-fns/esm/_lib/roundingMethods/index.js","../../../node_modules/date-fns/esm/differenceInHours/index.js","../../../node_modules/date-fns/esm/differenceInMinutes/index.js","../../../node_modules/date-fns/esm/endOfDay/index.js","../../../node_modules/date-fns/esm/endOfMonth/index.js","../../../node_modules/date-fns/esm/isLastDayOfMonth/index.js","../../../node_modules/date-fns/esm/differenceInMonths/index.js","../../../node_modules/date-fns/esm/differenceInSeconds/index.js","../../../node_modules/date-fns/esm/differenceInYears/index.js","../../../node_modules/date-fns/esm/subDays/index.js","../../../node_modules/date-fns/esm/subMonths/index.js","../../../node_modules/date-fns/esm/subHours/index.js","../../../node_modules/date-fns/esm/subMinutes/index.js","../../../node_modules/date-fns/esm/subSeconds/index.js","../../../node_modules/date-fns/esm/subYears/index.js","../../../node_modules/lodash-es/flatten.js","../src/services/canvas-zoom.ts","../src/services/essentials/events.ts","../src/services/essentials/files.ts","../src/services/essentials/transitions.ts","../src/services/scales-cartesian.ts","../src/services/curves.ts","../src/services/zoom.ts"],"sourcesContent":["import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addDays\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} - the new date with the days added\n * @throws {TypeError} - 2 arguments required\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * const result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nexport default function addDays(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n if (!amount) {\n // If 0 days, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n date.setDate(date.getDate() + amount);\n return date;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addMonths\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the months added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * const result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n */\nexport default function addMonths(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var date = toDate(dirtyDate);\n var amount = toInteger(dirtyAmount);\n if (isNaN(amount)) {\n return new Date(NaN);\n }\n if (!amount) {\n // If 0 months, no-op to avoid changing times in the hour before end of DST\n return date;\n }\n var dayOfMonth = date.getDate();\n\n // The JS Date object supports date math by accepting out-of-bounds values for\n // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n // new Date(2020, 13, 1) returns 1 Feb 2021. This is *almost* the behavior we\n // want except that dates will wrap around the end of a month, meaning that\n // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n // we'll default to the end of the desired month by adding 1 to the desired\n // month and using a date of 0 to back up one day to the end of the desired\n // month.\n var endOfDesiredMonth = new Date(date.getTime());\n endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);\n var daysInMonth = endOfDesiredMonth.getDate();\n if (dayOfMonth >= daysInMonth) {\n // If we're already at the end of the month, then this is the correct date\n // and we're done.\n return endOfDesiredMonth;\n } else {\n // Otherwise, we now know that setting the original day-of-month value won't\n // cause an overflow, so set the desired day-of-month. Note that we can't\n // just set the date of `endOfDesiredMonth` because that object may have had\n // its time changed in the unusual case where where a DST transition was on\n // the last day of the month and its local time was in the hour skipped or\n // repeated next to a DST transition. So we use `date` instead which is\n // guaranteed to still have the original time.\n date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);\n return date;\n }\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_HOUR = 3600000;\n\n/**\n * @name addHours\n * @category Hour Helpers\n * @summary Add the specified number of hours to the given date.\n *\n * @description\n * Add the specified number of hours to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of hours to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the hours added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 2 hours to 10 July 2014 23:00:00:\n * const result = addHours(new Date(2014, 6, 10, 23, 0), 2)\n * //=> Fri Jul 11 2014 01:00:00\n */\nexport default function addHours(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_HOUR);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name startOfDay\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the start of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * const result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nexport default function startOfDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setHours(0, 0, 0, 0);\n return date;\n}","import getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport startOfDay from \"../startOfDay/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_DAY = 86400000;\n\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar days\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\nexport default function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var startOfDayLeft = startOfDay(dirtyDateLeft);\n var startOfDayRight = startOfDay(dirtyDateRight);\n var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight);\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_MINUTE = 60000;\n\n/**\n * @name addMinutes\n * @category Minute Helpers\n * @summary Add the specified number of minutes to the given date.\n *\n * @description\n * Add the specified number of minutes to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of minutes to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the minutes added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 30 minutes to 10 July 2014 12:00:00:\n * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 12:30:00\n */\nexport default function addMinutes(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addSeconds\n * @category Second Helpers\n * @summary Add the specified number of seconds to the given date.\n *\n * @description\n * Add the specified number of seconds to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the seconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 30 seconds to 10 July 2014 12:45:00:\n * const result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:45:30\n */\nexport default function addSeconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, amount * 1000);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMonths from \"../addMonths/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addYears\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of years to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the years added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * const result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\nexport default function addYears(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMonths(dirtyDate, amount * 12);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name compareAsc\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @param {Date|Number} dateLeft - the first date to compare\n * @param {Date|Number} dateRight - the second date to compare\n * @returns {Number} the result of the comparison\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * const result = compareAsc(new Date(1987, 1, 11), new Date(1989, 6, 10))\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * const result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\nexport default function compareAsc(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var diff = dateLeft.getTime() - dateRight.getTime();\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1;\n // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}","/**\n * Days in 1 week.\n *\n * @name daysInWeek\n * @constant\n * @type {number}\n * @default\n */\nexport var daysInWeek = 7;\n\n/**\n * Days in 1 year\n * One years equals 365.2425 days according to the formula:\n *\n * > Leap year occures every 4 years, except for years that are divisable by 100 and not divisable by 400.\n * > 1 mean year = (365+1/4-1/100+1/400) days = 365.2425 days\n *\n * @name daysInYear\n * @constant\n * @type {number}\n * @default\n */\nexport var daysInYear = 365.2425;\n\n/**\n * Maximum allowed time.\n *\n * @name maxTime\n * @constant\n * @type {number}\n * @default\n */\nexport var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1000;\n\n/**\n * Milliseconds in 1 minute\n *\n * @name millisecondsInMinute\n * @constant\n * @type {number}\n * @default\n */\nexport var millisecondsInMinute = 60000;\n\n/**\n * Milliseconds in 1 hour\n *\n * @name millisecondsInHour\n * @constant\n * @type {number}\n * @default\n */\nexport var millisecondsInHour = 3600000;\n\n/**\n * Milliseconds in 1 second\n *\n * @name millisecondsInSecond\n * @constant\n * @type {number}\n * @default\n */\nexport var millisecondsInSecond = 1000;\n\n/**\n * Minimum allowed time.\n *\n * @name minTime\n * @constant\n * @type {number}\n * @default\n */\nexport var minTime = -maxTime;\n\n/**\n * Minutes in 1 hour\n *\n * @name minutesInHour\n * @constant\n * @type {number}\n * @default\n */\nexport var minutesInHour = 60;\n\n/**\n * Months in 1 quarter\n *\n * @name monthsInQuarter\n * @constant\n * @type {number}\n * @default\n */\nexport var monthsInQuarter = 3;\n\n/**\n * Months in 1 year\n *\n * @name monthsInYear\n * @constant\n * @type {number}\n * @default\n */\nexport var monthsInYear = 12;\n\n/**\n * Quarters in 1 year\n *\n * @name quartersInYear\n * @constant\n * @type {number}\n * @default\n */\nexport var quartersInYear = 4;\n\n/**\n * Seconds in 1 hour\n *\n * @name secondsInHour\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInHour = 3600;\n\n/**\n * Seconds in 1 minute\n *\n * @name secondsInMinute\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInMinute = 60;\n\n/**\n * Seconds in 1 day\n *\n * @name secondsInDay\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInDay = secondsInHour * 24;\n\n/**\n * Seconds in 1 week\n *\n * @name secondsInWeek\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInWeek = secondsInDay * 7;\n\n/**\n * Seconds in 1 year\n *\n * @name secondsInYear\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInYear = secondsInDay * daysInYear;\n\n/**\n * Seconds in 1 month\n *\n * @name secondsInMonth\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInMonth = secondsInYear / 12;\n\n/**\n * Seconds in 1 quarter\n *\n * @name secondsInQuarter\n * @constant\n * @type {number}\n * @default\n */\nexport var secondsInQuarter = secondsInMonth * 3;","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInCalendarMonths\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar months\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nexport default function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();\n var monthDiff = dateLeft.getMonth() - dateRight.getMonth();\n return yearDiff * 12 + monthDiff;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInCalendarYears\n * @category Year Helpers\n * @summary Get the number of calendar years between the given dates.\n *\n * @description\n * Get the number of calendar years between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar years\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInCalendarYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * )\n * //=> 2\n */\nexport default function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getFullYear() - dateRight.getFullYear();\n}","import toDate from \"../toDate/index.js\";\nimport differenceInCalendarDays from \"../differenceInCalendarDays/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\"; // Like `compareAsc` but uses local time not UTC, which is needed\n// for accurate equality comparisons of UTC timestamps that end up\n// having the same representation in local time, e.g. one hour before\n// DST ends vs. the instant that DST ends.\nfunction compareLocalAsc(dateLeft, dateRight) {\n var diff = dateLeft.getFullYear() - dateRight.getFullYear() || dateLeft.getMonth() - dateRight.getMonth() || dateLeft.getDate() - dateRight.getDate() || dateLeft.getHours() - dateRight.getHours() || dateLeft.getMinutes() - dateRight.getMinutes() || dateLeft.getSeconds() - dateRight.getSeconds() || dateLeft.getMilliseconds() - dateRight.getMilliseconds();\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1;\n // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}\n\n/**\n * @name differenceInDays\n * @category Day Helpers\n * @summary Get the number of full days between the given dates.\n *\n * @description\n * Get the number of full day periods between two dates. Fractional days are\n * truncated towards zero.\n *\n * One \"full day\" is the distance between a local time in one day to the same\n * local time on the next or previous day. A full day can sometimes be less than\n * or more than 24 hours if a daylight savings change happens between two dates.\n *\n * To ignore DST and only measure exact 24-hour periods, use this instead:\n * `Math.floor(differenceInHours(dateLeft, dateRight)/24)|0`.\n *\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full days according to the local timezone\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 365\n * // How many full days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 0\n * // How many full days are between\n * // 1 March 2020 0:00 and 1 June 2020 0:00 ?\n * // Note: because local time is used, the\n * // result will always be 92 days, even in\n * // time zones where DST starts and the\n * // period has only 92*24-1 hours.\n * const result = differenceInDays(\n * new Date(2020, 5, 1),\n * new Date(2020, 2, 1)\n * )\n//=> 92\n */\nexport default function differenceInDays(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareLocalAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight));\n dateLeft.setDate(dateLeft.getDate() - sign * difference);\n\n // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full\n // If so, result must be decreased by 1 in absolute value\n var isLastDayNotFull = Number(compareLocalAsc(dateLeft, dateRight) === -sign);\n var result = sign * (difference - isLastDayNotFull);\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInMilliseconds\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of milliseconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * const result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nexport default function differenceInMilliseconds(dateLeft, dateRight) {\n requiredArgs(2, arguments);\n return toDate(dateLeft).getTime() - toDate(dateRight).getTime();\n}","var roundingMap = {\n ceil: Math.ceil,\n round: Math.round,\n floor: Math.floor,\n trunc: function trunc(value) {\n return value < 0 ? Math.ceil(value) : Math.floor(value);\n } // Math.trunc is not supported by IE\n};\n\nvar defaultRoundingMethod = 'trunc';\nexport function getRoundingMethod(method) {\n return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];\n}","import { millisecondsInHour } from \"../constants/index.js\";\nimport differenceInMilliseconds from \"../differenceInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { getRoundingMethod } from \"../_lib/roundingMethods/index.js\";\n/**\n * @name differenceInHours\n * @category Hour Helpers\n * @summary Get the number of hours between the given dates.\n *\n * @description\n * Get the number of hours between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @param {Object} [options] - an object with options.\n * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)\n * @returns {Number} the number of hours\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?\n * const result = differenceInHours(\n * new Date(2014, 6, 2, 19, 0),\n * new Date(2014, 6, 2, 6, 50)\n * )\n * //=> 12\n */\nexport default function differenceInHours(dateLeft, dateRight, options) {\n requiredArgs(2, arguments);\n var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour;\n return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);\n}","import { millisecondsInMinute } from \"../constants/index.js\";\nimport differenceInMilliseconds from \"../differenceInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { getRoundingMethod } from \"../_lib/roundingMethods/index.js\";\n/**\n * @name differenceInMinutes\n * @category Minute Helpers\n * @summary Get the number of minutes between the given dates.\n *\n * @description\n * Get the signed number of full (rounded towards 0) minutes between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @param {Object} [options] - an object with options.\n * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)\n * @returns {Number} the number of minutes\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?\n * const result = differenceInMinutes(\n * new Date(2014, 6, 2, 12, 20, 0),\n * new Date(2014, 6, 2, 12, 7, 59)\n * )\n * //=> 12\n *\n * @example\n * // How many minutes are between 10:01:59 and 10:00:00\n * const result = differenceInMinutes(\n * new Date(2000, 0, 1, 10, 0, 0),\n * new Date(2000, 0, 1, 10, 1, 59)\n * )\n * //=> -1\n */\nexport default function differenceInMinutes(dateLeft, dateRight, options) {\n requiredArgs(2, arguments);\n var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;\n return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfDay\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a day\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * const result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\nexport default function endOfDay(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name endOfMonth\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|Number} date - the original date\n * @returns {Date} the end of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * const result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nexport default function endOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var month = date.getMonth();\n date.setFullYear(date.getFullYear(), month + 1, 0);\n date.setHours(23, 59, 59, 999);\n return date;\n}","import toDate from \"../toDate/index.js\";\nimport endOfDay from \"../endOfDay/index.js\";\nimport endOfMonth from \"../endOfMonth/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name isLastDayOfMonth\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * @param {Date|Number} date - the date to check\n * @returns {Boolean} the date is the last day of a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * const result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\nexport default function isLastDayOfMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n return endOfDay(date).getTime() === endOfMonth(date).getTime();\n}","import toDate from \"../toDate/index.js\";\nimport differenceInCalendarMonths from \"../differenceInCalendarMonths/index.js\";\nimport compareAsc from \"../compareAsc/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport isLastDayOfMonth from \"../isLastDayOfMonth/index.js\";\n/**\n * @name differenceInMonths\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @description\n * Get the number of full months between the given dates using trunc as a default rounding method.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full months\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * const result = differenceInMonths(new Date(2014, 8, 1), new Date(2014, 0, 31))\n * //=> 7\n */\nexport default function differenceInMonths(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight));\n var result;\n\n // Check for the difference of less than month\n if (difference < 1) {\n result = 0;\n } else {\n if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) {\n // This will check if the date is end of Feb and assign a higher end of month date\n // to compare it with Jan\n dateLeft.setDate(30);\n }\n dateLeft.setMonth(dateLeft.getMonth() - sign * difference);\n\n // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full\n // If so, result must be decreased by 1 in absolute value\n var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign;\n\n // Check for cases of one full calendar month\n if (isLastDayOfMonth(toDate(dirtyDateLeft)) && difference === 1 && compareAsc(dirtyDateLeft, dateRight) === 1) {\n isLastMonthNotFull = false;\n }\n result = sign * (difference - Number(isLastMonthNotFull));\n }\n\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}","import differenceInMilliseconds from \"../differenceInMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport { getRoundingMethod } from \"../_lib/roundingMethods/index.js\";\n/**\n * @name differenceInSeconds\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @param {Object} [options] - an object with options.\n * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)\n * @returns {Number} the number of seconds\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * const result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nexport default function differenceInSeconds(dateLeft, dateRight, options) {\n requiredArgs(2, arguments);\n var diff = differenceInMilliseconds(dateLeft, dateRight) / 1000;\n return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);\n}","import toDate from \"../toDate/index.js\";\nimport differenceInCalendarYears from \"../differenceInCalendarYears/index.js\";\nimport compareAsc from \"../compareAsc/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInYears\n * @category Year Helpers\n * @summary Get the number of full years between the given dates.\n *\n * @description\n * Get the number of full years between the given dates.\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full years\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))\n * //=> 1\n */\nexport default function differenceInYears(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight));\n\n // Set both dates to a valid leap year for accurate comparison when dealing\n // with leap days\n dateLeft.setFullYear(1584);\n dateRight.setFullYear(1584);\n\n // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full\n // If so, result must be decreased by 1 in absolute value\n var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign;\n var result = sign * (difference - Number(isLastYearNotFull));\n // Prevent negative zero\n return result === 0 ? 0 : result;\n}","import addDays from \"../addDays/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n/**\n * @name subDays\n * @category Day Helpers\n * @summary Subtract the specified number of days from the given date.\n *\n * @description\n * Subtract the specified number of days from the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the days subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 10 days from 1 September 2014:\n * const result = subDays(new Date(2014, 8, 1), 10)\n * //=> Fri Aug 22 2014 00:00:00\n */\nexport default function subDays(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addDays(dirtyDate, -amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMonths from \"../addMonths/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subMonths\n * @category Month Helpers\n * @summary Subtract the specified number of months from the given date.\n *\n * @description\n * Subtract the specified number of months from the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the months subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 5 months from 1 February 2015:\n * const result = subMonths(new Date(2015, 1, 1), 5)\n * //=> Mon Sep 01 2014 00:00:00\n */\nexport default function subMonths(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMonths(dirtyDate, -amount);\n}","import addHours from \"../addHours/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n/**\n * @name subHours\n * @category Hour Helpers\n * @summary Subtract the specified number of hours from the given date.\n *\n * @description\n * Subtract the specified number of hours from the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of hours to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the hours subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 2 hours from 11 July 2014 01:00:00:\n * const result = subHours(new Date(2014, 6, 11, 1, 0), 2)\n * //=> Thu Jul 10 2014 23:00:00\n */\nexport default function subHours(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addHours(dirtyDate, -amount);\n}","import addMinutes from \"../addMinutes/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\n/**\n * @name subMinutes\n * @category Minute Helpers\n * @summary Subtract the specified number of minutes from the given date.\n *\n * @description\n * Subtract the specified number of minutes from the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of minutes to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the minutes subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 30 minutes from 10 July 2014 12:00:00:\n * const result = subMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 11:30:00\n */\nexport default function subMinutes(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMinutes(dirtyDate, -amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addSeconds from \"../addSeconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subSeconds\n * @category Second Helpers\n * @summary Subtract the specified number of seconds from the given date.\n *\n * @description\n * Subtract the specified number of seconds from the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of seconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the seconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 30 seconds from 10 July 2014 12:45:00:\n * const result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:44:30\n */\nexport default function subSeconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addSeconds(dirtyDate, -amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addYears from \"../addYears/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subYears\n * @category Year Helpers\n * @summary Subtract the specified number of years from the given date.\n *\n * @description\n * Subtract the specified number of years from the given date.\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of years to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the years subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 5 years from 1 September 2014:\n * const result = subYears(new Date(2014, 8, 1), 5)\n * //=> Tue Sep 01 2009 00:00:00\n */\nexport default function subYears(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addYears(dirtyDate, -amount);\n}","import baseFlatten from './_baseFlatten.js';\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nexport default flatten;\n","import { select } from 'd3'\nimport { Service } from './service'\nimport { Events } from '@/interfaces/enums'\nimport { canvasZoomSettings } from '@/configuration'\nimport { DOMUtils } from '@/services/essentials/dom-utils'\n\nexport class CanvasZoom extends Service {\n\tprotected model: any\n\n\t/**\n\t * focal: object to zoom into\n\t * canvasElements: all the elements to translate and zoom on the chart area\n\t * zoomSettings: object containing duration, easing and zoomlevel for the zoom behaviours\n\t * */\n\tzoomIn(focal: any, canvasElements: any, zoomSettings?: any) {\n\t\tlet x: number\n\t\tlet y: number\n\t\tlet zoomLevel: number\n\t\tconst settings = zoomSettings ? zoomSettings : canvasZoomSettings\n\n\t\tif (focal) {\n\t\t\tx = focal.x\n\t\t\ty = focal.y\n\t\t\tzoomLevel = 2\n\t\t}\n\n\t\t// the 'viewport' size of the chart\n\t\tconst { width, height } = DOMUtils.getSVGElementSize(this.services.domUtils.getHolder(), {\n\t\t\tuseClientDimensions: true\n\t\t})\n\n\t\tcanvasElements\n\t\t\t.transition()\n\t\t\t.duration(settings.duration)\n\t\t\t.ease(settings.ease)\n\t\t\t.attr(\n\t\t\t\t'transform',\n\t\t\t\t`translate(${width / 2}, ${height / 2}) scale(${zoomLevel}) translate(${-x},${-y})`\n\t\t\t)\n\n\t\t// Dispatch canvas zoom in event\n\t\tthis.services.events.dispatchEvent(Events.CanvasZoom.CANVAS_ZOOM_IN, {\n\t\t\telement: select(focal)\n\t\t})\n\t}\n\n\tzoomOut(canvasElements: any, zoomSettings?: any) {\n\t\tconst settings = zoomSettings ? zoomSettings : canvasZoomSettings\n\t\tcanvasElements\n\t\t\t.transition()\n\t\t\t.duration(settings.duration)\n\t\t\t.ease(settings.ease)\n\t\t\t.attr('transform', '')\n\n\t\t// Dispatch canvas zoom out event\n\t\tthis.services.events.dispatchEvent(Events.CanvasZoom.CANVAS_ZOOM_OUT)\n\t}\n}\n","import { Service } from '@/services/service'\n\nexport class Events extends Service {\n\t// DOM Event target\n\tdocumentFragment: DocumentFragment\n\n\tinit() {\n\t\t// Setup the event fragment on the DOM\n\t\tthis.documentFragment = document.createDocumentFragment()\n\t}\n\n\taddEventListener(type: string, listener: EventListenerOrEventListenerObject) {\n\t\tthis.documentFragment.addEventListener(type, listener)\n\t}\n\n\tremoveEventListener(type: string, listener: EventListenerOrEventListenerObject) {\n\t\tthis.documentFragment.removeEventListener(type, listener)\n\t}\n\n\tdispatchEvent(eventType: string, eventDetail?: object) {\n\t\tlet newEvent: any\n\t\tif (eventDetail) {\n\t\t\tnewEvent = new CustomEvent(eventType, {\n\t\t\t\tdetail: eventDetail\n\t\t\t})\n\t\t} else {\n\t\t\tnewEvent = document.createEvent('Event')\n\t\t\tnewEvent.initEvent(eventType, false, true)\n\t\t}\n\n\t\tthis.documentFragment.dispatchEvent(newEvent)\n\t}\n}\n","import { Service } from '@/services/service'\nimport { ChartModel } from '@/model/model'\n\nexport class Files extends Service {\n\tconstructor(model: ChartModel, services: any) {\n\t\tsuper(model, services)\n\t}\n\n\tdownloadCSV(content: any, filename: string) {\n\t\tconst anchor = document.createElement('a')\n\t\tconst mimeType = 'text/csv;encoding:utf-8'\n\n\t\tif (navigator['msSaveBlob']) {\n\t\t\t// Internet Explorer 10\n\t\t\tnavigator['msSaveBlob'](\n\t\t\t\tnew Blob([content], {\n\t\t\t\t\ttype: mimeType\n\t\t\t\t}),\n\t\t\t\tfilename\n\t\t\t)\n\t\t} else if (URL && 'download' in anchor) {\n\t\t\t// HTML5\n\t\t\tconst href = URL.createObjectURL(\n\t\t\t\tnew Blob([content], {\n\t\t\t\t\ttype: mimeType\n\t\t\t\t})\n\t\t\t)\n\t\t\tanchor.href = href\n\t\t\tanchor.setAttribute('download', filename)\n\n\t\t\t// Add anchor to body\n\t\t\tdocument.body.appendChild(anchor)\n\n\t\t\t// Click anchor\n\t\t\tanchor.click()\n\n\t\t\t// Remove anchor from body\n\t\t\tdocument.body.removeChild(anchor)\n\t\t\tURL.revokeObjectURL(href)\n\t\t} else {\n\t\t\tlocation.href = `data:application/octet-stream,${encodeURIComponent(content)}`\n\t\t}\n\t}\n\n\tdownloadImage(uri: string, name: string) {\n\t\tconst link = document.createElement('a')\n\t\tlink.download = name\n\t\tlink.href = uri\n\t\tdocument.body.appendChild(link)\n\t\tlink.click()\n\t\tdocument.body.removeChild(link)\n\t}\n}\n","import { getProperty } from '@/tools'\nimport { transitions as transitionConfigs } from '@/configuration'\nimport { Service } from '@/services/service'\nimport { Events } from '@/interfaces/enums'\nimport type { Transition } from 'd3'\n\nexport interface setupTransitionConfigs {\n\ttransition?: any // d3 types are causing issues here, hence why using `any`\n\tname?: string\n\tanimate?: boolean\n}\n\nexport class Transitions extends Service {\n\tpendingTransitions: Record<number, Transition<any, any, any, any>> = {}\n\n\tinit() {\n\t\tthis.services.events?.addEventListener(Events.Model.UPDATE, () => {\n\t\t\tthis.pendingTransitions = {}\n\t\t})\n\t}\n\n\tsetupTransition({ transition: t, name, animate }: setupTransitionConfigs) {\n\t\tthis.pendingTransitions[t._id] = t\n\t\tt.on('end interrupt cancel', () => {\n\t\t\tdelete this.pendingTransitions[t._id]\n\t\t})\n\n\t\tif (this.model.getOptions().animations === false || animate === false) {\n\t\t\treturn t.duration(0)\n\t\t}\n\n\t\treturn t.duration(getProperty(transitionConfigs, name, 'duration') || transitionConfigs.default.duration)\n\t}\n\n\tgetPendingTransitions() {\n\t\treturn this.pendingTransitions\n\t}\n}\n","import { extent, max, scaleBand, scaleLinear, scaleTime, scaleLog, type ScaleTime, type ScaleBand, type ScaleLinear } from 'd3'\nimport {\n\tdifferenceInYears,\n\taddYears,\n\tsubYears,\n\tdifferenceInMonths,\n\taddMonths,\n\tsubMonths,\n\tdifferenceInDays,\n\taddDays,\n\tsubDays,\n\tdifferenceInHours,\n\taddHours,\n\tsubHours,\n\tdifferenceInMinutes,\n\taddMinutes,\n\tsubMinutes,\n\tdifferenceInSeconds,\n\tsubSeconds,\n\taddSeconds\n} from 'date-fns'\nimport { flatten, uniq } from 'lodash-es'\nimport { getProperty } from '@/tools'\nimport { axis as axisConfigs } from '@/configuration'\nimport { Service } from './service'\nimport { AxisPositions, CartesianOrientations, ScaleTypes } from '@/interfaces/enums'\nimport { ThresholdOptions } from '@/interfaces/components'\n\nexport type ScaleFunction = ScaleTime<number, number, never> | ScaleBand<string> | ScaleLinear<number, number, never>\n\nexport class CartesianScales extends Service {\n\tprotected scaleTypes = {\n\t\ttop: null as ScaleTypes,\n\t\tright: null as ScaleTypes,\n\t\tbottom: null as ScaleTypes,\n\t\tleft: null as ScaleTypes\n\t}\n\n\tprotected scales = { // null or function\n\t\ttop: null as ScaleLinear<number, number, never>,\n\t\tright: null as ScaleLinear<number, number, never>,\n\t\tbottom: null as ScaleLinear<number, number, never>,\n\t\tleft: null as ScaleLinear<number, number, never>\n\t}\n\n\tprotected domainAxisPosition: AxisPositions\n\tprotected rangeAxisPosition: AxisPositions\n\tprotected secondaryDomainAxisPosition: AxisPositions\n\tprotected secondaryRangeAxisPosition: AxisPositions\n\n\tprotected dualAxes: boolean\n\n\tprotected orientation: CartesianOrientations\n\n\tgetDomainAxisPosition({ datum = null }: { datum?: any } = {}) {\n\t\tif (this.dualAxes && datum) {\n\t\t\tconst options = this.model.getOptions()\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst axesOptions = getProperty(options, 'axes', this.secondaryDomainAxisPosition)\n\t\t\tconst dataset = datum[groupMapsTo]\n\t\t\tif (\n\t\t\t\taxesOptions?.correspondingDatasets &&\n\t\t\t\taxesOptions.correspondingDatasets.includes(dataset)\n\t\t\t) {\n\t\t\t\treturn this.secondaryDomainAxisPosition\n\t\t\t}\n\t\t}\n\t\treturn this.domainAxisPosition\n\t}\n\n\tgetRangeAxisPosition({ datum = null, groups = null }: { datum?: any, groups?: any } = {}) {\n\t\tif (this.dualAxes) {\n\t\t\tconst options = this.model.getOptions()\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst axisOptions = getProperty(options, 'axes', this.secondaryRangeAxisPosition)\n\t\t\tlet dataset\n\t\t\tif (datum !== null) {\n\t\t\t\tdataset = datum[groupMapsTo]\n\t\t\t} else if (groups && groups.length > 0) {\n\t\t\t\tdataset = groups[0]\n\t\t\t}\n\t\t\tif (\n\t\t\t\taxisOptions?.correspondingDatasets &&\n\t\t\t\taxisOptions.correspondingDatasets.includes(dataset)\n\t\t\t) {\n\t\t\t\treturn this.secondaryRangeAxisPosition\n\t\t\t}\n\t\t}\n\t\treturn this.rangeAxisPosition\n\t}\n\n\tgetAxisOptions(position: AxisPositions) {\n\t\treturn getProperty(this.model.getOptions(), 'axes', position)\n\t}\n\n\tgetDomainAxisOptions() {\n\t\tconst domainAxisPosition = this.getDomainAxisPosition()\n\t\treturn this.getAxisOptions(domainAxisPosition)\n\t}\n\n\tgetRangeAxisOptions() {\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition()\n\t\treturn this.getAxisOptions(rangeAxisPosition)\n\t}\n\n\tgetScaleLabel(position: AxisPositions) {\n\t\tconst axisOptions = this.getAxisOptions(position)\n\t\tconst title: string = axisOptions.title\n\t\tif (!title) {\n\t\t\tif (position === AxisPositions.BOTTOM || position === AxisPositions.TOP) {\n\t\t\t\treturn 'x-value'\n\t\t\t}\n\t\t\treturn 'y-value'\n\t\t}\n\t\treturn title\n\t}\n\n\tgetDomainLabel() {\n\t\treturn this.getScaleLabel(this.getDomainAxisPosition())\n\t}\n\n\tgetRangeLabel() {\n\t\treturn this.getScaleLabel(this.getRangeAxisPosition())\n\t}\n\n\tupdate() {\n\t\tthis.determineAxisDuality()\n\t\tthis.findDomainAndRangeAxes()\n\t\tthis.determineOrientation()\n\t\tconst axisPositions: AxisPositions[] = Object.keys(AxisPositions).map(\n\t\t\t(axisPositionKey: string) => AxisPositions[axisPositionKey as keyof typeof AxisPositions]\n\t\t)\n\t\taxisPositions.forEach((axisPosition) => {\n\t\t\tthis.scales[axisPosition] = this.createScale(axisPosition) as ScaleLinear<number, number, never>\n\t\t})\n\t}\n\n\tfindDomainAndRangeAxes() {\n\t\t// find main axes between (left & right) && (bottom & top)\n\t\tconst verticalAxesPositions = this.findVerticalAxesPositions()\n\t\tconst horizontalAxesPositions = this.findHorizontalAxesPositions()\n\n\t\t// Now we have horizontal & vertical main axes to choose domain & range axes from\n\t\tconst domainAndRangeAxesPositions = this.findDomainAndRangeAxesPositions(\n\t\t\tverticalAxesPositions,\n\t\t\thorizontalAxesPositions\n\t\t)\n\n\t\tthis.domainAxisPosition = domainAndRangeAxesPositions.primaryDomainAxisPosition\n\t\tthis.rangeAxisPosition = domainAndRangeAxesPositions.primaryRangeAxisPosition\n\n\t\tif (this.isDualAxes()) {\n\t\t\tthis.secondaryDomainAxisPosition = domainAndRangeAxesPositions.secondaryDomainAxisPosition\n\t\t\tthis.secondaryRangeAxisPosition = domainAndRangeAxesPositions.secondaryRangeAxisPosition\n\t\t}\n\t}\n\n\tdetermineOrientation() {\n\t\tif (\n\t\t\t(this.rangeAxisPosition === AxisPositions.LEFT ||\n\t\t\t\tthis.rangeAxisPosition === AxisPositions.RIGHT) &&\n\t\t\t(this.domainAxisPosition === AxisPositions.BOTTOM ||\n\t\t\t\tthis.domainAxisPosition === AxisPositions.TOP)\n\t\t) {\n\t\t\tthis.orientation = CartesianOrientations.VERTICAL\n\t\t} else {\n\t\t\tthis.orientation = CartesianOrientations.HORIZONTAL\n\t\t}\n\t}\n\n\tisDualAxes() {\n\t\treturn this.dualAxes\n\t}\n\n\t// if any of the axes objects have correspondingDatasets [] asserted we flag the chart as dual axes\n\t// it does not count as dual axes if it just has another axis turned on but is not actually using it to map a dataset\n\tdetermineAxisDuality() {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\n\t\tif (\n\t\t\t(axesOptions[AxisPositions.LEFT]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.RIGHT]) ||\n\t\t\t(axesOptions[AxisPositions.RIGHT]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.LEFT]) ||\n\t\t\t(axesOptions[AxisPositions.TOP]?.correspondingDatasets &&\n\t\t\t\taxesOptions[AxisPositions.BOTTOM]) ||\n\t\t\t(axesOptions[AxisPositions.BOTTOM]?.correspondingDatasets && axesOptions[AxisPositions.TOP])\n\t\t) {\n\t\t\tthis.dualAxes = true\n\t\t}\n\t}\n\n\tgetCustomDomainValuesByposition(axisPosition: AxisPositions) {\n\t\tconst domain = getProperty(this.model.getOptions(), 'axes', axisPosition, 'domain')\n\n\t\t// Check if domain is an array\n\t\tif (domain && !Array.isArray(domain)) {\n\t\t\tthrow new Error(`Domain in ${axisPosition} axis is not a valid array`)\n\t\t}\n\n\t\t// Determine number of elements passed in domain depending on scale types\n\t\tif (Array.isArray(domain)) {\n\t\t\tif (\n\t\t\t\t(this.scaleTypes[axisPosition] === ScaleTypes.LINEAR ||\n\t\t\t\t\tthis.scaleTypes[axisPosition] === ScaleTypes.TIME) &&\n\t\t\t\tdomain.length !== 2\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`There can only be 2 elements in domain for scale type: ${this.scaleTypes[axisPosition]}`\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\treturn domain\n\t}\n\n\tgetOrientation() {\n\t\treturn this.orientation\n\t}\n\n\tgetScaleByPosition(axisPosition: AxisPositions) {\n\t\treturn this.scales[axisPosition]\n\t}\n\n\tgetScaleTypeByPosition(axisPosition: AxisPositions) {\n\t\treturn this.scaleTypes[axisPosition]\n\t}\n\n\tgetDomainAxisScaleType() {\n\t\tconst domainAxisPosition = this.getDomainAxisPosition()\n\t\treturn this.getScaleTypeByPosition(domainAxisPosition)\n\t}\n\n\tgetRangeAxisScaleType() {\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition()\n\t\treturn this.getScaleTypeByPosition(rangeAxisPosition)\n\t}\n\n\tgetDomainScale() {\n\t\treturn this.scales[this.domainAxisPosition]\n\t}\n\n\tgetRangeScale() {\n\t\treturn this.scales[this.rangeAxisPosition]\n\t}\n\n\t// Find the main x-axis out of the 2 x-axis on the chart (when 2D axis is used)\n\tgetMainXAxisPosition() {\n\t\tconst possibleXAxisPositions = [AxisPositions.BOTTOM, AxisPositions.TOP]\n\n\t\treturn [this.domainAxisPosition, this.rangeAxisPosition].find(\n\t\t\t(position) => possibleXAxisPositions.indexOf(position) > -1\n\t\t)\n\t}\n\n\t// Find the main y-axis out of the 2 y-axis on the chart (when 2D axis is used)\n\tgetMainYAxisPosition() {\n\t\tconst possibleYAxisPositions = [AxisPositions.LEFT, AxisPositions.RIGHT]\n\n\t\treturn [this.domainAxisPosition, this.rangeAxisPosition].find(\n\t\t\t(position) => possibleYAxisPositions.indexOf(position) > -1\n\t\t)\n\t}\n\n\tgetMainXScale() {\n\t\treturn this.scales[this.getMainXAxisPosition()]\n\t}\n\n\tgetMainYScale() {\n\t\treturn this.scales[this.getMainYAxisPosition()]\n\t}\n\n\tgetValueFromScale(scale: any, scaleType: ScaleTypes, axisPosition: AxisPositions, datum: any) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst axisOptions = axesOptions[axisPosition]\n\t\tconst { mapsTo } = axisOptions\n\t\tconst value = getProperty(datum, mapsTo) !== null ? datum[mapsTo] : datum\n\t\tlet scaledValue: number\n\t\tswitch (scaleType) {\n\t\t\tcase ScaleTypes.LABELS:\n\t\t\t\tscaledValue = scale(value) + scale.step() / 2\n\t\t\t\tbreak\n\t\t\tcase ScaleTypes.TIME:\n\t\t\t\tscaledValue = scale(new Date(value))\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tscaledValue = scale(value)\n\t\t}\n\t\treturn scaledValue\n\t}\n\n\tgetBoundedScaledValues(datum: any): number[] {\n\t\tconst { bounds } = this.model.getOptions()\n\t\tconst axisPosition = this.getRangeAxisPosition({ datum })\n\t\tconst scale = this.scales[axisPosition]\n\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst axisOptions = axesOptions[axisPosition]\n\t\tconst { mapsTo } = axisOptions\n\t\tconst value = datum[mapsTo] !== undefined ? datum[mapsTo] : datum\n\n\t\tconst boundedValues = [\n\t\t\tscale(\n\t\t\t\tgetProperty(datum, bounds.upperBoundMapsTo) !== null\n\t\t\t\t\t? datum[bounds.upperBoundMapsTo]\n\t\t\t\t\t: value\n\t\t\t),\n\t\t\tscale(\n\t\t\t\tgetProperty(datum, bounds.lowerBoundMapsTo) !== null\n\t\t\t\t\t? datum[bounds.lowerBoundMapsTo]\n\t\t\t\t\t: value\n\t\t\t)\n\t\t]\n\n\t\treturn boundedValues\n\t}\n\n\tgetValueThroughAxisPosition(axisPosition: AxisPositions, datum: any) {\n\t\tconst scaleType = this.scaleTypes[axisPosition] as ScaleTypes\n\t\tconst scale = this.scales[axisPosition]\n\n\t\treturn this.getValueFromScale(scale, scaleType, axisPosition, datum)\n\t}\n\n\tgetDomainValue(d: string | object) {\n\t\tconst axisPosition = this.getDomainAxisPosition({ datum: d })\n\t\treturn this.getValueThroughAxisPosition(axisPosition, d)\n\t}\n\n\tgetRangeValue(d: number | string | object) {\n\t\tconst axisPosition = this.getRangeAxisPosition({ datum: d })\n\t\treturn this.getValueThroughAxisPosition(axisPosition, d)\n\t}\n\n\tgetMainXScaleType() {\n\t\treturn this.getScaleTypeByPosition(this.getMainXAxisPosition())\n\t}\n\n\tgetMainYScaleType() {\n\t\treturn this.getScaleTypeByPosition(this.getMainYAxisPosition())\n\t}\n\n\tgetDomainIdentifier(datum?: any) {\n\t\tconst options = this.model.getOptions()\n\t\treturn getProperty(options, 'axes', this.getDomainAxisPosition({ datum: datum }), 'mapsTo')\n\t}\n\n\tgetRangeIdentifier(datum?: any) {\n\t\tconst options = this.model.getOptions()\n\t\treturn getProperty(options, 'axes', this.getRangeAxisPosition({ datum: datum }), 'mapsTo')\n\t}\n\n\textendsDomain(axisPosition: AxisPositions, domain: any) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\t\tif (axisOptions.scaleType === ScaleTypes.TIME) {\n\t\t\tconst spaceToAddToEdges = getProperty(options, 'timeScale', 'addSpaceOnEdges')\n\t\t\treturn addSpacingToTimeDomain(domain, spaceToAddToEdges)\n\t\t} else {\n\t\t\treturn addSpacingToContinuousDomain(domain, axisConfigs.paddingRatio, axisOptions.scaleType)\n\t\t}\n\t}\n\n\tprotected findVerticalAxesPositions() {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst dualAxes = this.isDualAxes()\n\n\t\t// If right axis has been specified as `main`\n\t\tif (\n\t\t\t(getProperty(axesOptions, AxisPositions.LEFT) === null &&\n\t\t\t\tgetProperty(axesOptions, AxisPositions.RIGHT) !== null) ||\n\t\t\tgetProperty(axesOptions, AxisPositions.RIGHT, 'main') === true ||\n\t\t\t(dualAxes && getProperty(axesOptions, AxisPositions.LEFT, 'correspondingDatasets'))\n\t\t) {\n\t\t\treturn {\n\t\t\t\tprimary: AxisPositions.RIGHT,\n\t\t\t\tsecondary: AxisPositions.LEFT\n\t\t\t}\n\t\t}\n\n\t\treturn { primary: AxisPositions.LEFT, secondary: AxisPositions.RIGHT }\n\t}\n\n\tprotected findHorizontalAxesPositions() {\n\t\tconst options = this.model.getOptions()\n\t\tconst axesOptions = getProperty(options, 'axes')\n\t\tconst dualAxes = this.isDualAxes()\n\n\t\t// If top axis has been specified as `main`\n\t\tif (\n\t\t\t(getProperty(axesOptions, AxisPositions.BOTTOM) === null &&\n\t\t\t\tgetProperty(axesOptions, AxisPositions.TOP) !== null) ||\n\t\t\tgetProperty(axesOptions, AxisPositions.TOP, 'main') === true ||\n\t\t\t(dualAxes && getProperty(axesOptions, AxisPositions.BOTTOM, 'correspondingDatasets'))\n\t\t) {\n\t\t\treturn {\n\t\t\t\tprimary: AxisPositions.TOP,\n\t\t\t\tsecondary: AxisPositions.BOTTOM\n\t\t\t}\n\t\t}\n\n\t\treturn { primary: AxisPositions.BOTTOM, secondary: AxisPositions.TOP }\n\t}\n\n\tprotected findDomainAndRangeAxesPositions(\n\t\tverticalAxesPositions: any,\n\t\thorizontalAxesPositions: any\n\t) {\n\t\tconst options = this.model.getOptions()\n\n\t\tconst mainVerticalAxisOptions = getProperty(options, 'axes', verticalAxesPositions.primary)\n\t\tconst mainHorizontalAxisOptions = getProperty(options, 'axes', horizontalAxesPositions.primary)\n\n\t\tconst mainVerticalScaleType = mainVerticalAxisOptions.scaleType || ScaleTypes.LINEAR\n\t\tconst mainHorizontalScaleType = mainHorizontalAxisOptions.scaleType || ScaleTypes.LINEAR\n\n\t\tconst result = {\n\t\t\tprimaryDomainAxisPosition: null as AxisPositions,\n\t\t\tsecondaryDomainAxisPosition: null as AxisPositions,\n\t\t\tprimaryRangeAxisPosition: null as AxisPositions,\n\t\t\tsecondaryRangeAxisPosition: null as AxisPositions\n\t\t}\n\n\t\t// assign to to be a vertical chart by default\n\t\tresult.primaryDomainAxisPosition = horizontalAxesPositions.primary\n\t\tresult.primaryRangeAxisPosition = verticalAxesPositions.primary\n\t\t// secondary axes\n\t\tresult.secondaryDomainAxisPosition = horizontalAxesPositions.secondary\n\t\tresult.secondaryRangeAxisPosition = verticalAxesPositions.secondary\n\n\t\t// if neither the horizontal axes are label or time\n\t\t// and atleast one of the main vertical ones are labels or time then it should be horizontal\n\t\tif (\n\t\t\t(!(\n\t\t\t\tmainHorizontalScaleType === ScaleTypes.LABELS || mainHorizontalScaleType === ScaleTypes.TIME\n\t\t\t) &&\n\t\t\t\tmainVerticalScaleType === ScaleTypes.LABELS) ||\n\t\t\tmainVerticalScaleType === ScaleTypes.TIME\n\t\t) {\n\t\t\tresult.primaryDomainAxisPosition = verticalAxesPositions.primary\n\t\t\tresult.primaryRangeAxisPosition = horizontalAxesPositions.primary\n\t\t\t// secondary axes\n\t\t\tresult.secondaryDomainAxisPosition = verticalAxesPositions.secondary\n\t\t\tresult.secondaryRangeAxisPosition = horizontalAxesPositions.secondary\n\t\t}\n\n\t\treturn result\n\t}\n\n\tgetScaleDomain(axisPosition: AxisPositions) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\t\tconst bounds = getProperty(options, 'bounds')\n\t\tconst { includeZero } = axisOptions\n\t\tconst scaleType = getProperty(axisOptions, 'scaleType') || ScaleTypes.LINEAR\n\n\t\tif (this.model.isDataEmpty()) {\n\t\t\treturn []\n\t\t}\n\n\t\tif (axisOptions.binned) {\n\t\t\tconst { bins } = this.model.getBinConfigurations()\n\n\t\t\treturn [0, max(bins, (d: any) => d.length)]\n\t\t} else if (axisOptions.limitDomainToBins) {\n\t\t\tconst { bins } = this.model.getBinConfigurations()\n\t\t\tconst stackKeys = this.model.getStackKeys({ bins })\n\n\t\t\treturn [stackKeys[0].split('-')[0], stackKeys[stackKeys.length - 1].split('-')[1]]\n\t\t}\n\n\t\tconst displayData = this.model.getDisplayData()\n\t\tconst { extendLinearDomainBy, mapsTo, percentage, thresholds } = axisOptions\n\t\tconst { reference: ratioReference, compareTo: ratioCompareTo } = axisConfigs.ratio\n\n\t\t// If domain is specified return that domain\n\t\tif (axisOptions.domain) {\n\t\t\tif (scaleType === ScaleTypes.LABELS) {\n\t\t\t\treturn axisOptions.domain\n\t\t\t} else if (scaleType === ScaleTypes.TIME) {\n\t\t\t\taxisOptions.domain = axisOptions.domain.map((d: any) =>\n\t\t\t\t\td.getTime === undefined ? new Date(d) : d\n\t\t\t\t)\n\t\t\t}\n\t\t\treturn this.extendsDomain(axisPosition, axisOptions.domain)\n\t\t}\n\n\t\t// Return [0, 100] for percentage axis scale\n\t\tif (percentage) {\n\t\t\treturn [0, 100]\n\t\t}\n\n\t\t// If scale is a LABELS scale, return some labels as the domain\n\t\tif (axisOptions && scaleType === ScaleTypes.LABELS) {\n\t\t\t// Get unique values\n\t\t\treturn uniq(displayData.map((d: any) => d[mapsTo]))\n\t\t}\n\n\t\t// Get the extent of the domain\n\t\tlet domain: any\n\t\tlet allDataValues: any\n\t\tconst dataGroupNames = this.model.getDataGroupNames()\n\n\t\tif (scaleType === ScaleTypes.LABELS_RATIO) {\n\t\t\treturn displayData.map((datum: any) => `${datum[ratioReference]}/${datum[ratioCompareTo]}`)\n\t\t} else if (scaleType === ScaleTypes.TIME) {\n\t\t\tallDataValues = displayData.map((datum: any) => +new Date(datum[mapsTo]))\n\t\t} else if (bounds && options.axes) {\n\t\t\tallDataValues = []\n\n\t\t\tdisplayData.forEach((datum: any) => {\n\t\t\t\tallDataValues.push(datum[mapsTo])\n\n\t\t\t\tif (datum[bounds.upperBoundMapsTo]) {\n\t\t\t\t\tallDataValues.push(datum[bounds.upperBoundMapsTo])\n\t\t\t\t}\n\t\t\t\tif (datum[bounds.lowerBoundMapsTo]) {\n\t\t\t\t\tallDataValues.push(datum[bounds.lowerBoundMapsTo])\n\t\t\t\t}\n\t\t\t})\n\t\t} else if (\n\t\t\taxisOptions.stacked === true &&\n\t\t\tdataGroupNames &&\n\t\t\taxisPosition === this.getRangeAxisPosition()\n\t\t) {\n\t\t\tconst { groupMapsTo } = options.data\n\t\t\tconst dataValuesGroupedByKeys = this.model.getDataValuesGroupedByKeys({\n\t\t\t\tgroups: dataGroupNames\n\t\t\t})\n\t\t\tconst nonStackedGroupsData = displayData.filter(\n\t\t\t\t(datum: any) => !dataGroupNames.includes(datum[groupMapsTo])\n\t\t\t)\n\n\t\t\tconst stackedValues: any[] = []\n\t\t\tdataValuesGroupedByKeys.forEach((dataValues: any) => {\n\t\t\t\tconst { ...numericalValues } = dataValues\n\n\t\t\t\tlet positiveSum = 0,\n\t\t\t\t\tnegativeSum = 0\n\t\t\t\tObject.values(numericalValues).forEach((value: number) => {\n\t\t\t\t\tif (!isNaN(value)) {\n\t\t\t\t\t\tif (value < 0) {\n\t\t\t\t\t\t\tnegativeSum += value\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpositiveSum += value\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\tstackedValues.push([negativeSum, positiveSum])\n\t\t\t})\n\n\t\t\tallDataValues = [\n\t\t\t\t...flatten(stackedValues),\n\t\t\t\t...nonStackedGroupsData.map((datum: any) => datum[mapsTo])\n\t\t\t]\n\t\t} else {\n\t\t\tallDataValues = []\n\n\t\t\tdisplayData.forEach((datum: any) => {\n\t\t\t\tconst value = datum[mapsTo]\n\t\t\t\tif (Array.isArray(value) && value.length === 2) {\n\t\t\t\t\tallDataValues.push(value[0])\n\t\t\t\t\tallDataValues.push(value[1])\n\t\t\t\t} else {\n\t\t\t\t\tif (extendLinearDomainBy) {\n\t\t\t\t\t\tallDataValues.push(Math.max(datum[mapsTo], datum[extendLinearDomainBy]))\n\t\t\t\t\t}\n\t\t\t\t\tallDataValues.push(value)\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\n\t\t// Time can never be 0 and log of base 0 is -Infinity\n\t\tif (scaleType !== ScaleTypes.TIME && scaleType !== ScaleTypes.LOG && includeZero) {\n\t\t\tallDataValues.push(0)\n\t\t}\n\n\t\t// Add threshold values into the scale\n\t\tif (thresholds && thresholds.length > 0) {\n\t\t\tthresholds.forEach((threshold: any) => {\n\t\t\t\tconst thresholdValue = getProperty(threshold, 'value')\n\t\t\t\tif (thresholdValue !== null) allDataValues.push(thresholdValue)\n\t\t\t})\n\t\t}\n\n\t\tdomain = extent(allDataValues)\n\t\tdomain = this.extendsDomain(axisPosition, domain)\n\n\t\treturn domain\n\t}\n\n\tprotected createScale(axisPosition: AxisPositions) {\n\t\tconst options = this.model.getOptions()\n\t\tconst axisOptions = getProperty(options, 'axes', axisPosition)\n\n\t\tif (!axisOptions) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst scaleType = getProperty(axisOptions, 'scaleType') || ScaleTypes.LINEAR\n\t\tthis.scaleTypes[axisPosition] = scaleType\n\n\t\tlet scale: ScaleFunction\n\t\tif (scaleType === ScaleTypes.TIME) {\n\t\t\tscale = scaleTime()\n\t\t} else if (scaleType === ScaleTypes.LOG) {\n\t\t\tscale = scaleLog().base(axisOptions.base || 10)\n\t\t} else if (scaleType === ScaleTypes.LABELS || scaleType === ScaleTypes.LABELS_RATIO) {\n\t\t\tscale = scaleBand()\n\t\t} else {\n\t\t\tscale = scaleLinear()\n\t\t}\n\n\t\tscale.domain(this.getScaleDomain(axisPosition))\n\n\t\treturn scale\n\t}\n\n\tgetHighestDomainThreshold(): null | {\n\t\tthreshold: ThresholdOptions\n\t\tscaleValue: number\n\t} {\n\t\tconst axesOptions = getProperty(this.model.getOptions(), 'axes')\n\t\tconst domainAxisPosition = this.getDomainAxisPosition()\n\n\t\tconst { thresholds } = axesOptions[domainAxisPosition]\n\n\t\t// Check if thresholds exist & is not empty\n\t\tif (!Array.isArray(thresholds) || (Array.isArray(thresholds) && !thresholds.length)) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst domainScale = this.getDomainScale()\n\t\t// Find the highest threshold for the domain\n\t\tconst highestThreshold = thresholds.sort((a, b) => b.value - a.value)[0]\n\n\t\tconst scaleType = this.getScaleTypeByPosition(domainAxisPosition)\n\t\tif (\n\t\t\tscaleType === ScaleTypes.TIME &&\n\t\t\t(typeof highestThreshold.value === 'string' || highestThreshold.value.getTime === undefined)\n\t\t) {\n\t\t\thighestThreshold.value = new Date(highestThreshold.value)\n\t\t}\n\n\t\treturn {\n\t\t\tthreshold: highestThreshold,\n\t\t\tscaleValue: domainScale(highestThreshold.value)\n\t\t}\n\t}\n\n\tgetHighestRangeThreshold(): null | {\n\t\tthreshold: ThresholdOptions\n\t\tscaleValue: number\n\t} {\n\t\tconst axesOptions = getProperty(this.model.getOptions(), 'axes')\n\t\tconst rangeAxisPosition = this.getRangeAxisPosition()\n\n\t\tconst { thresholds } = axesOptions[rangeAxisPosition]\n\n\t\t// Check if thresholds exist & is not empty\n\t\tif (!Array.isArray(thresholds) || (Array.isArray(thresholds) && !thresholds.length)) {\n\t\t\treturn null\n\t\t}\n\n\t\tconst rangeScale = this.getRangeScale()\n\t\t// Find the highest threshold for the range\n\t\tconst highestThreshold = thresholds.sort((a, b) => b.value - a.value)[0]\n\n\t\treturn {\n\t\t\tthreshold: highestThreshold,\n\t\t\tscaleValue: rangeScale(highestThreshold.value)\n\t\t}\n\t}\n}\n\nfunction addSpacingToTimeDomain(domain: any, spaceToAddToEdges: number) {\n\tconst startDate = new Date(domain[0])\n\tconst endDate = new Date(domain[1])\n\n\tif (differenceInYears(endDate, startDate) > 1) {\n\t\treturn [subYears(startDate, spaceToAddToEdges), addYears(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInMonths(endDate, startDate) > 1) {\n\t\treturn [subMonths(startDate, spaceToAddToEdges), addMonths(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInDays(endDate, startDate) > 1) {\n\t\treturn [subDays(startDate, spaceToAddToEdges), addDays(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInHours(endDate, startDate) > 1) {\n\t\treturn [subHours(startDate, spaceToAddToEdges), addHours(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInMinutes(endDate, startDate) > 30) {\n\t\treturn [\n\t\t\tsubMinutes(startDate, spaceToAddToEdges * 30),\n\t\t\taddMinutes(endDate, spaceToAddToEdges * 30)\n\t\t]\n\t}\n\n\tif (differenceInMinutes(endDate, startDate) > 1) {\n\t\treturn [subMinutes(startDate, spaceToAddToEdges), addMinutes(endDate, spaceToAddToEdges)]\n\t}\n\n\tif (differenceInSeconds(endDate, startDate) > 15) {\n\t\treturn [\n\t\t\tsubSeconds(startDate, spaceToAddToEdges * 15),\n\t\t\taddSeconds(endDate, spaceToAddToEdges * 15)\n\t\t]\n\t}\n\n\tif (differenceInSeconds(endDate, startDate) > 1) {\n\t\treturn [subSeconds(startDate, spaceToAddToEdges), addSeconds(endDate, spaceToAddToEdges)]\n\t}\n\n\treturn [startDate, endDate]\n}\n\nfunction addSpacingToContinuousDomain(\n\t[lower, upper]: number[],\n\tpaddingRatio: number,\n\tscaleType?: ScaleTypes\n) {\n\tconst domainLength = upper - lower\n\tconst padding = domainLength * paddingRatio\n\n\t// If padding crosses 0, keep 0 as new upper bound\n\tconst newUpper = upper <= 0 && upper + padding > 0 ? 0 : upper + padding\n\t// If padding crosses 0, keep 0 as new lower bound\n\tlet newLower = lower >= 0 && lower - padding < 0 ? 0 : lower - padding\n\n\t// Log of base 0 or a negative number is -Infinity\n\tif (scaleType === ScaleTypes.LOG && newLower <= 0) {\n\t\tif (lower <= 0) {\n\t\t\tthrow Error('Data must have values greater than 0 if log scale type is used.')\n\t\t}\n\t\tnewLower = lower\n\t}\n\n\treturn [newLower, newUpper]\n}\n","import {\n\tcurveBasis,\n\tcurveBasisClosed,\n\tcurveBasisOpen,\n\tcurveBundle,\n\tcurveCardinal,\n\tcurveCardinalClosed,\n\tcurveCardinalOpen,\n\tcurveCatmullRom,\n\tcurveCatmullRomClosed,\n\tcurveCatmullRomOpen,\n\tcurveLinear,\n\tcurveLinearClosed,\n\tcurveMonotoneX,\n\tcurveMonotoneY,\n\tcurveNatural,\n\tcurveStep,\n\tcurveStepAfter,\n\tcurveStepBefore\n} from 'd3'\nimport { Service } from './service'\n\nexport class Curves extends Service {\n\tcurveTypes = {\n\t\tcurveLinear,\n\t\tcurveLinearClosed,\n\t\tcurveBasis,\n\t\tcurveBasisClosed,\n\t\tcurveBasisOpen,\n\t\tcurveBundle,\n\t\tcurveCardinal,\n\t\tcurveCardinalClosed,\n\t\tcurveCardinalOpen,\n\t\tcurveCatmullRom,\n\t\tcurveCatmullRomClosed,\n\t\tcurveCatmullRomOpen,\n\t\tcurveMonotoneX,\n\t\tcurveMonotoneY,\n\t\tcurveNatural,\n\t\tcurveStep,\n\t\tcurveStepAfter,\n\t\tcurveStepBefore\n\t}\n\n\tgetD3Curve() {\n\t\tlet curveName = 'curveLinear' as keyof typeof this.curveTypes\n\t\tconst curveOptions = this.model.getOptions().curve\n\n\t\t// Parse curve type whether the user provided a string\n\t\t// Or an object with more options\n\t\tif (curveOptions) {\n\t\t\tif (typeof curveOptions === 'string') {\n\t\t\t\t// curve: 'string'\n\t\t\t\tcurveName = curveOptions as keyof typeof this.curveTypes\n\t\t\t} else {\n\t\t\t\t// curve: { name: 'string' }\n\t\t\t\tcurveName = curveOptions.name\n\t\t\t}\n\t\t}\n\n\t\tif (this.curveTypes[curveName]) {\n\t\t\t// Grab correct d3 curve function\n\t\t\tlet curve = this.curveTypes[curveName] as any\n\n\t\t\t// Apply user-provided options to the d3 curve\n\t\t\tif (curveOptions) {\n\t\t\t\tObject.keys(curveOptions).forEach((optionName) => {\n\t\t\t\t\tif (curve[optionName]) {\n\t\t\t\t\t\tcurve = curve[optionName](curveOptions[optionName])\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t}\n\n\t\t\treturn curve\n\t\t}\n\n\t\tconsole.warn(`The curve type '${curveName}' is invalid, using 'curveLinear' instead`)\n\t\treturn this.curveTypes['curveLinear']\n\t}\n}\n","import { extent } from 'd3'\nimport { getProperty } from '@/tools'\nimport { zoomBar as zoomBarConfigs } from '@/configuration'\nimport { AxisPositions, Events, ScaleTypes } from '@/interfaces/enums'\nimport { Service } from './service'\n\nimport type { ChartModelCartesian } from '../model'\n\nexport class Zoom extends Service {\n\tprotected model: ChartModelCartesian\n\n\tisZoomBarEnabled() {\n\t\t// CartesianScales service is only available in axis charts\n\t\tif (!this.services.cartesianScales) {\n\t\t\treturn false\n\t\t}\n\n\t\t// @todo - need to update this if zoom bar in other position (bottom, left, right) is supported\n\t\t// check configuration\n\t\tif (!getProperty(this.model.getOptions(), 'zoomBar', 'top', 'enabled')) {\n\t\t\treturn false\n\t\t}\n\n\t\t// @todo - Zoom Bar only supports main axis at BOTTOM axis and time scale for now\n\t\tthis.services.cartesianScales.findDomainAndRangeAxes() // need to do this before getMainXAxisPosition()\n\t\tconst mainXAxisPosition = this.services.cartesianScales.getMainXAxisPosition()\n\t\tconst mainXScaleType = getProperty(\n\t\t\tthis.model.getOptions(),\n\t\t\t'axes',\n\t\t\tmainXAxisPosition,\n\t\t\t'scaleType'\n\t\t)\n\n\t\treturn mainXAxisPosition === AxisPositions.BOTTOM && mainXScaleType === ScaleTypes.TIME\n\t}\n\n\t// get display data for zoom bar\n\t// basically it's sum of value grouped by time\n\tgetZoomBarData() {\n\t\tconst customZoomBarData = this.model.getZoomBarData()\n\n\t\t// if user already defines zoom bar data, use it\n\t\tif (customZoomBarData && customZoomBarData.length > 1) {\n\t\t\treturn customZoomBarData\n\t\t} else {\n\t\t\t// use displayData if not defined\n\t\t\treturn this.model.getDisplayData()\n\t\t}\n\t}\n\n\tgetDefaultZoomBarDomain(zoomBarData?: any) {\n\t\tif (!this.services.zoom) throw new Error('Services zoom not defined')\n\t\tconst allZoomBarData = zoomBarData || this.services.zoom.getZoomBarData()\n\t\tconst { cartesianScales } = this.services\n\t\tif (!cartesianScales) throw new Error('Services cartesianScales undefined')\n\t\tconst mainXAxisPosition = cartesianScales.getMainXAxisPosition()\n\t\tconst domainIdentifier = cartesianScales.getDomainIdentifier()\n\n\t\tconst customDomain = getProperty(this.model.getOptions(), 'axes', mainXAxisPosition, 'domain')\n\n\t\t// return custom domain if exists && valid\n\t\tif (Array.isArray(customDomain) && customDomain.length === 2) {\n\t\t\treturn customDomain\n\t\t}\n\n\t\t// default to full range with extended domain\n\t\tif (!mainXAxisPosition) throw new Error('Not defined: mainXAxisPosition')\n\t\treturn cartesianScales.extendsDomain(\n\t\t\tmainXAxisPosition,\n\t\t\textent(allZoomBarData, (d: any) => d[domainIdentifier])\n\t\t)\n\t}\n\n\thandleDomainChange(newDomain: any, configs = { dispatchEvent: true }) {\n\t\tthis.model.set({ zoomDomain: newDomain }, { animate: false })\n\t\tif (configs.dispatchEvent) {\n\t\t\tthis.services.events?.dispatchEvent(Events.ZoomDomain.CHANGE, {\n\t\t\t\tnewDomain\n\t\t\t})\n\t\t}\n\t}\n\n\tgetZoomRatio() {\n\t\treturn getProperty(this.model.getOptions(), 'zoomBar', 'zoomRatio')\n\t}\n\n\t// filter out data not inside zoom domain\n\t// to get better range value for axis label\n\tfilterDataForRangeAxis(displayData: object[], configs?: any) {\n\t\tconst zoomDomain = this.model.get('zoomDomain')\n\t\tconst mergedConfigs = Object.assign(\n\t\t\t{ stacked: false }, // default configs\n\t\t\tconfigs\n\t\t)\n\t\tconst shouldUpdateRangeAxis = getProperty(this.model.getOptions(), 'zoomBar', 'updateRangeAxis')\n\t\tif (this.isZoomBarEnabled() && shouldUpdateRangeAxis && zoomDomain) {\n\t\t\tconst domainIdentifier = mergedConfigs.stacked\n\t\t\t\t? 'sharedStackKey'\n\t\t\t\t: this.services.cartesianScales?.getDomainIdentifier()\n\t\t\tconst filteredData = displayData.filter(\n\t\t\t\t(datum: any) =>\n\t\t\t\t\tnew Date(datum[domainIdentifier]) >= zoomDomain[0] &&\n\t\t\t\t\tnew Date(datum[domainIdentifier]) <= zoomDomain[1]\n\t\t\t)\n\t\t\t// if no data in zoom domain, use all data to get full range value\n\t\t\t// so only return filteredData if length > 0\n\t\t\tif (filteredData.length > 0) {\n\t\t\t\treturn filteredData\n\t\t\t}\n\t\t}\n\t\t// return original data by default\n\t\treturn displayData\n\t}\n\n\tzoomIn(zoomRatio = this.getZoomRatio()) {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\tconst handleWidth = zoomBarConfigs.handleWidth\n\t\tconst xScale = this.services.cartesianScales?.getMainXScale().copy()\n\t\txScale.domain(this.getDefaultZoomBarDomain()) // reset domain to default full domain\n\n\t\t// use scale range (rather than domain) to calculate\n\t\t// current zoom bar handle x position\n\t\tconst currentX0 = xScale(currentZoomDomain[0])\n\t\tconst currentX1 = xScale(currentZoomDomain[1])\n\n\t\t// zoom bar handles are already too close\n\t\tif (currentX1 - currentX0 < handleWidth + 1) {\n\t\t\treturn\n\t\t}\n\t\tconst fullRange = xScale.range()\n\t\tconst gap = currentX1 - currentX0\n\t\tconst diff = Math.min(((fullRange[1] - fullRange[0]) / 2) * (zoomRatio / 2), gap / 2)\n\n\t\t// new zoom bar handle x position\n\t\tlet newX0 = currentX0 + diff\n\t\tlet newX1 = currentX1 - diff\n\t\t// if left handle becomes right side of right handle, just make them close to each other\n\t\tif (newX0 >= newX1) {\n\t\t\tnewX0 = currentX0 + gap / 2 - handleWidth / 2\n\t\t\tnewX1 = currentX1 - gap / 2 + handleWidth / 2\n\t\t}\n\n\t\tconst newDomain = [xScale.invert(newX0), xScale.invert(newX1)]\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain)\n\t\t}\n\t}\n\n\tzoomOut(zoomRatio = this.getZoomRatio()) {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\n\t\tif (!this.services.cartesianScales) throw new Error('Services cartesianScales undefined')\n\t\tconst xScale = this.services.cartesianScales.getMainXScale().copy()\n\n\t\txScale.domain(this.getDefaultZoomBarDomain()) // reset domain to default full domain\n\n\t\t// use scale range (rather than domain) to calculate\n\t\t// current zoom bar handle x position\n\t\tconst currentX0 = xScale(currentZoomDomain[0])\n\t\tconst currentX1 = xScale(currentZoomDomain[1])\n\n\t\tconst fullRange = xScale.range()\n\t\tconst diff = ((fullRange[1] - fullRange[0]) / 2) * (zoomRatio / 2)\n\n\t\t// new zoom bar handle x position\n\t\t// max to full range\n\t\tconst newX0 = Math.max(currentX0 - diff, fullRange[0])\n\t\tconst newX1 = Math.min(currentX1 + diff, fullRange[1])\n\n\t\tconst newDomain = [xScale.invert(newX0), xScale.invert(newX1)]\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain)\n\t\t}\n\t}\n\n\tresetZoomDomain() {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\tconst newDomain = this.getDefaultZoomBarDomain()\n\n\t\t// only if zoomDomain needs update\n\t\tif (\n\t\t\tcurrentZoomDomain[0].valueOf() !== newDomain[0].valueOf() ||\n\t\t\tcurrentZoomDomain[1].valueOf() !== newDomain[1].valueOf()\n\t\t) {\n\t\t\tthis.handleDomainChange(newDomain)\n\t\t}\n\t}\n\n\t// check if current zoom domain is already the min zoom domain\n\t// when toolbar is rendered, we don't render chart yet\n\t// don't depend on scale range\n\tisMinZoomDomain() {\n\t\t// get current zoomDomain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\t// assume the max zoom domain is the default zoom bar domain\n\t\tconst maxZoomDomain = this.getDefaultZoomBarDomain()\n\t\tif (!currentZoomDomain || !maxZoomDomain) {\n\t\t\treturn false\n\t\t}\n\n\t\tconst currentZoomDomainPeriod = currentZoomDomain[1].valueOf() - currentZoomDomain[0].valueOf()\n\t\tconst maxZoomDomainPeriod = maxZoomDomain[1].valueOf() - maxZoomDomain[0].valueOf()\n\t\tconst minZoomRatio = getProperty(this.model.getOptions(), 'zoomBar', 'minZoomRatio')\n\t\t// if current zoom domain is already smaller than minZoomRatio\n\t\tif (currentZoomDomainPeriod / maxZoomDomainPeriod < minZoomRatio) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\t// check if current zoom domain is already the max zoom domain\n\tisMaxZoomDomain() {\n\t\t// get current zoom domain\n\t\tconst currentZoomDomain = this.model.get('zoomDomain')\n\t\t// assume the max zoom domain is the default zoom bar domain\n\t\tconst maxZoomDomain = this.getDefaultZoomBarDomain()\n\n\t\tif (\n\t\t\tcurrentZoomDomain &&\n\t\t\tmaxZoomDomain &&\n\t\t\tcurrentZoomDomain[0].valueOf() === maxZoomDomain[0].valueOf() &&\n\t\t\tcurrentZoomDomain[1].valueOf() === maxZoomDomain[1].valueOf()\n\t\t) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\tisEmptyState() {\n\t\treturn this.getZoomBarData().length === 0\n\t}\n\n\tisZoomBarLoading(position: any) {\n\t\treturn getProperty(this.model.getOptions(), 'zoomBar', position, 'loading')\n\t}\n\n\tisZoomBarLocked(position: any) {\n\t\treturn getProperty(this.model.getOptions(), 'zoomBar', position, 'locked')\n\t}\n}\n"],"names":["addDays","dirtyDate","dirtyAmount","requiredArgs","date","toDate","amount","toInteger","addMonths","dayOfMonth","endOfDesiredMonth","daysInMonth","MILLISECONDS_IN_HOUR","addHours","addMilliseconds","startOfDay","MILLISECONDS_IN_DAY","differenceInCalendarDays","dirtyDateLeft","dirtyDateRight","startOfDayLeft","startOfDayRight","timestampLeft","getTimezoneOffsetInMilliseconds","timestampRight","MILLISECONDS_IN_MINUTE","addMinutes","addSeconds","addYears","compareAsc","dateLeft","dateRight","diff","millisecondsInMinute","millisecondsInHour","differenceInCalendarMonths","yearDiff","monthDiff","differenceInCalendarYears","compareLocalAsc","differenceInDays","sign","difference","isLastDayNotFull","result","differenceInMilliseconds","roundingMap","value","defaultRoundingMethod","getRoundingMethod","method","differenceInHours","options","differenceInMinutes","endOfDay","endOfMonth","month","isLastDayOfMonth","differenceInMonths","isLastMonthNotFull","differenceInSeconds","differenceInYears","isLastYearNotFull","subDays","subMonths","subHours","subMinutes","subSeconds","subYears","flatten","array","length","baseFlatten","CanvasZoom","Service","focal","canvasElements","zoomSettings","x","y","zoomLevel","settings","canvasZoomSettings","width","height","DOMUtils","Events","select","type","listener","eventType","eventDetail","newEvent","Files","model","services","content","filename","anchor","mimeType","href","uri","name","link","Transitions","_a","t","animate","getProperty","transitionConfigs","CartesianScales","datum","groupMapsTo","axesOptions","dataset","groups","axisOptions","position","domainAxisPosition","rangeAxisPosition","title","AxisPositions","axisPositionKey","axisPosition","verticalAxesPositions","horizontalAxesPositions","domainAndRangeAxesPositions","CartesianOrientations","_b","_c","_d","domain","ScaleTypes","possibleXAxisPositions","possibleYAxisPositions","scale","scaleType","mapsTo","scaledValue","bounds","d","spaceToAddToEdges","addSpacingToTimeDomain","addSpacingToContinuousDomain","axisConfigs","dualAxes","mainVerticalAxisOptions","mainHorizontalAxisOptions","mainVerticalScaleType","mainHorizontalScaleType","includeZero","bins","max","stackKeys","displayData","extendLinearDomainBy","percentage","thresholds","ratioReference","ratioCompareTo","uniq","allDataValues","dataGroupNames","dataValuesGroupedByKeys","nonStackedGroupsData","stackedValues","dataValues","numericalValues","positiveSum","negativeSum","threshold","thresholdValue","extent","scaleTime","scaleLog","scaleBand","scaleLinear","domainScale","highestThreshold","a","b","rangeScale","startDate","endDate","lower","upper","paddingRatio","padding","newUpper","newLower","Curves","curveLinear","curveLinearClosed","curveBasis","curveBasisClosed","curveBasisOpen","curveBundle","curveCardinal","curveCardinalClosed","curveCardinalOpen","curveCatmullRom","curveCatmullRomClosed","curveCatmullRomOpen","curveMonotoneX","curveMonotoneY","curveNatural","curveStep","curveStepAfter","curveStepBefore","curveName","curveOptions","curve","optionName","Zoom","mainXAxisPosition","mainXScaleType","customZoomBarData","zoomBarData","allZoomBarData","cartesianScales","domainIdentifier","customDomain","newDomain","configs","zoomDomain","mergedConfigs","shouldUpdateRangeAxis","filteredData","zoomRatio","currentZoomDomain","handleWidth","zoomBarConfigs","xScale","currentX0","currentX1","fullRange","gap","newX0","newX1","maxZoomDomain","currentZoomDomainPeriod","maxZoomDomainPeriod","minZoomRatio"],"mappings":";;;;AAqBe,SAASA,EAAQC,GAAWC,GAAa;AACtD,EAAAC,EAAa,GAAG,SAAS;AACzB,MAAIC,IAAOC,EAAOJ,CAAS,GACvBK,IAASC,EAAUL,CAAW;AAClC,SAAI,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