@dpuse/dpuse-tool-d3 0.0.11 → 0.0.12

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billboardJs-DHDJ97w1.js","names":["getMinMax","color","legend","title","tooltip","data","interaction","data","color","interaction","legend","title","tooltip","pointer","setTimeout","clearTimeout","csv","tsv","data","select","select","drag","select","scaleOrdinal","getMinMax","select","namespaces","scaleLinear","scaleSymlog","scaleLog","scaleTime","scaleUtc","select","select","select","point","noop","point","noop","point","noop","noop","curveBasis","curveBasisClosed","curveBasisOpen","curveBundle","curveCardinal","curveCardinalClosed","curveCardinalOpen","curveCatmullRom","curveCatmullRomClosed","curveCatmullRomOpen","curveMonotoneX","curveMonotoneY","curveNatural","curveLinearClosed","curveLinear","curveStep","curveStepAfter","curveStepBefore","select","select","data","select","grid","select","selectAll","namespaces","select","select","select"],"sources":["../node_modules/billboard.js/dist-esm/config/const.js","../node_modules/billboard.js/dist-esm/module/browser.js","../node_modules/billboard.js/dist-esm/module/util/type-checks.js","../node_modules/billboard.js/dist-esm/module/sanitize.js","../node_modules/billboard.js/dist-esm/module/util/object.js","../node_modules/billboard.js/dist-esm/module/error.js","../node_modules/d3-selection/src/selectAll.js","../node_modules/billboard.js/dist-esm/config/classes.js","../node_modules/billboard.js/dist-esm/config/Options/common/boost.js","../node_modules/billboard.js/dist-esm/config/Options/common/color.js","../node_modules/billboard.js/dist-esm/config/Options/common/legend.js","../node_modules/billboard.js/dist-esm/config/Options/common/main.js","../node_modules/billboard.js/dist-esm/config/Options/common/title.js","../node_modules/billboard.js/dist-esm/config/Options/common/tooltip.js","../node_modules/billboard.js/dist-esm/config/Options/data/data.js","../node_modules/billboard.js/dist-esm/config/Options/interaction/interaction.js","../node_modules/billboard.js/dist-esm/config/Options/Options.js","../node_modules/billboard.js/dist-esm/config/Store/Element.js","../node_modules/billboard.js/dist-esm/config/Store/State.js","../node_modules/billboard.js/dist-esm/config/Store/Store.js","../node_modules/billboard.js/dist-esm/module/Cache.js","../node_modules/billboard.js/dist-esm/module/util/dom.js","../node_modules/billboard.js/dist-esm/module/generator.js","../node_modules/billboard.js/dist-esm/module/worker.js","../node_modules/billboard.js/dist-esm/module/dsv.js","../node_modules/billboard.js/dist-esm/ChartInternal/data/convert.helper.js","../node_modules/billboard.js/dist-esm/ChartInternal/data/convert.js","../node_modules/billboard.js/dist-esm/ChartInternal/data/data.js","../node_modules/billboard.js/dist-esm/ChartInternal/data/load.js","../node_modules/billboard.js/dist-esm/ChartInternal/interactions/interaction.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/category.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/class.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/color.js","../node_modules/billboard.js/dist-esm/module/util/brush.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/domain.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/format.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/legend.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/redraw.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/scale.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/size.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/style.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/text.util.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/text.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/title.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/tooltip.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/transform.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/type.js","../node_modules/d3-shape/src/noop.js","../node_modules/d3-shape/src/curve/basis.js","../node_modules/d3-shape/src/curve/basisClosed.js","../node_modules/d3-shape/src/curve/basisOpen.js","../node_modules/d3-shape/src/curve/bundle.js","../node_modules/d3-shape/src/curve/cardinal.js","../node_modules/d3-shape/src/curve/cardinalClosed.js","../node_modules/d3-shape/src/curve/cardinalOpen.js","../node_modules/d3-shape/src/curve/catmullRom.js","../node_modules/d3-shape/src/curve/catmullRomClosed.js","../node_modules/d3-shape/src/curve/catmullRomOpen.js","../node_modules/d3-shape/src/curve/linearClosed.js","../node_modules/d3-shape/src/curve/monotone.js","../node_modules/d3-shape/src/curve/natural.js","../node_modules/d3-shape/src/curve/step.js","../node_modules/billboard.js/dist-esm/ChartInternal/shape/shape.js","../node_modules/billboard.js/dist-esm/ChartInternal/ChartInternal.js","../node_modules/billboard.js/dist-esm/config/config.js","../node_modules/billboard.js/dist-esm/Chart/api/chart.js","../node_modules/billboard.js/dist-esm/Chart/api/color.js","../node_modules/billboard.js/dist-esm/Chart/api/data.js","../node_modules/billboard.js/dist-esm/Chart/api/focus.js","../node_modules/billboard.js/dist-esm/Chart/api/legend.js","../node_modules/billboard.js/dist-esm/Chart/api/load.js","../node_modules/billboard.js/dist-esm/Chart/api/show.js","../node_modules/billboard.js/dist-esm/Chart/api/tooltip.js","../node_modules/billboard.js/dist-esm/Chart/Chart.js","../node_modules/billboard.js/dist-esm/Chart/api/grid.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/grid.js","../node_modules/billboard.js/dist-esm/config/Options/common/grid.js","../node_modules/billboard.js/dist-esm/config/resolver/grid.js","../node_modules/billboard.js/dist-esm/core.js","../node_modules/billboard.js/dist-esm/ChartInternal/shape/core/point.js","../node_modules/billboard.js/dist-esm/config/Options/common/point.js","../node_modules/billboard.js/dist-esm/Chart/api/axis.js","../node_modules/billboard.js/dist-esm/Chart/api/group.js","../node_modules/billboard.js/dist-esm/Chart/api/x.js","../node_modules/billboard.js/dist-esm/ChartInternal/Axis/AxisRendererHelper.js","../node_modules/billboard.js/dist-esm/ChartInternal/Axis/AxisRenderer.js","../node_modules/billboard.js/dist-esm/ChartInternal/Axis/Axis.js","../node_modules/billboard.js/dist-esm/ChartInternal/interactions/eventrect.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/clip.js","../node_modules/billboard.js/dist-esm/ChartInternal/internals/size.axis.js","../node_modules/billboard.js/dist-esm/config/Options/axis/x.js","../node_modules/billboard.js/dist-esm/config/Options/axis/y.js","../node_modules/billboard.js/dist-esm/config/Options/axis/y2.js","../node_modules/billboard.js/dist-esm/config/Options/axis/axis.js","../node_modules/billboard.js/dist-esm/config/Options/data/axis.js","../node_modules/billboard.js/dist-esm/config/resolver/axis.js","../node_modules/billboard.js/dist-esm/config/resolver/axis.core.js","../node_modules/billboard.js/dist-esm/config/resolver/shape/axis.helpers.js","../node_modules/billboard.js/dist-esm/ChartInternal/shape/core/barRadius.js","../node_modules/billboard.js/dist-esm/ChartInternal/shape/bar.js","../node_modules/billboard.js/dist-esm/config/Options/shape/bar.js","../node_modules/billboard.js/dist-esm/config/resolver/shape/bar.js","../src/billboardJs.ts"],"sourcesContent":["/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Chart type constant\n * @private\n */\nconst TYPE = {\n AREA: \"area\",\n AREA_LINE_RANGE: \"area-line-range\",\n AREA_SPLINE: \"area-spline\",\n AREA_SPLINE_RANGE: \"area-spline-range\",\n AREA_STEP: \"area-step\",\n AREA_STEP_RANGE: \"area-step-range\",\n BAR: \"bar\",\n BUBBLE: \"bubble\",\n CANDLESTICK: \"candlestick\",\n DONUT: \"donut\",\n FUNNEL: \"funnel\",\n GAUGE: \"gauge\",\n LINE: \"line\",\n PIE: \"pie\",\n POLAR: \"polar\",\n RADAR: \"radar\",\n SCATTER: \"scatter\",\n SPLINE: \"spline\",\n STEP: \"step\",\n TREEMAP: \"treemap\"\n};\n/**\n * Optional API modules and their resolver module name.\n * Used by checkApiModuleImport() to surface a helpful error when a user calls\n * chart.export() / chart.flow() without importing the matching resolver.\n * @private\n */\nconst API_MODULE_NEEDED = {\n export: \"exportApi\",\n flow: \"flow\",\n xgrids: \"grid\",\n ygrids: \"grid\",\n regions: \"regions\",\n category: \"category\",\n categories: \"category\"\n};\n/**\n * Axis rendering constants shared by SVG and canvas renderers.\n * @private\n */\nconst AXIS_DEFAULT_TICK_COUNT = 10;\nconst AXIS_TICK_SIZE = 6;\nconst AXIS_TICK_PADDING = 3;\nconst AXIS_TICK_LENGTH = AXIS_TICK_SIZE + AXIS_TICK_PADDING;\nconst AXIS_TICK_LINE_OVERLAP_PADDING = 1;\n/**\n * Subchart brush handle path constants shared by SVG and canvas renderers.\n * @private\n */\nconst SUBCHART_BRUSH_HANDLE_PATH = {\n x: {\n start: \"M0 -8.5 A6 6 0 0 0 -6.5 -3.5 V2.5 A6 6 0 0 0 0 8.5 Z M-2 -3.5 V3.5 M-4 -3.5 V3.5z\",\n end: \"M0 -8.5 A6 6 0 0 1 6.5 -3.5 V2.5 A6 6 0 0 1 0 8.5 Z M2 -3.5 V3.5 M4 -3.5 V3.5z\"\n },\n y: {\n start: \"M8.5 0 a6 6 0 0 0 -6 -6.5 H-2.5 a 6 6 0 0 0 -6 6.5 z m-5 -2 H-3.5 m7 -2 H-3.5z\",\n end: \"M8.5 0 a6 -6 0 0 1 -6 6.5 H-2.5 a 6 -6 0 0 1 -6 -6.5z m-5 2 H-3.5 m7 2 H-3.5z\"\n }\n};\n/**\n * Chart type module and its method from ChartInternal class, needed to be initialized.\n * @private\n */\nconst TYPE_METHOD_NEEDED = {\n AREA: \"initArea\",\n AREA_LINE_RANGE: \"initArea\",\n AREA_SPLINE: \"initArea\",\n AREA_SPLINE_RANGE: \"initArea\",\n AREA_STEP: \"initArea\",\n AREA_STEP_RANGE: \"initArea\",\n BAR: \"initBar\",\n BUBBLE: \"initCircle\",\n CANDLESTICK: \"initCandlestick\",\n DONUT: \"initArc\",\n FUNNEL: \"initFunnel\",\n GAUGE: \"initArc\",\n LINE: \"initLine\",\n PIE: \"initArc\",\n POLAR: \"initPolar\",\n RADAR: \"initCircle\",\n SCATTER: \"initCircle\",\n SPLINE: \"initLine\",\n STEP: \"initLine\",\n TREEMAP: \"initTreemap\"\n};\n/**\n * chart types by category\n * @private\n */\nconst TYPE_BY_CATEGORY = {\n Area: [\n TYPE.AREA,\n TYPE.AREA_SPLINE,\n TYPE.AREA_SPLINE_RANGE,\n TYPE.AREA_LINE_RANGE,\n TYPE.AREA_STEP,\n TYPE.AREA_STEP_RANGE\n ],\n AreaRange: [\n TYPE.AREA_SPLINE_RANGE,\n TYPE.AREA_LINE_RANGE,\n TYPE.AREA_STEP_RANGE\n ],\n Arc: [\n TYPE.PIE,\n TYPE.DONUT,\n TYPE.GAUGE,\n TYPE.POLAR,\n TYPE.RADAR\n ],\n Line: [\n TYPE.LINE,\n TYPE.SPLINE,\n TYPE.AREA,\n TYPE.AREA_SPLINE,\n TYPE.AREA_SPLINE_RANGE,\n TYPE.AREA_LINE_RANGE,\n TYPE.STEP,\n TYPE.AREA_STEP,\n TYPE.AREA_STEP_RANGE\n ],\n Step: [\n TYPE.STEP,\n TYPE.AREA_STEP,\n TYPE.AREA_STEP_RANGE\n ],\n Spline: [\n TYPE.SPLINE,\n TYPE.AREA_SPLINE,\n TYPE.AREA_SPLINE_RANGE\n ]\n};\n\nexport { API_MODULE_NEEDED, AXIS_DEFAULT_TICK_COUNT, AXIS_TICK_LENGTH, AXIS_TICK_LINE_OVERLAP_PADDING, AXIS_TICK_PADDING, AXIS_TICK_SIZE, SUBCHART_BRUSH_HANDLE_PATH, TYPE, TYPE_BY_CATEGORY, TYPE_METHOD_NEEDED };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Window object\n * @private\n */\n/* eslint-disable no-new-func, no-undef */\n/**\n * Get global object\n * @returns {object} window object\n * @private\n */\nfunction getGlobal() {\n return (typeof globalThis === \"object\" && globalThis !== null && globalThis.Object === Object &&\n globalThis) ||\n (typeof self === \"object\" && self !== null && self.Object === Object && self) ||\n Function(\"return this\")();\n}\n/**\n * Get fallback object\n * @param {object} w global object\n * @returns {Array} fallback object array\n * @private\n */\nfunction getFallback(w) {\n const hasRAF = typeof w?.requestAnimationFrame === \"function\" &&\n typeof w?.cancelAnimationFrame === \"function\";\n const hasRIC = typeof w?.requestIdleCallback === \"function\" &&\n typeof w?.cancelIdleCallback === \"function\";\n const request = cb => setTimeout(cb, 1);\n const cancel = id => clearTimeout(id);\n return [\n hasRAF ? w.requestAnimationFrame : request,\n hasRAF ? w.cancelAnimationFrame : cancel,\n hasRIC ? w.requestIdleCallback : request,\n hasRIC ? w.cancelIdleCallback : cancel\n ];\n}\nconst win = getGlobal();\nconst doc = win?.document;\nconst [requestAnimationFrame, cancelAnimationFrame, requestIdleCallback, cancelIdleCallback] = getFallback(win);\n\nexport { cancelAnimationFrame, cancelIdleCallback, doc as document, getFallback, requestAnimationFrame, requestIdleCallback, win as window };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n * @ignore\n */\nconst isValue = (v) => v || v === 0;\nconst isFunction = (v) => typeof v === \"function\";\nconst isString = (v) => typeof v === \"string\";\nconst isNumber = (v) => typeof v === \"number\";\nconst isUndefined = (v) => typeof v === \"undefined\";\nconst isDefined = (v) => typeof v !== \"undefined\";\nconst isBoolean = (v) => typeof v === \"boolean\";\nconst ceil10 = (v) => Math.ceil(v / 10) * 10;\nconst asHalfPixel = (n) => Math.ceil(n) + 0.5;\nconst diffDomain = (d) => d[1] - d[0];\nconst isObjectType = (v) => typeof v === \"object\";\nconst isEmptyObject = (obj) => {\n for (const x in obj) {\n return false;\n }\n return true;\n};\nconst isEmpty = (o) => (isUndefined(o) || o === null ||\n (isString(o) && o.length === 0) ||\n (isObjectType(o) && !(o instanceof Date) && isEmptyObject(o)) ||\n (isNumber(o) && isNaN(o)));\nconst notEmpty = (o) => !isEmpty(o);\n/**\n * Check if is array\n * @param {Array} arr Data to be checked\n * @returns {boolean}\n * @private\n */\nconst isArray = (arr) => Array.isArray(arr);\n/**\n * Check if is object\n * @param {object} obj Data to be checked\n * @returns {boolean}\n * @private\n */\nconst isObject = (obj) => obj && !obj?.nodeType && isObjectType(obj) && !isArray(obj);\n\nexport { asHalfPixel, ceil10, diffDomain, isArray, isBoolean, isDefined, isEmpty, isEmptyObject, isFunction, isNumber, isObject, isObjectType, isString, isUndefined, isValue, notEmpty };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n * @ignore\n */\n/**\n * HTML/SVG Sanitization module\n * Pure whitelist approach - only explicitly allowed tags, attributes, and protocols pass through\n */\n// Whitelist of allowed HTML/SVG tags\nconst ALLOWED_TAGS = new Set([\n // HTML tags for tooltip/legend templates\n \"span\",\n \"div\",\n \"p\",\n \"br\",\n \"b\",\n \"i\",\n \"em\",\n \"small\",\n \"strong\",\n \"mark\",\n \"u\",\n \"s\",\n \"sub\",\n \"sup\",\n \"h1\",\n \"h2\",\n \"h3\",\n \"h4\",\n \"h5\",\n \"h6\",\n \"ul\",\n \"ol\",\n \"li\",\n \"dl\",\n \"dt\",\n \"dd\",\n \"table\",\n \"thead\",\n \"tbody\",\n \"tfoot\",\n \"tr\",\n \"th\",\n \"td\",\n \"caption\",\n \"colgroup\",\n \"col\",\n \"hr\",\n \"pre\",\n \"code\",\n \"blockquote\",\n \"abbr\",\n \"ins\",\n \"del\",\n \"a\",\n \"img\",\n \"figure\",\n \"figcaption\",\n // SVG tags for point patterns\n \"svg\",\n \"g\",\n \"path\",\n \"circle\",\n \"ellipse\",\n \"rect\",\n \"line\",\n \"polyline\",\n \"polygon\",\n \"text\",\n \"tspan\",\n \"textPath\",\n \"use\",\n \"defs\",\n \"symbol\",\n \"clipPath\",\n \"mask\",\n \"linearGradient\",\n \"radialGradient\",\n \"stop\",\n \"pattern\",\n \"marker\",\n \"title\",\n \"desc\"\n]);\n// Whitelist of allowed attributes\nconst ALLOWED_ATTRS = new Set([\n // Common attributes\n \"class\",\n \"id\",\n \"style\",\n \"title\",\n \"lang\",\n \"dir\",\n // HTML specific\n \"href\",\n \"src\",\n \"alt\",\n \"width\",\n \"height\",\n \"colspan\",\n \"rowspan\",\n \"scope\",\n \"headers\",\n // SVG presentation attributes\n \"d\",\n \"points\",\n \"x\",\n \"y\",\n \"x1\",\n \"x2\",\n \"y1\",\n \"y2\",\n \"cx\",\n \"cy\",\n \"r\",\n \"rx\",\n \"ry\",\n \"dx\",\n \"dy\",\n \"viewBox\",\n \"preserveAspectRatio\",\n \"transform\",\n \"fill\",\n \"fill-opacity\",\n \"fill-rule\",\n \"stroke\",\n \"stroke-width\",\n \"stroke-opacity\",\n \"stroke-linecap\",\n \"stroke-linejoin\",\n \"stroke-dasharray\",\n \"stroke-dashoffset\",\n \"opacity\",\n \"clip-path\",\n \"clip-rule\",\n \"mask\",\n \"font-family\",\n \"font-size\",\n \"font-weight\",\n \"font-style\",\n \"text-anchor\",\n \"dominant-baseline\",\n \"offset\",\n \"stop-color\",\n \"stop-opacity\",\n \"gradientUnits\",\n \"gradientTransform\",\n \"spreadMethod\",\n \"patternUnits\",\n \"patternTransform\",\n \"marker-start\",\n \"marker-mid\",\n \"marker-end\",\n \"markerWidth\",\n \"markerHeight\",\n \"refX\",\n \"refY\",\n \"xlink:href\"\n]);\n// Case-insensitive lookup maps: lowercase key → canonical casing from whitelists\nconst TAG_CASE_MAP = new Map();\nALLOWED_TAGS.forEach(tag => TAG_CASE_MAP.set(tag.toLowerCase(), tag));\nconst ATTR_CASE_MAP = new Map();\nALLOWED_ATTRS.forEach(attr => ATTR_CASE_MAP.set(attr.toLowerCase(), attr));\n// Whitelist of allowed URI protocols\nconst ALLOWED_URI_PROTOCOLS = new Set([\n \"http:\",\n \"https:\",\n \"mailto:\"\n]);\n// Attributes that contain URIs\nconst URI_ATTRS = new Set([\"href\", \"src\", \"xlink:href\"]);\n// Pre-compiled regex patterns for performance\nconst TAG_NAME_REGEX = /^<\\/?([a-zA-Z][a-zA-Z0-9]*)/;\nconst CLOSING_TAG_REGEX = /^<\\/([a-zA-Z][a-zA-Z0-9]*)\\s*>$/;\nconst OPENING_TAG_REGEX = /^<([a-zA-Z][a-zA-Z0-9]*)([\\s\\S]*?)(\\/?)>$/;\nconst ATTR_REGEX = /([a-zA-Z][\\w:-]*)\\s*(?:=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s>]+)))?/g;\nconst URL_IN_STYLE_REGEX = /url\\s*\\(\\s*[\"']?([^\"')]+)[\"']?\\s*\\)/gi;\n// Dangerous CSS patterns\nconst DANGEROUS_CSS_PATTERNS = [\n \"expression(\",\n \"behavior:\",\n \"binding:\",\n \"@import\",\n \"@charset\",\n \"-moz-binding:\"\n];\n/**\n * Decode HTML entities in a string\n * @param {string} str String with potential HTML entities\n * @returns {string} Decoded string\n * @private\n */\nfunction decodeHTMLEntities(str) {\n return str\n // Named entities\n .replace(/&colon;/gi, \":\")\n .replace(/&newline;/gi, \"\\n\")\n .replace(/&tab;/gi, \"\\t\")\n .replace(/&nbsp;/gi, \" \")\n .replace(/&lt;/gi, \"<\")\n .replace(/&gt;/gi, \">\")\n .replace(/&amp;/gi, \"&\")\n .replace(/&quot;/gi, \"\\\"\")\n .replace(/&apos;/gi, \"'\")\n // Numeric entities (decimal) - trailing semicolon is optional per HTML5 tokenizer\n .replace(/&#(\\d+);?/gi, (_, code) => String.fromCharCode(parseInt(code, 10)))\n // Numeric entities (hex) - trailing semicolon is optional per HTML5 tokenizer\n .replace(/&#x([0-9a-f]+);?/gi, (_, code) => String.fromCharCode(parseInt(code, 16)));\n}\n/**\n * Check if a URI is safe (whitelist approach)\n * @param {string} uri URI to check\n * @returns {boolean} Whether the URI is safe\n * @private\n */\nfunction isSafeURI(uri) {\n // Decode HTML entities first to prevent bypass\n const decoded = decodeHTMLEntities(uri).trim();\n // Remove any whitespace/control characters that could be used for bypass\n // eslint-disable-next-line no-control-regex\n const normalized = decoded.replace(/[\\s\\u0000-\\u001f]/g, \"\").toLowerCase();\n // Empty or fragment-only URIs are safe\n if (!normalized || normalized.startsWith(\"#\")) {\n return true;\n }\n // A ':' appearing before the first '/', '?' or '#' denotes a URI scheme.\n // Reject the value unless that scheme is whitelisted - do NOT infer safety\n // merely from the absence of a literal colon (which could be reconstructed\n // from an alternate encoding once assigned to innerHTML).\n const schemeMatch = normalized.match(/^[^/?#]*:/);\n if (schemeMatch) {\n return ALLOWED_URI_PROTOCOLS.has(schemeMatch[0]);\n }\n // No scheme → relative path / query / fragment only → safe\n return true;\n}\n/**\n * Check if a style value is safe (whitelist approach)\n * @param {string} style Style attribute value\n * @returns {string|null} Sanitized style or null if unsafe\n * @private\n */\nfunction sanitizeStyleValue(style) {\n // Decode HTML entities first\n const decoded = decodeHTMLEntities(style);\n // Remove any control characters\n // eslint-disable-next-line no-control-regex\n const cleaned = decoded.replace(/[\\u0000-\\u001f]/g, \"\");\n // Check for url() - only allow safe URIs inside\n URL_IN_STYLE_REGEX.lastIndex = 0;\n let match;\n while ((match = URL_IN_STYLE_REGEX.exec(cleaned)) !== null) {\n if (!isSafeURI(match[1])) {\n return null;\n }\n }\n // Check for dangerous CSS patterns (expression, behavior, etc.)\n const normalizedLower = cleaned.toLowerCase().replace(/\\s/g, \"\");\n for (const pattern of DANGEROUS_CSS_PATTERNS) {\n if (normalizedLower.includes(pattern)) {\n return null;\n }\n }\n return style;\n}\n// Lookup table for encoding dangerous characters in attribute values\nconst ATTR_ENCODE_MAP = {\n \"\\\"\": \"&quot;\",\n \"'\": \"&#39;\",\n \"`\": \"&#96;\"\n};\nconst ATTR_ENCODE_REGEX = /[\"'`]/g;\n/**\n * Encode dangerous characters in attribute values to HTML entities\n * This prevents attribute injection attacks where quotes/backticks break out of the attribute context\n * @param {string} value Attribute value\n * @returns {string} Encoded value\n * @private\n */\nfunction encodeAttrValue(value) {\n return value.replace(ATTR_ENCODE_REGEX, char => ATTR_ENCODE_MAP[char]);\n}\n/**\n * Sanitize attribute value using whitelist approach\n * @param {string} name Attribute name\n * @param {string} value Attribute value\n * @param {boolean} wasUnquoted Whether the value was originally unquoted\n * @returns {string|null} Sanitized value if safe, null if should be removed\n * @private\n */\nfunction sanitizeAttrValue(name, value, wasUnquoted = false) {\n // Check URI attributes with whitelist\n if (URI_ATTRS.has(name)) {\n if (!isSafeURI(value)) {\n return null;\n }\n // Encode dangerous characters in URI values to prevent attribute injection\n return wasUnquoted ? encodeAttrValue(value) : value;\n }\n // Check style attribute\n if (name === \"style\") {\n const sanitizedStyle = sanitizeStyleValue(value);\n if (sanitizedStyle === null) {\n return null;\n }\n // Encode dangerous characters in style values\n return wasUnquoted ? encodeAttrValue(sanitizedStyle) : sanitizedStyle;\n }\n // For other attributes, check for embedded event handlers\n const decoded = decodeHTMLEntities(value).toLowerCase().replace(/\\s/g, \"\");\n if (/\\bon\\w+=/.test(decoded)) {\n return null;\n }\n // Encode dangerous characters to prevent attribute injection\n return wasUnquoted ? encodeAttrValue(value) : value;\n}\n/**\n * Extract tag name from a tag string\n * Returns null if not a valid tag format\n * @param {string} tag Tag string starting with <\n * @returns {string|null} Lowercase tag name or null\n * @private\n */\nfunction extractTagName(tag) {\n // Must start with < followed immediately by letter (no spaces allowed)\n const match = tag.match(TAG_NAME_REGEX);\n return match ? match[1].toLowerCase() : null;\n}\n/**\n * Check if a tag is in the whitelist\n * @param {string} tag Tag string\n * @returns {boolean} Whether tag is allowed\n * @private\n */\nfunction isAllowedTag(tag) {\n const tagName = extractTagName(tag);\n return tagName !== null && TAG_CASE_MAP.has(tagName);\n}\n/**\n * Sanitize a single HTML/SVG tag (only called for allowed tags)\n * @param {string} fullTag The full tag string including < and >\n * @returns {string} Sanitized tag\n * @private\n */\nfunction sanitizeTag(fullTag) {\n // Closing tag\n const closingMatch = fullTag.match(CLOSING_TAG_REGEX);\n if (closingMatch) {\n const lowerName = closingMatch[1].toLowerCase();\n return `</${TAG_CASE_MAP.get(lowerName) ?? lowerName}>`;\n }\n // Opening tag\n const openingMatch = fullTag.match(OPENING_TAG_REGEX);\n if (!openingMatch) {\n return \"\";\n }\n const [, tagName, attrString, selfClose] = openingMatch;\n const lowerTagName = tagName.toLowerCase();\n const canonicalTagName = TAG_CASE_MAP.get(lowerTagName) ?? lowerTagName;\n // Parse and filter attributes, preserving original quote style\n const allowedAttrs = [];\n ATTR_REGEX.lastIndex = 0;\n let attrMatch;\n while ((attrMatch = ATTR_REGEX.exec(attrString)) !== null) {\n const lowerAttrName = attrMatch[1].toLowerCase();\n const doubleQuotedValue = attrMatch[2];\n const singleQuotedValue = attrMatch[3];\n const unquotedValue = attrMatch[4];\n // Skip event handlers (on*)\n if (lowerAttrName.startsWith(\"on\")) {\n continue;\n }\n const canonicalAttrName = ATTR_CASE_MAP.get(lowerAttrName) ?? lowerAttrName;\n // Determine original quote style and value\n let attrValue;\n let quoteChar;\n if (doubleQuotedValue !== undefined) {\n attrValue = doubleQuotedValue;\n quoteChar = \"\\\"\";\n }\n else if (singleQuotedValue !== undefined) {\n attrValue = singleQuotedValue;\n quoteChar = \"'\";\n }\n else if (unquotedValue !== undefined) {\n attrValue = unquotedValue;\n quoteChar = \"\\\"\";\n }\n else {\n // Boolean attribute (no value)\n if (ATTR_CASE_MAP.has(lowerAttrName)) {\n allowedAttrs.push(canonicalAttrName);\n }\n continue;\n }\n if (ATTR_CASE_MAP.has(lowerAttrName)) {\n const wasUnquoted = unquotedValue !== undefined;\n const sanitizedValue = sanitizeAttrValue(lowerAttrName, attrValue, wasUnquoted);\n if (sanitizedValue !== null) {\n allowedAttrs.push(`${canonicalAttrName}=${quoteChar}${sanitizedValue}${quoteChar}`);\n }\n }\n }\n const attrsStr = allowedAttrs.length > 0 ? ` ${allowedAttrs.join(\" \")}` : \"\";\n const selfCloseStr = selfClose ? \"/>\" : \">\";\n return `<${canonicalTagName}${attrsStr}${selfCloseStr}`;\n}\n/**\n * Sanitize HTML string to prevent XSS attacks\n * Pure whitelist approach - allowed tags are sanitized, others are escaped\n * @param {string} str Target string value\n * @returns {string} Sanitized string with only allowed elements\n * @private\n */\nfunction sanitize(str) {\n if (typeof str !== \"string\" || !str || str.indexOf(\"<\") === -1) {\n return str;\n }\n // Single pass: sanitize allowed tags, escape disallowed ones\n // Also match orphaned fragments like \"ipt>\" from broken tags\n return str.replace(/<\\/?[^>]*>|[^<>\\s]+>/g, match => {\n // Remove HTML comments\n if (match.startsWith(\"<!--\")) {\n return \"\";\n }\n // Orphaned fragment (e.g., \"ipt>\") → escape '>'\n if (!match.startsWith(\"<\")) {\n return match.slice(0, -1) + \"&gt;\";\n }\n // Allowed tag → sanitize attributes\n if (isAllowedTag(match)) {\n return sanitizeTag(match);\n }\n // Disallowed tag → escape all '<' to prevent execution\n return match.replace(/</g, \"&lt;\");\n });\n}\n\nexport { sanitize };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { requestAnimationFrame } from '../browser.js';\nimport { sanitize } from '../sanitize.js';\nimport { isArray, isObject, isDefined, isFunction, isString, isNumber, notEmpty } from './type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n * @ignore\n */\n/**\n * Internal helper to iterate over array items and invoke a callback for each valid item\n * @param {Array} items Array to iterate\n * @param {function} callback Callback function (item, index) => void\n * @private\n */\nfunction _forEachValidItem(items, callback) {\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n if (item !== null && isDefined(item)) {\n callback(item, i);\n }\n }\n}\n/**\n * Get specified key value from object\n * If default value is given, will return if given key value not found\n * @param {object} options Source object\n * @param {string} key Key value\n * @param {string|number|boolean|object|Array|function|null|undefined} defaultValue Default value\n * @returns {string|number|boolean|object|Array|function|null|undefined} Option value or default value\n * @private\n */\nfunction getOption(options, key, defaultValue) {\n return isDefined(options[key]) ? options[key] : defaultValue;\n}\n/**\n * Check if value exist in the given object\n * @param {object} dict Target object to be checked\n * @param {string|number|boolean|object|Array|function|null|undefined} value Value to be checked\n * @returns {boolean}\n * @private\n */\nfunction hasValue(dict, value) {\n for (const key in dict) {\n if (dict[key] === value)\n return true;\n }\n return false;\n}\n/**\n * Call function with arguments\n * @param {function} fn Function to be called\n * @param {object|null|undefined} thisArg \"this\" value for fn\n * @param {...(string|number|boolean|object|Array|function|null|undefined)} args Arguments for fn\n * @returns {boolean} true: fn is function, false: fn is not function\n * @private\n */\nfunction callFn(fn, thisArg, ...args) {\n const isFn = isFunction(fn);\n isFn && fn.call(thisArg, ...args);\n return isFn;\n}\n/**\n * Call function after all transitions ends\n * @param {d3.transition} transition Transition\n * @param {Fucntion} cb Callback function\n * @private\n */\nfunction endall(transition, cb) {\n let n = 0;\n const end = function (...args) {\n !--n && cb.apply(this, args);\n };\n // if is transition selection\n if (\"duration\" in transition) {\n transition\n .each(() => ++n)\n .on(\"end\", end);\n }\n else {\n ++n;\n transition.call(end);\n }\n}\n/**\n * Return first letter capitalized\n * @param {string} str Target string\n * @returns {string} capitalized string\n * @private\n */\nconst capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);\n/**\n * Camelize from kebob style string\n * @param {string} str Target string\n * @param {string} separator Separator string\n * @returns {string} camelized string\n * @private\n */\nfunction camelize(str, separator = \"-\") {\n return str.split(separator)\n .map((v, i) => (i ? v.charAt(0).toUpperCase() + v.slice(1).toLowerCase() : v.toLowerCase()))\n .join(\"\");\n}\n/**\n * Convert to array\n * @param {object} v Target to be converted\n * @returns {Array}\n * @private\n */\nconst toArray = (v) => [].slice.call(v);\n/**\n * Deep copy object\n * @param {object} objectN Source object\n * @returns {object} Cloned object\n * @private\n */\nfunction deepClone(...objectN) {\n const clone = v => {\n if (isArray(v)) {\n return v.map(clone);\n }\n else if (isObject(v) && v.constructor) {\n const r = new v.constructor();\n for (const k in v) {\n r[k] = clone(v[k]);\n }\n return r;\n }\n return v;\n };\n return objectN.map(v => clone(v))\n .reduce((a, c) => ({ ...a, ...c }));\n}\n/**\n * Extend target from source object\n * @param {object} target Target object\n * @param {object|Array} source Source object\n * @returns {object}\n * @private\n */\nfunction extend(target = {}, source) {\n if (isArray(source)) {\n source.forEach(v => extend(target, v));\n }\n // exclude name with only numbers\n for (const p in source) {\n if (/^\\d+$/.test(p) || p in target) {\n continue;\n }\n target[p] = source[p];\n }\n return target;\n}\n/**\n * Get unique value from array\n * @param {Array} data Source data\n * @returns {Array} Unique array value\n * @private\n */\nfunction getUnique(data) {\n const isDate = data[0] instanceof Date;\n const d = Array.from(new Set(isDate ? data.map(Number) : data));\n return isDate ? d.map(v => new Date(v)) : d;\n}\n/**\n * Merge array\n * @param {Array} arr Source array\n * @returns {Array}\n * @private\n */\nfunction mergeArray(arr) {\n return arr && arr.length ? arr.reduce((p, c) => p.concat(c)) : [];\n}\n/**\n * Merge object returning new object\n * @param {object} target Target object\n * @param {object} objectN Source object\n * @returns {object} merged target object\n * @private\n */\nfunction mergeObj(target, ...objectN) {\n if (!objectN.length || (objectN.length === 1 && !objectN[0])) {\n return target;\n }\n const source = objectN.shift();\n if (isObject(target) && isObject(source)) {\n Object.keys(source).forEach(key => {\n if (!/^(__proto__|constructor|prototype)$/i.test(key)) {\n const value = source[key];\n if (value instanceof Date) {\n target[key] = new Date(value.getTime());\n }\n else if (isObject(value)) {\n !target[key] && (target[key] = {});\n target[key] = mergeObj(target[key], value);\n }\n else {\n target[key] = isArray(value) ? value.concat() : value;\n }\n }\n });\n }\n return mergeObj(target, ...objectN);\n}\n/**\n * Sort value\n * @param {Array} data value to be sorted\n * @param {boolean} isAsc true: asc, false: desc\n * @returns {number|string|Date} sorted date\n * @private\n */\nfunction sortValue(data, isAsc = true) {\n let fn;\n if (data[0] instanceof Date) {\n fn = isAsc ? (a, b) => a - b : (a, b) => b - a;\n }\n else {\n if (isAsc && !data.every(isNaN)) {\n fn = (a, b) => a - b;\n }\n else if (!isAsc) {\n fn = (a, b) => (a > b && -1) || (a < b && 1) || (a === b && 0);\n }\n }\n return data.concat().sort(fn);\n}\n/**\n * Get min/max value\n * @param {string} type 'min' or 'max'\n * @param {Array} data Array data value\n * @returns {number|Date|undefined}\n * @private\n */\nfunction getMinMax(type, data) {\n let res = data.filter(v => notEmpty(v));\n if (res.length) {\n if (isNumber(res[0])) {\n let result = type === \"min\" ? Infinity : -Infinity;\n for (const v of res) {\n if (type === \"min\" ? v < result : v > result) {\n result = v;\n }\n }\n res = result;\n }\n else if (res[0] instanceof Date) {\n res = sortValue(res, type === \"min\")[0];\n }\n }\n else {\n res = undefined;\n }\n return res;\n}\n/**\n * Get range\n * @param {number} start Start number\n * @param {number} end End number\n * @param {number} step Step number\n * @returns {Array}\n * @private\n */\nconst getRange = (start, end, step = 1) => {\n const res = [];\n const n = Math.max(0, Math.ceil((end - start) / step)) | 0;\n for (let i = 0; i < n; i++) {\n res.push(start + i * step);\n }\n return res;\n};\nlet _transitionCounter = 0;\n/**\n * Return auto-incrementing counter value.\n * Transition names only need uniqueness, not cryptographic randomness.\n * @param {boolean} asStr Convert returned value as string\n * @returns {number|string}\n * @private\n */\nfunction getRandom(asStr = true) {\n const id = ++_transitionCounter;\n return asStr ? String(id) : id;\n}\n/**\n * Find index based on binary search\n * @param {Array} arr Data array\n * @param {number} v Target number to find\n * @param {number} start Start index of data array\n * @param {number} end End index of data arr\n * @param {boolean} isRotated Weather is roted axis\n * @returns {number} Index number\n * @private\n */\nfunction findIndex(arr, v, start, end, isRotated) {\n if (start > end) {\n return -1;\n }\n const mid = Math.floor((start + end) / 2);\n let { x, w = 0 } = arr[mid];\n if (isRotated) {\n x = arr[mid].y;\n w = arr[mid].h;\n }\n if (v >= x && v <= x + w) {\n return mid;\n }\n return v < x ?\n findIndex(arr, v, start, mid - 1, isRotated) :\n findIndex(arr, v, mid + 1, end, isRotated);\n}\n/**\n * Process the template & return bound string\n * @param {string} tpl Template string\n * @param {object} data Data value to be replaced\n * @returns {string}\n * @private\n */\nfunction tplProcess(tpl, data) {\n return sanitize(tpl.replace(/\\{=([^}]+)\\}/g, (_, key) => data[key] ?? \"\"));\n}\n/**\n * Get parsed date value\n * (It must be called in 'ChartInternal' context)\n * @param {Date|string|number} date Value of date to be parsed\n * @returns {Date}\n * @private\n */\nfunction parseDate(date) {\n let parsedDate;\n if (date instanceof Date) {\n parsedDate = date;\n }\n else if (isString(date)) {\n const { config, format } = this;\n // if fails to parse, try by new Date()\n // https://github.com/naver/billboard.js/issues/1714\n parsedDate = format.dataTime(config.data_xFormat)(date) ?? new Date(date);\n }\n else if (isNumber(date) && !isNaN(date)) {\n parsedDate = new Date(+date);\n }\n if (!parsedDate || isNaN(+parsedDate)) {\n console && console.error &&\n console.error(`Failed to parse x '${date}' to Date object`);\n }\n return parsedDate;\n}\n/**\n * Parse CSS shorthand values (padding, margin, border-radius, etc.)\n * @param {number|string|object} value Shorthand value(s)\n * @returns {object} Parsed object with top, right, bottom, left properties\n * @private\n */\nfunction parseShorthand(value) {\n if (isObject(value) && !isString(value)) {\n const obj = value;\n return {\n top: obj.top || 0,\n right: obj.right || 0,\n bottom: obj.bottom || 0,\n left: obj.left || 0\n };\n }\n const values = (isString(value) ? value.trim().split(/\\s+/) : [value]).map(v => +v || 0);\n const [a, b = a, c = a, d = b] = values;\n return { top: a, right: b, bottom: c, left: d };\n}\n/**\n * Run function until given condition function return true\n * @param {function} fn Function to be executed when condition is true\n * @param {function(): boolean} conditionFn Condition function to check if condition is true\n * @private\n */\nfunction runUntil(fn, conditionFn) {\n if (conditionFn() === false) {\n requestAnimationFrame(() => runUntil(fn, conditionFn));\n }\n else {\n fn();\n }\n}\n/**\n * Convert an array to a Set by applying a key extractor\n * @param {Array} items Array of items to convert to Set\n * @param {function} keyFn Function to extract key from each item (item, index) => key. Defaults to identity function\n * @returns {Set} Set with extracted keys\n * @private\n */\nfunction toSet(items, keyFn = (item => item)) {\n const set = new Set();\n _forEachValidItem(items, (item, i) => {\n set.add(keyFn(item, i));\n });\n return set;\n}\n/**\n * Convert an array to a Map by applying key and value extractors\n * @param {Array} items Array of items to convert to Map\n * @param {function} keyFn Function to extract key from each item (item, index) => key\n * @param {function} valueFn Function to extract value from each item (item, index) => value. Defaults to identity function\n * @returns {Map} Map with extracted keys and values\n * @private\n */\nfunction toMap(items, keyFn, valueFn = (item => item)) {\n const map = new Map();\n _forEachValidItem(items, (item, i) => {\n map.set(keyFn(item, i), valueFn(item, i));\n });\n return map;\n}\n\nexport { callFn, camelize, capitalize, deepClone, endall, extend, findIndex, getMinMax, getOption, getRandom, getRange, getUnique, hasValue, mergeArray, mergeObj, parseDate, parseShorthand, runUntil, sortValue, toArray, toMap, toSet, tplProcess };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { TYPE_METHOD_NEEDED, TYPE, API_MODULE_NEEDED } from '../config/const.js';\nimport { window as win } from './browser.js';\nimport { isEmpty } from './util/type-checks.js';\nimport { camelize } from './util/object.js';\n\nconst MODULE_IMPORT_DOC = \"https://github.com/naver/billboard.js/blob/master/MODULE_IMPORTS.md\";\n/**\n * Check chart type module imports.\n * @param {ChartInternal} ctx Context\n * @private\n */\nfunction checkModuleImport(ctx) {\n const $$ = ctx;\n const { config } = $$;\n let type = \"\";\n if (isEmpty(config.data_type || config.data_types) && !$$[TYPE_METHOD_NEEDED.LINE]) {\n type = \"line\";\n }\n else {\n for (const x in TYPE_METHOD_NEEDED) {\n const t = TYPE[x];\n if ($$.hasType(t) && !$$[TYPE_METHOD_NEEDED[x]]) {\n type = t;\n break;\n }\n }\n }\n type &&\n logError(`Please, make sure if %c${camelize(type)}`, \"module has been imported and specified correctly.\", MODULE_IMPORT_DOC);\n}\n/**\n * Check optional API module import (e.g. export, flow).\n * Invoked by stubs on Chart.prototype when the corresponding resolver module\n * was not imported. Throws a helpful error pointing to the module the user\n * needs to import.\n * @param {string} apiName API name (key of API_MODULE_NEEDED)\n * @private\n */\nfunction checkApiModuleImport(apiName) {\n const moduleName = API_MODULE_NEEDED[apiName];\n moduleName &&\n logError(`Please, make sure if %c${moduleName}`, \"module has been imported and specified correctly.\", MODULE_IMPORT_DOC);\n}\n/**\n * Log error and throw error\n * @param {string} head Message header\n * @param {string} tail Message tail\n * @param {string} info Info message\n * @private\n */\nfunction logError(head, tail, info) {\n const prefix = \"[billboard.js]\";\n const hasConsole = win.console?.error;\n if (hasConsole) {\n const tailMsg = [\"background:red;color:white;display:block;font-size:15px\", tail] ;\n console.error(`❌ ${prefix} ${head}`, \"background:red;color:white;display:block;font-size:15px\", ...tailMsg);\n console.info(\"%cℹ️\", \"font-size:15px\", info);\n }\n throw Error(`${prefix} ${head.replace(/\\%c([a-z-]+)/i, \"'$1' \")} ${tail}`);\n}\n\nexport { checkApiModuleImport, checkModuleImport, logError };\n","import array from \"./array.js\";\nimport {Selection, root} from \"./selection/index.js\";\n\nexport default function(selector) {\n return typeof selector === \"string\"\n ? new Selection([document.querySelectorAll(selector)], [document.documentElement])\n : new Selection([array(selector)], root);\n}\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * CSS class names definition\n * @private\n */\nconst $COMMON = {\n button: \"bb-button\",\n chart: \"bb-chart\",\n empty: \"bb-empty\",\n main: \"bb-main\",\n target: \"bb-target\",\n EXPANDED: \"_expanded_\",\n dummy: \"_dummy_\"\n};\nconst $ARC = {\n arc: \"bb-arc\",\n arcLabelLine: \"bb-arc-label-line\",\n arcLabelLineText: \"bb-arc-label-line-text\",\n arcRange: \"bb-arc-range\",\n arcs: \"bb-arcs\",\n chartArc: \"bb-chart-arc\",\n chartArcs: \"bb-chart-arcs\",\n chartArcsBackground: \"bb-chart-arcs-background\",\n chartArcsTitle: \"bb-chart-arcs-title\",\n needle: \"bb-needle\"\n};\nconst $AREA = {\n area: \"bb-area\",\n areas: \"bb-areas\"\n};\nconst $AXIS = {\n axis: \"bb-axis\",\n axisX: \"bb-axis-x\",\n axisXLabel: \"bb-axis-x-label\",\n axisY: \"bb-axis-y\",\n axisY2: \"bb-axis-y2\",\n axisY2Label: \"bb-axis-y2-label\",\n axisYLabel: \"bb-axis-y-label\",\n axisXTooltip: \"bb-axis-x-tooltip\",\n axisYTooltip: \"bb-axis-y-tooltip\",\n axisY2Tooltip: \"bb-axis-y2-tooltip\",\n axisTooltipX: \"bb-axis-tooltip-x\",\n axisTooltipY: \"bb-axis-tooltip-y\"\n};\nconst $BAR = {\n bar: \"bb-bar\",\n bars: \"bb-bars\",\n chartBar: \"bb-chart-bar\",\n chartBars: \"bb-chart-bars\",\n barConnectLine: \"bb-bar-connectLine\"\n};\nconst $CANDLESTICK = {\n candlestick: \"bb-candlestick\",\n candlesticks: \"bb-candlesticks\",\n chartCandlestick: \"bb-chart-candlestick\",\n chartCandlesticks: \"bb-chart-candlesticks\",\n valueDown: \"bb-value-down\",\n valueUp: \"bb-value-up\"\n};\nconst $CIRCLE = {\n chartCircles: \"bb-chart-circles\",\n circle: \"bb-circle\",\n circles: \"bb-circles\"\n};\nconst $COLOR = {\n colorPattern: \"bb-color-pattern\",\n colorScale: \"bb-colorscale\"\n};\nconst $DRAG = {\n dragarea: \"bb-dragarea\",\n INCLUDED: \"_included_\"\n};\nconst $FUNNEL = {\n funnel: \"bb-funnel\",\n chartFunnel: \"bb-chart-funnel\",\n chartFunnels: \"bb-chart-funnels\",\n funnelBackground: \"bb-funnel-background\"\n};\nconst $GAUGE = {\n chartArcsGaugeMax: \"bb-chart-arcs-gauge-max\",\n chartArcsGaugeMin: \"bb-chart-arcs-gauge-min\",\n chartArcsGaugeUnit: \"bb-chart-arcs-gauge-unit\",\n chartArcsGaugeTitle: \"bb-chart-arcs-gauge-title\",\n gaugeValue: \"bb-gauge-value\"\n};\nconst $LEGEND = {\n legend: \"bb-legend\",\n legendBackground: \"bb-legend-background\",\n legendItem: \"bb-legend-item\",\n legendItemEvent: \"bb-legend-item-event\",\n legendItemHidden: \"bb-legend-item-hidden\",\n legendItemPoint: \"bb-legend-item-point\",\n legendItemTile: \"bb-legend-item-tile\"\n};\nconst $LINE = {\n chartLine: \"bb-chart-line\",\n chartLines: \"bb-chart-lines\",\n line: \"bb-line\",\n lines: \"bb-lines\"\n};\nconst $EVENT = {\n eventRect: \"bb-event-rect\",\n eventRects: \"bb-event-rects\",\n eventRectsMultiple: \"bb-event-rects-multiple\",\n eventRectsSingle: \"bb-event-rects-single\"\n};\nconst $FOCUS = {\n focused: \"bb-focused\",\n defocused: \"bb-defocused\",\n legendItemFocused: \"bb-legend-item-focused\",\n xgridFocus: \"bb-xgrid-focus\",\n ygridFocus: \"bb-ygrid-focus\"\n};\nconst $GRID = {\n grid: \"bb-grid\",\n gridLines: \"bb-grid-lines\",\n xgrid: \"bb-xgrid\",\n xgridLine: \"bb-xgrid-line\",\n xgridLines: \"bb-xgrid-lines\",\n xgrids: \"bb-xgrids\",\n ygrid: \"bb-ygrid\",\n ygridLine: \"bb-ygrid-line\",\n ygridLines: \"bb-ygrid-lines\",\n ygrids: \"bb-ygrids\"\n};\nconst $LEVEL = {\n level: \"bb-level\",\n levels: \"bb-levels\"\n};\nconst $RADAR = {\n chartRadar: \"bb-chart-radar\",\n chartRadars: \"bb-chart-radars\"\n};\nconst $REGION = {\n region: \"bb-region\",\n regions: \"bb-regions\"\n};\nconst $SELECT = {\n selectedCircle: \"bb-selected-circle\",\n selectedCircles: \"bb-selected-circles\",\n SELECTED: \"_selected_\"\n};\nconst $SHAPE = {\n shape: \"bb-shape\",\n shapes: \"bb-shapes\"\n};\nconst $SUBCHART = {\n brush: \"bb-brush\",\n subchart: \"bb-subchart\"\n};\nconst $TEXT = {\n chartText: \"bb-chart-text\",\n chartTexts: \"bb-chart-texts\",\n text: \"bb-text\",\n texts: \"bb-texts\",\n title: \"bb-title\",\n textBorderRect: \"bb-text-border\",\n textLabelImage: \"bb-text-label-image\",\n TextOverlapping: \"text-overlapping\"\n};\nconst $TOOLTIP = {\n tooltip: \"bb-tooltip\",\n tooltipContainer: \"bb-tooltip-container\",\n tooltipName: \"bb-tooltip-name\"\n};\nconst $TREEMAP = {\n treemap: \"bb-treemap\",\n chartTreemap: \"bb-chart-treemap\",\n chartTreemaps: \"bb-chart-treemaps\"\n};\nconst $ZOOM = {\n buttonZoomReset: \"bb-zoom-reset\",\n zoomBrush: \"bb-zoom-brush\"\n};\nvar CLASS = {\n ...$COMMON,\n ...$ARC,\n ...$AREA,\n ...$AXIS,\n ...$BAR,\n ...$CANDLESTICK,\n ...$CIRCLE,\n ...$COLOR,\n ...$DRAG,\n ...$GAUGE,\n ...$LEGEND,\n ...$LINE,\n ...$EVENT,\n ...$FOCUS,\n ...$FUNNEL,\n ...$GRID,\n ...$LEVEL,\n ...$RADAR,\n ...$REGION,\n ...$SELECT,\n ...$SHAPE,\n ...$SUBCHART,\n ...$TEXT,\n ...$TOOLTIP,\n ...$TREEMAP,\n ...$ZOOM\n};\n\nexport { $ARC, $AREA, $AXIS, $BAR, $CANDLESTICK, $CIRCLE, $COLOR, $COMMON, $DRAG, $EVENT, $FOCUS, $FUNNEL, $GAUGE, $GRID, $LEGEND, $LEVEL, $LINE, $RADAR, $REGION, $SELECT, $SHAPE, $SUBCHART, $TEXT, $TOOLTIP, $TREEMAP, $ZOOM, CLASS as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * boost config options\n */\nvar boost = {\n /**\n * Set boost options\n * @name boost\n * @memberof Options\n * @type {object}\n * @property {object} boost boost object\n * @property {boolean} [boost.useCssRule=false] Avoid setting inline styles for each shape elements.\n * - **NOTE:**\n * - Will append &lt;style> to the head tag and will add shpes' CSS rules dynamically.\n * - For now, covers colors related properties (fill, stroke, etc.) only.\n * @property {boolean} [boost.useWorker=false] Use Web Worker as possible for processing.\n * - **NOTE:**\n * - For now, only applies for data conversion at the initial time.\n * - As of Web Worker's async nature, handling chart instance synchrously is not recommended.\n * - When given data is empty, useWorker will be ignored.\n * @example\n * boost: {\n * useCssRule: true,\n * useWorker: false\n * }\n */\n boost_useCssRule: false,\n boost_useWorker: false\n};\n\nexport { boost as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * color config options\n */\nvar color = {\n /**\n * Set color of the data values\n * @name color\n * @memberof Options\n * @type {object}\n * @property {object} color color object\n * @property {string|object|((this: Chart, d: DataItem) => string)} [color.onover] Set the color value for each data point when mouse/touch onover event occurs.\n * @property {Array|null} [color.pattern=[]] Set custom color pattern. Passing `null` will not set a color for these elements, which requires the usage of custom CSS-based theming to work.\n * @property {(this: Chart) => SVGPathElement[]} [color.tiles] if defined, allows use svg's patterns to fill data area. It should return an array of [SVGPatternElement](https://developer.mozilla.org/en-US/docs/Web/API/SVGPatternElement).\n * - **NOTE:** The pattern element's id will be defined as `bb-colorize-pattern-$COLOR-VALUE`.<br>\n * ex. When color pattern value is `['red', '#fff']` and defined 2 patterns,then ids for pattern elements are:<br>\n * - `bb-colorize-pattern-red`\n * - `bb-colorize-pattern-fff`\n * @property {object} [color.threshold] color threshold for gauge and tooltip color\n * @property {string} [color.threshold.unit] If set to `value`, the threshold will be based on the data value. Otherwise it'll be based on equation of the `threshold.max` option value.\n * @property {Array} [color.threshold.values] Threshold values for each steps\n * @property {number} [color.threshold.max=100] The base value to determine threshold step value condition. When the given value is 15 and max 10, then the value for threshold is `15*100/10`.\n * @example\n * color: {\n * pattern: [\"#1f77b4\", \"#aec7e8\", ...],\n *\n * // Set colors' patterns\n * // it should return an array of SVGPatternElement\n * tiles: function() {\n * var pattern = document.createElementNS(\"http://www.w3.org/2000/svg\", \"pattern\");\n * var g = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n * var circle1 = document.createElementNS(\"http://www.w3.org/2000/svg\", \"circle\");\n *\n * pattern.setAttribute(\"patternUnits\", \"userSpaceOnUse\");\n * pattern.setAttribute(\"width\", \"32\");\n * pattern.setAttribute(\"height\", \"32\");\n *\n * g.style.fill = \"#000\";\n * g.style.opacity = \"0.2\";\n *\n * circle1.setAttribute(\"cx\", \"3\");\n * circle1.setAttribute(\"cy\", \"3\");\n * circle1.setAttribute(\"r\", \"3\");\n *\n * g.appendChild(circle1);\n * pattern.appendChild(g);\n *\n * return [pattern];\n * },\n *\n * // for threshold usage, pattern values should be set for each steps\n * pattern: [\"grey\", \"green\", \"yellow\", \"orange\", \"red\"],\n * threshold: {\n * unit: \"value\",\n *\n * // when value is 20 => 'green', value is 40 => 'orange' will be set.\n * values: [10, 20, 30, 40, 50],\n *\n * // the equation for max:\n * // - unit == 'value': max => 30\n * // - unit != 'value': max => value*100/30\n * max: 30\n * },\n *\n * // set all data to 'red'\n * onover: \"red\",\n *\n * // set different color for data\n * onover: {\n * data1: \"red\",\n * data2: \"yellow\"\n * },\n *\n * // will pass data object to the callback\n * onover: function(d) {\n * return d.id === \"data1\" ? \"red\" : \"green\";\n * }\n * }\n */\n color_pattern: [],\n color_tiles: undefined,\n color_threshold: {},\n color_onover: undefined\n};\n\nexport { color as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * legend config options\n */\nvar legend = {\n /**\n * Legend options\n * @name legend\n * @memberof Options\n * @type {object}\n * @property {object} legend Legend object\n * @property {boolean} [legend.show=true] Show or hide legend.\n * @property {boolean} [legend.hide=false] Hide legend\n * If true given, all legend will be hidden. If string or array given, only the legend that has the id will be hidden.\n * @property {string|HTMLElement} [legend.contents.bindto=undefined] Set CSS selector or element reference to bind legend items.\n * - **NOTE:** Should be used along with `legend.contents.template`.\n * @property {string|function} [legend.contents.template=\"<span style='color:#fff;padding:5px;background-color:{=COLOR}'>{=TITLE}</span>\"] Set item's template.<br>\n * - **NOTE:** Only common HTML tags are allowed to prevent XSS attacks. If creating charts from user input, it is recommended to sanitize input values to avoid potential vulnerabilities.\n * - If set `string` value, within template the 'color' and 'title' can be replaced using template-like syntax string:\n * - {=COLOR}: data color value\n * - {=TITLE}: data title value\n * - If set `function` value, will pass following arguments to the given function:\n * - title {string}: data's id value\n * - color {string}: color string\n * - data {Array}: data array\n * - **NOTE:** While basic XSS sanitization is applied, if you're allowing user-provided chart options in a service exposed to other users, you should implement additional security measures to prevent sophisticated XSS attacks.\n * @property {string} [legend.position=bottom] Change the position of legend.<br>\n * Available values are: `bottom`, `right` and `inset` are supported.\n * @property {object} [legend.inset={anchor: 'top-left',x: 10,y: 0,step: undefined}] Change inset legend attributes.<br>\n * This option accepts object that has the keys `anchor`, `x`, `y` and `step`.\n * - **anchor** decides the position of the legend:\n * - top-left\n * - top-right\n * - bottom-left\n * - bottom-right\n * - **x** and **y**:\n * - set the position of the legend based on the anchor.\n * - **step**:\n * - defines the max step the legend has (e.g. If 2 set and legend has 3 legend item, the legend 2 columns).\n * @property {boolean} [legend.equally=false] Set to all items have same width size.\n * @property {number} [legend.padding=0] Set padding value\n * @property {boolean} [legend.item.interaction=true] Set legend item interaction.\n * - **NOTE:**\n * - This setting will not have effect on `.toggle()` method.\n * - `legend.item.onXXX` listener options will work if set, regardless of this option value.\n * @property {boolean} [legend.item.interaction.dblclick=false] Set legend item to interact on double click.\n * - **NOTE:**\n * - Double clicking will make focused clicked dataseries only, hiding all others.\n * - for single click case, `click + altKey(Win)/optionKey(Mac OS)` to have same effect.\n * - To return initial state(which all dataseries are showing), double click current focused legend item again.\n * - for single click case, `click + altKey(Win)/optionKey(Mac OS)` to have same effect.\n * - In this case, default `click` interaction will be disabled.\n * @property {function} [legend.item.onclick=undefined] Set click event handler to the legend item.\n * - **NOTE:**\n * - When set, default `click` interaction will be disabled.\n * - When `interaction.dblclick=true` is set, will be called on double click.\n * @property {function} [legend.item.onover=undefined] Set mouse/touch over event handler to the legend item.\n * - **NOTE:** When set, default `mouseover` interaction will be disabled.\n * @property {function} [legend.item.onout=undefined] Set mouse/touch out event handler to the legend item.\n * - **NOTE:** When set, default `mouseout` interaction will be disabled.\n * @property {number} [legend.item.tile.width=10] Set width for 'rectangle' legend item tile element.\n * @property {number} [legend.item.tile.height=10] Set height for 'rectangle' legend item tile element.\n * @property {number} [legend.item.tile.r=5] Set the radius for 'circle' legend item tile type.\n * @property {string} [legend.item.tile.type=\"rectangle\"] Set legend item shape type.<br>\n * - **Available Values:**\n * - circle\n * - rectangle\n * @property {boolean} [legend.format] Set formatter function for legend text.\n * The argument:<br>\n * - `id`: Legend text value. When `data.names` is specified, will pass from it, otherwise will pass data id.\n * - `dataId`: When `data.names` specified, will pass the original data id. Otherwise will be undefined.\n * @property {boolean} [legend.tooltip=false] Show full legend text value using system tooltip(via `<title>` element).\n * @property {boolean} [legend.usePoint=false] Whether to use custom points in legend.\n * @see [Demo: format](https://naver.github.io/billboard.js/demo/#Legend.LegendFormat)\n * @see [Demo: item.interaction](https://naver.github.io/billboard.js/demo/#Legend.LegendItemInteraction)\n * @see [Demo: item.tile.type](https://naver.github.io/billboard.js/demo/#Legend.LegendItemTileType)\n * @see [Demo: position](https://naver.github.io/billboard.js/demo/#Legend.LegendPosition)\n * @see [Demo: contents.template](https://naver.github.io/billboard.js/demo/#Legend.LegendTemplate1)\n * @see [Demo: usePoint](https://naver.github.io/billboard.js/demo/#Legend.usePoint)\n * @example\n * legend: {\n * show: true,\n * hide: true,\n * //or hide: \"data1\"\n * //or hide: [\"data1\", \"data2\"]\n * contents: {\n * bindto: \"#legend\", // <ul id='legend'></ul>\n *\n * // will be as: <li style='background-color:#1f77b4'>data1</li>\n * template: \"<li style='background-color:{=COLOR}'>{=TITLE}</li>\"\n *\n * // or using function\n * template: function(id, color, data) {\n * // if you want omit some legend, return falsy value\n * if (id !== \"data1\") {\n * return \"<li style='background-color:\"+ color +\">\"+ id +\"</li>\";\n * }\n * }\n * },\n * position: \"bottom\", // bottom, right, inset\n * inset: {\n * anchor: \"top-right\" // top-left, top-right, bottom-left, bottom-right\n * x: 20,\n * y: 10,\n * step: 2\n * },\n * equally: false,\n * padding: 10,\n * item: {\n * // will disable default interaction\n * interaction: false,\n *\n * // set legend interact on double click\n * // by double clicking, will make focused clicked dataseries only, hiding all others.\n * interaction: {\n * dblclick: true\n * }\n *\n * // when set below callback, will disable corresponding default interactions\n * onclick: function(id, visible) {\n * \t// toggle based on the data visibility\n * \tthis[visible ? \"hide\" : \"show\"](id);\n * },\n * onover: function(id, visible) { ... },\n * onout: function(id, visible) { ... },\n *\n * // set tile's size\n * tile: {\n * // set tile type\n * type: \"circle\" // or \"rectangle\" (default)\n *\n * // width & height, are only applicable for 'rectangle' legend type\n * width: 15,\n * height: 15\n *\n * // radius is only applicable for 'circle' legend type\n * r: 10\n * }\n * },\n * format: function(id, dataId) {\n * // set ellipsis string when length is > 5\n * // to get full legend value, combine with 'legend.tooltip=true'\n * if (id.length > 5) {\n * \tid = id.substr(0, 5) + \"...\";\n * }\n *\n * return id;\n * },\n * tooltip: true,\n * usePoint: true\n * }\n */\n legend_contents_bindto: undefined,\n legend_contents_template: \"<span style='color:#fff;padding:5px;background-color:{=COLOR}'>{=TITLE}</span>\",\n legend_equally: false,\n legend_hide: false,\n legend_inset_anchor: \"top-left\",\n legend_inset_x: 10,\n legend_inset_y: 0,\n legend_inset_step: undefined,\n legend_item_interaction: true,\n legend_item_dblclick: false,\n legend_item_onclick: undefined,\n legend_item_onover: undefined,\n legend_item_onout: undefined,\n legend_item_tile_width: 10,\n legend_item_tile_height: 10,\n legend_item_tile_r: 5,\n legend_item_tile_type: \"rectangle\",\n legend_format: undefined,\n legend_padding: 0,\n legend_position: \"bottom\",\n legend_show: true,\n legend_tooltip: false,\n legend_usePoint: false\n};\n\nexport { legend as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * main config options\n */\nvar main = {\n /**\n * Specify the CSS selector or the element which the chart will be set to. D3 selection object can be specified also.<br>\n * If another chart is already set, it will be replaced with the new one (only one chart can be set in one element).\n * - **NOTE:** In case the element doesn't exist or not specified, will add a `<div>` element to the body.\n * @name bindto\n * @memberof Options\n * @property {string|HTMLElement|d3.selection|object} [bindto=\"#chart\"] Specify the element where chart will be drawn.\n * @property {string|HTMLElement|d3.selection} bindto.element=\"#chart\" Specify the element where chart will be drawn.\n * @property {string} [bindto.classname=bb] Specify the class name of bind element.<br>\n * **NOTE:** When the class name isn't `bb`, then you also need to update the default CSS to be rendered correctly.\n * @default #chart\n * @example\n * bindto: \"#myContainer\"\n *\n * // or HTMLElement\n * bindto: document.getElementById(\"myContainer\")\n *\n * // or D3 selection object\n * bindto: d3.select(\"#myContainer\")\n *\n * // or to change default classname\n * bindto: {\n * element: \"#chart\",\n * classname: \"bill-board\" // ex) <div id='chart' class='bill-board'>\n * }\n */\n bindto: \"#chart\",\n /**\n * Set chart background.\n * @name background\n * @memberof Options\n * @property {object} background background object\n * @property {string} background.class Specify the class name for background element.\n * @property {string} background.color Specify the fill color for background element.<br>**NOTE:** Will be ignored if `imgUrl` option is set.\n * @property {string} background.imgUrl Specify the image url string for background.\n * @see [Demo](https://naver.github.io/billboard.js/demo/#ChartOptions.Background)\n * @example\n * background: {\n * class: \"myClass\",\n * color: \"red\",\n *\n * // Set image url for background.\n * // If specified, 'color' option will be ignored.\n * imgUrl: \"https://naver.github.io/billboard.js/img/logo/billboard.js.svg\",\n * }\n */\n background: {},\n /**\n * Set 'clip-path' attribute for chart element\n * - **NOTE:**\n * > When false, chart node element is positioned after the axis node in DOM tree hierarchy.\n * > This is to make the chart element positioned over axis element.\n * @name clipPath\n * @memberof Options\n * @type {boolean}\n * @default true\n * @see [Demo](https://naver.github.io/billboard.js/demo/#ChartOptions.clipPath)\n * @example\n * // don't set 'clip-path' attribute\n * clipPath: false\n */\n clipPath: true,\n /**\n * Set svg element's class name\n * @name svg\n * @memberof Options\n * @type {object}\n * @property {object} [svg] svg object\n * @property {string} [svg.classname] class name for svg element\n * @example\n * svg: {\n * classname: \"test_class\"\n * }\n */\n svg_classname: undefined,\n /**\n * The desired size of the chart element.\n * If the value is not specified, the width of the chart will be calculated by the size of the parent element it's appended to.\n * @name size\n * @memberof Options\n * @type {object}\n * @property {object} [size] size object\n * @property {number} [size.width] width of the chart element\n * @property {number} [size.height] height of the chart element\n * @see [Demo](https://naver.github.io/billboard.js/demo/#ChartOptions.ChartSize)\n * @example\n * size: {\n * width: 640,\n * height: 480\n * }\n */\n size_width: undefined,\n size_height: undefined,\n /**\n * The padding of the chart element.\n * - **NOTE:** for more information, see the \"[`Understanding padding`](https://github.com/naver/billboard.js/wiki/Understanding-padding)\" wiki documentation.\n * @name padding\n * @memberof Options\n * @type {object}\n * @property {object|boolean} [padding=true] Set padding of chart, and accepts object or boolean type.\n * - `Object`: Specify each side's padding.\n * - `false`: Remove padding completely and make the shape fully occupy the container element.\n * - In this case, axes and subchart will be hidden.\n * - To adjust some padding from this state, use `axis.[x|y].padding` option.\n * @property {string} [padding.mode] padding mode\n * - `\"fit\"`: Reduce padding as much as possible to make chart fit to the container element for chart types w/axis.<br>When specified, all padding values will be relative from fitted value.\n * @property {number} [padding.top] padding on the top of chart\n * @property {number} [padding.right] padding on the right of chart\n * @property {number} [padding.bottom] padding on the bottom of chart\n * @property {number} [padding.left] padding on the left of chart\n * @see [Demo](https://naver.github.io/billboard.js/demo/#ChartOptions.Padding)\n * @see [Demo: Fit padding](https://naver.github.io/billboard.js/demo/#ChartOptions.FitPadding)\n * @example\n * // remove padding completely.\n * padding: false,\n *\n * padding: {\n * // specifying mode value, will reduce padding and make fit to the container element.\n * mode: \"fit\"\n *\n * // when mode is \"fit\", all padding values will be relative from fitted value.\n * // so, 0 will be initial fitted value.\n * top: 20,\n * right: 20,\n * bottom: 20,\n * left: 20\n * }\n *\n * // or specify padding value for each side\n * padding: {\n * top: 20,\n * right: 20,\n * bottom: 20,\n * left: 20\n * }\n */\n padding: true,\n padding_mode: undefined,\n padding_left: undefined,\n padding_right: undefined,\n padding_top: undefined,\n padding_bottom: undefined,\n /**\n * Set chart resize options\n * @name resize\n * @memberof Options\n * @type {object}\n * @property {object} [resize] resize object\n * @property {boolean|string} [resize.auto=true] Set chart resize automatically on viewport changes.\n * - **NOTE:** Available options\n * - true: Enables automatic resize.\n * - false: Disables automatic resize.\n * - \"parent\": Enables automatic resize when the parent node is resized.\n * - \"viewBox\": Enables automatic resize, and size will be fixed based on the viewbox.\n * @property {boolean|number} [resize.timer=true] Set resize timer option.\n * - **NOTE:** Available options\n * - The resize function will be called using:\n * - true: `setTimeout()`\n * - false: `requestIdleCallback()`\n * - Given number(delay in ms) value, resize function will be triggered using `setTimeout()` with given delay.\n * @see [Demo: resize \"parent\"](https://naver.github.io/billboard.js/demo/#ChartOptions.resizeParent)\n * @see [Demo: resize \"viewBox\"](https://naver.github.io/billboard.js/demo/#ChartOptions.resizeViewBox)\n * @example\n * resize: {\n * auto: false,\n *\n * // set resize based on parent node width value\n * auto: \"parent\",\n *\n * // set resize based on viewBox value\n * auto: \"viewBox\",\n *\n * // set resize function will be triggered using `setTimeout()`\n * timer: true,\n *\n * // set resize function will be triggered using `requestIdleCallback()`\n * timer: false,\n *\n * // set resize function will be triggered using `setTimeout()` with a delay of `100ms`.\n * timer: 100\n * }\n */\n resize_auto: true,\n resize_timer: true,\n /**\n * Set a callback to execute when the chart is clicked.\n * @name onclick\n * @memberof Options\n * @type {function}\n * @default undefined\n * @example\n * onclick: function(event) {\n * this; // chart instance itself\n * event; // native event object\n * ...\n * }\n */\n onclick: undefined,\n /**\n * Set a callback to execute when mouse/touch enters the chart.\n * @name onover\n * @memberof Options\n * @type {function}\n * @default undefined\n * @example\n * onover: function(event) {\n * this; // chart instance itself\n * event; // native event object\n * ...\n * }\n */\n onover: undefined,\n /**\n * Set a callback to execute when mouse/touch leaves the chart.\n * @name onout\n * @memberof Options\n * @type {function}\n * @default undefined\n * @example\n * onout: function(event) {\n * this; // chart instance itself\n * event; // native event object\n * ...\n * }\n */\n onout: undefined,\n /**\n * Set a callback to execute when user resizes the screen.\n * @name onresize\n * @memberof Options\n * @type {function}\n * @default undefined\n * @example\n * onresize: function() {\n * this; // chart instance itself\n * ...\n * }\n */\n onresize: undefined,\n /**\n * Set a callback to execute when screen resize finished.\n * @name onresized\n * @memberof Options\n * @type {function}\n * @default undefined\n * @example\n * onresized: function() {\n * this; // chart instance itself\n * ...\n * }\n */\n onresized: undefined,\n /**\n * Set a callback to execute before the chart is initialized\n * @name onbeforeinit\n * @memberof Options\n * @type {function}\n * @default undefined\n * @example\n * onbeforeinit: function() {\n * this; // chart instance itself\n * ...\n * }\n */\n onbeforeinit: undefined,\n /**\n * Set a callback to execute when the chart is initialized.\n * @name oninit\n * @memberof Options\n * @type {function}\n * @default undefined\n * @example\n * oninit: function() {\n * this; // chart instance itself\n * ...\n * }\n */\n oninit: undefined,\n /**\n * Set a callback to execute after the chart is initialized\n * @name onafterinit\n * @memberof Options\n * @type {function}\n * @default undefined\n * @example\n * onafterinit: function() {\n * this; // chart instance itself\n * ...\n * }\n */\n onafterinit: undefined,\n /**\n * Set a callback which is executed when the chart is rendered. Basically, this callback will be called in each time when the chart is redrawn.\n * @name onrendered\n * @memberof Options\n * @type {function}\n * @default undefined\n * @example\n * onrendered: function() {\n * this; // chart instance itself\n * ...\n * }\n */\n onrendered: undefined,\n /**\n * Set duration of transition (in milliseconds) for chart animation.<br><br>\n * - **NOTE:** If `0` or `null` is set, transition will be skipped. So, this makes initial rendering faster especially in case you have a lot of data.\n * - **NOTE:** In canvas mode, `transition.duration` is ignored. Canvas frames are redrawn synchronously. For canvas `flow()`, pass `duration` to the `flow()` call when an x-domain interpolation is required.\n * @name transition\n * @memberof Options\n * @type {object}\n * @property {object} [transition] transition object\n * @property {number} [transition.duration=250] duration in milliseconds\n * @example\n * transition: {\n * duration: 500\n * }\n */\n transition_duration: 250,\n /**\n * Set plugins\n * @name plugins\n * @memberof Options\n * @type {Array}\n * @example\n * plugins: [\n * new bb.plugin.stanford({ ... }),\n * new PluginA(),\n * ...\n * ]\n */\n plugins: [],\n /**\n * Control the render timing\n * @name render\n * @memberof Options\n * @type {object}\n * @property {object} [render] render object\n * @property {boolean} [render.lazy=true] Make it not render at initialization.\n * - **NOTE**:\n * - Enabled by default when bind element's visibility is hidden.\n * - When set to `false`, will initialize the chart regardless the bind element's visibility state, but in this case chart can't be guaranteed to be rendered properly.\n * @property {boolean} [render.observe=true] Observe bind element's visibility(`display` or `visibility` inline css property or class value) & render when it is visible automatically (for IEs, only works IE11+). When set to **false**, call [`.flush()`](./Chart.html#flush) to render.\n * @property {\"svg\"|\"canvas\"} [render.mode=\"svg\"] Select rendering backend. Available values are `\"svg\"` and `\"canvas\"`. In canvas mode, chart primitives are rendered to a single `<canvas>` instead of SVG nodes.\n * - **NOTE:** Canvas mode doesn't create per-shape, per-tick, grid, region and label SVG DOM nodes/classes. SVG CSS selectors that depend on those nodes, such as `.bb-target-data1 .bb-bar`, `.bb-bar-0` or `.bb-axis .tick text`, won't style canvas-drawn primitives. Use chart options, supported CSS theme probes or `canvas.theme` overrides.\n * - **NOTE:** Arc chart types (`pie`, `donut`, `gauge`, `polar` and `radar`) and funnel charts don't get meaningful rendering benefit from canvas mode. They are rendered as SVG only and `render.mode=\"canvas\"` is ignored for those types.\n * @see [Demo](https://naver.github.io/billboard.js/demo/#ChartOptions.LazyRender)\n * @example\n * render: {\n * lazy: true,\n * observe: true,\n * mode: \"svg\"\n * }\n *\n * @example\n * render: {\n * mode: \"canvas\"\n * }\n *\n * @example\n * \t// <!-- render.lazy will detect visibility defined -->\n * // (a) <div id='chart' class='hide'></div>\n * // (b) <div id='chart' style='display:none'></div>\n *\n * // render.lazy enabled by default when element is hidden\n * var chart = bb.generate({ ... });\n *\n * // chart will be rendered automatically when element's visibility changes\n * // Note: works only for inlined css property or class attribute changes\n * document.getElementById('chart').classList.remove('hide') // (a)\n * document.getElementById('chart').style.display = 'block'; // (b)\n *\n * @example\n * \t// chart won't be rendered and not observing bind element's visibility changes\n * var chart = bb.generate({\n * render: {\n * lazy: true,\n * observe: false\n * }\n * });\n *\n * // call at any point when you want to render\n * chart.flush();\n */\n render: {},\n render_mode: \"svg\",\n /**\n * Override canvas drawing style values read from supported SVG CSS probes.\n * Use this for canvas-specific styling that can't be represented by per-node SVG CSS selectors.\n * @name canvas\n * @memberof Options\n * @type {object}\n * @property {object} [canvas] Canvas options.\n * @property {object} [canvas.theme] Canvas theme override.\n * @property {object} [canvas.theme.selectors] Canvas theme overrides keyed by supported billboard.js SVG selectors. Use this to style canvas-rendered primitives with familiar CSS selectors and CSS property names.\n * - **NOTE:** `canvas.theme.selectors` keys are compatibility aliases for supported canvas primitives, not a full DOM/CSS selector engine. They don't match live SVG nodes 1:1 in canvas mode, and unsupported or per-data selectors such as `.bb-target-data1 .bb-bar` or `.bb-bar-0` are ignored. Use `canvas.theme` direct overrides or chart options for styles that need exact per-node behavior.\n * @see [Canvas theme selector reference](https://github.com/naver/billboard.js/blob/master/CANVAS_THEME_SELECTORS.md)\n * @example\n * canvas: {\n * theme: {\n * selectors: {\n * \".bb-axis .tick text\": {\n * fill: \"#555\",\n * font: \"12px sans-serif\"\n * },\n * \".bb-grid line\": {\n * stroke: \"#ddd\",\n * \"stroke-width\": 1,\n * \"stroke-dasharray\": \"2 2\"\n * },\n * \".bb-bar\": {\n * stroke: \"#fff\",\n * \"stroke-width\": 1\n * }\n * }\n * }\n * }\n */\n canvas_theme: {},\n /**\n * Show rectangles inside the chart.<br><br>\n * - **NOTE:**<br>\n * - axis must be x, y or y2. start and end should be the value where regions start and end.\n * - If not specified, the edge values will be used.\n * - If timeseries x axis, date string, Date object and unixtime integer can be used.\n * - If category x axis, category name can be used for start and end.\n * - If class is set, the region element will have it as class.\n *\n * This option accept array of object with below values:\n * - `axis {string}`: 'x', 'y', or 'y2'\n * - `[start] {number|Date|string}`: Start position of the region. If not set, the start will be the edge of the chart.\n * - `[end] {number|Date|string}`: End position of the region. If not set, the end will be the edge of the chart.\n * - `[class] {string}`: Class value to apply to the region.\n * - `[label] {object}` Label text option.\n * - `text {string}`: Text value.\n * - `x {number}`: x Position.\n * - `y {number}`: y Position.\n * - `center {string}`: Align label at the center. Allowed values are 'x', 'y', 'xy'.\n * - `color {string}`: Color string.\n * - `rotated (boolean)`: Whether rotate label or not.\n * @name regions\n * @memberof Options\n * @type {Array}\n * @default []\n * @see [Demo: Regions](https://naver.github.io/billboard.js/demo/#Region.Region)\n * @see [Demo: Regions Timeseries](https://naver.github.io/billboard.js/demo/#Region.RegionWithTimeseries)\n * @see [Demo: Regions Label](https://naver.github.io/billboard.js/demo/#Region.RegionLabel)\n * @example\n * regions: [\n * {\n * axis: \"x\",\n * start: 1,\n * end: 4,\n * class: \"region-1-4\",\n * opacity: 0.2,\n * label: {\n * \ttext: \"Region Text\",\n * \tx: 5, // position relative of the initial x coordinate\n * \ty: 5, // position relative of the initial y coordinate\n * \tcenter: \"xy\", // center text label in both direction.\n * \tcolor: \"red\", // color string\n * \trotated: true // make text to show in vertical or horizontal\n * }\n * }\n * ]\n */\n regions: []\n};\n\nexport { main as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * title config options\n */\nvar title = {\n /**\n * Set title options\n * @name title\n * @memberof Options\n * @type {object}\n * @property {object} title Title object\n * @property {string} [title.text] Title text. If contains `\\n`, it's used as line break allowing multiline title.\n * @property {number} [title.padding.top=0] Top padding value.\n * @property {number} [title.padding.right=0] Right padding value.\n * @property {number} [title.padding.bottom=0] Bottom padding value.\n * @property {number} [title.padding.left=0] Left padding value.\n * @property {string} [title.position=center] Available values are: 'center', 'right' and 'left'.\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Title.MultilinedTitle)\n * @example\n * title: {\n * text: \"Title Text\",\n *\n * // or Multiline title text\n * text: \"Main title text\\nSub title text\",\n *\n * padding: {\n * top: 10,\n * right: 10,\n * bottom: 10,\n * left: 10\n * },\n * position: \"center\"\n * }\n */\n title_text: undefined,\n title_padding: {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n },\n title_position: \"center\"\n};\n\nexport { title as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * tooltip config options\n */\nvar tooltip = {\n /**\n * Tooltip options\n * @name tooltip\n * @memberof Options\n * @type {object}\n * @property {object} tooltip Tooltip object\n * @property {boolean} [tooltip.show=true] Show or hide tooltip.\n * @property {boolean} [tooltip.doNotHide=false] Make tooltip keep showing not hiding on interaction.\n * @property {boolean} [tooltip.grouped=true] Set if tooltip is grouped or not for the data points.\n * - **NOTE:** The overlapped data points will be displayed as grouped even if set false.\n * @property {boolean} [tooltip.linked=false] Set if tooltips on all visible charts with like x points are shown together when one is shown.\n * @property {string} [tooltip.linked.name=\"\"] Groping name for linked tooltip.<br>If specified, linked tooltip will be groped interacting to be worked only with the same name.\n * @property {function} [tooltip.format.title] Set format for the title of tooltip.<br>\n * Specified function receives x of the data point to show.\n * @property {function} [tooltip.format.name] Set format for the name of each data in tooltip.<br>\n * Specified function receives name, ratio, id and index of the data point to show. ratio will be undefined if the chart is not donut/pie/gauge.\n * @property {function} [tooltip.format.value] Set format for the value of each data value in tooltip. If undefined returned, the row of that value will be skipped to be called.\n * - Will pass following arguments to the given function:\n * - `value {string}`: Value of the data point. If data row contains multiple or ranged(ex. candlestick, area range, etc.) value, formatter will be called as value length.\n * - `ratio {number}`: Ratio of the data point in the `pie/donut/gauge` and `area/bar` when contains grouped data. Otherwise is `undefined`.\n * - `id {string}`: id of the data point\n * - `index {number}`: Index of the data point\n * @property {function} [tooltip.position] Set custom position function for the tooltip.<br>\n * This option can be used to modify the tooltip position by returning object that has top and left.\n * - Will pass following arguments to the given function:\n * - `data {Array}`: Current selected data array object.\n * - `width {number}`: Width of tooltip.\n * - `height {number}`: Height of tooltip.\n * - `element {SVGElement}`: Tooltip event bound element\n * - `pos {object}`: Current position of the tooltip.\n * @property {function|object} [tooltip.contents] Set custom HTML for the tooltip.<br>\n * If tooltip.grouped is true, data includes multiple data points.<br><br>\n * Specified function receives `data` array and `defaultTitleFormat`, `defaultValueFormat` and `color` functions of the data point to show.\n * - **Note:**\n * - Only common HTML tags are allowed to prevent XSS attacks. If creating charts from user input, it is recommended to sanitize input values to avoid potential vulnerabilities.<br><br>\n * - defaultTitleFormat:\n * - if `axis.x.tick.format` option will be used if set.\n * - otherwise, will return function based on tick format type(category, timeseries).\n * - defaultValueFormat:\n * \t - for Arc type (except gauge, radar), the function will return value from `(ratio * 100).toFixed(1)`.\n * \t - for Axis based types, will be used `axis.[y|y2].tick.format` option value if is set.\n * \t - otherwise, will parse value and return as number.\n * @property {string|HTMLElement} [tooltip.contents.bindto=undefined] Set CSS selector or element reference to bind tooltip.\n * - **NOTE:** When is specified, will not be updating tooltip's position.\n * @property {string} [tooltip.contents.template=undefined] Set tooltip's template.\n * - **NOTE:** Only common HTML tags are allowed to prevent XSS attacks. If creating charts from user input, it is recommended to sanitize input values to avoid potential vulnerabilities.<br><br>\n * Within template, below syntax will be replaced using template-like syntax string:\n * - **{{ ... }}**: the doubly curly brackets indicate loop block for data rows.\n * - **{=CLASS_TOOLTIP}**: default tooltip class name `bb-tooltip`.\n * - **{=CLASS_TOOLTIP_NAME}**: default tooltip data class name (ex. `bb-tooltip-name-data1`)\n * - **{=TITLE}**: title value.\n * - **{=COLOR}**: data color.\n * - **{=NAME}**: data id value.\n * - **{=VALUE}**: data value.\n * - **NOTE:** While basic XSS sanitization is applied, if you're allowing user-provided chart options in a service exposed to other users, you should implement additional security measures to prevent sophisticated XSS attacks.\n * @property {object} [tooltip.contents.text=undefined] Set additional text content within data loop, using template syntax.\n * - **NOTE:** It should contain `{ key: Array, ... }` value\n * - 'key' name is used as substitution within template as '{=KEY}'\n * - The value array length should match with the data length\n * @property {boolean} [tooltip.init.show=false] Show tooltip at the initialization.\n * @property {number} [tooltip.init.x=0] Set x Axis index(or index for Arc(donut, gauge, pie) types) to be shown at the initialization.\n * @property {object} [tooltip.init.position] Set the position of tooltip at the initialization.\n * @property {function} [tooltip.onshow] Set a callback that will be invoked before the tooltip is shown.\n * @property {function} [tooltip.onhide] Set a callback that will be invoked before the tooltip is hidden.\n * @property {function} [tooltip.onshown] Set a callback that will be invoked after the tooltip is shown\n * @property {function} [tooltip.onhidden] Set a callback that will be invoked after the tooltip is hidden.\n * @property {string|function|null} [tooltip.order=null] Set tooltip data display order.<br><br>\n * **Available Values:**\n * - `desc`: In descending data value order\n * - `asc`: In ascending data value order\n * - `null`: It keeps the data display order<br>\n * **NOTE:** When `data.groups` is set, the order will follow as the stacked graph order.<br>\n * If want to order as data bound, set any value rather than asc, desc or null. (ex. empty string \"\")\n * - `function(data1, data2) { ... }`: [Array.sort compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Parameters)\n * @see [Demo: Hide Tooltip](https://naver.github.io/billboard.js/demo/#Tooltip.HideTooltip)\n * @see [Demo: Tooltip Grouping](https://naver.github.io/billboard.js/demo/#Tooltip.TooltipGrouping)\n * @see [Demo: Tooltip Format](https://naver.github.io/billboard.js/demo/#Tooltip.TooltipFormat)\n * @see [Demo: Linked Tooltip](https://naver.github.io/billboard.js/demo/#Tooltip.LinkedTooltips)\n * @see [Demo: Tooltip Position](https://naver.github.io/billboard.js/demo/#Tooltip.TooltipPosition)\n * @see [Demo: Tooltip Template](https://naver.github.io/billboard.js/demo/#Tooltip.TooltipTemplate)\n * @example\n * tooltip: {\n * show: true,\n * doNotHide: true,\n * grouped: false,\n * format: {\n * title: function(x) { return \"Data \" + x; },\n * name: function(name, ratio, id, index) { return name; },\n *\n * // If data row contains multiple or ranged(ex. candlestick, area range, etc.) value,\n * // formatter will be called as value length times.\n * value: function(value, ratio, id, index) { return ratio; }\n * },\n * position: function(data, width, height, element, pos) {\n * // data: [{x, index, id, name, value}, ...]\n * // width: Tooltip width\n * // height: Tooltip height\n * // element: Tooltip event bound element\n * // pos: {\n * // x: Current mouse event x position,\n * // y: Current mouse event y position,\n * // xAxis: Current x Axis position (the value is given for axis based chart type only)\n * // yAxis: Current y Axis position value or function(the value is given for axis based chart type only)\n * // }\n *\n * // yAxis will work differently per data lengths\n * // - a) Single data: `yAxis` will return `number` value\n * // - b) Multiple data: `yAxis` will return a function with property value\n *\n * // a) Single data:\n * // Get y coordinate\n * pos.yAxis; // y axis coordinate value of current data point\n *\n * // b) Multiple data:\n * // Get y coordinate of value 500, where 'data1' scales(y or y2).\n * // When 'data.axes' option is used, data can bound to different axes.\n * // - when \"data.axes={data1: 'y'}\", will return y value from y axis scale.\n * // - when \"data.axes={data1: 'y2'}\", will return y value from y2 axis scale.\n * pos.yAxis(500, \"data1\"); // will return y coordinate value of data1\n *\n * pos.yAxis(500); // get y coordinate with value of 500, using y axis scale\n * pos.yAxis(500, null, \"y2\"); // get y coordinate with value of 500, using y2 axis scale\n *\n * return {\n * top: 0,\n * left: 0\n * }\n * },\n *\n * contents: function(d, defaultTitleFormat, defaultValueFormat, color) {\n * return ... // formatted html as you want\n * },\n *\n * // specify tooltip contents using template\n * // - example of HTML returned:\n * // <ul class=\"bb-tooltip\">\n * // <li class=\"bb-tooltip-name-data1\"><span>250</span><br><span style=\"color:#00c73c\">data1</span></li>\n * // <li class=\"bb-tooltip-name-data2\"><span>50</span><br><span style=\"color:#fa7171\">data2</span></li>\n * // </ul>\n * contents: {\n * \tbindto: \"#tooltip\",\n * \ttemplate: '<ul class={=CLASS_TOOLTIP}>{{' +\n * \t\t\t'<li class=\"{=CLASS_TOOLTIP_NAME}\"><span>{=VALUE}</span><br>' +\n * \t\t\t'<span style=color:{=COLOR}>{=NAME}</span></li>' +\n * \t\t'}}</ul>'\n * }\n *\n * // with additional text value\n * // - example of HTML returned:\n * // <ul class=\"bb-tooltip\">\n * // <li class=\"bb-tooltip-name-data1\"><span>250</span><br>comment1<span style=\"color:#00c73c\">data1</span>text1</li>\n * // <li class=\"bb-tooltip-name-data2\"><span>50</span><br>comment2<span style=\"color:#fa7171\">data2</span>text2</li>\n * // </ul>\n * contents: {\n * \tbindto: \"#tooltip\",\n * \ttext: {\n * \t\t// a) 'key' name is used as substitution within template as '{=KEY}'\n * \t\t// b) the length should match with the data length\n * \t\tVAR1: [\"text1\", \"text2\"],\n * \t\tVAR2: [\"comment1\", \"comment2\"],\n * \t},\n * \ttemplate: '<ul class={=CLASS_TOOLTIP}>{{' +\n * \t\t\t'<li class=\"{=CLASS_TOOLTIP_NAME}\"><span>{=VALUE}</span>{=VAR2}<br>' +\n * \t\t\t'<span style=color:{=COLOR}>{=NAME}</span>{=VAR1}</li>' +\n * \t\t'}}</ul>'\n * }\n *\n * // sort tooltip data value display in ascending order\n * order: \"asc\",\n *\n * // specifying sort function\n * order: function(a, b) {\n * // param data passed format\n * {x: 5, value: 250, id: \"data1\", index: 5, name: \"data1\"}\n * ...\n * },\n *\n * // show at the initialization\n * init: {\n * show: true,\n * x: 2, // x Axis index (or index for Arc(donut, gauge, pie) types)\n * position: {\n * top: \"150px\", // specify as number or as string with 'px' unit string\n * left: 250 // specify as number or as string with 'px' unit string\n * }\n * },\n *\n * // fires prior tooltip is shown\n * onshow: function(selectedData) {\n * \t// current dataset selected\n * \t// ==> [{x: 4, value: 150, id: \"data2\", index: 4, name: \"data2\"}, ...]\n * \tselectedData;\n * },\n *\n * // fires prior tooltip is hidden\n * onhide: function(selectedData) {\n * \t// current dataset selected\n * \t// ==> [{x: 4, value: 150, id: \"data2\", index: 4, name: \"data2\"}, ...]\n * \tselectedData;\n * },\n *\n * // fires after tooltip is shown\n * onshown: function(selectedData) {\n * \t// current dataset selected\n * \t// ==> [{x: 4, value: 150, id: \"data2\", index: 4, name: \"data2\"}, ...]\n * \tselectedData;\n * },\n *\n * // fires after tooltip is hidden\n * onhidden: function(selectedData) {\n * \t// current dataset selected\n * \t// ==> [{x: 4, value: 150, id: \"data2\", index: 4, name: \"data2\"}, ...]\n * \tselectedData;\n * },\n *\n * // Link any tooltips when multiple charts are on the screen where same x coordinates are available\n * // Useful for timeseries correlation\n * linked: true,\n *\n * // Specify name to interact those with the same name only.\n * linked: {\n * name: \"some-group\"\n * }\n * }\n */\n tooltip_show: true,\n tooltip_doNotHide: false,\n tooltip_grouped: true,\n tooltip_format_title: undefined,\n tooltip_format_name: undefined,\n tooltip_format_value: undefined,\n tooltip_position: undefined,\n tooltip_contents: {},\n tooltip_init_show: false,\n tooltip_init_x: 0,\n tooltip_init_position: undefined,\n tooltip_linked: false,\n tooltip_linked_name: \"\",\n tooltip_onshow: () => { },\n tooltip_onhide: () => { },\n tooltip_onshown: () => { },\n tooltip_onhidden: () => { },\n tooltip_order: null\n};\n\nexport { tooltip as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * data config options\n */\nvar data = {\n /**\n * Specify the key of x values in the data.<br><br>\n * We can show the data with non-index x values by this option. This option is required when the type of x axis is timeseries. If this option is set on a category axis, the values of the data on the key will be used for category names.\n * @name data․x\n * @memberof Options\n * @type {string}\n * @default undefined\n * @example\n * data: {\n * x: \"date\"\n * }\n */\n data_x: undefined,\n /**\n * Converts data id value\n * @name data․idConverter\n * @memberof Options\n * @type {function}\n * @default function(id) { return id; }\n * @example\n * data: {\n * idConverter: function(id) {\n * // when id is 'data1', converts to be 'data2'\n * // 'data2' should be given as the initial data value\n * if (id === \"data1\") {\n * return \"data2\";\n * } else {\n * return id;\n * }\n * }\n * }\n */\n data_idConverter: id => id,\n /**\n * Set custom data name.\n * If a name is set to `null`, the series is omitted from the legend.\n * @name data․names\n * @memberof Options\n * @type {object}\n * @default {}\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.DataName)\n * @example\n * data: {\n * names: {\n * data1: \"Data Name 1\",\n * data2: \"Data Name 2\"\n * }\n * }\n */\n data_names: {},\n /**\n * Set custom data class.<br><br>\n * If this option is specified, the element g for the data has an additional class that has the prefix 'bb-target-' (eg. bb-target-additional-data1-class).\n * @name data․classes\n * @memberof Options\n * @type {object}\n * @default {}\n * @example\n * data: {\n * classes: {\n * data1: \"additional-data1-class\",\n * data2: \"additional-data2-class\"\n * }\n * }\n */\n data_classes: {},\n /**\n * Set chart type at once.<br><br>\n * If this option is specified, the type will be applied to every data. This setting can be overwritten by data.types.<br><br>\n * **Available Values:**\n * - area\n * - area-line-range\n * - area-spline\n * - area-spline-range\n * - area-step\n * - area-step-range\n * - bar\n * - bubble\n * - candlestick\n * - donut\n * - funnel\n * - gauge\n * - line\n * - pie\n * - polar\n * - radar\n * - scatter\n * - spline\n * - step\n * - treemap\n * @name data․type\n * @memberof Options\n * @type {string}\n * @default \"line\"<br>NOTE: When importing shapes by ESM, `line()` should be specified for type.\n * @example\n * data: {\n * type: \"bar\"\n * }\n * @example\n * // Generate chart by importing ESM\n * // Import types to be used only, where this will make smaller bundle size.\n * import bb, {\n * area,\n * areaLineRange,\n * areaSpline,\n * areaSplineRange,\n * areaStep,\n * areaStepRange,\n * bar,\n * bubble,\n * candlestick,\n * donut,\n * funnel,\n * gauge,\n * line,\n * pie,\n * polar,\n * radar,\n * scatter,\n * spline,\n * step,\n * treemap\n * }\n *\n * bb.generate({\n * ...,\n * data: {\n * type: bar()\n * }\n * });\n */\n data_type: undefined,\n /**\n * Set chart type for each data.<br>\n * This setting overwrites data.type setting.\n * - **NOTE:** `radar` and `treemap` type can't be combined with other types.\n * @name data․types\n * @memberof Options\n * @type {object}\n * @default {}\n * @example\n * data: {\n * types: {\n * data1: \"bar\",\n * data2: \"spline\"\n * }\n * }\n * @example\n * // Generate chart by importing ESM\n * // Import types to be used only, where this will make smaller bundle size.\n * import bb, {\n * area,\n * areaLineRange,\n * areaSpline,\n * areaSplineRange,\n * areaStep,\n * areaStepRange,\n * bar,\n * bubble,\n * candlestick,\n * donut,\n * funnel,\n * gauge,\n * line,\n * pie,\n * polar,\n * radar,\n * scatter,\n * spline,\n * step,\n * treemap\n * }\n *\n * bb.generate({\n * ...,\n * data: {\n * types: {\n * data1: bar(),\n * data1: spline()\n * }\n * }\n * });\n */\n data_types: {},\n /**\n * This option changes the order of stacking data and pieces of pie/donut.\n * - If `null` specified, it will be the order in which the data is loaded.\n * - If a function is specified, it will be used as [Array.sort compareFunction](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#Parameters)<br><br>\n *\n * **Available Values:**\n * - `desc`: In descending order\n * - `asc`: In ascending order\n * - `null`: It keeps the data load order\n * - `function(data1, data2) { ... }`: Array.sort compareFunction\n *\n * **NOTE**: order function only works for Axis based types & Arc types, except `Radar` type.\n * @name data․order\n * @memberof Options\n * @type {string|function|null}\n * @default desc\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.DataOrder)\n * @example\n * data: {\n * // in descending order (default)\n * order: \"desc\"\n *\n * // in ascending order\n * order: \"asc\"\n *\n * // keeps data input order\n * order: null\n *\n * // specifying sort function\n * order: function(a, b) {\n * // param data passed format\n * // {\n * // id: \"data1\", id_org: \"data1\", values: [\n * // {x: 5, value: 250, id: \"data1\", index: 5, name: \"data1\"},\n * // ...\n * // ]\n * // }\n *\n * const reducer = (p, c) => p + Math.abs(c.value);\n * const aSum = a.values.reduce(reducer, 0);\n * const bSum = b.values.reduce(reducer, 0);\n *\n * // ascending order\n * return aSum - bSum;\n *\n * // descending order\n * // return bSum - aSum;\n * }\n * }\n */\n data_order: \"desc\",\n /**\n * Set groups for the data for stacking.\n * @name data․groups\n * @memberof Options\n * @type {Array}\n * @default []\n * @example\n * data: {\n * groups: [\n * [\"data1\", \"data2\"],\n * [\"data3\"]\n * ]\n * }\n */\n data_groups: [],\n /**\n * Set how zero value will be treated on groups.<br>\n * Possible values:\n * - `zero`: 0 will be positioned at the absolute axis zero point.\n * - `positive`: 0 will be positioned at the top of a stack.\n * - `negative`: 0 will be positioned at the bottom of a stack.\n * @name data․groupsZeroAs\n * @memberof Options\n * @type {string}\n * @default \"positive\"\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.Groups)\n * @example\n * data: {\n * groupsZeroAs: \"zero\" // \"positive\" or \"negative\"\n * }\n */\n data_groupsZeroAs: \"positive\",\n /**\n * Set color converter function.<br><br>\n * This option should be a function and the specified function receives color (e.g. '#ff0000') and d that has data parameters like id, value, index, etc. And it must return a string that represents color (e.g. '#00ff00').\n * @name data․color\n * @memberof Options\n * @type {function}\n * @default undefined\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.DataColor)\n * @example\n * data: {\n * color: function(color, d) { ... }\n * }\n */\n data_color: undefined,\n /**\n * Set color for each data.\n * @name data․colors\n * @memberof Options\n * @type {object}\n * @default {}\n * @example\n * data: {\n * colors: {\n * data1: \"#ff0000\",\n * data2: function(d) {\n * return \"#000\";\n * }\n * ...\n * }\n * }\n */\n data_colors: {},\n /**\n * Set labels options\n * @name data․labels\n * @memberof Options\n * @type {object}\n * @property {object} data Data object\n * @property {boolean} [data.labels=false] Show or hide labels on each data point\n * @property {boolean} [data.labels.centered=false] Centerize labels on `bar` shape. (**NOTE:** works only for 'bar' type)\n * @property {function} [data.labels.format] Set formatter function for data labels.<br>\n * The formatter function receives 4 arguments such as `v, id, i, texts` and it **must return a string** (`\\n` character will be used as line break) that will be shown as the label.<br><br>\n * The arguments are:<br>\n * - `v` is the value of the data point where the label is shown.\n * - `id` is the id of the data where the label is shown.\n * - `i` is the index of the data series point where the label is shown.\n * - `texts` is an array of whole corresponding data series' text labels.<br><br>\n * Formatter function can be defined for each data by specifying as an object and D3 formatter function can be set (ex. d3.format('$'))\n * @property {string|object|function} [data.labels.backgroundColors] Set label text background colors.<br><br>\n * - **NOTE**: When a function is set, background colors can be specified one color per dataset.\n * - Within the function, the last returned color for dataset will be used.\n * - Only can control set or unset background color for each values.\n * @property {string|object|function} [data.labels.colors] Set label text colors.\n * @property {object|function} [data.labels.position] Set each dataset position, relative to the original.<br><br>\n * When a function is specified, it will receive 5 arguments such as `type, v, id, i, texts` and it must return a position number.<br><br>\n * The arguments are:<br>\n * - `type` coordinate type string, which will be 'x' or 'y'.\n * - `v` is the value of the data point where the label is shown.\n * - `id` is the id of the data where the label is shown.\n * - `i` is the index of the data series point where the label is shown.\n * - `texts` is an array of whole corresponding data series' text labels.<br><br>\n * @property {number} [data.labels.position.x=0] x coordinate position, relative to the original.\n * @property {number} [data.labels.position.y=0] y coordinate position, relative to the original.\n * @property {object} [data.labels.rotate] Rotate label text. Specify degree value in a range of `0 ~ 360`.\n * - **NOTE:** Depending on the rotate value, the text position needs to be adjusted manually(using `data.labels.position` option) to be shown nicely.\n * @property {boolean|object} [data.labels.border=false] Add border to data label text. NOTE: When set as `true`, styling isn't applied. Hence, you need to set it using `.bb-text-border` class.\n * @property {number|string|object} [data.labels.border.padding=\"3 5\"] Border padding. Can be a single number, string or object with top, bottom, left, right properties.\n * @property {number} [data.labels.border.radius=10] Border radius value.\n * @property {number} [data.labels.border.strokeWidth=1] Border stroke width.\n * @property {string} [data.labels.border.stroke=\"#000\"] Border stroke color.\n * @property {string} [data.labels.border.fill=\"none\"] Border fill color.\n * @property {object|function} [data.labels.image] Set image to be displayed next to the label text.<br><br>\n * When a function is specified, it will receive 3 arguments such as `v, id, i` and it must return an image object with `url`, `width`, `height`, and optional `pos` properties.<br><br>\n * The arguments are:<br>\n * - `v` is the value of the data point where the label is shown.\n * - `id` is the id of the data where the label is shown.\n * - `i` is the index of the data series point where the label is shown.\n * @property {string} data.labels.image.url Image URL path. Can use placeholder `{=ID}` which will be replaced with the data ID.\n * @property {number} data.labels.image.width Image width in pixels.\n * @property {number} data.labels.image.height Image height in pixels.\n * @property {object} [data.labels.image.pos] Image position relative to the label text.\n * @property {number} [data.labels.image.pos.x=0] x coordinate position, relative to the original.\n * @property {number} [data.labels.image.pos.y=0] y coordinate position, relative to the original.\n * @memberof Options\n * @type {object}\n * @default {}\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.DataLabel)\n * @see [Demo: label border](https://naver.github.io/billboard.js/demo/#Data.DataLabelBorder)\n * @see [Demo: label colors](https://naver.github.io/billboard.js/demo/#Data.DataLabelColors)\n * @see [Demo: label format](https://naver.github.io/billboard.js/demo/#Data.DataLabelFormat)\n * @see [Demo: label image](https://naver.github.io/billboard.js/demo/#Data.DataLabelImage)\n * @see [Demo: label multiline](https://naver.github.io/billboard.js/demo/#Data.DataLabelMultiline)\n * @see [Demo: label overlap](https://naver.github.io/billboard.js/demo/#Data.DataLabelOverlap)\n * @see [Demo: label position](https://naver.github.io/billboard.js/demo/#Data.DataLabelPosition)\n * @see [Demo: label rotate](https://naver.github.io/billboard.js/demo/#Data.DataLabelRotate)\n * @example\n * data: {\n * labels: true,\n *\n * // or set specific options\n * labels: {\n * format: function(v, id, i, texts) {\n * ...\n * // to multiline, return with '\\n' character\n * return \"Line1\\nLine2\";\n * },\n *\n * // it's possible to set for each data\n * format: {\n * data1: function(v, id, i, texts) { ... },\n * ...\n * },\n *\n * // align text to center of the 'bar' shape (works only for 'bar' type)\n * centered: true,\n *\n * // apply background color for label texts\n * backgroundColors: \"red\",\n *\n * // set different background colors per dataset\n * backgroundColors: {\n * data1: \"green\",\n * data2: \"yellow\"\n * },\n *\n * // call back for label text background color\n * backgroundColors: function(color, d) {\n * // color: the default data label color string\n * // data: ex) {x: 0, value: 200, id: \"data3\", index: 0}\n * ....\n * return d.value > 200 ? \"cyan\" : \"red\";\n * },\n *\n * // apply for all label texts\n * colors: \"red\",\n *\n * // set different colors per dataset\n * // for not specified dataset, will have the default color value\n * colors: {\n * data1: \"yellow\",\n * data3: \"green\"\n * },\n *\n * // call back for label text color\n * colors: function(color, d) {\n * // color: the default data label color string\n * // data: ex) {x: 0, value: 200, id: \"data3\", index: 0}\n * ....\n * return d.value > 200 ? \"cyan\" : color;\n * },\n *\n * // return x, y coordinate position\n * // apt to handle each text position manually\n * position: function(type, v, id, i, texts) {\n * ...\n * return type == \"x\" ? 10 : 20;\n * },\n *\n * // set x, y coordinate position\n * position: {\n * x: -10,\n * y: 10\n * },\n *\n * // or set x, y coordinate position by each dataset\n * position: {\n * data1: {x: 5, y: 5},\n * data2: {x: 10, y: -20}\n * },\n *\n * \t // rotate degree for label text\n * rotate: 90,\n *\n * // add border to data label text\n * // NOTE: When set as `true`, styling aren't applied. Hence, need to set using '.bb-text-border' class.\n * // ex. \".bb-text-border { fill: red; stroke: #000; stroke-width: 2px; rx: 10px; ry: 10px; }\"\n * border: true,\n *\n * // or set detailed border options\n * border: {\n * padding: 10, // set all padding to 10\n * padding: \"5 10\", // set top and bottom padding to 5, left and right padding to 10\n * padding: { // specify each padding\n * top: 3,\n * bottom: 5,\n * left: 10,\n * right: 13\n * },\n * radius: 10,\n * strokeWidth: 2,\n * stroke: \"#000\",\n * fill: \"red\"\n * },\n *\n * // set image to be displayed next to the label text\n * image: {\n * url: \"./sample.svg\",\n *\n * // use placeholder to dynamically set image URL based on data ID\n * url: \"./images/{=ID}.svg\", // will be replaced to \"./images/data1.svg\", \"./images/data2.svg\", etc.\n * width: 35,\n * height: 35,\n * pos: {\n * x: 0,\n * y: 0\n * }\n * },\n *\n * // or use function to return image configuration dynamically\n * image: function(v, id, i) {\n * // v is the value of the data point where the label is shown.\n * // id is the id of the data where the label is shown.\n * // i is the index of the data series point where the label is shown.\n *\n * // Return different images based on value\n * if (v > 500) {\n * return {\n * url: \"./high-value.svg\",\n * width: 40,\n * height: 40,\n * pos: { x: 0, y: 0 }\n * };\n * } else if (v > 100) {\n * return {\n * url: \"./medium-value.svg\",\n * width: 30,\n * height: 30,\n * pos: { x: 0, y: 0 }\n * };\n * } else if(v < 5) {\n * \t// Return falsy value in case you don't want to show image\n * return null;\n * } else {\n * return {\n * url: \"./low-value.svg\",\n * width: 20,\n * height: 20,\n * pos: { x: 0, y: 0 }\n * };\n * }\n * }\n * }\n * }\n */\n data_labels: {},\n data_labels_backgroundColors: undefined,\n data_labels_colors: undefined,\n data_labels_position: {},\n data_labels_imgUrl: undefined,\n /**\n * Hide each data when the chart appears.<br><br>\n * If true is specified, all of data will be hidden. If multiple ids are specified as an array, those will be hidden.\n * @name data․hide\n * @memberof Options\n * @type {boolean|Array}\n * @default false\n * @example\n * data: {\n * // all of data will be hidden\n * hide: true\n *\n * // specified data will be hidden\n * hide: [\"data1\", ...]\n * }\n */\n data_hide: false,\n /**\n * Filter values to be shown\n * The data value is the same as the returned by `.data()`.\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter\n * @name data․filter\n * @memberof Options\n * @type {function}\n * @default undefined\n * @example\n * data: {\n * // filter for id value\n * filter: function(v) {\n * // v: [{id: \"data1\", id_org: \"data1\", values: [\n * // {x: 0, value: 130, id: \"data2\", index: 0}, ...]\n * // }, ...]\n * return v.id !== \"data1\";\n * }\n */\n data_filter: undefined,\n /**\n * Set a callback for click event on each data point.<br><br>\n * This callback will be called when each data point is clicked and will receive `d` and element as the arguments.\n * - `d` is the data clicked and element is the element clicked.\n * - `element` is the current interacting svg element.\n * - In this callback, `this` will be the Chart object.\n * @name data․onclick\n * @memberof Options\n * @type {function}\n * @default function() {}\n * @example\n * data: {\n * onclick: function(d, element) {\n * // d - ex) {x: 4, value: 150, id: \"data1\", index: 4, name: \"data1\"}\n * // element - <circle>\n * ...\n * }\n * }\n */\n data_onclick: () => { },\n /**\n * Set a callback for mouse/touch over event on each data point.<br><br>\n * This callback will be called when the mouse cursor or touch moves onto each data point and will receive `d` and `element` as the argument.\n * - `d` is the data where mouse cursor moves onto.\n * - `element` is the current interacting svg element.\n * - In this callback, `this` will be the Chart object.\n * @name data․onover\n * @memberof Options\n * @type {function}\n * @default function() {}\n * @example\n * data: {\n * onover: function(d, element) {\n * // d - ex) {x: 4, value: 150, id: \"data1\", index: 4}\n * // element - <circle>\n * ...\n * }\n * }\n */\n data_onover: () => { },\n /**\n * Set a callback for mouse/touch out event on each data point.<br><br>\n * This callback will be called when the mouse cursor or touch moves out each data point and will receive `d` as the argument.\n * - `d` is the data where mouse cursor moves out.\n * - `element` is the current interacting svg element.\n * - In this callback, `this` will be the Chart object.\n * @name data․onout\n * @memberof Options\n * @type {function}\n * @default function() {}\n * @example\n * data: {\n * onout: function(d, element) {\n * // d - ex) {x: 4, value: 150, id: \"data1\", index: 4}\n * // element - <circle>\n * ...\n * }\n * }\n */\n data_onout: () => { },\n /**\n * Set a callback for when data is shown.<br>\n * The callback will receive shown data ids in array.\n * @name data․onshown\n * @memberof Options\n * @type {function}\n * @default undefined\n * @example\n * data: {\n * onshown: function(ids) {\n * // ids - [\"data1\", \"data2\", ...]\n * ...\n * }\n * }\n */\n data_onshown: undefined,\n /**\n * Set a callback for when data is hidden.<br>\n * The callback will receive hidden data ids in array.\n * @name data․onhidden\n * @memberof Options\n * @type {function}\n * @default undefined\n * @example\n * data: {\n * onhidden: function(ids) {\n * // ids - [\"data1\", \"data2\", ...]\n * ...\n * }\n * }\n */\n data_onhidden: undefined,\n /**\n * Set a callback for minimum data\n * - **NOTE:** For 'area-line-range', 'area-step-range' and 'area-spline-range', `mid` data will be taken for the comparison\n * @name data․onmin\n * @memberof Options\n * @type {function}\n * @default undefined\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.OnMinMaxCallback)\n * @example\n * onmin: function(data) {\n * // data - ex) [{x: 3, value: 400, id: \"data1\", index: 3}, ... ]\n * ...\n * }\n */\n data_onmin: undefined,\n /**\n * Set a callback for maximum data\n * - **NOTE:** For 'area-line-range', 'area-step-range' and 'area-spline-range', `mid` data will be taken for the comparison\n * @name data․onmax\n * @memberof Options\n * @type {function}\n * @default undefined\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.OnMinMaxCallback)\n * @example\n * onmax: function(data) {\n * // data - ex) [{x: 3, value: 400, id: \"data1\", index: 3}, ... ]\n * ...\n * }\n */\n data_onmax: undefined,\n /**\n * Load a CSV or JSON file from a URL. NOTE that this will not work if loading via the \"file://\" protocol as most browsers will block XMLHTTPRequests.\n * @name data․url\n * @memberof Options\n * @type {string}\n * @default undefined\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.LoadData)\n * @example\n * data: {\n * url: \"/data/test.csv\"\n * }\n */\n data_url: undefined,\n /**\n * XHR header value\n * - **NOTE:** Should be used with `data.url` option\n * @name data․headers\n * @memberof Options\n * @type {string}\n * @default undefined\n * @see https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/setRequestHeader\n * @example\n * data: {\n * url: \"/data/test.csv\",\n * headers: {\n * \"Content-Type\": \"text/xml\",\n * ...\n * }\n * }\n */\n data_headers: undefined,\n /**\n * Parse a JSON object for data. See also data.keys.\n * @name data․json\n * @memberof Options\n * @type {Array}\n * @default undefined\n * @see [data․keys](#.data%25E2%2580%25A4keys)\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.JSONData)\n * @example\n * data: {\n * json: [\n * {name: \"www.site1.com\", upload: 200, download: 200, total: 400},\n * {name: \"www.site2.com\", upload: 100, download: 300, total: 400},\n * {name: \"www.site3.com\", upload: 300, download: 200, total: 500},\n * {name: \"www.site4.com\", upload: 400, download: 100, total: 500}\n * ],\n * keys: {\n * // case 1: specify 'x' key for category axis\n * x: \"name\", // 'name' key will be used as category x axis values\n * value: [\"upload\", \"download\"]\n *\n * // case 2: without 'x' key for non-category axis\n * value: [\"upload\", \"download\"]\n * }\n * }\n */\n data_json: undefined,\n /**\n * Load data from a multidimensional array, with the first element containing the data names, the following containing related data in that order.\n * @name data․rows\n * @memberof Options\n * @type {Array}\n * @default undefined\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.RowOrientedData)\n * @example\n * data: {\n * rows: [\n * [\"A\", \"B\", \"C\"],\n * [90, 120, 300],\n * [40, 160, 240],\n * [50, 200, 290],\n * [120, 160, 230],\n * [80, 130, 300],\n * [90, 220, 320]\n * ]\n * }\n *\n * // for 'bar' type, data can contain:\n * // - an array of [start, end] data following the order\n * data: {\n * rows: [\n * [\"data1\", \"data2\"],\n * [[100, 150], 120],\n * [[200, 300], 55],\n * [[-400, 500], 60]\n * ],\n * type: \"bar\"\n * }\n *\n * // for 'range' types('area-line-range' or 'area-step-range' or 'area-spline-range'), data should contain:\n * // - an array of [high, mid, low] data following the order\n * // - or an object with 'high', 'mid' and 'low' key value\n * data: {\n * rows: [\n * [\"data1\", \"data2\"],\n * [\n * // or {high:150, mid: 140, low: 110}, 120\n * [150, 140, 110], 120\n * ],\n * [[155, 130, 115], 55],\n * [[160, 135, 120], 60]\n * ],\n * types: {\n * data1: \"area-line-range\",\n * data2: \"line\"\n * }\n * }\n *\n * // for 'bubble' type, data can contain dimension value:\n * // - an array of [y, z] data following the order\n * // - or an object with 'y' and 'z' key value\n * // 'y' is for y axis coordination and 'z' is the bubble radius value\n * data: {\n * rows: [\n * [\"data1\", \"data2\"],\n * [\n * // or {y:10, z: 140}, 120\n * [10, 140], 120\n * ],\n * [[100, 30], 55],\n * [[50, 100], 60]\n * ],\n * types: {\n * data1: \"bubble\",\n * data2: \"line\"\n * }\n * }\n *\n * // for 'candlestick' type, data should contain:\n * // - an array of [open, high, low, close, volume(optional)] data following the order\n * // - or an object with 'open', 'high', 'low', 'close' and 'value'(optional) key value\n * data: {\n * rows: [\n * [\"data1\", \"data2\"],\n * \t\t[\n * \t\t\t// open, high, low, close, volume (optional)\n * \t\t\t{open: 1300, high: 1369, low: 1200, close: 1339, volume: 100},\n * \t\t\t[1000, 1100, 850, 870]\n * \t\t],\n * \t\t[\n * \t\t\t{open: 1348, high: 1371, low: 1271, close: 1320},\n * \t\t\t[870, 1250, 830, 1200, 50]\n * \t\t]\n * ],\n * type: \"candlestick\"\n * }\n */\n data_rows: undefined,\n /**\n * Load data from a multidimensional array, with each element containing an array consisting of a datum name and associated data values.\n * @name data․columns\n * @memberof Options\n * @type {Array}\n * @default undefined\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.ColumnOrientedData)\n * @example\n * data: {\n * columns: [\n * [\"data1\", 30, 20, 50, 40, 60, 50],\n * [\"data2\", 200, 130, 90, 240, 130, 220],\n * [\"data3\", 300, 200, 160, 400, 250, 250]\n * ]\n * }\n *\n * // for 'bar' type, data can contain:\n * // - an array of [start, end] data following the order\n * data: {\n * columns: [\n * [\"data1\", -100, 50, [100, 200], [200, 300]],\n * [\"data2\", -200, 300, [-100, 100], [-50, -30]],\n * ],\n * type: \"bar\"\n * }\n *\n * // for 'range' types('area-line-range' or 'area-step-range' or 'area-spline-range'), data should contain:\n * // - an array of [high, mid, low] data following the order\n * // - or an object with 'high', 'mid' and 'low' key value\n * data: {\n * columns: [\n * [\"data1\",\n * [150, 140, 110], // or {high:150, mid: 140, low: 110}\n * [150, 140, 110],\n * [150, 140, 110]\n * ]\n * ],\n * type: \"area-line-range\"\n * }\n *\n * // for 'bubble' type, data can contain dimension value:\n * // - an array of [y, z] data following the order\n * // - or an object with 'y' and 'z' key value\n * // 'y' is for y axis coordination and 'z' is the bubble radius value\n * data: {\n * columns: [\n * [\"data1\",\n * [10, 140], // or {y:10, z: 140}\n * [100, 30],\n * [50, 100]\n * ]\n * ],\n * type: \"bubble\"\n * }\n *\n * // for 'candlestick' type, data should contain:\n * // - an array of [open, high, low, close, volume(optional)] data following the order\n * // - or an object with 'open', 'high', 'low', 'close' and 'value'(optional) key value\n * data: {\n * columns: [\n * [\"data1\",\n * [1000, 1100, 850, 870, 100], // or {open:1000, high: 1100, low: 870, volume: 100}\n * [870, 1250, 830, 1200] // 'volume' can be omitted\n * ]\n * ],\n * type: \"candlestick\"\n * }\n */\n data_columns: undefined,\n /**\n * Used if loading JSON via data.url.\n * - **Available Values:**\n * - json\n * - csv\n * - tsv\n * @name data․mimeType\n * @memberof Options\n * @type {string}\n * @default csv\n * @example\n * data: {\n * mimeType: \"json\"\n * }\n */\n data_mimeType: \"csv\",\n /**\n * Choose which JSON object keys correspond to desired data.\n * - **NOTE:** Only for JSON object given as array.\n * @name data․keys\n * @memberof Options\n * @type {string}\n * @default undefined\n * @example\n * data: {\n * json: [\n * {name: \"www.site1.com\", upload: 200, download: 200, total: 400},\n * {name: \"www.site2.com\", upload: 100, download: 300, total: 400},\n * {name: \"www.site3.com\", upload: 300, download: 200, total: 500},\n * {name: \"www.site4.com\", upload: 400, download: 100, total: 500}\n * ],\n * keys: {\n * // case 1: specify 'x' key for category axis\n * x: \"name\", // 'name' key will be used as category x axis values\n * value: [\"upload\", \"download\"]\n *\n * // case 2: without 'x' key for non-category axis\n * value: [\"upload\", \"download\"]\n * }\n * }\n */\n data_keys: undefined,\n /**\n * Set text label to be displayed when there's no data to show.\n * - ex. Toggling all visible data to not be shown, unloading all current data, etc.\n * @name data․empty․label․text\n * @memberof Options\n * @type {string}\n * @default \"\"\n * @example\n * data: {\n * empty: {\n * label: {\n * text: \"No Data\"\n * }\n * }\n * }\n */\n data_empty_label_text: \"\"\n};\n\nexport { data as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * interaction config options\n */\nvar interaction = {\n /**\n * Interaction options\n * @name interaction\n * @memberof Options\n * @type {object}\n * @property {object} interaction Intersection object\n * @property {boolean} [interaction.enabled=true] Indicate if the chart should have interactions.<br>\n * If `false` is set, all of interactions (showing/hiding tooltip, selection, mouse events, etc) will be disabled.\n * @property {boolean} [interaction.brighten=true] Make brighter for the selected area (ex. 'pie' type data selected area)\n * @property {boolean} [interaction.inputType.mouse=true] enable or disable mouse interaction\n * @property {boolean} [interaction.inputType.touch=true] enable or disable touch interaction\n * @property {boolean|number} [interaction.inputType.touch.preventDefault=false] enable or disable to call event.preventDefault on touchstart & touchmove event. It's usually used to prevent document scrolling.<br>\n * - **NOTE**: When `true` is set, touch events are bound with [`{passive: false}`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#using_passive_listeners) option.\n * @property {boolean} [interaction.onout=true] Enable or disable \"onout\" event.<br>\n * \t\tWhen is disabled, defocus(hiding tooltip, focused gridline, etc.) event won't work.\n * @see [Demo: touch.preventDefault](https://naver.github.io/billboard.js/demo/#Interaction.PreventScrollOnTouch)\n * @example\n * interaction: {\n * enabled: false,\n * brighten: false,\n * inputType: {\n * mouse: true,\n * touch: false\n *\n * // or declare preventDefault explicitly.\n * // In this case touch inputType is enabled by default\n * touch: {\n * preventDefault: true\n *\n * // or threshold pixel value (pixel moved from touchstart to touchmove)\n * preventDefault: 5\n * }\n * },\n *\n * // disable \"onout\" event\n * onout: false\n * }\n */\n interaction_enabled: true,\n interaction_brighten: true,\n interaction_inputType_mouse: true,\n interaction_inputType_touch: {},\n interaction_onout: true\n};\n\nexport { interaction as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport boost from './common/boost.js';\nimport color from './common/color.js';\nimport legend from './common/legend.js';\nimport main from './common/main.js';\nimport title from './common/title.js';\nimport tooltip from './common/tooltip.js';\nimport data from './data/data.js';\nimport interaction from './interaction/interaction.js';\nimport { deepClone } from '../../module/util/object.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n// common\n/**\n * Class to set options on generating chart.\n * - It's instantiated internally, not exposed for public.\n * @class Options\n * @see {@link bb.generate} to use these options on generating the chart\n */\nclass Options {\n static data = {};\n static setOptions(options) {\n for (let i = 0; i < options.length; i++) {\n Object.assign(this.data, options[i]);\n }\n }\n constructor() {\n return deepClone(main, boost, data, color, interaction, legend, title, tooltip, Options.data);\n }\n}\n\nexport { Options as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Elements class.\n * @class Elements\n * @ignore\n * @private\n */\nclass Element {\n constructor() {\n const element = {\n chart: null,\n main: null,\n svg: null,\n axis: {\n x: null,\n y: null,\n y2: null,\n subX: null\n },\n axisTooltip: {\n x: null,\n y: null,\n y2: null\n },\n defs: null,\n tooltip: null,\n legend: null,\n title: null,\n subchart: {\n main: null, // $$.context\n bar: null, // $$.contextBar\n line: null, // $$.contextLine\n area: null // $$.contextArea\n },\n arcs: null,\n bar: null, // mainBar,\n candlestick: null,\n line: null, // mainLine,\n area: null, // mainArea,\n circle: null, // mainCircle,\n radar: null,\n text: null, // mainText,\n grid: {\n main: null, // grid (also focus)\n x: null, // xgrid,\n y: null // ygrid,\n },\n gridLines: {\n main: null, // gridLines\n x: null, // xgridLines,\n y: null // ygridLines\n },\n region: {\n main: null, // region\n list: null // mainRegion\n },\n eventRect: null,\n zoomResetBtn: null // drag zoom reset button\n };\n return element;\n }\n}\n\nexport { Element as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * State class.\n * @class State\n * @ignore\n * @private\n */\nclass State {\n constructor() {\n return {\n // chart drawn area dimension, excluding axes\n width: 0,\n width2: 0,\n height: 0,\n height2: 0,\n margin: {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0\n },\n margin2: {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0\n },\n margin3: {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0\n },\n arcWidth: 0,\n arcHeight: 0,\n xAxisHeight: 0,\n hasAxis: false,\n hasFunnel: false,\n hasRadar: false,\n hasTreemap: false,\n isCanvasMode: false,\n canvasShape: null,\n canvasFocusKey: null,\n canvasSubchartBrushDragging: false,\n canvasSubchartBrushMode: null,\n canvasSubchartBrushStart: null,\n canvasSubchartBrushOrigin: null,\n canvasSubchartBrushMoved: false,\n canvasFlowFrame: null,\n canvasFlowFinish: null,\n canvasFocusMainRedraw: false,\n // for data CSS rule index (used when boost.useCssRule is true)\n cssRule: {},\n // Data loading state (used in scale calculation)\n loading: undefined,\n // Zoom/subchart domain (different from current.domain which is for rendering)\n domain: undefined,\n current: {\n // current domain value. Assigned when is zoom is called\n domain: undefined,\n // chart whole dimension\n width: 0,\n height: 0,\n dataMax: 0,\n maxTickSize: {\n x: {\n width: 0,\n height: 0,\n ticks: [],\n clipPath: 0,\n domain: \"\"\n },\n y: { width: 0, height: 0, domain: \"\" },\n y2: { width: 0, height: 0, domain: \"\" }\n },\n // current used chart type list\n types: [],\n needle: undefined, // arc needle current value\n zoomDomain: null // zoomed domain value\n },\n // legend\n isLegendRight: false,\n isLegendInset: false,\n isLegendTop: false,\n isLegendLeft: false,\n legendStep: 0,\n legendItemWidth: 0,\n legendItemHeight: 0,\n legendHasRendered: false,\n canvasInlineStyle: {\n minHeight: \"\"\n },\n canvasSelection: new Set(),\n canvasSelectionDragStart: null,\n canvasSelectionDragIncluded: new Set(),\n canvasSelectionDragging: false,\n canvasSelectionDragMoved: false,\n canvasSelectionDragMoveHandler: null,\n canvasSelectionDragEndHandler: null,\n eventReceiver: {\n currentIdx: -1, // current event interaction index\n rect: {}, // event rect's clientBoundingRect\n data: [], // event data bound of previoous eventRect\n coords: [] // coordination value of previous eventRect\n },\n axis: {\n x: {\n padding: { left: 0, right: 0 },\n tickCount: 0\n }\n },\n rotatedPadding: {\n left: 30,\n right: 0,\n top: 5\n },\n withoutFadeIn: {},\n inputType: \"\",\n datetimeId: \"\",\n // clip id string\n clip: {\n id: \"\",\n idXAxis: \"\",\n idYAxis: \"\",\n idXAxisTickTexts: \"\",\n idGrid: \"\",\n idSubchart: \"\", // clipIdForSubchart\n path: \"\",\n pathXAxis: \"\",\n pathYAxis: \"\",\n pathXAxisTickTexts: \"\",\n pathGrid: \"\"\n },\n // state\n event: null, // event object\n dragStart: null,\n dragging: false,\n flowing: false,\n cancelClick: false,\n mouseover: false,\n rendered: false,\n transiting: false,\n redrawing: false, // if redraw() is on process\n resizing: false, // resize event called\n toggling: false, // legend toggle\n zooming: false,\n hasNegativeValue: false,\n hasPositiveValue: true,\n orgAreaOpacity: \"0.2\",\n orgConfig: {}, // user original genration config\n // ID strings (Set for O(1) lookup — see isTargetToShow, classFocused, etc.)\n hiddenTargetIds: new Set(),\n hiddenLegendIds: new Set(),\n focusedTargetIds: new Set(),\n defocusedTargetIds: new Set(),\n // value for Arc\n radius: 0,\n innerRadius: 0,\n outerRadius: undefined,\n innerRadiusRatio: 0,\n gaugeArcWidth: 0,\n radiusExpanded: 0,\n // xgrid attribute\n xgridAttr: {\n x1: null,\n x2: null,\n y1: null,\n y2: null\n },\n // RAF batching for zoom/drag interactions\n pendingRaf: null,\n rafBatchQueue: [],\n // Dirty flags for selective redraw\n dirty: {\n data: false, // data changed (load/unload)\n visibility: false, // show/hide toggled\n size: false // dimensions changed\n },\n // Performance: generation counters for cache invalidation\n redrawGeneration: 0, // increments every redraw (for per-redraw caches)\n dataGeneration: 0, // increments on data/visibility changes (for data-dependent caches)\n // Performance: cached values for reuse within redraw cycle\n _targetsToShow: null,\n _cachedDrawShape: null,\n _canvasVisibleRangeCache: null,\n _canvasXDataTickCache: null,\n _canvasXTickValuesCache: null,\n _eventRectFingerprint: null,\n // Performance: throttle tooltip position updates on mousemove\n _lastTooltipMouse: null,\n // Performance: cached grid focus D3 selection\n _gridFocusEl: null,\n // Performance: generateClass() result cache (series IDs are fixed per chart)\n generateClassCache: new Map()\n };\n }\n}\n\nexport { State as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport Element from './Element.js';\nimport State from './State.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n// mapping\nconst classes = {\n element: Element,\n state: State\n};\n/**\n * Internal store class.\n * @class Store\n * @ignore\n * @private\n */\nclass Store {\n constructor() {\n Object.keys(classes).forEach(v => {\n this[v] = new classes[v]();\n });\n }\n getStore(name) {\n return this[name];\n }\n}\n\nexport { Store as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { isString } from './util/type-checks.js';\n\n/**\n * Constant for cache key\n * - NOTE: Prefixed with '$', will be resetted when .load() is called\n * @private\n */\nconst KEY = {\n bubbleBaseLength: \"$baseLength\",\n bubbleMaxValue: \"$bubbleMaxValue\",\n colorPattern: \"__colorPattern__\",\n dataMinMax: \"$dataMinMax\",\n dataTotalSum: \"$dataTotalSum\",\n dataTotalPerIndex: \"$totalPerIndex\",\n domainMinMax: \"$domainMinMax\",\n filteredTargets: \"$filteredTargets\",\n svgLeft: \"$svgLeft\",\n valuesByX: \"$valuesByX\",\n legendItemTextBox: \"legendItemTextBox\",\n legendItemMap: \"$legendItemMap\",\n radarPoints: \"$radarPoints\",\n radarTextWidth: \"$radarTextWidth\",\n setOverOut: \"setOverOut\",\n callOverOutForTouch: \"callOverOutForTouch\",\n textRect: \"textRect\",\n shapeOffset: \"$shapeOffset\",\n maxTickSize: \"$maxTickSize\",\n maxDataCountTarget: \"$maxDataCountTarget\",\n valuesXIndexMap: \"$valuesXIndexMap\"\n};\nclass Cache {\n cache = new Map();\n /**\n * Add cache\n * @param {string} key Cache key\n * @param {string|number|boolean|object|Array|function|null|undefined} value Value to be stored\n * @param {boolean} isDataType Weather the cache is data typed '{id:'data', id_org: 'data', values: [{x:0, index:0,...}, ...]}'\n * @returns {string|number|boolean|object|Array|function|null|undefined} Added data value\n * @private\n */\n add(key, value, isDataType = false) {\n const v = isDataType ? this.cloneTarget(value) : value;\n this.cache.set(key, v);\n return v;\n }\n /**\n * Remove cache\n * @param {string|Array} key Cache key\n * @private\n */\n remove(key) {\n const keys = isString(key) ? [key] : key;\n for (let i = 0; i < keys.length; i++) {\n this.cache.delete(keys[i]);\n }\n }\n /**\n * Get cahce\n * @param {string|Array} key Cache key\n * @param {boolean} isDataType Weather the cache is data typed '{id:'data', id_org: 'data', values: [{x:0, index:0,...}, ...]}'\n * @returns {string|number|boolean|object|Array|function|null} Cached value\n * @private\n */\n get(key, isDataType = false) {\n // when is isDataType, key should be string array\n if (isDataType && Array.isArray(key)) {\n const targets = [];\n for (let i = 0, id; (id = key[i]); i++) {\n if (this.cache.has(id)) {\n targets.push(this.cache.get(id));\n }\n }\n return targets;\n }\n else {\n // use .has() so stored falsy values (false, \"\", 0) aren't reported as a miss\n return this.cache.has(key) ? this.cache.get(key) : null;\n }\n }\n /**\n * Check if cache key exists\n * @param {string} key Cache key\n * @returns {boolean} True if key exists in cache\n * @private\n */\n has(key) {\n return this.cache.has(key);\n }\n /**\n * Get all cache keys\n * @returns {string[]} Array of cache keys\n * @private\n */\n getKeys() {\n return Array.from(this.cache.keys());\n }\n /**\n * Reset cached data\n * @param {boolean} all true: reset all data, false: reset only '$' prefixed key data\n * @param {string[]} excludePrefixes Keys starting with any of these prefixes are preserved\n * @private\n */\n reset(all, excludePrefixes) {\n if (all) {\n this.cache.clear();\n }\n else {\n this.cache.forEach((_, x) => {\n if (/^\\$/.test(x)) {\n if (!excludePrefixes?.some(prefix => x.startsWith(prefix))) {\n this.cache.delete(x);\n }\n }\n });\n }\n }\n /**\n * Clone data target object\n * @param {object} target Data object\n * @returns {object}\n * @private\n */\n cloneTarget(target) {\n return {\n id: target.id,\n id_org: target.id_org,\n values: target.values.map(d => ({ x: d.x, value: d.value, id: d.id }))\n };\n }\n}\n\nexport { KEY, Cache as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { pointer } from 'd3-selection';\nimport { window as win, document as doc } from '../browser.js';\nimport { toArray, mergeObj } from './object.js';\nimport { isString } from './type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n * @ignore\n */\n// Hoisted to module level to avoid recompilation on every addCssRules() call\nconst RE_CSS_BB = /\\s?(bb-)/g;\nconst RE_CSS_DOTS = /\\.+/g;\n/**\n * Convert a CSS selector string to dot-notation class selector\n * @param {string} s Selector string\n * @returns {string}\n * @private\n */\nfunction getCssSelector(s) {\n return s.replace(RE_CSS_BB, \".$1\").replace(RE_CSS_DOTS, \".\");\n}\n// ====================================\n// Internal Helper (Not Exported)\n// ====================================\n/**\n * Get boundingClientRect or BBox with caching.\n * Internal helper for getBoundingRect() and getBBox()\n * @param {boolean} relativeViewport Relative to viewport - true: will use .getBoundingClientRect(), false: will use .getBBox()\n * @param {SVGElement} node Target element\n * @param {boolean} forceEval Force evaluation\n * @returns {object}\n * @private\n */\nfunction _getRect(relativeViewport, node, forceEval = false) {\n const _ = n => n[relativeViewport ? \"getBoundingClientRect\" : \"getBBox\"]();\n // cache per API: getBoundingClientRect(viewport coords) and getBBox(local coords)\n // return different values for the same node and must not share one slot\n const cacheKey = relativeViewport ? \"rectClient\" : \"rectBBox\";\n if (forceEval) {\n return _(node);\n }\n else {\n // will cache the value if the element is not a SVGElement or the width is not set\n const needEvaluate = !(cacheKey in node) || (node.hasAttribute(\"width\") &&\n node[cacheKey].width !== +(node.getAttribute(\"width\") || 0));\n return needEvaluate ? (node[cacheKey] = _(node)) : node[cacheKey];\n }\n}\n// ====================================\n// Exported\n// ====================================\n/**\n * Set text value. If there're multiline add nodes.\n * @param {d3Selection} node Text node\n * @param {string} text Text value string\n * @param {Array} dy dy value for multilined text\n * @param {boolean} toMiddle To be alingned vertically middle\n * @private\n */\nfunction setTextValue(node, text, dy = [-1, 1], toMiddle = false) {\n if (!node || !isString(text)) {\n return;\n }\n if (text.indexOf(\"\\n\") === -1) {\n node.text(text);\n }\n else {\n const diff = [node.text(), text].map(v => v.replace(/[\\s\\n]/g, \"\"));\n if (diff[0] !== diff[1]) {\n const multiline = text.split(\"\\n\");\n const len = toMiddle ? multiline.length - 1 : 1;\n // reset possible text\n node.html(\"\");\n multiline.forEach((v, i) => {\n node.append(\"tspan\")\n .attr(\"x\", 0)\n .attr(\"dy\", `${i === 0 ? dy[0] * len : dy[1]}em`)\n .text(v);\n });\n }\n }\n}\n/**\n * Substitution of SVGPathSeg API polyfill\n * @param {SVGGraphicsElement} path Target svg element\n * @returns {Array}\n * @private\n */\nfunction getRectSegList(path) {\n /*\n * seg1 ---------- seg2\n * | |\n * | |\n * | |\n * seg0 ---------- seg3\n */\n const { x, y, width, height } = getBBox(path, true);\n return [\n { x, y: y + height }, // seg0\n { x, y }, // seg1\n { x: x + width, y }, // seg2\n { x: x + width, y: y + height } // seg3\n ];\n}\n/**\n * Get svg bounding path box dimension\n * @param {SVGGraphicsElement} path Target svg element\n * @returns {object}\n * @private\n */\nfunction getPathBox(path) {\n const { width, height } = getBoundingRect(path);\n const items = getRectSegList(path);\n const x = items[0].x;\n const y = Math.min(items[0].y, items[1].y);\n return {\n x,\n y,\n width,\n height\n };\n}\n/**\n * Get event's current position coordinates\n * @param {object} event Event object\n * @param {SVGElement|HTMLElement} element Target element\n * @returns {Array} [x, y] Coordinates x, y array\n * @private\n */\nfunction getPointer(event, element) {\n const touches = event &&\n (event.touches || (event.sourceEvent && event.sourceEvent.touches))?.[0];\n let pointer$1 = [0, 0];\n try {\n pointer$1 = pointer(touches || event, element);\n }\n catch { }\n return pointer$1.map(v => (isNaN(v) ? 0 : v));\n}\n/**\n * Get boundingClientRect.\n * @param {SVGElement} node Target element\n * @param {boolean} forceEval Force evaluation\n * @returns {object}\n * @private\n */\nfunction getBoundingRect(node, forceEval = false) {\n return _getRect(true, node, forceEval);\n}\n/**\n * Get BBox.\n * @param {SVGElement} node Target element\n * @param {boolean} forceEval Force evaluation\n * @returns {object}\n * @private\n */\nfunction getBBox(node, forceEval = false) {\n return _getRect(false, node, forceEval);\n}\n/**\n * Add CSS rules\n * @param {object} style Style object\n * @param {string} selector Selector string\n * @param {Array} prop Prps arrary\n * @returns {number} Newely added rule index\n * @private\n */\nfunction addCssRules(style, selector, prop) {\n const { rootSelector = \"\", sheet } = style;\n const rule = `${rootSelector} ${getCssSelector(selector)} {${prop.join(\";\")}}`;\n return sheet[sheet.insertRule ? \"insertRule\" : \"addRule\"](rule, sheet.cssRules.length);\n}\n/**\n * Get css rules for specified stylesheets\n * @param {Array} styleSheets The stylesheets to get the rules from\n * @returns {Array}\n * @private\n */\nfunction getCssRules(styleSheets) {\n let rules = [];\n styleSheets.forEach(sheet => {\n try {\n if (sheet.cssRules && sheet.cssRules.length) {\n rules = rules.concat(toArray(sheet.cssRules));\n }\n }\n catch (e) {\n win.console?.warn(`Error while reading rules from ${sheet.href}: ${String(e)}`);\n }\n });\n return rules;\n}\n/**\n * Get current window and container scroll position\n * @param {HTMLElement} node Target element\n * @returns {object} window scroll position\n * @private\n */\nfunction getScrollPosition(node) {\n return {\n x: (win.pageXOffset ?? win.scrollX ?? 0) + (node.scrollLeft ?? 0),\n y: (win.pageYOffset ?? win.scrollY ?? 0) + (node.scrollTop ?? 0)\n };\n}\n/**\n * Get translation string from screen <--> svg point\n * @param {SVGGraphicsElement} node graphics element\n * @param {number} x target x point\n * @param {number} y target y point\n * @param {boolean} inverse inverse flag\n * @returns {object}\n */\nfunction getTransformCTM(node, x = 0, y = 0, inverse = true) {\n const point = new DOMPoint(x, y);\n const screen = node.getScreenCTM();\n const res = point.matrixTransform(inverse ? screen?.inverse() : screen);\n if (inverse === false) {\n const rect = getBoundingRect(node);\n res.x -= rect.x;\n res.y -= rect.y;\n }\n return res;\n}\n/**\n * Gets the SVGMatrix of an SVGGElement\n * @param {SVGElement} node Node element\n * @returns {SVGMatrix} matrix\n * @private\n */\nfunction getTranslation(node) {\n const transform = node ? node.transform : null;\n const baseVal = transform && transform.baseVal;\n return baseVal && baseVal.numberOfItems ?\n baseVal.getItem(0).matrix :\n { a: 0, b: 0, c: 0, d: 0, e: 0, f: 0 };\n}\n/**\n * Get position value from element's attribute or transform\n * @param {SVGElement} element SVG element\n * @param {string} type Coordinate type (\"x\" or \"y\")\n * @returns {number} Position value\n * @private\n */\nfunction getElementPos(element, type) {\n const attr = element?.getAttribute?.(type);\n if (attr) {\n return parseFloat(attr);\n }\n const matrix = getTranslation(element);\n return type === \"x\" ? matrix.e : matrix.f;\n}\n/**\n * Check if svg element has viewBox attribute\n * @param {d3Selection} svg Target svg selection\n * @returns {boolean}\n */\nfunction hasViewBox(svg) {\n const attr = svg.attr(\"viewBox\");\n // a valid viewBox has 4 numeric tokens: \"min-x min-y width height\"\n return attr ? attr.trim().split(/[\\s,]+/).length === 4 : false;\n}\n/**\n * Determine if given node has the specified style\n * @param {d3Selection|SVGElement} node Target node\n * @param {object} condition Conditional style props object\n * @param {boolean} all If true, all condition should be matched\n * @returns {boolean}\n */\nfunction hasStyle(node, condition, all = false) {\n const isD3Node = !!node.node;\n let has = false;\n for (const [key, value] of Object.entries(condition)) {\n has = isD3Node ? node.style(key) === value : node.style[key] === value;\n // any-mode: stop on first match / all-mode: stop on first mismatch\n if (all ? !has : has) {\n break;\n }\n }\n return has;\n}\n/**\n * Return if the current doc is visible or not\n * @returns {boolean}\n * @private\n */\nfunction isTabVisible() {\n return doc?.hidden === false || doc?.visibilityState === \"visible\";\n}\n/**\n * Get the current input type\n * @param {boolean} mouse Config value: interaction.inputType.mouse\n * @param {boolean} touch Config value: interaction.inputType.touch\n * @returns {string} \"mouse\" | \"touch\" | null\n * @private\n */\nfunction convertInputType(mouse, touch) {\n const { DocumentTouch, matchMedia, navigator } = win;\n // https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pointer#coarse\n const hasPointerCoarse = matchMedia?.(\"(pointer:coarse)\").matches;\n let hasTouch = false;\n if (touch) {\n // Some Edge desktop return true: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/20417074/\n if (navigator && \"maxTouchPoints\" in navigator) {\n hasTouch = navigator.maxTouchPoints > 0;\n // Ref: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js\n // On IE11 with IE9 emulation mode, ('ontouchstart' in window) is returning true\n }\n else if (\"ontouchmove\" in win || (DocumentTouch && doc instanceof DocumentTouch)) {\n hasTouch = true;\n }\n else {\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#avoiding_user_agent_detection\n if (hasPointerCoarse) {\n hasTouch = true;\n }\n else {\n // Only as a last resort, fall back to user agent sniffing\n const UA = navigator.userAgent;\n hasTouch = /\\b(BlackBerry|webOS|iPhone|IEMobile)\\b/i.test(UA) ||\n /\\b(Android|Windows Phone|iPad|iPod)\\b/i.test(UA);\n }\n }\n }\n // For non-touch device, media feature condition is: '(pointer:coarse) = false' and '(pointer:fine) = true'\n // https://github.com/naver/billboard.js/issues/3854#issuecomment-2404183158\n const hasMouse = mouse && !hasPointerCoarse && matchMedia?.(\"(pointer:fine)\").matches;\n // fallback to 'mouse' if no input type is detected.\n return (hasMouse && \"mouse\") || (hasTouch && \"touch\") || \"mouse\";\n}\n/**\n * Schedule a RAF update to batch multiple redraw requests\n * Manages a RAF state object to intelligently batch rapid updates while ensuring\n * immediate execution for the first call (for test compatibility)\n * @param {object} rafState RAF state object with pendingRaf property\n * @param {number|null} rafState.pendingRaf ID of pending RAF or null\n * @param {function} callback Function to execute in RAF\n * @returns {void}\n * @private\n */\nfunction scheduleRAFUpdate(rafState, callback) {\n // If there's already a pending RAF, we're in a rapid update scenario\n // Cancel it and schedule a new one to batch the updates\n if (rafState.pendingRaf !== null) {\n win.cancelAnimationFrame(rafState.pendingRaf);\n // Schedule new RAF\n rafState.pendingRaf = win.requestAnimationFrame(() => {\n rafState.pendingRaf = null;\n callback();\n });\n }\n else {\n // First call - execute immediately for test compatibility\n // But set pending RAF to detect rapid consecutive calls\n rafState.pendingRaf = win.requestAnimationFrame(() => {\n rafState.pendingRaf = null;\n });\n callback();\n }\n}\n// emulate event\nconst emulateEvent = {\n mouse: (() => {\n const getParams = () => ({\n bubbles: false,\n cancelable: false,\n screenX: 0,\n screenY: 0,\n clientX: 0,\n clientY: 0\n });\n try {\n // eslint-disable-next-line no-new\n new MouseEvent(\"t\");\n return (el, eventType, params = getParams()) => {\n el.dispatchEvent(new MouseEvent(eventType, params));\n };\n }\n catch {\n // Polyfills DOM4 MouseEvent\n return (el, eventType, params = getParams()) => {\n const mouseEvent = doc.createEvent(\"MouseEvent\");\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent\n mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, win, 0, // the event's mouse click count\n params.screenX, params.screenY, params.clientX, params.clientY, false, false, false, false, 0, null);\n el.dispatchEvent(mouseEvent);\n };\n }\n })(),\n touch: (el, eventType, params) => {\n const touchObj = new Touch(mergeObj({\n identifier: Date.now(),\n target: el,\n radiusX: 2.5,\n radiusY: 2.5,\n rotationAngle: 10,\n force: 0.5\n }, params));\n el.dispatchEvent(new TouchEvent(eventType, {\n cancelable: true,\n bubbles: true,\n shiftKey: true,\n touches: [touchObj],\n targetTouches: [],\n changedTouches: [touchObj]\n }));\n }\n};\n\nexport { addCssRules, convertInputType, emulateEvent, getBBox, getBoundingRect, getCssRules, getElementPos, getPathBox, getPointer, getRectSegList, getScrollPosition, getTransformCTM, getTranslation, hasStyle, hasViewBox, isTabVisible, scheduleRAFUpdate, setTextValue };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { requestIdleCallback, window as win, cancelIdleCallback } from './browser.js';\nimport { isNumber, isArray } from './util/type-checks.js';\nimport { runUntil } from './util/object.js';\nimport { isTabVisible } from './util/dom.js';\n\nconst { setTimeout, clearTimeout } = win;\n/**\n * Generate resize queue function\n * @param {boolean|number} option Resize option\n * @returns {Fucntion}\n * @private\n */\nfunction generateResize(option) {\n const fn = [];\n let timeout;\n const callResizeFn = function () {\n // Delay all resize functions call, to prevent unintended excessive call from resize event\n callResizeFn.clear();\n if (option === false) {\n timeout = requestIdleCallback(() => {\n timeout = null;\n fn.forEach((f) => f());\n }, { timeout: 200 });\n }\n else {\n timeout = setTimeout(() => {\n timeout = null;\n fn.forEach((f) => f());\n }, isNumber(option) ? option : 200);\n }\n };\n callResizeFn.clear = () => {\n if (timeout) {\n (option === false ? cancelIdleCallback : clearTimeout)(timeout);\n timeout = null;\n }\n };\n callResizeFn.add = f => fn.push(f);\n callResizeFn.remove = f => {\n const index = fn.indexOf(f);\n index !== -1 && fn.splice(index, 1);\n };\n return callResizeFn;\n}\n/**\n * Generate transition queue function\n * @returns {function}\n * @private\n */\nfunction generateWait() {\n let transitionsToWait = [];\n // 'f' is called as selection.call(f, ...);\n const f = function (selection, callback) {\n /**\n * Check if transition is complete\n * @returns {boolean} Whether transition is complete\n * @private\n */\n function loop() {\n let done = 0;\n for (let i = 0, t; (t = transitionsToWait[i]); i++) {\n if (t === true || t.empty?.()) {\n done++;\n continue;\n }\n // when tab isn't visible exit loop\n if (isTabVisible() === false) {\n done = transitionsToWait.length;\n break;\n }\n try {\n t.transition();\n }\n catch {\n done++;\n }\n }\n return done === transitionsToWait.length;\n }\n runUntil(() => {\n callback?.();\n }, loop);\n };\n f.add = function (t) {\n isArray(t) ? (transitionsToWait = transitionsToWait.concat(t)) : transitionsToWait.push(t);\n };\n return f;\n}\n\nexport { generateResize, generateWait };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { window as win } from './browser.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n// Store worker cache in memory\nconst cache = {};\n// Correlation id for worker request/response matching\nlet messageId = 0;\n/**\n * Get or create cached worker resources (Object URL, Worker)\n * @param {function} fn Function to be executed in worker\n * @param {Array} depsFn Dependency functions to run given function(fn).\n * @returns {{key: string, src: string}} Cache key and Object URL\n * @private\n */\nfunction getOrCreateWorkerResources(fn, depsFn) {\n const fnString = fn.toString();\n // Include depsFn in cache key to handle different dependencies\n const depsString = depsFn?.map(String).join(\";\") ?? \"\";\n const key = (fnString + depsString).replace(/(function|[\\s\\W\\n])/g, \"\").substring(0, 30);\n if (!(key in cache)) {\n try {\n // Create Blob and Object URL for Web Worker\n const blob = new win.Blob([\n `${depsString}\n\n\t\t\t\tself.onmessage=function({data}) {\n\t\t\t\t\tconst result = (${fnString}).apply(null, data.args);\n\t\t\t\t\tself.postMessage({id: data.id, result});\n\t\t\t\t};`\n ], {\n type: \"text/javascript\"\n });\n cache[key] = {\n src: win.URL.createObjectURL(blob),\n worker: null\n };\n }\n catch {\n return null;\n }\n }\n return { key, src: cache[key].src };\n}\n/**\n * Get or create cached WebWorker instance\n * @param {string} key Cache key\n * @param {string} src URL object as string\n * @returns {Worker} WebWorker instance\n * @private\n */\nfunction getWorker(key, src) {\n const cached = cache[key];\n // Return null if cache entry doesn't exist\n if (!cached) {\n return null;\n }\n if (!cached.worker) {\n try {\n cached.worker = new win.Worker(src);\n }\n catch {\n return null;\n }\n // handle error\n if (cached.worker) {\n cached.worker.onerror = function (e) {\n // eslint-disable-next-line no-console\n console.error ? console.error(e) : console.log(e);\n };\n }\n }\n return cached.worker;\n}\n/**\n * Create and run on Web Worker\n * @param {boolean} useWorker Use Web Worker\n * @param {function} fn Function to be executed in worker\n * @param {function} callback Callback function to receive result from worker\n * @param {Array} depsFn Dependency functions to run given function(fn).\n * @returns {function}\n * @example\n * \tconst worker = runWorker(function(arg) {\n * \t\t // do some tasks...\n * \t\t console.log(\"param:\", A(arg));\n *\n * \t\t return 1234;\n * \t }, function(data) {\n * \t\t // callback after worker is done\n * \t \t console.log(\"result:\", data);\n * \t },\n * \t [function A(){}]\n * \t);\n *\n * \tworker(11111);\n * @private\n */\nfunction runWorker(useWorker = true, fn, callback, depsFn) {\n let runFn = function (...args) {\n const res = fn(...args);\n callback(res);\n };\n if (win.Worker && useWorker) {\n const workerResources = getOrCreateWorkerResources(fn, depsFn);\n const worker = workerResources && getWorker(workerResources.key, workerResources.src);\n if (worker) {\n runFn = function (...args) {\n // workers are cached and shared: match the response by id so concurrent\n // callers don't steal each other's result\n const id = ++messageId;\n const handler = function (e) {\n if (e.data?.id === id) {\n worker.removeEventListener(\"message\", handler);\n callback(e.data.result);\n }\n };\n worker.addEventListener(\"message\", handler);\n worker.postMessage({ id, args });\n };\n }\n }\n return runFn;\n}\n/**\n * Clean-up all cached workers and release resources\n * @private\n */\nfunction cleanupWorkers() {\n for (const key in cache) {\n const cached = cache[key];\n if (cached.worker) {\n cached.worker.terminate();\n }\n if (cached.src) {\n win.URL.revokeObjectURL(cached.src);\n }\n delete cache[key];\n }\n}\n\nexport { cleanupWorkers, getWorker, runWorker };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n * @see https://datatracker.ietf.org/doc/html/rfc4180\n */\nconst QUOTE = 34; // \"\nconst NEWLINE = 10; // \\n\nconst RETURN = 13; // \\r\n/**\n * Create a DSV parser for the specified delimiter.\n * @param {string} delimiter The delimiter character\n * @returns {object} DSV parser object with parse and parseRows methods\n * @private\n */\nfunction dsv(delimiter) {\n const delimiterCode = delimiter.charCodeAt(0);\n /**\n * Parse DSV string into rows of string arrays.\n * @param {string} text DSV string to parse\n * @param {function} [callback] Optional row callback\n * @returns {Array} Parsed rows\n * @private\n */\n function parseRows(text, callback) {\n const rows = [];\n let len = text.length;\n let pos = 0;\n let rowNum = 0;\n let eof = len <= 0;\n let eol = false;\n // Strip BOM\n text.charCodeAt(0) === 0xfeff && pos++;\n // Strip trailing newline\n text.charCodeAt(len - 1) === NEWLINE && --len;\n text.charCodeAt(len - 1) === RETURN && --len;\n /**\n * Get next token from DSV string.\n * @returns {string|null} Next field value, or null for EOL/EOF\n */\n function token() {\n if (eof) {\n return null;\n }\n if (eol) {\n eol = false;\n return null;\n }\n const start = pos;\n let c, end;\n // Quoted value\n if (text.charCodeAt(start) === QUOTE) {\n while (++pos < len) {\n if (text.charCodeAt(pos) === QUOTE) {\n if (text.charCodeAt(pos + 1) !== QUOTE) {\n break;\n }\n pos++;\n }\n }\n if ((end = pos++) >= len) {\n eof = true;\n }\n else if ((c = text.charCodeAt(pos++)) === NEWLINE) {\n eol = true;\n }\n else if (c === RETURN) {\n eol = true;\n text.charCodeAt(pos) === NEWLINE && ++pos;\n }\n return text.slice(start + 1, end).replace(/\"\"/g, \"\\\"\");\n }\n // Unquoted value\n while (pos < len) {\n if ((c = text.charCodeAt(end = pos++)) === NEWLINE) {\n eol = true;\n }\n else if (c === RETURN) {\n eol = true;\n text.charCodeAt(pos) === NEWLINE && ++pos;\n }\n else if (c !== delimiterCode) {\n continue;\n }\n return text.slice(start, end);\n }\n eof = true;\n return text.slice(start, len);\n }\n let t;\n while ((t = token()) !== null) {\n const row = [];\n while (t !== null) {\n row.push(t);\n t = token();\n }\n if (callback) {\n const result = callback(row, rowNum++);\n result != null && rows.push(result);\n }\n else {\n rows.push(row);\n }\n }\n return rows;\n }\n /**\n * Parse DSV string into array of objects using first row as headers.\n * @param {string} text DSV string to parse\n * @param {function} [callback] Optional row callback\n * @returns {Array} Array of objects\n * @private\n */\n function parse(text, callback) {\n let columns = [];\n return parseRows(text, (row, i) => {\n if (i === 0) {\n columns = row;\n return null;\n }\n const obj = {};\n for (let j = 0; j < columns.length; j++) {\n obj[columns[j]] = row[j] ?? \"\";\n }\n return callback ? callback(obj, i - 1, columns) : obj;\n });\n }\n return { parse, parseRows };\n}\nconst csv = dsv(\",\");\nconst tsv = dsv(\"\\t\");\nconst csvParse = csv.parse;\nconst csvParseRows = csv.parseRows;\nconst tsvParse = tsv.parse;\nconst tsvParseRows = tsv.parseRows;\n\nexport { csvParse, csvParseRows, tsvParse, tsvParseRows };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { csvParse, csvParseRows, tsvParse, tsvParseRows } from '../../module/dsv.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/* eslint-disable */\n/***** Functions to be executed on Web Worker *****\n * NOTE: Don't allowed to use\n * - arrow function syntax\n * - Utils functions\n */\n/**\n * Convert Columns data\n * @param {object} columns\n * @returns {Array}\n * @private\n */\nfunction columns(columns) {\n const newRows = [];\n columns.forEach(function (col, i) {\n const key = col[0];\n col.forEach(function (v, j) {\n if (j > 0) {\n if (typeof newRows[j - 1] === \"undefined\") {\n newRows[j - 1] = {};\n }\n if (typeof v === \"undefined\") {\n throw new Error(`Source data is missing a component at (${i}, ${j})!`);\n }\n newRows[j - 1][key] = v;\n }\n });\n });\n return newRows;\n}\n/**\n * Convert Rows data\n * @param {object} columns\n * @returns {Array}\n * @private\n */\nfunction rows(rows) {\n const keys = rows[0];\n const newRows = [];\n rows.forEach(function (row, i) {\n if (i > 0) {\n const newRow = {};\n row.forEach(function (v, j) {\n if (typeof v === \"undefined\") {\n throw new Error(`Source data is missing a component at (${i}, ${j})!`);\n }\n newRow[keys[j]] = v;\n });\n newRows.push(newRow);\n }\n });\n return newRows;\n}\n/**\n * Convert JSON data\n * @param {object} columns\n * @returns {Array}\n * @private\n */\nfunction json(json, keysParam) {\n const newRows = [];\n let targetKeys;\n let data;\n if (Array.isArray(json)) {\n const findValueInJson = function (object, path) {\n if (object[path] !== undefined) {\n return object[path];\n }\n const convertedPath = path.replace(/\\[(\\w+)\\]/g, \".$1\"); // convert indexes to properties (replace [] with .)\n const pathArray = convertedPath.replace(/^\\./, \"\").split(\".\"); // strip a leading dot\n let target = object;\n pathArray.some(function (k) {\n return !(target = target && typeof target === \"object\" && k in target ?\n target[k] :\n undefined);\n });\n return target;\n };\n if (keysParam.x) {\n targetKeys = keysParam.value.concat(keysParam.x);\n }\n else {\n targetKeys = keysParam.value;\n }\n newRows.push(targetKeys);\n json.forEach(function (o) {\n const newRow = targetKeys.map(function (key) {\n // convert undefined to null because undefined data will be removed in convertDataToTargets()\n let v = findValueInJson(o, key);\n if (typeof v === \"undefined\") {\n v = null;\n }\n return v;\n });\n newRows.push(newRow);\n });\n data = rows(newRows);\n }\n else {\n Object.keys(json).forEach(function (key) {\n const tmp = [].concat(json[key]);\n tmp.unshift?.(key);\n newRows.push(tmp);\n });\n data = columns(newRows);\n }\n return data;\n}\n/***** Functions can't be executed on Web Worker *****/\n/**\n * Convert URL data\n * @param {string} url Remote URL\n * @param {string} mimeType MIME type string: json | csv | tsv\n * @param {object} headers Header object\n * @param {object} keys Key object\n * @param {function} done Callback function\n * @private\n */\nfunction url(url, mimeType = \"csv\", headers, keys, done) {\n const req = new XMLHttpRequest();\n const converter = { csv, tsv, json };\n req.open(\"GET\", url);\n if (headers) {\n Object.keys(headers).forEach(function (key) {\n req.setRequestHeader(key, headers[key]);\n });\n }\n req.onreadystatechange = function () {\n if (req.readyState === 4) {\n if (req.status === 200) {\n const response = req.responseText;\n response && done.call(this, converter[mimeType](mimeType === \"json\" ? JSON.parse(response) : response, keys));\n }\n else {\n throw new Error(`${url}: Something went wrong loading!`);\n }\n }\n };\n req.send();\n}\n/**\n * Convert CSV/TSV data\n * @param {object} parser Parser object\n * @param {object} xsv Data\n * @returns {object}\n * @private\n */\nfunction convertCsvTsvToData(parser, xsv) {\n const rows = parser.rows(xsv);\n let d;\n if (rows.length === 1) {\n d = [{}];\n rows[0].forEach(id => {\n d[0][id] = null;\n });\n }\n else {\n d = parser.parse(xsv);\n }\n return d;\n}\nfunction csv(xsv) {\n return convertCsvTsvToData({\n rows: csvParseRows,\n parse: csvParse\n }, xsv);\n}\nfunction tsv(tsv) {\n return convertCsvTsvToData({\n rows: tsvParseRows,\n parse: tsvParse\n }, tsv);\n}\n\nexport { columns, csv, json, rows, tsv, url };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { runWorker } from '../../module/worker.js';\nimport { url, columns, rows, json } from './convert.helper.js';\nimport { toSet } from '../../module/util/object.js';\nimport { isUndefined, isDefined, isValue, notEmpty, isObject, isArray, isEmpty } from '../../module/util/type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Get data key for JSON\n * @param {string|object} keysParam Key params\n * @param {object} config Config object\n * @returns {string} Data key\n * @private\n */\nfunction _getDataKeyForJson(keysParam, config) {\n const keys = keysParam || config?.data_keys;\n if (keys?.x) {\n config.data_x = keys.x;\n }\n return keys;\n}\n/**\n * Set `xs` for each id\n * @param {string[]} ids Ids to set xs\n * @param {object[]} data Data to set xs from\n * @param {object} params Parameters for setting xs\n * @param {boolean} params.appendXs Whether to append xs\n * @param {string[]} params.xs X keys to set xs from\n * @param {boolean} params.categorized Whether the axis is categorized\n * @param {boolean} params.timeSeries Whether the axis is time series\n * @param {boolean} params.customX Whether the x is custom\n * @private\n */\nfunction _setXS(ids, data, params) {\n const $$ = this;\n const { config } = $$;\n let xsData;\n ids.forEach(id => {\n const xKey = $$.getXKey(id);\n if (params.customX || params.timeSeries) {\n // if included in input data\n if (params.xs.indexOf(xKey) >= 0) {\n xsData = ((params.appendXs && $$.data.xs[id]) || [])\n .concat(data.map((d, i) => {\n const rawX = d[xKey];\n return isValue(rawX) ? $$.generateTargetX(rawX, id, i) : false;\n }).filter(v => v !== false));\n }\n else if (config.data_x) {\n // if not included in input data, find from preloaded data of other id's x\n xsData = this.getOtherTargetXs();\n }\n else if (notEmpty(config.data_xs)) {\n // if not included in input data, find from preloaded data\n xsData = $$.getXValuesOfXKey(xKey, $$.data.targets);\n }\n // MEMO: if no x included, use same x of current will be used\n }\n else {\n xsData = data.map((d, i) => i);\n }\n if (xsData) {\n $$.data.xs[id] = xsData;\n }\n else {\n throw new Error(`x is not defined for id = \"${id}\".`);\n }\n });\n}\n/**\n * Data convert\n * @memberof ChartInternal\n * @private\n */\nvar dataConvert = {\n /**\n * Convert data according its type\n * @param {object} args data object\n * @param {function} [callback] callback for url(XHR) type loading\n * @private\n */\n convertData(args, callback) {\n const { config } = this;\n const useWorker = d => d?.length && !isEmpty(d[0]) ? config.boost_useWorker : false;\n let data = args;\n if (args.bindto) {\n data = {};\n [\"url\", \"mimeType\", \"headers\", \"keys\", \"json\", \"rows\", \"columns\"]\n .forEach(v => {\n const key = `data_${v}`;\n if (key in args) {\n data[v] = args[key];\n }\n });\n }\n if (data.url && callback) {\n url(data.url, data.mimeType, data.headers, _getDataKeyForJson(data.keys, config), callback);\n }\n else if (data.json) {\n runWorker(useWorker(data.json), json, callback, [columns, rows])(data.json, _getDataKeyForJson(data.keys, config));\n }\n else if (data.rows) {\n runWorker(useWorker(data.rows), rows, callback)(data.rows);\n }\n else if (data.columns) {\n runWorker(useWorker(data.columns), columns, callback)(data.columns);\n }\n else if (args.bindto) {\n throw Error(\"url or json or rows or columns is required.\");\n }\n },\n /**\n * Convert data to targets\n * @param {object[]} data Data to convert\n * @param {boolean} appendXs Whether to append xs\n * @returns {IData[]} Converted targets\n * @private\n */\n convertDataToTargets(data, appendXs) {\n const $$ = this;\n const { axis, config, state } = $$;\n const chartType = config.data_type;\n const dataKeys = Object.keys(data[0] || {});\n // Extract ids and xs from data keys to handle x and non-x values\n const { ids, xs } = dataKeys.length ?\n dataKeys.reduce((acc, key) => {\n if ($$.isX.call($$, key)) {\n acc.xs.push(key);\n }\n else {\n acc.ids.push(key);\n }\n return acc;\n }, { ids: [], xs: [] }) :\n { ids: [], xs: [] };\n const params = {\n appendXs,\n xs,\n categorized: axis?.isCategorized(),\n timeSeries: axis?.isTimeSeries(),\n customX: axis?.isCustomX()\n };\n // save x for update data by load when custom x and bb.x API\n _setXS.bind($$)(ids, data, params);\n // Build a Map for O(1) category-to-index lookups\n const categoryIndexMap = (params.customX && params.categorized && config.axis_x_categories.length) ?\n new Map(config.axis_x_categories.map((cat, i) => [cat, i])) :\n null;\n // convert to target\n const idConverter = config.data_idConverter.bind($$.api);\n const targets = ids.map((id, index) => {\n const convertedId = idConverter(id);\n const xKey = $$.getXKey(id);\n const isCategory = params.customX && params.categorized;\n const hasCategory = isCategory && index === 0 && (() => {\n const categorySet = toSet(config.axis_x_categories);\n return data.every(v => categorySet.has(v[xKey]));\n })();\n // when .load() with 'append' option is used for indexed axis\n // @ts-ignore\n const isDataAppend = data.__append__;\n const xIndex = xKey === null && isDataAppend ? $$.api.data.values(id).length : 0;\n return {\n id: convertedId,\n id_org: id,\n values: data.map((d, i) => {\n const rawX = d[xKey];\n let value = d[id];\n let x;\n value = value !== null && !isNaN(value) && !isObject(value) ?\n +value :\n (isArray(value) || isObject(value) ? value : null);\n // use x as categories if custom x and categorized\n if ((isCategory || state.hasRadar) && index === 0 && !isUndefined(rawX)) {\n if (!hasCategory && i === 0 && !isDataAppend) {\n config.axis_x_categories = [];\n if (categoryIndexMap) {\n categoryIndexMap.clear();\n }\n }\n const rawXStr = String(rawX);\n x = categoryIndexMap?.get(rawXStr) ?? -1;\n if (x === -1) {\n x = config.axis_x_categories.length;\n config.axis_x_categories.push(rawX);\n categoryIndexMap?.set(rawXStr, x);\n }\n }\n else {\n x = $$.generateTargetX(rawX, id, xIndex + i);\n }\n // mark as x = undefined if value is undefined and filter to remove after mapped\n if (isUndefined(value) || $$.data.xs[id].length <= i) {\n x = undefined;\n }\n return {\n x,\n value,\n id: convertedId,\n index: -1\n };\n }).filter(v => isDefined(v.x))\n };\n });\n // finish targets\n targets.forEach(t => {\n // sort values by its x\n if (config.data_xSort) {\n t.values = t.values.sort((v1, v2) => {\n const x1 = v1.x || v1.x === 0 ? v1.x : Infinity;\n const x2 = v2.x || v2.x === 0 ? v2.x : Infinity;\n return x1 - x2;\n });\n }\n // indexing each value\n t.values.forEach((v, i) => (v.index = i));\n // this needs to be sorted because its index and value.index is identical\n $$.data.xs[t.id]?.sort((v1, v2) => v1 - v2);\n });\n // cache information about values\n state.hasNegativeValue = targets.some(t => t.values.some(v => v.value !== null && v.value < 0));\n state.hasPositiveValue = targets.some(t => t.values.some(v => v.value !== null && v.value > 0));\n // set target types\n if (chartType && $$.isValidChartType(chartType)) {\n const targetIds = $$.mapToIds(targets)\n .filter(id => !(id in config.data_types) || !$$.isValidChartType(config.data_types[id]));\n $$.setTargetType(targetIds, chartType);\n }\n // cache as original id keyed\n targets.forEach(d => $$.cache.add(d.id_org, d, true));\n return targets;\n }\n};\n\nexport { dataConvert as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { select } from 'd3-selection';\nimport { $BAR, $COMMON, $CANDLESTICK } from '../../config/classes.js';\nimport { KEY } from '../../module/Cache.js';\nimport { isArray, isNumber, isObject, isUndefined, isValue, isString, isBoolean, isObjectType, notEmpty, isFunction, isDefined } from '../../module/util/type-checks.js';\nimport { getScrollPosition, hasViewBox, getTransformCTM } from '../../module/util/dom.js';\nimport { getUnique, mergeArray, sortValue, parseDate, hasValue, findIndex } from '../../module/util/object.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n// ranged data key-to-index lookup, used by getRangedData()\nconst rangedDataKeyIndex = {\n areaRange: { high: 0, mid: 1, low: 2 },\n candlestick: { open: 0, high: 1, low: 2, close: 3, volume: 4 }\n};\n/**\n * Normalize target ids to an array\n * @param {Array|string} targetIds Target ids\n * @returns {Array} Target ids array\n * @private\n */\nfunction normalizeTargetIds(targetIds) {\n return (isArray(targetIds) ? targetIds : [targetIds]);\n}\nvar data = {\n isX(key) {\n const $$ = this;\n const { config } = $$;\n const dataKey = config.data_x && key === config.data_x;\n const existValue = notEmpty(config.data_xs) && hasValue(config.data_xs, key);\n return dataKey || existValue;\n },\n isStackNormalized() {\n const { config } = this;\n return !!((config.data_stack_normalize === true ||\n isObjectType(config.data_stack_normalize)) &&\n config.data_groups.length);\n },\n /**\n * Check if stack normalization should be applied per group\n * @returns {boolean}\n * @private\n */\n isStackNormalizedPerGroup() {\n const { config } = this;\n return !!(isObjectType(config.data_stack_normalize) &&\n config.data_stack_normalize?.perGroup &&\n config.data_groups.length);\n },\n /**\n * Check if given id is grouped data or has grouped data\n * @param {string} id Data id value\n * @returns {boolean} is grouped data or has grouped data\n * @private\n */\n isGrouped(id) {\n const groups = this.config.data_groups;\n return id ? groups.some(v => v.indexOf(id) >= 0 && v.length > 1) : groups.length > 0;\n },\n /**\n * Check if the given axis has any grouped data\n * @param {string} axisId Axis ID (e.g., \"y\", \"y2\")\n * @returns {boolean} true if axis has grouped data\n * @private\n */\n hasAxisGroupedData(axisId) {\n const $$ = this;\n const { axis } = $$;\n const targets = $$.data.targets;\n // Get all data IDs that belong to this axis\n const axisDataIds = targets\n .filter(t => axis.getId(t.id) === axisId)\n .map(t => t.id);\n // Check if any of the axis data IDs are in groups\n return axisDataIds.some(id => $$.isGrouped(id));\n },\n getXKey(id) {\n const $$ = this;\n const { config } = $$;\n return config.data_x ?\n config.data_x :\n (notEmpty(config.data_xs) ? config.data_xs[id] : null);\n },\n getXValuesOfXKey(key, targets) {\n const $$ = this;\n const ids = targets && notEmpty(targets) ? $$.mapToIds(targets) : [];\n let xValues;\n ids.forEach(id => {\n if ($$.getXKey(id) === key) {\n xValues = $$.data.xs[id];\n }\n });\n return xValues;\n },\n /**\n * Get index number based on given x Axis value\n * @param {Date|number|string} x x Axis to be compared\n * @param {Array} basedX x Axis list to be based on\n * @returns {number} index number\n * @private\n */\n getIndexByX(x, basedX) {\n const $$ = this;\n return basedX ?\n basedX.indexOf(isString(x) ? x : +x) :\n ($$.filterByX($$.data.targets, x)[0] || { index: null }).index;\n },\n getXValue(id, i) {\n const $$ = this;\n return id in $$.data.xs &&\n $$.data.xs[id] &&\n isValue($$.data.xs[id][i]) ?\n $$.data.xs[id][i] :\n i;\n },\n getOtherTargetXs() {\n const $$ = this;\n const idsForX = Object.keys($$.data.xs);\n return idsForX.length ? $$.data.xs[idsForX[0]] : null;\n },\n getOtherTargetX(index) {\n const xs = this.getOtherTargetXs();\n return xs && index < xs.length ? xs[index] : null;\n },\n addXs(xs) {\n const $$ = this;\n const { config } = $$;\n Object.keys(xs).forEach(id => {\n config.data_xs[id] = xs[id];\n });\n },\n /**\n * Determine if x axis is multiple\n * @returns {boolean} true: multiple, false: single\n * @private\n */\n isMultipleX() {\n return !this.config.axis_x_forceAsSingle && (notEmpty(this.config.data_xs) ||\n this.hasType(\"bubble\") ||\n this.hasType(\"scatter\"));\n },\n addName(data) {\n const $$ = this;\n const { config } = $$;\n let name;\n if (data) {\n name = config.data_names[data.id];\n data.name = name !== undefined ? name : data.id;\n }\n return data;\n },\n /**\n * Get all values on given index\n * @param {number} index Index\n * @param {boolean} filterNull Filter nullish value\n * @returns {Array}\n * @private\n */\n getAllValuesOnIndex(index, filterNull = false) {\n const $$ = this;\n let value = $$.filterTargetsToShow($$.data.targets)\n .map(t => $$.addName($$.getValueOnIndex(t.values, index)));\n if (filterNull) {\n value = value.filter(v => v && \"value\" in v && isValue(v.value));\n }\n return value;\n },\n getValueOnIndex(values, index) {\n // Fast path: values are sorted by index from convertDataToTargets\n if (values[index]?.index === index) {\n return values[index];\n }\n // Fallback for sparse/reordered data\n const valueOnIndex = values.filter(v => v.index === index);\n return valueOnIndex.length ? valueOnIndex[0] : null;\n },\n updateTargetX(targets, x) {\n const $$ = this;\n targets.forEach(t => {\n t.values.forEach((v, i) => {\n v.x = $$.generateTargetX(x[i], t.id, i);\n });\n $$.data.xs[t.id] = x;\n });\n },\n updateTargetXs(targets, xs) {\n const $$ = this;\n targets.forEach(t => {\n xs[t.id] && $$.updateTargetX([t], xs[t.id]);\n });\n },\n generateTargetX(rawX, id, index) {\n const $$ = this;\n const { axis } = $$;\n let x = axis?.isCategorized() ? index : (rawX || index);\n if (axis?.isTimeSeries()) {\n const fn = parseDate.bind($$);\n x = rawX ? fn(rawX) : fn($$.getXValue(id, index));\n }\n else if (axis?.isCustomX() && !axis?.isCategorized()) {\n x = isValue(rawX) ? +rawX : $$.getXValue(id, index);\n }\n return x;\n },\n updateXs(values) {\n if (values.length) {\n this.axis.xs = values.map(v => v.x);\n }\n },\n getPrevX(i) {\n const x = this.axis.xs[i - 1];\n return isDefined(x) ? x : null;\n },\n getNextX(i) {\n const x = this.axis.xs[i + 1];\n return isDefined(x) ? x : null;\n },\n /**\n * Get base value isAreaRangeType\n * @param {object} data Data object\n * @returns {number}\n * @private\n */\n getBaseValue(data) {\n const $$ = this;\n const { hasAxis } = $$.state;\n let { value } = data;\n // In case of area-range, data is given as: [low, mid, high] or {low, mid, high}\n // will take the 'mid' as the base value\n if (value && hasAxis) {\n if ($$.isAreaRangeType(data)) {\n value = $$.getRangedData(data, \"mid\");\n }\n else if ($$.isBubbleZType(data)) {\n value = $$.getBubbleZData(value, \"y\");\n }\n }\n return value;\n },\n /**\n * Get min/max value from the data\n * @private\n * @param {Array} data array data to be evaluated\n * @returns {{min: {number}, max: {number}}}\n */\n getMinMaxValue(data) {\n const getBaseValue = this.getBaseValue.bind(this);\n let min = Infinity;\n let max = -Infinity;\n const targets = data || this.data.targets.map(t => t.values);\n for (let i = 0; i < targets.length; i++) {\n const v = targets[i];\n for (let j = 0; j < v.length; j++) {\n const val = getBaseValue(v[j]);\n if (isNumber(val)) {\n if (val < min)\n min = val;\n if (val > max)\n max = val;\n }\n }\n }\n return { min, max };\n },\n /**\n * Get the min/max data\n * @private\n * @returns {{min: Array, max: Array}}\n */\n getMinMaxData() {\n const $$ = this;\n const cacheKey = KEY.dataMinMax;\n let minMaxData = $$.cache.get(cacheKey);\n if (!minMaxData) {\n const data = $$.data.targets.map(t => t.values);\n const minMax = $$.getMinMaxValue(data);\n const min = [];\n const max = [];\n // Cache the getFilteredDataByValue function calls\n const { min: minVal, max: maxVal } = minMax;\n data.forEach(v => {\n const minData = $$.getFilteredDataByValue(v, minVal);\n const maxData = $$.getFilteredDataByValue(v, maxVal);\n if (minData.length) {\n for (let i = 0; i < minData.length; i++) {\n min.push(minData[i]);\n }\n }\n if (maxData.length) {\n for (let i = 0; i < maxData.length; i++) {\n max.push(maxData[i]);\n }\n }\n });\n // update the cached data\n $$.cache.add(cacheKey, minMaxData = { min, max });\n }\n return minMaxData;\n },\n /**\n * Get sum of data per index\n * @param {string} targetId Target ID to get total for (only for normalized stack per group)\n * @private\n * @returns {Array}\n */\n getTotalPerIndex(targetId) {\n const $$ = this;\n const { config } = $$;\n const cacheKey = targetId ? `${KEY.dataTotalPerIndex}-${targetId}` : KEY.dataTotalPerIndex;\n let sum = $$.cache.get(cacheKey);\n if (($$.config.data_groups.length || $$.isStackNormalized()) && !sum) {\n sum = [];\n // When normalize per group is enabled and targetId is provided,\n // only sum data within the same group\n let { targets } = $$.data;\n if ($$.isStackNormalizedPerGroup() && targetId) {\n // Find which group the target belongs to\n const group = config.data_groups.find(g => g.indexOf(targetId) >= 0);\n if (group) {\n // Only sum targets in the same group\n targets = targets.filter(t => group.indexOf(t.id) >= 0);\n }\n else {\n // If target is not in any group, return null to indicate no normalization\n return null;\n }\n }\n targets.forEach(row => {\n row.values.forEach((v, i) => {\n if (!sum[i]) {\n sum[i] = 0;\n }\n sum[i] += isNumber(v.value) ? v.value : 0;\n });\n });\n $$.cache.add(cacheKey, sum);\n }\n return sum;\n },\n /**\n * Get total data sum\n * @param {boolean} subtractHidden Subtract hidden data from total\n * @returns {number}\n * @private\n */\n getTotalDataSum(subtractHidden) {\n const $$ = this;\n const cacheKey = KEY.dataTotalSum;\n let total = $$.cache.get(cacheKey);\n if (!isNumber(total)) {\n total = $$.data.targets.reduce((acc, t) => {\n return acc + t.values.reduce((sum, v) => sum + (v.value ?? 0), 0);\n }, 0);\n $$.cache.add(cacheKey, total);\n }\n if (subtractHidden) {\n total -= $$.getHiddenTotalDataSum();\n }\n return total;\n },\n /**\n * Get total hidden data sum\n * @returns {number}\n * @private\n */\n getHiddenTotalDataSum() {\n const $$ = this;\n const { api, state: { hiddenTargetIds } } = $$;\n let total = 0;\n if (hiddenTargetIds.size) {\n total = api.data.values.bind(api)([...hiddenTargetIds])\n .reduce((p, c) => p + c, 0);\n }\n return total;\n },\n /**\n * Get filtered data by value\n * @param {object} data Data\n * @param {number} value Value to be filtered\n * @returns {Array} filtered array data\n * @private\n */\n getFilteredDataByValue(data, value) {\n return data.filter(t => this.getBaseValue(t) === value);\n },\n /**\n * Return the max length of the data\n * @returns {number} max data length\n * @private\n */\n getMaxDataCount() {\n const { targets } = this.data;\n let max = 0;\n for (let i = 0; i < targets.length; i++) {\n if (targets[i].values.length > max) {\n max = targets[i].values.length;\n }\n }\n return max;\n },\n getMaxDataCountTarget() {\n const $$ = this;\n const { cache, state } = $$;\n const cached = cache.get(KEY.maxDataCountTarget);\n if (cached && cached.generation === state.dataGeneration) {\n return cached.value;\n }\n let target = $$.filterTargetsToShow() || [];\n const length = target.length;\n const isInverted = $$.config.axis_x_inverted;\n if (length > 1) {\n const allX = [];\n for (let i = 0; i < target.length; i++) {\n const values = target[i].values;\n for (let j = 0; j < values.length; j++) {\n allX.push(values[j].x);\n }\n }\n target = allX;\n target = sortValue(getUnique(target))\n .map((x, index, array) => ({\n x,\n index: isInverted ? array.length - index - 1 : index\n }));\n }\n else if (length) {\n target = target[0].values.concat();\n }\n cache.add(KEY.maxDataCountTarget, { value: target, generation: state.dataGeneration });\n return target;\n },\n mapToIds(targets) {\n return targets.map(d => d.id);\n },\n mapToTargetIds(ids) {\n const $$ = this;\n return ids ? (isArray(ids) ? ids.concat() : [ids]) : $$.mapToIds($$.data.targets);\n },\n hasTarget(targets, id) {\n const ids = this.mapToIds(targets);\n for (let i = 0, val; (val = ids[i]); i++) {\n if (val === id) {\n return true;\n }\n }\n return false;\n },\n isTargetToShow(targetId) {\n return !this.state.hiddenTargetIds.has(targetId);\n },\n isLegendToShow(targetId) {\n return !this.state.hiddenLegendIds.has(targetId);\n },\n getTargetsToShow() {\n const { state } = this;\n return state._targetsToShow ?? this.filterTargetsToShow();\n },\n filterTargetsToShow(targets) {\n const $$ = this;\n // When called without arguments, use caching\n if (!targets) {\n const { cache, data, state } = $$;\n const cacheKey = KEY.filteredTargets;\n const cached = cache.get(cacheKey);\n // Return cached result if generation matches\n if (cached && cached.generation === state.dataGeneration) {\n return cached.value;\n }\n // Compute and cache result\n const filtered = data.targets.filter(t => $$.isTargetToShow(t.id));\n cache.add(cacheKey, { value: filtered, generation: state.dataGeneration });\n return filtered;\n }\n // When called with custom targets, don't cache\n return targets.filter(t => $$.isTargetToShow(t.id));\n },\n mapTargetsToUniqueXs(targets) {\n const $$ = this;\n const { axis } = $$;\n let xs = [];\n if (targets?.length) {\n xs = getUnique(mergeArray(targets.map(t => t.values.map(v => +v.x))));\n xs = axis?.isTimeSeries() ? xs.map(x => new Date(+x)) : xs.map(Number);\n }\n return sortValue(xs);\n },\n /**\n * Add to thetarget Ids\n * @param {string} type State's prop name\n * @param {Array|string} targetIds Target ids array\n * @private\n */\n addTargetIds(type, targetIds) {\n const { state } = this;\n normalizeTargetIds(targetIds).forEach(v => state[type].add(v));\n },\n /**\n * Remove from the state target Ids\n * @param {string} type State's prop name\n * @param {Array|string} targetIds Target ids array\n * @private\n */\n removeTargetIds(type, targetIds) {\n const { state } = this;\n normalizeTargetIds(targetIds).forEach(v => state[type].delete(v));\n },\n addHiddenTargetIds(targetIds) {\n this.addTargetIds(\"hiddenTargetIds\", targetIds);\n },\n removeHiddenTargetIds(targetIds) {\n this.removeTargetIds(\"hiddenTargetIds\", targetIds);\n },\n addHiddenLegendIds(targetIds) {\n this.addTargetIds(\"hiddenLegendIds\", targetIds);\n },\n removeHiddenLegendIds(targetIds) {\n this.removeTargetIds(\"hiddenLegendIds\", targetIds);\n },\n getValuesAsIdKeyed(targets) {\n const $$ = this;\n const { hasAxis } = $$.state;\n const ys = {};\n const isMultipleX = $$.isMultipleX();\n let xIndexMap = null;\n if (isMultipleX) {\n const cached = $$.cache.get(KEY.valuesXIndexMap);\n if (cached && cached.generation === $$.state.dataGeneration) {\n xIndexMap = cached.value;\n }\n else {\n const xs = $$.mapTargetsToUniqueXs($$.data.targets)\n .map(v => (isString(v) ? v : +v));\n xIndexMap = new Map(xs.map((x, i) => [x, i]));\n $$.cache.add(KEY.valuesXIndexMap, {\n value: xIndexMap,\n generation: $$.state.dataGeneration\n });\n }\n }\n targets.forEach(t => {\n const data = [];\n t.values\n .filter(({ value }) => isValue(value) || value === null)\n .forEach(v => {\n let { value } = v;\n // exclude 'volume' value to correct mis domain calculation\n if (value !== null && $$.isCandlestickType(v)) {\n value = isArray(value) ?\n value.slice(0, 4) :\n [value.open, value.high, value.low, value.close];\n }\n if (isArray(value)) {\n data.push(...value);\n }\n else if (isObject(value) && \"high\" in value) {\n data.push(...Object.values(value));\n }\n else if ($$.isBubbleZType(v)) {\n data.push(hasAxis && $$.getBubbleZData(value, \"y\"));\n }\n else {\n if (isMultipleX && xIndexMap) {\n // Use Map for O(1) lookup instead of getIndexByX which uses indexOf\n const xKey = isString(v.x) ? v.x : +v.x;\n const index = xIndexMap.get(xKey);\n if (index !== undefined) {\n data[index] = value;\n }\n }\n else {\n data.push(value);\n }\n }\n });\n ys[t.id] = data;\n });\n return ys;\n },\n hasMultiTargets() {\n return this.filterTargetsToShow().length > 1;\n },\n /**\n * Sort targets data\n * Note: For stacked bar, will sort from the total sum of data series, not for each stacked bar\n * @param {Array} targetsValue Target value\n * @returns {Array}\n * @private\n */\n orderTargets(targetsValue) {\n const $$ = this;\n const targets = targetsValue.slice();\n const fn = $$.getSortCompareFn();\n fn && targets.sort(fn);\n return targets;\n },\n /**\n * Get data.order compare function\n * @param {boolean} isReversed for Arc & Treemap type sort order needs to be reversed\n * @returns {function} compare function\n * @private\n */\n getSortCompareFn(isReversed = false) {\n const $$ = this;\n const { config } = $$;\n const order = config.data_order;\n const orderAsc = /asc/i.test(order);\n const orderDesc = /desc/i.test(order);\n let fn;\n if (orderAsc || orderDesc) {\n const reducer = (p, c) => p + Math.abs(c.value);\n const sum = v => (isNumber(v) ? v : (\"values\" in v ? v.values.reduce(reducer, 0) : v.value));\n fn = (t1, t2) => {\n const t1Sum = sum(t1);\n const t2Sum = sum(t2);\n return isReversed ?\n (orderAsc ? t1Sum - t2Sum : t2Sum - t1Sum) :\n (orderAsc ? t2Sum - t1Sum : t1Sum - t2Sum);\n };\n }\n else if (isFunction(order)) {\n fn = order.bind($$.api);\n }\n return fn || null;\n },\n filterByX(targets, x) {\n return this.getValuesByX(targets).get(this.getXCacheKey(x)) || [];\n },\n filterNullish(data) {\n const filter = v => isValue(v.value);\n return data ?\n data.filter(v => \"value\" in v ? filter(v) : v.values.some(filter)) :\n data;\n },\n filterRemoveNull(data) {\n return data.filter(d => isValue(this.getBaseValue(d)));\n },\n filterByXDomain(targets, xDomain) {\n return targets.map(t => ({\n id: t.id,\n id_org: t.id_org,\n values: t.values.filter(v => xDomain[0] <= v.x && v.x <= xDomain[1])\n }));\n },\n hasDataLabel() {\n const dataLabels = this.config.data_labels;\n return (isBoolean(dataLabels) && dataLabels) ||\n (isObjectType(dataLabels) && notEmpty(dataLabels));\n },\n /**\n * Determine if has null value\n * @param {Array} targets Data array to be evaluated\n * @returns {boolean}\n * @private\n */\n hasNullDataValue(targets) {\n return targets.some(({ value }) => value === null);\n },\n /**\n * Get data index from the event coodinates\n * @param {Event} event Event object\n * @returns {number}\n * @private\n */\n getDataIndexFromEvent(event) {\n const $$ = this;\n const { $el, config, state: { hasRadar, inputType, eventReceiver: { coords, rect } } } = $$;\n let index;\n if (hasRadar) {\n let target = event.target;\n // in case of multilined axis text\n if (/tspan/i.test(target.tagName)) {\n target = target.parentNode;\n }\n const d = select(target).datum();\n index = d && Object.keys(d).length === 1 ? d.index : undefined;\n }\n else {\n const isRotated = config.axis_rotated;\n const scrollPos = getScrollPosition($el.chart.node());\n // get data based on the mouse coords\n const e = inputType === \"touch\" && event.changedTouches ?\n event.changedTouches[0] :\n event;\n let point = isRotated ? e.clientY + scrollPos.y : e.clientX + scrollPos.x;\n if (hasViewBox($el.svg)) {\n const pos = [point, 0];\n isRotated && pos.reverse();\n point = getTransformCTM($el.eventRect.node(), ...pos)[isRotated ? \"y\" : \"x\"];\n }\n else {\n point -= isRotated ? rect.top : rect.left;\n }\n index = findIndex(coords, point, 0, coords.length - 1, isRotated);\n }\n return index;\n },\n getDataLabelLength(min, max, key) {\n const $$ = this;\n const paddingCoef = 1.3;\n const values = [min, max].map(v => $$.dataLabelFormat()(v));\n if ($$.config.render_mode === \"canvas\" && !$$.$el.svg) {\n const chart = $$.$el.chart?.node?.();\n const doc = chart?.ownerDocument;\n const svg = doc?.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n if (chart && svg) {\n const texts = values.map(value => {\n const text = doc.createElementNS(\"http://www.w3.org/2000/svg\", \"text\");\n text.textContent = value;\n svg.appendChild(text);\n return text;\n });\n svg.style.cssText =\n \"position:absolute;visibility:hidden;left:-10000px;top:-10000px;\";\n chart.appendChild(svg);\n const lengths = texts.map(text => text.getBoundingClientRect()[key] * paddingCoef);\n svg.remove();\n return lengths;\n }\n }\n return $$.getTextRect(values)?.map((rect) => rect[key] * paddingCoef) || [0, 0];\n },\n isNoneArc(d) {\n return this.hasTarget(this.data.targets, d.id);\n },\n isArc(d) {\n return \"data\" in d && this.hasTarget(this.data.targets, d.data.id);\n },\n findSameXOfValues(values, index) {\n const targetX = values[index].x;\n const sames = [];\n let i;\n for (i = index - 1; i >= 0; i--) {\n if (targetX !== values[i].x) {\n break;\n }\n sames.push(values[i]);\n }\n for (i = index; i < values.length; i++) {\n if (targetX !== values[i].x) {\n break;\n }\n sames.push(values[i]);\n }\n return sames;\n },\n /**\n * Get normalized x value cache key.\n * @param {Date|number|string} x X value\n * @returns {number|string} Cache key value\n * @private\n */\n getXCacheKey(x) {\n return isString(x) ? x : +x;\n },\n /**\n * Get data rows grouped by x value.\n * @param {Array} targets Data targets\n * @returns {Map} X-value keyed data rows\n * @private\n */\n getValuesByX(targets) {\n const $$ = this;\n const { cache, state } = $$;\n const targetKey = targets.map(t => {\n const { values } = t;\n const first = values[0];\n const last = values[values.length - 1];\n return `${t.id}:${values.length}:${first ? $$.getXCacheKey(first.x) : \"\"}:${last ? $$.getXCacheKey(last.x) : \"\"}`;\n }).join(\"|\");\n const cached = cache.get(KEY.valuesByX);\n if (cached &&\n cached.generation === state.dataGeneration &&\n cached.targetKey === targetKey) {\n return cached.value;\n }\n const valueMap = new Map();\n for (let i = 0; i < targets.length; i++) {\n const values = targets[i].values;\n for (let j = 0; j < values.length; j++) {\n const v = values[j];\n const x = $$.getXCacheKey(v.x);\n const rows = valueMap.get(x);\n rows ? rows.push(v) : valueMap.set(x, [v]);\n }\n }\n cache.add(KEY.valuesByX, {\n generation: state.dataGeneration,\n targetKey,\n value: valueMap\n });\n return valueMap;\n },\n /**\n * Get candidate values near the current pointer position.\n * @param {Array} values Data values\n * @param {Array} pos Pointer position\n * @param {boolean} useSortedIndex Whether values are sorted target values\n * @returns {Array} Candidate values\n * @private\n */\n getClosestCandidates(values, pos, useSortedIndex = true) {\n const $$ = this;\n const { config, scale } = $$;\n const len = values.length;\n const first = values[0];\n if (!useSortedIndex || len < 200 || !first || !config.data_xSort) {\n return values;\n }\n const isBar = $$.isBarType(first.id);\n const isCandle = $$.isCandlestickType(first.id);\n const sensitivity = config.point_sensitivity;\n if (!(isBar || isCandle) && !isNumber(sensitivity)) {\n return values;\n }\n const xScale = scale.zoom || scale.x;\n const pointerX = pos[+config.axis_rotated];\n const isAscending = xScale(values[0].x) <= xScale(values[len - 1].x);\n let start = 0;\n let end = len - 1;\n while (start < end) {\n const mid = (start + end) >> 1;\n const x = xScale(values[mid].x);\n if (isAscending ? x < pointerX : x > pointerX) {\n start = mid + 1;\n }\n else {\n end = mid;\n }\n }\n const candidates = [];\n const visited = new Set();\n const add = (index) => {\n if (index >= 0 && index < len && !visited.has(index)) {\n visited.add(index);\n candidates.push(values[index]);\n }\n };\n const addSameX = (index) => {\n if (index < 0 || index >= len) {\n return;\n }\n const x = $$.getXCacheKey(values[index].x);\n let i = index;\n while (i >= 0 && $$.getXCacheKey(values[i].x) === x) {\n add(i--);\n }\n i = index + 1;\n while (i < len && $$.getXCacheKey(values[i].x) === x) {\n add(i++);\n }\n };\n if (isBar || isCandle) {\n for (let i = start - 2; i <= start + 2; i++) {\n addSameX(i);\n }\n }\n else {\n const maxDx = sensitivity;\n const scan = (index, direction) => {\n for (let i = index; i >= 0 && i < len; i += direction) {\n const v = values[i];\n if (Math.abs(xScale(v.x) - pointerX) > maxDx) {\n break;\n }\n add(i);\n }\n };\n scan(start, 1);\n scan(start - 1, -1);\n }\n return candidates;\n },\n findClosestFromTargets(targets, pos) {\n const $$ = this;\n const candidates = [];\n for (let i = 0; i < targets.length; i++) {\n const closest = $$.findClosest(targets[i].values, pos);\n closest && candidates.push(closest);\n }\n // decide closest point and return\n return $$.findClosest(candidates, pos, false);\n },\n findClosest(values, pos, useSortedIndex = true) {\n const $$ = this;\n const { $el: { main } } = $$;\n const data = $$.getClosestCandidates(values, pos, useSortedIndex);\n let minDist;\n let closest;\n // find mouseovering bar/candlestick and closest point in a single pass\n // https://github.com/naver/billboard.js/issues/2434\n for (let i = 0; i < data.length; i++) {\n const v = data[i];\n if (!v || !isValue(v.value)) {\n continue;\n }\n const isBar = $$.isBarType(v.id);\n const isCandle = $$.isCandlestickType(v.id);\n if (isBar || isCandle) {\n const selector = isBar ?\n `.${$BAR.chartBar}.${$COMMON.target}${$$.getTargetSelectorSuffix(v.id)} .${$BAR.bar}-${v.index}` :\n `.${$CANDLESTICK.chartCandlestick}.${$COMMON.target}${$$.getTargetSelectorSuffix(v.id)} .${$CANDLESTICK.candlestick}-${v.index} path`;\n if (!closest && $$.isWithinBar(main.select(selector).node())) {\n closest = v;\n }\n }\n else {\n const d = $$.dist(v, pos);\n const sensitivity = $$.getPointSensitivity(v);\n if (d < sensitivity && (minDist === undefined || d < minDist)) {\n minDist = d;\n closest = v;\n }\n }\n }\n return closest;\n },\n dist(data, pos) {\n const $$ = this;\n const { config: { axis_rotated: isRotated }, scale } = $$;\n const xIndex = +isRotated; // true: 1, false: 0\n const yIndex = +!isRotated; // true: 0, false: 1\n const y = $$.circleY(data, data.index);\n const x = (scale.zoom || scale.x)(data.x);\n const dx = x - pos[xIndex];\n const dy = y - pos[yIndex];\n return Math.sqrt(dx * dx + dy * dy);\n },\n /**\n * Convert data for step type\n * @param {Array} values Object data values\n * @returns {Array}\n * @private\n */\n convertValuesToStep(values) {\n const $$ = this;\n const { axis, config } = $$;\n const stepType = config.line_step_type;\n const isCategorized = axis ? axis.isCategorized() : false;\n const converted = isArray(values) ? values.concat() : [values];\n if (!(isCategorized || /step\\-(after|before)/.test(stepType))) {\n return values;\n }\n // when all data are null, return empty array\n // https://github.com/naver/billboard.js/issues/3124\n if (converted.length) {\n // insert & append cloning first/last value to be fully rendered covering on each gap sides\n const head = converted[0];\n const tail = converted[converted.length - 1];\n const { id } = head;\n let { x } = head;\n // insert head\n converted.unshift({ x: --x, value: head.value, id });\n isCategorized && stepType === \"step-after\" &&\n converted.unshift({ x: x - 1, value: head.value, id });\n // append tail\n x = tail.x;\n converted.push({ x: ++x, value: tail.value, id });\n isCategorized && stepType === \"step-before\" &&\n converted.push({ x: x + 1, value: tail.value, id });\n }\n return converted;\n },\n convertValuesToRange(values) {\n const converted = isArray(values) ? values.concat() : [values];\n const ranges = [];\n converted.forEach(range => {\n const { x, id } = range;\n ranges.push({\n x,\n id,\n value: range.value[0]\n });\n ranges.push({\n x,\n id,\n value: range.value[2]\n });\n });\n return ranges;\n },\n updateDataAttributes(name, attrs) {\n const $$ = this;\n const { config } = $$;\n const current = config[`data_${name}`];\n if (isUndefined(attrs)) {\n return current;\n }\n Object.keys(attrs).forEach(id => {\n current[id] = attrs[id];\n });\n $$.redraw({ withLegend: true });\n return current;\n },\n getRangedData(d, key = \"\", type = \"areaRange\") {\n const value = d?.value;\n if (isArray(value)) {\n if (type === \"bar\") {\n return value.reduce((a, c) => c - a);\n }\n else {\n const index = rangedDataKeyIndex[type]?.[key] ?? -1;\n return index >= 0 ? value[index] : undefined;\n }\n }\n else if (value && key) {\n return value[key];\n }\n return value;\n },\n /**\n * Set ratio for grouped data\n * @param {Array} data Data array\n * @private\n */\n setRatioForGroupedData(data) {\n const $$ = this;\n const { config } = $$;\n // calculate ratio if grouped data exists\n if (config.data_groups.length && data.some(d => $$.isGrouped(d.id))) {\n const setter = (d) => $$.getRatio(\"index\", d, true);\n data.forEach(v => {\n \"values\" in v ? v.values.forEach(setter) : setter(v);\n });\n }\n },\n /**\n * Get ratio value\n * @param {string} type Ratio for given type\n * @param {object} d Data value object\n * @param {boolean} asPercent Convert the return as percent or not\n * @returns {number} Ratio value\n * @private\n */\n getRatio(type, d, asPercent = false) {\n const $$ = this;\n const { config, state } = $$;\n const api = $$.api;\n let ratio = 0;\n if (d && api.data.shown().length) {\n ratio = d.ratio || d.value;\n if (type === \"arc\") {\n // if has padAngle set, calculate rate based on value\n if ($$.pie.padAngle()()) {\n ratio = d.value / $$.getTotalDataSum(true);\n // otherwise, based on the rendered angle value\n }\n else {\n const gaugeArcLength = config.gauge_fullCircle ?\n $$.getArcLength() :\n $$.getStartingAngle() * -2;\n const arcLength = $$.hasType(\"gauge\") ? gaugeArcLength : Math.PI * 2;\n ratio = (d.endAngle - d.startAngle) / arcLength;\n }\n }\n else if (type === \"index\") {\n const dataValues = api.data.values.bind(api);\n const { hiddenTargetIds } = state;\n // For normalized stack per group, get total per group\n let total = this.getTotalPerIndex($$.isStackNormalizedPerGroup() ? d.id : undefined);\n // If total is null, the data is not in any group - don't normalize\n if (total === null) {\n return ratio;\n }\n if (hiddenTargetIds.size) {\n // When normalized per group, only subtract hidden data from the same group\n let hiddenIds = [...hiddenTargetIds];\n if ($$.isStackNormalizedPerGroup() && d.id) {\n const group = config.data_groups.find(g => g.indexOf(d.id) >= 0);\n if (group) {\n // Only consider hidden IDs in the same group\n hiddenIds = hiddenIds.filter(id => group.indexOf(id) >= 0);\n }\n }\n if (hiddenIds.length) {\n let hiddenSum = dataValues(hiddenIds, false);\n if (hiddenSum.length) {\n hiddenSum = hiddenSum\n .reduce((acc, curr) => acc.map((v, i) => (isNumber(v) ? v : 0) + curr[i]));\n total = total.map((v, i) => v - hiddenSum[i]);\n }\n }\n }\n const divisor = total[d.index];\n d.ratio = isNumber(d.value) && total && divisor ? d.value / divisor : 0;\n ratio = d.ratio;\n }\n else if (type === \"radar\") {\n ratio = (parseFloat(String(Math.max(d.value, 0))) / state.current.dataMax) * config.radar_size_ratio;\n }\n else if (type === \"bar\") {\n const yScale = $$.getYScaleById.bind($$)(d.id);\n const max = yScale.domain().reduce((a, c) => c - a);\n // when all data are 0, return 0\n ratio = max === 0 ? 0 : Math.abs($$.getRangedData(d, null, type) / max);\n }\n else if (type === \"treemap\") {\n ratio /= $$.getTotalDataSum(true);\n }\n }\n return asPercent && ratio ? ratio * 100 : ratio;\n },\n /**\n * Sort data index to be aligned with x axis.\n * @param {Array} tickValues Tick array values\n * @private\n */\n updateDataIndexByX(tickValues) {\n const $$ = this;\n const tickValueMap = tickValues.reduce((out, tick, index) => {\n out[Number(tick.x)] = index;\n return out;\n }, {});\n $$.data.targets.forEach(t => {\n t.values.forEach((value, valueIndex) => {\n let index = tickValueMap[Number(value.x)];\n if (index === undefined) {\n index = valueIndex;\n }\n value.index = index;\n });\n });\n },\n /**\n * Determine if bubble has dimension data\n * @param {object|Array} d data value\n * @returns {boolean}\n * @private\n */\n isBubbleZType(d) {\n const $$ = this;\n return $$.isBubbleType(d) && ((isObject(d.value) && (\"z\" in d.value || \"y\" in d.value)) ||\n (isArray(d.value) && d.value.length >= 2));\n },\n /**\n * Determine if bar has ranged data\n * @param {Array} d data value\n * @returns {boolean}\n * @private\n */\n isBarRangeType(d) {\n const $$ = this;\n const { value } = d;\n return $$.isBarType(d) && isArray(value) && value.length >= 2 &&\n value.every(isNumber);\n },\n /**\n * Get data object by id\n * @param {string} id data id\n * @returns {object}\n * @private\n */\n getDataById(id) {\n const d = this.cache.get(id) || this.api.data(id);\n return d?.[0] ?? d;\n }\n};\n\nexport { data as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { $LEGEND } from '../../config/classes.js';\nimport { KEY } from '../../module/Cache.js';\nimport { endall } from '../../module/util/object.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Call done callback with resize after transition\n * @param {function} fn Callback function\n * @param {boolean} resizeAfter Weather to resize chart after the load\n * @private\n */\nfunction callDone(fn, resizeAfter = false) {\n const $$ = this;\n const { api } = $$;\n resizeAfter && $$.api.flush(true);\n fn?.call(api);\n}\nvar dataLoad = {\n load(rawTargets, args) {\n const $$ = this;\n const { axis, data, org, scale } = $$;\n const { append } = args;\n const zoomState = {\n domain: null,\n currentDomain: null,\n x: null\n };\n let targets = rawTargets;\n if (targets) {\n // filter loading targets if needed\n if (args.filter) {\n targets = targets.filter(args.filter);\n }\n // set type if args.types || args.type specified\n if (args.type || args.types) {\n targets.forEach(t => {\n const type = args.types?.[t.id] || args.type;\n $$.setTargetType(t.id, type);\n });\n }\n // Update/Add data: index incoming targets by id to avoid O(n×m) scans\n const incoming = new Map(targets.map(t => [t.id, t]));\n data.targets.forEach(d => {\n const t = incoming.get(d.id);\n if (t) {\n if (append) {\n const values = t.values;\n for (let j = 0; j < values.length; j++) {\n d.values.push(values[j]);\n }\n }\n else {\n d.values = t.values;\n }\n incoming.delete(d.id);\n }\n });\n // add remained\n incoming.forEach(t => data.targets.push(t));\n }\n if ($$.state.isCanvasMode) {\n $$.redraw({\n withUpdateOrgXDomain: true,\n withUpdateXDomain: true,\n withLegend: true\n });\n $$.updateTypesElements();\n callDone.call($$, args.done, args.resizeAfter);\n return;\n }\n // Set targets\n $$.updateTargets(data.targets);\n if (scale.zoom) {\n zoomState.x = axis.isCategorized() ?\n scale.x.orgScale() :\n (org.xScale || scale.x).copy();\n zoomState.domain = $$.getXDomain(data.targets); // get updated xDomain\n zoomState.x.domain(zoomState.domain);\n zoomState.currentDomain = $$.zoom.getDomain(); // current zoomed domain\n // reset zoom state when new data loaded is out of range\n if (!$$.withinRange(zoomState.currentDomain, undefined, zoomState.domain)) {\n scale.x.domain(zoomState.domain);\n scale.zoom = null;\n $$.$el.eventRect.property(\"__zoom\", null);\n }\n }\n // Redraw with new targets\n $$.redraw({\n withUpdateOrgXDomain: true,\n withUpdateXDomain: true,\n withLegend: true\n });\n // when load happens on zoom state\n if (scale.zoom) {\n // const x = (axis.isCategorized() ? scale.x.orgScale() : (org.xScale || scale.x)).copy();\n org.xDomain = zoomState.domain;\n org.xScale = zoomState.x;\n if (axis.isCategorized()) {\n zoomState.currentDomain = $$.getZoomDomainValue(zoomState.currentDomain);\n org.xDomain = $$.getZoomDomainValue(org.xDomain);\n org.xScale = zoomState.x.domain(org.xDomain);\n }\n $$.updateCurrentZoomTransform(zoomState.x, zoomState.currentDomain);\n // https://github.com/naver/billboard.js/issues/3878\n }\n else if (org.xScale) {\n org.xScale.domain(org.xDomain);\n }\n // Update current state chart type and elements list after redraw\n $$.updateTypesElements();\n callDone.call($$, args.done, args.resizeAfter);\n },\n loadFromArgs(args) {\n const $$ = this;\n // prevent load when chart is already destroyed\n if (!$$.config) {\n return;\n }\n // Reset non-generation-based caches only.\n // Generation-based caches ($filteredTargets, $maxDataCountTarget, $valuesXIndexMap,\n // $maxTickSize_*) are invalidated automatically by dataGeneration/redrawGeneration\n // increments at the start of the next redraw — no need to delete them eagerly.\n $$.cache.reset(false, [\n KEY.filteredTargets,\n KEY.maxDataCountTarget,\n KEY.valuesXIndexMap,\n KEY.maxTickSize\n ]);\n $$.convertData(args, d => {\n const data = args.data || d;\n args.append && (data.__append__ = true);\n data && $$.load($$.convertDataToTargets.call($$, data), args);\n });\n },\n unload(rawTargetIds, customDoneCb) {\n const $$ = this;\n const { state, $el, $T } = $$;\n const hasLegendDefsPoint = !!$$.hasLegendDefsPoint?.();\n let done = customDoneCb;\n let targetIds = rawTargetIds;\n // Reset non-generation-based caches only (same rationale as loadFromArgs)\n $$.cache.reset(false, [\n KEY.filteredTargets,\n KEY.maxDataCountTarget,\n KEY.valuesXIndexMap,\n KEY.maxTickSize\n ]);\n if (!done) {\n done = () => { };\n }\n // filter existing target\n targetIds = targetIds.filter(id => $$.hasTarget($$.data.targets, id));\n // If no target, call done and return\n if (targetIds.length === 0) {\n done();\n return;\n }\n // remove in a single pass instead of re-filtering per id\n const unloadIds = new Set(targetIds);\n if (state.isCanvasMode) {\n targetIds.forEach(id => {\n state.withoutFadeIn[id] = false;\n });\n $$.data.targets = $$.data.targets.filter(t => !unloadIds.has(t.id));\n $$.removeHiddenTargetIds(targetIds);\n $$.removeHiddenLegendIds(targetIds);\n $$.updateTypesElements();\n done();\n return;\n }\n targetIds.forEach(id => {\n const suffixId = $$.getTargetSelectorSuffix(id);\n // Reset fadein for future load\n state.withoutFadeIn[id] = false;\n // Remove target's elements\n if ($el.legend) {\n $el.legend.selectAll(`.${$LEGEND.legendItem}${suffixId}`).remove();\n }\n // Remove custom point def element\n hasLegendDefsPoint && $el.defs?.select(`#${$$.getDefsPointId(suffixId)}`).remove();\n });\n // Remove targets\n $$.data.targets = $$.data.targets.filter(t => !unloadIds.has(t.id));\n // since treemap uses different data types, it needs to be transformed\n state.hasFunnel && $$.updateFunnel($$.data.targets);\n // since treemap uses different data types, it needs to be transformed\n state.hasTreemap && $$.updateTargetsForTreemap($$.data.targets);\n // Update current state chart type and elements list after redraw\n $$.updateTypesElements();\n const targets = $el.svg.selectAll(targetIds.map(id => $$.selectorTarget(id)));\n $T(targets)\n .style(\"opacity\", \"0\")\n .remove()\n .call(endall, done);\n }\n};\n\nexport { callDone, dataLoad as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { drag } from 'd3-drag';\nimport { select } from 'd3-selection';\nimport { $AXIS, $SHAPE, $COMMON, $ARC } from '../../config/classes.js';\nimport { KEY } from '../../module/Cache.js';\nimport { getBoundingRect, hasViewBox, getTransformCTM, emulateEvent, getPointer } from '../../module/util/dom.js';\nimport { isObject, isNumber } from '../../module/util/type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\nvar interaction = {\n /**\n * Expand data shape/point\n * @param {number} index Index number\n * @param {string} id Data id\n * @param {boolean} reset Reset expand state\n * @private\n */\n setExpand(index, id, reset) {\n const $$ = this;\n const { config, $el: { circle } } = $$;\n circle && config.point_focus_expand_enabled &&\n $$.expandCircles(index, id, reset);\n // bar, candlestick\n $$.expandBarTypeShapes(true, index, id, reset);\n },\n /**\n * Expand/Unexpand bar type shapes\n * @param {boolean} expand Expand or unexpand\n * @param {number} i Shape index\n * @param {string} id Data id\n * @param {boolean} reset Reset expand style\n * @private\n */\n expandBarTypeShapes(expand = true, i, id, reset) {\n const $$ = this;\n [\"bar\", \"candlestick\"]\n .filter(v => $$.$el[v])\n .forEach(v => {\n reset && $$.$el[v].classed($COMMON.EXPANDED, false);\n $$.getShapeByIndex(v, i, id).classed($COMMON.EXPANDED, expand);\n });\n },\n /**\n * Handle data.onover/out callback options\n * @param {boolean} isOver Over or not\n * @param {number|object} d data object\n * @private\n */\n setOverOut(isOver, d) {\n const $$ = this;\n const { config, state: { hasFunnel, hasRadar, hasTreemap }, $el: { main } } = $$;\n const isArcishData = isObject(d);\n // Call event handler\n if (isArcishData || d !== -1) {\n const callback = config[isOver ? \"data_onover\" : \"data_onout\"].bind($$.api);\n config.color_onover && $$.setOverColor(isOver, d, isArcishData);\n if (isArcishData) {\n const suffix = $$.getTargetSelectorSuffix(d.id);\n const selector = hasFunnel || hasTreemap ?\n `${$COMMON.target + suffix} .${$SHAPE.shape}` :\n $ARC.arc + suffix;\n callback(d, main.select(`.${selector}`).node());\n }\n else if (!config.tooltip_grouped) {\n const last = $$.cache.get(KEY.setOverOut) || [];\n // select based on the index\n const shapesAtIndex = main.selectAll(`.${$SHAPE.shape}-${d}`)\n .filter(function (d) {\n return $$.isWithinShape(this, d);\n });\n // filter if has new selection\n const shape = shapesAtIndex.filter(function () {\n return last.every(v => v !== this);\n });\n // call onout callback\n if (!isOver || shapesAtIndex.empty() || (last.length === shape.size() && shape.nodes().every((v, i) => v !== last[i]))) {\n while (last.length) {\n const target = last.pop();\n config.data_onout.bind($$.api)(select(target).datum(), target);\n }\n }\n // call onover callback\n shape.each(function () {\n if (isOver) {\n callback(select(this).datum(), this);\n last.push(this);\n }\n });\n $$.cache.add(KEY.setOverOut, last);\n }\n else {\n if (isOver) {\n hasRadar && $$.isPointFocusOnly() ?\n $$.showCircleFocus($$.getAllValuesOnIndex(d, true)) :\n $$.setExpand(d, null, true);\n }\n !$$.isMultipleX() && main.selectAll(`.${$SHAPE.shape}-${d}`)\n .each(function (d) {\n callback(d, this);\n });\n }\n }\n },\n /**\n * Call data.onover/out callback for touch event\n * @param {number|object} d target index or data object for Arc type\n * @private\n */\n callOverOutForTouch(d) {\n const $$ = this;\n const last = $$.cache.get(KEY.callOverOutForTouch);\n if (isObject(d) && last ? d.id !== last.id : (d !== last)) {\n (last || isNumber(last)) && $$.setOverOut(false, last);\n (d || isNumber(d)) && $$.setOverOut(true, d);\n $$.cache.add(KEY.callOverOutForTouch, d);\n }\n },\n /**\n * Return draggable selection function\n * @returns {function}\n * @private\n */\n getDraggableSelection() {\n const $$ = this;\n const { config, state } = $$;\n return config.interaction_enabled && config.data_selection_draggable && $$.drag ?\n drag()\n .on(\"drag\", function (event) {\n state.event = event;\n $$.drag(getPointer(event, this));\n })\n .on(\"start\", function (event) {\n state.event = event;\n $$.dragstart(getPointer(event, this));\n })\n .on(\"end\", event => {\n state.event = event;\n $$.dragend();\n }) :\n () => { };\n },\n /**\n * Dispatch a mouse event.\n * @private\n * @param {string} type event type\n * @param {number} index Index of eventRect\n * @param {Array} mouse x and y coordinate value\n */\n dispatchEvent(type, index, mouse) {\n const $$ = this;\n const { config, state: { eventReceiver, hasAxis, hasFunnel, hasRadar, hasTreemap }, $el: { eventRect, funnel, radar, svg, treemap } } = $$;\n let element = (((hasFunnel || hasTreemap) && eventReceiver.rect) ||\n (hasRadar && radar.axes.select(`.${$AXIS.axis}-${index} text`)) || (eventRect || $$.getArcElementByIdOrIndex?.(index)))?.node?.();\n if (element) {\n const isMultipleX = $$.isMultipleX();\n const isRotated = config.axis_rotated;\n let { width, left, top } = getBoundingRect(element);\n if (hasAxis && !hasRadar && !isMultipleX) {\n const coords = eventReceiver.coords[index];\n if (coords) {\n width = coords.w;\n left += coords.x;\n top += coords.y;\n }\n else {\n width = 0;\n left = 0;\n top = 0;\n }\n }\n let x = left + (mouse ? mouse[0] : 0) + (isMultipleX || isRotated ? 0 : (width / 2));\n // value 4, is to adjust coordinate value set from: scale.ts - updateScales(): $$.getResettedPadding(1)\n let y = top + (mouse ? mouse[1] : 0) + (isRotated ? 4 : 0);\n // eventRect doesn't exist for radar/funnel/treemap charts\n if (hasViewBox(svg) && $$.$el.eventRect) {\n const ctm = getTransformCTM($$.$el.eventRect.node(), x, y, false);\n x = ctm.x;\n y = ctm.y;\n }\n const params = {\n screenX: x,\n screenY: y,\n clientX: x,\n clientY: y,\n bubbles: hasRadar // radar type needs to bubble up event\n };\n // for funnel and treemap event bound to <g> node\n if (hasFunnel || hasTreemap) {\n element = (funnel ?? treemap).node();\n }\n emulateEvent[/^(mouse|click)/.test(type) ? \"mouse\" : \"touch\"](element, type, params);\n }\n },\n setDragStatus(isDragging) {\n this.state.dragging = isDragging;\n },\n /**\n * Unbind zoom events\n * @private\n */\n unbindZoomEvent() {\n const $$ = this;\n const { $el: { canvas, eventRect, svg, zoomResetBtn } } = $$;\n eventRect?.on(\".zoom wheel.zoom .drag\", null);\n canvas?.on(\".zoom wheel.zoom .drag\", null);\n // remove the Safari wheel workaround listener bound in bindZoomOnEventRect()\n svg?.on(\"wheel\", null);\n zoomResetBtn?.on(\"click\", null)\n .style(\"display\", \"none\");\n },\n /**\n * Unbind all attached events\n * @private\n */\n unbindAllEvents() {\n const $$ = this;\n const { $el: { arcs, eventRect, legend, region, svg, treemap }, brush } = $$;\n const list = [\n \"wheel\",\n \"click\",\n \"mouseover\",\n \"mousemove\",\n \"mouseout\",\n \"touchstart\",\n \"touchmove\",\n \"touchend\",\n \"touchstart.eventRect\",\n \"touchmove.eventRect\",\n \"touchend.eventRect\",\n \".brush\",\n \".drag\",\n \".zoom\",\n \"wheel.zoom\",\n \"dblclick.zoom\"\n ].join(\" \");\n // detach all possible event types\n [\n svg,\n eventRect,\n region?.list,\n brush?.getSelection(),\n arcs?.selectAll(\"path\"),\n legend?.selectAll(\"g\"),\n treemap\n ]\n .forEach(v => v?.on(list, null));\n $$.unbindZoomEvent?.();\n }\n};\n\nexport { interaction as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\nvar category = {\n /**\n * Category Name\n * @param {number} i Index number\n * @returns {string} category Name\n * @private\n */\n categoryName(i) {\n const { axis_x_categories } = this.config;\n return axis_x_categories?.[i] ?? i;\n }\n};\n\nexport { category as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport CLASS from '../../config/classes.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n// Hoisted to module level to avoid recompilation on every getTargetSelectorSuffix() call\nconst RE_SELECTOR_SUFFIX = /[\\x00-\\x20\\x7F-\\xA0\\s?!@#$%^&*()_=+,.<>'\":;\\[\\]\\/|~`{}\\\\]/g; // eslint-disable-line no-control-regex\nvar classModule = {\n generateClass(prefix, targetId) {\n const cache = this.state.generateClassCache;\n const key = `${prefix}\\0${targetId}`;\n let cls = cache.get(key);\n if (!cls) {\n cls = ` ${prefix} ${prefix + this.getTargetSelectorSuffix(targetId)}`;\n cache.set(key, cls);\n }\n return cls;\n },\n /**\n * Get class string\n * @param {string} type Shape type\n * @param {boolean} withShape Get with shape prefix\n * @returns {string} Class string\n * @private\n */\n getClass(type, withShape) {\n const isPlural = /s$/.test(type);\n const useIdKey = /^(area|arc|line|funnel|treemap)s?$/.test(type);\n const key = isPlural ? \"id\" : \"index\";\n return (d) => {\n const data = d.data || d;\n const result = (withShape ? this.generateClass(CLASS[isPlural ? \"shapes\" : \"shape\"], data[key]) : \"\") + this.generateClass(CLASS[type], data[useIdKey ? \"id\" : key]);\n return result.trim();\n };\n },\n /**\n * Get chart class string\n * @param {string} type Shape type\n * @returns {string} Class string\n * @private\n */\n getChartClass(type) {\n return (d) => CLASS[`chart${type}`] + this.classTarget((d.data ? d.data : d).id);\n },\n generateExtraLineClass() {\n const $$ = this;\n const classes = $$.config.line_classes || [];\n const ids = [];\n return function (d) {\n const id = d.id || d.data?.id || d;\n if (ids.indexOf(id) < 0) {\n ids.push(id);\n }\n return classes[ids.indexOf(id) % classes.length];\n };\n },\n classRegion(d, i) {\n return `${this.generateClass(CLASS.region, i)} ${\"class\" in d ? d.class : \"\"}`;\n },\n classTarget(id) {\n const additionalClassSuffix = this.config.data_classes[id];\n let additionalClass = \"\";\n if (additionalClassSuffix) {\n additionalClass = ` ${CLASS.target}-${additionalClassSuffix}`;\n }\n return this.generateClass(CLASS.target, id) + additionalClass;\n },\n classFocus(d) {\n return this.classFocused(d) + this.classDefocused(d);\n },\n classFocused(d) {\n return ` ${this.state.focusedTargetIds.has(d.id) ? CLASS.focused : \"\"}`;\n },\n classDefocused(d) {\n return ` ${this.state.defocusedTargetIds.has(d.id) ? CLASS.defocused : \"\"}`;\n },\n getTargetSelectorSuffix(targetId) {\n const targetStr = targetId || targetId === 0 ? `-${targetId}` : \"\";\n // replace control ascii(0 ~ 32) and extended ascii(127 ~ 160)\n return targetStr.replace(RE_SELECTOR_SUFFIX, \"-\");\n },\n selectorTarget(id, prefix = \"\", postfix = \"\") {\n const target = this.getTargetSelectorSuffix(id);\n // select target & circle\n return `${prefix}.${CLASS.target + target} ${postfix}, ${prefix}.${CLASS.circles + target} ${postfix}`;\n },\n selectorTargets(idsValue, prefix) {\n const ids = idsValue || [];\n return ids.length ? ids.map(id => this.selectorTarget(id, prefix)) : null;\n },\n selectorLegend(id) {\n return `.${CLASS.legendItem + this.getTargetSelectorSuffix(id)}`;\n },\n selectorLegends(ids) {\n return ids?.length ? ids.map(id => this.selectorLegend(id)) : null;\n }\n};\n\nexport { classModule as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { scaleOrdinal } from 'd3-scale';\nimport { select } from 'd3-selection';\nimport { $ARC, $SHAPE, $COLOR } from '../../config/classes.js';\nimport { document as doc } from '../../module/browser.js';\nimport { KEY } from '../../module/Cache.js';\nimport { isObject, isString, isFunction, notEmpty } from '../../module/util/type-checks.js';\nimport { sanitize } from '../../module/sanitize.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Set pattern's background color\n * (it adds a <rect> element to simulate bg-color)\n * @param {SVGPatternElement} pattern SVG pattern element\n * @param {string} color Color string\n * @param {string} id ID to be set\n * @returns {{id: string, node: SVGPatternElement}}\n * @private\n */\nconst _colorizePattern = (pattern, color, id) => {\n const node = select(pattern.cloneNode(true));\n node\n .attr(\"id\", id)\n .insert(\"rect\", \":first-child\")\n .attr(\"width\", node.attr(\"width\"))\n .attr(\"height\", node.attr(\"height\"))\n .style(\"fill\", color);\n return {\n id,\n node: node.node()\n };\n};\n/**\n * Get color pattern from CSS file\n * CSS should be defined as: background-image: url(\"#00c73c;#fa7171; ...\");\n * @param {d3Selection} element Chart element\n * @returns {Array}\n * @private\n */\nfunction _getColorFromCss(element) {\n const cacheKey = KEY.colorPattern;\n const { body } = doc;\n let pattern = body[cacheKey];\n if (!pattern) {\n const delimiter = \";\";\n const content = element\n .classed($COLOR.colorPattern, true)\n .style(\"background-image\");\n element.classed($COLOR.colorPattern, false);\n if (content.indexOf(delimiter) > -1) {\n pattern = content\n .replace(/url[^#]*|[\"'()]|(\\s|%20)/g, \"\")\n .split(delimiter)\n .map(v => v.trim().replace(/[\\\"'\\s]/g, \"\"))\n .filter(Boolean);\n body[cacheKey] = pattern;\n }\n }\n return pattern;\n}\n// Replacement of d3.schemeCategory10.\n// Contained differently depend on d3 version: v4(d3-scale), v5(d3-scale-chromatic)\nconst schemeCategory10 = [\n \"#1f77b4\",\n \"#ff7f0e\",\n \"#2ca02c\",\n \"#d62728\",\n \"#9467bd\",\n \"#8c564b\",\n \"#e377c2\",\n \"#7f7f7f\",\n \"#bcbd22\",\n \"#17becf\"\n];\nvar color = {\n generateColor() {\n const $$ = this;\n const { $el, config } = $$;\n const ids = [];\n const hasGradient = config.area_linearGradient || config.bar_linearGradient ||\n config.point_radialGradient;\n let pattern = notEmpty(config.color_pattern) ?\n config.color_pattern :\n scaleOrdinal(_getColorFromCss($el.chart) || schemeCategory10).range();\n const originalColorPattern = pattern;\n if (isFunction(config.color_tiles)) {\n const tiles = config.color_tiles.bind($$.api)();\n // Add background color to patterns\n const colorizedPatterns = pattern.map((p, index) => {\n const color = p.replace(/[#\\(\\)\\s,]/g, \"\");\n const id = `${$$.state.datetimeId}-pattern-${color}-${index}`;\n return _colorizePattern(tiles[index % tiles.length], p, id);\n });\n pattern = colorizedPatterns.map(p => `url(#${p.id})`);\n $$.patterns = colorizedPatterns;\n }\n return function (d) {\n const colors = config.data_colors;\n const callback = config.data_color;\n const id = d.id ||\n d.data?.id ||\n d;\n const isLine = $$.isTypeOf(id, [\"line\", \"spline\", \"step\"]) || !config.data_types[id];\n let color;\n // if callback function is provided\n if (isFunction(colors[id])) {\n color = colors[id].bind($$.api)(d);\n }\n else if (colors[id]) {\n // if specified, choose that color\n color = colors[id];\n }\n else {\n // if not specified, choose from pattern\n let idx = ids.indexOf(id);\n if (idx < 0) {\n ids.push(id);\n idx = ids.length - 1;\n }\n color = isLine ?\n originalColorPattern[idx % originalColorPattern.length] :\n pattern[idx % pattern.length];\n colors[id] = color;\n }\n color = isFunction(callback) ? callback.call($$.api, color, d) : color;\n if (hasGradient && $el.defs) {\n const stop = $$.$el.defs.selectAll(`[id$='-gradient${$$.getTargetSelectorSuffix(id)}'] stop`);\n let hasSameColor;\n stop.each(function (d, i) {\n hasSameColor = i === 0 ?\n this.style.stopColor :\n this.style.stopColor === hasSameColor;\n });\n hasSameColor === true && stop.attr(\"stop-color\", color);\n }\n return color;\n };\n },\n generateLevelColor() {\n const $$ = this;\n const { config } = $$;\n const colors = config.color_pattern;\n const threshold = config.color_threshold;\n const asValue = threshold.unit === \"value\";\n const max = threshold.max || 100;\n const values = threshold.values &&\n threshold.values.length ?\n threshold.values :\n [];\n return notEmpty(threshold) ?\n function (value) {\n const v = asValue ? value : (value * 100 / max);\n let color = colors[colors.length - 1];\n for (let i = 0, l = values.length; i < l; i++) {\n if (v <= values[i]) {\n color = colors[i];\n break;\n }\n }\n return color;\n } :\n null;\n },\n /**\n * Append data backgound color filter definition\n * @param {string|object|function} color Color string, object, or function\n * @param {object} attr filter attribute\n * @private\n */\n generateTextBGColorFilter(color, attr = {\n x: 0,\n y: 0,\n width: 1,\n height: 1\n }) {\n const $$ = this;\n const { $el: { defs }, state } = $$;\n if (color) {\n let ids = [];\n if (isString(color)) {\n ids.push(\"\");\n }\n else if (isObject(color)) {\n ids = Object.keys(color);\n }\n else if (isFunction(color)) {\n ids = $$.mapToTargetIds();\n }\n ids.forEach(v => {\n const id = `${state.datetimeId}-labels-bg${$$.getTargetSelectorSuffix(v)}${isString(color) ? $$.getTargetSelectorSuffix(color) : \"\"}`;\n const colorValue = sanitize(v === \"\" ? color : color?.[v] || \"\");\n if (defs.select(`#${id}`).empty()) {\n const filter = defs.append(\"filter\")\n .attr(\"x\", attr.x)\n .attr(\"y\", attr.y)\n .attr(\"width\", attr.width)\n .attr(\"height\", attr.height)\n .attr(\"id\", id);\n filter.append(\"feFlood\").attr(\"flood-color\", colorValue);\n filter.append(\"feComposite\").attr(\"in\", \"SourceGraphic\");\n }\n });\n }\n // Note: For function type, filters will be created dynamically in updateTextBGColor\n },\n /**\n * Get data gradient color url\n * @param {string} id Data id\n * @returns {string}\n * @private\n */\n getGradienColortUrl(id) {\n return `url(#${this.state.datetimeId}-gradient${this.getTargetSelectorSuffix(id)})`;\n },\n /**\n * Update linear/radial gradient definition\n * - linear: area & bar only\n * - radial: type which has data points only\n * @private\n */\n updateLinearGradient() {\n const $$ = this;\n const { config, data: { targets }, state: { datetimeId }, $el: { defs } } = $$;\n targets.forEach(d => {\n const id = `${datetimeId}-gradient${$$.getTargetSelectorSuffix(d.id)}`;\n const radialGradient = $$.hasPointType() && config.point_radialGradient;\n const supportedType = ($$.isAreaType(d) && \"area\") || ($$.isBarType(d) && \"bar\");\n if ((radialGradient || supportedType) && defs.select(`#${id}`).empty()) {\n const color = $$.color(d);\n const gradient = {\n defs: null,\n stops: []\n };\n if (radialGradient) {\n const { cx = 0.3, cy = 0.3, r = 0.7, stops = [[0.1, color, 0], [0.9, color, 1]] } = radialGradient;\n gradient.stops = stops;\n gradient.defs = defs.append(\"radialGradient\")\n .attr(\"id\", `${id}`)\n .attr(\"cx\", cx)\n .attr(\"cy\", cy)\n .attr(\"r\", r);\n }\n else {\n const isRotated = config.axis_rotated;\n const { x = isRotated ? [1, 0] : [0, 0], y = isRotated ? [0, 0] : [0, 1], stops = [[0, color, 1], [1, color, 0]] } = config[`${supportedType}_linearGradient`];\n gradient.stops = stops;\n gradient.defs = defs.append(\"linearGradient\")\n .attr(\"id\", `${id}`)\n .attr(\"x1\", x[0])\n .attr(\"x2\", x[1])\n .attr(\"y1\", y[0])\n .attr(\"y2\", y[1]);\n }\n gradient.stops.forEach((v) => {\n const [offset, stopColor, stopOpacity] = v;\n const colorValue = isFunction(stopColor) ?\n stopColor.bind($$.api)(d.id) :\n stopColor;\n gradient.defs && gradient.defs.append(\"stop\")\n .attr(\"offset\", offset)\n .attr(\"stop-color\", colorValue || color)\n .attr(\"stop-opacity\", stopOpacity);\n });\n }\n });\n },\n /**\n * Set the data over color.\n * When is out, will restate in its previous color value\n * @param {boolean} isOver true: set overed color, false: restore\n * @param {number|object} d target index or data object for Arc type\n * @private\n */\n setOverColor(isOver, d) {\n const $$ = this;\n const { config, $el: { main } } = $$;\n const onover = config.color_onover;\n let color = isOver ? onover : $$.color;\n if (isObject(color)) {\n color = ({ id }) => (id in onover ? onover[id] : $$.color(id));\n }\n else if (isString(color)) {\n color = () => onover;\n }\n else if (isFunction(onover)) {\n color = color.bind($$.api);\n }\n main.selectAll(isObject(d) ?\n // when is Arc type\n `.${$ARC.arc}${$$.getTargetSelectorSuffix(d.id)}` :\n `.${$SHAPE.shape}-${d}`).style(\"fill\", color);\n }\n};\n\nexport { color as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { brushSelection } from 'd3-brush';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n * @ignore\n */\n/**\n * Return brush selection array\n * @param {object} ctx Current instance\n * @returns {d3.brushSelection}\n * @private\n */\nfunction getBrushSelection(ctx) {\n const { event, $el } = ctx;\n const main = $el.subchart.main || $el.main;\n let selection;\n // check from event\n if (event && event.type === \"brush\") {\n selection = event.selection;\n // check from brush area selection\n }\n else if (main && (selection = main.select(\".bb-brush\").node())) {\n selection = brushSelection(selection);\n }\n return selection;\n}\n/**\n * Check if brush is empty\n * @param {object} ctx Bursh context\n * @returns {boolean}\n * @private\n */\nfunction brushEmpty(ctx) {\n const selection = getBrushSelection(ctx);\n if (selection) {\n // brush selected area\n // two-dimensional: [[x0, y0], [x1, y1]]\n // one-dimensional: [x0, x1] or [y0, y1]\n return selection[0] === selection[1];\n }\n return true;\n}\n\nexport { brushEmpty, getBrushSelection };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { TYPE, TYPE_BY_CATEGORY } from '../../config/const.js';\nimport { KEY } from '../../module/Cache.js';\nimport { isDefined, isObject, diffDomain, notEmpty, isNumber, isValue } from '../../module/util/type-checks.js';\nimport { getMinMax, sortValue, parseDate, toSet } from '../../module/util/object.js';\nimport { brushEmpty, getBrushSelection } from '../../module/util/brush.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Build a compact cache key for target-domain scans.\n * @param {object} $$ ChartInternal instance\n * @param {Array} targets Data targets\n * @returns {string} Cache key\n * @private\n */\nfunction getTargetDomainCacheKey($$, targets) {\n return targets.map(target => {\n const { values } = target;\n const first = values[0];\n const last = values[values.length - 1];\n const firstX = first ? $$.getXCacheKey?.(first.x) ?? first.x : \"\";\n const lastX = last ? $$.getXCacheKey?.(last.x) ?? last.x : \"\";\n return `${target.id}:${values.length}:${firstX}:${lastX}`;\n }).join(\"|\");\n}\n/**\n * Check whether domain result can be cached without accumulating zoom-window entries.\n * @param {object} $$ ChartInternal instance\n * @param {Array} targets Data targets\n * @returns {boolean} Whether the targets use original value arrays\n * @private\n */\nfunction canCacheTargetDomain($$, targets) {\n const sourceTargets = $$.data?.targets;\n if (!sourceTargets) {\n return false;\n }\n for (let i = 0; i < targets.length; i++) {\n const target = targets[i];\n const source = sourceTargets.find(v => v.id === target.id);\n if (!source || source.values !== target.values) {\n return false;\n }\n }\n return true;\n}\n/**\n * Update a min/max accumulator with a scalar domain value.\n * @param {object} minMax Min/max accumulator\n * @param {number|Date|null|undefined} value Domain value\n * @private\n */\nfunction updateMinMax(minMax, value) {\n if (!notEmpty(value)) {\n return;\n }\n if (minMax.min === undefined || value < minMax.min) {\n minMax.min = value;\n }\n if (minMax.max === undefined || value > minMax.max) {\n minMax.max = value;\n }\n}\n/**\n * Update a min/max accumulator from an array-like value.\n * @param {object} minMax Min/max accumulator\n * @param {Array} values Domain values\n * @private\n */\nfunction updateMinMaxFromValues(minMax, values) {\n for (let i = 0; i < values.length; i++) {\n updateMinMax(minMax, values[i]);\n }\n}\n/**\n * Compute target value min/max without allocating intermediate value arrays.\n * @param {object} $$ ChartInternal instance\n * @param {Array} targets Data targets\n * @returns {Array} Min/max tuple\n * @private\n */\nfunction getTargetValueMinMax($$, targets) {\n const minMax = { min: undefined, max: undefined };\n const hasAxis = $$.state.hasAxis;\n for (let i = 0; i < targets.length; i++) {\n const target = targets[i];\n const isCandlestick = $$.isCandlestickType?.(target);\n const { values } = target;\n for (let j = 0; j < values.length; j++) {\n const row = values[j];\n let value = row.value;\n if (!(isValue(value) || value === null)) {\n continue;\n }\n if (value !== null && isCandlestick) {\n value = Array.isArray(value) ?\n value.slice(0, 4) :\n [value.open, value.high, value.low, value.close];\n }\n if (Array.isArray(value)) {\n updateMinMaxFromValues(minMax, value);\n }\n else if (isObject(value) && \"high\" in value) {\n updateMinMaxFromValues(minMax, Object.values(value));\n }\n else if ($$.isBubbleZType?.(row)) {\n updateMinMax(minMax, hasAxis && $$.getBubbleZData(value, \"y\"));\n }\n else {\n updateMinMax(minMax, value);\n }\n }\n }\n return [minMax.min, minMax.max];\n}\n/**\n * Compute x-domain min or max without allocating intermediate x arrays.\n * @param {Array} targets Data targets\n * @param {string} type Min/max type\n * @returns {number|Date|undefined} Domain value\n * @private\n */\nfunction getTargetXMinMax(targets, type) {\n let result;\n for (let i = 0; i < targets.length; i++) {\n const { values } = targets[i];\n for (let j = 0; j < values.length; j++) {\n const { x } = values[j];\n if (notEmpty(x) &&\n (result === undefined || (type === \"min\" ? x < result : x > result))) {\n result = x;\n }\n }\n }\n return result;\n}\nvar domain = {\n /**\n * Get both min and max Y domain values in a single pass.\n * Avoids calling getValuesAsIdKeyed twice.\n * @param {Array} targets Target data\n * @returns {[number|Date|undefined, number|Date|undefined]} [min, max]\n * @private\n */\n getYDomainMinMaxBoth(targets) {\n const $$ = this;\n const { axis, cache, config, state } = $$;\n const canCache = canCacheTargetDomain($$, targets);\n const cacheKey = canCache ?\n `${KEY.domainMinMax}_y_${getTargetDomainCacheKey($$, targets)}` :\n null;\n const cached = cacheKey && cache.get(cacheKey);\n if (cached && cached.generation === state.dataGeneration) {\n return cached.value;\n }\n const dataGroups = config.data_groups;\n const ids = $$.mapToIds(targets);\n const idsSet = toSet(ids);\n let result;\n if (dataGroups.length > 0) {\n const rawYs = $$.getValuesAsIdKeyed(targets);\n const hasNegative = targets.some(t => t.values.some(v => v.value < 0));\n const hasPositive = targets.some(t => t.values.some(v => v.value > 0));\n const axisIdMap = new Map(ids.map(id => [id, axis.getId(id)]));\n // Clone ys into separate min/max copies since grouped calculation mutates values\n const ysMin = {};\n const ysMax = {};\n for (const key in rawYs) {\n ysMin[key] = rawYs[key].slice();\n ysMax[key] = rawYs[key].slice();\n }\n dataGroups.forEach(groupIds => {\n const idsInGroup = groupIds.filter(v => idsSet.has(v));\n if (idsInGroup.length) {\n const baseId = idsInGroup[0];\n const baseAxisId = axisIdMap.get(baseId);\n // Initialize base values for min (negative) and max (positive)\n if (ysMin[baseId] && hasNegative) {\n ysMin[baseId] = ysMin[baseId].map(v => (v < 0 ? v : 0));\n }\n if (ysMax[baseId] && hasPositive) {\n ysMax[baseId] = ysMax[baseId].map(v => (v > 0 ? v : 0));\n }\n idsInGroup\n .filter((v, i) => i > 0)\n .forEach(id => {\n if (ysMin[id]) {\n const axisId = axisIdMap.get(id);\n ysMin[id].forEach((v, i) => {\n const val = +v;\n // min pass: skip positive values when hasNegative\n if (axisId === baseAxisId && !(hasNegative && val > 0)) {\n ysMin[baseId][i] += val;\n }\n });\n }\n if (ysMax[id]) {\n const axisId = axisIdMap.get(id);\n ysMax[id].forEach((v, i) => {\n const val = +v;\n // max pass: skip negative values when hasPositive\n if (axisId === baseAxisId && !(hasPositive && val < 0)) {\n ysMax[baseId][i] += val;\n }\n });\n }\n });\n }\n });\n const minVals = [];\n const maxVals = [];\n for (const key in ysMin) {\n minVals.push(getMinMax(\"min\", ysMin[key]));\n maxVals.push(getMinMax(\"max\", ysMax[key]));\n }\n result = [\n getMinMax(\"min\", minVals),\n getMinMax(\"max\", maxVals)\n ];\n }\n else {\n result = getTargetValueMinMax($$, targets);\n }\n if (cacheKey) {\n cache.add(cacheKey, {\n generation: state.dataGeneration,\n value: result\n });\n }\n return result;\n },\n /**\n * Check if hidden targets bound to the given axis id\n * @param {string} id ID to be checked\n * @returns {boolean}\n * @private\n */\n isHiddenTargetWithYDomain(id) {\n const $$ = this;\n for (const v of $$.state.hiddenTargetIds) {\n if ($$.axis.getId(v) === id)\n return true;\n }\n return false;\n },\n getYDomain(targets, axisId, xDomain) {\n const $$ = this;\n const { axis, config, scale } = $$;\n const pfx = `axis_${axisId}`;\n // Check if stack normalization should be applied for this axis\n if ($$.isStackNormalized()) {\n // Get all data IDs that belong to this axis\n const axisDataIds = targets\n .filter(t => axis.getId(t.id) === axisId)\n .map(t => t.id);\n // Check if any of the axis data IDs are in groups\n const hasGroupedData = axisDataIds.some(id => $$.isGrouped(id));\n // Apply normalization only if this axis has grouped data\n if (hasGroupedData) {\n return [0, 100];\n }\n }\n const isLog = scale?.[axisId] && scale[axisId].type === \"log\";\n const targetsByAxisId = targets.filter(t => axis.getId(t.id) === axisId);\n const yTargets = xDomain ? $$.filterByXDomain(targetsByAxisId, xDomain) : targetsByAxisId;\n if (yTargets.length === 0) { // use domain of the other axis if target of axisId is none\n if ($$.isHiddenTargetWithYDomain(axisId)) {\n return scale[axisId].domain();\n }\n else {\n return axisId === \"y2\" ?\n scale.y.domain() : // When all data bounds to y2, y Axis domain is called prior y2.\n // So, it needs to call to get y2 domain here\n $$.getYDomain(targets, \"y2\", xDomain);\n }\n }\n const yMin = config[`${pfx}_min`];\n const yMax = config[`${pfx}_max`];\n const center = config[`${pfx}_center`];\n const isInverted = config[`${pfx}_inverted`];\n const showHorizontalDataLabel = $$.hasDataLabel() && config.axis_rotated;\n const showVerticalDataLabel = $$.hasDataLabel() && !config.axis_rotated;\n const [yDomainMinVal, yDomainMaxVal] = $$.getYDomainMinMaxBoth(yTargets);\n let yDomainMin = yDomainMinVal;\n let yDomainMax = yDomainMaxVal;\n let isZeroBased = [TYPE.BAR, TYPE.BUBBLE, TYPE.SCATTER, ...TYPE_BY_CATEGORY.Line]\n .some(v => {\n const type = v.indexOf(\"area\") > -1 ? \"area\" : v;\n return $$.hasType(v, yTargets, true) && config[`${type}_zerobased`];\n });\n // MEMO: avoid inverting domain unexpectedly\n yDomainMin = isValue(yMin) ? yMin : (isValue(yMax) ?\n (yDomainMin <= yMax ? yDomainMin : yMax - 10) :\n yDomainMin);\n yDomainMax = isValue(yMax) ? yMax : (isValue(yMin) ?\n (yMin <= yDomainMax ? yDomainMax : yMin + 10) :\n yDomainMax);\n if (isNaN(yDomainMin)) { // set minimum to zero when not number\n yDomainMin = 0;\n }\n if (isNaN(yDomainMax)) { // set maximum to have same value as yDomainMin\n yDomainMax = yDomainMin;\n }\n if (yDomainMin === yDomainMax) {\n yDomainMin < 0 ? yDomainMax = 0 : yDomainMin = 0;\n }\n const isAllPositive = yDomainMin >= 0 && yDomainMax >= 0;\n const isAllNegative = yDomainMin <= 0 && yDomainMax <= 0;\n // Cancel zerobased if axis_*_min / axis_*_max specified\n if ((isValue(yMin) && isAllPositive) || (isValue(yMax) && isAllNegative)) {\n isZeroBased = false;\n }\n // Bar/Area chart should be 0-based if all positive|negative\n if (isZeroBased) {\n isAllPositive && (yDomainMin = 0);\n isAllNegative && (yDomainMax = 0);\n }\n const domainLength = Math.abs(yDomainMax - yDomainMin);\n let padding = { top: domainLength * 0.1, bottom: domainLength * 0.1 };\n if (isDefined(center)) {\n const yDomainAbs = Math.max(Math.abs(yDomainMin), Math.abs(yDomainMax));\n yDomainMax = center + yDomainAbs;\n yDomainMin = center - yDomainAbs;\n }\n // add padding for data label\n if (showHorizontalDataLabel) {\n const diff = diffDomain(scale.y.range());\n const ratio = $$.getDataLabelLength(yDomainMin, yDomainMax, \"width\")\n .map(v => {\n const result = v / diff;\n return isFinite(result) ? result : 0;\n });\n [\"bottom\", \"top\"].forEach((v, i) => {\n padding[v] += domainLength * (ratio[i] / (1 - ratio[0] - ratio[1]));\n });\n }\n else if (showVerticalDataLabel) {\n const lengths = $$.getDataLabelLength(yDomainMin, yDomainMax, \"height\");\n [\"bottom\", \"top\"].forEach((v, i) => {\n padding[v] += $$.convertPixelToScale(\"y\", lengths[i], domainLength);\n });\n }\n padding = $$.getResettedPadding(padding);\n // if padding is set, the domain will be updated relative the current domain value\n // ex) $$.height=300, padding.top=150, domainLength=4 --> domain=6\n const p = config[`${pfx}_padding`];\n if (notEmpty(p)) {\n [\"bottom\", \"top\"].forEach(v => {\n padding[v] = axis.getPadding(p, v, padding[v], domainLength);\n });\n }\n // Bar/Area chart should be 0-based if all positive|negative\n if (isZeroBased) {\n isAllPositive && (padding.bottom = yDomainMin);\n isAllNegative && (padding.top = -yDomainMax);\n }\n const domain = isLog ?\n [yDomainMin, yDomainMax].map(v => (v < 0 ? 0 : v)) :\n [yDomainMin - padding.bottom, yDomainMax + padding.top];\n return isInverted ? domain.reverse() : domain;\n },\n getXDomainMinMax(targets, type) {\n const $$ = this;\n const { cache, state } = $$;\n const configValue = $$.config[`axis_x_${type}`];\n const canCache = canCacheTargetDomain($$, targets);\n const cacheKey = canCache ?\n `${KEY.domainMinMax}_x_${type}_${getTargetDomainCacheKey($$, targets)}` :\n null;\n const cached = cacheKey && cache.get(cacheKey);\n let dataValue = cached?.generation === state.dataGeneration ? cached.value : undefined;\n if (dataValue === undefined) {\n dataValue = getTargetXMinMax(targets, type);\n cacheKey && cache.add(cacheKey, {\n generation: state.dataGeneration,\n value: dataValue\n });\n }\n let value = isObject(configValue) ? configValue.value : configValue;\n value = isDefined(value) && $$.axis?.isTimeSeries() ? parseDate.bind(this)(value) : value;\n if (isObject(configValue) && configValue.fit && ((type === \"min\" && value < dataValue) || (type === \"max\" && value > dataValue))) {\n value = undefined;\n }\n return isDefined(value) ? value : dataValue;\n },\n /**\n * Get x Axis padding\n * @param {Array} domain x Axis domain\n * @param {number} tickCount Tick count\n * @returns {object} Padding object values with 'left' & 'right' key\n * @private\n */\n getXDomainPadding(domain, tickCount) {\n const $$ = this;\n const { axis, config } = $$;\n const padding = config.axis_x_padding;\n const isTimeSeriesTickCount = axis.isTimeSeries() && tickCount;\n const diff = diffDomain(domain);\n let defaultValue;\n // determine default padding value\n if (axis.isCategorized() || isTimeSeriesTickCount) {\n defaultValue = 0;\n }\n else if ($$.hasType(\"bar\")) {\n const maxDataCount = $$.getMaxDataCount();\n defaultValue = maxDataCount > 1 ? (diff / (maxDataCount - 1)) / 2 : 0.5;\n }\n else {\n defaultValue = $$.getResettedPadding(diff * 0.01);\n }\n let { left = defaultValue, right = defaultValue } = isNumber(padding) ?\n { left: padding, right: padding } :\n padding;\n // when the unit is pixel, convert pixels to axis scale value\n if (padding.unit === \"px\") {\n const domainLength = Math.abs(diff + (diff * 0.2));\n left = axis.getPadding(padding, \"left\", defaultValue, domainLength);\n right = axis.getPadding(padding, \"right\", defaultValue, domainLength);\n }\n else {\n const range = diff + left + right;\n if (isTimeSeriesTickCount && range) {\n const relativeTickWidth = (diff / tickCount) / range;\n left = left / range / relativeTickWidth;\n right = right / range / relativeTickWidth;\n }\n }\n return { left, right };\n },\n /**\n * Get x Axis domain\n * @param {Array} targets targets\n * @returns {Array} x Axis domain\n * @private\n */\n getXDomain(targets) {\n const $$ = this;\n const { axis, config, scale: { x } } = $$;\n const isInverted = config.axis_x_inverted;\n const domain = [\n $$.getXDomainMinMax(targets, \"min\"),\n $$.getXDomainMinMax(targets, \"max\")\n ];\n let [min = 0, max = 0] = domain;\n if (x.type !== \"log\") {\n const isCategorized = axis.isCategorized();\n const isTimeSeries = axis.isTimeSeries();\n const padding = $$.getXDomainPadding(domain);\n let [firstX, lastX] = domain;\n // show center of x domain if min and max are the same\n if ((firstX - lastX) === 0 && !isCategorized) {\n if (isTimeSeries) {\n firstX = new Date(firstX.getTime() * 0.5);\n lastX = new Date(lastX.getTime() * 1.5);\n }\n else {\n firstX = firstX === 0 ? 1 : (firstX * 0.5);\n lastX = lastX === 0 ? -1 : (lastX * 1.5);\n }\n }\n if (firstX || firstX === 0) {\n min = isTimeSeries ?\n new Date(firstX.getTime() - padding.left) :\n firstX - padding.left;\n }\n if (lastX || lastX === 0) {\n max = isTimeSeries ?\n new Date(lastX.getTime() + padding.right) :\n lastX + padding.right;\n }\n }\n return isInverted ? [max, min] : [min, max];\n },\n updateXDomain(targets, withUpdateXDomain, withUpdateOrgXDomain, withTrim, domain) {\n const $$ = this;\n const { config, org, scale: { x, subX } } = $$;\n const zoomEnabled = config.zoom_enabled;\n if (withUpdateOrgXDomain) {\n x.domain(domain || sortValue($$.getXDomain(targets), !config.axis_x_inverted));\n org.xDomain = x.domain();\n // zoomEnabled && $$.zoom.updateScaleExtent();\n subX.domain(x.domain());\n $$.brush?.scale(subX);\n }\n if (withUpdateXDomain) {\n const domainValue = domain || (!$$.brush || brushEmpty($$)) ?\n org.xDomain :\n getBrushSelection($$).map(subX.invert);\n x.domain(domainValue);\n // zoomEnabled && $$.zoom.updateScaleExtent();\n }\n if (withUpdateOrgXDomain || withUpdateXDomain) {\n zoomEnabled && $$.zoom.updateScaleExtent();\n }\n // Trim domain when too big by zoom mousemove event\n withTrim && x.domain($$.trimXDomain(x.orgDomain()));\n return x.domain();\n },\n /**\n * Trim x domain when given domain surpasses the range\n * @param {Array} domain Domain value\n * @returns {Array} Trimed domain if given domain is out of range\n * @private\n */\n trimXDomain(domain) {\n const $$ = this;\n const isInverted = $$.config.axis_x_inverted;\n const zoomDomain = $$.getZoomDomain();\n const [min, max] = zoomDomain;\n if (isInverted ? domain[0] >= min : domain[0] <= min) {\n domain[1] = +domain[1] + (min - domain[0]);\n domain[0] = min;\n }\n if (isInverted ? domain[1] <= max : domain[1] >= max) {\n domain[0] = +domain[0] - (domain[1] - max);\n domain[1] = max;\n }\n return domain;\n },\n /**\n * Get subchart/zoom domain\n * @param {string} type \"subX\" or \"zoom\"\n * @param {boolean} getCurrent Get current domain if true\n * @returns {Array} zoom domain\n * @private\n */\n getZoomDomain(type = \"zoom\", getCurrent = false) {\n const $$ = this;\n const { config, scale, org } = $$;\n let [min, max] = getCurrent && scale[type] ? scale[type].domain() : org.xDomain;\n if (type === \"zoom\") {\n if (isDefined(config.zoom_x_min)) {\n min = getMinMax(\"min\", [min, config.zoom_x_min]);\n }\n if (isDefined(config.zoom_x_max)) {\n max = getMinMax(\"max\", [max, config.zoom_x_max]);\n }\n }\n return [min, max];\n },\n /**\n * Return zoom domain from given domain\n * - 'category' type need to add offset to original value\n * @param {Array} domainValue domain value\n * @returns {Array} Zoom domain\n * @private\n */\n getZoomDomainValue(domainValue) {\n const $$ = this;\n const { config, axis } = $$;\n if (axis.isCategorized() && Array.isArray(domainValue)) {\n const isInverted = config.axis_x_inverted;\n // need to add offset to original value for 'category' type\n const domain = domainValue.map((v, i) => Number(v) + (i === 0 ? +isInverted : +!isInverted));\n return domain;\n }\n return domainValue;\n },\n /**\n * Converts pixels to axis' scale values\n * @param {string} type Axis type\n * @param {number} pixels Pixels\n * @param {number} domainLength Domain length\n * @returns {number}\n * @private\n */\n convertPixelToScale(type, pixels, domainLength) {\n const $$ = this;\n const { config, state } = $$;\n const isRotated = config.axis_rotated;\n let length;\n if (type === \"x\") {\n length = isRotated ? \"height\" : \"width\";\n }\n else {\n length = isRotated ? \"width\" : \"height\";\n }\n return domainLength * (pixels / state[length]);\n },\n /**\n * Check if the given domain is within subchart/zoom range\n * @param {Array} domain Target domain value\n * @param {Array} current Current subchart/zoom domain value\n * @param {Array} range subchart/zoom range value\n * @returns {boolean}\n * @private\n */\n withinRange(domain, current = [0, 0], range) {\n const $$ = this;\n const isInverted = $$.config.axis_x_inverted;\n const [min, max] = range;\n if (Array.isArray(domain)) {\n const lo = isInverted ? domain[1] : domain[0];\n const hi = isInverted ? domain[0] : domain[1];\n if (lo < hi) {\n return domain.every((v, i) => (i === 0 ?\n (isInverted ? +v <= min : +v >= min) :\n (isInverted ? +v >= max : +v <= max)) && !(domain.every((v, i) => v === current[i])));\n }\n }\n return false;\n }\n};\n\nexport { domain as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { isArray, isValue, isObject, isFunction, isObjectType } from '../../module/util/type-checks.js';\n\n/**\n * Get formatted\n * @param {object} $$ Context\n * @param {string} typeValue Axis type\n * @param {number} v Value to be formatted\n * @returns {number | string}\n * @private\n */\nfunction _getFormat($$, typeValue, v) {\n const { config } = $$;\n const type = `axis_${typeValue}_tick_format`;\n const format = config[type] ? config[type] : $$.defaultValueFormat;\n return format.call($$.api, v);\n}\nvar format = {\n yFormat(v) {\n return _getFormat(this, \"y\", v);\n },\n y2Format(v) {\n return _getFormat(this, \"y2\", v);\n },\n /**\n * Get default value format function\n * @returns {function} formatter function\n * @private\n */\n getDefaultValueFormat() {\n const $$ = this;\n const { defaultArcValueFormat, yFormat, y2Format } = $$;\n const hasArc = $$.hasArcType(null, [\"gauge\", \"polar\", \"radar\"]);\n return function (v, ratio, id) {\n const format = hasArc ? defaultArcValueFormat : ($$.axis && $$.axis.getId(id) === \"y2\" ? y2Format : yFormat);\n return format.call($$, v, ratio);\n };\n },\n defaultValueFormat(v) {\n return isArray(v) ? v.join(\"~\") : (isValue(v) ? +v : \"\");\n },\n defaultArcValueFormat(v, ratio) {\n return `${(ratio * 100).toFixed(1)}%`;\n },\n defaultPolarValueFormat(v) {\n return `${v}`;\n },\n dataLabelFormat(targetId) {\n const $$ = this;\n const dataLabels = $$.config.data_labels;\n const defaultFormat = v => {\n const delimiter = \"~\";\n let res = v;\n if (isArray(v)) {\n res = v.join(delimiter);\n }\n else if (isObject(v)) {\n res = Object.values(v).join(delimiter);\n }\n return res;\n };\n let format = defaultFormat;\n // find format according to axis id\n if (isFunction(dataLabels.format)) {\n format = dataLabels.format;\n }\n else if (isObjectType(dataLabels.format)) {\n if (dataLabels.format[targetId]) {\n format = dataLabels.format[targetId] === true ?\n defaultFormat :\n dataLabels.format[targetId];\n }\n else {\n format = () => \"\";\n }\n }\n return format.bind($$.api);\n }\n};\n\nexport { format as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { select, namespaces } from 'd3-selection';\nimport { $LEGEND, $FOCUS, $GAUGE } from '../../config/classes.js';\nimport { document as doc } from '../../module/browser.js';\nimport { KEY } from '../../module/Cache.js';\nimport { isDefined, isFunction, isEmpty, isBoolean } from '../../module/util/type-checks.js';\nimport { callFn, tplProcess, getOption, toMap } from '../../module/util/object.js';\nimport { sanitize } from '../../module/sanitize.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\nconst LEGEND_TOUCH_TAP_THRESHOLD = 10;\nconst LEGEND_TOUCH_CLICK_TIMEOUT = 750;\n/**\n * Get color string for given data id\n * Internal helper used only within this file\n * @param {string} id Data id\n * @returns {string} Color string\n * @private\n */\nfunction _getLegendColor(id) {\n const $$ = this;\n const data = $$.getDataById(id);\n const color = $$.levelColor ? $$.levelColor(data.values[0].value) : $$.color(data);\n return color;\n}\n/**\n * Get formatted text value\n * Internal helper used only within this file\n * @param {string} id Legend text id\n * @param {boolean} formatted Whether or not to format the text\n * @returns {string} Formatted legend text\n * @private\n */\nfunction _getFormattedText(id, formatted = true) {\n const { config } = this;\n let text = config.data_names[id] ?? id;\n if (formatted && isFunction(config.legend_format)) {\n text = config.legend_format(text, id !== text ? id : undefined);\n }\n return text;\n}\n/**\n * Build a Map of legend items for fast O(1) lookup by ID\n * Internal helper used only within this file\n * @param {object} $$ ChartInternal context\n * @param {d3.selection} legendItems D3 selection of legend items\n * @private\n */\nfunction _buildLegendItemMap($$, legendItems) {\n if (!legendItems || legendItems.empty()) {\n return;\n }\n // rebuild from all rendered items, not the passed (possibly enter-only) selection,\n // so existing items aren't dropped from the map when new series are loaded\n const allItems = $$.$el.legend?.selectAll(`.${$LEGEND.legendItem}`);\n if (allItems && !allItems.empty()) {\n legendItems = allItems;\n }\n // Convert D3 selection to array of [id, node] pairs\n const items = [];\n legendItems.each(function (id) {\n items.push({ id, node: this });\n });\n // Create Map for O(1) lookups using toMap utility\n const itemMap = toMap(items, item => item.id, item => item.node);\n // Cache the map\n $$.cache.add(KEY.legendItemMap, itemMap);\n}\n/**\n * Get touch point from a touch event.\n * @param {TouchEvent} event Touch event\n * @returns {Touch | undefined} Touch point\n * @private\n */\nfunction _getLegendTouchPoint(event) {\n return event.changedTouches?.[0] || event.touches?.[0];\n}\n/**\n * Store the touch start position for legend tap detection.\n * @param {object} $$ ChartInternal context\n * @param {string} id Legend data id\n * @param {TouchEvent} event Touch event\n * @private\n */\nfunction _setLegendTouchStart($$, id, event) {\n const touch = _getLegendTouchPoint(event);\n $$.state.legendTouch = touch ?\n {\n id,\n x: touch.clientX,\n y: touch.clientY,\n moved: false\n } :\n null;\n}\n/**\n * Update whether the current legend touch moved beyond tap tolerance.\n * @param {object} $$ ChartInternal context\n * @param {TouchEvent} event Touch event\n * @private\n */\nfunction _updateLegendTouchMove($$, event) {\n const start = $$.state.legendTouch;\n const touch = start && _getLegendTouchPoint(event);\n if (touch) {\n start.moved = start.moved ||\n Math.abs(touch.clientX - start.x) > LEGEND_TOUCH_TAP_THRESHOLD ||\n Math.abs(touch.clientY - start.y) > LEGEND_TOUCH_TAP_THRESHOLD;\n }\n}\n/**\n * Determine whether a touch sequence is a legend tap.\n * @param {object} $$ ChartInternal context\n * @param {string} id Legend data id\n * @param {TouchEvent} event Touch event\n * @returns {boolean} Whether the touch sequence is a tap\n * @private\n */\nfunction _isLegendTouchTap($$, id, event) {\n _updateLegendTouchMove($$, event);\n const start = $$.state.legendTouch;\n $$.state.legendTouch = null;\n return !!start && start.id === id && !start.moved;\n}\n/**\n * Mark a touch legend tap so the following compatibility click can be skipped.\n * @param {object} $$ ChartInternal context\n * @param {string} id Legend data id\n * @private\n */\nfunction _markLegendTouchClick($$, id) {\n $$.state.legendLastTouchClickId = id;\n $$.state.legendLastTouchClickTime = Date.now();\n}\n/**\n * Check if a click duplicates a recent touch legend tap.\n * @param {object} $$ ChartInternal context\n * @param {string} id Legend data id\n * @returns {boolean} Whether the click is duplicate\n * @private\n */\nfunction _isDuplicateLegendTouchClick($$, id) {\n const { state } = $$;\n const duplicate = state.legendLastTouchClickId === id &&\n Date.now() - (state.legendLastTouchClickTime || 0) < LEGEND_TOUCH_CLICK_TIMEOUT;\n if (duplicate) {\n state.legendLastTouchClickId = null;\n state.legendLastTouchClickTime = 0;\n }\n return duplicate;\n}\n/**\n * Get touch listener passive option following interaction.inputType.touch.preventDefault.\n * @param {object} $$ ChartInternal context\n * @returns {object} Touch listener option\n * @private\n */\nfunction _getLegendTouchOption($$) {\n const preventDefault = $$.config.interaction_inputType_touch?.preventDefault;\n const isPrevented = (isBoolean(preventDefault) && preventDefault) || false;\n const preventThreshold = (!isNaN(preventDefault) && preventDefault) || null;\n return {\n passive: !isPrevented && preventThreshold === null\n };\n}\nvar legend = {\n /**\n * Initialize the legend.\n * @private\n */\n initLegend() {\n const $$ = this;\n const { config, $el } = $$;\n $$.legendItemTextBox = {};\n $$.state.legendHasRendered = false;\n if ($$.state.isCanvasMode) {\n if (config.legend_show) {\n $$.updateHtmlLegend?.();\n }\n else {\n $$.state.hiddenLegendIds = new Set($$.mapToIds($$.data.targets));\n }\n return;\n }\n if (config.legend_show) {\n if (!config.legend_contents_bindto) {\n $el.legend = $$.$el.svg.append(\"g\")\n .classed($LEGEND.legend, true)\n .attr(\"transform\", $$.getTranslate(\"legend\"));\n }\n // MEMO: call here to update legend box and translate for all\n // MEMO: translate will be updated by this, so transform not needed in updateLegend()\n $$.updateLegend();\n }\n else {\n $$.state.hiddenLegendIds = new Set($$.mapToIds($$.data.targets));\n }\n },\n /**\n * Update legend element\n * @param {Array} targetIds ID's of target\n * @param {object} options withTransform : Whether to use the transform property / withTransitionForTransform: Whether transition is used when using the transform property / withTransition : whether or not to transition.\n * @param {object} transitions Return value of the generateTransitions\n * @private\n */\n updateLegend(targetIds, options, transitions) {\n const $$ = this;\n const { config, state, scale, $el } = $$;\n const optionz = options || {\n withTransform: false,\n withTransitionForTransform: false,\n withTransition: false\n };\n optionz.withTransition = getOption(optionz, \"withTransition\", true);\n optionz.withTransitionForTransform = getOption(optionz, \"withTransitionForTransform\", true);\n if (config.legend_contents_bindto && config.legend_contents_template) {\n $$.updateLegendTemplate();\n }\n else if (!state.hasTreemap) {\n $$.updateLegendElement(targetIds || $$.mapToIds($$.data.targets), optionz);\n }\n // toggle legend state\n $el.legend?.selectAll(`.${$LEGEND.legendItem}`)\n .classed($LEGEND.legendItemHidden, function (id) {\n const hide = !$$.isTargetToShow(id);\n if (hide) {\n this.style.opacity = null;\n }\n return hide;\n });\n // Update size and scale\n $$.updateScales(false, !scale.zoom);\n $$.updateSvgSize();\n // Update g positions\n $$.transformAll(optionz.withTransitionForTransform, transitions);\n state.legendHasRendered = true;\n },\n /**\n * Update legend using template option\n * @private\n */\n updateLegendTemplate() {\n const $$ = this;\n const { config, $el } = $$;\n const wrapper = select(config.legend_contents_bindto);\n const template = config.legend_contents_template;\n if (!wrapper.empty()) {\n const targets = $$.mapToIds($$.data.targets);\n const ids = [];\n let html = \"\";\n targets.forEach(v => {\n const content = isFunction(template) ?\n sanitize(template.call($$.api, v, $$.color(v), $$.api.data(v)[0].values)) :\n tplProcess(template, {\n COLOR: $$.color(v),\n TITLE: v\n });\n if (content) {\n ids.push(v);\n html += content;\n }\n });\n const legendItem = wrapper.html(html)\n .selectAll(function () {\n return this.childNodes;\n })\n .data(ids);\n $$.setLegendItem(legendItem);\n $el.legend = wrapper;\n }\n },\n /**\n * Update the size of the legend.\n * @param {Obejct} size Size object\n * @private\n */\n updateSizeForLegend(size) {\n const $$ = this;\n const { config, state: { isLegendTop, isLegendLeft, isLegendRight, isLegendInset, current } } = $$;\n const { width, height } = size;\n const insetLegendPosition = {\n top: isLegendTop ?\n $$.getCurrentPaddingByDirection(\"top\") + config.legend_inset_y + 5.5 :\n current.height - height - $$.getCurrentPaddingByDirection(\"bottom\") -\n config.legend_inset_y,\n left: isLegendLeft ?\n $$.getCurrentPaddingByDirection(\"left\") + config.legend_inset_x + 0.5 :\n current.width - width - $$.getCurrentPaddingByDirection(\"right\") -\n config.legend_inset_x + 0.5\n };\n $$.state.margin3 = {\n top: isLegendRight ?\n 0 :\n isLegendInset ?\n insetLegendPosition.top :\n current.height - height,\n right: NaN,\n bottom: 0,\n left: isLegendRight ?\n current.width - width :\n isLegendInset ?\n insetLegendPosition.left :\n 0\n };\n },\n /**\n * Transform Legend\n * @param {boolean} withTransition whether or not to transition.\n * @private\n */\n transformLegend(withTransition) {\n const $$ = this;\n const { $el: { legend }, $T } = $$;\n $T(legend, withTransition)\n .attr(\"transform\", $$.getTranslate(\"legend\"));\n },\n /**\n * Update legend item color\n * @param {string} id Corresponding data ID value\n * @param {string} color Color value\n * @private\n */\n updateLegendItemColor(id, color) {\n const $$ = this;\n const { legend } = $$.$el;\n if (legend) {\n // Use cached Map lookup for O(1) performance\n const legendItem = $$.getLegendItemById(id);\n if (legendItem) {\n select(legendItem).select(\"line\")\n .style(\"stroke\", color);\n }\n }\n },\n /**\n * Get the width of the legend\n * @returns {number} width\n * @private\n */\n getLegendWidth() {\n const $$ = this;\n const { current: { width }, isLegendRight, isLegendInset, legendItemWidth, legendStep } = $$.state;\n return $$.config.legend_show ?\n (isLegendRight || isLegendInset ? legendItemWidth * (legendStep + 1) : width) :\n 0;\n },\n /**\n * Get the height of the legend\n * @returns {number} height\n * @private\n */\n getLegendHeight() {\n const $$ = this;\n const { current, isLegendRight, legendItemHeight, legendStep } = $$.state;\n const isFitPadding = $$.config.padding?.mode === \"fit\";\n const minHeight = isFitPadding ? 10 : 20;\n const height = $$.config.legend_show ?\n (isLegendRight ? current.height : (Math.max(minHeight, legendItemHeight)) * (legendStep + 1)) :\n 0;\n return height;\n },\n /**\n * Get the opacity of the legend that is unfocused\n * @param {d3.selection} legendItem Legend item node\n * @returns {string|null} opacity\n * @private\n */\n opacityForUnfocusedLegend(legendItem) {\n return legendItem.classed($LEGEND.legendItemHidden) ? null : \"0.3\";\n },\n /**\n * Toggles the focus of the legend\n * @param {Array} targetIds ID's of target\n * @param {boolean} focus whether or not to focus.\n * @private\n */\n toggleFocusLegend(targetIds, focus) {\n const $$ = this;\n const { $el: { legend }, $T } = $$;\n const targetIdz = $$.mapToTargetIds(targetIds);\n legend && $T(legend.selectAll(`.${$LEGEND.legendItem}`)\n .filter(id => targetIdz.indexOf(id) >= 0)\n .classed($FOCUS.legendItemFocused, focus))\n .style(\"opacity\", function () {\n return focus ? null : $$.opacityForUnfocusedLegend.call($$, select(this));\n });\n },\n /**\n * Revert the legend to its default state\n * @private\n */\n revertLegend() {\n const $$ = this;\n const { $el: { legend }, $T } = $$;\n legend && $T(legend.selectAll(`.${$LEGEND.legendItem}`)\n .classed($FOCUS.legendItemFocused, false))\n .style(\"opacity\", null);\n },\n /**\n * Shows the legend\n * @param {Array} targetIds ID's of target\n * @private\n */\n showLegend(targetIds) {\n const $$ = this;\n const { config, $el, $T } = $$;\n if (!config.legend_show) {\n config.legend_show = true;\n $el.legend ? $el.legend.style(\"visibility\", null) : $$.initLegend();\n !$$.state.legendHasRendered && $$.updateLegend();\n }\n $$.removeHiddenLegendIds(targetIds);\n $T($el.legend.selectAll($$.selectorLegends(targetIds))\n .style(\"visibility\", null)).style(\"opacity\", null);\n },\n /**\n * Hide the legend\n * @param {Array} targetIds ID's of target\n * @private\n */\n hideLegend(targetIds) {\n const $$ = this;\n const { config, $el: { legend } } = $$;\n if (config.legend_show && isEmpty(targetIds)) {\n config.legend_show = false;\n legend?.style(\"visibility\", \"hidden\");\n }\n $$.addHiddenLegendIds(targetIds);\n // legend element isn't created when the chart was generated with legend.show=false\n legend?.selectAll($$.selectorLegends(targetIds))\n .style(\"opacity\", \"0\")\n .style(\"visibility\", \"hidden\");\n },\n /**\n * Get legend item textbox dimension\n * @param {string} id Data ID\n * @param {HTMLElement|d3.selection} textElement Text node element\n * @returns {object} Bounding rect\n * @private\n */\n getLegendItemTextBox(id, textElement) {\n const $$ = this;\n const { cache, state } = $$;\n let data;\n // do not prefix w/'$', to not be resetted cache in .load() call\n const cacheKey = KEY.legendItemTextBox;\n if (id) {\n data = (!state.redrawing && cache.get(cacheKey)) || {};\n if (!data[id]) {\n data[id] = $$.getTextRect(textElement, $LEGEND.legendItem);\n cache.add(cacheKey, data);\n }\n data = data[id];\n }\n return data;\n },\n /**\n * Set legend item style & bind events\n * @param {d3.selection} item Item node\n * @private\n */\n setLegendItem(item) {\n const $$ = this;\n const { $el, api, config, state } = $$;\n const isTouch = state.inputType === \"touch\";\n const hasGauge = $$.hasType(\"gauge\");\n const useCssRule = config.boost_useCssRule;\n const interaction = config.legend_item_interaction;\n const eventType = interaction.dblclick ? \"dblclick\" : \"click\";\n const hasClickInteraction = interaction || isFunction(config.legend_item_onclick);\n const touchOption = isTouch ? _getLegendTouchOption($$) : undefined;\n const handleLegendToggle = function (event, id) {\n if (!callFn(config.legend_item_onclick, api, id, !state.hiddenTargetIds.has(id))) {\n const { altKey, type } = event;\n const selected = select(this);\n if (type === \"dblclick\" || altKey) {\n // when focused legend is clicked(with altKey or double clicked), reset all hiding.\n if (state.hiddenTargetIds.size &&\n !selected.classed($LEGEND.legendItemHidden)) {\n api.show();\n }\n else {\n api.hide();\n api.show(id);\n }\n }\n else {\n api.toggle(id);\n selected.classed($FOCUS.legendItemFocused, false);\n }\n }\n if (isTouch) {\n $$.hideTooltip();\n $$.hideGridFocus?.(true);\n }\n };\n item\n .attr(\"class\", function (id) {\n const node = select(this);\n const itemClass = (!node.empty() && node.attr(\"class\")) || \"\";\n return itemClass + $$.generateClass($LEGEND.legendItem, id);\n })\n .style(\"visibility\", id => ($$.isLegendToShow(id) ? null : \"hidden\"));\n if (config.interaction_enabled) {\n if (useCssRule) {\n [\n [`.${$LEGEND.legendItem}`, \"cursor:pointer\"],\n [`.${$LEGEND.legendItem} text`, \"pointer-events:none\"],\n [`.${$LEGEND.legendItemPoint} text`, \"pointer-events:none\"],\n [`.${$LEGEND.legendItemTile}`, \"pointer-events:none\"],\n [`.${$LEGEND.legendItemEvent}`, \"fill-opacity:0\"]\n ].forEach(v => {\n const [selector, props] = v;\n $$.setCssRule(false, selector, [props])($el.legend);\n });\n }\n item\n .on(eventType, hasClickInteraction ?\n function (event, id) {\n if (isTouch && event.type === \"click\" &&\n _isDuplicateLegendTouchClick($$, id)) {\n return;\n }\n handleLegendToggle.call(this, event, id);\n } :\n null);\n isTouch && eventType === \"click\" && hasClickInteraction && item\n .on(\"touchstart\", function (event, id) {\n _setLegendTouchStart($$, id, event);\n }, touchOption)\n .on(\"touchmove\", event => {\n _updateLegendTouchMove($$, event);\n }, touchOption)\n .on(\"touchend\", function (event, id) {\n if (_isLegendTouchTap($$, id, event)) {\n _markLegendTouchClick($$, id);\n handleLegendToggle.call(this, event, id);\n }\n }, touchOption);\n !isTouch && item\n .on(\"mouseout\", interaction || isFunction(config.legend_item_onout) ?\n function (event, id) {\n if (!callFn(config.legend_item_onout, api, id, !state.hiddenTargetIds.has(id))) {\n select(this).classed($FOCUS.legendItemFocused, false);\n if (hasGauge) {\n $$.undoMarkOverlapped($$, `.${$GAUGE.gaugeValue}`);\n }\n $$.api.revert();\n }\n } :\n null)\n .on(\"mouseover\", interaction || isFunction(config.legend_item_onover) ?\n function (event, id) {\n if (!callFn(config.legend_item_onover, api, id, !state.hiddenTargetIds.has(id))) {\n select(this).classed($FOCUS.legendItemFocused, true);\n if (hasGauge) {\n $$.markOverlapped(id, $$, `.${$GAUGE.gaugeValue}`);\n }\n if (!state.transiting && $$.isTargetToShow(id)) {\n api.focus(id);\n }\n }\n } :\n null);\n // set cursor when has some interaction\n !item.empty() && item.on(\"click mouseout mouseover\") &&\n item.style(\"cursor\", $$.getStylePropValue(\"pointer\"));\n }\n // Build legend item map for O(1) lookup\n _buildLegendItemMap($$, item);\n },\n /**\n * Get legend item node by ID using cached Map for O(1) lookup\n * Falls back to D3 selection if map is not available\n * @param {string} id Data ID\n * @returns {HTMLElement | null} Legend item node\n * @private\n */\n getLegendItemById(id) {\n const $$ = this;\n const itemMap = $$.cache.get(KEY.legendItemMap);\n if (itemMap && itemMap instanceof Map) {\n return itemMap.get(id) || null;\n }\n // Fallback to D3 selection (slower)\n const item = $$.$el.legend?.selectAll(`.${$LEGEND.legendItem}`)\n .filter(d => d === id);\n return item?.node() || null;\n },\n /**\n * Update the legend\n * @param {Array} targetIds ID's of target\n * @param {object} options withTransform : Whether to use the transform property / withTransitionForTransform: Whether transition is used when using the transform property / withTransition : whether or not to transition.\n * @private\n */\n updateLegendElement(targetIds, options) {\n const $$ = this;\n const { config, state, $el: { legend }, $T } = $$;\n const legendType = config.legend_item_tile_type;\n const isRectangle = legendType !== \"circle\";\n const legendItemR = config.legend_item_tile_r;\n const itemTileSize = {\n width: isRectangle ? config.legend_item_tile_width : legendItemR * 2,\n height: isRectangle ? config.legend_item_tile_height : legendItemR * 2\n };\n const dimension = {\n padding: {\n top: 4,\n right: 10\n },\n max: {\n width: 0,\n height: 0\n },\n posMin: 10,\n step: 0,\n tileWidth: itemTileSize.width + 5,\n totalLength: 0\n };\n const sizes = {\n offsets: {},\n widths: {},\n heights: {},\n margins: [0],\n steps: {}\n };\n let xForLegend;\n let yForLegend;\n let background;\n // Skip elements when their name is set to null\n const targetIdz = targetIds\n .filter(id => !isDefined(config.data_names[id]) || config.data_names[id] !== null);\n const withTransition = options.withTransition;\n const isLegendRightOrInset = state.isLegendRight || state.isLegendInset;\n const getFormattedText = _getFormattedText.bind($$);\n const updatePositions = $$.getUpdateLegendPositions(targetIdz, dimension, sizes, isLegendRightOrInset);\n if (state.isLegendInset) {\n dimension.step = config.legend_inset_step ? config.legend_inset_step : targetIdz.length;\n state.legendStep = dimension.step;\n }\n if (state.isLegendRight) {\n xForLegend = id => dimension.max.width * sizes.steps[id];\n yForLegend = id => sizes.margins[sizes.steps[id]] + sizes.offsets[id];\n }\n else if (state.isLegendInset) {\n xForLegend = id => dimension.max.width * sizes.steps[id] + 10;\n yForLegend = id => sizes.margins[sizes.steps[id]] + sizes.offsets[id];\n }\n else {\n xForLegend = id => sizes.margins[sizes.steps[id]] + sizes.offsets[id];\n yForLegend = id => dimension.max.height * sizes.steps[id];\n }\n const posFn = {\n xText: (id, i) => xForLegend(id, i) + 4 + itemTileSize.width,\n xRect: (id, i) => xForLegend(id, i),\n x1Tile: (id, i) => xForLegend(id, i) - 2,\n x2Tile: (id, i) => xForLegend(id, i) - 2 + itemTileSize.width,\n yText: (id, i) => yForLegend(id, i) + 9,\n yRect: (id, i) => yForLegend(id, i) - 5,\n yTile: (id, i) => yForLegend(id, i) + 4\n };\n $$.generateLegendItem(targetIdz, itemTileSize, updatePositions, posFn, isLegendRightOrInset, getFormattedText);\n // Set background for inset legend\n background = legend.select(`.${$LEGEND.legendBackground} rect`);\n if (state.isLegendInset && dimension.max.width > 0 && background.size() === 0) {\n background = legend.insert(\"g\", `.${$LEGEND.legendItem}`)\n .attr(\"class\", $LEGEND.legendBackground)\n .append(\"rect\");\n }\n if (config.legend_tooltip) {\n legend.selectAll(\"title\")\n .data(targetIdz)\n .text(id => getFormattedText(id, false));\n }\n const texts = legend.selectAll(\"text\")\n .data(targetIdz)\n .text(id => getFormattedText(id)) // MEMO: needed for update\n .each(function (id, i) {\n updatePositions(this, id, i);\n });\n $T(texts, withTransition)\n .attr(\"x\", posFn.xText)\n .attr(\"y\", posFn.yText);\n const rects = legend.selectAll(`rect.${$LEGEND.legendItemEvent}`)\n .data(targetIdz);\n $T(rects, withTransition)\n .attr(\"width\", id => sizes.widths[id])\n .attr(\"height\", id => sizes.heights[id])\n .attr(\"x\", posFn.xRect)\n .attr(\"y\", posFn.yRect);\n // update legend items position\n $$.updateLegendItemPos(targetIdz, withTransition, posFn);\n if (background) {\n $T(background, withTransition)\n .attr(\"height\", $$.getLegendHeight() - 12)\n .attr(\"width\", dimension.max.width * (dimension.step + 1) + 10);\n }\n // Update all to reflect change of legend\n state.legendItemWidth = dimension.max.width;\n state.legendItemHeight = dimension.max.height;\n state.legendStep = dimension.step;\n },\n /**\n * Get position update function\n * @param {Array} targetIdz Data ids\n * @param {object} dimension Dimension object\n * @param {object} sizes Size object\n * @param {boolean} isLegendRightOrInset Whether legend is right or inset\n * @returns {function} Update position function\n * @private\n */\n getUpdateLegendPositions(targetIdz, dimension, sizes, isLegendRightOrInset) {\n const $$ = this;\n const { config, state } = $$;\n return function (textElement, id, index) {\n const reset = index === 0;\n const isLast = index === targetIdz.length - 1;\n const box = $$.getLegendItemTextBox(id, textElement);\n const itemWidth = box.width + dimension.tileWidth +\n (isLast && !isLegendRightOrInset ? 0 : dimension.padding.right) +\n config.legend_padding;\n const itemHeight = box.height + dimension.padding.top;\n const itemLength = isLegendRightOrInset ? itemHeight : itemWidth;\n const areaLength = isLegendRightOrInset ? $$.getLegendHeight() : $$.getLegendWidth();\n let margin;\n // MEMO: care about condifion of step, totalLength\n const updateValues = function (id2, withoutStep) {\n if (!withoutStep) {\n margin = (areaLength - dimension.totalLength - itemLength) / 2;\n if (margin < dimension.posMin) {\n margin = (areaLength - itemLength) / 2;\n dimension.totalLength = 0;\n dimension.step++;\n }\n }\n sizes.steps[id2] = dimension.step;\n sizes.margins[dimension.step] = state.isLegendInset ? 10 : margin;\n sizes.offsets[id2] = dimension.totalLength;\n dimension.totalLength += itemLength;\n };\n if (reset) {\n dimension.totalLength = 0;\n dimension.step = 0;\n dimension.max.width = 0;\n dimension.max.height = 0;\n }\n if (config.legend_show && !$$.isLegendToShow(id)) {\n sizes.widths[id] = 0;\n sizes.heights[id] = 0;\n sizes.steps[id] = 0;\n sizes.offsets[id] = 0;\n return;\n }\n sizes.widths[id] = itemWidth;\n sizes.heights[id] = itemHeight;\n if (!dimension.max.width || itemWidth >= dimension.max.width) {\n dimension.max.width = itemWidth;\n }\n if (!dimension.max.height || itemHeight >= dimension.max.height) {\n dimension.max.height = itemHeight;\n }\n const maxLength = isLegendRightOrInset ? dimension.max.height : dimension.max.width;\n if (config.legend_equally) {\n for (const id2 in sizes.widths)\n sizes.widths[id2] = dimension.max.width;\n for (const id2 in sizes.heights)\n sizes.heights[id2] = dimension.max.height;\n margin = (areaLength - maxLength * targetIdz.length) / 2;\n if (margin < dimension.posMin) {\n dimension.totalLength = 0;\n dimension.step = 0;\n targetIdz.forEach(id2 => updateValues(id2));\n }\n else {\n updateValues(id, true);\n }\n }\n else {\n updateValues(id);\n }\n };\n },\n /**\n * Generate legend item elements\n * @param {Array} targetIdz Data ids\n * @param {object} itemTileSize Item tile size {width, height}\n * @param {function} updatePositions Update position function\n * @param {object} posFn Position functions\n * @param {boolean} isLegendRightOrInset Whether legend is right or inset\n * @param {function} getFormattedText Bound text formatter function\n * @private\n */\n generateLegendItem(targetIdz, itemTileSize, updatePositions, posFn, isLegendRightOrInset, getFormattedText) {\n const $$ = this;\n const { config, state, $el: { legend } } = $$;\n const usePoint = config.legend_usePoint;\n const legendItemR = config.legend_item_tile_r;\n const legendType = config.legend_item_tile_type;\n const isRectangle = legendType !== \"circle\";\n const pos = -200;\n // Define g for legend area\n const l = legend.selectAll(`.${$LEGEND.legendItem}`)\n .data(targetIdz)\n .enter()\n .append(\"g\");\n $$.setLegendItem(l);\n if (config.legend_tooltip) {\n l.append(\"title\").text(id => id);\n }\n l.append(\"text\")\n .text(id => getFormattedText(id))\n .each(function (id, i) {\n updatePositions(this, id, i);\n })\n .style(\"pointer-events\", $$.getStylePropValue(\"none\"))\n .attr(\"x\", isLegendRightOrInset ? posFn.xText : pos)\n .attr(\"y\", isLegendRightOrInset ? pos : posFn.yText);\n l.append(\"rect\")\n .attr(\"class\", $LEGEND.legendItemEvent)\n .style(\"fill-opacity\", $$.getStylePropValue(\"0\"))\n .attr(\"x\", isLegendRightOrInset ? posFn.xRect : pos)\n .attr(\"y\", isLegendRightOrInset ? pos : posFn.yRect);\n if (usePoint) {\n const ids = [];\n const pattern = $$.getValidPointPattern();\n l.append(d => {\n ids.indexOf(d) === -1 && ids.push(d);\n let point = pattern[ids.indexOf(d) % pattern.length];\n if (point === \"rectangle\") {\n point = \"rect\";\n }\n return doc.createElementNS(namespaces.svg, (\"hasValidPointType\" in $$) && $$.hasValidPointType(point) ? point : \"use\");\n })\n .attr(\"class\", $LEGEND.legendItemPoint)\n .style(\"fill\", _getLegendColor.bind($$))\n .style(\"pointer-events\", $$.getStylePropValue(\"none\"))\n .attr(\"href\", (data, idx, selection) => {\n const node = selection[idx];\n const nodeName = node.nodeName.toLowerCase();\n const id = $$.getTargetSelectorSuffix(data);\n return nodeName === \"use\" ? `#${state.datetimeId}-point${id}` : undefined;\n });\n }\n else {\n l.append(isRectangle ? \"line\" : legendType)\n .attr(\"class\", $LEGEND.legendItemTile)\n .style(\"stroke\", _getLegendColor.bind($$))\n .style(\"pointer-events\", $$.getStylePropValue(\"none\"))\n .call(selection => {\n if (legendType === \"circle\") {\n selection\n .attr(\"r\", legendItemR)\n .style(\"fill\", _getLegendColor.bind($$))\n .attr(\"cx\", isLegendRightOrInset ? posFn.x2Tile : pos)\n .attr(\"cy\", isLegendRightOrInset ? pos : posFn.yTile);\n }\n else if (isRectangle) {\n selection\n .attr(\"stroke-width\", itemTileSize.height)\n .attr(\"x1\", isLegendRightOrInset ? posFn.x1Tile : pos)\n .attr(\"y1\", isLegendRightOrInset ? pos : posFn.yTile)\n .attr(\"x2\", isLegendRightOrInset ? posFn.x2Tile : pos)\n .attr(\"y2\", isLegendRightOrInset ? pos : posFn.yTile);\n }\n });\n }\n },\n /**\n * Update legend item position\n * @param {Array} targetIdz Data ids\n * @param {boolean} withTransition Whether or not to apply transition\n * @param {object} posFn Position functions\n * @private\n */\n updateLegendItemPos(targetIdz, withTransition, posFn) {\n const $$ = this;\n const { config, $el: { legend }, $T } = $$;\n const usePoint = config.legend_usePoint;\n const legendType = config.legend_item_tile_type;\n const isRectangle = legendType !== \"circle\";\n if (usePoint) {\n const tiles = legend.selectAll(`.${$LEGEND.legendItemPoint}`)\n .data(targetIdz);\n const isRectangleTile = config.legend_item_tile_type !== \"circle\";\n const tileWidth = isRectangleTile ?\n config.legend_item_tile_width :\n config.legend_item_tile_r * 2;\n const tileHeight = isRectangleTile ?\n config.legend_item_tile_height :\n config.legend_item_tile_r * 2;\n const iconWidth = tileWidth * 0.75;\n const iconHeight = tileHeight * 0.75;\n const customScaleX = tileWidth / 8;\n const customScaleY = tileHeight / 8;\n $T(tiles, withTransition)\n .each(function () {\n const nodeName = this.nodeName.toLowerCase();\n let x = \"x\";\n let y = \"y\";\n let radius = null;\n let width = null;\n let height = null;\n if (nodeName === \"circle\") {\n x = \"cx\";\n y = \"cy\";\n radius = Math.min(iconWidth, iconHeight) / 2;\n }\n else if (nodeName === \"rect\") {\n width = iconWidth;\n height = iconHeight;\n }\n const tile = select(this)\n .attr(\"transform\", null)\n .attr(\"x\", null)\n .attr(\"y\", null)\n .attr(\"cx\", null)\n .attr(\"cy\", null)\n .attr(\"r\", radius)\n .attr(\"width\", width)\n .attr(\"height\", height);\n if (nodeName === \"use\") {\n tile.attr(\"transform\", d => `translate(${posFn.x1Tile(d)} ${posFn.yTile(d) - tileHeight / 2}) ` +\n `scale(${customScaleX} ${customScaleY})`);\n }\n else {\n tile\n .attr(x, d => posFn.x1Tile(d) + ((tileWidth - (width || 0)) / 2))\n .attr(y, d => posFn.yTile(d) - ((height || 0) / 2));\n }\n });\n }\n else {\n const tiles = legend.selectAll(`.${$LEGEND.legendItemTile}`)\n .data(targetIdz);\n $T(tiles, withTransition)\n .style(\"stroke\", _getLegendColor.bind($$))\n .call(selection => {\n if (legendType === \"circle\") {\n selection\n .attr(\"cx\", d => {\n const x2 = posFn.x2Tile(d);\n return x2 - ((x2 - posFn.x1Tile(d)) / 2);\n })\n .attr(\"cy\", posFn.yTile);\n }\n else if (isRectangle) {\n selection\n .attr(\"x1\", posFn.x1Tile)\n .attr(\"y1\", posFn.yTile)\n .attr(\"x2\", posFn.x2Tile)\n .attr(\"y2\", posFn.yTile);\n }\n });\n }\n }\n};\n\nexport { legend as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { transition } from 'd3-transition';\nimport { $TEXT, $COMMON, $SELECT } from '../../config/classes.js';\nimport { KEY } from '../../module/Cache.js';\nimport { generateWait } from '../../module/generator.js';\nimport { getOption, capitalize, callFn } from '../../module/util/object.js';\nimport { notEmpty } from '../../module/util/type-checks.js';\nimport { isTabVisible } from '../../module/util/dom.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\nvar redraw = {\n redraw(options = {}) {\n const $$ = this;\n const { config, state, $el } = $$;\n const { main, treemap } = $el;\n state.redrawing = true;\n // Increment generation counters for cache invalidation\n state.redrawGeneration++;\n if (state.dirty.data || state.dirty.visibility || options.initializing) {\n state.dataGeneration++;\n }\n // Invalidate per-redraw caches (only when size changed or initializing)\n if (options.initializing || state.dirty.size || state.dirty.data || !state.rendered) {\n $$.cache.remove([KEY.svgLeft]);\n }\n const targetsToShow = $$.filterTargetsToShow($$.data.targets);\n // Cache for reuse by sub-methods within this redraw cycle\n state._targetsToShow = targetsToShow;\n // Capture and reset dirty flags immediately to avoid race conditions\n // (async afterRedraw could wipe flags set by a subsequent redraw)\n const dirtySnapshot = {\n data: state.dirty.data,\n visibility: state.dirty.visibility};\n state.dirty.data = false;\n state.dirty.visibility = false;\n state.dirty.size = false;\n const { flow, initializing } = options;\n const wth = $$.getWithOption(options);\n const duration = wth.Transition ? config.transition_duration : 0;\n const durationForExit = wth.TransitionForExit ? duration : 0;\n const durationForAxis = wth.TransitionForAxis ? duration : 0;\n const transitions = $$.axis?.generateTransitions(durationForAxis);\n // Shape DOM updates (D3 data join: enter/update/exit) are only needed when data or\n // visibility changes. Zoom/brush only need redraw*() (position recalculation via\n // getRedrawList), not update*(). New APIs that modify data must set dirty flags.\n const needShapeUpdate = dirtySnapshot.data || dirtySnapshot.visibility || initializing;\n if (state.isCanvasMode) {\n $$.setContainerSize();\n $$.updateHtmlLegend?.();\n }\n $$.updateSizes(initializing);\n if (state.isCanvasMode) {\n const zoomScale = $$.scale.zoom;\n const zoomDomain = zoomScale?.domain();\n zoomScale && ($$.scale.zoom = null);\n $$.updateScales(initializing, wth.UpdateXDomain);\n if (zoomScale) {\n zoomScale.range($$.scale.x.range());\n zoomDomain && zoomScale.domain(zoomDomain);\n $$.scale.zoom = $$.getCustomizedXScale(zoomScale);\n $$.axis.x.scale($$.scale.zoom);\n $$.scale.x.domain(config.zoom_rescale ? zoomDomain : $$.org.xDomain);\n $$.scale.subX.domain($$.org.xDomain);\n }\n state.hasAxis && $$.axis.syncAxisDomains(targetsToShow, wth, flow);\n state.hasAxis && $$.applyCanvasSubchartDomain?.();\n const shape = needShapeUpdate ?\n $$.getDrawShape() :\n (state._cachedDrawShape || $$.getDrawShape());\n if (needShapeUpdate) {\n state._cachedDrawShape = shape;\n }\n $$.updateHtmlLegend?.();\n $$.resizeCanvas?.();\n state.canvasFocusKey = null;\n $$.renderCanvasFrame(shape, null, true);\n initializing && $$.updateTypesElements();\n $$.callPluginHook(\"$redraw\", options, 0);\n state.redrawing = false;\n state._targetsToShow = null;\n state._cachedDrawShape = null;\n $$.mapToIds($$.data.targets).forEach(id => {\n state.withoutFadeIn[id] = true;\n });\n callFn(config.onrendered, $$.api);\n return;\n }\n // update legend and transform each g\n if (wth.Legend && config.legend_show) {\n options.withTransition = !!duration;\n !treemap && $$.updateLegend($$.mapToIds($$.data.targets), options, transitions);\n }\n else if (wth.Dimension) {\n // need to update dimension (e.g. axis.y.tick.values) because y tick values should change\n // no need to update axis in it because they will be updated in redraw()\n $$.updateDimension(true);\n }\n // Data empty label positioning and text.\n config.data_empty_label_text && main.select(`text.${$TEXT.text}.${$COMMON.empty}`)\n .attr(\"x\", state.width / 2)\n .attr(\"y\", state.height / 2)\n .text(config.data_empty_label_text)\n .style(\"display\", targetsToShow.length ? \"none\" : null);\n // title - position early so other elements can calculate correct padding\n $$.redrawTitle?.();\n // update axis\n if (state.hasAxis) {\n // @TODO: Make 'init' state to be accessible everywhere not passing as argument.\n $$.axis.redrawAxis(targetsToShow, wth, transitions, flow, initializing);\n // grid (optional module — guarded for tree-shakable grid resolver)\n $$.hasGrid?.() && $$.updateGrid();\n // rect for regions (optional module — updateRegion installed by regions resolver)\n config.regions.length && $$.updateRegion?.();\n [\"bar\", \"candlestick\", \"line\", \"area\"].forEach(v => {\n const name = capitalize(v);\n if ((/^(line|area)$/.test(v) && $$.hasTypeOf(name)) || $$.hasType(v)) {\n if (needShapeUpdate) {\n $$[`update${name}`](wth.TransitionForExit);\n }\n }\n });\n // circles for select\n $el.text && main.selectAll(`.${$SELECT.selectedCircles}`)\n .filter($$.isBarType.bind($$))\n .selectAll(\"circle\")\n .remove();\n // event rects will redrawn when flow called\n if (config.interaction_enabled && !flow && wth.EventRect) {\n $$.redrawEventRect();\n $$.bindZoomEvent?.();\n }\n }\n else {\n // arc\n $el.arcs && $$.redrawArc(duration, durationForExit, wth.Transform);\n // radar\n $el.radar && $$.redrawRadar();\n // polar\n $el.polar && $$.redrawPolar();\n // funnel\n $el.funnel && $$.redrawFunnel();\n // treemap\n treemap && $$.updateTreemap(durationForExit);\n }\n if (!state.resizing && !treemap && ($$.hasPointType() || state.hasRadar)) {\n if (needShapeUpdate) {\n $$.updateCircle();\n }\n }\n else if ($$.hasLegendDefsPoint?.()) {\n $$.data.targets.forEach($$.point(\"create\", this));\n }\n // text\n if ($$.hasDataLabel() && !$$.hasArcType(null, [\"radar\"])) {\n if (needShapeUpdate) {\n $$.updateText();\n }\n }\n initializing && $$.updateTypesElements();\n $$.generateRedrawList(targetsToShow, flow, duration, wth.Subchart, needShapeUpdate);\n $$.updateTooltipOnRedraw();\n $$.callPluginHook(\"$redraw\", options, duration);\n },\n /**\n * Generate redraw list\n * @param {object} targets targets data to be shown\n * @param {object} flow flow object\n * @param {number} duration duration value\n * @param {boolean} withSubchart whether or not to show subchart\n * @param {boolean} needShapeRegen whether to regenerate draw shape\n * @private\n */\n generateRedrawList(targets, flow, duration, withSubchart, needShapeRegen = true) {\n const $$ = this;\n const { config, state } = $$;\n const shape = needShapeRegen ?\n $$.getDrawShape() :\n (state._cachedDrawShape || $$.getDrawShape());\n if (needShapeRegen) {\n state._cachedDrawShape = shape;\n }\n if (state.hasAxis) {\n // subchart\n config.subchart_show && $$.redrawSubchart(withSubchart, duration, shape);\n }\n // generate flow\n const flowFn = flow && $$.generateFlow({\n targets,\n flow,\n duration: flow.duration,\n shape,\n xv: $$.xv.bind($$)\n });\n const withTransition = (duration || flowFn) && isTabVisible();\n // redraw list\n const redrawList = $$.getRedrawList(shape, flow, flowFn, withTransition);\n // callback function after redraw ends\n const afterRedraw = () => {\n flowFn && flowFn();\n state.redrawing = false;\n state._targetsToShow = null;\n state._cachedDrawShape = null;\n callFn(config.onrendered, $$.api);\n };\n // Only use transition when current tab is visible.\n if (withTransition && redrawList.length) {\n // Wait for end of transitions for callback\n const waitForDraw = generateWait();\n // transition should be derived from one transition\n transition().duration(duration)\n .each(() => {\n redrawList\n .flatMap(t1 => t1)\n .forEach(t => waitForDraw.add(t));\n })\n .call(waitForDraw, afterRedraw);\n }\n else if (!state.transiting) {\n afterRedraw();\n }\n // update fadein condition\n $$.mapToIds($$.data.targets).forEach(id => {\n state.withoutFadeIn[id] = true;\n });\n },\n getRedrawList(shape, flow, flowFn, withTransition) {\n const $$ = this;\n const { config, state: { hasAxis, hasRadar, hasTreemap }, $el: { grid } } = $$;\n const { cx, cy, xForText, yForText } = shape.pos;\n const list = [];\n if (hasAxis) {\n if ($$.redrawGrid && (config.grid_x_lines.length || config.grid_y_lines.length)) {\n list.push($$.redrawGrid(withTransition));\n }\n if ($$.redrawRegion && config.regions.length) {\n list.push($$.redrawRegion(withTransition));\n }\n for (const v in shape.type) {\n const name = capitalize(v);\n const drawFn = shape.type[v];\n if ((/^(area|line)$/.test(v) && $$.hasTypeOf(name)) || $$.hasType(v)) {\n list.push($$[`redraw${name}`](drawFn, withTransition));\n }\n }\n !flow && grid.main && $$.updateGridFocus && list.push($$.updateGridFocus());\n }\n if (!$$.hasArcType() || hasRadar) {\n notEmpty(config.data_labels) && config.data_labels !== false &&\n list.push($$.redrawText(xForText, yForText, flow, withTransition));\n }\n if (($$.hasPointType() || hasRadar) && !$$.isPointFocusOnly()) {\n $$.redrawCircle && list.push($$.redrawCircle(cx, cy, withTransition, flowFn));\n }\n if (hasTreemap) {\n list.push($$.redrawTreemap(withTransition));\n }\n return list;\n },\n updateAndRedraw(options = {}) {\n const $$ = this;\n const { config, state } = $$;\n let transitions;\n // same with redraw\n options.withTransition = getOption(options, \"withTransition\", true);\n options.withTransform = getOption(options, \"withTransform\", false);\n options.withLegend = getOption(options, \"withLegend\", false);\n // NOT same with redraw\n options.withUpdateXDomain = true;\n options.withUpdateOrgXDomain = true;\n options.withTransitionForExit = false;\n options.withTransitionForTransform = getOption(options, \"withTransitionForTransform\", options.withTransition);\n // MEMO: called in updateLegend in redraw if withLegend\n if (!(options.withLegend && config.legend_show)) {\n if (state.hasAxis) {\n transitions = $$.axis.generateTransitions(options.withTransitionForAxis ? config.transition_duration : 0);\n }\n // Update scales\n $$.updateScales();\n $$.updateSvgSize();\n // Update g positions\n $$.transformAll(options.withTransitionForTransform, transitions);\n }\n // Draw with new sizes & scales\n $$.redraw(options);\n }\n};\n\nexport { redraw as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { scaleUtc, scaleTime, scaleLog, scaleSymlog, scaleLinear } from 'd3-scale';\nimport { parseDate } from '../../module/util/object.js';\nimport { isString, isValue } from '../../module/util/type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Get scale\n * @param {string} [type='linear'] Scale type\n * @param {number|Date} [min] Min range\n * @param {number|Date} [max] Max range\n * @returns {d3.scaleLinear|d3.scaleTime} scale\n * @private\n */\nfunction getScale(type = \"linear\", min, max) {\n const scale = ({\n linear: scaleLinear,\n log: scaleSymlog,\n _log: scaleLog,\n time: scaleTime,\n utc: scaleUtc\n })[type]();\n scale.type = type;\n /_?log/.test(type) && scale.clamp(true);\n return scale.range([min ?? 0, max ?? 1]);\n}\nvar scale = {\n /**\n * Get x Axis scale function\n * @param {number} min Min range value\n * @param {number} max Max range value\n * @param {Array} domain Domain value\n * @param {function} offset The offset getter to be sum\n * @returns {function} scale\n * @private\n */\n getXScale(min, max, domain, offset) {\n const $$ = this;\n const scale = ($$.state.loading !== \"append\" && $$.scale.zoom) ||\n getScale($$.axis.getAxisType(\"x\"), min, max);\n return $$.getCustomizedXScale(domain ? scale.domain(domain) : scale, offset);\n },\n /**\n * Get y Axis scale function\n * @param {string} id Axis id: 'y' or 'y2'\n * @param {number} min Min value\n * @param {number} max Max value\n * @param {Array} domain Domain value\n * @param {object} [existing] Existing scale function to be updated\n * @returns {function} Scale function\n * @private\n */\n getYScale(id, min, max, domain, existing) {\n const $$ = this;\n const type = $$.axis.getAxisType(id);\n // Reuse existing scale if type hasn't changed — just update range\n if (existing && existing.type === type) {\n existing.range([min, max]);\n domain && existing.domain(domain);\n return existing;\n }\n const scale = getScale(type, min, max);\n domain && scale.domain(domain);\n return scale;\n },\n /**\n * Get y Axis scale\n * @param {string} id Axis id\n * @param {boolean} isSub Weather is sub Axis\n * @returns {function} Scale function\n * @private\n */\n getYScaleById(id, isSub = false) {\n const isY2 = this.axis?.getId(id) === \"y2\";\n const key = isSub ? (isY2 ? \"subY2\" : \"subY\") : (isY2 ? \"y2\" : \"y\");\n return this.scale[key];\n },\n /**\n * Get customized x axis scale\n * @param {d3.scaleLinear|d3.scaleTime} scaleValue Scale function\n * @param {function} offsetValue Offset getter to be sum\n * @returns {function} Scale function\n * @private\n */\n getCustomizedXScale(scaleValue, offsetValue) {\n const $$ = this;\n const offset = () => {\n const value = offsetValue ? offsetValue() : $$.axis.x.tickOffset();\n return value || ($$.axis.isCategorized() ? (scaleValue(1) - scaleValue(0)) / 2 : 0);\n };\n const isInverted = $$.config.axis_x_inverted;\n /**\n * Get scaled value\n * @param {object} d Data object\n * @returns {number}\n * @private\n */\n const scale = function (d) {\n return scaleValue(d) + offset();\n };\n // copy original scale methods\n for (const key in scaleValue) {\n scale[key] = scaleValue[key];\n }\n scale.orgDomain = () => scaleValue.domain();\n scale.orgScale = () => scaleValue;\n // define custom domain() for categorized axis\n if ($$.axis.isCategorized()) {\n scale.domain = function (domainValue) {\n let domain = domainValue;\n if (!arguments.length) {\n domain = this.orgDomain();\n return isInverted ? [domain[0] + 1, domain[1]] : [domain[0], domain[1] + 1];\n }\n scaleValue.domain(domain);\n return scale;\n };\n }\n return scale;\n },\n /**\n * Update scale\n * @param {boolean} isInit Param is given at the init rendering\n * @param {boolean} updateXDomain If update x domain\n * @private\n */\n updateScales(isInit, updateXDomain = true) {\n const $$ = this;\n const { axis, config, format, org, scale, state: { current, width, height, width2, height2, hasAxis, hasTreemap } } = $$;\n if (hasAxis) {\n const isRotated = config.axis_rotated;\n const resettedPadding = $$.getResettedPadding(1);\n // update edges\n const min = {\n x: isRotated ? resettedPadding : 0,\n y: isRotated ? 0 : height,\n subY: isRotated ? 0 : height2\n };\n const max = {\n x: isRotated ? height : width,\n y: isRotated ? width : resettedPadding,\n subY: isRotated ? width2 : 1\n };\n // update scales\n // x Axis\n const xDomain = updateXDomain ?\n scale.x?.orgDomain() :\n (scale.zoom ? undefined : scale.x?.domain?.());\n const xSubDomain = updateXDomain ?\n org.xDomain :\n (scale.zoom ? undefined : scale.subX?.domain?.());\n scale.x = $$.getXScale(min.x, max.x, xDomain, () => axis.x.tickOffset());\n scale.subX = $$.getXScale(min.x, max.x, xSubDomain, d => (d % 1 ? 0 : (axis.subX ?? axis.x).tickOffset()));\n format.xAxisTick = axis.getXAxisTickFormat();\n format.subXAxisTick = axis.getXAxisTickFormat(true);\n axis.setAxis(\"x\", scale.x, config.axis_x_tick_outer, isInit);\n if (config.subchart_show) {\n axis.setAxis(\"subX\", scale.subX, config.axis_x_tick_outer, isInit);\n }\n // y Axis\n scale.y = $$.getYScale(\"y\", min.y, max.y, scale.y ? scale.y.domain() : config.axis_y_default, scale.y);\n scale.subY = $$.getYScale(\"y\", min.subY, max.subY, scale.subY ? scale.subY.domain() : config.axis_y_default, scale.subY);\n axis.setAxis(\"y\", scale.y, config.axis_y_tick_outer, isInit);\n // y2 Axis\n if (config.axis_y2_show) {\n scale.y2 = $$.getYScale(\"y2\", min.y, max.y, scale.y2 ? scale.y2.domain() : config.axis_y2_default, scale.y2);\n scale.subY2 = $$.getYScale(\"y2\", min.subY, max.subY, scale.subY2 ? scale.subY2.domain() : config.axis_y2_default, scale.subY2);\n axis.setAxis(\"y2\", scale.y2, config.axis_y2_tick_outer, isInit);\n }\n }\n else if (hasTreemap) {\n const padding = $$.getCurrentPadding();\n scale.x = scaleLinear().rangeRound([padding.left, current.width - padding.right]);\n scale.y = scaleLinear().rangeRound([padding.top, current.height - padding.bottom]);\n }\n else {\n // update for arc\n $$.updateArc?.();\n }\n },\n /**\n * Get the zoom or unzoomed scaled value\n * @param {Date|number|object} d Data value\n * @returns {number|null}\n * @private\n */\n xx(d) {\n const $$ = this;\n const { config, scale: { x, zoom } } = $$;\n const fn = config.zoom_enabled && zoom ? zoom : x;\n return d ? fn(isValue(d.x) ? d.x : d) : null;\n },\n xv(d) {\n const $$ = this;\n const { axis, config, scale: { x, zoom } } = $$;\n const fn = config.zoom_enabled && zoom ? zoom : x;\n let value = $$.getBaseValue(d);\n if (axis.isTimeSeries()) {\n value = parseDate.call($$, value);\n }\n else if (axis.isCategorized() && isString(value)) {\n value = config.axis_x_categories.indexOf(value);\n }\n return fn(value);\n },\n yv(d) {\n const $$ = this;\n const { scale: { y, y2 } } = $$;\n const yScale = d.axis && d.axis === \"y2\" ? y2 : y;\n return yScale($$.getBaseValue(d));\n },\n subxx(d) {\n return d ? this.scale.subX(d.x) : null;\n }\n};\n\nexport { scale as default, getScale };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { $SUBCHART, $AXIS } from '../../config/classes.js';\nimport { document as doc } from '../../module/browser.js';\nimport { KEY } from '../../module/Cache.js';\nimport { isEmpty, isUndefined, isNumber, isString, ceil10 } from '../../module/util/type-checks.js';\nimport { getBoundingRect } from '../../module/util/dom.js';\nimport { capitalize } from '../../module/util/object.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\nvar size = {\n /**\n * Update container size\n * @private\n */\n setContainerSize() {\n const $$ = this;\n const { state } = $$;\n state.current.width = $$.getCurrentWidth();\n state.current.height = $$.getCurrentHeight();\n },\n getCurrentWidth() {\n const $$ = this;\n return $$.config.size_width || $$.getParentRectValue(\"width\");\n },\n getCurrentHeight() {\n const $$ = this;\n const { config } = $$;\n const h = config.size_height || $$.getParentHeight();\n return h > 0 ? h : 320 / ($$.hasType(\"gauge\") && !config.gauge_fullCircle ? 2 : 1);\n },\n /**\n * Get the parent rect element's size\n * @param {string} key property/attribute name\n * @returns {number}\n * @private\n */\n getParentRectValue(key) {\n const offsetName = `offset${capitalize(key)}`;\n let parent = this.$el.chart.node();\n let v = 0;\n while (v < 30 && parent && parent.tagName !== \"BODY\") {\n try {\n v = getBoundingRect(parent, true)[key];\n }\n catch {\n if (offsetName in parent) {\n // In IE in certain cases getBoundingClientRect\n // will cause an \"unspecified error\"\n v = parent[offsetName];\n }\n }\n parent = parent.parentNode;\n }\n // Sometimes element's dimension value is incorrect(ex. flex container)\n // In this case, use body's offset instead.\n const bodySize = doc.body[offsetName];\n v > bodySize && (v = bodySize);\n return v;\n },\n getParentHeight() {\n const h = this.$el.chart.style(\"height\");\n let height = 0;\n if (h) {\n height = /px$/.test(h) ? parseInt(h, 10) : this.getParentRectValue(\"height\");\n }\n return height;\n },\n getSvgLeft(withoutRecompute) {\n const $$ = this;\n const { cache, config, state: { hasAxis }, $el } = $$;\n // Return cached value when recompute is not forced\n if (withoutRecompute) {\n const cached = cache.get(KEY.svgLeft);\n if (cached !== null) {\n return cached;\n }\n }\n const isRotated = config.axis_rotated;\n const hasLeftAxisRect = isRotated || (!isRotated && !config.axis_y_inner);\n const leftAxisClass = isRotated ? $AXIS.axisX : $AXIS.axisY;\n const leftAxis = $el.main.select(`.${leftAxisClass}`).node();\n const leftLabel = hasAxis && config[`axis_${isRotated ? \"x\" : \"y\"}_label`];\n // Check if label measurement is needed\n const needLabelRect = hasAxis && (isString(leftLabel) || isString(leftLabel.text) ||\n /^inner-/.test(leftLabel?.position));\n const label = needLabelRect ? $el.main.select(`.${leftAxisClass}-label`) : null;\n const labelNode = label && !label.empty() ? label.node() : null;\n const forceEval = !withoutRecompute;\n const rects = {\n label: labelNode ? getBoundingRect(labelNode, forceEval) : null,\n leftAxis: leftAxis && hasLeftAxisRect ? getBoundingRect(leftAxis, forceEval) : null,\n chart: getBoundingRect($el.chart.node(), forceEval)\n };\n const labelWidth = rects.label?.left ?? 0;\n const svgRect = rects.leftAxis ?? { right: 0 };\n const chartRectLeft = rects.chart.left + labelWidth;\n const hasArc = $$.hasArcType();\n const svgLeft = svgRect.right - chartRectLeft -\n (hasArc ? 0 : $$.getCurrentPaddingByDirection(\"left\", withoutRecompute));\n const result = svgLeft > 0 ? svgLeft : 0;\n cache.add(KEY.svgLeft, result);\n return result;\n },\n updateDimension(withoutAxis) {\n const $$ = this;\n const { config, state: { hasAxis, isCanvasMode }, $el } = $$;\n if (hasAxis && !withoutAxis && $$.axis.x && config.axis_rotated) {\n $$.axis.subX?.create($el.axis.subX);\n }\n // pass 'withoutAxis' param to not animate at the init rendering\n $$.updateScales(withoutAxis);\n if (isCanvasMode) {\n $$.resizeCanvas?.();\n return;\n }\n $$.updateSvgSize();\n $$.transformAll(false);\n },\n updateSvgSize() {\n const $$ = this;\n const { config, state: { clip, current, hasAxis, width, height }, $el: { svg } } = $$;\n if (!svg) {\n $$.resizeCanvas?.();\n return;\n }\n if (config.resize_auto === \"viewBox\") {\n svg\n .attr(\"viewBox\", `0 0 ${current.width} ${current.height}`);\n }\n else {\n svg\n .attr(\"width\", current.width)\n .attr(\"height\", current.height);\n }\n if (hasAxis) {\n const brush = svg.select(`.${$SUBCHART.brush} .overlay`);\n const brushSize = { width: 0, height: 0 };\n if (brush.size()) {\n brushSize.width = +brush.attr(\"width\");\n brushSize.height = +brush.attr(\"height\");\n }\n svg.selectAll([`#${clip.id}`, `#${clip.idGrid}`])\n .select(\"rect\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n svg.select(`#${clip.idXAxis}`)\n .select(\"rect\")\n .call($$.setXAxisClipPath.bind($$));\n svg.select(`#${clip.idYAxis}`)\n .select(\"rect\")\n .call($$.setYAxisClipPath.bind($$));\n clip.idSubchart && svg.select(`#${clip.idSubchart}`)\n .select(\"rect\")\n .attr(\"width\", width)\n .attr(\"height\", brushSize.height);\n }\n },\n /**\n * Get padding by the direction.\n * @param {string} type \"top\" | \"bottom\" | \"left\" | \"right\"\n * @param {boolean} [withoutRecompute=false] If set true, do not recompute the padding value.\n * @param {boolean} [withXAxisTickTextOverflow=false] If set true, calculate x axis tick text overflow.\n * @returns {number} padding value\n * @private\n */\n getCurrentPaddingByDirection(type, withoutRecompute = false, withXAxisTickTextOverflow = false) {\n const $$ = this;\n const { config, $el, state: { hasAxis, isCanvasMode } } = $$;\n const isRotated = config.axis_rotated;\n const isFitPadding = config.padding?.mode === \"fit\";\n const paddingOption = isNumber(config[`padding_${type}`]) ?\n config[`padding_${type}`] :\n undefined;\n const axisId = hasAxis ?\n {\n top: isRotated ? \"y2\" : null,\n bottom: isRotated ? \"y\" : \"x\",\n left: isRotated ? \"x\" : \"y\",\n right: isRotated ? null : \"y2\"\n }[type] :\n null;\n const isLeftRight = /^(left|right)$/.test(type);\n const isAxisInner = axisId && config[`axis_${axisId}_inner`];\n const isAxisShow = axisId && config[`axis_${axisId}_show`];\n const axesLen = axisId ? config[`axis_${axisId}_axes`].length : 0;\n let axisSize = axisId ?\n (isLeftRight ?\n $$.getAxisWidthByAxisId(axisId, withoutRecompute) :\n $$.getHorizontalAxisHeight(axisId)) :\n 0;\n const defaultPadding = 20;\n let gap = 0;\n if (!isFitPadding && isLeftRight) {\n axisSize = ceil10(axisSize);\n }\n let padding = hasAxis && isLeftRight && (isAxisInner || (isUndefined(paddingOption) && !isAxisShow)) ?\n 0 :\n (isFitPadding ? (isAxisShow ? axisSize : 0) + (paddingOption ?? 0) : (isUndefined(paddingOption) ? axisSize : paddingOption));\n if (isLeftRight && hasAxis) {\n if (axisId && (isFitPadding || isAxisInner) && config[`axis_${axisId}_label`].text) {\n padding += $$.axis.getAxisLabelPosition(axisId).isOuter ? defaultPadding : 0;\n }\n if (type === \"right\") {\n padding += isRotated ?\n (!isFitPadding && isUndefined(paddingOption) ? 10 : 2) :\n !isAxisShow || isAxisInner ?\n (isFitPadding ? 2 : 1) :\n 0;\n padding += withXAxisTickTextOverflow ?\n $$.axis.getXAxisTickTextY2Overflow(defaultPadding) :\n 0;\n }\n else if (type === \"left\" && isRotated && isUndefined(paddingOption)) {\n padding = !config.axis_x_show ?\n 1 :\n (isFitPadding ? axisSize : Math.max(axisSize, 40));\n }\n }\n else {\n if (type === \"top\") {\n if (($el.title && $el.title.node()) || (isCanvasMode && config.title_text)) {\n padding += $$.getTitlePadding();\n }\n gap = isRotated && !isAxisInner ? axesLen : 0;\n }\n else if (type === \"bottom\" && hasAxis && isRotated && !isAxisShow) {\n padding += 1;\n }\n }\n // console.log(type, padding + (axisSize * axesLen) - gap)\n return padding + (axisSize * axesLen) - gap;\n },\n getCurrentPadding(withXAxisTickTextOverflow = false) {\n const $$ = this;\n const [top, bottom, left, right] = [\"top\", \"bottom\", \"left\", \"right\"]\n .map(v => $$.getCurrentPaddingByDirection(v, null, withXAxisTickTextOverflow));\n return { top, bottom, left, right };\n },\n /**\n * Get resetted padding values when 'padding=false' option is set\n * https://github.com/naver/billboard.js/issues/2367\n * @param {number|object} v Padding values to be resetted\n * @returns {number|object} Padding value\n * @private\n */\n getResettedPadding(v) {\n const $$ = this;\n const { config } = $$;\n const isNum = isNumber(v);\n let p = isNum ? 0 : {};\n if (config.padding === false) {\n !isNum && Object.keys(v).forEach(key => {\n // when data.lables=true, do not reset top padding\n p[key] = (!isEmpty(config.data_labels) &&\n config.data_labels !== false &&\n key === \"top\") ?\n v[key] :\n 0;\n });\n }\n else {\n p = v;\n }\n return p;\n },\n /**\n * Update size values\n * @param {boolean} isInit If is called at initialization\n * @private\n */\n updateSizes(isInit) {\n const $$ = this;\n const { config, state, $el: { legend } } = $$;\n const isRotated = config.axis_rotated;\n const isNonAxis = $$.hasArcType() || state.hasFunnel || state.hasTreemap;\n const isFitPadding = config.padding?.mode === \"fit\";\n !isInit && $$.setContainerSize();\n // Cache legend dimensions to avoid redundant calls\n const legendWidth = legend ? $$.getLegendWidth() : 0;\n const legendHeight = legend ? $$.getLegendHeight() : 0;\n const currLegend = {\n width: legendWidth,\n height: legendHeight\n };\n if (!isNonAxis && config.axis_x_show && config.axis_x_tick_autorotate) {\n $$.updateXAxisTickClip();\n }\n const legendSize = {\n right: config.legend_show && state.isLegendRight ?\n legendWidth + (isFitPadding ? 0 : 20) :\n 0,\n bottom: !config.legend_show || state.isLegendRight || state.isLegendInset ?\n 0 :\n legendHeight\n };\n const xAxisHeight = isRotated || isNonAxis ? 0 : $$.getHorizontalAxisHeight(\"x\");\n const subchartXAxisHeight = config.subchart_axis_x_show && config.subchart_axis_x_tick_text_show ? xAxisHeight : 30;\n const subchartHeight = config.subchart_show && !isNonAxis ?\n (config.subchart_size_height + subchartXAxisHeight) :\n 0;\n // when needle is shown with legend, it need some bottom space to not overlap with legend text\n const gaugeHeight = $$.hasType(\"gauge\") && config.arc_needle_show &&\n !config.gauge_fullCircle && !config.gauge_label_show ?\n 10 :\n 0;\n const padding = $$.getCurrentPadding(true);\n // for main\n state.margin = !isNonAxis && isRotated ?\n {\n top: padding.top,\n right: isNonAxis ? 0 : padding.right + legendSize.right,\n bottom: legendSize.bottom + padding.bottom,\n left: subchartHeight + (isNonAxis ? 0 : padding.left)\n } :\n {\n top: (isFitPadding ? 0 : 4) + padding.top, // for top tick text\n right: isNonAxis ? 0 : padding.right + legendSize.right,\n bottom: gaugeHeight + subchartHeight + legendSize.bottom + padding.bottom,\n left: isNonAxis ? 0 : padding.left\n };\n state.margin = $$.getResettedPadding(state.margin);\n // for subchart\n state.margin2 = isRotated ?\n {\n top: state.margin.top,\n right: NaN,\n bottom: 20 + legendSize.bottom,\n left: $$.state.rotatedPadding.left\n } :\n {\n top: state.current.height - subchartHeight - legendSize.bottom,\n right: NaN,\n bottom: subchartXAxisHeight + legendSize.bottom,\n left: state.margin.left\n };\n // for legend\n state.margin3 = {\n top: 0,\n right: NaN,\n bottom: 0,\n left: 0\n };\n $$.updateSizeForLegend?.(currLegend);\n state.width = state.current.width - state.margin.left - state.margin.right;\n state.height = state.current.height - state.margin.top - state.margin.bottom;\n if (state.width < 0) {\n state.width = 0;\n }\n if (state.height < 0) {\n state.height = 0;\n }\n state.width2 = isRotated ?\n state.margin.left - state.rotatedPadding.left - state.rotatedPadding.right :\n state.width;\n state.height2 = isRotated ?\n state.height :\n state.current.height - state.margin2.top - state.margin2.bottom;\n if (state.width2 < 0) {\n state.width2 = 0;\n }\n if (state.height2 < 0) {\n state.height2 = 0;\n }\n // for arc\n if ($$.hasArcType()) {\n const hasGauge = $$.hasType(\"gauge\");\n const isLegendRight = config.legend_show && state.isLegendRight;\n const textWidth = (state.hasRadar && $$.cache.get(KEY.radarTextWidth)) ?? 0;\n state.arcWidth = state.width - (isLegendRight ? currLegend.width + 10 : 0) - textWidth;\n state.arcHeight = state.height - (isLegendRight && !hasGauge ? 0 : 10);\n if (config.arc_rangeText_values?.length) {\n if (hasGauge) {\n state.arcWidth -= 25;\n state.arcHeight -= 10;\n state.margin.left += 10;\n }\n else {\n state.arcHeight -= 20;\n state.margin.top += 10;\n }\n }\n if (hasGauge && !config.gauge_fullCircle) {\n state.arcHeight += state.height - $$.getPaddingBottomForGauge();\n }\n $$.updateRadius?.();\n }\n if (state.isLegendRight && isNonAxis) {\n state.margin3.left = state.arcWidth / 2 + state.radiusExpanded * 1.1;\n }\n }\n};\n\nexport { size as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { $SHAPE } from '../../config/classes.js';\nimport { isFunction, isString } from '../../module/util/type-checks.js';\nimport { addCssRules } from '../../module/util/dom.js';\n\nvar style = {\n /**\n * Add props color css rule to given selector\n * @param {boolean} withShape Set shpes' prefix class\n * @param {string} selector CSS selector\n * @param {Array} props CSS props list\n * @param {function} propsFn Function to retrieve value or determine for props\n * @returns {function}\n * @private\n */\n setCssRule(withShape, selector, props, propsFn) {\n const $$ = this;\n const { config, state: { cssRule, style } } = $$;\n return config.boost_useCssRule ?\n (selection) => {\n selection.each((d) => {\n const res = propsFn && propsFn?.call($$, d);\n const shapeSelector = `${withShape ? `.${$SHAPE.shapes + $$.getTargetSelectorSuffix(d.id)}` : \"\"}${selector}`;\n (selector in cssRule) && style.sheet.deleteRule(cssRule[shapeSelector]);\n $$.state.cssRule[shapeSelector] = addCssRules(style, shapeSelector, props.filter(Boolean).map(v => (isString(res) && v.indexOf(\":\") === -1 ? `${v}: ${res}` : (v || \"\"))));\n });\n } :\n () => { };\n },\n /**\n * Get style prop value\n * @param {function|string} v Value\n * @returns {string|null}\n * @private\n */\n getStylePropValue(v) {\n const { config: { boost_useCssRule: useCssRule } } = this;\n return useCssRule ? null : isFunction(v) ? v.bind(this) : v;\n }\n};\n\nexport { style as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { select } from 'd3-selection';\nimport { $TEXT } from '../../config/classes.js';\nimport { tplProcess, toMap, parseShorthand } from '../../module/util/object.js';\nimport { getBoundingRect, getBBox } from '../../module/util/dom.js';\nimport { isFunction, isNumber } from '../../module/util/type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Get text-anchor according text.labels.rotate angle\n * @param {number} angle Angle value\n * @returns {string} Anchor string value\n * @private\n */\nfunction getRotateAnchor(angle) {\n let anchor = \"middle\";\n if (angle > 0 && angle <= 170) {\n anchor = \"end\";\n }\n else if (angle > 190 && angle <= 360) {\n anchor = \"start\";\n }\n return anchor;\n}\n/**\n * Set rotated position coordinate according text.labels.rotate angle\n * @param {object} d Data object\n * @param {object} pos Position object\n * @param {object} pos.x x coordinate\n * @param {object} pos.y y coordinate\n * @param {string} anchor string value\n * @param {boolean} isRotated If axis is rotated\n * @param {boolean} isInverted If axis is inverted\n * @returns {object} x, y coordinate\n * @private\n */\nfunction setRotatePos(d, pos, anchor, isRotated, isInverted) {\n const $$ = this;\n const { value } = d;\n const isCandlestickType = $$.isCandlestickType(d);\n const isNegative = (isNumber(value) && value < 0) || (isCandlestickType && !$$.getCandlestickData(d)?._isUp);\n let { x, y } = pos;\n const gap = 4;\n const doubleGap = gap * 2;\n if (isRotated) {\n if (anchor === \"start\") {\n x += isNegative ? 0 : doubleGap;\n y += gap;\n }\n else if (anchor === \"middle\") {\n x += doubleGap;\n y -= doubleGap;\n }\n else if (anchor === \"end\") {\n isNegative && (x -= doubleGap);\n y += gap;\n }\n }\n else {\n if (anchor === \"start\") {\n x += gap;\n isNegative && (y += doubleGap * 2);\n }\n else if (anchor === \"middle\") {\n y -= doubleGap;\n }\n else if (anchor === \"end\") {\n x -= gap;\n isNegative && (y += doubleGap * 2);\n }\n if (isInverted) {\n y += isNegative ? -17 : (isCandlestickType ? 13 : 7);\n }\n }\n return { x, y };\n}\n/**\n * Get data.labels.position value\n * @param {object} d Data object\n * @param {string} type x | y\n * @returns {number} Position value\n * @private\n */\nfunction getTextPos(d, type) {\n const position = this.config.data_labels_position;\n const { id, index, value } = d;\n return (isFunction(position) ?\n position.bind(this.api)(type, value, id, index, this.$el.text) :\n (id in position ? position[id] : position)[type]) ?? 0;\n}\n/**\n * Update text border\n * @param {SVGTextElement} text Text element\n * @param {Coord} pos Position object\n * @param {string} rectClass Class name\n * @private\n */\nfunction updateTextBorder(text, pos, rectClass) {\n const $$ = this;\n const { config, $T } = $$;\n const isRotated = config.axis_rotated;\n const { border: { padding = \"3 5\", radius = 10, stroke = \"#000\", strokeWidth = 1, fill = \"none\" } } = config.data_labels;\n const borderPadding = parseShorthand(padding);\n const applyStyle = config.data_labels.border !== true;\n const textRect = getBBox(text);\n let borderRect = select(text.previousElementSibling);\n if (borderRect.empty() ||\n borderRect.node()?.tagName !== \"rect\" ||\n !borderRect.attr(\"class\")?.includes(rectClass)) {\n borderRect = select(text.parentNode)\n .insert(\"rect\", () => text)\n .attr(\"class\", `${$TEXT.textBorderRect} ${rectClass}`)\n .attr(\"width\", textRect.width + (applyStyle ? borderPadding.left + borderPadding.right : 0))\n .attr(\"height\", textRect.height + (applyStyle ? borderPadding.top + borderPadding.bottom : 0));\n if (applyStyle) {\n borderRect\n .style(\"fill\", fill)\n .style(\"stroke\", stroke)\n .style(\"stroke-width\", `${strokeWidth}px`)\n .attr(\"rx\", radius)\n .attr(\"ry\", radius);\n }\n }\n $T(borderRect)\n .attr(\"x\", pos.x - (applyStyle ? borderPadding.left : 0) - (isRotated ? 0 : textRect.width / 2))\n .attr(\"y\", pos.y - (applyStyle ? borderPadding.top : 0) - (textRect.height / 4 * 3.2));\n}\n/**\n * Check if meets the ratio to show data label text\n * @param {number} ratio ratio to meet\n * @param {string} type chart type\n * @returns {boolean}\n * @private\n */\nfunction meetsLabelThreshold(ratio = 0, type) {\n const $$ = this;\n const { config } = $$;\n const threshold = config[`${type}_label_threshold`] || 0;\n return ratio >= threshold;\n}\n/**\n * Update text image\n * @private\n */\nfunction updateTextImage() {\n const $$ = this;\n const { $el: { text }, config } = $$;\n const isArc = $$.state.arcWidth;\n if (isArc ? $$.getArcLabelConfig(\"image\") : config.data_labels.image) {\n text.filter(function () {\n const prev = this.previousElementSibling;\n if (prev) {\n return prev.tagName !== \"image\" || !prev.classList.contains($TEXT.textLabelImage);\n }\n return true;\n }).each(function (d) {\n const image = getDataLabelImgUrl.call($$, d);\n if (!image) {\n return;\n }\n const { url, width, height, pos } = image;\n if (url) {\n const parentNode = select(this.parentNode);\n // Insert image before text\n parentNode?.insert(\"image\", `${this.getAttribute(\"class\")?.replace(/(?:^(.)|\\s)/g, \".$1\") ?? \"text\"}`)\n .style(\"opacity\", \"0\")\n .attr(\"href\", (d) => tplProcess(url, {\n ID: (\"id\" in d) ? d.id : d.data.id\n }))\n .attr(\"class\", $TEXT.textLabelImage)\n .style(\"pointer-events\", \"none\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .attr(\"transform\", pos ? `translate(${pos.x ?? 0} ${pos.y ?? 0})` : null);\n }\n });\n }\n}\n/**\n * Get image URL for data label\n * @param {object} d Data object\n * @returns {string|null} Image URL\n * @private\n */\nfunction getDataLabelImgUrl(d) {\n const $$ = this;\n const { config, state } = $$;\n const image = state.arcWidth ? $$.getArcLabelConfig(\"image\") : config.data_labels.image;\n if (isFunction(image)) {\n return image.call($$.api, d.value, d.id, d.index) ?? {\n url: \"\",\n width: 0,\n height: 0,\n pos: { x: 0, y: 0 }\n };\n }\n else if (image) {\n const { url = \"\", width = 0, height = 0, pos } = image;\n return {\n url,\n width,\n height,\n pos\n };\n }\n return null;\n}\n/**\n * Update text image position\n * @param {SVGTextElement} textNode Text element\n * @param {object} pos Position object\n * @param {number} pos.x X coordinate\n * @param {number} pos.y Y coordinate\n * @param {DOMRect|SVGRect} textRect Optional cached text dimensions\n * @private\n */\nfunction updateTextImagePos(textNode, pos, textRect) {\n const $$ = this;\n const { config, state: { arcWidth, hasTreemap } } = $$;\n const isRotated = config.axis_rotated;\n const image = select(textNode.previousElementSibling);\n const isShown = textNode => {\n const isShown = textNode.style.opacity !== \"0\" && textNode.style.fillOpacity !== \"0\";\n return (arcWidth ? textNode.textContent : isShown) &&\n this.previousElementSibling?.tagName !== \"image\";\n };\n if (!image.empty() && image.node()?.tagName === \"image\") {\n const textDimension = textRect || getBoundingRect(textNode);\n const w = +image.attr(\"width\") / 2;\n const h = +image.attr(\"height\") / 2;\n let x = pos.x - w;\n let y = pos.y - h - textDimension.height / 2;\n if (isRotated) {\n pos.x += w;\n }\n else {\n if (hasTreemap) {\n x = -w;\n y = -(h * 2 + textDimension.height);\n }\n // exclude pie & polar type\n if (!($$.hasType(\"pie\") || $$.hasType(\"polar\"))) {\n pos.y += h;\n }\n }\n $$.$T(image)\n .style(\"opacity\", isShown(textNode) ? null : \"0\")\n .attr(\"x\", x)\n .attr(\"y\", y);\n }\n}\n/**\n * Batch getBBox() calls to avoid layout thrashing\n * Collects all bbox calculations in a single read phase\n * @param {SVGTextElement[]} elements Array of text elements\n * @returns {Map<SVGTextElement, DOMRect>} Map of element to bbox\n * @private\n */\nfunction batchGetBBox(elements) {\n // Single read phase - batch all getBBox calls together\n // This prevents layout thrashing by avoiding interleaved reads/writes\n return toMap(elements, element => element, element => getBBox(element, true));\n}\n\nexport { batchGetBBox, getRotateAnchor, getTextPos, meetsLabelThreshold, setRotatePos, updateTextBorder, updateTextImage, updateTextImagePos };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { selectAll, select } from 'd3-selection';\nimport { $TEXT, $COMMON } from '../../config/classes.js';\nimport { KEY } from '../../module/Cache.js';\nimport { getTextPos, batchGetBBox, setRotatePos, updateTextImagePos, updateTextBorder, updateTextImage, meetsLabelThreshold, getRotateAnchor } from './text.util.js';\nimport { getTranslation, getBoundingRect, getElementPos, getBBox, setTextValue } from '../../module/util/dom.js';\nimport { isNumber, isString, isFunction, isObject } from '../../module/util/type-checks.js';\nimport { capitalize, getRandom } from '../../module/util/object.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\nvar text = {\n opacityForText(d) {\n const $$ = this;\n return $$.isBarType(d) &&\n !meetsLabelThreshold.call($$, Math.abs($$.getRatio(\"bar\", d)), \"bar\") ?\n \"0\" :\n ($$.hasDataLabel() ? null : \"0\");\n },\n /**\n * Initializes the text\n * @private\n */\n initText() {\n const { $el } = this;\n $el.main.select(`.${$COMMON.chart}`).append(\"g\")\n .attr(\"class\", $TEXT.chartTexts)\n .style(\"pointer-events\", $el.funnel || $el.treemap ? \"none\" : null);\n },\n /**\n * Update chartText\n * @param {object} targets $$.data.targets\n * @private\n */\n updateTargetsForText(targets) {\n const $$ = this;\n const classChartText = $$.getChartClass(\"Text\");\n const classTexts = $$.getClass(\"texts\", \"id\");\n const classFocus = $$.classFocus.bind($$);\n const mainTextUpdate = $$.$el.main.select(`.${$TEXT.chartTexts}`)\n .selectAll(`.${$TEXT.chartText}`)\n .data($$.filterNullish(targets))\n .attr(\"class\", d => `${classChartText(d)}${classFocus(d)}`.trim());\n const mainTextEnter = mainTextUpdate.enter().append(\"g\")\n .style(\"opacity\", \"0\")\n .attr(\"class\", classChartText)\n .call($$.setCssRule(true, ` .${$TEXT.text}`, [\"fill\", \"pointer-events:none\"], $$.updateTextColor));\n mainTextEnter.append(\"g\")\n .attr(\"class\", classTexts);\n },\n /**\n * Update text\n * @private\n */\n updateText() {\n const $$ = this;\n const { $el, $T, config, axis } = $$;\n const classText = $$.getClass(\"text\", \"index\");\n const labelsCentered = config.data_labels.centered;\n const text = $el.main.selectAll(`.${$TEXT.texts}`)\n .selectAll(`.${$TEXT.text}`)\n .data($$.labelishData.bind($$));\n $T(text.exit())\n .style(\"fill-opacity\", \"0\")\n .remove();\n $el.text = text.enter()\n .append(\"text\")\n .merge(text)\n .attr(\"class\", classText)\n .attr(\"text-anchor\", d => {\n const isInverted = config[`axis_${axis?.getId(d.id)}_inverted`];\n // when value is negative or\n let isEndAnchor = isInverted ? d.value > 0 : d.value < 0;\n if ($$.isCandlestickType(d)) {\n const data = $$.getCandlestickData(d);\n isEndAnchor = !data?._isUp;\n }\n else if ($$.isTreemapType(d)) {\n return labelsCentered ? \"middle\" : \"start\";\n }\n return (config.axis_rotated ? (isEndAnchor ? \"end\" : \"start\") : \"middle\");\n })\n .style(\"fill\", $$.getStylePropValue($$.updateTextColor))\n .style(\"fill-opacity\", \"0\")\n .each(function (d, i, texts) {\n const node = select(this);\n let { value } = d;\n if ($$.isBubbleZType(d)) {\n value = $$.getBubbleZData(value, \"z\");\n }\n else if ($$.isCandlestickType(d)) {\n const data = $$.getCandlestickData(d);\n if (data) {\n value = data.close;\n }\n }\n value = $$.isTreemapType(d) ?\n $$.treemapDataLabelFormat(d)(node) :\n $$.dataLabelFormat(d.id)(value, d.id, d.index, texts);\n if (isNumber(value)) {\n this.textContent = value;\n }\n else {\n setTextValue(node, value, undefined, true);\n }\n });\n // Add images if imgUrl is specified\n updateTextImage.call($$);\n },\n updateTextColor(d) {\n const $$ = this;\n const { config } = $$;\n const labelColors = config.data_labels_colors;\n const defaultColor = ($$.isArcType(d) && !$$.isRadarType(d)) || $$.isFunnelType(d) || $$.isTreemapType(d) ?\n null :\n $$.color(d);\n let color;\n if (isString(labelColors)) {\n color = labelColors;\n }\n else if (isObject(labelColors)) {\n const { id } = d.data || d;\n color = labelColors[id];\n }\n else if (isFunction(labelColors)) {\n color = labelColors.bind($$.api)(defaultColor, d);\n }\n if ($$.isCandlestickType(d) && !isFunction(labelColors)) {\n const value = $$.getCandlestickData(d);\n if (!value?._isUp) {\n const downColor = config.candlestick_color_down;\n color = isObject(downColor) ? downColor[d.id] : downColor;\n }\n }\n return color || defaultColor;\n },\n /**\n * Update data label text background color\n * @param {object} d Data object\n * @param {object|string|function} option option object\n * @returns {string|null}\n * @private\n */\n updateTextBGColor(d, option) {\n const $$ = this;\n const { $el: { defs } } = $$;\n let color = \"\";\n if (option) {\n const id = isString(option) ?\n \"\" :\n $$.getTargetSelectorSuffix(\"id\" in d ? d.id : d.data.id);\n const filter = defs.select([\"filter[id*='labels-bg\", \"']\"].join(id));\n if (filter.size()) {\n color = `url(#${filter.attr(\"id\")})`;\n }\n if (isFunction(option)) {\n $$.generateTextBGColorFilter(option);\n // Get default color and call function\n const defaultColor = $$.color(d);\n const bgColor = option.bind($$.api)(defaultColor, d);\n if (bgColor) {\n filter.select(\"feFlood\").attr(\"flood-color\", bgColor);\n }\n else {\n color = \"\";\n }\n }\n }\n return color || null;\n },\n /**\n * Redraw chartText\n * @param {function} getX Positioning function for x\n * @param {function} getY Positioning function for y\n * @param {boolean} forFlow Weather is flow\n * @param {boolean} withTransition transition is enabled\n * @returns {Array}\n * @private\n */\n redrawText(getX, getY, forFlow, withTransition) {\n const $$ = this;\n const { $T, axis, config, state: { hasTreemap } } = $$;\n const t = getRandom(true);\n const isRotated = config.axis_rotated;\n const angle = config.data_labels.rotate;\n const anchorString = getRotateAnchor(angle);\n const rotateString = angle ? `rotate(${angle})` : \"\";\n const text = $$.$el.text\n .style(\"fill\", $$.getStylePropValue($$.updateTextColor))\n .attr(\"filter\", d => $$.updateTextBGColor.bind($$)(d, config.data_labels_backgroundColors))\n .style(\"fill-opacity\", forFlow ? 0 : $$.opacityForText.bind($$));\n // Phase 1: collect text dimensions before mutating label positions.\n const dimensions = new Map();\n const elementsToMeasure = [];\n text.each(function (d) {\n const element = this;\n dimensions.set(element, { rect: getBoundingRect(element) });\n if (config.data_labels.centered && ($$.isBarType(d) || $$.isTreemapType(d))) {\n elementsToMeasure.push(element);\n }\n });\n if (elementsToMeasure.length > 0) {\n batchGetBBox(elementsToMeasure).forEach((bbox, element) => {\n const dimension = dimensions.get(element);\n dimension && (dimension.bbox = bbox);\n });\n }\n // Phase 2: apply cached dimensions during position calculation.\n text.each(function (d, i) {\n const labelDimension = dimensions.get(this);\n // do not apply transition for newly added text elements\n const node = $T(hasTreemap && this.childElementCount ? this.parentNode : this, !!(withTransition &&\n (this.getAttribute(\"x\") || this.getAttribute(\"transform\"))), t);\n const isInverted = config[`axis_${axis?.getId(d.id)}_inverted`];\n let pos = {\n x: getX.call(this, d, i, labelDimension),\n y: getY.call(this, d, i, labelDimension)\n };\n if (angle) {\n pos = setRotatePos.bind($$)(d, pos, anchorString, isRotated, isInverted);\n node.attr(\"text-anchor\", anchorString);\n }\n updateTextImagePos.call($$, this, pos, labelDimension?.rect);\n // when is multiline\n if (this.childElementCount || angle) {\n node.attr(\"transform\", `translate(${pos.x} ${pos.y}) ${rotateString}`);\n }\n else {\n node.attr(\"x\", pos.x).attr(\"y\", pos.y);\n }\n config.data_labels.border &&\n updateTextBorder.call($$, node.node(), pos, `${$TEXT.textBorderRect}-${i}`);\n });\n // need to return 'true' as of being pushed to the redraw list\n // ref: getRedrawList()\n return true;\n },\n /**\n * Gets the getBoundingClientRect value of the element\n * @param {HTMLElement|d3.selection|Array} source Target element\n * @param {string} className Class name\n * @returns {object} value of element.getBoundingClientRect()\n * @private\n */\n getTextRect(source, className) {\n const $$ = this;\n let cacheKey;\n let base;\n let text;\n if (Array.isArray(source)) {\n cacheKey = `${KEY.textRect}-${source.join(\"_\")}`;\n }\n else {\n base = source.node?.() ?? source;\n if (!/text/i.test(base.tagName)) {\n base = base.querySelector(\"text\");\n }\n text = base.textContent;\n cacheKey = `${KEY.textRect}-${text.replace(/\\W/g, \"_\")}`;\n }\n const rect = $$.cache.get(cacheKey) || [];\n if (rect.length === 0) {\n ($$.$el.svg || $$.$el.chart.select(\"svg\"))\n .selectAll(`.${$COMMON.dummy}`)\n .data(text ? [text] : source)\n .enter()\n .append(\"text\")\n .style(\"visibility\", \"hidden\")\n .style(\"font\", base ? select(base).style(\"font\") : null)\n .classed(className || $COMMON.dummy, true)\n .text(d => d)\n .each(function (v, i) {\n rect[i] = getBoundingRect(this);\n })\n .remove();\n $$.cache.add(cacheKey, rect);\n }\n return rect.length > 1 ? rect : rect[0];\n },\n /**\n * Gets the x or y coordinate of the text\n * @param {object} indices Indices values\n * @param {boolean} forX whether or not to x\n * @returns {function} coordinates\n * @private\n */\n generateXYForText(indices, forX) {\n const $$ = this;\n const { state: { hasRadar, hasFunnel, hasTreemap } } = $$;\n const types = Object.keys(indices);\n const points = {};\n const getter = forX ? $$.getXForText : $$.getYForText;\n hasFunnel && types.push(\"funnel\");\n hasRadar && types.push(\"radar\");\n hasTreemap && types.push(\"treemap\");\n types.forEach(v => {\n points[v] = $$[`generateGet${capitalize(v)}Points`](indices[v], false);\n });\n return function (d, i, labelDimension) {\n const type = ($$.isAreaType(d) && \"area\") ||\n ($$.isBarType(d) && \"bar\") ||\n ($$.isCandlestickType(d) && \"candlestick\") ||\n ($$.isFunnelType(d) && \"funnel\") ||\n ($$.isRadarType(d) && \"radar\") ||\n ($$.isTreemapType(d) && \"treemap\") || \"line\";\n return getter.call($$, points[type](d, i), d, this, labelDimension);\n };\n },\n /**\n * Get centerized text position for bar type data.label.text\n * @param {object} d Data object\n * @param {Array} points Data points position\n * @param {HTMLElement} textElement Data label text element\n * @param {string} type 'x' or 'y'\n * @param {object} labelDimension Optional cached label dimensions\n * @returns {number} Position value\n * @private\n */\n getCenteredTextPos(d, points, textElement, type, labelDimension) {\n const $$ = this;\n const { config } = $$;\n const isRotated = config.axis_rotated;\n const isBarType = $$.isBarType(d);\n const isTreemapType = $$.isTreemapType(d);\n if (config.data_labels.centered && (isBarType || isTreemapType)) {\n const rect = labelDimension?.bbox || getBBox(textElement);\n if (isBarType) {\n const isPositive = $$.getRangedData(d, null, \"bar\") >= 0;\n if (isRotated) {\n const w = (isPositive ?\n points[1][1] - points[0][1] :\n points[0][1] - points[1][1]) / 2 + (rect.width / 2);\n return isPositive ? -w - 3 : w + 2;\n }\n else {\n const h = (isPositive ?\n points[0][1] - points[1][1] :\n points[1][1] - points[0][1]) / 2 + (rect.height / 2);\n return isPositive ? h : -h - 2;\n }\n }\n else if (isTreemapType) {\n return type === \"x\" ?\n (points[1][0] - points[0][0]) / 2 : // X: Move to horizontal center of rect\n (points[1][1] - points[0][1]) / 2 - rect.y - rect.height / 2; // Y: Calculate true vertical center\n }\n }\n return 0;\n },\n /**\n * Gets the x coordinate of the text\n * @param {object} points Data points position\n * @param {object} d Data object\n * @param {HTMLElement} textElement Data label text element\n * @param {object} labelDimension Optional cached label dimensions\n * @returns {number} x coordinate\n * @private\n */\n getXForText(points, d, textElement, labelDimension) {\n const $$ = this;\n const { config } = $$;\n const isRotated = config.axis_rotated;\n const isFunnelType = $$.isFunnelType(d);\n const isTreemapType = $$.isTreemapType(d);\n let xPos = points ? points[0][0] : 0;\n if ($$.isCandlestickType(d)) {\n if (isRotated) {\n xPos = $$.getCandlestickData(d)?._isUp ? points[2][2] + 4 : points[2][1] - 4;\n }\n else {\n xPos += (points[1][0] - xPos) / 2;\n }\n }\n else if (isFunnelType) {\n // Use pre-calculated center x from points[2]\n // Preserve current position when points unavailable (during hide transition)\n if (points) {\n xPos = points[2]?.[0] ?? xPos;\n }\n else {\n return getElementPos(textElement, \"x\");\n }\n }\n else if (isTreemapType) {\n xPos += config.data_labels.centered ? 0 : 5;\n }\n else {\n if (isRotated) {\n const isInverted = config[`axis_${$$.axis.getId(d.id)}_inverted`];\n const padding = $$.isBarType(d) ? 4 : 6;\n const value = d.value;\n xPos = points[2][1];\n xPos += padding * ((isInverted ? value > 0 : value < 0) ? -1 : 1);\n }\n else {\n xPos = $$.hasType(\"bar\") ? (points[2][0] + points[0][0]) / 2 : xPos;\n }\n }\n if (isRotated || isTreemapType || isFunnelType) {\n xPos += $$.getCenteredTextPos(d, points, textElement, \"x\", labelDimension);\n }\n return xPos + getTextPos.call(this, d, \"x\");\n },\n /**\n * Gets the y coordinate of the text\n * @param {object} points Data points position\n * @param {object} d Data object\n * @param {HTMLElement} textElement Data label text element\n * @param {object} labelDimension Optional cached label dimensions\n * @returns {number} y coordinate\n * @private\n */\n getYForText(points, d, textElement, labelDimension) {\n const $$ = this;\n const { axis, config, state } = $$;\n const isRotated = config.axis_rotated;\n const isInverted = config[`axis_${axis?.getId(d.id)}_inverted`];\n const isBarType = $$.isBarType(d);\n const isFunnelType = $$.isFunnelType(d);\n const isTreemapType = $$.isTreemapType(d);\n const r = config.point_r;\n const rect = labelDimension?.rect || getBoundingRect(textElement);\n let { value } = d;\n let baseY = 3;\n let yPos;\n if ($$.isCandlestickType(d)) {\n value = $$.getCandlestickData(d);\n if (isRotated) {\n yPos = points[0][0];\n yPos += ((points[1][0] - yPos) / 2) + baseY;\n }\n else {\n yPos = value && value._isUp ? points[2][2] - baseY : points[2][1] + (baseY * 4);\n if (isInverted) {\n yPos += 15 * (value._isUp ? 1 : -1);\n }\n }\n }\n else if (isFunnelType) {\n // Use pre-calculated center y from points[2]\n // Preserve current position when points unavailable (during hide transition)\n if (points) {\n yPos = (points[2]?.[1] ?? points[0][1]) + rect.height / 2 - 3;\n }\n else {\n return getElementPos(textElement, \"y\");\n }\n }\n else if (isTreemapType) {\n yPos = points[0][1] + (config.data_labels.centered ? 0 : rect.height + 5);\n }\n else {\n if (isRotated) {\n yPos = (points[0][0] + points[2][0] + rect.height * 0.6) / 2;\n }\n else {\n yPos = points[2][1];\n if (isNumber(r) && r > 5 && ($$.isLineType(d) || $$.isScatterType(d))) {\n baseY += config.point_r / 2.3;\n }\n if (value < 0 || (value === 0 && !state.hasPositiveValue && state.hasNegativeValue)) {\n yPos += isInverted ? (isBarType ? -3 : -5) : (rect.height + (isBarType ? -baseY : baseY));\n }\n else {\n let diff = -baseY * 2;\n if (isBarType) {\n diff = -baseY;\n }\n else if ($$.isBubbleType(d)) {\n diff = baseY;\n }\n if (isInverted) {\n diff = isBarType ? 10 : 15;\n }\n yPos += diff;\n }\n }\n }\n if (!isRotated || isTreemapType) {\n yPos += $$.getCenteredTextPos(d, points, textElement, \"y\", labelDimension);\n }\n return yPos + getTextPos.call(this, d, \"y\");\n },\n /**\n * Calculate if two or more text nodes are overlapping\n * Mark overlapping text nodes with \"text-overlapping\" class\n * @param {string} id Axis id\n * @param {ChartInternal} $$ ChartInternal context\n * @param {string} selector Selector string\n * @private\n */\n markOverlapped(id, $$, selector) {\n const textNodes = $$.$el.arcs.selectAll(selector);\n const filteredTextNodes = textNodes.filter(node => node.data.id !== id);\n const textNode = textNodes.filter(node => node.data.id === id);\n const translate = getTranslation(textNode.node());\n // Calculates the length of the hypotenuse\n const calcHypo = (x, y) => Math.sqrt(x * x + y * y);\n textNode.node() && filteredTextNodes.each(function () {\n const coordinate = getTranslation(this);\n const filteredTextNode = select(this);\n const nodeForWidth = calcHypo(translate.e, translate.f) > calcHypo(coordinate.e, coordinate.f) ?\n textNode :\n filteredTextNode;\n const overlapsX = Math.ceil(Math.abs(translate.e - coordinate.e)) <\n Math.ceil(nodeForWidth.node().getComputedTextLength());\n const overlapsY = Math.ceil(Math.abs(translate.f - coordinate.f)) <\n parseInt(textNode.style(\"font-size\"), 10);\n filteredTextNode.classed($TEXT.TextOverlapping, overlapsX && overlapsY);\n });\n },\n /**\n * Calculate if two or more text nodes are overlapping\n * Remove \"text-overlapping\" class on selected text nodes\n * @param {ChartInternal} $$ ChartInternal context\n * @param {string} selector Selector string\n * @private\n */\n undoMarkOverlapped($$, selector) {\n $$.$el.arcs.selectAll(selector)\n .each(function () {\n selectAll([this, this.previousSibling])\n .classed($TEXT.TextOverlapping, false);\n });\n }\n};\n\nexport { text as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { $TEXT } from '../../config/classes.js';\nimport { getElementPos, getBBox, setTextValue, getBoundingRect } from '../../module/util/dom.js';\nimport { isNumber } from '../../module/util/type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Get the text position\n * @param {string} pos right, left or center\n * @param {number} width chart width\n * @returns {string|number} text-anchor value or position in pixel\n * @private\n */\nfunction _getTextXPos(pos = \"left\", width) {\n const isNum = isNumber(width);\n if (pos.includes(\"center\")) {\n return isNum ? width / 2 : \"middle\";\n }\n if (pos.includes(\"right\")) {\n return isNum ? width : \"end\";\n }\n return isNum ? 0 : \"start\";\n}\n/**\n * Get estimated canvas title height.\n * @param {object} $$ ChartInternal instance\n * @returns {number} Title height\n * @private\n */\nfunction _getCanvasTitleHeight($$) {\n const { config, $el } = $$;\n const font = $$.canvasTheme?.style?.title?.font ||\n $$.canvasTheme?.style?.label?.font ||\n \"14px sans-serif\";\n const chart = $el.chart?.node?.();\n const doc = chart?.ownerDocument;\n if (chart && doc && config.title_text) {\n const svg = doc.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n const text = doc.createElementNS(\"http://www.w3.org/2000/svg\", \"text\");\n svg.style.cssText = \"position:absolute;visibility:hidden;left:-10000px;top:-10000px;\";\n text.setAttribute(\"class\", $TEXT.title);\n text.style.font = font;\n text.textContent = String(config.title_text);\n svg.appendChild(text);\n chart.appendChild(svg);\n const height = getBoundingRect(text).height;\n svg.remove();\n if (height) {\n return height;\n }\n }\n return config.title_text ? (parseFloat(font) || 14) : 0;\n}\nvar title = {\n /**\n * Initializes the title\n * @private\n */\n initTitle() {\n const $$ = this;\n const { config, $el } = $$;\n if (config.title_text) {\n $el.title = $el.svg.append(\"g\");\n const text = $el.title\n .append(\"text\")\n .style(\"text-anchor\", _getTextXPos(config.title_position))\n .attr(\"class\", $TEXT.title);\n setTextValue(text, config.title_text, [0.3, 1.5]);\n }\n },\n /**\n * Redraw title\n * @private\n */\n redrawTitle() {\n const $$ = this;\n const { config, state: { current }, $el: { title } } = $$;\n if (title) {\n const x = _getTextXPos(config.title_position, current.width);\n const y = (config.title_padding.top || 0) +\n $$.getTextRect($$.$el.title, $TEXT.title).height;\n title.attr(\"transform\", `translate(${x}, ${y})`);\n }\n },\n /**\n * Get canvas title height using the same SVG text measurement as title padding.\n * @returns {number} Title height\n * @private\n */\n getCanvasTitleHeight() {\n return _getCanvasTitleHeight(this);\n },\n /**\n * Get title padding\n * @returns {number} padding value\n * @private\n */\n getTitlePadding() {\n const $$ = this;\n const { $el: { title }, config, state } = $$;\n const paddingTop = config.title_padding.top || 0;\n const paddingBottom = config.title_padding.bottom || 0;\n if (state.isCanvasMode && config.title_text) {\n return paddingTop + $$.getCanvasTitleHeight() + paddingBottom;\n }\n if (!title?.node()) {\n return paddingTop + paddingBottom;\n }\n const titleNode = title.node();\n const translateY = getElementPos(titleNode, \"y\");\n // If title has been positioned, use actual bounding box for accurate calculation\n if (translateY) {\n const bbox = getBBox(titleNode);\n // Calculate actual bottom of title text\n // translateY is the baseline position, bbox.y is negative (above baseline),\n // bbox.y + bbox.height gives the extent below baseline\n return translateY + bbox.y + bbox.height + paddingBottom;\n }\n // Fallback: title not yet positioned, use text rect estimation\n return paddingTop +\n $$.getTextRect(title, $TEXT.title).height +\n paddingBottom;\n }\n};\n\nexport { title as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { select } from 'd3-selection';\nimport { $TOOLTIP, $ARC } from '../../config/classes.js';\nimport { document as doc } from '../../module/browser.js';\nimport { callFn, tplProcess, parseDate } from '../../module/util/object.js';\nimport { isValue, isFunction, isUndefined, isObject, isString, isEmpty } from '../../module/util/type-checks.js';\nimport { getTransformCTM, getBoundingRect, getPointer, hasViewBox } from '../../module/util/dom.js';\nimport { sanitize } from '../../module/sanitize.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n// Hoisted to module level to avoid recompilation on every getTooltipContentTemplate() call\nconst RE_WHITESPACE = /(\\r?\\n|\\t)/g;\nconst RE_TOOLTIP_TPL = /{{(.*)}}/;\nvar tooltip = {\n /**\n * Initializes the tooltip\n * @private\n */\n initTooltip() {\n const $$ = this;\n const { config, $el } = $$;\n $el.tooltip = select(config.tooltip_contents.bindto);\n if ($el.tooltip.empty()) {\n $el.tooltip = $el.chart\n .append(\"div\")\n .attr(\"class\", $TOOLTIP.tooltipContainer)\n .style(\"position\", \"absolute\")\n .style(\"pointer-events\", \"none\")\n .style(\"display\", \"none\");\n }\n $$.bindTooltipResizePos();\n },\n /**\n * Show tooltip at initialization.\n * Is called only when tooltip.init.show=true option is set\n * @private\n */\n initShowTooltip() {\n const $$ = this;\n const { config, $el, state: { hasAxis, hasRadar } } = $$;\n // Show tooltip if needed\n if (config.tooltip_init_show) {\n const isArc = !(hasAxis || hasRadar);\n if ($$.axis?.isTimeSeries() && isString(config.tooltip_init_x)) {\n config.tooltip_init_x = parseDate.call($$, config.tooltip_init_x);\n }\n $$.api.tooltip.show({\n data: {\n [isArc ? \"index\" : \"x\"]: config.tooltip_init_x\n }\n });\n const position = config.tooltip_init_position;\n if (!config.tooltip_contents.bindto && !isEmpty(position)) {\n const { top = 0, left = 50 } = position;\n $el.tooltip.style(\"top\", isString(top) ? top : `${top}px`)\n .style(\"left\", isString(left) ? left : `${left}px`)\n .style(\"display\", null);\n }\n }\n },\n /**\n * Get the tooltip HTML string\n * @param {Array} args Arguments\n * @returns {string} Formatted HTML string\n * @private\n */\n getTooltipHTML(...args) {\n const $$ = this;\n const { api, config } = $$;\n return sanitize(isFunction(config.tooltip_contents) ?\n config.tooltip_contents.bind(api)(...args) :\n $$.getTooltipContent(...args));\n },\n /**\n * Returns the tooltip content(HTML string)\n * @param {object} d data\n * @param {function} defaultTitleFormat Default title format\n * @param {function} defaultValueFormat Default format for each data value in the tooltip.\n * @param {function} color Color function\n * @returns {string} html\n * @private\n */\n getTooltipContent(d, defaultTitleFormat, defaultValueFormat, color) {\n const $$ = this;\n const { api, config, state, $el } = $$;\n // get formatter function\n const titleFn = config.tooltip_format_title;\n const nameFn = config.tooltip_format_name;\n const valueFn = config.tooltip_format_value;\n // determine formatter function\n const titleFormat = isFunction(titleFn) ? titleFn.bind(api) : defaultTitleFormat;\n const nameFormat = isFunction(nameFn) ? nameFn.bind(api) : (name => name);\n const boundValueFn = isFunction(valueFn) ? valueFn.bind(api) : null;\n const valueFormat = (v, ratio, id, index) => {\n let fn = boundValueFn;\n if (!fn) {\n // For normalize per group, only show percentage for data in groups\n if (state.hasTreemap ||\n ($$.isStackNormalized() &&\n (!$$.isStackNormalizedPerGroup() || $$.isGrouped(id)))) {\n fn = (v, ratio) => `${(ratio * 100).toFixed(2)}%`;\n }\n else {\n fn = defaultValueFormat;\n }\n }\n return fn(v, ratio, id, index);\n };\n const order = config.tooltip_order;\n const getRowValue = row => ($$.axis && $$.isBubbleZType(row) ?\n $$.getBubbleZData(row.value, \"z\") :\n $$.getBaseValue(row));\n const getBgColor = $$.levelColor ? row => $$.levelColor(row.value) : row => color(row);\n const contents = config.tooltip_contents;\n const tplStr = contents.template;\n const targetIds = $$.mapToTargetIds();\n if (order === null && config.data_groups.length) {\n // for stacked data, order should aligned with the visually displayed data\n const ids = $$.orderTargets($$.data.targets)\n .map(i2 => i2.id)\n .reverse();\n d.sort((a, b) => {\n let v1 = a ? a.value : null;\n let v2 = b ? b.value : null;\n if (v1 > 0 && v2 > 0) {\n v1 = a.id ? ids.indexOf(a.id) : null;\n v2 = b.id ? ids.indexOf(b.id) : null;\n }\n return v1 - v2;\n });\n }\n else if (/^(asc|desc)$/.test(order)) {\n const isAscending = order === \"asc\";\n d.sort((a, b) => {\n const v1 = a ? getRowValue(a) : null;\n const v2 = b ? getRowValue(b) : null;\n return isAscending ? v1 - v2 : v2 - v1;\n });\n }\n else if (isFunction(order)) {\n d.sort(order.bind(api));\n }\n const tpl = $$.getTooltipContentTemplate(tplStr);\n const len = d.length;\n let text;\n let row;\n let param;\n let value;\n let i;\n for (i = 0; i < len; i++) {\n row = d[i];\n const rowValue = row && getRowValue(row);\n if (!row || !(rowValue || rowValue === 0)) {\n continue;\n }\n if (isUndefined(text)) {\n const title = (state.hasAxis || state.hasRadar) && titleFormat(row.x);\n text = tplProcess(tpl[0], {\n CLASS_TOOLTIP: $TOOLTIP.tooltip,\n TITLE: isValue(title) ?\n (tplStr ? title : `<tr><th colspan=\"2\">${title}</th></tr>`) :\n \"\"\n });\n }\n if (!row.ratio && $el.arcs) {\n param = [\"arc\", $$.$el.arcs.select(`path.${$ARC.arc}-${row.id}`).data()[0]];\n row.ratio = $$.getRatio(...param);\n }\n // arrange param to be passed to formatter\n param = [row.ratio, row.id, row.index];\n if ($$.isAreaRangeType(row)) {\n const [high, low] = [\"high\", \"low\"].map(v => valueFormat($$.getRangedData(row, v), ...param));\n const mid = valueFormat(getRowValue(row), ...param);\n value = `<b>Mid:</b> ${mid} <b>High:</b> ${high} <b>Low:</b> ${low}`;\n }\n else if ($$.isCandlestickType(row)) {\n const [open, high, low, close, volume] = [\"open\", \"high\", \"low\", \"close\", \"volume\"]\n .map(v => {\n const value = $$.getRangedData(row, v, \"candlestick\");\n return value ?\n valueFormat($$.getRangedData(row, v, \"candlestick\"), ...param) :\n undefined;\n });\n value =\n `<b>Open:</b> ${open} <b>High:</b> ${high} <b>Low:</b> ${low} <b>Close:</b> ${close}${volume ? ` <b>Volume:</b> ${volume}` : \"\"}`;\n }\n else if ($$.isBarRangeType(row)) {\n const { value: rangeValue, id, index } = row;\n value = `${valueFormat(rangeValue, undefined, id, index)}`;\n }\n else {\n value = valueFormat(getRowValue(row), ...param);\n }\n if (value !== undefined) {\n // Skip elements when their name is set to null\n if (row.name === null) {\n continue;\n }\n const name = nameFormat(row.name ?? row.id, ...param);\n const color = getBgColor(row);\n const contentValue = {\n CLASS_TOOLTIP_NAME: $TOOLTIP.tooltipName + $$.getTargetSelectorSuffix(row.id),\n COLOR: (tplStr || !$$.patterns) ?\n color :\n `<svg><rect style=\"fill:${color}\" width=\"10\" height=\"10\"></rect></svg>`,\n NAME: name,\n VALUE: value\n };\n if (tplStr && isObject(contents.text)) {\n const index = targetIds.indexOf(row.id);\n Object.keys(contents.text).forEach(key => {\n contentValue[key] = contents.text[key][index];\n });\n }\n text += tplProcess(tpl[1], contentValue);\n }\n }\n return `${text}</table>`;\n },\n /**\n * Get the content template string\n * @param {string} tplStr Tempalte string\n * @returns {Array} Template string\n * @private\n */\n getTooltipContentTemplate(tplStr) {\n return (tplStr || `<table class=\"{=CLASS_TOOLTIP}\"><tbody>\n\t\t\t\t{=TITLE}\n\t\t\t\t{{<tr class=\"{=CLASS_TOOLTIP_NAME}\">\n\t\t\t\t\t<td class=\"name\">${this.patterns ? `{=COLOR}` : `<span style=\"background-color:{=COLOR}\"></span>`}{=NAME}</td>\n\t\t\t\t\t<td class=\"value\">{=VALUE}</td>\n\t\t\t\t</tr>}}\n\t\t\t</tbody></table>`)\n .replace(RE_WHITESPACE, \"\")\n .split(RE_TOOLTIP_TPL);\n },\n /**\n * Update tooltip position coordinate\n * @param {object} dataToShow Data object\n * @param {SVGElement} eventTarget Event element\n * @private\n */\n setTooltipPosition(dataToShow, eventTarget) {\n const $$ = this;\n const { config, scale, state, $el: { eventRect, tooltip, svg } } = $$;\n const { bindto } = config.tooltip_contents;\n const isRotated = config.axis_rotated;\n const datum = tooltip?.datum();\n if (!bindto && datum) {\n const data = dataToShow ?? datum.data;\n const [x, y] = getPointer(state.event, eventTarget ?? eventRect?.node()); // get mouse event position\n const currPos = { x, y };\n if (state.hasAxis && scale.x && datum && \"x\" in datum) {\n const getYPos = (value = 0, id, axisId = \"y\") => {\n const scaleFn = scale[id ? $$.axis?.getId(id) : axisId];\n return scaleFn ?\n scaleFn(value) + (isRotated ? state.margin.left : state.margin.top) :\n 0;\n };\n currPos.xAxis = scale.x(datum.x) + (\n // add margin only when user specified tooltip.position function\n config.tooltip_position ? (isRotated ? state.margin.top : state.margin.left) : 0);\n if (data.length === 1) {\n currPos.yAxis = getYPos(data[0].value, data[0].id);\n }\n else {\n currPos.yAxis = getYPos;\n }\n }\n const { width = 0, height = 0 } = datum;\n // Get tooltip position\n const pos = config.tooltip_position?.bind($$.api)(data, width, height, eventRect?.node(), currPos) ?? ((svg && hasViewBox(svg)) ?\n $$.getTooltipPositionViewBox.bind($$)(width, height, currPos) :\n $$.getTooltipPosition.bind($$)(width, height, currPos));\n [\"top\", \"left\"].forEach(v => {\n const value = pos[v];\n tooltip.style(v, `${value}px`);\n // Remember left pos in percentage to be used on resize call\n if (v === \"left\" && !datum.xPosInPercent) {\n datum.xPosInPercent = value / state.current.width * 100;\n }\n });\n }\n },\n /**\n * Get tooltip position when svg has vieBox attribute\n * @param {number} tWidth Tooltip width value\n * @param {number} tHeight Tooltip height value\n * @param {object} currPos Current event position value from SVG coordinate\n * @returns {object} top, left value\n */\n getTooltipPositionViewBox(tWidth, tHeight, currPos) {\n const $$ = this;\n const { $el: { eventRect, svg }, config, state } = $$;\n const isRotated = config.axis_rotated;\n const hasArcType = $$.hasArcType() || state.hasFunnel || state.hasTreemap;\n const target = (hasArcType ? svg : eventRect)?.node() ?? state.event.target;\n let { x, y } = currPos;\n if (state.hasAxis) {\n x = isRotated ? x : currPos.xAxis;\n y = isRotated ? currPos.xAxis : y;\n }\n // currPos value based on SVG coordinate\n const ctm = getTransformCTM(target, x, y, false);\n const rect = getBoundingRect(target);\n const size = getTransformCTM(target, 20, 0, false).x;\n let top = ctm.y;\n let left = ctm.x + (tWidth / 2) + size;\n if (hasArcType) {\n if (state.hasFunnel || state.hasTreemap || state.hasRadar) {\n left -= (tWidth / 2) + size;\n top += tHeight;\n }\n else {\n top += rect.height / 2;\n left += (rect.width / 2) - (tWidth - size);\n }\n }\n if (left + tWidth > rect.width) {\n left = rect.width - tWidth - size;\n }\n if (top + tHeight > rect.height) {\n top -= tHeight * 2;\n }\n return {\n top,\n left\n };\n },\n /**\n * Returns the position of the tooltip\n * @param {string} tWidth Width value of tooltip element\n * @param {string} tHeight Height value of tooltip element\n * @param {object} currPos Current mouse position\n * @returns {object} top, left value\n * @private\n */\n getTooltipPosition(tWidth, tHeight, currPos) {\n const $$ = this;\n const { config, scale, state } = $$;\n const { width, height, current, hasFunnel, hasRadar, hasTreemap, isLegendRight, inputType } = state;\n const hasGauge = $$.hasType(\"gauge\") && !config.gauge_fullCircle;\n const isRotated = config.axis_rotated;\n const hasArcType = $$.hasArcType();\n const svgLeft = state.isCanvasMode ? 0 : $$.getSvgLeft(true);\n let chartRight = svgLeft + current.width - $$.getCurrentPaddingByDirection(\"right\");\n const size = 20;\n let { x, y } = currPos;\n // Determine tooltip position\n if (hasRadar) {\n x += x >= (width / 2) ? 15 : -(tWidth + 15);\n y += 15;\n }\n else if (hasArcType) {\n const notTouch = inputType !== \"touch\";\n if (notTouch) {\n let titlePadding = $$.getTitlePadding?.() ?? 0;\n if (titlePadding && hasGauge && config.arc_rangeText_values?.length) {\n titlePadding += 10;\n }\n x += (width - (isLegendRight ? $$.getLegendWidth() : 0)) / 2;\n y += (hasGauge ? height : (height / 2) + tHeight) + titlePadding;\n }\n }\n else if (hasFunnel || hasTreemap) {\n y += tHeight;\n }\n else {\n const padding = {\n top: $$.getCurrentPaddingByDirection(\"top\", true),\n left: $$.getCurrentPaddingByDirection(\"left\", true)\n };\n if (isRotated) {\n x += svgLeft + padding.left + size;\n y = padding.top + currPos.xAxis + size;\n chartRight -= svgLeft;\n }\n else {\n x = svgLeft + padding.left + size + (scale.zoom ? x : currPos.xAxis);\n y += padding.top - 5;\n }\n }\n // when tooltip left + tWidth > chart's width\n if ((x + tWidth + 15) > chartRight) {\n x -= tWidth + (hasFunnel || hasTreemap || hasArcType ? 0 : (isRotated ? size * 2 : 38));\n }\n if (y + tHeight > current.height) {\n const gap = hasTreemap ? tHeight + 10 : 30;\n y -= hasGauge ? tHeight * 1.5 : tHeight + gap;\n }\n const pos = { top: y, left: x };\n // make sure to not be positioned out of viewport\n if (pos.top < 0)\n pos.top = 0;\n if (pos.left < 0)\n pos.left = 0;\n return pos;\n },\n /**\n * Show the tooltip\n * @param {object} selectedData Data object\n * @param {SVGElement} eventTarget Event element\n * @private\n */\n showTooltip(selectedData, eventTarget) {\n const $$ = this;\n const { config, $el: { tooltip } } = $$;\n if (!tooltip || !config.tooltip_show) {\n return;\n }\n let dataToShow = null;\n let dataToShowCount = 0;\n let dataStr = `${$$.data.targets.length}:`;\n let firstData;\n for (let i = 0; i < selectedData.length; i++) {\n const d = selectedData[i];\n i > 0 && (dataStr += \",\");\n dataStr += `${d?.index}|${d?.id}|${d?.value}`;\n !firstData && d && (firstData = d);\n if (d && isValue($$.getBaseValue(d))) {\n dataToShowCount++;\n dataToShow?.push(d);\n }\n else if (!dataToShow) {\n dataToShow = selectedData.slice(0, i);\n }\n }\n if (dataToShowCount === 0 || !firstData) {\n return;\n }\n const datum = tooltip.datum();\n let positionData = dataToShow;\n if (!datum || datum.current !== dataStr) {\n const { index, x } = firstData;\n // getTooltipHTML() may sort selectedData in-place for display ordering.\n // Keep the original order for tooltip.position without copying on repeated hovers.\n if (!positionData) {\n positionData = selectedData.slice();\n }\n callFn(config.tooltip_onshow, $$.api, selectedData);\n // set tooltip content\n tooltip\n .html($$.getTooltipHTML(selectedData, // data\n $$.axis ? $$.axis.getXAxisTickFormat() : $$.categoryName.bind($$), // defaultTitleFormat\n $$.getDefaultValueFormat(), // defaultValueFormat\n $$.color // color\n ))\n .style(\"display\", null)\n .style(\"visibility\", null); // for IE9\n tooltip.datum({\n index,\n x,\n current: dataStr,\n data: selectedData,\n width: tooltip.property(\"offsetWidth\"),\n height: tooltip.property(\"offsetHeight\")\n });\n callFn(config.tooltip_onshown, $$.api, selectedData);\n $$._handleLinkedCharts(true, index);\n }\n $$.setTooltipPosition(positionData || selectedData, eventTarget);\n },\n /**\n * Adjust tooltip position on resize event\n * @private\n */\n bindTooltipResizePos() {\n const $$ = this;\n const { resizeFunction, state, $el: { tooltip } } = $$;\n resizeFunction.add(() => {\n if (tooltip.style(\"display\") === \"block\") {\n const { current } = state;\n const { width, xPosInPercent } = tooltip.datum();\n let value = current.width / 100 * xPosInPercent;\n const diff = current.width - (value + width);\n // if tooltip size overs current viewport size\n if (diff < 0) {\n value += diff;\n }\n tooltip.style(\"left\", `${value}px`);\n }\n });\n },\n /**\n * Hide the tooltip\n * @param {boolean} force Force to hide\n * @private\n */\n hideTooltip(force) {\n const $$ = this;\n const { api, config, $el: { tooltip } } = $$;\n if (tooltip && tooltip.style(\"display\") !== \"none\" && (!config.tooltip_doNotHide || force)) {\n const selectedData = tooltip.datum().data ?? [];\n callFn(config.tooltip_onhide, api, selectedData);\n // hide tooltip\n tooltip\n .style(\"display\", \"none\")\n .datum(null);\n callFn(config.tooltip_onhidden, api, selectedData);\n }\n },\n /**\n * Toggle display for linked chart instances\n * @param {boolean} show true: show, false: hide\n * @param {number} index x Axis index\n * @private\n */\n _handleLinkedCharts(show, index) {\n const $$ = this;\n const { charts, config, state: { event } } = $$;\n // Prevent propagation among instances if isn't instantiated from the user's event\n // https://github.com/naver/billboard.js/issues/1979\n if (event?.isTrusted && config.tooltip_linked && charts.length > 1) {\n const linkedName = config.tooltip_linked_name;\n charts\n .filter(c => c !== $$.api)\n .forEach(c => {\n const { config, $el, state } = c.internal;\n const isLinked = config.tooltip_linked;\n const name = config.tooltip_linked_name;\n const isInDom = doc.body.contains($el.chart.node());\n if (isLinked && linkedName === name && isInDom) {\n const data = $el.tooltip.data()[0];\n const isNotSameIndex = index !== data?.index;\n try {\n if (show && isNotSameIndex && state.isCanvasMode) {\n c.internal.showCanvasLinkedTooltip?.(index);\n }\n else {\n c.tooltip[show && isNotSameIndex ? \"show\" : \"hide\"]({ index });\n }\n }\n catch { }\n }\n });\n }\n },\n /**\n * Update tooltip content on redraw\n * - In a situation where tooltip is displayed and data load happens, it should reflect loaded data to tooltip\n * @param {d3Selection} context Event rect element\n * @param {number} index Data index\n * @private\n */\n updateTooltipOnRedraw(context, index) {\n const $$ = this;\n const { config, $el: { eventRect, svg, tooltip }, state: { event, hasAxis, hasRadar, hasTreemap } } = $$;\n if ($$.state.isCanvasMode) {\n return;\n }\n // Update tooltip, when tooltip is in shown state\n if (tooltip?.style(\"display\") === \"block\" && event) {\n const rect = context ?? (hasRadar ? svg : eventRect)?.node();\n // for Axis based & Radar\n if (hasAxis || hasRadar) {\n if ($$.isMultipleX()) {\n $$.selectRectForMultipleXs(rect, false);\n }\n else {\n const idx = index ?? $$.getDataIndexFromEvent(event);\n if (index === -1) {\n $$.api.tooltip.hide();\n }\n else {\n $$.selectRectForSingle(rect, idx);\n $$.setExpand(idx, null, true);\n }\n }\n }\n else { // for Arc & Treemap\n const { clientX, clientY } = event;\n setTimeout(() => {\n let target = [clientX, clientY].every(Number.isFinite) &&\n doc.elementFromPoint(clientX, clientY);\n const data = target && select(target).datum();\n if (data) {\n const d = $$.hasArcType() ?\n $$.convertToArcData($$.updateAngle(data)) :\n data?.data;\n hasTreemap && (target = svg.node());\n d && $$.showTooltip([d], target);\n }\n else {\n $$.api.tooltip.hide();\n }\n }, config.transition_duration);\n }\n }\n }\n};\n\nexport { tooltip as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { $AXIS, $ARC } from '../../config/classes.js';\nimport { asHalfPixel } from '../../module/util/type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\nvar transform = {\n getTranslate(target, index = 0) {\n const $$ = this;\n const { config, state } = $$;\n const isRotated = config.axis_rotated;\n let padding = 0;\n let x;\n let y;\n if (index && /^(x|y2?)$/.test(target)) {\n padding = $$.getAxisSize(target) * index;\n }\n if (target === \"main\") {\n x = asHalfPixel(state.margin.left);\n y = asHalfPixel(state.margin.top);\n }\n else if (target === \"context\") {\n x = asHalfPixel(state.margin2.left);\n y = asHalfPixel(state.margin2.top);\n }\n else if (target === \"legend\") {\n x = state.margin3.left;\n y = state.margin3.top;\n }\n else if (target === \"x\") {\n x = isRotated ? -padding : 0;\n y = isRotated ? 0 : state.height + padding;\n }\n else if (target === \"y\") {\n x = isRotated ? 0 : -padding;\n y = isRotated ? state.height + padding : 0;\n }\n else if (target === \"y2\") {\n x = isRotated ? 0 : state.width + padding;\n y = isRotated ? -padding - 1 : 0;\n }\n else if (target === \"subX\") {\n x = 0;\n y = isRotated ? 0 : state.height2;\n }\n else if (target === \"arc\") {\n x = state.arcWidth / 2;\n y = state.arcHeight / 2;\n if (config.arc_rangeText_values?.length) {\n y += 5 + ($$.hasType(\"gauge\") && config.title_text ? 10 : 0);\n }\n }\n else if (target === \"polar\") {\n x = state.arcWidth / 2;\n y = state.arcHeight / 2;\n }\n else if (target === \"radar\") {\n const [width, height] = $$.getRadarSize();\n x = state.width / 2 - width;\n y = state.height / 2 - height;\n }\n return `translate(${x}, ${y})`;\n },\n transformMain(withTransition, transitions) {\n const $$ = this;\n const { $el: { main }, $T } = $$;\n const xAxis = transitions?.axisX ?\n transitions.axisX :\n $T(main.select(`.${$AXIS.axisX}`), withTransition);\n const yAxis = transitions?.axisY ?\n transitions.axisY :\n $T(main.select(`.${$AXIS.axisY}`), withTransition);\n const y2Axis = transitions?.axisY2 ?\n transitions.axisY2 :\n $T(main.select(`.${$AXIS.axisY2}`), withTransition);\n $T(main, withTransition)\n .attr(\"transform\", $$.getTranslate(\"main\"));\n xAxis.attr(\"transform\", $$.getTranslate(\"x\"));\n yAxis.attr(\"transform\", $$.getTranslate(\"y\"));\n y2Axis.attr(\"transform\", $$.getTranslate(\"y2\"));\n main.select(`.${$ARC.chartArcs}`)\n .attr(\"transform\", $$.getTranslate(\"arc\"));\n },\n transformAll(withTransition, transitions) {\n const $$ = this;\n const { config, state: { hasAxis, hasFunnel, hasTreemap, isCanvasMode }, $el } = $$;\n if (isCanvasMode) {\n return;\n }\n !hasFunnel && !hasTreemap && $$.transformMain(withTransition, transitions);\n hasAxis && config.subchart_show &&\n $$.transformContext(withTransition, transitions);\n $el.legend && $$.transformLegend(withTransition);\n }\n};\n\nexport { transform as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { TYPE_BY_CATEGORY, TYPE } from '../../config/const.js';\nimport { isNumber, isArray, isString } from '../../module/util/type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n// Module-level constant: avoids re-creating the list on every isInterpolationType() call\n// https://github.com/d3/d3-shape#curves\nconst INTERPOLATION_TYPES = new Set([\n \"basis\",\n \"basis-closed\",\n \"basis-open\",\n \"bundle\",\n \"cardinal\",\n \"cardinal-closed\",\n \"cardinal-open\",\n \"catmull-rom\",\n \"catmull-rom-closed\",\n \"catmull-rom-open\",\n \"linear\",\n \"linear-closed\",\n \"monotone-x\",\n \"monotone-y\",\n \"natural\"\n]);\nvar typeInternals = {\n /**\n * Check if the given chart type is valid\n * @param {string} type Chart type string\n * @returns {boolean}\n * @private\n */\n isValidChartType(type) {\n return !!(type && Object.values(TYPE).indexOf(type) > -1);\n },\n setTargetType(targetIds, type) {\n const $$ = this;\n const { config, state: { withoutFadeIn } } = $$;\n $$.mapToTargetIds(targetIds).forEach(id => {\n withoutFadeIn[id] = type === config.data_types[id];\n config.data_types[id] = type;\n });\n if (!targetIds) {\n config.data_type = type;\n }\n },\n /**\n * Updte current used chart types\n * @private\n */\n updateTypesElements() {\n const $$ = this;\n const { state: { current } } = $$;\n Object.keys(TYPE).forEach(v => {\n const t = TYPE[v];\n const has = $$.hasType(t, null, true);\n const idx = current.types.indexOf(t);\n if (idx === -1 && has) {\n current.types.push(t);\n }\n else if (idx > -1 && !has) {\n current.types.splice(idx, 1);\n }\n });\n // Update current chart elements reference\n $$.setChartElements();\n },\n /**\n * Check if given chart types exists\n * @param {string} type Chart type\n * @param {Array} targetsValue Data array\n * @param {boolean} checkFromData Force to check type cotains from data targets\n * @returns {boolean}\n * @private\n */\n hasType(type, targetsValue, checkFromData = false) {\n const $$ = this;\n const { config, state: { current } } = $$;\n const types = config.data_types;\n const targets = targetsValue || $$.data.targets;\n if (!checkFromData && current.types?.indexOf(type) > -1) {\n return true;\n }\n else if (targets?.length) {\n return targets.some(target => {\n const t = types[target.id];\n return t === type || (!t && type === \"line\");\n });\n }\n else if (Object.keys(types).length) {\n return Object.values(types).some(t => t === type);\n }\n return config.data_type === type;\n },\n /**\n * Check if contains given chart types\n * @param {string} type Type key\n * @param {object} targets Target data\n * @param {Array} exclude Excluded types\n * @returns {boolean}\n * @private\n */\n hasTypeOf(type, targets, exclude = []) {\n if (type in TYPE_BY_CATEGORY) {\n return !TYPE_BY_CATEGORY[type]\n .filter((v) => exclude.indexOf(v) === -1)\n .every((v) => !this.hasType(v, targets));\n }\n return false;\n },\n /**\n * Check if given data is certain chart type\n * @param {object} d Data object\n * @param {string|Array} type chart type\n * @returns {boolean}\n * @private\n */\n isTypeOf(d, type) {\n const id = isString(d) ? d : d.id;\n const dataType = this.config && (this.config.data_types?.[id] || this.config.data_type);\n return isArray(type) ? type.indexOf(dataType) >= 0 : dataType === type;\n },\n hasPointType() {\n const $$ = this;\n return $$.hasTypeOf(\"Line\") || $$.hasType(\"bubble\") || $$.hasType(\"scatter\");\n },\n /**\n * Check if contains arc types chart\n * @param {object} targets Target data\n * @param {Array} exclude Excluded types\n * @returns {boolean}\n * @private\n */\n hasArcType(targets, exclude) {\n return this.hasTypeOf(\"Arc\", targets, exclude);\n },\n hasMultiArcGauge() {\n return this.hasType(\"gauge\") && this.config.gauge_type === \"multi\";\n },\n isLineType(d) {\n const id = isString(d) ? d : d.id;\n return !this.config.data_types[id] ||\n this.isTypeOf(id, TYPE_BY_CATEGORY.Line);\n },\n isStepType(d) {\n return this.isTypeOf(d, TYPE_BY_CATEGORY.Step);\n },\n isSplineType(d) {\n return this.isTypeOf(d, TYPE_BY_CATEGORY.Spline);\n },\n isAreaType(d) {\n return this.isTypeOf(d, TYPE_BY_CATEGORY.Area);\n },\n isAreaRangeType(d) {\n return this.isTypeOf(d, TYPE_BY_CATEGORY.AreaRange);\n },\n isBarType(d) {\n return this.isTypeOf(d, \"bar\");\n },\n isBubbleType(d) {\n return this.isTypeOf(d, \"bubble\");\n },\n isCandlestickType(d) {\n return this.isTypeOf(d, \"candlestick\");\n },\n isScatterType(d) {\n return this.isTypeOf(d, \"scatter\");\n },\n isTreemapType(d) {\n return this.isTypeOf(d, \"treemap\");\n },\n isPieType(d) {\n return this.isTypeOf(d, \"pie\");\n },\n isFunnelType(d) {\n return this.isTypeOf(d, \"funnel\");\n },\n isGaugeType(d) {\n return this.isTypeOf(d, \"gauge\");\n },\n isDonutType(d) {\n return this.isTypeOf(d, \"donut\");\n },\n isPolarType(d) {\n return this.isTypeOf(d, \"polar\");\n },\n isRadarType(d) {\n return this.isTypeOf(d, \"radar\");\n },\n isArcType(d) {\n return this.isPieType(d) ||\n this.isDonutType(d) ||\n this.isGaugeType(d) ||\n this.isPolarType(d) ||\n this.isRadarType(d);\n },\n // determine if is 'circle' data point\n isCirclePoint(node) {\n const { config } = this;\n const pattern = config.point_pattern;\n const isCircle = node?.tagName === \"circle\" || (config.point_type === \"circle\" &&\n (!pattern || (isArray(pattern) && pattern.length === 0)));\n return isCircle;\n },\n lineData(d) {\n return this.isLineType(d) ? [d] : [];\n },\n arcData(d) {\n return this.isArcType(d.data) ? [d] : [];\n },\n /**\n * Get data adapt for data label showing\n * @param {object} d Data object\n * @returns {Array}\n * @private\n */\n labelishData(d) {\n return this.isBarType(d) ||\n this.isLineType(d) ||\n this.isScatterType(d) ||\n this.isBubbleType(d) ||\n this.isCandlestickType(d) ||\n this.isFunnelType(d) ||\n this.isRadarType(d) ||\n this.isTreemapType(d) ?\n d.values.filter(v => isNumber(v.value) || Boolean(v.value)) :\n [];\n },\n barLineBubbleData(d) {\n return this.isBarType(d) || this.isLineType(d) || this.isBubbleType(d) ? d.values : [];\n },\n isInterpolationType(type) {\n return INTERPOLATION_TYPES.has(type);\n }\n};\n\nexport { typeInternals as default };\n","export default function() {}\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n (2 * that._x0 + that._x1) / 3,\n (2 * that._y0 + that._y1) / 3,\n (that._x0 + 2 * that._x1) / 3,\n (that._y0 + 2 * that._y1) / 3,\n (that._x0 + 4 * that._x1 + x) / 6,\n (that._y0 + 4 * that._y1 + y) / 6\n );\n}\n\nexport function Basis(context) {\n this._context = context;\n}\n\nBasis.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 3: point(this, this._x1, this._y1); // falls through\n case 2: this._context.lineTo(this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new Basis(context);\n}\n","import noop from \"../noop.js\";\nimport {point} from \"./basis.js\";\n\nfunction BasisClosed(context) {\n this._context = context;\n}\n\nBasisClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x2, this._y2);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);\n this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x2, this._y2);\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x2 = x, this._y2 = y; break;\n case 1: this._point = 2; this._x3 = x, this._y3 = y; break;\n case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisClosed(context);\n}\n","import {point} from \"./basis.js\";\n\nfunction BasisOpen(context) {\n this._context = context;\n}\n\nBasisOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n }\n};\n\nexport default function(context) {\n return new BasisOpen(context);\n}\n","import {Basis} from \"./basis.js\";\n\nfunction Bundle(context, beta) {\n this._basis = new Basis(context);\n this._beta = beta;\n}\n\nBundle.prototype = {\n lineStart: function() {\n this._x = [];\n this._y = [];\n this._basis.lineStart();\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n j = x.length - 1;\n\n if (j > 0) {\n var x0 = x[0],\n y0 = y[0],\n dx = x[j] - x0,\n dy = y[j] - y0,\n i = -1,\n t;\n\n while (++i <= j) {\n t = i / j;\n this._basis.point(\n this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),\n this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)\n );\n }\n }\n\n this._x = this._y = null;\n this._basis.lineEnd();\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\nexport default (function custom(beta) {\n\n function bundle(context) {\n return beta === 1 ? new Basis(context) : new Bundle(context, beta);\n }\n\n bundle.beta = function(beta) {\n return custom(+beta);\n };\n\n return bundle;\n})(0.85);\n","export function point(that, x, y) {\n that._context.bezierCurveTo(\n that._x1 + that._k * (that._x2 - that._x0),\n that._y1 + that._k * (that._y2 - that._y0),\n that._x2 + that._k * (that._x1 - x),\n that._y2 + that._k * (that._y1 - y),\n that._x2,\n that._y2\n );\n}\n\nexport function Cardinal(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinal.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: point(this, this._x1, this._y1); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; this._x1 = x, this._y1 = y; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new Cardinal(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import noop from \"../noop.js\";\nimport {point} from \"./cardinal.js\";\n\nexport function CardinalClosed(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalClosed(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {point} from \"./cardinal.js\";\n\nexport function CardinalOpen(context, tension) {\n this._context = context;\n this._k = (1 - tension) / 6;\n}\n\nCardinalOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(tension) {\n\n function cardinal(context) {\n return new CardinalOpen(context, tension);\n }\n\n cardinal.tension = function(tension) {\n return custom(+tension);\n };\n\n return cardinal;\n})(0);\n","import {epsilon} from \"../math.js\";\nimport {Cardinal} from \"./cardinal.js\";\n\nexport function point(that, x, y) {\n var x1 = that._x1,\n y1 = that._y1,\n x2 = that._x2,\n y2 = that._y2;\n\n if (that._l01_a > epsilon) {\n var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,\n n = 3 * that._l01_a * (that._l01_a + that._l12_a);\n x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;\n y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;\n }\n\n if (that._l23_a > epsilon) {\n var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,\n m = 3 * that._l23_a * (that._l23_a + that._l12_a);\n x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;\n y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;\n }\n\n that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);\n}\n\nfunction CatmullRom(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRom.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x2, this._y2); break;\n case 3: this.point(this._x2, this._y2); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalClosed} from \"./cardinalClosed.js\";\nimport noop from \"../noop.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomClosed(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =\n this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 1: {\n this._context.moveTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 2: {\n this._context.lineTo(this._x3, this._y3);\n this._context.closePath();\n break;\n }\n case 3: {\n this.point(this._x3, this._y3);\n this.point(this._x4, this._y4);\n this.point(this._x5, this._y5);\n break;\n }\n }\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; this._x3 = x, this._y3 = y; break;\n case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;\n case 2: this._point = 3; this._x5 = x, this._y5 = y; break;\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import {CardinalOpen} from \"./cardinalOpen.js\";\nimport {point} from \"./catmullRom.js\";\n\nfunction CatmullRomOpen(context, alpha) {\n this._context = context;\n this._alpha = alpha;\n}\n\nCatmullRomOpen.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 = this._x2 =\n this._y0 = this._y1 = this._y2 = NaN;\n this._l01_a = this._l12_a = this._l23_a =\n this._l01_2a = this._l12_2a = this._l23_2a =\n this._point = 0;\n },\n lineEnd: function() {\n if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n\n if (this._point) {\n var x23 = this._x2 - x,\n y23 = this._y2 - y;\n this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));\n }\n\n switch (this._point) {\n case 0: this._point = 1; break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;\n case 3: this._point = 4; // falls through\n default: point(this, x, y); break;\n }\n\n this._l01_a = this._l12_a, this._l12_a = this._l23_a;\n this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;\n this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;\n this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;\n }\n};\n\nexport default (function custom(alpha) {\n\n function catmullRom(context) {\n return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);\n }\n\n catmullRom.alpha = function(alpha) {\n return custom(+alpha);\n };\n\n return catmullRom;\n})(0.5);\n","import noop from \"../noop.js\";\n\nfunction LinearClosed(context) {\n this._context = context;\n}\n\nLinearClosed.prototype = {\n areaStart: noop,\n areaEnd: noop,\n lineStart: function() {\n this._point = 0;\n },\n lineEnd: function() {\n if (this._point) this._context.closePath();\n },\n point: function(x, y) {\n x = +x, y = +y;\n if (this._point) this._context.lineTo(x, y);\n else this._point = 1, this._context.moveTo(x, y);\n }\n};\n\nexport default function(context) {\n return new LinearClosed(context);\n}\n","function sign(x) {\n return x < 0 ? -1 : 1;\n}\n\n// Calculate the slopes of the tangents (Hermite-type interpolation) based on\n// the following paper: Steffen, M. 1990. A Simple Method for Monotonic\n// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.\n// NOV(II), P. 443, 1990.\nfunction slope3(that, x2, y2) {\n var h0 = that._x1 - that._x0,\n h1 = x2 - that._x1,\n s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),\n s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),\n p = (s0 * h1 + s1 * h0) / (h0 + h1);\n return (sign(s0) + sign(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;\n}\n\n// Calculate a one-sided slope.\nfunction slope2(that, t) {\n var h = that._x1 - that._x0;\n return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;\n}\n\n// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations\n// \"you can express cubic Hermite interpolation in terms of cubic Bézier curves\n// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1\".\nfunction point(that, t0, t1) {\n var x0 = that._x0,\n y0 = that._y0,\n x1 = that._x1,\n y1 = that._y1,\n dx = (x1 - x0) / 3;\n that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);\n}\n\nfunction MonotoneX(context) {\n this._context = context;\n}\n\nMonotoneX.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x0 = this._x1 =\n this._y0 = this._y1 =\n this._t0 = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n switch (this._point) {\n case 2: this._context.lineTo(this._x1, this._y1); break;\n case 3: point(this, this._t0, slope2(this, this._t0)); break;\n }\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n this._line = 1 - this._line;\n },\n point: function(x, y) {\n var t1 = NaN;\n\n x = +x, y = +y;\n if (x === this._x1 && y === this._y1) return; // Ignore coincident points.\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; break;\n case 2: this._point = 3; point(this, slope2(this, t1 = slope3(this, x, y)), t1); break;\n default: point(this, this._t0, t1 = slope3(this, x, y)); break;\n }\n\n this._x0 = this._x1, this._x1 = x;\n this._y0 = this._y1, this._y1 = y;\n this._t0 = t1;\n }\n}\n\nfunction MonotoneY(context) {\n this._context = new ReflectContext(context);\n}\n\n(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {\n MonotoneX.prototype.point.call(this, y, x);\n};\n\nfunction ReflectContext(context) {\n this._context = context;\n}\n\nReflectContext.prototype = {\n moveTo: function(x, y) { this._context.moveTo(y, x); },\n closePath: function() { this._context.closePath(); },\n lineTo: function(x, y) { this._context.lineTo(y, x); },\n bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }\n};\n\nexport function monotoneX(context) {\n return new MonotoneX(context);\n}\n\nexport function monotoneY(context) {\n return new MonotoneY(context);\n}\n","function Natural(context) {\n this._context = context;\n}\n\nNatural.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = [];\n this._y = [];\n },\n lineEnd: function() {\n var x = this._x,\n y = this._y,\n n = x.length;\n\n if (n) {\n this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);\n if (n === 2) {\n this._context.lineTo(x[1], y[1]);\n } else {\n var px = controlPoints(x),\n py = controlPoints(y);\n for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {\n this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);\n }\n }\n }\n\n if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();\n this._line = 1 - this._line;\n this._x = this._y = null;\n },\n point: function(x, y) {\n this._x.push(+x);\n this._y.push(+y);\n }\n};\n\n// See https://www.particleincell.com/2012/bezier-splines/ for derivation.\nfunction controlPoints(x) {\n var i,\n n = x.length - 1,\n m,\n a = new Array(n),\n b = new Array(n),\n r = new Array(n);\n a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];\n for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];\n a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];\n for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];\n a[n - 1] = r[n - 1] / b[n - 1];\n for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];\n b[n - 1] = (x[n] + a[n - 1]) / 2;\n for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];\n return [a, b];\n}\n\nexport default function(context) {\n return new Natural(context);\n}\n","function Step(context, t) {\n this._context = context;\n this._t = t;\n}\n\nStep.prototype = {\n areaStart: function() {\n this._line = 0;\n },\n areaEnd: function() {\n this._line = NaN;\n },\n lineStart: function() {\n this._x = this._y = NaN;\n this._point = 0;\n },\n lineEnd: function() {\n if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);\n if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();\n if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;\n },\n point: function(x, y) {\n x = +x, y = +y;\n switch (this._point) {\n case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;\n case 1: this._point = 2; // falls through\n default: {\n if (this._t <= 0) {\n this._context.lineTo(this._x, y);\n this._context.lineTo(x, y);\n } else {\n var x1 = this._x * (1 - this._t) + x * this._t;\n this._context.lineTo(x1, this._y);\n this._context.lineTo(x1, y);\n }\n break;\n }\n }\n this._x = x, this._y = y;\n }\n};\n\nexport default function(context) {\n return new Step(context, 0.5);\n}\n\nexport function stepBefore(context) {\n return new Step(context, 0);\n}\n\nexport function stepAfter(context) {\n return new Step(context, 1);\n}\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { select } from 'd3-selection';\nimport { curveStepBefore, curveStepAfter, curveStep, curveLinear, curveLinearClosed, curveNatural, curveMonotoneY, curveMonotoneX, curveCatmullRomOpen, curveCatmullRomClosed, curveCatmullRom, curveCardinalOpen, curveCardinalClosed, curveCardinal, curveBundle, curveBasisOpen, curveBasisClosed, curveBasis } from 'd3-shape';\nimport CLASS from '../../config/classes.js';\nimport { KEY } from '../../module/Cache.js';\nimport { getPointer, getRectSegList } from '../../module/util/dom.js';\nimport { isValue, isObjectType, isFunction, isNumber, notEmpty, isUndefined } from '../../module/util/type-checks.js';\nimport { parseDate, getUnique, capitalize } from '../../module/util/object.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n// Module-level constant: avoids re-creating the lookup object on every getInterpolate() call\nconst CURVE_MAP = {\n basis: curveBasis,\n \"basis-closed\": curveBasisClosed,\n \"basis-open\": curveBasisOpen,\n bundle: curveBundle,\n cardinal: curveCardinal,\n \"cardinal-closed\": curveCardinalClosed,\n \"cardinal-open\": curveCardinalOpen,\n \"catmull-rom\": curveCatmullRom,\n \"catmull-rom-closed\": curveCatmullRomClosed,\n \"catmull-rom-open\": curveCatmullRomOpen,\n \"monotone-x\": curveMonotoneX,\n \"monotone-y\": curveMonotoneY,\n natural: curveNatural,\n \"linear-closed\": curveLinearClosed,\n linear: curveLinear,\n step: curveStep,\n \"step-after\": curveStepAfter,\n \"step-before\": curveStepBefore\n};\n/**\n * Check if a target can use line-like grouped point offsets.\n * @param {object} $$ ChartInternal instance\n * @param {object|string} d Data value, target or id\n * @returns {boolean} Whether target uses point-like y coordinates\n * @private\n */\nfunction isLinePointGroupType($$, d) {\n return $$.isLineType(d) || $$.isScatterType?.(d) || $$.isBubbleType?.(d);\n}\n/**\n * Get type filter for grouped line-like point offsets.\n * @param {object} $$ ChartInternal instance\n * @returns {function} Type filter\n * @private\n */\nfunction getLinePointGroupTypeFilter($$) {\n return d => isLinePointGroupType($$, d);\n}\n/**\n * Get numeric value used for stacked offset calculation.\n * @param {object} $$ ChartInternal instance\n * @param {object} d Data row\n * @returns {number|Array|object|null} Offset value\n * @private\n */\nfunction getShapeOffsetValue($$, d) {\n if ($$.isCandlestickType?.(d)) {\n return $$.getCandlestickData?.(d)?.close;\n }\n return $$.getBaseValue(d);\n}\n/**\n * Get grouped data point function for y coordinate\n * @param {object} d data vlaue\n * @returns {function|undefined}\n * @private\n */\nfunction _getGroupedDataPointsFn(d) {\n const $$ = this;\n let fn;\n if (isLinePointGroupType($$, d)) {\n const typeFilter = getLinePointGroupTypeFilter($$);\n fn = $$.generateGetLinePoints($$.getShapeIndices(typeFilter), false, typeFilter);\n }\n else if ($$.isBarType(d)) {\n fn = $$.generateGetBarPoints($$.getShapeIndices($$.isBarType));\n }\n else if ($$.isCandlestickType?.(d)) {\n fn = $$.generateGetCandlestickPoints?.($$.getShapeIndices($$.isCandlestickType));\n }\n return fn;\n}\n/**\n * Get shape color with gradient support\n * @param {object} d Data object\n * @param {string} configKey Configuration key for linearGradient (e.g., 'bar_linearGradient', 'area_linearGradient')\n * @param {(d: IDataRow) => string | null} colorFn Fallback color function when gradient is not enabled\n * @returns {string | null} Color string or gradient URL\n * @private\n */\nfunction getShapeColorWithGradient(d, configKey, colorFn) {\n return this.config[configKey] ? this.getGradienColortUrl(d.id) : colorFn(d);\n}\n/**\n * Initialize a shape element container\n * @param {ShapeElementConfig} config Configuration object\n * @private\n */\nfunction initShapeElement(config) {\n const { $el } = this;\n const { elKey, className, cssRules, position } = config;\n const container = $el.main.select(`.${CLASS.chart}`);\n $el[elKey] = position === \"first\" ?\n container.insert(\"g\", \":first-child\") :\n container.append(\"g\");\n $el[elKey].attr(\"class\", className);\n if (cssRules?.length) {\n $el[elKey].call(this.setCssRule(false, `.${className}`, cssRules));\n }\n}\n/**\n * Common update targets pattern for shapes\n * @param {Array} targets Target data\n * @param {UpdateTargetsConfig} config Configuration object\n * @returns {d3Selection} Enter selection for additional setup\n * @private\n */\nfunction updateTargetsForShape(targets, config) {\n const $$ = this;\n const { $el } = $$;\n const { type, elKey, containerClass, itemClass, initFn, withFocus = true, withStyles = true } = config;\n if (!$el[elKey]) {\n initFn.call($$);\n }\n const classChart = $$.getChartClass(type);\n const classFocus = withFocus ? $$.classFocus.bind($$) : () => \"\";\n const mainUpdate = $el.main.select(`.${containerClass}`)\n .selectAll(`.${itemClass}`)\n .data($$.filterNullish(targets))\n .attr(\"class\", d => classChart(d) + classFocus(d));\n const mainEnter = mainUpdate.enter().append(\"g\")\n .attr(\"class\", classChart);\n if (withStyles) {\n mainEnter\n .style(\"opacity\", \"0\")\n .style(\"pointer-events\", $$.getStylePropValue(\"none\"));\n }\n return mainEnter;\n}\nvar shape = {\n /**\n * Get the shape draw function\n * @returns {object}\n * @private\n */\n getDrawShape() {\n const $$ = this;\n const isRotated = $$.config.axis_rotated;\n const { hasRadar, hasTreemap } = $$.state;\n const shape = { type: {}, indices: {}, pos: {} };\n !hasTreemap && [\"bar\", \"candlestick\", \"line\", \"area\"].forEach(v => {\n const name = capitalize(v);\n if ($$.hasType(v) || $$.hasTypeOf(name) || (v === \"line\" &&\n ($$.hasType(\"bubble\") || $$.hasType(\"scatter\")))) {\n const indices = $$.getShapeIndices($$[`is${name}Type`]);\n const drawFn = $$[`generateDraw${name}`];\n shape.indices[v] = indices;\n shape.type[v] = drawFn ? drawFn.bind($$)(indices, false) : undefined;\n }\n });\n if (!$$.hasArcType() || hasRadar || hasTreemap) {\n let cx;\n let cy;\n let xForText;\n let yForText;\n // generate circle x/y functions depending on updated params\n if (!hasTreemap) {\n cx = hasRadar ? $$.radarCircleX : (isRotated ? $$.circleY : $$.circleX);\n cy = hasRadar ? $$.radarCircleY : (isRotated ? $$.circleX : $$.circleY);\n }\n if (hasTreemap && $$.state.isCanvasMode) {\n xForText = yForText = function () { };\n }\n else {\n xForText = $$.generateXYForText(shape.indices, true);\n yForText = $$.generateXYForText(shape.indices, false);\n }\n shape.pos = {\n xForText,\n yForText,\n cx: (cx || function () { }).bind($$),\n cy: (cy || function () { }).bind($$)\n };\n }\n return shape;\n },\n /**\n * Get shape's indices according it's position within each axis tick.\n *\n * From the below example, indices will be:\n * ==> {data1: 0, data2: 0, data3: 1, data4: 1, __max__: 1}\n *\n * \tdata1 data3 data1 data3\n * \tdata2 data4 data2 data4\n * \t-------------------------\n * \t\t 0 1\n * @param {function} typeFilter Chart type filter function\n * @returns {object} Indices object with its position\n */\n getShapeIndices(typeFilter) {\n const $$ = this;\n const { config } = $$;\n const xs = config.data_xs;\n const hasXs = notEmpty(xs);\n const indices = {};\n let i = hasXs ? {} : 0;\n if (hasXs) {\n getUnique(Object.keys(xs).map(v => xs[v]))\n .forEach(v => {\n i[v] = 0;\n indices[v] = {};\n });\n }\n $$.filterTargetsToShow($$.data.targets.filter(typeFilter, $$))\n .forEach(d => {\n const xKey = d.id in xs ? xs[d.id] : \"\";\n const ind = xKey ? indices[xKey] : indices;\n for (let j = 0, groups; (groups = config.data_groups[j]); j++) {\n if (groups.indexOf(d.id) < 0) {\n continue;\n }\n for (let k = 0, key; (key = groups[k]); k++) {\n if (key in ind) {\n ind[d.id] = ind[key];\n break;\n }\n // for same grouped data, add other data to same indices\n if (d.id !== key && xKey) {\n ind[key] = ind[d.id] ?? i[xKey];\n }\n }\n }\n if (isUndefined(ind[d.id])) {\n ind[d.id] = xKey ? i[xKey]++ : i++;\n ind.__max__ = (xKey ? i[xKey] : i) - 1;\n }\n });\n return indices;\n },\n /**\n * Get indices value based on data ID value\n * @param {object} indices Indices object\n * @param {object} d Data row\n * @param {string} caller Caller function name (Used only for 'sparkline' plugin)\n * @returns {object} Indices object\n * @private\n */\n getIndices(indices, d, caller) {\n const $$ = this;\n const { data_xs: xs, bar_indices_removeNull: removeNull } = $$.config;\n const { id, index } = d;\n if ($$.isBarType(id) && removeNull) {\n const ind = {};\n // redefine bar indices order\n $$.getAllValuesOnIndex(index, true)\n .forEach((v, i) => {\n ind[v.id] = i;\n ind.__max__ = i;\n });\n return ind;\n }\n return notEmpty(xs) ? indices[xs[id]] : indices;\n },\n /**\n * Get indices max number\n * @param {object} indices Indices object\n * @returns {number} Max number\n * @private\n */\n getIndicesMax(indices) {\n if (!notEmpty(this.config.data_xs)) {\n return indices.__max__;\n }\n // if is multiple xs, return total sum of xs' __max__ value\n let total = 0;\n for (const key in indices) {\n total += indices[key].__max__ || 0;\n }\n return total;\n },\n getShapeX(offset, indices, isSub) {\n const $$ = this;\n const { config, scale } = $$;\n const currScale = isSub ? scale.subX : (scale.zoom || scale.x);\n const barOverlap = config.bar_overlap;\n const barPadding = config.bar_padding;\n const sum = (p, c) => p + c;\n // total shapes half width\n const halfWidth = isObjectType(offset) && (offset._$total.length ? offset._$total.reduce(sum) / 2 : 0);\n // Pre-compute prefix sums to avoid O(n) slice+reduce on every bar datum\n const prefixSums = [];\n if (halfWidth && isObjectType(offset) && offset._$total.length) {\n let acc = 0;\n for (const v of offset._$total) {\n acc += v;\n prefixSums.push(acc);\n }\n }\n return d => {\n const ind = $$.getIndices(indices, d, \"getShapeX\");\n const index = d.id in ind ? ind[d.id] : 0;\n const targetsNum = (ind.__max__ || 0) + 1;\n let x = 0;\n if (notEmpty(d.x)) {\n const xPos = currScale(d.x, true);\n if (halfWidth) {\n const offsetWidth = offset[d.id] || offset._$width;\n x = barOverlap ? xPos - offsetWidth / 2 : xPos - offsetWidth +\n (prefixSums[index] ?? offset._$total.slice(0, index + 1).reduce(sum)) -\n halfWidth;\n }\n else {\n x = xPos - (isNumber(offset) ? offset : offset._$width) *\n (targetsNum / 2 - (barOverlap ? 1 : index));\n }\n }\n // adjust x position for bar.padding option\n if (offset && x && targetsNum > 1 && barPadding) {\n if (index) {\n x += barPadding * index;\n }\n if (targetsNum > 2) {\n x -= (targetsNum - 1) * barPadding / 2;\n }\n else if (targetsNum === 2) {\n x -= barPadding / 2;\n }\n }\n return x;\n };\n },\n getShapeY(isSub) {\n const $$ = this;\n const isStackNormalized = $$.isStackNormalized();\n return d => {\n let { value } = d;\n if (isNumber(d)) {\n value = d;\n }\n else if ($$.isAreaRangeType(d)) {\n value = $$.getBaseValue(d, \"mid\");\n }\n else if (isStackNormalized) {\n value = $$.getRatio(\"index\", d, true);\n }\n else if ($$.isBubbleZType(d)) {\n value = $$.getBubbleZData(d.value, \"y\");\n }\n else if ($$.isBarRangeType(d)) {\n // TODO use range.getEnd() like method\n value = value[1];\n }\n return $$.getYScaleById(d.id, isSub)(value);\n };\n },\n /**\n * Get shape based y Axis min value\n * @param {string} id Data id\n * @returns {number}\n * @private\n */\n getShapeYMin(id) {\n const $$ = this;\n const axisId = $$.axis.getId(id);\n const scale = $$.scale[axisId];\n const [yMin] = scale.domain();\n const inverted = $$.config[`axis_${axisId}_inverted`];\n return !$$.isGrouped(id) && !inverted && yMin > 0 ? yMin : 0;\n },\n /**\n * Get Shape's offset data\n * @param {function} typeFilter Type filter function\n * @returns {object}\n * @private\n */\n getShapeOffsetData(typeFilter) {\n const $$ = this;\n const targets = $$.orderTargets($$.filterTargetsToShow($$.data.targets.filter(typeFilter, $$)));\n // Same IDs can receive new values through load()/flow(), so ID-only\n // caching can leave stacked offsets pointing at stale row maps.\n const dataGeneration = $$.state.dataGeneration;\n const targetIds = targets.map(t => t.id).join(\"_\");\n const cacheKey = `${KEY.shapeOffset}_${targetIds}`;\n // Check if result is already cached\n const cachedData = $$.cache.get(cacheKey);\n if (cachedData?.generation === dataGeneration) {\n return cachedData;\n }\n const isStackNormalized = $$.isStackNormalized();\n const shapeOffsetTargets = targets.map(target => {\n let rowValues = target.values;\n const values = {};\n if ($$.isStepType(target)) {\n rowValues = $$.convertValuesToStep(rowValues);\n }\n const rowValueMapByXValue = rowValues.reduce((out, d) => {\n const key = Number(d.x);\n const value = getShapeOffsetValue($$, d);\n out[key] = d;\n values[key] = isStackNormalized ? $$.getRatio(\"index\", d, true) : value;\n return out;\n }, {});\n return {\n id: target.id,\n rowValues,\n rowValueMapByXValue,\n values\n };\n });\n const indexMapByTargetId = targets.reduce((out, { id }, index) => {\n out[id] = index;\n return out;\n }, {});\n const result = { generation: dataGeneration, indexMapByTargetId, shapeOffsetTargets };\n // Cache the result\n $$.cache.add(cacheKey, result);\n return result;\n },\n getShapeOffset(typeFilter, indices, isSub) {\n const $$ = this;\n const { shapeOffsetTargets, indexMapByTargetId } = $$.getShapeOffsetData(typeFilter);\n const groupsZeroAs = $$.config.data_groupsZeroAs;\n // Pre-build per-series same-stacking-group lookup to avoid .filter() on every datum.\n // bar_indices_removeNull recomputes group membership per-datum index, so fall back there.\n let sameGroupByTargetId = null;\n if (!$$.config.bar_indices_removeNull) {\n sameGroupByTargetId = new Map();\n for (const target of shapeOffsetTargets) {\n const ind = $$.getIndices(indices, { id: target.id, index: 0 });\n sameGroupByTargetId.set(target.id, shapeOffsetTargets.filter(t => t.id !== target.id && ind[t.id] === ind[target.id]));\n }\n }\n return (d, idx) => {\n const { id, value, x } = d;\n const baseValue = getShapeOffsetValue($$, d);\n const ind = $$.getIndices(indices, d);\n const scale = $$.getYScaleById(id, isSub);\n if ($$.isBarRangeType(d)) {\n // TODO use range.getStart()\n return scale(value[0]);\n }\n const dataXAsNumber = Number(x);\n const y0 = scale(groupsZeroAs === \"zero\" ? 0 : $$.getShapeYMin(id));\n let offset = y0;\n const sameGroupTargets = sameGroupByTargetId?.get(id) ??\n shapeOffsetTargets.filter(t => t.id !== id && ind[t.id] === ind[id]);\n for (const t of sameGroupTargets) {\n const { id: tid, rowValueMapByXValue, rowValues, values: tvalues } = t;\n // for same stacked group (ind[tid] === ind[id])\n if (indexMapByTargetId[tid] < indexMapByTargetId[id]) {\n const rValue = tvalues[dataXAsNumber];\n let row = rowValues[idx];\n // check if the x values line up\n if (!row || Number(row.x) !== dataXAsNumber) {\n row = rowValueMapByXValue[dataXAsNumber];\n }\n const rowValue = row && getShapeOffsetValue($$, row);\n if (isNumber(rowValue) &&\n isNumber(baseValue) &&\n rowValue * baseValue >= 0 &&\n isNumber(rValue)) {\n const addOffset = baseValue === 0 ?\n ((groupsZeroAs === \"positive\" &&\n rValue > 0) ||\n (groupsZeroAs === \"negative\" && rValue < 0)) :\n true;\n if (addOffset) {\n offset += scale(rValue) - y0;\n }\n }\n }\n }\n return offset;\n };\n },\n /**\n * Generate line coordinate points from shared geometry.\n * @param {object} lineIndices Data order within x axis\n * @param {boolean} isSub Whether the coordinates are for subchart\n * @param {function} typeFilter Type filter for offset targets\n * @returns {function} Line point generator\n * @private\n */\n generateGetLinePoints(lineIndices, isSub, typeFilter) {\n const $$ = this;\n const { config } = $$;\n const x = $$.getShapeX(0, lineIndices, isSub);\n const y = $$.getShapeY(isSub);\n const lineOffset = $$.getShapeOffset(typeFilter || $$.isLineType, lineIndices, isSub);\n const yScale = $$.getYScaleById.bind($$);\n return (d, i) => {\n const y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id));\n const offset = lineOffset(d, i) || y0;\n const posX = x(d);\n let posY = y(d);\n if (config.axis_rotated && ((d.value > 0 && posY < y0) || (d.value < 0 && y0 < posY))) {\n posY = y0;\n }\n const point = [posX, posY - (y0 - offset)];\n return [\n point,\n point,\n point,\n point\n ];\n };\n },\n /**\n * Generate area coordinate points from shared geometry.\n * @param {object} areaIndices Data order within x axis\n * @param {boolean} isSub Whether the coordinates are for subchart\n * @returns {function} Area point generator\n * @private\n */\n generateGetAreaPoints(areaIndices, isSub) {\n const $$ = this;\n const { config } = $$;\n const x = $$.getShapeX(0, areaIndices, isSub);\n const y = $$.getShapeY(!!isSub);\n const areaOffset = $$.getShapeOffset($$.isAreaType, areaIndices, isSub);\n const yScale = $$.getYScaleById.bind($$);\n // per-series cache: y0 depends only on the id and is stable within one draw pass\n const y0Cache = new Map();\n return function (d, i) {\n let y0 = y0Cache.get(d.id);\n if (y0 === undefined) {\n y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id));\n y0Cache.set(d.id, y0);\n }\n const offset = areaOffset(d, i) || y0;\n const posX = x(d);\n const value = d.value;\n let posY = y(d);\n if (config.axis_rotated && ((value > 0 && posY < y0) || (value < 0 && y0 < posY))) {\n posY = y0;\n }\n return [\n [posX, offset],\n [posX, posY - (y0 - offset)],\n [posX, posY - (y0 - offset)],\n [posX, offset]\n ];\n };\n },\n /**\n * Generate bar coordinate points from shared geometry.\n * @param {object} barIndices Data order within x axis\n * @param {boolean} isSub Whether the coordinates are for subchart\n * @returns {function} Bar point generator\n * @private\n */\n generateGetBarPoints(barIndices, isSub) {\n const $$ = this;\n const { config } = $$;\n const axis = isSub ? $$.axis.subX : $$.axis.x;\n const barTargetsNum = $$.getIndicesMax(barIndices) + 1;\n const barW = $$.getBarW(\"bar\", axis, barTargetsNum);\n const barX = $$.getShapeX(barW, barIndices, !!isSub);\n const barY = $$.getShapeY(!!isSub);\n const barOffset = $$.getShapeOffset($$.isBarType, barIndices, !!isSub);\n const yScale = $$.getYScaleById.bind($$);\n // per-series cache: y0/isInverted depend only on the id and are stable within one draw pass\n const idCache = new Map();\n return (d, i) => {\n const { id } = d;\n let idInfo = idCache.get(id);\n if (!idInfo) {\n idInfo = {\n y0: yScale.call($$, id, isSub)($$.getShapeYMin(id)),\n isInverted: config[`axis_${$$.axis.getId(id)}_inverted`]\n };\n idCache.set(id, idInfo);\n }\n const { y0, isInverted } = idInfo;\n const offset = barOffset(d, i) || y0;\n const width = isNumber(barW) ? barW : barW[d.id] || barW._$width;\n const value = d.value;\n const posX = barX(d);\n let posY = barY(d);\n if (config.axis_rotated && !isInverted && ((value > 0 && posY < y0) || (value < 0 && y0 < posY))) {\n posY = y0;\n }\n if (!$$.isBarRangeType(d)) {\n posY -= y0 - offset;\n }\n const startPosX = posX + width;\n return [\n [posX, offset],\n [posX, posY],\n [startPosX, posY],\n [startPosX, offset]\n ];\n };\n },\n /**\n * Get data's y coordinate\n * @param {object} d Target data\n * @param {number} i Index number\n * @returns {number} y coordinate\n * @private\n */\n circleY(d, i) {\n const $$ = this;\n const id = d.id;\n let points;\n if ($$.isGrouped(id)) {\n points = _getGroupedDataPointsFn.bind($$)(d);\n }\n return points ? points(d, i)[0][1] : $$.getYScaleById(id)($$.getBaseValue(d));\n },\n /**\n * Get data point x coordinate.\n * @param {object} d Data row\n * @returns {number|null} X coordinate\n * @private\n */\n circleX(d) {\n return this.xx(d);\n },\n /**\n * Generate data point y coordinate accessor.\n * @param {boolean} isSub Whether the coordinates are for subchart\n * @returns {function} Y coordinate accessor\n * @private\n */\n updateCircleY(isSub = false) {\n const $$ = this;\n const typeFilter = getLinePointGroupTypeFilter($$);\n const getPoints = $$.generateGetLinePoints($$.getShapeIndices(typeFilter), isSub, typeFilter);\n return (d, i) => {\n const id = d.id;\n return $$.isGrouped(id) && isLinePointGroupType($$, d) ?\n getPoints(d, i)[0][1] :\n $$.getYScaleById(id, isSub)($$.getBaseValue(d));\n };\n },\n /**\n * Get point radius.\n * @param {object} d Data row\n * @returns {number} Point radius\n * @private\n */\n pointR(d) {\n const $$ = this;\n const { config } = $$;\n const pointR = config.point_r;\n let r = pointR;\n if ($$.isBubbleType(d)) {\n r = $$.getBubbleR(d);\n }\n else if (isFunction(pointR)) {\n r = pointR.bind($$.api)(d);\n }\n d.r = r;\n return r;\n },\n /**\n * Get focused point radius.\n * @param {object} d Data row\n * @returns {number} Focused point radius\n * @private\n */\n pointExpandedR(d) {\n const $$ = this;\n const { config } = $$;\n const scale = $$.isBubbleType(d) ? 1.15 : 1.75;\n return config.point_focus_expand_enabled ?\n (config.point_focus_expand_r || $$.pointR(d) * scale) :\n $$.pointR(d);\n },\n /**\n * Get selected point radius.\n * @param {object} d Data row\n * @returns {number} Selected point radius\n * @private\n */\n pointSelectR(d) {\n const $$ = this;\n const selectR = $$.config.point_select_r;\n return isFunction(selectR) ? selectR(d) : (selectR || $$.pointR(d) * 4);\n },\n /**\n * Check if point.focus.only option can be applied.\n * @returns {boolean} Whether focus-only point rendering is active\n * @private\n */\n isPointFocusOnly() {\n const $$ = this;\n return $$.config.point_focus_only &&\n !$$.hasType(\"bubble\") && !$$.hasType(\"scatter\") && !$$.hasArcType(null, [\"radar\"]);\n },\n /**\n * Get data point sensitivity radius.\n * @param {object} d Data point\n * @returns {number} Sensitivity radius\n * @private\n */\n getPointSensitivity(d) {\n const $$ = this;\n let sensitivity = $$.config.point_sensitivity;\n if (!d) {\n return sensitivity;\n }\n else if (isFunction(sensitivity)) {\n sensitivity = sensitivity.call($$.api, d);\n }\n else if (sensitivity === \"radius\") {\n sensitivity = d.r;\n }\n return sensitivity;\n },\n getBarW(type, axis, targetsNum) {\n const $$ = this;\n const { config, org, scale, state } = $$;\n const maxDataCount = $$.getMaxDataCount();\n const isGrouped = type === \"bar\" && config.data_groups?.length;\n const configName = `${type}_width`;\n const { k } = $$.getZoomTransform?.() ?? { k: 1 };\n const xMinMax = [\n config.axis_x_min ?? org.xDomain[0],\n config.axis_x_max ?? org.xDomain[1]\n ].map(v => ($$.axis.isTimeSeries() ? parseDate.call($$, v) : Number(v)));\n let tickInterval = axis.tickInterval(maxDataCount);\n if (scale.zoom && !$$.axis.isCategorized() && k > 1) {\n const isSameMinMax = xMinMax.every((v, i) => v === org.xDomain[i]);\n tickInterval = org.xDomain.map((v, i) => {\n const value = isSameMinMax ? v : v - Math.abs(xMinMax[i]);\n return scale.zoom(value);\n }).reduce((a, c) => Math.abs(a) + c) / maxDataCount;\n }\n const getWidth = (id) => {\n const width = id ? config[configName][id] : config[configName];\n const ratio = id ? width.ratio : config[`${configName}_ratio`];\n const max = id ? width.max : config[`${configName}_max`];\n const w = isNumber(width) ? width : (isFunction(width) ?\n width.call($$, state.width, targetsNum, maxDataCount) :\n (targetsNum ? (tickInterval * ratio) / targetsNum : 0));\n return max && w > max ? max : w;\n };\n let result = getWidth();\n if (!isGrouped && isObjectType(config[configName])) {\n result = { _$width: result, _$total: [] };\n $$.getTargetsToShow().forEach(v => {\n if (config[configName][v.id]) {\n result[v.id] = getWidth(v.id);\n result._$total.push(result[v.id] || result._$width);\n }\n });\n }\n return result;\n },\n /**\n * Get shape element\n * @param {string} shapeName Shape string\n * @param {number} i Index number\n * @param {string} id Data series id\n * @returns {d3Selection}\n * @private\n */\n getShapeByIndex(shapeName, i, id) {\n const $$ = this;\n const { $el } = $$;\n const suffix = isValue(i) ? `-${i}` : ``;\n let shape = $el[shapeName];\n // filter from shape reference if has\n if (shape && !shape.empty()) {\n shape = shape\n .filter(d => (id ? d.id === id : true))\n .filter(d => (isValue(i) ? d.index === i : true));\n }\n else {\n shape = (id ?\n $el.main\n .selectAll(`.${CLASS[`${shapeName}s`]}${$$.getTargetSelectorSuffix(id)}`) :\n $el.main)\n .selectAll(`.${CLASS[shapeName]}${suffix}`);\n }\n return shape;\n },\n isWithinShape(that, d) {\n const $$ = this;\n const shape = select(that);\n let isWithin;\n if (!$$.isTargetToShow(d.id)) {\n isWithin = false;\n }\n else if ($$.hasValidPointType?.(that.nodeName)) {\n isWithin = $$.isStepType(d) ?\n $$.isWithinStep(that, $$.getYScaleById(d.id)($$.getBaseValue(d))) :\n $$.isWithinCircle(that, $$.isBubbleType(d) ? $$.pointSelectR(d) * 1.5 : 0);\n }\n else if (that.nodeName === \"path\") {\n isWithin = shape.classed(CLASS.bar) ? $$.isWithinBar(that) : true;\n }\n return isWithin;\n },\n getInterpolate(d) {\n const $$ = this;\n const interpolation = $$.getInterpolateType(d);\n return CURVE_MAP[interpolation];\n },\n /**\n * Get curve generator for line-like shapes.\n * @param {object} d Data target\n * @returns {function} Curve generator\n * @private\n */\n getCurve(d) {\n const $$ = this;\n const isRotatedStepType = $$.config.axis_rotated && $$.isStepType(d);\n // when is step & rotated, should be computed in different way\n // https://github.com/naver/billboard.js/issues/471\n return isRotatedStepType ?\n context => {\n const step = $$.getInterpolate(d)(context);\n // keep the original method\n step.orgPoint = step.point;\n // to get rotated path data\n step.pointRotated = function (x, y) {\n this._point === 1 && (this._point = 2);\n const y1 = this._y * (1 - this._t) + y * this._t;\n this._context.lineTo(this._x, y1);\n this._context.lineTo(x, y1);\n this._x = x;\n this._y = y;\n };\n step.point = function (x, y) {\n this._point === 0 ? this.orgPoint(x, y) : this.pointRotated(x, y);\n };\n return step;\n } :\n $$.getInterpolate(d);\n },\n getInterpolateType(d) {\n const $$ = this;\n const { config } = $$;\n const type = config.spline_interpolation_type;\n const interpolation = $$.isInterpolationType(type) ? type : \"cardinal\";\n return $$.isSplineType(d) ? interpolation : ($$.isStepType(d) ? config.line_step_type : \"linear\");\n },\n isWithinBar(that) {\n const mouse = getPointer(this.state.event, that);\n const list = getRectSegList(that);\n const [seg0, seg1, seg2] = list;\n const x = Math.min(seg0.x, seg1.x);\n const y = Math.min(seg0.y, seg1.y);\n const offset = this.config.bar_sensitivity;\n const width = Math.abs(seg2.x - seg1.x);\n const height = Math.abs(seg0.y - seg1.y);\n const sx = x - offset;\n const ex = x + width + offset;\n const sy = y + height + offset;\n const ey = y - offset;\n const isWithin = sx < mouse[0] &&\n mouse[0] < ex &&\n ey < mouse[1] &&\n mouse[1] < sy;\n return isWithin;\n }\n};\n\nexport { shape as default, getShapeColorWithGradient, initShapeElement, updateTargetsForShape };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { select } from 'd3-selection';\nimport { timeParse, utcParse, timeFormat, utcFormat } from 'd3-time-format';\nimport { $COMMON, $TEXT, $CIRCLE } from '../config/classes.js';\nimport Options from '../config/Options/Options.js';\nimport Store from '../config/Store/Store.js';\nimport { document as doc, window as win } from '../module/browser.js';\nimport Cache from '../module/Cache.js';\nimport { checkModuleImport } from '../module/error.js';\nimport { generateResize } from '../module/generator.js';\nimport dataConvert from './data/convert.js';\nimport data from './data/data.js';\nimport dataLoad from './data/load.js';\nimport interaction from './interactions/interaction.js';\nimport category from './internals/category.js';\nimport classModule from './internals/class.js';\nimport color from './internals/color.js';\nimport domain from './internals/domain.js';\nimport format from './internals/format.js';\nimport legend from './internals/legend.js';\nimport redraw from './internals/redraw.js';\nimport scale from './internals/scale.js';\nimport size from './internals/size.js';\nimport style from './internals/style.js';\nimport text from './internals/text.js';\nimport title from './internals/title.js';\nimport tooltip from './internals/tooltip.js';\nimport transform from './internals/transform.js';\nimport typeInternals from './internals/type.js';\nimport shape from './shape/shape.js';\nimport { callFn, getRandom, sortValue, capitalize, getOption, extend } from '../module/util/object.js';\nimport { isFunction, notEmpty, isObject, isBoolean, isString } from '../module/util/type-checks.js';\nimport { convertInputType, hasStyle } from '../module/util/dom.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n * @ignore\n */\n/**\n * Get SVG-only chart type reason for canvas render fallback.\n * @param {object} $$ ChartInternal instance\n * @returns {string|null} Unsupported chart type reason\n * @private\n */\nfunction getUnsupportedCanvasRenderType($$) {\n if ($$.hasArcType()) {\n return \"arc charts\";\n }\n if ($$.hasType(\"funnel\")) {\n return \"funnel chart\";\n }\n return null;\n}\n/**\n * Fall back to SVG when canvas mode is requested for unsupported chart types.\n * @param {object} $$ ChartInternal instance\n * @private\n */\nfunction fallbackUnsupportedCanvasRenderMode($$) {\n const { config } = $$;\n const unsupportedType = config.render_mode === \"canvas\" ?\n getUnsupportedCanvasRenderType($$) :\n null;\n if (!unsupportedType) {\n return;\n }\n win.console?.warn?.(`[billboard.js] render.mode='canvas' is ignored for ${unsupportedType}; falling back to SVG.`);\n config.render_mode = \"svg\";\n}\n/**\n * Internal chart class.\n * - Note: Instantiated internally, not exposed for public.\n * @class ChartInternal\n * @ignore\n * @private\n */\nclass ChartInternal {\n api; // API interface\n config; // config object\n cache; // cache instance\n $el; // elements\n state; // state variables\n charts; // all Chart instances array within page (equivalent of 'bb.instances')\n // data object\n data = {\n xs: {},\n targets: []\n };\n // Axis\n axis; // Axis\n // scales\n scale = {\n x: null,\n y: null,\n y2: null,\n subX: null,\n subY: null,\n subY2: null,\n zoom: null\n };\n // original values\n org = {\n xScale: null,\n xDomain: null\n };\n // formatter function\n color;\n patterns;\n levelColor;\n point;\n brush;\n // format function\n format = {\n extraLineClasses: null,\n xAxisTick: null,\n dataTime: null, // dataTimeFormat\n defaultAxisTime: null, // defaultAxisTimeFormat\n axisTime: null // axisTimeFormat\n };\n constructor(api) {\n const $$ = this;\n $$.api = api; // Chart class instance alias\n $$.config = new Options();\n $$.cache = new Cache();\n const store = new Store();\n $$.$el = store.getStore(\"element\");\n $$.state = store.getStore(\"state\");\n $$.$T = $$.$T.bind($$);\n }\n /**\n * Get the selection based on transition config\n * @param {SVGElement|d3Selection} selection Target selection\n * @param {boolean} force Force transition\n * @param {string} name Transition name\n * @returns {d3Selection}\n * @private\n */\n $T(selection, force, name) {\n const { config, state } = this;\n const duration = config.transition_duration;\n const subchart = config.subchart_show;\n let t = selection;\n if (t) {\n // in case of non d3 selection, wrap with d3 selection\n if (\"tagName\" in t) {\n t = select(t);\n }\n // do not transit on:\n // - wheel zoom (state.zooming = true)\n // - when has no subchart\n // - initialization\n // - resizing\n const transit = ((force !== false && duration) || force) &&\n (!state.zooming || state.dragging) &&\n !state.resizing &&\n state.rendered &&\n !subchart;\n // @ts-ignore\n t = (transit ? t.transition(name).duration(duration) : t);\n }\n return t;\n }\n beforeInit() {\n const $$ = this;\n $$.callPluginHook(\"$beforeInit\");\n // can do something\n callFn($$.config.onbeforeinit, $$.api);\n }\n afterInit() {\n const $$ = this;\n $$.callPluginHook(\"$afterInit\");\n // can do something\n callFn($$.config.onafterinit, $$.api);\n }\n init() {\n const $$ = this;\n const { config, state, $el } = $$;\n const { boost_useCssRule, bindto } = config;\n checkModuleImport($$);\n fallbackUnsupportedCanvasRenderMode($$);\n const hasArcType = $$.hasArcType();\n state.hasRadar = !state.hasAxis && $$.hasType(\"radar\");\n state.hasFunnel = !state.hasAxis && $$.hasType(\"funnel\");\n state.hasTreemap = !state.hasAxis && $$.hasType(\"treemap\");\n state.hasAxis = !hasArcType && !state.hasFunnel && !state.hasTreemap;\n // datetime to be used for uniqueness\n state.datetimeId = `bb-${+new Date() * getRandom()}`;\n if (boost_useCssRule) {\n // append style element\n const styleEl = doc.createElement(\"style\");\n // styleEl.id = styleId;\n styleEl.type = \"text/css\";\n doc.head.appendChild(styleEl);\n state.style = {\n rootSelector: `.${state.datetimeId}`,\n sheet: styleEl.sheet\n };\n // used on .destroy()\n $el.style = styleEl;\n }\n const bindConfig = {\n element: bindto,\n classname: \"bb\"\n };\n if (isObject(bindto)) {\n bindConfig.element = bindto.element || \"#chart\";\n bindConfig.classname = bindto.classname || bindConfig.classname;\n }\n // select bind element\n $el.chart = isFunction(bindConfig.element.node) ?\n bindto.element :\n select(bindConfig.element || []);\n if ($el.chart.empty()) {\n $el.chart = select(doc.body.appendChild(doc.createElement(\"div\")));\n }\n $el.chart.html(\"\")\n .classed(bindConfig.classname, true)\n .classed(state.datetimeId, boost_useCssRule)\n .style(\"position\", \"relative\");\n $$.initParams();\n $$.initToRender();\n }\n /**\n * Initialize the rendering process\n * @param {boolean} forced Force to render process\n * @private\n */\n initToRender(forced) {\n const $$ = this;\n const { config, state, $el: { chart } } = $$;\n const isHidden = () => hasStyle(chart, { display: \"none\", visibility: \"hidden\" });\n const isLazy = config.render.lazy === false ? false : config.render.lazy || isHidden();\n const MutationObserver = win.MutationObserver;\n if (isLazy && MutationObserver && config.render.observe !== false && !forced) {\n new MutationObserver((mutation, observer) => {\n if (!isHidden()) {\n observer.disconnect();\n !state.rendered && $$.initToRender(true);\n }\n }).observe(chart.node(), {\n attributes: true,\n attributeFilter: [\"class\", \"style\"]\n });\n }\n if (!isLazy || forced) {\n $$.convertData(config, res => {\n $$.initWithData(res);\n $$.afterInit();\n });\n }\n }\n initParams() {\n const $$ = this;\n const { config, format, state } = $$;\n if (config.render_mode === \"canvas\") {\n $$.prepareCanvasConfig?.();\n }\n // color settings\n $$.color = $$.generateColor();\n $$.levelColor = $$.generateLevelColor();\n // when 'padding=false' is set, disable axes and subchart. Because they are useless.\n if (config.padding === false) {\n config.axis_x_show = false;\n config.axis_y_show = false;\n config.axis_y2_show = false;\n config.subchart_show = false;\n }\n if (config.render_mode !== \"canvas\" && ($$.hasPointType() || $$.hasLegendDefsPoint?.())) {\n $$.point = $$.generatePoint();\n }\n if (state.hasAxis) {\n $$.initClip();\n format.extraLineClasses = $$.generateExtraLineClass();\n format.dataTime = config.data_xLocaltime ? timeParse : utcParse;\n format.axisTime = config.axis_x_localtime ? timeFormat : utcFormat;\n const isDragZoom = config.zoom_enabled && config.zoom_type === \"drag\";\n format.defaultAxisTime = d => {\n const { x, zoom } = $$.scale;\n const isZoomed = isDragZoom ?\n zoom :\n zoom && x.orgDomain().toString() !== zoom.domain().toString();\n const specifier = (d.getMilliseconds() && \".%L\") ||\n (d.getSeconds() && \".:%S\") ||\n (d.getMinutes() && \"%I:%M\") ||\n (d.getHours() && \"%I %p\") ||\n (d.getDate() !== 1 && \"%b %d\") ||\n (isZoomed && d.getDate() === 1 && \"%b'%y\") ||\n (d.getMonth() && \"%-m/%-d\") || \"%Y\";\n return format.axisTime(specifier)(d);\n };\n }\n const { legend_position, legend_inset_anchor, axis_rotated } = config;\n state.isLegendRight = legend_position === \"right\";\n state.isLegendInset = legend_position === \"inset\";\n state.isLegendTop = legend_inset_anchor === \"top-left\" ||\n legend_inset_anchor === \"top-right\";\n state.isLegendLeft = legend_inset_anchor === \"top-left\" ||\n legend_inset_anchor === \"bottom-left\";\n state.rotatedPadding.top = $$.getResettedPadding(state.rotatedPadding.top);\n state.rotatedPadding.right = axis_rotated && !config.axis_x_show ? 0 : 30;\n state.inputType = convertInputType(config.interaction_inputType_mouse, config.interaction_inputType_touch);\n }\n initWithData(data) {\n const $$ = this;\n const { config, scale, state, $el, org } = $$;\n const { hasAxis, hasFunnel, hasTreemap } = state;\n const hasInteraction = config.interaction_enabled;\n const hasPolar = $$.hasType(\"polar\");\n const labelsBGColor = config.data_labels_backgroundColors;\n // for arc type, set axes to not be shown\n // $$.hasArcType() && [\"x\", \"y\", \"y2\"].forEach(id => (config[`axis_${id}_show`] = false));\n if (hasAxis) {\n $$.axis = $$.getAxisInstance();\n config.zoom_enabled && $$.initZoom();\n }\n // Init data as targets\n $$.data.xs = {};\n $$.data.targets = $$.convertDataToTargets(data);\n if (config.data_filter) {\n $$.data.targets = $$.data.targets.filter(config.data_filter.bind($$.api));\n }\n // Set targets to hide if needed\n if (config.data_hide) {\n $$.addHiddenTargetIds(config.data_hide === true ? $$.mapToIds($$.data.targets) : config.data_hide);\n }\n if (config.legend_hide) {\n $$.addHiddenLegendIds(config.legend_hide === true ? $$.mapToIds($$.data.targets) : config.legend_hide);\n }\n // Init sizes and scales\n $$.updateSizes();\n $$.updateScales(true);\n // retrieve scale after the 'updateScales()' is called\n if (hasAxis) {\n const { x, y, y2, subX, subY, subY2 } = scale;\n // Set domains for each scale\n if (x) {\n x.domain(sortValue($$.getXDomain($$.data.targets), !config.axis_x_inverted));\n subX.domain(x.domain());\n // Save original x domain for zoom update\n org.xDomain = x.domain();\n }\n if (y) {\n y.domain($$.getYDomain($$.data.targets, \"y\"));\n subY.domain(y.domain());\n }\n if (y2) {\n y2.domain($$.getYDomain($$.data.targets, \"y2\"));\n subY2 && subY2.domain(y2.domain());\n }\n }\n if (config.render_mode === \"canvas\") {\n if (!$$.initCanvas) {\n throw Error(\"[billboard.js] Please import and call canvas() to use render.mode='canvas'.\");\n }\n // Bind resize event before tooltip init because tooltip position registers resize hooks.\n $$.bindResize();\n $$.initCanvas();\n config.tooltip_show && $$.initTooltip();\n $$.callPluginHook(\"$init\");\n // oninit callback\n callFn(config.oninit, $$.api);\n $$.redraw({\n withTransition: false,\n withTransform: true,\n withUpdateXDomain: true,\n withUpdateOrgXDomain: true,\n withTransitionForAxis: false,\n initializing: true\n });\n // data.onmin/max callback\n if (config.data_onmin || config.data_onmax) {\n const minMax = $$.getMinMaxData();\n callFn(config.data_onmin, $$.api, minMax.min);\n callFn(config.data_onmax, $$.api, minMax.max);\n }\n state.rendered = true;\n return;\n }\n // -- Basic Elements --\n $el.svg = $el.chart.append(\"svg\")\n .style(\"overflow\", \"hidden\")\n .style(\"display\", \"block\");\n if (hasInteraction && state.inputType) {\n const isTouch = state.inputType === \"touch\";\n const { onclick, onover, onout } = config;\n const preventDefault = config.interaction_inputType_touch?.preventDefault;\n const isPrevented = (isBoolean(preventDefault) && preventDefault) || false;\n const preventThreshold = (!isNaN(preventDefault) && preventDefault) || null;\n const touchOption = isTouch ?\n {\n passive: !isPrevented && preventThreshold === null\n } :\n undefined;\n $el.svg\n .on(\"click\", onclick?.bind($$.api) || null)\n .on(isTouch ? \"touchstart\" : \"mouseenter\", onover?.bind($$.api) || null, touchOption)\n .on(isTouch ? \"touchend\" : \"mouseleave\", onout?.bind($$.api) || null);\n }\n config.svg_classname && $el.svg.attr(\"class\", config.svg_classname);\n // Define defs\n const hasColorPatterns = isFunction(config.color_tiles) && $$.patterns;\n if (hasAxis || hasColorPatterns || hasPolar || hasTreemap ||\n labelsBGColor || $$.hasLegendDefsPoint?.()) {\n $el.defs = $el.svg.append(\"defs\");\n if (hasAxis) {\n [\"id\", \"idXAxis\", \"idYAxis\", \"idGrid\"].forEach(v => {\n $$.appendClip($el.defs, state.clip[v]);\n });\n }\n // Append data background color filter definition\n $$.generateTextBGColorFilter(labelsBGColor);\n // set color patterns\n if (hasColorPatterns) {\n $$.patterns.forEach(p => $el.defs.append(() => p.node));\n }\n }\n $$.updateSvgSize();\n // Bind resize event\n $$.bindResize();\n // Define regions\n const main = $el.svg.append(\"g\")\n .classed($COMMON.main, true)\n .attr(\"transform\", hasFunnel || hasTreemap ? null : $$.getTranslate(\"main\"));\n $el.main = main;\n // initialize subchart when subchart show option is set\n config.subchart_show && $$.initSubchart();\n config.tooltip_show && $$.initTooltip();\n config.title_text && $$.initTitle();\n !hasTreemap && config.legend_show && $$.initLegend();\n // -- Main Region --\n // text when empty\n if (config.data_empty_label_text) {\n main.append(\"text\")\n .attr(\"class\", `${$TEXT.text} ${$COMMON.empty}`)\n .attr(\"text-anchor\", \"middle\") // horizontal centering of text at x position in all browsers.\n .attr(\"dominant-baseline\", \"middle\"); // vertical centering of text at y position in all browsers, except IE.\n }\n if (hasAxis) {\n // Regions (optional module — initRegion installed by regions resolver)\n config.regions.length && $$.initRegion?.();\n // Add Axis here, when clipPath is 'false'\n !config.clipPath && $$.axis.init();\n }\n // Define g for chart area\n main.append(\"g\")\n .classed($COMMON.chart, true)\n .attr(\"clip-path\", hasAxis ? state.clip.path : null);\n $$.callPluginHook(\"$init\");\n $$.initChartElements();\n if (hasAxis) {\n // Cover whole with rects for events\n hasInteraction && $$.initEventRect?.();\n // Grids (optional module — initGrid installed by grid resolver)\n $$.initGrid?.();\n // Add Axis here, when clipPath is 'true'\n config.clipPath && $$.axis?.init();\n }\n // Set targets\n $$.updateTargets($$.data.targets);\n // Draw with targets\n $$.updateDimension();\n // oninit callback\n callFn(config.oninit, $$.api);\n // Set background\n $$.setBackground();\n $$.redraw({\n withTransition: false,\n withTransform: true,\n withUpdateXDomain: true,\n withUpdateOrgXDomain: true,\n withTransitionForAxis: false,\n initializing: true\n });\n // data.onmin/max callback\n if (config.data_onmin || config.data_onmax) {\n const minMax = $$.getMinMaxData();\n callFn(config.data_onmin, $$.api, minMax.min);\n callFn(config.data_onmax, $$.api, minMax.max);\n }\n config.tooltip_show && $$.initShowTooltip();\n state.rendered = true;\n }\n /**\n * Initialize chart elements\n * @private\n */\n initChartElements() {\n const $$ = this;\n const { hasAxis, hasRadar, hasTreemap } = $$.state;\n const types = [];\n if (hasAxis) {\n const shapes = [\"bar\", \"bubble\", \"candlestick\", \"line\"];\n if ($$.config.bar_front) {\n shapes.push(shapes.shift());\n }\n for (const shape of shapes) {\n const name = capitalize(shape);\n if ((shape === \"line\" && $$.hasTypeOf(name)) || $$.hasType(shape)) {\n types.push(name);\n }\n }\n }\n else if (hasTreemap) {\n types.push(\"Treemap\");\n }\n else if ($$.hasType(\"funnel\")) {\n types.push(\"Funnel\");\n }\n else {\n const hasPolar = $$.hasType(\"polar\");\n const hasGauge = $$.hasType(\"gauge\");\n if (!hasRadar) {\n types.push(\"Arc\", \"Pie\");\n }\n if (hasGauge) {\n types.push(\"Gauge\");\n }\n else if (hasRadar) {\n types.push(\"Radar\");\n }\n else if (hasPolar) {\n types.push(\"Polar\");\n }\n }\n for (const type of types) {\n $$[`init${type}`]();\n }\n if (notEmpty($$.config.data_labels) && !$$.hasArcType(null, [\"radar\"])) {\n $$.initText();\n }\n }\n /**\n * Set chart elements\n * @private\n */\n setChartElements() {\n const $$ = this;\n const { $el: { chart, svg, defs, main, tooltip, legend, title, canvas, eventOverlay, grid, needle, arcs: arc, circle: circles, bar: bars, candlestick, line: lines, area: areas, text: texts } } = $$;\n // public\n $$.api.$ = {\n chart,\n svg,\n canvas,\n eventOverlay,\n defs,\n main,\n tooltip,\n legend,\n title,\n grid,\n arc,\n circles,\n bar: { bars },\n candlestick,\n line: { lines, areas },\n needle,\n text: { texts }\n };\n }\n /**\n * Set background element/image\n * @private\n */\n setBackground() {\n const $$ = this;\n const { config: { background: bg }, state, $el: { svg } } = $$;\n if (notEmpty(bg)) {\n const element = svg.select(\"g\")\n .insert(bg.imgUrl ? \"image\" : \"rect\", \":first-child\");\n if (bg.imgUrl) {\n element.attr(\"href\", bg.imgUrl);\n }\n else if (bg.color) {\n element\n .style(\"fill\", bg.color)\n .attr(\"clip-path\", state.clip.path);\n }\n element\n .attr(\"class\", bg.class || null)\n .attr(\"width\", \"100%\")\n .attr(\"height\", \"100%\");\n }\n }\n /**\n * Update targeted element with given data\n * @param {object} targets Data object formatted as 'target'\n * @private\n */\n updateTargets(targets) {\n const $$ = this;\n const { hasAxis, hasFunnel, hasRadar, hasTreemap } = $$.state;\n const helper = type => $$[`updateTargetsFor${type}`](targets.filter($$[`is${type}Type`].bind($$)));\n // Text\n $$.updateTargetsForText(targets);\n if (hasAxis) {\n const shapes = [\"bar\", \"candlestick\", \"line\"];\n for (const shape of shapes) {\n const name = capitalize(shape);\n if ((shape === \"line\" && $$.hasTypeOf(name)) || $$.hasType(shape)) {\n helper(name);\n }\n }\n // Sub Chart\n $$.updateTargetsForSubchart?.(targets);\n // Arc, Polar, Radar\n }\n else if ($$.hasArcType(targets)) {\n let type = \"Arc\";\n if (hasRadar) {\n type = \"Radar\";\n }\n else if ($$.hasType(\"polar\")) {\n type = \"Polar\";\n }\n helper(type);\n }\n else if (hasFunnel) {\n helper(\"Funnel\");\n }\n else if (hasTreemap) {\n helper(\"Treemap\");\n }\n // Point types\n const hasPointType = $$.hasType(\"bubble\") || $$.hasType(\"scatter\");\n if (hasPointType) {\n $$.updateTargetForCircle?.();\n }\n // Fade-in each chart\n $$.filterTargetsToShowAtInit(hasPointType);\n }\n /**\n * Display targeted elements at initialization\n * @param {boolean} hasPointType whether has point type(bubble, scatter) or not\n * @private\n */\n filterTargetsToShowAtInit(hasPointType = false) {\n const $$ = this;\n const { $el: { svg }, $T } = $$;\n let selector = `.${$COMMON.target}`;\n if (hasPointType) {\n selector += `, .${$CIRCLE.chartCircles} > .${$CIRCLE.circles}`;\n }\n $T(svg.selectAll(selector)\n .filter(d => $$.isTargetToShow(d.id))).style(\"opacity\", null);\n }\n getWithOption(options) {\n const withOptions = {\n Dimension: true,\n EventRect: true,\n Legend: false,\n Subchart: true,\n Transform: false,\n Transition: true,\n TrimXDomain: true,\n UpdateXAxis: \"UpdateXDomain\",\n UpdateXDomain: false,\n UpdateOrgXDomain: false,\n TransitionForExit: \"Transition\",\n TransitionForAxis: \"Transition\",\n Y: true\n };\n for (const [key, defVal] of Object.entries(withOptions)) {\n const value = isString(defVal) ? withOptions[defVal] : defVal;\n withOptions[key] = getOption(options, `with${key}`, value);\n }\n return withOptions;\n }\n initialOpacity(d) {\n const $$ = this;\n const { withoutFadeIn } = $$.state;\n return $$.getBaseValue(d) !== null && withoutFadeIn[d.id] ? null : \"0\";\n }\n bindResize() {\n const $$ = this;\n const { $el, config, state } = $$;\n const resizeFunction = generateResize(config.resize_timer);\n const { resize_auto } = config;\n const list = [];\n list.push(() => callFn(config.onresize, $$.api));\n if (/^(true|parent)$/.test(resize_auto)) {\n list.push(() => {\n // Skip resize if dimensions haven't changed\n const prevWidth = state.current.width;\n const prevHeight = state.current.height;\n $$.setContainerSize();\n if (prevWidth === state.current.width &&\n prevHeight === state.current.height) {\n return;\n }\n state.resizing = true;\n // https://github.com/naver/billboard.js/issues/2650\n if (config.legend_show) {\n $$.updateSizes();\n state.isCanvasMode ? $$.updateHtmlLegend?.() : $$.updateLegend();\n }\n $$.api.flush(false);\n });\n }\n list.push(() => {\n callFn(config.onresized, $$.api);\n state.resizing = false;\n });\n // add resize functions\n list.forEach(v => resizeFunction.add(v));\n $$.resizeFunction = resizeFunction;\n // attach resize event\n if (resize_auto === \"parent\" && win.ResizeObserver) {\n ($$.resizeFunction.resizeObserver = new win.ResizeObserver($$.resizeFunction.bind($$)))\n .observe($el.chart.node().parentNode);\n }\n else {\n if (resize_auto === \"parent\") {\n // ResizeObserver unavailable: parent-specific resize won't be detected\n win.console?.warn?.(\"[billboard.js] resize.auto='parent' requires ResizeObserver; falling back to window resize.\");\n }\n win.addEventListener(\"resize\", $$.resizeFunction);\n }\n }\n /**\n * Call plugin hook\n * @param {string} phase The lifecycle phase\n * @param {Array} args Arguments\n * @private\n */\n callPluginHook(phase, ...args) {\n this.config.plugins.forEach(v => {\n if (phase === \"$beforeInit\") {\n v.$$ = this;\n this.api.plugins.push(v);\n }\n v[phase](...args);\n });\n }\n}\nextend(ChartInternal.prototype, [\n // common\n dataConvert,\n data,\n dataLoad,\n category,\n classModule,\n color,\n domain,\n interaction,\n format,\n legend,\n redraw,\n scale,\n shape,\n size,\n style,\n text,\n title,\n tooltip,\n transform,\n typeInternals\n]);\n\nexport { ChartInternal as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { isDefined, isObjectType } from '../module/util/type-checks.js';\n\n/**\n * Load configuration option\n * @param {object} config User's generation config value\n * @private\n */\nfunction loadConfig(config) {\n const thisConfig = this.config;\n let target;\n let keys;\n let read;\n const find = () => {\n const key = keys.shift();\n if (key && target && isObjectType(target) && key in target) {\n target = target[key];\n return find();\n }\n else if (!key) {\n return target;\n }\n return undefined;\n };\n Object.keys(thisConfig).forEach(key => {\n target = config;\n keys = key.split(\"_\");\n read = find();\n if (isDefined(read)) {\n thisConfig[key] = read;\n }\n });\n // only should run in the ChartInternal context\n if (this.api) {\n this.state.orgConfig = config;\n }\n}\n\nexport { loadConfig };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { window as win } from '../../module/browser.js';\nimport { cleanupWorkers } from '../../module/worker.js';\nimport { isDefined, notEmpty, isEmpty } from '../../module/util/type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\nvar apiChart = {\n /**\n * Resize the chart.\n * @function resize\n * @instance\n * @memberof Chart\n * @param {object} size This argument should include width and height in pixels.\n * @param {number} [size.width] width value\n * @param {number} [size.height] height value\n * @example\n * // Resize to 640x480\n * chart.resize({\n * width: 640,\n * height: 480\n * });\n */\n resize(size) {\n const $$ = this.internal;\n const { config, state } = $$;\n if (state.rendered) {\n config.size_width = size ? size.width : null;\n config.size_height = size ? size.height : null;\n state.resizing = true;\n state.dirty.size = true;\n this.flush(false);\n $$.resizeFunction();\n }\n },\n /**\n * Force to redraw.\n * - **NOTE:** When zoom/subchart is used, the zoomed state will be reset.\n * @function flush\n * @instance\n * @memberof Chart\n * @param {boolean} [soft] For soft redraw.\n * @example\n * chart.flush();\n *\n * // for soft redraw\n * chart.flush(true);\n */\n flush(soft) {\n const $$ = this.internal;\n const { state, $el: { zoomResetBtn } } = $$;\n if (state.rendered) {\n // reset possible zoom scale when is called from resize event\n if (state.resizing) { // arguments[1] is given when is called from resize\n $$.brush?.updateResize();\n }\n else {\n // re-update config info\n $$.axis?.setOrient();\n }\n // hide possible reset zoom button\n // https://github.com/naver/billboard.js/issues/2201\n zoomResetBtn?.style(\"display\", \"none\");\n // keep current zoom domain\n if ($$.scale.zoom) {\n state.current.zoomDomain = $$.scale.zoom.domain();\n }\n $$.scale.zoom = null;\n // Ensure shapes are fully updated on flush\n // Skip for resize-only: data hasn't changed, only geometry needs recalculation\n if (!state.resizing) {\n state.dirty.data = true;\n }\n soft ?\n $$.redraw({\n withTransform: true,\n withUpdateXDomain: true,\n withUpdateOrgXDomain: true,\n withLegend: true\n }) :\n $$.updateAndRedraw({\n withLegend: true,\n withTransition: false,\n withTransitionForTransform: false\n });\n // reset subchart selection & selection state\n if (!state.resizing && $$.brush) {\n $$.brush.getSelection().call($$.brush.move);\n $$.unselectRect();\n }\n // restore zoom domain\n if (state.current.zoomDomain) {\n $$.api.zoom(state.current.zoomDomain);\n state.current.zoomDomain = null;\n }\n }\n else {\n $$.initToRender(true);\n }\n },\n /**\n * Reset the chart object and remove element and events completely.\n * @function destroy\n * @instance\n * @memberof Chart\n * @returns {null}\n * @example\n * chart.destroy();\n */\n destroy() {\n const $$ = this.internal;\n const { state, $el: { chart, style, svg } } = $$;\n if (notEmpty($$)) {\n $$.callPluginHook(\"$willDestroy\");\n // clear interaction caches that hold DOM references\n $$.cache?.remove([\"setOverOut\", \"callOverOutForTouch\"]);\n $$.charts.splice($$.charts.indexOf(this), 1);\n // release cached web workers/Object URLs when no chart instance remains\n $$.charts.length === 0 && cleanupWorkers();\n // detach events\n $$.unbindAllEvents();\n // clear timers && pending transition\n svg?.select(\"*\").interrupt();\n state.canvasFlowFrame !== null &&\n win.cancelAnimationFrame?.(state.canvasFlowFrame);\n state.canvasFlowFrame = null;\n state.canvasFlowFinish = null;\n state.pendingRaf !== null && win.cancelAnimationFrame?.(state.pendingRaf);\n state.pendingRaf = null;\n $$.canvasRenderer?.destroy();\n $$.canvasEngine?.destroy();\n $$.resizeFunction?.clear();\n $$.resizeFunction?.resizeObserver?.disconnect();\n $$.resizeFunction && win.removeEventListener(\"resize\", $$.resizeFunction);\n chart.classed(\"bb\", false)\n .style(\"position\", null);\n if (state.isCanvasMode) {\n chart.style(\"min-height\", state.canvasInlineStyle.minHeight || null);\n }\n chart.selectChildren().remove();\n // remove <style> element added by boost.useCssRule option\n style && style.parentNode.removeChild(style);\n // releasing own references\n Object.keys(this).forEach(key => {\n key === \"internal\" && Object.keys($$).forEach(k => {\n $$[k] = null;\n });\n this[key] = null;\n delete this[key];\n });\n // release prototype chains\n for (const key in this) {\n this[key] = () => { };\n }\n }\n return null;\n },\n /**\n * Get or set config option value.\n * - **NOTE**\n * - The option key name must be specified as the last level.\n * - When no argument is given, it will return all specified generation options object only. (will exclude any other options not specified at the initialization)\n * @function config\n * @instance\n * @memberof Chart\n * @param {string} name The option key name.\n * @param {string|number|boolean|object|Array} [value] The value accepted for indicated option.\n * @param {boolean} [redraw] Set to redraw with the new option changes.\n * - **NOTE:** Doesn't guarantee to work in all circumstances. It can be applied for limited options only.\n * @returns {string|number|boolean|object|Array} The option value or all options object\n * @example\n *\n * // Getter\n * chart.config(\"gauge.max\");\n *\n * // Getter specified with top level key name will not work.\n * // The option key name must be specified as the last level.\n * // chart.config(\"gauge\"); // will not work\n *\n * // without any arguments, it returns generation config object\n * chart.config(); // {data: { ... }, axis: { ... }, ...}\n *\n * // Setter\n * chart.config(\"gauge.max\", 100);\n *\n * // Setter specified with top level key name will not work.\n * // The option key name must be specified as the last level.\n * // chart.config(\"gauge\", {min: 10, max: 20}); // will not work\n *\n * // Setter & redraw with the new option\n * chart.config(\"gauge.max\", 100, true);\n */\n config(name, value, redraw) {\n const $$ = this.internal;\n const { config, state } = $$;\n const key = name?.replace(/\\./g, \"_\");\n let res;\n if (name && key in config) {\n if (isDefined(value)) {\n config[key] = value;\n res = value;\n redraw && this.flush();\n }\n else {\n res = config[key];\n }\n }\n else if (arguments.length === 0 || isEmpty(name)) {\n res = state.orgConfig;\n }\n return res;\n }\n};\n\nexport { apiChart as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\nvar apiColor = {\n /**\n * Get the color\n * @function color\n * @instance\n * @memberof Chart\n * @param {string} id id to get the color\n * @returns {string}\n * @example\n * chart.color(\"data1\");\n */\n color(id) {\n return this.internal.color(id); // more patterns\n }\n};\n\nexport { apiColor as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { isUndefined, isArray } from '../../module/util/type-checks.js';\nimport { extend } from '../../module/util/object.js';\n\n/**\n * Get data loaded in the chart.\n * @function data\n * @instance\n * @memberof Chart\n * @param {string|Array} targetIds If this argument is given, this API returns the specified target data. If this argument is not given, all of data will be returned.\n * @returns {Array} Data objects\n * @example\n * // Get only data1 data\n * chart.data(\"data1\");\n * // --> [{id: \"data1\", id_org: \"data1\", values: Array(6)}, ...]\n *\n * // Get data1 and data2 data\n * chart.data([\"data1\", \"data2\"]);\n *\n * // Get all data\n * chart.data();\n */\nconst data = function (targetIds) {\n const { targets } = this.internal.data;\n if (!isUndefined(targetIds)) {\n const ids = isArray(targetIds) ? targetIds : [targetIds];\n return targets.filter(t => ids.some(v => v === t.id));\n }\n return targets;\n};\nextend(data, {\n /**\n * Get data shown in the chart.\n * @function data․shown\n * @instance\n * @memberof Chart\n * @param {string|Array} targetIds If this argument is given, this API filters the data with specified target ids. If this argument is not given, all shown data will be returned.\n * @returns {Array} Data objects\n * @example\n * // Get shown data by filtering to include only data1 data\n * chart.data.shown(\"data1\");\n * // --> [{id: \"data1\", id_org: \"data1\", values: Array(6)}, ...]\n *\n * // Get shown data by filtering to include data1 and data2 data\n * chart.data.shown([\"data1\", \"data2\"]);\n *\n * // Get all shown data\n * chart.data.shown();\n */\n shown: function (targetIds) {\n return this.internal.filterTargetsToShow(this.data(targetIds));\n },\n /**\n * Get values of the data loaded in the chart.\n * @function data․values\n * @instance\n * @memberof Chart\n * @param {string|Array|null} targetIds This API returns the values of specified target. If this argument is not given, null will be returned\n * @param {boolean} [flat=true] Get flatten values\n * @returns {Array} Data values\n * @example\n * // Get data1 values\n * chart.data.values(\"data1\");\n * // --> [10, 20, 30, 40]\n */\n values: function (targetIds, flat = true) {\n let values = null;\n if (targetIds) {\n const targets = this.data(targetIds);\n if (isArray(targets)) {\n values = [];\n targets.forEach(v => {\n const dataValue = v.values.map(d => d.value);\n flat ? (values = values.concat(dataValue)) : values.push(dataValue);\n });\n }\n }\n return values;\n },\n /**\n * Get and set names of the data loaded in the chart.\n * @function data․names\n * @instance\n * @memberof Chart\n * @param {object} names If this argument is given, the names of data will be updated. If not given, the current names will be returned. The format of this argument is the same as [data.names](./Options.html#.data%25E2%2580%25A4names).\n * @returns {object} Corresponding names according its key value, if specified names values.\n * @example\n * // Get current names\n * chart.data.names();\n * // --> {data1: \"test1\", data2: \"test2\"}\n *\n * // Update names\n * chart.data.names({\n * data1: \"New Name 1\",\n * data2: \"New Name 2\"\n * });\n */\n names: function (names) {\n const $$ = this.internal;\n return $$.updateDataAttributes(\"names\", names);\n },\n /**\n * Get and set colors of the data loaded in the chart.\n * - **NOTE:** If gradient option is set, the color update will affect only gradient stops have the same color.\n * @function data․colors\n * @instance\n * @memberof Chart\n * @param {object} colors If this argument is given, the colors of data will be updated. If not given, the current colors will be returned. The format of this argument is the same as [data.colors](./Options.html#.data%25E2%2580%25A4colors).\n * @returns {object} Corresponding data color value according its key value.\n * @example\n * // Get current colors\n * chart.data.colors();\n * // --> {data1: \"#00c73c\", data2: \"#fa7171\"}\n *\n * // Update colors\n * chart.data.colors({\n * data1: \"#FFFFFF\",\n * data2: \"#000000\"\n * });\n */\n colors: function (colors) {\n return this.internal.updateDataAttributes(\"colors\", colors);\n },\n /**\n * Get and set axes of the data loaded in the chart.\n * - **NOTE:** If all data is related to one of the axes, the domain of axis without related data will be replaced by the domain from the axis with related data\n * @function data․axes\n * @instance\n * @memberof Chart\n * @param {object} axes If this argument is given, the axes of data will be updated. If not given, the current axes will be returned. The format of this argument is the same as\n * @returns {object} Corresponding axes value for data, if specified axes value.\n * @example\n * // Get current axes\n * chart.data.axes();\n * // --> {data1: \"y\"}\n *\n * // Update axes\n * chart.data.axes({\n * data1: \"y\",\n * data2: \"y2\"\n * });\n */\n axes: function (axes) {\n return this.internal.updateDataAttributes(\"axes\", axes);\n },\n /**\n * Get the minimum data value bound to the chart\n * @function data․min\n * @instance\n * @memberof Chart\n * @returns {Array} Data objects\n * @example\n * // Get current axes\n * chart.data.min();\n * // --> [{x: 0, value: 30, id: \"data1\", index: 0}, ...]\n */\n min: function () {\n return this.internal.getMinMaxData().min;\n },\n /**\n * Get the maximum data value bound to the chart\n * @function data․max\n * @instance\n * @memberof Chart\n * @returns {Array} Data objects\n * @example\n * // Get current axes\n * chart.data.max();\n * // --> [{x: 3, value: 400, id: \"data1\", index: 3}, ...]\n */\n max: function () {\n return this.internal.getMinMaxData().max;\n }\n});\nvar apiData = { data };\n\nexport { apiData as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { select } from 'd3-selection';\nimport { $FOCUS, $GAUGE } from '../../config/classes.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\nvar apiFocus = {\n /**\n * This API highlights specified targets and fade out the others.<br><br>\n * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be highlighted.\n * @function focus\n * @instance\n * @memberof Chart\n * @param {string|Array} targetIdsValue Target ids to be highlighted.\n * @example\n * // data1 will be highlighted and the others will be faded out\n * chart.focus(\"data1\");\n *\n * // data1 and data2 will be highlighted and the others will be faded out\n * chart.focus([\"data1\", \"data2\"]);\n *\n * // all targets will be highlighted\n * chart.focus();\n */\n focus(targetIdsValue) {\n const $$ = this.internal;\n const { state } = $$;\n const targetIds = $$.mapToTargetIds(targetIdsValue);\n if (state.isCanvasMode) {\n const focusedIds = targetIds.filter($$.isTargetToShow, $$);\n const focusedSet = new Set(focusedIds);\n const defocusedIds = $$.mapToTargetIds()\n .filter(id => !focusedSet.has(id) && $$.isTargetToShow(id));\n $$.revertLegend();\n $$.toggleFocusLegend(defocusedIds, false);\n $$.toggleFocusLegend(focusedIds, true);\n state.focusedTargetIds = focusedSet;\n state.defocusedTargetIds = new Set(defocusedIds);\n $$.renderCanvasFrame?.(undefined, null, false);\n return;\n }\n const candidates = $$.$el.svg.selectAll($$.selectorTargets(targetIds.filter($$.isTargetToShow, $$)));\n this.revert();\n this.defocus();\n candidates.classed($FOCUS.focused, true).classed($FOCUS.defocused, false);\n if ($$.hasArcType() && !state.hasRadar) {\n $$.expandArc(targetIds);\n $$.hasType(\"gauge\") &&\n $$.markOverlapped(targetIdsValue, $$, `.${$GAUGE.gaugeValue}`);\n }\n $$.toggleFocusLegend(targetIds, true);\n state.focusedTargetIds = new Set(targetIds);\n targetIds.forEach(id => state.defocusedTargetIds.delete(id));\n },\n /**\n * This API fades out specified targets and reverts the others.<br><br>\n * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be faded out.\n * @function defocus\n * @instance\n * @memberof Chart\n * @param {string|Array} targetIdsValue Target ids to be faded out.\n * @example\n * // data1 will be faded out and the others will be reverted.\n * chart.defocus(\"data1\");\n *\n * // data1 and data2 will be faded out and the others will be reverted.\n * chart.defocus([\"data1\", \"data2\"]);\n *\n * // all targets will be faded out.\n * chart.defocus();\n */\n defocus(targetIdsValue) {\n const $$ = this.internal;\n const { state } = $$;\n const targetIds = $$.mapToTargetIds(targetIdsValue);\n if (state.isCanvasMode) {\n const defocusedIds = targetIds.filter($$.isTargetToShow, $$);\n $$.toggleFocusLegend(defocusedIds, false);\n defocusedIds.forEach(id => state.focusedTargetIds.delete(id));\n state.defocusedTargetIds = new Set(defocusedIds);\n $$.renderCanvasFrame?.(undefined, null, false);\n return;\n }\n const candidates = $$.$el.svg.selectAll($$.selectorTargets(targetIds.filter($$.isTargetToShow, $$)));\n candidates.classed($FOCUS.focused, false).classed($FOCUS.defocused, true);\n if ($$.hasArcType(null, [\"polar\"])) {\n $$.unexpandArc(targetIds);\n $$.hasType(\"gauge\") &&\n $$.undoMarkOverlapped($$, `.${$GAUGE.gaugeValue}`);\n }\n $$.toggleFocusLegend(targetIds, false);\n targetIds.forEach(id => state.focusedTargetIds.delete(id));\n state.defocusedTargetIds = new Set(targetIds);\n },\n /**\n * Revert focused or defocused state to initial state.<br><br>\n * You can specify multiple targets by giving an array that includes id as string. If no argument is given, all of targets will be reverted.\n * @function revert\n * @instance\n * @memberof Chart\n * @param {string|Array} targetIdsValue Target ids to be reverted\n * @example\n * // 'data1' will be reverted.\n * chart.revert(\"data1\");\n *\n * // 'data1' and 'data2' will be reverted.\n * chart.revert([\"data1\", \"data2\"]);\n *\n * // all targets will be reverted.\n * chart.revert();\n */\n revert(targetIdsValue) {\n const $$ = this.internal;\n const { config, state, $el } = $$;\n const targetIds = $$.mapToTargetIds(targetIdsValue);\n const resetLegend = () => {\n if (config.legend_show) {\n $$.showLegend(targetIds.filter($$.isLegendToShow.bind($$)));\n $el.legend.selectAll($$.selectorLegends(targetIds))\n .filter(function () {\n return select(this).classed($FOCUS.legendItemFocused);\n })\n .classed($FOCUS.legendItemFocused, false);\n }\n };\n if (state.isCanvasMode) {\n const changed = !!state.focusedTargetIds?.size || !!state.defocusedTargetIds?.size;\n resetLegend();\n state.focusedTargetIds = new Set();\n state.defocusedTargetIds = new Set();\n changed && $$.renderCanvasFrame?.(undefined, null, false);\n return;\n }\n const candidates = $el.svg.selectAll($$.selectorTargets(targetIds)); // should be for all targets\n candidates.classed($FOCUS.focused, false).classed($FOCUS.defocused, false);\n $$.hasArcType(null, [\"polar\"]) && $$.unexpandArc(targetIds);\n resetLegend();\n state.focusedTargetIds = new Set();\n state.defocusedTargetIds = new Set();\n }\n};\n\nexport { apiFocus as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Define legend\n * @ignore\n */\nconst legend = {\n /**\n * Show legend for each target.\n * - **NOTE:** Legend APIs aren't supported for `treemap` type.\n * @function legend․show\n * @instance\n * @memberof Chart\n * @param {string|Array} targetIds\n * - If targetIds is given, specified target's legend will be shown.\n * - If only one target is the candidate, String can be passed.\n * - If no argument is given, all of target's legend will be shown.\n * @example\n * // Show legend for data1.\n * chart.legend.show(\"data1\");\n *\n * // Show legend for data1 and data2.\n * chart.legend.show([\"data1\", \"data2\"]);\n *\n * // Show all legend.\n * chart.legend.show();\n */\n show: function (targetIds) {\n const $$ = this.internal;\n $$.showLegend($$.mapToTargetIds(targetIds));\n $$.updateAndRedraw({ withLegend: true });\n },\n /**\n * Hide legend for each target.\n * @function legend․hide\n * @instance\n * @memberof Chart\n * @param {string|Array} targetIds\n * - If targetIds is given, specified target's legend will be hidden.\n * - If only one target is the candidate, String can be passed.\n * - If no argument is given, all of target's legend will be hidden.\n * @example\n * // Hide legend for data1.\n * chart.legend.hide(\"data1\");\n *\n * // Hide legend for data1 and data2.\n * chart.legend.hide([\"data1\", \"data2\"]);\n *\n * // Hide all legend.\n * chart.legend.hide();\n */\n hide: function (targetIds) {\n const $$ = this.internal;\n $$.hideLegend($$.mapToTargetIds(targetIds));\n $$.updateAndRedraw({ withLegend: true });\n }\n};\nvar apiLegend = { legend };\n\nexport { apiLegend as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { callDone } from '../../ChartInternal/data/load.js';\nimport { requestIdleCallback } from '../../module/browser.js';\nimport { isEmpty, isArray, isString } from '../../module/util/type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\nvar apiLoad = {\n /**\n * Load data to the chart.<br><br>\n * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be toggles.\n * - <b>Note:</b>\n * - unload should be used if some data needs to be unloaded simultaneously.\n * If you call unload API soon after/before load instead of unload param, chart will not be rendered properly because of cancel of animation.<br>\n * - done will be called after data loaded, but it's not after rendering.\n * It's because rendering will finish after some transition and there is some time lag between loading and rendering\n * @function load\n * @instance\n * @memberof Chart\n * @param {object} args The object can consist with following members:<br>\n *\n * | Key | Type | Description |\n * | --- | --- | --- |\n * | columns | Array | The `columns` data will be loaded. If data that has the same target id is given, the chart will be updated. Otherwise, new target will be added |\n * | json | Array | The `json` data will be loaded. If data that has the same target id is given, the chart will be updated. Otherwise, new target will be added |\n * | rows | Array | The `rows` data will be loaded. If data that has the same target id is given, the chart will be updated. Otherwise, new target will be added |\n * | url | string | The data from `url` will be loaded. If data that has the same target id is given, the chart will be updated. Otherwise, new target will be added |\n * | &nbsp; | | |\n * | append | boolean | Load data appending it to the current dataseries.<br>If the existing chart has`x` value, should provide with corresponding `x` value for newly loaded data. |\n * | axes | Object | The axes specified by data.axes will be updated. axes must be Object that has target id as keys. |\n * | categories | Array | The categories specified by axis.x.categories or data.x will be updated. categories must be Array. |\n * | classes | Object | The classes specified by data.classes will be updated. classes must be Object that has target id as keys. |\n * | colors | Object | The colors specified by data.colors will be updated. colors must be Object that has target id as keys. |\n * | data | Object | Data objects to be loaded. Checkout the example. |\n * | done | Function | The specified function will be called after data loaded.|\n * | headers | string | Set request header if loading via `data.url`.<br>@see [data․headers](Options.html#.data%25E2%2580%25A4headers) |\n * | keys | Object | Choose which JSON objects keys correspond to desired data.<br>**NOTE:** Only for JSON object given as array.<br>@see [data․keys](Options.html#.data%25E2%2580%25A4keys) |\n * | mimeType | string | Set 'json' if loading JSON via url.<br>@see [data․mimeType](Options.html#.data%25E2%2580%25A4mimeType) |\n * | names | Object | Same as data.names() |\n * | regions | Object | The regions specified by data.regions will be updated. regions must be Object that has target id as keys. |\n * | resizeAfter | boolean | Resize after the load. Default value is `false`.<br>- This option won't call `onresize` neither `onresized`.<br>- When set to 'true', will call `.flush(true)` at the end of load. |\n * | type | string | The type of targets will be updated. |\n * | types | Object | The types of targets will be updated. |\n * | unload | Array | Specify the data will be unloaded before loading new data. If true given, all of data will be unloaded. If target ids given as String or Array, specified targets will be unloaded. If absent or false given, unload will not occur. |\n * | xs | string | Same as data.xs option |\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.DataFromURL)\n * @example\n * // Load data1 and unload data2 and data3\n * chart.load({\n * columns: [\n * [\"data1\", 100, 200, 150, ...],\n * ...\n * ],\n * unload: [\"data2\", \"data3\"],\n * url: \"...\",\n * done: function() { ... }\n * resizeAfter: true // will resize after load\n * });\n * @example\n * const chart = bb.generate({\n * data: {\n * columns: [\n * [\"data1\", 20, 30, 40]\n * ]\n * }\n * });\n *\n * chart.load({\n * columns: [\n * // with 'append' option, the 'data1' will have `[20,30,40,50,60]`.\n * [\"data1\", 50, 60]\n * ],\n * append: true\n * });\n * @example\n * const chart = bb.generate({\n * data: {\n * x: \"x\",\n * xFormat: \"%Y-%m-%dT%H:%M:%S\",\n * columns: [\n * [\"x\", \"2021-01-03T03:00:00\", \"2021-01-04T12:00:00\", \"2021-01-05T21:00:00\"],\n * [\"data1\", 36, 30, 24]\n * ]\n * },\n * axis: {\n * x: {\n * type: \"timeseries\"\n * }\n * }\n * };\n *\n * chart.load({\n * columns: [\n * // when existing chart has `x` value, should provide corresponding 'x' value.\n * // with 'append' option, the 'data1' will have `[36,30,24,37]`.\n * [\"x\", \"2021-02-01T08:00:00\"],\n * [\"data1\", 37]\n * ],\n * append: true\n * });\n * @example\n * // myAPI.json\n * // {\n * // \"data1\": [220, 240, 270, 250, 280],\n * // \"data2\": [180, 150, 300, 70, 120]\n * // }\n *\n * chart.load({\n * url: './data/myAPI.json',\n * mimeType: \"json\",\n *\n * // set request header if is needed\n * headers: {\n * \"Content-Type\": \"text/json\"\n * }\n * });\n * @example\n * chart.load({\n * data: [\n * // equivalent as: columns: [[\"data1\", 30, 200, 100]]\n * {\"data1\": 30}, {\"data1\": 200}, {\"data1\": 100}\n *\n * // or\n * // equivalent as: columns: [[\"data1\", 10, 20], [\"data2\", 13, 30]]\n * // {\"data1\": 10, \"data2\": 13}, {\"data1\": 20, \"data2\": 30}}\n * ]\n * });\n * @example\n * chart.load({\n * json: [\n * {name: \"www.site1.com\", upload: 800, download: 500, total: 400},\n * ],\n * keys: {\n * x: \"name\",\n * value: [\"upload\", \"download\"]\n * }\n * });\n * @example\n * chart.load({\n * json: {\n * data1:[30, 20, 50, 40, 60, 50],\n * data2:[200, 130, 90, 240, 130, 220],\n * }\n * });\n */\n load(args) {\n const $$ = this.internal;\n const { config } = $$;\n $$.state.dirty.data = true;\n $$.state._eventRectFingerprint = null;\n // update xs if specified\n args.xs && $$.addXs(args.xs);\n // update names if exists\n \"names\" in args && this.data.names(args.names);\n // update classes if exists\n \"classes\" in args && Object.keys(args.classes).forEach(id => {\n config.data_classes[id] = args.classes[id];\n });\n // update categories if exists\n if (\"categories\" in args && $$.axis.isCategorized()) {\n config.axis_x_categories = args.categories;\n }\n // update axes if exists\n \"axes\" in args && Object.keys(args.axes).forEach(id => {\n config.data_axes[id] = args.axes[id];\n });\n // update colors if exists\n \"colors\" in args && Object.keys(args.colors).forEach(id => {\n config.data_colors[id] = args.colors[id];\n });\n // update regions if exists\n \"regions\" in args && (config.data_regions = args.regions || {});\n const hasDataToLoad = [\"data\", \"columns\", \"rows\", \"json\", \"url\"]\n .some(key => key in args);\n const hasUnload = \"unload\" in args && args.unload !== false;\n if (\"regions\" in args && !hasDataToLoad && !hasUnload) {\n $$.redraw({\n withUpdateOrgXDomain: true,\n withUpdateXDomain: true,\n withLegend: true\n });\n callDone.call($$, args.done, args.resizeAfter);\n return;\n }\n // unload if needed\n if (hasUnload) {\n // TODO: do not unload if target will load (included in url/rows/columns)\n const unloadIds = $$.mapToTargetIds(args.unload === true ? null : args.unload);\n $$.unload(unloadIds, () => {\n if (!$$.config || !$$.cache) {\n return;\n }\n $$.cache.remove(unloadIds);\n // to mitigate improper rendering for multiple consecutive calls\n // https://github.com/naver/billboard.js/issues/2121\n requestIdleCallback(() => $$.loadFromArgs(args));\n });\n }\n else {\n $$.loadFromArgs(args);\n }\n },\n /**\n * Unload data to the chart.<br><br>\n * You can specify multiple targets by giving an array that includes id as String. If no argument is given, all of targets will be toggles.\n * - <b>Note:</b>\n * If you call load API soon after/before unload, unload param of load should be used. Otherwise chart will not be rendered properly because of cancel of animation.<br>\n * `done` will be called after data loaded, but it's not after rendering. It's because rendering will finish after some transition and there is some time lag between loading and rendering.\n * @function unload\n * @instance\n * @memberof Chart\n * @param {object} argsValue\n * | key | Type | Description |\n * | --- | --- | --- |\n * | ids | String &vert; Array | Target id data to be unloaded. If not given, all data will be unloaded. |\n * | done | Function | Callback after data is unloaded. |\n * | resizeAfter | boolean | Resize after the unload. Default value is `false`.<br>- This option won't call `onresize` neither `onresized`.<br>- When set to 'true', will call `.flush(true)` at the end of unload. |\n * @example\n * // Unload data2 and data3\n * chart.unload({\n * ids: [\"data2\", \"data3\"],\n * done: function() {\n * // called after the unloaded\n * },\n * resizeAfter: true // will resize after unload\n * });\n */\n unload(argsValue) {\n const $$ = this.internal;\n let args = argsValue || {};\n // hide possible tooltip display when data is completely unloaded\n isEmpty(args) && this.tooltip.hide();\n if (isArray(args)) {\n args = { ids: args };\n }\n else if (isString(args)) {\n args = { ids: [args] };\n }\n const ids = $$.mapToTargetIds(args.ids);\n $$.state.dirty.data = true;\n $$.state._eventRectFingerprint = null;\n $$.unload(ids, () => {\n if (!$$.config || !$$.cache) {\n return;\n }\n $$.redraw({\n withUpdateOrgXDomain: true,\n withUpdateXDomain: true,\n withLegend: true\n });\n $$.cache.remove(ids);\n callDone.call($$, args.done, args.resizeAfter);\n });\n }\n};\n\nexport { apiLoad as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { callFn, endall } from '../../module/util/object.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Show/Hide data series\n * @param {boolean} show Show or hide\n * @param {Array} targetIdsValue Target id values\n * @param {object} options Options\n * @param {boolean} [options.withLegend=false] whether or not display legend\n * @param {boolean} [skipRedraw=false] whether or not skip redraw after show/hide\n * @private\n */\nfunction showHide(show, targetIdsValue, options, skipRedraw = false) {\n const $$ = this.internal;\n const targetIds = $$.mapToTargetIds(targetIdsValue);\n const targetIdSet = new Set(targetIds);\n const hiddenIds = [...$$.state.hiddenTargetIds].filter(v => targetIdSet.has(v));\n $$.state.toggling = true;\n $$.state.dirty.visibility = true;\n $$[`${show ? \"remove\" : \"add\"}HiddenTargetIds`](targetIds);\n if ($$.state.isCanvasMode) {\n if (show && hiddenIds.length) {\n callFn($$.config.data_onshown, this, hiddenIds);\n }\n else if (!show && hiddenIds.length === 0) {\n callFn($$.config?.data_onhidden, this, targetIds);\n }\n if (!skipRedraw) {\n $$.redraw({\n withUpdateOrgXDomain: true,\n withUpdateXDomain: true,\n withLegend: true\n });\n }\n $$.state.toggling = false;\n return;\n }\n const targets = $$.$el.svg.selectAll($$.selectorTargets(targetIds));\n const opacity = show ? null : \"0\";\n if (show && hiddenIds.length) {\n targets.style(\"display\", null);\n callFn($$.config.data_onshown, this, hiddenIds);\n }\n $$.$T(targets)\n .style(\"opacity\", opacity, \"important\")\n .call(endall, () => {\n // https://github.com/naver/billboard.js/issues/1758\n if (!show && hiddenIds.length === 0) {\n targets.style(\"display\", \"none\");\n callFn($$.config?.data_onhidden, this, targetIds);\n }\n targets.style(\"opacity\", opacity);\n });\n options.withLegend && $$[`${show ? \"show\" : \"hide\"}Legend`](targetIds);\n if (!skipRedraw) {\n $$.redraw({\n withUpdateOrgXDomain: true,\n withUpdateXDomain: true,\n withLegend: true\n });\n }\n $$.state.toggling = false;\n}\nvar apiShow = {\n /**\n * Show data series on chart\n * @function show\n * @instance\n * @memberof Chart\n * @param {string|Array} [targetIdsValue] The target id value.\n * @param {object} [options] The object can consist with following members:<br>\n *\n * | Key | Type | default | Description |\n * | --- | --- | --- | --- |\n * | withLegend | boolean | false | whether or not display legend |\n *\n * @example\n * // show 'data1'\n * chart.show(\"data1\");\n *\n * // show 'data1' and 'data3'\n * chart.show([\"data1\", \"data3\"]);\n */\n show(targetIdsValue, options = {}) {\n showHide.call(this, true, targetIdsValue, options);\n },\n /**\n * Hide data series from chart\n * @function hide\n * @instance\n * @memberof Chart\n * @param {string|Array} [targetIdsValue] The target id value.\n * @param {object} [options] The object can consist with following members:<br>\n *\n * | Key | Type | default | Description |\n * | --- | --- | --- | --- |\n * | withLegend | boolean | false | whether or not display legend |\n *\n * @example\n * // hide 'data1'\n * chart.hide(\"data1\");\n *\n * // hide 'data1' and 'data3'\n * chart.hide([\"data1\", \"data3\"]);\n */\n hide(targetIdsValue, options = {}) {\n showHide.call(this, false, targetIdsValue, options);\n },\n /**\n * Toggle data series on chart. When target data is hidden, it will show. If is shown, it will hide in vice versa.\n * @function toggle\n * @instance\n * @memberof Chart\n * @param {string|Array} [targetIds] The target id value.\n * @param {object} [options] The object can consist with following members:<br>\n *\n * | Key | Type | default | Description |\n * | --- | --- | --- | --- |\n * | withLegend | boolean | false | whether or not display legend |\n *\n * @example\n * // toggle 'data1'\n * chart.toggle(\"data1\");\n *\n * // toggle 'data1' and 'data3'\n * chart.toggle([\"data1\", \"data3\"]);\n */\n toggle(targetIds, options = {}) {\n const $$ = this.internal;\n const targets = { show: [], hide: [] };\n // sort show & hide target ids\n $$.mapToTargetIds(targetIds)\n .forEach((id) => targets[$$.isTargetToShow(id) ? \"hide\" : \"show\"].push(id));\n if (targets.show.length && targets.hide.length) {\n // Batch both operations with a single redraw\n showHide.call(this, true, targets.show, options, true);\n showHide.call(this, false, targets.hide, options);\n }\n else {\n // perform show & hide task separately\n // https://github.com/naver/billboard.js/issues/454\n targets.show.length && this.show(targets.show, options);\n targets.hide.length && this.hide(targets.hide, options);\n }\n }\n};\n\nexport { apiShow as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { $SHAPE } from '../../config/classes.js';\nimport { isDefined } from '../../module/util/type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Define tooltip\n * @ignore\n */\nconst tooltip = {\n /**\n * Show tooltip\n * @function tooltip․show\n * @instance\n * @memberof Chart\n * @param {object} args The object can consist with following members:<br>\n *\n * | Key | Type | Description |\n * | --- | --- | --- |\n * | index | Number | Determine focus by index |\n * | x | Number &vert; Date | Determine focus by x Axis index |\n * | mouse | Array | Determine x and y coordinate value relative the targeted '.bb-event-rect' x Axis.<br>It should be used along with `data`, `index` or `x` value. The default value is set as `[0,0]` |\n * | data | Object | When [data.xs](Options.html#.data%25E2%2580%25A4xs) option is used or [tooltip.grouped](Options.html#.tooltip) set to 'false', `should be used giving this param`.<br><br>**Key:**<br>- x {number &verbar; Date}: x Axis value<br>- index {number}: x Axis index (useless for data.xs)<br>- id {string}: data id<br>- value {number}: The corresponding value for tooltip. |\n *\n * @example\n * // show the 2nd x Axis coordinate tooltip\n * // for Arc(gauge, donut & pie) and radar type, approach showing tooltip by using \"index\" number.\n * chart.tooltip.show({\n * index: 1\n * });\n *\n * // show tooltip for the 3rd x Axis in x:50 and y:100 coordinate of '.bb-event-rect' of the x Axis.\n * chart.tooltip.show({\n * x: 2,\n * mouse: [50, 100]\n * });\n *\n * // show tooltip for timeseries x axis\n * chart.tooltip.show({\n * x: new Date(\"2018-01-02 00:00\")\n * });\n *\n * // treemap type can be shown by using \"id\" only.\n * chart.tooltip.show({\n * data: {\n * id: \"data1\" // data id\n * }\n * });\n *\n * // for Arc types, specify 'id' or 'index'\n * chart.tooltip.show({ data: { id: \"data2\" }});\n * chart.tooltip.show({ data: { index: 2 }});\n *\n * // when data.xs is used\n * chart.tooltip.show({\n * data: {\n * x: 3, // x Axis value\n * id: \"data1\", // data id\n * value: 500 // data value\n * }\n * });\n *\n * // when data.xs isn't used, but tooltip.grouped=false is set\n * chart.tooltip.show({\n * data: {\n * index: 3, // or 'x' key value\n * id: \"data1\", // data id\n * value: 500 // data value\n * }\n * });\n */\n show: function (args) {\n const $$ = this.internal;\n const { $el, config, state: { eventReceiver, hasFunnel, hasTreemap, inputType } } = $$;\n let index;\n let mouse;\n // determine mouse position on the chart\n if (args.mouse) {\n mouse = args.mouse;\n }\n // determine focus data\n if (args.data) {\n const { data } = args;\n const y = $$.getYScaleById(data.id)?.(data.value);\n if ((hasFunnel || hasTreemap) && data.id) {\n const selector = $$.selectorTarget(data.id, undefined, `.${$SHAPE.shape}`);\n eventReceiver.rect = $el.main.select(selector);\n }\n else if ($$.isMultipleX()) {\n // if multiple xs, target point will be determined by mouse\n mouse = [$$.xx(data), y];\n }\n else {\n if (!config.tooltip_grouped) {\n mouse = [0, y];\n }\n index = data.index ?? ($$.hasArcType() && data.id ?\n $$.getArcElementByIdOrIndex(data.id)?.datum().index :\n $$.getIndexByX(data.x));\n }\n }\n else if (isDefined(args.x)) {\n index = $$.getIndexByX(args.x);\n }\n else if (isDefined(args.index)) {\n index = args.index;\n }\n if ($$.state.isCanvasMode) {\n const targets = $$.filterTargetsToShow?.() || $$.data.targets;\n const selectedData = args.data?.id && !config.tooltip_grouped ?\n targets\n .filter(target => target.id === args.data.id)\n .map(target => target.values[index ?? args.data.index])\n .filter(Boolean) :\n targets\n .map(target => target.values[index])\n .filter(Boolean);\n const canvas = $el.canvas?.node?.();\n const shape = $$.state.canvasShape || $$.getDrawShape?.();\n const first = selectedData[0];\n const point = mouse || (first && shape?.pos?.cx && shape?.pos?.cy ?\n [\n $$.state.margin.left + shape.pos.cx(first),\n $$.state.margin.top + shape.pos.cy(first)\n ] :\n undefined);\n if (!selectedData.length || !canvas) {\n return;\n }\n $$.state.canvasFocusKey = selectedData\n .map(v => `${v.id}:${v.index}`)\n .join(\"|\");\n $$.renderCanvasFocus?.(selectedData, point);\n $$.showTooltip?.(selectedData, canvas);\n return;\n }\n (inputType === \"mouse\" ? [\"mouseover\", \"mousemove\"] : [\"touchstart\"]).forEach(eventName => {\n $$.dispatchEvent(eventName, index, mouse);\n });\n },\n /**\n * Hide tooltip\n * @function tooltip․hide\n * @instance\n * @memberof Chart\n */\n hide: function () {\n const $$ = this.internal;\n const { state: { inputType, isCanvasMode }, $el: { tooltip } } = $$;\n const data = tooltip?.datum();\n if (isCanvasMode) {\n $$.state.canvasFocusKey = null;\n $$.hideTooltip(true);\n $$.clearCanvasFocus?.();\n return;\n }\n if (data?.data?.[0]) {\n const { index } = data.data[0];\n // make to finalize, possible pending event flow set from '.tooltip.show()' call\n (inputType === \"mouse\" ? [\"mouseout\"] : [\"touchend\"]).forEach(eventName => {\n $$.dispatchEvent(eventName, index);\n });\n }\n // reset last touch point index\n inputType === \"touch\" && $$.callOverOutForTouch();\n $$.hideTooltip(true);\n $$.hideGridFocus?.();\n $$.unexpandCircles?.();\n $$.expandBarTypeShapes?.(false);\n }\n};\nvar apiTooltip = { tooltip };\n\nexport { apiTooltip as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport ChartInternal from '../ChartInternal/ChartInternal.js';\nimport { loadConfig } from '../config/config.js';\nimport apiChart from './api/chart.js';\nimport apiColor from './api/color.js';\nimport apiData from './api/data.js';\nimport apiFocus from './api/focus.js';\nimport apiLegend from './api/legend.js';\nimport apiLoad from './api/load.js';\nimport apiShow from './api/show.js';\nimport apiTooltip from './api/tooltip.js';\nimport { isFunction, notEmpty } from '../module/util/type-checks.js';\nimport { extend } from '../module/util/object.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Main chart class.\n * - Note: Instantiated via `bb.generate()`.\n * @class Chart\n * @example\n * var chart = bb.generate({\n * data: {\n * columns: [\n * [\"x\", \"2015-11-02\", \"2015-12-01\", \"2016-01-01\", \"2016-02-01\", \"2016-03-01\"],\n * [\"count1\", 11, 8, 7, 6, 5 ],\n * [\"count2\", 9, 3, 6, 2, 8 ]\n * ]}\n * }\n * @see {@link bb.generate} for the initialization.\n */\n/**\n * Access instance's primary node elements\n * @member {object} $\n * @property {object} $ Access instance's primary node elements\n * @property {d3.selection} $.chart Wrapper element\n * @property {d3.selection} $.svg Main svg element\n * @property {d3.selection} $.defs Definition element\n * @property {d3.selection} $.main Main grouping element\n * @property {d3.selection} $.needle Needle element\n * - **NOTE:**\n * - The element will have `bb-needle` as class name.\n * - Will provide special helper `.updateHelper(value: number, updateConfig: boolean)` method to facilitate needle position update.\n * @property {d3.selection} $.tooltip Tooltip element\n * @property {d3.selection} $.legend Legend element\n * @property {d3.selection} $.title Title element\n * @property {d3.selection} $.grid Grid element\n * @property {d3.selection} $.arc Arc element\n * @property {d3.selection} $.circles Data point circle elements\n * @property {object} $.bar Bar element object\n * @property {d3.selection} $.bar.bars Bar elements\n * @property {d3.selection} $.candlestick Candlestick elements\n * @property {object} $.line Line element object\n * @property {d3.selection} $.line.lines Line elements\n * @property {d3.selection} $.line.areas Areas elements\n * @property {object} $.text Text element object\n * @property {d3.selection} $.text.texts Data label text elements\n * @memberof Chart\n * @example\n * const chart = bb.generate({ ... });\n *\n * chart.$.chart; // wrapper element\n * chart.$.line.circles; // all data point circle elements\n * @example\n * // Update arc needle position\n * const chart = bb.generate({\n * data: {\n * type: \"donut\"\n * },\n * arc: {\n * needle: {\n * show: true,\n * ...\n * }\n * }\n * });\n *\n * chart.$.needle.updateHelper(70); // update needle position to point value 70.\n *\n * // update needle position to point value 70 and the config value.\n * // NOTE: updating config value, will update needle pointer initial value too.\n * chart.$.needle.updateHelper(70, true);\n *\n * // update needle point position every 1 second\n * let i = 0;\n * setInterval(() => {\n * chart.$.needle.updateHelper(i += 10);\n * }, 1000)\n */\n/**\n * Plugin instance array\n * @member {Array} plugins\n * @memberof Chart\n * @example\n * var chart = bb.generate({\n * ...\n * plugins: [\n * new bb.plugin.stanford({ ... }),\n * new PluginA()\n * ]\n * });\n *\n * chart.plugins; // [Stanford, PluginA] - instance array\n */\nclass Chart {\n plugins = [];\n internal;\n constructor(options) {\n const $$ = new ChartInternal(this);\n // let hook = () => {};\n this.internal = $$;\n // bind to namespaced APIs\n (function bindThis(fn, target, argThis) {\n Object.keys(fn).forEach(key => {\n const isFunc = isFunction(fn[key]);\n const isChild = target !== argThis;\n const isNotNil = notEmpty(fn[key]);\n const hasChild = isNotNil && Object.keys(fn[key]).length > 0;\n // const hookFn = function(...params) {\n // \thook();\n // \treturn fn[key].bind(argThis)(...params);\n // }\n if (isFunc && ((!isChild && hasChild) || isChild)) {\n target[key] = fn[key].bind(argThis);\n }\n else if (isNotNil && !isFunc) {\n target[key] = {};\n }\n else {\n target[key] = fn[key];\n }\n hasChild && bindThis(fn[key], target[key], argThis);\n });\n })(Chart.prototype, this, this);\n loadConfig.call($$, options);\n $$.beforeInit();\n $$.init();\n // if ($$.config.render.lazy !== false && hasStyle($$.$el.chart, {\"display\": \"none\", \"visibility\": \"hidden\"})) {\n // \thook = () => {\n // \t\tlogError(`The call of APIs won't work. Please, make sure if chart element is %cvisible.`);\n // \t};\n // }\n }\n}\n// extend common APIs as part of Chart class\nextend(Chart.prototype, [\n apiChart,\n apiColor,\n apiData,\n apiFocus,\n apiLegend,\n apiLoad,\n apiShow,\n apiTooltip\n]);\n\nexport { Chart as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { isTabVisible } from '../../module/util/dom.js';\nimport { extend } from '../../module/util/object.js';\n\n/**\n * Normalize grid argument to array.\n * @param {Array|object} grids Grid lines\n * @returns {Array} Grid lines\n * @private\n */\nfunction toGrids(grids) {\n return Array.isArray(grids) ? grids : [grids];\n}\n/**\n * Redraw canvas after grid API mutation.\n * @param {object} $$ ChartInternal instance\n * @private\n */\nfunction redrawCanvasGrid($$) {\n $$.state.canvasShape = null;\n $$.renderCanvasFrame?.(undefined, null, false);\n}\n/**\n * Update grid lines.\n * @param {Array} grids grid lines to update\n * @param {string} axisId axis' id: \"x\" or \"y\"\n * @returns {Array}\n * @private\n */\nfunction grid(grids, axisId) {\n const $$ = this.internal;\n const { config } = $$;\n const withTransition = config.transition_duration && isTabVisible();\n const gridPropLines = `grid_${axisId}_lines`;\n if (!grids) {\n return config[gridPropLines];\n }\n config[gridPropLines] = toGrids(grids);\n if ($$.state.isCanvasMode) {\n redrawCanvasGrid($$);\n return config[gridPropLines];\n }\n $$.updateGrid();\n $$.redrawGrid(withTransition);\n return config[gridPropLines];\n}\n/**\n * Add grid lines.\n * @param {Array|object} grids grid lines to add\n * @param {string} axisId axis' id: \"x\" or \"y\"\n * @returns {Array}\n * @private\n */\nfunction add(grids, axisId) {\n const gridPropLines = `grid_${axisId}_lines`;\n return grid.bind(this)(this.internal.config[gridPropLines].concat(grids ? toGrids(grids) : []), axisId);\n}\n/**\n * Remove grid lines.\n * @param {object} grids grid lines to remove\n * @param {boolean} isXAxis weather is x axis or not\n * @private\n */\nfunction remove(grids, isXAxis) {\n const $$ = this.internal;\n if ($$.state.isCanvasMode) {\n const toRemove = $$.getGridFilterToRemove?.(grids) || (() => true);\n const gridLines = `grid_${isXAxis ? \"x\" : \"y\"}_lines`;\n $$.config[gridLines] = $$.config[gridLines].filter(line => !toRemove(line));\n redrawCanvasGrid($$);\n return;\n }\n $$.removeGridLines(grids, isXAxis);\n}\n/**\n * Update x grid lines.\n * @function xgrids\n * @instance\n * @memberof Chart\n * @param {Array} grids X grid lines will be replaced with this argument. The format of this argument is the same as grid.x.lines.\n * @returns {Array}\n * @example\n * // Show 2 x grid lines\n * chart.xgrids([\n * {value: 1, text: \"Label 1\"},\n * {value: 4, text: \"Label 4\"}\n * ]);\n * // --> Returns: [{value: 1, text: \"Label 1\"}, {value: 4, text: \"Label 4\"}]\n */\nconst xgrids = function (grids) {\n return grid.bind(this)(grids, \"x\");\n};\nextend(xgrids, {\n /**\n * Add x grid lines.<br>\n * This API adds new x grid lines instead of replacing like xgrids.\n * @function xgrids․add\n * @instance\n * @memberof Chart\n * @param {Array|object} grids New x grid lines will be added. The format of this argument is the same as grid.x.lines and it's possible to give an Object if only one line will be added.\n * @returns {Array}\n * @example\n * // Add a new x grid line\n * chart.xgrids.add(\n * {value: 4, text: \"Label 4\"}\n * );\n *\n * // Add new x grid lines\n * chart.xgrids.add([\n * {value: 2, text: \"Label 2\"},\n * {value: 4, text: \"Label 4\"}\n * ]);\n */\n add(grids) {\n return add.bind(this)(grids, \"x\");\n },\n /**\n * Remove x grid lines.<br>\n * This API removes x grid lines.\n * @function xgrids․remove\n * @instance\n * @memberof Chart\n * @param {object} grids This argument should include value or class. If value is given, the x grid lines that have specified x value will be removed. If class is given, the x grid lines that have specified class will be removed. If args is not given, all of x grid lines will be removed.\n * @param {number} [grids.value] target value\n * @param {string} [grids.class] target class\n * @returns {void}\n * @example\n * // x grid line on x = 2 will be removed\n * chart.xgrids.remove({value: 2});\n *\n * // x grid lines that have 'grid-A' will be removed\n * chart.xgrids.remove({\n * class: \"grid-A\"\n * });\n *\n * // all of x grid lines will be removed\n * chart.xgrids.remove();\n */\n remove(grids) {\n return remove.bind(this)(grids, true);\n }\n});\n/**\n * Update y grid lines.\n * @function ygrids\n * @instance\n * @memberof Chart\n * @param {Array} grids Y grid lines will be replaced with this argument. The format of this argument is the same as grid.y.lines.\n * @returns {object}\n * @example\n * // Show 2 y grid lines\n * chart.ygrids([\n * {value: 100, text: \"Label 1\"},\n * {value: 400, text: \"Label 4\"}\n * ]);\n * // --> Returns: [{value: 100, text: \"Label 1\"}, {value: 400, text: \"Label 4\"}]\n */\nconst ygrids = function (grids) {\n return grid.bind(this)(grids, \"y\");\n};\nextend(ygrids, {\n /**\n * Add y grid lines.<br>\n * This API adds new y grid lines instead of replacing like ygrids.\n * @function ygrids․add\n * @instance\n * @memberof Chart\n * @param {Array|object} grids New y grid lines will be added. The format of this argument is the same as grid.y.lines and it's possible to give an Object if only one line will be added.\n * @returns {object}\n * @example\n * // Add a new x grid line\n * chart.ygrids.add(\n * {value: 400, text: \"Label 4\"}\n * );\n *\n * // Add new x grid lines\n * chart.ygrids.add([\n * {value: 200, text: \"Label 2\"},\n * {value: 400, text: \"Label 4\"}\n * ]);\n */\n add(grids) {\n return add.bind(this)(grids, \"y\");\n },\n /**\n * Remove y grid lines.<br>\n * This API removes x grid lines.\n * @function ygrids․remove\n * @instance\n * @memberof Chart\n * @param {object} grids This argument should include value or class. If value is given, the y grid lines that have specified y value will be removed. If class is given, the y grid lines that have specified class will be removed. If args is not given, all of y grid lines will be removed.\n * @param {number} [grids.value] target value\n * @param {string} [grids.class] target class\n * @returns {void}\n * @example\n * // y grid line on y = 200 will be removed\n * chart.ygrids.remove({value: 200});\n *\n * // y grid lines that have 'grid-A' will be removed\n * chart.ygrids.remove({\n * class: \"grid-A\"\n * });\n *\n * // all of y grid lines will be removed\n * chart.ygrids.remove();\n */\n remove(grids) {\n return remove.bind(this)(grids, false);\n }\n});\nvar apiGrid = { xgrids, ygrids };\n\nexport { apiGrid as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { select, selectAll } from 'd3-selection';\nimport { $GRID, $AXIS, $FOCUS, $COMMON } from '../../config/classes.js';\nimport { AXIS_DEFAULT_TICK_COUNT } from '../../config/const.js';\nimport { isArray, isValue } from '../../module/util/type-checks.js';\nimport { getPointer } from '../../module/util/dom.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n// Grid position and text anchor helpers\nconst GRID_FOCUS_SELECTOR = `line.${$FOCUS.xgridFocus}, line.${$FOCUS.ygridFocus}`;\nconst _getGridTextAnchor = d => isValue(d.position) || \"end\";\nconst _getGridTextDx = d => (d.position === \"start\" ? 4 : (d.position === \"middle\" ? 0 : -4));\n/**\n * Get current grid focus line selection.\n * @param {object} $$ ChartInternal context\n * @returns {d3.selection} Grid focus line selection\n * @private\n */\nfunction _getGridFocusEl($$) {\n const { state, $el: { main } } = $$;\n const cached = state._gridFocusEl;\n const mainNode = main.node();\n const cachedNodes = cached?.nodes?.() || [];\n return cachedNodes.length && cachedNodes.every(node => mainNode?.contains(node)) ?\n cached :\n (state._gridFocusEl = main.selectAll(GRID_FOCUS_SELECTOR));\n}\n/**\n * Get grid text x value getter function\n * @param {boolean} isX Is x Axis\n * @param {number} width Width value\n * @param {number} height Height value\n * @returns {function}\n * @private\n */\nfunction _getGridTextX(isX, width, height) {\n return d => {\n let x = isX ? 0 : width;\n if (d.position === \"start\") {\n x = isX ? -height : 0;\n }\n else if (d.position === \"middle\") {\n x = (isX ? -height : width) / 2;\n }\n return x;\n };\n}\n/**\n * Update coordinate attributes value\n * @param {d3.selection} el Target node\n * @param {string} type Type\n * @private\n */\nfunction _smoothLines(el, type) {\n {\n el.each(function () {\n const g = select(this);\n [\"x1\", \"x2\", \"y1\", \"y2\"]\n .forEach(v => g.attr(v, +g.attr(v)));\n });\n }\n}\nvar internalGrid = {\n hasGrid() {\n const { config } = this;\n return [\"x\", \"y\"]\n .some(v => config[`grid_${v}_show`] || config[`grid_${v}_lines`].length);\n },\n initGrid() {\n const $$ = this;\n $$.hasGrid() && $$.initGridLines();\n $$.initFocusGrid();\n },\n initGridLines() {\n const $$ = this;\n const { config, state: { clip }, $el } = $$;\n if (config.grid_x_lines.length || config.grid_y_lines.length) {\n $el.gridLines.main = $el.main.insert(\"g\", `.${$COMMON.chart}${config.grid_lines_front ? \" + *\" : \"\"}`)\n .attr(\"clip-path\", clip.pathGrid)\n .attr(\"class\", `${$GRID.grid} ${$GRID.gridLines}`);\n $el.gridLines.main.append(\"g\").attr(\"class\", $GRID.xgridLines);\n $el.gridLines.main.append(\"g\").attr(\"class\", $GRID.ygridLines);\n $el.gridLines.x = selectAll([]);\n }\n },\n updateXGrid(withoutUpdate) {\n const $$ = this;\n const { config, scale, state, $el: { main, grid } } = $$;\n const isRotated = config.axis_rotated;\n const xgridData = $$.generateGridData(config.grid_x_type, scale.x);\n const tickOffset = $$.axis.isCategorized() ? $$.axis.x.tickOffset() : 0;\n const pos = d => (scale.zoom || scale.x)(d) + (tickOffset * (isRotated ? -1 : 1));\n state.xgridAttr = isRotated ?\n {\n x1: 0,\n x2: state.width,\n y1: pos,\n y2: pos\n } :\n {\n x1: pos,\n x2: pos,\n y1: 0,\n y2: state.height\n };\n grid.x = main.select(`.${$GRID.xgrids}`)\n .selectAll(`.${$GRID.xgrid}`)\n .data(xgridData);\n grid.x.exit().remove();\n grid.x = grid.x.enter()\n .append(\"line\")\n .attr(\"class\", $GRID.xgrid)\n .merge(grid.x);\n if (!withoutUpdate) {\n grid.x.each(function () {\n const grid = select(this);\n Object.keys(state.xgridAttr).forEach(id => {\n grid.attr(id, state.xgridAttr[id]);\n });\n // hide the gridline overlapping the axis line (attr() returns a string)\n grid.style(\"opacity\", () => (+grid.attr(isRotated ? \"y1\" : \"x1\") === (isRotated ? state.height : 0) ?\n \"0\" :\n null));\n });\n }\n },\n updateYGrid() {\n const $$ = this;\n const { axis, config, scale, state, $el: { grid, main } } = $$;\n const isRotated = config.axis_rotated;\n const pos = d => scale.y(d);\n const gridValues = axis.y.getGeneratedTicks(config.grid_y_ticks) ||\n $$.scale.y.ticks(config.grid_y_ticks);\n grid.y = main.select(`.${$GRID.ygrids}`)\n .selectAll(`.${$GRID.ygrid}`)\n .data(gridValues);\n grid.y.exit().remove();\n grid.y = grid.y\n .enter()\n .append(\"line\")\n .attr(\"class\", $GRID.ygrid)\n .merge(grid.y);\n grid.y.attr(\"x1\", isRotated ? pos : 0)\n .attr(\"x2\", isRotated ? pos : state.width)\n .attr(\"y1\", isRotated ? 0 : pos)\n .attr(\"y2\", isRotated ? state.height : pos);\n _smoothLines(grid.y);\n },\n updateGrid() {\n const $$ = this;\n const { $el: { grid, gridLines } } = $$;\n !gridLines.main && $$.initGridLines();\n // hide if arc type\n grid.main.style(\"visibility\", $$.hasArcType() ? \"hidden\" : null);\n $$.hideGridFocus();\n $$.updateGridLines(\"x\");\n $$.updateGridLines(\"y\");\n },\n /**\n * Update Grid lines\n * @param {string} type x | y\n * @private\n */\n updateGridLines(type) {\n const $$ = this;\n const { config, $el: { gridLines, main }, $T } = $$;\n const isRotated = config.axis_rotated;\n const isX = type === \"x\";\n config[`grid_${type}_show`] && $$[`update${type.toUpperCase()}Grid`]();\n let lines = main.select(`.${$GRID[`${type}gridLines`]}`)\n .selectAll(`.${$GRID[`${type}gridLine`]}`)\n .data(config[`grid_${type}_lines`]);\n // exit\n $T(lines.exit())\n .style(\"opacity\", \"0\")\n .remove();\n // enter\n const gridLine = lines.enter().append(\"g\");\n gridLine.append(\"line\")\n .style(\"opacity\", \"0\");\n lines = gridLine.merge(lines);\n lines.each(function (d) {\n const g = select(this);\n if (g.select(\"text\").empty() && d.text) {\n g.append(\"text\")\n .style(\"opacity\", \"0\");\n }\n });\n $T(lines\n .attr(\"class\", d => `${$GRID[`${type}gridLine`]} ${d.class || \"\"}`.trim())\n .select(\"text\")\n .attr(\"text-anchor\", _getGridTextAnchor)\n .attr(\"transform\", () => (isX ?\n (isRotated ? null : \"rotate(-90)\") :\n (isRotated ? \"rotate(-90)\" : null)))\n .attr(\"dx\", _getGridTextDx)\n .attr(\"dy\", -5))\n .text(function (d) {\n return d.text ?? this.remove();\n });\n gridLines[type] = lines;\n },\n redrawGrid(withTransition) {\n const $$ = this;\n const { config: { axis_rotated: isRotated }, state: { width, height }, $el: { gridLines }, $T } = $$;\n const xv = $$.xv.bind($$);\n const yv = $$.yv.bind($$);\n let xLines = gridLines.x.select(\"line\");\n let xTexts = gridLines.x.select(\"text\");\n let yLines = gridLines.y.select(\"line\");\n let yTexts = gridLines.y.select(\"text\");\n xLines = $T(xLines, withTransition)\n .attr(\"x1\", isRotated ? 0 : xv)\n .attr(\"x2\", isRotated ? width : xv)\n .attr(\"y1\", isRotated ? xv : 0)\n .attr(\"y2\", isRotated ? xv : height);\n xTexts = $T(xTexts, withTransition)\n .attr(\"x\", _getGridTextX(!isRotated, width, height))\n .attr(\"y\", xv);\n yLines = $T(yLines, withTransition)\n .attr(\"x1\", isRotated ? yv : 0)\n .attr(\"x2\", isRotated ? yv : width)\n .attr(\"y1\", isRotated ? 0 : yv)\n .attr(\"y2\", isRotated ? height : yv);\n yTexts = $T(yTexts, withTransition)\n .attr(\"x\", _getGridTextX(isRotated, width, height))\n .attr(\"y\", yv);\n return [\n xLines.style(\"opacity\", null),\n xTexts.style(\"opacity\", null),\n yLines.style(\"opacity\", null),\n yTexts.style(\"opacity\", null)\n ];\n },\n initFocusGrid() {\n const $$ = this;\n const { config, state, state: { clip }, $el } = $$;\n // Invalidate cached D3 selection in case grid is re-initialized\n state._gridFocusEl = null;\n const isFront = config.grid_front;\n const className = `.${isFront && $el.gridLines.main ? $GRID.gridLines : $COMMON.chart}${isFront ? \" + *\" : \"\"}`;\n const grid = $el.main.insert(\"g\", className)\n .attr(\"clip-path\", clip.pathGrid)\n .attr(\"class\", $GRID.grid);\n $el.grid.main = grid;\n config.grid_x_show &&\n grid.append(\"g\").attr(\"class\", $GRID.xgrids);\n config.grid_y_show &&\n grid.append(\"g\").attr(\"class\", $GRID.ygrids);\n if (config.axis_tooltip) {\n const axis = grid.append(\"g\").attr(\"class\", \"bb-axis-tooltip\");\n axis.append(\"line\").attr(\"class\", \"bb-axis-tooltip-x\");\n axis.append(\"line\").attr(\"class\", \"bb-axis-tooltip-y\");\n }\n if (config.interaction_enabled && config.grid_focus_show && !config.axis_tooltip) {\n grid.append(\"g\")\n .attr(\"class\", $FOCUS.xgridFocus)\n .append(\"line\")\n .attr(\"class\", $FOCUS.xgridFocus);\n // to show xy focus grid line, should be 'tooltip.grouped=false'\n if (config.grid_focus_y && !config.tooltip_grouped) {\n grid.append(\"g\")\n .attr(\"class\", $FOCUS.ygridFocus)\n .append(\"line\")\n .attr(\"class\", $FOCUS.ygridFocus);\n }\n }\n },\n showAxisGridFocus() {\n const $$ = this;\n const { config, format, state: { event, width, height } } = $$;\n const isRotated = config.axis_rotated;\n // get mouse event position\n const [x, y] = getPointer(event, $$.$el.eventRect?.node());\n const pos = { x, y };\n for (const [axis, node] of Object.entries($$.$el.axisTooltip)) {\n const attr = (axis === \"x\" && !isRotated) || (axis !== \"x\" && isRotated) ? \"x\" : \"y\";\n const value = pos[attr];\n let scaleText = $$.scale[axis]?.invert(value);\n if (scaleText) {\n scaleText = axis === \"x\" && $$.axis.isTimeSeries() ?\n format.xAxisTick(scaleText) :\n scaleText?.toFixed(2);\n // set position & its text value based on position\n node?.attr(attr, value)\n .text(scaleText);\n }\n }\n $$.$el.main.selectAll(`line.bb-axis-tooltip-x, line.bb-axis-tooltip-y`).style(\"visibility\", null)\n .each(function (d, i) {\n const line = select(this);\n if (i === 0) {\n line\n .attr(\"x1\", x)\n .attr(\"x2\", x)\n .attr(\"y1\", i ? 0 : height)\n .attr(\"y2\", i ? height : 0);\n }\n else {\n line\n .attr(\"x1\", i ? 0 : width)\n .attr(\"x2\", i ? width : 0)\n .attr(\"y1\", y)\n .attr(\"y2\", y);\n }\n });\n },\n hideAxisGridFocus() {\n const $$ = this;\n $$.$el.main.selectAll(`line.${$AXIS.axisTooltipX}, line.${$AXIS.axisTooltipY}`).style(\"visibility\", \"hidden\");\n Object.values($$.$el.axisTooltip)\n .forEach((v) => v?.style(\"display\", \"none\"));\n },\n /**\n * Show grid focus line\n * @param {Array} data Selected data\n * @private\n */\n showGridFocus(data) {\n const $$ = this;\n const { config, state: { width, height } } = $$;\n const isRotated = config.axis_rotated;\n // Cache grid focus selection to avoid repeated DOM queries on mousemove\n const focusEl = _getGridFocusEl($$);\n const dataToShow = (data || [focusEl.datum()]).filter(d => d && isValue($$.getBaseValue(d)));\n // Hide when bubble/scatter/stanford plot exists\n if (!config.tooltip_show || dataToShow.length === 0 || (!config.axis_x_forceAsSingle && $$.hasType(\"bubble\")) || $$.hasArcType()) {\n return;\n }\n const isEdge = config.grid_focus_edge && !config.tooltip_grouped;\n const xx = $$.xx.bind($$);\n focusEl\n .style(\"visibility\", null)\n .data(dataToShow.concat(dataToShow))\n .each(function (d) {\n const el = select(this);\n const pos = {\n x: xx(d),\n y: $$.getYScaleById(d.id)(d.value)\n };\n let xy;\n if (el.classed($FOCUS.xgridFocus)) {\n // will contain 'x1, y1, x2, y2' order\n xy = isRotated ?\n [\n null, // x1\n pos.x, // y1\n isEdge ? pos.y : width, // x2\n pos.x // y2\n ] :\n [\n pos.x,\n isEdge ? pos.y : null,\n pos.x,\n height\n ];\n }\n else {\n const isY2 = $$.axis.getId(d.id) === \"y2\";\n xy = isRotated ?\n [\n pos.y, // x1\n isEdge && !isY2 ? pos.x : null, // y1\n pos.y, // x2\n isEdge && isY2 ? pos.x : height // y2\n ] :\n [\n isEdge && isY2 ? pos.x : null,\n pos.y,\n isEdge && !isY2 ? pos.x : width,\n pos.y\n ];\n }\n [\"x1\", \"y1\", \"x2\", \"y2\"]\n .forEach((v, i) => el.attr(v, xy[i]));\n });\n _smoothLines(focusEl);\n $$.showCircleFocus?.(data);\n },\n hideGridFocus(force = false) {\n const $$ = this;\n const { state: { inputType, resizing } } = $$;\n if (force || inputType === \"mouse\" || !resizing) {\n const focusEl = _getGridFocusEl($$);\n focusEl.style(\"visibility\", \"hidden\");\n $$.hideCircleFocus?.();\n }\n },\n updateGridFocus() {\n const $$ = this;\n const { state: { inputType, width, height, resizing }, $el: { grid } } = $$;\n const xgridFocus = grid.main.select(`line.${$FOCUS.xgridFocus}`);\n if (inputType === \"touch\") {\n if (xgridFocus.empty()) {\n resizing && $$.showCircleFocus?.();\n }\n else {\n $$.showGridFocus();\n }\n }\n else {\n const isRotated = $$.config.axis_rotated;\n xgridFocus\n .attr(\"x1\", isRotated ? 0 : -10)\n .attr(\"x2\", isRotated ? width : -10)\n .attr(\"y1\", isRotated ? -10 : 0)\n .attr(\"y2\", isRotated ? -10 : height);\n }\n // need to return 'true' as of being pushed to the redraw list\n // ref: getRedrawList()\n return true;\n },\n generateGridData(type, scale) {\n const $$ = this;\n const tickNum = $$.$el.main.select(`.${$AXIS.axisX}`)\n .selectAll(\".tick\")\n .size();\n let gridData = [];\n if (type === \"year\") {\n const xDomain = $$.getXDomain($$.data.targets);\n const [firstYear, lastYear] = xDomain.map(v => v.getFullYear());\n for (let i = firstYear; i <= lastYear; i++) {\n gridData.push(new Date(`${i}-01-01 00:00:00`));\n }\n }\n else {\n gridData = scale.ticks(AXIS_DEFAULT_TICK_COUNT);\n if (gridData.length > tickNum) { // use only int\n gridData = gridData.filter(d => String(d).indexOf(\".\") < 0);\n }\n }\n return gridData;\n },\n getGridFilterToRemove(params) {\n return params ?\n line => {\n let found = false;\n (isArray(params) ? params.concat() : [params]).forEach(param => {\n if (((\"value\" in param && line.value === param.value) ||\n (\"class\" in param && line.class === param.class))) {\n found = true;\n }\n });\n return found;\n } :\n () => true;\n },\n removeGridLines(params, forX) {\n const $$ = this;\n const { config, $T } = $$;\n const toRemove = $$.getGridFilterToRemove(params);\n const toShow = line => !toRemove(line);\n const classLines = forX ? $GRID.xgridLines : $GRID.ygridLines;\n const classLine = forX ? $GRID.xgridLine : $GRID.ygridLine;\n $T($$.$el.main.select(`.${classLines}`)\n .selectAll(`.${classLine}`)\n .filter(toRemove))\n .style(\"opacity\", \"0\")\n .remove();\n const gridLines = `grid_${forX ? \"x\" : \"y\"}_lines`;\n config[gridLines] = config[gridLines].filter(toShow);\n }\n};\n\nexport { internalGrid as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nvar optGrid = {\n /**\n * Set related options\n * @name grid\n * @memberof Options\n * @type {object}\n * @property {boolean} [front=false] Set 'grid & focus lines' to be positioned over grid lines and chart elements.\n * @property {object} x Grid x object\n * @property {boolean} [x.show=false] Show grids along x axis.\n * @property {Array} [x.lines=[]] Show additional grid lines along x axis.<br>\n * This option accepts array including object that has value, text, position and class. text, position and class are optional. For position, start, middle and end (default) are available.\n * If x axis is category axis, value can be category name. If x axis is timeseries axis, value can be date string, Date object and unixtime integer.\n * @property {object} y Grid y object\n * @property {boolean} [y.show=false] Show grids along x axis.\n * @property {Array} [y.lines=[]] Show additional grid lines along y axis.<br>\n * This option accepts array including object that has value, text, position and class.\n * @property {number} [y.ticks=undefined] Number of y grids to be shown.\n * @property {object} focus Grid focus object\n * @property {boolean} [focus.edge=false] Show edged focus grid line.<br>**NOTE:** Available when [`tooltip.grouped=false`](#.tooltip) option is set.\n * @property {boolean} [focus.show=true] Show grid line when focus.\n * @property {boolean} [focus.y=false] Show y coordinate focus grid line.<br>**NOTE:** Available when [`tooltip.grouped=false`](#.tooltip) option is set.\n * @property {object} lines Grid lines object\n * @property {boolean} [lines.front=true] Set grid lines to be positioned over chart elements.\n * @default undefined\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Grid.GridLines)\n * @see [Demo: X Grid Lines](https://naver.github.io/billboard.js/demo/#Grid.OptionalXGridLines)\n * @see [Demo: Y Grid Lines](https://naver.github.io/billboard.js/demo/#Grid.OptionalYGridLines)\n * @example\n * grid: {\n * x: {\n * show: true,\n * lines: [\n * {value: 2, text: \"Label on 2\"},\n * {value: 5, text: \"Label on 5\", class: \"label-5\"},\n * {value: 6, text: \"Label on 6\", position: \"start\"}\n * ]\n * },\n * y: {\n * show: true,\n * lines: [\n * {value: 100, text: \"Label on 100\"},\n * {value: 200, text: \"Label on 200\", class: \"label-200\"},\n * {value: 300, text: \"Label on 300\", position: 'middle'}\n * ],\n * ticks: 5\n * },\n * front: true,\n * focus: {\n * show: false,\n *\n * // Below options are available when 'tooltip.grouped=false' option is set\n * edge: true,\n * y: true\n * },\n * lines: {\n * front: false\n * }\n * }\n */\n grid_x_show: false,\n grid_x_type: \"tick\",\n grid_x_lines: [],\n grid_y_show: false,\n grid_y_lines: [],\n grid_y_ticks: undefined,\n grid_focus_edge: false,\n grid_focus_show: true,\n grid_focus_y: false,\n grid_front: false,\n grid_lines_front: true\n};\n\nexport { optGrid as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport apiGrid from '../../Chart/api/grid.js';\nimport Chart from '../../Chart/Chart.js';\nimport ChartInternal from '../../ChartInternal/ChartInternal.js';\nimport internalGrid from '../../ChartInternal/internals/grid.js';\nimport optGrid from '../Options/common/grid.js';\nimport Options from '../Options/Options.js';\nimport { extend } from '../../module/util/object.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Enable chart grid API (chart.xgrids() / chart.ygrids()).\n * Tree-shakable: only bundled when imported.\n * @returns {object} Empty options object (safe to spread into bb.generate())\n * @example\n * // ESM — import to enable grid APIs and grid rendering\n * import bb, {bar, grid} from \"billboard.js\";\n *\n * const chart = bb.generate({\n * ...bar(),\n * ...grid(),\n * data: { columns: [...] },\n * grid: { x: { lines: [...] } }\n * });\n *\n * chart.xgrids([{value: 1, text: \"Label\"}]);\n */\nlet grid = () => {\n extend(ChartInternal.prototype, internalGrid);\n // Direct assignment overrides stubs installed by Chart/api/stubs.\n Chart.prototype.xgrids = apiGrid.xgrids;\n Chart.prototype.ygrids = apiGrid.ygrids;\n Options.setOptions([optGrid]);\n return (grid = () => ({}))();\n};\n\nexport { grid };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport Chart from './Chart/Chart.js';\nimport { mergeObj } from './module/util/object.js';\nimport { isObject } from './module/util/type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard project is licensed under the MIT license\n */\nlet defaults = Object.create(null);\n/**\n * @namespace bb\n * @version 4.0.3\n */\nconst bb = {\n /**\n * Version information\n * @property {string} version version\n * @example\n * bb.version; // \"1.0.0\"\n * @memberof bb\n */\n version: \"4.0.3\",\n /**\n * Generate chart\n * - **NOTE:** Bear in mind for the possibility of ***throwing an error***, during the generation when:\n * - Unused option value is given.\n * - ex) For `data.type=\"pie\"` option, setting 'axis' option can cause unexpected generation error.\n * - Insufficient value is given for certain option used.\n * - ex) `data: { x: \"x\", columns: [[\"x\"], [\"data1\", 30, 200, 100]] }`\n * @param {Options} config chart options\n * @memberof bb\n * @returns {Chart}\n * @see {@link Options} for different generation options\n * @see {@link Chart} for different methods API\n * @example\n * <!-- chart holder -->\n * <div id=\"LineChart\"></div>\n * @example\n * // Generate chart with options\n * var chart = bb.generate({\n * \"bindto\": \"#LineChart\"\n * \"data\": {\n * \"columns\": [\n * [\"data1\", 30, 200, 100, 400, 150, 250],\n * [\"data2\", 50, 20, 10, 40, 15, 25]\n * ],\n * \"type\": \"line\"\n * }\n * });\n *\n * // call some API\n * // ex) get the data of 'data1'\n * chart.data(\"data1\");\n * @example\n * // Generate chart by importing ESM.\n * // Import only the shape and API resolvers you use for a smaller bundle.\n * import bb, {\n * bar,\n * category,\n * exportApi,\n * flow,\n * grid,\n * line,\n * regions,\n * step\n * } from \"billboard.js\";\n *\n * const chart = bb.generate({\n * ...category(),\n * ...exportApi(),\n * ...flow(),\n * ...grid(),\n * ...regions(),\n * bindto: \"#LineChart\",\n * data: {\n * columns: [\n * [\"data1\", 30, 200, 100, 400, 150, 250],\n * [\"data2\", 50, 20, 10, 40, 15, 25]\n * ],\n * type: line(),\n *\n * // or specify per-series types\n * types: {\n * data1: bar(),\n * data2: step()\n * }\n * },\n * axis: {\n * x: {\n * type: \"category\",\n * categories: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\"]\n * }\n * },\n * grid: {\n * x: {show: true}\n * },\n * regions: [\n * {axis: \"x\", start: \"Feb\", end: \"Apr\"}\n * ]\n * });\n *\n * chart.export();\n * @example\n * // Generate a canvas-rendered chart by importing the canvas ESM entry.\n * import bb, {\n * bar,\n * canvas,\n * category,\n * exportApi,\n * flow,\n * grid,\n * regions,\n * subchart\n * } from \"billboard.js/canvas\";\n *\n * const chart = bb.generate({\n * render: {\n * mode: canvas()\n * },\n * ...category(),\n * ...exportApi(),\n * ...flow(),\n * ...grid(),\n * ...regions(),\n * bindto: \"#LineChart\",\n * data: {\n * columns: [\n * [\"data1\", 30, 200, 100, 400]\n * ],\n * type: bar()\n * },\n * axis: {\n * x: {\n * type: \"category\",\n * categories: [\"Jan\", \"Feb\", \"Mar\", \"Apr\"]\n * }\n * },\n * grid: {\n * x: {show: true, lines: [{value: \"Feb\", text: \"Milestone\"}]},\n * y: {show: true}\n * },\n * regions: [\n * {axis: \"x\", start: \"Feb\", end: \"Mar\", label: {text: \"Campaign\"}}\n * ],\n * subchart: {\n * show: subchart()\n * }\n * });\n *\n * chart.xgrids([{value: \"Mar\", text: \"API grid\"}]);\n * chart.regions([{axis: \"x\", start: \"Jan\", end: \"Feb\"}]);\n * chart.flow({columns: [[\"data1\", 120]]});\n * chart.export();\n *\n * // Arc-family chart types (`pie`, `donut`, `gauge`, `polar`, `radar`)\n * // stay SVG-only because canvas mode doesn't provide meaningful benefit.\n */\n generate(config) {\n const options = mergeObj(Object.create(null), defaults, config);\n const inst = new Chart(options);\n inst.internal.charts = this.instance;\n this.instance.push(inst);\n return inst;\n },\n /**\n * Set or get global default options.\n * - **NOTE:**\n * - The options values settings are valid within page context only.\n * - If is called multiple times, will override the last value.\n * @param {Options} options chart options\n * @memberof bb\n * @returns {Options}\n * @see {@link Options}\n * @example\n * // Set same option value as for `.generate()`\n * bb.defaults({\n * data: {\n * type: \"bar\"\n * }\n * });\n *\n * bb.defaults(); // {data:{type: \"bar\"}}\n *\n * // data.type defaults to 'bar'\n * var chart = bb.generate({ ... });\n */\n defaults(options) {\n if (isObject(options)) {\n defaults = options;\n }\n return defaults;\n },\n /**\n * An array containing instance created\n * @property {Array} instance instance array\n * @example\n * // generate charts\n * var chart1 = bb.generate(...);\n * var chart2 = bb.generate(...);\n *\n * bb.instance; // [ chart1, chart2, ... ]\n * @memberof bb\n */\n instance: [],\n /**\n * Namespace for plugins\n * @property {object} plugin plugin namespace\n * @example\n * // Stanford diagram plugin\n * bb.plugin.stanford;\n * @memberof bb\n */\n plugin: {}\n};\n\nexport { bb, bb as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { select, namespaces } from 'd3-selection';\nimport { document as doc } from '../../../module/browser.js';\nimport { notEmpty, isObjectType, isFunction } from '../../../module/util/type-checks.js';\nimport { sanitize } from '../../../module/sanitize.js';\nimport { toArray } from '../../../module/util/object.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Check if point draw methods are valid\n * @param {string} point point type\n * @returns {boolean}\n * @private\n */\nfunction _hasValidPointDrawMethods(point) {\n return isObjectType(point) &&\n isFunction(point.create) && isFunction(point.update);\n}\n/**\n * Insert point info defs element\n * @param {string} point Point element\n * @param {string} id Point id\n * @private\n */\nfunction _insertPointInfoDefs(point, id) {\n const $$ = this;\n const copyAttr = (from, target) => {\n const attribs = from.attributes;\n for (let i = 0, name; (name = attribs[i]); i++) {\n name = name.name;\n target.setAttribute(name, from.getAttribute(name));\n }\n };\n const doc$1 = new DOMParser().parseFromString(sanitize(point), \"image/svg+xml\");\n const node = doc$1.documentElement;\n const clone = doc.createElementNS(namespaces.svg, node.nodeName.toLowerCase());\n clone.id = id;\n clone.style.fill = \"inherit\";\n clone.style.stroke = \"inherit\";\n copyAttr(node, clone);\n if (node.childNodes?.length) {\n const parent = select(clone);\n if (\"innerHTML\" in clone) {\n parent.html(sanitize(node.innerHTML));\n }\n else {\n toArray(node.childNodes).forEach(v => {\n copyAttr(v, parent.append(v.tagName).node());\n });\n }\n }\n $$.$el.defs.node().appendChild(clone);\n}\nvar shapePointCommon = {\n /**\n * Check if point type option is valid\n * @param {string} type point type\n * @returns {boolean}\n * @private\n */\n hasValidPointType(type) {\n // For point.pattern, allow additional SVG shape tags (polygon, ellipse, use)\n // These will be sanitized before use\n return /^(circle|rect(angle)?|polygon|ellipse|use)$/i.test(type || this.config.point_type);\n },\n /**\n * Check if pattern point is set to be used on legend\n * @returns {boolean}\n * @private\n */\n hasLegendDefsPoint() {\n const { config } = this;\n return config.legend_show && config.point_pattern?.length && config.legend_usePoint;\n },\n getDefsPointId(id) {\n const { state: { datetimeId } } = this;\n return `${datetimeId}-point${id}`;\n },\n /**\n * Get validated point pattern array\n * @returns {Array} Array of point types\n * @private\n */\n getValidPointPattern() {\n const { config } = this;\n // Ensure point_type is restricted to 'circle' or 'rectangle' only\n const validPointType = /^(circle|rect(angle)?)$/i.test(config.point_type) ?\n config.point_type :\n \"circle\";\n return notEmpty(config.point_pattern) ? config.point_pattern : [validPointType];\n },\n /**\n * Get generate point function\n * @returns {function}\n * @private\n */\n generatePoint() {\n const $$ = this;\n const { $el, config } = $$;\n const ids = [];\n const pattern = $$.getValidPointPattern();\n return function (method, context, ...args) {\n return function (d) {\n const id = $$.getTargetSelectorSuffix(d.id || d.data?.id || d);\n const element = select(this);\n ids.indexOf(id) < 0 && ids.push(id);\n let point = pattern[ids.indexOf(id) % pattern.length];\n if ($$.hasValidPointType(point)) {\n point = $$[point];\n }\n else if (!_hasValidPointDrawMethods(point || config.point_type)) {\n const pointId = $$.getDefsPointId(id);\n const defsPoint = $el.defs.select(`#${pointId}`);\n if (defsPoint.size() < 1) {\n _insertPointInfoDefs.call($$, point, pointId);\n }\n if (method === \"create\") {\n return $$.custom?.create.bind(context)(element, pointId, ...args);\n }\n else if (method === \"update\") {\n return $$.custom?.update.bind(context)(element, ...args);\n }\n }\n return point[method]?.bind(context)(element, ...args);\n };\n };\n }\n};\n\nexport { shapePointCommon as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * point config options\n */\nvar optPoint = {\n /**\n * Set point options\n * @name point\n * @memberof Options\n * @type {object}\n * @property {object} point Point object\n * @property {boolean} [point.show=true] Whether to show each point in line.\n * @property {number|function} [point.r=2.5] The radius size of each point.\n * - **NOTE:** Disabled for 'bubble' type\n * @property {boolean|object} [point.radialGradient=false] Set the radial gradient on point.<br><br>\n * Or customize by giving below object value:\n * - cx {number}: `cx` value (default: `0.3`)\n * - cy {number}: `cy` value (default: `0.3`)\n * - r {number}: `r` value (default: `0.7`)\n * - stops {Array}: Each item should be having `[offset, stop-color, stop-opacity]` values.\n * - (default: `[[0.1, $DATA_COLOR, 1], [0.9, $DATA_COLOR, 0]]`)\n * @property {boolean} [point.focus.expand.enabled=true] Whether to expand each point on focus.\n * @property {number} [point.focus.expand.r=point.r*1.75] The radius size of each point on focus.\n * - **NOTE:** For 'bubble' type, the default is `bubbleSize*1.15`\n * @property {boolean} [point.focus.only=false] Show point only when is focused.\n * @property {number|null} [point.opacity=undefined] Set point opacity value.\n * - **NOTE:**\n * \t- `null` will make to not set inline 'opacity' css prop.\n * \t- when no value(or undefined) is set, it defaults to set opacity value according its chart types.\n * @property {number|string|function} [point.sensitivity=10] The sensitivity value for interaction boundary.\n * - **Available Values:**\n * - {number}: Absolute sensitivity value which is the distance from the data point in pixel.\n * - \"radius\": sensitivity based on point's radius\n * - Function: callback for each point to determine the sensitivity<br>\n * \t```js\n * \tsensitivity: function(d) {\n * \t // ex. of argument d:\n * \t // ==> {x: 2, value: 55, id: 'data3', index: 2, r: 19.820624179302296}\n *\n * \t // returning d.r, will make sensitivity same as point's radius value.\n * \t return d.r;\n * \t}\n * \t```\n * @property {number} [point.select.r=point.r*4] The radius size of each point on selected.\n * @property {string} [point.type=\"circle\"] The type of point to be drawn\n * - **NOTE:**\n * - If chart has 'bubble' type, only circle can be used.\n * - For IE, non circle point expansions are not supported due to lack of transform support.\n * - **Available Values:**\n * - circle\n * - rectangle\n * @property {Array} [point.pattern=[]] The type of point or svg shape as string, to be drawn for each line\n * - **NOTE:**\n * - This is an `experimental` feature and can have some unexpected behaviors.\n * - If chart has 'bubble' type, only circle can be used.\n * - For IE, non circle point expansions are not supported due to lack of transform support.\n * - Only common SVG tags are allowed to prevent XSS attacks. If creating charts from user input, it is recommended to sanitize input values to avoid potential vulnerabilities.\n * - **Available Values:**\n * - circle\n * - rectangle\n * - svg shape tag interpreted as string<br>\n * (ex. `<polygon points='2.5 0 0 5 5 5'></polygon>`)\n * @see [Demo: point type](https://naver.github.io/billboard.js/demo/#Point.RectanglePoints)\n * @see [Demo: point focus only](https://naver.github.io/billboard.js/demo/#Point.FocusOnly)\n * @see [Demo: point radialGradient](https://naver.github.io/billboard.js/demo/#Point.RadialGradientPoint)\n * @see [Demo: point sensitivity](https://naver.github.io/billboard.js/demo/#Point.PointSensitivity)\n * @example\n * point: {\n * show: false,\n * r: 5,\n *\n * // or customize the radius\n * r: function(d) {\n * ...\n * return r;\n * },\n *\n * // will generate following radialGradient:\n * // for more info: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/radialGradient\n * // <radualGradient cx=\"0.3\" cy=\"0.3\" r=\"0.7\">\n * // <stop offset=\"0.1\" stop-color=\"$DATA_COLOR\" stop-opacity=\"1\"></stop>\n * // <stop offset=\"0.9\" stop-color=\"$DATA_COLOR\" stop-opacity=\"0\"></stop>\n * // </radialrGradient>\n * radialGradient: true,\n *\n * // Or customized gradient\n * radialGradient: {\n * \tcx: 0.3, // cx attributes\n * \tcy: 0.5, // cy attributes\n * \tr: 0.7, // r attributes\n * \tstops: [\n * \t // offset, stop-color, stop-opacity\n * \t [0, \"#7cb5ec\", 1],\n *\n * \t // setting 'null' for stop-color, will set its original data color\n * \t [0.5, null, 0],\n *\n * \t // setting 'function' for stop-color, will pass data id as argument.\n * \t // It should return color string or null value\n * \t [1, function(id) { return id === \"data1\" ? \"red\" : \"blue\"; }, 0],\n * \t]\n * },\n *\n * focus: {\n * expand: {\n * enabled: true,\n * r: 1\n * },\n * only: true\n * },\n *\n * // do not set inline 'opacity' css prop setting\n * opacity: null,\n *\n * // set every data point's opacity value\n * opacity: 0.7,\n *\n * select: {\n * r: 3\n * },\n *\n * // having lower value, means how closer to be for interaction\n * sensitivity: 3,\n *\n * // sensitivity based on point's radius\n * sensitivity: \"radius\",\n *\n * // callback for each point to determine the sensitivity\n * sensitivity: function(d) {\n * \t// ex. of argument d:\n * \t// ==> {x: 2, value: 55, id: 'data3', index: 2, r: 19.820624179302296}\n *\n * \t// returning d.r, will make sensitivity same as point's radius value.\n * \treturn d.r;\n * }\n *\n * // valid values are \"circle\" or \"rectangle\"\n * type: \"rectangle\",\n *\n * // or indicate as pattern\n * pattern: [\n * \"circle\",\n * \"rectangle\",\n * \"<polygon points='0 6 4 0 -4 0'></polygon>\"\n * ],\n * }\n */\n point_show: true,\n point_r: 2.5,\n point_radialGradient: false,\n point_sensitivity: 10,\n point_focus_expand_enabled: true,\n point_focus_expand_r: undefined,\n point_focus_only: false,\n point_opacity: undefined,\n point_pattern: [],\n point_select_r: undefined,\n point_type: \"circle\"\n};\n\nexport { optPoint as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { isDefined, isValue, isObjectType, isNumber } from '../../module/util/type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Set the min/max value\n * @param {Chart} $$ Chart instance\n * @param {string} type Set type 'min' or 'max'\n * @param {object} value Value to be set\n * @private\n */\nfunction setMinMax($$, type, value) {\n const { config } = $$;\n const helper = (key, value) => {\n const v = isNumber(value) ? value : (value === false ? undefined : null);\n if (v !== null) {\n config[`axis_${key}_${type}`] = v;\n }\n };\n if (isDefined(value)) {\n if (isObjectType(value)) {\n Object.keys(value).forEach(key => {\n helper(key, value[key]);\n });\n }\n else if (isNumber(value) || value === false) {\n // shorthand values affects only y and y2.\n [\"y\", \"y2\"].forEach(key => {\n helper(key, value);\n });\n }\n $$.state.dirty.data = true;\n $$.redraw({\n withUpdateOrgXDomain: true,\n withUpdateXDomain: true\n });\n }\n}\n/**\n * Get the min/max value\n * @param {Chart} $$ Chart instance\n * @param {string} type Set type 'min' or 'max'\n * @returns {{x, y, y2}}\n * @private\n */\nfunction getMinMax($$, type) {\n const { config } = $$;\n return {\n x: config[`axis_x_${type}`],\n y: config[`axis_y_${type}`],\n y2: config[`axis_y2_${type}`]\n };\n}\n/**\n * Define axis\n * @ignore\n */\nconst axis = {\n /**\n * Get and set axis labels.\n * - **NOTE:** Only applicable for chart types which has x and y axes.\n * @function axis․labels\n * @instance\n * @memberof Chart\n * @param {object} labels specified axis' label to be updated.\n * @param {string} [labels.x] x Axis string\n * @param {string} [labels.y] y Axis string\n * @param {string} [labels.y2] y2 Axis string\n * @returns {object|undefined} axis labels text object\n * @example\n * // Update axis' label\n * chart.axis.labels({\n * x: \"New X Axis Label\",\n * y: \"New Y Axis Label\",\n * y2: \"New Y2 Axis Label\"\n * });\n *\n * chart.axis.labels();\n * // --> {\n * // x: \"New X Axis Label\",\n * // y: \"New Y Axis Label\",\n * // y2: \"New Y2 Axis Label\"\n * // }\n */\n labels: function (labels) {\n const $$ = this.internal;\n let labelText;\n if (labels) {\n Object.keys(labels).forEach(axisId => {\n $$.axis.setLabelText(axisId, labels[axisId]);\n });\n if ($$.state.isCanvasMode) {\n $$.renderCanvasFrame?.(undefined, null, false);\n }\n else {\n $$.axis.updateLabels();\n }\n }\n [\"x\", \"y\", \"y2\"].forEach(v => {\n const text = $$.axis.getLabelText(v);\n if (text) {\n !labelText && (labelText = {});\n labelText[v] = text;\n }\n });\n return labelText;\n },\n /**\n * Get and set axis min value.\n * - **NOTE:** Only applicable for chart types which has x and y axes.\n * @function axis․min\n * @instance\n * @memberof Chart\n * @param {object} min If min is given, specified axis' min value will be updated.<br>\n * If no argument is given, the min values set on generating option for each axis will be returned.\n * If not set any min values on generation, it will return `undefined`.<br>\n * To unset specific axis max, set `false` to each of them.\n * @returns {object|undefined}\n * @example\n * // Update axis' min\n * chart.axis.min({\n * x: -10,\n * y: 1000,\n * y2: 100\n * });\n *\n * // To unset specific axis min, set false to each of them.\n * chart.axis.min({\n * x: false,\n * y: false,\n * y2: false\n * });\n *\n * // shorthand (only affects y and y2 axis)\n * chart.axis.min(-50);\n * chart.axis.min(false);\n */\n min: function (min) {\n const $$ = this.internal;\n return isValue(min) || min === false ?\n setMinMax($$, \"min\", min) :\n getMinMax($$, \"min\");\n },\n /**\n * Get and set axis max value.\n * - **NOTE:** Only applicable for chart types which has x and y axes.\n * @function axis․max\n * @instance\n * @memberof Chart\n * @param {object} max If max is given, specified axis' max value will be updated.<br>\n * If no argument is given, the max values set on generating option for each axis will be returned.\n * If not set any max values on generation, it will return `undefined`.<br>\n * To unset specific axis max, set `false` to each of them.\n * @returns {object|undefined}\n * @example\n * // Update axis' label\n * chart.axis.max({\n * x: 100,\n * y: 1000,\n * y2: 10000\n * });\n *\n * // To unset specific axis max, set false to each of them.\n * chart.axis.max({\n * x: false,\n * y: false,\n * y2: false\n * });\n *\n * // shorthand (only affects y and y2 axis)\n * chart.axis.max(10);\n * chart.axis.max(false);\n */\n max: function (max) {\n const $$ = this.internal;\n return isValue(max) || max === false ?\n setMinMax($$, \"max\", max) :\n getMinMax($$, \"max\");\n },\n /**\n * Get and set axis min and max value.\n * - **NOTE:** Only applicable for chart types which has x and y axes.\n * @function axis․range\n * @instance\n * @memberof Chart\n * @param {object} range If range is given, specified axis' min and max value will be updated.\n * If no argument is given, the current min and max values for each axis will be returned.<br>\n * To unset specific axis max, set `false` to each of them.\n * @returns {object|undefined}\n * @example\n * // Update axis' label\n * chart.axis.range({\n * min: {\n * x: -10,\n * y: -1000,\n * y2: -10000\n * },\n * max: {\n * x: 100,\n * y: 1000,\n * y2: 10000\n * },\n * });\n *\n * // To unset specific axis max, set false to each of them.\n * chart.axis.range({\n * min: {\n * x: false,\n * y: false,\n * y2: false\n * },\n * max: {\n * x: false,\n * y: false,\n * y2: false\n * },\n * });\n *\n * // shorthand (only affects y and y2 axis)\n * chart.axis.range({ min: -50, max: 1000 });\n * chart.axis.range({ min: false, max: false });\n */\n range: function (range) {\n const { axis } = this;\n if (arguments.length) {\n const { min, max } = range;\n isDefined(max) && axis.max(max);\n isDefined(min) && axis.min(min);\n }\n else {\n return {\n max: axis.max(),\n min: axis.min()\n };\n }\n return undefined;\n }\n};\nvar apiAxis = { axis };\n\nexport { apiAxis as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { isUndefined } from '../../module/util/type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\nvar apiGroup = {\n /**\n * Update groups for the targets.\n * @function groups\n * @instance\n * @memberof Chart\n * @param {Array} groups This argument needs to be an Array that includes one or more Array that includes target ids to be grouped.\n * @returns {Array} Grouped data names array\n * @example\n * // data1 and data2 will be a new group.\n * chart.groups([\n * [\"data1\", \"data2\"]\n * ]);\n */\n groups(groups) {\n const $$ = this.internal;\n const { config } = $$;\n if (isUndefined(groups)) {\n return config.data_groups;\n }\n config.data_groups = groups;\n $$.state.dirty.data = true;\n $$.redraw();\n return config.data_groups;\n }\n};\n\nexport { apiGroup as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { isObject, isArray } from '../../module/util/type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\nvar apiX = {\n /**\n * Get and set x values for the chart.\n * @function x\n * @instance\n * @memberof Chart\n * @param {Array} x If x is given, x values of every target will be updated. If no argument is given, current x values will be returned as an Object whose keys are the target ids.\n * @returns {object} xs\n * @example\n * // Get current x values\n * chart.x();\n *\n * // Update x values for all targets\n * chart.x([100, 200, 300, 400, ...]);\n */\n x(x) {\n const $$ = this.internal;\n const { axis, data } = $$;\n const isCategorized = axis.isCustomX() && axis.isCategorized();\n if (isArray(x)) {\n if (isCategorized) {\n this.categories(x);\n }\n else {\n $$.updateTargetX(data.targets, x);\n $$.state.dirty.data = true;\n $$.redraw({\n withUpdateOrgXDomain: true,\n withUpdateXDomain: true\n });\n }\n }\n return isCategorized ? this.categories() : data.xs;\n },\n /**\n * Get and set x values for the chart.\n * @function xs\n * @instance\n * @memberof Chart\n * @param {Array} xs If xs is given, specified target's x values will be updated. If no argument is given, current x values will be returned as an Object whose keys are the target ids.\n * @returns {object} xs\n * @example\n * // Get current x values\n * chart.xs();\n *\n * // Update x values for all targets\n * chart.xs({\n * data1: [10, 20, 30, 40, ...],\n * data2: [100, 200, 300, 400, ...]\n * });\n */\n xs(xs) {\n const $$ = this.internal;\n if (isObject(xs)) {\n $$.updateTargetXs($$.data.targets, xs);\n $$.state.dirty.data = true;\n $$.redraw({\n withUpdateOrgXDomain: true,\n withUpdateXDomain: true\n });\n }\n return $$.data.xs;\n }\n};\n\nexport { apiX as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { getScale } from '../internals/scale.js';\nimport { getBBox } from '../../module/util/dom.js';\nimport { isValue, isDefined } from '../../module/util/type-checks.js';\n\nclass AxisRendererHelper {\n owner;\n config;\n scale;\n charSize = {};\n constructor(owner) {\n const scale = getScale();\n const { config, params } = owner;\n this.owner = owner;\n this.config = config;\n this.scale = scale;\n if (config.noTransition || !params.config.transition_duration) {\n config.withoutTransition = true;\n }\n // set range\n config.range = this.scaleExtent((params.orgXScale || scale).range());\n }\n /**\n * Compute a character dimension\n * @param {string} orient Axis orientation\n * @param {d3.selection} text SVG text selection\n * @param {boolean} memoize memoize the calculated size\n * @returns {{w: number, h: number}}\n * @private\n */\n getSizeFor1Char(orient, text, memoize = true) {\n // default size for one character\n const size = {\n w: 5.5,\n h: 11.5\n };\n if (this.charSize[orient] && memoize) {\n return this.charSize[orient];\n }\n !text.empty() && text\n .text(\"0\")\n .call((el) => {\n try {\n const { width, height } = getBBox(el.node(), true);\n if (width && height) {\n size.w = width;\n size.h = height;\n }\n }\n finally {\n el.text(\"\");\n }\n });\n this.charSize[orient] = size;\n return size;\n }\n /**\n * Get tick transform setter function\n * @param {string} id Axis id\n * @returns {(selection: d3Selection, scale) => void} transfrom setter function\n * @private\n */\n getTickTransformSetter(id) {\n const { config } = this;\n const fn = id === \"x\" ?\n value => `translate(${value + config.tickOffset},0)` :\n value => `translate(0,${value})`;\n return (selection, scale) => {\n selection.attr(\"transform\", d => {\n const x = scale(d);\n return isValue(d) ? fn(x) : null;\n });\n };\n }\n scaleExtent(domain) {\n const start = domain[0];\n const stop = domain[domain.length - 1];\n return start < stop ? [start, stop] : [stop, start];\n }\n generateTicks(scale, isYAxes) {\n const { tickStepSize } = this.owner.params;\n const [start, end] = scale.domain();\n let ticks = [];\n // When 'axis[y|y2].tick.stepSize' option is set\n if (isYAxes && tickStepSize) {\n let interval = Math.round(start);\n while (interval <= end) {\n ticks.push(interval);\n interval += tickStepSize;\n }\n }\n else if (scale.ticks) {\n const { tickArguments } = this.config;\n // adjust excessive tick count show\n if (scale.type === \"log\" && !tickArguments) {\n // nicer symlog ticks didn't implemented yet: https://github.com/d3/d3-scale/issues/162\n // get ticks values from logScale\n const s = getScale(\"_log\")\n .domain([start > 0 ? start : 1, end])\n .range(scale.range());\n ticks = s.ticks();\n for (let cnt = end.toFixed().length; ticks.length > 15; cnt--) {\n ticks = s.ticks(cnt);\n }\n ticks.splice(0, 1, start);\n ticks.splice(ticks.length - 1, 1, end);\n }\n else {\n ticks = scale\n .ticks(...(this.config.tickArguments || []));\n }\n }\n return ticks;\n }\n copyScale() {\n const newScale = this.scale.copy();\n if (!newScale.domain().length) {\n newScale.domain(this.scale.domain());\n }\n newScale.type = this.scale.type;\n return newScale;\n }\n textFormatted(v) {\n const tickFormat = this.config.tickFormat;\n // to round float numbers from 'binary floating point'\n // https://en.wikipedia.org/wiki/Double-precision_floating-point_format\n // https://stackoverflow.com/questions/17849101/laymans-explanation-for-why-javascript-has-weird-floating-math-ieee-754-stand\n const value = /\\d+\\.\\d+0{5,}\\d$/.test(v) ? +String(v).replace(/0+\\d$/, \"\") : v;\n const formatted = tickFormat ? tickFormat(value) : value;\n return isDefined(formatted) ? formatted : \"\";\n }\n transitionise(selection) {\n const { config } = this;\n let transitionSelection = selection;\n if (config.withoutTransition) {\n transitionSelection = selection.interrupt();\n }\n else if (config.transition || !this.owner.params.noTransition) {\n // prevent for 'transition not found' case\n // https://github.com/naver/billboard.js/issues/2140\n try {\n transitionSelection = selection.transition(config.transition);\n }\n catch { }\n }\n return transitionSelection;\n }\n}\n\nexport { AxisRendererHelper as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { select } from 'd3-selection';\nimport { $COMMON } from '../../config/classes.js';\nimport { AXIS_TICK_LENGTH, AXIS_TICK_SIZE, AXIS_TICK_PADDING } from '../../config/const.js';\nimport AxisRendererHelper from './AxisRendererHelper.js';\nimport { isFunction, isArray, isNumber, isString } from '../../module/util/type-checks.js';\nimport { toArray } from '../../module/util/object.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n * @ignore\n */\nclass AxisRenderer {\n helper;\n config;\n params;\n g;\n generatedTicks = [];\n canReuseTickTextOnResize(isLeftRight) {\n const { config, params } = this;\n const { config: chartConfig, id, owner } = params;\n const isX = /^(x|subX)$/.test(id);\n const type = id === \"subX\" ? \"x\" : id;\n const customTickFormat = id === \"subX\" ?\n chartConfig.subchart_axis_x_tick_format || chartConfig.axis_x_tick_format :\n chartConfig[`axis_${type}_tick_format`];\n const categoryAutoWrap = params.tickMultiline && params.isCategory && !isLeftRight &&\n !(params.tickWidth > 0);\n return !!(owner.state.resizing &&\n !owner.state.flowing &&\n !isFunction(chartConfig.axis_evalTextSize) &&\n !customTickFormat &&\n !params.tickTitle &&\n !(isX && chartConfig.axis_x_tick_autorotate) &&\n !categoryAutoWrap &&\n config.withoutTransition);\n }\n canReuseTickNodesOnResize(tickNodes, ticks, isLeftRight, tickShow) {\n if (tickShow.tick || !tickShow.text || !this.canReuseTickTextOnResize(isLeftRight) ||\n tickNodes.size() !== ticks.length) {\n return false;\n }\n const nodes = tickNodes.nodes();\n for (let i = 0; i < ticks.length; i++) {\n const current = nodes[i].__data__;\n const next = ticks[i];\n if (current instanceof Date || next instanceof Date) {\n if (+current !== +next) {\n return false;\n }\n }\n else if (current !== next) {\n return false;\n }\n }\n return true;\n }\n constructor(params = {}) {\n const config = {\n innerTickSize: AXIS_TICK_SIZE,\n outerTickSize: params.outerTick ? AXIS_TICK_SIZE : 0,\n orient: \"bottom\",\n range: [],\n tickArguments: null,\n tickCentered: null,\n tickCulling: true,\n tickFormat: null,\n tickLength: AXIS_TICK_LENGTH,\n tickOffset: 0,\n tickPadding: AXIS_TICK_PADDING,\n tickValues: null,\n transition: null,\n noTransition: params.noTransition\n };\n config.tickLength = Math.max(config.innerTickSize, 0) + config.tickPadding;\n this.config = config;\n this.params = params;\n this.helper = new AxisRendererHelper(this);\n }\n /**\n * Create axis element\n * @param {d3.selection} g Axis selection\n * @private\n */\n create(g) {\n const ctx = this;\n const { config, helper, params } = ctx;\n const { scale } = helper;\n const { orient } = config;\n const splitTickText = this.splitTickText.bind(ctx);\n const isLeftRight = /^(left|right)$/.test(orient);\n const isTopBottom = /^(top|bottom)$/.test(orient);\n // line/text enter and path update\n const tickTransform = helper.getTickTransformSetter(isTopBottom ? \"x\" : \"y\");\n const axisPx = tickTransform === helper.axisX ? \"y\" : \"x\";\n const sign = /^(top|left)$/.test(orient) ? -1 : 1;\n // tick text helpers\n const rotate = params.tickTextRotate;\n this.config.range = scale.rangeExtent ?\n scale.rangeExtent() :\n helper.scaleExtent((params.orgXScale || scale).range());\n const { innerTickSize, tickLength, range } = config;\n // // get the axis' tick position configuration\n const id = params.id;\n const tickTextPos = id && /^(x|y|y2)$/.test(id) ?\n params.config[`axis_${id}_tick_text_position`] :\n { x: 0, y: 0 };\n // tick visiblity\n const prefix = id === \"subX\" ? `subchart_axis_x` : `axis_${id}`;\n const axisShow = params.config[`${prefix}_show`];\n const tickShow = {\n tick: axisShow ? params.config[`${prefix}_tick_show`] : false,\n text: axisShow ? params.config[`${prefix}_tick_text_show`] : false\n };\n const evalTextSize = params.config.axis_evalTextSize;\n let $g;\n g.each(function () {\n const g = select(this);\n let scale0 = this.__chart__ || scale;\n let scale1 = helper.copyScale();\n $g = g;\n this.__chart__ = scale1;\n config.tickOffset = params.isCategory ? (scale1(1) - scale1(0)) / 2 : 0;\n // update selection - data join\n const path = g.selectAll(\".domain\").data([0]);\n // enter + update selection\n path.enter().append(\"path\")\n .attr(\"class\", \"domain\")\n // https://observablehq.com/@d3/d3-selection-2-0\n .merge(path)\n .attr(\"d\", () => {\n const outerTickSized = config.outerTickSize * sign;\n return isTopBottom ?\n `M${range[0]},${outerTickSized}V0H${range[1]}V${outerTickSized}` :\n `M${outerTickSized},${range[0]}H0V${range[1]}H${outerTickSized}`;\n });\n if (tickShow.tick || tickShow.text) {\n // count of tick data in array\n const ticks = config.tickValues ||\n helper.generateTicks(scale1, isLeftRight || params.config.axis_rotated);\n // set generated ticks\n ctx.generatedTicks = ticks;\n // update selection\n let tick = g.selectAll(\".tick\");\n const canReuseTickNodes = ctx.canReuseTickNodesOnResize(tick, ticks, isLeftRight || params.config.axis_rotated, tickShow);\n if (canReuseTickNodes) {\n tickTransform(tick, scale1);\n }\n else {\n tick = tick.data(ticks, scale1);\n // enter selection\n const tickEnter = tick\n .enter()\n .insert(\"g\", \".domain\")\n .attr(\"class\", \"tick\");\n // MEMO: No exit transition. The reason is this transition affects max tick width calculation because old tick will be included in the ticks.\n const tickExit = tick.exit().remove();\n // enter + update selection\n tick = tickEnter.merge(tick);\n tickShow.tick && tickEnter.append(\"line\");\n tickShow.text && tickEnter.append(\"text\");\n const hasTickChange = !tickEnter.empty() || !tickExit.empty();\n const reuseTickText = tickShow.text && !hasTickChange &&\n ctx.canReuseTickTextOnResize(isLeftRight || params.config.axis_rotated);\n let sizeFor1Char = { w: 0, h: 0 };\n let textUpdate = tick.selectAll(\"text.__bb-empty\");\n if (tickShow.text && !reuseTickText) {\n const tickText = tick.select(\"text\");\n const counts = [];\n textUpdate = tickText;\n if (isFunction(evalTextSize)) {\n // set evalTextSize to dummy axis element to be used in .getMaxTickSize()\n sizeFor1Char = evalTextSize.bind(ctx.params.owner.api)(tickText.node(), id);\n if (this.classList.contains($COMMON.dummy)) {\n this.sizeFor1Char = sizeFor1Char;\n }\n }\n if (!sizeFor1Char || sizeFor1Char.w === 0 || sizeFor1Char.h === 0) {\n sizeFor1Char = ctx.helper.getSizeFor1Char(orient, tickText, !!evalTextSize);\n }\n let tspan = tickText\n .selectAll(\"tspan\")\n .data((d, index) => {\n let split;\n if (params.tickMultiline) {\n split = splitTickText(d, scale1, ticks, isLeftRight, sizeFor1Char.w);\n }\n else {\n const formatted = helper.textFormatted(d);\n split = isArray(formatted) ? formatted.concat() : [formatted];\n }\n counts[index] = split.length;\n return split.map(splitted => ({ index, splitted }));\n });\n tspan.exit().remove();\n tspan = tspan\n .enter()\n .append(\"tspan\")\n .merge(tspan)\n .text(d => d.splitted);\n // set <tspan>'s position\n tspan\n .attr(\"x\", isTopBottom ? 0 : tickLength * sign)\n .attr(\"dx\", (() => {\n let dx = 0;\n if (/(top|bottom)/.test(orient) && rotate) {\n dx = 8 * Math.sin(Math.PI * (rotate / 180)) *\n (orient === \"top\" ? -1 : 1);\n }\n return dx + (tickTextPos.x || 0);\n })())\n .attr(\"dy\", (d, i) => {\n const defValue = \".71em\";\n let dy = 0;\n if (orient !== \"top\") {\n dy = sizeFor1Char.h;\n if (i === 0) {\n dy = isLeftRight ?\n -((counts[d.index] - 1) * (sizeFor1Char.h / 2) - 3) :\n (tickTextPos.y === 0 ? defValue : 0);\n }\n }\n return isNumber(dy) && tickTextPos.y ?\n dy + tickTextPos.y :\n dy || defValue;\n });\n }\n const lineUpdate = tick.select(\"line\");\n tickEnter.select(\"line\").attr(`${axisPx}2`, innerTickSize * sign);\n tickEnter.select(\"text\").attr(axisPx, tickLength * sign);\n ctx.setTickLineTextPosition(lineUpdate, textUpdate, sizeFor1Char);\n // Append <title> for tooltip display\n if (params.tickTitle) {\n const title = textUpdate.select(\"title\");\n const tickTitle = params.tickTitle;\n (title.empty() ? textUpdate.append(\"title\") : title)\n .text(index => tickTitle[Number(index)]);\n }\n if (scale1.bandwidth) {\n const x = scale1;\n const dx = x.bandwidth() / 2;\n scale0 = d => x(d) + dx;\n scale1 = scale0;\n }\n else if (scale0.bandwidth) {\n scale0 = scale1;\n }\n else {\n tickTransform(tickExit, scale1);\n }\n // when .flow(), it should follow flow's transition config\n // otherwise make to use ChartInternals.$T()\n tick = params.owner.state.flowing ?\n helper.transitionise(tick) :\n params.owner.$T(tick);\n tickTransform(tickEnter, scale0);\n tickTransform(tick.style(\"opacity\", null), scale1);\n }\n }\n });\n this.g = $g;\n }\n /**\n * Get generated ticks\n * @param {number} count Count of ticks\n * @returns {Array} Generated ticks\n * @private\n */\n getGeneratedTicks(count) {\n const len = this.generatedTicks?.length - 1;\n let res = this.generatedTicks;\n if (len > count) {\n const interval = Math.round((len / count) + 0.1);\n res = this.generatedTicks\n .map((v, i) => (i % interval === 0 ? v : null))\n .filter(v => v !== null)\n .splice(0, count);\n }\n return res;\n }\n /**\n * Get tick x/y coordinate\n * @returns {{x: number, y: number}}\n * @private\n */\n getTickXY() {\n const { config } = this;\n const pos = { x: 0, y: 0 };\n if (this.params.isCategory) {\n pos.x = config.tickCentered ? 0 : config.tickOffset;\n pos.y = config.tickCentered ? config.tickOffset : 0;\n }\n return pos;\n }\n /**\n * Get tick size\n * @param {object} d data object\n * @returns {number}\n * @private\n */\n getTickSize(d) {\n const { scale } = this.helper;\n const { config } = this;\n const { innerTickSize, range } = config;\n const tickPosition = scale(d) +\n (config.tickCentered ? 0 : config.tickOffset);\n return range[0] < tickPosition && tickPosition < range[1] ? innerTickSize : 0;\n }\n /**\n * Set tick's line & text position\n * @param {d3.selection} lineUpdate Line selection\n * @param {d3.selection} textUpdate Text selection\n * @param {object} sizeFor1Char Size for 1 char\n * @private\n */\n setTickLineTextPosition(lineUpdate, textUpdate, sizeFor1Char) {\n const tickPos = this.getTickXY();\n const { innerTickSize, orient, tickLength, tickOffset } = this.config;\n const axisId = this.params.id;\n const rotate = this.params.tickTextRotate;\n const baseHeight = 6;\n const charHeight = (sizeFor1Char.h / 2) - baseHeight;\n const textAnchorForText = r => {\n const value = [\"start\", \"end\"];\n orient === \"top\" && value.reverse();\n return !r ? \"middle\" : value[r > 0 ? 0 : 1];\n };\n const textTransform = r => (r ? `rotate(${r})` : null);\n const yForText = r => {\n const r2 = r / (orient === \"bottom\" ? 15 : 23);\n const y = r ? 11.5 - 2.5 * r2 * (r > 0 ? 1 : -1) : tickLength;\n return y;\n };\n const { config: { axis_rotated: isRotated, axis_x_tick_text_inner: inner } } = this.params.owner;\n const tickLineInner = this.params.config[`axis_${axisId}_tick_inner`];\n switch (orient) {\n case \"bottom\":\n lineUpdate\n .attr(\"x1\", tickPos.x)\n .attr(\"x2\", tickPos.x)\n .attr(\"y2\", d => this.getTickSize.bind(this)(d) * (tickLineInner ? -1 : 1));\n textUpdate\n .attr(\"x\", 0)\n .attr(\"y\", yForText(rotate))\n .style(\"text-anchor\", (d, i, { length }) => {\n if (!isRotated && i === 0 && (inner === true || inner.first)) {\n return \"start\";\n }\n else if (!isRotated && i === length - 1 && (inner === true || inner.last)) {\n return \"end\";\n }\n return textAnchorForText(rotate);\n })\n .attr(\"transform\", textTransform(rotate));\n break;\n case \"top\":\n lineUpdate\n .attr(\"x2\", 0)\n .attr(\"y2\", tickLineInner ? innerTickSize : -innerTickSize);\n textUpdate\n .attr(\"x\", 0)\n .attr(\"y\", -(yForText(rotate) + charHeight + baseHeight))\n .style(\"text-anchor\", textAnchorForText(rotate))\n .attr(\"transform\", textTransform(rotate));\n break;\n case \"left\":\n lineUpdate\n .attr(\"x2\", tickLineInner ? innerTickSize : -innerTickSize)\n .attr(\"y1\", tickPos.y)\n .attr(\"y2\", tickPos.y);\n textUpdate\n .attr(\"x\", -tickLength)\n .attr(\"y\", tickOffset + (isRotated ? charHeight / 4 : charHeight))\n .style(\"text-anchor\", \"end\");\n break;\n case \"right\":\n lineUpdate\n .attr(\"x2\", tickLineInner ? -innerTickSize : innerTickSize)\n .attr(\"y2\", 0);\n textUpdate\n .attr(\"x\", tickLength)\n .attr(\"y\", charHeight)\n .style(\"text-anchor\", \"start\");\n }\n }\n // this should be called only when category axis\n splitTickText(d, scale, ticks, isLeftRight, charWidth) {\n const { params } = this;\n const tickText = this.helper.textFormatted(d);\n const splitted = isString(tickText) && tickText.indexOf(\"\\n\") > -1 ?\n tickText.split(\"\\n\") :\n [];\n if (splitted.length) {\n return splitted;\n }\n if (isArray(tickText)) {\n return tickText;\n }\n let tickWidth = params.tickWidth;\n if (!tickWidth || tickWidth <= 0) {\n tickWidth = isLeftRight ? 95 : (params.isCategory ?\n (params.isInverted ?\n scale(ticks[0]) - scale(ticks[1]) :\n scale(ticks[1]) - scale(ticks[0])) - 12 :\n 110);\n }\n // split given text by tick width size\n // eslint-disable-next-line\n function split(splitted, text) {\n let subtext;\n let spaceIndex;\n let textWidth;\n for (let i = 1; i < text.length; i++) {\n if (text.charAt(i) === \" \") {\n spaceIndex = i;\n }\n subtext = text.substr(0, i + 1);\n textWidth = charWidth * subtext.length;\n // if text width gets over tick width, split by space index or current index\n if (tickWidth < textWidth) {\n return split(splitted.concat(text.substr(0, spaceIndex || i)), text.slice(spaceIndex ? spaceIndex + 1 : i));\n }\n }\n return splitted.concat(text);\n }\n return split(splitted, String(tickText));\n }\n scale(x) {\n if (!arguments.length) {\n return this.helper.scale;\n }\n this.helper.scale = x;\n return this;\n }\n orient(x) {\n if (!arguments.length) {\n return this.config.orient;\n }\n this.config.orient = x in {\n top: 1,\n right: 1,\n bottom: 1,\n left: 1\n } ?\n String(x) :\n \"bottom\";\n return this;\n }\n tickFormat(format) {\n const { config } = this;\n if (!arguments.length) {\n return config.tickFormat;\n }\n config.tickFormat = format;\n return this;\n }\n tickCentered(isCentered) {\n const { config } = this;\n if (!arguments.length) {\n return config.tickCentered;\n }\n config.tickCentered = isCentered;\n return this;\n }\n /**\n * Return tick's offset value.\n * The value will be set for 'category' axis type.\n * @returns {number}\n * @private\n */\n tickOffset() {\n return this.config.tickOffset;\n }\n /**\n * Get tick interval count\n * @private\n * @param {number} size Total data size\n * @returns {number}\n */\n tickInterval(size) {\n const { outerTickSize, tickOffset, tickValues } = this.config;\n let interval;\n if (this.params.isCategory) {\n const scale = this.params.owner.scale.zoom ?? this.helper.scale;\n interval = tickOffset * 2 || Math.abs(scale(1) - scale(0));\n }\n else {\n const scale = this.params.owner.scale.zoom ?? this.helper.scale;\n const length = this.g ?\n this.g.select(\"path.domain\")\n .node()\n .getTotalLength() - outerTickSize * 2 :\n Math.abs(scale.range()[1] - scale.range()[0]);\n interval = length / (size || this.g?.selectAll(\"line\").size() || 1);\n // get the interval by its values\n if (tickValues) {\n for (let i = 0; i < tickValues.length - 1; i++) {\n const intervalByValue = scale(tickValues[i + 1]) - scale(tickValues[i]);\n if (intervalByValue && intervalByValue < interval) {\n interval = intervalByValue;\n }\n }\n }\n }\n return interval === Infinity ? 0 : interval;\n }\n ticks(...args) {\n const { config } = this;\n if (!args.length) {\n return config.tickArguments;\n }\n config.tickArguments = toArray(args);\n return this;\n }\n tickCulling(culling) {\n const { config } = this;\n if (!arguments.length) {\n return config.tickCulling;\n }\n config.tickCulling = culling;\n return this;\n }\n tickValues(x) {\n const { config } = this;\n if (isFunction(x)) {\n config.tickValues = () => x(this.helper.scale.domain());\n }\n else {\n if (!arguments.length) {\n return config.tickValues;\n }\n config.tickValues = x;\n }\n return this;\n }\n setTransition(t) {\n this.config.transition = t;\n return this;\n }\n}\n\nexport { AxisRenderer as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { axisLeft, axisBottom, axisTop, axisRight } from 'd3-axis';\nimport { $AXIS, $COMMON } from '../../config/classes.js';\nimport { AXIS_TICK_SIZE, AXIS_TICK_LINE_OVERLAP_PADDING } from '../../config/const.js';\nimport { KEY } from '../../module/Cache.js';\nimport { getScale } from '../internals/scale.js';\nimport AxisRenderer from './AxisRenderer.js';\nimport { capitalize, parseDate, mergeObj, sortValue } from '../../module/util/object.js';\nimport { notEmpty, isFunction, isEmpty, isString, isArray, isNumber, isValue, isObjectType } from '../../module/util/type-checks.js';\nimport { getBoundingRect } from '../../module/util/dom.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Sample representative tick nodes to avoid N forced reflows in getMaxTickSize\n * @param {SVGTextElement[]} nodes All tick text nodes\n * @returns {SVGTextElement[]} Sampled subset: first, last, longest, and middle nodes\n * @private\n */\nfunction _sampleTickNodes(nodes) {\n const sampled = [nodes[0], nodes[nodes.length - 1]];\n // Find the node with the longest text content (likely widest)\n let maxLen = 0;\n let longestNode = null;\n for (const node of nodes) {\n const len = node.textContent?.length ?? 0;\n if (len > maxLen) {\n maxLen = len;\n longestNode = node;\n }\n }\n if (longestNode && !sampled.includes(longestNode)) {\n sampled.push(longestNode);\n }\n // Add a middle sample\n const mid = nodes[Math.floor(nodes.length / 2)];\n if (!sampled.includes(mid)) {\n sampled.push(mid);\n }\n return sampled;\n}\nconst MAX_TICK_MEASURE_VALUES = 50;\nconst TICK_WIDTH_FALLBACK = Symbol(\"tickWidthFallback\");\n/**\n * Get SVG tick line stroke width.\n * @param {object} tickNodes Tick node selection\n * @returns {number} Tick line stroke width\n * @private\n */\nfunction _getTickLineWidth(tickNodes) {\n const line = tickNodes.select(\"line\").node();\n const strokeWidth = line?.ownerDocument?.defaultView?.getComputedStyle ?\n parseFloat(line.ownerDocument.defaultView.getComputedStyle(line).strokeWidth) :\n parseFloat(line?.getAttribute?.(\"stroke-width\"));\n return Number.isFinite(strokeWidth) && strokeWidth > 0 ? strokeWidth : 1;\n}\n/**\n * Check whether adjacent tick line intervals overlap on the rendered axis.\n * @param {object} axis Axis renderer\n * @param {Array} tickValues Sorted tick values\n * @param {number} tickLineWidth Tick line stroke width\n * @returns {boolean} Whether tick lines should be culled with tick text\n * @private\n */\nfunction _hasOverlappedTickLineIntervals(axis, tickValues, tickLineWidth) {\n const scale = axis?.scale?.();\n if (!scale || tickValues.length < 2) {\n return false;\n }\n const halfWidth = Math.max(1, tickLineWidth) / 2;\n const positions = tickValues\n .map(value => +scale(value))\n .filter(Number.isFinite)\n .sort((a, b) => a - b);\n if (positions.length < 2) {\n return false;\n }\n let previousEnd = positions[0] + halfWidth;\n for (let i = 1; i < positions.length; i++) {\n const start = positions[i] - halfWidth;\n const end = positions[i] + halfWidth;\n if (start <= previousEnd + AXIS_TICK_LINE_OVERLAP_PADDING) {\n return true;\n }\n previousEnd = Math.max(previousEnd, end);\n }\n return false;\n}\n/**\n * Sample representative tick values before creating dummy tick DOM nodes.\n * @param {Array} values All tick values\n * @param {function} format Tick format function\n * @returns {Array} Sampled tick values\n * @private\n */\nfunction _sampleTickValues(values, format) {\n if (values.length <= MAX_TICK_MEASURE_VALUES) {\n return values;\n }\n const sampled = new Map();\n const add = (index) => {\n if (index >= 0 && index < values.length) {\n sampled.set(index, values[index]);\n }\n };\n add(0);\n add(values.length - 1);\n add(Math.floor(values.length / 2));\n const step = Math.max(1, Math.floor(values.length / (MAX_TICK_MEASURE_VALUES - 3)));\n let maxLength = -1;\n let maxIndex = 0;\n for (let i = 0; i < values.length; i += step) {\n add(i);\n const value = values[i];\n const text = format ? format(value) : value;\n const length = Array.isArray(text) ? text.join(\"\").length : String(text ?? \"\").length;\n if (length > maxLength) {\n maxLength = length;\n maxIndex = i;\n }\n }\n add(maxIndex);\n return Array.from(sampled.keys())\n .sort((a, b) => a - b)\n .map(index => sampled.get(index));\n}\n/**\n * Get compact tick values for cache fingerprinting.\n * @param {Array|function} values Tick values\n * @returns {Array|object|string} Cache fingerprint value\n * @private\n */\nfunction _getTickValuesCacheValue(values) {\n if (isFunction(values)) {\n return _getCacheReferenceId(values);\n }\n if (!Array.isArray(values) || values.length <= MAX_TICK_MEASURE_VALUES) {\n return values;\n }\n return {\n length: values.length,\n first: values[0],\n middle: values[Math.floor(values.length / 2)],\n last: values[values.length - 1]\n };\n}\n/**\n * Get compact tick width fallback.\n * @param {Array} ticks Tick width array\n * @returns {number|undefined} Fallback width\n * @private\n */\nfunction _getTickWidthFallback(ticks) {\n return ticks[TICK_WIDTH_FALLBACK];\n}\n/**\n * Set compact tick width fallback.\n * @param {Array} ticks Tick width array\n * @param {number} width Fallback width\n * @private\n */\nfunction _setTickWidthFallback(ticks, width) {\n if (isNumber(width)) {\n Object.defineProperty(ticks, TICK_WIDTH_FALLBACK, {\n configurable: true,\n value: width,\n writable: true\n });\n }\n else {\n delete ticks[TICK_WIDTH_FALLBACK];\n }\n}\n/**\n * Reset tick widths and compact metadata.\n * @param {Array} ticks Tick width array\n * @private\n */\nfunction _clearTickWidths(ticks) {\n ticks.length = 0;\n _setTickWidthFallback(ticks);\n}\n/**\n * Store large uniform tick widths without filling the array.\n * @param {Array} ticks Tick width array\n * @param {number} length Tick count\n * @param {number} width Uniform fallback width\n * @private\n */\nfunction _compactTickWidths(ticks, length, width) {\n _clearTickWidths(ticks);\n ticks.length = length;\n _setTickWidthFallback(ticks, width);\n}\n/**\n * Clone tick widths while preserving sparse compact storage.\n * @param {Array} ticks Tick width array\n * @returns {Array} Cloned tick width array\n * @private\n */\nfunction _cloneTickWidths(ticks) {\n const clone = [];\n clone.length = ticks.length;\n Object.keys(ticks).forEach(key => {\n const index = +key;\n clone[index] = ticks[index];\n });\n _setTickWidthFallback(clone, _getTickWidthFallback(ticks));\n return clone;\n}\n/**\n * Restore cached tick widths into current mutable state.\n * @param {Array} target Current tick width array\n * @param {Array} source Cached tick width array\n * @private\n */\nfunction _restoreTickWidths(target, source) {\n _clearTickWidths(target);\n target.length = source.length;\n Object.keys(source).forEach(key => {\n const index = +key;\n target[index] = source[index];\n });\n _setTickWidthFallback(target, _getTickWidthFallback(source));\n}\n/**\n * Get a tick width from dense or compact storage.\n * @param {Array} ticks Tick width array\n * @param {number} index Tick index\n * @param {number} fallback Fallback width\n * @returns {number} Tick width\n * @private\n */\nfunction _getTickWidth(ticks, index, fallback) {\n const value = ticks[index];\n if (isNumber(value)) {\n return value;\n }\n const numericValue = Number(value);\n return Number.isFinite(numericValue) ? numericValue : fallback;\n}\nconst cacheReferenceIds = new WeakMap();\nlet cacheReferenceUid = 0;\n/**\n * Get stable identity for non-serializable cache inputs.\n * @param {function|object|string|number|boolean|null|undefined} value Value to identify\n * @returns {string} Stable reference id\n * @private\n */\nfunction _getCacheReferenceId(value) {\n if (!value || !/^(function|object)$/.test(typeof value)) {\n return `${typeof value}:${String(value)}`;\n }\n let id = cacheReferenceIds.get(value);\n if (!id) {\n id = ++cacheReferenceUid;\n cacheReferenceIds.set(value, id);\n }\n return `${typeof value}:${id}`;\n}\n/**\n * Stringify axis measurement inputs for cache matching.\n * @param {Date|Array|function|object|string|number|boolean|null|undefined} value Value to stringify\n * @returns {string} Stringified value\n * @private\n */\nfunction _stringifyCacheValue(value) {\n if (value instanceof Date) {\n return `date:${+value}`;\n }\n else if (Array.isArray(value)) {\n return `[${value.map(v => _stringifyCacheValue(v)).join(\",\")}]`;\n }\n else if (value && typeof value === \"object\") {\n return `{${Object.keys(value).sort().map(key => `${key}:${_stringifyCacheValue(value[key])}`).join(\",\")}}`;\n }\n else if (typeof value === \"function\") {\n return _getCacheReferenceId(value);\n }\n return `${typeof value}:${String(value)}`;\n}\n/**\n * Clone array/date cache values before storing state snapshots.\n * @param {Date|Array|object|string|number|boolean|null|undefined} value Value to clone\n * @returns {Date|Array|object|string|number|boolean|null|undefined} Cloned value\n * @private\n */\nfunction _cloneCacheValue(value) {\n return value instanceof Date ? new Date(+value) : (Array.isArray(value) ? value.map(v => _cloneCacheValue(v)) : value);\n}\n/**\n * Clone tick measurement state without mutable array side effects.\n * @param {object} tickSize Tick measurement state\n * @returns {object} Cloned measurement state\n * @private\n */\nfunction _cloneMaxTickSize(tickSize) {\n return {\n width: tickSize.width,\n height: tickSize.height,\n ticks: tickSize.ticks && _cloneTickWidths(tickSize.ticks),\n clipPath: tickSize.clipPath,\n domain: _cloneCacheValue(tickSize.domain)\n };\n}\n/**\n * Restore cached tick measurement into current mutable state.\n * @param {object} target Current tick measurement state\n * @param {object} source Cached tick measurement state\n * @returns {object} Current tick measurement state\n * @private\n */\nfunction _restoreMaxTickSize(target, source) {\n target.width = source.width;\n target.height = source.height;\n target.clipPath = source.clipPath;\n target.domain = _cloneCacheValue(source.domain);\n if (target.ticks && source.ticks) {\n _restoreTickWidths(target.ticks, source.ticks);\n }\n return target;\n}\nvar axis = {\n getAxisInstance: function () {\n return this.axis || new Axis(this);\n }\n};\nclass Axis {\n owner;\n x;\n subX;\n y;\n y2;\n axesList = {};\n tick = {\n x: null,\n y: null,\n y2: null\n };\n xs = [];\n orient = {\n x: \"bottom\",\n y: \"left\",\n y2: \"right\",\n subX: \"bottom\"\n };\n constructor(owner) {\n this.owner = owner;\n this.setOrient();\n }\n getAxisClassName(id) {\n return `${$AXIS.axis} ${$AXIS[`axis${capitalize(id)}`]}`;\n }\n isHorizontal($$, forHorizontal) {\n const isRotated = $$.config.axis_rotated;\n return forHorizontal ? isRotated : !isRotated;\n }\n isCategorized() {\n const { config, state } = this.owner;\n return config.axis_x_type.indexOf(\"category\") >= 0 || state.hasRadar;\n }\n isCustomX() {\n const { config } = this.owner;\n return !this.isTimeSeries() && (config.data_x || notEmpty(config.data_xs));\n }\n isTimeSeries(id = \"x\") {\n return this.owner.config[`axis_${id}_type`] === \"timeseries\";\n }\n isLog(id = \"x\") {\n return this.owner.config[`axis_${id}_type`] === \"log\";\n }\n isTimeSeriesY() {\n return this.isTimeSeries(\"y\");\n }\n getAxisType(id = \"x\") {\n let type = \"linear\";\n if (this.isTimeSeries(id)) {\n type = this.owner.config.axis_x_localtime ? \"time\" : \"utc\";\n }\n else if (this.isLog(id)) {\n type = \"log\";\n }\n return type;\n }\n /**\n * Get extent value\n * @returns {Array} default extent\n * @private\n */\n getExtent() {\n const $$ = this.owner;\n const { config, scale } = $$;\n let extent = config.axis_x_extent;\n if (extent) {\n if (isFunction(extent)) {\n extent = extent.bind($$.api)($$.getXDomain($$.data.targets), scale.subX);\n }\n else if (this.isTimeSeries() && extent.every(isNaN)) {\n const fn = parseDate.bind($$);\n extent = extent.map(v => scale.subX(fn(v)));\n }\n }\n return extent;\n }\n init() {\n const $$ = this.owner;\n const { config, $el: { main, axis }, state: { clip } } = $$;\n const target = [\"x\", \"y\"];\n config.axis_y2_show && target.push(\"y2\");\n target.forEach(v => {\n const classAxis = this.getAxisClassName(v);\n axis[v] = main.append(\"g\")\n .attr(\"class\", classAxis)\n .attr(\"clip-path\", () => {\n let res = null;\n if (v === \"x\") {\n res = clip.pathXAxis;\n }\n else if (v === \"y\") { // || v === \"y2\") {\n res = clip.pathYAxis;\n }\n return res;\n })\n .attr(\"transform\", $$.getTranslate(v))\n .style(\"visibility\", config[`axis_${v}_show`] ? null : \"hidden\");\n this.generateAxes(v);\n });\n }\n /**\n * Set axis orient according option value\n * @private\n */\n setOrient() {\n const $$ = this.owner;\n const { axis_rotated: isRotated, axis_y_inner: yInner, axis_y2_inner: y2Inner } = $$.config;\n this.orient = {\n x: isRotated ? \"left\" : \"bottom\",\n y: isRotated ? (yInner ? \"top\" : \"bottom\") : (yInner ? \"right\" : \"left\"),\n y2: isRotated ? (y2Inner ? \"bottom\" : \"top\") : (y2Inner ? \"left\" : \"right\"),\n subX: isRotated ? \"left\" : \"bottom\"\n };\n }\n /**\n * Generate axes\n * It's used when axis' axes option is set\n * @param {string} id Axis id\n * @private\n */\n generateAxes(id) {\n const $$ = this.owner;\n const { config } = $$;\n const axes = [];\n const axesConfig = config[`axis_${id}_axes`];\n const isRotated = config.axis_rotated;\n let d3Axis;\n if (id === \"x\") {\n d3Axis = isRotated ? axisLeft : axisBottom;\n }\n else if (id === \"y\") {\n d3Axis = isRotated ? axisBottom : axisLeft;\n }\n else if (id === \"y2\") {\n d3Axis = isRotated ? axisTop : axisRight;\n }\n if (axesConfig.length) {\n axesConfig.forEach(v => {\n const tick = v.tick || {};\n const scale = $$.scale[id].copy();\n v.domain && scale.domain(v.domain);\n axes.push(d3Axis(scale)\n .ticks(tick.count)\n .tickFormat(isFunction(tick.format) ? tick.format.bind($$.api) : ((x) => x))\n .tickValues(tick.values)\n .tickSizeOuter(tick.outer === false ? 0 : AXIS_TICK_SIZE));\n });\n }\n this.axesList[id] = axes;\n }\n /**\n * Update axes nodes\n * @private\n */\n updateAxes() {\n const $$ = this.owner;\n const { config, $el: { main }, $T } = $$;\n Object.keys(this.axesList).forEach(id => {\n const axesConfig = config[`axis_${id}_axes`];\n const scale = $$.scale[id].copy();\n const range = scale.range();\n this.axesList[id].forEach((v, i) => {\n const axisRange = v.scale().range();\n // adjust range value with the current\n // https://github.com/naver/billboard.js/issues/859\n if (!range.every((v, i) => v === axisRange[i])) {\n v.scale().range(range);\n }\n const className = `${this.getAxisClassName(id)}-${i + 1}`;\n let g = main.select(`.${className.replace(/\\s/, \".\")}`);\n if (g.empty()) {\n g = main.append(\"g\")\n .attr(\"class\", className)\n .style(\"visibility\", config[`axis_${id}_show`] ? null : \"hidden\")\n .call(v);\n }\n else {\n axesConfig[i].domain && scale.domain(axesConfig[i].domain);\n $T(g).call(v.scale(scale));\n }\n g.attr(\"transform\", $$.getTranslate(id, i + 1));\n });\n });\n }\n /**\n * Set Axis & tick values\n * called from: updateScales()\n * @param {string} id Axis id string\n * @param {d3Scale} scale Scale\n * @param {boolean} outerTick If show outer tick\n * @param {boolean} noTransition If with no transition\n * @private\n */\n setAxis(id, scale, outerTick, noTransition) {\n const $$ = this.owner;\n if (id !== \"subX\") {\n this.tick[id] = this.getTickValues(id);\n }\n // @ts-ignore\n this[id] = this.getAxis(id, scale, outerTick, \n // do not transit x Axis on zoom and resizing\n // https://github.com/naver/billboard.js/issues/1949\n id === \"x\" && ($$.scale.zoom || $$.config.subchart_show || $$.state.resizing) ?\n true :\n noTransition);\n }\n // called from : getMaxTickSize()\n getAxis(id, scale, outerTick, noTransition, noTickTextRotate) {\n const $$ = this.owner;\n const { config } = $$;\n const isX = /^(x|subX)$/.test(id);\n const type = isX ? \"x\" : id;\n const isCategory = isX && this.isCategorized();\n const orient = this.orient[id];\n const tickTextRotate = noTickTextRotate ? 0 : $$.getAxisTickRotate(type);\n let tickFormat;\n if (isX) {\n tickFormat = (id === \"subX\") ? $$.format.subXAxisTick : $$.format.xAxisTick;\n }\n else {\n const fn = config[`axis_${id}_tick_format`];\n if (isFunction(fn)) {\n tickFormat = fn.bind($$.api);\n }\n }\n let tickValues = this.tick[type];\n const axisParams = mergeObj({\n outerTick,\n noTransition,\n config,\n id,\n tickTextRotate,\n owner: $$\n }, isX && {\n isCategory,\n isInverted: config.axis_x_inverted,\n tickMultiline: config.axis_x_tick_multiline,\n tickWidth: config.axis_x_tick_width,\n tickTitle: isCategory && config.axis_x_tick_tooltip && $$.api.categories(),\n orgXScale: $$.scale.x\n });\n if (!isX) {\n axisParams.tickStepSize = config[`axis_${type}_tick_stepSize`];\n }\n const axis = new AxisRenderer(axisParams)\n .scale((isX && $$.scale.zoom) || scale)\n .orient(orient);\n if (isX && this.isTimeSeries() && tickValues && !isFunction(tickValues)) {\n const fn = parseDate.bind($$);\n tickValues = tickValues.map(v => fn(v));\n }\n else if (!isX && this.isTimeSeriesY()) {\n // https://github.com/d3/d3/blob/master/CHANGES.md#time-intervals-d3-time\n axis.ticks(config.axis_y_tick_time_value);\n tickValues = null;\n }\n tickValues && axis.tickValues(tickValues);\n // Set tick\n axis.tickFormat(tickFormat || (!isX && ($$.isStackNormalized() && $$.hasAxisGroupedData(id) && (x => `${x}%`))));\n if (isCategory) {\n axis.tickCentered(config.axis_x_tick_centered);\n if (isEmpty(config.axis_x_tick_culling)) {\n config.axis_x_tick_culling = false;\n }\n }\n const tickCount = config[`axis_${type}_tick_count`];\n tickCount && axis.ticks(tickCount);\n return axis;\n }\n updateXAxisTickValues(targets, axis) {\n const $$ = this.owner;\n const { config } = $$;\n const fit = config.axis_x_tick_fit;\n let count = config.axis_x_tick_count;\n let values;\n if (fit) {\n values = $$.mapTargetsToUniqueXs(targets);\n // if given count is greater than the value length, then limit the count.\n if (this.isCategorized() && count > values.length) {\n count = values.length;\n }\n values = this.generateTickValues(values, count, this.isTimeSeries());\n }\n if (axis) {\n axis.tickValues(values);\n }\n else if (this.x) {\n this.x.tickValues(values);\n this.subX?.tickValues(values);\n }\n return values;\n }\n getId(id) {\n const { config, scale } = this.owner;\n let axis = config.data_axes[id];\n // when data.axes option has 'y2', but 'axis.y2.show=true' isn't set will return 'y'\n if (!axis || !scale[axis]) {\n axis = \"y\";\n }\n return axis;\n }\n getXAxisTickFormat(forSubchart) {\n const $$ = this.owner;\n const { config, format } = $$;\n // enable different tick format for x and subX - subX format defaults to x format if not defined\n const tickFormat = forSubchart ?\n config.subchart_axis_x_tick_format || config.axis_x_tick_format :\n config.axis_x_tick_format;\n const isTimeSeries = this.isTimeSeries();\n const isCategorized = this.isCategorized();\n let currFormat;\n if (tickFormat) {\n if (isFunction(tickFormat)) {\n currFormat = tickFormat.bind($$.api);\n }\n else if (isTimeSeries) {\n currFormat = date => (date ? format.axisTime(tickFormat)(date) : \"\");\n }\n }\n else {\n currFormat = isTimeSeries ? format.defaultAxisTime : (isCategorized ? $$.categoryName : v => (v < 0 ? v.toFixed(0) : v));\n }\n return isFunction(currFormat) ?\n v => currFormat.apply($$, isCategorized ? [v, $$.categoryName(v)] : [v]) :\n currFormat;\n }\n getTickValues(id) {\n const $$ = this.owner;\n const tickValues = $$.config[`axis_${id}_tick_values`];\n const axis = $$[`${id}Axis`];\n return (isFunction(tickValues) ? tickValues.call($$.api) : tickValues) ||\n (axis ? axis.tickValues() : undefined);\n }\n getLabelOptionByAxisId(id) {\n return this.owner.config[`axis_${id}_label`];\n }\n getLabelText(id) {\n const option = this.getLabelOptionByAxisId(id);\n return isString(option) ? option : (option ? option.text : null);\n }\n setLabelText(id, text) {\n const $$ = this.owner;\n const { config } = $$;\n const option = this.getLabelOptionByAxisId(id);\n if (isString(option)) {\n config[`axis_${id}_label`] = text;\n }\n else if (option) {\n option.text = text;\n }\n }\n getLabelPosition(id, defaultPosition) {\n const isRotated = this.owner.config.axis_rotated;\n const option = this.getLabelOptionByAxisId(id);\n const position = (isObjectType(option) && option.position) ?\n option.position :\n defaultPosition[+!isRotated];\n const has = v => !!~position.indexOf(v);\n return {\n isInner: has(\"inner\"),\n isOuter: has(\"outer\"),\n isLeft: has(\"left\"),\n isCenter: has(\"center\"),\n isRight: has(\"right\"),\n isTop: has(\"top\"),\n isMiddle: has(\"middle\"),\n isBottom: has(\"bottom\")\n };\n }\n getAxisLabelPosition(id) {\n return this.getLabelPosition(id, id === \"x\" ? [\"inner-top\", \"inner-right\"] : [\"inner-right\", \"inner-top\"]);\n }\n xForAxisLabel(id) {\n const $$ = this.owner;\n const { state: { width, height } } = $$;\n const position = this.getAxisLabelPosition(id);\n let x = position.isMiddle ? -height / 2 : 0;\n if (this.isHorizontal($$, id !== \"x\")) {\n x = position.isLeft ? 0 : (position.isCenter ? width / 2 : width);\n }\n else if (position.isBottom) {\n x = -height;\n }\n return x;\n }\n textAnchorForAxisLabel(id) {\n const $$ = this.owner;\n const position = this.getAxisLabelPosition(id);\n let anchor = position.isMiddle ? \"middle\" : \"end\";\n if (this.isHorizontal($$, id !== \"x\")) {\n anchor = position.isLeft ? \"start\" : (position.isCenter ? \"middle\" : \"end\");\n }\n else if (position.isBottom) {\n anchor = \"start\";\n }\n return anchor;\n }\n dxForAxisLabel(id) {\n const $$ = this.owner;\n const position = this.getAxisLabelPosition(id);\n let dx = position.isBottom ? \"0.5em\" : \"0\";\n if (this.isHorizontal($$, id !== \"x\")) {\n dx = position.isLeft ? \"0.5em\" : (position.isRight ? \"-0.5em\" : \"0\");\n }\n else if (position.isTop) {\n dx = \"-0.5em\";\n }\n return dx;\n }\n dyForAxisLabel(id) {\n const $$ = this.owner;\n const { config } = $$;\n const isRotated = config.axis_rotated;\n const isInner = this.getAxisLabelPosition(id).isInner;\n const tickRotate = config[`axis_${id}_tick_rotate`] ? $$.getHorizontalAxisHeight(id) : 0;\n const { width: maxTickWidth } = this.getMaxTickSize(id);\n let dy;\n if (id === \"x\") {\n const xHeight = config.axis_x_height;\n if (isRotated) {\n dy = isInner ? \"1.2em\" : -25 - maxTickWidth;\n }\n else if (isInner) {\n dy = \"-0.5em\";\n }\n else if (xHeight) {\n dy = xHeight - 10;\n }\n else if (tickRotate) {\n dy = tickRotate - 10;\n }\n else {\n dy = \"3em\";\n }\n }\n else {\n dy = {\n y: [\"-0.5em\", 10, \"3em\", \"1.2em\", 10],\n y2: [\"1.2em\", -20, \"-2.2em\", \"-0.5em\", 15]\n }[id];\n if (isRotated) {\n if (isInner) {\n dy = dy[0];\n }\n else if (tickRotate) {\n dy = tickRotate * (id === \"y2\" ? -1 : 1) - dy[1];\n }\n else {\n dy = dy[2];\n }\n }\n else {\n dy = isInner ? dy[3] : (dy[4] + (config[`axis_${id}_inner`] ? 0 : (maxTickWidth + dy[4]))) * (id === \"y\" ? -1 : 1);\n }\n }\n return dy;\n }\n getTickFormatCacheValue(id) {\n const $$ = this.owner;\n const { config } = $$;\n const isX = id === \"x\";\n return isX ?\n {\n format: config.axis_x_tick_format,\n type: config.axis_x_type,\n localtime: config.axis_x_localtime,\n categories: config.axis_x_categories\n } :\n {\n format: config[`axis_${id}_tick_format`],\n normalized: $$.isStackNormalized(),\n grouped: $$.hasAxisGroupedData(id),\n type: config[`axis_${id}_type`]\n };\n }\n getMaxTickSizeFingerprint(id, scale, domain, axis, tickRotate, withoutRecompute) {\n const $$ = this.owner;\n const { config, state } = $$;\n const isX = id === \"x\";\n const configPrefix = isX ? \"axis_x\" : `axis_${id}`;\n const tickValues = axis.tickValues();\n return _stringifyCacheValue({\n id,\n withoutRecompute: !!withoutRecompute,\n dataGeneration: state.dataGeneration,\n size: [state.current.width, state.current.height],\n range: scale.range?.(),\n domain,\n type: scale.type,\n orient: this.orient[id],\n axisRotated: config.axis_rotated,\n evalTextSize: config.axis_evalTextSize,\n format: this.getTickFormatCacheValue(id),\n ticks: {\n values: _getTickValuesCacheValue(tickValues),\n rawValues: config[`${configPrefix}_tick_values`],\n arguments: axis.ticks(),\n count: config[`${configPrefix}_tick_count`],\n rotate: tickRotate,\n show: config[`${configPrefix}_tick_show`],\n textShow: config[`${configPrefix}_tick_text_show`],\n textPosition: config[`${configPrefix}_tick_text_position`],\n inner: config[`${configPrefix}_tick_inner`],\n culling: config[`${configPrefix}_tick_culling`],\n cullingMax: config[`${configPrefix}_tick_culling_max`],\n cullingLines: config[`${configPrefix}_tick_culling_lines`],\n cullingReverse: config[`${configPrefix}_tick_culling_reverse`],\n stepSize: !isX && config[`${configPrefix}_tick_stepSize`],\n timeValue: !isX && config[`${configPrefix}_tick_time_value`],\n fit: isX && config.axis_x_tick_fit,\n autorotate: isX && config.axis_x_tick_autorotate,\n centered: isX && config.axis_x_tick_centered,\n inverted: isX && config.axis_x_inverted,\n multiline: isX && config.axis_x_tick_multiline,\n width: isX && config.axis_x_tick_width\n }\n });\n }\n /**\n * Get max tick size\n * @param {string} id axis id string\n * @param {boolean} withoutRecompute wheather or not to recompute\n * @returns {object} {width, height}\n * @private\n */\n getMaxTickSize(id, withoutRecompute) {\n const $$ = this.owner;\n const { config, state, $el: { svg, chart } } = $$;\n const { current, resizing } = state;\n const currentTickMax = current.maxTickSize[id];\n // First keep the existing per-redraw fast path, then use the fingerprint below\n // to avoid rebuilding dummy axes across redraws when axis inputs are stable.\n const cacheKey = `${KEY.maxTickSize}_${id}_${!!withoutRecompute}`;\n const cached = $$.cache.get(cacheKey);\n if (cached && cached.generation === state.redrawGeneration) {\n return currentTickMax;\n }\n const configPrefix = `axis_${id}`;\n const max = {\n width: 0,\n height: 0\n };\n let fingerprint;\n if (resizing || withoutRecompute || !config[`${configPrefix}_show`] || (currentTickMax.width > 0 && $$.filterTargetsToShow().length === 0)) {\n return currentTickMax;\n }\n if ((svg || config.render_mode === \"canvas\") && $$.scale[id]?.copy) {\n const isYAxis = /^y2?$/.test(id);\n const targetsToShow = $$.getTargetsToShow();\n const scale = $$.scale[id].copy().domain($$[`get${isYAxis ? \"Y\" : \"X\"}Domain`](targetsToShow, id));\n const domain = scale.domain();\n const isDomainSame = domain[0] === domain[1] && domain.every(v => v > 0);\n const isCurrentMaxTickDomainSame = isArray(currentTickMax.domain) &&\n currentTickMax.domain[0] === currentTickMax.domain[1] &&\n currentTickMax.domain.every(v => v > 0);\n // do not compute if domain or currentMaxTickDomain is same\n if (isDomainSame || isCurrentMaxTickDomainSame) {\n return currentTickMax;\n }\n else {\n currentTickMax.domain = domain;\n }\n // reset old max state value to prevent from new data loading\n if (!isYAxis) {\n _clearTickWidths(currentTickMax.ticks);\n }\n const axis = this.getAxis(id, scale, false, false, true);\n const tickRotate = config[`${configPrefix}_tick_rotate`];\n const tickCount = config[`${configPrefix}_tick_count`];\n const tickValues = config[`${configPrefix}_tick_values`];\n // Make to generate the final tick text to be rendered\n // https://github.com/naver/billboard.js/issues/920\n // Do not generate if 'tick values' option is given\n // https://github.com/naver/billboard.js/issues/1251\n if (!tickValues && tickCount) {\n axis.tickValues(this.generateTickValues(domain, tickCount, isYAxis ? this.isTimeSeriesY() : this.isTimeSeries()));\n }\n !isYAxis && this.updateXAxisTickValues(targetsToShow, axis);\n fingerprint = this.getMaxTickSizeFingerprint(id, scale, domain, axis, tickRotate, withoutRecompute);\n if (cached?.fingerprint === fingerprint) {\n $$.cache.add(cacheKey, {\n ...cached,\n generation: state.redrawGeneration\n });\n return _restoreMaxTickSize(currentTickMax, cached.value);\n }\n const originalTickValues = axis.tickValues();\n const hasLargeTickValues = !isYAxis &&\n Array.isArray(originalTickValues) &&\n originalTickValues.length > MAX_TICK_MEASURE_VALUES;\n hasLargeTickValues && axis.tickValues(_sampleTickValues(originalTickValues, axis.tickFormat()));\n const dummy = chart.append(\"svg\")\n .style(\"visibility\", \"hidden\")\n .style(\"position\", \"fixed\")\n .style(\"top\", \"0\")\n .style(\"left\", \"0\");\n const g = dummy\n .append(\"g\")\n .attr(\"class\", `${$AXIS[`axis${capitalize(id)}`]} ${$COMMON.dummy}`);\n axis.create(g);\n // when evalTextSize is set as function, sizeFor1Char is set to the dummy element\n const { sizeFor1Char } = g.node();\n const textSelection = dummy.selectAll(\"text\")\n .attr(\"transform\", isNumber(tickRotate) ? `rotate(${tickRotate})` : null);\n const measuredTickCount = hasLargeTickValues ?\n originalTickValues.length :\n textSelection.size();\n // Batch processing to minimize layout thrashing\n if (sizeFor1Char) {\n // Use pre-calculated character size (no reflow needed)\n textSelection.each(function (d, i) {\n const width = this.textContent.length * sizeFor1Char.w;\n const height = sizeFor1Char.h;\n max.width = Math.max(max.width, width);\n max.height = Math.max(max.height, height);\n if (!isYAxis) {\n currentTickMax.ticks[i] = width;\n }\n });\n }\n else {\n const textNodes = [];\n textSelection.each(function () {\n textNodes.push(this);\n });\n // Sample a representative subset to avoid N forced reflows on large tick sets\n const nodesToMeasure = textNodes.length <= 5 ?\n textNodes :\n _sampleTickNodes(textNodes);\n nodesToMeasure.map(node => getBoundingRect(node, true)).forEach(dim => {\n max.width = Math.max(max.width, dim.width);\n max.height = Math.max(max.height, dim.height);\n });\n // Estimate per-tick width from measured max for culling calculations\n if (!isYAxis) {\n for (let i = 0; i < textNodes.length; i++) {\n currentTickMax.ticks[i] = max.width;\n }\n }\n }\n if (!isYAxis && hasLargeTickValues) {\n _compactTickWidths(currentTickMax.ticks, measuredTickCount, max.width);\n }\n dummy.remove();\n }\n Object.keys(max).forEach(key => {\n if (max[key] > 0) {\n currentTickMax[key] = max[key];\n }\n });\n $$.cache.add(cacheKey, {\n fingerprint,\n generation: state.redrawGeneration,\n value: _cloneMaxTickSize(currentTickMax)\n });\n return currentTickMax;\n }\n getXAxisTickTextY2Overflow(defaultPadding) {\n const $$ = this.owner;\n const { axis, config, state: { current, isLegendRight, legendItemWidth } } = $$;\n const xAxisTickRotate = $$.getAxisTickRotate(\"x\");\n const positiveRotation = xAxisTickRotate > 0 && xAxisTickRotate < 90;\n if ((axis.isCategorized() || axis.isTimeSeries()) &&\n config.axis_x_tick_fit &&\n (!config.axis_x_tick_culling || isEmpty(config.axis_x_tick_culling)) &&\n !config.axis_x_tick_multiline &&\n positiveRotation) {\n const y2AxisWidth = (config.axis_y2_show && current.maxTickSize.y2.width) || 0;\n const legendWidth = (isLegendRight && legendItemWidth) || 0;\n const widthWithoutCurrentPaddingLeft = current.width -\n $$.getCurrentPaddingByDirection(\"left\");\n const maxOverflow = this.getXAxisTickMaxOverflow(xAxisTickRotate, widthWithoutCurrentPaddingLeft - defaultPadding) - y2AxisWidth - legendWidth;\n const xAxisTickTextY2Overflow = Math.max(0, maxOverflow) +\n defaultPadding; // for display inconsistencies between browsers\n return Math.min(xAxisTickTextY2Overflow, widthWithoutCurrentPaddingLeft / 2);\n }\n return 0;\n }\n getXAxisTickMaxOverflow(xAxisTickRotate, widthWithoutCurrentPaddingLeft) {\n const $$ = this.owner;\n const { axis, config, state } = $$;\n const isTimeSeries = axis.isTimeSeries();\n const tickTextWidths = state.current.maxTickSize.x.ticks;\n const tickCount = tickTextWidths.length;\n const fallbackTickTextWidth = _getTickWidthFallback(tickTextWidths) ??\n state.current.maxTickSize.x.width;\n const { left, right } = state.axis.x.padding;\n let maxOverflow = 0;\n const remaining = tickCount - (isTimeSeries && config.axis_x_tick_fit ? 0.5 : 0);\n for (let i = 0; i < tickCount; i++) {\n const tickIndex = i + 1;\n const rotatedTickTextWidth = Math.cos(Math.PI * xAxisTickRotate / 180) *\n _getTickWidth(tickTextWidths, i, fallbackTickTextWidth);\n const ticksBeforeTickText = tickIndex - (isTimeSeries ? 1 : 0.5) + left;\n // Skip ticks if there are no ticks before them\n if (ticksBeforeTickText <= 0) {\n continue;\n }\n const xAxisLengthWithoutTickTextWidth = widthWithoutCurrentPaddingLeft -\n rotatedTickTextWidth;\n const tickLength = xAxisLengthWithoutTickTextWidth / ticksBeforeTickText;\n const remainingTicks = remaining - tickIndex;\n const paddingRightLength = right * tickLength;\n const remainingTickWidth = (remainingTicks * tickLength) + paddingRightLength;\n const overflow = rotatedTickTextWidth - (tickLength / 2) - remainingTickWidth;\n maxOverflow = Math.max(maxOverflow, overflow);\n }\n const filteredTargets = $$.getTargetsToShow();\n let tickOffset = 0;\n if (!isTimeSeries &&\n config.axis_x_tick_count <= filteredTargets.length && filteredTargets[0].values.length) {\n const scale = getScale($$.axis.getAxisType(\"x\"), 0, widthWithoutCurrentPaddingLeft - maxOverflow)\n .domain([\n left * -1,\n $$.getXDomainMax($$.data.targets) + 1 + right\n ]);\n tickOffset = (scale(1) - scale(0)) / 2;\n }\n return maxOverflow + tickOffset;\n }\n /**\n * Update axis label text\n * @param {boolean} withTransition Weather update with transition\n * @private\n */\n updateLabels(withTransition) {\n const $$ = this.owner;\n const { config, $el: { main }, $T } = $$;\n const isRotated = config.axis_rotated;\n [\"x\", \"y\", \"y2\"].forEach((id) => {\n const text = this.getLabelText(id);\n const selector = `axis${capitalize(id)}`;\n const classLabel = $AXIS[`${selector}Label`];\n if (text) {\n let axisLabel = main.select(`text.${classLabel}`);\n // generate eleement if not exists\n if (axisLabel.empty()) {\n axisLabel = main.select(`g.${$AXIS[selector]}`)\n .insert(\"text\", \":first-child\")\n .attr(\"class\", classLabel)\n .attr(\"transform\", [\"rotate(-90)\", null][id === \"x\" ? +!isRotated : +isRotated])\n .style(\"text-anchor\", () => this.textAnchorForAxisLabel(id));\n }\n // @check $$.$T(node, withTransition)\n $T(axisLabel, withTransition)\n .attr(\"x\", () => this.xForAxisLabel(id))\n .attr(\"dx\", () => this.dxForAxisLabel(id))\n .attr(\"dy\", () => this.dyForAxisLabel(id))\n .text(text);\n }\n });\n }\n /**\n * Get axis padding value\n * @param {number|object} padding Padding object\n * @param {string} key Key string of padding\n * @param {Date|number} defaultValue Default value\n * @param {number} domainLength Domain length\n * @returns {number} Padding value in scale\n * @private\n */\n getPadding(padding, key, defaultValue, domainLength) {\n const p = isNumber(padding) ? padding : padding[key];\n if (!isValue(p)) {\n return defaultValue;\n }\n return this.owner.convertPixelToScale(/(bottom|top)/.test(key) ? \"y\" : \"x\", p, domainLength);\n }\n generateTickValues(values, tickCount, forTimeSeries) {\n let tickValues = values;\n if (tickCount) {\n const targetCount = isFunction(tickCount) ? tickCount() : tickCount;\n // compute ticks according to tickCount\n if (targetCount === 1) {\n tickValues = [values[0]];\n }\n else if (targetCount === 2) {\n tickValues = [values[0], values[values.length - 1]];\n }\n else if (targetCount > 2) {\n const isCategorized = this.isCategorized();\n const count = targetCount - 2;\n const start = values[0];\n const end = values[values.length - 1];\n const interval = (end - start) / (count + 1);\n let tickValue;\n // re-construct unique values\n tickValues = [start];\n for (let i = 0; i < count; i++) {\n tickValue = +start + interval * (i + 1);\n tickValues.push(forTimeSeries ? new Date(tickValue) : (isCategorized ? Math.round(tickValue) : tickValue));\n }\n tickValues.push(end);\n }\n }\n if (!forTimeSeries) {\n tickValues = tickValues.sort((a, b) => a - b);\n }\n return tickValues;\n }\n generateTransitions(withTransition) {\n const $$ = this.owner;\n const { $el: { axis }, $T } = $$;\n const [axisX, axisY, axisY2, axisSubX] = [\"x\", \"y\", \"y2\", \"subX\"]\n .map(v => $T(axis[v], withTransition));\n return { axisX, axisY, axisY2, axisSubX };\n }\n redraw(transitions, isHidden, isInit) {\n const $$ = this.owner;\n const { config, state, $el } = $$;\n const opacity = isHidden ? \"0\" : null;\n [\"x\", \"y\", \"y2\", \"subX\"].forEach(id => {\n const axis = this[id];\n const $axis = $el.axis[id];\n if (axis && $axis) {\n if (!isInit && !config.transition_duration) {\n axis.config.withoutTransition = true;\n }\n $axis.style(\"opacity\", opacity);\n axis.create(transitions[`axis${capitalize(id)}`]);\n }\n });\n this.updateAxes();\n !state.rendered && config.axis_tooltip && this.setAxisTooltip();\n }\n /**\n * Synchronize axis domains and tick values.\n * @param {Array} targetsToShow targets data to be shown\n * @param {object} wth option object\n * @param {object} flow flow object\n * @private\n */\n syncAxisDomains(targetsToShow, wth, flow) {\n const $$ = this.owner;\n const { config, scale, $el } = $$;\n const hasZoom = !!scale.zoom;\n let xDomainForZoom;\n if (!hasZoom && this.isCategorized() && targetsToShow.length === 0 && $el.axis.x) {\n scale.x.domain([0, $el.axis.x.selectAll(\".tick\").size()]);\n }\n if (scale.x && targetsToShow.length) {\n !hasZoom &&\n $$.updateXDomain(targetsToShow, wth.UpdateXDomain, wth.UpdateOrgXDomain, wth.TrimXDomain);\n if (!config.axis_x_tick_values) {\n this.updateXAxisTickValues(targetsToShow);\n }\n }\n else if (this.x) {\n this.x.tickValues([]);\n this.subX?.tickValues([]);\n }\n if (config.zoom_rescale && !flow) {\n xDomainForZoom = scale.x.orgDomain();\n }\n [\"y\", \"y2\"].forEach(key => {\n const prefix = `axis_${key}_`;\n const axisScale = scale[key];\n if (axisScale) {\n const tickValues = config[`${prefix}tick_values`];\n const tickCount = config[`${prefix}tick_count`];\n axisScale.domain($$.getYDomain(targetsToShow, key, xDomainForZoom));\n if (!tickValues && tickCount) {\n const axis = $$.axis[key];\n const domain = axisScale.domain();\n axis.tickValues(this.generateTickValues(domain, domain.every(v => v === 0) ? 1 : tickCount, this.isTimeSeriesY()));\n }\n }\n });\n // Update sub domain\n if (wth.Y) {\n scale.subY?.domain($$.getYDomain(targetsToShow, \"y\"));\n scale.subY2?.domain($$.getYDomain(targetsToShow, \"y2\"));\n }\n }\n /**\n * Redraw axis\n * @param {Array} targetsToShow targets data to be shown\n * @param {object} wth option object\n * @param {d3.Transition} transitions Transition object\n * @param {object} flow flow object\n * @param {boolean} isInit called from initialization\n * @private\n */\n redrawAxis(targetsToShow, wth, transitions, flow, isInit) {\n const $$ = this.owner;\n this.syncAxisDomains(targetsToShow, wth, flow);\n // axes\n this.redraw(transitions, $$.hasArcType(), isInit);\n // Update axis label\n this.updateLabels(wth.Transition);\n // show/hide if manual culling needed\n if ((wth.UpdateXDomain || wth.UpdateXAxis || wth.Y) && targetsToShow.length) {\n this.setCulling();\n }\n }\n /**\n * Set manual culling\n * @private\n */\n setCulling() {\n const $$ = this.owner;\n const { config, state: { clip, current }, $el } = $$;\n [\"subX\", \"x\", \"y\", \"y2\"].forEach(type => {\n const axis = $el.axis[type];\n // subchart x axis should be aligned with x axis culling\n const id = type === \"subX\" ? \"x\" : type;\n const cullingOptionPrefix = `axis_${id}_tick_culling`;\n const toCull = config[cullingOptionPrefix];\n if (axis && toCull) {\n const tickNodes = axis.selectAll(\".tick\");\n const tickValues = sortValue(tickNodes.data(), !config[`${cullingOptionPrefix}_reverse`]);\n const tickSize = tickValues.length;\n const cullingMax = config[`${cullingOptionPrefix}_max`];\n const lines = config[`${cullingOptionPrefix}_lines`];\n const cullTickLine = !lines || _hasOverlappedTickLineIntervals(this[type], tickValues, _getTickLineWidth(tickNodes));\n let intervalForCulling;\n if (tickSize) {\n for (let i = 1; i < tickSize; i++) {\n if (tickSize / i < cullingMax) {\n intervalForCulling = i;\n break;\n }\n }\n // culling.max <= 1 or a single tick can't satisfy the loop condition\n intervalForCulling = intervalForCulling ?? tickSize;\n // Build index map once: O(n) instead of O(n²) indexOf per tick\n const tickIndexMap = new Map();\n for (let i = 0; i < tickValues.length; i++) {\n tickIndexMap.set(tickValues[i], i);\n }\n tickNodes\n .each(function (d) {\n const node = cullTickLine ? this : this.querySelector(\"text\");\n if (node) {\n node.style.display =\n (tickIndexMap.get(d) ?? 0) % intervalForCulling ? \"none\" : null;\n }\n });\n }\n else {\n tickNodes.style(\"display\", null);\n }\n // set/unset x_axis_tick_clippath\n if (type === \"x\") {\n const clipPath = current.maxTickSize.x.clipPath ?\n clip.pathXAxisTickTexts :\n null;\n $el.svg.selectAll(`.${$AXIS.axisX} .tick text`)\n .attr(\"clip-path\", clipPath);\n }\n }\n });\n }\n /**\n * Set axis tooltip\n * @private\n */\n setAxisTooltip() {\n const $$ = this.owner;\n const { config: { axis_rotated: isRotated, axis_tooltip }, $el: { axis, axisTooltip } } = $$;\n const bgColor = axis_tooltip.backgroundColor ?? \"black\";\n $$.generateTextBGColorFilter(bgColor, {\n x: -0.15,\n y: -0.2,\n width: 1.3,\n height: 1.3\n });\n [\"x\", \"y\", \"y2\"].forEach(v => {\n if (isString(bgColor) || bgColor[v]) {\n axisTooltip[v] = axis[v]?.append(\"text\")\n .classed($AXIS[`axis${v.toUpperCase()}Tooltip`], true)\n .attr(\"filter\", $$.updateTextBGColor({ id: v }, bgColor));\n if (isRotated) {\n const pos = v === \"x\" ? \"x\" : \"y\";\n const val = v === \"y\" ? \"1.15em\" : (v === \"x\" ? \"-0.3em\" : \"-0.4em\");\n axisTooltip[v]?.attr(pos, val)\n .attr(`d${v === \"x\" ? \"y\" : \"x\"}`, v === \"x\" ? \"0.4em\" : \"-1.3em\")\n .style(\"text-anchor\", v === \"x\" ? \"end\" : null);\n }\n else {\n const pos = v === \"x\" ? \"y\" : \"x\";\n const val = v === \"x\" ? \"1.15em\" : `${v === \"y\" ? \"-\" : \"\"}0.4em`;\n axisTooltip[v]?.attr(pos, val)\n .attr(`d${v === \"x\" ? \"x\" : \"y\"}`, v === \"x\" ? \"-1em\" : \"0.3em\")\n .style(\"text-anchor\", v === \"y\" ? \"end\" : null);\n }\n }\n });\n }\n}\n\nexport { axis as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { $SHAPE, $COMMON, $EVENT } from '../../config/classes.js';\nimport { getPointer, getScrollPosition, getBoundingRect } from '../../module/util/dom.js';\nimport { isFunction, isBoolean } from '../../module/util/type-checks.js';\n\nvar eventrect = {\n /**\n * Initialize the area that detects the event.\n * Add a container for the zone that detects the event.\n * @private\n */\n initEventRect() {\n const $$ = this;\n $$.$el.main.select(`.${$COMMON.chart}`)\n .append(\"g\")\n .attr(\"class\", $EVENT.eventRects)\n .style(\"fill-opacity\", \"0\");\n },\n /**\n * Redraws the area that detects the event.\n * @private\n */\n redrawEventRect() {\n const $$ = this;\n const { config, state, $el } = $$;\n const isMultipleX = $$.isMultipleX();\n const isInverted = config.axis_x_inverted;\n if ($el.eventRect) {\n $$.updateEventRect($el.eventRect, true);\n // do not initialize eventRect when data is empty\n }\n else if ($$.data.targets.length) {\n const eventRects = $$.$el.main.select(`.${$EVENT.eventRects}`)\n .style(\"cursor\", config.zoom_enabled && config.zoom_type !== \"drag\" ?\n (config.axis_rotated ? \"ns-resize\" : \"ew-resize\") :\n null)\n .classed($EVENT.eventRectsMultiple, isMultipleX)\n .classed($EVENT.eventRectsSingle, !isMultipleX);\n // append event <rect>\n const eventRectUpdate = eventRects.selectAll(`.${$EVENT.eventRect}`)\n .data([0])\n .enter()\n .append(\"rect\");\n $$.updateEventRect(eventRectUpdate);\n // bind event to <rect> element\n $$.updateEventType(eventRectUpdate);\n // bind draggable selection\n eventRectUpdate.call($$.getDraggableSelection());\n $el.eventRect = eventRectUpdate;\n if ($$.state.inputType === \"touch\" && !$el.svg.on(\"touchstart.eventRect\") &&\n !$$.hasArcType()) {\n $$.bindTouchOnEventRect();\n }\n // when initilazed with empty data and data loaded later, need to update eventRect\n state.rendered && $$.updateEventRect($el.eventRect, true);\n }\n if (!isMultipleX) {\n // Set data and update eventReceiver.data\n const xAxisTickValues = $$.getMaxDataCountTarget();\n if (!config.data_xSort || isInverted) {\n xAxisTickValues.sort((a, b) => (isInverted ? b.x - a.x : a.x - b.x));\n }\n // update data's index value to be alinged with the x Axis\n $$.updateDataIndexByX(xAxisTickValues);\n $$.updateXs(xAxisTickValues);\n $$.updatePointClass?.(true);\n state.eventReceiver.data = xAxisTickValues;\n }\n $$.updateEventRectData();\n },\n bindTouchOnEventRect() {\n const $$ = this;\n const { config, state, $el: { eventRect, svg } } = $$;\n const selectRect = context => {\n if ($$.isMultipleX()) {\n $$.selectRectForMultipleXs(context);\n }\n else {\n const index = $$.getDataIndexFromEvent(state.event);\n $$.callOverOutForTouch(index);\n index === -1 ? $$.unselectRect() : $$.selectRectForSingle(context, index);\n }\n };\n const unselectRect = () => {\n $$.unselectRect();\n $$.callOverOutForTouch();\n };\n // call event.preventDefault()\n // according 'interaction.inputType.touch.preventDefault' option\n const preventDefault = config.interaction_inputType_touch.preventDefault;\n const isPrevented = (isBoolean(preventDefault) && preventDefault) || false;\n const preventThreshold = (!isNaN(preventDefault) && preventDefault) || null;\n let startPx;\n // Determine passive option based on preventDefault setting\n // If preventDefault is needed, passive must be false\n const passiveOption = !isPrevented && preventThreshold === null;\n const preventEvent = event => {\n const eventType = event.type;\n const touch = event.changedTouches[0];\n const currentXY = touch[`client${config.axis_rotated ? \"Y\" : \"X\"}`];\n // prevent document scrolling\n if (eventType === \"touchstart\") {\n if (isPrevented) {\n event.preventDefault();\n }\n else if (preventThreshold !== null) {\n startPx = currentXY;\n }\n }\n else if (eventType === \"touchmove\") {\n if (isPrevented || startPx === true || (preventThreshold !== null &&\n Math.abs(startPx - currentXY) >= preventThreshold)) {\n // once prevented, keep prevented during whole 'touchmove' context\n startPx = true;\n event.preventDefault();\n }\n }\n };\n // bind touch events\n eventRect\n .on(\"touchstart\", event => {\n state.event = event;\n $$.updateEventRect();\n }, { passive: passiveOption })\n .on(\"touchstart.eventRect touchmove.eventRect\", event => {\n state.event = event;\n if (!eventRect.empty() && eventRect.classed($EVENT.eventRect)) {\n // if touch points are > 1, means doing zooming interaction. In this case do not execute tooltip codes.\n if (state.dragging || state.flowing || $$.hasArcType() ||\n event.touches.length > 1) {\n return;\n }\n preventEvent(event);\n selectRect(eventRect.node());\n }\n else {\n unselectRect();\n }\n }, { passive: passiveOption })\n .on(\"touchend.eventRect\", event => {\n state.event = event;\n if (!eventRect.empty() && eventRect.classed($EVENT.eventRect)) {\n if ($$.hasArcType() || !$$.toggleShape || state.cancelClick) {\n state.cancelClick && (state.cancelClick = false);\n }\n }\n }, { passive: passiveOption });\n svg.on(\"touchstart\", event => {\n state.event = event;\n const { target } = event;\n if (target && target !== eventRect.node()) {\n unselectRect();\n }\n }, { passive: passiveOption });\n },\n /**\n * Update event rect size\n * @param {d3Selection} eventRect Event <rect> element\n * @param {boolean} force Force to update\n * @private\n */\n updateEventRect(eventRect, force = false) {\n const $$ = this;\n const { state, $el } = $$;\n const { eventReceiver, width, height, rendered, resizing } = state;\n const rectElement = eventRect || $el.eventRect;\n const updateClientRect = () => {\n if (eventReceiver) {\n const scrollPos = getScrollPosition($el.chart.node());\n eventReceiver.rect = getBoundingRect(rectElement.node(), true)\n .toJSON();\n eventReceiver.rect.top += scrollPos.y;\n eventReceiver.rect.left += scrollPos.x;\n }\n };\n if (!rendered || resizing || force) {\n rectElement\n .attr(\"x\", 0)\n .attr(\"y\", 0)\n .attr(\"width\", width)\n .attr(\"height\", height);\n // only for init\n if (!rendered || force) {\n rectElement.classed($EVENT.eventRect, true);\n }\n }\n updateClientRect();\n },\n /**\n * Update event type (single or multiple x)\n * @param {d3Selection | boolean} target Target element or boolean to rebind event\n */\n updateEventType(target) {\n const $$ = this;\n const isRebindCall = isBoolean(target);\n const eventRect = isRebindCall ? $$.$el.eventRect : target;\n const unbindEvent = isRebindCall ? target !== eventRect?.datum().multipleX : false;\n if (eventRect) {\n // release previous event listeners\n unbindEvent && eventRect?.on(\"mouseover mousemove mouseout click\", null);\n $$.isMultipleX() ?\n $$.generateEventRectsForMultipleXs(eventRect) :\n $$.generateEventRectsForSingleX(eventRect);\n }\n },\n /**\n * Updates the location and size of the eventRect.\n * @private\n */\n updateEventRectData() {\n const $$ = this;\n const { config, scale, state } = $$;\n const xScale = scale.zoom || scale.x;\n const isRotated = config.axis_rotated;\n const isMultipleX = $$.isMultipleX();\n // Skip recalculation if scale domain, plot size or visibility hasn't changed.\n // width/height must be part of the key: resize keeps the domain but moves coords.\n const xDomain = xScale?.domain();\n const fingerprint = xDomain ?\n `${xDomain[0]}_${xDomain[1]}_${state.width}_${state.height}_${$$.data.targets.length}_${state.dataGeneration}_${[...state.hiddenTargetIds].join(\",\")}` :\n null;\n if (fingerprint && fingerprint === state._eventRectFingerprint) {\n return;\n }\n state._eventRectFingerprint = fingerprint;\n let x;\n let y;\n let w;\n let h;\n $$.updateEventType(isMultipleX);\n if (isMultipleX) {\n // TODO: rotated not supported yet\n x = 0;\n y = 0;\n w = state.width;\n h = state.height;\n }\n else {\n let rectW;\n let rectX;\n if ($$.axis.isCategorized()) {\n rectW = $$.getEventRectWidth();\n rectX = d => xScale(d.x) - (rectW / 2);\n }\n else {\n const getPrevNextX = ({ index }) => ({\n prev: $$.getPrevX(index),\n next: $$.getNextX(index)\n });\n rectW = (d) => {\n const x = getPrevNextX(d);\n const xDomain = xScale.domain();\n let val;\n // if there this is a single data point make the eventRect full width (or height)\n if (x.prev === null && x.next === null) {\n val = isRotated ? state.height : state.width;\n }\n else if (x.prev === null) {\n val = (xScale(x.next) + xScale(d.x)) / 2;\n }\n else if (x.next === null) {\n val = xScale(xDomain[1]) - ((xScale(x.prev) + xScale(d.x)) / 2);\n }\n else {\n val = Math.max(0, (xScale(x.next) - xScale(x.prev)) / 2);\n }\n return val;\n };\n rectX = (d) => {\n const x = getPrevNextX(d);\n let val;\n // if there this is a single data point position the eventRect at 0\n if (x.prev === null && x.next === null) {\n val = 0;\n }\n else if (x.prev === null) {\n val = xScale(xScale.domain()[0]);\n }\n else {\n val = (xScale(d.x) + xScale(x.prev)) / 2;\n }\n return val;\n };\n }\n x = isRotated ? 0 : rectX;\n y = isRotated ? rectX : 0;\n w = isRotated ? state.width : rectW;\n h = isRotated ? rectW : state.height;\n }\n const { eventReceiver } = state;\n const call = (fn, v) => (isFunction(fn) ? fn(v) : fn);\n // reset for possible remains coords data before the data loading\n eventReceiver.coords.splice(eventReceiver.data.length);\n eventReceiver.data.forEach((d, i) => {\n eventReceiver.coords[i] = {\n x: call(x, d),\n y: call(y, d),\n w: call(w, d),\n h: call(h, d)\n };\n });\n },\n /**\n * Seletct rect for single x value\n * @param {d3Selection} context Event rect element\n * @param {number} index x Axis index\n * @private\n */\n selectRectForSingle(context, index) {\n const $$ = this;\n const { config, state, $el: { main, circle } } = $$;\n const isSelectionEnabled = config.data_selection_enabled;\n const isSelectionGrouped = config.data_selection_grouped;\n const isSelectable = config.data_selection_isselectable;\n const isTooltipGrouped = config.tooltip_grouped;\n const selectedData = $$.getAllValuesOnIndex(index);\n if (isTooltipGrouped) {\n $$.showTooltip(selectedData, context);\n $$.showGridFocus?.(selectedData);\n if (!isSelectionEnabled || isSelectionGrouped) {\n return;\n }\n }\n // remove possible previous focused state\n !circle &&\n main.selectAll(`.${$COMMON.EXPANDED}:not(.${$SHAPE.shape}-${index})`).classed($COMMON.EXPANDED, false);\n const shapeAtIndex = main.selectAll(`.${$SHAPE.shape}-${index}`)\n .classed($COMMON.EXPANDED, true)\n .style(\"cursor\", isSelectable ? \"pointer\" : null)\n .filter(function (d) {\n return $$.isWithinShape(this, d);\n });\n shapeAtIndex\n .call(selected => {\n const d = selected.data();\n if (isSelectionEnabled &&\n (isSelectionGrouped || isSelectable?.bind($$.api)(d))) {\n context.style.cursor = \"pointer\";\n }\n if (!isTooltipGrouped) {\n $$.showTooltip(d, context);\n $$.showGridFocus?.(d);\n $$.unexpandCircles?.();\n selected.each(d => $$.setExpand(index, d.id));\n }\n });\n if (!isTooltipGrouped && shapeAtIndex.empty()) {\n // `point.focus.only` can render focus points away from the hovered data point.\n // Fall back to data distance so ungrouped tooltips can still focus the intended point.\n const mouse = getPointer(state.event, context);\n const closestData = selectedData.filter(d => {\n if ($$.isTargetToShow(d.id)) {\n const dist = $$.dist(d, mouse);\n return dist < $$.getPointSensitivity(d);\n }\n return false;\n });\n if (closestData.length > 0) {\n let closest = closestData[0];\n let minDist = $$.dist(closest, mouse);\n for (let i = 1; i < closestData.length; i++) {\n const d = closestData[i];\n const dist = $$.dist(d, mouse);\n if (dist < minDist) {\n minDist = dist;\n closest = d;\n }\n }\n $$.showTooltip([closest], context);\n $$.showGridFocus?.([closest]);\n $$.unexpandCircles?.();\n $$.setExpand(index, closest.id, true);\n if (isSelectionEnabled &&\n (isSelectionGrouped || isSelectable?.bind($$.api)(closest))) {\n context.style.cursor = \"pointer\";\n }\n }\n else if (config.interaction_onout) {\n $$.hideGridFocus?.();\n $$.hideTooltip();\n !isSelectionGrouped && $$.setExpand(index);\n }\n }\n },\n /**\n * Select rect for multiple x values\n * @param {d3Selection} context Event rect element\n * @param {boolean} [triggerEvent=true] Whether trigger event or not\n * @private\n */\n selectRectForMultipleXs(context, triggerEvent = true) {\n const $$ = this;\n const { config, state } = $$;\n const targetsToShow = $$.getTargetsToShow();\n // do nothing when dragging\n if (state.dragging || $$.hasArcType(targetsToShow)) {\n return;\n }\n const mouse = getPointer(state.event, context);\n const closest = $$.findClosestFromTargets(targetsToShow, mouse);\n if (triggerEvent && state.mouseover && (!closest || closest.id !== state.mouseover.id)) {\n config.data_onout.call($$.api, state.mouseover);\n state.mouseover = undefined;\n }\n if (!closest) {\n $$.unselectRect();\n return;\n }\n const sameXData = ($$.isBubbleType(closest) || $$.isScatterType(closest) || !config.tooltip_grouped) ?\n [closest] :\n $$.filterByX(targetsToShow, closest.x);\n // show tooltip when cursor is close to some point\n const selectedData = sameXData.map(d => $$.addName(d));\n $$.showTooltip(selectedData, context);\n // expand points\n $$.setExpand(closest.index, closest.id, true);\n // Show xgrid focus line (optional module — grid resolver)\n $$.showGridFocus?.(selectedData);\n const dist = $$.dist(closest, mouse);\n // Show cursor as pointer if point is close to mouse position\n if ($$.isBarType(closest.id) || dist < $$.getPointSensitivity(closest)) {\n $$.$el.eventRect.style(\"cursor\", \"pointer\");\n if (triggerEvent && (!state.mouseover ||\n state.mouseover.x !== closest.x ||\n state.mouseover.id !== closest.id)) {\n config.data_onover.call($$.api, closest);\n state.mouseover = closest;\n }\n }\n },\n /**\n * Unselect EventRect.\n * @private\n */\n unselectRect() {\n const $$ = this;\n const { state, $el: { circle, tooltip } } = $$;\n state._lastTooltipMouse = null;\n if (state.isCanvasMode) {\n $$.clearCanvasFocus?.();\n tooltip && $$.hideTooltip();\n return;\n }\n $$.$el.eventRect?.style(\"cursor\", null);\n $$.hideGridFocus?.();\n if (tooltip) {\n $$.hideTooltip();\n $$._handleLinkedCharts(false);\n }\n circle && !$$.isPointFocusOnly() && $$.unexpandCircles();\n $$.expandBarTypeShapes(false);\n },\n /**\n * Create eventRect for each data on the x-axis.\n * Register touch and drag events.\n * @param {object} eventRectEnter d3.select($EVENT.eventRects) object.\n * @returns {object} d3.select($EVENT.eventRects) object.\n * @private\n */\n generateEventRectsForSingleX(eventRectEnter) {\n const $$ = this;\n const { config, state } = $$;\n const { eventReceiver } = state;\n const rect = eventRectEnter\n .style(\"cursor\", config.data_selection_enabled && config.data_selection_grouped ? \"pointer\" : null)\n .on(\"click\", function (event) {\n state.event = event;\n const { currentIdx, data } = eventReceiver;\n const d = data[currentIdx === -1 ? $$.getDataIndexFromEvent(event) : currentIdx];\n $$.clickHandlerForSingleX.bind(this)(d, $$);\n })\n .datum({ multipleX: false });\n if (state.inputType === \"mouse\") {\n const getData = event => {\n const index = event ? $$.getDataIndexFromEvent(event) : eventReceiver.currentIdx;\n return index > -1 ? eventReceiver.data[index] : null;\n };\n rect\n .on(\"mouseover\", event => {\n state.event = event;\n $$.updateEventRect();\n Object.values($$.$el.axisTooltip)\n .forEach((v) => v?.style(\"display\", null));\n })\n .on(\"mousemove\", function (event) {\n const d = getData(event);\n state.event = event;\n if (!d) {\n return;\n }\n let { index } = d;\n const stepType = config.line_step_type;\n // tooltip position match for step-before & step-after\n if (config.line_step_tooltipMatch && $$.hasType(\"step\") &&\n /^step\\-(before|after)$/.test(stepType)) {\n const scale = $$.scale.zoom || $$.scale.x;\n const xs = $$.axis.xs[index];\n const inverted = scale.invert(getPointer(event, this)[0]);\n if (stepType === \"step-after\" && inverted < xs) {\n index -= 1;\n }\n else if (stepType === \"step-before\" && inverted > xs) {\n index += 1;\n }\n }\n $$.showAxisGridFocus();\n const eventOnSameIdx = config.tooltip_grouped &&\n index === eventReceiver.currentIdx;\n // do nothing while dragging/flowing\n if (state.dragging || state.flowing || $$.hasArcType() || eventOnSameIdx) {\n // Throttle tooltip position updates: skip if mouse hasn't moved enough\n if (config.tooltip_show && eventOnSameIdx) {\n const [mx, my] = getPointer(event, this);\n const last = state._lastTooltipMouse;\n if (!last ||\n (mx - last[0]) ** 2 + (my - last[1]) ** 2 >= 9) {\n state._lastTooltipMouse = [mx, my];\n $$.setTooltipPosition();\n }\n }\n return;\n }\n if (index !== eventReceiver.currentIdx) {\n $$.setOverOut(false, eventReceiver.currentIdx);\n eventReceiver.currentIdx = index;\n }\n index === -1 ? $$.unselectRect() : $$.selectRectForSingle(this, index);\n // As of individual data point(or <path>) element can't bind mouseover/out event\n // to determine current interacting element, so use 'mousemove' event instead.\n $$.setOverOut(index !== -1, index);\n })\n .on(\"mouseout\", event => {\n state.event = event;\n // chart is destroyed ($$.config, not the closure-captured one, becomes null)\n if (!$$.config || $$.hasArcType() || eventReceiver.currentIdx === -1 ||\n !config.interaction_onout) {\n return;\n }\n $$.hideAxisGridFocus();\n $$.unselectRect();\n $$.setOverOut(false, eventReceiver.currentIdx);\n // reset the event current index\n eventReceiver.currentIdx = -1;\n });\n }\n return rect;\n },\n clickHandlerForSingleX(d, ctx) {\n const $$ = ctx;\n const { config, state, $el: { main } } = $$;\n if (!d || $$.hasArcType() || state.cancelClick) {\n state.cancelClick && (state.cancelClick = false);\n return;\n }\n const { index } = d;\n main.selectAll(`.${$SHAPE.shape}-${index}`)\n .each(function (d2) {\n if (config.data_selection_grouped || $$.isWithinShape(this, d2)) {\n $$.toggleShape?.(this, d2, index);\n config.data_onclick.bind($$.api)(d2, this);\n }\n });\n },\n /**\n * Create an eventRect,\n * Register touch and drag events.\n * @param {object} eventRectEnter d3.select($EVENT.eventRects) object.\n * @private\n */\n generateEventRectsForMultipleXs(eventRectEnter) {\n const $$ = this;\n const { config, state } = $$;\n eventRectEnter\n .on(\"click\", function (event) {\n state.event = event;\n $$.clickHandlerForMultipleXS.bind(this)($$);\n })\n .datum({ multipleX: true });\n if (state.inputType === \"mouse\") {\n eventRectEnter\n .on(\"mouseover mousemove\", function (event) {\n state.event = event;\n $$.selectRectForMultipleXs(this);\n })\n .on(\"mouseout\", event => {\n state.event = event;\n // chart is destroyed\n if (!$$.config || $$.hasArcType() || !config.interaction_onout) {\n return;\n }\n $$.unselectRect();\n });\n }\n },\n clickHandlerForMultipleXS(ctx) {\n const $$ = ctx;\n const { config, state } = $$;\n const targetsToShow = $$.getTargetsToShow();\n if ($$.hasArcType(targetsToShow)) {\n return;\n }\n const mouse = getPointer(state.event, this);\n const closest = $$.findClosestFromTargets(targetsToShow, mouse);\n if (!closest) {\n return;\n }\n const sensitivity = $$.getPointSensitivity(closest);\n // select if selection enabled\n if ($$.isBarType(closest.id) || $$.dist(closest, mouse) < sensitivity) {\n $$.$el.main.selectAll(`.${$SHAPE.shapes}${$$.getTargetSelectorSuffix(closest.id)}`)\n .selectAll(`.${$SHAPE.shape}-${closest.index}`)\n .each(function () {\n if (config.data_selection_grouped || $$.isWithinShape(this, closest)) {\n $$.toggleShape?.(this, closest, closest.index);\n config.data_onclick.bind($$.api)(closest, this);\n }\n });\n }\n }\n};\n\nexport { eventrect as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\nvar clip = {\n initClip() {\n const $$ = this;\n const { clip, datetimeId } = $$.state;\n // MEMO: clipId needs to be unique because it conflicts when multiple charts exist\n clip.id = `${datetimeId}-clip`;\n clip.idXAxis = `${clip.id}-xaxis`;\n clip.idYAxis = `${clip.id}-yaxis`;\n clip.idGrid = `${clip.id}-grid`;\n // Define 'clip-path' attribute values\n clip.path = $$.getClipPath(clip.id);\n clip.pathXAxis = $$.getClipPath(clip.idXAxis);\n clip.pathYAxis = $$.getClipPath(clip.idYAxis);\n clip.pathGrid = $$.getClipPath(clip.idGrid);\n },\n getClipPath(id) {\n const $$ = this;\n const { config } = $$;\n if ((!config.clipPath && /-clip$/.test(id)) ||\n (!config.axis_x_clipPath && /-clip-xaxis$/.test(id)) ||\n (!config.axis_y_clipPath && /-clip-yaxis$/.test(id))) {\n return null;\n }\n return `url(#${id})`;\n },\n appendClip(parent, id) {\n id && parent.append(\"clipPath\")\n .attr(\"id\", id)\n .append(\"rect\");\n },\n /**\n * Set x Axis clipPath dimension\n * @param {d3Selecton} node clipPath <rect> selection\n * @private\n */\n setXAxisClipPath(node) {\n const $$ = this;\n const { config, state: { margin, width, height } } = $$;\n const isRotated = config.axis_rotated;\n const left = Math.max(30, margin.left) - (isRotated ? 0 : 20);\n // less than 20 is not enough to show the axis label 'outer' without legend\n const h = (isRotated ? (margin.top + height) + 10 : margin.bottom) + 20;\n const x = isRotated ? -(1 + left) : -(left - 1);\n const y = -15; // -Math.max(15, margin.top);\n const w = isRotated ? margin.left + 20 : width + 10 + left;\n node\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"width\", w)\n .attr(\"height\", h);\n },\n /**\n * Set y Axis clipPath dimension\n * @param {d3Selection} node clipPath <rect> selection\n * @private\n */\n setYAxisClipPath(node) {\n const $$ = this;\n const { config, state: { margin, width, height } } = $$;\n const isRotated = config.axis_rotated;\n const left = Math.max(30, margin.left) - (isRotated ? 20 : 0);\n const isInner = config.axis_y_inner;\n const x = isInner && !isRotated ?\n (config.axis_y_label.text ? -20 : -1) :\n (isRotated ? -(1 + left) : -(left - 1));\n const y = -(isRotated ? 20 : margin.top);\n const w = (isRotated ? width + 15 + left : margin.left + 20) + (isInner ? 20 : 0);\n const h = (isRotated ? margin.bottom + 10 : (margin.top + height)) + 10;\n node\n .attr(\"x\", x)\n .attr(\"y\", y)\n .attr(\"width\", w)\n .attr(\"height\", h);\n },\n updateXAxisTickClip() {\n const $$ = this;\n const { config, state: { clip, xAxisHeight }, $el: { defs } } = $$;\n const newXAxisHeight = $$.getHorizontalAxisHeight(\"x\");\n if (defs && !clip.idXAxisTickTexts) {\n const clipId = `${clip.id}-xaxisticktexts`;\n $$.appendClip(defs, clipId);\n clip.idXAxisTickTexts = clipId;\n clip.pathXAxisTickTexts = $$.getClipPath(clip.idXAxisTickTexts);\n }\n if (!config.axis_x_tick_multiline &&\n $$.getAxisTickRotate(\"x\") &&\n newXAxisHeight !== xAxisHeight) {\n $$.setXAxisTickClipWidth();\n $$.setXAxisTickTextClipPathWidth();\n }\n $$.state.xAxisHeight = newXAxisHeight;\n },\n setXAxisTickClipWidth() {\n const $$ = this;\n const { config, state: { current: { maxTickSize } } } = $$;\n const xAxisTickRotate = $$.getAxisTickRotate(\"x\");\n if (!config.axis_x_tick_multiline && xAxisTickRotate) {\n const sinRotation = Math.sin(Math.PI / 180 * Math.abs(xAxisTickRotate));\n maxTickSize.x.clipPath = ($$.getHorizontalAxisHeight(\"x\") - 20) / sinRotation;\n }\n else {\n maxTickSize.x.clipPath = null;\n }\n },\n setXAxisTickTextClipPathWidth() {\n const $$ = this;\n const { state: { clip, current }, $el: { svg } } = $$;\n if (svg) {\n svg.select(`#${clip.idXAxisTickTexts} rect`)\n .attr(\"width\", current.maxTickSize.x.clipPath)\n .attr(\"height\", 30);\n }\n }\n};\n\nexport { clip as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { isNumber } from '../../module/util/type-checks.js';\n\nvar sizeAxis = {\n /**\n * Get Axis size according its position\n * @param {string} id Axis id value - x, y or y2\n * @returns {number} size Axis size value\n * @private\n */\n getAxisSize(id) {\n const $$ = this;\n const isRotated = $$.config.axis_rotated;\n return (isRotated && id === \"x\") || (!isRotated && /y2?/.test(id)) ?\n $$.getAxisWidthByAxisId(id, true) :\n $$.getHorizontalAxisHeight(id);\n },\n getAxisWidthByAxisId(id, withoutRecompute) {\n const $$ = this;\n if ($$.axis) {\n const position = $$.axis?.getAxisLabelPosition(id);\n const { width } = $$.axis.getMaxTickSize(id, withoutRecompute);\n const gap = width === 0 ? 0.5 : 0;\n return width + ($$.config.padding?.mode === \"fit\" ?\n position.isInner ? (10 + gap) : 10 :\n position.isInner ?\n (20 + gap) :\n 40);\n }\n else {\n return 40;\n }\n },\n getHorizontalAxisHeight(id) {\n const $$ = this;\n const { config, state } = $$;\n const { rotatedPadding, isLegendRight, isLegendInset } = state;\n const isRotated = config.axis_rotated;\n const isFitPadding = config.padding?.mode === \"fit\";\n const isInner = config[`axis_${id}_inner`];\n const hasLabelText = config[`axis_${id}_label`].text;\n const defaultHeight = 13;\n let h = config.padding?.mode === \"fit\" ?\n (isInner && !hasLabelText ? (id === \"y\" ? 1 : 0) : 20) :\n 30;\n if (id === \"x\" && !config.axis_x_show) {\n return 8;\n }\n if (id === \"x\" && isNumber(config.axis_x_height)) {\n return config.axis_x_height;\n }\n if (id === \"y\" && !config.axis_y_show) {\n return config.legend_show &&\n !isLegendRight &&\n !isLegendInset ?\n 10 :\n 1;\n }\n if (id === \"y2\" && !config.axis_y2_show) {\n return isFitPadding ? 0 : rotatedPadding.top;\n }\n const maxtickSize = $$.axis.getMaxTickSize(id);\n const isXAxisTickRotated = Math.abs(config.axis_x_tick_rotate) > 0 && (!config.axis_x_tick_autorotate || $$.needToRotateXAxisTickTexts());\n if ((config.axis_x_tick_multiline || isXAxisTickRotated) &&\n maxtickSize.height > defaultHeight) {\n h += maxtickSize.height - defaultHeight;\n }\n return h +\n ($$.axis.getAxisLabelPosition(id).isInner ? 0 : 10) +\n (id === \"y2\" && !isRotated ? -10 : 0);\n },\n getEventRectWidth() {\n const $$ = this;\n const { config, axis } = $$;\n const isInverted = config.axis_x_inverted;\n const tickInterval = axis.x.tickInterval();\n return Math.max(0, isInverted ? Math.abs(tickInterval) : tickInterval);\n },\n /**\n * Get axis tick test rotate value\n * @param {string} id Axis id\n * @returns {number} rotate value\n * @private\n */\n getAxisTickRotate(id) {\n const $$ = this;\n const { axis, config, state, $el } = $$;\n let rotate = config[`axis_${id}_tick_rotate`];\n if (id === \"x\") {\n const allowedXAxisTypes = axis.isCategorized() || axis.isTimeSeries();\n if (config.axis_x_tick_fit && allowedXAxisTypes) {\n const xTickCount = config.axis_x_tick_count;\n const currentXTicksLength = state.current.maxTickSize.x.ticks.length;\n let tickCount = 0;\n if (xTickCount) {\n tickCount = xTickCount > currentXTicksLength ? currentXTicksLength : xTickCount;\n }\n else if (currentXTicksLength) {\n tickCount = currentXTicksLength;\n }\n if (tickCount !== state.axis.x.tickCount) {\n const { targets } = $$.data;\n state.axis.x.padding = $$.getXDomainPadding([\n $$.getXDomainMinMax(targets, \"min\"),\n $$.getXDomainMinMax(targets, \"max\")\n ], tickCount);\n }\n state.axis.x.tickCount = tickCount;\n }\n if (($el.svg || state.isCanvasMode) &&\n config.axis_x_tick_autorotate &&\n config.axis_x_tick_fit &&\n !config.axis_x_tick_multiline &&\n !config.axis_x_tick_culling &&\n allowedXAxisTypes) {\n rotate = $$.needToRotateXAxisTickTexts() ? config.axis_x_tick_rotate : 0;\n }\n }\n return rotate;\n },\n /**\n * Check weather axis tick text needs to be rotated\n * @returns {boolean}\n * @private\n */\n needToRotateXAxisTickTexts() {\n const $$ = this;\n const { state: { axis, current, isLegendRight, legendItemWidth } } = $$;\n const legendWidth = isLegendRight && legendItemWidth;\n const xAxisLength = current.width - legendWidth -\n $$.getCurrentPaddingByDirection(\"left\") - $$.getCurrentPaddingByDirection(\"right\");\n const tickCountWithPadding = axis.x.tickCount +\n axis.x.padding.left + axis.x.padding.right;\n const { width } = $$.axis.getMaxTickSize(\"x\");\n const tickLength = tickCountWithPadding ? xAxisLength / tickCountWithPadding : 0;\n return width > tickLength;\n }\n};\n\nexport { sizeAxis as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * x Axis config options\n */\nvar x = {\n /**\n * Set clip-path attribute for x axis element\n * @name axis․x․clipPath\n * @memberof Options\n * @type {boolean}\n * @default true\n * @see [Demo]()\n * @example\n * // don't set 'clip-path' attribute\n * clipPath: false\n */\n axis_x_clipPath: true,\n /**\n * Show or hide x axis.\n * @name axis․x․show\n * @memberof Options\n * @type {boolean}\n * @default true\n * @example\n * axis: {\n * x: {\n * show: false\n * }\n * }\n */\n axis_x_show: true,\n /**\n * Force the x axis to interact as single rather than multiple x axes.\n * - **NOTE:** The tooltip event will be triggered nearing each data points(for multiple xs) rather than x axis based(as single x does) in below condition:\n * - for `bubble` & `scatter` type\n * - when `data.xs` is set\n * - when `tooltip.grouped=false` is set\n * - `tooltip.grouped` options will take precedence over `axis.forceSingleX` option.\n * @name axis․x․forceAsSingle\n * @memberof Options\n * @type {boolean}\n * @default false\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.ForceAsSingle)\n * @example\n * axis: {\n * x: {\n * // will work as single x axis\n * forceAsSingle: true\n * }\n * }\n */\n axis_x_forceAsSingle: false,\n /**\n * Set type of x axis.<br><br>\n * **Available Values:**\n * - category\n * - indexed\n * - log\n * - timeseries\n *\n * **NOTE:**<br>\n * - **log** type:\n * - the x values specified by [`data.x`](#.data%25E2%2580%25A4x)(or by any equivalent option), must be exclusively-positive.\n * - x axis min value should be >= 0.\n * - for 'category' type, `data.xs` option isn't supported.\n * @name axis․x․type\n * @memberof Options\n * @type {string}\n * @default indexed\n * @see [Demo: indexed](https://naver.github.io/billboard.js/demo/#Chart.AreaChart)\n * @see [Demo: timeseries](https://naver.github.io/billboard.js/demo/#Chart.TimeseriesChart)\n * @see [Demo: category](https://naver.github.io/billboard.js/demo/#Data.CategoryData)\n * @see [Demo: log](https://naver.github.io/billboard.js/demo/#Axis.LogScales)\n * @example\n * axis: {\n * x: {\n * type: \"timeseries\"\n * }\n * }\n */\n axis_x_type: \"indexed\",\n /**\n * Set how to treat the timezone of x values.<br>\n * If true, treat x value as localtime. If false, convert to UTC internally.\n * @name axis․x․localtime\n * @memberof Options\n * @type {boolean}\n * @default true\n * @example\n * axis: {\n * x: {\n * localtime: false\n * }\n * }\n */\n axis_x_localtime: true,\n /**\n * Set category names on category axis.\n * This must be an array that includes category names in string. If category names are included in the date by data.x option, this is not required.\n * @name axis․x․categories\n * @memberof Options\n * @type {Array}\n * @default []\n * @example\n * axis: {\n * x: {\n * categories: [\"Category 1\", \"Category 2\", ...]\n * }\n * }\n */\n axis_x_categories: [],\n /**\n * centerize ticks on category axis.\n * @name axis․x․tick․centered\n * @memberof Options\n * @type {boolean}\n * @default false\n * @example\n * axis: {\n * x: {\n * tick: {\n * centered: true\n * }\n * }\n * }\n */\n axis_x_tick_centered: false,\n /**\n * A function to format tick value. Format string is also available for timeseries data.\n * @name axis․x․tick․format\n * @memberof Options\n * @type {function|string}\n * @default undefined\n * @see [D3's time specifier](https://d3js.org/d3-time-format#locale_format)\n * @example\n * axis: {\n * x: {\n * tick: {\n * // for timeseries, a 'datetime' object is given as parameter\n * format: function(x) {\n * return x.getFullYear();\n * }\n *\n * // for category, index(Number) and categoryName(String) are given as parameter\n * format: function(index, categoryName) {\n * return categoryName.substr(0, 10);\n * },\n *\n * // for timeseries format specifier\n * format: \"%Y-%m-%d %H:%M:%S\"\n * }\n * }\n * }\n */\n axis_x_tick_format: undefined,\n /**\n * Setting for culling ticks.\n * - `true`: the ticks will be culled, then only limited tick text will be shown.<br>\n * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.x.tick.culling.lines=false`.\n * - `false`: all of ticks will be shown.<br><br>\n * The number of ticks to be shown can be changed by `axis.x.tick.culling.max`.\n * @name axis․x․tick․culling\n * @memberof Options\n * @type {boolean}\n * @default\n * `true` for indexed axis and timeseries axis, `false` for category axis\n * @example\n * axis: {\n * x: {\n * tick: {\n * culling: false,\n * }\n * }\n * }\n */\n axis_x_tick_culling: {},\n /**\n * The number of tick texts will be adjusted to less than this value.\n * @name axis․x․tick․culling․max\n * @memberof Options\n * @type {number}\n * @default 10\n * @example\n * axis: {\n * x: {\n * tick: {\n * culling: {\n * max: 5\n * }\n * }\n * }\n * }\n */\n axis_x_tick_culling_max: 10,\n /**\n * Control visibility of tick lines within culling option, along with tick text.\n * @name axis․x․tick․culling․lines\n * @memberof Options\n * @type {boolean}\n * @default true\n * @example\n * axis: {\n * x: {\n * tick: {\n * culling: {\n * lines: false,\n * }\n * }\n * }\n * }\n */\n axis_x_tick_culling_lines: true,\n /**\n * Control culling start point to be reversed. If set to true, the culling will be started from the end to start.\n * - **NOTE:** This option is only available when `axis.x.tick.culling` is set to truthy value.\n * @name axis․x․tick․culling․reverse\n * @memberof Options\n * @type {boolean}\n * @default false\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickCulling)\n * @example\n * axis: {\n * x: {\n * tick: {\n * culling: {\n * reverse: true,\n * }\n * }\n * }\n * }\n */\n axis_x_tick_culling_reverse: false,\n /**\n * The number of x axis ticks to show.<br><br>\n * This option hides tick lines together with tick text. If this option is used on timeseries axis, the ticks position will be determined precisely and not nicely positioned (e.g. it will have rough second value).\n * @name axis․x․tick․count\n * @memberof Options\n * @type {number}\n * @default undefined\n * @example\n * axis: {\n * x: {\n * tick: {\n * count: 5\n * }\n * }\n * }\n */\n axis_x_tick_count: undefined,\n /**\n * Set the axis tick line to be positioned inside of the chart.\n * @name axis․x․tick․inner\n * @memberof Options\n * @type {boolean}\n * @default false\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.TickInner)\n * @example\n * axis: {\n * x: {\n * tick: {\n * inner: true\n * }\n * }\n * }\n */\n axis_x_tick_inner: false,\n /**\n * Show or hide x axis tick line.\n * @name axis․x․tick․show\n * @memberof Options\n * @type {boolean}\n * @default true\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)\n * @example\n * axis: {\n * x: {\n * tick: {\n * show: false\n * }\n * }\n * }\n */\n axis_x_tick_show: true,\n /**\n * Show or hide x axis tick text.\n * @name axis․x․tick․text․show\n * @memberof Options\n * @type {boolean}\n * @default true\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)\n * @example\n * axis: {\n * x: {\n * tick: {\n * text: {\n * show: false\n * }\n * }\n * }\n * }\n */\n axis_x_tick_text_show: true,\n /**\n * Set the first/last axis tick text to be positioned inside of the chart on non-rotated axis.\n * @name axis․x․tick․text․inner\n * @memberof Options\n * @type {boolean|object}\n * @default false\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickInner)\n * @example\n * axis: {\n * x: {\n * tick: {\n * text: {\n * inner: true,\n *\n * // or specify each position of the first and last tick text\n * inner: {\n * \t first: true,\n * \t last: true\n * \t}\n * }\n * }\n * }\n * }\n */\n axis_x_tick_text_inner: false,\n /**\n * Set the x Axis tick text's position relatively its original position\n * @name axis․x․tick․text․position\n * @memberof Options\n * @type {object}\n * @default {x: 0, y:0}\n * @example\n * axis: {\n * x: {\n * tick: {\n * text: {\n * position: {\n * x: 10,\n * y: 10\n * }\n * }\n * }\n * }\n * }\n */\n axis_x_tick_text_position: { x: 0, y: 0 },\n /**\n * Fit x axis ticks.\n * - **true**: ticks will be shown according to x value of the data points.\n * - **false**: ticks will be shown as to have same intervals.\n * @name axis․x․tick․fit\n * @memberof Options\n * @type {boolean}\n * @default true\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickFitting)\n * @see [Demo: for timeseries zoom](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickTimeseries)\n * @example\n * axis: {\n * x: {\n * tick: {\n * fit: false\n * }\n * }\n * }\n */\n axis_x_tick_fit: true,\n /**\n * Set the x values of ticks manually.<br><br>\n * If this option is provided, the position of the ticks will be determined based on those values.<br>\n * This option works with `timeseries` data and the x values will be parsed according to the type of the value and data.xFormat option.\n * @name axis․x․tick․values\n * @memberof Options\n * @type {Array|function}\n * @default null\n * @example\n * axis: {\n * x: {\n * tick: {\n * values: [1, 2, 4, 8, 16, 32, ...],\n *\n * // an Array value should be returned\n * values: function() {\n * \treturn [ ... ];\n * }\n * }\n * }\n * }\n */\n axis_x_tick_values: null,\n /**\n * Rotate x axis tick text if there is not enough space for 'category' and 'timeseries' type axis.\n * - **NOTE:** The conditions where `autorotate` is enabled are:\n * - axis.x.type='category' or 'timeseries\n * - axis.x.tick.multiline=false\n * - axis.x.tick.culling=false\n * - axis.x.tick.fit=true\n * - **NOTE:** axis.x.tick.clippath=false is necessary for calculating the overflow padding between the end of x axis and the width of the SVG\n * @name axis․x․tick․autorotate\n * @memberof Options\n * @type {boolean}\n * @default false\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickAutorotate)\n * @example\n * axis: {\n * x: {\n * tick: {\n * rotate: 15,\n * autorotate: true,\n * multiline: false,\n * culling: false,\n * fit: true\n * },\n * clipPath: false\n * }\n * }\n */\n axis_x_tick_autorotate: false,\n /**\n * Rotate x axis tick text.\n * - If you set negative value, it will rotate to opposite direction.\n * - Applied when [`axis.rotated`](#.axis%25E2%2580%25A4rotated) option is `false`.\n * - As long as `axis_x_tick_fit` is set to `true` it will calculate an overflow for the y2 axis and add this value to the right padding.\n * @name axis․x․tick․rotate\n * @memberof Options\n * @type {number}\n * @default 0\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.RotateXAxisTickText)\n * @example\n * axis: {\n * x: {\n * tick: {\n * rotate: 60\n * }\n * }\n * }\n */\n axis_x_tick_rotate: 0,\n /**\n * Show x axis outer tick.\n * @name axis․x․tick․outer\n * @memberof Options\n * @type {boolean}\n * @default true\n * @example\n * axis: {\n * x: {\n * tick: {\n * outer: false\n * }\n * }\n * }\n */\n axis_x_tick_outer: true,\n /**\n * Set tick text to be multiline\n * - **NOTE:**\n * > When x tick text contains `\\n`, it's used as line break and 'axis.x.tick.width' option is ignored.\n * @name axis․x․tick․multiline\n * @memberof Options\n * @type {boolean}\n * @default true\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.XAxisTickMultiline)\n * @example\n * axis: {\n * x: {\n * tick: {\n * multiline: false\n * }\n * }\n * }\n * @example\n * // example of line break with '\\n'\n * // In this case, 'axis.x.tick.width' is ignored\n * data: {\n * x: \"x\",\n * columns: [\n * [\"x\", \"long\\ntext\", \"Another\\nLong\\nText\"],\n * ...\n * ],\n * }\n */\n axis_x_tick_multiline: true,\n /**\n * Set tick width\n * - **NOTE:**\n * > When x tick text contains `\\n`, this option is ignored.\n * @name axis․x․tick․width\n * @memberof Options\n * @type {number}\n * @default null\n * @example\n * axis: {\n * x: {\n * tick: {\n * width: 50\n * }\n * }\n * }\n */\n axis_x_tick_width: null,\n /**\n * Set to display system tooltip(via `<title>` element) for tick text\n * - **NOTE:** Only available for category axis type (`axis.x.type='category'`)\n * @name axis․x․tick․tooltip\n * @memberof Options\n * @type {boolean}\n * @default false\n * @example\n * axis: {\n * x: {\n * tick: {\n * tooltip: true\n * }\n * }\n * }\n */\n axis_x_tick_tooltip: false,\n /**\n * Set max value of x axis range.\n * @name axis․x․max\n * @memberof Options\n * @property {number} max Set the max value\n * @property {boolean} [max.fit=false] When specified `max.value` is greater than the bound data value, setting `true` will make x axis max to be fitted to the bound data max value.\n * - **NOTE:** If the bound data max value is greater than the `max.value`, the x axis max will be limited as the given `max.value`.\n * @property {number} [max.value] Set the max value\n * @example\n * axis: {\n * x: {\n * max: 100,\n *\n * max: {\n * // 'fit=true' will make x axis max to be limited as the bound data value max when 'max.value' is greater.\n * // - when bound data max is '10' and max.value: '100' ==> x axis max will be '10'\n * // - when bound data max is '1000' and max.value: '100' ==> x axis max will be '100'\n * fit: true,\n * value: 100\n * }\n * }\n * }\n */\n axis_x_max: undefined,\n /**\n * Set min value of x axis range.\n * @name axis․x․min\n * @memberof Options\n * @property {number} min Set the min value\n * @property {boolean} [min.fit=false] When specified `min.value` is lower than the bound data value, setting `true` will make x axis min to be fitted to the bound data min value.\n * - **NOTE:** If the bound data min value is lower than the `min.value`, the x axis min will be limited as the given `min.value`.\n * @property {number} [min.value] Set the min value\n * @example\n * axis: {\n * x: {\n * min: -100,\n *\n * min: {\n * // 'fit=true' will make x axis min to be limited as the bound data value min when 'min.value' is lower.\n * // - when bound data min is '-10' and min.value: '-100' ==> x axis min will be '-10'\n * // - when bound data min is '-1000' and min.value: '-100' ==> x axis min will be '-100'\n * fit: true,\n * value: -100\n * }\n * }\n * }\n */\n axis_x_min: undefined,\n /**\n * Change the direction of x axis.<br><br>\n * If true set, the direction will be `right -> left`.\n * @name axis․x․inverted\n * @memberof Options\n * @type {boolean}\n * @default false\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.InvertedAxis)\n * @example\n * axis: {\n * x: {\n * inverted: true\n * }\n * }\n */\n axis_x_inverted: false,\n /**\n * Set padding for x axis.<br><br>\n * If this option is set, the range of x axis will increase/decrease according to the values.\n * If no padding is needed in the rage of x axis, 0 should be set.\n * By default, left/right padding are set depending on x axis type or chart types.\n * - **NOTE:**\n * - The meaning of padding values, differs according axis types:<br>\n * - **category/indexed:** The unit of tick value\n * ex. the given value `1`, is same as the width of 1 tick width\n * - **timeseries:** Numeric time value\n * ex. the given value `1000*60*60*24`, which is numeric time equivalent of a day, is same as the width of 1 tick width\n * - If want values to be treated as pixels, specify `unit:\"px\"`.\n * - The pixel value will be converted based on the scale values. Hence can not reflect accurate padding result.\n * @name axis․x․padding\n * @memberof Options\n * @type {object|number}\n * @default {}\n * @example\n * axis: {\n * x: {\n * padding: {\n * // when axis type is 'category'\n * left: 1, // set left padding width of equivalent value of a tick's width\n * right: 0.5 // set right padding width as half of equivalent value of tick's width\n *\n * // when axis type is 'timeseries'\n * left: 1000*60*60*24, // set left padding width of equivalent value of a day tick's width\n * right: 1000*60*60*12 // set right padding width as half of equivalent value of a day tick's width\n * },\n *\n * // or set both values at once.\n * padding: 10,\n *\n * // or set padding values as pixel unit.\n * padding: {\n * left: 100,\n * right: 50,\n * unit: \"px\"\n * },\n * }\n * }\n */\n axis_x_padding: {},\n /**\n * Set height of x axis.<br><br>\n * The height of x axis can be set manually by this option. If you need more space for x axis, please use this option for that. The unit is pixel.\n * @name axis․x․height\n * @memberof Options\n * @type {number}\n * @default undefined\n * @example\n * axis: {\n * x: {\n * height: 20\n * }\n * }\n */\n axis_x_height: undefined,\n /**\n * Set extent for subchart and zoom(drag only). This can be an array or function that returns an array.\n * - **NOTE:** Specifying value, will limit the zoom scope selection within.\n * @name axis․x․extent\n * @memberof Options\n * @type {Array|function}\n * @default undefined\n * @example\n * axis: {\n * x: {\n * // extent range as a pixel value\n * extent: [0, 200],\n *\n * // when axis is 'timeseries', parsable datetime string\n * extent: [\"2019-03-01\", \"2019-03-05\"],\n *\n * // return extent value\n * extent: function(domain, scale) {\n * \t var extent = domain.map(function(v) {\n * \t return scale(v);\n * \t });\n *\n * \t // it should return a format of array\n * \t // ex) [0, 584]\n * \t return extent;\n * }\n * }\n * }\n */\n axis_x_extent: undefined,\n /**\n * Set label on x axis.<br><br>\n * You can set x axis label and change its position by this option.\n * `string` and `object` can be passed and we can change the poisiton by passing object that has position key.<br>\n * Available position differs according to the axis direction (vertical or horizontal).\n * If string set, the position will be the default.\n *\n * - **If it's horizontal axis:**\n * - inner-right [default]\n * - inner-center\n * - inner-left\n * - outer-right\n * - outer-center\n * - outer-left\n * - **If it's vertical axis:**\n * - inner-top [default]\n * - inner-middle\n * - inner-bottom\n * - outer-top\n * - outer-middle\n * - outer-bottom\n * @name axis․x․label\n * @memberof Options\n * @type {string|object}\n * @default undefined\n * @example\n * axis: {\n * x: {\n * label: \"Your X Axis\"\n * }\n * }\n *\n * axis: {\n * x: {\n * label: {\n * text: \"Your X Axis\",\n * position: \"outer-center\"\n * }\n * }\n * }\n */\n axis_x_label: {},\n /**\n * Set additional axes for x Axis.\n * - **NOTE:** Axis' scale is based on x Axis value if domain option isn't set.\n *\n * Each axis object should consist with following options:\n *\n * | Name | Type | Default | Description |\n * | --- | --- | --- | --- |\n * | domain | Array | - | Set the domain value |\n * | tick.outer | boolean | true | Show outer tick |\n * | tick.format | Function | - | Set formatter for tick text |\n * | tick.count | Number | - | Set the number of y axis ticks |\n * | tick.values | Array | - | Set tick values manually |\n * @name axis․x․axes\n * @memberof Options\n * @type {Array}\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.MultiAxes)\n * @see [Demo: Domain](https://naver.github.io/billboard.js/demo/#Axis.MultiAxesDomain)\n * @example\n * x: {\n * axes: [\n * {\n * // if set, will not be correlated with the main x Axis domain value\n * domain: [0, 1000],\n * tick: {\n * outer: false,\n * format: function(x) {\n * return x + \"%\";\n * },\n * count: 2,\n * values: [10, 20, 30]\n * }\n * },\n * ...\n * ]\n * }\n */\n axis_x_axes: []\n};\n\nexport { x as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * y Axis config options\n */\nvar y = {\n /**\n * Set clip-path attribute for y axis element\n * - **NOTE**: `clip-path` attribute for y Axis is set only when `axis.y.inner` option is true.\n * @name axis․y․clipPath\n * @memberof Options\n * @type {boolean}\n * @default true\n * @example\n * // don't set 'clip-path' attribute\n * clipPath: false\n */\n axis_y_clipPath: true,\n /**\n * Show or hide y axis.\n * @name axis․y․show\n * @memberof Options\n * @type {boolean}\n * @default true\n * @example\n * axis: {\n * y: {\n * show: false\n * }\n * }\n */\n axis_y_show: true,\n /**\n * Set type of y axis.<br><br>\n * **Available Values:**\n * - indexed\n * - log\n * - timeseries\n *\n * **NOTE:**<br>\n * - **log** type:\n * - the bound data values must be exclusively-positive.\n * - y axis min value should be >= 0.\n * - [`data.groups`](#.data%25E2%2580%25A4groups)(stacked data) option aren't supported.\n *\n * @name axis․y․type\n * @memberof Options\n * @type {string}\n * @default \"indexed\"\n * @see [Demo: log](https://naver.github.io/billboard.js/demo/#Axis.LogScales)\n * @example\n * axis: {\n * y: {\n * type: \"log\"\n * }\n * }\n */\n axis_y_type: \"indexed\",\n /**\n * Set max value of y axis.\n * - **NOTE:** Padding will be added based on this value, so if you don't need the padding, please set axis.y.padding to disable it (e.g. axis.y.padding = 0).\n * @name axis․y․max\n * @memberof Options\n * @type {number}\n * @default undefined\n * @example\n * axis: {\n * y: {\n * max: 1000\n * }\n * }\n */\n axis_y_max: undefined,\n /**\n * Set min value of y axis.\n * - **NOTE:**\n * Padding will be added based on this value, so if you don't need the padding, please set axis.y.padding to disable it (e.g. axis.y.padding = 0).\n * @name axis․y․min\n * @memberof Options\n * @type {number}\n * @default undefined\n * @example\n * axis: {\n * y: {\n * min: 1000\n * }\n * }\n */\n axis_y_min: undefined,\n /**\n * Change the direction of y axis.<br><br>\n * If true set, the direction will be `top -> bottom`.\n * @name axis․y․inverted\n * @memberof Options\n * @type {boolean}\n * @default false\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.InvertedAxis)\n * @example\n * axis: {\n * y: {\n * inverted: true\n * }\n * }\n */\n axis_y_inverted: false,\n /**\n * Set center value of y axis.\n * @name axis․y․center\n * @memberof Options\n * @type {number}\n * @default undefined\n * @example\n * axis: {\n * y: {\n * center: 0\n * }\n * }\n */\n axis_y_center: undefined,\n /**\n * Show y axis inside of the chart.\n * @name axis․y․inner\n * @memberof Options\n * @type {boolean}\n * @default false\n * @example\n * axis: {\n * y: {\n * inner: true\n * }\n * }\n */\n axis_y_inner: false,\n /**\n * Set label on y axis.<br><br>\n * You can set y axis label and change its position by this option. This option works in the same way as [axis.x.label](#.axis%25E2%2580%25A4x%25E2%2580%25A4label).\n * @name axis․y․label\n * @memberof Options\n * @type {string|object}\n * @default {}\n * @see [axis.x.label](#.axis%25E2%2580%25A4x%25E2%2580%25A4label) for position string value.\n * @example\n * axis: {\n * y: {\n * label: \"Your Y Axis\"\n * }\n * }\n *\n * axis: {\n * y: {\n * label: {\n * text: \"Your Y Axis\",\n * position: \"outer-middle\"\n * }\n * }\n * }\n */\n axis_y_label: {},\n /**\n * Set formatter for y axis tick text.<br><br>\n * This option accepts d3.format object as well as a function you define.\n * @name axis․y․tick․format\n * @memberof Options\n * @type {function}\n * @default undefined\n * @example\n * axis: {\n * y: {\n * tick: {\n * format: function(x) {\n * return x.getFullYear();\n * }\n * }\n * }\n * }\n */\n axis_y_tick_format: undefined,\n /**\n * Setting for culling ticks.\n * - `true`: the ticks will be culled, then only limited tick text will be shown.<br>\n * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.y.tick.culling.lines=false`.\n * - `false`: all of ticks will be shown.<br><br>\n * The number of ticks to be shown can be changed by `axis.y.tick.culling.max`.\n * @name axis․y․tick․culling\n * @memberof Options\n * @type {boolean}\n * @default false\n * @example\n * axis: {\n * y: {\n * tick: {\n * culling: false\n * }\n * }\n * }\n */\n axis_y_tick_culling: false,\n /**\n * The number of tick texts will be adjusted to less than this value.\n * @name axis․y․tick․culling․max\n * @memberof Options\n * @type {number}\n * @default 5\n * @example\n * axis: {\n * y: {\n * tick: {\n * culling: {\n * max: 5\n * }\n * }\n * }\n * }\n */\n axis_y_tick_culling_max: 5,\n /**\n * Control visibility of tick lines within culling option, along with tick text.\n * @name axis․y․tick․culling․lines\n * @memberof Options\n * @type {boolean}\n * @default true\n * @example\n * axis: {\n * y: {\n * tick: {\n * culling: {\n * lines: false,\n * }\n * }\n * }\n * }\n */\n axis_y_tick_culling_lines: true,\n /**\n * Control culling start point to be reversed. If set to true, the culling will be started from the end to start.\n * - **NOTE:** This option is only available when `axis.y.tick.culling` is set to truthy value.\n * @name axis․y․tick․culling․reverse\n * @memberof Options\n * @type {boolean}\n * @default false\n * @example\n * axis: {\n * y: {\n * tick: {\n * culling: {\n * reverse: true,\n * }\n * }\n * }\n * }\n */\n axis_y_tick_culling_reverse: false,\n /**\n * Set the axis tick line to be positioned inside of the chart.\n * @name axis․y․tick․inner\n * @memberof Options\n * @type {boolean}\n * @default false\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.TickInner)\n * axis: {\n * y: {\n * tick: {\n * inner: true\n * }\n * }\n * }\n */\n axis_y_tick_inner: false,\n /**\n * Show y axis outer tick.\n * @name axis․y․tick․outer\n * @memberof Options\n * @type {boolean}\n * @default true\n * @example\n * axis: {\n * y: {\n * tick: {\n * outer: false\n * }\n * }\n * }\n */\n axis_y_tick_outer: true,\n /**\n * Set y axis tick values manually.\n * @name axis․y․tick․values\n * @memberof Options\n * @type {Array|function}\n * @default null\n * @example\n * axis: {\n * y: {\n * tick: {\n * values: [100, 1000, 10000],\n *\n * // an Array value should be returned\n * values: function() {\n * \treturn [ ... ];\n * }\n * }\n * }\n * }\n */\n axis_y_tick_values: null,\n /**\n * Rotate y axis tick text.\n * - If you set negative value, it will rotate to opposite direction.\n * - Applied when [`axis.rotated`](#.axis%25E2%2580%25A4rotated) option is `true`.\n * @name axis․y․tick․rotate\n * @memberof Options\n * @type {number}\n * @default 0\n * @example\n * axis: {\n * y: {\n * tick: {\n * rotate: 60\n * }\n * }\n * }\n */\n axis_y_tick_rotate: 0,\n /**\n * Set the number of y axis ticks.<br><br>\n * - **NOTE:** The position of the ticks will be calculated precisely, so the values on the ticks will not be rounded nicely. In the case, axis.y.tick.format or axis.y.tick.values will be helpful.\n * @name axis․y․tick․count\n * @memberof Options\n * @type {number}\n * @default undefined\n * @example\n * axis: {\n * y: {\n * tick: {\n * count: 5\n * }\n * }\n * }\n */\n axis_y_tick_count: undefined,\n /**\n * Show or hide y axis tick line.\n * @name axis․y․tick․show\n * @memberof Options\n * @type {boolean}\n * @default true\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)\n * @example\n * axis: {\n * y: {\n * tick: {\n * show: false\n * }\n * }\n * }\n */\n axis_y_tick_show: true,\n /**\n * Set axis tick step(interval) size.\n * - **NOTE:** Will be ignored if `axis.y.tick.count` or `axis.y.tick.values` options are set.\n * @name axis․y․tick․stepSize\n * @memberof Options\n * @type {number}\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.StepSizeForYAxis)\n * @example\n * axis: {\n * y: {\n * tick: {\n * // tick value will step as indicated interval value.\n * // ex) 'stepSize=15' ==> [0, 15, 30, 45, 60]\n * stepSize: 15\n * }\n * }\n * }\n */\n axis_y_tick_stepSize: null,\n /**\n * Show or hide y axis tick text.\n * @name axis․y․tick․text․show\n * @memberof Options\n * @type {boolean}\n * @default true\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)\n * @example\n * axis: {\n * y: {\n * tick: {\n * text: {\n * show: false\n * }\n * }\n * }\n * }\n */\n axis_y_tick_text_show: true,\n /**\n * Set the y Axis tick text's position relatively its original position\n * @name axis․y․tick․text․position\n * @memberof Options\n * @type {object}\n * @default {x: 0, y:0}\n * @example\n * axis: {\n * y: {\n * tick: {\n * text: {\n * position: {\n * x: 10,\n * y: 10\n * }\n * }\n * }\n * }\n * }\n */\n axis_y_tick_text_position: { x: 0, y: 0 },\n /**\n * Set the number of y axis ticks.<br><br>\n * - **NOTE:** The position of the ticks will be calculated precisely, so the values on the ticks will not be rounded nicely. In the case, axis.y.tick.format or axis.y.tick.values will be helpful.\n * @name axis․y․tick․time\n * @memberof Options\n * @private\n * @type {object}\n * @property {object} time time object\n * @property {function} [time.value] D3's time interval function (https://github.com/d3/d3-time#intervals)\n * @example\n * axis: {\n * y: {\n * tick: {\n * time: {\n * // ticks at 15-minute intervals\n * // https://github.com/d3/d3-scale/blob/master/README.md#time_ticks\n * value: d3.timeMinute.every(15)\n * }\n * }\n * }\n * }\n */\n // @TODO: not fully implemented yet\n axis_y_tick_time_value: undefined,\n /**\n * Set padding for y axis.<br><br>\n * You can set padding for y axis to create more space on the edge of the axis.\n * This option accepts object and it can include top and bottom. top, bottom will be treated as pixels.\n *\n * - **NOTE:**\n * - Given values are translated relative to the y Axis domain value for padding\n * - For area and bar type charts, [area.zerobased](#.area) or [bar.zerobased](#.bar) options should be set to 'false` to get padded bottom.\n * @name axis․y․padding\n * @memberof Options\n * @type {object|number}\n * @default {}\n * @example\n * axis: {\n * y: {\n * padding: {\n * top: 0,\n * bottom: 0\n * },\n *\n * // or set both values at once.\n * padding: 10\n * }\n * }\n */\n axis_y_padding: {},\n /**\n * Set default range of y axis.<br><br>\n * This option set the default value for y axis when there is no data on init.\n * @name axis․y․default\n * @memberof Options\n * @type {Array}\n * @default undefined\n * @example\n * axis: {\n * y: {\n * default: [0, 1000]\n * }\n * }\n */\n axis_y_default: undefined,\n /**\n * Set additional axes for y Axis.\n * - **NOTE:** Axis' scale is based on y Axis value if domain option isn't set.\n *\n * Each axis object should consist with following options:\n *\n * | Name | Type | Default | Description |\n * | --- | --- | --- | --- |\n * | domain | Array | - | Set the domain value |\n * | tick.outer | boolean | true | Show outer tick |\n * | tick.format | Function | - | Set formatter for tick text |\n * | tick.count | Number | - | Set the number of y axis ticks |\n * | tick.values | Array | - | Set tick values manually |\n * @name axis․y․axes\n * @memberof Options\n * @type {Array}\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.MultiAxes)\n * @see [Demo: Domain](https://naver.github.io/billboard.js/demo/#Axis.MultiAxesDomain)\n * @example\n * y: {\n * axes: [\n * {\n * // if set, will not be correlated with the main y Axis domain value\n * domain: [0, 1000],\n * tick: {\n * outer: false,\n * format: function(x) {\n * return x + \"%\";\n * },\n * count: 2,\n * values: [10, 20, 30]\n * }\n * },\n * ...\n * ]\n * }\n */\n axis_y_axes: []\n};\n\nexport { y as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * y2 Axis config options\n */\nvar y2 = {\n /**\n * Show or hide y2 axis.\n * - **NOTE**:\n * - When set to `false` will not generate y2 axis node. In this case, all 'y2' axis related functionality won't work properly.\n * - If need to use 'y2' related options while y2 isn't visible, set the value `true` and control visibility by css display property.\n * @name axis․y2․show\n * @memberof Options\n * @type {boolean}\n * @default false\n * @example\n * axis: {\n * y2: {\n * show: true\n * }\n * }\n */\n axis_y2_show: false,\n /**\n * Set type of y2 axis.<br><br>\n * **Available Values:**\n * - indexed\n * - log\n * - timeseries\n *\n * **NOTE:**<br>\n * - **log** type:\n * - the bound data values must be exclusively-positive.\n * - y2 axis min value should be >= 0.\n * - [`data.groups`](#.data%25E2%2580%25A4groups)(stacked data) option aren't supported.\n *\n * @name axis․y2․type\n * @memberof Options\n * @type {string}\n * @default \"indexed\"\n * @see [Demo: log](https://naver.github.io/billboard.js/demo/#Axis.LogScales)\n * @example\n * axis: {\n * y2: {\n * type: \"indexed\"\n * }\n * }\n */\n axis_y2_type: \"indexed\",\n /**\n * Set max value of y2 axis.\n * @name axis․y2․max\n * @memberof Options\n * @type {number}\n * @default undefined\n * @example\n * axis: {\n * y2: {\n * max: 1000\n * }\n * }\n */\n axis_y2_max: undefined,\n /**\n * Set min value of y2 axis.\n * @name axis․y2․min\n * @memberof Options\n * @type {number}\n * @default undefined\n * @example\n * axis: {\n * y2: {\n * min: -1000\n * }\n * }\n */\n axis_y2_min: undefined,\n /**\n * Change the direction of y2 axis.<br><br>\n * If true set, the direction will be `top -> bottom`.\n * @name axis․y2․inverted\n * @memberof Options\n * @type {boolean}\n * @default false\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.InvertedAxis)\n * @example\n * axis: {\n * y2: {\n * inverted: true\n * }\n * }\n */\n axis_y2_inverted: false,\n /**\n * Set center value of y2 axis.\n * @name axis․y2․center\n * @memberof Options\n * @type {number}\n * @default undefined\n * @example\n * axis: {\n * y2: {\n * center: 0\n * }\n * }\n */\n axis_y2_center: undefined,\n /**\n * Show y2 axis inside of the chart.\n * @name axis․y2․inner\n * @memberof Options\n * @type {boolean}\n * @default false\n * @example\n * axis: {\n * y2: {\n * inner: true\n * }\n * }\n */\n axis_y2_inner: false,\n /**\n * Set label on y2 axis.<br><br>\n * You can set y2 axis label and change its position by this option. This option works in the same way as [axis.x.label](#.axis%25E2%2580%25A4x%25E2%2580%25A4label).\n * @name axis․y2․label\n * @memberof Options\n * @type {string|object}\n * @default {}\n * @see [axis.x.label](#.axis%25E2%2580%25A4x%25E2%2580%25A4label) for position string value.\n * @example\n * axis: {\n * y2: {\n * label: \"Your Y2 Axis\"\n * }\n * }\n *\n * axis: {\n * y2: {\n * label: {\n * text: \"Your Y2 Axis\",\n * position: \"outer-middle\"\n * }\n * }\n * }\n */\n axis_y2_label: {},\n /**\n * Set formatter for y2 axis tick text.<br><br>\n * This option works in the same way as axis.y.format.\n * @name axis․y2․tick․format\n * @memberof Options\n * @type {function}\n * @default undefined\n * @example\n * axis: {\n * y2: {\n * tick: {\n * format: d3.format(\"$,\")\n * //or format: function(d) { return \"$\" + d; }\n * }\n * }\n * }\n */\n axis_y2_tick_format: undefined,\n /**\n * Setting for culling ticks.\n * - `true`: the ticks will be culled, then only limited tick text will be shown.<br>\n * This option does not hide the tick lines by default, if want to hide tick lines, set `axis.y2.tick.culling.lines=false`.\n * - `false`: all of ticks will be shown.<br><br>\n * The number of ticks to be shown can be changed by `axis.y2.tick.culling.max`.\n * @name axis․y2․tick․culling\n * @memberof Options\n * @type {boolean}\n * @default false\n * @example\n * axis: {\n * y2: {\n * tick: {\n * culling: false\n * }\n * }\n * }\n */\n axis_y2_tick_culling: false,\n /**\n * The number of tick texts will be adjusted to less than this value.\n * @name axis․y2․tick․culling․max\n * @memberof Options\n * @type {number}\n * @default 5\n * @example\n * axis: {\n * y2: {\n * tick: {\n * culling: {\n * max: 5\n * }\n * }\n * }\n * }\n */\n axis_y2_tick_culling_max: 5,\n /**\n * Control visibility of tick lines within culling option, along with tick text.\n * @name axis․y2․tick․culling․lines\n * @memberof Options\n * @type {boolean}\n * @default true\n * @example\n * axis: {\n * y2: {\n * tick: {\n * culling: {\n * lines: false,\n * }\n * }\n * }\n * }\n */\n axis_y2_tick_culling_lines: true,\n /**\n * Control culling start point to be reversed. If set to true, the culling will be started from the end to start.\n * - **NOTE:** This option is only available when `axis.y2.tick.culling` is set to truthy value.\n * @name axis․y2․tick․culling․reverse\n * @memberof Options\n * @type {boolean}\n * @default false\n * @example\n * axis: {\n * y2: {\n * tick: {\n * culling: {\n * reverse: true,\n * }\n * }\n * }\n * }\n */\n axis_y2_tick_culling_reverse: false,\n /**\n * Set the axis tick line to be positioned inside of the chart.\n * @name axis․y2․tick․inner\n * @memberof Options\n * @type {boolean}\n * @default false\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.TickInner)\n * @example\n * axis: {\n * y2: {\n * tick: {\n * inner: true\n * }\n * }\n * }\n */\n axis_y2_tick_inner: false,\n /**\n * Show or hide y2 axis outer tick.\n * @name axis․y2․tick․outer\n * @memberof Options\n * @type {boolean}\n * @default true\n * @example\n * axis: {\n * y2: {\n * tick: {\n * outer: false\n * }\n * }\n * }\n */\n axis_y2_tick_outer: true,\n /**\n * Set y2 axis tick values manually.\n * @name axis․y2․tick․values\n * @memberof Options\n * @type {Array|function}\n * @default null\n * @example\n * axis: {\n * y2: {\n * tick: {\n * values: [100, 1000, 10000],\n *\n * // an Array value should be returned\n * values: function() {\n * \treturn [ ... ];\n * }\n * }\n * }\n * }\n */\n axis_y2_tick_values: null,\n /**\n * Rotate y2 axis tick text.\n * - If you set negative value, it will rotate to opposite direction.\n * - Applied when [`axis.rotated`](#.axis%25E2%2580%25A4rotated) option is `true`.\n * @name axis․y2․tick․rotate\n * @memberof Options\n * @type {number}\n * @default 0\n * @example\n * axis: {\n * y2: {\n * tick: {\n * rotate: 60\n * }\n * }\n * }\n */\n axis_y2_tick_rotate: 0,\n /**\n * Set the number of y2 axis ticks.\n * - **NOTE:** This works in the same way as axis.y.tick.count.\n * @name axis․y2․tick․count\n * @memberof Options\n * @type {number}\n * @default undefined\n * @example\n * axis: {\n * y2: {\n * tick: {\n * count: 5\n * }\n * }\n * }\n */\n axis_y2_tick_count: undefined,\n /**\n * Show or hide y2 axis tick line.\n * @name axis․y2․tick․show\n * @memberof Options\n * @type {boolean}\n * @default true\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)\n * @example\n * axis: {\n * y2: {\n * tick: {\n * show: false\n * }\n * }\n * }\n */\n axis_y2_tick_show: true,\n /**\n * Set axis tick step(interval) size.\n * - **NOTE:** Will be ignored if `axis.y2.tick.count` or `axis.y2.tick.values` options are set.\n * @name axis․y2․tick․stepSize\n * @memberof Options\n * @type {number}\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.StepSizeForYAxis)\n * @example\n * axis: {\n * y2: {\n * tick: {\n * // tick value will step as indicated interval value.\n * // ex) 'stepSize=15' ==> [0, 15, 30, 45, 60]\n * stepSize: 15\n * }\n * }\n * }\n */\n axis_y2_tick_stepSize: null,\n /**\n * Show or hide y2 axis tick text.\n * @name axis․y2․tick․text․show\n * @memberof Options\n * @type {boolean}\n * @default true\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.HideTickLineText)\n * @example\n * axis: {\n * y2: {\n * tick: {\n * text: {\n * show: false\n * }\n * }\n * }\n * }\n */\n axis_y2_tick_text_show: true,\n /**\n * Set the y2 Axis tick text's position relatively its original position\n * @name axis․y2․tick․text․position\n * @memberof Options\n * @type {object}\n * @default {x: 0, y:0}\n * @example\n * axis: {\n * y2: {\n * tick: {\n * text: {\n * position: {\n * x: 10,\n * y: 10\n * }\n * }\n * }\n * }\n * }\n */\n axis_y2_tick_text_position: { x: 0, y: 0 },\n /**\n * Set padding for y2 axis.<br><br>\n * You can set padding for y2 axis to create more space on the edge of the axis.\n * This option accepts object and it can include top and bottom. top, bottom will be treated as pixels.\n *\n * - **NOTE:**\n * - Given values are translated relative to the y2 Axis domain value for padding\n * - For area and bar type charts, [area.zerobased](#.area) or [bar.zerobased](#.bar) options should be set to 'false` to get padded bottom.\n * @name axis․y2․padding\n * @memberof Options\n * @type {object|number}\n * @default {}\n * @example\n * axis: {\n * y2: {\n * padding: {\n * top: 100,\n * bottom: 100\n * }\n *\n * // or set both values at once.\n * padding: 10\n * }\n */\n axis_y2_padding: {},\n /**\n * Set default range of y2 axis.<br><br>\n * This option set the default value for y2 axis when there is no data on init.\n * @name axis․y2․default\n * @memberof Options\n * @type {Array}\n * @default undefined\n * @example\n * axis: {\n * y2: {\n * default: [0, 1000]\n * }\n * }\n */\n axis_y2_default: undefined,\n /**\n * Set additional axes for y2 Axis.\n * - **NOTE:** Axis' scale is based on y2 Axis value if domain option isn't set.\n *\n * Each axis object should consist with following options:\n *\n * | Name | Type | Default | Description |\n * | --- | --- | --- | --- |\n * | domain | Array | - | Set the domain value |\n * | tick.outer | boolean | true | Show outer tick |\n * | tick.format | Function | - | Set formatter for tick text |\n * | tick.count | Number | - | Set the number of y axis ticks |\n * | tick.values | Array | - | Set tick values manually |\n * @name axis․y2․axes\n * @memberof Options\n * @type {Array}\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.MultiAxes)\n * @see [Demo: Domain](https://naver.github.io/billboard.js/demo/#Axis.MultiAxesDomain)\n * @example\n * y2: {\n * axes: [\n * {\n * // if set, will not be correlated with the main y2 Axis domain value\n * domain: [0, 1000],\n * tick: {\n * outer: false,\n * format: function(x) {\n * return x + \"%\";\n * },\n * count: 2,\n * values: [10, 20, 30]\n * }\n * },\n * ...\n * ]\n * }\n */\n axis_y2_axes: []\n};\n\nexport { y2 as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport x from './x.js';\nimport y from './y.js';\nimport y2 from './y2.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * y Axis config options\n */\nvar optAxis = {\n /**\n * Setup the way to evaluate tick text size.\n * - **NOTE:**\n * - When setting `false` or a custom evaluator, it is highly recommended to memoize evaluated text dimension value to not degrade performance.\n * @name axis․evalTextSize\n * @memberof Options\n * @type {boolean|function}\n * @default true\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.AxisEvalTextSize)\n * @example\n * axis: {\n * // will evaluate getting text size every time.\n * evalTextSize: false,\n *\n * // set a custom evaluator\n * evalTextSize: function(textElement, axisId) {\n * // set some character to be evaluated\n * // NOTE: The dummy textElement is a descendant of given axisId('x', 'y' or 'y2').\n * textElement.textContent = \"0\";\n *\n * // get the size\n * const box = textElement.getBBox();\n *\n * // clear text\n * textElement.textContent = \"\";\n *\n * return { w: 7, h: 12};\n * },\n *\n * // set a custom evaluator by returning fixed value\n * evalTextSize: function(textElement, axisId) {\n * return {\n * x: {w: 7, h: 12},\n * y: {w: 15.75, h: 30},\n * y2: {w: 9.5, h: 18}\n * }[axisId];\n * }\n * }\n */\n axis_evalTextSize: true,\n /**\n * Switch x and y axis position.\n * @name axis․rotated\n * @memberof Options\n * @type {boolean}\n * @default false\n * @example\n * axis: {\n * rotated: true\n * }\n */\n axis_rotated: false,\n /**\n * Set axis tooltip.\n * - **NOTE:**\n * - When enabled, will disable default focus grid line.\n * - For `timeseries` x Axis, tooltip will be formatted using x Axis' tick format.\n * - For `category` x Axis, tooltip will be displaying scales' value text.\n * @name axis․tooltip\n * @memberof Options\n * @type {boolean}\n * @default false\n * @property {object} axis Axis object\n * @property {boolean} [axis.tooltip=false] Show tooltip or not.\n * @property {string|object} [axis.tooltip.backgroundColor] Set axis tooltip text background colors.\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.AxisTooltip)\n * @example\n * axis: {\n * tooltip: true, // default background color is\n *\n * // set background color for axis tooltip texts\n * tooltip: {\n * backgroundColor: \"red\",\n *\n * // set different background colors per axes\n * // NOTE: In this case, only specified axes tooltip will appear.\n * backgroundColor: {\n * x: \"green\",\n * y: \"yellow\",\n * y2: \"red\"\n * }\n * }\n * }\n */\n axis_tooltip: false,\n ...x,\n ...y,\n ...y2\n};\n\nexport { optAxis as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * Axis based chart data config options\n */\nvar optDataAxis = {\n /**\n * Specify the keys of the x values for each data.<br><br>\n * This option can be used if we want to show the data that has different x values.\n * @name data․xs\n * @memberof Options\n * @type {object}\n * @default {}\n * @example\n * data: {\n * xs: {\n * data1: \"x1\",\n * data2: \"x2\"\n * }\n * }\n */\n data_xs: {},\n /**\n * Set a format specifier to parse string specified as x.\n * @name data․xFormat\n * @memberof Options\n * @type {string}\n * @default %Y-%m-%d\n * @example\n * data: {\n * x: \"x\",\n * columns: [\n * [\"x\", \"01012019\", \"02012019\", \"03012019\"],\n * [\"data1\", 30, 200, 100]\n * ],\n * // Format specifier to parse as datetime for given 'x' string value\n * xFormat: \"%m%d%Y\"\n * },\n * axis: {\n * x: {\n * type: \"timeseries\"\n * }\n * }\n * @see [D3's time specifier](https://d3js.org/d3-time-format#locale_format)\n */\n data_xFormat: \"%Y-%m-%d\",\n /**\n * Set localtime format to parse x axis.\n * @name data․xLocaltime\n * @memberof Options\n * @type {boolean}\n * @default true\n * @example\n * data: {\n * xLocaltime: false\n * }\n */\n data_xLocaltime: true,\n /**\n * Sort on x axis.\n * - **NOTE:** This option works for lineish(area/line/spline/step) types only.\n * @name data․xSort\n * @memberof Options\n * @type {boolean}\n * @default true\n * @see [Demo](https://naver.github.io/billboard.js/demo/#Data.DataXSort)\n * @example\n * data: {\n * xSort: false,\n * x: \"x\",\n * columns: [\n * // The line graph will start to be drawn following the x axis sequence\n * // Below data, will start drawing x=1: 200, x=2: 300, x=3: 100\n * [\"x\", 3, 1, 2],\n * [\"data1\", 100, 200, 300]\n * ]\n * }\n */\n data_xSort: true,\n /**\n * Set y axis the data related to. y and y2 can be used.\n * - **NOTE:** If all data is related to one of the axes, the domain of axis without related data will be replaced by the domain from the axis with related data\n * @name data․axes\n * @memberof Options\n * @type {object}\n * @default {}\n * @example\n * data: {\n * axes: {\n * data1: \"y\",\n * data2: \"y2\"\n * }\n * }\n */\n data_axes: {},\n /**\n * Define regions for each data.<br>\n * The values must be an array for each data and it should include an object that has `start`, `end` and `style`.\n * - The object type should be as:\n * - start {number}: Start data point number. If not set, the start will be the first data point.\n * - [end] {number}: End data point number. If not set, the end will be the last data point.\n * - [style.dasharray=\"2 2\"] {string}: The first number specifies a distance for the filled area, and the second a distance for the unfilled area.\n * - **NOTE:**\n * - Supports only line type.\n * - `start` and `end` values should be in the exact x value range.\n * - Dashes will be applied using `stroke-dasharray` css property when data doesn't contain nullish value(or nullish value with `line.connectNull=true` set).\n * - Dashes will be applied via path command when data contains nullish value.\n * @name data․regions\n * @memberof Options\n * @type {object}\n * @default {}\n * @example\n * data: {\n * regions: {\n * data1: [{\n * start: 1,\n * end: 2,\n * style: {\n * dasharray: \"5 2\"\n * }\n * }, {\n * start: 3\n * }],\n * ...\n * }\n * }\n */\n data_regions: {},\n /**\n * Set the stacking to be normalized\n * - **NOTE:**\n * - For stacking, '[data.groups](#.data%25E2%2580%25A4groups)' option should be set\n * - y Axis will be set in percentage value (0 ~ 100%)\n * - Must have positive values\n * - Data not in any group will not be normalized when using perGroup option\n * @name data․stack․normalize\n * @memberof Options\n * @type {boolean|object}\n * @default false\n * @see [Demo: Data Stack Normalized](https://naver.github.io/billboard.js/demo/#Data.DataStackNormalized)\n * @see [Demo: Data Stack Normalized per Group](https://naver.github.io/billboard.js/demo/#Data.DataStackNormalizedGroup)\n * @example\n * data: {\n * stack: {\n * // Normalize all grouped data together (all groups combined to 0-100%)\n * normalize: true\n *\n * // Normalize per group (each group independently becomes 0-100%)\n * // Data not in any group will display with their original values.\n * // If non-grouped data shares the same axis (e.g., y), it will be\n * // displayed on the 0-100 absolute scale. To display original values,\n * // assign them to a separate axis (e.g., y2).\n * normalize: {\n * perGroup: true\n * }\n * },\n * groups: [\n * [\"data1\", \"data2\"] // This group will be normalized to 0-100%\n * ],\n * // data3 is not in any group, so it displays original values\n * // Assign it to y2 axis to use a separate scale\n * axes: {\n * data3: \"y2\"\n * }\n * },\n * axis: {\n * y2: {\n * show: true\n * }\n * }\n */\n data_stack_normalize: false\n};\n\nexport { optDataAxis as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport apiAxis from '../../Chart/api/axis.js';\nimport apiGroup from '../../Chart/api/group.js';\nimport apiX from '../../Chart/api/x.js';\nimport axis from '../../ChartInternal/Axis/Axis.js';\nimport eventrect from '../../ChartInternal/interactions/eventrect.js';\nimport clip from '../../ChartInternal/internals/clip.js';\nimport sizeAxis from '../../ChartInternal/internals/size.axis.js';\nimport optAxis from '../Options/axis/axis.js';\nimport optDataAxis from '../Options/data/axis.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Modules exports for Axis based chart\n */\n// Chart\nconst api = [\n apiAxis,\n apiGroup,\n apiX\n];\nconst internal = {\n axis,\n clip,\n eventrect,\n sizeAxis\n};\nconst options = {\n optDataAxis,\n optAxis\n};\n\nexport { api, internal, options };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport Chart from '../../Chart/Chart.js';\nimport ChartInternal from '../../ChartInternal/ChartInternal.js';\nimport Options from '../Options/Options.js';\nimport { api, internal, options } from './axis.js';\nimport { extend } from '../../module/util/object.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Get object values without requiring Object.values().\n * @param {object} obj Source object\n * @returns {Array} Object values\n * @private\n */\nfunction getValues(obj) {\n return Object.keys(obj).map(key => obj[key]);\n}\n/**\n * Extend shared axis modules without importing renderer-specific shape modules.\n * @param {Array} module Internal modules\n * @param {Array} option Option modules\n * @private\n */\nfunction extendAxisModules(module = [], option = []) {\n extend(ChartInternal.prototype, getValues(internal).concat(module));\n extend(Chart.prototype, api);\n Options.setOptions(getValues(options).concat(option));\n}\n\nexport { extendAxisModules };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport shapePointCommon from '../../../ChartInternal/shape/core/point.js';\nimport shapeLine from '../../../ChartInternal/shape/line.js';\nimport shapePoint from '../../../ChartInternal/shape/point.js';\nimport optPoint from '../../Options/common/point.js';\nimport optLine from '../../Options/shape/line.js';\nimport { extendAxisModules } from '../axis.core.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Extend Axis\n * @param {Array<object>} module Module to be extended\n * @param {Array<object>} option Option object to be extended\n * @private\n */\nfunction extendAxis(module = [], option = []) {\n extendAxisModules(module, option);\n}\n/**\n * Extend Line type modules\n * @param {object|Array<object>} module Module to be extended\n * @param {Array<object>} option Option object to be extended\n * @private\n */\nfunction extendLine(module, option = []) {\n const modules = Array.isArray(module) ? module : (module ? [module] : []);\n extendAxisModules([shapePointCommon, shapePoint, shapeLine].concat(modules), [optPoint, optLine].concat(option));\n}\n\nexport { extendAxis, extendLine };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { isNumber } from '../../../module/util/type-checks.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Get the configured bar corner radius resolver.\n * @param {object} $$ ChartInternal instance\n * @returns {function|null} Radius resolver\n * @private\n */\nfunction getBarRadiusResolver($$) {\n const { bar_radius: radius, bar_radius_ratio: ratio } = $$.config;\n return isNumber(radius) && radius > 0 ? () => radius : (isNumber(ratio) ? width => width * ratio : null);\n}\n/**\n * Get stacked bar rows that should receive rounded bar-end corners.\n * @param {object} $$ ChartInternal instance\n * @returns {Set} Radius row keys\n * @private\n */\nfunction getStackingBarRadiusSet($$) {\n const { config, data } = $$;\n const set = new Set();\n if (!config.data_groups.length) {\n return set;\n }\n const orderedTargets = $$.orderTargets($$.filterTargetsToShow(data.targets.filter($$.isBarType, $$)));\n for (const group of config.data_groups) {\n const ids = new Set(group);\n const lastPosByIndex = new Map();\n const lastNegByIndex = new Map();\n for (const target of orderedTargets) {\n if (!ids.has(target.id)) {\n continue;\n }\n for (const d of target.values) {\n if (d.value === null || d.value === 0) {\n continue;\n }\n (d.value > 0 ? lastPosByIndex : lastNegByIndex).set(d.index, target.id);\n }\n }\n for (const [index, id] of lastPosByIndex) {\n set.add(`${id}:${index}`);\n }\n for (const [index, id] of lastNegByIndex) {\n set.add(`${id}:${index}`);\n }\n }\n return set;\n}\n/**\n * Get canvas/SVG corner flags for the rounded bar edge.\n * @param {boolean} isRotated Whether axis is rotated\n * @param {boolean} isNegative Whether the bar direction is negative\n * @param {number} radius Radius value\n * @returns {number|object} Corner radius map\n * @private\n */\nfunction getBarRadiusCorners(isRotated, isNegative, radius) {\n if (!radius) {\n return 0;\n }\n return isRotated ?\n (isNegative ? { tl: radius, bl: radius } : { tr: radius, br: radius }) :\n (isNegative ? { br: radius, bl: radius } : { tl: radius, tr: radius });\n}\n/**\n * Get SVG clip-path inset for radius arcs that exceed the bar shape.\n * @param {Array} init Initial render coordinate\n * @param {number} pos Rounded edge position\n * @param {boolean} isRotated Whether axis is rotated\n * @param {boolean} isNegative Whether the bar direction is negative\n * @returns {string|null} Clip-path value\n * @private\n */\nfunction getBarRadiusClipPath(init, pos, isRotated, isNegative) {\n let clipPath = \"\";\n if (isRotated) {\n if (isNegative && init[0] < pos) {\n clipPath = `0 ${pos - init[0]}px 0 0`;\n }\n else if (!isNegative && init[0] > pos) {\n clipPath = `0 0 0 ${init[0] - pos}px`;\n }\n }\n else {\n if (isNegative && init[1] > pos) {\n clipPath = `${init[1] - pos}px 0 0 0`;\n }\n else if (!isNegative && init[1] < pos) {\n clipPath = `0 0 ${pos - init[1]}px 0`;\n }\n }\n return clipPath ? `inset(${clipPath})` : null;\n}\n/**\n * Get shared rounded bar geometry that renderers can translate to their own primitives.\n * @param {object} $$ ChartInternal instance\n * @param {object} d Data row\n * @param {Array} points Shared bar points\n * @param {function|null} getRadius Radius resolver\n * @param {Set} stackingRadiusSet Stacked radius row keys\n * @param {function} isStackingRadiusData Optional fallback for hidden SVG bars\n * @returns {object} Rounded bar geometry\n * @private\n */\nfunction getBarRadiusInfo($$, d, points, getRadius, stackingRadiusSet, isStackingRadiusData) {\n const { config, state } = $$;\n const isRotated = config.axis_rotated;\n const indexX = +isRotated;\n const indexY = +!indexX;\n const isUnderZero = d.value < 0;\n const isInverted = config[`axis_${$$.axis.getId(d.id)}_inverted`];\n const isNegative = (!isInverted && isUnderZero) || (isInverted && !isUnderZero);\n const isGrouped = $$.isGrouped(d.id);\n const isRadiusData = getRadius && isGrouped && d.value !== 0 ?\n (state.hiddenTargetIds.has(d.id) && isStackingRadiusData ?\n isStackingRadiusData(d) :\n stackingRadiusSet.has(`${d.id}:${d.index}`)) :\n false;\n const init = [\n points[0][indexX],\n points[0][indexY]\n ];\n let radius = 0;\n if (getRadius) {\n const index = isRotated ? indexY : indexX;\n const barW = Math.abs(points[2][index] - points[0][index]);\n radius = Math.max(0, !isGrouped || isRadiusData ? getRadius(barW) : 0);\n }\n const pos = isRotated ?\n points[1][indexX] + (isNegative ? radius : -radius) :\n points[1][indexY] + (isNegative ? -radius : radius);\n return {\n radius,\n corners: getBarRadiusCorners(isRotated, isNegative, radius),\n clipPath: radius ? getBarRadiusClipPath(init, pos, isRotated, isNegative) : null,\n indexX,\n indexY,\n isNegative,\n pos\n };\n}\n\nexport { getBarRadiusInfo, getBarRadiusResolver, getStackingBarRadiusSet };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport { select } from 'd3-selection';\nimport { $BAR, $COMMON } from '../../config/classes.js';\nimport { getStackingBarRadiusSet, getBarRadiusInfo, getBarRadiusResolver } from './core/barRadius.js';\nimport { getShapeColorWithGradient, updateTargetsForShape } from './shape.js';\nimport { isNumber } from '../../module/util/type-checks.js';\nimport { getRandom } from '../../module/util/object.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\n/**\n * Get the type of connect line for bar chart\n * @param {string} id Data id\n * @returns {string|null} Connect line type or null if not applicable\n * @private\n */\nfunction _getConnectLineType(id) {\n const connectLine = this.config.bar_connectLine;\n const type = connectLine?.[id] || connectLine;\n return (/^(start|end)\\-(start|end)$/.test(type)) ? type : null;\n}\nvar shapeBar = {\n initBar() {\n const { $el, config, state: { clip } } = this;\n $el.bar = $el.main.select(`.${$COMMON.chart}`);\n $el.bar = config.bar_front ? $el.bar.append(\"g\") : $el.bar.insert(\"g\", \":first-child\");\n $el.bar\n .attr(\"class\", $BAR.chartBars)\n .call(this.setCssRule(false, `.${$BAR.chartBars}`, [\"pointer-events:none\"]));\n // set clip-path attribute when condition meet\n // https://github.com/naver/billboard.js/issues/2421\n if (config.clipPath === false && (config.bar_radius || config.bar_radius_ratio)) {\n $el.bar.attr(\"clip-path\", clip.pathXAxis.replace(/#[^)]*/, `#${clip.id}`));\n }\n },\n updateTargetsForBar(targets) {\n const $$ = this;\n const { config } = $$;\n const classBars = $$.getClass(\"bars\", true);\n const isSelectable = config.interaction_enabled && config.data_selection_isselectable;\n const mainBarEnter = updateTargetsForShape.call($$, targets, {\n type: \"Bar\",\n elKey: \"bar\",\n containerClass: $BAR.chartBars,\n itemClass: $BAR.chartBar,\n initFn: $$.initBar\n });\n // Bars for each data\n mainBarEnter.append(\"g\")\n .attr(\"class\", classBars)\n .style(\"cursor\", d => (isSelectable?.bind?.($$.api)(d) ? \"pointer\" : null))\n .call(selection => {\n $$.setCssRule(true, ` .${$BAR.bar}`, [\"fill\"], $$.color)(selection);\n // add bar connect line\n selection.each(function (d) {\n if (_getConnectLineType.call($$, d.id)) {\n select(this).append(\"path\")\n .attr(\"class\", $BAR.barConnectLine);\n }\n });\n });\n },\n /**\n * Generate/Update elements\n * @param {boolean} withTransition Transition for exit elements\n * @param {boolean} isSub Subchart draw\n * @private\n */\n updateBar(withTransition, isSub = false) {\n const $$ = this;\n if ($$.state.isCanvasMode) {\n return;\n }\n const { config, $el, $T } = $$;\n const $root = isSub ? $el.subchart : $el;\n const classBar = $$.getClass(\"bar\", true);\n const initialOpacity = $$.initialOpacity.bind($$);\n config.bar_linearGradient && $$.updateLinearGradient();\n const bar = $root.main.selectAll(`.${$BAR.bars}`)\n .selectAll(`.${$BAR.bar}`)\n .data($$.labelishData.bind($$));\n $T(bar.exit(), withTransition)\n .style(\"opacity\", \"0\")\n .remove();\n $root.bar = bar.enter().append(\"path\")\n .attr(\"class\", classBar)\n .style(\"fill\", $$.generateUpdateBarColor())\n .merge(bar)\n .style(\"opacity\", initialOpacity);\n // calculate ratio if grouped data exists\n $$.setRatioForGroupedData($root.bar.data());\n },\n /**\n * Generate bar color accessor, hoisting the bound color function\n * to be created once per call (not per datum)\n * @returns {function} Color accessor\n * @private\n */\n generateUpdateBarColor() {\n const $$ = this;\n const fn = $$.getStylePropValue($$.color) || (() => null);\n return (d) => getShapeColorWithGradient.call($$, d, \"bar_linearGradient\", fn);\n },\n /**\n * Update bar color\n * @param {object} d Data object\n * @returns {string} Color string\n * @private\n */\n updateBarColor(d) {\n return this.generateUpdateBarColor()(d);\n },\n /**\n * Redraw function\n * @param {function} drawFn Retuned function from .getDrawShape() => .generateDrawBar()\n * @param {boolean} withTransition With or without transition\n * @param {boolean} isSub Subchart draw\n * @returns {Array}\n * @private\n */\n redrawBar(drawFn, withTransition, isSub = false) {\n const $$ = this;\n if ($$.state.isCanvasMode) {\n return [];\n }\n const { bar } = isSub ? $$.$el.subchart : $$.$el;\n const barPath = [];\n const connectLineCache = new Map();\n return [\n $$.$T(bar, withTransition, getRandom())\n .attr(\"d\", function (d, i, arr) {\n const path = (isNumber(d.value) || $$.isBarRangeType(d)) && drawFn(d, i);\n // Memoize per series id: config lookup + regex runs once per id, not per bar\n let connectLineType = connectLineCache.get(d.id);\n if (connectLineType === undefined) {\n connectLineType = _getConnectLineType.call($$, d.id);\n connectLineCache.set(d.id, connectLineType);\n }\n // for bar.connectLine option\n if (path.length > 1) {\n barPath.push(path[1]);\n }\n // flush per series even when the last datum is null,\n // otherwise the accumulated path leaks into the next series\n if (i === arr.length - 1 && barPath.length) {\n const barConnectLineNode = $$.$T(select(this.parentNode.querySelector(`.${$BAR.barConnectLine}`)), withTransition, getRandom());\n $$.updateConnectLine(barConnectLineNode, connectLineType, barPath);\n barPath.splice(0);\n }\n return path[0];\n })\n .style(\"fill\", $$.generateUpdateBarColor())\n .style(\"clip-path\", d => d.clipPath)\n .style(\"opacity\", null)\n ];\n },\n /**\n * Generate draw function\n * @param {object} barIndices data order within x axis.\n * barIndices ==> {data1: 0, data2: 0, data3: 1, data4: 1, __max__: 1}\n *\n * When gropus given as:\n * groups: [\n * \t\t[\"data1\", \"data2\"],\n * \t\t[\"data3\", \"data4\"]\n * \t],\n *\n * Will be rendered as:\n * \t\tdata1 data3 data1 data3\n * \t\tdata2 data4 data2 data4\n * \t\t-------------------------\n * \t\t\t 0 1\n * @param {boolean} isSub If is for subchart\n * @returns {function}\n * @private\n */\n generateDrawBar(barIndices, isSub) {\n const $$ = this;\n const { config } = $$;\n const getPoints = $$.generateGetBarPoints(barIndices, isSub);\n const getRadius = getBarRadiusResolver($$);\n const stackingRadiusSet = getRadius ? getStackingBarRadiusSet($$) : new Set();\n const connectLineCache = new Map();\n return (d, i) => {\n // 4 points that make a bar\n const points = getPoints(d, i);\n const { indexX, indexY, isNegative, pos, radius, clipPath } = getBarRadiusInfo($$, d, points, getRadius, stackingRadiusSet, $$.isStackingRadiusData.bind($$));\n const pathRadius = [\"\", \"\"];\n // initialize as null to not set attribute if isn't needed\n d.clipPath = clipPath;\n if (getRadius) {\n const arc = `a${radius} ${radius} ${isNegative ? \"1 0 0\" : \"0 0 1\"} `;\n pathRadius[indexY] = `${arc}${radius},${radius}`;\n pathRadius[indexX] = `${arc}${[-radius, radius][config.axis_rotated ? \"sort\" : \"reverse\"]()}`;\n isNegative && pathRadius.reverse();\n }\n // path string data shouldn't be containing new line chars\n // https://github.com/naver/billboard.js/issues/530\n const path = config.axis_rotated ?\n `H${pos} ${pathRadius[0]}V${points[2][indexY] - radius} ${pathRadius[1]}H${points[3][indexX]}` :\n `V${pos} ${pathRadius[0]}H${points[2][indexX] - radius} ${pathRadius[1]}V${points[3][indexY]}`;\n const coords = [`M${points[0][indexX]},${points[0][indexY]}${path}z`];\n // Memoize per series id: config lookup + regex runs once per id, not per bar\n let connectLineType = connectLineCache.get(d.id);\n if (connectLineType === undefined) {\n connectLineType = _getConnectLineType.call($$, d.id);\n connectLineCache.set(d.id, connectLineType);\n }\n if (connectLineType) {\n coords.push(config.axis_rotated ?\n {\n x: points[0][indexX],\n y: points[0][indexY],\n width: points[0][indexX] - pos,\n height: points[2][indexY] - points[0][indexY]\n } :\n {\n x: points[0][indexX],\n y: pos,\n width: points[2][indexX] - points[0][indexX],\n height: points[3][indexY] - pos\n });\n }\n return coords;\n };\n },\n /**\n * Determine if given stacking bar data is radius type\n * @param {object} d Data row\n * @returns {boolean}\n */\n isStackingRadiusData(d) {\n const $$ = this;\n const { $el, config, data, state } = $$;\n const { id, index, value } = d;\n // when the data is hidden, check if has rounded edges\n if (state.hiddenTargetIds.has(id)) {\n const target = $el.bar.filter(d => d.id === id && d.value === value);\n return !target.empty() && /a\\d+/i.test(target.attr(\"d\"));\n }\n // Find same grouped ids\n const keys = config.data_groups.find(v => v.indexOf(id) > -1);\n // Get sorted list\n const sortedList = $$.orderTargets($$.filterTargetsToShow(data.targets.filter($$.isBarType, $$))).filter(v => keys.indexOf(v.id) > -1);\n // Get sorted Ids. Filter positive or negative values Ids from given value\n const sortedIds = sortedList\n .map(v => {\n // Direct index access (values are sorted by index from convertDataToTargets)\n const v2 = v.values[index];\n if (v2 && (isNumber(value) && value > 0 ? v2.value > 0 : v2.value < 0)) {\n return v2;\n }\n return undefined;\n })\n .filter(Boolean)\n .map(v => v.id);\n // If the given id stays in the last position, then radius should be applied.\n return value !== 0 && (sortedIds.indexOf(id) === sortedIds.length - 1);\n },\n /**\n * Update the bar connect line path\n * @param {d3Selection} node d3 selection of bar connect line\n * @param {string} type Type of connect line, one of \"start-start\", \"start-end\", \"end-start\", \"end-end\"\n * @param {Array} barPath d3 path data for the bar\n */\n updateConnectLine(node, type, barPath) {\n const path = barPath.map((v, i, arr) => {\n const isRotated = this.config.axis_rotated;\n const isStart = /^start-(start|end)$/.test(type);\n const isEnd = /^end-(start|end)$/.test(type);\n const path = [];\n const x = isRotated ? (isEnd ? v.x - v.width : v.x) : (v.x + v.width);\n const y = isRotated ? v.y + v.height : isStart ? v.y + v.height : v.y;\n if (i === 0) {\n path.push(`${x},${y}`);\n }\n else {\n path.push(isRotated ?\n `L${v.x - (/\\w+-end$/.test(type) ? v.width : 0)},${v.y}` :\n `L${v.x},${v.y + (/\\w+-start$/.test(type) ? v.height : 0)}`);\n if (i < arr.length - 1) {\n path.push(`M${x},${y}`);\n }\n }\n return path.join(\" \");\n });\n node.attr(\"d\", `M${path.join(\"\")}z`);\n }\n};\n\nexport { shapeBar as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\n/**\n * bar config options\n */\nvar optBar = {\n /**\n * Set bar options\n * @name bar\n * @memberof Options\n * @type {object}\n * @property {object} bar Bar object\n * @property {boolean} [bar.front=false] Set 'bar' to be positioned over(on the top) other shapes elements.\n * @property {number} [bar.indices.removeNull=false] Remove nullish data on bar indices positions.\n * @property {number} [bar.label.threshold=0] Set threshold ratio to show/hide labels.\n * @property {boolean|object} [bar.linearGradient=false] Set the linear gradient on bar.<br><br>\n * Or customize by giving below object value:\n * - x {Array}: `x1`, `x2` value (default: `[0, 0]`)\n * - y {Array}: `y1`, `y2` value (default: `[0, 1]`)\n * - stops {Array}: Each item should be having `[offset, stop-color, stop-opacity]` values.\n * - (default: `[[0, $DATA_COLOR, 1], [1, $DATA_COLOR, 0]]`)\n * @property {boolean} [bar.overlap=false] Bars will be rendered at same position, which will be overlapped each other. (for non-grouped bars only)\n * @property {number} [bar.padding=0] The padding pixel value between each bar.\n * @property {number} [bar.radius] Set the radius of bar edge in pixel.\n * @property {number} [bar.radius.ratio] Set the radius ratio of bar edge in relative the bar's width.\n * @property {number} [bar.sensitivity=2] The sensitivity offset value for interaction boundary.\n * @property {number|function|object} [bar.width] Change the width of bar chart.\n * @property {number} [bar.width.ratio=0.6] Change the width of bar chart by ratio.\n * - **NOTE:** Criteria for ratio.\n * - When x ticks count is same with the data count, the baseline for ratio is the minimum interval value of x ticks.\n * \t - ex. when timeseries x values are: [2024-01-01, 2024-02-01, 2024-03-01], the minimum interval will be `2024-02-01 ~ 2024-03-01`\n * - if the minimum interval is 30px, then ratio=1 means 30px.\n * - When x ticks count is lower than the data count, the baseline will be calculated as `chart width / data count`.\n * \t - ex. when chart width is 500, data count is 5, then ratio=1 means 100px.\n * @property {number} [bar.width.max] The maximum width value for ratio.\n * @property {number} [bar.width.dataname] Change the width of bar for indicated dataset only.\n * @property {number} [bar.width.dataname.ratio=0.6] Change the width of bar chart by ratio.\n * - **NOTE:**\n * - Works only for non-stacked bar\n * @property {number} [bar.width.dataname.max] The maximum width value for ratio.\n * @property {boolean} [bar.zerobased=true] Set if min or max value will be 0 on bar chart.\n * @see [Demo: bar front](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarFront)\n * @see [Demo: bar indices](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarIndices)\n * @see [Demo: bar overlap](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarOverlap)\n * @see [Demo: bar padding](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarPadding)\n * @see [Demo: bar radius](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarRadius)\n * @see [Demo: bar width](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarWidth)\n * @see [Demo: bar width variant](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarWidthVariant)\n * @example\n * bar: {\n * // make bar shape to be positioned over the other shape elements\n * front: true,\n *\n * // remove nullish data on bar indices positions\n * indices: {\n * removeNull: true\n * },\n *\n * // will generate following linearGradient:\n * // for more info: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/linearGradient\n * // <linearGradient x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n * // <stop offset=\"0\" stop-color=\"$DATA_COLOR\" stop-opacity=\"1\"></stop>\n * // <stop offset=\"1\" stop-color=\"$DATA_COLOR\" stop-opacity=\"0\"></stop>\n * // </linearGradient>\n * linearGradient: true,\n *\n * // Or customized gradient\n * linearGradient: {\n * \tx: [0, 0], // x1, x2 attributes\n * \ty: [0, 0], // y1, y2 attributes\n * \tstops: [\n * \t // offset, stop-color, stop-opacity\n * \t [0, \"#7cb5ec\", 1],\n *\n * \t // setting 'null' for stop-color, will set its original data color\n * \t [0.5, null, 0],\n *\n * \t // setting 'function' for stop-color, will pass data id as argument.\n * \t // It should return color string or null value\n * \t [1, function(id) { return id === \"data1\" ? \"red\" : \"blue\"; }, 0],\n * \t]\n * },\n *\n * // remove nullish da\n * overlap: true,\n *\n * padding: 1,\n *\n * // bar radius\n * radius: 10,\n * // or\n * radius: {\n * ratio: 0.5\n * }\n *\n * label: {\n * // 0.1(10%) ratio value means, the minimum ratio to show text label relative to the y Axis domain range value.\n * // if data value is below than 0.1, text label will be hidden.\n * threshold: 0.1,\n * },\n *\n * // will not have offset between each bar elements for interaction\n * sensitivity: 0,\n *\n * width: 10,\n *\n * // or specify width callback. The callback will receive width, targetsNum, maxDataCount as arguments.\n * // - width: chart area width\n * // - targetsNum: number of targets\n * // - maxDataCount: maximum data count among targets\n * width: function(width, targetsNum, maxDataCount) {\n * return width / (targetsNum * maxDataCount);\n * }\n *\n * // or specify ratio & max\n * width: {\n * ratio: 0.2,\n * max: 20\n * },\n *\n * // or specify width per dataset\n * width: {\n * data1: 20,\n * data2: {\n * ratio: 0.2,\n * max: 20\n * }\n * },\n *\n * zerobased: false\n * }\n */\n bar_connectLine: false,\n bar_front: false,\n bar_indices_removeNull: false,\n bar_label_threshold: 0,\n bar_linearGradient: false,\n bar_overlap: false,\n bar_padding: 0,\n bar_radius: undefined,\n bar_radius_ratio: undefined,\n bar_sensitivity: 2,\n bar_width: undefined,\n bar_width_ratio: 0.6,\n bar_width_max: undefined,\n bar_zerobased: true\n};\n\nexport { optBar as default };\n","/*!\n* Copyright (c) 2017 ~ present NAVER Corp.\r\n * billboard.js project is licensed under the MIT license\r\n * \r\n * billboard.js, JavaScript chart library\r\n * https://naver.github.io/billboard.js/\r\n * \r\n * @version 4.0.3\n*/\nimport shapeBar from '../../../ChartInternal/shape/bar.js';\nimport shapePointCommon from '../../../ChartInternal/shape/core/point.js';\nimport { TYPE } from '../../const.js';\nimport optPoint from '../../Options/common/point.js';\nimport optBar from '../../Options/shape/bar.js';\nimport { extendAxis } from './axis.helpers.js';\n\n/**\n * Copyright (c) 2017 ~ present NAVER Corp.\n * billboard.js project is licensed under the MIT license\n */\nlet bar = () => (extendAxis([shapeBar, shapePointCommon], [optBar, optPoint]), (bar = () => TYPE.BAR)());\n\nexport { bar };\n","// ── External Dependencies & Registrations\nimport 'billboard.js/dist/billboard.css';\nimport type { Chart } from 'billboard.js';\nimport { bar, bb, grid } from 'billboard.js';\n\n// ── Types ────────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport interface BarChartSeries {\n name: string;\n values: number[];\n}\n\nexport interface BarChartData {\n categories: string[];\n series: BarChartSeries[];\n}\n\nexport interface BillboardJSHandle {\n chart: Chart;\n destroy: () => void;\n resize: () => void;\n}\n\n// ── Actions ──────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n// Billboard.js's SVG entry point (there's also a heavier `billboard.js/canvas` entry, unused here - see the D3Tool.renderBillboardJS comment).\nexport function renderBillboardJS(data: BarChartData, renderTo: HTMLElement): BillboardJSHandle {\n const columns = data.series.map((series): [string, ...number[]] => [series.name, ...series.values]);\n\n const chart = bb.generate({\n ...grid(),\n axis: { x: { categories: data.categories, type: 'category' } },\n bindto: renderTo,\n data: { columns, type: bar() }\n });\n\n return {\n chart,\n destroy: () => {\n chart.destroy();\n },\n resize: () => {\n chart.resize();\n }\n };\n}\n"],"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,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101],"mappings":";;;;;;AAiBA,IAAM,IAAO;CACT,MAAM;CACN,iBAAiB;CACjB,aAAa;CACb,mBAAmB;CACnB,WAAW;CACX,iBAAiB;CACjB,KAAK;CACL,QAAQ;CACR,aAAa;CACb,OAAO;CACP,QAAQ;CACR,OAAO;CACP,MAAM;CACN,KAAK;CACL,OAAO;CACP,OAAO;CACP,SAAS;CACT,QAAQ;CACR,MAAM;CACN,SAAS;AACb,GA2CM,IAAqB;CACvB,MAAM;CACN,iBAAiB;CACjB,aAAa;CACb,mBAAmB;CACnB,WAAW;CACX,iBAAiB;CACjB,KAAK;CACL,QAAQ;CACR,aAAa;CACb,OAAO;CACP,QAAQ;CACR,OAAO;CACP,MAAM;CACN,KAAK;CACL,OAAO;CACP,OAAO;CACP,SAAS;CACT,QAAQ;CACR,MAAM;CACN,SAAS;AACb,GAKM,IAAmB;CACrB,MAAM;EACF,EAAK;EACL,EAAK;EACL,EAAK;EACL,EAAK;EACL,EAAK;EACL,EAAK;CACT;CACA,WAAW;EACP,EAAK;EACL,EAAK;EACL,EAAK;CACT;CACA,KAAK;EACD,EAAK;EACL,EAAK;EACL,EAAK;EACL,EAAK;EACL,EAAK;CACT;CACA,MAAM;EACF,EAAK;EACL,EAAK;EACL,EAAK;EACL,EAAK;EACL,EAAK;EACL,EAAK;EACL,EAAK;EACL,EAAK;EACL,EAAK;CACT;CACA,MAAM;EACF,EAAK;EACL,EAAK;EACL,EAAK;CACT;CACA,QAAQ;EACJ,EAAK;EACL,EAAK;EACL,EAAK;CACT;AACJ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