From c6ac5a5b303e6852f0450f7913b6ba0401b26d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=99=8D=EC=9C=A0=EC=A0=95/FE=EA=B0=9C=EB=B0=9C=EB=9E=A9/?= =?UTF-8?q?NE?= Date: Thu, 1 Mar 2018 21:50:01 +0900 Subject: [PATCH 01/13] doc: update README.md to prepare branding site open (#764) --- README.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 7b325cecd..10d6ffc15 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,6 @@ [![GitHub release](https://img.shields.io/github/release/nhnent/tui.chart.svg)](https://github.com/nhnent/tui.grid/releases/latest) [![npm](https://img.shields.io/npm/v/tui-chart.svg)](https://www.npmjs.com/package/tui-grid) [![bower](https://img.shields.io/bower/v/tui-chart.svg)](https://github.com/nhnent/tui.chart/releases/latest) [![GitHub license](https://img.shields.io/github/license/nhnent/tui.chart.svg)](https://github.com/nhnent/tui.chart/blob/production/LICENSE) [![PRs welcome](https://img.shields.io/badge/PRs-welcome-ff69b4.svg)](https://github.com/nhnent/tui.chart/pulls) [![code with hearth by NHN Entertainment](https://img.shields.io/badge/%3C%2F%3E%20with%20%E2%99%A5%20by-NHN%20Entertainment-ff1414.svg)](https://github.com/nhnent) -![area chart normal stack2](https://user-images.githubusercontent.com/13758710/35846361-b9b96dd0-0b59-11e8-8e55-57995e35badc.png) -![all](https://user-images.githubusercontent.com/13758710/35847300-6139bcec-0b5d-11e8-861f-57d8a0b1c810.png) - - ## 🚩 Table of Contents * [Browser Support](#-browser-support) * [Features](#-features) @@ -30,7 +26,7 @@ ## 🌏 Browser Support | Chrome Chrome | Firefox Firefox | Safari Safari | Edge Edge | IE Internet Explorer | | :---------: | :---------: | :---------: | :---------: | :---------: | -| Yes | Yes | Yes | Yes | [[8+]] | +| Yes | Yes | Yes | Yes | 8+ | ## 🎨 Features @@ -65,15 +61,15 @@ It is being maintained actively for three years and so forth. Yes, It's free. :) ## Examples -#### Single Charts +### Single Charts | [Bar](https://nhnent.github.io/tui.chart/latest/tutorial-example01-01-bar-chart-basic.html)
[Column](https://nhnent.github.io/tui.chart/latest/tutorial-example02-01-column-chart-basic.html) | [Line](https://nhnent.github.io/tui.chart/latest/tutorial-example03-01-line-chart-basic.html)
[Area](https://nhnent.github.io/tui.chart/latest/tutorial-example04-01-area-chart-basic.html)
[Radial](https://nhnent.github.io/tui.chart/latest/tutorial-example13-01-radial-chart-basic.html) | [Bubble](https://nhnent.github.io/tui.chart/latest/tutorial-example05-01-bubble-chart-basic.html)
[Scatter](https://nhnent.github.io/tui.chart/latest/tutorial-example06-01-scatter-chart-basic.html) | [Pie](https://nhnent.github.io/tui.chart/latest/tutorial-example07-01-pie-chart-basic.html)(General)
[Pie](https://nhnent.github.io/tui.chart/latest/tutorial-example07-04-pie-chart-donut.html)(Donut) | [Map](https://nhnent.github.io/tui.chart/latest/tutorial-example09-01-map-chart-world-map.html)
[Heatmap](https://nhnent.github.io/tui.chart/latest/tutorial-example10-01-heatmap-chart-basic.html)
[Treemap](https://nhnent.github.io/tui.chart/latest/tutorial-example11-01-treemap-chart-basic.html) | [Boxplot](https://nhnent.github.io/tui.chart/latest/tutorial-example14-01-boxplot-chart-basic.html) | [Bullet](https://nhnent.github.io/tui.chart/latest/tutorial-example15-01-bullet-chart-basic.html) | --- | --- | --- | --- | --- | --- | --- | -#### Combo Charts +### Combo Charts | [Column-Line](https://nhnent.github.io/tui.chart/latest/tutorial-example08-01-combo-chart-column-and-line.html) | [Pie-Donut](https://nhnent.github.io/tui.chart/latest/tutorial-example08-02-combo-chart-pie-and-donut.html) | [Line-Area](https://nhnent.github.io/tui.chart/latest/tutorial-example08-03-combo-chart-line-and-area.html) | [Line-Scatter](https://nhnent.github.io/tui.chart/latest/tutorial-example08-04-combo-chart-line-and-scatter.html) | | --- | --- | --- | --- | -#### Other tips +### Other tips * [Load Data from ``](https://github.com/nhnent/tui.chart/blob/production/docs/wiki/import-chart-data-from-existing-table-element.md) * [Add data dynamically](https://github.com/nhnent/tui.chart/blob/production/docs/wiki/theme.md) @@ -103,15 +99,15 @@ When using npm, be sure to use it in the environment [Node.js](https://nodejs.or #### npm ```sh -$ npm install --save [[package name]] # Latest version -$ npm install --save [[package name]]@ # Specific version +$ npm install --save tui-chart # Latest version +$ npm install --save tui-chart@ # Specific version ``` #### bower ```sh -$ bower install [[package name]] # Latest version -$ bower install [[package name]]# # Specific version +$ bower install tui-chart # Latest version +$ bower install tui-chart# # Specific version ``` ### Download Source Files From 07c883454bafaacc7af995f2696e08da96c11113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=84=EC=9A=B0/FE=EA=B0=9C=EB=B0=9C=EB=9E=A9/?= =?UTF-8?q?NE?= Date: Thu, 8 Mar 2018 17:29:59 +0900 Subject: [PATCH 02/13] fix: casting compare category of datetype (#769) * fix: casting compare category of datetype * fix: legend aling bug --- src/js/components/legends/legend.js | 2 +- src/js/models/data/dataProcessor.js | 47 +++++++++++++++++++++--- src/js/plugins/raphaelLegendComponent.js | 2 + test/models/data/dataProcessor.spec.js | 15 ++++++++ 4 files changed, 60 insertions(+), 6 deletions(-) diff --git a/src/js/components/legends/legend.js b/src/js/components/legends/legend.js index ce1dd5b98..538f2a845 100644 --- a/src/js/components/legends/legend.js +++ b/src/js/components/legends/legend.js @@ -211,7 +211,7 @@ var Legend = snippet.defineClass(/** @lends Legend.prototype */ { var dimensionHeight = (chartConst.LINE_MARGIN_TOP + legendItemHeight) * (isHorizontal ? 1 : labelCount); var left = basePosition.left; - if (!predicate.isLegendAlignLeft) { + if (!predicate.isLegendAlignLeft(this.options.align)) { left += chartConst.LEGEND_AREA_PADDING; } diff --git a/src/js/models/data/dataProcessor.js b/src/js/models/data/dataProcessor.js index 2a0166fb9..339b2a8ca 100644 --- a/src/js/models/data/dataProcessor.js +++ b/src/js/models/data/dataProcessor.js @@ -209,6 +209,12 @@ var DataProcessor = snippet.defineClass(DataProcessorBase, /** @lends DataProces */ this.categoriesMap = null; + /** + * categories isDatetype true or false + * @type {null|object} + */ + this.categoriesIsDateTime = {}; + /** * stacks * @type {Array.} @@ -306,17 +312,18 @@ var DataProcessor = snippet.defineClass(DataProcessorBase, /** @lends DataProces } else { isDateTime = options.type && predicate.isDatetimeType(options.type); } - if (isDateTime) { categories = snippet.map(categories, function(value) { - var date = new Date(value); + var date = this.chageDatetypeToTimestamp(value); - return date.getTime() || value; - }); + return date; + }, this); } else { categories = this._escapeCategories(categories); } + this.categoriesIsDateTime[axisName] = isDateTime; + return categories; }, @@ -371,6 +378,31 @@ var DataProcessor = snippet.defineClass(DataProcessorBase, /** @lends DataProces return foundCategories; }, + /** + * Get Category date type + * @param {boolean} isVertical - whether vertical or not + * @returns {boolean} + */ + getCategorieDateType: function(isVertical) { + var type = isVertical ? 'y' : 'x'; + + return this.categoriesIsDateTime[type]; + }, + + /** + * value to timestamp of datetype category + * @param {string} dateTypeValue - datetype category value + * @returns {boolean} + */ + chageDatetypeToTimestamp: function(dateTypeValue) { + var date = new Date(dateTypeValue); + if (!(date.getTime() > 0)) { + date = new Date(parseInt(dateTypeValue, 10)); + } + + return date.getTime() || dateTypeValue; + }, + /** * Get category count. * @param {boolean} isVertical - whether vertical or not @@ -441,15 +473,20 @@ var DataProcessor = snippet.defineClass(DataProcessorBase, /** @lends DataProces */ findCategoryIndex: function(value) { var categories = this.getCategories(); + var isDateType = this.getCategorieDateType(); var foundIndex = null; snippet.forEachArray(categories, function(category, index) { + if (isDateType) { + value = this.chageDatetypeToTimestamp(value); + } + if (category === value) { foundIndex = index; } return snippet.isNull(foundIndex); - }); + }, this); return foundIndex; }, diff --git a/src/js/plugins/raphaelLegendComponent.js b/src/js/plugins/raphaelLegendComponent.js index fe576d86d..4885e0af3 100644 --- a/src/js/plugins/raphaelLegendComponent.js +++ b/src/js/plugins/raphaelLegendComponent.js @@ -307,7 +307,9 @@ RaphaelLegendComponent = snippet.defineClass(/** @lends RaphaelLegendComponent.p left: position.left, top: position.top + (this._iconHeight / 2) }; + var attributes = { + fill: labelTheme.color, 'font-size': labelTheme.fontSize, 'font-family': labelTheme.fontFamily, 'font-weight': labelTheme.fontWeight, diff --git a/test/models/data/dataProcessor.spec.js b/test/models/data/dataProcessor.spec.js index eb4332885..0882b606f 100644 --- a/test/models/data/dataProcessor.spec.js +++ b/test/models/data/dataProcessor.spec.js @@ -313,6 +313,21 @@ describe('Test for DataProcessor', function() { expect(actual).toBeNull(); }); + + it('timestamp should be properly cast and compared in both string and numeric modes', function() { + var actual; + + dataProcessor.categoriesMap = { + x: [1530958121000, 1530958122000, 1530958123000] + }; + dataProcessor.categoriesIsDateTime = { + x: true + }; + + actual = dataProcessor.findCategoryIndex('1530958122000'); + + expect(actual).toBe(1); + }); }); describe('makeTooltipCategory()', function() { From 235717335f0c6ea7679ba0197457ccd2ef69c4d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=84=EC=9A=B0/FE=EA=B0=9C=EB=B0=9C=EB=9E=A9/?= =?UTF-8?q?NE?= Date: Thu, 8 Mar 2018 17:30:16 +0900 Subject: [PATCH 03/13] fix: spectrum legend tick bug (#768) --- src/js/helpers/predicate.js | 10 +++ src/js/models/scaleData/scaleDataMaker.js | 35 ++++++--- src/js/plugins/raphaelMapLegend.js | 1 - test/models/scaleData/scaleDataMaker.spec.js | 78 ++++++++++++++------ 4 files changed, 91 insertions(+), 33 deletions(-) diff --git a/src/js/helpers/predicate.js b/src/js/helpers/predicate.js index ff58ea51b..c9ca09f06 100644 --- a/src/js/helpers/predicate.js +++ b/src/js/helpers/predicate.js @@ -286,6 +286,16 @@ var predicate = { return chartType === chartConst.CHART_TYPE_MAP; }, + /** + * Whether map type chart or not. + * @memberOf module:predicate + * @param {string} chartType - chart type + * @returns {boolean} + */ + isMapTypeChart: function(chartType) { + return (this.isMapChart(chartType) || this.isHeatmapChart(chartType) || this.isTreemapChart(chartType)); + }, + /** * Whether coordinate type chart or not. * @memberOf module:predicate diff --git a/src/js/models/scaleData/scaleDataMaker.js b/src/js/models/scaleData/scaleDataMaker.js index e3504109a..7496d13f1 100644 --- a/src/js/models/scaleData/scaleDataMaker.js +++ b/src/js/models/scaleData/scaleDataMaker.js @@ -245,17 +245,23 @@ var scaleDataMaker = { /** * Calculate coordinate scale. - * @param {Array.} baseValues - base values - * @param {number} baseSize - base size(width or height) for calculating scale data - * @param {object} overflowItem - overflow item - * @param {boolean} isDiverging - is diverging or not - * @param {object} options - scale options - * @param {{min: ?number, max: ?number}} options.limit - limit options + * @param {object} makeScaleInfos - calculate scale infos + * @param {Array.} makeScaleInfos.baseValues - base values + * @param {number} makeScaleInfos.baseSize - base size(width or height) for calculating scale data + * @param {object} makeScaleInfos.overflowItem - overflow item + * @param {boolean} makeScaleInfos.isDiverging - is diverging or not + * @param {strint} makeScaleInfos.chartType - chartType + * @param {object} makeScaleInfos.options - scale options + * @param {{min: ?number, max: ?number}} makeScaleInfos.options.limit - limit options * @returns {{limit: {min:number, max:number}, step: number}} * @private */ - _calculateCoordinateScale: function(baseValues, baseSize, overflowItem, isDiverging, options) { - var limit = this._getLimitSafely(baseValues); + _calculateCoordinateScale: function(makeScaleInfos) { + var options = makeScaleInfos.options; + var baseSize = makeScaleInfos.baseSize; + var overflowItem = makeScaleInfos.overflowItem; + var chartType = makeScaleInfos.chartType; + var limit = this._getLimitSafely(makeScaleInfos.baseValues); var limitOption = options.limitOption || {}; var hasMinOption = snippet.isExisty(limitOption.min); var hasMaxOption = snippet.isExisty(limitOption.max); @@ -283,11 +289,11 @@ var scaleDataMaker = { isOverflowed = this._isOverflowed(overflowItem, scaleData, limit, hasMinOption, hasMaxOption); - if (isOverflowed) { + if (isOverflowed && !predicate.isMapTypeChart(chartType)) { scaleData.limit = this._adjustLimitForOverflow(scaleData.limit, scaleData.step, isOverflowed); } - if (isDiverging) { + if (makeScaleInfos.isDiverging) { scaleData.limit = this._makeLimitForDivergingOption(scaleData.limit); } @@ -342,7 +348,14 @@ var scaleDataMaker = { options.stepCount = Math.floor(baseSize / 100); } - scaleData = this._calculateCoordinateScale(baseValues, baseSize, overflowItem, isDiverging, options); + scaleData = this._calculateCoordinateScale({ + baseValues: baseValues, + baseSize: baseSize, + overflowItem: overflowItem, + isDiverging: isDiverging, + chartType: chartType, + options: options + }); } return scaleData; diff --git a/src/js/plugins/raphaelMapLegend.js b/src/js/plugins/raphaelMapLegend.js index 670a560b3..5021c69a7 100644 --- a/src/js/plugins/raphaelMapLegend.js +++ b/src/js/plugins/raphaelMapLegend.js @@ -71,7 +71,6 @@ var RaphaelMapLegend = snippet.defineClass(/** @lends RaphaelMapLegend.prototype } legendSet.push(raphaelRenderUtil.renderLine(paper, path, '#ccc', 1)); - legendSet.push(raphaelRenderUtil.renderText(paper, pos, label)); }); }, diff --git a/test/models/scaleData/scaleDataMaker.spec.js b/test/models/scaleData/scaleDataMaker.spec.js index cb99c8eb8..45fba9c77 100644 --- a/test/models/scaleData/scaleDataMaker.spec.js +++ b/test/models/scaleData/scaleDataMaker.spec.js @@ -265,11 +265,17 @@ describe('Test for ScaleDataMaker', function() { describe('_calculateCoordinateScale()', function() { it('should return limitOption, if there is limitOption', function() { - var scaleData = scaleDataMaker._calculateCoordinateScale([10, 20, 30, 40], 100, null, false, { - limitOption: { + var scaleData = scaleDataMaker._calculateCoordinateScale({ + baseValues: [10, 20, 30, 40], + baseSize: 100, + overflowItem: null, + isDiverging: false, + chartType: 'bar', + options: {limitOption: { min: 0, max: 100 - }}); + }} + }); expect(scaleData.limit.max).toBe(100); expect(scaleData.limit.min).toBe(0); @@ -277,11 +283,16 @@ describe('Test for ScaleDataMaker', function() { }); it('should set scale data\'s limit value by baseValues, when limit option is not set', function() { - var scaleData = scaleDataMaker._calculateCoordinateScale([10, 20, 30, 39], 100, null, false, { - limitOption: { + var scaleData = scaleDataMaker._calculateCoordinateScale({ + baseValues: [10, 20, 30, 39], + baseSize: 100, + overflowItem: null, + isDiverging: false, + chartType: 'bar', + options: {limitOption: { min: null, max: null - } + }} }); expect(scaleData.limit.max).toBe(40); @@ -290,11 +301,16 @@ describe('Test for ScaleDataMaker', function() { }); it('should adjust limit.max value, if no limtOption and max value is not zero', function() { - var scaleData = scaleDataMaker._calculateCoordinateScale([10, 20, 30, 40], 100, null, false, { - limitOption: { + var scaleData = scaleDataMaker._calculateCoordinateScale({ + baseValues: [10, 20, 30, 40], + baseSize: 100, + overflowItem: null, + isDiverging: false, + chartType: 'bar', + options: {limitOption: { min: null, max: null - } + }} }); expect(scaleData.limit.max).toBe(50); @@ -303,11 +319,16 @@ describe('Test for ScaleDataMaker', function() { }); it('should adjust limit.min value, if no limit option and min value is not zero', function() { - var scaleData = scaleDataMaker._calculateCoordinateScale([-10, -20, -30, 0], 100, null, false, { - limitOption: { + var scaleData = scaleDataMaker._calculateCoordinateScale({ + baseValues: [-10, -20, -30, 0], + baseSize: 100, + overflowItem: null, + isDiverging: false, + chartType: 'bar', + options: {limitOption: { min: null, max: null - } + }} }); expect(scaleData.limit.max).toBe(0); @@ -316,11 +337,16 @@ describe('Test for ScaleDataMaker', function() { }); it('should set limit to (min : data - step, max: 0), when base values count is 1, and the value is negative', function() { - var scaleData = scaleDataMaker._calculateCoordinateScale([-10], 100, null, false, { - limitOption: { + var scaleData = scaleDataMaker._calculateCoordinateScale({ + baseValues: [-10], + baseSize: 100, + overflowItem: null, + isDiverging: false, + chartType: 'bar', + options: {limitOption: { min: null, max: null - } + }} }); expect(scaleData.limit.max).toBe(0); @@ -328,11 +354,16 @@ describe('Test for ScaleDataMaker', function() { }); it('should set limit to (min : 0, max: data + step), when baseValues count is 1, and the value is positive.', function() { - var scaleData = scaleDataMaker._calculateCoordinateScale([10], 100, null, false, { - limitOption: { + var scaleData = scaleDataMaker._calculateCoordinateScale({ + baseValues: [10], + baseSize: 100, + overflowItem: null, + isDiverging: false, + chartType: 'bar', + options: {limitOption: { min: null, max: null - } + }} }); expect(scaleData.limit.max).toBe(15); @@ -340,11 +371,16 @@ describe('Test for ScaleDataMaker', function() { }); it('should set minimum value to zero, when limit.min is zero', function() { - var scaleData = scaleDataMaker._calculateCoordinateScale([0.501, 0.551], 100, null, false, { - limitOption: { + var scaleData = scaleDataMaker._calculateCoordinateScale({ + baseValues: [0.501, 0.551], + baseSize: 100, + overflowItem: null, + isDiverging: false, + chartType: 'bar', + options: {limitOption: { min: 0, max: null - } + }} }); expect(scaleData.limit.max).toBe(0.6); From 9ddac3d1ab37bbdb2fa4b88409f7013292b4e20c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=84=EC=9A=B0/FE=EA=B0=9C=EB=B0=9C=EB=9E=A9/?= =?UTF-8?q?NE?= Date: Thu, 8 Mar 2018 17:38:06 +0900 Subject: [PATCH 04/13] fix: select series bug (#767) * fix: select series bug * fix: jsdoc expression improvement --- src/js/components/legends/legend.js | 4 +++- .../mouseEventDetectors/areaTypeDataModel.js | 18 ++++++++++++------ .../areaTypeEventDetector.js | 3 ++- src/js/models/data/dataProcessor.js | 6 ++++++ .../areaTypeDataModel.spec.js | 6 +++++- 5 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/js/components/legends/legend.js b/src/js/components/legends/legend.js index 538f2a845..e6a04a58f 100644 --- a/src/js/components/legends/legend.js +++ b/src/js/components/legends/legend.js @@ -281,7 +281,9 @@ var Legend = snippet.defineClass(/** @lends Legend.prototype */ { this._fireChangeCheckedLegendsEvent(); } - this.graphRenderer.selectLegend(this.legendModel.getSelectedIndex(), this.legendSet); + this.dataProcessor.selectLegendIndex = this.legendModel.getSelectedIndex(); + + this.graphRenderer.selectLegend(this.dataProcessor.selectLegendIndex, this.legendSet); this._fireSelectLegendEvent(data); this._fireSelectLegendPublicEvent(data); diff --git a/src/js/components/mouseEventDetectors/areaTypeDataModel.js b/src/js/components/mouseEventDetectors/areaTypeDataModel.js index 90697ff55..4b6f3e138 100644 --- a/src/js/components/mouseEventDetectors/areaTypeDataModel.js +++ b/src/js/components/mouseEventDetectors/areaTypeDataModel.js @@ -85,26 +85,32 @@ var AreaTypeDataModel = snippet.defineClass(/** @lends AreaTypeDataModel.prototy * Find Data by layer position. * @param {{x: number, y: number}} layerPosition - layer position * @param {number} [distanceLimit] distance limitation to find data + * @param {?number} selectLegendIndex select legend sereis index * @returns {object} */ - findData: function(layerPosition, distanceLimit) { + findData: function(layerPosition, distanceLimit, selectLegendIndex) { var min = 100000; - var foundData; + var findFoundMap = {}; + var findFound; distanceLimit = distanceLimit || Number.MAX_VALUE; - snippet.forEach(this.data, function(datum) { var xDiff = layerPosition.x - datum.bound.left; var yDiff = layerPosition.y - datum.bound.top; var distance = Math.sqrt(Math.pow(xDiff, 2) + Math.pow(yDiff, 2)); - if (distance < distanceLimit && distance < min) { + if (distance < distanceLimit && distance <= min) { min = distance; - foundData = datum; + findFound = datum; + findFoundMap[datum.indexes.index] = datum; } }); - return foundData; + if (!snippet.isNull(selectLegendIndex) && findFoundMap[selectLegendIndex]) { + findFound = findFoundMap[selectLegendIndex]; + } + + return findFound; }, /** diff --git a/src/js/components/mouseEventDetectors/areaTypeEventDetector.js b/src/js/components/mouseEventDetectors/areaTypeEventDetector.js index 51021c1b7..985986e98 100644 --- a/src/js/components/mouseEventDetectors/areaTypeEventDetector.js +++ b/src/js/components/mouseEventDetectors/areaTypeEventDetector.js @@ -102,8 +102,9 @@ var AreaTypeEventDetector = snippet.defineClass(MouseEventDetectorBase, /** @len */ _findData: function(clientX, clientY) { var layerPosition = this._calculateLayerPosition(clientX, clientY); + var selectLegendIndex = this.dataProcessor.selectLegendIndex; - return this.dataModel.findData(layerPosition, AREA_DETECT_DISTANCE_THRESHHOLD); + return this.dataModel.findData(layerPosition, AREA_DETECT_DISTANCE_THRESHHOLD, selectLegendIndex); }, /** diff --git a/src/js/models/data/dataProcessor.js b/src/js/models/data/dataProcessor.js index 339b2a8ca..6d8e7142c 100644 --- a/src/js/models/data/dataProcessor.js +++ b/src/js/models/data/dataProcessor.js @@ -96,6 +96,12 @@ var DataProcessor = snippet.defineClass(DataProcessorBase, /** @lends DataProces */ this.originalLegendData = null; + /** + * select legend index + * @type {number} + */ + this.selectLegendIndex = null; + /** * dynamic data array for adding data. * @type {Array.<{category: string | number, values: Array.}>} diff --git a/test/components/mouseEventDetectors/areaTypeDataModel.spec.js b/test/components/mouseEventDetectors/areaTypeDataModel.spec.js index 048ad308f..bfd94d1b9 100644 --- a/test/components/mouseEventDetectors/areaTypeDataModel.spec.js +++ b/test/components/mouseEventDetectors/areaTypeDataModel.spec.js @@ -55,6 +55,10 @@ describe('Test for AreaTypeDataModel', function() { bound: { top: 10, left: 10 + }, + indexes: { + groupIndex: 0, + index: 0 } }, { @@ -67,7 +71,7 @@ describe('Test for AreaTypeDataModel', function() { actual = dataModel.findData({ x: 17, y: 10 - }); + }, null, null); expected = dataModel.data[0]; expect(actual).toBe(expected); }); From 57bd70f0b74441ba8648d96eacd705a8cd94b4b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=84=EC=9A=B0?= Date: Thu, 8 Mar 2018 21:10:01 +0900 Subject: [PATCH 05/13] fixed: Correction to eslint rule update. --- src/js/helpers/dataExporter.js | 8 ++++++-- src/js/models/data/seriesDataModelForBoxplot.js | 2 +- src/js/plugins/raphaelLegendComponent.js | 6 ++---- src/js/plugins/raphaelPieChart.js | 3 +-- test/charts/componentManager.spec.js | 3 +-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/js/helpers/dataExporter.js b/src/js/helpers/dataExporter.js index d588f35f1..951dc9385 100644 --- a/src/js/helpers/dataExporter.js +++ b/src/js/helpers/dataExporter.js @@ -55,15 +55,19 @@ function _get2DArrayFromRawData(rawData) { var categories; var isHeatMap = (rawData.categories && snippet.isExisty(rawData.categories.x)); var isBullet = (rawData.series && snippet.isExisty(rawData.series.bullet)); + var return2DArrayData = false; if (rawData) { if (isHeatMap) { - return _get2DArrayFromHeatmapRawData(rawData); + return2DArrayData = _get2DArrayFromHeatmapRawData(rawData); } else if (isBullet) { - return _get2DArrayFromBulletRawData(rawData); + return2DArrayData = _get2DArrayFromBulletRawData(rawData); } else if (rawData.categories) { categories = rawData.categories; } + if (return2DArrayData) { + return return2DArrayData; + } resultArray.push([''].concat(categories)); diff --git a/src/js/models/data/seriesDataModelForBoxplot.js b/src/js/models/data/seriesDataModelForBoxplot.js index 3d8c224e3..63b7879be 100644 --- a/src/js/models/data/seriesDataModelForBoxplot.js +++ b/src/js/models/data/seriesDataModelForBoxplot.js @@ -132,7 +132,7 @@ var SeriesDataModelForBoxplot = snippet.defineClass(SeriesDataModel, /** @lends _createValues: function() { var values = []; this.map(function(seriesGroup) { - snippet.forEach(seriesGroup.items, function(group) { + return snippet.forEach(seriesGroup.items, function(group) { values.push(group.min); values.push(group.max); values.push(group.uq); diff --git a/src/js/plugins/raphaelLegendComponent.js b/src/js/plugins/raphaelLegendComponent.js index 4885e0af3..fe9019fb7 100644 --- a/src/js/plugins/raphaelLegendComponent.js +++ b/src/js/plugins/raphaelLegendComponent.js @@ -234,12 +234,10 @@ RaphaelLegendComponent = snippet.defineClass(/** @lends RaphaelLegendComponent.p var controllerPositionLeft = position.left - chartConst.CHART_PADDING; var rightButtonPositionLeft = controllerPositionLeft + dimension.width - BUTTON_WIDTH; var leftButtonPositionLeft = rightButtonPositionLeft - (BUTTON_PADDING_LEFT + BUTTON_WIDTH); - var lowerArrowPath = [ - 'M', rightButtonPositionLeft, ',', (controllerPositionTop + 3), + var lowerArrowPath = ['M', rightButtonPositionLeft, ',', (controllerPositionTop + 3), 'L', (rightButtonPositionLeft + 5), ',', (controllerPositionTop + 8), 'L', (rightButtonPositionLeft + 10), ',', (controllerPositionTop + 3)].join(''); - var upperArrowPath = [ - 'M', leftButtonPositionLeft, ',', (controllerPositionTop + 8), + var upperArrowPath = ['M', leftButtonPositionLeft, ',', (controllerPositionTop + 8), 'L', (leftButtonPositionLeft + 5), ',', (controllerPositionTop + 3), 'L', (leftButtonPositionLeft + 10), ',', (controllerPositionTop + 8)].join(''); diff --git a/src/js/plugins/raphaelPieChart.js b/src/js/plugins/raphaelPieChart.js index 9b9251223..e23ee65cc 100644 --- a/src/js/plugins/raphaelPieChart.js +++ b/src/js/plugins/raphaelPieChart.js @@ -141,8 +141,7 @@ var RaphaelPieChart = snippet.defineClass(/** @lends RaphaelPieChart.prototype * var path = ['M', cx, cy, 'L', x1, y1, 'A', r, r, 0, largeArcFlag, 1, x2, y2, - 'Z' - ]; + 'Z']; // see details about path // http://www.w3schools.com/svg/svg_path.asp diff --git a/test/charts/componentManager.spec.js b/test/charts/componentManager.spec.js index 2349db146..8b5f1af4b 100644 --- a/test/charts/componentManager.spec.js +++ b/test/charts/componentManager.spec.js @@ -61,8 +61,7 @@ describe('Test for ComponentManager', function() { { name: 'lineSeries', componentType: 'series' - } - ]; + }]; expect(actual).toEqual(expected); }); From f29b61bbac4d2319a4904e907d6c6ce27ec986cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=84=EC=9A=B0?= Date: Thu, 8 Mar 2018 21:11:22 +0900 Subject: [PATCH 06/13] chore: eslint and raphael version up of package.json --- package-lock.json | 1399 +++++++++++++++++++++++++-------------------- package.json | 6 +- 2 files changed, 781 insertions(+), 624 deletions(-) diff --git a/package-lock.json b/package-lock.json index 69d894bd6..a2ce586dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,9 +38,9 @@ } }, "acorn": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.3.0.tgz", - "integrity": "sha512-Yej+zOJ1Dm/IMZzzj78OntP/r3zHEaKcyNoU2lAaxPtrseM6rF0xwqoz5Q5ysAiED9hTjI2hgtvLXitlCN1/Ug==", + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", + "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", "dev": true }, "acorn-jsx": { @@ -73,15 +73,15 @@ "dev": true, "requires": { "co": "4.6.0", - "fast-deep-equal": "1.0.0", + "fast-deep-equal": "1.1.0", "fast-json-stable-stringify": "2.0.0", "json-schema-traverse": "0.3.1" } }, "ajv-keywords": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", - "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.1.0.tgz", + "integrity": "sha1-rCsnk5xUPpXSwG5/f1wnvkqlQ74=", "dev": true }, "align-text": { @@ -193,7 +193,7 @@ "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "1.1.11" } }, "readable-stream": { @@ -217,9 +217,9 @@ } }, "argparse": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", - "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { "sprintf-js": "1.0.3" @@ -345,7 +345,7 @@ "dev": true, "requires": { "browserslist": "1.7.7", - "caniuse-db": "1.0.30000790", + "caniuse-db": "1.0.30000813", "normalize-range": "0.1.2", "num2fraction": "1.2.2", "postcss": "5.2.18", @@ -377,9 +377,9 @@ } }, "babel-generator": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.0.tgz", - "integrity": "sha1-rBriAHC3n248odMmlhMFN3TyDcU=", + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", "dev": true, "requires": { "babel-messages": "6.23.0", @@ -387,7 +387,7 @@ "babel-types": "6.26.0", "detect-indent": "4.0.0", "jsesc": "1.3.0", - "lodash": "4.17.4", + "lodash": "4.17.5", "source-map": "0.5.7", "trim-right": "1.0.1" }, @@ -429,7 +429,7 @@ "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "lodash": "4.17.4" + "lodash": "4.17.5" } }, "babel-traverse": { @@ -445,8 +445,25 @@ "babylon": "6.18.0", "debug": "2.6.9", "globals": "9.18.0", - "invariant": "2.2.2", - "lodash": "4.17.4" + "invariant": "2.2.3", + "lodash": "4.17.5" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + } } }, "babel-types": { @@ -457,7 +474,7 @@ "requires": { "babel-runtime": "6.26.0", "esutils": "2.0.2", - "lodash": "4.17.4", + "lodash": "4.17.5", "to-fast-properties": "1.0.3" } }, @@ -486,9 +503,9 @@ "dev": true }, "base64-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", - "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.3.tgz", + "integrity": "sha512-MsAhsUW1GxCdgYSO6tAfZrNapmUKk7mWx/k5mFY/A1gBtkaCaNapTg+FExCw1r9yeaZhqx/xPg43xgTFH6KL5w==", "dev": true }, "base64id": { @@ -596,13 +613,24 @@ "bytes": "3.0.0", "content-type": "1.0.4", "debug": "2.6.9", - "depd": "1.1.1", + "depd": "1.1.2", "http-errors": "1.6.2", "iconv-lite": "0.4.19", "on-finished": "2.3.0", "qs": "6.5.1", "raw-body": "2.3.2", - "type-is": "1.6.15" + "type-is": "1.6.16" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } } }, "boolbase": { @@ -621,9 +649,9 @@ } }, "brace-expansion": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "1.0.0", @@ -665,8 +693,8 @@ "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", "dev": true, "requires": { - "caniuse-db": "1.0.30000790", - "electron-to-chromium": "1.3.30" + "caniuse-db": "1.0.30000813", + "electron-to-chromium": "1.3.36" } }, "buffer": { @@ -675,7 +703,7 @@ "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "dev": true, "requires": { - "base64-js": "1.2.1", + "base64-js": "1.2.3", "ieee754": "1.1.8", "isarray": "1.0.0" } @@ -705,9 +733,9 @@ "dev": true }, "cacache": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.2.tgz", - "integrity": "sha512-dljb7dk1jqO5ogE+dRpoR9tpHYv5xz9vPSNunh1+0wRuNdYxmzp9WmsyokgW/DUF1FDRVA/TMsmxt027R8djbQ==", + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", + "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", "dev": true, "requires": { "bluebird": "3.5.1", @@ -715,14 +743,14 @@ "glob": "7.1.2", "graceful-fs": "4.1.11", "lru-cache": "4.1.1", - "mississippi": "1.3.0", + "mississippi": "2.0.0", "mkdirp": "0.5.1", "move-concurrently": "1.0.1", "promise-inflight": "1.0.1", "rimraf": "2.6.2", - "ssri": "5.0.0", + "ssri": "5.2.4", "unique-filename": "1.1.0", - "y18n": "3.2.1" + "y18n": "4.0.0" } }, "caller-path": { @@ -769,15 +797,15 @@ "dev": true, "requires": { "browserslist": "1.7.7", - "caniuse-db": "1.0.30000790", + "caniuse-db": "1.0.30000813", "lodash.memoize": "4.1.2", "lodash.uniq": "4.5.0" } }, "caniuse-db": { - "version": "1.0.30000790", - "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000790.tgz", - "integrity": "sha1-qAI+brn+nA7z1gtEJ84QTqh9OBw=", + "version": "1.0.30000813", + "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000813.tgz", + "integrity": "sha1-4KHGA/iICteHsqNWUrJzPzKl4po=", "dev": true }, "caseless": { @@ -841,7 +869,7 @@ "lodash.flatten": "4.4.0", "lodash.foreach": "4.5.0", "lodash.map": "4.6.0", - "lodash.merge": "4.6.0", + "lodash.merge": "4.6.1", "lodash.pick": "4.4.0", "lodash.reduce": "4.6.0", "lodash.reject": "4.6.0", @@ -1022,7 +1050,7 @@ "integrity": "sha1-RYwH4J4NkA/Ci3Cj/sLazR0st/Y=", "dev": true, "requires": { - "lodash": "4.17.4" + "lodash": "4.17.5" } }, "combined-stream": { @@ -1035,9 +1063,9 @@ } }, "commander": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", - "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.0.tgz", + "integrity": "sha512-7B1ilBwtYSbetCgTY1NJFg+gVpestg0fdA1MhC1Vs4ssyfSXnCAjFr+QcQM9/RedXC0EaUx1sG8Smgw2VfgKEg==", "dev": true }, "commondir": { @@ -1103,23 +1131,23 @@ } }, "compressible": { - "version": "2.0.12", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.12.tgz", - "integrity": "sha1-xZpcmdt2dn6YdlAOJx72OzSTvWY=", + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.13.tgz", + "integrity": "sha1-DRAgq5JLL9tNYnmHXH1tq6a6p6k=", "dev": true, "requires": { - "mime-db": "1.30.0" + "mime-db": "1.33.0" } }, "compression": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.1.tgz", - "integrity": "sha1-7/JgPvwuIs+G810uuTWJ+YdTc9s=", + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.2.tgz", + "integrity": "sha1-qv+81qr4VLROuygDU9WtFlH1mmk=", "dev": true, "requires": { - "accepts": "1.3.4", + "accepts": "1.3.5", "bytes": "3.0.0", - "compressible": "2.0.12", + "compressible": "2.0.13", "debug": "2.6.9", "on-headers": "1.0.1", "safe-buffer": "5.1.1", @@ -1127,15 +1155,24 @@ }, "dependencies": { "accepts": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", - "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", "dev": true, "requires": { - "mime-types": "2.1.17", + "mime-types": "2.1.18", "negotiator": "0.6.1" } }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "negotiator": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", @@ -1151,26 +1188,37 @@ "dev": true }, "concat-stream": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", - "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.1.tgz", + "integrity": "sha512-gslSSJx03QKa59cIKqeJO9HQ/WZMotvYJCuaUULrLpjj8oG40kV2Z+gz82pVxlTkOADi4PJxQPPfhl1ELYrrXw==", "dev": true, "requires": { "inherits": "2.0.3", - "readable-stream": "2.3.3", + "readable-stream": "2.3.5", "typedarray": "0.0.6" } }, "connect": { - "version": "3.6.5", - "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.5.tgz", - "integrity": "sha1-+43ee6B2OHfQ7J352sC0tA5yx9o=", + "version": "3.6.6", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.6.tgz", + "integrity": "sha1-Ce/2xVr3I24TcTWnJXSFi2eG9SQ=", "dev": true, "requires": { "debug": "2.6.9", - "finalhandler": "1.0.6", + "finalhandler": "1.1.0", "parseurl": "1.3.2", "utils-merge": "1.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } } }, "connect-history-api-fallback": { @@ -1239,20 +1287,18 @@ } }, "copy-webpack-plugin": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-4.3.1.tgz", - "integrity": "sha512-xlcFiW/U7KrpS6dFuWq3r8Wb7koJx7QVc7LDFCosqkikaVSxkaYOnwDLwilbjrszZ0LYZXThDAJKcQCSrvdShQ==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-4.5.0.tgz", + "integrity": "sha512-ROQ85fWKuhJfUkBTdHvfV+Zv6Ltm3G/vPVFdLPFwzWzd9RUY1yLw3rt6FmKK2PaeNQCNvmwgFhuarkjuV4PVDQ==", "dev": true, "requires": { - "cacache": "10.0.2", + "cacache": "10.0.4", "find-cache-dir": "1.0.0", "globby": "7.1.1", "is-glob": "4.0.0", - "loader-utils": "0.2.17", - "lodash": "4.17.4", + "loader-utils": "1.1.0", "minimatch": "3.0.4", "p-limit": "1.2.0", - "pify": "3.0.0", "serialize-javascript": "1.4.0" } }, @@ -1280,7 +1326,7 @@ "object-assign": "4.1.1", "pify": "2.3.0", "pinkie-promise": "2.0.1", - "readable-stream": "2.3.3" + "readable-stream": "2.3.5" }, "dependencies": { "pify": { @@ -1442,6 +1488,20 @@ "postcss-modules-scope": "1.1.0", "postcss-modules-values": "1.3.0", "source-list-map": "0.1.8" + }, + "dependencies": { + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "3.2.0", + "emojis-list": "2.1.0", + "json5": "0.5.1", + "object-assign": "4.1.1" + } + } } }, "css-select": { @@ -1592,9 +1652,9 @@ } }, "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { "ms": "2.0.0" @@ -1662,9 +1722,9 @@ "dev": true }, "depd": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", - "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", "dev": true }, "destroy": { @@ -1738,9 +1798,9 @@ } }, "domain-browser": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", - "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", "dev": true }, "domelementtype": { @@ -1769,14 +1829,14 @@ } }, "duplexify": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.3.tgz", - "integrity": "sha512-g8ID9OroF9hKt2POf8YLayy+9594PzmM3scI00/uBXocX3TWNgoB67hjzkFe9ITAbQOne/lLdBxHXvYUM4ZgGA==", + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.4.tgz", + "integrity": "sha512-JzYSLYMhoVVBe8+mbHQ4KgpvHpm0DZpJuL8PY93Vyv1fW7jYJ90LoXa1di/CVbJM+TgMs91rbDapE/RNIfnJsA==", "dev": true, "requires": { "end-of-stream": "1.4.1", "inherits": "2.0.3", - "readable-stream": "2.3.3", + "readable-stream": "2.3.5", "stream-shift": "1.0.0" } }, @@ -1796,20 +1856,11 @@ "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", "dev": true }, - "electron-releases": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/electron-releases/-/electron-releases-2.1.0.tgz", - "integrity": "sha512-cyKFD1bTE/UgULXfaueIN1k5EPFzs+FRc/rvCY5tIynefAPqopQEgjr0EzY+U3Dqrk/G4m9tXSPuZ77v6dL/Rw==", - "dev": true - }, "electron-to-chromium": { - "version": "1.3.30", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.30.tgz", - "integrity": "sha512-zx1Prv7kYLfc4OA60FhxGbSo4qrEjgSzpo1/37i7l9ltXPYOoQBtjQxY9KmsgfHnBxHlBGXwLlsbt/gub1w5lw==", - "dev": true, - "requires": { - "electron-releases": "2.1.0" - } + "version": "1.3.36", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.36.tgz", + "integrity": "sha1-Dqv3Gp6+qQE/scw1o5DgaGJPJ+g=", + "dev": true }, "emojis-list": { "version": "2.1.0", @@ -1818,9 +1869,9 @@ "dev": true }, "encodeurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", - "integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", "dev": true }, "end-of-stream": { @@ -1962,9 +2013,9 @@ "dev": true }, "errno": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.6.tgz", - "integrity": "sha512-IsORQDpaaSwcDP4ZZnHxgE85werpo34VYn1Ud3mq+eUsF593faR8oCZNXrROVkpFu2TsbrNhHin0aUrTsQ9vNw==", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", "dev": true, "requires": { "prr": "1.0.1" @@ -2029,71 +2080,122 @@ } }, "eslint": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.4.1.tgz", - "integrity": "sha1-mc1+r8/8ov+Zpcj18qR01jZLS9M=", + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.16.0.tgz", + "integrity": "sha512-YVXV4bDhNoHHcv0qzU4Meof7/P26B4EuaktMi5L1Tnt52Aov85KmYA8c5D+xyZr/BkhvwUqr011jDSD/QTULxg==", "dev": true, "requires": { "ajv": "5.5.2", "babel-code-frame": "6.26.0", - "chalk": "1.1.3", - "concat-stream": "1.6.0", + "chalk": "2.3.2", + "concat-stream": "1.6.1", "cross-spawn": "5.1.0", - "debug": "2.6.9", + "debug": "3.1.0", "doctrine": "2.1.0", "eslint-scope": "3.7.1", - "espree": "3.5.2", + "eslint-visitor-keys": "1.0.0", + "espree": "3.5.4", "esquery": "1.0.0", - "estraverse": "4.2.0", "esutils": "2.0.2", "file-entry-cache": "2.0.0", "functional-red-black-tree": "1.0.1", "glob": "7.1.2", - "globals": "9.18.0", + "globals": "11.3.0", "ignore": "3.3.7", "imurmurhash": "0.1.4", "inquirer": "3.3.0", - "is-resolvable": "1.0.1", - "js-yaml": "3.10.0", - "json-stable-stringify": "1.0.1", + "is-resolvable": "1.1.0", + "js-yaml": "3.11.0", + "json-stable-stringify-without-jsonify": "1.0.1", "levn": "0.3.0", - "lodash": "4.17.4", + "lodash": "4.17.5", "minimatch": "3.0.4", "mkdirp": "0.5.1", "natural-compare": "1.4.0", "optionator": "0.8.2", "path-is-inside": "1.0.2", - "pluralize": "4.0.0", + "pluralize": "7.0.0", "progress": "2.0.0", "require-uncached": "1.0.3", - "semver": "5.4.1", + "semver": "5.5.0", + "strip-ansi": "4.0.0", "strip-json-comments": "2.0.1", - "table": "4.0.2", + "table": "4.0.3", "text-table": "0.2.0" }, "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.3.0" + } + }, "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", "dev": true }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "js-yaml": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", - "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", + "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", "dev": true, "requires": { - "argparse": "1.0.9", + "argparse": "1.0.10", "esprima": "4.0.0" } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } } } }, "eslint-config-tui": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/eslint-config-tui/-/eslint-config-tui-1.0.2.tgz", - "integrity": "sha512-4x8Ic5b4L3isL684m+oZjT+l3pb1YetdIfykILggP+R35+vxNAWHzxriT/91RMMhuIY8Ubq6tkTjtio58CT/8A==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/eslint-config-tui/-/eslint-config-tui-1.0.3.tgz", + "integrity": "sha512-81DMKKSVccvkG9YobCBBCIJT+ewYNINo2mIdfeYMvtA/P3g0XEfEFlDix5xN3HP57rVM30Z/Wnzt7q2Z7M4xQw==", "dev": true }, "eslint-loader": { @@ -2107,19 +2209,6 @@ "object-assign": "4.1.1", "object-hash": "1.2.0", "rimraf": "2.6.2" - }, - "dependencies": { - "loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", - "dev": true, - "requires": { - "big.js": "3.2.0", - "emojis-list": "2.1.0", - "json5": "0.5.1" - } - } } }, "eslint-scope": { @@ -2128,17 +2217,23 @@ "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", "dev": true, "requires": { - "esrecurse": "4.2.0", + "esrecurse": "4.2.1", "estraverse": "4.2.0" } }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, "espree": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.2.tgz", - "integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==", + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", "dev": true, "requires": { - "acorn": "5.3.0", + "acorn": "5.5.3", "acorn-jsx": "3.0.1" } }, @@ -2158,13 +2253,12 @@ } }, "esrecurse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", - "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "dev": true, "requires": { - "estraverse": "4.2.0", - "object-assign": "4.1.1" + "estraverse": "4.2.0" } }, "estraverse": { @@ -2277,7 +2371,7 @@ "integrity": "sha1-41xt/i1kt9ygpc1PIXgb4ymeB2w=", "dev": true, "requires": { - "accepts": "1.3.4", + "accepts": "1.3.5", "array-flatten": "1.1.1", "body-parser": "1.18.2", "content-disposition": "0.5.2", @@ -2285,8 +2379,8 @@ "cookie": "0.3.1", "cookie-signature": "1.0.6", "debug": "2.6.9", - "depd": "1.1.1", - "encodeurl": "1.0.1", + "depd": "1.1.2", + "encodeurl": "1.0.2", "escape-html": "1.0.3", "etag": "1.8.1", "finalhandler": "1.1.0", @@ -2296,7 +2390,7 @@ "on-finished": "2.3.0", "parseurl": "1.3.2", "path-to-regexp": "0.1.7", - "proxy-addr": "2.0.2", + "proxy-addr": "2.0.3", "qs": "6.5.1", "range-parser": "1.2.0", "safe-buffer": "5.1.1", @@ -2304,34 +2398,28 @@ "serve-static": "1.13.1", "setprototypeof": "1.1.0", "statuses": "1.3.1", - "type-is": "1.6.15", + "type-is": "1.6.16", "utils-merge": "1.0.1", "vary": "1.1.2" }, "dependencies": { "accepts": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", - "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", "dev": true, "requires": { - "mime-types": "2.1.17", + "mime-types": "2.1.18", "negotiator": "0.6.1" } }, - "finalhandler": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", - "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { - "debug": "2.6.9", - "encodeurl": "1.0.1", - "escape-html": "1.0.3", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "statuses": "1.3.1", - "unpipe": "1.0.0" + "ms": "2.0.0" } }, "negotiator": { @@ -2397,6 +2485,20 @@ "async": "1.5.2", "loader-utils": "0.2.17", "webpack-sources": "0.1.5" + }, + "dependencies": { + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "3.2.0", + "emojis-list": "2.1.0", + "json5": "0.5.1", + "object-assign": "4.1.1" + } + } } }, "extsprintf": { @@ -2406,9 +2508,9 @@ "dev": true }, "fast-deep-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", - "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", "dev": true }, "fast-json-stable-stringify": { @@ -2477,13 +2579,13 @@ } }, "finalhandler": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.6.tgz", - "integrity": "sha1-AHrqM9Gk0+QgF/YkhIrVjSEvgU8=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", + "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", "dev": true, "requires": { "debug": "2.6.9", - "encodeurl": "1.0.1", + "encodeurl": "1.0.2", "escape-html": "1.0.3", "on-finished": "2.3.0", "parseurl": "1.3.2", @@ -2491,6 +2593,15 @@ "unpipe": "1.0.0" }, "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "statuses": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", @@ -2506,7 +2617,7 @@ "dev": true, "requires": { "commondir": "1.0.1", - "make-dir": "1.1.0", + "make-dir": "1.2.0", "pkg-dir": "2.0.0" } }, @@ -2544,7 +2655,7 @@ "dev": true, "requires": { "inherits": "2.0.3", - "readable-stream": "2.3.3" + "readable-stream": "2.3.5" } }, "for-in": { @@ -2621,7 +2732,7 @@ "dev": true, "requires": { "inherits": "2.0.3", - "readable-stream": "2.3.3" + "readable-stream": "2.3.5" } }, "fs-access": { @@ -2642,7 +2753,7 @@ "graceful-fs": "4.1.11", "iferr": "0.1.5", "imurmurhash": "0.1.4", - "readable-stream": "2.3.3" + "readable-stream": "2.3.5" } }, "fs.realpath": { @@ -2658,7 +2769,7 @@ "dev": true, "optional": true, "requires": { - "nan": "2.8.0", + "nan": "2.9.2", "node-pre-gyp": "0.6.39" }, "dependencies": { @@ -3675,9 +3786,9 @@ } }, "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.3.0.tgz", + "integrity": "sha512-kkpcKNlmQan9Z5ZmgqKH/SMbSmjxQ7QjyNqfXVc8VJcoBV2UEg+sxQD15GQofGRh2hfpwUb70VC31DR7Rq5Hdw==", "dev": true }, "globby": { @@ -3738,8 +3849,8 @@ "requires": { "bluebird": "2.11.0", "chalk": "1.1.3", - "commander": "2.13.0", - "is-my-json-valid": "2.17.1" + "commander": "2.15.0", + "is-my-json-valid": "2.17.2" }, "dependencies": { "bluebird": { @@ -3816,9 +3927,9 @@ "dev": true }, "hosted-git-info": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", - "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", + "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", "dev": true }, "html-comment-regex": { @@ -3838,7 +3949,7 @@ "domutils": "1.5.1", "entities": "1.1.1", "inherits": "2.0.3", - "readable-stream": "2.3.3" + "readable-stream": "2.3.5" } }, "http-errors": { @@ -3851,12 +3962,20 @@ "inherits": "2.0.3", "setprototypeof": "1.0.3", "statuses": "1.4.0" + }, + "dependencies": { + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=", + "dev": true + } } }, "http-parser-js": { - "version": "0.4.9", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.9.tgz", - "integrity": "sha1-6hoE+2St/wJC6ZdPKX3Uw8rSceE=", + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.11.tgz", + "integrity": "sha512-QCR5O2AjjMW8Mo4HyI1ctFcv+O99j/0g367V3YoVnrNw5hkDvAWZD0lWGcc+F4yN3V55USPCVix4efb75HxFfA==", "dev": true }, "http-proxy": { @@ -3877,7 +3996,7 @@ "requires": { "http-proxy": "1.16.2", "is-glob": "3.1.0", - "lodash": "4.17.4", + "lodash": "4.17.5", "micromatch": "2.3.11" }, "dependencies": { @@ -3996,12 +4115,12 @@ "dev": true, "requires": { "ansi-escapes": "3.0.0", - "chalk": "2.3.0", + "chalk": "2.3.2", "cli-cursor": "2.1.0", "cli-width": "2.2.0", "external-editor": "2.1.0", "figures": "2.0.0", - "lodash": "4.17.4", + "lodash": "4.17.5", "mute-stream": "0.0.7", "run-async": "2.3.0", "rx-lite": "4.0.8", @@ -4018,29 +4137,29 @@ "dev": true }, "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.3.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "strip-ansi": { @@ -4053,12 +4172,12 @@ } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -4070,9 +4189,9 @@ "dev": true }, "invariant": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", - "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.3.tgz", + "integrity": "sha512-7Z5PPegwDTyjbaeCnV0efcyS6vdKAU51kpEmS7QFib3P4822l8ICYyMn7qvJnc+WzLoDsuI9gPMKbJ8pCu8XtA==", "dev": true, "requires": { "loose-envify": "1.3.1" @@ -4085,9 +4204,9 @@ "dev": true }, "ipaddr.js": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.5.2.tgz", - "integrity": "sha1-1LUFvemUaYfM8PxY2QEP+WB+P6A=", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz", + "integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=", "dev": true }, "is-absolute-url": { @@ -4177,14 +4296,21 @@ "is-extglob": "2.1.1" } }, + "is-my-ip-valid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", + "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", + "dev": true + }, "is-my-json-valid": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.1.tgz", - "integrity": "sha512-Q2khNw+oBlWuaYvEEHtKSw/pCxD2L5Rc1C+UQme9X6JdRDh7m5D7HkozA0qa3DUkQ6VzCnEm8mVIQPyIRkI5sQ==", + "version": "2.17.2", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz", + "integrity": "sha512-IBhBslgngMQN8DDSppmgDv7RNrlFotuuDsKcrCP3+HbFaVivIBU7u9oiiErw8sH4ynx3+gOGQ3q2otkgiSi6kg==", "dev": true, "requires": { "generate-function": "2.0.0", "generate-object-property": "1.2.0", + "is-my-ip-valid": "1.0.0", "jsonpointer": "4.0.1", "xtend": "4.0.1" } @@ -4253,9 +4379,9 @@ "dev": true }, "is-resolvable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.1.tgz", - "integrity": "sha512-y5CXYbzvB3jTnWAZH1Nl7ykUWb6T3BcTs56HUruwBf8MhF56n1HWqhDWnVFo8GHrUPDgvUUNVhrc2U8W7iqz5g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, "is-svg": { @@ -4366,42 +4492,56 @@ "dev": true, "requires": { "convert-source-map": "1.5.1", - "istanbul-lib-instrument": "1.9.1", + "istanbul-lib-instrument": "1.9.2", "loader-utils": "0.2.17", "object-assign": "4.1.1" + }, + "dependencies": { + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "3.2.0", + "emojis-list": "2.1.0", + "json5": "0.5.1", + "object-assign": "4.1.1" + } + } } }, "istanbul-lib-coverage": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz", - "integrity": "sha512-0+1vDkmzxqJIn5rcoEqapSB4DmPxE31EtI2dF2aCkV5esN9EWHxZ0dwgDClivMXJqE7zaYQxq30hj5L0nlTN5Q==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.2.tgz", + "integrity": "sha512-tZYA0v5A7qBSsOzcebJJ/z3lk3oSzH62puG78DbBA1+zupipX2CakDyiPV3pOb8He+jBwVimuwB0dTnh38hX0w==", "dev": true }, "istanbul-lib-instrument": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.1.tgz", - "integrity": "sha512-RQmXeQ7sphar7k7O1wTNzVczF9igKpaeGQAG9qR2L+BS4DCJNTI9nytRmIVYevwO0bbq+2CXvJmYDuz0gMrywA==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.2.tgz", + "integrity": "sha512-nz8t4HQ2206a/3AXi+NHFWEa844DMpPsgbcUteJbt1j8LX1xg56H9rOMnhvcvVvPbW60qAIyrSk44H8ZDqaSSA==", "dev": true, "requires": { - "babel-generator": "6.26.0", + "babel-generator": "6.26.1", "babel-template": "6.26.0", "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "istanbul-lib-coverage": "1.1.1", - "semver": "5.4.1" + "istanbul-lib-coverage": "1.1.2", + "semver": "5.5.0" } }, "jasmine-core": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.8.0.tgz", - "integrity": "sha1-vMl5rh+f0FcB5F5S5l06XWPxok4=", + "version": "2.99.1", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.99.1.tgz", + "integrity": "sha1-5kAN8ea1bhMLYcS80JPap/boyhU=", "dev": true }, "js-base64": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.0.tgz", - "integrity": "sha512-Wehd+7Pf9tFvGb+ydPm9TjYjV8X1YHOVyG8QyELZxEMqOhemVwGRmoG8iQ/soqI3n8v4xn59zaLxiCJiaaRzKA==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.3.tgz", + "integrity": "sha512-H7ErYLM34CvDMto3GbD6xD0JLUGYXR3QTcH6B/tr4Hi/QpSThnCsIp+Sy5FRTw3B0d6py4HcNkW7nO/wdtGWEw==", "dev": true }, "js-tokens": { @@ -4416,7 +4556,7 @@ "integrity": "sha1-XJZ93YN6m/3KXy3oQlOr6KHAO4A=", "dev": true, "requires": { - "argparse": "1.0.9", + "argparse": "1.0.10", "esprima": "2.7.3" } }, @@ -4448,7 +4588,7 @@ "escape-string-regexp": "1.0.5", "js2xmlparser": "3.0.0", "klaw": "2.0.0", - "marked": "0.3.12", + "marked": "0.3.17", "mkdirp": "0.5.1", "requizzle": "0.2.1", "strip-json-comments": "2.0.1", @@ -4488,10 +4628,17 @@ "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", "dev": true, + "optional": true, "requires": { "jsonify": "0.0.0" } }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -4514,7 +4661,8 @@ "version": "0.0.0", "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true + "dev": true, + "optional": true }, "jsonpointer": { "version": "4.0.1", @@ -4555,7 +4703,7 @@ "chokidar": "1.7.0", "colors": "1.1.2", "combine-lists": "1.0.1", - "connect": "3.6.5", + "connect": "3.6.6", "core-js": "2.5.3", "di": "0.0.1", "dom-serialize": "2.2.1", @@ -4569,13 +4717,13 @@ "mime": "1.6.0", "minimatch": "3.0.4", "optimist": "0.6.1", - "qjobs": "1.1.5", + "qjobs": "1.2.0", "range-parser": "1.2.0", "rimraf": "2.6.2", "socket.io": "1.4.7", "source-map": "0.5.7", "tmp": "0.0.28", - "useragent": "2.2.1" + "useragent": "2.3.0" }, "dependencies": { "lodash": { @@ -4663,8 +4811,8 @@ "integrity": "sha1-FRIAlejtgZGG5HoLAS8810GJVWA=", "dev": true, "requires": { - "chalk": "2.3.0", - "log-symbols": "2.1.0", + "chalk": "2.3.2", + "log-symbols": "2.2.0", "strip-ansi": "4.0.0" }, "dependencies": { @@ -4675,29 +4823,29 @@ "dev": true }, "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.3.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "strip-ansi": { @@ -4710,12 +4858,12 @@ } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -4773,6 +4921,18 @@ "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", "dev": true }, + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "3.2.0", + "emojis-list": "2.1.0", + "json5": "0.5.1", + "object-assign": "4.1.1" + } + }, "lodash": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", @@ -4855,7 +5015,7 @@ "integrity": "sha512-KPdIJKWcEAb02TuJtaLrhue0krtRLoRoo7x6BNJIBelO00t/CCdJQUnHW5V34OnHMWzIktSalJxRO+FvytQlCQ==", "dev": true, "requires": { - "errno": "0.1.6", + "errno": "0.1.7", "graceful-fs": "4.1.11", "image-size": "0.5.5", "mime": "1.6.0", @@ -4898,9 +5058,9 @@ "optional": true }, "combined-stream": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "dev": true, "requires": { "delayed-stream": "1.0.0" @@ -4920,8 +5080,8 @@ "optional": true, "requires": { "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.17" + "combined-stream": "1.0.6", + "mime-types": "2.1.18" } }, "har-validator": { @@ -4984,7 +5144,7 @@ "aws-sign2": "0.6.0", "aws4": "1.6.0", "caseless": "0.12.0", - "combined-stream": "1.0.5", + "combined-stream": "1.0.6", "extend": "3.0.1", "forever-agent": "0.6.1", "form-data": "2.1.4", @@ -4994,15 +5154,15 @@ "is-typedarray": "1.0.0", "isstream": "0.1.2", "json-stringify-safe": "5.0.1", - "mime-types": "2.1.17", + "mime-types": "2.1.18", "oauth-sign": "0.8.2", "performance-now": "0.2.0", "qs": "6.4.0", "safe-buffer": "5.1.1", "stringstream": "0.0.5", - "tough-cookie": "2.3.3", + "tough-cookie": "2.3.4", "tunnel-agent": "0.6.0", - "uuid": "3.1.0" + "uuid": "3.2.1" } }, "tunnel-agent": { @@ -5016,9 +5176,9 @@ } }, "uuid": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", "dev": true, "optional": true } @@ -5031,6 +5191,20 @@ "dev": true, "requires": { "loader-utils": "0.2.17" + }, + "dependencies": { + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "3.2.0", + "emojis-list": "2.1.0", + "json5": "0.5.1", + "object-assign": "4.1.1" + } + } } }, "levn": { @@ -5116,15 +5290,14 @@ } }, "loader-utils": { - "version": "0.2.17", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", - "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", "dev": true, "requires": { "big.js": "3.2.0", "emojis-list": "2.1.0", - "json5": "0.5.1", - "object-assign": "4.1.1" + "json5": "0.5.1" } }, "locate-path": { @@ -5138,9 +5311,9 @@ } }, "lodash": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", "dev": true }, "lodash._createcompounder": { @@ -5226,9 +5399,9 @@ "dev": true }, "lodash.merge": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.0.tgz", - "integrity": "sha1-aYhLoUSsM/5plzemCG3v+t0PicU=", + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", + "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==", "dev": true }, "lodash.pick": { @@ -5271,47 +5444,47 @@ } }, "log-symbols": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.1.0.tgz", - "integrity": "sha512-zLeLrzMA1A2vRF1e/0Mo+LNINzi6jzBylHj5WqvQ/WK/5WCZt8si9SyN4p9llr/HRYvVR1AoXHRHl4WTHyQAzQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", "dev": true, "requires": { - "chalk": "2.3.0" + "chalk": "2.3.2" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.3.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5400,9 +5573,9 @@ "dev": true }, "make-dir": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.1.0.tgz", - "integrity": "sha512-0Pkui4wLJ7rxvmfUvs87skoEaxmu0hCUApF8nonzpl7q//FWp9zu8W61Scz4sd/kUiqDxvUhtoam2efDyiBzcA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.2.0.tgz", + "integrity": "sha512-aNUAa4UMg/UougV25bbrU4ZaaKNjJ/3/xnvg/twpmKROPdKZPZ9wGgI0opdZzO8q/zUFawoUuixuOv33eZ61Iw==", "dev": true, "requires": { "pify": "3.0.0" @@ -5415,9 +5588,9 @@ "dev": true }, "marked": { - "version": "0.3.12", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.12.tgz", - "integrity": "sha512-k4NaW+vS7ytQn6MgJn3fYpQt20/mOgYM5Ft9BYMfQJDz2QT6yEeS9XJ8k2Nw8JTeWK/znPPW2n3UJGzyYEiMoA==", + "version": "0.3.17", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.17.tgz", + "integrity": "sha512-+AKbNsjZl6jFfLPwHhWmGTqE009wTKn3RTmn9K8oUKHrX/abPJjtcRtXpYB/FFrwPJRUA86LX/de3T0knkPCmQ==", "dev": true }, "math-expression-evaluator": { @@ -5438,8 +5611,8 @@ "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", "dev": true, "requires": { - "errno": "0.1.6", - "readable-stream": "2.3.3" + "errno": "0.1.7", + "readable-stream": "2.3.5" } }, "meow": { @@ -5525,24 +5698,24 @@ "dev": true }, "mime-db": { - "version": "1.30.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", - "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=", + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", "dev": true }, "mime-types": { - "version": "2.1.17", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", - "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", "dev": true, "requires": { - "mime-db": "1.30.0" + "mime-db": "1.33.0" } }, "mimic-fn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", - "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, "minimatch": { @@ -5551,7 +5724,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.8" + "brace-expansion": "1.1.11" } }, "minimist": { @@ -5561,19 +5734,19 @@ "dev": true }, "mississippi": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-1.3.0.tgz", - "integrity": "sha1-0gFYPrEjJ+PFwWQqQEqcrPlONPU=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-2.0.0.tgz", + "integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==", "dev": true, "requires": { - "concat-stream": "1.6.0", - "duplexify": "3.5.3", + "concat-stream": "1.6.1", + "duplexify": "3.5.4", "end-of-stream": "1.4.1", "flush-write-stream": "1.0.2", "from2": "2.3.0", "parallel-transform": "1.1.0", - "pump": "1.0.3", - "pumpify": "1.3.6", + "pump": "2.0.1", + "pumpify": "1.4.0", "stream-each": "1.2.2", "through2": "2.0.3" } @@ -5614,9 +5787,9 @@ "dev": true }, "nan": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", - "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=", + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.9.2.tgz", + "integrity": "sha512-ltW65co7f3PQWBDbqVvaU1WtFJUsNW7sWWm4HINhbMQIyVyzIeyZ8toX5TC5eeooE6piZoaEh4cZkueSKG3KYw==", "dev": true, "optional": true }, @@ -5659,7 +5832,7 @@ "console-browserify": "1.1.0", "constants-browserify": "1.0.0", "crypto-browserify": "3.3.0", - "domain-browser": "1.1.7", + "domain-browser": "1.2.0", "events": "1.1.1", "https-browserify": "0.0.1", "os-browserify": "0.2.1", @@ -5667,11 +5840,11 @@ "process": "0.11.10", "punycode": "1.4.1", "querystring-es3": "0.2.1", - "readable-stream": "2.3.3", + "readable-stream": "2.3.5", "stream-browserify": "2.0.1", - "stream-http": "2.7.2", + "stream-http": "2.8.0", "string_decoder": "0.10.31", - "timers-browserify": "2.0.4", + "timers-browserify": "2.0.6", "tty-browserify": "0.0.0", "url": "0.11.0", "util": "0.10.3", @@ -5707,10 +5880,10 @@ "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "dev": true, "requires": { - "hosted-git-info": "2.5.0", + "hosted-git-info": "2.6.0", "is-builtin-module": "1.0.0", - "semver": "5.4.1", - "validate-npm-package-license": "3.0.1" + "semver": "5.5.0", + "validate-npm-package-license": "3.0.3" } }, "normalize-path": { @@ -5831,7 +6004,7 @@ "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", "dev": true, "requires": { - "mimic-fn": "1.1.0" + "mimic-fn": "1.2.0" } }, "open": { @@ -5949,7 +6122,7 @@ "requires": { "cyclist": "0.2.2", "inherits": "2.0.3", - "readable-stream": "2.3.3" + "readable-stream": "2.3.5" } }, "parse-glob": { @@ -6106,9 +6279,9 @@ } }, "pluralize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-4.0.0.tgz", - "integrity": "sha1-WbcIwcAZCi9pLxx2GMRGsFL9F2I=", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", "dev": true }, "postcss": { @@ -6118,7 +6291,7 @@ "dev": true, "requires": { "chalk": "1.1.3", - "js-base64": "2.4.0", + "js-base64": "2.4.3", "source-map": "0.5.7", "supports-color": "3.2.3" }, @@ -6312,55 +6485,44 @@ "integrity": "sha1-thTJcgvmgW6u41+zpfqh26agXds=", "dev": true, "requires": { - "postcss": "6.0.16" + "postcss": "6.0.19" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" - }, - "dependencies": { - "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", - "dev": true, - "requires": { - "has-flag": "2.0.0" - } - } + "supports-color": "5.3.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.16", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.16.tgz", - "integrity": "sha512-m758RWPmSjFH/2MyyG3UOW1fgYbR9rtdzz5UNJnlm7OLtu4B2h9C6gi+bE4qFKghsBRFfZT8NzoQBs6JhLotoA==", + "version": "6.0.19", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.19.tgz", + "integrity": "sha512-f13HRz0HtVwVaEuW6J6cOUCBLFtymhgyLPV7t4QEk2UD3twRI9IluDcQNdzQdBpiixkXj2OmzejhhTbSbDxNTg==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.3.2", "source-map": "0.6.1", - "supports-color": "5.1.0" + "supports-color": "5.3.0" } }, "source-map": { @@ -6370,12 +6532,12 @@ "dev": true }, "supports-color": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.1.0.tgz", - "integrity": "sha512-Ry0AwkoKjDpVKK4sV4h6o3UJmNRbjYm2uXhwfj3J56lMVdvnUNqzQVRztOOMGQ++w1K/TjNDFvpJk0F/LoeBCQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -6387,38 +6549,27 @@ "dev": true, "requires": { "css-selector-tokenizer": "0.7.0", - "postcss": "6.0.16" + "postcss": "6.0.19" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" - }, - "dependencies": { - "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", - "dev": true, - "requires": { - "has-flag": "2.0.0" - } - } + "supports-color": "5.3.0" } }, "css-selector-tokenizer": { @@ -6433,20 +6584,20 @@ } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.16", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.16.tgz", - "integrity": "sha512-m758RWPmSjFH/2MyyG3UOW1fgYbR9rtdzz5UNJnlm7OLtu4B2h9C6gi+bE4qFKghsBRFfZT8NzoQBs6JhLotoA==", + "version": "6.0.19", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.19.tgz", + "integrity": "sha512-f13HRz0HtVwVaEuW6J6cOUCBLFtymhgyLPV7t4QEk2UD3twRI9IluDcQNdzQdBpiixkXj2OmzejhhTbSbDxNTg==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.3.2", "source-map": "0.6.1", - "supports-color": "5.1.0" + "supports-color": "5.3.0" } }, "source-map": { @@ -6456,12 +6607,12 @@ "dev": true }, "supports-color": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.1.0.tgz", - "integrity": "sha512-Ry0AwkoKjDpVKK4sV4h6o3UJmNRbjYm2uXhwfj3J56lMVdvnUNqzQVRztOOMGQ++w1K/TjNDFvpJk0F/LoeBCQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -6473,38 +6624,27 @@ "dev": true, "requires": { "css-selector-tokenizer": "0.7.0", - "postcss": "6.0.16" + "postcss": "6.0.19" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" - }, - "dependencies": { - "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", - "dev": true, - "requires": { - "has-flag": "2.0.0" - } - } + "supports-color": "5.3.0" } }, "css-selector-tokenizer": { @@ -6519,20 +6659,20 @@ } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.16", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.16.tgz", - "integrity": "sha512-m758RWPmSjFH/2MyyG3UOW1fgYbR9rtdzz5UNJnlm7OLtu4B2h9C6gi+bE4qFKghsBRFfZT8NzoQBs6JhLotoA==", + "version": "6.0.19", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.19.tgz", + "integrity": "sha512-f13HRz0HtVwVaEuW6J6cOUCBLFtymhgyLPV7t4QEk2UD3twRI9IluDcQNdzQdBpiixkXj2OmzejhhTbSbDxNTg==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.3.2", "source-map": "0.6.1", - "supports-color": "5.1.0" + "supports-color": "5.3.0" } }, "source-map": { @@ -6542,12 +6682,12 @@ "dev": true }, "supports-color": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.1.0.tgz", - "integrity": "sha512-Ry0AwkoKjDpVKK4sV4h6o3UJmNRbjYm2uXhwfj3J56lMVdvnUNqzQVRztOOMGQ++w1K/TjNDFvpJk0F/LoeBCQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -6559,55 +6699,44 @@ "dev": true, "requires": { "icss-replace-symbols": "1.1.0", - "postcss": "6.0.16" + "postcss": "6.0.19" }, "dependencies": { "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" - }, - "dependencies": { - "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", - "dev": true, - "requires": { - "has-flag": "2.0.0" - } - } + "supports-color": "5.3.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "postcss": { - "version": "6.0.16", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.16.tgz", - "integrity": "sha512-m758RWPmSjFH/2MyyG3UOW1fgYbR9rtdzz5UNJnlm7OLtu4B2h9C6gi+bE4qFKghsBRFfZT8NzoQBs6JhLotoA==", + "version": "6.0.19", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.19.tgz", + "integrity": "sha512-f13HRz0HtVwVaEuW6J6cOUCBLFtymhgyLPV7t4QEk2UD3twRI9IluDcQNdzQdBpiixkXj2OmzejhhTbSbDxNTg==", "dev": true, "requires": { - "chalk": "2.3.0", + "chalk": "2.3.2", "source-map": "0.6.1", - "supports-color": "5.1.0" + "supports-color": "5.3.0" } }, "source-map": { @@ -6617,12 +6746,12 @@ "dev": true }, "supports-color": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.1.0.tgz", - "integrity": "sha512-Ry0AwkoKjDpVKK4sV4h6o3UJmNRbjYm2uXhwfj3J56lMVdvnUNqzQVRztOOMGQ++w1K/TjNDFvpJk0F/LoeBCQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -6764,9 +6893,9 @@ "dev": true }, "process-nextick-args": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true }, "progress": { @@ -6792,13 +6921,13 @@ "dev": true }, "proxy-addr": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.2.tgz", - "integrity": "sha1-ZXFQT0e7mI7IGAJT+F3X4UlSvew=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz", + "integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==", "dev": true, "requires": { "forwarded": "0.1.2", - "ipaddr.js": "1.5.2" + "ipaddr.js": "1.6.0" } }, "prr": { @@ -6814,9 +6943,9 @@ "dev": true }, "pump": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", - "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", "dev": true, "requires": { "end-of-stream": "1.4.1", @@ -6824,26 +6953,14 @@ } }, "pumpify": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.3.6.tgz", - "integrity": "sha512-BurGAcvezsINL5US9T9wGHHcLNrG6MCp//ECtxron3vcR+Rfx5Anqq7HbZXNJvFQli8FGVsWCAvywEJFV5Hx/Q==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.4.0.tgz", + "integrity": "sha512-2kmNR9ry+Pf45opRVirpNuIFotsxUGLaYqxIwuR77AYrYRMuFCz9eryHBS52L360O+NcR383CL4QYlMKPq4zYA==", "dev": true, "requires": { - "duplexify": "3.5.3", + "duplexify": "3.5.4", "inherits": "2.0.3", - "pump": "2.0.0" - }, - "dependencies": { - "pump": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.0.tgz", - "integrity": "sha512-6MYypjOvtiXhBSTOD0Zs5eNjCGfnqi5mPsCsW+dgKTxrZzQMZQNpBo3XRkLx7id753f3EeyHLBqzqqUymIolgw==", - "dev": true, - "requires": { - "end-of-stream": "1.4.1", - "once": "1.4.0" - } - } + "pump": "2.0.1" } }, "punycode": { @@ -6859,9 +6976,9 @@ "dev": true }, "qjobs": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.1.5.tgz", - "integrity": "sha1-ZZ3p8s+NzCehSBJ28gU3cnI4LnM=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", + "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", "dev": true }, "qs": { @@ -6946,7 +7063,7 @@ "dev": true }, "raphael": { - "version": "git+https://github.com/nhnent/raphael.git#38d4ba69d2207954c02b6f64369b5405e40c56a6", + "version": "git+https://github.com/nhnent/raphael.git#78a6ed3ec269f33b6457b0ec66f8c3d1f2ed70e0", "requires": { "eve": "git://github.com/adobe-webplatform/eve.git#eef80ed8d188423c2272746fb8ae5cc8dad84cb1" } @@ -7025,15 +7142,15 @@ } }, "readable-stream": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", - "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.5.tgz", + "integrity": "sha512-tK0yDhrkygt/knjowCUiWP9YdV7c5R+8cR0r/kt9ZhBU906Fs6RpQJCEilamRJj1Nx2rWI6LkW9gKqjTkshhEw==", "dev": true, "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", "isarray": "1.0.0", - "process-nextick-args": "1.0.7", + "process-nextick-args": "2.0.0", "safe-buffer": "5.1.1", "string_decoder": "1.0.3", "util-deprecate": "1.0.2" @@ -7047,7 +7164,7 @@ "requires": { "graceful-fs": "4.1.11", "minimatch": "3.0.4", - "readable-stream": "2.3.3", + "readable-stream": "2.3.5", "set-immediate-shim": "1.0.1" } }, @@ -7193,7 +7310,7 @@ "oauth-sign": "0.6.0", "qs": "2.4.2", "stringstream": "0.0.5", - "tough-cookie": "2.3.3", + "tough-cookie": "2.3.4", "tunnel-agent": "0.4.3" }, "dependencies": { @@ -7363,9 +7480,9 @@ } }, "semver": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true }, "send": { @@ -7375,9 +7492,9 @@ "dev": true, "requires": { "debug": "2.6.9", - "depd": "1.1.1", + "depd": "1.1.2", "destroy": "1.0.4", - "encodeurl": "1.0.1", + "encodeurl": "1.0.2", "escape-html": "1.0.3", "etag": "1.8.1", "fresh": "0.5.2", @@ -7389,6 +7506,15 @@ "statuses": "1.3.1" }, "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "mime": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", @@ -7415,25 +7541,34 @@ "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", "dev": true, "requires": { - "accepts": "1.3.4", + "accepts": "1.3.5", "batch": "0.6.1", "debug": "2.6.9", "escape-html": "1.0.3", "http-errors": "1.6.2", - "mime-types": "2.1.17", + "mime-types": "2.1.18", "parseurl": "1.3.2" }, "dependencies": { "accepts": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", - "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", "dev": true, "requires": { - "mime-types": "2.1.17", + "mime-types": "2.1.18", "negotiator": "0.6.1" } }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "negotiator": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", @@ -7448,7 +7583,7 @@ "integrity": "sha512-hSMUZrsPa/I09VYFJwa627JJkNs0NrfL1Uzuup+GqHfToR2KcsXFymXSV90hoyw3M+msjFuQly+YzIH/q0MGlQ==", "dev": true, "requires": { - "encodeurl": "1.0.1", + "encodeurl": "1.0.2", "escape-html": "1.0.3", "parseurl": "1.3.2", "send": "0.16.1" @@ -7699,13 +7834,13 @@ "dev": true, "requires": { "faye-websocket": "0.10.0", - "uuid": "3.1.0" + "uuid": "3.2.1" }, "dependencies": { "uuid": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", - "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", "dev": true } } @@ -7724,6 +7859,15 @@ "url-parse": "1.2.0" }, "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, "faye-websocket": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.1.tgz", @@ -7763,24 +7907,35 @@ "dev": true }, "spdx-correct": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", - "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", "dev": true, "requires": { - "spdx-license-ids": "1.2.2" + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.0" } }, - "spdx-expression-parse": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", - "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", + "spdx-exceptions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", "dev": true }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "2.1.0", + "spdx-license-ids": "3.0.0" + } + }, "spdx-license-ids": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", - "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", "dev": true }, "sprintf-js": { @@ -7823,9 +7978,9 @@ } }, "ssri": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.0.0.tgz", - "integrity": "sha512-728D4yoQcQm1ooZvSbywLkV1RjfITZXh0oWrhM/lnsx3nAHx7LsRGJWB/YyvoceAYRq98xqbstiN4JBv1/wNHg==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.2.4.tgz", + "integrity": "sha512-UnEAgMZa15973iH7cUi0AHjJn1ACDIkaMyZILoqwN6yzt+4P81I8tBc5Hl+qwi5auMplZtPQsHrPBR5vJLcQtQ==", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -7844,7 +7999,7 @@ "dev": true, "requires": { "inherits": "2.0.3", - "readable-stream": "2.3.3" + "readable-stream": "2.3.5" } }, "stream-cache": { @@ -7864,14 +8019,14 @@ } }, "stream-http": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.7.2.tgz", - "integrity": "sha512-c0yTD2rbQzXtSsFSVhtpvY/vS6u066PcXOX9kBB3mSO76RiUQzL340uJkGBWnlBg4/HZzqiUXtaVA7wcRcJgEw==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.0.tgz", + "integrity": "sha512-sZOFxI/5xw058XIRHl4dU3dZ+TTOIGJR78Dvo0oEAejIt4ou27k+3ne1zYmCV+v7UucbxIFQuOgnkTVHh8YPnw==", "dev": true, "requires": { "builtin-status-codes": "3.0.0", "inherits": "2.0.3", - "readable-stream": "2.3.3", + "readable-stream": "2.3.5", "to-arraybuffer": "1.0.1", "xtend": "4.0.1" } @@ -7971,19 +8126,6 @@ "requires": { "loader-utils": "1.1.0", "schema-utils": "0.3.0" - }, - "dependencies": { - "loader-utils": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", - "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", - "dev": true, - "requires": { - "big.js": "3.2.0", - "emojis-list": "2.1.0", - "json5": "0.5.1" - } - } } }, "supports-color": { @@ -8008,52 +8150,63 @@ } }, "table": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", - "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.3.tgz", + "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", "dev": true, "requires": { - "ajv": "5.5.2", - "ajv-keywords": "2.1.1", - "chalk": "2.3.0", - "lodash": "4.17.4", + "ajv": "6.2.1", + "ajv-keywords": "3.1.0", + "chalk": "2.3.2", + "lodash": "4.17.5", "slice-ansi": "1.0.0", "string-width": "2.1.1" }, "dependencies": { + "ajv": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.2.1.tgz", + "integrity": "sha1-KKarxJOiq+D7TIUHrK7bQ/pVBnE=", + "dev": true, + "requires": { + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "1.9.1" } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.2.tgz", + "integrity": "sha512-ZM4j2/ld/YZDc3Ma8PgN7gyAk+kHMMMyzLNryCPGhWrsfAuDVeuid5bpRFTDgMH9JBK2lA4dyyAkkZYF/WcqDQ==", "dev": true, "requires": { - "ansi-styles": "3.2.0", + "ansi-styles": "3.2.1", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.3.0" } }, "has-flag": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", - "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.3.0.tgz", + "integrity": "sha512-0aP01LLIskjKs3lq52EC0aGBAJhLq7B2Rd8HC/DR/PtNNpcLilNmHC12O+hu0usQpo7wtHNRqtrhBwtDb0+dNg==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -8126,7 +8279,7 @@ "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", "dev": true, "requires": { - "readable-stream": "2.3.3", + "readable-stream": "2.3.5", "xtend": "4.0.1" } }, @@ -8137,9 +8290,9 @@ "dev": true }, "timers-browserify": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.4.tgz", - "integrity": "sha512-uZYhyU3EX8O7HQP+J9fTVYwsq90Vr68xPEFo7yrVImIxYvHgukBEgOB/SgGoorWVTzGM/3Z+wUNnboA4M8jWrg==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.6.tgz", + "integrity": "sha512-HQ3nbYRAowdVd0ckGFvmJPPCOH/CHleFN/Y0YQCX1DVaB7t+KFvisuyN09fuP8Jtp1CpfSh8O8bMkHbdbPe6Pw==", "dev": true, "requires": { "setimmediate": "1.0.5" @@ -8173,9 +8326,9 @@ "dev": true }, "tough-cookie": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", - "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "dev": true, "requires": { "punycode": "1.4.1" @@ -8236,13 +8389,13 @@ } }, "type-is": { - "version": "1.6.15", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", - "integrity": "sha1-yrEPtJCeRByChC6v4a1kbIGARBA=", + "version": "1.6.16", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", + "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", "dev": true, "requires": { "media-typer": "0.3.0", - "mime-types": "2.1.17" + "mime-types": "2.1.18" } }, "typedarray": { @@ -8386,21 +8539,13 @@ } }, "useragent": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/useragent/-/useragent-2.2.1.tgz", - "integrity": "sha1-z1k+9PLRdYdei7ZY6pLhik/QbY4=", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/useragent/-/useragent-2.3.0.tgz", + "integrity": "sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw==", "dev": true, "requires": { - "lru-cache": "2.2.4", + "lru-cache": "4.1.1", "tmp": "0.0.33" - }, - "dependencies": { - "lru-cache": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.2.4.tgz", - "integrity": "sha1-bGWGGb7PFAMdDQtZSxYELOTcBj0=", - "dev": true - } } }, "utf8": { @@ -8439,13 +8584,13 @@ "dev": true }, "validate-npm-package-license": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", - "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", + "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", "dev": true, "requires": { - "spdx-correct": "1.0.2", - "spdx-expression-parse": "1.0.4" + "spdx-correct": "3.0.0", + "spdx-expression-parse": "3.0.0" } }, "vargs": { @@ -8585,14 +8730,26 @@ "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", "dev": true }, + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "3.2.0", + "emojis-list": "2.1.0", + "json5": "0.5.1", + "object-assign": "4.1.1" + } + }, "memory-fs": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.3.0.tgz", "integrity": "sha1-e8xrYp46Q+hx1+Kaymrop/FcuyA=", "dev": true, "requires": { - "errno": "0.1.6", - "readable-stream": "2.3.3" + "errno": "0.1.7", + "readable-stream": "2.3.5" } }, "supports-color": { @@ -8666,7 +8823,7 @@ "integrity": "sha1-DL1fLSrI1OWTqs1clwLnu9XlmJI=", "dev": true, "requires": { - "compression": "1.7.1", + "compression": "1.7.2", "connect-history-api-fallback": "1.5.0", "express": "4.16.2", "http-proxy-middleware": "0.17.4", @@ -8708,7 +8865,7 @@ "integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=", "dev": true, "requires": { - "http-parser-js": "0.4.9", + "http-parser-js": "0.4.11", "websocket-extensions": "0.1.3" } }, @@ -8795,9 +8952,9 @@ "dev": true }, "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, "yallist": { diff --git a/package.json b/package.json index 6028c365a..2e99dc2b5 100644 --- a/package.json +++ b/package.json @@ -30,8 +30,8 @@ "cpy-cli": "^1.0.1", "css-loader": "^0.25.0", "es5-shim": "^4.5.9", - "eslint": "4.4.1", - "eslint-config-tui": "^1.0.1", + "eslint": "4.16.0", + "eslint-config-tui": "^1.0.3", "eslint-loader": "^1.9.0", "extract-text-webpack-plugin": "^1.0.1", "istanbul-instrumenter-loader": "^1.0.0", @@ -58,7 +58,7 @@ "webpack-dev-server": "^1.16.2" }, "dependencies": { - "raphael": "https://github.com/nhnent/raphael.git#2.2.0b", + "raphael": "https://github.com/nhnent/raphael.git#2.2.0-c", "tui-code-snippet": "^1.2.5" } } From 44df4dc48c072ccfe1c76c332ea6259b37e4e6d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=84=EC=9A=B0/FE=EA=B0=9C=EB=B0=9C=EB=9E=A9/?= =?UTF-8?q?NE?= Date: Fri, 9 Mar 2018 15:10:26 +0900 Subject: [PATCH 07/13] feat: add spectrum legend reversed option (#770) * feat: add spectrum legend reversed option * feat: add test for reverse option --- src/js/components/legends/spectrumLegend.js | 14 ++++- src/js/plugins/raphaelMapLegend.js | 6 +- .../components/legends/spectrumLegend.spec.js | 61 +++++++++++++++++++ 3 files changed, 78 insertions(+), 3 deletions(-) diff --git a/src/js/components/legends/spectrumLegend.js b/src/js/components/legends/spectrumLegend.js index 724cacd0d..d20144c06 100644 --- a/src/js/components/legends/spectrumLegend.js +++ b/src/js/components/legends/spectrumLegend.js @@ -142,6 +142,11 @@ var SpectrumLegend = snippet.defineClass(/** @lends SpectrumLegend.prototype */ * @private */ _renderTickArea: function(legendSet) { + if (this.options.reversed) { + this.scaleData.labels.sort(function(prev, next) { + return next - prev; + }); + } this.graphRenderer.renderTicksAndLabels(this.paper, this._makeBaseDataToMakeTickArea(), this.scaleData.labels, this.isHorizontal, legendSet); }, @@ -176,7 +181,7 @@ var SpectrumLegend = snippet.defineClass(/** @lends SpectrumLegend.prototype */ * @private */ _renderGraph: function(legendSet) { - var dimension; + var dimension, startForSwap; if (this.isHorizontal) { dimension = this._makeHorizontalGraphDimension(); @@ -184,6 +189,12 @@ var SpectrumLegend = snippet.defineClass(/** @lends SpectrumLegend.prototype */ dimension = this._makeVerticalGraphDimension(); } + if (this.options.reversed) { + startForSwap = this.colorSpectrum.start; + this.colorSpectrum.start = this.colorSpectrum.end; + this.colorSpectrum.end = startForSwap; + } + this.graphRenderer.render(this.paper, { dimension: dimension, position: this.layout.position @@ -249,6 +260,7 @@ var SpectrumLegend = snippet.defineClass(/** @lends SpectrumLegend.prototype */ * @param {number} ratio ratio */ onShowWedge: function(ratio) { + ratio = this.options.reversed ? 1 - ratio : ratio; this.graphRenderer.showWedge(chartConst.MAP_LEGEND_SIZE * ratio); }, diff --git a/src/js/plugins/raphaelMapLegend.js b/src/js/plugins/raphaelMapLegend.js index 5021c69a7..4593d7196 100644 --- a/src/js/plugins/raphaelMapLegend.js +++ b/src/js/plugins/raphaelMapLegend.js @@ -87,7 +87,7 @@ var RaphaelMapLegend = snippet.defineClass(/** @lends RaphaelMapLegend.prototype _renderGradientBar: function(paper, layout, colorSpectrum, isHorizontal) { var rectHeight = layout.dimension.height; var left = layout.position.left; - var degree, bound; + var degree, bound, fill; if (isHorizontal) { rectHeight -= PADDING; @@ -98,6 +98,8 @@ var RaphaelMapLegend = snippet.defineClass(/** @lends RaphaelMapLegend.prototype this._makeWedghPath = this._makeVerticalWedgePath; } + fill = degree + '-' + colorSpectrum.start + '-' + colorSpectrum.end; + bound = { left: left, top: layout.position.top, @@ -106,7 +108,7 @@ var RaphaelMapLegend = snippet.defineClass(/** @lends RaphaelMapLegend.prototype }; return raphaelRenderUtil.renderRect(paper, bound, { - fill: degree + '-' + colorSpectrum.start + '-' + colorSpectrum.end, + fill: fill, stroke: 'none' }); }, diff --git a/test/components/legends/spectrumLegend.spec.js b/test/components/legends/spectrumLegend.spec.js index 64a3c44f7..64cef53f5 100644 --- a/test/components/legends/spectrumLegend.spec.js +++ b/test/components/legends/spectrumLegend.spec.js @@ -50,5 +50,66 @@ describe('Test for SpectrumLegend', function() { done(); }); }); + + it('reverse option is true, labels must be in reverse order', function() { + var paper = raphael(document.createElement('div'), 100, 100); + var legendSet = paper.set(); + + legend.layout = { + dimension: { + height: 200, + width: 100 + }, + position: { + left: 0, + top: 0 + } + }; + legend.scaleData = { + labels: [0, 50, 100, 150, 200], + stepCount: 4 + }; + legend.options.reversed = true; + legend.paper = paper; + + legend._renderTickArea(legendSet); + + expect(legend.scaleData.labels[0]).toBe(200); + }); + }); + + describe('_renderGraph()', function() { + it('reverse option is true, color should look reversed', function() { + var paper = raphael(document.createElement('div'), 100, 100); + var legendSet = paper.set(); + var startColor = '#F4F4F4'; + var endColor = '#345391'; + + legend.layout = { + dimension: { + height: 200, + width: 100 + }, + position: { + left: 0, + top: 0 + } + }; + legend.scaleData = { + labels: [0, 50, 100, 150, 200], + stepCount: 4 + }; + legend.options.reversed = true; + legend.colorSpectrum = { + start: startColor, + end: endColor + }; + legend.paper = paper; + + legend._renderGraph(legendSet); + + expect(legend.colorSpectrum.start).toBe(endColor); + expect(legend.colorSpectrum.end).toBe(startColor); + }); }); }); From 22956f2207b964e699c9794621c0dbf2d3753ca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=84=EC=9A=B0/FE=EA=B0=9C=EB=B0=9C=EB=9E=A9/?= =?UTF-8?q?NE?= Date: Fri, 9 Mar 2018 15:11:18 +0900 Subject: [PATCH 08/13] feat: add axis option showlabel (#771) --- src/js/components/axes/axis.js | 6 ++++-- src/js/models/bounds/axisCalculator.js | 16 ++++++++++++---- test/models/bounds/axisCalculator.spec.js | 16 ++++++++++++++++ 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/js/components/axes/axis.js b/src/js/components/axes/axis.js index 9242e5166..6addf22a9 100644 --- a/src/js/components/axes/axis.js +++ b/src/js/components/axes/axis.js @@ -164,13 +164,15 @@ var Axis = snippet.defineClass(/** @lends Axis.prototype */ { } this._renderTitleArea(); - this._renderLabelArea(size, tickCount, categories, additionalWidth); + + if (this.options.showLabel !== false) { + this._renderLabelArea(size, tickCount, categories, additionalWidth); + } if (!isYAxisLineType) { this._renderTickArea(size, tickCount, additionalWidth); } }, - /** * Render divided xAxis if yAxis rendered in the center. * @param {{width: number, height:number}} dimension axis area width and height diff --git a/src/js/models/bounds/axisCalculator.js b/src/js/models/bounds/axisCalculator.js index 3879319f3..5514f8add 100644 --- a/src/js/models/bounds/axisCalculator.js +++ b/src/js/models/bounds/axisCalculator.js @@ -27,12 +27,17 @@ var axisCalculator = { var titleAreaHeight = titleHeight ? (titleHeight + chartConst.TITLE_PADDING) : 0; var labelMargin = options.labelMargin || 0; var labelHeight = renderUtil.getRenderedLabelHeight(chartConst.MAX_HEIGHT_WORD, theme.label); + var height = titleAreaHeight + chartConst.CHART_PADDING; if (labelMargin > 0) { - labelHeight += labelMargin; + height += labelMargin; } - return titleAreaHeight + labelHeight + chartConst.CHART_PADDING; + if (options.showLabel !== false) { + height += labelHeight; + } + + return height; }, /** @@ -66,8 +71,11 @@ var axisCalculator = { width += labelMargin; } - width += renderUtil.getRenderedLabelsMaxWidth(labels, theme.label) + titleAreaWidth + - chartConst.AXIS_LABEL_PADDING; + if (options.showLabel !== false) { + width += renderUtil.getRenderedLabelsMaxWidth(labels, theme.label); + } + + width += titleAreaWidth + chartConst.AXIS_LABEL_PADDING; return width; } diff --git a/test/models/bounds/axisCalculator.spec.js b/test/models/bounds/axisCalculator.spec.js index 821b06029..a47207d48 100644 --- a/test/models/bounds/axisCalculator.spec.js +++ b/test/models/bounds/axisCalculator.spec.js @@ -26,6 +26,11 @@ describe('Test for axisCalculator', function() { var actual = axisCalculator.calculateXAxisHeight({title: 'Axis Title', labelMargin: 30}, {}); expect(actual).toBe(90); }); + + it('showlabel option is false, it should be reflected in the width of the label width', function() { + var actual = axisCalculator.calculateXAxisHeight({title: 'Axis Title', showLabel: false}, {}); + expect(actual).toBe(40); + }); }); describe('calculateYAxisWidth()', function() { @@ -71,5 +76,16 @@ describe('Test for axisCalculator', function() { expect(actual).toBe(117); }); + + it('showlabel option is false, it should be reflected in the width of the label width', function() { + var actual; + + actual = axisCalculator.calculateYAxisWidth(['label1', 'label12'], { + title: 'Axis Title', + showLabel: false + }, {}); + + expect(actual).toBe(37); + }); }); }); From c89bef892917991b2b9ee06753581bbbbc9bb2eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=84=EC=9A=B0?= Date: Tue, 13 Mar 2018 12:37:22 +0900 Subject: [PATCH 09/13] chore: v2.17.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2e99dc2b5..f568c0874 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tui-chart", "author": "NHN Ent. FE Development Lab ", - "version": "2.16.0", + "version": "2.17.0", "main": "dist/tui-chart", "license": "MIT", "description": "TOAST UI Application: Chart", From 94b2d4a9da6710985c8371f22a6f4385379e9990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=84=EC=9A=B0?= Date: Tue, 13 Mar 2018 14:12:28 +0900 Subject: [PATCH 10/13] chore: package-lock --- package-lock.json | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index a2ce586dc..5310d10d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tui-chart", - "version": "2.16.0", + "version": "2.17.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2279,9 +2279,6 @@ "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", "dev": true }, - "eve": { - "version": "git://github.com/adobe-webplatform/eve.git#eef80ed8d188423c2272746fb8ae5cc8dad84cb1" - }, "eventemitter3": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz", @@ -7066,6 +7063,11 @@ "version": "git+https://github.com/nhnent/raphael.git#78a6ed3ec269f33b6457b0ec66f8c3d1f2ed70e0", "requires": { "eve": "git://github.com/adobe-webplatform/eve.git#eef80ed8d188423c2272746fb8ae5cc8dad84cb1" + }, + "dependencies": { + "eve": { + "version": "git://github.com/adobe-webplatform/eve.git#eef80ed8d188423c2272746fb8ae5cc8dad84cb1" + } } }, "raw-body": { From 03596631c56277c00c92315cff0eb80a47e0dc1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=84=EC=9A=B0?= Date: Tue, 13 Mar 2018 14:16:21 +0900 Subject: [PATCH 11/13] chore: add dist --- .gitignore | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 91bf689a8..3b28b2ccd 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ pids *.seed # Compiled files -dist +# dist # Coverage directory used by tools like istanbul coverage @@ -17,7 +17,7 @@ coverage build/Release # Distribution directory -dist +# dist # Dependency directory node_modules From 90b5ee10f962756c3f5d6280219626acf365d295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=84=EC=9A=B0?= Date: Tue, 13 Mar 2018 14:16:48 +0900 Subject: [PATCH 12/13] chore: add dist --- dist/maps/china.js | 10 + dist/maps/japan.js | 10 + dist/maps/singapore.js | 10 + dist/maps/south-korea.js | 10 + dist/maps/taiwan.js | 10 + dist/maps/thailand.js | 10 + dist/maps/usa.js | 10 + dist/maps/world.js | 11 + dist/tui-chart.css | 704 + dist/tui-chart.js | 40782 +++++++++++++++++++++++++++++++++++++ dist/tui-chart.min.css | 10 + dist/tui-chart.min.js | 21 + 12 files changed, 41598 insertions(+) create mode 100644 dist/maps/china.js create mode 100644 dist/maps/japan.js create mode 100644 dist/maps/singapore.js create mode 100644 dist/maps/south-korea.js create mode 100644 dist/maps/taiwan.js create mode 100644 dist/maps/thailand.js create mode 100644 dist/maps/usa.js create mode 100644 dist/maps/world.js create mode 100644 dist/tui-chart.css create mode 100644 dist/tui-chart.js create mode 100644 dist/tui-chart.min.css create mode 100644 dist/tui-chart.min.js diff --git a/dist/maps/china.js b/dist/maps/china.js new file mode 100644 index 000000000..fa41ea072 --- /dev/null +++ b/dist/maps/china.js @@ -0,0 +1,10 @@ +/** + * https://www.amcharts.com/svg-maps/?map=china + * map data by amcharts team + */ +'use strict'; + +(function(tuiChart) { + var data = [{"code":"CN-AH","name":"Anhui","path":"M541.02,336.29L541.71,336.09L543.77,338.27L543.53,338.58L545.92,338.99L546.76,340.12L548.44,340.06L548.55,341.76L549.62,342.38L549.24,343.35L550.58,344.54L551.35,344.98L553.38,344.66L554.17,345.63L555.37,345.08L556.2,346.28L556.8,345.6L557.82,347.73L558.51,347.76L558.17,350.15L560.8,350.12L561.12,349.61L563.89,349.94L562.98,351.84L562.99,353.94L562.06,353.97L560.77,357.72L561.33,357.73L562.06,359L563.49,358.5L563.75,357.85L564.17,358.09L564.64,361.19L565.52,361.68L564.51,362.21L564.67,363.38L565.17,363.21L565.35,364.41L566.19,364.53L566.23,365.29L569.63,364.91L570.56,365.3L571.08,364.96L570.95,363.35L571.8,363.24L572.34,361.72L574.42,361.71L574.42,362.52L575.54,363.71L576.52,363.63L577.12,366.98L576.92,367.48L576.48,367.11L576.07,368.69L575.27,369.28L574.63,368.34L573.95,368.48L572.81,367.73L572.98,367.22L568.79,367.27L569.11,368.9L570.26,368.96L570.47,370.97L569.84,371.57L569.93,372.77L567.97,373.13L567.87,374.18L566.53,374.8L566.23,376.97L567.97,378.31L567.71,378.99L568.26,379.8L569.51,379.48L570.12,379.99L569.89,381.28L570.75,381.42L571.35,380.69L571.68,381.56L572.49,381.6L572.58,384.48L570.45,386.31L571.53,387.37L575.34,387.32L576.48,386.31L577.75,387.06L578.55,386.9L578.72,386.35L579.14,388.12L582.26,388.74L582.26,388.74L581.47,393.15L580.4,393.97L579.82,395.87L579.08,395.35L578.2,396.29L577.28,396.38L577.29,397.52L578.35,397.61L579.28,399.98L577.41,400.34L577.11,401.08L574.8,400.87L573.67,400.08L572.75,400.72L573.27,402.26L572.33,403.02L572.9,403.12L572.9,406.09L571.14,407.62L570.94,409.22L568.54,410.96L567.72,412.46L566.65,412.91L565.57,412.67L565.46,413.7L564.67,413.56L564.03,414.13L564.03,414.13L563.23,413.7L563.3,412.5L561.74,411.47L557.87,411.88L557.23,410.94L555.76,411.18L555.63,410.36L554.66,409.87L554.24,407.54L553.46,408.06L553.18,407.52L552.19,407.79L552.13,406.67L551.61,406.4L549.85,407.78L550.64,408.52L550.35,409.52L548.88,409.93L546.92,411.56L545.91,411.15L545.41,411.64L544.54,410.6L544.91,410.04L544.56,409.77L546.56,408.07L547.67,406.07L544.73,404.27L543.76,404.56L543.09,406.83L542.24,406.82L539.6,408.5L538.88,407.79L538,407.92L538,407.92L537.23,405.88L537.12,402.37L536.06,401.04L535.09,400.83L534.83,399.78L535.59,399.16L534.97,398.75L535.21,397.8L533.26,395.38L533.52,394.35L534.62,394.05L534.62,392.72L537.23,391.28L536.87,390.53L535.54,390.11L534.7,388.6L533.39,389.1L531.94,387.66L530.97,388.6L530.32,387.03L529.52,386.78L528.33,384.83L528.33,384.83L528.41,383.41L529.8,381.78L529.94,380.84L532.2,379.27L533.94,379.57L535.17,379.04L535.49,373.58L534.78,368.75L534.3,368.46L535.34,367.54L533.5,369.09L533.31,368.51L533.16,368.93L532.38,368.65L532,369.91L530.61,370.02L528.8,367.47L527.48,367.8L527.47,367.3L526.14,367.25L526.14,363.27L522.15,361.35L522.76,360.8L522.44,359.18L522.85,358.72L524.05,359.8L525.49,359.83L527.33,359.09L528.25,356.19L527.62,355.4L528.01,353.55L528.68,353.53L528.87,352.71L531.71,352.3L530.81,349.43L531.44,349.31L531.64,347.98L530.57,347.83L531.23,345.53L531.87,345.02L533.86,344.93L534.43,345.96L534.87,345.52L535.88,345.99L536.09,347.44L537.04,348.1L537.23,349.32L538.33,350.45L541.8,348.99L541.87,348.25L543.42,347.42L544.39,347.69L544.48,346.42L542.96,344.27L543.61,341.8L540.93,341.91L540.88,341.21L538.99,340.21L538.31,338.99L538.71,337.22L538.71,337.22L539.3,337.63z"},{"code":"CN-BJ","name":"Beijing","path":"M546.46,257.82L545.19,257.69L545.32,258.18L543.54,257.65L541.38,259.38L542.02,260.56L540.61,260.4L538.66,258.32L536.13,258.13L535.82,258.52L535.34,258.01L533.87,259.42L533.2,259.42L532.34,257.98L530.81,258.02L529.74,257.1L529.84,255.69L529,255.13L530.84,254.47L530.2,254L530.15,252.87L528.99,252.2L529.29,251L531.38,249.47L533.13,249.19L533.53,248.49L534.28,249.13L534.78,247.81L535.79,247.12L535.17,245.59L533.4,244.1L533.46,243.33L532.94,243.15L533.23,242.5L535.15,241.24L536.1,241.87L537.59,241.28L539.29,238.42L540,238.94L541.47,238.45L542.04,238.74L540.53,236.05L542.23,236.64L541.97,235.28L543.78,235.25L544.4,233.9L545.04,234.33L544.79,235.26L545.4,236.52L547.05,237.66L548.92,239.98L550.77,239.84L552.86,240.63L555.26,240.44L555.25,240.92L554.36,240.98L554.53,241.89L552.78,241.9L551.46,243.23L551.74,245.25L553.79,247.69L553.79,247.69L553.79,248.62L551.45,250.07L551.45,250.07L548.96,250.95L546.19,250.97L546.21,253.02L547.91,253.88L548.31,254.99L547.66,256.41L547.66,256.41z"},{"code":"CN-CQ","name":"Chongqing","path":"M441.77,372.89L443.66,374.38L444.63,374.41L446.44,376.09L448.29,376.53L450.34,378.61L451.33,378.94L451.5,380.2L455.19,379.99L455.19,379.99L457.11,380.46L457.05,382.61L458.18,382.41L460.2,383.16L459.82,383.71L462.29,384.97L462.95,388.58L462.01,389.34L462.62,390.98L461.5,393.66L460.76,393.21L460.54,392.23L457.68,392.95L455.18,395.81L454.67,395.53L453.63,396.3L452.22,398.17L451.71,396.13L449.61,397.59L448.96,397.13L449.33,395.92L448.36,395.81L445.63,398.13L444.48,398.09L443.95,396.8L443.22,396.85L443.39,397.48L442.46,398.45L440.59,398.26L440.29,399.7L442.47,401.76L441.57,404.6L442.02,405.51L441.8,407.26L440.72,407.05L440.05,408.02L440.53,408.06L440.75,409.2L441.64,409.55L442.7,407.43L443.53,407.5L443.8,409.82L444.8,410.48L445.17,410.11L445.21,410.67L445.95,410.43L446.2,411.24L446.63,411.22L446.13,413.01L447.06,413.79L446.76,415.14L448.73,414.13L449.56,415.99L449.27,416.9L450.8,418.06L450.8,418.06L451.9,419.15L450.84,421.56L450.91,422.98L451.7,423.65L450.18,425.23L451.9,425.65L451.32,426.94L451.32,426.94L449.8,428.24L449.02,431.36L448.2,431.08L447.79,431.79L445.46,430.62L444.83,431.27L444.38,430.29L444.98,429.63L445.02,427.91L444.28,426.98L443.36,427.48L443.93,428.36L443.73,429.24L442.52,428.97L442.87,428.1L442.47,426.47L442.96,426.35L443.25,424.97L442.5,424.63L441.21,425.13L439.53,424.46L440.11,422.81L439.1,418.62L438.23,419.37L437.7,418.81L436.07,418.6L435.39,419.47L434.6,419.32L433.29,420.37L432.18,417.14L431.24,417.77L430.07,417.41L429.74,416.67L428.75,417.32L428.32,416.89L427.78,417.16L427.94,418.15L427.34,418.35L427.24,419.68L428.15,420.59L426.72,422.44L425.6,423.08L424.2,421.39L422.77,421.44L422.44,422.98L421.3,422.45L420.51,423.08L420.33,423.54L421.12,424.35L420.36,425.64L419.74,425.19L419.15,427.56L417.52,426.8L417.16,427.12L418.25,424.66L417.29,424.25L417.46,423.84L415.93,422.16L415.69,422.91L416.55,424.48L415.87,425.76L416.27,426.41L415.04,425.91L414.72,426.56L414.72,426.56L414.16,426.17L414.22,425.02L412.7,421.31L410.57,421.13L410.54,420.52L409.78,420.07L408.73,421.22L407.47,420.67L406.42,418.33L406.1,415.66L405.58,416.18L403.09,415.63L402.6,414.85L402.81,413.97L402.19,413.33L401.4,413.4L401.29,411.09L401.63,411.29L402.57,409.98L403.29,410.06L403.4,409.44L404.47,409.24L405.03,407.77L406.52,407.46L406.71,404.97L404.12,402.85L405.61,402.33L405.17,401.36L406.53,401.64L406.69,400.13L407.78,399.06L408.01,399.66L408.59,399.41L411.76,400.73L412.98,402.66L413.78,401.94L415.38,401.74L415.6,401.07L417.08,400.92L418.06,401.45L417.75,402.13L419.42,404.94L421.64,404.87L422.26,404.15L422.84,404.83L423.5,404.51L425.51,402.07L429.03,396.06L427.94,394.53L429.05,393.11L429.96,392.94L430.66,393.51L431.68,392.45L432.26,393.49L433.62,393.59L434.99,392.14L434.43,391.87L434.53,391.04L435.94,390L435.38,389.14L436.34,387.67L435.56,387.52L435.57,387.1L437.53,385.87L437.2,385.24L438.09,383.93L437.7,383.47L439.38,383.25L440.68,381.44L441.3,381.59L442.02,380.82L441.93,379.55L439.67,378.05L438.57,376.47L439.84,376.19L439.59,374.88L440.88,374.99L439.99,373.24z"},{"code":"CN-FJ","name":"Fujian","path":"M553.98,493.05l0.46,0.69l1.04,-0.25l0.06,0.51l-0.4,-0.1l0.03,0.89l-0.8,0.01l0.15,1l-1.5,0.13l1.3,-1.37l-1.02,-0.2L553.98,493.05zM580.19,472.65l1.32,0.7l-0.29,0.6l-1.37,-0.55L580.19,472.65zM584.11,466.98l0.02,0.78l1.34,0.62l-0.98,0.37l-0.04,0.63l0.67,0.36l-1.27,0.4l-0.08,0.58l-1.02,-1.06l0.88,-0.53l-0.1,-1.17l-0.35,0.3l-0.17,-0.4L584.11,466.98zM563.7,480.63l-0.76,1.42l1.13,0.75l-0.26,1l-1.11,0.28l-0.25,-1.87l-0.46,0.42l0.48,0.5l-0.78,0.34l0.39,0.47l-1.57,-0.45l-0.31,0.69l0.21,0.47l2.03,-0.21l-0.51,0.8l0.93,-0.08l0.49,1.05l-1.47,1.08l-0.28,-0.29l-0.17,0.57l-0.49,-0.56l-0.45,0.49l0.42,0.32l-0.49,1.75l-0.94,0.27l-1.12,1.54l0.8,-1.89l-1.42,0.37l0.16,0.87l-0.88,0.8l0.1,1.37l-0.67,1.03l0.17,-2.5l-2.11,-0.78l-0.27,0.49l0.81,0.18l0.19,1.12l-0.71,0.95l-0.46,-0.47l-1.71,0.85l0.18,1.3l-1.21,0.21l0,0l-1.81,-1.24l-0.99,-2.66l0.14,-1.31l-0.7,-1.21l0.87,-1.29l-0.74,-0.59l-1.1,-3.48l-1.16,-0.95l0.52,-1.83l-3.51,0.95l-0.38,-1.43l-1.44,-1.23l0.53,-0.54l-0.3,-0.47l-1.9,1.13l-0.59,-1l-1.59,0.17l-0.59,-0.69l-1.8,-0.46l0,0l0.28,-0.71l-0.39,-0.49l0.73,-0.45l-0.95,-2.2l1.97,-1.56l-0.25,-1.93l0.85,-1.49l-0.05,-1.67l1.56,-1.21l-0.61,-1.17l2.98,-1.49l0.3,-1.05l1.23,-0.99l-0.26,-0.9l-0.9,-0.1l0.04,-1.21l1.5,-1.86l1.05,0.35l0.46,-1.29l-1.23,-1.37l0.37,-1.09l-0.72,-0.93l0.59,-0.83l-0.13,-1.03l1.85,-2.07l3.1,-0.5l1.35,-1.08l0.21,-1.04l1.31,-1.44l-0.8,-0.84l0.11,-2.28l-0.41,-1.02l-0.75,0.05l-0.04,-1.25l0.51,-0.31l0.53,0.63l0.09,-0.8l1.22,-0.02l1.22,-1.28l-0.17,-1.37l0.49,-0.41l0.21,0.61l2.28,-1.87l1.03,1.68l1.62,0.96l1.57,-2.04l2.18,-0.58l0.82,0.35l0.4,-1.31l2.8,-0.59l0.34,-1.29l-0.68,-0.53l1.38,-0.91l0,0l0.77,0.73l0.12,-0.58l0.98,-0.14l0.38,0.5l1.28,-0.79l1.19,0.94l-0.46,0.92l0.38,0.84l-1.02,0.95l0.14,1.11l1.11,0.95l1.01,2.77l-0.18,2.81l0,0l0.3,0.73l0.7,0.05l0,0l0.64,-0.51l1.42,0.18l0.09,0.7l1.43,0.18l1.67,-1.61l0.95,0.3l0.54,-2.04l0.56,0.18l0.23,-0.45l1.04,0.08l-0.1,1.1l0.97,1.22l0,0l-0.2,1.09l1.15,1.43l0,0l-0.15,0.31l2.17,-0.11l0.8,-0.92l0.4,0.54l1.3,-1.1l1.38,-0.18l0.38,0.55l0,0l0.84,-0.07l0.15,0.76l0,0l0.89,1.19l-0.28,0.25l0,0l0.19,1.17l-0.58,-1.22l-0.87,0.13l0.07,-0.84l-0.81,-0.09l0.06,0.6l-0.64,-0.22l-0.06,1.03l0.39,-0.66l1.96,0.4l0.66,1.24l-0.72,0.61l-1.44,-0.29l0.09,1.64l-1.19,0.33l0.73,0.13l-0.03,0.71l-1.39,-0.27l-0.28,0.8l-0.56,-0.27l-0.09,0.97l1.15,0.41l-0.54,0.58l0.8,0.41l-0.7,0.5l0.42,0.63l-0.53,0.42l-0.19,-0.43l-1.56,0.55l-0.89,1.3l-0.74,-0.16l0.21,-0.83l1.44,-0.59l1.53,-2.24l-1.9,0.21l-0.74,1.8l-0.4,-0.89l-0.63,-0.01l0.71,-1.38l-0.6,0.26l-0.24,-0.58l-0.64,1.79l-1.43,-0.75l0.11,-0.57l-0.52,0.26l0.99,0.77l-0.58,1.17l-0.61,0.09l0.39,0.46l1.74,-0.16l0.59,0.44l-0.21,0.46l0.84,1.39l-0.72,0.37l-1.6,-1l-0.74,0.77l0.97,0.23l0.29,1.09l1.9,-1.17l0.28,1.1l1.25,-0.35l-0.92,0.77l-1.19,0.14l0.12,0.5l-1.96,0.02l0.18,0.88l-1.87,2l2.57,0.92l-0.37,1.25l-0.76,0.23l-0.36,2.91l-1.56,0.7l0.4,0.99l1.03,-0.32l0.3,0.42l-0.44,0.67l0.97,1.23l0.03,0.99l-0.78,0.21l-0.19,-1.65l-0.66,0.66l0.6,0.15l-0.76,0.27l-0.93,-1.28l0.23,-0.36l-1.38,-0.58l-0.04,1.47l-0.63,0.26l-0.47,-1.09l-1.41,1.43l0.8,0.41l0.09,1.22l0.43,-0.79l1.4,0.89l-0.87,0.34l-0.08,0.79l-1.38,0.06l-0.66,-0.6l-0.38,0.55l0.84,0.69l-0.75,0.34l-0.92,-0.36l0.6,-1.37l-1.24,0.15l0.18,-0.59l0.77,-0.07l-2.05,0.16l0.3,0.87l0.83,0.03l-0.54,0.75l0.39,0.34l-1.19,-0.06l-0.36,0.5l1.4,1.15l0.72,-0.78l-0.4,1.05l0.72,0.21l-1.56,0.11l-0.05,0.65l0.93,0.5l-1.41,-0.26l-1.65,0.65l-0.69,-0.58l-0.6,0.54l0.2,0.81l0.85,-0.25l0.08,0.53l0.66,0.04l-0.81,1.31l-0.84,-0.04l0.41,1.01l-1.03,1.15l-0.4,-0.92l-1.5,-0.75l-0.13,-0.83l-0.25,1.36l-1.65,0.03l-0.81,0.91l-0.47,-0.41l0.26,-1.2L563.7,480.63z"},{"code":"CN-GD","name":"Guangdong","path":"M496.82,520.43l-0.91,1.14l0.15,1.36l-0.55,0.29L495,522.6l0.7,-0.85l-1,-0.33L496.82,520.43zM502.06,518.75l-0.21,-0.71l-0.51,0.12l0.02,0.7L502.06,518.75zM468.39,528.06l-1.21,0.23l0.11,1.37L468.39,528.06zM468.22,532.68l0.41,-0.93l-0.54,-0.28l-0.45,1.15L468.22,532.68zM494.13,522.29L494,521.2l-0.76,0.31l-0.83,1.42L494.13,522.29zM549.8,494.91l0.22,1.42l1.32,-1.04l0,0l-1.81,-1.24l-0.99,-2.66l0.14,-1.31l-0.7,-1.21l0.87,-1.29l-0.74,-0.59l-1.1,-3.48l-1.16,-0.95l0.52,-1.83l-3.51,0.95l-0.38,-1.43l-1.44,-1.23l0.53,-0.54l-0.3,-0.47l-1.9,1.13l-0.59,-1l-1.59,0.17l-0.59,-0.69l-1.8,-0.46l0,0l0.23,0.8l-1.06,-0.34l-0.76,2.17l1.01,2.5l-1.5,0.34l-0.54,-0.8l-1.3,-0.33l-1.18,-1.89l-0.79,-0.3l-3.83,1.63l-0.56,-0.59l-2,0.59l-0.52,1.42l-1.57,-0.73l-0.46,1.16l-0.64,-0.67l-2.88,1.26l-0.94,-1.39l-0.62,0.21l-0.36,-0.77l-1.33,-0.62l1.98,-1.04l0.87,-1.8l-0.06,-1.03l1.75,-0.98l0.36,-0.87l1.09,0.11l1.04,-0.59l-0.62,-0.74l0.7,-1.49l-2.56,-1.93l-1.87,1.4l-3.33,0.08l-1.13,0.8l0.07,-1.51l-0.95,-1.31l0,0l-0.95,0.29l-0.83,1.47l-0.7,0.03l-0.16,-0.48l-2.23,0.69l-0.49,-0.73l-2.15,-0.48l-0.79,-0.65l-0.13,-1.02l-1.74,0.45l-0.4,1.05l-1.42,0.91l-1.09,0.56l-0.86,-0.38l0.08,1.19l1.41,-0.09l0.68,0.82l-0.85,0.53l0.58,1.01l-0.44,0.81l0.37,1.32l-1.84,0.46l-1.03,0l-1.55,-3.25l-1.46,0.06l-1.22,-0.77l-0.6,0.55l-0.44,-0.69l-1.29,0.45l-0.65,-0.59l-1.17,3.03l0.72,0.96l-0.23,1.05l-1.68,1.38l0,0l-0.8,0.33l-0.4,1.18l0.95,1.13l-0.2,1.11l0.94,1.54l-1.03,1.34l-1.37,0.66l0.72,3.35l-0.95,0.25l-0.61,1.85l-2,-0.07l-0.38,1.21l0.62,0.24l-0.62,0.95l-1.62,0.18l-0.1,1.16l-0.99,1.05l-0.57,2.51l0.52,1.64l-0.25,0.99l0.66,0.77l-0.89,1.01l-0.03,0.98l-1.77,1.94l-2,0.26l0.4,0.47l-0.43,0.58l-3.18,1.27l-0.44,-0.31l-0.32,1.56l-0.74,-0.05l0.33,1.44l0.94,1.12l-1.12,0.1l-0.74,1.71l-0.85,-0.61l-0.8,0.64l-1.1,-0.82l-0.55,0.55l-0.45,-0.34l0.46,4.14l-1,-0.36l-0.67,0.5l-3.33,-0.03l-1.01,3.01l-1.29,0.24l-0.36,-0.47l-0.25,1.39l0,0l0.66,1.45l1.79,0.29l-0.37,1.13l-1.95,0.15l0.15,1.74l-1.22,1.34l0.46,0.79l-0.58,2.17l1.32,2.6l-0.35,1l1.07,0.7l0.04,1.05l2.37,0.76l-0.48,0.82l-0.94,-0.7l-0.63,0.4l0.91,0.9l-0.09,1.56l0.85,-0.96l1.81,0.69l2.21,-0.21l1.68,-0.94l1.19,-1.99l-0.88,-2.66l-1.62,-0.31l-0.08,-0.56l0.74,0.4l-0.01,-1.48l-2.42,-0.54l-0.4,-1.67l1.64,-1.48l-1.15,2.03l3.31,-0.69l0.76,0.93l0.29,-1.9l-2.77,-0.09l1.11,-1.61l2.72,-0.47l1.78,-2.28l1.45,0.17l2.45,-1.08l-0.86,-0.14l0.23,-0.71l0.87,0.9l2.36,-0.42l-0.38,1.04l2.4,-1.99l0.34,0.78l2.17,-0.15l1.73,-1.92l0.06,-0.72l-1.13,-0.85l1.21,-0.07l0.81,1.48l0.68,-0.28l-0.25,0.6l-0.68,-0.06l-0.32,1.23l0.62,-0.04l1.99,-0.96l-1.11,-0.25l0.01,-0.87l2.38,-1.14l0.98,0.06l0.84,1.27l1.77,-0.47l0.24,-1.23l2.37,0.83l2.28,-2.46l0.99,0.27l0.7,0.98l1.33,-1.29l-0.29,-2.04l0.99,-0.92l0.02,-0.75l0.25,2.07l1.04,1.58l1.04,-1.4l1.26,0.91l0.56,-1.07l-0.46,-0.27l0.26,-1.36l1.27,1.59l0.6,-0.54l-0.39,-0.79l0.91,-0.96l-0.25,-0.81l0.73,-1.03l-1.03,-0.23l0.01,-0.5l1.43,-2.35l-1.24,-1.82l0.74,-0.32l-0.1,-0.64l0.73,0.83l1.09,0.14l1.16,2.4l0.69,0.35l-0.49,0.46l0.31,0.56l0.63,-0.9l1.33,0.25l0,0l1.51,-0.77l0.82,0.23l0,0l2.14,-0.93l1.13,1.06l0.2,1.17l1.38,-0.65l-0.83,-1.01l-0.59,0.23l1.23,-1.36l-1.2,0.09l0.26,-0.82l0.65,0.27l-0.08,-0.75l2.51,-0.58l0.2,-0.7l0.54,0.64l-1.03,0.65l-0.04,1.84l1.8,0.2l0.02,0.66l1.06,-1.94l-1.05,-0.33l-0.32,-0.78l1.04,-0.01l0.46,1.1l0.61,-0.25l0.32,-1.12l1.2,-0.34l0.39,0.49l0.43,-0.77l0.53,0.15l-0.32,0.56l2.41,-0.07l-0.3,0.54l-0.61,-0.16l0.04,0.64l2.73,0.85l0.43,-1.39l-0.6,-0.02l-0.12,0.56l-0.37,-0.6l1.51,-1.57l1.53,0.34l0.73,1.43l2.24,-1.28l1.82,-0.05l1.87,-1.63l2.67,0.27l0.78,-1.2l-0.04,-1.86l1.19,-0.05l0.81,-1.07l0.98,0.44l-0.52,-1.79l1.34,-1.23l0.35,-1.68l1,0.11l-0.45,-0.67L549.8,494.91zM548.72,497.44l-0.48,0.49l2.31,0.49l0.35,-0.76l-0.33,-0.53l-1.42,0.63L548.72,497.44z"},{"code":"CN-GA","name":"Gansu","labelCoordinate":{"x":0.5,"y":0.4},"path":"M298.61,204.91L306.89,223.83L304.01,227.2L308.57,233.27L308.96,233.11L313.36,236.83L313.58,237.59L312.15,242.77L317.1,242.49L319.89,238.99L323.81,237.13L328.73,237.39L330.11,235.99L335.37,236.82L337.05,239.5L337.21,241.51L334.44,244.88L333.01,247.94L329.37,250.38L327.27,253.46L331.21,253.3L334.35,255.69L337.35,256.55L338.23,259.31L340.52,259.94L340.5,261.27L344.9,261.29L344.96,267.55L346.06,266.98L347.02,268.43L349.6,267.35L349.04,268.47L349.89,269.8L351.01,270.18L350.96,271.25L353.52,272.17L354.61,273.2L355.36,272.71L356.64,273.15L357.61,272.91L357.74,272.19L360.47,269.41L357.12,266.08L361.99,264.97L365.22,263.62L367.13,264.79L372.12,266.08L376.66,262.12L382.67,260.28L383.99,260.19L385.88,260.95L385.39,262.91L387.33,266.23L386.93,268.69L385.13,269.5L383.16,273.47L377.3,277.29L378.21,278.59L378.97,281.34L376.67,282.37L377.28,286.25L380.54,287.23L386.98,293.23L388.25,292.91L388.25,292.91L394.02,293.02L393.22,293.93L393.69,294.34L392.23,295.36L392.64,296.11L393.68,296.54L394.65,295.75L395.45,296.22L397.01,298.95L399.49,299.87L399.73,301.43L400.81,301.7L401.54,302.95L399.9,304.17L400.7,306.37L400.45,306.87L401.74,307.41L402.44,309.69L403.32,310.75L403.74,313.03L403.53,313.74L402.7,313.77L401.46,315.08L401.53,317.01L402.32,317.56L402.03,318.37L402.67,318.12L403.07,319.16L404.33,319.58L404.48,320.17L405.49,319.31L406.82,319.46L406.1,320.16L407.69,321.96L407.99,323.19L408.63,322.27L411.1,323.04L410.62,323.76L410.69,323.23L408.75,323.63L408.76,324.41L411,323.69L410.71,324.17L411.38,325.23L412.21,324.06L412.97,324.47L413.15,325.56L414.57,327.16L416.3,325.26L415.55,320.08L416.83,319.3L419.31,320.26L419.52,319.57L420.27,319.77L421.67,318.32L420.7,317.05L421.81,316.38L421.27,316.11L421.92,315.51L421.91,313.26L421.5,313.46L420.41,311.74L419.58,311.94L417.13,310.77L416.88,311.33L416.18,311.13L416.47,307.88L414.47,306.44L415.64,306.56L415.47,305.67L416.52,303.95L417.31,303.61L418.12,304.06L418.07,301.45L417.48,301.32L416.74,300.01L417.27,300.6L418,300.28L417.64,297.56L419.46,298.25L419.87,297.22L421.22,298.04L421.29,297.34L422.79,297.93L424.66,297.33L426.06,298.38L426.06,298.38L426.48,301L428.71,301.16L429.42,302.39L431.19,302.32L433.95,303.45L434.6,305.08L435.4,304.7L435.16,305.37L435.73,306L437.13,306.58L437.97,305.45L437.95,306.41L439.61,306.65L440.67,308.53L441.72,307.91L444.23,309.57L443.42,311.25L444.21,313.18L443.91,315L443.46,316.13L442.55,316.14L441.55,317.11L441.86,320.82L443.08,322.27L442.91,325.51L441.42,326.39L439.59,326.03L438.25,326.7L437.45,326.01L434.73,327.05L431.83,326.09L431.63,326.9L430.83,327.02L433.42,330.81L432.77,331.44L430.67,331.88L429.81,331.21L429.3,332.13L426.31,331.75L425.12,332.58L424.75,331.73L423.76,331.23L423.7,330.45L421.58,329.32L416.9,329.43L416.14,330.73L417.15,333.6L416.93,334.57L415.6,335.44L415.76,336.29L413.91,337.2L414.28,338.1L415.84,337.96L417.17,338.58L418.1,340.06L419.02,340.35L418.45,342.26L416.6,341.58L416.22,342.15L416.91,342.33L417.44,343.88L416.29,344.43L415.25,347.63L416.18,348.35L415.76,349.16L416.04,350.46L416.77,350.7L417.38,352.34L416.57,353.59L415.72,353.09L415.4,351.79L413.59,352.06L412.31,352.88L411.32,352.55L411.26,351.94L409.44,351.95L407.98,353.68L407.77,355.39L406.27,355.38L407.37,357.2L409.51,358.03L409.48,358.91L409.11,358.21L408.65,358.9L409.09,358.96L408.91,361.19L408.21,362.01L405.38,362.9L403.62,362.47L403.62,362.47L402.87,362.2L402.13,363L403.09,365.03L398.8,367.2L397.86,366.41L395.88,367.13L395.2,366.18L394.01,366.53L393.5,365.98L392.73,366.15L391.9,365.15L388.52,363.65L388.33,362L389.33,361.95L390.09,360.88L388.94,360.47L389.47,359.46L388.56,356.58L389.77,356.84L390.13,356.3L388.43,356.1L387.47,355.07L386.66,352.98L386.84,351.94L385.28,350.77L381.77,351.19L379.5,350.37L378.41,350.86L378.46,348.9L377.52,349.8L376.48,349.91L373.99,348.9L374.35,347.53L373.56,346.6L374.02,345.95L373.64,345.14L374.21,344.62L373.44,343.34L371.84,343.05L371.43,341.58L370.71,341.23L370.11,341.88L368.69,341.99L368.2,342.98L367.12,343.58L367.75,344.78L364.84,344.67L364.33,346.45L362.85,346.18L361.79,346.77L362.66,348.27L362.43,349.2L363.46,349.63L363.15,350.37L363.74,350.06L363.69,351.79L365.07,352.43L365.48,354.15L363.94,355.22L362.75,354.82L361.71,356.08L362.19,356.47L361.97,357.79L360.78,357.09L360.31,358.2L359.2,358.12L357.85,359.47L357.22,359.27L357.38,358.11L356.54,357.27L357.8,356.4L358.68,354.43L357.39,351.88L356.92,351.78L356.6,352.88L356.6,352.88L356.1,353.57L354.78,353.59L354.27,351L353.17,350.54L352.26,350.68L351.83,351.36L349.86,350.86L348.95,351.22L349.3,349.23L348.76,348.45L346.67,347.51L343.87,343.31L344.53,341.19L345.52,340.27L346.63,340.32L347.48,341.09L350.09,341.49L350.87,342.27L354.62,343.25L355.04,344.2L356.14,344.87L357.56,343.74L358.81,344.41L360.26,341.68L361.29,341.94L361.75,340.59L362.63,340.59L361.38,338.29L358.55,337.02L358.34,335.76L357.26,336.5L355.9,335.32L357.46,334.23L358.37,334.72L358.4,332.62L361.08,330.53L362.98,329.88L363.71,328.29L364.39,328.12L363.84,326.43L362.95,326.05L363.39,325.56L363.2,324.15L364.86,324.15L366.22,322.07L368.56,322.65L369.02,321.23L368.15,318.4L369.35,317.47L371.44,317.87L371.67,314.7L370.57,313.96L371.97,312.22L372.86,312.06L369.98,309.98L368.54,305.72L367.45,305.23L366.98,304.31L368.6,303.35L365.2,300.07L365.61,298.28L366.91,297.05L364.87,295.1L364,295.24L363.83,294.45L362.08,292.99L359.61,292.18L360.41,290.6L359.41,290L359.15,287.51L357.76,289.04L357.37,291.57L356.36,291.33L355.88,290.33L349.3,286.17L348.04,284.71L342.15,282.17L341.68,279.87L338.37,278.71L336.93,276.51L335.59,275.95L335.21,277.26L336.21,278.56L336.37,280.35L330.11,276.83L328.25,275.06L327.94,273.99L327.19,274.12L326.1,272.3L322.4,269.41L322.89,268.53L321.82,268.02L321.48,268.39L319.25,266.38L318.52,266.38L316.26,268.82L314.68,268.51L313.75,267.27L312.57,267.15L312.32,268.48L310.02,271.04L309.1,270.04L305.13,268.34L304.85,267.58L300.65,265.04L296.6,264.45L295.57,266.03L296.25,266.86L295.74,269.69L296.18,270.16L296.12,272.51L295.48,272.96L295.51,273.85L296.18,274.35L295.77,278.4L290.51,276.66L290.26,275.25L287.67,273.6L286.51,273.9L285.41,273.04L284.83,273.44L284.19,271.91L282.37,271.47L280.77,269.75L280.62,270.11L279.7,269.67L278.21,267.53L276.28,266.59L274.69,264.45L272.99,264.88L270.03,263.82L267.63,263.86L266.33,262.75L261.91,262.76L261.57,262.23L258.41,263.43L256.84,263.56L256.31,263.14L254.6,263.6L251.98,263.04L251.27,264.13L246.25,265.29L245.11,264.96L245.11,264.96L245.02,260.33L244.15,258.82L242.75,253.4L244.7,249.72L244.64,243.21L250.2,243.64L253.81,241.3L255.93,236.93L258.4,233.38L266.96,224.45L272.03,221.8L277.82,220.53L279.68,221.07L281.87,220.76L283.51,219.85L284.33,217.9L283.96,216.18L284.86,207.86L288.25,205.85L288.25,205.85L292.17,205.41L295.43,205.93z"},{"code":"CN-GZ","name":"Guangxi Zhuang","path":"M453.95,461.89l0.58,0.47l1.42,-0.7l1.03,0.86l-0.77,1.45l1.6,0.18l0.49,-0.69l-0.44,-1.41l0.98,-0.19l1.23,-2.31l0.77,0.55l0.74,-0.16l-0.23,1.75l1.1,0.36l0.52,-0.7l0.72,1.48l0.91,-0.18l0.65,-1.66l1.65,-1.16l1.32,-2.2l1.24,0.59l0.39,-0.31l0.25,0.91l2.03,-0.08l0.61,-1.81l0.34,0.9l3.38,0.8l0.03,1.88l-0.83,1.75l0.23,1.54l0.77,0.6l0.61,-0.66l2.04,0.5l-0.85,0.41l0.19,0.89l-1.71,0.79l0.44,1.53l-0.54,2.25l-2.5,2.21l0.06,0.95l-1.35,0.78l-0.51,2.22l0.5,1.08l0.65,-0.06l0.62,-0.24l0.02,-1.2l2.14,-1.59l0.95,0.67l0.65,-0.47l0.52,0.42l-0.23,0.79l0.63,0.3l-0.47,0.65l0.61,2.42l-0.53,1.79l1.59,0.44l1.8,-2.02l3.99,0.63l0,0l-0.8,0.33l-0.4,1.18l0.95,1.13l-0.2,1.11l0.94,1.54l-1.03,1.34l-1.37,0.66l0.72,3.35l-0.95,0.25l-0.61,1.85l-2,-0.07l-0.38,1.21l0.62,0.24l-0.62,0.95l-1.62,0.18l-0.1,1.16l-0.99,1.05l-0.57,2.51l0.52,1.64l-0.25,0.99l0.66,0.77l-0.89,1.01l-0.03,0.98l-1.77,1.94l-2,0.26l0.4,0.47l-0.43,0.58l-3.18,1.27l-0.44,-0.31l-0.32,1.56l-0.74,-0.05l0.33,1.44l0.94,1.12l-1.12,0.1l-0.74,1.71l-0.85,-0.61l-0.8,0.64l-1.1,-0.82l-0.55,0.55l-0.45,-0.34l0.46,4.14l-1,-0.36l-0.67,0.5l-3.33,-0.03l-1.01,3.01l-1.29,0.24l-0.36,-0.47l-0.25,1.39l0,0l0.04,1.54l-1.29,-0.82l0.16,-1.08l-0.35,0.54l-0.34,-0.25l-0.4,-2.15l-0.44,0.1l0.44,2.11l-0.43,0.92l-3.65,1.12l-0.16,-0.63l-0.21,0.79l-0.86,0.1l-1.45,-0.62l1.49,-0.92l-0.27,-0.78l-1.12,-0.55l-1.75,0.08l-0.76,-0.98l0.17,-1.29l-0.4,1.2l0.43,0.9l-1.58,0.28l-1.28,-2.13l-0.45,0.63l-0.47,-0.49l0.11,-1.54l-0.42,-0.37l-0.84,0.76l1.17,2.25l-1.13,1.43l-1.08,0.11l0.24,-1.54l-0.66,0.9l0.08,-0.74l-0.65,0l0.03,1.07l-1.33,1.06l0.37,-1.59l-1.19,0.67l0.51,0.46l-0.79,0.2l-0.43,-0.5l-1.72,0.21l-1.22,-1.56l-4.19,0.88l-0.75,-1.02l-1.32,0.89l-0.76,-1.92l-0.88,0.47l-2.63,-1.53l0.44,-1.51l-1.24,0.17l-2.42,-1.26l-1.06,0.44l0.09,-4.02l-0.5,-0.86l-1.17,-0.13l0.36,-0.43l-0.38,-0.91l0.63,-2.08l1.58,0.14l0.4,-2.05l0.9,-0.87l-3.94,-1.95l-0.34,0.59l-1.85,0.67l-0.92,-0.18l-1.03,-1.65l-2.45,-0.03l-0.06,0.69l-1.62,0.22l-1.73,-1.88l-2.04,-0.13l0.25,-1.02l-0.67,-0.63l0,0l-0.18,-0.74l0.79,-0.92l0.81,-0.54l0.48,0.3l-0.53,-0.95l1.97,-0.94l0.25,-0.66l2.02,0.36l0.17,0.57l1.79,-1.67l-0.06,-3.1l0.77,-1.04l-1.27,-2.17l-1.2,-1.38l-1.04,0.09l-0.25,0.97l-0.73,0.32l-0.87,-0.62l-1.38,0.42l-0.71,-1.33l-0.92,0.14l-0.61,1.46l-2.08,-1.32l-0.77,0.66l-1,-0.96l0.66,-0.69l-0.66,-1.28l0.18,-0.74l-1.85,-1.44l-1.33,0.46l-2.88,-0.52l-0.26,1.7l-1.1,-0.81l-1.28,-2.66l-0.29,-1.07l0.62,-1.1l0,0l2.53,1.53l1.42,-0.81l0.38,-0.87l2.02,-0.73l0.5,-1.68l1.72,-1.1l0.78,0.88l1.94,-0.01l1.05,1.75l1.12,0.01l2.69,1.43l1.54,-0.33l1.15,1.22l1.92,-1.79l0.34,-1.35l-0.65,-1.34l3.7,-0.87l1.82,-0.9l0.89,-1.13l2.96,-0.22l0.39,-0.88l0.83,0.13l0.3,-1.47l-0.63,-1.21l1.35,-1.14l-0.1,-0.6l2.09,-0.64l0.05,0.67l1.36,0.98l-0.37,0.83l1.39,0.46l0.15,1.45l0.62,-0.16l-0.08,1.2l2.4,-1.41l0.37,1.63l0.74,-0.6l0.3,1.66l0.93,0.01l1.91,-1.05l1.33,-0.04l0.37,-2.48l0.63,-0.37l-0.46,-0.48l1.14,0.2l1.01,-1.48l1.2,1.28l0.95,-0.15l1.37,1.78l-0.01,-1.99l1.07,-0.77l-0.24,-0.72l0.61,-0.67l0.91,-0.12l0.32,1.43l1.63,-0.42l1.28,0.51l0.44,-0.36l-0.5,-1.39l0.49,-1.24l-0.86,0.06l-0.8,0.82l-0.56,-0.54l0.88,-0.26l0.31,-0.74l1.53,-0.34l0.27,0.81l0.58,-0.22l-0.14,-0.58l0.86,1.15l1.22,-0.19l0.01,-1.3L453.95,461.89z"},{"code":"CN-GH","name":"Guizhou","path":"M454.87,452.2l-0.09,0.02l0,0l0.45,-0.65l-0.04,0.51l0,0L454.87,452.2zM414.72,426.56l0.33,-0.65l1.22,0.5l-0.39,-0.65l0.68,-1.28l-0.86,-1.58l0.24,-0.75l1.53,1.69l-0.18,0.41l0.97,0.41l-1.09,2.46l0.36,-0.32l1.63,0.75l0.59,-2.37l0.62,0.45l0.75,-1.29l-0.79,-0.81l0.18,-0.45l0.79,-0.63l1.14,0.53l0.33,-1.54l1.43,-0.05l1.4,1.69l1.11,-0.64l1.43,-1.86l-0.91,-0.91l0.1,-1.33l0.6,-0.19l-0.16,-0.99l0.54,-0.27l0.42,0.43l0.99,-0.65l0.33,0.74l1.17,0.37l0.95,-0.64l1.11,3.23l1.31,-1.05l0.79,0.15l0.68,-0.87l1.63,0.21l0.53,0.56l0.87,-0.75l1.01,4.18l-0.58,1.65l1.68,0.67l1.29,-0.49l0.75,0.33l-0.29,1.38l-0.49,0.13l0.4,1.63l-0.35,0.87l1.21,0.27l0.2,-0.88l-0.58,-0.88l0.92,-0.5l0.75,0.93l-0.04,1.72l-0.6,0.67l0.45,0.98l0.64,-0.65l2.33,1.17l0.41,-0.71l0.82,0.28l0.78,-3.12l1.52,-1.3l0,0l-0.02,2.64l0.33,0.56l1.07,0.13l-1.05,3.03l0.97,0.36l-0.94,1.07l0.53,1.73l-0.38,0.72l1.53,0.59l0.27,2.32l-1.92,1.36l-0.08,0.8l-1.16,-0.37l-0.65,0.48L449.6,442l-0.37,1.22l-0.77,0.39l0.16,0.55l-1.98,1.07l-0.31,1.48l-1.17,0.41l1.15,1.17l3.02,-1.77l-0.16,0.7l0.81,0l1,-1.14l2.84,0.26l-0.16,0.95l0.66,-0.08l0.55,1.77l-1.51,0.96l0.99,0.07l0.04,1.62l-2.95,0.86l0.92,0.58l0.66,1.69l-1.73,2.94l0.84,1.04l1.77,-0.57l-0.5,0.78l0.88,1.64l-0.52,0.62l0.18,0.67l0,0l-1.86,2.81l-0.01,1.3l-1.22,0.19l-0.86,-1.15l0.14,0.58l-0.58,0.22l-0.27,-0.81l-1.53,0.34l-0.31,0.74l-0.88,0.26l0.56,0.54l0.8,-0.82l0.86,-0.06l-0.49,1.24l0.5,1.39l-0.44,0.36l-1.28,-0.51l-1.63,0.42l-0.32,-1.43l-0.91,0.12l-0.61,0.67l0.24,0.72l-1.07,0.77l0.01,1.99l-1.37,-1.78l-0.95,0.15l-1.2,-1.28l-1.01,1.48l-1.14,-0.2l0.46,0.48l-0.63,0.37l-0.37,2.48l-1.33,0.04l-1.91,1.05l-0.93,-0.01l-0.3,-1.66l-0.74,0.6l-0.37,-1.63l-2.4,1.41l0.08,-1.2l-0.62,0.16l-0.15,-1.45l-1.39,-0.46l0.37,-0.83l-1.36,-0.98l-0.05,-0.67l-2.09,0.64l0.1,0.6l-1.35,1.14l0.63,1.21l-0.3,1.47l-0.83,-0.13l-0.39,0.88l-2.96,0.22l-0.89,1.13l-1.82,0.9l-3.7,0.87l0.65,1.34l-0.34,1.35l-1.92,1.79l-1.15,-1.22l-1.54,0.33l-2.69,-1.43l-1.12,-0.01l-1.05,-1.75l-1.94,0.01l-0.78,-0.88l-1.72,1.1l-0.5,1.68l-2.02,0.73l-0.38,0.87l-1.42,0.81l-2.53,-1.53l0,0l0.19,-1.28l2.07,-2.37l-0.41,-0.86l-0.71,-0.15l0.63,-0.09l0.88,-1.95l0.9,0.67l0.08,-1.16l-2.12,-0.64l-0.14,-0.91l-1.24,-0.6l0.23,-1.63l-1.62,0.59l-0.08,-1.41l-1.25,-0.32l-0.21,-0.72l0.15,-1.33l0.67,0.24l0.79,-1.93l0.2,-2.75l0.82,-0.32l0.28,-2.21l1.77,-1.74l-0.23,-0.84l-1.16,-1.29l-0.07,-0.82l-1.38,-0.29l-0.61,-1.51L389,453.6l-2.67,-0.32l-1.51,1.79l-2.48,-0.28l-0.84,-1.23l0.27,-1.54l-0.45,0.07l-0.39,-1.1l0.92,-0.93l0.02,-1.12l-0.96,-1.37l-1.06,0.61l-0.18,-0.85l0.73,-0.06l-0.39,-0.65l0.96,-0.29l2.09,-2.4l0.8,-1.91l1.03,0.1l-0.02,0.81l2.11,1.51l0.94,-0.45l1.33,-2.32l1.93,0.91l0.28,0.94l1.02,0.38l1.52,-0.47l0.47,0.38l0.53,-0.52l0.63,0.86l2.64,-1.79l1.48,0.62l0.86,-2.03l-0.4,-0.42l0.98,-1.08l-0.04,-1.18l0,0l2.3,-0.96l1.88,1.64l5.6,-1.74l1.48,0.36l1.78,-0.96l-0.18,-2.14l-0.79,-0.6l-0.14,-1.12l-1.24,-1.01l-1.36,0.33l-0.15,0.49l-0.97,-0.49l-0.87,0.23l0.04,-1.72l-0.87,-0.87l-0.51,-0.38l-0.65,0.91l-1.09,-0.65l-0.24,-2.44l1.49,-1.81l1.95,0.18l-0.04,-0.83l1.04,-1.36l4.4,3.73l0.69,0.18L414.72,426.56z"},{"code":"CN-HN","name":"Hainan","path":"M469.24,542.12l1.17,1.99l2,0.1l1.2,4.74l-2.19,1.7l-0.52,-0.99l0.79,-0.25l-1.1,-0.03l0.51,1l-0.96,1.57l-1.05,0.46l0.07,0.85l-1.63,2.26l0.19,1.47l-0.72,1.39l0.27,1.97l-0.87,0.32l-0.63,1.44l-1.65,-0.13l-1.08,0.67l-1.25,1.24l-0.62,1.88l-1.47,-0.44l-2.09,0.3l-0.51,2.39l-1.21,-0.21l-0.51,0.94l-0.09,-0.02l-0.12,-0.64l-0.77,-0.19l-0.39,0.45l0.18,-0.83l-0.49,-0.43l-3.56,-0.04l-0.88,-1.01l-1.48,0.07l-0.37,-0.6l-3.44,-1.36l0.12,-3.02l-0.93,-1.42l0.46,-1.29l-0.6,-2.18l0.83,-0.89l-0.65,-0.52l0.1,-1.13l0.68,-1.12l0.65,0.02l3.38,-2.78l3.39,-1.93l-0.05,-0.62l-1.06,0.55l-0.35,-0.72l1.27,-1.51l0.57,-0.23l2.41,1.06l0.48,-1.47l0.98,-0.64l1.14,-0.13l1.3,0.95l0.18,-0.65l0.37,0.55l1.15,-0.68l1,0.59l1.32,-0.67l0.44,-0.83l1.46,0.49l1.23,-0.8l2.73,1.17l0.3,1l-0.51,-2.26L469.24,542.12z"},{"code":"CN-HB","name":"Hebei","labelCoordinate":{"x":0.4,"y":0.6},"path":"M551.45,250.07l-0.79,2.64l0.28,0.73l1.29,0.51l-1.29,0.41l0.5,0.82l-0.52,2.36l-2.26,-0.26l-0.32,-1.11l-0.68,0.23l0,0l0.65,-1.42l-0.39,-1.11l-1.71,-0.86l-0.02,-2.05l2.78,-0.02L551.45,250.07zM512.7,239.27l-1.16,-1.48l0.39,-0.51l-1.27,-2.1l-1.94,-1.91l1.21,-1.21l0.88,-0.16l0.4,-0.87l-1.19,-0.87l0.23,-1.64l-0.88,-0.95l1.97,-1.38l2.82,0.22l-0.47,-4.92l1.58,-2.07l2.02,-0.75l0.14,-2.41l0.82,-0.42l2.36,0.49l0.82,-1.02l0.62,0.73l-0.61,1.23l0.99,0.94l0.58,2.77l-0.92,0.53l0.36,1.84l-0.5,1.65l3.17,-0.63l1.62,0.86l0.47,-0.8l0.33,0.5l0.76,-0.33l-0.68,-0.97l0.28,-0.61l3.95,-1.96l2.28,-1.89l1.16,-0.09l0.93,2.72l0.74,0.15l0.65,-0.25l0.07,-1.12l1.09,-0.18l0.28,-1.14l1.38,-1.25l1.03,0.2l-0.16,0.88l1.26,-0.64l0.72,0.86l2.24,-0.1l0.18,-0.81l1.71,-0.62l0.06,-1.56l-1.25,-1.47l1.63,0l0.09,-3.56l2.16,-1.32l3.59,0.36l1.13,-1.13l0.1,-0.98l0.78,0.04l0.19,-0.45l0.7,0.76l2.46,-0.81l2.75,3.72l-0.13,0.83l0.64,0.83l-1.15,0.95l1.73,1.2l-0.18,1.06l0.8,0.48l-0.49,0.75l1.06,0.07l0.16,-0.81l0.62,-0.08l0.34,0.84l-0.64,0.23l0.87,0.73l-0.56,1l0.94,1.21l-0.69,1.41l-1.39,-0.82l-0.53,1.22l1.15,2.58l1.15,0.38l0.04,0.91l-0.58,0.62l1,0.79l0.21,1.78l2.06,-0.55l2.87,0.5l1.12,-0.83l0.59,1.24l0.74,-0.29l3.17,0.6l0.49,-0.54l0,0l-0.05,1.01l-0.88,0.57l0.23,0.62l-1.3,0.86l-0.13,0.81l-1.61,0.31l-0.1,0.57l1.06,0.53l-0.39,0.7l-1.19,-0.04l-0.59,2.67l2.58,2.23l1.56,-0.44l-0.33,1.46l1.02,-0.03l-0.13,0.58l0.71,0.56l3.75,-0.06l0.3,3.23l0.66,1.22l-0.27,0.6l1.51,0.7l0.36,2.37l0.86,-0.05l0,0.95l0,0l-3.45,1.38l-0.46,0.33l0.01,1.23l-0.81,-0.04l-1.33,1.12l-1.3,3.64l0.62,1.64l-0.53,0.89l-0.8,-0.19l-2.57,2.96l-3.19,0.96l-1.78,-0.53l-3.42,2.35l-1.42,-0.54l-1.95,-2.65l0,0l-0.72,-2.29l-0.87,-0.7l-0.89,0.16l0.79,-2.96l-2.12,-0.35l-0.67,0.94l-0.23,-0.66l-0.91,-0.22l0.56,-1.18l-1.49,-1.75l-0.45,-1.84l0.38,-1.59l2.12,-0.08l0.7,0.44l0.35,-0.81l-0.7,-0.17l0.06,-0.9l-1.3,-0.4l-1.25,-2.14l-2.05,0.02l0,0l-2.05,-2.44l-0.28,-2.02l1.32,-1.33l1.74,-0.01l-0.17,-0.91l0.9,-0.07l0.01,-0.47l-2.4,0.19l-2.09,-0.79l-1.85,0.15l-1.87,-2.33l-1.65,-1.13l-0.62,-1.26l0.26,-0.93l-0.65,-0.43l-0.62,1.35l-1.8,0.04l0.25,1.36l-1.69,-0.6l1.51,2.7l-0.57,-0.29l-1.47,0.48l-0.71,-0.52l-1.71,2.86l-1.49,0.59l-0.95,-0.62l-1.92,1.25l-0.29,0.65l0.52,0.18l-0.05,0.76l1.77,1.49l0.62,1.53l-1.01,0.69l-0.5,1.32l-0.74,-0.64l-0.4,0.7l-1.75,0.29l-2.09,1.52l-0.31,1.21l1.16,0.67l0.06,1.13l0.64,0.47l-1.84,0.66l0.85,0.56l-0.11,1.42l1.08,0.92l1.52,-0.04l0.87,1.44l0.67,0l1.47,-1.4l0.48,0.51l0.31,-0.39l2.53,0.19l1.95,2.08l1.41,0.16l-0.64,-1.17l2.16,-1.73l1.77,0.53l-0.13,-0.49l1.27,0.13l0,0l-0.03,2.49l0.75,0.5l-0.39,1.39l0.43,-0.3l0.36,0.46l-0.43,2.13l0.96,1.05l-0.36,1.17l-1.84,0.6l-0.62,1.53l0.56,3.12l1.08,0l1.01,0.8l1.3,-0.18l1.05,1.86l1.57,-0.66l0.37,0.94l3.69,-0.64l0.21,-0.75l0,0l1.76,4.38l2.05,1.98l0,0l-2.09,2.92l-1.59,0.15l-1.81,3.51l-8.05,0.28l-4.54,5.72l-1.4,-1.64l-0.65,1.76l-0.6,-0.13l0.01,0.74l0.67,0.41l-0.51,0.62l-1.02,-0.29l-2.27,0.72l-0.25,1.64l-0.72,0.5l-0.49,1.99l-1.12,1.25l-1.18,2.79l-2.54,0.84l-1.82,2.34l-0.73,1.86l0.96,2.87l0.77,-0.2l0.61,1.03l0.11,1.38l0,0l-1.89,1.29l-1.05,-1.59l-1.51,-0.35l-0.21,0.62l-0.65,0.03l-0.59,1.52l-1.11,0.41l-0.36,-1.4l-3.75,0.25l-2.4,-1.63l-4.3,-0.75l-0.63,-1.26l-0.57,-0.04l0.07,0.58l-0.29,-0.59l-1.42,0.38l-1.42,-0.42l0,0l-0.28,-0.99l-1.94,-1.14l0.42,-1.04l-0.55,-0.95l-0.83,-0.27l0.35,-1.01l-0.53,-0.04l2.73,-1.3l0.2,-1.45l0.67,0.47l0.52,-0.36l-0.3,-4.25l1.51,-1.49l3.2,-6.92l-0.91,-0.73l-0.94,0.23l0.65,-1.04l-0.91,-0.8l-1.19,-3.86l-0.8,-0.82l0.23,-0.7l-3.17,-1.13l-0.48,-0.66l-0.25,-1.8l0.74,-1.33l-0.27,-1.48l0.64,-1.41l1.22,-0.15l0.05,-0.87l0.63,0.13l0.5,-1l0.46,0.08l0.2,-1.14l-1.01,-0.91l-0.09,-1.37l1.51,-1.53l1.96,-1.18l0.83,1.38l1.12,0.03l1.05,-1.17l0.89,0.56l0.36,-1.31l1.01,-0.7l-0.57,-0.49l0.05,-0.91l1.69,-4.08l-1.82,-1.69l0.38,-2.32l-0.57,-1.23l-2.17,0.01l-2.04,-0.85l-0.47,-1.23l-1.4,-0.29l0.76,-0.52l0.3,-1.39l0.5,1.14l0.57,-0.25l-0.01,-1.85l0.63,0.2l1.33,-0.36l0.27,-0.67l2.47,-0.38l0.99,-1.19l-1.05,-0.69l-1.67,0.05l-0.57,-1.94l0.17,-1.72l-1.03,-0.59L512.7,239.27z"},{"code":"CN-HE","name":"Henan","path":"M507.6,309.72L509.02,310.14L510.44,309.77L510.73,310.35L510.67,309.78L511.23,309.82L511.87,311.08L516.17,311.84L518.57,313.46L522.33,313.21L522.69,314.61L523.8,314.2L524.39,312.68L525.03,312.66L525.25,312.04L526.76,312.39L527.81,313.98L529.7,312.69L529.7,312.69L529.29,315.13L528.13,315.85L528.21,318.68L529.84,317.17L529.83,316.58L530.58,316.92L533.87,315.17L536.33,314.52L537.07,313.7L537.56,313.6L537.64,314.09L536.78,315.87L535.32,315.8L534.58,316.85L534.78,317.43L532.77,317.76L531.95,319.38L529.96,319.55L528.33,322.1L527.78,321.86L528.08,323.26L526.41,324.37L525.86,323.91L523.97,325.02L522.82,327.59L521.72,328.09L521.21,330.42L522.63,331.17L525.1,330.61L526.37,331.33L526.15,331.98L526.88,332.16L526.77,333.01L527.42,332.79L529.09,333.91L529.28,335.79L530.44,337.23L532.21,337.5L532.49,336.85L534.14,337.46L535.96,337.06L536.33,336.53L536.76,337L537.57,336.81L537.99,337.51L538.71,337.22L538.71,337.22L538.31,338.99L538.99,340.21L540.88,341.21L540.93,341.91L543.61,341.8L542.96,344.27L544.48,346.42L544.39,347.69L543.42,347.42L541.87,348.25L541.8,348.99L538.33,350.45L537.23,349.32L537.04,348.1L536.09,347.44L535.88,345.99L534.87,345.52L534.43,345.96L533.86,344.93L531.87,345.02L531.23,345.53L530.57,347.83L531.64,347.98L531.44,349.31L530.81,349.43L531.71,352.3L528.87,352.71L528.68,353.53L528.01,353.55L527.62,355.4L528.25,356.19L527.33,359.09L525.49,359.83L524.05,359.8L522.85,358.72L522.44,359.18L522.76,360.8L522.15,361.35L526.14,363.27L526.14,367.25L527.47,367.3L527.48,367.8L528.8,367.47L530.61,370.02L532,369.91L532.38,368.65L533.16,368.93L533.31,368.51L533.5,369.09L535.34,367.54L534.3,368.46L534.78,368.75L535.49,373.58L535.17,379.04L533.94,379.57L532.2,379.27L529.94,380.84L529.8,381.78L528.41,383.41L528.33,384.83L528.33,384.83L527.56,385.14L526.44,384.54L526.63,382.61L525.64,381.86L524.98,383.13L523.94,383.04L523.67,383.85L523.32,383.43L521.58,383.99L518.96,382.09L518.06,382.55L518.3,379.48L516.74,379.99L514.77,379.71L514.04,378.49L513.26,378.19L510.73,379.6L510.4,378.1L509.94,377.8L509.09,378.28L508.64,376.48L507.93,376.09L508.34,375.42L507.64,374.17L508.08,374.13L508.28,373.06L507.74,372.32L508.13,370.63L507.63,369.84L506.8,369.78L506.28,370.68L503.72,371.95L501.06,369.65L500.15,370.39L498.71,369.69L498.23,370.47L496.74,370.09L495.39,370.88L492.69,370.03L491.34,370.77L490.29,370.53L489.83,371.16L488.65,370.19L487.62,370.28L486.48,368.99L485.81,369.23L485.14,368.32L484.35,368.52L482.22,367.02L481.27,366.99L481.2,366.56L480.34,367.17L478.44,365.14L479.03,364.49L478.36,364.69L476.72,362.58L476.27,362.83L476.56,361.52L476.12,360.49L474.98,360.47L475.52,359.8L474.29,358.39L473.61,358.75L473.82,358.21L472.9,357.23L472.9,357.23L473.49,356L473.21,352.49L471,350.97L470.3,349.05L468.16,348.17L468.01,347.53L469.02,346.74L467.88,345.54L468.61,343.5L466.06,342.29L465.88,341.65L466.8,340.93L466.55,339.73L465.91,339.8L465.08,338.3L465.58,337.46L465.35,336.84L465.35,336.84L469.17,337L470.05,336.05L471.86,335.96L472.21,334.87L472.68,335.31L475.08,333.72L475.97,333.97L480.34,333.1L481.63,331.59L481.61,330.92L483.26,330.3L483.57,329.67L485.18,329.53L486.16,330.27L486.53,326.45L488.48,327.22L489.37,326.87L489.35,327.37L489.96,327.45L490.78,326.97L493.56,327.37L493.99,326.67L494.3,327.34L495.3,327.65L496.05,326.83L497.46,326.94L498.37,326.1L498.28,325.37L499.86,325.64L501.01,323.98L502.16,324.23L502.17,323.44L504.65,322.61L505.33,320.8L506.27,320.97L505.64,318.16L506.67,317.86L506.43,315.51L507.05,315.54L507.21,314.98L506.72,314.79L506.63,313.41L507.29,313.19L506.68,312.75L507.18,312.5L506.86,312.21z"},{"code":"CN-HK","name":"Hong Kong","path":"M514.06,513.52l0.32,1.09l-0.54,-0.34l-0.06,0.47l-1.23,-1.1L514.06,513.52zM511.67,512.67l-0.53,1.79l-0.39,-0.35l-1.66,0.44l0.7,-1.14L511.67,512.67zM510.02,511.94l1.6,-1.43l0,0l1.51,-0.77l0.82,0.23l0,0l-0.22,0.28l0.61,-0.33l0.22,0.56l0.78,0.01l-1.99,0.86l1.12,0.34l0.67,-0.83l1.03,0.6l-0.46,1.19l-0.98,-0.62l-0.44,0.54l0.75,0.73l-0.15,0.55l-2.47,-1.51l-2.33,0.03L510.02,511.94z"},{"code":"CN-HL","name":"Heilongjiang","labelCoordinate":{"x":0.5,"y":0.6},"path":"M630.59,1.2L631.03,1.27L631.22,0.19L631.44,1.43L632.14,0.33L633.38,1.57L635.64,1.65L638.9,4.65L640.55,4.19L643.16,7.5L646.35,7.91L646.57,8.74L647.97,9.09L648.51,9.9L648.69,8.49L649.86,7.83L652.62,7.9L655.93,9.76L656.51,10.9L657.67,10.31L659.39,12.2L659.21,13.25L658.39,13.79L658.58,14.87L660.6,14.07L662.31,16.87L663.34,16.13L664.01,16.63L663.25,17.33L663.42,18.73L662.35,19.04L662.39,20.05L662.79,20.61L663.6,20.21L665.17,21.56L665.11,23L665.99,22.93L667.06,24.44L666.87,26.29L668.27,26.73L666.49,28.34L669.75,30.1L669.24,31.9L668.34,32.13L668.56,33.75L671.02,38.16L671.86,38.43L672,40.07L671.26,40.83L673.24,42.22L672.7,44.23L674.29,45.07L674.28,45.93L673.06,46.35L673.35,47.69L674.13,47.94L673.75,46.6L675.03,46.4L674.1,48.76L674.35,51.59L676.77,54.15L678.3,57.28L679.08,57.88L678.89,59.08L679.9,61.14L678.99,63.23L679.88,64.27L679.67,66.4L682.86,68.21L682.78,69.56L681.5,72.29L682.15,74.09L681.96,76.21L683.57,76.99L684.01,79.02L685.5,80.62L686.79,80.89L687.38,80.17L688.82,81.57L690.91,81.95L691.1,82.39L692.82,80.69L694.76,80.41L696.94,81.15L697.37,80.62L698.07,81.17L697.47,82.82L700.57,83.35L701.7,85.24L703.23,84.35L704.93,85.27L705.48,83.72L706.58,83.72L707.21,84.1L707.58,86.44L709.66,86.69L710.03,88.24L711.3,88.82L711.27,89.74L712.16,90.18L712.28,91.32L716.08,94.59L718.62,93.93L719.78,94.87L721.68,94.51L719.89,99.43L720.85,100.09L721.1,101.86L722.82,101.73L722.51,103.08L723.69,105.39L721.49,109.14L721.83,110.24L724.57,113.01L725.67,116.71L727.11,117.04L729.1,116.06L731.53,115.91L733.7,117.44L734.71,116.55L736.06,117.26L738.11,117.36L738.53,116.59L741.63,116.59L742.55,115.72L745.64,116.4L747,112.06L748.71,112.43L749.61,111.06L751.27,110.72L751.57,109.99L753.2,109.07L755.55,109.06L757.22,109.76L761.04,107.31L762.17,107.54L762.49,106.12L763.95,105.79L764.43,104.76L768.73,103.77L770.27,104.5L771.01,104.14L771.77,105.4L772.8,105.85L770.77,111.18L771.25,112.81L772.11,113.06L772.34,114.39L773.56,115.69L773.33,117.09L770.04,121.47L768.03,121.61L766.1,123.71L765.69,125.14L766.53,126.07L766.61,127.51L765.25,128.55L764.07,132.98L764.43,133.87L763.99,136.07L762.71,137.4L761.91,139.43L763.08,140.85L762.14,141.8L762.8,142.14L762.67,143.18L761.9,144.35L761.44,143.93L759.87,145.34L760.45,147.15L759.55,149.13L758.85,149.14L758.54,150.44L757.76,149.96L757.24,150.56L757.01,151.65L757.48,151.95L756.54,153.55L757.2,153.73L756.79,154.35L757.07,155L756.29,155.1L756.4,155.73L755.5,156.17L755.19,157.15L754.54,156.64L753.14,157.65L752.25,161.76L752.83,163.81L750.83,165.62L749.3,164.98L747.34,171.48L745.62,173.87L742.53,172.8L739.95,170.58L740.86,166.74L739.28,161.77L737.68,160.98L737.16,159.97L736.35,160.46L735.71,162.19L734.47,162.1L734.07,163.19L734.58,163.94L731.93,166.09L732.11,166.55L730.25,166.3L729.4,167.32L727.17,167.22L726.96,167.93L725.32,168.57L727.2,171.45L729.6,182.23L728.47,186.71L728.79,190.63L728.34,191.9L729.39,192.71L729.39,192.71L727.71,193.95L726.15,192.3L724.17,193.46L723.55,192.27L721.14,190.77L721.19,190.25L719.78,190.12L717.43,184.54L717.6,182.82L714.39,186.42L713.53,186.15L713.24,183.71L712.48,183.11L710.4,184.33L710.48,185.33L709.88,185.78L706.84,185.8L705.08,187.17L703.75,186.9L703.31,187.41L703.18,191.05L700.67,192.01L699.94,191.46L699.04,191.59L697.72,188.42L697.14,188.23L697.51,187.86L696.66,185.63L696.17,185.54L693.84,180.88L693.89,177.06L692.59,174.7L690.56,176.17L690.05,177.67L688.61,177.48L689.17,178.66L688.72,179.29L689.24,179.82L688.53,180.42L689.21,181.33L686.74,182.5L685.2,182.4L684.61,181.92L684.37,180.18L684,180.71L682.89,180.02L683.08,178.71L681.35,176.63L681.64,175.95L681.05,174.74L682.11,174.47L682.18,173.61L680.45,172.54L678.81,172.46L678.56,173.08L677.5,172.3L675.91,173.68L675.14,169.16L676.37,166.85L674.89,164.68L674.79,163.63L672.69,163.58L669.75,161.57L668.08,161.89L667.17,162.76L666.32,162.67L665.72,163.52L662.22,163L660.33,161.86L658.87,160L658.77,156.9L657.72,156.82L656.36,157.6L655.64,157.34L655.87,157.88L654.57,158.99L653.84,158.41L653.7,158.97L653.25,158.5L651.16,159.17L650.5,158.23L650.53,157.14L649.38,157.19L648.94,156.4L648.08,158.23L647.29,158.22L647.05,157.71L645.38,158.28L644.75,157.94L644.26,158.7L643.32,157.81L642.36,158.15L641.82,156.26L640.74,156.13L640.22,154.72L639.3,154.92L639.03,153.65L637.48,152.44L638.26,150.7L636.82,149.02L637.5,148.3L637.29,147.74L637.92,147.58L637.38,146.88L637.4,145.16L636.93,145.04L636.86,142.83L636.18,143.38L636.14,142.59L635.44,142.57L631.98,143.88L631.16,143.39L629.45,144.02L627.84,143.09L626.97,143.52L626.97,143.52L624.96,140.38L624.79,137.62L625.37,137.44L625.39,136.75L627.56,137.29L628.24,135.99L632.3,135.45L632.76,133.23L632.04,132.98L632.52,132.68L632.36,131.81L632,131.74L631.81,132.98L631.09,132.99L630.79,132.46L631.44,130.56L629.92,130.71L628.76,129.59L628.72,130.35L629.56,130.92L629.33,132.2L627.46,132.49L626.8,134.44L624.9,134.91L623.41,133.1L623.38,130.48L622.21,130.83L621.85,130.16L622.81,128.73L619.82,127.44L617.08,123.33L618.43,122.18L619.35,119.79L627.05,114.81L628.69,111.77L632.07,110.27L637.39,103.96L640.82,101.03L641.43,101.92L641.3,104.18L641.85,105.66L642.78,106.49L642.6,107.49L643.44,107.96L642.74,109.43L643.79,108.72L644.69,105.43L643.89,103.98L644.36,102.32L643.93,100.68L644.95,99.1L645.11,96.9L645.57,95.46L646.18,95.11L646.25,93.59L646.79,93.6L647.73,91.22L647.52,89.9L648.69,88.6L650.45,88.68L651.44,89.65L652.78,88.44L653.38,83.34L652.58,81.72L652.99,81.71L652.94,80.62L651.6,79.59L651.96,79.01L652.43,79.89L652.77,79.15L652.85,76.59L652.21,75.97L652.85,75.85L653.09,75.18L652.26,73.49L653.66,72.58L653.11,71.69L654.23,71.52L653.43,71.15L653.52,70.18L654.73,69.93L654.21,69.41L655.86,68.19L655.8,66.89L656.58,66.56L656.92,65.62L656.41,64.65L657.25,64.78L657.09,63.99L657.98,63.94L658.88,63.15L658.56,62.89L660.43,61.86L659.97,59.26L660.42,58.78L659.55,57.82L659.98,57.38L660.67,57.66L660.5,57.02L661.69,56.14L661.34,55.64L662.09,55.68L662.18,54.86L662.65,55.36L663.68,53.5L663.07,52.77L663.42,52.2L662.38,51.2L662.62,50.41L661.88,50.66L660.93,49.96L660.79,48.63L659.5,48.22L658.81,46.19L654.42,40.28L651.69,40.08L651.51,39.53L650.92,40.15L650.74,42.01L649.08,42.83L649.26,43.85L648.43,45.15L647.11,45.01L646.57,45.9L645.34,46.29L644.62,45.41L643.55,45.21L642.87,45.75L642.48,47.4L641.75,47.4L640.19,45.83L636.42,46.82L635.36,45.47L634.76,45.6L633.79,44.83L633.08,46.44L628.39,47.82L625.59,46.41L624.74,46.57L624.25,44.93L622.89,43.24L623.28,41.93L621.56,37.84L621.84,37.11L621.01,34.86L621.26,33.04L620.64,33.02L619.98,31.24L620.06,29.81L621.41,29.46L622.03,27.42L618.13,26.53L617.73,24.51L617.24,24.85L616.01,22.83L614.71,22.95L614.18,22.01L611.43,26.48L610,26.78L608.47,26.07L607.64,23.5L606,23.21L603.53,20.85L601.87,20.33L607.05,15.33L607.11,14.18L609.76,10.53L608.93,8.79L607.7,8.09L607.88,6.69L605.72,4.91L605.72,4.91L610.39,2.97L613.14,3.01L613.92,2.03L615.2,2.11L616.18,1.37L617.63,2.58L622.71,2.34L625.29,1.1L626.55,1.27L628.06,0.05L630.4,0.7z"},{"code":"CN-HN","name":"Hunan","path":"M450.8,418.06l0.53,-0.19l-0.21,-1.32l1.17,-0.94l-0.13,-0.93l0.88,-2.05l0.39,0.1l-0.1,-0.6l0.4,0.23l0.68,-1.51l2.53,0.16l-0.27,-0.86l0.83,-0.32l0.14,-0.95l1.19,-0.28l3.08,-0.21l3.21,2.25l1.2,-1.1l0.87,0.2l1.39,-1.13l-1.71,-2l0.61,-1.11l-0.71,-0.58l1.94,-0.71l1.18,0.5l0.12,-1.07l0.9,-0.12l1.24,0.2l0.07,0.68l4.06,0.35l1.78,1.81l1.69,-0.16l0.31,0.52l1.39,0.03l1.09,-0.43l2.71,1.19l0.17,0.68l1.09,0.68l0.07,-0.4l0.01,1.29l1.65,0.79l0.6,-0.51l-0.13,0.6l0.87,0.54l-0.21,1.26l2.05,-1.98l2.97,0.55l2.6,-2.95l0.6,1.61l1.13,-1.21l-0.17,0.98l-1.27,0.99l0.36,2.31l1.25,-0.47l0.47,1.08l0.69,-0.13l5.54,-5.87l-0.27,2.42l1.46,0.01l0.91,1.49l-1.35,0.81l1.52,1.05l-1.87,2.69l1.16,0.42l-0.5,1.01l0.4,1.11l0.49,-0.31l0.19,0.67l0.97,-0.62l0.76,0.98l0.87,-0.15l0,0l0.23,1.42l0.53,-0.1l0.77,1.57l1.05,0.31l-0.27,3.13l-0.56,0.79l1.64,0.93l-0.48,0.71l1.04,0.59l-0.04,0.96l-2.06,2.04l-1.24,0.13l0.54,1.76l-1.49,0.81l-0.75,-0.22l-1.22,0.98l-0.37,0.84l0.39,1.16l-1.92,2.36l-0.42,1.35l0.62,0.4l-0.45,0.6l0.32,1.73l1.05,0.19l2.23,-0.71l-0.06,1.38l-1.26,2.58l1.98,2.13l-1.12,2.08l0.33,2.1l0.58,0.55l2.66,0.37l-0.44,2.5l-0.67,0.43l0.03,1l-1.2,2.02l1.25,-0.32l0.55,0.36l1.13,-0.65l0.76,0.81l-1.7,1.16l-0.67,-0.07l-0.43,0.84l0.25,1.26l-1.47,2.8l0.96,2.28l-0.61,1.13l0.28,0.33l0,0l-0.95,0.29l-0.83,1.47l-0.7,0.03l-0.16,-0.48l-2.23,0.69l-0.49,-0.73l-2.15,-0.48l-0.79,-0.65l-0.13,-1.02l-1.74,0.45l-0.4,1.05l-1.42,0.91l-1.09,0.56l-0.86,-0.38l0.08,1.19l1.41,-0.09l0.68,0.82l-0.85,0.53l0.58,1.01l-0.44,0.81l0.37,1.32l-1.84,0.46l-1.03,0l-1.55,-3.25l-1.46,0.06l-1.22,-0.77l-0.6,0.55l-0.44,-0.69l-1.29,0.45l-0.65,-0.59l-1.17,3.03l0.72,0.96l-0.23,1.05l-1.68,1.38l0,0l-3.99,-0.63l-1.8,2.02l-1.59,-0.44l0.53,-1.79l-0.61,-2.42l0.47,-0.65l-0.63,-0.3l0.23,-0.79l-0.52,-0.42l-0.65,0.47l-0.95,-0.67l-2.14,1.59l-0.02,1.2l-0.62,0.24l-0.65,0.06l-0.5,-1.08l0.51,-2.22l1.35,-0.78l-0.06,-0.95l2.5,-2.21l0.54,-2.25l-0.44,-1.53l1.71,-0.79l-0.19,-0.89l0.85,-0.41l-2.04,-0.5l-0.61,0.66l-0.77,-0.6l-0.23,-1.54l0.83,-1.75l-0.03,-1.88l-3.38,-0.8l-0.34,-0.9l-0.61,1.81l-2.03,0.08l-0.25,-0.91l-0.39,0.31l-1.24,-0.59l-1.32,2.2l-1.65,1.16l-0.65,1.66l-0.91,0.18l-0.72,-1.48l-0.52,0.7l-1.1,-0.36l0.23,-1.75l-0.74,0.16l-0.77,-0.55l-1.23,2.31l-0.98,0.19l0.44,1.41l-0.49,0.69l-1.6,-0.18l0.77,-1.45l-1.03,-0.86l-1.42,0.7l-0.58,-0.47l0,0l-0.18,-0.67l0.52,-0.62l-0.88,-1.64l0.5,-0.78l-1.77,0.57l-0.84,-1.04l1.73,-2.94l-0.66,-1.69l-0.92,-0.58l2.95,-0.86l-0.04,-1.62l-0.99,-0.07l1.51,-0.96l-0.55,-1.77l-0.66,0.08l0.16,-0.95l-2.84,-0.26l-1,1.14l-0.81,0l0.16,-0.7l-3.02,1.77l-1.15,-1.17l1.17,-0.41l0.31,-1.48l1.98,-1.07l-0.16,-0.55l0.77,-0.39l0.37,-1.22l0.22,0.37l0.65,-0.48l1.16,0.37l0.08,-0.8l1.92,-1.36l-0.27,-2.32l-1.53,-0.59l0.38,-0.72l-0.53,-1.73l0.94,-1.07l-0.97,-0.36l1.05,-3.03l-1.07,-0.13l-0.33,-0.56l0.02,-2.64l0,0l0.58,-1.29l-1.72,-0.43l1.52,-1.58l-0.79,-0.67l-0.07,-1.42l1.06,-2.42L450.8,418.06zM454.79,452.22l0.45,-0.65l-0.04,0.51l0,0L454.79,452.22z"},{"code":"CN-HU","name":"Hubei","path":"M455.19,379.99L455.91,378.8L455.24,377.48L455.82,376.84L455.27,375.63L455.71,374.48L455.48,372.95L454.1,371.55L454.5,369.56L455.89,367.96L455.67,367.18L459.35,367.19L460.7,367.87L461.62,366.83L462.56,367.17L463.09,366.59L462.43,365.74L462.26,363.96L460.81,363L458.8,362.41L457.91,362.91L457.5,362.48L457.84,360.05L453.39,358.82L454.25,357.64L455.44,357.61L455.88,356.96L456.91,357.6L458.61,357.38L460.87,358.22L462.56,357.96L463.42,358.71L465.86,358.52L467.6,357.27L468.08,358.78L468.79,358.78L469.46,359.66L469.9,358.89L470.81,358.84L470.99,357.99L472.02,358L472.9,357.23L472.9,357.23L473.82,358.21L473.61,358.75L474.29,358.39L475.52,359.8L474.98,360.47L476.12,360.49L476.56,361.52L476.27,362.83L476.72,362.58L478.36,364.69L479.03,364.49L478.44,365.14L480.34,367.17L481.2,366.56L481.27,366.99L482.22,367.02L484.35,368.52L485.14,368.32L485.81,369.23L486.48,368.99L487.62,370.28L488.65,370.19L489.83,371.16L490.29,370.53L491.34,370.77L492.69,370.03L495.39,370.88L496.74,370.09L498.23,370.47L498.71,369.69L500.15,370.39L501.06,369.65L503.72,371.95L506.28,370.68L506.8,369.78L507.63,369.84L508.13,370.63L507.74,372.32L508.28,373.06L508.08,374.13L507.64,374.17L508.34,375.42L507.93,376.09L508.64,376.48L509.09,378.28L509.94,377.8L510.4,378.1L510.73,379.6L513.26,378.19L514.04,378.49L514.77,379.71L516.74,379.99L518.3,379.48L518.06,382.55L518.96,382.09L521.58,383.99L523.32,383.43L523.67,383.85L523.94,383.04L524.98,383.13L525.64,381.86L526.63,382.61L526.44,384.54L527.56,385.14L528.33,384.83L528.33,384.83L529.52,386.78L530.32,387.03L530.97,388.6L531.94,387.66L533.39,389.1L534.7,388.6L535.54,390.11L536.87,390.53L537.23,391.28L534.62,392.72L534.62,394.05L533.52,394.35L533.26,395.38L535.21,397.8L534.97,398.75L535.59,399.16L534.83,399.78L535.09,400.83L536.06,401.04L537.12,402.37L537.23,405.88L538,407.92L538,407.92L536.9,409L535.39,409.37L532.22,407.47L530.11,407.67L529.6,409.12L527.3,410.79L527.02,410.27L525.04,409.96L525.35,411.16L525.84,411.25L525.65,412.37L523.67,411.53L523.01,412L523.11,412.54L522.42,412.14L522,412.86L522.33,413.36L522.94,413.02L522.22,414.12L520.54,414.55L519.53,414.08L517.49,415.13L514.4,414.71L514.16,416.39L511.86,416.78L510.33,419.13L510.33,419.13L509.46,419.28L508.7,418.29L507.73,418.92L507.54,418.25L507.06,418.56L506.65,417.45L507.16,416.44L506,416.02L507.87,413.34L506.35,412.29L507.7,411.48L506.79,409.99L505.32,409.98L505.59,407.57L500.05,413.43L499.37,413.57L498.89,412.48L497.65,412.95L497.29,410.64L498.56,409.65L498.72,408.67L497.59,409.88L496.99,408.27L494.38,411.22L491.42,410.67L489.36,412.65L489.57,411.39L488.71,410.85L488.83,410.24L488.23,410.75L486.59,409.96L486.57,408.67L486.5,409.07L485.41,408.39L485.24,407.71L482.54,406.52L481.44,406.95L480.05,406.92L479.75,406.4L478.06,406.56L476.27,404.75L472.21,404.4L472.15,403.72L470.91,403.52L470,403.64L469.89,404.71L468.71,404.21L466.77,404.93L467.48,405.51L466.88,406.62L468.59,408.61L467.2,409.75L466.33,409.55L465.13,410.64L461.91,408.4L458.84,408.61L457.65,408.89L457.51,409.84L456.68,410.16L456.94,411.02L454.42,410.86L453.73,412.37L453.33,412.14L453.43,412.75L453.04,412.64L452.16,414.69L452.29,415.62L451.11,416.56L451.32,417.88L450.8,418.06L450.8,418.06L449.27,416.9L449.56,415.99L448.73,414.13L446.76,415.14L447.06,413.79L446.13,413.01L446.63,411.22L446.2,411.24L445.95,410.43L445.21,410.67L445.17,410.11L444.8,410.48L443.8,409.82L443.53,407.5L442.7,407.43L441.64,409.55L440.75,409.2L440.53,408.06L440.05,408.02L440.72,407.05L441.8,407.26L442.02,405.51L441.57,404.6L442.47,401.76L440.29,399.7L440.59,398.26L442.46,398.45L443.39,397.48L443.22,396.85L443.95,396.8L444.48,398.09L445.63,398.13L448.36,395.81L449.33,395.92L448.96,397.13L449.61,397.59L451.71,396.13L452.22,398.17L453.63,396.3L454.67,395.53L455.18,395.81L457.68,392.95L460.54,392.23L460.76,393.21L461.5,393.66L462.62,390.98L462.01,389.34L462.95,388.58L462.29,384.97L459.82,383.71L460.2,383.16L458.18,382.41L457.05,382.61L457.11,380.46z"},{"code":"CN-JL","name":"Jilin","path":"M626.97,143.52L627.84,143.09L629.45,144.02L631.16,143.39L631.98,143.88L635.44,142.57L636.14,142.59L636.18,143.38L636.86,142.83L636.93,145.04L637.4,145.16L637.38,146.88L637.92,147.58L637.29,147.74L637.5,148.3L636.82,149.02L638.26,150.7L637.48,152.44L639.03,153.65L639.3,154.92L640.22,154.72L640.74,156.13L641.82,156.26L642.36,158.15L643.32,157.81L644.26,158.7L644.75,157.94L645.38,158.28L647.05,157.71L647.29,158.22L648.08,158.23L648.94,156.4L649.38,157.19L650.53,157.14L650.5,158.23L651.16,159.17L653.25,158.5L653.7,158.97L653.84,158.41L654.57,158.99L655.87,157.88L655.64,157.34L656.36,157.6L657.72,156.82L658.77,156.9L658.87,160L660.33,161.86L662.22,163L665.72,163.52L666.32,162.67L667.17,162.76L668.08,161.89L669.75,161.57L672.69,163.58L674.79,163.63L674.89,164.68L676.37,166.85L675.14,169.16L675.91,173.68L677.5,172.3L678.56,173.08L678.81,172.46L680.45,172.54L682.18,173.61L682.11,174.47L681.05,174.74L681.64,175.95L681.35,176.63L683.08,178.71L682.89,180.02L684,180.71L684.37,180.18L684.61,181.92L685.2,182.4L686.74,182.5L689.21,181.33L688.53,180.42L689.24,179.82L688.72,179.29L689.17,178.66L688.61,177.48L690.05,177.67L690.56,176.17L692.59,174.7L693.89,177.06L693.84,180.88L696.17,185.54L696.66,185.63L697.51,187.86L697.14,188.23L697.72,188.42L699.04,191.59L699.94,191.46L700.67,192.01L703.18,191.05L703.31,187.41L703.75,186.9L705.08,187.17L706.84,185.8L709.88,185.78L710.48,185.33L710.4,184.33L712.48,183.11L713.24,183.71L713.53,186.15L714.39,186.42L717.6,182.82L717.43,184.54L719.78,190.12L721.19,190.25L721.14,190.77L723.55,192.27L724.17,193.46L726.15,192.3L727.71,193.95L729.39,192.71L729.39,192.71L729.76,194.21L728.31,197.4L728.45,198.64L727.12,200.64L727.5,202.18L726.03,202.42L726.12,203.46L723.64,203.19L723.01,203.92L721.91,203.67L718.38,205.76L719.07,206.49L719.97,206.18L721.14,207.46L721.07,208.8L720.36,208.96L721.03,210.86L720.42,210.7L719.79,207.7L719.26,207.62L719.26,208.6L718.78,208.78L718.74,207.83L718.1,207.85L716.4,205.95L716.54,202.78L714.63,202.6L715.11,201.52L714.6,201.22L713.42,201.58L711.96,200.95L710.27,205.84L710.43,207.79L709.65,210.81L708.77,210.79L708.46,210.21L707.38,211.79L706.26,210.57L704.95,210.45L704.6,211.51L703.6,211.71L703.81,212.6L702.94,213.78L703.35,214.67L700.06,216.78L699.93,217.77L697.39,217.34L696.72,217.88L695.94,217.47L694.56,218.13L691.94,217.44L688.87,218.43L689.08,221.2L689.81,222.73L691.88,224.78L689.79,228.55L689.29,228.8L687.06,227.52L686.26,228.1L683.41,228.05L682.1,226.94L680.52,227.25L680.28,226.81L678.55,226.85L678.72,226.3L676.63,225.87L677.58,224.93L675.8,223.59L676.29,223.12L675.98,222.5L674.44,221.89L674.42,221.3L673.33,222.68L672.88,222.41L672.64,223.25L671.28,222.34L671.92,223.01L671.36,223.75L670.42,223.72L669.79,224.65L670.12,225.61L669.09,227.66L669.32,228.97L668.37,228.95L666.35,232.21L664.13,233.57L664.39,234.04L663.62,235.44L662.47,236.24L663,236.55L661.93,236.98L661.65,236.36L661.65,236.36L660.33,237.08L659.96,236.47L659,237.1L658.34,236.34L657.24,236.54L658.52,235.32L659.28,233.67L658.93,233.15L660.03,232.02L659.32,231.79L659.51,230.9L658.12,230.38L658.05,229.21L656.65,227.74L656.72,226.9L655.63,224.82L655.72,223.64L654.07,223.39L654.33,222.13L653.67,220.77L654.28,219.28L653.72,218.63L656.14,215.71L654.65,215.09L653.91,215.71L653.68,213.26L653.28,212.76L652.17,212.8L652.28,210.91L650.95,209.5L651.21,207.68L650.26,207.57L649.7,206.56L649.67,204.53L648.28,204.43L648.35,201.37L647.94,200.65L648.6,198.79L646.12,200.02L645.58,201.56L643.17,204.08L642.97,203.37L641.95,202.86L642.79,201.63L641.64,201.08L642.63,199.66L641.04,198.25L640.89,197.21L640.13,196.64L638.89,196.73L638.46,195.96L637.64,196.09L634.79,192.51L633.59,194.47L633.59,194.47L633.62,194.58L633.62,194.58L632.23,194.59L630.86,192.89L630.25,193.71L628.82,192.42L628.88,191.36L630.2,191.54L630,190.61L631.17,190.72L631.58,190.2L630.63,187.95L630.78,186.12L628.88,182.44L629.61,180.86L628.57,180.35L627.46,177.89L626.44,177.25L626.54,174.54L625.03,174.83L623.13,176.59L618.23,179.53L615.49,179.05L615.83,175.45L615.07,175.4L614.76,174.09L613.61,173.49L613.71,170.88L613.17,170.5L614.23,169.98L613.41,169.86L612.53,167.82L613.2,167.52L613.61,163.25L615.11,162.01L615.13,161.24L613.95,160.62L614.16,158.18L612.43,157.31L611.73,155.95L612.14,154.53L611.75,153.55L610.25,153.14L608.67,153.7L607.44,152.45L608.94,151.78L609.9,149.36L609.31,148.09L610.13,147.59L611.59,148.4L612.07,148.19L613.3,150.19L615.29,151.57L616.73,150.37L616.82,149.64L617.42,149.63L618.97,152.1L621.16,153.62L622.29,152.03L622.54,150.32L622.03,146.78L625.3,146.24L626.19,145.58L626.04,144.89z"},{"code":"CN-JS","name":"Jiangsu","path":"M541.02,336.29l-0.1,-1.61l0.46,-0.16l0.57,-2.2l2.21,-0.57l1.85,0.31l0.19,-0.4l2.41,1.14l1.4,2.48l-0.27,0.8l0.8,0.25l1.01,2.76l0.58,-0.06l0.17,-1.13l1.14,-0.88l1.37,1.55l1.21,0.4l1.55,-1.18l1.47,0.34l0.11,-1.97l1.8,-0.42l1.84,0.42l-0.22,1.41l1.18,0.14l-0.46,0.98l0.53,0.51l-0.14,0.91l0.45,0.1l2.54,-0.78l0.3,-2.62l1.21,-1.65l2.07,0.5l1.07,-0.68l-0.66,-0.54l1.79,-2.88l-0.03,-1.26l0.73,-0.48l2.44,0.1l1.07,-0.93l1.29,0.33l0,0l-0.89,0.61l-0.66,3.07l0.8,1.09l0.9,0.64l0.53,-0.35l1.65,0.62l-0.4,0.78l2.45,1.75l0.1,0.58l4.61,1.5l3.35,1.96l0.79,3.08l4.37,9.67l-0.8,-0.22l0.04,0.97l0.51,1.03l0.63,-0.36l-0.01,1.25l1.29,1.7l0.4,1.52l-0.37,0.31l0.91,0.35l0.29,2.11l-0.73,1.66l0.6,2.23l1.26,0.59l-0.12,0.66l4.77,2l0.59,2.19l-0.54,0.69l0.72,1.23l3.72,1.38l1.54,1.72l0.99,2.57l-0.73,0.84l-3.05,-0.77l-4.12,-2.2l-2.6,1.46l-0.16,0.97l3.05,3.19l0,0l-2.2,0.95l-0.03,0.74l-0.56,0.21l0.5,1.39l-1.08,0.24l-0.15,1.85l-2.15,0.12l0.24,1.76l0,0l-2.45,0.57l0.05,1.06l-1.56,0.61l-0.94,1.35l-0.98,-2.32l-0.89,0.52l0.11,-0.96l-2.74,0.27l-2.01,-1.32l-1.05,-2.18l-1.63,-0.11l-1.86,0.64l0,0l-3.12,-0.62l-0.42,-1.77l-0.18,0.55l-0.79,0.15l-1.27,-0.75l-1.14,1.02l-3.8,0.05l-1.09,-1.06l2.13,-1.83l-0.09,-2.88l-0.81,-0.03l-0.33,-0.87l-0.6,0.72l-0.86,-0.14l0.23,-1.29l-0.61,-0.51l-1.25,0.32l-0.55,-0.81l0.26,-0.68l-1.74,-1.34l0.3,-2.17l1.33,-0.63l0.1,-1.05l1.96,-0.36l-0.09,-1.2l0.63,-0.6l-0.21,-2.01l-1.16,-0.05l-0.32,-1.63l4.19,-0.04l-0.17,0.5l1.14,0.75l0.68,-0.13l0.65,0.94l0.79,-0.6l0.41,-1.58l0.44,0.37l0.2,-0.51l-0.6,-3.34l-0.97,0.08l-1.12,-1.19l0,-0.81l-2.09,0.01l-0.53,1.51l-0.86,0.11l0.13,1.61l-0.51,0.34l-0.93,-0.39l-3.4,0.38l-0.04,-0.76l-0.84,-0.11l-0.18,-1.2l-0.5,0.17l-0.16,-1.16l1.01,-0.53l-0.88,-0.49l-0.47,-3.1l-0.42,-0.24l-0.26,0.65l-1.43,0.5l-0.73,-1.26l-0.56,-0.01l1.29,-3.76l0.93,-0.02l-0.01,-2.1l0.91,-1.9l-2.78,-0.33l-0.32,0.5l-2.63,0.04l0.34,-2.39l-0.69,-0.03l-1.02,-2.13l-0.6,0.68l-0.83,-1.2l-1.2,0.55l-0.79,-0.97l-2.03,0.32l-0.77,-0.44l-1.34,-1.19l0.38,-0.97l-1.06,-0.62l-0.11,-1.7l-1.68,0.06l-0.84,-1.12l-2.38,-0.42l0.24,-0.31l-2.06,-2.18L541.02,336.29z"},{"code":"CN-JX","name":"Jiangxi","path":"M538,407.92L538.88,407.79L539.6,408.5L542.24,406.82L543.09,406.83L543.76,404.56L544.73,404.27L547.67,406.07L546.56,408.07L544.56,409.77L544.91,410.04L544.54,410.6L545.41,411.64L545.91,411.15L546.92,411.56L548.88,409.93L550.35,409.52L550.64,408.52L549.85,407.78L551.61,406.4L552.13,406.67L552.19,407.79L553.18,407.52L553.46,408.06L554.24,407.54L554.66,409.87L555.63,410.36L555.76,411.18L557.23,410.94L557.87,411.88L561.74,411.47L563.3,412.5L563.23,413.7L564.03,414.13L564.03,414.13L564.25,414.72L563.73,415.52L562.56,415.6L562.14,418.41L562.85,419.92L563.92,420.08L564.36,420.63L564.08,421.09L564.89,420.91L565.38,422.18L566.42,422.87L567.09,424.5L566.9,427.04L567.54,427.37L567.18,428.3L567.71,429.34L566.99,429.96L566.99,429.96L565.61,430.88L566.3,431.41L565.95,432.7L563.16,433.29L562.76,434.6L561.94,434.25L559.76,434.84L558.19,436.88L556.56,435.92L555.54,434.24L553.26,436.11L553.04,435.5L552.55,435.91L552.72,437.27L551.5,438.56L550.28,438.58L550.19,439.38L549.66,438.75L549.15,439.05L549.19,440.3L549.94,440.25L550.35,441.27L550.24,443.55L551.05,444.38L549.74,445.82L549.53,446.87L548.18,447.94L545.08,448.44L543.23,450.51L543.36,451.54L542.77,452.36L543.49,453.29L543.12,454.38L544.35,455.74L543.89,457.03L542.84,456.68L541.34,458.54L541.3,459.75L542.2,459.84L542.46,460.75L541.23,461.74L540.92,462.79L537.95,464.28L538.56,465.45L537,466.67L537.05,468.33L536.2,469.82L536.45,471.75L534.48,473.31L535.43,475.51L534.7,475.96L535.09,476.45L534.81,477.16L534.81,477.16L535.04,477.96L533.98,477.62L533.22,479.78L534.23,482.28L532.74,482.63L532.19,481.82L530.89,481.5L529.71,479.6L528.92,479.3L525.09,480.93L524.53,480.34L522.53,480.93L522.02,482.35L520.45,481.62L519.99,482.77L519.35,482.11L516.47,483.37L515.54,481.97L514.92,482.18L514.56,481.41L513.23,480.79L515.21,479.76L516.08,477.96L516.02,476.93L517.77,475.95L518.13,475.08L519.22,475.19L520.26,474.6L519.64,473.87L520.34,472.38L517.78,470.45L515.91,471.86L512.58,471.93L511.45,472.73L511.52,471.22L510.57,469.91L510.57,469.91L510.3,469.59L510.91,468.46L509.95,466.18L511.41,463.38L511.17,462.11L511.59,461.28L512.27,461.34L513.97,460.19L513.21,459.37L512.08,460.02L511.53,459.67L510.28,459.98L511.48,457.96L511.45,456.96L512.12,456.53L512.57,454.03L509.91,453.67L509.33,453.12L509,451.01L510.12,448.94L508.14,446.81L509.4,444.23L509.46,442.85L507.22,443.56L506.18,443.37L505.86,441.64L506.31,441.04L505.69,440.64L506.11,439.29L508.03,436.94L507.64,435.78L508.01,434.94L509.23,433.96L509.98,434.18L511.47,433.37L510.93,431.6L512.17,431.48L514.23,429.43L514.27,428.48L513.24,427.89L513.72,427.18L512.07,426.24L512.64,425.45L512.91,422.33L511.86,422.02L511.09,420.45L510.56,420.55L510.33,419.13L510.33,419.13L511.86,416.78L514.16,416.39L514.4,414.71L517.49,415.13L519.53,414.08L520.54,414.55L522.22,414.12L522.94,413.02L522.33,413.36L522,412.86L522.42,412.14L523.11,412.54L523.01,412L523.67,411.53L525.65,412.37L525.84,411.25L525.35,411.16L525.04,409.96L527.02,410.27L527.3,410.79L529.6,409.12L530.11,407.67L532.22,407.47L535.39,409.37L536.9,409z"},{"code":"CN-LN","name":"Liaoning","path":"M608.69,260.2l-0.41,-0.04l-0.02,0.8l-1.23,-0.25l-0.75,0.81l-1.17,-2.09l-0.84,-0.34l-0.93,0.69l-0.98,-0.41l0.96,-1.42l2.02,-0.48l1.08,0.57l-0.29,-1.71l-0.29,0.27l-0.55,-0.93l0.48,-0.56l-0.25,-0.52l2.82,-1.97l0.93,0.26l1.57,-1.42l-0.87,-0.45l2.22,-1.68l-0.01,-0.85l1.22,-0.86l-0.17,-0.97l1.36,-1.11l0.1,-0.96l1.68,-0.98l-0.1,-0.82l-0.67,0.04l-1.55,-1.33l0.12,-1.3l-2.65,-1.65l-0.39,-0.88l-0.77,0.15l-0.6,-2.29l-0.96,1.94l-2.21,0.07l-0.87,-0.75l-3.94,-0.64l-1.28,0.99l-0.05,0.67l-1.16,-0.56l-0.43,0.95l0.46,0.25l-0.73,0.81l1.02,0.28l-2.24,0.71l-0.44,1.31l-1.64,1.1l-0.01,0.85l-0.98,0.45l0.08,1.5l-1.17,0.63l0.04,1.17l-0.71,0.94l-1.82,0.23l-5.84,3.17l0,0l0,-0.95l-0.86,0.05l-0.36,-2.37l-1.51,-0.7l0.27,-0.6l-0.66,-1.22l-0.3,-3.23l-3.75,0.06l-0.71,-0.56l0.13,-0.58l-1.02,0.03l0.33,-1.46l-1.56,0.44l-2.58,-2.23l0.59,-2.67l1.19,0.04l0.39,-0.7l-1.06,-0.53l0.1,-0.57l1.61,-0.31l0.13,-0.81l1.3,-0.86l-0.23,-0.62l0.88,-0.57l0.05,-1.01l0,0l0.89,-0.58l0.2,0.33l-0.27,-1.23l1.24,-1.22l-0.55,-1.25l0.66,-0.6l-0.73,-0.33l-0.68,-1.66l0.37,-3.94l0,0l0.36,-1.05l0,0l0.28,-1.58l-1.78,-2.1l0.56,-0.93l2.24,-1.09l0.51,-0.93l1.33,2.24l1.82,0.84l1.22,-0.12l-0.06,1.9l2.5,4.87l-0.15,1.58l0.86,0.42l2.45,-4.21l2.34,-1.28l-0.1,-1.41l1.49,-1.05l0.51,0.21l3.28,-1.92l1.96,0.26l2.93,-2.13l0.75,-1.35l1.9,-0.69l1.39,-0.35l0.87,1.35l0.69,-0.2l1.85,-1.36l0.95,-2.68l1.52,-0.64l1.36,0.63l0.49,-0.68l2.32,0.81l0.84,-1.44l-1.12,-0.24l-0.28,-0.82l0.41,-0.38l2.21,0.34l0.94,0.91l1.27,-0.17l1.36,1.03l0.68,-0.73l2.29,-0.13l2.15,-0.96l-0.73,-0.45l0.05,-1.24l0.83,-1.07l2.95,-0.85l1.28,0.71l1.11,-3.33l-0.16,-1.14l0.59,-0.36l-0.02,-1.57l0,0l-0.03,-0.16l0,0l1.19,-1.97l2.85,3.58l0.82,-0.13l0.43,0.76l1.24,-0.09l0.77,0.57l0.14,1.04l1.59,1.42l-1,1.41l1.16,0.55l-0.84,1.23l1.02,0.52l0.2,0.71l2.41,-2.52l0.54,-1.55l2.48,-1.23l-0.65,1.87l0.41,0.72l-0.08,3.06l1.39,0.09l0.03,2.03l0.56,1.01l0.96,0.11l-0.27,1.82l1.33,1.41l-0.1,1.88l1.1,-0.04l0.4,0.5l0.23,2.46l0.74,-0.62l1.49,0.62l-2.42,2.93l0.56,0.65l-0.61,1.49l0.67,1.35l-0.26,1.27l1.65,0.25l-0.09,1.18l1.1,2.07l-0.08,0.84l1.4,1.47l0.07,1.17l1.39,0.52l-0.19,0.88l0.72,0.23l-1.1,1.14l0.35,0.52l-0.76,1.65l-1.28,1.22l1.1,-0.21l0.65,0.77l0.96,-0.63l0.37,0.61l1.32,-0.72l0,0l-1.36,0.82l-0.42,-0.42l-0.81,0.47l-0.88,0.81l0.59,0.77l-1.62,-0.02l-0.25,0.72l-1.57,0.92l0.08,0.63l-1.88,-0.39l-0.44,0.73l-2.84,1.23l0.26,1.25l-1.42,0.12l-0.31,-0.47l-1.95,1.78l-0.12,0.82l-1.62,0.77l-2.77,2.49l-0.72,0.99l0.45,1.04l-1.82,1.4l-0.8,1.64l-1.98,0.25l-0.46,-0.61l-1.1,0.15l-0.08,-0.47l-1.91,0.46l-1.43,-0.29l-2.46,1.88l-0.07,-1.36l-1.62,-0.01l-0.54,1.21l0.53,0.77l-3.41,0.19l-0.54,0.86l-1.99,0.63l-0.68,-0.27l0.33,0.58l-1.23,0.8l-0.3,-0.6l-1.07,1.55l-2.33,0.27l-1.81,1.8l-0.04,0.92l-1.6,1.01l0.34,1.06l-0.75,0.66l-0.64,-0.22l0.43,1.05l-0.81,-0.23l-0.49,0.73l-0.73,-0.74l-1,0.54l0.93,0.74l-0.33,0.75l-1.36,-1.38l-0.56,0.04l0.13,0.55l-0.74,-0.43l-0.09,0.82l-1.02,0.49l1.69,0.67l-0.25,0.62l-1.4,-0.22l-1.44,0.99l-3.08,0.22l-0.39,1.32l-0.82,-0.06l-0.34,-2.03l0.85,-0.57l-1.07,-0.13l0.11,-0.59l0.59,-0.39l0.98,0.39l1.51,-0.71l-0.22,-0.6l0.6,-0.77l0.87,0.74l2.8,-1.06l0.32,-0.86l-1.31,-1.04l1.05,-0.51l-0.95,-0.73l1.72,-0.03l0.26,-1.27l1.48,-0.05l1.07,-0.71l-0.34,-0.69l-0.54,0.18l0.23,0.47l-1.75,0.24L608.69,260.2z"},{"code":"CN-MC","name":"Macau","path":"M505.56,515.13l0.35,0.51l-0.43,0.26L505.56,515.13z"},{"code":"CN-NM","name":"Nei Mongol","labelCoordinate":{"x":0.66,"y":0.63},"path":"M605.72,4.91l2.15,1.78l-0.17,1.4l1.23,0.7l0.83,1.75l-2.65,3.65l-0.06,1.15l-5.18,5l1.66,0.52l2.48,2.36l1.63,0.29l0.83,2.57l1.53,0.71l1.42,-0.3l2.76,-4.47l0.53,0.94l1.3,-0.12l1.23,2.02l0.5,-0.34l0.39,2.01l3.91,0.9l-0.62,2.04l-1.35,0.35l-0.08,1.43l0.67,1.78l0.62,0.03l-0.25,1.81l0.83,2.26l-0.28,0.73l1.71,4.09l-0.39,1.31l1.36,1.69l0.49,1.64l0.86,-0.16l2.79,1.41l4.7,-1.38l0.71,-1.61l0.96,0.77l0.61,-0.13l1.06,1.35l3.77,-0.99l1.55,1.57l0.74,0l0.39,-1.65l0.67,-0.54l1.08,0.2l0.72,0.88l1.23,-0.39l0.54,-0.88l1.32,0.14l0.83,-1.3l-0.18,-1.02l1.65,-0.82l0.18,-1.86l0.59,-0.62l0.18,0.54l2.73,0.21l4.39,5.9l0.69,2.03l1.29,0.41l0.14,1.33l0.94,0.7l0.74,-0.25l-0.24,0.78l1.04,1.01l-0.35,0.57l0.61,0.73l-1.03,1.86l-0.47,-0.5l-0.09,0.82l-0.75,-0.04l0.35,0.51l-1.19,0.87l0.16,0.64l-0.68,-0.27l-0.44,0.43l0.87,0.96l-0.45,0.48l0.47,2.6l-1.88,1.03l0.32,0.26l-0.9,0.79l-0.88,0.06l0.15,0.78l-0.84,-0.13l0.51,0.97l-0.35,0.94l-0.78,0.33l0.06,1.29l-1.65,1.22l0.53,0.52l-1.21,0.25l-0.09,0.97l0.8,0.38l-1.12,0.16l0.55,0.89l-1.4,0.91l0.83,1.69l-0.24,0.68l-0.64,0.12l0.64,0.61l-0.08,2.56l-0.34,0.74l-0.47,-0.88l-0.36,0.58l1.34,1.04l0.05,1.08l-0.41,0.02l0.8,1.61l-0.59,5.11l-1.34,1.2l-1,-0.97l-1.76,-0.08l-1.16,1.31l0.21,1.31l-0.94,2.38l-0.54,-0.02l-0.07,1.52l-0.61,0.35l-0.46,1.44l-0.17,2.2l-1.02,1.58l0.44,1.64l-0.48,1.66l0.8,1.45l-0.89,3.29l-1.06,0.71l0.7,-1.47l-0.84,-0.47l0.18,-1l-0.94,-0.83l-0.55,-1.48l0.13,-2.26l-0.61,-0.88l-3.43,2.92l-5.32,6.32l-3.38,1.49l-1.63,3.05l-7.71,4.97l-0.92,2.39l-1.35,1.15l2.74,4.11l3,1.29l-0.96,1.43l0.35,0.67l1.17,-0.34l0.03,2.62l1.49,1.81l1.89,-0.47l0.67,-1.95l1.87,-0.29l0.23,-1.27l-0.84,-0.57l0.04,-0.76l1.16,1.12l1.52,-0.15l-0.65,1.9l0.3,0.53l0.72,-0.01l0.19,-1.24l0.36,0.07l0.16,0.87l-0.48,0.29l0.72,0.26l-0.46,2.21l-4.07,0.54l-0.68,1.3l-2.16,-0.54l-0.02,0.68l-0.58,0.19l0.17,2.76l2.01,3.14l0,0l-0.93,1.37l0.14,0.69l-0.89,0.66l-3.26,0.54l0.5,3.54l-0.25,1.71l-1.13,1.59l-2.19,-1.53l-1.55,-2.46l-0.6,0l-0.09,0.73l-1.45,1.2l-1.99,-1.38l-1.23,-2l-0.48,0.21l-1.46,-0.81l-0.82,0.51l0.59,1.27l-0.96,2.42l-1.5,0.67l1.23,1.26l1.58,-0.56l1.5,0.41l0.39,0.98l-0.41,1.42l0.7,1.36l1.73,0.87l-0.21,2.44l1.18,0.62l-0.02,0.77l-1.5,1.24l-0.41,4.27l-0.68,0.31l0.88,2.03l0.82,0.13l-1.06,0.52l0.54,0.38l-0.1,2.61l1.15,0.6l0.31,1.31l0.76,0.05l-0.33,3.59l2.74,0.49l4.89,-2.94l1.9,-1.77l1.51,-0.29l-0.11,2.72l1.02,0.63l1.12,2.46l1.04,0.51l-0.73,1.58l1.9,3.68l-0.15,1.83l0.95,2.25l-0.41,0.52l-1.17,-0.11l0.21,0.93l-1.32,-0.18l-0.06,1.06l1.44,1.29l0.6,-0.82l1.37,1.7l1.39,0l0,0l0.01,0.05l0,0l0.02,1.57l-0.59,0.36l0.16,1.14l-1.11,3.33l-1.28,-0.71l-2.95,0.85l-0.83,1.07l-0.05,1.24l0.73,0.45l-2.15,0.96l-2.29,0.13l-0.68,0.73l-1.36,-1.03l-1.27,0.17l-0.94,-0.91l-2.21,-0.34l-0.41,0.38l0.28,0.82l1.12,0.24l-0.84,1.44l-2.32,-0.81l-0.49,0.68l-1.36,-0.63l-1.52,0.64l-0.95,2.68l-1.85,1.36l-0.69,0.2l-0.87,-1.35l-1.39,0.35l-1.9,0.69l-0.75,1.35l-2.93,2.13l-1.96,-0.26l-3.28,1.92l-0.51,-0.21l-1.49,1.05l0.1,1.41l-2.34,1.28l-2.45,4.21l-0.86,-0.42l0.15,-1.58l-2.5,-4.87l0.06,-1.9l-1.22,0.12l-1.82,-0.84l-1.33,-2.24l-0.51,0.93l-2.24,1.09l-0.56,0.93l1.78,2.1l-0.28,1.58l0,0l-0.36,1.05l0,0l-0.37,3.94l0.68,1.66l0.73,0.33l-0.66,0.6l0.55,1.25l-1.24,1.22l0.27,1.23l-0.2,-0.33l-0.89,0.58l0,0l-0.49,0.54l-3.17,-0.6l-0.74,0.29l-0.59,-1.24l-1.12,0.83l-2.87,-0.5l-2.06,0.55l-0.21,-1.78l-1,-0.79l0.58,-0.62l-0.04,-0.91l-1.15,-0.38l-1.15,-2.58l0.53,-1.22l1.39,0.82l0.69,-1.41l-0.94,-1.21l0.56,-1l-0.87,-0.73l0.64,-0.23l-0.34,-0.84l-0.62,0.08l-0.16,0.81l-1.06,-0.07l0.49,-0.75l-0.8,-0.48l0.18,-1.06l-1.73,-1.2l1.15,-0.95l-0.64,-0.83l0.13,-0.83l-2.75,-3.72l-2.46,0.81l-0.7,-0.76l-0.19,0.45l-0.78,-0.04l-0.1,0.98l-1.13,1.13l-3.59,-0.36l-2.16,1.32l-0.09,3.56l-1.63,0l1.25,1.47l-0.06,1.56l-1.71,0.62l-0.18,0.81l-2.24,0.1l-0.72,-0.86l-1.26,0.64l0.16,-0.88l-1.03,-0.2l-1.38,1.25l-0.28,1.14l-1.09,0.18l-0.07,1.12l-0.65,0.25l-0.74,-0.15l-0.93,-2.72l-1.16,0.09l-2.28,1.89l-3.95,1.96l-0.28,0.61l0.68,0.97l-0.76,0.33l-0.33,-0.5l-0.47,0.8l-1.62,-0.86l-3.17,0.63l0.5,-1.65l-0.36,-1.84l0.92,-0.53l-0.58,-2.77l-0.99,-0.94l0.61,-1.23l-0.62,-0.73l-0.82,1.02l-2.36,-0.49l-0.82,0.42l-0.14,2.41l-2.02,0.75l-1.58,2.07l0.47,4.92l-2.82,-0.22l-1.97,1.38l0.88,0.95l-0.23,1.64l1.19,0.87l-0.4,0.87l-0.88,0.16l-1.21,1.21l1.94,1.91l1.27,2.1l-0.39,0.51l1.16,1.48l0,0l0,0l0,0l-0.86,0.36l-0.06,3.1l-1.27,0.15l-1.23,1.04l-0.87,-1.02l-2.97,2.8l-3.07,0.45l-0.83,-1.52l-3.3,0.92l-1.22,0.51l-0.56,1.97l-1.24,0.65l-3.65,-2.16l-1.93,0.76l-4.15,7.34l-0.57,3.12l-2.14,0.4l-1.38,-0.76l-2.71,-0.14l-0.11,2.1l-1.01,1.42l-2.38,0.17l-0.33,0.82l0,0l-0.53,0.07l-0.47,-0.93l1.13,-2.06l-0.24,-0.58l-3.2,1.4l-1.99,3.43l-1.25,0.6l-1.25,-2.19l-1.29,0.36l-0.38,0.79l-1.84,-2.11l-1.21,-0.3l-0.22,0.96l1.08,1.93l-3.27,1.57l-1.15,1.5l-1.88,0.48l-0.5,2.17l-1.35,1.92l-0.71,-0.29l-1.13,0.44l-0.33,1.46l-0.89,0.11l0.21,1.41l-0.93,-0.12l-1.44,1.08l-0.32,1.26l-1.02,0.57l-0.99,1.72l-0.51,2.52l1.55,1.52l0,0.86l-1.44,1.78l-1.21,-1.52l-0.66,-0.05l0.41,0.52l-0.57,0.69l0.02,4.13l-2.64,0.53l0.02,-0.55l-0.6,-0.08l-2.01,0.28l-0.62,0.61l-0.8,-0.52l-1.46,0.78l-1.55,-0.77l-0.61,-2l-3.97,-1.31l0,0l-3.07,-1.19l0.25,-0.77l-1.26,-1.5l-2.04,-1.07l-2.06,0.58l-2.45,-0.58l-4.03,-2.57l2.26,-3.56l0.35,-2.97l3.43,-4.25l-0.17,-1.19l-1.42,-0.52l-0.74,-4.42l-2.35,-0.01l-1.46,1.21l-2.52,0.32l-0.03,2.04l-1.76,-0.11l-0.83,2.79l-1.4,1.22l0.25,0.71l-1.03,1.32l-0.71,2.38l-0.3,3.49l0.46,2.33l-1.01,1.07l-0.19,1.09l0.91,2.08l-1,3.26l-1.52,0.34l-0.52,1.26l-2.52,-0.17l-2.24,0.52l-2.94,2.1l-3.45,0.61l-1.73,-0.52l-2.09,0.37l-0.18,0.77l-1.47,0.61l0,0l-1.28,0.32l-6.43,-6l-3.27,-0.98l-0.61,-3.88l2.3,-1.03l-0.76,-2.75l-0.91,-1.29l5.86,-3.82l1.97,-3.97l1.8,-0.81l0.4,-2.45l-1.94,-3.32l0.49,-1.96l-1.89,-0.76l-1.31,0.1l-6.02,1.84l-4.54,3.96l-4.98,-1.29l-1.92,-1.18l-3.22,1.36l-4.87,1.11l3.35,3.32l-2.74,2.78l-0.13,0.72l-0.97,0.24l-1.27,-0.45l-0.75,0.49l-1.09,-1.02l-2.56,-0.92l0.05,-1.07l-1.12,-0.38l-0.85,-1.33l0.55,-1.12l-2.58,1.08l-0.96,-1.45l-1.1,0.57l-0.06,-6.26l-4.4,-0.02l0.02,-1.33l-2.29,-0.63l-0.88,-2.76l-3,-0.86l-3.14,-2.39l-3.94,0.16l2.1,-3.09l3.63,-2.44l1.43,-3.05l2.78,-3.37l-0.17,-2.01l-1.68,-2.68l-5.26,-0.83l-1.38,1.4l-4.92,-0.27l-3.92,1.86l-2.79,3.5l-4.95,0.28l1.43,-5.17l-0.21,-0.76l-4.4,-3.73l-0.39,0.16l-4.56,-6.07l2.88,-3.38l-8.28,-18.92l0,0l13.43,2.29l15.77,1.16l6.3,-1.33l3.63,0.29l0.55,-0.9l7.39,0.65l11.44,2.93l3.11,4.34l4.44,1.33l4.1,0.11l7.37,3.84l6.83,1.68l8.61,-1.28l-0.12,3.73l5.19,0.29l1.13,1.31l2.92,-2.88l6.78,-3.7l11.14,-5.12l7.36,-1.66l0.36,-0.86l2,-0.93l0.85,-0.07l0.43,0.67l4.53,0.25l4.12,-0.85l0.68,0.38l2.95,-0.27l3.62,1.16l1.98,-1.18l3.83,0.58l3.49,-0.83l3.63,-2.62l4.03,-0.22l2.28,-1.51l1.46,-1.22l0.04,-1.05l2.14,-1.23l1.03,-2.19l4.34,-4.95l4.77,-2.21l1.89,-0.33l2.35,-3.57l2.45,-0.62l0.64,-0.69l-0.03,-0.86l-1.89,-3l-2.8,-1.26l-3.09,-4.99l2.19,-6.64l2.28,-4.25l1.87,-2.01l6.66,0.24l4.12,3.33l2,0.17l2.79,1.16l4.31,0.14l2.05,0.85l5.37,-3.69l4.18,-3.8l1.39,-2.16l0.3,-1.58l1.65,-1.02l1.37,-0.4l3.13,0.92l0,0.66l9.11,-1.31l2.69,-3.12l1.65,-1.15l2,-0.51l0.77,-2.24l-0.29,-2.22l4.08,-6.12l2.27,-0.52l1.23,-1.19l1.52,0.61l4.85,-0.02l0.92,-4.22l2.04,-0.11l0.92,1.31l1.82,-0.09l0.79,-1.07l4.78,-2.93l0.15,-0.93l2.29,0.14l0.79,-0.52l1.03,0.83l0.95,-0.77l1.65,0.42l2.23,-0.68l-0.07,0.62l1.53,0.08l0.41,1.1l1.08,-0.25l2.42,1.85l0.69,1.34l-0.67,0.44l-0.21,1.12l1.56,1.02l1.07,-2.4l2.23,-1.31l1.89,-2.38l-1.52,-3.15l-0.17,-2.07l0.58,0.06l0.07,-1.67l-1.77,-1.32l0.78,-0.47l0.63,1.18l0.74,-0.13l-0.5,-1.75l-1.46,-1.21l-3.04,-0.28l-1.93,-1.79l-0.07,-2.11l-1.37,0.5l-0.71,-0.38l-0.35,-3.06l-4.4,-1.94l-3.75,-3.64l-2.85,-0.03l-0.79,-0.56l-1.02,0.23l0.13,-0.35l-3.51,0.23l-4.7,5.17l-1.21,2.1l-3.36,-3.22l-3.84,-1.69l-2.05,0.18l-1.86,0.9l-3.58,-0.44l-3.5,3.57l-6.05,-6l1.18,-0.09l-0.5,-3.4l3.99,-1.71L534.1,101l3.66,-4.98l-0.7,-1.74l8.14,-18.5l3.13,2.32l4.12,1.74l2.58,0.06l4.75,2.39l3.25,-3.03l0.6,0.01l1,-1.4l1.78,-0.84l0.09,-0.94l1.04,-0.23l1.18,-1.76l8.02,-1.69l1.32,-1.65l0.78,-1.55l-0.6,-2.01l0.65,-0.78l-0.32,-0.61l-2.08,0.04l-0.79,-0.77l0.53,-0.65l0.58,0.16l0.89,-3.85l2.6,-2.7l0.43,-3.33l2.91,-3.68l0.18,-2.57l0.63,-0.04l-0.04,-1.26l1.54,-1.45l-0.34,-0.61l1.1,-1.37l-0.21,-0.77l0.91,-1.25l0.62,-2.53l1.04,-0.09l3.53,-3.3l0.25,-0.8l0.81,0.08l0.24,-0.67l1.13,-0.33l0.78,-1.43l-0.36,-0.93l0.77,-0.72l0.47,-1.64l-0.53,-1l0.22,-0.88l-1.68,-1.3l-0.13,-0.65l1.4,-4.1l-3.39,-2.04l-2.3,0.45l-1.11,0.89l-1.53,-0.15l-0.47,-0.99l0.4,-1.52l-0.36,-1.4l3.2,-1.96l3.14,-4.29l1.13,-0.59l0.78,-1.56l1.83,-1.4l0.11,-0.71l2.98,-0.59l0.66,0.6l1.22,-0.17l1.26,-0.86L605.72,4.91z"},{"code":"CN-NH","name":"Ningxia Hui","path":"M388.25,292.91L389.72,292.3L389.9,291.53L391.99,291.16L393.73,291.68L397.18,291.07L400.12,288.97L402.36,288.45L404.88,288.61L405.4,287.36L406.92,287.02L407.93,283.76L407.01,281.68L407.21,280.58L408.22,279.52L407.76,277.18L408.06,273.69L408.77,271.31L409.8,269.99L409.55,269.28L410.95,268.06L411.79,265.27L413.54,265.38L413.57,263.33L416.09,263.02L417.56,261.81L419.9,261.82L420.64,266.24L422.06,266.76L422.24,267.95L418.81,272.2L418.46,275.17L416.2,278.73L420.23,281.29L422.69,281.88L424.75,281.3L426.79,282.37L428.05,283.87L427.8,284.64L430.87,285.82L430.87,285.82L430.53,287.3L428.88,287.56L428.58,288.64L427.38,288.77L427.4,289.39L426.43,290.01L427.19,290.9L426.17,292.07L425.86,293.9L426.43,295.96L426.08,296.1L426.8,297.02L426.43,298.05L426.04,297.62L426.06,298.38L426.06,298.38L424.66,297.33L422.79,297.93L421.29,297.34L421.22,298.04L419.87,297.22L419.46,298.25L417.64,297.56L418,300.28L417.27,300.6L416.74,300.01L417.48,301.32L418.07,301.45L418.12,304.06L417.31,303.61L416.52,303.95L415.47,305.67L415.64,306.56L414.47,306.44L416.47,307.88L416.18,311.13L416.88,311.33L417.13,310.77L419.58,311.94L420.41,311.74L421.5,313.46L421.91,313.26L421.92,315.51L421.27,316.11L421.81,316.38L420.7,317.05L421.67,318.32L420.27,319.77L419.52,319.57L419.31,320.26L416.83,319.3L415.55,320.08L416.3,325.26L414.57,327.16L413.15,325.56L412.97,324.47L412.21,324.06L411.38,325.23L410.71,324.17L411,323.69L408.76,324.41L408.75,323.63L410.69,323.23L410.62,323.76L411.1,323.04L408.63,322.27L407.99,323.19L407.69,321.96L406.1,320.16L406.82,319.46L405.49,319.31L404.48,320.17L404.33,319.58L403.07,319.16L402.67,318.12L402.03,318.37L402.32,317.56L401.53,317.01L401.46,315.08L402.7,313.77L403.53,313.74L403.74,313.03L403.32,310.75L402.44,309.69L401.74,307.41L400.45,306.87L400.7,306.37L399.9,304.17L401.54,302.95L400.81,301.7L399.73,301.43L399.49,299.87L397.01,298.95L395.45,296.22L394.65,295.75L393.68,296.54L392.64,296.11L392.23,295.36L393.69,294.34L393.22,293.93L394.02,293.02z"},{"code":"CN-QH","name":"Quinghai","path":"M245.11,264.96L246.25,265.29L251.27,264.13L251.98,263.04L254.6,263.6L256.31,263.14L256.84,263.56L258.41,263.43L261.57,262.23L261.91,262.76L266.33,262.75L267.63,263.86L270.03,263.82L272.99,264.88L274.69,264.45L276.28,266.59L278.21,267.53L279.7,269.67L280.62,270.11L280.77,269.75L282.37,271.47L284.19,271.91L284.83,273.44L285.41,273.04L286.51,273.9L287.67,273.6L290.26,275.25L290.51,276.66L295.77,278.4L296.18,274.35L295.51,273.85L295.48,272.96L296.12,272.51L296.18,270.16L295.74,269.69L296.25,266.86L295.57,266.03L296.6,264.45L300.65,265.04L304.85,267.58L305.13,268.34L309.1,270.04L310.02,271.04L312.32,268.48L312.57,267.15L313.75,267.27L314.68,268.51L316.26,268.82L318.52,266.38L319.25,266.38L321.48,268.39L321.82,268.02L322.89,268.53L322.4,269.41L326.1,272.3L327.19,274.12L327.94,273.99L328.25,275.06L330.11,276.83L336.37,280.35L336.21,278.56L335.21,277.26L335.59,275.95L336.93,276.51L338.37,278.71L341.68,279.87L342.15,282.17L348.04,284.71L349.3,286.17L355.88,290.33L356.36,291.33L357.37,291.57L357.76,289.04L359.15,287.51L359.41,290L360.41,290.6L359.61,292.18L362.08,292.99L363.83,294.45L364,295.24L364.87,295.1L366.91,297.05L365.61,298.28L365.2,300.07L368.6,303.35L366.98,304.31L367.45,305.23L368.54,305.72L369.98,309.98L372.86,312.06L371.97,312.22L370.57,313.96L371.67,314.7L371.44,317.87L369.35,317.47L368.15,318.4L369.02,321.23L368.56,322.65L366.22,322.07L364.86,324.15L363.2,324.15L363.39,325.56L362.95,326.05L363.84,326.43L364.39,328.12L363.71,328.29L362.98,329.88L361.08,330.53L358.4,332.62L358.37,334.72L357.46,334.23L355.9,335.32L357.26,336.5L358.34,335.76L358.55,337.02L361.38,338.29L362.63,340.59L361.75,340.59L361.29,341.94L360.26,341.68L358.81,344.41L357.56,343.74L356.14,344.87L355.04,344.2L354.62,343.25L350.87,342.27L350.09,341.49L347.48,341.09L346.63,340.32L345.52,340.27L344.53,341.19L343.87,343.31L346.67,347.51L348.76,348.45L349.3,349.23L348.95,351.22L349.86,350.86L351.83,351.36L352.26,350.68L353.17,350.54L354.27,351L354.78,353.59L356.1,353.57L356.6,352.88L356.6,352.88L356.61,354.26L355.81,354.38L355.12,355.7L355.04,356.27L356.1,356.95L355,359.41L352.79,357.69L351.83,357.76L351.72,358.83L351.07,357.9L348.79,358.82L348.34,362.44L349.79,363.7L349.28,365.76L348.3,366.57L348.25,366.02L347.65,365.89L345.94,367.04L342.78,365.9L343.24,366.92L342.54,366.78L342.6,368.25L340.7,369.94L339.85,368.97L341.4,367.64L340.1,365.69L339.25,364.76L338.47,365.26L337.48,364.96L336.87,367.01L335.68,366.52L335.29,366.03L335.89,365.14L335.56,363.24L334.52,362.64L334.52,361.95L333.73,361.95L332.84,360.25L332.44,362.01L331.22,361.93L331.52,363.01L330.92,365.32L326.1,362.45L324.97,362.8L323.93,360.55L319.68,358.74L319.15,357.16L318.55,356.84L318.81,355.66L318.2,354.86L318.28,353.87L317.17,352.94L316.76,351.75L317.29,351.31L314.8,348.3L314.11,347.99L312.21,348.4L312.22,347.38L309.21,346.78L306.02,348.09L305.68,347.65L306.14,346.41L304.68,345.8L304.29,347.23L301.19,347.67L300.96,348.54L301.7,350.76L301.4,351.75L302.84,352.35L303.33,354.1L306,354.81L304.18,355.95L303.85,357.25L302.43,358.6L303.15,360.44L302.61,360.73L302.82,361.22L301.17,361.66L300.78,362.45L301.67,365.55L305.5,368.16L305.5,368.16L304.77,368.94L300.94,368.18L300.55,369.4L301.51,370.83L300.8,370.98L301.54,371.43L299.9,371.78L299.59,373.28L300.15,374.79L299.02,374.38L299.22,375.14L298.37,375.55L295.7,375.03L295.8,376.04L294.98,375.74L294.45,376.32L292.79,375.61L293.86,377.6L293.24,378.22L294.24,380.08L293.84,380.9L292.94,380.81L292.24,380.04L290.56,380.11L289.24,379.16L287.66,376.89L286.03,377.58L286.23,378.21L285.55,378.2L285.35,378.84L286.45,379.71L286.84,380.69L286.39,381.87L286.89,382.12L286.15,382.81L284.92,380.27L281.99,380.15L281.34,380.77L280.51,379.55L278.94,379.23L277.59,379.72L275.7,376.57L276.59,375.88L276.22,375.39L276.71,374.98L276.48,373.67L275.5,373.43L274.89,372.25L272.03,372.32L271.22,371.36L269.79,370.8L270.15,370.26L269.69,369.17L268.67,368.84L267.94,368.12L268.26,367.86L266.16,366.02L264.05,367.58L263.31,367.09L262.95,368.26L260.93,368.33L260.08,369.56L259.07,369.02L258.5,369.38L257.89,368.77L256.59,368.98L256,367.79L254.85,367.4L254,367.49L252.3,368.93L251.55,367.73L250.53,368.17L248.85,366.17L246.52,366.65L245.89,364.94L244.1,365.62L241.84,364.61L241.25,365.27L238.86,364.62L236.44,365.29L235.67,364.84L236,363.54L234.9,362.83L232.68,363.82L231.12,361.92L229.09,361.21L226.47,359.38L225.16,357.35L225.7,356.78L225.35,356.31L223.27,356.22L222.56,357.5L220.24,357.49L218.4,359.45L216.66,359L214.02,357.14L212.52,357.03L210.84,355.02L210.73,353.53L207.66,351.6L207.92,350.66L206.73,350L206.91,349.01L205.18,348L203.32,345.23L203.94,344.11L205.44,343.49L205.64,341.5L206.18,340.92L205.3,339.92L205.25,336.48L204.54,336.16L204.38,334.99L206.13,333.56L205.3,332.02L202.6,332.34L202.62,329.02L201.74,328.69L200.9,327.22L201.87,326.42L201.48,326.33L201.47,325.15L203.88,324.29L204.81,323.39L204.03,322.35L204.81,321.65L204.32,320.69L205.25,317.61L201.87,317.37L200.5,316.52L200.26,315.33L200.58,314.67L201.53,314.91L204.43,314.01L204.43,314.01L207.2,314.12L207.93,310.98L209.53,311.51L209.44,312.04L210.77,312.76L216.43,313.29L218.48,315L219.58,314.71L220.13,313.67L221.71,313.86L221.64,311.98L220.97,311.28L221.37,310.65L220.74,310.17L220.81,306.95L217.05,306.1L216.73,304.62L217.27,303.95L216.85,302.94L218.53,300.95L220.6,300.85L222.63,299.24L224.37,299.21L223.96,297.27L222.8,296.32L221.54,292.25L219.67,292.09L217.9,289.63L213.18,287.33L213.46,286.89L212.93,285.64L213.91,284.53L209.73,277.63L209.72,276.88L213.13,275.87L213.58,274.9L215.46,274.19L215.66,273.01L217.5,273.17L221.91,272.37L225.97,270.72L231.37,269.63L233.82,268.4L237.97,267.66L239.41,265.96z"},{"code":"CN-SA","name":"Shaanxi","labelCoordinate":{"x":0.5,"y":0.67},"path":"M430.87,285.82L434.84,287.14L435.45,289.14L437,289.91L438.46,289.13L439.26,289.65L439.87,289.04L441.89,288.75L442.49,288.83L442.47,289.38L445.11,288.85L445.09,284.73L445.66,284.04L445.25,283.51L445.91,283.56L447.12,285.07L448.56,283.3L448.56,282.44L447.02,280.92L447.52,278.4L448.52,276.68L449.53,276.11L449.85,274.86L451.29,273.78L452.22,273.9L452.01,272.49L452.89,272.38L453.23,270.91L454.35,270.48L455.07,270.77L456.42,268.85L456.92,266.67L458.8,266.2L459.95,264.7L463.21,263.13L462.13,261.21L462.35,260.24L463.56,260.54L465.4,262.66L465.77,261.87L467.07,261.51L468.32,263.7L469.57,263.1L471.56,259.67L474.77,258.27L475,258.85L473.88,260.91L474.34,261.84L474.87,261.77L474.87,261.77L476.3,262.87L475.77,263.26L474.7,266.89L472.86,268.13L473.35,269.7L471.7,273.38L472.13,274.5L471.58,276.41L470.42,276.63L468.83,278.95L467.86,278.98L467.62,280.3L466.89,280.94L467.03,284.44L469.98,287.72L469.37,288.44L470.57,289.35L470.1,289.59L470.47,290.96L469.94,292.43L468.6,292.89L468.52,293.86L469.4,294.26L469.21,295.26L467.18,298.06L465.74,299.14L466.21,299.56L465.21,299.43L465.92,300.24L465.3,301.66L465.85,301.89L465.86,302.81L465.34,303.29L466.23,303.92L466.02,304.64L465.45,304.72L466.86,306.26L466.16,312.76L468.23,321.06L463.96,331.26L464.08,334.1L463.61,335.47L464.24,336.64L465.35,336.84L465.35,336.84L465.58,337.46L465.08,338.3L465.91,339.8L466.55,339.73L466.8,340.93L465.88,341.65L466.06,342.29L468.61,343.5L467.88,345.54L469.02,346.74L468.01,347.53L468.16,348.17L470.3,349.05L471,350.97L473.21,352.49L473.49,356L472.9,357.23L472.9,357.23L472.02,358L470.99,357.99L470.81,358.84L469.9,358.89L469.46,359.66L468.79,358.78L468.08,358.78L467.6,357.27L465.86,358.52L463.42,358.71L462.56,357.96L460.87,358.22L458.61,357.38L456.91,357.6L455.88,356.96L455.44,357.61L454.25,357.64L453.39,358.82L457.84,360.05L457.5,362.48L457.91,362.91L458.8,362.41L460.81,363L462.26,363.96L462.43,365.74L463.09,366.59L462.56,367.17L461.62,366.83L460.7,367.87L459.35,367.19L455.67,367.18L455.89,367.96L454.5,369.56L454.1,371.55L455.48,372.95L455.71,374.48L455.27,375.63L455.82,376.84L455.24,377.48L455.91,378.8L455.19,379.99L455.19,379.99L451.5,380.2L451.33,378.94L450.34,378.61L448.29,376.53L446.44,376.09L444.63,374.41L443.66,374.38L441.77,372.89L441.77,372.89L441.29,372L439.35,372.46L438.23,371.9L437.6,372.65L435.54,372.74L434.93,373.83L433.33,372.94L430.9,370.05L429.21,370.32L428.32,369.79L428,368.08L427.35,367.99L426,369.96L425.49,369.82L423.65,368.13L423.83,366.34L422.82,365.26L419.83,365.79L419.8,365.12L419.32,365.11L415.22,366.87L414.32,366.1L411.4,365.22L410.76,364.58L411.16,363.89L410.53,363.1L410.07,363.67L407.76,363.8L407.34,364.86L406.83,364.58L404.85,365.62L403.62,362.47L403.62,362.47L405.38,362.9L408.21,362.01L408.91,361.19L409.09,358.96L408.65,358.9L409.11,358.21L409.48,358.91L409.51,358.03L407.37,357.2L406.27,355.38L407.77,355.39L407.98,353.68L409.44,351.95L411.26,351.94L411.32,352.55L412.31,352.88L413.59,352.06L415.4,351.79L415.72,353.09L416.57,353.59L417.38,352.34L416.77,350.7L416.04,350.46L415.76,349.16L416.18,348.35L415.25,347.63L416.29,344.43L417.44,343.88L416.91,342.33L416.22,342.15L416.6,341.58L418.45,342.26L419.02,340.35L418.1,340.06L417.17,338.58L415.84,337.96L414.28,338.1L413.91,337.2L415.76,336.29L415.6,335.44L416.93,334.57L417.15,333.6L416.14,330.73L416.9,329.43L421.58,329.32L423.7,330.45L423.76,331.23L424.75,331.73L425.12,332.58L426.31,331.75L429.3,332.13L429.81,331.21L430.67,331.88L432.77,331.44L433.42,330.81L430.83,327.02L431.63,326.9L431.83,326.09L434.73,327.05L437.45,326.01L438.25,326.7L439.59,326.03L441.42,326.39L442.91,325.51L443.08,322.27L441.86,320.82L441.55,317.11L442.55,316.14L443.46,316.13L443.91,315L444.21,313.18L443.42,311.25L444.23,309.57L441.72,307.91L440.67,308.53L439.61,306.65L437.95,306.41L437.97,305.45L437.13,306.58L435.73,306L435.16,305.37L435.4,304.7L434.6,305.08L433.95,303.45L431.19,302.32L429.42,302.39L428.71,301.16L426.48,301L426.06,298.38L426.06,298.38L426.04,297.62L426.43,298.05L426.8,297.02L426.08,296.1L426.43,295.96L425.86,293.9L426.17,292.07L427.19,290.9L426.43,290.01L427.4,289.39L427.38,288.77L428.58,288.64L428.88,287.56L430.53,287.3z"},{"code":"CN-SH","name":"Sichuan","path":"M356.6,352.88L356.92,351.78L357.39,351.88L358.68,354.43L357.8,356.4L356.54,357.27L357.38,358.11L357.22,359.27L357.85,359.47L359.2,358.12L360.31,358.2L360.78,357.09L361.97,357.79L362.19,356.47L361.71,356.08L362.75,354.82L363.94,355.22L365.48,354.15L365.07,352.43L363.69,351.79L363.74,350.06L363.15,350.37L363.46,349.63L362.43,349.2L362.66,348.27L361.79,346.77L362.85,346.18L364.33,346.45L364.84,344.67L367.75,344.78L367.12,343.58L368.2,342.98L368.69,341.99L370.11,341.88L370.71,341.23L371.43,341.58L371.84,343.05L373.44,343.34L374.21,344.62L373.64,345.14L374.02,345.95L373.56,346.6L374.35,347.53L373.99,348.9L376.48,349.91L377.52,349.8L378.46,348.9L378.41,350.86L379.5,350.37L381.77,351.19L385.28,350.77L386.84,351.94L386.66,352.98L387.47,355.07L388.43,356.1L390.13,356.3L389.77,356.84L388.56,356.58L389.47,359.46L388.94,360.47L390.09,360.88L389.33,361.95L388.33,362L388.52,363.65L391.9,365.15L392.73,366.15L393.5,365.98L394.01,366.53L395.2,366.18L395.88,367.13L397.86,366.41L398.8,367.2L403.09,365.03L402.13,363L402.87,362.2L403.62,362.47L403.62,362.47L404.85,365.62L406.83,364.58L407.34,364.86L407.76,363.8L410.07,363.67L410.53,363.1L411.16,363.89L410.76,364.58L411.4,365.22L414.32,366.1L415.22,366.87L419.32,365.11L419.8,365.12L419.83,365.79L422.82,365.26L423.83,366.34L423.65,368.13L425.49,369.82L426,369.96L427.35,367.99L428,368.08L428.32,369.79L429.21,370.32L430.9,370.05L433.33,372.94L434.93,373.83L435.54,372.74L437.6,372.65L438.23,371.9L439.35,372.46L441.29,372L441.77,372.89L441.77,372.89L439.99,373.24L440.88,374.99L439.59,374.88L439.84,376.19L438.57,376.47L439.67,378.05L441.93,379.55L442.02,380.82L441.3,381.59L440.68,381.44L439.38,383.25L437.7,383.47L438.09,383.93L437.2,385.24L437.53,385.87L435.57,387.1L435.56,387.52L436.34,387.67L435.38,389.14L435.94,390L434.53,391.04L434.43,391.87L434.99,392.14L433.62,393.59L432.26,393.49L431.68,392.45L430.66,393.51L429.96,392.94L429.05,393.11L427.94,394.53L429.03,396.06L425.51,402.07L423.5,404.51L422.84,404.83L422.26,404.15L421.64,404.87L419.42,404.94L417.75,402.13L418.06,401.45L417.08,400.92L415.6,401.07L415.38,401.74L413.78,401.94L412.98,402.66L411.76,400.73L408.59,399.41L408.01,399.66L407.78,399.06L406.69,400.13L406.53,401.64L405.17,401.36L405.61,402.33L404.12,402.85L406.71,404.97L406.52,407.46L405.03,407.77L404.47,409.24L403.4,409.44L403.29,410.06L402.57,409.98L401.63,411.29L401.29,411.09L401.4,413.4L402.19,413.33L402.81,413.97L402.6,414.85L403.09,415.63L405.58,416.18L406.1,415.66L406.42,418.33L407.47,420.67L408.73,421.22L409.78,420.07L410.54,420.52L410.57,421.13L412.7,421.31L414.22,425.02L414.16,426.17L414.72,426.56L414.72,426.56L414.71,427.25L414.01,427.07L409.61,423.34L408.57,424.7L408.61,425.53L406.66,425.35L405.17,427.17L405.41,429.61L406.51,430.25L407.15,429.34L407.66,429.72L408.53,430.59L408.48,432.31L409.36,432.08L410.33,432.57L410.48,432.08L411.84,431.74L413.08,432.75L413.21,433.87L414.01,434.47L414.19,436.61L412.41,437.57L410.93,437.21L405.34,438.95L403.46,437.3L401.16,438.26L401.16,438.26L401.27,436.73L400.54,436.56L400.31,435.72L400.89,435.1L400.71,434.13L399.81,434.23L399.66,433.2L397.93,432.72L397.03,433.23L395.79,435.38L392.04,436.31L391.08,435.75L388.57,433.44L389.59,433.25L390.27,432.4L390.48,431.55L389.74,431.31L390.49,430.55L389.72,430.23L389.41,429.33L388.46,429.51L387.93,428.47L387.83,426.54L389.18,426.11L390.01,425.11L388.57,425.22L387.81,424.56L385.94,425.42L384.09,425.48L382.74,424.57L381.98,426.65L383.01,429.76L381.04,431.19L380.08,430.37L377.75,432.3L377.66,433.72L378.25,433.68L378.47,434.54L379.17,434.44L378.46,435.27L378.3,436.75L375.56,439.35L375.72,440.22L374.91,440.19L373.82,442.29L371.91,443.02L371.34,442.38L370.6,444.02L370.92,446.54L370.42,447.85L372.8,454.8L371.98,455.53L371.86,457.4L370.49,457.21L367.88,459.39L367.02,458.8L367.37,457.59L366.43,457.2L362.63,459.23L360.66,461.34L358.49,460.76L357.38,461.68L356.16,459.29L355.52,458.92L354.62,459.38L354.26,458.36L355.11,457.99L354.84,456.74L351.81,454.51L351.81,453.94L352.69,453.8L352.95,452.85L352.56,452.41L353.32,451.58L352.53,451.32L352.64,452.01L351.78,452.17L351.45,449.89L350.23,449.62L350.19,448.95L348.63,447.91L348.92,445.39L347.41,445.15L347.54,444.2L346.02,441.6L345.32,441.58L345.29,439.65L344.66,439.52L344.82,438.67L344.13,438.59L343.17,436.89L342.89,435.33L342.25,435.3L341.11,436.76L339.63,435.96L338.3,438.08L338.07,436.04L336.36,435.46L336.54,434.76L335.2,433.53L334.48,431.97L334.63,431.49L336.36,430.94L336.42,429.48L334.93,428.76L335.11,427.89L334.08,427.29L333.46,425.75L332.76,425.44L332.07,425.88L332.06,424.59L330.91,423.88L330.61,422.05L329.41,422.51L328.11,425.77L326.34,426.47L326.87,430.2L326.56,431.85L325.49,431.01L323.74,428.2L323.84,425.71L322.91,422.56L322.97,416.21L322.97,416.21L321.47,410.12L322.45,406.38L322.09,404.18L321.36,403.07L320.33,395.31L321.06,394.26L318.78,392.33L319.01,390.64L316.52,387.96L316.93,385.79L317.61,385.82L318.77,387.04L320.07,385.2L316.76,382.06L314.15,378.5L314.37,375.84L311.76,372.58L311.38,370.65L308.52,368.98L305.5,368.16L305.5,368.16L301.67,365.55L300.78,362.45L301.17,361.66L302.82,361.22L302.61,360.73L303.15,360.44L302.43,358.6L303.85,357.25L304.18,355.95L306,354.81L303.33,354.1L302.84,352.35L301.4,351.75L301.7,350.76L300.96,348.54L301.19,347.67L304.29,347.23L304.68,345.8L306.14,346.41L305.68,347.65L306.02,348.09L309.21,346.78L312.22,347.38L312.21,348.4L314.11,347.99L314.8,348.3L317.29,351.31L316.76,351.75L317.17,352.94L318.28,353.87L318.2,354.86L318.81,355.66L318.55,356.84L319.15,357.16L319.68,358.74L323.93,360.55L324.97,362.8L326.1,362.45L330.92,365.32L331.52,363.01L331.22,361.93L332.44,362.01L332.84,360.25L333.73,361.95L334.52,361.95L334.52,362.64L335.56,363.24L335.89,365.14L335.29,366.03L335.68,366.52L336.87,367.01L337.48,364.96L338.47,365.26L339.25,364.76L340.1,365.69L341.4,367.64L339.85,368.97L340.7,369.94L342.6,368.25L342.54,366.78L343.24,366.92L342.78,365.9L345.94,367.04L347.65,365.89L348.25,366.02L348.3,366.57L349.28,365.76L349.79,363.7L348.34,362.44L348.79,358.82L351.07,357.9L351.72,358.83L351.83,357.76L352.79,357.69L355,359.41L356.1,356.95L355.04,356.27L355.12,355.7L355.81,354.38L356.61,354.26z"},{"code":"CN-SD","name":"Shandong","path":"M560,279.73l2.1,1.2l0.17,0.77l5.35,0.32l0.68,0.74l1.07,-1.16l2.93,-0.1l1.31,0.76l0.64,2.21l1.14,0.73l-0.04,1.19l1.25,0.67l-0.18,0.45l1.18,-0.77l0.09,0.43l-0.83,0.36l1.28,1.91l-2.43,-0.9l-0.81,0.2l-1.55,2.54l0.5,3.92l1.9,1.26l0.29,1.18l0.08,-0.52l0.6,0.66l0.75,-0.14l-0.14,1.1l3.63,-1.03l0.52,1.15l0.2,-0.91l2.05,-0.22l1.83,-2.01l0.13,-0.81l-0.83,-1.11l3.11,-1.14l2.64,-2.19l0.34,-1.22l-1.27,-0.47l1.78,-0.1l4.81,-2.2l2.57,0.31l-0.15,0.56l0.92,0.95l1.68,0.09l-0.07,1.6l0.54,0.46l2.03,-0.01l0.43,-0.38l-0.33,-0.37l1.1,0.49l-0.76,0.39l1.06,1.48l1.5,0.8l1.19,0.04l0.11,-0.44l1.2,0.66l-0.11,-0.59l2.25,-0.28l-0.05,0.8l0.64,0.04l-0.31,-1.04l1.39,-1.14l0.93,0.01l0.18,0.56l-0.48,0.21l0.6,1.25l0.94,-0.54l1.05,0.85l1.96,-0.35l-0.25,0.71l0.52,0.22l-0.06,-0.52l1.65,-0.31l0.97,0.44l-1.92,0.74l0.44,0.32l-0.52,-0.08l0.01,0.89l0.96,1.34l-0.81,0.18l0.2,0.56l-1.07,-0.14l-1.06,1.96l0.04,0.44l1.59,-0.34l-0.26,2.06l-0.36,0l0.21,-0.61l-0.93,0.11l-0.09,0.97l-0.78,0.39l-2.36,-0.02l0.34,-0.99l-0.74,-0.71l-1.31,0.71l-0.36,-1l-0.56,0.1l-4.21,2.35l0.13,1.2l-0.55,-0.6l-1.51,0l1.5,-1.07l-1.38,0.51l0.09,-0.5l-0.56,1.3l-3.58,1.26l-1.92,1.48l-1.12,-0.1l-0.41,-0.92l-0.51,-0.01l-0.6,0.67l1.87,0.69l0.04,1.33l-0.65,0.4l-0.29,1.19l-0.92,-1.5l-0.91,0.15l-0.7,0.99l0.54,1.01l-0.91,-0.12l-0.19,0.82l0.49,0.18l0.4,2.24l-2.11,0.27l-2.64,1.15l-0.65,-0.27l0.94,-2.24l-0.48,-0.52l-0.52,0.22l0.33,0.53l-1.74,-0.24l-0.82,1.61l0.88,0.6l-0.06,0.5l0.79,-0.47l-0.68,1.33l0.69,-0.45l-0.01,0.58l0.72,-0.77l0.1,0.73l-1.54,1.22l0.41,-0.92l-1.99,1.11l-0.47,2.42l-1.22,-0.62l0.38,0.72l-0.91,1.58l-0.58,-0.11l0.34,-0.6l-0.41,-0.16l-0.76,1.34l-0.34,-1.18l-0.75,1l-0.61,-0.06l-0.85,3.09l-2,2.1l-0.46,2.5l-0.9,0.04l0,0l-1.29,-0.33l-1.07,0.93l-2.44,-0.1l-0.73,0.48l0.03,1.26l-1.79,2.88l0.66,0.54l-1.07,0.68l-2.07,-0.5l-1.21,1.65l-0.3,2.62l-2.54,0.78l-0.45,-0.1l0.14,-0.91l-0.53,-0.51l0.46,-0.98l-1.18,-0.14l0.22,-1.41l-1.84,-0.42l-1.8,0.42l-0.11,1.97l-1.47,-0.34l-1.55,1.18l-1.21,-0.4l-1.37,-1.55l-1.14,0.88l-0.17,1.13l-0.58,0.06l-1.01,-2.76l-0.8,-0.25l0.27,-0.8l-1.4,-2.48l-2.41,-1.14l-0.19,0.4l-1.85,-0.31l-2.21,0.57l-0.57,2.2l-0.46,0.16l0.1,1.61l0,0l0,0l0,0l-1.72,1.35l-0.59,-0.41l0,0l-0.72,0.29l-0.42,-0.7l-0.8,0.19l-0.43,-0.47l-0.38,0.53l-1.81,0.4l-1.65,-0.6l-0.28,0.65l-1.77,-0.27l-1.16,-1.44l-0.19,-1.88l-1.67,-1.12l-0.65,0.22l0.1,-0.85l-0.73,-0.18l0.22,-0.65l-1.27,-0.71l-2.46,0.55l-1.42,-0.75l0.5,-2.33l1.1,-0.5l1.15,-2.57l1.89,-1.11l0.55,0.46l1.67,-1.12l-0.3,-1.4l0.55,0.23l1.63,-2.55l1.99,-0.17l0.82,-1.62l2.01,-0.32l-0.2,-0.58l0.74,-1.05l1.46,0.07l0.86,-1.78l-0.09,-0.49l-0.49,0.1l-0.74,0.82l-2.46,0.65l-3.29,1.75l-0.76,-0.34l0.01,0.59l-1.62,1.51l-0.09,-2.82l1.16,-0.73l0.41,-2.43l0,0l-0.11,-1.38l-0.61,-1.03l-0.77,0.2l-0.96,-2.87l0.73,-1.86l1.82,-2.34l2.54,-0.84l1.18,-2.79l1.12,-1.25l0.49,-1.99l0.72,-0.5l0.25,-1.64l2.27,-0.72l1.02,0.29l0.51,-0.62l-0.67,-0.41l-0.01,-0.74l0.6,0.13l0.65,-1.76l1.4,1.64l4.54,-5.72l8.05,-0.28l1.81,-3.51l1.59,-0.15l2.09,-2.92l0,0L560,279.73z"},{"code":"CN-SH","name":"Shanghai","path":"M617.84,394.31l1.03,0.87l-1.33,0.02L617.84,394.31zM609.64,385.16l0.99,0.36l-0.18,0.88l-0.74,-0.37L609.64,385.16zM606.03,383.49l3.18,1.6l0.26,0.97L606.03,383.49zM603.72,383.43l1.08,0.29l4.16,3.24l1.48,2.16l0.86,2.67l-0.51,1.23l-4.56,0.37l-3.35,1.95l0,0l-0.11,-0.81l-0.57,-0.56l-1.07,0.01l-0.33,-0.98l-1.46,0.35l0.13,-2.56l-1.26,-0.15l0,0l-0.24,-1.76l2.15,-0.12l0.15,-1.85l1.08,-0.24l-0.5,-1.39l0.56,-0.21l0.03,-0.74l2.2,-0.95l0,0L603.72,383.43zM603.28,377.98l4.73,3.27l2.88,0.86l0.88,0.71l-0.06,0.78l-1.69,0.74l-5.7,-2.7l-2.75,-2.46L603.28,377.98z"},{"code":"CN-SX","name":"Shanxi","path":"M512.7,239.27L513.55,241.11L514.58,241.7L514.41,243.42L514.98,245.36L516.65,245.31L517.7,245.99L516.71,247.18L514.23,247.56L513.96,248.23L512.63,248.59L512,248.39L512.01,250.24L511.44,250.49L510.94,249.34L510.63,250.73L509.88,251.25L511.28,251.54L511.75,252.77L513.79,253.62L515.97,253.61L516.54,254.83L516.16,257.15L517.98,258.84L516.29,262.92L516.24,263.83L516.81,264.32L515.8,265.02L515.44,266.33L514.55,265.76L513.5,266.94L512.38,266.91L511.55,265.53L509.59,266.7L508.08,268.23L508.18,269.6L509.18,270.51L508.98,271.65L508.51,271.58L508.01,272.57L507.38,272.45L507.34,273.32L506.11,273.46L505.47,274.88L505.74,276.36L505.01,277.69L505.25,279.5L505.73,280.16L508.91,281.29L508.68,281.99L509.48,282.81L510.68,286.67L511.58,287.46L510.93,288.5L511.87,288.27L512.77,289L509.58,295.91L508.07,297.41L508.37,301.65L507.85,302.01L507.18,301.54L506.98,302.98L504.25,304.28L504.78,304.32L504.42,305.33L505.25,305.6L505.8,306.55L505.38,307.59L507.32,308.73L507.6,309.72L507.6,309.72L506.86,312.21L507.18,312.5L506.68,312.75L507.29,313.19L506.63,313.41L506.72,314.79L507.21,314.98L507.05,315.54L506.43,315.51L506.67,317.86L505.64,318.16L506.27,320.97L505.33,320.8L504.65,322.61L502.17,323.44L502.16,324.23L501.01,323.98L499.86,325.64L498.28,325.37L498.37,326.1L497.46,326.94L496.05,326.83L495.3,327.65L494.3,327.34L493.99,326.67L493.56,327.37L490.78,326.97L489.96,327.45L489.35,327.37L489.37,326.87L488.48,327.22L486.53,326.45L486.16,330.27L485.18,329.53L483.57,329.67L483.26,330.3L481.61,330.92L481.63,331.59L480.34,333.1L475.97,333.97L475.08,333.72L472.68,335.31L472.21,334.87L471.86,335.96L470.05,336.05L469.17,337L465.35,336.84L465.35,336.84L464.24,336.64L463.61,335.47L464.08,334.1L463.96,331.26L468.23,321.06L466.16,312.76L466.86,306.26L465.45,304.72L466.02,304.64L466.23,303.92L465.34,303.29L465.86,302.81L465.85,301.89L465.3,301.66L465.92,300.24L465.21,299.43L466.21,299.56L465.74,299.14L467.18,298.06L469.21,295.26L469.4,294.26L468.52,293.86L468.6,292.89L469.94,292.43L470.47,290.96L470.1,289.59L470.57,289.35L469.37,288.44L469.98,287.72L467.03,284.44L466.89,280.94L467.62,280.3L467.86,278.98L468.83,278.95L470.42,276.63L471.58,276.41L472.13,274.5L471.7,273.38L473.35,269.7L472.86,268.13L474.7,266.89L475.77,263.26L476.3,262.87L474.87,261.77L474.87,261.77L475.2,260.94L477.58,260.77L478.59,259.35L478.7,257.25L481.41,257.39L482.79,258.14L484.93,257.75L485.49,254.63L489.64,247.29L491.57,246.52L495.22,248.68L496.46,248.04L497.01,246.07L498.24,245.56L501.54,244.63L502.37,246.15L505.44,245.7L508.41,242.9L509.28,243.92L510.51,242.88L511.78,242.73L511.85,239.63z"},{"code":"CN-TJ","name":"Tianjin","path":"M553.79,247.69L555.84,247.67L557.09,249.81L558.39,250.21L558.33,251.11L559.03,251.28L558.68,252.09L557.98,251.65L555.86,251.72L555.48,253.31L555.93,255.16L557.42,256.9L556.85,258.08L557.76,258.3L557.99,258.96L558.66,258.02L560.78,258.37L560,261.33L560.89,261.16L561.76,261.86L562.48,264.15L562.48,264.15L560.57,264.37L558.24,266.23L558.97,268.11L558.05,268.25L556.98,269.94L556.13,273.3L556.13,273.3L555.91,274.05L552.23,274.69L551.86,273.75L550.29,274.41L549.24,272.55L547.94,272.73L546.93,271.93L545.85,271.94L545.29,268.82L545.91,267.29L547.75,266.7L548.12,265.52L547.15,264.48L547.58,262.35L547.22,261.89L546.79,262.19L547.18,260.8L546.43,260.3L546.46,257.82L546.46,257.82L547.66,256.41L547.66,256.41L548.34,256.18L548.66,257.29L550.92,257.54L551.44,255.18L550.94,254.36L552.23,253.95L550.94,253.44L550.66,252.71L551.45,250.07L551.45,250.07L553.79,248.62z"},{"code":"CN-TW","name":"Taiwan","path":"M606.73,516.2l0.27,1.16l-1.15,-1.08L606.73,516.2zM582.5,495.43l0.56,0.78l-1.57,0.63l-0.4,-0.41l0.26,-0.65L582.5,495.43zM581.64,494.5l0.34,0.57l-0.5,-0.35l-0.67,0.46l-0.02,0.88l-0.62,0.06l0.58,-1.3L581.64,494.5zM567.03,482.83l0.44,1.39l-2.11,0.4l-0.04,-1.15l1.1,0.23L567.03,482.83zM589.92,507.16l-0.96,-2.97l-1.66,-1.46l0.67,-0.73l0.17,-2.26l0.79,-1.29l-0.08,-1.4l-0.46,-0.14l0.77,-4.17l1.19,-0.35l-0.28,-0.42l2.14,-3.07l-0.52,-0.17l1.31,-1.37l0.05,-0.84l2.91,-4.7l2.36,-2.07l0.19,-1.37l1.66,-2.64l4.29,-1.52l0.78,-1.42l1.86,-0.59l1.6,1.76l2.49,0.71l0.22,1.24l0.84,0.2l-2.26,2.34l0.63,4.25l-3.28,6.19l0.38,1.08l-0.5,0.62l-1.15,6.58l-1.52,3.79l0.08,1.24l-2.7,3.63l-0.21,1.25l-1.79,1.24l-1.74,4.54l0.08,4.03l-0.72,0.62l0.28,1.22l-1.27,-0.82l-0.67,0.35l-0.33,-1.28l0.38,-1.05l-0.93,-2.69l-3.6,-2.76l-1.37,-1.96L589.92,507.16z"},{"code":"CN-XY","name":"Xinjiang Uygur","path":"M180.43,88.68L180.86,89.77L180.43,91.12L181.47,92.31L179.6,93.26L179.39,94.26L180.3,94.92L180.07,95.63L181.6,96.6L182.55,96.6L183.62,97.65L182.73,98.65L182.28,101.42L182.55,100.25L186.81,102.01L187.76,103.65L189.08,103.24L190.23,104.75L189.98,106.71L192.23,108.48L195.01,109.55L195.67,110.5L195.71,112.05L197.8,111.96L199.85,110.24L202.34,110.14L202.99,112.08L205.25,114.48L207.12,114.5L207.37,113.23L208.69,113.65L208.83,115.45L212.09,117.49L211.98,118.27L213.6,120.67L214.37,125.18L217.1,129.68L219.37,130.57L219.95,133.1L221.25,135.2L220.81,137.2L221.44,137.73L219.34,142.46L219.66,144.37L220.73,145.95L220.74,147.59L216.72,153.26L216.21,156.73L217.88,159.2L218.1,160.86L219.14,161.29L218.93,162.55L222.13,162.37L225.19,164.11L226.28,163.4L227.95,164.88L233.3,164.74L235.27,165.43L237.84,165.11L239.6,165.8L246.61,165.65L252.15,166.59L260.86,171.97L262.29,173.31L262.48,174.36L265.65,175.75L267.16,177.52L270.88,179.16L276.36,178.55L275.36,182.84L277.96,183.83L279.72,189.22L282.14,194.04L282.3,196.4L287.74,203.01L288.25,205.85L288.25,205.85L284.86,207.86L283.96,216.18L284.33,217.9L283.51,219.85L281.87,220.76L279.68,221.07L277.82,220.53L272.03,221.8L266.96,224.45L258.4,233.38L255.93,236.93L253.81,241.3L250.2,243.64L244.64,243.21L244.7,249.72L242.75,253.4L244.15,258.82L245.02,260.33L245.11,264.96L245.11,264.96L239.41,265.96L237.97,267.66L233.82,268.4L231.37,269.63L225.97,270.72L221.91,272.37L217.5,273.17L215.66,273.01L215.46,274.19L213.58,274.9L213.13,275.87L209.72,276.88L209.73,277.63L213.91,284.53L212.93,285.64L213.46,286.89L213.18,287.33L217.9,289.63L219.67,292.09L221.54,292.25L222.8,296.32L223.96,297.27L224.37,299.21L222.63,299.24L220.6,300.85L218.53,300.95L216.85,302.94L217.27,303.95L216.73,304.62L217.05,306.1L220.81,306.95L220.74,310.17L221.37,310.65L220.97,311.28L221.64,311.98L221.71,313.86L220.13,313.67L219.58,314.71L218.48,315L216.43,313.29L210.77,312.76L209.44,312.04L209.53,311.51L207.93,310.98L207.2,314.12L204.43,314.01L204.43,314.01L201.35,312.97L198.15,310.73L196.81,311.38L194.22,309.64L192.23,310.63L190.4,309.25L189.96,308.24L188.82,308.37L188.46,307.8L185.67,307.99L184.22,308.67L182.3,308.5L181.16,309.55L179.13,309.32L177.09,309.99L175.84,309.68L175.67,308.85L174.67,308.83L173.75,309.65L172.33,309.88L171.77,310.69L169.83,310.51L168.63,311.17L168.19,310.53L166.83,310.73L165.78,311.64L163.67,312.17L163,311.88L160.44,312.84L159.75,313.32L159.52,314.82L157.94,317.72L156.69,318.68L153.45,319.19L152.18,320.81L151.27,320.62L151.27,319.81L148.01,318.74L145.05,319.26L142.58,320.91L137.71,322.33L137.69,323.41L134.26,325.26L131.89,324.28L130.35,325.21L127.2,325.6L126.18,325.51L125.62,324.7L124.35,324.9L122.4,324.31L120.94,324.64L119.32,323.31L118.84,320.42L116.76,320.16L115.94,320.94L114.65,320.09L112.48,319.69L111.66,320.66L110.95,320.73L110.74,322.24L107.31,323.86L106.9,325.73L105.79,325.85L105.98,326.25L104.98,326.77L102.59,327.17L101.09,327.02L99.61,325.26L96.84,325.86L95.32,324.5L94.47,324.91L94.4,326.02L90.53,325.61L89.73,324.7L88.52,324.69L88.23,323.86L87.33,323.69L85.17,325.23L84.86,327.24L83.34,329.26L82.1,329.86L81.36,332.9L80.01,333.06L79.78,334.62L80.44,335.37L79.71,335.89L79.68,337.98L78.93,338.73L76.97,339.22L75.69,338.77L71.7,339.72L70.74,339.29L69.81,339.73L69.3,340.93L68.28,340.14L67.91,340.39L67.91,340.39L63.39,336.73L61.47,336.83L61.23,336.17L59.78,335.88L59.12,335.12L57.24,329.51L57.76,328.7L56.73,327.67L56.09,325.42L57.51,323.32L55.71,323.39L54.97,324.2L53.86,322.8L52.35,323.38L48.63,323.57L47.5,322.61L45.91,322.64L41.69,320.43L40.43,320.39L38.45,318.67L38.09,316.61L35.33,317.92L33.13,317.92L32.97,316.45L32.08,315.11L30.94,315.05L30.24,314.25L30.12,313.25L31.16,312.74L31,311.89L31.62,311.79L30.77,310.76L31.03,308.26L29.05,304.78L26.53,303.32L25.19,303.35L24.99,304.04L24.03,304.06L23.36,300.58L21.28,300.35L20.14,299.37L18.6,299.5L17.3,300.71L16.4,299.87L16.16,298.7L15.02,299.33L14.28,298.18L13.79,298.2L12.84,299.14L11.12,297.85L11.82,297.01L11.83,295.86L14,296L15.03,295.33L15.83,296.31L16.9,296.19L17.46,295.11L19.75,294.62L20.01,292.87L18.98,291.34L17.37,290.88L16.98,289.27L18.24,287.53L17.12,286.43L17.2,283.67L16.52,283.33L15.58,280.85L15.49,278.3L16.55,277.6L16.54,275.74L16.01,276.06L13.62,274.47L10.27,273.31L7.22,273.15L6.53,275.31L4.69,275.23L2.88,274L3.15,273.42L1.88,269.89L2.45,268.82L3.57,268.68L3.69,268.11L3.37,267.2L2.42,267.25L1.63,265.01L0.06,263.53L1.45,261.89L1.33,260.18L3.66,260.2L4.86,258.08L4.51,255.91L3.52,255.18L5.41,251.43L4.95,251.05L6.14,249.97L7.04,250.14L8.54,249.39L9.95,250.05L13.05,246.91L14.3,247.05L14.54,245.73L15.78,245.65L16.49,246.2L17.01,245.87L15.62,244.07L16.11,242.77L18.13,244L21.05,244.15L24.1,241.38L25.78,240.55L26.38,243.07L27.4,243.54L26.41,245.11L27.13,246.86L28.71,245.83L29.89,246.72L30.5,245.22L32.07,244.71L33.29,245.12L34.62,243.82L35.11,245.5L37.51,243.8L37.72,242.6L39.09,241.02L38.93,238.91L40.87,237.35L40.85,235.53L41.84,234.52L44.15,233.88L45.49,234.6L48.1,234.33L50.5,234.99L55.98,233.58L56.94,234.33L58.59,233.55L59.63,231.31L61.06,230.34L61.15,228.01L64.28,227.01L65.14,225.65L66.76,225.23L74.03,220.75L74.86,220.71L74.95,221.78L77.3,221.62L79.97,217.42L85.03,217.05L84.57,214.32L85.1,213.45L84.1,210.79L84.2,209.84L84.97,209.29L83.88,208.37L83.63,206.83L84.73,203.94L86.49,203.96L88.93,202.78L86.57,201.23L86.45,200.18L88.96,198.72L91.28,198.42L91.57,197.89L91.05,195.93L89.81,195.59L90.89,193.06L88.03,186.53L85.8,175.17L86.57,172.91L86.03,172.08L87.62,171.19L87.56,170.72L85,168.82L81.85,169.51L80.96,168.13L79.51,167.76L82.51,165.79L82.5,165.09L84.22,165.42L85.35,164.78L86.28,165.18L87.4,163.87L89.12,164.01L90.67,162.87L92.72,163.65L93.49,162.99L95.05,162.86L95.43,162.06L96.18,162.21L99.33,160.83L100.23,161.06L102.81,159.42L104.06,160.49L104.44,162.32L105.44,162.24L106.16,163.18L109.93,161.76L112.88,163.82L114.22,161.84L114.71,159.55L114.36,158.26L112,157.54L110.17,155.76L113.11,148.31L113.42,144.66L116.07,138.57L116.94,134.32L118.57,129.47L119.29,128.67L119.76,125.78L121.58,125.56L122.46,126.41L123.81,126.49L124.54,127.44L125.16,127.26L126.71,128.63L132.49,130.34L134.72,129.71L137.43,129.51L138.41,130.11L140.68,129.62L141.94,131.4L140.79,132.66L142.19,132.9L144.17,132.07L144.34,131.28L145.53,130.94L147.46,128.71L151.34,128.61L151.93,126.18L153.45,125.43L153.58,122.74L152.27,120.06L152.49,118.42L151.49,112.2L152.36,108.1L153.94,104.05L155.39,102.97L157.47,102.56L159.99,102.82L161.3,101.58L162.76,101.7L164.72,100.78L165.29,99.22L166.92,97.5L166.72,96.24L167.54,95.06L166.55,93.68L166.42,92.22L167.76,91.07L168.21,89.88L169.52,90.11L171.62,89.14L175.2,90.44L176.31,90.01L176.39,89.32L177.11,89.6L178.79,88.78z"},{"code":"CN-TB","name":"Xizang (Tibet)","path":"M67.91,340.39L68.28,340.14L69.3,340.93L69.81,339.73L70.74,339.29L71.7,339.72L75.69,338.77L76.97,339.22L78.93,338.73L79.68,337.98L79.71,335.89L80.44,335.37L79.78,334.62L80.01,333.06L81.36,332.9L82.1,329.86L83.34,329.26L84.86,327.24L85.17,325.23L87.33,323.69L88.23,323.86L88.52,324.69L89.73,324.7L90.53,325.61L94.4,326.02L94.47,324.91L95.32,324.5L96.84,325.86L99.61,325.26L101.09,327.02L102.59,327.17L104.98,326.77L105.98,326.25L105.79,325.85L106.9,325.73L107.31,323.86L110.74,322.24L110.95,320.73L111.66,320.66L112.48,319.69L114.65,320.09L115.94,320.94L116.76,320.16L118.84,320.42L119.32,323.31L120.94,324.64L122.4,324.31L124.35,324.9L125.62,324.7L126.18,325.51L127.2,325.6L130.35,325.21L131.89,324.28L134.26,325.26L137.69,323.41L137.71,322.33L142.58,320.91L145.05,319.26L148.01,318.74L151.27,319.81L151.27,320.62L152.18,320.81L153.45,319.19L156.69,318.68L157.94,317.72L159.52,314.82L159.75,313.32L160.44,312.84L163,311.88L163.67,312.17L165.78,311.64L166.83,310.73L168.19,310.53L168.63,311.17L169.83,310.51L171.77,310.69L172.33,309.88L173.75,309.65L174.67,308.83L175.67,308.85L175.84,309.68L177.09,309.99L179.13,309.32L181.16,309.55L182.3,308.5L184.22,308.67L185.67,307.99L188.46,307.8L188.82,308.37L189.96,308.24L190.4,309.25L192.23,310.63L194.22,309.64L196.81,311.38L198.15,310.73L201.35,312.97L204.43,314.01L204.43,314.01L201.53,314.91L200.58,314.67L200.26,315.33L200.5,316.52L201.87,317.37L205.25,317.61L204.32,320.69L204.81,321.65L204.03,322.35L204.81,323.39L203.88,324.29L201.47,325.15L201.48,326.33L201.87,326.42L200.9,327.22L201.74,328.69L202.62,329.02L202.6,332.34L205.3,332.02L206.13,333.56L204.38,334.99L204.54,336.16L205.25,336.48L205.3,339.92L206.18,340.92L205.64,341.5L205.44,343.49L203.94,344.11L203.32,345.23L205.18,348L206.91,349.01L206.73,350L207.92,350.66L207.66,351.6L210.73,353.53L210.84,355.02L212.52,357.03L214.02,357.14L216.66,359L218.4,359.45L220.24,357.49L222.56,357.5L223.27,356.22L225.35,356.31L225.7,356.78L225.16,357.35L226.47,359.38L229.09,361.21L231.12,361.92L232.68,363.82L234.9,362.83L236,363.54L235.67,364.84L236.44,365.29L238.86,364.62L241.25,365.27L241.84,364.61L244.1,365.62L245.89,364.94L246.52,366.65L248.85,366.17L250.53,368.17L251.55,367.73L252.3,368.93L254,367.49L254.85,367.4L256,367.79L256.59,368.98L257.89,368.77L258.5,369.38L259.07,369.02L260.08,369.56L260.93,368.33L262.95,368.26L263.31,367.09L264.05,367.58L266.16,366.02L268.26,367.86L267.94,368.12L268.67,368.84L269.69,369.17L270.15,370.26L269.79,370.8L271.22,371.36L272.03,372.32L274.89,372.25L275.5,373.43L276.48,373.67L276.71,374.98L276.22,375.39L276.59,375.88L275.7,376.57L277.59,379.72L278.94,379.23L280.51,379.55L281.34,380.77L281.99,380.15L284.92,380.27L286.15,382.81L286.89,382.12L286.39,381.87L286.84,380.69L286.45,379.71L285.35,378.84L285.55,378.2L286.23,378.21L286.03,377.58L287.66,376.89L289.24,379.16L290.56,380.11L292.24,380.04L292.94,380.81L293.84,380.9L294.24,380.08L293.24,378.22L293.86,377.6L292.79,375.61L294.45,376.32L294.98,375.74L295.8,376.04L295.7,375.03L298.37,375.55L299.22,375.14L299.02,374.38L300.15,374.79L299.59,373.28L299.9,371.78L301.54,371.43L300.8,370.98L301.51,370.83L300.55,369.4L300.94,368.18L304.77,368.94L305.5,368.16L305.5,368.16L308.52,368.98L311.38,370.65L311.76,372.58L314.37,375.84L314.15,378.5L316.76,382.06L320.07,385.2L318.77,387.04L317.61,385.82L316.93,385.79L316.52,387.96L319.01,390.64L318.78,392.33L321.06,394.26L320.33,395.31L321.36,403.07L322.09,404.18L322.45,406.38L321.47,410.12L322.97,416.21L322.97,416.21L321.08,417.13L321.79,419.03L320.55,420.14L321.06,422.27L319.54,422.54L318.75,419.78L316.89,420.18L317.61,423.61L316.4,424.52L316.77,426.92L317.53,427.36L318.43,429.3L317.85,430.84L316.8,431.81L315.85,431.54L314.02,432.61L313.45,429.95L312.51,428.49L311.48,429.06L312.27,430.63L311.02,431.17L310.65,432.03L310.65,432.03L309.77,431.16L309.1,431.23L309.18,430.36L307.62,428.78L306.39,429.35L305.26,426.82L304.3,427.42L303.57,426.38L302.34,428.71L302.25,430.23L301.62,429.94L300.79,430.81L298.47,429.87L297.44,428.86L296.23,429.62L295,428.63L293.53,428.85L292.04,427.48L289.43,428.15L288.69,429.22L288.33,428.51L287.02,428.28L288.35,427.18L287.75,426.51L288.78,426.08L288.71,425.64L289.88,425.02L289.61,424.3L291.04,423.82L291.42,423L289.67,419.91L290.28,418.69L288.02,419.36L285.74,421.18L285.48,420.72L285.98,420L285.09,418.71L288.02,417.37L288.6,416.13L288.23,415.71L286.72,416.44L284.66,413.15L283.1,414.31L282.13,414.19L279.07,416.23L278.57,416.06L278.41,416.69L277.8,416.75L277.91,417.97L277.28,417.81L276.66,419.31L274.37,419L274.17,418.25L272.54,418.15L270.97,417.34L271.29,417.95L269.38,417.17L268.45,417.46L268.19,416.36L266.31,414.81L265.42,416.53L263.82,416.56L261.08,418.62L260.33,420.48L258.3,422.1L258.39,423.05L257.43,424.53L256.4,424.02L255.53,424.58L251.94,424.36L251.72,424.79L251.36,424.47L249.99,424.99L249.22,426.92L248.04,427.85L248.66,428.41L248.5,429.37L246.03,429.81L245.74,430.84L245.28,430.4L241.78,432.34L241.47,433.24L242.44,434.28L240.18,436.67L239.43,436.38L237.09,437.28L236.43,436.15L235.75,436.14L232.07,438.18L231.33,437.87L230.87,436.83L229.89,436.93L228.52,436.2L228.92,434.98L226.58,434.45L224.51,432.85L221.75,434.57L220.74,434.5L219.61,433.52L217.49,433.46L217,432.83L213.6,433.6L215.65,431.04L212.26,430.54L210.47,429.56L209.55,430.09L207.83,429.5L206.62,429.81L205.37,430.91L205.31,431.63L202.89,431.89L201.16,433.38L200.75,434.4L199.66,434.65L199.8,436.1L198.56,436.55L196.85,439.55L194.9,441.2L194.85,444.4L192.45,441.86L192.25,440.28L193.25,438.84L193.74,436.13L193.08,433.96L192.04,433.08L190.98,433.07L190.4,432.26L189.35,433.58L185.63,434.86L184.25,434.66L183.99,436.02L182.55,435.32L180.96,436.88L178.71,436.35L177.49,436.8L177.25,436.01L175.78,436.66L175.21,436.24L171.66,436.63L171.8,436.1L170.48,435L169.11,434.71L168.05,433.73L167.37,433.86L166.16,432.59L163.78,433.78L163.91,435.23L162.58,435.41L162.67,434.61L161.76,434.92L160.01,434.3L159.39,431.71L158.25,432.86L158.88,435L157.33,435.28L156.68,434.94L155.95,432.49L151.77,429.66L150.23,429.43L149.45,430.09L147.84,430.11L147.23,429.27L146.09,429.38L147.08,425.3L146.3,424.45L142.85,426.02L140.73,425.38L140.32,423.75L137.3,423.6L137.51,422.55L137.06,421.95L135.3,421.07L133.92,421.48L134.12,420.01L133.5,419.11L134.5,416.78L133.22,415.85L130.97,415.31L129.3,416.41L128.37,416.34L127.36,417.38L126.11,416.83L122.38,411.42L117.38,409.59L113.03,405.27L109.23,404.04L109.38,402.82L108.61,400.6L102.12,399.07L101.5,399.17L101.38,399.98L100.2,399.23L99.24,399.36L98.97,402.42L98.38,403.17L97.44,403.28L97.33,404.54L96.61,404.95L95.31,404.23L95.4,403.19L94.24,401.56L91.71,400.73L88.85,398.29L88.12,398.77L84.13,396.9L83.75,395.55L84.46,394.59L83.53,393.57L82.77,394.02L82.02,393.07L80.39,392.37L79.59,391.08L78.21,390.69L76.1,391.46L75.16,390.21L74.05,390.24L73.65,389.05L72.61,388.6L71.78,387.06L71.96,386.43L70.46,384.34L69.43,383.87L68.7,385.47L67.88,385.91L67.74,386.94L67.31,386.81L66.73,385.31L66,384.89L66.24,384.13L65.12,383.16L66.69,381.73L66.04,380.63L65.47,380.6L64.93,379.1L65.93,376.04L63.74,374.23L63.68,372.79L61.74,372.38L62.75,369.82L61.73,369.25L61.4,367.77L63.08,366.93L64.1,367.01L65.62,365.68L66.06,368.97L68.54,370.95L69.45,370.34L70.15,370.52L70.43,369.14L71.39,368.44L72.09,368.26L72.77,368.8L74.49,367.32L75.72,367L75.96,366.06L74.5,362.79L73.28,361.44L74.01,358.45L69.77,357.7L69.67,356.68L66.59,353.86L65.18,351.27L66.1,349.52L65.18,347.22L65.93,345.75L65.12,344.95L68.51,342.36L68.7,341.21z"},{"code":"CN-YN","name":"Yunnan","path":"M322.97,416.21L322.91,422.56L323.84,425.71L323.74,428.2L325.49,431.01L326.56,431.85L326.87,430.2L326.34,426.47L328.11,425.77L329.41,422.51L330.61,422.05L330.91,423.88L332.06,424.59L332.07,425.88L332.76,425.44L333.46,425.75L334.08,427.29L335.11,427.89L334.93,428.76L336.42,429.48L336.36,430.94L334.63,431.49L334.48,431.97L335.2,433.53L336.54,434.76L336.36,435.46L338.07,436.04L338.3,438.08L339.63,435.96L341.11,436.76L342.25,435.3L342.89,435.33L343.17,436.89L344.13,438.59L344.82,438.67L344.66,439.52L345.29,439.65L345.32,441.58L346.02,441.6L347.54,444.2L347.41,445.15L348.92,445.39L348.63,447.91L350.19,448.95L350.23,449.62L351.45,449.89L351.78,452.17L352.64,452.01L352.53,451.32L353.32,451.58L352.56,452.41L352.95,452.85L352.69,453.8L351.81,453.94L351.81,454.51L354.84,456.74L355.11,457.99L354.26,458.36L354.62,459.38L355.52,458.92L356.16,459.29L357.38,461.68L358.49,460.76L360.66,461.34L362.63,459.23L366.43,457.2L367.37,457.59L367.02,458.8L367.88,459.39L370.49,457.21L371.86,457.4L371.98,455.53L372.8,454.8L370.42,447.85L370.92,446.54L370.6,444.02L371.34,442.38L371.91,443.02L373.82,442.29L374.91,440.19L375.72,440.22L375.56,439.35L378.3,436.75L378.46,435.27L379.17,434.44L378.47,434.54L378.25,433.68L377.66,433.72L377.75,432.3L380.08,430.37L381.04,431.19L383.01,429.76L381.98,426.65L382.74,424.57L384.09,425.48L385.94,425.42L387.81,424.56L388.57,425.22L390.01,425.11L389.18,426.11L387.83,426.54L387.93,428.47L388.46,429.51L389.41,429.33L389.72,430.23L390.49,430.55L389.74,431.31L390.48,431.55L390.27,432.4L389.59,433.25L388.57,433.44L391.08,435.75L392.04,436.31L395.79,435.38L397.03,433.23L397.93,432.72L399.66,433.2L399.81,434.23L400.71,434.13L400.89,435.1L400.31,435.72L400.54,436.56L401.27,436.73L401.16,438.26L401.16,438.26L401.2,439.45L400.22,440.53L400.62,440.95L399.76,442.98L398.28,442.36L395.64,444.15L395.01,443.29L394.48,443.81L394.01,443.43L392.49,443.89L391.46,443.51L391.18,442.57L389.25,441.67L387.93,443.99L386.99,444.44L384.88,442.93L384.9,442.12L383.86,442.02L383.06,443.93L380.97,446.32L380.02,446.62L380.4,447.26L379.67,447.33L379.86,448.18L380.91,447.57L381.88,448.94L381.85,450.06L380.93,450.99L381.32,452.09L381.77,452.02L381.5,453.56L382.34,454.79L384.82,455.07L386.34,453.28L389,453.6L389.84,452.33L390.45,453.84L391.84,454.13L391.91,454.94L393.07,456.23L393.29,457.07L391.53,458.81L391.25,461.02L390.43,461.34L390.22,464.09L389.44,466.02L388.77,465.78L388.62,467.11L388.83,467.83L390.09,468.15L390.17,469.56L391.79,468.97L391.56,470.61L392.8,471.21L392.94,472.12L395.06,472.76L394.98,473.92L394.08,473.24L393.2,475.2L392.57,475.29L393.28,475.43L393.69,476.29L391.61,478.67L391.42,479.95L391.42,479.95L390.8,481.05L391.1,482.12L392.38,484.78L393.48,485.59L393.74,483.89L396.62,484.41L397.95,483.96L399.81,485.4L399.63,486.14L400.28,487.42L399.62,488.11L400.62,489.07L401.39,488.41L403.46,489.73L404.07,488.27L405,488.12L405.71,489.45L407.08,489.03L407.95,489.65L408.69,489.33L408.94,488.35L409.98,488.26L411.18,489.64L412.45,491.81L411.68,492.85L411.74,495.95L409.95,497.62L409.78,497.05L407.76,496.69L407.51,497.35L405.54,498.29L406.07,499.24L405.59,498.95L404.78,499.48L403.99,500.4L404.17,501.14L404.17,501.14L401.48,498.42L400.21,500.08L398.44,500.09L396.72,501.42L395.98,501.38L395.75,502.06L394.78,502.02L395.61,504.5L393.97,506.19L392.02,505.79L389.31,507.98L388.12,507.32L388.23,505.97L386.17,506.35L385.22,507.55L384.46,510.5L380.43,506.67L379.23,507.86L378.81,509.33L377.48,507.67L377.62,507.04L376.14,506.27L375.62,508.16L374.43,508.64L374.39,509.81L373.13,510.45L373,511.3L371.21,510.81L370.35,509.08L367.12,507.42L366.65,507.81L365.77,506.78L364.3,508.1L364.51,508.8L362.91,510.61L362.77,511.76L361.82,511.48L361.29,511.94L359.76,511.18L358.44,511.48L358.05,512.21L356.82,510.64L355.53,510.98L354.82,513.49L353.73,514.01L354.45,515.21L354.11,515.84L354.7,517.79L355.73,518.13L355.77,518.82L356.69,519.65L356.33,521.12L357.27,522.75L356.45,523.1L356.17,526.64L357.52,527.48L357.46,528.01L356.71,528.14L356.77,529L355.74,528.87L355.34,528.2L354.47,528.51L354.53,527.77L353.94,527.53L350.42,528.47L349.74,526.67L350.21,525.84L349.32,525.33L349.58,523.41L348.77,523.28L348.98,522.27L348.3,521.96L348.42,520.42L344.73,522.13L342.76,524.37L340.4,524.71L339,523.59L336.69,524.92L335.62,523.06L336.36,521.98L335.94,521.52L334.35,521.48L333.9,520.91L333.52,519.79L334.18,517.71L333.81,516.67L332.69,516.48L332.28,517.05L330.99,516.32L330.43,516.79L329.79,515.96L328.23,516L327.57,515.51L325.82,516.02L323.65,515.21L325.04,512.65L324.73,512.12L326.47,510.6L325.66,507.17L327.21,505.81L327.18,504.5L327.98,505.03L328.67,504.62L328.01,502.63L325.94,501.93L322.94,502.5L322.18,501.95L322.27,501.42L320.09,501.16L320.78,499.76L320.1,499.25L320.58,497.99L320.01,497.09L319.39,497.3L319.12,496.36L320.18,495.32L319.33,493.36L317.53,492.66L317.88,490.91L317.49,490.63L319.52,489.38L320.04,487.94L316.6,488.77L315.68,488.29L310.66,488.68L307.46,489.94L304.48,492.21L303.04,490.93L304.27,490.08L305.85,487.74L305.48,487.27L305.9,486.24L304.73,485.85L304.65,485.37L305.34,485.19L304.87,483.94L303.06,484.07L303.28,479.85L306.23,478.39L305.34,476.53L306.95,472.55L308.27,473.16L310.67,470.86L310.49,469.13L311.19,468.58L311.06,467.6L312.86,468.69L313.47,468.46L315.01,465.02L315.89,464.46L316.97,465.08L317.86,464.21L317.92,463.69L316.63,462.49L316.15,460.68L317.11,460.3L317.34,461.07L317.98,460.47L318.19,459.73L317.41,458.84L317.46,457.92L318.23,456.96L318.78,453.65L318.25,450.24L318.57,447.56L317.77,446.76L317.59,445.28L318.16,443.82L317.58,441.7L317.8,440.29L317.33,439.61L316.46,439.8L315.94,438.99L315.59,439.32L314.32,438.55L314.2,440.13L313.12,440.84L311.71,437.94L311.81,436.58L311,436.15L311.53,435.41L310.66,434.57L310.65,432.03L310.65,432.03L311.02,431.17L312.27,430.63L311.48,429.06L312.51,428.49L313.45,429.95L314.02,432.61L315.85,431.54L316.8,431.81L317.85,430.84L318.43,429.3L317.53,427.36L316.77,426.92L316.4,424.52L317.61,423.61L316.89,420.18L318.75,419.78L319.54,422.54L321.06,422.27L320.55,420.14L321.79,419.03L321.08,417.13z"},{"code":"CN-ZJ","name":"Zhejiang","path":"M610.42,405.84l-0.31,-1.21l0.47,-0.52l0.69,1.25L610.42,405.84zM614.26,405.47l1.56,0.97l0.6,-1.39l-2.97,-1.97l-1.56,0.09l-0.36,-0.48l0.95,2.78L614.26,405.47zM616.85,398.39l-1.19,0.06l0.02,0.76l1.98,0.14L616.85,398.39zM617.36,401.51l-1.74,0.41l1.65,0.13L617.36,401.51zM614.94,400.51l-2.15,0.48l2.25,0.97L614.94,400.51zM613.05,408.6l-0.29,0.88l0.77,-0.05l0.91,0.98l0.35,-0.57l-1.07,-1.46L613.05,408.6zM617.28,407.77l0.2,-1.62l-1.18,0.12L617.28,407.77zM616.12,408.71l-0.19,-1.01l-0.98,0.08L616.12,408.71zM602.51,431.02l-1.34,1.16l0.29,1.42l1.75,-0.75l-0.33,-1.42L602.51,431.02zM611.83,415.87l0.32,0.17l-0.8,0.99l-1.59,0.53l-0.05,-3.19l-0.48,0.31l-0.11,2.48l-1.68,-0.06l-0.39,-0.9l-0.86,0.9l0.99,0.71l-1.8,-0.22l-0.05,0.73l2.41,-0.02l-0.13,0.75l0.92,0.57l-0.59,0.5l0.81,0.4l-1.11,0.63l-1.61,-0.57l1.66,0.92l0.47,1.35l-0.79,1.19l-2.06,0.29l0.69,0.27l0.55,1.83l0.88,0.04l-0.63,1.38l0.39,1.61l0.83,-0.35l-0.37,0.95l-0.69,0.51l-0.02,-0.89l-1.53,-0.28l-1.54,2.7l-1.43,-1.75l-0.53,-1.8l-1.1,3.17l-0.96,0.36l-0.71,2.25l-1.98,-0.09l-1.2,-0.69l0.36,0.76l1.59,0.74l-0.04,0.96l-3.32,3.89l0.32,1.28l0.77,0.34l-0.64,0.72l0.11,0.88l-1.29,-0.55l-0.43,0.95l0.54,0.25l-0.45,0.6l0.3,0.42l-0.86,1.18l-0.94,-1.15l0,0l0.28,-0.25l-0.89,-1.19l0,0l-0.07,-0.69l-0.92,0l0,0l-0.38,-0.55l-1.38,0.18l-1.3,1.1l-0.4,-0.54l-0.8,0.92l-2.17,0.11l0.15,-0.31l0,0l-1.21,-1.54l0.26,-0.98l0,0l-0.97,-1.22l0.1,-1.1l-1.04,-0.08l-0.23,0.45l-0.56,-0.18l-0.54,2.04l-0.95,-0.3l-1.67,1.61l-1.43,-0.18l-0.09,-0.7l-1.42,-0.18l-0.64,0.51l0,0l-0.56,0.03l-0.44,-0.82l0,0l0.18,-2.81l-1.01,-2.77l-1.11,-0.95l-0.14,-1.11l1.02,-0.95l-0.38,-0.84l0.46,-0.92l-1.19,-0.94l-1.28,0.79l-0.38,-0.5l-0.98,0.14l-0.12,0.58l-0.77,-0.73l0,0l0.72,-0.62l-0.53,-1.05l0.36,-0.92l-0.64,-0.34l0.2,-2.54l-0.67,-1.63l-1.04,-0.69l-0.49,-1.27l-0.81,0.18l0.27,-0.46l-0.44,-0.55l-1.07,-0.16l-0.71,-1.51l0.42,-2.82l1.17,-0.08l0.52,-0.8l-0.22,-0.59l0,0l0.64,-0.57l0.79,0.14l0.11,-1.03l1.08,0.24l1.07,-0.45l0.83,-1.5l2.4,-1.74l0.2,-1.6l1.76,-1.53l0.01,-2.97l-0.57,-0.1l0.94,-0.76l-0.52,-1.54l0.92,-0.64l1.13,0.78l2.31,0.22l0.29,-0.74l1.87,-0.36l-0.93,-2.37l-1.06,-0.09l-0.01,-1.13l0.92,-0.1l0.88,-0.93l0.74,0.52l0.58,-1.9l1.08,-0.82l0.78,-4.41l0,0l1.86,-0.64l1.63,0.11l1.05,2.18l2.01,1.32l2.74,-0.27l-0.11,0.96l0.89,-0.52l0.98,2.32l0.94,-1.35l1.56,-0.61l-0.05,-1.06l2.45,-0.57l0,0l1.26,0.15l-0.13,2.56l1.46,-0.35l0.33,0.98l1.07,-0.01l0.57,0.56l0.11,0.81l0,0l-3.49,1.92l-1.02,2.71l-1.85,0.75l-0.43,-0.87l-1.04,-0.35l0.54,2.04l0.53,0.56l1.02,0l0.71,1l3.9,-2.49l1.96,-0.04l2.25,1.76l2.21,3.29l1.43,0.21l1.72,1.1l2.49,-0.19l0.11,0.36l-3.44,1.81l-0.15,0.85l-1.94,1.97l-2.25,0.63l-0.42,-0.4l-0.8,1.01l0.28,0.87l0.8,-1.09l-0.28,1.5l0.97,-1.28l1.96,-0.96l1.02,0.93l0.35,-1l-1.08,-0.18l2.17,-1.24l1.01,0.62l-0.91,0.89l0.78,1.19l-0.83,0.53l-0.07,1.07l0.48,0.1l-0.59,0.6L611.83,415.87zM609.4,417.75l0.03,0.43l1.57,0.02l0.28,0.81l0.68,-0.44l-0.5,-1.41l-0.96,0.6L609.4,417.75z"}]; + tuiChart.registerMap('china', data); +})(tui.chart); diff --git a/dist/maps/japan.js b/dist/maps/japan.js new file mode 100644 index 000000000..99d8fbfe2 --- /dev/null +++ b/dist/maps/japan.js @@ -0,0 +1,10 @@ +/** + * https://www.amcharts.com/svg-maps/?map=japan + * map data by amcharts team + */ +'use strict'; + +(function(tuiChart) { + var data = [{"code":"JP-AC","name":"Aichi","path":"M274.27,277.6l0.33,-2.12l-0.86,-1.4l0.56,-2.83l-2.28,-0.31l0,0l-1.29,-2.78l0,0l0.22,-2.19l1.69,-2.97l2.94,-0.35l1.48,-1.13l1.8,3.09l2.09,1.04l2.4,-0.91l2.48,1.57l2.53,-1.48l0,0l0.31,2.15l2.11,-0.82l2.62,0.42l0,0l0.2,1.49l-3.73,6.27l-2.75,1.53l-0.27,3.55l0,0l-8.87,2.3l0.54,-1.92l0.74,0.63l2.36,-1.02l1.92,-1.37l0.21,-1.14l-2.26,-1.02l-0.76,1.39l-2.95,-0.32l-1.42,-1.37l-0.13,-1.27l-0.69,2.8l1.17,1.8L274.27,277.6z"},{"code":"JP-AT","name":"Akita","path":"M337.52,155.13l-0.69,-2.75l-1.39,-1.62l0.51,-0.81l1.33,1.12l0.18,-4.97l-1.52,0l-1.15,2.88l0.46,1.68l-1.64,-0.13l-0.02,1.1l-2.1,-0.09l-1.18,-3.14l0.14,-0.73l2.59,1.11l2.34,-3.03l1.42,-7.06l-1.72,-1.81l0,0l1.64,0.24l1.03,-1.22l0.76,0.81l4.5,-0.06l0.5,-1l1.31,-0.11l2.22,2.03l1,-0.84l1.25,0.84l2.98,-1.19l0.24,-1.08l1.23,-0.49l-0.16,2.35l2.13,-0.23l-0.49,4.64l0,0l-1.82,1.9l0.3,7.69l-1.87,0.16l0.07,1.06l1.12,0.66l-1.21,1.61l0.79,2.25l-1.81,2.14l-1.41,3.84l0.78,2.92l2.16,3.02l-1.08,1.13l-0.01,1.2l1.12,0.77l-0.71,2.52l0,0l-2.35,1.74l-2.03,0.18l0,0l-1.77,-0.98l-0.58,-1.8l-5.58,-1.53l-1.51,-0.89l-0.2,-1.17l-1.35,0.71l-2.51,-0.41l0,0l0.8,-3.71l2.04,-3.1L337.52,155.13z"},{"code":"JP-AM","name":"Aomori","path":"M358.65,125.37l1.5,-1.88l1.39,-5.44l-1.58,-3.1l-0.79,-0.08l-1.98,2.42l-1.52,-0.42l-3.33,1.86l-0.93,-0.47l0.69,-4.59l2.24,-5.89l6.95,5.01l1.89,-0.26l2.04,-1.67l-1.49,6.85l0.45,10.64l1.37,4.86l1.18,1.09l0.67,-0.39l2.14,2.44l0,0l-2.87,2.68l-1.24,-0.77l-2.39,1.19l-0.68,-1.08l-5.73,3.89l-1.4,-0.69l0,0l0.49,-4.64l-2.13,0.23l0.16,-2.35l-1.23,0.49l-0.24,1.08l-2.98,1.19l-1.25,-0.84l-1,0.84l-2.22,-2.03l-1.31,0.11l-0.5,1l-4.5,0.06l-0.76,-0.81l-1.03,1.22l-1.64,-0.24l0,0l0.07,-3.22l-1.56,-1.63l3.45,-3.65l1.84,0.44l2.66,-1.78l1.09,-7.4l-1.38,-0.82l1.43,-0.59l0.4,-2.95l2.39,2.04l1.67,-1.2l1.75,1.1l0.28,4.79l1.65,4.47l1.33,-0.11l1.19,-1.28l0.33,-3.25L358.65,125.37z"},{"code":"JP-CB","name":"Chiba","path":"M333.18,262.84l1.09,0.2l0.17,-1.77l1.75,-0.65l1.51,-2.16l0.81,0.1l-2.51,-3.31l-0.69,0.29l0,0l-1.43,-3.02l0,0l0.57,-1.59l-2.44,-5.67l0,0l3.3,3.83l4.09,2.28l6.14,-1.81l4.36,1.72l3.61,3.06l0,0l-0.11,0.65l-3.82,-0.05l-2.72,2.07l-2.51,3.73l-0.43,6.4l-1.42,1.26l-3.66,0.38l-4.69,5.28l-2.67,-1.6l2.08,-0.74l-0.78,-1.66l-0.01,-2.96l1,-1.23l-1.13,-1.6L333.18,262.84z"},{"code":"JP-EM","name":"Ehime","path":"M188.1,312.49l0.23,-0.43l0.35,-0.26l0.35,0.04l0.02,-0.2l-0.29,-0.13l-0.38,-0.16l-0.47,0.16l-0.28,0.23l-0.44,-0.25l-0.2,0.38l-0.4,-0.13l-0.14,-0.23l-0.46,0l0.13,-0.45l0.17,-0.13l0.14,-0.1l0.31,-0.12l-0.03,-0.17l-0.04,-0.25l-0.3,0.03l-0.22,-0.37l0.35,-0.29l-0.07,-0.36l-0.27,-0.07l0.35,-0.32l0.16,-0.04l0.22,-0.27l0.09,-0.46l-0.23,0.13l-0.4,-0.05l0.17,-0.41l-0.51,0.1l-0.33,-0.36l-0.23,0.06l-0.35,0.29l-0.86,0.6l-0.52,0.14l-0.33,0.37l-1.1,0.33l-0.57,0.53l-0.16,0.31l-0.31,0.28l-0.51,0.06l-0.03,-0.24l0.35,-0.22l0.01,-0.17l-0.51,0.02l-0.85,0.71l-0.51,0.31l-0.25,0.01l2.15,-1.81l0.51,-0.3l0.66,-0.36l0.57,0.08l0.31,-0.33l0.31,-0.14l0.46,-0.04l0.24,-0.14l0.1,-0.18l1.16,-0.52l0.86,-0.64l0.75,-0.4l0.21,-0.5l0.83,-0.99l0.63,-0.46l1.55,-0.56l1.22,-0.91l0.21,-0.24l0.37,-0.98l0.45,-0.4l-0.23,-0.72l-0.01,-0.99l0.2,-1.04l0.24,-0.66l0.43,0.17l0.43,-0.29l0.34,-1.22l0.07,-0.62l1.77,-1.67l1.11,-0.17l-0.06,-0.45l0.26,-0.17l-0.15,-0.56l0.36,-0.6l0.75,0.87l0.98,1.41l0.72,1.48l0.38,0.6l0.13,0.43l0.5,0.36l0.95,-0.32l1.38,-0.34l0.37,-0.1l-0.12,-0.46l1.2,-0.2l0.24,-0.26l0.38,0.05l0.37,0.33l0.7,-0.3l0.68,0.1l0.48,0.1l0.73,0.33l0.5,-0.07l0.69,-0.5l0.2,-0.34l0.14,-0.44l0.16,-0.08l0.4,-0.27l0,0l0.33,0.27l0.95,0.13l0.61,0.34l0,0l-0.29,0.68l0.27,0.49l0,1.04l-0.22,0.61l-0.34,0.29l0,0l-0.41,0.01l-0.65,-0.01l-0.47,0.33l-0.51,-0.34l-0.21,0.04l-0.56,0.77l-0.21,0.27l-0.2,0.16l-2.07,0.07l-0.8,-0.13l-1.47,0.02l-0.2,0.17l-0.22,0.73l-0.18,0.11l-0.52,0.19l-0.34,-0.34l-0.2,0.02l-0.26,0.69l-0.39,0.79l-0.4,0.4l-0.35,0.5l-0.06,0.55l-0.22,0.28l-0.61,0.1l-0.18,0.65l-0.25,0.73l-0.19,0.46l0.29,0.29l0.04,0.52l-0.36,0.27l-0.57,0.88l-0.01,0.27l-1.2,0.34l-0.21,-0.13l-0.66,0.08l-1.3,-0.21l-0.41,0.11l-0.32,0.3l0.35,0.32l0.15,0.94l0.15,0.2l0.2,0l0.23,0.72l0.45,0.14l0.27,0.36l0.04,0.57l-0.08,0.22l-0.8,0.46l-1.21,0.42l-0.31,0.52l-0.18,1.14l-0.43,0.03l-0.17,0.15l-0.14,0.47l-0.71,0.9l-0.19,0.07l-0.95,-0.92l-0.11,-0.27l-0.2,0.07l-0.14,0.29l0.29,0.62l-0.03,0.26l0.47,0.51l0.21,0.05l0.09,0.3l-0.2,0.92l0.3,0.31l0.21,0.94l-0.01,1.33l-0.41,0.1l-0.05,0.38l0,0l-0.32,-0.12l-0.94,0.35l-0.14,-0.27l-0.25,-0.34l-0.09,-0.18l-0.46,0.16l-0.19,0.09l-0.26,0.06l-0.02,0.29l0.02,0.13l-0.19,0.26l-0.35,-0.03l-0.27,0.01l-0.25,-0.04l0.08,-0.37l-0.32,-0.38l0.1,-0.12l0.36,-0.04l0.35,-0.26l-0.63,-0.34l0.28,-0.23l0.24,0.14l0.15,0.04l0.14,-0.1l-0.21,-0.39l0.1,-0.26l-0.3,-0.14l-0.12,-0.04l-0.01,-0.83l-0.28,-0.04l-0.35,0.33l-0.42,-0.24l-0.38,0.17l-0.13,0.08l-0.09,0.21l-0.05,0.29l-0.36,-0.18l0.33,-0.4l0.02,-0.38l0.15,-0.35l0.22,-0.05l0.2,0.11l0.14,0.34l0.33,-0.06l0.57,-0.22l0.13,-0.27l-0.3,-0.12l0.21,-0.39l0.38,-0.6l-0.02,-0.33l-0.39,-0.09l-0.15,0.01l-0.22,0.08l-0.15,0.13l-0.22,-0.14l0.05,-0.25l-0.36,-0.17l0.15,-0.33l0.29,-0.35l-0.52,-0.56l0.51,0.2l0.69,0.34l0.29,0.33l0.35,0.02l-0.08,-0.37l-0.2,-0.41l0.31,-0.27l0.56,0.04l0.23,-0.03l0.09,-0.16l-0.14,-0.34l-0.28,0.04l-0.38,-0.34l0.39,-0.21l0.04,-0.31l-0.8,0.05L188.1,312.49z"},{"code":"JP-FK","name":"Fukui","labelCoordinate":{"x":0.5,"y":0.35},"path":"M252.29,257.91l1.54,1.06l-0.22,-1.07l1.11,-0.42l-0.83,-1.29l1.02,0.84l2.12,-0.41l-0.39,-2.38l1.24,-0.99l0.16,2.03l0.96,0.43l0.5,-2.8l-2.8,-4.94l3.26,-6.5l2.38,-1.09l0,0l2.35,3.21l2.02,0.68l1.75,-0.42l2.1,2.08l1.89,-0.48l0,0l-0.53,2.25l2.06,3.41l-0.8,1.24l-2.89,-0.05l-2.84,1.26l-2.53,-0.92l-1.89,3.09l0,0l-2.47,-0.81l0.38,3.18l-1.1,-0.32l-2.1,2.07l-1.23,-0.67l-1.04,2.77l-1.57,-0.13l-0.87,1.34l0,0l-4.61,-0.52l-1.44,-2.08l0.18,-2.32l0,0l0.88,0.17l-0.03,1.34l2.58,0.39l1.78,-0.38l0.27,-0.88l-1.24,-0.34L252.29,257.91z"},{"code":"JP-FO","name":"Fukuoka","path":"M147.17,302.8l1.24,-1.35l-0.38,-1.63l1.57,-1.76l2.07,0.16l1.39,-1.34l3.77,1.09l2.22,-1.81l-0.15,2.62l-0.79,0.7l0.88,0.33l1.94,4.63l1.64,0.47l0,0l-0.11,2.15l-3.81,0.07l-1.61,1.38l-1.26,2.47l0.58,1.11l-0.78,1.29l1.17,1.53l-0.83,1.63l0,0l-3.16,-1.49l-0.53,1.44l-1.5,-0.17l-1.62,1.49l0.18,1.07l-2.14,-0.08l0,0l0.48,-1.1l-1.4,-2.19l0,0l0.76,-2.27l2.87,-2.25l0.02,-2.25l-2.14,0.98l-3.09,-1.95l-4.66,0.21l0,0l2.3,-1.64l0.19,-0.55l-1.51,-0.47l2.37,-2.02l1.45,2.03l2.33,-0.84l0.69,-1.07L147.17,302.8z"},{"code":"JP-FS","name":"Fukushima","path":"M355.44,223.47l-3.11,2l-0.36,1.14l0,0l-3.43,-1.04l-0.57,-1.03l0.12,1.76l-2.57,1.89l-4.03,-3.45l0,0l-0.17,-2.19l-0.85,0.05l-1.25,-1.91l-4.81,-1.28l-10.18,5.94l0,0l-2.83,-0.88l0,0l0.28,-5.21l-1.74,-1.89l1.17,-2.55l-0.53,-1.76l0.57,-0.92l3.38,-0.29l0.73,-1.35l2.97,0.03l-0.67,-3.39l3.69,-4.3l0,0l1.42,0.49l2.51,-0.62l0.97,1.68l1.23,-0.46l1.47,1.12l2.04,-0.3l1.33,-1.61l-0.29,-4.12l0,0l1.39,0.66l1.13,-0.57l1.51,1.78l3.47,0.02l0.65,2.35l1.84,0.77l-0.32,-0.55l1.72,-0.15l-0.03,-2.17l1.42,-0.09l0,0l1.58,3.74l0.55,6.03L355.44,223.47zM352.01,226.63l0.03,0.01l0,0L352.01,226.63z"},{"code":"JP-GF","name":"Gifu","path":"M265.76,266.48L265.04,265.79L266.29,262.35L265.46,258.97L263.82,258.47L263.94,256.87L263.02,255.73L263.02,255.73L264.91,252.64L267.44,253.56L270.28,252.3L273.17,252.35L273.96,251.11L271.91,247.7L272.44,245.45L272.44,245.45L272.71,243.62L274.26,241.72L273.21,240.32L273.21,240.32L274.85,238.62L276.37,239.36L276.79,240.94L280.51,236.55L283.36,236.33L283.61,237.25L284.96,236.45L285.24,237.23L288.86,238.13L288.86,238.13L290.11,239.83L288.21,244.2L289.38,245.76L288.99,247.33L286.66,250.17L284.76,250.26L283.71,252.11L286.32,253.39L287.9,255.88L288.1,259.26L289.74,259.48L289.09,261.09L289.8,262.07L288.93,262.36L289.19,263.63L288.36,264.81L288.36,264.81L285.84,266.29L283.35,264.72L280.95,265.64L278.87,264.6L277.07,261.51L275.58,262.63L272.65,262.98L270.96,265.96L270.74,268.15L270.74,268.15L269.66,268.03L267.97,265.53z"},{"code":"JP-GM","name":"Gunma","path":"M329.7,242.25L328.9,243.01L325.84,243.01L324.03,241.67L319.21,240.83L317.54,244.49L316.01,244.56L311.13,247.78L311.13,247.78L309.8,247.16L309.75,245.04L308.38,243.53L309.45,243.21L308.83,240.85L309.86,240.17L309.64,237.54L306.15,237.78L304.9,237.04L304.84,235.74L305.42,233.09L307.34,231.75L307.35,230.66L310.69,229.47L310.69,229.47L312.5,229.45L313.19,227.78L315.32,227.19L315.36,225.8L316.3,225.65L316.03,223.72L317.67,223.44L318.61,221.76L321.41,224.48L321.41,224.48L324.24,225.36L324.24,225.36L323.66,226.9L324.68,227.34L323.66,228.75L323.17,232.18L326.21,233.53L323.95,238.65L326.07,240.98L328.9,240.94z"},{"code":"JP-HG","name":"Hyogo","path":"M227.25,277.27l-1.09,0.9l-1.21,-0.22l0,0l-1.8,-2.81l0.7,-1.31l-0.68,-0.85l0.3,-1.82l1.81,-2.81l0.92,-0.19l-0.12,-2.24l0,0l2.22,-0.89l-0.11,-1.59l-2.82,-6.56l0,0l3.35,-1.4l1.62,0.77l0.82,-0.67l4.09,0.18l0,0l0.02,2.02l1.07,1.41l2.38,0.06l0,2.63l-0.91,0.52l-1.14,-0.55l-0.35,2.27l2.82,1.74l1.78,-0.44l0.64,2.15l1.79,-0.08l0.26,0.79l1.83,0.31l-0.26,2l0,0l-0.72,0.27l0.24,1.57l2.37,0.95l-0.91,0.51l0.84,4.95l-0.54,1.21l0,0l-0.55,-1.32l-2.3,-0.41l-2.08,1.62l-2.58,0.64l-4.27,-1.72l-1.67,-1.65L227.25,277.27zM236.65,288.35l0.22,0.77l-4.38,1.85l-1.51,-2.42l6.89,-7.57l0.44,0.83l-2.54,3.82L236.65,288.35z"},{"code":"JP-HK","name":"Hokkaido","path":"M344.04,71.29l2.76,-2.73l-4.03,-5.33l0.41,-3.02l1.64,0.11l1.34,-1.17l5.8,4.8l4.4,-1.19l-0.14,1.17l3.04,1.39l2.2,-1.22l2.96,-3.75l-1.86,-10.74l1.02,-2.1l4.26,-2.26l0.93,-1.89l0.06,-9.81l2.14,-3.76l0.72,-5.25l-1.07,-7.11l-3.28,-9.47l1.64,-3.22l-0.26,-2.67l1.27,1.45l1.76,-0.28L374.52,0l11.73,13.8l3.91,7.23l5.02,5.66l8.74,7.2l3.7,1.94l9.12,2.97l3.23,0.22l0.23,2.05l1.46,2.04l3.21,1.01l5.98,-0.12l7.83,-7.21l3,-3.96l0.45,2.23l-4.45,7.94L436.06,48l6.06,12.8l-2.49,-1.28l-0.03,1.63l0.86,-0.67l0.55,1.34l2.95,0.34l3.76,-3.51l3.28,0.2l-1.36,1.41l-3.61,1.33l-0.8,2.93l-2.01,-0.41l-5.47,1.2l-3.38,4.39l-1.9,-0.1l-1.09,-1.99l-1.92,1.83l1.12,1.54l-6.74,-0.48l-2.26,-1.42l-3.06,0.54l-5.82,3.71l-5.27,5.27l-4.08,5.8l-1.53,3.31l0.27,3.11l-1.72,7.01l-3.7,-3.72l-12.93,-6.47l-4.21,-3.72l-3.21,-0.94l-4.04,-3.24l-4.21,-0.57l-3.17,1.04l-6.35,4.45l-2.46,3.19l-1.4,-0.95l0.97,0.35l0.12,-0.81l-1.35,-0.41l-0.87,-2.37l-3.24,-3.33l-4.67,-0.12l-3.12,4.56l-0.43,4.49l5.06,3.55l4.17,-0.08l3.94,5.31l4.49,2.84l-4.32,2.59l-3.63,-1.7l-1.63,0.89l0.3,-1.74l-1.45,-0.3l-0.84,2.01l-3.07,1.49l-0.31,3.94l-3.3,1.38l-1.29,2.2l-3.06,-1.3l-1.16,-3.58l1.76,-5.86l1.05,-0.51l-0.09,-4.69l-1.9,-2.94l-1.97,-0.48l-1.39,-2.2l-1.14,-0.41l-0.58,-2.12l1.58,-3.1l-0.46,-4.88l0.92,-1.45l3.41,-0.68l2,-1.64l0.85,-1.92l1.39,1.54l0.89,-0.23L344.04,71.29zM358.76,9.86l-0.09,-1.23l1.28,-1.25l2.07,1.21l0.51,1.81l-1.81,1.49L358.76,9.86zM326.88,91.03l-0.29,2.22l-1.07,1.22l-0.97,-3.35l3.12,-1.99L326.88,91.03zM357.23,4.25l-0.65,2.72l-1.18,-5.35l0.65,0.85L357.03,2L357.23,4.25z"},{"code":"JP-HS","name":"Hiroshima","path":"M191.21,290.66l-0.78,-0.7l-1.45,1.75l1.24,1.22l-2.52,0.51l1.45,-3.72l-0.56,-2.7l-1.31,-0.65l-2.28,1.04l-1.69,2.64l0,0l-1.61,-0.12l-1.71,-5.72l0,0l-0.49,-0.63l1.52,-1.49l0.91,-2.8l-0.55,-0.34l2.06,-2.48l1.19,0.59l2.82,-0.97l1.88,0.54l3.23,-1.2l-1.08,-1.55l2.04,-1.26l2.4,-3.33l5.31,0.61l0,0l2.53,0.45l0,0l1.01,1.22l-0.47,2.8l1.6,2l0.11,4.41l1.33,3.39l0,0l-1.71,2.55l-2.4,-0.51l0.53,-0.41l-0.6,-0.81l-2.97,1.31l-0.23,0.98l-3.69,0.44l-0.9,0.83l-0.96,-0.48l-0.75,1.7L191.21,290.66z"},{"code":"JP-IR","name":"Ibaraki","path":"M347.55,240.03l0.79,5.4l5.17,8.91l0,0l-3.61,-3.06l-4.36,-1.72l-6.14,1.81l-4.09,-2.28l-3.3,-3.83l0,0l-0.78,0.25l-0.69,-2.85l0,0l2.37,-0.93l0.55,-1.69l1.13,0.28l1.25,-1.8l4.36,-0.79l1.13,-3.02l-0.59,-3.76l1.32,-0.91l-0.59,-5.28l0,0l4.03,3.45l2.57,-1.89l-0.12,-1.76l0.57,1.03l3.43,1.04l0,0l0.04,0.02l0,0l0.03,0.01l0,0l-3.6,9.2l0.16,2.88L347.55,240.03z"},{"code":"JP-IK","name":"Ishikawa","path":"M271.76,220.87l-0.06,-1.29l-0.98,-0.08l1.36,-4.74l7.99,-3.94l3.62,-0.75l0.64,1.95l-2.14,0.6l0.31,2.22l-0.66,0.98l-2.68,0.45l-1.73,2.34l-1.23,-1.22l-1.46,2.17l0.54,0.23l-0.83,1.56l1.12,-0.48l1.13,1.11l1.51,-1.33l0.04,3.49l0,0l-1.97,0.16l-1.4,1.37l-1.85,6.8l0.64,1.71l-0.47,6.15l0,0l1.05,1.4l-1.55,1.91l-0.28,1.83l0,0l-1.89,0.48l-2.1,-2.08l-1.75,0.42l-2.02,-0.68l-2.35,-3.21l0,0l3.43,-3.08l5.57,-7.99l1.33,-3.8L271.76,220.87z"},{"code":"JP-IT","name":"Iwate","path":"M373.89,165.92l0.47,0.61l-0.83,-0.04l1.36,1.2l-1.76,0.4l1.06,0.74l-1.66,0.78l1.67,1.04l-2.13,-0.23l0.21,0.97l1.02,0.26l-1.22,0.18l0.47,0.85l-1.56,0.17l-0.72,-1.21l0.45,1.9l-0.79,1.31l-0.67,-1.67l-0.92,0.09l0.16,0.75l0,0l-2.61,-0.62l-1.22,5.45l-2.45,-1l-1.59,1.75l-1.77,-1.01l-0.13,-2.14l-2.93,0.05l-3.2,-2.21l-0.95,0.14l0,0l0.71,-2.52l-1.12,-0.77l0.01,-1.2l1.08,-1.13l-2.16,-3.02l-0.78,-2.92l1.41,-3.84l1.81,-2.14l-0.79,-2.25l1.21,-1.61l-1.12,-0.66l-0.07,-1.06l1.87,-0.16l-0.3,-7.69l1.82,-1.9l0,0l1.4,0.69l5.73,-3.89l0.68,1.08l2.39,-1.19l1.24,0.77l2.87,-2.68l0,0l2.91,5.5l-0.98,1.08l1.86,1.24l-0.85,1.77l2.42,2.37l0.65,7.55l-0.85,2.57l1.57,-1.79l0.02,2.02l0.9,0.79l-2.32,1.87l0.43,0.88l1.67,-0.81l-0.43,1.33l-2.81,2.05l1.57,0.47L373.89,165.92z"},{"code":"JP-KC","name":"Kochi","path":"M200.54,317.38l-0.24,1.03l-1.61,0.09l-0.1,3.24l-1.14,0.48l1.34,3.21l-2.76,-1.56l-1.56,1.03l-1.78,-1.22l-1.59,0.88l1.7,-3.46l-1.07,-0.31l0.16,-3.98l-1.03,-1.73l1.59,0.75l1.93,-3.21l2.09,-1.09l-1.84,-3.26l4.1,-0.49l1.23,-4.07l2.29,-3.31l9.2,-2.07l0,0l1.71,1.06l1.81,-0.17l1.43,1.22l1.03,-1.01l1.35,0.16l0.61,3.26l1.97,0.05l0.63,3l2.11,0.22l0,0l-1.88,3.58l-0.65,3.57l-4.8,-5.74l-3.68,-1.14l-3.15,0.5l-2.55,2.29l-2.19,0.41l-0.55,1.07l-1.16,-0.29l-0.7,5l-0.76,-0.23L200.54,317.38z"},{"code":"JP-KG","name":"Kagawa","path":"M213.71,288.54l2.14,-1.22l0.18,-0.96l3.7,0.78l1.07,-1.2l0.52,1.71l2.05,-0.2l-0.22,1.2l3.71,1.87l0,0l-0.58,1.18l-4.7,-0.36l-3.42,2.39l-1.33,-0.97l-1.38,0.25l-3.39,2.18l0,0l-1.88,-0.74l1.01,-3.58l-1.45,-1.54l1.9,0.72L213.71,288.54z"},{"code":"JP-KM","name":"Kumamoto","path":"M153.66,339.94l-2.47,-1.97l-2.89,1.71l-1.9,-1.03l0,0l4.13,-6.51l-0.56,-1.43l0.8,-0.19l-0.9,-0.55l2.44,-2.42l-3.95,0.36l2.73,-2.21l0.21,-1.87l-3.22,-2.76l-0.89,-2.23l0,0l2.14,0.08l-0.18,-1.07l1.62,-1.49l1.5,0.17l0.53,-1.44l3.16,1.49l0,0l2.88,1.94l0.67,-1.48l-0.71,-1.95l2.43,-0.31l2.09,3.04l0.8,3.88l1.4,1.27l0,0l-1.26,0.16l-2.97,5.42l-1.87,1.03l0.01,2.51l1.81,2.6l-1.38,1.65l1.32,2.26l-1.99,-0.25l-1.1,1.31L153.66,339.94zM147.64,330.16l-0.59,2.89l-3.5,-0.59l-0.26,2.23l-3.56,4.06l-0.4,-1.96l-0.73,-0.21l1.56,-6.27l2.79,-0.8l0.35,2.23l2.23,-1.53L147.64,330.16zM142.47,337.28l0.5,-1.3l0.44,2.65l-0.93,1.52l-1.28,-1.93l0.14,-0.87L142.47,337.28zM148.14,329.33l-0.89,0.11l-0.22,-0.87l0.96,-0.89L148.14,329.33z"},{"code":"JP-KN","name":"Kanagawa","path":"M315.06,262.06l0.41,-1.13l3.45,-2.1l0.36,-3.31l0,0l2.27,1.64l3.04,0.55l1.35,1.89l0.49,-2.05l-0.79,-0.62l1.47,-0.67l2.68,1.27l0.81,1.28l0,0l1.12,0.53l-2.64,1.13l1.17,0.63l-1.32,1.1l0.41,2.28l2.03,1.01l-1.79,1.7l0.41,1.11l-1.34,-0.03l-0.76,-3.68l-2.54,-0.62l-4.57,1l-1.16,0.93l-0.8,2.44l0,0l-1.52,-0.21l-0.83,-1.22l0.26,-4.63L315.06,262.06z"},{"code":"JP-KS","name":"Kagoshima","path":"M144.46,355.54l1.4,-4.24l-3.29,-4.26l1.13,-2.7l-0.91,-2.49l0.57,-1.08l-0.72,-0.58l1.05,-0.97l2.28,0.37l0.44,-0.96l0,0l1.9,1.03l2.89,-1.71l2.47,1.97l0,0l-0.48,1l3.72,3.64l-0.15,2.21l2.03,0.59l1.32,3.35l0.5,-0.58l2.14,0.82l0.24,2.38l-0.74,1.38l0,0l-1.17,-0.42l-1.68,1.87l-0.08,0.8l1.77,0.61l-0.62,1.14l1.09,0.15l-2.28,1.17l-1,2.01l-5.94,3.28l-0.15,-1.75l1.8,-1.39l1.17,-4.66l-2.07,-2.94l0.11,-1.94l-2.22,-0.79l1.72,-1.11l0.64,1.45l1.06,0.09l1.13,-2.06l-0.49,-1.1l-2.67,-0.78l-0.84,0.67l-1.94,4.51l0.9,4.36l1.97,1.21l-1.55,2.5l-1.37,-0.2l-1.14,-1.96l-4.84,0.06l-0.82,-1.72l0.72,-0.55l-1.54,-1.48l0.54,-0.66l1.3,0.99L144.46,355.54zM149.1,377.5l3.41,1.96l-0.38,1.76l-2.55,1.62l-1.69,-0.28l-1.2,-3.03L149.1,377.5zM157.96,374.83l-0.18,-2.06l2.33,-3.91l0.44,3.29l-2.29,4.92l0.38,1.86l-2.15,1.25l-0.48,-2.81L157.96,374.83zM133.83,350.48l-0.77,0.47l-0.54,-0.86l2.51,-3.05L133.83,350.48zM135.99,345.98l0.03,-1.04l1.89,0.75l-0.94,0.9L135.99,345.98zM143.81,377.34l0.68,0.76l-1.07,0.32l-1.34,-1.55L143.81,377.34z"},{"code":"JP-KT","name":"Kyoto","path":"M245.18,270.62L245.43,268.62L243.6,268.31L243.34,267.51L241.55,267.59L240.92,265.44L239.13,265.88L236.32,264.13L236.67,261.87L237.81,262.42L238.72,261.9L238.73,259.27L236.35,259.21L235.28,257.8L235.26,255.78L235.26,255.78L236.49,256.06L242.15,253.09L243.89,254.97L241.6,258.64L242.49,257.66L243.1,258L242.59,258.72L244.19,259L244.33,260.38L245.65,260.11L244.44,258.81L245.29,258.13L246.72,257.43L247.14,258.25L247.14,258.25L246.96,260.57L248.4,262.65L253,263.17L253,263.17L254.6,265L254,270.54L254.94,274.29L256.38,274.38L258.02,276.7L258.02,276.7L258.47,277.9L258.47,277.9L257.55,278.57L256.15,277.53L254.68,278.74L252.76,278.22L252.24,277L252.24,277L252.52,276.38L249.95,272.4L249.2,272.38L249.32,273.48L248.53,273.74L247.52,271.96L245.36,271.36z"},{"code":"JP-ME","name":"Mie","path":"M271.27,288.59l0.47,-1.08l-0.57,-0.33l-1.76,2.14l-0.64,-0.73l-0.51,0.94l-0.78,-0.71l0.05,1.18l-4.01,1.15l-0.13,2.25l-0.97,-0.44l-0.94,0.67l1.58,1.26l-0.17,1.2l-3.4,2.03l-1.77,3.88l0,0l-1.29,-0.27l-1.7,-1.94l0.07,-1.92l0,0l3.14,-3.22l1.62,0.25l-0.15,-4.03l0.73,-1.36l-0.69,-1.15l0.67,-0.36l-1.16,-1.85l0.5,-0.95l2.18,-0.32l0.39,-0.94l-1.41,-1.7l-2.12,-0.64l0.76,-2.12l-0.8,-1.57l0,0l-0.45,-1.21l0,0l1.34,-0.55l0.4,-2.09l2.68,1.03l2.33,-1.13l1.76,-5.9l-0.78,-1.57l0,0l0,0l0,0l2.21,-0.95l1.7,2.49l1.08,0.12l0,0l1.29,2.78l0,0l-1.68,0.89l-0.1,2.14l-1.93,2.95l-0.21,3.9l5.91,2.59l1.8,2.23l-1.13,0.67l0.74,0.48l-0.79,2.46l-2.34,-0.21l1.63,0.11l-0.41,-0.77L271.27,288.59z"},{"code":"JP-MY","name":"Miyagi","path":"M357.32,189.61l-0.41,0.71l0.84,0.74l-1.26,0.75l-1.71,3.62l-0.08,5.65l0,0l-1.42,0.09l0.03,2.17l-1.72,0.15l0.32,0.55l-1.84,-0.77l-0.65,-2.35l-3.47,-0.02l-1.51,-1.78l-1.13,0.57l-1.39,-0.66l0,0l-0.06,-1.98l2.71,-0.56l1.29,-2.6l-0.07,-2.24l2.6,-4.67l-1.32,-4.56l1.15,0.03l0.89,-3.22l-1.85,-2.88l0,0l2.03,-0.18l2.35,-1.74l0,0l0.95,-0.14l3.2,2.21l2.93,-0.05l0.13,2.14l1.77,1.01l1.59,-1.75l2.45,1l1.22,-5.45l2.61,0.62l0,0l0.85,2.85l-1.58,-0.75l-0.09,1.67l-1.52,1.39l1.02,0.68l-0.05,1.21l-0.71,-0.64l-1.61,1.11l-0.03,0.72l1.72,0.21l-1.32,1.36l0.64,1.23l1.08,0.19l-0.29,0.95l-0.82,-0.54l0,1.65l-0.93,-0.02l0.47,1.25l1.33,-0.16l-0.63,0.41l0.34,2.78l-2.13,-1.85l0.83,-0.67l-0.54,-0.64l-1.13,0.38l-0.44,-0.77l-2.53,0.39l-1.67,1.93l-0.07,-1.38L357.32,189.61z"},{"code":"JP-MZ","name":"Miyazaki","path":"M168.94,341.18l-1.16,4.83l0.83,1.17l-0.5,3.58l-1.69,2.54l-0.55,3.54l-1.9,-0.35l-0.68,-1.51l-1.05,-0.26l0,0l0.74,-1.38l-0.24,-2.38l-2.14,-0.82l-0.5,0.58l-1.32,-3.35l-2.03,-0.59l0.15,-2.21l-3.72,-3.64l0.48,-1l0,0l4.42,-0.31l1.1,-1.31l1.99,0.25l-1.32,-2.26l1.38,-1.65l-1.81,-2.6l-0.01,-2.51l1.87,-1.03l2.97,-5.42l1.26,-0.16l0,0l0.87,0.59l2.02,-0.7l1.74,1.92l2.75,-0.42l1.44,-1.47l1.64,0.62l-0.26,1.56l0.56,0.01l0,0l-3.87,4.57l0.95,1.16l-1.55,0.72l0.78,0.9l-0.92,0.36l-1.17,2.78L168.94,341.18z"},{"code":"JP-NG","name":"Niigata","path":"M301.12,218.98l6.73,-5.17l3.82,-5.61l2.29,-5.71l8.15,-4.67l1.75,-1.88l1.65,-3.59l0.13,-3.88l1.85,-3.75l0,0l3.29,1.28l-0.15,2.29l0.8,1.13l2.99,1.71l-0.79,1.59l-1.37,0.86l-1.58,-0.22l-0.52,0.82l0.17,2.88l-1.28,3.68l2.2,2.11l0,0l-3.69,4.3l0.67,3.39l-2.97,-0.03l-0.73,1.35l-3.38,0.29l-0.57,0.92l0.53,1.76l-1.17,2.55l1.74,1.89l-0.28,5.21l0,0l-2.8,-2.72l-0.95,1.68l-1.63,0.28l0.27,1.93l-0.94,0.15l-0.04,1.39l-2.13,0.59l-0.69,1.67l-1.81,0.02l0,0l-0.07,-2.76l-2.01,-1.54l-0.46,-2.49l-0.81,-0.23l-2.56,0.81l-1.92,2.1l-0.26,1.65l-1.39,-0.64l-3.18,1.74l-0.95,-0.69l0.19,-1.85l-2.88,-0.3l0.08,1.29l-2.15,2.36l0,0l-1,-4.25l-1.52,-1.06l0,0l5.42,-1.98l3.59,-2.74L301.12,218.98zM306.12,194.21l-0.4,2.32l2.5,-0.1l-1.42,3.93l-2.75,2.23l-2.84,0.51l2.68,-4.62l-1.38,-0.26l-0.97,0.81l0.15,-2.76l1.68,-2.84l2.17,-1.55l0.46,-1.54l1.09,-0.26L306.12,194.21z"},{"code":"JP-NN","name":"Nagano","path":"M288.36,264.81L289.19,263.63L288.93,262.36L289.8,262.07L289.09,261.09L289.74,259.48L288.1,259.26L287.9,255.88L286.32,253.39L283.71,252.11L284.76,250.26L286.66,250.17L288.99,247.33L289.38,245.76L288.21,244.2L290.11,239.83L288.86,238.13L288.86,238.13L291.16,235.01L290.94,233.79L292.12,233.09L292.32,228.91L292.32,228.91L294.47,226.55L294.39,225.26L297.26,225.56L297.08,227.42L298.03,228.11L301.21,226.37L302.59,227.01L302.85,225.36L304.77,223.26L307.34,222.45L308.15,222.68L308.61,225.17L310.62,226.71L310.69,229.47L310.69,229.47L307.35,230.66L307.34,231.75L305.42,233.09L304.84,235.74L304.9,237.04L306.15,237.78L309.64,237.54L309.86,240.17L308.83,240.85L309.45,243.21L308.38,243.53L309.75,245.04L309.8,247.16L311.13,247.78L311.13,247.78L311.35,249.81L311.35,249.81L309.25,250.75L308.71,249.61L306.25,250.08L305.78,248.88L304.35,248.3L302.58,251.01L301.66,250.51L300.69,252.48L301.57,253.34L300.57,254.44L301.3,256.21L301.3,256.21L299.8,258.36L299.79,262.81L293.4,266.57L293.4,266.57L290.79,266.14L288.68,266.96z"},{"code":"JP-NR","name":"Nara","path":"M258.47,277.9L259.27,279.47L258.51,281.59L260.62,282.23L262.03,283.93L261.64,284.88L259.46,285.2L258.96,286.15L260.11,288L259.45,288.36L260.14,289.52L259.42,290.88L259.56,294.91L257.94,294.66L254.81,297.88L254.81,297.88L250.33,298.48L249.74,297.78L250.45,295.95L248.63,293.21L250.5,290.47L252.24,289.97L250.54,286.42L250.54,286.42L251.34,284.95L250.71,281.11L252.24,277L252.24,277L252.76,278.22L254.68,278.74L256.15,277.53L257.55,278.57z"},{"code":"JP-NS","name":"Nagasaki","path":"M144.39,321.96l1.43,0.22l0.88,1.71l-0.59,2.7l-3.54,1.92l-0.69,-2.04l1.47,-1.73l-0.54,-0.96l-1.86,-0.03l-2.61,0.62l-1.13,2.48l-3.11,2.15l1.83,-3.83l-1.1,-1.98l-0.74,0.31l-0.9,-0.87l-1.23,-2.58l0.62,-2.88l0.97,-0.27l0.42,1.89l1.65,0.3l-0.53,3l1.17,0.82l0.97,-1.13l2.2,0.78l-1.53,-1.8l0.01,-2.41l-3.79,-1.21l-0.32,-2.01l-1.12,1.49l0.21,-1.49l-2.45,-1.22l0.85,-3.87l0.59,0.46l0.9,-0.88l0.12,1.07l2.08,-0.45l0.21,0.84l0,0l-0.59,0.99l1.08,2.63l2.41,0.48l-0.32,1.75l2.7,2.42l2.8,0.68l0,0l-1.52,1.87l0.85,0.74L144.39,321.96zM126.07,287.66l0.35,-1.14l-0.56,0.71l-1.82,-0.36l2.01,-4.09l-0.83,-0.89l0.67,-1.87l1.44,-0.07l1.1,-1.31l0.96,0.89l-0.48,2.7l-2.05,2.43l0.92,2.45l-0.88,0.74l0.42,0.55l-1.28,0.49l-0.91,3.46l-1.37,1.09l-0.91,-0.44l0.76,-5.44l0.36,0.91L126.07,287.66zM116.44,325.01l1,2.34l-2.41,-0.09l0.04,1.67l-0.73,-0.8l-2.71,-0.12l0.27,-0.82l1.17,-0.11l-0.28,-3.02l1.01,0.72l2,-1.13L116.44,325.01zM121.62,317.82l-0.31,1.55l1.53,-0.62l0.35,0.71l-1.71,1.49l-0.74,2.31l-0.47,-3.02l-0.87,0.03l1.11,-0.75l1.3,-4.41L121.62,317.82zM129.89,310.07l0.6,-0.71l0.3,1.23l-2.09,3.37l-1.85,1.04l-0.34,-0.82l0.82,0.42l0.19,-1.98L129.89,310.07zM116.78,322.61l0.83,0.52l-0.43,1.36l-0.75,-0.49L116.78,322.61zM119.72,322.23l-0.94,-0.92l0.71,0.1l-0.18,-0.87l0.9,0.82l-0.11,1.23L119.72,322.23zM122.36,312.04l-0.22,1.09l-1.14,-0.24L122.36,312.04zM118.38,323.63l-1.02,-1.8l0.83,0.9l0.55,-0.74L118.38,323.63zM127.58,310.23l0.55,-1.66l0,2.09L127.58,310.23zM130.91,307.67l-1.55,0.24l1.17,-0.93L130.91,307.67zM120.77,314.57l-0.3,-0.73l1.03,0.09L120.77,314.57z"},{"code":"JP-ON","name":"Okinawa","path":"M96.19,466.71l3.32,-2.45l-1.74,-0.69l-0.34,-2.3l2.4,0.41l0.16,1.38l0.92,-0.11l3.5,-3.57l0.33,-1.59l1.17,0.59l0.39,2.04l-1.76,2.62l-1.76,0.03l0.08,1.38l-1.15,0.72l-1.15,-0.38l0.33,0.67l-2.04,1.83l-2.34,0.12l1.77,3l-1.67,-0.75l-1.32,2.79l1.22,0.76l-3.05,2.01l-0.79,-2.72l2.42,-2.38l-0.85,-2.74L96.19,466.71zM131.27,424.58l-1.1,1.43l-1.58,0.22l0.1,1.88l-1.89,1.34l0.21,1.01l-1.64,-0.93l-0.42,-1.37l-2.74,-0.96l1.8,-0.45l-0.2,-0.64l2.44,-1.48l3.28,-0.7l0.72,-1.42l1.55,-0.31l0.3,1.39l0.72,-1l-0.57,-0.93l0.89,-0.62l0.52,2.24L131.27,424.58zM19.83,512.37l-1.21,2.24l-4.28,-1.13l0.83,-0.91l0.79,0.63l0.64,-2.54L19.83,512.37zM118.99,436l1.33,2.09l-0.97,2.05l-1.03,0.19l-1.12,-1.37l-0.03,-2.47l0.42,-1.32l1.44,0.04L118.99,436zM24.36,510.41l1.06,-0.13l2.32,-3.23l-1.76,3.08l-0.19,2.5l-1.69,0.37l-0.86,-0.75l0.62,-1.04l-1.47,-0.38l0.97,-1.13L24.36,510.41zM45.7,503.79l0.63,0.09l-0.36,-3.53l1.39,2.55l2.31,1.46l-2.86,0.41L45.7,503.79zM112.24,446.9l-1.39,0.78l-0.71,-1.32l3.72,-1.12L112.24,446.9zM123.92,429.29l0.69,-0.34l1.74,1.25l-0.07,0.91l-2.48,0l-0.8,-2.47l0.69,-0.29L123.92,429.29zM75.6,469.71l-1.16,-1l1.45,-0.38l0.79,0.92l-0.24,1.2L75.6,469.71zM139.95,424.63l-1.2,1.87l-1.08,-0.15l0.05,-0.73L139.95,424.63zM43.46,502.47l0.52,-1.03l1.14,1.1L43.46,502.47zM98.87,453.97l1.4,-1.11l-2.06,2.28L98.87,453.97zM96.23,460.76l0.24,0.54l-1.55,-0.2L96.23,460.76zM98.63,455.89l0.05,0.99l-0.56,-0.59L98.63,455.89z"},{"code":"JP-OK","name":"Osaka","path":"M246.17,283l0.29,-2.92l0,0l0.54,-1.21l-0.84,-4.95l0.91,-0.51l-2.37,-0.95l-0.24,-1.57l0.72,-0.27l0,0l0.19,0.74l2.16,0.6l1.01,1.78l0.79,-0.26l-0.12,-1.1l0.75,0.02l2.57,3.98l-0.29,0.62l0,0l-1.53,4.1l0.63,3.84l-0.81,1.47l0,0l-10.07,2.64l-0.83,-1.01l0,0l2.57,-0.85L246.17,283z"},{"code":"JP-OY","name":"Okayama","path":"M218.7,281.93l-1.41,1.09l-0.47,1.72l-4.33,-0.55l-0.62,-0.78l-3.86,1.58l-0.69,-0.84l0,0l-1.33,-3.39l-0.11,-4.41l-1.6,-2l0.47,-2.8l-1.01,-1.22l0,0l0.59,-1.09l2.19,-0.41l-0.06,-1.57l1.98,-0.16l1.74,-3.66l2.97,0.64l1.59,1.65l3.55,-2.45l0.04,1.06l2.42,0.63l0.92,2.67l4.41,-1.71l0,0l0.12,2.24l-0.92,0.19l-1.81,2.81l-0.3,1.82l0.68,0.85l-0.7,1.31l1.8,2.81l0,0l-1.37,0.04l-2.13,2.87L218.7,281.93zM223.96,284.77l0.32,-0.65l-1.53,1.49l0.02,-1.32l-1.88,-0.04l0.45,-0.86l3.68,-1.35l-0.22,3.06L223.96,284.77z"},{"code":"JP-OT","name":"Oita","path":"M155.94,316.55l0.83,-1.63l-1.17,-1.53l0.78,-1.29l-0.58,-1.11l1.26,-2.47l1.61,-1.38l3.81,-0.07l0.11,-2.15l0,0l4.67,0.6l1.58,-2.31l1.68,-0.5l2.85,2.48l0.18,2.87l-0.71,1.37l-1.37,-0.4l0.2,1.16l-1.12,0.69l-1.68,-0.38l-0.12,0.71l0.35,1.5l1.5,0.51l1.88,-0.81l1.34,0.96l2.96,-0.67l-1.86,3.29l1.78,-0.18l-0.76,1.29l0.99,0.29l0.59,-0.68l0.59,0.84l0.63,-0.82l0.07,0.8l-1.53,0.24l-0.63,1.66l3.71,1.09l-2.11,0.27l0.78,0.75l-0.81,0.76l0.66,0.7l-1.43,1.02l-0.92,-0.47l-0.25,1.53l0,0l-0.56,-0.01l0.26,-1.56l-1.64,-0.62l-1.44,1.47l-2.75,0.42l-1.74,-1.92l-2.02,0.7l-0.87,-0.59l0,0l-1.4,-1.27l-0.8,-3.88l-2.09,-3.04l-2.43,0.31l0.71,1.95l-0.67,1.48L155.94,316.55z"},{"code":"JP-SG","name":"Saga","path":"M135.42,311.26l0.67,0.96l0.64,-2.5l-1.75,-1.34l0.48,-0.81l1.01,0.73l-0.26,-2.4l1.66,0.14l0.75,2.25l1.37,-0.3l0,0l4.66,-0.21l3.09,1.95l2.14,-0.98l-0.02,2.25l-2.87,2.25l-0.76,2.27l0,0l-1.31,-0.01l-1.08,-1.09l-1.98,2.1l1.41,3.5l0,0l-2.8,-0.68l-2.7,-2.42l0.32,-1.75l-2.41,-0.48l-1.08,-2.63l0.59,-0.99l0,0L135.42,311.26zM133.81,302.28l-1.58,-1.37l1.21,-2.23l1.37,0.5l-0.3,1.58l0.78,0.27L133.81,302.28zM134.05,308.93l0.37,-1l0.78,0.95l-1.18,0.59L134.05,308.93z"},{"code":"JP-SH","name":"Shiga","path":"M265.76,266.48L266.54,268.06L264.78,273.96L262.44,275.09L259.76,274.06L259.36,276.15L258.02,276.7L258.02,276.7L256.38,274.38L254.94,274.29L254,270.54L254.6,265L253,263.17L253,263.17L253.88,261.83L255.45,261.95L256.49,259.19L257.72,259.86L259.82,257.79L260.92,258.11L260.54,254.93L263.02,255.73L263.02,255.73L263.94,256.87L263.82,258.47L265.46,258.97L266.29,262.35L265.04,265.79z"},{"code":"JP-SM","name":"Shimane","path":"M184.79,270.28l2.1,-3.06l4.5,-2.85l0.54,-2.39l-0.87,-0.76l6.78,-1.99l-0.07,-0.65l1.17,0.12l1.34,-1.6l0.91,1.06l3.65,-0.18l-1.62,0.81l1.63,1.67l0,0l-0.31,4.69l-3.1,1.38l0.85,1.11l-1.05,2.24l0,0l-5.31,-0.61l-2.4,3.33l-2.04,1.26l1.08,1.55l-3.23,1.2l-1.88,-0.54l-2.82,0.97l-1.19,-0.59l-2.06,2.48l0.55,0.34l-0.91,2.8l-1.52,1.49l0.49,0.63l0,0l-1.29,1.16l0.28,1.21l-1.12,1.58l-0.69,-0.63l-1.99,0.79l-1.04,-1.62l0.55,-1.54l-1.87,0.04l-0.61,-1.65l1.11,-1.62l-0.83,-2.54l0,0l2.66,-0.42l5.23,-5.67L184.79,270.28zM202.89,242.95l-0.87,-0.56l-0.06,-1.85l1.95,-1.3l2.08,1.79l-0.3,1.5l-1.26,0.17l0.44,0.78L202.89,242.95zM199.93,244.07l-0.65,2.01l-1.17,-0.81l0.24,1.34l-1.03,-0.64l1.31,-1.75L199.93,244.07zM201.07,245.45l-1.32,1.26l-0.09,-1.63l0.95,-0.47L201.07,245.45zM198.48,246.74l1.22,0.88l-1.18,-0.16L198.48,246.74z"},{"code":"JP-ST","name":"Saitama","path":"M311.35,249.81L311.13,247.78L311.13,247.78L316.01,244.56L317.54,244.49L319.21,240.83L324.03,241.67L325.84,243.01L328.9,243.01L329.7,242.25L329.7,242.25L330.54,242.66L330.54,242.66L331.23,245.51L332.01,245.26L332.01,245.26L334.45,250.92L333.88,252.52L333.88,252.52L331.82,252.03L328.96,253.26L327.5,253.34L327.22,252.47L324.38,253.25L322.66,251.63L317.17,250.1L315.6,251.12L315.6,251.12L314.51,251.41z"},{"code":"JP-SZ","name":"Shizuoka","path":"M318.88,274.72L316.58,277.79L316.39,279.81L313.21,281.04L311.49,279.03L312.24,277.49L311.83,274.42L312.5,273.81L311.96,272.28L312.45,271.05L314.5,271.21L314.77,270.5L312.99,268.91L310.67,268.4L307.93,269.22L307.21,271.89L304.14,273.55L303.52,275.89L300.77,279.64L301.44,281.29L296.97,279.71L286.85,279.41L286.85,279.41L287.12,275.86L289.87,274.32L293.6,268.05L293.4,266.57L293.4,266.57L299.79,262.81L299.8,258.36L301.3,256.21L301.3,256.21L302.24,259.39L301.96,263.87L304.16,264.22L305.54,267.41L307.5,266.9L307.1,264.24L307.48,261.92L308.47,261.01L310.52,263.12L315.06,262.06L315.06,262.06L316.72,262.27L316.46,266.9L317.29,268.12L318.81,268.33L318.81,268.33L318,270.31L319.53,272.72z"},{"code":"JP-TC","name":"Tochigi","path":"M341.49,224.75L342.07,230.03L340.75,230.94L341.34,234.7L340.21,237.73L335.85,238.52L334.6,240.32L333.47,240.04L332.91,241.73L330.54,242.66L330.54,242.66L329.7,242.25L329.7,242.25L328.9,240.94L326.07,240.98L323.95,238.65L326.21,233.53L323.17,232.18L323.66,228.75L324.68,227.34L323.66,226.9L324.24,225.36L324.24,225.36L334.41,219.42L339.22,220.7L340.47,222.61L341.32,222.56z"},{"code":"JP-TK","name":"Tokyo","path":"M324.39,279.13l-0.82,-0.8l0.18,-1.89l1.74,1.35l-0.16,1.5L324.39,279.13zM322.28,285.28l-0.33,2.29l-0.55,-0.92L322.28,285.28zM333.18,256.39l-1.01,-0.99l-0.5,0.44l-0.3,1.56l1.02,1.32l-1.79,0.09l0,0l-0.81,-1.28l-2.68,-1.27l-1.47,0.67l0.79,0.62l-0.49,2.05l-1.35,-1.89l-3.04,-0.55l-2.27,-1.64l0,0l-2.1,-1.16l-1.58,-3.24l0,0l1.57,-1.02l5.49,1.53l1.72,1.62l2.84,-0.78l0.28,0.87l1.46,-0.08l2.86,-1.23l2.06,0.49l0,0l1.43,3.02l0,0l-0.99,1.27L333.18,256.39zM327.8,293.02l-1.45,-0.42l-0.22,1.63l1.42,-0.22L327.8,293.02zM333.04,317.92l0.29,-1.71l-1.91,-0.94l0.65,2.06L333.04,317.92zM333.04,317.92l0.29,-1.71l-1.91,-0.94l0.65,2.06L333.04,317.92z"},{"code":"JP-TS","name":"Tokushima","path":"M232.42,299.62l-6.51,3.95l-1.79,2.54l0,0l-2.11,-0.22l-0.63,-3l-1.97,-0.05l-0.61,-3.26l-1.35,-0.16l-1.03,1.01l-1.43,-1.22l-1.81,0.17l-1.71,-1.06l0,0l0.58,-3.11l0,0l3.39,-2.18l1.38,-0.25l1.33,0.97l3.42,-2.39l4.7,0.36l0.58,-1.18l0,0l2.81,-0.79l0.75,1.42l-0.63,4.06l0.48,0.53l0.36,-0.56l1.4,2.01l-1.52,1.73l2.25,0.25L232.42,299.62z"},{"code":"JP-TT","name":"Tottori","path":"M204.84,260.46l1.46,0.29l3.72,-1.9l3.24,0.75l7.29,-0.63l4.83,-2.08l0,0l2.82,6.56l0.11,1.59l-2.22,0.89l0,0l-4.41,1.71l-0.92,-2.67l-2.42,-0.63l-0.04,-1.06l-3.55,2.45l-1.59,-1.65l-2.97,-0.64l-1.74,3.66l-1.98,0.16l0.06,1.57l-2.19,0.41l-0.59,1.09l0,0l-2.53,-0.45l0,0l1.05,-2.24l-0.85,-1.11l3.1,-1.38L204.84,260.46z"},{"code":"JP-TY","name":"Toyama","path":"M279.57,228.41L283.8,228.95L284.97,227.84L285.67,224.91L289.79,223.6L289.79,223.6L291.31,224.66L292.32,228.91L292.32,228.91L292.12,233.09L290.94,233.79L291.16,235.01L288.86,238.13L288.86,238.13L285.24,237.23L284.96,236.45L283.61,237.25L283.36,236.33L280.51,236.55L276.79,240.94L276.37,239.36L274.85,238.62L273.21,240.32L273.21,240.32L273.68,234.17L273.03,232.46L274.88,225.66L276.28,224.29L278.25,224.13L278.25,224.13L276.92,226.42z"},{"code":"JP-WY","name":"Wakayama","labelCoordinate":{"x":0.5,"y":0.65},"path":"M254.08,306.89l-1.24,1.87l0.07,-1.1l-5.03,-1.02l-3.54,-3.37l1.22,-1.09l-4.06,-2.43l-0.68,-1.41l-1.87,-0.06l0.21,-2.33l2.06,-1.28l-1.86,-1.01l0.91,-1.47l1.17,-0.28l-2.31,-3.24l0.49,-0.63l0,0l0.83,1.01l10.07,-2.64l0,0l1.7,3.56l-1.74,0.49l-1.86,2.74l1.82,2.74l-0.71,1.83l0.59,0.71l4.48,-0.61l0,0l-0.07,1.92l1.7,1.94l1.29,0.27l0,0l-0.48,1.6l-0.96,0.26l0.43,1.48L254.08,306.89z"},{"code":"JP-YC","name":"Yamaguchi","path":"M169.03,294.88l-0.59,-0.41l-1.09,1.23l-0.59,-0.92l-2.49,2.48l-2.18,-0.78l0.08,-0.79l-2.26,-1.28l-2.86,3.04l0.24,-3.14l-1.06,-1.52l1.43,-1.85l-1.31,-2.38l0.69,-1.53l2.64,-0.41l-1.53,-0.86l0.28,-0.82l2.52,0.55l1.09,1.11l4.6,-1.06l4.13,-5.73l1.69,-0.44l0,0l0.83,2.54l-1.11,1.62l0.61,1.65l1.87,-0.04l-0.55,1.54l1.04,1.62l1.99,-0.79l0.69,0.63l1.12,-1.58l-0.28,-1.21l1.29,-1.16l0,0l1.71,5.72l1.61,0.12l0,0l-0.42,5.34l-1.66,1.08l0.26,2.93l-0.49,-1.07l-5.41,-3.33l-0.5,1.15l-0.91,-0.2l1.12,-1.18l-1.25,-0.71l-4.44,1.44L169.03,294.88zM184.17,298.5l-1.42,0.31l-0.64,-1.66l1.18,-0.95l1.36,1.13l3.33,-0.72l-1.97,0.95l0.01,1.14l-1.42,-0.82L184.17,298.5z"},{"code":"JP-YN","name":"Yamanashi","path":"M319.27,255.52L318.91,258.83L315.46,260.93L315.06,262.06L315.06,262.06L310.52,263.12L308.47,261.01L307.48,261.92L307.1,264.24L307.5,266.9L305.54,267.41L304.16,264.22L301.96,263.87L302.24,259.39L301.3,256.21L301.3,256.21L300.57,254.44L301.57,253.34L300.69,252.48L301.66,250.51L302.58,251.01L304.35,248.3L305.78,248.88L306.25,250.08L308.71,249.61L309.25,250.75L311.35,249.81L311.35,249.81L314.51,251.41L315.6,251.12L315.6,251.12L317.17,254.36z"},{"code":"JP-YT","name":"Yamagata","path":"M341.93,199.04l0.29,4.12l-1.33,1.61l-2.04,0.3l-1.47,-1.12l-1.23,0.46l-0.97,-1.68l-2.51,0.62l-1.42,-0.49l0,0l-2.2,-2.11l1.28,-3.68l-0.17,-2.88l0.52,-0.82l1.58,0.22l1.37,-0.86l0.79,-1.59l-2.99,-1.71l-0.8,-1.13l0.15,-2.29l-3.29,-1.28l0,0l1.17,-3.08l2.88,-3.01l2.26,-8.33l0,0l2.51,0.41l1.35,-0.71l0.2,1.17l1.51,0.89l5.58,1.53l0.58,1.8l1.77,0.98l0,0l1.85,2.88l-0.89,3.22l-1.15,-0.03l1.32,4.56l-2.6,4.67l0.07,2.24l-1.29,2.6l-2.71,0.56L341.93,199.04z"}]; + tuiChart.registerMap('japan', data); +})(tui.chart); diff --git a/dist/maps/singapore.js b/dist/maps/singapore.js new file mode 100644 index 000000000..1e7759f21 --- /dev/null +++ b/dist/maps/singapore.js @@ -0,0 +1,10 @@ +/** + * https://www.amcharts.com/svg-maps/?map=singapore + * map data by amcharts team + */ +'use strict'; + +(function(tuiChart) { + var data = [{"code":"SG-CS","name":"Central Singapore","labelCoordinate":{"x":0.4,"y":0.5},"path":"M430.84,77.29l6.38,3.86l8.89,10.73l4.99,1.87l2.1,-2.6l4.36,0.42l14.99,4.56l5.66,4.3l0,0l-0.3,0.29l0,0l-5.15,7.86l0,0l-10.02,7.12l-1.68,7.58l0,0l-0.56,2.62l0,0l-7.4,6.09l-0.09,6.18l-6.67,10.65l-6.78,20.43l0,0l-11.34,-1.64l0,0l-6.87,1.29l-11.16,23.74l-0.14,5.87l5.29,13.45l-10.3,3.57v3.72l13.01,1.86l5.01,15.73l9.58,3.72l6.87,6.86l1.43,10.45l0,0l-5.15,4.15l0,0l-3.72,3l0,0l-1,3.43l2.86,7.44l-1.76,7.47l0,0l-10.47,10.12l0.83,17.15l-16.43,-0.12l-1.97,8.35l2.17,7.13l2.04,0.2l5.37,-10.93l3.46,0.07l11.41,5.5l5.92,8.69l-17,13.37l-8.41,-2.14l-1.64,-3.83l-6.05,-1.8l-2.53,2.03l0.63,20.97l-9.28,-9.6l-3.41,2.93l2.99,5.3l-9.56,-9.53l-13.39,-0.38l-13.13,7.39h-8.09l-4.05,-1.36l1.15,-1.43l-2.12,-1.4l-2.59,2.53l-2.15,-2.06l1.67,-2.1l-3.56,-1.63l0,0l-5.13,-8.36l7.97,-10.82l-0.38,-3.42l-1.52,-2.28l-17.85,0.19l-8.35,-4.94l-3.99,-17.09l-5.51,-9.3l3.23,-6.46l0,0l0.57,-3.41l2.3,1.78l0,0l5.13,2.93l2.44,-16.13l9.04,-12.46l7.82,-4.89l0.73,-10.51l5.13,-6.11l-0.49,-3.18l-8.55,-2.44l-14.17,-12.95l-0.98,-4.15l11,-17.35l12.22,-9.77l8.17,-20.84l0,0l-1.57,-2.62l0,0l-3.42,-10.02l0.49,-12.22l-4.4,-9.77l0,0l-3.66,-6.6l0,0l13.44,-6.11l8.8,-16.61l0,0l3.18,-10.51l0,0l6.84,-5.62l6.35,0.73l11.24,11.48l8.8,-1.71l0,0l5,-0.12l0,0l6.63,-1.66l0,0l-7.04,9.29l-26.84,9.1l-3,4.51l1.69,5.82l4.65,-3.03l2.76,-5.88l13.61,-0.28l15.89,-7.71l16.4,-25.38L430.84,77.29zM477.52,91.76h-12.86l-8.33,-4.04l9.73,-10.55l12.45,8.08L477.52,91.76zM454.77,85.74l-1.57,1.81l-6.76,-1.24L431.61,73.7l1.07,-3.38l8.33,-5.44l4.86,-0.25l6.92,3.63l8.9,6.51L454.77,85.74z"},{"code":"SG-NE","name":"North East","path":"M532.68,110.05l2.97,5.42l-8.2,-5.22l-3.22,1.37l0.62,-4.07L509.7,91.24l11.28,6.9L532.68,110.05zM505.91,92.39l0.34,8.23l21.14,16.76l-6.45,5.89l1.7,3.88l13.68,-6.35l5.13,4.37l6.46,11.58l12.92,8.89l13.26,4.87l1.42,3.27l0.84,-2.35l9.39,1l6.89,-2.26l5.65,2.19l4.07,-6.93l0,0l1.41,5.85l8.73,10.06l-0.76,3.61l-19.94,18.61l3.42,8.73v8.54l-11.77,3.8l-17.47,12.15l-8.16,-3.99l-15.38,1.33l-11.01,-2.09l-1.04,2.97l5.68,3.2l0,0l2.82,2.91l0,0l2.19,3.58l-1.48,3.09l-7.41,0.76l-12.53,7.79l1.33,2.85l-3.99,4.56l3.61,3.23l-1.9,6.27l-24.68,1.52l-2.85,-5.89l2.09,-6.08l-27.72,-26.96l-0.38,-7.41l-18.23,-5.51l-2.47,-3.23l-1.33,-6.08l-7.59,-8.92l4.05,-15.46l0,0l6.78,-20.43l6.67,-10.65l0.09,-6.18l7.4,-6.09l0,0l0.56,-2.62l0,0l1.68,-7.58l10.02,-7.12l0,0l5.15,-7.86l0,0l0.3,-0.29l0,0l1.51,-2.78l10.4,-3.9l5.79,-9.15l5.37,-1.76l3.19,1.01l-1.26,3.95L505.91,92.39z"},{"code":"SG-NW","name":"North West","labelCoordinate":{"x":0.3,"y":0.4},"path":"M411.58,35.23l11.68,14.27l0.66,5.35l-7.32,-8.07L411.58,35.23zM345.83,5.52l-2.63,4.41l1.22,1.41l6.38,-4.51l1.78,4.79l-2.44,3.19l2.35,0.66l9.49,-11.7l8.49,5.28l-2.63,7.98l8.26,-6.2l24.54,17.62l18.02,33.25l-11.08,14.64l-0.56,5.54l-6.49,11.59l0,0l-6.63,1.66l0,0l-5,0.12l0,0l-8.8,1.71l-11.24,-11.48l-6.35,-0.73l-6.84,5.62l0,0l-3.18,10.51l0,0l-8.8,16.61l-13.44,6.11l0,0l3.66,6.6l0,0l4.4,9.77l-0.49,12.22l3.42,10.02l0,0l1.57,2.62l0,0l-8.17,20.84l-12.22,9.77l-11,17.35l0.98,4.15l14.17,12.95l8.55,2.44l0.49,3.18l-5.13,6.11l-0.73,10.51l-7.82,4.89l-9.04,12.46l-2.44,16.13l-5.13,-2.93l0,0l-2.3,-1.78l0,0l-0.95,-3.42l-9.87,-3.79l-10.63,-7.97l-10.07,-2.47l-20.69,-16.9l-4.56,-7.21v-6.08l11.2,-0.2l8.92,-4.94l0.57,-4.36l8.35,-0.57l2.1,-2.28l-0.57,-4.36l-7.79,-5.13l-13.67,-16.7l-1.9,-20.13l-12.53,-30.76l-10.83,-16.33l-2.28,-14.05l4.94,-8.74l0.19,-21.46l12.16,-14.05l-2.3,-13.75l0,0l5.38,-2.15l3.85,-7.42l4.22,-0.66l0.28,-4.13l4.22,-3.75l16.61,-7.42l37.57,-26.17l22.57,-3.44l12.59,2.27L345.83,5.52z"},{"code":"SG-SE","name":"South East","labelCoordinate":{"x":0.5,"y":0.65},"path":"M633.27,131.52l17.34,4.94l10.94,8l6.47,13.49l-0.18,23.8l7.93,2.92l-26.61,64.37l5.74,2.83l15.59,-3.28l5.65,1.46l13.22,6.47l-2.06,7.73l-30,8.58l-17.28,-6.19l-10.13,2.74l-2.05,-7.71l-0.88,0.03l-37.83,4.84l-33.84,12.8l-24.92,3.53L508.45,289l-5,3.59l-12.07,1.65l-28.8,13.08L450,317.29l-4.15,0.43l-5.02,5.67l-11.01,-12.92l-3.94,-8.88l0.24,-6.05l17.17,-0.61l-7.12,-6.2l-0.21,-4.11l-3.76,-1.29l0,0l1.76,-7.47l-2.86,-7.44l1,-3.43l0,0l3.72,-3l0,0l5.15,-4.15l0,0l-1.43,-10.44l-6.87,-6.87l-9.58,-3.72l-5.01,-15.73l-13.02,-1.86v-3.72l10.3,-3.58l-5.29,-13.45l0.14,-5.86l11.16,-23.74l6.87,-1.29l0,0l11.34,1.64l0,0l-4.05,15.46l7.59,8.92l1.33,6.08l2.47,3.23l18.23,5.51l0.38,7.41l27.72,26.96l-2.09,6.08l2.85,5.89l24.68,-1.52l1.9,-6.27l-3.61,-3.23l3.99,-4.56l-1.33,-2.85l12.53,-7.79l7.41,-0.76l1.48,-3.09l-2.19,-3.58l0,0l-2.82,-2.91l0,0l-5.68,-3.2l1.04,-2.97l11.01,2.09l15.38,-1.33l8.16,3.99l17.47,-12.15l11.77,-3.8v-8.54l-3.42,-8.73l19.94,-18.61l0.76,-3.61l-8.73,-10.06l-1.41,-5.85l0,0l10.78,-11.89L633.27,131.52zM574.63,119.63l-6.92,-6.55l5.64,2.03L574.63,119.63zM693.46,97.65l-6.71,-3.1l-2.65,-5.59l4.57,-9.37l11.79,12.08l-1.47,4.74L693.46,97.65zM578.31,88.95l28.69,-1.5l13.24,2.61l10.33,-1.4l0.7,2.11l5.12,-1.81l2.61,6.32l-0.6,7.32l2.31,1.81l-24.68,1.6l-10.53,8.43l-23.07,4.92l-6.12,-9.63l-5.72,-1.1l-5.02,-8.02l-16.05,-7.42l-5.72,-0.1l-4.01,-4.11l-3.11,1l-5.22,-4.51l-1.3,-6.12l12.64,-7.02l18.96,6.82l7.42,6.72L578.31,88.95zM771.21,72.11l21.97,14.55l6.12,10.36l0.7,5.72l-8.13,26.98l-8.33,4.71l-6.92,-3.31l-5.92,2.11l-18.46,8.83l-10.53,8.53l-21.97,-25.48l-2.91,-8.48l-13.24,-10.83l5.82,-11.84L704.3,76.5l16.15,0.5l9.88,-10.91l3.66,3.41l11.54,3.11l6.92,-7.02L771.21,72.11z"},{"code":"SG-SW","name":"South West","labelCoordinate":{"x":0.4,"y":0.4},"path":"M185.99,484.54l-2.31,1.47l3.5,2.82l-1.13,1.81l-8.58,1.75l-5.36,3.84l-1.02,-8.13l6.83,-1.75l2.03,-6.32l3.72,0.62L185.99,484.54zM313.25,460.57l-11.94,-5.42l-3.31,-6.32l0.9,-4.41L313.25,460.57zM243.6,447.43l2.96,0.89l2.54,5.67l-3.43,4.95l-3.89,1.23l-2.67,-8.84l3.39,-7.19L243.6,447.43zM181.9,447.02l6.04,-2.48l1.41,1.47l-3.44,4.01l6.49,4.18l-3.39,4.18l-17.89,0.62l-18.68,-3.5l1.41,-3.27l13.54,-9.08l11.12,-1.97L181.9,447.02zM393.23,423.71l5.43,3.01l0.06,9.56l-11.5,-13.16l2.36,-1.71L393.23,423.71zM409.87,427.38l-6.73,-5.37l-0.71,-4.84l8.26,5.9L409.87,427.38zM230.19,421.81l-7.82,-0.1l-1.3,-7.32l9.73,4.11l1.6,2.11L230.19,421.81zM401.9,410.27l-4.25,0.59l4.37,-3.01L401.9,410.27zM238.92,412.28l-5.82,-6.52l4.51,-6.02l3.41,6.72L238.92,412.28zM216.25,407.47l-5.32,-0.2l-2.11,-3.41l10.03,-5.72l5.52,1.3l0.5,4.31L216.25,407.47zM260.48,403.16l9.93,7.72l4.21,8.23h-8.13l-2.61,-5.82l-6.92,-3.81l-1.5,1.71l4.92,3.01l-4.21,3.91l-14.44,-2.51l2.81,-5.92l5.72,1.5l2.01,-2.01l-6.82,-2.91l-2.51,-7.72l1.3,-4.51l7.82,1.2L260.48,403.16zM333.09,361.34l7,1.18l3.85,-2.52l14.79,8.97l8.57,-0.08l7.24,2.99l8.81,-1.26l1.42,4.09l8.18,-3.38l2.36,2.28l-9.56,14l-4.72,-5.19l0.63,9.44L367.38,398l-14.71,-16.52L341.74,377l-16.52,-15.97L333.09,361.34zM382.56,363.23l-9.28,5.35l-19.04,-7.79l7.94,-5.11l10.23,-1.26L382.56,363.23zM184.53,311.65l0.9,7.92l6.02,6.72l14.95,3.61l3.91,4.31l-0.3,3.91l-11.94,7.12l-16.05,-5.42l-6.52,5.12l1.1,3.21l6.42,-0.1l0.3,3.71l-5.22,5.92l-18.66,-9.13l-0.9,-4.81l-2.71,2.35l-3.81,-0.7l-2.81,4.71l16.85,9.83l-0.4,1.71l-9.03,3.21l-20.06,12.84l-9.53,-19.96l-6.82,4.51l6.62,19.76l-1,2.61l-5.92,3.51l-8.53,-20.86l-7.02,5.72l6.02,21.37l-15.95,5.22l-8.93,-5.92l-12.14,-19.36l-8.33,-24l19.56,-19.36l28.84,-20.46l11.99,-1.02l2.81,-3.51l4.31,-0.3l0.6,2.71l-8.13,6.42l-11.94,15.55l5.92,6.72l6.82,-5.72l2.41,1.6l4.11,-1.6l0.4,-7.46l6.02,-6.02l5.22,-0.6v-4.62l3.31,1.61l1.91,-2.61l-2.71,-3.61l5.92,-3.81l14.65,-3.01l5.82,1L184.53,311.65zM136.61,291.37l-3.4,-0.74l-1.77,-10.2l5.91,4.95L136.61,291.37zM177.87,38.94l13.14,-2.4l4.72,7.59l6.83,3.88l-0.32,5.98l14.01,-1.62l9.4,5.15l17.19,-2.3l0,0l2.3,13.75l-12.16,14.05l-0.19,21.46l-4.94,8.74l2.28,14.05l10.83,16.33l12.53,30.76l1.9,20.13l13.67,16.7l7.79,5.13l0.57,4.36l-2.1,2.28l-8.35,0.57l-0.57,4.36l-8.92,4.94l-11.2,0.2v6.08l4.56,7.21l20.69,16.9l10.07,2.47l10.63,7.97l9.87,3.79l0.95,3.42l0,0l-0.57,3.41l0,0l-3.23,6.46l5.51,9.3l3.99,17.09l8.35,4.94l17.85,-0.19l1.52,2.28l0.38,3.42l-7.97,10.82l5.13,8.36l0,0l-0.19,2.71l-6.79,2.08l-10.03,-7.06l4.74,6.11l-2.8,2.8l-11.72,-12.48l-5.5,-1.78l-2.34,1.78l-24.12,-13.84l-15.13,24.04l-40.49,-25.98l6.37,-12.66l3.06,-1.43l11.1,6.32l-0.36,2.6l3.57,2.19l6.62,-2.04v3.41l2.98,2.01l7.05,0.23l3.05,-7.04l-17.97,-11.55l2.55,-7.92l-9.07,-8.72l-4.36,-11.7l-5.42,-4.48l-13.16,-0.34l14.59,6.05l5.29,14.75l-12.16,0.61l-30.89,-8.41l-5.96,1.91l2.37,-21.1l6.73,-8.62l-1.68,-2.45l-3.13,0.92l-6.27,8.79l-3.44,20.41l-14.53,-10.93l-8.56,-0.61l-4.36,2.22l-2.68,9.46h-6.5l-1.22,-4.05l-10.93,-6.27l-4.89,6.19l1.05,6.94l-15.65,1.93l-2.06,-15.29l-2.45,-2.68l-2.52,2.83l1.3,17.81l-3.52,1.68l-9.25,-8.79l-1.39,-7.81l-6.66,0.72l0.25,10.99l7.03,8.79l-11.7,10.22l-4.74,-4.59l-5.35,4.43l-9.61,-11.59l1.85,-4.3l-3.37,-4.81l-4.55,1.52l-2.41,-2.33l13.54,-16.05l-4.81,-0.67l-10.12,9.53l-3.88,-4.89l8.26,-9.9l-2.38,-3.88l-3.52,0.67l-8.78,8.69l-8.81,-7.22l-7.38,6.5l6.48,5.64l22.44,43.15l-0.59,3.96l-39.04,0.76l-12.73,-7.59l-1.94,-17.79l30.18,-84.18l-1.01,-7.84l5.9,-3.96l17.52,-33.3l6.76,-3.42l7.13,-18.27l7.58,-7.7l1.95,-27.8l4.01,-2.93l-0.05,-4.71l3.37,-0.51l-0.51,4.64l7.49,-4.17l-2.05,-4.68l4.64,-1.43l-1.6,-6.41l2.56,-1.66l-0.96,-1.89l3.04,0.34l-0.25,-9.78l13.37,-9.73l6.61,0.54V68.1l4.3,0.51l1.11,-2.75l10.01,-2.76l29.79,-25.39l15.45,-3.36L177.87,38.94z"}]; + tuiChart.registerMap('singapore', data); +})(tui.chart); diff --git a/dist/maps/south-korea.js b/dist/maps/south-korea.js new file mode 100644 index 000000000..3ede5903c --- /dev/null +++ b/dist/maps/south-korea.js @@ -0,0 +1,10 @@ +/** + * https://www.amcharts.com/svg-maps/?map=southKorea + * map data by amcharts team + */ +'use strict'; + +(function(tuiChart) { + var data = [{"code":"KR-SU","name":"Seoul","path":"M133.45,208.68L133.45,208.68L137.25,212.51L138.02,217.91L139.15,218.34L141.56,217.09L144.66,222.92L146.47,222.19L150.07,222.59L154.24,220.28L157.32,219.99L158,222.92L161.65,220.84L164.64,220.58L166.32,219L166.3,217.85L167.56,217.55L168.84,215.83L167.66,214.75L168.06,212.24L171.26,210.1L169.81,206.54L165.01,208.72L163.46,208.29L164.88,202.94L162.8,198.22L162.7,193.7L160.6,192.41L155.64,192.21L153.46,193.73L151.83,196.51L151.75,199.51L150.65,200.3L145.5,200.7L143.87,205.22L140.25,206.83L135.18,203.64L133,207.1L133,207.1z"},{"code":"KR-BS","name":"Busan","path":"M361.82,463.22l0.04,0.76h3.97l1.34,1.34l0,0l1,1.68l-0.17,1.51l-1.5,1.09l-0.84,5.03l-1.86,0.99l1.6,0.19l0.31,1.63l-1.42,3.04l-0.97,-0.51l-0.6,1.41l0.79,1.38l-0.55,1.73l-2.34,0.67l-0.58,2.21l-1.13,0.7l-1.65,-0.61l-1.29,0.93l-1.65,-1.09l0.11,0.8l-1.63,0.22l-0.6,2.08l1.02,0.16l0.52,1.5l-0.13,2.62l-1.18,-0.64l-1.92,0.32l-0.32,-0.38l-1.94,-0.26l0.21,-1.98l-0.71,-0.45l-1.79,1.31l-1.71,2.68l-0.21,1.79l-0.81,0.1l0.68,1.44l-0.71,1.15l-1.1,-3.58l-1.08,0.19l0.92,3.86l-0.94,0.42l-0.16,-1.47l-0.97,-0.35l0.21,1.66l-1.16,-0.13l0.69,0.93l-1.18,0.83l0.1,-1.76l-0.73,-0.38l-0.81,-3.32l0.55,-3.03l-2.08,2.43l-0.08,-2.87l-1.97,3.61h-1.65l1.02,-4.54l-1.05,-0.38l-0.97,4.92l-4.44,-0.51l-1.5,-1.63l-2.94,2.17l-0.76,-0.89l1.84,-1.53l-1.26,0.19l0.32,-2.32l0,0l6.93,-2.61l0.43,-5.01l2.29,-0.29l3.87,-2.43l4.15,-0.14l4.06,-4.94l3.95,-2.48l1.84,0.32l3.61,-6.64l4.87,-0.57l0.57,-1.86l2.95,-2.71l0,0L361.82,463.22zM347.32,494.1l1.86,1.6l-0.29,1.63l1.94,1.63l-0.5,1.09h-0.89l-0.47,-1.18l-0.63,0.26l-0.58,-1.28l-3.12,-2.3L347.32,494.1z"},{"code":"KR-DG","name":"Daegu","path":"M297.68,431.85L296.36,436.12L295.02,437.04L295.02,437.04L292.6,436.15L291.07,436.52L291.07,436.52L287.58,439.02L285.17,439.08L285.17,439.08L284.44,435.65L280.38,430.66L280.69,427.85L284.12,429.72L286.31,429.72L286.93,427.23L283.81,423.79L285.06,420.67L286.31,417.86L291.61,416.93L291.3,415.06L288.49,412.87L283.81,412.56L285.37,406.63L287.56,403.51L291.61,401.64L292.24,407.25L294.73,407.25L298.17,399.14L304.09,397.89L306.9,394.77L310.33,393.84L313.45,394.15L317.2,397.27L317.82,404.76L319.7,408.81L318.76,411L315.33,412.25L313.77,415.68L313.77,418.8L311.27,419.11L311.27,420.98L312.52,422.54L312.52,426.6L309.09,427.85L307.52,429.72L304.72,429.41L304.09,426.6L300.97,426.6L298.79,427.85L297.23,430.35z"},{"code":"KR-IC","name":"Incheon","path":"M113.39,205.14l4.15,-2.72l2.11,-2.84l2.08,0.19l7.46,6.03l0,0l3.83,1.29l0.45,1.58l0,0l0,0l0,0l-3.54,4.55l0,0l0.13,4.02l3.31,2.9l0,0l-0.45,3.79l-1.79,2.33l0,0l-2,-0.59l0.47,-1.81l-0.68,-0.53l-0.39,1.68l-0.6,-2.34l0.45,3l-1.97,2.27l-3.57,-0.49l-3.68,4.64l-4.59,0.13l-0.34,1.09l-1,-0.03l0.84,-0.26l0.53,-1.84l4.57,0.82l3.6,-4.51l-4.04,-3.16l-0.94,-4.28l-0.5,2.31l-1.47,-0.1l0.18,-2.6l-0.81,1.29l-1.21,-0.49l1.21,-4.64l2.99,-1.19l1.23,0.4l-0.92,-1.68l-2.42,1.12l0.05,-1.32l-1.02,-1.09l0.97,0.1l-0.16,-1.25l-1.23,-1.25l0.68,-0.3l0.05,-1.42l-2.78,1.65l-1,-0.16l-0.1,-0.07l3.91,-1.62L113.39,205.14zM87.39,206.76l1.84,1.25l0.87,-0.26l1.42,2.01l2.97,-0.43l-0.26,1.45l-2.05,-0.43l-1.86,0.63l-0.39,-0.56l-1.02,0.96l0.37,-2.11L87.39,206.76zM107.03,209.92l0.74,1.19l3.57,0.99l1.39,1.32l0.42,1.85l-2.26,1.42l-2,-0.66l-8.88,7.38l-2.86,0.56l0.34,-1.97l-0.94,-0.66l-1.23,0.82l0.89,-0.92l-0.47,-0.72l-1.6,1.25l-1.63,-0.82l0.87,-0.62l-1.55,-1.78l0.24,-1.38l1.65,-0.03l3.94,-2.8l5.57,-0.26l1.34,-0.96l0.68,-2.7L107.03,209.92zM97.18,224.58l2.78,2.9l-0.84,2.14l-1.57,0.43l-0.95,-0.92l0.11,-1.94l-1.18,-0.3l0.89,-2.44L97.18,224.58z"},{"code":"KR-GJ","name":"Gwangju","path":"M149.04,478.34L147.22,477.47L144.78,477.38L140.34,479.38L138.33,481.47L136.85,481.56L133.28,479.47L132.67,477.29L130.49,477.21L128.4,482.52L126.05,482.43L124.31,484.52L123.18,489.31L123.61,493.4L130.84,494.45L134.59,500.55L138.33,500.55L141.73,498.54L145.56,498.54L147.04,497.5L150.18,498.11L153.57,495.76L154.97,493.93L156.71,487.83L156.71,486.44L154.62,485.48L152.01,485.22L150.99,480.68z"},{"code":"KR-DJ","name":"Daejeon","path":"M191.13,336.42L192.38,341.72L192.69,341.89L192.69,341.89L194.15,339.52L194.15,339.52L194.76,338.88L194.76,338.88L196.15,339.06L195.83,340.36L195.83,340.36L195.76,341L195.76,341L198.62,338.6L198.62,338.6L201.12,341.1L201.12,341.1L201.36,343.72L203.79,344.88L203.47,346.51L205.49,348.9L202.68,350.77L202.68,350.77L201.74,356.39L201.74,356.39L200.49,362.63L201.66,366.38L201.66,366.38L198.31,368.56L196.13,371.37L192.38,369.18L190.2,365.44L189.57,362.01L188.01,362.01L187.7,370.12L186.77,372.31L185.52,372.31L184.58,369.18L182.08,368.25L180.52,366.06L180.21,362.63L178.03,360.76L177.72,356.7L179.9,354.21L179.59,345.47L186.45,343.29L187.41,337.15L187.41,337.15Z"},{"code":"KR-US","name":"Ulsan","path":"M361.02,427.42L362.82,428.89L365.81,429.79L366.04,430.61L366.04,430.61L365.62,433.46L365.62,433.46L366.64,434.56L366.64,434.56L368.61,435.22L368.61,435.22L373.98,432.82L373.98,432.82L382.11,434.97L382.11,434.97L385.01,435.38L385.71,436.83L385.68,438.21L384.55,438.99L385.08,442.13L384.42,444.54L383.29,445.06L384.05,445.15L383.87,446.73L382.66,447.24L383.66,447.98L382.4,448.59L383.89,449.3L382.87,450.48L381.87,450.07L380.06,451.35L380.22,448.88L379.06,447.98L378.43,445.03L376.49,442.9L374.99,442.42L377.3,444.77L377.22,445.89L378.19,446.15L378.54,447.6L376.17,447.72L376.7,448.43L377.67,448.17L378.56,449.75L375.96,452.99L373.73,451.29L374.49,454.3L375.65,454.24L375.15,455.23L376.51,454.5L376.51,456.1L374.94,457.32L376.07,459.05L374.26,461.97L376.04,464.47L374.55,465.34L373.36,464.85L371.34,467.93L370.27,468L370,469.18L368.01,468.51L368.18,467L367.18,465.32L367.18,465.32L365.84,463.98L361.86,463.98L361.82,463.22L361.82,463.22L360.28,461.34L360.28,461.34L357.19,461.13L357.19,461.13L351.53,455.26L351.53,455.26L348.27,451.9L345.87,451.7L345.87,451.7L343.12,451.7L340.89,450.65L340.55,445.82L342.78,443.93L342.78,443.93L343.98,442.88L343.98,441.42L342.51,438.99L342.51,438.99L346.43,435.9L346.43,435.9L346.43,435.9L346.43,435.9L348.09,435.73L348.09,435.73L348.09,435.73L348.09,435.73L349.42,434.99L348.07,432.51L348.44,430.95L355.71,427.36z"},{"code":"KR-GG","name":"Gyeonggi","labelCoordinate":{"x":0.65,"y":0.7},"path":"M79.19,183.7l-1.81,-2.08l1.52,-1.65l0.21,-2.28l1.58,-1.49h2.65l3.05,1.75l2.39,-0.66l1.08,1.19l-1.71,2.78l-1.97,1.19l-2.62,-0.33l-2.23,0.6l-1.05,1.42L79.19,183.7zM88.88,242.67l-3.44,-1.77l-1.08,1.25l3.99,2.1l2.07,-0.52l0.74,-1.22l-1.37,-0.53L88.88,242.67zM82.21,195.73l-3.12,-0.1l3.73,3.86l0.34,-0.56l-1.13,-0.82L82.21,195.73zM70.32,243.33l-0.92,0.63l-0.76,-2.86l-1.1,-0.16l-1.52,6.01l1.26,-0.2l0.18,-0.79l0.39,1.28l1.16,-0.36l-0.16,1.45l3.39,-0.52l1.6,-1.87l-3.28,-2.04L70.32,243.33zM75.07,193.06l-1.05,-0.36l-1.24,0.89l1.18,0.73l1.16,-0.5l0.87,1.49l1.86,0.33l0.29,-1.45L76.7,191.67L75.07,193.06zM154.22,126.06l-4.9,5.81h-2.81l-4.68,-1.87l-2.5,1.56l-5.62,4.68l-3.43,4.99l1.87,0.94l1.87,3.75l6.31,0.29l3.37,1.9l0.62,3.12l-1.25,0.94l-0.31,1.87l-4.99,-0.62l-0.31,3.75l-1.56,0.94l0.31,2.5l1.87,0.94l-0.31,6.55l-2.18,1.25l-3.12,-3.74l1.25,-4.37l-1.96,-2.47l-2.4,0.07l-0.32,2.71l-1.87,1.87l-3.47,-3.34l-0.74,0.11l0.9,4.9l-0.49,1.87l4.74,1.77l3.43,4.99l-6.55,1.87h-2.83l-0.96,4.55l-3,0.18l-3.07,2.46l-3.56,-0.53l-2.02,-1.61l-0.6,1.17l-1.76,0.79l1.1,1.75l-0.87,4.23l1.08,1.79l-0.5,3.11l1.16,0.53l-0.76,1.72l2.65,6.34l2.37,3.1l0,0l4.15,-2.72l2.11,-2.84l2.08,0.19l7.46,6.03l0,0l3.82,1.29l0,0l2.18,-3.46l5.07,3.2l3.63,-1.61l1.63,-4.52l5.15,-0.4l1.1,-0.79l0.08,-3l1.63,-2.77l2.18,-1.52l4.96,0.2l2.1,1.29l0.11,4.53l2.07,4.72l-1.42,5.35l1.55,0.43l4.81,-2.18l1.44,3.56l-3.2,2.14l-0.39,2.5l1.18,1.09l-1.29,1.71l-1.26,0.3l0.03,1.15l-1.68,1.58l-2.99,0.26l-3.65,2.08l-0.68,-2.93l-3.07,0.3l-4.18,2.31l-3.6,-0.39l-1.81,0.72l-3.1,-5.83l-2.41,1.25l-1.13,-0.43l-0.76,-5.4l-3.81,-3.82l0,0l-3.54,4.55l0,0l0.13,4.02l3.31,2.9l0,0l-0.45,3.79l-1.79,2.33l0,0l1.23,0.59l-3.96,-0.76l-0.89,1.05l0.81,0.63l-0.39,1.51l-4.7,2.63l0.29,1.51L116.01,236l-2.94,2.24l-0.92,-0.26l0.47,0.99l-1.29,1.38l-2.89,-1.38l2.89,4.04l-0.34,2.07l-1.81,1.12l1.45,1.48h-1.21l0.29,0.85l-1.08,1.08l1.65,-0.69l1.02,1.58l1.84,-3.38l3.02,1.54l0.79,-3.32l0.26,1.64l2,1.25l-0.52,1.71l0.58,0.62l0.79,-2.33l-0.34,-1.64l-2.63,-1.35l-0.63,-2.69l-2.21,-0.39l-2.13,-2l1.02,-1.81l3.2,-2.23l6.49,-2.24l9.38,4.54l3.1,-0.39l2.76,3.29l1.26,-0.43l-1,1.77l-1.58,-2l-1.92,-0.49l0.16,-0.92l-0.89,0.33l-0.34,0.79l0.95,1.28l-1.92,-0.1l0.74,1.74l-0.92,0.85l0.66,0.2l-2.23,3.35l-1.31,-0.89l0.58,-0.69l-0.6,-3.02l-2.65,0.85l-0.34,-1.08l-3.57,-0.75l-0.73,1.84l-1.71,0.36l0.39,1.74l0.92,0.59l-0.94,1.74l0.97,1.54l-1.42,0.03l-1.16,1.48l1.18,2.59l-1.08,0.95l1.5,-0.62l2.44,0.49l-2.23,2.13l1.29,0.82l-0.18,1.77l0.84,0.79l0.4,-1.61l3.36,-1.9l2.07,-3.41l2.55,0.23l1.39,-2.13l0.95,2.4l-2.15,1.31l4.67,0.07l-2.08,0.59l0.92,1.02l-0.81,-0.36l-1.36,1.31l-1.05,-0.72l-2.02,1.94l0.05,7.08l-1.57,2.75l0.37,0.79l4.31,0.33l0.29,2.1l-1.34,0.43l0.05,0.82l3.91,0.82l1.63,4.16l1.92,0.79l0.45,1.87l1.94,-0.33l1.42,0.92l0.87,4.56l0,0l3.46,-2.08l7.55,1.76l4.94,-1.77l3.01,-2.07l2.58,-0.08l2.99,1.43l3.29,3.38l5.1,0.7l0,0l2.77,-0.23l0,0l3.78,-1.7l0,0l1.71,-1.24l2.21,0.14l1.8,-1.75l0.17,-2.11l0,0l-0.3,-1.08l5.09,-3.01l0,0l0.8,-2.63l2.34,-2.57l0.8,1.19l1.48,-0.02l-0.27,2.07l1.6,-3.22l4.3,0.78l4.06,-3.74l2.5,-0.31l0.63,-7.8h1.56l1.56,1.87h1.87l2.66,-6.65l2.65,-0.58l0,0l0.62,-7.44l-0.62,-3.43l1.56,-1.25l-0.31,-7.49l3.43,-8.11l0.31,-4.06l-1.95,-0.71l-0.79,-2.38l3.14,-4.03l2.06,-0.7l0.79,-2.18l-1.65,-2.9l-8.97,-1.37l-4.31,-3.69l-2.69,-0.32l-4.11,-2.48l-3.64,1.4l-2.64,-2.84l1.75,-3.51l0.31,-4.39l-3.59,0.9l0.12,-2.02l2.7,-3.08l-1.32,-3.5l0.83,-1.96l-0.85,-2.95l0.59,-1.52l2.26,-0.75l1.8,-2.06l3.31,-1.07l1,-3.97l-0.82,-4.03l-1.44,-1.59l-4.2,-1.42l-0.08,-2.7l-0.88,-0.6l-3.22,0.34l-3.09,-1.53l-1.56,-3.02l-0.4,-7.52l-1.42,-1.97l-1.96,1.05l-2.09,-1.55l-1.49,0.2l-4.11,1.93l-4.47,-3.58l0.48,-5.32l1.09,-0.92l-1.97,-0.88l-3.66,3.74l-2.44,0.16l-1.64,-0.83l-0.39,-3.19l-0.99,0.31l-0.18,-1.08l0.63,-1.87l-1.56,-1.25l-0.94,-5.3h-4.68v-1.87l1.25,-0.94l-4.74,-4.42l0,0l-1.33,0.58L154.22,126.06zM92.9,190.84l-2.49,-0.36l-2.1,-1.65l-0.03,-2.31l1.02,-2.08l-0.92,-0.56l-3.23,1.32l-0.08,3.41l-1.52,0.56l4.6,3.17l1.02,1.45l-0.26,2.08l1.08,1.06l3.57,-2.74l0.39,-2.05L92.9,190.84zM108.47,194.51l-1.47,-1.35l0.79,-3.17l-1.16,-1.72l1.24,-3.74l-1.37,-1.69l-0.34,-2.28l-4.52,-2.94l-2.15,-2.78l-3.94,0.73l-0.84,2.02l-3.49,1.89l0.53,10.09l2.99,0.79l1.97,4.59l-0.87,2.38l-3.18,0.59l1.16,2.08l-0.58,0.79l3.28,1.95l5.36,0.36l0.03,-1.02l0.89,0.43l0.58,-0.92l3.15,0.92l0.81,-1.65l1.37,-0.4l-1.18,-4.72L108.47,194.51zM102.93,238.99l-1.94,0.43l-0.18,1.28l-1.55,-0.13l-0.71,1.51l0.81,1.97l-0.34,1.87l1.89,-0.03l0.05,0.92l0.63,-0.06l1.34,-1.12l-0.26,-0.85l1.52,-0.1l-1.15,-1.31l1.26,-0.03l-0.21,-0.76l1,0.72l0.68,-1.97l-1.31,-1.71L102.93,238.99z"},{"code":"KR-GW","name":"Gangwon","path":"M281.2,81.07L282.62,83.88L284.77,86.63L285.35,86.46L286.13,88.2L285.58,89.47L287.34,91.81L286.76,93.11L287.92,94.12L287.76,95.58L291.46,100.46L290.33,100.96L290.28,102.67L295.8,110.27L295.17,110.71L295.43,112.37L297.03,114.61L297,116.07L299.32,118.07L300.15,123.7L304.15,128.9L303.33,130.03L305.36,132.76L304.44,133.75L305.36,137.81L310.95,144.39L311.66,147.42L315.7,151.73L316.8,151.83L316.3,153.72L320.06,159.89L321.74,161.09L321.66,162.15L325.76,165.89L325.68,168.38L330.06,173.41L330.3,174.87L347.26,193.36L346.06,198.01L348.44,201.25L352.94,204.94L353.3,206.76L352.36,208.7L354.3,213.88L359.47,219.18L360.58,224.22L365.41,227.97L367.11,234.85L368.95,236.46L369.98,236.36L370.45,238.89L372.1,238.96L372.92,240.04L372.65,241.85L375.46,245.27L373.99,246.38L374.7,248.16L373.86,250.55L374.41,253.14L377.15,257.08L376.83,258.26L377.64,259.1L377.64,259.1L373.37,259.81L373.37,259.81L371.5,262L369,262.93L366.19,265.43L366.19,265.43L364.63,267.61L364.63,268.86L364.63,268.86L366.19,271.67L359.65,271.83L359.65,271.83L357,269.56L354.05,268.53L351.43,268.13L348.89,270.65L341.46,268.03L338.11,268.75L337.43,267.42L335.71,266.74L335.71,266.74L332.8,271.05L332.8,271.05L331.87,272.29L327.81,272.29L321.57,267.93L319.55,268.11L319.01,272.83L317.89,273.95L314.83,272.57L312.91,272.83L308.65,270.49L308.65,270.49L306.28,268.35L302.79,268.56L298.83,267.29L298.83,267.29L295.24,264.37L293.23,264.28L293.23,264.28L289,265.29L289,265.29L287.11,265.75L286.29,264.36L286.29,264.36L284.5,262.71L284.6,260.09L284.6,260.09L283.64,259.28L282.18,259.61L282.18,259.61L278.9,259.47L277.71,260.72L277.71,260.72L275.74,261.38L275.74,261.38L275.04,261.85L272.73,260.08L272.07,258.39L275.33,256.36L277.69,253.63L277.79,252.27L277.79,252.27L276.24,251.74L274.87,252.57L274.87,252.57L273.82,252.84L273.82,252.84L272.11,252.6L270.63,250.87L268.51,250.44L266.53,248.93L264.07,249.52L262.28,251.96L258.63,251.05L254.95,254.13L254.95,254.13L249.88,254.99L249.88,254.99L249.6,251.15L249.6,251.15L247.83,247.84L243.56,247.4L242.06,248.34L242.06,248.34L239.22,251.03L240.21,255.72L239.79,257.52L236.64,259.62L234.31,258.47L231.28,258.56L229.83,260.44L227.64,261.37L223.59,258.25L222.97,254.77L222.97,254.77L223.59,247.33L222.96,243.9L224.52,242.65L224.21,235.16L227.64,227.05L227.96,222.99L226,222.28L225.22,219.9L228.35,215.87L230.42,215.17L231.21,212.98L229.56,210.08L220.59,208.72L216.28,205.02L213.59,204.7L209.48,202.22L205.84,203.62L203.2,200.77L204.95,197.26L205.26,192.87L201.67,193.78L201.79,191.75L204.49,188.67L203.17,185.17L203.99,183.21L203.15,180.26L203.73,178.74L206,177.98L207.8,175.92L211.11,174.85L212.11,170.88L211.29,166.85L209.84,165.26L205.64,163.84L205.56,161.13L204.68,160.53L201.46,160.87L198.36,159.34L196.81,156.32L196.4,148.81L194.98,146.83L193.02,147.88L190.93,146.33L189.44,146.52L185.33,148.46L180.87,144.87L181.35,139.55L182.44,138.63L180.47,137.75L176.81,141.49L174.37,141.66L172.73,140.82L172.34,137.63L171.34,137.94L171.16,136.87L171.79,135L170.23,133.75L169.29,128.44L164.61,128.44L164.61,126.57L165.86,125.63L161.12,121.22L161.12,121.22L165.16,117.96L168.53,118.35L175.22,115.29L178.63,115.81L180.24,117L183.43,116.89L184.57,115.94L190.58,114.82L199.81,118.82L208.05,114.58L210.66,116.02L214.44,115.61L217.11,116.28L219.06,114.97L224.85,115.26L227.39,113.86L231.06,118.46L234.98,117.35L237.1,115.11L243.39,116.95L245.17,116.52L251.62,117.96L254.58,117.5L257.56,115.06L260.9,114.78L267.7,109.37L268.99,107.26L274.52,102.42L276.68,97.81L277.5,93.22L276.97,84.14z"},{"code":"KR-NC","name":"North Chungcheong","labelCoordinate":{"x":0.5,"y":0.25},"path":"M213.91,387.92L211.73,381.67L209.54,379.79L209.23,376.99L209.23,376.99L210.48,374.18L210.17,371.06L208.3,367.94L208.3,367.94L205.5,368.2L201.66,366.38L200.49,362.63L201.74,356.39L201.74,356.39L202.68,350.77L202.68,350.77L205.49,348.9L203.47,346.51L203.79,344.88L201.36,343.72L201.12,341.1L201.12,341.1L198.62,338.6L198.62,338.6L195.76,341L195.76,341L195.83,340.36L195.83,340.36L196.15,339.06L194.76,338.88L194.76,338.88L194.15,339.52L194.15,339.52L192.69,341.89L192.69,341.89L192.38,341.72L192.38,341.72L192.38,341.72L192.38,341.72L191.13,336.42L191.13,336.42L187.41,337.15L186.79,336.29L185.68,336.48L185.68,336.48L185.11,337.26L185.11,337.26L186.97,331.16L185.89,330.02L186.81,326.74L183.47,326.54L183.02,325.19L183.02,325.19L183.02,322.38L180.21,318.95L182.4,318.32L182.71,315.51L182.71,315.51L181.15,313.33L186.14,305.53L189.89,305.84L191.45,303.97L190.2,300.22L187.08,298.04L184.2,298.04L184.2,298.04L183.12,297.56L183.28,295.57L183.28,295.57L182.69,295.08L182.69,295.08L181.21,294.37L181.21,294.37L180.98,291.71L178.14,289.79L177.23,287.37L179.99,287.14L179.99,287.14L183.77,285.44L183.77,285.44L185.48,284.2L187.69,284.34L189.48,282.59L189.65,280.48L189.65,280.48L189.35,279.4L194.43,276.39L194.43,276.39L195.23,273.76L197.57,271.19L198.38,272.38L199.86,272.36L199.59,274.43L201.18,271.2L205.49,271.98L209.54,268.24L212.04,267.93L212.66,260.13L214.23,260.13L215.79,262L217.66,262L220.32,255.35L222.97,254.77L223.59,258.25L227.64,261.37L229.83,260.44L231.27,258.56L234.31,258.47L236.64,259.62L239.79,257.52L240.21,255.72L239.22,251.03L242.06,248.34L242.06,248.34L243.56,247.4L247.83,247.84L249.6,251.15L249.6,251.15L249.88,254.99L249.88,254.99L254.95,254.13L254.95,254.13L258.63,251.05L262.28,251.97L264.07,249.52L266.53,248.93L268.51,250.44L270.63,250.87L272.11,252.6L273.82,252.84L273.82,252.84L274.87,252.57L274.87,252.57L276.24,251.74L277.79,252.27L277.79,252.27L277.69,253.63L275.33,256.36L272.07,258.39L272.73,260.08L275.04,261.85L275.74,261.38L275.74,261.38L277.71,260.72L277.71,260.72L278.9,259.47L282.18,259.61L282.18,259.61L283.64,259.28L284.6,260.09L284.6,260.09L284.5,262.71L286.29,264.36L286.29,264.36L287.11,265.76L289,265.29L289,265.29L293.23,264.28L293.23,264.28L295.24,264.37L298.83,267.29L298.83,267.29L302.79,268.56L306.28,268.35L308.65,270.49L308.65,270.49L306.45,272.65L304.31,272.4L304.31,272.4L302.03,275.02L302.03,275.02L301.41,275.3L301.41,275.3L298.12,278.55L295.32,279.35L295.32,279.35L294.53,280.6L294.53,280.6L290.99,283.35L287.83,289.01L287.83,289.01L287,290.58L287,290.58L286.94,291.91L288.26,292.52L288.26,292.52L289.05,295.44L286.21,299.33L282.21,300.11L282.21,300.11L281.29,301.15L278.85,301.09L278.85,301.09L276.65,301.27L276.65,301.27L274.16,296.35L270.92,294.5L269.74,292.53L269.74,292.53L268.07,295.58L266.94,295.92L266.5,299.15L266.5,299.15L266.13,299.72L260.43,297.98L260.43,297.98L260.01,297.35L260.01,297.35L258.94,296.98L258.33,297.6L258.33,297.6L255.8,300.69L254.42,300.88L254.42,300.88L252.78,299.14L252.27,299.44L252.27,299.44L249.41,306.13L249.41,306.13L252.8,311.38L248.2,310.46L248.2,310.46L247.02,309.8L245.81,310.39L242.5,308.76L242.5,308.76L239.62,312.49L239.62,312.49L235.37,313.91L233.69,316.29L234.17,318.51L230.94,321.85L230.94,321.85L229.18,323.4L229.18,323.4L227.62,323.75L227.62,323.75L226.63,325.66L227.35,326.76L232.72,327.89L233.94,329.11L233.8,330.04L233.8,330.04L234.76,332.01L234.76,332.01L236.77,333.37L236.35,335.08L236.35,335.08L234.33,335.97L233.52,343.6L233.52,343.6L234.12,346.07L232.83,348.09L234.15,351.34L234.15,351.34L234.65,351.65L234.65,351.65L233.65,354.21L230.98,356.52L230.98,356.52L230.91,360.8L233.07,362.58L233.07,362.58L236.48,360.02L236.95,361.47L239.45,362.95L239.45,362.95L241.3,364.52L241.3,364.52L242.47,364.92L242.47,364.92L244.46,364.08L244.46,364.08L246.69,363.29L248.71,363.99L248.71,363.99L249.33,365.06L249.33,365.06L249.48,368.23L249.48,368.23L250.74,370.1L250.74,370.1L250.15,371.38L247.03,369.97L244.62,371.4L243.44,373.14L244.61,376.1L244.2,379.67L242.45,381.13L241.41,385.77L239.57,388.37L236.69,388.27L235.61,389.35L232.87,391.91L229.97,389.63L229.97,389.63L224.98,392.03L224.62,392.94L222.02,392.94L221.87,392.02L220.16,390.98L216.06,389.56L216.06,389.56L215.01,387.29z"},{"code":"KR-SC","name":"South Chungcheong","path":"M92.24,350.46l0.95,0.71l-0.79,0.1l-0.1,0.91l-1.31,-0.62l-0.47,0.68l-0.24,-1.39l1.08,-0.75l0.03,-1.33h0.66L92.24,350.46zM95.71,342.01h1.21l0.16,1.17l1.47,0.49l-0.58,-1.36l1.29,-1.01l-0.26,-2.14l-2.36,-1.76l1,-1.43l-0.87,-1.43l0.16,-1.82l-1.1,0.33l0.34,-2.02l-2.23,-1.24l0.81,-0.88l-1.02,-1.37l-0.1,-3.25l-1.47,-0.68l1.52,-0.98l0.05,-1.14l-0.97,-2.61l-1.34,-0.62l-3.73,3.78l1.65,3.39l-0.31,5.21l0.89,2.05l-1.08,2.89l1.37,-0.39l-0.63,3.35l2.44,0.39l-0.55,1.89l1.73,1.53l0.97,-1.1l1.92,0.03L95.71,342.01zM100.7,267.96l-0.5,-2.1l-2.36,-0.39l0.05,2.79L100.7,267.96zM99.68,346.49l-0.63,-1.14l-1.02,-0.1l-0.94,0.46l0.53,1.43l-2.52,-1.4l-0.71,1.62l1.86,-0.16l5.28,1.75l0.16,-0.94l-2.73,-0.75L99.68,346.49zM211.73,381.67l-2.18,-1.87l-0.31,-2.81l1.25,-2.81l-0.31,-3.12l-1.87,-3.12l-2.8,0.27l-3.83,-1.82l-3.35,2.18l-2.18,2.81l-3.74,-2.18l-2.18,-3.74l-0.62,-3.43h-1.56l-0.31,8.11l-0.94,2.19h-1.25l-0.94,-3.12l-2.5,-0.94l-1.56,-2.18l-0.31,-3.43l-2.18,-1.87l-0.31,-4.06l-1.71,-2.06l-1.75,-1.35l-1.21,-3.1l0.14,-4.04l-0.27,-2.83l-1.35,-3.91l-2.7,-1.48l-1.89,-2.56l-0.13,-2.02l1.08,-2.43v-3.1l-0.13,-3.5l-0.27,-3.37l0.67,-2.43l-0.27,-3.1l-0.54,-2.02l-1.08,-2.02l0.4,-1.75l2.7,-1.08l2.56,0.81l1.48,1.62l2.7,1.62l2.56,0.94l2.44,-0.2l4.99,-7.8l3.75,0.31l1.56,-1.87l-1.25,-3.74l-3.12,-2.18h-2.88l-1.08,-0.48l0.16,-1.99l-0.59,-0.49l-1.48,-0.71l-0.23,-2.66l-2.84,-1.92l-0.91,-2.42l-5.09,-0.7l-3.29,-3.38l-2.99,-1.43l-2.58,0.08l-3.01,2.07l-4.94,1.77l-7.55,-1.76l-3.46,2.08l-4.49,1.06l-3.57,-0.65l-1.5,-5l-1.13,-0.39l-1.68,-3.89l0.08,-1.37l-7.51,-2.03l-0.37,-0.79l-6.35,-0.23l-6.8,-4.06l-2.2,-0.36l-1.55,-2.26l-2.02,-0.72l-0.89,0.66l-0.71,1.38l0.53,0.56l-2.6,2.42l1,1.9l-1.26,0.66l-2.68,-1.34l-3.96,-0.39l-2.1,1.05l-0.81,-0.52l-1.97,1.67l-0.71,-0.36l0.32,1.83l3.15,0.72l0.81,-0.49l0.45,1.24l1,0.16l-1.65,1.34l-0.71,-1.11h-2.47l-0.21,1.08l1.45,-0.16l0.18,1.15l0.92,0.16l-0.18,1.34l0.95,-0.92l1.18,0.26l0.87,1.83l1.68,-1.34l0.92,0.43l0.03,1.5l-1.31,0.62l0.34,1.15l2.15,0.82l-3.31,0.98l0.16,1.54l-1.94,-0.26l-1.23,0.72l0.6,2.22l-1.44,1.24l0.89,1.86l-2.07,-1.83l0.42,-1.7l-1.6,-0.29l-1.13,2.68l0.97,0.75l-0.29,1.18l0.87,1.14l-1.13,-0.56l-0.87,0.88l-0.76,-0.42l-0.03,1.04l-0.94,-0.06l-0.39,1.11l-0.97,-2.35l0.24,-0.75l3.05,-0.91l0.16,-0.69l-2.1,-0.46l0.08,-1.18l1.65,-3.66l1.76,-0.95h-0.97l-0.18,-1.6l-1.65,-1.47v-3.24l0.95,-1.31l-1,0.1l-0.81,-1.05l1.02,-0.26l0.18,-1.57l-2.34,1.8l1.05,5.14l-0.84,1.31l0.37,1.08l-3.7,-1.08l0.45,-0.69l-1.47,0.1l-2.36,1.9l-0.92,-0.78l-0.5,2.26l-1.86,-0.13l1.34,1.21l-0.89,0.69l0.68,1.7l1,-0.06l-2.08,2.74l1.42,1.57l-1.1,0.1l1.63,4.34l-1.92,-3.69l-0.68,0.52l0.05,-3.72l-1.02,-0.06L73.26,290.7l-0.47,0.75l-0.63,-0.29l0.58,1.05l-0.92,0.03l1.29,1.21l-0.18,1.18l-1.31,1.01l0.74,0.65l-0.42,1.57l-1.05,0.85l-0.42,-0.52l0.03,1.27l-1.81,0.36l1.21,2.81h0.87l-1.36,4.93l3.1,-2.67l-1.15,-3.69l1.55,0.85l3.55,-0.26l-1.02,1.34l1.92,1.08l1.23,-0.59l-1.26,2.35l1.05,-0.65l0.89,0.65l-1.55,1.93l-3.57,-1.53l-1.84,1.47l0.55,3.29l3.91,0.39l1.08,-2.31l2.31,-0.23l0.63,-0.81l-0.31,-1.83l2.1,0.1l1.86,-1.53l0.39,0.75l-0.81,0.29l-0.08,2.22l-1.13,1.37l0.32,2.15l2.18,0.29l1.08,2.31l0.13,3.16l-1.05,0.75l-0.55,2.93l1.02,1.73l6.67,-5.76l4.31,1.24l5.01,3.55l0.74,3.03l-0.66,1.69l2.36,2.9l1.5,-1.27l4.15,2.99l-4.2,-2.24l-2.02,2.12l-0.24,3.41l0.55,2.8l1.23,1.3l-0.26,1.2l2.63,-1.33l0.32,-1.4l0.79,-0.06l2.52,-3.28l2.44,1.01l2.23,-0.78l-1,1.24l-2.7,-0.45l-0.68,2.76l-1.5,-0.1l-1.52,1.49h-1.26l-2.39,1.66l-0.92,1.92l-0.42,3.22l1.79,0.03l4.73,3.28l3.26,0.68l-2.6,-0.23l-4.07,2.82l-1.29,0.1l4.57,6.91l-1.73,3.14l0.89,4.5l-1.5,1.62l0.18,2.23l-0.76,0.97l-2.36,-0.23l-0.03,2.75l1.08,0.97l0.29,-2.4l1.18,-0.32l2.63,0.94l0.92,1.85l1.39,-1.39l2.55,2.2l1.34,2.94l0.81,-0.71l1.05,0.49l-0.03,0.84l1.18,-0.32l-2.44,1.94l1.05,-0.19l0.29,2.81l1.05,-0.1l2.26,2.59l-0.76,0.49l0.05,2.13l0.74,0.74l1.13,-0.61l4.28,1.07l1.39,-2.17l0.68,0.33l1.31,-0.56l1.48,1.36l11.55,-4.99l0,-8.44l4.69,-2.68l3.69,0.67l3.77,2.27l1.27,-0.38l2.19,2.01l0.31,3.75l2.44,0.19l0.53,2.02l2.55,0.18l5.68,-2.1l2.85,1.89l5.31,-0.31l-0.62,-2.5l4.37,0.31l2.42,-2.02l1.13,1.63l2.97,5.1l2.22,7.14l4.92,-1.56l0.7,4.99l6.55,-0.31l0.94,-1.87l0.16,-2.21l1.03,-0.18l1.89,-1l4.1,2.45l2.81,-2.81v-2.49L211.73,381.67z"},{"code":"KR-NJ","name":"North Jeolla","path":"M128.74,388.35L130.05,387.8L131.53,389.16L143.08,384.16L143.08,375.72L147.77,373.04L151.46,373.71L155.22,375.98L156.49,375.6L158.68,377.61L158.99,381.35L161.43,381.55L161.96,383.57L164.51,383.75L170.19,381.65L173.04,383.54L178.34,383.23L177.72,380.73L182.08,381.04L182.08,381.04L184.5,379.03L185.64,380.65L185.64,380.65L188.6,385.76L190.82,392.9L195.74,391.34L196.44,396.33L202.99,396.02L203.93,394.15L203.93,394.15L204.08,391.94L205.11,391.76L205.11,391.76L207,390.76L211.1,393.21L213.91,390.4L213.91,387.92L213.91,387.92L215.01,387.29L216.06,389.56L216.06,389.56L220.16,390.98L221.87,392.02L222.02,392.94L224.62,392.94L224.98,392.03L229.97,389.63L229.97,389.63L232.87,391.91L235.61,389.35L235.61,389.35L240.32,398.32L239.04,403.33L239.04,403.33L236.71,404.85L234.67,409.47L231.56,411.35L230.1,411.36L230.1,411.36L228.27,412.51L226.26,412.07L226.26,412.07L225.61,412.54L225.61,412.54L223.95,416.62L219.01,421.36L218.23,426.18L218.23,426.18L218.07,428.1L217.18,428.89L217.18,428.89L211.96,443.3L212.13,445.62L214.9,446.99L214.9,446.99L215.32,449.9L215.32,449.9L216.59,452.17L215.91,455.51L216.6,457.44L218.23,457.87L217.77,461.88L217.77,461.88L214.07,465.44L212.92,468.59L213.47,471.46L211.25,473.76L211.25,473.76L211.02,473.97L211.02,473.97L204.64,469.51L204.64,469.51L200.1,467.43L200.1,467.43L198.1,467.54L198.1,467.54L196.35,468.52L193.4,472.31L191.65,472.78L191.65,472.78L188.45,472.41L186.07,473.11L186.07,473.11L179.92,473.13L178.79,472.48L178.79,472.48L177.35,471.1L175.42,472.22L175.42,472.22L172.26,470.87L170.96,471.7L170.96,471.7L170,472.6L170,472.6L166.96,473.69L166.96,473.69L164.87,473.15L162.27,471.18L162.27,471.18L162.69,467.57L161.68,464.69L161.68,464.69L159.6,464.02L160.67,461.71L160.67,461.71L160.21,457.29L158.86,456.26L156.34,456.18L155.36,457.96L155.36,457.96L154.36,458.61L153.69,461.71L153.69,461.71L152.67,462.4L150.7,461.83L150.7,461.83L147.14,456.17L147.14,456.17L143.09,453.18L140.07,452.57L138.5,454.44L137.42,454.22L137.42,454.22L135.89,453.87L135.89,453.87L133.62,454.85L132.83,456.84L132.83,456.84L132.39,460.61L132.39,460.61L130.79,462.24L130.79,462.24L131.05,463.01L131.05,463.01L130.43,465.98L128.01,467.2L128.01,467.2L124.87,468.17L123.34,469.66L123.34,469.66L121.27,470.37L120.3,469.94L120.3,469.94L118.2,470.06L116.75,471.6L112.4,471.83L112.4,471.83L112.03,470.13L110.31,470.13L109.07,466.07L107.19,463.89L106.26,458.27L104.39,456.71L104.39,456.71L102.51,456.09L102.51,456.09L98.68,455.59L103.8,445.76L105.16,447.05L105.4,445.48L107.19,444.32L109.39,445.25L111.62,443.16L114.17,443.48L114.41,444.74L115.93,441.17L116.48,441.33L116.43,440.11L117.87,439.69L119.47,440.17L121.94,443.23L121.63,439.95L120.66,439.37L121.81,438.31L120.42,438.34L118.37,436.64L118.08,437.51L116.61,437.28L115.82,438.21L114.59,437.25L114.17,438.02L109.26,437.99L108.1,439.08L107.19,439.02L106.84,438.02L106.27,439.08L104.56,438.34L103.46,436.32L102.22,436.9L101.49,435.26L102.54,433.36L101.28,432.33L105.58,429.88L108.92,426.31L110.76,425.12L111.91,425.73L114.41,423.61L117.48,419.36L116.77,415.04L117.82,413.43L119.68,414.36L124.31,413.65L128.8,414.85L130.9,416.59L132.24,419.62L132.92,418.97L131.69,418.62L132.29,416.33L131.6,413.43L122.84,408.43L124.28,406.95L127.48,405.72L132.79,405.95L133.71,404.82L133.79,402.72L136.7,401.3L132.53,401.43L130.87,403.08L128.06,402.79L125.91,403.56L122.65,402.56L121.29,403.79L116.11,403.5L116.3,396.94L111.75,396.46L111.73,395.36L109.84,393.88L110.57,392.97L115.48,392.62L116.64,393.62L117.35,392.78L123.07,391.97L124.73,390.74L127.61,391.87L129.32,390L129.64,388.67z"},{"code":"KR-SJ","name":"South Jeolla","path":"M66.62,587.6l0.37,1.2l-1.84,-1.17l-0.68,1.2l-0.21,-1.61l-1.02,0.06l0.03,1.58l-0.47,-1.11l-2.47,-0.19l0.18,-1.11l-0.95,0.22l1.71,-1.58l-0.24,-0.31l0.84,-1.08l1.29,1.68l3.34,-0.89L66.62,587.6zM93.4,563.47l0.89,-0.67l-0.47,-1.14l-2.42,-1.71l-0.68,-1.78l-0.92,0.32l0.63,-1.11l-2.44,0.79l-1.34,-1.52l0.76,-0.67l-0.73,-1.08l-5.78,-1.81l-0.13,2.48l1,0.54l-1.5,2.92l-0.84,-0.67l-0.08,1.21l-1.23,0.41l1.1,1.21l-1.89,0.16l-0.37,1.05l0.74,0.83l-1.13,0.54l-0.5,-2.28l-1.73,3.36l-5.25,2.89l0.95,1.71l-0.66,-0.57l-1.13,0.44l-1.73,3.1l2.7,4.56l2.34,-0.79l0.29,0.79l-1.02,0.44l0.39,0.6l-0.94,1.23h1.65l-0.13,-0.73l0.76,-0.22l0.92,1.62l2.26,0.06l2.65,-0.98l-0.66,-1.27l1.23,0.54l0.92,-0.89l0.6,0.67l0.89,-1.2l1.63,0.13l0.13,-2.12l1.5,0.79l1.58,-0.82l-0.81,-0.98l0.89,-0.38l0.81,0.7l-0.37,-1.2l1.16,0.86l-0.24,-1.81l1.39,1.74l-0.37,0.73l1.23,0.03l-0.03,-1.68l2.81,-3.17l-0.71,-1.65l1.31,-1.68l-1.21,-0.35l0.03,-0.85l1.5,-0.41l0.58,0.86l-0.05,-1.62L93.4,563.47zM51.65,536.57l1.05,-0.16l-1.26,-1.91l0.05,-1.46l5.04,-0.67l0.34,-1.34l1.16,-0.16l-0.26,-2.83l-2.02,0.32l-0.97,1.91l-1.23,-0.25l0.21,0.64l-1.21,0.73l-3.99,-0.6l0.42,1.21l-0.81,0.38l-0.13,-0.54l-0.39,0.76l0.58,0.7l-0.73,3.28l2.86,1.81l2.13,-0.6L51.65,536.57zM131.13,584.47l-2.07,-0.73l-1.81,-3.77l0.08,-2.82l-1.08,-1.2l-3.39,-1.84l-4.07,1.96l-0.05,5.13l0.71,0.67l-0.5,0.89l1.97,0.41l2.84,3.61l1.55,-0.6l2.5,1.27l-0.18,-2.09l1.18,1.49l2.78,0.51l-1.39,-1.87L131.13,584.47zM55.48,538.28l-0.97,-2.39l-0.16,1.81l-1.23,-0.06l-0.1,2l-0.97,-0.57l0.26,-0.6l-2.1,0.44l-0.21,2.96l0.6,1.65l1.13,-0.79l-0.05,1.11l0.84,0.51l1.29,-1.02l-0.1,1.56l0.97,0.32l1.5,-0.67l0.03,-1.08l1.5,-1.02l0.16,-1.05l1.08,0.29l0.47,-1.21L55.48,538.28zM122.86,599.4l-3.36,-2.15l-0.66,1.55l-0.89,-0.09l1.81,2.05l-2.07,2.12l-0.05,1.61l0.71,1.64l1.37,-0.79l-0.13,1.61l1,0.47l0.89,-1.04l-0.13,-2.62l1.1,0.38l0.26,-1.07l-1.31,-0.03l-1.08,-2.65l2,-0.25L122.86,599.4zM115.59,594.53l-2.76,-0.54l-0.52,0.73l-0.47,-1.39l-1.42,0.06l1.23,1.68l-0.89,0.1l-0.26,0.76h0.97l-1.13,0.67l0.39,1.26l-0.92,0.41l1.6,0.41l-0.05,1.17l2.57,0.54l-1.34,-1.55l2,-0.51l-0.1,0.92l1.89,-0.03l-1.23,-1.93h1.81l-0.6,-1.74L115.59,594.53zM113.12,600.69l-0.6,1.01l-0.5,-1.11l-1.39,0.28l-1.55,-1.61l-3.28,2.5l-0.08,2.46l0.84,1.96l1.39,0.06l4.67,-2.68l0.24,-1.55l1.13,-0.6l1.16,2.02l0.05,-1.67l1.23,1.39l0.47,-1.86l-1.1,0.35L113.12,600.69zM59.92,555.76l0.97,-0.13l0.55,-1.3l0.6,0.98l1.81,-0.51l0.37,-1.17l-0.42,-1.11l-0.71,0.64l0.24,-2l-1.44,0.45l-0.84,-1.27l0.79,-2.13l-1.05,0.25l0.16,-0.79l-1.86,0.45l0.6,1.43l-0.52,2.54l0.82,-0.44l0.6,0.57l-0.66,0.6V555.76zM83.68,520.43l-0.76,1.82l-2.81,-0.89l-0.47,1.82l3.31,1.02l1.58,-1.88l3.15,0.35l0.37,0.86l1.29,-0.57l1.39,1.91l-1.71,1.08l0.45,0.67l1.76,0.54l0.18,-0.95l1.5,-0.22l0.05,-3.69l-1.08,0.45l0.03,-1.27l-3.12,0.32l-0.97,-0.83l1.02,-0.48l-1.08,-0.73l1.16,-0.19l0.05,-1.24l2.42,0.16l-0.03,-0.99l-1.44,-1.24l-2.26,0.19l-1.31,-1.66l-1.57,1.05l2.07,2.97l-1.02,0.64l-1.18,-0.61l-0.21,1.63l0.71,0.64l-1.1,0.38L83.68,520.43zM70.14,537.17l1.42,-0.13l0.63,3.02l2.78,-0.57l0.29,-1.78l-1.81,-4.07l-1.79,0.67l-1.71,-2.23l-1.73,0.54l-1.81,-0.92l-0.34,1.21l-0.66,0.03l0.45,1.43l-0.87,2.13l2.05,-1.21l0.1,1.02l0.66,-0.29l-0.37,1.88l1.18,-0.16l0.68,0.76L70.14,537.17zM75.57,547.31l0.32,-1.52l-3.05,-2.35l-0.97,0.32l-0.63,1.56l-0.79,-0.57l-0.31,0.95l-1.18,0.1l0.26,1.02l1,-0.64l0.58,0.73l-1.05,1.62l0.71,1.62l2.05,-0.57l0.47,-0.95l1.68,0.57l0.63,-1.05l1.52,-0.16l0.29,-1.21L75.57,547.31zM73.92,497.36l0.13,0.7l0.97,-0.29l-0.55,0.77l1.89,0.38l0.42,-0.61l0.84,1.05l1.79,-0.16l0.97,0.61l-0.42,1.66l0.92,0.19l0.87,1.6l1.42,0.13l0.97,-1.91l-1.15,-0.73l-0.39,-2.43l-1.42,-0.99l0.5,-2.75l-0.52,-0.64l-1.39,0.9l-0.39,-1.05l-1.97,0.35l-1,-1.25l-1.05,0.23l-2.28,1.37l0.76,1.79L73.92,497.36zM65.2,522.91l-1.57,0.29l3.05,3.85l0.37,2.07l2.21,-0.35l0.5,-1.4l-0.92,-1.65l0.79,-1.15l1.13,0.51l1.6,-1.24l-1.73,-1.11l-0.03,-0.8l1.84,0.06l0.6,-0.8l-1.39,-1.82l-0.47,0.77l-2.21,-0.89l-0.58,0.38l0.16,1.78l0.89,0.73l-0.5,0.92l-3.1,-1.11L65.2,522.91zM73.29,505.98l0.63,-1.88l-3.78,-1.37l-2.78,2.97L73.29,505.98zM55.96,521.41l5.2,0.54l1.05,1.85l-0.18,-1.78l0.76,-0.22l0.21,0.76l1.44,-0.45l-0.34,-0.8l1.97,0.1l-0.6,-1.43l1.92,-0.92l-1.44,-1.5l1.52,-1.4l-1.42,-0.22l0.71,-1.21l-1.23,0.29l0.11,-1.31l-2.1,-0.86l0.39,2.17l-0.58,0.96l-1.02,0.19l-0.42,-1.11l-0.66,1.21l-1.81,-0.35l-2.2,4.21l-2.13,0.03l1.39,0.89L55.96,521.41zM63.6,498.42l0.18,-0.35l1.58,-0.26v1.6l2.36,0.96l0.03,-1.56l1.52,0.1l-0.81,-1.53l1.23,-0.22l-1.79,-1.76l0.32,-1.5l1.18,-0.03l0.32,-3.1l3.83,-1.66l-4.65,0.23l-0.1,1.09l-2.81,2.97l-3.2,0.57l-0.68,2.27l1.58,0.93l-0.31,0.86l-1.68,-0.25l1.05,1.05L63.6,498.42zM5.33,542.07l-1.34,-0.73l1.29,-1.05l-3.1,0.57l0.05,1.24l-2.08,2.92l1.08,1.02L0,546.64l0.95,1.65l1.58,0.57l-0.08,-1.68l1.63,-0.7l-0.55,-1.59l1.89,-0.48l0.24,-2.06l1.86,-0.64l-1.02,-1.05L5.33,542.07zM143.87,599.08l0.5,-1.2l-0.79,-0.88l0.71,-1.2l-1.89,-0.54l-1.86,0.85l-0.18,0.82l-1.18,0.31l0.03,2.53l-1,0.35l1.16,0.54l-1,0.89l0.71,1.39l1.18,-1.77l1.1,1.86l1.79,-0.69l0.79,0.6l1.02,-0.91l0.13,-3.28L143.87,599.08zM226.87,518.86l-0.13,-3.44l-1.71,-1.69l-2.7,-0.06l0.26,-1.72l-0.79,-0.64l-2.57,2.58l0.05,2.01l5.36,1.21l0.5,0.7l-0.29,-2.71l0.95,-0.35l0.94,3.92L226.87,518.86zM227.32,553.44l1.55,-0.6l0.16,-0.86l-1.86,-1.24l0.32,-2.16l0.84,-0.35l-0.18,-2.89l0.74,-0.73l-1.02,0.13l0.55,-0.73l-1.55,-0.38l-0.79,-1.24l0.29,-1.88l-1.29,0.35l-0.66,-1.08l0.58,-0.76l0.84,0.67l0.16,0.29l1.31,0.32l-0.24,-2l-4.52,-1.94l0.68,2.26l1.13,0.16l-0.18,2.54l1.44,0.7l-1.79,0.32l-0.5,1.46l-2.28,1.49l-0.58,1.43l0.66,0.95l-1.34,1.52l2.55,1.18l1.16,2.16l1.44,-0.09L227.32,553.44zM218.86,537.52l-2.1,-1.27l0.34,-0.67l-1.76,-1.08l0.05,-0.73l-0.6,0.16l0.18,1.02l-2.26,3.05l0.71,1.44l-1.55,-0.55v-0.83l-0.42,1.31h-0.73l1.31,1.27l-0.42,1.02l1.39,0.35l-1.55,0.67l1.31,2.23l-0.66,0.51l1.31,0.51l-1.21,1.46l1.02,0.03l0.42,1.14l-2,-0.29l-0.97,-1.62l-2.42,-0.98l-1.21,0.38l0.45,2.16l-2.78,-4.1l1.18,-1.18l-1.1,-0.35l0.05,-1.59l2.36,-0.89l-1.29,-0.06v-0.83l-1.02,0.96l0.37,-1.53l-0.81,0.1l1.47,-1.27l-0.24,-0.92l0.63,0.48l1.05,-0.57l0.34,-1.43l1.92,0.06l-1.81,-0.6l0.63,-0.83l-0.68,-1.34l-1,1.08l-0.03,-1.59l-1.29,-0.38l1.37,-0.73l-1.37,-1.43l-0.13,-1.3l-3.12,-0.22l0.18,-1.62l1.6,-2.16l-1.65,-0.26l-0.79,-4.01l-2.55,0.7l0.19,3.06l-0.6,0.77l-1.78,-0.54l-2.34,0.92l-0.47,-1.37l-0.42,1.37l-3.36,1.34l-1.29,-1.34l-2.34,-0.1l2.23,1.18l0.92,1.46l3.36,0.03l-3.1,2.01l-0.79,2.01l-1.94,-0.1l3.44,1.24l-0.39,1.24l-2.39,1.88l1.55,3.4l3.28,2.29l0.81,1.34l-0.45,0.7l1.84,0.03l-0.24,1.37l1.21,-0.83l-0.05,0.83l0.95,0.1l-0.47,-1.08l1.47,-0.13l-0.39,2l1.55,0.51l-0.03,0.89l-1.18,-0.67l-0.34,0.83l-0.92,-0.95l-0.47,0.44l0.84,0.92l2.78,0.6l0.81,4.26l-1.71,1.43l-0.05,0.98l-2.44,-0.79l-0.39,-1.27l-1.23,1.68l-1,-1.3l-1.47,0.64l-0.92,-0.92l-3.96,0.57l0.05,0.67l2.36,-0.19l0.24,0.95l1.31,-0.79l-0.39,1.37l-2.21,0.38l-0.18,1.08l1.97,-0.57l2.26,0.38l-0.63,0.57l1.37,-0.32l0.45,2.28l-1.26,0.44l0.63,2.19l-2.07,-0.89l-0.34,1.68l-1.42,-0.6l-1.05,0.73l1.13,1.43l-0.24,0.92l-0.89,-0.48l-0.84,0.79l-1.34,-1.3l-0.47,1.62l-0.63,-0.66l-1.65,0.82l1.13,1.01l-1.68,0.19l1.68,0.95l0.26,1.01l-1.13,0.82l-2.21,-0.85l0.03,-0.63l1.1,0.03l-0.71,-0.98l-1.18,-0.03l0.34,-0.86l-3.05,-1.24l1.42,-1.93l-2.76,-2.63l-0.97,0.03l-0.03,0.73l-1.18,-0.38l0.21,-0.79l-2.39,-2.09l0.08,2.6l-2.52,-1.71l-0.84,1.74l-0.5,-0.67l-2.94,0.35l-1.47,-0.79l0.08,-1.24l-0.94,-0.63l0.47,-1.94l2.63,-2.41l0.34,-1.87l0.95,1.08l1.23,-0.38l0.05,-3.59l2.55,-2.54l2.68,-0.67l0.42,-2.48l1.1,-1.08l-0.39,-1.65l2.23,-1.97l0.68,0.54l0.97,-0.79l0.5,2.77l-0.73,2.42l0.76,0.8l2.68,0.25l1.71,-4.93l1.13,-0.35l-1.15,-0.54l-0.63,-4.17l-2.05,0.25l-1.13,2.19l-1.97,-1.24l-0.76,1.15l-1.73,-3.31l-1.55,0.35l-4.25,7.25l-3.86,0.13l-1.31,-1.21l-2.94,3.66l-2.94,1.08l-1.79,2.95l-2.76,1.27l-2.28,0.19l-0.03,0.95l1.39,0.76l-1.02,0.45l-0.66,2.57l-1.08,0.95l0.95,0.7l1.63,-0.32l-0.13,1.49l-1.6,-0.48l0.03,2.48l-1.55,-0.38l-1.15,1.3l1.66,2.03l-0.95,0.51l-0.37,1.56l1.5,2.09l-2.05,0.82l-1.39,-1.59l-0.58,0.83l0.97,2.31l-0.84,1.05l-1.65,-0.79l-4.73,-0.19l1.52,2.47l-0.16,1.46l-1.21,-1.81l-2.6,-1.58l-2.55,0.35l-1.29,-0.92l0.29,-1.4l-2.05,-0.06l1.02,-1.24l-0.94,-3.84l1.05,-3.93l-0.66,-0.51l0.42,-1.71l-0.87,-1.02l0.24,-1.17l-1.02,-0.92l0.84,-5.18l-1.55,2.73l-0.6,9.43l0.55,0.64l-1.05,0.67l0.68,2.63l-2.55,1.55l0.79,1.55l-2.21,3.3l-2.36,0.28l-2.34,1.43l-0.08,0.95l-0.81,-0.82l-1.37,0.48l-0.52,1.49l-0.97,-0.25l-0.55,1.05l-0.55,-0.57l-0.6,0.79l0.5,0.57l-0.94,1.17l0.84,0.73l-0.05,2.34l-1.71,1.08l0.6,0.51l-0.79,1.01l0.53,2.37l-4.28,-0.85l-1.5,2.21l-1.44,0.25l-0.34,1.01l-0.87,-0.31l0.26,-2.21l-0.66,-0.54l1.39,-1.68l-0.6,-3.07l-1.44,-0.63l-3.18,2.03l-0.6,-1.08l0.32,-0.66l0.92,0.85l-0.21,-1.01l0.97,0.09l-1.26,-2.22l2.39,-0.41l-1.08,-2.44l1.68,0.92l1.08,-1.65l-0.71,-2.82l-1.13,0.92l-1.29,-0.28v0.98l-2.63,-2.44l0.84,-0.85l0.37,-0.25l0.16,-1.65l-0.63,0.25l-0.74,-0.95l1,-0.73l-0.92,-2.06l1.34,-0.82l-0.79,-1.36l-1.92,-0.16l2.21,-1.68l-0.31,-0.82l-2.05,0.64l-0.03,-1.59l-2.28,-0.79l0.21,1.21l-1.5,0.25l0.03,0.95l-1.44,0.7l-0.79,-0.79l0.92,-2.35l-2.21,-0.09l-2.86,-1.43l-2,0.7l-0.94,-1.14l0.87,-1.02l-3.18,-1.18l0.11,-2.95l1.23,-1.02l-0.42,-0.57l-0.45,0.64l-1.18,-0.29l-1.18,-1.14l-0.45,-4.19l0.76,-0.7l-0.16,-2.45l0.58,0.45l0.68,-1.11l1.05,-5.15l1.31,-0.54l1.05,0.99l-0.32,0.73l1.26,-0.13l1,3.25l1.76,1.4l-1.55,1.3l0.16,2.77l-0.71,0.99l2.55,1.43l-0.1,2.89l1.31,0.64l0.26,1.84l1.02,-1.49l6.75,4.06l-0.18,-0.89l2.89,-1.46l0.45,-1.14l-0.87,-0.54l-2.02,0.98l-0.45,-2.89l-1.18,1.18l-0.81,-2.45l-1.05,0.25l0.5,-1.84l-0.74,-0.06l0.05,-0.83l-0.87,0.03l-0.31,1.24l-1.39,0.92l-1.08,-0.95l1.65,-1.97l-0.7,-2.41l1.13,0.92l0.47,-0.41l-0.73,-1.78l-1.05,-0.19l1.05,-0.95l1.81,3.5l1.65,-1.91l0.5,0.6l0.55,-0.95l1.13,0.67l-2.57,3.59l1.13,1.27l0.97,-0.38l-0.03,0.89l1.63,1.21l3.94,0.51l1.58,1.37l1,-1.33l-1.31,-0.38l0.13,-1.4l2.21,0.22l0.31,0.89l3.26,1.4l3.54,-0.16l-2.81,-0.86l-3.02,-2.22l0.24,-2.67l-2.39,-0.13l-1.18,-2.92l-2.68,-3.18l-2.47,-0.25l-1.44,1.11l-0.73,-1.65l-1.71,0.54l-1.58,-1.08l-2.41,1.85l-2.34,-0.86l1.63,-1.56l-0.21,-1.56l1.16,-0.44l-0.08,-1.34l-1.99,0.13l-0.71,-2.17l2.99,-4.26l1.81,-0.7l-1.6,-2.9l0.63,-1.31l-1.29,-0.35l0.29,-1.98h0.84l0.45,-1.27l-1.47,-1.88l0.66,-0.73l-0.79,-1.21l0.53,-2.23l-1.15,-0.77l-0.92,-3.25l-0.31,2.77l-0.87,0.7l0.08,0.77l1.42,0.61l-0.89,1.44l0.76,0.51l-0.71,0.86l0.39,0.93l-2.49,1.05l-1.36,-0.16l-0.24,-1.62l-1.92,0.25l-0.18,-0.73l1.5,-1.05l-2.44,-2.52l1.63,-2.55l-0.29,1.4l0.95,-0.67l0.81,1.69l1.89,-0.96l0.95,-2.04l-1.86,-0.41l4.91,-3.16l-0.08,-1.5l-0.89,-1.12l-2.63,0.83l-0.26,-2.04l-1.65,-0.41l1.26,-0.96l-1.15,-2.17l-1.34,-0.03l-0.13,0.73l-1.37,-0.96l1.21,2.24l-1.37,1.05l1.26,0.9l-1.29,1.21l-1.47,-2.08l-2.08,0.99l-0.6,-3l-1.02,-0.67l0.42,-1.28l1.65,-0.13l-2.21,-2.43l0.82,-1.92l0.76,0.31l-0.26,-1.3l1.47,-0.9l0.71,1.92l1.05,-0.83l1.37,0.42l0.08,1.25l1.29,-0.06l0.92,-1.63l-0.6,-0.77h0.97l1.08,-1.28l0.05,2.56l-0.68,2.33l-0.76,0.22l-0.13,2.46l1.21,0.22l0.89,-1.02l-0.71,2.65l1.23,0.42l0.74,-0.57l0.21,1.95l2.23,-2.75l-0.66,2.27l1.13,-1.18l1,1.53l-1.55,2.27l0.97,-0.03l0.1,1.85l2.23,-0.06l-0.58,-1.76l2.1,-1.4l1.44,-2.3l-2.07,-0.96l2.1,-0.67l0.66,-1.18l-4.07,-0.73l-3.62,-5.82l-2.18,-1.25l0.29,-1.34l-1,-0.48l1.63,-0.54l0.68,-2.56l-4.1,0.86l-1.57,-0.8l-0.26,-1.73l-1.37,-1.12l1.1,-2.08l1.34,2.85l1.37,-1.38l-0.55,-0.99l1.6,-2.18l-0.29,-0.7l-1.76,0.03l0.74,-1.31l3.13,0.03l0.74,-5.29l1.76,-4.45l4.7,1.57l-3.47,-2.37l-0.76,-2.4l0.45,-2.34l1.47,-1.41l4.49,-0.23l0,0l1.87,0.62l0,0l1.87,1.56l0.94,5.62l1.87,2.19l1.25,4.06h1.71l0.38,1.7l0,0l4.35,-0.23l1.45,-1.54l2.1,-0.11l0,0l0.97,0.43l2.07,-0.71l0,0l1.53,-1.5l3.14,-0.96l0,0l2.41,-1.22l0.62,-2.97l0,0l-0.26,-0.77l0,0l1.6,-1.63l0,0l0.44,-3.77l0,0l0.79,-1.99l2.27,-0.98l0,0l1.53,0.35l0,0l1.08,0.22l1.57,-1.87l3.02,0.61l4.04,2.99l0,0l3.56,5.67l0,0l1.97,0.57l1.02,-0.69l0,0l0.67,-3.1l1,-0.64l0,0l0.98,-1.79l2.52,0.08l1.35,1.04l0.46,4.41l0,0l-1.06,2.31l2.08,0.67l0,0l1.01,2.88l-0.42,3.61l0,0l2.59,1.98l2.1,0.54l0,0l3.03,-1.09l0,0l0.96,-0.9l0,0l1.3,-0.84l3.16,1.36l0,0l1.93,-1.12l1.44,1.37l0,0l1.13,0.66l6.15,-0.02l0,0l2.38,-0.7l3.19,0.36l0,0l1.75,-0.46l2.95,-3.79l1.76,-0.98l0,0l2,-0.11l0,0l4.54,2.08l0,0l6.38,4.46l0,0l-0.8,2.26l2.66,2.99l0.91,9.22l6.57,6.46l0.19,2.9l0,0l1.09,1.05l0,0l3.56,3.8l0,0l1.75,1.33l0,0l2.24,8.23l-2.78,-0.09l-1.36,-2.97l-2.97,1.66l-0.05,-2.9l-1.42,-2.04l1.13,5.2l-1.79,2.1l-2.02,0.77l0.29,1.44l-3.2,1.53l-0.94,1.37l-0.95,-1.21l0.45,-0.57l-2.07,0.22l-1.52,-2.26l0.16,-2.45l-0.71,-0.67l-0.13,3l-1.97,0.54l2.44,1.88l-0.5,0.8l-0.39,0.19l-1.92,0.8l1.44,0.54l1.58,3.76l2.89,0.67l-0.94,1.31l1.16,1.43l0.03,-1.11l2.31,0.8l2.55,-1.78l0.92,-1.53l0.11,-0.29l3.18,-0.96l-0.95,0.86l1.76,0.7l-0.13,-0.76l2.31,-0.83l1.34,1.34l-0.84,0.19l-0.29,5.89l-0.89,-0.06l-1.34,2.61l0.97,4.55h-2l-0.26,1.11L218.86,537.52zM152.01,485.22l-1.02,-4.54l-1.94,-2.34l-1.83,-0.87l-2.44,-0.09l-4.44,2l-2,2.09l-1.48,0.09l-3.57,-2.09l-0.61,-2.18l-2.18,-0.09l-2.09,5.31l-2.35,-0.09l-1.74,2.09l-1.13,4.79l0.44,4.09l7.23,1.04l3.75,6.1h3.75l3.4,-2h3.83l1.48,-1.04l3.14,0.61l3.4,-2.35l1.39,-1.83l1.74,-6.1v-1.39l-2.09,-0.96L152.01,485.22zM201.87,568.35l-1.42,-2.28l-0.05,1.14l-0.68,-0.41l-0.45,1.01l-0.92,-0.03l0.66,-0.82l-1.68,0.16l-1.76,-1.17l0.39,2.57l-0.81,0.48l2.21,-0.51l1,0.6l-0.21,0.63l-1.86,-0.22l1.21,1.27h1.68l-0.55,1.74l0.5,0.7l2.7,-1.71l1,0.48l0.76,-0.95l-0.1,-2.06L201.87,568.35zM225.16,561.91l1.39,-0.51l-1.84,-2.25l-0.55,-2.16l-1.71,0.03l-2.55,1.75l-1.42,-0.13l2.18,1.78l1.26,-0.41l-0.74,1.17l1.5,0.7l-0.6,0.89l1.84,-0.19l-0.03,0.64l1.65,0.28l-0.87,0.57l2.71,0.51l0.76,-1.17L225.16,561.91zM221.43,518.23l-0.94,-0.83l-1.76,0.67l-0.68,1.18l0.95,0.73l-0.47,0.45l2.26,0.57l0.92,-1.91l1.58,-0.38l-0.34,-0.57L221.43,518.23zM131.79,576.56l-1.31,2.6l1.39,0.82l0.03,-1.9l1.08,-1.46l2.55,-0.1l0.55,-1.96l2.31,1.24l1.55,-0.1l0.08,-0.82h-0.71l-0.16,-1.36l-0.81,0.13l0.21,-1.24l-1.1,0.82l-1.42,-1.01l1.79,-0.1l0.29,-0.98l-1.13,-0.29l-0.08,-1.39l-4.25,1.24l-2.23,2.57l0.34,1.36l-1.71,2.25L131.79,576.56zM196.99,564.61l1.44,0.32l0.39,-0.7l0.58,0.7l1.13,-0.82l-1.39,-1.97l-2.89,-0.22l0.16,-0.79l1.21,0.38l-1.52,-1.78l1.84,-0.79l-0.47,-0.92l-1.52,-0.16l-2.23,2.89l2.05,1.05l-0.42,0.54l0.66,0.44l-1.68,1.05l0.95,1.56l1.02,0.16L196.99,564.61zM228.5,568.48l0.32,-1.01l-1.08,0.57l0.29,0.89l-1.15,2.22l1.5,-0.25l-1.47,1.65l0.26,0.54l0.87,-0.48l0.11,0.82l0.71,0.03l0.97,-5.04l-0.71,0.48L228.5,568.48zM149.75,581.43l-1.16,1.36l0.26,2.12l0.55,-0.38l0.81,1.27l4.02,-2.59l-0.13,-0.92l-1.58,-0.85H149.75zM140.06,584.31l-0.05,-0.95l0.53,1.46l1.08,-0.03l-0.24,-2.34l1.5,-0.16l0.1,-1.52l-1.68,0.92l-0.71,-1.45l-1.44,0.41l-0.13,-0.66l-0.68,0.85l-1.5,-1.61l-1.37,1.3l0.13,1.04l-1.23,0.51l-1.6,-1.42l-1.39,1.27l-2.18,-0.13l2.73,0.98l1.21,1.39l1.44,-1.39l1.87,0.13l1.21,3.13l1.31,-1.2L140.06,584.31zM160.75,579.31l-0.89,-0.48l-2.91,1.27l0.05,-1.96l-1.55,-1.46l-0.21,0.89h-1.63l0.63,0.63l-0.89,0.06v1.14l-2.13,-0.32l2.13,1.24l0.71,-0.73l1.34,0.86l0.34,0.79l-1.42,0.32l1.16,0.67l2.05,-0.95l0.13,0.73l-1.57,1.11l0.42,1.84l1.66,-2.78l2.02,-0.51l-1.71,-0.28l0.55,-0.89l3.31,1.14l-1.89,-1.74L160.75,579.31zM144.45,575.48l-0.6,-1.33l-0.66,0.6l-0.47,-0.7l-0.16,0.92l-1,-1.27l-0.76,0.79l-0.05,-0.89l-0.87,-0.41l-0.31,0.63l0.95,1.36l-0.79,2.38l0.68,0.57l1.34,-0.6l0.32,1.62l1.79,0.7l1.63,-0.79l0.39,-1.17l1.81,0.35l-0.66,-1.96l1.02,-2.12l-0.55,-1.11l-1.24,2.5L144.45,575.48zM175.61,591.75l-0.03,1.17l-0.92,0.1l-0.71,2.78l1.47,-0.66l1.68,0.85l-0.81,-1.2l1.1,-0.28l-0.34,-3.07L175.61,591.75zM173.01,563.59l-1.39,0.86l-2.02,-0.29l-3.49,2.03l-1.34,-0.63l-0.42,-1.43l-0.79,0.06l-0.16,1.62l-2,0.67l1.26,1.74l-0.66,1.4l1.63,-0.63l-0.08,1.08l2.52,2.12l0.58,-1.24l1.47,0.28l0.21,-0.76l4.04,0.63l2.47,-5.29L173.01,563.59zM154.79,568.16l1.1,0.67l0.34,3.2l0.81,0.79l0.6,-0.32l-0.26,-1.27l1.05,0.25l0.13,2.79l1.18,-3.14l-0.92,-2.54l-0.97,-0.82l-0.39,0.76l-0.6,-0.95L154.79,568.16z"},{"code":"KR-NG","name":"North Gyeongsang","path":"M452.87,219.76l0.41,1.32l-0.76,0.88l-1.29,-0.54l-0.34,-0.96M452.87,219.76M442.25,208.93l0.94,0.28l-1.05,1.46l0.96,1.76l-0.73,2.61l0.94,0.68l-3.53,1.86l-0.75,1.9l-6.31,-2.46l-1.42,-5.79l0.75,0.48l4.06,-2.08l4.47,-0.62l0.77,-0.86L442.25,208.93zM299.65,432.93l-0.47,3.05l0,0l1.69,3.67l0,0l4.45,3.48l5.88,-1.1l7.44,2.75l0,0l1.92,0.57l5.51,-3.83l1.01,0.3l0,0l4.96,-4.15l2.1,0.04l0,0l2.93,0.87l0,0l3.7,1.57l0.96,-0.35l0,0l4.69,-3.88l0,0l0,0l0,0l1.66,-0.17l0,0l0,0l0,0l1.33,-0.73l-1.58,-3.54l4.75,-3.07l3.11,-1.02l4.22,-0.36l2.9,1.89l2.01,0.31l1.21,1.41l0,0l-0.43,2.84l0,0l1.02,1.11l0,0l1.98,0.65l0,0l5.37,-2.39l0,0l8.14,2.15l0,0l3.01,0.22l-1.44,-1.38l-0.24,-2.32l1.26,-2.38l1.05,-0.1v-1.61l1.15,-1.29l-0.45,-1.83l2.37,-7.54l-0.63,-1.9l1.94,-2.06l-0.29,-2.13l2.47,-5.52l-1.6,-0.32l1.1,-1.06l-0.44,-1.32l0.87,-0.74l-1.52,-3.23l2.94,-2.65l0.24,-3.17l3.07,-4.36l-0.68,-0.94l0.63,-2.49l-1.21,-3.75l-1.18,-1.07l-1.23,0.29l-0.92,2.3l-3.07,3.33l-0.05,1.33l-4.17,2.49L384.84,391l-0.82,0.26l-2.54,-1l-0.26,-2.13l-2.34,0.61l1.37,-1.91l2.26,-0.19l-2.6,-0.94l-1.68,1.16l-1,-1.65l0.66,-2.33l3.47,-1.36l-0.18,-1.45l1.31,-1.65l0.08,-0.97l-3.02,-2.49l-0.47,-6.02l-1.39,-0.61l-0.84,-1.59l1.39,-2.24v-2.3l-1.23,-1.46l0.81,-2.5l-0.68,-1.59l1.29,-7.98l4.6,-8.25l-0.24,-6.31l1.79,-2.99l-0.87,-0.78l-0.29,-4.62l-2.7,-3.65l0.03,-4.59l2.39,-5.67l1.18,-0.98l1.31,0.07l1.26,-2.41l-0.55,-2.58l0.52,-1.43l-0.92,-2.84l1.05,-1.11l-3.02,-7.67l-1.68,-1.86l-1.23,-4.31l0.5,-6.9l-1.18,-3.96l1.05,-1.86l-0.97,-4.19l0.68,-0.52l-0.18,-2.52l1.6,-0.36l-5.25,-5.24l0.37,-2.02l0,0l-4.28,0.72l0,0l-1.87,2.19l-2.5,0.94l-2.81,2.5l0,0l-1.56,2.19v1.25l0,0l1.56,2.81l-6.53,0.16l0,0l-2.66,-2.27l-2.95,-1.03l-2.61,-0.4l-2.55,2.52l-7.43,-2.62l-3.35,0.72l-0.68,-1.32l-1.72,-0.68l0,0l-2.91,4.31l0,0l-0.94,1.25h-4.06l-6.24,-4.37l-2.02,0.18l-0.54,4.72l-1.11,1.12l-3.07,-1.37l-1.92,0.26l-4.25,-2.34l0,0l-2.2,2.16l-2.15,-0.25l0,0l-2.28,2.61l0,0l-0.62,0.28l0,0l-3.29,3.25l-2.8,0.81l0,0l-0.79,1.24l0,0l-3.55,2.75l-3.16,5.67l0,0l-0.83,1.57l0,0l-0.05,1.33l1.31,0.61l0,0l0.8,2.91l-2.84,3.9l-3.99,0.78l0,0l-0.92,1.03l-2.44,-0.05l0,0l-2.19,0.18l0,0l-2.49,-4.92l-3.24,-1.85l-1.18,-1.97l0,0l-1.67,3.05l-1.13,0.34l-0.44,3.23l0,0l-0.37,0.57l-5.7,-1.74l0,0l-0.42,-0.63l0,0l-1.06,-0.38l-0.61,0.63l0,0l-2.53,3.09l-1.38,0.19l0,0l-1.64,-1.75l-0.51,0.31l0,0l-2.86,6.69l0,0l3.4,5.25l-4.6,-0.91l0,0l-1.18,-0.67l-1.21,0.59l-3.31,-1.63l0,0l-2.87,3.73l0,0l-4.25,1.42l-1.68,2.38l0.48,2.22l-3.23,3.34l0,0l-1.76,1.55l0,0l-1.56,0.35l0,0l-0.99,1.91l0.73,1.1l5.37,1.13l1.22,1.22l-0.14,0.93l0,0l0.97,1.97l0,0l2.01,1.36l-0.42,1.71l0,0l-2.02,0.89l-0.81,7.63l0,0l0.6,2.48l-1.28,2.02l1.32,3.25l0,0l0.5,0.31l0,0l-1,2.56l-2.66,2.31l0,0l-0.07,4.29l2.15,1.78l0,0l3.42,-2.56l0.46,1.44l2.5,1.48l0,0l1.85,1.57l0,0l1.17,0.4l0,0l1.99,-0.84l0,0l2.23,-0.79l2.02,0.7l0,0l0.62,1.07l0,0l0.15,3.17l0,0l1.26,1.87l0,0l-0.6,1.28l-3.12,-1.41l-2.41,1.43l-1.18,1.74l1.18,2.96l-0.41,3.57l-1.76,1.46l-1.04,4.64l-1.84,2.6l-2.88,-0.1l-1.08,1.07l0,0l4.72,8.98l-1.29,5.01l0,0l0.13,1.94l1.18,1.37l2.09,0.38l0,0l0.71,0.37l0,0l0.31,2.61l0.94,0.56l0,0l3.92,0.54l0,0l1.74,1.76l0,0l7,0.52l1.49,0.75l0,0l2.04,1.49l0.78,2.88l0,0l0.66,0.5l0,0l2.07,0.99l0.43,1.76l2.52,1.49l0.94,1.79l-2.06,6.18l0,0l-0.27,1.66l0.89,1.64l3.8,1.49l3.44,-0.61l0,0l2.96,-1.09l4.49,1.36l0,0l2.24,2.18l0,0l1.71,1.25l0,0l-0.73,-3.43l-4.06,-4.99l0.31,-2.81l3.43,1.87h2.18l0.62,-2.5l-3.12,-3.43l1.25,-3.12l1.25,-2.81l5.31,-0.94l-0.31,-1.87l-2.81,-2.18l-4.68,-0.31l1.56,-5.93l2.19,-3.12l4.06,-1.87l0.62,5.62h2.5l3.43,-8.11l5.93,-1.25l2.81,-3.12l3.43,-0.94l3.12,0.31l3.74,3.12l0.63,7.49l1.87,4.06l-0.94,2.19l-3.43,1.25l-1.56,3.43v3.12l-2.5,0.31v1.87l1.25,1.56v4.06l-3.43,1.25l-1.56,1.87l-2.81,-0.31l-0.62,-2.81h-3.12l-2.18,1.25l-1.56,2.5l0.45,1.51l0,0l1.27,-0.2L299.65,432.93z"},{"code":"KR-SG","name":"South Gyeongsang","path":"M240.35,406.64l2.09,0.38l0,0l0.71,0.37l0,0l0.31,2.61l0.95,0.56l0,0l3.92,0.54l0,0l1.74,1.76l0,0l7,0.52l1.49,0.75l0,0l2.04,1.49l0.78,2.88l0,0l0.66,0.5l0,0l2.07,0.99l0.43,1.76l2.52,1.49l0.94,1.79l-2.06,6.18l0,0l-0.27,1.66l0.89,1.64l3.8,1.49l3.44,-0.61l0,0l2.96,-1.09l4.49,1.36l0,0l2.24,2.18l0,0l1.71,1.25l2.41,-0.06l3.49,-2.5l0,0l1.52,-0.38l2.42,0.89l0,0l1.35,-0.92l1.32,-4.27l1.27,-0.2l0,0l0.69,1.28l-0.47,3.05l0,0l1.69,3.67l0,0l4.45,3.48l5.88,-1.1l7.44,2.75l0,0l1.92,0.57l5.51,-3.83l1.01,0.3l0,0l4.96,-4.15l2.1,0.04l0,0l2.93,0.87l0,0l3.7,1.57l0.96,-0.35l0,0l0.77,-0.79l0,0l1.47,2.43v1.47l-1.2,1.05l0,0l-2.23,1.89l0.34,4.83l2.23,1.05h2.75l0,0l2.4,0.21l3.26,3.35l0,0l5.66,5.87l0,0l3.09,0.21l0,0l1.27,1.55l0,0l-2.95,2.71l-0.57,1.86l-4.87,0.57l-3.61,6.64l-1.84,-0.32l-3.95,2.48l-4.06,4.94l-4.15,0.14l-3.86,2.43l-2.29,0.29l-0.43,5.01l-6.93,2.61l0,0l-1.81,2.23l-0.97,-0.73l0.16,1.25l-2.26,-0.67l-1.13,1.05l-0.37,-0.73l-0.87,0.19l-0.05,-0.93l-1.23,-0.03l-0.6,0.83l-0.71,-0.73l1.5,-2.2l-0.6,-1.82l-0.87,-0.29l0.21,-0.99l-1.68,0.8l0.52,1.76l-1.18,0.96l-0.34,-1.53l-1.78,-0.73l0.29,-1.34l-1.84,0.32l-0.42,1.73l-0.63,-0.83l-0.84,0.26l0.76,-1.09l-0.47,-1.89l-1.52,-1.09l-0.21,-3.23l3.94,-2.37l-4.2,1.34l-2.21,2.59l1.39,1.6l-0.29,1.31l1.13,0.13l0.95,2.11l-2.18,0.54l-0.13,0.7l2.52,-0.06l0.05,3.39l2.44,1.95l-2.26,0.64l0.79,0.96l1.37,-0.32l0.87,0.7l-5.94,1.76l1.42,-1.15l-0.42,-0.22l-1.97,-0.19l0.58,1.37l-1.21,0.16l-1.29,-1.82l2.23,-0.16l-0.31,-1.21l1.86,-1.12l-3.78,-1.15l0.6,-0.73l-0.87,-0.03l-0.08,-1.44l-1.02,1.82l-1.55,0.64l-2.52,-1.18l0.1,0.83l-1.02,0.42l-2.28,-0.89l-0.21,1.06l2.97,2.11l-1.08,-0.38l-0.42,0.96l-2.1,0.19l-1.31,1.95h-1.15l-0.34,-0.89l-2.73,1.92l-0.76,-0.41l0.71,1.6l-1.23,0.48l-0.97,2.42l2.73,-1.08l0.11,-1.76l1.5,-0.89l4.07,-1.02l-0.18,-2.01l0.79,-0.19l0.39,0.83l0.97,-1.44l1.26,1.31l-0.05,1.21l-0.26,0.9l-1.79,-0.06l2.02,0.67l-0.03,1.4l1.97,1.5l-0.92,1.24l-0.84,-0.54l-0.6,1.95l-1.29,-0.51l-0.05,1.02l-5.2,-0.8l0.03,1.44l1.94,-0.42l1.21,0.38l0.24,1.05l-1.94,1.95l0.58,0.26l-0.42,1.69l1,0.89l-1.68,2.52l0.79,0.77l-0.6,0.77l0.18,2.77l2.36,-3.25l-0.6,-1.47l1.23,-0.1l1.1,2.52l0.97,0.26l-0.76,2.29l-1.05,-1.34v1.94l-0.87,-0.13l0.5,2.26l-3.94,1.37l2.76,0.64l0.24,0.92l-0.03,2.07l-1,0.16l0.81,0.86l-1.89,0.28l1.52,1.21l-1.15,2.23l-2.49,-0.38l-0.08,-1.69l-0.81,0.38l0.29,-1.18l-0.84,-1.21l-0.63,0.96l-1.13,-0.76l1.5,-0.95l-0.05,-1.27l-2.99,-1.21l-1.05,0.96l-0.58,-1.05l0.92,-0.41l-0.24,-1.43l0.66,1.11l0.95,-1.18l1.08,1.43l0.63,-0.54l1.23,2.52l-0.18,-1.75l1,0.32l0.95,-0.76l-1.1,0.32l-0.79,-0.57l0.42,-0.86l-1.31,0.1l-0.37,-1.15l1.73,-1.37l2.92,0.13l-0.34,-0.6h-2.81l-0.55,-2.36l-0.29,0.7l-0.79,-0.41l0.29,1.88l-1.57,-0.32l-0.47,-1.69l-0.21,1.56l-0.66,-1.02l-1.29,0.7l-0.03,-1.24l-1.08,0.8l-1.79,-2.71l1.39,-0.7l4.07,0.13l-1.39,-4.62l-1.02,0.19l0.21,-1.08l-1.31,-0.64l0.29,2.01l-2.02,0.89l0.47,2.07l-1.42,1.02l-0.71,-0.73l0.03,1.4l-1.55,-0.92l0.03,-3.22l-1.65,-0.25l-0.31,-0.16l-1.63,0.32l-0.58,-0.6l-0.42,0.83l-2.02,0.19l0.79,1.27l-0.18,3.7l-1.89,-0.16l-0.66,-1.4l-0.21,1.21h-0.74l-0.68,-1.21l-1.6,0.57l-0.87,1.56l-1,-1.85l-1.05,0.26l-0.73,-1.02l1.68,-1.31l-4.25,-0.06l-3.44,-1.94l-0.94,-2.04l2.18,-2.33l-1.34,-2.08l1.02,-2.33l-0.42,-0.8l-0.73,0.64l-0.16,-0.51l1.29,-5.46l1.16,-0.99l-0.63,-0.32l-2.02,1.53l-1.18,4.66l-1.42,-0.73l1.18,-0.64l-0.24,-0.7l-0.73,0.86l-2.05,-0.93l-0.89,1.34l1.92,-0.35l1,2.81l1.13,0.26l-1.05,3.35l-0.97,-1.59l-1.47,2.11l-1.13,-2.17l-2.18,1.47l0.5,0.86l-1.5,-0.54l0.37,-0.83l-0.87,-0.41l0.76,-0.22l0.08,-1.24l-1.55,-1.44l-0.6,3.83h-0.92l0.4,1.25l-1,0.13l-0.31,1.34l-1.84,1.34l-2.94,0.19l-0.24,-1.53l-0.58,0.38l-0.55,-0.86l-0.42,2.1l-1.72,-0.25l-0.09,0.41l-2.24,-8.23l0,0l-1.74,-1.33l0,0l-3.56,-3.8l0,0l-1.09,-1.05l0,0l-0.19,-2.9l-6.56,-6.46l-0.91,-9.22l-2.66,-2.99l0.8,-2.26l0,0l0.23,-0.2l0,0l2.22,-2.31l-0.55,-2.87l1.16,-3.15l3.7,-3.57l0,0l0.46,-4.01l-1.63,-0.43l-0.69,-1.93l0.69,-3.34l-1.27,-2.27l0,0l-0.42,-2.91l0,0l-2.77,-1.37l-0.17,-2.32l5.22,-14.41l0,0l0.89,-0.8l0.16,-1.92l0,0l0.78,-4.82l4.94,-4.74l1.66,-4.08l0,0l0.65,-0.47l0,0l2.02,0.44l1.83,-1.15l0,0l1.46,-0.01l3.11,-1.88l2.05,-4.62l2.33,-1.51l0.13,1.94L240.35,406.64zM325.68,498.1l0.5,1.44l1.02,-0.29l0.47,1.76l-1.63,3.42l0.66,0.8l-1.31,1.85l0.26,-0.6l-1.1,-0.96l0.82,-1.21l-2.05,-0.89l0.94,-0.8l-1.78,-3L325.68,498.1zM312.55,502.25l0.71,-0.64l1.31,0.51l0.89,1.47l-0.87,1.66l-1.05,-0.1l0.5,1.05l-1.37,0.06l0.79,0.51l-0.39,2.23l1.94,0.93l0.97,2.93l-0.87,-0.09l0.55,2.93l-1.26,0.22l0.63,1.31l-1.99,1.15l-0.05,1.05l1.45,0.29l-0.1,0.89l1.86,-2.23l0.97,0.57l-0.1,0.73l0.45,1.24l-0.66,0.7l-1.21,-0.29l1.16,2.39l-1.13,0.28l-0.58,-0.99l-1.6,1.05l0.66,1.43l0.87,-1.02l0.74,0.54l-0.6,1.08l2.02,4.14l-2.89,-0.86l0.55,-0.8l-0.76,-1.37l-1.16,1.91l-0.68,-0.19l0.21,-1.24l-2.07,-0.45l-0.24,2.29l0.71,0.86l-1.44,1.27l-1.18,-0.44l-0.73,1.78l1.39,2.39l2.71,0.19l-0.47,1.4l-1.94,-1.34l-2.49,1.02l-0.18,-0.7l-0.47,0.76l1.66,1.43l-0.16,0.92l-1.21,-0.48l-1.5,1.46l-1.81,-0.92l-1.29,0.76l0.79,-2.29l2.07,-0.98l-2.84,-1.11l0.21,-2.45l2.05,-0.16l-0.86,-0.76l0.5,-0.86l-2.13,-0.06l-1.24,1.4l-0.84,-1.08l1.42,-1.4l-1,-0.16l-1.39,1.56l0.24,-1.05l-0.66,-0.38l4.39,-1.18l0.03,-2.29l0.97,-1.62l-0.71,0.19l-1,-1.53l1.05,0.32l0.03,-0.7l-1.44,-0.83l-0.81,2.48l-3.31,-0.03l-0.1,1.37l-0.76,-0.25l0.37,0.92l-1.26,0.73l-0.94,-1.69l0.68,-0.86l-2.47,-1.08l-0.89,-3.73l1.89,-3.15l0.82,-0.06l-0.39,-0.7l0.81,0.35l-0.47,-0.8l1.44,0.19l0.92,-1.56l3.86,2.81l0.92,-0.16l-0.55,-0.92l1.44,-0.77l3.73,2.61l-0.58,-2.84l-1,0.29l0.26,-1.05l-2.42,-2.26l1.89,-3.09l-0.03,1.37l2.6,-0.35l-0.03,-0.64l1.63,1.05l-0.16,-1.66l1.08,-1.12l-0.55,-0.73l1.05,-0.26l-0.5,-0.8l1.08,-0.13l0.26,-0.29l0.73,-0.73l-1.31,0.13l0.76,-3l0.89,-0.13L312.55,502.25zM308.56,503.27l0.47,1.25l-0.81,3.61l-1.73,0.38l-0.5,-0.7l-1.15,1.08l0.21,-1.4l1.37,-0.83l-0.89,-0.77l1.58,-0.03l-0.23,-1.12L308.56,503.27zM237.11,511.92l2.21,1.27l0.18,-0.8l0.63,0.29v5.58l-2.23,0.83l-0.34,1.5l1.63,2.68l-0.58,0.92l3.18,1.43l0.16,2.13l1.71,0.26l-0.34,-0.86l2.94,-2.07l3.73,-0.29l1.47,1.4l1.42,0.1l0.47,2.32l-1.18,0.06l0.47,0.96l-0.76,1.21l0.87,3.53l-2.34,3.02l2.49,1.78L249.01,540l0.66,-1.94l-0.94,-0.6l-0.79,0.29l0.08,1.08l-1.52,-0.19l-0.34,-0.83l-0.47,1.43l-2.57,-0.06l-1.23,-4.29l0.63,-3.53l-4.36,1.34l0.71,3.69l-2.13,1.34l-2.99,-0.64l0.42,-0.73l-1.08,-0.41l0.18,-1.21l-1.5,-0.1l0.37,-2.13l1.08,-0.25l-1.71,-2.96l0.24,-1.43l-2.18,-2.9l-0.58,-2.83l1.05,-1.97l0.97,-0.06l0.08,-2.13l1.18,-1.4l0.39,0.61l1.65,-0.22l-0.97,-1.27l0.11,-1.56l1.08,-0.38l0.42,-1.24L237.11,511.92zM250.06,514.69l-1.92,6.37l1.29,0.29l-0.13,-2.07l1.31,-1.75l1,0.13l0.21,1.59l0.6,-0.26l1.08,1.31l-0.13,1.4l-1.1,1.05l0.76,-0.32l-0.13,1.18h1.45l1.08,1.94l-1.37,-0.86l-0.73,0.6l-0.97,-0.95l-0.79,0.32l-2.28,-1.53l-0.31,1.21l-1.39,0.32l-3.28,-0.89l-0.55,-3.22l1.31,-0.83l2,-3.76L250.06,514.69zM266.13,521.83l3.07,1.78l-2.49,0.22l-2.02,2.04l-0.13,-1.31l-1.29,-0.32l-0.29,-1.34L266.13,521.83zM269.59,524.03l2.76,2.87l-0.55,0.8l-2.02,-0.19l0.26,1.88l-4.02,-2.71l0.16,-0.8l1.21,0.38l-0.66,-0.6l0.87,-1.24L269.59,524.03zM292.99,526.7l-0.6,0.7h0.89l0.55,3.44l1.21,-0.25l0.55,0.83l-0.32,1.18l-1.89,1.11l-2,-0.44l0.58,-1.15l-1.34,-1.78l0.24,-2.29l0.47,1.78l0.76,-0.38l-0.16,-1.05l-0.71,-0.86l0.29,-0.83H292.99zM270.38,545.6l2.86,1.56l-1,0.7l0.95,0.95l0.95,-1.65l1.34,-0.03l-0.92,2.29l-2.49,-0.86l-1.76,0.92l-0.16,0.92l-0.89,-0.16l-0.26,-0.57l1.13,-0.7l-0.79,-0.57l0.26,-0.76l-0.87,0.51l-0.45,-0.73l1.1,-0.38l-0.68,-0.98L270.38,545.6z"},{"code":"KR-JJ","name":"Jeju","path":"M148.46,643.64l0.68,0.78l-0.45,0.6l1.45,-0.09l-0.68,2.92l-2.07,-0.5l-0.45,-1.44L148.46,643.64zM143.84,658.77l-3.15,2.28l-0.47,2.03l-2.47,2.48l0.16,1.44l-1.31,1.47l-5.07,-0.09l-3.12,3.25l-9.01,1.12l-2.76,2.94l-1.81,0.69l-1,-0.91l-1.71,-0.06l-0.52,1.28l-1.47,-0.87l-2.15,0.19l-5.3,1.66l-1.84,-1.84l-2.34,0.63l-1.86,-1l-3.31,1.5l-4.23,-1.12l-3.1,2.03l0.03,2.97l-1.39,-0.5l-0.95,0.62l-0.89,-0.59l0.24,-1.12l-0.84,-0.03l-2.13,-2.87l-4.88,-2.84l-1.84,-3l0.58,-3.31l-0.58,-1.81l1.79,-1.47l0.03,-1.41l2.76,-1.78l1.18,-1.81l1.21,0.19l2.18,-2.5l0.45,-2.82l4.2,-1.69l0.45,-1.97l5.38,-1.03l1.66,-1.35l1.18,0.75l7.9,-3.07l1.08,-1.22l2.02,0.6l2.42,-0.97l4.31,-0.09l0.79,-1.16l3.7,-0.25l1.1,-2.01l1.89,1.51l1.1,-1.13l4.65,-0.91l3.18,0.38l0.24,-0.94l3.33,1.13l2.76,-0.5l1.31,3.01l1.76,0.94l1,-0.63l3.26,1.03l-0.42,1.32h1.02l0.34,0.94l-1.16,2.16l1.81,1.44l1.34,-0.5l1.08,1.69l-0.47,0.56l-1,-0.66l-0.81,1.22l-0.1,1.03l1.5,1.1l-0.73,0.88l-1.23,-1.31L143.84,658.77z"},{"code":"KR-SE","name":"Sejong","path":"M176.14,312.59L173.45,310.97L171.97,309.35L169.4,308.54L166.71,309.62L166.3,311.38L167.38,313.4L167.92,315.42L168.19,318.52L167.52,320.95L167.79,324.32L167.92,327.82L167.92,330.92L166.84,333.35L166.98,335.37L168.86,337.93L171.56,339.41L172.91,343.32L173.18,346.15L173.04,350.2L174.26,353.3L176.01,354.65L177.72,356.7L179.9,354.21L179.59,345.47L186.45,343.29L187.41,337.15L186.79,336.29L185.68,336.48L185.11,337.26L186.97,331.16L185.89,330.02L186.81,326.74L183.47,326.54L183.02,325.19L183.02,322.38L180.21,318.95L182.4,318.32L182.71,315.51L181.15,313.33L178.71,313.53z"}]; + tuiChart.registerMap('south-korea', data); +})(tui.chart); diff --git a/dist/maps/taiwan.js b/dist/maps/taiwan.js new file mode 100644 index 000000000..40c06386d --- /dev/null +++ b/dist/maps/taiwan.js @@ -0,0 +1,10 @@ +/** + * https://www.amcharts.com/svg-maps/?map=taiwan + * map data by amcharts team + */ +'use strict'; + +(function(tuiChart) { + var data = [{"code":"TW-LCG","name":"Lienchiang","path":"M368.13,96.5L367.26,96.77L367.14,97.52L365.19,97.09L363.28,101.53L365.09,100.55L366.44,99.9L368,98.3L368.13,96.5zM358.84,95.81L360.35,94.95L358.2,93.84L355.43,94.81L357.25,97.52L358.84,95.81zM356.34,52.71L354.61,52.09L354.37,51.47L354.41,50.4L353.58,50.52L352.76,52.12L352.37,54.28L352.98,56.17L354.96,57.5L356.27,57.29L360.57,55.04L362.81,52.54L362.76,51.07L360.61,51.09L357.15,53.1L356.34,52.71zM373.11,38.78L372.64,38.12L371.96,37.71L370.92,36.15L368.96,35.86L367.23,36.92L366.67,37.62L364.62,38.29L363.73,38.84L363.33,40.1L362.98,43.46L363.35,44.68L364.2,45.22L365.16,41.25L366.32,39.96L367.33,39.69L368.1,40L369.95,39L370.82,39.59L371.96,41.25L372.97,42.13L373.04,41.44L372.64,40.53L372.94,39.74L373.11,38.78zM471.57,0L469.82,1.43L469.1,1.86L469.5,2.95L468.65,4.3L469.57,4.81L470.07,5.1L471.02,5.27L471.27,5.67L472.12,4.03L472.66,3.31L473.22,2.98L473.67,3.17L474.11,3.29L475,2.95L474.11,2.19L473.62,1.17L471.57,0z"},{"code":"TW-KNM","name":"Kinmen","path":"M6.83,451.66L7.79,451.13L8.24,450.19L9.11,449.27L10.37,449.17L11.45,447.54L11.48,445.09L10.17,443.66L8.66,442.59L7.01,442.63L5.37,443.06L4.33,444.13L0.39,451.93L2.71,452.86L6.83,451.66zM50.07,430.63L44.5,425.54L38.64,426.74L36.81,431.02L35.99,437.89L30.5,438.56L22.62,433.39L16.68,436.32L15.48,437.02L15.67,438.68L17.03,441.95L17.6,445.35L17.68,447.29L17.53,448.9L16.99,449.89L15.28,452.06L14.96,452.65L15.87,454.28L17.73,455.1L19.85,455.24L22.94,456.71L25.58,455.36L28.63,450.58L34.23,447.04L40.58,446.4L44.56,447.69L49.9,451.05L52.91,447.42L53.74,440.54L50.07,430.63zM261.51,322.57L262.18,320.87L262.01,319.37L260.65,319.17L258.77,320.31L258.26,322.75L259.29,323.7L261.51,322.57z"},{"code":"TW-PEN","name":"Penghu","path":"M251.46,726.5L252.72,724.74L253.66,723.86L253.88,722.58L253.74,720.94L251.61,720.34L248.63,721.37L247.88,722.34L249.05,726.05L250.08,727.21L251.46,726.5zM250.57,717.1L249.14,714.67L246.62,714.27L245.68,715.14L245.88,717.1L247.47,719.01L249.22,719.53L250.57,717.1zM288.91,714.57L289.53,714.57L289.57,714.5L290.47,714.41L290,713.72L290.17,713.41L289.8,712.84L289.38,712.81L289.15,712.9L287.87,713.02L287.99,713.37L287.65,713.5L288.49,714.54L288.51,714.58L288.52,714.58L288.56,714.62L288.91,714.57zM289.83,712.67L289.9,712.52L289.68,712.11L289.53,712.67L289.83,712.67zM299.83,710.97L299.81,711.13L299.75,711.13L299.6,712.56L300.02,713.58L300.45,714.75L300.45,714.74L300.47,714.75L301.06,713.29L301.9,712.14L301.6,711.96L301.9,711.13L300.12,711.13L299.83,710.97zM298.39,710.55L297.8,711.14L297.45,711.15L297.7,711.26L297.61,711.34L298.03,711.39L298.44,711.55L298.44,711.13L298.25,711.13L298.39,710.55zM267.82,709.37L267.34,708.6L266.41,710L267.82,709.37zM231.75,698.99L231.68,698.58L231.45,698.53L231.16,698.67L231.38,699.01L231.39,699L231.5,699.12L231.75,698.99zM228.69,697.75L228.62,697.36L228.52,697.24L228.12,697.44L228.34,697.78L228.44,697.89L228.69,697.75zM231.78,697.63L231.16,697.21L231.45,698.41L231.73,698.44L231.78,697.63zM273.54,687.69L273.7,686.7L272.53,685.98L271.3,686.24L270.71,686.68L269.87,687.84L269.57,688.9L269.87,689.18L272.23,687.82L272.85,687.85L273.54,687.69zM266.93,682.46L266.48,681.98L265.97,681.86L263.84,678.98L262.55,679.26L260.95,683.24L261.4,685.05L262.97,684.58L263.66,684.1L263.86,687.38L262.73,689.82L263.96,690.36L266.45,690.6L267.59,690.15L267.22,689.35L267.15,688.63L268.04,687.71L268.56,686.5L268.02,685.97L267.4,685.52L267.02,684.3L266.93,682.46zM228.1,677.95L227.93,678.25L227.8,678.27L226.99,680.02L227.6,680.41L227.6,680.5L227.83,680.88L229.5,680.45L229.97,679.72L229.71,678.87L229.93,678.46L228.91,678.08L228.64,678.13L228.1,677.95zM274.06,658.51L273.89,658.5L273.94,658.48L271.99,658.08L270.21,658.95L270.18,658.99L269.94,659.08L269.13,659.43L268.86,659.65L267.42,659.22L267.02,659.57L266.95,659.52L267,659.6L266.88,659.69L267.15,661.11L267.89,661.22L267.91,661.21L268.11,661.54L269.91,660.61L270.98,660.22L271.52,660.17L271.77,659.94L272.07,659.85L274.06,658.51zM289.33,636.53L290.3,633.05L286.66,634.31L280.83,637.96L279.18,637.54L277.77,637.54L277.59,640.67L277.77,643.83L278.59,643.4L278.74,643.26L278.74,643.01L279.18,642.29L280.29,644.01L281.52,645.27L283.03,646.19L284.94,646.91L282.17,649.17L278.79,650.1L275.65,649.43L273.55,646.91L272.54,648.89L276.36,652.7L280.16,654.16L283.95,653.63L287.62,651.51L288.15,650.55L288.99,647.35L289.6,646.2L290.69,645.59L292.89,645.33L295.98,643.59L298.2,644.03L300.22,645.35L301.73,646.91L302.18,644.56L301.18,641.39L297.5,634.59L296.24,636.71L294.47,636.84L292.05,636.58L288.89,637.54L289.33,636.53zM257.98,643.83L258.93,643.04L259.94,642.57L261.15,642.35L262.87,642.29L265.24,641.9L265.47,640.84L264.93,639.33L265.03,637.54L267.2,630.91L268.56,628.08L270.53,626.9L267.22,624.02L264.76,626.44L262.21,634.59L262.16,638.34L261.67,639.94L259.96,640.6L257.98,640.75L256.51,641.2L255.56,642.19L255.05,643.83L257.98,643.83zM284.52,629.8L285.67,627.98L284.89,625.23L286.81,623.37L285.75,621.06L283.23,618.9L280.66,617.53L276.29,620.74L279.7,624.14L281.26,626.42L281.94,629.14L282.81,630.3L284.52,629.8zM286.62,605.89L288.15,604.01L289.92,603.01L290.24,601.6L288.25,600.48L288.19,600.2L287.87,599.68L287.4,600.38L286.56,602.04L285.21,603.14L285.57,603.91L285.36,604.26L286.24,606.35L286.29,606.3L286.37,606.64L286.62,605.89z"},{"code":"TW-TTT","name":"Taitung","labelCoordinate":{"x":0.4,"y":0.3},"path":"M701.71,1004.06L700.79,1003.28L700.15,1004.37L701.06,1005.14L701.71,1004.06zM697.98,990.66L698.24,988.51L696.62,986.57L692.99,983.8L692.29,981.82L692.56,979.56L693.23,977.67L693.63,976.81L693.63,975.44L678.24,975.44L679.64,977.09L680.43,978.92L680.46,980.92L679.54,983.04L682.61,985.93L687.92,989.69L693.7,992.01L697.98,990.66zM679.13,851.24L678.85,849.96L679.13,848.65L679.84,847.39L680.46,844.3L679.89,842.79L679.01,842.28L671.12,842.86L670.68,843.33L671.77,846.65L673.99,850.5L676.06,851.33L676.41,851.76L677.12,851.93L678.48,851.93L679.08,852.09L679.13,851.24zM655.44,745.43L659.25,737.61L660.03,730.02L659.93,722.05L661.07,713.1L662.7,708.27L664.77,704.44L670.31,697.05L672.08,693.22L675.65,672.48L672.91,671.69L664.46,675.78L661.43,680.06L662.75,685.46L663.22,690.85L660.36,696.24L657.72,700.33L655.58,705.53L653.7,712.13L650.8,718.17L647.05,728.57L644.57,733.31L644.66,738.6L643.93,743.47L638.85,746.4L632.41,745.47L623.19,737.9L615.98,725.32L611.54,724.11L606.59,723.42L602.66,719.66L597.84,717.43L591.73,715.2L587.77,708.83L586.89,703.04L574.62,706.05L569.54,709.25L566.43,712.32L560.32,716.27L559.64,720.77L561.39,725.46L559.3,729.31L553.49,732.47L552.81,737.86L554.52,745.65L552.13,756L552.09,764.81L548.71,769.4L542.01,775.1L540.18,782.75L541.25,789.15L543.59,792.76L548.42,797.76L549.4,801.65L546.37,802.02L549.06,807.21L549.65,811.01L553.84,812.03L558.19,814.9L556.01,825.73L555.88,829.8L554.31,833.69L546.67,836.93L542.91,839.06L536.89,840.35L532.67,843.87L530.79,849.05L527.89,854.22L525.5,860.1L524.86,871.65L525.84,876.78L527.42,881.54L528.23,887.13L528.23,891.33L530.28,895.26L533.95,899.64L531.99,902.64L527.8,905.14L526.18,908.18L525.75,911.78L527.89,914.83L530.58,916.12L533.01,919.63L532.92,924.1L533.35,928.85L535.91,933.51L539.5,937.34L547.52,941.03L551.05,940.77L550.84,929.26L552.16,916.61L553.23,912.14L560.72,899.01L564.49,885.86L565.97,876.21L568.52,871.52L574.84,863.63L576.89,859.67L580.99,849.13L582.65,846.97L584.72,845.88L593.22,836.56L605.86,828.12L609.55,824.61L613.28,819.87L614.96,817.11L615.94,814.6L616.07,812.41L615.57,807.48L615.94,805.41L618.53,802.42L629.43,793.18L630.44,791.04L638.5,779.41L640.17,774.79L642.49,764.53L646.25,757.9L647.56,753.34L648.38,751.56L650.05,749.84L653.81,747.1L655.44,745.43z"},{"code":"TW-YUN","name":"Yunlin","labelCoordinate":{"x":0.5,"y":0.4},"path":"M426.52,585.04L420.55,581.6L420.55,581.6L419.89,582.87L415.5,586.23L414.9,587.42L414.09,589.56L409.25,595.96L408.26,598.31L406.43,605.2L405.45,613.08L402.03,619.1L399.83,626.8L399.27,636.44L399.44,649.35L395.84,653.39L396.58,653.35L396.69,653.26L404.97,652.33L411.5,656.01L416.24,656.06L419.36,653.59L420.68,649.73L422.3,647.4L426.48,646.75L431.95,642.28L435.45,640.41L438.43,637.43L451.24,630.03L456.87,628.49L466.77,626.63L472.19,626.35L476.33,629.98L480.26,634.59L490.16,638.23L493.06,637.81L499.59,635.94L503.31,638.55L505.18,641.67L510.13,641.16L519.35,639.3L522.43,638.27L522.43,635.57L522.72,631.66L523.11,631.7L521.06,628.91L514.57,629.61L509.24,631.24L504.67,629.24L501.56,625.56L502.28,621.04L503.77,616.98L502.96,610.97L503.77,605.33L505.35,601.65L503.86,595.93L503.05,596.49L493.64,594.62L489.07,594.69L479.52,589.96L464.04,588.21L454.94,584.73L449.7,583.3L443.78,582.99L426.52,585.04z"},{"code":"TW-TXQ","name":"Taichung City","path":"M546.22,479.04L537.12,473.79L532,472.86L526.19,470.05L514.36,461.3L509.43,456.99L505.71,453.06L498.47,441.87L488.04,453.45L485.42,457.76L483.2,465.55L475.89,478.23L473.75,487.9L472.01,492.93L469.42,495.1L468.83,497.69L468.34,498.27L468.34,498.27L472.92,499.76L476.05,502.51L478.15,507.49L478.96,513.45L482.48,517.73L491.81,520.47L495.2,523.27L497.72,527.2L499.29,530.32L499.33,533.43L500.3,536.07L503.65,536.67L507.94,539.47L507.95,540.57L511.26,540.69L525.38,542.68L528.68,542.15L532.58,538.42L538.53,527.11L541.43,520.47L546.45,518.06L554.4,519.22L559.13,519L563.65,512.98L566.01,511.49L573.06,516.73L575.79,516.01L577.85,511.74L581.52,508.65L586.73,508.75L590.66,507.25L596.86,501.26L600.84,499.01L604.3,498.36L611.24,494.71L616.09,494.52L620.99,493.74L629.72,490.28L633.39,490.03L637.08,490.87L647.57,491.84L647.58,491.84L649.78,490.27L650.74,488.68L653.42,487.28L655.81,484.35L656.83,480.29L659.19,476.42L665.12,472.68L666.97,467.83L667.31,464.56L670.95,460.74L666.37,457.05L662.53,457.05L658.77,458.83L655.7,459.31L652.78,457.3L649.33,455.31L645.47,454.46L644.33,451.56L644.86,447.18L641.99,446.4L639.77,445.8L631.47,446.58L630.86,447.01L627.94,449.06L626.52,453.46L622.7,455.06L618.52,454.96L615.19,457.3L611.6,460.77L606.99,463.3L597.89,470.55L592.48,472.76L585.55,476.48L581.28,474.8L577.37,470.45L572.63,468.55L564.89,467.96L560.56,470.55L559.88,476.32L555.78,478.54L546.22,479.04z"},{"code":"TW-NAN","name":"Nantou","path":"M647.57,491.84L637.08,490.87L633.39,490.03L629.72,490.28L620.99,493.74L616.09,494.52L611.24,494.71L604.3,498.36L600.84,499.01L596.86,501.26L590.66,507.25L586.73,508.75L581.52,508.65L577.85,511.74L575.79,516.01L573.06,516.73L566.01,511.49L563.65,512.98L559.13,519L554.4,519.22L546.45,518.06L541.43,520.47L538.53,527.11L532.58,538.42L528.68,542.15L525.38,542.68L511.26,540.69L507.95,540.57L507.97,543.4L504.61,544.58L503.65,546.89L504.09,550.07L502.5,553.62L501.22,557.88L501.14,562.33L500.23,567.52L499.55,578.04L501.14,582.99L504.01,585.6L507.06,586.72L511.44,588.93L510.7,591.7L507.68,592.91L505.7,594.69L503.86,595.93L505.35,601.65L503.77,605.33L502.96,610.97L503.77,616.98L502.28,621.04L501.56,625.56L504.67,629.24L509.24,631.24L514.57,629.61L521.06,628.91L523.11,631.7L527.89,632.22L533.18,634.27L536.42,635.2L540.48,637.39L540.18,641.53L537.83,645.58L538.81,649.35L540.9,654.47L541.2,659.03L542.06,662.06L548.03,663.13L568.13,663.27L568.84,663.44L572.27,664.25L576.84,666.01L580.13,670.57L580.64,672.15L585.38,669.46L587.79,667.22L586.45,662.36L587.65,660.27L588.81,657.08L592.89,654.07L598.69,652.77L604.5,652.58L608.66,648.86L609.72,642.15L612.82,638.12L618.84,635.94L622.34,633.46L623.62,629.49L626.11,619.55L627.08,612.99L626.35,607.36L625.41,603.07L622.93,599.91L621.25,596.76L625.72,589.4L625.89,586.47L627.88,580.94L630.89,574.28L633.31,567.4L634.53,559.59L635.01,553.64L633.62,550.12L631.98,547.51L633.86,541.53L637.83,533.15L644.12,524.95L644.33,521.96L643.16,518.38L639.09,515.73L636.85,513.33L636.64,505.5L639.55,503.25L644.77,501.51L648.84,499.61L648.65,496.77L647.57,491.84z"},{"code":"TW-HUA","name":"Hualien","path":"M701.45,470.3L696.32,470.27L689.84,467.8L678.01,464.8L672.91,462.33L670.95,460.74L667.31,464.56L666.97,467.83L665.12,472.68L659.19,476.42L656.83,480.29L655.81,484.35L653.42,487.28L650.74,488.68L649.78,490.27L647.58,491.84L647.57,491.84L648.65,496.77L648.84,499.61L644.77,501.51L639.55,503.25L636.64,505.5L636.85,513.33L639.09,515.73L643.16,518.38L644.33,521.96L644.12,524.95L637.83,533.15L633.86,541.53L631.98,547.51L633.62,550.12L635.01,553.64L634.53,559.59L633.31,567.4L630.89,574.28L627.88,580.94L625.89,586.47L625.72,589.4L621.25,596.76L622.93,599.91L625.41,603.07L626.35,607.36L627.08,612.99L626.11,619.55L623.62,629.49L622.34,633.46L618.84,635.94L612.82,638.12L609.72,642.15L608.66,648.86L604.5,652.58L598.69,652.77L592.89,654.07L588.81,657.08L587.65,660.27L586.45,662.36L587.79,667.22L585.38,669.46L580.64,672.15L582.13,676.71L579.78,680.62L575.39,682.57L574.32,685.08L575.09,688.2L579.44,691.03L584.44,695.08L586.61,701.07L586.89,703.04L587.77,708.83L591.73,715.2L597.84,717.43L602.66,719.66L606.59,723.42L611.54,724.11L615.98,725.32L623.19,737.9L632.41,745.47L638.85,746.4L643.93,743.47L644.66,738.6L644.57,733.31L647.05,728.57L650.8,718.17L653.7,712.13L655.58,705.53L657.72,700.33L660.36,696.24L663.22,690.85L662.75,685.46L661.43,680.06L664.46,675.78L672.91,671.69L675.65,672.48L675.65,672.48L684.32,622.15L688.1,614.45L694.41,583.03L699.4,569.62L701.92,556.85L702.22,551.81L702.82,549.07L705.7,544.57L706.55,541.73L706.5,539.19L705.85,538.11L704.82,537.29L703.63,535.55L702.22,531.44L702.07,527.74L703.23,524.29L709.06,515.74L711.31,506.17L713.51,501.43L715.48,499.54L720.72,495.58L721.37,494.4L720.82,492.74L721.98,491.19L725.61,488.29L730.53,481.48L735.1,477.02L736.19,475.14L736.04,474.3L735.49,473.14L734.78,471.97L734.26,471.38L734.26,471.38L733.41,471.36L724.67,470.05L710.14,461.37L707.15,462.05L705.32,466.74L701.45,470.3z"},{"code":"TW-CYI","name":"Chiayi City","path":"M464.04,670.2L469.38,668.06L472.92,667.6L475.27,665.87L473.26,660.52L471.34,657.41L468.14,655.68L463.74,654.01L457.55,654.57L450.26,655.82L447.31,659.03L447.99,663.46L452.77,665.36L458.28,668.9L464.04,670.2z"},{"code":"TW-CYQ","name":"Chiayi","labelCoordinate":{"x":0.7,"y":0.5},"path":"M391.96,700.38L393.15,697.89L394.28,696.38L394.19,695.53L393.69,695.11L392.87,696.31L392.13,698.13L390.28,700.56L390.57,701.42L391.96,700.38zM393.74,690.44L395.05,688.1L395.44,686.65L394.73,686.95L393.15,689.9L392.98,691.33L393.74,690.44zM397.59,683.37L397.94,682.51L397.89,680.25L397.52,679.92L397.52,683.38L397.59,683.37zM398.65,675.76L398.58,675.74L398.6,675.71L397.67,675.46L398.08,677.04L398.18,676.8L398.24,677.08L398.65,675.76zM397.64,670.97L397.47,670.91L397.52,670.71L396.23,670.38L396.43,670.71L397.24,672.05L397.64,670.97zM374.22,671.77L377.74,668.97L380.07,667.33L383.04,664.36L385.35,661.54L388.83,658.03L395.94,646.54L393.98,647.11L385.65,657.71L374.7,668.78L371.76,673.07L374.22,671.77zM480.26,634.59L476.33,629.98L472.19,626.35L466.77,626.63L456.87,628.49L451.24,630.03L438.43,637.43L435.45,640.41L431.95,642.28L426.48,646.75L422.3,647.4L420.68,649.73L419.36,653.59L416.24,656.06L411.5,656.01L404.97,652.33L396.69,653.26L396.58,653.35L395.84,653.39L396,660.24L402.71,659.82L399.52,663.96L398.82,665.94L397.45,667.58L397.14,668.93L399.52,670.1L399.52,671.64L398.01,674.5L401.29,680.82L404.16,689.02L399.95,688.98L397.05,689.18L395.12,693.62L395.15,696.21L397.08,696.3L398.54,696.66L400.28,695.4L400.93,697.89L399.82,697.52L397.27,698.66L394.24,698.87L398.36,700.42L405.32,701.45L410.99,702.89L415.9,700.7L417.86,696.8L422.39,694.01L427.59,689.97L431.26,686.2L436.09,682.62L442.19,679.88L454.14,677.64L460.8,677.27L466.43,679.13L469.59,681.04L471.21,684.34L472.58,688.34L480.34,696.29L481.11,702.19L479.75,713.34L480.98,716.92L484.53,719.66L487.47,719.7L491.7,717.8L495.62,717.29L498.53,718.17L505.1,718.93L505.1,718.91L504.33,713.71L503.18,710.13L503.31,706.28L506.12,703.49L511.5,704.05L516.11,703.58L525.75,697.82L529.25,693.64L535.53,688.85L541.54,685.46L544.87,681.5L547.69,676.16L554.31,670.85L568.84,663.44L568.13,663.27L548.03,663.13L542.06,662.06L541.2,659.03L540.9,654.47L538.81,649.35L537.83,645.58L540.18,641.53L540.48,637.39L536.42,635.2L533.18,634.27L527.89,632.22L523.11,631.7L522.72,631.66L522.43,635.57L522.43,638.27L519.35,639.3L510.13,641.16L505.18,641.67L503.31,638.55L499.59,635.94L493.06,637.81L490.16,638.23L480.26,634.59zM450.26,655.82L457.55,654.57L463.74,654.01L468.14,655.68L471.34,657.41L473.26,660.52L475.27,665.87L472.92,667.6L469.38,668.06L464.04,670.2L458.28,668.9L452.77,665.36L447.99,663.46L447.31,659.03L450.26,655.82z"},{"code":"TW-CHA","name":"Changhua","path":"M507.95,540.57L507.94,539.47L503.65,536.67L500.3,536.07L499.33,533.43L499.29,530.32L497.72,527.2L495.2,523.27L491.81,520.47L482.48,517.73L478.96,513.45L478.15,507.49L476.05,502.51L472.92,499.76L468.34,498.27L459.44,508.68L457.32,510.7L456.62,512.88L456.15,520.81L455.22,523.2L451.19,526.37L450.26,528.54L449.78,530.86L448.55,532L446.84,532.82L444.89,534.14L442.52,536.5L440.4,540.18L435.87,552.84L432.64,558.92L430.52,565.01L428.91,567.25L423.35,572.58L422.41,574.91L421.13,580.48L420.55,581.6L420.55,581.6L426.52,585.04L443.78,582.99L449.7,583.3L454.94,584.73L464.04,588.21L479.52,589.96L489.07,594.69L493.64,594.62L503.05,596.49L503.86,595.93L505.7,594.69L507.68,592.91L510.7,591.7L511.44,588.93L507.06,586.72L504.01,585.6L501.14,582.99L499.55,578.04L500.23,567.52L501.14,562.33L501.22,557.88L502.5,553.62L504.09,550.07L503.65,546.89L504.61,544.58L507.97,543.4L507.95,540.57z"},{"code":"TW-TAO","name":"Taoyuan","path":"M652.98,353.4L648.95,351.15L650.01,345.87L649.21,341.85L645.01,337.84L644.15,333.85L645.01,329.31L644.84,324.44L647.74,321.27L657.98,318.26L660.63,315.53L661.4,312.23L661.02,309.06L656.99,303.19L653.66,301.43L650.47,300.67L647.96,298.41L644.24,296.02L639.32,293.64L635.99,290.02L620.21,292.87L613.18,295.41L609.65,297.33L606.75,299.89L603.37,302L588.9,306.76L583.26,311.54L577.8,318.05L570.81,329.19L573.31,330.07L584.01,329.31L587.64,331.75L590.77,338.57L594.7,340.1L598.09,341.08L601.31,342.61L606.68,344.37L609.5,347.63L608.61,352.24L611.32,355.15L616.47,356.79L619.74,359.17L622.21,361.61L625.21,362.18L628.22,361.93L630.89,364.68L632.94,368.26L636.36,369.95L639.04,372.02L639.32,375.96L640.56,381.67L639.09,387.74L635.46,392.85L635.91,396.26L639.92,399.36L644.78,402.27L649.14,403.02L652.3,405.28L658.01,408.53L661.77,410.22L662.2,409.03L665.27,407.78L667.8,408.28L670.5,407.28L672.27,404.27L669.82,394.51L674.03,391.44L676.44,390.77L674.51,386.49L667.49,379.85L666.4,375.46L665.77,371.39L668.23,368.44L669.37,364.34L662.76,354.66L658.8,353.09L652.98,353.4z"},{"code":"TW-TPQ","name":"New Taipei City","labelCoordinate":{"x":0.4,"y":0.77},"path":"M707.97,267.4L700.1,256.3L696.57,253.66L688.09,252.65L679.43,254.63L671.89,258.48L666.73,263.15L664.23,267.74L662.6,271.79L661.98,272.51L660.48,273.22L659.05,274.4L658.36,276.53L660.77,278.03L665.32,282.65L668.16,287.11L665.44,288.22L664.21,287L663.25,284.84L661.78,282.77L659.02,281.85L656.63,281.89L654.85,282.2L653.41,282.93L648.57,286.95L644.84,288.42L636,290.02L635.99,290.02L639.32,293.64L644.24,296.02L647.96,298.41L650.47,300.67L653.66,301.43L656.99,303.19L661.02,309.06L661.4,312.23L660.63,315.53L657.98,318.26L647.74,321.27L644.84,324.44L645.01,329.31L644.15,333.85L645.01,337.84L649.21,341.85L650.01,345.87L648.95,351.15L652.98,353.4L658.8,353.09L662.76,354.66L669.37,364.34L668.23,368.44L665.77,371.39L666.4,375.46L667.49,379.85L674.51,386.49L676.44,390.77L680.98,389.5L684.82,388.06L687.8,385.49L691.68,382.76L696.91,380.23L699.97,378.07L699.64,376.47L698.84,373.97L698.73,370.71L700.23,366.82L703.96,363.68L706.95,361.9L717.19,357.73L727.77,351.39L732.64,349.89L736.6,347.06L739.02,343.11L741.58,339.88L744.48,338.35L747.24,337.38L750.85,335.08L752.13,332.1L750.17,329.31L751.28,326.99L760.04,325.2L762.92,323.29L769.51,319.77L774.19,318.79L776.8,320.27L777.41,321.15L777.41,321.15L784.23,317.77L782.65,315.77L779.73,314.3L776.42,313.41L773.6,313.11L768.1,313.95L766.44,313.19L764.37,310L762.46,303.17L761.9,299.09L762.25,296.79L763.53,293.91L760.99,292.3L733.83,285.7L733.6,295.08L733.73,297.46L736.63,300.5L736.33,302.43L734.34,303.89L731.21,305.07L727.17,304.55L718.87,301.09L716.53,299.42L713.65,296.68L711.41,293.95L710.06,291.19L707.82,288.29L707.37,286.03L709.87,284.33L715.5,281.88L718.96,279.58L718.96,279.57L717.16,278.3L716.32,277.31L716.25,275.59L717.04,274.2L717.86,273.19L717.96,272.49L716.25,272.02L713.83,272.3L711.71,272.88L710.79,273.27L707.97,267.4zM674.74,286.6L676.41,283.01L679.2,279.88L687.76,274.79L690.07,272.83L693.2,271.27L696.21,272.26L697.83,273.96L697.41,276.79L697.73,279.5L698.94,282.07L700.27,284.85L702.21,292.75L705.26,295.46L706.54,298.95L705.26,304.13L705.41,308.13L709.02,310.16L711.94,312.66L710.38,316L704.41,323.53L701.12,324.9L696.55,324.85L692.78,324L689.9,321.46L686.91,318.05L682.38,314.49L679.27,309.22L680.51,303.38L679.57,298.48L675.04,294.14L672.08,290.82L673.34,288.48L674.74,286.6zM799.61,174.24L797.67,173.06L797.96,175.38L799.61,174.24z"},{"code":"TW-TPE","name":"Taipei City","path":"M701.12,324.9L704.41,323.53L710.38,316L711.94,312.66L709.02,310.16L705.41,308.13L705.26,304.13L706.54,298.95L705.26,295.46L702.21,292.75L700.27,284.85L698.94,282.07L697.73,279.5L697.41,276.79L697.83,273.96L696.21,272.26L693.2,271.27L690.07,272.83L687.76,274.79L679.2,279.88L676.41,283.01L674.74,286.6L673.34,288.48L672.08,290.82L675.04,294.14L679.57,298.48L680.51,303.38L679.27,309.22L682.38,314.49L686.91,318.05L689.9,321.46L692.78,324L696.55,324.85L701.12,324.9z"},{"code":"TW-MIA","name":"Miaoli","path":"M564.68,384.11L561.24,382.73L559.11,379.76L555.78,377.72L550.38,375.62L550.37,375.61L550.09,376.64L547.27,378.06L546.61,379.5L545.17,384L542.24,386.96L540.11,389.87L540.86,394.18L535.22,393.1L530.83,394.26L527.22,396.93L523.93,400.37L522.85,402.29L521.96,404.36L520.47,406.02L515.16,407.6L513.95,409.7L512.69,414.61L508.05,422.8L506.32,427.19L505.63,432.37L504.17,435.54L498.47,441.87L498.47,441.87L505.71,453.06L509.43,456.99L514.36,461.3L526.19,470.05L532,472.86L537.12,473.79L546.22,479.04L555.78,478.54L559.88,476.32L560.56,470.55L564.89,467.96L572.63,468.55L577.37,470.45L581.28,474.8L585.55,476.48L592.48,472.76L597.89,470.55L606.99,463.3L611.6,460.77L615.19,457.3L618.52,454.96L622.7,455.06L626.52,453.46L627.94,449.06L630.86,447.01L630.36,443.18L626.8,437.05L624.19,434.52L623.16,431.05L619.23,427.92L609.36,430.42L605.63,430.05L600.28,430.39L594.24,432.05L591.03,431.27L591.75,427.3L592.72,423.64L591.97,420.54L591.2,418.26L591.97,415.79L592.59,413.09L592.87,410.03L592.25,405.9L589.24,403.27L579.68,398.76L574.96,395.25L571.93,391.75L568.44,383.05L568.29,383.23L564.68,384.11z"},{"code":"TW-KEE","name":"Keelung City","path":"M733.83,285.7L725,283.56L721.98,282.44L720.67,281.14L720.06,280.35L718.96,279.57L718.96,279.58L715.5,281.88L709.87,284.33L707.37,286.03L707.82,288.29L710.06,291.19L711.41,293.95L713.65,296.68L716.53,299.42L718.87,301.09L727.17,304.55L731.21,305.07L734.34,303.89L736.33,302.43L736.63,300.5L733.73,297.46L733.6,295.08L733.83,285.7z"},{"code":"TW-ILA","name":"Yilan","labelCoordinate":{"x":0.5,"y":0.65},"path":"M771.16,351.63L771.08,351.67L770.94,351.65L770.82,351.82L768.87,352.94L768.1,352.68L769.11,354.31L769.18,354.32L769.48,354.8L770.54,355.4L773.55,355.51L774.12,353.67L773.61,353.18L772.86,351.98L771.34,351.72L771.16,351.63zM758.73,408.28L752.71,407.17L747.6,404.01L744.91,399.11L744.76,392.76L745.87,389.65L746.02,386.55L743.44,374.39L743.23,368.56L743.65,362.56L744.85,356.51L746.68,351.24L749,347.46L763.67,329.57L768,325.81L777.41,321.15L777.41,321.15L776.8,320.27L774.19,318.79L769.51,319.77L762.92,323.29L760.04,325.2L751.28,326.99L750.17,329.31L752.13,332.1L750.85,335.08L747.24,337.38L744.48,338.35L741.58,339.88L739.02,343.11L736.6,347.06L732.64,349.89L727.77,351.39L717.19,357.73L706.95,361.9L703.96,363.68L700.23,366.82L698.73,370.71L698.84,373.97L699.64,376.47L699.97,378.07L696.91,380.23L691.68,382.76L687.8,385.49L684.82,388.06L680.98,389.5L676.44,390.77L674.03,391.44L669.82,394.51L672.27,404.27L670.5,407.28L667.8,408.28L665.27,407.78L662.2,409.03L661.77,410.22L659.95,415.32L658.89,419.04L659.34,422.48L656.39,427.05L645.4,438.18L641.99,446.4L644.86,447.18L644.33,451.56L645.47,454.46L649.33,455.31L652.78,457.3L655.7,459.31L658.77,458.83L662.53,457.05L666.37,457.05L670.95,460.74L672.91,462.33L678.01,464.8L689.84,467.8L696.32,470.27L701.45,470.3L705.32,466.74L707.15,462.05L710.14,461.37L724.67,470.05L733.41,471.36L734.26,471.38L734.09,471.2L733.27,469.9L733.67,468.82L734.46,467.78L734.9,466.5L735.3,461.51L735.94,458.97L736.95,457.21L737.86,455.11L737.52,449.63L737.71,447.15L743.23,440.81L748.11,437.98L750.09,436.12L749.62,433.92L748.29,431.8L747.69,429.45L748.04,427.52L752.73,424.85L753.38,420.42L752.32,415.32L750.26,411.38L751.72,410.34L753.75,409.67L756.17,409.43L758.73,409.68L758.73,408.28z"},{"code":"TW-HSZ","name":"Hsinchu","path":"M573.31,330.07L570.81,329.19L570.81,329.19L569.19,331.78L567.43,336.57L566.91,338.87L567.08,339.84L565.09,340.51L563.01,342.21L561.38,344.46L560.72,346.75L560.25,349.77L559.08,351.52L559.03,351.58L565.55,354.4L577.39,358.16L581.64,360.42L584.68,363.43L586.13,366.31L585.37,369.2L583.52,370.26L579.45,370.95L574.88,372.83L572.17,376.22L570.4,380.67L568.44,383.05L571.93,391.75L574.96,395.25L579.68,398.76L589.24,403.27L592.25,405.9L592.87,410.03L592.59,413.09L591.97,415.79L591.2,418.26L591.97,420.54L592.72,423.64L591.75,427.3L591.03,431.27L594.24,432.05L600.28,430.39L605.63,430.05L609.36,430.42L619.23,427.92L623.16,431.05L624.19,434.52L626.8,437.05L630.36,443.18L630.86,447.01L631.47,446.58L639.77,445.8L641.99,446.4L645.4,438.18L656.39,427.05L659.34,422.48L658.89,419.04L659.95,415.32L661.77,410.22L658.01,408.53L652.3,405.28L649.14,403.02L644.78,402.27L639.92,399.36L635.91,396.26L635.46,392.85L639.09,387.74L640.56,381.67L639.32,375.96L639.04,372.02L636.36,369.95L632.94,368.26L630.89,364.68L628.22,361.93L625.21,362.18L622.21,361.61L619.74,359.17L616.47,356.79L611.32,355.15L608.61,352.24L609.5,347.63L606.68,344.37L601.31,342.61L598.09,341.08L594.7,340.1L590.77,338.57L587.64,331.75L584.01,329.31L573.31,330.07z"},{"code":"TW-HSQ","name":"Hsinchu City","path":"M568.44,383.05L570.4,380.67L572.17,376.22L574.88,372.83L579.45,370.95L583.52,370.26L585.37,369.2L586.13,366.31L584.68,363.43L581.64,360.42L577.39,358.16L565.55,354.4L559.03,351.58L559.03,351.58L557.67,353.02L556.49,355.36L557.35,357.12L557.87,358.56L557.9,359.89L557.33,361.12L555.62,363.47L551.25,372.4L550.37,375.61L550.38,375.62L555.78,377.72L559.11,379.76L561.24,382.73L564.68,384.11L568.29,383.23L568.44,383.05z"},{"code":"TW-TNQ","name":"Tainan City","path":"M379.59,759.29L379.69,758.53L378,756.79L377.48,755.33L376.79,754.38L376.23,754.39L376.01,755.41L377.34,758.66L379.11,760.26L379.59,759.29zM380.01,737.62L380.2,736.68L381.27,732.65L380.97,732.63L380.8,732.52L377.68,743L377.73,743.11L380.01,737.62zM382.7,727.56L386.05,721.2L385.91,719.78L385.49,719.84L382.65,727.56L382.7,727.56zM387.71,709.94L388.26,703.64L387.86,703.51L387.37,711.79L387.46,711.87L387.71,709.94zM481.11,702.19L480.34,696.29L472.58,688.34L471.21,684.34L469.59,681.04L466.43,679.13L460.8,677.27L454.14,677.64L442.19,679.88L436.09,682.62L431.26,686.2L427.59,689.97L422.39,694.01L417.86,696.8L415.9,700.7L410.99,702.89L405.32,701.45L398.36,700.42L394.24,698.87L393,702.06L395.93,704.02L393.91,704.53L392.67,705.88L390.01,712.93L389.64,714.69L390.02,716.49L388.24,718.56L387.15,721.48L386.42,723.8L387.49,726.32L388.13,729.4L387.09,731.39L384.95,732.1L382.99,733.22L382.45,736.36L384.65,738.88L387.99,741.77L388.6,743.84L382.45,743.89L382.45,745.43L389.79,747.26L390.92,748.49L390.09,750.87L387.68,751.65L384.75,752.04L382.45,753.23L381.53,755.05L381,757.74L381.58,760.46L383.86,762.43L386.01,761.86L387.47,759.59L389.27,757.97L392.46,759.36L393.1,761.29L392.72,766.79L393.74,768.54L396.35,768.65L397.74,766.55L398.56,763.89L399.52,762.43L404.49,763.14L405.33,767.26L403.25,772.02L399.52,774.68L402.58,777.76L404.01,780.61L404.76,785.53L404.76,785.54L409.6,782.64L409.71,782.98L412.83,789.8L416.58,791.69L428.87,793.46L435.36,792.76L441.98,793.55L445.26,792.39L448.04,790.35L453.12,788.31L458.07,784.84L459.94,780.53L462.29,776.4L466.43,770.89L471.25,765.83L476.33,761.61L482.18,755.91L487.26,749.36L495.11,736L503.31,724.11L505.1,718.93L498.53,718.17L495.62,717.29L491.7,717.8L487.47,719.7L484.53,719.66L480.98,716.92L479.75,713.34L481.11,702.19z"},{"code":"TW-PIF","name":"Pingtung","path":"M446.8,914.48L446.28,914.85L444.67,914.85L442.49,917.62L442.5,917.69L441.43,919.77L442.07,922.19L442.08,922.16L442.1,922.33L444.47,920.27L445.78,919.23L446.05,918.98L448.16,917.55L448.05,917.16L448.42,916.81L447.37,915.29L447.21,914.85L447.06,914.85L446.8,914.48zM543.69,1014.98L543.94,1010.33L542.83,1003.16L542.73,996.58L545.85,993.69L548.49,991.75L550.49,987.07L551.72,981.31L551.05,940.77L547.52,941.03L539.5,937.34L535.91,933.51L533.35,928.85L532.92,924.1L533.01,919.63L530.58,916.12L527.89,914.83L525.75,911.78L526.18,908.18L527.8,905.14L531.99,902.64L533.95,899.64L530.28,895.26L528.23,891.33L528.23,887.13L527.42,881.54L525.84,876.78L524.86,871.65L525.5,860.1L527.89,854.22L530.79,849.05L532.67,843.87L536.89,840.35L542.91,839.06L546.67,836.93L554.31,833.69L555.88,829.8L556.01,825.73L558.19,814.9L553.84,812.03L549.65,811.01L549.06,807.21L546.37,802.02L546.32,802.03L542.23,801.28L538.86,801.47L532.16,806.75L527.55,802.4L521.61,795.45L515.94,796.84L510.73,801.47L500.45,796.28L493.06,799.8L488.07,805.36L481.8,807.58L467.8,806.75L466.43,810.55L465.41,816.19L463.36,822.4L463.78,827.9L463.7,835.35L459.26,852.01L459.13,857.6L461.31,863.47L461.61,869.94L455.22,886.03L455.51,886.15L457.25,887.26L461.02,890.56L464.58,893.01L472.44,896.78L475.89,899.01L476.39,900.06L477.15,902.99L478.01,903.59L478.86,903.87L481.42,905.34L487.8,910.38L489.38,912.62L492.81,920.36L497.16,925.75L498.45,927.97L514.08,968.52L513.64,970.88L511.73,973.66L511.27,976.13L511.27,984.57L510.97,987.15L510.92,988.72L511.27,990.66L515.61,997.89L514.62,1003.38L514.79,1005.22L517.68,1007.66L520.35,1008.33L522.16,1006.47L522.41,1001.28L528.63,1002.8L534.82,1005.59L540.12,1009.63L543.69,1014.98z"},{"code":"TW-KHQ","name":"Kaohsiung City","path":"M580.64,672.15L580.13,670.57L576.84,666.01L572.27,664.25L568.84,663.44L554.31,670.85L547.69,676.16L544.87,681.5L541.54,685.46L535.53,688.85L529.25,693.64L525.75,697.82L516.11,703.58L511.5,704.05L506.12,703.49L503.31,706.28L503.18,710.13L504.33,713.71L505.1,718.91L505.1,718.93L503.31,724.11L495.11,736L487.26,749.36L482.18,755.91L476.33,761.61L471.25,765.83L466.43,770.89L462.29,776.4L459.94,780.53L458.07,784.84L453.12,788.31L448.04,790.35L445.26,792.39L441.98,793.55L435.36,792.76L428.87,793.46L416.58,791.69L412.83,789.8L409.71,782.98L409.6,782.64L404.76,785.54L406.43,796.24L407.03,797.76L409.25,801.6L409.7,803.43L410.75,804.45L411.75,805.2L412.19,806.2L411.92,808.09L410.75,810.92L410.66,813.22L411.47,816.77L415.1,824.77L418.94,830.78L421.05,835.26L422.24,839.79L421.35,843.01L419.65,846.63L420.93,850.33L423.65,853.67L430.74,860.23L434.91,864.98L436.23,867.49L436.24,867.49L437.9,870.64L439.07,876.4L429.06,864.3L438.57,877.79L448.82,885.81L450.5,885.76L451.95,885.22L453.21,885.15L455.22,886.03L461.61,869.94L461.31,863.47L459.13,857.6L459.26,852.01L463.7,835.35L463.78,827.9L463.36,822.4L465.41,816.19L466.43,810.55L467.8,806.75L481.8,807.58L488.07,805.36L493.06,799.8L500.45,796.28L510.73,801.47L515.94,796.84L521.61,795.45L527.55,802.4L532.16,806.75L538.86,801.47L542.23,801.28L546.32,802.03L546.37,802.02L549.4,801.65L548.42,797.76L543.59,792.76L541.25,789.15L540.18,782.75L542.01,775.1L548.71,769.4L552.09,764.81L552.13,756L554.52,745.65L552.81,737.86L553.49,732.47L559.3,729.31L561.39,725.46L559.64,720.77L560.32,716.27L566.43,712.32L569.54,709.25L574.62,706.05L586.89,703.04L586.61,701.07L584.44,695.08L579.44,691.03L575.09,688.2L574.32,685.08L575.39,682.57L579.78,680.62L582.13,676.71L580.64,672.15z"}]; + tuiChart.registerMap('taiwan', data); +})(tui.chart); diff --git a/dist/maps/thailand.js b/dist/maps/thailand.js new file mode 100644 index 000000000..3278e34d5 --- /dev/null +++ b/dist/maps/thailand.js @@ -0,0 +1,10 @@ +/** + * https://www.amcharts.com/svg-maps/?map=thailand + * map data by amcharts team + */ +'use strict'; + +(function(tuiChart) { + var data = [{"code":"TH-KM","name":"Krung Thep Maha Nakhon (Bangkok)","path":"M217.05,457.2L219.75,457.53L220.26,456.82L222.21,458.44L228.16,459.47L240.64,457.5L240.64,457.5L240.12,463.33L239.17,464.04L242.25,466.54L240.34,468.2L237.06,474.62L237.06,474.62L232.17,473.3L226.9,473.18L226.13,477.46L223.95,476.1L222.64,477.75L218.13,476.61L218.67,474.96L216.52,473.99L215.9,476.32L213.91,476.25L214.12,480.94L211.44,480.76L210.69,481.75L209.65,480.97L208.97,484.35L209.51,488.02L209.51,488.02L206.5,488.61L206.5,488.61L207.16,484.02L205.6,484.23L203.96,479.27L201.89,478.47L201.34,472.09L201.34,472.09L200.53,465.97L200.53,465.97L201.25,467.23L210.74,468.26L212.79,467.49L213.8,466.62L213.35,465.79L215.7,464.08z"},{"code":"TH-SP","name":"Samut Prakan","path":"M209.51,488.02L208.97,484.35L209.65,480.97L210.69,481.75L211.44,480.76L214.12,480.94L213.91,476.25L215.9,476.32L216.52,473.99L218.67,474.96L218.13,476.61L222.64,477.75L223.95,476.1L226.13,477.46L226.9,473.18L232.17,473.3L237.06,474.62L237.06,474.62L243.4,476.94L242.93,477.66L243.94,478.33L241.31,481.74L240.2,481.91L240.72,483.35L240.03,484.44L238.99,483.83L237.8,488.83L236.5,488.51L236.26,489.6L236.26,489.6L221.59,486.75L218,484.07L218.93,480.65L216.74,480.17L218.67,480.97L217.6,483.63L218.28,486.48L214.78,487.73z"},{"code":"TH-NB","name":"Nonthaburi","path":"M202.24,445.78L201.4,449.93L203.48,454.25L210.25,455.68L212.76,458.07L215.46,456.76L217.05,457.2L217.05,457.2L215.7,464.08L213.35,465.79L213.8,466.62L212.79,467.49L210.74,468.26L201.25,467.23L200.53,465.97L200.53,465.97L196.83,459.16L199.1,456.27L196.91,453.1L197.88,445.07L197.88,445.07L199.32,444.06z"},{"code":"TH-PT","name":"Pathum Thani","path":"M234.59,436.89L239.12,434.77L239.25,436.86L243.19,434.86L243.19,434.86L242.82,437.36L240.68,438.52L240.67,456.5L240.67,456.5L240.64,457.5L240.64,457.5L228.16,459.47L222.21,458.44L220.26,456.82L219.75,457.53L217.05,457.2L217.05,457.2L215.46,456.76L212.76,458.07L210.25,455.68L203.48,454.25L201.4,449.93L202.24,445.78L202.24,445.78L211.23,446.05L213.84,444.89L216,445.98L219.64,444.45L220.67,444.82L220.96,443.81z"},{"code":"TH-PS","name":"Phra Nakhon Si Ayutthaya","path":"M213.4,407.12L213.71,408L216.04,407.27L216.34,408.04L219.66,408.46L219.66,408.46L217.82,412.45L219.71,413.8L219.77,415.44L224.11,415.47L224.5,413.54L225.61,413.37L231.8,414.49L231.57,416.99L229.47,417.96L231.04,419.64L230.23,425.15L232.75,426.76L231.12,431.06L234.53,431.11L234.59,436.89L234.59,436.89L220.96,443.81L220.67,444.82L219.64,444.45L216,445.98L213.84,444.89L211.23,446.05L202.24,445.78L202.24,445.78L199.32,444.06L197.88,445.07L197.88,445.07L198.16,441.99L195.64,441.7L195.35,439.24L195.35,439.24L195.39,434.06L197.05,431.24L197.03,427.27L197.98,425.88L197.42,424.07L195.77,423.56L196.07,420.41L196.07,420.41L198.32,419.34L200.63,419.94L206.6,418.47L207.2,423.02L210.05,423.4L212.72,421.92L212.56,417.42L211.27,414.64z"},{"code":"TH-AT","name":"Ang Thong","path":"M194.36,399.04L197.47,398.54L198.84,399.66L201.2,398.27L202.06,400.46L203.91,400.87L204.72,402.4L207.69,401.77L207.01,403.42L210.62,404.23L210.62,404.23L213.4,407.12L213.4,407.12L211.27,414.64L212.56,417.42L212.72,421.92L210.05,423.4L207.2,423.02L206.6,418.47L200.63,419.94L198.32,419.34L196.07,420.41L196.07,420.41L192.95,417.58L192.21,415.01L193.19,413.71L192.17,411.66L194.57,408.69L193.1,406.63L192.9,402.48L193.09,400.13z"},{"code":"TH-LO","name":"Lop Buri","path":"M271.43,344.33L272.46,350.94L271.79,358.47L272.43,361.61L272.43,361.61L272.64,367.77L270.49,367.1L271.14,371.23L273.02,374.05L274.22,381.47L274.22,381.47L270.85,381.41L269.94,384.99L268.29,386.34L265.17,386.54L263.84,390.59L262.21,388.66L261.63,389.95L259.47,390.02L256.77,391.66L252.76,391.07L251.45,392.96L252.5,395.15L250.89,395.63L252.45,396.29L251.11,397.43L250.7,399.5L246.91,396.36L244.19,396.19L243.4,397.02L243.47,400.21L244.49,401.38L242.68,402.47L239.76,400.54L237.8,400.99L235.49,398.16L232.25,398.85L229.61,397.86L227.83,401.32L225.68,401.77L223.25,404.27L219.92,403.69L221.26,406.84L219.66,408.46L219.66,408.46L216.34,408.04L216.04,407.27L213.71,408L213.4,407.12L213.4,407.12L210.62,404.23L210.62,404.23L211.97,401.99L210.9,401.01L210.57,395.91L208.39,393.47L207.73,389.26L209.32,388.44L209.2,385.07L210.77,382.58L207.49,380.59L207.49,380.59L210.32,376.63L213.19,375.47L213.07,373.67L215.36,370.81L218.9,368.64L219.07,366.57L218.08,365.44L221.8,362.16L222.4,355.63L231.07,352.21L230.95,350.06L229.31,349L230.26,348.25L230.26,348.25L232.33,348.15L234.65,351.21L239.39,351.56L242.95,353.57L244.99,355.88L244.88,357.7L248,361.03L251.14,361.13L252.63,360.13L255.55,361.92L260.25,362.35L267.03,357.62L266.96,348.52L265.93,347.47L267.39,344.74z"},{"code":"TH-SI","name":"Sing Buri","path":"M202.14,376.85L207.49,380.59L207.49,380.59L210.77,382.58L209.2,385.07L209.32,388.44L207.73,389.26L208.39,393.47L210.57,395.91L210.9,401.01L211.97,401.99L210.62,404.23L210.62,404.23L207.01,403.42L207.69,401.77L204.72,402.4L203.91,400.87L202.06,400.46L201.2,398.27L198.84,399.66L197.47,398.54L194.36,399.04L194.36,399.04L192.79,397.7L194.16,392.65L192.97,391.54L193.98,391.01L191.83,391.09L191.29,389.75L192.64,387.72L192.64,387.72L197.38,387.85L196.58,385.24L197.14,383.88L194.7,382.8L194.62,380.93L198.83,379.94L198.99,378.75z"},{"code":"TH-CN","name":"Chai Nat","path":"M185.92,355.54L188.31,356.54L188.54,357.75L192.57,359.2L195.02,362.04L196.71,364.5L199.07,371.9L202.38,374.33L202.86,376.29L202.14,376.85L202.14,376.85L198.99,378.75L198.83,379.94L194.62,380.93L194.7,382.8L197.14,383.88L196.58,385.24L197.38,387.85L192.64,387.72L192.64,387.72L188.15,390.6L186.62,388.28L181.75,387.25L181.86,390.18L176.62,391.25L171.13,390.55L169.14,388.66L160.29,387.13L159.88,386.12L159.88,386.12L160.79,384.41L164.07,382.76L163.71,380.68L165.95,377.99L162.03,373.15L162.82,372.4L160.36,369.06L160.94,367.5L160.22,365.25L164.72,362.46L168.96,362.94L171.18,364.6L176.14,363.36L181.76,364.02L182.84,365.46L185.74,361.14L184.03,358.84L184.48,358.14L186.1,358.5L184.9,356.58z"},{"code":"TH-SB","name":"Saraburi","path":"M219.66,408.46L221.26,406.84L219.92,403.69L223.25,404.27L225.68,401.77L227.83,401.32L229.61,397.86L232.25,398.85L235.49,398.16L237.8,400.99L239.76,400.54L242.68,402.47L244.49,401.38L243.47,400.21L243.4,397.02L244.19,396.19L246.91,396.36L250.7,399.5L251.11,397.43L252.45,396.29L250.89,395.63L252.5,395.15L251.45,392.96L252.76,391.07L256.77,391.66L259.47,390.02L261.63,389.95L262.21,388.66L263.84,390.59L265.17,386.54L268.29,386.34L269.94,384.99L270.85,381.41L274.22,381.47L274.22,381.47L277.08,393.94L269.19,399.38L269.03,400.83L267.22,401.29L266.64,402.77L265.53,402.23L265.38,403.56L262.08,403.07L260.85,401.17L259.2,401.99L260.96,413.17L258.74,416.15L262.72,420.59L262.72,420.59L261.62,421.19L261.83,423.95L260.6,424.08L260.67,428.02L259,428.45L258.48,429.71L257.52,430.08L256.63,428.17L254.97,427.37L252.28,427.29L250.26,425.13L250.34,429.95L245.62,433.87L243.07,432.46L243.19,434.86L243.19,434.86L239.25,436.86L239.12,434.77L234.59,436.89L234.59,436.89L234.53,431.11L231.12,431.06L232.75,426.76L230.23,425.15L231.04,419.64L229.47,417.96L231.57,416.99L231.8,414.49L225.61,413.37L224.5,413.54L224.11,415.47L219.77,415.44L219.71,413.8L217.82,412.45z"},{"code":"TH-CB","name":"Chon Buri","path":"M244.93,490.19l2.06,0.49l4.2,-3.68l-1.79,-2.81l3.35,0.33l2.33,-1.02l1.51,-2.15l6.82,2.12l7.75,7.59l3.8,0.23l0.09,1.64l1.88,1.65l2.57,-1.21l3.37,1.12l1.6,5.28l6.98,4.04l3.46,6.37l0,0l-1.46,1.96l0,0l-3.41,-0.81l-2.71,1.88l-1.63,-0.14l0.36,1.34l-1.07,2.37l-3.17,0.74l-4.11,2.8l-1.79,-1.28l-1.04,0.89l-2.81,0.02l-3.76,-3.21l-2.13,1.36l-0.02,0.98l-2.22,-1.8l-1.31,0.92l-3.73,-1.62l-0.77,2.02l1.84,0.82l-0.9,0.54l-5.85,-0.53l-2.23,2.75l1.55,0.55l0.86,1.78l-0.96,3.86l-1.88,4.03l0.16,1.6l-3.36,3.25l0.1,1.89l-2.05,4.53l0.47,2.49l0,0l-1.64,0.8l-0.35,3.39l-2.52,-0.73l-0.87,-1.23l1.17,-1.49l-0.75,-0.86l-4.68,0.51l0.82,-1.16l-1.44,-0.59l0.98,-1.23l-1.26,-0.25l-0.18,-2.49l1.59,-2.17l2.66,-0.28l1.13,-2.57l-3.88,-7.72l1.87,-1.4l-0.05,-2.14l2.44,-1.14l0.53,-2.33l-1.21,-1.95l-1.2,0.48l-0.11,-0.65l-0.22,-1.68l-0.98,-0.48l4.34,-8.2l-0.79,-4.41l-1.86,-2.45l1.96,-2.69l3.38,-1.23l0.54,-2.41l-1.14,-2.85L244.93,490.19z"},{"code":"TH-RY","name":"Rayong","path":"M245.87,546.18l-0.47,-2.49l2.05,-4.53l-0.1,-1.89l3.36,-3.25l-0.16,-1.6l1.88,-4.03l0.96,-3.86l-0.86,-1.78l-1.55,-0.55l2.23,-2.75l5.85,0.53l0.9,-0.54l-1.84,-0.82l0.77,-2.02l3.73,1.62l1.31,-0.92l2.22,1.8l0.02,-0.98l2.13,-1.36l3.76,3.21l2.81,-0.02l1.04,-0.89l1.79,1.28l4.11,-2.8l3.17,-0.74l1.07,-2.37l-0.36,-1.34l1.63,0.14l2.71,-1.88l3.41,0.81l0,0l-0.79,2.46l0.98,0.54l-0.45,1.14l1.54,3.84l2.53,-0.03l0.42,0.94l-1.42,4.39l1.18,1.26l1.5,-0.81l0.77,0.66l1.19,3.87l0.49,-1.04l0.69,1.81l-0.4,8.31l-1.35,0.51l-1.04,3.65l0,0l-2.42,-1.01l-4.12,1.02l-2.83,3.46l-3.31,-0.8l-2.12,0.48l-0.63,1.39l-7.25,-0.24l-1.59,0.88l-0.47,2.37l-6.87,-4.11l-6.57,-1.71l-6.32,-0.67L245.87,546.18z"},{"code":"TH-CT","name":"Chanthaburi","path":"M338.81,564.23l-2.25,1.87l-0.12,1.99l-2.12,2.08l-1.42,-0.95l-0.01,-1.92l-0.86,0.05l-0.26,-1.43l1.97,-0.48l-0.99,-2.42l-0.51,1.73l-1.22,-2.13l0.69,-1.66l-2.73,1.22l-0.69,-1.32l0.24,1.39l-1.14,1.14l2.17,-0.93l0.86,0.74l-1.05,1.78l1.46,-0.04l1.56,3.9l-0.13,1.1l-1.37,0.21l-6.24,-6.21l-2.85,-0.74l0.43,-0.76l-1.24,-2l-2.6,-2.54l0.19,-1.73l0.26,-0.3l1.18,-0.55l-2.06,-0.22l-0.16,3.86l-1.09,-0.17l-0.19,-1.96l-1.55,-1.58l-2.32,-1.2l-2.32,0.08l0.94,-2.82l-0.88,-1.03l-1.03,0.5l0.6,3.87l-3.67,-2.57l-0.35,-0.85l1.59,0.45l-0.17,-1.39l-1.46,-0.33l-0.08,0.86l-1.32,-3.71l-5.21,-3.47l0,0l1.04,-3.65l1.35,-0.51l0.4,-8.31l-0.69,-1.81l-0.49,1.04l-1.19,-3.87l-0.77,-0.66l-1.5,0.81l-1.18,-1.26l1.42,-4.39l-0.42,-0.94l-2.53,0.03l-1.54,-3.84l0.45,-1.14l-0.98,-0.54l0.79,-2.46l0,0l1.46,-1.96l0,0l3.59,-0.22l5.22,-4.34l1.25,-0.2l0.35,1.9l0.66,-0.95l0.53,0.64l0.97,-4.14l2.78,-0.41l2.86,-2.77l0,0l1.59,3.01l1.5,0.4l-0.43,3.23l5.41,-1.89l1.41,-4.92l1.53,2.58l2.41,-0.28l1.04,3.03l5.56,-0.15l0.35,-2.73l1.34,0.9l1.49,-2.05l1.38,1.24l0,0l-0.27,1.5l1.2,1.02l2.14,7.28l2.44,4.62l1.73,0.6l2.32,4.68l2.44,0.8l-3.01,1.64l1.02,1.18l-1.03,0.94l1.6,3.61l-0.76,2.49l2.12,2.79l0.44,2.35l-1.81,2.11l0,0l-1.14,-0.38l-1.28,1.47l-2.24,-0.1l-3.83,4.02l1.11,4.33l-0.91,0.78l2.38,2.38l-1.63,0.08l-1.58,-1.95l-1.09,0.06l-3.63,2.82l0.73,2.99l1.74,2.07l-1.47,1.99l0.38,1.7L338.81,564.23z"},{"code":"TH-TT","name":"Trat","path":"M352.01,609.81l-0.15,1.81l1.06,-0.74l1.88,1.52l0.02,2.62l-1.36,2.74l0.87,0.24l-0.61,3.15l-1.61,-1.01l-0.11,-1.19l-2.77,-0.81l1.31,-1.21l-1.43,-2.33l1.63,-7.06L352.01,609.81zM345.55,602.47l2.71,0.61l-1.57,0.89l-0.08,1.58l-1.3,-1.52l-1.62,0L345.55,602.47zM332.46,581.4l3.17,0.46l1.95,1.52l2.23,4.41l0.8,0l3.28,4.96l-0.75,1.69l-3.6,-3.34l-0.83,0.47l0.49,2.03l-2.93,-0.78l-1.53,0.57l-1.29,-1.24l0.17,-3.96l-3.03,-6.43L332.46,581.4zM338.81,564.23l-3,-2.3l-0.38,-1.7l1.47,-1.99l-1.74,-2.07l-0.73,-2.99l3.63,-2.82l1.09,-0.06l1.58,1.95l1.63,-0.08l-2.38,-2.38l0.91,-0.78l-1.11,-4.33l3.83,-4.02l2.24,0.1l1.28,-1.47l1.14,0.38l0,0l-0.82,3.28l0.89,2.39l1.45,1.09l3.22,0.08l2.52,2.6l1.86,0.27l-0.11,1.72l1.21,0.24l1.52,2.28l-0.49,0.65l2.36,2.18l1.08,-0.31l-0.59,1.68l1.27,0.23l-0.16,1.18l1.97,0.74l1.21,1.96l0.06,1.79l-2.6,0.77l-1.39,1.69l-1.49,13.15l2.15,4.39l2.39,2.51l0.68,5.64l2.33,3.83l1.19,5.29l4.74,5.95l0.41,8.18l-1.28,-7.02l-8,-11.16l0.77,-2.15l-1.24,-2.44l-0.01,-2.77l-9.32,-8.5l1.33,-1.15l-0.82,-1.46l-2.87,-1.83l-1.52,0.95l-0.82,-0.76l1.18,2.84l-1.31,0.32l0.25,4.57l1.63,1.75l0.01,1.84l-2.47,-1.08l0.24,-1.7l-1.29,-2.05l-3.62,-1.74l-0.36,-1.83l-4.98,-0.19l-3.52,-2.08l-1.41,1.31l-2.98,-1.28l0.36,-2.74l-1.89,-3.48l1.22,0.42l3.24,-1.21l2.7,-2.96l-1.11,-1.49L338.81,564.23z"},{"code":"TH-CS","name":"Chachoengsao","path":"M240.67,456.5L249.47,455.34L255.71,455.85L255.71,455.85L257.26,458.41L256.29,461.13L257.32,461.31L255.83,461.83L257.26,463.21L256.53,463.96L261.37,461.65L263.28,463L265.21,462.13L269.55,463.46L272.05,462.57L272.19,464.26L278.12,465.96L282.03,469.18L283.7,467.84L286.36,471.98L289.68,471.2L291.53,471.82L293.66,468.13L296.89,466.65L299.66,469.65L300.34,474.75L301.84,474.03L302.87,474.59L302.86,478.71L304.65,479.29L306.49,482.55L307.87,482.26L307.87,482.26L306.95,484.9L304.47,485.55L306.67,486.86L308.08,489.76L309.35,489.89L309.57,492.09L312.17,494.57L313.12,499.69L313.12,499.69L310.25,502.46L307.48,502.86L306.51,507L305.98,506.36L305.32,507.31L304.97,505.41L303.72,505.62L298.5,509.96L294.91,510.18L294.91,510.18L291.45,503.81L284.47,499.77L282.87,494.48L279.5,493.36L276.93,494.57L275.05,492.91L274.96,491.28L271.16,491.05L263.41,483.46L256.59,481.34L255.08,483.49L252.75,484.51L249.4,484.18L251.19,486.99L246.99,490.67L244.93,490.19L244.93,490.19L244.87,489.37L242.41,490.73L236.26,489.6L236.26,489.6L236.5,488.51L237.8,488.83L238.99,483.83L240.03,484.44L240.72,483.35L240.2,481.91L241.31,481.74L243.94,478.33L242.93,477.66L243.4,476.94L237.06,474.62L237.06,474.62L240.34,468.2L242.25,466.54L239.17,464.04L240.12,463.33L240.64,457.5L240.64,457.5z"},{"code":"TH-PB","name":"Prachin Buri","path":"M275.61,426.81L276.61,424.61L275.87,422.94L279.34,421.8L282.45,424.4L286.28,423.43L288.34,424.15L288.27,425.02L296.43,432.48L296.97,429.66L299.62,428.91L301.29,429.69L303.14,428.46L303.03,429.4L306.41,431.7L308.67,430.88L310.31,432.87L311.18,431.69L313.54,432.09L313.82,433.75L310.57,436.23L313.24,437.11L311.69,438.02L321.06,443.32L321.06,443.32L320.57,446.6L317.06,448.47L316.64,450.97L310.66,452.18L309.51,453.18L310.58,458.28L307.94,458.22L307.42,461.82L309.05,463.8L308.84,466.48L310.33,467.44L309.97,469.92L308.4,470.74L309.93,471.83L309.9,477.86L310.79,479.96L310.18,479.66L309.7,481.24L307.93,480.88L307.87,482.26L307.87,482.26L306.49,482.55L304.65,479.29L302.86,478.71L302.87,474.59L301.84,474.03L300.34,474.75L299.66,469.65L296.89,466.65L293.66,468.13L291.53,471.82L289.68,471.2L286.36,471.98L283.7,467.84L282.03,469.18L278.12,465.96L272.19,464.26L272.05,462.57L269.55,463.46L265.21,462.13L263.28,463L261.37,461.65L256.53,463.96L257.26,463.21L255.83,461.83L257.32,461.31L256.29,461.13L257.26,458.41L255.71,455.85L255.71,455.85L255.86,453.65L259.69,452.76L260.86,449.91L264.35,449.46L265.58,450.22L266.96,448.69L268,448.86L265.93,443.46L271.61,439.56L272.21,434.91L274.47,436.28L280.01,435.29L279.95,430.63L278.51,428.49z"},{"code":"TH-NN","name":"Nakhon Nayok","path":"M262.72,420.59L265.15,418.33L265.61,419.88L267.08,419.33L267.49,421.11L271.08,422.73L274.92,427.19L275.61,426.81L275.61,426.81L278.51,428.49L279.95,430.63L280.01,435.29L274.47,436.28L272.21,434.91L271.61,439.56L265.93,443.46L268,448.86L266.96,448.69L265.58,450.22L264.35,449.46L260.86,449.91L259.69,452.76L255.86,453.65L255.71,455.85L255.71,455.85L249.47,455.34L240.67,456.5L240.67,456.5L240.68,438.52L242.82,437.36L243.19,434.86L243.19,434.86L243.07,432.46L245.62,433.87L250.34,429.95L250.26,425.13L252.28,427.29L254.97,427.37L256.63,428.17L257.52,430.08L258.48,429.71L259,428.45L260.67,428.02L260.6,424.08L261.83,423.95L261.62,421.19z"},{"code":"TH-SK","name":"Sa Kaeo","path":"M321.06,443.32L325.06,443.98L325.15,441.85L326.39,440.2L328.17,441.85L328.49,443.72L331.92,443.59L332.24,444.82L333.37,444.39L334.64,445.39L337.99,444.64L338.11,442.36L339.87,443.72L342.99,443.23L342.99,443.23L342.99,443.23L342.99,443.23L342.99,443.23L342.99,443.23L345.83,444.69L346.45,444L350.94,444.44L354.84,441.93L356.6,443.46L358.12,442.33L360.75,444.71L365.61,443.86L367.29,441.85L367.8,442.74L368.62,441.87L372.52,443.39L372.91,441.8L374.48,442.43L376.55,441.56L376.55,441.56L377.31,443.55L374.63,448.03L375.34,452.59L372.33,453.49L366.68,458.42L365.66,463.71L362.65,468.05L363.23,469.37L353.74,474L351.04,476.87L352.77,479.39L355.97,480.76L352.6,481.11L351.83,482.83L349.41,483.81L346.26,483.25L343.47,484.13L338.61,482.86L336.8,484.16L336.4,485.67L338.34,488.92L337.15,498.74L337.71,502.07L337.71,502.07L336.32,500.83L334.83,502.88L333.5,501.98L333.15,504.71L327.59,504.86L326.54,501.83L324.13,502.1L322.6,499.52L321.19,504.44L315.78,506.33L316.21,503.1L314.71,502.69L313.12,499.69L313.12,499.69L312.17,494.57L309.57,492.09L309.35,489.89L308.08,489.76L306.67,486.86L304.47,485.55L306.95,484.9L307.87,482.26L307.87,482.26L307.93,480.88L309.7,481.24L310.18,479.66L310.79,479.96L309.9,477.86L309.93,471.83L308.4,470.74L309.97,469.92L310.33,467.44L308.84,466.48L309.05,463.8L307.42,461.82L307.94,458.22L310.58,458.28L309.51,453.18L310.66,452.18L316.64,450.97L317.06,448.47L320.57,446.6z"},{"code":"TH-NR","name":"Nakhon Ratchasima","path":"M272.43,361.61L274.23,362.58L275.99,358.75L279.75,359.75L281.6,358.52L286.75,358.23L288.29,359.39L290.81,356.7L298.37,358.09L300.88,354.86L305.75,357.68L309.24,353.15L313.63,352.33L314.56,352.92L316.16,351.67L316.51,346.62L318.89,341.27L322.45,339.32L322.46,337.94L323.73,336.94L323.5,335.43L324.77,334.05L324.34,333L327.39,333.17L327.61,331.96L329.41,332.86L330.71,332.4L331.21,330.27L333.61,330L334.95,328.42L335.95,328.74L335.95,328.74L338.35,331.24L338.19,333.77L339.4,333.69L341.96,336.21L344.36,334.75L348.56,334.06L350.99,335.43L354.18,335.04L355.04,333.93L357.75,334.88L359.9,333.92L360.91,334.24L360.4,335.72L362.19,338.3L364.24,338L366.45,339.73L366.45,339.73L365.87,341.33L367.72,347.8L369.84,349.48L369.96,348.77L372.15,349.3L374.34,348.4L376.65,349.35L376.12,349.72L377.58,350.58L377.28,351.63L379.82,351.1L382.11,354.84L380.72,355.8L379.31,355L378.69,356.41L378.69,356.41L378.36,356.44L378.36,356.44L378.36,358.12L380.45,358.84L380.77,360.39L378.1,362.71L379.14,364.25L378.25,365.72L378.61,369.2L379.6,370.22L379.06,371.22L374.24,371.47L368.97,374.69L365.27,379.13L366.61,381.76L364.7,382.56L364.46,385.06L362.03,385.66L360.86,389.13L354.39,388.98L352.41,387.48L350.86,388.14L352.14,389.59L350.37,391.52L351.11,394.2L349.76,397.51L347.62,398.26L344.88,396L344.09,396.91L343.83,399.8L346.87,402.98L344.82,404.86L345.99,408.77L345.59,411.09L347.28,414.67L346.36,418.28L354.96,419.6L354.25,422.85L352.25,424.23L351.8,427.79L354.51,431.45L357.05,431.23L360.17,433.13L350.23,439.79L347.5,440.81L345.97,439.94L344.41,440.38L342.99,443.23L342.99,443.23L339.87,443.72L338.11,442.36L337.99,444.64L334.64,445.39L333.37,444.39L332.24,444.82L331.92,443.59L328.49,443.72L328.17,441.85L326.39,440.2L325.15,441.85L325.06,443.98L321.06,443.32L321.06,443.32L311.69,438.02L313.24,437.11L310.57,436.23L313.82,433.75L313.54,432.09L311.18,431.69L310.31,432.87L308.67,430.88L306.41,431.7L303.03,429.4L303.14,428.46L301.29,429.69L299.62,428.91L296.97,429.66L296.43,432.48L288.27,425.02L288.34,424.15L286.28,423.43L282.45,424.4L279.34,421.8L275.87,422.94L276.61,424.61L275.61,426.81L275.61,426.81L274.92,427.19L271.08,422.73L267.49,421.11L267.08,419.33L265.61,419.88L265.15,418.33L262.72,420.59L262.72,420.59L258.74,416.15L260.96,413.17L259.2,401.99L260.85,401.17L262.08,403.07L265.38,403.56L265.53,402.23L266.64,402.77L267.22,401.29L269.03,400.83L269.19,399.38L277.08,393.94L274.22,381.47L274.22,381.47L273.02,374.05L271.14,371.23L270.49,367.1L272.64,367.77z"},{"code":"TH-BR","name":"Buri Ram","path":"M376.65,329.29L377.36,331.3L381.65,333.94L381.67,336.99L379.56,338.69L383.12,342.9L384.87,343.44L384.44,345.42L387.45,347.7L386.21,350.02L388.9,351.18L388.9,351.18L387.44,355.56L389.26,356.73L390.62,355.99L392.33,359.35L391.9,360.06L394.46,359.24L394.59,361.28L395.61,360.83L396.85,362.62L398.35,362.18L398.12,363.24L400.54,362.44L400.89,363.77L404.92,360.41L407.26,361.84L408.06,361.36L407.36,362.32L408.54,363.17L410.28,363.14L411.47,360.61L413.12,361.14L414.05,362.99L415.2,362.8L415.3,364.35L413.71,364.1L412.45,365.03L412.28,366.76L411.07,366.35L410.73,370.24L409.59,370.56L410.11,377.3L410.11,377.3L410.91,377.03L410.87,377.72L410.87,377.72L409.84,380.07L411.52,381.45L409.75,382.5L408.96,384.38L410.39,386.07L409.46,387.51L410.05,389.5L408.49,390.15L408.67,391.67L407.64,391.89L404.72,396.31L400.83,397.92L401.06,399.49L399.28,400.68L399.83,402.81L398.83,407.34L397,409.04L397.3,411.09L395.66,412.74L396.33,415.98L395.74,418.86L397.96,423.26L396.2,426.04L396.95,426.92L396.24,427.65L396.62,431.16L396.62,431.16L392.68,430.65L391.69,432.07L390.87,431.22L389.68,432.91L385.23,434.07L382.9,437.81L378.22,439.41L376.55,441.56L376.55,441.56L374.48,442.43L372.91,441.8L372.52,443.39L368.62,441.87L367.8,442.74L367.29,441.85L365.61,443.86L360.75,444.71L358.12,442.33L356.6,443.46L354.84,441.93L350.94,444.44L346.45,444L345.83,444.69L342.99,443.23L342.99,443.23L344.41,440.38L345.97,439.94L347.5,440.81L350.23,439.79L360.17,433.13L357.05,431.23L354.51,431.45L351.8,427.79L352.25,424.23L354.25,422.85L354.96,419.6L346.36,418.28L347.28,414.67L345.59,411.09L345.99,408.77L344.82,404.86L346.87,402.98L343.83,399.8L344.09,396.91L344.88,396L347.62,398.26L349.76,397.51L351.11,394.2L350.37,391.52L352.14,389.59L350.86,388.14L352.41,387.48L354.39,388.98L360.86,389.13L362.03,385.66L364.46,385.06L364.7,382.56L366.61,381.76L365.27,379.13L368.97,374.69L374.24,371.47L379.06,371.22L379.6,370.22L378.61,369.2L378.25,365.72L379.14,364.25L378.1,362.71L380.77,360.39L380.45,358.84L378.36,358.12L378.36,356.44L378.36,356.44L378.69,356.41L378.69,356.41L379.31,355L380.72,355.8L382.11,354.84L379.82,351.1L377.28,351.63L377.58,350.58L376.12,349.72L376.65,349.35L374.34,348.4L372.15,349.3L369.96,348.77L369.84,349.48L367.72,347.8L365.87,341.33L366.45,339.73L366.45,339.73L368.88,340.65L372.32,339.41L373.22,336.43L373.08,331.17z"},{"code":"TH-SN","name":"Surin","path":"M388.9,351.18L395.83,352.51L398.23,353.46L399.53,355.18L404.35,356.37L408.19,354.39L408.19,354.39L411.8,352.91L417.2,354.94L419.45,352.46L422.58,352.03L426.35,353.55L430.12,354.11L431.47,353.45L433.73,354.35L438.76,352.18L439.23,353.41L440.44,352.04L441.02,353.04L441.32,351.96L441.88,353.86L444.97,354.09L445.28,355.83L446.93,354.97L446.8,356.3L447.9,356.31L447.9,356.31L448.33,357.25L449.06,356.16L452.04,357.1L452.74,356.39L454.92,359.75L450.26,361.59L450.68,362.51L449.48,362.63L449.74,364.48L448.6,363.96L448.38,365.87L447.04,365.04L448.58,367.04L447.85,367.34L448.04,368.85L446.82,369.22L447.72,370.56L446.51,371.67L446.56,373.13L448.73,374.23L447.88,375.53L448.78,376.19L448.19,378.25L450.09,379.09L449.09,380.44L450.15,381.31L449.44,383.2L448.36,383.42L448.64,385.12L446.53,386.34L446.59,388.09L443.83,391.21L442.15,394.98L443.24,396.48L448.48,398.52L449.29,401.2L448.82,403.48L452.19,407.55L452.76,412.21L450.91,416.14L451.09,419.34L452.33,419.54L452.68,421.32L451.7,428.67L452.57,429.91L452.57,429.91L450.68,430.46L447.4,429.25L445.31,429.58L444.85,430.96L440.74,430.4L438.38,428.11L436.98,429.37L435.45,429.1L435.41,428.24L433.6,428.83L429.15,427.7L429.1,423.93L427.63,423.38L425.42,423.59L424.58,424.62L425.43,425.45L423.36,426.24L422.47,424.77L418.96,424.47L415.05,426.06L412.84,428.55L410.66,426.76L408.85,429.06L399.16,429.51L396.62,431.16L396.62,431.16L396.24,427.65L396.95,426.92L396.2,426.04L397.96,423.26L395.74,418.86L396.33,415.98L395.66,412.74L397.3,411.09L397,409.04L398.83,407.34L399.83,402.81L399.28,400.68L401.06,399.49L400.83,397.92L404.72,396.31L407.64,391.89L408.67,391.67L408.49,390.15L410.05,389.5L409.46,387.51L410.39,386.07L408.96,384.38L409.75,382.5L411.52,381.45L409.84,380.07L410.87,377.72L410.87,377.72L410.11,377.3L410.11,377.3L409.59,370.56L410.73,370.24L411.07,366.35L412.28,366.76L412.45,365.03L413.71,364.1L415.3,364.35L415.2,362.8L414.05,362.99L413.12,361.14L411.47,360.61L410.28,363.14L408.54,363.17L407.36,362.32L408.06,361.36L407.26,361.84L404.92,360.41L400.89,363.77L400.54,362.44L398.12,363.24L398.35,362.18L396.85,362.62L395.61,360.83L394.59,361.28L394.46,359.24L391.9,360.06L392.33,359.35L390.62,355.99L389.26,356.73L387.44,355.56z"},{"code":"TH-SS","name":"Si Sa Ket","path":"M447.9,356.31L448.49,353.35L450.62,350.79L452.85,349.85L452.54,348.81L453.75,348.22L454.25,346.55L455.82,346.6L455.45,345.18L456.99,345.45L456.99,345.45L457.9,349.28L460.98,351.34L464.32,355.72L465.29,358.57L469.29,360.8L472.66,360.68L474.55,364.15L476.03,364.45L476.03,364.45L482.63,366.02L482.63,366.02L484.22,367.07L487.71,367.01L487.71,367.01L489.6,365.61L489.7,366.54L492.19,366.85L492.27,367.93L493.53,368.51L492.67,367.5L493.6,366.73L494.52,368.92L495.71,369.12L494.72,369.54L494.75,370.7L496.24,370.74L496.11,371.73L497.17,371.34L495.79,373.58L498.34,373.1L494.55,376.05L493.95,377.68L495.14,377.68L494.37,378.72L495.45,378.84L494.95,381.58L493.88,382.31L494.86,384.28L494.81,387.92L502.98,391.79L504.54,395.88L503.1,396.42L502.61,397.79L504.09,401.72L507.77,405.4L508.73,408.66L505.98,408.28L504.48,411.87L503.81,415.69L506.84,419.45L506.62,421.16L504.66,423.31L505.9,424.41L507.98,423.64L509.92,426.13L509.92,426.13L507.46,424.88L505.4,425.9L503.02,423.58L497.52,425.92L496.55,423.82L494.84,426.38L493.17,426.09L492.16,424.52L487.83,427.81L487.69,429.09L484.77,429.35L482.33,427.85L479.93,429.93L479.79,428.89L478.09,429.03L476.74,428.01L471.07,428.15L467.33,425.49L464.35,428.13L461.18,427.19L460.23,427.79L460.51,428.85L458.52,429.28L458.06,427.97L456.02,427.62L454.76,429.67L452.57,429.91L452.57,429.91L451.7,428.67L452.68,421.32L452.33,419.54L451.09,419.34L450.91,416.14L452.76,412.21L452.19,407.55L448.82,403.48L449.29,401.2L448.48,398.52L443.24,396.48L442.15,394.98L443.83,391.21L446.59,388.09L446.53,386.34L448.64,385.12L448.36,383.42L449.44,383.2L450.15,381.31L449.09,380.44L450.09,379.09L448.19,378.25L448.78,376.19L447.88,375.53L448.73,374.23L446.56,373.13L446.51,371.67L447.72,370.56L446.82,369.22L448.04,368.85L447.85,367.34L448.58,367.04L447.04,365.04L448.38,365.87L448.6,363.96L449.74,364.48L449.48,362.63L450.68,362.51L450.26,361.59L454.92,359.75L452.74,356.39L452.04,357.1L449.06,356.16L448.33,357.25z"},{"code":"TH-UR","name":"Ubon Ratchathani","path":"M520.85,308.58L530.45,311.62L543.92,314.04L544.78,315.8L541.66,316.16L539.26,320.47L542.66,328.77L544.41,329.76L545.39,332.12L547.17,332.78L549.75,331.34L553.58,332.58L556.67,334.51L558.73,338.09L558.38,345.28L556.15,349.33L556.78,351.71L556.03,355.13L554.2,356.86L549.4,357.78L547.65,360.35L550.19,362.68L554.83,362.01L555.36,362.73L555.94,365.89L552.55,367.05L548.23,372.09L547.48,376.62L550.59,378.6L550.8,380.23L553.36,380.37L553.03,381.91L554.67,383.07L554.81,384.68L557.95,386.22L555.52,388.33L553.43,387.99L552.99,389.73L554.86,391.41L555.08,392.82L552.3,393.71L553.45,395.88L551.29,396.74L550.64,398.45L550.75,401.62L552.55,403.17L551.24,403.47L550.91,405.67L551.54,409.98L552.72,410.83L551.81,412.46L552.13,415.48L545.11,425.1L543.81,424.1L542.28,426.37L539.22,427.18L537.76,426.3L536.65,428.5L534.84,429.36L533.25,428.7L531.49,430.74L527.95,429.89L527.37,431.08L528.01,432.02L526.31,434.08L525.97,437.03L521.66,439.28L519.48,438.92L517.69,437.14L515.56,431.54L516.21,428.36L514.25,426.66L512.95,427.44L509.92,426.13L509.92,426.13L507.98,423.64L505.9,424.41L504.66,423.31L506.62,421.16L506.84,419.45L503.81,415.69L504.48,411.87L505.98,408.28L508.73,408.66L507.77,405.4L504.09,401.72L502.61,397.79L503.1,396.42L504.54,395.88L502.98,391.79L494.81,387.92L494.86,384.28L493.88,382.31L494.95,381.58L495.45,378.84L494.37,378.72L495.14,377.68L493.95,377.68L494.55,376.05L498.34,373.1L495.79,373.58L497.17,371.34L496.11,371.73L496.24,370.74L494.75,370.7L494.72,369.54L495.71,369.12L494.52,368.92L493.6,366.73L492.67,367.5L493.53,368.51L492.27,367.93L492.19,366.85L489.7,366.54L489.6,365.61L487.71,367.01L487.71,367.01L484.25,367.07L482.63,366.02L482.63,366.02L476.03,364.45L476.03,364.45L476.99,359.38L476.26,357.74L474.54,357.28L475.15,356.29L473.85,352.78L475.63,346.76L481.05,347.29L483.13,345.47L483.13,345.47L485.63,346.92L488.24,345.21L487.7,342.7L491.75,339.64L489.3,337.87L490.77,336.76L497.87,339.59L498.79,338.87L499.05,339.97L501.83,341.48L502.44,343.28L503.44,342.49L504.27,343.94L506.85,344.34L507.85,345.51L507.03,346.45L508.13,347.24L509.1,345.45L508.42,344.74L511.51,341.56L511.35,339.9L509.13,339.29L510.02,331.56L513.41,329.77L513.68,324.79L515.46,321.24L514.23,320.85L516.78,317.5L516.52,313.11L518.89,308.62L520.23,308.28L520.23,308.28z"},{"code":"TH-YT","name":"Yasothon","labelCoordinate":{"x":0.4,"y":0.5},"path":"M472.4,292.4L475.4,290.69L482.54,291.21L483.18,292.97L485.9,293.34L487.66,297.87L489.16,298.34L490.11,299.99L492.12,300.07L493.67,298.08L496.17,300.6L500.5,301.44L500.5,301.44L502.07,304.16L504.31,304.23L503.8,308.22L490.82,306.47L486.59,308.22L483.52,313.27L484.51,315.22L482.73,316.31L482.67,318.51L479.35,321.94L478.94,324.28L479.78,325.95L478.07,328.06L477.04,336.11L478.5,335.97L478.37,341.63L480.04,340.97L479.68,343.38L482.75,343.84L483.13,345.47L483.13,345.47L481.05,347.29L475.63,346.76L473.85,352.78L475.15,356.29L474.54,357.28L476.26,357.74L476.99,359.38L476.03,364.45L476.03,364.45L474.55,364.15L472.66,360.68L469.29,360.8L465.29,358.57L464.32,355.72L460.98,351.34L457.9,349.28L456.99,345.45L456.99,345.45L456.98,344.45L459.54,342.72L463.04,341.75L461.24,342.23L461.59,340.7L460.14,340.49L460.31,338.71L461.33,338.29L458.98,336.55L458.65,335L457.34,336.19L456.67,335.71L458.27,333.94L457.27,331.13L457.66,328.95L453.75,326.24L453.87,327.67L451.08,329.22L448.73,329.21L449.56,325.9L450.58,325.4L450.05,324.36L451.21,324.27L449.76,323.01L449.7,321.28L451.17,319.22L450.55,317.81L449.78,318.62L449.51,317.95L450.66,316.2L455.69,316.18L456.39,312.28L455.17,309.9L456.09,307.63L458.14,307.36L460.48,304.77L464.07,303.48L465.64,299.79L467.46,299.31L471.15,296.01z"},{"code":"TH-CY","name":"Chaiyaphum","path":"M271.43,344.33L273.85,333.43L269.07,332.11L267.81,329.71L268.75,328.78L268.81,323.38L271.72,320.67L270.79,320.34L271.68,317.33L270.57,317.65L269.48,316.08L268.23,312.2L269.48,304.42L270.96,302.18L272.2,301.89L271.79,298.23L270.18,297.38L271.73,296.25L272.41,290.25L274.18,288.69L273.59,287.32L278.37,281.66L277.72,280.06L278.34,278.15L281.47,276.78L279.93,275.21L280.2,272.49L281.95,271.78L280.92,267.62L285.02,269.74L285.4,268.12L283.82,264.06L285.95,264.42L289.2,267.54L292.5,267.03L295.44,269.58L296.9,268.4L296.9,268.4L297.31,269.54L298.98,269.92L298.71,271.2L302.4,269.11L306.46,270.07L307.55,271.22L310.5,270.75L312.39,272.4L313.2,275.5L315.49,276.09L316.13,278.79L318.88,280L318.52,280.6L324.55,279.96L325.55,280.79L326.25,279.74L327.63,279.88L331.95,283.3L334.16,283.96L338.51,283.43L339.09,284.62L340.85,283.88L340.95,282.43L341.84,285.48L344.84,287.71L342.21,294.22L341.82,297.66L332.83,309.75L334.33,312.37L336.76,312.39L337.87,314.69L339.97,315.54L338.48,317.56L339.14,318.87L337.84,319.97L337.71,322.02L335.48,324.37L335.95,328.74L335.95,328.74L334.95,328.42L333.61,330L331.21,330.27L330.71,332.4L329.41,332.86L327.61,331.96L327.39,333.17L324.34,333L324.77,334.05L323.5,335.43L323.73,336.94L322.46,337.94L322.45,339.32L318.89,341.27L316.51,346.62L316.16,351.67L314.56,352.92L313.63,352.33L309.24,353.15L305.75,357.68L300.88,354.86L298.37,358.09L290.81,356.7L288.29,359.39L286.75,358.23L281.6,358.52L279.75,359.75L275.99,358.75L274.23,362.58L272.43,361.61L272.43,361.61L271.79,358.47L272.46,350.94z"},{"code":"TH-AC","name":"Amnat Charoen","path":"M500.5,301.44L503.61,302.17L504.61,300.86L508.05,300.39L510.35,297.25L511.52,297.39L513.33,295.28L514.69,295.59L514.69,295.59L517.24,298.2L516.96,301.7L518.91,307.45L520.23,308.28L520.23,308.28L518.89,308.62L516.52,313.11L516.78,317.5L514.23,320.85L515.46,321.24L513.68,324.79L513.41,329.77L510.02,331.56L509.13,339.29L511.35,339.9L511.51,341.56L508.42,344.74L509.1,345.45L508.13,347.24L507.03,346.45L507.85,345.51L506.85,344.34L504.27,343.94L503.44,342.49L502.44,343.28L501.83,341.48L499.05,339.97L498.79,338.87L497.87,339.59L490.77,336.76L489.3,337.87L491.75,339.64L487.7,342.7L488.24,345.21L485.63,346.92L483.13,345.47L483.13,345.47L482.75,343.84L479.68,343.38L480.04,340.97L478.37,341.63L478.5,335.97L477.04,336.11L478.07,328.06L479.78,325.95L478.94,324.28L479.35,321.94L482.67,318.51L482.73,316.31L484.51,315.22L483.52,313.27L486.59,308.22L490.82,306.47L503.8,308.22L504.31,304.23L502.07,304.16z"},{"code":"TH-BK","name":"Bueng Kan","path":"M408.29,176.24L407.93,174.64L401.48,169.71L401.48,165.59L404.56,163.47L404.85,160.85L399.65,158.74L399.55,156.32L401.19,155.01L401.13,153.81L401.13,153.81L400.71,151.62L398.05,150.51L398.08,148.74L402.07,144.51L408.63,143.31L412.15,145L416.93,144.97L422.57,146.59L428.28,150.8L436.54,151.16L439.16,155.05L443.58,151.89L446.73,151.19L452.83,159.46L456.05,166.96L461.5,173.38L461.5,173.38L460.48,173.52L460.37,174.79L458.91,173.32L456.34,174.74L458.2,178.35L453.68,183.46L452.06,182.71L451.6,181.4L448.63,182.54L447.55,184.85L448.93,185.57L449.89,188.33L449.89,188.33L448.8,188.52L447.41,191.21L447,190.24L445.95,190.91L444.88,190.26L443.18,187.7L443.56,185.14L442.05,185.61L442.38,183.35L439.7,184.54L439.9,183.48L439.06,183.19L437.69,184.13L435.08,183.64L436.09,184.99L434.98,186.1L432.94,183.19L434.44,182.6L433.64,181.47L434.12,179.8L432.41,180.5L432.97,178.15L431.68,181.26L429.64,179.05L427.44,178.07L425.98,178.45L426.07,176.84L425.32,177.55L424.36,176.59L423.53,177.18L423.27,174.78L424.62,174.02L422.62,173.98L421.51,171.38L420.45,172.15L418,170.34L417.89,168.6L417.55,170.06L416.12,169.63L414.64,170.58L414.89,175.63L413.11,174.55L412.7,175.72L411.6,175.34L410.93,176.13L411.81,176.51L411.45,177.27L408.8,175.41z"},{"code":"TH-NL","name":"Nong Bua Lam Phu","path":"M319.62,200.58L320.93,199.8L322.27,200.73L324.36,198.55L331.61,198.87L335.33,197.58L336.35,206.5L338.74,210.06L343.46,221.41L343.56,225.5L348.16,225.04L353.97,226.56L352.53,229.08L345.78,231.12L349.05,238.34L352.53,242.2L358.98,245.69L358.98,245.69L359.83,247.99L356,256.21L355.15,261.45L347.32,259.06L343.01,260.02L337.53,257.12L337.06,258.05L335.71,255.99L336.16,255.38L335.21,255.4L335.73,254.52L333.8,252.8L331.05,252.6L330.76,253.76L328.48,255.11L326.61,255.15L326.1,254.19L325.42,254.64L320.92,252.4L320.59,253.46L318.58,252.83L318.58,252.83L316.98,251.63L316.01,248.49L318.83,247.65L320.43,244.93L323.1,244.26L324.11,242.94L320.94,240.72L320.01,237.41L315.31,235.95L315.34,233.43L316.94,234.29L319.11,231.84L313.71,230.9L314.38,230L318.58,230.68L317.89,228.8L318.52,227.33L317.35,227.58L313.72,224.2L313.23,222.7L315.27,221.26L315.15,219.09L312.67,216.29L313.34,212.98L317.46,213.61L320.16,212.5L323.14,209.44L323.16,206.1z"},{"code":"TH-KK","name":"Khon Kaen","labelCoordinate":{"x":0.5,"y":0.3},"path":"M358.98,245.69L359.61,242.05L361.4,238.96L362.63,241.83L366.99,244.16L369.52,247.12L368.11,248.35L369.17,249.56L368.44,251.17L369.42,254.75L371.86,253.36L375.74,256.75L379.28,255.86L388.01,251.26L388.01,251.26L389.69,252.65L388.44,257.33L389.63,257.85L390.61,257L390.77,254.39L393.16,254.79L393.84,257.75L393.63,260.12L391.19,262.39L392,263.84L391.17,266.09L392.04,268L391.61,270.12L391.61,270.12L391.65,272.43L389.47,273.73L389.34,275.53L386.82,279.35L384.18,280.76L383.55,280.05L382.6,281.96L378.2,283.5L379.64,285.48L378.49,285.4L378.05,286.51L378.05,286.51L377.68,287.79L377.68,287.79L374.33,290.69L374.21,293.13L370.98,296.11L370.77,300.32L371.75,303.79L370.89,304.99L372.4,306.34L371.13,310.1L371.81,312.21L374.2,313.3L373.46,314.13L374.98,317.05L373.93,319.73L376.45,323.49L375.89,327.34L376.65,329.29L376.65,329.29L373.08,331.17L373.22,336.43L372.32,339.41L368.88,340.65L366.45,339.73L366.45,339.73L364.24,338L362.19,338.3L360.4,335.72L360.91,334.24L359.9,333.92L357.75,334.88L355.04,333.93L354.18,335.04L350.99,335.43L348.56,334.06L344.36,334.75L341.96,336.21L339.4,333.69L338.19,333.77L338.35,331.24L335.95,328.74L335.95,328.74L335.48,324.37L337.71,322.02L337.84,319.97L339.14,318.87L338.48,317.56L339.97,315.54L337.87,314.69L336.76,312.39L334.33,312.37L332.83,309.75L341.82,297.66L342.21,294.22L344.84,287.71L341.84,285.48L340.95,282.43L340.85,283.88L339.09,284.62L338.51,283.43L334.16,283.96L331.95,283.3L327.63,279.88L326.25,279.74L325.55,280.79L324.55,279.96L318.52,280.6L318.88,280L316.13,278.79L315.49,276.09L313.2,275.5L312.39,272.4L310.5,270.75L307.55,271.22L306.46,270.07L302.4,269.11L298.71,271.2L298.98,269.92L297.31,269.54L296.9,268.4L296.9,268.4L299.59,264.62L299.44,261.81L299.44,261.81L307.51,258.17L310.46,256.31L310.15,255.49L313.53,256.38L314.63,254.25L316.71,255.05L318.58,252.83L318.58,252.83L320.59,253.46L320.92,252.4L325.42,254.64L326.1,254.19L326.61,255.15L328.48,255.11L330.76,253.76L331.05,252.6L333.8,252.8L335.73,254.52L335.21,255.4L336.16,255.38L335.71,255.99L337.06,258.05L337.53,257.12L343.01,260.02L347.32,259.06L355.15,261.45L356,256.21L359.83,247.99z"},{"code":"TH-UD","name":"Udon Thani","path":"M317.68,168.98L319.96,171.02L321.13,170.58L321.11,173.15L323.52,172.5L323.31,174.45L324.3,175.74L325.54,173.72L327.6,173.42L327.68,174.36L331.55,176.08L333.27,175.67L334.72,178.59L340.02,182.14L340.88,185.96L343.68,187.63L342.81,189.48L343.58,191.32L345.45,192.35L349.56,191.75L355.31,197L354.03,198.03L354.07,201.51L357.47,202.07L357.65,203.61L360.74,201.66L363.24,202.83L363.87,201.69L365.56,201.74L365.14,200.17L366.11,199.79L366.78,197.36L369.87,196.57L371.26,194.14L371.56,190.83L369.67,188.28L370.55,188.39L370.91,186.61L372.57,185.89L372.65,183.02L373.59,182.28L376.58,182.71L379.36,187.56L383.91,182.53L385.31,183.67L386.62,183.19L388.14,185.09L389.04,184.76L391.37,188.79L392.46,188.52L393.97,184.26L397.44,182.7L401.76,187.08L402.37,186.15L401.69,184.27L403.84,183.1L406.21,183.29L408.33,181.68L408.33,181.68L409.51,183.28L407.96,185.16L409.84,186.12L408.46,186.03L408.33,186.85L408.12,186.02L407.14,186.14L407.65,187.03L406.12,189.74L409.05,194.05L408.12,201.9L409,203.4L406.73,203.63L406.57,204.56L404.96,204.02L403.05,206.42L402.73,208.5L400.66,210.32L400.89,212.4L399.79,214.29L401.69,217.83L398.26,223.23L399.89,226.18L405.01,227.31L405.69,228.64L409.45,230.29L411.79,230.29L413.02,229.07L419.79,234.15L421.78,233.39L424.31,237.32L426.31,237.78L425.49,239.84L425.98,243.85L425.98,243.85L424.93,243.53L425.29,241.9L423.13,238.7L420.31,238.08L418.3,239L415.56,242.12L416.35,245.33L414.64,247.32L414.43,251.96L414.43,251.96L413.6,253.11L413.6,253.11L409.7,259.05L408.98,258.58L409.85,257.61L408.32,255.46L409.09,254.63L407.24,251.93L404.34,250.52L400.67,250.4L398.28,247.9L396.15,247.45L393.62,248.85L389.23,247.84L388.01,251.26L388.01,251.26L379.28,255.86L375.74,256.75L371.86,253.36L369.42,254.75L368.44,251.17L369.17,249.56L368.11,248.35L369.52,247.12L366.99,244.16L362.63,241.83L361.4,238.96L359.61,242.05L358.98,245.69L358.98,245.69L352.53,242.2L349.05,238.34L345.78,231.12L352.53,229.08L353.97,226.56L348.16,225.04L343.56,225.5L343.46,221.41L338.74,210.06L336.35,206.5L335.33,197.58L331.61,198.87L324.36,198.55L322.27,200.73L320.93,199.8L319.62,200.58L319.62,200.58L317.84,199.05L316.38,199.71L315.94,199.05L316.5,198.67L315,192.77L315.86,190.09L316.92,189.82L316.31,188.65L317.37,185.7L315.16,176.2L316.8,175.73z"},{"code":"TH-LE","name":"Loei","path":"M320.47,159.71L321.1,159.92L321.1,159.92L320.84,163.5L318.58,164.85L317.68,168.98L317.68,168.98L316.8,175.73L315.16,176.2L317.37,185.7L316.31,188.65L316.92,189.82L315.86,190.09L315,192.77L316.5,198.67L315.94,199.05L316.38,199.71L317.84,199.05L319.62,200.58L319.62,200.58L323.16,206.1L323.14,209.44L320.16,212.5L317.46,213.61L313.34,212.98L312.67,216.29L315.15,219.09L315.27,221.26L313.23,222.7L313.72,224.2L317.35,227.58L318.52,227.33L317.89,228.8L318.58,230.68L314.38,230L313.71,230.9L319.11,231.84L316.94,234.29L315.34,233.43L315.31,235.95L320.01,237.41L320.94,240.72L324.11,242.94L323.1,244.26L320.43,244.93L318.83,247.65L316.01,248.49L316.98,251.63L318.58,252.83L318.58,252.83L316.71,255.05L314.63,254.25L313.53,256.38L310.15,255.49L310.46,256.31L307.51,258.17L299.44,261.81L299.44,261.81L295.44,262.53L292.72,259.4L295.08,258.75L292.15,254.96L292.93,249.69L291.75,248.52L292.01,246.84L290.24,242.37L288.89,242.04L287.5,245.15L284.6,246.11L282.51,243.61L282.3,241.42L278.98,240.17L277.75,238.56L276.01,240.04L273.68,238.6L272.53,239.56L269.5,239.07L268.64,240.14L267.42,238.62L264.01,238.87L261.54,235.89L260.03,236.59L259.99,238.77L257.9,242.31L254.23,243.92L253.65,252.06L252.79,252.64L251.11,251.88L251.11,251.88L251.2,250.39L248.74,249.95L248.28,249.01L249.88,248.05L249.18,245.87L250.39,243.16L249.87,239.63L251.75,235.41L251.65,232.68L253.81,228.67L252.04,225.57L249.81,225.35L246.84,221.78L240.77,221.23L240.79,213.57L239.34,212.62L236.83,213.56L235.31,212.4L235.95,209.97L237.91,208.06L237.1,206.96L238.44,204.17L240.15,203.67L241.96,205.33L243.71,204.92L243.71,204.92L248.07,206.12L253.87,211.42L257.59,212.33L258,210.61L259.06,210.35L258.91,208.32L262.18,207.6L264.37,203.27L267.47,200.66L267.65,199.5L270.49,198.62L272.68,196.34L273.86,197.3L275.81,194.94L273.96,193.63L276.9,193.74L278.56,192.79L279.61,192.91L279.17,194.2L279.96,194.15L281.43,191.26L283.75,189.76L285.52,190.04L283.73,188.06L285.44,184.18L286.51,185.58L288.49,182.45L293.43,181.13L294.49,181.83L296,180.51L295.78,178.48L299.11,170.17L305.55,172.92L307.54,172.84L310.99,168.1L315.77,164.41L317,161.02z"},{"code":"TH-NK","name":"Nong Khai","path":"M408.29,176.24L407.46,176.29L407.57,177.9L409.22,179.65L407.92,179.86L408.33,181.68L408.33,181.68L406.21,183.29L403.84,183.1L401.69,184.27L402.37,186.15L401.76,187.08L397.44,182.7L393.97,184.26L392.46,188.52L391.37,188.79L389.04,184.76L388.14,185.09L386.62,183.19L385.31,183.67L383.91,182.53L379.36,187.56L376.58,182.71L373.59,182.28L372.65,183.02L372.57,185.89L370.91,186.61L370.55,188.39L369.67,188.28L371.56,190.83L371.26,194.14L369.87,196.57L366.78,197.36L366.11,199.79L365.14,200.17L365.56,201.74L363.87,201.69L363.24,202.83L360.74,201.66L357.65,203.61L357.47,202.07L354.07,201.51L354.03,198.03L355.31,197L349.56,191.75L345.45,192.35L343.58,191.32L342.81,189.48L343.68,187.63L340.88,185.96L340.02,182.14L334.72,178.59L333.27,175.67L331.55,176.08L327.68,174.36L327.6,173.42L325.54,173.72L324.3,175.74L323.31,174.45L323.52,172.5L321.11,173.15L321.13,170.58L319.96,171.02L317.68,168.98L317.68,168.98L318.58,164.85L320.84,163.5L321.1,159.92L321.1,159.92L324.99,160.65L326.4,164.47L333.41,171.1L337.5,171.93L344.99,176.97L354.53,177.99L355.35,181.17L353.54,185.67L359.63,188.8L360.83,187.82L359.55,185.84L360.14,184.2L364.91,182.47L366.91,179.58L369.21,179.01L371.84,176.88L378.71,174.61L382.37,176.9L383.8,176.55L386.67,172.69L386.87,166.28L391.51,162.53L391.46,158.72L392.3,157.35L401.13,153.81L401.13,153.81L401.19,155.01L399.55,156.32L399.65,158.74L404.85,160.85L404.56,163.47L401.48,165.59L401.48,169.71L407.93,174.64z"},{"code":"TH-MS","name":"Maha Sarakham","path":"M391.61,270.12L394.13,270.25L394.51,271.12L392.64,272.72L393.93,276.52L392,280.69L393.7,283.78L392.33,287.76L393.16,289.71L399.15,288.68L400.94,287.48L401.62,289.3L404.24,289.76L404.83,291.06L404.83,291.06L405.05,293.59L406.16,294.18L406.16,294.18L409.07,295.26L408.61,297.19L410.87,299.83L411.49,299.25L411.03,300.74L411.81,302.37L413.63,300.57L415.29,300.52L415.26,301.16L415.26,301.16L412,306.96L411.86,309.39L413.04,311.85L412.55,317.04L413.72,320.13L412.19,321.43L411.32,324.21L409.63,334.51L407.67,335.32L404.97,334.15L401.9,335.73L399.64,338.44L401.87,338.65L399.8,342.77L401.18,343.42L401.74,345.54L404.87,346.78L405.63,348.07L409.18,347.16L409.75,349.33L408.19,354.39L408.19,354.39L404.35,356.37L399.53,355.18L398.23,353.46L395.83,352.51L388.9,351.18L388.9,351.18L386.21,350.02L387.45,347.7L384.44,345.42L384.87,343.44L383.12,342.9L379.56,338.69L381.67,336.99L381.65,333.94L377.36,331.3L376.65,329.29L376.65,329.29L375.89,327.34L376.45,323.49L373.93,319.73L374.98,317.05L373.46,314.13L374.2,313.3L371.81,312.21L371.13,310.1L372.4,306.34L370.89,304.99L371.75,303.79L370.77,300.32L370.98,296.11L374.21,293.13L374.33,290.69L377.68,287.79L377.68,287.79L378.05,286.51L378.05,286.51L378.49,285.4L379.64,285.48L378.2,283.5L382.6,281.96L383.55,280.05L384.18,280.76L386.82,279.35L389.34,275.53L389.47,273.73L391.65,272.43z"},{"code":"TH-RE","name":"Roi Et","path":"M464.78,285.13L467.87,283.75L468.36,282.1L469.26,282.71L471.01,291.21L470.48,291.98L472.4,292.4L472.4,292.4L471.15,296.01L467.46,299.31L465.64,299.79L464.07,303.48L460.48,304.77L458.14,307.36L456.09,307.63L455.17,309.9L456.39,312.28L455.69,316.18L450.66,316.2L449.51,317.95L449.78,318.62L450.55,317.81L451.17,319.22L449.7,321.28L449.76,323.01L451.21,324.27L450.05,324.36L450.58,325.4L449.56,325.9L448.73,329.21L451.08,329.22L453.87,327.67L453.75,326.24L457.66,328.95L457.27,331.13L458.27,333.94L456.67,335.71L457.34,336.19L458.65,335L458.98,336.55L461.33,338.29L460.31,338.71L460.14,340.49L461.59,340.7L461.24,342.23L463.04,341.75L459.54,342.72L456.98,344.45L456.99,345.45L456.99,345.45L455.45,345.18L455.82,346.6L454.25,346.55L453.75,348.22L452.54,348.81L452.85,349.85L450.62,350.79L448.49,353.35L447.9,356.31L447.9,356.31L446.8,356.3L446.93,354.97L445.28,355.83L444.97,354.09L441.88,353.86L441.32,351.96L441.02,353.04L440.44,352.04L439.23,353.41L438.76,352.18L433.73,354.35L431.47,353.45L430.12,354.11L426.35,353.55L422.58,352.03L419.45,352.46L417.2,354.94L411.8,352.91L408.19,354.39L408.19,354.39L409.75,349.33L409.18,347.16L405.63,348.07L404.87,346.78L401.74,345.54L401.18,343.42L399.8,342.77L401.87,338.65L399.64,338.44L401.9,335.73L404.97,334.15L407.67,335.32L409.63,334.51L411.32,324.21L412.19,321.43L413.72,320.13L412.55,317.04L413.04,311.85L411.86,309.39L412,306.96L415.26,301.16L415.26,301.16L416.45,301.42L417.72,299.54L417.51,300.31L419.09,299.85L418.46,300.86L421.55,300.95L421.75,301.62L423.04,300.89L421.79,300.17L422.58,299.83L424.3,302.04L425.33,300.85L425.93,301.62L426.89,300.97L426.13,299.62L427.56,300.36L427.91,299.37L430.75,299.59L432.3,294.1L428.44,288.76L436.37,282.37L439.67,282.25L443.93,284.74L450.8,284.15L451.79,287.99L453.6,286.44L457.95,285.47L460.25,283.97L461.53,285.06z"},{"code":"TH-KS","name":"Kalasin","path":"M388.01,251.26L389.23,247.84L393.62,248.85L396.15,247.45L398.28,247.9L400.67,250.4L404.34,250.52L407.24,251.93L409.09,254.63L408.32,255.46L409.85,257.61L408.98,258.58L409.7,259.05L413.6,253.11L413.6,253.11L414.43,251.96L414.43,251.96L414.64,247.32L416.35,245.33L415.56,242.12L418.3,239L420.31,238.08L423.13,238.7L425.29,241.9L424.93,243.53L425.98,243.85L425.98,243.85L428.1,242.84L430.06,244.08L430.12,246.48L430.93,245.93L431.4,247.15L434.11,248.07L434.53,249.36L433.26,250.49L434.61,253.05L437.76,254.47L438.25,256.35L444.64,261.11L445.6,260.67L446.09,257.54L446.68,258.44L447.4,256.64L450.6,255.18L453.53,257.68L453.53,257.68L455,258.43L456.82,262.15L457.98,262.23L457.71,263.78L459.13,266.18L460.25,266.44L459.83,267.82L461.43,268.4L460.57,272.52L462.65,274.36L463.95,276.6L463.71,278.17L464.93,278.93L464.07,282.04L464.78,285.13L464.78,285.13L461.53,285.06L460.25,283.97L457.95,285.47L453.6,286.44L451.79,287.99L450.8,284.15L443.93,284.74L439.67,282.25L436.37,282.37L428.44,288.76L432.3,294.1L430.75,299.59L427.91,299.37L427.56,300.36L426.13,299.62L426.89,300.97L425.93,301.62L425.33,300.85L424.3,302.04L422.58,299.83L421.79,300.17L423.04,300.89L421.75,301.62L421.55,300.95L418.46,300.86L419.09,299.85L417.51,300.31L417.72,299.54L416.45,301.42L415.26,301.16L415.26,301.16L415.29,300.52L413.63,300.57L411.81,302.37L411.03,300.74L411.49,299.25L410.87,299.83L408.61,297.19L409.07,295.26L406.16,294.18L406.16,294.18L405.08,293.61L404.83,291.06L404.83,291.06L404.24,289.76L401.62,289.3L400.94,287.48L399.15,288.68L393.16,289.71L392.33,287.76L393.7,283.78L392,280.69L393.93,276.52L392.64,272.72L394.51,271.12L394.13,270.25L391.61,270.12L391.61,270.12L392.04,268L391.17,266.09L392,263.84L391.19,262.39L393.63,260.12L393.84,257.75L393.16,254.79L390.77,254.39L390.61,257L389.63,257.85L388.44,257.33L389.69,252.65z"},{"code":"TH-SO","name":"Sakon Nakhon","path":"M408.29,176.24L408.8,175.41L411.45,177.27L411.81,176.51L410.93,176.13L411.6,175.34L412.7,175.72L413.11,174.55L414.89,175.63L414.64,170.58L416.12,169.63L417.55,170.06L417.89,168.6L418,170.34L420.45,172.15L421.51,171.38L422.62,173.98L424.62,174.02L423.27,174.78L423.53,177.18L424.36,176.59L425.32,177.55L426.07,176.84L425.98,178.45L427.44,178.07L429.64,179.05L431.68,181.26L432.97,178.15L432.41,180.5L434.12,179.8L433.64,181.47L434.44,182.6L432.94,183.19L434.98,186.1L436.09,184.99L435.08,183.64L437.69,184.13L439.06,183.19L439.9,183.48L439.7,184.54L442.38,183.35L442.05,185.61L443.56,185.14L443.18,187.7L444.88,190.26L445.95,190.91L447,190.24L447.41,191.21L448.8,188.52L449.89,188.33L449.89,188.33L450.35,191.85L451.38,191.15L452.62,191.98L452.13,193.35L453.12,192.73L452.78,194.27L453.98,195.65L453.47,197.47L454.38,197.25L453.3,199.85L450.68,200.32L452.41,204.12L451.12,205.68L450.98,209.11L449.39,211.04L452.69,217.82L453.77,218.75L454.15,217.59L455.18,218.85L454.93,216.99L456.04,216.88L456.23,217.73L457.28,217.19L457.69,218.48L459.13,217.48L458.53,216.45L460.67,216.19L460.43,215.12L464.14,216.12L468.11,214.84L476.87,215.46L476.19,218.6L477.28,221.71L475.9,224.21L478.1,228.35L475.16,232.62L474.97,234.88L475.78,235.67L473.35,237.95L472.57,240.32L475.48,242.7L475.53,243.7L472.84,244.79L472.43,246.3L470.17,246.9L469.05,250.33L465.79,251.74L465.79,251.74L462.58,254.04L457.18,253.11L456.1,256.44L453.53,257.68L453.53,257.68L450.6,255.18L447.4,256.64L446.68,258.44L446.09,257.54L445.6,260.67L444.64,261.11L438.25,256.35L437.76,254.47L434.61,253.05L433.26,250.49L434.53,249.36L434.11,248.07L431.4,247.15L430.93,245.93L430.12,246.48L430.06,244.08L428.1,242.84L425.98,243.85L425.98,243.85L425.49,239.84L426.31,237.78L424.31,237.32L421.78,233.39L419.79,234.15L413.02,229.07L411.79,230.29L409.45,230.29L405.69,228.64L405.01,227.31L399.89,226.18L398.26,223.23L401.69,217.83L399.79,214.29L400.89,212.4L400.66,210.32L402.73,208.5L403.05,206.42L404.96,204.02L406.57,204.56L406.73,203.63L409,203.4L408.12,201.9L409.05,194.05L406.12,189.74L407.65,187.03L407.14,186.14L408.12,186.02L408.33,186.85L408.46,186.03L409.84,186.12L407.96,185.16L409.51,183.28L408.33,181.68L408.33,181.68L407.92,179.86L409.22,179.65L407.57,177.9L407.46,176.29z"},{"code":"TH-NP","name":"Nakhon Phanom","path":"M461.6,173.51L463.45,175.6L467.34,185.03L472.9,188.16L479.42,198.89L495.62,208.21L502.14,217.24L502.94,229.29L501.35,236.68L497.89,244.82L498.13,251.54L499.81,255.7L498.15,258.81L498.15,258.81L496.03,257.25L493.74,260.16L491.67,257.44L491.07,254.75L485.77,254.38L481.78,255.6L480.41,254.48L478.67,254.53L476.75,252.7L475.54,253.62L472.64,252.12L470.7,252.02L467.87,255.21L465.79,251.74L465.79,251.74L469.05,250.33L470.17,246.9L472.43,246.3L472.84,244.79L475.53,243.7L475.48,242.7L472.57,240.32L473.35,237.95L475.78,235.67L474.97,234.88L475.16,232.62L478.1,228.35L475.9,224.21L477.28,221.71L476.19,218.6L476.87,215.46L468.11,214.84L464.14,216.12L460.43,215.12L460.67,216.19L458.53,216.45L459.13,217.48L457.69,218.48L457.28,217.19L456.23,217.73L456.04,216.88L454.93,216.99L455.18,218.85L454.15,217.59L453.77,218.75L452.69,217.82L449.39,211.04L450.98,209.11L451.12,205.68L452.41,204.12L450.68,200.32L453.3,199.85L454.38,197.25L453.47,197.47L453.98,195.65L452.78,194.27L453.12,192.73L452.13,193.35L452.62,191.98L451.38,191.15L450.35,191.85L449.89,188.33L449.89,188.33L448.93,185.57L447.55,184.85L448.63,182.54L451.6,181.4L452.06,182.71L453.68,183.46L458.2,178.35L456.34,174.74L458.91,173.32L460.37,174.79L460.48,173.52L461.5,173.38L461.5,173.38z"},{"code":"TH-MD","name":"Mukdahan","path":"M465.79,251.74L467.87,255.21L470.7,252.02L472.64,252.12L475.54,253.62L476.75,252.7L478.67,254.53L480.41,254.48L481.78,255.6L485.77,254.38L491.07,254.75L491.67,257.44L493.74,260.16L496.03,257.25L498.15,258.81L498.15,258.81L500.3,266.19L498.86,270.81L498.44,277.15L500.67,280.22L505.91,283.57L508.91,290.95L511.55,292.22L514.69,295.59L514.69,295.59L513.33,295.28L511.52,297.39L510.35,297.25L508.05,300.39L504.61,300.86L503.61,302.17L500.5,301.44L500.5,301.44L496.17,300.6L493.67,298.08L492.12,300.07L490.11,299.99L489.16,298.34L487.66,297.87L485.9,293.34L483.18,292.97L482.54,291.21L475.4,290.69L472.4,292.4L472.4,292.4L470.48,291.98L471.01,291.21L469.26,282.71L468.36,282.1L467.87,283.75L464.78,285.13L464.78,285.13L464.07,282.04L464.93,278.93L463.71,278.17L463.95,276.6L462.65,274.36L460.57,272.52L461.43,268.4L459.83,267.82L460.25,266.44L459.13,266.18L457.71,263.78L457.98,262.23L456.82,262.15L455,258.43L453.53,257.68L453.53,257.68L456.1,256.44L457.18,253.11L462.58,254.04z"},{"code":"TH-CM","name":"Chiang Mai","path":"M146.34,22.84L149.87,24.43L150.11,25.51L144.94,27.51L145,28.61L145.82,29.37L143.56,30.73L143.94,32.22L140.07,35.86L140,39.05L137.54,40.96L139.97,46.48L138.05,46.56L136.07,49.16L135.91,52.67L134.88,53.8L132.8,54.08L129.09,58.38L129.66,61.01L130.84,61.52L131.78,64.38L133.58,66.05L131.52,69.15L133.04,72.04L132.53,73.93L134.05,78.73L133.01,79.5L134.72,85.29L132.58,88.39L132.28,91.82L134.87,98.2L137.5,99.89L138.68,104.34L138.68,104.34L136.87,105.51L137.65,113.66L135.29,115.87L136.66,121.72L133.73,126.61L135.16,128.67L133.79,129.66L133.81,131.35L135.88,132.27L133.02,137.36L133.02,137.36L126.41,133.15L127.53,131.37L127.44,129.05L124.39,127L124.32,125.04L122.16,124.83L119.27,127.01L112.44,127.39L111.98,129.46L110.16,130.1L109.33,131.51L107.28,136.64L101.97,139.68L101.39,139.17L99.09,142.28L95.84,144.26L91.93,143.89L90.99,145.56L91.98,145.93L90.15,148.93L91.68,151.3L89.61,151.87L89.08,153.64L96.52,157.3L97.02,162.29L98.47,164.01L98.03,168.77L99.07,169.34L96.65,174.72L98.69,174.33L100.42,175.75L102.96,185.48L101.79,185.62L101.88,188.03L99.6,189.23L98.08,189.23L97.04,186.72L95.65,188.88L90.42,189.65L90.78,190.64L90.78,190.64L87.2,193.46L86.49,190.93L84.49,188.85L82.83,188.32L81.97,189.3L79.24,187.29L77.56,188.04L77.55,189.2L78.64,189.8L78.21,191.88L79.65,195.58L80.1,201.6L82.18,201.97L83.73,204.51L80.93,205.91L79.21,209.36L79.7,213.05L81.87,214.88L80.45,219.72L82.08,220.56L81.81,224.63L83.19,224.35L82.94,225.2L80.1,225.92L77.7,225.88L77.45,224.05L77,224.04L75.02,223.15L68.59,224.95L66.48,224L65.6,222.71L66.69,220.68L63.88,216.62L65.92,215.99L66.4,212.18L64.22,204.8L62.26,204.57L58.37,207.31L53.5,207.24L50.35,200.48L50.35,200.48L53.99,197.32L54.52,193.92L53.35,191.9L54.1,190.63L53.17,189.32L50.16,188.41L48.8,185.22L44.95,182.37L44.95,180.28L50.23,177.6L53.9,179.47L55.66,176.81L60.68,175.71L59.96,173.06L62.67,171.83L63.7,169.66L62.22,168.88L60.9,169.57L59.77,168.01L58.07,168.68L57.07,166.9L55.45,166.59L54.79,163.49L56.09,161.56L55.84,159.61L54.18,158.94L53.38,156.17L54.01,154.96L57.86,154.43L55.88,153.81L55.93,150.98L52.67,146.29L49.21,144.72L51.37,142.64L52.47,139.5L55.72,137.85L56.02,136.35L58.33,137.03L60.19,134.75L58.42,132.06L51.36,129.17L50.73,122.77L52.41,120.25L50.25,119.6L49.59,116.96L50.24,114.14L52.64,110.83L54.83,109.99L55.87,107.75L55.69,104.29L61.13,96.63L60.45,94.35L61.28,92.92L67.32,93.57L68.06,97.66L72.59,102.32L73.86,100.92L81.03,102.44L82.52,101.08L86.88,99.89L88.14,97.82L86.88,93.25L82.52,89.42L84.58,88L83.95,85.78L84.95,84.48L84.35,79.19L82.89,76.66L84.29,75.69L83.66,72.83L84.35,69.55L82.57,68.22L82.37,65.5L80.83,64.64L80.56,60.92L75.87,57.34L75.81,55.27L75.81,55.27L78.67,53.35L82.4,56.62L83.9,53.67L86.34,53.64L86.47,52.72L92.27,50.07L96.65,50.92L100.86,46.54L105.51,50.1L106.07,51.64L106.96,49.37L110.37,52.18L111.12,48.72L112.69,47.88L113.73,45.08L113.2,38.4L114.52,38.19L114.66,36.87L113.71,35.28L115.31,33.05L114.63,30.65L116.84,26.05L120.56,25.74L120.4,24.72L122.57,23.83L125.97,23.97L133.54,28.33L137.4,26.91L141.27,26.86L145.25,25.02z"},{"code":"TH-LH","name":"Lamphun","path":"M90.78,190.64L90.42,189.65L95.65,188.88L97.04,186.72L98.08,189.23L99.6,189.23L101.88,188.03L101.79,185.62L102.96,185.48L100.42,175.75L98.69,174.33L96.65,174.72L99.07,169.34L98.03,168.77L98.47,164.01L97.02,162.29L96.52,157.3L89.08,153.64L89.61,151.87L91.68,151.3L90.15,148.93L91.98,145.93L90.99,145.56L91.93,143.89L95.84,144.26L99.09,142.28L101.39,139.17L101.97,139.68L107.28,136.64L109.33,131.51L110.16,130.1L111.98,129.46L112.44,127.39L119.27,127.01L122.16,124.83L124.32,125.04L124.39,127L127.44,129.05L127.53,131.37L126.41,133.15L133.02,137.36L133.02,137.36L133.29,139.6L131.77,140.41L129,139.99L128.01,141.08L127.66,143.28L125.06,145.24L124.41,147.58L122.92,148.5L121.9,152.67L119.9,153L119.38,155.98L117.33,155.23L112.88,157.11L115.48,162.62L116.39,170.52L118.45,174.89L118.02,177.95L119.42,178.71L118.81,181.05L121.54,181.2L124.01,185.35L122.46,185.79L123.38,188.28L120.76,187.54L118.62,188.15L120.09,190.98L118.65,193.19L117.39,193.42L117.53,195.77L115.97,196.61L115.03,202.17L108.1,199.82L105.29,199.66L103.65,201.23L104.09,203.78L105.64,204.39L105.62,207.58L105.62,207.58L103.55,210.7L102.09,209.29L100.21,209.05L94.8,212.31L92.58,212.6L90.76,215.4L90.24,212.83L91.8,210L91.55,206.2L90.22,203.28L90.32,198.51L94.5,196.57z"},{"code":"TH-LP","name":"Lampang","path":"M138.68,104.34L141.07,103.74L144.97,98.79L147.39,98.86L149.28,94.96L147.8,92.8L148.59,86.39L150.78,82.26L149.66,74.76L154.2,77.07L157.26,76.47L158.42,77.13L158.42,77.13L159.4,80.16L159.09,86.96L160.62,92.28L162.78,94.85L163.8,99.75L165.22,100.52L166.83,99.93L168.17,104.2L173.07,105.15L177.36,110.01L180.19,111.65L181.35,111.23L183.81,113.84L183.57,117.24L185.02,116.52L186.77,117.84L186.77,117.84L187.54,119.57L185.59,123.46L186.58,127.55L185.79,130.53L187.17,132.48L186.38,135.31L185.18,134.52L182.81,135.63L182.83,138.52L180.5,143.36L179.34,143.56L180.01,144.07L179.45,146.02L178.22,147.29L176.78,147.19L172.82,155.14L169.49,154.93L168.99,156.9L165.66,159.79L162.46,165L162.94,166.34L160.2,169.98L158.15,170.39L156.77,171.98L154.28,170.54L151.12,172.46L151.67,174.37L144.22,180.54L143.7,182.38L140.06,185.48L136.37,190.87L139.74,195.64L141.94,195.4L143.47,193.36L143.47,193.36L143.75,197.65L141.82,199.94L142.19,203.21L141.24,202.4L139.89,203.11L139.51,204.93L140.99,205.65L141.25,208.09L140.02,208.8L139.01,212.12L139.97,214.12L141.48,214.72L140.6,217.66L143.45,219.69L143.84,222.14L142.3,223.52L142.36,227.37L141.35,227.55L141.26,229.05L137.9,230.67L136.78,230.26L134.58,226.45L132.89,226.33L132.89,226.33L130.26,221.96L129.85,217.1L126.94,216.73L123.35,221.54L121.99,221.51L121.18,219.9L119.28,219.2L118.98,220.05L114.86,218.15L113.83,216.42L112.44,216.13L110.29,212.41L107.04,211.9L106.67,208.5L105.62,207.58L105.62,207.58L105.64,204.39L104.09,203.78L103.65,201.23L105.29,199.66L108.1,199.82L115.03,202.17L115.97,196.61L117.53,195.77L117.39,193.42L118.65,193.19L120.09,190.98L118.62,188.15L120.76,187.54L123.38,188.28L122.46,185.79L124.01,185.35L121.54,181.2L118.81,181.05L119.42,178.71L118.02,177.95L118.45,174.89L116.39,170.52L115.48,162.62L112.88,157.11L117.33,155.23L119.38,155.98L119.9,153L121.9,152.67L122.92,148.5L124.41,147.58L125.06,145.24L127.66,143.28L128.01,141.08L129,139.99L131.77,140.41L133.29,139.6L133.02,137.36L133.02,137.36L135.88,132.27L133.81,131.35L133.79,129.66L135.16,128.67L133.73,126.61L136.66,121.72L135.29,115.87L137.65,113.66L136.87,105.51z"},{"code":"TH-UA","name":"Uttaradit","path":"M253.04,148.14L258.74,151.03L256.54,153.99L257.22,155.54L256.21,156.57L257.63,159.59L259.38,160.12L257.33,166.25L258.9,170.34L254.71,174.95L254.4,178.34L247.77,182.57L248.52,186.61L246.38,187.64L245.98,188.7L246.91,190.07L244.96,191.72L245.7,193.01L245.7,193.01L243.43,196.04L238.03,195.27L235.98,199.23L233.14,200.39L228.85,207.22L222.39,210.56L222.56,211.95L220.45,212.54L219.37,215.52L214.82,215.94L213.72,216.85L212.83,215.13L211.69,215.87L207.84,215.63L203.83,217.93L201.26,218.07L200.93,219.32L199.55,218.59L197.86,219.09L195.16,221.02L196.1,228.06L191.74,231.65L190.88,231.83L189.7,230.34L181.55,232.57L181.1,233.68L179.07,232.13L177.67,233.04L177.67,233.04L177.84,230.12L176.27,229.03L176.06,228.27L176.81,225.51L178.86,224.72L180.02,222.26L179.09,220.4L179.67,218.39L178.33,216.98L179.31,215.81L179.27,213.08L177.8,211.02L174.09,208.64L175.13,207.05L173.91,204.07L177.35,201.57L176.74,200.82L177.51,199.02L176.64,195.28L173.66,192.59L173.83,190.02L172.11,188.54L172.11,188.54L176.2,190.44L176.59,189.13L178.6,188.17L178.19,186.61L182.13,185.68L182.95,186.66L187.75,185.02L193.53,180.53L195.69,177.63L197.93,177.93L201.72,182.64L203.3,180.13L202.67,176.12L205.51,173.43L206.99,173.4L206.99,173.4L215.61,173.78L216.07,172.59L220.17,171.42L224.12,171.96L225.75,173.2L230.97,173.15L233.76,169.43L236.38,169.12L238.62,164.32L240.66,163.76L241.05,157.78L245.39,153.2L246.42,153.53L250.4,149.83L251.56,149.77L252.36,148.13L252.36,148.13z"},{"code":"TH-PR","name":"Phrae","path":"M186.77,117.84L189.81,116.04L191.57,116.29L192.3,117.46L194.35,116.67L202,118.08L202,118.08L201.8,119.36L203.53,120.12L203.22,121.91L205.48,122.66L202.8,126.91L203.47,129.47L205.81,130.67L204.79,131.03L204.05,134.99L205.2,135.55L205.98,140.6L207.07,140.92L208.35,139.64L208.99,140.35L211.13,139.99L213.21,141.56L215.54,140.39L216.18,143.19L215.25,147.39L213.91,147.34L213.14,149.42L211.51,150.25L212.31,151.07L211.44,152.5L212.38,155.22L209.68,159.82L209.15,163.75L207.15,164.01L205.83,165.43L206.99,173.4L206.99,173.4L205.51,173.43L202.67,176.12L203.3,180.13L201.72,182.64L197.93,177.93L195.69,177.63L193.53,180.53L187.75,185.02L182.95,186.66L182.13,185.68L178.19,186.61L178.6,188.17L176.59,189.13L176.2,190.44L172.11,188.54L172.11,188.54L164.41,189.63L162.37,193.29L160.62,194.54L156.8,188.98L155.45,189.31L152.01,187.51L146.66,189.21L143.47,193.36L143.47,193.36L141.94,195.4L139.74,195.64L136.37,190.87L140.06,185.48L143.7,182.38L144.22,180.54L151.67,174.37L151.12,172.46L154.28,170.54L156.77,171.98L158.15,170.39L160.2,169.98L162.94,166.34L162.46,165L165.66,159.79L168.99,156.9L169.49,154.93L172.82,155.14L176.78,147.19L178.22,147.29L179.45,146.02L180.01,144.07L179.34,143.56L180.5,143.36L182.83,138.52L182.81,135.63L185.18,134.52L186.38,135.31L187.17,132.48L185.79,130.53L186.58,127.55L185.59,123.46L187.54,119.57z"},{"code":"TH-NA","name":"Nan","path":"M226.54,46.23L226.47,48.61L224.27,53.41L223.94,65.25L230.17,67.98L230.81,69.68L237.06,63.6L239.35,59.31L240.86,60.16L248.88,59.67L254.76,63.66L257.94,62.71L259.85,63.34L260.44,61.33L262.94,61.45L265.91,63.96L264.98,65.22L265.73,66.88L264.55,68.57L264.45,70.93L260.69,70.74L261,73.68L259.1,76.09L260.35,79.49L261.9,79.7L262.55,80.87L261.81,82.64L263.59,87.32L263.02,91.5L263.8,95.47L269.49,99.39L270.47,101.07L269.21,103.95L267.43,104.14L266.26,105.65L266.43,108.59L263.06,112.21L263.3,120.05L261.58,123.24L264.77,126.21L261.8,130.56L258.74,131.79L258.82,135.4L256.56,135.94L255.79,137.7L253.49,138.16L252.83,140.82L250.16,143.75L250.05,144.94L252.36,148.13L252.36,148.13L251.56,149.77L250.4,149.83L246.42,153.53L245.39,153.2L241.05,157.78L240.66,163.76L238.62,164.32L236.38,169.12L233.76,169.43L230.97,173.15L225.75,173.2L224.12,171.96L220.17,171.42L216.07,172.59L215.61,173.78L206.99,173.4L206.99,173.4L205.83,165.43L207.15,164.01L209.15,163.75L209.68,159.82L212.38,155.22L211.44,152.5L212.31,151.07L211.51,150.25L213.14,149.42L213.91,147.34L215.25,147.39L216.18,143.19L215.54,140.39L213.21,141.56L211.13,139.99L208.99,140.35L208.35,139.64L207.07,140.92L205.98,140.6L205.2,135.55L204.05,134.99L204.79,131.03L205.81,130.67L203.47,129.47L202.8,126.91L205.48,122.66L203.22,121.91L203.53,120.12L201.8,119.36L202,118.08L202,118.08L201.98,116.63L205.24,111.81L205.44,109.49L207.94,107.5L207.3,105.59L209.99,100.51L212.33,100.58L212.18,101.6L213.77,102.58L213.11,105.03L215.85,104.54L215.37,101.02L219.85,102.86L220.83,101.94L217.11,99.04L217.74,96.86L221.41,97.21L222.7,95.88L219.55,86.48L220.3,82.22L217.09,82.37L216.87,80.29L215.09,79.16L213.99,75.99L217.15,73.37L217.21,72.02L218.75,70.6L214.73,69.11L211.43,69.56L210.81,66.63L211.82,61.81L208.94,59.2L208.84,57.1L207.94,56.5L208.83,53.83L206.5,52.04L206.5,52.04L206.99,48.95L208.37,47.59L208.37,47.59L212.24,48.93L216.8,48.16L217.98,46.59z"},{"code":"TH-PY","name":"Phayao","path":"M206.5,52.04L208.83,53.83L207.94,56.5L208.84,57.1L208.94,59.2L211.82,61.81L210.81,66.63L211.43,69.56L214.73,69.11L218.75,70.6L217.21,72.02L217.15,73.37L213.99,75.99L215.09,79.16L216.87,80.29L217.09,82.37L220.3,82.22L219.55,86.48L222.7,95.88L221.41,97.21L217.74,96.86L217.11,99.04L220.83,101.94L219.85,102.86L215.37,101.02L215.85,104.54L213.11,105.03L213.77,102.58L212.18,101.6L212.33,100.58L209.99,100.51L207.3,105.59L207.94,107.5L205.44,109.49L205.24,111.81L201.98,116.63L202,118.08L202,118.08L194.35,116.67L192.3,117.46L191.57,116.29L189.81,116.04L186.77,117.84L186.77,117.84L185.02,116.52L183.57,117.24L183.81,113.84L181.35,111.23L180.19,111.65L177.36,110.01L173.07,105.15L168.17,104.2L166.83,99.93L165.22,100.52L163.8,99.75L162.78,94.85L160.62,92.28L159.09,86.96L159.4,80.16L158.42,77.13L158.42,77.13L157.7,74.34L159.81,74.52L164.67,72.33L169.9,72.66L170.81,71.97L172.3,74.07L173.31,73.59L173.79,75.44L175.65,73.88L178.96,73.39L179.78,74.06L179.76,73.14L182.21,72.9L183.67,71.39L183.67,65.88L189.84,64.3L190.27,62.62L195.01,61.12L196.66,58.26L200.43,58.24L201.58,55.75L203.26,55.37z"},{"code":"TH-CR","name":"Chiang Rai","path":"M176.39,0.03L178.94,3.3L184.39,6.07L185.62,10.88L185.24,13.92L186.42,15.25L190.67,15.66L191.28,14.23L190.46,11.81L193.89,10.68L194.26,8.09L197.02,4.73L200.25,4.52L203.04,6.25L207.05,15.06L209.56,16.69L209.8,18.98L213.37,22.52L214.71,22.96L216.35,20.71L218.01,21.15L214.07,39.37L212.54,42.09L209.38,44.13L208.37,47.59L208.37,47.59L206.99,48.95L206.5,52.04L206.5,52.04L203.26,55.37L201.58,55.75L200.43,58.24L196.66,58.26L195.01,61.12L190.27,62.62L189.84,64.3L183.67,65.88L183.67,71.39L182.21,72.9L179.76,73.14L179.78,74.06L178.96,73.39L175.65,73.88L173.79,75.44L173.31,73.59L172.3,74.07L170.81,71.97L169.9,72.66L164.67,72.33L159.81,74.52L157.7,74.34L158.42,77.13L158.42,77.13L157.26,76.47L154.2,77.07L149.66,74.76L150.78,82.26L148.59,86.39L147.8,92.8L149.28,94.96L147.39,98.86L144.97,98.79L141.07,103.74L138.68,104.34L138.68,104.34L137.5,99.89L134.87,98.2L132.28,91.82L132.58,88.39L134.72,85.29L133.01,79.5L134.05,78.73L132.53,73.93L133.04,72.04L131.52,69.15L133.58,66.05L131.78,64.38L130.84,61.52L129.66,61.01L129.09,58.38L132.8,54.08L134.88,53.8L135.91,52.67L136.07,49.16L138.05,46.56L139.97,46.48L137.54,40.96L140,39.05L140.07,35.86L143.94,32.22L143.56,30.73L145.82,29.37L145,28.61L144.94,27.51L150.11,25.51L149.87,24.43L146.34,22.84L146.34,22.84L148.09,22.73L149.69,18.54L146.88,16.55L145.87,10L142.5,7.36L142.52,5.19L152.02,9.09L155.11,8.69L157.63,10.63L160.18,9.76L160.94,8.25L166.34,9.23L168.37,6.62L168.35,4.5L170.32,1.44L173.79,1.38z"},{"code":"TH-MH","name":"Mae Hong Son","path":"M11.81,139.93l1.28,0.49l0.82,-2.72l1.04,0.51l0.65,-0.89l3.1,-0.3l-0.29,-1.54l1.47,0.14l1.27,-1.34l7.62,-0.04l0.38,-7.9l-1.36,-2.51l0.64,-2.45l-1.58,-4.69l0.06,-3.93l-2.44,-1.29l-2.5,-3.38l4.72,-2.27l-0.16,-4.4l2.3,-0.26l-0.04,-1.94l4.37,-1.6l0.78,-8.49l-4.22,-3.79l1.25,-1.5l1.4,0.44l1.37,-1.08l-2.87,-3.83l0.26,-2.56l-1.16,-0.9l1.91,-1.01l4.77,-6.1l-2.16,-2.31l0.46,-3.03l7.78,-1.92l0.52,-2.68l3.69,-0.09l-0.84,-5.26l0.64,-6.37l3.15,-0.35l1.22,2.73l2.32,-1.07l2.25,1.22l1.5,2.2l2.44,0.82l1.38,3.62l5.3,-1.53l2.96,0.64l1.53,-1.04l5.02,0.88l0,0l0.07,2.07l4.69,3.58l0.27,3.72l1.54,0.86l0.2,2.72l1.78,1.33l-0.69,3.27l0.63,2.87l-1.41,0.97l1.46,2.53l0.61,5.29l-1,1.3L84.58,88l-2.06,1.42l4.36,3.83l1.26,4.57l-1.26,2.07l-4.36,1.19l-1.5,1.36l-7.17,-1.52l-1.27,1.4l-4.53,-4.67l-0.75,-4.08l-6.04,-0.65l-0.83,1.43l0.68,2.28l-5.43,7.66l0.17,3.46l-1.04,2.24l-2.19,0.84l-2.4,3.31l-0.65,2.83l0.66,2.63l2.16,0.65l-1.68,2.53l0.63,6.4l7.06,2.88l1.77,2.69l-1.86,2.28l-2.31,-0.68l-0.29,1.5l-3.25,1.66l-1.11,3.14l-2.16,2.08l3.46,1.57l3.25,4.69l-0.04,2.83l1.97,0.62l-3.85,0.53l-0.63,1.21l0.8,2.77l1.66,0.67l0.26,1.95l-1.31,1.93l0.66,3.1l1.62,0.31l1.01,1.78l1.7,-0.67l1.12,1.56l1.32,-0.69l1.49,0.78l-1.03,2.18l-2.71,1.23l0.72,2.65l-5.02,1.1l-1.75,2.66l-3.67,-1.87l-5.28,2.68l0,2.09l3.84,2.85l1.36,3.19l3.01,0.91l0.93,1.32l-0.75,1.26l1.18,2.02l-0.54,3.4l-3.63,3.16l0,0l-3.41,-2.68l-2.09,-6.6l-2.28,-3.78l-0.45,-3.24l-3.84,0.97l-0.52,3L34,190.44l-6.94,-0.17l0,0l-1.77,-2.47l-1.35,-0.12l-1.62,-3.58l1.18,-3.94l2.94,-1.94l0.25,-1.46l-4.14,-9.79l-0.19,-3.39l-4.48,-5.44l2.03,-3.46l-1.33,-2.18l-4.02,-1.48l-1.61,3.74l-2.38,1.24l-3.66,-4.54l0.39,-4l-1.73,-1.31l-2.81,-7.03l-2.52,-2.56l-0.22,-2.31l1.05,-1.32l0.18,2.52l2.53,-0.26l1.09,0.9l2.12,4.04l2.42,-1.04l1.62,1.26L11.81,139.93z"},{"code":"TH-NS","name":"Nakhon Sawan","labelCoordinate":{"x":0.5,"y":0.35},"path":"M181.3,301.37L185.3,304.08L184.3,306.23L186.71,309.42L186.88,311.7L189.92,316.39L191.11,320.29L192.71,319.59L194.32,320.56L195.32,317.77L196.55,317.87L197.08,319.22L200.89,317.17L200.84,315.94L202.38,316.83L201.33,319.22L210.77,320.19L214.83,319.12L214.36,321.15L218.31,317.72L221.28,316.5L230.97,315.05L230.97,315.05L231.91,316.2L230.54,321.22L233.71,323.36L232.78,327.19L234.25,335.02L236.26,336.23L234.81,337.61L233.83,345.03L232.4,347.21L230.26,348.25L230.26,348.25L229.31,349L230.95,350.06L231.07,352.21L222.4,355.63L221.8,362.16L218.08,365.44L219.07,366.57L218.9,368.64L215.36,370.81L213.07,373.67L213.19,375.47L210.32,376.63L207.49,380.59L207.49,380.59L202.14,376.85L202.14,376.85L202.86,376.29L202.38,374.33L199.07,371.9L196.71,364.5L195.02,362.04L192.57,359.2L188.54,357.75L188.31,356.54L185.92,355.54L185.92,355.54L182.75,355.03L183.57,352.82L181.22,351.67L180.67,349.29L179.54,349.51L178.92,351.01L176.2,349.36L175.42,349.81L174.4,337.63L170.01,338.99L169.73,341.59L165.24,339.84L161.18,336.7L159.19,336.81L151.75,340.84L149.6,343.43L146.22,345.46L143.4,345.38L143.12,343.86L142.17,344.11L139.99,341.89L137.12,341.14L135.51,337.27L131.55,336.38L130.24,334.77L128.32,334.41L126.19,331.33L120.75,329.4L120.75,329.4L118.09,326.75L117.53,322.97L117.53,322.97L120.25,321.14L121.54,321.38L123.22,319.38L125.33,319.42L125.62,318.57L131.12,322.51L133.12,320.03L133.77,321.09L135.65,320.08L139.17,321.17L140.41,320.63L143.1,321.94L143.9,320.43L145.4,320L152.46,322.08L155.98,324.94L159.39,323.42L161.64,324.9L163.61,321.95L163.46,320.55L165.83,320.54L166.02,319.11L168.61,316.43L168.56,313.85L171.45,311.57L174.5,311.35L180.14,304.42L181.58,304.02L180.56,302.28z"},{"code":"TH-UT","name":"Uthai Thani","path":"M120.75,329.4L126.19,331.33L128.32,334.41L130.24,334.77L131.55,336.38L135.51,337.27L137.12,341.14L139.99,341.89L142.17,344.11L143.12,343.86L143.4,345.38L146.22,345.46L149.6,343.43L151.75,340.84L159.19,336.81L161.18,336.7L165.24,339.84L169.73,341.59L170.01,338.99L174.4,337.63L175.42,349.81L176.2,349.36L178.92,351.01L179.54,349.51L180.67,349.29L181.22,351.67L183.57,352.82L182.75,355.03L185.92,355.54L185.92,355.54L184.9,356.58L186.1,358.5L184.48,358.14L184.03,358.84L185.74,361.14L182.84,365.46L181.76,364.02L176.14,363.36L171.18,364.6L168.96,362.94L164.72,362.46L160.22,365.25L160.94,367.5L160.36,369.06L162.82,372.4L162.03,373.15L165.95,377.99L163.71,380.68L164.07,382.76L160.79,384.41L159.88,386.12L159.88,386.12L154.37,385.24L154.14,388.74L145.75,385.54L141.56,385.66L139.85,381.14L136.23,381.15L134.15,378.85L131.95,380.69L132.32,382.79L130.79,384.92L130.79,384.92L128.87,385.38L127.3,383.68L124.48,382.68L122.49,383.43L120.73,381.89L121.19,380.94L116.81,381.84L112.93,380.74L111.68,379.48L112.04,374.46L110.51,371.93L110.51,371.93L111.77,371.74L112.01,367.96L114.2,364.43L113.69,361.2L116.25,357.08L115.36,353.75L116.93,350.02L114.88,345.93L117.97,344.12L119.26,340.86L119.12,338.18L120.95,333.54L120.21,331.3z"},{"code":"TH-KP","name":"Kamphaeng Phet","path":"M140.35,253.54L142.6,253.72L144.61,251.6L146.32,254.45L150.66,255.36L150.57,257.39L153.56,262.07L157.16,264.18L158.44,263.98L158.51,265.02L161.18,263.65L160.92,265.53L163.5,267.39L165.72,266.75L166.58,264.73L168.56,265.12L169.37,263.63L169.37,263.63L172.27,264.61L173.09,272.78L176.35,275.1L179.5,274.19L179.95,274.94L179.95,274.94L181.38,280.04L178.73,284.31L177.91,288.65L179.38,291.57L180.9,291.91L179.03,294.9L179.66,295.93L181.1,295.76L180.52,297.63L182.77,299.08L181.3,301.37L181.3,301.37L180.56,302.28L181.58,304.02L180.14,304.42L174.5,311.35L171.45,311.57L168.56,313.85L168.61,316.43L166.02,319.11L165.83,320.54L163.46,320.55L163.61,321.95L161.64,324.9L159.39,323.42L155.98,324.94L152.46,322.08L145.4,320L143.9,320.43L143.1,321.94L140.41,320.63L139.17,321.17L135.65,320.08L133.77,321.09L133.12,320.03L131.12,322.51L125.62,318.57L125.33,319.42L123.22,319.38L121.54,321.38L120.25,321.14L117.53,322.97L117.53,322.97L118.15,319.87L116.63,317.81L117.6,316.38L117.24,313.19L119.46,309.92L118.89,308.06L115,305.51L115,303.91L116.16,303.52L117.2,300.22L114.95,297.08L114.41,288.91L112.71,288.09L113.16,285.16L111.29,283.37L110.69,280.9L111.74,280.2L113.58,281.98L119.91,281.91L121.08,280.12L123.35,279.43L124.47,277.44L126.39,278.3L127.83,277.81L128.89,275.46L128.2,268.77L129.93,268.27L132.06,263.45L131.31,260.28L133.45,258.26L137.55,258.58L137.19,254.88z"},{"code":"TH-TK","name":"Tak","path":"M27.06,190.27L34,190.44L37.77,188.16L38.29,185.16L42.13,184.19L42.57,187.42L44.86,191.21L46.94,197.8L50.35,200.48L50.35,200.48L53.5,207.24L58.37,207.31L62.26,204.57L64.22,204.8L66.4,212.18L65.92,215.99L63.88,216.62L66.69,220.68L65.6,222.71L66.48,224L68.59,224.95L75.02,223.15L77,224.04L77.45,224.05L77.7,225.88L80.1,225.92L82.94,225.2L83.19,224.35L81.81,224.63L82.08,220.56L80.45,219.72L81.87,214.88L79.7,213.05L79.21,209.36L80.93,205.91L83.73,204.51L82.18,201.97L80.1,201.6L79.65,195.58L78.21,191.88L78.64,189.8L77.55,189.2L77.56,188.04L79.24,187.29L81.97,189.3L82.83,188.32L84.49,188.85L86.49,190.93L87.2,193.46L90.78,190.64L90.78,190.64L94.5,196.57L90.32,198.51L90.22,203.28L91.55,206.2L91.8,210L90.24,212.83L90.76,215.4L92.58,212.6L94.8,212.31L100.21,209.05L102.09,209.29L103.55,210.7L105.62,207.58L105.62,207.58L106.67,208.5L107.04,211.9L110.29,212.41L112.44,216.13L113.83,216.42L114.86,218.15L118.98,220.05L119.28,219.2L121.18,219.9L121.99,221.51L123.35,221.54L126.94,216.73L129.85,217.1L130.26,221.96L132.89,226.33L132.89,226.33L132.79,235.17L133.87,235.71L133.27,237.42L134.51,238.8L136.41,238.51L138.13,239.44L138.19,243.45L140.77,244.43L139.36,246.59L139.62,249.57L141.65,251.54L140.35,253.54L140.35,253.54L137.19,254.88L137.55,258.58L133.45,258.26L131.31,260.28L132.06,263.45L129.93,268.27L128.2,268.77L128.89,275.46L127.83,277.81L126.39,278.3L124.47,277.44L123.35,279.43L121.08,280.12L119.91,281.91L113.58,281.98L111.74,280.2L110.69,280.9L111.29,283.37L113.16,285.16L112.71,288.09L114.41,288.91L114.95,297.08L117.2,300.22L116.16,303.52L115,303.91L115,305.51L118.89,308.06L119.46,309.92L117.24,313.19L117.6,316.38L116.63,317.81L118.15,319.87L117.53,322.97L117.53,322.97L118.09,326.75L120.75,329.4L120.75,329.4L120.21,331.3L120.95,333.54L119.12,338.18L119.26,340.86L117.97,344.12L114.88,345.93L116.93,350.02L115.36,353.75L116.25,357.08L113.69,361.2L114.2,364.43L112.01,367.96L111.77,371.74L110.51,371.93L110.51,371.93L108.63,367.41L106.48,367.45L105.74,366L103.93,365.43L104.23,364.29L102.89,362.02L100.38,360.56L95.03,353.87L95.26,351.67L91.67,349.87L93.02,348.61L87.93,340.57L86.37,341.03L83.58,338.7L82.69,339.07L82.69,339.07L81.88,339.29L81.06,337.11L85.33,323.62L84.36,323.68L83.59,320.72L85.2,316.55L84.08,314.11L82.08,312.77L82.43,311.1L83.37,310.64L86.34,312.08L88.74,309.93L90.02,306.12L91.32,305.62L94.34,306.75L96.77,306.24L98.4,307.78L101.36,306.13L102.32,303.15L101.71,299.73L105.07,297.36L105.64,294.16L106.75,293.65L107,292.12L105.48,290.8L106.15,288.14L103.52,285.42L100.2,285.54L99.25,288.1L96.48,290.72L93.27,291.95L91.46,296.22L89.72,296.13L87.22,285.29L88.55,283.36L88.11,282.16L83.09,276.08L83.73,274.09L82.71,271.03L78.73,270.02L79.01,266.68L75.4,264.11L75.42,262.6L76.41,262.98L77.17,261.17L76.92,259.91L78.17,260.15L79.01,258.77L81.13,258.11L77.44,256.26L78.49,253.67L80.28,252.3L77.28,250.58L77.06,247.14L76.04,245.44L74.46,245.36L74.85,243.65L73.22,243.71L73.71,242.7L70.41,241L67.38,241.82L65.58,240.34L64.98,238.13L63.07,237.15L63.93,234.37L62.42,234.49L60.65,230.49L59.45,230.88L57.95,227.75L55.85,226.99L51.65,222.68L51.63,218.14L49.6,217.75L47.28,215.02L47.92,214.16L43.71,209.39L42.3,209.5L41.6,208.11L39.09,207.36L37.91,204.24L30.31,197.47L28.25,194.33L28.99,192.35L27.03,191.13z"},{"code":"TH-ST","name":"Sukhothai","path":"M143.47,193.36L146.66,189.21L152.01,187.51L155.45,189.31L156.8,188.98L160.62,194.54L162.37,193.29L164.41,189.63L172.11,188.54L172.11,188.54L173.83,190.02L173.66,192.59L176.64,195.28L177.51,199.02L176.74,200.82L177.35,201.57L173.91,204.07L175.13,207.05L174.09,208.64L177.8,211.02L179.27,213.08L179.31,215.81L178.33,216.98L179.67,218.39L179.09,220.4L180.02,222.26L178.86,224.72L176.81,225.51L176.06,228.27L176.27,229.03L177.84,230.12L177.67,233.04L177.67,233.04L175.88,233.54L176.56,236.34L175.66,237.17L175.64,239.56L176.72,240.23L178.63,239.62L180.15,242.9L185.42,245.55L186.34,246.91L185.66,247.06L186.5,250.94L184.88,252.77L179.6,252.85L180.19,255.43L178.37,254.42L175.79,255.07L175.11,257.34L173.03,258.92L173.86,261.59L170.63,261.45L169.37,263.63L169.37,263.63L168.56,265.12L166.58,264.73L165.72,266.75L163.5,267.39L160.92,265.53L161.18,263.65L158.51,265.02L158.44,263.98L157.16,264.18L153.56,262.07L150.57,257.39L150.66,255.36L146.32,254.45L144.61,251.6L142.6,253.72L140.35,253.54L140.35,253.54L141.65,251.54L139.62,249.57L139.36,246.59L140.77,244.43L138.19,243.45L138.13,239.44L136.41,238.51L134.51,238.8L133.27,237.42L133.87,235.71L132.79,235.17L132.89,226.33L132.89,226.33L134.58,226.45L136.78,230.26L137.9,230.67L141.26,229.05L141.35,227.55L142.36,227.37L142.3,223.52L143.84,222.14L143.45,219.69L140.6,217.66L141.48,214.72L139.97,214.12L139.01,212.12L140.02,208.8L141.25,208.09L140.99,205.65L139.51,204.93L139.89,203.11L141.24,202.4L142.19,203.21L141.82,199.94L143.75,197.65z"},{"code":"TH-PL","name":"Phitsanulok","path":"M246.18,193.58l0.91,2.49l-1.16,1.77l-0.03,3.9l-2.19,3.18l0,0l-1.76,0.41l-1.81,-1.67l-1.7,0.51l-1.34,2.78l0.81,1.1l-1.96,1.91l-0.64,2.43l1.52,1.16l2.51,-0.94l1.45,0.95l-0.02,7.66l6.07,0.54l2.97,3.58l2.24,0.21l1.77,3.11l-2.17,4l0.1,2.73l-1.88,4.22l0.51,3.53l-1.21,2.71l0.7,2.18l-1.6,0.96l0.46,0.94l2.46,0.44l-0.1,1.49l0,0l-1.72,0.11l-1.43,2.51l-4.54,3.01l0.08,2.04l-3.55,-0.29l-0.47,1.92l1.56,1.02l-0.37,1.77l1.9,3.59l-1.28,1.04l-2.19,-0.24l-1.73,1.77l-1.19,3.61l0.7,3.16l-2.78,4.47l-1.52,0.72l0.8,1.63l-1.23,0.03l-1.09,1.62l-4.33,0.43l-0.31,3.16l-3.62,3.33l0,0l-2.58,1.19l0.88,-3.77l-1.49,-1.42l-0.43,-5.79l-0.84,-0.41l-0.07,-3.32l1.13,-2.75l-0.69,-2.45l-5.28,1.41l-2.79,3.74l-3,0.83l-1.32,-1.26l-0.67,0.52l-1.16,-1.89l-3.79,1.54l-3.78,-0.95l-2.03,0.62l-0.16,-6.54l-1.09,-1.73l-1.74,1l0.87,0.6l-0.86,1.49l-2.33,0.68l-2.64,-1.03l-2.11,0.74l-0.26,1.29l-4.61,0.31l0,0l-0.45,-0.75l-3.16,0.91l-3.26,-2.32l-0.83,-8.17l-2.9,-0.98l0,0l1.26,-2.18l3.24,0.14l-0.83,-2.68l2.07,-1.58l0.69,-2.27l2.58,-0.64l1.82,1.01l-0.59,-2.58l5.28,-0.08l1.63,-1.83l-0.84,-3.88l0.68,-0.15l-0.92,-1.36l-5.27,-2.65l-1.52,-3.28l-1.91,0.61l-1.07,-0.67l0.02,-2.39l0.9,-0.83l-0.68,-2.81l1.79,-0.5l0,0l1.4,-0.91l2.03,1.55l0.45,-1.11l8.15,-2.23l1.18,1.5l0.86,-0.18l4.36,-3.59l-0.94,-7.04l2.7,-1.93l1.69,-0.51l1.38,0.73l0.33,-1.24l2.57,-0.14l4.01,-2.3l3.85,0.24l1.14,-0.73l0.89,1.72l1.1,-0.92l4.55,-0.42l1.08,-2.98l2.11,-0.59l-0.18,-1.4l6.46,-3.34l4.29,-6.83l2.83,-1.17l2.06,-3.96l5.4,0.77l2.27,-3.03l0,0L246.18,193.58z"},{"code":"TH-PC","name":"Phichit","path":"M179.95,274.94L184.56,274.63L184.83,273.34L186.93,272.6L189.57,273.63L191.9,272.95L192.77,271.47L191.9,270.87L193.63,269.87L194.72,271.6L194.89,278.14L196.92,277.52L200.7,278.47L204.49,276.93L205.65,278.82L206.32,278.3L207.64,279.56L210.64,278.73L213.43,274.98L218.71,273.57L219.4,276.03L218.27,278.77L218.34,282.09L219.18,282.5L219.61,288.3L221.1,289.71L220.22,293.48L222.79,292.3L222.79,292.3L222.91,294.52L224.92,297.6L227.12,296.49L227.66,297.33L222.47,305.36L223.2,307.68L221.95,311.87L228.02,313.17L230.97,315.05L230.97,315.05L221.28,316.5L218.31,317.72L214.36,321.15L214.83,319.12L210.77,320.19L201.33,319.22L202.38,316.83L200.84,315.94L200.89,317.17L197.08,319.22L196.55,317.87L195.32,317.77L194.32,320.56L192.71,319.59L191.11,320.29L189.92,316.39L186.88,311.7L186.71,309.42L184.3,306.23L185.3,304.08L181.3,301.37L181.3,301.37L182.77,299.08L180.52,297.63L181.1,295.76L179.66,295.93L179.03,294.9L180.9,291.91L179.38,291.57L177.91,288.65L178.73,284.31L181.38,280.04z"},{"code":"TH-PN","name":"Phetchabun","path":"M251.11,251.88L252.79,252.64L253.65,252.06L254.23,243.92L257.9,242.31L259.99,238.77L260.03,236.59L261.54,235.89L264.01,238.87L267.42,238.62L268.64,240.14L269.5,239.07L272.53,239.56L273.68,238.6L276.01,240.04L277.75,238.56L278.98,240.17L282.3,241.42L282.51,243.61L284.6,246.11L287.5,245.15L288.89,242.04L290.24,242.37L292.01,246.84L291.75,248.52L292.93,249.69L292.15,254.96L295.08,258.75L292.72,259.4L295.44,262.53L299.44,261.81L299.44,261.81L299.59,264.62L296.9,268.4L296.9,268.4L295.44,269.58L292.5,267.03L289.2,267.54L285.95,264.42L283.82,264.06L285.4,268.12L285.02,269.74L280.92,267.62L281.95,271.78L280.2,272.49L279.93,275.21L281.47,276.78L278.34,278.15L277.72,280.06L278.37,281.66L273.59,287.32L274.18,288.69L272.41,290.25L271.73,296.25L270.18,297.38L271.79,298.23L272.2,301.89L270.96,302.18L269.48,304.42L268.23,312.2L269.48,316.08L270.57,317.65L271.68,317.33L270.79,320.34L271.72,320.67L268.81,323.38L268.75,328.78L267.81,329.71L269.07,332.11L273.85,333.43L271.43,344.33L271.43,344.33L271.43,344.33L271.43,344.33L267.39,344.74L265.93,347.47L266.96,348.52L267.03,357.62L260.25,362.35L255.55,361.92L252.63,360.13L251.14,361.13L248,361.03L244.88,357.7L244.99,355.88L242.95,353.57L239.39,351.56L234.65,351.21L232.33,348.15L230.26,348.25L230.26,348.25L232.4,347.21L233.83,345.03L234.81,337.61L236.26,336.23L234.25,335.02L232.78,327.19L233.71,323.36L230.54,321.22L231.91,316.2L230.97,315.05L230.97,315.05L228.02,313.17L221.95,311.87L223.2,307.68L222.47,305.36L227.66,297.33L227.12,296.49L224.92,297.6L222.91,294.52L222.79,292.3L222.79,292.3L226.41,288.97L226.73,285.81L231.06,285.38L232.15,283.75L233.38,283.72L232.58,282.09L234.1,281.38L236.88,276.91L236.18,273.76L237.37,270.15L239.1,268.38L241.29,268.62L242.57,267.58L240.67,263.99L241.04,262.21L239.47,261.19L239.94,259.27L243.5,259.56L243.42,257.52L247.96,254.51L249.39,252z"},{"code":"TH-RT","name":"Ratchaburi","path":"M170.73,457.22L174.04,458.06L173.29,460.19L172.07,460.42L173.1,462.52L172.37,464.67L176.13,465.04L176.97,466.83L175.16,471.39L175.84,472.2L179.01,471.88L180.85,470.72L180.74,474.25L181.35,474.98L183.51,474.7L183.49,477.81L183.49,477.81L182.65,480.02L181.14,480.51L181.97,484.97L181.01,487.68L181.01,487.68L179.69,487.16L178.71,488.54L176.75,489.12L173.23,487.42L173.66,488.14L171.71,490.26L169.34,499.99L169.34,499.99L162.69,498.94L159.13,500.53L156.43,502.94L156.34,507.85L154.44,508.71L150.5,509.04L146.76,508.17L145.77,510.2L143.8,508.81L142.61,510.06L141.28,509.93L135.22,505.94L133.38,507.47L133.43,510.42L129.88,512.38L127.08,508.7L125.78,508.35L125.78,508.35L124.84,505.09L125.81,504.67L124.22,502.54L125.67,499.41L125.72,491.13L124.42,488.57L124.71,485.34L122.82,483.23L123.78,482.4L122.97,480.78L122.88,472.51L122.88,472.51L123.27,471.66L125.05,472.43L126.61,470.98L129.54,471.46L130.77,470.19L131.7,471.59L135.39,471.15L142.13,468.81L143.32,467.06L145.6,469.8L148.58,470.38L156.5,464.33L166.25,466.91L166.93,463.04L168.03,462.99z"},{"code":"TH-KC","name":"Kanchanaburi","path":"M82.69,339.07L83.58,338.7L86.37,341.03L87.93,340.57L93.02,348.61L91.67,349.87L95.26,351.67L95.03,353.87L100.38,360.56L102.89,362.02L104.23,364.29L103.93,365.43L105.74,366L106.48,367.45L108.63,367.41L110.51,371.93L110.51,371.93L112.04,374.46L111.68,379.48L112.93,380.74L116.81,381.84L121.19,380.94L120.73,381.89L122.49,383.43L124.48,382.68L127.3,383.68L128.87,385.38L130.79,384.92L130.79,384.92L133.25,388.12L132.96,392.12L130.65,394.21L131.41,396.09L135.76,400.36L141.03,400.1L142.89,405.57L146.24,405.18L148.63,403.8L148.5,398.29L149.95,399.53L153.09,399.66L155.38,398.12L160.71,401.89L165.27,402.64L163.86,404.85L165.21,405.58L167.72,410.97L165.99,411.39L165.37,413L166.98,414.07L166.32,416.06L166.92,438.13L164.48,440.52L163.34,439.93L162.69,441.12L161.9,440.89L160.75,446.34L162.43,447.42L164.92,446.83L166.28,449.19L168.46,449.62L168.46,449.62L169.14,450.8L167.54,453.75L168.56,453.84L170.73,457.22L170.73,457.22L168.03,462.99L166.93,463.04L166.25,466.91L156.5,464.33L148.58,470.38L145.6,469.8L143.32,467.06L142.13,468.81L135.39,471.15L131.7,471.59L130.77,470.19L129.54,471.46L126.61,470.98L125.05,472.43L123.27,471.66L122.88,472.51L122.88,472.51L122.09,470.68L119.94,469.46L119.92,466.7L118.49,464.88L119.15,461.4L117.13,461.2L115.85,458.75L113.14,457.39L111.66,452.45L109.83,451.52L108.98,447.11L104.89,446.22L102.88,443.69L92.58,436.84L91.34,434.82L84.86,431.48L84.54,428.33L82.45,427.21L77.35,416.39L75.35,417.06L75.19,413.75L73.59,411.31L69.05,407.72L68.14,405.53L66.16,404.71L61.05,396.48L61.95,394.58L59.9,392.22L61.21,390.5L59.84,386.85L58.29,385.77L58.58,383.07L59.95,381.64L56.53,376.67L58.57,372.27L57.58,368.53L61.27,368.89L64.78,365.13L64.76,362.85L71.74,366.92L72.62,365.71L71.02,363.4L72.57,362.18L72.65,359.6L76.98,357.66L80.57,359.03L81.88,361.51L83.33,359.22L83.9,354.02L83.45,348.15L81.72,342.82z"},{"code":"TH-SH","name":"Suphan Buri","path":"M130.79,384.92L132.32,382.79L131.95,380.69L134.15,378.85L136.23,381.15L139.85,381.14L141.56,385.66L145.75,385.54L154.14,388.74L154.37,385.24L159.88,386.12L159.88,386.12L160.29,387.13L169.14,388.66L171.13,390.55L176.62,391.25L181.86,390.18L181.75,387.25L186.62,388.28L188.15,390.6L192.64,387.72L192.64,387.72L191.29,389.75L191.83,391.09L193.98,391.01L192.97,391.54L194.16,392.65L192.79,397.7L194.36,399.04L194.36,399.04L193.09,400.13L192.9,402.48L193.1,406.63L194.57,408.69L192.17,411.66L193.19,413.71L192.21,415.01L192.95,417.58L196.07,420.41L196.07,420.41L195.77,423.56L197.42,424.07L197.98,425.88L197.03,427.27L197.05,431.24L195.39,434.06L195.35,439.24L195.35,439.24L193.49,441.09L189.49,442.18L187.88,443.62L175.06,444.37L168.46,449.62L168.46,449.62L166.28,449.19L164.92,446.83L162.43,447.42L160.75,446.34L161.9,440.89L162.69,441.12L163.34,439.93L164.48,440.52L166.92,438.13L166.32,416.06L166.98,414.07L165.37,413L165.99,411.39L167.72,410.97L165.21,405.58L163.86,404.85L165.27,402.64L160.71,401.89L155.38,398.12L153.09,399.66L149.95,399.53L148.5,398.29L148.63,403.8L146.24,405.18L142.89,405.57L141.03,400.1L135.76,400.36L131.41,396.09L130.65,394.21L132.96,392.12L133.25,388.12z"},{"code":"TH-NM","name":"Nakhon Pathom","path":"M195.35,439.24L195.64,441.7L198.16,441.99L197.88,445.07L197.88,445.07L196.91,453.1L199.1,456.27L196.83,459.16L200.53,465.97L200.53,465.97L201.34,472.09L201.34,472.09L198.31,473.66L196.91,475.68L194.24,476.5L193.53,475.28L190.16,475.21L188.03,475.67L186.01,477.9L183.49,477.81L183.49,477.81L183.51,474.7L181.35,474.98L180.74,474.25L180.85,470.72L179.01,471.88L175.84,472.2L175.16,471.39L176.97,466.83L176.13,465.04L172.37,464.67L173.1,462.52L172.07,460.42L173.29,460.19L174.04,458.06L170.73,457.22L170.73,457.22L168.56,453.84L167.54,453.75L169.14,450.8L168.46,449.62L168.46,449.62L175.06,444.37L187.88,443.62L189.49,442.18L193.49,441.09z"},{"code":"TH-SM","name":"Samut Sakhon","path":"M201.34,472.09L201.89,478.47L203.96,479.27L205.6,484.23L207.16,484.02L206.5,488.61L206.5,488.61L201.03,489.07L198.06,487.81L197.51,487.71L196.56,489.49L184.32,493.3L184.32,493.3L183.92,491.13L181.01,487.68L181.01,487.68L181.97,484.97L181.14,480.51L182.65,480.02L183.49,477.81L183.49,477.81L186.01,477.9L188.03,475.67L190.16,475.21L193.53,475.28L194.24,476.5L196.91,475.68L198.31,473.66z"},{"code":"TH-SR","name":"Samut Songkhram","path":"M169.34,499.99L171.71,490.26L173.66,488.14L173.23,487.42L176.75,489.12L178.71,488.54L179.69,487.16L181.01,487.68L181.01,487.68L183.92,491.13L184.32,493.3L184.32,493.3L182.27,494.39L180.49,497.68L178.9,497.24L178.92,499.61L175.79,502.22L175.79,502.22L174,503.29L171.98,502.86L171.21,505.65L169.53,505.69z"},{"code":"TH-PH","name":"Phetchaburi","path":"M125.78,508.35L127.08,508.7L129.88,512.38L133.43,510.42L133.38,507.47L135.22,505.94L141.28,509.93L142.61,510.06L143.8,508.81L145.77,510.2L146.76,508.17L150.5,509.04L154.44,508.71L156.34,507.85L156.43,502.94L159.13,500.53L162.69,498.94L169.34,499.99L169.34,499.99L169.53,505.69L171.21,505.65L171.98,502.86L174,503.29L175.79,502.22L175.79,502.22L175.06,504.25L178.02,506.38L180.29,509.81L183.49,511.75L183.49,517.02L185.66,518.74L181.6,525.02L176.69,540.34L175.96,547.78L175.96,547.78L173.76,548.43L172.59,547.57L171.1,548.6L167.24,547.98L162.75,551.21L162.12,548.08L161.3,548.41L159.95,546.58L155.11,547.54L153.33,546.5L152.94,549.01L153.94,550.46L153.21,554.13L151.61,553.6L150.56,551.49L147.98,551.59L146.72,552.71L144.49,550.7L141.19,551.22L141.19,551.22L139.37,548.98L137.14,548.98L134.83,547.26L134.4,545.82L131.51,544.72L131.84,543.95L129.78,541.2L127.76,541.57L126.58,534.72L124.14,532.9L123.92,528.73L122.56,527.59L124.75,525.6L124.73,523.23L119.98,519.96L118.31,517.59L120.59,514.46L120.62,511.27L119.44,510.46L119.9,509.2L122.19,508.25L124.98,509.28z"},{"code":"TH-PK","name":"Prachuap Khiri Khan","path":"M141.19,551.22l3.3,-0.52l2.23,2.01l1.26,-1.12l2.58,-0.1l1.04,2.11l1.6,0.53l0.73,-3.67l-1,-1.45l0.39,-2.51l1.78,1.04l4.84,-0.96l1.34,1.83l0.82,-0.33l0.64,3.13l4.48,-3.23l3.86,0.62l1.49,-1.03l1.16,0.86l2.2,-0.65l0,0l0.1,3.65l1.87,4.4l-0.71,1.1l0.35,4.52l1.58,6.64l-1.95,4.9l3.02,5.18l-3.35,3.72l-0.51,3.41l-1.32,0.3l-4.85,5.43l-2.57,4.16l-1.33,3.94l1.51,3.33l-1.23,-0.25l-1.18,1.44l1.3,2.24l-1.52,1l1.06,2.19l-1.33,-0.51l-3.98,3.72l-6.36,11.86l-5.86,14.61l0.26,3.87l1.82,2.39l-0.2,1.15l-0.9,0.81l-1.39,-1.68l-1.4,0.61l-2.42,3.69l0.52,10.7l0,0l-1.77,-0.26l-4.13,2.52l-4.25,-1.37l-4.43,1.21l-7.5,-3.04l-1.42,-0.89l0.23,-1.19l0,0l0.93,-0.4l0.96,-2.95l3.08,-1.81l0,-2.29l2.6,-4.02l1.56,0.74l1.43,-1.85l-0.78,-2.16l2.06,-2.63l-0.97,-2.05l1.06,-1.34l1.01,0.25l1.5,-2.61l2.49,-1.19l-0.51,-4.95l1.75,-1.32l1.49,0.13l0.39,-2.02l1.71,-1.7l-1.07,-3.42l0.66,-2.16l2.68,-1.46l1.48,1.01l2.46,-0.33l1.63,-4.46l3.13,-2.43l0.26,-4.23l1.62,-2.36l-2.87,-0.65l-0.81,-2.44l-1.45,-0.29l-0.55,-4.8l0.92,-0.84l-0.1,-2.58l-3.71,-1.55l-0.21,-3.45l2.5,-5.44l-3.74,-0.17l-1.63,1.3l-1.24,-0.25l1.48,-3.91l-1.57,-3.15l0.86,-2.59l-1.56,-0.89l-1.84,-3.85l0.86,-4.38l-1.4,-1.32l-0.06,-1.59l-1.55,-0.71l0.27,-1.46l1.33,-0.73l-0.27,-4.14L141.19,551.22z"},{"code":"TH-NT","name":"Nakhon Si Thammarat","path":"M164.42,773.96l1.13,-0.11l0.47,1.32l1.83,-0.43l0.85,3.48l2.26,3.04l-0.43,4.67l2.32,2.91l0.35,12.78l2.96,20.2l0.9,1.41l2.43,0.64l5.43,11.36l3.31,1.67l2.36,0.08l-1.65,-3.44l1.12,-2.71l-0.35,-1.46l-3.02,-1.33l3.63,1.07l2.62,3.22l4.77,14.08l3.91,21.4l0,0l-1.67,-0.29l-0.3,1.52l-4.08,-0.17l-1.06,1.34l-5.88,1.82l0,0l-6.49,2.25l-4.05,-1.6l-1.95,-1.94l-2.55,0.45l-2.26,-0.76l-5.47,0.21l-1.57,2.26l-3.14,0.08l0,0l0.51,-3.5l-0.7,-2.44l1.61,-1.13l-1.87,-2.51l-1.74,0.49l-3.15,-1.56l-1.75,0.23l-1.95,1.71l-0.4,1.85l-3.36,2.71l-0.5,2.38l-1.62,0.46l-2.27,-0.36l-0.61,-1.62l-3.15,1.93l-0.34,-5.27l-1.55,-0.15l0,0l0.05,-1.87l1.22,-1.15l-2.1,-7.26l-2.61,-1.85l-3.35,0.23l-0.53,-1.29l2.1,-3.4l-0.51,-2.21l1.56,-2.4l-0.35,-1.47l-2.63,-1.48l0,0l-1.09,-2.61l-2.34,-1.04l-0.39,-1.29l1.69,-4.22l2.39,-1.66l-0.4,-0.87l0.91,0.45l1.94,-1.28l0.48,-1.49l1.53,1.34l3.32,-2.03l-0.3,-1.68l3.33,-3.19l-0.49,-2.04l0.98,-1.18l1.13,0.17l0.85,-3.31l2.05,-1.61l0.52,-2.74l-0.85,-5.1l2.83,-1.04l-0.16,-1.72l1.28,-2.37l1.98,-1.11l1.55,1.08l1.29,-1.24l3.31,-0.36l-0.15,-2.64l2.09,-0.41l1.4,-5.59l-0.05,-5.35l-1.35,-1.05l1.93,-4.33l-0.37,-4.91l1.43,-2.01l0,0L164.42,773.96z"},{"code":"TH-KB","name":"Krabi","path":"M114.1,886.79l2.93,3.76l-0.29,2.36l2.35,4.72l-0.91,1.6l-4.33,-6.75l-0.6,-5.23L114.1,886.79zM116.12,884.28l2.81,0.14l0.78,0.93l0.66,1.66l-0.8,4.13l-0.7,-1.03l-1.39,0.51l-1.25,-1l-2.04,-2.99l0.02,-2.08L116.12,884.28zM114.85,873.16l3.21,0.91l0.31,1.54l1.56,0.08l0.37,2.18l-2.45,6.27l-3.48,-0.79l-1.23,-3.26l0.49,-3.17l-0.86,-2.06l1.69,-0.38L114.85,873.16zM108.53,872.88l1.37,0.59l0.77,4.45l-3.47,-3.77L108.53,872.88zM112.32,871.03l1.96,1.6l-1.46,1.66l-1.08,-2.04L112.32,871.03zM116.4,869l0.58,0.76l-1.42,1.82L116.4,869zM110.46,868.1l1.11,1.95l-0.61,3.33l-1.59,-4.86L110.46,868.1zM91.54,820.44l1.27,0.16l1.72,-3.03l3.22,2.31l0.32,-1.01l2.92,0.02l6.18,6.29l0.84,9.31l6.49,4.25l5.31,-0.33l9.46,4.38l1.92,-0.75l0,0l2.63,1.48l0.35,1.47l-1.56,2.4l0.51,2.21l-2.1,3.4l0.53,1.29l3.35,-0.23l2.61,1.85l2.1,7.26l-1.22,1.15l-0.05,1.87l0,0l-0.52,0.52l0,0l-0.86,0.37l0,0l-4.32,2l-0.59,1.27l0.9,0.65l-2.58,2.17l1.06,1.94l-0.4,1.01l1.03,0.1l-1.04,2.36l1.21,1.23l0.23,3.03l-3.43,3.35l0,0l-5.43,-2.88l-0.63,-1.7l-2.12,-1.54l-0.63,-4.53l-1.78,-0.12l0.03,-1.57l-2.55,-0.84l2.12,-5.51l-1.66,0.94l2.11,-1.94l-0.06,-1.13l-4.9,5.31l-2.02,-3.51l-1.82,0.62l-2.02,-3.73l0.99,-0.83l-2.58,-2.45l0.06,-1.03l-2.64,-0.36l1.51,1.15l-1.53,1.32l-1.38,-0.5l-1.12,1.76l-2.76,-3l-1.99,0.33l-0.52,1.2l-1.84,-3.55l1.38,-3.66l-0.39,-1.41l-1.14,1.02l1.29,-4.5l-1.74,-2.79l0.34,-1.83l-0.6,-0.61l-0.57,3.98l-0.59,-6.4l-3.91,2.86l-0.5,-1.3l-1.05,0.38l0.62,-5.65l2.22,-0.91l-1.41,-1.84l1.12,-1.11l0,0l0.03,-2.16l-1.07,-1.52l3.9,-7.78L91.54,820.44z"},{"code":"TH-PG","name":"Phangnga","path":"M80.68,856.37l2.18,1.64l1.62,-0.35l-0.39,1.25l1.19,1.34l-0.73,1.73l0.97,3.71l-1.17,5.1l-0.95,-1.86l-0.16,1.68l-1.08,-4.64l0.06,-2.09l0.99,0.26l0.54,-1.78l-2.49,-1.6l-1.36,-2.32l-0.42,-1.24L80.68,856.37zM87.01,850.61l-1.63,7.16l-0.41,-1.26l-1.29,0.14l-1.62,-1.51l1.69,0.09l0.9,-2.46L87.01,850.61zM62.33,794.56l3.65,2.12l-3.83,8.01l-1.26,-3.34l1,-2.69l-1.06,-3.59L62.33,794.56zM63.68,784.13l2.97,6.24l-2.01,2.49l-3.52,0.68l-0.18,-6.59l0.81,-2.64L63.68,784.13zM66.33,784.75l0.22,2.21l-1.4,-1.83l0.06,-1.81L66.33,784.75zM65.26,778.05l-1.68,3.29l0.47,0.9l-2.13,1.66l0.02,-2.37l2.85,-3.94L65.26,778.05zM70.6,771.95l1.61,0.51l2.09,-0.76l1.46,1.46l-0.91,0.91l3.39,0.5l0,0l1.42,0.82l0.24,2.84l-2.3,3.64l0.41,3.19l-1.38,0.42l-0.11,1.63l0.92,2.89l-1.44,1.22l1.02,3.2l1.54,1.39l-4.04,2l-0.36,4.77l4.05,1.01l0.57,1.36l1.46,0.16l1.3,2.99l2.95,1.15l-0.3,5.76l-3.83,3.51l4.48,2.29l3.03,-2.24l1.73,-0.1l1.96,1.96l0,0l0.24,2.41l-3.9,7.78l1.07,1.52l-0.03,2.16l0,0l-1.42,0.93l0.94,1.97l-2.33,0.24l-0.83,-1.83l-1.24,3.17l-5.04,2.4l-0.69,-1.11l-0.77,1.62l-4.28,0.5l1.93,1.27l0.51,4.95l-1.6,1.87l-0.78,3.63l-1.39,-1.7l-1.65,2.42l-1.83,-4.16l-1.64,0.53l-0.62,-1.62l-3.03,-0.03l-1.77,-11.15l-3.39,-12.39l0.61,-0.8l1.69,1.55l1.18,2.61l0.14,-2.54l-2.41,-1.98l1.14,-1.48l-0.69,-2.04L60.8,819l-0.82,-4.59l-1.27,-1.01l1.48,0.03l1.57,-1.8l-0.59,-3.2l0.79,-3.37l3.92,-7.6l0.74,-0.47l1.84,1.27l1.5,2.18l-1.65,-3.85l1.5,-0.65l-1.39,-0.46l2.63,-2.32l-3.42,2.17l-2.02,-2.11l1.92,-2.39l2.59,0.96l-0.63,-1.17l0.84,-0.67l-1.29,0.21l0.23,-1.48l-1.39,0.36l-0.64,-3.73l-1.77,-3.04l0.92,-1.91l0.9,2.84l0.22,-2.73l2.23,1.9l-0.91,-2.28l-1.47,-0.96l1.65,-2.15l-0.53,-0.66l1.15,-0.61L70.6,771.95z"},{"code":"TH-PU","name":"Phuket","path":"M63.91,849.71l2.99,1.87l1.08,4.07l1.34,-0.48l0.88,2.25l1.31,0.39l1.86,-1.27l0.68,1.93l-2.21,3l1.07,2.59l-2.19,0.56l1.69,5.49l1.5,-1.11l0.24,2.1l-0.95,0.43l0.44,0.81l-2.62,-0.36l-0.36,1.38l1.15,0.9l0.13,2.4l-1.13,-0.86l-0.45,0.62l-0.74,-2.2l-0.82,-0.08l-1.36,1.06l-0.42,2.91l-1.88,1.5l-1.8,-2.08l0.95,-1.16l-0.57,-3.44l-1.98,-2l1.89,-0.01l0.45,-1.51l-2.54,-1.85l1.7,-1.49l-0.85,-2.08l0.97,0.25l0.46,-0.9l-1.44,-4.94l2.09,-2.47l-1.2,-5.99L63.91,849.71z"},{"code":"TH-SU","name":"Surat Thani","path":"M183.67,755.49l1.39,1.34l-2.3,3.81l1.16,2.94l-1.63,0.13l-2.68,3.34l-3.06,0.73l-0.9,-0.88l-1.49,0.32l0.35,-2.69l-1.08,-2.38l1,-0.4l0.05,-2.71l-1.46,-2.29l4.66,-1.13l4.81,2.08L183.67,755.49zM93.94,754.71l1.85,-1.84l0.15,-3.97l5.15,-1.15l1.79,-1.83l2.23,-0.32l6.21,2.19l0.58,-0.49l4.73,4.01l1.4,-0.78l-1.6,-1.71l0.42,-1.06l2.64,0.71l2.8,-0.71l0,0l0.78,3.32l2.62,3.6l2.17,7.95l4.38,5.98l-1.09,-0.4l-1.86,2.75l-2.99,1.66l0.26,5.4l1.2,1.51l1.78,1.09l2.87,-1.62l2.03,2.28l1.55,-0.46l0.5,1.74l2.91,-1.07l3.62,0.5l1.72,-1.04l2.53,-4.81l5.15,1.17l2.74,-2.53l2.36,-0.57l-0.08,-1.63l2.9,1.7l3.1,-0.69l0,0l-1.43,2.01l0.37,4.91l-1.93,4.33l1.35,1.05l0.05,5.35l-1.4,5.59l-2.09,0.41l0.15,2.64l-3.31,0.36l-1.29,1.24l-1.55,-1.08l-1.98,1.11l-1.28,2.37l0.16,1.72l-2.83,1.04l0.85,5.1l-0.52,2.74l-2.05,1.61l-0.85,3.31l-1.13,-0.17l-0.98,1.18l0.49,2.04l-3.33,3.19l0.3,1.68l-3.32,2.03l-1.53,-1.34l-0.48,1.49l-1.94,1.28l-0.91,-0.45l0.4,0.87l-2.39,1.66l-1.69,4.22l0.39,1.29l2.34,1.04l1.09,2.61l0,0l-1.92,0.75l-9.46,-4.38l-5.31,0.33l-6.49,-4.25l-0.84,-9.31l-6.18,-6.29l-2.92,-0.02l-0.32,1.01l-3.22,-2.31l-1.72,3.03l-1.27,-0.16l0,0l-1.96,-1.96l-1.73,0.1l-3.03,2.24l-4.48,-2.29l3.83,-3.51l0.3,-5.76l-2.95,-1.15l-1.3,-2.99l-1.46,-0.16l-0.57,-1.36l-4.05,-1.01l0.36,-4.77l4.04,-2l-1.54,-1.39l-1.02,-3.2l1.44,-1.22l-0.92,-2.89l0.11,-1.63l1.38,-0.42l-0.41,-3.19l2.3,-3.64l-0.24,-2.84l-1.42,-0.82l0,0l2.73,-3.52l2.7,-0.47l1.67,1.75l3.67,-0.89l0.42,-2.27l-1.62,0.03l-0.05,-2.66l1.63,0.13l0.64,-0.68l-0.79,-2.11l1.68,-0.24l4.98,-5.08l-0.64,-1.99l-1.37,-0.57L93.94,754.71zM183.92,748.1l-0.87,1.36l-5.97,-3.3l-1.16,-3.88l0.58,-1.46l5.87,0.78l1.64,1.75L183.92,748.1zM168.04,719.01l1.22,2.48l-1.91,2.19l-0.84,-0.91l0.8,-1.47l-0.54,-1.49L168.04,719.01z"},{"code":"TH-RN","name":"Ranong","path":"M72.1,743.21l0.88,2.46l-2.56,2.06l0.41,-1.01l-1.08,-0.88L72.1,743.21zM74.89,736.93l1.01,0.43l-1.29,4.54l-1.42,-2.11l0.79,-1l-0.36,-1.46l0.93,-1.14L74.89,736.93zM103.47,674.13l0.62,0.78l0,0l1.69,1.8l-1.35,4.48l0.77,-0.58l1.64,1.25l-0.13,1.6l1.52,0.79l-0.37,1.74l0.92,-0.31l0.42,0.82l-1.61,2.37l1.44,2.05l-2.98,2.17l-2.27,3.38l1.12,4.02l1.86,0.28l0.98,2.97l-2.9,4.26l0.56,1.56l-2.57,5.34l1.24,1.82l-1.31,0.37l-0.42,4l-1.87,2.06l3.87,0.12l0.79,2.49l-2.59,2.32l-1.47,-0.01l-2.04,3.9l-2.27,-0.96l-1.69,1.14l-2.28,2.68l-0.14,1.97l-5.89,5.21l-0.39,1.66l1.33,4.9l0.89,0.55l-0.83,1.48l5.03,2.29l1.13,1.84l0,0l-0.04,1.29l1.37,0.57l0.64,1.99l-4.98,5.08l-1.68,0.24l0.79,2.11l-0.64,0.68l-1.63,-0.13l0.05,2.66l1.62,-0.03l-0.42,2.27l-3.67,0.89l-1.67,-1.75l-2.7,0.47l-2.73,3.52l0,0l-3.39,-0.5l0.91,-0.91l-1.46,-1.46l-2.09,0.76l-1.61,-0.51l0,0l0.3,-3.77l1.46,-0.31l2.5,-10.59l0.94,-0.17l-0.58,0.66l1.01,2.02l0.81,-0.61l1.07,1.55l-0.33,-2.71l2.42,-1.11l-1.76,-1.78l-2.92,-0.58l-0.11,-1.7l1.04,-0.4l1.67,1.8l0.33,-0.52l-0.56,-1.25l0.88,-1.61l-0.99,0.4l-0.92,-2.27l1.65,0.87l1.28,-0.67l1.83,-3.1l0.01,-1.32l-3.74,0.56l0.82,-1.05l-0.37,-1.93l2.06,0.03l2.62,-3.11l-0.22,-0.6l-2.48,2.49l-1.4,-3.61l1.2,-0.32l-0.32,-1.06l0.93,-0.9l0.95,0.72l0.86,-3.1l1.1,-0.62l1.24,-4.49l4.87,-8.42l5.07,-13.65l0.21,-4.65l3.86,-5.25l-0.59,-0.97l1.19,-2.94l-1.27,-5.34l-1.89,-1.07l0.59,-3.98L103.47,674.13z"},{"code":"TH-CP","name":"Chumphon","path":"M121.74,657.28l-0.23,1.19l1.42,0.89l7.5,3.04l4.43,-1.21l4.25,1.37l4.13,-2.52l1.77,0.26l0,0l-0.35,3.41l1.93,2.72l-0.66,1.75l-0.84,0.79l-1.09,-1.82l-0.93,1.12l-1.77,0.04l-1.89,7.36l-3.62,4.87l0.7,1.09l-0.73,0.73l-0.63,-1.24l-1.88,0.73l-2.72,4.74l-0.47,4.08l-2.4,0.46l0.27,1.84l1.67,-0.42l-0.6,1.08l-1.77,0.31l-0.3,1.48l3.74,4.21l0.01,3.33l-0.76,0.64l-1.22,-0.67l-1.02,1.29l-3.13,-1.93l-3.09,1.91l0.8,3.67l2.34,1.65l0.85,-0.37l-0.15,1.46l1.2,1.6l1.74,-0.43l-2.3,1.59l-1.3,-0.3l-3.1,6.21l0.3,3.6l2.04,2.23l-0.43,1.97l-1.06,-0.25l-0.62,1.3l0.97,9.1l-1.87,2.59l1.43,7.94l0,0l-2.8,0.71l-2.64,-0.71l-0.42,1.06l1.6,1.71l-1.4,0.78l-4.73,-4.01l-0.58,0.49l-6.21,-2.19l-2.23,0.32l-1.79,1.83l-5.15,1.15l-0.15,3.97l-1.85,1.84l0,0l-1.13,-1.84l-5.03,-2.29l0.83,-1.48l-0.89,-0.55l-1.33,-4.9l0.39,-1.66l5.89,-5.21l0.14,-1.97l2.28,-2.68l1.69,-1.14l2.27,0.96l2.04,-3.9l1.47,0.01l2.59,-2.32l-0.79,-2.49l-3.87,-0.12l1.87,-2.06l0.42,-4l1.31,-0.37l-1.24,-1.82l2.57,-5.34l-0.56,-1.56l2.9,-4.26l-0.98,-2.97l-1.86,-0.28l-1.12,-4.02l2.27,-3.38l2.98,-2.17l-1.44,-2.05l1.61,-2.37l-0.42,-0.82l-0.92,0.31l0.37,-1.74l-1.52,-0.79l0.13,-1.6l-1.64,-1.25l-0.77,0.58l1.35,-4.48l-1.69,-1.8l0,0l1.09,-0.47l1.24,-3.12l2.38,1.01l3.51,-3.01l-0.77,-4.57l1.64,-3.17l2.27,1.57l1.47,-0.51l1.59,-4.01L121.74,657.28z"},{"code":"TH-SL","name":"Songkhla","path":"M204.38,910.21l0.01,0.13l0,0l0.54,1.85l3.44,1.8l-1.08,0.51l0,0l-1.41,0.5l-0.72,1.96l1.57,0.25l0.53,2.66l2.11,0.14l0.25,1.04l0.89,-0.83l1.42,1.54l4.18,-0.56l2.86,-2.44l-0.93,-3.54l13.22,17.17l3.59,1.68l1.34,-0.74l4.13,3.73l5.66,3.21l4.61,0.17l0,0l-1.33,1.17l2.06,0.79l-3.02,3.3l0.22,2.4l-0.92,1.2l2.51,0.56l0.17,3.11l3.34,2.86l0,0l-1.32,1.05l1.58,1.77l-2.84,2.81l-1.9,0.26l-1.2,2.85l-1.58,1.13l-1.56,-0.27l-1.1,2.35l-2.25,0.99l-0.71,2.64l0.8,5.16l-5.38,2.17l-0.41,-1.22l0,0l0.29,-3.17l-1.72,-0.18l0.1,-4.95l-3.07,-2.24l-1.71,0.27l-0.8,-3.27l-2.15,2.49l-3.74,1.85l-6.17,-3.5l-0.94,0.73l-2.45,-0.65l-1.44,-2.08l-2.16,-0.43l-2.29,1.13l-3.97,-1.72l-0.81,-2.18l-2.61,-2.07l0.74,-4.04l-1.75,-1.11l-0.24,-1.97l-1.15,0.04l-0.38,1.11l-2.51,-0.18l-2.06,-2.14l0,0l0.6,-2.34l-1.55,-3.24l2,-4.29l-2.4,-2.7l-4.23,-0.77l-2.89,-3.51l0.24,-1.49l-1.35,-1.46l1.09,-1.43l-1.02,-1.07l-0.5,-3.43l0,0l0.44,-2.02l3.26,-1.89l3.02,1.12l1.25,-1.78l8.76,-2.32l4.88,-7.06l0,0l0.03,0.09l0,0l-0.01,0.49l0,0L204.38,910.21zM188.66,872.03l5.88,-1.82l1.06,-1.34l4.08,0.17l0.3,-1.52l1.67,0.29l0,0l8.37,34.09l3.45,7.95l4.69,7.67l-2.23,0.08l-4.8,-4.11l-2.44,0.33l0,0l-1.94,-1.25l1.34,-0.88l-0.06,-1.8l-0.4,-3.51l-1.36,-1.28l0.44,-6.27l-1.29,-6.08l-4.82,-1.02l-2,4.89l-1.3,-0.96l-0.54,-2.52l1.66,-2.58l0,0l1.5,0.44l0,0l0.72,-3.13l-1.04,-7.82l0,0l-1.68,-3.41l-0.99,0.16l0,0l-1.05,1.09l-3.34,0.33l0,0l-1.9,-1.83l-3.13,0.33L188.66,872.03z"},{"code":"TH-SA","name":"Satun","path":"M130.22,959.23l3.31,1.74l-0.84,2.86l-1.97,0.06L130.22,959.23zM128.25,958.86l0.69,1.81l-2.5,1.19l-2.6,-0.56l0.89,-1.92L128.25,958.86zM156.07,949.68l1.6,2.35l-0.37,3.96l1.36,5.3l-0.37,1.27l-1.14,-0.76l-0.2,1.87l-1.13,0.61l-4.12,-6.58l1.11,-1.05l0.14,-2.96l1.77,-1.28l0.15,-3.97L156.07,949.68zM163.23,922.29L163.23,922.29l1.44,-0.1l4.96,3.93l2.58,-1.86l4.39,-0.13l2.25,-1.03l0,0l2.02,1.57l0.73,-1.27l1.18,0.11l0,0l0.5,3.43l1.02,1.07l-1.09,1.43l1.35,1.46l-0.24,1.49l2.89,3.51l4.23,0.77l2.4,2.7l-2,4.29l1.55,3.24l-0.6,2.34l0,0l-2.23,2.16l0.62,2.66l-0.96,2.14l1.18,3.06l-1.86,0l0.46,5.34l-2.63,6.27l-1.54,-6.15l-1.14,0.09l0.84,-3.76l-1.27,-0.42l-0.97,2.81l-2.85,-1.97l-2.3,-4.28l-2.49,1.59l-0.09,-2.21l1.74,-0.84l-1.54,-3.28l-1.09,1.5l-0.84,-2.17l-1.12,-0.11l0.69,-2.59l-0.74,-0.83l-0.21,1.34l-1.7,0.05l-2.65,-4.69l-0.4,1.01l-1.86,-0.13l-1.78,-4.13l-1.71,0.36l-2.07,-2.03l-1.71,0.42l-1.31,-2.94l0.69,-0.47l-0.36,-2.66l1.61,-0.66l-0.37,-0.97l-1.25,0.73l-0.82,-2.91l1.02,-0.84l-1.02,-1.66l1.78,-2.48l0.38,0.73l2.44,-4.27L163.23,922.29z"},{"code":"TH-TR","name":"Trang","path":"M149.79,922.97l3.27,2.32l-3.4,-0.82l-0.75,-2.2L149.79,922.97zM138.38,912.73l3.54,0.83l-2.56,0.82l-1.96,2.5l-1.27,-1.24l0.24,-2.85l1.14,-1.03L138.38,912.73zM138.33,866.19l1.55,0.15l0.34,5.27l3.15,-1.93l0.61,1.62l2.27,0.36l1.62,-0.46l0.5,-2.38l3.36,-2.71l0.4,-1.85l1.95,-1.71l1.75,-0.23l3.15,1.56l1.74,-0.49l1.87,2.51l-1.61,1.13l0.7,2.44l-0.51,3.5l0,0l2.33,4.55l-0.26,1.32l1.11,0.64l0.31,3.98l1.98,1.42l-0.29,2.03l-1.89,0.35l1.65,1.51l-0.72,2.53l2.48,2.54l-1.04,2.33l2.06,1.83l-0.14,1.42l3.54,5.14l0.24,4.03l2.27,0.76l0.51,3.46l-0.89,1.68l4.39,8.6l0,0l-2.25,1.03l-4.39,0.13l-2.58,1.86l-4.96,-3.93l-1.44,0.1l0,0l-4.27,-0.53l-2.38,1.34l-0.6,-4.14l-3.48,2.59l-1.48,-0.73l-4.32,-7.44l0.75,-1.7l1.83,-0.42l1.72,-4.45l0.89,0.52l-1.06,-1.87l-1.44,3.68l-2.2,1.56l-1.36,-0.72l0.33,-8.33l-2.01,3.6l0.04,5.78l-1,0.6l-5.01,-1.64l-3.83,-4.75l0.72,-1.63l-1.44,-6.2l-1.12,-0.94l-0.99,0.72l-0.81,-1.25l1.41,-0.19l0.4,-1.53l-2.21,-3.99l-0.09,-1.91l-0.96,0.83l-0.56,-0.85l0.35,-2.11l0,0l3.43,-3.35l-0.23,-3.03l-1.21,-1.23l1.04,-2.36l-1.03,-0.1l0.4,-1.01l-1.06,-1.94l2.58,-2.17l-0.9,-0.65l0.59,-1.27l4.32,-2l0,0l0.86,-0.37l0,0L138.33,866.19z"},{"code":"TH-PA","name":"Phatthalung","path":"M204.84,903.51l0.46,0.04l0,0l0.27,4.66l2.1,1.74l-0.15,1.45l-1.53,0.76l-0.92,-0.48l-0.29,-3.25l-2.1,-1.57l2.02,-3.38l0,0L204.84,903.51zM201.54,901.86l0.07,-3.82l3.1,-1.2l-2.14,1.8l1.28,2.59l-0.48,2.12l-1.03,0.47l0.16,3.02l-1.68,-0.17l-0.22,-0.87l0.59,-3.37l1.16,-0.36L201.54,901.86L201.54,901.86L201.54,901.86zM161.19,872.97l3.14,-0.08l1.57,-2.26l5.47,-0.21l2.26,0.76l2.55,-0.45l1.95,1.94l4.05,1.6l6.49,-2.25l0,0l-1.14,4.72l3.13,-0.33l1.9,1.83l0,0l-3.71,3.34l1.97,14.08l1.91,1.93l1.51,-0.5l-0.15,2.05l2.14,5.29l2.87,2.46l0.04,1l1.74,-1.05l2,0.64l1.43,1.88l0,0l0.06,0.19l0,0l-4.88,7.06l-8.76,2.32l-1.25,1.78l-3.02,-1.12l-3.26,1.89l-0.44,2.02l0,0l-1.18,-0.11l-0.73,1.27l-2.02,-1.57l0,0l-4.39,-8.6l0.89,-1.68l-0.51,-3.46l-2.27,-0.76l-0.24,-4.03l-3.54,-5.14l0.14,-1.42l-2.06,-1.83l1.04,-2.33l-2.48,-2.54l0.72,-2.53l-1.65,-1.51l1.89,-0.35l0.29,-2.03l-1.98,-1.42l-0.31,-3.98l-1.11,-0.64l0.26,-1.32L161.19,872.97z"},{"code":"TH-PI","name":"Pattani","path":"M265.52,934.02L270.72,937.34L281.84,939.88L283.93,941.14L295.25,959.31L295.25,959.31L291.54,959.52L290.56,956.08L289.2,956.33L288.92,955.35L288.67,956.1L287.69,955.52L285.29,956.54L286.34,960.07L286.34,960.07L284.48,961.13L282.47,960.7L280.36,957.42L277.26,957.9L276.73,959.31L275.12,958.07L269.3,960.82L266.96,959.9L265.92,952.15L260.85,958.02L255.36,957.12L253.64,955.8L253.64,955.8L250.31,952.95L250.14,949.83L247.63,949.27L248.54,948.07L248.33,945.67L251.34,942.37L249.28,941.59L250.61,940.42L250.61,940.42L258.92,939.84L263.7,937.33L265.8,938.99L267.18,938.4L268.79,939.2L269.81,938.25L268.03,935.94L266.7,935.63L265.52,934.25L262.66,935.11z"},{"code":"TH-YL","name":"Yala","path":"M253.64,955.8L255.36,957.12L260.85,958.02L265.92,952.15L266.96,959.9L269.3,960.82L275.12,958.07L276.73,959.31L277.26,957.9L280.36,957.42L282.47,960.7L284.48,961.13L286.34,960.07L286.34,960.07L287.41,961.62L282.31,966.66L283.43,968.17L277.64,966.8L278.01,969.51L274.97,969.76L274.5,973.1L272.52,975.49L273.57,982.05L271.41,984.17L272.55,986.99L275.71,989.47L276.49,992.64L278.41,993.72L278.26,998.93L279.89,1001.63L279.41,1004.78L280.11,1005.38L280.11,1005.38L278.12,1006.63L272.93,1006.62L271.25,1009.23L267.66,1011.08L265.81,1010.16L264.91,1010.72L263.21,1014.18L263.7,1017.34L255.43,1024L254.03,1019.85L250.71,1015.58L248.4,1015.14L245.43,1011.18L247.41,1009.24L246.78,1008.22L248.09,1004.03L252.14,1004.16L254.93,999.62L253.54,998.22L254,995.79L253.29,994.46L255.27,991.28L250.32,988.54L252.15,986.13L254.88,985.02L253.46,982.14L253.9,981.4L252.71,980.57L247.67,981.07L244.87,978.65L242.33,981.33L239.97,981.64L238.23,980.51L236.97,981.99L235.27,978.78L235.78,977.49L235.78,977.49L236.19,978.71L241.57,976.55L240.77,971.39L241.48,968.75L243.72,967.76L244.83,965.4L246.39,965.68L247.97,964.55L249.17,961.7L251.07,961.44L253.91,958.62L252.33,956.85z"},{"code":"TH-NW","name":"Narathiwat","path":"M286.34,960.07L285.29,956.54L287.69,955.52L288.67,956.1L288.92,955.35L289.2,956.33L290.56,956.08L291.54,959.52L295.25,959.31L295.25,959.31L301.55,967.81L305.33,969.57L310.58,975.34L319.59,981.56L319,984.83L320.03,988.28L317.39,992.76L313.15,995.46L310.1,999.06L308.46,1003.73L309.96,1006.79L308.19,1008.72L305.94,1009.12L305.7,1010.85L302.35,1012.46L301.84,1015.78L299.67,1014.64L297.47,1011.7L294.74,1012.46L293.72,1014.32L291.14,1010.59L291.03,1006.76L289.24,1006.26L285.61,1002.59L280.11,1005.38L280.11,1005.38L279.41,1004.78L279.89,1001.63L278.26,998.93L278.41,993.72L276.49,992.64L275.71,989.47L272.55,986.99L271.41,984.17L273.57,982.05L272.52,975.49L274.5,973.1L274.97,969.76L278.01,969.51L277.64,966.8L283.43,968.17L282.31,966.66L287.41,961.62z"},{"code":"TH-LS","name":"Lake Songkhla","path":"M192.55,878.25l3.34,-0.33l1.05,-1.09l0,0l0.89,-0.25l1.78,3.5l0,0l1.04,7.82l-0.72,3.13l0,0l-1.5,-0.44l0,0l-1.66,2.58l0.54,2.52l1.3,0.96l2,-4.89l4.82,1.02l1.29,6.08l-0.44,6.27l1.36,1.28l0.4,3.51l0.06,1.8l-1.34,0.88l1.94,1.25l0,0l-1.39,0.66l0,0l1.08,-0.51l-3.44,-1.8l-0.54,-1.85l0,0l-0.01,-0.19l0,0l0.01,-0.49l0,0l-0.09,-0.28l0,0l-1.43,-1.88l-2,-0.64l-1.74,1.05l-0.04,-1l-2.87,-2.46l-2.14,-5.29l0.15,-2.05l-1.51,0.5l-1.91,-1.93l-1.97,-14.08L192.55,878.25zM201.6,898.04l-0.07,3.82l0.81,0.22l-1.16,0.36l-0.37,4.24l1.68,0.17l-0.16,-3.02l1.03,-0.47l0.48,-2.12l-1.28,-2.59l2.14,-1.8l-1.1,0.78L201.6,898.04zM204.71,903.47L204.71,903.47l-2.02,3.38l2.1,1.57l0.29,3.25l0.92,0.48l1.53,-0.76l0.15,-1.45l-2.1,-1.74l-0.27,-4.66L204.71,903.47z"}]; + tuiChart.registerMap('thailand', data); +})(tui.chart); diff --git a/dist/maps/usa.js b/dist/maps/usa.js new file mode 100644 index 000000000..73a7a7b89 --- /dev/null +++ b/dist/maps/usa.js @@ -0,0 +1,10 @@ +/** + * https://www.amcharts.com/svg-maps/?map=usa + * map data by amcharts team + */ +'use strict'; + +(function(tuiChart) { + var data = [{"code":"US-AK","name":"Alaska","path":"M191.8,495.91l2.87,8.43l3.02,-2.96l9.45,2.36l-0.85,3.93l8.45,3.99l6.07,-1.1l11.73,6.53l11.14,2.37l4.41,2.47l7.93,-2.48l8.81,5.39l6.42,2.46l0,0l-0.29,61.92l-0.41,89.84l7.5,0.44l7.5,4.15l5.52,6.58l7.22,9.78l7.24,-8.8l7.5,-5.33l4.57,7.63l5.67,5.86l7.72,6.27l5.88,10.36l9.87,16.24l15.03,7.91l1.32,9.26l-3.88,7.62l-5.24,-5.02l-7.87,-3.96l-3.56,-12.68l-11.56,-11.14l-5.39,-13.83l-7.71,-0.46l-12.67,0.3l-9.46,-4l-16.5,-15.44l-7.41,-2.87l-13.37,-5.62l-10.64,1l-14.65,-7.75l-8.54,-7.13l-8.59,2.6l0.69,10.76l-4.31,0.62l-9.17,2.34l-7.32,4.4l-8.95,2.21v-9.05l5.22,-14.52l8.47,-3.82l-1.62,-4.08l-10.5,7.43l-6.45,9.48L169.57,686l4.61,8.12l-8.97,9.68l-9.49,4.89l-8.73,3.17l-3.13,6.19l-14.01,5.24l-3.92,6.35l-10.87,4.25l-5.39,-2.33l-8.57,2.31l-9.52,2.92l-8.06,3.09l-15.29,0.34l-0.64,-2.74l10.79,-4.25l9.15,-2.37l10.61,-5.76l10.46,0.68l5.31,-5.08l12.97,-6.42l2.37,-2.58l6.88,-4.06l3.48,-10.97l5.58,-8.06l-9.78,2.83l-1.99,-3.05l-5.29,4.55l-3.47,-8.58l-3.22,4.87l-1.26,-8.01l-9,4.19l-4.71,-1.12l1.45,-8.95l2.67,-5.11l-3.54,-6.46l-10.41,0.39l-4.4,-8.61l-4.04,-4.93l2.31,-8.42l-3.72,-7.91l5.2,-7.81l8.05,-6.82l4.58,-7.12l5.87,0.36l4.11,3.66l7.39,-6.02l4.68,2.52l6.33,-3.59l0.34,-7.37l-3.13,-3.67l6.35,-4.88l-4.14,-0.76l-7.89,1.7l-2.89,2.92l-4.41,-4.75l-9.88,-0.77l-8.65,-6.44l-0.92,-7.01l-5.42,-11.46l10.92,-3.79l16.26,-3.71l5.19,1.37l-2.92,7.67l13.69,2.75l-2.8,-11.1l-6.17,-8.03l-2.27,-9.16l-3.95,-8.45l-6.76,-7.45l5.78,-7.51l10.57,2.37l9.34,-5.56l3.41,-7.73l7.78,-6.53l5.97,-0.64l12.31,-5.24l4.93,2.18l10.31,-7.58L191.8,495.91zM59.27,587.82l3.09,4.29l4.68,-0.11l4.08,5.78l6.04,4.18l-1.08,1.46l-6.17,1.5l-4.07,-4.97l-1.64,-3.58l-6.21,-1.19l-1.13,-1.88L59.27,587.82zM84.05,658.96l-5.19,0.99l-4.04,-4.16l-3.25,-5.32l7.96,-0.37l5.42,3L84.05,658.96zM172.79,720.54l-8.89,4.49l-3.56,-4.44l-0.17,-7.13l8.04,-4.19l4.56,-1.67l5.13,1.72l2.78,5.07L172.79,720.54z"},{"code":"US-AL","name":"Alabama","path":"M823.25,403.55L831.37,431.02L838.53,452.95L842.13,459.7L844.3,463.54L841.61,467.9L841.4,475.24L842.96,479.38L842.96,483.45L842.88,487.23L844.46,489.98L845.75,492.54L805.82,497.08L794.73,499.45L794.58,501.21L799.58,506.33L798.97,510.92L797.83,514.18L780.04,513.21L776.52,478.48L776.84,441.91L777.66,412.26L775.95,407.99L799.35,405.82z"},{"code":"US-AR","name":"Arkansas","path":"M746.45,386.99L746.39,388.88L744.74,392.2L741.65,394.62L741.19,398.42L738.45,401.59L739.1,408.17L737.11,410.42L736.87,412.24L733.64,414.14L733.77,417.43L731.63,423.65L729.53,425.07L726.38,428.35L724.64,433.14L720.94,441.29L720.79,446.7L723.3,452.55L722.62,457.07L706.39,457.09L685.47,458.65L666.94,459.1L667.77,446.16L663.36,446.16L659.67,446.53L658.64,445.06L658.85,425.16L658.87,403.06L654.82,379.13L677.08,378.97L697.32,378.33L716.63,377.44L737.54,377.61L739.25,380.31L737.34,382.88L735.44,385.46L734.45,387.78z"},{"code":"US-AZ","name":"Arizona","path":"M393.21,351.89L374.82,479.32L336.43,473.46L295.45,449.76L268.97,433.11L271.6,429.19L274.1,429.74L277.1,425.71L274.42,421.95L274.45,418.47L274.3,414.34L279,409.98L282.58,400.09L289.13,396.66L286.51,391.67L284.99,386.99L284.28,382.78L283.9,379.56L283.94,377.49L285.97,373.36L285.98,368.82L286.5,364.43L287.5,359.65L286.52,356.27L288.33,353.79L292.12,354.57L295.26,356.86L297.54,358.24L299.42,355.09L300.35,354.51L303.82,336.59L332.7,341.78L367.14,347.74z"},{"code":"US-CA","name":"California","labelCoordinate":{"x":0.35,"y":0.5},"path":"M227.74,202.25L209.97,267.9L234.88,306L259.69,342.73L283.94,377.49L283.9,379.56L284.28,382.78L284.99,386.99L286.51,391.67L289.13,396.66L282.58,400.09L279,409.98L274.3,414.34L274.45,418.47L274.42,421.95L277.1,425.71L274.1,429.74L271.6,429.19L247.2,426.36L225.43,423.15L225.09,414.45L219.96,401.1L203.57,383L196.4,380.28L190.28,371.27L176.35,365.7L172.7,360.88L173.84,348.28L162.81,321.41L157.2,286.87L159.32,282.02L153.91,272.55L146.38,250.33L149.63,231.97L144.55,217.34L153.92,200.58L159.29,181.87z"},{"code":"US-CO","name":"Colorado","path":"M524.26,297.34L522.11,332.21L519.88,365.43L502.43,364.1L480.73,362.25L449.96,359.16L421.42,355.72L393.21,351.89L406.05,262.04L423.12,264.4L440.2,266.58L474.43,270.36L491.58,271.97L525.81,274.63L524.3,296.61z"},{"code":"US-CT","name":"Connecticut","path":"M1034.84,200.91L1038.24,212.85L1038.11,216.33L1031.11,219.4L1021.77,223.02L1010.11,231.52L1008.84,228.98L1011.92,225.92L1010.14,224.38L1006.81,207.31L1019.47,204.48z"},{"code":"US-DC","name":"Washington, DC","path":"M963.72,293.35L963.53,292.03L961.68,290.43L962.86,289.07L965.55,290.9z"},{"code":"US-DE","name":"Delaware","path":"M986.93,264.85L984.93,267.74L986.35,271.89L992.67,282.97L1000,293.17L988.42,295.83L980.78,267.93L981.69,265.89L983,264.55z"},{"code":"US-FL","name":"Florida","labelCoordinate":{"x":0.75,"y":0.5},"path":"M915.25,488.75L920.47,504.83L931.05,522.16L942.9,537.63L944.43,546.48L957.31,568.23L961.78,588.44L960.97,609.01L952.91,614.56L942.16,613.5L937.22,603.98L928.48,599.97L914.49,581.98L901.97,566.79L898.51,556.09L899.92,541.71L893.44,529.65L878.58,517.85L866.13,510.74L845.03,523.09L839.71,517.25L819.88,509.08L797.83,514.18L798.97,510.92L799.58,506.33L794.58,501.21L794.73,499.45L805.82,497.08L845.75,492.54L849.47,498.29L869.32,496.79L901.59,495.62L903.65,499.35L905.87,496.93L904.7,489.07L906.93,487.93L911.06,488.99z"},{"code":"US-GA","name":"Georgia","path":"M870.54,397.61L868.77,399.77L866.4,404.45L871.95,407.48L875.38,408.38L879.89,414.99L882.71,418.65L890.05,423L891.77,425.6L896.8,428.57L899.84,433.58L906.61,437.16L908.79,442.08L910.32,444.39L909.93,446.15L913.88,448.03L916.46,451.94L917.13,456.23L919.03,456.77L922.51,457.38L916.86,475.27L915.25,488.75L911.06,488.99L906.93,487.93L904.7,489.07L905.87,496.93L903.65,499.35L901.59,495.62L869.32,496.79L849.47,498.29L845.75,492.54L844.46,489.98L842.88,487.23L842.96,483.45L842.96,479.38L841.4,475.24L841.61,467.9L844.3,463.54L842.13,459.7L838.53,452.95L831.37,431.02L823.25,403.55L837.59,402.05L847.46,400.57z"},{"code":"US-HI","name":"Hawaii","path":"M443.39,612.09l-3.04,0.1l-1.75,-2.38l-0.9,-4.35l2.24,-0.78l3.28,0.52l3.31,2.87l-0.17,1.63L443.39,612.09zM460.92,640.38l-0.66,3.48l-2.99,-1.37l-0.62,-2.43l-1.04,-0.48l-0.48,-0.1l-1.92,-1.63l1.05,-6.3l2.46,1.6l3.75,0.34l-1,5.34L460.92,640.38zM472.36,657.57l-3.54,-0.18l-5.86,-6.16l2.14,-1.41L472.36,657.57zM472.75,661.08l0.38,3.47l3.3,1.61l1.96,5.74l-0.91,1.33l-2.35,0.03l-5.18,-3l1.42,-4.08l-1.82,-1.98l0.38,-3.08l1.6,-0.74L472.75,661.08zM464.41,705.67l-3.3,1.32l-2.68,-4.91l3.87,-5.3l2.25,-8.02l6.97,-1.6l0.83,-3.42l1.47,-1.3l0.87,0.25l6.34,12.29l0.27,3.33l-1.3,2.37l1.01,1.2l-0.53,1.9l0.83,3.79l-6.57,0.44l-4.82,-2.11L464.41,705.67z"},{"code":"US-IA","name":"Iowa","path":"M708.74,219.26L709.04,220.49L711.39,223.98L710,225.78L710.31,230.55L711.1,232.54L712.37,236.09L717.96,237.96L719.79,241.33L720.87,243L722.93,244.04L723.88,246.44L726.64,248.09L728.51,249.94L727.99,256.09L725.17,261.42L724.13,263.12L720.32,264.66L714.53,266.11L713.21,270.09L715.43,271.74L716.35,275.21L714.32,279.26L713.36,282.76L709.11,286.36L708.97,290.51L706.51,288.74L703.03,285.22L684.16,286.48L664.27,287.22L648.77,287.52L633.24,287.62L632.09,283.51L632.57,279.45L632.19,275.54L630.42,268.99L629.29,266.28L628.06,265.54L627.94,260.29L626.88,256.53L623.81,252.24L623.86,250.36L622.8,246.61L622.06,244.34L622.09,242.26L619.39,239.72L620.76,236L621.65,232.36L622.06,229.89L619.95,226.86L620.01,221.31L622.21,221.31L640.32,221.33L662.83,220.7L687.01,219.83z"},{"code":"US-ID","name":"Idaho","path":"M384.7,178.06L385.21,178.56L375.87,234.37L326.11,225.41L276.58,214.43L286.18,174.71L289.06,168.74L288.45,165.54L285.82,163.34L286.7,159.8L290.12,155.29L294.56,151.7L298.48,145.04L301.92,139.8L304.17,137.26L304.11,133.69L301.91,131.28L299.24,126.14L300.3,122.21L299.68,118.48L306.56,87.28L313.23,58.66L327.79,61.98L323.71,85.85L326.37,92.69L325.47,96.73L327.51,100.93L330.57,103.82L332.38,107.84L335.18,115.68L338.48,119.77L343.09,120.94L340.37,125.56L337.65,131.15L337.77,137.18L335.65,138.25L334.63,144.02L336.98,146.81L340.63,144.78L342.87,141.95L344.65,142.95L345.92,146.4L346.33,153.84L348.59,157.19L348.46,163.24L349.11,165.06L352.25,166.24L353.6,169.87L355.34,176.23L358.88,173.67L363.99,175.46L364.82,173.33L373.63,176.35L377.44,176.27L380.5,172.2L382.13,173.11L383.16,176.53z"},{"code":"US-IL","name":"Illinois","path":"M767.4,237.97L767.4,238.03L768.06,243.91L773.71,255.38L773.71,255.38L773.71,255.38L776.14,281.56L778.56,307.71L777.15,314.18L778.75,315.7L780.04,319.47L780.19,322.52L778.83,324.03L777.89,327.89L774.65,333.15L772.69,339.44L772.52,344.06L772.79,345.73L771.03,349.05L772.75,351.05L769.73,352.97L765.81,355.21L766.92,360.09L764.7,362.15L760.16,360.41L755.25,359.56L754.19,361.85L755.15,365.22L751.67,361.95L749.76,362.68L747.04,357.29L747.46,353.85L745.73,348.47L743.87,347.93L738.83,343.28L736.79,343.33L733.04,340.37L730.3,337.13L731.2,333.08L732.64,329.68L733.38,325.44L729.78,322.01L726.52,323.68L724.45,322.85L723.94,319.08L722.22,314.86L720.54,313.92L716.32,311.1L712.77,307.43L709.63,302.92L707.74,296.22L708.97,290.51L709.11,286.36L713.36,282.76L714.32,279.26L716.35,275.21L715.43,271.74L713.21,270.09L714.53,266.11L720.32,264.66L724.13,263.12L725.17,261.42L727.99,256.09L728.51,249.94L726.64,248.09L723.88,246.44L722.93,244.04L720.87,243L719.79,241.33L736.92,240.23L754.43,238.94L767.35,238.03L767.34,237.97z"},{"code":"US-IN","name":"Indiana","path":"M819.8,251.07L822.26,271.46L824.84,293.39L826.66,309L825.79,310.19L827.78,314.61L827.23,316.37L824.27,316.77L821.75,319.09L817.48,318.77L817.61,323.14L815.31,325.08L813.42,329.22L810.98,330.21L807.81,337.35L803.98,335.81L802.57,333.17L799.94,337.99L798.22,340.71L794.11,338.45L790.21,341.01L789.07,343.34L783.23,340.43L779.62,343.26L774.85,341.93L774.89,344.44L772.52,344.06L772.69,339.44L774.65,333.15L777.89,327.89L778.83,324.03L780.19,322.52L780.04,319.47L778.75,315.7L777.15,314.18L778.56,307.71L776.14,281.56L773.71,255.38L773.71,255.38L775.41,256.76L781.16,256.08L785.48,253.14L785.48,253.14L803.69,251.3L819.57,249.31z"},{"code":"US-KS","name":"Kansas","path":"M654.77,368.71L638.81,368.9L606.07,368.79L573.32,368.04L555.14,367.35L536.98,366.45L519.88,365.43L522.11,332.21L524.26,297.34L524.29,297.34L554.73,299.07L577.39,299.98L617.51,300.79L641.53,300.79L645.7,303.78L647.97,303.71L648.51,306.99L646.09,311.22L647.45,313.36L649.68,318.1L654.35,320.18L654.53,344.47z"},{"code":"US-KY","name":"Kentucky","path":"M868.09,319.18L868.74,321.26L869.24,325.93L871.88,329.12L873.25,332.39L876.29,334.91L878.49,337.35L882.03,337.23L875.89,345L870.68,348.46L870.51,350.34L868.95,352.99L864.4,356.38L863.09,358.79L859.56,360.71L854.51,362.7L842.33,365.07L826.21,366.09L821.02,366.98L810.52,367.52L799.86,368.47L790.05,369.33L778.72,371.03L778.04,370.05L774.43,370.42L774.8,373.97L748.7,375.84L752.62,373.16L755.37,371.06L754.75,367.53L755.15,365.22L754.19,361.85L755.25,359.56L760.16,360.41L764.7,362.15L766.92,360.09L765.81,355.21L769.73,352.97L772.75,351.05L771.03,349.05L772.79,345.73L772.52,344.06L774.89,344.44L774.85,341.93L779.62,343.26L783.23,340.43L789.07,343.34L790.21,341.01L794.11,338.45L798.22,340.71L799.94,337.99L802.57,333.17L803.98,335.81L807.81,337.35L810.98,330.21L813.42,329.22L815.31,325.08L817.61,323.14L817.48,318.77L821.75,319.09L824.27,316.77L827.23,316.37L827.78,314.61L825.79,310.19L826.66,309L832.73,308.77L836.11,310.54L841.45,315.01L845.39,316.1L848.35,317.55L852.46,316.35L855.74,317.21L859.34,315.44L862.62,314.57L864.48,317.51z"},{"code":"US-LA","name":"Louisiana","labelCoordinate":{"x":0.5,"y":0.65},"path":"M722.62,457.07L724.06,458.3L722.49,461.68L725.53,466.21L724.89,469.07L727.6,472.85L725.04,475.33L724.38,479.68L720.81,483.43L719.3,488.3L717.8,493.89L715.53,496.56L716.6,502.22L733.98,502.02L752.51,500.89L752.21,504.72L751.16,508.55L752.61,511.35L755.39,513.82L756.36,517.55L756.89,519.79L755.26,529.47L762.48,542.76L734.86,545.47L717.53,541.69L705.74,537.49L690.4,535.09L673.04,534.9L671.32,531.91L673.27,528.5L676.18,525.4L676.12,520.83L674.63,519.34L676.22,513.83L677.42,511.32L679.1,502.91L677.27,499.84L674.87,494.7L673.07,489.45L671.9,485.95L668.65,483.45L666.94,459.1L685.47,458.65L706.39,457.09z"},{"code":"US-MA","name":"Massachusetts","path":"M1045.63,177.8L1048.77,189.44L1057.46,199.48L1064.38,198.06L1060.35,190.6L1066.65,194.01L1067.17,200.62L1057.15,207.36L1049.14,209.17L1047.75,205.96L1044.47,204.17L1041.66,198.77L1034.84,200.91L1019.47,204.48L1006.81,207.31L1006.47,191.24L1019.95,188.12L1039.54,183L1040.61,180.37L1043.61,177.93z"},{"code":"US-MD","name":"Maryland","labelCoordinate":{"x":0.6,"y":0.4},"path":"M980.78,267.93L988.42,295.83L1000,293.17L1001.44,294.94L996.49,304.07L992.51,305.34L991.48,307.17L980.22,298.59L975.8,282.14L974.67,290.56L979.11,309.68L967.2,305.35L965.52,302.45L962.88,304.01L960.31,303.28L961.26,297.92L963.79,295.21L963.72,293.35L965.55,290.9L962.86,289.07L961.68,290.43L957.94,288.63L954.01,288.05L954.78,285.4L952.15,284.2L949.46,283.97L947.53,281.41L944.79,278.66L939.12,277.96L936.14,280.29L934.58,282.31L929.32,282.4L927.46,285.17L924.2,286.7L921.71,289.82L919.42,292.31L917.49,280.96L933.46,277.97L938.9,276.86L951.06,274.31L965.73,271.32z"},{"code":"US-ME","name":"Maine","path":"M1046.95,172.11L1045.32,172.81L1043.71,169.97L1039.84,167.56L1039.83,165.23L1026.54,125.88L1031.85,120.24L1034.43,108.68L1034.08,90.22L1040.58,70.21L1047.3,74.47L1056.14,67.64L1064.77,71.84L1074.29,101.57L1088.28,110.6L1091.52,119.75L1078.66,131.52L1065.07,141.37L1051.08,159.84z"},{"code":"US-MI","name":"Michigan","path":"M810.31,140.6L810.31,140.6l5.32,0.03l0,0l-1.7,2.51l9.03,8.01L809.3,155l-0.54,-0.04l-12.74,-0.9l-11.87,5.92l-10.61,3.16l-8.01,15.38l-0.43,-0.12l-0.01,0.04l-2.39,-2.49l0.85,-3.77l-3.55,0.12l0.4,-3.76l0.81,-1.92l-1.7,-3.07l-3.89,-1.11l-1.2,-3.67l-3.12,-0.03l-4.49,0.34l-9.47,-3.39l-14.14,-3.12l-1.54,-4.03l-2.52,-0.59l-0.02,-0.07l-0.95,0.53l-0.15,-0.11l0.14,0.1l11.76,-6.62l12,-8.35l13.09,-8.73l-3.95,12.49l9.13,2.13l11.89,7.63l13.42,-6.53l15.16,-3.76l4.06,5.97l4.91,0.32L810.31,140.6zM855.86,215.95L855.86,215.95l-0.37,0.36l-5.98,13.52l-2.54,8.4h0l-4.54,9.49l0,0l-6.33,1.07l-7.68,1.01l-8.62,1.26l-0.23,-1.76l-15.88,1.99l-18.21,1.84v0l0,0l3.1,-3.48l5.66,-11.73l-1.15,-14.96l-6.97,-13.41l-0.19,-9.69l3.06,-11.57l3.2,-8.06l5.82,-6.16l2.38,7.43l1.52,-11.52l3.25,-2.73l1.18,-8.89l14.08,2.82l13,7.22l2.75,10.08l-0.03,10.5l-7.71,10.26l1.6,5.57l3.28,-0.25l8.73,-11.34l6.35,1.38l4.89,12.62l2.21,9.1L855.86,215.95z"},{"code":"US-MN","name":"Minnesota","path":"M728.42,114.75L728.41,114.76L713.15,123.35L702.62,133.13L692.46,143.3L692.56,146.66L688.46,148.11L689.15,160.93L688.65,160.93L684.81,163.61L681.49,165.93L679.36,170.21L682.88,174.37L681.86,180.15L682.07,186.34L681.75,191.37L686.66,195.58L688.61,195.71L694.02,198.73L695.92,200.19L697.18,202.59L701.49,206.31L707.21,209.4L707.84,211.25L708.17,216.72L708.74,219.26L687.01,219.83L662.83,220.7L640.32,221.33L622.21,221.31L622.54,200.03L620.69,178.18L617.89,176.38L616.33,172.84L617.22,169.75L620.82,167.22L621.12,163.9L621.15,159.74L620.18,156.26L618.88,152.54L618.15,147.88L618,142.66L617.48,141.4L616.9,134.67L616.87,131.58L616.59,128.83L615.86,124.17L614.03,119.43L612.29,115.2L612.08,111.02L611.94,106.51L612.5,103.57L612.63,100.89L611.25,97.55L611.06,95.28L642.49,95.37L642.44,86.5L647.55,86.32L650.41,98.96L655.22,102.79L665.92,103.97L681.65,107.14L696.84,113.64L709.12,109.99L728.41,114.75z"},{"code":"US-MO","name":"Missouri","path":"M708.97,290.51L707.74,296.22L709.63,302.92L712.77,307.43L716.32,311.1L720.54,313.92L722.22,314.86L723.94,319.08L724.45,322.85L726.52,323.68L729.78,322.01L733.38,325.44L732.64,329.68L731.2,333.08L730.3,337.13L733.04,340.37L736.79,343.33L738.83,343.28L743.87,347.93L745.73,348.47L747.46,353.85L747.04,357.29L749.76,362.68L751.67,361.95L755.15,365.22L754.75,367.53L755.37,371.06L752.62,373.16L748.7,375.84L748.38,378.06L747.49,381.37L746.45,386.99L734.45,387.78L735.44,385.46L737.34,382.88L739.25,380.31L737.54,377.61L716.63,377.44L697.32,378.33L677.08,378.97L654.82,379.13L654.86,368.71L654.77,368.71L654.53,344.47L654.35,320.18L649.68,318.1L647.45,313.36L646.09,311.22L648.51,306.99L647.97,303.71L645.7,303.78L641.53,300.79L639.23,295.96L636.52,293.07L633.59,289.49L633.24,287.62L648.77,287.52L664.27,287.22L684.16,286.48L703.03,285.22L706.51,288.74z"},{"code":"US-MS","name":"Mississippi","path":"M775.95,407.99L777.66,412.26L776.84,441.91L776.52,478.48L780.04,513.21L768.32,519.32L756.89,519.79L756.36,517.55L755.39,513.82L752.61,511.35L751.16,508.55L752.21,504.72L752.51,500.89L733.98,502.02L716.6,502.22L715.53,496.56L717.8,493.89L719.3,488.3L720.81,483.43L724.38,479.68L725.04,475.33L727.6,472.85L724.89,469.07L725.53,466.21L722.49,461.68L724.06,458.3L722.62,457.07L723.3,452.55L720.79,446.7L720.94,441.29L724.64,433.14L726.38,428.35L729.53,425.07L731.63,423.65L733.77,417.43L733.64,414.14L736.87,412.24L737.11,410.42L755.47,409.14z"},{"code":"US-MT","name":"Montana","path":"M501.84,159.67L499.16,180.45L472.33,177.57L443.38,174.28L418.47,170.63L386.97,165.87L385.13,177.31L384.7,178.06L383.16,176.53L382.13,173.11L380.5,172.2L377.44,176.27L373.63,176.35L364.82,173.33L363.99,175.46L358.88,173.67L355.34,176.23L353.6,169.87L352.25,166.24L349.11,165.06L348.46,163.24L348.59,157.19L346.33,153.84L345.92,146.4L344.65,142.95L342.87,141.95L340.63,144.78L336.98,146.81L334.63,144.02L335.65,138.25L337.77,137.18L337.65,131.15L340.37,125.56L343.09,120.94L338.48,119.77L335.18,115.68L332.38,107.84L330.57,103.82L327.51,100.93L325.47,96.73L326.37,92.69L323.71,85.85L327.79,61.98L372.22,71.15L416.94,78.85L461.89,85.08L507.02,89.83L503.5,131.88z"},{"code":"US-NC","name":"North Carolina","path":"M995.21,338.43L1002.75,360L994.84,379.03L978.65,391.44L965.08,405.88L958.75,408.49L934.04,391.25L913.5,394.62L913.11,392L909.59,388.69L907.98,390.48L907.51,388.53L898.72,388.9L881.69,391.36L872.29,396.68L870.54,397.61L847.46,400.57L847.25,395.75L850.98,393.82L851.93,391.24L854.18,388.16L857.83,387.06L862.01,385.43L865.93,382.9L867.46,380.66L870.69,378.36L870.36,376.75L874.51,373.03L876.28,374.79L882.37,369.54L885.58,369.5L887.79,365.3L891.33,363.75L890.63,360.58L890.64,357.69L921.25,353.54L957.11,346.86L976.05,342.75z"},{"code":"US-ND","name":"North Dakota","path":"M611.06,95.28L611.25,97.55L612.63,100.89L612.5,103.57L611.94,106.51L612.08,111.02L612.29,115.2L614.03,119.43L615.86,124.17L616.59,128.83L616.87,131.58L616.9,134.67L617.48,141.4L618,142.66L618.15,147.88L618.88,152.54L620.18,156.26L621.15,159.74L621.12,163.9L590.77,164.65L564.87,163.67L532.22,161.94L501.84,159.67L503.5,131.88L507.02,89.83L559.45,93.57z"},{"code":"US-NE","name":"Nebraska","path":"M622.06,244.34L622.8,246.61L623.86,250.36L623.81,252.24L626.88,256.53L627.94,260.29L628.06,265.54L629.29,266.28L630.42,268.99L632.19,275.54L632.57,279.45L632.09,283.51L633.24,287.62L633.59,289.49L636.52,293.07L639.23,295.96L641.53,300.79L617.51,300.79L577.39,299.98L554.73,299.07L524.29,297.34L524.26,297.34L524.3,296.61L525.81,274.63L491.58,271.97L495.46,226.79L527.96,229.32L552.96,230.8L586.41,232.12L590.65,235.11L596.76,237.07L598.22,236.06L602.2,236.22L608.18,236.09L612.47,239.07L617.05,241.01L617.8,242.91L619.24,244.01z"},{"code":"US-NH","name":"New Hampshire","path":"M1046.95,172.11L1045.63,177.8L1043.61,177.93L1040.61,180.37L1039.54,183L1019.95,188.12L1018.05,186.18L1018.57,182.99L1017.43,177.12L1017.56,175.61L1016.72,170.27L1017.3,165.41L1018.09,163.14L1018.58,157.42L1017.99,153.78L1017.94,151.5L1020.7,149.61L1023.53,146.09L1023.4,143.19L1021.37,140.36L1021.55,133.87L1021.52,133.86L1021.57,128.01L1026.54,125.88L1039.83,165.23L1039.84,167.56L1043.71,169.97L1045.32,172.81z"},{"code":"US-NJ","name":"New Jersey","path":"M1005.97,233.13L1002.85,245.27L1007.3,245.2L1008.29,261.79L999.91,281.76L997.29,276.39L993.25,276.13L987.8,271.3L986.35,271.89L984.93,267.74L986.93,264.85L989.95,262.02L990.85,260.36L994.19,256.49L995.8,253.57L989.13,249.11L988.29,246.84L986.3,246.58L985.55,243.01L986.88,239.85L985.31,237.18L987.53,234.61L989.28,228.98L991.08,227.52z"},{"code":"US-NM","name":"New Mexico","path":"M502.43,364.1L501.59,375.32L497.01,434.63L493.71,477.35L475.73,475.87L440.89,472.47L423.5,470.51L423.48,472.47L425.23,476.34L391.9,472.15L390.39,481.45L374.82,479.32L393.21,351.89L421.42,355.72L449.96,359.16L480.73,362.25z"},{"code":"US-NV","name":"Nevada","path":"M326.11,225.41L303.82,336.59L300.35,354.51L299.42,355.09L297.54,358.24L295.26,356.86L292.12,354.57L288.33,353.79L286.52,356.27L287.5,359.65L286.5,364.43L285.98,368.82L285.97,373.36L283.94,377.49L259.69,342.73L234.88,306L209.97,267.9L227.74,202.25L276.56,214.49L276.58,214.43z"},{"code":"US-NY","name":"New York","path":"M1006.47,191.24L1006.81,207.31L1010.14,224.38L1011.92,225.92L1008.84,228.98L1010.11,231.52L1032.89,222.46L1038.92,225.29L1017.3,238.01L1006.63,240.74L1005.97,233.13L991.08,227.52L988.02,226.6L984.83,225.73L983,222.77L982.87,220.23L980.43,218.69L976.03,216.05L953.56,221.02L929.39,226.03L903.43,230.95L902.33,224.89L914.06,208.94L913.34,206.86L913.33,206.8L909.87,200.77L917.84,196.33L930.8,194.61L944.51,193.68L955.07,183.7L952.2,175.26L949.61,172.2L949.54,172.18L949.55,172.17L949.62,172.2L962.67,153.32L968.84,147.56L992.69,141.54L993.51,146.1L993.6,149.11L995.65,155.57L997.38,158.72L996.94,163.69L999.87,169.09L999.66,172.55L1000.17,173.31L1002.51,172.89z"},{"code":"US-OH","name":"Ohio","path":"M895.99,263.59L893.82,265.11L895.03,267.83L895.11,273.12L894.33,279.24L893.47,284.35L893.57,286.7L889.71,292.59L887.88,294.01L885.64,295.02L883.46,294.86L880.19,299.33L880.12,303.48L879.92,305.75L878.5,306.88L877.89,304.42L875.44,304.24L873.72,309.48L874.2,314.49L872.38,317.95L868.09,319.18L864.48,317.51L862.62,314.57L859.34,315.44L855.74,317.21L852.46,316.35L848.35,317.55L845.39,316.1L841.45,315.01L836.11,310.54L832.73,308.77L826.66,309L824.84,293.39L822.26,271.46L819.8,251.07L828.42,249.81L836.1,248.8L842.43,247.72L842.43,247.72L842.43,247.73L853.5,250.9L862.09,250.8L873.84,245.91L882.78,238.09L890.88,233.62z"},{"code":"US-OK","name":"Oklahoma","labelCoordinate":{"x":0.65,"y":0.5},"path":"M654.82,379.13L658.87,403.06L658.85,425.16L658.64,445.06L650.4,440.72L645.06,438.36L640.76,439.93L634.09,439.72L630.14,439.76L626.89,441.61L623.71,442.55L620.93,441.42L614.58,442.61L611.74,438.79L608.74,442.04L603.58,440.5L598.33,436.88L592.59,439.04L590.23,433.51L581.41,433.82L575.82,432.43L569.54,430.6L566.91,425.79L561.9,427.12L558.91,425.14L554.53,422.51L555.49,400.85L556.46,378.64L538.16,377.73L519.86,376.63L501.59,375.32L502.43,364.1L519.88,365.43L536.98,366.45L555.14,367.35L573.32,368.04L606.07,368.79L638.81,368.9L654.77,368.71L654.86,368.71z"},{"code":"US-OR","name":"Oregon","path":"M299.24,126.14L301.91,131.28L304.11,133.69L304.17,137.26L301.92,139.8L298.48,145.04L294.56,151.7L290.12,155.29L286.7,159.8L285.82,163.34L288.45,165.54L289.06,168.74L286.18,174.71L276.58,214.43L276.56,214.49L227.74,202.25L159.29,181.87L158.03,168.07L170.35,146.42L179.28,122.31L192.49,90.34L195.72,91.03L200.31,92.59L203.38,95.72L207.41,98.33L208.97,103.37L208.26,107.16L208.47,110.57L211.77,112.47L215.57,113.53L222.2,112.96L225.89,113.27L231.12,115.79L233.22,117.63L236.67,117.76L240.68,116.96L247.56,119.17L253.95,118.28L257.44,117.29L261.12,119.3L267.26,118.43z"},{"code":"US-PA","name":"Pennsylvania","path":"M991.08,227.52L989.28,228.98L987.53,234.61L985.31,237.18L986.88,239.85L985.55,243.01L986.3,246.58L988.29,246.84L989.13,249.11L995.8,253.57L994.19,256.49L990.85,260.36L989.95,262.02L986.93,264.85L983,264.55L981.69,265.89L980.78,267.93L965.73,271.32L951.06,274.31L938.9,276.86L933.46,277.97L917.49,280.96L899.53,284.16L895.99,263.59L890.88,233.62L890.88,233.62L902.3,224.93L902.33,224.89L903.43,230.95L929.39,226.03L953.56,221.02L976.03,216.05L980.43,218.69L982.87,220.23L983,222.77L984.83,225.73L988.02,226.6z"},{"code":"US-RI","name":"Rhode Island","path":"M1049.14,209.17L1038.11,216.33L1038.24,212.85L1034.84,200.91L1041.66,198.77L1044.47,204.17L1047.75,205.96z"},{"code":"US-SC","name":"South Carolina","path":"M958.75,408.49L954.4,425.6L940.47,442.52L922.51,457.38L919.03,456.77L917.13,456.23L916.46,451.94L913.88,448.03L909.93,446.15L910.32,444.39L908.79,442.08L906.61,437.16L899.84,433.58L896.8,428.57L891.77,425.6L890.05,423L882.71,418.65L879.89,414.99L875.38,408.38L871.95,407.48L866.4,404.45L868.77,399.77L870.54,397.61L872.29,396.68L881.69,391.36L898.72,388.9L907.51,388.53L907.98,390.48L909.59,388.69L913.11,392L913.5,394.62L934.04,391.25z"},{"code":"US-SD","name":"South Dakota","path":"M622.21,221.31L620.01,221.31L619.95,226.86L622.06,229.89L621.65,232.36L620.76,236L619.39,239.72L622.09,242.26L622.06,244.34L619.24,244.01L617.8,242.91L617.05,241.01L612.47,239.07L608.18,236.09L602.2,236.22L598.22,236.06L596.76,237.07L590.65,235.11L586.41,232.12L552.96,230.8L527.96,229.32L495.46,226.79L499.16,180.45L501.84,159.67L532.22,161.94L564.87,163.67L590.77,164.65L621.12,163.9L620.82,167.22L617.22,169.75L616.33,172.84L617.89,176.38L620.69,178.18L622.54,200.03z"},{"code":"US-TN","name":"Tennessee","path":"M854.51,362.7L881.54,359.56L890.64,357.69L890.63,360.58L891.33,363.75L887.79,365.3L885.58,369.5L882.37,369.54L876.28,374.79L874.51,373.03L870.36,376.75L870.69,378.36L867.46,380.66L865.93,382.9L862.01,385.43L857.83,387.06L854.18,388.16L851.93,391.24L850.98,393.82L847.25,395.75L847.46,400.57L837.59,402.05L823.25,403.55L799.35,405.82L775.95,407.99L755.47,409.14L737.11,410.42L739.1,408.17L738.45,401.59L741.19,398.42L741.65,394.62L744.74,392.2L746.39,388.88L746.45,386.99L747.49,381.37L748.38,378.06L748.7,375.84L774.8,373.97L774.43,370.42L778.04,370.05L778.72,371.03L790.05,369.33L799.86,368.47L810.52,367.52L821.02,366.98L826.21,366.09L842.33,365.07z"},{"code":"US-TX","name":"Texas","path":"M658.64,445.06L659.67,446.53L663.36,446.16L667.77,446.16L666.94,459.1L668.65,483.45L671.9,485.95L673.07,489.45L674.87,494.7L677.27,499.84L679.1,502.91L677.42,511.32L676.22,513.83L674.63,519.34L676.12,520.83L676.18,525.4L673.27,528.5L671.32,531.91L673.04,534.9L656.02,540.04L637.82,557.24L617.61,567.14L606.35,578.03L601.48,588.34L601.04,604.28L601.91,615.41L605.78,623.36L597.58,623.93L582.8,618.52L566.71,610.86L561.26,599.79L557.33,583.46L545.79,569.82L539.4,556.02L530.11,539.78L516.53,529.83L500.18,529.18L486.19,546.32L470.08,538.07L460.36,530.23L456.6,517.21L451.21,504.67L440.58,493.46L431.39,485.2L425.23,476.34L423.48,472.47L423.5,470.51L440.89,472.47L475.73,475.87L493.71,477.35L497.01,434.63L501.59,375.32L519.86,376.63L538.16,377.73L556.46,378.64L555.49,400.85L554.53,422.51L558.91,425.14L561.9,427.12L566.91,425.79L569.54,430.6L575.82,432.43L581.41,433.82L590.23,433.51L592.59,439.04L598.33,436.88L603.58,440.5L608.74,442.04L611.74,438.79L614.58,442.61L620.93,441.42L623.71,442.55L626.89,441.61L630.14,439.76L634.09,439.72L640.76,439.93L645.06,438.36L650.4,440.72z"},{"code":"US-UT","name":"Utah","path":"M406.05,262.04L393.21,351.89L367.14,347.74L332.7,341.78L303.82,336.59L326.11,225.41L375.87,234.37L372.15,256.16z"},{"code":"US-VA","name":"Virginia","labelCoordinate":{"x":0.67,"y":0.5},"path":"M949.46,283.97l2.68,0.24l2.64,1.19l-0.78,2.65l3.93,0.58l3.75,1.8l1.84,1.6l0.19,1.32l0.07,1.86l-2.52,2.71l-0.95,5.36l2.57,0.72l2.64,-1.56l1.68,2.91l13.73,10.02l5.74,9.84l0.35,0.6l8.2,12.61l-19.16,4.32l-18.93,4.11l-35.87,6.68l-30.61,4.16l-9.1,1.87l-27.04,3.14l5.06,-2l3.53,-1.92l1.3,-2.42l4.55,-3.38l1.57,-2.65l0.17,-1.88l5.21,-3.46l6.13,-7.78l1.39,3.68l2.33,1.71l3.01,1.37l5.21,-3.61l2.41,1.22l6.36,-2.98l0.05,-2.07l2.15,0.45l1.93,-2.01l2.54,-0.11l2.53,-2.22l0.03,-2.11L911.2,328l1.72,-4.29l2.9,-3.52l0.28,-3.45l2.3,-4.51l0.8,-5.16l2.64,1.3l2.9,1.11l2.36,-1.33l0.46,-2.19l1.2,-3.09l1.34,-3.53l1.44,0.69l2.03,-3.37l2.84,-3.57l1.72,-2.63l0.2,-6.19l10.03,4.26L949.46,283.97zM988.81,323.46l1.81,0.52l5.88,-19.91l-3.99,1.27l-1.03,1.82L988.81,323.46z"},{"code":"US-VT","name":"Vermont","path":"M1019.95,188.12L1006.47,191.24L1002.51,172.89L1000.17,173.31L999.66,172.55L999.87,169.09L996.94,163.69L997.38,158.72L995.65,155.57L993.6,149.11L993.51,146.1L992.69,141.54L1021.52,133.86L1021.55,133.87L1021.37,140.36L1023.4,143.19L1023.53,146.09L1020.7,149.61L1017.94,151.5L1017.99,153.78L1018.58,157.42L1018.09,163.14L1017.3,165.41L1016.72,170.27L1017.56,175.61L1017.43,177.12L1018.57,182.99L1018.05,186.18z"},{"code":"US-WA","name":"Washington","path":"M313.23,58.66L306.56,87.28L299.68,118.48L300.3,122.21L299.24,126.14L267.26,118.43L261.12,119.3L257.44,117.29L253.95,118.28L247.56,119.17L240.68,116.96L236.67,117.76L233.22,117.63L231.12,115.79L225.89,113.27L222.2,112.96L215.57,113.53L211.77,112.47L208.47,110.57L208.26,107.16L208.97,103.37L207.41,98.33L203.38,95.72L200.31,92.59L195.72,91.03L192.49,90.34L194.19,70.89L198.52,49.07L217.79,59.52L219.14,78.74L224.58,74.04L227.61,55.27L226.19,34.98L269.51,47.56z"},{"code":"US-WI","name":"Wisconsin","path":"M718.02,148.31L718.17,148.42L719.11,147.88L719.13,147.95L721.66,148.55L723.2,152.58L737.33,155.69L746.81,159.08L751.29,158.75L754.41,158.78L755.61,162.45L759.51,163.56L761.21,166.63L760.4,168.55L760,172.31L763.55,172.19L762.7,175.96L765.09,178.45L765.1,178.41L765.53,178.53L765.4,178.76L759.81,187.53L762.25,190.02L772.73,174.27L775.14,173.95L768.45,192.24L766.23,208.39L764.26,221.5L767.34,232.41L767.4,237.97L767.34,237.97L767.35,238.03L754.43,238.94L736.92,240.23L719.79,241.33L717.96,237.96L712.37,236.09L711.1,232.54L710.31,230.55L710,225.78L711.39,223.98L709.04,220.49L708.74,219.26L708.17,216.72L707.84,211.25L707.21,209.4L701.49,206.31L697.18,202.59L695.92,200.19L694.02,198.73L688.61,195.71L686.66,195.58L681.75,191.37L682.07,186.34L681.86,180.15L682.88,174.37L679.36,170.21L681.49,165.93L684.81,163.61L688.65,160.93L689.15,160.93L688.46,148.11L692.56,146.66L692.56,146.66L708.07,141.11z"},{"code":"US-WV","name":"West Virginia","path":"M917.49,280.96L919.42,292.31L921.71,289.82L924.2,286.7L927.46,285.17L929.32,282.4L934.58,282.31L936.14,280.29L939.12,277.96L944.79,278.66L947.53,281.41L949.46,283.97L948.37,288.54L938.34,284.28L938.14,290.47L936.42,293.1L933.58,296.67L931.55,300.04L930.11,299.35L928.76,302.87L927.56,305.97L927.1,308.15L924.75,309.48L921.84,308.37L919.2,307.07L918.4,312.23L916.1,316.74L915.82,320.19L912.93,323.71L911.2,328L911.95,330.57L911.92,332.68L909.4,334.9L906.86,335.01L904.93,337.02L902.78,336.56L902.73,338.63L896.37,341.61L893.96,340.38L888.75,343.99L885.75,342.62L883.41,340.91L882.03,337.23L878.49,337.35L876.29,334.91L873.25,332.39L871.88,329.12L869.24,325.93L868.74,321.26L868.09,319.18L872.38,317.95L874.2,314.49L873.72,309.48L875.44,304.24L877.89,304.42L878.5,306.88L879.92,305.75L880.12,303.48L880.19,299.33L883.46,294.86L885.64,295.02L887.88,294.01L889.71,292.59L893.57,286.7L893.47,284.35L894.33,279.24L895.11,273.12L895.03,267.83L893.82,265.11L895.99,263.59L899.53,284.16z"},{"code":"US-WY","name":"Wyoming","path":"M499.16,180.45L495.46,226.79L491.58,271.97L474.43,270.36L440.2,266.58L423.12,264.4L406.05,262.04L372.15,256.16L375.87,234.37L385.21,178.56L384.7,178.06L385.13,177.31L386.97,165.87L418.47,170.63L443.38,174.28L472.33,177.57z"}]; + tuiChart.registerMap('usa', data); +})(tui.chart); diff --git a/dist/maps/world.js b/dist/maps/world.js new file mode 100644 index 000000000..cc4c03cb9 --- /dev/null +++ b/dist/maps/world.js @@ -0,0 +1,11 @@ +/** + * https://www.amcharts.com/svg-maps/?map=world + * map data by amcharts team + */ + +'use strict'; + +(function(tuiChart) { + var data = [{"code":"AE","name":"United Arab Emirates","path":"M619.87,393.72L620.37,393.57L620.48,394.41L622.67,393.93L624.99,394.01L626.68,394.1L628.6,392.03L630.7,390.05L632.47,388.15L633,389.2L633.38,391.64L631.95,391.65L631.72,393.65L632.22,394.07L630.95,394.67L630.94,395.92L630.12,397.18L630.05,398.39L629.48,399.03L621.06,397.51L619.98,394.43z"},{"code":"AF","name":"Afghanistan","path":"M646.88,356.9L649.74,358.2L651.85,357.74L652.44,356.19L654.65,355.67L656.23,354.62L656.79,351.83L659.15,351.15L659.59,349.9L660.92,350.84L661.76,350.95L663.32,350.98L665.44,351.72L666.29,352.14L668.32,351.02L669.27,351.69L670.17,350.09L671.85,350.16L672.28,349.64L672.58,348.21L673.79,346.98L675.3,347.78L675,348.87L675.85,349.04L675.58,351.99L676.69,353.14L677.67,352.4L678.92,352.06L680.66,350.49L682.59,350.75L685.49,350.75L685.99,351.76L684.35,352.15L682.93,352.8L679.71,353.2L676.7,353.93L675.06,355.44L675.72,356.9L676.05,358.6L674.65,360.03L674.77,361.33L674,362.55L671.33,362.44L672.43,364.66L670.65,365.51L669.46,367.51L669.61,369.49L668.51,370.41L667.48,370.11L665.33,370.54L665.03,371.45L662.94,371.45L661.38,373.29L661.28,376.04L657.63,377.37L655.68,377.09L655.11,377.79L653.44,377.39L650.63,377.87L645.94,376.23L648.48,373.3L648.25,371.2L646.13,370.65L645.91,368.56L644.99,365.92L646.19,364.09L644.97,363.6L645.74,361.15z"},{"code":"AL","name":"Albania","path":"M532.98,334.66L532.63,335.93L533.03,337.52L534.19,338.42L534.13,339.39L533.22,339.93L533.05,341.12L531.75,342.88L531.27,342.63L531.22,341.83L529.66,340.6L529.42,338.85L529.66,336.32L530.04,335.16L529.57,334.57L529.38,333.38L530.6,331.51L530.77,332.23L531.53,331.89L532.13,332.91L532.8,333.29z"},{"code":"AM","name":"Armenia","path":"M597.45,337.5L601.35,336.92L601.93,337.9L603,338.54L602.43,339.46L603.93,340.72L603.14,341.88L604.33,342.87L605.59,343.46L605.65,345.96L604.63,346.06L603.49,343.98L603.5,343.43L602.26,343.44L601.43,342.46L600.85,342.56L599.74,341.5L597.66,340.59L597.93,338.8z"},{"code":"AO","name":"Angola","path":"M521.03,479.78l0.69,2.09l0.8,1.68l0.64,0.91l1.07,1.47l1.85,-0.23l0.93,-0.4l1.55,0.4l0.42,-0.7l0.7,-1.64l1.74,-0.11l0.15,-0.49l1.43,-0.01l-0.24,1.01l3.4,-0.02l0.05,1.77l0.57,1.09l-0.41,1.7l0.21,1.74l0.94,1.05l-0.15,3.37l0.69,-0.26l1.22,0.07l1.74,-0.42l1.28,0.17l0.3,0.88l-0.32,1.38l0.49,1.34l-0.42,1.07l0.24,0.99l-5.84,-0.04l-0.13,9.16l1.89,2.38l1.83,1.82l-5.15,1.19l-6.79,-0.41l-1.94,-1.4l-11.37,0.13l-0.42,0.21l-1.67,-1.32l-1.82,-0.09l-1.68,0.5l-1.35,0.56l-0.26,-1.83l0.39,-2.55l0.97,-2.65l0.15,-1.24l0.91,-2.59l0.67,-1.17l1.61,-1.87l0.9,-1.27l0.29,-2.11l-0.15,-1.61l-0.84,-1.01l-0.75,-1.72l-0.69,-1.69l0.15,-0.59l0.86,-1.12l-0.85,-2.72l-0.57,-1.88l-1.4,-1.77l0.27,-0.54l1.16,-0.38l0.81,0.05l0.98,-0.34L521.03,479.78zM510.12,479.24l-0.71,0.3l-0.75,-2.1l1.13,-1.21l0.85,-0.47l1.05,0.96l-1.02,0.59l-0.46,0.72L510.12,479.24z"},{"code":"AR","name":"Argentina","path":"M291.6,648.91l-2.66,0.25l-1.43,-1.73l-1.69,-0.13l-3,0l0,-10.57l1.08,2.15l1.4,3.53l3.65,2.87l3.93,1.21L291.6,648.91zM293.1,526.47l1.65,2.18l1.09,-2.43l3.2,0.12l0.45,0.64l5.15,4.94l2.29,0.46l3.43,2.26l2.89,1.2l0.4,1.36l-2.76,4.73l2.83,0.85l3.15,0.48l2.22,-0.5l2.54,-2.4l0.46,-2.74l1.39,-0.59l1.41,1.79l-0.06,2.49l-2.36,1.73l-1.88,1.28l-3.16,3.08l-3.74,4.37l-0.7,2.59l-0.75,3.37l0.03,3.3l-0.61,0.74l-0.22,2.17l-0.19,1.76l3.56,2.91l-0.38,2.37l1.75,1.51l-0.14,1.7l-2.69,4.52l-4.16,1.91l-5.62,0.75l-3.08,-0.36l0.59,2.15l-0.57,2.72l0.52,1.85l-1.68,1.3l-2.87,0.51l-2.7,-1.35l-1.08,0.97l0.39,3.71l1.89,1.14l1.54,-1.19l0.84,1.96l-2.58,1.18l-2.25,2.38l-0.41,3.91l-0.66,2.11l-2.65,0.01l-2.2,2.04l-0.8,3.01l2.76,2.98l2.68,0.83l-0.96,3.73l-3.31,2.38l-1.82,5.03l-2.56,1.72l-1.15,2.06l0.91,4.64l1.87,2.63l-1.18,-0.23l-2.6,-0.71l-6.78,-0.61l-1.16,-2.63l0.05,-3.33l-1.87,0.28l-0.99,-1.6l-0.25,-4.6l2.15,-1.88l0.89,-2.68l-0.33,-2.11l1.49,-3.52l1.02,-5.35l-0.3,-2.33l1.22,-0.75l-0.3,-1.48l-1.3,-0.78l0.92,-1.63l-1.27,-1.46l-0.65,-4.4l1.13,-0.77l-0.47,-4.54l0.66,-3.75l0.75,-3.22l1.68,-1.3l-0.85,-3.46l-0.01,-3.22l2.12,-2.26l-0.06,-2.87l1.6,-3.31l0.01,-3.09l-0.73,-0.61l-1.29,-5.69l1.73,-3.34l-0.27,-3.11l1,-2.9l1.84,-2.96l1.98,-1.95l-0.84,-1.23l0.59,-1l-0.09,-5.14l3.05,-1.51l0.96,-3.16l-0.34,-0.76l2.34,-2.72L293.1,526.47z"},{"code":"AT","name":"Austria","path":"M522.86,309.85L522.65,311.56L521.07,311.57L521.61,312.46L520.68,315.11L520.15,315.8L517.7,315.9L516.28,316.82L513.96,316.51L509.95,315.46L509.33,314.03L506.56,314.75L506.23,315.52L504.53,314.94L503.1,314.83L501.83,314.09L502.26,313.08L502.15,312.34L503,312.12L504.42,313.26L504.82,312.17L507.29,312.35L509.3,311.61L510.64,311.73L511.51,312.58L511.78,311.88L511.38,309.16L512.39,308.62L513.37,306.67L515.46,308.04L517.03,306.3L518.02,305.98L520.2,307.28L521.51,307.06L522.81,307.86L522.58,308.4z"},{"code":"AU","name":"Australia","path":"M882.93,588.16l2.71,1.28l1.53,-0.51l2.19,-0.71l1.68,0.25l0.2,4.43l-0.96,1.3l-0.29,3.06l-0.98,-1.05l-1.95,2.67l-0.58,-0.21l-1.72,-0.12l-1.73,-3.28l-0.38,-2.5l-1.62,-3.25l0.07,-1.7L882.93,588.16zM877.78,502.1l1.01,2.25l1.8,-1.08l0.93,1.22l1.35,1.13l-0.29,1.28l0.6,2.48l0.43,1.45l0.71,0.35l0.76,2.5l-0.27,1.52l0.91,1.99l3.04,1.54l1.98,1.41l1.88,1.29l-0.37,0.72l1.6,1.87l1.09,3.25l1.12,-0.66l1.14,1.31l0.69,-0.46l0.48,3.21l1.99,1.87l1.3,1.17l2.19,2.49l0.79,2.49l0.07,1.77l-0.19,1.94l1.34,2.68l-0.16,2.81l-0.49,1.48l-0.76,2.87l0.06,1.86l-0.55,2.34l-1.24,3l-2.08,1.63l-1.02,2.59l-0.94,1.67l-0.83,2.93l-1.08,1.71l-0.71,2.58l-0.36,2.4l0.14,1.11l-1.61,1.22l-3.14,0.13l-2.59,1.45l-1.29,1.38l-1.69,1.54l-2.32,-1.58l-1.72,-0.63l0.44,-1.85l-1.53,0.67l-2.46,2.58l-2.42,-0.97l-1.59,-0.56l-1.6,-0.25l-2.71,-1.03l-1.81,-2.18l-0.52,-2.66l-0.65,-1.75l-1.38,-1.4l-2.7,-0.41l0.92,-1.66l-0.68,-2.52l-1.37,2.35l-2.5,0.63l1.47,-1.88l0.42,-1.95l1.08,-1.65l-0.22,-2.47l-2.28,2.85l-1.75,1.15l-1.07,2.69l-2.19,-1.4l0.09,-1.79l-1.75,-2.43l-1.48,-1.25l0.53,-0.77l-3.6,-2l-1.97,-0.09l-2.7,-1.6l-5.02,0.31l-3.63,1.18l-3.19,1.1l-2.68,-0.22l-2.97,1.7l-2.43,0.77l-0.54,1.75l-1.04,1.36l-2.38,0.08l-1.76,0.3l-2.48,-0.61l-2.02,0.37l-1.92,0.15l-1.67,1.8l-0.82,-0.15l-1.41,0.96l-1.35,1.08l-2.05,-0.13l-1.88,0l-2.97,-2.17l-1.51,-0.64l0.06,-1.93l1.39,-0.46l0.48,-0.76l-0.1,-1.2l0.34,-2.3l-0.31,-1.95l-1.48,-3.29l-0.46,-1.85l0.12,-1.83l-1.12,-2.08l-0.07,-0.93l-1.24,-1.26l-0.35,-2.47l-1.6,-2.48l-0.39,-1.33l1.23,1.35l-0.95,-2.88l1.39,0.9l0.83,1.2l-0.05,-1.59l-1.39,-2.43l-0.27,-0.97l-0.65,-0.92l0.3,-1.77l0.57,-0.75l0.38,-1.52l-0.3,-1.77l1.16,-2.17l0.21,2.29l1.18,-2.07l2.28,-1l1.37,-1.28l2.14,-1.1l1.27,-0.23l0.77,0.37l2.21,-1.11l1.7,-0.33l0.42,-0.65l0.74,-0.27l1.55,0.07l2.95,-0.87l1.52,-1.31l0.72,-1.58l1.64,-1.49l0.13,-1.17l0.07,-1.59l1.96,-2.47l1.18,2.51l1.19,-0.58l-1,-1.38l0.88,-1.41l1.24,0.63l0.34,-2.21l1.53,-1.42l0.68,-1.14l1.41,-0.49l0.04,-0.8l1.23,0.34l0.05,-0.72l1.23,-0.41l1.36,-0.39l2.07,1.32l1.56,1.71l1.75,0.02l1.78,0.27l-0.59,-1.58l1.34,-2.3l1.26,-0.75l-0.44,-0.71l1.22,-1.63l1.7,-1.01l1.43,0.34l2.36,-0.54l-0.05,-1.45l-2.05,-0.94l1.49,-0.41l1.86,0.7l1.49,1.17l2.36,0.73l0.8,-0.29l1.74,0.88l1.64,-0.82l1.05,0.25l0.66,-0.55l1.29,1.41l-0.75,1.53l-1.06,1.16l-0.96,0.1l0.33,1.15l-0.82,1.43l-1,1.41l0.2,0.81l2.23,1.6l2.16,0.93l1.44,1l2.03,1.72l0.79,0l1.47,0.75l0.43,0.9l2.68,0.99l1.85,-1l0.55,-1.57l0.57,-1.29l0.35,-1.59l0.85,-2.3l-0.39,-1.39l0.2,-0.84l-0.32,-1.64l0.37,-2.16l0.54,-0.58l-0.44,-0.95l0.68,-1.51l0.53,-1.56l0.07,-0.81l1.04,-1.06l0.79,1.39l0.19,1.78l0.7,0.34l0.12,1.2l1.02,1.45l0.21,1.62L877.78,502.1z"},{"code":"AZ","name":"Azerbaijan","path":"M601.43,342.46l0.83,0.97l1.24,-0.01l-0.01,0.56l1.14,2.08l-1.92,-0.48l-1.42,-1.66l-0.44,-1.37L601.43,342.46zM608.08,337.03l1.24,0.25l0.48,-0.95l1.67,-1.51l1.47,1.97l1.43,2.62l1.31,0.17l0.86,0.99l-2.31,0.29l-0.49,2.82l-0.48,1.26l-1.03,0.84l0.08,1.77l-0.7,0.18l-1.75,-1.87l0.97,-1.78l-0.83,-1.06l-1.05,0.27l-3.31,2.66l-0.06,-2.5l-1.26,-0.59l-1.19,-0.99l0.79,-1.16l-1.49,-1.26l0.56,-0.92l-1.07,-0.64l-0.58,-0.97l0.69,-0.61l2.09,1.07l1.51,0.22l0.38,-0.43l-1.38,-2.02l0.73,-0.52l0.79,0.13L608.08,337.03z"},{"code":"BA","name":"Bosnia and Herzegovina","path":"M528.54,323.11L529.56,323.1L528.86,324.82L530.21,326.32L529.8,328.14L529.14,328.31L528.61,328.67L527.7,329.56L527.29,331.66L524.81,330.22L523.75,328.61L522.68,327.76L521.39,326.31L520.79,325.1L519.41,323.27L520,321.63L521.01,322.54L521.61,321.72L522.92,321.63L525.33,322.29L527.27,322.23z"},{"code":"BD","name":"Bangladesh","path":"M735.09,400.41L735.04,402.56L734.06,402.1L734.24,404.51L733.44,402.95L733.28,401.43L732.74,399.98L731.57,398.22L728.99,398.1L729.25,399.35L728.37,401.02L727.17,400.41L726.76,400.96L725.97,400.63L724.89,400.36L724.45,397.88L723.48,395.6L723.95,393.76L722.23,392.94L722.85,391.82L724.6,390.67L722.58,389.04L723.57,386.93L725.79,388.27L727.13,388.43L727.38,390.58L730.04,391L732.65,390.95L734.26,391.48L732.97,394.07L731.71,394.25L730.85,395.98L732.38,397.56L732.84,395.62L733.62,395.61z"},{"code":"BE","name":"Belgium","path":"M484.55,295.91L486.6,296.26L489.2,295.33L490.97,297.28L492.52,298.32L492.2,301.29L491.47,301.45L491.16,303.88L488.71,301.91L487.27,302.25L485.31,300.19L484.01,298.42L482.71,298.35L482.3,296.79z"},{"code":"BF","name":"Burkina Faso","path":"M467.33,436.4L465.41,435.67L464.09,435.78L463.11,436.49L461.85,435.89L461.36,434.96L460.1,434.34L459.91,432.7L460.68,431.49L460.61,430.53L462.84,428.17L463.25,426.21L464.02,425.51L465.38,425.89L466.55,425.31L466.93,424.57L469.11,423.29L469.64,422.39L472.26,421.19L473.81,420.78L474.51,421.33L476.3,421.32L476.08,422.72L476.46,424.03L478.04,425.9L478.12,427.28L481.36,427.93L481.29,429.88L480.68,430.74L479.31,431L478.74,432.24L477.78,432.56L475.32,432.5L474.02,432.28L473.12,432.74L471.88,432.53L467.01,432.66L466.94,434.27z"},{"code":"BG","name":"Bulgaria","path":"M538.78,325.56L539.59,327.16L540.67,326.87L542.83,327.48L546.95,327.68L548.34,326.69L551.64,325.79L553.68,327.2L555.33,327.61L553.87,329.2L552.85,331.93L553.75,334.09L551.34,333.58L548.48,334.76L548.45,336.62L545.9,336.97L543.93,335.67L541.68,336.7L539.61,336.59L539.41,334.12L538,332.91L538.47,332.37L538.16,331.92L538.63,330.71L539.7,329.52L538.34,327.86L538.09,326.44z"},{"code":"BI","name":"Burundi","path":"M557.52,475.93L557.34,472.56L556.63,471.3L558.34,471.52L559.2,469.93L560.69,470.11L560.85,471.21L561.45,471.84L561.48,472.75L560.79,473.33L559.69,474.79L558.68,475.8z"},{"code":"BJ","name":"Benin","path":"M482.8,445.92L480.48,446.25L479.79,444.31L479.92,437.85L479.35,437.27L479.25,435.88L478.27,434.89L477.42,434.06L477.78,432.56L478.74,432.24L479.31,431L480.68,430.74L481.29,429.88L482.23,429.05L483.24,429.04L485.38,430.68L485.27,431.63L485.9,433.31L485.35,434.45L485.64,435.21L484.28,436.96L483.42,437.83L482.89,439.6L482.96,441.39z"},{"code":"BN","name":"Brunei Darussalam","path":"M795.46,450.77L796.57,449.72L798.96,448.19L798.83,449.57L798.67,451.35L797.33,451.26L796.74,452.21z"},{"code":"BO","name":"Bolivia","path":"M299.04,526.35L295.84,526.22L294.75,528.65L293.1,526.47L289.43,525.74L287.1,528.46L285.07,528.87L283.97,524.72L282.47,521.38L283.35,518.51L281.88,517.26L281.51,515.14L280.13,513.14L281.9,510L280.69,507.56L281.34,506.59L280.83,505.52L281.93,504.08L281.99,501.64L282.12,499.62L282.73,498.66L280.3,494.08L282.39,494.32L283.83,494.25L284.46,493.4L286.91,492.25L288.38,491.19L292.05,490.71L291.76,492.83L292.1,493.92L291.87,495.82L294.92,498.37L298.06,498.84L299.16,499.91L301.06,500.48L302.22,501.31L303.98,501.28L305.61,502.13L305.73,503.79L306.28,504.63L306.32,505.88L305.5,505.92L306.58,509.29L311.95,509.41L311.54,511.09L311.84,512.24L313.37,513.06L314.04,514.88L313.54,517.2L312.77,518.49L313.04,520.18L312.16,520.79L312.12,519.88L309.5,518.37L306.9,518.32L302.01,519.18L300.67,521.8L300.6,523.4L299.49,526.99z"},{"code":"BR","name":"Brazil",labelCoordinate: {x: 0.65,y: 0.4},"path":"M313.68,551.79L317.42,547.42L320.59,544.34L322.47,543.06L324.83,541.33L324.89,538.84L323.48,537.05L322.09,537.64L322.64,535.86L323.02,534.04L323.02,532.36L322.01,531.81L320.96,532.3L319.92,532.17L319.59,530.99L319.33,528.22L318.8,527.32L316.91,526.5L315.77,527.09L312.81,526.51L312.99,522.45L312.16,520.79L313.04,520.18L312.77,518.49L313.54,517.2L314.04,514.88L313.37,513.06L311.84,512.24L311.54,511.09L311.95,509.41L306.58,509.29L305.5,505.92L306.32,505.88L306.28,504.63L305.73,503.79L305.61,502.13L303.98,501.28L302.22,501.31L301.06,500.48L299.16,499.91L298.06,498.84L294.92,498.37L291.87,495.82L292.1,493.92L291.76,492.83L292.05,490.71L288.38,491.19L286.91,492.25L284.46,493.4L283.83,494.25L282.39,494.32L280.3,494.08L278.72,494.57L277.44,494.24L277.63,489.94L275.33,491.6L272.86,491.53L271.8,490.02L269.94,489.86L270.53,488.65L268.97,486.93L267.8,484.4L268.54,483.89L268.54,482.7L270.24,481.89L269.96,480.38L270.67,479.4L270.88,478.1L274.08,476.19L276.38,475.66L276.75,475.24L279.28,475.37L280.54,467.72L280.61,466.51L280.17,464.92L278.93,463.9L278.94,461.88L280.52,461.42L281.08,461.71L281.17,460.64L279.53,460.35L279.5,458.61L284.96,458.67L285.89,457.71L286.67,458.59L287.21,460.24L287.74,459.89L289.29,461.37L291.47,461.19L292.01,460.33L294.09,459.68L295.25,459.23L295.57,458.05L297.58,457.25L297.42,456.67L295.05,456.43L294.66,454.67L294.77,452.8L293.52,452.08L294.04,451.82L296.12,452.18L298.35,452.88L299.16,452.22L301.17,451.78L304.31,450.74L305.34,449.67L304.96,448.88L306.42,448.76L307.08,449.4L306.71,450.63L307.67,451.05L308.32,452.35L307.54,453.33L307.09,455.71L307.81,457.12L308.01,458.41L309.74,459.71L311.12,459.85L311.43,459.31L312.31,459.19L313.58,458.7L314.49,457.96L316.04,458.19L316.72,458.09L318.25,458.32L318.5,457.75L318.03,457.2L318.31,456.39L319.44,456.64L320.77,456.35L322.37,456.94L323.6,457.52L324.47,456.76L325.09,456.88L325.48,457.67L326.82,457.47L327.89,456.41L328.75,454.35L330.41,451.8L331.37,451.67L332.06,453.21L333.63,458.09L335.13,458.55L335.21,460.47L333.1,462.76L333.97,463.6L338.93,464.04L339.03,466.83L341.16,465L344.69,466.01L349.34,467.71L350.71,469.34L350.25,470.88L353.51,470.02L358.97,471.5L363.16,471.39L367.3,473.7L370.88,476.83L373.04,477.63L375.44,477.75L376.46,478.63L377.41,482.2L377.88,483.89L376.76,488.55L375.33,490.39L371.38,494.33L369.59,497.54L367.52,500.02L366.82,500.08L366.03,502.18L366.23,507.58L365.45,512.06L365.15,513.99L364.27,515.14L363.77,519.08L360.93,522.96L360.45,526.05L358.18,527.36L357.52,529.17L354.48,529.16L350.07,530.33L348.09,531.68L344.95,532.57L341.65,535.01L339.28,538.07L338.87,540.39L339.34,542.12L338.81,545.3L338.18,546.85L336.22,548.6L333.11,554.28L330.64,556.87L328.73,558.41L327.46,561.57L325.6,563.48L324.82,561.58L326.06,560.01L324.44,557.76L322.24,555.94L319.35,553.86L318.31,553.95L315.5,551.45z"},{"code":"BS","name":"Bahamas","path":"M257.86,395.2l-0.69,0.15l-0.71,-1.76l-1.05,-0.89l0.61,-1.95l0.84,0.12l0.98,2.55L257.86,395.2zM257.06,386.51l-3.06,0.5l-0.2,-1.15l1.32,-0.25l1.85,0.09L257.06,386.51zM259.36,386.48l-0.48,2.21l-0.52,-0.4l0.05,-1.63l-1.26,-1.23l-0.01,-0.36L259.36,386.48z"},{"code":"BT","name":"Bhutan","path":"M732.36,382.78L733.5,383.78L733.3,385.71L731.01,385.8L728.65,385.59L726.88,386.08L724.33,384.89L724.28,384.26L726.13,381.92L727.64,381.12L729.65,381.85L731.13,381.93z"},{"code":"BW","name":"Botswana","path":"M547.17,515.95L547.73,516.47L548.62,518.18L551.79,521.43L552.99,521.75L553,522.8L553.82,524.7L555.99,525.16L557.78,526.52L553.81,528.74L551.29,531L550.36,533.03L549.52,534.18L547.99,534.43L547.5,535.9L547.21,536.86L545.42,537.58L543.14,537.43L541.8,536.57L540.62,536.19L539.25,536.91L538.56,538.39L537.23,539.32L535.83,540.71L533.82,541.03L533.2,539.94L533.46,538.04L531.79,535.11L531.04,534.65L531.04,525.79L533.8,525.68L533.88,515.11L535.97,515.02L540.29,513.99L541.37,515.2L543.15,514.05L544.01,514.04L545.59,513.38L546.09,513.6z"},{"code":"BY","name":"Belarus","path":"M541.1,284.07L543.81,284.11L546.85,282.31L547.5,279.59L549.8,278.02L549.54,275.82L551.24,274.98L554.26,273.05L557.21,274.31L557.61,275.54L559.08,274.95L561.82,276.13L562.09,278.44L561.49,279.76L563.25,282.91L564.39,283.78L564.22,284.64L566.11,285.47L566.92,286.72L565.83,287.74L563.57,287.58L563.03,288.02L563.69,289.56L564.38,292.49L561.97,292.76L561.11,293.76L560.92,296.02L559.81,295.59L557.28,295.81L556.54,294.76L555.49,295.54L554.44,294.89L552.23,294.8L549.1,293.72L546.27,293.36L544.1,293.46L542.56,294.69L541.22,294.86L541.17,292.85L540.3,290.73L541.98,289.79L542,287.94L541.22,286.16z"},{"code":"BZ","name":"Belize","path":"M225.31,412.96L225.29,412.53L225.63,412.39L226.14,412.74L227.14,410.97L227.67,410.93L227.68,411.36L228.21,411.37L228.17,412.17L227.71,413.44L227.96,413.89L227.67,414.94L227.84,415.21L227.52,416.68L226.97,417.46L226.46,417.55L225.9,418.55L225.07,418.55L225.29,415.27z"},{"code":"CA","name":"Canada",labelCoordinate:{x:0.4,y:0.7},"path":"M198.93,96.23l-0.22,-5.9l3.63,0.58l1.63,0.96l3.35,4.92l-0.76,4.97l-4.15,2.77l-2.28,-3.12L198.93,96.23zM212.14,108.88l0.33,-1.49l-1.97,-2.45l-5.65,-0.19l0.75,3.68l5.25,0.83L212.14,108.88zM248.49,155.83l3.08,5.1l0.81,0.57l3.07,-1.27l3.02,0.2l2.98,0.28l-0.25,-2.64l-4.84,-5.38l-6.42,-1.08l-1.35,0.67L248.49,155.83zM183.06,93.13l-2.71,4.19l6.24,0.52l4.61,4.44l4.58,1.5l-1.09,-5.68l-2.14,-6.73l-7.58,-5.35l-5.5,-2.04l0.2,5.69L183.06,93.13zM208.96,82.89l5.13,-0.12l-2.22,4l-0.04,5.3l3.01,5.76l5.81,1.77l4.96,-0.99l5.18,-10.73l3.85,-4.45l-3.38,-4.97l-2.21,-10.65l-4.6,-3.19l-4.72,-3.68l-3.58,-9.56l-6.52,0.94l1.23,4.15l-2.87,1.25l-1.94,5.32l-1.94,7.46l1.78,7.26L208.96,82.89zM145.21,136.27l3.92,1.95l12.67,-1.3l-5.82,4.77l0.36,3.43l4.26,-0.24l7.07,-4.58l9.5,-1.67l1.71,-5.22l-0.49,-5.57l-2.94,-0.5l-2.5,1.93l-1.1,-4.13l-0.95,-5.7l-2.9,-1.42l-2.57,4.41l4.01,11.05l-4.9,-0.85l-4.98,-6.79l-7.89,-4l-2.64,3.32L145.21,136.27zM167.77,94.21l-3.65,-2.9l-1.5,-0.66l-2.88,4.28l-0.05,2l4.66,0.01L167.77,94.21zM166.31,106.56l0.93,-3.99l-3.95,-2.12l-4.09,1.39l-2.27,4.26l4.16,4.21L166.31,106.56zM195.4,139.8l4.62,-1.11l1.28,-8.25l-0.09,-5.95l-2.14,-5.56l-0.22,1.6l-3.94,-0.7l-4.22,4.09l-3.02,-0.37l0.18,8.92l4.6,-0.87l-0.06,6.47L195.4,139.8zM192.12,185.41l-5.06,-3.93l-4.71,-4.21l-0.87,-6.18l-1.76,-8.92l-3.14,-3.84l-2.79,-1.55l-2.47,1.42l1.99,9.59l-1.41,3.73l-2.29,-8.98l-2.56,-3.11l-3.17,4.81l-3.9,-4.76l-6.24,2.87l1.4,-4.46l-2.87,-1.87l-7.51,5.84l-1.95,3.71l-2.35,6.77l4.9,2.32l4.33,-0.12l-6.5,3.46l1.48,3.13l3.98,0.17l5.99,-0.67l5.42,1.96l-3.66,1.44l-3.95,-0.37l-4.33,1.41l-1.87,0.87l3.45,6.35l2.49,-0.88l3.83,2.15l1.52,3.65l4.99,-0.73l7.1,-1.16l5.26,-2.65l3.26,-0.48l4.82,2.12l5.07,1.22l0.94,-2.86l-1.79,-3.05l4.6,-0.64L192.12,185.41zM199.86,184.43l-1.96,3.54l-2.47,2.49l3.83,3.54l2.28,-0.85l3.78,2.36l1.74,-2.73l-1.71,-3.03l-0.84,-1.53l-1.68,-1.46L199.86,184.43zM182.25,154.98l-2.13,-2.17l-3.76,0.4l-0.95,1.38l4.37,6.75L182.25,154.98zM210.94,168.15l3.01,-6.93l3.34,-1.85l4.19,-8.74l-5.36,-2.47l-5.84,-0.36l-2.78,2.77l-1.47,4.23l-0.04,4.82l1.75,8.19L210.94,168.15zM228.09,145.15l5.76,-0.18l8.04,-1.61l3.59,1.28l4.18,-2.26l1.75,-2.84l-0.63,-4.52l-3,-4.23l-4.56,-0.8l-5.71,0.97l-4.46,2.44l-4.09,-0.94l-3.78,-0.5l-1.78,-2.7l-3.22,-2.61l0.64,-4.43l-2.42,-3.98l-5.52,0.03l-3.11,-3.99l-5.78,-0.8l-1.06,5.1l3.25,3.74l5.8,1.45l2.81,5.09l0.34,5.6l0.97,5.99l7.45,3.42L228.09,145.15zM139.07,126.88l5.21,-5.05l2.62,-0.59l2.16,-4.23l0.38,-9.77l-3.85,1.91l-4.3,-0.18l-5.76,8.19l-4.76,8.98l3.8,2.51L139.07,126.88zM211.25,143.05l1.53,-4.14l-1.02,-3.46l-2.45,-3.92l-4.03,3.02l-1.49,4.92l3.4,2.79L211.25,143.05zM202.94,154.49l-0.73,-2.88l-5,1.26l-3.34,-2.11l-3.32,4.8l3.09,6.28l-5.72,-1.17l-0.06,3.01l6.97,7.05l1.94,3.38l2.7,0.73l4.6,-3.41l0.5,-8.21l-4.24,-4.07L202.94,154.49zM128.95,308.23l-1.16,-2.34l-2.8,-1.77l-1.39,-2.05l-0.95,-1.5l-2.64,-0.46l-1.72,-0.67l-2.94,-0.96l-0.24,1.02l1.08,2.38l2.89,0.78l0.5,1.23l2.51,1.5l0.84,1.51l4.6,1.92L128.95,308.23zM250.65,230.6l-2,-2.11l-2.06,0.5l-0.25,-3.06l-3.21,-2.04l-3.07,-2.27l-1.63,-1.75l-1.43,1.03l-0.52,-2.96l-2.03,-0.55l-0.96,6.13l-0.36,5.11l-2.44,3.14l3.8,-0.6l0.96,3.65l3.99,-3.23l2.78,-3.38l1.57,2.86l4.36,1.51L250.65,230.6zM130.12,178.05l7.38,-4.18V170l3.48,-6.41l6.88,-6.69l3.52,-2.47l-3.01,-4.2l-2.72,-2.95l-7.16,-0.57l-4,-2.16l-9.48,1.63l2.74,6.23l-2.43,6.43l-1.94,6.87l-1.2,3.86l6.47,4.69L130.12,178.05zM264.36,205.36l0.32,-1.01l-0.03,-3.17l-2.19,-2.08l-2.57,1.05l-1.19,4.17l0.7,3.56l3.14,-0.36L264.36,205.36zM288.18,212.9l4.41,6.6l3.45,2.85l4.92,-7.87l0.87,-4.93l-4.41,-0.47l-4.03,-6.7l-4.45,-1.64l-6.6,-4.97l5.15,-3.63l-2.65,-7.54l-2.44,-3.35l-6.77,-3.35l-2.92,-5.55l-5.21,1.99l-0.36,-3.86l-3.86,-4.32l-6.22,-4.71l-2.65,3.71l-5.55,2.66l0.42,-6.06l-4.81,-10.05l-7.11,4.06l-2.59,7.7l-2.21,-5.92l2.06,-6.37l-7.24,2.65l-2.88,3.99l-2.15,8.42l0.89,9.05l3.98,0.04l-2.93,3.92l2.33,2.96l4.55,1.25l5.93,2.42l10.2,1.82l5.08,-1.04l1.5,-2.42l2.21,2.79l2.47,0.46l2.97,4.96l-1.8,1.98l5.68,2.63l4.29,3.68l1.08,2.55l0.77,3.24l-3.63,6.93l-0.98,3.44l0.94,2.42l-5.77,0.86l-5.27,0.12l-1.85,4.87l2.37,2.23l8.11,-1.03l-0.04,-1.89l4.08,3.15l4.18,3.28l-0.98,1.77l3.4,3.02l6.02,3.53l7.6,2.39l-0.46,-2.09l-2.92,-3.67l-3.96,-5.37l7.03,5l3.54,1.66l0.97,-4.44l-1.82,-6.3l-1.16,-1.73l-3.81,-3.03l-2.95,-3.91l0.35,-3.94L288.18,212.9zM222.35,51.34l2.34,7.29l4.96,5.88l9.81,-1.09l6.31,1.97l-4.38,6.05l-2.21,-1.78l-7.66,-0.71l1.19,8.31l3.96,6.04l-0.8,5.2l-4.97,3.46l-2.27,5.47l4.55,2.65l3.82,8.55l-7.5,-5.7l-1.71,0.94l1.38,9.38l-5.18,2.83l0.35,5.85l5.3,0.63l4.17,1.44l8.24,-1.84l7.33,3.27l7.49,-7.19l-0.06,-3.02l-4.79,0.48l-0.39,-2.84l3.92,-3.83l1.33,-5.15l4.33,-3.83l2.66,-4.76l-2.32,-7.1l1.94,-2.65l-3.86,-1.89l8.49,-1.63l1.79,-3.15l5.78,-2.6l4.8,-13.47l4.57,-4.94l6.62,-11.12l-6.1,0.1l2.54,-4.3l6.78,-3.99l6.84,-8.9l0.12,-5.73l-5.13,-6.04l-6.02,-2.93l-7.49,-1.82l-6.07,-1.49l-6.07,-1.5l-8.1,3.98l-1.49,-2.53l-8.57,0.98l-5.03,2.57l-3.7,3.65l-2.13,11.74L239,24.52l-3.48,-1.14l-4.12,7.97l-5.5,3.35l-3.27,0.66l-4.17,3.84l0.61,6.65L222.35,51.34zM296.75,316.34l-0.98,-1.98l-1.06,1.26l0.7,1.36l3.56,1.71l1.04,-0.26l1.38,-1.66l-2.6,0.11L296.75,316.34zM239.75,238.48l0.61,1.63l1.98,0.14l3.28,-3.34l0.06,-1.19l-3.85,-0.06L239.75,238.48zM301.88,304.92l-2.87,-1.8l-3.69,-1.09l-0.97,0.37l2.61,2.04l3.63,1.34l1.36,-0.08L301.88,304.92zM326.76,309.71l-0.36,-2.24l-1.96,0.72l0.87,-3.11l-2.8,-1.32l-1.29,1.05l-2.49,-1.18l0.98,-1.51l-1.88,-0.93l-1.83,1.47l1.86,-3.82l1.5,-2.8l0.54,-1.22l-1.3,-0.2l-2.43,1.55l-1.74,2.53l-2.9,6.92l-2.35,2.56l1.22,1.14l-1.75,1.47l0.43,1.23l5.44,0.13l3.01,-0.25l2.69,1.01l-1.98,1.93l1.67,0.14l3.25,-3.58l0.78,0.53l-0.61,3.37l1.84,0.77l1.27,-0.15l1.18,-3.61L326.76,309.71zM305.57,314.47l-2.81,4.56l-4.63,0.58l-3.64,-2.01l-0.92,-3.07l-0.89,-4.46l2.65,-2.83l-2.48,-2.09l-4.19,0.43l-5.88,3.53l-4.5,5.45l-2.38,0.67l3.23,-3.8l4.04,-5.57l3.57,-1.9l2.35,-3.11l2.9,-0.3l4.21,0.03l6,0.92l4.74,-0.71l3.53,-3.62l4.62,-1.59l2.01,-1.58l2.04,-1.71l-0.2,-5.19l-1.13,-1.77l-2.18,-0.63l-1.11,-4.05l-1.8,-1.55l-4.47,-1.26l-2.52,-2.82l-3.73,-2.83l1.13,-3.2l-3.1,-6.26l-3.65,-6.89l-2.18,-4.98l-1.86,2.61l-2.68,6.05l-4.06,2.97l-2.03,-3.16l-2.56,-0.85l-0.93,-6.99l0.08,-4.8l-5,-0.44l-0.85,-2.27l-3.45,-3.44l-2.61,-2.04l-2.32,1.58l-2.88,-0.58l-4.81,-1.65l-1.95,1.4l0.94,9.18l1.22,5.12l-3.31,5.75l3.41,4.02l1.9,4.44l0.23,3.42l-1.55,3.5l-3.18,3.46l-4.49,2.28l1.98,2.53l1.46,7.4l-1.52,4.68l-2.16,1.46l-4.17,-4.28l-2.03,-5.17l-0.87,-4.76l0.46,-4.19l-3.05,-0.47l-4.63,-0.28l-2.97,-2.08l-3.51,-1.37l-2.01,-2.38l-2.8,-1.94l-5.21,-2.23l-3.92,1.02l-1.31,-3.95l-1.26,-4.99l-4.12,-0.9l0.15,-6.41l1.09,-4.48l3.04,-6.6l3.43,-4.9l3.26,-0.77l0.19,-4.05l2.21,-2.68l4.01,-0.42l3.25,-4.39l0.82,-2.9l2.7,-5.73l0.84,-3.5l2.9,2.11l3.9,-1.08l5.49,-4.96l0.36,-3.54l-1.98,-3.98l2.09,-4.06l-0.17,-3.87l-3.76,-3.95l-4.14,-1.19l-3.98,-0.62l-0.15,8.71l-2.04,6.56l-2.93,5.3l-2.71,-4.95l0.84,-5.61l-3.35,-5.02l-3.75,6.09l0.01,-7.99l-5.21,-1.63l2.49,-4.01l-3.81,-9.59l-2.84,-3.91l-3.7,-1.44l-3.32,6.43l-0.22,9.34l3.27,3.29l3,4.91l-1.27,7.71l-2.26,-0.2l-1.78,5.88l0.02,-7l-4.34,-2.58l-2.49,1.33l0.32,4.67l-4.09,-0.18l-4.35,1.17l-4.95,-3.35l-3.13,0.6l-2.82,-4.11l-2.26,-1.84l-2.24,0.77l-3.41,0.35l-1.81,2.61l2.86,3.19l-3.05,3.72l-2.99,-4.42l-2.39,1.3l-7.57,0.87l-5.07,-1.59l3.94,-3.74l-3.78,-3.9l-2.75,0.5l-3.86,-1.32l-6.56,-2.89l-4.29,-3.37l-3.4,-0.47l-1.06,2.36l-3.44,1.31l-0.38,-6.15l-3.73,5.5l-4.74,-7.32l-1.94,-0.89l-0.63,3.91l-2.09,1.9l-1.93,-3.39l-4.59,2.05l-4.2,3.55l-4.17,-0.98l-3.4,2.5l-2.46,3.28l-2.92,-0.72l-4.41,-3.8l-5.23,-1.94l-0.02,27.65l-0.01,35.43l2.76,0.17l2.73,1.56l1.96,2.44l2.49,3.6l2.73,-3.05l2.81,-1.79l1.49,2.85l1.89,2.23l2.57,2.42l1.75,3.79l2.87,5.88l4.77,3.2l0.08,3.12l-1.56,2.35l0.06,2.48l3.39,3.45l0.49,3.76l3.59,1.96l-0.4,2.79l1.56,3.96l5.08,1.82l2,1.89l5.43,4.23l0.38,0.01h7.96h8.32h2.76h8.55h8.27h8.41l8.42,0l9.53,0l9.59,0l5.8,0l0.01,-1.64l0.95,-0.02l0.5,2.35l0.87,0.72l1.96,0.26l2.86,0.67l2.72,1.3l2.27,-0.55l3.45,1.09l1.14,-1.66l1.59,-0.66l0.62,-1.03l0.63,-0.55l2.61,0.86l1.93,0.1l0.67,0.57l0.94,2.38l3.15,0.63l-0.49,1.18l1.11,1.21l-0.48,1.56l1.18,0.51l-0.59,1.37l0.75,0.13l0.53,-0.6l0.55,0.9l2.1,0.5l2.13,0.04l2.27,0.41l2.51,0.78l0.91,1.26l1.82,3.04l-0.9,1.3l-2.28,-0.54l-1.42,-2.44l0.36,2.49l-1.34,2.17l0.15,1.84l-0.23,1.07l-1.81,1.27l-1.32,2.09l-0.62,1.32l1.54,0.24l2.08,-1.2l1.23,-1.06l0.83,-0.17l1.54,0.38l0.75,-0.59l1.37,-0.48l2.44,-0.47v0l0,0l-0.25,-1.15l-0.13,0.04l-0.86,0.2l-1.12,-0.36l0.84,-1.32l0.85,-0.46l1.98,-0.56l2.37,-0.53l1.24,0.73l0.78,-0.85l0.89,-0.54l0.6,0.29l0.03,0.06l2.87,-2.73l1.27,-0.73l4.26,-0.03l5.17,0l0.28,-0.98l0.9,-0.2l1.19,-0.62l1,-1.82l0.86,-3.15l2.14,-3.1l0.93,1.08l1.88,-0.7l1.25,1.19l0,5.52l1.83,2.25l3.12,-0.48l4.49,-0.13l-4.87,3.26l0.11,3.29l2.13,0.28l3.13,-2.79l2.78,-1.58l6.21,-2.35l3.47,-2.62l-1.81,-1.46L305.57,314.47zM251.91,243.37l1.1,-3.12l-0.71,-1.23l-1.15,-0.13l-1.08,1.8l-0.13,0.41l0.74,1.77L251.91,243.37zM109.25,279.8L109.25,279.8l1.56,-2.35L109.25,279.8zM105.85,283.09l-2.69,0.38l-1.32,-0.62l-0.17,1.52l0.52,2.07l1.42,1.46l1.04,2.13l1.69,2.1l1.12,0.01l-2.44,-3.7L105.85,283.09z"},{"code":"CD","name":"Democratic Republic of Congo","path":"M561.71,453.61L561.54,456.87L562.66,457.24L561.76,458.23L560.68,458.97L559.61,460.43L559.02,461.72L558.86,463.96L558.21,465.02L558.19,467.12L557.38,467.9L557.28,469.56L556.89,469.77L556.63,471.3L557.34,472.56L557.52,475.93L558.02,478.5L557.74,479.96L558.3,481.58L559.93,483.15L561.44,486.7L560.34,486.41L556.57,486.89L555.82,487.22L555.02,489.02L555.65,490.27L555.15,493.62L554.8,496.47L555.56,496.98L557.52,498.08L558.29,497.57L558.53,500.65L556.38,500.62L555.23,499.05L554.2,497.83L552.05,497.43L551.42,495.94L549.7,496.84L547.46,496.44L546.52,495.15L544.74,494.89L543.43,494.96L543.27,494.08L542.3,494.01L541.02,493.84L539.29,494.26L538.07,494.19L537.37,494.45L537.52,491.08L536.59,490.03L536.38,488.3L536.79,486.6L536.23,485.51L536.18,483.75L532.77,483.77L533.02,482.76L531.59,482.77L531.44,483.26L529.7,483.37L528.99,485L528.57,485.71L527.02,485.31L526.1,485.71L524.24,485.93L523.17,484.46L522.53,483.55L521.72,481.87L521.03,479.78L512.76,479.75L511.77,480.08L510.96,480.03L509.8,480.41L509.41,479.54L510.12,479.24L510.21,478.02L510.67,477.3L511.69,476.72L512.43,477L513.39,475.93L514.91,475.96L515.09,476.75L516.14,477.25L517.79,475.49L519.42,474.13L520.13,473.24L520.04,470.94L521.26,468.23L522.54,466.8L524.39,465.46L524.71,464.57L524.78,463.55L525.24,462.58L525.09,461L525.44,458.53L525.99,456.79L526.83,455.3L526.99,453.62L527.24,451.67L528.34,450.25L529.84,449.35L532.15,450.3L533.93,451.33L535.98,451.61L538.07,452.15L538.91,450.47L539.3,450.25L540.57,450.53L543.7,449.14L544.8,449.73L545.71,449.65L546.13,448.97L547.17,448.73L549.28,449.02L551.08,449.08L552.01,448.79L553.7,451.1L554.96,451.43L555.71,450.96L557.01,451.15L558.57,450.56L559.24,451.75z"},{"code":"CF","name":"Central African Republic","path":"M518.09,442.66L520.41,442.44L520.93,441.72L521.39,441.78L522.09,442.41L525.62,441.34L526.81,440.24L528.28,439.25L528,438.26L528.79,438L531.5,438.18L534.14,436.87L536.16,433.78L537.59,432.64L539.36,432.15L539.68,433.37L541.3,435.14L541.3,436.29L540.85,437.47L541.03,438.34L542,439.15L544.14,440.39L545.67,441.52L545.7,442.44L547.58,443.9L548.75,445.11L549.46,446.79L551.56,447.9L552.01,448.79L551.08,449.08L549.28,449.02L547.17,448.73L546.13,448.97L545.71,449.65L544.8,449.73L543.7,449.14L540.57,450.53L539.3,450.25L538.91,450.47L538.07,452.15L535.98,451.61L533.93,451.33L532.15,450.3L529.84,449.35L528.34,450.25L527.24,451.67L526.99,453.62L525.19,453.46L523.29,452.99L521.62,454.47L520.15,457.07L519.85,456.26L519.73,454.99L518.45,454.09L517.41,452.65L517.17,451.65L515.85,450.19L516.07,449.36L515.79,448.18L516.01,446.01L516.68,445.5z"},{"code":"CG","name":"Republic of Congo","path":"M511.69,476.72L510.64,475.76L509.79,476.23L508.66,477.43L506.36,474.48L508.49,472.94L507.44,471.09L508.4,470.39L510.29,470.05L510.51,468.81L512.01,470.15L514.49,470.27L515.35,468.95L515.7,467.1L515.39,464.92L514.07,463.28L515.28,460.05L514.58,459.5L512.5,459.72L511.71,458.29L511.92,457.07L515.45,457.18L517.72,457.91L519.95,458.57L520.15,457.07L521.62,454.47L523.29,452.99L525.19,453.46L526.99,453.62L526.83,455.3L525.99,456.79L525.44,458.53L525.09,461L525.24,462.58L524.78,463.55L524.71,464.57L524.39,465.46L522.54,466.8L521.26,468.23L520.04,470.94L520.13,473.24L519.42,474.13L517.79,475.49L516.14,477.25L515.09,476.75L514.91,475.96L513.39,475.93L512.43,477z"},{"code":"CH","name":"Switzerland","path":"M502.15,312.34L502.26,313.08L501.83,314.09L503.1,314.83L504.53,314.94L504.31,316.61L503.08,317.3L501,316.79L500.39,318.42L499.06,318.55L498.57,317.91L497,319.27L495.65,319.46L494.44,318.6L493.48,316.83L492.14,317.47L492.18,315.63L494.23,313.32L494.14,312.27L495.42,312.66L496.19,311.95L498.57,311.98L499.15,311.08z"},{"code":"CI","name":"Côte d'Ivoire","path":"M467.24,449.46L465.97,449.49L464.01,448.94L462.22,448.97L458.89,449.46L456.95,450.27L454.17,451.29L453.63,451.22L453.84,448.92L454.11,448.57L454.03,447.46L452.84,446.29L451.95,446.1L451.13,445.33L451.74,444.09L451.46,442.73L451.59,441.91L452.04,441.91L452.2,440.68L451.98,440.14L452.25,439.75L453.29,439.41L452.6,437.15L451.95,435.99L452.18,435.02L452.74,434.81L453.1,434.55L453.88,434.97L456.04,435L456.56,434.17L457.04,434.23L457.85,433.91L458.29,435.12L458.94,434.76L460.1,434.34L461.36,434.96L461.85,435.89L463.11,436.49L464.09,435.78L465.41,435.67L467.33,436.4L468.07,440.41L466.89,442.77L466.16,445.94L467.37,448.35z"},{"code":"CL","name":"Chile",labelCoordinate: {x: -0.5,y: 0.5},"path":"M282.81,636.73l0,10.57l3,0l1.69,0.13l-0.93,1.98l-2.4,1.53l-1.38,-0.16l-1.66,-0.4l-2.04,-1.48l-2.94,-0.71l-3.53,-2.71l-2.86,-2.57l-3.86,-5.25l2.31,0.97l3.94,3.13l3.72,1.7l1.45,-2.17l0.91,-3.2l2.58,-1.91L282.81,636.73zM283.97,524.72l1.1,4.15l2.02,-0.41l0.34,0.76l-0.96,3.16l-3.05,1.51l0.09,5.14l-0.59,1l0.84,1.23l-1.98,1.95l-1.84,2.96l-1,2.9l0.27,3.11l-1.73,3.34l1.29,5.69l0.73,0.61l-0.01,3.09l-1.6,3.31l0.06,2.87l-2.12,2.26l0.01,3.22l0.85,3.46l-1.68,1.3l-0.75,3.22l-0.66,3.75l0.47,4.54l-1.13,0.77l0.65,4.4l1.27,1.46l-0.92,1.63l1.3,0.78l0.3,1.48l-1.22,0.75l0.3,2.33l-1.02,5.35l-1.49,3.52l0.33,2.11l-0.89,2.68l-2.15,1.88l0.25,4.6l0.99,1.6l1.87,-0.28l-0.05,3.33l1.16,2.63l6.78,0.61l2.6,0.71l-2.49,-0.03l-1.35,1.13l-2.53,1.67l-0.45,4.38l-1.19,0.11l-3.16,-1.54l-3.21,-3.25l0,0l-3.49,-2.63l-0.88,-2.87l0.79,-2.62l-1.41,-2.94l-0.36,-7.34l1.19,-4.03l2.96,-3.19l-4.26,-1.19l2.67,-3.57l0.95,-6.56l3.12,1.37l1.46,-7.97l-1.88,-1l-0.88,4.75l-1.77,-0.54l0.88,-5.42l0.96,-6.84l1.29,-2.48l-0.81,-3.5l-0.23,-3.98l1.18,-0.11l1.72,-5.6l1.94,-5.43l1.19,-4.97l-0.65,-4.91l0.84,-2.67l-0.34,-3.96l1.64,-3.87l0.51,-6.04l0.9,-6.37l0.88,-6.75l-0.21,-4.87l-0.58,-4.15l1.44,-0.75l0.75,-1.5l1.37,1.99l0.37,2.12l1.47,1.25l-0.88,2.87L283.97,524.72z"},{"code":"CM","name":"Cameroon","path":"M511.92,457.07L511.57,456.92L509.91,457.28L508.2,456.9L506.87,457.09L502.31,457.02L502.72,454.82L501.62,452.98L500.34,452.5L499.77,451.25L499.05,450.85L499.09,450.08L499.81,448.1L501.14,445.4L501.95,445.37L503.62,443.73L504.69,443.69L506.26,444.84L508.19,443.89L508.45,442.73L509.08,441.59L509.51,440.17L511.01,439.01L511.58,437.04L512.17,436.41L512.57,434.94L513.31,433.13L515.67,430.93L515.82,429.98L516.13,429.47L515.02,428.33L515.11,427.43L515.9,427.26L517.01,429.09L517.2,430.98L517.1,432.87L518.62,435.44L517.06,435.41L516.27,435.61L514.99,435.33L514.38,436.66L516.03,438.31L517.25,438.79L517.65,439.96L518.53,441.89L518.09,442.66L516.68,445.5L516.01,446.01L515.79,448.18L516.07,449.36L515.85,450.19L517.17,451.65L517.41,452.65L518.45,454.09L519.73,454.99L519.85,456.26L520.15,457.07L519.95,458.57L517.72,457.91L515.45,457.18z"},{"code":"CN","name":"China",labelCoordinate:{x:0.5,y:0.6},"path":"M784.63,410.41l-2.42,1.41l-2.3,-0.91l-0.08,-2.53l1.38,-1.34l3.06,-0.83l1.61,0.07l0.63,1.13l-1.23,1.3L784.63,410.41zM833.19,302.89l4.88,1.38l3.32,3.03l1.13,3.95l4.26,0l2.43,-1.65l4.63,-1.24l-1.47,3.76l-1.09,1.51l-0.96,4.46l-1.89,3.89l-3.4,-0.7l-2.41,1.4l0.74,3.36l-0.4,4.55l-1.43,0.1l0.02,1.93l-1.81,-2.24l-1.11,2.13l-4.33,1.62l0.44,1.97l-2.42,-0.14l-1.33,-1.17l-1.93,2.64l-3.09,1.98l-2.28,2.35l-3.92,1.06l-2.06,1.69l-3.02,0.98l1.49,-1.67l-0.59,-1.41l2.22,-2.45l-1.48,-1.93l-2.44,1.3l-3.17,2.54l-1.73,2.34l-2.75,0.17l-1.43,1.68l1.48,2.41l2.29,0.58l0.09,1.58l2.22,1.02l3.14,-2.51l2.49,1.37l1.81,0.09l0.46,1.84l-3.97,0.97l-1.31,1.87l-2.73,1.73l-1.44,2.39l3.02,1.86l1.1,3.31l1.71,3.05l1.9,2.53l-0.05,2.43l-1.76,0.89l0.67,1.73l1.65,1l-0.43,2.61l-0.71,2.52l-1.57,0.28l-2.05,3.41l-2.27,4.09l-2.6,3.68l-3.86,2.82l-3.9,2.55l-3.16,0.35l-1.71,1.34l-0.97,-0.98l-1.59,1.5l-3.92,1.5l-2.97,0.46l-0.96,3.15l-1.55,0.17l-0.74,-2.16l0.66,-1.16l-3.76,-0.96l-1.33,0.49l-2.82,-0.78l-1.33,-1.22l0.44,-1.74l-2.56,-0.55l-1.35,-1.14l-2.39,1.62l-2.73,0.35l-2.24,-0.02l-1.5,0.74l-1.45,0.44l0.42,3.43l-1.5,-0.08l-0.25,-0.7l-0.08,-1.24l-2.06,0.87l-1.21,-0.55l-2.08,-1.13l0.82,-2.51l-1.78,-0.59l-0.67,-2.8l-2.96,0.51l0.34,-3.63l2.66,-2.58l0.11,-2.57l-0.08,-2.4l-1.22,-0.75l-0.94,-1.86l-1.64,0.24l-3.02,-0.47l0.95,-1.33l-1.31,-1.99l-2,1.35L740.4,378l-3.23,2.03l-2.55,2.36l-2.26,0.39l-1.23,-0.85l-1.48,-0.08l-2,-0.73l-1.51,0.8l-1.85,2.34l-0.24,-2.48l-1.71,0.66l-3.27,-0.31l-3.17,-0.73l-2.28,-1.39l-2.18,-0.63l-0.94,-1.53l-1.58,-0.46l-2.83,-2.09l-2.25,-0.99l-1.16,0.77l-3.9,-2.26l-2.75,-2.07l-0.79,-3.63l2.01,0.44l0.09,-1.69l-1.12,-1.71l0.28,-2.74l-3.01,-3.99l-4.61,-1.39l-0.83,-2.66l-2.07,-1.63l-0.5,-1.01l-0.42,-2.01l0.1,-1.38l-1.7,-0.81l-0.92,0.36l-0.71,-3.32l0.8,-0.83l-0.39,-0.85l2.68,-1.73l1.94,-0.72l2.97,0.49l1.06,-2.35l3.6,-0.44l1,-1.48l4.42,-2.03l0.39,-0.85l-0.22,-2.17l1.92,-1l-2.52,-6.75l5.55,-1.58l1.44,-0.89l2.02,-7.26l5.56,1.35l1.56,-1.86l0.13,-4.19l2.33,-0.39l2.13,-2.83l1.1,-0.35l0.74,2.97l2.36,2.23l4,1.57l1.93,3.32l-1.08,4.73l1.01,1.73l3.33,0.68l3.78,0.55l3.39,2.45l1.73,0.43l1.28,3.57l1.65,2.27l3.09,-0.09l5.79,0.85l3.73,-0.53l2.77,0.57l4.15,2.29l3.39,0l1.24,1.16l3.26,-2.01l4.53,-1.31l4.2,-0.14l3.28,-1.34l2.01,-2.05l1.96,-1.3l-0.45,-1.28l-0.9,-1.5l1.47,-2.54l1.58,0.36l2.88,0.8l2.79,-2.1l4.28,-1.55l2.05,-2.66l1.97,-1.16l4.07,-0.54l2.21,0.46l0.31,-1.45l-2.54,-2.89l-2.25,-1.33l-2.16,1.54l-2.77,-0.65l-1.59,0.53l-0.72,-1.71l1.98,-4.23l1.37,-3.25l3.37,1.63l3.95,-2.74l-0.03,-1.93l2.53,-4.73l1.56,-1.45l-0.04,-2.52l-1.54,-1.1l2.32,-2.31l3.48,-0.84l3.72,-0.13l4.2,1.39l2.46,1.71l1.73,4.61l1.05,1.94l0.98,2.73L833.19,302.89z"},{"code":"CO","name":"Colombia","path":"M263.92,463.81L262.72,463.15L261.34,462.23L260.54,462.67L258.16,462.28L257.48,461.08L256.96,461.13L254.15,459.54L253.77,458.67L254.82,458.46L254.7,457.07L255.35,456.06L256.74,455.87L257.93,454.12L259,452.66L257.96,451.99L258.49,450.37L257.86,447.81L258.46,447.08L258.02,444.71L256.88,443.21L257.24,441.85L258.15,442.05L258.68,441.21L258.03,439.56L258.37,439.14L259.81,439.23L261.92,437.26L263.07,436.96L263.1,436.03L263.62,433.64L265.23,432.32L266.99,432.27L267.21,431.68L269.41,431.91L271.62,430.48L272.71,429.84L274.06,428.47L275.06,428.64L275.79,429.39L275.25,430.35L273.45,430.83L272.74,432.25L271.65,433.06L270.84,434.12L270.49,436.13L269.72,437.79L271.16,437.97L271.52,439.27L272.14,439.89L272.36,441.02L272.03,442.06L272.13,442.65L272.82,442.88L273.49,443.86L277.09,443.59L278.72,443.95L280.7,446.36L281.83,446.06L283.85,446.21L285.45,445.89L286.44,446.38L285.93,447.88L285.31,448.82L285.09,450.83L285.65,452.68L286.45,453.51L286.54,454.14L285.12,455.53L286.14,456.14L286.89,457.12L287.74,459.89L287.21,460.24L286.67,458.59L285.89,457.71L284.96,458.67L279.5,458.61L279.53,460.35L281.17,460.64L281.08,461.71L280.52,461.42L278.94,461.88L278.93,463.9L280.17,464.92L280.61,466.51L280.54,467.72L279.28,475.37L277.88,473.88L277.04,473.82L278.85,470.98L276.7,469.67L275.02,469.91L274.01,469.43L272.46,470.17L270.37,469.82L268.72,466.9L267.42,466.18L266.53,464.86L264.67,463.54z"},{"code":"CR","name":"Costa Rica","path":"M242.63,440.4L241.11,439.77L240.54,439.18L240.86,438.69L240.76,438.07L239.98,437.39L238.88,436.84L237.91,436.48L237.73,435.65L236.99,435.14L237.17,435.97L236.61,436.64L235.97,435.86L235.07,435.58L234.69,435.01L234.71,434.15L235.08,433.25L234.29,432.85L234.93,432.31L235.35,431.94L237.2,432.69L237.84,432.32L238.73,432.56L239.2,433.14L240.02,433.33L240.69,432.73L241.41,434.27L242.49,435.41L243.81,436.62L242.72,436.87L242.74,438L243.32,438.42L242.9,438.76L243.01,439.27L242.78,439.84z"},{"code":"CU","name":"Cuba","path":"M244.58,396.94L247.01,397.16L249.21,397.19L251.84,398.22L252.96,399.33L255.58,398.99L256.57,399.69L258.95,401.56L260.69,402.91L261.61,402.87L263.29,403.48L263.08,404.32L265.15,404.44L267.27,405.66L266.94,406.35L265.07,406.73L263.18,406.88L261.25,406.64L257.24,406.93L259.12,405.27L257.98,404.5L256.17,404.3L255.2,403.44L254.53,401.74L252.95,401.85L250.33,401.05L249.49,400.42L245.84,399.95L244.86,399.36L245.91,398.61L243.16,398.46L241.15,400.02L239.98,400.06L239.58,400.8L238.2,401.13L237,400.84L238.48,399.91L239.08,398.82L240.35,398.15L241.78,397.56L243.91,397.27z"},{"code":"CY","name":"Cyprus","path":"M570.31,358.29L572.2,356.83L569.65,357.85L567.63,357.8L567.23,358.63L567.03,358.65L565.7,358.77L566.35,360.14L567.72,360.58L570.6,359.2L570.51,358.93z"},{"code":"CZ","name":"Czech Republic","path":"M522.81,307.86L521.51,307.06L520.2,307.28L518.02,305.98L517.03,306.3L515.46,308.04L513.37,306.67L511.79,304.84L510.36,303.8L510.06,301.98L509.57,300.68L511.61,299.73L512.65,298.63L514.66,297.77L515.37,296.93L516.11,297.44L517.36,296.97L518.69,298.4L520.78,298.79L520.61,300L522.13,300.9L522.55,299.77L524.47,300.26L524.74,301.63L526.82,301.89L528.11,304.02L527.28,304.03L526.84,304.8L526.2,304.99L526.02,305.96L525.48,306.17L525.4,306.56L524.45,307L523.2,306.93z"},{"code":"DE","name":"Germany","path":"M503.07,278.92L503.12,280.8L505.96,281.92L505.93,283.62L508.78,282.72L510.35,281.41L513.52,283.3L514.84,284.81L515.5,287.2L514.72,288.45L515.73,290.1L516.43,292.55L516.21,294.11L517.36,296.97L516.11,297.44L515.37,296.93L514.66,297.77L512.65,298.63L511.61,299.73L509.57,300.68L510.06,301.98L510.36,303.8L511.79,304.84L513.37,306.67L512.39,308.62L511.38,309.16L511.78,311.88L511.51,312.58L510.64,311.73L509.3,311.61L507.29,312.35L504.82,312.17L504.42,313.26L503,312.12L502.15,312.34L499.15,311.08L498.57,311.98L496.19,311.95L496.54,308.97L497.96,306.07L493.92,305.29L492.6,304.16L492.76,302.27L492.2,301.29L492.52,298.32L492.04,293.63L493.73,293.63L494.44,291.92L495.14,287.69L494.61,286.11L495.16,285.11L497.5,284.85L498.02,285.89L499.93,283.56L499.29,281.77L499.16,279.02L501.28,279.66z"},{"code":"DJ","name":"Djibouti","path":"M596.05,427.72L596.71,428.6L596.62,429.79L595.02,430.47L596.23,431.24L595.19,432.76L594.57,432.26L593.9,432.46L592.33,432.41L592.28,431.55L592.07,430.76L593.01,429.43L594,428.17L595.2,428.42z"},{"code":"DK","name":"Denmark","path":"M510.83,275.84l-1.68,3.97l-2.93,-2.76l-0.39,-2.05l4.11,-1.66L510.83,275.84zM505.85,271.59l-0.69,1.9l-0.83,-0.55l-2.02,3.59l0.76,2.39l-1.79,0.74l-2.12,-0.64l-1.14,-2.72l-0.08,-5.12l0.47,-1.38l0.8,-1.54l2.47,-0.32l0.98,-1.43l2.26,-1.47l-0.1,2.68l-0.83,1.68l0.34,1.43L505.85,271.59z"},{"code":"DO","name":"Dominican Republic","path":"M274.18,407.35L274.53,406.84L276.72,406.86L278.38,407.62L279.12,407.54L279.63,408.59L281.16,408.53L281.07,409.41L282.32,409.52L283.7,410.6L282.66,411.8L281.32,411.16L280.04,411.28L279.12,411.14L278.61,411.68L277.53,411.86L277.11,411.14L276.18,411.57L275.06,413.57L274.34,413.11L274.19,412.27L274.25,411.47L273.53,410.59L274.21,410.09L274.43,408.96z"},{"code":"DZ","name":"Algeria","path":"M508.9,396.08L499.29,401.83L491.17,407.68L487.22,409L484.11,409.29L484.08,407.41L482.78,406.93L481.03,406.08L480.37,404.69L470.91,398.14L461.45,391.49L450.9,383.96L450.96,383.35L450.96,383.14L450.93,379.39L455.46,377.03L458.26,376.54L460.55,375.68L461.63,374.06L464.91,372.77L465.03,370.36L466.65,370.07L467.92,368.86L471.59,368.3L472.1,367.02L471.36,366.31L470.39,362.78L470.23,360.73L469.17,358.55L471.86,356.68L474.9,356.08L476.67,354.65L479.37,353.6L484.12,352.98L488.76,352.69L490.17,353.21L492.81,351.84L495.81,351.81L496.95,352.62L498.86,352.41L498.29,354.2L498.74,357.48L498.08,360.3L496.35,362.18L496.6,364.71L498.89,366.69L498.92,367.5L500.64,368.83L501.84,374.69L502.75,377.53L502.9,379.01L502.41,381.6L502.61,383.04L502.25,384.76L502.5,386.73L501.38,388.02L503.04,390.28L503.15,391.6L504.14,393.31L505.45,392.75L507.67,394.17z"},{"code":"EC","name":"Ecuador","path":"M250.1,472.87L251.59,470.79L250.98,469.57L249.91,470.87L248.23,469.64L248.8,468.86L248.33,466.33L249.31,465.91L249.83,464.18L250.89,462.38L250.69,461.25L252.23,460.65L254.15,459.54L256.96,461.13L257.48,461.08L258.16,462.28L260.54,462.67L261.34,462.23L262.72,463.15L263.92,463.81L264.31,465.92L263.44,467.73L260.38,470.65L257.01,471.75L255.29,474.18L254.76,476.06L253.17,477.21L252,475.8L250.86,475.5L249.7,475.72L249.63,474.7L250.43,474.04z"},{"code":"EE","name":"Estonia","path":"M543.42,264.71L543.75,261.59L542.72,262.26L540.94,260.36L540.69,257.25L544.24,255.72L547.77,254.91L550.81,255.83L553.71,255.66L554.13,256.62L552.14,259.76L552.97,264.72L551.77,266.38L549.45,266.37L547.04,264.43L545.81,263.78z"},{"code":"EG","name":"Egypt","path":"M573.17,377.28L572.38,378.57L571.78,380.97L571.02,382.61L570.36,383.17L569.43,382.15L568.16,380.73L566.16,376.16L565.88,376.45L567.04,379.82L568.76,383L570.88,387.88L571.91,389.56L572.81,391.3L575.33,394.7L574.77,395.23L574.86,397.2L578.13,399.91L578.62,400.53L567.5,400.53L556.62,400.53L545.35,400.53L545.35,389.3L545.35,378.12L544.51,375.54L545.23,373.54L544.8,372.15L545.81,370.58L549.54,370.53L552.24,371.39L555.02,372.36L556.32,372.86L558.48,371.83L559.63,370.9L562.11,370.63L564.1,371.04L564.87,372.66L565.52,371.59L567.76,372.36L569.95,372.55L571.33,371.73z"},{"code":"EH","name":"Western Sahara","path":"M438.57,383.06L442.19,383.07L450.94,383.1L450.94,383.1L450.94,383.1L442.19,383.07L438.57,383.06L438.46,383.15L438.41,383.19L436.63,386.39L434.77,387.53L433.75,389.44L433.69,391.09L432.94,392.88L432,393.37L430.44,395.31L429.48,397.46L429.66,398.48L428.74,400.05L427.66,400.87L427.53,402.26L427.41,403.53L428.02,402.53L439,402.55L438.47,398.2L439.16,396.65L441.78,396.38L441.69,388.52L450.9,388.69L450.9,383.96L450.96,383.35L450.96,383.14z"},{"code":"ER","name":"Eritrea","path":"M594,428.17L593.04,427.24L591.89,425.57L590.65,424.65L589.92,423.65L587.48,422.5L585.56,422.47L584.88,421.86L583.24,422.54L581.54,421.23L580.66,423.38L577.4,422.78L577.1,421.63L578.31,417.38L578.58,415.45L579.46,414.55L581.53,414.07L582.95,412.4L584.58,415.78L585.35,418.45L586.89,419.86L590.71,422.58L592.27,424.22L593.79,425.88L594.67,426.86L596.05,427.72L595.2,428.42z"},{"code":"ES","name":"Spain","path":"M449.92,334.56L450.06,331.88L448.92,330.22L452.88,327.45L456.31,328.15L460.08,328.12L463.06,328.78L465.39,328.58L469.92,328.7L471.04,330.19L476.2,331.92L477.22,331.1L480.38,332.82L483.63,332.33L483.78,334.52L481.12,337.01L477.53,337.79L477.28,339.03L475.55,341.06L474.47,344.02L475.56,346.07L473.94,347.67L473.34,349.97L471.22,350.67L469.23,353.36L465.68,353.41L463,353.35L461.25,354.57L460.18,355.88L458.8,355.59L457.77,354.42L456.97,352.42L454.35,351.88L454.12,350.72L455.16,349.4L455.54,348.44L454.58,347.38L455.35,345.03L454.23,342.86L455.44,342.56L455.55,340.84L456.01,340.31L456.04,337.43L457.34,336.43L456.56,334.55L454.92,334.42L454.44,334.89L452.79,334.9L452.08,333.06L450.94,333.61z"},{"code":"ET","name":"Ethiopia","path":"M581.54,421.23L583.24,422.54L584.88,421.86L585.56,422.47L587.48,422.5L589.92,423.65L590.65,424.65L591.89,425.57L593.04,427.24L594,428.17L593.01,429.43L592.07,430.76L592.28,431.55L592.33,432.41L593.9,432.46L594.57,432.26L595.19,432.76L594.58,433.77L595.62,435.33L596.65,436.69L597.72,437.7L606.89,441.04L609.25,441.02L601.32,449.44L597.67,449.56L595.17,451.53L593.38,451.58L592.61,452.46L590.69,452.46L589.56,451.52L587,452.69L586.17,453.85L584.3,453.63L583.68,453.31L583.02,453.38L582.14,453.36L578.59,450.98L576.64,450.98L575.68,450.07L575.68,448.5L574.22,448.03L572.57,444.98L571.29,444.33L570.79,443.21L569.37,441.84L567.65,441.64L568.61,440.03L570.09,439.96L570.51,439.1L570.48,436.57L571.31,433.61L572.63,432.81L572.92,431.65L574.12,429.48L575.81,428.06L576.95,425.25L577.4,422.78L580.66,423.38z"},{"code":"FK","name":"Falkland Islands","path":"M303.66,633.13L307.02,630.44L309.41,631.56L311.09,629.77L313.33,631.78L312.49,633.36L308.7,634.72L307.44,633.13L305.06,635.18z"},{"code":"FI","name":"Finland",labelCoordinate: {x: 0.5,y: 0.68},"path":"M555.42,193.1L555.01,198.5L559.31,203.49L556.72,208.97L559.98,216.93L558.09,222.69L560.62,227.55L559.47,231.69L563.62,235.95L562.56,239.05L559.96,242.5L553.96,249.91L548.87,250.36L543.94,252.43L539.38,253.61L537.75,250.54L535.04,248.67L535.66,242.95L534.3,237.54L535.64,233.96L538.18,230.02L544.59,223L546.47,221.61L546.17,218.77L542.27,215.55L541.33,212.85L541.25,201.73L536.88,196.58L533.14,192.77L534.82,190.69L537.94,194.84L541.6,194.45L544.61,196.32L547.28,192.88L548.66,187.03L553.01,184.25L556.61,187.51z"},{"code":"FJ","name":"Fiji","path":"M980.53,508.61l-0.35,1.4l-0.23,0.16l-1.78,0.72l-1.79,0.61l-0.36,-1.09l1.4,-0.6l0.89,-0.16l1.64,-0.91L980.53,508.61zM974.69,512.92l-1.27,-0.36l-1.08,1l0.27,1.29l1.55,0.36l1.74,-0.4l0.46,-1.53l-0.96,-0.84L974.69,512.92z"},{"code":"FR","name":"France","path":"M502.06,333.54l-0.93,2.89l-1.27,-0.76l-0.65,-2.53l0.57,-1.41l1.81,-1.45L502.06,333.54zM485.31,300.19l1.96,2.06l1.44,-0.34l2.45,1.97l0.63,0.37l0.81,-0.09l1.32,1.12l4.04,0.79l-1.42,2.9l-0.36,2.98l-0.77,0.71l-1.28,-0.38l0.09,1.05l-2.05,2.3l-0.04,1.84l1.34,-0.63l0.96,1.77l-0.12,1.13l0.83,1.5l-0.97,1.21l0.72,3.04l1.52,0.49l-0.32,1.68l-2.54,2.17l-5.53,-1.04l-4.08,1.24l-0.32,2.29l-3.25,0.49l-3.15,-1.72l-1.02,0.82l-5.16,-1.73l-1.12,-1.49l1.45,-2.32l0.53,-7.88l-2.89,-4.26l-2.07,-2.09l-4.29,-1.6l-0.28,-3.07l3.64,-0.92l4.71,1.09l-0.89,-4.84l2.65,1.85l6.53,-3.37l0.84,-3.61l2.45,-0.9l0.41,1.56l1.3,0.07L485.31,300.19z"},{"code":"GA","name":"Gabon","path":"M506.36,474.48L503.48,471.66L501.62,469.36L499.92,466.48L500.01,465.56L500.62,464.66L501.3,462.64L501.87,460.57L502.82,460.41L506.89,460.44L506.87,457.09L508.2,456.9L509.91,457.28L511.57,456.92L511.92,457.07L511.71,458.29L512.5,459.72L514.58,459.5L515.28,460.05L514.07,463.28L515.39,464.92L515.7,467.1L515.35,468.95L514.49,470.27L512.01,470.15L510.51,468.81L510.29,470.05L508.4,470.39L507.44,471.09L508.49,472.94z"},{"code":"GB","name":"United Kingdom",labelCoordinate:{x:-0.5,y:0.2},"path":"M459.38,281l-1.5,3.29l-2.12,-0.98l-1.73,0.07l0.58,-2.57l-0.58,-2.6l2.35,-0.2L459.38,281zM466.83,260.24l-3,5.73l2.86,-0.72l3.07,0.03l-0.73,4.22l-2.52,4.53l2.9,0.32l0.22,0.52l2.5,5.79l1.92,0.77l1.73,5.41l0.8,1.84l3.4,0.88l-0.34,2.93l-1.43,1.33l1.12,2.33l-2.52,2.33l-3.75,-0.04l-4.77,1.21l-1.31,-0.87l-1.85,2.06l-2.59,-0.5l-1.97,1.67l-1.49,-0.87l4.11,-4.64l2.51,-0.97l-0.02,0l-4.38,-0.75l-0.79,-1.8l2.93,-1.41l-1.54,-2.48l0.53,-3.06l4.17,0.42l0,0l0.41,-2.74l-1.88,-2.95l-0.04,-0.07l-3.4,-0.85l-0.67,-1.32l1.02,-2.2l-0.92,-1.37l-1.51,2.34l-0.16,-4.8l-1.42,-2.59l1.02,-5.36l2.18,-4.31l2.24,0.42L466.83,260.24z"},{"code":"GE","name":"Georgia","path":"M591.76,335.85L592.18,334.25L591.48,331.68L589.86,330.27L588.31,329.83L587.28,328.66L587.62,328.2L589.99,328.86L594.12,329.48L597.94,331.31L598.43,332.02L600.13,331.42L602.75,332.22L603.6,333.77L605.37,334.64L604.64,335.15L606.02,337.17L605.64,337.6L604.13,337.38L602.04,336.32L601.35,336.92L597.45,337.5L594.75,335.68z"},{"code":"GF","name":"French Guiana","path":"M327.89,456.41l-1.07,1.06l-1.34,0.2l-0.38,-0.78l-0.63,-0.12l-0.87,0.76l-1.22,-0.57l0.71,-1.19l0.24,-1.27l0.48,-1.2l-1.09,-1.65l-0.22,-1.91l1.46,-2.41l0.95,0.31l2.06,0.66l2.97,2.36l0.46,1.14l-1.66,2.55L327.89,456.41z"},{"code":"GH","name":"Ghana","path":"M478.23,446.84L473.83,448.48L472.27,449.44L469.74,450.25L467.24,449.46L467.37,448.35L466.16,445.94L466.89,442.77L468.07,440.41L467.33,436.4L466.94,434.27L467.01,432.66L471.88,432.53L473.12,432.74L474.02,432.28L475.32,432.5L475.11,433.39L476.28,434.85L476.28,436.9L476.55,439.12L477.25,440.15L476.63,442.68L476.85,444.08L477.6,445.86z"},{"code":"GL","name":"Greenland","path":"M344.13,23.91L353.55,10.3L363.39,11.37L366.96,2.42L376.87,0L399.27,3.15L416.81,21.74L411.63,30.04L400.9,30.97L385.81,33L387.22,36.64L397.15,34.4L405.59,41.31L411.04,35.19L413.37,42.34L410.29,53.31L417.43,46.38L431.04,38.83L439.45,42.64L441.02,50.76L429.59,63.42L428.01,67.32L419.05,70.18L425.54,70.97L422.26,82.48L420,92.07L420.09,107.33L423.46,115.67L419.08,116.18L414.47,120.06L419.64,126.36L420.3,135.98L417.3,137L420.93,146.15L414.71,146.9L417.96,151.04L417.04,154.55L413.09,156.06L409.18,156.09L412.69,162.57L412.73,166.7L407.18,162.87L405.74,165.36L409.52,167.65L413.2,173.13L414.26,180.08L409.26,181.7L407.1,178.44L403.63,173.46L404.59,179.33L401.34,183.74L408.72,184.09L412.59,184.54L405.07,191.57L397.45,197.7L389.25,200.31L386.16,200.35L383.26,203.22L379.36,210.85L373.33,215.74L371.39,216.03L367.65,217.7L363.63,219.29L361.22,223.41L361.18,227.97L359.77,232.13L355.19,237.08L356.32,241.79L355.06,246.64L353.63,252.2L349.68,252.54L345.54,247.91L339.93,247.88L337.21,244.7L335.34,238.9L330.48,231.22L329.06,227.07L328.68,221.18L324.79,214.91L325.8,209.74L323.93,207.21L326.7,198.56L330.92,195.71L332.03,192.45L332.62,186.19L329.41,189.05L327.89,190.24L325.37,191.38L321.93,188.77L321.74,183.22L322.84,178.74L325.44,178.62L331.16,180.87L326.34,175.44L323.83,172.43L321.04,173.67L318.7,171.48L321.83,162.98L320.13,159.45L317.9,152.71L314.53,141.8L310.96,137.63L310.99,133L303.46,126.31L297.51,125.46L290.02,125.93L283.18,126.79L279.92,123.04L275.05,115.38L282.41,111.41L288.06,110.73L276.06,107.37L269.74,101.93L270.13,96.59L280.74,89.72L291.01,82.56L292.09,76.92L284.53,71.16L286.97,64.52L296.68,52.19L300.76,50.21L299.59,41.64L306.23,36.4L314.85,33.19L323.47,33.01L326.53,39.31L333.97,27.99L340.66,35.77L344.59,37.36L350.42,43.77L343.75,33z"},{"code":"GM","name":"Gambia","path":"M428.03,426.43L428.39,425.16L431.44,425.07L432.08,424.4L432.97,424.35L434.07,425.06L434.94,425.07L435.87,424.59L436.43,425.41L435.22,426.06L434,426.01L432.8,425.4L431.76,426.06L431.26,426.09L430.58,426.49z"},{"code":"GN","name":"Guinea","path":"M451.59,441.91L450.8,441.84L450.23,442.97L449.43,442.96L448.89,442.36L449.07,441.23L447.9,439.51L447.17,439.82L446.57,439.89L445.8,440.05L445.83,439.02L445.38,438.28L445.47,437.46L444.86,436.27L444.08,435.26L441.84,435.26L441.19,435.79L440.41,435.85L439.93,436.46L439.61,437.25L438.11,438.49L436.88,436.82L435.79,435.71L435.07,435.35L434.37,434.78L434.06,433.53L433.65,432.91L432.83,432.44L434.08,431.06L434.93,431.11L435.66,430.63L436.28,430.63L436.72,430.25L436.48,429.31L436.79,429.01L436.84,428.04L438.19,428.07L440.21,428.77L440.83,428.7L441.04,428.39L442.56,428.61L442.97,428.45L443.13,429.5L443.58,429.49L444.31,429.11L444.77,429.21L445.55,429.93L446.75,430.16L447.52,429.54L448.43,429.16L449.1,428.76L449.66,428.84L450.28,429.46L450.62,430.25L451.77,431.44L451.19,432.17L451.08,433.09L451.68,432.81L452.03,433.15L451.88,433.99L452.74,434.81L452.18,435.02L451.95,435.99L452.6,437.15L453.29,439.41L452.25,439.75L451.98,440.14L452.2,440.68L452.04,441.91z"},{"code":"GQ","name":"Equatorial Guinea","path":"M501.87,460.57L501.34,460.15L502.31,457.02L506.87,457.09L506.89,460.44L502.82,460.41z"},{"code":"GR","name":"Greece","path":"M541.7,356.71l1.53,1.16l2.18,-0.19l2.09,0.24l-0.07,0.6l1.53,-0.41l-0.35,1.01l-4.04,0.29l0.03,-0.56l-3.42,-0.67L541.7,356.71zM549.85,335.75l-0.87,2.33l-0.67,0.41l-1.71,-0.1l-1.46,-0.35l-3.4,0.96l1.94,2.06l-1.42,0.59l-1.56,0l-1.48,-1.88l-0.53,0.8l0.63,2.18l1.4,1.7l-1.06,0.79l1.56,1.65l1.39,1.03l0.04,2l-1.36,-1.15l-1.24,0.21l0.83,1.8l-0.92,0.19l-1,-0.69l1.2,3.95l-0.58,0l-0.45,-1.25l-0.57,-0.02l-0.26,1.32l-0.45,-0.3l0.1,-0.74l-0.56,-1.04h-0.64l0.12,0.84l-0.25,0.27l-0.62,-0.54l-0.38,-1.01l0.52,-0.57l-0.36,-0.74l-0.41,-0.38l-0.42,-0.09l-0.49,-0.94l0.58,-0.52l0.36,-0.48l0.56,0.1l0.25,-0.41l0.59,-0.16l0.68,0.46l0.55,0.17l0.39,-0.62l-0.94,-0.08l-0.56,-0.19l-1.25,0.28l-1.22,0.05l-1.09,-1.64l-0.18,-0.25l0.17,-0.64l-1.42,-1.15l-0.19,-1.03l1.3,-1.76l0.17,-1.19l0.91,-0.53l0.06,-0.97l1.83,-0.33l1.07,-0.81l1.52,0.07l0.46,-0.65l0.53,-0.12l2.07,0.11l2.25,-1.02l1.98,1.3l2.55,-0.35l0.03,-1.86L549.85,335.75z"},{"code":"GT","name":"Guatemala","path":"M222.64,424.75L221.2,424.25L219.45,424.2L218.17,423.63L216.66,422.45L216.73,421.61L217.05,420.93L216.66,420.39L218.01,418.03L221.6,418.02L221.68,417.04L221.22,416.86L220.91,416.23L219.87,415.56L218.83,414.58L220.1,414.58L220.1,412.93L222.72,412.93L225.31,412.96L225.29,415.27L225.07,418.55L225.9,418.55L226.82,419.08L227.06,418.64L227.88,419.01L226.61,420.12L225.28,420.93L225.08,421.48L225.3,422.04L224.72,422.78L224.06,422.95L224.21,423.29L223.69,423.61L222.73,424.33z"},{"code":"GW","name":"Guinea-Bissau","path":"M432.83,432.44L431.33,431.25L430.15,431.07L429.51,430.26L429.52,429.83L428.67,429.23L428.49,428.62L429.98,428.15L430.91,428.24L431.66,427.92L436.84,428.04L436.79,429.01L436.48,429.31L436.72,430.25L436.28,430.63L435.66,430.63L434.93,431.11L434.08,431.06z"},{"code":"GY","name":"Guyana","path":"M307.7,440L309.54,441.03L311.28,442.86L311.35,444.31L312.41,444.38L313.91,445.74L315.02,446.72L314.57,449.24L312.87,449.97L313.02,450.62L312.5,452.07L313.75,454.09L314.64,454.1L315.01,455.67L316.72,458.09L316.04,458.19L314.49,457.96L313.58,458.7L312.31,459.19L311.43,459.31L311.12,459.85L309.74,459.71L308.01,458.41L307.81,457.12L307.09,455.71L307.54,453.33L308.32,452.35L307.67,451.05L306.71,450.63L307.08,449.4L306.42,448.76L304.96,448.88L303.07,446.76L303.83,445.99L303.77,444.69L305.5,444.24L306.19,443.72L305.23,442.68L305.48,441.65z"},{"code":"HN","name":"Honduras","path":"M230.43,426.9L229.95,426.01L229.09,425.76L229.29,424.61L228.91,424.3L228.33,424.1L227.1,424.44L227,424.05L226.15,423.59L225.55,423.02L224.72,422.78L225.3,422.04L225.08,421.48L225.28,420.93L226.61,420.12L227.88,419.01L228.17,419.13L228.79,418.62L229.59,418.58L229.85,418.81L230.29,418.67L231.59,418.93L232.89,418.85L233.79,418.53L234.12,418.21L235.01,418.36L235.68,418.56L236.41,418.49L236.97,418.24L238.25,418.64L238.7,418.7L239.55,419.24L240.36,419.89L241.38,420.33L242.12,421.13L241.16,421.07L240.77,421.46L239.8,421.84L239.09,421.84L238.47,422.21L237.91,422.08L237.43,421.64L237.14,421.72L236.78,422.41L236.51,422.38L236.46,422.98L235.48,423.77L234.97,424.11L234.68,424.47L233.85,423.89L233.25,424.65L232.66,424.63L232,424.7L232.06,426.11L231.65,426.13L231.3,426.79z"},{"code":"HR","name":"Croatia","path":"M528.05,318.93L528.73,320.48L529.62,321.62L528.54,323.11L527.27,322.23L525.33,322.29L522.92,321.63L521.61,321.72L521.01,322.54L520,321.63L519.41,323.27L520.79,325.1L521.39,326.31L522.68,327.76L523.75,328.61L524.81,330.22L527.29,331.66L526.98,332.3L524.35,330.9L522.72,329.52L520.16,328.38L517.8,325.53L518.37,325.23L517.09,323.59L517.03,322.25L515.23,321.63L514.37,323.34L513.54,322.01L513.61,320.63L513.71,320.57L515.66,320.71L516.18,320.03L517.13,320.68L518.23,320.76L518.22,319.64L519.19,319.23L519.47,317.61L521.7,316.53L522.59,317.03L524.69,318.76L527,319.53z"},{"code":"HT","name":"Haiti","path":"M270.04,406.75L271.75,406.88L274.18,407.35L274.43,408.96L274.21,410.09L273.53,410.59L274.25,411.47L274.19,412.27L272.33,411.77L271.01,411.97L269.3,411.76L267.99,412.31L266.48,411.39L266.73,410.44L269.31,410.85L271.43,411.09L272.44,410.43L271.16,409.16L271.18,408.03L269.41,407.57z"},{"code":"HU","name":"Hungary","path":"M520.68,315.11L521.61,312.46L521.07,311.57L522.65,311.56L522.86,309.85L524.29,310.92L525.32,311.38L527.68,310.87L527.9,310.03L529.02,309.9L530.38,309.25L530.68,309.52L532,309L532.66,308L533.58,307.75L536.58,309.03L537.18,308.6L538.73,309.74L538.93,310.86L537.22,311.73L535.89,314.53L534.2,317.29L531.95,318.05L530.2,317.88L528.05,318.93L527,319.53L524.69,318.76L522.59,317.03L521.7,316.53L521.15,315.16z"},{"code":"ID","name":"Indonesia","path":"M813.72,492.06l-1.18,0.05l-3.72,-1.98l2.61,-0.56l1.47,0.86l0.98,0.86L813.72,492.06zM824.15,491.78l-2.4,0.62l-0.34,-0.34l0.25,-0.96l1.21,-1.72l2.77,-1.12l0.28,0.56l0.05,0.86L824.15,491.78zM805.83,486.01l1.01,0.75l1.73,-0.23l0.7,1.2l-3.24,0.57l-1.94,0.38l-1.51,-0.02l0.96,-1.62l1.54,-0.02L805.83,486.01zM819.86,486l-0.41,1.56l-4.21,0.8l-3.73,-0.35l-0.01,-1.03l2.23,-0.59l1.76,0.84l1.87,-0.21L819.86,486zM779.82,482.31l5.37,0.28l0.62,-1.16l5.2,1.35l1.02,1.82l4.21,0.51l3.44,1.67l-3.2,1.07l-3.08,-1.13l-2.54,0.08l-2.91,-0.21l-2.62,-0.51l-3.25,-1.07l-2.06,-0.28l-1.17,0.35l-5.11,-1.16l-0.49,-1.21l-2.57,-0.21l1.92,-2.68l3.4,0.17l2.26,1.09l1.16,0.21L779.82,482.31zM853,480.73l-1.44,1.91l-0.27,-2.11l0.5,-1.01l0.59,-0.95l0.64,0.82L853,480.73zM832.04,473.02l-1.05,0.93l-1.94,-0.51l-0.55,-1.2l2.84,-0.13L832.04,473.02zM841.08,472.01l1.02,2.13l-2.37,-1.15l-2.34,-0.23l-1.58,0.18l-1.94,-0.1l0.67,-1.53l3.46,-0.12L841.08,472.01zM851.37,466.59l0.78,4.51l2.9,1.67l2.34,-2.96l3.22,-1.68l2.49,0l2.4,0.97l2.08,1l3.01,0.53l0.05,9.1l0.05,9.16l-2.5,-2.31l-2.85,-0.57l-0.69,0.8l-3.55,0.09l1.19,-2.29l1.77,-0.78l-0.73,-3.05l-1.35,-2.35l-5.44,-2.37l-2.31,-0.23l-4.21,-2.58l-0.83,1.36l-1.08,0.25l-0.64,-1.02l-0.01,-1.21l-2.14,-1.37l3.02,-1l2,0.05l-0.24,-0.74l-4.1,-0.01l-1.11,-1.66l-2.5,-0.51l-1.19,-1.38l3.78,-0.67l1.44,-0.91l4.5,1.14L851.37,466.59zM826.41,459.43l-2.25,2.76l-2.11,0.54l-2.7,-0.54l-4.67,0.14l-2.45,0.4l-0.4,2.11l2.51,2.48l1.51,-1.26l5.23,-0.95l-0.23,1.28l-1.22,-0.4l-1.22,1.63l-2.47,1.08l2.65,3.57l-0.51,0.96l2.52,3.22l-0.02,1.84l-1.5,0.82l-1.1,-0.98l1.36,-2.29l-2.75,1.08l-0.7,-0.77l0.36,-1.08l-2.02,-1.64l0.21,-2.72l-1.87,0.85l0.24,3.25l0.11,4l-1.78,0.41l-1.2,-0.82l0.8,-2.57l-0.43,-2.69l-1.18,-0.02l-0.87,-1.91l1.16,-1.83l0.4,-2.21l1.41,-4.2l0.59,-1.15l2.38,-2.07l2.19,0.82l3.54,0.39l3.22,-0.12l2.77,-2.02L826.41,459.43zM836.08,460.23l-0.15,2.43l-1.45,-0.27l-0.43,1.69l1.16,1.47l-0.79,0.33l-1.13,-1.76l-0.83,-3.56l0.56,-2.23l0.93,-1.01l0.2,1.52l1.66,0.24L836.08,460.23zM805.76,458.29l3.14,2.58l-3.32,0.33l-0.94,1.9l0.12,2.52l-2.7,1.91L802,470.3l-1.08,4.27l-0.41,-0.99l-3.19,1.26l-1.11,-1.71l-2,-0.16l-1.4,-0.89l-3.33,1l-1.02,-1.35l-1.84,0.15l-2.31,-0.32l-0.43,-3.74l-1.4,-0.77l-1.35,-2.38l-0.39,-2.44l0.33,-2.58l1.67,-1.85l0.47,1.86l1.92,1.57l1.81,-0.57l1.79,0.2l1.63,-1.41l1.34,-0.24l2.65,0.78l2.29,-0.59l1.44,-3.88l1.08,-0.97l0.97,-3.17l3.22,0l2.43,0.47l-1.59,2.52l2.06,2.64L805.76,458.29zM771.95,479.71l-3.1,0.06l-2.36,-2.34l-3.6,-2.28l-1.2,-1.69l-2.12,-2.27l-1.39,-2.09l-2.13,-3.9l-2.46,-2.32l-0.82,-2.39l-1.03,-2.17l-2.53,-1.75l-1.47,-2.39l-2.11,-1.56l-2.92,-3.08l-0.25,-1.42l1.81,0.11l4.34,0.54l2.48,2.73l2.17,1.89l1.55,1.16l2.66,3l2.85,0.04l2.36,1.91l1.62,2.33l2.13,1.27l-1.12,2.27l1.61,0.97l1.01,0.07l0.48,1.94l0.98,1.56l2.06,0.25l1.36,1.76l-0.7,3.47L771.95,479.71z"},{"code":"IE","name":"Ireland","path":"M457.88,284.29L458.34,287.65L456.22,291.77L451.25,294.45L447.28,293.77L449.55,288.99L448.09,284.22L451.9,280.47L454.02,278.2L454.6,280.8L454.02,283.37L455.76,283.31z"},{"code":"IL","name":"Israel","path":"M575.41,366.82L574.92,367.87L573.9,367.41L573.32,369.61L574.02,369.97L573.31,370.43L573.18,371.29L574.5,370.84L574.57,372.11L573.17,377.28L571.33,371.73L572.14,370.65L571.95,370.46L572.69,368.93L573.26,366.43L573.66,365.59L573.74,365.56L574.68,365.56L574.94,364.98L575.69,364.93L575.73,366.3L575.35,366.8z"},{"code":"IN","name":"India","path":"M693.5,357.44L696.51,361.43L696.23,364.17L697.34,365.88L697.25,367.57L695.24,367.13L696.03,370.76L698.78,372.82L702.68,375.09L700.9,376.55L699.81,379.54L702.53,380.74L705.17,382.29L708.83,384.06L712.67,384.47L714.29,386.06L716.45,386.35L719.83,387.08L722.16,387.03L722.48,385.79L722.11,383.8L722.33,382.45L724.04,381.78L724.28,384.26L724.33,384.89L726.88,386.08L728.65,385.59L731.01,385.8L733.3,385.71L733.5,383.78L732.36,382.78L734.62,382.38L737.17,380.03L740.4,378L742.75,378.78L744.75,377.44L746.07,379.42L745.12,380.76L748.14,381.23L748.36,382.43L747.37,383.01L747.6,384.94L745.6,384.37L741.97,386.53L742.05,388.31L740.51,390.91L740.36,392.41L739.11,394.93L736.92,394.23L736.81,397.38L736.18,398.41L736.48,399.69L735.09,400.41L733.62,395.61L732.84,395.62L732.38,397.56L730.85,395.98L731.71,394.25L732.97,394.07L734.26,391.48L732.65,390.95L730.04,391L727.38,390.58L727.13,388.43L725.79,388.27L723.57,386.93L722.58,389.04L724.6,390.67L722.85,391.82L722.23,392.94L723.95,393.76L723.48,395.6L724.45,397.88L724.89,400.36L724.48,401.46L722.58,401.42L719.12,402.04L719.28,404.29L717.78,406.05L713.75,408.05L710.61,411.51L708.5,413.36L705.71,415.27L705.71,416.61L704.31,417.33L701.78,418.36L700.47,418.52L699.63,420.72L700.21,424.47L700.36,426.84L699.18,429.55L699.16,434.38L697.71,434.52L696.44,436.67L697.29,437.6L694.73,438.4L693.79,440.32L692.66,441.13L690.01,438.5L688.71,434.54L687.63,431.68L686.65,430.34L685.16,427.6L684.47,424.02L683.98,422.22L681.43,418.25L680.27,412.61L679.43,408.84L679.44,405.26L678.9,402.46L674.82,404.25L672.84,403.89L669.18,400.26L670.53,399.17L669.7,397.99L666.41,395.41L668.28,393.37L674.45,393.38L673.89,390.74L672.32,389.18L672,386.79L670.16,385.39L673.25,382.09L676.51,382.33L679.44,379.01L681.2,375.75L683.92,372.51L683.88,370.18L686.27,368.27L684,366.64L683.03,364.39L682.04,361.44L683.41,359.98L687.67,360.81L690.79,360.3z"},{"code":"IQ","name":"Iraq","path":"M602.61,355.77L604.44,356.81L604.66,358.81L603.24,359.98L602.59,362.62L604.54,365.8L607.97,367.62L609.42,370.12L608.96,372.49L609.85,372.49L609.88,374.22L611.43,375.91L609.77,375.76L607.88,375.49L605.82,378.57L600.61,378.31L592.71,371.82L588.53,369.53L585.15,368.64L584.02,364.6L590.23,361.1L591.29,356.98L591.02,354.46L592.56,353.6L594,351.42L595.2,350.87L598.46,351.33L599.45,352.22L600.79,351.63z"},{"code":"IR","name":"Iran","path":"M626.44,351.53L628.91,350.85L630.9,348.83L632.77,348.93L634,348.27L636,348.6L639.1,350.39L641.34,350.78L644.54,353.87L646.63,353.99L646.88,356.9L645.74,361.15L644.97,363.6L646.19,364.09L644.99,365.92L645.91,368.56L646.13,370.65L648.25,371.2L648.48,373.3L645.94,376.23L647.32,377.91L648.45,379.84L651.13,381.24L651.21,384.01L652.55,384.52L652.78,385.96L648.74,387.57L647.68,391.17L642.41,390.24L639.35,389.53L636.19,389.12L634.99,385.31L633.65,384.75L631.49,385.31L628.67,386.82L625.24,385.79L622.41,383.38L619.71,382.48L617.84,379.47L615.77,375.2L614.26,375.72L612.48,374.65L611.43,375.91L609.88,374.22L609.85,372.49L608.96,372.49L609.42,370.12L607.97,367.62L604.54,365.8L602.59,362.62L603.24,359.98L604.66,358.81L604.44,356.81L602.61,355.77L600.79,351.63L599.26,348.8L599.8,347.71L598.93,343.59L600.85,342.56L601.29,343.93L602.71,345.59L604.63,346.06L605.65,345.96L608.96,343.3L610.01,343.03L610.83,344.1L609.87,345.88L611.62,347.74L612.31,347.57L613.2,350.18L615.86,350.91L617.81,352.67L621.79,353.27L626.17,352.35z"},{"code":"IS","name":"Iceland","path":"M434.57,212.43L433.93,216.91L437.09,221.51L433.45,226.52L425.36,230.9L422.94,232.05L419.25,231.12L411.43,229.11L414.19,226.27L408.09,223.07L413.05,221.79L412.93,219.82L407.05,218.25L408.94,213.78L413.19,212.75L417.56,217.43L421.82,213.68L425.35,215.64L429.92,211.93z"},{"code":"IT","name":"Italy","path":"M518.77,347.88l-1.01,2.78l0.42,1.09l-0.59,1.79l-2.14,-1.31l-1.43,-0.38l-3.91,-1.79l0.39,-1.82l3.28,0.32l2.86,-0.39L518.77,347.88zM501.08,337.06l1.68,2.62l-0.39,4.81l-1.27,-0.23l-1.14,1.2l-1.06,-0.95l-0.11,-4.38l-0.64,-2.1l1.54,0.19L501.08,337.06zM509.95,315.46l4.01,1.05l-0.3,1.99l0.67,1.71l-2.23,-0.58l-2.28,1.42l0.16,1.97l-0.34,1.12l0.92,1.99l2.63,1.95l1.41,3.17l3.12,3.05l2.2,-0.02l0.68,0.83l-0.79,0.74l2.51,1.35l2.06,1.12l2.4,1.92l0.29,0.68l-0.52,1.31l-1.56,-1.7l-2.44,-0.6l-1.18,2.36l2.03,1.34l-0.33,1.88l-1.17,0.21l-1.5,3.06l-1.17,0.27l0.01,-1.08l0.57,-1.91l0.61,-0.77l-1.09,-2.09l-0.86,-1.83l-1.16,-0.46l-0.83,-1.58l-1.8,-0.67l-1.21,-1.49l-2.07,-0.24l-2.19,-1.68l-2.56,-2.45l-1.91,-2.19l-0.87,-3.8l-1.4,-0.45l-2.28,-1.29l-1.29,0.53l-1.62,1.8l-1.17,0.28l0.32,-1.68l-1.52,-0.49l-0.72,-3.04l0.97,-1.21l-0.83,-1.5l0.12,-1.13l1.21,0.86l1.35,-0.19l1.57,-1.36l0.49,0.64l1.34,-0.13l0.61,-1.63l2.07,0.51l1.24,-0.68l0.22,-1.67l1.7,0.58l0.33,-0.78l2.77,-0.71L509.95,315.46z"},{"code":"JM","name":"Jamaica","path":"M257.76,410.96L259.65,411.22L261.14,411.93L261.6,412.73L259.63,412.78L258.78,413.27L257.21,412.8L255.61,411.73L255.94,411.06L257.12,410.86z"},{"code":"JO","name":"Jordan","path":"M574.92,367.87L575.41,366.82L578.53,368.14L584.02,364.6L585.15,368.64L584.62,369.13L579,370.78L581.8,374.04L580.87,374.58L580.41,375.67L578.27,376.11L577.6,377.27L576.38,378.25L573.26,377.74L573.17,377.28L574.57,372.11L574.5,370.84L574.92,369.88z"},{"code":"JP","name":"Japan",labelCoordinate:{x:0.8,y:0.4},"path":"M852.76,362.01l0.36,1.15l-1.58,2.03l-1.15,-1.07l-1.44,0.78l-0.74,1.95l-1.83,-0.95l0.02,-1.58l1.55,-2l1.59,0.39l1.15,-1.42L852.76,362.01zM870.53,351.73l-1.06,2.78l0.49,1.73l-1.46,2.42l-3.58,1.6l-4.93,0.21l-4,3.84l-1.88,-1.29L854,360.5l-4.88,0.75l-3.32,1.59l-3.28,0.06l2.84,2.46l-1.87,5.61l-1.81,1.37l-1.36,-1.27l0.69,-2.96l-1.77,-0.96l-1.14,-2.28l2.65,-1.03l1.47,-2.11l2.82,-1.75l2.06,-2.33l5.58,-1.02l3,0.7l2.93,-6.17l1.87,1.67l4.11,-3.51l1.59,-1.38l1.76,-4.38l-0.48,-4.1l1.18,-2.33l2.98,-0.68l1.53,5.11l-0.08,2.94l-2.59,3.6L870.53,351.73zM878.76,325.8l1.97,0.83l1.98,-1.65l0.62,4.35l-4.16,1.05l-2.46,3.76l-4.41,-2.58l-1.53,4.12l-3.12,0.06l-0.39,-3.74l1.39,-2.94l3,-0.21l0.82,-5.38l0.83,-3.09l3.29,4.12L878.76,325.8z"},{"code":"KE","name":"Kenya","path":"M590.19,465.78L591.85,468.07L589.89,469.19L589.2,470.35L588.14,470.55L587.75,472.52L586.85,473.64L586.3,475.5L585.17,476.42L581.15,473.63L580.95,472.01L570.79,466.34L570.31,466.03L570.29,463.08L571.09,461.95L572.47,460.11L573.49,458.08L572.26,454.88L571.93,453.48L570.6,451.54L572.32,449.87L574.22,448.03L575.68,448.5L575.68,450.07L576.64,450.98L578.59,450.98L582.14,453.36L583.02,453.38L583.68,453.31L584.3,453.63L586.17,453.85L587,452.69L589.56,451.52L590.69,452.46L592.61,452.46L590.16,455.63z"},{"code":"KG","name":"Kyrgyzstan","path":"M674.22,333.11L674.85,331.45L676.69,330.91L681.31,332.22L681.74,329.98L683.33,329.18L687.33,330.79L688.35,330.37L693,330.47L697.16,330.87L698.56,332.24L700.29,332.79L699.9,333.65L695.48,335.68L694.48,337.16L690.88,337.6L689.82,339.95L686.85,339.46L684.92,340.18L682.24,341.9L682.63,342.75L681.83,343.58L676.53,344.13L673.06,342.96L670.02,343.24L670.29,341.14L673.34,341.75L674.37,340.62L676.5,340.98L680.09,338.34L676.77,336.38L674.77,337.31L672.7,335.91L675.05,333.48z"},{"code":"KH","name":"Cambodia","path":"M765.44,433.6L764.3,432.12L762.89,429.18L762.22,425.73L764.02,423.35L767.64,422.8L770.27,423.21L772.58,424.34L773.85,422.35L776.34,423.41L776.99,425.33L776.64,428.75L771.93,430.94L773.16,432.67L770.22,432.87L767.79,434.01z"},{"code":"KP","name":"North Korea","path":"M841.55,332.62L841.94,333.29L840.88,333.06L839.66,334.33L838.82,335.61L838.93,338.28L837.48,339.09L836.98,339.74L835.92,340.82L834.05,341.42L832.84,342.4L832.75,343.97L832.42,344.37L833.54,344.95L835.13,346.53L834.72,347.39L833.53,347.62L831.55,347.79L830.46,349.39L829.2,349.27L829.03,349.59L827.67,348.92L827.33,349.58L826.51,349.87L826.41,349.21L825.68,348.89L824.93,348.32L825.7,346.75L826.36,346.33L826.11,345.68L826.82,343.74L826.63,343.15L825,342.75L823.68,341.78L825.96,339.43L829.05,337.45L830.98,334.8L832.31,335.97L834.73,336.11L834.29,334.14L838.62,332.51L839.74,330.38z"},{"code":"KR","name":"South Korea",labelCoordinate:{x:0.5,y:0.6},"path":"M835.13,346.53L837.55,350.71L838.24,352.98L838.26,356.96L837.21,358.84L834.67,359.5L832.43,360.91L829.9,361.2L829.59,359.35L830.11,356.78L828.87,353.18L830.95,352.59L829.03,349.59L829.2,349.27L830.46,349.39L831.55,347.79L833.53,347.62L834.72,347.39z"},{"code":"XK","name":"Kosovo","path":"M533.47,333.92L533.34,334.69L532.98,334.66L532.8,333.29L532.13,332.91L531.53,331.89L532.05,331.04L532.72,330.76L533.11,329.5L533.61,329.28L534.01,329.82L534.54,330.06L534.9,330.67L535.36,330.85L535.91,331.55L536.31,331.53L535.99,332.46L535.66,332.91L535.75,333.19L535.12,333.33z"},{"code":"KW","name":"Kuwait","path":"M609.77,375.76L610.35,377.17L610.1,377.9L611,380.31L609.02,380.39L608.32,378.88L605.82,378.57L607.88,375.49z"},{"code":"KZ","name":"Kazakhstan","path":"M674.22,333.11L672.61,333.81L668.92,336.42L667.69,339.07L666.64,339.09L665.88,337.34L662.31,337.22L661.74,334.16L660.37,334.13L660.58,330.33L657.23,327.53L652.42,327.83L649.13,328.39L646.45,324.89L644.16,323.41L639.81,320.57L639.29,320.22L632.07,322.57L632.18,336.7L630.74,336.88L628.78,333.95L626.88,332.89L623.7,333.68L622.46,334.93L622.3,334.01L622.99,332.44L622.46,331.12L619.21,329.82L617.94,326.35L616.4,325.37L616.3,324.09L619.03,324.46L619.14,321.58L621.52,320.94L623.97,321.53L624.48,317.62L623.98,315.11L621.17,315.31L618.79,314.31L615.54,316.1L612.93,316.96L611.5,316.3L611.79,314.2L610,311.44L607.92,311.55L605.54,308.72L607.16,305.5L606.34,304.63L608.57,299.86L611.46,302.39L611.81,299.2L617.59,294.35L621.97,294.23L628.16,297.33L631.47,299.12L634.45,297.25L638.89,297.17L642.48,299.46L643.3,298.15L647.23,298.34L647.94,296.23L643.39,293.14L646.08,290.91L645.56,289.66L648.25,288.45L646.23,285.25L647.51,283.63L658,281.97L659.37,280.78L666.39,278.99L668.91,276.95L673.95,278.01L674.83,283.02L677.76,281.86L681.36,283.49L681.13,286.07L683.82,285.8L690.84,281.31L689.82,282.81L693.4,286.47L699.66,298.05L701.16,295.72L705.02,298.28L709.05,297.14L710.59,297.94L711.94,300.49L713.9,301.33L715.1,303.18L718.71,302.6L720.2,305.23L718.06,308.06L715.73,308.46L715.6,312.64L714.04,314.5L708.48,313.15L706.46,320.41L705.02,321.3L699.47,322.88L701.99,329.63L700.07,330.63L700.29,332.79L698.56,332.24L697.16,330.87L693,330.47L688.35,330.37L687.33,330.79L683.33,329.18L681.74,329.98L681.31,332.22L676.69,330.91L674.85,331.45z"},{"code":"LA","name":"Lao People's Democratic Republic","path":"M770.27,423.21L771.18,421.91L771.31,419.47L769.04,416.94L768.86,414.07L766.73,411.69L764.61,411.49L764.05,412.51L762.4,412.59L761.56,412.08L758.61,413.82L758.54,411.2L759.23,408.09L757.34,407.96L757.18,406.18L755.96,405.26L756.56,404.16L758.95,402.22L759.2,402.92L760.69,403L760.27,399.57L761.72,399.13L763.36,401.5L764.62,404.22L768.07,404.25L769.16,406.84L767.37,407.61L766.56,408.68L769.92,410.44L772.25,413.9L774.02,416.47L776.14,418.49L776.85,420.53L776.34,423.41L773.85,422.35L772.58,424.34z"},{"code":"LB","name":"Lebanon","path":"M575.69,364.93L574.94,364.98L574.68,365.56L573.74,365.56L574.74,362.83L576.13,360.45L576.19,360.33L577.45,360.51L577.91,361.83L576.38,363.1z"},{"code":"LK","name":"Sri Lanka","path":"M704.57,442.37L704.15,445.29L702.98,446.09L700.54,446.73L699.2,444.5L698.71,440.47L699.98,435.89L701.91,437.46L703.22,439.44z"},{"code":"LR","name":"Liberia","path":"M453.63,451.22L452.89,451.24L450,449.91L447.46,447.78L445.07,446.25L443.18,444.44L443.85,443.54L444,442.73L445.26,441.2L446.57,439.89L447.17,439.82L447.9,439.51L449.07,441.23L448.89,442.36L449.43,442.96L450.23,442.97L450.8,441.84L451.59,441.91L451.46,442.73L451.74,444.09L451.13,445.33L451.95,446.1L452.84,446.29L454.03,447.46L454.11,448.57L453.84,448.92z"},{"code":"LS","name":"Lesotho","path":"M556.5,547.75L557.48,548.71L556.62,550.27L556.14,551.32L554.58,551.82L554.06,552.86L553.06,553.18L550.96,550.69L552.45,548.66L553.97,547.41L555.28,546.77z"},{"code":"LT","name":"Lithuania","path":"M538.99,282.09L538.76,280.87L539.06,279.54L537.82,278.77L534.89,277.91L534.29,273.75L537.5,272.2L542.2,272.53L544.96,272.03L545.35,273.08L546.84,273.4L549.54,275.82L549.8,278.02L547.5,279.59L546.85,282.31L543.81,284.11L541.1,284.07L540.43,282.61z"},{"code":"LU","name":"Luxembourg","path":"M492.2,301.29L492.76,302.27L492.6,304.16L491.79,304.26L491.16,303.88L491.47,301.45z"},{"code":"LV","name":"Latvia","path":"M534.29,273.75L534.39,269.94L535.77,266.7L538.41,264.92L540.63,268.8L542.88,268.7L543.42,264.71L545.81,263.78L547.04,264.43L549.45,266.37L551.77,266.38L553.12,267.57L553.35,270.06L554.26,273.05L551.24,274.98L549.54,275.82L546.84,273.4L545.35,273.08L544.96,272.03L542.2,272.53L537.5,272.2z"},{"code":"LY","name":"Libya","path":"M516.89,397.93L514.91,399.05L513.33,397.39L508.9,396.08L507.67,394.17L505.45,392.75L504.14,393.31L503.15,391.6L503.04,390.28L501.38,388.02L502.5,386.73L502.25,384.76L502.61,383.04L502.41,381.6L502.9,379.01L502.75,377.53L501.84,374.69L503.21,373.94L503.45,372.56L503.15,371.21L505.08,369.95L505.94,368.9L507.31,367.95L507.47,365.4L510.76,366.55L511.94,366.26L514.28,366.82L518,368.29L519.31,371.21L521.83,371.85L525.78,373.21L528.77,374.82L530.14,373.98L531.48,372.49L530.83,369.98L531.71,368.38L533.73,366.83L535.66,366.38L539.45,367.06L540.41,368.54L541.45,368.55L542.34,369.11L545.13,369.5L545.81,370.58L544.8,372.15L545.23,373.54L544.51,375.54L545.35,378.12L545.35,389.3L545.35,400.53L545.35,406.49L542.13,406.5L542.09,407.74L530.91,402.04L519.72,396.27z"},{"code":"MA","name":"Morocco","path":"M450.96,383.14L450.93,379.39L455.46,377.03L458.26,376.54L460.55,375.68L461.63,374.06L464.91,372.77L465.03,370.36L466.65,370.07L467.92,368.86L471.59,368.3L472.1,367.02L471.36,366.31L470.39,362.78L470.23,360.73L469.17,358.55L467.95,358.51L465.05,357.76L462.38,358L460.69,356.54L458.63,356.52L457.74,358.63L455.87,362.14L453.79,363.53L450.98,365.06L449.18,367.3L448.8,369.04L447.73,371.86L448.43,375.89L446.09,378.57L444.69,379.42L442.48,381.59L439.87,381.94L438.57,383.06L442.19,383.07L450.94,383.1L450.94,383.1L450.94,383.1L442.19,383.07L438.57,383.06z"},{"code":"MD","name":"Moldova","path":"M549.89,309.45L550.56,308.83L552.42,308.41L554.49,309.72L555.64,309.88L556.91,311L556.71,312.41L557.73,313.08L558.13,314.8L559.11,315.84L558.92,316.44L559.44,316.86L558.7,317.15L557.04,317.04L556.77,316.47L556.18,316.8L556.38,317.52L555.61,318.81L555.12,320.18L554.42,320.62L553.91,318.79L554.21,317.07L554.12,315.28L552.5,312.84L551.61,311.09L550.74,309.85z"},{"code":"ME","name":"Montenegro","path":"M530.77,332.23L530.6,331.51L529.38,333.38L529.57,334.57L528.98,334.28L528.2,333.05L526.98,332.3L527.29,331.66L527.7,329.56L528.61,328.67L529.14,328.31L529.88,328.97L530.29,329.51L531.21,329.92L532.28,330.71L532.05,331.04L531.53,331.89z"},{"code":"MG","name":"Madagascar","path":"M614.17,498.4L614.91,499.61L615.6,501.5L616.06,504.96L616.78,506.31L616.5,507.69L616.01,508.55L615.05,506.85L614.53,507.71L615.06,509.85L614.81,511.09L614.04,511.76L613.86,514.24L612.76,517.66L611.38,521.75L609.64,527.42L608.57,531.63L607.3,535.18L605.02,535.91L602.57,537.22L600.96,536.43L598.73,535.33L597.96,533.71L597.77,531L596.79,528.58L596.53,526.41L597.03,524.25L598.32,523.73L598.33,522.74L599.67,520.48L599.92,518.6L599.27,517.2L598.74,515.35L598.52,512.65L599.5,511.02L599.87,509.17L601.27,509.07L602.84,508.47L603.87,507.95L605.11,507.91L606.7,506.26L609.01,504.48L609.85,503.04L609.47,501.81L610.66,502.16L612.21,500.17L612.26,498.45L613.19,497.17z"},{"code":"MK","name":"Macedonia","path":"M532.98,334.66L533.34,334.69L533.47,333.92L535.12,333.33L535.75,333.19L536.71,332.97L538,332.91L539.41,334.12L539.61,336.59L539.07,336.71L538.61,337.36L537.09,337.29L536.02,338.1L534.19,338.42L533.03,337.52L532.63,335.93z"},{"code":"ML","name":"Mali","path":"M441.13,422.22L442.07,421.7L442.54,420L443.43,419.93L445.39,420.73L446.97,420.16L448.05,420.35L448.48,419.71L459.73,419.67L460.35,417.64L459.86,417.28L458.51,404.6L457.16,391.54L461.45,391.49L470.91,398.14L480.37,404.69L481.03,406.08L482.78,406.93L484.08,407.41L484.11,409.29L487.22,409L487.23,415.75L485.69,417.69L485.45,419.48L482.96,419.93L479.14,420.18L478.1,421.21L476.3,421.32L474.51,421.33L473.81,420.78L472.26,421.19L469.64,422.39L469.11,423.29L466.93,424.57L466.55,425.31L465.38,425.89L464.02,425.51L463.25,426.21L462.84,428.17L460.61,430.53L460.68,431.49L459.91,432.7L460.1,434.34L458.94,434.76L458.29,435.12L457.85,433.91L457.04,434.23L456.56,434.17L456.04,435L453.88,434.97L453.1,434.55L452.74,434.81L451.88,433.99L452.03,433.15L451.68,432.81L451.08,433.09L451.19,432.17L451.77,431.44L450.62,430.25L450.28,429.46L449.66,428.84L449.1,428.76L448.43,429.16L447.52,429.54L446.75,430.16L445.55,429.93L444.77,429.21L444.31,429.11L443.58,429.49L443.13,429.5L442.97,428.45L443.1,427.56L442.86,426.46L441.81,425.65L441.26,424.01z"},{"code":"MM","name":"Myanmar","path":"M754.36,405.95L752.72,407.23L750.74,407.37L749.46,410.56L748.28,411.09L749.64,413.66L751.42,415.79L752.56,417.71L751.54,420.23L750.57,420.76L751.24,422.21L753.11,424.49L753.43,426.09L753.38,427.42L754.48,430.02L752.94,432.67L751.58,435.58L751.31,433.48L752.17,431.3L751.23,429.62L751.46,426.51L750.32,425.03L749.41,421.59L748.9,417.93L747.69,415.53L745.84,416.99L742.65,419.05L741.08,418.79L739.34,418.12L740.31,414.51L739.73,411.77L737.53,408.38L737.87,407.31L736.23,406.93L734.24,404.51L734.06,402.1L735.04,402.56L735.09,400.41L736.48,399.69L736.18,398.41L736.81,397.38L736.92,394.23L739.11,394.93L740.36,392.41L740.51,390.91L742.05,388.31L741.97,386.53L745.6,384.37L747.6,384.94L747.37,383.01L748.36,382.43L748.14,381.23L749.78,380.99L750.72,382.85L751.94,383.6L752.03,386L751.91,388.57L749.26,391.15L748.92,394.78L751.88,394.28L752.55,397.08L754.33,397.67L753.51,400.17L755.59,401.3L756.81,401.85L758.86,400.98L758.95,402.22L756.56,404.16L755.96,405.26z"},{"code":"MN","name":"Mongolia","path":"M721.29,304.88L724.25,304.14L729.6,300.4L733.87,298.33L736.3,299.68L739.23,299.74L741.1,301.79L743.9,301.94L747.96,303.03L750.68,300L749.54,297.4L752.45,292.74L755.59,294.61L758.13,295.14L761.43,296.29L761.96,299.61L765.95,301.45L768.6,300.64L772.14,300.07L774.95,300.65L777.7,302.74L779.4,304.94L782,304.9L785.53,305.59L788.11,304.53L791.8,303.82L795.91,300.76L797.59,301.23L799.06,302.69L802.4,302.33L801.04,305.58L799.06,309.8L799.78,311.51L801.37,310.98L804.13,311.63L806.29,310.09L808.54,311.42L811.08,314.31L810.77,315.76L808.56,315.3L804.49,315.84L802.51,317L800.46,319.66L796.18,321.21L793.39,323.31L790.51,322.51L788.93,322.15L787.46,324.69L788.35,326.19L788.81,327.47L786.84,328.77L784.83,330.82L781.56,332.15L777.35,332.3L772.82,333.61L769.56,335.62L768.32,334.46L764.93,334.46L760.78,332.17L758.01,331.6L754.28,332.13L748.49,331.28L745.4,331.37L743.76,329.1L742.48,325.53L740.75,325.1L737.36,322.65L733.58,322.1L730.25,321.42L729.24,319.69L730.32,314.96L728.39,311.65L724.39,310.08L722.03,307.85z"},{"code":"MR","name":"Mauritania","path":"M441.13,422.22L439.28,420.24L437.58,418.11L435.72,417.34L434.38,416.49L432.81,416.52L431.45,417.15L430.05,416.9L429.09,417.83L428.85,416.27L429.63,414.83L429.98,412.08L429.67,409.17L429.33,407.7L429.61,406.23L428.89,404.81L427.41,403.53L428.02,402.53L439,402.55L438.47,398.2L439.16,396.65L441.78,396.38L441.69,388.52L450.9,388.69L450.9,383.96L461.45,391.49L457.16,391.54L458.51,404.6L459.86,417.28L460.35,417.64L459.73,419.67L448.48,419.71L448.05,420.35L446.97,420.16L445.39,420.73L443.43,419.93L442.54,420L442.07,421.7z"},{"code":"MW","name":"Malawi","path":"M572.15,495.69L571.37,497.85L572.15,501.57L573.13,501.53L574.14,502.45L575.31,504.53L575.55,508.25L574.34,508.86L573.48,510.87L571.65,509.08L571.45,507.04L572.04,505.69L571.87,504.54L570.77,503.81L569.99,504.07L568.38,502.69L566.91,501.95L567.76,499.29L568.64,498.3L568.1,495.94L568.66,493.64L569.14,492.87L568.43,490.47L567.11,489.21L569.85,489.73L570.42,490.51L571.37,491.83z"},{"code":"MX","name":"Mexico","path":"M202.89,388.72L201.8,391.43L201.31,393.64L201.1,397.72L200.83,399.19L201.32,400.83L202.19,402.3L202.75,404.61L204.61,406.82L205.26,408.51L206.36,409.96L209.34,410.75L210.5,411.97L212.96,411.15L215.09,410.86L217.19,410.33L218.96,409.82L220.74,408.62L221.41,406.89L221.64,404.4L222.13,403.53L224.02,402.74L226.99,402.05L229.47,402.15L231.17,401.9L231.84,402.53L231.75,403.97L230.24,405.74L229.58,407.55L230.09,408.06L229.67,409.34L228.97,411.63L228.26,410.88L227.67,410.93L227.14,410.97L226.14,412.74L225.63,412.39L225.29,412.53L225.31,412.96L222.72,412.93L220.1,412.93L220.1,414.58L218.83,414.58L219.87,415.56L220.91,416.23L221.22,416.86L221.68,417.04L221.6,418.02L218.01,418.03L216.66,420.39L217.05,420.93L216.73,421.61L216.66,422.45L213.49,419.34L212.04,418.4L209.75,417.64L208.19,417.85L205.93,418.94L204.52,419.23L202.54,418.47L200.44,417.91L197.82,416.58L195.72,416.17L192.54,414.82L190.2,413.42L189.49,412.64L187.92,412.47L185.05,411.54L183.88,410.2L180.87,408.53L179.47,406.66L178.8,405.21L179.73,404.92L179.44,404.07L180.09,403.3L180.1,402.26L179.16,400.92L178.9,399.72L177.96,398.2L175.49,395.18L172.67,392.79L171.31,390.88L168.9,389.62L168.39,388.86L168.82,386.94L167.39,386.21L165.73,384.69L165.03,382.5L163.52,382.24L161.9,380.58L160.58,379.03L160.46,378.03L158.95,375.61L157.96,373.13L158,371.88L155.97,370.59L155.04,370.73L153.44,369.83L152.99,371.16L153.45,372.72L153.72,375.15L154.69,376.48L156.77,378.69L157.23,379.44L157.66,379.66L158.02,380.76L158.52,380.71L159.09,382.75L159.94,383.55L160.53,384.66L162.3,386.26L163.23,389.15L164.06,390.5L164.84,391.94L164.99,393.56L166.34,393.66L167.47,395.05L168.49,396.41L168.42,396.95L167.24,398.06L166.74,398.05L166,396.2L164.17,394.47L162.15,392.99L160.71,392.21L160.8,389.96L160.38,388.28L159.04,387.32L157.11,385.93L156.74,386.33L156.04,385.51L154.31,384.76L152.66,382.93L152.86,382.69L154.01,382.87L155.05,381.69L155.16,380.26L153,377.99L151.36,377.1L150.32,375.09L149.28,372.97L147.98,370.36L146.84,367.4L150.03,367.15L153.59,366.79L153.33,367.43L157.56,369.04L163.96,371.35L169.54,371.32L171.76,371.32L171.76,369.97L176.62,369.97L177.64,371.14L179.08,372.17L180.74,373.6L181.67,375.29L182.37,377.05L183.82,378.02L186.15,378.98L187.91,376.45L190.21,376.39L192.18,377.67L193.59,379.85L194.56,381.71L196.21,383.51L196.83,385.7L197.62,387.17L199.8,388.13L201.79,388.81z"},{"code":"MY","name":"Malaysia","path":"M758.65,446.07l0.22,1.44l1.85,-0.33l0.92,-1.15l0.64,0.26l1.66,1.69l1.18,1.87l0.16,1.88l-0.3,1.27l0.27,0.96l0.21,1.65l0.99,0.77l1.1,2.46l-0.05,0.94l-1.99,0.19l-2.65,-2.06l-3.32,-2.21l-0.33,-1.42l-1.62,-1.87l-0.39,-2.31l-1.01,-1.52l0.31,-2.04l-0.62,-1.19l0.49,-0.5L758.65,446.07zM807.84,450.9l-2.06,0.95l-2.43,-0.47l-3.22,0l-0.97,3.17l-1.08,0.97l-1.44,3.88l-2.29,0.59l-2.65,-0.78l-1.34,0.24l-1.63,1.41l-1.79,-0.2l-1.81,0.57l-1.92,-1.57l-0.47,-1.86l2.05,0.96l2.17,-0.52l0.56,-2.36l1.2,-0.53l3.36,-0.6l2.01,-2.21l1.38,-1.77l1.28,1.45l0.59,-0.95l1.34,0.09l0.16,-1.78l0.13,-1.38l2.16,-1.95l1.41,-2.19l1.13,-0.01l1.44,1.42l0.13,1.22l1.85,0.78l2.34,0.84l-0.2,1.1l-1.88,0.14L807.84,450.9z"},{"code":"MZ","name":"Mozambique","path":"M572.15,495.69L574.26,495.46L577.63,496.26L578.37,495.9L580.32,495.83L581.32,494.98L583,495.02L586.06,493.92L588.29,492.28L588.75,493.55L588.63,496.38L588.98,498.88L589.09,503.36L589.58,504.76L588.75,506.83L587.66,508.84L585.87,510.64L583.31,511.75L580.15,513.16L576.98,516.31L575.9,516.85L573.94,518.94L572.79,519.63L572.55,521.75L573.88,524L574.43,525.76L574.47,526.66L574.96,526.51L574.88,529.47L574.43,530.88L575.09,531.4L574.67,532.67L573.5,533.76L571.19,534.8L567.82,536.46L566.59,537.61L566.83,538.91L567.54,539.12L567.3,540.76L565.18,540.74L564.94,539.36L564.52,537.97L564.28,536.86L564.78,533.43L564.05,531.26L562.71,527L565.66,523.59L566.4,521.44L566.83,521.17L567.14,519.43L566.69,518.55L566.81,516.35L567.36,514.31L567.35,510.62L565.9,509.68L564.56,509.47L563.96,508.75L562.66,508.14L560.32,508.2L560.14,507.12L559.87,505.07L568.38,502.69L569.99,504.07L570.77,503.81L571.87,504.54L572.04,505.69L571.45,507.04L571.65,509.08L573.48,510.87L574.34,508.86L575.55,508.25L575.31,504.53L574.14,502.45L573.13,501.53L572.15,501.57L571.37,497.85z"},{"code":"NA","name":"Namibia","path":"M521.08,546.54L519,544.15L517.9,541.85L517.28,538.82L516.59,536.57L515.65,531.85L515.59,528.22L515.23,526.58L514.14,525.34L512.69,522.87L511.22,519.3L510.61,517.45L508.32,514.58L508.15,512.33L509.5,511.78L511.18,511.28L513,511.37L514.67,512.69L515.09,512.48L526.46,512.36L528.4,513.76L535.19,514.17L540.34,512.98L542.64,512.31L544.46,512.48L545.56,513.14L545.59,513.38L544.01,514.04L543.15,514.05L541.37,515.2L540.29,513.99L535.97,515.02L533.88,515.11L533.8,525.68L531.04,525.79L531.04,534.65L531.03,546.17L528.53,547.8L527.03,548.03L525.26,547.43L524,547.2L523.53,545.84L522.42,544.97z"},{"code":"NC","name":"New Caledonia","path":"M940.08,523.48L942.38,525.34L943.83,526.72L942.77,527.45L941.22,526.63L939.22,525.28L937.41,523.69L935.56,521.59L935.17,520.58L936.37,520.63L937.95,521.64L939.18,522.65z"},{"code":"NE","name":"Niger","path":"M481.29,429.88L481.36,427.93L478.12,427.28L478.04,425.9L476.46,424.03L476.08,422.72L476.3,421.32L478.1,421.21L479.14,420.18L482.96,419.93L485.45,419.48L485.69,417.69L487.23,415.75L487.22,409L491.17,407.68L499.29,401.83L508.9,396.08L513.33,397.39L514.91,399.05L516.89,397.93L517.58,402.6L518.63,403.38L518.68,404.33L519.84,405.35L519.23,406.63L518.15,412.61L518.01,416.4L514.43,419.14L513.22,422.94L514.39,424L514.38,425.85L516.18,425.92L515.9,427.26L515.11,427.43L515.02,428.33L514.49,428.4L512.6,425.27L511.94,425.15L509.75,426.75L507.58,425.92L506.07,425.75L505.26,426.15L503.61,426.07L501.96,427.29L500.53,427.36L497.14,425.88L495.81,426.58L494.38,426.53L493.33,425.45L490.51,424.38L487.5,424.72L486.77,425.34L486.38,426.99L485.57,428.14L485.38,430.68L483.24,429.04L482.23,429.05z"},{"code":"NG","name":"Nigeria","path":"M499.09,450.08L496.18,451.08L495.11,450.94L494.03,451.56L491.79,451.5L490.29,449.75L489.37,447.73L487.38,445.89L485.27,445.92L482.8,445.92L482.96,441.39L482.89,439.6L483.42,437.83L484.28,436.96L485.64,435.21L485.35,434.45L485.9,433.31L485.27,431.63L485.38,430.68L485.57,428.14L486.38,426.99L486.77,425.34L487.5,424.72L490.51,424.38L493.33,425.45L494.38,426.53L495.81,426.58L497.14,425.88L500.53,427.36L501.96,427.29L503.61,426.07L505.26,426.15L506.07,425.75L507.58,425.92L509.75,426.75L511.94,425.15L512.6,425.27L514.49,428.4L515.02,428.33L516.13,429.47L515.82,429.98L515.67,430.93L513.31,433.13L512.57,434.94L512.17,436.41L511.58,437.04L511.01,439.01L509.51,440.17L509.08,441.59L508.45,442.73L508.19,443.89L506.26,444.84L504.69,443.69L503.62,443.73L501.95,445.37L501.14,445.4L499.81,448.1z"},{"code":"NI","name":"Nicaragua","path":"M234.93,432.31L233.96,431.41L232.65,430.26L232.03,429.3L230.85,428.41L229.44,427.12L229.75,426.68L230.22,427.11L230.43,426.9L231.3,426.79L231.65,426.13L232.06,426.11L232,424.7L232.66,424.63L233.25,424.65L233.85,423.89L234.68,424.47L234.97,424.11L235.48,423.77L236.46,422.98L236.51,422.38L236.78,422.41L237.14,421.72L237.43,421.64L237.91,422.08L238.47,422.21L239.09,421.84L239.8,421.84L240.77,421.46L241.16,421.07L242.12,421.13L241.88,421.41L241.74,422.05L242.02,423.1L241.38,424.08L241.08,425.23L240.98,426.5L241.14,427.23L241.21,428.52L240.78,428.8L240.52,430.02L240.71,430.77L240.13,431.5L240.27,432.26L240.69,432.73L240.02,433.33L239.2,433.14L238.73,432.56L237.84,432.32L237.2,432.69L235.35,431.94z"},{"code":"NL","name":"Netherlands","path":"M492.28,285.98L494.61,286.11L495.14,287.69L494.44,291.92L493.73,293.63L492.04,293.63L492.52,298.32L490.97,297.28L489.2,295.33L486.6,296.26L484.55,295.91L485.99,294.67L488.45,287.93z"},{"code":"NO","name":"Norway",labelCoordinate: {x: 0.1,y: 0.7},"path":"M554.23,175.61l8.77,6.24l-3.61,2.23l3.07,5.11l-4.77,3.19l-2.26,0.72l1.19,-5.59l-3.6,-3.25l-4.35,2.78l-1.38,5.85l-2.67,3.44l-3.01,-1.87l-3.66,0.38l-3.12,-4.15l-1.68,2.09l-1.74,0.32l-0.41,5.08l-5.28,-1.22l-0.74,4.22l-2.69,-0.03l-1.85,5.24l-2.8,7.87l-4.35,9.5l1.02,2.23l-0.98,2.55l-2.78,-0.11l-1.82,5.91l0.17,8.04l1.79,2.98l-0.93,6.73l-2.33,3.81l-1.24,3.15l-1.88,-3.35l-5.54,6.27l-3.74,1.24l-3.88,-2.71l-1,-5.86l-0.89,-13.26l2.58,-3.88l7.4,-5.18l5.54,-6.59l5.13,-9.3l6.74,-13.76l4.7,-5.67l7.71,-9.89l6.15,-3.59l4.61,0.44l4.27,-6.99l5.11,0.38L554.23,175.61z"},{"code":"NP","name":"Nepal","path":"M722.33,382.45L722.11,383.8L722.48,385.79L722.16,387.03L719.83,387.08L716.45,386.35L714.29,386.06L712.67,384.47L708.83,384.06L705.17,382.29L702.53,380.74L699.81,379.54L700.9,376.55L702.68,375.09L703.84,374.31L706.09,375.31L708.92,377.4L710.49,377.86L711.43,379.39L713.61,380.02L715.89,381.41L719.06,382.14z"},{"code":"NZ","name":"New Zealand","path":"M960.38,588.63l0.64,1.53l1.99,-1.5l0.81,1.57l0,1.57l-1.04,1.74l-1.83,2.8l-1.43,1.54l1.03,1.86l-2.16,0.05l-2.4,1.46l-0.75,2.57l-1.59,4.03l-2.2,1.8l-1.4,1.16l-2.58,-0.09l-1.82,-1.34l-3.05,-0.28l-0.47,-1.48l1.51,-2.96l3.53,-3.87l1.81,-0.73l2.01,-1.47l2.4,-2.01l1.68,-1.98l1.25,-2.81l1.06,-0.95l0.42,-2.07l1.97,-1.7L960.38,588.63zM964.84,571.61l2.03,3.67l0.06,-2.38l1.27,0.95l0.42,2.65l2.26,1.15l1.89,0.28l1.6,-1.35l1.42,0.41l-0.68,3.15l-0.85,2.09l-2.14,-0.07l-0.75,1.1l0.26,1.56l-0.41,0.68l-1.06,1.97l-1.39,2.53l-2.17,1.49l-0.48,-0.98l-1.17,-0.54l1.62,-3.04l-0.92,-2.01l-3.02,-1.45l0.08,-1.31l2.03,-1.25l0.47,-2.74l-0.13,-2.28l-1.14,-2.34l0.08,-0.61l-1.34,-1.43l-2.21,-3.04l-1.17,-2.41l1.04,-0.27l1.53,1.89l2.18,0.89L964.84,571.61z"},{"code":"OM","name":"Oman","path":"M640.29,403.18l-1.05,2.04l-1.27,-0.16l-0.58,0.71l-0.45,1.5l0.34,1.98l-0.26,0.36l-1.29,-0.01l-1.75,1.1l-0.27,1.43l-0.64,0.62l-1.74,-0.02l-1.1,0.74l0.01,1.18l-1.36,0.81l-1.55,-0.27l-1.88,0.98l-1.3,0.16l-0.92,-2.04l-2.19,-4.84l8.41,-2.96l1.87,-5.97l-1.29,-2.14l0.07,-1.22l0.82,-1.26l0.01,-1.25l1.27,-0.6l-0.5,-0.42l0.23,-2l1.43,-0.01l1.26,2.09l1.57,1.11l2.06,0.4l1.66,0.55l1.27,1.74l0.76,1l1,0.38l-0.01,0.67l-1.02,1.79l-0.45,0.84L640.29,403.18zM633.37,388.64L633,389.2l-0.53,-1.06l0.82,-1.06l0.35,0.27L633.37,388.64z"},{"code":"PA","name":"Panama","path":"M256.88,443.21L255.95,442.4L255.35,440.88L256.04,440.13L255.33,439.94L254.81,439.01L253.41,438.23L252.18,438.41L251.62,439.39L250.48,440.09L249.87,440.19L249.6,440.78L250.93,442.3L250.17,442.66L249.76,443.08L248.46,443.22L247.97,441.54L247.61,442.02L246.68,441.86L246.12,440.72L244.97,440.54L244.24,440.21L243.04,440.21L242.95,440.82L242.63,440.4L242.78,439.84L243.01,439.27L242.9,438.76L243.32,438.42L242.74,438L242.72,436.87L243.81,436.62L244.81,437.63L244.75,438.23L245.87,438.35L246.14,438.12L246.91,438.82L248.29,438.61L249.48,437.9L251.18,437.33L252.14,436.49L253.69,436.65L253.58,436.93L255.15,437.03L256.4,437.52L257.31,438.36L258.37,439.14L258.03,439.56L258.68,441.21L258.15,442.05L257.24,441.85z"},{"code":"PE","name":"Peru","path":"M280.13,513.14L279.38,514.65L277.94,515.39L275.13,513.71L274.88,512.51L269.33,509.59L264.3,506.42L262.13,504.64L260.97,502.27L261.43,501.44L259.06,497.69L256.29,492.45L253.65,486.83L252.5,485.54L251.62,483.48L249.44,481.64L247.44,480.51L248.35,479.26L246.99,476.59L247.86,474.64L250.1,472.87L250.43,474.04L249.63,474.7L249.7,475.72L250.86,475.5L252,475.8L253.17,477.21L254.76,476.06L255.29,474.18L257.01,471.75L260.38,470.65L263.44,467.73L264.31,465.92L263.92,463.81L264.67,463.54L266.53,464.86L267.42,466.18L268.72,466.9L270.37,469.82L272.46,470.17L274.01,469.43L275.02,469.91L276.7,469.67L278.85,470.98L277.04,473.82L277.88,473.88L279.28,475.37L276.75,475.24L276.38,475.66L274.08,476.19L270.88,478.1L270.67,479.4L269.96,480.38L270.24,481.89L268.54,482.7L268.54,483.89L267.8,484.4L268.97,486.93L270.53,488.65L269.94,489.86L271.8,490.02L272.86,491.53L275.33,491.6L277.63,489.94L277.44,494.24L278.72,494.57L280.3,494.08L282.73,498.66L282.12,499.62L281.99,501.64L281.93,504.08L280.83,505.52L281.34,506.59L280.69,507.56L281.9,510z"},{"code":"PG","name":"Papua New Guinea","path":"M912.32,482.42l-0.79,0.28l-1.21,-1.08l-1.23,-1.78l-0.6,-2.13l0.39,-0.27l0.3,0.83l0.85,0.63l1.36,1.77l1.32,0.95L912.32,482.42zM901.39,478.67l-1.47,0.23l-0.44,0.79l-1.53,0.68l-1.44,0.66l-1.49,0l-2.3,-0.81l-1.6,-0.78l0.23,-0.87l2.51,0.41l1.53,-0.22l0.42,-1.34l0.4,-0.07l0.27,1.49l1.6,-0.21l0.79,-0.96l1.57,-1l-0.31,-1.65l1.68,-0.05l0.57,0.46l-0.06,1.55L901.39,478.67zM887.96,484.02l2.5,1.84l1.82,2.99l1.61,-0.09l-0.11,1.25l2.17,0.48l-0.84,0.53l2.98,1.19l-0.31,0.82l-1.86,0.2l-0.69,-0.73l-2.41,-0.32l-2.83,-0.43l-2.18,-1.8l-1.59,-1.55l-1.46,-2.46l-3.66,-1.23l-2.38,0.8l-1.71,0.93l0.36,2.08l-2.2,0.97l-1.57,-0.47l-2.9,-0.12l-0.05,-9.16l-0.05,-9.1l4.87,1.92l5.18,1.6l1.93,1.43l1.56,1.41l0.43,1.65l4.67,1.73l0.68,1.49l-2.58,0.3L887.96,484.02zM904.63,475.93l-0.88,0.74l-0.53,-1.65l-0.65,-1.08l-1.27,-0.91l-1.6,-1.19l-2.02,-0.82l0.78,-0.67l1.51,0.78l0.95,0.61l1.18,0.67l1.12,1.17l1.07,0.89L904.63,475.93z"},{"code":"PH","name":"Philippines","path":"M829.59,439.86l0.29,1.87l0.17,1.58l-0.96,2.57l-1.02,-2.86l-1.31,1.42l0.9,2.06l-0.8,1.31l-3.3,-1.63l-0.79,-2.03l0.86,-1.33l-1.78,-1.33l-0.88,1.17l-1.32,-0.11l-2.08,1.57l-0.46,-0.82l1.1,-2.37l1.77,-0.79l1.53,-1.06l0.99,1.27l2.13,-0.77l0.46,-1.26l1.98,-0.08l-0.17,-2.18l2.27,1.34l0.24,1.42L829.59,439.86zM822.88,434.6l-1.01,0.93l-0.88,1.79l-0.88,0.84l-1.73,-1.95l0.58,-0.76l0.7,-0.79l0.31,-1.76l1.55,-0.17l-0.45,1.91l2.08,-2.74L822.88,434.6zM807.52,437.32l-3.73,2.67l1.38,-1.97l2.03,-1.74l1.68,-1.96l1.47,-2.82l0.5,2.31l-1.85,1.56L807.52,437.32zM817,430.02l1.68,0.88l1.78,0l-0.05,1.19l-1.3,1.2l-1.78,0.85l-0.1,-1.32l0.2,-1.45L817,430.02zM827.14,429.25l0.79,3.18l-2.16,-0.75l0.06,0.95l0.69,1.75l-1.33,0.63l-0.12,-1.99l-0.84,-0.15l-0.44,-1.72l1.65,0.23l-0.04,-1.08l-1.71,-2.18l2.69,0.06L827.14,429.25zM816,426.66l-0.74,2.47l-1.2,-1.42l-1.43,-2.18l2.4,0.1L816,426.66zM815.42,410.92l1.73,0.84l0.86,-0.76l0.25,0.75l-0.46,1.22l0.96,2.09l-0.74,2.42l-1.65,0.96l-0.44,2.33l0.63,2.29l1.49,0.32l1.24,-0.34l3.5,1.59l-0.27,1.56l0.92,0.69l-0.29,1.32l-2.18,-1.4l-1.04,-1.5l-0.72,1.05l-1.79,-1.72l-2.55,0.42l-1.4,-0.63l0.14,-1.19l0.88,-0.73l-0.84,-0.67l-0.36,1.04l-1.38,-1.65l-0.42,-1.26l-0.1,-2.77l1.13,0.96l0.29,-4.55l0.91,-2.66L815.42,410.92z"},{"code":"PL","name":"Poland","path":"M517.36,296.97L516.21,294.11L516.43,292.55L515.73,290.1L514.72,288.45L515.5,287.2L514.84,284.81L516.76,283.42L521.13,281.2L524.67,279.56L527.46,280.38L527.67,281.56L530.38,281.62L533.83,282.17L538.99,282.09L540.43,282.61L541.1,284.07L541.22,286.16L542,287.94L541.98,289.79L540.3,290.73L541.17,292.85L541.22,294.86L542.63,298.75L542.33,299.99L540.94,300.5L538.39,304.11L539.11,306.03L538.5,305.78L535.84,304.14L533.82,304.74L532.5,304.3L530.84,305.22L529.43,303.7L528.27,304.28L528.11,304.02L526.82,301.89L524.74,301.63L524.47,300.26L522.55,299.77L522.13,300.9L520.61,300L520.78,298.79L518.69,298.4z"},{"code":"PK","name":"Pakistan","path":"M685.99,351.76L688.06,353.39L688.89,356.05L693.5,357.44L690.79,360.3L687.67,360.81L683.41,359.98L682.04,361.44L683.03,364.39L684,366.64L686.27,368.27L683.88,370.18L683.92,372.51L681.2,375.75L679.44,379.01L676.51,382.33L673.25,382.09L670.16,385.39L672,386.79L672.32,389.18L673.89,390.74L674.45,393.38L668.28,393.37L666.41,395.41L664.36,394.64L663.52,392.44L661.35,390.1L656.19,390.68L651.63,390.73L647.68,391.17L648.74,387.57L652.78,385.96L652.55,384.52L651.21,384.01L651.13,381.24L648.45,379.84L647.32,377.91L645.94,376.23L650.63,377.87L653.44,377.39L655.11,377.79L655.68,377.09L657.63,377.37L661.28,376.04L661.38,373.29L662.94,371.45L665.03,371.45L665.33,370.54L667.48,370.11L668.51,370.41L669.61,369.49L669.46,367.51L670.65,365.51L672.43,364.66L671.33,362.44L674,362.55L674.77,361.33L674.65,360.03L676.05,358.6L675.72,356.9L675.06,355.44L676.7,353.93L679.71,353.2L682.93,352.8L684.35,352.15z"},{"code":"PR","name":"Puerto Rico","path":"M289.41,410.89L290.84,411.15L291.35,411.73L290.63,412.47L288.52,412.45L286.88,412.55L286.72,411.3L287.11,410.87z"},{"code":"PS","name":"Palestinian Territories","path":"M574.92,367.87L574.92,369.88L574.5,370.84L573.18,371.29L573.31,370.43L574.02,369.97L573.32,369.61L573.9,367.41z"},{"code":"PT","name":"Portugal","path":"M449.92,334.56L450.94,333.61L452.08,333.06L452.79,334.9L454.44,334.89L454.92,334.42L456.56,334.55L457.34,336.43L456.04,337.43L456.01,340.31L455.55,340.84L455.44,342.56L454.23,342.86L455.35,345.03L454.58,347.38L455.54,348.44L455.16,349.4L454.12,350.72L454.35,351.88L453.23,352.79L451.75,352.3L450.3,352.68L450.73,349.94L450.47,347.76L449.21,347.43L448.54,346.08L448.77,343.72L449.88,342.41L450.08,340.94L450.67,338.73L450.6,337.16L450.04,335.82z"},{"code":"PY","name":"Paraguay","path":"M299.49,526.99L300.6,523.4L300.67,521.8L302.01,519.18L306.9,518.32L309.5,518.37L312.12,519.88L312.16,520.79L312.99,522.45L312.81,526.51L315.77,527.09L316.91,526.5L318.8,527.32L319.33,528.22L319.59,530.99L319.92,532.17L320.96,532.3L322.01,531.81L323.02,532.36L323.02,534.04L322.64,535.86L322.09,537.64L321.63,540.39L319.09,542.79L316.87,543.29L313.72,542.81L310.9,541.96L313.66,537.23L313.25,535.86L310.37,534.66L306.94,532.4L304.65,531.94z"},{"code":"QA","name":"Qatar","path":"M617.72,392.16L617.53,389.92L618.29,388.3L619.05,387.96L619.9,388.93L619.95,390.74L619.34,392.55L618.56,392.77z"},{"code":"RO","name":"Romania","path":"M538.93,310.86L540.14,309.97L541.88,310.43L543.67,310.45L544.97,311.46L545.93,310.82L548,310.42L548.71,309.44L549.89,309.45L550.74,309.85L551.61,311.09L552.5,312.84L554.12,315.28L554.21,317.07L553.91,318.79L554.42,320.62L555.67,321.35L556.98,320.71L558.26,321.39L558.32,322.42L556.96,323.26L556.11,322.9L555.33,327.61L553.68,327.2L551.64,325.79L548.34,326.69L546.95,327.68L542.83,327.48L540.67,326.87L539.59,327.16L538.78,325.56L538.27,324.88L538.92,324.22L538.22,323.73L537.34,324.61L535.71,323.47L535.49,321.84L533.78,320.9L533.47,319.63L531.95,318.05L534.2,317.29L535.89,314.53L537.22,311.73z"},{"code":"RS","name":"Serbia","path":"M533.78,320.9L535.49,321.84L535.71,323.47L537.34,324.61L538.22,323.73L538.92,324.22L538.27,324.88L538.78,325.56L538.09,326.44L538.34,327.86L539.7,329.52L538.63,330.71L538.16,331.92L538.47,332.37L538,332.91L536.71,332.97L535.75,333.19L535.66,332.91L535.99,332.46L536.31,331.53L535.91,331.55L535.36,330.85L534.9,330.67L534.54,330.06L534.01,329.82L533.61,329.28L533.11,329.5L532.72,330.76L532.05,331.04L532.28,330.71L531.21,329.92L530.29,329.51L529.88,328.97L529.14,328.31L529.8,328.14L530.21,326.32L528.86,324.82L529.56,323.1L528.54,323.11L529.62,321.62L528.73,320.48L528.05,318.93L530.2,317.88L531.95,318.05L533.47,319.63z"},{"code":"RU","name":"Russia","path":"M1008.27,215.75l-2.78,2.97l-4.6,0.7l-0.07,6.46l-1.12,1.35l-2.63,-0.19l-2.14,-2.26l-3.73,-1.92l-0.63,-2.89l-2.85,-1.1l-3.19,0.87l-1.52,-2.37l0.61,-2.55l-3.36,1.64l1.26,3.19l-1.59,2.83l-0.02,0.04l-3.6,2.89l-3.63,-0.48l2.53,3.44l1.67,5.2l1.29,1.67l0.33,2.53l-0.72,1.6l-5.23,-1.32l-7.84,4.51l-2.49,0.69l-4.29,4.1l-4.07,3.5l-1.03,2.55l-4.01,-3.9l-7.31,4.42l-1.28,-2.08l-2.7,2.39l-3.75,-0.76l-0.9,3.63l-3.36,5.22l0.1,2.14l3.19,1.17l-0.38,7.46l-2.6,0.19l-1.2,4.15l1.17,2.1l-4.9,2.47l-0.97,5.4l-4.18,1.14l-0.84,4.66l-4.04,4.18l-1.04,-3.08l-1.2,-6.69l-1.56,-10.65l1.35,-6.95l2.37,-3.07l0.15,-2.44l4.36,-1.18l5.01,-6.78l4.83,-5.73l5.04,-4.57l2.25,-8.37l-3.41,0.51l-1.68,4.92l-7.11,6.36l-2.3,-7.14l-7.24,2l-7.02,9.56l2.32,3.38l-6.26,1.42l-4.33,0.56l0.2,-3.95l-4.36,-0.84l-3.47,2.7l-8.57,-0.94l-9.22,1.62l-9.08,10.33l-10.75,11.78l4.42,0.61l1.38,3l2.72,1.05l1.79,-2.38l3.08,0.31l4.05,5.19l0.09,3.92l-2.19,4.51l-0.24,5.27l-1.26,6.85l-4.23,6.01l-0.94,2.82l-3.81,4.66l-3.78,4.53l-1.81,2.28l-3.74,2.25l-1.77,0.05l-1.76,-1.86l-3.76,2.79l-0.44,1.26l-0.39,-0.66l-0.02,-1.93l1.43,-0.1l0.4,-4.55l-0.74,-3.36l2.41,-1.4l3.4,0.7l1.89,-3.89l0.96,-4.46l1.09,-1.51l1.47,-3.76l-4.63,1.24l-2.43,1.65l-4.26,0l-1.13,-3.95l-3.32,-3.03l-4.88,-1.38l-1.04,-4.28l-0.98,-2.73l-1.05,-1.94l-1.73,-4.61l-2.46,-1.71l-4.2,-1.39l-3.72,0.13l-3.48,0.84l-2.32,2.31l1.54,1.1l0.04,2.52l-1.56,1.45l-2.53,4.72l0.03,1.93l-3.95,2.74l-3.37,-1.63l-3.35,0.36l-1.47,-1.46l-1.68,-0.47l-4.11,3.06l-3.69,0.71l-2.58,1.06l-3.53,-0.7l-2.6,0.04l-1.7,-2.2l-2.75,-2.09l-2.81,-0.58l-3.55,0.57l-2.65,0.81l-3.98,-1.84l-0.53,-3.32l-3.3,-1.15l-2.54,-0.53l-3.14,-1.87l-2.9,4.66l1.14,2.6l-2.73,3.03l-4.05,-1.09l-2.8,-0.16l-1.87,-2.04l-2.92,-0.06l-2.44,-1.35l-4.26,2.07l-5.35,3.74l-2.96,0.74l-1.1,0.35l-1.49,-2.63l-3.61,0.58l-1.19,-1.84l-1.96,-0.85l-1.35,-2.55l-1.55,-0.8l-4.03,1.14l-3.86,-2.57l-1.49,2.33l-6.27,-11.58l-3.58,-3.66l1.03,-1.5l-7.03,4.49l-2.69,0.27l0.23,-2.58l-3.6,-1.63l-2.93,1.17l-0.88,-5.01l-5.04,-1.06l-2.52,2.03l-7.02,1.79l-1.37,1.19l-10.49,1.66l-1.29,1.62l2.02,3.21l-2.69,1.2l0.53,1.25l-2.69,2.22l4.54,3.1l-0.7,2.11l-3.94,-0.19l-0.81,1.31l-3.59,-2.29l-4.45,0.09l-2.98,1.87l-3.32,-1.79l-6.18,-3.1l-4.38,0.12l-5.79,4.85l-0.35,3.19l-2.88,-2.53l-2.24,4.77l0.82,0.87l-1.62,3.21l2.38,2.84l2.08,-0.12l1.79,2.76l-0.28,2.1l1.42,0.66l-1.28,2.39l-2.72,0.66l-2.79,4.09l2.55,3.7l-0.28,2.59l3.06,4.46l-1.67,1.51l-0.48,0.95l-1.24,-0.25l-1.93,-2.27l-0.79,-0.13l-1.76,-0.87l-0.86,-1.55l-2.62,-0.79l-1.7,0.6l-0.49,-0.71l-3.82,-1.83l-4.13,-0.62l-2.37,-0.66l-0.34,0.45l-3.57,-3.27l-3.2,-1.48l-2.42,-2.32l2.04,-0.64l2.33,-3.35l-1.57,-1.6l4.13,-1.67l-0.07,-0.9l-2.52,0.66l0.09,-1.83l1.45,-1.16l2.71,-0.31l0.44,-1.4l-0.62,-2.33l1.14,-2.23l-0.03,-1.26l-4.13,-1.41l-1.64,0.05l-1.73,-2.04l-2.15,0.69l-3.56,-1.54l0.06,-0.87l-1,-1.93l-2.24,-0.22l-0.23,-1.39l0.7,-0.91l-1.79,-2.58l-2.91,0.44l-0.85,-0.23l-0.71,1.04l-1.05,-0.18l-0.69,-2.94l-0.66,-1.54l0.54,-0.44l2.26,0.16l1.09,-1.02l-0.81,-1.25l-1.89,-0.83l0.17,-0.86l-1.14,-0.87l-1.76,-3.15l0.6,-1.31l-0.27,-2.31l-2.74,-1.18l-1.47,0.59l-0.4,-1.24l-2.95,-1.26l-0.9,-2.99l-0.24,-2.49l-1.35,-1.19l1.2,-1.66l-0.83,-4.96l2,-3.13l-0.42,-0.96l3.19,-3.07l-2.94,-2.68l6,-7.41l2.6,-3.45l1.05,-3.1l-4.15,-4.26l1.15,-4.15l-2.52,-4.85l1.89,-5.76l-3.26,-7.96l2.59,-5.48l-4.29,-4.99l0.41,-5.4l2.26,-0.72l4.77,-3.19l2.89,-2.81l4.61,4.86l7.68,1.88l10.59,8.65l2.15,3.51l0.19,4.8l-3.11,3.69l-4.58,1.85l-12.52,-5.31l-2.06,0.9l4.57,5.1l0.18,3.15l0.18,6.75l3.61,1.97l2.19,1.66l0.36,-3.11l-1.69,-2.8l1.78,-2.51l6.78,4.1l2.36,-1.59l-1.89,-4.88l6.53,-6.74l2.59,0.4l2.62,2.43l1.63,-4.81l-2.34,-4.28l1.37,-4.41l-2.06,-4.69l7.84,2.44l1.6,4.18l-3.55,0.91l0.02,4.04l2.21,2.44l4.33,-1.54l0.69,-4.61l5.86,-3.52l9.79,-6.54l2.11,0.38l-2.76,4.64l3.48,0.78l2.01,-2.58l5.25,-0.21l4.16,-3.19l3.2,4.62l3.19,-5.09l-2.94,-4.58l1.46,-2.66l8.28,2.44l3.88,2.49l10.16,8.8l1.88,-3.97l-2.85,-4.11l-0.08,-1.68l-3.38,-0.78l0.92,-3.83l-1.5,-6.49l-0.08,-2.74l5.17,-7.99l1.84,-8.42l2.08,-1.88l7.42,2.51l0.58,5.18l-2.66,7.28l1.74,2.78l0.9,5.94l-0.64,11.07l3.09,4.73l-1.2,5.01l-5.49,10.2l3.21,1.02l1.12,-2.51l3.08,-1.82l0.74,-3.55l2.43,-3.49l-1.63,-4.26l1.31,-5.08l-3.07,-0.64l-0.67,-4.42l2.24,-8.28l-3.64,-7.03l5.02,-6.04l-0.65,-6.62l1.4,-0.22l1.47,5.19l-1.11,8.67l3,1.59l-1.28,-6.37l4.69,-3.58l5.82,-0.49l5.18,5.18l-2.49,-7.62l-0.28,-10.28l4.88,-2.02l6.74,0.44l6.08,-1.32l-2.28,-5.38l3.25,-7.02l3.22,-0.3l5.45,-5.51l7.4,-1.51l0.94,-3.15l7.36,-1.08l2.29,2.61l6.29,-6.24l5.15,0.2l0.77,-5.24l2.68,-5.33l6.62,-5.31l4.81,4.21l-3.82,3.13l6.35,1.92l0.76,6.03l2.56,-2.94l8.2,0.16l6.32,5.84l2.25,4.35l-0.7,5.85l-3.1,3.24l-7.37,5.92l-2.11,3.08l3.48,1.43l4.15,2.55l2.52,-1.91l1.43,6.39l1.23,-2.56l4.48,-1.57l9,1.65l0.68,4.58l11.72,1.43l0.16,-7.47l5.95,1.74l4.48,-0.05l4.53,5.14l1.29,6.04l-1.66,3.84l3.52,6.98l4.41,3.49l2.71,-9.18l4.5,4l4.78,-2.38l5.43,2.72l2.07,-2.47l4.59,1.24l-2.02,-8.4l3.7,-4.07l25.32,6.06l2.39,5.35l7.34,6.65l11.32,-1.62l5.58,1.41l2.33,3.5l-0.34,6.02l3.45,2.29l3.75,-1.64l4.97,-0.21l5.29,1.57l5.31,-0.89l4.88,6.99l3.47,-2.48l-2.27,-5.07l1.25,-3.62l8.95,2.29l5.83,-0.49l8.06,3.84l3.92,3.44l6.87,5.86l7.35,7.34l-0.24,4.44l1.89,1.74l-0.65,-5.15l7.61,1.07L1008.27,215.75zM880.84,306.25l-2.82,-7.68l-1.16,-4.51l0.07,-4.5l-0.97,-4.5l-0.73,-3.15l-1.25,0.67l1.11,2.21l-2.59,2.17l-0.25,6.3l1.64,4.41l-0.12,5.85l-0.65,3.24l0.32,4.54l-0.31,4.01l0.52,3.4l1.84,-3.13l2.13,2.44l0.08,-2.84l-2.73,-4.23l1.72,-6.11L880.84,306.25zM537.82,278.77l-2.94,-0.86l-3.87,1.58l-0.64,2.13l3.45,0.55l5.16,-0.07l-0.22,-1.23l0.3,-1.33L537.82,278.77zM979.95,178.65l3.66,-0.52l2.89,-2.06l0.24,-1.19l-4.06,-2.51l-2.38,-0.02l-0.36,0.37l-3.57,3.64l0.5,2.73L979.95,178.65zM870.07,151.56l-2.66,3.92l0.49,0.52l5.75,1.08l4.25,-0.07l-0.34,-2.57l-3.98,-3.81L870.07,151.56zM894.64,142.03l3.24,-4.25l-7.04,-2.88l-5.23,-1.68l-0.67,3.59l5.21,4.27L894.64,142.03zM869.51,140.34l10.33,0.3l2.21,-8.14l-10.13,-6.07l-7.4,-0.51l-3.7,2.18l-1.51,7.75l5.55,7.01L869.51,140.34zM622.39,166.28l-2.87,1.96l0.41,4.83l5.08,2.35l0.74,3.82l9.16,1.1l1.66,-0.74l-5.36,-7.11l-0.57,-7.52l4.39,-9.14l4.18,-9.82l8.71,-10.17l8.56,-5.34l9.93,-5.74l1.88,-3.71l-1.95,-4.83l-5.46,1.6l-4.8,4.49l-9.33,2.22l-9.26,7.41l-6.27,5.85l0.76,4.87l-6.71,9.03l2.58,1.22l-5.56,8.27L622.39,166.28zM769.87,98.34l0.83,-5.72l-7.11,-8.34l-2.11,-0.98l-2.3,1.7l-5.12,18.6L769.87,98.34zM605.64,69.03l3.04,3.88l3.28,-2.69l0.39,-2.72l2.52,-1.27l3.76,-2.23l1.08,-2.62l-4.16,-3.85l-2.64,2.9l-1.61,4.12l-0.57,-4.65l-4.26,0.21L601,63.25l6.24,0.52L605.64,69.03zM736.89,82.07l4.65,5.73l7.81,4.2l6.12,-1.8l0.69,-13.62l-6.46,-16.04l-5.45,-9.02l-6.07,4.11l-7.28,11.83l3.83,3.27L736.89,82.07z"},{"code":"RW","name":"Rwanda","path":"M560.54,466.55L561.66,468.12L561.49,469.76L560.69,470.11L559.2,469.93L558.34,471.52L556.63,471.3L556.89,469.77L557.28,469.56L557.38,467.9L558.19,467.12L558.87,467.41z"},{"code":"SA","name":"Saudi Arabia","path":"M595.2,417.22L594.84,415.98L593.99,415.1L593.77,413.93L592.33,412.89L590.83,410.43L590.04,408.02L588.1,405.98L586.85,405.5L584.99,402.65L584.67,400.57L584.79,398.78L583.18,395.42L581.87,394.23L580.35,393.6L579.43,391.84L579.58,391.15L578.8,389.55L577.98,388.86L576.89,386.54L575.18,384.02L573.75,381.86L572.36,381.87L572.79,380.13L572.92,379.02L573.26,377.74L576.38,378.25L577.6,377.27L578.27,376.11L580.41,375.67L580.87,374.58L581.8,374.04L579,370.78L584.62,369.13L585.15,368.64L588.53,369.53L592.71,371.82L600.61,378.31L605.82,378.57L608.32,378.88L609.02,380.39L611,380.31L612.1,383.04L613.48,383.75L613.96,384.86L615.87,386.17L616.04,387.46L615.76,388.49L616.12,389.53L616.92,390.4L617.3,391.41L617.72,392.16L618.56,392.77L619.34,392.55L619.87,393.72L619.98,394.43L621.06,397.51L629.48,399.03L630.05,398.39L631.33,400.53L629.46,406.5L621.05,409.46L612.97,410.59L610.35,411.91L608.34,414.98L607.03,415.46L606.33,414.49L605.26,414.64L602.55,414.35L602.03,414.05L598.8,414.12L598.04,414.39L596.89,413.63L596.14,415.06L596.43,416.29z"},{"code":"SB","name":"Solomon Islands","path":"M929.81,492.75l0.78,0.97l-1.96,-0.02l-1.07,-1.74l1.67,0.69L929.81,492.75zM926.26,491.02l-1.09,0.06l-1.72,-0.29l-0.59,-0.44l0.18,-1.12l1.85,0.44l0.91,0.59L926.26,491.02zM928.58,490.25l-0.42,0.52l-2.08,-2.45l-0.58,-1.68h0.95l1.01,2.25L928.58,490.25zM923.52,486.69l0.12,0.57l-2.2,-1.19l-1.54,-1.01l-1.05,-0.94l0.42,-0.29l1.29,0.67l2.3,1.29L923.52,486.69zM916.97,483.91l-0.56,0.16l-1.23,-0.64l-1.15,-1.15l0.14,-0.47l1.67,1.18L916.97,483.91z"},{"code":"SD","name":"Sudan","path":"M570.48,436.9L570.09,436.85L570.14,435.44L569.8,434.47L568.36,433.35L568.02,431.3L568.36,429.2L567.06,429.01L566.87,429.64L565.18,429.79L565.86,430.62L566.1,432.33L564.56,433.89L563.16,435.93L561.72,436.22L559.36,434.57L558.3,435.15L558.01,435.98L556.57,436.51L556.47,437.09L553.68,437.09L553.29,436.51L551.27,436.41L550.26,436.9L549.49,436.65L548.05,435L547.57,434.23L545.54,434.62L544.77,435.93L544.05,438.45L543.09,438.98L542.23,439.29L542,439.15L541.03,438.34L540.85,437.47L541.3,436.29L541.3,435.14L539.68,433.37L539.36,432.15L539.39,431.46L538.36,430.63L538.33,428.97L537.75,427.87L536.76,428.04L537.04,426.99L537.77,425.79L537.45,424.61L538.37,423.73L537.79,423.06L538.53,421.28L539.81,419.15L542.23,419.35L542.09,407.74L542.13,406.5L545.35,406.49L545.35,400.53L556.62,400.53L567.5,400.53L578.62,400.53L579.52,403.47L578.91,404.01L579.32,407.07L580.35,410.59L581.41,411.32L582.95,412.4L581.53,414.07L579.46,414.55L578.58,415.45L578.31,417.38L577.1,421.63L577.4,422.78L576.95,425.25L575.81,428.06L574.12,429.48L572.92,431.65L572.63,432.81L571.31,433.61L570.48,436.57z"},{"code":"SE","name":"Sweden",labelCoordinate: {x: 0.5,y: 0.3},"path":"M537.45,217.49L534.73,222.18L535.17,226.2L530.71,231.33L525.3,236.67L523.25,245.08L525.25,249.15L527.93,252.29L525.36,258.52L522.44,259.78L521.37,268.62L519.78,273.38L516.38,272.89L514.79,276.84L511.54,277.07L510.65,272.36L508.3,266.55L506.17,259.05L507.41,255.9L509.74,252.09L510.67,245.36L508.88,242.38L508.7,234.34L510.53,228.43L513.31,228.54L514.28,225.99L513.26,223.76L517.61,214.26L520.42,206.39L522.27,201.15L524.96,201.17L525.71,196.96L530.99,198.18L531.4,193.1L533.14,192.77L536.88,196.58L541.25,201.73L541.33,212.85L542.27,215.55z"},{"code":"SI","name":"Slovenia","path":"M513.96,316.51L516.28,316.82L517.7,315.9L520.15,315.8L520.68,315.11L521.15,315.16L521.7,316.53L519.47,317.61L519.19,319.23L518.22,319.64L518.23,320.76L517.13,320.68L516.18,320.03L515.66,320.71L513.71,320.57L514.33,320.21L513.66,318.5z"},{"code":"SJ","name":"Svalbard and Jan Mayen","path":"M544.58,104.49l-6.26,5.36l-4.95,-3.02l1.94,-3.42l-1.69,-4.34l5.81,-2.78l1.11,5.18L544.58,104.49zM526.43,77.81l9.23,11.29l-7.06,5.66l-1.56,10.09l-2.46,2.49l-1.33,10.51l-3.38,0.48l-6.03,-7.64l2.54,-4.62l-4.2,-3.86l-5.46,-11.82l-2.18,-11.79l7.64,-5.69l1.54,5.56l3.99,-0.22l1.06,-5.43l4.12,-0.56L526.43,77.81zM546.6,66.35l5.5,5.8l-4.16,8.52l-8.13,1.81l-8.27,-2.56l-0.5,-4.32l-4.02,-0.28l-3.07,-7.48l8.66,-4.72l4.07,4.08l2.84,-5.09L546.6,66.35z"},{"code":"SK","name":"Slovakia","path":"M528.11,304.02L528.27,304.28L529.43,303.7L530.84,305.22L532.5,304.3L533.82,304.74L535.84,304.14L538.5,305.78L537.73,306.89L537.18,308.6L536.58,309.03L533.58,307.75L532.66,308L532,309L530.68,309.52L530.38,309.25L529.02,309.9L527.9,310.03L527.68,310.87L525.32,311.38L524.29,310.92L522.86,309.85L522.58,308.4L522.81,307.86L523.2,306.93L524.45,307L525.4,306.56L525.48,306.17L526.02,305.96L526.2,304.99L526.84,304.8L527.28,304.03z"},{"code":"SL","name":"Sierra Leone","path":"M443.18,444.44L442.42,444.23L440.41,443.1L438.95,441.6L438.46,440.57L438.11,438.49L439.61,437.25L439.93,436.46L440.41,435.85L441.19,435.79L441.84,435.26L444.08,435.26L444.86,436.27L445.47,437.46L445.38,438.28L445.83,439.02L445.8,440.05L446.57,439.89L445.26,441.2L444,442.73L443.85,443.54z"},{"code":"SN","name":"Senegal","path":"M428.39,425.16L427.23,422.92L425.83,421.9L427.07,421.35L428.43,419.32L429.09,417.83L430.05,416.9L431.45,417.15L432.81,416.52L434.38,416.49L435.72,417.34L437.58,418.11L439.28,420.24L441.13,422.22L441.26,424.01L441.81,425.65L442.86,426.46L443.1,427.56L442.97,428.45L442.56,428.61L441.04,428.39L440.83,428.7L440.21,428.77L438.19,428.07L436.84,428.04L431.66,427.92L430.91,428.24L429.98,428.15L428.49,428.62L428.03,426.43L430.58,426.49L431.26,426.09L431.76,426.06L432.8,425.4L434,426.01L435.22,426.06L436.43,425.41L435.87,424.59L434.94,425.07L434.07,425.06L432.97,424.35L432.08,424.4L431.44,425.07z"},{"code":"SO","name":"Somalia","path":"M618.63,430.43L618.56,429.64L617.5,429.65L616.17,430.63L614.68,430.91L613.39,431.33L612.5,431.39L610.9,431.49L609.9,432.01L608.51,432.2L606.04,433.08L602.99,433.41L600.34,434.14L598.95,434.13L597.69,432.94L597.14,431.77L596.23,431.24L595.19,432.76L594.58,433.77L595.62,435.33L596.65,436.69L597.72,437.7L606.89,441.04L609.25,441.02L601.32,449.44L597.67,449.56L595.17,451.53L593.38,451.58L592.61,452.46L590.16,455.63L590.19,465.78L591.85,468.07L592.48,467.41L593.13,465.95L596.2,462.57L598.81,460.45L603.01,457.69L605.81,455.43L609.11,451.62L611.5,448.49L613.91,444.39L615.64,440.8L616.99,437.65L617.78,434.6L618.38,433.58L618.37,432.08z"},{"code":"SR","name":"Suriname","path":"M315.02,446.72L318.38,447.28L318.68,446.77L320.95,446.57L323.96,447.33L322.5,449.73L322.72,451.64L323.83,453.3L323.34,454.5L323.09,455.77L322.37,456.94L320.77,456.35L319.44,456.64L318.31,456.39L318.03,457.2L318.5,457.75L318.25,458.32L316.72,458.09L315.01,455.67L314.64,454.1L313.75,454.09L312.5,452.07L313.02,450.62L312.87,449.97L314.57,449.24z"},{"code":"SS","name":"South Sudan","path":"M570.48,436.9L570.51,439.1L570.09,439.96L568.61,440.03L567.65,441.64L569.37,441.84L570.79,443.21L571.29,444.33L572.57,444.98L574.22,448.03L572.32,449.87L570.6,451.54L568.87,452.82L566.9,452.82L564.64,453.47L562.86,452.84L561.71,453.61L559.24,451.75L558.57,450.56L557.01,451.15L555.71,450.96L554.96,451.43L553.7,451.1L552.01,448.79L551.56,447.9L549.46,446.79L548.75,445.11L547.58,443.9L545.7,442.44L545.67,441.52L544.14,440.39L542.23,439.29L543.09,438.98L544.05,438.45L544.77,435.93L545.54,434.62L547.57,434.23L548.05,435L549.49,436.65L550.26,436.9L551.27,436.41L553.29,436.51L553.68,437.09L556.47,437.09L556.57,436.51L558.01,435.98L558.3,435.15L559.36,434.57L561.72,436.22L563.16,435.93L564.56,433.89L566.1,432.33L565.86,430.62L565.18,429.79L566.87,429.64L567.06,429.01L568.36,429.2L568.02,431.3L568.36,433.35L569.8,434.47L570.14,435.44L570.09,436.85z"},{"code":"SV","name":"El Salvador","path":"M229.09,425.76L228.78,426.43L227.16,426.39L226.15,426.12L224.99,425.55L223.43,425.37L222.64,424.75L222.73,424.33L223.69,423.61L224.21,423.29L224.06,422.95L224.72,422.78L225.55,423.02L226.15,423.59L227,424.05L227.1,424.44L228.33,424.1L228.91,424.3L229.29,424.61z"},{"code":"SY","name":"Syria","path":"M584.02,364.6L578.53,368.14L575.41,366.82L575.35,366.8L575.73,366.3L575.69,364.93L576.38,363.1L577.91,361.83L577.45,360.51L576.19,360.33L575.93,357.72L576.61,356.31L577.36,355.56L578.11,354.8L578.27,352.86L579.18,353.54L582.27,352.57L583.76,353.22L586.07,353.21L589.29,351.9L590.81,351.96L594,351.42L592.56,353.6L591.02,354.46L591.29,356.98L590.23,361.1z"},{"code":"SZ","name":"Swaziland","path":"M565.18,540.74L564.61,542.13L562.97,542.46L561.29,540.77L561.27,539.69L562.03,538.52L562.3,537.62L563.11,537.4L564.52,537.97L564.94,539.36z"},{"code":"TD","name":"Chad","path":"M515.9,427.26L516.18,425.92L514.38,425.85L514.39,424L513.22,422.94L514.43,419.14L518.01,416.4L518.15,412.61L519.23,406.63L519.84,405.35L518.68,404.33L518.63,403.38L517.58,402.6L516.89,397.93L519.72,396.27L530.91,402.04L542.09,407.74L542.23,419.35L539.81,419.15L538.53,421.28L537.79,423.06L538.37,423.73L537.45,424.61L537.77,425.79L537.04,426.99L536.76,428.04L537.75,427.87L538.33,428.97L538.36,430.63L539.39,431.46L539.36,432.15L537.59,432.64L536.16,433.78L534.14,436.87L531.5,438.18L528.79,438L528,438.26L528.28,439.25L526.81,440.24L525.62,441.34L522.09,442.41L521.39,441.78L520.93,441.72L520.41,442.44L518.09,442.66L518.53,441.89L517.65,439.96L517.25,438.79L516.03,438.31L514.38,436.66L514.99,435.33L516.27,435.61L517.06,435.41L518.62,435.44L517.1,432.87L517.2,430.98L517.01,429.09z"},{"code":"TF","name":"French Southern and Antarctic Lands","path":"M668.54,619.03L670.34,620.36L672.99,620.9L673.09,621.71L672.31,623.67L668,623.95L667.93,621.66L668.35,619.9z"},{"code":"TG","name":"Togo","path":"M480.48,446.25L478.23,446.84L477.6,445.86L476.85,444.08L476.63,442.68L477.25,440.15L476.55,439.12L476.28,436.9L476.28,434.85L475.11,433.39L475.32,432.5L477.78,432.56L477.42,434.06L478.27,434.89L479.25,435.88L479.35,437.27L479.92,437.85L479.79,444.31z"},{"code":"TH","name":"Thailand","path":"M762.89,429.18L760.37,427.87L757.97,427.93L758.38,425.68L755.91,425.7L755.69,428.84L754.18,432.99L753.27,435.49L753.46,437.54L755.28,437.63L756.42,440.2L756.93,442.63L758.49,444.24L760.19,444.57L761.64,446.02L760.73,447.17L758.87,447.51L758.65,446.07L756.37,444.84L755.88,445.34L754.77,444.27L754.29,442.88L752.8,441.29L751.44,439.96L750.98,441.61L750.45,440.05L750.76,438.29L751.58,435.58L752.94,432.67L754.48,430.02L753.38,427.42L753.43,426.09L753.11,424.49L751.24,422.21L750.57,420.76L751.54,420.23L752.56,417.71L751.42,415.79L749.64,413.66L748.28,411.09L749.46,410.56L750.74,407.37L752.72,407.23L754.36,405.95L755.96,405.26L757.18,406.18L757.34,407.96L759.23,408.09L758.54,411.2L758.61,413.82L761.56,412.08L762.4,412.59L764.05,412.51L764.61,411.49L766.73,411.69L768.86,414.07L769.04,416.94L771.31,419.47L771.18,421.91L770.27,423.21L767.64,422.8L764.02,423.35L762.22,425.73z"},{"code":"TJ","name":"Tajikistan","path":"M674.37,340.62L673.34,341.75L670.29,341.14L670.02,343.24L673.06,342.96L676.53,344.13L681.83,343.58L682.54,346.91L683.46,346.55L685.16,347.36L685.07,348.74L685.49,350.75L682.59,350.75L680.66,350.49L678.92,352.06L677.67,352.4L676.69,353.14L675.58,351.99L675.85,349.04L675,348.87L675.3,347.78L673.79,346.98L672.58,348.21L672.28,349.64L671.85,350.16L670.17,350.09L669.27,351.69L668.32,351.02L666.29,352.14L665.44,351.72L667.01,348.15L666.41,345.49L664.35,344.63L665.08,343.04L667.42,343.21L668.75,341.2L669.64,338.85L673.39,337.99L672.81,339.7L673.21,340.72z"},{"code":"TL","name":"Timor-Leste","path":"M825.65,488.25L825.98,487.59L828.39,486.96L830.35,486.86L831.22,486.51L832.28,486.86L831.25,487.62L828.33,488.85L825.98,489.67L825.93,488.81z"},{"code":"TM","name":"Turkmenistan","path":"M646.88,356.9L646.63,353.99L644.54,353.87L641.34,350.78L639.1,350.39L636,348.6L634,348.27L632.77,348.93L630.9,348.83L628.91,350.85L626.44,351.53L625.92,349.04L626.33,345.31L624.14,344.09L624.86,341.61L623,341.39L623.62,338.3L626.26,339.21L628.73,338.02L626.68,335.79L625.88,333.65L623.62,334.61L623.34,337.34L622.46,334.93L623.7,333.68L626.88,332.89L628.78,333.95L630.74,336.88L632.18,336.7L635.34,336.65L634.88,334.77L637.28,333.47L639.64,331.27L643.42,333.27L643.72,336.26L644.79,337.03L647.82,336.86L648.76,337.53L650.14,341.32L653.35,343.83L655.18,345.52L658.11,347.27L661.84,348.79L661.76,350.95L660.92,350.84L659.59,349.9L659.15,351.15L656.79,351.83L656.23,354.62L654.65,355.67L652.44,356.19L651.85,357.74L649.74,358.2z"},{"code":"TN","name":"Tunisia","path":"M501.84,374.69L500.64,368.83L498.92,367.5L498.89,366.69L496.6,364.71L496.35,362.18L498.08,360.3L498.74,357.48L498.29,354.2L498.86,352.41L501.92,351L503.88,351.42L503.8,353.19L506.18,351.9L506.38,352.57L504.97,354.28L504.96,355.88L505.93,356.73L505.56,359.69L503.71,361.4L504.24,363.23L505.69,363.29L506.4,364.88L507.47,365.4L507.31,367.95L505.94,368.9L505.08,369.95L503.15,371.21L503.45,372.56L503.21,373.94z"},{"code":"TR","name":"Turkey","path":"M578.75,336.6l4.02,1.43l3.27,-0.57l2.41,0.33l3.31,-1.94l2.99,-0.18l2.7,1.83l0.48,1.3l-0.27,1.79l2.08,0.91l1.1,1.06l-1.92,1.03l0.88,4.11l-0.55,1.1l1.53,2.82l-1.34,0.59l-0.98,-0.89l-3.26,-0.45l-1.2,0.55l-3.19,0.54l-1.51,-0.06l-3.23,1.31l-2.31,0.01l-1.49,-0.66l-3.09,0.97l-0.92,-0.68l-0.15,1.94l-0.75,0.76l-0.75,0.76l-1.03,-1.57l1.06,-1.3l-1.71,0.3l-2.35,-0.8l-1.93,2l-4.26,0.39l-2.27,-1.86l-3.02,-0.12l-0.65,1.44l-1.94,0.41l-2.71,-1.85l-3.06,0.06l-1.66,-3.48l-2.05,-1.96l1.36,-2.78l-1.78,-1.72l3.11,-3.48l4.32,-0.15l1.18,-2.81l5.34,0.49l3.37,-2.42l3.27,-1.06l4.64,-0.08L578.75,336.6zM551.5,338.99l-2.34,1.98l-0.88,-1.71l0.04,-0.76l0.67,-0.41l0.87,-2.33l-1.37,-0.99l2.86,-1.18l2.41,0.5l0.33,1.44l2.45,1.2l-0.51,0.91l-3.33,0.2L551.5,338.99z"},{"code":"TT","name":"Trinidad and Tobago","path":"M302.31,433.24L303.92,432.87L304.51,432.97L304.4,435.08L302.06,435.39L301.55,435.14L302.37,434.36z"},{"code":"TW","name":"Taiwan","path":"M816.7,393.27L815.01,398.14L813.81,400.62L812.33,398.07L812.01,395.82L813.66,392.82L815.91,390.5L817.19,391.41z"},{"code":"TZ","name":"Tanzania","path":"M570.31,466.03L570.79,466.34L580.95,472.01L581.15,473.63L585.17,476.42L583.88,479.87L584.04,481.46L585.84,482.48L585.92,483.21L585.15,484.91L585.31,485.76L585.13,487.11L586.11,488.87L587.27,491.66L588.29,492.28L586.06,493.92L583,495.02L581.32,494.98L580.32,495.83L578.37,495.9L577.63,496.26L574.26,495.46L572.15,495.69L571.37,491.83L570.42,490.51L569.85,489.73L567.11,489.21L565.51,488.36L563.73,487.89L562.61,487.41L561.44,486.7L559.93,483.15L558.3,481.58L557.74,479.96L558.02,478.5L557.52,475.93L558.68,475.8L559.69,474.79L560.79,473.33L561.48,472.75L561.45,471.84L560.85,471.21L560.69,470.11L561.49,469.76L561.66,468.12L560.54,466.55L561.53,466.21L564.6,466.25z"},{"code":"UA","name":"Ukraine","path":"M564.38,292.49L565.42,292.68L566.13,291.64L566.98,291.87L569.89,291.43L571.68,294L570.98,294.92L571.21,296.31L573.45,296.52L574.45,298.45L574.39,299.32L577.95,300.86L580.1,300.17L581.83,302.21L583.47,302.17L587.6,303.57L587.63,304.84L586.5,307.07L587.11,309.4L586.67,310.79L583.96,311.1L582.52,312.26L582.43,314.09L580.19,314.42L578.32,315.74L575.7,315.95L573.28,317.47L571.96,318.5L573.45,319.97L574.82,320.93L577.68,320.69L577.13,322.11L574.06,322.79L570.25,325.06L568.7,324.27L569.31,322.42L566.25,321.26L566.75,320.49L569.91,318.86L569.51,318.05L569.06,318.46L568.62,318.24L564.26,317.22L564.07,315.71L561.47,316.21L560.43,318.44L558.26,321.39L556.98,320.71L555.67,321.35L554.42,320.62L555.12,320.18L555.61,318.81L556.38,317.52L556.18,316.8L556.77,316.48L557.04,317.04L558.7,317.15L559.44,316.86L558.92,316.44L559.11,315.84L558.13,314.8L557.73,313.08L556.71,312.41L556.91,311L555.64,309.88L554.49,309.72L552.42,308.41L550.56,308.83L549.89,309.45L548.71,309.44L548,310.42L545.93,310.82L544.98,311.46L543.67,310.45L541.88,310.43L540.14,309.97L538.93,310.86L538.73,309.74L537.18,308.6L537.73,306.89L538.5,305.79L539.12,306.03L538.39,304.11L540.94,300.5L542.33,299.99L542.63,298.75L541.22,294.86L542.56,294.69L544.1,293.46L546.27,293.36L549.1,293.72L552.23,294.8L554.44,294.89L555.49,295.54L556.54,294.76L557.28,295.81L559.81,295.59L560.92,296.02L561.11,293.76L561.97,292.76z"},{"code":"UG","name":"Uganda","path":"M564.6,466.25L561.53,466.21L560.54,466.55L558.87,467.41L558.19,467.12L558.21,465.02L558.86,463.96L559.02,461.72L559.61,460.43L560.68,458.97L561.76,458.23L562.66,457.24L561.54,456.87L561.71,453.61L562.86,452.84L564.64,453.47L566.9,452.82L568.87,452.82L570.6,451.54L571.93,453.48L572.26,454.88L573.49,458.08L572.47,460.11L571.09,461.95L570.29,463.08L570.31,466.03z"},{"code":"US","name":"United States",labelCoordinate:{x:0.68,y:0.75},"path":"M109.25,279.8L109.25,279.8l-1.54,-1.83l-2.47,-1.57l-0.79,-4.36l-3.61,-4.13l-1.51,-4.94l-2.69,-0.34l-4.46,-0.13l-3.29,-1.54l-5.8,-5.64l-2.68,-1.05l-4.9,-1.99l-3.88,0.48l-5.51,-2.59l-3.33,-2.43l-3.11,1.21l0.58,3.93l-1.55,0.36l-3.24,1.16l-2.47,1.86l-3.11,1.16l-0.4,-3.24l1.26,-5.53l2.98,-1.77l-0.77,-1.46l-3.57,3.22l-1.91,3.77l-4.04,3.95l2.05,2.65l-2.65,3.85l-3.01,2.21l-2.81,1.59l-0.69,2.29l-4.38,2.63l-0.89,2.36l-3.28,2.13l-1.92,-0.38l-2.62,1.38l-2.85,1.67l-2.33,1.63l-4.81,1.38l-0.44,-0.81l3.07,-2.27l2.74,-1.51l2.99,-2.71l3.48,-0.56l1.38,-2.06l3.89,-3.05l0.63,-1.03l2.07,-1.83l0.48,-4l1.43,-3.17l-3.23,1.64l-0.9,-0.93l-1.52,1.95l-1.83,-2.73l-0.76,1.94l-1.05,-2.7l-2.8,2.17l-1.72,0l-0.24,-3.23l0.51,-2.02l-1.81,-1.98l-3.65,1.07l-2.37,-2.63l-1.92,-1.36l-0.01,-3.25l-2.16,-2.48l1.08,-3.41l2.29,-3.37l1,-3.15l2.27,-0.45l1.92,0.99l2.26,-3.01l2.04,0.54l2.14,-1.96l-0.52,-2.92l-1.57,-1.16l2.08,-2.52l-1.72,0.07l-2.98,1.43l-0.85,1.43l-2.21,-1.43l-3.97,0.73l-4.11,-1.56l-1.18,-2.65l-3.55,-3.91l3.94,-2.87l6.25,-3.41h2.31l-0.38,3.48l5.92,-0.27l-2.28,-4.34l-3.45,-2.72l-1.99,-3.64l-2.69,-3.17l-3.85,-2.38l1.57,-4.03l4.97,-0.25l3.54,-3.58l0.67,-3.92l2.86,-3.91l2.73,-0.95l5.31,-3.76l2.58,0.57l4.31,-4.61l4.24,1.83l2.03,3.87l1.25,-1.65l4.74,0.51l-0.17,1.95l4.29,1.43l2.86,-0.84l5.91,2.64l5.39,0.78l2.16,1.07l3.73,-1.34l4.25,2.46l3.05,1.13l-0.02,27.65l-0.01,35.43l2.76,0.17l2.73,1.56l1.96,2.44l2.49,3.6l2.73,-3.05l2.81,-1.79l1.49,2.85l1.89,2.23l2.57,2.42l1.75,3.79l2.87,5.88l4.77,3.2l0.08,3.12L109.25,279.8zM285.18,314.23l-1.25,-1.19l-1.88,0.7l-0.93,-1.08l-2.14,3.1l-0.86,3.15l-1,1.82l-1.19,0.62l-0.9,0.2l-0.28,0.98l-5.17,0l-4.26,0.03l-1.27,0.73l-2.87,2.73l0.29,0.54l0.17,1.51l-2.1,1.27l-2.3,-0.32l-2.2,-0.14l-1.33,0.44l0.25,1.15l0,0l0.05,0.37l-2.42,2.27l-2.11,1.09l-1.44,0.51l-1.66,1.03l-2.03,0.5l-1.4,-0.19l-1.73,-0.77l0.96,-1.45l0.62,-1.32l1.32,-2.09l-0.14,-1.57l-0.5,-2.24l-1.04,-0.39l-1.74,1.7l-0.56,-0.03l-0.14,-0.97l1.54,-1.56l0.26,-1.79l-0.23,-1.79l-2.08,-1.55l-2.38,-0.8l-0.39,1.52l-0.62,0.4l-0.5,1.95l-0.26,-1.33l-1.12,0.95l-0.7,1.32l-0.73,1.92l-0.14,1.64l0.93,2.38l-0.08,2.51l-1.14,1.84l-0.57,0.52l-0.76,0.41l-0.95,0.02l-0.26,-0.25l-0.76,-1.98l-0.02,-0.98l0.08,-0.94l-0.35,-1.87l0.53,-2.18l0.63,-2.71l1.46,-3.03l-0.42,0.01l-2.06,2.54l-0.38,-0.46l1.1,-1.42l1.67,-2.57l1.91,-0.36l2.19,-0.8l2.21,0.42l0.09,0.02l2.47,-0.36l-1.4,-1.61l-0.75,-0.13l-0.86,-0.16l-0.59,-1.14l-2.75,0.36l-2.49,0.9l-1.97,-1.55l-1.59,-0.52l0.9,-2.17l-2.48,1.37l-2.25,1.33l-2.16,1.04l-1.72,-1.4l-2.81,0.85l0.01,-0.6l1.9,-1.73l1.99,-1.65l2.86,-1.37l-3.45,-1.09l-2.27,0.55l-2.72,-1.3l-2.86,-0.67l-1.96,-0.26l-0.87,-0.72l-0.5,-2.35l-0.95,0.02l-0.01,1.64l-5.8,0l-9.59,0l-9.53,0l-8.42,0h-8.41h-8.27h-8.55h-2.76h-8.32h-7.96l0.95,3.47l0.45,3.41l-0.69,1.09l-1.49,-3.91l-4.05,-1.42l-0.34,0.82l0.82,1.94l0.89,3.53l0.51,5.42l-0.34,3.59l-0.34,3.54l-1.1,3.61l0.9,2.9l0.1,3.2l-0.61,3.05l1.49,1.99l0.39,2.95l2.17,2.99l1.24,1.17l-0.1,0.82l2.34,4.85l2.72,3.45l0.34,1.87l0.71,0.55l2.6,0.33l1,0.91l1.57,0.17l0.31,0.96l1.31,0.4l1.82,1.92l0.47,1.7l3.19,-0.25l3.56,-0.36l-0.26,0.65l4.23,1.6l6.4,2.31l5.58,-0.02l2.22,0l0.01,-1.35l4.86,0l1.02,1.16l1.43,1.03l1.67,1.43l0.93,1.69l0.7,1.77l1.45,0.97l2.33,0.96l1.77,-2.53l2.29,-0.06l1.98,1.28l1.41,2.18l0.97,1.86l1.65,1.8l0.62,2.19l0.79,1.47l2.19,0.96l1.99,0.68l1.09,-0.09l-0.53,-1.06l-0.14,-1.5l0.03,-2.16l0.65,-1.42l1.53,-1.51l2.79,-1.37l2.55,-2.37l2.36,-0.75l1.74,-0.23l2.04,0.74l2.45,-0.4l2.09,1.69l2.03,0.1l1.05,-0.61l1.04,0.47l0.53,-0.42l-0.6,-0.63l0.05,-1.3l-0.5,-0.86l1.16,-0.5l2.14,-0.22l2.49,0.36l3.17,-0.41l1.76,0.8l1.36,1.5l0.5,0.16l2.83,-1.46l1.09,0.49l2.19,2.68l0.79,1.75l-0.58,2.1l0.42,1.23l1.3,2.4l1.49,2.68l1.07,0.71l0.44,1.35l1.38,0.37l0.84,-0.39l0.7,-1.89l0.12,-1.21l0.09,-2.1l-1.33,-3.65l-0.02,-1.37l-1.25,-2.25l-0.94,-2.75l-0.5,-2.25l0.43,-2.31l1.32,-1.94l1.58,-1.57l3.08,-2.16l0.4,-1.12l1.42,-1.23l1.4,-0.22l1.84,-1.98l2.9,-1.01l1.78,-2.53l-0.39,-3.46l-0.29,-1.21l-0.8,-0.24l-0.12,-3.35l-1.93,-1.14l1.85,0.56l-0.6,-2.26l0.54,-1.55l0.33,2.97l1.43,1.36l-0.87,2.4l0.26,0.14l1.58,-2.81l0.9,-1.38l-0.04,-1.35l-0.7,-0.64l-0.58,-1.94l0.92,0.9l0.62,0.19l0.21,0.92l2.04,-2.78l0.61,-2.62l-0.83,-0.17l0.85,-1.02l-0.08,0.45l1.79,-0.01l3.93,-1.11l-0.83,-0.7l-4.12,0.7l2.34,-1.07l1.63,-0.18l1.22,-0.19l2.07,-0.65l1.35,0.07l1.89,-0.61l0.22,-1.07l-0.84,-0.84l0.29,1.37l-1.16,-0.09l-0.93,-1.99l0.03,-2.01l0.48,-0.86l1.48,-2.28l2.96,-1.15l2.88,-1.34l2.99,-1.9l-0.48,-1.29l-1.83,-2.25L285.18,314.23zM45.62,263.79l-1.5,0.8l-2.55,1.86l0.43,2.42l1.43,1.32l2.8,-1.95l2.43,-2.47l-1.19,-1.63L45.62,263.79zM0,235.22l2.04,-1.26l0.23,-0.68L0,232.61V235.22zM8.5,250.59l-2.77,0.97l1.7,1.52l1.84,1.04l1.72,-0.87l-0.27,-2.15L8.5,250.59zM105.85,283.09l-2.69,0.38l-1.32,-0.62l-0.17,1.52l0.52,2.07l1.42,1.46l1.04,2.13l1.69,2.1l1.12,0.01l-2.44,-3.7L105.85,283.09zM37.13,403.77l-1,-0.28l-0.27,0.26l0.02,0.19l0.32,0.24l0.48,0.63l0.94,-0.21l0.23,-0.36L37.13,403.77zM34.14,403.23l1.5,0.09l0.09,-0.32l-1.38,-0.13L34.14,403.23zM40.03,406.52l-0.5,-0.26l-1.07,-0.5l-0.21,-0.06l-0.16,0.28l0.19,0.58l-0.49,0.48l-0.14,0.33l0.46,1.08l-0.08,0.83l0.7,0.42l0.41,-0.49l0.9,-0.46l1.1,-0.63l0.07,-0.16l-0.71,-1.04L40.03,406.52zM32.17,401.38l-0.75,0.41l0.11,0.12l0.36,0.68l0.98,0.11l0.2,0.04l0.15,-0.17l-0.81,-0.99L32.17,401.38zM27.77,399.82l-0.43,0.3l-0.15,0.22l0.94,0.55l0.33,-0.3l-0.06,-0.7L27.77,399.82z"},{"code":"UY","name":"Uruguay","path":"M313.68,551.79L315.5,551.45L318.31,553.95L319.35,553.86L322.24,555.94L324.44,557.76L326.06,560.01L324.82,561.58L325.6,563.48L324.39,565.6L321.22,567.48L319.15,566.8L317.63,567.17L315.04,565.71L313.14,565.82L311.43,563.95L311.65,561.79L312.26,561.05L312.23,557.75L312.98,554.38z"},{"code":"UZ","name":"Uzbekistan","path":"M661.76,350.95L661.84,348.79L658.11,347.27L655.18,345.52L653.35,343.83L650.14,341.32L648.76,337.53L647.82,336.86L644.79,337.03L643.72,336.26L643.42,333.27L639.64,331.27L637.28,333.47L634.88,334.77L635.34,336.65L632.18,336.7L632.07,322.57L639.29,320.22L639.81,320.57L644.16,323.41L646.45,324.89L649.13,328.39L652.42,327.83L657.23,327.53L660.58,330.33L660.37,334.13L661.74,334.16L662.31,337.22L665.88,337.34L666.64,339.09L667.69,339.07L668.92,336.42L672.61,333.81L674.22,333.11L675.05,333.48L672.7,335.91L674.77,337.31L676.77,336.38L680.09,338.34L676.5,340.98L674.37,340.62L673.21,340.72L672.81,339.7L673.39,337.99L669.64,338.85L668.75,341.2L667.42,343.21L665.08,343.04L664.35,344.63L666.41,345.49L667.01,348.15L665.44,351.72L663.32,350.98z"},{"code":"VE","name":"Venezuela","path":"M275.25,430.35L275.17,431.02L273.52,431.35L274.44,432.64L274.4,434.13L273.17,435.77L274.23,438.01L275.44,437.83L276.07,435.79L275.2,434.79L275.06,432.65L278.55,431.49L278.16,430.15L279.14,429.25L280.15,431.25L282.12,431.3L283.94,432.88L284.05,433.82L286.56,433.84L289.56,433.55L291.17,434.82L293.31,435.17L294.88,434.29L294.91,433.57L298.39,433.4L301.75,433.36L299.37,434.2L300.32,435.54L302.57,435.75L304.69,437.14L305.14,439.4L306.6,439.33L307.7,440L305.48,441.65L305.23,442.68L306.19,443.72L305.5,444.24L303.77,444.69L303.83,445.99L303.07,446.76L304.96,448.88L305.34,449.67L304.31,450.74L301.17,451.78L299.16,452.22L298.35,452.88L296.12,452.18L294.04,451.82L293.52,452.08L294.77,452.8L294.66,454.67L295.05,456.43L297.42,456.67L297.58,457.25L295.57,458.05L295.25,459.23L294.09,459.68L292.01,460.33L291.47,461.19L289.29,461.37L287.74,459.89L286.89,457.12L286.14,456.14L285.12,455.53L286.54,454.14L286.45,453.51L285.65,452.68L285.09,450.83L285.31,448.82L285.93,447.88L286.44,446.38L285.45,445.89L283.85,446.21L281.83,446.06L280.7,446.36L278.72,443.95L277.09,443.59L273.49,443.86L272.82,442.88L272.13,442.65L272.03,442.06L272.36,441.02L272.14,439.89L271.52,439.27L271.16,437.97L269.72,437.79L270.49,436.13L270.84,434.12L271.65,433.06L272.74,432.25L273.45,430.83z"},{"code":"VN","name":"Vietnam",labelCoordinate: {x: 1.2,y: 0.5},"path":"M778.21,401.87L774.47,404.43L772.13,407.24L771.51,409.29L773.66,412.38L776.28,416.2L778.82,417.99L780.53,420.32L781.81,425.64L781.43,430.66L779.1,432.53L775.88,434.36L773.6,436.72L770.1,439.34L769.08,437.53L769.87,435.62L767.79,434.01L770.22,432.87L773.16,432.67L771.93,430.94L776.64,428.75L776.99,425.33L776.34,423.41L776.85,420.53L776.14,418.49L774.02,416.47L772.25,413.9L769.92,410.44L766.56,408.68L767.37,407.61L769.16,406.84L768.07,404.25L764.62,404.22L763.36,401.5L761.72,399.13L763.23,398.39L765.46,398.41L768.19,398.06L770.58,396.44L771.93,397.58L774.5,398.13L774.05,399.87L775.39,401.09z"},{"code":"VU","name":"Vanuatu","path":"M945.87,509.9l-0.92,0.38l-0.94,-1.27l0.1,-0.78L945.87,509.9zM943.8,505.46l0.46,2.33l-0.75,-0.36l-0.58,0.16l-0.4,-0.8l-0.06,-2.21L943.8,505.46z"},{"code":"YE","name":"Yemen","path":"M624.16,416.33L622.13,417.12L621.59,418.4L621.52,419.39L618.73,420.61L614.25,421.96L611.74,423.99L610.51,424.14L609.67,423.97L608.03,425.17L606.24,425.72L603.89,425.87L603.18,426.03L602.57,426.78L601.83,426.99L601.4,427.72L600.01,427.66L599.11,428.04L597.17,427.9L596.44,426.23L596.52,424.66L596.07,423.81L595.52,421.69L594.71,420.5L595.27,420.36L594.98,419.04L595.32,418.48L595.2,417.22L596.43,416.29L596.14,415.06L596.89,413.63L598.04,414.39L598.8,414.12L602.03,414.05L602.55,414.35L605.26,414.64L606.33,414.49L607.03,415.46L608.34,414.98L610.35,411.91L612.97,410.59L621.05,409.46L623.25,414.3z"},{"code":"ZA","name":"South Africa","path":"M563.63,548.71l-0.55,0.46l-1.19,1.63l-0.78,1.66l-1.59,2.33l-3.17,3.38l-1.98,1.98l-2.12,1.51l-2.93,1.3l-1.43,0.17l-0.36,0.93l-1.7,-0.5l-1.39,0.64l-3.04,-0.65l-1.7,0.41l-1.16,-0.18l-2.89,1.33l-2.39,0.54l-1.73,1.28l-1.28,0.08l-1.19,-1.21l-0.95,-0.06l-1.21,-1.51l-0.13,0.47l-0.37,-0.91l0.02,-1.96l-0.91,-2.23l0.9,-0.6l-0.07,-2.53l-1.84,-3.05l-1.41,-2.74l0,-0.01l-2.01,-4.15l1.34,-1.57l1.11,0.87l0.47,1.36l1.26,0.23l1.76,0.6l1.51,-0.23l2.5,-1.63l0,-11.52l0.76,0.46l1.66,2.93l-0.26,1.89l0.63,1.1l2.01,-0.32l1.4,-1.39l1.33,-0.93l0.69,-1.48l1.37,-0.72l1.18,0.38l1.34,0.87l2.28,0.15l1.79,-0.72l0.28,-0.96l0.49,-1.47l1.53,-0.25l0.84,-1.15l0.93,-2.03l2.52,-2.26l3.97,-2.22l1.14,0.03l1.36,0.51l0.94,-0.36l1.49,0.3l1.34,4.26l0.73,2.17l-0.5,3.43l0.24,1.11l-1.42,-0.57l-0.81,0.22l-0.26,0.9l-0.77,1.17l0.03,1.08l1.67,1.7l1.64,-0.34l0.57,-1.39l2.13,0.03l-0.7,2.28l-0.33,2.62l-0.73,1.43L563.63,548.71zM556.5,547.75l-1.22,-0.98l-1.31,0.65l-1.52,1.25l-1.5,2.03l2.1,2.48l1,-0.32l0.52,-1.03l1.56,-0.5l0.48,-1.05l0.86,-1.56L556.5,547.75z"},{"code":"ZM","name":"Zambia","path":"M567.11,489.21L568.43,490.47L569.14,492.87L568.66,493.64L568.1,495.94L568.64,498.3L567.76,499.29L566.91,501.95L568.38,502.69L559.87,505.07L560.14,507.12L558.01,507.52L556.42,508.67L556.08,509.68L555.07,509.9L552.63,512.3L551.08,514.19L550.13,514.26L549.22,513.92L546.09,513.6L545.59,513.38L545.56,513.14L544.46,512.48L542.64,512.31L540.34,512.98L538.51,511.16L536.62,508.78L536.75,499.62L542.59,499.66L542.35,498.67L542.77,497.6L542.28,496.27L542.6,494.89L542.3,494.01L543.27,494.08L543.43,494.96L544.74,494.89L546.52,495.15L547.46,496.44L549.7,496.84L551.42,495.94L552.05,497.43L554.2,497.83L555.23,499.05L556.38,500.62L558.53,500.65L558.29,497.57L557.52,498.08L555.56,496.98L554.8,496.47L555.15,493.62L555.65,490.27L555.02,489.02L555.82,487.22L556.57,486.89L560.34,486.41L561.44,486.7L562.61,487.41L563.73,487.89L565.51,488.36z"},{"code":"ZW","name":"Zimbabwe","path":"M562.71,527L561.22,526.7L560.27,527.06L558.92,526.55L557.78,526.52L555.99,525.16L553.82,524.7L553,522.8L552.99,521.75L551.79,521.43L548.62,518.18L547.73,516.47L547.17,515.95L546.09,513.6L549.22,513.92L550.13,514.26L551.08,514.19L552.63,512.3L555.07,509.9L556.08,509.68L556.42,508.67L558.01,507.52L560.14,507.12L560.32,508.2L562.66,508.14L563.96,508.75L564.56,509.47L565.9,509.68L567.35,510.62L567.36,514.31L566.81,516.35L566.69,518.55L567.14,519.43L566.83,521.17L566.4,521.44L565.66,523.59z"}]; + tuiChart.registerMap('world', data); +})(tui.chart); diff --git a/dist/tui-chart.css b/dist/tui-chart.css new file mode 100644 index 000000000..58dd85330 --- /dev/null +++ b/dist/tui-chart.css @@ -0,0 +1,704 @@ +/*! + * tui-chart + * @fileoverview tui-chart + * @author NHN Ent. FE Development Lab + * @version 2.17.0 + * @license MIT + * @link https://github.com/nhnent/tui.chart + * bundle created at "Tue Mar 13 2018 14:13:16 GMT+0900 (KST)" + */ +.tui-chart { + position: relative; + user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; +} +.tui-chart, +.tui-chart * { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + line-height: 1; +} +.tui-chart .tui-chart-title { + position: absolute; + top: 0; + left: 0; + width: 100%; + text-align: center; + padding: 10px 0; + z-index: 350; +} +.tui-chart .tui-chart-axis-area { + z-index: 300; + position: absolute; +} +.tui-chart .tui-chart-axis-area * { + user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; +} +.tui-chart .tui-chart-axis-area .tui-chart-title-area { + position: absolute; +} +.tui-chart .tui-chart-axis-area .tui-chart-tick-area, +.tui-chart .tui-chart-axis-area .tui-chart-label-area { + position: absolute; + top: 0; + width: 100%; + height: 100%; +} +.tui-chart .tui-chart-axis-area .tui-chart-tick-area .tui-chart-tick { + position: absolute; + background-color: #000; +} +.tui-chart .tui-chart-axis-area .tui-chart-label-area .tui-chart-label { + position: absolute; +} +.tui-chart .tui-chart-axis-area .tui-chart-label-area .tui-chart-label > span { + line-height: 1.2; +} +.tui-chart .tui-chart-axis-area.vertical { + top: 10px; +} +.tui-chart .tui-chart-axis-area.vertical .tui-chart-title-area { + text-align: center; + white-space: nowrap; + top: 0; +} +.tui-chart .tui-chart-axis-area.vertical .tui-chart-title-area.rotation { + -webkit-transform-origin: top left; + -moz-transform-origin: top left; + -ms-transform-origin: top left; + -o-transform-origin: top left; + transform-origin: top left; + -webkit-transform: rotate(-90deg); + -moz-transform: rotate(-90deg); + -ms-transform: rotate(-90deg); + -o-transform: rotate(-90deg); + transform: rotate(-90deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); +} +.tui-chart .tui-chart-axis-area.vertical .tui-chart-tick-area { + right: 0; +} +.tui-chart .tui-chart-axis-area.vertical .tui-chart-tick-area .tui-chart-tick { + right: 1px; + width: 5px; + height: 1px; +} +.tui-chart .tui-chart-axis-area.vertical .tui-chart-tick-area .tui-chart-tick-line { + left: auto; + right: 0; + width: 1px; + background-color: #000; + position: absolute; +} +.tui-chart .tui-chart-axis-area.vertical .tui-chart-label-area { + right: 10px; +} +.tui-chart .tui-chart-axis-area.vertical .tui-chart-label-area .tui-chart-label { + left: 0; + width: 100%; + text-align: right; + white-space: nowrap; +} +.tui-chart .tui-chart-axis-area.vertical.right .tui-chart-title-area { + text-align: center; + white-space: nowrap; + top: 0; +} +.tui-chart .tui-chart-axis-area.vertical.right .tui-chart-title-area.rotation { + -webkit-transform-origin: top left; + -moz-transform-origin: top left; + -ms-transform-origin: top left; + -o-transform-origin: top left; + transform-origin: top left; + -webkit-transform: rotate(90deg); + -moz-transform: rotate(90deg); + -ms-transform: rotate(90deg); + -o-transform: rotate(90deg); + transform: rotate(90deg); + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); +} +.tui-chart .tui-chart-axis-area.vertical.right .tui-chart-tick-area, +.tui-chart .tui-chart-axis-area.vertical.right .tui-chart-label-area { + left: 0; +} +.tui-chart .tui-chart-axis-area.vertical.right .tui-chart-label-area .tui-chart-label { + text-align: left; + padding-right: 0; + padding-left: 10px; +} +.tui-chart .tui-chart-axis-area.vertical.center .tui-chart-title-area { + width: 100% !important; + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + -ms-transform: rotate(0deg); + -o-transform: rotate(0deg); + transform: rotate(0deg); + filter: none; + top: auto; +} +.tui-chart .tui-chart-axis-area.vertical.center .tui-chart-label-area { + left: 0; + width: 100% !important; +} +.tui-chart .tui-chart-axis-area.vertical.center .tui-chart-label-area .tui-chart-label { + text-align: center; +} +.tui-chart .tui-chart-axis-area.vertical.right .tui-chart-tick-area, +.tui-chart .tui-chart-axis-area.vertical.center .tui-chart-tick-area.opposite-side { + border-right: none; +} +.tui-chart .tui-chart-axis-area.vertical.right .tui-chart-tick-area .tui-chart-tick, +.tui-chart .tui-chart-axis-area.vertical.center .tui-chart-tick-area.opposite-side .tui-chart-tick { + left: 1px; +} +.tui-chart .tui-chart-axis-area.vertical.right .tui-chart-tick-area .tui-chart-tick-line, +.tui-chart .tui-chart-axis-area.vertical.center .tui-chart-tick-area.opposite-side .tui-chart-tick-line { + right: auto; + left: 0; +} +.tui-chart .tui-chart-axis-area.horizontal { + right: 10px; +} +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-title-area { + bottom: 0; + width: 100%; + text-align: center; +} +.tui-chart .tui-chart-axis-area.horizontal.division .tui-chart-title-area { + left: 0; + width: auto; +} +.tui-chart .tui-chart-axis-area.horizontal.division .tui-chart-title-area.right { + left: auto; + right: 0; +} +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-tick-area, +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area { + left: 0; +} +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-tick-area .tui-chart-tick-line { + top: 0; + height: 1px; + background-color: #000; + position: absolute; +} +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-tick-area .tui-chart-ticks { + width: 100%; + position: absolute; + left: 0; + top: 0; +} +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-tick-area .tui-chart-tick { + top: 0; + width: 1px; + height: 6px; +} +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label { + top: 10px; + text-align: center; + word-wrap: break-word; + word-break: keep-all; +} +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation { + text-align: right; + white-space: nowrap; +} +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation span { + position: absolute; + right: 0; + top: 0; +} +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation25 { + -webkit-transform: rotate(-25deg); + -moz-transform: rotate(-25deg); + -ms-transform: rotate(-25deg); + -o-transform: rotate(-25deg); + transform: rotate(-25deg); +} +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation25 span { + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.9063077870366499, M12=0.42261826174069944, M21=-0.42261826174069944, M22=0.9063077870366499)"; +} +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation45 { + -webkit-transform: rotate(-45deg); + -moz-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + -o-transform: rotate(-45deg); + transform: rotate(-45deg); +} +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation45 span { + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=0.7071067811865475, M21=-0.7071067811865475, M22=0.7071067811865476)"; +} +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation65 { + -webkit-transform: rotate(-65deg); + -moz-transform: rotate(-65deg); + -ms-transform: rotate(-65deg); + -o-transform: rotate(-65deg); + transform: rotate(-65deg); +} +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation65 span { + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.42261826174069944, M12=0.9063077870366499, M21=-0.9063077870366499, M22=0.42261826174069944)"; +} +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation85 { + -webkit-transform: rotate(-85deg); + -moz-transform: rotate(-85deg); + -ms-transform: rotate(-85deg); + -o-transform: rotate(-85deg); + transform: rotate(-85deg); +} +.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation85 span { + -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.08715574274765814, M12=0.9961946980917455, M21=-0.9961946980917455, M22=0.08715574274765814)"; +} +.tui-chart .tui-chart-plot-area { + position: absolute; + right: 10px; + top: 10px; + z-index: -100; +} +.tui-chart .tui-chart-plot-area .tui-chart-plot-optional-lines-area { + left: 0; + top: 0; + width: 100%; + height: 100%; + position: absolute; +} +.tui-chart .tui-chart-plot-area .tui-chart-plot-lines-area { + width: 100%; + height: 100%; + position: relative; +} +.tui-chart .tui-chart-plot-area .tui-chart-plot-line { + background-color: #ccc; + position: absolute; +} +.tui-chart .tui-chart-plot-area .tui-chart-plot-line.vertical { + top: 0px; + width: 1px; +} +.tui-chart .tui-chart-plot-area .tui-chart-plot-line.horizontal { + left: 0px; + height: 1px; +} +.tui-chart .tui-chart-series-area { + z-index: 200; + position: absolute; + user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; +} +.tui-chart .tui-chart-series-area:first-child { + overflow: visible; +} +.tui-chart .tui-chart-series-area .tui-chart-series-block-area { + position: absolute; + left: 10px; + top: 10px; +} +.tui-chart .tui-chart-series-area .tui-chart-series-block-area .tui-chart-series-block { + position: absolute; +} +.tui-chart .tui-chart-series-area .tui-chart-series-label-area { + position: absolute; + overflow: visible; + left: 0px; + top: 0px; + display: none; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; + filter: alpha(opacity=0); + opacity: 0; +} +.tui-chart .tui-chart-series-area .tui-chart-series-label-area .tui-chart-series-label { + position: absolute; + cursor: default; + text-align: center; + white-space: nowrap; + text-shadow: #fff 0px 0px 3px; +} +.tui-chart .tui-chart-series-area .tui-chart-series-label-area.show { + display: block; +} +.tui-chart .tui-chart-series-area .tui-chart-series-label-area.opacity { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; + filter: alpha(opacity=100); + opacity: 1; +} +.tui-chart .tui-chart-series-area .tui-chart-series-graph-area { + position: absolute; + left: 0; + top: 0; +} +.tui-chart .tui-chart-zoom-area { + z-index: 1500; + position: absolute; + border: 1px solid #cccccc; + background-color: #cccccc; + -webkit-border-radius: 4px; + border-radius: 4px; + background-clip: padding-box; +} +.tui-chart .tui-chart-zoom-area > .tui-chart-zoom-btn { + width: 21px; + height: 21px; + display: block; + background-color: #fff; + cursor: pointer; + position: relative; +} +.tui-chart .tui-chart-zoom-area > .tui-chart-zoom-btn:first-child { + margin-bottom: 1px; + -webkit-border-radius: 4px 4px 0 0; + border-radius: 4px 4px 0 0; + background-clip: padding-box; +} +.tui-chart .tui-chart-zoom-area > .tui-chart-zoom-btn:last-child { + -webkit-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 4px; + background-clip: padding-box; +} +.tui-chart .tui-chart-zoom-area > .tui-chart-zoom-btn:hover { + background-color: #efefef; +} +.tui-chart .tui-chart-zoom-area > .tui-chart-zoom-btn > div { + font-szie: 0; + background-color: #555555; + position: absolute; +} +.tui-chart .tui-chart-zoom-area > .tui-chart-zoom-btn > div.horizontal-line { + width: 9px; + height: 1px; + left: 6px; + top: 10px; +} +.tui-chart .tui-chart-zoom-area > .tui-chart-zoom-btn > div.vertical-line { + width: 1px; + height: 9px; + left: 10px; + top: 6px; +} +.tui-chart .tui-chart-series-custom-event-area { + z-index: 1000; + position: absolute; + left: 0; + top: 0; +} +.tui-chart .tui-chart-series-custom-event-area.hide { + display: none; +} +.tui-chart .tui-chart-series-custom-event-area.drag { + cursor: move; +} +.tui-chart .tui-chart-series-custom-event-area .tui-chart-drag-selection { + top: 10px; + height: 100%; + background-color: gray; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; + filter: alpha(opacity=30); + opacity: 0.3; + position: absolute; + display: none; +} +.tui-chart .tui-chart-series-custom-event-area .tui-chart-drag-selection.show { + display: block; +} +.tui-chart .tui-chart-series-custom-event-area .tui-chart-reset-zoom-btn { + position: absolute; + left: 20px; + top: 20px; + font-size: 11px; + padding: 5px; + border: 1px solid #ccc; + background-color: #efefef; + cursor: pointer; + user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; +} +.tui-chart .tui-chart-legend-rect { + margin-top: 2px; + width: 12px; + height: 12px; +} +.tui-chart .tui-chart-legend-rect.line { + height: 2px; +} +.tui-chart .tui-chart-legend-rect.area, +.tui-chart .tui-chart-legend-rect.bubble { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; + filter: alpha(opacity=50); + opacity: 0.5; +} +.tui-chart .tui-chart-chartExportMenu-area { + z-index: 900; + position: absolute; + font-family: Verdana; + margin: 0; + padding: 10px 0 0 0; + z-index: 5000; +} +.tui-chart .tui-chart-chartExportMenu-area .tui-chart-chartExportMenu-button { + position: absolute; + width: 26px; + height: 20px; + right: 0; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAAKklEQVQ4EWMsKCj4z0BFwERFs8BGUd1AajtwCJjHOBrLQyCWKHXiCIxlAM/yBv2WsAlAAAAAAElFTkSuQmCC) top left no-repeat; + border: 0px; + font-size: 12px; + padding: 3px 5px; + margin: 0; + cursor: pointer; +} +.tui-chart .tui-chart-chartExportMenu-area ul { + display: none; + position: absolute; + top: 30px; + right: 0; + width: 120px; + background: #fff; + border: 0.5px solid #000; + font-size: 0.8em; + padding: 0; + margin: 0; + box-shadow: 3px 3px 5px #888888; +} +.tui-chart .tui-chart-chartExportMenu-area ul > li { + margin: 0; + padding: 7px 3px; + border-collapse: collapse; + text-align: center; + list-style-type: none; + line-height: 1; + cursor: pointer; +} +.tui-chart .tui-chart-chartExportMenu-area ul > li:hover { + background-color: #91ade5; +} +.tui-chart .tui-chart-legend-area { + z-index: 400; + position: absolute; + padding: 10px; + user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; +} +.tui-chart .tui-chart-legend-area .tui-chart-legend { + clear: both; +} +.tui-chart .tui-chart-legend-area .tui-chart-legend > div { + float: left; +} +.tui-chart .tui-chart-legend-area .tui-chart-legend .tui-chart-legend-checkbox-area { + width: 20px; + height: 20px; + position: relative; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.tui-chart .tui-chart-legend-area .tui-chart-legend .tui-chart-legend-checkbox-area input { + left: 2px; + top: 2px; + *left: -2px; + *top: -2px; + position: absolute; + padding: 0; + margin: 0; +} +.tui-chart .tui-chart-legend-area .tui-chart-legend .tui-chart-legend-label { + padding: 2px 0 2px 4px; + cursor: pointer; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + line-height: 1; +} +.tui-chart .tui-chart-legend-area .tui-chart-legend.unselected .tui-chart-legend-rect { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; + filter: alpha(opacity=30); + opacity: 0.3; +} +.tui-chart .tui-chart-legend-area .tui-chart-legend.unselected .tui-chart-legend-label { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; + filter: alpha(opacity=30); + opacity: 0.3; +} +.tui-chart .tui-chart-legend-area .tui-chart-legend-tick-area { + position: absolute; + left: 10px; + top: 10px; +} +.tui-chart .tui-chart-legend-area .tui-chart-legend-tick-area .tui-chart-map-legend-tick { + width: 15px; + height: 1px; + background-color: #ccc; + position: absolute; + left: 0px; +} +.tui-chart .tui-chart-legend-area .tui-chart-legend-tick-area .tui-chart-map-legend-tick-label { + position: absolute; + left: 30px; + text-align: left; +} +.tui-chart .tui-chart-legend-area .tui-chart-legend-tick-area.horizontal .tui-chart-map-legend-tick { + top: 0px; + width: 1px; + height: 15px; +} +.tui-chart .tui-chart-legend-area .tui-chart-legend-tick-area.horizontal .tui-chart-map-legend-tick-label { + top: 30px; +} +.tui-chart .tui-chart-legend-area .tui-chart-map-legend-wedge { + position: absolute; + width: 19px; + height: 4px; + border-left: 2px solid #777; + border-right: 2px solid #777; + left: 8px; + top: 30px; + display: none; +} +.tui-chart .tui-chart-legend-area .tui-chart-map-legend-wedge.show { + display: block; +} +.tui-chart .tui-chart-legend-area.horizontal { + padding-left: 0; + padding-right: 0; +} +.tui-chart .tui-chart-legend-area.horizontal .tui-chart-legend { + clear: none; + float: left; + white-space: nowrap; +} +.tui-chart .tui-chart-circle-legend-area { + position: absolute; + z-index: 400; +} +.tui-chart .tui-chart-circle-legend-area .tui-chart-circle-legend-label-area { + position: absolute; + left: 0; + top: 0; +} +.tui-chart .tui-chart-circle-legend-area .tui-chart-circle-legend-label-area .tui-chart-circle-legend-label { + position: absolute; + font-size: 9px; + white-space: nowrap; + text-shadow: #fff 0px 0px 3px; +} +.tui-chart .tui-chart-tooltip-area { + position: absolute; + z-index: 500; +} +.tui-chart .tui-chart-tooltip-area * { + user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; +} +.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip { + z-index: 100; + position: absolute; + display: none; + user-select: none; +} +.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip.show { + display: block; +} +.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip { + padding: 4px 0; + font-size: 12px; + min-width: 100px; + color: #fff; + -webkit-border-radius: 5px; + border-radius: 5px; + background-clip: padding-box; + background-color: rgba(0, 0, 0, 0.7); + background-color: #555 \9; +} +.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip > * { + padding: 2px 7px; + text-align: center; + white-space: nowrap; +} +.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip > :first-child { + backgound-color: #fff; + font-weight: bold; +} +.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip.tui-chart-group-tooltip > * { + text-align: left; + position: relative; + padding-left: 20px; + padding-top: 4px; + padding-bottom: 4px; +} +.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip.tui-chart-group-tooltip .tui-chart-legend-rect { + position: absolute; + left: 7px; + top: 2px; +} +.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip.tui-chart-group-tooltip .tui-chart-legend-rect.line { + top: 7px; +} +.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip.tui-chart-group-tooltip > :first-child { + padding-left: 7px; + padding-top: 6px; + padding-bottom: 6px; + text-align: center; +} +.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip.tui-chart-group-tooltip > .tui-chart-tooltip-type { + padding-left: 7px; +} +.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip .hide { + display: none; +} +.tui-chart .tui-chart-tooltip-area .tui-chart-group-tooltip-sector { + z-index: 50; + position: absolute; + background-color: #aaa; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; + filter: alpha(opacity=30); + opacity: 0.3; + display: none; +} +.tui-chart .tui-chart-tooltip-area .tui-chart-group-tooltip-sector.show { + display: block; +} +.tui-chart.tui-map-chart .tui-chart-series-area { + overflow: hidden; +} +.tui-chart.tui-map-chart .tui-chart-tooltip-area .tui-chart-default-tooltip > :first-child { + font-weight: normal; +} +.tui-chart-size-check-element { + clear: both; + position: absolute; + word-wrap: break-word; + word-break: keep-all; + top: 100000px; + left: 100000px; + width: 1000px; + height: 100px; + padding: 0; + line-height: 1; +} +.tui-chart-size-check-element > span { + display: inline-block; + box-sizing: border-box; + text-align: center; + padding: 0; +} +:root .tui-chart .tui-chart-axis-area.vertical .tui-chart-title-area { + filter: none \0; +} +:root .tui-chart .tui-chart-axis-area.horizontal .tui-chart-label.tui-chart-xaxis-rotation25 span, +:root .tui-chart .tui-chart-axis-area.horizontal .tui-chart-label.tui-chart-xaxis-rotation45 span, +:root .tui-chart .tui-chart-axis-area.horizontal .tui-chart-label.tui-chart-xaxis-rotation65 span, +:root .tui-chart .tui-chart-axis-area.horizontal .tui-chart-label.tui-chart-xaxis-rotation85 span { + filter: none \0; +} diff --git a/dist/tui-chart.js b/dist/tui-chart.js new file mode 100644 index 000000000..fb3a5ee07 --- /dev/null +++ b/dist/tui-chart.js @@ -0,0 +1,40782 @@ +/*! + * tui-chart + * @fileoverview tui-chart + * @author NHN Ent. FE Development Lab + * @version 2.17.0 + * @license MIT + * @link https://github.com/nhnent/tui.chart + * bundle created at "Tue Mar 13 2018 14:13:16 GMT+0900 (KST)" + */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("raphael"), require("tui-code-snippet")); + else if(typeof define === 'function' && define.amd) + define(["raphael", "tui-code-snippet"], factory); + else if(typeof exports === 'object') + exports["chart"] = factory(require("raphael"), require("tui-code-snippet")); + else + root["tui"] = root["tui"] || {}, root["tui"]["chart"] = factory(root["Raphael"], (root["tui"] && root["tui"]["util"])); +})(this, function(__WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_6__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "/dist/"; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var pluginRaphael = __webpack_require__(2); + var chart = __webpack_require__(29); + __webpack_require__(147); + + chart.registerPlugin(pluginRaphael.name, pluginRaphael.plugins, pluginRaphael.callback); + chart.renderUtil = __webpack_require__(7); + chart.arrayUtil = __webpack_require__(10); + chart.colorutil = __webpack_require__(138); + + /** + * NHN Entertainment Toast UI Chart. + * @namespace tui.chart + */ + module.exports = chart; + + +/***/ }), +/* 1 */, +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Raphael render plugin. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var raphael = __webpack_require__(3); + + var BarChart = __webpack_require__(4); + var Boxplot = __webpack_require__(12); + var Bullet = __webpack_require__(13); + var LineChart = __webpack_require__(14); + var AreaChart = __webpack_require__(16); + var PieChart = __webpack_require__(18); + var RadialLineSeries = __webpack_require__(19); + var CoordinateTypeChart = __webpack_require__(20); + var BoxTypeChart = __webpack_require__(21); + var MapChart = __webpack_require__(22); + + var legend = __webpack_require__(23); + var MapLegend = __webpack_require__(24); + var CircleLegend = __webpack_require__(25); + var title = __webpack_require__(26); + var axis = __webpack_require__(27); + + var RadialPlot = __webpack_require__(28); + + var pluginRaphael = { + bar: BarChart, + boxplot: Boxplot, + bullet: Bullet, + column: BarChart, + line: LineChart, + area: AreaChart, + pie: PieChart, + bubble: CoordinateTypeChart, + scatter: CoordinateTypeChart, + heatmap: BoxTypeChart, + treemap: BoxTypeChart, + map: MapChart, + radial: RadialLineSeries, + legend: legend, + mapLegend: MapLegend, + circleLegend: CircleLegend, + radialPlot: RadialPlot, + title: title, + axis: axis + }; + var callback = function(container, dimension) { + var paper = raphael(container, dimension.width, dimension.height); + var rect = paper.rect(0, 0, dimension.width, dimension.height); + + if (paper.raphael.svg) { + appendGlowFilterToDefs(paper); + } + + paper.pushDownBackgroundToBottom = function() { + rect.toBack(); + }; + + paper.changeChartBackgroundColor = function(color) { + rect.attr({ + fill: color + }); + }; + + paper.changeChartBackgroundOpacity = function(opacity) { + rect.attr({ + 'fill-opacity': opacity + }); + }; + + paper.resizeBackground = function(width, height) { + rect.attr({ + width: width, + height: height + }); + }; + + rect.attr({ + fill: '#fff', + 'stroke-width': 0 + }); + + return paper; + }; + + /** + * Append glow filter for series label + * @param {object} paper Raphael paper object + * @ignore + */ + function appendGlowFilterToDefs(paper) { + var filter = document.createElementNS('http://www.w3.org/2000/svg', 'filter'); + var feGaussianBlur = document.createElementNS('http://www.w3.org/2000/svg', 'feGaussianBlur'); + var feFlood = document.createElementNS('http://www.w3.org/2000/svg', 'feFlood'); + var feComposite = document.createElementNS('http://www.w3.org/2000/svg', 'feComposite'); + var feMorphology = document.createElementNS('http://www.w3.org/2000/svg', 'feMorphology'); + var feMerge = document.createElementNS('http://www.w3.org/2000/svg', 'feMerge'); + var feMergeNodeColoredBlur = document.createElementNS('http://www.w3.org/2000/svg', 'feMergeNode'); + var feMergeNodeSourceGraphic = document.createElementNS('http://www.w3.org/2000/svg', 'feMergeNode'); + + filter.id = 'glow'; + + feFlood.setAttribute('result', 'flood'); + feFlood.setAttribute('flood-color', '#ffffff'); + feFlood.setAttribute('flood-opacity', '0.5'); + + feComposite.setAttribute('in', 'flood'); + feComposite.setAttribute('result', 'mask'); + feComposite.setAttribute('in2', 'SourceGraphic'); + feComposite.setAttribute('operator', 'in'); + + feMorphology.setAttribute('in', 'mask'); + feMorphology.setAttribute('result', 'dilated'); + feMorphology.setAttribute('operator', 'dilate'); + feMorphology.setAttribute('radius', '2'); + + feGaussianBlur.setAttribute('in', 'dilated'); + feGaussianBlur.setAttribute('result', 'blurred'); + feGaussianBlur.setAttribute('stdDeviation', '1'); + + feMergeNodeColoredBlur.setAttribute('in', 'blurred'); + feMergeNodeSourceGraphic.setAttribute('in', 'SourceGraphic'); + + filter.appendChild(feFlood); + filter.appendChild(feComposite); + filter.appendChild(feMorphology); + filter.appendChild(feGaussianBlur); + + filter.appendChild(feMerge); + + feMerge.appendChild(feMergeNodeColoredBlur); + feMerge.appendChild(feMergeNodeSourceGraphic); + + paper.defs.appendChild(filter); + } + + module.exports = { + name: 'Raphael', + plugins: pluginRaphael, + callback: callback + }; + + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_3__; + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Raphael bar chart renderer. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var raphaelRenderUtil = __webpack_require__(5); + var snippet = __webpack_require__(6); + var raphael = __webpack_require__(3); + + var ANIMATION_DURATION = 700; + var EMPHASIS_OPACITY = 1; + var DE_EMPHASIS_OPACITY = 0.3; + var DEFAULT_LUMINANC = 0.2; + + /** + * @classdesc RaphaelBarChart is graph renderer for bar, column chart. + * @class RaphaelBarChart + * @private + */ + var RaphaelBarChart = snippet.defineClass(/** @lends RaphaelBarChart.prototype */ { + /** + * Render function of bar chart + * @param {object} paper paper object + * @param {{size: object, model: object, options: object, tooltipPosition: string}} data chart data + * @returns {Array.} seriesSet + */ + render: function(paper, data) { + var groupBounds = data.groupBounds; + + if (!groupBounds) { + return null; + } + + this.paper = paper; + + this.theme = data.theme; + this.seriesDataModel = data.seriesDataModel; + this.chartType = data.chartType; + + this.paper.setStart(); + + this.options = data.options; + this.theme = data.theme; + this.groupBars = this._renderBars(groupBounds); + this.groupBorders = this._renderBarBorders(groupBounds); + + this.overlay = this._renderOverlay(); + this.groupBounds = groupBounds; + + return this.paper.setFinish(); + }, + + /** + * Render overlay. + * @returns {object} raphael object + * @private + */ + _renderOverlay: function() { + var bound = { + width: 1, + height: 1, + left: 0, + top: 0 + }; + var attributes = { + 'fill-opacity': 0 + }; + + return this._renderBar(bound, '#fff', attributes); + }, + + /** + * Render rect + * @param {{left: number, top: number, width: number, height: number}} bound bound + * @param {string} color series color + * @param {object} [attributes] - attributes + * @returns {object} bar rect + * @private + */ + _renderBar: function(bound, color, attributes) { + var rect; + + if (bound.width < 0 || bound.height < 0) { + return null; + } + + rect = raphaelRenderUtil.renderRect(this.paper, bound, snippet.extend({ + fill: color, + stroke: 'none' + }, attributes)); + + return rect; + }, + + /** + * Render bars. + * @param {Array.>} groupBounds bounds + * @returns {Array.>} bars + * @private + */ + _renderBars: function(groupBounds) { + var self = this; + var colors = this.theme.colors; + var colorByPoint = this.options.colorByPoint; + var groupBars = snippet.map(groupBounds, function(bounds, groupIndex) { + return snippet.map(bounds, function(bound, index) { + var color, rect, item; + + if (!bound) { + return null; + } + + item = self.seriesDataModel.getSeriesItem(groupIndex, index); + + color = colorByPoint ? colors[groupIndex] : colors[index]; + rect = self._renderBar(bound.start, color); + + return { + rect: rect, + color: color, + bound: bound.end, + item: item, + groupIndex: groupIndex, + index: index, + isRange: item.isRange + }; + }); + }); + + return groupBars; + }, + + /** + * Make rect points. + * @param {{left: number, top:number, width: number, height: number}} bound rect bound + * @returns {{ + * leftTop: {left: number, top: number}, + * rightTop: {left: number, top: number}, + * rightBottom: {left: number, top: number}, + * leftBottom: {left: number, top: number} + * }} rect points + * @private + */ + _makeRectPoints: function(bound) { + return { + leftTop: { + left: Math.ceil(bound.left), + top: Math.ceil(bound.top) + }, + rightTop: { + left: Math.ceil(bound.left + bound.width), + top: Math.ceil(bound.top) + }, + rightBottom: { + left: Math.ceil(bound.left + bound.width), + top: Math.ceil(bound.top + bound.height) + }, + leftBottom: { + left: Math.ceil(bound.left), + top: Math.ceil(bound.top + bound.height) + } + }; + }, + + /** + * Make top line path. + * @param {object} points points + * @param {{left: number, top: number}} points.leftTop left top + * @param {{left: number, top: number}} points.rightTop right top + * @param {string} chartType chart type + * @param {Item} item item + * @returns {string} top line path + * @private + */ + _makeTopLinePath: function(points, chartType, item) { + var linePath = null, + value = item.value, + cloneLeftTop; + + if (chartType === 'bar' || value >= 0 || item.isRange) { + cloneLeftTop = snippet.extend({}, points.leftTop); + cloneLeftTop.left -= chartType === 'column' || value < 0 ? 1 : 0; + linePath = raphaelRenderUtil.makeLinePath(cloneLeftTop, points.rightTop).join(' '); + } + + return linePath; + }, + + /** + * Make right line path. + * @param {object} points points + * @param {{left: number, top: number}} points.rightTop right top + * @param {{left: number, top: number}} points.rightBottom right bottom + * @param {string} chartType chart type + * @param {Item} item item + * @returns {string} top line path + * @private + */ + _makeRightLinePath: function(points, chartType, item) { + var linePath = null; + + if (chartType === 'column' || item.value >= 0 || item.isRange) { + linePath = raphaelRenderUtil.makeLinePath(points.rightTop, points.rightBottom).join(' '); + } + + return linePath; + }, + + /** + * Make bottom line path. + * @param {object} points points + * @param {{left: number, top: number}} points.lefBottom left bottom + * @param {{left: number, top: number}} points.rightBottom right bottom + * @param {string} chartType chart type + * @param {Item} item item + * @returns {string} top line path + * @private + */ + _makeBottomLinePath: function(points, chartType, item) { + var linePath = null; + + if (chartType === 'bar' || item.value < 0 || item.isRange) { + linePath = raphaelRenderUtil.makeLinePath(points.leftBottom, points.rightBottom).join(' '); + } + + return linePath; + }, + + /** + * Make left line path. + * @param {object} points points + * @param {{left: number, top: number}} points.lefTop left top + * @param {{left: number, top: number}} points.leftBottom left bottom + * @param {string} chartType chart type + * @param {Item} item item + * @returns {string} top line path + * @private + */ + _makeLeftLinePath: function(points, chartType, item) { + var linePath = null; + + if (chartType === 'column' || item.value < 0 || item.isRange) { + linePath = raphaelRenderUtil.makeLinePath(points.leftTop, points.leftBottom).join(' '); + } + + return linePath; + }, + + /** + * Make border lines paths. + * @param {{left: number, top:number, width: number, height: number}} bound rect bound + * @param {string} chartType chart type + * @param {Item} item item + * @returns {{top: string, right: string, bottom: string, left: string}} paths + * @private + */ + _makeBorderLinesPaths: function(bound, chartType, item) { + var points = this._makeRectPoints(bound), + paths = { + top: this._makeTopLinePath(points, chartType, item), + right: this._makeRightLinePath(points, chartType, item), + bottom: this._makeBottomLinePath(points, chartType, item), + left: this._makeLeftLinePath(points, chartType, item) + }; + + return snippet.filter(paths, function(path) { + return path; + }); + }, + + /** + * Render border lines; + * @param {{left: number, top:number, width: number, height: number}} bound bar bound + * @param {string} borderColor border color + * @param {string} chartType chart type + * @param {Item} item item + * @returns {object} raphael object + * @private + */ + _renderBorderLines: function(bound, borderColor, chartType, item) { + var self = this, + borderLinePaths = this._makeBorderLinesPaths(bound, chartType, item), + lines = {}; + + snippet.forEach(borderLinePaths, function(path, name) { + lines[name] = raphaelRenderUtil.renderLine(self.paper, path, borderColor, 1); + }); + + return lines; + }, + + /** + * Render bar borders. + * @param {Array.>} groupBounds bounds + * @returns {Array.>} borders + * @private + */ + _renderBarBorders: function(groupBounds) { + var self = this, + borderColor = this.theme.borderColor, + groupBorders; + + if (!borderColor) { + return null; + } + + groupBorders = snippet.map(groupBounds, function(bounds, groupIndex) { + return snippet.map(bounds, function(bound, index) { + var seriesItem; + + if (!bound) { + return null; + } + + seriesItem = self.seriesDataModel.getSeriesItem(groupIndex, index); + + return self._renderBorderLines(bound.start, borderColor, self.chartType, seriesItem); + }); + }); + + return groupBorders; + }, + + /** + * Animate rect. + * @param {object} rect raphael object + * @param {{left: number, top:number, width: number, height: number}} bound rect bound + * @private + */ + _animateRect: function(rect, bound) { + rect.animate({ + x: bound.left, + y: bound.top, + width: bound.width, + height: bound.height + }, ANIMATION_DURATION, '>'); + }, + + /** + * Animate borders. + * @param {Array.} lines raphael objects + * @param {{left: number, top:number, width: number, height: number}} bound rect bound + * @param {string} chartType chart type + * @param {Item} item item + * @private + */ + _animateBorders: function(lines, bound, chartType, item) { + var paths = this._makeBorderLinesPaths(bound, chartType, item); + + snippet.forEach(lines, function(line, name) { + line.animate({ + path: paths[name] + }, ANIMATION_DURATION, '>'); + }); + }, + + /** + * Animate. + * @param {function} onFinish finish callback function + */ + animate: function(onFinish) { + var self = this, + groupBorders = this.groupBorders || []; + + raphaelRenderUtil.forEach2dArray(this.groupBars, function(bar, groupIndex, index) { + var lines = groupBorders[groupIndex] && groupBorders[groupIndex][index]; + if (!bar) { + return; + } + self._animateRect(bar.rect, bar.bound); + if (lines) { + self._animateBorders(lines, bar.bound, self.chartType, bar.item); + } + }); + + if (onFinish) { + this.callbackTimeout = setTimeout(function() { + onFinish(); + delete self.callbackTimeout; + }, ANIMATION_DURATION); + } + }, + + /** + * Show animation. + * @param {{groupIndex: number, index:number}} data show info + */ + showAnimation: function(data) { + var bar = this.groupBars[data.groupIndex][data.index], + bound = bar.bound; + this.overlay.attr({ + width: bound.width, + height: bound.height, + x: bound.left, + y: bound.top, + 'fill-opacity': 0.3 + }); + }, + + /** + * Hide animation. + */ + hideAnimation: function() { + this.overlay.attr({ + width: 1, + height: 1, + x: 0, + y: 0, + 'fill-opacity': 0 + }); + }, + + /** + * Update rect bound + * @param {object} rect raphael object + * @param {{left: number, top: number, width: number, height: number}} bound bound + * @private + */ + _updateRectBound: function(rect, bound) { + rect.attr({ + x: bound.left, + y: bound.top, + width: bound.width, + height: bound.height + }); + }, + + /** + * Resize graph of bar type chart. + * @param {object} params parameters + * @param {{width: number, height:number}} params.dimension dimension + * @param {Array.>} params.groupBounds group bounds + */ + resize: function(params) { + var self = this, + groupBorders = this.groupBorders || [], + dimension = params.dimension, + groupBounds = params.groupBounds; + + this.groupBounds = groupBounds; + this.paper.setSize(dimension.width, dimension.height); + + raphaelRenderUtil.forEach2dArray(this.groupBars, function(bar, groupIndex, index) { + var lines, bound; + + if (!bar) { + return; + } + + lines = groupBorders[groupIndex] && groupBorders[groupIndex][index]; + bound = groupBounds[groupIndex][index].end; + bar.bound = bound; + raphaelRenderUtil.updateRectBound(bar.rect, bound); + + if (lines) { + self._updateBordersPath(lines, bound, self.chartType, bar.item); + } + }); + }, + + /** + * Change borders color. + * @param {Array.} lines raphael objects + * @param {borderColor} borderColor border color + * @private + */ + _changeBordersColor: function(lines, borderColor) { + snippet.forEach(lines, function(line) { + line.attr({stroke: borderColor}); + }); + }, + + /** + * Change bar color. + * @param {{groupIndex: number, index: number}} indexes indexes + * @param {string} color fill color + * @param {?string} borderColor stroke color + * @private + */ + _changeBarColor: function(indexes, color, borderColor) { + var bar = this.groupBars[indexes.groupIndex][indexes.index], + lines; + + bar.rect.attr({ + fill: color + }); + + if (borderColor) { + lines = this.groupBorders[indexes.groupIndex][indexes.index]; + this._changeBordersColor(lines, borderColor); + } + }, + + /** + * Select series. + * @param {{groupIndex: number, index: number}} indexes indexes + */ + selectSeries: function(indexes) { + var bar = this.groupBars[indexes.groupIndex][indexes.index], + objColor = raphael.color(bar.color), + selectionColorTheme = this.theme.selectionColor, + color = selectionColorTheme || raphaelRenderUtil.makeChangedLuminanceColor(objColor.hex, DEFAULT_LUMINANC), + borderColor = this.theme.borderColor, + objBorderColor; + + if (borderColor) { + objBorderColor = raphael.color(borderColor); + borderColor = raphaelRenderUtil.makeChangedLuminanceColor(objBorderColor.hex, DEFAULT_LUMINANC); + } + + this._changeBarColor(indexes, color, borderColor); + }, + + /** + * Unselect series. + * @param {{groupIndex: number, index: number}} indexes indexes + */ + unselectSeries: function(indexes) { + var bar = this.groupBars[indexes.groupIndex][indexes.index], + borderColor = this.theme.borderColor; + this._changeBarColor(indexes, bar.color, borderColor); + }, + + /** + * Select legend. + * @param {?number} legendIndex legend index + */ + selectLegend: function(legendIndex) { + var groupBorders = this.groupBorders || [], + noneSelected = snippet.isNull(legendIndex); + + raphaelRenderUtil.forEach2dArray(this.groupBars, function(bar, groupIndex, index) { + var lines, opacity; + + if (!bar) { + return; + } + + lines = groupBorders[groupIndex] && groupBorders[groupIndex][index]; + opacity = (noneSelected || legendIndex === index) ? EMPHASIS_OPACITY : DE_EMPHASIS_OPACITY; + + bar.rect.attr({'fill-opacity': opacity}); + if (lines) { + snippet.forEach(lines, function(line) { + line.attr({'stroke-opacity': opacity}); + }); + } + }); + }, + + renderSeriesLabel: function(paper, groupPositions, groupLabels, labelTheme, isStacked) { + var textAnchor = (isStacked || this.chartType === 'column') ? 'middle' : 'start'; + var attributes = { + 'font-size': labelTheme.fontSize, + 'font-family': labelTheme.fontFamily, + 'font-weight': labelTheme.fontWeight, + fill: labelTheme.color, + opacity: 0, + 'text-anchor': textAnchor + }; + var labelSet = paper.set(); + + snippet.forEach(groupLabels, function(categoryLabel, categoryIndex) { + snippet.forEach(categoryLabel, function(label, seriesIndex) { + var position = groupPositions[categoryIndex][seriesIndex]; + var endLabel = raphaelRenderUtil.renderText(paper, position.end, label.end, attributes); + var startLabel; + + endLabel.node.style.userSelect = 'none'; + endLabel.node.style.cursor = 'default'; + endLabel.node.setAttribute('filter', 'url(#glow)'); + + labelSet.push(endLabel); + + if (position.start) { + startLabel = raphaelRenderUtil.renderText(paper, position.start, label.start, attributes); + startLabel.node.style.userSelect = 'none'; + startLabel.node.style.cursor = 'default'; + startLabel.node.setAttribute('filter', 'url(#glow)'); + + labelSet.push(startLabel); + } + }); + }); + + return labelSet; + } + }); + + module.exports = RaphaelBarChart; + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Util for raphael rendering. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + var renderUtil = __webpack_require__(7); + var raphael = __webpack_require__(3); + + /** + * Util for raphael rendering. + * @module raphaelRenderUtil + * @private + */ + var raphaelRenderUtil = { + + /** + * Make line path. + * @memberOf module:raphaelRenderUtil + * @param {{top: number, left: number}} fromPos from position + * @param {{top: number, left: number}} toPos to position + * @param {number} width width + * @returns {string} path + */ + makeLinePath: function(fromPos, toPos, width) { + var fromPoint = [fromPos.left, fromPos.top]; + var toPoint = [toPos.left, toPos.top]; + var additionalPoint; + + width = width || 1; + additionalPoint = (width % 2 / 2); + + snippet.forEachArray(fromPoint, function(from, index) { + if (from === toPoint[index]) { + fromPoint[index] = toPoint[index] = Math.round(from) - additionalPoint; + } + }); + + return ['M'].concat(fromPoint).concat('L').concat(toPoint); + }, + + /** + * Render line. + * @memberOf module:raphaelRenderUtil + * @param {object} paper raphael paper + * @param {string} path line path + * @param {string} color line color + * @param {number} strokeWidth stroke width + * @returns {object} raphael line + */ + renderLine: function(paper, path, color, strokeWidth) { + var line = paper.path([path]), + strokeStyle = { + stroke: color, + 'stroke-width': strokeWidth || 2 + }; + + if (color === 'transparent') { + strokeStyle.stroke = '#fff'; + strokeStyle['stroke-opacity'] = 0; + } + line.attr(strokeStyle); + + return line; + }, + + /** + * text ellipsis for fixed width + * @param {string} text - target text + * @param {number} fixedWidth - width for elipsis + * @param {object} theme - lable theme + * @returns {string} + */ + getEllipsisText: function(text, fixedWidth, theme) { + var textArray = text.split(''); + var textLength = textArray.length; + var dotWidth = this.getRenderedTextSize('.', theme.fontSize, theme.fontFamily).width; + var textWidth = dotWidth * 2; + var newString = ''; + var i = 0; + + for (; i < textLength; i += 1) { + textWidth += this.getRenderedTextSize(textArray[i], theme.fontSize, theme.fontFamily).width; + if (textWidth >= fixedWidth) { + newString += '..'; + break; + } + newString += textArray[i]; + } + + return newString; + }, + + /** + * Render text + * @param {object} paper - Raphael paper object + * @param {{left: number, top: number}} pos - text object position + * @param {string} text - text content + * @param {object} [attributes] - text object's attributes + * @returns {object} + */ + renderText: function(paper, pos, text, attributes) { + var textObj = paper.text(pos.left, pos.top, snippet.decodeHTMLEntity(String(text))); + + if (attributes) { + if (attributes['dominant-baseline']) { + textObj.node.setAttribute('dominant-baseline', attributes['dominant-baseline']); + } else { + textObj.node.setAttribute('dominant-baseline', 'central'); + } + + textObj.attr(attributes); + } + + return textObj; + }, + + /** + * Render area graph. + * @param {object} paper raphael paper + * @param {string} path path + * @param {object} fillStyle fill style + * @param {string} fillStyle.fill fill color + * @param {?number} fillStyle.opacity fill opacity + * @param {string} fillStyle.stroke stroke color + * @param {?number} fillStyle.stroke-opacity stroke opacity + * @returns {Array.} raphael object + */ + renderArea: function(paper, path, fillStyle) { + var area = paper.path(path); + + fillStyle = snippet.extend({ + 'stroke-opacity': 0 + }, fillStyle); + area.attr(fillStyle); + + return area; + }, + + /** + * Render circle. + * @param {object} paper - raphael object + * @param {{left: number, top: number}} position - position + * @param {number} radius - radius + * @param {object} attributes - attributes + * @returns {object} + */ + renderCircle: function(paper, position, radius, attributes) { + var circle = paper.circle(position.left, position.top, radius); + + if (attributes) { + circle.attr(attributes); + } + + return circle; + }, + + /** + * Render rect. + * @param {object} paper - raphael object + * @param {{left: number, top: number, width: number, height, number}} bound - bound + * @param {object} attributes - attributes + * @returns {*} + */ + renderRect: function(paper, bound, attributes) { + var rect = paper.rect(bound.left, bound.top, bound.width, bound.height); + + if (attributes) { + rect.attr(attributes); + } + + return rect; + }, + + /** + * Update rect bound + * @param {object} rect raphael object + * @param {{left: number, top: number, width: number, height: number}} bound bound + */ + updateRectBound: function(rect, bound) { + rect.attr({ + x: bound.left, + y: bound.top, + width: bound.width, + height: bound.height + }); + }, + + /** + * Render items of line type chart. + * @param {Array.>} groupItems group items + * @param {function} funcRenderItem function + */ + forEach2dArray: function(groupItems, funcRenderItem) { + if (groupItems) { + snippet.forEachArray(groupItems, function(items, groupIndex) { + snippet.forEachArray(items, function(item, index) { + funcRenderItem(item, groupIndex, index); + }); + }); + } + }, + + /** + * Make changed luminance color. + * @param {string} hex hax color + * @param {number} lum luminance + * @returns {string} changed color + */ + makeChangedLuminanceColor: function(hex, lum) { + var changedHex; + + hex = hex.replace('#', ''); + lum = lum || 0; + + changedHex = snippet.map(snippet.range(3), function(index) { + var hd = parseInt(hex.substr(index * 2, 2), 16); + var newHd = hd + (hd * lum); + + newHd = Math.round(Math.min(Math.max(0, newHd), 255)).toString(16); + + return renderUtil.formatToZeroFill(newHd, 2); + }).join(''); + + return '#' + changedHex; + }, + + /** + * Get rendered text element size + * @param {string} text text content + * @param {number} fontSize font-size attribute + * @param {string} fontFamily font-family attribute + * @returns {{ + * width: number, + * height: number + * }} + */ + getRenderedTextSize: function(text, fontSize, fontFamily) { + var paper = raphael(document.body, 100, 100); + var textElement = paper.text(0, 0, text).attr({ + 'font-size': fontSize, + 'font-family': fontFamily + }); + var bBox = textElement.getBBox(); + + textElement.remove(); + paper.remove(); + + return { + width: bBox.width, + height: bBox.height + }; + }, + + /** + * Animate given element's opacity + * @param {object} element element + * @param {number} startOpacity endOpacity default is '0' + * @param {number} endOpacity endOpacity default is '1' + * @param {number} duration endOpacity default is '600' + */ + animateOpacity: function(element, startOpacity, endOpacity, duration) { + var animationDuration = isNumber(duration) ? duration : 600; + var animationStartOpacity = isNumber(startOpacity) ? startOpacity : 0; + var animationEndOpacity = isNumber(endOpacity) ? endOpacity : 1; + var animation = raphael.animation({ + opacity: animationEndOpacity + }, animationDuration); + + element.attr({ + opacity: animationStartOpacity + }); + + element.animate(animation); + } + }; + + /** + * Return boolean value for given parameter is number or not + * @param {*} numberSuspect number suspect + * @returns {boolean} + */ + function isNumber(numberSuspect) { + return snippet.isExisty(numberSuspect) && typeof numberSuspect === 'number'; + } + + module.exports = raphaelRenderUtil; + + +/***/ }), +/* 6 */ +/***/ (function(module, exports) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_6__; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Util for rendering. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var dom = __webpack_require__(9); + var arrayUtil = __webpack_require__(10); + + var snippet = __webpack_require__(6); + var predicate = __webpack_require__(11); + + var concat = Array.prototype.concat; + + var browser = snippet.browser, + isIE7 = browser.msie && browser.version === 7, + isOldBrowser = browser.msie && browser.version <= 8; + var hasComputedStyle = window.getComputedStyle || false; + + var lineBaseChartCount = 0; + var CLIP_RECT_ID = 'clipRectForAnimation'; + + /** + * Util for rendering. + * @module renderUtil + * @private */ + var renderUtil = { + /** + * Concat string. + * @params {...string} target strings + * @returns {string} concat string + * @memberof module:renderUtil + */ + concatStr: function() { + return String.prototype.concat.apply('', arguments); + }, + + /** + * Make cssText for font. + * @param {{fontSize: number, fontFamily: string, color: string}} theme font theme + * @returns {string} cssText + * @memberof module:renderUtil + */ + makeFontCssText: function(theme) { + var cssTexts = []; + + if (!theme) { + return ''; + } + + if (theme.fontSize) { + cssTexts.push(this.concatStr('font-size:', theme.fontSize, 'px')); + } + + if (theme.fontFamily) { + cssTexts.push(this.concatStr('font-family:', theme.fontFamily)); + } + + if (theme.color) { + cssTexts.push(this.concatStr('color:', theme.color)); + } + + if (theme.fontWeight) { + cssTexts.push(this.concatStr('font-weight:', theme.fontWeight)); + } + + return cssTexts.join(';'); + }, + + checkEl: null, + /** + * Create element for size check. + * @memberof module:renderUtil + * @returns {HTMLElement} element + * @private + */ + _createSizeCheckEl: function() { + var div, span; + if (!this.checkEl) { + div = dom.create('DIV', 'tui-chart-size-check-element'); + span = dom.create('SPAN'); + div.appendChild(span); + this.checkEl = div; + } else { + this.checkEl.style.cssText = ''; + } + + return this.checkEl; + }, + + /** + * Make caching key. + * @param {string} label labek + * @param {{fontSize: number, fontFamily: string}} theme theme + * @param {string} offsetType offset type (offsetWidth or offsetHeight) + * @returns {string} key + * @private + */ + _makeCachingKey: function(label, theme, offsetType) { + var keys = [label, offsetType]; + + snippet.forEach(theme, function(key, value) { + keys.push(key + value); + }); + + return keys.join('-'); + }, + + /** + * Add css style. + * @param {HTMLElement} div div element + * @param {{fontSize: number, fontFamily: string, cssText: string}} theme theme + * @private + */ + _addCssStyle: function(div, theme) { + div.style.fontSize = (theme.fontSize || chartConst.DEFAULT_LABEL_FONT_SIZE) + 'px'; + + if (theme.fontFamily) { + div.style.fontFamily = theme.fontFamily; + } + + if (theme.fontWeight) { + div.style.fontWeight = theme.fontWeight; + } + + if (theme.cssText) { + div.style.cssText += theme.cssText; + } + }, + + /** + * Size cache. + * @type {object} + * @private + */ + sizeCache: {}, + + /** + * Get rendered label size (width or height). + * @memberOf module:renderUtil + * @param {string | number} label label + * @param {object} theme theme + * @param {string} offsetType offset type (offsetWidth or offsetHeight) + * @returns {number} size + * @private + */ + _getRenderedLabelSize: function(label, theme, offsetType) { + var key, div, span, labelSize; + + theme = theme || {}; + + label = snippet.isExisty(label) ? String(label) : ''; + + if (!label) { + return 0; + } + + key = this._makeCachingKey(label, theme, offsetType); + labelSize = this.sizeCache[key]; + + if (!labelSize) { + div = this._createSizeCheckEl(); + span = div.firstChild; + + span.innerHTML = label; + + this._addCssStyle(div, theme); + + document.body.appendChild(div); + labelSize = span[offsetType]; + document.body.removeChild(div); + + this.sizeCache[key] = labelSize; + } + + return labelSize; + }, + + /** + * Get rendered label width. + * @memberof module:renderUtil + * @param {string} label label + * @param {{fontSize: number, fontFamily: string, color: string}} theme label theme + * @returns {number} width + */ + getRenderedLabelWidth: function(label, theme) { + var labelWidth = this._getRenderedLabelSize(label, theme, 'offsetWidth'); + + return labelWidth; + }, + + /** + * Get rendered label height. + * @memberof module:renderUtil + * @param {string} label label + * @param {{fontSize: number, fontFamily: string, color: string}} theme label theme + * @returns {number} height + */ + getRenderedLabelHeight: function(label, theme) { + var labelHeight = this._getRenderedLabelSize(label, theme, 'offsetHeight'); + + return labelHeight; + }, + + /** + * Get Rendered Labels Max Size(width or height). + * @memberof module:renderUtil + * @param {string[]} labels labels + * @param {{fontSize: number, fontFamily: string, color: string}} theme label theme + * @param {function} iteratee iteratee + * @returns {number} max size (width or height) + * @private + */ + _getRenderedLabelsMaxSize: function(labels, theme, iteratee) { + var maxSize = 0, + sizes; + + if (labels && labels.length) { + sizes = snippet.map(labels, function(label) { + return iteratee(label, theme); + }); + maxSize = arrayUtil.max(sizes); + } + + return maxSize; + }, + + /** + * Get rendered labels max width. + * @memberof module:renderUtil + * @param {string[]} labels labels + * @param {{fontSize: number, fontFamily: string, color: string}} theme label theme + * @returns {number} max width + * @private + */ + getRenderedLabelsMaxWidth: function(labels, theme) { + var iteratee = snippet.bind(this.getRenderedLabelWidth, this); + var maxWidth = this._getRenderedLabelsMaxSize(labels, theme, iteratee); + + return maxWidth; + }, + + /** + * Get rendered labels max height. + * @memberof module:renderUtil + * @param {string[]} labels labels + * @param {{fontSize: number, fontFamily: string, color: string}} theme label theme + * @returns {number} max height + */ + getRenderedLabelsMaxHeight: function(labels, theme) { + var iteratee = snippet.bind(this.getRenderedLabelHeight, this); + var maxHeight = this._getRenderedLabelsMaxSize(labels, theme, iteratee); + + return maxHeight; + }, + + /** + * Render dimension. + * @memberof module:renderUtil + * @param {HTMLElement} el target element + * @param {{width: number, height: number}} dimension dimension + */ + renderDimension: function(el, dimension) { + el.style.cssText = [ + this.concatStr('width:', dimension.width, 'px'), + this.concatStr('height:', dimension.height, 'px') + ].join(';'); + }, + + /** + * Render position(top, right). + * @memberof module:renderUtil + * @param {HTMLElement} el target element + * @param {{top: number, left: number, right: number}} position position + */ + renderPosition: function(el, position) { + if (snippet.isUndefined(position)) { + return; + } + + snippet.forEachArray(['top', 'bottom', 'left', 'right'], function(key) { + var value = position[key]; + + if (snippet.isNumber(value)) { + el.style[key] = position[key] + 'px'; + } + }); + }, + + /** + * Render background. + * @memberof module:renderUtil + * @param {HTMLElement} el target element + * @param {string} background background option + */ + renderBackground: function(el, background) { + if (!background) { + return; + } + + el.style.background = background; + }, + + /** + * Render font family. + * @memberof module:renderUtil + * @param {HTMLElement} el target element + * @param {string} fontFamily font family option + */ + renderFontFamily: function(el, fontFamily) { + if (!fontFamily) { + return; + } + + el.style.fontFamily = fontFamily; + }, + + /** + * Render title. + * @memberof module:renderUtil + * @param {string} title title + * @param {{fontSize: number, color: string, background: string}} theme title theme + * @param {string} className css class name + * @returns {HTMLElement} title element + */ + renderTitle: function(title, theme, className) { + var elTitle, cssText; + + if (!title) { + return null; + } + + elTitle = dom.create('DIV', className); + elTitle.innerHTML = title; + + cssText = renderUtil.makeFontCssText(theme); + + if (theme.background) { + cssText += ';' + this.concatStr('background:', theme.background); + } + + elTitle.style.cssText = cssText; + + return elTitle; + }, + + /** + * Expand dimension. + * @param {{ + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }} bound series bound + * @returns {{ + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }} expended bound + * @memberof module:renderUtil + */ + expandBound: function(bound) { + var dimension = bound.dimension; + var position = bound.position; + + return { + dimension: { + width: dimension.width + (chartConst.SERIES_EXPAND_SIZE * 2), + height: dimension.height + (chartConst.SERIES_EXPAND_SIZE * 2) + }, + position: { + left: position.left - chartConst.SERIES_EXPAND_SIZE, + top: position.top - chartConst.SERIES_EXPAND_SIZE + } + }; + }, + + /** + * Proper case. + * @param {string} value - string value + * @returns {string} + */ + _properCase: function(value) { + return value.substring(0, 1).toUpperCase() + value.substring(1); + }, + + /** + * Make mouse event detector name. + * @param {string} prefix prefix + * @param {string} value value + * @param {string} suffix suffix + * @returns {string} mouse event detector name + * @memberof module:renderUtil + */ + makeMouseEventDetectorName: function(prefix, value, suffix) { + return prefix + this._properCase(value) + this._properCase(suffix); + }, + + /** + * Format value. + * @param {object} params - raw data + * @param {number} params.value value + * @param {Array.} params.formatFunctions - functions for format + * @param {string} params.chartType - type of chart + * @param {string} params.areaType - type of area like yAxis, xAxis, series, circleLegend + * @param {string} [params.valueType] - type of value + * @param {string} [params.legendName] - legendName + * @returns {string} formatted value + * @memberof module:renderUtil + */ + formatValue: function(params) { + var value = params.value; + var formatFunctions = params.formatFunctions; + var valueType = params.valueType || 'value'; + var areaType = params.areaType; + var chartType = params.chartType; + var legendName = params.legendName; + + var fns = [String(value)].concat(formatFunctions || []); + + return snippet.reduce(fns, function(stored, fn) { + return fn(stored, chartType, areaType, valueType, legendName); + }); + }, + /** + * Format values. + * @param {Array.} values values + * @param {Array.} formatFunctions functions for format + * @param {string} chartType - type of chart + * @param {string} areaType - type of area like yAxis, xAxis, series, circleLegend + * @param {string} valueType - type of value + * @returns {Array.} + * @memberof module:renderUtil + */ + formatValues: function(values, formatFunctions, chartType, areaType, valueType) { + var formatedValues; + + if (!formatFunctions || !formatFunctions.length) { + return values; + } + + formatedValues = snippet.map(values, function(label) { + return renderUtil.formatValue({ + value: label, + formatFunctions: formatFunctions, + chartType: chartType, + areaType: areaType, + valueType: valueType + }); + }); + + return formatedValues; + }, + + /** + * Format date. + * @param {string | number | date} value - value + * @param {string} format - date format + * @returns {string} + * @memberof module:renderUtil + */ + formatDate: function(value, format) { + var date = snippet.isDate(value) ? value : (new Date(value)); + format = format || chartConst.DEFAULT_DATE_FORMAT; + + return snippet.formatDate(format, date) || value; + }, + + /** + * Format dates. + * @param {Array.} values - values + * @param {string} format - date format + * @returns {Array} + * @memberof module:renderUtil + */ + formatDates: function(values, format) { + var formatDate = this.formatDate; + + format = format || chartConst.DEFAULT_DATE_FORMAT; + + return snippet.map(values, function(value) { + return formatDate(value, format); + }); + }, + + /** + * Cancel animation + * @param {{id: number}} animation animaion object + * @memberof module:renderUtil + */ + cancelAnimation: function(animation) { + if (animation && animation.id) { + cancelAnimationFrame(animation.id); + delete animation.id; + } + }, + + /** + * Start animation. + * @param {number} animationTime - animation time + * @param {function} onAnimation - animation callback function + * @param {function} onCompleted - completed callback function + * @returns {{id: number}} requestAnimationFrame id + * @memberof module:renderUtil + */ + startAnimation: function(animationTime, onAnimation, onCompleted) { + var animation = {}, + startTime; + + /** + * Animate. + */ + function animate() { + var diffTime = (new Date()).getTime() - startTime, + ratio = Math.min((diffTime / animationTime), 1); + + onAnimation(ratio); + + if (ratio === 1) { + delete animation.id; + if (onCompleted) { + onCompleted(); + } + } else { + animation.id = requestAnimationFrame(animate); + } + } + + startTime = (new Date()).getTime(); + animation.id = requestAnimationFrame(animate); + + return animation; + }, + + /** + * Whether IE7 or not. + * @returns {boolean} result boolean + */ + isIE7: function() { + return isIE7; + }, + + /** + * Whether oldBrowser or not. + * @memberof module:renderUtil + * @returns {boolean} result boolean + */ + isOldBrowser: function() { + return isOldBrowser; + }, + + /** + * Format to zero fill. + * @param {string} value target value + * @param {number} len length of result + * @returns {string} formatted value + * @private + */ + formatToZeroFill: function(value, len) { + var zero = '0'; + + value = String(value); + + if (value.length >= len) { + return value; + } + + while (value.length < len) { + value = zero + value; + } + + return value; + }, + + /** + * Format to Decimal. + * @param {string} value target value + * @param {number} len length of under decimal point + * @returns {string} formatted value + * @memberof module:renderUtil + */ + formatToDecimal: function(value, len) { + var DECIMAL = 10; + var pow; + + if (len === 0) { + return Math.round(value); + } + + pow = Math.pow(DECIMAL, len); + value = Math.round(value * pow) / pow; + value = parseFloat(value).toFixed(len); + + return value; + }, + + /** + * Format to Comma. + * @param {string} value target value + * @returns {string} formatted value + * @private + */ + formatToComma: function(value) { + var comma = ',', + underPointValue = '', + betweenLen = 3, + orgValue = value, + sign, values, lastIndex, formattedValue; + + value = String(value); + sign = value.indexOf('-') > -1 ? '-' : ''; + + if (value.indexOf('.') > -1) { + values = value.split('.'); + value = String(Math.abs(values[0])); + underPointValue = '.' + values[1]; + } else { + value = String(Math.abs(value)); + } + + if (value.length <= betweenLen) { + formattedValue = orgValue; + } else { + values = (value).split('').reverse(); + lastIndex = values.length - 1; + values = snippet.map(values, function(char, index) { + var result = [char]; + if (index < lastIndex && (index + 1) % betweenLen === 0) { + result.push(comma); + } + + return result; + }); + formattedValue = sign + concat.apply([], values).reverse().join('') + underPointValue; + } + + return formattedValue; + }, + + /** + * Make cssText from map. + * @param {object} cssMap - css map + * @returns {string} + * @memberof module:renderUtil + */ + makeCssTextFromMap: function(cssMap) { + return snippet.map(cssMap, function(value, name) { + return renderUtil.concatStr(name, ':', value); + }).join(';'); + }, + + /** + * Perse String. + * @param {string} value - string + * @returns {string} + */ + _perseString: function(value) { + return typeof value === 'string' || typeof value === 'number' ? String(value) : ''; + }, + + /** + * Add prefix or suffix to label. + * @param {array} labels - labels + * @param {string} prefix - string + * @param {string} suffix - string + * @returns {array} + * @memberof module:renderUtil + */ + addPrefixSuffix: function(labels, prefix, suffix) { + prefix = this._perseString(prefix); + suffix = this._perseString(suffix); + + if (!(prefix === '' && suffix === '')) { + return snippet.map(labels, function(label) { + return prefix + label + suffix; + }); + } + + return labels; + }, + + /** + * Returns element's style value defined at css file + * @param {HTMLElement} target - Current element + * @returns {Object} Style object of element + * @memberof module:renderUtil + */ + getStyle: function(target) { + var computedObj; + + if (hasComputedStyle) { + computedObj = window.getComputedStyle(target, ''); + } else { + computedObj = target.currentStyle; + } + + return computedObj; + }, + + /** + * Get clip rect id + * @returns {string} create unique id by line base chart count + */ + generateClipRectId: function() { + var id = CLIP_RECT_ID + lineBaseChartCount; + lineBaseChartCount += 1; + + return id; + }, + + /** + * get default height of series top area + * @param {string} chartType - chart type + * @param {object} theme - series theme + * @returns {number} - default series top height + */ + getDefaultSeriesTopAreaHeight: function(chartType, theme) { + if (predicate.isBarTypeChart(chartType) || + predicate.isLineTypeChart(chartType) || + predicate.isComboChart(chartType) || + predicate.isBulletChart(chartType) + ) { + return this.getRenderedLabelHeight(chartConst.MAX_HEIGHT_WORD, theme) + + chartConst.SERIES_LABEL_PADDING; + } + + return 0; + } + }; + + /** + * Set css opacity. + * @param {HTMLElement | Array.} elements - elements + * @param {function} iteratee - iteratee + * @ignore + */ + function setOpacity(elements, iteratee) { + elements = snippet.isArray(elements) ? elements : [elements]; + snippet.forEachArray(elements, iteratee); + } + + /** + * Make filter opacity css string. + * @param {number} opacity - opacity + * @returns {string} + * @ignore + */ + function makeCssFilterOpacityString(opacity) { + return 'alpha(opacity=' + (opacity * chartConst.OLD_BROWSER_OPACITY_100) + ')'; + } + + if (isOldBrowser) { + /** + * Make opacity css text for old browser(IE7, IE8). + * @param {number} opacity - opacity + * @returns {string} + */ + renderUtil.makeOpacityCssText = function(opacity) { + var cssText = ''; + + if (snippet.isExisty(opacity)) { + cssText = ';filter:' + makeCssFilterOpacityString(opacity); + } + + return cssText; + }; + + /** + * Set css opacity for old browser(IE7, IE8). + * @param {HTMLElement | Array.} elements - elements + * @param {number} opacity - opacity + */ + renderUtil.setOpacity = function(elements, opacity) { + var filter = makeCssFilterOpacityString(opacity); + setOpacity(elements, function(element) { + element.style.filter = filter; + }); + }; + } else { + /** + * Make opacity css text for browser supporting opacity property of CSS3. + * @param {number} opacity - opacity + * @returns {string} + */ + renderUtil.makeOpacityCssText = function(opacity) { + var cssText = ''; + + if (snippet.isExisty(opacity)) { + cssText = ';opacity:' + opacity; + } + + return cssText; + }; + + /** + * Set css opacity for browser supporting opacity property of CSS3. + * @param {HTMLElement | Array.} elements - elements + * @param {number} opacity - opacity + */ + renderUtil.setOpacity = function(elements, opacity) { + setOpacity(elements, function(element) { + element.style.opacity = opacity; + }); + }; + } + + module.exports = renderUtil; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + + /** + * @fileoverview Chart const + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + /** + * Chart const + * @readonly + * @enum {number|string} + * @private + */ + var chartConst = { + /** tui class names + * @type {string} + */ + CLASS_NAME_LEGEND_LABEL: 'tui-chart-legend-label', + /** @type {string} */ + CLASS_NAME_LEGEND_CHECKBOX: 'tui-chart-legend-checkbox', + /** @type {string} */ + CLASS_NAME_SERIES_LABEL: 'tui-chart-series-label', + /** @type {string} */ + CLASS_NAME_SERIES_LEGEND: 'tui-chart-series-legend', + /** @type {string} */ + CLASS_NAME_RESET_ZOOM_BTN: 'tui-chart-reset-zoom-btn', + /** @type {string} */ + CLASS_NAME_CHART_EXPORT_MENU_AREA: 'tui-chart-chartExportMenu-area', + /** @type {string} */ + CLASS_NAME_CHART_EXPORT_MENU_ITEM: 'tui-chart-chartExportMenu-item', + /** @type {string} */ + CLASS_NAME_CHART_EXPORT_MENU_BUTTON: 'tui-chart-chartExportMenu-button', + /** chart type + * @type {string} + */ + CHART_TYPE_BAR: 'bar', + /** @type {string} */ + CHART_TYPE_COLUMN: 'column', + /** @type {string} */ + CHART_TYPE_LINE: 'line', + /** @type {string} */ + CHART_TYPE_AREA: 'area', + /** @type {string} */ + CHART_TYPE_COMBO: 'combo', + /** @type {string} */ + CHART_TYPE_COLUMN_LINE_COMBO: 'columnLineCombo', + /** @type {string} */ + CHART_TYPE_LINE_SCATTER_COMBO: 'lineScatterCombo', + /** @type {string} */ + CHART_TYPE_LINE_AREA_COMBO: 'lineAreaCombo', + /** @type {string} */ + CHART_TYPE_PIE_DONUT_COMBO: 'pieDonutCombo', + /** @type {string} */ + CHART_TYPE_PIE: 'pie', + /** @type {string} */ + CHART_TYPE_BUBBLE: 'bubble', + /** @type {string} */ + CHART_TYPE_SCATTER: 'scatter', + /** @type {string} */ + CHART_TYPE_HEATMAP: 'heatmap', + /** @type {string} */ + CHART_TYPE_TREEMAP: 'treemap', + /** @type {string} */ + CHART_TYPE_MAP: 'map', + /** @type {string} */ + CHART_TYPE_RADIAL: 'radial', + /** @type {string} */ + CHART_TYPE_BOXPLOT: 'boxplot', + /** @type {string} */ + CHART_TYPE_BULLET: 'bullet', + /** chart padding */ + CHART_PADDING: 10, + /** chart default width */ + CHART_DEFAULT_WIDTH: 500, + /** chart default height */ + CHART_DEFAULT_HEIGHT: 400, + /** overlapping width of xAxis and yAxis */ + OVERLAPPING_WIDTH: 1, + /** rendered text padding */ + TEXT_PADDING: 2, + /** series expand size */ + SERIES_EXPAND_SIZE: 10, + /** series label padding */ + SERIES_LABEL_PADDING: 5, + /** default font size of title */ + DEFAULT_TITLE_FONT_SIZE: 14, + /** default font size of axis title */ + DEFAULT_AXIS_TITLE_FONT_SIZE: 10, + /** default font size of label */ + DEFAULT_LABEL_FONT_SIZE: 12, + /** default font size of series label */ + DEFAULT_SERIES_LABEL_FONT_SIZE: 11, + /** default graph plugin + * @type {string} + */ + DEFAULT_PLUGIN: 'Raphael', + /** default tick color + * @type {string} + */ + DEFAULT_TICK_COLOR: 'black', + /** default theme name + * @type {string} + */ + DEFAULT_THEME_NAME: 'default', + MAX_HEIGHT_WORD: 'A', + /** stack type + * @type {string} + */ + NORMAL_STACK_TYPE: 'normal', + /** @type {string} */ + PERCENT_STACK_TYPE: 'percent', + /** default stack + * @type {string} + */ + DEFAULT_STACK: '___DEFAULT___STACK___', + /** dummy key + * @type {string} + */ + DUMMY_KEY: '___DUMMY___KEY___', + /** root id of treemap + * @type {string} + */ + TREEMAP_ROOT_ID: '___TUI_TREEMAP_ROOT___', + /** id prefix of treemap + * @type {string} + */ + TREEMAP_ID_PREFIX: '___TUI_TREEMAP_ID___', + /** prefix for caching seriesItems + * @type {string} + */ + TREEMAP_DEPTH_KEY_PREFIX: '___TUI_TREEMAP_DEPTH___', + /** @type {string} */ + TREEMAP_PARENT_KEY_PREFIX: '___TUI_TREEMAP_PARENT___', + /** @type {string} */ + TREEMAP_LEAF_KEY_PREFIX: '___TUI_TREEMAP_LEAF___', + /** @type {string} */ + TREEMAP_LIMIT_DEPTH_KEY_PREFIX: '___TUI_TREEMAP_LIMIT_DEPTH___', + /** default border color for treemap chart + * @type {string} + */ + TREEMAP_DEFAULT_BORDER: '#ccc', + /** empty axis label */ + EMPTY_AXIS_LABEL: '', + /** angel */ + ANGLE_85: 85, + ANGLE_90: 90, + ANGLE_360: 360, + /** radian */ + RAD: Math.PI / 180, + RERENDER_TIME: 700, + ADDING_DATA_ANIMATION_DURATION: 300, + /** series label align outer + * @type {string} + */ + LABEL_ALIGN_OUTER: 'outer', + /** @type {string} */ + LEGEND_ALIGN_TOP: 'top', + /** @type {string} */ + LEGEND_ALIGN_BOTTOM: 'bottom', + /** @type {string} */ + LEGEND_ALIGN_LEFT: 'left', + /** @type {number} */ + LEGEND_PAGINATION_BUTTON_WIDTH: 10, + /** @type {number} */ + LEGEND_PAGINATION_BUTTON_PADDING_LEFT: 5, + /** series outer label padding */ + SERIES_OUTER_LABEL_PADDING: 20, + /** default ratio for pie graph */ + PIE_GRAPH_DEFAULT_RATIO: 0.9, + /** small ratio for pie graph */ + PIE_GRAPH_SMALL_RATIO: 0.75, + /** tick count for spectrum legend */ + SPECTRUM_LEGEND_TICK_COUNT: 4, + /** legend & lable concat separator */ + LABEL_SEPARATOR: '\n', + /** default position ratio of map chart label + * @type {object} + */ + MAP_CHART_LABEL_DEFAULT_POSITION_RATIO: { + x: 0.5, + y: 0.5 + }, + /** dot radius */ + DOT_RADIUS: 4, + /** radius for circle of scatter chart*/ + SCATTER_RADIUS: 5, + /** + * theme properties + * @type {{yAxis: Array., series: Array.}} + */ + THEME_PROPS_MAP: { + yAxis: ['tickColor', 'title', 'label'], + series: ['label', 'colors', 'borderColor', 'borderWidth', 'selectionColor', 'startColor', 'endColor', + 'overColor', 'dot', 'ranges'] + }, + /** title area width padding */ + TITLE_AREA_WIDTH_PADDING: 20, + /** top margin of x axis label */ + XAXIS_LABEL_TOP_MARGIN: 10, + /** right padding of vertical label */ + V_LABEL_RIGHT_PADDING: 10, + /** tooltip prefix + * @type {string} + */ + TOOLTIP_PREFIX: 'tui-chart-tooltip', + /** tooltip z-index **/ + TOOLTIP_ZINDEX: 500, + /** tooltip animation time */ + TOOLTIP_ANIMATION_TIME: 100, + /** tooltip animation time for pie chart */ + TOOLTIP_PIE_ANIMATION_TIME: 50, + /** minimum pixel type step size */ + MIN_PIXEL_TYPE_STEP_SIZE: 45, + /** maximum pixel type step size */ + MAX_PIXEL_TYPE_STEP_SIZE: 65, + /** axis scale for percent stack option + * @type {object} + */ + PERCENT_STACKED_AXIS_SCALE: { + limit: { + min: 0, + max: 100 + }, + step: 25, + labels: [0, 25, 50, 75, 100] + }, + /** axis scale for minus percent stack option + * @type {object} + */ + MINUS_PERCENT_STACKED_AXIS_SCALE: { + limit: { + min: -100, + max: 0 + }, + step: 25, + labels: [0, -25, -50, -75, -100] + }, + /** axis scale of dual percent stack option + * @type {object} + */ + DUAL_PERCENT_STACKED_AXIS_SCALE: { + limit: { + min: -100, + max: 100 + }, + step: 25, + labels: [-100, -75, -50, -25, 0, 25, 50, 75, 100] + }, + /** axis scale of diverging percent stack option + * @type {object} + */ + DIVERGING_PERCENT_STACKED_AXIS_SCALE: { + limit: { + min: -100, + max: 100 + }, + step: 25, + labels: [100, 75, 50, 25, 0, 25, 50, 75, 100] + }, + /** + * datetime axis type + * @type {string} + */ + AXIS_TYPE_DATETIME: 'datetime', + /** + * default dateFormat + * @type {string} + */ + DEFAULT_DATE_FORMAT: 'YYYY.MM.DD hh:mm:dd', + /** + * date type + * @type {string} + */ + DATE_TYPE_YEAR: 'year', + DATE_TYPE_MONTH: 'month', + DATE_TYPE_WEEK: 'week', + DATE_TYPE_DATE: 'date', + DATE_TYPE_HOUR: 'hour', + DATE_TYPE_MINUTE: 'minute', + DATE_TYPE_SECOND: 'second', + /** title add padding */ + TITLE_PADDING: 10, + /** legend area padding */ + LEGEND_AREA_PADDING: 10, + /** legend checkbox width */ + LEGEND_CHECKBOX_WIDTH: 10, + LEGEND_ICON_WIDTH: 40, + LEGEND_ICON_HEIGHT: 15, + /** lgend label left padding */ + LEGEND_LABEL_LEFT_PADDING: 5, + MIN_LEGEND_WIDTH: 100, + /** map legend height */ + MAP_LEGEND_SIZE: 200, + /** map legend graph size */ + MAP_LEGEND_GRAPH_SIZE: 25, + /** map legend label padding */ + MAP_LEGEND_LABEL_PADDING: 10, + CIRCLE_LEGEND_LABEL_FONT_SIZE: 9, + CIRCLE_LEGEND_PADDING: 10, + HALF_RATIO: 0.5, + /** AXIS LABEL PADDING */ + AXIS_LABEL_PADDING: 7, + /** rotations degree candidates */ + DEGREE_CANDIDATES: [25, 45, 65, 85], + /** + * auto tick interval + * @type {string} + */ + TICK_INTERVAL_AUTO: 'auto', + /** yAxis align option + * @type {string} + */ + YAXIS_ALIGN_CENTER: 'center', + /** xAxis label compare margin */ + XAXIS_LABEL_COMPARE_MARGIN: 20, + /** xAxis label gutter */ + XAXIS_LABEL_GUTTER: 2, + /** + * Standard multiple nums of axis + * @type {Array} + */ + AXIS_STANDARD_MULTIPLE_NUMS: [1, 2, 5, 10, 20, 50, 100], + /** + * Last standard multiple num of axis + */ + AXIS_LAST_STANDARD_MULTIPLE_NUM: 100, + /** label padding top */ + LABEL_PADDING_TOP: 3, + /** line margin top */ + LINE_MARGIN_TOP: 5, + /** tooltip gap */ + TOOLTIP_GAP: 5, + /** tooltip direction + * @type {string} + */ + TOOLTIP_DIRECTION_FORWARD: 'forword', + /** @type {string} */ + TOOLTIP_DIRECTION_CENTER: 'center', + /** @type {string} */ + TOOLTIP_DIRECTION_BACKWARD: 'backword', + /** tooltip align options + * @type {string} + */ + TOOLTIP_DEFAULT_ALIGN_OPTION: 'center top', + /** @type {string} */ + TOOLTIP_DEFAULT_HORIZONTAL_ALIGN_OPTION: 'right middle', + /** @type {string} */ + TOOLTIP_DEFAULT_GROUP_ALIGN_OPTION: 'right middle', + /** @type {string} */ + TOOLTIP_DEFAULT_GROUP_HORIZONTAL_ALIGN_OPTION: 'center bottom', + /** hide delay */ + HIDE_DELAY: 200, + OLD_BROWSER_OPACITY_100: 100, + SERIES_LABEL_OPACITY: 0.3, + WHEEL_TICK: 120, + MAX_ZOOM_MAGN: 5, + FF_WHEELDELTA_ADJUSTING_VALUE: -40, + IE7_ROTATION_FILTER_STYLE_MAP: { + 25: ' style="filter: progid:DXImageTransform.Microsoft.Matrix(SizingMethod=\'auto expand\',' + + ' M11=0.9063077870366499, M12=0.42261826174069944, M21=-0.42261826174069944, M22=0.9063077870366499)"', + 45: ' style="filter: progid:DXImageTransform.Microsoft.Matrix(SizingMethod=\'auto expand\',' + + ' M11=0.7071067811865476, M12=0.7071067811865475, M21=-0.7071067811865475, M22=0.7071067811865476)"', + 65: ' style="filter: progid:DXImageTransform.Microsoft.Matrix(SizingMethod=\'auto expand\',' + + ' M11=0.42261826174069944, M12=0.9063077870366499, M21=-0.9063077870366499, M22=0.42261826174069944)"', + 85: ' style="filter: progid:DXImageTransform.Microsoft.Matrix(SizingMethod=\'auto expand\',' + + ' M11=0.08715574274765814, M12=0.9961946980917455, M21=-0.9961946980917455, M22=0.08715574274765814)"' + }, + /** prefix for public event + * @type {string} + */ + PUBLIC_EVENT_PREFIX: 'public_', + /** public event map + * @type {object} + */ + PUBLIC_EVENT_MAP: { + load: true, + selectLegend: true, + selectSeries: true, + unselectSeries: true, + beforeShowTooltip: true, + afterShowTooltip: true, + beforeHideTooltip: true, + zoom: true + }, + /** for radial */ + RADIAL_PLOT_PADDING: 15, // Prevent cross paper boundaries by line width + RADIAL_MARGIN_FOR_CATEGORY: 60, + RADIAL_CATEGORY_PADDING: 20, + + COMPONENT_TYPE_DOM: 'DOM', + COMPONENT_TYPE_RAPHAEL: 'Raphael', + + IMAGE_EXTENSIONS: ['png', 'jpeg'], + DATA_EXTENSIONS: ['xls', 'csv'], + + GUIDE_AREACHART_AREAOPACITY_TYPE: 'areaOpacity should be a number between 0 and 1', + + /** for bullet */ + BULLET_TYPE_ACTUAL: 'Actual', + BULLET_TYPE_RANGE: 'Ranges', + BULLET_TYPE_MARKER: 'Markers', + BULLET_MARKER_STROKE_TICK: 3, + BULLET_MARKER_BUFFER_POSITION: 5, + BULLET_RANGES_HEIGHT_RATIO: 0.7, + BULLET_ACTUAL_HEIGHT_RATIO: 0.28, + BULLET_MARKERS_HEIGHT_RATIO: 0.55, + BULLET_MARKER_DETECT_PADDING: 3 + }; + module.exports = chartConst; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview DOM Handler. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + var aps = Array.prototype.slice; + + /** + * DOM Handler. + * @module domHandler + * @private */ + var domHandler = { + /** + * Create element. + * @memberOf module:domHandler + * @param {string} tag html tag + * @param {string} newClass class name + * @returns {HTMLElement} created element + */ + create: function(tag, newClass) { + var el = document.createElement(tag); + + if (newClass) { + this.addClass(el, newClass); + } + + return el; + }, + + /** + * Get class names. + * @memberOf module:domHandler + * @param {HTMLElement} el target element + * @returns {Array} names + * @private + */ + _getClassNames: function(el) { + var className, classNames; + + if (el.classList) { + classNames = aps.call(el.classList); + } else { + className = el.className || ''; + classNames = className && snippet.isString(className) ? className.split(' ') : []; + } + + return classNames; + }, + + /** + * Add css class to target element. + * @memberOf module:domHandler + * @param {HTMLElement} el target element + * @param {string} newClass add class name + */ + addClass: function(el, newClass) { + var classNames, index; + + if (!el || !newClass) { + return; + } + + classNames = this._getClassNames(el); + index = snippet.inArray(newClass, classNames); + + if (index > -1) { + return; + } + + classNames.push(newClass); + el.className = classNames.join(' '); + }, + + /** + * Remove css class from target element. + * @memberOf module:domHandler + * @param {HTMLElement} el target element + * @param {string} rmClass remove class name + */ + removeClass: function(el, rmClass) { + var classNames = this._getClassNames(el), + index = snippet.inArray(rmClass, classNames); + + if (index === -1) { + return; + } + + classNames.splice(index, 1); + el.className = classNames.join(' '); + }, + + /** + * Whether class exist or not. + * @memberOf module:domHandler + * @param {HTMLElement} el target element + * @param {string} findClass target css class + * @returns {boolean} has class + */ + hasClass: function(el, findClass) { + var classNames = this._getClassNames(el); + var index = snippet.inArray(findClass, classNames); + + return index > -1; + }, + + /** + * Find parent by class name. + * @memberOf module:domHandler + * @param {HTMLElement} el target element + * @param {string} className target css class + * @param {string} lastClass last css class + * @returns {HTMLElement} result element + */ + findParentByClass: function(el, className, lastClass) { + var parent = el.parentNode, + result; + + if (!parent) { + result = null; + } else if (this.hasClass(parent, className)) { + result = parent; + } else if (parent.nodeName === 'BODY' || this.hasClass(parent, lastClass)) { + result = null; + } else { + result = this.findParentByClass(parent, className, lastClass); + } + + return result; + }, + + /** + * Append child element. + * @memberOf module:domHandler + * @param {HTMLElement} container container element + * @param {HTMLElement} children child element + */ + append: function(container, children) { + if (!container || !children) { + return; + } + children = snippet.isArray(children) ? children : [children]; + + snippet.forEachArray(children, function(child) { + if (!child) { + return; + } + container.appendChild(child); + }); + } + }; + + module.exports = domHandler; + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Util for array. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + + /** + * Pick minimum value from value array. + * @memberOf module:arrayUtil + * @param {Array} arr value array + * @param {?function} condition condition function + * @param {?object} context target context + * @returns {*} minimum value + */ + var min = function(arr, condition, context) { + var result, minValue, rest; + + if (!condition) { + result = Math.min.apply(null, arr); + } else { + result = arr[0]; + minValue = condition.call(context, result, 0); + rest = arr.slice(1); + snippet.forEachArray(rest, function(item, index) { + var compareValue = condition.call(context, item, index + 1); + if (compareValue < minValue) { + minValue = compareValue; + result = item; + } + }); + } + + return result; + }; + + /** + * Pick maximum value from value array. + * @memberOf module:arrayUtil + * @param {Array} arr value array + * @param {?function} [condition] condition function + * @param {?object} [context] target context + * @returns {*} maximum value + */ + var max = function(arr, condition, context) { + var result, maxValue, rest; + + if (!condition) { + result = Math.max.apply(null, arr); + } else { + result = arr[0]; + maxValue = condition.call(context, result, 0); + rest = arr.slice(1); + snippet.forEachArray(rest, function(item, index) { + var compareValue = condition.call(context, item, index + 1); + if (compareValue > maxValue) { + maxValue = compareValue; + result = item; + } + }); + } + + return result; + }; + + /** + * Whether one of them is true or not. + * @memberOf module:arrayUtil + * @param {Array} collection target collection + * @param {function} condition condition function + * @param {?object} context target context + * @returns {boolean} result boolean + */ + var any = function(collection, condition, context) { + var result = false; + snippet.forEach(collection, function(item, key) { + if (condition.call(context, item, key, collection)) { + result = true; + } + + return !result; + }); + + return result; + }; + + /** + * All of them is true or not. + * @memberOf module:arrayUtil + * @param {Array} collection target collection + * @param {function} condition condition function + * @param {?object} context target context + * @returns {boolean} result boolean + */ + var all = function(collection, condition, context) { + var result = !!(collection || []).length; + snippet.forEach(collection, function(item, key) { + if (!condition.call(context, item, key, collection)) { + result = false; + } + + return result !== false; + }); + + return result; + }; + + /** + * Make unique values. + * @memberOf module:arrayUtil + * @param {Array} arr target array + * @param {?boolean} sorted whether sorted or not. + * @param {?function} iteratee iteratee function + * @param {?object} context target context + * @returns {Array} unique values + */ + var unique = function(arr, sorted, iteratee, context) { + var result = [], + prevValue; + + if (!snippet.isBoolean(sorted)) { + context = iteratee; + iteratee = sorted; + sorted = false; + } + + iteratee = iteratee || function(value) { + return value; + }; + + if (sorted) { + snippet.forEachArray(arr, function(value, index) { + value = iteratee.call(context, value, index, arr); + if (!index || prevValue !== value) { + result.push(value); + } + prevValue = value; + }); + } else { + snippet.forEachArray(arr, function(value, index) { + value = iteratee.call(context, value, index, arr); + if (snippet.inArray(value, result) === -1) { + result.push(value); + } + }); + } + + return result; + }; + + /** + * Array pivot. + * @memberOf module:arrayUtil + * @param {Array.} arr2d target 2d array + * @returns {Array.} pivoted 2d array + */ + var pivot = function(arr2d) { + var result = []; + var len = max(snippet.map(arr2d, function(arr) { + return arr.length; + })); + var index; + + snippet.forEachArray(arr2d, function(arr) { + for (index = 0; index < len; index += 1) { + if (!result[index]) { + result[index] = []; + } + result[index].push(arr[index]); + } + }); + + return result; + }; + + var arrayUtil = { + min: min, + max: max, + any: any, + all: all, + unique: unique, + pivot: pivot + }; + + module.exports = arrayUtil; + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Predicate. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var arrayUtil = __webpack_require__(10); + + /** + * predicate. + * @module predicate + * @private */ + var predicate = { + /** + * Whether bar chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @returns {boolean} + */ + isBarChart: function(chartType) { + return chartType === chartConst.CHART_TYPE_BAR; + }, + + /** + * Whether column chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @returns {boolean} + */ + isColumnChart: function(chartType) { + return chartType === chartConst.CHART_TYPE_COLUMN; + }, + + /** + * Whether bar type chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @returns {boolean} + */ + isBarTypeChart: function(chartType) { + return predicate.isBarChart(chartType) || predicate.isColumnChart(chartType); + }, + + /** + * Whether boxplot chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @returns {boolean} + */ + isBoxplotChart: function(chartType) { + return chartType === chartConst.CHART_TYPE_BOXPLOT; + }, + + /** + * Whether bullet chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @returns {boolean} + */ + isBulletChart: function(chartType) { + return chartType === chartConst.CHART_TYPE_BULLET; + }, + + /** + * Whether radial type chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @returns {boolean} + */ + isRadialChart: function(chartType) { + return chartType === chartConst.CHART_TYPE_RADIAL; + }, + + /** + * Whether diverging chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @param {boolean} diverging - whether has diverging or not + * @returns {*|boolean} + */ + isDivergingChart: function(chartType, diverging) { + return this.isBarTypeChart(chartType) && diverging; + }, + + /** + * Whether normal stack chart or not. + * @param {string} chartType - type of chart + * @param {string} stackType - type of stack + * @returns {boolean} + * @private + */ + isNormalStackChart: function(chartType, stackType) { + var isAllowedStackOption = predicate.isAllowedStackOption(chartType); + var isNormalStack = predicate.isNormalStack(stackType); + + return isAllowedStackOption && isNormalStack; + }, + + /** + * Whether percent stack chart or not. + * @param {string} chartType - type of chart + * @param {string} stackType - type of stack + * @returns {boolean} + * @private + */ + isPercentStackChart: function(chartType, stackType) { + var isAllowedStackOption = predicate.isAllowedStackOption(chartType); + var isPercentStack = predicate.isPercentStack(stackType); + + return isAllowedStackOption && isPercentStack; + }, + + /** + * Whether combo chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @returns {boolean} + */ + isComboChart: function(chartType) { + return chartType === chartConst.CHART_TYPE_COMBO; + }, + + /** + * Whether pie and donut combo chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @param {Array.} subChartTypes - types of chart + * @returns {boolean} + */ + isPieDonutComboChart: function(chartType, subChartTypes) { + var isAllPieType = arrayUtil.all(subChartTypes, function(subChartType) { + return predicate.isPieChart(subChartType); + }); + + return predicate.isComboChart(chartType) && isAllPieType; + }, + + /** + * Whether line chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @returns {boolean} + */ + isLineChart: function(chartType) { + return chartType === chartConst.CHART_TYPE_LINE; + }, + + /** + * Whether area chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @returns {boolean} + */ + isAreaChart: function(chartType) { + return chartType === chartConst.CHART_TYPE_AREA; + }, + + /** + * Whether line and area combo chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @param {Array.} subChartTypes - types of chart + * @returns {boolean} + */ + isLineAreaComboChart: function(chartType, subChartTypes) { + var isAllLineType = arrayUtil.all(subChartTypes || [], function(subChartType) { + return predicate.isLineChart(subChartType) || predicate.isAreaChart(subChartType); + }); + + return predicate.isComboChart(chartType) && isAllLineType; + }, + + /** + * Whether line and area combo chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @param {Array.} subChartTypes - types of chart + * @returns {boolean} + */ + hasLineChart: function(chartType, subChartTypes) { + var hasLineType = arrayUtil.any(subChartTypes || [], function(subChartType) { + return predicate.isLineChart(subChartType); + }); + + return predicate.isComboChart(chartType) && hasLineType; + }, + + /** + * Whether line and scatter combo chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @param {Array.} subChartTypes - types of chart + * @returns {boolean} + */ + isLineScatterComboChart: function(chartType, subChartTypes) { + var isAllLineType = arrayUtil.all(subChartTypes || [], function(subChartType) { + return predicate.isLineChart(subChartType) || predicate.isScatterChart(subChartType); + }); + + return predicate.isComboChart(chartType) && isAllLineType; + }, + + /** + * Whether line type chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @param {Array.} [subChartTypes] - types of chart + * @returns {boolean} + */ + isLineTypeChart: function(chartType, subChartTypes) { + return predicate.isLineChart(chartType) || predicate.isAreaChart(chartType) + || predicate.isLineAreaComboChart(chartType, subChartTypes); + }, + + /** + * Whether bubble chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @returns {boolean} + */ + isBubbleChart: function(chartType) { + return chartType === chartConst.CHART_TYPE_BUBBLE; + }, + + /** + * Whether scatter chart or not. + * @memberOf module:predicate + * @param {string} chartType - chart type + * @returns {boolean} + */ + isScatterChart: function(chartType) { + return chartType === chartConst.CHART_TYPE_SCATTER; + }, + + /** + * Whether heatmap chart or not. + * @memberOf module:predicate + * @param {string} chartType - chart type + * @returns {boolean} + */ + isHeatmapChart: function(chartType) { + return chartType === chartConst.CHART_TYPE_HEATMAP; + }, + + /** + * Whether treemap chart or not. + * @memberOf module:predicate + * @param {string} chartType - chart type + * @returns {boolean} + */ + isTreemapChart: function(chartType) { + return chartType === chartConst.CHART_TYPE_TREEMAP; + }, + + /** + * Whether box type chart or not. + * @memberOf module:predicate + * @param {string} chartType - chart type + * @returns {boolean} + */ + isBoxTypeChart: function(chartType) { + return predicate.isHeatmapChart(chartType) || predicate.isTreemapChart(chartType); + }, + + /** + * Whether pie chart or not. + * @memberOf module:predicate + * @param {string} chartType - chart type + * @returns {boolean} + */ + isPieChart: function(chartType) { + // change to indexOf for handling alias + return chartType && chartType.indexOf(chartConst.CHART_TYPE_PIE) !== -1; + }, + + /** + * Whether map chart or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @returns {boolean} + */ + isMapChart: function(chartType) { + return chartType === chartConst.CHART_TYPE_MAP; + }, + + /** + * Whether map type chart or not. + * @memberOf module:predicate + * @param {string} chartType - chart type + * @returns {boolean} + */ + isMapTypeChart: function(chartType) { + return (this.isMapChart(chartType) || this.isHeatmapChart(chartType) || this.isTreemapChart(chartType)); + }, + + /** + * Whether coordinate type chart or not. + * @memberOf module:predicate + * @param {string} chartType - chart type + * @returns {boolean} + */ + isCoordinateTypeChart: function(chartType) { + return predicate.isBubbleChart(chartType) || predicate.isScatterChart(chartType); + }, + + /** + * Whether allow rendering for minus point in area of series. + * @memberOf module:predicate + * @param {string} chartType - chart type + * @returns {boolean} + */ + allowMinusPointRender: function(chartType) { + return predicate.isLineTypeChart(chartType) || predicate.isCoordinateTypeChart(chartType) || + predicate.isBoxTypeChart(chartType) || predicate.isBulletChart(chartType); + }, + + /** + * Whether chart to detect mouse events on series or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @returns {boolean} + */ + isChartToDetectMouseEventOnSeries: function(chartType) { + return predicate.isPieChart(chartType) || predicate.isMapChart(chartType) + || predicate.isCoordinateTypeChart(chartType); + }, + + /** + * Whether align of label is outer or not. + * @memberOf module:predicate + * @param {string} align - align of legend + * @returns {boolean} + */ + isLabelAlignOuter: function(align) { + return align === chartConst.LABEL_ALIGN_OUTER; + }, + + /** + * Whether show label or not. + * @param {{showLabel: ?boolean, showLegend: ?boolean}} options - options + * @returns {boolean} + */ + isShowLabel: function(options) { + return options.showLabel || options.showLegend; + }, + + /** + * Whether show outer label or not. + * @param {{showLabel: ?boolean, showLegend: ?boolean, labelAlign: string}} options - options + * @returns {*|boolean} + */ + isShowOuterLabel: function(options) { + return predicate.isShowLabel(options) && predicate.isLabelAlignOuter(options.labelAlign); + }, + + /** + * Whether align of legend is left or not. + * @memberOf module:predicate + * @param {string} align - align of legend + * @returns {boolean} + */ + isLegendAlignLeft: function(align) { + return align === chartConst.LEGEND_ALIGN_LEFT; + }, + + /** + * Whether align of legend is top or not. + * @memberOf module:predicate + * @param {string} align - align of legend + * @returns {boolean} + */ + isLegendAlignTop: function(align) { + return align === chartConst.LEGEND_ALIGN_TOP; + }, + + /** + * Whether align of legend is bottom or not. + * @memberOf module:predicate + * @param {string} align - align of legend + * @returns {boolean} + */ + isLegendAlignBottom: function(align) { + return align === chartConst.LEGEND_ALIGN_BOTTOM; + }, + + /** + * Whether horizontal legend or not. + * @memberOf module:predicate + * @param {string} align - align option for legend + * @returns {boolean} + */ + isHorizontalLegend: function(align) { + return predicate.isLegendAlignTop(align) || predicate.isLegendAlignBottom(align); + }, + + /** + * Whether vertical legend or not. + * @memberOf module:predicate + * @param {string} align - align option for legend + * @returns {boolean} + */ + isVerticalLegend: function(align) { + return !predicate.isHorizontalLegend(align); + }, + + /** + * Whether allowed stackType option or not. + * @memberOf module:predicate + * @param {string} chartType - type of chart + * @returns {boolean} + */ + isAllowedStackOption: function(chartType) { + return predicate.isBarChart(chartType) || predicate.isColumnChart(chartType) + || predicate.isAreaChart(chartType); + }, + + /** + * Whether normal stack type or not. + * @memberOf module:predicate + * @param {boolean} stackType - stackType option + * @returns {boolean} + */ + isNormalStack: function(stackType) { + return stackType === chartConst.NORMAL_STACK_TYPE; + }, + + /** + * Whether percent stack type or not. + * @memberOf module:predicate + * @param {boolean} stackType - stackType option + * @returns {boolean} + */ + isPercentStack: function(stackType) { + return stackType === chartConst.PERCENT_STACK_TYPE; + }, + + /** + * Whether valid stackType option or not. + * @memberOf module:predicate + * @param {boolean} stackType - stackType option + * @returns {boolean} + */ + isValidStackOption: function(stackType) { + return stackType && (predicate.isNormalStack(stackType) || predicate.isPercentStack(stackType)); + }, + + /** + * Whether allow range data or not. + * @memberOf module:predicate + * @param {string} chartType - chart type + * @returns {boolean} + */ + isAllowRangeData: function(chartType) { + return predicate.isBarTypeChart(chartType) || predicate.isAreaChart(chartType); + }, + + /** + * Whether align of yAxis is center or not. + * @memberOf module:predicate + * @param {boolean} hasRightYAxis - whether has right yAxis. + * @param {string} alignOption - align option of yAxis. + * @returns {boolean} whether - align center or not. + */ + isYAxisAlignCenter: function(hasRightYAxis, alignOption) { + return !hasRightYAxis && (alignOption === chartConst.YAXIS_ALIGN_CENTER); + }, + + /** + * Whether minus limit or not. + * @memberOf module:predicate + * @param {{min: number, max: number}} limit - limit + * @returns {boolean} + */ + isMinusLimit: function(limit) { + return limit.min <= 0 && limit.max <= 0; + }, + + /** + * Whether auto tick interval or not. + * @param {string} [tickInterval] - tick interval option + * @returns {boolean} + */ + isAutoTickInterval: function(tickInterval) { + return tickInterval === chartConst.TICK_INTERVAL_AUTO; + }, + + /** + * Whether valid label interval or not. + * @param {number} [labelInterval] - label interval option + * @param {string} [tickInterval] - tick interval option + * @returns {*|boolean} + */ + isValidLabelInterval: function(labelInterval, tickInterval) { + return labelInterval && labelInterval > 1 && !tickInterval; + }, + + /** + * Whether datetime type or not. + * @param {string} type - type + * @returns {boolean} + */ + isDatetimeType: function(type) { + return type === chartConst.AXIS_TYPE_DATETIME; + }, + + /** + * @param {string} chartType - type of chart + * @returns {boolean} - whether it support ChartBase#showTooltip API + */ + isSupportPublicShowTooptipAPI: function(chartType) { + return this.isBarChart(chartType) || + this.isColumnChart(chartType) || + this.isLineChart(chartType) || + this.isAreaChart(chartType) || + this.isBoxplotChart(chartType); + }, + + /** + * @param {string} chartType - type of chart + * @returns {boolean} - whether it support ChartBase#hideTooltip API + */ + isSupportPublicHideTooptipAPI: function(chartType) { + return this.isBarChart(chartType) || + this.isColumnChart(chartType) || + this.isLineChart(chartType) || + this.isAreaChart(chartType) || + this.isBoxplotChart(chartType); + } + }; + + module.exports = predicate; + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Raphael boxplot chart renderer. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var raphaelRenderUtil = __webpack_require__(5); + var snippet = __webpack_require__(6); + var raphael = __webpack_require__(3); + + var ANIMATION_DURATION = 700; + var EMPHASIS_OPACITY = 1; + var DE_EMPHASIS_OPACITY = 0.3; + var DEFAULT_LUMINANC = 0.2; + var BOX_STROKE_WIDTH = 1; + var EDGE_LINE_WIDTH = 2; + var MEDIAN_LINE_WIDTH = 2; + var WHISKER_LINE_WIDTH = 1; + + /** + * @classdesc RaphaelBoxplotChart is graph renderer for bar, column chart. + * @class RaphaelBoxplotChart + * @private + */ + var RaphaelBoxplotChart = snippet.defineClass(/** @lends RaphaelBoxplotChart.prototype */ { + /** + * Render function of bar chart + * @param {object} paper paper object + * @param {{size: object, model: object, options: object, tooltipPosition: string}} data chart data + * @returns {Array.} seriesSet + */ + render: function(paper, data) { + var groupBounds = data.groupBounds; + + if (!groupBounds) { + return null; + } + + this.paper = paper; + + this.theme = data.theme; + this.options = data.options; + this.seriesDataModel = data.seriesDataModel; + this.chartType = data.chartType; + + this.paper.setStart(); + this.groupWhiskers = []; + this.groupMedians = []; + this.groupBoxes = this._renderBoxplots(groupBounds); + this.groupBorders = this._renderBoxBorders(groupBounds); + + this.rectOverlay = this._renderRectOverlay(); + this.circleOverlay = this._renderCircleOverlay(); + this.groupBounds = groupBounds; + + return this.paper.setFinish(); + }, + + /** + * Render overlay. + * @returns {object} raphael object + * @private + */ + _renderRectOverlay: function() { + var bound = { + width: 1, + height: 1, + left: 0, + top: 0 + }; + var attributes = { + 'fill-opacity': 0 + }; + + return raphaelRenderUtil.renderRect(this.paper, bound, snippet.extend({ + 'stroke-width': 0 + }, attributes)); + }, + + /** + * Render overlay. + * @returns {object} raphael object + * @private + */ + _renderCircleOverlay: function() { + var position = { + left: 0, + top: 0 + }; + var attributes = { + 'fill-opacity': 0 + }; + + return raphaelRenderUtil.renderCircle(this.paper, position, 0, snippet.extend({ + 'stroke-width': 0 + }, attributes)); + }, + + /** + * Render rect + * @param {{left: number, top: number, width: number, height: number}} bound bound + * @param {string} color series color + * @param {object} [attributes] - attributes + * @returns {object} bar rect + * @private + */ + _renderBox: function(bound, color, attributes) { + var rect; + + if (bound.width < 0 || bound.height < 0) { + return null; + } + + rect = raphaelRenderUtil.renderRect(this.paper, bound, snippet.extend({ + fill: '#fff', + stroke: color, + 'stroke-width': BOX_STROKE_WIDTH + }, attributes)); + + return rect; + }, + + /** + * Render boxes. + * @param {Array.>} groupBounds bounds + * @returns {Array.>} bars + * @private + */ + _renderBoxes: function(groupBounds) { + var self = this; + var colors = this.theme.colors; + var colorByPoint = this.options.colorByPoint; + + return snippet.map(groupBounds, function(bounds, groupIndex) { + return snippet.map(bounds, function(bound, index) { + var color, rect, item; + + if (!bound) { + return null; + } + + item = self.seriesDataModel.getSeriesItem(groupIndex, index); + + color = colorByPoint ? colors[groupIndex] : colors[index]; + + if (bound.start) { + rect = self._renderBox(bound.start, color); + } + + return { + rect: rect, + color: color, + bound: bound.end, + item: item, + groupIndex: groupIndex, + index: index + }; + }); + }); + }, + + /** + * Render boxplots. + * @param {Array.>} groupBounds bounds + * @returns {Array.>} bars + * @private + */ + _renderBoxplots: function(groupBounds) { + var groupBoxes = this._renderBoxes(groupBounds); + + this.groupWhiskers = this._renderWhiskers(groupBounds); + this.groupMedians = this._renderMedianLines(groupBounds); + this.groupOutliers = this._renderOutliers(groupBounds); + + return groupBoxes; + }, + + _renderWhisker: function(end, start, color) { + var paper = this.paper; + var topDistance = start.top - end.top; + var whiskerDirection = topDistance > 0 ? 1 : -1; + var width = end.width; + var left = end.left; + var quartileWidth = width / 4; + var edgePath = 'M' + (left + quartileWidth) + ',' + end.top + 'H' + (left + (quartileWidth * 3)); + var whiskerPath = 'M' + (left + (quartileWidth * 2)) + ',' + end.top + 'V' + (end.top + (Math.abs(topDistance) * whiskerDirection)); + var edge = raphaelRenderUtil.renderLine(paper, edgePath, color, EDGE_LINE_WIDTH); + var whisker = raphaelRenderUtil.renderLine(paper, whiskerPath, color, WHISKER_LINE_WIDTH); + var whiskers = []; + + edge.attr({ + opacity: 0 + }); + whisker.attr({ + opacity: 0 + }); + + whiskers.push(edge); + whiskers.push(whisker); + + return whiskers; + }, + + _renderWhiskers: function(groupBounds) { + var self = this; + var colors = this.theme.colors; + var colorByPoint = this.options.colorByPoint; + var groupWhiskers = []; + + snippet.forEach(groupBounds, function(bounds, groupIndex) { + var whiskers = []; + + snippet.forEach(bounds, function(bound, index) { + var color = colorByPoint ? colors[groupIndex] : colors[index]; + + if (!bound) { + return; + } + + whiskers = whiskers.concat(self._renderWhisker(bound.min, bound.start, color)); + whiskers = whiskers.concat(self._renderWhisker(bound.max, bound.end, color)); + }); + + groupWhiskers.push(whiskers); + }); + + return groupWhiskers; + }, + + _renderMedianLine: function(bound, color) { + var width = bound.width; + var medianLinePath = 'M' + bound.left + ',' + bound.top + 'H' + (bound.left + width); + var median = raphaelRenderUtil.renderLine(this.paper, medianLinePath, color, MEDIAN_LINE_WIDTH); + + median.attr({ + opacity: 0 + }); + + return median; + }, + + _renderMedianLines: function(groupBounds) { + var self = this; + var colors = this.theme.colors; + var colorByPoint = this.options.colorByPoint; + var groupMedians = []; + + snippet.forEach(groupBounds, function(bounds, groupIndex) { + var medians = []; + + snippet.forEach(bounds, function(bound, index) { + var color = colorByPoint ? colors[groupIndex] : colors[index]; + + if (!bound) { + return; + } + + medians.push(self._renderMedianLine(bound.median, color)); + }); + groupMedians.push(medians); + }); + + return groupMedians; + }, + + _renderOutlier: function(bound, color) { + var outlier = raphaelRenderUtil.renderCircle(this.paper, { + left: bound.left, + top: bound.top + }, 3, { + stroke: color + }); + + outlier.attr({ + opacity: 0 + }); + + return outlier; + }, + + _renderOutliers: function(groupBounds) { + var self = this; + var colors = this.theme.colors; + var colorByPoint = this.options.colorByPoint; + var groupOutliers = []; + + snippet.forEach(groupBounds, function(bounds, groupIndex) { + var outliers = []; + snippet.forEach(bounds, function(bound, index) { + var color = colorByPoint ? colors[groupIndex] : colors[index]; + var seriesOutliers = []; + + if (!bound) { + return; + } + + if (bound.outliers.length) { + snippet.forEach(bound.outliers, function(outlier) { + seriesOutliers.push(self._renderOutlier(outlier, color)); + }); + } + outliers.push(seriesOutliers); + }); + groupOutliers.push(outliers); + }); + + return groupOutliers; + }, + + /** + * Make rect points. + * @param {{left: number, top:number, width: number, height: number}} bound rect bound + * @returns {{ + * leftTop: {left: number, top: number}, + * rightTop: {left: number, top: number}, + * rightBottom: {left: number, top: number}, + * leftBottom: {left: number, top: number} + * }} rect points + * @private + */ + _makeRectPoints: function(bound) { + return { + leftTop: { + left: Math.ceil(bound.left), + top: Math.ceil(bound.top) + }, + rightTop: { + left: Math.ceil(bound.left + bound.width), + top: Math.ceil(bound.top) + }, + rightBottom: { + left: Math.ceil(bound.left + bound.width), + top: Math.ceil(bound.top + bound.height) + }, + leftBottom: { + left: Math.ceil(bound.left), + top: Math.ceil(bound.top + bound.height) + } + }; + }, + + /** + * Render border lines; + * @param {{left: number, top:number, width: number, height: number}} bound bar bound + * @param {string} borderColor border color + * @param {string} chartType chart type + * @param {Item} item item + * @returns {object} raphael object + * @private + */ + _renderBorderLines: function(bound, borderColor, chartType, item) { + var self = this; + var borderLinePaths = this._makeBorderLinesPaths(bound, chartType, item); + var lines = {}; + + snippet.forEach(borderLinePaths, function(path, name) { + lines[name] = raphaelRenderUtil.renderLine(self.paper, path, borderColor, 1); + }); + + return lines; + }, + + /** + * Render bar borders. + * @param {Array.>} groupBounds bounds + * @returns {Array.>} borders + * @private + */ + _renderBoxBorders: function(groupBounds) { + var self = this, + borderColor = this.theme.borderColor, + groupBorders; + + if (!borderColor) { + return null; + } + + groupBorders = snippet.map(groupBounds, function(bounds, groupIndex) { + return snippet.map(bounds, function(bound, index) { + var seriesItem; + + if (!bound) { + return null; + } + + seriesItem = self.seriesDataModel.getSeriesItem(groupIndex, index); + + return self._renderBorderLines(bound.start, borderColor, self.chartType, seriesItem); + }); + }); + + return groupBorders; + }, + + /** + * Animate rect. + * @param {object} rect raphael object + * @param {{left: number, top:number, width: number, height: number}} bound rect bound + * @private + */ + _animateRect: function(rect, bound) { + rect.animate({ + x: bound.left, + y: bound.top, + width: bound.width, + height: bound.height + }, ANIMATION_DURATION, '>'); + }, + + /** + * Animate. + * @param {function} onFinish finish callback function + */ + animate: function(onFinish) { + var self = this; + var animation = raphael.animation({ + opacity: 1 + }, ANIMATION_DURATION); + + raphaelRenderUtil.forEach2dArray(this.groupBoxes, function(box) { + if (!box) { + return; + } + self._animateRect(box.rect, box.bound); + }); + + raphaelRenderUtil.forEach2dArray(self.groupWhiskers, function(whisker) { + whisker.animate(animation.delay(ANIMATION_DURATION)); + }); + + raphaelRenderUtil.forEach2dArray(self.groupMedians, function(median) { + median.animate(animation.delay(ANIMATION_DURATION)); + }); + + raphaelRenderUtil.forEach2dArray(self.groupOutliers, function(outliers) { + snippet.forEach(outliers, function(outlier) { + outlier.animate(animation.delay(ANIMATION_DURATION)); + }); + }); + + if (onFinish) { + this.callbackTimeout = setTimeout(function() { + onFinish(); + delete self.callbackTimeout; + }, ANIMATION_DURATION); + } + }, + + /** + * Show animation. + * @param {{groupIndex: number, index:number}} data show info + */ + showAnimation: function(data) { + if (snippet.isNumber(data.outlierIndex)) { + this.showOutlierAnimation(data); + } else { + this.showRectAnimation(data); + } + }, + + /** + * Show animation. + * @param {{groupIndex: number, index:number}} data show info + */ + showRectAnimation: function(data) { + var bar = this.groupBoxes[data.groupIndex][data.index], + bound = bar.bound; + + this.rectOverlay.attr({ + width: bound.width, + height: bound.height, + x: bound.left, + y: bound.top, + fill: bar.color, + 'fill-opacity': 0.3 + }); + }, + + /** + * Show animation. + * @param {{groupIndex: number, index:number}} data show info + */ + showOutlierAnimation: function(data) { + var targetAttr = this.groupOutliers[data.groupIndex][data.index][data.outlierIndex].attr(); + + this.circleOverlay.attr({ + r: targetAttr.r, + cx: targetAttr.cx, + cy: targetAttr.cy, + fill: targetAttr.stroke, + 'fill-opacity': 0.3, + stroke: targetAttr.stroke, + 'stroke-width': 2 + }); + }, + + /** + * Hide animation. + */ + hideAnimation: function() { + this.circleOverlay.attr({ + width: 1, + height: 1, + x: 0, + y: 0, + 'fill-opacity': 0, + 'stroke-width': 0 + }); + this.rectOverlay.attr({ + width: 1, + height: 1, + x: 0, + y: 0, + 'fill-opacity': 0 + }); + }, + + /** + * Update rect bound + * @param {object} rect raphael object + * @param {{left: number, top: number, width: number, height: number}} bound bound + * @private + */ + _updateRectBound: function(rect, bound) { + rect.attr({ + x: bound.left, + y: bound.top, + width: bound.width, + height: bound.height + }); + }, + + /** + * Resize graph of bar type chart. + * @param {object} params parameters + * @param {{width: number, height:number}} params.dimension dimension + * @param {Array.>} params.groupBounds group bounds + */ + resize: function(params) { + var dimension = params.dimension; + var groupBounds = params.groupBounds; + + this.groupBounds = groupBounds; + this.paper.setSize(dimension.width, dimension.height); + + raphaelRenderUtil.forEach2dArray(this.groupBoxes, function(bar, groupIndex, index) { + var bound; + + if (!bar) { + return; + } + + bound = groupBounds[groupIndex][index].end; + bar.bound = bound; + raphaelRenderUtil.updateRectBound(bar.rect, bound); + }); + }, + + /** + * Change borders color. + * @param {Array.} lines raphael objects + * @param {borderColor} borderColor border color + * @private + */ + _changeBordersColor: function(lines, borderColor) { + snippet.forEach(lines, function(line) { + line.attr({stroke: borderColor}); + }); + }, + + /** + * Change bar color. + * @param {{groupIndex: number, index: number}} indexes indexes + * @param {string} color fill color + * @param {?string} borderColor stroke color + * @private + */ + _changeBoxColor: function(indexes, color, borderColor) { + var bar = this.groupBoxes[indexes.groupIndex][indexes.index]; + var lines; + + bar.rect.attr({ + stroke: color + }); + + if (borderColor) { + lines = this.groupBorders[indexes.groupIndex][indexes.index]; + this._changeBordersColor(lines, borderColor); + } + }, + + /** + * Select series. + * @param {{groupIndex: number, index: number}} indexes indexes + */ + selectSeries: function(indexes) { + var bar = this.groupBoxes[indexes.groupIndex][indexes.index], + objColor = raphael.color(bar.color), + selectionColorTheme = this.theme.selectionColor, + color = selectionColorTheme || raphaelRenderUtil.makeChangedLuminanceColor(objColor.hex, DEFAULT_LUMINANC), + borderColor = this.theme.borderColor, + objBorderColor; + + if (borderColor) { + objBorderColor = raphael.color(borderColor); + borderColor = raphaelRenderUtil.makeChangedLuminanceColor(objBorderColor.hex, DEFAULT_LUMINANC); + } + + this._changeBoxColor(indexes, color, borderColor); + }, + + /** + * Unselect series. + * @param {{groupIndex: number, index: number}} indexes indexes + */ + unselectSeries: function(indexes) { + var bar = this.groupBoxes[indexes.groupIndex][indexes.index], + borderColor = this.theme.borderColor; + this._changeBoxColor(indexes, bar.color, borderColor); + }, + + /** + * Select legend. + * @param {?number} legendIndex legend index + */ + selectLegend: function(legendIndex) { + var noneSelected = snippet.isNull(legendIndex); + + raphaelRenderUtil.forEach2dArray(this.groupBoxes, function(box, groupIndex, index) { + var opacity; + + if (!box) { + return; + } + + opacity = (noneSelected || legendIndex === index) ? EMPHASIS_OPACITY : DE_EMPHASIS_OPACITY; + + box.rect.attr({'stroke-opacity': opacity}); + }); + raphaelRenderUtil.forEach2dArray(this.groupWhiskers, function(whisker, groupIndex, index) { + var opacity = (noneSelected || legendIndex === index) ? EMPHASIS_OPACITY : DE_EMPHASIS_OPACITY; + + whisker.attr({'stroke-opacity': opacity}); + }); + raphaelRenderUtil.forEach2dArray(this.groupMedians, function(median, groupIndex, index) { + var opacity = (noneSelected || legendIndex === index) ? EMPHASIS_OPACITY : DE_EMPHASIS_OPACITY; + + median.attr({'stroke-opacity': opacity}); + }); + }, + + renderSeriesLabel: function(paper, groupPositions, groupLabels, labelTheme, isStacked) { + var attributes = { + 'font-size': labelTheme.fontSize, + 'font-family': labelTheme.fontFamily, + 'font-weight': labelTheme.fontWeight, + fill: labelTheme.color, + opacity: 0, + 'text-anchor': isStacked ? 'middle' : 'start' + }; + var labelSet = paper.set(); + + snippet.forEach(groupLabels, function(categoryLabel, categoryIndex) { + snippet.forEach(categoryLabel, function(label, seriesIndex) { + var position = groupPositions[categoryIndex][seriesIndex]; + var endLabel = raphaelRenderUtil.renderText(paper, position.end, label.end, attributes); + var startLabel; + + endLabel.node.style.userSelect = 'none'; + endLabel.node.style.cursor = 'default'; + endLabel.node.setAttribute('filter', 'url(#glow)'); + + labelSet.push(endLabel); + + if (position.start) { + startLabel = raphaelRenderUtil.renderText(paper, position.start, label.start, attributes); + startLabel.node.style.userSelect = 'none'; + startLabel.node.style.cursor = 'default'; + startLabel.node.setAttribute('filter', 'url(#glow)'); + + labelSet.push(startLabel); + } + }); + }); + + return labelSet; + } + }); + + module.exports = RaphaelBoxplotChart; + + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Raphael bullet chart renderer. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var raphaelRenderUtil = __webpack_require__(5); + var chartConst = __webpack_require__(8); + var snippet = __webpack_require__(6); + var renderUtil = __webpack_require__(7); + + var browser = snippet.browser; + var IS_LTE_IE8 = browser.msie && browser.version <= 8; + var ANIMATION_DURATION = 700; + var ANIMATION_DELAY = 700; + var EMPHASIS_OPACITY = 1; + var DE_EMPHASIS_OPACITY = 0.3; + var EVENT_DETECTOR_PADDING = 20; + + /** + * @classdesc RaphaelBulletChart is graph renderer for bullet chart. + * @class RaphaelBulletChart + * @private + */ + var RaphaelBulletChart = snippet.defineClass(/** @lends RaphaelBulletChart.prototype */ { + /** + * Render function of bar chart + * @param {object} paper paper object + * @param {{size: object, model: object, options: object, tooltipPosition: string}} data chart data + * @returns {Array.} seriesSet + */ + render: function(paper, data) { + var groupBounds = data.groupBounds; + var seriesDataModel = data.seriesDataModel; + + if (!groupBounds || !groupBounds.length) { + return null; + } + + this.paper = paper; + + this.theme = data.theme; + this.dimension = data.dimension; + this.position = data.position; + this.options = data.options; + this.chartType = data.chartType; + this.isVertical = data.isVertical; + + this.seriesDataModel = seriesDataModel; + this.maxRangeCount = seriesDataModel.maxRangeCount; + this.maxMarkerCount = seriesDataModel.maxMarkerCount; + + this.rangeOpacities = {}; + + this.paper.setStart(); + + this._renderBounds(groupBounds); + + return this.paper.setFinish(); + }, + + /** + * Get range opacity by index + * If rangeOpacities[index] not exists, create and store. then use it next time + * @param {number} index - ranges index + * @returns {number} - opacity of ranges bar at index + * @private + */ + _getRangeOpacity: function(index) { + var maxRangeCount = this.maxRangeCount; + if (this.prevMaxRangeCount !== maxRangeCount) { + this._updateOpacityStep(maxRangeCount); + } + + if (index < maxRangeCount && !this.rangeOpacities[index]) { + this.rangeOpacities[index] = 1 - (this.opacityStep * (index + 1)); + } + + return this.rangeOpacities[index]; + }, + + /** + * Update opacity step using maxRangeCount + * @param {number} maxRangeCount - maximum count of ranges bar among series graphes + * @private + */ + _updateOpacityStep: function(maxRangeCount) { + this.rangeOpacities = {}; + this.opacityStep = Number(1 / (maxRangeCount + 1)).toFixed(2); + this.prevMaxRangeCount = maxRangeCount; + }, + + /** + * Render bullet graph using groupBounds model + * @param {Array.} groupBounds - bounds data for rendering bullet graph + * @private + */ + _renderBounds: function(groupBounds) { + var rangeThemes = this.theme.ranges; + var paper = this.paper; + + this.groupBars = []; + this.groupLines = []; + + snippet.forEach(groupBounds, function(bounds, groupIndex) { + var seriesColor = this.theme.colors[groupIndex]; + var rangeIndex = 0; + var barSet = paper.set(); + var lineSet = paper.set(); + + snippet.forEach(bounds, function(bound) { + var type = bound.type; + + if (type === chartConst.BULLET_TYPE_ACTUAL) { + barSet.push(this._renderActual(bound, seriesColor)); + } else if (type === chartConst.BULLET_TYPE_RANGE) { + barSet.push(this._renderRange(bound, seriesColor, rangeIndex, rangeThemes[rangeIndex])); + rangeIndex += 1; + } else if (type === chartConst.BULLET_TYPE_MARKER) { + lineSet.push(this._renderMarker(bound, seriesColor)); + } + }, this); + + this.groupBars.push(barSet); + this.groupLines.push(lineSet); + }, this); + }, + + /** + * Render actual bar + * @param {object} bound - bound model on start point + * @param {string} seriesColor - series color for painting actual bar + * @returns {Element} - rendered actual bar + * @private + */ + _renderActual: function(bound, seriesColor) { + if (!bound) { + return null; + } + + return this._renderBar(bound, seriesColor); + }, + + /** + * Render range bar + * @param {object} bound - bound model on start point + * @param {string} seriesColor - series color for painting range bar + * @param {number} rangeIndex - ranges index + * @param {object} rangeTheme - range theme + * @returns {Element} - rendered range bar + * @private + */ + _renderRange: function(bound, seriesColor, rangeIndex, rangeTheme) { + var color = seriesColor; + var opacity = this._getRangeOpacity(rangeIndex); + var attr = {opacity: opacity}; + + if (!bound) { + return null; + } + + if (rangeTheme) { + color = rangeTheme.color || color; + attr.opacity = rangeTheme.opacity || opacity; + } + + return this._renderBar(bound, color, attr); + }, + + /** + * Create bar type element using passing arguments + * @param {object} bound - bound data for render rect element + * @param {string} color - hex type color string + * @param {object} attributes - styling attributes + * @returns {Element} - svg rect element + * @private + */ + _renderBar: function(bound, color, attributes) { + if (bound.width < 0 || bound.height < 0) { + return null; + } + + return raphaelRenderUtil.renderRect(this.paper, bound, snippet.extend({ + fill: color, + stroke: 'none' + }, attributes)); + }, + + /** + * Render marker + * @param {object} bound - bound model of marker + * @param {string} seriesColor - series color for painting marker + * @returns {Element} - rendered marker + * @private + */ + _renderMarker: function(bound, seriesColor) { + if (!bound) { + return null; + } + + return this._renderLine(bound, seriesColor); + }, + + /** + * Create line element using passing arguments + * @param {object} bound - bound data for render path element + * @param {string} color - hex type color string + * @returns {Element} - svg rect element + * @private + */ + _renderLine: function(bound, color) { + var top = bound.top; + var left = bound.left; + var length = bound.length; + var endPosition = this.isVertical ? 'L' + (left + length) + ',' + top : 'L' + left + ',' + (top + length); + var path = 'M' + left + ',' + top + endPosition; + + return raphaelRenderUtil.renderLine(this.paper, path, color, chartConst.BULLET_MARKER_STROKE_TICK); + }, + + /** + * Animate. + * @param {function} onFinish finish callback function + * @param {Array.} seriesSet series set + */ + animate: function(onFinish, seriesSet) { + var paper = this.paper; + var dimension = this.dimension; + var position = this.position; + var clipRect = this.clipRect; + var clipRectId = this._getClipRectId(); + var clipRectWidth = dimension.width - EVENT_DETECTOR_PADDING; + var clipRectHeight = dimension.height - EVENT_DETECTOR_PADDING; + var startDimension = {}; + var animateAttr = {}; + + if (this.isVertical) { + startDimension.width = clipRectWidth; + startDimension.height = 0; + animateAttr.height = clipRectHeight; + } else { + startDimension.width = 0; + startDimension.height = clipRectHeight; + animateAttr.width = clipRectWidth; + } + + // Animation was implemented using SVG element + // As Browser compatibility of is IE9+, + // No Animation on IE8 + if (!IS_LTE_IE8 && dimension) { + if (!clipRect) { + clipRect = createClipPathRectWithLayout(paper, position, startDimension, clipRectId); + this.clipRect = clipRect; + } else { + clipRect.attr({ + x: position.left, + y: position.top + }); + clipRect.attr(startDimension); + } + + seriesSet.forEach(function(element) { + if (element.type === 'set') { + element.forEach(function(item) { + item.node.setAttribute('clip-path', 'url(#' + clipRectId + ')'); + }); + } else { + element.node.setAttribute('clip-path', 'url(#' + clipRectId + ')'); + } + }); + + clipRect.animate(animateAttr, ANIMATION_DURATION, '>', onFinish); + } + + if (onFinish) { + this.callbackTimeout = setTimeout(function() { + onFinish(); + delete self.callbackTimeout; + }, ANIMATION_DELAY); + } + }, + + /** + * Resize bullet chart + * @param {object} params parameters + * @param {{width: number, height:number}} params.dimension dimension + * @param {Array.>} params.groupBounds group bounds + */ + resize: function(params) { + var dimension = params.dimension; + var groupBounds = params.groupBounds; + var width = dimension.width; + var height = dimension.height; + + this.dimension = params.dimension; + this.groupBounds = groupBounds; + this.resizeClipRect(width, height); + this.paper.setSize(width, height); + + this._renderBounds(groupBounds); + }, + + /** + * Resize clip rect size + * @param {number} width series width + * @param {number} height series height + */ + resizeClipRect: function(width, height) { + var clipRect = this.paper.getById(this._getClipRectId() + '_rect'); + + clipRect.attr({ + width: width, + height: height + }); + }, + + /** + * set clip rect position + * @param {object} position series position + */ + setClipRectPosition: function(position) { + var clipRect = this.paper.getById(this._getClipRectId() + '_rect'); + + clipRect.attr({ + x: position.left, + y: position.top + }); + }, + + /** + * Set clip rect id + * @returns {string} id - clip rect id + * @private + */ + _getClipRectId: function() { + if (!this.clipRectId) { + this.clipRectId = renderUtil.generateClipRectId(); + } + + return this.clipRectId; + }, + + /** + * Change borders color. + * @param {Array.} lines raphael objects + * @param {borderColor} borderColor border color + * @private + */ + _changeBordersColor: function(lines, borderColor) { + snippet.forEach(lines, function(line) { + line.attr({stroke: borderColor}); + }); + }, + + /** + * Select legend. + * @param {?number} legendIndex legend index + */ + selectLegend: function(legendIndex) { + var allEmphasized = snippet.isNull(legendIndex); + + snippet.forEachArray(this.groupBars, function(bars, groupIndex) { + var opacity = (allEmphasized || legendIndex === groupIndex) ? EMPHASIS_OPACITY : DE_EMPHASIS_OPACITY; + + this.groupBars[groupIndex].attr({'fill-opacity': opacity}); + this.groupLabels[groupIndex].attr({opacity: opacity}); + snippet.forEachArray(this.groupLabels[groupIndex], function(label) { + label.attr({opacity: opacity}); + }); + }, this); + }, + + /** + * @param {object} paper - raphael paper + * @param {Array.} positionData - series label positions + * @param {Array.} labelData - series labels + * @param {object} labelTheme - series text theme + * @returns {object} - rendered label set + */ + renderSeriesLabel: function(paper, positionData, labelData, labelTheme) { + var attributes = { + 'font-size': labelTheme.fontSize, + 'font-family': labelTheme.fontFamily, + 'font-weight': labelTheme.fontWeight, + fill: labelTheme.color, + opacity: 0, + 'text-anchor': this.isVertical ? 'middle' : 'start' + }; + var set = paper.set(); + + this.groupLabels = snippet.map(labelData, function(labels, groupIndex) { + var labelSet = paper.set(); + snippet.forEach(labels, function(label, index) { + var labelElement = this._renderLabel(paper, positionData[groupIndex][index], attributes, label); + labelSet.push(labelElement); + set.push(labelElement); + }, this); + + return labelSet; + }, this); + + return set; + }, + + /** + * @param {object} paper - raphael paper + * @param {Array.} position - series label positions + * @param {Array.} attributes - label text attributes + * @param {string} labelText - label text + * @returns {object} - rendered label object + * @private + */ + _renderLabel: function(paper, position, attributes, labelText) { + var label = raphaelRenderUtil.renderText(paper, position, labelText, attributes); + var node = label.node; + var style = node.style; + style.userSelect = 'none'; + style.cursor = 'default'; + node.setAttribute('filter', 'url(#glow)'); + + return label; + }, + + /** + * @param {number} index - series index + * @returns {Array.} - color and opacity of series + */ + getGraphColors: function() { + return snippet.map(this.groupBars, function(barSet, groupIndex) { + var barColors = []; + var markerCount = this.groupLines[groupIndex].length; + var i = 0; + var legendColor; + + barSet.forEach(function(item) { + barColors.push(item.attrs.fill); + }); + + legendColor = barColors[barColors.length - 1]; + + for (; i <= markerCount; i += 1) { + barColors.push(legendColor); + } + + return barColors; + }, this); + } + }); + + /** + * Create clip rect with layout + * @param {object} paper Raphael paper + * @param {object} position position + * @param {object} dimension dimension + * @param {string} id ID string + * @returns {object} + * @ignore + */ + function createClipPathRectWithLayout(paper, position, dimension, id) { + var clipPath = document.createElementNS('http://www.w3.org/2000/svg', 'clipPath'); + var rect = paper.rect(position.left, position.top, dimension.width, dimension.height); + + rect.id = id + '_rect'; + clipPath.id = id; + + clipPath.appendChild(rect.node); + paper.defs.appendChild(clipPath); + + return rect; + } + + module.exports = RaphaelBulletChart; + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Raphael line chart renderer. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var RaphaelLineBase = __webpack_require__(15); + var raphaelRenderUtil = __webpack_require__(5); + var snippet = __webpack_require__(6); + + var EMPHASIS_OPACITY = 1; + var DE_EMPHASIS_OPACITY = 0.3; + + var RaphaelLineChart = snippet.defineClass(RaphaelLineBase, /** @lends RaphaelLineChart.prototype */ { + /** + * RaphaelLineCharts is graph renderer for line chart. + * @constructs RaphaelLineChart + * @private + * @private + * @extends RaphaelLineTypeBase + */ + init: function() { + /** + * selected legend index + * @type {?number} + */ + this.selectedLegendIndex = null; + + /** + * type of chart + * @type {string} + */ + this.chartType = 'line'; + + /** + * Line width + * @type {number} + */ + this.lineWidth = 2; + }, + + /** + * Render function of line chart. + * @param {object} [paper] - raphael paper + * @param {{groupPositions: Array., dimension: object, theme: object, options: object}} data render data + * @returns {object} paper raphael paper + */ + render: function(paper, data) { + var dimension = data.dimension; + var groupPositions = data.groupPositions; + var theme = data.theme; + var colors = theme.colors; + var options = data.options; + var opacity = options.showDot ? 1 : 0; + var isSpline = options.spline; + var lineWidth = this.lineWidth = (snippet.isNumber(options.pointWidth) ? options.pointWidth : this.lineWidth); + var borderStyle = this.makeBorderStyle(theme.borderColor, opacity); + var outDotStyle = this.makeOutDotStyle(opacity, borderStyle); + var groupPaths; + + if (isSpline) { + groupPaths = this._getSplineLinesPath(groupPositions, options.connectNulls); + } else { + groupPaths = this._getLinesPath(groupPositions, options.connectNulls); + } + + this.paper = paper; + this.theme = data.theme; + this.isSpline = isSpline; + this.dimension = dimension; + this.position = data.position; + + paper.setStart(); + + this.groupLines = this._renderLines(paper, groupPaths, colors, lineWidth); + this.tooltipLine = this._renderTooltipLine(paper, dimension.height); + this.groupDots = this._renderDots(paper, groupPositions, colors, opacity); + + if (options.allowSelect) { + this.selectionDot = this._makeSelectionDot(paper); + this.selectionColor = theme.selectionColor; + } + this.colors = colors; + this.borderStyle = borderStyle; + this.outDotStyle = outDotStyle; + this.groupPositions = groupPositions; + this.groupPaths = groupPaths; + this.dotOpacity = opacity; + delete this.pivotGroupDots; + + return paper.setFinish(); + }, + + /** + * Get lines path. + * @param {Array.>} groupPositions positions + * @param {boolean} [connectNulls] - boolean value connect nulls or not + * @returns {Array.>} path + * @private + */ + _getLinesPath: function(groupPositions, connectNulls) { + var self = this; + + return snippet.map(groupPositions, function(positions) { + return self._makeLinesPath(positions, null, connectNulls); + }); + }, + + /** + * Get spline lines path. + * @param {Array.>} groupPositions positions + * @param {boolean} [connectNulls] - boolean value connect nulls or not + * @returns {Array} path + * @private + */ + _getSplineLinesPath: function(groupPositions, connectNulls) { + var self = this; + + return snippet.map(groupPositions, function(positions) { + return self._makeSplineLinesPath(positions, connectNulls); + }); + }, + + /** + * Render lines. + * @param {object} paper raphael paper + * @param {Array.>} groupPaths paths + * @param {string[]} colors line colors + * @param {?number} strokeWidth stroke width + * @returns {Array.>} lines + * @private + */ + _renderLines: function(paper, groupPaths, colors, strokeWidth) { + return snippet.map(groupPaths, function(path, groupIndex) { + var color = colors[groupIndex] || 'transparent'; + + return raphaelRenderUtil.renderLine(paper, path.join(' '), color, strokeWidth); + }); + }, + + /** + * Resize graph of line chart. + * @param {object} params parameters + * @param {{width: number, height:number}} params.dimension dimension + * @param {Array.>} params.groupPositions group positions + */ + resize: function(params) { + var self = this, + dimension = params.dimension, + groupPositions = params.groupPositions; + + this.resizeClipRect(dimension.width, dimension.height); + + this.groupPositions = groupPositions; + this.groupPaths = this.isSpline ? this._getSplineLinesPath(groupPositions) : this._getLinesPath(groupPositions); + this.paper.setSize(dimension.width, dimension.height); + this.tooltipLine.attr({top: dimension.height}); + + snippet.forEachArray(this.groupPaths, function(path, groupIndex) { + self.groupLines[groupIndex].attr({path: path.join(' ')}); + + snippet.forEachArray(self.groupDots[groupIndex], function(item, index) { + if (item.endDot) { + self.moveDot(item.endDot.dot, groupPositions[groupIndex][index]); + } + }); + }); + }, + + /** + * Select legend. + * @param {?number} legendIndex legend index + */ + selectLegend: function(legendIndex) { + var noneSelected = snippet.isNull(legendIndex); + + if (this.selectedLegendIndex && this.selectedLegendIndex !== -1) { + this.resetSeriesOrder(this.selectedLegendIndex); + } + + this.selectedLegendIndex = legendIndex; + + snippet.forEachArray(this.groupLines, function(line, groupIndex) { + var isSelectedLegend = legendIndex === groupIndex; + var opacity = (noneSelected || isSelectedLegend) ? EMPHASIS_OPACITY : DE_EMPHASIS_OPACITY; + var groupDots = this.groupDots[groupIndex]; + + line.attr({'stroke-opacity': opacity}); + + snippet.forEachArray(groupDots, function(item) { + item.opacity = opacity; + + if (this.dotOpacity) { + item.endDot.dot.attr({'fill-opacity': opacity}); + } + }, this); + + if (isSelectedLegend) { + this.moveSeriesToFront(line, groupDots); + } + }, this); + + if (noneSelected) { + snippet.forEachArray(this.groupLines, function(line, groupIndex) { + this.moveSeriesToFront(line, this.groupDots[groupIndex]); + }, this); + } + }, + + /** + * Reset series order after selected to be same to when it is first rendered + * @param {number} legendIndex - legend index to reset series order + * @ignore + */ + resetSeriesOrder: function(legendIndex) { + var frontLine = legendIndex + 1 < this.groupLines.length ? this.groupLines[legendIndex + 1] : null; + + if (frontLine) { + this.groupLines[legendIndex].insertBefore(frontLine); + snippet.forEachArray(this.groupDots[legendIndex], function(item) { + item.endDot.dot.insertBefore(frontLine); + }); + } + }, + + /** + * @param {SVGElement} lineType - line or area graph + * @param {Array.} dots - dot type element + * @ignore + * @override + */ + moveSeriesToFront: function(lineType, dots) { + lineType.toFront(); + + snippet.forEachArray(dots, function(item) { + item.endDot.dot.toFront(); + }); + }, + + /** + * Animate for adding data. + * @param {object} data - data for graph rendering + * @param {number} tickSize - tick size + * @param {Array.>} groupPositions - group positions + * @param {boolean} [shiftingOption] - shifting option + */ + animateForAddingData: function(data, tickSize, groupPositions, shiftingOption) { + var self = this; + var isSpline = data.options.spline; + var groupPaths = isSpline ? this._getSplineLinesPath(groupPositions) : this._getLinesPath(groupPositions); + var additionalIndex = 0; + + if (!groupPositions.length) { + return; + } + + if (shiftingOption) { + additionalIndex = 1; + } + + snippet.forEachArray(this.groupLines, function(line, groupIndex) { + var dots = self.groupDots[groupIndex]; + var groupPosition = groupPositions[groupIndex]; + + if (shiftingOption) { + self._removeFirstDot(dots); + } + + snippet.forEachArray(dots, function(item, index) { + var position = groupPosition[index + additionalIndex]; + self._animateByPosition(item.endDot.dot, position, tickSize); + }); + + self._animateByPath(line, groupPaths[groupIndex], tickSize); + }); + }, + + renderSeriesLabel: function(paper, groupPositions, groupLabels, labelTheme) { + var attributes = { + 'font-size': labelTheme.fontSize, + 'font-family': labelTheme.fontFamily, + 'font-weight': labelTheme.fontWeight, + fill: labelTheme.color, + 'text-anchor': 'middle', + opacity: 0 + }; + var set = paper.set(); + + snippet.forEach(groupLabels, function(categoryLabel, categoryIndex) { + snippet.forEach(categoryLabel, function(label, seriesIndex) { + var position = groupPositions[categoryIndex][seriesIndex]; + var endLabel = raphaelRenderUtil.renderText(paper, position.end, label.end, attributes); + var startLabel; + + set.push(endLabel); + + endLabel.node.style.userSelect = 'none'; + endLabel.node.style.cursor = 'default'; + endLabel.node.setAttribute('filter', 'url(#glow)'); + + if (position.start) { + startLabel = raphaelRenderUtil.renderText(paper, position.start, label.start, attributes); + + startLabel.node.style.userSelect = 'none'; + startLabel.node.style.cursor = 'default'; + startLabel.node.setAttribute('filter', 'url(#glow)'); + + set.push(startLabel); + } + }); + }); + + return set; + } + }); + + module.exports = RaphaelLineChart; + + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview RaphaelLineTypeBase is base class for line type renderer. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var raphaelRenderUtil = __webpack_require__(5); + var renderUtil = __webpack_require__(7); + var snippet = __webpack_require__(6); + var arrayUtil = __webpack_require__(10); + + var browser = snippet.browser; + var IS_LTE_IE8 = browser.msie && browser.version <= 8; + var ANIMATION_DURATION = 700; + var DEFAULT_DOT_RADIUS = 3; + var SELECTION_DOT_RADIUS = 7; + var DE_EMPHASIS_OPACITY = 0.3; + var MOVING_ANIMATION_DURATION = 300; + + var concat = Array.prototype.concat; + + /** + * @classdesc RaphaelLineTypeBase is base for line type renderer. + * @class RaphaelLineTypeBase + * @private + */ + var RaphaelLineTypeBase = snippet.defineClass(/** @lends RaphaelLineTypeBase.prototype */ { + /** + * Make lines path. + * @param {Array.<{left: number, top: number, startTop: number}>} positions positions + * @param {?string} [posTopType='top'] position top type + * @param {boolean} [connectNulls] - boolean value connect nulls or not + * @returns {Array.} paths + * @private + */ + _makeLinesPath: function(positions, posTopType, connectNulls) { + var path = []; + var prevMissing = false; + + posTopType = posTopType || 'top'; + snippet.map(positions, function(position) { + var pathCommand = (prevMissing && !connectNulls) ? 'M' : 'L'; + + if (position) { + path.push([pathCommand, position.left, position[posTopType]]); + if (prevMissing) { + prevMissing = false; + } + } else { + prevMissing = true; + } + }); + + path = concat.apply([], path); + + if (path.length > 0) { + path[0] = 'M'; + } + + return path; + }, + + /** + * Get anchor. (http://raphaeljs.com/analytics.js) + * @param {{left: number, top: number}} fromPos from position + * @param {{left: number, top: number}} pos position + * @param {{left: number, top: number}} nextPos next position + * @returns {{x1: number, y1: number, x2: number, y2: number}} anchor + * @private + */ + _getAnchor: function(fromPos, pos, nextPos) { + var l1 = (pos.left - fromPos.left) / 2, + l2 = (nextPos.left - pos.left) / 2, + a = Math.atan((pos.left - fromPos.left) / Math.abs(pos.top - fromPos.top)), + b = Math.atan((nextPos.left - pos.left) / Math.abs(pos.top - nextPos.top)), + alpha, dx1, dy1, dx2, dy2; + + a = fromPos.top < pos.top ? Math.PI - a : a; + b = nextPos.top < pos.top ? Math.PI - b : b; + alpha = (Math.PI / 2) - (((a + b) % (Math.PI * 2)) / 2); + dx1 = l1 * Math.sin(alpha + a); + dy1 = l1 * Math.cos(alpha + a); + dx2 = l2 * Math.sin(alpha + b); + dy2 = l2 * Math.cos(alpha + b); + + return { + x1: pos.left - dx1, + y1: pos.top + dy1, + x2: pos.left + dx2, + y2: pos.top + dy2 + }; + }, + + /** + * Get spline positions groups which is divided with null data value. + * If series has not divided positions, it returns only one positions group. + * @param {Array.} positions positions array + * @param {boolean} connectNulls option of connect line of both null data's side + * @returns {Array.>} + * @private + */ + _getSplinePositionsGroups: function(positions, connectNulls) { + var positionsGroups = []; + var positionsGroup = []; + snippet.forEach(positions, function(position, index) { + var isLastIndex = index === positions.length - 1; + + if (position) { + positionsGroup.push(position); + } + + if ((!position && positionsGroup.length > 0 && !connectNulls) || isLastIndex) { + positionsGroups.push(positionsGroup); + positionsGroup = []; + } + }); + + return positionsGroups; + }, + + /** + * Get spline partial paths + * @param {Array.>} positionsGroups positions groups + * @returns {Array.>} + * @private + */ + _getSplinePartialPaths: function(positionsGroups) { + var self = this; + var paths = []; + var firstPos, lastPos, positionsLen, fromPos, middlePositions, path, prevPos; + + snippet.forEach(positionsGroups, function(dataPositions) { + prevPos = firstPos = dataPositions[0]; + positionsLen = dataPositions.length; + fromPos = firstPos; + lastPos = dataPositions[positionsLen - 1]; + middlePositions = dataPositions.slice(1).slice(0, positionsLen - 2); + + path = snippet.map(middlePositions, function(position, index) { + var nextPos = dataPositions[index + 2]; + var anchor = self._getAnchor(fromPos, position, nextPos); + + fromPos = position; + + if (Math.abs(anchor.y1 - prevPos.top) > Math.abs(prevPos.top - position.top)) { + anchor.y1 = position.top; + } + + if (Math.abs(anchor.y2 - nextPos.top) > Math.abs(nextPos.top - position.top)) { + anchor.y2 = position.top; + } + + prevPos = position; + + return [anchor.x1, anchor.y1, position.left, position.top, anchor.x2, anchor.y2]; + }); + + path.push([lastPos.left, lastPos.top, lastPos.left, lastPos.top]); + path.unshift(['M', firstPos.left, firstPos.top, 'C', firstPos.left, firstPos.top]); + paths.push(path); + }); + + return paths; + }, + + /** + * Make spline lines path. + * @param {Array.<{left: number, top: number, startTop: number}>} positions positions + * @param {boolean} [connectNulls] - boolean value connect nulls or not + * @returns {Array.} paths + * @private + */ + _makeSplineLinesPath: function(positions, connectNulls) { + var path = []; + var positionsGroups = this._getSplinePositionsGroups(positions, connectNulls); + var partialPaths = this._getSplinePartialPaths(positionsGroups); + + snippet.forEach(partialPaths, function(partialPath) { + path = path.concat(partialPath); + }); + + return path; + }, + + /** + * Render tooltip line. + * @param {object} paper raphael paper + * @param {number} height height + * @returns {object} raphael object + * @private + */ + _renderTooltipLine: function(paper, height) { + var linePath = raphaelRenderUtil.makeLinePath({ + left: 10, + top: height + }, { + left: 10, + top: 0 + }); + + return raphaelRenderUtil.renderLine(paper, linePath, 'transparent', 1); + }, + + /** + * Make border style. + * @param {string} borderColor border color + * @param {number} opacity opacity + * @returns {{stroke: string, stroke-width: number, strike-opacity: number}} border style + */ + makeBorderStyle: function(borderColor, opacity) { + var borderStyle; + + if (borderColor) { + borderStyle = { + stroke: borderColor, + 'stroke-width': 1, + 'stroke-opacity': opacity + }; + } + + return borderStyle; + }, + + /** + * Make dot style for mouseout event. + * @param {number} opacity opacity + * @param {object} borderStyle border style + * @returns {{fill-opacity: number, stroke-opacity: number, r: number}} style + */ + makeOutDotStyle: function(opacity, borderStyle) { + var outDotStyle = { + 'fill-opacity': opacity, + 'stroke-opacity': 0, + r: DEFAULT_DOT_RADIUS + }; + + if (borderStyle) { + snippet.extend(outDotStyle, borderStyle); + } + + return outDotStyle; + }, + + /** + * Render dot. + * @param {object} paper raphael papaer + * @param {{left: number, top: number}} position dot position + * @param {string} color dot color + * @param {number} opacity opacity + * @returns {object} raphael dot + */ + renderDot: function(paper, position, color, opacity) { + var dotTheme = (this.theme && this.theme.dot) || {dot: {}}; + var dot, dotStyle, raphaelDot; + + if (position) { + dot = paper.circle(position.left, position.top, dotTheme.radius || DEFAULT_DOT_RADIUS); + dotStyle = { + fill: dotTheme.fillColor || color, + 'fill-opacity': snippet.isNumber(opacity) ? opacity : dotTheme.fillOpacity, + stroke: dotTheme.strokeColor || color, + 'stroke-opacity': snippet.isNumber(opacity) ? opacity : dotTheme.strokeOpacity, + 'stroke-width': dotTheme.strokeWidth + }; + + dot.attr(dotStyle); + + raphaelDot = { + dot: dot, + color: color + }; + } + + return raphaelDot; + }, + + /** + * Move dots to front. + * @param {Array.<{startDot: {dot: object}, endDot: {dot: object}}>} dots - dots + * @private + */ + _moveDotsToFront: function(dots) { + raphaelRenderUtil.forEach2dArray(dots, function(dotInfo) { + dotInfo.endDot.dot.toFront(); + if (dotInfo.startDot) { + dotInfo.startDot.dot.toFront(); + } + }); + }, + + /** + * Render dots. + * @param {object} paper raphael paper + * @param {Array.>} groupPositions positions + * @param {string[]} colors colors + * @param {number} opacity opacity + * @param {Array.} [seriesSet] series set + * @returns {Array.} dots + * @private + */ + _renderDots: function(paper, groupPositions, colors, opacity, seriesSet) { + var self = this; + var dots; + + dots = snippet.map(groupPositions, function(positions, groupIndex) { + var color = colors[groupIndex]; + + return snippet.map(positions, function(position) { + var dotMap = { + endDot: self.renderDot(paper, position, color, opacity) + }; + var startPosition; + + if (self.hasRangeData) { + startPosition = snippet.extend({}, position); + startPosition.top = startPosition.startTop; + dotMap.startDot = self.renderDot(paper, startPosition, color, opacity); + } + + if (seriesSet) { + seriesSet.push(dotMap.endDot.dot); + if (dotMap.startDot) { + seriesSet.push(dotMap.startDot.dot); + } + } + + return dotMap; + }); + }); + + return dots; + }, + + /** + * Get center position + * @param {{left: number, top: number}} fromPos from position + * @param {{left: number, top: number}} toPos to position + * @returns {{left: number, top: number}} position + * @private + */ + _getCenter: function(fromPos, toPos) { + return { + left: (fromPos.left + toPos.left) / 2, + top: (fromPos.top + toPos.top) / 2 + }; + }, + + /** + * Show dot. + * @param {object} dotInformation raphael object + * @param {number} groupIndex seriesIndex + * @private + */ + _showDot: function(dotInformation, groupIndex) { + var hoverTheme = this.theme.dot.hover; + var attributes = { + 'fill-opacity': hoverTheme.fillOpacity, + stroke: hoverTheme.strokeColor || dotInformation.color, + 'stroke-opacity': hoverTheme.strokeOpacity, + 'stroke-width': hoverTheme.strokeWidth, + r: hoverTheme.radius + }; + + this._setPrevDotAttributes(groupIndex, dotInformation.dot); + + if (hoverTheme.fillColor) { + attributes.fill = hoverTheme.fillColor; + } + + dotInformation.dot.attr(attributes); + }, + + /** + * temp save dot style attribute + * @param {number} groupIndex seriesIndex + * @param {object} dot raphael circle object + * @private + */ + _setPrevDotAttributes: function(groupIndex, dot) { + if (!this._prevDotAttributes) { + this._prevDotAttributes = {}; + } + this._prevDotAttributes[groupIndex] = dot.attr(); + }, + + /** + * Update line stroke width. + * @param {object} line raphael object + * @param {number} strokeWidth stroke width + * @private + */ + _updateLineStrokeWidth: function(line, strokeWidth) { + line.attr({ + 'stroke-width': strokeWidth + }); + }, + + /** + * Show animation. + * @param {{groupIndex: number, index:number}} data show info + */ + showAnimation: function(data) { + var index = data.groupIndex; // Line chart has pivot values. + var groupIndex = data.index; + var line = this.groupLines ? this.groupLines[groupIndex] : this.groupAreas[groupIndex]; + var item = this.groupDots[groupIndex][index]; + var strokeWidth, startLine; + + if (!item) { + return; + } + + if (this.chartType === 'area') { + strokeWidth = this.lineWidth * 2; + startLine = line.startLine; + line = line.line; + } else { + strokeWidth = this.lineWidth * 2; + } + + this._updateLineStrokeWidth(line, strokeWidth); + + if (startLine) { + this._updateLineStrokeWidth(startLine, strokeWidth); + } + this._showDot(item.endDot, groupIndex); + + if (item.startDot) { + this._showDot(item.startDot, groupIndex); + } + }, + + /** + * Get pivot group dots. + * @returns {Array.} dots + * @private + */ + _getPivotGroupDots: function() { + if (!this.pivotGroupDots && this.groupDots) { + this.pivotGroupDots = arrayUtil.pivot(this.groupDots); + } + + return this.pivotGroupDots; + }, + + /** + * Show group dots. + * @param {number} index index + * @private + */ + _showGroupDots: function(index) { + var self = this; + var groupDots = this._getPivotGroupDots(); + + if (!groupDots || !groupDots[index]) { + return; + } + + snippet.forEachArray(groupDots[index], function(item, groupIndex) { + if (item.endDot) { + self._showDot(item.endDot, groupIndex); + } + + if (item.startDot) { + self._showDot(item.startDot, groupIndex); + } + }); + }, + + /** + * Show line for group tooltip. + * @param {{ + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }} bound bound + * @param {object} layout layout + */ + showGroupTooltipLine: function(bound, layout) { + var left = Math.max(bound.position.left, 11); + var linePath = raphaelRenderUtil.makeLinePath({ + left: left, + top: layout.position.top + bound.dimension.height + }, { + left: left, + top: layout.position.top + }); + + if (this.tooltipLine) { + this.tooltipLine.attr({ + path: linePath, + stroke: '#999', + 'stroke-opacity': 1 + }); + } + }, + + /** + * Show group animation. + * @param {number} index index + */ + showGroupAnimation: function(index) { + this._showGroupDots(index); + }, + + /** + * Hide dot. + * @param {object} dot raphael object + * @param {number} groupIndex seriesIndex + * @param {?number} opacity opacity + * @private + */ + _hideDot: function(dot, groupIndex, opacity) { + var prev = this._prevDotAttributes[groupIndex]; + var outDotStyle = this.outDotStyle; + + // if prev data exists, use prev.r + // there is dot disappearing issue, when hideDot + if (prev && !snippet.isUndefined(opacity)) { + outDotStyle = snippet.extend({ + 'r': prev.r, + 'stroke': prev.stroke, + 'fill': prev.fill, + 'stroke-opacity': prev['stroke-opacity'], + 'stroke-width': prev['stroke-width'] + }, { + 'fill-opacity': opacity + }); + } + + dot.attr(outDotStyle); + }, + + /** + * Hide animation. + * @param {{groupIndex: number, index:number}} data hide info + */ + hideAnimation: function(data) { + var index = data.groupIndex; // Line chart has pivot values. + var groupIndex = data.index; + var opacity = this.dotOpacity; + var groupDot = this.groupDots[groupIndex]; + var line, item, strokeWidth, startLine; + + if (!groupDot || !groupDot[index]) { + return; + } + + line = this.groupLines ? this.groupLines[groupIndex] : this.groupAreas[groupIndex]; + item = groupDot[index]; + + if (this.chartType === 'area') { + strokeWidth = this.lineWidth; + startLine = line.startLine; + line = line.line; + } else { + strokeWidth = this.lineWidth; + } + + if (opacity && !snippet.isNull(this.selectedLegendIndex) && this.selectedLegendIndex !== groupIndex) { + opacity = DE_EMPHASIS_OPACITY; + } + + if (line) { + this._updateLineStrokeWidth(line, strokeWidth); + } + + if (startLine) { + this._updateLineStrokeWidth(startLine, strokeWidth); + } + + if (item) { + this._hideDot(item.endDot.dot, groupIndex, opacity); + + if (item.startDot) { + this._hideDot(item.startDot.dot, groupIndex, opacity); + } + } + }, + + /** + * Hide group dots. + * @param {number} index index + * @private + */ + _hideGroupDots: function(index) { + var self = this; + var hasSelectedIndex = !snippet.isNull(this.selectedLegendIndex); + var baseOpacity = this.dotOpacity; + var groupDots = this._getPivotGroupDots(); + + if (!groupDots || !groupDots[index]) { + return; + } + + snippet.forEachArray(groupDots[index], function(item, groupIndex) { + var opacity = baseOpacity; + + if (opacity && hasSelectedIndex && self.selectedLegendIndex !== groupIndex) { + opacity = DE_EMPHASIS_OPACITY; + } + + if (item.endDot) { + self._hideDot(item.endDot.dot, groupIndex, opacity); + } + + if (item.startDot) { + self._hideDot(item.startDot.dot, groupIndex, opacity); + } + }); + }, + + /** + * Hide line for group tooltip. + */ + hideGroupTooltipLine: function() { + this.tooltipLine.attr({ + 'stroke-opacity': 0 + }); + }, + + /** + * Hide group animation. + * @param {number} index index + */ + hideGroupAnimation: function(index) { + this._hideGroupDots(index); + }, + + /** + * Move dot. + * @param {object} dot - raphael object + * @param {{left: number, top: number}} position - position + * @private + */ + _moveDot: function(dot, position) { + var dotAttrs = { + cx: position.left, + cy: position.top + }; + + if (this.dotOpacity) { + dotAttrs = snippet.extend({'fill-opacity': this.dotOpacity}, dotAttrs, this.borderStyle); + } + + dot.attr(dotAttrs); + }, + + /** + * Animate. + * @param {function} onFinish callback + * @param {Array.} seriesSet series set + */ + animate: function(onFinish, seriesSet) { + var paper = this.paper; + var dimension = this.dimension; + var position = this.position; + var clipRect = this.clipRect; + var clipRectId = this._getClipRectId(); + + if (!IS_LTE_IE8 && dimension) { + if (!clipRect) { + clipRect = createClipPathRectWithLayout(paper, position, dimension, clipRectId); + this.clipRect = clipRect; + } else { + clipRect.attr({ + width: 0, + height: dimension.height + }); + } + + seriesSet.forEach(function(seriesElement) { + seriesElement.node.setAttribute('clip-path', 'url(#' + clipRectId + ')'); + }); + + clipRect.animate({ + width: dimension.width + }, ANIMATION_DURATION, '>', onFinish); + } + }, + + /** + * Make selection dot. + * @param {object} paper raphael paper + * @returns {object} selection dot + * @private + */ + _makeSelectionDot: function(paper) { + var selectionDot = paper.circle(0, 0, SELECTION_DOT_RADIUS); + + selectionDot.attr({ + 'fill': '#ffffff', + 'fill-opacity': 0, + 'stroke-opacity': 0, + 'stroke-width': 2 + }); + + return selectionDot; + }, + + /** + * Select series. + * @param {{groupIndex: number, index: number}} indexes indexes + */ + selectSeries: function(indexes) { + var item = this.groupDots[indexes.index][indexes.groupIndex], + position = this.groupPositions[indexes.index][indexes.groupIndex]; + + this.selectedItem = item; + this.selectionDot.attr({ + cx: position.left, + cy: position.top, + 'fill-opacity': 0.5, + 'stroke-opacity': 1, + stroke: this.selectionColor || item.endDot.color + }); + + if (this.selectionStartDot) { + this.selectionStartDot.attr({ + cx: position.left, + cy: position.startTop, + 'fill-opacity': 0.5, + 'stroke-opacity': 1, + stroke: this.selectionColor || item.startDot.color + }); + } + }, + + /** + * Unselect series. + * @param {{groupIndex: number, index: number}} indexes indexes + */ + unselectSeries: function(indexes) { + var item = this.groupDots[indexes.index][indexes.groupIndex]; + + if (this.selectedItem === item) { + this.selectionDot.attr({ + 'fill-opacity': 0, + 'stroke-opacity': 0 + }); + } + + if (this.selectionStartDot) { + this.selectionStartDot.attr({ + 'fill-opacity': 0, + 'stroke-opacity': 0 + }); + } + }, + + /** + * Set width or height of paper. + * @param {number} width - width + * @param {number} height - height + */ + setSize: function(width, height) { + width = width || this.dimension.width; + height = height || this.dimension.height; + this.paper.setSize(width, height); + }, + + /** + * Animate by position. + * @param {object} raphaelObj - raphael object + * @param {{left: number, top: number}} position - position + * @param {number} tickSize tick size + * @private + */ + _animateByPosition: function(raphaelObj, position, tickSize) { + var attr = { + cx: position.left, + cy: position.top + }; + + if (snippet.isExisty(tickSize)) { + attr.transform = 't-' + tickSize + ',0'; + } + + raphaelObj.animate(attr, MOVING_ANIMATION_DURATION); + }, + + /** + * Animate by path. + * @param {object} raphaelObj - raphael object + * @param {Array.} paths - paths + * @param {number} tickSize tick size + * @private + */ + _animateByPath: function(raphaelObj, paths, tickSize) { + var attr = { + path: paths.join(' ') + }; + + if (snippet.isExisty(tickSize)) { + attr.transform = 't-' + tickSize + ',0'; + } + + raphaelObj.animate(attr, MOVING_ANIMATION_DURATION); + }, + + /** + * Remove first dot. + * @param {Array.} dots - dots + * @private + */ + _removeFirstDot: function(dots) { + var firstDot = dots.shift(); + + firstDot.endDot.dot.remove(); + + if (firstDot.startDot) { + firstDot.startDot.dot.remove(); + } + }, + + /** + * Clear paper. + */ + clear: function() { + delete this.paper.dots; + this.paper.clear(); + }, + + /** + * Resize clip rect size + * @param {number} width series width + * @param {number} height series height + */ + resizeClipRect: function(width, height) { + var clipRect = this.paper.getById(this._getClipRectId() + '_rect'); + + clipRect.attr({ + width: width, + height: height + }); + }, + + /** + * Set clip rect id + * @returns {string} id - clip rect id + * @private + */ + _getClipRectId: function() { + if (!this.clipRectId) { + this.clipRectId = renderUtil.generateClipRectId(); + } + + return this.clipRectId; + }, + + /** + * Reset series order after selected to be same to when it is first rendered + * @param {number} legendIndex - legend index to reset series order + * @ignore + * @abstract + */ + resetSeriesOrder: function() {}, + + /** + * @param {SVGElement | {area: {SVGElement}, line: {SVGElement}, startLine: {SVGElement}}} lineType - line or area graph + * @param {Array.} dots - dot type element + * @abstract + */ + moveSeriesToFront: function() {} + }); + + /** + * Create clip rect with layout + * @param {object} paper Raphael paper + * @param {object} position position + * @param {object} dimension dimension + * @param {string} id ID string + * @returns {object} + * @ignore + */ + function createClipPathRectWithLayout(paper, position, dimension, id) { + var clipPath = document.createElementNS('http://www.w3.org/2000/svg', 'clipPath'); + var rect = paper.rect((position.left - 10), (position.top - 10), 0, dimension.height); + + rect.id = id + '_rect'; + clipPath.id = id; + + clipPath.appendChild(rect.node); + paper.defs.appendChild(clipPath); + + return rect; + } + + module.exports = RaphaelLineTypeBase; + + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Raphael area chart renderer. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var RaphaelLineBase = __webpack_require__(15); + var raphaelRenderUtil = __webpack_require__(5); + var snippet = __webpack_require__(6); + + var EMPHASIS_OPACITY = 1; + var DE_EMPHASIS_OPACITY = 0.3; + + var concat = Array.prototype.concat; + var GUIDE_AREACHART_AREAOPACITY_TYPE = __webpack_require__(8).GUIDE_AREACHART_AREAOPACITY_TYPE; + var consoleUtil = __webpack_require__(17); + + var RaphaelAreaChart = snippet.defineClass(RaphaelLineBase, /** @lends RaphaelAreaChart.prototype */ { + /** + * RaphaelAreaChart is graph renderer for area chart. + * @constructs RaphaelAreaChart + * @private + * @private + * @extends RaphaelLineTypeBase + */ + init: function() { + /** + * selected legend index + * @type {?number} + */ + this.selectedLegendIndex = null; + + /** + * type of chart + * @type {string} + */ + this.chartType = 'area'; + + /** + * Line width + * @type {number} + */ + this.lineWidth = 1; + }, + + /** + * Render function of area chart. + * @param {object} paper - raphael paper + * @param {{groupPositions: Array., dimension: object, theme: object, options: object}} data render data + * @returns {object} + */ + render: function(paper, data) { + var dimension = data.dimension; + var groupPositions = data.groupPositions; + var theme = data.theme; + var colors = theme.colors; + var options = data.options; + var areaOpacity = this._isAreaOpacityNumber(options.areaOpacity) ? options.areaOpacity : 0.5; + var dotOpacity = options.showDot ? 1 : 0; + var borderStyle = this.makeBorderStyle(theme.borderColor, dotOpacity); + var outDotStyle = this.makeOutDotStyle(dotOpacity, borderStyle); + var lineWidth = this.lineWidth = (snippet.isNumber(options.pointWidth) ? options.pointWidth : this.lineWidth); + + this.paper = paper; + this.theme = data.theme; + this.isSpline = options.spline; + this.dimension = dimension; + this.position = data.position; + + this.zeroTop = data.zeroTop; + this.hasRangeData = data.hasRangeData; + + paper.setStart(); + + this.groupPaths = this._getAreaChartPath(groupPositions, null, options.connectNulls); + this.groupAreas = this._renderAreas(paper, this.groupPaths, colors, lineWidth, areaOpacity); + this.tooltipLine = this._renderTooltipLine(paper, dimension.height); + this.groupDots = this._renderDots(paper, groupPositions, colors, dotOpacity); + + if (options.allowSelect) { + this.selectionDot = this._makeSelectionDot(paper); + this.selectionColor = theme.selectionColor; + + if (this.hasRangeData) { + this.selectionStartDot = this._makeSelectionDot(paper); + } + } + + this.outDotStyle = outDotStyle; + this.groupPositions = groupPositions; + this.dotOpacity = dotOpacity; + + this.pivotGroupDots = null; + + return paper.setFinish(); + }, + + /** + * Get path for area chart. + * @param {Array.>} groupPositions - positions + * @param {boolean} [hasExtraPath] - whether has extra path or not + * @param {boolean} [connectNulls] - boolean value connect nulls or not + * @returns {*} + * @private + */ + _getAreaChartPath: function(groupPositions, hasExtraPath, connectNulls) { + var path; + + if (this.isSpline) { + path = this._makeSplineAreaChartPath(groupPositions, hasExtraPath); + } else { + path = this._makeAreaChartPath(groupPositions, hasExtraPath, connectNulls); + } + + return path; + }, + + /** + * Render area graphs. + * @param {object} paper paper + * @param {Array.} groupPaths group paths + * @param {Array.} colors colors + * @param {number} lineWidth line width + * @param {number} opacity opacity + * @returns {Array} raphael objects + * @private + */ + _renderAreas: function(paper, groupPaths, colors, lineWidth, opacity) { + var groupAreas; + + colors = colors.slice(0, groupPaths.length); + colors.reverse(); + groupPaths.reverse(); + + groupAreas = snippet.map(groupPaths, function(path, groupIndex) { + var areaColor = colors[groupIndex] || 'transparent', + lineColor = areaColor, + polygons = { + area: raphaelRenderUtil.renderArea(paper, path.area.join(' '), { + fill: areaColor, + opacity: opacity, + stroke: areaColor + }), + line: raphaelRenderUtil.renderLine(paper, path.line.join(' '), lineColor, lineWidth) + }; + + if (path.startLine) { + polygons.startLine = raphaelRenderUtil.renderLine(paper, path.startLine.join(' '), lineColor, 1); + } + + return polygons; + }); + + return groupAreas.reverse(); + }, + + /** + * Make height. + * @param {number} top top + * @param {number} startTop start top + * @returns {number} height + * @private + */ + _makeHeight: function(top, startTop) { + return Math.abs(top - startTop); + }, + + /** + * Make areas path. + * @param {Array.<{left: number, top: number, startTop: number}>} positions positions + * @param {boolean} [hasExtraPath] - whether has extra path or not + * @returns {Array.} path + * @private + */ + _makeAreasPath: function(positions, hasExtraPath) { + var path = []; + var paths = []; + var prevNull = false; + var positionLength = positions.length; + var targetIndex; + var formerPath = []; + var latterPath = []; + + snippet.forEachArray(positions, function(position, index) { + var moveOrLine; + if (position) { + if (prevNull) { + moveOrLine = 'M'; + prevNull = false; + } else { + moveOrLine = 'L'; + } + + formerPath.push([moveOrLine, position.left, position.top]); + latterPath.unshift(['L', position.left, position.startTop]); + } else { + prevNull = true; + latterPath.push(['z']); + } + + if (!position || index === positionLength - 1) { + paths.push(formerPath.concat(latterPath)); + formerPath = []; + latterPath = []; + } + }); + + snippet.forEachArray(paths, function(partialPath) { + path = path.concat(partialPath); + }); + + if (hasExtraPath !== false) { + targetIndex = positions.length - 1; + path.splice(targetIndex + 1, 0, path[targetIndex], path[targetIndex + 1]); + } + + path = concat.apply([], path); + path[0] = 'M'; + + return path; + }, + + /** + * Make path for area chart. + * @param {Array.>} groupPositions positions + * @param {boolean} [hasExtraPath] - whether has extra path or not + * @param {boolean} [connectNulls] - boolean value connect nulls or not + * @returns {Array.<{area: Array., line: Array.}>} path + * @private + */ + _makeAreaChartPath: function(groupPositions, hasExtraPath, connectNulls) { + var self = this; + + return snippet.map(groupPositions, function(positions) { + var paths; + + paths = { + area: self._makeAreasPath(positions, hasExtraPath), + line: self._makeLinesPath(positions, null, connectNulls) + }; + + if (self.hasRangeData) { + paths.startLine = self._makeLinesPath(positions, 'startTop'); + } + + return paths; + }); + }, + + /** + * Make spline area bottom path. + * @param {Array.<{left: number, top: number}>} positions positions + * @returns {Array.} spline area path + * @private + */ + _makeSplineAreaBottomPath: function(positions) { + var self = this; + + return snippet.map(positions, function(position) { + return ['L', position.left, self.zeroTop]; + }).reverse(); + }, + + /** + * Make spline path for area chart. + * @param {Array.>} groupPositions positions + * @param {boolean} [hasExtraPath] - whether has extra path or not + * @returns {Array.<{area: Array., line: Array.}>} path + * @private + */ + _makeSplineAreaChartPath: function(groupPositions, hasExtraPath) { + var self = this; + + return snippet.map(groupPositions, function(positions) { + var linesPath = self._makeSplineLinesPath(positions); + var areaPath = JSON.parse(JSON.stringify(linesPath)); + var areasBottomPath = self._makeSplineAreaBottomPath(positions); + var lastPosition; + + if (hasExtraPath !== false) { + lastPosition = positions[positions.length - 1]; + areaPath.push(['L', lastPosition.left, lastPosition.top]); + areasBottomPath.unshift(['L', lastPosition.left, self.zeroTop]); + } + + return { + area: areaPath.concat(areasBottomPath), + line: linesPath + }; + }); + }, + + /** + * Resize graph of area chart. + * @param {object} params parameters + * @param {{width: number, height:number}} params.dimension dimension + * @param {Array.>} params.groupPositions group positions + */ + resize: function(params) { + var self = this, + dimension = params.dimension, + groupPositions = params.groupPositions; + + this.resizeClipRect(dimension.width, dimension.height); + + this.zeroTop = params.zeroTop; + this.groupPositions = groupPositions; + this.groupPaths = this._getAreaChartPath(groupPositions); + this.paper.setSize(dimension.width, dimension.height); + this.tooltipLine.attr({top: dimension.height}); + + snippet.forEachArray(this.groupPaths, function(path, groupIndex) { + var area = self.groupAreas[groupIndex]; + area.area.attr({path: path.area.join(' ')}); + area.line.attr({path: path.line.join(' ')}); + + if (area.startLine) { + area.startLine.attr({path: path.startLine.join(' ')}); + } + + snippet.forEachArray(self.groupDots[groupIndex], function(item, index) { + var position = groupPositions[groupIndex][index]; + var startPositon; + + if (item.endDot) { + self._moveDot(item.endDot.dot, position); + } + if (item.startDot) { + startPositon = snippet.extend({}, position); + startPositon.top = startPositon.startTop; + self._moveDot(item.startDot.dot, startPositon); + } + }); + }); + }, + + /** + * Select legend. + * @param {?number} legendIndex legend index + */ + selectLegend: function(legendIndex) { + var noneSelected = snippet.isNull(legendIndex); + + if (this.selectedLegendIndex && this.selectedLegendIndex !== -1) { + this.resetSeriesOrder(this.selectedLegendIndex); + } + + this.selectedLegendIndex = legendIndex; + + snippet.forEachArray(this.groupAreas, function(area, groupIndex) { + var isSelectedLegend = legendIndex === groupIndex; + var opacity = (noneSelected || isSelectedLegend) ? EMPHASIS_OPACITY : DE_EMPHASIS_OPACITY; + var groupDots = this.groupDots[groupIndex]; + + area.area.attr({'fill-opacity': opacity}); + area.line.attr({'stroke-opacity': opacity}); + + if (area.startLine) { + area.startLine.attr({'stroke-opacity': opacity}); + } + + snippet.forEachArray(groupDots, function(item) { + if (this.dotOpacity) { + item.endDot.dot.attr({'fill-opacity': opacity}); + if (item.startDot) { + item.startDot.dot.attr({'fill-opacity': opacity}); + } + } + }, this); + + if (isSelectedLegend) { + this.moveSeriesToFront(area, groupDots); + } + }, this); + }, + + /** + * Reset series order after selected to be same to when it is first rendered + * @param {number} legendIndex - legend index to reset series order + * @ignore + */ + resetSeriesOrder: function(legendIndex) { + var frontLine = legendIndex + 1 < this.groupLines.length ? this.groupLines[legendIndex + 1] : null; + + if (frontLine) { + this.groupLines[legendIndex].insertBefore(frontLine); + snippet.forEachArray(this.groupDots[legendIndex], function(item) { + item.endDot.dot.insertBefore(frontLine); + }); + } + }, + + /** + * @param {{area: {SVGElement}, line: {SVGElement}, startLine: {SVGElement}}} areaSurface - line or plane to represent area chart + * @param {Array.} dots - dot type element + * @ignore + * @override + */ + moveSeriesToFront: function(areaSurface, dots) { + areaSurface.line.toFront(); + areaSurface.area.toFront(); + if (areaSurface.startLine) { + areaSurface.startLine.toFront(); + } + + snippet.forEachArray(dots, function(item) { + item.endDot.dot.toFront(); + if (item.startDot) { + item.startDot.dot.toFront(); + } + }); + }, + + /** + * Animate for adding data. + * @param {object} data - data for graph rendering + * @param {number} tickSize - tick size + * @param {Array.>} groupPositions - group positions + * @param {boolean} [shiftingOption] - shifting option + * @param {number} zeroTop - position top value for zero point + */ + animateForAddingData: function(data, tickSize, groupPositions, shiftingOption, zeroTop) { + var self = this; + var groupPaths = this._getAreaChartPath(groupPositions, false); + var additionalIndex = 0; + + if (!groupPositions.length) { + return; + } + + if (shiftingOption) { + additionalIndex = 1; + } + + this.zeroTop = zeroTop; + + snippet.forEachArray(this.groupAreas, function(area, groupIndex) { + var dots = self.groupDots[groupIndex]; + var groupPosition = groupPositions[groupIndex]; + var pathMap = groupPaths[groupIndex]; + + if (shiftingOption) { + self._removeFirstDot(dots); + } + + snippet.forEachArray(dots, function(item, index) { + var position = groupPosition[index + additionalIndex]; + self._animateByPosition(item.endDot.dot, position, tickSize); + + if (item.startDot) { + self._animateByPosition(item.startDot.dot, { + left: position.left, + top: position.startTop + }, tickSize); + } + }); + + self._animateByPath(area.area, pathMap.area, tickSize); + self._animateByPath(area.line, pathMap.line, tickSize); + + if (area.startLine) { + self._animateByPath(area.startLine, pathMap.startLine, tickSize); + } + }); + }, + + renderSeriesLabel: function(paper, groupPositions, groupLabels, labelTheme) { + var attributes = { + 'font-size': labelTheme.fontSize, + 'font-family': labelTheme.fontFamily, + 'font-weight': labelTheme.fontWeight, + fill: labelTheme.color, + 'text-anchor': 'middle', + opacity: 0 + }; + var set = paper.set(); + + snippet.forEach(groupLabels, function(categoryLabel, categoryIndex) { + snippet.forEach(categoryLabel, function(label, seriesIndex) { + var position = groupPositions[categoryIndex][seriesIndex]; + var endLabel = raphaelRenderUtil.renderText(paper, position.end, label.end, attributes); + var startLabel; + + set.push(endLabel); + + endLabel.node.style.userSelect = 'none'; + endLabel.node.style.cursor = 'default'; + endLabel.node.setAttribute('filter', 'url(#glow)'); + + if (position.start) { + startLabel = raphaelRenderUtil.renderText(paper, position.start, label.start, attributes); + + startLabel.node.style.userSelect = 'none'; + startLabel.node.style.cursor = 'default'; + startLabel.node.setAttribute('filter', 'url(#glow)'); + + set.push(startLabel); + } + }); + }); + + return set; + }, + + /** + * Test areaOpacity is a number, and return the result. + * It is used to determine whether to set a default value, 0.5. + * If it is not a number, areaOpacity will be changed to the default value, 0.5. + * @param {*} areaOpacity - value of property `options.areaOpacity` + * @returns {boolean} - whether areaOpacity is a number. + * @private + */ + _isAreaOpacityNumber: function(areaOpacity) { + var isNumber = snippet.isNumber(areaOpacity); + + if (isNumber) { + if (areaOpacity < 0 || areaOpacity > 1) { + consoleUtil.print(GUIDE_AREACHART_AREAOPACITY_TYPE, 'warn'); + } + } else if (!snippet.isUndefined(areaOpacity)) { + consoleUtil.print(GUIDE_AREACHART_AREAOPACITY_TYPE, 'error'); + } + + return isNumber; + } + }); + + module.exports = RaphaelAreaChart; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports) { + + /** + * @fileoverview util for console + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + module.exports = { + /** + * check if window.console exists + * @param {string} message - message + * @param {string} status - print function of window.console + */ + print: function(message, status) { + status = status || 'log'; + + if (window.console) { + window.console[status](message); + } + } + }; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview RaphaelPieCharts is graph renderer for pie chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var raphaelRenderUtil = __webpack_require__(5); + var snippet = __webpack_require__(6); + var raphael = __webpack_require__(3); + + var DEGREE_180 = 180; + var DEGREE_360 = 360; + var MIN_DEGREE = 0.01; + var RAD = Math.PI / DEGREE_180; + var LOADING_ANIMATION_DURATION = 700; + var EMPHASIS_OPACITY = 1; + var OVERLAY_OPACITY = 0.3; + var DE_EMPHASIS_OPACITY = 0.3; + var DEFAULT_LUMINANT_VALUE = 0.2; + var OVERLAY_ID = 'overlay'; + var TOOLTIP_OFFSET_VALUE = 20; + + /** + * @classdesc RaphaelPieCharts is graph renderer for pie chart. + * @class RaphaelPieChart + * @private + */ + var RaphaelPieChart = snippet.defineClass(/** @lends RaphaelPieChart.prototype */ { + /** + * Render function of pie chart. + * @param {object} paper Raphael paper + * @param {{ + * sectorData: Array., + * circleBound: {cx: number, cy: number, r: number}, + * dimension: object, theme: object, options: object + * }} data render data + * @param {object} callbacks callbacks + * @param {function} callbacks.showTooltip show tooltip function + * @param {function} callbacks.hideTooltip hide tooltip function + * @returns {object} paper raphael paper + */ + render: function(paper, data, callbacks) { + var pieSeriesSet = paper.set(); + + /** + * raphael object + * @type {object} + */ + this.paper = paper; + + /** + * ratio for hole + * @type {number} + */ + this.holeRatio = data.options.radiusRange[0]; + + /** + * base background + * @type {string} + */ + this.chartBackground = data.chartBackground; + + /** + * type of chart + * @type {string} + */ + this.chartType = data.chartType; + + /** + * functions for tooltip control + * @type {{showTooltip: Function, hideTooltip: Function}} + */ + this.callbacks = callbacks; + + /** + * color for selection + * @type {string} + */ + this.selectionColor = data.theme.selectionColor; + + /** + * bound for circle + * @type {{cx: number, cy: number, r: number}} + */ + this.circleBound = data.circleBound; + + /** + * sector attr's name for draw graph + * @type {string} + */ + this.sectorName = 'sector_' + this.chartType; + + this._setSectorAttr(); + + this.sectorInfos = this._renderPie(data.sectorData, data.theme.colors, data.additionalIndex, pieSeriesSet); + this.overlay = this._renderOverlay(); + + /** + * previous mouse position + * @type {{left: number, top: number}} + */ + this.prevPosition = null; + + /** + * previous hover sector + * @type {object} + */ + this.prevHoverSector = null; + + return pieSeriesSet; + }, + + /** + * Clear paper. + */ + clear: function() { + this.legendLines = null; + this.paper.clear(); + }, + + /** + * Make sector path. + * @param {number} cx center x + * @param {number} cy center y + * @param {number} r radius + * @param {number} startAngle start angle + * @param {number} endAngle end angel + * @returns {{path: Array}} sector path + * @private + */ + _makeSectorPath: function(cx, cy, r, startAngle, endAngle) { + var startRadian = startAngle * RAD; + var endRadian = endAngle * RAD; + var x1 = cx + (r * Math.sin(startRadian)); // x point of start radian + var y1 = cy - (r * Math.cos(startRadian)); // y posint of start radian + var x2 = cx + (r * Math.sin(endRadian)); // x point of end radian + var y2 = cy - (r * Math.cos(endRadian)); // y point of end radian + var largeArcFlag = endAngle - startAngle > DEGREE_180 ? 1 : 0; + var path = ['M', cx, cy, + 'L', x1, y1, + 'A', r, r, 0, largeArcFlag, 1, x2, y2, + 'Z']; + + // see details about path + // http://www.w3schools.com/svg/svg_path.asp + // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/d + return {path: path}; + }, + + /** + * Make sector path for donut chart. + * @param {number} cx - center x + * @param {number} cy - center y + * @param {number} r - radius + * @param {number} startAngle - start angle + * @param {number} endAngle - end angel + * @param {number} [holeRadius] - hole radius + * @returns {{path: Array}} sector path + * @private + */ + _makeDonutSectorPath: function(cx, cy, r, startAngle, endAngle, holeRadius) { + /* eslint max-params: [2, 6]*/ + var startRadian = startAngle * RAD; + var endRadian = endAngle * RAD; + var r2 = holeRadius || (r * this.holeRatio); // radius of donut hole + var x1 = cx + (r * Math.sin(startRadian)); + var y1 = cy - (r * Math.cos(startRadian)); + var x2 = cx + (r2 * Math.sin(startRadian)); + var y2 = cy - (r2 * Math.cos(startRadian)); + var x3 = cx + (r * Math.sin(endRadian)); + var y3 = cy - (r * Math.cos(endRadian)); + var x4 = cx + (r2 * Math.sin(endRadian)); + var y4 = cy - (r2 * Math.cos(endRadian)); + var largeArcFlag = endAngle - startAngle > DEGREE_180 ? 1 : 0; + var path = [ + 'M', x1, y1, + 'A', r, r, 0, largeArcFlag, 1, x3, y3, + 'L', x4, y4, + 'A', r2, r2, 0, largeArcFlag, 0, x2, y2, + 'Z' + ]; + + return {path: path}; + }, + + /** + * Set sector attribute for raphael paper. + * @private + */ + _setSectorAttr: function() { + var makeSectorPath; + + if (this.paper.customAttributes[this.sectorName]) { + return; + } + + if (this.holeRatio) { + makeSectorPath = this._makeDonutSectorPath; + } else { + makeSectorPath = this._makeSectorPath; + } + + this.paper.customAttributes[this.sectorName] = snippet.bind(makeSectorPath, this); + }, + + /** + * Render overlay. + * @returns {object} raphael object + * @private + */ + _renderOverlay: function() { + var params = { + paper: this.paper, + circleBound: { + cx: 0, + cy: 0, + r: 0 + }, + angles: { + startAngle: 0, + endAngle: 0 + }, + attrs: { + fill: 'none', + opacity: 0, + stroke: this.chartBackground.color, + 'stroke-width': 1 + } + }; + var inner = this._renderSector(params); + + inner.data('id', OVERLAY_ID); + inner.data('chartType', this.chartType); + + return { + inner: inner, + outer: this._renderSector(params) + }; + }, + + /** + * Render sector + * @param {object} params parameters + * @param {object} params.paper raphael paper + * @param {{cx: number, cy: number, r:number}} params.circleBound circle bounds + * @param {number} params.startAngle start angle + * @param {number} params.endAngle end angle + * @param {{object}} params.attrs attributes + * @returns {object} raphael object + * @private + */ + _renderSector: function(params) { + var circleBound = params.circleBound; + var angles = params.angles; + var attrs = params.attrs; + + attrs[this.sectorName] = [circleBound.cx, circleBound.cy, circleBound.r, angles.startAngle, angles.endAngle]; + + return params.paper.path().attr(attrs); + }, + + /** + * Render pie graph. + * @param {Array.} sectorData - sectorData + * @param {Array.} colors - sector colors + * @param {number} additionalIndex - additional index for accumulate past pie series's data indexes on pieDonutCombo + * @param {Array.} pieSeriesSet - pie series set + * @returns {Array.} + * @private + */ + _renderPie: function(sectorData, colors, additionalIndex, pieSeriesSet) { + var self = this; + var circleBound = this.circleBound; + var chartBackground = this.chartBackground; + var sectorInfos = []; + + snippet.forEachArray(sectorData, function(sectorDatum, index) { + var ratio = sectorDatum.ratio; + var color = colors[index]; + var sector = self._renderSector({ + paper: self.paper, + circleBound: circleBound, + angles: sectorDatum.angles.start, + attrs: { + fill: chartBackground.color, + stroke: chartBackground.color, + 'stroke-width': 1 + } + }); + sector.data('index', index); + sector.data('legendIndex', index + additionalIndex); + sector.data('chartType', self.chartType); + + sectorInfos.push({ + sector: sector, + color: color, + angles: sectorDatum.angles.end, + ratio: ratio + }); + + pieSeriesSet.push(sector); + }); + + return sectorInfos; + }, + + /** + * Render legend lines. + * @param {Array.} outerPositions outer position + */ + renderLegendLines: function(outerPositions) { + var paper = this.paper, + paths; + + if (!this.legendLines) { + paths = this._makeLinePaths(outerPositions); + this.legendLines = snippet.map(paths, function(path) { + return raphaelRenderUtil.renderLine(paper, path, 'transparent', 1); + }); + } + }, + + /** + * Make line paths. + * @param {Array.} outerPositions outer positions + * @returns {Array} line paths. + * @private + */ + _makeLinePaths: function(outerPositions) { + return snippet.map(outerPositions, function(positions) { + return [ + raphaelRenderUtil.makeLinePath(positions.start, positions.middle), + raphaelRenderUtil.makeLinePath(positions.middle, positions.end), + 'Z' + ].join(''); + }); + }, + + /** + * Show overlay. + * @param {number} index - index + * @param {number} legendIndex - legend index + * @private + */ + _showOverlay: function(index, legendIndex) { + var overlay = this.overlay; + var sectorInfo = this.sectorInfos[index]; + var sa = sectorInfo.angles.startAngle; + var ea = sectorInfo.angles.endAngle; + var cb = this.circleBound; + var innerAttrs; + + innerAttrs = { + fill: '#fff', + opacity: OVERLAY_OPACITY + }; + innerAttrs[this.sectorName] = [cb.cx, cb.cy, cb.r, sa, ea, cb.r * this.holeRatio]; + overlay.inner.attr(innerAttrs); + overlay.inner.data('index', index); + overlay.inner.data('legendIndex', legendIndex); + overlay.outer.attr({ + path: this._makeDonutSectorPath(cb.cx, cb.cy, cb.r + 10, sa, ea, cb.r).path, + fill: sectorInfo.color, + opacity: OVERLAY_OPACITY + }); + }, + + /** + * Hide overlay. + * @private + */ + _hideOverlay: function() { + var overlay = this.overlay; + var attrs = { + fill: 'none', + opacity: 0 + }; + + overlay.inner.attr(attrs); + overlay.outer.attr(attrs); + }, + + /** + * Animate. + * @param {function} callback callback + */ + animate: function(callback) { + var delayTime = 0; + var sectorName = this.sectorName; + var circleBound = this.circleBound; + var sectorArgs = [circleBound.cx, circleBound.cy, circleBound.r]; + + snippet.forEachArray(this.sectorInfos, function(sectorInfo) { + var angles = sectorInfo.angles; + var attrMap = { + fill: sectorInfo.color + }; + var animationTime = LOADING_ANIMATION_DURATION * sectorInfo.ratio; + var anim; + + if ((angles.startAngle === 0) && (angles.endAngle === DEGREE_360)) { + angles.endAngle = DEGREE_360 - MIN_DEGREE; + } + + attrMap[sectorName] = sectorArgs.concat([angles.startAngle, angles.endAngle]); + anim = raphael.animation(attrMap, animationTime, '>'); + sectorInfo.sector.animate(anim.delay(delayTime)); + delayTime += animationTime; + }); + + if (callback) { + setTimeout(callback, delayTime); + } + }, + + /** + * Animate legend lines. + * @param {?number} legendIndex legend index + */ + animateLegendLines: function(legendIndex) { + var isNull; + + if (!this.legendLines) { + return; + } + + isNull = snippet.isNull(legendIndex); + + snippet.forEachArray(this.legendLines, function(line, index) { + var opacity = (isNull || legendIndex === index) ? EMPHASIS_OPACITY : DE_EMPHASIS_OPACITY; + + line.animate({ + 'stroke': 'black', + 'stroke-opacity': opacity + }); + }); + }, + + /** + * Resize graph of pie chart. + * @param {object} params parameters + * @param {{width: number, height:number}} params.dimension dimension + * @param {{cx:number, cy:number, r: number}} params.circleBound circle bound + */ + resize: function(params) { + var dimension = params.dimension; + var circleBound = params.circleBound; + var sectorName = this.sectorName; + var labelSet = this.labelSet; + + this.circleBound = circleBound; + this.paper.setSize(dimension.width, dimension.height); + + snippet.forEachArray(this.sectorInfos, function(sectorInfo, index) { + var angles = sectorInfo.angles; + var attrs = {}; + var bBox; + + attrs[sectorName] = [circleBound.cx, circleBound.cy, circleBound.r, angles.startAngle, angles.endAngle]; + sectorInfo.sector.attr(attrs); + + if (labelSet && labelSet.length) { + bBox = sectorInfo.sector.getBBox(); + + labelSet[index].attr({ + x: bBox.x + (bBox.width / 2), + y: bBox.y + (bBox.height / 2) + }); + } + }); + }, + + /** + * Move legend lines. + * @param {Array.} outerPositions outer positions + */ + moveLegendLines: function(outerPositions) { + var paths; + + if (!this.legendLines) { + return; + } + + paths = this._makeLinePaths(outerPositions); + snippet.forEachArray(this.legendLines, function(line, index) { + line.attr({path: paths[index]}); + + return line; + }); + }, + + findSectorInfo: function(position) { + var sector = this.paper && this.paper.getElementByPoint(position.left, position.top); + var info = null; + + if (sector) { + info = { + legendIndex: snippet.isExisty(sector.data('legendIndex')) ? sector.data('legendIndex') : -1, + index: snippet.isExisty(sector.data('index')) ? sector.data('index') : -1, + chartType: sector.data('chartType') + }; + } + + return info; + }, + + /** + * Whether changed or not. + * @param {{left: number, top: number}} prevPosition previous position + * @param {{left: number, top: number}} position position + * @returns {boolean} result boolean + * @private + */ + _isChangedPosition: function(prevPosition, position) { + return !prevPosition || prevPosition.left !== position.left || prevPosition.top !== position.top; + }, + + /** + * Show tooltip. + * @param {object} sector - raphael object + * @param {{left: number, top: number}} position - mouse position + * @private + */ + _showTooltip: function(sector, position) { + var args = [{}, 0, sector.data('index'), { + left: position.left - TOOLTIP_OFFSET_VALUE, + top: position.top - TOOLTIP_OFFSET_VALUE + }]; + + this.callbacks.showTooltip.apply(null, args); + }, + + /** + * Whether valid sector or not. + * @param {object} sector - raphael object + * @returns {boolean} + * @private + */ + _isValidSector: function(sector) { + return sector && sector.data('chartType') === this.chartType; + }, + + /** + * Move mouse on series. + * @param {{left: number, top: number}} position mouse position + */ + moveMouseOnSeries: function(position) { + var sector = this.paper && this.paper.getElementByPoint(position.left, position.top); + + if (this._isValidSector(sector)) { + if (this.prevHoverSector !== sector) { + this._showOverlay(sector.data('index'), sector.data('legendIndex')); + this.prevHoverSector = sector; + } + + if (this._isChangedPosition(this.prevPosition, position)) { + this._showTooltip(sector, position); + } + } else if (this.prevHoverSector) { + this._hideOverlay(); + this.callbacks.hideTooltip(); + this.prevHoverSector = null; + } + + this.prevPosition = position; + }, + + /** + * Select series. + * @param {{index: number}} indexes - index map + */ + selectSeries: function(indexes) { + var sectorInfo = this.sectorInfos[indexes.index]; + var luminanceColor, objColor, color; + + if (!sectorInfo) { + return; + } + + objColor = raphael.color(sectorInfo.color); + luminanceColor = raphaelRenderUtil.makeChangedLuminanceColor(objColor.hex, DEFAULT_LUMINANT_VALUE); + + color = this.selectionColor || luminanceColor; + + sectorInfo.sector.attr({ + fill: color + }); + }, + + /** + * Unelect series. + * @param {{index: number}} indexes - index map + */ + unselectSeries: function(indexes) { + var sectorInfo = this.sectorInfos[indexes.index]; + + if (!sectorInfo) { + return; + } + + sectorInfo.sector.attr({ + fill: sectorInfo.color + }); + }, + + /** + * Select legend. + * @param {?number} legendIndex legend index + */ + selectLegend: function(legendIndex) { + var isNull = snippet.isNull(legendIndex); + var legendLines = this.legendLines; + + snippet.forEachArray(this.sectorInfos, function(sectorInfo, index) { + var opacity = (isNull || legendIndex === index) ? EMPHASIS_OPACITY : DE_EMPHASIS_OPACITY; + + sectorInfo.sector.attr({ + 'fill-opacity': opacity + }); + + if (legendLines) { + legendLines[index].attr({ + 'stroke-opacity': opacity + }); + } + }); + }, + /** + * Get rendered label width + * @param {string} text - text content + * @param {object} theme - label theme + * @returns {number} + */ + getRenderedLabelWidth: function(text, theme) { + return raphaelRenderUtil.getRenderedTextSize(text, theme.fontSize, theme.fontFamily).width; + }, + + /** + * Get rendered label height + * @param {string} text - text content + * @param {object} theme - label theme + * @returns {number} + */ + getRenderedLabelHeight: function(text, theme) { + return raphaelRenderUtil.getRenderedTextSize(text, theme.fontSize, theme.fontFamily).height; + }, + + /** + * Render labels and return label set + * @param {object} paper Raphael paper + * @param {object} positions position left, top + * @param {Array.} labels series labels + * @param {object} theme label theme + * @returns {Array.} + */ + renderLabels: function(paper, positions, labels, theme) { + var labelSet = paper.set(); + var attributes = { + 'font-size': theme.fontSize, + 'font-family': theme.fontFamily, + 'font-weight': theme.fontWeight, + 'text-anchor': 'middle', + fill: theme.color, + opacity: 0 + }; + + snippet.forEach(positions, function(position, index) { + var label; + + if (position) { + label = raphaelRenderUtil.renderText(paper, position, labels[index], attributes); + + label.node.style.userSelect = 'none'; + label.node.style.cursor = 'default'; + label.node.setAttribute('filter', 'url(#glow)'); + } + labelSet.push(label); + }); + + this.labelSet = labelSet; + + return labelSet; + } + }); + + module.exports = RaphaelPieChart; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Raphael radial line series renderer. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var RaphaelLineTypeBase = __webpack_require__(15); + var raphaelRenderUtil = __webpack_require__(5); + var snippet = __webpack_require__(6); + + var EMPHASIS_OPACITY = 1; + var DE_EMPHASIS_OPACITY = 0.3; + + var RaphaelRadialLineSeries = snippet.defineClass(RaphaelLineTypeBase, /** @lends RaphaelRadialLineSeries.prototype */{ + /** + * RaphaelLineCharts is graph renderer for line chart. + * @constructs RaphaelRadialLineSeries + * @extends RaphaelLineTypeBase + */ + init: function() { + /** + * selected legend index + * @type {?number} + */ + this.selectedLegendIndex = null; + + /** + * type of chart + * @type {string} + */ + this.chartType = 'radial'; + + /** + * Line width + * @type {number} + */ + this.lineWidth = 2; + }, + + /** + * Render function of line chart. + * @param {object} paper - raphael paper + * @param {{groupPositions: Array., dimension: object, theme: object, options: object}} data render data + * @returns {object} paper raphael paper + */ + render: function(paper, data) { + var dimension = data.dimension; + var groupPositions = data.groupPositions; + var theme = data.theme; + var colors = theme.colors; + var dotOpacity = data.options.showDot ? 1 : 0; + var isShowArea = data.options.showArea; + + var groupPaths = this._getLinesPath(groupPositions); + var borderStyle = this.makeBorderStyle(theme.borderColor, dotOpacity); + var outDotStyle = this.makeOutDotStyle(dotOpacity, borderStyle); + var radialSeriesSet = paper.set(); + var lineWidth = this.lineWidth = (data.options.pointWidth ? data.options.pointWidth : this.lineWidth); + + this.paper = paper; + this.theme = data.theme; + this.dimension = dimension; + this.position = data.position; + + if (isShowArea) { + this.groupAreas = this._renderArea(paper, groupPaths, colors, radialSeriesSet); + } + + this.groupLines = this._renderLines(paper, groupPaths, colors, lineWidth, radialSeriesSet); + this.groupDots = this._renderDots(paper, groupPositions, colors, dotOpacity, radialSeriesSet); + + if (data.options.allowSelect) { + this.selectionDot = this._makeSelectionDot(paper); + this.selectionColor = theme.selectionColor; + } + + this.colors = colors; + this.borderStyle = borderStyle; + this.outDotStyle = outDotStyle; + this.groupPositions = groupPositions; + this.groupPaths = groupPaths; + this.dotOpacity = dotOpacity; + + return radialSeriesSet; + }, + + /** + * Get lines path. + * @param {Array.>} groupPositions positions + * @returns {Array.>} path + * @private + */ + _getLinesPath: function(groupPositions) { + var self = this; + + return snippet.map(groupPositions, function(positions) { + return self._makeLinesPath(positions); + }); + }, + + /** + * Render lines. + * @param {object} paper raphael paper + * @param {Array.>} groupPaths paths + * @param {string[]} colors line colors + * @param {?number} strokeWidth stroke width + * @param {Array.} radialSeriesSet radial line series set + * @returns {Array.>} lines + * @private + */ + _renderLines: function(paper, groupPaths, colors, strokeWidth, radialSeriesSet) { + return snippet.map(groupPaths, function(path, groupIndex) { + var color = colors[groupIndex] || 'transparent'; + var line = raphaelRenderUtil.renderLine(paper, path.join(' '), color, strokeWidth); + + radialSeriesSet.push(line); + + return line; + }); + }, + + /** + * Render area. + * @param {object} paper raphael paper + * @param {Array.>} groupPaths paths + * @param {string[]} colors line colors + * @param {Array.} radialSeriesSet radial line series set + * @returns {Array.>} lines + * @private + */ + _renderArea: function(paper, groupPaths, colors, radialSeriesSet) { + return snippet.map(groupPaths, function(path, groupIndex) { + var color = colors[groupIndex] || 'transparent'; + var area = raphaelRenderUtil.renderArea(paper, path, { + fill: color, + opacity: 0.4, + 'stroke-width': 0, + stroke: color + }); + + radialSeriesSet.push(area); + + return area; + }); + }, + + /** + * Resize graph of line chart. + * /todo copied at raphaelLineCharts#resize, should remove duplication + * tooltipLine code was deleted, as group tooltip not works on radial chart/ + * @param {object} params parameters + * @param {{width: number, height:number}} params.dimension dimension + * @param {Array.>} params.groupPositions group positions + */ + resize: function(params) { + var self = this, + dimension = params.dimension, + groupPositions = params.groupPositions; + + this.groupPositions = groupPositions; + this.groupPaths = this._getLinesPath(groupPositions); + this.paper.setSize(dimension.width, dimension.height); + + snippet.forEachArray(this.groupPaths, function(path, groupIndex) { + self.groupLines[groupIndex].attr({path: path.join(' ')}); + self.groupAreas[groupIndex].attr({path: path.join(' ')}); + + snippet.forEachArray(self.groupDots[groupIndex], function(item, index) { + self._moveDot(item.endDot.dot, groupPositions[groupIndex][index]); + }); + }); + }, + + /** + * Select legend. + * /todo copied at raphaelLineCharts, should remove duplication + * @param {?number} legendIndex legend index + */ + selectLegend: function(legendIndex) { + var self = this, + noneSelected = snippet.isNull(legendIndex); + + this.selectedLegendIndex = legendIndex; + + snippet.forEachArray(this.groupLines, function(line, groupIndex) { + var opacity = (noneSelected || legendIndex === groupIndex) ? EMPHASIS_OPACITY : DE_EMPHASIS_OPACITY; + + line.attr({'stroke-opacity': opacity}); + + snippet.forEachArray(self.groupDots[groupIndex], function(item) { + item.opacity = opacity; + + if (self.dotOpacity) { + item.endDot.dot.attr({'fill-opacity': opacity}); + } + }); + }); + } + }); + + module.exports = RaphaelRadialLineSeries; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Raphael bubble chart renderer. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var raphaelRenderUtil = __webpack_require__(5); + var snippet = __webpack_require__(6); + var raphael = __webpack_require__(3); + + var ANIMATION_DURATION = 700; + var CIRCLE_OPACITY = 0.5; + var STROKE_OPACITY = 0.3; + var EMPHASIS_OPACITY = 0.5; + var DE_EMPHASIS_OPACITY = 0.3; + var DEFAULT_LUMINANC = 0.2; + var OVERLAY_BORDER_WIDTH = 2; + var TOOLTIP_OFFSET_VALUE = 20; + + /** + * bound for circle + * @typedef {{left: number, top: number, radius: number}} bound + * @private + */ + + /** + * Information for rendered circle + * @typedef {{circle: object, color: string, bound: bound}} circleInfo + * @private + */ + + /** + * @classdesc RaphaelBubbleChart is graph renderer for bubble chart. + * @class RaphaelBubbleChart + * @private + */ + var RaphaelBubbleChart = snippet.defineClass(/** @lends RaphaelBubbleChart.prototype */ { + /** + * Render function of bubble chart + * @param {object} paper - Raphael paper + * @param {{ + * dimension: {width: number, height: number}, + * seriesDataModel: SeriesDataModel, + * groupBounds: Array.>, + * theme: object + * }} data - data for rendering + * @param {{showTooltip: function, hideTooltip: function}} callbacks - callbacks for toggle of tooltip. + * @returns {object} + */ + render: function(paper, data, callbacks) { + var circleSet = paper.set(); + + this.paper = paper; + + /** + * theme + * @type {object} + */ + this.theme = data.theme; + + /** + * seriesDataModel + * @type {SeriesDataModel} + */ + this.seriesDataModel = data.seriesDataModel; + + /** + * group bounds + * @type {Array.>} + */ + this.groupBounds = data.groupBounds; + + /** + * callbacks for toggle of tooltip. + * @type {{showTooltip: Function, hideTooltip: Function}} + */ + this.callbacks = callbacks; + + /** + * overlay is circle object of raphael, that using for mouseover. + * @type {object} + */ + this.overlay = this._renderOverlay(); + + /** + * two-dimensional array by circleInfo + * @type {Array.>} + */ + this.groupCircleInfos = this._renderCircles(circleSet); + + /** + * previous selected circle + * @type {?object} + */ + this.prevCircle = null; + + /** + * previous over circle + * @type {?object} + */ + this.prevOverCircle = null; + + /** + * animation timeout id + * @type {?number} + */ + this.animationTimeoutId = null; + + return circleSet; + }, + + /** + * Render overlay. + * @returns {object} + * @private + */ + _renderOverlay: function() { + var position = { + left: 0, + top: 0 + }; + var attribute = { + fill: 'none', + stroke: '#fff', + 'stroke-opacity': STROKE_OPACITY, + 'stroke-width': 2 + }; + var circle = raphaelRenderUtil.renderCircle(this.paper, position, 0, attribute); + + return circle; + }, + + /** + * Render circles. + * @param {object} circleSet - circle set + * @returns {Array.>} + * @private + */ + _renderCircles: function(circleSet) { + var self = this; + var colors = this.theme.colors; + + return snippet.map(this.groupBounds, function(bounds, groupIndex) { + return snippet.map(bounds, function(bound, index) { + var circleInfo = null; + var color, circle; + + if (bound) { + color = colors[index]; + circle = raphaelRenderUtil.renderCircle(self.paper, bound, 0, { + fill: color, + opacity: 0, + stroke: 'none' + }); + + circleSet.push(circle); + + circle.data('groupIndex', groupIndex); + circle.data('index', index); + + circleInfo = { + circle: circle, + color: color, + bound: bound + }; + } + + return circleInfo; + }); + }); + }, + + /** + * Animate circle + * @param {object} circle - raphael object + * @param {number} radius - radius of circle + * @private + */ + _animateCircle: function(circle, radius) { + circle.animate({ + r: radius, + opacity: CIRCLE_OPACITY + }, ANIMATION_DURATION, '>'); + }, + + /** + * Animate. + */ + animate: function() { + var self = this; + + raphaelRenderUtil.forEach2dArray(this.groupCircleInfos, function(circleInfo) { + if (!circleInfo) { + return; + } + self._animateCircle(circleInfo.circle, circleInfo.bound.radius); + }); + }, + + /** + * Update circle bound + * @param {object} circle - raphael object + * @param {{left: number, top: number}} bound - bound + * @private + */ + _updatePosition: function(circle, bound) { + circle.attr({ + cx: bound.left, + cy: bound.top, + r: bound.radius + }); + }, + + /** + * Resize graph of bubble type chart. + * @param {object} params parameters + * @param {{width: number, height:number}} params.dimension - dimension + * @param {Array.>} params.groupBounds - group bounds + */ + resize: function(params) { + var self = this; + var dimension = params.dimension; + var groupBounds = params.groupBounds; + + this.groupBounds = groupBounds; + this.paper.setSize(dimension.width, dimension.height); + + raphaelRenderUtil.forEach2dArray(this.groupCircleInfos, function(circleInfo, groupIndex, index) { + var bound = groupBounds[groupIndex][index]; + if (circleInfo) { + circleInfo.bound = bound; + self._updatePosition(circleInfo.circle, bound); + } + }); + }, + + /** + * Find data indexes of rendered circle by position. + * @param {{left: number, top: number}} position - mouse position + * @returns {{index: number, groupIndex: number}} + */ + findIndexes: function(position) { + var circle = this.paper.getElementByPoint(position.left, position.top); + var foundIndexes = null; + + if (circle) { + foundIndexes = { + index: circle.data('index'), + groupIndex: circle.data('groupIndex') + }; + } + + return foundIndexes; + }, + + /** + * Whether changed or not. + * @param {{left: number, top: number}} prevPosition - previous position + * @param {{left: number, top: number}} position - position + * @returns {boolean} result boolean + * @private + */ + _isChangedPosition: function(prevPosition, position) { + return !prevPosition || prevPosition.left !== position.left || prevPosition.top !== position.top; + }, + + /** + * Show overlay with animation. + * @param {object} indexes - indexes + * @param {number} indexes.groupIndex - index of circles group + * @param {number} indexes.index - index of circles + */ + showAnimation: function(indexes) { + var circleInfo = this.groupCircleInfos[indexes.groupIndex][indexes.index]; + var bound = circleInfo.bound; + + this.overlay.attr({ + cx: bound.left, + cy: bound.top, + r: bound.radius + OVERLAY_BORDER_WIDTH, + stroke: circleInfo.color, + opacity: 1 + }); + }, + + /** + * Hide overlay with animation. + * @private + */ + hideAnimation: function() { + this.overlay.attr({ + cx: 0, + cy: 0, + r: 0, + opacity: 0 + }); + }, + + /** + * Find circle. + * @param {{left: number, top: number}} position - position + * @returns {?object} + * @private + */ + _findCircle: function(position) { + var circles = []; + var paper = this.paper; + var foundCircle, circle; + + while (snippet.isUndefined(foundCircle)) { + circle = paper.getElementByPoint(position.left, position.top); + + if (circle) { + if (circle.attrs.opacity > DE_EMPHASIS_OPACITY) { + foundCircle = circle; + } else { + circles.push(circle); + circle.hide(); + } + } else { + foundCircle = null; + } + } + + if (!foundCircle) { + foundCircle = circles[0]; + } + + snippet.forEachArray(circles, function(_circle) { + _circle.show(); + }); + + return foundCircle; + }, + + /** + * Move mouse on series. + * @param {{left: number, top: number}} position - mouse position + */ + moveMouseOnSeries: function(position) { + var circle = this._findCircle(position); + var groupIndex, index, args; + + if (circle && snippet.isExisty(circle.data('groupIndex'))) { + groupIndex = circle.data('groupIndex'); + index = circle.data('index'); + args = [{}, groupIndex, index, { + left: position.left - TOOLTIP_OFFSET_VALUE, + top: position.top - TOOLTIP_OFFSET_VALUE + }]; + + if (this._isChangedPosition(this.prevPosition, position)) { + this.callbacks.showTooltip.apply(null, args); + this.prevOverCircle = circle; + } + } else if (this.prevOverCircle) { + this.callbacks.hideTooltip(); + this.prevOverCircle = null; + } + this.prevPosition = position; + }, + + /** + * Select series. + * @param {{index: number, groupIndex: number}} indexes - index map + */ + selectSeries: function(indexes) { + var groupIndex = indexes.groupIndex; + var index = indexes.index; + var circleInfo = this.groupCircleInfos[groupIndex][index]; + var objColor = raphael.color(circleInfo.color); + var themeColor = this.theme.selectionColor; + var color = themeColor || raphaelRenderUtil.makeChangedLuminanceColor(objColor.hex, DEFAULT_LUMINANC); + + circleInfo.circle.attr({ + fill: color + }); + }, + + /** + * Unselect series. + * @param {{index: number, groupIndex: number}} indexes - index map + */ + unselectSeries: function(indexes) { + var groupIndex = indexes.groupIndex; + var index = indexes.index; + var circleInfo = this.groupCircleInfos[groupIndex][index]; + + circleInfo.circle.attr({ + fill: circleInfo.color + }); + }, + + /** + * Select legend. + * @param {?number} legendIndex - index of legend + */ + selectLegend: function(legendIndex) { + var noneSelected = snippet.isNull(legendIndex); + + raphaelRenderUtil.forEach2dArray(this.groupCircleInfos, function(circleInfo, groupIndex, index) { + var opacity; + + if (!circleInfo) { + return; + } + + opacity = (noneSelected || legendIndex === index) ? EMPHASIS_OPACITY : DE_EMPHASIS_OPACITY; + + circleInfo.circle.attr({opacity: opacity}); + }); + } + }); + + module.exports = RaphaelBubbleChart; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview RaphaelBoxTypeChart is graph renderer for box type chart(heatmap chart, treemap chart). + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var raphaelRenderUtil = __webpack_require__(5); + var snippet = __webpack_require__(6); + + var ANIMATION_DURATION = 100; + var MIN_BORDER_WIDTH = 1; + var MAX_BORDER_WIDTH = 3; + + /** + * @classdesc RaphaelBoxTypeChart is graph renderer for box type chart(heatmap chart, treemap chart). + * @class RaphaelBarChart + * @private + */ + var RaphaelBoxTypeChart = snippet.defineClass(/** @lends RaphaelBoxTypeChart.prototype */ { + /** + * Render function of bar chart + * @param {object} paper Raphael paper + * @param {{ + * dimension: {width: number, height: number}, + * colorSpectrum: object, + * seriesDataModel: SeriesDataModel, + * groupBounds: (Array.>|object.), + * theme: object + * }} seriesData - data for graph rendering + * @returns {object} + */ + render: function(paper, seriesData) { + var seriesSet = paper.set(); + + this.paper = paper; + + /** + * theme + * @type {*|{}} + */ + this.theme = seriesData.theme || {}; + + /** + * color spectrum + * @type {Object} + */ + this.colorSpectrum = seriesData.colorSpectrum; + + /** + * + */ + this.chartBackground = seriesData.chartBackground; + + /** + * zoomable option + */ + this.zoomable = seriesData.zoomable; + + /** + * border color for rendering box + * @type {string} + */ + this.borderColor = this.theme.borderColor || 'none'; + + /** + * border width for rendering box + */ + this.borderWidth = this.theme.borderWidth; + + /** + * group bounds + * @type {Array.>|object.} + */ + this.groupBounds = seriesData.groupBounds; + + /** + * bound map + * @type {object.} + */ + this.boundMap = seriesData.boundMap; + + this._bindGetBoundFunction(); + this._bindGetColorFunction(); + + /** + * boxes set + * @type {Array.>} + */ + this.boxesSet = this._renderBoxes(seriesData.seriesDataModel, seriesData.startDepth, !!seriesData.isPivot, + seriesSet); + + return seriesSet; + }, + + /** + * Bind _getBound private function. + * @private + */ + _bindGetBoundFunction: function() { + if (this.boundMap) { + this._getBound = this._getBoundFromBoundMap; + } else { + this._getBound = this._getBoundFromGroupBounds; + } + }, + + /** + * Bind _bindGetColorFunction private function. + * @private + */ + _bindGetColorFunction: function() { + if (this.colorSpectrum) { + this._getColor = this._getColorFromSpectrum; + } else if (this.zoomable) { + this._getColor = this._getColorFromColorsWhenZoomable; + } else { + this._getColor = this._getColorFromColors; + } + }, + + /** + * Get bound from groupBounds by indexes(groupIndex, index) of seriesItem. + * @param {SeriesItem} seriesItem - seriesItem + * @returns {{width: number, height: number, left: number, top: number}} + * @private + */ + _getBoundFromGroupBounds: function(seriesItem) { + return this.groupBounds[seriesItem.groupIndex][seriesItem.index].end; + }, + + /** + * Get bound from boundMap by id of seriesItem. + * @param {SeriesItem} seriesItem - seriesItem + * @returns {{width: number, height: number, left: number, top: number}} + * @private + */ + _getBoundFromBoundMap: function(seriesItem) { + return this.boundMap[seriesItem.id]; + }, + + /** + * Get color from colorSpectrum by ratio of seriesItem. + * @param {SeriesItem} seriesItem - seriesItem + * @returns {string} + * @private + */ + _getColorFromSpectrum: function(seriesItem) { + var color; + + if (!seriesItem.hasChild) { + color = this.colorSpectrum.getColor(seriesItem.colorRatio || seriesItem.ratio) || this.chartBackground; + } else { + color = 'none'; + } + + return color; + }, + + /** + * Get color from colors theme by group property of seriesItem. + * @param {SeriesItem} seriesItem - seriesItem + * @returns {string} + * @private + */ + _getColorFromColors: function(seriesItem) { + return seriesItem.hasChild ? 'none' : this.theme.colors[seriesItem.group]; + }, + + /** + * Get color from colors theme, when zoomable option. + * @param {SeriesItem} seriesItem - seriesItem + * @param {number} startDepth - start depth + * @returns {string} + * @private + */ + _getColorFromColorsWhenZoomable: function(seriesItem, startDepth) { + return (seriesItem.depth === startDepth) ? this.theme.colors[seriesItem.group] : 'none'; + }, + + /** + * Render rect. + * @param {{width: number, height: number, left: number, top: number}} bound - bound + * @param {string} color - color + * @param {number} strokeWidth - stroke width + * @returns {object} + * @private + */ + _renderRect: function(bound, color, strokeWidth) { + return raphaelRenderUtil.renderRect(this.paper, bound, { + fill: color, + stroke: this.borderColor, + 'stroke-width': strokeWidth + }); + }, + + /** + * Get stroke width. + * @param {?number} depth - depth + * @param {number} startDepth - start depth + * @returns {number} + * @private + */ + _getStrokeWidth: function(depth, startDepth) { + var strokeWidth; + + if (this.borderWidth) { + strokeWidth = this.borderWidth; + } else if (snippet.isExisty(depth)) { + strokeWidth = Math.max(MIN_BORDER_WIDTH, MAX_BORDER_WIDTH - (depth - startDepth)); + } else { + strokeWidth = MIN_BORDER_WIDTH; + } + + return strokeWidth; + }, + + /** + * Render boxes. + * @param {SeriesDataModel} seriesDataModel - seriesDataModel + * @param {number} startDepth - start depth + * @param {boolean} isPivot - whether pivot or not + * @param {Array.} seriesSet - seriesSet + * @returns {Array.>} + * @private + */ + _renderBoxes: function(seriesDataModel, startDepth, isPivot, seriesSet) { + var self = this; + var rectToBack; + + if (this.colorSpectrum || !this.zoomable) { + rectToBack = function(rect) { + rect.toBack(); + }; + } else { + rectToBack = function() {}; + } + + return seriesDataModel.map(function(seriesGroup, groupIndex) { + return seriesGroup.map(function(seriesItem, index) { + var result = null; + var strokeWidth = self._getStrokeWidth(seriesItem.depth, startDepth); + var bound, color; + + seriesItem.groupIndex = groupIndex; + seriesItem.index = index; + bound = self._getBound(seriesItem); + + if (bound) { + color = self._getColor(seriesItem, startDepth); + result = { + rect: self._renderRect(bound, color, strokeWidth), + seriesItem: seriesItem, + color: color + }; + rectToBack(result.rect); + + if (seriesSet) { + seriesSet.push(result.rect); + } + } + + return result; + }); + }, isPivot); + }, + + /** + * Animate changing color of box. + * @param {object} rect - raphael object + * @param {string} [color] - fill color + * @param {number} [opacity] - fill opacity + * @private + */ + _animateChangingColor: function(rect, color, opacity) { + var properties = { + 'fill-opacity': snippet.isExisty(opacity) ? opacity : 1 + }; + + if (color) { + properties.fill = color; + } + + rect.animate(properties, ANIMATION_DURATION, '>'); + }, + + /** + * Show animation. + * @param {{groupIndex: number, index:number}} indexes - index info + * @param {boolean} [useSpectrum] - whether use spectrum legend or not + * @param {number} [opacity] - fill opacity + */ + showAnimation: function(indexes, useSpectrum, opacity) { + var box = this.boxesSet[indexes.groupIndex][indexes.index]; + var color; + + if (!box) { + return; + } + + useSpectrum = snippet.isUndefined(useSpectrum) ? true : useSpectrum; + color = useSpectrum ? this.theme.overColor : box.color; + + if (box.seriesItem.hasChild) { + if (useSpectrum) { + box.rect.attr({'fill-opacity': 0}); + } + box.rect.toFront(); + } + + this._animateChangingColor(box.rect, color, opacity); + }, + + /** + * Hide animation. + * @param {{groupIndex: number, index:number}} indexes - index info + * @param {boolean} [useColorValue] - whether use colorValue or not + */ + hideAnimation: function(indexes, useColorValue) { + var colorSpectrum = this.colorSpectrum; + var box = this.boxesSet[indexes.groupIndex][indexes.index]; + var opacity = 1; + var color, paper; + + if (!box) { + return; + } + + paper = box.rect.paper; + + if (box.seriesItem.hasChild) { + color = null; + if (useColorValue) { + opacity = 0; + } + } else { + color = box.color; + } + + this._animateChangingColor(box.rect, color, opacity); + + setTimeout(function() { + if (!colorSpectrum && box.seriesItem.hasChild) { + box.rect.toBack(); + paper.pushDownBackgroundToBottom(); + } + }, ANIMATION_DURATION); + }, + + /** + * Resize. + * @param {{ + * dimension: {width: number, height: number}, + * groupBounds: (Array.>|object.) + * }} seriesData - data for graph rendering + */ + resize: function(seriesData) { + var self = this; + var dimension = seriesData.dimension; + + this.boundMap = seriesData.boundMap; + this.groupBounds = seriesData.groupBounds; + this.paper.setSize(dimension.width, dimension.height); + + raphaelRenderUtil.forEach2dArray(this.boxesSet, function(box, groupIndex, index) { + var bound; + + if (!box) { + return; + } + + bound = self._getBound(box.seriesItem, groupIndex, index); + + if (bound) { + raphaelRenderUtil.updateRectBound(box.rect, bound); + } + }); + }, + + renderSeriesLabel: function(paper, positionSet, labels, labelTheme) { + var labelSet = paper.set(); + var attributes = { + 'font-size': labelTheme.fontSize, + 'font-family': labelTheme.fontFamily, + 'font-weight': labelTheme.fontWeight, + fill: labelTheme.color, + opacity: 0 + }; + + snippet.forEach(labels, function(categoryLabel, categoryIndex) { + snippet.forEach(categoryLabel, function(label, seriesIndex) { + var seriesLabel = raphaelRenderUtil.renderText(paper, positionSet[categoryIndex][seriesIndex].end, + label, attributes); + + seriesLabel.node.style.userSelect = 'none'; + seriesLabel.node.style.cursor = 'default'; + seriesLabel.node.setAttribute('filter', 'url(#glow)'); + + labelSet.push(seriesLabel); + }); + }); + + return labelSet; + }, + + renderSeriesLabelForTreemap: function(paper, positions, labels, labelTheme) { + var labelSet = paper.set(); + var attributes = { + 'font-size': labelTheme.fontSize, + 'font-family': labelTheme.fontFamily, + 'font-weight': labelTheme.fontWeight, + fill: labelTheme.color, + opacity: 0 + }; + + snippet.forEach(labels, function(label, index) { + var seriesLabel = raphaelRenderUtil.renderText(paper, positions[index], label, attributes); + + seriesLabel.node.style.userSelect = 'none'; + seriesLabel.node.style.cursor = 'default'; + seriesLabel.node.setAttribute('filter', 'url(#glow)'); + + labelSet.push(seriesLabel); + }); + + return labelSet; + } + }); + + module.exports = RaphaelBoxTypeChart; + + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview RaphaelPieCharts is graph renderer for map chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var raphaelRenderUtil = __webpack_require__(5); + var dom = __webpack_require__(9); + var snippet = __webpack_require__(6); + var browser = snippet.browser; + + var IS_LTE_IE8 = browser.msie && browser.version <= 8; + var STROKE_COLOR = 'gray'; + var ANIMATION_DURATION = 100; + var G_ID = 'tui-chart-series-group'; + + /** + * @classdesc RaphaelMapCharts is graph renderer for map chart. + * @class RaphaelMapChart + * @private + */ + var RaphaelMapChart = snippet.defineClass(/** @lends RaphaelMapChart.prototype */ { + /** + * Render function of map chart. + * @param {object} paper paper object + * @param {object} data data + * @param {{width: number, height: number}} data.dimension series dimension + * @param {Array.<{code: string, path: string}>} data.map mapData + * @param {ColorSpectrum} data.colorSpectrum color model + */ + render: function(paper, data) { + var mapDimension = data.mapModel.getMapDimension(); + + this.ratio = this._getDimensionRatio(data.layout.dimension, mapDimension); + this.dimension = data.layout.dimension; + this.position = data.layout.position; + this.paper = paper; + this.sectorSet = paper.set(); + this.sectors = this._renderMap(data, this.ratio); + + if (!IS_LTE_IE8) { + this.g = createGElement(paper, this.sectorSet, G_ID); + } + + this.overColor = data.theme.overColor; + }, + + /** + * Get dimension ratio + * @param {object} dimension dimension + * @param {object} mapDimension map dimension + * @returns {number} + * @private + */ + _getDimensionRatio: function(dimension, mapDimension) { + return Math.min(dimension.height / mapDimension.height, dimension.width / mapDimension.width); + }, + + /** + * Render map graph. + * @param {object} data data + * @param {{width: number, height: number}} data.dimension series dimension + * @param {Array.<{code: string, path: string}>} data.map mapData + * @param {ColorSpectrum} data.colorSpectrum color model + * @param {number} dimensionRatio dimension ratio of rendering by map + * @returns {Array.<{sector: object, color: string, data: object}>} rendered map information + * @private + */ + _renderMap: function(data, dimensionRatio) { + var sectorSet = this.sectorSet; + var position = data.layout.position; + var paper = this.paper; + var colorSpectrum = data.colorSpectrum; + + return snippet.map(data.mapModel.getMapData(), function(datum, index) { + var ratio = datum.ratio || 0; + var color = colorSpectrum.getColor(ratio); + var sector = raphaelRenderUtil.renderArea(paper, datum.path, { + fill: color, + opacity: 1, + stroke: STROKE_COLOR, + 'stroke-opacity': 1, + transform: 's' + dimensionRatio + ',' + dimensionRatio + ',0,0' + + 't' + (position.left / dimensionRatio) + ',' + (position.top / dimensionRatio) + }); + + sector.data('index', index); + + sectorSet.push(sector); + + return { + sector: sector, + color: color, + ratio: datum.ratio + }; + }); + }, + + /** + * Find sector index. + * @param {{left: number, top: number}} position position + * @returns {?number} found index + */ + findSectorIndex: function(position) { + var sector = this.paper.getElementByPoint(position.left, position.top), + foundIndex = sector && sector.data('index'), + data = !snippet.isUndefined(foundIndex) && this.sectors[foundIndex]; + + return data && !snippet.isUndefined(data.ratio) ? foundIndex : null; + }, + + /** + * Change color. + * @param {number} index index + */ + changeColor: function(index) { + var sector = this.sectors[index]; + + sector.sector.animate({ + fill: this.overColor + }, ANIMATION_DURATION, '>'); + }, + + /** + * Restore color. + * @param {number} index index + */ + restoreColor: function(index) { + var sector = this.sectors[index]; + + sector.sector.animate({ + fill: sector.color + }, ANIMATION_DURATION, '>'); + }, + + /** + * Scale map sector paths + * @param {number} changedRatio changed ratio of map + * @param {object} position position + * @param {number} mapRatio mapdimension ratio by dimansion + * @param {object} limitPosition limit position + * @param {object} mapDimension map dimension + */ + scaleMapPaths: function(changedRatio, position, mapRatio, limitPosition, mapDimension) { + var transformList = this.g.transform.baseVal; + var zoom = this.paper.canvas.createSVGTransform(); + var matrix = this.paper.canvas.createSVGMatrix(); + var raphaelMatrix = this.paper.raphael.matrix(); + var transformMatrix = transformList.numberOfItems ? transformList.getItem(0).matrix : { + a: 1, + b: 0, + c: 0, + d: 1, + e: 0, + f: 0 + }; + var maxRight = mapDimension.width - this.dimension.width; + var maxTop = mapDimension.height - this.dimension.height; + var previousTranslateX = (transformMatrix.e / transformMatrix.a); + var previousTranslateY = (transformMatrix.f / transformMatrix.d); + var currentLimitRight = -maxRight / transformMatrix.a; + var currentLimitTop = -maxTop / transformMatrix.d; + var transformX, transformY; + + raphaelMatrix.scale(changedRatio, changedRatio, + (position.left * mapRatio) - (previousTranslateX * changedRatio), + (position.top * mapRatio) - (previousTranslateY * changedRatio)); + transformX = (raphaelMatrix.e / raphaelMatrix.a) + previousTranslateX; + transformY = (raphaelMatrix.f / raphaelMatrix.d) + previousTranslateY; + + if (transformX >= 0) { + raphaelMatrix.e = -previousTranslateX * raphaelMatrix.a; + } else if (transformX < currentLimitRight) { + raphaelMatrix.e = currentLimitRight - previousTranslateX; + } + + if (transformY >= 0) { + raphaelMatrix.f = -previousTranslateY * raphaelMatrix.a; + } else if (transformY < currentLimitTop) { + raphaelMatrix.f = currentLimitTop - previousTranslateY; + } + + matrix.a = raphaelMatrix.a; + matrix.b = raphaelMatrix.b; + matrix.c = raphaelMatrix.c; + matrix.d = raphaelMatrix.d; + matrix.e = raphaelMatrix.e; + matrix.f = raphaelMatrix.f; + + zoom.setMatrix(matrix); + transformList.appendItem(zoom); + transformList.initialize(transformList.consolidate()); + }, + + /** + * Scale map sector paths + * @param {object} distances drag distance for moving + * @param {object} mapDimension map dimension + */ + moveMapPaths: function(distances, mapDimension) { + var matrix = this.paper.canvas.createSVGMatrix(); + var raphaelMatrix = this.paper.raphael.matrix(); + var transformList = this.g.transform.baseVal; + var translate = this.paper.canvas.createSVGTransform(); + var maxRight = mapDimension.width - this.dimension.width; + var maxTop = mapDimension.height - this.dimension.height; + var transformMatrix = transformList.numberOfItems ? transformList.getItem(0).matrix : { + a: 1, + b: 0, + c: 0, + d: 1, + e: 0, + f: 0 + }; + var translateX, translateY, currentTranslateX, currentTranslateY; + + raphaelMatrix.translate(distances.x, distances.y); + + currentTranslateX = (raphaelMatrix.e / raphaelMatrix.a); + currentTranslateY = (raphaelMatrix.f / raphaelMatrix.d); + translateX = currentTranslateX + (transformMatrix.e / transformMatrix.a); + translateY = currentTranslateY + (transformMatrix.f / transformMatrix.d); + + if (translateX >= 0 && currentTranslateX > 0) { + raphaelMatrix.e = 0; + } else if (translateX < 0 && translateX < -maxRight / transformMatrix.a && currentTranslateX < 0) { + raphaelMatrix.e = 0; + } + if (translateY >= 0 && currentTranslateY > 0) { + raphaelMatrix.f = 0; + } else if (translateY < 0 && translateY < -maxTop / transformMatrix.d && currentTranslateY < 0) { + raphaelMatrix.f = 0; + } + + matrix.a = raphaelMatrix.a; + matrix.b = raphaelMatrix.b; + matrix.c = raphaelMatrix.c; + matrix.d = raphaelMatrix.d; + matrix.e = raphaelMatrix.e; + matrix.f = raphaelMatrix.f; + + translate.setMatrix(matrix); + transformList.appendItem(translate); + transformList.initialize(transformList.consolidate()); + }, + /** + * Render series labels + * @param {object} paper Raphael paper + * @param {Array.} labelData label data + * @param {object} labelTheme label theme + * @returns {Array.} + */ + renderSeriesLabels: function(paper, labelData, labelTheme) { + var attributes = { + 'font-size': labelTheme.fontSize, + 'font-family': labelTheme.fontFamily, + 'font-weight': labelTheme.fontWeight, + fill: labelTheme.color, + 'text-anchor': 'middle', + opacity: 0, + transform: 's' + this.ratio + ',' + this.ratio + ',0,0' + + 't' + (this.position.left / this.ratio) + ',' + (this.position.top / this.ratio) + }; + var set = paper.set(); + var self = this; + + snippet.forEach(labelData, function(labelDatum) { + var position = labelDatum.labelPosition; + var label = raphaelRenderUtil.renderText(paper, position, labelDatum.name || labelDatum.code, attributes); + + set.push(label); + + label.node.style.userSelect = 'none'; + label.node.style.cursor = 'default'; + label.node.setAttribute('filter', 'url(#glow)'); + + if (!IS_LTE_IE8) { + self.g.appendChild(label.node); + } + }); + + return set; + } + }); + + /** + * Create and append sector set + * @param {object} paper Raphael paper + * @param {Array.} sectorSet sectorSet + * @param {string} id ID string + * @returns {object} + * @ignore + */ + function createGElement(paper, sectorSet, id) { + var g = document.createElementNS('http://www.w3.org/2000/svg', 'g'); + g.id = id; + + sectorSet.forEach(function(sector) { + dom.append(g, sector.node); + }); + + paper.canvas.appendChild(g); + + return g; + } + + module.exports = RaphaelMapChart; + + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Raphael title renderer. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var raphaelRenderUtil = __webpack_require__(5); + var arrayUtil = __webpack_require__(10); + var snippet = __webpack_require__(6); + + var UNSELECTED_LEGEND_LABEL_OPACITY = 0.5; + var RaphaelLegendComponent; + + /** + * Get sum of icon and left padding width + * @returns {number} - icon and left padding width + * @ignore + */ + function getIconWidth() { + return chartConst.LEGEND_ICON_WIDTH + chartConst.LEGEND_LABEL_LEFT_PADDING; + } + + RaphaelLegendComponent = snippet.defineClass(/** @lends RaphaelLegendComponent.prototype */ { + + init: function() { + /** + * @type {number} + * @private + */ + this._checkBoxWidth = 0; + /** + * @type {number} + * @private + */ + this._checkBoxHeight = 0; + /** + * @type {number} + * @private + */ + this._iconHeight = 0; + /** + * @type {number} + * @private + */ + this._legendItemHeight = 0; + /** + * @type {number} + * @private + */ + this._currentPageCount = 1; + /** + * @type {boolean} + * @private + */ + this._showCheckbox = true; + }, + + /** + * @param {Array.} legendData Array of legend item data + * @private + */ + _renderLegendItems: function(legendData) { + var self = this; + var labelPaddingLeft = chartConst.LEGEND_LABEL_LEFT_PADDING; + var position = snippet.extend({}, this.basePosition); + + snippet.forEach(legendData, function(legendDatum, index) { + var iconType = legendDatum.iconType; + var legendIndex = legendDatum.index; + var legendColor = legendDatum.colorByPoint ? '#aaa' : legendDatum.theme.color; + var isUnselected = legendDatum.isUnselected; + var labelHeight = legendDatum.labelHeight; + var checkboxData = legendDatum.checkbox; + var predicatedLegendWidth = position.left + self._calculateSingleLegendWidth(legendIndex, iconType); + var isNeedBreakLine = (predicatedLegendWidth >= self.paper.width); + + if (self.isHorizontal && isNeedBreakLine) { + position.top += (self._legendItemHeight + chartConst.LABEL_PADDING_TOP); + position.left = self.basePosition.left; + } + + if (self._showCheckbox) { + self._renderCheckbox(position, { + isChecked: checkboxData.checked, + legendIndex: legendIndex, + legendSet: self.legendSet + }); + + position.left += (self._checkBoxWidth + labelPaddingLeft); + } + + self._renderIcon(position, { + legendColor: legendColor, + iconType: iconType, + labelHeight: labelHeight, + isUnselected: isUnselected, + legendIndex: legendIndex, + legendSet: self.legendSet + }); + + position.left += chartConst.LEGEND_ICON_WIDTH + labelPaddingLeft; + + self._renderLabel(position, { + labelText: legendDatum.label, + labelHeight: labelHeight, + isUnselected: isUnselected, + legendIndex: legendIndex, + legendSet: self.legendSet + }); + + if (self.isHorizontal) { + position.left += self.labelWidths[index] + labelPaddingLeft; + } else { + position.left = self.basePosition.left; + position.top += self._legendItemHeight + chartConst.LINE_MARGIN_TOP; + } + }); + }, + + /** + * @param {Array.} legendData Array of legend item data + * @param {number} sliceIndex slice index of + * @returns {Array.} + * @private + */ + _getLegendData: function(legendData, sliceIndex) { + var positionTop = this.basePosition.top; + var totalHeight = this.dimension.height; + var chartHeight = this.paper.height; + var resultLegendData = legendData; + var pageHeight, singleItemHeight, visibleItemCount; + + if (!this.isHorizontal && totalHeight + (positionTop * 2) > chartHeight) { + pageHeight = chartHeight - (positionTop * 2); + this._legendItemHeight = Math.max(legendData[0].labelHeight, chartConst.LEGEND_ICON_HEIGHT); + singleItemHeight = (this._legendItemHeight + chartConst.LINE_MARGIN_TOP); + + visibleItemCount = Math.floor(pageHeight / singleItemHeight); + + resultLegendData = legendData.slice((sliceIndex - 1) * visibleItemCount, sliceIndex * visibleItemCount); + } + + return resultLegendData; + }, + + /** + * Render legend + * @param {object} data rendering data + * @param {HTMLElement} data.container legend container + * @param {Array.} data.legendData rendering legendData + * @param {boolean} data.isHorizontal boolean value of horizontal or not + * @param {{height:number, width:number}} data.dimension legend dimension + * @param {object} data.labelTheme legend label theme object + * @param {number} data.labelWidths label widths + * @param {object} data.eventBus event bus + * @returns {object} paper + */ + render: function(data) { + var legendData, legendHeight; + + this.eventBus = data.eventBus; + this.paper = data.paper; + this.dimension = data.dimension; + this.legendSet = this.paper.set(); + this.labelWidths = data.labelWidths; + this.labelTheme = data.labelTheme; + this.basePosition = data.position; + this.isHorizontal = data.isHorizontal; + this.originalLegendData = data.legendData; + + if (this.originalLegendData.length) { + this._showCheckbox = snippet.isExisty(data.legendData[0].checkbox); + this._setComponentDimensionsBaseOnLabelHeight(data.legendData[0].labelHeight); + + legendData = this._getLegendData(data.legendData, this._currentPageCount); + + this._renderLegendItems(legendData); + + if (!this.isHorizontal && legendData && legendData.length < data.legendData.length) { + legendHeight = this.paper.height - (this.basePosition.top * 2); + + this.availablePageCount = Math.ceil(data.dimension.height / legendHeight); + + this._renderPaginationArea(this.basePosition, { + width: data.dimension.width, + height: legendHeight + }); + } + } + + return this.legendSet; + }, + + /** + * @param {string} direction direction string of paginate 'next' or 'previous' + * @private + */ + _paginateLegendAreaTo: function(direction) { + var pageNumber = this._currentPageCount; + + this._removeLegendItems(); + + if (direction === 'next') { + pageNumber += 1; + } else { + pageNumber -= 1; + } + + this._renderLegendItems(this._getLegendData(this.originalLegendData, pageNumber)); + }, + + _removeLegendItems: function() { + this.legendSet.forEach(function(legendItem) { + snippet.forEach(legendItem.events, function(event) { + event.unbind(); + }); + legendItem.remove(); + }); + }, + + /** + * @param {{top: number, left: number}} position legend area position + * @param {{height: number, width: number}} dimension legend area dimension + * @private + */ + _renderPaginationArea: function(position, dimension) { + var self = this; + var BUTTON_WIDTH = chartConst.LEGEND_PAGINATION_BUTTON_WIDTH; + var BUTTON_PADDING_LEFT = chartConst.LEGEND_PAGINATION_BUTTON_PADDING_LEFT; + var controllerPositionTop = position.top + dimension.height - chartConst.CHART_PADDING; + var controllerPositionLeft = position.left - chartConst.CHART_PADDING; + var rightButtonPositionLeft = controllerPositionLeft + dimension.width - BUTTON_WIDTH; + var leftButtonPositionLeft = rightButtonPositionLeft - (BUTTON_PADDING_LEFT + BUTTON_WIDTH); + var lowerArrowPath = ['M', rightButtonPositionLeft, ',', (controllerPositionTop + 3), + 'L', (rightButtonPositionLeft + 5), ',', (controllerPositionTop + 8), + 'L', (rightButtonPositionLeft + 10), ',', (controllerPositionTop + 3)].join(''); + var upperArrowPath = ['M', leftButtonPositionLeft, ',', (controllerPositionTop + 8), + 'L', (leftButtonPositionLeft + 5), ',', (controllerPositionTop + 3), + 'L', (leftButtonPositionLeft + 10), ',', (controllerPositionTop + 8)].join(''); + + this.upperButton = raphaelRenderUtil.renderLine(this.paper, upperArrowPath, '#555', 3); + this.lowerButton = raphaelRenderUtil.renderLine(this.paper, lowerArrowPath, '#555', 3); + + this.upperButton.click(function() { + if (self._currentPageCount > 1) { + self._paginateLegendAreaTo('previous'); + self._currentPageCount -= 1; + } + }); + + this.lowerButton.click(function() { + if (self._currentPageCount < self.availablePageCount) { + self._paginateLegendAreaTo('next'); + self._currentPageCount += 1; + } + }); + }, + + /** + * Make labels width. + * @param {Array.<{chartType: ?string, label: string}>} legendData legend data + * @param {object} theme theme object + * @param {number} maxWidth user option legend max width size + * @returns {Array.} label widths + */ + makeLabelWidths: function(legendData, theme, maxWidth) { + return snippet.map(legendData, function(item) { + var labelWidth = raphaelRenderUtil.getRenderedTextSize(item.label, theme.fontSize, theme.fontFamily).width; + if (maxWidth && labelWidth > maxWidth) { + labelWidth = maxWidth; + } + + return labelWidth + chartConst.LEGEND_LABEL_LEFT_PADDING; + }); + }, + + /** + * Get rendered label height + * @param {string} labelText label text + * @param {object} theme theme object + * @returns {number} + */ + getRenderedLabelHeight: function(labelText, theme) { + return raphaelRenderUtil.getRenderedTextSize(labelText, theme.fontSize, theme.fontFamily).height; + }, + + /** + * Render label text and attach event + * @param {object} position left, top + * @param {object} data rendering data + * @param {string} data.labelText label text + * @param {number} data.labelHeight label height + * @param {boolean} data.isUnselected boolean value for selected or not + * @param {number} data.legendIndex legend index + * @param {Array.} data.legendSet legend set + * @private + */ + _renderLabel: function(position, data) { + var eventBus = this.eventBus; + var labelTheme = this.labelTheme; + var pos = { + left: position.left, + top: position.top + (this._iconHeight / 2) + }; + + var attributes = { + fill: labelTheme.color, + 'font-size': labelTheme.fontSize, + 'font-family': labelTheme.fontFamily, + 'font-weight': labelTheme.fontWeight, + opacity: data.isUnselected ? UNSELECTED_LEGEND_LABEL_OPACITY : 1, + 'text-anchor': 'start' + }; + var label = raphaelRenderUtil.renderText(this.paper, pos, data.labelText, attributes); + + label.data('index', data.legendIndex); + + label.node.style.userSelect = 'none'; + label.node.style.cursor = 'pointer'; + + data.legendSet.push(label); + + label.click(function() { + eventBus.fire('labelClicked', data.legendIndex); + }); + }, + + /** + * Render checkbox + * @param {object} position left, top + * @param {object} data rendering data + */ + _renderCheckbox: function(position, data) { + var self = this; + var checkboxSet; + var left = position.left; + var top = position.top + ((this._legendItemHeight - this._checkBoxHeight) / 2); + var vPathString = 'M' + ((this._checkBoxWidth * 0.3) + left) + ',' + ((this._checkBoxHeight * 0.5) + top) + + 'L' + ((this._checkBoxWidth * 0.5) + left) + ',' + ((this._checkBoxHeight * 0.7) + top) + + 'L' + ((this._checkBoxWidth * 0.8) + left) + ',' + ((this._checkBoxHeight * 0.2) + top); + + checkboxSet = this.paper.set(); + + checkboxSet.push(this.paper.rect(left, top, this._checkBoxWidth, this._checkBoxHeight, 2).attr({ + fill: '#fff' + })); + + if (data.isChecked) { + checkboxSet.push(this.paper.path(vPathString)); + } + + checkboxSet.data('index', data.legendIndex); + checkboxSet.click(function() { + self.eventBus.fire('checkboxClicked', data.legendIndex); + }); + + checkboxSet.forEach(function(checkbox) { + data.legendSet.push(checkbox); + }); + }, + + /** + * Render legend icon and attach event + * @param {object} position left, top + * @param {object} data rendering data + * @param {string} data.labelText label text + * @param {number} data.labelHeight label height + * @param {string} data.legendColor legend color hex + * @param {boolean} data.isUnselected boolean value for selected or not + * @param {number} data.legendIndex legend index + * @param {Array.} data.legendSet legend set + * @private + */ + _renderIcon: function(position, data) { + var self = this; + var icon, pathString; + + this.paper.setStart(); + + if (data.iconType === 'line') { + pathString = 'M' + position.left + ',' + (position.top + (this._legendItemHeight / 2)) + + 'H' + (position.left + chartConst.LEGEND_ICON_WIDTH); + + icon = raphaelRenderUtil.renderLine(this.paper, pathString, data.legendColor, 3); + icon.attr('stroke-opacity', data.isUnselected ? UNSELECTED_LEGEND_LABEL_OPACITY : 1); + } else { + icon = raphaelRenderUtil.renderRect(this.paper, { + left: position.left, + top: position.top, + width: chartConst.LEGEND_ICON_WIDTH, + height: this._iconHeight + }, { + 'stroke-width': 0, + fill: data.legendColor, + opacity: data.isUnselected ? UNSELECTED_LEGEND_LABEL_OPACITY : 1 + }); + } + + icon.data('icon', data.iconType); + icon.data('index', data.legendIndex); + icon.click(function() { + self.eventBus.fire('labelClicked', data.legendIndex); + }); + + data.legendSet.push(icon); + }, + + selectLegend: function(index, legendSet) { + legendSet.forEach(function(element) { + var indexData = element.data('index'); + var attributeName = element.data('icon') === 'line' ? 'stroke-opacity' : 'opacity'; + + if (snippet.isNull(indexData) || snippet.isUndefined(indexData)) { + element.attr(attributeName, 1); + } else if (!snippet.isUndefined(indexData)) { + if (snippet.isNumber(index) && indexData !== index) { + element.attr(attributeName, UNSELECTED_LEGEND_LABEL_OPACITY); + } else { + element.attr(attributeName, 1); + } + } + }); + }, + + /** + * get checkbox area's width depends on checkbox visibility + * @returns {number} - checkbox region's width + */ + _getCheckboxWidth: function() { + return this._showCheckbox ? (this._checkBoxWidth + chartConst.LEGEND_LABEL_LEFT_PADDING) : 0; + }, + + /** + * Get width of a label when parameter is given. + * Otherwise, returns maximum width of labels + * @param {number} [index] - legend index + * @returns {number} - maximum label width label width + */ + _getLabelWidth: function(index) { + var labelWidth; + if (index) { + labelWidth = this.labelWidths[index] || 0; + } else { + labelWidth = arrayUtil.max(this.labelWidths); + } + + return labelWidth; + }, + + /** + * calulate a whole legend width before start rendering + * @returns {number} - calculate label + */ + _calculateLegendWidth: function() { + return this._calculateSingleLegendWidth(); + }, + + /** + * calculate a single legend width of index `legendIndex` + * @param {number} legendIndex - index of legend label + * @returns {number} - calculate single legend width + */ + _calculateSingleLegendWidth: function(legendIndex) { + return chartConst.LEGEND_AREA_PADDING + + this._getCheckboxWidth() + + getIconWidth() + + this._getLabelWidth(legendIndex) + + chartConst.LEGEND_AREA_PADDING; + }, + + /** + * set component dimension by comparaing label height and icon height + * @param {number} labelHeight - label height + */ + _setComponentDimensionsBaseOnLabelHeight: function(labelHeight) { + this._legendItemHeight = Math.max(labelHeight, chartConst.LEGEND_ICON_HEIGHT); + this._iconHeight = this._legendItemHeight; + this._checkBoxWidth = this._checkBoxHeight = labelHeight; + } + }); + + module.exports = RaphaelLegendComponent; + + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview RaphaelMapLegend is graph renderer for map chart legend. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var raphaelRenderUtil = __webpack_require__(5); + var chartConst = __webpack_require__(8); + var snippet = __webpack_require__(6); + + var PADDING = chartConst.LEGEND_AREA_PADDING; + var DEGREE_HORIZONTAL_BAR = 360; + var DEGREE_VERTICAL_BAR = 270; + var GAP_BETWEEN_LABEL_AND_LEGEND_BAR = 35; + var TICK_BAR_LENGTH = 15; + var WEDGE_BASE_HALF = 3; // half of wedge triagle base + /** + * @classdesc RaphaelMapLegend is graph renderer for map chart legend. + * @class RaphaelMapLegend + * @private + */ + var RaphaelMapLegend = snippet.defineClass(/** @lends RaphaelMapLegend.prototype */ { + /** + * Render function of map chart legend. + * @param {object} paper raphael paper + * @param {object} layout legend layout + * @param {ColorSpectrum} colorSpectrum map chart color model + * @param {boolean} isHorizontal whether horizontal legend or not + * @param {Array.} legendSet legend set + */ + render: function(paper, layout, colorSpectrum, isHorizontal, legendSet) { + var gradientBar; + + layout.position.left += (PADDING * 2); + layout.position.top += PADDING; + + gradientBar = this._renderGradientBar(paper, layout, colorSpectrum, isHorizontal); + + legendSet.push(gradientBar); + + this.wedge = this._renderWedge(paper, layout.position); + legendSet.push(this.wedge); + + this.gradientBar = gradientBar; + }, + + /** + * Render gradient bar inner tick & tick label + * @param {object} paper Raphael paper + * @param {object} baseData base data for render ticks + * @param {Array.} labels labels + * @param {boolean} isHorizontal boolean value for is horizontal or not + * @param {Array.} legendSet legend set + */ + renderTicksAndLabels: function(paper, baseData, labels, isHorizontal, legendSet) { + snippet.forEach(labels, function(label, labelIndex) { + var offsetValue = baseData.step * labelIndex; + var pos = snippet.extend({}, baseData.position); + var path = 'M'; + + if (isHorizontal) { + pos.left += offsetValue; + path += pos.left + ',' + (pos.top - GAP_BETWEEN_LABEL_AND_LEGEND_BAR) + + 'V' + (pos.top - GAP_BETWEEN_LABEL_AND_LEGEND_BAR + TICK_BAR_LENGTH); + } else { + pos.top += offsetValue; + path += (pos.left - GAP_BETWEEN_LABEL_AND_LEGEND_BAR) + ',' + pos.top + + 'H' + (pos.left - GAP_BETWEEN_LABEL_AND_LEGEND_BAR + TICK_BAR_LENGTH); + } + + legendSet.push(raphaelRenderUtil.renderLine(paper, path, '#ccc', 1)); + legendSet.push(raphaelRenderUtil.renderText(paper, pos, label)); + }); + }, + + /** + * Render gradient bar. + * @param {object} paper raphael object + * @param {object} layout legend layout + * @param {ColorSpectrum} colorSpectrum map chart color model + * @param {boolean} isHorizontal whether horizontal legend or not + * @returns {object} + * @private + */ + _renderGradientBar: function(paper, layout, colorSpectrum, isHorizontal) { + var rectHeight = layout.dimension.height; + var left = layout.position.left; + var degree, bound, fill; + + if (isHorizontal) { + rectHeight -= PADDING; + degree = DEGREE_HORIZONTAL_BAR; + this._makeWedghPath = this._makeHorizontalWedgePath; + } else { + degree = DEGREE_VERTICAL_BAR; + this._makeWedghPath = this._makeVerticalWedgePath; + } + + fill = degree + '-' + colorSpectrum.start + '-' + colorSpectrum.end; + + bound = { + left: left, + top: layout.position.top, + width: layout.dimension.width - PADDING, + height: rectHeight + }; + + return raphaelRenderUtil.renderRect(paper, bound, { + fill: fill, + stroke: 'none' + }); + }, + + /** + * Render wedge. + * @param {object} paper raphael object + * @param {{top: number, left: number}} position base position of legend + * @returns {object} raphael object + * @private + */ + _renderWedge: function(paper, position) { + return paper.path(this.verticalBasePath).attr({ + 'fill': 'gray', + stroke: 'none', + opacity: 0, + transform: 't' + position.left + ',' + position.top + }); + }, + + /** + * Vertical base path + * @type {Array} + */ + verticalBasePath: ['M', 16, 6, 'L', 24, 3, 'L', 24, 9], + + /** + * Make vertical wedge path. + * @param {number} top top + * @returns {Array} path + * @private + */ + _makeVerticalWedgePath: function(top) { + var path = this.verticalBasePath; + + path[2] = top; + path[5] = top - WEDGE_BASE_HALF; + path[8] = top + WEDGE_BASE_HALF; + + return path; + }, + + /** + * Horizontal base path + * @type {Array} + */ + horizontalBasePath: ['M', 5, 16, 'L', 8, 24, 'L', 2, 24], + + /** + * Make horizontal wedge path. + * @param {number} left left + * @returns {Array} path + * @private + */ + _makeHorizontalWedgePath: function(left) { + var path = this.horizontalBasePath; + + path[1] = left; + path[4] = left + WEDGE_BASE_HALF; + path[7] = left - WEDGE_BASE_HALF; + + return path; + }, + + /** + * Show wedge. + * @param {number} positionValue top + */ + showWedge: function(positionValue) { + var path = this._makeWedghPath(positionValue); + + this.wedge.attr({ + path: path, + opacity: 1 + }); + }, + + /** + * Hide wedge + */ + hideWedge: function() { + this.wedge.attr({ + opacity: 0 + }); + }, + + /** + * Remove location URL from fill attribute + * @private + */ + removeLocationURLFromFillAttribute: function() { + var gradientBar = this.gradientBar; + var fillURL = gradientBar.node.getAttribute('fill'); + this.locationURL = /url\('?([^#]+)#[^#]+'?\)/.exec(fillURL)[1]; + + gradientBar.node.setAttribute('fill', fillURL.replace(this.locationURL, '')); + }, + + /** + * Restore location URL to fill attribute + * @private + */ + restoreLocationURLToFillAttribute: function() { + var gradientBar = this.gradientBar; + var fillURL = gradientBar.node.getAttribute('fill'); + + gradientBar.node.setAttribute('fill', fillURL.replace('#', this.locationURL + '#')); + } + }); + + module.exports = RaphaelMapLegend; + + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview RaphaelCircleLegend is graph renderer for circleLegend. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var raphaelRenderUtil = __webpack_require__(5); + var snippet = __webpack_require__(6); + + /** + * @classdesc RaphaelCircleLegend is graph renderer for circleLegend. + * @class RaphaelCircleLegend + * @private + */ + var RaphaelCircleLegend = snippet.defineClass(/** @lends RaphaelCircleLegend.prototype */ { + + /** + * Render circle and label. + * @param {object} paper paper object + * @param {{width: number, height: number}} layout - layout of circle legend area + * @param {number} maxRadius - pixel type maximum radius + * @param {Array.} radiusRatios - radius ratios + * @param {Array.} labels - circle legend labels + * @returns {Array.} + * @private + */ + render: function(paper, layout, maxRadius, radiusRatios, labels) { + var left = layout.position.left + (layout.dimension.width / 2); + var circleLegendSet = paper.set(); + + snippet.forEachArray(radiusRatios, function(ratio, index) { + var radius = maxRadius * ratio; + var top = layout.position.top + layout.dimension.height - radius; + var circle = raphaelRenderUtil.renderCircle(paper, { + left: left, + top: top + }, radius, { + fill: 'none', + opacity: 1, + stroke: '#888', + 'stroke-width': 1 + }); + + circleLegendSet.push(circle); + + circleLegendSet.push(raphaelRenderUtil.renderText(paper, { + left: left, + top: top - radius - 5 + }, labels[index])); + }); + + return circleLegendSet; + } + }); + + module.exports = RaphaelCircleLegend; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Raphael title renderer. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var raphaelRenderUtil = __webpack_require__(5); + var chartConst = __webpack_require__(8); + var snippet = __webpack_require__(6); + + var RaphaelTitleComponent = snippet.defineClass(/** @lends RaphaelTitleComponent.prototype */ { + /** + * Render title + * @param {object} paper - paper + * @param {string} titleText - title text + * @param {{x: number, y: number}} offset - title offset x, y + * @param {object} theme - theme object + * @returns {Array.} title set + */ + render: function(paper, titleText, offset, theme) { + var fontSize = theme.fontSize; + var fontFamily = theme.fontFamily; + var titleSize = raphaelRenderUtil.getRenderedTextSize(titleText, fontSize, fontFamily); + var pos = { + left: paper.width / 2, + top: (titleSize.height + chartConst.TITLE_PADDING) / 2 // for renderText's baseline + }; + var titleSet = paper.set(); + + if (offset) { + if (offset.x) { + pos.left += offset.x; + } else if (offset.y) { + pos.top += offset.y; + } + } + + titleSet.push(raphaelRenderUtil.renderText(paper, pos, titleText, { + 'font-family': theme.fontFamily, + 'font-size': theme.fontSize, + 'font-weight': theme.fontWeight, + fill: theme.color, + 'text-anchor': 'middle' + })); + + return titleSet; + }, + /** + * Resize title component + * @param {number} chartWidth chart width + * @param {Array.} titleSet title set + */ + resize: function(chartWidth, titleSet) { + titleSet.attr({ + x: chartWidth / 2 + }); + } + }); + + module.exports = RaphaelTitleComponent; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Raphael title renderer. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var raphaelRenderUtil = __webpack_require__(5); + var AXIS_BACKGROUND_RIGHT_PADDING = 4; + var snippet = __webpack_require__(6); + + var RaphaelAxisComponent = snippet.defineClass(/** @lends RaphaelAxisComponent.prototype */ { + init: function() { + this.ticks = []; + }, + + /** + * Render background with plot background color + * @param {object} paper Raphael paper + * @param {object} position axis position + * @param {object} dimension axis dimension + * @param {object} theme chart theme + * @returns {Element} - raphael element + * @private + */ + renderBackground: function(paper, position, dimension, theme) { + var background = ((theme && theme.background) || {}); + var fillColor = (background.color || '#fff'); + var opacity = (background.opacity || 1); + + return raphaelRenderUtil.renderRect(paper, { + left: 0, + top: position.top, + width: dimension.width + position.left - AXIS_BACKGROUND_RIGHT_PADDING, + height: dimension.height + }, { + fill: fillColor, + opacity: opacity, + 'stroke-width': 0 + }); + }, + + /** + * Render title + * @param {object} paper raphael paper + * @param {object} data rendering data + * @param {string} data.text text content + * @param {object} data.theme theme object + * @param {object} data.rotationInfo object + * @param {object} data.layout dimension and position + */ + renderTitle: function(paper, data) { + var theme = data.theme; + var attributes = { + 'dominant-baseline': 'auto', + 'font-family': theme.fontFamily, + 'font-size': theme.fontSize, + 'font-weight': theme.fontWeight, + fill: theme.color, + 'text-anchor': 'middle' + }; + var position = this.calculatePosition(paper, data); + var title; + + attributes.transform = getCSSTransform(data.rotationInfo, position); + title = raphaelRenderUtil.renderText(paper, position, data.text, attributes); + + title.node.style.userSelect = 'none'; + title.node.style.cursor = 'default'; + + data.set.push(title); + }, + + /** + * Render Axis label + * @param {object} data data for render label + * @param {{ + * left: number, + * top: number + * }} data.positionTopAndLeft left, top positions + * @param {string} data.labelText label text + * @param {number} data.labelSize label size + * @param {object} data.paper raphael paper + * @param {boolean} data.isVertical boolean value of axis is vertical + * @param {boolean} data.isPositionRight boolean value of axis is right yAxis + * @param {object} data.theme theme of label + */ + renderLabel: function(data) { + var positionTopAndLeft = data.positionTopAndLeft; + var labelText = data.labelText; + var paper = data.paper; + var isVertical = data.isVertical; + var isPositionRight = data.isPositionRight; + var theme = data.theme; + var attributes = { + 'dominant-baseline': 'central', + 'font-family': theme.fontFamily, + 'font-size': theme.fontSize, + 'font-weight': theme.fontWeight, + fill: theme.color + }; + var textObj; + + if (isPositionRight) { + attributes['text-anchor'] = 'start'; + } else if (isVertical) { + attributes['text-anchor'] = 'end'; + } else { + attributes['text-anchor'] = 'middle'; + } + + textObj = raphaelRenderUtil.renderText(paper, positionTopAndLeft, labelText, attributes); + + textObj.node.style.userSelect = 'none'; + textObj.node.style.cursor = 'default'; + + data.set.push(textObj); + this.ticks.push(textObj); + }, + + /** + * Render rotated Axis label + * @param {object} data data for render rotated label + * @param {{ + * left: number, + * top: number + * }} data.positionTopAndLeft left, top positions + * @param {string} data.labelText label text + * @param {object} data.paper raphael paper + * @param {boolean} data.isVertical boolean value of axis is vertical + * @param {object} data.theme theme of label + * @param {number} data.degree rotation degree + */ + renderRotatedLabel: function(data) { + var positionTopAndLeft = data.positionTopAndLeft; + var labelText = data.labelText; + var paper = data.paper; + var theme = data.theme; + var textObj = raphaelRenderUtil.renderText(paper, positionTopAndLeft, labelText, { + 'dominant-baseline': 'central', + 'font-family': theme.fontFamily, + 'font-size': theme.fontSize, + 'font-weight': theme.fontWeight, + fill: theme.color, + 'text-anchor': 'end', + transform: 'r' + (-data.degree) + ',' + (positionTopAndLeft.left + 20) + ',' + (positionTopAndLeft.top) + }); + + textObj.node.style.userSelect = 'none'; + textObj.node.style.cursor = 'arrow'; + + data.set.push(textObj); + this.ticks.push(textObj); + }, + + /** + * Render ticks on given paper + * @param {object} data data for rendering ticks + */ + renderTicks: function(data) { + var self = this; + var paper = data.paper; + var positions = data.positions; + var additionalSize = data.additionalSize; + var isVertical = data.isVertical; + var isCenter = data.isCenter; + var isPositionRight = data.isPositionRight; + var tickColor = data.tickColor; + var layout = data.layout; + var rightEdgeOfAxis = layout.position.left + layout.dimension.width; + var baseTop = layout.position.top; + var baseLeft = layout.position.left; + var tick; + var isContainDivensionArea = function(position) { + var compareType = isVertical ? 'height' : 'width'; + + return (position > layout.dimension[compareType]); + }; + + snippet.forEach(positions, function(position) { + var pathString = 'M'; + + position += additionalSize; + + if (isContainDivensionArea(position)) { + return; + } + + if (isVertical) { + if (isCenter) { + pathString += baseLeft + ',' + (baseTop + position); + pathString += 'H' + (baseLeft + 5); + + pathString += 'M' + rightEdgeOfAxis + ',' + (baseTop + position); + pathString += 'H' + (rightEdgeOfAxis - 5); + } else if (isPositionRight) { + pathString += baseLeft + ',' + (baseTop + position); + pathString += 'H' + (baseLeft + 5); + } else { + pathString += rightEdgeOfAxis + ',' + (baseTop + position); + pathString += 'H' + (rightEdgeOfAxis - 5); + } + } else { + pathString += (baseLeft + position) + ',' + baseTop; + pathString += 'V' + (baseTop + 5); + } + + if (!isNaN(position)) { + tick = paper.path(pathString).attr({ + stroke: tickColor + }); + data.set.push(tick); + self.ticks.push(tick); + } + }); + }, + + /** + * Render tick line on given paper + * @param {number} data data for render tick line + * @param {number} data.areaSize area size width or height + * @param {object} data.paper raphael paper + * @param {boolean} data.isNotDividedXAxis boolean value for XAxis divided or not + * @param {number} data.additionalSize additional size for position and line length + * @param {number} data.additionalWidth additional width of tick line paper + * @param {number} data.additionalHeight additional height of tick line paper + * @param {boolean} data.isPositionRight boolean value of right yAxis or not + * @param {boolean} data.isCenter boolean value of center yAxis or not + * @param {boolean} data.isVertical boolean value of vertical axis or not + */ + renderTickLine: function(data) { + var areaSize = data.areaSize; + var lineSize = areaSize; + var paper = data.paper; + var layout = data.layout; + var isNotDividedXAxis = data.isNotDividedXAxis; + var additionalSize = data.additionalSize; + var isPositionRight = data.isPositionRight; + var isCenter = data.isCenter; + var isVertical = data.isVertical; + var tickColor = data.tickColor; + var pathString = 'M'; + var baseTop = layout.position.top; + var baseLeft = layout.position.left; + var verticalTickLineEndYCoord = layout.dimension.height + baseTop; + var rightEdgeOfAxis = baseLeft + layout.dimension.width; + var lineStartYCoord, lineEndXCoord, lineEndYCoord; + + if (isPositionRight) { + pathString += baseLeft + ',' + baseTop; + pathString += 'V' + verticalTickLineEndYCoord; + } else if (isVertical) { + lineStartYCoord = baseTop; + pathString += rightEdgeOfAxis + ',' + lineStartYCoord; + + if (isCenter) { + pathString += 'V' + verticalTickLineEndYCoord; + pathString += 'M' + baseLeft + ',' + lineStartYCoord; + pathString += 'V' + verticalTickLineEndYCoord; + } else { + lineEndYCoord = baseTop + lineSize; + pathString += 'V' + lineEndYCoord; + } + } else { + if (isNotDividedXAxis) { + pathString += baseLeft; + } else { + pathString += (baseLeft + additionalSize); + } + pathString += ',' + baseTop + 'H'; + + lineEndXCoord = (baseLeft + lineSize); + + if (!isNotDividedXAxis) { + lineEndXCoord += additionalSize; + } + pathString += lineEndXCoord; + } + + data.set.push(paper.path(pathString).attr({ + 'stroke-width': 1, + stroke: tickColor + })); + }, + + /** + * Animate ticks for adding data + * @param {number} tickSize tick size of moving + */ + animateForAddingData: function(tickSize) { + snippet.forEach(this.ticks, function(tick) { + tick.animate({ + transform: 't-' + tickSize + ',0' + }, 300); + }); + }, + + /** + * Calculate axis title position, and transforma + * @param {Raphael.paper} paper - paper + * @param {object} data - options for calcultating title position + * @param {object} data.rotationInfo - isCenter, isVertical, isPositionRight + * @param {object} data.text - text + * @param {object} data.theme - theme + * @param {object} data.layout - layout + * @returns {object} position - top, left + */ + calculatePosition: function(paper, data) { + var rotationInfo = data.rotationInfo; + var textHeight = getTextHeight(data.text, data.theme); + var layout = data.layout; + var centerPosition = calculateCenterPosition( + rotationInfo.isVertical, layout.dimension, layout.position + ); + var position = {}; + + if (rotationInfo.isCenter) { + position.top = paper.height - (textHeight / 2); + position.left = layout.position.left + (layout.dimension.width / 2); + } else if (rotationInfo.isPositionRight) { + position.top = centerPosition; + position.left = layout.position.left + layout.dimension.width; + } else if (rotationInfo.isVertical) { + position.top = centerPosition; + position.left = layout.position.left + (textHeight / 2); + } else { + position.top = layout.position.top + layout.dimension.height; + position.left = centerPosition; + } + + if (!rotationInfo.isCenter) { + addOffset(position, data.offset); + } + + return position; + } + }); + + /** + * Get a text height by theme + * @param {string} text - text + * @param {object} theme - axis theme + * @returns {number} text height + * @ignore + */ + function getTextHeight(text, theme) { + var titleSize = raphaelRenderUtil.getRenderedTextSize(text, theme.fontSize, theme.fontFamily); + + return titleSize.height; + } + + /** + * Test axis title need to rotate + * @param {object} rotationInfo - rotationInfo + * @returns {boolean} - whether it needs to rotate + * @ignore + */ + function doesTitleRotate(rotationInfo) { + if (snippet.isExisty(rotationInfo.rotateTitle)) { + return rotationInfo.rotateTitle === true; + } + + return true; + } + + /** + * Calculate center position + * @param {boolean} isVertical - is vertical axis + * @param {object} dimension - width, height + * @param {object} position - top, left + * @returns {number} - center position + * @ignore + */ + function calculateCenterPosition(isVertical, dimension, position) { + var size = isVertical ? dimension.height : dimension.width; + var margin = isVertical ? position.top : position.left; + + return (size / 2) + margin; + } + + /** + * Add offset to position + * @param {object} position - top, left + * @param {object} offset - x, y + * @ignore + */ + function addOffset(position, offset) { + if (!offset) { + return; + } + + if (offset.x) { + position.left += offset.x; + } + if (offset.y) { + position.top += offset.y; + } + } + + /** + * Get transform by rotation info + * @param {object} rotationInfo - isCenter, isVertical, isPositionRight + * @param {object} position - top, left + * @returns {string} css transform + * @ignore + */ + function getCSSTransform(rotationInfo, position) { + var transform = 'none'; + if (rotationInfo.isPositionRight) { + transform = 'r90,' + position.left + ',' + position.top; + } else if (rotationInfo.isVertical && doesTitleRotate(rotationInfo)) { + transform = 'r-90,' + position.left + ',' + position.top; + } + + return transform; + } + + module.exports = RaphaelAxisComponent; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview RaphaelRadialPlot is graph renderer for radial plot. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var raphaelRenderUtil = __webpack_require__(5); + var arrayUtil = __webpack_require__(10); + var snippet = __webpack_require__(6); + + var STEP_TOP_ADJUSTMENT = 8; + var STEP_LEFT_ADJUSTMENT = 3; + + /** + * @classdesc RaphaelRadialPlot is graph renderer for radial plot. + * @class RaphaelRadialPlot + * @private + */ + var RaphaelRadialPlot = snippet.defineClass(/** @lends RaphaelRadialPlot.prototype */ { + /** + * Render function of map chart legend. + * @param {object} params parameters + * @param {HTMLElement} params.container container + * @param {{width: number, height: number}} params.dimension - dimension of circle legend area + * @param {Array} params.plotPositions plot positions + * @param {object} params.labelData label data + * @returns {object} paper raphael paper + */ + render: function(params) { + var plotSet = params.paper.set(); + + this.paper = params.paper; + this.layout = params.layout; + this.plotPositions = params.plotPositions; + this.theme = params.theme; + this.options = params.options; + this.labelData = params.labelData; + + this._renderPlot(plotSet); + this._renderLabels(plotSet); + + plotSet.toBack(); + this.paper.pushDownBackgroundToBottom(); + + return plotSet; + }, + + /** + * Render plot component + * @param {Array.} plotSet plot set + * @private + */ + _renderPlot: function(plotSet) { + if (this.options.type === 'circle') { + this._renderCirclePlot(plotSet); + } else { + this._renderSpiderwebPlot(plotSet); + } + + this._renderCatergoryLines(plotSet); + }, + + /** + * Render spider web plot + * @param {Array.} plotSet plot set + * @private + */ + _renderSpiderwebPlot: function(plotSet) { + var groupPaths = this._getLinesPath(this.plotPositions); + + this._renderLines(groupPaths, this.theme.lineColor, plotSet); + }, + + /** + * Render circle plot + * @param {Array.} plotSet plot set + * @private + */ + _renderCirclePlot: function(plotSet) { + var i, pos, radius; + var plotPositions = this.plotPositions; + var centerPoint = plotPositions[0][0]; + var strokeColor = this.theme.lineColor; + + for (i = 1; i < plotPositions.length; i += 1) { + pos = plotPositions[i][0]; + radius = centerPoint.top - pos.top; + + plotSet.push(raphaelRenderUtil.renderCircle(this.paper, centerPoint, radius, { + stroke: strokeColor + })); + } + }, + + /** + * Render category lines + * @param {Array.} plotSet plot set + * @private + */ + _renderCatergoryLines: function(plotSet) { + var groupPaths = this._getLinesPath(arrayUtil.pivot(this.plotPositions)); + + this._renderLines(groupPaths, this.theme.lineColor, plotSet); + }, + + /** + * Render labels + * @param {Array.} plotSet plot set + * @private + */ + _renderLabels: function(plotSet) { + var paper = this.paper; + var theme = this.theme; + var labelData = this.labelData; + var attributes = { + fill: theme.lineColor, + 'font-size': theme.label.fontSize, + 'font-family': theme.label.fontFamily, + 'text-anchor': 'end', + 'font-weight': '100', + 'dominant-baseline': 'middle' + }; + + snippet.forEachArray(labelData.category, function(item) { + var categoryAttributes = snippet.extend({}, attributes, { + 'text-anchor': item.position.anchor + }); + var label = raphaelRenderUtil.renderText(paper, item.position, item.text, categoryAttributes); + + label.node.style.userSelect = 'none'; + label.node.style.cursor = 'default'; + + plotSet.push(label); + }); + + snippet.forEachArray(labelData.step, function(item) { + var stepLabel = raphaelRenderUtil.renderText(paper, item.position, item.text, attributes); + + item.position.top -= STEP_TOP_ADJUSTMENT; + item.position.left -= STEP_LEFT_ADJUSTMENT; + + stepLabel.node.style.userSelect = 'none'; + stepLabel.node.style.cursor = 'default'; + + plotSet.push(stepLabel); + }); + }, + + /** + * Render lines. + * @param {Array.>} groupPaths paths + * @param {string} lineColor line color + * @param {Array.} plotSet plot set + * @returns {Array.>} lines + * @private + */ + _renderLines: function(groupPaths, lineColor, plotSet) { + var paper = this.paper; + + return snippet.map(groupPaths, function(path) { + var line = raphaelRenderUtil.renderLine(paper, path.join(' '), lineColor, 1); + + plotSet.push(line); + + return line; + }); + }, + + /** + * Get lines path. + * /todo remove duplication, copied from raphaelLineTypeBase + * @param {Array.>} groupPositions positions + * @returns {Array.>} path + * @private + */ + _getLinesPath: function(groupPositions) { + var self = this; + + return snippet.map(groupPositions, function(positions) { + return self._makeLinesPath(positions); + }); + }, + + /** + * Make lines path. + * /todo remove duplication, copied from raphaelLineTypeBase + * @param {Array.<{left: number, top: number, startTop: number}>} positions positions + * @param {?string} [posTopType='top'] position top type + * @param {boolean} [connectNulls] - boolean value connect nulls or not + * @returns {Array.} paths + * @private + */ + _makeLinesPath: function(positions, posTopType, connectNulls) { + var path = []; + var prevMissing = false; + + posTopType = posTopType || 'top'; + + snippet.map(positions, function(position) { + var pathCommand = (prevMissing && !connectNulls) ? 'M' : 'L'; + + if (position) { + path.push([pathCommand, position.left, position[posTopType]]); + if (prevMissing) { + prevMissing = false; + } + } else { + prevMissing = true; + } + }); + + path = Array.prototype.concat.apply([], path); + path[0] = 'M'; + + return path; + } + }); + + module.exports = RaphaelRadialPlot; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview chart.js is entry point of Toast UI Chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var chartFactory = __webpack_require__(30); + var pluginFactory = __webpack_require__(32); + var themeManager = __webpack_require__(33); + var mapManager = __webpack_require__(35); + var objectUtil = __webpack_require__(36); + var seriesDataImporter = __webpack_require__(37); + var drawingToolPicker = __webpack_require__(38); + + __webpack_require__(39); + __webpack_require__(40); + __webpack_require__(146); + + /** + * Raw series datum. + * @typedef {{name: ?string, data: Array., stack: ?string}} rawSeriesDatum + * @private + */ + + /** + * Raw series data. + * @typedef {Array.} rawSeriesData + * @private + */ + + /** + * Raw data. + * @typedef {{ + * categories: ?Array., + * series: (rawSeriesData|{line: ?rawSeriesData, column: ?rawSeriesData}) + * }} rawData + * @private + */ + + /** + * Create chart. + * @param {HTMLElement} container container + * @param {({ + * series: (object|Array), + * categories: Array + * }|{ + * table: ({ + * elementId: string + * }|{ + * element: HTMLElement + * }) + * })} rawData - raw data object or data container table element or table's id + * @param {{ + * chart: { + * width: number, + * height: number, + * title: string, + * format: string + * }, + * yAxis: { + * title: string, + * min: number + * }, + * xAxis: { + * title: string, + * min: number + * }, + * tooltip: { + * suffix: string, + * template: function + * }, + * theme: string + * }} options - chart options + * @param {string} chartType - chart type + * @returns {object} chart instance. + * @private + * @ignore + */ + function _createChart(container, rawData, options, chartType) { + var theme, chart, temp; + + if (!rawData) { + rawData = {}; + } + + if (rawData.table) { + rawData = seriesDataImporter.makeDataWithTable(rawData.table); + } + + if (!rawData.series) { + rawData.series = []; + } + + rawData = objectUtil.deepCopy(rawData); + + if (chartType !== 'combo') { + temp = rawData.series; + rawData.series = {}; + rawData.series[chartType] = temp; + } + + options = options ? objectUtil.deepCopy(options) : {}; + options.chartType = chartType; + options.theme = options.theme || chartConst.DEFAULT_THEME_NAME; + theme = themeManager.get(options.theme, chartType, rawData.series); + + chart = chartFactory.get(options.chartType, rawData, theme, options); + + chart.render(container); + chart.animateChart(); + + return chart; + } + + /** + * Bar chart creator. + * @memberof module:chart + * @memberof tui.chart + * @param {HTMLElement} container - chart container + * @param {rawData} rawData - raw data + * @param {Array.} rawData.categories - categories + * @param {Array.} rawData.series - series data + * @param {object} options - chart options + * @param {object} options.chart - base options for chart + * @param {number} options.chart.width - chart width + * @param {number} options.chart.height - chart height + * @param {string | object} options.chart.title - title text or title object + * @param {string} options.chart.title.text - title text + * @param {number} options.chart.title.offsetX - title offset x + * @param {number} options.chart.title.offsetY - title offset y + * @param {string | function} options.chart.format - formatter for value + * @param {object} options.yAxis - options for y axis component + * @param {string | object} options.yAxis.title - title text or title object + * @param {string} options.yAxis.title.text - title text + * @param {number} options.yAxis.title.offsetX - title offset x + * @param {number} options.yAxis.title.offsetY - title offset y + * @param {number} options.yAxis.labelMargin - label margin for y axis + * @param {string} options.yAxis.align - align option for center y axis + * @param {boolean} options.yAxis.rotateTitle - whether rotate title or not (default: true) + * @param {string} options.yAxis.type - type of axis + * @param {string} options.yAxis.dateFormat - date format + * @param {object} options.xAxis - options for x axis component + * @param {string | object} options.xAxis.title - title text or title object + * @param {string} options.xAxis.title.text - title text + * @param {number} options.xAxis.title.offsetX - title offset x + * @param {number} options.xAxis.title.offsetY - title offset y + * @param {number} options.xAxis.labelMargin - label margin for x axis + * @param {number} options.xAxis.min - minimum value for x axis + * @param {number} options.xAxis.max - maximum value for x axis + * @param {object} options.series - options for series component + * @param {string} options.series.stackType - type of stack + * @param {boolean} options.series.showLabel - whether show label or not + * @param {number} options.series.barWidth - bar width + * @param {boolean} options.series.allowSelect - whether allow select or not + * @param {boolean} options.series.diverging - whether diverging or not + * @param {object} options.tooltip - options for tooltip component + * @param {string} options.tooltip.suffix - suffix for tooltip + * @param {function} [options.tooltip.template] - template for tooltip + * @param {string} options.tooltip.align - align option for tooltip + * @param {object} options.tooltip.offsetX - tooltip offset x + * @param {object} options.tooltip.offsetY - tooltip offset y + * @param {object} options.tooltip.position - (deprecated) relative position + * @param {number} options.tooltip.position.left - position left + * @param {number} options.tooltip.position.top - position top + * @param {boolean} options.tooltip.grouped - whether group tooltip or not + * @param {object} options.legend - options for legend component + * @param {string} options.legend.align - align option for legend (top|bottom|left) + * @param {boolean} options.legend.showCheckbox - whether show checkbox or not (default: true) + * @param {boolean} options.legend.visible - whether visible or not (default: true) + * @param {number} options.legend.maxWidth - legend name display max width + * @param {object} options.plot - options for plot component + * @param {boolean} options.plot.showLine - whether show line or not (default: true) + * @param {string} options.theme - theme name + * @param {string} options.libType - type of graph library + * @returns {object} bar chart + * @api + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var container = document.getElementById('container-id'), + * rawData = { + * categories: ['cate1', 'cate2', 'cate3'], + * series: [ + * { + * name: 'Legend1', + * data: [20, 30, 50] + * }, + * { + * name: 'Legend2', + * data: [40, 40, 60] + * }, + * { + * name: 'Legend3', + * data: [60, 50, 10] + * }, + * { + * name: 'Legend4', + * data: [80, 10, 70] + * } + * ] + * }, + * options = { + * chart: { + * title: 'Bar Chart' + * }, + * yAxis: { + * title: 'Y Axis' + * }, + * xAxis: { + * title: 'X Axis' + * } + * }; + * chart.barChart(container, rawData, options); + */ + function barChart(container, rawData, options) { + return _createChart(container, rawData, options, chartConst.CHART_TYPE_BAR); + } + + /** + * Column chart creator. + * @memberof module:chart + * @memberof tui.chart + * @param {HTMLElement} container - chart container + * @param {rawData} rawData - raw data + * @param {Array.} rawData.categories - categories + * @param {Array.} rawData.series - series data + * @param {object} options - chart options + * @param {object} options.chart - base options for chart + * @param {number} options.chart.width - chart width + * @param {number} options.chart.height - chart height + * @param {string | object} options.chart.title - title text or title object + * @param {string} options.chart.title.text - title text + * @param {number} options.chart.title.offsetX - title offset x + * @param {number} options.chart.title.offsetY - title offset y + * @param {string | function} options.chart.format - formatter for value + * @param {object} options.yAxis - options for y axis component + * @param {string | object} options.yAxis.title - title text or title object + * @param {string} options.yAxis.title.text - title text + * @param {number} options.yAxis.title.offsetX - title offset x + * @param {number} options.yAxis.title.offsetY - title offset y + * @param {number} options.yAxis.labelMargin - label margin for y axis + * @param {number} options.yAxis.min - minimum value for y axis + * @param {number} options.yAxis.max - maximum value for y axis + * @param {boolean} options.yAxis.rotateTitle - whether rotate title or not (default: true) + * @param {object} options.xAxis - options for x axis component + * @param {string | object} options.xAxis.title - title text or title object + * @param {string} options.xAxis.title.text - title text + * @param {number} options.xAxis.title.offsetX - title offset x + * @param {number} options.xAxis.title.offsetY - title offset y + * @param {number} options.xAxis.labelMargin - label margin for x axis + * @param {number} options.xAxis.labelInterval - label interval for x axis + * @param {boolean} options.xAxis.rotateLabel - whether rotate label or not (default: true) + * @param {string} options.xAxis.type - type of axis + * @param {string} options.xAxis.dateFormat - date format + * @param {object} options.series - options for series component + * @param {string} options.series.stackType - type of stack + * @param {boolean} options.series.showLabel - whether show label or not + * @param {number} options.series.barWidth - bar width + * @param {boolean} options.series.allowSelect - whether allow select or not + * @param {boolean} options.series.diverging - whether diverging or not + * @param {object} options.tooltip - options for tooltip component + * @param {string} options.tooltip.suffix - suffix for tooltip + * @param {function} [options.tooltip.template] - template for tooltip + * @param {string} options.tooltip.align - align option for tooltip + * @param {object} options.tooltip.offsetX - tooltip offset x + * @param {object} options.tooltip.offsetY - tooltip offset y + * @param {object} options.tooltip.position - (deprecated) relative position + * @param {number} options.tooltip.position.left - position left + * @param {number} options.tooltip.position.top - position top + * @param {boolean} options.tooltip.grouped - whether group tooltip or not + * @param {object} options.legend - options for legend component + * @param {string} options.legend.align - align option for legend (top|bottom|left) + * @param {boolean} options.legend.showCheckbox - whether show checkbox or not (default: true) + * @param {boolean} options.legend.visible - whether visible or not (default: true) + * @param {number} options.legend.maxWidth - legend name display max width + * @param {object} options.plot - options for plot component + * @param {boolean} options.plot.showLine - whether show line or not (default: true) + * @param {string} options.theme - theme name + * @param {string} options.libType - type of graph library + * @param {object} options.chartExportMenu - options for exporting + * @param {string} options.chartExportMenu.filename - export file name + * @returns {object} column chart + * @api + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var container = document.getElementById('container-id'), + * rawData = { + * categories: ['cate1', 'cate2', 'cate3'], + * series: [ + * { + * name: 'Legend1', + * data: [20, 30, 50] + * }, + * { + * name: 'Legend2', + * data: [40, 40, 60] + * }, + * { + * name: 'Legend3', + * data: [60, 50, 10] + * }, + * { + * name: 'Legend4', + * data: [80, 10, 70] + * } + * ] + * }, + * options = { + * chart: { + * title: 'Column Chart' + * }, + * yAxis: { + * title: 'Y Axis' + * }, + * xAxis: { + * title: 'X Axis' + * } + * }; + * chart.columnChart(container, rawData, options); + */ + function columnChart(container, rawData, options) { + return _createChart(container, rawData, options, chartConst.CHART_TYPE_COLUMN); + } + + /** + * Line chart creator. + * @memberof module:chart + * @memberof tui.chart + * @param {HTMLElement} container - chart container + * @param {rawData} rawData - raw data + * @param {?Array.} rawData.categories - categories + * @param {Array.} rawData.series - series data + * @param {object} options - chart options + * @param {object} options.chart - base options for chart + * @param {number} options.chart.width - chart width + * @param {number} options.chart.height - chart height + * @param {string | object} options.chart.title - title text or title object + * @param {string} options.chart.title.text - title text + * @param {number} options.chart.title.offsetX - title offset x + * @param {number} options.chart.title.offsetY - title offset y + * @param {string | function} options.chart.format - formatter for value + * @param {object} options.yAxis - options for y axis component + * @param {string | object} options.yAxis.title - title text or title object + * @param {string} options.yAxis.title.text - title text + * @param {number} options.yAxis.title.offsetX - title offset x + * @param {number} options.yAxis.title.offsetY - title offset y + * @param {number} options.yAxis.labelMargin - label margin for y axis + * @param {number} options.yAxis.min - minimum value for y axis + * @param {number} options.yAxis.max - maximum value for y axis + * @param {boolean} options.yAxis.rotateTitle - whether rotate title or not (default: true) + * @param {object} options.xAxis - options for x axis component + * @param {string | object} options.xAxis.title - title text or title object + * @param {string} options.xAxis.title.text - title text + * @param {number} options.xAxis.title.offsetX - title offset x + * @param {number} options.xAxis.title.offsetY - title offset y + * @param {number} options.xAxis.labelMargin - label margin for x axis + * @param {number} options.xAxis.labelInterval - label interval for x axis + * @param {string} options.xAxis.tickInterval - tick interval for x axis + * @param {boolean} options.xAxis.rotateLabel - whether rotate label or not (default: true) + * @param {string} options.xAxis.type - type of axis + * @param {string} options.xAxis.dateFormat - date format + * @param {object} options.series - options for series component + * @param {boolean} options.series.showDot - whether show dot or not + * @param {boolean} options.series.showLabel - whether show label or not + * @param {boolean} options.series.allowSelect - whether allow select or not + * @param {boolean} options.series.spline - whether spline or not + * @param {boolean} options.series.zoomable - whether zoomable or not + * @param {boolean} options.series.shifting - whether shifting or not + * @param {object} options.tooltip - options for tooltip component + * @param {string} options.tooltip.suffix - suffix for tooltip + * @param {function} [options.tooltip.template] - template for tooltip + * @param {string} options.tooltip.align - align option for tooltip + * @param {object} options.tooltip.offsetX - tooltip offset x + * @param {object} options.tooltip.offsetY - tooltip offset y + * @param {object} options.tooltip.position - (deprecated) relative position + * @param {number} options.tooltip.position.left - position left + * @param {number} options.tooltip.position.top - position top + * @param {boolean} options.tooltip.grouped - whether group tooltip or not + * @param {object} options.legend - options for legend component + * @param {string} options.legend.align - align option for legend (top|bottom|left) + * @param {boolean} options.legend.showCheckbox - whether show checkbox or not (default: true) + * @param {boolean} options.legend.visible - whether visible or not (default: true) + * @param {number} options.legend.maxWidth - legend name display max width + * @param {object} options.plot - options for plot component + * @param {boolean} options.plot.showLine - whether show line or not (default: true) + * @param {Array} options.plot.bands - plot bands + * @param {Array.} options.plot.bands.range - value range for matching + * @param {string} options.plot.bands.color - band color + * @param {number} options.plot.bands.opacity - band opacity + * @param {Array} options.plot.lines - plot lines + * @param {(string|number|date)} options.plot.lines.value - value for matching + * @param {string} options.plot.lines.color - band color + * @param {number} options.plot.lines.opacity - band opacity + * @param {Array.<{value: (string|number|date), color: ?string, opacity: ?string}>} options.plot.lines + * - plot lines + * @param {string} options.theme - theme name + * @param {string} options.libType - type of graph library + * @param {object} options.chartExportMenu - options for exporting + * @param {string} options.chartExportMenu.filename - export file name + * @returns {object} bar chart + * @api + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var container = document.getElementById('container-id'), + * rawData = { + * categories: ['cate1', 'cate2', 'cate3'], + * series: [ + * { + * name: 'Legend1', + * data: [20, 30, 50] + * }, + * { + * name: 'Legend2', + * data: [40, 40, 60] + * }, + * { + * name: 'Legend3', + * data: [60, 50, 10] + * }, + * { + * name: 'Legend4', + * data: [80, 10, 70] + * } + * ] + * }, + * options = { + * chart: { + * title: 'Line Chart' + * }, + * yAxis: { + * title: 'Y Axis' + * }, + * xAxis: { + * title: 'X Axis' + * }, + * series: { + * showDot: true + * } + * }; + * chart.lineChart(container, rawData, options); + */ + function lineChart(container, rawData, options) { + return _createChart(container, rawData, options, chartConst.CHART_TYPE_LINE); + } + + /** + * Area chart creator. + * @memberof module:chart + * @memberof tui.chart + * @param {HTMLElement} container - chart container + * @param {rawData} rawData - raw data + * @param {?Array.} rawData.categories - categories + * @param {Array.} rawData.series - series data + * @param {object} options - chart options + * @param {object} options.chart - base options for chart + * @param {number} options.chart.width - chart width + * @param {number} options.chart.height - chart height + * @param {string | object} options.chart.title - title text or title object + * @param {string} options.chart.title.text - title text + * @param {number} options.chart.title.offsetX - title offset x + * @param {number} options.chart.title.offsetY - title offset y + * @param {string | function} options.chart.format - formatter for value + * @param {object} options.yAxis - options for y axis component + * @param {string | object} options.yAxis.title - title text or title object + * @param {string} options.yAxis.title.text - title text + * @param {number} options.yAxis.title.offsetX - title offset x + * @param {number} options.yAxis.title.offsetY - title offset y + * @param {number} options.yAxis.labelMargin - label margin for y axis + * @param {number} options.yAxis.min - minimum value for y axis + * @param {number} options.yAxis.max - maximum value for y axis + * @param {boolean} options.yAxis.rotateTitle - whether rotate title or not (default: true) + * @param {object} options.xAxis - options for x axis component + * @param {string | object} options.xAxis.title - title text or title object + * @param {string} options.xAxis.title.text - title text + * @param {number} options.xAxis.title.offsetX - title offset x + * @param {number} options.xAxis.title.offsetY - title offset y + * @param {number} options.xAxis.labelMargin - label margin for x axis + * @param {number} options.xAxis.labelInterval - label interval for x axis + * @param {boolean} options.xAxis.rotateLabel - whether rotate label or not (default: true) + * @param {string} options.xAxis.tickInterval - tick interval for x axis + * @param {string} options.xAxis.type - type of axis + * @param {string} options.xAxis.dateFormat - date format + * @param {object} options.series - options for series component + * @param {boolean} options.series.showDot - whether show dot or not + * @param {boolean} options.series.showLabel - whether show label or not + * @param {boolean} options.series.allowSelect - whether allow select or not + * @param {boolean} options.series.spline - whether spline or not + * @param {boolean} options.series.zoomable - whether zoomable or not + * @param {boolean} options.series.shifting - whether shifting or not + * @param {object} options.tooltip - options for tooltip component + * @param {string} options.tooltip.suffix - suffix for tooltip + * @param {function} [options.tooltip.template] - template for tooltip + * @param {string} options.tooltip.align - align option for tooltip + * @param {object} options.tooltip.offsetX - tooltip offset x + * @param {object} options.tooltip.offsetY - tooltip offset y + * @param {object} options.tooltip.position - (deprecated) relative position + * @param {number} options.tooltip.position.left - position left + * @param {number} options.tooltip.position.top - position top + * @param {boolean} options.tooltip.grouped - whether group tooltip or not + * @param {object} options.legend - options for legend component + * @param {string} options.legend.align - align option for legend (top|bottom|left) + * @param {boolean} options.legend.showCheckbox - whether show checkbox or not (default: true) + * @param {boolean} options.legend.visible - whether visible or not (default: true) + * @param {number} options.legend.maxWidth - legend name display max width + * @param {object} options.plot - options for plot component + * @param {boolean} options.plot.showLine - whether show line or not (default: true) + * @param {Array} options.plot.bands - plot bands + * @param {Array.} options.plot.bands.range - value range for matching + * @param {string} options.plot.bands.color - band color + * @param {number} options.plot.bands.opacity - band opacity + * @param {Array} options.plot.lines - plot lines + * @param {(string|number|date)} options.plot.lines.value - value for matching + * @param {string} options.plot.lines.color - band color + * @param {number} options.plot.lines.opacity - band opacity + * @param {string} options.theme - theme name + * @param {string} options.libType - type of graph library + * @param {object} options.chartExportMenu - options for exporting + * @param {string} options.chartExportMenu.filename - export file name + * @returns {object} bar chart + * @api + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var container = document.getElementById('container-id'), + * rawData = { + * categories: ['cate1', 'cate2', 'cate3'], + * series: [ + * { + * name: 'Legend1', + * data: [20, 30, 50] + * }, + * { + * name: 'Legend2', + * data: [40, 40, 60] + * }, + * { + * name: 'Legend3', + * data: [60, 50, 10] + * }, + * { + * name: 'Legend4', + * data: [80, 10, 70] + * } + * ] + * }, + * options = { + * chart: { + * title: 'Area Chart' + * }, + * yAxis: { + * title: 'Y Axis' + * }, + * xAxis: { + * title: 'X Axis' + * } + * }; + * chart.areaChart(container, rawData, options); + */ + function areaChart(container, rawData, options) { + return _createChart(container, rawData, options, chartConst.CHART_TYPE_AREA); + } + + /** + * Bubble chart creator. + * @memberof module:chart + * @memberof tui.chart + * @param {HTMLElement} container - chart container + * @param {rawData} rawData - raw data + * @param {Array.} rawData.categories - categories + * @param {Array.} rawData.series - series data + * @param {object} options - chart options + * @param {object} options.chart - base options for chart + * @param {number} options.chart.width - chart width + * @param {number} options.chart.height - chart height + * @param {string | object} options.chart.title - title text or title object + * @param {string} options.chart.title.text - title text + * @param {number} options.chart.title.offsetX - title offset x + * @param {number} options.chart.title.offsetY - title offset y + * @param {string | function} options.chart.format - formatter for value + * @param {object} options.yAxis - options for y axis component + * @param {string | object} options.yAxis.title - title text or title object + * @param {string} options.yAxis.title.text - title text + * @param {number} options.yAxis.title.offsetX - title offset x + * @param {number} options.yAxis.title.offsetY - title offset y + * @param {number} options.yAxis.labelMargin - label margin for y axis + * @param {number} options.yAxis.min - minimum value for y axis + * @param {number} options.yAxis.max - maximum value for y axis + * @param {boolean} options.yAxis.rotateTitle - whether rotate title or not (default: true) + * @param {object} options.xAxis - options for x axis component + * @param {string | object} options.xAxis.title - title text or title object + * @param {string} options.xAxis.title.text - title text + * @param {number} options.xAxis.title.offsetX - title offset x + * @param {number} options.xAxis.title.offsetY - title offset y + * @param {number} options.xAxis.labelMargin - label margin for x axis + * @param {number} options.xAxis.labelInterval - label interval for x axis + * @param {boolean} options.xAxis.rotateLabel - whether rotate label or not (default: true) + * @param {number} options.xAxis.min - minimum value for y axis + * @param {number} options.xAxis.max - maximum value for y axis + * @param {object} options.series - options for series component + * @param {boolean} options.series.showLabel - whether show label or not + * @param {boolean} options.series.allowSelect - whether allow select or not + * @param {object} options.tooltip - options for tooltip component + * @param {string} options.tooltip.suffix - suffix for tooltip + * @param {function} [options.tooltip.template] - template for tooltip + * @param {string} options.tooltip.align - align option for tooltip + * @param {object} options.tooltip.offsetX - tooltip offset x + * @param {object} options.tooltip.offsetY - tooltip offset y + * @param {object} options.tooltip.position - (deprecated) relative position + * @param {number} options.tooltip.position.left - position left + * @param {number} options.tooltip.position.top - position top + * @param {object} options.legend - options for legend component + * @param {string} options.legend.align - align option for legend (top|bottom|left) + * @param {boolean} options.legend.showCheckbox - whether show checkbox or not (default: true) + * @param {boolean} options.legend.visible - whether visible or not (default: true) + * @param {number} options.legend.maxWidth - legend name display max width + * @param {object} options.circleLegend - options for circleLegend + * @param {boolean} options.circleLegend.visible - whether visible or not (default: true) + * @param {object} options.plot - options for plot component + * @param {boolean} options.plot.showLine - whether show line or not (default: true) + * @param {string} options.theme - theme name + * @param {string} options.libType - type of graph library + * @param {object} options.chartExportMenu - options for exporting + * @param {string} options.chartExportMenu.filename - export file name + * @returns {object} bubble chart + * @api + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var container = document.getElementById('container-id'), + * rawData = { + * series: [ + * { + * name: 'Legend1', + * data: [{ + * x: 10, + * y: 20, + * r: 15, + * label: 'Lable1' + * }, { + * x: 20, + * y: 40, + * r: 10, + * label: 'Lable2' + * }] + * }, + * { + * name: 'Legend2', + * data: [{ + * x: 40, + * y: 10, + * r: 5, + * label: 'Lable3' + * }, { + * x: 30, + * y: 40, + * r: 8, + * label: 'Lable4' + * }] + * } + * ] + * }, + * options = { + * chart: { + * title: 'Bubble Chart' + * }, + * yAxis: { + * title: 'Y Axis' + * }, + * xAxis: { + * title: 'X Axis' + * } + * }; + * chart.bubbleChart(container, rawData, options); + */ + function bubbleChart(container, rawData, options) { + return _createChart(container, rawData, options, chartConst.CHART_TYPE_BUBBLE); + } + + /** + * Scatter chart creator. + * @memberof module:chart + * @memberof tui.chart + * @param {HTMLElement} container - chart container + * @param {rawData} rawData - raw data + * @param {Array.} rawData.categories - categories + * @param {Array.} rawData.series - series data + * @param {object} options - chart options + * @param {object} options.chart - base options for chart + * @param {number} options.chart.width - chart width + * @param {number} options.chart.height - chart height + * @param {string | object} options.chart.title - title text or title object + * @param {string} options.chart.title.text - title text + * @param {number} options.chart.title.offsetX - title offset x + * @param {number} options.chart.title.offsetY - title offset y + * @param {string | function} options.chart.format - formatter for value + * @param {object} options.yAxis - options for y axis component + * @param {string | object} options.yAxis.title - title text or title object + * @param {string} options.yAxis.title.text - title text + * @param {number} options.yAxis.title.offsetX - title offset x + * @param {number} options.yAxis.title.offsetY - title offset y + * @param {number} options.yAxis.labelMargin - label margin for y axis + * @param {number} options.yAxis.min - minimum value for y axis + * @param {number} options.yAxis.max - maximum value for y axis + * @param {boolean} options.yAxis.rotateTitle - whether rotate title or not (default: true) + * @param {object} options.xAxis - options for x axis component + * @param {string | object} options.xAxis.title - title text or title object + * @param {string} options.xAxis.title.text - title text + * @param {number} options.xAxis.title.offsetX - title offset x + * @param {number} options.xAxis.title.offsetY - title offset y + * @param {number} options.xAxis.labelMargin - label margin for x axis + * @param {number} options.xAxis.min - minimum value for y axis + * @param {number} options.xAxis.max - maximum value for y axis + * @param {object} options.series - options for series component + * @param {boolean} options.series.showLabel - whether show label or not + * @param {boolean} options.series.allowSelect - whether allow select or not + * @param {object} options.tooltip - options for tooltip component + * @param {string} options.tooltip.suffix - suffix for tooltip + * @param {function} [options.tooltip.template] - template for tooltip + * @param {string} options.tooltip.align - align option for tooltip + * @param {object} options.tooltip.offsetX - tooltip offset x + * @param {object} options.tooltip.offsetY - tooltip offset y + * @param {object} options.tooltip.position - (deprecated) relative position + * @param {number} options.tooltip.position.left - position left + * @param {number} options.tooltip.position.top - position top + * @param {object} options.legend - options for legend component + * @param {string} options.legend.align - align option for legend (top|bottom|left) + * @param {boolean} options.legend.showCheckbox - whether show checkbox or not (default: true) + * @param {boolean} options.legend.visible - whether visible or not (default: true) + * @param {number} options.legend.maxWidth - legend name display max width + * @param {object} options.plot - options for plot component + * @param {boolean} options.plot.showLine - whether show line or not (default: true) + * @param {string} options.theme - theme name + * @param {string} options.libType - type of graph library + * @param {object} options.chartExportMenu - options for exporting + * @param {string} options.chartExportMenu.filename - export file name + * @returns {object} scatter chart + * @api + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var container = document.getElementById('container-id'), + * rawData = { + * series: [ + * { + * name: 'Legend1', + * data: [{ + * x: 10, + * y: 20 + * }, { + * x: 20, + * y: 40 + * }] + * }, + * { + * name: 'Legend2', + * data: [{ + * x: 40, + * y: 10 + * }, { + * x: 30, + * y: 40 + * }] + * } + * ] + * }, + * options = { + * chart: { + * title: 'Scatter Chart' + * }, + * yAxis: { + * title: 'Y Axis' + * }, + * xAxis: { + * title: 'X Axis' + * } + * }; + * chart.scatterChart(container, rawData, options); + */ + function scatterChart(container, rawData, options) { + return _createChart(container, rawData, options, chartConst.CHART_TYPE_SCATTER); + } + + /** + * Heatmap chart creator. + * @memberof module:chart + * @memberof tui.chart + * @param {HTMLElement} container - chart container + * @param {rawData} rawData - raw data + * @param {{x: Array., y: Array.}} rawData.categories - categories + * @param {Array.>} rawData.series - series data + * @param {object} options - chart options + * @param {object} options.chart - base options for chart + * @param {number} options.chart.width - chart width + * @param {number} options.chart.height - chart height + * @param {string | object} options.chart.title - title text or title object + * @param {string} options.chart.title.text - title text + * @param {number} options.chart.title.offsetX - title offset x + * @param {number} options.chart.title.offsetY - title offset y + * @param {string | function} options.chart.format - formatter for value + * @param {object} options.yAxis - options for y axis component + * @param {string | object} options.yAxis.title - title text or title object + * @param {string} options.yAxis.title.text - title text + * @param {number} options.yAxis.title.offsetX - title offset x + * @param {number} options.yAxis.title.offsetY - title offset y + * @param {number} options.yAxis.labelMargin - label margin for y axis + * @param {boolean} options.yAxis.rotateTitle - whether rotate title or not (default: true) + * @param {object} options.xAxis - options for x axis component + * @param {string | object} options.xAxis.title - title text or title object + * @param {string} options.xAxis.title.text - title text + * @param {number} options.xAxis.title.offsetX - title offset x + * @param {number} options.xAxis.title.offsetY - title offset y + * @param {number} options.xAxis.labelMargin - label margin for x axis + * @param {object} options.series - options for series component + * @param {boolean} options.series.showLabel - whether show label or not + * @param {object} options.tooltip - options for tooltip component + * @param {string} options.tooltip.suffix - suffix for tooltip + * @param {function} [options.tooltip.template] - template for tooltip + * @param {string} options.tooltip.align - align option for tooltip + * @param {object} options.tooltip.offsetX - tooltip offset x + * @param {object} options.tooltip.offsetY - tooltip offset y + * @param {object} options.tooltip.position - (deprecated) relative position + * @param {number} options.tooltip.position.left - position left + * @param {number} options.tooltip.position.top - position top + * @param {object} options.legend - options for legend component + * @param {string} options.legend.align - align option for legend (top|bottom|left) + * @param {boolean} options.legend.visible - whether visible or not (default: true) + * @param {number} options.legend.maxWidth - legend name display max width + * @param {string} options.theme - theme name + * @param {string} options.libType - type of graph library + * @param {object} options.chartExportMenu - options for exporting + * @param {string} options.chartExportMenu.filename - export file name + * @returns {object} scatter chart + * @api + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var container = document.getElementById('container-id'), + * rawData = { + * categories: { + * x: [10, 20, 30, 40, 50], + * y: [1, 2, 3, 4, 5, 6] + * }, + * series: [ + * [10, 20, 30, 40, 50], + * [1, 4, 6, 7, 8], + * [20, 4, 5, 70, 8], + * [100, 40, 30, 80, 30], + * [20, 10, 60, 90, 20], + * [50, 40, 30, 20, 10] + * ] + * }, + * options = { + * chart: { + * title: 'Heatmap Chart' + * }, + * yAxis: { + * title: 'Y Axis' + * }, + * xAxis: { + * title: 'X Axis' + * } + * }; + * chart.heatmapChart(container, rawData, options); + */ + function heatmapChart(container, rawData, options) { + return _createChart(container, rawData, options, chartConst.CHART_TYPE_HEATMAP); + } + + /** + * Treemap chart creator. + * @memberof module:chart + * @memberof tui.chart + * @param {HTMLElement} container - chart container + * @param {rawData} rawData - raw data + * @param {Array.>} rawData.series - series data + * @param {object} options - chart options + * @param {object} options.chart - base options for chart + * @param {number} options.chart.width - chart width + * @param {number} options.chart.height - chart height + * @param {string | object} options.chart.title - title text or title object + * @param {string} options.chart.title.text - title text + * @param {number} options.chart.title.offsetX - title offset x + * @param {number} options.chart.title.offsetY - title offset y + * @param {string | function} options.chart.format - formatter for value + * @param {object} options.series - options for series component + * @param {boolean} options.series.showLabel - whether show label or not + * @param {boolean} options.series.useColorValue - whether use colorValue or not + * @param {boolean} options.series.zoomable - whether zoomable or not + * @param {boolean} options.series.useLeafLabel - whether use leaf label or not + * @param {object} options.tooltip - options for tooltip component + * @param {string} options.tooltip.suffix - suffix for tooltip + * @param {function} [options.tooltip.template] - template for tooltip + * @param {object} options.tooltip.offsetX - tooltip offset x + * @param {object} options.tooltip.offsetY - tooltip offset y + * @param {object} options.tooltip.position - (deprecated) relative position + * @param {number} options.tooltip.position.left - position left + * @param {number} options.tooltip.position.top - position top + * @param {object} options.legend - options for legend component + * @param {string} options.legend.align - align option for legend (top|bottom|left) + * @param {boolean} options.legend.visible - whether visible or not (default: true) + * @param {number} options.legend.maxWidth - legend name display max width + * @param {string} options.theme - theme name + * @param {string} options.libType - type of graph library + * @param {object} options.chartExportMenu - options for exporting + * @param {string} options.chartExportMenu.filename - export file name + * @returns {object} scatter chart + * @api + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var container = document.getElementById('container-id'), + * rawData = { + * series: [ + * { + * label: 'label1', + * value: 6 + * }, + * { + * label: 'label2', + * value: 6 + * }, + * { + * label: 'label3', + * value: 4 + * }, + * { + * label: 'label4', + * value: 3 + * }, + * { + * label: 'label5', + * value: 2 + * }, + * { + * label: 'label6', + * value: 2 + * }, + * { + * label: 'label7', + * value: 1 + * } + * ], + * options = { + * chart: { + * title: 'Treemap Chart' + * } + * }; + * chart.treemapChart(container, rawData, options); + */ + function treemapChart(container, rawData, options) { + return _createChart(container, rawData, options, chartConst.CHART_TYPE_TREEMAP); + } + + /** + * Combo chart creator. + * @memberof module:chart + * @memberof tui.chart + * @param {HTMLElement} container - chart container + * @param {rawData} rawData - raw data + * @param {Array.} rawData.categories - categories + * @param {Array.} rawData.series - series data + * @param {object} options - chart options + * @param {object} options.chart - base options for chart + * @param {number} options.chart.width - chart width + * @param {number} options.chart.height - chart height + * @param {string | object} options.chart.title - title text or title object + * @param {string} options.chart.title.text - title text + * @param {number} options.chart.title.offsetX - title offset x + * @param {number} options.chart.title.offsetY - title offset y + * @param {string | function} options.chart.format - formatter for value + * @param {object|Array} options.yAxis - options for y axis component + * @param {string | object} options.yAxis.title - title text or title object + * @param {string} options.yAxis.title.text - title text + * @param {number} options.yAxis.title.offsetX - title offset x + * @param {number} options.yAxis.title.offsetY - title offset y + * @param {number} options.yAxis.labelMargin - label margin for y axis + * @param {number} options.yAxis.min - minimum value for y axis + * @param {number} options.yAxis.max - maximum value for y axis + * @param {boolean} options.yAxis.rotateTitle - whether rotate title or not (default: true) + * @param {object} options.xAxis - options for x axis component + * @param {string | object} options.xAxis.title - title text or title object + * @param {string} options.xAxis.title.text - title text + * @param {number} options.xAxis.title.offsetX - title offset x + * @param {number} options.xAxis.title.offsetY - title offset y + * @param {number} options.xAxis.labelMargin - label margin for x axis + * @param {number} options.xAxis.labelInterval - label interval for x axis + * @param {boolean} options.xAxis.rotateLabel - whether rotate label or not (default: true) + * @param {object} options.series - options for series component + * @param {?object} options.series.column - options for column series component + * @param {string} options.series.column.stackType - type of stack + * @param {boolean} options.series.column.showLabel - whether show label or not + * @param {number} options.series.column.barWidth - bar width + * @param {?object} options.series.line - options for line series component + * @param {boolean} options.series.line.showDot - whether show dot or not + * @param {boolean} options.series.line.showLabel - whether show label or not + * @param {boolean} options.series.line.spline - whether spline or not + * @param {?object} options.series.area - options for line series component + * @param {boolean} options.series.area.showDot - whether show dot or not + * @param {boolean} options.series.area.showLabel - whether show label or not + * @param {boolean} options.series.area.spline - whether spline or not + * @param {?object} options.series.pie - options for pie series component + * @param {boolean} options.series.pie.showLabel - whether show label or not + * @param {number} options.series.pie.radiusRatio - ratio of radius for pie graph + * @param {boolean} options.series.pie.startAngle - start angle + * @param {boolean} options.series.pie.endAngle - end angle + * @param {boolean} options.series.showDot - whether show dot or not + * @param {boolean} options.series.showLabel - whether show label or not + * @param {boolean} options.series.allowSelect - whether allow select or not + * @param {boolean} options.series.spline - whether spline or not + * @param {boolean} options.series.zoomable - whether zoomable or not + * @param {boolean} options.series.shifting - whether shifting or not + * @param {object} options.tooltip - options for tooltip component + * @param {object} options.tooltip.column - options for column tooltip + * @param {string} options.tooltip.column.suffix - suffix for tooltip + * @param {function} [options.tooltip.column.template] template of tooltip + * @param {string} options.tooltip.column.align - align option for tooltip + * @param {number} options.tooltip.column.offsetX - tooltip offset x + * @param {number} options.tooltip.column.offsetY - tooltip offset y + * @param {object} options.tooltip.column.position - (deprecated) relative position + * @param {number} options.tooltip.position.left - position left + * @param {number} options.tooltip.position.top - position top + * @param {boolean} options.tooltip.grouped - whether group tooltip or not + * @param {object} options.legend - options for legend component + * @param {string} options.legend.align - align option for legend (top|bottom|left) + * @param {boolean} options.legend.showCheckbox - whether show checkbox or not (default: true) + * @param {boolean} options.legend.visible - whether visible or not (default: true) + * @param {number} options.legend.maxWidth - legend name display max width + * @param {object} options.plot - options for plot component + * @param {boolean} options.plot.showLine - whether show line or not (default: true) + * @param {Array} options.plot.bands - plot bands for line & area combo chart + * @param {Array.} options.plot.bands.range - value range for matching + * @param {string} options.plot.bands.color - band color + * @param {number} options.plot.bands.opacity - band opacity + * @param {Array} options.plot.lines - plot lines + * @param {(string|number|date)} options.plot.lines.value - value for matching + * @param {string} options.plot.lines.color - band color + * @param {number} options.plot.lines.opacity - band opacity + * @param {string} options.theme - theme name + * @param {string} options.libType - type of graph library + * @param {object} options.chartExportMenu - options for exporting + * @param {string} options.chartExportMenu.filename - export file name + * @returns {object} bar chart + * @api + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var container = document.getElementById('container-id'), + * rawData = { + * categories: ['cate1', 'cate2', 'cate3'], + * series: { + * column: [ + * { + * name: 'Legend1', + * data: [20, 30, 50]] + * }, + * { + * name: 'Legend2', + * data: [40, 40, 60] + * }, + * { + * name: 'Legend3', + * data: [60, 50, 10] + * }, + * { + * name: 'Legend4', + * data: [80, 10, 70] + * } + * }, + * line: [ + * { + * name: 'Legend5', + * data: [1, 2, 3] + * } + * ] + * } + * }, + * options = { + * chart: { + * title: 'Combo Chart' + * }, + * yAxis:[ + * { + * title: 'Y Axis', + * chartType: 'line' + * }, + * { + * title: 'Y Right Axis' + * } + * ], + * xAxis: { + * title: 'X Axis' + * }, + * series: { + * showDot: true + * } + * }; + * chart.comboChart(container, rawData, options); + */ + function comboChart(container, rawData, options) { + return _createChart(container, rawData, options, chartConst.CHART_TYPE_COMBO); + } + + /** + * Pie chart creator. + * @memberof module:chart + * @memberof tui.chart + * @param {HTMLElement} container - chart container + * @param {rawData} rawData - raw data + * @param {Array.} rawData.series - series data + * @param {object} options - chart options + * @param {object} options.chart - base options for chart + * @param {number} options.chart.width - chart width + * @param {number} options.chart.height - chart height + * @param {string | object} options.chart.title - title text or title object + * @param {string} options.chart.title.text - title text + * @param {number} options.chart.title.offsetX - title offset x + * @param {number} options.chart.title.offsetY - title offset y + * @param {string | function} options.chart.format - formatter for value + * @param {object} options.series - options for series component + * @param {boolean} options.series.showLabel - whether show label or not + * @param {number} options.series.radiusRatio - ratio of radius for pie graph + * @param {boolean} options.series.allowSelect - whether allow select or not + * @param {boolean} options.series.startAngle - start angle + * @param {boolean} options.series.endAngle - end angle + * @param {object} options.tooltip - options for tooltip component + * @param {string} options.tooltip.suffix - suffix for tooltip + * @param {function} [options.tooltip.template] - template for tooltip + * @param {string} options.tooltip.align - align option for tooltip + * @param {object} options.tooltip.offset - tooltip offset + * @param {number} options.tooltip.offset.x - offset x + * @param {number} options.tooltip.offset.y - offset y + * @param {object} options.tooltip.position - (deprecated) relative position + * @param {number} options.tooltip.position.left - position left + * @param {number} options.tooltip.position.top - position top + * @param {object} options.legend - options for legend component + * @param {string} options.legend.align - align option for legend (top|bottom|left|center|outer) + * @param {boolean} options.legend.showCheckbox - whether show checkbox or not (default: true) + * @param {boolean} options.legend.visible - whether visible or not (default: true) + * @param {number} options.legend.maxWidth - legend name display max width + * @param {string} options.theme - theme name + * @param {string} options.libType - type of graph library + * @param {object} options.chartExportMenu - options for exporting + * @param {string} options.chartExportMenu.filename - export file name + * @returns {object} bar chart + * @api + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var container = document.getElementById('container-id'), + * rawData = { + * series: [ + * { + * name: 'Legend1', + * data: 20 + * }, + * { + * name: 'Legend2', + * data: 40 + * }, + * { + * name: 'Legend3', + * data: 60 + * }, + * { + * name: 'Legend4', + * data: 80 + * } + * ] + * }, + * options = { + * chart: { + * title: 'Pie Chart' + * } + * }; + * chart.pieChart(container, rawData, options); + */ + function pieChart(container, rawData, options) { + return _createChart(container, rawData, options, chartConst.CHART_TYPE_PIE); + } + + /** + * Map chart creator. + * @memberof module:chart + * @memberof tui.chart + * @param {HTMLElement} container - chart container + * @param {rawData} rawData chart data + * @param {Array.} rawData.series - series data + * @param {object} options - chart options + * @param {object} options.chart - base options for chart + * @param {number} options.chart.width - chart width + * @param {number} options.chart.height - chart height + * @param {string | object} options.chart.title - title text or title object + * @param {string} options.chart.title.text - title text + * @param {number} options.chart.title.offsetX - title offset x + * @param {number} options.chart.title.offsetY - title offset y + * @param {string | function} options.chart.format - formatter for value + * @param {object} options.series - options for series component + * @param {boolean} options.series.showLabel - whether show label or not + * @param {object} options.tooltip - options for tooltip component + * @param {string} options.tooltip.suffix - suffix for tooltip + * @param {function} [options.tooltip.template] - template for tooltip + * @param {string} options.tooltip.align - align option for tooltip + * @param {object} options.tooltip.offset - tooltip offset + * @param {number} options.tooltip.offset.x - offset x + * @param {number} options.tooltip.offset.y - offset y + * @param {object} options.tooltip.position - (deprecated) relative position + * @param {number} options.tooltip.position.left - position left + * @param {number} options.tooltip.position.top - position top + * @param {object} options.legend - options for legend component + * @param {string} options.legend.align - align option for legend (top|bottom|left|center|outer) + * @param {string} options.theme - theme name + * @param {string} options.map map type + * @param {string} options.libType - type of graph library + * @param {object} options.chartExportMenu - options for exporting + * @param {string} options.chartExportMenu.filename - export file name + * @returns {object} bar chart + * @api + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var container = document.getElementById('container-id'), + * rawData = { + * series: [ + * { + * code: 'KR', + * data: 100, + * labelCoordinate: { + * x: 0.6, + * y: 0.7 + * } + * }, + * { + * code: 'JP', + * data: 50 + * } + * ] + * }, + * options = { + * chart: { + * title: 'Map Chart' + * }, + * map: 'world' + * }; + * chart.mapChart(container, rawData, options); + */ + function mapChart(container, rawData, options) { + return _createChart(container, rawData, options, chartConst.CHART_TYPE_MAP); + } + + /** + * radial chart creator. + * @memberof module:chart + * @memberof tui.chart + * @param {HTMLElement} container - chart container + * @param {rawData} rawData - raw data + * @param {Array.} rawData.series - series data + * @param {object} options - chart options + * @param {object} options.chart - base options for chart + * @param {number} options.chart.width - chart width + * @param {number} options.chart.height - chart height + * @param {string | object} options.chart.title - title text or title object + * @param {string} options.chart.title.text - title text + * @param {number} options.chart.title.offsetX - title offset x + * @param {number} options.chart.title.offsetY - title offset y + * @param {string | function} options.chart.format - formatter for value + * @param {object} options.series - options for series component + * @param {boolean} options.series.showDot - show dot or not (default: true) + * @param {boolean} options.series.showArea - show area or not (default: true) + * @param {object} options.plot - options for plot component + * @param {boolean} options.plot.type - "spiderweb" or "circle" (default: "spiderweb") + * @param {object|Array} options.yAxis - options for y axis component + * @param {number} options.yAxis.min - minimum value for y axis + * @param {number} options.yAxis.max - maximum value for y axis + * @param {object} options.tooltip - options for tooltip component + * @param {string} options.tooltip.suffix - suffix for tooltip + * @param {function} [options.tooltip.template] - template for tooltip + * @param {string} options.tooltip.align - align option for tooltip + * @param {object} options.tooltip.offset - tooltip offset + * @param {number} options.tooltip.offset.x - offset x + * @param {number} options.tooltip.offset.y - offset y + * @param {object} options.tooltip.position - (deprecated) relative position + * @param {number} options.tooltip.position.left - position left + * @param {number} options.tooltip.position.top - position top + * @param {object} options.legend - options for legend component + * @param {string} options.legend.align - align option for legend (top|bottom|left|center|outer) + * @param {boolean} options.legend.showCheckbox - whether show checkbox or not (default: true) + * @param {boolean} options.legend.visible - whether visible or not (default: true) + * @param {number} options.legend.maxWidth - legend name display max width + * @param {string} options.theme - theme name + * @param {string} options.libType - type of graph library + * @param {object} options.chartExportMenu - options for exporting + * @param {string} options.chartExportMenu.filename - export file name + * @returns {object} bar chart + * @api + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var container = document.getElementById('chart-area'), + * rawData = { + * categories: ["June", "July", "Aug", "Sep", "Oct", "Nov"], + * series: [ + * { + * name: 'Budget', + * data: [5000, 3000, 5000, 7000, 6000, 4000] + * }, + * { + * name: 'Income', + * data: [8000, 8000, 7000, 2000, 5000, 3000] + * }, + * { + * name: 'Expenses', + * data: [4000, 4000, 6000, 3000, 4000, 5000] + * }, + * { + * name: 'Debt', + * data: [6000, 3000, 3000, 1000, 2000, 4000] + * } + * ] + * }, + * options = { + * chart: { + * width: 600, + * height: 400 + * }, + * series: { + * showDot: true, + * showArea: true + * }, + * plot: { + * type: 'circle' + * }, + * yAxis: { + * min: 0, + * max: 9000 + * } + * }; + * chart.radialChart(container, rawData, options); + * + */ + function radialChart(container, rawData, options) { + return _createChart(container, rawData, options, chartConst.CHART_TYPE_RADIAL); + } + + /** + * Boxplot chart creator. + * @memberof module:chart + * @memberof tui.chart + * @param {HTMLElement} container - chart container + * @param {rawData} rawData chart data + * @param {object} options - chart options + * @returns {object} box plot chart + * @api + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var container = document.getElementById('container-id'), + * var rawData = { + * categories: ['Budget', 'Income', 'Expenses', 'Debt'], + * series: [{ + * name: '2015', + * data: [ + * [1000, 2500, 3714, 5500, 7000], + * [1000, 2250, 3142, 4750, 6000] + * ], + * outliers: [ + * [0, 14000] + * ] + * }, { + * name: '2016', + * data: [ + * [2000, 4500, 6714, 11500, 13000], + * [7000, 9250, 10142, 11750, 12000] + * ], + * outliers: [ + * [1, 14000] + * ] + * }]; + * }; + * var options = { + * chart: { + * width: 600, + * height: 400 + * }, + * series: { + * showDot: true, + * showArea: true + * }, + * plot: { + * type: 'circle' + * }, + * yAxis: { + * min: 0, + * max: 9000 + * } + * }; + * chart.boxplotChart(container, rawData, options); + */ + function boxplotChart(container, rawData, options) { + return _createChart(container, rawData, options, chartConst.CHART_TYPE_BOXPLOT); + } + + /** + * Bullet chart creator. + * @memberof module:chart + * @memberof tui.chart + * @param {HTMLElement} container - chart container + * @param {rawData} rawData chart data + * @param {object} options - chart options + * @returns {object} box plot chart + * @api + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var container = document.getElementById('chart-area'); + * var data = { + * categories: ['July', 'August'], + * series: [{ + * name: 'Budget', + * data: 25, + * markers: [28, 2, 15], + * ranges: [[-1, 10], [10, 20], [20, 30]] + * },{ + * name: 'Hello', + * data: 11, + * markers: [20], + * ranges: [[0, 8], [8, 15]] + * }] + * }; + * var options = { + * chart: { + * width: 700, + * height: 300, + * title: 'Monthly Revenue' + * }, + * series: { + * showLabel: true, + * vertical: false + * } + * }; + * chart.bulletChart(container, data, options); + */ + function bulletChart(container, rawData, options) { + return _createChart(container, rawData, options, chartConst.CHART_TYPE_BULLET); + } + + /** + * Register theme. + * @memberof tui.chart + * @param {string} themeName - theme name + * @param {object} theme - application chart theme + * @param {object} theme.chart - chart theme + * @param {string} theme.chart.fontFamily - font family for chart + * @param {string} theme.chart.background - background for chart + * @param {object} theme.title - chart title theme + * @param {number} theme.title.fontSize - font size + * @param {string} theme.title.fontFamily - font family + * @param {string} theme.title.fontWeight - font weight + * @param {string} theme.title.color - font color + * @param {string} theme.title.background - background + * @param {object} theme.yAxis - y axis theme + * @param {object} theme.yAxis.title - theme for y axis title + * @param {number} theme.yAxis.title.fontSize - font size + * @param {string} theme.yAxis.title.fontFamily - font family + * @param {string} theme.yAxis.title.fontWeight - font weight + * @param {string} theme.yAxis.title.color - font color + * @param {object} theme.yAxis.label - theme for y axis label + * @param {number} theme.yAxis.label.fontSize - font size + * @param {string} theme.yAxis.label.fontFamily - font family + * @param {string} theme.yAxis.label.fontWeight - font weight + * @param {string} theme.yAxis.label.color - font color + * @param {string} theme.yAxis.tickColor - color for y axis tick + * @param {object} theme.xAxis - theme for x axis + * @param {object} theme.xAxis.title - theme for x axis title + * @param {number} theme.xAxis.title.fontSize - font size + * @param {string} theme.xAxis.title.fontFamily - font family + * @param {string} theme.xAxis.title.fontWeight - font weight + * @param {string} theme.xAxis.title.color - font color + * @param {object} theme.xAxis.label - theme for x axis label + * @param {number} theme.xAxis.label.fontSize - font size + * @param {string} theme.xAxis.label.fontFamily - font family + * @param {string} theme.xAxis.label.fontWeight - font weight + * @param {string} theme.xAxis.label.color - font color + * @param {string} theme.xAxis.tickColor - color for x axis tick + * @param {object} theme.plot - theme for plot + * @param {string} theme.plot.lineColor - line color + * @param {string} theme.plot.background - background + * @param {object} theme.series theme for series + * @param {Array.} theme.series.colors - colors + * @param {string} theme.series.borderColor - border color + * @param {string} theme.series.selectionColor - selection color + * @param {string} theme.series.startColor - start color + * @param {string} theme.series.endColor - end color + * @param {string} theme.series.overColor - over color + * @param {object} theme.legend - theme for legend + * @param {object} theme.legend.label - theme for legend label + * @param {number} theme.legend.label.fontSize - font size + * @param {string} theme.legend.label.fontFamily - font family + * @param {string} theme.legend.label.fontWeight - font family + * @param {string} theme.legend.label.color - font color + * @api + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var theme = { + * yAxis: { + * tickColor: '#ccbd9a', + * title: { + * color: '#333333' + * }, + * label: { + * color: '#6f491d' + * } + * }, + * xAxis: { + * tickColor: '#ccbd9a', + * title: { + * color: '#333333' + * }, + * label: { + * color: '#6f491d' + * } + * }, + * plot: { + * lineColor: '#e5dbc4', + * background: '#f6f1e5' + * }, + * series: { + * colors: ['#40abb4', '#e78a31', '#c1c452', '#795224', '#f5f5f5'], + * borderColor: '#8e6535', + * selectionColor: '#cccccc', + * startColor: '#efefef', + * endColor: 'blue', + * overColor: 'yellow' + * }, + * legend: { + * label: { + * color: '#6f491d' + * } + * } + * }; + * chart.registerTheme('newTheme', theme); + */ + function registerTheme(themeName, theme) { + themeManager.register(themeName, theme); + } + + /** + * Register map. + * @memberof tui.chart + * @param {string} mapName map name + * @param {Array.<{code: string, name: string, path: string}>} data map data + * @api + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var data = [ + * { + * code: 'KR', + * name: 'South Korea', + * path: 'M835.13,346.53L837.55,350.71...', + * labelCoordinate: { + * x: 0.6, + * y: 0.7 + * } + * }, + * //... + * ]; + * chart.registerMap('newMap', data); + */ + function registerMap(mapName, data) { + mapManager.register(mapName, data); + } + + /** + * Register graph plugin. + * @memberof tui.chart + * @param {string} libType type of graph library + * @param {object} plugin plugin to control library + * @param {function} getPaperCallback callback function for getting paper + * @example + * var chart = tui.chart; // or require('tui-chart'); + * var pluginRaphael = { + * bar: function() {} // Render class + * }; + * tui.chart.registerPlugin('raphael', pluginRaphael); + */ + function registerPlugin(libType, plugin, getPaperCallback) { + pluginFactory.register(libType, plugin); + drawingToolPicker.addRendererType(libType, getPaperCallback); + } + + module.exports = { + barChart: barChart, + columnChart: columnChart, + lineChart: lineChart, + areaChart: areaChart, + bubbleChart: bubbleChart, + scatterChart: scatterChart, + heatmapChart: heatmapChart, + treemapChart: treemapChart, + comboChart: comboChart, + pieChart: pieChart, + mapChart: mapChart, + radialChart: radialChart, + boxplotChart: boxplotChart, + bulletChart: bulletChart, + registerTheme: registerTheme, + registerMap: registerMap, + registerPlugin: registerPlugin + }; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Chart factory play role register chart. + * Also, you can get chart from this factory. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var rawDataHandler = __webpack_require__(31); + var predicate = __webpack_require__(11); + + var charts = {}; + var factory = { + /** + * Find key for getting chart. + * @param {string} chartType - type of chart + * @param {{seriesAlias: ?object, series: object.}} rawData - raw data + * @returns {string} + * @private + */ + _findKey: function(chartType, rawData) { + var key = null; + var chartTypeMap; + + if (predicate.isComboChart(chartType)) { + chartTypeMap = rawDataHandler.getChartTypeMap(rawData); + + if (chartTypeMap[chartConst.CHART_TYPE_COLUMN] && chartTypeMap[chartConst.CHART_TYPE_LINE]) { + key = chartConst.CHART_TYPE_COLUMN_LINE_COMBO; + } else if (chartTypeMap[chartConst.CHART_TYPE_LINE] && chartTypeMap[chartConst.CHART_TYPE_SCATTER]) { + key = chartConst.CHART_TYPE_LINE_SCATTER_COMBO; + } else if (chartTypeMap[chartConst.CHART_TYPE_AREA] && chartTypeMap[chartConst.CHART_TYPE_LINE]) { + key = chartConst.CHART_TYPE_LINE_AREA_COMBO; + } else if (chartTypeMap[chartConst.CHART_TYPE_PIE]) { + key = chartConst.CHART_TYPE_PIE_DONUT_COMBO; + } + } else { + key = chartType; + } + + return key; + }, + + /** + * Get chart instance. + * @param {string} chartType chart type + * @param {object} rawData chart data + * @param {object} theme chart options + * @param {object} options chart options + * @returns {object} chart instance; + */ + get: function(chartType, rawData, theme, options) { + var key = this._findKey(chartType, rawData); + var Chart = charts[key]; + var chart; + + if (!Chart) { + throw new Error('Not exist ' + chartType + ' chart.'); + } + + chart = new Chart(rawData, theme, options); + + return chart; + }, + + /** + * Register chart. + * @param {string} chartType char type + * @param {class} ChartClass chart class + */ + register: function(chartType, ChartClass) { + charts[chartType] = ChartClass; + } + }; + + module.exports = factory; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Raw data handler. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var arrayUtil = __webpack_require__(10); + var snippet = __webpack_require__(6); + + /** + * Raw data Handler. + * @module rawDataHandler + * @private */ + var rawDataHandler = { + /** + * Pick stacks. + * @param {Array.<{stack: string}>} seriesData - raw series data + * @param {boolean} [divergingOption] - diverging option + * @returns {Array.} stacks + */ + pickStacks: function(seriesData, divergingOption) { + var stacks, uniqStacks, filteredStack; + + stacks = snippet.map(seriesData, function(seriesDatum) { + return seriesDatum.stack; + }); + + uniqStacks = arrayUtil.unique(stacks); + + if (divergingOption) { + uniqStacks = uniqStacks.slice(0, 2); + } + + filteredStack = snippet.filter(uniqStacks, function(stack) { + return !!stack; + }); + + if (filteredStack.length < uniqStacks.length) { + filteredStack.push(chartConst.DEFAULT_STACK); + } + + return filteredStack; + }, + + /** + * Sort series data from stacks. + * @param {Array.<{stack: ?string}>} seriesData series data + * @param {Array.} stacks stacks + * @returns {Array} + * @private + */ + _sortSeriesData: function(seriesData, stacks) { + var newSeriesData = []; + + if (!stacks) { + stacks = this.pickStacks(seriesData); + } + + snippet.forEachArray(stacks, function(stack) { + var filtered = snippet.filter(seriesData, function(datum) { + return (datum.stack || chartConst.DEFAULT_STACK) === stack; + }); + newSeriesData = newSeriesData.concat(filtered); + }); + + return newSeriesData; + }, + + /** + * Remove stack of series data. + * @param {Array.<{stack: ?string}>} seriesData series data + */ + removeSeriesStack: function(seriesData) { + snippet.forEachArray(seriesData, function(datum) { + delete datum.stack; + }); + }, + + /** + * Find char type from chart name. + * @param {object.} seriesAlias - alias map + * @param {string} seriesType - series name + * @returns {*} + */ + findChartType: function(seriesAlias, seriesType) { + var chartType; + + if (seriesAlias) { + chartType = seriesAlias[seriesType]; + } + + return chartType || seriesType; + }, + + /** + * Get chart type map. + * @param {{series: (Array | object)}} rawData - raw data + * @returns {object.} + */ + getChartTypeMap: function(rawData) { + var self = this; + var chartTypeMap = {}; + + if (snippet.isObject(rawData.series)) { + snippet.forEach(rawData.series, function(data, seriesType) { + chartTypeMap[self.findChartType(rawData.seriesAlias, seriesType)] = true; + }); + } + + return chartTypeMap; + }, + + /** + * Create minus values. + * @param {Array.} data number data + * @returns {Array} minus values + * @private + */ + _createMinusValues: function(data) { + return snippet.map(data, function(value) { + return value < 0 ? 0 : -value; + }); + }, + + /** + * Create plus values. + * @param {Array.} data number data + * @returns {Array} plus values + * @private + */ + _createPlusValues: function(data) { + return snippet.map(data, function(value) { + return value < 0 ? 0 : value; + }); + }, + + /** + * Make normal diverging raw series data. + * @param {{data: Array.}} rawSeriesData raw series data + * @returns {{data: Array.}} changed raw series data + * @private + */ + _makeNormalDivergingRawSeriesData: function(rawSeriesData) { + rawSeriesData.length = Math.min(rawSeriesData.length, 2); + + rawSeriesData[0].data = this._createMinusValues(rawSeriesData[0].data); + + if (rawSeriesData[1]) { + rawSeriesData[1].data = this._createPlusValues(rawSeriesData[1].data); + } + + return rawSeriesData; + }, + + /** + * Make raw series data for stacked diverging option. + * @param {{data: Array., stack: string}} rawSeriesData raw series data + * @returns {{data: Array.}} changed raw series data + * @private + */ + _makeRawSeriesDataForStackedDiverging: function(rawSeriesData) { + var self = this; + var stacks = this.pickStacks(rawSeriesData, true); + var result = []; + var leftStack = stacks[0]; + var rightStack = stacks[1]; + + rawSeriesData = this._sortSeriesData(rawSeriesData, stacks); + + snippet.forEachArray(rawSeriesData, function(seriesDatum) { + var stack = seriesDatum.stack || chartConst.DEFAULT_STACK; + if (stack === leftStack) { + seriesDatum.data = self._createMinusValues(seriesDatum.data); + result.push(seriesDatum); + } else if (stack === rightStack) { + seriesDatum.data = self._createPlusValues(seriesDatum.data); + result.push(seriesDatum); + } + }); + + return result; + }, + + /** + * Make raw series data for diverging. + * @param {{data: Array., stack: string}} rawSeriesData raw series data + * @param {?string} stackTypeOption stackType option + * @returns {{data: Array.}} changed raw series data + * @private + */ + _makeRawSeriesDataForDiverging: function(rawSeriesData, stackTypeOption) { + if (predicate.isValidStackOption(stackTypeOption)) { + rawSeriesData = this._makeRawSeriesDataForStackedDiverging(rawSeriesData); + } else { + rawSeriesData = this._makeNormalDivergingRawSeriesData(rawSeriesData); + } + + return rawSeriesData; + }, + + /** + * Update raw series data by options. + * @param {object} rawData - raw data + * @param {{stackType: ?string, diverging: ?boolean}} seriesOptions - series options + */ + updateRawSeriesDataByOptions: function(rawData, seriesOptions) { + var self = this; + + seriesOptions = seriesOptions || {}; + + if (predicate.isValidStackOption(seriesOptions.stackType)) { + snippet.forEach(rawData.series, function(seriesDatum, seriesType) { + rawData.series[seriesType] = self._sortSeriesData(rawData.series[seriesType]); + }); + } + + if (seriesOptions.diverging) { + snippet.forEach(rawData.series, function(seriesDatum, seriesType) { + rawData.series[seriesType] = self._makeRawSeriesDataForDiverging(seriesDatum, seriesOptions.stackType); + }); + } + }, + + /** + * Append outlier value to boxplot series data end + * @param {object} rawData - raw data + */ + appendOutliersToSeriesData: function(rawData) { + var boxplot = rawData.series.boxplot; + snippet.forEach(boxplot, function(seriesItem) { + var outliers = seriesItem.outliers; + + if (outliers && outliers.length) { + snippet.forEach(outliers, function(outlier) { + seriesItem.data[outlier[0]].push(outlier[1]); + }); + } + }); + }, + + /** + * Filter raw data belong to checked legend. + * @param {object} rawData raw data + * @param {Array. | {line: ?Array., column: ?Array.}} checkedLegends checked legends + * @returns {object} rawData + */ + filterCheckedRawData: function(rawData, checkedLegends) { + var cloneData = JSON.parse(JSON.stringify(rawData)); + var filteredCategories; + + if (checkedLegends) { + snippet.forEach(cloneData.series, function(serieses, chartType) { + if (!checkedLegends[chartType]) { + cloneData.series[chartType] = []; + } else if (checkedLegends[chartType].length) { + cloneData.series[chartType] = snippet.filter(serieses, function(series, index) { + return checkedLegends[chartType][index]; + }); + } + }); + } + + if (cloneData.series.bullet) { + filteredCategories = []; + snippet.forEach(checkedLegends.bullet, function(isChecked, index) { + if (isChecked) { + filteredCategories.push(rawData.categories[index]); + } + }); + cloneData.categories = filteredCategories; + } + + return cloneData; + }, + + /** + * Modify rawData to fit chart format + * @param {object} rawData - raw data + * @private + */ + _makeRawSeriesDataForBulletChart: function(rawData) { + var bullet = rawData.series.bullet; + + rawData.categories = rawData.categories || []; + + rawData.categories = snippet.map(bullet, function(seriesData) { + return seriesData.name || ''; + }); + } + }; + + module.exports = rawDataHandler; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Plugin factory play role register rendering plugin. + * Also, you can get plugin from this factory. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + + var plugins = {}, + factory = { + /** + * Get graph renderer. + * @param {string} libType type of graph library + * @param {string} chartType chart type + * @returns {object} renderer instance + */ + get: function(libType, chartType) { + var plugin = plugins[libType || chartConst.DEFAULT_PLUGIN], + Renderer, renderer; + + if (!plugin) { + throw new Error('Not exist ' + libType + ' plugin.'); + } + + Renderer = plugin[chartType]; + if (!Renderer) { + throw new Error('Not exist ' + chartType + ' chart renderer.'); + } + + renderer = new Renderer(); + + return renderer; + }, + /** + * Plugin register. + * @param {string} libType type of graph library + * @param {object} plugin plugin to control library + */ + register: function(libType, plugin) { + plugins[libType] = plugin; + } + }; + + module.exports = factory; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @Fileoverview Theme manager. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var defaultTheme = __webpack_require__(34); + var snippet = __webpack_require__(6); + + var themes = {}; + + module.exports = { + /** + * Theme register. + * @param {string} themeName theme name + * @param {object} theme theme + */ + register: function(themeName, theme) { + theme = JSON.parse(JSON.stringify(theme)); + themes[themeName] = theme; + }, + + /** + * Pick series types from raw series data. + * @param {string} chartType - chart type + * @param {object} rawSeriesData - raw series data + * @returns {Array} + * @private + */ + _pickSeriesNames: function(chartType, rawSeriesData) { + var seriesTypes = []; + if (predicate.isComboChart(chartType)) { + snippet.forEach(rawSeriesData, function(data, seriesType) { + seriesTypes.push(seriesType); + }); + } else { + seriesTypes.push(chartType); + } + + return seriesTypes; + }, + + /** + * Overwrite theme + * @param {object} fromTheme - from theme + * @param {object} toTheme - to theme + * @private + */ + _overwriteTheme: function(fromTheme, toTheme) { + var self = this; + + snippet.forEach(toTheme, function(item, key) { + var fromItem = fromTheme[key]; + if (!fromItem && fromItem !== 0) { + return; + } + + if (snippet.isArray(fromItem)) { + toTheme[key] = fromItem.slice(); + } else if (snippet.isObject(fromItem)) { + self._overwriteTheme(fromItem, item); + } else { + toTheme[key] = fromItem; + } + }); + }, + + /** + * Pick valid theme properties. + * @param {object} theme - theme + * @param {string} componentType - component type (series or yAxis) + * @returns {object} + * @private + */ + _pickValidTheme: function(theme, componentType) { + var validTheme = {}; + + snippet.forEachArray(chartConst.THEME_PROPS_MAP[componentType], function(propName) { + if (snippet.isExisty(theme[propName])) { + validTheme[propName] = theme[propName]; + } + }); + + return validTheme; + }, + + /** + * Create component theme with series name + * @param {Array.} seriesTypes - series types + * @param {object} fromTheme - from theme + * @param {object} toTheme - to theme + * @param {string} componentType - component type + * @returns {object} + * @private + */ + _createComponentThemeWithSeriesName: function(seriesTypes, fromTheme, toTheme, componentType) { + var self = this; + var newTheme = {}; + + fromTheme = fromTheme || {}; + + snippet.forEachArray(seriesTypes, function(seriesType) { + var theme = fromTheme[seriesType] || self._pickValidTheme(fromTheme, componentType); + + if (snippet.keys(theme).length) { + newTheme[seriesType] = JSON.parse(JSON.stringify(defaultTheme[componentType])); + self._overwriteTheme(theme, newTheme[seriesType]); + } else { + newTheme[seriesType] = JSON.parse(JSON.stringify(toTheme)); + } + }); + + return newTheme; + }, + + /** + * Make each series's color + * @param {Array.} themeColors Theme colors to use + * @param {number} seriesCount Series count + * @param {number} startColorIndex Start color index + * @returns {Array.} colors + */ + _makeEachSeriesColors: function(themeColors, seriesCount, startColorIndex) { + var colors = []; + var themeColorsLen = themeColors.length; + var colorIndex = startColorIndex || 0; + var i; + + for (i = 0; i < seriesCount; i += 1) { + colors.push(themeColors[colorIndex]); + + colorIndex += 1; + + if (colorIndex >= themeColorsLen) { + colorIndex = 0; + } + } + + return colors; + }, + + /** + * Set series colors theme. + * @param {Array.} seriesTypes - series type + * @param {object} seriesThemes - series theme map + * @param {object} rawSeriesThemes - raw series theme map + * @param {object} rawSeriesData - raw series data + * @private + */ + _setSeriesColors: function(seriesTypes, seriesThemes, rawSeriesThemes, rawSeriesData) { + var seriesColors, seriesCount, hasOwnColors; + var colorIndex = 0; + + rawSeriesThemes = rawSeriesThemes || {}; // to simplify if/else statement + + snippet.forEachArray(seriesTypes, function(seriesType) { + if (rawSeriesThemes[seriesType]) { + seriesColors = rawSeriesThemes[seriesType].colors; + hasOwnColors = true; + } else { + seriesColors = rawSeriesThemes.colors || defaultTheme.series.colors; + hasOwnColors = false; + } + + seriesCount = this._getSeriesThemeColorCount(rawSeriesData[seriesType]); + + seriesThemes[seriesType].colors = this._makeEachSeriesColors(seriesColors, seriesCount, + !hasOwnColors && colorIndex); + + // To distinct between series that use default theme, we make the colors different + if (!hasOwnColors) { + colorIndex = (seriesCount + colorIndex) % seriesColors.length; + } + }, this); + }, + + /** + * Get number of series theme color from seriesData + * @param {object} rawSeriesDatum - raw series data contains series information + * @returns {number} number of series theme color + * @private + */ + _getSeriesThemeColorCount: function(rawSeriesDatum) { + var seriesCount = 0; + + if (rawSeriesDatum && rawSeriesDatum.length) { + if (rawSeriesDatum.colorLength) { + seriesCount = rawSeriesDatum.colorLength; + } else if (rawSeriesDatum[0] && rawSeriesDatum[0].data && rawSeriesDatum[0].data.length) { + seriesCount = Math.max(rawSeriesDatum.length, rawSeriesDatum[0].data.length); + } else { + seriesCount = rawSeriesDatum.length; + } + } + + return seriesCount; + }, + + /** + * Init theme. + * @param {string} themeName - theme name + * @param {object} rawTheme - raw theme + * @param {Array.} seriesTypes - series types + * @param {object} rawSeriesData - raw series data + * @returns {object} + * @private + * @ignore + */ + _initTheme: function(themeName, rawTheme, seriesTypes, rawSeriesData) { + var theme; + + if (themeName !== chartConst.DEFAULT_THEME_NAME) { // customized theme that overrides default theme + theme = JSON.parse(JSON.stringify(defaultTheme)); + this._overwriteTheme(rawTheme, theme); + } else { // default theme + theme = JSON.parse(JSON.stringify(rawTheme)); + } + + // make each component theme have theme by series name. theme.yAxis.theme -> theme.yAxis.line.theme + theme.yAxis = this._createComponentThemeWithSeriesName(seriesTypes, rawTheme.yAxis, theme.yAxis, 'yAxis'); + theme.series = this._createComponentThemeWithSeriesName(seriesTypes, rawTheme.series, theme.series, 'series'); + + this._setSeriesColors(seriesTypes, theme.series, rawTheme.series, rawSeriesData); + + return theme; + }, + + /** + * Create target themes for font inherit. + * @param {object} theme - theme + * @returns {Array.} + * @private + */ + _createTargetThemesForFontInherit: function(theme) { + var items = [ + theme.title, + theme.xAxis.title, + theme.xAxis.label, + theme.legend.label, + theme.plot.label + ]; + + snippet.forEach(theme.yAxis, function(_theme) { + items.push(_theme.title, _theme.label); + }); + + snippet.forEach(theme.series, function(_theme) { + items.push(_theme.label); + }); + + return items; + }, + + /** + * Inherit theme font. + * @param {object} theme theme + * @private + */ + _inheritThemeFont: function(theme) { + var targetThemes = this._createTargetThemesForFontInherit(theme); + var baseFont = theme.chart.fontFamily; + + snippet.forEachArray(targetThemes, function(item) { + if (!item.fontFamily) { + item.fontFamily = baseFont; + } + }); + }, + + /** + * Copy color theme to otherTheme from seriesTheme. + * @param {object} seriesTheme - series theme + * @param {object} otherTheme - other theme + * @param {object} seriesType - series name + * @private + */ + _copySeriesColorTheme: function(seriesTheme, otherTheme, seriesType) { + otherTheme[seriesType] = { + colors: seriesTheme.colors, + borderColor: seriesTheme.borderColor, + selectionColor: seriesTheme.selectionColor + }; + }, + + /** + * Copy series color theme to other components. + * @param {object} theme theme + * @private + * @ignore + */ + _copySeriesColorThemeToOther: function(theme) { + var self = this; + + snippet.forEach(theme.series, function(seriesTheme, seriesType) { + self._copySeriesColorTheme(seriesTheme, theme.legend, seriesType); + self._copySeriesColorTheme(seriesTheme, theme.tooltip, seriesType); + }); + }, + + /** + * Get theme. + * @param {string} themeName - theme name + * @param {string} chartType - chart type + * @param {object} rawSeriesData - raw series data + * @returns {object} + */ + get: function(themeName, chartType, rawSeriesData) { + var rawTheme = themes[themeName]; + var theme, seriesTypes; + + if (!rawTheme) { + throw new Error('Not exist ' + themeName + ' theme.'); + } + + seriesTypes = this._pickSeriesNames(chartType, rawSeriesData); + + theme = this._initTheme(themeName, rawTheme, seriesTypes, rawSeriesData); + + this._inheritThemeFont(theme, seriesTypes); + this._copySeriesColorThemeToOther(theme); + + return theme; + } + }; + + +/***/ }), +/* 34 */ +/***/ (function(module, exports) { + + 'use strict'; + + var DEFAULT_COLOR = '#000000'; + var DEFAULT_BACKGROUND = '#ffffff'; + var DEFAULT_FONTWEIGHT = 'normal'; + var EMPTY = ''; + var DEFAULT_AXIS = { + tickColor: DEFAULT_COLOR, + title: { + fontSize: 12, + fontFamily: EMPTY, + color: DEFAULT_COLOR, + fontWeight: DEFAULT_FONTWEIGHT + }, + label: { + fontSize: 12, + fontFamily: EMPTY, + color: DEFAULT_COLOR, + fontWeight: DEFAULT_FONTWEIGHT + } + }; + + var defaultTheme = { + chart: { + background: { + color: DEFAULT_BACKGROUND, + opacity: 1 + }, + fontFamily: 'Verdana' + }, + title: { + fontSize: 18, + fontFamily: EMPTY, + color: DEFAULT_COLOR, + fontWeight: DEFAULT_FONTWEIGHT + }, + yAxis: DEFAULT_AXIS, + xAxis: DEFAULT_AXIS, + plot: { + lineColor: '#dddddd', + background: '#ffffff', + label: { + fontSize: 11, + fontFamily: EMPTY, + color: '#888' + } + }, + series: { + label: { + fontSize: 11, + fontFamily: EMPTY, + color: DEFAULT_COLOR, + fontWeight: DEFAULT_FONTWEIGHT + }, + colors: ['#ac4142', '#d28445', '#f4bf75', '#90a959', '#75b5aa', '#6a9fb5', '#aa759f', '#8f5536'], + borderColor: EMPTY, + borderWidth: EMPTY, + selectionColor: EMPTY, + startColor: '#F4F4F4', + endColor: '#345391', + overColor: '#F0C952', + dot: { + fillColor: EMPTY, + fillOpacity: 1, + strokeColor: EMPTY, + strokeOpacity: 1, + strokeWidth: 2, + radius: 2, + hover: { + fillColor: EMPTY, + fillOpacity: 1, + strokeColor: EMPTY, + strokeOpacity: 0.8, + strokeWidth: 3, + radius: 4 + } + }, + ranges: [] + }, + legend: { + label: { + fontSize: 12, + fontFamily: EMPTY, + color: DEFAULT_COLOR, + fontWeight: DEFAULT_FONTWEIGHT + } + }, + tooltip: {}, + chartExportMenu: { + backgroundColor: '#fff', + borderRadius: 0, + borderWidth: 1, + color: '#000' + } + }; + + module.exports = defaultTheme; + + +/***/ }), +/* 35 */ +/***/ (function(module, exports) { + + /** + * @fileoverview Map Manager. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var maps = {}; + + module.exports = { + /** + * Get map data. + * @param {string} mapName map name + * @returns {Array} map data + */ + get: function(mapName) { + var data = maps[mapName]; + + if (!data) { + throw new Error('Not exist ' + mapName + ' map.'); + } + + return data; + }, + + /** + * Register Map. + * @param {string} mapName map name + * @param {Array} data map data + */ + register: function(mapName, data) { + maps[mapName] = data; + } + }; + + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview util for object + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + + /** + * Deep copy. + * @memberOf module:objectUtil + * @param {object|Array|*} origin - original data + * @returns {*} + */ + var deepCopy = function(origin) { + var clone; + + if (snippet.isArray(origin)) { + clone = []; + snippet.forEachArray(origin, function(value, index) { + clone[index] = deepCopy(value); + }); + } else if (snippet.isFunction(origin) || snippet.isDate(origin)) { + clone = origin; + } else if (snippet.isObject(origin)) { + clone = {}; + snippet.forEach(origin, function(value, key) { + clone[key] = deepCopy(value); + }); + } else { + clone = origin; + } + + return clone; + }; + + /** + * util for object + * @module objectUtil + * @private */ + var objectUtil = { + deepCopy: deepCopy + }; + + module.exports = objectUtil; + + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileOverview Series data importer + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var arrayUtil = __webpack_require__(10); + var snippet = __webpack_require__(6); + + /** + * Get series data from 2D array + * @param {Array.} table2DArray - extracted 2DArray from table element + * @returns {{ + * series: Array., + * categories: Array. + * }} + * @private + */ + function getChartDataFrom2DArray(table2DArray) { + var chartData; + + if (table2DArray.length > 0) { + chartData = {}; + chartData.categories = []; + chartData.series = []; + + chartData.categories = table2DArray.shift().slice(1); + snippet.forEach(table2DArray, function(tr) { + var seriesDatum = {}; + + seriesDatum.name = tr[0]; + seriesDatum.data = tr.slice(1); + + chartData.series.push(seriesDatum); + }); + } + + return chartData; + } + + /** + * Get pivoted second dimension array from table to use element.innerText + * @param {HTMLElement} tableElement - table element for extract chart's raw data + * @returns {Array.} + * @private + */ + function get2DArray(tableElement) { + var trs = []; + var secondDimensionArray = []; + var resultArray = []; + + if (tableElement) { + trs = snippet.toArray(tableElement.getElementsByTagName('TR')); + + snippet.forEach(trs, function(tr, index) { + var tagName = index === 0 ? 'TH' : 'TD'; + var cells = snippet.toArray(tr.getElementsByTagName(tagName)); + var rows = snippet.pluck(cells, 'innerText'); + + secondDimensionArray.push(rows); + }); + + if (secondDimensionArray[0].length < secondDimensionArray[1].length) { + secondDimensionArray[0].unshift(''); + } + + resultArray = arrayUtil.pivot(secondDimensionArray); + } + + return resultArray; + } + + /** + * Make chart data with table element + * @param {({ + * elementId:string + * }|{ + * element:HTMLElement + * })} table - object for table data import + * @returns {rawData} + * @ignore + * @api + */ + function makeDataWithTable(table) { + var element, chartData; + + if (table.element && table.element.tagName === 'TABLE') { + element = table.element; + } else if (table.elementId) { + element = document.getElementById(table.elementId); + } + + chartData = getChartDataFrom2DArray(get2DArray(element)); + + return chartData; + } + + module.exports = { + makeDataWithTable: makeDataWithTable + }; + + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var dom = __webpack_require__(9); + var snippet = __webpack_require__(6); + + /** + * Get raphael paper + * @param {HTMLElement} container container element + * @param {{width:number, height:number}} dimension dimension + * @returns {object} + * @private + */ + + /** + * Renderers + * @type {object} + * @ignore + */ + var renderers = { + DOM: function(container) { + var paper = dom.create('DIV'); + dom.append(container, paper); + + return paper; + } + }; + + var DrawingToolPicker = snippet.defineClass({ + /** + * DrawingToolPicker initializer + * @param {{width:number, height:number}} dimension dimension + * @ignore + */ + initDimension: function(dimension) { + this.dimension = dimension; + }, + + /** + * Get drawing tool paper + * @param {HTMLElement} container container element + * @param {string} rendererType component renderer type + * @returns {HTMLElement|object} + * @ignore + */ + getPaper: function(container, rendererType) { + var paper = this[rendererType + 'Paper']; + var isNeedCreateNewPaper = snippet.isExisty(container) + && paper && dom.findParentByClass(paper.canvas, 'tui-chart') !== container; + + if (!paper || isNeedCreateNewPaper) { + paper = renderers[rendererType].call(this, container, this.dimension); + + if (rendererType !== 'DOM') { + this[rendererType + 'Paper'] = paper; + } + } + + return paper; + } + }); + + /** + * Add renderer type + * @param {string} componentType component renderer type + * @param {function} callback callback function for get renderer's paper + */ + DrawingToolPicker.addRendererType = function(componentType, callback) { + renderers[componentType] = callback; + }; + + module.exports = DrawingToolPicker; + + +/***/ }), +/* 39 */ +/***/ (function(module, exports) { + + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON + // Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ + if (!window.JSON) { + window.JSON = { + parse: function(sJSON) { return eval('(' + sJSON + ')'); }, + stringify: (function () { + var toString = Object.prototype.toString; + var isArray = Array.isArray || function (a) { return toString.call(a) === '[object Array]'; }; + var escMap = {'"': '\\"', '\\': '\\\\', '\b': '\\b', '\f': '\\f', '\n': '\\n', '\r': '\\r', '\t': '\\t'}; + var escFunc = function (m) { return escMap[m] || '\\u' + (m.charCodeAt(0) + 0x10000).toString(16).substr(1); }; + var escRE = /[\\"\u0000-\u001F\u2028\u2029]/g; + return function stringify(value) { + if (value == null) { + return 'null'; + } else if (typeof value === 'number') { + return isFinite(value) ? value.toString() : 'null'; + } else if (typeof value === 'boolean') { + return value.toString(); + } else if (typeof value === 'object') { + if (typeof value.toJSON === 'function') { + return stringify(value.toJSON()); + } else if (isArray(value)) { + var res = '['; + for (var i = 0; i < value.length; i++) + res += (i ? ', ' : '') + stringify(value[i]); + return res + ']'; + } else if (toString.call(value) === '[object Object]') { + var tmp = []; + for (var k in value) { + if (value.hasOwnProperty(k)) + tmp.push(stringify(k) + ': ' + stringify(value[k])); + } + return '{' + tmp.join(', ') + '}'; + } + } + return '"' + value.toString().replace(escRE, escFunc) + '"'; + }; + })() + }; + } + + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create + // Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ + if (typeof Object.create != 'function') { + Object.create = (function(undefined) { + var Temp = function() {}; + return function (prototype, propertiesObject) { + if(prototype !== Object(prototype) && prototype !== null) { + throw TypeError('Argument must be an object, or null'); + } + Temp.prototype = prototype || {}; + if (propertiesObject !== undefined) { + Object.defineProperties(Temp.prototype, propertiesObject); + } + var result = new Temp(); + Temp.prototype = null; + // to imitate the case of Object.create(null) + if(prototype === null) { + result.__proto__ = null; + } + return result; + }; + })(); + } + + // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ + // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating + // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel + // MIT license + + (function () { + var lastTime = 0; + var vendors = ['ms', 'moz', 'webkit', 'o']; + for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { + window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; + window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] + || window[vendors[x] + 'CancelRequestAnimationFrame']; + } + + if (!window.requestAnimationFrame) { + window.requestAnimationFrame = function (callback) { + var currTime = new Date().getTime(); + var timeToCall = Math.max(0, 16 - (currTime - lastTime)); + var id = window.setTimeout(function () { + callback(currTime + timeToCall); + }, + timeToCall); + lastTime = currTime + timeToCall; + return id; + }; + } + + if (!window.cancelAnimationFrame) { + window.cancelAnimationFrame = function (id) { + clearTimeout(id); + }; + } + }()); + + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var chartConst = __webpack_require__(8); + var chartFactory = __webpack_require__(30); + var BarChart = __webpack_require__(41); + var ColumnChart = __webpack_require__(124); + var LineChart = __webpack_require__(125); + var AreaChart = __webpack_require__(127); + var ColumnLineComboChart = __webpack_require__(128); + var LineScatterComboChart = __webpack_require__(130); + var LineAreaComboChart = __webpack_require__(131); + var PieDonutComboChart = __webpack_require__(132); + var PieChart = __webpack_require__(133); + var BubbleChart = __webpack_require__(134); + var ScatterChart = __webpack_require__(135); + var HeatmapChart = __webpack_require__(136); + var TreemapChart = __webpack_require__(139); + var MapChart = __webpack_require__(140); + var RadialChart = __webpack_require__(143); + var BoxplotChart = __webpack_require__(144); + var BulletChart = __webpack_require__(145); + + chartFactory.register(chartConst.CHART_TYPE_BAR, BarChart); + chartFactory.register(chartConst.CHART_TYPE_COLUMN, ColumnChart); + chartFactory.register(chartConst.CHART_TYPE_LINE, LineChart); + chartFactory.register(chartConst.CHART_TYPE_AREA, AreaChart); + chartFactory.register(chartConst.CHART_TYPE_COLUMN_LINE_COMBO, ColumnLineComboChart); + chartFactory.register(chartConst.CHART_TYPE_LINE_SCATTER_COMBO, LineScatterComboChart); + chartFactory.register(chartConst.CHART_TYPE_LINE_AREA_COMBO, LineAreaComboChart); + chartFactory.register(chartConst.CHART_TYPE_PIE_DONUT_COMBO, PieDonutComboChart); + chartFactory.register(chartConst.CHART_TYPE_PIE, PieChart); + chartFactory.register(chartConst.CHART_TYPE_BUBBLE, BubbleChart); + chartFactory.register(chartConst.CHART_TYPE_SCATTER, ScatterChart); + chartFactory.register(chartConst.CHART_TYPE_HEATMAP, HeatmapChart); + chartFactory.register(chartConst.CHART_TYPE_TREEMAP, TreemapChart); + chartFactory.register(chartConst.CHART_TYPE_MAP, MapChart); + chartFactory.register(chartConst.CHART_TYPE_RADIAL, RadialChart); + chartFactory.register(chartConst.CHART_TYPE_BOXPLOT, BoxplotChart); + chartFactory.register(chartConst.CHART_TYPE_BULLET, BulletChart); + + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Bar chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var chartConst = __webpack_require__(8); + var rawDataHandler = __webpack_require__(31); + var predicate = __webpack_require__(11); + var snippet = __webpack_require__(6); + + var BarChart = snippet.defineClass(ChartBase, /** @lends BarChart.prototype */ { + /** + * className + * @type {string} + */ + className: 'tui-bar-chart', + /** + * Bar chart. + * @constructs BarChart + * @extends ChartBase + * @mixes axisTypeMixer + * @param {Array.} rawData raw data + * @param {object} theme chart theme + * @param {object} options chart options + */ + init: function(rawData, theme, options) { + rawDataHandler.updateRawSeriesDataByOptions(rawData, options.series); + this._updateOptionsRelatedDiverging(options); + + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options, + hasAxes: true + }); + }, + + /** + * Update options related diverging option. + * @param {object} options - options + * @private + */ + _updateOptionsRelatedDiverging: function(options) { + var isCenter; + + options.series = options.series || {}; + + /** + * Whether has right y axis or not. + * @type {boolean} + */ + this.hasRightYAxis = false; + + if (options.series.diverging) { + options.yAxis = options.yAxis || {}; + options.xAxis = options.xAxis || {}; + options.plot = options.plot || {}; + + options.series.stackType = options.series.stackType || chartConst.NORMAL_STACK_TYPE; + this.hasRightYAxis = snippet.isArray(options.yAxis) && options.yAxis.length > 1; + + isCenter = predicate.isYAxisAlignCenter(this.hasRightYAxis, options.yAxis.align); + + options.yAxis.isCenter = isCenter; + options.xAxis.divided = isCenter; + options.series.divided = isCenter; + options.plot.divided = isCenter; + } + }, + + /** + * Add components + * @override + */ + addComponents: function() { + this.componentManager.register('title', 'title'); + this.componentManager.register('plot', 'plot'); + this.componentManager.register('legend', 'legend'); + + this.componentManager.register('barSeries', 'barSeries'); + + this.componentManager.register('yAxis', 'axis'); + this.componentManager.register('xAxis', 'axis'); + + if (this.hasRightYAxis) { + this.componentManager.register('rightYAxis', 'axis'); + } + + this.componentManager.register('chartExportMenu', 'chartExportMenu'); + this.componentManager.register('tooltip', 'tooltip'); + this.componentManager.register('mouseEventDetector', 'mouseEventDetector'); + }, + + /** + * Get scale option. + * @returns {{xAxis: boolean}} + * @override + */ + getScaleOption: function() { + return { + xAxis: true + }; + }, + + /** + * On change selected legend. + * @param {Array. | {line: ?Array., column: ?Array.}} checkedLegends checked legends + */ + onChangeCheckedLegends: function(checkedLegends) { + var boundParams; + + if (this.hasRightYAxis) { + boundParams = { + optionChartTypes: ['bar', 'bar'] + }; + } + ChartBase.prototype.onChangeCheckedLegends.call(this, checkedLegends, null, boundParams); + }, + /** + * Add data ratios. + * @override + * modified from axisTypeMixer + */ + addDataRatios: function(limitMap) { + var seriesOption = this.options.series || {}; + var chartType = this.chartType; + var stackType = (seriesOption[chartType] || seriesOption).stackType; + + this.dataProcessor.addDataRatios(limitMap[chartType], stackType, chartType); + } + }); + + module.exports = BarChart; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview ChartBase + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var ComponentManager = __webpack_require__(43); + var DefaultDataProcessor = __webpack_require__(101); + var rawDataHandler = __webpack_require__(31); + var dom = __webpack_require__(9); + var renderUtil = __webpack_require__(7); + var boundsAndScaleBuilder = __webpack_require__(112); + var predicate = __webpack_require__(11); + var snippet = __webpack_require__(6); + + var ChartBase = snippet.defineClass(/** @lends ChartBase.prototype */ { + /** + * Chart base. + * @constructs ChartBase + * @param {object} params parameters + * @param {object} params.rawData raw data + * @param {object} params.theme chart theme + * @param {object} params.options chart options + * @param {boolean} params.hasAxes whether has axes or not + * @param {boolean} params.isVertical whether vertical or not + * @param {DataProcessor} params.DataProcessor DataProcessor + */ + init: function(params) { + /** + * theme + * @type {object} + */ + this.theme = params.theme; + + this._initializeOptions(params.options); + + /** + * chart type + * @type {string} + */ + this.chartType = this.options.chartType; + + /** + * whether chart has axes or not + * @type {boolean} + */ + this.hasAxes = params.hasAxes; + + /** + * whether vertical or not + * @type {boolean} + */ + this.isVertical = !!params.isVertical; + + /** + * data processor + * @type {DataProcessor} + */ + this.dataProcessor = this._createDataProcessor(params); + + /** + * event bus for transmitting message + * @type {object} + */ + this.eventBus = new snippet.CustomEvents(); + + /** + * previous xAxis data + * @type {null|object} + */ + this.prevXAxisData = null; + + /** + * component manager + * @type {ComponentManager} + */ + this.componentManager = this._createComponentManager(); + + this.addComponents(); + + this._attachToEventBus(); + }, + + /** + * Attach to event bus. + * @private + */ + _attachToEventBus: function() { + this.eventBus.on('changeCheckedLegends', this.onChangeCheckedLegends, this); + + if (this.onZoom) { + this.eventBus.on({ + zoom: this.onZoom, + resetZoom: this.onResetZoom + }, this); + } + }, + + /** + * Set offset property + * @param {{offset: object}} options - options + * @param {string} fromProperty - from property name + * @param {string} toProperty - to property name + * @private + */ + _setOffsetProperty: function(options, fromProperty, toProperty) { + if (!snippet.isExisty(options[fromProperty])) { + return; + } + + options.offset = options.offset || {}; + options.offset[toProperty] = options[fromProperty]; + delete options[fromProperty]; + }, + + /** + * Initialize offset. + * @param {{offsetX: ?number, offsetY: ?number}} options - offset options + * @private + */ + _initializeOffset: function(options) { + if (!options) { + return; + } + + this._setOffsetProperty(options, 'offsetX', 'x'); + this._setOffsetProperty(options, 'offsetY', 'y'); + }, + + /** + * Initialize title options. + * @param { + * Array.<{title: (string | {text: string, offsetX: number, offsetY: number})}> | + * {title: (string | {text: string, offsetX: number, offsetY: number})} + * } targetOptions - target options + * @private + */ + _initializeTitleOptions: function(targetOptions) { + var self = this; + var optionsSet; + + if (!targetOptions) { + return; + } + + optionsSet = snippet.isArray(targetOptions) ? targetOptions : [targetOptions]; + snippet.forEachArray(optionsSet, function(options) { + var title = options.title; + + if (snippet.isString(title)) { + options.title = { + text: title + }; + } + + self._initializeOffset(options.title); + }); + }, + + /** + * Initialize tooltip options. + * @param {{grouped: ?boolean, offsetX: ?number, offsetY: ?number}} options - tooltip options + * @private + */ + _initializeTooltipOptions: function(options) { + var position = options.position; + + options.grouped = !!options.grouped; + this._initializeOffset(options); + + if (!options.offset && position) { + options.offset = { + x: position.left, + y: position.top + }; + } + + delete options.position; + }, + + /** + * Initialize options. + * @param {object} options - options for chart + * @private + */ + _initializeOptions: function(options) { + options.chartTypes = this.charTypes; + options.xAxis = options.xAxis || {}; + options.series = options.series || {}; + options.tooltip = options.tooltip || {}; + options.legend = options.legend || {}; + options.chartExportMenu = options.chartExportMenu || {}; + + this._initializeTitleOptions(options.chart); + this._initializeTitleOptions(options.xAxis); + this._initializeTitleOptions(options.yAxis); + + if (snippet.isUndefined(options.legend.visible)) { + options.legend.visible = true; + } + + if (snippet.isUndefined(options.chartExportMenu.visible)) { + options.chartExportMenu.visible = true; + } + + this._initializeTooltipOptions(options.tooltip); + + /** + * options + * @type {object} + */ + this.options = options; + }, + + /** + * Create dataProcessor for processing raw data. + * @param {object} params parameters + * @param {object} params.rawData - raw data + * @param {DataProcessor} params.DataProcessor - DataProcessor class + * @param {{chart: object, chartType: string}} params.options - chart options + * @param {Array} params.seriesTypes series - chart types for rendering series + * @returns {object} data processor + * @private + */ + _createDataProcessor: function(params) { + var DataProcessor, dataProcessor; + + DataProcessor = params.DataProcessor || DefaultDataProcessor; + dataProcessor = new DataProcessor(params.rawData, this.chartType, params.options, this.seriesTypes); + + return dataProcessor; + }, + + /** + * Create ComponentManager. + * @returns {ComponentManager} + * @private + */ + _createComponentManager: function() { + return new ComponentManager({ + options: this.options, + theme: this.theme, + dataProcessor: this.dataProcessor, + hasAxes: this.hasAxes, + eventBus: this.eventBus, + isVertical: this.isVertical, + seriesTypes: this.seriesTypes || [this.chartType] + }); + }, + + /** + * Add components. + * @abstract + */ + addComponents: function() {}, + + /** + * Get scale option. + * @abstract + */ + getScaleOption: function() {}, + + /** + * Build bounds and scale data. + * @param {object} prevXAxisData - previous xAxis data + * @param {boolean} addingDataMode - whether adding data mode or not + * @returns {{ + * layoutBounds: { + * dimensionMap: { + * xAxis: {width: number, height: number}, + * yAxis: {width: number, height: number}, + * rightYAxis: {width: number, height: number}, + * series: {width: number, height: number}, + * extendedSeries: {width: number, height: number}, + * mouseEventDetector: {width: number, height: number}, + * legend: {width: number, height: number}, + * tooltip: {width: number, height: number} + * }, + * positionMap: { + * xAxis: {left: number, top: number}, + * yAxis: {left: number, top: number}, + * rightYAxis: {left: number, top: number}, + * series: {left: number, top: number}, + * extendedSeries: {left: number, top: number}, + * mouseEventDetector: {left: number, top: number}, + * legend: {left: number, top: number}, + * tooltip: {left: number, top: number} + * } + * }, + * limitMap: { + * xAxis: {min: number, max: number}, + * yAxis: {min: number, max: number} + * }, + * axisDataMap: { + * xAxis: object, + * yAxis: object, + * yRightAxis: object + * }, + * maxRadius: ?number + * }} + * @private + */ + _buildBoundsAndScaleData: function(prevXAxisData, addingDataMode) { + return boundsAndScaleBuilder.build(this.dataProcessor, this.componentManager, { + chartType: this.chartType, + seriesTypes: this.seriesTypes, + options: this.options, + theme: this.theme, + hasAxes: this.hasAxes, + scaleOption: this.getScaleOption(), + isVertical: this.isVertical, + hasRightYAxis: this.hasRightYAxis, + addedDataCount: this._dynamicDataHelper ? this._dynamicDataHelper.addedDataCount : null, + prevXAxisData: prevXAxisData, + addingDataMode: addingDataMode + }); + }, + + /** + * Add data ratios. + * @abstract + */ + addDataRatios: function() {}, + + /** + * Make chart ready for render, it should be invoked before render, rerender, resize and zoom. + * @param {?boolean} addingDataMode - whether adding data mode or not + * @returns {object} Bounds and scale data + */ + readyForRender: function(addingDataMode) { + var boundsAndScale = this._buildBoundsAndScaleData(this.prevXAxisData, addingDataMode); + + if (boundsAndScale.axisDataMap.xAxis) { + this.prevXAxisData = boundsAndScale.axisDataMap.xAxis; + } + + this.addDataRatios(boundsAndScale.limitMap); + + return boundsAndScale; + }, + + /** + * Render chart. + * @param {HTMLElement} wrapper chart wrapper element + */ + render: function(wrapper) { + var container = dom.create('DIV', 'tui-chart ' + this.className); + var componentManager = this.componentManager; + var dataProcessor = this.dataProcessor; + var seriesVisibilityMap = dataProcessor.getLegendVisibility(); + var rawData = rawDataHandler.filterCheckedRawData(dataProcessor.rawData, seriesVisibilityMap); + var raphaelPaper = componentManager.drawingToolPicker.getPaper(container, chartConst.COMPONENT_TYPE_RAPHAEL); + var boundsAndScale; + + this.dataProcessor.initData(rawData); + + raphaelPaper.changeChartBackgroundColor(this.theme.chart.background.color); + raphaelPaper.changeChartBackgroundOpacity(this.theme.chart.background.opacity); + renderUtil.renderFontFamily(container, this.theme.chart.fontFamily); + + dom.append(wrapper, container); + + boundsAndScale = this.readyForRender(); + + renderUtil.renderDimension(container, boundsAndScale.dimensionMap.chart); + componentManager.render('render', boundsAndScale, { + checkedLegends: seriesVisibilityMap + }, container); + + this.chartContainer = container; + this.paper = raphaelPaper; + }, + + /** + * Rerender. + * @param {Array. | {line: ?Array., column: ?Array.}} checkedLegends checked legends + * @param {?object} rawData rawData + */ + rerender: function(checkedLegends, rawData) { + var dataProcessor = this.dataProcessor; + var boundsAndScale; + + if (!rawData) { + rawData = rawDataHandler.filterCheckedRawData( + dataProcessor.getZoomedRawData(), + checkedLegends + ); + } + + this.dataProcessor.initData(rawData); + + boundsAndScale = this.readyForRender(); + + this.componentManager.render('rerender', boundsAndScale, { + checkedLegends: checkedLegends + }, this.chartContainer); + }, + + /** + * On change checked legend. + * @param {Array. | {line: ?Array., column: ?Array.}} checkedLegends checked legends + * @param {?object} rawData rawData + * @param {?object} boundsParams addition params for calculating bounds + */ + onChangeCheckedLegends: function(checkedLegends, rawData, boundsParams) { + this.rerender(checkedLegends, rawData, boundsParams); + }, + + /** + * Animate chart. + */ + animateChart: function() { + this.componentManager.execute('animateComponent'); + }, + + /** + * Register of user event. + * @param {string} eventName event name + * @param {function} func event callback + */ + on: function(eventName, func) { + if (chartConst.PUBLIC_EVENT_MAP[eventName]) { + this.eventBus.on(chartConst.PUBLIC_EVENT_PREFIX + eventName, func); + } + }, + + /** + * Remove user event. + * @param {string} eventName event name + * @param {function} func event callback + */ + off: function(eventName, func) { + if (chartConst.PUBLIC_EVENT_MAP[eventName]) { + this.eventBus.off(chartConst.PUBLIC_EVENT_PREFIX + eventName, func); + } + }, + + /** + * Update dimension of chart. + * @param {{width: number, height: number}} dimension dimension + * @returns {boolean} whether updated or not + * @private + */ + _updateChartDimension: function(dimension) { + var updated = false; + var options = this.options; + + options.chart = options.chart || {}; + + if (dimension.width && dimension.width > 0 && options.chart.width !== dimension.width) { + options.chart.width = dimension.width; + updated = true; + } + + if (dimension.height && dimension.height > 0 && options.chart.height !== dimension.height) { + options.chart.height = dimension.height; + updated = true; + } + + return updated; + }, + + /** + * Public API for resizable. + * @param {object} dimension dimension + * @param {number} dimension.width width + * @param {number} dimension.height height + * @api + */ + resize: function(dimension) { + var updated, boundsAndScale, chartDimension; + + if (!dimension) { + return; + } + + updated = this._updateChartDimension(dimension); + + if (!updated) { + return; + } + + boundsAndScale = this.readyForRender(); + chartDimension = boundsAndScale.dimensionMap.chart; + + renderUtil.renderDimension(this.chartContainer, chartDimension); + this.paper.resizeBackground(chartDimension.width, chartDimension.height); + + this.componentManager.render('resize', boundsAndScale); + }, + + /** + * Set tooltip align option. + * @param {string} align align (left|center|right, top|middle|bottom) + * @api + */ + setTooltipAlign: function(align) { + this.componentManager.get('tooltip').setAlign(align); + }, + + /** + * Set tooltip offset option. + * @param {object} offset - tooltip offset + * @param {number} offset.x - offset x + * @param {number} offset.y - offset y + * @api + */ + setTooltipOffset: function(offset) { + this.componentManager.get('tooltip').setOffset(offset); + }, + + /** + * Set position option. + * @param {object} position moving position + * @param {number} position.left left + * @param {number} position.top top + * @api + * @deprecated + */ + setTooltipPosition: function(position) { + this.componentManager.get('tooltip').setPosition(position); + }, + + /** + * Reset tooltip align option. + * @api + */ + resetTooltipAlign: function() { + this.componentManager.get('tooltip').resetAlign(); + }, + + /** + * Reset tooltip position. + * @api + */ + resetTooltipOffset: function() { + this.componentManager.get('tooltip').resetOffset(); + }, + + /** + * Reset tooltip position. + * @api + * @deprecated + */ + resetTooltipPosition: function() { + this.resetTooltipOffset(); + }, + + /** + * Show series label. + * @api + */ + showSeriesLabel: function() { + var seriesSet = this.componentManager.where({componentType: 'series'}); + + snippet.forEachArray(seriesSet, function(series) { + series.showLabel(); + }); + }, + + /** + * Hide series label. + * @api + */ + hideSeriesLabel: function() { + var seriesSet = this.componentManager.where({componentType: 'series'}); + + snippet.forEachArray(seriesSet, function(series) { + series.hideLabel(); + }); + }, + + /** + * Add data. + * @abstract + */ + addData: function() {}, + + /** + * Add plot line. + * @abstract + */ + addPlotLine: function() {}, + + /** + * Add plot band. + * @abstract + */ + addPlotBand: function() {}, + + /** + * Remove plot line. + * @abstract + */ + removePlotLine: function() {}, + + /** + * Remove plot band. + * @abstract + */ + removePlotBand: function() {}, + + /** + * Get series item bound by indexes + * @param {number} index - tooltip data's category index + * @param {number} seriesIndex - tooltip data's series index + * @param {number} [outlierIndex] - outlier index of tooltip, exists only hovered on boxplot chart's outlier point + * + * @returns {?object} - series item bound + * @private + */ + _getSeriesData: function(index, seriesIndex, outlierIndex) { + var indexes = { + index: index, + seriesIndex: seriesIndex, + outlierIndex: outlierIndex + }; + + if (seriesIndex < 0) { + return null; + } + + return this.componentManager.get('mouseEventDetector').findDataByIndexes(indexes); + }, + + /** + * find series index by legend label + * @param {string} chartType - chart tyoe + * @param {string} legendLabel - legend label + * @returns {number} - if not found return -1, else return found series index + * @private + */ + _findSeriesIndexByLabel: function(chartType, legendLabel) { + var labels = this.dataProcessor.getLegendLabels(chartType); + var seriesIndex = -1; + var i = 0; + var len = labels ? labels.length : 0; + + for (; i < len; i += 1) { + if (labels[i] === legendLabel) { + seriesIndex = i; + break; + } + } + + return seriesIndex; + }, + + /** + * @param {number} index - category index + * @param {number} seriesIndex - series index + * @returns {object} + */ + _findDataByIndexes: function(index, seriesIndex) { + return this.componentManager.get('mouseEventDetector').findDataByIndexes(index, seriesIndex); + }, + + /** + * show tooltip by index of series item + * @param {object} params - data needed for making a tooltip + * @ignore + */ + showTooltip: function(params) { + var isGroupTooltip, mouseEventDetector, foundSeriesIndex, foundData; + + if (!predicate.isSupportPublicShowTooptipAPI(this.chartType)) { + return; + } + + isGroupTooltip = this.options.tooltip && this.options.tooltip.grouped; + mouseEventDetector = this.componentManager.get('mouseEventDetector'); + + if (isGroupTooltip) { + foundData = {indexes: {groupIndex: params.index}}; + } else { + foundSeriesIndex = this._findSeriesIndexByLabel(params.chartType, params.legend); + foundData = this._getSeriesData(params.index, foundSeriesIndex, params.outlierIndex); + } + + if (foundData) { + foundData.silent = true; + mouseEventDetector._showTooltip(foundData); + } else { + this.hideTooltip(); + } + }, + + /** + * hide tooltip + * @ignore + */ + hideTooltip: function() { + var isGroupTooltip, mouseEventDetector; + + if (!predicate.isSupportPublicShowTooptipAPI(this.chartType)) { + return; + } + + isGroupTooltip = this.options.tooltip && this.options.tooltip.grouped; + mouseEventDetector = this.componentManager.get('mouseEventDetector'); + + if ((isGroupTooltip && mouseEventDetector.prevIndex >= 0) || + (!isGroupTooltip && mouseEventDetector.prevFoundData)) { + mouseEventDetector._hideTooltip({silent: true}); + } + } + }); + + module.exports = ChartBase; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview ComponentManager manages components of chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var dom = __webpack_require__(9); + var Axis = __webpack_require__(44); + var Plot = __webpack_require__(46); + var title = __webpack_require__(47); + var RadialPlot = __webpack_require__(48); + var ChartExportMenu = __webpack_require__(50); + var DrawingToolPicker = __webpack_require__(38); + + // legends + var Legend = __webpack_require__(56); + var SpectrumLegend = __webpack_require__(58); + var CircleLegend = __webpack_require__(59); + + // tooltips + var Tooltip = __webpack_require__(60); + var GroupTooltip = __webpack_require__(66); + var MapChartTooltip = __webpack_require__(68); + + // mouse event detectors + var MapChartEventDetector = __webpack_require__(69); + var mouseEventDetector = __webpack_require__(73); + + // series + var BarSeries = __webpack_require__(80); + var ColumnSeries = __webpack_require__(84); + var LineSeries = __webpack_require__(85); + var RadialSeries = __webpack_require__(87); + var AreaSeries = __webpack_require__(88); + var BubbleSeries = __webpack_require__(89); + var ScatterSeries = __webpack_require__(91); + var MapSeries = __webpack_require__(92); + var PieSeries = __webpack_require__(93); + var HeatmapSeries = __webpack_require__(94); + var TreemapSeries = __webpack_require__(95); + var BoxplotSeries = __webpack_require__(97); + var BulletSeries = __webpack_require__(98); + + var Zoom = __webpack_require__(99); + + var snippet = __webpack_require__(6); + + var COMPONENT_FACTORY_MAP = { + axis: Axis, + plot: Plot, + radialPlot: RadialPlot, + legend: Legend, + spectrumLegend: SpectrumLegend, + circleLegend: CircleLegend, + tooltip: Tooltip, + groupTooltip: GroupTooltip, + mapChartTooltip: MapChartTooltip, + mapChartEventDetector: MapChartEventDetector, + mouseEventDetector: mouseEventDetector, + barSeries: BarSeries, + columnSeries: ColumnSeries, + lineSeries: LineSeries, + radialSeries: RadialSeries, + areaSeries: AreaSeries, + bubbleSeries: BubbleSeries, + scatterSeries: ScatterSeries, + mapSeries: MapSeries, + pieSeries: PieSeries, + heatmapSeries: HeatmapSeries, + treemapSeries: TreemapSeries, + boxplotSeries: BoxplotSeries, + bulletSeries: BulletSeries, + zoom: Zoom, + chartExportMenu: ChartExportMenu, + title: title + }; + + var ComponentManager = snippet.defineClass(/** @lends ComponentManager.prototype */ { + /** + * ComponentManager manages components of chart. + * @param {object} params parameters + * @param {object} params.theme - theme + * @param {object} params.options - options + * @param {DataProcessor} params.dataProcessor - data processor + * @param {boolean} params.hasAxes - whether has axes or not + * @constructs ComponentManager + * @private + */ + init: function(params) { + var chartOption = params.options.chart; + var width = snippet.pick(chartOption, 'width') || chartConst.CHART_DEFAULT_WIDTH; + var height = snippet.pick(chartOption, 'height') || chartConst.CHART_DEFAULT_HEIGHT; + + /** + * Components + * @type {Array.} + */ + this.components = []; + + /** + * componentFactory map. + * @type {object} + */ + this.componentMap = {}; + + /** + * theme + * @type {object} + */ + this.theme = params.theme || {}; + + /** + * options + * @type {object} + */ + this.options = params.options || {}; + + /** + * data processor + * @type {DataProcessor} + */ + this.dataProcessor = params.dataProcessor; + + /** + * whether chart has axes or not + * @type {boolean} + */ + this.hasAxes = params.hasAxes; + + /** + * whether chart is vertical or not + * @type {boolean} + */ + this.isVertical = params.isVertical; + + /** + * event bus for transmitting message + * @type {object} + */ + this.eventBus = params.eventBus; + + /** + * Drawing tool picker + * @type {object} + */ + this.drawingToolPicker = new DrawingToolPicker(); + + this.drawingToolPicker.initDimension({ + width: width, + height: height + }); + + /** + * seriesTypes of chart + * @type {Array.} + */ + this.seriesTypes = params.seriesTypes; + }, + + /** + * Make component options. + * @param {object} options options + * @param {string} optionKey component option key + * @param {string} componentName component name + * @param {number} index component index + * @returns {object} options + * @private + */ + _makeComponentOptions: function(options, optionKey, componentName, index) { + options = options || this.options[optionKey]; + options = snippet.isArray(options) ? options[index] : options || {}; + + return options; + }, + + /** + * Register component. + * The component refers to a component of the chart. + * The component types are axis, legend, plot, series and mouseEventDetector. + * Chart Component Description : https://i-msdn.sec.s-msft.com/dynimg/IC267997.gif + * @param {string} name component name + * @param {string} classType component factory name + * @param {object} params params that for alternative charts + */ + register: function(name, classType, params) { + var index, component, componentType, componentFactory, optionKey; + + params = params || {}; + + params.name = name; + + index = params.index || 0; + + componentFactory = COMPONENT_FACTORY_MAP[classType]; + componentType = componentFactory.componentType; + + params.chartTheme = this.theme; + params.chartOptions = this.options; + params.seriesTypes = this.seriesTypes; + + if (componentType === 'axis') { + // Get theme and options by axis name + // As axis has 3 types(xAxis, yAxis, rightYAxis) + optionKey = name; + } else { + optionKey = componentType; + } + + params.theme = this.theme[optionKey]; + params.options = this.options[optionKey]; + + if (!params.theme && optionKey === 'rightYAxis') { + params.theme = this.theme.yAxis; + } + + if (!params.options && optionKey === 'rightYAxis') { + params.options = this.options.yAxis; + } + + if (optionKey === 'series') { + snippet.forEach(this.seriesTypes, function(seriesType) { + if (name.indexOf(seriesType) === 0) { + params.options = params.options[seriesType] || params.options; // For combo chart, options are set for each chart + params.theme = params.theme[seriesType]; // For combo, single chart, themes are set for each chart + + if (snippet.isArray(params.options)) { + params.options = params.options[index] || {}; + } + + return false; + } + + return true; + }); + } + + params.dataProcessor = this.dataProcessor; + params.hasAxes = this.hasAxes; + params.isVertical = this.isVertical; + params.eventBus = this.eventBus; + + // alternative scale models for charts that do not use common scale models like maps + params.alternativeModel = this.alternativeModel; + + component = componentFactory(params); + + // component creation can be refused by factory, according to option data + if (component) { + component.componentName = name; + component.componentType = componentType; + + this.components.push(component); + this.componentMap[name] = component; + } + }, + + /** + * Make data for rendering. + * @param {string} name - component name + * @param {string} type - component type + * @param {object} paper - raphael object + * @param {{ + * layoutBounds: { + * dimensionMap: object, + * positionMap: object + * }, + * limitMap: object, + * axisDataMap: object, + * maxRadius: ?number + * }} boundsAndScale - bounds and scale data + * @param {?object} additionalData - additional data + * @returns {object} + * @private + */ + _makeDataForRendering: function(name, type, paper, boundsAndScale, additionalData) { + var data = snippet.extend({ + paper: paper + }, additionalData); + + if (boundsAndScale) { + snippet.extend(data, boundsAndScale); + + data.layout = { + dimension: data.dimensionMap[name] || data.dimensionMap[type], + position: data.positionMap[name] || data.positionMap[type] + }; + } + + return data; + }, + + /** + * Render components. + * @param {string} funcName - function name for executing + * @param {{ + * layoutBounds: { + * dimensionMap: object, + * positionMap: object + * }, + * limitMap: object, + * axisDataMap: object, + * maxRadius: ?number + * }} boundsAndScale - bounds and scale data + * @param {?object} additionalData - additional data + * @param {?HTMLElement} container - container + */ + render: function(funcName, boundsAndScale, additionalData, container) { + var self = this; + var name, type; + + var elements = snippet.map(this.components, function(component) { + var element = null; + var data, result, paper; + + if (component[funcName]) { + name = component.componentName; + type = component.componentType; + paper = self.drawingToolPicker.getPaper(container, component.drawingType); + data = self._makeDataForRendering(name, type, paper, boundsAndScale, additionalData); + + result = component[funcName](data); + + if (result && !result.paper) { + element = result; + } + } + + return element; + }); + + if (container) { + dom.append(container, elements); + } + }, + + /** + * Find components to conditionMap. + * @param {object} conditionMap condition map + * @returns {Array.} filtered components + */ + where: function(conditionMap) { + return snippet.filter(this.components, function(component) { + var contained = true; + + snippet.forEach(conditionMap, function(value, key) { + if (component[key] !== value) { + contained = false; + } + + return contained; + }); + + return contained; + }); + }, + + /** + * Execute components. + * @param {string} funcName - function name + */ + execute: function(funcName) { + var args = Array.prototype.slice.call(arguments, 1); + + snippet.forEachArray(this.components, function(component) { + if (component[funcName]) { + component[funcName].apply(component, args); + } + }); + }, + + /** + * Get component. + * @param {string} name component name + * @returns {object} component instance + */ + get: function(name) { + return this.componentMap[name]; + }, + + /** + * Whether has component or not. + * @param {string} name - comopnent name + * @returns {boolean} + */ + has: function(name) { + return !!this.get(name); + } + }); + + module.exports = ComponentManager; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + + * @fileoverview Axis component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var calculator = __webpack_require__(45); + var pluginFactory = __webpack_require__(32); + var renderUtil = __webpack_require__(7); + var snippet = __webpack_require__(6); + + var Axis = snippet.defineClass(/** @lends Axis.prototype */ { + /** + * Axis component. + * @constructs Axis + * @private + * @param {object} params parameters + * @param {object} params.bound axis bound + * @param {object} params.theme axis theme + * @param {object} params.options axis options + * @param {object} params.dataProcessor data processor of chart + * @param {object} params.seriesType series type + * @param {boolean} params.isYAxis boolean value for axis is vertical or not + */ + init: function(params) { + /** + * Axis view className + * @type {string} + */ + this.className = 'tui-chart-axis-area'; + + /** + * Data processor + * @type {DataProcessor} + */ + this.dataProcessor = params.dataProcessor; + + /** + * Options + * @type {object} + */ + this.options = params.options || {}; + + /** + * Axis Theme + * Use chart background theme object for render yAxis background on dynamicDataShifting chart + * @type {object} + */ + this.theme = snippet.extend({}, params.theme, { + background: params.chartTheme.chart.background + }); + + /** + * Whether label type axis or not. + * @type {boolean} + */ + this.isLabelAxis = false; + + /** + * Whether vertical type or not. + * @type {boolean} + */ + this.isYAxis = params.isYAxis; + + /** + * Whether data dynamic shifting or not. + * @type {boolean} + */ + this.shifting = params.shifting; + + /** + * cached axis data + * @type {object} + */ + this.data = {}; + + /** + * layout bounds information for this components + * @type {null|{dimension:{width:number, height:number}, position:{left:number, top:number, ?right:number}}} + */ + this.layout = null; + + /** + * dimension map for layout of chart + * @type {null|object} + */ + this.dimensionMap = null; + + /** + * axis data map + * @type {null|object} + */ + this.axisDataMap = null; + + /** + * Renderer + * @type {object} + */ + this.graphRenderer = pluginFactory.get(chartConst.COMPONENT_TYPE_RAPHAEL, 'axis'); + + /** + * Drawing type + * @type {string} + */ + this.drawingType = chartConst.COMPONENT_TYPE_RAPHAEL; + + /** + * Paper additional width + * @type {number} + */ + this.paperAdditionalWidth = 0; + + /** + * Paper additional height + * @type {number} + */ + this.paperAdditionalHeight = 0; + + /** + * Raphael Element for axis background + * We should caching this for prevent making background multiply + * @type {Raphael.Element} + */ + this._elBg = null; + }, + + /** + * Render vertical axis background + * @private + */ + _renderBackground: function() { + var dimension = snippet.extend({}, this.layout.dimension); + var position = snippet.extend({}, this.layout.position); + + if (this.isYAxis) { + dimension.height = this.dimensionMap.chart.height; + position.top = 0; + } + + if (this._elBg) { + this._elBg.remove(); + } + + this._elBg = this.graphRenderer.renderBackground(this.paper, position, dimension, this.theme.background); + }, + /** + * Render child containers like title area, label area and tick area. + * @param {number} size xAxis width or yAxis height + * @param {number} tickCount tick count + * @param {Array.} categories categories + * @param {number} additionalWidth additional width + * @private + */ + _renderChildContainers: function(size, tickCount, categories, additionalWidth) { + var isYAxisLineType = this.isYAxis && this.data.aligned; + + if (this.isYAxis && !this.data.isPositionRight && !this.options.isCenter && this.shifting) { + this._renderBackground(); + } + + this._renderTitleArea(); + + if (this.options.showLabel !== false) { + this._renderLabelArea(size, tickCount, categories, additionalWidth); + } + + if (!isYAxisLineType) { + this._renderTickArea(size, tickCount, additionalWidth); + } + }, + /** + * Render divided xAxis if yAxis rendered in the center. + * @param {{width: number, height:number}} dimension axis area width and height + * @private + */ + _renderDividedAxis: function(dimension) { + var axisData = this.data; + var lSideWidth = Math.round(dimension.width / 2); + var rSideWidth = dimension.width - lSideWidth - 1; + var tickCount = axisData.tickCount; + var halfTickCount = parseInt(tickCount / 2, 10) + 1; + var categories = axisData.labels; + var lCategories = categories.slice(0, halfTickCount); + var rCategories = categories.slice(halfTickCount - 1, tickCount); + var tickInterval = lSideWidth / halfTickCount; + var secondXAxisAdditionalPosition = lSideWidth + this.dimensionMap.yAxis.width - 1; + + this.paperAdditionalWidth = tickInterval; + + this._renderChildContainers(lSideWidth, halfTickCount, lCategories, 0); + this._renderChildContainers(rSideWidth + 1, halfTickCount, rCategories, + secondXAxisAdditionalPosition); + }, + + /** + * Render single axis if not divided. + * @param {{width: number, height: number}} dimension axis area dimension + * @private + */ + _renderNotDividedAxis: function(dimension) { + var axisData = this.data; + var isYAxis = this.isYAxis; + var size = isYAxis ? dimension.height : dimension.width; + var additionalSize = 0; + + if (axisData.positionRatio) { + additionalSize = size * axisData.positionRatio; + } + + this._renderChildContainers(size, axisData.tickCount, axisData.labels, additionalSize); + }, + + /** + * Render axis area. + * @private + */ + _renderAxisArea: function() { + var dimension = this.layout.dimension; + var axisData = this.data; + + this.isLabelAxis = axisData.isLabelAxis; + + if (this.options.divided) { + this.containerWidth = dimension.width + this.dimensionMap.yAxis.width; + this._renderDividedAxis(dimension); + dimension.width = this.containerWidth; + } else { + dimension.width += this.options.isCenter ? 1 : 0; + this._renderNotDividedAxis(dimension); + } + }, + + /** + * Set data for rendering. + * @param {{ + * options: ?object, + * layout: { + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }, + * dimensionMap: object, + * axisDataMap: object + * }} data - bounds and scale data + * @private + */ + _setDataForRendering: function(data) { + this.layout = data.layout; + this.dimensionMap = data.dimensionMap; + this.data = data.axisDataMap[this.componentName]; + this.options = this.data.options; + }, + + /** + * @param {object} data - bounds and scale data + */ + render: function(data) { + this.paper = data.paper; + this.axisSet = data.paper.set(); + + this._setDataForRendering(data); + this._renderAxisArea(); + }, + + /** + * Rerender axis component. + * @param {object} data - bounds and scale data + */ + rerender: function(data) { + this.axisSet.remove(); + + this.render(data); + }, + + /** + * Resize axis component. + * @param {object} data - bounds and scale data + */ + resize: function(data) { + this.rerender(data); + }, + + /** + * Zoom. + * @param {object} data - bounds and scale data + */ + zoom: function(data) { + this.rerender(data); + }, + + /** + * Title area renderer + * @private + */ + _renderTitleArea: function() { + var title = this.options.title || {}; + + if (title.text) { + this.graphRenderer.renderTitle(this.paper, { + text: title.text, + offset: title.offset, + theme: this.theme.title, + rotationInfo: { + rotateTitle: this.options.rotateTitle, + isVertical: this.isYAxis, + isPositionRight: this.data.isPositionRight, + isCenter: this.options.isCenter + }, + layout: this.layout, + set: this.axisSet + }); + } + }, + + /** + * Render tick line. + * @param {number} areaSize - width or height + * @param {boolean} isNotDividedXAxis - whether is not divided x axis or not. + * @param {number} additionalSize - additional size + * @private + */ + _renderTickLine: function(areaSize, isNotDividedXAxis, additionalSize) { + this.graphRenderer.renderTickLine({ + areaSize: areaSize, + additionalSize: additionalSize, + additionalWidth: this.paperAdditionalWidth, + additionalHeight: this.paperAdditionalHeight, + isPositionRight: this.data.isPositionRight, + isCenter: this.data.options.isCenter, + isNotDividedXAxis: isNotDividedXAxis, + isVertical: this.isYAxis, + tickColor: this.theme.tickColor, + layout: this.layout, + paper: this.paper, + set: this.axisSet + }); + }, + + /** + * Render ticks. + * @param {number} size - width or height + * @param {number} tickCount - tick count + * @param {boolean} isNotDividedXAxis - whether is not divided x axis or not. + * @param {number} [additionalSize] - additional size + * @private + */ + _renderTicks: function(size, tickCount, isNotDividedXAxis, additionalSize) { + var tickColor = this.theme.tickColor; + var axisData = this.data; + var sizeRatio = axisData.sizeRatio || 1; + var isYAxis = this.isYAxis; + var isCenter = this.data.options.isCenter; + var isPositionRight = this.data.isPositionRight; + var positions = calculator.makeTickPixelPositions((size * sizeRatio), tickCount); + var additionalHeight = this.paperAdditionalHeight + 1; + var additionalWidth = this.paperAdditionalWidth; + + positions.length = axisData.tickCount; + + this.graphRenderer.renderTicks({ + paper: this.paper, + layout: this.layout, + positions: positions, + isVertical: isYAxis, + isCenter: isCenter, + additionalSize: additionalSize, + additionalWidth: additionalWidth, + additionalHeight: additionalHeight, + isPositionRight: isPositionRight, + tickColor: tickColor, + set: this.axisSet + }); + }, + + /** + * Render tick area. + * @param {number} size - width or height + * @param {number} tickCount - tick count + * @param {number} [additionalSize] - additional size (width or height) + * @private + */ + _renderTickArea: function(size, tickCount, additionalSize) { + var isNotDividedXAxis = !this.isYAxis && !this.options.divided; + + this._renderTickLine(size, isNotDividedXAxis, (additionalSize || 0)); + + this._renderTicks(size, tickCount, isNotDividedXAxis, (additionalSize || 0)); + }, + + /** + * Render label area. + * @param {number} size label area size + * @param {number} tickCount tick count + * @param {Array.} categories categories + * @param {number} [additionalSize] additional size (width or height) + * @private + */ + _renderLabelArea: function(size, tickCount, categories, additionalSize) { + var sizeRatio = this.data.sizeRatio || 1; + var tickPixelPositions = calculator.makeTickPixelPositions((size * sizeRatio), tickCount, 0); + var labelDistance = tickPixelPositions[1] - tickPixelPositions[0]; + + this._renderLabels(tickPixelPositions, categories, labelDistance, (additionalSize || 0)); + }, + + /** + * Make html of rotation labels. + * @param {Array.} positions label position array + * @param {string[]} categories categories + * @param {number} labelSize label size + * @param {number} additionalSize additional size + * @private + */ + _renderRotationLabels: function(positions, categories, labelSize, additionalSize) { + var self = this; + var renderer = this.graphRenderer; + var isYAxis = this.isYAxis; + var theme = this.theme.label; + var degree = this.data.degree; + var halfWidth = labelSize / 2; + var horizontalTop = this.layout.position.top + chartConst.AXIS_LABEL_PADDING; + var baseLeft = this.layout.position.left; + var labelMargin = this.options.labelMargin || 0; + + snippet.forEach(positions, function(position, index) { + var labelPosition = position + (additionalSize || 0); + var positionTopAndLeft = {}; + + if (isYAxis) { + positionTopAndLeft.top = labelPosition + halfWidth; + positionTopAndLeft.left = labelSize + labelMargin; + } else { + positionTopAndLeft.top = horizontalTop + labelMargin; + positionTopAndLeft.left = baseLeft + labelPosition; + + if (self.isLabelAxis) { + positionTopAndLeft.left += halfWidth; + } + } + + renderer.renderRotatedLabel({ + degree: degree, + labelText: categories[index], + paper: self.paper, + positionTopAndLeft: positionTopAndLeft, + set: self.axisSet, + theme: theme + }); + }); + }, + + /** + * Make html of normal labels. + * @param {Array.} positions label position array + * @param {string[]} categories categories + * @param {number} labelSize label size + * @param {number} additionalSize additional size + * @private + */ + _renderNormalLabels: function(positions, categories, labelSize, additionalSize) { + var self = this; + var renderer = this.graphRenderer; + var isYAxis = this.isYAxis; + var isPositionRight = this.data.isPositionRight; + var isCategoryLabel = this.isLabelAxis; + var theme = this.theme.label; + var dataProcessor = this.dataProcessor; + var isLineTypeChart = predicate.isLineTypeChart(dataProcessor.chartType, dataProcessor.seriesTypes); + var isPointOnColumn = isLineTypeChart && this.options.pointOnColumn; + var layout = this.layout; + var labelMargin = this.options.labelMargin || 0; + + snippet.forEach(positions, function(position, index) { + var labelPosition = position + additionalSize; + var halfLabelDistance = labelSize / 2; + var positionTopAndLeft = {}; + var labelTopPosition, labelLeftPosition; + + /* + * to prevent printing `undefined` text, when category label is not set + */ + if (labelPosition < 0) { + return; + } + + if (isYAxis) { + labelTopPosition = labelPosition; + + if (isCategoryLabel) { + labelTopPosition += halfLabelDistance + layout.position.top; + } else { + labelTopPosition = layout.dimension.height + layout.position.top - labelTopPosition; + } + + if (isPositionRight) { + labelLeftPosition = layout.position.left + chartConst.AXIS_LABEL_PADDING + labelMargin; + } else { + labelLeftPosition = layout.position.left + layout.dimension.width - + chartConst.AXIS_LABEL_PADDING - labelMargin; + } + } else { + labelTopPosition = layout.position.top + chartConst.CHART_PADDING + + chartConst.AXIS_LABEL_PADDING + labelMargin; + + labelLeftPosition = labelPosition + layout.position.left; + + if (isCategoryLabel) { + if (!isLineTypeChart || isPointOnColumn) { + labelLeftPosition += halfLabelDistance; + } + } + } + + positionTopAndLeft.top = Math.round(labelTopPosition); + positionTopAndLeft.left = Math.round(labelLeftPosition); + + renderer.renderLabel({ + isPositionRight: isPositionRight, + isVertical: isYAxis, + labelSize: labelSize, + labelText: categories[index], + paper: self.paper, + positionTopAndLeft: positionTopAndLeft, + set: self.axisSet, + theme: theme + }); + }); + }, + + /** + * Make labels html. + * @param {Array.} positions - positions for labels + * @param {Array.} categories - categories + * @param {number} labelSize label size + * @param {number} additionalSize additional size + * @private + */ + _renderLabels: function(positions, categories, labelSize, additionalSize) { + var isRotationlessXAxis = !this.isYAxis && this.isLabelAxis && (this.options.rotateLabel === false); + var hasRotatedXAxisLabel = this.componentName === 'xAxis' && this.data.degree; + var axisLabels; + + if (isRotationlessXAxis) { + axisLabels = this.data.multilineLabels; + } else { + axisLabels = categories; + } + + if (axisLabels.length) { + positions.length = axisLabels.length; + } + + axisLabels = renderUtil.addPrefixSuffix(axisLabels, this.options.prefix, this.options.suffix); + + if (hasRotatedXAxisLabel) { + this._renderRotationLabels(positions, axisLabels, labelSize, additionalSize); + } else { + this._renderNormalLabels(positions, axisLabels, labelSize, additionalSize); + } + }, + /** + * Animate axis for adding data + * @param {object} data rendering data + */ + animateForAddingData: function(data) { + if (!this.isYAxis) { + this.graphRenderer.animateForAddingData(data.tickSize); + } + } + }); + + /** + * Factory for Axis + * @param {object} axisParam parameter + * @returns {object} + * @ignore + */ + function axisFactory(axisParam) { + var chartType = axisParam.chartOptions.chartType; + var name = axisParam.name; + + axisParam.isYAxis = (name === 'yAxis' || name === 'rightYAxis'); + axisParam.shifting = axisParam.chartOptions.series.shifting; + + // In combo chart, the theme is divided into series name considering two YAxis(yAxis and rightYAxis) + // @todo change theme structure so that access theme by axis type, not considering chart type + // like theme.xAxis, theme.yAxis, theme.rightYAxis + if (chartType === 'combo') { + if (axisParam.isYAxis) { + axisParam.theme = axisParam.theme[axisParam.seriesTypes[0]]; + } else if (name === 'rightYAxis') { + axisParam.componentType = 'yAxis'; + axisParam.theme = axisParam.theme[axisParam.seriesTypes[1]]; + axisParam.index = 1; + } + // @todo I do not know why the single type chart with yAxis branches once again as the chart name inside it. I feel inconsistent + } else if (axisParam.isYAxis) { + axisParam.theme = axisParam.theme[chartType]; + // single chart, xAxis + } else { + axisParam.theme = axisParam.theme; + } + + return new Axis(axisParam); + } + + axisFactory.componentType = 'axis'; + axisFactory.Axis = Axis; + + module.exports = axisFactory; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview calculator. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + var arrayUtil = __webpack_require__(10); + var PERCENT_DIVISOR = 100; + + /** + * Calculator. + * @module calculator + * @private */ + var calculator = { + /** + * Calculate limit from chart min, max data. + * - http://peltiertech.com/how-excel-calculates-automatic-chart-axis-limits/ + * @memberOf module:calculator + * @param {number} min min minimum value of user data + * @param {number} max max maximum value of user data + * @returns {{min: number, max: number}} limit axis limit + */ + calculateLimit: function(min, max) { + var saveMin = 0, + limit = {}, + iodValue; // increase or decrease value; + + if (min < 0) { + saveMin = min; + max -= min; + min = 0; + } + + iodValue = (max - min) / 20; + limit.max = max + iodValue + saveMin; + + if (max / 6 > min) { + limit.min = saveMin; + } else { + limit.min = min - iodValue + saveMin; + } + + return limit; + }, + + /** + * Make tick positions of pixel type. + * @memberOf module:calculator + * @param {number} size area width or height + * @param {number} count tick count + * @param {?number} additionalPosition additional position + * @returns {Array.} positions + */ + makeTickPixelPositions: function(size, count, additionalPosition) { + var positions = []; + + additionalPosition = additionalPosition || 0; + + if (count > 0) { + positions = snippet.map(snippet.range(0, count), function(index) { + var ratio = index === 0 ? 0 : (index / (count - 1)); + + return (ratio * size) + additionalPosition; + }); + positions[positions.length - 1] -= 1; + } + + return positions; + }, + + /** + * Make labels from limit. + * @memberOf module:calculator + * @param {{min: number, max: number}} limit axis limit + * @param {number} step step between max and min + * @returns {string[]} labels + * @private + */ + makeLabelsFromLimit: function(limit, step) { + var multipleNum = calculator.findMultipleNum(step); + var min = Math.round(limit.min * multipleNum); + var max = Math.round(limit.max * multipleNum); + var labels = snippet.range(min, max + 1, step * multipleNum); + + return snippet.map(labels, function(label) { + return label / multipleNum; + }); + }, + + /** + * Calculate step from limit. + * @memberOf module:calculator + * @param {{min: number, max: number}} limit axis limit + * @param {number} count value count + * @returns {number} step + */ + calculateStepFromLimit: function(limit, count) { + return calculator.divide(calculator.subtract(limit.max, limit.min), (count - 1)); + }, + + /** + * Sum plus values. + * @param {Array.} values values + * @returns {number} sum + */ + sumPlusValues: function(values) { + var plusValues = snippet.filter(values, function(value) { + return value > 0; + }); + + return calculator.sum(plusValues); + }, + + /** + * Sum minus values. + * @param {Array.} values values + * @returns {number} sum + */ + sumMinusValues: function(values) { + var minusValues = snippet.filter(values, function(value) { + return value < 0; + }); + + return calculator.sum(minusValues); + }, + + /** + * Make percentage value. + * @param {number} value - value + * @param {number} totalValue - total value + * @returns {number} + */ + makePercentageValue: function(value, totalValue) { + return value / totalValue * PERCENT_DIVISOR; + }, + + /** + * Calculate ratio for making bound. + * @param {number} value - value + * @param {number} divNumber - number for division + * @param {number} subNumber - number for subtraction + * @param {number} baseRatio - base ratio + * @returns {number} + */ + calculateRatio: function(value, divNumber, subNumber, baseRatio) { + return ((value - subNumber) / divNumber) * baseRatio; + } + }; + + /** + * Get length after decimal point. + * @memberOf module:calculator + * @param {string | number} value target value + * @returns {number} result length + */ + var getDecimalLength = function(value) { + var valueArr = String(value).split('.'); + + return valueArr.length === 2 ? valueArr[1].length : 0; + }; + + /** + * Find multiple num. + * @memberOf module:calculator + * @param {...Array} target values + * @returns {number} multiple num + */ + var findMultipleNum = function() { + var args = [].slice.call(arguments); + var underPointLens = snippet.map(args, function(value) { + return calculator.getDecimalLength(value); + }); + var underPointLen = arrayUtil.max(underPointLens); + + return Math.pow(10, underPointLen); + }; + + /** + * Modulo operation for floating point operation. + * @memberOf module:calculator + * @param {number} target target values + * @param {number} modNum mod num + * @returns {number} result mod + */ + var mod = function(target, modNum) { + var multipleNum = calculator.findMultipleNum(modNum); + var result; + + if (multipleNum === 1) { + result = target % modNum; + } else { + result = ((target * multipleNum) % (modNum * multipleNum)) / multipleNum; + } + + return result; + }; + + /** + * 'add' is function for add operation to floating point. + * @memberOf module:calculator + * @param {number} a target a + * @param {number} b target b + * @returns {number} + */ + var add = function(a, b) { + var multipleNum = calculator.findMultipleNum(a, b); + + return ((a * multipleNum) + (b * multipleNum)) / multipleNum; + }; + + /** + * 'subtract' is function for subtract operation to floating point. + * @memberOf module:calculator + * @param {number} a target a + * @param {number} b target b + * @returns {number} + */ + var subtract = function(a, b) { + var multipleNum = calculator.findMultipleNum(a, b); + + return ((a * multipleNum) - (b * multipleNum)) / multipleNum; + }; + + /** + * 'multiply' is function for multiply operation to floating point. + * @param {number} a target a + * @param {number} b target b + * @returns {number} + */ + var multiply = function(a, b) { + var multipleNum = calculator.findMultipleNum(a, b); + + return ((a * multipleNum) * (b * multipleNum)) / (multipleNum * multipleNum); + }; + + /** + * 'divide' is function for divide operation to floating point. + * @memberOf module:calculator + * @param {number} a target a + * @param {number} b target b + * @returns {number} + */ + var divide = function(a, b) { + var multipleNum = calculator.findMultipleNum(a, b); + + return (a * multipleNum) / (b * multipleNum); + }; + + /** + * Sum. + * @memberOf module:calculator + * @param {Array.} values target values + * @returns {number} result value + */ + var sum = function(values) { + var copyArr = values.slice(); + copyArr.unshift(0); + + return snippet.reduce(copyArr, function(base, value) { + return calculator.add(parseFloat(base), parseFloat(value)); + }); + }; + + calculator.getDecimalLength = getDecimalLength; + calculator.findMultipleNum = findMultipleNum; + calculator.mod = mod; + calculator.add = add; + calculator.subtract = subtract; + calculator.multiply = multiply; + calculator.divide = divide; + calculator.sum = sum; + + module.exports = calculator; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Plot component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var calculator = __webpack_require__(45); + var snippet = __webpack_require__(6); + var map = snippet.map; + + var Plot = snippet.defineClass(/** @lends Plot.prototype */ { + /** + * Plot component. + * @constructs Plot + * @private + * @param {object} params parameters + * @param {number} params.vTickCount vertical tick count + * @param {number} params.hTickCount horizontal tick count + * @param {object} params.theme axis theme + */ + init: function(params) { + /** + * Plot view className + * @type {string} + */ + this.className = 'tui-chart-plot-area'; + + /** + * Data processor + * @type {DataProcessor} + */ + this.dataProcessor = params.dataProcessor; + + /** + * Options + * @type {object} + */ + this.options = params.options || {}; + this.options.showLine = snippet.isUndefined(this.options.showLine) ? true : this.options.showLine; + this.options.lines = this.options.lines || []; + this.options.bands = this.options.bands || []; + + /** + * x axis type option + * @type {?string} + */ + this.xAxisTypeOption = params.xAxisTypeOption; + + /** + * Theme + * @type {object} + */ + this.theme = params.theme || {}; + + /** + * chart type + * @type {string} + */ + this.chartType = params.chartType; + + /** + * sub charts type + * @type {Array.} + */ + this.chartTypes = params.chartTypes; + + /** + * layout bounds information for this components + * @type {null|{dimension:{width:number, height:number}, position:{left:number, top:number}}} + */ + this.layout = null; + + /** + * axis data map + * @type {null|object} + */ + this.axisDataMap = null; + + this.drawingType = chartConst.COMPONENT_TYPE_RAPHAEL; + }, + + /** + * Render plot area. + * @param {object} paper paper object + * @private + */ + _renderPlotArea: function(paper) { + var dimension; + + dimension = this.layout.dimension; + + if (predicate.isLineTypeChart(this.chartType, this.chartTypes)) { + this._renderOptionalLines(paper, dimension); + } + + if (this.options.showLine) { + this._renderPlotLines(paper, dimension); + } + }, + + /** + * Set data for rendering. + * @param {{ + * layout: { + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }, + * axisDataMap: object + * }} data - bounds and scale data + * @private + */ + _setDataForRendering: function(data) { + if (data) { + this.layout = data.layout; + this.dimensionMap = data.dimensionMap; + this.axisDataMap = data.axisDataMap; + this.paper = data.paper; + } + }, + + /** + * Render plot component. + * @param {object} data - bounds and scale data + */ + render: function(data) { + var paper = (data && data.paper) || this.paper; + this.plotSet = paper.set(); + this.additionalPlotSet = paper.set(); + + this._setDataForRendering(data); + this._renderPlotArea(this.paper); + + this.additionalPlotSet.toBack(); + this.plotSet.toBack(); + paper.pushDownBackgroundToBottom(); + }, + + /** + * Rerender. + * @param {object} data - bounds and scale data + */ + rerender: function(data) { + this.additionalPlotSet.remove(); + this.plotSet.remove(); + this.render(data); + }, + + /** + * Resize plot component. + * @param {object} data - bounds and scale data + */ + resize: function(data) { + this.rerender(data); + }, + + /** + * Zoom. + * @param {object} data - bounds and scale data + */ + zoom: function(data) { + this.rerender(data); + }, + + /** + * Make template params for vertical line. + * @param {object} additionalParams - additional params + * @returns {object} + * @private + */ + _makeVerticalLineTemplateParams: function(additionalParams) { + return snippet.extend({ + className: 'vertical', + positionType: 'left', + width: '1px' + }, additionalParams); + }, + + /** + * Make template params for horizontal line. + * @param {object} additionalParams - additional params + * @returns {object} + * @private + */ + _makeHorizontalLineTemplateParams: function(additionalParams) { + return snippet.extend({ + className: 'horizontal', + positionType: 'bottom', + height: '1px' + }, additionalParams); + }, + + /** + * Render line + * @param {number} offsetPosition - start percentage offsetPosition + * @param {object} attributes - line attributes + * @returns {object} path + * @private + */ + _renderLine: function(offsetPosition, attributes) { + var top = this.layout.position.top; + var height = this.layout.dimension.height; + var pathString = 'M' + offsetPosition + ',' + top + 'V' + (top + height); + var path = this.paper.path(pathString); + + path.attr({ + opacity: attributes.opacity || 1, + stroke: attributes.color + }); + + this.additionalPlotSet.push(path); + + return path; + }, + + /** + * Render band + * @param {number} offsetPosition - start percentage offsetPosition + * @param {number} plotWidth - plotWidth + * @param {object} attributes - band attributes + * @returns {object} band + * @private + */ + _renderBand: function(offsetPosition, plotWidth, attributes) { + var position = this.layout.position; + var dimension = this.layout.dimension; + var remainingWidth = dimension.width - offsetPosition + position.left; + var bandWidth = plotWidth < 0 ? remainingWidth : plotWidth; + var rect = this.paper.rect(offsetPosition, position.top, bandWidth, dimension.height); + + rect.attr({ + fill: attributes.color, + opacity: attributes.opacity || 1, + stroke: attributes.color + }); + + this.additionalPlotSet.push(rect); + + return rect; + }, + + /** + * Create value range for optional line. + * @param {{range: ?Array., value: ?number}} optionalLineData - optional line data + * @returns {Array.} + * @private + */ + _createOptionalLineValueRange: function(optionalLineData) { + var range = optionalLineData.range || [optionalLineData.value]; + + if (predicate.isDatetimeType(this.xAxisTypeOption)) { + range = map(range, function(value) { + var date = new Date(value); + + return date.getTime() || value; + }); + } + + return range; + }, + + /** + * Create position for optional line, when value axis. + * @param {{dataMin: number, distance: number}} xAxisData - x axis data + * @param {number} width - width + * @param {number} value - value + * @returns {number|null} + * @private + */ + _createOptionalLinePosition: function(xAxisData, width, value) { + var ratio = (value - xAxisData.dataMin) / xAxisData.distance; + var position = ratio * width; + + if (ratio === 1) { + position -= 1; + } + + if (position < 0) { + position = null; + } + + return position; + }, + + /** + * Create position for optional line, when label axis. + * @param {number} width - width + * @param {number} value - value + * @returns {number|null} + * @private + */ + _createOptionalLinePositionWhenLabelAxis: function(width, value) { + var dataProcessor = this.dataProcessor; + var index = dataProcessor.findCategoryIndex(value); + var position = null; + var ratio; + + if (!snippet.isNull(index)) { + ratio = (index === 0) ? 0 : (index / (dataProcessor.getCategoryCount() - 1)); + position = ratio * width; + } + + if (ratio === 1) { + position -= 1; + } + + return position; + }, + + /** + * Create position map for optional line. + * @param {{range: ?Array., value: ?number}} optionalLineData - optional line data + * @param {{isLabelAxis: boolean, dataMin: number, distance: number}} xAxisData - x axis data + * @param {number} width - width + * @returns {{start: number, end: number}} + * @private + */ + _createOptionalLinePositionMap: function(optionalLineData, xAxisData, width) { + var categories = this.dataProcessor.getCategories(); + var range = this._createOptionalLineValueRange(optionalLineData); + var startPosition, endPosition; + + if (xAxisData.isLabelAxis) { + startPosition = this._createOptionalLinePositionWhenLabelAxis(width, range[0]); + endPosition = this._createOptionalLinePositionWhenLabelAxis(width, range[1]); + } else { + startPosition = this._createOptionalLinePosition(xAxisData, width, range[0]); + endPosition = range[1] && this._createOptionalLinePosition(xAxisData, width, range[1]); + } + + if (snippet.isNull(startPosition)) { + startPosition = this._isBeforeVisibleCategories(range[0], categories[0]) ? 0 : -1; + } + + if (snippet.isNull(endPosition)) { + endPosition = this._isAfterVisibleCatgories(range[1], categories[categories.length - 1]) ? width : -1; + } + + return { + start: startPosition, + end: endPosition + }; + }, + + /** + * @param {string} value - value of starting point + * @param {string} firstCategory - first visible category data + * @returns {boolean} - whether starting point value is at before first visible category data or not + * @private + */ + _isBeforeVisibleCategories: function(value, firstCategory) { + var dataProcessor = this.dataProcessor; + var valueIndex, firstCategoryIndex; + + if (!snippet.isExisty(value)) { + return false; + } + + if (predicate.isDatetimeType(this.xAxisTypeOption)) { + return value < firstCategory; + } + + valueIndex = dataProcessor.findAbsoluteCategoryIndex(value); + firstCategoryIndex = dataProcessor.findAbsoluteCategoryIndex(firstCategory); + + return (valueIndex >= 0) && (valueIndex < firstCategoryIndex); + }, + + /** + * @param {string} value - value of end point + * @param {string} lastCategory - last visible category data + * @returns {boolean} - whether end point value is at after last visible category data or not + * @private + */ + _isAfterVisibleCatgories: function(value, lastCategory) { + var dataProcessor = this.dataProcessor; + var valueIndex, lastCategoryIndex; + + if (!snippet.isExisty(value)) { + return false; + } + + if (predicate.isDatetimeType(this.xAxisTypeOption)) { + return value > lastCategory; + } + + valueIndex = dataProcessor.findAbsoluteCategoryIndex(value); + lastCategoryIndex = dataProcessor.findAbsoluteCategoryIndex(lastCategory); + + return (valueIndex >= 0) && (valueIndex > lastCategoryIndex); + }, + + /** + * Render optional line. + * @param {Array.} xAxisData - positions + * @param {number} width - standard width + * @param {object} attributes - template parameters + * @param {object} optionalLineData - optional line information + * @returns {object} + * @private + */ + _renderOptionalLine: function(xAxisData, width, attributes, optionalLineData) { + var positionMap = this._createOptionalLinePositionMap(optionalLineData, xAxisData, width); + var line; + + if (positionMap.start >= 0 && positionMap.start <= width) { + attributes.width = 1; + + attributes.color = optionalLineData.color || 'transparent'; + attributes.opacity = optionalLineData.opacity; + + line = this._renderLine(positionMap.start + this.layout.position.left, attributes); + } + + return line; + }, + + /** + * Render optional band. + * @param {Array.} xAxisData - positions + * @param {number} width - standard width + * @param {object} attributes - template parameters + * @param {object} optionalLineData - optional line information + * @returns {object} + * @private + */ + _makeOptionalBand: function(xAxisData, width, attributes, optionalLineData) { + var range = optionalLineData.range; + var positionMaps; + + if (range && range.length) { + this._makeRangeTo2DArray(optionalLineData); + } + + positionMaps = map(optionalLineData.range, function(rangeItem) { + return this._createOptionalLinePositionMap({range: rangeItem}, xAxisData, width); + }, this); + + if (optionalLineData.mergeOverlappingRanges) { + positionMaps.sort(compareByStartPosition); + positionMaps = this._mergeOverlappingPositionMaps(positionMaps); + } + + return map(positionMaps, function(positionMap) { + var isStartPositionInsidePlotArea = (positionMap.start) >= 0 && (positionMap.start <= width); + var bandWidth, band; + + if (isStartPositionInsidePlotArea && positionMap.end >= 0) { + attributes.color = optionalLineData.color || 'transparent'; + attributes.opacity = optionalLineData.opacity; + bandWidth = positionMap.end - positionMap.start; + band = this._renderBand(positionMap.start + this.layout.position.left, bandWidth, attributes); + } + + return band; + }, this); + }, + + /** + * Make optional lines html. + * @param {Array.} lines - optional lines + * @param {{width: number, height: number}} dimension - dimension + * @returns {string} + * @private + */ + _makeOptionalLines: function(lines, dimension) { + var width = dimension.width; + var xAxisData = this.axisDataMap.xAxis; + var templateParams = this._makeVerticalLineTemplateParams({ + height: dimension.height + 'px' + }); + var makeOptionalLineHtml = snippet.bind(this._renderOptionalLine, this, xAxisData, width, templateParams); + + return map(lines, makeOptionalLineHtml); + }, + + /** + * Make optional lines html. + * @param {Array.} lines - optional lines + * @param {{width: number, height: number}} dimension - dimension + * @returns {string} + * @private + */ + _makeOptionalBands: function(lines, dimension) { + var width = dimension.width; + var xAxisData = this.axisDataMap.xAxis; + var templateParams = this._makeVerticalLineTemplateParams({ + height: dimension.height + 'px' + }); + var makeOptionalLineHtml = snippet.bind(this._makeOptionalBand, this, xAxisData, width, templateParams); + + return map(lines, makeOptionalLineHtml); + }, + + /** + * Render optional lines and bands. + * @param {object} paper - paper + * @param {{width: number, height: number}} dimension - dimension + * @private + */ + _renderOptionalLines: function(paper, dimension) { + var optionalLines = []; + optionalLines.concat(this._makeOptionalBands(this.options.bands, dimension)); + optionalLines.concat(this._makeOptionalLines(this.options.lines, dimension)); + + this.optionalLines = optionalLines; + }, + + /** + * Maker html for vertical lines + * @param {{width: number, height: number}} dimension - dimension + * @param {string} lineColor - line color + * @private + */ + _renderVerticalLines: function(dimension, lineColor) { + var positions = this._makeHorizontalPositions(dimension.width); + var self = this; + var layout = this.layout; + var left = layout.position.left; + var top = layout.position.top; + + snippet.forEach(positions, function(position) { + var pathString = 'M' + (position + left) + ',' + top + 'V' + (top + layout.dimension.height); + + var path = self.paper.path(pathString); + + path.attr({ + stroke: lineColor, + 'stroke-width': 1 + }); + + self.plotSet.push(path); + }); + }, + + /** + * Maker html for horizontal lines. + * @param {{width: number, height: number}} dimension - dimension + * @param {string} lineColor - line color + * @private + */ + _renderHorizontalLines: function(dimension, lineColor) { + var positions = this._makeVerticalPositions(dimension.height); + var self = this; + var layout = this.layout; + var left = layout.position.left; + var top = layout.position.top; + var distance = positions[1] - positions[0]; + + snippet.forEach(positions, function(position, index) { + var pathString = 'M' + left + ',' + ((distance * index) + top) + 'H' + (left + layout.dimension.width); + var path = self.paper.path(pathString); + + path.attr({ + stroke: lineColor, + 'stroke-width': 1 + }); + + self.plotSet.push(path); + }); + }, + + /** + * Render plot lines. + * @param {HTMLElement} container - container element + * @param {{width: number, height: number}} dimension plot area dimension + * @private + */ + _renderPlotLines: function(container, dimension) { + var theme = this.theme; + + if (!predicate.isLineTypeChart(this.chartType)) { + this._renderVerticalLines(dimension, theme.lineColor); + } + + this._renderHorizontalLines(dimension, theme.lineColor); + }, + + /** + * Make positions for vertical line. + * @param {number} height plot height + * @returns {Array.} positions + * @private + */ + _makeVerticalPositions: function(height) { + var axisDataMap = this.axisDataMap; + var yAxis = axisDataMap.yAxis || axisDataMap.rightYAxis; + var positions = calculator.makeTickPixelPositions(height, yAxis.validTickCount); + + positions.shift(); + + return positions; + }, + + /** + * Make divided positions of plot. + * @param {number} width - plot width + * @param {number} tickCount - tick count + * @returns {Array.} + * @private + */ + _makeDividedPlotPositions: function(width, tickCount) { + var yAxisWidth = this.dimensionMap.yAxis.width; + var leftWidth, rightWidth, leftPositions, rightPositions; + + tickCount = parseInt(tickCount / 2, 10) + 1; + width -= yAxisWidth; + leftWidth = Math.round((width) / 2); + rightWidth = width - leftWidth; + + leftPositions = calculator.makeTickPixelPositions(leftWidth, tickCount); + rightPositions = calculator.makeTickPixelPositions(rightWidth, tickCount, leftWidth + yAxisWidth); + + leftPositions.pop(); + rightPositions.shift(); + + return leftPositions.concat(rightPositions); + }, + + /** + * Make positions for horizontal line. + * @param {number} width plot width + * @returns {Array.} positions + * @private + */ + _makeHorizontalPositions: function(width) { + var tickCount = this.axisDataMap.xAxis.validTickCount; + var positions; + + if (this.options.divided) { + positions = this._makeDividedPlotPositions(width, tickCount); + } else { + positions = calculator.makeTickPixelPositions(width, tickCount); + positions.shift(); + } + + return positions; + }, + + /** + * Add plot line. + * @param {{index: number, color: string, id: string}} data - data + */ + addPlotLine: function(data) { + this.options.lines.push(data); + this.rerender(); + }, + + /** + * Add plot band. + * @param {{range: Array., color: string, id: string}} data - data + */ + addPlotBand: function(data) { + this.options.bands.push(data); + this.rerender(); + }, + + /** + * Remove plot line. + * @param {string} id - line id + */ + removePlotLine: function(id) { + this.options.lines = snippet.filter(this.options.lines, function(line) { + return line.id !== id; + }); + this.rerender(); + }, + + /** + * Remove plot band. + * @param {string} id - band id + */ + removePlotBand: function(id) { + this.options.bands = snippet.filter(this.options.bands, function(band) { + return band.id !== id; + }); + this.rerender(); + }, + + /** + * Animate for adding data. + * @param {{tickSize: number, shifting: boolean}} data - data for animation + */ + animateForAddingData: function(data) { + var self = this; + + if (!this.dataProcessor.isCoordinateType()) { + if (data.shifting) { + snippet.forEach(this.optionalLines, function(line) { + var bbox = line.getBBox(); + + if (bbox.x - data.tickSize < self.layout.position.left) { + line.animate({ + transform: 'T' + data.tickSize + ',' + bbox.y, + opacity: 0 + }, 300, 'linear', function() { + line.remove(); + }); + } else { + line.animate({ + transform: 'T' + data.tickSize + ',' + bbox.y + }, 300); + } + }); + } + } + }, + + /** + * Check if optionalLineData has range property and range property is 2D array + * @param {{range: ?Array.}} optionalLineData - optional line data + * @private + */ + _makeRangeTo2DArray: function(optionalLineData) { + var range = optionalLineData.range; + var isOneDimensionArray = range && snippet.isArray(range) && + (range.length === 0 || !snippet.isArray(range[0])); + + if (isOneDimensionArray) { + optionalLineData.range = [range]; + } + }, + + /** + * check if some areas are overlapped, and then merge overlapping area + * @param {Array.<{start: number, end: number}>} positionMaps - original positionMaps + * @returns {Array.<{start: number, end: number}>} - inspected positionMaps + * @private + */ + _mergeOverlappingPositionMaps: function(positionMaps) { + var i = 1; + var len = positionMaps.length; + var processedMap, previous, current; + + if (len) { + processedMap = [positionMaps[0]]; + previous = processedMap[0]; + } + + for (; i < len; i += 1) { + current = positionMaps[i]; + + if (current.start <= previous.end) { + previous.end = Math.max(current.end, previous.end); + } else { + processedMap.push(current); + previous = current; + } + } + + return processedMap; + } + }); + + /** + * Compare positionMap by it's start value + * @param {{start: number, end: number}} previous - previouse plot band positionMap + * @param {{start: number, end: number}} current - current plot band positionMap + * @returns {number} - comparison of whether a is greater than b + * @ignore + */ + function compareByStartPosition(previous, current) { + return previous.start - current.start; + } + + /** + * Factory for Plot + * @param {object} param parameter + * @returns {object} + * @ignore + */ + function plotFactory(param) { + var chartType = param.chartOptions.chartType; + var seriesTypes = param.seriesTypes; + var xAxisType = param.chartOptions.xAxis.type; + + // same among bar, chart, line, area charts + param.chartType = chartType; + param.chartTypes = seriesTypes; + param.xAxisTypeOption = xAxisType; + + return new Plot(param); + } + + plotFactory.componentType = 'plot'; + plotFactory.Plot = Plot; + + module.exports = plotFactory; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Title component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var pluginFactory = __webpack_require__(32); + var snippet = __webpack_require__(6); + + var Title = snippet.defineClass(/** @lends Title.prototype */ { + /** + * Title component. + * @constructs Title + * @param {object} params parameters + * @param {object} params.bound title bound + * @param {object} params.theme title theme + * @param {object} params.options title options + * @param {object} params.text title text content + */ + init: function(params) { + /** + * Theme + * @type {object} + */ + this.theme = params.theme || {}; + + /** + * Title text content + * @type {string} + */ + this.titleText = params.text; + + /** + * Relative offset position + * @type {object} + */ + this.offset = params.offset; + + /** + * Graph renderer + * @type {object} + */ + this.graphRenderer = pluginFactory.get(chartConst.COMPONENT_TYPE_RAPHAEL, 'title'); + + /** + * Drawing type + * @type {string} + */ + this.drawingType = chartConst.COMPONENT_TYPE_RAPHAEL; + }, + + /** + * Render title component + * @param {object} data data for render title + */ + render: function(data) { + this.titleSet = this._renderTitleArea(data.paper); + }, + + /** + * Render title component + * @param {object} data data for render title + */ + resize: function(data) { + var dimensionMap = data.dimensionMap; + var legendWidth = dimensionMap.legend ? dimensionMap.legend.width : 0; + var width = dimensionMap.series.width + legendWidth; + this.graphRenderer.resize(width, this.titleSet); + }, + + /** + * Render title component + * @param {object} data data for render title + */ + rerender: function(data) { + this.titleSet.remove(); + + this.render(data); + }, + + /** + * Render title on given paper + * @param {object} paper paper object + * @returns {object} raphael paper + * @private + */ + _renderTitleArea: function(paper) { + return this.graphRenderer.render(paper, this.titleText, this.offset, this.theme); + } + }); + + /** + * Factory for Title + * @param {object} param parameter + * @returns {object|null} + * @ignore + */ + function titleFactory(param) { + var options = param.chartOptions.chart || {title: {}}; + var title = null; + + if (options.title && options.title.text) { + param.text = options.title.text; + param.offset = options.title.offset; + + title = new Title(param); + } + + return title; + } + + titleFactory.componentType = 'title'; + titleFactory.Title = Title; + + module.exports = titleFactory; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Radial plot component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var geom = __webpack_require__(49); + var chartConst = __webpack_require__(8); + var pluginFactory = __webpack_require__(32); + var snippet = __webpack_require__(6); + + var RadialPlot = snippet.defineClass(/** @lends Plot.prototype */ { + /** + * plot component className + * @type {string} + */ + className: 'tui-chart-plot-area', + + /** + * Plot component. + * @constructs Plot + * @param {object} params parameters + * @param {number} params.vTickCount vertical tick count + * @param {number} params.hTickCount horizontal tick count + * @param {object} params.theme axis theme + */ + init: function(params) { + /** + * Options + * @type {object} + */ + this.options = snippet.extend({ + type: 'spiderweb' + }, params.options); + + /** + * Theme + * @type {object} + */ + this.theme = params.theme || {}; + + /** + * Graph renderer + * @type {object} + */ + this.graphRenderer = pluginFactory.get(chartConst.COMPONENT_TYPE_RAPHAEL, 'radialPlot'); + + this.drawingType = chartConst.COMPONENT_TYPE_RAPHAEL; + }, + + /** + * Render plot area + * @param {object} paper paper object + * @param {object} layout layout + * @param {Array.} plotPositions plot positions + * @param {object} labelData label data + * @returns {Array.} plotSet + */ + _renderPlotArea: function(paper, layout, plotPositions, labelData) { + var renderParams = { + paper: paper, + layout: layout, + plotPositions: plotPositions, + labelData: labelData, + theme: this.theme, + options: this.options + }; + + return this.graphRenderer.render(renderParams); + }, + + /** + * Make plot positions for render + * @param {object} axisDataMap axisDataMap + * @param {object} layout layout + * @returns {Array.} plot positions + */ + _makePositions: function(axisDataMap, layout) { + var width = layout.dimension.width - chartConst.RADIAL_PLOT_PADDING - chartConst.RADIAL_MARGIN_FOR_CATEGORY; + var height = layout.dimension.height - chartConst.RADIAL_PLOT_PADDING - chartConst.RADIAL_MARGIN_FOR_CATEGORY; + var centerX = (width / 2) + (chartConst.RADIAL_PLOT_PADDING / 2) + (chartConst.RADIAL_MARGIN_FOR_CATEGORY / 2) + + layout.position.left; + var centerY = (height / 2) - (chartConst.RADIAL_PLOT_PADDING / 2) - (chartConst.RADIAL_MARGIN_FOR_CATEGORY / 2) + - layout.position.top; + var stepCount = axisDataMap.yAxis.tickCount; + var angleStepCount = axisDataMap.xAxis.labels.length; + + return makeSpiderWebPositions({ + width: width, + height: height, + centerX: centerX, + centerY: centerY, + angleStepCount: angleStepCount, + stepCount: stepCount + }); + }, + + /** + * Make category positions + * @param {object} axisDataMap axisDataMap + * @param {object} layout layout + * @returns {Array.} category positions + */ + _makeCategoryPositions: function(axisDataMap, layout) { + var width = layout.dimension.width - chartConst.RADIAL_PLOT_PADDING - chartConst.RADIAL_CATEGORY_PADDING; + var height = layout.dimension.height - chartConst.RADIAL_PLOT_PADDING - chartConst.RADIAL_CATEGORY_PADDING; + var centerX = (width / 2) + (chartConst.RADIAL_PLOT_PADDING / 2) + (chartConst.RADIAL_CATEGORY_PADDING / 2) + + layout.position.left; + var centerY = (height / 2) - (chartConst.RADIAL_PLOT_PADDING / 2) - (chartConst.RADIAL_CATEGORY_PADDING / 2) + - layout.position.top; + var angleStepCount = axisDataMap.xAxis.labels.length; + + return makeRadialCategoryPositions({ + width: width, + height: height, + centerX: centerX, + centerY: centerY, + angleStepCount: angleStepCount + }); + }, + + /** + * Make label data + * @param {object} axisDataMap axisDataMap + * @param {object} dimension dimension + * @param {Array.} plotPositions plot positions + * @returns {object} + */ + _makeLabelData: function(axisDataMap, dimension, plotPositions) { + var categories = axisDataMap.xAxis.labels; + var stepLabels = axisDataMap.yAxis.labels; + var categoryPositions = this._makeCategoryPositions(axisDataMap, dimension); + var categoryLabelData = []; + var stepLabelData = []; + var i, j; + + for (i = 0; i < categories.length; i += 1) { + categoryLabelData.push({ + text: categories[i], + position: categoryPositions[i] + }); + } + + // skip last step label. it could overlapped by category label + for (j = 0; j < (stepLabels.length - 1); j += 1) { + stepLabelData.push({ + text: stepLabels[j], + position: plotPositions[j][0] + }); + } + + return { + category: categoryLabelData, + step: stepLabelData + }; + }, + + /** + * Render plot component. + * @param {object} data - bounds and scale data + */ + render: function(data) { + var plotPositions = this._makePositions(data.axisDataMap, data.layout); + var labelData = this._makeLabelData(data.axisDataMap, data.layout, plotPositions); + + this.plotSet = this._renderPlotArea(data.paper, data.layout, plotPositions, labelData); + }, + + /** + * Re render plot component + * @param {object} data - bounds and scale data + */ + rerender: function(data) { + this.plotSet.remove(); + + this.render(data); + }, + + /** + * Resize plot component. + * @param {object} data - bounds and scale data + */ + resize: function(data) { + this.rerender(data); + } + }); + + /** + * Make Spider web positions + * @param {object} params parameters + * @param {number} params.width width + * @param {number} params.height height + * @param {number} params.centerX center x coordinate + * @param {number} params.centerY cneter y coordinate + * @param {number} params.angleStepCount angle step count + * @param {number} params.stepCount step count + * @returns {Array} positions + * @private + */ + function makeSpiderWebPositions(params) { + var width = params.width; + var height = params.height; + var centerX = params.centerX; + var centerY = params.centerY; + var angleStepCount = params.angleStepCount; + var stepCount = params.stepCount; + var radius = Math.min(width, height) / 2; + var angleStep = 360 / angleStepCount; + var points = []; + var stepPoints, pointY, point, stepPixel, i, j; + + stepPixel = radius / (stepCount - 1); // As there is not size in step 0, one step is removed + + for (i = 0; i < stepCount; i += 1) { + stepPoints = []; + // point Y of first pixel to rotate + pointY = centerY + (stepPixel * i); + + for (j = 0; j < angleStepCount; j += 1) { + point = geom.rotatePointAroundOrigin(centerX, centerY, centerX, pointY, angleStep * j); + + stepPoints.push({ + left: point.x, + top: height - point.y // convert y to top + }); + } + + stepPoints.push(stepPoints[0]); + + points[i] = stepPoints; + } + + return points; + } + + /** + * Make radial category positions + * @param {object} params parameters + * @param {number} params.width width + * @param {number} params.height height + * @param {number} params.centerX center x coordinate + * @param {number} params.centerY cneter y coordinate + * @param {number} params.angleStepCount angle step count + * @returns {Array} category positions + * @private + */ + function makeRadialCategoryPositions(params) { + var width = params.width; + var height = params.height; + var centerX = params.centerX; + var centerY = params.centerY; + var angleStepCount = params.angleStepCount; + var radius = Math.min(height, width) / 2; + var angleStep = 360 / angleStepCount; + var points = []; + var anchor, point, i, pointY, reversedAngle; + + pointY = centerY + radius; + + for (i = 0; i < angleStepCount; i += 1) { + reversedAngle = 360 - (angleStep * i); + point = geom.rotatePointAroundOrigin(centerX, centerY, centerX, pointY, reversedAngle); + + if (reversedAngle > 0 && reversedAngle < 180) { + anchor = 'end'; + } else if (reversedAngle > 180 && reversedAngle < 360) { + anchor = 'start'; + } else { + anchor = 'middle'; + } + + points.push({ + left: point.x, + top: height - point.y, // convert y to top + anchor: anchor + }); + } + + return points; + } + + function RadialPlotFactory(param) { + return new RadialPlot(param); + } + + RadialPlotFactory.componentType = 'plot'; + RadialPlotFactory.RadialPlot = RadialPlot; + + module.exports = RadialPlotFactory; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview module for geometric operation + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + + /** + * Rotate a point around the origin with an angle. + * @param {number} centerX center point x + * @param {number} centerY center point y + * @param {number} pointX point x to rotate + * @param {number} pointY point y to rotate + * @param {number} angle angle + * @returns {object} x, y + * @ignore + */ + function rotatePointAroundOrigin(centerX, centerY, pointX, pointY, angle) { + var rad = angle * (Math.PI / 180); + + var newX = ((pointX - centerX) * Math.cos(rad)) - ((pointY - centerY) * Math.sin(rad)); + var newY = ((pointX - centerX) * Math.sin(rad)) + ((pointY - centerY) * Math.cos(rad)); + + newX += centerX; + newY += centerY; + + return { + x: newX, + y: newY + }; + } + /** + * Calculate adjacent. + * @param {number} degree degree + * @param {number} hypotenuse hypotenuse + * @returns {number} adjacent + * @ignore + * + * H : Hypotenuse + * A : Adjacent + * O : Opposite + * D : Degree + * + * /| + * / | + * H / | O + * / | + * /\ D | + * ----- + * A + */ + function calculateAdjacent(degree, hypotenuse) { + return Math.cos(degree * chartConst.RAD) * hypotenuse; + } + + /** + * Calculate opposite. + * @param {number} degree degree + * @param {number} hypotenuse hypotenuse + * @returns {number} opposite + * @ignore + */ + function calculateOpposite(degree, hypotenuse) { + return Math.sin(degree * chartConst.RAD) * hypotenuse; + } + + /** + * Calculate rotated width. + * @param {number} degree - degree + * @param {number} width - width + * @param {number} height - height + * @returns {number} + * @ignore + */ + function calculateRotatedWidth(degree, width, height) { + var centerHalf = calculateAdjacent(degree, width / 2); + var sideHalf = calculateAdjacent(chartConst.ANGLE_90 - degree, height / 2); + + return (centerHalf + sideHalf) * 2; + } + + /** + * Calculate rotated height + * @param {number} degree - degree + * @param {number} width - width + * @param {number} height - height + * @returns {number} + * @ignore + */ + function calculateRotatedHeight(degree, width, height) { + var centerHalf = calculateOpposite(degree, width / 2); + var sideHalf = calculateOpposite(chartConst.ANGLE_90 - degree, height / 2); + + return (centerHalf + sideHalf) * 2; + } + + module.exports = { + rotatePointAroundOrigin: rotatePointAroundOrigin, + calculateAdjacent: calculateAdjacent, + calculateRotatedHeight: calculateRotatedHeight, + calculateRotatedWidth: calculateRotatedWidth, + calculateOpposite: calculateOpposite + }; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview chartExportMenu component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var chartExporter = __webpack_require__(51); + var dom = __webpack_require__(9); + var eventListener = __webpack_require__(55); + var predicate = __webpack_require__(11); + var renderUtil = __webpack_require__(7); + var snippet = __webpack_require__(6); + + var CHART_EXPORT_MENU_ITEMS = ['xls', 'csv', 'png', 'jpeg']; + var CLASS_NAME_CHART_EXPORT_MENU_OPENED = 'menu-opened'; + + var ChartExportMenu = snippet.defineClass(/** @lends ChartExportMenu.prototype */ { + /** + * ChartExportMenu component. + * @constructs ChartExportMenu + * @private + * @param {object} params parameters + */ + init: function(params) { + /** + * ChartExportMenu view className + * @type {string} + */ + this.className = 'tui-chart-chartExportMenu-area'; + + /** + * Data processor + * @type {DataProcessor} + */ + this.dataProcessor = params.dataProcessor; + + /** + * chart title + * @type {string} + */ + this.chartTitle = params.chartTitle || 'tui-chart'; + + /** + * export filename + * @type {string} + */ + this.exportFilename = params.exportFilename || this.chartTitle; + + /** + * chart type + * @type {string} + */ + this.chartType = params.chartType; + + /** + * layout bounds information for this components + * @type {null|{dimension:{width:number, height:number}, position:{right:number, top:number}}} + */ + this.layout = null; + + /** + * chartExportMenu container + * @type {HTMLElement} + */ + this.chartExportMenuContainer = null; + + /** + * chartExportMenu element + * @type {HTMLElement} + */ + this.chartExportMenu = null; + + /** + * chartExportMenu options + */ + this.options = params.options; + + /** + * Event bus + * @type {EventBus} + */ + this.eventBus = params.eventBus; + + this.drawingType = chartConst.COMPONENT_TYPE_DOM; + + this.theme = params.theme || null; + }, + + /** + * Create chartExportMenuButton + * @returns {HTMLElement} + * @private + */ + _createChartExportMenuButton: function() { + var menuButton = dom.create('div', chartConst.CLASS_NAME_CHART_EXPORT_MENU_BUTTON); + + if (this.options.buttonClass) { + dom.addClass(menuButton, this.options.buttonClass); + } + + return menuButton; + }, + /** + * Render chartExportMenu area. + * @param {HTMLElement} chartExportMenuContainer chartExportMenu area element + * @private + */ + _renderChartExportMenuArea: function(chartExportMenuContainer) { + var menuButton = this._createChartExportMenuButton(); + var dimension = this.layout.dimension; + + chartExportMenuContainer.appendChild(menuButton); + + renderUtil.renderDimension(chartExportMenuContainer, dimension); + renderUtil.renderPosition(chartExportMenuContainer, this.layout.position); + }, + + /** + * Render chartExportMenu area. + * @param {HTMLElement} chartExportMenuContainer chartExportMenu area element + * @private + */ + _renderChartExportMenu: function(chartExportMenuContainer) { + var seriesDataModelMap = this.dataProcessor.seriesDataModelMap; + var isDataDownloadAvailable = this.isDataDownloadAvailable(seriesDataModelMap); + var isDownloadSupported = chartExporter.isDownloadSupported; + var isImageExtension = chartExporter.isImageExtension; + var isImageDownloadAvailable = chartExporter.isImageDownloadAvailable; + var menuElement = dom.create('ul', chartConst.CLASS_NAME_CHART_EXPORT_MENU); + var menuStyle = menuElement.style; + var menuTheme = this.theme; + var menuItems = []; + + if (isDownloadSupported && (isDataDownloadAvailable || isImageDownloadAvailable)) { + menuItems = snippet.map(CHART_EXPORT_MENU_ITEMS, function(exportItemType) { + var itemElement; + + if ((!isImageExtension(exportItemType) && isDataDownloadAvailable) + || (isImageExtension(exportItemType) && isImageDownloadAvailable) + ) { + itemElement = dom.create('li', chartConst.CLASS_NAME_CHART_EXPORT_MENU_ITEM); + itemElement.id = exportItemType; + itemElement.innerHTML = 'Export to .' + exportItemType; + } + + return itemElement; + }); + } else { + menuStyle.width = '200px'; + menuItems[0] = dom.create('li', chartConst.CLASS_NAME_CHART_EXPORT_MENU_ITEM); + menuItems[0].innerHTML = 'Browser does not support client-side download.'; + } + + if (menuTheme) { + if (menuTheme.borderWidth) { + menuStyle.borderWidth = menuTheme.borderWidth; + } + + if (menuTheme.borderRadius) { + menuStyle.borderRadius = menuTheme.borderRadius; + } + + if (menuTheme.backgroundColor) { + menuStyle.backgroundColor = menuTheme.backgroundColor; + } + + if (menuTheme.color) { + menuStyle.color = menuTheme.color; + } + } + + if (this.options.menuClass) { + dom.addClass(menuElement, this.options.menuClass); + } + + dom.append(menuElement, menuItems); + + this.chartExportMenu = menuElement; + + dom.append(chartExportMenuContainer, menuElement); + }, + + /** + * Set data for rendering. + * @param {{ + * layout: { + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }, + * axisDataMap: object + * }} data - bounds and scale data + * @private + */ + _setDataForRendering: function(data) { + if (data) { + this.layout = data.layout; + this.dimensionMap = data.dimensionMap; + this.axisDataMap = data.axisDataMap; + } + }, + + /** + * Render chartExportMenu component. + * @param {object} data - bounds and scale data + * @returns {HTMLElement} chartExportMenu element + */ + render: function(data) { + var container = null; + + if (chartExporter.isDownloadSupported) { + container = this.container = data.paper; + + dom.addClass(container, this.className); + + this._setDataForRendering(data); + this._renderChartExportMenuArea(container); + this._renderChartExportMenu(container); + this.chartExportMenuContainer = container; + this._attachEvent(); + } + + return container; + }, + + /** + * Rerender. + */ + rerender: function() { + this._hideChartExportMenu(); + }, + + /** + * Resize. + */ + resize: function() { + }, + + /** + * Show chart export menu + * @private + */ + _showChartExportMenu: function() { + dom.addClass(this.chartExportMenuContainer, CLASS_NAME_CHART_EXPORT_MENU_OPENED); + this.chartExportMenu.style.display = 'block'; + }, + + /** + * Hide chart export menu + * @private + */ + _hideChartExportMenu: function() { + if (this.chartExportMenuContainer) { + dom.removeClass(this.chartExportMenuContainer, CLASS_NAME_CHART_EXPORT_MENU_OPENED); + this.chartExportMenu.style.display = 'none'; + } + }, + + /** + * onclick event handler + * @param {MouseEvent} e mouse event + * @private + */ + _onClick: function(e) { + var elTarget = e.target || e.srcElement; + var svgElement = this.container.parentNode.getElementsByTagName('svg')[0]; + + if (dom.hasClass(elTarget, chartConst.CLASS_NAME_CHART_EXPORT_MENU_ITEM)) { + if (elTarget.id) { + this.eventBus.fire('beforeImageDownload'); + + chartExporter.exportChart(this.exportFilename, elTarget.id, + this.dataProcessor.rawData, svgElement, this.options); + + this.eventBus.fire('afterImageDownload'); + } + + this._hideChartExportMenu(); + } else if (dom.hasClass(elTarget, chartConst.CLASS_NAME_CHART_EXPORT_MENU_BUTTON) + && (this.chartExportMenuContainer === elTarget.parentNode) + && !dom.hasClass(this.chartExportMenuContainer, CLASS_NAME_CHART_EXPORT_MENU_OPENED)) { + this._showChartExportMenu(); + } else { + this._hideChartExportMenu(); + } + }, + + /** + * Return boolean value for chart data is able to export + * @param {object} seriesDataModels series data model + * @returns {boolean} + */ + isDataDownloadAvailable: function(seriesDataModels) { + var result = true; + + if (predicate.isTreemapChart(this.chartType)) { + result = false; + } else { + snippet.forEach(seriesDataModels, function(seriesDataModel) { + if (seriesDataModel.isCoordinateType) { + result = false; + } + + return false; + }); + } + + return result; + }, + + /** + * Attach browser event. + * @private + */ + _attachEvent: function() { + eventListener.on(this.chartExportMenuContainer.parentNode, 'click', this._onClick, this); + }, + + /** + * Detach browser event. + * @private + */ + _detachEvent: function() { + eventListener.off(this.chartExportMenuContainer.parentNode, 'click', this._onClick); + } + }); + + /** + * Factory for ChartExportMenu + * @param {object} params parameter + * @returns {object|null} + * @ignore + */ + function chartExportMenuFactory(params) { + var isVisible = params.options.visible; + var chartExportMenu = null; + var chartOption = params.chartOptions.chart || {}; + var exportingOption = params.chartOptions.chartExportMenu; + + if (chartOption.title) { + params.chartTitle = chartOption.title.text; + } + + if (exportingOption && exportingOption.filename) { + params.exportFilename = exportingOption.filename; + } + + if (isVisible) { + chartExportMenu = new ChartExportMenu(params); + } + + return chartExportMenu; + } + + chartExportMenuFactory.componentType = 'chartExportMenu'; + + module.exports = chartExportMenuFactory; + + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileOverview Chart exporter + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var arrayUtil = __webpack_require__(10); + var dataExporter = __webpack_require__(52); + var imageExporter = __webpack_require__(54); + var snippet = __webpack_require__(6); + + var browser = snippet.browser; + + var isIE10OrIE11 = browser.msie && (browser.version === 10 || browser.version === 11); + var isImageDownloadAvailable = !isIE10OrIE11 + || (isIE10OrIE11 && document.createElement('canvas').getContext('2d').drawSvg); + var isDownloadAttributeSupported = snippet.isExisty(document.createElement('a').download); + var isMsSaveOrOpenBlobSupported = window.Blob && window.navigator.msSaveOrOpenBlob; + + /** + * Return given extension type is image format + * @param {string} extension extension + * @returns {boolean} + * @ignore + */ + function isImageExtension(extension) { + return arrayUtil.any(imageExporter.getExtensions(), function(imageExtension) { + return extension === imageExtension; + }); + } + /** + * Return given extension type is data format + * @param {string} extension extension + * @returns {boolean} + * @ignore + */ + function isDataExtension(extension) { + return arrayUtil.any(dataExporter.getExtensions(), function(dataExtension) { + return extension === dataExtension; + }); + } + + /** + * Download chart data with given export type + * @param {string} fileName - file name = chart title + * @param {string} extension - file extension + * @param {object} rawData - chart raw data + * @param {HTMLElement} svgElement - svg element + * @param {object} [downloadOptions] download option + * @ignore + */ + function exportChart(fileName, extension, rawData, svgElement, downloadOptions) { + var downloadOption = (downloadOptions && downloadOptions[extension] ? downloadOptions[extension] : {}); + + if (isImageExtension(extension)) { + imageExporter.downloadImage(fileName, extension, svgElement); + } else if (isDataExtension(extension)) { + dataExporter.downloadData(fileName, extension, rawData, downloadOption); + } + } + + module.exports = { + exportChart: exportChart, + isDownloadSupported: isDownloadAttributeSupported || isMsSaveOrOpenBlobSupported, + isImageDownloadAvailable: isImageDownloadAvailable, + isImageExtension: isImageExtension, + + /** + * Add file extension to dataExtension + * @param {string} type file extension type + * @param {string} extension file extension + */ + addExtension: function(type, extension) { + var isValidExtension = extension && snippet.isString(extension); + var exporter, extensions; + + if (type === 'data') { + exporter = dataExporter; + } else if (type === 'image') { + exporter = imageExporter; + } + + if (exporter && isValidExtension) { + extensions = exporter.getExtensions(); + extensions.push(extension); + } + } + }; + + +/***/ }), +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileOverview Chart data exporter + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var downloader = __webpack_require__(53); + var chartConst = __webpack_require__(8); + var snippet = __webpack_require__(6); + + var DATA_URI_HEADERS = { + xls: 'data:application/vnd.ms-excel;base64,', + csv: 'data:text/csv;charset=utf-8,%EF%BB%BF' /* BOM for utf-8 */ + }; + var DATA_URI_BODY_MAKERS = { + xls: _makeXlsBodyWithRawData, + csv: _makeCsvBodyWithRawData + }; + var dataExtensions = [].concat([], chartConst.DATA_EXTENSIONS); + + var dataExporter = { + /** + * Download chart data + * @param {string} fileName file name + * @param {string} extension file extension + * @param {object} rawData raw data of chart + * @param {object} [downloadOption] download option + */ + downloadData: function(fileName, extension, rawData, downloadOption) { + var chartData2DArray = _get2DArrayFromRawData(rawData); + var content = DATA_URI_HEADERS[extension] + DATA_URI_BODY_MAKERS[extension](chartData2DArray, downloadOption); + + downloader.execDownload(fileName, extension, content); + }, + + /** + * Returns data extensions + * @returns {Array.} + */ + getExtensions: function() { + return dataExtensions; + } + }; + + /** + * Get pivoted second dimension array from table to use element.innerText + * @param {rawData} rawData - chart's raw data + * @returns {Array.} + * @private + */ + function _get2DArrayFromRawData(rawData) { + var resultArray = []; + var categories; + var isHeatMap = (rawData.categories && snippet.isExisty(rawData.categories.x)); + var isBullet = (rawData.series && snippet.isExisty(rawData.series.bullet)); + var return2DArrayData = false; + + if (rawData) { + if (isHeatMap) { + return2DArrayData = _get2DArrayFromHeatmapRawData(rawData); + } else if (isBullet) { + return2DArrayData = _get2DArrayFromBulletRawData(rawData); + } else if (rawData.categories) { + categories = rawData.categories; + } + if (return2DArrayData) { + return return2DArrayData; + } + + resultArray.push([''].concat(categories)); + + snippet.forEach(rawData.series, function(seriesDatum) { + snippet.forEach(seriesDatum, function(seriesItem) { + var row = [seriesItem.name].concat(seriesItem.data); + + resultArray.push(row); + }); + }); + } + + return resultArray; + } + + /** + * Make table head data for Excel + * @param {number} maxRangeCount - max range count + * @param {number} maxMarkerCount - max marker count + * @returns {Array.} - table head data + * @private + */ + function _makeTHeadForBullet(maxRangeCount, maxMarkerCount) { + var tableHead = ['', chartConst.BULLET_TYPE_ACTUAL]; + var i = 0; + + for (; i < maxRangeCount; i += 1) { + tableHead.push(chartConst.BULLET_TYPE_RANGE + i); + } + + i = 0; + for (; i < maxMarkerCount; i += 1) { + tableHead.push(chartConst.BULLET_TYPE_MARKER + i); + } + + return tableHead; + } + + /** + * Make table cells from bullet ranges + * @param {Array.>} ranges - series item's ranges data + * @param {number} maxRangeCount - max range count + * @returns {Array.} - cells containing range data + * @private + */ + function _makeTCellsFromBulletRanges(ranges, maxRangeCount) { + var cells = []; + var i = 0; + var dataText; + + for (; i < maxRangeCount; i += 1) { + dataText = ''; + + if (ranges && ranges[i]) { + dataText = ((ranges[i].length > 0) ? ranges[i][0] : '') + + '~' + ((ranges[i].length > 1) ? ranges[i][1] : ''); + } + cells.push(dataText); + } + + return cells; + } + + /** + * Make table cells from bullet markers + * @param {Array.>} markers - series item's markers data + * @param {number} maxMarkerCount - max marker count + * @returns {Array.} - cells containing marker data + * @private + */ + function _makeTCellsFromBulletMarkers(markers, maxMarkerCount) { + var cells = []; + var i = 0; + var dataText; + + for (; i < maxMarkerCount; i += 1) { + dataText = markers && markers[i] ? markers[i] : ''; + cells.push(dataText); + } + + return cells; + } + + /** + * Make table data for importing in excel, by using bullet chart raw data + * @param {object} rawData - raw data + * @param {object} [options] download option + * @returns {Array.>} - table data for importing in excel + * @private + */ + function _get2DArrayFromBulletRawData(rawData) { + var resultArray = []; + var maxCounts = _calculateMaxCounts(rawData.series.bullet); + var maxRangeCount = maxCounts.maxRangeCount; + var maxMarkerCount = maxCounts.maxMarkerCount; + + resultArray.push(_makeTHeadForBullet(maxRangeCount, maxMarkerCount)); + + snippet.forEach(rawData.series.bullet, function(seriesItem) { + var row = [seriesItem.name, seriesItem.data]; + + row = row.concat(_makeTCellsFromBulletRanges(seriesItem.ranges, maxRangeCount)); + row = row.concat(_makeTCellsFromBulletMarkers(seriesItem.markers, maxMarkerCount)); + resultArray.push(row); + }); + + return resultArray; + } + + /** + * Calculate maxinum count of range and marker property + * @param {object} bulletSeries - raw series data of bullet chart + * @returns {object} - maximum count of range and marker property + * @private + */ + function _calculateMaxCounts(bulletSeries) { + var maxRangeCount = 0; + var maxMarkerCount = 0; + + snippet.forEach(bulletSeries, function(series) { + maxRangeCount = Math.max(maxRangeCount, series.ranges.length); + maxMarkerCount = Math.max(maxMarkerCount, series.markers.length); + }); + + return { + maxRangeCount: maxRangeCount, + maxMarkerCount: maxMarkerCount + }; + } + + /** + * Make table data for importing in excel, by using heatmap chart raw data + * @param {object} rawData - raw data + * @returns {Array.>} - table data for importing in excel + * @private + */ + function _get2DArrayFromHeatmapRawData(rawData) { + var resultArray = []; + + resultArray.push([''].concat(rawData.categories.x)); + + snippet.forEach(rawData.series, function(seriesDatum) { + snippet.forEach(seriesDatum, function(seriesItem, index) { + var row = [rawData.categories.y[index]].concat(seriesItem); + + resultArray.push(row); + }); + }); + + return resultArray; + } + + /** + * Get table element from chart data 2D array for xls content + * @param {Array.>} chartData2DArray - chart data 2D array + * @returns {string} + * @private + */ + function _getTableElementStringForXls(chartData2DArray) { + var tableElementString = '
'; + snippet.forEach(chartData2DArray, function(row, rowIndex) { + var cellTagName = rowIndex === 0 ? 'th' : 'td'; + + tableElementString += ''; + + snippet.forEach(row, function(cell, cellIndex) { + var cellNumberClass = (rowIndex !== 0 || cellIndex === 0) ? ' class="number"' : ''; + var cellString = '<' + cellTagName + cellNumberClass + '>' + cell + ''; + + tableElementString += cellString; + }); + + tableElementString += ''; + }); + + tableElementString += '
'; + + return tableElementString; + } + + /** + * Make xls file with chart series data + * @param {Array.>} chartData2DArray - chart chartData2DArray + * @returns {string} base64 xls file content + * @private + */ + function _makeXlsBodyWithRawData(chartData2DArray) { + var xlsString = '' + + '' + + '' + + '' + + '' + + '' + + '' + + _getTableElementStringForXls(chartData2DArray) + + '' + + ''; + + return window.btoa(unescape(encodeURIComponent(xlsString))); + } + + /** + * Make csv text with chart series data + * @param {Array.>} chartData2DArray - chart chartData2DArray + * @param {object} [option] - download option + * @param {object} [option.itemDelimiter = ','] - item delimiter + * @param {object} [option.lineDelimiter = '\n'] - line delimiter + * @returns {string} URI encoded csv text + * @private + */ + function _makeCsvBodyWithRawData(chartData2DArray, option) { + var csvText = ''; + var lineDelimiter = (option && option.lineDelimiter) || '\u000a'; + var itemDelimiter = (option && option.itemDelimiter) || ','; + var lastRowIndex = chartData2DArray.length - 1; + + snippet.forEachArray(chartData2DArray, function(row, rowIndex) { + var lastCellIndex = row.length - 1; + + snippet.forEachArray(row, function(cell, cellIndex) { + var cellContent = (snippet.isNumber(cell) ? cell : '"' + cell + '"'); + + csvText += cellContent; + + if (cellIndex < lastCellIndex) { + csvText += itemDelimiter; + } + }); + + if (rowIndex < lastRowIndex) { + csvText += lineDelimiter; + } + }); + + return encodeURIComponent(csvText); + } + + // export private methods for Test + dataExporter._makeCsvBodyWithRawData = _makeCsvBodyWithRawData; + dataExporter._makeXlsBodyWithRawData = _makeXlsBodyWithRawData; + dataExporter._get2DArrayFromRawData = _get2DArrayFromRawData; + dataExporter._get2DArrayFromBulletRawData = _get2DArrayFromBulletRawData; + dataExporter._get2DArrayFromHeatmapRawData = _get2DArrayFromHeatmapRawData; + dataExporter._makeTCellsFromBulletRanges = _makeTCellsFromBulletRanges; + dataExporter._makeTCellsFromBulletMarkers = _makeTCellsFromBulletMarkers; + dataExporter._makeTHeadForBullet = _makeTHeadForBullet; + + module.exports = dataExporter; + + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileOverview File downloader for client-side download + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + var arrayUtil = __webpack_require__(10); + var chartConst = __webpack_require__(8); + + var DOWNLOAD_HANDLERS = { + downloadAttribute: downloadWithAnchorElementDownloadAttribute, + msSaveOrOpenBlob: downloadWithMsSaveOrOpenBlob + }; + + /** + * Return download method name of current browser supports + * @returns {string} + * @ignore + */ + function getDownloadMethod() { + var isDownloadAttributeSupported = snippet.isExisty(document.createElement('a').download); + var isMsSaveOrOpenBlobSupported = window.Blob && window.navigator.msSaveOrOpenBlob; + var method; + + if (isMsSaveOrOpenBlobSupported) { + method = 'msSaveOrOpenBlob'; + } else if (isDownloadAttributeSupported) { + method = 'downloadAttribute'; + } + + return method; + } + + /** + * Base64 string to blob + * original source ref: https://github.com/miguelmota/base64toblob/blob/master/base64toblob.js + * Licence: MIT Licence + * @param {string} base64String - base64 string + * @returns {Blob} + * @ignore + */ + function base64toBlob(base64String) { + var contentType = base64String.substr(0, base64String.indexOf(';base64,')).substr(base64String.indexOf(':') + 1); + var sliceSize = 1024; + var byteCharacters = atob(base64String.substr(base64String.indexOf(',') + 1)); + var byteArrays = []; + var offset, slice, byteNumbers, i, byteArray, resultBlob; + + for (offset = 0; offset < byteCharacters.length; offset += sliceSize) { + slice = byteCharacters.slice(offset, offset + sliceSize); + + byteNumbers = new Array(slice.length); + + for (i = 0; i < slice.length; i += 1) { + byteNumbers[i] = slice.charCodeAt(i); + } + + byteArray = new window.Uint8Array(byteNumbers); + + byteArrays.push(byteArray); + } + + resultBlob = new Blob(byteArrays, {type: contentType}); + + return resultBlob; + } + + /** + * Return given extension type is image format + * @param {string} extension extension + * @returns {boolean} + * @ignore + */ + function isImageExtension(extension) { + return arrayUtil.any(chartConst.IMAGE_EXTENSIONS, function(imageExtension) { + return extension === imageExtension; + }); + } + + /** + * Download content to file with msSaveOrOpenBlob + * @param {string} fileName - file name + * @param {string} extension - file extension + * @param {string} content - file content + * @ignore + */ + function downloadWithMsSaveOrOpenBlob(fileName, extension, content) { + var blobObject = isImageExtension(extension) ? base64toBlob(content) : new Blob([content]); + + window.navigator.msSaveOrOpenBlob(blobObject, fileName + '.' + extension); + } + + /** + * Download content to file with anchor element's download attribute + * @param {string} fileName - file name + * @param {string} extension - file extension + * @param {string} content - file content + * @ignore + */ + function downloadWithAnchorElementDownloadAttribute(fileName, extension, content) { + var anchorElement; + + if (content) { + anchorElement = document.createElement('a'); + + anchorElement.href = content; + anchorElement.target = '_blank'; + anchorElement.download = fileName + '.' + extension; + + document.body.appendChild(anchorElement); + + anchorElement.click(); + anchorElement.remove(); + } + } + + /** + * Download content to file with given filename and extension + * @param {string} fileName - file name + * @param {string} extension - file extension + * @param {string} content - file content + * @ignore + */ + function execDownload(fileName, extension, content) { + var downloadMethod = getDownloadMethod(); + + if (downloadMethod && snippet.isString(content)) { + DOWNLOAD_HANDLERS[downloadMethod](fileName, extension, content); + } + } + + module.exports = { + execDownload: execDownload + }; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileOverview Chart image exporter + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var downloader = __webpack_require__(53); + var chartConst = __webpack_require__(8); + var snippet = __webpack_require__(6); + + var browser = snippet.browser; + var isIE10OrIE11 = browser.msie && (browser.version === 10 || browser.version === 11); + var DOMURL = window.URL || window.webkitURL || window; + var imageExtensions = [].concat([], chartConst.IMAGE_EXTENSIONS); + + /** + * Return svg outerHTML string + * @param {HTMLElement} svgElement svg element + * @returns {string} + * @ignore + */ + function getSvgString(svgElement) { + var svgParent = svgElement.parentNode; + var tempWrapper = document.createElement('DIV'); + var svgString; + + tempWrapper.appendChild(svgElement); + svgString = tempWrapper.innerHTML; + svgParent.appendChild(svgElement); + + tempWrapper = null; + svgParent = null; + + return svgString; + } + + /** + * Download with SVG string and canvg + * @param {HTMLElement} canvas canvas element + * @param {string} svgString svg HTML string + * @param {string} fileName file name + * @param {string} extension file extension + * @ignore + */ + function downloadSvgWithCanvg(canvas, svgString, fileName, extension) { + var ctx = canvas.getContext('2d'); + + // remove name space for IE + if (isIE10OrIE11) { + svgString = svgString.replace(/xmlns:NS1=""/, ''); + svgString = svgString.replace(/NS1:xmlns:xlink="http:\/\/www\.w3\.org\/1999\/xlink"/, ''); + svgString = svgString.replace(/xmlns="http:\/\/www\.w3\.org\/2000\/svg"/, ''); + svgString = svgString.replace(/xmlns:xlink="http:\/\/www\.w3\.org\/1999\/xlink"/, ''); + } + + ctx.drawSvg(svgString, 0, 0); + + downloader.execDownload(fileName, extension, canvas.toDataURL('image/' + extension, 1)); + } + + /** + * Download with SVG string and blob URL + * @param {HTMLElement} canvas canvas element + * @param {string} svgString svg HTML string + * @param {string} fileName file name + * @param {string} extension file extension + * @ignore + */ + function downloadSvgWithBlobURL(canvas, svgString, fileName, extension) { + var ctx = canvas.getContext('2d'); + var blob = new Blob([svgString], {type: 'image/svg+xml'}); + var url = DOMURL.createObjectURL(blob); + var img = new Image(); + + img.onload = function() { + ctx.drawImage(img, 0, 0, canvas.width, canvas.height); + + downloader.execDownload(fileName, extension, canvas.toDataURL('image/' + extension, 1)); + + DOMURL.revokeObjectURL(url); + }; + + img.src = url; + } + + module.exports = { + /** + * Download image with png format + * @param {string} fileName - file name to save + * @param {string} extension - extension type + * @param {HTMLElement} imageSourceElement - image source element + */ + downloadImage: function(fileName, extension, imageSourceElement) { + var svgString, parentNode, canvas; + + if (imageSourceElement.tagName === 'svg') { + parentNode = imageSourceElement.parentNode; + + canvas = document.createElement('canvas'); + + canvas.width = parentNode.offsetWidth; + canvas.height = parentNode.offsetHeight; + + svgString = getSvgString(imageSourceElement); + + if (isIE10OrIE11) { + downloadSvgWithCanvg(canvas, svgString, fileName, extension); + } else { + downloadSvgWithBlobURL(canvas, svgString, fileName, extension); + } + } else if (imageSourceElement.tagName === 'canvas') { + canvas = imageSourceElement; + + downloader.execDownload(fileName, extension, canvas.toDataURL('image/' + extension, 1)); + } + }, + + /** + * Returns data extensions + * @returns {Array.} + */ + getExtensions: function() { + return imageExtensions; + } + }; + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Event listener. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + + var bindHandlerMap = {}; + + /** + * Event listener. + * @module eventListener + * @private */ + var eventListener = { + /** + * Add event listener for IE. + * @memberOf module:eventListener + * @param {HTMLElement} target target element + * @param {string} type event type + * @param {function} handler callback function + * @param {?object} context context for callback + * @private + */ + _attachEvent: function(target, type, handler, context) { + var bindHandler; + + if (context) { + bindHandler = snippet.bind(handler, context); + } else { + bindHandler = handler; + } + + bindHandlerMap[type + handler] = bindHandler; + target.attachEvent('on' + type, bindHandler); + }, + + /** + * Add event listener for other browsers. + * @memberOf module:eventListener + * @param {HTMLElement} target - target element + * @param {string} type - event type + * @param {function} handler - handler + * @param {object} [context] - context for handler + * @private + */ + _addEventListener: function(target, type, handler, context) { + var bindHandler; + + if (context) { + bindHandler = snippet.bind(handler, context); + } else { + bindHandler = handler; + } + + bindHandlerMap[type + handler] = bindHandler; + target.addEventListener(type, bindHandler); + }, + + /** + * Bind DOM event. + * @memberOf module:eventListener + * @memberOf module:eventListener + * @param {HTMLElement} target target element + * @param {string} type event type + * @param {function} handler handler function + * @param {object} [context] - context for handler + * @private + */ + _bindEvent: function(target, type, handler, context) { + var bindEvent; + + if ('addEventListener' in target) { + bindEvent = this._addEventListener; + } else if ('attachEvent' in target) { + bindEvent = this._attachEvent; + } + eventListener._bindEvent = bindEvent; + + bindEvent(target, type, handler, context); + }, + + /** + * Bind DOM events. + * @memberOf module:eventListener + * @param {HTMLElement} target - target element + * @param {string | object} types - type or map of type and handler + * @param {function | object} [handler] - handler or context + * @param {object} [context] - context + */ + on: function(target, types, handler, context) { + var handlerMap = {}; + if (snippet.isString(types)) { + handlerMap[types] = handler; + } else { + handlerMap = types; + context = handler; + } + + snippet.forEach(handlerMap, function(_handler, type) { + eventListener._bindEvent(target, type, _handler, context); + }); + }, + + /** + * Remove event listener for IE. + * @memberOf module:eventListener + * @param {HTMLElement} target - target element + * @param {string} type - event type + * @param {function} handler - handler + * @private + */ + _detachEvent: function(target, type, handler) { + if (bindHandlerMap[type + handler]) { + target.detachEvent('on' + type, bindHandlerMap[type + handler]); + delete bindHandlerMap[type + handler]; + } + }, + + /** + * Add event listener for other browsers. + * @memberOf module:eventListener + * @param {HTMLElement} target - target element + * @param {string} type - event type + * @param {function} handler - handler + * @private + */ + _removeEventListener: function(target, type, handler) { + target.removeEventListener(type, bindHandlerMap[type + handler]); + delete bindHandlerMap[type + handler]; + }, + + /** + * Unbind DOM event. + * @memberOf module:eventListener + * @param {HTMLElement} target - target element + * @param {string} type - event type + * @param {function} handler - handler + * @private + */ + _unbindEvent: function(target, type, handler) { + var unbindEvent; + if ('removeEventListener' in target) { + unbindEvent = eventListener._removeEventListener; + } else if ('detachEvent' in target) { + unbindEvent = eventListener._detachEvent; + } + eventListener._unbindEvent = unbindEvent; + + unbindEvent(target, type, handler); + }, + + /** + * Unbind DOM events. + * @memberOf module:eventListener + * @param {HTMLElement} target - target element + * @param {string | object} types - type or map of type and handler + * @param {function} [handler] - handler + */ + off: function(target, types, handler) { + var handlerMap = {}; + if (snippet.isString(types)) { + handlerMap[types] = handler; + } else { + handlerMap = types; + } + + snippet.forEach(handlerMap, function(_handler, type) { + eventListener._unbindEvent(target, type, _handler); + }); + } + }; + + module.exports = eventListener; + + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Legend component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var LegendModel = __webpack_require__(57); + var pluginFactory = __webpack_require__(32); + var predicate = __webpack_require__(11); + var raphaelRenderUtil = __webpack_require__(5); + var snippet = __webpack_require__(6); + + var ICON_HEIGHT = chartConst.LEGEND_ICON_HEIGHT; + + var Legend = snippet.defineClass(/** @lends Legend.prototype */ { + /** + * Legend component. + * @constructs Legend + * @private + * @param {object} params parameters + * @param {object} params.theme - axis theme + * @param {?Array.} params.seriesTypes - series types + * @param {string} params.chart - chart type + * @param {object} params.dataProcessor - data processor + * @param {object} params.eventBus - chart event bus + */ + init: function(params) { + /** + * legend theme + * @type {object} + */ + this.theme = params.theme; + + /** + * options + * @type {Object} + */ + this.options = params.options || {}; + + /** + * chart type + * @type {string} + */ + this.chartType = params.chartType; + + /** + * series types + * @type {?Array.} + */ + this.seriesTypes = params.seriesTypes || [this.chartType]; + + /** + * event bus for transmitting message + * @type {object} + */ + this.eventBus = params.eventBus; + + /** + * Legend view className + */ + this.className = 'tui-chart-legend-area'; + + /** + * DataProcessor instance + * @type {DataProcessor} + */ + this.dataProcessor = params.dataProcessor; + + /** + * legend model + */ + this.legendModel = new LegendModel({ + theme: this.theme, + labels: params.dataProcessor.getLegendLabels(), + legendData: params.dataProcessor.getLegendData(), + seriesTypes: this.seriesTypes, + chartType: this.chartType + }); + + /** + * layout bounds information for this components + * @type {null|{dimension:{width:number, height:number}, position:{left:number, top:number}}} + */ + this.layout = null; + + /** + * Graph renderer + * @type {object} + */ + this.graphRenderer = pluginFactory.get(chartConst.COMPONENT_TYPE_RAPHAEL, 'legend'); + + /** + * Paper for rendering legend + * @type {object} + */ + this.paper = null; + + this.drawingType = chartConst.COMPONENT_TYPE_RAPHAEL; + }, + + /** + * Set data for rendering. + * @param {{ + * layout: { + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * } + * }} data - bounds data + * @private + */ + _setDataForRendering: function(data) { + if (data) { + this.layout = data.layout; + this.paper = data.paper; + } + }, + + /** + * Render legend component. + * @param {object} data - bounds data + */ + _render: function(data) { + this._setDataForRendering(data); + this.legendSet = this._renderLegendArea(data.paper); + }, + + /** + * Render legend component and listen legend event. + * @param {object} data - bounds data + */ + render: function(data) { + this._render(data); + + this._listenEvents(); + }, + + /** + * Rerender. + * @param {object} data - bounds data + */ + rerender: function(data) { + this.legendSet.remove(); + + this._render(data); + }, + + /** + * Rerender, when resizing chart. + * @param {object} data - bounds data + */ + resize: function(data) { + this.rerender(data); + }, + + /** + * Get legend rendering data + * @param {object} legendData legned data + * @param {number} labelHeight lebel height + * @param {Array.} labelWidths label widths + * @returns {Array.} + * @private + */ + _getLegendRenderingData: function(legendData, labelHeight, labelWidths) { + var maxWidth = this.options.maxWidth; + var colorByPoint = (predicate.isBarTypeChart(this.chartType) || predicate.isBoxplotChart(this.chartType)) + && this.dataProcessor.options.series.colorByPoint; + + return snippet.map(legendData, function(legendDatum, index) { + var checkbox = this.options.showCheckbox === false ? null : { + checked: this.legendModel.isCheckedIndex(index) + }; + var legendLabel = legendDatum.label; + + if (maxWidth) { + legendLabel = raphaelRenderUtil.getEllipsisText(legendLabel, maxWidth, this.theme.label); + } + + return { + checkbox: checkbox, + iconType: legendDatum.chartType || 'rect', + colorByPoint: colorByPoint, + index: index, + theme: legendDatum.theme, + label: legendLabel, + labelHeight: labelHeight, + labelWidth: labelWidths[index], + isUnselected: this.legendModel.isUnselectedIndex(index) + }; + }, this); + }, + + /** + * Render legend area. + * @param {object} paper paper object + * @returns {Array.} + * @private + */ + _renderLegendArea: function(paper) { + var legendData = this.legendModel.getData(); + var graphRenderer = this.graphRenderer; + var isHorizontal = predicate.isHorizontalLegend(this.options.align); + var basePosition = this.layout.position; + var labelWidths = graphRenderer.makeLabelWidths(legendData, this.theme.label, this.options.maxWidth); + var labelTheme = legendData[0] ? legendData[0].theme : {}; + var labelHeight = graphRenderer.getRenderedLabelHeight('DEFAULT_TEXT', labelTheme) - 1; + var labelCount = labelWidths.length; + var legendItemHeight = Math.max(ICON_HEIGHT, labelHeight); + var dimensionHeight = (chartConst.LINE_MARGIN_TOP + legendItemHeight) * (isHorizontal ? 1 : labelCount); + var left = basePosition.left; + + if (!predicate.isLegendAlignLeft(this.options.align)) { + left += chartConst.LEGEND_AREA_PADDING; + } + + return graphRenderer.render({ + paper: paper, + legendData: this._getLegendRenderingData(legendData, labelHeight, labelWidths), + isHorizontal: isHorizontal, + position: { + left: left, + top: basePosition.top + chartConst.LEGEND_AREA_PADDING + chartConst.CHART_PADDING + }, + dimension: { + height: dimensionHeight, + width: this.layout.dimension.width + }, + labelTheme: this.theme.label, + labelWidths: labelWidths, + eventBus: this.eventBus + }); + }, + + /** + * Fire onChangeCheckedLegends event. + * @private + */ + _fireChangeCheckedLegendsEvent: function() { + this.eventBus.fire('changeCheckedLegends', this.legendModel.getCheckedIndexes()); + }, + + /** + * Fire selectLegend event. + * @param {{chartType: string, index: number}} data data + * @private + */ + _fireSelectLegendEvent: function(data) { + var index = this.legendModel.getSelectedIndex(); + var legendIndex = !snippet.isNull(index) ? data.seriesIndex : index; + + this.eventBus.fire('selectLegend', data.chartType, legendIndex); + }, + + /** + * Fire selectLegend public event. + * @param {{label: string, chartType: string, index: number}} data data + * @private + */ + _fireSelectLegendPublicEvent: function(data) { + this.eventBus.fire(chartConst.PUBLIC_EVENT_PREFIX + 'selectLegend', { + legend: data.label, + chartType: data.chartType, + index: data.index + }); + }, + + /** + * Select legend. + * @param {number} index index + * @private + */ + _selectLegend: function(index) { + var data = this.legendModel.getDatum(index); + + this.legendModel.toggleSelectedIndex(index); + + if (!snippet.isNull(this.legendModel.getSelectedIndex()) && !this.legendModel.isCheckedSelectedIndex()) { + this.legendModel.checkSelectedIndex(); + this._fireChangeCheckedLegendsEvent(); + } + + this.dataProcessor.selectLegendIndex = this.legendModel.getSelectedIndex(); + + this.graphRenderer.selectLegend(this.dataProcessor.selectLegendIndex, this.legendSet); + + this._fireSelectLegendEvent(data); + this._fireSelectLegendPublicEvent(data); + }, + + /** + * Get checked indexes. + * @returns {Array} checked indexes + * @private + */ + _getCheckedIndexes: function() { + var checkedIndexes = []; + + snippet.forEachArray(this.legendModel.checkedWholeIndexes, function(checkbox, index) { + if (checkbox) { + checkedIndexes.push(index); + } + }); + + return checkedIndexes; + }, + + /** + * Check legend. + * @private + */ + _checkLegend: function() { + var selectedData = this.legendModel.getSelectedDatum(); + + if (!this.legendModel.isCheckedSelectedIndex()) { + this.legendModel.updateSelectedIndex(null); + } + + this._fireChangeCheckedLegendsEvent(); + + if (selectedData) { + this._fireSelectLegendEvent(selectedData); + } + }, + + /** + * On click event handler. + * @param {number} index checkbox index + * @private + */ + _checkboxClick: function(index) { + var checkedIndexes; + + this.legendModel.toggleCheckedIndex(index); + + checkedIndexes = this._getCheckedIndexes(); + + if (checkedIndexes.length > 0) { + this.legendModel.updateCheckedLegendsWith(checkedIndexes); + this._checkLegend(); + } else { + this.legendModel.toggleCheckedIndex(index); + } + }, + + /** + * On click event handler. + * @param {number} index selected index + * @private + */ + _labelClick: function(index) { + this._selectLegend(index); + }, + + /** + * Listen legend events + * @private + */ + _listenEvents: function() { + this.eventBus.on('checkboxClicked', this._checkboxClick, this); + this.eventBus.on('labelClicked', this._labelClick, this); + } + }); + + snippet.CustomEvents.mixin(Legend); + + /** + * Factory for Legend + * @param {object} params parameter + * @returns {object|null} + * @ignore + */ + function legendFactory(params) { + var isLegendVisible = snippet.isUndefined(params.options.visible) ? true : params.options.visible; + var seriesTypes = params.dataProcessor.seriesTypes; + var chartType = params.chartOptions.chartType; + var legend = null; + + if (isLegendVisible) { + params.seriesTypes = seriesTypes; + params.chartType = chartType; + + // @todo should extends additionalParams added when addComponents(), should grasp the omitted + legend = new Legend(params); + } + + return legend; + } + + legendFactory.componentType = 'legend'; + legendFactory.Legend = Legend; + + module.exports = legendFactory; + + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview LegendModel is a model for legend area(checkbox, icon, label text) + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + + var concat = Array.prototype.concat; + var forEachArray = snippet.forEachArray; + + var LegendModel = snippet.defineClass(/** @lends LegendModel.prototype */ { + /** + * LegendModel is legend model. + * @constructs LegendModel + * @private + * @param {object} params parameters + * @param {number} params.labels legend labels + * @param {object} params.bound axis bound + * @param {object} params.theme axis theme + */ + init: function(params) { + /** + * legend theme + * @type {Object} + */ + this.theme = params.theme; + + /** + * legend labels + * @type {Array. | {column: ?Array., line: ?Array.}} + */ + this.labels = params.labels; + + /** + * label infos + * @type {Array.<{chartType: string, label: string, index: number}>} + */ + this.legendData = params.legendData; + + /** + * chart types + * @type {?Array.} + */ + this.seriesTypes = params.seriesTypes || []; + + /** + * chart type + * @type {string} + */ + this.chartType = params.chartType; + + /** + * Legend data + * @type {?Array} + */ + this.data = null; + + /** + * Selected legend index. + * @type {?number} + */ + this.selectedIndex = null; + + /** + * sending data to series + * @type {object} + */ + this.checkedIndexesMap = {}; + + /** + * checked indexes + * @type {Array} + */ + this.checkedWholeIndexes = []; + + this._setData(); + this._initCheckedIndexes(); + }, + + /** + * Initialize checked data. + * @private + */ + _initCheckedIndexes: function() { + var self = this; + var checkedIndexes = []; + forEachArray(this.legendData, function(legendDatum, index) { + if (legendDatum.visible) { + checkedIndexes.push(index); + } + self.checkedWholeIndexes[index] = legendDatum.visible; + }); + + this.updateCheckedLegendsWith(checkedIndexes); + }, + + /** + * Set theme to legend data. + * @param {Array.} legendData - legend data + * @param {{ + * colors: Array., + * borderColor: ?string + * }} colorTheme - legend theme + * @param {Array.} [checkedIndexes] - checked indexes + * @private + */ + _setThemeToLegendData: function(legendData, colorTheme, checkedIndexes) { + var seriesIndex = 0; + + forEachArray(legendData, function(datum, index) { + var itemTheme = { + color: colorTheme.colors[index] + }; + + if (colorTheme.borderColor) { + itemTheme.borderColor = colorTheme.borderColor; + } + + datum.theme = itemTheme; + datum.index = index; + + if (!checkedIndexes || !snippet.isUndefined(checkedIndexes[index])) { + datum.seriesIndex = seriesIndex; + seriesIndex += 1; + } else { + datum.seriesIndex = -1; + } + }); + }, + + /** + * Set legend data. + * @private + */ + _setData: function() { + var self = this; + var theme = this.theme; + var chartType = this.chartType; + var seriesTypes = this.seriesTypes; + var legendData = this.legendData; + var checkedIndexesMap = this.checkedIndexesMap; + var data, startIndex; + + if (!seriesTypes || seriesTypes.length < 2) { + this._setThemeToLegendData(legendData, theme[chartType], checkedIndexesMap[chartType]); + data = legendData; + } else { + startIndex = 0; + data = concat.apply([], snippet.map(seriesTypes, function(seriesType) { + var labelLen = self.labels[seriesType].length; + var endIndex = startIndex + labelLen; + var slicedLegendData, checkedIndexes; + + slicedLegendData = legendData.slice(startIndex, endIndex); + checkedIndexes = checkedIndexesMap[seriesType]; + startIndex = endIndex; + self._setThemeToLegendData(slicedLegendData, theme[seriesType], checkedIndexes); + + return slicedLegendData; + })); + } + + this.data = data; + }, + + /** + * Get legend data. + * @returns {Array.<{chartType: string, label: string, theme: object}>} legend data + */ + getData: function() { + return this.data; + }, + + /** + * Get legend datum by index. + * @param {number} index legend index + * @returns {{chartType: string, label: string, theme: object}} legend datum + */ + getDatum: function(index) { + return this.data[index]; + }, + + /** + * Get legend datum by label + * @param {string} label - legend label + * @returns {{chartType: string, label: string, theme: object}} legend datum + */ + getDatumByLabel: function(label) { + var foundDatum = null; + forEachArray(this.data, function(datum) { + if (datum.label === label) { + foundDatum = datum; + } + + return !foundDatum; + }); + + return foundDatum; + }, + + /** + * Get selected datum. + * @returns {{chartType: string, label: string, theme: Object}} legend datum + */ + getSelectedDatum: function() { + return this.getDatum(this.selectedIndex); + }, + + /** + * Update selected index. + * @param {?number} value value + */ + updateSelectedIndex: function(value) { + this.selectedIndex = value; + }, + + /** + * Toggle selected index. + * @param {number} index legend index + */ + toggleSelectedIndex: function(index) { + var selectedIndex; + + if (this.selectedIndex === index) { + selectedIndex = null; + } else { + selectedIndex = index; + } + + this.updateSelectedIndex(selectedIndex); + }, + + /** + * Get selected index. + * @returns {number} selected index + */ + getSelectedIndex: function() { + return this.selectedIndex; + }, + + /** + * Whether unselected index or not. + * @param {number} index legend index + * @returns {boolean} true if selected + */ + isUnselectedIndex: function(index) { + return !snippet.isNull(this.selectedIndex) && (this.selectedIndex !== index); + }, + + /** + * Whether checked selected index or not. + * @returns {boolean} true if checked + */ + isCheckedSelectedIndex: function() { + return this.isCheckedIndex(this.selectedIndex); + }, + + /** + * Toggle checked index. + * @param {number} index legend index + */ + toggleCheckedIndex: function(index) { + this.checkedWholeIndexes[index] = !this.checkedWholeIndexes[index]; + }, + + /** + * Update checked index. + * @param {number} index legend index + * @private + */ + _updateCheckedIndex: function(index) { + this.checkedWholeIndexes[index] = true; + }, + + /** + * Whether checked index. + * @param {number} index legend index + * @returns {boolean} true if checked + */ + isCheckedIndex: function(index) { + return !!this.checkedWholeIndexes[index]; + }, + + /** + * Add sending datum. + * @param {number} index legend index + */ + _addSendingDatum: function(index) { + var legendDatum = this.getDatum(index); + if (!this.checkedIndexesMap[legendDatum.chartType]) { + this.checkedIndexesMap[legendDatum.chartType] = []; + } + this.checkedIndexesMap[legendDatum.chartType][legendDatum.index] = true; + }, + + /** + * Check selected index; + */ + checkSelectedIndex: function() { + this._updateCheckedIndex(this.selectedIndex); + this._addSendingDatum(this.selectedIndex); + this._setData(); + }, + + /** + * Get checked indexes. + * @returns {object} object data that whether series has checked or not + */ + getCheckedIndexes: function() { + return this.checkedIndexesMap; + }, + + /** + * Reset checked data. + * @private + */ + _resetCheckedData: function() { + this.checkedWholeIndexes = []; + this.checkedIndexesMap = {}; + }, + + /** + * Update checked legend's indexes + * @param {Array.} indexes indexes + */ + updateCheckedLegendsWith: function(indexes) { + var self = this; + + this._resetCheckedData(); + forEachArray(indexes, function(index) { + self._updateCheckedIndex(index); + self._addSendingDatum(index); + }); + this._setData(); + } + }); + + module.exports = LegendModel; + + +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Spectrum Legend component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var pluginFactory = __webpack_require__(32); + var snippet = __webpack_require__(6); + + var SpectrumLegend = snippet.defineClass(/** @lends SpectrumLegend.prototype */ { + /** + * Spectrum Legend component. + * @constructs SpectrumLegend + * @private + * @param {object} params parameters + * @param {object} params.theme axis theme + * @param {?Array.} params.options legend options + * @param {MapChartDataProcessor} params.dataProcessor data processor + */ + init: function(params) { + var libType = params.libType; + + /** + * chart type + * @type {string} + */ + this.chartType = params.chartType; + + /** + * legend theme + * @type {Object} + */ + this.theme = params.theme; + + /** + * options + * @type {object} + */ + this.options = params.options || {}; + + /** + * data processor + * @type {DataProcessor} + */ + this.dataProcessor = params.dataProcessor; + + /** + * color spectrum + * @type {ColorSpectrum} + */ + this.colorSpectrum = params.colorSpectrum; + + /** + * event bus for transmitting message + * @type {object} + */ + this.eventBus = params.eventBus; + + /** + * Graph renderer + * @type {object} + */ + this.graphRenderer = pluginFactory.get(libType, 'mapLegend'); + + /** + * Whether horizontal legend or not. + * @type {boolean} + */ + this.isHorizontal = predicate.isHorizontalLegend(this.options.align); + + /** + * scale data for legend + * @type {null|object} + */ + this.scaleData = null; + + this.drawingType = chartConst.COMPONENT_TYPE_RAPHAEL; + + this._attachToEventBus(); + }, + + /** + * Attach to event bus. + * @private + */ + _attachToEventBus: function() { + this.eventBus.on({ + showWedge: this.onShowWedge, + hideTooltip: this.onHideWedge + }, this); + this.eventBus.on('beforeImageDownload', snippet.bind(this._removeLocationURLFromFillAttribute, this)); + this.eventBus.on('afterImageDownload', snippet.bind(this._restoreLocationURLToFillAttribute, this)); + }, + + /** + * Remove location URL from fill attribute + * @private + */ + _removeLocationURLFromFillAttribute: function() { + this.graphRenderer.removeLocationURLFromFillAttribute(); + }, + + /** + * Restore location URL to fill attribute + * @private + */ + _restoreLocationURLToFillAttribute: function() { + this.graphRenderer.restoreLocationURLToFillAttribute(); + }, + + /** + * Make base data to make tick html. + * @returns {{startPositionValue: number, step: number, positionType: string, labelSize: ?number}} base data + * @private + */ + _makeBaseDataToMakeTickArea: function() { + var dimension = this.layout.dimension; + var scaleData = this.scaleData; + var stepCount = scaleData.stepCount || scaleData.tickCount - 1; + var baseData = {}; + + baseData.position = this.layout.position; + + if (this.isHorizontal) { + baseData.step = dimension.width / stepCount; + baseData.position.top += chartConst.MAP_LEGEND_GRAPH_SIZE + chartConst.MAP_LEGEND_LABEL_PADDING; + } else { + baseData.step = dimension.height / stepCount; + baseData.position.left += chartConst.MAP_LEGEND_GRAPH_SIZE + chartConst.MAP_LEGEND_LABEL_PADDING; + } + + return baseData; + }, + + /** + * Render tick area. + * @param {Array.} legendSet legend set + * @private + */ + _renderTickArea: function(legendSet) { + if (this.options.reversed) { + this.scaleData.labels.sort(function(prev, next) { + return next - prev; + }); + } + this.graphRenderer.renderTicksAndLabels(this.paper, this._makeBaseDataToMakeTickArea(), + this.scaleData.labels, this.isHorizontal, legendSet); + }, + + /** + * Make graph dimension of vertical legend + * @returns {{width: number, height: number}} dimension + * @private + */ + _makeVerticalGraphDimension: function() { + return { + width: chartConst.MAP_LEGEND_GRAPH_SIZE, + height: this.layout.dimension.height + }; + }, + + /** + * Make graph dimension of horizontal legend + * @returns {{width: number, height: number}} dimension + * @private + */ + _makeHorizontalGraphDimension: function() { + return { + width: this.layout.dimension.width + 10, + height: chartConst.MAP_LEGEND_GRAPH_SIZE + }; + }, + + /** + * Render graph. + * @param {Array.} legendSet legend set + * @private + */ + _renderGraph: function(legendSet) { + var dimension, startForSwap; + + if (this.isHorizontal) { + dimension = this._makeHorizontalGraphDimension(); + } else { + dimension = this._makeVerticalGraphDimension(); + } + + if (this.options.reversed) { + startForSwap = this.colorSpectrum.start; + this.colorSpectrum.start = this.colorSpectrum.end; + this.colorSpectrum.end = startForSwap; + } + + this.graphRenderer.render(this.paper, { + dimension: dimension, + position: this.layout.position + }, this.colorSpectrum, this.isHorizontal, legendSet); + }, + + /** + * Render legend area. + * @returns {Array.} + * @private + */ + _renderLegendArea: function() { + var legendSet = this.paper.set(); + + this._renderGraph(legendSet); + this._renderTickArea(legendSet); + + return legendSet; + }, + + /** + * Set data for rendering. + * @param {{ + * layout: object, + * legendScaleData: object + * }} data - scale data + * @private + */ + _setDataForRendering: function(data) { + this.layout = data.layout; + this.paper = data.paper; + this.scaleData = data.legendScaleData; + }, + + /** + * Render legend component. + * @param {object} data - scale data + */ + render: function(data) { + this._setDataForRendering(data); + this.legnedSet = this._renderLegendArea(); + }, + + /** + * Rerender legend component. + * @param {object} data - scale data + */ + rerender: function(data) { + this.legnedSet.remove(); + this.render(data); + }, + + /** + * Resize legend component. + * @param {object} data - scale data + */ + resize: function(data) { + this.rerender(data); + }, + + /** + * On show wedge. + * @param {number} ratio ratio + */ + onShowWedge: function(ratio) { + ratio = this.options.reversed ? 1 - ratio : ratio; + this.graphRenderer.showWedge(chartConst.MAP_LEGEND_SIZE * ratio); + }, + + /** + * On hide wedge. + */ + onHideWedge: function() { + this.graphRenderer.hideWedge(); + } + }); + + /** + * Factory for SpectrumLegend + * @param {object} params parameter + * @returns {object|null} + * @ignore + */ + function spectrumLegendFactory(params) { + var isLegendVisible = snippet.isUndefined(params.options.visible) ? true : params.options.visible; + var chartType = params.chartOptions.chartType; + var spectrumLegend = null; + + if (isLegendVisible) { + params.chartType = chartType; + + spectrumLegend = new SpectrumLegend(params); + } + + return spectrumLegend; + } + + spectrumLegendFactory.componentType = 'legend'; + spectrumLegendFactory.SpectrumLegend = SpectrumLegend; + + module.exports = spectrumLegendFactory; + + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Circle legend component render a legend in the form of overlapping circles + * by representative radius values. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var calculator = __webpack_require__(45); + var renderUtil = __webpack_require__(7); + var pluginFactory = __webpack_require__(32); + var snippet = __webpack_require__(6); + + var CircleLegend = snippet.defineClass(/** @lends CircleLegend.prototype */ { + /** + * ratios for rendering circle + * @type {Array.} + */ + circleRatios: [1, 0.5, 0.25], + /** + * Circle legend component render a legend in the form of overlapping circles by representative radius values. + * @constructs CircleLegend + * @private + * @param {object} params parameters + * @param {?string} params.libType - library type for graph rendering + * @param {string} params.chartType - chart type + * @param {DataProcessor} params.dataProcessor - DataProcessor + * @param {string} params.baseFontFamily - base fontFamily of chart + */ + init: function(params) { + var libType = params.libType; + + /** + * chart type + * @type {string} + */ + this.chartType = params.chartType; + + /** + * data processor + * @type {DataProcessor} + */ + this.dataProcessor = params.dataProcessor; + + /** + * theme for label of circle legend area + * @type {{fontSize: number, fontFamily: *}} + */ + this.labelTheme = { + fontSize: chartConst.CIRCLE_LEGEND_LABEL_FONT_SIZE, + fontFamily: params.baseFontFamily + }; + + /** + * Graph renderer + * @type {object} + */ + this.graphRenderer = pluginFactory.get(libType, 'circleLegend'); + + /** + * layout bounds information for this components + * @type {null|{dimension:{width:number, height:number}, position:{left:number, top:number}}} + */ + this.layout = null; + + /** + * max radius for rendering circle legend + * @type {null|number} + */ + this.maxRadius = null; + + this.drawingType = chartConst.COMPONENT_TYPE_RAPHAEL; + }, + + /** + * Format label. + * @param {number} label - label + * @param {number} decimalLength - decimal length + * @returns {string} + * @private + */ + _formatLabel: function(label, decimalLength) { + var formatFunctions = this.dataProcessor.getFormatFunctions(); + var formattedLabel; + + if (decimalLength === 0) { + formattedLabel = String(parseInt(label, 10)); + } else { + formattedLabel = renderUtil.formatToDecimal(String(label), decimalLength); + } + + return renderUtil.formatValue({ + value: formattedLabel, + formatFunctions: formatFunctions, + chartType: this.chartType, + areaType: 'circleLegend', + valueType: 'r' + }); + }, + + /** + * Make label html. + * @returns {Array.} + * @private + */ + _makeLabels: function() { + var self = this; + var maxValueRadius = this.dataProcessor.getMaxValue(this.chartType, 'r'); + var decimalLength = calculator.getDecimalLength(maxValueRadius); + + return snippet.map(this.circleRatios, function(ratio) { + return self._formatLabel(maxValueRadius * ratio, decimalLength); + }); + }, + + /** + * Render for circle legend area. + * @param {object} paper paper object + * @returns {Array.} + * @private + */ + _render: function(paper) { + return this.graphRenderer.render(paper, this.layout, this.maxRadius, this.circleRatios, this._makeLabels()); + }, + + /** + * Set data for rendering. + * @param {{ + * layout: { + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }, + * maxRadius: number + * }} data - bounds data + * @private + */ + _setDataForRendering: function(data) { + this.layout = data.layout; + this.maxRadius = data.maxRadius; + }, + + /** + * Render. + * @param {object} data - bounds data + */ + render: function(data) { + this._setDataForRendering(data); + this.circleLegendSet = this._render(data.paper); + }, + + /** + * Rerender. + * @param {object} data - bounds data + */ + rerender: function(data) { + this.circleLegendSet.remove(); + + this._setDataForRendering(data); + this.circleLegendSet = this._render(data.paper); + }, + + /** + * Resize. + * @param {object} data - bounds data + */ + resize: function(data) { + this.rerender(data); + } + }); + + /** + * Factory for CircleLegend + * @param {object} params parameter + * @returns {object|null} + * @ignore + */ + function circleLegendFactory(params) { + var chartType = params.chartOptions.chartType; + var chartTheme = params.chartTheme; + var visibleOption = snippet.pick(params.chartOptions, 'circleLegend', 'visible'); + var circleLegend = null; + var isLegendVisible; + + if (snippet.isUndefined(visibleOption)) { + isLegendVisible = true; + } else { + isLegendVisible = visibleOption; + } + + if (isLegendVisible) { + params.chartType = chartType; + params.baseFontFamily = chartTheme.chart.fontFamily; + + circleLegend = new CircleLegend(params); + } + + return circleLegend; + } + + circleLegendFactory.componentType = 'legend'; + circleLegendFactory.CircleLegend = CircleLegend; + + module.exports = circleLegendFactory; + + +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview NormalTooltip component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var normalTooltipFactory = __webpack_require__(61); + var groupTooltipFactory = __webpack_require__(66); + var mapChartTooltipFactory = __webpack_require__(68); + var predicate = __webpack_require__(11); + var snippet = __webpack_require__(6); + + /** + * Label formatter function for pie chart + * @param {object} seriesItem series item + * @param {object} tooltipDatum tooltip datum object + * @param {string} labelPrefix label prefix + * @returns {object} + * @ignore + */ + function pieTooltipLabelFormatter(seriesItem, tooltipDatum, labelPrefix) { + var ratioLabel; + var percentageString = (seriesItem.ratio * 100).toFixed(4); + var percent = parseFloat(percentageString); + var needSlice = (percent < 0.0009 || percentageString.length > 5); + + percentageString = needSlice ? percentageString.substr(0, 4) : String(percent); + ratioLabel = percentageString + ' % ' || ''; + + tooltipDatum.ratioLabel = labelPrefix + ratioLabel; + tooltipDatum.label = seriesItem.tooltipLabel || (seriesItem.label ? seriesItem.label : ''); + + return tooltipDatum; + } + + /** + * Factory for Tooltip + * @param {object} params parameter + * @returns {object|null} + * @ignore + */ + function tooltipFactory(params) { + var chartType = params.chartOptions.chartType; + var seriesTypes = params.seriesTypes; + var xAxisOptions = params.chartOptions.xAxis; + var colors = []; + var factory; + + snippet.forEach(snippet.filter(params.chartTheme.legend, function(item) { + return snippet.isArray(item.colors); + }), function(series) { + colors = colors.concat(series.colors); + }); + + if (chartType === 'map') { + factory = mapChartTooltipFactory; + } else if (params.options.grouped) { + factory = groupTooltipFactory; + } else { + factory = normalTooltipFactory; + } + + if (chartType === 'pie' || predicate.isPieDonutComboChart(chartType, seriesTypes)) { + params.labelFormatter = pieTooltipLabelFormatter; + } + + params.chartType = chartType; + params.chartTypes = seriesTypes; + params.xAxisType = xAxisOptions.type; + params.dateFormat = xAxisOptions.dateFormat; + params.colors = colors; + + return factory(params); + } + + tooltipFactory.componentType = 'tooltip'; + + module.exports = tooltipFactory; + + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview NormalTooltip component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var TooltipBase = __webpack_require__(62); + var singleTooltipMixer = __webpack_require__(63); + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var tooltipTemplate = __webpack_require__(64); + var snippet = __webpack_require__(6); + + /** + * @classdesc NormalTooltip component. + * @class NormalTooltip + * @private + */ + var NormalTooltip = snippet.defineClass(TooltipBase, /** @lends NormalTooltip.prototype */ { + /** + * NormalTooltip component. + * @constructs NormalTooltip + * @private + * @override + */ + init: function() { + TooltipBase.apply(this, arguments); + }, + + /** + * Make tooltip html. + * @param {string} category category + * @param {{value: string, legend: string, chartType: string, suffix: ?string}} item item data + * @returns {string} tooltip html + * @private + */ + _makeTooltipHtml: function(category, item) { + var template = this._getTooltipTemplate(item); + + return template(snippet.extend({ + categoryVisible: category ? 'show' : 'hide', + category: category + }, item)); + }, + + /** + * get tooltip template from a templates collection + * @param {{value: string, legend: string, chartType: string, suffix: ?string}} item item data + * @returns {string} tooltip template + * @private + */ + _getTooltipTemplate: function(item) { + var template = tooltipTemplate.tplDefault; + + if (predicate.isBoxplotChart(this.chartType)) { + template = this._getBoxplotTooltipTemplate(item); + } else if (predicate.isPieChart(this.chartType) || + predicate.isPieDonutComboChart(this.chartType, this.chartTypes)) { + template = tooltipTemplate.tplPieChart; + } else if (this.dataProcessor.coordinateType) { + template = tooltipTemplate.tplCoordinatetypeChart; + } else if (predicate.isBulletChart(this.chartType)) { + template = tooltipTemplate.tplBulletChartDefault; + } + + return template; + }, + + /** + * Get tooltip template of box plot chart + * If item has outlierIndex, return outlier template + * Otherwise, return box plot default template + * @param {{value: string, legend: string, chartType: string, suffix: ?string}} item item data + * @returns {string} tooltip template + * @private + */ + _getBoxplotTooltipTemplate: function(item) { + var template = tooltipTemplate.tplBoxplotChartDefault; + + if (snippet.isNumber(item.outlierIndex)) { + template = tooltipTemplate.tplBoxplotChartOutlier; + item.label = item.outliers[item.outlierIndex].label; + } + + return template; + }, + + /** + * Make html for value types like x, y, r + * @param {{x: ?number, y: ?number, r: ?number}} data - data + * @param {Array.} valueTypes - types of value + * @returns {string} + * @private + */ + _makeHtmlForValueTypes: function(data, valueTypes) { + return snippet.map(valueTypes, function(type) { + return (data[type]) ? '
' + type + ': ' + data[type] + '
' : ''; + }).join(''); + }, + + /** + * Make single tooltip html. + * @param {string} chartType chart type + * @param {{groupIndex: number, index: number}} indexes indexes + * @returns {string} tooltip html + * @private + */ + _makeSingleTooltipHtml: function(chartType, indexes) { + var groupIndex = indexes.groupIndex; + var data = snippet.extend({}, snippet.pick(this.data, chartType, indexes.groupIndex, indexes.index)); + + if (predicate.isBoxplotChart(this.chartType) && snippet.isNumber(indexes.outlierIndex)) { + data.outlierIndex = indexes.outlierIndex; + } + + data = snippet.extend({ + suffix: this.suffix + }, data); + data.valueTypes = this._makeHtmlForValueTypes(data, ['x', 'y', 'r']); + + return this.templateFunc(data.category, data, this.getRawCategory(groupIndex)); + }, + + /** + * Set default align option of tooltip. + * @private + * @override + */ + _setDefaultTooltipPositionOption: function() { + if (this.options.align) { + return; + } + + if (this.isVertical) { + this.options.align = chartConst.TOOLTIP_DEFAULT_ALIGN_OPTION; + } else { + this.options.align = chartConst.TOOLTIP_DEFAULT_HORIZONTAL_ALIGN_OPTION; + } + }, + + /** + * Make parameters for show tooltip user event. + * @param {{groupIndex: number, index: number}} indexes indexes + * @param {object} additionParams addition parameters + * @returns {{chartType: string, legend: string, legendIndex: number, index: number}} parameters for show tooltip + * @private + */ + _makeShowTooltipParams: function(indexes, additionParams) { + var legendIndex = indexes.index; + var legendData = this.dataProcessor.getLegendItem(legendIndex); + var chartType; + + var params; + + if (!legendData) { + return null; + } + + chartType = legendData.chartType; + params = snippet.extend({ + chartType: chartType, + legend: legendData.label, + legendIndex: legendIndex, + index: indexes.groupIndex + }, additionParams); + + if (predicate.isBoxplotChart(chartType) && + snippet.isNumber(indexes.outlierIndex)) { + params.outlierIndex = indexes.outlierIndex; + } + + return params; + }, + + /** + * Make tooltip datum. + * @param {string} legendLabel - legend label + * @param {string} category - category + * @param {SeriesItem} seriesItem - SeriesItem + * @returns {Object} + * @private + */ + _makeTooltipDatum: function(legendLabel, category, seriesItem) { + var labelPrefix = (legendLabel && seriesItem.label) ? ': ' : ''; + var tooltipLabel = seriesItem.tooltipLabel; + var labelFormatter = this.labelFormatter; + var tooltipDatum = { + legend: legendLabel || '', + label: tooltipLabel || (seriesItem.label ? labelPrefix + seriesItem.label : ''), + category: category || '' + }; + + if (labelFormatter) { + tooltipDatum = labelFormatter(seriesItem, tooltipDatum, labelPrefix); + } + + tooltipDatum.category = category || ''; + + return snippet.extend(tooltipDatum, seriesItem.pickValueMapForTooltip()); + }, + + /** + * Make tooltip data. + * @returns {Array.} tooltip data + * @override + */ + makeTooltipData: function() { + var self = this; + var orgLegendLabels = this.dataProcessor.getLegendLabels(); + var isPivot = predicate.isTreemapChart(this.chartType); + var legendLabels = {}; + var tooltipData = {}; + + if (snippet.isArray(orgLegendLabels)) { + legendLabels[this.chartType] = orgLegendLabels; + } else { + legendLabels = orgLegendLabels; + } + + this.dataProcessor.eachBySeriesGroup(function(seriesGroup, groupIndex, chartType) { + var data, isBulletChart; + + chartType = chartType || self.chartType; + isBulletChart = predicate.isBulletChart(chartType); + + data = seriesGroup.map(function(seriesItem, index) { + var category = self.dataProcessor.makeTooltipCategory(groupIndex, index, self.isVertical); + var legendIndex = isBulletChart ? groupIndex : index; + + if (!seriesItem) { + return null; + } + + return self._makeTooltipDatum(legendLabels[chartType][legendIndex], category, seriesItem); + }); + + if (!tooltipData[chartType]) { + tooltipData[chartType] = []; + } + + tooltipData[chartType].push(data); + }, isPivot); + + return tooltipData; + } + }); + + singleTooltipMixer.mixin(NormalTooltip); + + function normalTooltipFactory(params) { + return new NormalTooltip(params); + } + + normalTooltipFactory.componentType = 'tooltip'; + normalTooltipFactory.NormalTooltip = NormalTooltip; + + module.exports = normalTooltipFactory; + + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview TooltipBase is base class of tooltip components. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + var chartConst = __webpack_require__(8), + dom = __webpack_require__(9), + predicate = __webpack_require__(11), + renderUtil = __webpack_require__(7); + + var TooltipBase = snippet.defineClass(/** @lends TooltipBase.prototype */ { + /** + * TooltipBase is base class of tooltip components. + * @constructs TooltipBase + * @private + * @param {object} params - parameters + * @param {string} params.chartType - chart type + * @param {Array.} params.chartTypes - chart types + * @param {DataProcessor} params.dataProcessor - DataProcessor instance + * @param {object} params.options - tooltip options + * @param {object} params.theme - tooltip theme + * @param {boolean} params.isVertical - whether vertical or not + * @param {object} params.eventBus - snippet.CustomEvents instance + * @param {object} params.labelTheme - theme for label + * @param {string} params.xAxisType - xAxis type + * @param {string} params.dateFormat - date format + * @param {object} params.labelFormatter - label formatter function + */ + init: function(params) { + var isPieChart = predicate.isPieChart(params.chartType); + + /** + * Chart type + * @type {string} + */ + this.chartType = params.chartType; + + /** + * Chart types + * @type {Array.} + */ + this.chartTypes = params.chartTypes; + + /** + * Data processor + * @type {DataProcessor} + */ + this.dataProcessor = params.dataProcessor; + + /** + * Options + * @type {object} + */ + this.options = params.options; + this.colors = params.colors; + + /** + * Theme + * @type {object} + */ + this.theme = params.theme; + + /** + * whether vertical or not + * @type {boolean} + */ + this.isVertical = params.isVertical; + + /** + * event bus for transmitting message + * @type {object} + */ + this.eventBus = params.eventBus; + + /** + * label theme + * @type {object} + */ + this.labelTheme = params.labelTheme; + + /** + * x axis type + * @type {?string} + */ + this.xAxisType = params.xAxisType; + + /** + * dateFormat option for xAxis + * @type {?string} + */ + this.dateFormat = params.dateFormat; + + /** + * tooltip options for each chart + * @type {?function} + */ + this.labelFormatter = params.labelFormatter; + + /** + * className + * @type {string} + */ + this.className = 'tui-chart-tooltip-area'; + + /** + * Tooltip container. + * @type {HTMLElement} + */ + this.tooltipContainer = null; + + /** + * Tooltip suffix. + * @type {string} + */ + this.suffix = this.options.suffix ? ' ' + this.options.suffix : ''; + + /** + * Tooltip template function. + * @type {function} + */ + this.templateFunc = this.options.template || snippet.bind(this._makeTooltipHtml, this); + + /** + * Tooltip animation time. + * @type {number} + */ + this.animationTime = isPieChart ? chartConst.TOOLTIP_PIE_ANIMATION_TIME : chartConst.TOOLTIP_ANIMATION_TIME; + + /** + * TooltipBase base data. + * @type {Array.>} + */ + this.data = []; + + /** + * layout bounds information for this components + * @type {null|{dimension:{width:number, height:number}, position:{left:number, top:number}}} + */ + this.layout = null; + + /** + * dimension map for layout of chart + * @type {null|object} + */ + this.dimensionMap = null; + + /** + * position map for layout of chart + * @type {null|object} + */ + this.positionMap = null; + + /** + * Drawing type + * @type {string} + */ + this.drawingType = chartConst.COMPONENT_TYPE_DOM; + + this._setDefaultTooltipPositionOption(); + this._saveOriginalPositionOptions(); + + this._attachToEventBus(); + }, + + /** + * Attach to event bus. + * @private + */ + _attachToEventBus: function() { + this.eventBus.on({ + showTooltip: this.onShowTooltip, + hideTooltip: this.onHideTooltip + }, this); + + if (this.onShowTooltipContainer) { + this.eventBus.on({ + showTooltipContainer: this.onShowTooltipContainer, + hideTooltipContainer: this.onHideTooltipContainer + }, this); + } + }, + + /** + * Make tooltip html. + * @private + * @abstract + */ + _makeTooltipHtml: function() {}, + + /** + * Set default align option of tooltip. + * @private + * @abstract + */ + _setDefaultTooltipPositionOption: function() {}, + + /** + * Save position options. + * @private + */ + _saveOriginalPositionOptions: function() { + this.orgPositionOptions = { + align: this.options.align, + offset: this.options.offset + }; + }, + + /** + * Make tooltip data. + * @private + * @abstract + */ + makeTooltipData: function() {}, + + /** + * Set data for rendering. + * @param {{ + * layout: { + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }, + * dimensionMap: object + * }} data - bounds data + * @private + */ + _setDataForRendering: function(data) { + this.layout = data.layout; + this.dimensionMap = data.dimensionMap; + this.positionMap = data.positionMap; + }, + + /** + * Render tooltip component. + * @param {object} data - bounds data + * @returns {HTMLElement} tooltip element + */ + render: function(data) { + var el = data.paper; + + dom.addClass(el, this.className); + + this._setDataForRendering(data); + this.data = this.makeTooltipData(); + + renderUtil.renderPosition(el, this.layout.position); + + this.tooltipContainer = el; + + return el; + }, + + /** + * Rerender. + * @param {object} data - bounds data + */ + rerender: function(data) { + this.resize(data); + this.data = this.makeTooltipData(); + }, + + /** + * Resize tooltip component. + * @param {object} data - bounds data + * @override + */ + resize: function(data) { + this._setDataForRendering(data); + + renderUtil.renderPosition(this.tooltipContainer, this.layout.position); + if (this.positionModel) { + this.positionModel.updateBound(this.layout); + } + }, + + /** + * Zoom. + */ + zoom: function() { + this.data = this.makeTooltipData(); + }, + + /** + * Get tooltip element. + * @returns {HTMLElement} tooltip element + * @private + */ + _getTooltipElement: function() { + var tooltipElement; + + if (!this.tooltipElement) { + this.tooltipElement = tooltipElement = dom.create('DIV', 'tui-chart-tooltip'); + dom.append(this.tooltipContainer, tooltipElement); + } + + return this.tooltipElement; + }, + + /** + * onShowTooltip is callback of mouse event detector showTooltip for SeriesView. + * @param {object} params coordinate event parameters + */ + onShowTooltip: function(params) { + var tooltipElement = this._getTooltipElement(); + var isScatterCombo = predicate.isComboChart(this.chartType) && predicate.isScatterChart(params.chartType); + var prevPosition; + + if ((!predicate.isChartToDetectMouseEventOnSeries(params.chartType) || isScatterCombo) + && tooltipElement.offsetWidth) { + prevPosition = { + left: tooltipElement.offsetLeft, + top: tooltipElement.offsetTop + }; + } + + this._showTooltip(tooltipElement, params, prevPosition); + }, + + /** + * Get tooltip dimension + * @param {HTMLElement} tooltipElement tooltip element + * @returns {{width: number, height: number}} rendered tooltip dimension + */ + getTooltipDimension: function(tooltipElement) { + return { + width: tooltipElement.offsetWidth, + height: tooltipElement.offsetHeight + }; + }, + + /** + * Move to Position. + * @param {HTMLElement} tooltipElement tooltip element + * @param {{left: number, top: number}} position position + * @param {{left: number, top: number}} prevPosition prev position + * @private + */ + _moveToPosition: function(tooltipElement, position, prevPosition) { + if (prevPosition) { + this._slideTooltip(tooltipElement, prevPosition, position); + } else { + renderUtil.renderPosition(tooltipElement, position); + } + }, + + /** + * Slide tooltip + * @param {HTMLElement} tooltipElement tooltip element + * @param {{left: number, top: number}} prevPosition prev position + * @param {{left: number, top: number}} position position + * @private + */ + _slideTooltip: function(tooltipElement, prevPosition, position) { + var moveTop = position.top - prevPosition.top, + moveLeft = position.left - prevPosition.left; + + renderUtil.cancelAnimation(this.slidingAnimation); + + this.slidingAnimation = renderUtil.startAnimation(this.animationTime, function(ratio) { + var left = moveLeft * ratio, + top = moveTop * ratio; + tooltipElement.style.left = (prevPosition.left + left) + 'px'; + tooltipElement.style.top = (prevPosition.top + top) + 'px'; + }); + }, + + /** + * onHideTooltip is callback of mouse event detector hideTooltip for SeriesView + * @param {number|object} prevFound - showing tooltip object in case single tooltip, + * - showing tooltip index in case group tooltip + * @param {{silent: {boolean}}} [options] - hide tooltip options + */ + onHideTooltip: function(prevFound, options) { + var tooltipElement = this._getTooltipElement(); + + this._hideTooltip(tooltipElement, prevFound, options); + }, + + /** + * Set align option. + * @param {string} align align + */ + setAlign: function(align) { + this.options.align = align; + if (this.positionModel) { + this.positionModel.updateOptions(this.options); + } + }, + + /** + * Update offset option. + * @param {{x: number, y: number}} offset - offset + * @private + */ + _updateOffsetOption: function(offset) { + this.options.offset = offset; + + if (this.positionModel) { + this.positionModel.updateOptions(this.options); + } + }, + + /** + * Set offset. + * @param {{x: number, y: number}} offset - offset + */ + setOffset: function(offset) { + var offsetOption = snippet.extend({}, this.options.offset); + + if (snippet.isExisty(offset.x)) { + offsetOption.x = offset.x; + } + + if (snippet.isExisty(offset.y)) { + offsetOption.y = offset.y; + } + + this._updateOffsetOption(snippet.extend({}, this.options.offset, offsetOption)); + }, + + /** + * Set position option. + * @param {{left: number, top: number}} position moving position + * @deprecated + */ + setPosition: function(position) { + var offsetOption = snippet.extend({}, this.options.offset); + + if (snippet.isExisty(position.left)) { + offsetOption.x = position.left; + } + + if (snippet.isExisty(position.top)) { + offsetOption.y = position.y; + } + + this._updateOffsetOption(offsetOption); + }, + + /** + * Reset align option. + */ + resetAlign: function() { + var align = this.orgPositionOptions.align; + + this.options.align = align; + + if (this.positionModel) { + this.positionModel.updateOptions(this.options); + } + }, + + /** + * Reset offset option. + */ + resetOffset: function() { + this.options.offset = this.orgPositionOptions.offset; + this._updateOffsetOption(this.options.offset); + }, + + /** + * Get category's raw data + * @param {number} index - index of categories + * @param {string} format - date format + * @returns {string} - category's raw data + */ + getRawCategory: function(index, format) { + var axis = this.isVertical ? 'x' : 'y'; + var categories = this.dataProcessor.categoriesMap ? this.dataProcessor.categoriesMap[axis] : null; + var rawCategory = ''; + + if (categories) { + rawCategory = categories[index]; + } + + if (format) { + rawCategory = renderUtil.formatDate(rawCategory, format); + } + + return rawCategory; + } + }); + + module.exports = TooltipBase; + + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview singleTooltipMixer is single tooltip mixer of map chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + var chartConst = __webpack_require__(8), + predicate = __webpack_require__(11), + dom = __webpack_require__(9), + renderUtil = __webpack_require__(7); + + /** + * singleTooltipMixer is single tooltip mixer of map chart. + * @mixin + * @private */ + var singleTooltipMixer = { + /** + * Set data indexes. + * @param {HTMLElement} elTooltip tooltip element + * @param {{groupIndex: number, index:number}} indexes indexes + * @private + */ + _setIndexesCustomAttribute: function(elTooltip, indexes) { + elTooltip.setAttribute('data-groupIndex', indexes.groupIndex); + elTooltip.setAttribute('data-index', indexes.index); + }, + + /** + * Get data indexes + * @param {HTMLElement} elTooltip tooltip element + * @returns {{groupIndex: number, index: number}} indexes + * @private + */ + _getIndexesCustomAttribute: function(elTooltip) { + var groupIndex = elTooltip.getAttribute('data-groupIndex'); + var index = elTooltip.getAttribute('data-index'); + var indexes = null; + + if (!snippet.isNull(groupIndex) && !snippet.isNull(index)) { + indexes = { + groupIndex: parseInt(groupIndex, 10), + index: parseInt(index, 10) + }; + } + + return indexes; + }, + + /** + * Set showed custom attribute. + * @param {HTMLElement} elTooltip tooltip element + * @param {boolean} status whether showed or not + * @private + */ + _setShowedCustomAttribute: function(elTooltip, status) { + elTooltip.setAttribute('data-showed', status); + }, + + /** + * Whether showed tooltip or not. + * @param {HTMLElement} elTooltip tooltip element + * @returns {boolean} whether showed tooltip or not + * @private + */ + _isShowedTooltip: function(elTooltip) { + var isShowed = elTooltip.getAttribute('data-showed'); + + return isShowed === 'true' || isShowed === true; // true in ie7 + }, + + /** + * Make tooltip position for bullet chart + * @param {object} params - mouse position + * @returns {object} - position of single tooltip + * @private + */ + _makeTooltipPositionForBulletChart: function(params) { + var mousePosition = params.mousePosition; + var tooltipAreaPosition = this.layout.position; + + return { + left: mousePosition.left - tooltipAreaPosition.left, + top: mousePosition.top - tooltipAreaPosition.top + }; + }, + + /** + * Make left position of not bar chart. + * @param {number} baseLeft base left + * @param {string} alignOption align option + * @param {number} minusWidth minus width + * @param {number} lineGap line gap + * @returns {number} left position value + * @private + */ + _makeLeftPositionOfNotBarChart: function(baseLeft, alignOption, minusWidth, lineGap) { + var left = baseLeft; + var offsetNegative = minusWidth || 0; + var lineGapOffset = lineGap || chartConst.TOOLTIP_GAP; + + if (alignOption.indexOf('left') > -1) { + left -= offsetNegative + lineGapOffset; + } else if (alignOption.indexOf('center') > -1 && offsetNegative) { + left -= offsetNegative / 2; + } else { + left += lineGapOffset; + } + + return left; + }, + + /** + * Make top position of not bar chart. + * @param {number} baseTop base top + * @param {string} alignOption align option + * @param {number} tooltipHeight tooltip height + * @param {number} lineGap line gap + * @returns {number} top position value + * @private + */ + _makeTopPositionOfNotBarChart: function(baseTop, alignOption, tooltipHeight, lineGap) { + var top = baseTop; + var offsetNegative = tooltipHeight || 0; + + if (alignOption.indexOf('bottom') > -1) { + top += offsetNegative + lineGap; + } else if (alignOption.indexOf('middle') > -1 && offsetNegative) { + top += offsetNegative / 2; + } else { + top -= offsetNegative + chartConst.TOOLTIP_GAP; + } + + return top; + }, + + /** + * Make tooltip position for not bar chart. + * @param {object} params parameters + * @param {{bound: object}} params.data graph information + * @param {{width: number, height: number}} params.dimension tooltip dimension + * @param {string} params.alignOption position option (ex: 'left top') + * @returns {{top: number, left: number}} position + * @private + */ + _makeTooltipPositionForNotBarChart: function(params) { + var bound = params.bound, + positionOption = params.positionOption, + minusWidth = params.dimension.width - (bound.width || 0), + lineGap = bound.width ? 0 : chartConst.TOOLTIP_GAP, + alignOption = params.alignOption || '', + tooltipHeight = params.dimension.height, + baseLeft = bound.left - this.layout.position.left + positionOption.left, + baseTop = bound.top - this.layout.position.top + positionOption.top - chartConst.TOOLTIP_GAP; + + return { + left: this._makeLeftPositionOfNotBarChart(baseLeft, alignOption, minusWidth, lineGap), + top: this._makeTopPositionOfNotBarChart(baseTop, alignOption, tooltipHeight, lineGap) + }; + }, + + /** + * Make tooltip position to event position. + * @param {object} params parameters + * @param {{left: number, top: number}} params.bound bound + * @param {{left: number, top: number}} params.mousePosition mouse position + * @returns {{top: number, left: number}} position + * @private + */ + _makeTooltipPositionToMousePosition: function(params) { + if (!params.bound) { + params.bound = params.bound || {}; + snippet.extend(params.bound, params.mousePosition); + } + + return this._makeTooltipPositionForNotBarChart(params); + }, + + /** + * Make left position for bar chart. + * @param {number} baseLeft base left + * @param {string} alignOption align option + * @param {number} tooltipWidth tooltip width + * @returns {number} left position value + * @private + */ + _makeLeftPositionForBarChart: function(baseLeft, alignOption, tooltipWidth) { + var left = baseLeft; + + if (alignOption.indexOf('left') > -1) { + left -= tooltipWidth; + } else if (alignOption.indexOf('center') > -1) { + left -= tooltipWidth / 2; + } else { + left += chartConst.TOOLTIP_GAP; + } + + return left; + }, + + /** + * Make top position for bar chart. + * @param {number} baseTop base top + * @param {string} alignOption align option + * @param {number} minusHeight minus width + * @returns {number} top position value + * @private + */ + _makeTopPositionForBarChart: function(baseTop, alignOption, minusHeight) { + var top = baseTop; + + if (alignOption.indexOf('top') > -1) { + top -= minusHeight; + } else if (alignOption.indexOf('middle') > -1) { + top -= minusHeight / 2; + } + + return top; + }, + + /** + * Make tooltip position for bar chart. + * @param {object} params parameters + * @param {{bound: object}} params.data graph information + * @param {{width: number, height: number}} params.dimension tooltip dimension + * @param {string} params.alignOption position option (ex: 'left top') + * @returns {{top: number, left: number}} position + * @private + */ + _makeTooltipPositionForBarChart: function(params) { + var position = this.layout.position; + var bound = params.bound, + positionOption = params.positionOption, + minusHeight = params.dimension.height - (bound.height || 0), + alignOption = params.alignOption || '', + tooltipWidth = params.dimension.width, + baseLeft = bound.left + bound.width + positionOption.left - position.left, + baseTop = bound.top + positionOption.top - position.top; + + return { + left: this._makeLeftPositionForBarChart(baseLeft, alignOption, tooltipWidth), + top: this._makeTopPositionForBarChart(baseTop, alignOption, minusHeight) + }; + }, + + /** + * Make tooltip position for treemap chart. + * @param {object} params parameters + * @param {{bound: object}} params.data - graph information + * @param {{width: number, height: number}} params.dimension - tooltip dimension + * @returns {{left: number, top: number}} + * @private + */ + _makeTooltipPositionForTreemapChart: function(params) { + var position = this.layout.position; + var bound = params.bound; + var positionOption = params.positionOption; + var labelHeight = renderUtil.getRenderedLabelHeight(chartConst.MAX_HEIGHT_WORD, this.labelTheme); + + return { + left: bound.left + ((bound.width - params.dimension.width) / 2) + positionOption.left - position.left, + top: bound.top + (bound.height / 2) - labelHeight + positionOption.top - position.top + }; + }, + + /** + * Adjust position. + * @param {{width: number, height: number}} tooltipDimension tooltip dimension + * @param {{left: number, top: number}} position position + * @returns {{left: number, top: number}} adjusted position + * @private + */ + _adjustPosition: function(tooltipDimension, position) { + var chartDimension = this.dimensionMap.chart; + var areaPosition = this.layout.position; + + position.left = Math.max(position.left, -areaPosition.left); + position.left = Math.min(position.left, chartDimension.width - areaPosition.left - tooltipDimension.width); + position.top = Math.max(position.top, -areaPosition.top); + position.top = Math.min(position.top, chartDimension.height - areaPosition.top - tooltipDimension.height); + + return position; + }, + + /** + * Make tooltip position. + * @param {object} params parameters + * @param {{left: number, top: number, width: number, height: number}} params.bound graph bound + * @param {string} params.chartType chart type + * @param {boolean} params.allowNegativeTooltip whether allow negative tooltip or not + * @param {{width: number, height: number}} params.dimension tooltip dimension + * @param {string} params.alignOption position option (ex: 'left top') + * @returns {{top: number, left: number}} position + * @private + */ + _makeTooltipPosition: function(params) { + var position = {}, + sizeType, positionType, addPadding; + + if (params.mousePosition) { + position = this._makeTooltipPositionToMousePosition(params); + } else { + if (predicate.isBarChart(params.chartType)) { + position = this._makeTooltipPositionForBarChart(params); + sizeType = 'width'; + positionType = 'left'; + addPadding = 1; + } else if (predicate.isTreemapChart(params.chartType)) { + position = this._makeTooltipPositionForTreemapChart(params); + } else { + position = this._makeTooltipPositionForNotBarChart(params); + sizeType = 'height'; + positionType = 'top'; + addPadding = -1; + } + + if (params.allowNegativeTooltip) { + position = this._moveToSymmetry(position, { + bound: params.bound, + indexes: params.indexes, + dimension: params.dimension, + chartType: params.chartType, + sizeType: sizeType, + positionType: positionType, + addPadding: addPadding + }); + } + + position = this._adjustPosition(params.dimension, position); + } + + return position; + }, + + /** + * Move to symmetry. + * @param {{left: number, top: number}} position tooltip position + * @param {object} params parameters + * @param {{left: number, top: number, width: number, height: number}} params.bound graph bound + * @param {string} params.id tooltip id + * @param {{width: number, height: number}} params.dimension tooltip dimension + * @param {string} params.sizeType size type (width or height) + * @param {string} params.positionType position type (left or top) + * @param {number} params.addPadding add padding + * @returns {{left: number, top: number}} moved position + * @private + */ + _moveToSymmetry: function(position, params) { + var bound = params.bound; + var sizeType = params.sizeType; + var positionType = params.positionType; + var seriesType = params.seriesType || params.chartType; + var value = this.dataProcessor.getValue(params.indexes.groupIndex, params.indexes.index, seriesType); + var direction = predicate.isBarChart(this.chartType) ? -1 : 1; + var tooltipSize, barSize, movedPositionValue; + + if (value < 0) { + tooltipSize = params.dimension[sizeType]; + barSize = bound[sizeType]; + movedPositionValue = position[positionType] + + ((barSize + tooltipSize) * direction); + position[positionType] = movedPositionValue; + } + + return position; + }, + + /** + * Whether changed indexes or not. + * @param {{groupIndex: number, index: number}} prevIndexes prev indexes + * @param {{groupIndex: number, index: number}} indexes indexes + * @returns {boolean} whether changed or not + * @private + */ + _isChangedIndexes: function(prevIndexes, indexes) { + return !!prevIndexes && (prevIndexes.groupIndex !== indexes.groupIndex || prevIndexes.index !== indexes.index); + }, + + /** + * Show tooltip. + * @param {HTMLElement} elTooltip tooltip element + * @param {{indexes: {groupIndex: number, index: number}, bound: object}} params tooltip data + * @param {{left: number, top: number}} prevPosition prev position + * @private + */ + _showTooltip: function(elTooltip, params, prevPosition) { + var boundingClientRect = this.tooltipContainer.parentNode.getBoundingClientRect(); + var indexes = params.indexes; + var prevIndexes = this._getIndexesCustomAttribute(elTooltip); + var offset = this.options.offset || {}; + var positionOption = {}; + var prevChartType = elTooltip && elTooltip.getAttribute('data-chart-type'); + var position; + + if (!params.bound && params.mousePosition) { + params.bound = { + left: params.mousePosition.left - boundingClientRect.left + chartConst.CHART_PADDING, + top: params.mousePosition.top - boundingClientRect.top + chartConst.CHART_PADDING + }; + } + + if (this._isChangedIndexes(prevIndexes, indexes) || prevChartType !== params.chartType) { + this.eventBus.fire('hoverOffSeries', prevIndexes, prevChartType); + } + + elTooltip.innerHTML = this._makeSingleTooltipHtml(params.seriesType || params.chartType, indexes); + + elTooltip.setAttribute('data-chart-type', params.chartType); + this._setIndexesCustomAttribute(elTooltip, indexes); + this._setShowedCustomAttribute(elTooltip, true); + + this._fireBeforeShowTooltipPublicEvent(indexes, params.silent); + + dom.addClass(elTooltip, 'show'); + + positionOption.left = offset.x || 0; + positionOption.top = offset.y || 0; + + position = this._makeTooltipPosition(snippet.extend({ + dimension: this.getTooltipDimension(elTooltip), + positionOption: positionOption, + alignOption: this.options.align || '' + }, params)); + + this._moveToPosition(elTooltip, position, prevPosition); + this.eventBus.fire('hoverSeries', indexes, params.chartType); + this._fireAfterShowTooltipPublicEvent(indexes, { + element: elTooltip, + position: position + }, params.silent); + delete params.silent; + }, + + /** + * To call beforeShowTooltip callback of public event. + * @param {{groupIndex: number, index: number}} indexes indexes + * @param {boolean} [silent] - whether invoke a public beforeHideTooltip event or not + * @private + */ + _fireBeforeShowTooltipPublicEvent: function(indexes, silent) { + var params; + + if (silent) { + return; + } + + params = this._makeShowTooltipParams(indexes); + this.eventBus.fire(chartConst.PUBLIC_EVENT_PREFIX + 'beforeShowTooltip', params); + }, + + /** + * To call afterShowTooltip callback of public event. + * @param {{groupIndex: number, index: number}} indexes indexes + * @param {object} additionParams addition parameters + * @param {boolean} [silent] - whether invoke a public beforeHideTooltip event or not + * @private + */ + _fireAfterShowTooltipPublicEvent: function(indexes, additionParams, silent) { + var params; + + if (silent) { + return; + } + + params = this._makeShowTooltipParams(indexes, additionParams); + this.eventBus.fire(chartConst.PUBLIC_EVENT_PREFIX + 'afterShowTooltip', params); + }, + + /** + * Execute hiding tooltip. + * @param {HTMLElement} tooltipElement tooltip element + * @private + */ + _executeHidingTooltip: function(tooltipElement) { + dom.removeClass(tooltipElement, 'show'); + tooltipElement.removeAttribute('data-groupIndex'); + tooltipElement.removeAttribute('data-index'); + tooltipElement.style.cssText = ''; + }, + + /** + * Hide tooltip. + * @param {HTMLElement} tooltipElement - tooltip element + * @param {object} prevFoundData - data represented by tooltip elements + * @param {{silent: {boolean}}} [options] - options for hiding a tooltip element + * @private + */ + _hideTooltip: function(tooltipElement, prevFoundData, options) { + var self = this; + var indexes = this._getIndexesCustomAttribute(tooltipElement); + var chartType = tooltipElement.getAttribute('data-chart-type'); + var silent = !!(options && options.silent); + + if (predicate.isChartToDetectMouseEventOnSeries(chartType)) { + this.eventBus.fire('hoverOffSeries', indexes, chartType); + this._fireBeforeHideTooltipPublicEvent(indexes, silent); + this._executeHidingTooltip(tooltipElement); + } else if (chartType) { + this._setShowedCustomAttribute(tooltipElement, false); + this.eventBus.fire('hoverOffSeries', indexes, chartType); + + if (this._isChangedIndexes(this.prevIndexes, indexes)) { + delete this.prevIndexes; + } + + setTimeout(function() { + if (self._isShowedTooltip(tooltipElement)) { + return; + } + self._fireBeforeHideTooltipPublicEvent(indexes, silent); + self._executeHidingTooltip(tooltipElement); + }, chartConst.HIDE_DELAY); + } + }, + + /** + * To call afterShowTooltip callback of public event. + * @param {{groupIndex: number, index: number}} indexes indexes= + * @param {boolean} [silent] - whether invoke a public beforeHideTooltip event or not + * @private + */ + _fireBeforeHideTooltipPublicEvent: function(indexes, silent) { + var params; + if (silent) { + return; + } + + this.eventBus.fire(chartConst.PUBLIC_EVENT_PREFIX + 'beforeHideTooltip', params); + }, + + /** + * On show tooltip container. + */ + onShowTooltipContainer: function() { + this.tooltipContainer.style.zIndex = chartConst.TOOLTIP_ZINDEX; + }, + + /** + * On hide tooltip container. + */ + onHideTooltipContainer: function() { + this.tooltipContainer.style.zIndex = 0; + }, + + /** + * Mix in. + * @param {function} func target function + * @ignore + */ + mixin: function(func) { + snippet.extend(func.prototype, this); + } + }; + + module.exports = singleTooltipMixer; + + +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview This is templates of tooltip. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var templateMaker = __webpack_require__(65); + + var htmls = { + HTML_DEFAULT_TEMPLATE: '
' + + '
{{ category }}
' + + '
' + + '{{ legend }}' + + '{{ label }}' + + '{{ suffix }}' + + '
' + + '
', + HTML_PIE_TEMPLATE: '
' + + '
{{ category }}
' + + '
' + + '{{ legend }}' + + '{{ ratioLabel }}' + + '( {{ label }} {{ suffix }})' + + '
' + + '
', + HTML_COORDINATE_TYPE_CHART_TEMPLATE: '
' + + '
{{ category }}
' + + '
' + + '{{ legend }}' + + '{{ label }}' + + '
{{ valueTypes }}' + + '
', + HTML_GROUP: '
' + + '
{{ category }}
' + + '{{ items }}' + + '
', + HTML_GROUP_TYPE: '
{{ type }}
', + HTML_GROUP_ITEM: '
' + + '
' + + ' {{ legend }}{{ value }}' + + '{{ suffix }}' + + '
', + GROUP_CSS_TEXT: 'background-color:{{ color }}', + HTML_MAP_CHART_DEFAULT_TEMPLATE: '
' + + '
{{ name }}: {{ value }}{{ suffix }}
' + + '
', + HTML_BOXPLOT_TEMPLATE: '
' + + '
{{ category }}
' + + '
' + + '{{ legend }}' + + '
' + + '
' + + 'Maximum: ' + + '{{ maxLabel }}' + + '{{ suffix }}' + + '
' + + '
' + + 'Upper Quartile: ' + + '{{ uqLabel }}' + + '{{ suffix }}' + + '
' + + '
' + + 'Median: ' + + '{{ medianLabel }}' + + '{{ suffix }}' + + '
' + + '
' + + 'Lower Quartile: ' + + '{{ lqLabel }}' + + '{{ suffix }}' + + '
' + + '
' + + 'Minimum: ' + + '{{ minLabel }}' + + '{{ suffix }}' + + '
' + + '
', + HTML_BOXPLOT_OUTLIER: '
' + + '
{{ category }}
' + + '
' + + '{{ legend }}' + + '
' + + '
' + + 'Outlier: ' + + '{{ label }}' + + '{{ suffix }}' + + '
' + + '
', + HTML_BULLET_TEMPLATE: '
' + + '
{{ category }}' + + '{{ label }}{{ suffix }}
' + + '
' + }; + + module.exports = { + tplDefault: templateMaker.template(htmls.HTML_DEFAULT_TEMPLATE), + tplPieChart: templateMaker.template(htmls.HTML_PIE_TEMPLATE), + tplCoordinatetypeChart: templateMaker.template(htmls.HTML_COORDINATE_TYPE_CHART_TEMPLATE), + tplGroup: templateMaker.template(htmls.HTML_GROUP), + tplGroupType: templateMaker.template(htmls.HTML_GROUP_TYPE), + tplGroupItem: templateMaker.template(htmls.HTML_GROUP_ITEM), + tplGroupCssText: templateMaker.template(htmls.GROUP_CSS_TEXT), + tplMapChartDefault: templateMaker.template(htmls.HTML_MAP_CHART_DEFAULT_TEMPLATE), + tplBoxplotChartDefault: templateMaker.template(htmls.HTML_BOXPLOT_TEMPLATE), + tplBoxplotChartOutlier: templateMaker.template(htmls.HTML_BOXPLOT_OUTLIER), + tplBulletChartDefault: templateMaker.template(htmls.HTML_BULLET_TEMPLATE) + }; + + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview This is template maker. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + + module.exports = { + /** + * This is template maker. + * @param {string} html html + * @returns {function} template function + * @eaxmple + * + * var template = templateMaker.template('{{ name }}'), + * result = template({name: 'John'); + * console.log(result); // John + * + */ + template: function(html) { + return function(data) { + var result = html; + snippet.forEach(data, function(value, key) { + var regExp = new RegExp('{{\\s*' + key + '\\s*}}', 'g'); + result = result.replace(regExp, String(value).replace('$', '$')); + }); + + return result; + }; + } + }; + + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Group tooltip component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var TooltipBase = __webpack_require__(62); + var GroupTooltipPositionModel = __webpack_require__(67); + var chartConst = __webpack_require__(8); + var dom = __webpack_require__(9); + var renderUtil = __webpack_require__(7); + var defaultTheme = __webpack_require__(34); + var tooltipTemplate = __webpack_require__(64); + var snippet = __webpack_require__(6); + var predicate = __webpack_require__(11); + + /** + * @classdesc GroupTooltip component. + * @class GroupTooltip + * @private + */ + var GroupTooltip = snippet.defineClass(TooltipBase, /** @lends GroupTooltip.prototype */ { + /** + * Group tooltip component. + * @constructs GroupTooltip + * @private + * @override + */ + init: function(params) { + this.prevIndex = null; + this.isBullet = predicate.isBulletChart(params.chartType); + TooltipBase.call(this, params); + }, + + /** + * Make tooltip html. + * @param {string} category category + * @param {Array.<{value: string, legend: string, chartType: string, suffix: ?string}>} items items data + * @param {string} rawCategory raw category + * @param {number} groupIndex group index + * @returns {string} tooltip html + * @private + */ + _makeTooltipHtml: function(category, items, rawCategory, groupIndex) { + var template = tooltipTemplate.tplGroupItem; + var cssTextTemplate = tooltipTemplate.tplGroupCssText; + var colors = this._makeColors(this.theme, groupIndex); + var prevType, itemsHtml; + + itemsHtml = snippet.map(items, function(item, index) { + var type = item.type; + var typeVisible = (type !== 'data') && (prevType !== type); + var itemHtml = ''; + + prevType = type; + + if (!item.value) { + return null; + } + + if (typeVisible) { + itemHtml = tooltipTemplate.tplGroupType({ + type: type + }); + } + + itemHtml += template(snippet.extend({ + cssText: cssTextTemplate({color: colors[index]}) + }, item)); + + return itemHtml; + }).join(''); + + return tooltipTemplate.tplGroup({ + category: category, + items: itemsHtml + }); + }, + + /** + * Set default align option of tooltip. + * @private + * @override + */ + _setDefaultTooltipPositionOption: function() { + if (this.options.align) { + return; + } + + if (this.isVertical) { + this.options.align = chartConst.TOOLTIP_DEFAULT_GROUP_ALIGN_OPTION; + } else { + this.options.align = chartConst.TOOLTIP_DEFAULT_GROUP_HORIZONTAL_ALIGN_OPTION; + } + }, + + /** + * Render tooltip component. + * @returns {HTMLElement} + * @override + */ + render: function(data) { + var container = TooltipBase.prototype.render.call(this, data); + var chartDimension = this.dimensionMap.chart; + var bound = this.layout; + + if (data.checkedLegends) { + this.theme = { + colors: this.colors + }; + } + + this.positionModel = new GroupTooltipPositionModel(chartDimension, bound, this.isVertical, this.options); + + return container; + }, + + /** + * Rerender. + * @param {{checkedLegends: Array.}} data rendering data + * @override + */ + rerender: function(data) { + TooltipBase.prototype.rerender.call(this, data); + this.prevIndex = null; + + if (data.checkedLegends) { + this.theme = this._updateLegendTheme(data.checkedLegends); + } + }, + + /** + * Zoom. + */ + zoom: function() { + this.prevIndex = null; + TooltipBase.prototype.zoom.call(this); + }, + + /** + * Update legend theme. + * @param {object | Array.}checkedLegends checked legends + * @returns {{colors: Array.}} legend theme + * @private + */ + _updateLegendTheme: function(checkedLegends) { + var colors = []; + + snippet.forEachArray(this.dataProcessor.getOriginalLegendData(), function(item) { + var _checkedLegends = checkedLegends[item.chartType] || checkedLegends; + if (_checkedLegends[item.index]) { + colors.push(item.theme.color); + } + }); + + return { + colors: colors + }; + }, + + /** + * Make tooltip data. + * @returns {Array.} tooltip data + * @override + */ + makeTooltipData: function() { + var length = this.dataProcessor.getCategoryCount(this.isVertical); + + return snippet.map(this.dataProcessor.getSeriesGroups(), function(seriesGroup, index) { + var values = seriesGroup.map(function(item) { + return { + type: item.type || 'data', + label: item.label + }; + }); + + return { + category: this.dataProcessor.makeTooltipCategory(index, length - index, this.isVertical), + values: values + }; + }, this); + }, + + /** + * Make colors. + * @param {object} theme tooltip theme + * @param {number} [groupIndex] groupIndex + * @returns {Array.} colors + * @private + */ + _makeColors: function(theme, groupIndex) { + var colorIndex = 0, + legendLabels = this.dataProcessor.getLegendData(), + defaultColors, colors, prevChartType; + + if (this.isBullet) { + return this.dataProcessor.getGraphColors()[groupIndex]; + } + + if (theme.colors) { + return theme.colors; + } + + defaultColors = defaultTheme.series.colors.slice(0, legendLabels.length); + + return snippet.map(snippet.pluck(legendLabels, 'chartType'), function(chartType) { + var color; + + if (prevChartType !== chartType) { + colors = theme[chartType] ? theme[chartType].colors : defaultColors; + colorIndex = 0; + } + + prevChartType = chartType; + color = colors[colorIndex]; + colorIndex += 1; + + return color; + }); + }, + + /** + * Make rendering data about legend item. + * @param {Array.} values values + * @param {number} groupIndex groupIndex + * @returns {Array.<{value: string, legend: string, chartType: string, suffix: ?string}>} legend item data. + * @private + */ + _makeItemRenderingData: function(values, groupIndex) { + var dataProcessor = this.dataProcessor, + suffix = this.suffix; + + return snippet.map(values, function(data, index) { + var item = { + value: data.label, + type: data.type, + suffix: suffix, + legend: '' + }; + var legendLabel; + + if (this.isBullet) { + legendLabel = dataProcessor.getLegendItem(groupIndex); + } else { + legendLabel = dataProcessor.getLegendItem(index); + item.legend = legendLabel.label; + } + + item.chartType = legendLabel.chartType; + + return item; + }, this); + }, + + /** + * Make tooltip. + * @param {number} groupIndex group index + * @returns {string} tooltip html + * @private + */ + _makeGroupTooltipHtml: function(groupIndex) { + var data = this.data[groupIndex]; + var items, htmlString = ''; + + if (data) { + items = this._makeItemRenderingData(data.values, groupIndex); + htmlString = this.templateFunc(data.category, items, this.getRawCategory(groupIndex), groupIndex); + } + + return htmlString; + }, + + /** + * Get tooltip sector element. + * @returns {HTMLElement} sector element + * @private + */ + _getTooltipSectorElement: function() { + var groupTooltipSector; + + if (!this.groupTooltipSector) { + this.groupTooltipSector = groupTooltipSector = dom.create('DIV', 'tui-chart-group-tooltip-sector'); + dom.append(this.tooltipContainer, groupTooltipSector); + } + + return this.groupTooltipSector; + }, + + /** + * Make bound about tooltip sector of vertical type chart. + * @param {number} height height + * @param {{start: number, end: number}} range range + * @param {boolean} isLine whether line or not + * @returns {{dimension: {width: number, height: number}, position: {left: number, top: number}}} bound + * @private + */ + _makeVerticalTooltipSectorBound: function(height, range, isLine) { + var width; + + if (isLine) { + width = 1; + } else { + width = range.end - range.start; + } + + return { + dimension: { + width: width, + height: height + }, + position: { + left: range.start, + top: chartConst.SERIES_EXPAND_SIZE + } + }; + }, + + /** + * Make bound about tooltip sector of horizontal type chart. + * @param {number} width width + * @param {{start: number, end:number}} range range + * @returns {{dimension: {width: number, height: number}, position: {left: number, top: number}}} bound + * @private + */ + _makeHorizontalTooltipSectorBound: function(width, range) { + return { + dimension: { + width: width, + height: range.end - range.start + }, + position: { + left: chartConst.SERIES_EXPAND_SIZE, + top: range.start + } + }; + }, + + /** + * Make bound about tooltip sector. + * @param {number} size width or height + * @param {{start: number, end:number}} range range + * @param {boolean} isVertical whether vertical or not + * @param {boolean} isLine whether line type or not + * @returns {{dimension: {width: number, height: number}, position: {left: number, top: number}}} bound + * @private + */ + _makeTooltipSectorBound: function(size, range, isVertical, isLine) { + var bound; + + if (isVertical) { + bound = this._makeVerticalTooltipSectorBound(size, range, isLine); + } else { + bound = this._makeHorizontalTooltipSectorBound(size, range); + } + + return bound; + }, + + /** + * Show tooltip sector. + * @param {number} size width or height + * @param {{start: number, end:number}} range range + * @param {boolean} isVertical whether vertical or not + * @param {number} index index + * @param {boolean} [isMoving] whether moving or not + * @private + */ + _showTooltipSector: function(size, range, isVertical, index, isMoving) { + var groupTooltipSector = this._getTooltipSectorElement(), + isLine = (range.start === range.end), + bound = this._makeTooltipSectorBound(size, range, isVertical, isLine); + + if (isLine) { + this.eventBus.fire('showGroupTooltipLine', bound); + } else { + renderUtil.renderDimension(groupTooltipSector, bound.dimension); + renderUtil.renderPosition(groupTooltipSector, bound.position); + dom.addClass(groupTooltipSector, 'show'); + } + + if (isMoving) { + index -= 1; + } + + this.eventBus.fire('showGroupAnimation', index); + }, + + /** + * Hide tooltip sector. + * @param {number} index index + * @private + */ + _hideTooltipSector: function(index) { + var groupTooltipSector = this._getTooltipSectorElement(); + + if (!dom.hasClass(groupTooltipSector, 'show')) { + this.eventBus.fire('hideGroupTooltipLine'); + } else { + dom.removeClass(groupTooltipSector, 'show'); + } + this.eventBus.fire('hideGroupAnimation', index); + this.eventBus.fire('hideGroupTooltipLine'); + }, + + /** + * Show tooltip. + * @param {HTMLElement} elTooltip tooltip element + * @param {{index: number, range: {start: number, end: number}, + * size: number, direction: string, isVertical: boolean + * }} params coordinate event parameters + * @param {{left: number, top: number}} prevPosition prev position + * @private + */ + _showTooltip: function(elTooltip, params, prevPosition) { + var dimension, position; + + if (!snippet.isNull(this.prevIndex)) { + this.eventBus.fire('hideGroupAnimation', this.prevIndex); + } + + elTooltip.innerHTML = this._makeGroupTooltipHtml(params.index); + + this._fireBeforeShowTooltipPublicEvent(params.index, params.range, params.silent); + + dom.addClass(elTooltip, 'show'); + + this._showTooltipSector(params.size, params.range, params.isVertical, params.index, params.isMoving); + + dimension = this.getTooltipDimension(elTooltip); + position = this.positionModel.calculatePosition(dimension, params.range); + + this._moveToPosition(elTooltip, position, prevPosition); + + this._fireAfterShowTooltipPublicEvent(params.index, params.range, { + element: elTooltip, + position: position + }, params.silent); + + this.prevIndex = params.index; + }, + + /** + * To call beforeShowTooltip callback of public event. + * @param {number} index index + * @param {{start: number, end: number}} range range + * @param {boolean} [silent] - whether invoke a public beforeHideTooltip event or not + * @private + */ + _fireBeforeShowTooltipPublicEvent: function(index, range, silent) { + if (silent) { + return; + } + + this.eventBus.fire(chartConst.PUBLIC_EVENT_PREFIX + 'beforeShowTooltip', { + chartType: this.chartType, + index: index, + range: range + }); + }, + + /** + * To call afterShowTooltip callback of public event. + * @param {number} index index + * @param {{start: number, end: number}} range range + * @param {object} additionParams addition parameters + * @param {boolean} [silent] - whether invoke a public beforeHideTooltip event or not + * @private + */ + _fireAfterShowTooltipPublicEvent: function(index, range, additionParams, silent) { + if (silent) { + return; + } + this.eventBus.fire(chartConst.PUBLIC_EVENT_PREFIX + 'afterShowTooltip', snippet.extend({ + chartType: this.chartType, + index: index, + range: range + }, additionParams)); + }, + + /** + * Hide tooltip. + * @param {HTMLElement} tooltipElement tooltip element + * @param {number} prevFoundIndex - showing tooltip index + * @param {object} [options] - options for hiding tooltip + * @private + */ + _hideTooltip: function(tooltipElement, prevFoundIndex, options) { + var silent = !!(options && options.silent); + this.prevIndex = null; + this._fireBeforeHideTooltipPublicEvent(prevFoundIndex, silent); + this._hideTooltipSector(prevFoundIndex); + dom.removeClass(tooltipElement, 'show'); + tooltipElement.style.cssText = ''; + }, + + /** + * To call beforeHideTooltip callback of public event. + * @param {number} index index + * @param {boolean} [silent] - options for hiding tooltip + * @private + */ + _fireBeforeHideTooltipPublicEvent: function(index, silent) { + if (silent) { + return; + } + + this.eventBus.fire(chartConst.PUBLIC_EVENT_PREFIX + 'beforeHideTooltip', { + chartType: this.chartType, + index: index + }); + } + }); + + function groupTooltipFactory(params) { + return new GroupTooltip(params); + } + + groupTooltipFactory.componentType = 'tooltip'; + groupTooltipFactory.GroupTooltip = GroupTooltip; + + module.exports = groupTooltipFactory; + + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview GroupTooltipPositionModel is position model for group tooltip.. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var snippet = __webpack_require__(6); + + var GroupTooltipPositionModel = snippet.defineClass(/** @lends GroupTooltipPositionModel.prototype */ { + /** + * GroupTooltipPositionModel is position model for group tooltip. + * @constructs GroupTooltipPositionModel + * @private + * @param {{width: number, height: number}} chartDimension chart dimension + * @param {{ + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }} areaBound tooltip area bound + * @param {boolean} isVertical whether vertical or not + * @param {{align: ?string, position: {left: number, top: number}}} options tooltip options + */ + init: function(chartDimension, areaBound, isVertical, options) { + /** + * chart dimension + * @type {{width: number, height: number}} + */ + this.chartDimension = chartDimension; + + /** + * tooltip area bound + * @type {{dimension: {width: number, height: number}, position: {left: number, top: number}}} + */ + this.areaBound = areaBound; + + /** + * Whether vertical or not + * @type {boolean} + */ + this.isVertical = isVertical; + + /** + * tooltip options + * @type {{align: ?string, position: {left: number, top: number}}} + */ + this.options = options; + + /** + * For caching + * @type {object} + */ + this.positions = {}; + + this._setData(chartDimension, areaBound, isVertical, options); + }, + + /** + * Get horizontal direction. + * @param {?string} alignOption align option + * @returns {string} direction + * @private + */ + _getHorizontalDirection: function(alignOption) { + var direction; + + alignOption = alignOption || ''; + if (alignOption.indexOf('left') > -1) { + direction = chartConst.TOOLTIP_DIRECTION_BACKWARD; + } else if (alignOption.indexOf('center') > -1) { + direction = chartConst.TOOLTIP_DIRECTION_CENTER; + } else { + direction = chartConst.TOOLTIP_DIRECTION_FORWARD; + } + + return direction; + }, + + /** + * Make vertical data. + * @param {{width: number, height: number}} chartDimension chart dimension + * @param {{ + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }} areaBound tooltip area bound + * @param {?string} alignOption align option + * @returns {{ + * positionType: string, sizeType: string, direction: (string), + * areaPosition: number, areaSize: number, chartSize: number, + * basePosition: (number) + * }} vertical data + * @private + */ + _makeVerticalData: function(chartDimension, areaBound, alignOption) { + var hDirection = this._getHorizontalDirection(alignOption); + + return { + positionType: 'left', + sizeType: 'width', + direction: hDirection, + areaPosition: areaBound.position.left, + areaSize: areaBound.dimension.width, + chartSize: chartDimension.width, + basePosition: chartConst.SERIES_EXPAND_SIZE + }; + }, + + /** + * Get vertical direction. + * @param {?string} alignOption align option + * @returns {string} direction + * @private + */ + _getVerticalDirection: function(alignOption) { + var direction; + + alignOption = alignOption || ''; + + if (alignOption.indexOf('top') > -1) { + direction = chartConst.TOOLTIP_DIRECTION_BACKWARD; + } else if (alignOption.indexOf('bottom') > -1) { + direction = chartConst.TOOLTIP_DIRECTION_FORWARD; + } else { + direction = chartConst.TOOLTIP_DIRECTION_CENTER; + } + + return direction; + }, + + /** + * Make horizontal data. + * @param {{width: number, height: number}} chartDimension chart dimension + * @param {{ + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }} areaBound tooltip area bound + * @param {?string} alignOption align option + * @returns {{ + * positionType: string, sizeType: string, direction: (string), + * areaPosition: number, areaSize: number, chartSize: number, + * basePosition: (number) + * }} horizontal data + * @private + */ + _makeHorizontalData: function(chartDimension, areaBound, alignOption) { + var vDirection = this._getVerticalDirection(alignOption); + + return { + positionType: 'top', + sizeType: 'height', + direction: vDirection, + areaPosition: areaBound.position.top, + areaSize: areaBound.dimension.height, + chartSize: chartDimension.height, + basePosition: chartConst.SERIES_EXPAND_SIZE + }; + }, + + /** + * Set data. + * @param {{width: number, height: number}} chartDimension chart dimension + * @param {{ + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }} areaBound tooltip area bound + * @param {boolean} isVertical whether vertical or not + * @param {{align: ?string, position: {left: number, top: number}}} options tooltip options + * @private + */ + _setData: function(chartDimension, areaBound, isVertical, options) { + var verticalData = this._makeVerticalData(chartDimension, areaBound, options.align); + var horizontalData = this._makeHorizontalData(chartDimension, areaBound, options.align); + var offset = options.offset || {}; + + if (isVertical) { + this.mainData = verticalData; + this.subData = horizontalData; + } else { + this.mainData = horizontalData; + this.subData = verticalData; + } + + this.positionOption = {}; + this.positionOption.left = offset.x || 0; + this.positionOption.top = offset.y || 0; + + this.positions = {}; + }, + + /** + * Calculate main position value. + * @param {number} tooltipSize tooltip size (width or height) + * @param {{start: number, end: number}} range range + * @param {object} data data + * @param {string} data.direction direction + * @param {number} data.basePosition basePosition + * @returns {number} position value + * @private + */ + _calculateMainPositionValue: function(tooltipSize, range, data) { + var isLine = (range.start === range.end), + lineTypePadding = 9, + otherTypePadding = 5, + padding = isLine ? lineTypePadding : otherTypePadding, + value = data.basePosition; + + if (data.direction === chartConst.TOOLTIP_DIRECTION_FORWARD) { + value += range.end + padding; + } else if (data.direction === chartConst.TOOLTIP_DIRECTION_BACKWARD) { + value += range.start - tooltipSize - padding; + } else if (isLine) { + value += range.start - (tooltipSize / 2); + } else { + value += range.start + ((range.end - range.start - tooltipSize) / 2); + } + + return value; + }, + + /** + * Calculate sub position value. + * @param {number} tooltipSize tooltip size (width or height) + * @param {object} data data + * @param {number} data.areaSize tooltip area size (width or height) + * @param {string} data.direction direction + * @param {number} data.basePosition basePosition + * @returns {number} position value + * @private + */ + _calculateSubPositionValue: function(tooltipSize, data) { + var middle = data.areaSize / 2, + value; + + if (data.direction === chartConst.TOOLTIP_DIRECTION_FORWARD) { + value = middle + data.basePosition; + } else if (data.direction === chartConst.TOOLTIP_DIRECTION_BACKWARD) { + value = middle - tooltipSize + data.basePosition; + } else { + value = middle - (tooltipSize / 2) + data.basePosition; + } + + return value; + }, + + /** + * Make position value diff. + * @param {number} value positoin value + * @param {number} tooltipSize tooltip size (width or height) + * @param {object} data data + * @param {number} data.chartSize chart size (width or height) + * @param {number} data.areaPosition tooltip area position (left or top) + * @returns {number} diff + * @private + */ + _makePositionValueDiff: function(value, tooltipSize, data) { + return value + data.areaPosition + tooltipSize - data.chartSize; + }, + + /** + * Adjust backward position value. + * @param {number} value position value + * @param {{start: number, end: number}} range range + * @param {number} tooltipSize tooltip size (width or height) + * @param {object} data data + * @param {number} data.chartSize chart size (width or height) + * @param {number} data.areaPosition tooltip area position (left or top) + * @param {number} data.basePosition basePosition + * @returns {number} position value + * @private + */ + _adjustBackwardPositionValue: function(value, range, tooltipSize, data) { + var changedValue; + + if (value < -data.areaPosition) { + changedValue = this._calculateMainPositionValue(tooltipSize, range, { + direction: chartConst.TOOLTIP_DIRECTION_FORWARD, + basePosition: data.basePosition + }); + if (this._makePositionValueDiff(changedValue, tooltipSize, data) > 0) { + value = -data.areaPosition; + } else { + value = changedValue; + } + } + + return value; + }, + + /** + * Adjust forward position value. + * @param {number} value position value + * @param {{start: number, end: number}} range range + * @param {number} tooltipSize tooltip size (width or height) + * @param {object} data data + * @param {number} data.chartSize chart size (width or height) + * @param {number} data.areaPosition tooltip area position (left or top) + * @param {number} data.basePosition basePosition + * @returns {number} position value + * @private + */ + _adjustForwardPositionValue: function(value, range, tooltipSize, data) { + var diff = this._makePositionValueDiff(value, tooltipSize, data), + changedValue; + + if (diff > 0) { + changedValue = this._calculateMainPositionValue(tooltipSize, range, { + direction: chartConst.TOOLTIP_DIRECTION_BACKWARD, + basePosition: data.basePosition + }); + if (changedValue < -data.areaPosition) { + value -= diff; + } else { + value = changedValue; + } + } + + return value; + }, + + /** + * Adjust main position value + * @param {number} value position value + * @param {{start: number, end: number}} range range + * @param {number} tooltipSize tooltip size (width or height) + * @param {object} data data + * @param {number} data.chartSize chart size (width or height) + * @param {number} data.areaPosition tooltip area position (left or top) + * @returns {number} position value + * @private + */ + _adjustMainPositionValue: function(value, range, tooltipSize, data) { + if (data.direction === chartConst.TOOLTIP_DIRECTION_BACKWARD) { + value = this._adjustBackwardPositionValue(value, range, tooltipSize, data); + } else if (data.direction === chartConst.TOOLTIP_DIRECTION_FORWARD) { + value = this._adjustForwardPositionValue(value, range, tooltipSize, data); + } else { + value = Math.max(value, -data.areaPosition); + value = Math.min(value, data.chartSize - data.areaPosition - tooltipSize); + } + + return value; + }, + + /** + * Adjust sub position value. + * @param {number} value position value + * @param {number} tooltipSize tooltip size (width or height) + * @param {object} data data + * @param {number} data.chartSize chart size (width or height) + * @param {number} data.areaPosition tooltip area position (left or top) + * @param {number} data.basePosition basePosition + * @returns {number} position value + * @private + */ + _adjustSubPositionValue: function(value, tooltipSize, data) { + if (data.direction === chartConst.TOOLTIP_DIRECTION_FORWARD) { + value = Math.min(value, data.chartSize - data.areaPosition - tooltipSize); + } else { + value = Math.max(value, -data.areaPosition); + } + + return value; + }, + + /** + * Make caching key. + * @param {{start: number, end: number}} range range + * @returns {string} key + * @private + */ + _makeCachingKey: function(range) { + return range.start + '-' + range.end; + }, + + /** + * Add position option. + * @param {number} position position + * @param {string} positionType position type (left or top) + * @returns {number} position + * @private + */ + _addPositionOptionValue: function(position, positionType) { + return position + this.positionOption[positionType]; + }, + + /** + * Make main position value. + * @param {{width: number, height: number}} tooltipDimension tooltip dimension + * @param {{start: number, end: number}} range tooltip sector range + * @param {{ + * positionType: string, sizeType: string, direction: (string), + * areaPosition: number, areaSize: number, chartSize: number, + * basePosition: (number) + * }} main main data + * @returns {number} position value + * @private + */ + _makeMainPositionValue: function(tooltipDimension, range, main) { + var value; + + value = this._calculateMainPositionValue(tooltipDimension[main.sizeType], range, main); + value = this._addPositionOptionValue(value, main.positionType); + value = this._adjustMainPositionValue(value, range, tooltipDimension[main.sizeType], main); + + return value; + }, + + /** + * Make sub position value. + * @param {{width: number, height: number}} tooltipDimension tooltip dimension + * @param {{ + * positionType: string, sizeType: string, direction: (string), + * areaPosition: number, areaSize: number, chartSize: number, + * basePosition: (number) + * }} sub sub data + * @returns {number} position value + * @private + */ + _makeSubPositionValue: function(tooltipDimension, sub) { + var value; + + value = this._calculateSubPositionValue(tooltipDimension[sub.sizeType], sub); + value = this._addPositionOptionValue(value, sub.positionType); + value = this._adjustSubPositionValue(value, tooltipDimension[sub.sizeType], sub); + + return value; + }, + + /** + * Calculate group tooltip position. + * @param {{width: number, height: number}} tooltipDimension tooltip dimension + * @param {{start: number, end: number}} range tooltip sector range + * @returns {{left: number, top: number}} group tooltip position + */ + calculatePosition: function(tooltipDimension, range) { + var key = this._makeCachingKey(range), + main = this.mainData, + sub = this.subData, + position = this.positions[key]; + + if (!position) { + position = {}; + position[main.positionType] = this._makeMainPositionValue(tooltipDimension, range, main); + position[sub.positionType] = this._makeSubPositionValue(tooltipDimension, sub); + this.positions[key] = position; + } + + return position; + }, + + /** + * Update tooltip options for position calculation. + * @param {{align: ?string, position: {left: number, top: number}}} options tooltip options + */ + updateOptions: function(options) { + this.options = options; + this._setData(this.chartDimension, this.areaBound, this.isVertical, options); + }, + + /** + * Update tooltip bound for position calculation. + * @param {{ + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }} bound tooltip area bound + */ + updateBound: function(bound) { + this.areaBound = bound; + this._setData(this.chartDimension, bound, this.isVertical, this.options); + } + }); + + module.exports = GroupTooltipPositionModel; + + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Tooltip component for map chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var TooltipBase = __webpack_require__(62); + var singleTooltipMixer = __webpack_require__(63); + var tooltipTemplate = __webpack_require__(64); + var snippet = __webpack_require__(6); + + /** + * @classdesc MapChartTooltip component. + * @class MapChartTooltip + * @private + */ + var MapChartTooltip = snippet.defineClass(TooltipBase, /** @lends MapChartTooltip.prototype */ { + /** + * Map chart tooltip component. + * @constructs MapChartTooltip + * @private + * @override + */ + init: function(params) { + /** + * Map model + * @type {MapChartMapModel} + */ + this.mapModel = params.mapModel; + + TooltipBase.apply(this, arguments); + }, + + /** + * Make tooltip html. + * @param {{name: string, value: number}} datum tooltip datum + * @returns {string} tooltip html + * @private + */ + _makeTooltipHtml: function(datum) { + return tooltipTemplate.tplMapChartDefault(datum); + }, + + /** + * Make single tooltip html. + * @param {string} chartType chart type + * @param {{groupIndex: number, index: number}} indexes indexes + * @returns {string} tooltip html + * @private + */ + _makeSingleTooltipHtml: function(chartType, indexes) { + var datum = this.mapModel.getDatum(indexes.index), + suffix = this.options.suffix ? ' ' + this.options.suffix : ''; + + return this.templateFunc({ + name: datum.name || datum.code, + value: datum.label, + suffix: suffix + }); + }, + + /** + * Make parameters for show tooltip user event. + * @param {{groupIndex: number, index: number}} indexes indexes + * @param {object} additionParams addition parameters + * @returns {{chartType: string, legend: string, legendIndex: number, index: number}} parameters for show tooltip + * @private + */ + _makeShowTooltipParams: function(indexes, additionParams) { + var datum = this.mapModel.getDatum(indexes.index), + params; + + params = snippet.extend({ + chartType: this.chartType, + code: datum.code, + name: datum.name, + value: datum.label, + index: indexes.index + }, additionParams); + + return params; + }, + + /** + * Set default align option of tooltip. + * @private + * @override + */ + _setDefaultTooltipPositionOption: function() { + if (!this.options.align) { + this.options.align = chartConst.TOOLTIP_DEFAULT_ALIGN_OPTION; + } + } + }); + + singleTooltipMixer.mixin(MapChartTooltip); + + function mapChartTooltipFactory(params) { + return new MapChartTooltip(params); + } + + mapChartTooltipFactory.componentType = 'tooltip'; + + module.exports = mapChartTooltipFactory; + + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview MapChartEventDetector is mouse event detector for map chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var MouseEventDetectorBase = __webpack_require__(70); + var chartConst = __webpack_require__(8); + var eventListener = __webpack_require__(55); + var dom = __webpack_require__(9); + var renderUtil = __webpack_require__(7); + var snippet = __webpack_require__(6); + + var MapChartEventDetector = snippet.defineClass(MouseEventDetectorBase, /** @lends MapChartEventDetector.prototype */ { + /** + * MapChartEventDetector is mouse event detector for map chart. + * @param {object} params parameters + * @param {string} params.chartType - chart type + * @constructs MapChartEventDetector + * @private + * @extends MouseEventDetectorBase + */ + init: function(params) { + /** + * chart type + * {string} + * + */ + this.chartType = params.chartType; + + /** + * event bus for transmitting message + * @type {object} + */ + this.eventBus = params.eventBus; + + /** + * whether mouse down or not + * @type {boolean} + */ + this.isDown = false; + + this.drawingType = chartConst.COMPONENT_TYPE_DOM; + }, + + /** + * Render event handle layer area + * @param {HTMLElement} mouseEventDetectorContainer mouse event detector container element + * @private + */ + _renderMouseEventDetectorArea: function(mouseEventDetectorContainer) { + renderUtil.renderDimension(mouseEventDetectorContainer, this.layout.dimension); + renderUtil.renderPosition(mouseEventDetectorContainer, this.layout.position); + }, + + /** + * On click. + * @private + * @override + */ + _onClick: function() {}, + + /** + * Call 'dragStartMapSeries' event, when occur mouse down event. + * @param {mouseevent} e mouse event + * @private + * @override + */ + _onMousedown: function(e) { + this.isDown = true; + this.eventBus.fire('dragStartMapSeries', { + left: e.clientX, + top: e.clientY + }); + }, + + /** + * Drag end. + * @private + */ + _dragEnd: function() { + this.isDrag = false; + dom.removeClass(this.mouseEventDetectorContainer, 'drag'); + this.eventBus.fire('dragEndMapSeries'); + }, + + /** + * If drag, call dragEnd function. + * But if not drag, occur click event. + * @param {mouseevent} e mouse event + * @private + * @override + */ + _onMouseup: function(e) { + this.isDown = false; + + if (this.isDrag) { + this._dragEnd(); + } else { + this._onMouseEvent('click', e); + } + + this.isMove = false; + }, + + /** + * If mouse downed, set drag mode. + * But if not downed, set move mode. + * @param {mouseevent} e mouse event + * @private + * @override + */ + _onMousemove: function(e) { + if (this.isDown) { + if (!this.isDrag) { + dom.addClass(this.mouseEventDetectorContainer, 'drag'); + } + this.isDrag = true; + this.eventBus.fire('dragMapSeries', { + left: e.clientX, + top: e.clientY + }); + } else { + this.isMove = true; + this._onMouseEvent('move', e); + } + }, + + /** + * If drag mode, call dragEnd. + * But if not drag mode, occur move event. + * @private + * @override + */ + _onMouseout: function(e) { + if (this.isDrag) { + this._dragEnd(); + } else { + this._onMouseEvent('move', e); + } + this.isDown = false; + }, + + /** + * On mouse wheel. + * @param {mouseevent} e mouse event + * @returns {?boolean} + * @private + */ + _onMousewheel: function(e) { + var wheelDelta = e.wheelDelta || e.detail * chartConst.FF_WHEELDELTA_ADJUSTING_VALUE; + + this.eventBus.fire('wheel', wheelDelta, { + left: e.clientX, + top: e.clientY + }); + + if (e.preventDefault) { + e.preventDefault(); + } + + return false; + }, + + /** + * Attach event. + * @param {HTMLElement} target target element + * @override + */ + attachEvent: function(target) { + MouseEventDetectorBase.prototype.attachEvent.call(this, target); + + if (snippet.browser.firefox) { + eventListener.on(target, 'DOMMouseScroll', this._onMousewheel, this); + } else { + eventListener.on(target, 'mousewheel', this._onMousewheel, this); + } + } + }); + + function mapChartEventDetectorFactory(params) { + return new MapChartEventDetector(params); + } + + mapChartEventDetectorFactory.componentType = 'mouseEventDetector'; + + module.exports = mapChartEventDetectorFactory; + + +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview MouseEventDetectorBase is base class for mouse event detector components. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var TickBaseCoordinateModel = __webpack_require__(71); + var BoundsBaseCoordinateModel = __webpack_require__(72); + var chartConst = __webpack_require__(8); + var eventListener = __webpack_require__(55); + var predicate = __webpack_require__(11); + var dom = __webpack_require__(9); + var renderUtil = __webpack_require__(7); + var snippet = __webpack_require__(6); + + var MouseEventDetectorBase = snippet.defineClass(/** @lends MouseEventDetectorBase.prototype */ { + /** + * MouseEventDetectorBase is base class for mouse event detector components. + * @constructs MouseEventDetectorBase + * @private + * @param {object} params parameters + * @param {string} params.chartType - chart type + * @param {Array.} params.chartTypes - chart types + * @param {boolean} params.isVertical - whether vertical or not + * @param {DataProcessor} params.dataProcessor - DataProcessor instance + * @param {boolean} params.allowSelect - whether has allowSelect option or not + */ + init: function(params) { + var isLineTypeChart; + + /** + * type of chart + * @type {string} + */ + this.chartType = params.chartType; + + /** + * chartTypes is available in combo chart + * @type {Array.} + */ + this.chartTypes = params.chartTypes; + + /** + * whether vertical or not + * @type {boolean} + */ + this.isVertical = params.isVertical; + + /** + * data processor + * @type {DataProcessor} + */ + this.dataProcessor = params.dataProcessor; + + /** + * whether allow select series or not + * @type {boolean} + */ + this.allowSelect = params.allowSelect; + + /** + * event bus for transmitting message + * @type {object} + */ + this.eventBus = params.eventBus; + + /** + * layout bounds information for this components + * @type {null|{dimension:{width:number, height:number}, position:{left:number, top:number}}} + */ + this.layout = null; + + /** + * selected series item. + * @type {null | object} + */ + this.selectedData = null; + + isLineTypeChart = predicate.isLineTypeChart(this.chartType, this.chartTypes); + /** + * expand size + * @type {number} + */ + this.expandSize = isLineTypeChart ? chartConst.SERIES_EXPAND_SIZE : 0; + + /** + * series item bounds data + * @type {Array} + */ + this.seriesItemBoundsData = []; + + /** + * series count + * @type {number} + */ + this.seriesCount = predicate.isComboChart(this.chartType) ? 2 : 1; + + this._attachToEventBus(); + + this.drawingType = chartConst.COMPONENT_TYPE_DOM; + }, + + /** + * Attach to event bus. + * @private + */ + _attachToEventBus: function() { + this.eventBus.on('receiveSeriesData', this.onReceiveSeriesData, this); + }, + + /** + * Get bound for rendering. + * @returns {{ + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }} + * @private + */ + _getRenderingBound: function() { + var renderingBound = renderUtil.expandBound(this.layout); + + return renderingBound; + }, + + /** + * Render event handle layer area. + * @param {HTMLElement} mouseEventDetectorContainer - container element for mouse event detector + * @param {number} tickCount - tick count + * @private + */ + _renderMouseEventDetectorArea: function(mouseEventDetectorContainer, tickCount) { + var dimension = this.layout.dimension; + var renderingBound, tbcm; + + this.dimension = dimension; + tbcm = new TickBaseCoordinateModel(this.layout, tickCount, this.chartType, this.isVertical, this.chartTypes); + this.tickBaseCoordinateModel = tbcm; + renderingBound = this._getRenderingBound(); + renderUtil.renderDimension(mouseEventDetectorContainer, renderingBound.dimension); + renderUtil.renderPosition(mouseEventDetectorContainer, renderingBound.position); + }, + + /** + * Set data for rendering. + * @param {{ + * layout: { + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * } + * }} data - bounds data + * @private + */ + _setDataForRendering: function(data) { + this.layout = data.layout; + }, + + /** + * Pick tick count. + * @param {{xAxis: object, yAxis: object}} axisDataMap - axis data map + * @returns {number} + * @private + */ + _pickTickCount: function(axisDataMap) { + var tickCount; + + if (this.isVertical) { + tickCount = axisDataMap.xAxis.eventTickCount || axisDataMap.xAxis.tickCount; + } else { + tickCount = axisDataMap.yAxis.tickCount; + } + + return tickCount; + }, + + /** + * Render for mouseEventDetector component. + * @param {object} data - bounds data and tick count + * @returns {HTMLElement} container for mouse event detector + */ + render: function(data) { + var container = data.paper; + var tickCount; + this.positionMap = data.positionMap; + + dom.addClass(container, 'tui-chart-series-custom-event-area'); + + if (data.axisDataMap.xAxis) { + tickCount = this._pickTickCount(data.axisDataMap); + } + + this._setDataForRendering(data); + this._renderMouseEventDetectorArea(container, tickCount); + this.attachEvent(container); + this.mouseEventDetectorContainer = container; + + this.transparentChild = this._createTransparentChild(); + dom.append(container, this.transparentChild); + + return container; + }, + + /** + * Create a transparent element + * @param {string} height - value of css heigth property + * @returns {HTMLElement} transparent element + * @private + */ + _createTransparentChild: function() { + var child = document.createElement('DIV'); + var style = child.style; + + style.backgroundColor = '#fff'; + style.height = renderUtil.getStyle(this.mouseEventDetectorContainer).height; + renderUtil.setOpacity(child, 0); + + return child; + }, + + /** + * Calculate layer position by client position. + * @param {number} clientX - clientX + * @param {number} [clientY] - clientY + * @param {boolean} [checkLimit] - whether check limit or not + * @returns {{x: number, y: ?number}} + * @private + */ + _calculateLayerPosition: function(clientX, clientY, checkLimit) { + var bound = this.mouseEventDetectorContainer.getBoundingClientRect(); + var seriesPosition = this.positionMap.series; + var expandSize = this.expandSize; + var layerPosition = {}; + var maxLeft, minLeft; + + checkLimit = snippet.isUndefined(checkLimit) ? true : checkLimit; + + if (checkLimit) { + maxLeft = bound.right - expandSize; + minLeft = bound.left + expandSize; + clientX = Math.min(Math.max(clientX, minLeft), maxLeft); + } + + layerPosition.x = clientX - bound.left + seriesPosition.left - chartConst.CHART_PADDING; + + if (!snippet.isUndefined(clientY)) { + layerPosition.y = clientY - bound.top + seriesPosition.top - chartConst.CHART_PADDING; + } + + return layerPosition; + }, + + /** + * Create BoundsBaseCoordinateModel from seriesItemBoundsData for mouse event detector. + * @param {{chartType: string, data: object}} seriesItemBoundsDatum - series item bounds datum + */ + onReceiveSeriesData: function(seriesItemBoundsDatum) { + var seriesItemBoundsData = this.seriesItemBoundsData; + var seriesCount = this.seriesCount; + + if (seriesItemBoundsData.length === seriesCount) { + seriesItemBoundsData = []; + } + + seriesItemBoundsData.push(seriesItemBoundsDatum); + + if (seriesItemBoundsData.length === seriesCount) { + this.boundsBaseCoordinateModel = new BoundsBaseCoordinateModel(seriesItemBoundsData); + } + }, + + /** + * Rerender mouse event detector component. + * @param {object} data - bounds data and tick count + */ + rerender: function(data) { + var tickCount; + + if (data.axisDataMap.xAxis) { + tickCount = this._pickTickCount(data.axisDataMap); + } + + this.selectedData = null; + this._setDataForRendering(data); + this._renderMouseEventDetectorArea(this.mouseEventDetectorContainer, tickCount); + + this.transparentChild.style.height = renderUtil.getStyle(this.mouseEventDetectorContainer).height; + }, + + /** + * Rerender, when resizing chart. + * @param {object} data - bounds data and tick count + */ + resize: function(data) { + this.containerBound = null; + this.rerender(data); + }, + + /** + * Whether changed select data or not. + * @param {object} prev - previous data + * @param {object} cur - current data + * @returns {boolean} + * @private + */ + _isChangedSelectData: function(prev, cur) { + return !prev || !cur || prev.chartType !== cur.chartType || + prev.indexes.groupIndex !== cur.indexes.groupIndex || prev.indexes.index !== cur.indexes.index; + }, + + /** + * Find coordinate data from boundsCoordinateModel. + * @param {{x: number, y: number}} layerPosition - layer position + * @returns {object} + * @private + */ + _findDataFromBoundsCoordinateModel: function(layerPosition) { + var layerX = layerPosition.x; + var layerY = layerPosition.y; + var groupIndex; + + if (predicate.isTreemapChart(this.chartType)) { + groupIndex = 0; + } else { + groupIndex = this.tickBaseCoordinateModel.findIndex(this.isVertical ? layerX : layerY); + } + + return this.boundsBaseCoordinateModel.findData(groupIndex, layerX, layerY); + }, + + /** + * Find data. + * @param {number} clientX - clientX + * @param {number} clientY - clientY + * @returns {object} + * @private + */ + _findData: function(clientX, clientY) { + var layerPosition = this._calculateLayerPosition(clientX, clientY); + + return this._findDataFromBoundsCoordinateModel(layerPosition); + }, + + /** + * Show tooltip + * @private + * @abstract + */ + _showTooltip: function() {}, + + /** + * hide tooltip + * @private + * @abstract + */ + _hideTooltip: function() {}, + + /** + * When mouse event happens, + * hide MouseEventDetector container so that detect event of series elements + * and send mouse position data to series component + * @param {string} eventType - mouse event detector type + * @param {MouseEvent} e - mouse event + * @private + */ + _onMouseEvent: function(eventType, e) { + dom.addClass(this.mouseEventDetectorContainer, 'hide'); + this.eventBus.fire(eventType + 'Series', { + left: e.clientX, + top: e.clientY + }); + dom.removeClass(this.mouseEventDetectorContainer, 'hide'); + }, + + /** + * Unselect selected data. + * @private + */ + _unselectSelectedData: function() { + this.eventBus.fire('unselectSeries', this.selectedData); + this.selectedData = null; + }, + + /** + * Call 'selectSeries' event, when changed found position data. + * And call 'unselectSeries' event, when not changed found position data. + * @param {MouseEvent} e - mouse event + * @private + */ + _onClick: function(e) { + var foundData = this._findData(e.clientX, e.clientY); + + if (!this._isChangedSelectData(this.selectedData, foundData)) { + this._unselectSelectedData(); + } else if (foundData) { + if (this.selectedData) { + this._unselectSelectedData(); + } + + this.eventBus.fire('selectSeries', foundData); + if (this.allowSelect) { + this.selectedData = foundData; + } + } + }, + + /** + * On mouse down + * @private + * @abstract + */ + _onMousedown: function() {}, + + /** + * On mouse up + * @private + * @abstract + */ + _onMouseup: function() {}, + + /** + * Store client position, when occur mouse move event. + * @param {MouseEvent} e - mouse event + * @abstract + * @private + */ + _onMousemove: function() {}, + + /** + * Abstract mouseout handler + * @abstract + * @private + */ + _onMouseout: function() {}, + + /** + * Attach mouse event. + * @param {HTMLElement} target - target element + */ + attachEvent: function(target) { + eventListener.on(target, { + click: this._onClick, + mousedown: this._onMousedown, + mouseup: this._onMouseup, + mousemove: this._onMousemove, + mouseout: this._onMouseout + }, this); + }, + + /** + * find data by indexes + * @abstract + */ + findDataByIndexes: function() {}, + + /** + * Set prevClientPosition by MouseEvent + * @param {?MouseEvent} event - mouse event + */ + _setPrevClientPosition: function(event) { + if (!event) { + this.prevClientPosition = null; + } else { + this.prevClientPosition = { + x: event.clientX, + y: event.clientY + }; + } + } + }); + + snippet.CustomEvents.mixin(MouseEventDetectorBase); + + module.exports = MouseEventDetectorBase; + + +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview TickBaseDataModel is tick base data model. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var predicate = __webpack_require__(11); + var arrayUtil = __webpack_require__(10); + var snippet = __webpack_require__(6); + + var TickBaseDataModel = snippet.defineClass(/** @lends TickBaseDataModel.prototype */ { + /** + * TickBaseDataModel is tick base data model. + * @param {{ + * dimension: { + * width: number, + * height: number + * }, position: { + * left: number, + * top: number + * } + * }} layout layout + * @param {number} tickCount tick count + * @param {string} chartType chart type + * @param {boolean} isVertical whether vertical or not + * @param {Array.} [chartTypes] - chart types of combo chart + * @constructs TickBaseDataModel + * @private + */ + init: function(layout, tickCount, chartType, isVertical, chartTypes) { + /** + * whether line type or not + * @type {boolean} + */ + this.isLineType = predicate.isLineTypeChart(chartType, chartTypes); + + this.data = this._makeData(layout, tickCount, isVertical); + }, + + /** + * Get each tick ranges + * @param {number} tickCount tick count + * @param {number} firstPosition first position value + * @param {number} tickInterval tick distance + * @returns {Array.} + * @private + */ + _getRanges: function(tickCount, firstPosition, tickInterval) { + var prev = firstPosition; + var halfInterval = tickInterval / 2; + + return snippet.map(snippet.range(0, tickCount), function() { + var limit = { + min: prev - halfInterval, + max: prev + halfInterval + }; + + prev += tickInterval; + + return limit; + }); + }, + + /** + * Make tick base data about line type chart. + * @param {number} width width + * @param {number} tickCount tick count + * @param {number} firstPosition firstPosition of group + * @returns {Array} tick base data + * @private + */ + _makeLineTypeData: function(width, tickCount, firstPosition) { + var tickInterval = (width + 1) / (tickCount - 1); + var ranges = this._getRanges(tickCount, (firstPosition || 0), tickInterval); + + ranges[tickCount - 1].max -= 1; + + return ranges; + }, + + /** + * Make tick base data about non line type chart. + * @param {number} size width or height + * @param {number} tickCount tick count + * @param {number} firstPosition firstPosition of group + * @returns {Array} tick base data + * @private + */ + _makeNormalData: function(size, tickCount, firstPosition) { + var len = tickCount - 1; + var tickInterval = size / len; + var prev = (firstPosition || 0); + + return snippet.map(snippet.range(0, len), function() { + var max = arrayUtil.min([size + prev, tickInterval + prev]); + var limit = { + min: prev, + max: max + }; + prev = max; + + return limit; + }); + }, + + /** + * Make tick base data for mouse event detector. + * @param {{dimension: object, position: object}} layout layout + * @param {number} tickCount tick count + * @param {boolean} isVertical whether vertical or not + * @returns {Array.} tick base data + * @private + */ + _makeData: function(layout, tickCount, isVertical) { + var sizeType = isVertical ? 'width' : 'height'; + var positionType = isVertical ? 'left' : 'top'; + var data; + + if (this.isLineType) { + data = this._makeLineTypeData(layout.dimension[sizeType], tickCount, layout.position[positionType]); + } else { + data = this._makeNormalData(layout.dimension[sizeType], tickCount, layout.position[positionType]); + } + + return data; + }, + + /** + * Find index. + * @param {number} pointValue mouse position point value + * @returns {number} group index + */ + findIndex: function(pointValue) { + var foundIndex = -1; + + snippet.forEachArray(this.data, function(limit, index) { + if (limit.min < pointValue && limit.max >= pointValue) { + foundIndex = index; + + return false; + } + + return true; + }); + + return foundIndex; + }, + + /** + * Get last index. + * @returns {number} + */ + getLastIndex: function() { + return this.data.length - 1; + }, + + /** + * Make range of tooltip position. + * @param {number} index index + * @param {number} positionValue positionValue + * @returns {{start: number, end: number}} range type value + * @private + */ + makeRange: function(index, positionValue) { + var limit = this.data[index], + range, center; + if (this.isLineType) { + center = parseInt(limit.max - ((limit.max - limit.min) / 2), 10); + range = { + start: center, + end: center + }; + } else { + range = { + start: limit.min - (positionValue || 0), + end: limit.max - (positionValue || 0) + }; + } + + return range; + } + }); + + module.exports = TickBaseDataModel; + + +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview BoundsBaseCoordinateModel is data model for mouse event detector of bounds type. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + /** + * position + * @typedef {{left: number, top: number}} position + * @private + */ + + /** + * bound + * @typedef {{ + * dimension: {width: number, height: number}, + * position: position + *}} bound + * @private + */ + + /** + * group bound + * @typedef {Array.>} groupBound + * @private + */ + + /** + * group position + * @typedef {Array.>} groupPosition + * @private + */ + + /** + * series info + * @typedef {{ + * chartType: {string}, + * data: { + * groupBounds: ?groupBound, + * groupValues: ?Array.>, + * groupPositions: ?groupPosition + * } + *}} seriesInfo + * @private + */ + + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var arrayUtil = __webpack_require__(10); + var snippet = __webpack_require__(6); + + var BoundsBaseCoordinateModel = snippet.defineClass(/** @lends BoundsBaseCoordinateModel.prototype */ { + /** + * BoundsBaseCoordinateModel is data mode for mouse event detector of bounds type. + * @constructs BoundsBaseCoordinateModel + * @private + * @param {Array} seriesItemBoundsData - series item bounds data + */ + init: function(seriesItemBoundsData) { + this.data = this._makeData(seriesItemBoundsData); + }, + + /** + * @param {string} chartType - chart type + * @param {object} indexes - index of SeriesDataModel + * @param {boolean} allowNegativeTooltip - whether allow negative tooltip or not + * @param {object} bound - coordinate data for rendering graph + * @returns {object} - `sendData`: tooltip contents, `bound`: for detecting hovered or not + * @private + */ + _makeTooltipData: function(chartType, indexes, allowNegativeTooltip, bound) { + return { + sendData: { + chartType: chartType, + indexes: indexes, + allowNegativeTooltip: allowNegativeTooltip, + bound: bound + }, + bound: { + left: bound.left, + top: bound.top, + right: bound.left + bound.width, + bottom: bound.top + bound.height + } + }; + }, + + /** + * Make position data for rect type graph + * @param {groupBound} groupBounds group bounds + * @param {string} chartType chart type + * @returns {Array} + * @private + */ + _makeRectTypePositionData: function(groupBounds, chartType) { + var allowNegativeTooltip = !predicate.isBoxTypeChart(chartType); + + return snippet.map(groupBounds, function(bounds, groupIndex) { + return snippet.map(bounds, function(bound, index) { + if (!bound) { + return null; + } + + return this._makeTooltipData( + chartType, + { + groupIndex: groupIndex, + index: index + }, + allowNegativeTooltip, + bound.end || bound + ); + }, this); + }, this); + }, + + /** + * Make position data for rect type graph + * @param {groupBound} groupBounds group bounds + * @param {string} chartType chart type + * @param {object} resultData resultData + * @private + */ + _makeOutliersPositionDataForBoxplot: function(groupBounds, chartType, resultData) { + var allowNegativeTooltip = !predicate.isBoxTypeChart(chartType); + var _groupBounds = [].concat(groupBounds); + + snippet.forEach(_groupBounds, function(bounds, groupIndex) { + snippet.forEach(bounds, function(bound, index) { + var outliers; + + if (bound.outliers && bound.outliers.length) { + outliers = snippet.map(bound.outliers, function(outlier, outlierIndex) { + var outlierBound = { + top: outlier.top - 3, + left: outlier.left - 3, + width: 6, + height: 6 + }; + + return this._makeTooltipData( + chartType, + { + groupIndex: groupIndex, + index: index, + outlierIndex: outlierIndex + }, + allowNegativeTooltip, + outlierBound + ); + }, this); + + resultData[groupIndex] = resultData[groupIndex].concat(outliers); + } + }, this); + }, this); + }, + + /** + * Make position data for dot type graph + * @param {groupPositions} groupPositions group positions + * @param {string} chartType chart type + * @returns {Array.>} + * @private + */ + _makeDotTypePositionData: function(groupPositions, chartType) { + if (!groupPositions) { + return []; + } + + return snippet.map(arrayUtil.pivot(groupPositions), function(positions, groupIndex) { + return snippet.map(positions, function(position, index) { + if (!position) { + return null; + } + + return { + sendData: { + chartType: chartType, + indexes: { + groupIndex: groupIndex, + index: index + }, + bound: position + }, + bound: { + left: position.left - chartConst.DOT_RADIUS, + top: position.top - chartConst.DOT_RADIUS, + right: position.left + chartConst.DOT_RADIUS, + bottom: position.top + chartConst.DOT_RADIUS + } + }; + }); + }); + }, + + /** + * Join data. + * @param {Array.>>} dataGroupSet data group set + * @returns {Array.>} joined data + * @private + */ + _joinData: function(dataGroupSet) { + var results = []; + snippet.forEachArray(dataGroupSet, function(dataGroup) { + snippet.forEachArray(dataGroup, function(data, index) { + var additionalIndex; + + if (!results[index]) { + results[index] = data; + } else { + additionalIndex = results[index].length; + snippet.forEachArray(data, function(datum) { + if (datum) { + datum.sendData.indexes.legendIndex = datum.sendData.indexes.index + additionalIndex; + } + }); + results[index] = results[index].concat(data); + } + }); + }); + + return results; + }, + + /** + * Make data for detecting mouse event. + * @param {Array} seriesItemBoundsData - series item bounds data + * @returns {Array.>} coordinate data + * @private + */ + _makeData: function(seriesItemBoundsData) { + var data = snippet.map(seriesItemBoundsData, function(info) { + var result; + + if (predicate.isLineTypeChart(info.chartType)) { + result = this._makeDotTypePositionData(info.data.groupPositions, info.chartType); + } else { + result = this._makeRectTypePositionData(info.data.groupBounds, info.chartType); + } + + if (predicate.isBoxplotChart(info.chartType)) { + this._makeOutliersPositionDataForBoxplot(info.data.groupBounds, info.chartType, result); + } + + return result; + }, this); + + return this._joinData(data); + }, + + /** + * Find candidates. + * @param {{bound: {left: number, top: number, right: number, bottom: number}}} data data + * @param {number} layerX layerX + * @param {number} layerY layerY + * @returns {Array.<{sendData: object}>} candidates + * @private + */ + _findCandidates: function(data, layerX, layerY) { + return snippet.filter(data, function(datum) { + var bound = datum && datum.bound, + included = false, + includedX, includedY; + + if (bound) { + includedX = bound.left <= layerX && bound.right >= layerX; + includedY = bound.top <= layerY && bound.bottom >= layerY; + included = includedX && includedY; + } + + return included; + }); + }, + + /** + * Find data. + * @param {number} groupIndex group index + * @param {number} layerX mouse position x + * @param {number} layerY mouse position y + * @returns {object} tooltip data + */ + findData: function(groupIndex, layerX, layerY) { + var min = 10000; + var result = null; + var candidates; + + if (groupIndex > -1 && this.data[groupIndex]) { + // extract data containing layerX, layerY + candidates = this._findCandidates(this.data[groupIndex], layerX, layerY); + + // find nearest data to top position among extracted data + snippet.forEachArray(candidates, function(data) { + var diff = Math.abs(layerY - data.bound.top); + + if (min > diff) { + min = diff; + result = data.sendData; + } + }); + } + + return result; + }, + + /** + * Find data by indexes. + * @param {{index: {number}, seriesIndex: {number}}} indexes - indexe of series item displaying a tooltip + * @param {number} [indexes.outlierIndex] - index of outlier of boxplot series, it only exists in boxplot chart + * @returns {object} tooltip data + */ + findDataByIndexes: function(indexes) { + var foundData = this.data[indexes.index][indexes.seriesIndex].sendData; + + if (snippet.isNumber(indexes.outlierIndex)) { + return this._findOutlierDataByIndexes(indexes); + } + + return foundData; + }, + + /** + * find plot chart data by indexes + * @param {{ + * index: {number}, + * seriesIndex: {number}, + * outlierIndex: {number} + * }} indexes - indexe of series item displaying a tooltip + * @returns {object} - outlier tooltip data + */ + _findOutlierDataByIndexes: function(indexes) { + var foundData = null; + + snippet.forEachArray(this.data[indexes.index], function(datum) { + var datumIndexes = datum.sendData.indexes; + var found = (datumIndexes.index === indexes.seriesIndex) && + (datumIndexes.outlierIndex === indexes.outlierIndex); + + if (found) { + foundData = datum.sendData; + } + + return !found; + }); + + return foundData; + } + }); + + module.exports = BoundsBaseCoordinateModel; + + +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var predicate = __webpack_require__(11); + var areaTypeEventDetectorFactory = __webpack_require__(74); + var simpleEventDetectorFactory = __webpack_require__(77); + var groupTypeEventDetectorFactory = __webpack_require__(78); + var boundsTypeEventDetectorFactory = __webpack_require__(79); + var mapChartEventDetectorFactory = __webpack_require__(69); + + /** + * Factory for MouseEventDetector + * @param {object} params parameter + * @returns {object} + * @ignore + */ + function mouseEventDetectorFactory(params) { + var chartType = params.chartOptions.chartType; + var seriesTypes = params.seriesTypes; + var zoomable = params.chartOptions.series.zoomable; + var seriesAllowSelect = params.chartOptions.series.allowSelect; + var factory; + + if (params.chartOptions.tooltip.grouped) { + factory = groupTypeEventDetectorFactory; + } else if (predicate.isMapChart(chartType)) { + factory = mapChartEventDetectorFactory; + } else if (predicate.isBarTypeChart(chartType) + || predicate.isBoxplotChart(chartType) + || predicate.isHeatmapChart(chartType) + || predicate.isTreemapChart(chartType) + || predicate.isBulletChart(chartType) + ) { + factory = boundsTypeEventDetectorFactory; + } else if (predicate.isCoordinateTypeChart(chartType) + || predicate.isPieChart(chartType) + || predicate.isPieDonutComboChart(chartType, seriesTypes) + ) { + factory = simpleEventDetectorFactory; + } else { + factory = areaTypeEventDetectorFactory; + } + + params.chartType = chartType; + // @todo replace chartType, chartTypes to seriesTypes, problem of the whole component + params.chartTypes = seriesTypes; + params.zoomable = zoomable; + params.allowSelect = seriesAllowSelect; + + return factory(params); + } + + mouseEventDetectorFactory.componentType = 'mouseEventDetector'; + + module.exports = mouseEventDetectorFactory; + + +/***/ }), +/* 74 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview AreaTypeEventDetector is mouse event detector for line type chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var MouseEventDetectorBase = __webpack_require__(70); + var zoomMixer = __webpack_require__(75); + var AreaTypeDataModel = __webpack_require__(76); + var snippet = __webpack_require__(6); + + var AREA_DETECT_DISTANCE_THRESHHOLD = 50; + + var AreaTypeEventDetector = snippet.defineClass(MouseEventDetectorBase, /** @lends AreaTypeEventDetector.prototype */ { + /** + * AreaTypeEventDetector is mouse event detector for line type chart. + * @param {object} params parameters + * @constructs AreaTypeEventDetector + * @private + * @extends MouseEventDetectorBase + */ + init: function(params) { + MouseEventDetectorBase.call(this, params); + + /** + * previous found data + * @type {null | object} + */ + this.prevFoundData = null; + + /** + * previous client position of mouse event (clientX, clientY) + * @type {null | object} + */ + this.prevClientPosition = null; + + /** + * whether zoomable or not + * @type {boolean} + */ + this.zoomable = params.zoomable; + + if (this.zoomable) { + snippet.extend(this, zoomMixer); + this._initForZoom(params.zoomable); + } + }, + + /** + * Animate for adding data. + */ + animateForAddingData: function() { + var foundData, isMoving; + + if (!this.prevClientPosition) { + return; + } + + foundData = this._findData(this.prevClientPosition.x, this.prevClientPosition.y); + + if (foundData) { + isMoving = this.prevFoundData && (this.prevFoundData.indexes.groupIndex === foundData.indexes.groupIndex); + this._showTooltip(foundData, isMoving); + } + + this.prevFoundData = foundData; + }, + + /** + * Create areaTypeDataModel from seriesItemBoundsData for mouse event detector. + * @param {Array.} seriesItemBoundsDatum - series item bounds datum + * @override + */ + onReceiveSeriesData: function(seriesItemBoundsDatum) { + var seriesItemBoundsData = this.seriesItemBoundsData; + var seriesCount = this.seriesCount; + + if (seriesItemBoundsData.length === seriesCount) { + seriesItemBoundsData = []; + } + + seriesItemBoundsData.push(seriesItemBoundsDatum); + + if (seriesItemBoundsData.length === seriesCount) { + this.dataModel = new AreaTypeDataModel(seriesItemBoundsData); + } + + if (this.zoomable) { + this._showTooltipAfterZoom(); + } + }, + + /** + * Find data by client position. + * @param {number} clientX - clientX + * @param {number} clientY - clientY + * @returns {object} + * @private + * @override + */ + _findData: function(clientX, clientY) { + var layerPosition = this._calculateLayerPosition(clientX, clientY); + var selectLegendIndex = this.dataProcessor.selectLegendIndex; + + return this.dataModel.findData(layerPosition, AREA_DETECT_DISTANCE_THRESHHOLD, selectLegendIndex); + }, + + /** + * Find data by client position for zoomable + * @param {number} clientX - clientX + * @param {number} clientY - clientY + * @returns {object} + * @private + */ + _findDataForZoomable: function(clientX, clientY) { + var layerPosition = this._calculateLayerPosition(clientX, clientY); + + return this.dataModel.findData(layerPosition); + }, + + /** + * Get first model data. + * @param {number} index - index + * @returns {object} + * @private + */ + _getFirstData: function(index) { + return this.dataModel.getFirstData(index); + }, + + /** + * Get last model data. + * @param {number} index - index + * @returns {object} + * @private + */ + _getLastData: function(index) { + return this.dataModel.getLastData(index); + }, + + /** + * Show tooltip. + * @param {object} foundData - model data + * @private + */ + _showTooltip: function(foundData) { + this.eventBus.fire('showTooltip', foundData); + this.prevFoundData = foundData; + }, + + /** + * Hide tooltip. + * @param {{silent: {boolean}}} [options] - options for hiding tooltip + * @private + */ + _hideTooltip: function(options) { + this.eventBus.fire('hideTooltip', this.prevFoundData, options); + this.prevFoundData = null; + }, + + /** + * On mousemove. + * @param {MouseEvent} e - mouse event + * @private + * @override + */ + _onMousemove: function(e) { + var dragMoseupResult, foundData; + + this._setPrevClientPosition(e); + + foundData = this._findData(e.clientX, e.clientY); + + if (this.zoomable) { + dragMoseupResult = this._isAfterDragMouseup(); + } + + if (dragMoseupResult || !this._isChangedSelectData(this.prevFoundData, foundData)) { + return; + } + + if (foundData) { + this._showTooltip(foundData); + } else if (this.prevFoundData) { + this._hideTooltip(); + } + + this.prevFoundData = foundData; + }, + + /** + * On mouseout. + * @private + * @override + */ + _onMouseout: function() { + if (this.prevFoundData) { + this._hideTooltip(); + } + + this.prevClientPosition = null; + this.prevFoundData = null; + }, + + /** + * find data by indexes + * @param {{index: {number}, seriesIndex: {number}}} indexes - indexe of series item displaying a tooltip + * @returns {object} - series item data + */ + findDataByIndexes: function(indexes) { + return this.dataModel.findDataByIndexes(indexes); + }, + + /** + * Set prevClientPosition by MouseEvent + * @param {?MouseEvent} event - mouse event + */ + _setPrevClientPosition: function(event) { + if (!event) { + this.prevClientPosition = null; + } else { + this.prevClientPosition = { + x: event.clientX, + y: event.clientY + }; + } + } + }); + + function areaTypeEventDetectorFactory(params) { + return new AreaTypeEventDetector(params); + } + + areaTypeEventDetectorFactory.componentType = 'mouseEventDetector'; + + module.exports = areaTypeEventDetectorFactory; + + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Mixer for zoom event of area type mouse event detector. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var MouseEventDetectorBase = __webpack_require__(70); + var chartConst = __webpack_require__(8); + var dom = __webpack_require__(9); + var renderUtil = __webpack_require__(7); + var eventListener = __webpack_require__(55); + var snippet = __webpack_require__(6); + + /** + * Mixer for zoom event of area type mouse event detector. + * @mixin + * @private */ + var zoomMixer = { + /** + * Initialize for zoom. + * @param {boolean} zoomable - whether zoomable or not + * @private + */ + _initForZoom: function(zoomable) { + /** + * whether zoomable or not + * @type {boolean} + */ + this.zoomable = zoomable; + + /** + * drag start index. + * @type {null | object} + */ + this.dragStartIndexes = null; + + /** + * start client position(clientX, clientY) of mouse event. + * @type {null | {x: number, y: number}} + */ + this.startClientPosition = null; + + /** + * start layerX position + * @type {null | number} + */ + this.startLayerX = null; + + /** + * drag selection element + * @type {null | HTMLElement} + */ + this.dragSelectionElement = null; + + /** + * container bound + * @type {null | {left: number, right: number, top: number}} + */ + this.containerBound = null; + + /** + * whether show tooltip after zoom or not. + * @type {boolean} + */ + this.isShowTooltipAfterZoom = false; + + /** + * whether after mouseup or not. + * @type {boolean} + */ + this.afterMouseup = false; + + /** + * previouse distance of range + * @type {null | number} + */ + this.prevDistanceOfRange = null; + + /** + * whether reverse move or not. + * @type {null | number} + */ + this.reverseMove = null; + + /** + * reset zoom button element. + * @type {null | HTMLElement} + */ + this.resetZoomBtn = null; + }, + + /** + * Show tooltip after zoom. + * @private + */ + _showTooltipAfterZoom: function() { + var isShowTooltipAfterZoom = this.isShowTooltipAfterZoom; + var lastDataBeforeZoom; + + this.isShowTooltipAfterZoom = false; + + if (!isShowTooltipAfterZoom || !this.dragStartIndexes) { + return; + } + + if (this.reverseMove) { + lastDataBeforeZoom = this._getFirstData(this.dragStartIndexes.index); + } else { + lastDataBeforeZoom = this._getLastData(this.dragEndIndexes.index); + } + + if (lastDataBeforeZoom) { + this._showTooltip(lastDataBeforeZoom); + } + }, + + /** + * Update dimension for drag selection element. + * @param {HTMLElement} selectionElement - drag selection element + * @private + */ + _updateDimensionForDragSelection: function(selectionElement) { + renderUtil.renderDimension(selectionElement, { + height: this.layout.dimension.height + }); + }, + + /** + * Render drag selection. + * @returns {HTMLElement} + * @private + */ + _renderDragSelection: function() { + var selectionElement = dom.create('DIV', 'tui-chart-drag-selection'); + + this._updateDimensionForDragSelection(selectionElement); + + return selectionElement; + }, + + /** + * Render. + * @param {object} data - data for rendering + * @returns {HTMLElement} + * @override + */ + render: function(data) { + var container = MouseEventDetectorBase.prototype.render.call(this, data); + var selectionElement = this._renderDragSelection(); + + dom.append(container, selectionElement); + this.dragSelectionElement = selectionElement; + + return container; + }, + + /** + * Resize. + * @param {{tickCount: number}} data - data for resizing + * @override + */ + resize: function(data) { + this.containerBound = null; + MouseEventDetectorBase.prototype.resize.call(this, data); + this._updateDimensionForDragSelection(this.dragSelectionElement); + }, + + /** + * On click + * @private + * @override + */ + _onClick: function() {}, + + /** + * Whether after drag mouseup or not. + * @returns {boolean} + * @private + */ + _isAfterDragMouseup: function() { + var afterMouseup = this.afterMouseup; + + if (afterMouseup) { + this.afterMouseup = false; + } + + return afterMouseup; + }, + + /** + * Bind drag event for zoom. + * @param {HTMLElement} target - target element + * @private + */ + _bindDragEvent: function(target) { + if (target.setCapture) { + target.setCapture(); + } + + eventListener.on(document, 'mousemove', this._onDrag, this); + eventListener.off(this.mouseEventDetectorContainer, 'mouseup', this._onMouseup, this); + eventListener.on(document, 'mouseup', this._onMouseupAfterDrag, this); + }, + + /** + * Unbind drag event for zoom. + * @private + */ + _unbindDragEvent: function() { + if (this.downTarget && this.downTarget.releaseCapture) { + this.downTarget.releaseCapture(); + } + + eventListener.off(document, 'mousemove', this._onDrag, this); + eventListener.off(document, 'mouseup', this._onMouseupAfterDrag, this); + eventListener.on(this.mouseEventDetectorContainer, 'mouseup', this._onMouseup, this); + }, + + /** + * On mouse down. + * @param {MouseEvent} e - mouse event + * @private + * @override + */ + _onMousedown: function(e) { + var target; + + if (!this.zoomable) { + return; + } + + target = e.target || e.srcElement; + + this.startClientPosition = { + x: e.clientX, + y: e.clientY + }; + this.startLayerX = this._calculateLayerPosition(e.clientX).x; + this.downTarget = target; + + this._bindDragEvent(target); + }, + + /** + * Show drag selection. + * @param {number} clientX - clientX + * @private + */ + _showDragSelection: function(clientX) { + var layerX = this._calculateLayerPosition(clientX).x; + var left = Math.min(layerX, this.startLayerX) - this.layout.position.left; + var width = Math.abs(layerX - this.startLayerX); + var element = this.dragSelectionElement; + + element.style.left = left + 'px'; + element.style.width = width + 'px'; + + dom.addClass(element, 'show'); + }, + + /** + * Hide drag selection. + * @private + */ + _hideDragSelection: function() { + dom.removeClass(this.dragSelectionElement, 'show'); + }, + + /** + * On mouse drag. + * @param {MouseEvent} e - mouse event + * @private + */ + _onDrag: function(e) { + var clientPos = this.startClientPosition; + var target = e.target || e.srcElement; + var dataForZoomable; + + if (clientPos) { + dataForZoomable = this._findDataForZoomable(clientPos.x, clientPos.y); + + if (!dom.hasClass(target, chartConst.CLASS_NAME_RESET_ZOOM_BTN)) { + if (snippet.isNull(this.dragStartIndexes)) { + this.dragStartIndexes = dataForZoomable ? dataForZoomable.indexes : {}; + } else { + this._showDragSelection(e.clientX); + } + } + } + }, + + /** + * Adjust index range for ensure three indexes. + * @param {number} startIndex - start index + * @param {number} endIndex - end index + * @returns {Array.} + * @private + */ + _adjustIndexRange: function(startIndex, endIndex) { + var indexRange = [startIndex, endIndex].sort(function(a, b) { + return a - b; + }); + var distanceOfRange = indexRange[1] - indexRange[0]; + + if (distanceOfRange === 0) { + if (indexRange[0] === 0) { + indexRange[1] += 2; + } else { + indexRange[0] -= 1; + indexRange[1] += 1; + } + } else if (distanceOfRange === 1) { + if (indexRange[0] === 0) { + indexRange[1] += 1; + } else { + indexRange[0] -= 1; + } + } + + return indexRange; + }, + + /** + * Fire zoom mouse event detector. + * @param {number} startIndex - start index + * @param {number} endIndex - end index + * @private + */ + _fireZoom: function(startIndex, endIndex) { + var reverseMove = startIndex > endIndex; + var indexRange = this._adjustIndexRange(startIndex, endIndex); + var distanceOfRange = indexRange[1] - indexRange[0]; + + if (this.prevDistanceOfRange === distanceOfRange) { + return; + } + + this.prevDistanceOfRange = distanceOfRange; + this.reverseMove = reverseMove; + this.eventBus.fire('zoom', indexRange); + }, + + /** + * Set flag about whether show tooltip after zoom or not. + * @param {number} clientX - clientX of mouse event + * @param {number} clientY - clientY of mouse event + * @private + */ + _setIsShowTooltipAfterZoomFlag: function(clientX, clientY) { + var layerX = this._calculateLayerPosition(clientX, clientY, false).x; + var limitLayerX = this._calculateLayerPosition(clientX, clientY).x; + + this.isShowTooltipAfterZoom = (layerX === limitLayerX); + }, + + /** + * On mouseup after drag event. + * @param {MouseEvent} e - mouse event + * @private + */ + _onMouseupAfterDrag: function(e) { + // @TODO: define zoomable policy, when there is no data + // To find dragEndIndex for zoom, data should not be null. + // To avoid zooming avoid zooming with no data, check dragStartIndexes first + // Becault chart without data returns invalid dragStartIndexes + var foundedDragEndData = this._findDataForZoomable(e.clientX, e.clientY); + var target; + + this._unbindDragEvent(); + + if (snippet.isNull(this.dragStartIndexes)) { + target = e.target || e.srcElement; + if (dom.hasClass(target, chartConst.CLASS_NAME_RESET_ZOOM_BTN)) { + this._hideTooltip(); + this.prevDistanceOfRange = null; + this.eventBus.fire('resetZoom'); + } else { + MouseEventDetectorBase.prototype._onClick.call(this, e); + } + } else if (this.dragStartIndexes && foundedDragEndData) { + this.dragEndIndexes = foundedDragEndData.indexes; + this._setIsShowTooltipAfterZoomFlag(e.clientX, e.clientY); + this._hideDragSelection(); + this._fireZoom(this.dragStartIndexes.groupIndex, this.dragEndIndexes.groupIndex); + } else { + this._setIsShowTooltipAfterZoomFlag(e.clientX, e.clientY); + this._hideDragSelection(); + } + + this.startClientPosition = null; + this.dragStartIndexes = null; + this.startLayerX = null; + this.afterMouseup = true; + }, + + /** + * Render reset zoom button element. + * @returns {HTMLElement} + * @private + */ + _renderResetZoomBtn: function() { + var resetBtn = dom.create('DIV', chartConst.CLASS_NAME_RESET_ZOOM_BTN); + resetBtn.innerHTML = 'Reset Zoom'; + + return resetBtn; + }, + + /** + * Zoom. + * @param {object} data - data for rendering + */ + zoom: function(data) { + this.prevFoundData = null; + this.rerender(data); + this._updateDimensionForDragSelection(this.dragSelectionElement); + + if (!this.resetZoomBtn) { + this.resetZoomBtn = this._renderResetZoomBtn(); + dom.append(this.mouseEventDetectorContainer, this.resetZoomBtn); + } else if (data.isResetZoom) { + this.mouseEventDetectorContainer.removeChild(this.resetZoomBtn); + this.resetZoomBtn = null; + } + } + }; + + module.exports = zoomMixer; + + +/***/ }), +/* 76 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview AreaTypeDataModel is data model for mouse event detector of area type. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var predicate = __webpack_require__(11); + var arrayUtil = __webpack_require__(10); + var snippet = __webpack_require__(6); + + var concat = Array.prototype.concat; + + var AreaTypeDataModel = snippet.defineClass(/** @lends AreaTypeDataModel.prototype */ { + /** + * AreaTypeDataModel is data mode for mouse event detector of area type. + * @constructs AreaTypeDataModel + * @private + * @param {Array} seriesItemBoundsData - series item bounds data + */ + init: function(seriesItemBoundsData) { + this.data = this._makeData(seriesItemBoundsData); + + /** + * last group index + * @type {number} + */ + this.lastGroupIndex = 0; + }, + + /** + * Make data for detecting mouse event. + * @param {Array} seriesItemBoundsData - series item bounds data + * @returns {Array} + * @private + */ + _makeData: function(seriesItemBoundsData) { + var lastGroupIndex = 0; + var seriesItemBoundsLength = seriesItemBoundsData.length; + var data = snippet.map(seriesItemBoundsData, function(seriesDatum, seriesIndex) { + var groupPositions = seriesDatum.data.groupPositions || seriesDatum.data.groupBounds; + var chartType = seriesDatum.chartType; + + if (predicate.isLineTypeChart(chartType) || predicate.isRadialChart(chartType)) { + groupPositions = arrayUtil.pivot(groupPositions); + } + + lastGroupIndex = Math.max(groupPositions.length - 1, lastGroupIndex); + + return snippet.map(groupPositions, function(positions, groupIndex) { + return snippet.map(positions, function(position, index) { + var datum = null; + + if (position) { + datum = { + chartType: chartType, + indexes: { + groupIndex: groupIndex, + index: index + }, + bound: position + }; + } + + // Add legendIndex to datum on making multi series chart data, especially for LineScatterComboChart. + if (seriesItemBoundsLength > 1) { + datum.indexes.legendIndex = seriesIndex; + } + + return datum; + }); + }); + }); + + data = concat.apply([], data); + this.lastGroupIndex = lastGroupIndex; + + return snippet.filter(concat.apply([], data), function(datum) { + return !!datum; + }); + }, + + /** + * Find Data by layer position. + * @param {{x: number, y: number}} layerPosition - layer position + * @param {number} [distanceLimit] distance limitation to find data + * @param {?number} selectLegendIndex select legend sereis index + * @returns {object} + */ + findData: function(layerPosition, distanceLimit, selectLegendIndex) { + var min = 100000; + var findFoundMap = {}; + var findFound; + + distanceLimit = distanceLimit || Number.MAX_VALUE; + snippet.forEach(this.data, function(datum) { + var xDiff = layerPosition.x - datum.bound.left; + var yDiff = layerPosition.y - datum.bound.top; + var distance = Math.sqrt(Math.pow(xDiff, 2) + Math.pow(yDiff, 2)); + + if (distance < distanceLimit && distance <= min) { + min = distance; + findFound = datum; + findFoundMap[datum.indexes.index] = datum; + } + }); + + if (!snippet.isNull(selectLegendIndex) && findFoundMap[selectLegendIndex]) { + findFound = findFoundMap[selectLegendIndex]; + } + + return findFound; + }, + + /** + * Find data by indexes. + * @param {{index: {number}, seriesIndex: {number}}} indexes - indexe of series item displaying a tooltip + * @returns {object} + */ + findDataByIndexes: function(indexes) { + var foundData = null; + + snippet.forEachArray(this.data, function(datum) { + if (datum.indexes.groupIndex === indexes.index && datum.indexes.index === indexes.seriesIndex) { + foundData = datum; + } + + return !foundData; + }); + + return foundData; + }, + + /** + * Get first data. + * @param {number} index - index + * @returns {object} + */ + getFirstData: function(index) { + var indexes = { + index: 0, + seriesIndex: index + }; + + return this.findDataByIndexes(indexes); + }, + + /** + * Get last data. + * @param {number} index - index + * @returns {object} + */ + getLastData: function(index) { + var indexes = { + index: this.lastGroupIndex, + seriesIndex: index + }; + + return this.findDataByIndexes(indexes); + } + }); + + module.exports = AreaTypeDataModel; + + +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview SimpleEventDetector is event handle layer for simply sending clientX, clientY. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var MouseEventDetectorBase = __webpack_require__(70); + var renderUtil = __webpack_require__(7); + var snippet = __webpack_require__(6); + + var SimpleEventDetector = snippet.defineClass(MouseEventDetectorBase, /** @lends SimpleEventDetector.prototype */ { + /** + * SimpleEventDetector is event handle layer for simply sending clientX, clientY. + * @constructs SimpleEventDetector + * @private + * @param {object} params parameters + * @param {string} params.chartType - chart type + * @extends MouseEventDetectorBase + */ + init: function(params) { + /** + * chart type + * @type {string} + */ + this.chartType = params.chartType; + + this.drawingType = chartConst.COMPONENT_TYPE_DOM; + + /** + * event bus for transmitting message + * @type {object} + */ + this.eventBus = params.eventBus; + }, + + /** + * Render mouse event detector area + * @param {HTMLElement} mouseEventDetectorContainer - container element for mouse event detector + * @private + */ + _renderMouseEventDetectorArea: function(mouseEventDetectorContainer) { + renderUtil.renderDimension(mouseEventDetectorContainer, this.layout.dimension); + renderUtil.renderPosition(mouseEventDetectorContainer, this.layout.position); + }, + + /** + * Initialize data of mouse event detector + * @override + */ + onReceiveSeriesData: function() {}, + + /** + * On click. + * @param {MouseEvent} e - mouse event + * @private + * @override + */ + _onClick: function(e) { + this._onMouseEvent('click', e); + }, + + /** + * On mouse move. + * @param {MouseEvent} e - mouse event + * @private + * @override + */ + _onMousemove: function(e) { + this._onMouseEvent('move', e); + }, + + /** + * On mouse out. + * @param {MouseEvent} e - mouse event + * @private + * @override + */ + _onMouseout: function(e) { + this._onMouseEvent('move', e); + } + }); + + function simpleTypeEventDetectorFactory(params) { + return new SimpleEventDetector(params); + } + + simpleTypeEventDetectorFactory.componentType = 'mouseEventDetector'; + + module.exports = simpleTypeEventDetectorFactory; + + +/***/ }), +/* 78 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview GroupTypeEventDetector is mouse event detector for grouped tooltip. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var EventDetectorBase = __webpack_require__(70); + var zoomMixer = __webpack_require__(75); + var snippet = __webpack_require__(6); + + var GroupTypeEventDetector = snippet.defineClass(EventDetectorBase, /** @lends GroupTypeEventDetector.prototype */ { + /** + * GroupTypeEventDetector is mouse event detector for grouped tooltip. + * @param {object} params parameters + * @constructs GroupTypeEventDetector + * @private + * @extends EventDetectorBase + */ + init: function(params) { + EventDetectorBase.call(this, params); + + /** + * previous index of group data + * @type {null} + */ + this.prevIndex = null; + + /** + * whether zoomable or not + * @type {boolean} + */ + this.zoomable = params.zoomable; + + /** + * type of size + * @type {string} + */ + this.sizeType = this.isVertical ? 'height' : 'width'; + + if (this.zoomable) { + snippet.extend(this, zoomMixer); + this._initForZoom(params.zoomable); + } + }, + + /** + * Initialize data of mouse event detector + * @param {Array.} seriesInfos series infos + * @override + */ + initMouseEventDetectorData: function(seriesInfos) { + EventDetectorBase.prototype.initMouseEventDetectorData.call(this, seriesInfos); + + if (this.zoomable) { + this._showTooltipAfterZoom(); + } + }, + + /** + * Find data by client position. + * @param {number} clientX - clientX + * @param {number} clientY - clientY + * @returns {object} + * @private + */ + _findGroupData: function(clientX, clientY) { + var layerPosition = this._calculateLayerPosition(clientX, clientY, true); + var pointValue; + + if (this.isVertical) { + pointValue = layerPosition.x; + } else { + pointValue = layerPosition.y; + } + + return { + indexes: { + groupIndex: this.tickBaseCoordinateModel.findIndex(pointValue) + } + }; + }, + + /** + * Find data by client position for zoomable + * @param {number} clientX - clientX + * @param {number} clientY - clientY + * @returns {object} + * @private + */ + _findDataForZoomable: function(clientX, clientY) { + return this._findGroupData(clientX, clientY); + }, + + /** + * Get first data. + * @returns {{indexes: {groupIndex: number}}} - data + * @private + */ + _getFirstData: function() { + return { + indexes: { + groupIndex: 0 + } + }; + }, + + /** + * Get last data. + * @returns {{indexes: {groupIndex: number}}} - data + * @private + */ + _getLastData: function() { + return { + indexes: { + groupIndex: this.tickBaseCoordinateModel.getLastIndex() + } + }; + }, + + /** + * Whether outer position or not. + * @param {number} layerX layerX + * @param {number} layerY layerY + * @returns {boolean} result boolean + * @private + */ + _isOuterPosition: function(layerX, layerY) { + var dimension = this.dimension; + var width = dimension.width; + var height = dimension.height; + var position = this.layout.position; + var top = position.top; + var left = position.left; + + return layerX < left || layerX > left + width || + layerY < top || layerY > top + height; + }, + + /** + * Show tooltip. + * @param {{indexes: {groupIndex: number}, silent: boolean}} foundData - data + * @param {boolean} [isMoving] - whether moving or not + * @private + */ + _showTooltip: function(foundData, isMoving) { + var index = foundData.indexes.groupIndex; + var positionValue = (this.isVertical ? this.layout.position.left : this.layout.position.top) + - chartConst.CHART_PADDING; + + /** + * Can be called with showTooltip function + * At this time, the index may be larger than the data size. + */ + if (this.tickBaseCoordinateModel.data.length > index) { + this.eventBus.fire('showTooltip', { + index: index, + range: this.tickBaseCoordinateModel.makeRange(index, positionValue), + size: this.dimension[this.sizeType], + isVertical: this.isVertical, + isMoving: isMoving, + silent: foundData.silent + }); + this.prevIndex = index; + } + }, + + /** + * Hide tooltip + * @param {{silent: {boolean}}} [options] - options for hiding tooltip + * @private + */ + _hideTooltip: function(options) { + this.eventBus.fire('hideTooltip', this.prevIndex, options); + this.prevIndex = null; + }, + + /** + * If found position data by client position, show tooltip. + * And if not found, call onMouseout function. + * @param {MouseEvent} e mouse event object + * @private + * @override + */ + _onMousemove: function(e) { + var foundData, index; + + if (this.zoomable && this._isAfterDragMouseup()) { + return; + } + + foundData = this._findGroupData(e.clientX, e.clientY); + + index = foundData.indexes.groupIndex; + + if (index === -1) { + this._onMouseout(e); + } else if (this.prevIndex !== index) { + this._showTooltip(foundData); + } + }, + + /** + * If mouse position gets out mouse event detector area, hide tooltip. + * @override + */ + _onMouseout: function(e) { + var layerPosition; + + layerPosition = this._calculateLayerPosition(e.clientX, e.clientY, false); + + if (this._isOuterPosition(layerPosition.x, layerPosition.y) && !snippet.isNull(this.prevIndex)) { + this._hideTooltip(); + } + } + }); + + function groupTypeEventDetectorFactory(params) { + return new GroupTypeEventDetector(params); + } + + groupTypeEventDetectorFactory.componentType = 'mouseEventDetector'; + + module.exports = groupTypeEventDetectorFactory; + + +/***/ }), +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview BoundsTypeEventDetector is mouse event detector for bounds type charts + * like bar, column, heatmap, treemap. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var EventDetectorBase = __webpack_require__(70); + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var dom = __webpack_require__(9); + var snippet = __webpack_require__(6); + + var BoundsTypeEventDetector = snippet.defineClass(EventDetectorBase, /** @lends BoundsTypeEventDetector.prototype */ { + /** + * BoundsTypeEventDetector is mouse event detector for bounds type charts like bar, column, heatmap, treemap. + * @constructs BoundsTypeEventDetector + * @private + * @extends EventDetectorBase + */ + init: function() { + EventDetectorBase.apply(this, arguments); + + /** + * previous found data + * @type {null | object} + */ + this.prevFoundData = null; + + /** + * history array for treemap chart. + * @type {array} + */ + this.zoomHistory = [-1]; + + /** + * button for zoom history back + * @type {null | HTMLElement} + */ + this.historyBackBtn = null; + }, + + /** + * Attach to event bus. + * @private + * @override + */ + _attachToEventBus: function() { + EventDetectorBase.prototype._attachToEventBus.call(this); + + this.eventBus.on('afterZoom', this.onAfterZoom, this); + }, + + /** + * Show tooltip. + * @param {object} foundData - model data + * @private + */ + _showTooltip: function(foundData) { + this.eventBus.fire('showTooltip', foundData); + this.prevFoundData = foundData; + }, + + /** + * Hide tooltip. + * @param {{silent: {boolean}}} [options] - options for hiding a tooltip + * @private + */ + _hideTooltip: function(options) { + this.eventBus.fire('hideTooltip', this.prevFoundData, options); + this.prevFoundData = null; + this.styleCursor(false); + }, + + /** + * Style css cursor. + * @param {boolean} hasChild - whether has child or not + */ + styleCursor: function(hasChild) { + var container = this.mouseEventDetectorContainer; + if (hasChild) { + container.style.cursor = 'pointer'; + } else { + container.style.cursor = 'default'; + } + }, + + /** + * On mousemove. + * @param {MouseEvent} e - mouse event + * @private + * @override + */ + _onMousemove: function(e) { + var clientX = e.clientX; + var clientY = e.clientY; + var layerPosition = this._calculateLayerPosition(clientX, clientY); + var foundData = this._findDataFromBoundsCoordinateModel(layerPosition); + var seriesItem; + + if (!this._isChangedSelectData(this.prevFoundData, foundData)) { + return; + } + + if (this.prevFoundData) { + this._hideTooltip(); + } + + this.prevFoundData = foundData; + + if (!foundData) { + return; + } + + if (predicate.isTreemapChart(this.chartType)) { + seriesItem = this._getSeriesItemByIndexes(foundData.indexes); + this.styleCursor(seriesItem.hasChild); + } else if (predicate.isBulletChart(this.chartType)) { + foundData.mousePosition = { + left: clientX, + top: clientY + }; + } + this._showTooltip(foundData); + }, + + /** + * Zoom history back. + * @private + */ + _zoomHistoryBack: function() { + var index = this.zoomHistory[this.zoomHistory.length - 2]; + + this.zoomHistory.pop(); + this.eventBus.fire('zoom', index); + + if (this.zoomHistory.length === 1) { + this.mouseEventDetectorContainer.removeChild(this.historyBackBtn); + this.historyBackBtn = null; + } + }, + + /** + * Get seriesItem by indexes + * @param {{groupIndex: number, index: number}} indexes - indexes + * @returns {SeriesItem} + * @private + */ + _getSeriesItemByIndexes: function(indexes) { + var seriesDataModel = this.dataProcessor.getSeriesDataModel(chartConst.CHART_TYPE_TREEMAP); + + return seriesDataModel.getSeriesItem(indexes.groupIndex, indexes.index, true); + }, + + /** + * On mousemove. + * @param {MouseEvent} e - mouse event + * @private + * @override + */ + _onClick: function(e) { + var target = e.target || e.srcElement; + var layerPosition, foundData, seriesItem; + + EventDetectorBase.prototype._onClick.call(this, e); + + if (!predicate.isTreemapChart(this.chartType)) { + return; + } + + if (dom.hasClass(target, chartConst.CLASS_NAME_RESET_ZOOM_BTN)) { + this._hideTooltip(); + this._zoomHistoryBack(); + + return; + } + + layerPosition = this._calculateLayerPosition(e.clientX, e.clientY); + foundData = this._findDataFromBoundsCoordinateModel(layerPosition); + + if (foundData) { + seriesItem = this._getSeriesItemByIndexes(foundData.indexes); + + if (!seriesItem.hasChild) { + return; + } + + this._hideTooltip(); + this.eventBus.fire('zoom', foundData.indexes.index); + } + }, + + /** + * On mouseout. + * @override + */ + _onMouseout: function(e) { + // do not cache getBoundingClientRect() - if not, it will cause error when chart location changed + var bound = this.mouseEventDetectorContainer.getBoundingClientRect(); + var clientX = e.clientX; + var clientY = e.clientY; + + if ((bound.left <= clientX) && (bound.top <= clientY) && + (bound.right >= clientX) && (bound.bottom >= clientY)) { + return; + } + + if (this.prevFoundData) { + this._hideTooltip(); + } + + this.prevFoundData = null; + }, + + /** + * On after zoom. + * @param {number} index - index of target seriesItem + */ + onAfterZoom: function(index) { + if (!this.historyBackBtn) { + this.historyBackBtn = dom.create('DIV', chartConst.CLASS_NAME_RESET_ZOOM_BTN); + this.historyBackBtn.innerHTML = '< Back'; + dom.append(this.mouseEventDetectorContainer, this.historyBackBtn); + } + + if (this.zoomHistory[this.zoomHistory.length - 1] !== index) { + this.zoomHistory.push(index); + } + }, + + /** + * Find data by indexes. + * @param {{index: {number}, seriesIndex: {number}}} indexes - indexe of series item displaying a tooltip + * @param {number} [indexes.outlierIndex] - index of outlier of boxplot series, it only exists in boxplot chart + * @returns {object} - series item data + */ + findDataByIndexes: function(indexes) { + return this.boundsBaseCoordinateModel.findDataByIndexes(indexes); + } + }); + + function boundsTypeEventDetectorFactory(params) { + return new BoundsTypeEventDetector(params); + } + + boundsTypeEventDetectorFactory.componentType = 'mouseEventDetector'; + + module.exports = boundsTypeEventDetectorFactory; + + +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Bar chart series component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var Series = __webpack_require__(81); + var BarTypeSeriesBase = __webpack_require__(82); + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var snippet = __webpack_require__(6); + + var BarChartSeries = snippet.defineClass(Series, /** @lends BarChartSeries.prototype */ { + /** + * Bar chart series component. + * @constructs BarChartSeries + * @private + * @extends Series + * @param {object} params parameters + * @param {object} params.model series model + * @param {object} params.options series options + * @param {object} params.theme series theme + */ + init: function() { + Series.apply(this, arguments); + }, + + /** + * Make bound of bar chart. + * @param {number} width width + * @param {number} height height + * @param {number} top top position value + * @param {number} startLeft start left position value + * @param {number} endLeft end left position value + * @returns {{ + * start: {left: number, top: number, width: number, height: number}, + * end: {left: number, top: number, width: number, height: number} + * }} column chart bound + * @private + */ + _makeBound: function(width, height, top, startLeft, endLeft) { + return { + start: { + top: top, + left: startLeft, + width: 0, + height: height + }, + end: { + top: top, + left: endLeft, + width: width, + height: height + } + }; + }, + + /** + * Calculate additional left for divided option. + * @param {number} value value + * @returns {number} + * @private + */ + _calculateAdditionalLeft: function(value) { + var additionalLeft = 0; + + if (this.options.divided && value > 0) { + additionalLeft = this.dimensionMap.yAxis.width + chartConst.OVERLAPPING_WIDTH; + } + + return additionalLeft; + }, + + /** + * Make bar chart bound. + * @param {{ + * baseBarSize: number, + * groupSize: number, + * barSize: number, + * pointInterval: number, + * firstAdditionalPosition: number, + * basePosition: number + * }} baseData base data for making bound + * @param {{ + * baseTop: number, + * top: number, + * plusLeft: number, + * minusLeft: number, + * prevStack: ?string + * }} iterationData iteration data + * @param {?boolean} isStackType whether stackType option or not. + * @param {SeriesItem} seriesItem series item + * @param {number} index index + * @returns {{ + * start: {left: number, top: number, width: number, height: number}, + * end: {left: number, top: number, width: number, height: number} + * }} + * @private + */ + _makeBarChartBound: function(baseData, iterationData, isStackType, seriesItem, index) { + var barWidth = baseData.baseBarSize * seriesItem.ratioDistance; + var additionalLeft = this._calculateAdditionalLeft(seriesItem.value); + var barStartLeft = baseData.baseBarSize * seriesItem.startRatio; + var startLeft = baseData.basePosition + barStartLeft + additionalLeft; + var changedStack = (seriesItem.stack !== iterationData.prevStack); + var pointCount, endLeft, bound, boundTop; + + if (!isStackType || (!this.options.diverging && changedStack)) { + pointCount = isStackType ? this.dataProcessor.findStackIndex(seriesItem.stack) : index; + iterationData.top = iterationData.baseTop + (baseData.pointInterval * pointCount); + iterationData.plusLeft = 0; + iterationData.minusLeft = 0; + } + + if (seriesItem.value >= 0) { + endLeft = startLeft + iterationData.plusLeft; + iterationData.plusLeft += barWidth; + } else { + iterationData.minusLeft -= barWidth; + endLeft = startLeft + iterationData.minusLeft; + } + + iterationData.prevStack = seriesItem.stack; + boundTop = iterationData.top + baseData.pointInterval - (baseData.barSize / 2); + bound = this._makeBound(barWidth, baseData.barSize, boundTop, startLeft, endLeft); + + return bound; + }, + + /** + * Make series bounds for rendering + * @returns {Array.>} bounds + * @private + */ + _makeBounds: function() { + var self = this; + var seriesDataModel = this._getSeriesDataModel(); + var isStacked = predicate.isValidStackOption(this.options.stackType); + var dimension = this.layout.dimension; + var baseData = this._makeBaseDataForMakingBound(dimension.height, dimension.width); + + return seriesDataModel.map(function(seriesGroup, groupIndex) { + var baseTop = (groupIndex * baseData.groupSize) + self.layout.position.top; + var iterationData = { + baseTop: baseTop, + top: baseTop, + plusLeft: 0, + minusLeft: 0, + prevStack: null + }; + var iteratee = snippet.bind(self._makeBarChartBound, self, baseData, iterationData, isStacked); + + return seriesGroup.map(iteratee); + }); + }, + + /** + * Calculate top position of sum label. + * @param {{left: number, top: number}} bound bound + * @param {number} labelHeight label height + * @returns {number} top position value + * @private + */ + _calculateTopPositionOfSumLabel: function(bound, labelHeight) { + return bound.top + ((bound.height - labelHeight + chartConst.TEXT_PADDING) / 2); + } + }); + + BarTypeSeriesBase.mixin(BarChartSeries); + + function barSeriesFactory(params) { + var libType = params.chartOptions.libType; + var chartTheme = params.chartTheme; + + params.libType = libType; + params.chartType = 'bar'; + params.chartBackground = chartTheme.chart.background; + + return new BarChartSeries(params); + } + + // @todo let's find better way + barSeriesFactory.componentType = 'series'; + barSeriesFactory.BarChartSeries = BarChartSeries; + + module.exports = barSeriesFactory; + + +/***/ }), +/* 81 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Series base component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + + var LABEL_FADE_IN_DURATION = 600; + var browser = snippet.browser; + var IS_IE7 = browser.msie && browser.version === 7; + + var chartConst = __webpack_require__(8); + var dom = __webpack_require__(9); + var predicate = __webpack_require__(11); + var renderUtil = __webpack_require__(7); + var pluginFactory = __webpack_require__(32); + var raphaelRenderUtil = __webpack_require__(5); + + var Series = snippet.defineClass(/** @lends Series.prototype */ { + /** + * Series component className + * @type {string} + */ + className: 'tui-chart-series-area', + /** + * Series base component. + * @constructs Series + * @private + * @param {object} params parameters + * @param {object} params.options series options + * @param {object} params.theme series theme + */ + init: function(params) { + var libType = params.libType; + + /** + * Chart type + * @type {string} + */ + this.chartType = params.chartType; + + /** + * Series name + * @tpye {string} + */ + this.seriesType = params.seriesType || params.chartType; + + /** + * Component type + * @type {string} + */ + this.componentType = params.componentType; + + /** + * Data processor + * @type {DataProcessor} + */ + this.dataProcessor = params.dataProcessor; + + /** + * event bus for transmitting message + * @type {object} + */ + this.eventBus = params.eventBus; + + /** + * chart background. + * @type {string} + */ + this.chartBackground = params.chartBackground; + + /** + * Options + * @type {object} + */ + this.options = params.options || {}; + + /** + * Theme + * @type {object} + */ + + this.orgTheme = this.theme = params.theme; + + /** + * Graph renderer + * @type {object} + */ + this.graphRenderer = pluginFactory.get(libType, params.chartType); + + /** + * series container + * @type {HTMLElement} + */ + this.seriesContainer = null; + + /** + * series label container + * @type {HTMLElement} + */ + this.seriesLabelContainer = null; + + /** + * series data + * @type {Array.} + */ + this.seriesData = []; + + /** + * Selected legend index + * @type {?number} + */ + this.selectedLegendIndex = null; + + /** + * effector for show layer + * @type {object} + */ + this.labelShowEffector = null; + + /** + * raphael object + * @type {null|object} + */ + this.paper = null; + + /** + * limit(min, max) data for series + * @type {null|{min:number, max:number}} + */ + this.limit = null; + + /** + * aligned + * @type {null|boolean} + */ + this.aligned = null; + + /** + * layout bounds information for this components + * @type {null|{dimension:{width:number, height:number}, position:{left:number, top:number}}} + */ + this.layout = null; + + /** + * dimension map for layout of chart + * @type {null|object} + */ + this.dimensionMap = null; + + /** + * position map for layout of chart + * @type {null|object} + */ + this.positionMap = null; + + /** + * axis data map + * @type {null|object} + */ + this.axisDataMap = null; + + /** + * before axis data map + * @type {null|object} + */ + this.beforeAxisDataMap = null; + + /** + * Drawing type + * @type {string} + */ + this.drawingType = chartConst.COMPONENT_TYPE_RAPHAEL; + + /** + * whether series lable is supported + * @type {boolean} + */ + this.supportSeriesLable = true; + + this._attachToEventBus(); + }, + + /** + * Attach to event bus. + * @private + */ + _attachToEventBus: function() { + var firstRenderCheck = snippet.bind(function() { + this.isInitRenderCompleted = true; + this.eventBus.off('load', firstRenderCheck); + }, this); + + this.eventBus.on(chartConst.PUBLIC_EVENT_PREFIX + 'load', firstRenderCheck); + + this.eventBus.on({ + selectLegend: this.onSelectLegend, + selectSeries: this.onSelectSeries, + unselectSeries: this.onUnselectSeries, + hoverSeries: this.onHoverSeries, + hoverOffSeries: this.onHoverOffSeries, + showGroupAnimation: this.onShowGroupAnimation, + hideGroupAnimation: this.onHideGroupAnimation + }, this); + + if (this.onShowTooltip) { + this.eventBus.on('showTooltip', this.onShowTooltip, this); + } + + if (this.onShowGroupTooltipLine) { + this.eventBus.on({ + showGroupTooltipLine: this.onShowGroupTooltipLine, + hideGroupTooltipLine: this.onHideGroupTooltipLine + }, this); + } + + if (this.onClickSeries) { + this.eventBus.on({ + clickSeries: this.onClickSeries, + moveSeries: this.onMoveSeries + }, this); + } + }, + + /** + * Get seriesDataModel. + * @returns {SeriesDataModel} + * @private + */ + _getSeriesDataModel: function() { + return this.dataProcessor.getSeriesDataModel(this.seriesType); + }, + + /** + * Make series data. + * @private + * @abstract + */ + _makeSeriesData: function() {}, + + /** + * Get seriesData + * @returns {object} series data + */ + getSeriesData: function() { + return this.seriesData; + }, + + /** + * Render series label. + * @private + * @abstract + */ + _renderSeriesLabel: function() {}, + + /** + * Render series label area + * @param {object} paper series label area element + * @returns {Array.} + * @private + */ + _renderSeriesLabelArea: function(paper) { + return this._renderSeriesLabel(paper); + }, + + /** + * Send boudns to mouseEventDetector component. + * @param {object} seriesData - series data + * @private + */ + _sendBoundsToMouseEventDetector: function(seriesData) { + this.eventBus.fire('receiveSeriesData', { + chartType: this.chartType, + data: seriesData + }); + }, + + /** + * Render series area. + * @param {object} paper - raphael object + * @param {function} funcRenderGraph - function for graph rendering + * @private + */ + _renderSeriesArea: function(paper, funcRenderGraph) { + var dimension, seriesData; + + dimension = this.dimensionMap.extendedSeries; + + this.seriesData = seriesData = this._makeSeriesData(); + + this._sendBoundsToMouseEventDetector(seriesData); + + if (this.hasDataForRendering(seriesData) || this.chartType === 'map') { + if (funcRenderGraph) { + this.seriesSet = funcRenderGraph(dimension, seriesData, paper); + } + + if (predicate.isShowLabel(this.options) && this.supportSeriesLable) { + this.labelSet = this._renderSeriesLabelArea(paper); + } + } + }, + + /** + * Make parameters for graph rendering. + * @param {{width: number, height: number}} dimension dimension + * @param {object} seriesData series data + * @returns {object} parameters for graph rendering + * @private + */ + _makeParamsForGraphRendering: function(dimension, seriesData) { + return snippet.extend({ + dimension: dimension, + position: this.layout.position, + chartType: this.seriesType, + theme: this.theme, + options: this.options + }, seriesData); + }, + + /** + * Render raphael graph. + * @param {{width: number, height: number}} dimension - dimension + * @param {object} seriesData - series data + * @param {object} [paper] - raphael paper + * @returns {object} + * @private + */ + _renderGraph: function(dimension, seriesData, paper) { + var params = this._makeParamsForGraphRendering(dimension, seriesData); + + return this.graphRenderer.render(paper, params); + }, + + /** + * Set data for rendering. + * @param {{ + * paper: ?object, + * limit: { + * min: number, + * max: number + * }, + * aligned: boolean, + * layout: { + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }, + * dimensionMap: object, + * positionMap: object, + * axisDataMap: object + * }} data - data for rendering + * @private + */ + _setDataForRendering: function(data) { + this.paper = data.paper; + this.limit = data.limitMap[this.chartType]; + if (data.axisDataMap && data.axisDataMap.xAxis) { + this.aligned = data.axisDataMap.xAxis.aligned; + } + this.layout = data.layout; + this.dimensionMap = data.dimensionMap; + this.positionMap = data.positionMap; + this.axisDataMap = data.axisDataMap; + }, + + /** + * Render series component. + * @param {object} data - data for rendering + */ + render: function(data) { + var checkedLegends; + this.paper = data.paper; + this._setDataForRendering(data); + this._clearSeriesContainer(); + this.beforeAxisDataMap = this.axisDataMap; + + if (data.checkedLegends) { + checkedLegends = data.checkedLegends[this.seriesType]; + if (!this.options.colorByPoint) { + this.theme = this._getCheckedSeriesTheme(this.orgTheme, checkedLegends); + } + } + + this._renderSeriesArea(data.paper, snippet.bind(this._renderGraph, this)); + + if (this.paper.pushDownBackgroundToBottom) { + this.paper.pushDownBackgroundToBottom(); + } + }, + + /** + * Get checked series theme. + * @param {object} theme legend theme + * @param {?Array.} checkedLegends checked legends + * @returns {object} checked series theme + * @private + */ + _getCheckedSeriesTheme: function(theme, checkedLegends) { + var cloneTheme; + + if (!checkedLegends.length) { + return theme; + } + + cloneTheme = JSON.parse(JSON.stringify(theme)); + cloneTheme.colors = snippet.filter(cloneTheme.colors, function(color, index) { + return checkedLegends[index]; + }); + + return cloneTheme; + }, + + /** + * Clear series container. + * @private + */ + _clearSeriesContainer: function() { + if (this.seriesSet && this.seriesSet.remove) { + this.seriesSet.forEach(function(series) { + series.remove(); + }, this); + this.seriesSet.remove(); + } + if (this.labelSet && this.labelSet.remove) { + this.labelSet.forEach(function(label) { + label.remove(); + }, this); + this.labelSet.remove(); + } + + this.seriesData = []; + }, + + /** + * Rerender series + * @param {object} data - data for rendering + */ + rerender: function(data) { + var checkedLegends; + + if (this.dataProcessor.getGroupCount(this.seriesType)) { + if (data.checkedLegends) { + checkedLegends = data.checkedLegends[this.seriesType]; + this.theme = this._getCheckedSeriesTheme(this.orgTheme, checkedLegends); + } + + this._setDataForRendering(data); + this._clearSeriesContainer(); + this._renderSeriesArea(data.paper, snippet.bind(this._renderGraph, this)); + + if (this.labelShowEffector) { + clearInterval(this.labelShowEffector.timerId); + } + + // if rerender have excuted in the middle of animate, + // we should rerun animate + if (checkedLegends || !this.isInitRenderCompleted) { + this.animateComponent(true); + } + + if (!snippet.isNull(this.selectedLegendIndex)) { + this.graphRenderer.selectLegend(this.selectedLegendIndex); + } + } + }, + + /** + * Return whether label visible or not. + * @returns {boolean} + * @private + */ + _isLabelVisible: function() { + return !!(this.options.showLabel || this.options.showLegend); + }, + + /** + * Resize raphael graph by given dimension and series data + * @param {{width: number, height: number}} dimension - chart dimension + * @param {object} seriesData - series data + * @returns {Array.} + * @private + */ + _resizeGraph: function(dimension, seriesData) { + this.graphRenderer.resize(snippet.extend({ + dimension: this.dimensionMap.chart + }, seriesData)); + + return this.seriesSet; + }, + + /** + * Resize series component. + * }} bound series bound + * @param {object} data data for rendering + */ + resize: function(data) { + this._clearSeriesContainer(); + this._setDataForRendering(data); + this._renderSeriesArea(data.paper, snippet.bind(this._resizeGraph, this)); + }, + + /** + * Set element's top, left given top, left position + * @param {HTMLElement} el - series element + * @param {{top: number, left: number}} position - series top, left position + * @private + */ + _renderPosition: function(el, position) { + var hiddenWidth = renderUtil.isOldBrowser() ? 1 : 0; + + renderUtil.renderPosition(el, { + top: position.top - (hiddenWidth), + left: position.left - (hiddenWidth * 2) + }); + }, + + /** + * Get limit distance from zero point. + * @param {number} size chart size (width or height) + * @param {{min: number, max: number}} limit limit + * @returns {{toMax: number, toMin: number}} pixel distance + * @private + */ + _getLimitDistanceFromZeroPoint: function(size, limit) { + var min = limit.min, + max = limit.max, + distance = max - min, + toMax = 0, + toMin = 0; + + if (min <= 0 && max >= 0) { + toMax = (distance + min) / distance * size; + toMin = (distance - max) / distance * size; + } else if (min > 0) { + toMax = size; + } + + return { + toMax: toMax, + toMin: toMin + }; + }, + + /** + * Find label element. + * @param {HTMLElement} elTarget target element + * @returns {HTMLElement} label element + * @private + */ + _findLabelElement: function(elTarget) { + var elLabel = null; + + if (dom.hasClass(elTarget, chartConst.CLASS_NAME_SERIES_LABEL)) { + elLabel = elTarget; + } else { + elLabel = dom.findParentByClass(elTarget, chartConst.CLASS_NAME_SERIES_LABEL); + } + + return elLabel; + }, + + /** + * To call showAnimation function of graphRenderer. + * @param {{groupIndex: number, index: number}} data data + * @param {string} chartType - chart type + */ + onHoverSeries: function(data, chartType) { + if (chartType !== this.chartType) { + return; + } + + if (!this.graphRenderer.showAnimation) { + return; + } + + this.graphRenderer.showAnimation(data); + }, + + /** + * To call hideAnimation function of graphRenderer. + * @param {{groupIndex: number, index: number}} data data + * @param {string} chartType - chart type + */ + onHoverOffSeries: function(data, chartType) { + if (chartType !== this.chartType) { + return; + } + + if (!this.graphRenderer.hideAnimation || !data) { + return; + } + + this.graphRenderer.hideAnimation(data); + }, + + /** + * To call showGroupAnimation function of graphRenderer. + * @param {number} index index + */ + onShowGroupAnimation: function(index) { + if (!this.graphRenderer.showGroupAnimation) { + return; + } + this.graphRenderer.showGroupAnimation(index); + }, + + /** + * To call hideGroupAnimation function of graphRenderer. + * @param {number} index index + */ + onHideGroupAnimation: function(index) { + if (!this.graphRenderer.hideGroupAnimation) { + return; + } + this.graphRenderer.hideGroupAnimation(index); + }, + + /** + * Animate component. + * @param {boolean} [isRerendering] - whether rerendering or not + */ + animateComponent: function(isRerendering) { + if (this.graphRenderer.animate && this.seriesSet) { + this.graphRenderer.animate(snippet.bind(this.animateSeriesLabelArea, this, isRerendering), this.seriesSet); + } else { + this.animateSeriesLabelArea(isRerendering); + } + }, + + /** + * Fire load event. + * @param {boolean} [isRerendering] - whether rerendering or not + * @private + */ + _fireLoadEvent: function(isRerendering) { + if (!isRerendering) { + this.eventBus.fire(chartConst.PUBLIC_EVENT_PREFIX + 'load'); + } + }, + + /** + * Animate series label area. + * @param {boolean} [isRerendering] - whether rerendering or not + */ + animateSeriesLabelArea: function(isRerendering) { + if (!this._isLabelVisible()) { + this._fireLoadEvent(isRerendering); + + return; + } + + if (IS_IE7) { + this._fireLoadEvent(isRerendering); + this.labelSet.attr({ + opacity: 1 + }); + } else if (this.labelSet && this.labelSet.length) { + raphaelRenderUtil.animateOpacity(this.labelSet, 0, 1, LABEL_FADE_IN_DURATION); + } + }, + + /** + * Make exportation data for public event of series type. + * @param {object} seriesData series data + * @returns {{chartType: string, legend: string, legendIndex: number, index: number}} export data + * @private + */ + _makeExportationSeriesData: function(seriesData) { + var indexes = seriesData.indexes; + var legendIndex = snippet.isExisty(indexes.legendIndex) ? indexes.legendIndex : indexes.index; + var legendData = this.dataProcessor.getLegendItem(legendIndex); + var index = snippet.isExisty(indexes.groupIndex) ? indexes.groupIndex : 0; + var seriesItem = this._getSeriesDataModel().getSeriesItem(index, indexes.index); + var result; + + if (snippet.isExisty(seriesItem)) { + result = { + chartType: legendData.chartType, + legend: legendData.label, + legendIndex: legendIndex + }; + result.index = seriesItem.index; + } + + return result; + }, + + /** + * Execute graph renderer. + * @param {{left: number, top: number}} position mouse position + * @param {string} funcName function name + * @returns {*} result. + * @private + */ + _executeGraphRenderer: function(position, funcName) { + var isShowLabel = false; + var result; + + this.eventBus.fire('hideTooltipContainer'); + if (this.seriesLabelContainer && dom.hasClass(this.seriesLabelContainer, 'show')) { + dom.removeClass(this.seriesLabelContainer, 'show'); + isShowLabel = true; + } + + result = this.graphRenderer[funcName](position); + + if (isShowLabel) { + dom.addClass(this.seriesLabelContainer, 'show'); + } + + this.eventBus.fire('showTooltipContainer'); + + return result; + }, + + /** + * To call selectSeries callback of public event. + * @param {object} seriesData - series data + * @param {?boolean} shouldSelect - whether should select or not + */ + onSelectSeries: function(seriesData, shouldSelect) { + var eventName; + + if (seriesData.chartType !== this.chartType) { + return; + } + + eventName = chartConst.PUBLIC_EVENT_PREFIX + 'selectSeries'; + + this.eventBus.fire(eventName, this._makeExportationSeriesData(seriesData)); + shouldSelect = snippet.isEmpty(shouldSelect) ? true : shouldSelect; + + if (this.options.allowSelect && this.graphRenderer.selectSeries && shouldSelect) { + this.graphRenderer.selectSeries(seriesData.indexes); + } + }, + + /** + * To call unselectSeries callback of public event. + * @param {object} seriesData series data. + */ + onUnselectSeries: function(seriesData) { + var eventName; + + if (seriesData.chartType !== this.chartType) { + return; + } + + eventName = chartConst.PUBLIC_EVENT_PREFIX + 'unselectSeries'; + + this.eventBus.fire(eventName, this._makeExportationSeriesData(seriesData)); + if (this.options.allowSelect && this.graphRenderer.unselectSeries) { + this.graphRenderer.unselectSeries(seriesData.indexes); + } + }, + + /** + *On select legend. + * @param {string} seriesType - series name + * @param {?number} legendIndex - legend index + */ + onSelectLegend: function(seriesType, legendIndex) { + if ((this.seriesType !== seriesType) && !snippet.isNull(legendIndex)) { + legendIndex = -1; + } + + this.selectedLegendIndex = legendIndex; + + if (this._getSeriesDataModel().getGroupCount()) { + this.graphRenderer.selectLegend(legendIndex); + } + }, + + /** + * Show label. + */ + showLabel: function() { + this.options.showLabel = true; + + if (!this.seriesLabelContainer && this.supportSeriesLable) { + this._renderSeriesLabelArea(this.paper); + } + }, + + /** + * Hide label. + */ + hideLabel: function() { + this.options.showLabel = false; + + if (this.seriesLabelContainer) { + dom.removeClass(this.seriesLabelContainer, 'show'); + dom.removeClass(this.seriesLabelContainer, 'opacity'); + } + }, + /** + * Return boolean value whether seriesData contains data + * @param {object} seriesData seriesData object + * @returns {boolean} + */ + hasDataForRendering: function(seriesData) { + return !!(seriesData && seriesData.isAvailable()); + } + }); + + module.exports = Series; + + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview BarTypeSeriesBase is base class for bar type series. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var labelHelper = __webpack_require__(83); + var predicate = __webpack_require__(11); + var calculator = __webpack_require__(45); + var renderUtil = __webpack_require__(7); + var raphaelRenderUtil = __webpack_require__(5); + var snippet = __webpack_require__(6); + + var DEFAULT_BAR_SIZE_RATIO_BY_POINT_INTERVAL = 0.8; + + var BarTypeSeriesBase = snippet.defineClass(/** @lends BarTypeSeriesBase.prototype */ { + /** + * Make series data. + * @returns {object} add data + * @private + * @override + */ + _makeSeriesData: function() { + var groupBounds = this._makeBounds(this.layout.dimension); + + this.groupBounds = groupBounds; + + return { + groupBounds: groupBounds, + seriesDataModel: this._getSeriesDataModel(), + isAvailable: function() { + return groupBounds && groupBounds.length > 0; + } + }; + }, + + /** + * Get bar width option size. + * @param {number} pointInterval point interval + * @param {number} [optionBarWidth] barWidth option + * @returns {number} option size + * @private + */ + _getBarWidthOptionSize: function(pointInterval, optionBarWidth) { + var optionsSize = 0; + + if (optionBarWidth) { + if ((optionBarWidth / 2) >= pointInterval) { + optionBarWidth = pointInterval * 2; + } else if (optionBarWidth < 0) { + optionBarWidth = 0; + } + optionsSize = optionBarWidth; + } + + return optionsSize; + }, + + /** + * Calculate difference between optionSize and barSize. + * @param {number} barSize bar size + * @param {number} optionSize option size + * @param {number} itemCount item count + * @returns {number} addition padding + * @private + */ + _calculateAdditionalPosition: function(barSize, optionSize, itemCount) { + var additionalPosition = 0; + + if (optionSize && optionSize < barSize) { + additionalPosition = (barSize / 2) + ((barSize - optionSize) * itemCount / 2); + } + + return additionalPosition; + }, + + /** + * Make base data for making bound. + * @param {number} baseGroupSize base group size + * @param {number} baseBarSize base bar size + * @returns {undefined|{ + * baseBarSize: number, + * groupSize: number, + * barSize: number, + * pointInterval: number, + * firstAdditionalPosition: number, + * basePosition: number + * }} + * @private + */ + _makeBaseDataForMakingBound: function(baseGroupSize, baseBarSize) { + var isStackType = predicate.isValidStackOption(this.options.stackType); + var seriesDataModel = this._getSeriesDataModel(); + var groupSize = baseGroupSize / seriesDataModel.getGroupCount(); + var columnTopOffset = -this.layout.position.top + chartConst.CHART_PADDING; + var positionValue, itemCount, barSize, optionSize, basePosition, pointInterval, baseBounds; + var zeroToMin = this._getLimitDistanceFromZeroPoint(baseBarSize, this.limit).toMin; + + if (predicate.isColumnChart(this.chartType)) { + positionValue = columnTopOffset; + } else if (predicate.isBoxplotChart(this.chartType)) { + positionValue = this.layout.position.top - chartConst.CHART_PADDING; + } else { + positionValue = this.layout.position.left; + } + + if (seriesDataModel.rawSeriesData.length > 0) { + if (!isStackType) { + itemCount = seriesDataModel.getFirstSeriesGroup().getSeriesItemCount(); + } else { + itemCount = this.options.diverging ? 1 : this.dataProcessor.getStackCount(this.seriesType); + } + + pointInterval = groupSize / (itemCount + 1); + barSize = pointInterval * DEFAULT_BAR_SIZE_RATIO_BY_POINT_INTERVAL; + optionSize = this.options.barWidth || this.options.pointWidth; + barSize = this._getBarWidthOptionSize(pointInterval, optionSize) || barSize; + basePosition = zeroToMin + positionValue; + + if (predicate.isColumnChart(this.chartType)) { + basePosition = baseBarSize - basePosition; + } + + if (predicate.isBoxplotChart(this.chartType) && zeroToMin) { + basePosition -= zeroToMin * 2; + } + + baseBounds = { + baseBarSize: baseBarSize, + groupSize: groupSize, + barSize: barSize, + pointInterval: pointInterval, + firstAdditionalPosition: pointInterval, + basePosition: basePosition + }; + } + + return baseBounds; + }, + + /** + * Render normal series label. + * @param {object} paper paper + * @returns {Array.} + * @private + */ + _renderNormalSeriesLabel: function(paper) { + var graphRenderer = this.graphRenderer; + var seriesDataModel = this._getSeriesDataModel(); + var boundsSet = this.seriesData.groupBounds; + var labelTheme = this.theme.label; + var selectedIndex = this.selectedLegendIndex; + var groupLabels = seriesDataModel.map(function(seriesGroup) { + return seriesGroup.map(function(seriesDatum) { + var label = { + end: seriesDatum.endLabel + }; + + if (snippet.isExisty(seriesDatum.start)) { + label.start = seriesDatum.startLabel; + } + + return label; + }); + }); + var positionsSet; + + if (predicate.isBarChart(this.chartType)) { + positionsSet = labelHelper.boundsToLabelPositionsForBarChart(seriesDataModel, boundsSet, labelTheme); + } else { + positionsSet = labelHelper.boundsToLabelPositionsForColumnChart(seriesDataModel, boundsSet, labelTheme); + } + + return graphRenderer.renderSeriesLabel(paper, positionsSet, groupLabels, labelTheme, selectedIndex); + }, + + /** + * Make sum values. + * @param {Array.} values values + * @returns {number} sum result. + */ + _makeSumValues: function(values) { + var sum = calculator.sum(values); + + return renderUtil.formatValue({ + value: sum, + formatFunctions: this.dataProcessor.getFormatFunctions(), + chartType: this.chartType, + areaType: 'series' + }); + }, + + /** + * Make stackType label position. + * @param {{width: number, height: number, left: number, top: number}} bound element bound + * @returns {{left: number, top: number}} position + * @private + */ + _makeStackedLabelPosition: function(bound) { + var left = bound.left + (bound.width / 2); + var top = bound.top + (bound.height / 2); + + return { + left: left, + top: top + }; + }, + + /** + * Make labels html, when has stackType option. + * @param {object} params parameters + * @param {number} params.groupIndex group index + * @param {Array.} params.bounds bounds, + * @returns {string} label positions + * @private + */ + _makeStackedLabelPositions: function(params) { + var self = this; + var seriesGroup = params.seriesGroup; + var positions = seriesGroup.map(function(seriesItem, index) { + var bound = params.bounds[index]; + var position; + + if (bound && seriesItem) { + position = self._makeStackedLabelPosition(bound.end); + } + + return { + end: position + }; + }); + + return positions; + }, + + getGroupLabels: function(seriesDataModel, sumPlusValues, sumMinusValues) { + var isNormalStack = predicate.isNormalStack(this.options.stackType); + + return seriesDataModel.map(function(seriesGroup) { + var labels = seriesGroup.map(function(seriesDatum) { + return { + end: seriesDatum.endLabel + }; + }); + var minusSum; + + if (isNormalStack) { + sumPlusValues.push(calculator.sumPlusValues(seriesGroup.pluck('value'))); + + minusSum = calculator.sumMinusValues(seriesGroup.pluck('value')); + if (minusSum < 0) { + sumMinusValues.push(minusSum); + } + } + + return labels; + }); + }, + + getGroupPositions: function(seriesDataModel, groupBounds) { + var self = this; + + return seriesDataModel.map(function(seriesGroup, index) { + return self._makeStackedLabelPositions({ + seriesGroup: seriesGroup, + bounds: groupBounds[index] + }); + }); + }, + + /** + * Render series label, when has stackType option. + * @param {object} paper paper + * @returns {Array.} + * @private + */ + _renderStackedSeriesLabel: function(paper) { + var self = this; + var sumPlusValues = []; + var sumMinusValues = []; + var labelTheme = this.theme.label; + var groupBounds = this.seriesData.groupBounds; + var seriesDataModel = this._getSeriesDataModel(); + var groupPositions = this.getGroupPositions(seriesDataModel, groupBounds); + var groupLabels = this.getGroupLabels(seriesDataModel, sumPlusValues, sumMinusValues); + var isStacked = true; + var isNormalStack = predicate.isNormalStack(this.options.stackType); + var isBarChart = predicate.isBarChart(this.chartType); + var dimensionType = isBarChart ? 'width' : 'height'; + var positionType = isBarChart ? 'left' : 'top'; + var direction = isBarChart ? 1 : -1; + + if (isNormalStack) { + snippet.forEach(groupLabels, function(labels, index) { + var plusSumValue = sumPlusValues[index]; + var minusSumValue = sumMinusValues[index]; + + if (minusSumValue < 0 && self.options.diverging) { + minusSumValue *= -1; + } + + labels.push({ + end: renderUtil.formatToComma(plusSumValue) + }); + + if (sumMinusValues.length) { + labels.push({ + end: renderUtil.formatToComma(minusSumValue) + }); + } + }); + + snippet.forEach(groupPositions, function(positions, index) { + var bounds = groupBounds[index]; + var lastBound = bounds[bounds.length - 1].end; + var firstBound = bounds[Math.max(parseInt(bounds.length / 2, 10), 1) - 1].end; + var plusEnd = self._makeStackedLabelPosition(lastBound); + var minusEnd = self._makeStackedLabelPosition(firstBound); + var plusLabel = sumPlusValues[index]; + var minusLabel = sumMinusValues[index]; + var plusLabelSize = raphaelRenderUtil.getRenderedTextSize(plusLabel, labelTheme.fontSize, + labelTheme.fontFamily); + var minusLabelSize = raphaelRenderUtil.getRenderedTextSize(minusLabel, labelTheme.fontSize, + labelTheme.fontFamily); + var lastBoundEndPosition = ((lastBound[dimensionType] + plusLabelSize[dimensionType]) / 2); + var firstBoundStartPosition = ((firstBound[dimensionType] + minusLabelSize[dimensionType]) / 2); + + plusEnd[positionType] += (lastBoundEndPosition + chartConst.LEGEND_LABEL_LEFT_PADDING) * direction; + minusEnd[positionType] -= (firstBoundStartPosition + chartConst.LEGEND_LABEL_LEFT_PADDING) * direction; + + positions.push({ + end: plusEnd + }); + if (sumMinusValues.length) { + positions.push({ + end: minusEnd + }); + } + }); + } + + return this.graphRenderer.renderSeriesLabel(paper, groupPositions, groupLabels, labelTheme, isStacked); + }, + + /** + * Render series label. + * @param {object} paper paper + * @returns {Array.} + * @private + */ + _renderSeriesLabel: function(paper) { + var labelSet; + + if (this.options.stackType) { + labelSet = this._renderStackedSeriesLabel(paper); + } else { + labelSet = this._renderNormalSeriesLabel(paper); + } + + return labelSet; + } + }); + + BarTypeSeriesBase.mixin = function(func) { + snippet.extend(func.prototype, BarTypeSeriesBase.prototype); + }; + + module.exports = BarTypeSeriesBase; + + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview renderingLabelHelper is helper for rendering of series label. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var renderUtil = __webpack_require__(7); + var snippet = __webpack_require__(6); + + /** + * renderingLabelHelper is helper for rendering of series label. + * @module renderingLabelHelper + * @private + */ + var renderingLabelHelper = { + /** + * Calculate left position for center align of series label. + * @param {{left: number, top: number, width:number, height: number}} bound - bound + * @returns {number} + * @private + */ + _calculateLeftPositionForCenterAlign: function(bound) { + return bound.left + (bound.width / 2); + }, + + /** + * Calculate top position for middle align of series label. + * @param {{left: number, top: number, width:number, height: number}} bound - bound + * @returns {number} + * @private + */ + _calculateTopPositionForMiddleAlign: function(bound) { + return bound.top + (bound.height / 2); + }, + + /** + * Make position for type of bound for rendering label. + * @param {{left: number, top: number, width:number, height: number}} bound - bound + * @returns {{left: number, top: number}} + * @private + */ + _makePositionForBoundType: function(bound) { + return { + left: this._calculateLeftPositionForCenterAlign(bound), + top: this._calculateTopPositionForMiddleAlign(bound) + }; + }, + + /** + * Make position map for rendering label. + * @param {SeriesItem} seriesItem - series itemyuio + * @param {{left: number, top: number, width: number, height: number}} bound - bound + * @param {number} labelHeight - label height + * @param {object} theme - theme for series label + * @param {function} makePosition - function for making position of label + * @returns {{end: *}} + * @private + */ + _makePositionMap: function(seriesItem, bound, labelHeight, theme, makePosition) { + var value = seriesItem.value; + var isOppositeSide = value >= 0; + var positionMap = { + end: makePosition(bound, labelHeight, seriesItem.endLabel || seriesItem.label, theme, isOppositeSide) + }; + + if (seriesItem.isRange) { + isOppositeSide = value < 0; + positionMap.start = makePosition(bound, labelHeight, seriesItem.startLabel, theme, isOppositeSide); + } + + return positionMap; + }, + + /** + * Bounds to label positions. + * @param {SeriesDataModel} seriesDataModel - series data model + * @param {Array.>} boundsSet - bounds set + * @param {object} theme - theme for series label + * @param {function} [makePosition] - function for making position of label + * @param {boolean} [isPivot] - whether pivot or not + * @returns {Array.} + */ + boundsToLabelPositions: function(seriesDataModel, boundsSet, theme, makePosition, isPivot) { + var self = this; + var labelHeight = renderUtil.getRenderedLabelHeight(chartConst.MAX_HEIGHT_WORD, theme); + + makePosition = makePosition || snippet.bind(this._makePositionForBoundType, this); + isPivot = !!isPivot; + + return seriesDataModel.map(function(seriesGroup, groupIndex) { + var bounds = boundsSet[groupIndex]; + + return seriesGroup.map(function(seriesItem, index) { + var bound = bounds[index].end; + + return self._makePositionMap(seriesItem, bound, labelHeight, theme, makePosition); + }); + }, isPivot); + }, + + /** + * Make label position for bar chart. + * @param {{left: number, top: number, width:number, height: number}} bound - bound + * @param {number} labelHeight - label height + * @param {string} label - label + * @param {object} theme - theme for series label + * @param {boolean} isOppositeSide - whether opossite side or not + * @returns {{left: number, top: number}} + * @private + */ + _makePositionForBarChart: function(bound, labelHeight, label, theme, isOppositeSide) { + var labelWidth = renderUtil.getRenderedLabelWidth(label, theme); + var left = bound.left; + + if (isOppositeSide) { + left += bound.width + chartConst.SERIES_LABEL_PADDING; + } else { + left -= labelWidth + chartConst.SERIES_LABEL_PADDING; + } + + return { + left: left, + top: this._calculateTopPositionForMiddleAlign(bound) + }; + }, + + /** + * Bounds to label positions for bar chart. + * @param {SeriesDataModel} seriesDataModel - series data model + * @param {Array.>} boundsSet - bounds set + * @param {object} theme - theme for series label + * @returns {*|Array.|Array} + */ + boundsToLabelPositionsForBarChart: function(seriesDataModel, boundsSet, theme) { + var makePositionFunction = snippet.bind(this._makePositionForBarChart, this); + + return this.boundsToLabelPositions(seriesDataModel, boundsSet, theme, makePositionFunction); + }, + + /** + * Make label position for column chart. + * @param {{left: number, top: number, width:number, height: number}} bound - bound + * @param {number} labelHeight - label height + * @param {string} label - label + * @param {object} theme - theme for series label + * @param {boolean} isOppositeSide - whether opossite side or not + * @returns {{left: number, top: number}} + * @private + */ + _makePositionForColumnChart: function(bound, labelHeight, label, theme, isOppositeSide) { + var top = bound.top; + + if (isOppositeSide) { + top -= labelHeight + chartConst.SERIES_LABEL_PADDING; + } else { + top += bound.height + chartConst.SERIES_LABEL_PADDING; + } + + return { + left: this._calculateLeftPositionForCenterAlign(bound), + top: top + }; + }, + + /** + * Bounds to label positions for column chart. + * @param {SeriesDataModel} seriesDataModel - series data model + * @param {Array.>} boundsSet - bounds set + * @param {object} theme - theme for series label + * @returns {*|Array.|Array} + */ + boundsToLabelPositionsForColumnChart: function(seriesDataModel, boundsSet, theme) { + var makePositionFunction = snippet.bind(this._makePositionForColumnChart, this); + + return this.boundsToLabelPositions(seriesDataModel, boundsSet, theme, makePositionFunction); + }, + + /** + * Make labels html for treemap chart. + * @param {Array.} seriesItems - seriesItems + * @param {object.} boundMap - bound map + * @returns {string} + */ + boundsToLabelPostionsForTreemap: function(seriesItems, boundMap) { + var self = this; + var positions = snippet.map(seriesItems, function(seriesItem) { + var bound = boundMap[seriesItem.id]; + var position; + + if (bound) { + position = self._makePositionForBoundType(bound); + } + + return position; + }); + + return positions; + } + }; + + module.exports = renderingLabelHelper; + + +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Column chart series component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var Series = __webpack_require__(81); + var BarTypeSeriesBase = __webpack_require__(82); + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var renderUtil = __webpack_require__(7); + var snippet = __webpack_require__(6); + + var ColumnChartSeries = snippet.defineClass(Series, /** @lends ColumnChartSeries.prototype */ { + /** + * Column chart series component. + * @constructs ColumnChartSeries + * @private + * @extends Series + * @param {object} params parameters + * @param {object} params.model series model + * @param {object} params.options series options + * @param {object} params.theme series theme + */ + init: function() { + Series.apply(this, arguments); + }, + + /** + * Make bound of column chart. + * @param {number} width width + * @param {number} height height + * @param {number} left top position value + * @param {number} startTop start top position value + * @param {number} endTop end top position value + * @returns {{ + * start: {left: number, top: number, width: number, height: number}, + * end: {left: number, top: number, width: number, height: number} + * }} column chart bound + * @private + */ + _makeBound: function(width, height, left, startTop, endTop) { + return { + start: { + top: startTop, + left: left, + width: width, + height: 0 + }, + end: { + top: endTop, + left: left, + width: width, + height: height + } + }; + }, + + /** + * Make column chart bound. + * @param {{ + * baseBarSize: number, + * groupSize: number, + * barSize: number, + * pointInterval: number, + * firstAdditionalPosition: number, + * basePosition: number + * }} baseData base data for making bound + * @param {{ + * baseLeft: number, + * left: number, + * plusTop: number, + * minusTop: number, + * prevStack: ?string + * }} iterationData iteration data + * @param {?boolean} isStackType whether stackType option or not. + * @param {SeriesItem} seriesItem series item + * @param {number} index index + * @returns {{ + * start: {left: number, top: number, width: number, height: number}, + * end: {left: number, top: number, width: number, height: number} + * }} + * @private + */ + _makeColumnChartBound: function(baseData, iterationData, isStackType, seriesItem, index) { + var barHeight = Math.abs(baseData.baseBarSize * seriesItem.ratioDistance); + var barStartTop = baseData.baseBarSize * seriesItem.startRatio; + var startTop = baseData.basePosition + barStartTop + chartConst.SERIES_EXPAND_SIZE; + var changedStack = (seriesItem.stack !== iterationData.prevStack); + var pointCount, endTop, bound, boundLeft; + + if (!isStackType || (!this.options.diverging && changedStack)) { + pointCount = isStackType ? this.dataProcessor.findStackIndex(seriesItem.stack) : index; + iterationData.left = iterationData.baseLeft + (baseData.pointInterval * pointCount); + iterationData.plusTop = 0; + iterationData.minusTop = 0; + } + + if (seriesItem.value >= 0) { + iterationData.plusTop -= barHeight; + endTop = startTop + iterationData.plusTop; + } else { + endTop = startTop + iterationData.minusTop; + iterationData.minusTop += barHeight; + } + + iterationData.prevStack = seriesItem.stack; + boundLeft = iterationData.left + baseData.pointInterval - (baseData.barSize / 2); + bound = this._makeBound(baseData.barSize, barHeight, boundLeft, startTop, endTop); + + return bound; + }, + + /** + * Make bounds of column chart. + * @returns {Array.>} bounds + * @private + */ + _makeBounds: function() { + var self = this; + var seriesDataModel = this._getSeriesDataModel(); + var isStackType = predicate.isValidStackOption(this.options.stackType); + var dimension = this.layout.dimension; + var baseData = this._makeBaseDataForMakingBound(dimension.width, dimension.height); + + return seriesDataModel.map(function(seriesGroup, groupIndex) { + var baseLeft = (groupIndex * baseData.groupSize) + self.layout.position.left; + var iterationData = { + baseLeft: baseLeft, + left: baseLeft, + plusTop: 0, + minusTop: 0, + prevStack: null + }; + var iteratee = snippet.bind(self._makeColumnChartBound, self, baseData, iterationData, isStackType); + + return seriesGroup.map(iteratee); + }); + }, + + /** + * Calculate left position of sum label. + * @param {{left: number, top: number}} bound bound + * @param {string} formattedSum formatted sum. + * @returns {number} left position value + * @private + */ + _calculateLeftPositionOfSumLabel: function(bound, formattedSum) { + var labelWidth = renderUtil.getRenderedLabelWidth(formattedSum, this.theme.label); + + return bound.left + ((bound.width - labelWidth + chartConst.TEXT_PADDING) / 2); + } + }); + + BarTypeSeriesBase.mixin(ColumnChartSeries); + + function columnSeriesFactory(params) { + var libType = params.chartOptions.libType; + var chartTheme = params.chartTheme; + + params.libType = libType; + params.chartType = 'column'; + params.chartBackground = chartTheme.chart.background; + + return new ColumnChartSeries(params); + } + + columnSeriesFactory.componentType = 'series'; + columnSeriesFactory.ColumnChartSeries = ColumnChartSeries; + + module.exports = columnSeriesFactory; + + +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Line chart series component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var Series = __webpack_require__(81); + var LineTypeSeriesBase = __webpack_require__(86); + var snippet = __webpack_require__(6); + + var LineChartSeries = snippet.defineClass(Series, /** @lends LineChartSeries.prototype */ { + /** + * Line chart series component. + * @constructs LineChartSeries + * @private + * @extends Series + * @mixes LineTypeSeriesBase + * @param {object} params parameters + * @param {object} params.model series model + * @param {object} params.options series options + * @param {object} params.theme series theme + */ + init: function() { + Series.apply(this, arguments); + + /** + * object for requestAnimationFrame + * @type {null | {id: number}} + */ + this.movingAnimation = null; + }, + + /** + * Make positions for rendering graph and sending to mouse event detector. + * @param {number} [seriesWidth] - series width + * @returns {Array.>} positions + * @private + */ + _makePositions: function(seriesWidth) { + return this._makeBasicPositions(seriesWidth); + }, + + /** + * Make series data for rendering graph and sending to mouse event detector. + * @returns {object} series data + * @private + * @override + */ + _makeSeriesData: function() { + var groupPositions = this._makePositions(); + + return { + chartBackground: this.chartBackground, + groupPositions: groupPositions, + isAvailable: function() { + return groupPositions && groupPositions.length > 0; + } + }; + }, + + /** + * Rerender. + * @param {object} data - data for rerendering + * @override + */ + rerender: function(data) { + var paper; + + this._cancelMovingAnimation(); + + paper = Series.prototype.rerender.call(this, data); + + return paper; + } + }); + + LineTypeSeriesBase.mixin(LineChartSeries); + + function lineSeriesFactory(params) { + var libType = params.chartOptions.libType; + var chartTheme = params.chartTheme; + + params.libType = libType; + params.chartType = 'line'; + params.chartBackground = chartTheme.chart.background; + + return new LineChartSeries(params); + } + + lineSeriesFactory.componentType = 'series'; + + module.exports = lineSeriesFactory; + + +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview LineTypeSeriesBase is base class for line type series. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var arrayUtil = __webpack_require__(10); + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var calculator = __webpack_require__(45); + var renderUtil = __webpack_require__(7); + var snippet = __webpack_require__(6); + + /** + * @classdesc LineTypeSeriesBase is base class for line type series. + * @class LineTypeSeriesBase + * @private + * @mixin + * @private */ + var LineTypeSeriesBase = snippet.defineClass(/** @lends LineTypeSeriesBase.prototype */ { + /** + * Make positions for default data type. + * @param {number} [seriesWidth] - width of series area + * @returns {Array.>} + * @private + */ + _makePositionsForDefaultType: function(seriesWidth) { + var dimension = this.layout.dimension; + var seriesDataModel = this._getSeriesDataModel(); + var width = seriesWidth || dimension.width || 0; + var height = dimension.height; + var len = seriesDataModel.getGroupCount(); + var baseTop = this.layout.position.top; + var baseLeft = this.layout.position.left; + var step; + + if (this.aligned) { + step = width / (len > 1 ? (len - 1) : len); + } else { + step = width / len; + baseLeft += (step / 2); + } + + return seriesDataModel.map(function(seriesGroup) { + return seriesGroup.map(function(seriesItem, index) { + var position; + + if (!snippet.isNull(seriesItem.end)) { + position = { + left: baseLeft + (step * index), + top: baseTop + height - (seriesItem.ratio * height) + }; + + if (snippet.isExisty(seriesItem.startRatio)) { + position.startTop = baseTop + height - (seriesItem.startRatio * height); + } + } + + return position; + }); + }, true); + }, + + /** + * Make positions for coordinate data type. + * @param {number} [seriesWidth] - width of series area + * @returns {Array.>} + * @private + */ + _makePositionForCoordinateType: function(seriesWidth) { + var dimension = this.layout.dimension; + var seriesDataModel = this._getSeriesDataModel(); + var width = seriesWidth || dimension.width || 0; + var height = dimension.height; + var xAxis = this.axisDataMap.xAxis; + var additionalLeft = 0; + var baseTop = this.layout.position.top; + var baseLeft = this.layout.position.left; + + if (xAxis.sizeRatio) { + additionalLeft = calculator.multiply(width, xAxis.positionRatio); + width = calculator.multiply(width, xAxis.sizeRatio); + } + + return seriesDataModel.map(function(seriesGroup) { + return seriesGroup.map(function(seriesItem) { + var position; + + if (!snippet.isNull(seriesItem.end)) { + position = { + left: baseLeft + (seriesItem.ratioMap.x * width) + additionalLeft, + top: baseTop + height - (seriesItem.ratioMap.y * height) + }; + + if (snippet.isExisty(seriesItem.ratioMap.start)) { + position.startTop = + height - (seriesItem.ratioMap.start * height) + chartConst.SERIES_EXPAND_SIZE; + } + } + + return position; + }); + }, true); + }, + + /** + * Make basic positions for rendering line graph. + * @param {number} [seriesWidth] - width of series area + * @returns {Array.>} + * @private + */ + _makeBasicPositions: function(seriesWidth) { + var positions; + + if (this.dataProcessor.isCoordinateType()) { + positions = this._makePositionForCoordinateType(seriesWidth); + } else { + positions = this._makePositionsForDefaultType(seriesWidth); + } + + return positions; + }, + + /** + * Calculate label position top. + * @param {{top: number, startTop: number}} basePosition - base position + * @param {number} value - value of seriesItem + * @param {number} labelHeight - label height + * @param {boolean} [isStart] - whether start value of seriesItem or not + * @returns {number} position top + * @private + */ + _calculateLabelPositionTop: function(basePosition, value, labelHeight, isStart) { + var baseTop = basePosition.top, + top; + + if (predicate.isValidStackOption(this.options.stackType)) { + top = ((basePosition.startTop + baseTop - labelHeight) / 2) + 1; + } else if ((value >= 0 && !isStart) || (value < 0 && isStart)) { + top = baseTop - labelHeight - chartConst.SERIES_LABEL_PADDING; + } else { + top = baseTop + chartConst.SERIES_LABEL_PADDING; + } + + return top; + }, + + /** + * Make label position for rendering label of series area. + * @param {{left: number, top: number, startTop: ?number}} basePosition - base position for calculating + * @param {number} labelHeight - label height + * @param {(string | number)} label - label of seriesItem + * @param {number} value - value of seriesItem + * @param {boolean} [isStart] - whether start label position or not + * @returns {{left: number, top: number}} + * @private + */ + _makeLabelPosition: function(basePosition, labelHeight, label, value, isStart) { + return { + left: basePosition.left, + top: this._calculateLabelPositionTop(basePosition, value, labelHeight / 2, isStart) + + }; + }, + + /** + * Get label positions for line type chart + * @param {object} seriesDataModel series data model + * @param {object} theme label theme + * @returns {object} + * @private + */ + _getLabelPositions: function(seriesDataModel, theme) { + var self = this; + var basePositions = arrayUtil.pivot(this.seriesData.groupPositions); + var labelHeight = renderUtil.getRenderedLabelHeight(chartConst.MAX_HEIGHT_WORD, theme); + + return seriesDataModel.map(function(seriesGroup, groupIndex) { + return seriesGroup.map(function(seriesItem, index) { + var basePosition = basePositions[groupIndex][index]; + var end = self._makeLabelPosition(basePosition, labelHeight, seriesItem.endLabel, seriesItem.end); + var position = { + end: end + }; + + if (seriesItem.isRange) { + basePosition.top = basePosition.startTop; + position.start = + self._makeLabelPosition(basePosition, labelHeight, seriesItem.startLabel, seriesItem.start); + } + + return position; + }); + }); + }, + + /** + * Get label texts + * @param {object} seriesDataModel sereis data model + * @returns {Array.} + * @private + */ + _getLabelTexts: function(seriesDataModel) { + return seriesDataModel.map(function(seriesGroup) { + return seriesGroup.map(function(seriesDatum) { + var label = { + end: seriesDatum.endLabel + }; + + if (seriesDatum.isRange) { + label.start = seriesDatum.startLabel; + } + + return label; + }); + }); + }, + + /** + * Render series label. + * @param {object} paper paper + * @returns {Array.} + * @private + */ + _renderSeriesLabel: function(paper) { + var theme = this.theme.label; + var seriesDataModel = this._getSeriesDataModel(); + var groupLabels = this._getLabelTexts(seriesDataModel); + var positionsSet = this._getLabelPositions(seriesDataModel, theme); + + return this.graphRenderer.renderSeriesLabel(paper, positionsSet, groupLabels, theme); + }, + + /** + * To call showGroupTooltipLine function of graphRenderer. + * @param {{ + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }} bound bound + */ + onShowGroupTooltipLine: function(bound) { + if (!this.graphRenderer.showGroupTooltipLine) { + return; + } + + this.graphRenderer.showGroupTooltipLine(bound, this.layout); + }, + + /** + * To call hideGroupTooltipLine function of graphRenderer. + */ + onHideGroupTooltipLine: function() { + if (!this.seriesData + || !this.seriesData.isAvailable() + || !this.graphRenderer.hideGroupTooltipLine + ) { + return; + } + this.graphRenderer.hideGroupTooltipLine(); + }, + + /** + * Zoom by mouse drag. + * @param {object} data - data + */ + zoom: function(data) { + this._cancelMovingAnimation(); + this._clearSeriesContainer(data.paper); + this._setDataForRendering(data); + this._renderSeriesArea(data.paper, snippet.bind(this._renderGraph, this)); + this.animateComponent(true); + + if (!snippet.isNull(this.selectedLegendIndex)) { + this.graphRenderer.selectLegend(this.selectedLegendIndex); + } + }, + + /** + * Whether changed or not. + * @param {{min: number, max: number}} before - before limit + * @param {{min: number, max: number}} after - after limit + * @returns {boolean} + * @private + */ + _isChangedLimit: function(before, after) { + return before.min !== after.min || before.max !== after.max; + }, + + /** + * Whether changed axis limit(min, max) or not. + * @returns {boolean} + * @private + */ + _isChangedAxisLimit: function() { + var beforeAxisDataMap = this.beforeAxisDataMap; + var axisDataMap = this.axisDataMap; + var changed = true; + + if (beforeAxisDataMap) { + changed = this._isChangedLimit(beforeAxisDataMap.yAxis.limit, axisDataMap.yAxis.limit); + + if (axisDataMap.xAxis.limit) { + changed = changed || this._isChangedLimit(beforeAxisDataMap.xAxis.limit, axisDataMap.xAxis.limit); + } + } + + this.beforeAxisDataMap = axisDataMap; + + return changed; + }, + + /** + * Animate for motion of series area. + * @param {function} callback - callback function + * @private + */ + _animate: function(callback) { + var self = this; + var duration = chartConst.ADDING_DATA_ANIMATION_DURATION; + var changedLimit = this._isChangedAxisLimit(); + + if (changedLimit && this.seriesLabelContainer) { + this.seriesLabelContainer.innerHTML = ''; + } + + if (!callback) { + return; + } + + this.movingAnimation = renderUtil.startAnimation(duration, callback, function() { + self.movingAnimation = null; + }); + }, + + /** + * Make top of zero point for adding data. + * @returns {number} + * @private + * @override + */ + _makeZeroTopForAddingData: function() { + var seriesHeight = this.layout.dimension.height; + var limit = this.axisDataMap.yAxis.limit; + + return this._getLimitDistanceFromZeroPoint(seriesHeight, limit).toMax + chartConst.SERIES_EXPAND_SIZE; + }, + + /** + * Animate for adding data. + * @param {{tickSize: number}} data - parameters for adding data. + */ + animateForAddingData: function(data) { + var dimension = this.dimensionMap.extendedSeries; + var seriesWidth = this.layout.dimension.width; + var tickSize = data.tickSize; + var shiftingOption = this.options.shifting; + var seriesData, paramsForRendering, groupPositions, zeroTop; + + this.limit = data.limitMap[this.chartType]; + this.axisDataMap = data.axisDataMap; + + seriesData = this._makeSeriesData(); + paramsForRendering = this._makeParamsForGraphRendering(dimension, seriesData); + + if (shiftingOption) { + seriesWidth += tickSize; + } + + groupPositions = this._makePositions(seriesWidth); + zeroTop = this._makeZeroTopForAddingData(); + + this.graphRenderer.animateForAddingData(paramsForRendering, tickSize, groupPositions, shiftingOption, zeroTop); + }, + + /** + * Cancel moving animation. + * @private + */ + _cancelMovingAnimation: function() { + if (this.movingAnimation) { + cancelAnimationFrame(this.movingAnimation.id); + this.movingAnimation = null; + } + } + }); + + LineTypeSeriesBase.mixin = function(func) { + snippet.extend(func.prototype, LineTypeSeriesBase.prototype); + }; + + module.exports = LineTypeSeriesBase; + + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Radial chart series component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var Series = __webpack_require__(81); + var chartConst = __webpack_require__(8); + var geom = __webpack_require__(49); + var snippet = __webpack_require__(6); + + var RadialChartSeries = snippet.defineClass(Series, /** @lends RadialChartSeries.prototype */ { + /** + * Line chart series component. + * @constructs RadialChartSeries + * @private + * @extends Series + * @param {object} params parameters + * @param {object} params.model series model + * @param {object} params.options series options + * @param {object} params.theme series theme + */ + init: function() { + Series.apply(this, arguments); + + this.options = snippet.extend({ + showDot: true, + showArea: true + }, this.options); + + /** + * object for requestAnimationFrame + * @type {null | {id: number}} + */ + this.movingAnimation = null; + + this.drawingType = chartConst.COMPONENT_TYPE_RAPHAEL; + }, + + /** + * Make positions data for radial series + * @param {Array.} seriesGroups series data per category + * @param {number} groupCount category count + * @returns {Array.>} + * @private + */ + _makePositionsForRadial: function(seriesGroups, groupCount) { + var layout = this.layout; + var dimension = layout.dimension; + var width = dimension.width - chartConst.RADIAL_PLOT_PADDING - chartConst.RADIAL_MARGIN_FOR_CATEGORY; + var height = dimension.height - chartConst.RADIAL_PLOT_PADDING - chartConst.RADIAL_MARGIN_FOR_CATEGORY; + var centerX = (width / 2) + (chartConst.RADIAL_PLOT_PADDING / 2) + (chartConst.RADIAL_MARGIN_FOR_CATEGORY / 2) + + layout.position.left; + var centerY = (height / 2) - (chartConst.RADIAL_PLOT_PADDING / 2) - (chartConst.RADIAL_MARGIN_FOR_CATEGORY / 2) + - layout.position.top; + + var stepAngle = 360 / groupCount; + var radius; + + radius = Math.min(width, height) / 2; + + return snippet.map(seriesGroups, function(seriesGroup) { + var positions = snippet.map(seriesGroup, function(seriesItem, index) { + var position, y, angle, point, valueSize; + + if (!snippet.isNull(seriesItem.end)) { + valueSize = seriesItem.ratio * radius; + + // center y + real vaule size + y = centerY + valueSize; + + // turn angle to clockwise + angle = 360 - (stepAngle * index); + + point = geom.rotatePointAroundOrigin(centerX, centerY, centerX, y, angle); + + position = { + left: point.x, + top: height - point.y // convert y coordinate to top + }; + } + + return position; + }); + + positions.push(positions[0]); + + return positions; + }, true); + }, + + /** + * Get pivoted seriesGroups + * @returns {Array.} series group + * @private + */ + _getSeriesGroups: function() { + var seriesDataModel = this._getSeriesDataModel(); + + return seriesDataModel.map(function(group) { + return group.map(function(item) { + return item; + }); + }, true); + }, + + /** + * Make series data for rendering graph and sending to mouse event detector. + * @returns {object} series data + * @private + * @override + */ + _makeSeriesData: function() { + var groups = this._getSeriesGroups(); + var groupPositions = this._makePositionsForRadial(groups, this._getSeriesDataModel().getGroupCount()); + + return { + groupPositions: groupPositions, + isAvailable: function() { + return groupPositions && groupPositions.length > 0; + } + }; + }, + + /** + * Rerender. + * @param {object} data - data for rerendering + * @returns {Raphael.Paper} raphael paper + * @override + */ + rerender: function(data) { + return Series.prototype.rerender.call(this, data); + } + }); + + function radialSeriesFactory(params) { + var chartType = params.chartOptions.chartType; + var libType = params.chartOptions.libType; + var chartTheme = params.chartTheme; + + params.libType = libType; + params.chartType = chartType; + params.chartBackground = chartTheme.background; + + return new RadialChartSeries(params); + } + + radialSeriesFactory.componentType = 'series'; + radialSeriesFactory.RadialChartSeries = RadialChartSeries; + + module.exports = radialSeriesFactory; + + +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Area chart series component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var Series = __webpack_require__(81); + var LineTypeSeriesBase = __webpack_require__(86); + var predicate = __webpack_require__(11); + var snippet = __webpack_require__(6); + + var AreaChartSeries = snippet.defineClass(Series, /** @lends AreaChartSeries.prototype */ { + /** + * Area chart series component. + * @constructs AreaChartSeries + * @private + * @extends Series + * @mixes LineTypeSeriesBase + */ + init: function() { + Series.apply(this, arguments); + + /** + * object for requestAnimationFrame + * @type {null | {id: number}} + */ + this.movingAnimation = null; + }, + + /** + * Make position top of zero point. + * @returns {number} position top + * @private + */ + _makePositionTopOfZeroPoint: function() { + var dimension = this.layout.dimension; + var limit = this.axisDataMap.yAxis.limit; + var baseTop = this.layout.position.top; + var top = this._getLimitDistanceFromZeroPoint(dimension.height, limit).toMax + baseTop; + + if (limit.min >= 0 && !top) { + top = dimension.height; + } + + return top; + }, + + /** + * Make positions, when has stackType option. + * @param {Array.>} groupPositions group positions + * @returns {Array.>} stackType positions + * @private + */ + _makeStackedPositions: function(groupPositions) { + var height = this.layout.dimension.height; + var baseTop = this.layout.position.top; + var firstStartTop = this._makePositionTopOfZeroPoint(); + var prevPositionTops = []; + + return snippet.map(groupPositions, function(positions) { + return snippet.map(positions, function(position, index) { + var prevTop = prevPositionTops[index] || firstStartTop; + var positionTop = position ? position.top : 0; + var stackedHeight = height - positionTop + baseTop; + var top = position ? prevTop - stackedHeight : prevTop; + + if (position) { + position.startTop = prevTop; + position.top = top; + } + + prevPositionTops[index] = top; + + return position; + }); + }); + }, + + /** + * Make series positions. + * @param {number} seriesWidth - width of series area + * @returns {Array.>} stackType positions + * @private + */ + _makePositions: function(seriesWidth) { + var groupPositions = this._makeBasicPositions(seriesWidth); + + if (predicate.isValidStackOption(this.options.stackType)) { + groupPositions = this._makeStackedPositions(groupPositions); + } + + return groupPositions; + }, + + /** + * Make series data. + * @returns {object} series data + * @private + * @override + */ + _makeSeriesData: function() { + var dimension = this.layout.dimension; + var baseTop = this.layout.position.top; + var zeroTop = this._getLimitDistanceFromZeroPoint(dimension.height, this.limit).toMax + baseTop; + var groupPositions = this._makePositions(); + + return { + chartBackground: this.chartBackground, + groupPositions: groupPositions, + hasRangeData: this._getSeriesDataModel().hasRangeData(), + zeroTop: zeroTop, + isAvailable: function() { + return groupPositions && groupPositions.length > 0; + } + }; + }, + + /** + * Rerender. + * @param {object} data - data for rerendering + * @override + */ + rerender: function(data) { + var paper; + + this._cancelMovingAnimation(); + + paper = Series.prototype.rerender.call(this, data); + + return paper; + } + }); + + LineTypeSeriesBase.mixin(AreaChartSeries); + + function areaSeriesFactory(params) { + var libType = params.chartOptions.libType; + var chartTheme = params.chartTheme; + + params.libType = libType; + params.chartType = 'area'; + params.chartBackground = chartTheme.chart.background; + + return new AreaChartSeries(params); + } + + areaSeriesFactory.componentType = 'series'; + areaSeriesFactory.AreaChartSeries = AreaChartSeries; + + module.exports = areaSeriesFactory; + + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Bubble chart series component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var Series = __webpack_require__(81); + var CoordinateTypeSeriesBase = __webpack_require__(90); + var snippet = __webpack_require__(6); + + var BubbleChartSeries = snippet.defineClass(Series, /** @lends BubbleChartSeries.prototype */ { + /** + * Bubble chart series component. + * @constructs BubbleChartSeries + * @private + * @extends Series + */ + init: function() { + /** + * previous clicked index. + * @type {?number} + */ + this.prevClickedIndex = null; + + /** + * max radius for rendering circle graph + * @type {null|number} + */ + this.maxRadius = null; + + this.drawingType = chartConst.COMPONENT_TYPE_RAPHAEL; + + Series.apply(this, arguments); + }, + + /** + * Calculate step value for label axis. + * @returns {number} + * @private + */ + _calculateStep: function() { + var step = 0; + var dimension, size, len; + var hasVerticalCategory = this.dataProcessor.isXCountGreaterThanYCount(this.chartType); + + if (this.dataProcessor.hasCategories(hasVerticalCategory)) { + dimension = this.layout.dimension; + len = this.dataProcessor.getCategoryCount(hasVerticalCategory); + + if (hasVerticalCategory) { + size = dimension.height; + } else { + size = dimension.width; + } + + step = size / len; + } + + return step; + }, + + /** + * Make bound for bubble chart. + * @param {{x: number, y: number, r: number}} ratioMap - ratio map + * @param {number} positionByStep - position value by step + * @param {number} maxRadius - max radius + * @returns {{left: number, top: number, radius: number}} + * @private + */ + _makeBound: function(ratioMap, positionByStep, maxRadius) { + var dimension = this.layout.dimension; + var position = this.layout.position; + var left = snippet.isExisty(ratioMap.x) ? (ratioMap.x * dimension.width) : positionByStep; + var top = snippet.isExisty(ratioMap.y) ? (ratioMap.y * dimension.height) : positionByStep; + + return { + left: position.left + left, + top: position.top + dimension.height - top, + radius: Math.max(maxRadius * ratioMap.r, 2) + }; + }, + + /** + * Make bounds for bubble chart. + * @returns {Array.>} positions + * @private + */ + _makeBounds: function() { + var self = this; + var seriesDataModel = this._getSeriesDataModel(); + var maxRadius = this.maxRadius; + var step = this._calculateStep(); + var start = step ? step / 2 : 0; + + return seriesDataModel.map(function(seriesGroup, index) { + var positionByStep = start + (step * index); + + return seriesGroup.map(function(seriesItem) { + var hasRationMap = (seriesItem && seriesItem.ratioMap); + + return hasRationMap ? self._makeBound(seriesItem.ratioMap, positionByStep, maxRadius) : null; + }); + }); + }, + + /** + * Set data for rendering. + * @param {{ + * paper: ?object, + * limit: { + * min: number, + * max: number + * }, + * aligned: boolean, + * layout: { + * dimension: {width: number, height: number}, + * position: {left: number, top: number} + * }, + * dimensionMap: object, + * positionMap: object, + * axisDataMap: object, + * maxRadius: number + * }} data - data for rendering + * @private + */ + _setDataForRendering: function(data) { + this.maxRadius = data.maxRadius; + Series.prototype._setDataForRendering.call(this, data); + } + }); + + CoordinateTypeSeriesBase.mixin(BubbleChartSeries); + + function bubbleSeriesFactory(params) { + var libType = params.chartOptions.libType; + var chartTheme = params.chartTheme; + + params.libType = libType; + params.chartType = 'bubble'; + params.chartBackground = chartTheme.chart.background; + + return new BubbleChartSeries(params); + } + + bubbleSeriesFactory.componentType = 'series'; + bubbleSeriesFactory.BubbleChartSeries = BubbleChartSeries; + + module.exports = bubbleSeriesFactory; + + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview CoordinateTypeSeriesBase is base class for coordinate type series. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + var CoordinateTypeSeriesBase = snippet.defineClass(/** @lends CoordinateTypeSeriesBase.prototype */ { + /** + * Make series data. + * @returns {{ + * groupBounds: Array.>, + * seriesDataModel: SeriesDataModel + * }} series data + * @private + * @override + */ + _makeSeriesData: function() { + var groupBounds = this._makeBounds(); + + return { + groupBounds: groupBounds, + seriesDataModel: this._getSeriesDataModel(), + isAvailable: function() { + return groupBounds && groupBounds.length > 0; + } + }; + }, + + /** + * showTooltip is callback of mouseover event to series element. + * @param {object} params parameters + * @param {boolean} params.allowNegativeTooltip whether allow negative tooltip or not + * @param {{top:number, left: number, width: number, height: number}} bound graph bound information + * @param {number} groupIndex group index + * @param {number} index index + * @param {{left: number, top: number}} mousePosition mouse position + */ + showTooltip: function(params, bound, groupIndex, index, mousePosition) { + this.eventBus.fire('showTooltip', snippet.extend({ + indexes: { + groupIndex: groupIndex, + index: index + }, + mousePosition: mousePosition + }, params)); + }, + + /** + * hideTooltip is callback of mouseout event to series element. + */ + hideTooltip: function() { + this.eventBus.fire('hideTooltip'); + }, + + /** + * Render raphael graph. + * @param {{width: number, height: number}} dimension dimension + * @param {object} seriesData series data + * @param {object} paper paper object + * @private + * @override + */ + _renderGraph: function(dimension, seriesData, paper) { + var showTooltip = snippet.bind(this.showTooltip, this, { + chartType: this.chartType + }); + var callbacks = { + showTooltip: showTooltip, + hideTooltip: snippet.bind(this.hideTooltip, this) + }; + var params = this._makeParamsForGraphRendering(dimension, seriesData); + + return this.graphRenderer.render(paper, params, callbacks); + }, + + /** + * If click series, showing selected state. + * @param {{left: number, top: number}} position - mouse position + */ + onClickSeries: function(position) { + var indexes = this._executeGraphRenderer(position, 'findIndexes'); + var prevIndexes = this.prevClickedIndexes; + var allowSelect = this.options.allowSelect; + var shouldSelect; + + if (indexes && prevIndexes) { + this.onUnselectSeries({ + indexes: prevIndexes + }); + this.prevClickedIndexes = null; + } + + if (!indexes) { + return; + } + + shouldSelect = !prevIndexes || + (indexes.index !== prevIndexes.index) || (indexes.groupIndex !== prevIndexes.groupIndex); + + if (allowSelect && !shouldSelect) { + return; + } + + this.onSelectSeries({ + chartType: this.chartType, + indexes: indexes + }, shouldSelect); + + if (allowSelect) { + this.prevClickedIndexes = indexes; + } + }, + + /** + * If mouse move series, call 'moveMouseOnSeries' of graph render. + * @param {{left: number, top: number}} position mouse position + */ + onMoveSeries: function(position) { + this._executeGraphRenderer(position, 'moveMouseOnSeries'); + } + }); + + CoordinateTypeSeriesBase.mixin = function(func) { + snippet.extend(func.prototype, CoordinateTypeSeriesBase.prototype); + }; + + module.exports = CoordinateTypeSeriesBase; + + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Scatter chart series component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var Series = __webpack_require__(81); + var CoordinateTypeSeriesBase = __webpack_require__(90); + var chartConst = __webpack_require__(8); + var snippet = __webpack_require__(6); + + var ScatterChartSeries = snippet.defineClass(Series, /** @lends ScatterChartSeries.prototype */ { + /** + * Scatter chart series component. + * @constructs ScatterChartSeries + * @private + * @extends Series + */ + init: function() { + /** + * previous clicked index. + * @type {?number} + */ + this.prevClickedIndex = null; + Series.apply(this, arguments); + }, + + /** + * Make bound for scatter chart. + * @param {{x: number, y: number, r: number}} ratioMap - ratio map + * @returns {{left: number, top: number, raius: number}} + * @private + */ + _makeBound: function(ratioMap) { + var dimension = this.layout.dimension; + var basePosition = this.layout.position; + + return { + left: basePosition.left + (ratioMap.x * dimension.width), + top: dimension.height - (ratioMap.y * dimension.height) + basePosition.top, + radius: chartConst.SCATTER_RADIUS + }; + }, + + /** + * Make bounds for scatter chart. + * @returns {Array.>} positions + * @private + */ + _makeBounds: function() { + var self = this; + var seriesDataModel = this._getSeriesDataModel(); + + return seriesDataModel.map(function(seriesGroup) { + return seriesGroup.map(function(seriesItem) { + var hasRatioMap = (seriesItem && seriesItem.ratioMap); + + return hasRatioMap ? self._makeBound(seriesItem.ratioMap) : null; + }); + }); + } + }); + + CoordinateTypeSeriesBase.mixin(ScatterChartSeries); + + function scatterSeriesFactory(params) { + var libType = params.chartOptions.libType; + var chartTheme = params.chartTheme; + + params.libType = libType; + params.chartType = 'scatter'; + params.chartBackground = chartTheme.chart.background; + + return new ScatterChartSeries(params); + } + + scatterSeriesFactory.componentType = 'series'; + scatterSeriesFactory.ScatterChartSeries = ScatterChartSeries; + + module.exports = scatterSeriesFactory; + + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Map chart series component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var Series = __webpack_require__(81); + var chartConst = __webpack_require__(8); + var snippet = __webpack_require__(6); + + var browser = snippet.browser; + var IS_LTE_IE8 = browser.msie && browser.version <= 8; + + var MapChartSeries = snippet.defineClass(Series, /** @lends MapChartSeries.prototype */ { + /** + * Map chart series component. + * @constructs MapChartSeries + * @private + * @extends Series + * @param {object} params parameters + * @param {object} params.options series options + * @param {object} params.theme series theme + * @param {MapChartDataProcessor} params.dataProcessor data processor for map chart + */ + init: function(params) { + /** + * Base position. + * @type {{left: number, top: number}} + */ + this.basePosition = { + left: 0, + top: 0 + }; + + /** + * Zoom magnification. + * @type {number} + */ + this.zoomMagn = 1; + + /** + * Map ratio. + * @type {number} + */ + this.mapRatio = 1; + + /** + * Graph dimension. + * @type {{}} + */ + this.graphDimension = {}; + + /** + * Limit position. + * @type {{}} + */ + this.limitPosition = {}; + + /** + * Map model. + * @type {MapChartMapModel} + */ + this.mapModel = params.mapModel; + + /** + * Color spectrum + * @type {ColorSpectrum} + */ + this.colorSpectrum = params.colorSpectrum; + + /** + * Previous mouse position. + * @type {?{left: number, top: number}} + */ + this.prevPosition = null; + + /** + * Previous moved index. + * @type {?number} + */ + this.prevMovedIndex = null; + + /** + * Whether drag or not. + * @type {boolean} + */ + this.isDrag = false; + + /** + * Start position. + * @type {?{left: number, top: number}} + */ + this.startPosition = null; + + Series.call(this, params); + }, + + /** + * Attach to event bus. + * @private + */ + _attachToEventBus: function() { + Series.prototype._attachToEventBus.call(this); + + if (!IS_LTE_IE8) { + this.eventBus.on({ + dragStartMapSeries: this.onDragStartMapSeries, + dragMapSeries: this.onDragMapSeries, + dragEndMapSeries: this.onDragEndMapSeries, + zoomMap: this.onZoomMap + }, this); + } + }, + + /** + * Set map ratio. + * @param {object} [graphDimension] graph dimension + * @private + */ + _setMapRatio: function(graphDimension) { + var seriesDimension = this.layout.dimension; + var mapDimension = graphDimension || this.mapModel.getMapDimension(); + var widthRatio = seriesDimension.width / mapDimension.width; + var heightRatio = seriesDimension.height / mapDimension.height; + + this.mapRatio = Math.min(widthRatio, heightRatio); + }, + + /** + * Set graph dimension. + * @private + */ + _setGraphDimension: function() { + var seriesDimension = this.layout.dimension; + + this.graphDimension = { + width: seriesDimension.width * this.zoomMagn, + height: seriesDimension.height * this.zoomMagn + }; + }, + + /** + * Render series component. + * @param {object} data data for rendering + */ + render: function(data) { + Series.prototype.render.call(this, data); + this._setMapRatio(); + }, + + /** + * Set limit position to move map. + * @private + */ + _setLimitPositionToMoveMap: function() { + var seriesDimension = this.layout.dimension; + var graphDimension = this.graphDimension; + + this.limitPosition = { + left: seriesDimension.width - graphDimension.width, + top: seriesDimension.height - graphDimension.height + }; + }, + + /** + * Render raphael graph. + * @private + * @override + */ + _renderGraph: function() { + this._setGraphDimension(); + + this._setLimitPositionToMoveMap(); + + this.graphRenderer.render(this.paper, { + colorSpectrum: this.colorSpectrum, + mapModel: this.mapModel, + layout: this.layout, + theme: this.theme + }); + }, + + /** + * Render series label. + * @returns {Array.} + * @private + */ + _renderSeriesLabel: function() { + var labelData = this.mapModel.getLabelData(this.zoomMagn * this.mapRatio); + + return this.graphRenderer.renderSeriesLabels(this.paper, labelData, this.theme.label); + }, + + /** + * Render series area. + * @param {HTMLElement} seriesContainer series area element + * @param {object} data data for rendering + * @param {function} funcRenderGraph function for graph rendering + * @private + */ + _renderSeriesArea: function(seriesContainer, data, funcRenderGraph) { + Series.prototype._renderSeriesArea.call(this, seriesContainer, data, funcRenderGraph); + }, + + /** + * Adjust map position. + * @param {{left: number, top: number}} targetPosition target position + * @returns {{left: number, top: number}} adjusted position + * @private + */ + _adjustMapPosition: function(targetPosition) { + return { + left: Math.max(Math.min(targetPosition.left, 0), this.limitPosition.left), + top: Math.max(Math.min(targetPosition.top, 0), this.limitPosition.top) + }; + }, + + /** + * Update base position for zoom. + * @param {{width: number, height: number}} prevDimension previous dimension + * @param {{left: number, top: number}} prevLimitPosition previous limit position + * @param {number} changedRatio changed ratio + * @private + */ + _updateBasePositionForZoom: function(prevDimension, prevLimitPosition, changedRatio) { + var prevBasePosition = this.basePosition, + prevLeft = prevBasePosition.left - (prevLimitPosition.left / 2), + prevTop = prevBasePosition.top - (prevLimitPosition.top / 2), + newBasePosition = { + left: (prevLeft * changedRatio) + (this.limitPosition.left / 2), + top: (prevTop * changedRatio) + (this.limitPosition.top / 2) + }; + + this.basePosition = this._adjustMapPosition(newBasePosition); + }, + + /** + * Zoom. + * @param {number} changedRatio changed ratio + * @param {object} position position + * @private + */ + _zoom: function(changedRatio, position) { + var prevDimension = this.graphDimension, + prevLimitPosition = this.limitPosition; + + this._setGraphDimension(); + + this._setLimitPositionToMoveMap(); + this._updateBasePositionForZoom(prevDimension, prevLimitPosition, changedRatio); + + this._setMapRatio(this.graphDimension); + + this.graphRenderer.scaleMapPaths(changedRatio, position, this.mapRatio, prevDimension, prevDimension); + }, + + /** + * Update positions to resize. + * @param {number} prevMapRatio previous ratio + * @private + */ + _updatePositionsToResize: function(prevMapRatio) { + var changedRatio = this.mapRatio / prevMapRatio; + + this.basePosition.left *= changedRatio; + this.basePosition.top *= changedRatio; + + this.limitPosition.left *= changedRatio; + this.limitPosition.top *= changedRatio; + }, + + /** + * If click series, showing selected state. + * @param {{left: number, top: number}} position - mouse position + */ + onClickSeries: function(position) { + var foundIndex = this._executeGraphRenderer(position, 'findSectorIndex'); + + if (!snippet.isNull(foundIndex)) { + this.eventBus.fire('selectSeries', { + chartType: this.chartType, + index: foundIndex, + code: this.mapModel.getDatum(foundIndex).code + }); + } + }, + + /** + * Whether changed position or not. + * @param {?{left: number, top: number}} prevPosition previous position + * @param {{left: number, top: number}} position position + * @returns {boolean} result boolean + * @private + */ + _isChangedPosition: function(prevPosition, position) { + return !prevPosition || prevPosition.left !== position.left || prevPosition.top !== position.top; + }, + + /** + * Show wedge of spectrum legend. + * @param {number} index map data index + * @private + */ + _showWedge: function(index) { + var datum = this.mapModel.getDatum(index); + + if (!snippet.isUndefined(datum.ratio)) { + this.eventBus.fire('showWedge', datum.ratio); + } + }, + + /** + * Show tooltip. + * @param {number} index map data index + * @param {{left: number, top: number}} mousePosition mouse position + * @private + */ + _showTooltip: function(index, mousePosition) { + this.eventBus.fire('showTooltip', { + chartType: this.chartType, + indexes: { + index: index + }, + mousePosition: { + left: mousePosition.left, + top: mousePosition.top - chartConst.TOOLTIP_GAP + } + }); + }, + + /** + * On move series. + * @param {{left: number, top: number}} position position + */ + onMoveSeries: function(position) { + var foundIndex = this._executeGraphRenderer(position, 'findSectorIndex'); + + if (!snippet.isNull(foundIndex)) { + if (this.prevMovedIndex !== foundIndex) { + if (!snippet.isNull(this.prevMovedIndex)) { + this.graphRenderer.restoreColor(this.prevMovedIndex); + this.eventBus.fire('hideTooltip'); + } + + this.graphRenderer.changeColor(foundIndex); + } + + if (this._isChangedPosition(this.prevPosition, position)) { + this._showTooltip(foundIndex, { + left: position.left, + top: position.top + }); + this.prevMovedIndex = foundIndex; + } + + this._showWedge(foundIndex); + } else if (!snippet.isNull(this.prevMovedIndex)) { + this.graphRenderer.restoreColor(this.prevMovedIndex); + this.eventBus.fire('hideTooltip'); + this.prevMovedIndex = null; + } + this.prevPosition = position; + }, + + /** + * On drag start series. + * @param {{left: number, top: number}} position position + */ + onDragStartMapSeries: function(position) { + this.startPosition = { + left: position.left, + top: position.top + }; + }, + + /** + * Move position. + * @param {{left: number, top: number}} startPosition start position + * @param {{left: number, top: number}} endPosition end position + * @private + */ + _movePosition: function(startPosition, endPosition) { + var movementPosition = { + x: (endPosition.left - startPosition.left) * this.mapRatio, + y: (endPosition.top - startPosition.top) * this.mapRatio + }; + + this.graphRenderer.moveMapPaths(movementPosition, this.graphDimension); + }, + + /** + * On drag series. + * @param {{left: number, top: number}} position position + */ + onDragMapSeries: function(position) { + this._movePosition(this.startPosition, position); + + this.startPosition = position; + + if (!this.isDrag) { + this.isDrag = true; + this.eventBus.fire('hideTooltip'); + } + }, + + /** + * On drag end series. + */ + onDragEndMapSeries: function() { + this.isDrag = false; + }, + + /** + * On zoom map. + * @param {number} newMagn new zoom magnification + * @param {?{left: number, top: number}} position mouse position + */ + onZoomMap: function(newMagn, position) { + var changedRatio = newMagn / this.zoomMagn; + var positions = this.layout.position; + var layerPosition = position ? position : { + left: this.layout.dimension.width / 2, + top: this.layout.dimension.height / 2 + }; + + this.zoomMagn = newMagn; + + this._zoom(changedRatio, { + left: layerPosition.left - positions.left, + top: layerPosition.top - positions.top + }); + + this.eventBus.fire(chartConst.PUBLIC_EVENT_PREFIX + 'zoom', newMagn); + }, + + /** + * Make exportation data for public event of series type. + * @param {object} seriesData - series data + * @returns {{ + * chartType: string, + * code: string, + * index: number + * }} + * @private + */ + _makeExportationSeriesData: function(seriesData) { + return seriesData; + } + }); + + function mapSeriesFactory(params) { + var libType = params.chartOptions.libType; + + params.libType = libType; + params.chartType = 'map'; + + return new MapChartSeries(params); + } + + mapSeriesFactory.componentType = 'series'; + mapSeriesFactory.MapChartSeries = MapChartSeries; + + module.exports = mapSeriesFactory; + + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Pie chart series component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var Series = __webpack_require__(81); + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var snippet = __webpack_require__(6); + var raphaelRenderUtil = __webpack_require__(5); + + var PieChartSeries = snippet.defineClass(Series, /** @lends PieChartSeries.prototype */ { + /** + * Line chart series component. + * @constructs PieChartSeries + * @private + * @extends Series + * @param {object} params parameters + * @param {object} params.model series model + * @param {object} params.options series options + * @param {object} params.theme series theme + */ + init: function(params) { + Series.call(this, params); + + this.isCombo = !!params.isCombo; + + this.isShowOuterLabel = predicate.isShowOuterLabel(this.options); + + /** + * range for quadrant. + * @type {?number} + */ + this.quadrantRange = null; + + /** + * previous clicked index. + * @type {?number} + */ + this.prevClickedIndex = null; + + this.drawingType = chartConst.COMPONENT_TYPE_RAPHAEL; + + this.legendMaxWidth = params.legendMaxWidth; + + this._setDefaultOptions(); + }, + + /** + * Make valid angle. + * @param {number} angle - angle + * @param {number} defaultAngle - default angle + * @returns {number} + * @private + */ + _makeValidAngle: function(angle, defaultAngle) { + if (snippet.isUndefined(angle)) { + angle = defaultAngle; + } else if (angle < 0) { + angle = chartConst.ANGLE_360 - (Math.abs(angle) % chartConst.ANGLE_360); + } else if (angle > 0) { + angle = angle % chartConst.ANGLE_360; + } + + return angle; + }, + + /** + * Transform radius range. + * @param {Array.} radiusRange - radius range + * @returns {Array} + * @private + */ + _transformRadiusRange: function(radiusRange) { + radiusRange = radiusRange || ['0%', '100%']; + + return snippet.map(radiusRange, function(percent) { + var ratio = parseInt(percent, 10) * 0.01; + + return Math.max(Math.min(ratio, 1), 0); + }); + }, + + /** + * Set default options for series of pie type chart. + * @private + */ + _setDefaultOptions: function() { + var options = this.options; + + options.startAngle = this._makeValidAngle(options.startAngle, 0); + options.endAngle = this._makeValidAngle(options.endAngle, options.startAngle); + options.radiusRange = this._transformRadiusRange(options.radiusRange); + + if (options.radiusRange.length === 1) { + options.radiusRange.unshift(0); + } + }, + + /** + * Calculate angle for rendering. + * @returns {number} + * @private + */ + _calculateAngleForRendering: function() { + var startAngle = this.options.startAngle; + var endAngle = this.options.endAngle; + var renderingAngle; + + if (startAngle < endAngle) { + renderingAngle = endAngle - startAngle; + } else if (startAngle > endAngle) { + renderingAngle = chartConst.ANGLE_360 - (startAngle - endAngle); + } else { + renderingAngle = chartConst.ANGLE_360; + } + + return renderingAngle; + }, + + /** + * Make sectors information. + * @param {{cx: number, cy: number, r: number}} circleBound circle bound + * @returns {Array.} sectors information + * @private + */ + _makeSectorData: function(circleBound) { + var self = this; + var seriesGroup = this._getSeriesDataModel().getFirstSeriesGroup(); + var cx = circleBound.cx; + var cy = circleBound.cy; + var r = circleBound.r; + var angle = this.options.startAngle; + var angleForRendering = this._calculateAngleForRendering(); + var delta = 10; + var holeRatio = this.options.radiusRange[0]; + var centerR = r * 0.5; + var paths; + + if (holeRatio) { + centerR += centerR * holeRatio; + } + + if (!seriesGroup) { + return null; + } + paths = seriesGroup.map(function(seriesItem) { + var ratio = seriesItem ? seriesItem.ratio : 0; + var currentAngle = angleForRendering * ratio; + var endAngle = angle + currentAngle; + var popupAngle = angle + (currentAngle / 2); + var angles = { + start: { + startAngle: angle, + endAngle: angle + }, + end: { + startAngle: angle, + endAngle: endAngle + } + }; + var positionData = { + cx: cx, + cy: cy, + angle: popupAngle + }; + + angle = endAngle; + + return { + ratio: ratio, + angles: angles, + centerPosition: self._getArcPosition(snippet.extend({ + r: centerR + }, positionData)), + outerPosition: { + start: self._getArcPosition(snippet.extend({ + r: r + }, positionData)), + middle: self._getArcPosition(snippet.extend({ + r: r + delta + }, positionData)) + } + }; + }); + + return paths; + }, + + /** + * Make series data. + * @returns {{ + * chartBackground: string, + * circleBound: ({cx: number, cy: number, r: number}), + * sectorData: Array. + * }} add data for graph rendering + * @private + * @override + */ + _makeSeriesData: function() { + var circleBound = this._makeCircleBound(); + var sectorData = this._makeSectorData(circleBound); + + return { + chartBackground: this.chartBackground, + circleBound: circleBound, + sectorData: sectorData, + isAvailable: function() { + return sectorData && sectorData.length > 0; + } + }; + }, + + /** + * Get quadrant from angle. + * @param {number} angle - angle + * @param {boolean} isEnd whether end quadrant + * @returns {number} + * @private + */ + _getQuadrantFromAngle: function(angle, isEnd) { + var quadrant = parseInt(angle / chartConst.ANGLE_90, 10) + 1; + + if (isEnd && (angle % chartConst.ANGLE_90 === 0)) { + quadrant += (quadrant === 1) ? 3 : -1; + } + + return quadrant; + }, + + /** + * Get range for quadrant. + * @returns {{start: number, end: number}} + * @private + */ + _getRangeForQuadrant: function() { + if (!this.quadrantRange) { + this.quadrantRange = { + start: this._getQuadrantFromAngle(this.options.startAngle), + end: this._getQuadrantFromAngle(this.options.endAngle, true) + }; + } + + return this.quadrantRange; + }, + + /** + * Whether in range for quadrant. + * @param {number} start - start quadrant + * @param {number} end - end quadrant + * @returns {boolean} + * @private + */ + _isInQuadrantRange: function(start, end) { + var quadrantRange = this._getRangeForQuadrant(); + + return quadrantRange.start === start && quadrantRange.end === end; + }, + + /** + * Calculate base size. + * @returns {number} + * @private + */ + _calculateBaseSize: function() { + var dimension = this.layout.dimension; + var width = dimension.width; + var height = dimension.height; + var quadrantRange; + + if (!this.isCombo) { + quadrantRange = this._getRangeForQuadrant(); + if (this._isInQuadrantRange(2, 3) || this._isInQuadrantRange(4, 1)) { + height *= 2; + } else if (this._isInQuadrantRange(1, 2) || this._isInQuadrantRange(3, 4)) { + width *= 2; + } else if (quadrantRange.start === quadrantRange.end) { + width *= 2; + height *= 2; + } + } + + return Math.min(width, height); + }, + + /** + * Calculate radius. + * @returns {number} + * @private + */ + _calculateRadius: function() { + var radiusRatio = this.isShowOuterLabel ? chartConst.PIE_GRAPH_SMALL_RATIO : chartConst.PIE_GRAPH_DEFAULT_RATIO; + var baseSize = this._calculateBaseSize(); + + return baseSize * radiusRatio * this.options.radiusRange[1] / 2; + }, + + /** + * Calculate center x, y. + * @param {number} radius - radius + * @returns {{cx: number, cy: number}} + * @private + */ + _calculateCenterXY: function(radius) { + var dimension = this.layout.dimension; + var position = this.layout.position; + var halfRadius = radius / 2; + var cx = (dimension.width / 2) + position.left; + var cy = (dimension.height / 2) + position.top; + + if (!this.isCombo) { + if (this._isInQuadrantRange(1, 1)) { + cx -= halfRadius; + cy += halfRadius; + } else if (this._isInQuadrantRange(1, 2)) { + cx -= halfRadius; + } else if (this._isInQuadrantRange(2, 2)) { + cx -= halfRadius; + cy -= halfRadius; + } else if (this._isInQuadrantRange(2, 3)) { + cy -= halfRadius; + } else if (this._isInQuadrantRange(3, 3)) { + cx += halfRadius; + cy -= halfRadius; + } else if (this._isInQuadrantRange(3, 4)) { + cx += halfRadius; + } else if (this._isInQuadrantRange(4, 1)) { + cy += halfRadius; + } else if (this._isInQuadrantRange(4, 4)) { + cx += halfRadius; + cy += halfRadius; + } + } + + return { + cx: cx, + cy: cy + }; + }, + + /** + * Make circle bound + * @returns {{cx: number, cy: number, r: number}} circle bounds + * @private + */ + _makeCircleBound: function() { + var radius = this._calculateRadius(); + var centerXY = this._calculateCenterXY(radius); + + return snippet.extend({ + r: radius + }, centerXY); + }, + + /** + * Get arc position. + * @param {object} params parameters + * @param {number} params.cx center x + * @param {number} params.cy center y + * @param {number} params.r radius + * @param {number} params.angle angle(degree) + * @returns {{left: number, top: number}} arc position + * @private + */ + _getArcPosition: function(params) { + return { + left: params.cx + (params.r * Math.sin(params.angle * chartConst.RAD)), + top: params.cy - (params.r * Math.cos(params.angle * chartConst.RAD)) + }; + }, + + /** + * Render raphael graph. + * @param {{width: number, height: number}} dimension dimension + * @param {object} seriesData series data + * @param {object} paper paper object + * @private + * @override + */ + _renderGraph: function(dimension, seriesData, paper) { + var showTootltip = snippet.bind(this.showTooltip, this, { + allowNegativeTooltip: !!this.allowNegativeTooltip, + seriesType: this.seriesType, + chartType: this.chartType + }); + var callbacks = { + showTooltip: showTootltip, + hideTooltip: snippet.bind(this.hideTooltip, this) + }; + var params = this._makeParamsForGraphRendering(dimension, seriesData); + var currentSeriesName = this.seriesType; + var seriesDataModelMap = this.dataProcessor.seriesDataModelMap; + var pastSeriesNames = []; + var pastIndex = 0; + + snippet.forEach(this.dataProcessor.seriesTypes, function(seriesType) { + var needNext = true; + + if (seriesType !== currentSeriesName) { + pastSeriesNames.push(seriesType); + } else { + needNext = false; + } + + return needNext; + }); + + snippet.forEach(pastSeriesNames, function(seriesType) { + pastIndex += seriesDataModelMap[seriesType].baseGroups.length; + }); + + params.additionalIndex = pastIndex; + + return this.graphRenderer.render(paper, params, callbacks); + }, + + /** + * Resize. + * @override + */ + resize: function() { + Series.prototype.resize.apply(this, arguments); + this._moveLegendLines(); + }, + + /** + * showTooltip is mouseover event callback on series graph. + * @param {object} params parameters + * @param {boolean} params.allowNegativeTooltip whether allow negative tooltip or not + * @param {{top:number, left: number, width: number, height: number}} bound graph bound information + * @param {number} groupIndex group index + * @param {number} index index + * @param {{left: number, top: number}} mousePosition mouse position + */ + showTooltip: function(params, bound, groupIndex, index, mousePosition) { + this.eventBus.fire('showTooltip', snippet.extend({ + indexes: { + groupIndex: groupIndex, + index: index + }, + mousePosition: mousePosition + }, params)); + }, + + /** + * hideTooltip is mouseout event callback on series graph. + */ + hideTooltip: function() { + this.eventBus.fire('hideTooltip'); + }, + + /** + * Make series data by selection. + * @param {number} index index + * @returns {{indexes: {index: number, groupIndex: number}}} series data + * @private + */ + _makeSeriesDataBySelection: function(index) { + return { + indexes: { + index: index, + groupIndex: index + } + }; + }, + /** + * Get series label. + * @param {string} legend - legend name + * @param {string} label - label name + * @returns {string} series label + * @private + */ + _getSeriesLabel: function(legend, label) { + var seriesLabel = ''; + + if (this.options.showLegend) { + seriesLabel = raphaelRenderUtil.getEllipsisText(legend, this.legendMaxWidth, this.theme.label); + } + if (this.options.showLabel) { + seriesLabel += (seriesLabel ? chartConst.LABEL_SEPARATOR : '') + label; + } + + return seriesLabel; + }, + + /** + * Pick poistions from sector data. + * @param {string} positionType position type + * @returns {Array} positions + * @private + */ + _pickPositionsFromSectorData: function(positionType) { + return snippet.map(this.seriesData.sectorData, function(datum) { + return datum.ratio ? datum[positionType] : null; + }); + }, + + /** + * Add end position. + * @param {number} centerLeft center left + * @param {Array.} positions positions + * @private + */ + _addEndPosition: function(centerLeft, positions) { + snippet.forEachArray(positions, function(position) { + var end; + + if (!position) { + return; + } + + end = snippet.extend({}, position.middle); + if (end.left < centerLeft) { + end.left -= chartConst.SERIES_OUTER_LABEL_PADDING; + } else { + end.left += chartConst.SERIES_OUTER_LABEL_PADDING; + } + position.end = end; + }); + }, + + /** + * Move to outer position. + * @param {number} centerLeft center left + * @param {object} position position + * @param {string} label label + * @returns {{left: number, top: number}} outer position + * @private + */ + _moveToOuterPosition: function(centerLeft, position, label) { + var positionEnd = position.end; + var left = positionEnd.left; + var top = positionEnd.top; + var OffsetX = (this.graphRenderer.getRenderedLabelWidth(label, this.theme.label) / 2) + + chartConst.SERIES_LABEL_PADDING; + + if (left < centerLeft) { + left -= OffsetX; + } else { + left += OffsetX; + } + + return { + left: left, + top: top + }; + }, + + /** + * get label position infos. + * @returns {{centerLeft: number, outerPositions: Array, filteredPositions: Array }} - positionInfo + * @private + */ + _getFilterInfos: function() { + var centerLeft = this.getSeriesData().circleBound.cx; + var outerPositions = this._pickPositionsFromSectorData('outerPosition'); + var filteredPositions = snippet.filter(outerPositions, function(position) { + return position; + }); + + return { + centerLeft: centerLeft, + outerPositions: outerPositions, + filteredPositions: filteredPositions + }; + }, + + /** + * set series position + * @param {object} params position infos + * @param {Array.} labels labels array + * @returns {Array.} + * @private + */ + _setSeriesPosition: function(params, labels) { + var positions = []; + if (params.funcMoveToPosition) { + positions = snippet.map(params.positions, function(position, index) { + var outerPosition = null; + + if (position) { + outerPosition = params.funcMoveToPosition(position, labels[index]); + } + + return outerPosition; + }); + } else { + positions = params.positions; + } + + return positions; + }, + + /** + * Render series label. + * @param {object} paper paper + * @returns {Array.} + * @private + */ + _renderSeriesLabel: function(paper) { + var positionInfo; + var renderOption = {}; + var positions = []; + var dataProcessor = this.dataProcessor; + var seriesDataModel = this._getSeriesDataModel(); + var legendLabels = dataProcessor.getLegendLabels(this.seriesType); + var labels = snippet.map(legendLabels, function(legend, index) { + return this._getSeriesLabel(legend, seriesDataModel.getSeriesItem(0, index).label); + }, this); + + if (predicate.isLabelAlignOuter(this.options.labelAlign)) { + positionInfo = this._getFilterInfos(); + + this._addEndPosition(positionInfo.centerLeft, positionInfo.filteredPositions); + this.graphRenderer.renderLegendLines(positionInfo.filteredPositions); + + renderOption.positions = positionInfo.outerPositions; + renderOption.funcMoveToPosition = snippet.bind(this._moveToOuterPosition, this, positionInfo.centerLeft); + } else { + renderOption.positions = this._pickPositionsFromSectorData('centerPosition'); + } + + positions = this._setSeriesPosition(renderOption, labels); + + return this.graphRenderer.renderLabels(paper, positions, labels, this.theme.label); + }, + + /** + * Animate series label area. + * @override + */ + animateSeriesLabelArea: function() { + this.graphRenderer.animateLegendLines(this.selectedLegendIndex); + Series.prototype.animateSeriesLabelArea.call(this); + }, + + /** + * Move legend lines. + * @private + * @override + */ + _moveLegendLines: function() { + var centerLeft = this.dimensionMap.chart.width / 2, + outerPositions = this._pickPositionsFromSectorData('outerPosition'), + filteredPositions = snippet.filter(outerPositions, function(position) { + return position; + }); + + this._addEndPosition(centerLeft, filteredPositions); + this.graphRenderer.moveLegendLines(filteredPositions); + }, + + /** + * Whether detected label element or not. + * @param {{left: number, top: number}} position - mouse position + * @returns {boolean} + * @private + */ + _isDetectedLabel: function(position) { + var labelElement = document.elementFromPoint(position.left, position.top); + + return snippet.isString(labelElement.className); + }, + + /** + * On click series. + * @param {{left: number, top: number}} position mouse position + */ + onClickSeries: function(position) { + var sectorInfo = this._executeGraphRenderer(position, 'findSectorInfo'); + var prevIndex = this.prevClickedIndex; + var allowSelect = this.options.allowSelect; + var foundIndex, shouldSelect; + + if ((sectorInfo || this._isDetectedLabel(position)) && snippet.isExisty(prevIndex) && allowSelect) { + this.onUnselectSeries({ + indexes: { + index: prevIndex + } + }); + this.prevClickedIndex = null; + } + + if (!sectorInfo || sectorInfo.chartType !== this.seriesType) { + return; + } + + foundIndex = sectorInfo.index; + shouldSelect = foundIndex > -1 && (foundIndex !== prevIndex); + + if (allowSelect && !shouldSelect) { + return; + } + + this.onSelectSeries({ + chartType: this.chartType, + indexes: { + index: foundIndex, + legendIndex: sectorInfo.legendIndex + } + }, shouldSelect); + + if (allowSelect && foundIndex > -1) { + this.prevClickedIndex = foundIndex; + } + }, + + /** + * On move series. + * @param {{left: number, top: number}} position mouse position + */ + onMoveSeries: function(position) { + this._executeGraphRenderer(position, 'moveMouseOnSeries'); + } + }); + + function pieSeriesFactory(params) { + var libType = params.chartOptions.libType; + var chartTheme = params.chartTheme; + var chartType = params.chartOptions.chartType; + var legendOption = params.chartOptions.legend; + + params.libType = libType; + params.chartType = 'pie'; + + if (chartType === 'combo') { + // elias series mapping key is used as a seriesType(ex. pie1) + // It is now distinguished to follow current structure + // elias will not be needed after chart constructor is integrated + params.seriesType = params.name.split('Series')[0]; + params.isCombo = true; + } + + if (legendOption) { + params.legendMaxWidth = legendOption.maxWidth; + } + + params.chartBackground = chartTheme.chart.background; + + return new PieChartSeries(params); + } + + pieSeriesFactory.componentType = 'series'; + pieSeriesFactory.PieChartSeries = PieChartSeries; + + module.exports = pieSeriesFactory; + + +/***/ }), +/* 94 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Series component for rendering graph of heatmap chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var Series = __webpack_require__(81); + var labelHelper = __webpack_require__(83); + var snippet = __webpack_require__(6); + + var HeatmapChartSeries = snippet.defineClass(Series, /** @lends HeatmapChartSeries.prototype */ { + /** + * Series component for rendering graph of heatmap chart. + * @constructs HeatmapChartSeries + * @private + * @param {object} params - parameters + * @extends Series + */ + init: function(params) { + /** + * Color spectrum + * @type {ColorSpectrum} + */ + this.colorSpectrum = params.colorSpectrum; + + Series.call(this, params); + }, + + /** + * Make series data for rendering graph and sending to mouse event detector. + * @returns {{ + * groupBounds: Array.>, + * seriesDataModel: SeriesDataModel + * }} series data + * @private + * @override + */ + _makeSeriesData: function() { + var groupBounds = this._makeBounds(); + var seriesDataModel = this._getSeriesDataModel(); + + return { + colorSpectrum: this.colorSpectrum, + groupBounds: groupBounds, + seriesDataModel: seriesDataModel, + isAvailable: function() { + return groupBounds && groupBounds.length > 0; + } + }; + }, + + /** + * Make bound for graph rendering. + * @param {number} blockWidth - block width + * @param {number} blockHeight - block height + * @param {number} x - x index + * @param {number} y - y index + * @returns {{end: {left: number, top: number, width: number, height: number}}} + * @private + */ + _makeBound: function(blockWidth, blockHeight, x, y) { + var height = this.layout.dimension.height; + var left = (blockWidth * x) + this.layout.position.left; + var top = height - (blockHeight * (y + 1)) + this.layout.position.top; + + return { + end: { + left: left, + top: top, + width: blockWidth, + height: blockHeight + } + }; + }, + + /** + * Make bounds for graph rendering. + * @returns {Array.>} positions + * @private + */ + _makeBounds: function() { + var self = this; + var seriesDataModel = this._getSeriesDataModel(); + var dimension = this.layout.dimension; + var blockWidth = dimension.width / this.dataProcessor.getCategoryCount(false); + var blockHeight = dimension.height / this.dataProcessor.getCategoryCount(true); + + return seriesDataModel.map(function(seriesGroup, x) { + return seriesGroup.map(function(seriesItem, y) { + return self._makeBound(blockWidth, blockHeight, x, y); + }); + }); + }, + + /** + * Call showWedge event of spectrum legend, when call showTooltip event. + * @param {{indexes: {groupIndex: number, index: number}}} params - parameters + */ + onShowTooltip: function(params) { + var seriesDataModel = this._getSeriesDataModel(); + var indexes = params.indexes; + var ratio = seriesDataModel.getSeriesItem(indexes.groupIndex, indexes.index).ratio; + + this.eventBus.fire('showWedge', ratio); + }, + + /** + * Render series label. + * @param {object} paper - paper + * @returns {Array.} + * @private + */ + _renderSeriesLabel: function(paper) { + var sdm = this._getSeriesDataModel(); + var boundsSet = this.seriesData.groupBounds; + var labelTheme = this.theme.label; + var selectedIndex = this.selectedLegendIndex; + var positionsSet = labelHelper.boundsToLabelPositions(sdm, boundsSet, labelTheme); + var labels = sdm.map(function(datum) { + return datum.valuesMap.value; + }); + + return this.graphRenderer.renderSeriesLabel(paper, positionsSet, labels, labelTheme, selectedIndex); + }, + + /** + * Resize. + * @override + */ + resize: function() { + this.boundMap = null; + + Series.prototype.resize.apply(this, arguments); + }, + + /** + * Make exportation data for public event of series type. + * @param {object} seriesData - series data + * @returns {{x: number, y: number}} + * @private + */ + _makeExportationSeriesData: function(seriesData) { + return { + x: seriesData.indexes.groupIndex, + y: seriesData.indexes.index + }; + } + }); + + function heatmapChartSeriesFactory(params) { + var libType = params.chartOptions.libType; + + params.libType = libType; + params.chartType = 'heatmap'; + + return new HeatmapChartSeries(params); + } + + heatmapChartSeriesFactory.componentType = 'series'; + heatmapChartSeriesFactory.HeatmapChartSeries = HeatmapChartSeries; + + module.exports = heatmapChartSeriesFactory; + + +/***/ }), +/* 95 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Series component for rendering graph of treemap chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var Series = __webpack_require__(81); + var squarifier = __webpack_require__(96); + var labelHelper = __webpack_require__(83); + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var snippet = __webpack_require__(6); + + var TreemapChartSeries = snippet.defineClass(Series, /** @lends TreemapChartSeries.prototype */ { + /** + * Series component for rendering graph of treemap chart. + * @constructs TreemapChartSeries + * @private + * @param {object} params - parameters + * @extends Series + */ + init: function(params) { + Series.call(this, params); + + this.theme.borderColor = this.theme.borderColor || chartConst.TREEMAP_DEFAULT_BORDER; + + /** + * root id + * @type {string} + */ + this.rootId = chartConst.TREEMAP_ROOT_ID; + + /** + * start depth of seriesItem for rendering graph + * @type {number} + */ + this.startDepth = 1; + + /** + * selected group + * @type {null | number} + */ + this.selectedGroup = null; + + /** + * bound map + * @type {null|object.} + */ + this.boundMap = null; + + /** + * color spectrum + * @type {ColorSpectrum} + */ + this.colorSpectrum = params.colorSpectrum; + + this._initOptions(); + }, + + /** + * Initialize options. + * @private + */ + _initOptions: function() { + this.options.useColorValue = !!this.options.useColorValue; + + if (snippet.isUndefined(this.options.zoomable)) { + this.options.zoomable = !this.options.useColorValue; + } + + if (snippet.isUndefined(this.options.useLeafLabel)) { + this.options.useLeafLabel = !this.options.zoomable; + } + }, + + /** + * Make series data. + * @returns {{ + * groupBounds: object., + * seriesDataModel: SeriesDataModel + * }} + * @private + * @override + */ + _makeSeriesData: function() { + var boundMap = this._getBoundMap(); + var groupBounds = this._makeBounds(boundMap); + + return { + boundMap: boundMap, + groupBounds: groupBounds, + seriesDataModel: this._getSeriesDataModel(), + startDepth: this.startDepth, + isPivot: true, + colorSpectrum: this.options.useColorValue ? this.colorSpectrum : null, + chartBackground: this.chartBackground, + zoomable: this.options.zoomable, + isAvailable: function() { + return groupBounds && groupBounds.length > 0; + } + }; + }, + + /** + * Make bound map by dimension. + * @param {string | number} parent - parent id + * @param {object.} boundMap - bound map + * @param {object} layout - layout + * @returns {object.} + * @private + */ + _makeBoundMap: function(parent, boundMap, layout) { + var self = this; + var seriesDataModel = this._getSeriesDataModel(); + var defaultLayout = snippet.extend({}, this.layout.dimension, this.layout.position); + var seriesItems; + + layout = layout || defaultLayout; + seriesItems = seriesDataModel.findSeriesItemsByParent(parent); + boundMap = snippet.extend(boundMap || {}, squarifier.squarify(layout, seriesItems)); + + snippet.forEachArray(seriesItems, function(seriesItem) { + boundMap = self._makeBoundMap(seriesItem.id, boundMap, boundMap[seriesItem.id]); + }); + + return boundMap; + }, + + /** + * Make bounds for rendering graph. + * @param {object.} boundMap - bound map + * @returns {Array.>} + * @private + */ + _makeBounds: function(boundMap) { + var startDepth = this.startDepth; + var seriesDataModel = this._getSeriesDataModel(); + var isValid; + + if (this.options.zoomable) { + isValid = function(seriesItem) { + return seriesItem.depth === startDepth; + }; + } else { + isValid = function(seriesItem) { + return !seriesItem.hasChild; + }; + } + + return seriesDataModel.map(function(seriesGroup) { + return seriesGroup.map(function(seriesItem) { + var bound = boundMap[seriesItem.id]; + var result = null; + + if (bound && isValid(seriesItem)) { + result = { + end: bound + }; + } + + return result; + }, true); + }, true); + }, + + /** + * Get bound map for rendering graph. + * @returns {object.} + * @private + */ + _getBoundMap: function() { + if (!this.boundMap) { + this.boundMap = this._makeBoundMap(this.rootId); + } + + return this.boundMap; + }, + + /** + * Whether should dimmed or not. + * @param {SeriesDataModel} seriesDataModel - SeriesDataModel for treemap + * @param {SeriesItem} hoverSeriesItem - hover SeriesItem + * @param {SeriesItem} seriesItem - target SeriesItem + * @returns {boolean} + * @private + */ + _shouldDimmed: function(seriesDataModel, hoverSeriesItem, seriesItem) { + var shouldTransparent = false; + var parent; + + if (hoverSeriesItem && seriesItem.id !== hoverSeriesItem.id && seriesItem.group === hoverSeriesItem.group) { + parent = seriesDataModel.findParentByDepth(seriesItem.id, hoverSeriesItem.depth + 1); + + if (parent && parent.parent === hoverSeriesItem.id) { + shouldTransparent = true; + } + } + + return shouldTransparent; + }, + + /** + * Render series label. + * @param {object} paper - paper + * @returns {Array.} + * @private + */ + _renderSeriesLabel: function(paper) { + var seriesDataModel = this._getSeriesDataModel(); + var boundMap = this._getBoundMap(); + var labelTheme = this.theme.label; + var labelTemplate = this.options.labelTemplate; + var positions, seriesItems, labels; + + if (this.options.useLeafLabel) { + seriesItems = seriesDataModel.findLeafSeriesItems(this.selectedGroup); + } else { + seriesItems = seriesDataModel.findSeriesItemsByDepth(this.startDepth, this.selectedGroup); + } + + labels = snippet.map(seriesItems, function(seriesItem) { + var labelText = labelTemplate ? labelTemplate(seriesItem.pickLabelTemplateData()) : seriesItem.label; + + return labelText; + }); + + positions = labelHelper.boundsToLabelPostionsForTreemap(seriesItems, boundMap, labelTheme); + + return this.graphRenderer.renderSeriesLabelForTreemap(paper, positions, labels, labelTheme); + }, + + /** + * Resize. + * @override + */ + resize: function() { + this.boundMap = null; + + Series.prototype.resize.apply(this, arguments); + }, + + /** + * Zoom. + * @param {string | number} rootId - root id + * @param {number} startDepth - start depth + * @param {number} group - group + * @private + */ + _zoom: function(rootId, startDepth, group) { + this._clearSeriesContainer(); + this.boundMap = null; + this.rootId = rootId; + this.startDepth = startDepth; + this.selectedGroup = group; + this._renderSeriesArea(this.paper, snippet.bind(this._renderGraph, this)); + this.animateComponent(true); + }, + + /** + * Zoom + * @param {{index: number}} data - data for zoom + */ + zoom: function(data) { + var detectedIndex = data.index; + var seriesDataModel, seriesItem; + + this.labelSet.remove(); + + if (detectedIndex === -1) { + this._zoom(chartConst.TREEMAP_ROOT_ID, 1, null); + + return; + } + + seriesDataModel = this._getSeriesDataModel(); + seriesItem = seriesDataModel.getSeriesItem(0, detectedIndex, true); + + if (!seriesItem || !seriesItem.hasChild) { + return; + } + + this._zoom(seriesItem.id, seriesItem.depth + 1, seriesItem.group); + this.eventBus.fire('afterZoom', detectedIndex); + }, + + /** + * Make exportation data for public event of series type. + * @param {object} seriesData series data + * @returns {{chartType: string, legend: string, legendIndex: number, index: number}} export data + * @private + */ + _makeExportationSeriesData: function(seriesData) { + var indexes = seriesData.indexes; + var seriesItem = this._getSeriesDataModel().getSeriesItem(indexes.groupIndex, indexes.index, true); + + return snippet.extend({ + chartType: this.chartType, + indexes: seriesItem.indexes + }); + }, + + /** + * To call showAnimation function of graphRenderer. + * @param {{groupIndex: number, index: number}} indexes - indexes + */ + onHoverSeries: function(indexes) { + if (!predicate.isShowLabel(this.options)) { + return; + } + + this.graphRenderer.showAnimation(indexes, this.options.useColorValue, 0.6); + }, + + /** + * To call hideAnimation function of graphRenderer. + * @param {{groupIndex: number, index: number}} indexes - indexes + */ + onHoverOffSeries: function(indexes) { + if (!predicate.isShowLabel(this.options) || !indexes) { + return; + } + + this.graphRenderer.hideAnimation(indexes, this.options.useColorValue); + }, + + /** + * On show tooltip for calling showWedge. + * @param {{indexes: {groupIndex: number, index: number}}} params - parameters + */ + onShowTooltip: function(params) { + var seriesDataModel = this._getSeriesDataModel(); + var indexes = params.indexes; + var ratio = seriesDataModel.getSeriesItem(indexes.groupIndex, indexes.index, true).colorRatio; + + if (ratio > -1) { + this.eventBus.fire('showWedge', ratio); + } + } + }); + + function treemapChartSeriesFactory(params) { + var libType = params.chartOptions.libType; + var chartTheme = params.chartTheme; + + params.libType = libType; + params.chartType = 'treemap'; + params.chartBackground = chartTheme.chart.background; + + return new TreemapChartSeries(params); + } + + treemapChartSeriesFactory.componentType = 'series'; + treemapChartSeriesFactory.TreemapChartSeries = TreemapChartSeries; + + module.exports = treemapChartSeriesFactory; + + +/***/ }), +/* 96 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview squarifier create squarified bounds for rendering graph of treemap chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var calculator = __webpack_require__(45); + var arrayUtil = __webpack_require__(10); + var snippet = __webpack_require__(6); + + var squarifier = { + /** + * bound map + * @type {object.} + */ + boundMap: {}, + + /** + * Make base bound for calculating bounds. + * @param {{width: number, height: number, left: number, top: number}} layout - layout + * @returns {{width: number, height: number, left: number, top: number}} + * @private + */ + _makeBaseBound: function(layout) { + return snippet.extend({}, layout); + }, + + /** + * Calculate scale for calculating weight. + * @param {Array.} values - values + * @param {number} width - width of series area + * @param {number} height - height of series area + * @returns {number} + * @private + */ + _calculateScale: function(values, width, height) { + return (width * height) / calculator.sum(values); + }, + + /** + * Make base data for creating squarified bounds. + * @param {Array.} seriesItems - SeriesItems + * @param {number} width - width of series area + * @param {number} height - height of series area + * @returns {Array.<{itme: SeriesItem, weight: number}>} + * @private + */ + _makeBaseData: function(seriesItems, width, height) { + var scale = this._calculateScale(snippet.pluck(seriesItems, 'value'), width, height); + var data = snippet.map(seriesItems, function(seriesItem) { + return { + id: seriesItem.id, + weight: seriesItem.value * scale + }; + }).sort(function(a, b) { + return b.weight - a.weight; + }); + + return data; + }, + + /** + * Calculate worst aspect ratio. + * Referred function worst() in https://www.win.tue.nl/~vanwijk/stm.pdf + * @param {number} sum - sum for weights + * @param {number} min - minimum weight + * @param {number} max - maximum weight + * @param {number} baseSize - base size (width or height) + * @returns {number} + * @private + */ + _worst: function(sum, min, max, baseSize) { + var sumSquare = sum * sum; + var sizeSquare = baseSize * baseSize; + + return Math.max((sizeSquare * max) / sumSquare, sumSquare / (sizeSquare * min)); + }, + + /** + * Whether changed stack direction or not. + * @param {number} sum - sum for weights + * @param {Array.} weights - weights + * @param {number} baseSize - base size + * @param {number} newWeight - new weight + * @returns {boolean} + * @private + */ + _changedStackDirection: function(sum, weights, baseSize, newWeight) { + var min = arrayUtil.min(weights); + var max = arrayUtil.max(weights); + var beforeWorst = this._worst(sum, min, max, baseSize); + var newWorst = this._worst(sum + newWeight, Math.min(min, newWeight), Math.max(max, newWeight), baseSize); + + return newWorst >= beforeWorst; + }, + + /** + * Whether type of vertical stack or not. + * @param {{width: number, height: number}} baseBound - base bound + * @returns {boolean} + * @private + */ + _isVerticalStack: function(baseBound) { + return baseBound.height < baseBound.width; + }, + + /** + * Select base size from baseBound. + * @param {{width: number, height: number}} baseBound - base bound + * @returns {number} + * @private + */ + _selectBaseSize: function(baseBound) { + return this._isVerticalStack(baseBound) ? baseBound.height : baseBound.width; + }, + + /** + * Calculate fixed size. + * @param {number} baseSize - base size + * @param {number} sum - sum for weights + * @param {Array.<{weight: number}>} row - row + * @returns {number} + * @private + */ + _calculateFixedSize: function(baseSize, sum, row) { + var weights; + + if (!sum) { + weights = snippet.pluck(row, 'weight'); + sum = calculator.sum(weights); + } + + return sum / baseSize; + }, + + /** + * Add bounds. + * @param {number} startPosition - start position + * @param {Array.<{weight: number}>} row - row + * @param {number} fixedSize - fixed size + * @param {function} callback - callback function + * @private + */ + _addBounds: function(startPosition, row, fixedSize, callback) { + snippet.reduce([startPosition].concat(row), function(storedPosition, rowDatum) { + var dynamicSize = rowDatum.weight / fixedSize; + + callback(dynamicSize, storedPosition, rowDatum.id); + + return storedPosition + dynamicSize; + }); + }, + + /** + * Add bound. + * @param {number} left - left position + * @param {number} top - top position + * @param {number} width - width + * @param {number} height - height + * @param {string | number} id - id of seriesItem + * @private + */ + _addBound: function(left, top, width, height, id) { + this.boundMap[id] = { + left: left, + top: top, + width: width, + height: height + }; + }, + + /** + * Add bounds for type of vertical stack. + * @param {Array.<{weight: number}>} row - row + * @param {{left: number, top: number, width: number, height: number}} baseBound - base bound + * @param {number} baseSize - base size + * @param {number} sum - sum for weights of row + * @private + */ + _addBoundsForVerticalStack: function(row, baseBound, baseSize, sum) { + var self = this; + var fixedWidth = this._calculateFixedSize(baseSize, sum, row); + + this._addBounds(baseBound.top, row, fixedWidth, function(dynamicHeight, storedTop, id) { + self._addBound(baseBound.left, storedTop, fixedWidth, dynamicHeight, id); + }); + + baseBound.left += fixedWidth; + baseBound.width -= fixedWidth; + }, + + /** + * Add bounds for type of horizontal stack. + * @param {Array.<{weight: number}>} row - row + * @param {{left: number, top: number, width: number, height: number}} baseBound - base bound + * @param {number} baseSize - base size + * @param {number} sum - sum for weights of row + * @private + */ + _addBoundsForHorizontalStack: function(row, baseBound, baseSize, sum) { + var self = this; + var fixedHeight = this._calculateFixedSize(baseSize, sum, row); + + this._addBounds(baseBound.left, row, fixedHeight, function(dynamicWidth, storedLeft, id) { + self._addBound(storedLeft, baseBound.top, dynamicWidth, fixedHeight, id); + }); + + baseBound.top += fixedHeight; + baseBound.height -= fixedHeight; + }, + + /** + * Get adding bounds function. + * @param {{width: number, height: number}} baseBound - base bound + * @returns {*} + * @private + */ + _getAddingBoundsFunction: function(baseBound) { + var addBound; + + if (this._isVerticalStack(baseBound)) { + addBound = snippet.bind(this._addBoundsForVerticalStack, this); + } else { + addBound = snippet.bind(this._addBoundsForHorizontalStack, this); + } + + return addBound; + }, + + /** + * Create squarified bound map for graph rendering. + * @param {object} layout - series area layout + * @param {Array.} seriesItems - seriesItems + * @returns {object.} + */ + squarify: function(layout, seriesItems) { + var self = this; + var baseBound = this._makeBaseBound(layout); + var baseData = this._makeBaseData(seriesItems, baseBound.width, baseBound.height); + var row = []; + var baseSize, addBounds; + + this.boundMap = {}; + + snippet.forEachArray(baseData, function(datum) { + var weights = snippet.pluck(row, 'weight'); + var sum = calculator.sum(weights); + + if (row.length && self._changedStackDirection(sum, weights, baseSize, datum.weight)) { + addBounds(row, baseBound, baseSize, sum); + row = []; + } + + if (!row.length) { + baseSize = self._selectBaseSize(baseBound); + addBounds = self._getAddingBoundsFunction(baseBound); + } + + row.push(datum); + }); + + if (row.length) { + addBounds(row, baseBound, baseSize); + } + + return this.boundMap; + } + }; + + module.exports = squarifier; + + +/***/ }), +/* 97 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Boxplot chart series component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var Series = __webpack_require__(81); + var BarTypeSeriesBase = __webpack_require__(82); + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var renderUtil = __webpack_require__(7); + var snippet = __webpack_require__(6); + + var BoxplotChartSeries = snippet.defineClass(Series, /** @lends BoxplotChartSeries.prototype */ { + /** + * Boxplot chart series component. + * @constructs BoxplotChartSeries + * @private + * @extends Series + * @param {object} params parameters + * @param {object} params.model series model + * @param {object} params.options series options + * @param {object} params.theme series theme + */ + init: function() { + Series.apply(this, arguments); + + /** + * whether series label is supported + * @type {boolean} + */ + this.supportSeriesLable = false; + }, + + /** + * Make boxplot chart bound. + * @param {{ + * baseBarSize: number, + * groupSize: number, + * barSize: number, + * pointInterval: number, + * firstAdditionalPosition: number, + * basePosition: number + * }} baseData base data for making bound + * @param {{ + * baseLeft: number, + * left: number, + * plusTop: number, + * minusTop: number, + * prevStack: ?string + * }} iterationData iteration data + * @param {?boolean} isStackType whether stackType option or not. + * @param {SeriesItem} seriesItem series item + * @param {number} index index + * @returns {{ + * start: {left: number, top: number, width: number, height: number}, + * end: {left: number, top: number, width: number, height: number} + * }} + * @private + */ + _makeBoxplotChartBound: function(baseData, iterationData, isStackType, seriesItem, index) { + var boxHeight = Math.abs(baseData.baseBarSize * seriesItem.ratioDistance); + var boxStartTop = baseData.baseBarSize * (1 - seriesItem.lqRatio); + var startTop = baseData.basePosition + boxStartTop + chartConst.SERIES_EXPAND_SIZE; + var baseTopPosition = baseData.basePosition + chartConst.SERIES_EXPAND_SIZE; + var pointCount, endTop, boundLeft, outliers; + + pointCount = index; + iterationData.left = iterationData.baseLeft + (baseData.pointInterval * pointCount); + iterationData.plusTop = 0; + iterationData.minusTop = 0; + + if (seriesItem.value >= 0) { + iterationData.plusTop -= boxHeight; + endTop = startTop + iterationData.plusTop; + } else { + endTop = startTop + iterationData.minusTop; + iterationData.minusTop += boxHeight; + } + + boundLeft = iterationData.left + baseData.pointInterval - (baseData.barSize / 2); + + outliers = snippet.map(seriesItem.outliers, function(outlier) { + return { + top: (baseData.baseBarSize * (1 - outlier.ratio)) + baseTopPosition, + left: boundLeft + (baseData.barSize / 2) + }; + }); + + return { + start: { + top: startTop, + left: boundLeft, + width: baseData.barSize, + height: 0 + }, + end: { + top: endTop, + left: boundLeft, + width: baseData.barSize, + height: boxHeight + }, + min: { + top: (baseData.baseBarSize * (1 - seriesItem.minRatio)) + baseTopPosition, + left: boundLeft, + width: baseData.barSize, + height: 0 + }, + max: { + top: (baseData.baseBarSize * (1 - seriesItem.maxRatio)) + baseTopPosition, + left: boundLeft, + width: baseData.barSize, + height: 0 + }, + median: { + top: (baseData.baseBarSize * (1 - seriesItem.medianRatio)) + baseTopPosition, + left: boundLeft, + width: baseData.barSize, + height: 0 + }, + outliers: outliers + }; + }, + + /** + * Make bounds of boxplot chart. + * @returns {Array.>} bounds + * @private + */ + _makeBounds: function() { + var self = this; + var seriesDataModel = this._getSeriesDataModel(); + var isStackType = predicate.isValidStackOption(this.options.stackType); + var dimension = this.layout.dimension; + var baseData = this._makeBaseDataForMakingBound(dimension.width, dimension.height); + + return seriesDataModel.map(function(seriesGroup, groupIndex) { + var baseLeft = (groupIndex * baseData.groupSize) + self.layout.position.left; + var iterationData = { + baseLeft: baseLeft, + left: baseLeft, + plusTop: 0, + minusTop: 0, + prevStack: null + }; + var iteratee = snippet.bind(self._makeBoxplotChartBound, self, baseData, iterationData, isStackType); + + return seriesGroup.map(iteratee); + }); + }, + + /** + * Calculate left position of sum label. + * @param {{left: number, top: number}} bound bound + * @param {string} formattedSum formatted sum. + * @returns {number} left position value + * @private + */ + _calculateLeftPositionOfSumLabel: function(bound, formattedSum) { + var labelWidth = renderUtil.getRenderedLabelWidth(formattedSum, this.theme.label); + + return bound.left + ((bound.width - labelWidth + chartConst.TEXT_PADDING) / 2); + } + }); + + BarTypeSeriesBase.mixin(BoxplotChartSeries); + + function boxplotSeriesFactory(params) { + var libType = params.chartOptions.libType; + var chartTheme = params.chartTheme; + + params.libType = libType; + params.chartType = 'boxplot'; + params.chartBackground = chartTheme.chart.background; + + return new BoxplotChartSeries(params); + } + + boxplotSeriesFactory.componentType = 'series'; + boxplotSeriesFactory.BoxplotChartSeries = BoxplotChartSeries; + + module.exports = boxplotSeriesFactory; + + +/***/ }), +/* 98 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Bullet chart series component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var Series = __webpack_require__(81); + var renderUtil = __webpack_require__(7); + var chartConst = __webpack_require__(8); + var snippet = __webpack_require__(6); + + var BulletChartSeries = snippet.defineClass(Series, /** @lends BulletChartSeries.prototype */ { + /** + * Bullet chart series component. + * @constructs BulletChartSeries + * @private + * @extends Series + * @param {object} params series initialization data + */ + init: function(params) { + Series.call(this, params); + + /** + * true if graph stratches vertically + * false if graph stratches horizontally + * @type {boolean} + */ + this.isVertical = params.isVertical; + }, + + /** + * Create data for rendering series + * @returns {object} - data for rendering series + * @override + * @private + */ + _makeSeriesData: function() { + var groupBounds = this._makeBounds(); + + return { + groupBounds: groupBounds, + seriesDataModel: this._getSeriesDataModel(), + isVertical: this.isVertical, + isAvailable: function() { + return groupBounds && groupBounds.length > 0; + } + }; + }, + + /** + * Create bounds data + * @returns {Array.} - bound data of bullet graph components + * @private + */ + _makeBounds: function() { + var self = this; + var seriesDataModel = this._getSeriesDataModel(); + var baseData = this._makeBaseDataForMakingBound(); + var iterationData = { + renderedItemCount: 0, + top: baseData.categoryAxisTop, + left: baseData.categoryAxisLeft + }; + + return seriesDataModel.map(function(seriesGroup) { + var iteratee = snippet.bind(self._makeBulletChartBound, self, baseData, iterationData); + var bounds = seriesGroup.map(iteratee); + + self._updateIterationData(iterationData, baseData.itemWidth); + + return bounds; + }); + }, + + /** + * prepare a base data before making a bound + * @returns {object} - base data + * @private + */ + _makeBaseDataForMakingBound: function() { + var groupCount = this._getSeriesDataModel().getGroupCount(); + var dimension = this.layout.dimension; + var width = dimension.width; + var height = dimension.height; + var position = this.layout.position; + var categoryAxisTop = position.top; + var categoryAxisLeft = position.left; + var categoryAxisWidth, valueAxisWidth, itemWidth; + + if (this.isVertical) { + categoryAxisTop += height; + categoryAxisWidth = width; + valueAxisWidth = height; + } else { + categoryAxisWidth = height; + valueAxisWidth = width; + } + + itemWidth = categoryAxisWidth / groupCount; + + return { + categoryAxisTop: categoryAxisTop, + categoryAxisLeft: categoryAxisLeft, + categoryAxisWidth: categoryAxisWidth, + valueAxisWidth: valueAxisWidth, + itemWidth: itemWidth + }; + }, + + /** + * Create a bullet chart bound before making a base data + * @param {object} baseData - base data for making a tooltip + * @param {object} iterationData - increasing data while generating a graph data: index of item, graph position + * @param {object} item - series item + * @returns {Bound} - bullet graph bound + * @private + */ + _makeBulletChartBound: function(baseData, iterationData, item) { + var type = item.type; + var bound; + + if (type === chartConst.BULLET_TYPE_ACTUAL) { + bound = this._makeBarBound(item, chartConst.BULLET_ACTUAL_HEIGHT_RATIO, baseData, iterationData); + } else if (type === chartConst.BULLET_TYPE_RANGE) { + bound = this._makeBarBound(item, chartConst.BULLET_RANGES_HEIGHT_RATIO, baseData, iterationData); + } else if (type === chartConst.BULLET_TYPE_MARKER) { + bound = this._makeLineBound(item, chartConst.BULLET_MARKERS_HEIGHT_RATIO, baseData, iterationData); + } + + bound.type = type; + + return bound; + }, + + /** + * Create bar type bound data + * @param {object} model - series item data + * @param {number} widthRatio - thickness compare to graph area + * @param {object} baseData - base data needed for making a bar bound + * @param {object} iterationData - data for setting up position + * @returns {object} - bar type bound data + * @private + */ + _makeBarBound: function(model, widthRatio, baseData, iterationData) { + var barWidth = baseData.itemWidth * widthRatio; + var barHeight = baseData.valueAxisWidth * model.ratioDistance; + var barEndHeight = baseData.valueAxisWidth * model.endRatio; + var bound; + + if (this.isVertical) { + bound = this._makeVerticalBarBound(iterationData, baseData, barWidth, barHeight, barEndHeight); + } else { + bound = this._makeHorizontalBarBound(iterationData, baseData, barWidth, barHeight, barEndHeight); + } + + return bound; + }, + + /** + * create a bound of bar type component, when it is virtical chart + * @param {object} iterationData - increasing data while generating a graph data: graph position + * @param {object} baseData - base data + * @param {number} barWidth - width of bar + * @param {number} barHeight - bar size from start position to end position + * @param {number} barEndHeight - bar size from axis start point to end position + * @returns {object} - bound data + * @private + */ + _makeVerticalBarBound: function(iterationData, baseData, barWidth, barHeight, barEndHeight) { + return { + top: iterationData.top - barEndHeight, + left: iterationData.left + ((baseData.itemWidth - barWidth) / 2), + width: barWidth, + height: barHeight + }; + }, + + /** + * create a bound of bar type component, when it is a horizontal chart + * @param {object} iterationData - increasing data while generating a graph data: graph position + * @param {object} baseData - base data + * @param {number} barWidth - width of bar + * @param {number} barHeight - bar size from start position to end position + * @param {number} barEndHeight - bar size from axis start point to end position + * @returns {object} - bound data + * @private + */ + _makeHorizontalBarBound: function(iterationData, baseData, barWidth, barHeight, barEndHeight) { + return { + top: iterationData.top + ((baseData.itemWidth - barWidth) / 2), + left: iterationData.left + barEndHeight - barHeight, + width: barHeight, + height: barWidth + }; + }, + + /** + * Create line type bound data + * @param {object} model - series item data + * @param {number} widthRatio - graph thickness compare to graph area + * @param {object} baseData - base data needed for making a line bound + * @param {object} iterationData - data for setting up position + * @returns {object} - line type bound data + * @private + */ + _makeLineBound: function(model, widthRatio, baseData, iterationData) { + var lineWidth = baseData.itemWidth * widthRatio; + var endHeight = baseData.valueAxisWidth * model.endRatio; + var width = chartConst.BULLET_MARKER_DETECT_PADDING; + var height = chartConst.BULLET_MARKER_DETECT_PADDING; + var top, left; + + if (this.isVertical) { + top = iterationData.top - endHeight; + left = iterationData.left + ((baseData.itemWidth - lineWidth) / 2); + width = lineWidth; + } else { + top = iterationData.top + ((baseData.itemWidth - lineWidth) / 2); + left = iterationData.left + endHeight; + height = lineWidth; + } + + return { + top: top, + left: left, + length: lineWidth, + width: width, + height: height + }; + }, + + /** + * update iterationData after making a graph bound + * @param {object} iterationData - iteration data + * @param {number} itemWidth - size of category axis area + * @private + */ + _updateIterationData: function(iterationData, itemWidth) { + iterationData.renderedItemCount += 1; + + if (this.isVertical) { + iterationData.left += itemWidth; + } else { + iterationData.top += itemWidth; + } + }, + + /** + * Render series area. + * @param {object} paper - raphael object + * @param {function} funcRenderGraph - function for graph rendering + * @private + */ + _renderSeriesArea: function(paper, funcRenderGraph) { + Series.prototype._renderSeriesArea.call(this, paper, funcRenderGraph); + + this.dataProcessor.setGraphColors(this.graphRenderer.getGraphColors()); + }, + + /** + * Render series labels + * Series labels are shown only when `options.series.showLabel` is enabled + * @param {object} paper paper + * @returns {Array.} - svg label sets + * @override + * @private + */ + _renderSeriesLabel: function(paper) { + var theme = this.theme.label; + var seriesDataModel = this._getSeriesDataModel(); + var groupLabels = this._getLabelTexts(seriesDataModel); + var positionsSet = this._calculateLabelPositions(seriesDataModel, theme); + + return this.graphRenderer.renderSeriesLabel(paper, positionsSet, groupLabels, theme); + }, + + /** + * Get label texts needed for enabling `options.series.showLabel` option + * @param {object} seriesDataModel - seriesDataModel + * @returns {Array.} - actual data and marker data label + * @private + */ + _getLabelTexts: function(seriesDataModel) { + return seriesDataModel.map(function(seriesGroup) { + var seriesLabels = []; + + seriesGroup.each(function(seriesDatum) { + if (seriesDatum.type !== chartConst.BULLET_TYPE_RANGE) { + seriesLabels.push(seriesDatum.endLabel); + } + }); + + return seriesLabels; + }); + }, + + /** + * calculate a label position + * @param {object} seriesDataModel - bullet chart's series data model + * @param {object} theme - style needed to calculate the size of the text + * @returns {Array.} - position of label text + * @private + */ + _calculateLabelPositions: function(seriesDataModel, theme) { + var serieses = this.seriesData.groupBounds; + var labelHeight = renderUtil.getRenderedLabelHeight(chartConst.MAX_HEIGHT_WORD, theme); + + return snippet.map(serieses, function(series) { + var bounds = []; + + snippet.forEach(series, function(item) { + if (item.type !== chartConst.BULLET_TYPE_RANGE) { + bounds.push(this._makePositionByBound(item, labelHeight)); + } + }, this); + + return bounds; + }, this); + }, + + /** + * make position top, left data using bound data and label height + * @param {object} bound - bound data + * @param {number} labelHeight - label's height + * @returns {object} - position top, left + * @private + */ + _makePositionByBound: function(bound, labelHeight) { + var boundTop = bound.top; + var boundLeft = bound.left; + var width, height; + var position = {}; + + if (this.isVertical) { + width = bound.width || bound.length; + position.top = boundTop - labelHeight; + position.left = boundLeft + (width / 2); + } else { + width = bound.width || 0; + height = bound.height || bound.length; + position.top = boundTop + (height / 2); + position.left = boundLeft + 5 + (width || 0); + } + + return position; + } + }); + + /** + * BulletChartSeries factory function + * @param {object} params - series initialization data + * @returns {BulletChartSeries} - bullet chart series + */ + function bulletSeriesFactory(params) { + var chartTheme = params.chartTheme; + + params.libType = params.chartOptions.libType; + params.chartType = 'bullet'; + params.chartBackground = chartTheme.chart.background; + + return new BulletChartSeries(params); + } + + bulletSeriesFactory.componentType = 'series'; + bulletSeriesFactory.BulletChartSeries = BulletChartSeries; + + module.exports = bulletSeriesFactory; + + +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Zoom component. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + var IS_MSIE_VERSION_LTE_THAN_8 = snippet.browser.msie && snippet.browser.version <= 8; + + var seriesTemplate = __webpack_require__(100); + var chartConst = __webpack_require__(8); + var dom = __webpack_require__(9); + var renderUtil = __webpack_require__(7); + var eventListener = __webpack_require__(55); + + var Zoom = snippet.defineClass(/** @lends Zoom.prototype */{ + /** + * zoom component className + * @type {string} + */ + className: 'tui-chart-zoom-area', + /** + * Zoom component. + * @param {{eventBus: object}} params - parameters + * @constructs Zoom + * @private + */ + init: function(params) { + /** + * event bus for transmitting message + * @type {object} + */ + this.eventBus = params.eventBus; + + /** + * Magnification. + * @type {number} + */ + this.magn = 1; + + /** + * Stacked wheelDelta. + * @type {number} + */ + this.stackedWheelDelta = 0; + + this.drawingType = chartConst.COMPONENT_TYPE_DOM; + + this._attachToEventBus(); + }, + + /** + * Attach to event bus. + * @private + */ + _attachToEventBus: function() { + this.eventBus.on('wheel', this.onWheel, this); + }, + + /** + * Render. + * @param {{positionMap: {series: {left: number, top: number}}}} data - data for rendering + * @returns {HTMLElement} zoom container + */ + render: function(data) { + var container; + + if (!IS_MSIE_VERSION_LTE_THAN_8) { + container = dom.create('DIV', this.className); + + container.innerHTML += seriesTemplate.ZOOM_BUTTONS; + renderUtil.renderPosition(container, data.positionMap.series); + this._attachEvent(container); + } + + return container; + }, + + /** + * Find button element. + * @param {HTMLElement} target target element. + * @returns {?HTMLElement} button element + * @private + */ + _findBtnElement: function(target) { + var btnClassName = 'tui-chart-zoom-btn', + btnElement = target; + + if (!dom.hasClass(target, btnClassName)) { + btnElement = dom.findParentByClass(target, btnClassName); + } + + return btnElement; + }, + + /** + * Zoom + * @param {number} magn magnification + * @param {?{left: number, top: number}} position mouse position + * @private + */ + _zoom: function(magn, position) { + this.eventBus.fire('zoomMap', magn, position); + }, + + /** + * On click. + * @param {MouseEvent} e mouse event + * @returns {?boolean} prevent default for ie + * @private + */ + _onClick: function(e) { + var target = e.target || e.srcElement; + var btnElement = this._findBtnElement(target); + var zoomDirection = btnElement.getAttribute('data-magn'); + var magn = this._calculateMagn(zoomDirection); + + if (magn > 5) { + this.magn = 5; + } else if (magn < 1) { + this.magn = 1; + } else if (magn >= 1) { + this._zoom(magn); + } + + if (e.preventDefault) { + e.preventDefault(); + } + + return false; + }, + + /** + * Attach event. + * @param {HTMLElement} target target element + * @private + */ + _attachEvent: function(target) { + eventListener.on(target, 'click', this._onClick, this); + }, + + /** + * Calculate magnification from zoomDirection. + * @param {number} zoomDirection zoomDirection (positive is zoomIn) + * @returns {number} magnification + * @private + */ + _calculateMagn: function(zoomDirection) { + if (zoomDirection > 0) { + this.magn += 0.1; + } else if (zoomDirection < 0) { + this.magn -= 0.1; + } + + return this.magn; + }, + + /** + * On wheel. + * @param {number} wheelDelta wheelDelta + * @param {{left: number, top: number}} position mouse position + */ + onWheel: function(wheelDelta, position) { + var magn = this._calculateMagn(wheelDelta); + + if (magn > 5) { + this.magn = 5; + } else if (magn < 1) { + this.magn = 1; + } else if (magn >= 1) { + this._zoom(magn, position); + } + } + }); + + function zoomFactory(params) { + return new Zoom(params); + } + + zoomFactory.componentType = 'zoom'; + + module.exports = zoomFactory; + + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview This is templates of series. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var templateMaker = __webpack_require__(65); + + var htmls = { + HTML_SERIES_LABEL: '
' + + '{{ label }}
', + TEXT_CSS_TEXT: 'left:{{ left }}px;top:{{ top }}px;font-family:{{ fontFamily }};' + + 'font-size:{{ fontSize }}px;font-weight:{{ fontWeight }}{{opacity}}', + TEXT_CSS_TEXT_FOR_LINE_TYPE: 'left:{{ left }}%;top:{{ top }}%;font-family:{{ fontFamily }};' + + 'font-size:{{ fontSize }}px;font-weight:{{ fontWeight }}{{opacity}}', + HTML_ZOOM_BUTTONS: '' + + '
' + + '
', + HTML_SERIES_BLOCK: '
{{ label }}
' + }; + + module.exports = { + tplSeriesLabel: templateMaker.template(htmls.HTML_SERIES_LABEL), + tplCssText: templateMaker.template(htmls.TEXT_CSS_TEXT), + tplCssTextForLineType: templateMaker.template(htmls.TEXT_CSS_TEXT_FOR_LINE_TYPE), + ZOOM_BUTTONS: htmls.HTML_ZOOM_BUTTONS, + tplSeriesBlock: templateMaker.template(htmls.HTML_SERIES_BLOCK) + }; + + +/***/ }), +/* 101 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview DataProcessor process rawData. + * rawData.categories --> categories + * rawData.series --> SeriesDataModel, legendLabels, legendData + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var DataProcessorBase = __webpack_require__(102); + var SeriesDataModel = __webpack_require__(103); + var SeriesDataModelForBoxplot = __webpack_require__(107); + var SeriesDataModelForBullet = __webpack_require__(109); + var SeriesDataModelForTreemap = __webpack_require__(110); + var SeriesGroup = __webpack_require__(104); + var rawDataHandler = __webpack_require__(31); + var predicate = __webpack_require__(11); + var renderUtil = __webpack_require__(7); + var calculator = __webpack_require__(45); + var objectUtil = __webpack_require__(36); + var snippet = __webpack_require__(6); + + var concat = Array.prototype.concat; + + var isUndefined = snippet.isUndefined; + + /* + * Raw series datum. + * @typedef {{name: ?string, data: Array., stack: ?string}} rawSeriesDatum + */ + + /* + * Raw series data. + * @typedef {Array.} rawSeriesData + */ + + /* + * Raw data by user. + * @typedef {{ + * categories: ?Array., + * series: (rawSeriesData|{line: ?rawSeriesData, column: ?rawSeriesData}) + * }} rawData + */ + + /* + * SeriesDataModel is base model for drawing graph of chart series area, + * and create from rawSeriesData by user, + * SeriesDataModel.groups has SeriesGroups. + */ + + /* + * SeriesGroup is a element of SeriesDataModel.groups. + * SeriesGroup.items has SeriesItem. + */ + + var DataProcessor = snippet.defineClass(DataProcessorBase, /** @lends DataProcessor.prototype */{ + /** + * Data processor. + * @constructs DataProcessor + * @private + * @param {rawData} rawData raw data + * @param {string} chartType chart type + * @param {object} options options + * @param {Array.} seriesTypes chart types + */ + init: function(rawData, chartType, options, seriesTypes) { + /** + * original raw data. + * @type {{categories: ?Array., series: Array.}} + */ + this.originalRawData = objectUtil.deepCopy(rawData); + + /** + * chart type + * @type {string} + */ + this.chartType = chartType; + + /** + * chart options + * @type {Object} + */ + this.options = options; + + /** + * seriesTypes is sorted chart types for rendering series area of combo chart. + * @type {Array.} + */ + this.seriesTypes = seriesTypes; + + /** + * legend data for rendering legend of group tooltip + * @type {Array.<{chartType: string, label: string}>} + */ + this.originalLegendData = null; + + /** + * select legend index + * @type {number} + */ + this.selectLegendIndex = null; + + /** + * dynamic data array for adding data. + * @type {Array.<{category: string | number, values: Array.}>} + */ + this.dynamicData = []; + + this.defaultValues = [0, 500]; + + this.initData(rawData); + this.initZoomedRawData(); + this.baseInit(); + }, + + /** + * Get original raw data. + * @returns {rawData} raw data + */ + getOriginalRawData: function() { + return objectUtil.deepCopy(this.originalRawData); + }, + + /** + * Get zoomed raw data. + * @returns {*|null} + */ + getZoomedRawData: function() { + var zoomedRawData = this.zoomedRawData; + + if (zoomedRawData) { + zoomedRawData = objectUtil.deepCopy(zoomedRawData); + } else { + zoomedRawData = this.getOriginalRawData(); + } + + return zoomedRawData; + }, + + /** + * Filter seriesData by index range. + * @param {Array.<{data: Array}>} seriesData - series data + * @param {number} startIndex - start index + * @param {number} endIndex - end index + * @returns {Array.>} + * @private + */ + _filterSeriesDataByIndexRange: function(seriesData, startIndex, endIndex) { + snippet.forEachArray(seriesData, function(seriesDatum) { + seriesDatum.data = seriesDatum.data.slice(startIndex, endIndex + 1); + }); + + return seriesData; + }, + + /** + * Filter raw data by index range. + * @param {{series: Array., categories: Array.}} rawData - raw data + * @param {Array.} indexRange - index range for zoom + * @returns {*} + * @private + */ + _filterRawDataByIndexRange: function(rawData, indexRange) { + var self = this; + var startIndex = indexRange[0]; + var endIndex = indexRange[1]; + + snippet.forEach(rawData.series, function(seriesDataSet, seriesType) { + rawData.series[seriesType] = self._filterSeriesDataByIndexRange(seriesDataSet, startIndex, endIndex); + }); + + if (rawData.categories) { + rawData.categories = rawData.categories.slice(startIndex, endIndex + 1); + } + + return rawData; + }, + + /** + * Update raw data for zoom + * @param {Array.} indexRange - index range for zoom + */ + updateRawDataForZoom: function(indexRange) { + var rawData = this.getRawData(); + var zoomedRawData = this.getZoomedRawData(); + + this.zoomedRawData = this._filterRawDataByIndexRange(zoomedRawData, indexRange); + rawData = this._filterRawDataByIndexRange(rawData, indexRange); + this.initData(rawData); + }, + + /** + * Init zoomed raw data. + */ + initZoomedRawData: function() { + this.zoomedRawData = null; + }, + + /** + * Initialize data. + * @param {rawData} rawData raw data + */ + initData: function(rawData) { + /** + * raw data + * @type {rawData} + */ + this.rawData = rawData; + + /** + * categoriesMap + * @type {null|object} + */ + this.categoriesMap = null; + + /** + * categories isDatetype true or false + * @type {null|object} + */ + this.categoriesIsDateTime = {}; + + /** + * stacks + * @type {Array.} + */ + this.stacks = null; + + /** + * seriesDataModel map + * @type {object.} + */ + this.seriesDataModelMap = {}; + + /** + * SeriesGroups + * @type {Array.} + */ + this.seriesGroups = null; + + /** + * map of values of SeriesItems + * @type {Object.>} + */ + this.valuesMap = {}; + + /** + * legend labels for rendering legend area + * @type {{column: Array., line: Array. | Array.}} + */ + this.legendLabels = null; + + /** + * legend data for rendering legend + * @type {Array.<{chartType: string, label: string}>} + */ + this.legendData = null; + + /** + * multiline categories + * @type {Array.} + */ + this.multilineCategories = null; + + /** + * whether coordinate type data or not + * @type {null|boolean} + */ + this.coordinateType = null; + }, + + /** + * Get raw data. + * @returns {rawData} + */ + getRawData: function() { + return this.rawData; + }, + + /** + * Find chart type from series name. + * @param {string} seriesType - series name + * @returns {*} + */ + findChartType: function(seriesType) { + return rawDataHandler.findChartType(this.rawData.seriesAlias, seriesType); + }, + + /** + * Escape categories. + * @param {Array.} categories - cetegories + * @returns {*|Array.|Array} + * @private + */ + _escapeCategories: function(categories) { + return snippet.map(categories, function(category) { + return snippet.encodeHTMLEntity(String(category)); + }); + }, + + /** + * Map categories. + * @param {Array.} categories - categories + * @param {string} [axisName] - axis name like 'x' or 'y' + * @returns {Array.} + * @private + */ + _mapCategories: function(categories, axisName) { + var axisType = axisName + 'Axis'; + var options = this.options[axisType] || {}; + var isDateTime = false; + + if (snippet.isArray(options)) { + isDateTime = snippet.filter(options, function(option) { + return option.type && predicate.isDatetimeType(option.type); + }); + } else { + isDateTime = options.type && predicate.isDatetimeType(options.type); + } + if (isDateTime) { + categories = snippet.map(categories, function(value) { + var date = this.chageDatetypeToTimestamp(value); + + return date; + }, this); + } else { + categories = this._escapeCategories(categories); + } + + this.categoriesIsDateTime[axisName] = isDateTime; + + return categories; + }, + + /** + * Process categories. + * @param {string} type - category type (x or y) + * @returns {null | Array.} processed categories + * @private + */ + _processCategories: function(type) { + var rawCategories = this.rawData.categories; + var categoriesMap = {}; + + if (snippet.isArray(rawCategories)) { + categoriesMap[type] = this._mapCategories(rawCategories, type); + } else if (rawCategories) { + if (rawCategories.x) { + categoriesMap.x = this._mapCategories(rawCategories.x, 'x'); + } + + if (rawCategories.y) { + categoriesMap.y = this._mapCategories(rawCategories.y, 'y').reverse(); + } + } + + return categoriesMap; + }, + + /** + * Get Categories + * @param {boolean} isVertical - whether vertical or not + * @returns {Array.}} + */ + getCategories: function(isVertical) { + var type = isVertical ? 'y' : 'x'; + var foundCategories = []; + + if (!this.categoriesMap) { + this.categoriesMap = this._processCategories(type); + } + + if (snippet.isExisty(isVertical)) { + foundCategories = this.categoriesMap[type] || []; + } else { + snippet.forEach(this.categoriesMap, function(categories) { + foundCategories = categories; + + return false; + }); + } + + return foundCategories; + }, + + /** + * Get Category date type + * @param {boolean} isVertical - whether vertical or not + * @returns {boolean} + */ + getCategorieDateType: function(isVertical) { + var type = isVertical ? 'y' : 'x'; + + return this.categoriesIsDateTime[type]; + }, + + /** + * value to timestamp of datetype category + * @param {string} dateTypeValue - datetype category value + * @returns {boolean} + */ + chageDatetypeToTimestamp: function(dateTypeValue) { + var date = new Date(dateTypeValue); + if (!(date.getTime() > 0)) { + date = new Date(parseInt(dateTypeValue, 10)); + } + + return date.getTime() || dateTypeValue; + }, + + /** + * Get category count. + * @param {boolean} isVertical - whether vertical or not + * @returns {*} + */ + getCategoryCount: function(isVertical) { + var categories = this.getCategories(isVertical); + + return categories ? categories.length : 0; + }, + + /** + * Whether has categories or not. + * @param {boolean} isVertical - whether vertical or not + * @returns {boolean} + */ + hasCategories: function(isVertical) { + return !!this.getCategoryCount(isVertical); + }, + + /** + * Whether count of x data grater than count of y data. + * @param {string} chartType - chart type + * @returns {boolean} + */ + isXCountGreaterThanYCount: function(chartType) { + var seriesDataModel = this.getSeriesDataModel(chartType); + + return seriesDataModel.isXCountGreaterThanYCount(); + }, + + /** + * Whether has x value or not. + * @param {string} chartType - chart type + * @returns {boolean} + */ + hasXValue: function(chartType) { + var hasVerticalCategory = this.isXCountGreaterThanYCount(chartType); + + return !this.hasCategories(hasVerticalCategory) || hasVerticalCategory; + }, + + /** + * Whether has y value or not. + * @param {string} chartType - chart type + * @returns {boolean} + */ + hasYValue: function(chartType) { + var hasVerticalCategory = this.isXCountGreaterThanYCount(chartType); + + return !this.hasCategories(hasVerticalCategory) || !hasVerticalCategory; + }, + + /** + * Get category. + * @param {number} index index + * @param {boolean} isVertical - whether vertical or not + * @returns {string} category + */ + getCategory: function(index, isVertical) { + return this.getCategories(isVertical)[index]; + }, + + /** + * Find category index by value + * @param {string} value - category value + * @returns {null|number} + */ + findCategoryIndex: function(value) { + var categories = this.getCategories(); + var isDateType = this.getCategorieDateType(); + var foundIndex = null; + + snippet.forEachArray(categories, function(category, index) { + if (isDateType) { + value = this.chageDatetypeToTimestamp(value); + } + + if (category === value) { + foundIndex = index; + } + + return snippet.isNull(foundIndex); + }, this); + + return foundIndex; + }, + + /** + * @param {string} value - category + * @returns {number} - found: category index, not found: -1 + */ + findAbsoluteCategoryIndex: function(value) { + var originalCategories = this.originalRawData ? this.originalRawData.categories : null; + var index = -1; + + if (!originalCategories) { + return index; + } + + snippet.forEach(originalCategories, function(category, categoryIndex) { + var found = category === value; + if (found) { + index = categoryIndex; + } + + return !found; + }); + + return index; + }, + + /** + * Get tooltip category. + * @param {number} categoryIndex - category index + * @param {boolean} isVertical - whether vertical category or not + * @returns {string} + * @private + */ + _getTooltipCategory: function(categoryIndex, isVertical) { + var category = this.getCategory(categoryIndex, isVertical); + var axisType = isVertical ? 'yAxis' : 'xAxis'; + var axisOption = this.options[axisType] || {}; + var tooltipOption = this.options.tooltip || {}; + + if (predicate.isDatetimeType(tooltipOption.type)) { + category = renderUtil.formatDate(category, tooltipOption.dateFormat); + } else if (predicate.isDatetimeType(axisOption.type)) { + category = renderUtil.formatDate(category, axisOption.dateFormat); + } + + return category; + }, + + /** + * Make category for tooltip. + * @param {number} categoryIndex - category index + * @param {number} oppositeIndex - opposite index + * @param {boolean} isVerticalChart - whether vertical chart or not + * @returns {string} + */ + makeTooltipCategory: function(categoryIndex, oppositeIndex, isVerticalChart) { + var isVertical = !isVerticalChart; + var category = this._getTooltipCategory(categoryIndex, isVertical); + var categoryCount = this.getCategoryCount(!isVertical); + + if (categoryCount) { + category += ', ' + this._getTooltipCategory(categoryCount - oppositeIndex - 1, !isVertical); + } + + return category; + }, + + /** + * Get stacks from raw series data. + * @param {string} seriesType seriesType to count stacks + * @returns {Array.} + */ + getStacks: function(seriesType) { + if (!this.stacks) { + this.stacks = rawDataHandler.pickStacks(this.rawData.series[seriesType]); + } + + return this.stacks; + }, + + /** + * Get stack count. + * @param {string} seriesType - series type + * @returns {Number} + */ + getStackCount: function(seriesType) { + return this.getStacks(seriesType).length; + }, + + /** + * Find stack index from stack list by stack value. + * @param {string} stack stack + * @returns {number} + */ + findStackIndex: function(stack) { + return snippet.inArray(stack, this.getStacks()); + }, + + /** + * Whether coordinate type or not. + * @returns {boolean} + */ + isCoordinateType: function() { + var chartType = this.chartType; + var coordinateType = this.coordinateType; + + if (!snippet.isExisty(coordinateType)) { + coordinateType = predicate.isCoordinateTypeChart(chartType); + coordinateType = coordinateType || predicate.isLineScatterComboChart(chartType, this.seriesTypes); + coordinateType = coordinateType || (predicate.isLineTypeChart(chartType) && !this.hasCategories()); + this.coordinateType = coordinateType; + } + + return coordinateType; + }, + + /** + * Get SeriesDataModel. + * @param {string} seriesType - series name + * @returns {SeriesDataModel} + */ + getSeriesDataModel: function(seriesType) { + var rawSeriesData, chartType, SeriesDataModelClass; + + if (!this.seriesDataModelMap[seriesType]) { + chartType = this.findChartType(seriesType); + rawSeriesData = this.rawData.series[seriesType]; + + if (predicate.isBoxplotChart(this.chartType)) { + SeriesDataModelClass = SeriesDataModelForBoxplot; + } else if (predicate.isTreemapChart(this.chartType)) { + SeriesDataModelClass = SeriesDataModelForTreemap; + } else if (predicate.isBulletChart(this.chartType)) { + SeriesDataModelClass = SeriesDataModelForBullet; + } else { + SeriesDataModelClass = SeriesDataModel; + } + + this.seriesDataModelMap[seriesType] = new SeriesDataModelClass(rawSeriesData, chartType, + this.options, this.getFormatFunctions(), this.isCoordinateType()); + } + + return this.seriesDataModelMap[seriesType]; + }, + + /** + * Get group count. + * @param {string} chartType chart type + * @returns {number} + */ + getGroupCount: function(chartType) { + return this.getSeriesDataModel(chartType).getGroupCount(); + }, + + /** + * Push category. + * @param {string} category - category + * @private + */ + _pushCategory: function(category) { + if (this.rawData.categories) { + this.rawData.categories.push(category); + this.originalRawData.categories.push(category); + } + }, + + /** + * Shift category. + * @private + */ + _shiftCategory: function() { + if (this.rawData.categories) { + this.rawData.categories.shift(); + this.originalRawData.categories.shift(); + } + }, + + /** + * Find raw series datum by name. + * @param {string} name - legend name + * @param {string} [seriesType] - series name + * @returns {object} + * @private + */ + _findRawSeriesDatumByName: function(name, seriesType) { + var foundSeriesDatum = null; + var seriesData = this.rawData.series[seriesType]; + + snippet.forEachArray(seriesData, function(seriesDatum) { + var isEqual = seriesDatum.name === name; + + if (isEqual) { + foundSeriesDatum = seriesDatum; + } + + return !isEqual; + }); + + return foundSeriesDatum; + }, + + /** + * Push value to data property of series. + * @param {{name: string, data: Array}} seriesDatum - series datum + * @param {Array.|{x: number, y: number, r: number}|number} value - value + * @param {string} seriesType - sereis name + * @private + */ + _pushValue: function(seriesDatum, value, seriesType) { + var rawSeriesDatum = this._findRawSeriesDatumByName(seriesDatum.name, seriesType); + + seriesDatum.data.push(value); + + if (rawSeriesDatum) { + rawSeriesDatum.data.push(value); + } + }, + + /** + * Push values to series of originalRawData and series of rawData. + * @param {Array.<{name: string, data: Array}>} seriesData - series data + * @param {Array} values - values + * @param {string} [seriesType] - series name + * @private + */ + _pushValues: function(seriesData, values, seriesType) { + var self = this; + + snippet.forEachArray(seriesData, function(seriesDatum, index) { + self._pushValue(seriesDatum, values[index], seriesType); + }); + }, + + /** + * Push series data. + * @param {Array.} values - values + * @private + */ + _pushSeriesData: function(values) { + var self = this; + var temp; + + if (this.chartType !== 'combo' && snippet.isArray(values)) { + temp = values; + values = {}; + values[this.chartType] = temp; + } + + snippet.forEach(this.originalRawData.series, function(seriesData, seriesType) { + self._pushValues(seriesData, values[seriesType], seriesType); + }); + }, + + /** + * Shift values. + * @param {Array.<{name: string, data: Array}>} seriesData - series data + * @param {string} seriesType - series name + * @private + */ + _shiftValues: function(seriesData, seriesType) { + var self = this; + + snippet.forEachArray(seriesData, function(seriesDatum) { + var rawSeriesDatum = self._findRawSeriesDatumByName(seriesDatum.name, seriesType); + + seriesDatum.data.shift(); + if (rawSeriesDatum) { + rawSeriesDatum.data.shift(); + } + }); + }, + + /** + * Shift series data. + * @private + */ + _shiftSeriesData: function() { + var self = this; + + snippet.forEach(this.originalRawData.series, function(seriesData, seriesType) { + self._shiftValues(seriesData, seriesType); + }); + }, + + /** + * Add dynamic data. + * @param {string} category - category + * @param {Array.} values - values + */ + addDynamicData: function(category, values) { + this.dynamicData.push({ + category: category, + values: values + }); + }, + + /** + * Push dynamic data. + * @param {{category: string, values: Array.}} data - adding data + * @private + */ + _pushDynamicData: function(data) { + this._pushCategory(data.category); + this._pushSeriesData(data.values); + }, + + /** + * Push dynamic data for coordinate type. + * @param {object.|object.>} data - adding data + * @private + */ + _pushDynamicDataForCoordinateType: function(data) { + var self = this; + snippet.forEachArray(this.originalRawData.series, function(seriesDatum) { + self._pushValue(seriesDatum, data[seriesDatum.name]); + }); + }, + + /** + * Add data from dynamic data. + * @returns {boolean} + */ + addDataFromDynamicData: function() { + var datum = this.dynamicData.shift(); + + if (datum) { + if (this.isCoordinateType()) { + this._pushDynamicDataForCoordinateType(datum.values); + } else { + this._pushDynamicData(datum); + } + + this.initData(this.rawData); + } + + return !!datum; + }, + + /** + * Shift data. + */ + shiftData: function() { + this._shiftCategory(); + this._shiftSeriesData(); + + this.initData(this.rawData); + }, + + /** + * Add data from remain dynamic data. + * @param {boolean} shiftingOption - whether has shifting option or not. + */ + addDataFromRemainDynamicData: function(shiftingOption) { + var self = this; + var dynamicData = this.dynamicData; + + this.dynamicData = []; + + snippet.forEach(dynamicData, function(datum) { + self._pushCategory(datum.category); + self._pushSeriesData(datum.values); + if (shiftingOption) { + self._shiftCategory(); + self._shiftSeriesData(); + } + }); + + this.initData(this.rawData); + }, + + /** + * Traverse all SeriesDataModel by seriesTypes, and executes iteratee function. + * @param {function} iteratee iteratee function + * @private + */ + _eachByAllSeriesDataModel: function(iteratee) { + var self = this, + seriesTypes = this.seriesTypes || [this.chartType]; + + snippet.forEachArray(seriesTypes, function(chartType) { + return iteratee(self.getSeriesDataModel(chartType), chartType); + }); + }, + + /** + * Whether valid all SeriesDataModel or not. + * @returns {boolean} + */ + isValidAllSeriesDataModel: function() { + var isValid = true; + + this._eachByAllSeriesDataModel(function(seriesDataModel) { + isValid = !!seriesDataModel.getGroupCount(); + + return isValid; + }); + + return isValid; + }, + + /** + * Make SeriesGroups. + * @returns {Array.} + * @private + */ + _makeSeriesGroups: function() { + var joinedGroups = [], + seriesGroups; + + this._eachByAllSeriesDataModel(function(seriesDataModel) { + seriesDataModel.each(function(seriesGroup, index) { + if (!joinedGroups[index]) { + joinedGroups[index] = []; + } + joinedGroups[index] = joinedGroups[index].concat(seriesGroup.items); + }); + }); + + seriesGroups = snippet.map(joinedGroups, function(items) { + return new SeriesGroup(items); + }); + + return seriesGroups; + }, + + /** + * Get SeriesGroups. + * @returns {Array.} + */ + getSeriesGroups: function() { + if (!this.seriesGroups) { + this.seriesGroups = this._makeSeriesGroups(); + } + + return this.seriesGroups; + }, + + /** + * Get value. + * @param {number} groupIndex group index + * @param {number} index index + * @param {?string} chartType chart type + * @returns {number} value + */ + getValue: function(groupIndex, index, chartType) { + return this.getSeriesDataModel(chartType).getValue(groupIndex, index); + }, + + /** + * Get fallback datetime values + * @returns {number[]} milliseconds + */ + getDefaultDatetimeValues: function() { + var hour = 60 * 60 * 1000; + var now = Date.now(); + + return [now - hour, now]; + }, + + /** + * Return boolean value of whether seriesData empty or not + * @param {string} chartType Type string of chart + * @returns {boolean} + */ + isSeriesDataEmpty: function(chartType) { + var rawData = this.rawData; + var seriesNotExist = rawData && !rawData.series; + + return ( + !rawData + || seriesNotExist + || (!(rawData.series[chartType]) + || (rawData.series[chartType] && !(rawData.series[chartType].length))) + ); + }, + + /** + * Return boolean value of whether axis limit option empty or not + * @param {string} axisType Type string of axis + * @returns {boolean} + */ + isLimitOptionsEmpty: function(axisType) { + var axisOption = this.options[axisType] || {}; + + return isUndefined(axisOption.min) && isUndefined(axisOption.max); + }, + + /** + * Return boolean value of whether axis limit option empty or not + * @param {string} axisType Type string of axis + * @returns {boolean} + */ + isLimitOptionsInsufficient: function(axisType) { + var axisOption = this.options[axisType] || {}; + + return isUndefined(axisOption.min) || isUndefined(axisOption.max); + }, + + /** + * Create values that picked value from SeriesItems of specific SeriesDataModel. + * @param {?string} chartType - type of chart + * @param {?string} valueType - type of value like value, x, y, r. + * @param {?string} axisName - name of axis value 'xAxis' 'yAxis' + * @returns {Array.} + * @private + */ + _createValues: function(chartType, valueType, axisName) { + var values, plotValues; + var options = this.options; + var plotOptions = options.plot; + var axisOption = options[axisName] || {}; + var type = axisOption.type; + var isEmptyRawData = this.isSeriesDataEmpty(chartType); + var isEmptyLimitOptions = this.isLimitOptionsEmpty(axisName); + + var isInsufficientLimitOptions = this.isLimitOptionsInsufficient(axisName); + var isLineOrAreaChart = (predicate.isLineChart(chartType) || predicate.isAreaChart(chartType) + || predicate.isLineAreaComboChart(chartType, this.seriesTypes)); + var valueCandidate = this.defaultValues; + + if (predicate.isComboChart(chartType)) { + values = []; + this._eachByAllSeriesDataModel(function(seriesDataModel) { + values = values.concat(seriesDataModel.getValues(valueType)); + }); + } else if (isEmptyRawData && isInsufficientLimitOptions) { + if (!isEmptyLimitOptions && isInsufficientLimitOptions) { + valueCandidate = valueCandidate.concat([(axisOption.min || axisOption.max)]); + } + + if (valueType === 'x' && type === 'datetime') { + values = this.getDefaultDatetimeValues(); + + if (isLineOrAreaChart && plotOptions) { + plotValues = this.getValuesFromPlotOptions(plotOptions, type); + values = values.concat(plotValues); + } + } else { + values = valueCandidate; + } + } else { + values = this.getSeriesDataModel(chartType).getValues(valueType); + } + + return values; + }, + + /** + * Get values of plot lines, and bands if it exist + * @param {{lines: Array., bands: Array.}} plotOptions plot options + * @param {string} [axisType] axis value type 'value' 'datetime' + * @returns {Array.} + */ + getValuesFromPlotOptions: function(plotOptions, axisType) { + var values = []; + + if (plotOptions.lines) { + snippet.forEach(plotOptions.lines, function(line) { + values.push(axisType !== 'datetime' ? line.value : new Date(line.value)); + }); + } + + if (plotOptions.bands) { + snippet.forEach(plotOptions.bands, function(line) { + var ranges = snippet.map(line.range, function(range) { + return axisType !== 'datetime' ? range : new Date(range); + }); + + values = values.concat(ranges); + }); + } + + return values; + }, + + /** + * Get values from valuesMap. + * @param {?string} chartType - type of chart + * @param {?string} valueType - type of value like value, x, y, r. + * @param {?string} axisType - type of axis value 'value', 'datetime' + * @returns {Array.} + */ + getValues: function(chartType, valueType, axisType) { + var mapKey; + + // chartType = chartType || chartConst.DUMMY_KEY; + mapKey = chartType + valueType; + + if (!this.valuesMap[mapKey]) { + this.valuesMap[mapKey] = this._createValues(chartType, valueType, axisType); + } + + return this.valuesMap[mapKey]; + }, + + /** + * Traverse SeriesGroup of all SeriesDataModel, and executes iteratee function. + * @param {function} iteratee iteratee function + * @param {boolean} [isPivot] - whether pivot or not + */ + eachBySeriesGroup: function(iteratee, isPivot) { + this._eachByAllSeriesDataModel(function(seriesDataModel, chartType) { + seriesDataModel.each(function(seriesGroup, groupIndex) { + iteratee(seriesGroup, groupIndex, chartType); + }, isPivot); + }); + }, + + /** + * Pick legend label. + * @param {object} item item + * @returns {string} label + * @private + */ + _pickLegendLabel: function(item) { + return item.name ? snippet.encodeHTMLEntity(item.name) : null; + }, + + /** + * Pick legend visibility. + * @param {object} item item + * @returns {boolean} + * @private + */ + _isVisibleLegend: function(item) { + var visibility = true; + if (snippet.isExisty(item.visible) && item.visible === false) { + visibility = false; + } + + return visibility; + }, + + /** + * Pick legend labels or visibilities from raw data. + * @param {string} dataType data type of picking values + * @returns {string[]|boolean[]} labels or visibilities + * @private + */ + _pickLegendData: function(dataType) { + var seriesData = this.rawData.series; + var result = {}; + var pickerMethod; + + if (dataType === 'visibility') { + pickerMethod = this._isVisibleLegend; + } else if (dataType === 'label') { + pickerMethod = this._pickLegendLabel; + } + + if (pickerMethod) { + snippet.forEach(seriesData, function(seriesDatum, seriesType) { + result[seriesType] = snippet.map(seriesDatum, pickerMethod); + }); + + result = snippet.filter(result, snippet.isExisty); + } + + return result; + }, + + /** + * Get legend labels. + * @param {?string} chartType chart type + * @returns {Array. | {column: ?Array., line: ?Array.}} legend labels + */ + getLegendLabels: function(chartType) { + if (!this.legendLabels) { + this.legendLabels = this._pickLegendData('label'); + } + + return this.legendLabels[chartType] || this.legendLabels; + }, + + /** + * Get legend visibility. + * @param {?string} chartType chart type + * @returns {Array. | {column: ?Array., line: ?Array.}} legend labels + */ + getLegendVisibility: function(chartType) { + if (!this.legendVisibilities) { + this.legendVisibilities = this._pickLegendData('visibility'); + } + + return this.legendVisibilities[chartType] || this.legendVisibilities; + }, + + /** + * Make legend data. + * @returns {Array} labels + * @private + */ + _makeLegendData: function() { + var legendLabels = this.getLegendLabels(this.chartType); + var seriesTypes = this.seriesTypes || [this.chartType]; + var legendLabelsMap, legendData; + var legendVisibilities = this.getLegendVisibility(); + + if (snippet.isArray(legendLabels)) { + legendLabelsMap = [this.chartType]; + legendLabelsMap[this.chartType] = legendLabels; + } else { + seriesTypes = this.seriesTypes; + legendLabelsMap = legendLabels; + } + + legendData = snippet.map(seriesTypes, function(chartType) { + return snippet.map(legendLabelsMap[chartType], function(label, index) { + var is2DArray = snippet.isArray(legendVisibilities[chartType]); + + return { + chartType: chartType, + label: label, + visible: is2DArray ? legendVisibilities[chartType][index] : legendVisibilities[index] + }; + }); + }); + + return concat.apply([], legendData); + }, + + /** + * Get legend data. + * @returns {Array.<{chartType: string, label: string}>} legend data + */ + getLegendData: function() { + if (!this.legendData) { + this.legendData = this._makeLegendData(); + } + + if (!this.originalLegendData) { + this.originalLegendData = this.legendData; + } + + return this.legendData; + }, + + /** + * get original legend data. + * @returns {Array.<{chartType: string, label: string}>} + */ + getOriginalLegendData: function() { + return this.originalLegendData; + }, + + /** + * Get legend item. + * @param {number} index index + * @returns {{chartType: string, label: string}} legend data + */ + getLegendItem: function(index) { + return this.getLegendData()[index]; + }, + + /** + * Get first label of SeriesItem. + * @param {?string} chartType chartType + * @returns {string} formatted value + */ + getFirstItemLabel: function(chartType) { + return this.getSeriesDataModel(chartType).getFirstItemLabel(); + }, + + /** + * Add data ratios of pie chart. + * @param {string} chartType - type of chart. + */ + addDataRatiosOfPieChart: function(chartType) { + this.getSeriesDataModel(chartType).addDataRatiosOfPieChart(); + }, + + /** + * Add data ratios for chart of coordinate type. + * @param {string} chartType - type of chart. + * @param {{x: {min: number, max: number}, y: {min: number, max: number}}} limitMap - limit map + * @param {boolean} [hasRadius] - whether has radius or not + */ + addDataRatiosForCoordinateType: function(chartType, limitMap, hasRadius) { + if (predicate.isLineTypeChart(chartType)) { + this._addStartValueToAllSeriesItem(limitMap.yAxis, chartType); + } + this.getSeriesDataModel(chartType).addDataRatiosForCoordinateType(limitMap, hasRadius); + }, + + /** + * Add start value to all series item. + * @param {{min: number, max: number}} limit - limit + * @param {string} chartType - chart type + * @private + */ + _addStartValueToAllSeriesItem: function(limit, chartType) { + var start = 0; + + if (limit.min >= 0) { + start = limit.min; + } else if (limit.max <= 0) { + start = limit.max; + } + + this.getSeriesDataModel(chartType).addStartValueToAllSeriesItem(start); + }, + + /** + * Register percent values. + * @param {{min: number, max: number}} limit axis limit + * @param {string} stackType stackType option + * @param {string} chartType chart type + */ + addDataRatios: function(limit, stackType, chartType) { + var seriesDataModel = this.getSeriesDataModel(chartType); + + this._addStartValueToAllSeriesItem(limit, chartType); + seriesDataModel.addDataRatios(limit, stackType); + }, + + /** + * Add data ratios for treemap chart. + * @param {{min: number, max: number}} limit - limit + * @param {string} chartType - chart type + */ + addDataRatiosForTreemapChart: function(limit, chartType) { + this.getSeriesDataModel(chartType).addDataRatios(limit); + }, + + /** + * Create base values for normal stackType chart. + * @param {string} chartType - chart type + * @returns {Array.} + * @private + */ + _createBaseValuesForNormalStackedChart: function(chartType) { + var seriesDataModel = this.getSeriesDataModel(chartType); + var baseValues = []; + + seriesDataModel.each(function(seriesGroup) { + var valuesMap = seriesGroup._makeValuesMapPerStack(); + + snippet.forEach(valuesMap, function(values) { + var plusSum = calculator.sumPlusValues(values); + var minusSum = calculator.sumMinusValues(values); + baseValues = baseValues.concat([plusSum, minusSum]); + }); + }); + + return baseValues; + }, + + /** + * Create base values for calculating limit + * @param {string} chartType - chart type + * @param {boolean} isSingleYAxis = whether single y axis or not + * @param {string} stackType - stack type + * @param {string} valueType - value type + * @param {string} axisType - value type + * @returns {Array.} + */ + createBaseValuesForLimit: function(chartType, isSingleYAxis, stackType, valueType, axisType) { + var baseValues; + + if (predicate.isComboChart(this.chartType) && isSingleYAxis) { + baseValues = this.getValues(this.chartType, valueType); + if (predicate.isNormalStackChart(chartType, stackType)) { + baseValues = baseValues.concat(this._createBaseValuesForNormalStackedChart(chartType)); + } + } else if (predicate.isTreemapChart(chartType)) { + baseValues = this.getValues(chartType, 'colorValue'); + } else if (predicate.isNormalStackChart(chartType, stackType)) { + baseValues = this._createBaseValuesForNormalStackedChart(chartType); + } else { + baseValues = this.getValues(chartType, valueType, axisType); + } + + return baseValues; + }, + + /** + * Find overflow item than graph area + * @param {string} chartType - chart type + * @param {string} valueType - value type + * @returns {{minItem: SeriesItem, maxItem: SeriesItem}} + */ + findOverflowItem: function(chartType, valueType) { + var seriesDataModel = this.getSeriesDataModel(chartType); + var maxRadiusValue = seriesDataModel.getMaxValue('r'); + var isBiggerRatioThanHalfRatio = function(seriesItem) { + return (seriesItem.r / maxRadiusValue) > chartConst.HALF_RATIO; + }; + + return { + minItem: seriesDataModel.findMinSeriesItem(valueType, isBiggerRatioThanHalfRatio), + maxItem: seriesDataModel.findMaxSeriesItem(valueType, isBiggerRatioThanHalfRatio) + }; + }, + + /** + * Register color and opacity data of tooltip icon + * @param {Array.>} colors - color and opacities setGraphColors + * @ignore + */ + setGraphColors: function(colors) { + this.graphColors = colors; + }, + + /** + * Get color and opacity data of tooltip data + * @returns {Array.>} - color and opacities set + * @ignore + */ + getGraphColors: function() { + return this.graphColors; + } + }); + + module.exports = DataProcessor; + + +/***/ }), +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview data processor base. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var arrayUtil = __webpack_require__(10); + var renderUtil = __webpack_require__(7); + var calculator = __webpack_require__(45); + var snippet = __webpack_require__(6); + + /** + * @classdesc data processor base. + * @class DataProcessorBase + * @private + */ + var DataProcessorBase = snippet.defineClass(/** @lends DataProcessorBase.prototype */{ + /** + * Initialize. + */ + baseInit: function() { + /** + * functions for formatting + * @type {Array.} + */ + this.formatFunctions = null; + }, + + /** + * Get values. + * @abstract + * @returns {Array} + */ + getValues: function() {}, + + /** + * Get max value. + * @param {?string} chartType - type of chart + * @param {?string} valueType - type of value like value, x, y, r + * @returns {number} + */ + getMaxValue: function(chartType, valueType) { + return arrayUtil.max(this.getValues(chartType, valueType)); + }, + + /** + * Get formatted max value. + * @param {?string} chartType - type of chart + * @param {?string} areaType - type of area like circleLegend + * @param {?string} valueType - type of value like value, x, y, r + * @returns {string | number} + */ + getFormattedMaxValue: function(chartType, areaType, valueType) { + var maxValue = this.getMaxValue(chartType, valueType); + var formatFunctions = this.getFormatFunctions(); + + return renderUtil.formatValue({ + value: maxValue, + formatFunctions: formatFunctions, + chartType: chartType, + areaType: areaType, + valueType: valueType + }); + }, + + /** + * Pick max length under point. + * @param {string[]} values chart values + * @returns {number} max length under point + * @private + */ + _pickMaxLenUnderPoint: function(values) { + var max = 0; + + snippet.forEachArray(values, function(value) { + var len = calculator.getDecimalLength(value); + if (len > max) { + max = len; + } + }); + + return max; + }, + + /** + * Whether zero fill format or not. + * @param {string} format format + * @returns {boolean} result boolean + * @private + */ + _isZeroFill: function(format) { + return format.length > 2 && format.charAt(0) === '0'; + }, + + /** + * Whether decimal format or not. + * @param {string} format format + * @returns {boolean} result boolean + * @private + */ + _isDecimal: function(format) { + var indexOf = format.indexOf('.'); + + return indexOf > -1 && indexOf < format.length - 1; + }, + + /** + * Whether comma format or not. + * @param {string} format format + * @returns {boolean} result boolean + * @private + */ + _isComma: function(format) { + return format.indexOf(',') > -1; + }, + + /** + * Format to zero fill. + * @param {number} len length of result + * @param {string} value target value + * @returns {string} formatted value + * @private + */ + _formatToZeroFill: function(len, value) { + var isMinus = value < 0; + + value = renderUtil.formatToZeroFill(Math.abs(value), len); + + return (isMinus ? '-' : '') + value; + }, + + /** + * Format to Decimal. + * @param {number} len length of under decimal point + * @param {string} value target value + * @returns {string} formatted value + * @private + */ + _formatToDecimal: function(len, value) { + return renderUtil.formatToDecimal(value, len); + }, + + /** + * Find simple type format functions. + * @param {string} format - simple format + * @returns {Array.} + */ + _findSimpleTypeFormatFunctions: function(format) { + var funcs = []; + var len; + + if (this._isDecimal(format)) { + len = this._pickMaxLenUnderPoint([format]); + funcs = [snippet.bind(this._formatToDecimal, this, len)]; + } else if (this._isZeroFill(format)) { + len = format.length; + funcs = [snippet.bind(this._formatToZeroFill, this, len)]; + + return funcs; + } + + if (this._isComma(format)) { + funcs.push(renderUtil.formatToComma); + } + + return funcs; + }, + + /** + * Find format functions. + * @returns {function[]} functions + */ + _findFormatFunctions: function() { + var format = snippet.pick(this.options, 'chart', 'format'); + var funcs = []; + + if (snippet.isFunction(format)) { + funcs = [format]; + } else if (snippet.isString(format)) { + funcs = this._findSimpleTypeFormatFunctions(format); + } + + return funcs; + }, + + /** + * Get format functions. + * @returns {Array.} functions + */ + getFormatFunctions: function() { + if (!this.formatFunctions) { + this.formatFunctions = this._findFormatFunctions(); + } + + return this.formatFunctions; + } + }); + + module.exports = DataProcessorBase; + + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview SeriesDataModel is base model for drawing graph of chart series area, + * and create from rawSeriesData by user, + * SeriesDataModel.groups has SeriesGroups. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + /* + * Raw series datum. + * @typedef {{name: ?string, data: Array., stack: ?string}} rawSeriesDatum + */ + + /* + * Raw series data. + * @typedef {Array.} rawSeriesData + */ + + /* + * Groups. + * @typedef {Array.} groups + */ + + /* + * SeriesGroup is a element of SeriesDataModel.groups. + * SeriesGroup.items has SeriesItem. + */ + + /* + * SeriesItem is a element of SeriesGroup.items. + * SeriesItem has processed terminal data like value, ratio, etc. + */ + + var SeriesGroup = __webpack_require__(104); + var SeriesItem = __webpack_require__(105); + var SeriesItemForCoordinateType = __webpack_require__(106); + var predicate = __webpack_require__(11); + var calculator = __webpack_require__(45); + var arrayUtil = __webpack_require__(10); + var snippet = __webpack_require__(6); + + var concat = Array.prototype.concat; + + var SeriesDataModel = snippet.defineClass(/** @lends SeriesDataModel.prototype */{ + /** + * SeriesDataModel is base model for drawing graph of chart series area, + * and create from rawSeriesData by user. + * SeriesDataModel.groups has SeriesGroups. + * @constructs SeriesDataModel + * @private + * @param {rawSeriesData} rawSeriesData - raw series data + * @param {string} chartType - chart type + * @param {object} options - options + * @param {Array.} formatFunctions - format functions + * @param {boolean} isCoordinateType - whether coordinate type or not + */ + init: function(rawSeriesData, chartType, options, formatFunctions, isCoordinateType) { + /** + * chart type + * @type {string} + */ + this.chartType = chartType; + + /** + * chart options + * @type {Object} + */ + this.options = options || {}; + + /** + * functions for formatting + * @type {Array.} + */ + this.formatFunctions = formatFunctions; + + /** + * rawData.series + * @type {rawSeriesData} + */ + this.rawSeriesData = rawSeriesData || []; + + /** + * whether coordinate type or not + * @type {boolean} + */ + this.isCoordinateType = isCoordinateType; + + /** + * baseGroups is base data for making SeriesGroups. + * SeriesGroups is made by pivoted baseGroups, lf line type chart. + * @type {Array.Array} + */ + this.baseGroups = null; + + /** + * groups has SeriesGroups. + * @type {Array.} + */ + this.groups = null; + + this.options.series = this.options.series || {}; + + /** + * whether diverging chart or not. + * @type {boolean} + */ + this.isDivergingChart = predicate.isDivergingChart(chartType, this.options.series.diverging); + + /** + * map of values by value type like value, x, y, r. + * @type {object.>} + */ + this.valuesMap = {}; + + this._removeRangeValue(); + }, + + /** + * Remove range value of item, if has stackType option. + * @private + */ + _removeRangeValue: function() { + var seriesOption = snippet.pick(this.options, 'series') || {}; + var allowRange = predicate.isAllowRangeData(this.chartType) && + !predicate.isValidStackOption(seriesOption.stackType) && !seriesOption.spline; + + if (allowRange || this.isCoordinateType) { + return; + } + + snippet.forEachArray(this.rawSeriesData, function(rawItem) { + if (!snippet.isArray(rawItem.data)) { + return; + } + snippet.forEachArray(rawItem.data, function(value, index) { + if (snippet.isExisty(value)) { + rawItem.data[index] = concat.apply(value)[0]; + } + }); + }); + }, + + /** + * Create base groups. + * Base groups is two-dimensional array by seriesItems. + * @returns {Array.>} + * @private + */ + _createBaseGroups: function() { + var chartType = this.chartType; + var formatFunctions = this.formatFunctions; + var xAxisOption = this.options.xAxis; + var isDivergingChart = this.isDivergingChart; + var isCoordinateType = this.isCoordinateType; + var isPieChart = predicate.isPieChart(this.chartType); + var hasRawDatumAsArray = predicate.isHeatmapChart(this.chartType) || predicate.isTreemapChart(this.chartType); + var sortValues, SeriesItemClass; + + if (isCoordinateType) { + SeriesItemClass = SeriesItemForCoordinateType; + sortValues = function(items) { + items.sort(function(a, b) { + return a.x - b.x; + }); + }; + } else { + SeriesItemClass = SeriesItem; + sortValues = function() {}; + } + + return snippet.map(this.rawSeriesData, function(rawDatum) { + var stack, data, legendName, items; + + data = snippet.isArray(rawDatum) ? rawDatum : [].concat(rawDatum.data); + + if (!hasRawDatumAsArray) { + stack = rawDatum.stack; + } + if (rawDatum.name) { + legendName = rawDatum.name; + } + + if (isCoordinateType || isPieChart) { + data = snippet.filter(data, snippet.isExisty); + } + + items = snippet.map(data, function(datum, index) { + return new SeriesItemClass({ + datum: datum, + chartType: chartType, + formatFunctions: formatFunctions, + index: index, + legendName: legendName, + stack: stack, + isDivergingChart: isDivergingChart, + xAxisType: xAxisOption.type, + dateFormat: xAxisOption.dateFormat + }); + }); + sortValues(items); + + return items; + }); + }, + + /** + * Get base groups. + * @returns {Array.Array.} + * @private + */ + _getBaseGroups: function() { + if (!this.baseGroups) { + this.baseGroups = this._createBaseGroups(); + } + + return this.baseGroups; + }, + + /** + * Create SeriesGroups from rawData.series. + * @param {boolean} isPivot - whether pivot or not. + * @returns {Array.} + * @private + */ + _createSeriesGroupsFromRawData: function(isPivot) { + var baseGroups = this._getBaseGroups(); + + if (isPivot) { + baseGroups = arrayUtil.pivot(baseGroups); + } + + return snippet.map(baseGroups, function(items) { + return new SeriesGroup(items); + }); + }, + + /** + * Get SeriesGroups. + * @returns {(Array.|object)} + * @private + */ + _getSeriesGroups: function() { + if (!this.groups) { + this.groups = this._createSeriesGroupsFromRawData(true); + } + + return this.groups; + }, + + /** + * Get group count. + * @returns {Number} + */ + getGroupCount: function() { + return this._getSeriesGroups().length; + }, + + /** + * Get pivot groups. + * @returns {(Array.|object)} + */ + _getPivotGroups: function() { + if (!this.pivotGroups) { + this.pivotGroups = this._createSeriesGroupsFromRawData(); + } + + return this.pivotGroups; + }, + + /** + * Get SeriesGroup. + * @param {number} index - index + * @param {boolean} [isPivot] - whether pivot or not + * @returns {SeriesGroup} + */ + getSeriesGroup: function(index, isPivot) { + return isPivot ? this._getPivotGroups()[index] : this._getSeriesGroups()[index]; + }, + + /** + * Get first SeriesGroup. + * @param {boolean} [isPivot] - whether pivot or not + * @returns {SeriesGroup} + */ + getFirstSeriesGroup: function(isPivot) { + return this.getSeriesGroup(0, isPivot); + }, + + /** + * Get first label of SeriesItem. + * @returns {string} formatted value + */ + getFirstItemLabel: function() { + return this.getFirstSeriesGroup().getFirstSeriesItem().label; + }, + + /** + * Get series item. + * @param {number} groupIndex - index of series groups + * @param {number} index - index of series items + * @param {boolean} [isPivot] - whether pivot or not + * @returns {SeriesItem} + */ + getSeriesItem: function(groupIndex, index, isPivot) { + return this.getSeriesGroup(groupIndex, isPivot).getSeriesItem(index); + }, + + /** + * Get first series item. + * @returns {SeriesItem} + */ + getFirstSeriesItem: function() { + return this.getSeriesItem(0, 0); + }, + + /** + * Get value. + * @param {number} groupIndex - index of series groups + * @param {number} index - index of series items + * @returns {number} value + */ + getValue: function(groupIndex, index) { + return this.getSeriesItem(groupIndex, index).value; + }, + + /** + * Get minimum value. + * @param {string} valueType - value type like value, x, y, r. + * @returns {number} + */ + getMinValue: function(valueType) { + return arrayUtil.min(this.getValues(valueType)); + }, + + /** + * Get maximum value. + * @param {string} valueType - value type like value, x, y, r. + * @returns {number} + */ + getMaxValue: function(valueType) { + return arrayUtil.max(this.getValues(valueType)); + }, + + /** + * Traverse seriesGroups, and returns to found SeriesItem by result of execution seriesGroup.find with condition. + * @param {function} condition - condition function + * @returns {SeriesItem} + * @private + */ + _findSeriesItem: function(condition) { + var foundItem; + + this.each(function(seriesGroup) { + foundItem = seriesGroup.find(condition); + + return !foundItem; + }); + + return foundItem; + }, + + /** + * Find SeriesItem by value. + * @param {string} valueType - value type like value, x, y, r. + * @param {number} value - comparing value + * @param {function} condition - condition function + * @returns {SeriesItem} + * @private + */ + _findSeriesItemByValue: function(valueType, value, condition) { + condition = condition || function() { + return null; + }; + + return this._findSeriesItem(function(seriesItem) { + return seriesItem && (seriesItem[valueType] === value) && condition(seriesItem); + }); + }, + + /** + * Find minimum SeriesItem. + * @param {string} valueType - value type like value, x, y, r. + * @param {function} condition - condition function + * @returns {SeriesItem} + */ + findMinSeriesItem: function(valueType, condition) { + var minValue = this.getMinValue(valueType); + + return this._findSeriesItemByValue(valueType, minValue, condition); + }, + + /** + * Find maximum SeriesItem. + * @param {string} valueType - value type like value, x, y, r. + * @param {function} condition - condition function + * @returns {*|SeriesItem} + */ + findMaxSeriesItem: function(valueType, condition) { + var maxValue = this.getMaxValue(valueType); + + return this._findSeriesItemByValue(valueType, maxValue, condition); + }, + + /** + * Create values that picked value from SeriesItems of SeriesGroups. + * @param {?string} valueType - type of value + * @returns {Array.} + * @private + */ + _createValues: function(valueType) { + var values = this.map(function(seriesGroup) { + return seriesGroup.getValues(valueType); + }); + + values = concat.apply([], values); + + return snippet.filter(values, function(value) { + return !isNaN(value); + }); + }, + + /** + * Get values form valuesMap. + * @param {?string} valueType - type of value + * @returns {Array.} + */ + getValues: function(valueType) { + valueType = valueType || 'value'; + + if (!this.valuesMap[valueType]) { + this.valuesMap[valueType] = this._createValues(valueType); + } + + return this.valuesMap[valueType]; + }, + + /** + * Whether count of x values greater than count of y values. + * @returns {boolean} + */ + isXCountGreaterThanYCount: function() { + return this.getValues('x').length > this.getValues('y').length; + }, + + /** + * Add ratios, when has normal stackType option. + * @param {{min: number, max: number}} limit - axis limit + * @private + */ + _addRatiosWhenNormalStacked: function(limit) { + var distance = Math.abs(limit.max - limit.min); + + this.each(function(seriesGroup) { + seriesGroup.addRatios(distance); + }); + }, + + /** + * Calculate base ratio for calculating ratio of item. + * @returns {number} + * @private + */ + _calculateBaseRatio: function() { + var values = this.getValues(), + plusSum = calculator.sumPlusValues(values), + minusSum = Math.abs(calculator.sumMinusValues(values)), + ratio = (plusSum > 0 && minusSum > 0) ? 0.5 : 1; + + return ratio; + }, + + /** + * Add ratios, when has percent stackType option. + * @private + */ + _addRatiosWhenPercentStacked: function() { + var baseRatio = this._calculateBaseRatio(); + + this.each(function(seriesGroup) { + seriesGroup.addRatiosWhenPercentStacked(baseRatio); + }); + }, + + /** + * Add ratios, when has diverging stackType option. + * @private + */ + _addRatiosWhenDivergingStacked: function() { + this.each(function(seriesGroup) { + var values = seriesGroup.pluck('value'), + plusSum = calculator.sumPlusValues(values), + minusSum = Math.abs(calculator.sumMinusValues(values)); + + seriesGroup.addRatiosWhenDivergingStacked(plusSum, minusSum); + }); + }, + + /** + * Make subtraction value for making ratio of no option chart. + * @param {{min: number, max: number}} limit - limit + * @returns {number} + * @private + */ + _makeSubtractionValue: function(limit) { + var allowMinusPointRender = predicate.allowMinusPointRender(this.chartType), + subValue = 0; + + if (!allowMinusPointRender && predicate.isMinusLimit(limit)) { + subValue = limit.max; + } else if (allowMinusPointRender || limit.min >= 0) { + subValue = limit.min; + } + + return subValue; + }, + + /** + * Add ratios, when has not option. + * @param {{min: number, max: number}} limit - axis limit + * @private + */ + _addRatios: function(limit) { + var distance = Math.abs(limit.max - limit.min), + subValue = this._makeSubtractionValue(limit); + + this.each(function(seriesGroup) { + seriesGroup.addRatios(distance, subValue); + }); + }, + + /** + * Add data ratios. + * @param {{min: number, max: number}} limit - axis limit + * @param {string} stackType - stackType option + * @private + */ + addDataRatios: function(limit, stackType) { + var isAllowedStackOption = predicate.isAllowedStackOption(this.chartType); + + if (isAllowedStackOption && predicate.isNormalStack(stackType)) { + this._addRatiosWhenNormalStacked(limit); + } else if (isAllowedStackOption && predicate.isPercentStack(stackType)) { + if (this.isDivergingChart) { + this._addRatiosWhenDivergingStacked(); + } else { + this._addRatiosWhenPercentStacked(); + } + } else { + this._addRatios(limit); + } + }, + + /** + * Add data ratios of pie chart. + */ + addDataRatiosOfPieChart: function() { + this.each(function(seriesGroup) { + var sum = calculator.sum(seriesGroup.pluck('value')); + + seriesGroup.addRatios(sum); + }); + }, + + /** + * Add ratios of data for chart of coordinate type. + * @param {{x: {min: number, max: number}, y: {min: number, max: number}}} limitMap - limit map + * @param {boolean} [hasRadius] - whether has radius or not + */ + addDataRatiosForCoordinateType: function(limitMap, hasRadius) { + var xLimit = limitMap.xAxis; + var yLimit = limitMap.yAxis; + var maxRadius = hasRadius ? arrayUtil.max(this.getValues('r')) : 0; + var xDistance, xSubValue, yDistance, ySubValue; + + if (xLimit) { + xDistance = Math.abs(xLimit.max - xLimit.min); + xSubValue = this._makeSubtractionValue(xLimit); + } + + if (yLimit) { + yDistance = Math.abs(yLimit.max - yLimit.min); + ySubValue = this._makeSubtractionValue(yLimit); + } + + this.each(function(seriesGroup) { + seriesGroup.each(function(item) { + if (!item) { + return; + } + + item.addRatio('x', xDistance, xSubValue); + item.addRatio('y', yDistance, ySubValue); + item.addRatio('r', maxRadius, 0); + + if (snippet.isExisty(item.start)) { + item.addRatio('start', yDistance, ySubValue); + } + }); + }); + }, + + /** + * Add start to all series item. + * @param {number} start - start value + */ + addStartValueToAllSeriesItem: function(start) { + this.each(function(seriesGroup) { + seriesGroup.addStartValueToAllSeriesItem(start); + }); + }, + + /** + * Whether has range data or not. + * @returns {boolean} + */ + hasRangeData: function() { + var hasRangeData = false; + + this.each(function(seriesGroup) { + hasRangeData = seriesGroup.hasRangeData(); + + return !hasRangeData; + }); + + return hasRangeData; + }, + + /** + * Traverse groups, and executes iteratee function. + * @param {function} iteratee - iteratee function + * @param {boolean} isPivot - whether pivot or not + */ + each: function(iteratee, isPivot) { + var groups = isPivot ? this._getPivotGroups() : this._getSeriesGroups(); + + snippet.forEachArray(groups, function(seriesGroup, index) { + return iteratee(seriesGroup, index); + }); + }, + + /** + * Traverse groups, and returns to result of execution about iteratee function. + * @param {function} iteratee - iteratee function + * @param {boolean} isPivot - whether pivot or not + * @returns {Array} + */ + map: function(iteratee, isPivot) { + var results = []; + + this.each(function(seriesGroup, index) { + results.push(iteratee(seriesGroup, index)); + }, isPivot); + + return results; + } + }); + + module.exports = SeriesDataModel; + + +/***/ }), +/* 104 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview SeriesGroup is a element of SeriesDataModel.groups. + * SeriesGroup.items has SeriesItem. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var calculator = __webpack_require__(45); + var snippet = __webpack_require__(6); + + var SeriesGroup = snippet.defineClass(/** @lends SeriesGroup.prototype */{ + /** + * SeriesGroup is a element of SeriesDataModel.groups. + * SeriesGroup.items has SeriesItem. + * @constructs SeriesGroup + * @private + * @param {Array.} seriesItems - series items + */ + init: function(seriesItems) { + /** + * items has SeriesItem + * @type {Array.} + */ + this.items = seriesItems; + + /** + * map of values by value type like value, x, y, r. + * @type {Array.} + */ + this.valuesMap = {}; + + this.valuesMapPerStack = null; + }, + + /** + * Get series item count. + * @returns {number} + */ + getSeriesItemCount: function() { + return this.items.length; + }, + + /** + * Get series item. + * @param {number} index - index of items + * @returns {SeriesItem} + */ + getSeriesItem: function(index) { + return this.items[index]; + }, + + /** + * Get first SeriesItem. + * @returns {SeriesItem} + */ + getFirstSeriesItem: function() { + return this.getSeriesItem(0); + }, + + /** + * Create values that picked value from SeriesItems. + * @param {?string} valueType - type of value + * @returns {Array.} + * @private + */ + _createValues: function(valueType) { + var values = []; + + this.each(function(item) { + if (!item) { + return; + } + + if (snippet.isExisty(item[valueType])) { + values.push(item[valueType]); + } + if (snippet.isExisty(item.start)) { + values.push(item.start); + } + }); + + return values; + }, + + /** + * Get values from valuesMap. + * @param {?string} valueType - type of value + * @returns {Array} + */ + getValues: function(valueType) { + valueType = valueType || 'value'; + + if (!this.valuesMap[valueType]) { + this.valuesMap[valueType] = this._createValues(valueType); + } + + return this.valuesMap[valueType]; + }, + + /** + * Make values map per stack. + * @returns {object} + * @private + */ + _makeValuesMapPerStack: function() { + var valuesMap = {}; + + this.each(function(item) { + if (!valuesMap[item.stack]) { + valuesMap[item.stack] = []; + } + valuesMap[item.stack].push(item.value); + }); + + return valuesMap; + }, + + /** + * Get values map per stack. + * @returns {*|Object} + */ + getValuesMapPerStack: function() { + if (!this.valuesMapPerStack) { + this.valuesMapPerStack = this._makeValuesMapPerStack(); + } + + return this.valuesMapPerStack; + }, + + /** + * Make sum map per stack. + * @returns {object} sum map + * @private + */ + _makeSumMapPerStack: function() { + var valuesMap = this.getValuesMapPerStack(), + sumMap = {}; + + snippet.forEach(valuesMap, function(values, key) { + sumMap[key] = calculator.sum(snippet.map(values, function(value) { + return Math.abs(value); + })); + }); + + return sumMap; + }, + + /** + * Add start value to all series item. + * @param {number} start start value + */ + addStartValueToAllSeriesItem: function(start) { + this.each(function(item) { + if (!item) { + return; + } + item.addStart(start); + }); + }, + + /** + * Add ratios when percent stackType. + * @param {number} baseRatio - base ratio + */ + addRatiosWhenPercentStacked: function(baseRatio) { + var sumMap = this._makeSumMapPerStack(); + + this.each(function(item) { + var dividingNumber = sumMap[item.stack]; + + item.addRatio(dividingNumber, 0, baseRatio); + }); + }, + + /** + * Add ratios when diverging stacked. + * @param {number} plusSum - sum of plus number + * @param {number} minusSum - sum of minus number + */ + addRatiosWhenDivergingStacked: function(plusSum, minusSum) { + this.each(function(item) { + var dividingNumber = (item.value >= 0) ? plusSum : minusSum; + + item.addRatio(dividingNumber, 0, 0.5); + }); + }, + + /** + * Add ratios. + * @param {number} divNumber dividing number + * @param {number} subValue subtraction value + */ + addRatios: function(divNumber, subValue) { + this.each(function(item) { + if (!item) { + return; + } + item.addRatio(divNumber, subValue); + }); + }, + + /** + * Whether has range data or not. + * @returns {boolean} + */ + hasRangeData: function() { + var hasRangeData = false; + + this.each(function(seriesItem) { + hasRangeData = seriesItem && seriesItem.isRange; + + return !hasRangeData; + }); + + return hasRangeData; + }, + + /** + * Traverse items, and executes iteratee function. + * @param {function} iteratee - iteratee function + */ + each: function(iteratee) { + snippet.forEachArray(this.items, iteratee); + }, + + /** + * Traverse items, and returns to results of execution about iteratee function. + * @param {function} iteratee - iteratee function + * @returns {Array} + */ + map: function(iteratee) { + return snippet.map(this.items, iteratee); + }, + + /** + * Traverse items, and returns to picked result at item. + * @param {string} key key for pick + * @returns {Array} + */ + pluck: function(key) { + var items = snippet.filter(this.items, snippet.isExisty); + + return snippet.pluck(items, key); + }, + + /** + * Traverse items, and returns to found SeriesItem by condition function. + * @param {function} condition - condition function + * @returns {SeriesItem|null} + */ + find: function(condition) { + var foundItem; + + this.each(function(seriesItem) { + if (condition(seriesItem)) { + foundItem = seriesItem; + } + + return !foundItem; + }); + + return foundItem || null; + }, + + /** + * Traverse items, and returns to filter SeriesItems by condition function. + * @param {function} condition - condition function + * @returns {Array} + */ + filter: function(condition) { + return snippet.filter(this.items, condition); + } + }); + + module.exports = SeriesGroup; + + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview SeriesItem is a element of SeriesGroup.items. + * SeriesItem has processed terminal data like value, ratio, etc. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var renderUtil = __webpack_require__(7); + var calculator = __webpack_require__(45); + var predicate = __webpack_require__(11); + var snippet = __webpack_require__(6); + + var SeriesItem = snippet.defineClass(/** @lends SeriesItem.prototype */{ + /** + * SeriesItem is a element of SeriesGroup.items. + * SeriesItem has processed terminal data like value, ratio, etc. + * @constructs SeriesItem + * @private + * @param {object} params - parameters + * @param {number} params.datum - value + * @param {string} params.chartType - type of chart + * @param {?Array.} params.formatFunctions - format functions + * @param {number} params.index - raw data index + * @param {?string} params.stack - stack + */ + init: function(params) { + /** + * type of chart + * @type {string} + */ + this.chartType = params.chartType; + + /** + * for group stack option. + * @type {string} + */ + this.stack = params.stack || chartConst.DEFAULT_STACK; + + /** + * whether diverging chart or not + * @type {boolean} + */ + this.isDivergingChart = params.isDivergingChart; + + /** + * format functions + * @type {Array.} + */ + this.formatFunctions = params.formatFunctions; + + /** + * whether range item or not + * @type {boolean} + */ + this.isRange = false; + + /** + * value of item + * @type {number} + */ + this.value = null; + + /** + * label + * @type {string} + */ + this.label = null; + + /** + * ratio of value about distance of limit + * @type {number} + */ + this.ratio = null; + + /** + * end value of item. + * @type {number} + */ + this.end = null; + + /** + * end label + * @type {number} + */ + this.endLabel = null; + + /** + * ratio of end value + * @type {number} + */ + this.endRatio = null; + + /** + * start value of item. + * @type {number} + */ + this.start = null; + + /** + * start label + * @type {number} + */ + this.startLabel = null; + + /** + * ratio of start value + * @type {number} + */ + + this.startRatio = null; + + /** + * distance of start ratio and end ratio + * @type {null} + */ + this.ratioDistance = null; + + if (predicate.isBulletChart(this.chartType)) { + /** + * @type {string} + */ + this.type = params.type; + } + + /** + * series legend name + * @type {string} + */ + this.legendName = params.legendName; + + this._initValues(params.datum, params.index); + }, + + /** + * Initialize values of item. + * @param {number|Array.} rawValue - raw value + * @param {number} index - raw data index + * @private + */ + _initValues: function(rawValue, index) { + var values = this._createValues(rawValue); + var areaType = 'makingSeriesLabel'; + var hasStart = values.length > 1; + var value = values[0]; + + this.value = this.end = value; + this.index = index; + + if (this.isDivergingChart) { + value = Math.abs(value); + } + + if (snippet.isNull(value)) { + this.label = ''; + } else { + this.label = renderUtil.formatValue({ + value: value, + formatFunctions: this.formatFunctions, + chartType: this.chartType, + areaType: areaType, + legendName: this.legendName + }); + } + + this.endLabel = this.label; + + if (hasStart) { + this.addStart(values[1], true); + this._updateFormattedValueforRange(); + this.isRange = true; + } + }, + + /** + * Crete sorted values. + * @param {Array.|number} value value + * @returns {Array.} + * @private + */ + _createValues: function(value) { + var values = snippet.map([].concat(value), function(newValue) { + return snippet.isNull(newValue) ? null : parseFloat(newValue); + }); + + values = values.sort(function(a, b) { + if (a < 0 && b < 0) { + return a - b; + } + + return b - a; + }); + + return values; + }, + + /** + * Add start. + * @param {number} value - value + * @ignore + */ + addStart: function(value) { + if (!snippet.isNull(this.start)) { + return; + } + + this.start = value; + this.startLabel = renderUtil.formatValue({ + value: value, + formatFunctions: this.formatFunctions, + chartType: this.chartType, + areaType: 'series', + legendName: this.legendName + }); + }, + + /** + * Update formatted value for range. + * @private + */ + _updateFormattedValueforRange: function() { + this.label = this.startLabel + ' ~ ' + this.endLabel; + }, + + /** + * Add ratio. + * @param {number} divNumber - number for division + * @param {?number} subNumber - number for subtraction + * @param {?number} baseRatio - base ratio + */ + addRatio: function(divNumber, subNumber, baseRatio) { + divNumber = divNumber || 1; + baseRatio = baseRatio || 1; + subNumber = subNumber || 0; + + this.ratio = this.endRatio = calculator.calculateRatio(this.value, divNumber, subNumber, baseRatio); + + if (snippet.isExisty(this.start)) { + this.startRatio = calculator.calculateRatio(this.start, divNumber, subNumber, baseRatio); + this.ratioDistance = Math.abs(this.endRatio - this.startRatio); + } + }, + + /** + * Get formatted value for tooltip. + * @param {string} valueType - value type + * @returns {string} + * @private + */ + _getFormattedValueForTooltip: function(valueType) { + return renderUtil.formatValue({ + value: this[valueType], + formatFunctions: this.formatFunctions, + chartType: this.chartType, + areaType: 'tooltip', + valueType: valueType, + legendName: this.legendName + }); + }, + + /** + * Pick value map for tooltip. + * @returns {{value: number, start: ?number, end: ?number}} + */ + pickValueMapForTooltip: function() { + var valueMap = { + value: this._getFormattedValueForTooltip('value'), + ratio: this.ratio + }; + + if (snippet.isExisty(this.start)) { + valueMap.start = this._getFormattedValueForTooltip('start'); + valueMap.end = this._getFormattedValueForTooltip('end'); + valueMap.startRatio = this.startRatio; + valueMap.endRatio = this.endRatio; + } + + return valueMap; + } + }); + + module.exports = SeriesItem; + + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview SeriesItemForCoordinateType is a element of SeriesGroup.items. + * SeriesItemForCoordinateType has processed terminal data like x, y, r, xRatio, yRatio, rRatio. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var predicate = __webpack_require__(11); + var renderUtil = __webpack_require__(7); + var snippet = __webpack_require__(6); + + var SeriesItemForCoordinateType = snippet.defineClass(/** @lends SeriesItemForCoordinateType.prototype */{ + /** + * SeriesItemForCoordinateType is a element of SeriesGroup.items. + * SeriesItemForCoordinateType has processed terminal data like x, y, r, xRatio, yRatio, rRatio. + * @constructs SeriesItemForCoordinateType + * @private + * @param {object} params - parameters + * @param {Array.|{x: number, y:number, r: ?number, label: ?string}} params.datum - raw series datum + * @param {string} params.chartType - type of chart + * @param {?Array.} params.formatFunctions - format functions + * @param {number} params.index - raw data index + */ + init: function(params) { + /** + * type of chart + * @type {string} + */ + this.chartType = params.chartType; + + /** + * format functions + * @type {Array.} + */ + this.formatFunctions = params.formatFunctions; + + /** + * x axis type + * @type {?string} + */ + this.xAxisType = params.xAxisType; + + /** + * date format + * @type {?string} + */ + this.dateFormat = params.dateFormat; + + /** + * ratio map + * @type {object} + */ + this.ratioMap = {}; + + this._initData(params.datum, params.index); + }, + + /** + * Initialize data of item. + @param {Array.|{x: number, y:number, r: ?number, label: ?string}} rawSeriesDatum - raw series datum + * @param {number} index - raw data index + * @private + */ + _initData: function(rawSeriesDatum, index) { + var date; + + if (snippet.isArray(rawSeriesDatum)) { + this.x = rawSeriesDatum[0] || 0; + this.y = rawSeriesDatum[1] || 0; + if (predicate.isBubbleChart(this.chartType)) { + this.r = rawSeriesDatum[2]; + this.label = rawSeriesDatum[3] || ''; + } else { + this.label = rawSeriesDatum[2] || ''; + } + } else { + this.x = rawSeriesDatum.x; + this.y = rawSeriesDatum.y; + this.r = rawSeriesDatum.r; + this.label = rawSeriesDatum.label || ''; + } + + if (predicate.isDatetimeType(this.xAxisType)) { + date = snippet.isDate(this.x) ? this.x : (new Date(this.x)); + this.x = date.getTime() || 0; + } + + this.index = index; + + if (!this.label) { + if (predicate.isLineTypeChart(this.chartType) && predicate.isDatetimeType(this.xAxisType)) { + this.label = renderUtil.formatDate(this.x, this.dateFormat); + } else { + this.label = renderUtil.formatValue({ + value: this.x, + formatFunctions: this.formatFunctions, + chartType: this.chartType, + areaType: 'series' + }); + } + this.label += ', ' + renderUtil.formatValue({ + value: this.y, + formatFunctions: this.formatFunctions, + chartType: this.chartType, + areaType: 'series' + }); + } + }, + + /** + * Add start. + * @param {number} value - value + * @private + */ + addStart: function(value) { + this.start = value; + }, + + /** + * Add ratio. + * @param {string} valueType - type of value like x, y, r + * @param {?number} divNumber - number for division + * @param {?number} subNumber - number for subtraction + */ + addRatio: function(valueType, divNumber, subNumber) { + if (!snippet.isExisty(this.ratioMap[valueType]) && divNumber) { + this.ratioMap[valueType] = (this[valueType] - subNumber) / divNumber; + } + }, + + /** + * Get formatted value for tooltip. + * @param {string} valueType - value type + * @returns {string} + * @private + */ + _getFormattedValueForTooltip: function(valueType) { + var ratio = this.ratioMap[valueType]; + var value = this[valueType]; + var formattedValue = renderUtil.formatValue({ + value: value, + formatFunctions: this.formatFunctions, + chartType: this.chartType, + areaType: 'tooltip', + valueType: valueType + }); + + return snippet.isNumber(ratio) ? formattedValue : value; + }, + + /** + * Pick value map for tooltip. + * @returns {{x: (number | null), y: (number | null), r: (number | null)}} + */ + pickValueMapForTooltip: function() { + var valueMap = { + x: this._getFormattedValueForTooltip('x'), + y: this._getFormattedValueForTooltip('y'), + xRatio: this.ratioMap.x, + yRatio: this.ratioMap.y + }; + + if (snippet.isExisty(this.r)) { + valueMap.r = this._getFormattedValueForTooltip('r'); + valueMap.rRatio = this.ratioMap.r; + } + + return valueMap; + } + }); + + module.exports = SeriesItemForCoordinateType; + + +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview SeriesDataModelForBoxplot is boxplot series model for drawing graph of chart series area, + * and create from rawSeriesData by user, + * SeriesDataModel.groups has SeriesGroups. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + /* + * Raw series datum. + * @typedef {{name: ?string, data: Array., stack: ?string}} rawSeriesDatum + */ + + /* + * Raw series data. + * @typedef {Array.} rawSeriesData + */ + + /* + * Groups. + * @typedef {Array.} groups + */ + + /* + * SeriesGroup is a element of SeriesDataModel.groups. + * SeriesGroup.items has SeriesItem. + */ + + /* + * SeriesItem is a element of SeriesGroup.items. + * SeriesItem has processed terminal data like value, ratio, etc. + */ + + var SeriesItemForBoxplot = __webpack_require__(108); + var SeriesDataModel = __webpack_require__(103); + var snippet = __webpack_require__(6); + + var concat = Array.prototype.concat; + + var SeriesDataModelForBoxplot = snippet.defineClass(SeriesDataModel, /** @lends SeriesDataModelForBoxplot.prototype */{ + /** + * SeriesDataModelForBoxplot is series model for boxplot chart + * SeriesDataModel.groups has SeriesGroups. + * @constructs SeriesDataModel + * @param {rawSeriesData} rawSeriesData - raw series data + * @param {string} chartType - chart type + * @param {object} options - options + * @param {Array.} formatFunctions - format functions + */ + init: function(rawSeriesData, chartType, options, formatFunctions) { + /** + * chart type + * @type {string} + */ + this.chartType = chartType; + + /** + * chart options + * @type {Object} + */ + this.options = options || {}; + + /** + * functions for formatting + * @type {Array.} + */ + this.formatFunctions = formatFunctions; + + /** + * rawData.series + * @type {rawSeriesData} + */ + this.rawSeriesData = rawSeriesData || []; + + /** + * baseGroups is base data for making SeriesGroups. + * SeriesGroups is made by pivoted baseGroups, lf line type chart. + * @type {Array.Array} + */ + this.baseGroups = null; + + /** + * groups has SeriesGroups. + * @type {Array.} + */ + this.groups = null; + + this.options.series = this.options.series || {}; + + /** + * map of values by value type like value, x, y, r. + * @type {object.>} + */ + this.valuesMap = {}; + }, + + /** + * Create base groups. + * Base groups is two-dimensional array by seriesItems. + * @returns {Array.>} + * @private + * @override + */ + _createBaseGroups: function() { + var chartType = this.chartType; + var formatFunctions = this.formatFunctions; + + return snippet.map(this.rawSeriesData, function(rawDatum) { + var data = snippet.isArray(rawDatum) ? rawDatum : [].concat(rawDatum.data); + var items = snippet.map(data, function(datum, index) { + return new SeriesItemForBoxplot({ + datum: datum, + chartType: chartType, + formatFunctions: formatFunctions, + index: index, + legendName: rawDatum.name + }); + }); + + return items; + }); + }, + + /** + * Create values that picked value from SeriesItems of SeriesGroups. + * @returns {Array.} + * @private + * * @override + */ + _createValues: function() { + var values = []; + this.map(function(seriesGroup) { + return snippet.forEach(seriesGroup.items, function(group) { + values.push(group.min); + values.push(group.max); + values.push(group.uq); + values.push(group.lq); + values.push(group.median); + }); + }); + + values = concat.apply([], values); + + return snippet.filter(values, function(value) { + return !isNaN(value); + }); + } + }); + + module.exports = SeriesDataModelForBoxplot; + + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview SeriesItem is a element of SeriesGroup.items. + * SeriesItem has processed terminal data like value, ratio, etc. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var renderUtil = __webpack_require__(7); + var calculator = __webpack_require__(45); + var snippet = __webpack_require__(6); + + var SeriesItem = snippet.defineClass(/** @lends SeriesItem.prototype */{ + /** + * SeriesItem is a element of SeriesGroup.items. + * SeriesItem has processed terminal data like value, ratio, etc. + * @constructs SeriesItem + * @private + * @param {object} params - parameters + * @param {number} params.datum - value + * @param {string} params.chartType - type of chart + * @param {?Array.} params.formatFunctions - format functions + * @param {number} params.index - raw data index + * @param {?string} params.stack - stack + */ + init: function(params) { + /** + * type of chart + * @type {string} + */ + this.chartType = params.chartType; + + /** + * format functions + * @type {Array.} + */ + this.formatFunctions = params.formatFunctions; + + /** + * value of item + * @type {number} + */ + this.value = null; + + /** + * label + * @type {string} + */ + this.label = null; + + /** + * ratio of value about distance of limit + * @type {number} + */ + this.ratio = null; + + /** + * min value of item. + * @type {number} + */ + this.min = null; + + /** + * min label + * @type {number} + */ + this.minLabel = null; + + /** + * ratio of end value + * @type {number} + */ + this.minRatio = null; + + /** + * max value of item. + * @type {number} + */ + this.max = null; + + /** + * max label + * @type {number} + */ + this.maxLabel = null; + + /** + * ratio of max value + * @type {number} + */ + this.maxRatio = null; + + /** + * median value of item. + * @type {number} + */ + this.median = null; + + /** + * median label + * @type {number} + */ + this.medianLabel = null; + + /** + * ratio of median value + * @type {number} + */ + this.medianRatio = null; + + /** + * lq value of item. + * @type {number} + */ + this.lq = null; + + /** + * lq label + * @type {number} + */ + this.lqLabel = null; + + /** + * ratio of lq value + * @type {number} + */ + this.lqRatio = null; + + /** + * uq value of item. + * @type {number} + */ + this.uq = null; + + /** + * uq label + * @type {number} + */ + this.uqLabel = null; + + /** + * ratio of uq value + * @type {number} + */ + this.uqRatio = null; + + /** + * distance of start ratio and end ratio + * @type {null} + */ + this.ratioDistance = null; + + /** + * series legend name + * @type {string} + */ + this.legendName = params.legendName; + + this._initValues(params.datum, params.index); + }, + + /** + * Initialize values of item. + * @param {number|Array.} rawValue - raw value + * @param {number} index - raw data index + * @private + */ + _initValues: function(rawValue, index) { + var values = this._createValues(rawValue); + var max = values[4]; + var uq = values[3]; + var median = values[2]; + var lq = values[1]; + var min = values[0]; + var hasOutlier = values.length > 5; + var outliers; + var formatValue = snippet.bind(function(value) { + return renderUtil.formatValue({ + value: value, + formatFunctions: this.formatFunctions, + chartType: this.chartType, + areaType: 'makingSeriesLabel', + legendName: this.legendName + }); + }, this); + + this.value = this.max = max; + this.uq = uq; + this.median = median; + this.lq = lq; + this.min = min; + this.index = index; + + if (hasOutlier) { + this.outliers = []; + + outliers = this.outliers; + + snippet.forEach(values.slice(5), function(outlier) { + outliers.push({ + value: outlier, + label: formatValue(outlier) + }); + }); + } + + this.label = formatValue(max); + this.uqLabel = formatValue(uq); + this.medianLabel = formatValue(median); + this.lqLabel = formatValue(lq); + this.minLabel = formatValue(min); + + this.maxLabel = this.label; + }, + + /** + * Crete sorted values. + * @param {Array.|number} value value + * @returns {Array.} + * @private + */ + _createValues: function(value) { + var values = snippet.map([].concat(value), function(newValue) { + return snippet.isNull(newValue) ? null : parseFloat(newValue); + }); + + return values; + }, + + /** + * Add min. + * @param {number} value - value + * @private + */ + addStart: function(value) { + if (!snippet.isNull(this.min)) { + return; + } + + this.min = value; + this.minLabel = renderUtil.formatValue({ + value: value, + formatFunctions: this.formatFunctions, + chartType: this.chartType, + areaType: 'series', + legendName: this.legendName + }); + }, + + /** + * Update formatted value for range. + * @private + */ + _updateFormattedValueforRange: function() { + this.label = this.minLabel + ' ~ ' + this.maxLabel; + }, + + /** + * Add ratio. + * @param {number} divNumber - number for division + * @param {?number} subNumber - number for subtraction + * @param {?number} baseRatio - base ratio + */ + addRatio: function(divNumber, subNumber, baseRatio) { + var calculateRatio = calculator.calculateRatio; + + divNumber = divNumber || 1; + baseRatio = baseRatio || 1; + subNumber = subNumber || 0; + + this.ratio = this.maxRatio = calculateRatio(this.max, divNumber, subNumber, baseRatio); + this.uqRatio = calculateRatio(this.uq, divNumber, subNumber, baseRatio); + this.medianRatio = calculateRatio(this.median, divNumber, subNumber, baseRatio); + this.lqRatio = calculateRatio(this.lq, divNumber, subNumber, baseRatio); + this.minRatio = calculateRatio(this.min, divNumber, subNumber, baseRatio); + + snippet.forEach(this.outliers, function(outlier) { + outlier.ratio = calculateRatio(outlier.value, divNumber, subNumber, baseRatio); + }); + + this.ratioDistance = Math.abs(this.uqRatio - this.lqRatio); + }, + + /** + * Get formatted value for tooltip. + * @param {string} valueType - value type + * @returns {string} + * @private + */ + _getFormattedValueForTooltip: function(valueType) { + return renderUtil.formatValue({ + value: this[valueType], + formatFunctions: this.formatFunctions, + chartType: this.chartType, + areaType: 'tooltip', + valueType: valueType, + legendName: this.legendName + }); + }, + + /** + * Pick value map for tooltip. + * @returns {{value: number, min: ?number, max: ?number}} + */ + pickValueMapForTooltip: function() { + var valueMap = { + value: this._getFormattedValueForTooltip('value'), + ratio: this.ratio + }; + + if (snippet.isExisty(this.min)) { + valueMap.min = this._getFormattedValueForTooltip('min'); + valueMap.max = this._getFormattedValueForTooltip('max'); + valueMap.minRatio = this.minRatio; + valueMap.maxRatio = this.maxRatio; + valueMap.maxLabel = this.maxLabel; + valueMap.minLabel = this.minLabel; + valueMap.uqLabel = this.uqLabel; + valueMap.lqLabel = this.lqLabel; + valueMap.medianLabel = this.medianLabel; + valueMap.outliers = this.outliers; + } + + return valueMap; + } + }); + + module.exports = SeriesItem; + + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview SeriesDataModel for Bullet Chart + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var SeriesItem = __webpack_require__(105); + var SeriesDataModel = __webpack_require__(103); + var chartConst = __webpack_require__(8); + var snippet = __webpack_require__(6); + + var SeriesDataModelForBullet = snippet.defineClass(SeriesDataModel, /** @lends SeriesDataModelForBullet.prototype */ { + /** + * SeriesDataModelForBullet is series model for boxplot chart + * SeriesDataModel.groups has SeriesGroups. + * @constructs SeriesDataModel + * @param {rawSeriesData} rawSeriesData - raw series data + * @param {string} chartType - chart type + * @param {object} options - options + * @param {Array.} formatFunctions - format functions + */ + init: function(rawSeriesData, chartType, options, formatFunctions) { + SeriesDataModel.call(this, rawSeriesData, chartType, options, formatFunctions); + }, + + /** + * Create base groups. + * Base groups is two-dimensional array by seriesItems. + * @returns {Array.>} + * @private + * @override + */ + _createBaseGroups: function() { + var chartType = this.chartType; + var formatFunctions = this.formatFunctions; + var maxRangeCount = 0; + var maxMarkerCount = 0; + var baseGroups = snippet.map(this.rawSeriesData, function(rawDatum) { + var items = []; + var data = rawDatum.data; + var markers = rawDatum.markers; + var markerCount = markers.length; + var ranges = rawDatum.ranges; + var rangeCount = ranges.length; + + if (ranges && rangeCount) { + snippet.map(ranges, function(range) { + items.push(new SeriesItem({ + datum: range, + chartType: chartType, + formatFunctions: formatFunctions, + type: chartConst.BULLET_TYPE_RANGE + })); + }); + maxRangeCount = Math.max(maxRangeCount, rangeCount); + } + + if (data) { + items.push(new SeriesItem({ + datum: data, + chartType: chartType, + formatFunctions: formatFunctions, + type: chartConst.BULLET_TYPE_ACTUAL + })); + } + + if (markers && markerCount) { + snippet.map(markers, function(marker) { + items.push(new SeriesItem({ + datum: marker, + chartType: chartType, + formabutFunctions: formatFunctions, + type: chartConst.BULLET_TYPE_MARKER + })); + }); + maxMarkerCount = Math.max(maxMarkerCount, markerCount); + } + + return items; + }); + + this.maxMarkerCount = maxMarkerCount; + this.maxRangeCount = maxRangeCount; + + return baseGroups; + }, + + /** + * Create SeriesGroups from rawData.series. + * @returns {Array.} + * @private + */ + _createSeriesGroupsFromRawData: function() { + return SeriesDataModel.prototype._createSeriesGroupsFromRawData.call(this); + } + }); + + module.exports = SeriesDataModelForBullet; + + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview SeriesDataModelForTreemap is base model for drawing graph of treemap chart series area. + * SeriesDataModel.groups has SeriesGroups. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var SeriesDataModel = __webpack_require__(103); + var SeriesItem = __webpack_require__(111); + var chartConst = __webpack_require__(8); + var calculator = __webpack_require__(45); + var snippet = __webpack_require__(6); + + var aps = Array.prototype.slice; + + var SeriesDataModelForTreeMap = snippet.defineClass(SeriesDataModel, /** @lends SeriesDataModelForTreeMap.prototype */{ + /** + * SeriesDataModelForTreemap is base model for drawing graph of treemap chart series area. + * @constructs SeriesDataModelForTreemap + * @private + */ + init: function() { + SeriesDataModel.apply(this, arguments); + + /** + * cached found seriesItems map + * @type {object.>} + */ + this.foundSeriesItemsMap = {}; + + /** + * cached seriesItem map + * @type {object} + */ + this.seriesItemMap = {}; + }, + + /** + * Flatten hierarchical data. + * @param {Array.} rawSeriesData - raw series data + * @param {string | number} parent - parent id + * @param {?Array.} ancestorIndexes - ancestor indexes + * @returns {Array.} + * @private + */ + _flattenHierarchicalData: function(rawSeriesData, parent, ancestorIndexes) { + var self = this; + var flatData = []; + var idPrefix; + + if (parent) { + idPrefix = parent + '_'; + } else { + idPrefix = chartConst.TREEMAP_ID_PREFIX; + parent = chartConst.TREEMAP_ROOT_ID; + } + + ancestorIndexes = ancestorIndexes || []; + + snippet.forEachArray(rawSeriesData, function(datum, index) { + var id = idPrefix + index; + var children = datum.children; + var indexes = ancestorIndexes.concat(index); + + datum.indexes = indexes; + + if (!snippet.isNull(datum.value)) { + flatData.push(datum); + } + + if (!datum.id) { + datum.id = id; + } + + if (!datum.parent) { + datum.parent = parent; + } + + if (children) { + flatData = flatData.concat(self._flattenHierarchicalData(children, id, indexes)); + delete datum.children; + } + }); + + return flatData; + }, + + /** + * Partition raw series data by parent id + * @param {Array.} rawSeriesData - raw series data + * @param {string | number} parent - parent id + * @returns {Array.} + * @private + */ + _partitionRawSeriesDataByParent: function(rawSeriesData, parent) { + var filtered = []; + var rejected = []; + + snippet.forEachArray(rawSeriesData, function(datum) { + if (datum.parent === parent) { + filtered.push(datum); + } else { + rejected.push(datum); + } + }); + + return [filtered, rejected]; + }, + + /** + * Set tree properties like depth, group in raw series data. + * @param {Array.} flatSeriesData - flat series data + * @param {number} depth - tree depth + * @param {number} parent - parent id + * @param {number} group - tree group + * @returns {Array.} + * @private + */ + _setTreeProperties: function(flatSeriesData, depth, parent, group) { + var self = this; + var parted = this._partitionRawSeriesDataByParent(flatSeriesData, parent); + var filtered = parted[0]; + var rejected = parted[1]; + var childDepth = depth + 1; + + snippet.forEachArray(filtered, function(datum, index) { + var descendants, children; + + datum.depth = depth; + datum.group = snippet.isUndefined(group) ? index : group; + + descendants = self._setTreeProperties(rejected, childDepth, datum.id, datum.group); + children = snippet.filter(descendants, function(descendant) { + return descendant.depth === childDepth; + }); + + if (children.length) { + datum.value = calculator.sum(snippet.pluck(children, 'value')); + datum.hasChild = true; + } else { + datum.hasChild = false; + } + + filtered = filtered.concat(descendants); + }); + + return filtered; + }, + + /** + * Set ratio. + * @param {Array.} flatSeriesData - raw series data + * @param {string} parent - parent id + * @private + */ + _setRatio: function(flatSeriesData, parent) { + var self = this; + var parted = this._partitionRawSeriesDataByParent(flatSeriesData, parent); + var filtered = parted[0]; + var rejected = parted[1]; + var total = calculator.sum(snippet.pluck(filtered, 'value')); + + snippet.forEachArray(filtered, function(datum) { + var value = snippet.isNull(datum.value) ? 0 : datum.value; + + datum.ratio = value / total; + + if (datum.hasChild) { + self._setRatio(rejected, datum.id); + } + }); + }, + + /** + * Create base groups. + * @returns {Array.>} + * @private + * @override + */ + _createBaseGroups: function() { + var chartType = this.chartType; + var seriesItemMap = this.seriesItemMap; + var formatFunctions = this.formatFunctions; + var flatSeriesData = this._flattenHierarchicalData(this.rawSeriesData); + flatSeriesData = this._setTreeProperties(flatSeriesData, 1, chartConst.TREEMAP_ROOT_ID); + this._setRatio(flatSeriesData, chartConst.TREEMAP_ROOT_ID); + + return [snippet.map(flatSeriesData, function(rawDatum) { + var seriesItem = new SeriesItem(rawDatum, formatFunctions, chartType); + + seriesItemMap[seriesItem.id] = seriesItem; + + return seriesItem; + })]; + }, + + /** + * Find SeriesItems. + * @param {string} key - key + * @param {function} condition - condition function + * @returns {Array.} + * @private + */ + _findSeriesItems: function(key, condition) { + if (!this.foundSeriesItemsMap[key]) { + this.foundSeriesItemsMap[key] = this.getFirstSeriesGroup(true).filter(condition); + } + + return this.foundSeriesItemsMap[key]; + }, + + /** + * Make cache key for caching found SeriesItems. + * @param {string} prefix - prefix + * @returns {string} + * @private + */ + _makeCacheKey: function(prefix) { + var key = prefix; + + if (arguments.length > 1) { + key += aps.call(arguments, 1).join('_'); + } + + return key; + }, + + /** + * Whether valid group or not. + * If comparingGroup is undefined or group and comparingGroup are equal, this group is valid. + * @param {number} group - group + * @param {number} [comparingGroup] - comparing group + * @returns {boolean} + * @private + */ + _isValidGroup: function(group, comparingGroup) { + return !snippet.isExisty(comparingGroup) || (group === comparingGroup); + }, + + /** + * Find SeriesItems by depth. + * @param {number} depth - tree depth + * @param {number} [group] - tree group + * @returns {Array.} + */ + findSeriesItemsByDepth: function(depth, group) { + var self = this; + var key = this._makeCacheKey(chartConst.TREEMAP_DEPTH_KEY_PREFIX, depth, group); + + return this._findSeriesItems(key, function(seriesItem) { + return (seriesItem.depth === depth) && self._isValidGroup(seriesItem.group, group); + }); + }, + + /** + * Find SeriesItems by parent id. + * @param {string | number} parent - parent id + * @returns {Array.} + */ + findSeriesItemsByParent: function(parent) { + var key = this._makeCacheKey(chartConst.TREEMAP_PARENT_KEY_PREFIX, parent); + + return this._findSeriesItems(key, function(seriesItem) { + return seriesItem.parent === parent; + }); + }, + + /** + * Find leaf SeriesItems. + * @param {number} [group] - tree group + * @returns {Array.} + */ + findLeafSeriesItems: function(group) { + var self = this; + var key = this._makeCacheKey(chartConst.TREEMAP_LEAF_KEY_PREFIX, group); + + return this._findSeriesItems(key, function(seriesItem) { + return !seriesItem.hasChild && self._isValidGroup(seriesItem.group, group); + }); + }, + + /** + * Find parent by depth. + * @param {string} id - id + * @param {number} depth - depth + * @returns {SeriesItem|null} + */ + findParentByDepth: function(id, depth) { + var seriesItem = this.seriesItemMap[id] || null; + + if (seriesItem && seriesItem.depth !== depth) { + seriesItem = this.findParentByDepth(seriesItem.parent, depth); + } + + return seriesItem; + }, + + /** + * Initialize foundSeriesItemsMap. + */ + initSeriesItemsMap: function() { + this.foundSeriesItemsMap = null; + } + }); + + module.exports = SeriesDataModelForTreeMap; + + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview SeriesItem for treemap. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var calculator = __webpack_require__(45); + var renderUtil = __webpack_require__(7); + var snippet = __webpack_require__(6); + + var SeriesItemForTreemap = snippet.defineClass(/** @lends SeriesItemForTreemap.prototype */{ + /** + * SeriesItem for treemap. + * @constructs SeriesItemForTreemap + * @private + * @param {object} rawSeriesDatum - value + * @param {?Array.} formatFunctions - format functions + * @param {string} chartType - type of chart + */ + init: function(rawSeriesDatum, formatFunctions, chartType) { + /** + * type of chart + * @type {string} + */ + this.chartType = chartType; + + /** + * format functions + * @type {Array.} + */ + this.formatFunctions = formatFunctions; + this.id = rawSeriesDatum.id; + this.parent = rawSeriesDatum.parent; + this.value = rawSeriesDatum.value; + this.ratio = rawSeriesDatum.ratio; + this.colorValue = rawSeriesDatum.colorValue; + this.depth = rawSeriesDatum.depth; + this.label = rawSeriesDatum.label || ''; + this.group = rawSeriesDatum.group; + this.hasChild = !!rawSeriesDatum.hasChild; + this.indexes = rawSeriesDatum.indexes; + }, + + /** + * Add ratio. + * @param {number} divNumber - number for division + * @param {?number} subNumber - number for subtraction + */ + addRatio: function(divNumber, subNumber) { + divNumber = divNumber || 1; + subNumber = subNumber || 0; + + this.colorRatio = calculator.calculateRatio(this.colorValue, divNumber, subNumber, 1) || -1; + }, + + /** + * Pick value map for tooltip. + * @returns {{value: number, label: string}} + */ + pickValueMapForTooltip: function() { + var formatFunctions = this.formatFunctions; + var chartType = this.chartType; + var colorValue = this.colorValue; + var formattedValue = renderUtil.formatValue({ + value: this.value, + formatFunctions: formatFunctions, + chartType: chartType, + areaType: 'tooltipValue' + }); + var label = (this.label ? this.label + ': ' : '') + formattedValue; + var valueMap = { + value: formattedValue, + label: label, + ratio: this.ratio + }; + + if (snippet.isExisty(colorValue)) { + valueMap.colorValue = renderUtil.formatValue({ + value: colorValue, + formatFunctions: formatFunctions, + chartType: chartType, + areaType: 'tooltipColorValue' + }); + valueMap.colorRatio = this.colorRatio; + } + + return valueMap; + }, + + /** + * Pick data for label template. + * @param {number} total - value total + * @returns {{value: number, ratio: number, label: string, colorValue: ?number, colorValueRatio: ?number}} + */ + pickLabelTemplateData: function() { + var templateData = { + value: this.value, + ratio: this.ratio, + label: this.label + }; + + if (snippet.isExisty(this.colorValue)) { + templateData.colorValue = this.colorValue; + templateData.colorValueRatio = this.ratio; + } + + return templateData; + } + }); + + module.exports = SeriesItemForTreemap; + + +/***/ }), +/* 112 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Bounds and scale data builder. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var BoundsModel = __webpack_require__(113); + var ScaleDataModel = __webpack_require__(119); + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + + /** + * Bounds and scale data builder. + * @module boundsAndScaleBuilder + * @private */ + var boundsAndScaleBuilder = { + /** + * Create BoundsModel. + * @param {DataProcessor} dataProcessor - DataProcessor instance + * @param {object} params - parameters + * @returns {BoundsModel} + * @private + */ + _createBoundsModel: function(dataProcessor, params) { + return new BoundsModel({ + chartType: params.chartType, + seriesTypes: params.seriesTypes, + options: params.options, + theme: params.theme, + dataProcessor: dataProcessor, + hasAxes: params.hasAxes, + isVertical: params.isVertical + }); + }, + + /** + * Create ScaleDataModel. + * @param {DataProcessor} dataProcessor - DataProcessor instance + * @param {BoundsModel} boundsModel - BoundsModel instance + * @param {object} params - parameters + * @returns {ScaleDataModel} + * @private + */ + _createScaleDataModel: function(dataProcessor, boundsModel, params) { + return new ScaleDataModel({ + chartType: params.chartType, + seriesTypes: params.seriesTypes, + options: params.options, + theme: params.theme, + dataProcessor: dataProcessor, + boundsModel: boundsModel, + hasRightYAxis: params.hasRightYAxis, + addedDataCount: params.addedDataCount + }); + }, + + /** + * Add y axis scale. + * @param {ScaleDataModel} scaleDataModel - ScaleDataModel instance + * @param {string} name - component name + * @param {object} scaleOption - option for add scale + * @param {object} yAxisOptions - option for yAxis + */ + addYAxisScale: function(scaleDataModel, name, scaleOption, yAxisOptions) { + scaleDataModel.addScale(name, (scaleOption && scaleOption.options) || yAxisOptions || {}, { + valueType: scaleOption.valueType || 'value', + areaType: scaleOption.areaType, + chartType: scaleOption.chartType + }, scaleOption.additionalOptions); + }, + + /** + * Register dimension for y axis. + * @param {ComponentManager} componentManager - ComponentManager instance + * @param {BoundsModel} boundsModel - BoundsModel instance + * @param {object.} scaleDataMap - scale data map + * @param {string} axisName - axis name like yAxis and rightYAxis + * @param {boolean} isVertical - whether vertical or not + * @private + */ + _registerYAxisDimension: function(componentManager, boundsModel, scaleDataMap, axisName, isVertical) { + var yAxis = componentManager.get(axisName); + var limit = null; + var scaleData; + + if (!yAxis) { + return; + } + + scaleData = scaleDataMap[axisName]; + + if (scaleData) { + limit = scaleData.limit; + } + + boundsModel.registerYAxisDimension(limit, axisName, yAxis.options, yAxis.theme, isVertical); + }, + + /** + * Set layout bounds and scale. + * @param {DataProcessor} dataProcessor - DataProcessor instance + * @param {ComponentManager} componentManager - ComponentManager instance + * @param {BoundsModel} boundsModel - BoundsModel instance + * @param {ScaleDataModel} scaleDataModel - ScaleDataModel instance + * @param {object} params - parameter for setting layout bounds and scale data. + * @private + */ + _setLayoutBoundsAndScale: function(dataProcessor, componentManager, boundsModel, scaleDataModel, params) { + var options = params.options; + var scaleOption = params.scaleOption || {}; + var addingDataMode = params.addingDataMode; + var isVertical = params.isVertical; + var scaleDataMap; + + // 01. register base dimension + if (componentManager.has('xAxis')) { + boundsModel.registerXAxisHeight(); + } + + if (componentManager.has('legend')) { + if (componentManager.get('legend').colorSpectrum) { + boundsModel.registerSpectrumLegendDimension(); + } else { + boundsModel.registerLegendDimension(); + } + } + + // 02. add scale of y axis and legend + if (scaleOption.yAxis) { + this.addYAxisScale(scaleDataModel, 'yAxis', scaleOption.yAxis, params.options.yAxis); + } + + if (scaleOption.rightYAxis) { + this.addYAxisScale(scaleDataModel, 'rightYAxis', scaleOption.rightYAxis); + } + + if (scaleOption.legend) { + scaleDataModel.addScale('legend', {}, { + chartType: params.chartType + }, { + tickCounts: [chartConst.SPECTRUM_LEGEND_TICK_COUNT] + }); + } + + scaleDataMap = scaleDataModel.scaleDataMap; + + // 03. register y axis dimension + this._registerYAxisDimension(componentManager, boundsModel, scaleDataMap, 'yAxis', isVertical); + this._registerYAxisDimension(componentManager, boundsModel, scaleDataMap, 'rightYAxis', isVertical); + + // 04. add x axis scale + if (scaleOption.xAxis) { + scaleDataModel.addScale('xAxis', options.xAxis, { + valueType: scaleOption.xAxis.valueType || 'value' + }, scaleOption.xAxis.additionalOptions); + } + + // 05. create and configure axis data map + if (params.hasAxes) { + scaleDataModel.setAxisDataMap(); + } + + // 06. register series dimension + boundsModel.registerSeriesDimension(); + + // 07. register circle legend dimension, if there is a circle legend + if (componentManager.has('circleLegend') && options.circleLegend.visible) { + boundsModel.registerCircleLegendDimension(scaleDataModel.axisDataMap); + } + + if (componentManager.has('xAxis')) { + // 08. update axisData, when autoTickInterval option exist + if (predicate.isAutoTickInterval(options.xAxis.tickInterval)) { + scaleDataModel.updateXAxisDataForAutoTickInterval(params.prevXAxisData, addingDataMode); + } + + // 09. update axisData related to the rotation of label on x axis + scaleDataModel.updateXAxisDataForLabel(addingDataMode); + } + + // 10. regiser dimension of rest components + // register positon of all components + boundsModel.registerBoundsData(scaleDataModel.axisDataMap.xAxis); + }, + + /** + * Build layout bounds and scale data. + * @param {DataProcessor} dataProcessor - DataProcessor instance + * @param {ComponentManager} componentManager - ComponentManager instance + * @param {object} params - parameter for building layout bounds and scale data. + * @returns {{ + * dimensionMap: object, + * positionMap: object, + * limitMap: { + * xAxis: ?{min: number, max: number}, + * yAxis: ?{min: number, max: number}, + * rightYAxis: ?{min: number, max: number}, + * legend: ?{min: number, max: number} + * }, + * axisDataMap: ?object, + * maxRadius: ?number, + * legendScaleData: ?object + * }} + */ + build: function(dataProcessor, componentManager, params) { + var boundsModel = this._createBoundsModel(dataProcessor, params); + var scaleDataModel = this._createScaleDataModel(dataProcessor, boundsModel, params); + var boundsAndScale; + + this._setLayoutBoundsAndScale(dataProcessor, componentManager, boundsModel, scaleDataModel, params); + + boundsAndScale = { + dimensionMap: boundsModel.dimensionMap, + positionMap: boundsModel.positionMap, + limitMap: scaleDataModel.makeLimitMap(params.seriesTypes || [params.chartType], params.isVertical) + }; + + if (scaleDataModel.axisDataMap) { + boundsAndScale.axisDataMap = scaleDataModel.axisDataMap; + } + + if (predicate.isBubbleChart(params.chartType)) { + boundsAndScale.maxRadius = boundsModel.calculateMaxRadius(scaleDataModel.axisDataMap); + } + + if (scaleDataModel.scaleDataMap.legend) { + boundsAndScale.legendScaleData = scaleDataModel.scaleDataMap.legend; + } + + return boundsAndScale; + } + }; + + module.exports = boundsAndScaleBuilder; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Bounds model. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var renderUtil = __webpack_require__(7); + var raphaelRenderUtil = __webpack_require__(5); + var circleLegendCalculator = __webpack_require__(114); + var axisCalculator = __webpack_require__(115); + var legendCalculator = __webpack_require__(116); + var seriesCalculator = __webpack_require__(117); + var spectrumLegendCalculator = __webpack_require__(118); + var snippet = __webpack_require__(6); + + /** + * Dimension. + * @typedef {{width: number, height:number}} dimension + * @private + */ + + /** + * Position. + * @typedef {{left: number, top:number}} position + * @private + */ + + /** + * Bound. + * @typedef {{dimension: dimension, position:position}} bound + * @private + */ + + var BoundsModel = snippet.defineClass(/** @lends BoundsModel.prototype */{ + /** + * Bounds maker. + * @constructs BoundsModel + * @private + * @param {object} params parameters + */ + init: function(params) { + /** + * options + * @type {object} + */ + this.options = params.options || {}; + this.options.legend = this.options.legend || {}; + this.options.yAxis = this.options.yAxis || {}; + + /** + * theme + * @type {object} + */ + this.theme = params.theme || {}; + + /** + * whether chart has axes or not + * @type {boolean} + */ + this.hasAxes = params.hasAxes; + + /** + * chart type + * @type {string} + */ + this.chartType = params.chartType; + + /** + * series types + */ + this.seriesTypes = params.seriesTypes || []; + + /** + * data processor + * @type {DataProcessor} + */ + this.dataProcessor = params.dataProcessor; + + this.initBoundsData(); + }, + + /** + * Initialize bounds data. + */ + initBoundsData: function() { + this.dimensionMap = { + legend: { + width: 0 + }, + yAxis: { + width: 0 + }, + rightYAxis: { + width: 0 + }, + xAxis: { + height: 0 + }, + circleLegend: { + width: 0 + }, + chartExportMenu: { + width: 0 + } + }; + + this.positionMap = {}; + + /** + * chart left padding + * @type {number} + */ + this.chartLeftPadding = chartConst.CHART_PADDING; + + this.maxRadiusForBubbleChart = null; + + this._registerChartDimension(); + this._registerTitleDimension(); + this._registerChartExportMenuDimension(); + }, + + /** + * Register dimension. + * @param {string} name component name + * @param {dimension} dimension component dimension + * @private + */ + _registerDimension: function(name, dimension) { + this.dimensionMap[name] = snippet.extend(this.dimensionMap[name] || {}, dimension); + }, + + /** + * Get bound. + * @param {string} name component name + * @returns {bound} component bound + */ + getBound: function(name) { + return { + dimension: this.dimensionMap[name] || {}, + position: this.positionMap[name] || {} + }; + }, + + /** + * Set bound. + * @param {string} name component name + * @param {bound} bound component bound + * @private + */ + _setBound: function(name, bound) { + this.dimensionMap[name] = bound.dimension; + this.positionMap[name] = bound.position; + }, + + /** + * Get dimension. + * @param {string} name component name + * @returns {dimension} component dimension + */ + getDimension: function(name) { + return this.dimensionMap[name]; + }, + + /** + * Get dimension map. + * @param {string} types - dimension type names + * @returns {object} + */ + getDimensionMap: function(types) { + var self = this; + var dimensionMap = {}; + + if (types && types.length) { + snippet.forEachArray(types, function(type) { + dimensionMap[type] = self.dimensionMap[type]; + }); + } else { + dimensionMap = this.dimensionMap; + } + + return JSON.parse(JSON.stringify((dimensionMap))); + }, + + /** + * Get position. + * @param {string} name component name + * @returns {position} component position + */ + getPosition: function(name) { + return this.positionMap[name]; + }, + + /** + * Register chart dimension + * @private + */ + _registerChartDimension: function() { + var chartOptions = this.options.chart || {}, + dimension = { + width: chartOptions.width || chartConst.CHART_DEFAULT_WIDTH, + height: chartOptions.height || chartConst.CHART_DEFAULT_HEIGHT + }; + + this._registerDimension('chart', dimension); + }, + + /** + * Register title dimension + * @private + */ + _registerTitleDimension: function() { + var chartOptions = this.options.chart || {}; + var hasTitleOption = snippet.isExisty(chartOptions.title); + var titleHeight = + hasTitleOption ? raphaelRenderUtil.getRenderedTextSize(chartOptions.title.text, + this.theme.title.fontSize, this.theme.title.fontFamily).height : 0; + var dimension = { + height: titleHeight ? titleHeight + chartConst.TITLE_PADDING : 0 + }; + + this._registerDimension('title', dimension); + }, + + /** + * Register chartExportMenu dimension + * @private + */ + _registerChartExportMenuDimension: function() { + var dimension; + + if (this.options.chartExportMenu.visible) { + dimension = { + height: 17 + chartConst.CHART_PADDING, + width: 60 + }; + } else { + dimension = { + width: 0, + height: 0 + }; + } + this._registerDimension('chartExportMenu', dimension); + }, + + /** + * Register height for x axis component. + */ + registerXAxisHeight: function() { + this._registerDimension('xAxis', { + height: axisCalculator.calculateXAxisHeight(this.options.xAxis, this.theme.xAxis) + }); + }, + + /** + * Register dimension for legend component. + */ + registerLegendDimension: function() { + var legendLabels = snippet.pluck(this.dataProcessor.getOriginalLegendData(), 'label'); + var legendOptions = this.options.legend; + var labelTheme = this.theme.legend.label; + var chartWidth = this.getDimension('chart').width; + var legendDimension = legendCalculator.calculate(legendOptions, labelTheme, legendLabels, chartWidth); + + this._registerDimension('legend', legendDimension); + }, + + /** + * Register dimension for spectrum legend component. + */ + registerSpectrumLegendDimension: function() { + var maxValue = this.dataProcessor.getFormattedMaxValue(this.chartType, 'legend'); + var labelTheme = this.theme.label; + var dimension; + + if (predicate.isHorizontalLegend(this.options.legend.align)) { + dimension = spectrumLegendCalculator._makeHorizontalDimension(maxValue, labelTheme); + } else { + dimension = spectrumLegendCalculator._makeVerticalDimension(maxValue, labelTheme); + } + + this._registerDimension('legend', dimension); + }, + + /** + * Register dimension for y axis. + * @param {{min: number, max: number}} limit - min, max + * @param {string} componentName - component name like yAxis, rightYAxis + * @param {object} options - options for y axis + * @param {{title: object, label: object}} theme - them for y axis + * @param {boolean} isVertical - whether vertical or not + */ + registerYAxisDimension: function(limit, componentName, options, theme, isVertical) { + var categories, yAxisOptions; + + if (limit) { + categories = [limit.min, limit.max]; + } else if (predicate.isHeatmapChart(this.chartType) || !isVertical) { + categories = this.dataProcessor.getCategories(true); + } else { + return; + } + + if (snippet.isArray(options)) { + yAxisOptions = (componentName === 'yAxis') ? options[0] : options[1]; + } else { + yAxisOptions = options; + } + + this._registerDimension(componentName, { + width: axisCalculator.calculateYAxisWidth(categories, yAxisOptions, theme) + }); + }, + + /** + * Create series width. + * @returns {number} series width + */ + calculateSeriesWidth: function() { + var dimensionMap = this.getDimensionMap(['chart', 'yAxis', 'legend', 'rightYAxis']); + + return seriesCalculator.calculateWidth(dimensionMap, this.options.legend); + }, + + /** + * Create series height + * @returns {number} series height + */ + calculateSeriesHeight: function() { + var dimensionMap = this.getDimensionMap(['chart', 'title', 'legend', 'xAxis', 'chartExportMenu']); + + return seriesCalculator.calculateHeight(dimensionMap, this.options.legend, this.chartType, this.theme.series); + }, + + getBaseSizeForLimit: function(isVertical) { + var baseSize; + + if (isVertical) { + baseSize = this.calculateSeriesHeight(); + } else { + baseSize = this.calculateSeriesWidth(); + } + + return baseSize; + }, + + /** + * Make series dimension. + * @returns {{width: number, height: number}} series dimension + * @private + */ + _makeSeriesDimension: function() { + return { + width: this.calculateSeriesWidth(), + height: this.calculateSeriesHeight() + }; + }, + + /** + * Register series dimension. + */ + registerSeriesDimension: function() { + var seriesDimension = this._makeSeriesDimension(); + + this._registerDimension('series', seriesDimension); + }, + + /** + * Update width of legend and series of BoundsModel. + * @param {number} circleLegendWidth - width for circle legend + * @param {number} diffWidth - difference width + * @private + */ + _updateLegendAndSeriesWidth: function(circleLegendWidth, diffWidth) { + var legendOptions = this.options.legend; + + if (predicate.isVerticalLegend(legendOptions.align) && legendOptions.visible) { + this._registerDimension('legend', { + width: circleLegendWidth + }); + } + + this._registerDimension('series', { + width: this.getDimension('series').width - diffWidth + }); + }, + + /** + * Register dimension of circle legend. + * @param {object} axisDataMap - axisData map + * @private + */ + registerCircleLegendDimension: function(axisDataMap) { + var seriesDimension = this.getDimension('series'); + var legendOptions = this.options.legend; + var maxLabel = this.dataProcessor.getFormattedMaxValue(this.chartType, 'circleLegend', 'r'); + var fontFamily = this.theme.chart.fontFamily; + var circleLegendWidth = circleLegendCalculator.calculateCircleLegendWidth(seriesDimension, axisDataMap, + maxLabel, fontFamily); + var legendWidth, diffWidth; + + if (predicate.isVerticalLegend(legendOptions.align) && legendOptions.visible) { + legendWidth = this.getDimension('legend').width; + } else { + legendWidth = 0; + } + + circleLegendWidth = Math.min(circleLegendWidth, Math.max(legendWidth, chartConst.MIN_LEGEND_WIDTH)); + diffWidth = circleLegendWidth - legendWidth; + + this._registerDimension('circleLegend', { + width: circleLegendWidth, + height: circleLegendWidth + }); + + /** + * the reason why check diffWidth is positive: + * if circle legend area is narrower than text legend area, patial text legend area is not showing. + * because legend area width is set to circle legend area + */ + if (diffWidth > 0) { + /** + * If circle legend area is wider than text legend area, + * recalculate legend and series width, base on circle legend width + */ + this._updateLegendAndSeriesWidth(circleLegendWidth, diffWidth); + } + }, + + /** + * Make plot dimention + * @returns {{width: number, height: number}} plot dimension + * @private + */ + _makePlotDimension: function() { + var seriesDimension = this.getDimension('series'); + + return { + width: seriesDimension.width, + height: seriesDimension.height + chartConst.OVERLAPPING_WIDTH + }; + }, + + /** + * Register center components dimension. + * @private + */ + _registerCenterComponentsDimension: function() { + var seriesDimension = this.getDimension('series'); + + this._registerDimension('tooltip', seriesDimension); + this._registerDimension('mouseEventDetector', seriesDimension); + }, + + /** + * Register axis components dimension. + * @private + */ + _registerAxisComponentsDimension: function() { + var plotDimension = this._makePlotDimension(); + + this._registerDimension('plot', plotDimension); + + this._registerDimension('xAxis', { + width: plotDimension.width + }); + + this._registerDimension('yAxis', { + height: plotDimension.height + }); + + this._registerDimension('rightYAxis', { + height: plotDimension.height + }); + }, + + /** + * Update width of dimensions. + * @param {object} overflowInfo overflowLeft, overflowRight + * @private + */ + _updateDimensionsWidth: function(overflowInfo) { + var overflowLeft = Math.max(overflowInfo.overflowLeft, 0); + var overflowRight = Math.max(overflowInfo.overflowRight, 0); + var margin = overflowLeft + overflowRight; + + this.chartLeftPadding += overflowLeft; + this.dimensionMap.plot.width -= margin; + this.dimensionMap.series.width -= margin; + this.dimensionMap.mouseEventDetector.width -= margin; + this.dimensionMap.xAxis.width -= margin; + }, + + /** + * Update height of dimensions. + * @param {number} diffHeight diff height + * @private + */ + _updateDimensionsHeight: function(diffHeight) { + this.dimensionMap.plot.height -= diffHeight; + this.dimensionMap.series.height -= diffHeight; + this.dimensionMap.mouseEventDetector.height -= diffHeight; + this.dimensionMap.tooltip.height -= diffHeight; + this.dimensionMap.yAxis.height -= diffHeight; + this.dimensionMap.rightYAxis.height -= diffHeight; + this.dimensionMap.xAxis.height += diffHeight; + }, + + /** + * Update dimensions for label of x axis. + * @param {?object} xAxisData - axis data for x axis. + * @private + */ + _updateDimensionsForXAxisLabel: function(xAxisData) { + if (xAxisData.overflowRight > 0 || xAxisData.overflowLeft > 0) { + this._updateDimensionsWidth(xAxisData); + } + + if (xAxisData.overflowHeight) { + this._updateDimensionsHeight(xAxisData.overflowHeight); + } + }, + + /** + * Register axes type component positions. + * @param {number} leftLegendWidth legend width + * @private + */ + _registerAxisComponentsPosition: function(leftLegendWidth) { + var seriesPosition = this.getPosition('series'), + seriesDimension = this.getDimension('series'), + yAxisWidth = this.getDimension('yAxis').width, + leftAreaWidth = leftLegendWidth + yAxisWidth + seriesDimension.width; + + this.positionMap.plot = { + top: seriesPosition.top, + left: seriesPosition.left + }; + + this.positionMap.yAxis = { + top: seriesPosition.top, + left: this.chartLeftPadding + leftLegendWidth + }; + + this.positionMap.xAxis = { + top: seriesPosition.top + seriesDimension.height, + left: seriesPosition.left + }; + + this.positionMap.rightYAxis = { + top: seriesPosition.top, + left: this.chartLeftPadding + leftAreaWidth - chartConst.OVERLAPPING_WIDTH + }; + }, + + /** + * Make legend position. + * @returns {{top: number, left: number}} legend bound + * @private + */ + _makeLegendPosition: function() { + var dimensionMap = this.dimensionMap; + var seriesDimension = this.getDimension('series'); + var legendOption = this.options.legend; + var top = dimensionMap.title.height || dimensionMap.chartExportMenu.height; + var yAxisAreaWidth, left; + + if (predicate.isLegendAlignBottom(legendOption.align)) { + top += seriesDimension.height + this.getDimension('xAxis').height + chartConst.LEGEND_AREA_PADDING; + } + + if (predicate.isHorizontalLegend(legendOption.align)) { + left = (this.getDimension('chart').width - this.getDimension('legend').width) / 2; + } else if (predicate.isLegendAlignLeft(legendOption.align)) { + left = this.chartLeftPadding; + } else { + yAxisAreaWidth = this.getDimension('yAxis').width + this.getDimension('rightYAxis').width; + left = this.chartLeftPadding + yAxisAreaWidth + seriesDimension.width; + } + + return { + top: top, + left: left + }; + }, + + /** + * Make chartExportMenu position. + * @returns {{top: number, left: number}} + * @private + */ + _makeChartExportMenuPosition: function() { + return { + top: 1, + right: 20 + }; + }, + + /** + * Make CircleLegend position. + * @returns {{top: number, left: number}} + * @private + */ + _makeCircleLegendPosition: function() { + var seriesPosition = this.getPosition('series'); + var seriesDimension = this.getDimension('series'); + var circleDimension = this.getDimension('circleLegend'); + var legendOptions = this.options.legend; + var left, legendWidth; + + if (predicate.isLegendAlignLeft(legendOptions.align)) { + left = 0; + } else { + left = seriesPosition.left + seriesDimension.width; + } + + if (predicate.isVerticalLegend(legendOptions.align) && legendOptions.visible) { + legendWidth = this.getDimension('legend').width + chartConst.CHART_PADDING; + left += (legendWidth - circleDimension.width) / 2; + } + + return { + top: seriesPosition.top + seriesDimension.height - circleDimension.height, + left: left + }; + }, + + /** + * Whether need expansion series or not. + * @returns {boolean} + * @private + */ + _isNeedExpansionSeries: function() { + var chartType = this.chartType; + + return !(predicate.isPieChart(chartType) || predicate.isMapChart(chartType)) + && !predicate.isTreemapChart(chartType) + && !predicate.isRadialChart(chartType) + && !predicate.isPieDonutComboChart(chartType, this.seriesTypes); + }, + + /** + * Register essential components positions. + * Essential components is all components except components for axis. + * @private + */ + _registerEssentialComponentsPositions: function() { + var seriesPosition = this.getPosition('series'); + var tooltipPosition; + + this.positionMap.mouseEventDetector = snippet.extend({}, seriesPosition); + this.positionMap.legend = this._makeLegendPosition(); + this.positionMap.chartExportMenu = this._makeChartExportMenuPosition(); + + if (this.getDimension('circleLegend').width) { + this.positionMap.circleLegend = this._makeCircleLegendPosition(); + } + + if (this._isNeedExpansionSeries()) { + tooltipPosition = { + top: seriesPosition.top - chartConst.SERIES_EXPAND_SIZE, + left: seriesPosition.left - chartConst.SERIES_EXPAND_SIZE + }; + } else { + tooltipPosition = seriesPosition; + } + + this.positionMap.tooltip = tooltipPosition; + }, + + /** + * Register positions. + * @private + */ + _registerPositions: function() { + var alignOption = this.options.legend.align; + var isVisibleLegend = this.options.legend.visible; + var legendDimension = this.getDimension('legend'); + var topLegendHeight = (predicate.isLegendAlignTop(alignOption) && isVisibleLegend) ? legendDimension.height : 0; + var leftLegendWidth = (predicate.isLegendAlignLeft(alignOption) && isVisibleLegend) ? legendDimension.width : 0; + var titleOrExportMenuHeight = Math.max(this.getDimension('title').height, this.getDimension('chartExportMenu').height); + var seriesTop = titleOrExportMenuHeight + topLegendHeight; + var defaultSeriesTop = renderUtil.getDefaultSeriesTopAreaHeight(this.chartType, this.theme.series); + var seriesPosition = { + top: (!seriesTop ? defaultSeriesTop : seriesTop) + chartConst.CHART_PADDING, + left: this.chartLeftPadding + leftLegendWidth + this.getDimension('yAxis').width + }; + + this.positionMap.series = seriesPosition; + + if (this.hasAxes) { + this._registerAxisComponentsPosition(leftLegendWidth); + } + + this._registerEssentialComponentsPositions(); + }, + + /** + * Register bound of extended series for rendering. + * @private + */ + _registerExtendedSeriesBound: function() { + var seriesBound = this.getBound('series'); + if (this._isNeedExpansionSeries()) { + seriesBound = renderUtil.expandBound(seriesBound); + } + + this._setBound('extendedSeries', seriesBound); + }, + + /** + * Update bounds(positions, dimensions) of components for center option of yAxis. + * @private + */ + _updateBoundsForYAxisCenterOption: function() { + var yAxisWidth = this.getDimension('yAxis').width; + var yAxisExtensibleLeft = Math.floor((this.getDimension('series').width / 2)) + chartConst.OVERLAPPING_WIDTH; + var xAxisDecreasingLeft = yAxisWidth - chartConst.OVERLAPPING_WIDTH; + var additionalLeft = renderUtil.isOldBrowser() ? 1 : 0; + + this.dimensionMap.extendedSeries.width += yAxisWidth; + this.dimensionMap.xAxis.width += chartConst.OVERLAPPING_WIDTH; + this.dimensionMap.plot.width += yAxisWidth + chartConst.OVERLAPPING_WIDTH; + this.dimensionMap.mouseEventDetector.width += yAxisWidth; + this.dimensionMap.tooltip.width += yAxisWidth; + + this.positionMap.series.left -= (yAxisWidth - additionalLeft); + this.positionMap.extendedSeries.left -= (xAxisDecreasingLeft - additionalLeft); + this.positionMap.plot.left -= xAxisDecreasingLeft; + this.positionMap.yAxis.left += yAxisExtensibleLeft; + this.positionMap.xAxis.left -= xAxisDecreasingLeft; + this.positionMap.mouseEventDetector.left -= xAxisDecreasingLeft; + this.positionMap.tooltip.left -= xAxisDecreasingLeft; + }, + + /** + * Register bounds data. + * @param {?object} xAxisData - axis data for x axis. + */ + registerBoundsData: function(xAxisData) { + this._registerCenterComponentsDimension(); + + if (this.hasAxes) { + this._registerAxisComponentsDimension(); + this._updateDimensionsForXAxisLabel(xAxisData); + } + + this._registerPositions(); + this._registerExtendedSeriesBound(); + + if (this.options.yAxis.isCenter) { + this._updateBoundsForYAxisCenterOption(); + } + }, + + /** + * Calculate max radius. + * @param {object} axisDataMap - axisData map + * @returns {number} + */ + calculateMaxRadius: function(axisDataMap) { + var dimensionMap = this.getDimensionMap(['series', 'circleLegend']); + var circleLegendVisible = this.options.circleLegend ? this.options.circleLegend.visible : false; + + return circleLegendCalculator.calculateMaxRadius(dimensionMap, axisDataMap, circleLegendVisible); + } + }); + + module.exports = BoundsModel; + + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Calculator for circle legend. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var renderUtil = __webpack_require__(7); + + /** + * Calculator for circle legend. + * @module circleLegendCalculator + * @private */ + var circleLegendCalculator = { + /** + * Calculate step of pixel unit. + * @param {{tickCount: number, isLabelAxis: boolean}} axisData - data for rendering axis + * @param {number} size - width or height of series area + * @returns {number} + * @private + */ + _calculatePixelStep: function(axisData, size) { + var tickCount = axisData.tickCount; + var pixelStep; + + if (axisData.isLabelAxis) { + pixelStep = size / tickCount / 2; + } else { + pixelStep = size / (tickCount - 1); + } + + return parseInt(pixelStep, 10); + }, + + /** + * Calculate radius by axis data. + * @param {{width: number, height: number}} seriesDimension - dimension for series + * @param {{xAxis: object, yAxis: object}} axisDataMap - axis data map + * @returns {number} + * @private + */ + _calculateRadiusByAxisData: function(seriesDimension, axisDataMap) { + var yPixelStep = this._calculatePixelStep(axisDataMap.yAxis, seriesDimension.height); + var xPixelStep = this._calculatePixelStep(axisDataMap.xAxis, seriesDimension.width); + + return Math.min(yPixelStep, xPixelStep); + }, + + /** + * Get max width of label for CircleLegend. + * @param {string} maxLabel - maximum label + * @param {string} fontFamily - fontFamily for legend + * @returns {number} + * @private + */ + _getCircleLegendLabelMaxWidth: function(maxLabel, fontFamily) { + return renderUtil.getRenderedLabelWidth(maxLabel, { + fontSize: chartConst.CIRCLE_LEGEND_LABEL_FONT_SIZE, + fontFamily: fontFamily + }); + }, + + /** + * Calculate width for circle legend. + * @param {{width: number, height: number}} seriesDimension - dimension for series + * @param {{xAxis: object, yAxis: object}} axisDataMap - axis data map + * @param {string} maxLabel - maximum label + * @param {string} fontFamily - fontFamily for legend + * @returns {number} + * @private + */ + calculateCircleLegendWidth: function(seriesDimension, axisDataMap, maxLabel, fontFamily) { + var maxRadius = this._calculateRadiusByAxisData(seriesDimension, axisDataMap); + var maxLabelWidth = this._getCircleLegendLabelMaxWidth(maxLabel, fontFamily); + + return Math.max((maxRadius * 2), maxLabelWidth) + chartConst.CIRCLE_LEGEND_PADDING; + }, + + /** + * Calculate max radius. + * @param {{series: {width: number, height: number}, circleLegend: {width: number}}} dimensionMap - dimension map + * @param {{xAxis: object, yAxis: object}} axisDataMap - axis data map + * @param {boolean} [circleLegendVisible] - circleLegend visible option + * @returns {number} + * @private + */ + calculateMaxRadius: function(dimensionMap, axisDataMap, circleLegendVisible) { + var maxRadius = this._calculateRadiusByAxisData(dimensionMap.series, axisDataMap); + var circleLegendWidth = dimensionMap.circleLegend.width; + + if (!circleLegendVisible) { + return maxRadius; + } + + return Math.min((circleLegendWidth - chartConst.CIRCLE_LEGEND_PADDING) / 2, maxRadius); + } + }; + + module.exports = circleLegendCalculator; + + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Calculator for dimension of axis. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var renderUtil = __webpack_require__(7); + + /** + * Calculator for dimension of axis. + * @module axisCalculator + * @private */ + var axisCalculator = { + /** + * Calculate height for x axis. + * @param {{title: string, labelMargin: number}} options - title and label margin option for x axis + * @param {{title: object, label: object}} theme - theme for x axis + * @returns {*} + */ + calculateXAxisHeight: function(options, theme) { + var title = options.title; + var titleHeight = title ? renderUtil.getRenderedLabelHeight(title.text, theme.title) : 0; + var titleAreaHeight = titleHeight ? (titleHeight + chartConst.TITLE_PADDING) : 0; + var labelMargin = options.labelMargin || 0; + var labelHeight = renderUtil.getRenderedLabelHeight(chartConst.MAX_HEIGHT_WORD, theme.label); + var height = titleAreaHeight + chartConst.CHART_PADDING; + + if (labelMargin > 0) { + height += labelMargin; + } + + if (options.showLabel !== false) { + height += labelHeight; + } + + return height; + }, + + /** + * Calculate width for y axis. + * @param {Array.} labels labels + * @param {{title: ?string, isCenter: ?boolean, rotateTitle: ?boolean}} options - options + * @param {{title: object, label: object}} theme - them for y axis + * @returns {number} + * @private + */ + calculateYAxisWidth: function(labels, options, theme) { + var title = options.title || ''; + var titleAreaWidth = 0; + var labelMargin = options.labelMargin || 0; + var width = 0; + + labels = renderUtil.addPrefixSuffix(labels, options.prefix, options.suffix); + + if (options.isCenter) { + width += chartConst.AXIS_LABEL_PADDING; + } else if (options.rotateTitle === false) { + titleAreaWidth = renderUtil.getRenderedLabelWidth(title.text, theme.title) + chartConst.TITLE_PADDING; + } else { + titleAreaWidth = renderUtil.getRenderedLabelHeight(title.text, theme.title) + chartConst.TITLE_PADDING; + } + + if (predicate.isDatetimeType(options.type)) { + labels = renderUtil.formatDates(labels, options.dateFormat); + } + if (labelMargin > 0) { + width += labelMargin; + } + + if (options.showLabel !== false) { + width += renderUtil.getRenderedLabelsMaxWidth(labels, theme.label); + } + + width += titleAreaWidth + chartConst.AXIS_LABEL_PADDING; + + return width; + } + }; + + module.exports = axisCalculator; + + +/***/ }), +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Calculator for dimension of legend. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var calculator = __webpack_require__(45); + var renderUtil = __webpack_require__(7); + var arrayUtil = __webpack_require__(10); + + var LEGEND_CHECKBOX_WIDTH = chartConst.LEGEND_CHECKBOX_WIDTH; + var LEGEND_ICON_WIDTH = chartConst.LEGEND_ICON_WIDTH; + var LEGEND_ICON_HEIGHT = chartConst.LEGEND_ICON_HEIGHT; + var LEGEND_LABEL_LEFT_PADDING = chartConst.LEGEND_LABEL_LEFT_PADDING; + var LEGEND_AREA_PADDING = chartConst.LEGEND_AREA_PADDING; + + /** + * Calculator for dimension of legend. + * @module legendCalculator + * @private */ + var legendCalculator = { + /** + * Legend margin. + * @type {number} + */ + legendMargin: LEGEND_LABEL_LEFT_PADDING + LEGEND_AREA_PADDING, + + /** + * Calculate sum of legends width. + * @param {Array.} labels - legend labels + * @param {{fontSize: number, fontFamily: number}} labelTheme - legend label theme + * @param {number} checkboxWidth - width for checkbox + * @param {?number} [maxWidth] - user option legend maxWidth + * @returns {number} + * @private + */ + _calculateLegendsWidthSum: function(labels, labelTheme, checkboxWidth, maxWidth) { + var restWidth = LEGEND_AREA_PADDING + checkboxWidth + + LEGEND_ICON_WIDTH + LEGEND_LABEL_LEFT_PADDING; + var legendMargin = this.legendMargin; + + return calculator.sum(snippet.map(labels, function(label) { + var labelWidth = renderUtil.getRenderedLabelWidth(label, labelTheme); + + if (maxWidth && labelWidth > maxWidth) { + labelWidth = maxWidth; + } + labelWidth += restWidth; + + return labelWidth + legendMargin; + })); + }, + + /** + * Divide legend labels. + * @param {Array.} labels legend labels + * @param {number} count division count + * @returns {Array.>} + * @private + */ + _divideLegendLabels: function(labels, count) { + var limitCount = Math.round(labels.length / count); + var results = []; + var temp = []; + + snippet.forEachArray(labels, function(label) { + if (temp.length < limitCount) { + temp.push(label); + } else { + results.push(temp); + temp = [label]; + } + }); + + if (temp.length) { + results.push(temp); + } + + return results; + }, + + /** + * Get max line width. + * @param {Array.} dividedLabels - divided labels + * @param {{fontFamily: ?string, fontSize: ?string}} labelTheme - label theme + * @param {number} checkboxWidth - width for checkbox + * @param {?number} [maxWidth] - user option legend maxWidth + * @returns {number} + * @private + */ + _getMaxLineWidth: function(dividedLabels, labelTheme, checkboxWidth, maxWidth) { + var self = this; + var lineWidths = snippet.map(dividedLabels, function(labels) { + return self._calculateLegendsWidthSum(labels, labelTheme, checkboxWidth, maxWidth); + }); + + return arrayUtil.max(lineWidths); + }, + + /** + * Make divided labels and max line width. + * @param {Array.} labels legend labels + * @param {number} chartWidth chart width + * @param {{fontSize: number, fontFamily: number}} labelTheme legend label theme + * @param {number} checkboxWidth - width for checkbox + * @param {?number} [maxWidth] - user option legend maxWidth + * @returns {{dividedLabels: Array.>, maxLineWidth: number}} + * @private + */ + _makeDividedLabelsAndMaxLineWidth: function(labels, chartWidth, labelTheme, checkboxWidth, maxWidth) { + var divideCount = 1; + var maxLineWidth = 0; + var prevMaxWidth = 0; + var dividedLabels, prevLabels; + + do { + dividedLabels = this._divideLegendLabels(labels, divideCount); + maxLineWidth = this._getMaxLineWidth(dividedLabels, labelTheme, checkboxWidth, maxWidth); + + if (prevMaxWidth === maxLineWidth) { + dividedLabels = prevLabels; + break; + } + + prevMaxWidth = maxLineWidth; + prevLabels = dividedLabels; + divideCount += 1; + } while (maxLineWidth >= chartWidth); + + return { + labels: dividedLabels, + maxLineWidth: maxLineWidth + }; + }, + + /** + * Calculate height of horizontal legend. + * @param {Array.>} dividedLabels - divided labels + * @param {{fontSize: number, fontFamily: number}} labelTheme - label theme for legend + * @returns {number} + * @private + */ + _calculateHorizontalLegendHeight: function(dividedLabels, labelTheme) { + var heightByLabel = Math.max.apply(null, snippet.map(dividedLabels, function(labels) { + return renderUtil.getRenderedLabelsMaxHeight(labels, labelTheme); + })); + var labelItemHeightWithPaddingTop = Math.max(LEGEND_ICON_HEIGHT, heightByLabel) + chartConst.LINE_MARGIN_TOP; + var legendHeight = (labelItemHeightWithPaddingTop * dividedLabels.length) - chartConst.LINE_MARGIN_TOP; + + return legendHeight; + }, + + /** + * Make dimension of horizontal legend. + * @param {{fontSize: number, fontFamily: number}} labelTheme - label theme for legend + * @param {Array.} legendLabels - labels for legend + * @param {number} chartWidth - chart width + * @param {number} checkboxWidth - width for checkbox + * @param {?number} [maxWidth] - user option legend maxWidth + * @returns {{width: number, height: (number)}} + * @private + */ + _makeHorizontalDimension: function(labelTheme, legendLabels, chartWidth, checkboxWidth, maxWidth) { + var dividedInfo = this._makeDividedLabelsAndMaxLineWidth( + legendLabels, chartWidth, labelTheme, checkboxWidth, maxWidth + ); + var horizontalLegendHeight = this._calculateHorizontalLegendHeight(dividedInfo.labels, labelTheme); + var legendHeight = horizontalLegendHeight + (LEGEND_AREA_PADDING * 2); + + return { + width: Math.max(dividedInfo.maxLineWidth, chartConst.MIN_LEGEND_WIDTH), + height: legendHeight + }; + }, + + /** + * Make dimension of vertical legend. + * @param {{fontSize: number, fontFamily: number}} labelTheme - label theme for legend + * @param {Array.} legendLabels - labels for legend + * @param {number} checkboxWidth - width for checkbox + * @param {?number} [maxWidth] - user option legend maxWidth + * @returns {{width: (number)}} + * @private + */ + _makeVerticalDimension: function(labelTheme, legendLabels, checkboxWidth, maxWidth) { + var labelWidth = renderUtil.getRenderedLabelsMaxWidth(legendLabels, labelTheme); + if (maxWidth && labelWidth > maxWidth) { + labelWidth = maxWidth; + } + labelWidth += LEGEND_AREA_PADDING + checkboxWidth + LEGEND_ICON_WIDTH + LEGEND_LABEL_LEFT_PADDING; + + return { + width: labelWidth + this.legendMargin, + height: 0 + }; + }, + + /** + * Calculate legend dimension. + * @param {{showCheckbox: boolean, visible: boolean, align: string}} options - options for legend + * @param {{fontSize: number, fontFamily: number}} labelTheme - label theme for legend + * @param {Array.} legendLabels - labels for legend + * @param {number} chartWidth chart width + * @returns {{width: number, height: number}} + */ + calculate: function(options, labelTheme, legendLabels, chartWidth) { + var checkboxWidth = options.showCheckbox === false ? 0 : LEGEND_CHECKBOX_WIDTH + LEGEND_LABEL_LEFT_PADDING; + var maxWidth = options.maxWidth; + var dimension = {}; + + if (!options.visible) { + dimension.width = 0; + } else if (predicate.isHorizontalLegend(options.align)) { + dimension = this._makeHorizontalDimension( + labelTheme, legendLabels, chartWidth, checkboxWidth, maxWidth + ); + } else { + dimension = this._makeVerticalDimension(labelTheme, legendLabels, checkboxWidth, maxWidth); + } + + return dimension; + } + }; + + module.exports = legendCalculator; + + +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Calculator for series. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var renderUtil = __webpack_require__(7); + + /** + * Calculator for series. + * @module seriesCalculator + * @private */ + var seriesCalculator = { + /** + * Calculate width. + * @param {{ + * chart: {width: number}, + * yAxis: {width: number}, + * legend: {width: number}, + * rightYAxis: ?{width: number} + * }} dimensionMap - dimension map + * @param {{align: ?string, visible: boolean}} legendOptions - legend options + * @returns {number} series width + */ + calculateWidth: function(dimensionMap, legendOptions) { + var chartWidth = dimensionMap.chart.width; + var yAxisAreaWidth = dimensionMap.yAxis.width + dimensionMap.rightYAxis.width; + var legendDimension = dimensionMap.legend; + var legendWidth = 0; + + if (predicate.isVerticalLegend(legendOptions.align) && legendOptions.visible) { + legendWidth = legendDimension ? legendDimension.width : 0; + } + + return chartWidth - (chartConst.CHART_PADDING * 2) - yAxisAreaWidth - legendWidth; + }, + + /** + * Calculate height. + * @param {{ + * chart: {height: number}, + * title: {height: number}, + * legend: {height: number}, + * xAxis: {height: number} + * }} dimensionMap - dimension map + * @param {{align: ?string, visible: boolean}} legendOptions - legend options + * @param {string} chartType - chart type + * @param {object} seriesTheme - series theme; + * @returns {number} series height + */ + calculateHeight: function(dimensionMap, legendOptions, chartType, seriesTheme) { + var chartHeight = dimensionMap.chart.height; + var defaultTopAreaHeight = renderUtil.getDefaultSeriesTopAreaHeight(chartType, seriesTheme); + var topAreaHeight = Math.max(dimensionMap.title.height, dimensionMap.chartExportMenu.height); + var bottomAreaHeight = dimensionMap.xAxis.height; + var legendHeight = legendOptions.visible ? dimensionMap.legend.height : 0; + var legendAlignment = legendOptions.align; + + bottomAreaHeight += (predicate.isLegendAlignBottom(legendAlignment) ? legendHeight : 0); + topAreaHeight += (predicate.isLegendAlignTop(legendAlignment) ? legendHeight : 0); + topAreaHeight = topAreaHeight || defaultTopAreaHeight; + + return chartHeight - (chartConst.CHART_PADDING * 2) - topAreaHeight - bottomAreaHeight; + } + }; + + module.exports = seriesCalculator; + + +/***/ }), +/* 118 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Calculator for spectrum legend. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var renderUtil = __webpack_require__(7); + + /** + * Calculator for spectrum legend. + * @module spectrumLegendCalculator + * @private */ + var spectrumLegendCalculator = { + /** + * Make vertical dimension. + * @param {string} maxValue - formatted max value + * @param {object} labelTheme - theme for label + * @returns {{width: number, height: number}} + * @private + */ + _makeVerticalDimension: function(maxValue, labelTheme) { + var labelWidth = renderUtil.getRenderedLabelWidth(maxValue, labelTheme); + var padding = chartConst.LEGEND_AREA_PADDING + chartConst.MAP_LEGEND_LABEL_PADDING; + + return { + width: chartConst.MAP_LEGEND_GRAPH_SIZE + labelWidth + padding, + height: chartConst.MAP_LEGEND_SIZE + }; + }, + + /** + * Make horizontal dimension. + * @param {string} maxValue - formatted max value + * @param {object} labelTheme - theme for label + * @returns {{width: number, height: number}} + * @private + */ + _makeHorizontalDimension: function(maxValue, labelTheme) { + var labelHeight = renderUtil.getRenderedLabelHeight(maxValue, labelTheme); + var padding = chartConst.LEGEND_AREA_PADDING + chartConst.MAP_LEGEND_LABEL_PADDING; + + return { + width: chartConst.MAP_LEGEND_SIZE, + height: chartConst.MAP_LEGEND_GRAPH_SIZE + labelHeight + padding + }; + } + }; + + module.exports = spectrumLegendCalculator; + + +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var scaleDataMaker = __webpack_require__(120); + var scaleLabelFormatter = __webpack_require__(122); + var axisDataMaker = __webpack_require__(123); + var predicate = __webpack_require__(11); + var renderUtil = __webpack_require__(7); + var snippet = __webpack_require__(6); + + var ScaleDataModel = snippet.defineClass(/** @lends ScaleDataModel.prototype */{ + /** + * ScaleDataModel is scale model for scale data and axis data. + * @param {object} params - parameters + * @constructs ScaleDataModel + * @private + */ + init: function(params) { + this.chartType = params.chartType; + this.seriesTypes = params.seriesTypes; + this.dataProcessor = params.dataProcessor; + this.boundsModel = params.boundsModel; + this.options = params.options; + this.theme = params.theme; + this.hasRightYAxis = !!params.hasRightYAxis; + this.prevValidLabelCount = null; + + this.initScaleData(params.addedDataCount); + this.initForAutoTickInterval(); + }, + + /** + * Initialize scale data. + * @param {?number} addedDataCount - increased added count by dynamic adding data + */ + initScaleData: function(addedDataCount) { + this.scaleDataMap = {}; + this.axisDataMap = {}; + this.addedDataCount = addedDataCount; + }, + + /** + * Initialize for auto tick interval. + */ + initForAutoTickInterval: function() { + this.firstTickCount = null; + }, + + /** + * Pick limit option. + * @param {{min: ?number, max: ?number}} axisOptions - axis options + * @returns {{min: ?number, max: ?number}} + * @private + */ + _pickLimitOption: function(axisOptions) { + axisOptions = axisOptions || {}; + + return { + min: axisOptions.min, + max: axisOptions.max + }; + }, + + /** + * Create base scale data. + * @param {{ + * chartType: string, + * areaType: string, + * valueType: string + * }} typeMap - type map + * @param {{ + * type: string, + * stackType: string, + * diverging: boolean + * }} baseOptions - base options + * @param {object} axisOptions - axis options + * @param {object} additionalOptions - additional options + * @returns {{limit: {min: number, max: number}, step: number}} + * @private + */ + _createBaseScaleData: function(typeMap, baseOptions, axisOptions, additionalOptions) { + var chartType = typeMap.chartType; + var isVertical = typeMap.areaType !== 'xAxis'; + var baseValues = this.dataProcessor.createBaseValuesForLimit( + chartType, additionalOptions.isSingleYAxis, baseOptions.stackType, typeMap.valueType, typeMap.areaType); + var baseSize = this.boundsModel.getBaseSizeForLimit(isVertical); + var options = snippet.extend(baseOptions, { + isVertical: isVertical, + limitOption: this._pickLimitOption(axisOptions), + tickCounts: additionalOptions.tickCounts + }); + + if (predicate.isBubbleChart(chartType)) { + options.overflowItem = this.dataProcessor.findOverflowItem(chartType, typeMap.valueType); + } + + return scaleDataMaker.makeScaleData(baseValues, baseSize, chartType, options); + }, + + /** + * Create scale labels. + * @param {{limit: {min: number, max: number}, step: number}} baseScaleData - base scale data + * @param {{ + * chartType: string, + * areaType: string, + * valueType: string + * }} typeMap - type map + * @param {{ + * type: string, + * stackType: string, + * diverging: boolean + * }} baseOptions - base options + * @param {string} dateFormat - date format + * @returns {Array.} + * @private + */ + _createScaleLabels: function(baseScaleData, typeMap, baseOptions, dateFormat) { + var formatFunctions = this.dataProcessor.getFormatFunctions(); + var options = snippet.extend(baseOptions, { + dateFormat: dateFormat + }); + + return scaleLabelFormatter.createFormattedLabels(baseScaleData, typeMap, options, formatFunctions); + }, + + /** + * Create scale. + * @param {object} axisOptions - axis options + * @param {{chartType: string, areaType: string, valueType: string}} typeMap - type map + * @param {?object} additionalOptions - additional options + * @returns {object} + * @private + */ + _createScaleData: function(axisOptions, typeMap, additionalOptions) { + var seriesOptions = this.options.series; + var chartType = typeMap.chartType || this.chartType; + var baseOptions, baseScaleData; + + typeMap.chartType = chartType; + seriesOptions = seriesOptions[chartType] || seriesOptions; + baseOptions = { + stackType: additionalOptions.stackType || seriesOptions.stackType, + diverging: seriesOptions.diverging, + type: axisOptions.type + }; + baseScaleData = this._createBaseScaleData(typeMap, baseOptions, axisOptions, additionalOptions); + + return snippet.extend(baseScaleData, { + labels: this._createScaleLabels(baseScaleData, typeMap, baseOptions, axisOptions.dateFormat), + axisOptions: axisOptions + }); + }, + + /** + * Create value type axis data. + * @param {{labels: Array., limit: {min: number, max: number}, step: number}} scaleData - scale data + * @param {object} labelTheme - label theme + * @param {boolean} aligned - aligned tick and label + * @param {boolean} isVertical - whether vertical or not + * @param {boolean} isPositionRight - whether right position or not + * @returns {{ + * labels: Array., + * tickCount: number, + * validTickCount: number, + * isLabelAxis: boolean, + * limit: {min: number, max: number}, + * isVertical: boolean + * }} + * @private + */ + _createValueAxisData: function(scaleData, labelTheme, aligned, isVertical, isPositionRight) { + var hasCategories = this.dataProcessor.hasCategories(); + var isCoordinateLineType = !isVertical && !hasCategories && aligned; + var labels = scaleData.labels; + var limit = scaleData.limit; + var step = scaleData.step; + var tickCount = labels.length; + var values, additional; + + var axisData = axisDataMaker.makeValueAxisData({ + labels: labels, + tickCount: labels.length, + limit: limit, + step: step, + options: scaleData.axisOptions, + labelTheme: labelTheme, + isVertical: !!isVertical, + isPositionRight: !!isPositionRight, + aligned: aligned + }); + + if (isCoordinateLineType) { + values = this.dataProcessor.getValues(this.chartType, 'x'); + additional = axisDataMaker.makeAdditionalDataForCoordinateLineType(labels, values, limit, step, tickCount); + snippet.extend(axisData, additional); + } + + return axisData; + }, + + /** + * Create label type axis data. + * @param {object} axisOptions - options for axis + * @param {object} labelTheme - label theme + * @param {boolean} aligned - aligned tick and label + * @param {boolean} isVertical - whether vertical or not + * @param {boolean} isPositionRight - whether right position or not + * @returns {{ + * labels: Array., + * tickCount: number, + * validTickCount: number, + * isLabelAxis: boolean, + * options: object, + * isVertical: boolean, + * isPositionRight: boolean, + * aligned: boolean + * }} + * @private + */ + _createLabelAxisData: function(axisOptions, labelTheme, aligned, isVertical, isPositionRight) { + return axisDataMaker.makeLabelAxisData({ + labels: this.dataProcessor.getCategories(isVertical), + options: axisOptions, + labelTheme: labelTheme, + isVertical: !!isVertical, + isPositionRight: !!isPositionRight, + aligned: aligned, + addedDataCount: this.options.series.shifting ? this.addedDataCount : 0 + }); + }, + + /** + * Create axis data. + * @param {object} scaleData - scale data + * @param {object} axisOptions - axis options + * @param {object} labelTheme - them for label + * @param {boolean} isVertical - whether vertical or not + * @param {boolean} isPositionRight - whether right position or not + * @returns {object} + * @private + */ + _createAxisData: function(scaleData, axisOptions, labelTheme, isVertical, isPositionRight) { + var aligned = predicate.isLineTypeChart(this.chartType, this.seriesTypes) && !axisOptions.pointOnColumn; + var axisData; + + if (scaleData) { + axisData = this._createValueAxisData(scaleData, labelTheme, aligned, isVertical, isPositionRight); + } else { + axisData = this._createLabelAxisData(axisOptions, labelTheme, aligned, isVertical, isPositionRight); + } + + return axisData; + }, + + /** + * Create axes data. + * @returns {object.} + * @private + */ + _createAxesData: function() { + var scaleDataMap = this.scaleDataMap; + var options = this.options; + var theme = this.theme; + var yAxisOptions = snippet.isArray(options.yAxis) ? options.yAxis : [options.yAxis]; + var dataMap = {}; + + dataMap.xAxis = this._createAxisData(scaleDataMap.xAxis, options.xAxis, theme.xAxis.label); + dataMap.yAxis = this._createAxisData(scaleDataMap.yAxis, yAxisOptions[0], theme.yAxis.label, true); + + if (this.hasRightYAxis) { + dataMap.rightYAxis = this._createAxisData( + scaleDataMap.rightYAxis, yAxisOptions[1], theme.yAxis.label, true, true + ); + dataMap.rightYAxis.aligned = dataMap.xAxis.aligned; + } + + return dataMap; + }, + + /** + * Add scale. + * @param {string} axisName - axis name + * @param {options} axisOptions - axis options + * @param {{chartType: string, areaType: string}} typeMap - type map + * @param {object} additionalOptions - additional parameters + */ + addScale: function(axisName, axisOptions, typeMap, additionalOptions) { + typeMap = typeMap || {}; + additionalOptions = additionalOptions || {}; + typeMap.areaType = typeMap.areaType || axisName; + typeMap.chartType = additionalOptions.chartType || typeMap.chartType; + + this.scaleDataMap[axisName] = this._createScaleData(axisOptions, typeMap, additionalOptions); + }, + + /** + * Set axis data map. + */ + setAxisDataMap: function() { + this.axisDataMap = this._createAxesData(); + }, + + /** + * Update x axis data for auto tick interval. + * @param {object} prevXAxisData - previous xAxis data + * @param {?boolean} addingDataMode - whether adding data mode or not + */ + updateXAxisDataForAutoTickInterval: function(prevXAxisData, addingDataMode) { + var shiftingOption = this.options.series.shifting; + var zoomableOption = this.options.series.zoomable; + var xAxisData = this.axisDataMap.xAxis; + var seriesWidth = this.boundsModel.getDimension('series').width; + var addedCount = this.addedDataCount; + + if (shiftingOption || !prevXAxisData || zoomableOption) { + axisDataMaker.updateLabelAxisDataForAutoTickInterval(xAxisData, seriesWidth, addedCount, addingDataMode); + } else { + axisDataMaker.updateLabelAxisDataForStackingDynamicData(xAxisData, prevXAxisData, this.firstTickCount); + } + + if (!this.firstTickCount) { + this.firstTickCount = xAxisData.tickCount; + } + }, + + /** + * Update x axis data for label. + * @param {?boolean} addingDataMode - whether adding data mode or not + */ + updateXAxisDataForLabel: function(addingDataMode) { + var axisData = this.axisDataMap.xAxis; + var labels = axisData.labels; + var dimensionMap = this.boundsModel.getDimensionMap(['series', 'yAxis', 'chart']); + var isLabelAxis = axisData.isLabelAxis; + var theme = this.theme.xAxis.label; + var validLabels, validLabelCount, additionalData; + + if (addingDataMode) { + labels = labels.slice(0, labels.length - 1); + } + + labels = renderUtil.addPrefixSuffix(labels, this.options.xAxis.prefix, this.options.xAxis.suffix); + + validLabels = snippet.filter(labels, function(label) { + return !!label; + }); + + if (!snippet.isNull(this.prevValidLabelCount)) { + validLabelCount = this.prevValidLabelCount; + } else { + validLabelCount = validLabels.length; + } + + if (this.options.yAxis.isCenter) { + validLabelCount += 1; + dimensionMap.yAxis.width = 0; + } + + if (axisData.options.rotateLabel === false) { + additionalData = axisDataMaker.makeAdditionalDataForMultilineLabels( + labels, validLabelCount, theme, isLabelAxis, dimensionMap + ); + } else { + additionalData = axisDataMaker.makeAdditionalDataForRotatedLabels( + validLabels, validLabelCount, theme, isLabelAxis, dimensionMap + ); + } + + this.prevValidLabelCount = validLabelCount; + + snippet.extend(axisData, additionalData); + }, + + /** + * Find limit from limitMap by seriesIndex + * @param {object} limitMap - limit map + * @param {number} seriesIndex - series index + * @param {boolean} isVertical - whether vertical or not + * @returns {boolean} + * @private + */ + _findLimit: function(limitMap, seriesIndex, isVertical) { + var limit; + + if (seriesIndex === 0) { + limit = isVertical ? limitMap.yAxis : limitMap.xAxis; + } else { + limit = limitMap.rightYAxis ? limitMap.rightYAxis : limitMap.yAxis; + } + + return limit; + }, + + /** + * Make limit map. + * @param {Array.} seriesTypes - series types like bar, column, line, area + * @param {boolean} isVertical - whether vertical or not + * @returns {{ + * xAxis: ?{min: number, max: number}, + * yAxis: ?{min: number, max: number}, + * rightYAxis: ?{min: number, max: number}, + * legend: ?{min: number, max: number}, + * bar: ?{min: number, max: number} + * }} + * @private + */ + makeLimitMap: function(seriesTypes, isVertical) { + var self = this; + var scaleDataMap = this.scaleDataMap; + var limitMap = {}; + + if (scaleDataMap.xAxis) { + limitMap.xAxis = scaleDataMap.xAxis.limit; + } + + if (scaleDataMap.yAxis) { + limitMap.yAxis = scaleDataMap.yAxis.limit; + } + + if (scaleDataMap.rightYAxis) { + limitMap.rightYAxis = scaleDataMap.rightYAxis.limit; + } + + if (scaleDataMap.legend) { + limitMap.legend = scaleDataMap.legend.limit; + } + + snippet.forEachArray(seriesTypes, function(seriesType, index) { + limitMap[seriesType] = self._findLimit(limitMap, index, isVertical); + }); + + return limitMap; + } + }); + + module.exports = ScaleDataModel; + + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview scaleMaker calculates the limit and step into values of processed data and returns it. + * @auth NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var calculator = __webpack_require__(45); + var arrayUtil = __webpack_require__(10); + var coordinateScaleCalculator = __webpack_require__(121); + var snippet = __webpack_require__(6); + + var abs = Math.abs; + + /** + * scaleMaker calculates limit and step into values of processed data and returns it. + * @module scaleDataMaker + * @private */ + var scaleDataMaker = { + /** + * Make limit for diverging option. + * To balance diverging chart + * compare absolute value of min, max. and find larger one + * set min by making the value negative + * @param {{min: number, max: number}} limit limit + * @returns {{min: number, max: number}} changed limit + * @private + */ + _makeLimitForDivergingOption: function(limit) { + var newMax = Math.max(abs(limit.min), abs(limit.max)); + + return { + min: -newMax, + max: newMax + }; + }, + /** + * Adjust limit for bubble chart. + * @param {{min: number, max: number}} limit - limit + * @param {number} step - step; + * @param {{min: boolean, max: boolean}} isOverflowed - overflow Item map + * @returns {object} limit + * @private + */ + _adjustLimitForOverflow: function(limit, step, isOverflowed) { + var min = limit.min; + var max = limit.max; + + if (isOverflowed.min) { + min = calculator.subtract(min, step); + } + + if (isOverflowed.max) { + max = calculator.add(max, step); + } + + return { + min: min, + max: max + }; + }, + + /** + * millisecond map + */ + millisecondMap: { + year: 31536000000, + month: 2678400000, + week: 604800000, + date: 86400000, + hour: 3600000, + minute: 60000, + second: 1000 + }, + + /** + * millisecond types + */ + millisecondTypes: ['year', 'month', 'week', 'date', 'hour', 'minute', 'second'], + + /** + * Find date type. + * @param {{min: number, max: number}} dataLimit - data limit + * @param {number} count - data count + * @returns {string} + * @private + */ + _findDateType: function(dataLimit, count) { + var diff = dataLimit.max - dataLimit.min; + var millisecondTypes = this.millisecondTypes; + var millisecondMap = this.millisecondMap; + var lastTypeIndex = millisecondTypes.length - 1; + var foundType; + + if (diff) { + snippet.forEachArray(millisecondTypes, function(type, index) { + var millisecond = millisecondMap[type]; + var dividedCount = Math.floor(diff / millisecond); + var foundIndex; + + if (dividedCount) { + foundIndex = index < lastTypeIndex && dividedCount < 2 && dividedCount < count ? index + 1 : index; + foundType = millisecondTypes[foundIndex]; + } + + return !snippet.isExisty(foundIndex); + }); + } else { + foundType = chartConst.DATE_TYPE_SECOND; + } + + return foundType; + }, + + /** + * Make datetime information + * @param {{min: number, max: number}} dataLimit - data limit + * @param {number} count - data count + * @returns {{divisionNumber: number, minDate: number, dataLimit: {min: number, max: number}}} + * @private + */ + _makeDatetimeInfo: function(dataLimit, count) { + var dateType = this._findDateType(dataLimit, count); + var divisionNumber = this.millisecondMap[dateType]; + var minDate = calculator.divide(dataLimit.min, divisionNumber); + var maxDate = calculator.divide(dataLimit.max, divisionNumber); + var max = maxDate - minDate; + + return { + divisionNumber: divisionNumber, + minDate: minDate, + dataLimit: { + min: 0, + max: max + } + }; + }, + + /** + * Restore scale to datetime type. + * @param {{scale: number, limit:{min: number, max: number}}} scale - scale + * @param {number} minDate - minimum date + * @param {number} divisionNumber - division number + * @returns {{step: number, limit: {min: number, max: number}}} + * @private + */ + _restoreScaleToDatetimeType: function(scale, minDate, divisionNumber) { + var limit = scale.limit; + + scale.step = calculator.multiply(scale.step, divisionNumber); + limit.min = calculator.multiply(calculator.add(limit.min, minDate), divisionNumber); + limit.max = calculator.multiply(calculator.add(limit.max, minDate), divisionNumber); + + return scale; + }, + + /** + * Get limit values safely by limit values are both Zero then set max value to 10 temporary. + * @param {Array} baseValues base values + * @returns {{min: number, max: number}} + */ + _getLimitSafely: function(baseValues) { + var limit = { + min: arrayUtil.min(baseValues), + max: arrayUtil.max(baseValues) + }; + var firstValue; + + if (baseValues.length === 1) { + firstValue = baseValues[0]; + + if (firstValue > 0) { + limit.min = 0; + } else if (firstValue === 0) { + limit.max = 10; + } else { + limit.max = 0; + } + } else if (limit.min === 0 && limit.max === 0) { + limit.max = 10; + } else if (limit.min === limit.max) { + limit.min -= (limit.min / 10); + limit.max += (limit.max / 10); + } + + return limit; + }, + + /** + * Calculate date time scale. + * @param {Array.} baseValues - base values for calculating scale data + * @param {number} baseSize - base size(width or height) for calculating scale data + * @param {boolean} isDiverging - is diverging or not + * @returns {{limit: {min: number, max: number}, step: number}} + * @private + */ + _calculateDatetimeScale: function(baseValues, baseSize, isDiverging) { + var datetimeInfo, scale, limit; + + datetimeInfo = this._makeDatetimeInfo(this._getLimitSafely(baseValues), baseValues.length); + + limit = datetimeInfo.dataLimit; + + if (isDiverging) { + limit = this._makeLimitForDivergingOption(limit); + } + + scale = coordinateScaleCalculator({ + min: limit.min, + max: limit.max, + offsetSize: baseSize, + minimumStepSize: 1 + }); + + scale = this._restoreScaleToDatetimeType(scale, datetimeInfo.minDate, datetimeInfo.divisionNumber); + + return scale; + }, + + /** + * Calculate percent stackType scale. + * @param {Array.} baseValues - base values + * @param {boolean} isDiverging - is diverging or not + * @returns {{limit: {min:number, max:number}, step: number}} + * @private + */ + _calculatePercentStackedScale: function(baseValues, isDiverging) { + var scale; + + if (calculator.sumMinusValues(baseValues) === 0) { + scale = chartConst.PERCENT_STACKED_AXIS_SCALE; + } else if (calculator.sumPlusValues(baseValues) === 0) { + scale = chartConst.MINUS_PERCENT_STACKED_AXIS_SCALE; + } else if (isDiverging) { + scale = chartConst.DIVERGING_PERCENT_STACKED_AXIS_SCALE; + } else { + scale = chartConst.DUAL_PERCENT_STACKED_AXIS_SCALE; + } + + return scale; + }, + + /** + * Calculate coordinate scale. + * @param {object} makeScaleInfos - calculate scale infos + * @param {Array.} makeScaleInfos.baseValues - base values + * @param {number} makeScaleInfos.baseSize - base size(width or height) for calculating scale data + * @param {object} makeScaleInfos.overflowItem - overflow item + * @param {boolean} makeScaleInfos.isDiverging - is diverging or not + * @param {strint} makeScaleInfos.chartType - chartType + * @param {object} makeScaleInfos.options - scale options + * @param {{min: ?number, max: ?number}} makeScaleInfos.options.limit - limit options + * @returns {{limit: {min:number, max:number}, step: number}} + * @private + */ + _calculateCoordinateScale: function(makeScaleInfos) { + var options = makeScaleInfos.options; + var baseSize = makeScaleInfos.baseSize; + var overflowItem = makeScaleInfos.overflowItem; + var chartType = makeScaleInfos.chartType; + var limit = this._getLimitSafely(makeScaleInfos.baseValues); + var limitOption = options.limitOption || {}; + var hasMinOption = snippet.isExisty(limitOption.min); + var hasMaxOption = snippet.isExisty(limitOption.max); + var min = limit.min; + var max = limit.max; + var stepCount = options.stepCount; + var isOverflowed, scaleData; + + if (hasMinOption) { + min = limitOption.min; + stepCount = null; + } + + if (hasMaxOption) { + max = limitOption.max; + stepCount = null; + } + + scaleData = coordinateScaleCalculator({ + min: min, + max: max, + stepCount: stepCount, + offsetSize: baseSize + }); + + isOverflowed = this._isOverflowed(overflowItem, scaleData, limit, hasMinOption, hasMaxOption); + + if (isOverflowed && !predicate.isMapTypeChart(chartType)) { + scaleData.limit = this._adjustLimitForOverflow(scaleData.limit, scaleData.step, isOverflowed); + } + + if (makeScaleInfos.isDiverging) { + scaleData.limit = this._makeLimitForDivergingOption(scaleData.limit); + } + + return scaleData; + }, + + _isOverflowed: function(overflowItem, scaleData, limit, hasMinOption, hasMaxOption) { + var isBubbleMinOverflowed = !!(overflowItem && overflowItem.minItem); + var isBubbleMaxOverflowed = !!(overflowItem && overflowItem.maxItem); + var scaleDataLimit = scaleData.limit; + var isOverflowedMin = isBubbleMinOverflowed || + (!hasMinOption && scaleDataLimit.min === limit.min && scaleDataLimit.min !== 0); + var isOverflowedMax = isBubbleMaxOverflowed || + (!hasMaxOption && scaleDataLimit.max === limit.max && scaleDataLimit.max !== 0); + + if (!isOverflowedMin && !isOverflowedMax) { + return null; + } + + return { + min: isOverflowedMin, + max: isOverflowedMax + }; + }, + + /** + * Make scale data. + * @param {Array.} baseValues - base values for calculating scale data + * @param {number} baseSize - base size(width or height) for calculating scale data + * @param {string} chartType - chart type + * @param {{ + * type: string, + * stackType: string, + * diverging: boolean, + * isVertical: boolean, + * limitOption: ?{min: ?number, max: ?number}, + * tickCounts: ?Array. + * }} options - options + * @returns {{limit: {min:number, max:number}, step: number, stepCount: number}} + */ + makeScaleData: function(baseValues, baseSize, chartType, options) { + var scaleData; + var isDiverging = predicate.isDivergingChart(chartType, options.diverging); + var overflowItem = options.overflowItem; + + if (predicate.isPercentStackChart(chartType, options.stackType)) { + scaleData = this._calculatePercentStackedScale(baseValues, isDiverging); + } else if (predicate.isDatetimeType(options.type)) { + scaleData = this._calculateDatetimeScale(baseValues, baseSize, isDiverging); + } else { + if (predicate.isRadialChart(chartType)) { + options.stepCount = Math.floor(baseSize / 100); + } + + scaleData = this._calculateCoordinateScale({ + baseValues: baseValues, + baseSize: baseSize, + overflowItem: overflowItem, + isDiverging: isDiverging, + chartType: chartType, + options: options + }); + } + + return scaleData; + } + }; + + module.exports = scaleDataMaker; + + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Implement function that calculate coordinate scale data + * @author Sungho Kim + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + + /** + * The reference values to normailze value + * @private + * @type {Array.} + */ + var SNAP_VALUES = [1, 2, 5, 10]; + + /** + * Default step pixel size + * @private + * @type {number} + */ + var DEFAULT_PIXELS_PER_STEP = 88; + + /** + * Get digits of number + * @param {number} number number + * @returns {number} + * @private + * @example + * this.getDigits(2145) == 1000 + */ + function getDigits(number) { + var logNumberDividedLN10 = number === 0 ? 1 : (Math.log(Math.abs(number)) / Math.LN10); + + return Math.pow(10, Math.floor(logNumberDividedLN10)); + } + + /** + * Select value within SNAP_VALUES that most close with given value + * @param {number} number number + * @private + * @returns {number} + */ + function getSnappedNumber(number) { + var guideValue, snapNumber, i, t; + + for (i = 0, t = SNAP_VALUES.length; i < t; i += 1) { + snapNumber = SNAP_VALUES[i]; + guideValue = (snapNumber + (SNAP_VALUES[i + 1] || snapNumber)) / 2; + + if (number <= guideValue) { + break; + } + } + + return snapNumber; + } + + /** + * Get normalized step value + * @param {number} step step + * @private + * @returns {number} + */ + function getNormalizedStep(step) { + var placeNumber = getDigits(step); + var simplifiedStepValue = step / placeNumber; + + return getSnappedNumber(simplifiedStepValue) * placeNumber; + } + + /** + * Get normailzed limit values + * @param {number} min min + * @param {number} max max + * @param {number} step step + * @private + * @returns {{ + * min: number, + * max: number + * }} + * max = 155 and step = 10 ---> max = 160 + */ + function getNormalizedLimit(min, max, step) { + var minNumber = Math.min(getDigits(max), getDigits(step)); + var placeNumber = minNumber > 1 ? 1 : (1 / minNumber); + var fixedStep = (step * placeNumber); + + // ceil max value step digits + max = Math.ceil((max * placeNumber) / fixedStep) * fixedStep / placeNumber; + + if (min > step) { + // floor min value to multiples of step + min = Math.floor((min * placeNumber) / fixedStep) * fixedStep / placeNumber; + } else if (min < 0) { + min = -(Math.ceil((Math.abs(min) * placeNumber) / fixedStep) * fixedStep) / placeNumber; + } else { + // 0 when min value is positive and smaller than step + min = 0; + } + + return { + min: min, + max: max + }; + } + + /** + * Get normalized step count for floating point calculate error + * @param {number} limitSize limit size of chart min max distance + * @param {number} step step distance + * @returns {number} + * @ignore + */ + function getNormalizedStepCount(limitSize, step) { + var multiplier = 1 / Math.min(getDigits(limitSize), getDigits(step)); + + return Math.ceil((limitSize * multiplier) / (step * multiplier)); + } + + /** + * Get normalized scale data + * @param {object} scale scale + * @private + * @returns {object} + * @ignore + */ + function getNormalizedScale(scale) { + var step = getNormalizedStep(scale.step); + var edge = getNormalizedLimit(scale.limit.min, scale.limit.max, step); + var limitSize = Math.abs(edge.max - edge.min); + var stepCount = getNormalizedStepCount(limitSize, step); + + return { + limit: { + min: edge.min, + max: edge.max + }, + step: step, + stepCount: stepCount + }; + } + + /** + * Get rough(not normalized) scale data + * @param {number} min min + * @param {number} max max + * @param {number} offsetSize offset size + * @param {number} stepCount step count + * @param {object} [minimumStepSize] for ensure minimum step size + * @private + * @returns {object} scale data + */ + function getRoughScale(min, max, offsetSize, stepCount, minimumStepSize) { + var limitSize = Math.abs(max - min); + var valuePerPixel = limitSize / offsetSize; + var pixelsPerStep, step; + + if (!stepCount) { + stepCount = Math.ceil(offsetSize / DEFAULT_PIXELS_PER_STEP); + } + + pixelsPerStep = offsetSize / stepCount; + + step = valuePerPixel * pixelsPerStep; + + if (snippet.isNumber(minimumStepSize) && step < minimumStepSize) { + step = minimumStepSize; + stepCount = limitSize / step; + } + + return { + limit: { + min: min, + max: max + }, + step: step, + stepCount: stepCount + }; + } + + /** + * Calculate coordinate scale + * @param {object} options optionsPP + * @param {object} options.min min value + * @param {object} options.max max value + * @param {object} options.offsetSize offset pixel size of screen that needs scale + * @param {object} [options.stepCount] if need fixed step count + * @param {object} [options.minimumStepSize] for ensure minimum step size + * @returns {object} + * @ignore + */ + function coordinateScaleCalculator(options) { + var min = options.min; + var max = options.max; + var offsetSize = options.offsetSize; + var stepCount = options.stepCount; + var minimumStepSize = options.minimumStepSize; + + var scale = getRoughScale(min, max, offsetSize, stepCount, minimumStepSize); + scale = getNormalizedScale(scale); + + return scale; + } + + module.exports = coordinateScaleCalculator; + + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview scaleMaker calculates the limit and step into values of processed data and returns it. + * @auth NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var predicate = __webpack_require__(11); + var calculator = __webpack_require__(45); + var renderUtil = __webpack_require__(7); + var snippet = __webpack_require__(6); + + var abs = Math.abs; + + /** + * Format scale data labels + * @module scaleLabelFormatter + * @private + */ + var scaleLabelFormatter = { + /** + * Get functions for formatting value. + * @param {string} chartType - chart type + * @param {string} stackType - stack type + * @param {?Array.} formatFunctions - format functions + * @returns {Array.} + * @private + */ + _getFormatFunctions: function(chartType, stackType, formatFunctions) { + if (predicate.isPercentStackChart(chartType, stackType)) { + formatFunctions = [function(value) { + return value + '%'; + }]; + } + + return formatFunctions; + }, + + /** + * Create scale values. + * @param {{limit: {min: number, max: number}, step: number}} scale - scale data + * @param {string} chartType - chart type + * @param {boolean} diverging - diverging option + * @returns {Array.} + * @private + */ + _createScaleValues: function(scale, chartType, diverging) { + var values = calculator.makeLabelsFromLimit(scale.limit, scale.step); + + return predicate.isDivergingChart(chartType, diverging) ? snippet.map(values, abs) : values; + }, + + /** + * Create formatted scale values. + * @param {{limit: {min: number, max: number}, step: number}} scale - scale data + * @param {{ + * chartType: string, + * areaType: string, + * valueType: string + * }} typeMap - type map + * @param {{ + * type: string, + * stackType: string, + * diverging: boolean, + * dateFormat: ?string + * }} options - options + * @param {?Array.} formatFunctions - format functions + * @returns {Array.|*} + */ + createFormattedLabels: function(scale, typeMap, options, formatFunctions) { + var chartType = typeMap.chartType; + var areaType = typeMap.areaType; + var valueType = typeMap.valueType; + var values = this._createScaleValues(scale, chartType, options.diverging); + var formattedValues; + + if (predicate.isDatetimeType(options.type)) { + formattedValues = renderUtil.formatDates(values, options.dateFormat); + } else { + formatFunctions = this._getFormatFunctions(chartType, options.stackType, formatFunctions); + formattedValues = renderUtil.formatValues(values, formatFunctions, chartType, areaType, valueType); + } + + return formattedValues; + } + }; + + module.exports = scaleLabelFormatter; + + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Axis Data Maker + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var geomatric = __webpack_require__(49); + var renderUtil = __webpack_require__(7); + var arrayUtil = __webpack_require__(10); + var snippet = __webpack_require__(6); + + /** + * Axis data maker. + * @module axisDataMaker + * @private */ + var axisDataMaker = { + /** + * Makes labels by labelInterval option. + * @param {Array.} labels - labels + * @param {number} labelInterval - label interval option + * @param {number} [addedDataCount] - added data count + * @returns {Array.} labels + * @private + */ + _makeLabelsByIntervalOption: function(labels, labelInterval, addedDataCount) { + addedDataCount = addedDataCount || 0; + labels = snippet.map(labels, function(label, index) { + if (((index + addedDataCount) % labelInterval) !== 0) { + label = chartConst.EMPTY_AXIS_LABEL; + } + + return label; + }); + + return labels; + }, + + /** + * Make axis data for label type. + * @memberOf module:axisDataMaker + * @param {object} params - parameters + * @param {Array.} params.labels - chart labels + * @param {boolean} params.isVertical - whether vertical or not + * @param {boolean} params.aligned - whether align or not + * @param {?boolean} params.addedDataCount - added data count + * @returns {{ + * labels: Array., + * tickCount: number, + * validTickCount: number, + * isLabelAxis: boolean, + * options: object, + * isVertical: boolean, + * isPositionRight: boolean, + * aligned: boolean + * }} + */ + makeLabelAxisData: function(params) { + var tickCount = params.labels.length; + var options = params.options || {}; + var labels = params.labels; + + if (predicate.isValidLabelInterval(options.labelInterval, options.tickInterval) + && params.labels.length > options.labelInterval) { + labels = this._makeLabelsByIntervalOption(params.labels, options.labelInterval, params.addedDataCount); + } + + if (predicate.isDatetimeType(options.type)) { + labels = renderUtil.formatDates(labels, options.dateFormat); + } + + if (!params.aligned) { + tickCount += 1; + } + + return { + labels: labels, + tickCount: tickCount, + validTickCount: 0, + isLabelAxis: true, + options: options, + isVertical: !!params.isVertical, + isPositionRight: !!params.isPositionRight, + aligned: !!params.aligned + }; + }, + + /** + * Make data for value type axis. + * @memberOf module:axisDataMaker + * @param {object} params parameters + * @param {AxisScaleMaker} params.axisScaleMaker chart values + * @param {boolean} params.isVertical whether vertical or not + * @returns {{ + * labels: Array., + * tickCount: number, + * validTickCount: number, + * isLabelAxis: boolean, + * limit: {min: number, max: number}, + * isVertical: boolean + * }} axis data + */ + makeValueAxisData: function(params) { + var labels = params.labels; + var tickCount = params.tickCount; + var limit = params.limit; + var axisData = { + labels: labels, + tickCount: tickCount, + validTickCount: tickCount, + limit: limit, + dataMin: limit.min, + distance: limit.max - limit.min, + step: params.step, + options: params.options, + isVertical: !!params.isVertical, + isPositionRight: !!params.isPositionRight, + aligned: !!params.aligned + }; + + return axisData; + }, + + /** + * Make additional data for coordinate line type chart. + * @param {Array.} labels - labels + * @param {Array.} values - values + * @param {{min: number, max: number}} limit - limit + * @param {number} step - step + * @param {number} tickCount = tickCount + * @returns {{ + * labels: Array., + * tickCount: number, + * validTickCount: number, + * limit: {min: number, max: number}, + * positionRatio: number, + * sizeRatio: number + * }} + */ + makeAdditionalDataForCoordinateLineType: function(labels, values, limit, step, tickCount) { + var sizeRatio = 1; + var positionRatio = 0; + var min = arrayUtil.min(values); + var max = arrayUtil.max(values); + var distance; + + distance = max - min; + + if (distance) { + if (limit.min < min) { + limit.min += step; + positionRatio = (limit.min - min) / distance; + sizeRatio -= positionRatio; + tickCount -= 1; + labels.shift(); + } + + if (limit.max > max) { + limit.max -= step; + sizeRatio -= (max - limit.max) / distance; + tickCount -= 1; + labels.pop(); + } + } + + return { + labels: labels, + tickCount: tickCount, + validTickCount: tickCount, + limit: limit, + dataMin: min, + distance: distance, + positionRatio: positionRatio, + sizeRatio: sizeRatio + }; + }, + + /** + * Make adjusting tick interval information. + * @param {number} beforeBlockCount - before block count + * @param {number} seriesWidth - width of series area + * @param {number} blockSize - block size + * @returns {null | {blockCount: number, beforeRemainBlockCount: number, interval: number}} + * @private + */ + _makeAdjustingIntervalInfo: function(beforeBlockCount, seriesWidth, blockSize) { + var newBlockCount = parseInt(seriesWidth / blockSize, 10); + // interval : number of previous blocks in a new block(spaces between tick and tick) + var interval = parseInt(beforeBlockCount / newBlockCount, 10); + var intervalInfo = null; + var remainCount; + + if (interval > 1) { + // remainCount : remaining block count after filling new blocks + // | | | | | | | | | | | | - previous block interval + // | | | | - new block interval + // |*|*| - remaining block + remainCount = beforeBlockCount - (interval * newBlockCount); + + if (remainCount >= interval) { + newBlockCount += parseInt(remainCount / interval, 0); + remainCount = remainCount % interval; + } + + intervalInfo = { + blockCount: newBlockCount, + beforeRemainBlockCount: remainCount, + interval: interval + }; + } + + return intervalInfo; + }, + + /** + * Make candidate for adjusting tick interval. + * @param {number} beforeBlockCount - before block count + * @param {number} seriesWidth - width of series area + * @returns {Array.<{newBlockCount: number, remainBlockCount: number, interval: number}>} + * @private + */ + _makeCandidatesForAdjustingInterval: function(beforeBlockCount, seriesWidth) { + var self = this; + var blockSizeRange = snippet.range(90, 121, 5); // [90, 95, 100, 105, 110, 115, 120] + var candidates = snippet.map(blockSizeRange, function(blockSize) { + return self._makeAdjustingIntervalInfo(beforeBlockCount, seriesWidth, blockSize); + }); + + return snippet.filter(candidates, function(info) { + return !!info; + }); + }, + + /** + * Calculate adjusting interval information for auto tick interval option. + * @param {number} curBlockCount - current block count + * @param {number} seriesWidth - series width + * @returns {{newBlockCount: number, remainBlockCount: number, interval: number}} + * @private + */ + _calculateAdjustingIntervalInfo: function(curBlockCount, seriesWidth) { + var candidates = this._makeCandidatesForAdjustingInterval(curBlockCount, seriesWidth); + var intervalInfo = null; + + if (candidates.length) { + intervalInfo = arrayUtil.min(candidates, function(candidate) { + return candidate.blockCount; + }); + } + + return intervalInfo; + }, + + /** + * Make filtered labels by interval. + * @param {Array.} labels - labels + * @param {number} startIndex - start index + * @param {number} interval - interval + * @returns {Array.} + * @private + */ + _makeFilteredLabelsByInterval: function(labels, startIndex, interval) { + return snippet.filter(labels.slice(startIndex), function(label, index) { + return index % interval === 0; + }); + }, + + /** + * Update label type axisData for auto tick interval option. + * @param {object} axisData - axisData + * @param {number} seriesWidth - series width + * @param {?number} addedDataCount - added data count + * @param {?boolean} addingDataMode - whether adding data mode or not + */ + updateLabelAxisDataForAutoTickInterval: function(axisData, seriesWidth, addedDataCount, addingDataMode) { + var beforeBlockCount, intervalInfo; + var adjustingBlockCount, interval, beforeRemainBlockCount, startIndex; + + if (addingDataMode) { + axisData.tickCount -= 1; + axisData.labels.pop(); + } + + beforeBlockCount = axisData.tickCount - 1; + intervalInfo = this._calculateAdjustingIntervalInfo(beforeBlockCount, seriesWidth); + + if (!intervalInfo) { + return; + } + + adjustingBlockCount = intervalInfo.blockCount; + interval = intervalInfo.interval; + beforeRemainBlockCount = intervalInfo.beforeRemainBlockCount; + axisData.eventTickCount = axisData.tickCount; + + // startIndex: (remaing block count / 2) - current moved tick index + // | | | |*|*|*| - * remaing block + // |*|*|O | | |*| - tick is not moved (O startIndex = 2) + // |*|O | | |*|*| - tick moved 1 (O startIndex = 1) + startIndex = Math.round(beforeRemainBlockCount / 2) - (addedDataCount % interval); + + if (startIndex < 0) { + startIndex += interval; + } + + axisData.labels = this._makeFilteredLabelsByInterval(axisData.labels, startIndex, interval); + + snippet.extend(axisData, { + startIndex: startIndex, + tickCount: adjustingBlockCount + 1, + positionRatio: (startIndex / beforeBlockCount), + sizeRatio: 1 - (beforeRemainBlockCount / beforeBlockCount), + interval: interval + }); + }, + + /** + * Update label type axisData for stacking dynamic data. + * @param {object} axisData - axis data + * @param {object} prevUpdatedData - previous updated axisData + * @param {number} firstTickCount - calculated first tick count + */ + updateLabelAxisDataForStackingDynamicData: function(axisData, prevUpdatedData, firstTickCount) { + var interval = prevUpdatedData.interval; + var startIndex = prevUpdatedData.startIndex; + var beforeBlockCount = axisData.tickCount - 1; + var newBlockCount = beforeBlockCount / interval; + var firstBlockCount = firstTickCount ? firstTickCount - 1 : 0; + var beforeRemainBlockCount; + + // twice interval, if new block count is greater than twice of new block count + if (firstBlockCount && ((firstBlockCount * 2) <= newBlockCount)) { + interval *= 2; + } + + axisData.labels = this._makeFilteredLabelsByInterval(axisData.labels, startIndex, interval); + newBlockCount = axisData.labels.length - 1; + beforeRemainBlockCount = beforeBlockCount - (interval * newBlockCount); + + snippet.extend(axisData, { + startIndex: startIndex, + eventTickCount: axisData.tickCount, + tickCount: axisData.labels.length, + positionRatio: startIndex / beforeBlockCount, + sizeRatio: 1 - (beforeRemainBlockCount / beforeBlockCount), + interval: interval + }); + }, + + /** + * Calculate width for label area for x axis. + * @param {boolean} isLabelAxis - whether label type axis or not + * @param {number} seriesWidth - series width + * @param {number} labelCount - label count + * @returns {number} limit width + * @private + */ + _calculateXAxisLabelAreaWidth: function(isLabelAxis, seriesWidth, labelCount) { + if (!isLabelAxis) { + labelCount -= 1; + } + + return seriesWidth / labelCount; + }, + + /** + * Create multiline label. + * @param {string} label - label + * @param {number} limitWidth - limit width + * @param {object} theme - label theme + * @returns {string} + * @private + */ + _createMultilineLabel: function(label, limitWidth, theme) { + var words = String(label).split(/\s+/); + var lineWords = words[0]; + var lines = []; + + snippet.forEachArray(words.slice(1), function(word) { + var width = renderUtil.getRenderedLabelWidth(lineWords + ' ' + word, theme); + + if (width > limitWidth) { + lines.push(lineWords); + lineWords = word; + } else { + lineWords += ' ' + word; + } + }); + + if (lineWords) { + lines.push(lineWords); + } + + return lines.join('
'); + }, + + /** + * Create multiline labels. + * @param {Array.} labels - labels + * @param {object} labelTheme - theme for label + * @param {number} labelAreaWidth - label area width + * @returns {Array} + * @private + */ + _createMultilineLabels: function(labels, labelTheme, labelAreaWidth) { + var _createMultilineLabel = this._createMultilineLabel; + + return snippet.map(labels, function(label) { + return _createMultilineLabel(label, labelAreaWidth, labelTheme); + }); + }, + + /** + * Calculate multiline height. + * @param {Array.string} multilineLabels - multiline labels + * @param {object} labelTheme - theme for label + * @param {number} labelAreaWidth - width for label area + * @returns {number} + * @private + */ + _calculateMultilineHeight: function(multilineLabels, labelTheme, labelAreaWidth) { + return renderUtil.getRenderedLabelsMaxHeight(multilineLabels, snippet.extend({ + cssText: 'line-height:1.2;width:' + labelAreaWidth + 'px' + }, labelTheme)); + }, + + /** + * Calculate height difference between origin category and multiline category. + * @param {Array.} labels - labels + * @param {Array.} validLabelCount - valid label count + * @param {object} labelTheme - theme for label + * @param {boolean} isLabelAxis - whether label type axis or not + * @param {{series: {width: number}, yAxis: {width: number}}} dimensionMap - dimension map + * @returns {number} + */ + makeAdditionalDataForMultilineLabels: function(labels, validLabelCount, labelTheme, isLabelAxis, dimensionMap) { + var seriesWidth = dimensionMap.series.width; + var labelAreaWidth = this._calculateXAxisLabelAreaWidth(isLabelAxis, seriesWidth, validLabelCount); + var multilineLabels = this._createMultilineLabels(labels, labelTheme, seriesWidth); + var multilineHeight = this._calculateMultilineHeight(multilineLabels, labelTheme, labelAreaWidth); + var labelHeight = renderUtil.getRenderedLabelsMaxHeight(labels, labelTheme); + + return { + multilineLabels: multilineLabels, + overflowHeight: multilineHeight - labelHeight, + overflowLeft: (labelAreaWidth / 2) - dimensionMap.yAxis.width + }; + }, + + /** + * Find rotation degree. + * @param {number} labelAreaWidth - limit width + * @param {number} labelWidth - label width + * @param {number} labelHeight - label height + * @returns {number} + * @private + */ + _findRotationDegree: function(labelAreaWidth, labelWidth, labelHeight) { + var foundDegree = null; + + snippet.forEachArray(chartConst.DEGREE_CANDIDATES, function(degree) { + var compareWidth = geomatric.calculateRotatedWidth(degree, labelWidth, labelHeight); + + foundDegree = degree; + + if (compareWidth <= labelAreaWidth + chartConst.XAXIS_LABEL_COMPARE_MARGIN) { + return false; + } + + return true; + }); + + return foundDegree; + }, + + /** + * Calculate rotated width. + * @param {number} degree - degree for label of x axis + * @param {string} firstLabel - first label + * @param {number} labelHeight - labelHeight + * @param {object} labelTheme - theme for label + * @returns {number} + * @private + */ + _calculateRotatedWidth: function(degree, firstLabel, labelHeight, labelTheme) { + var firstLabelWidth = renderUtil.getRenderedLabelWidth(firstLabel, labelTheme); + var newLabelWidth = geomatric.calculateRotatedWidth(degree, firstLabelWidth, labelHeight); + + // when checking overflow, calculation should be based on right top angle + newLabelWidth -= geomatric.calculateAdjacent(chartConst.ANGLE_90 - degree, labelHeight / 2); + + return newLabelWidth; + }, + + /** + * Calculate limit width for label + * @param {number} yAxisWidth - y axis width + * @param {boolean} isLabelAxis - aligned tick and label + * @param {number} labelAreaWidth - width for label area + * @returns {number} + * @private + */ + _calculateLimitWidth: function(yAxisWidth, isLabelAxis, labelAreaWidth) { + var limitWidth = yAxisWidth; + + if (isLabelAxis) { + limitWidth += (labelAreaWidth / 2); + } + + return limitWidth; + }, + + /** + * Make additional data for rotated labels. + * The label size is larger than the specified area, creating data to handle the area beyond the border. + * @param {Array.} validLabels - valid labels + * @param {Array.} validLabelCount - valid label count + * @param {object} labelTheme - theme for label + * @param {boolean} isLabelAxis - whether label type axis or not + * @param {{series: {width: number}, yAxis: {width: number}}} dimensionMap - dimension map + * @returns {{degree: number, overflowHeight: number, overflowLeft: number}} + */ + makeAdditionalDataForRotatedLabels: function(validLabels, validLabelCount, labelTheme, isLabelAxis, dimensionMap) { + var maxLabelWidth = renderUtil.getRenderedLabelsMaxWidth(validLabels, labelTheme); + var seriesWidth = dimensionMap.series.width; + var labelAreaWidth = this._calculateXAxisLabelAreaWidth(isLabelAxis, seriesWidth, validLabelCount); + var additionalData = null; + var degree, labelHeight, rotatedHeight, limitWidth, rotatedWidth; + var contentWidth = chartConst.CHART_PADDING + dimensionMap.yAxis.width + seriesWidth; + + if (labelAreaWidth < maxLabelWidth) { + labelHeight = renderUtil.getRenderedLabelsMaxHeight(validLabels, labelTheme); + degree = this._findRotationDegree(labelAreaWidth, maxLabelWidth, labelHeight); + rotatedHeight = geomatric.calculateRotatedHeight(degree, maxLabelWidth, labelHeight); + rotatedWidth = this._calculateRotatedWidth(degree, validLabels[0], labelHeight, labelTheme); + limitWidth = this._calculateLimitWidth(dimensionMap.yAxis.width, isLabelAxis, labelAreaWidth); + contentWidth += rotatedWidth; // add spaces to render maybe one label + + additionalData = { + degree: degree, + overflowHeight: rotatedHeight - labelHeight, + overflowLeft: rotatedWidth - limitWidth, + overflowRight: contentWidth - dimensionMap.chart.width + }; + } else { + contentWidth += maxLabelWidth; + + labelAreaWidth = renderUtil.getRenderedLabelWidth(validLabels[0], labelTheme) / 2; + additionalData = { + overflowLeft: labelAreaWidth - dimensionMap.yAxis.width, + overflowRight: contentWidth - dimensionMap.chart.width + }; + } + + return additionalData; + } + }; + + module.exports = axisDataMaker; + + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Column chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var chartConst = __webpack_require__(8); + var rawDataHandler = __webpack_require__(31); + var snippet = __webpack_require__(6); + + var ColumnChart = snippet.defineClass(ChartBase, /** @lends ColumnChart.prototype */ { + /** + * className + * @type {string} + */ + className: 'tui-column-chart', + /** + * Column chart. + * @constructs ColumnChart + * @extends ChartBase + * @mixes axisTypeMixer + * @mixes verticalTypeMixer + * @param {Array.} rawData raw data + * @param {object} theme chart theme + * @param {object} options chart options + */ + init: function(rawData, theme, options) { + rawDataHandler.updateRawSeriesDataByOptions(rawData, options.series); + this._updateOptionsRelatedDiverging(options); + + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options, + hasAxes: true, + isVertical: true + }); + }, + + /** + * Update options related diverging option. + * @param {object} options - options + * @private + */ + _updateOptionsRelatedDiverging: function(options) { + options.series = options.series || {}; + + if (options.series.diverging) { + options.series.stackType = options.series.stackType || chartConst.NORMAL_STACK_TYPE; + } + }, + + /** + * Add components + * @override + */ + addComponents: function() { + this.componentManager.register('title', 'title'); + this.componentManager.register('plot', 'plot'); + this.componentManager.register('legend', 'legend'); + + this.componentManager.register('columnSeries', 'columnSeries'); + + this.componentManager.register('yAxis', 'axis'); + this.componentManager.register('xAxis', 'axis'); + + this.componentManager.register('chartExportMenu', 'chartExportMenu'); + this.componentManager.register('tooltip', 'tooltip'); + this.componentManager.register('mouseEventDetector', 'mouseEventDetector'); + }, + + /** + * Get scale option. + * @returns {{yAxis: boolean}} + * @override + */ + getScaleOption: function() { + return { + yAxis: true + }; + }, + /** + * Add data ratios. + * @override + * modified from axisTypeMixer + */ + addDataRatios: function(limitMap) { + var seriesOption = this.options.series || {}; + var chartType = this.chartType; + var stackType = (seriesOption[chartType] || seriesOption).stackType; + + this.dataProcessor.addDataRatios(limitMap[chartType], stackType, chartType); + } + }); + + module.exports = ColumnChart; + + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Line chart + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var predicate = __webpack_require__(11); + var DynamicDataHelper = __webpack_require__(126); + var Series = __webpack_require__(85); + var rawDataHandler = __webpack_require__(31); + var snippet = __webpack_require__(6); + + var LineChart = snippet.defineClass(ChartBase, /** @lends LineChart.prototype */ { + /** + * className + * @type {string} + */ + className: 'tui-line-chart', + + /** + * Series class + * @type {function} + */ + Series: Series, + + /** + * Line chart. + * @param {Array.} rawData - raw data + * @param {object} theme - chart theme + * @param {object} options - chart options + * @constructs LineChart + * @extends ChartBase + * @mixes axisTypeMixer + * @mixes lineTypeMixer + */ + init: function(rawData, theme, options) { + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options, + hasAxes: true, + isVertical: true + }); + + if (this.dataProcessor.isCoordinateType()) { + delete this.options.xAxis.tickInterval; + this.options.tooltip.grouped = false; + this.options.series.shifting = false; + } + + this._dynamicDataHelper = new DynamicDataHelper(this); + }, + /** + * Add data. + * @param {string} category - category + * @param {Array} values - values + */ + addData: function(category, values) { + this._dynamicDataHelper.addData(category, values); + }, + + /** + * On change checked legend. + * @param {Array. | {line: ?Array., column: ?Array.}} checkedLegends checked legends + * @param {?object} rawData rawData + * @param {?object} boundsParams addition params for calculating bounds + * @override + */ + onChangeCheckedLegends: function(checkedLegends, rawData, boundsParams) { + this._dynamicDataHelper.reset(); + this._dynamicDataHelper.changeCheckedLegends(checkedLegends, rawData, boundsParams); + }, + /** + * Add data ratios. + * @override + * from axisTypeMixer + */ + addDataRatios: function(limitMap) { + var self = this; + var chartTypes = this.chartTypes || [this.chartType]; + var seriesOption = this.options.series || {}; + var addDataRatio; + + if (this.dataProcessor.isCoordinateType()) { + addDataRatio = function(chartType) { + var hasRadius = predicate.isBubbleChart(chartType); + self.dataProcessor.addDataRatiosForCoordinateType(chartType, limitMap, hasRadius); + }; + } else { + addDataRatio = function(chartType) { + var stackType = (seriesOption[chartType] || seriesOption).stackType; + + self.dataProcessor.addDataRatios(limitMap[chartType], stackType, chartType); + }; + } + + snippet.forEachArray(chartTypes, addDataRatio); + }, + /** + * Add components + * @override + */ + addComponents: function() { + this.componentManager.register('title', 'title'); + this.componentManager.register('plot', 'plot'); + + this.componentManager.register('lineSeries', 'lineSeries'); + + this.componentManager.register('xAxis', 'axis'); + this.componentManager.register('yAxis', 'axis'); + + this.componentManager.register('legend', 'legend'); + + this.componentManager.register('chartExportMenu', 'chartExportMenu'); + + this.componentManager.register('tooltip', 'tooltip'); + this.componentManager.register('mouseEventDetector', 'mouseEventDetector'); + }, + /** + * Get scale option. + * from lineTypeMixer + * @returns {{xAxis: ?{valueType:string}, yAxis: ?(boolean|{valueType:string})}} + * @override + */ + getScaleOption: function() { + var scaleOption = {}; + var xAxisOption = this.options.xAxis; + var hasDateFormat, isDateTimeTypeXAxis; + + if (this.dataProcessor.isCoordinateType()) { + isDateTimeTypeXAxis = xAxisOption && xAxisOption.type === 'datetime'; + hasDateFormat = isDateTimeTypeXAxis && snippet.isExisty(xAxisOption.dateFormat); + + scaleOption.xAxis = { + valueType: 'x' + }; + + if (isDateTimeTypeXAxis) { + scaleOption.xAxis.type = (xAxisOption || {}).dateTime; + } + + if (hasDateFormat) { + scaleOption.xAxis.format = (xAxisOption || {}).dateFormat; + } + + scaleOption.yAxis = { + valueType: 'y' + }; + } else { + scaleOption.yAxis = true; + } + + return scaleOption; + }, + + /** + * Add plot line. + * @param {{index: number, color: string, id: string}} data - data + * @override + * @api + */ + addPlotLine: function(data) { + this.componentManager.get('plot').addPlotLine(data); + }, + + /** + * Add plot band. + * @param {{range: Array., color: string, id: string}} data - data + * @override + * @api + */ + addPlotBand: function(data) { + this.componentManager.get('plot').addPlotBand(data); + }, + + /** + * Remove plot line. + * @param {string} id - line id + * @override + * @api + */ + removePlotLine: function(id) { + this.componentManager.get('plot').removePlotLine(id); + }, + + /** + * Remove plot band. + * @param {string} id - band id + * @override + * @api + */ + removePlotBand: function(id) { + this.componentManager.get('plot').removePlotBand(id); + }, + /** + * Render for zoom. + * from chart/zoomMixer + * @param {boolean} isResetZoom - whether reset zoom or not + * @private + */ + _renderForZoom: function(isResetZoom) { + var boundsAndScale = this.readyForRender(); + + this.componentManager.render('zoom', boundsAndScale, { + isResetZoom: isResetZoom + }); + }, + + /** + * On zoom. + * nnfrom chart/zoomMixer + * @param {Array.} indexRange - index range for zoom + * @override + */ + onZoom: function(indexRange) { + this._dynamicDataHelper.pauseAnimation(); + this.dataProcessor.updateRawDataForZoom(indexRange); + this._renderForZoom(false); + }, + + /** + * On reset zoom. + * from chart/zoomMixer + * @override + */ + onResetZoom: function() { + var rawData = this.dataProcessor.getOriginalRawData(); + + if (this._dynamicDataHelper.checkedLegends) { + rawData = rawDataHandler.filterCheckedRawData(rawData, this._dynamicDataHelper.checkedLegends); + } + + this.dataProcessor.initData(rawData); + this.dataProcessor.initZoomedRawData(); + this.dataProcessor.addDataFromRemainDynamicData(snippet.pick(this.options.series, 'shifting')); + this._renderForZoom(true); + this._dynamicDataHelper.restartAnimation(); + } + }); + + module.exports = LineChart; + + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var chartConst = __webpack_require__(8); + var predicate = __webpack_require__(11); + var snippet = __webpack_require__(6); + + var DynamicDataHelper = snippet.defineClass(/** @lends DynamicDataHelper.prototype */ { + init: function(chart) { + var firstRenderCheck = snippet.bind(function() { + this.isInitRenderCompleted = true; + this.chart.off(firstRenderCheck); + }, this); + + /** + * chart instance + * @type {ChartBase} + */ + this.chart = chart; + + this.isInitRenderCompleted = false; + + this.chart.on('load', firstRenderCheck); + + this.reset(); + }, + reset: function() { + /** + * whether lookupping or not + * @type {boolean} + */ + this.lookupping = false; + + /** + * whether paused or not + * @type {boolean} + */ + this.paused = false; + + /** + * rendering delay timer id + * @type {null} + */ + this.rerenderingDelayTimerId = null; + + /** + * added data count + * @type {number} + */ + this.addedDataCount = 0; + + /** + * checked legends. + * @type {null | Array. | {line: ?Array., column: ?Array.}} + */ + this.checkedLegends = null; + + /** + * previous xAxis data + * @type {null|object} + */ + this.prevXAxisData = null; + }, + /** + * Calculate animate tick size. + * @param {number} xAxisWidth - x axis width + * @returns {number} + * @private + */ + _calculateAnimateTickSize: function(xAxisWidth) { + var dataProcessor = this.chart.dataProcessor; + var tickInterval = this.chart.options.xAxis.tickInterval; + var shiftingOption = !!this.chart.options.series.shifting; + var tickCount; + + if (dataProcessor.isCoordinateType()) { + tickCount = dataProcessor.getValues(this.chart.chartType, 'x').length - 1; + } else { + tickCount = dataProcessor.getCategoryCount(false) - 1; + } + + if (shiftingOption && !predicate.isAutoTickInterval(tickInterval)) { + tickCount -= 1; + } + + return xAxisWidth / tickCount; + }, + + /** + * Animate for adding data. + * @private + */ + _animateForAddingData: function() { + var chart = this.chart; + var boundsAndScale = chart.readyForRender(true); + var shiftingOption = !!this.chart.options.series.shifting; + var tickSize; + + this.addedDataCount += 1; + + tickSize = this._calculateAnimateTickSize(boundsAndScale.dimensionMap.xAxis.width); + + chart.componentManager.render('animateForAddingData', boundsAndScale, { + tickSize: tickSize, + shifting: shiftingOption + }); + + if (shiftingOption) { + chart.dataProcessor.shiftData(); + } + }, + + /** + * Rerender for adding data. + * @private + */ + _rerenderForAddingData: function() { + var chart = this.chart; + var boundsAndScale = chart.readyForRender(); + chart.componentManager.render('rerender', boundsAndScale); + }, + + /** + * Check for added data. + * @private + */ + _checkForAddedData: function() { + var chart = this.chart; + var self = this; + var added = chart.dataProcessor.addDataFromDynamicData(); + + if (!added) { + this.lookupping = false; + + return; + } + + if (this.paused) { + if (chart.options.series.shifting) { + chart.dataProcessor.shiftData(); + } + + return; + } + + this._animateForAddingData(); + + this.rerenderingDelayTimerId = setTimeout(function() { + self.rerenderingDelayTimerId = null; + self._rerenderForAddingData(); + self._checkForAddedData(); + }, 400); + }, + + /** + * Change checked legend. + * @param {Array. | {line: ?Array., column: ?Array.}} checkedLegends checked legends + * @param {?object} rawData rawData + * @param {?object} boundsParams addition params for calculating bounds + */ + changeCheckedLegends: function(checkedLegends, rawData, boundsParams) { + var self = this; + var chart = this.chart; + var shiftingOption = !!chart.options.series.shifting; + var pastPaused = this.paused; + + if (!pastPaused) { + this.pauseAnimation(); + } + + this.checkedLegends = checkedLegends; + chart.rerender(checkedLegends, rawData, boundsParams); + + if (!pastPaused) { + setTimeout(function() { + chart.dataProcessor.addDataFromRemainDynamicData(shiftingOption); + self.restartAnimation(); + }, chartConst.RERENDER_TIME); + } + }, + + /** + * Pause animation for adding data. + */ + pauseAnimation: function() { + this.paused = true; + + if (this.rerenderingDelayTimerId) { + clearTimeout(this.rerenderingDelayTimerId); + this.rerenderingDelayTimerId = null; + + if (this.chart.options.series.shifting) { + this.chart.dataProcessor.shiftData(); + } + } + }, + + /** + * Restart animation for adding data. + */ + restartAnimation: function() { + this.paused = false; + this.lookupping = false; + this._startLookup(); + }, + + /** + * Start lookup for checking added data. + * @private + */ + _startLookup: function() { + if (this.lookupping) { + return; + } + + this.lookupping = true; + + this._checkForAddedData(); + }, + + /** + * Add data. + * @param {string} category - category + * @param {Array} values - values + */ + addData: function(category, values) { + if (!values) { + values = category; + category = null; + } + + this.chart.dataProcessor.addDynamicData(category, values); + + // we should not animate for added data if initial render have not completed + if (this.isInitRenderCompleted) { + this._startLookup(); + } else if (values) { + this.addedDataCount += 1; + } + } + }); + + module.exports = DynamicDataHelper; + + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Area chart + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var DynamicDataHelper = __webpack_require__(126); + var rawDataHandler = __webpack_require__(31); + var Series = __webpack_require__(88); + var snippet = __webpack_require__(6); + + var AreaChart = snippet.defineClass(ChartBase, /** @lends AreaChart.prototype */ { + /** + * className + * @type {string} + */ + className: 'tui-area-chart', + + /** + * Series class + * @type {function} + */ + Series: Series, + + /** + * Area chart. + * @constructs AreaChart + * @extends ChartBase + * @param {Array.} rawData - raw data + * @param {object} theme - chart theme + * @param {object} options - chart options + * @mixes axisTypeMixer + * @mixes lineTypeMixer + */ + init: function(rawData, theme, options) { + rawDataHandler.removeSeriesStack(rawData.series); + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options, + hasAxes: true, + isVertical: true + }); + + this._dynamicDataHelper = new DynamicDataHelper(this); + }, + /** + * Add data. + * @param {string} category - category + * @param {Array} values - values + */ + addData: function(category, values) { + this._dynamicDataHelper.addData(category, values); + }, + /** + * On change checked legend. + * @param {Array. | {line: ?Array., column: ?Array.}} checkedLegends checked legends + * @param {?object} rawData rawData + * @param {?object} boundsParams addition params for calculating bounds + * @override + */ + onChangeCheckedLegends: function(checkedLegends, rawData, boundsParams) { + this._dynamicDataHelper.reset(); + this._dynamicDataHelper.changeCheckedLegends(checkedLegends, rawData, boundsParams); + }, + /** + * Add data ratios. + * @override + * from axisTypeMixer + */ + addDataRatios: function(limitMap) { + var self = this; + var chartTypes = this.chartTypes || [this.chartType]; + var seriesOption = this.options.series || {}; + var addDataRatio; + + if (this.dataProcessor.isCoordinateType()) { + addDataRatio = function(chartType) { + self.dataProcessor.addDataRatiosForCoordinateType(chartType, limitMap, false); + }; + } else { + addDataRatio = function(chartType) { + var stackType = (seriesOption[chartType] || seriesOption).stackType; + self.dataProcessor.addDataRatios(limitMap[chartType], stackType, chartType); + }; + } + + snippet.forEachArray(chartTypes, addDataRatio); + }, + + /** + * Add components + * @override + */ + addComponents: function() { + this.componentManager.register('title', 'title'); + this.componentManager.register('plot', 'plot'); + this.componentManager.register('legend', 'legend'); + + this.componentManager.register('areaSeries', 'areaSeries'); + + this.componentManager.register('xAxis', 'axis'); + this.componentManager.register('yAxis', 'axis'); + + this.componentManager.register('chartExportMenu', 'chartExportMenu'); + this.componentManager.register('tooltip', 'tooltip'); + this.componentManager.register('mouseEventDetector', 'mouseEventDetector'); + }, + /** + * Get scale option. + * from lineTypeMixer + * @returns {{xAxis: ?{valueType:string}, yAxis: ?(boolean|{valueType:string})}} + * @override + */ + getScaleOption: function() { + var scaleOption = {}; + + if (this.dataProcessor.isCoordinateType()) { + scaleOption.xAxis = { + valueType: 'x' + }; + scaleOption.yAxis = { + valueType: 'y' + }; + } else { + scaleOption.yAxis = true; + } + + return scaleOption; + }, + + /** + * Add plot line. + * @param {{index: number, color: string, id: string}} data - data + * @override + * @api + */ + addPlotLine: function(data) { + this.componentManager.get('plot').addPlotLine(data); + }, + + /** + * Add plot band. + * @param {{range: Array., color: string, id: string}} data - data + * @override + * @api + */ + addPlotBand: function(data) { + this.componentManager.get('plot').addPlotBand(data); + }, + + /** + * Remove plot line. + * @param {string} id - line id + * @override + * @api + */ + removePlotLine: function(id) { + this.componentManager.get('plot').removePlotLine(id); + }, + + /** + * Remove plot band. + * @param {string} id - band id + * @override + * @api + */ + removePlotBand: function(id) { + this.componentManager.get('plot').removePlotBand(id); + }, + /** + * Render for zoom. + * from chart/zoomMixer + * @param {boolean} isResetZoom - whether reset zoom or not + * @private + */ + _renderForZoom: function(isResetZoom) { + var boundsAndScale = this.readyForRender(); + + this.componentManager.render('zoom', boundsAndScale, { + isResetZoom: isResetZoom + }); + }, + + /** + * On zoom. + * nnfrom chart/zoomMixer + * @param {Array.} indexRange - index range for zoom + * @override + */ + onZoom: function(indexRange) { + this._dynamicDataHelper.pauseAnimation(); + this.dataProcessor.updateRawDataForZoom(indexRange); + this._renderForZoom(false); + }, + + /** + * On reset zoom. + * from chart/zoomMixer + * @override + */ + onResetZoom: function() { + var rawData = this.dataProcessor.getOriginalRawData(); + + if (this._dynamicDataHelper.checkedLegends) { + rawData = rawDataHandler.filterCheckedRawData(rawData, this._dynamicDataHelper.checkedLegends); + } + + this.dataProcessor.initData(rawData); + this.dataProcessor.initZoomedRawData(); + this.dataProcessor.addDataFromRemainDynamicData(snippet.pick(this.options.series, 'shifting')); + this._renderForZoom(true); + this._dynamicDataHelper.restartAnimation(); + } + }); + + module.exports = AreaChart; + + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Column and Line Combo chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var rawDataHandler = __webpack_require__(31); + var predicate = __webpack_require__(11); + var validTypeMakerForYAxisOptions = __webpack_require__(129); + var snippet = __webpack_require__(6); + + var ColumnLineComboChart = snippet.defineClass(ChartBase, /** @lends ColumnLineComboChart.prototype */ { + /** + * Column and Line Combo chart. + * @constructs ColumnLineComboChart + * @extends ChartBase + * @param {Array.} rawData raw data + * @param {object} theme chart theme + * @param {object} options chart options + */ + init: function(rawData, theme, options) { + var typeData = validTypeMakerForYAxisOptions({ + rawSeriesData: rawData.series, + yAxisOptions: options.yAxis + }); + + /** + * chart types + * @type {Object} + */ + this.chartTypes = typeData.chartTypes; + + /** + * series types + * @type {Object|Array.} + */ + this.seriesTypes = typeData.seriesTypes; + + /** + * yAxis options + * @type {object} + */ + this.yAxisOptions = this._makeYAxisOptions(this.chartTypes, options.yAxis); + + /** + * whether has right y axis or not + * @type {boolean} + */ + this.hasRightYAxis = snippet.isArray(options.yAxis) && options.yAxis.length > 1; + + options.tooltip = options.tooltip || {}; + options.tooltip.grouped = true; + + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options, + hasAxes: true, + isVertical: true + }); + }, + + /** + * Make yAxis options. + * @param {Array.} chartTypes chart types + * @param {?object} yAxisOptions yAxis options + * @returns {{column: ?object, line: ?object}} options map + * @private + * from verticalTypeComboMixer + */ + _makeYAxisOptions: function(chartTypes, yAxisOptions) { + var options = {}; + yAxisOptions = yAxisOptions || {}; + snippet.forEachArray(chartTypes, function(chartType, index) { + options[chartType] = yAxisOptions[index] || yAxisOptions; + }); + + return options; + }, + + /** + * On change selected legend. + * @param {Array. | {line: ?Array., column: ?Array.}} checkedLegends checked legends + */ + onChangeCheckedLegends: function(checkedLegends) { + var originalRawData = this.dataProcessor.getOriginalRawData(); + var rawData = rawDataHandler.filterCheckedRawData(originalRawData, checkedLegends); + var typeData = validTypeMakerForYAxisOptions({ + rawSeriesData: rawData.series, + yAxisOptions: this.options.yAxis + }); + + this.chartTypes = typeData.chartTypes; + this.seriesTypes = typeData.seriesTypes; + + this.rerender(checkedLegends, rawData, typeData); + }, + + /** + * Add components + * @override + */ + addComponents: function() { + this.componentManager.register('title', 'title'); + this.componentManager.register('plot', 'plot'); + this.componentManager.register('legend', 'legend'); + + this.componentManager.register('columnSeries', 'columnSeries'); + this.componentManager.register('lineSeries', 'lineSeries'); + + this.componentManager.register('yAxis', 'axis'); + + if (this.hasRightYAxis) { + this.componentManager.register('rightYAxis', 'axis'); + } + + this.componentManager.register('xAxis', 'axis'); + + this.componentManager.register('chartExportMenu', 'chartExportMenu'); + this.componentManager.register('tooltip', 'tooltip'); + this.componentManager.register('mouseEventDetector', 'mouseEventDetector'); + }, + /** + * Get scale option. + * @returns {{ + * yAxis: {options: object, areaType: string, chartType: string, additionalParams: object}, + * rightYAxis: {options: object, areaType: string, chartType: string, additionalParams: object} + * }} + * @override + */ + getScaleOption: function() { + var scaleOption = { + yAxis: this._makeYAxisScaleOption('yAxis', this.chartTypes[0], !this.hasRightYAxis) + }; + + if (this.hasRightYAxis) { + scaleOption.rightYAxis = this._makeYAxisScaleOption('rightYAxis', this.chartTypes[1]); + } + + return scaleOption; + }, + /** + * Make y axis scale option. + * @param {string} name - component name + * @param {string} chartType - chart type + * @param {boolean} isSingleYAxis - whether single y axis or not + * @returns {{options: object, areaType: string, chartType: string, additionalParams: object}} + * @private + * from verticalTypeComboMixer + */ + _makeYAxisScaleOption: function(name, chartType, isSingleYAxis) { + var yAxisOption = this.yAxisOptions[chartType]; + var additionalOptions = { + isSingleYAxis: !!isSingleYAxis + }; + + if (isSingleYAxis && this.options.series) { + this._setAdditionalOptions(additionalOptions); + } + + return { + options: yAxisOption, + areaType: 'yAxis', + chartType: chartType, + additionalOptions: additionalOptions + }; + }, + + /** + * Set additional parameter for making y axis scale option. + * @param {{isSingleYAxis: boolean}} additionalOptions - additional options + * @private + * from verticalTypeComboMixer + */ + _setAdditionalOptions: function(additionalOptions) { + var dataProcessor = this.dataProcessor; + + snippet.forEach(this.options.series, function(seriesOption, seriesType) { + var chartType; + + if (!seriesOption.stackType) { + return; + } + + chartType = dataProcessor.findChartType(seriesType); + + if (!predicate.isAllowedStackOption(chartType)) { + return; + } + + additionalOptions.chartType = chartType; + additionalOptions.stackType = seriesOption.stackType; + }); + }, + /** + * Add data ratios. + * @override + * from axisTypeMixer + */ + addDataRatios: function(limitMap) { + var self = this; + var chartTypes = this.chartTypes || [this.chartType]; + var seriesOption = this.options.series || {}; + var addDataRatio; + + addDataRatio = function(chartType) { + var stackType = (seriesOption[chartType] || seriesOption).stackType; + + self.dataProcessor.addDataRatios(limitMap[chartType], stackType, chartType); + }; + + snippet.forEachArray(chartTypes, addDataRatio); + } + }); + + module.exports = ColumnLineComboChart; + + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Implements valid type maker on yAxisOptions + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var snippet = __webpack_require__(6); + + /** + * Make valid types on yAxisOptions + * @param {object} params parameters + * @param {Array.} params.rawSeriesData raw series data + * @param {object} params.yAxisOptions chart yAxis options + * @param {string} params.chartType chart type + * @returns {object} { + * chartTypes: Array., + * seriesTypes: Array., + * hasRightYAxis: boolean, + * yAxisOptionsMap: object + * } + * @ignore + */ + function validTypeMakerForYAxisOptions(params) { + var rawSeriesData = params.rawSeriesData; + var yAxisOptions = params.yAxisOptions; + var chartTypesMap = makeChartTypesMap(rawSeriesData, yAxisOptions); + + return { + chartTypes: chartTypesMap.chartTypes, + seriesTypes: chartTypesMap.seriesTypes + }; + } + + /** + * Make chart types map. + * @param {object} rawSeriesData raw series data + * @param {object} yAxisOption option for y axis + * @returns {object} chart types map + * @private + */ + function makeChartTypesMap(rawSeriesData, yAxisOption) { + var seriesTypes = snippet.keys(rawSeriesData).sort(); + var optionChartTypes = getYAxisOptionChartTypes(seriesTypes, yAxisOption); + var chartTypes = optionChartTypes.length ? optionChartTypes : seriesTypes; + var validChartTypes = snippet.filter(optionChartTypes, function(_chartType) { + return rawSeriesData[_chartType].length; + }); + var chartTypesMap; + + if (validChartTypes.length === 1) { + chartTypesMap = { + chartTypes: validChartTypes, + seriesTypes: validChartTypes + }; + } else { + chartTypesMap = { + chartTypes: chartTypes, + seriesTypes: seriesTypes + }; + } + + return chartTypesMap; + } + + /** + * Get y axis option chart types. + * @param {Array.} chartTypes chart types + * @param {object} yAxisOption - options for y axis + * @returns {Array.} + * @private + */ + function getYAxisOptionChartTypes(chartTypes, yAxisOption) { + var resultChartTypes = chartTypes.slice(); + var yAxisOptions = [].concat(yAxisOption || []); + var isReverse = false; + var optionChartTypes; + + if (!yAxisOptions.length || (yAxisOptions.length === 1 && !yAxisOptions[0].chartType)) { + resultChartTypes = []; + } else if (yAxisOptions.length) { + optionChartTypes = snippet.map(yAxisOptions, function(option) { + return option.chartType; + }); + + snippet.forEachArray(optionChartTypes, function(chartType, index) { + isReverse = isReverse || ((chartType && resultChartTypes[index] !== chartType) || false); + }); + + if (isReverse) { + resultChartTypes.reverse(); + } + } + + return resultChartTypes; + } + + module.exports = validTypeMakerForYAxisOptions; + + +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Line and Scatter Combo chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var snippet = __webpack_require__(6); + + var LineScatterComboChart = snippet.defineClass(ChartBase, /** @lends LineScatterComboChart.prototype */ { + /** + * Line and Scatter Combo chart. + * @constructs LineScatterComboChart + * @extends ChartBase + * @param {Array.} rawData - raw data + * @param {object} theme - chart theme + * @param {object} options - chart options + */ + init: function(rawData, theme, options) { + /** + * chart types map + * @type {Object} + */ + this.chartTypes = ['line', 'scatter']; + + /** + * series types + * @type {Object|Array.} + */ + this.seriesTypes = ['line', 'scatter']; + + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options, + hasAxes: true, + isVertical: true + }); + }, + + /** + * Get scale option. + * @returns {{ + * yAxis: {valueType: string, additionalOptions: {isSingleYAxis: boolean}}, + * xAxis: {valueType: string} + * }} + * @override + */ + getScaleOption: function() { + return { + yAxis: { + valueType: 'y' + }, + xAxis: { + valueType: 'x' + } + }; + }, + + /** + * Add data ratios. + * @override + * from axisTypeMixer + */ + addDataRatios: function(limitMap) { + var self = this; + var chartTypes = this.chartTypes || [this.chartType]; + var addDataRatio; + + addDataRatio = function(chartType) { + self.dataProcessor.addDataRatiosForCoordinateType(chartType, limitMap, false); + }; + + snippet.forEachArray(chartTypes, addDataRatio); + }, + + /** + * Add components + * @override + */ + addComponents: function() { + this.componentManager.register('title', 'title'); + this.componentManager.register('plot', 'plot'); + this.componentManager.register('legend', 'legend'); + + this.componentManager.register('lineSeries', 'lineSeries'); + this.componentManager.register('scatterSeries', 'scatterSeries'); + + this.componentManager.register('yAxis', 'axis'); + this.componentManager.register('xAxis', 'axis'); + + this.componentManager.register('chartExportMenu', 'chartExportMenu'); + this.componentManager.register('tooltip', 'tooltip'); + this.componentManager.register('mouseEventDetector', 'mouseEventDetector'); + } + }); + + module.exports = LineScatterComboChart; + + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Line and Area Combo chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var rawDataHandler = __webpack_require__(31); + var predicate = __webpack_require__(11); + var validTypeMakerForYAxisOptions = __webpack_require__(129); + var DynamicDataHelper = __webpack_require__(126); + var snippet = __webpack_require__(6); + + var LineAreaComboChart = snippet.defineClass(ChartBase, /** @lends LineAreaComboChart.prototype */ { + /** + * className + * @type {string} + */ + className: 'tui-combo-chart', + /** + * Line and Area Combo chart. + * @constructs LineAreaComboChart + * @extends ChartBase + * @param {Array.} rawData - raw data + * @param {object} theme - chart theme + * @param {object} options - chart options + */ + init: function(rawData, theme, options) { + var typeData = validTypeMakerForYAxisOptions({ + rawSeriesData: rawData.series, + yAxisOptions: options.yAxis + }); + + /** + * chart types + * @type {Object} + */ + this.chartTypes = typeData.chartTypes; + + /** + * series types + * @type {Object|Array.} + */ + this.seriesTypes = typeData.seriesTypes; + + /** + * yAxis options + * @type {object} + */ + this.yAxisOptions = this._makeYAxisOptions(this.chartTypes, options.yAxis); + + /** + * whether has right y axis or not + * @type {boolean} + */ + this.hasRightYAxis = snippet.isArray(options.yAxis) && options.yAxis.length > 1; + + options.tooltip = options.tooltip || {}; + options.tooltip.grouped = true; + + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options, + hasAxes: true, + isVertical: true + }); + + this._dynamicDataHelper = new DynamicDataHelper(this); + }, + + /** + * On change selected legend. + * @param {Array. | {line: ?Array., column: ?Array.}} checkedLegends checked legends + */ + onChangeCheckedLegends: function(checkedLegends) { + var zoomedRawData = this.dataProcessor.getZoomedRawData(); + var rawData = rawDataHandler.filterCheckedRawData(zoomedRawData, checkedLegends); + var typeData = validTypeMakerForYAxisOptions({ + rawSeriesData: rawData.series, + yAxisOptions: this.options.yAxis + }); + + this._dynamicDataHelper.reset(); + this._dynamicDataHelper.changeCheckedLegends(checkedLegends, rawData, typeData); + }, + /** + * Add components + * @override + */ + addComponents: function() { + this.componentManager.register('title', 'title'); + this.componentManager.register('plot', 'plot'); + this.componentManager.register('legend', 'legend'); + + this.componentManager.register('areaSeries', 'areaSeries'); + this.componentManager.register('lineSeries', 'lineSeries'); + + this.componentManager.register('xAxis', 'axis'); + this.componentManager.register('yAxis', 'axis'); + + if (this.hasRightYAxis) { + this.componentManager.register('rightYAxis', 'axis'); + } + + this.componentManager.register('chartExportMenu', 'chartExportMenu'); + this.componentManager.register('tooltip', 'tooltip'); + this.componentManager.register('mouseEventDetector', 'mouseEventDetector'); + }, + /** + * Get scale option. + * @returns {{ + * yAxis: {options: object, areaType: string, chartType: string, additionalParams: object}, + * rightYAxis: {options: object, areaType: string, chartType: string, additionalParams: object} + * }} + * @override + */ + getScaleOption: function() { + var scaleOption = { + yAxis: this._makeYAxisScaleOption('yAxis', this.chartTypes[0], !this.hasRightYAxis) + }; + + if (this.hasRightYAxis) { + scaleOption.rightYAxis = this._makeYAxisScaleOption('rightYAxis', this.chartTypes[1]); + } + + return scaleOption; + }, + /** + * Make y axis scale option. + * @param {string} name - component name + * @param {string} chartType - chart type + * @param {boolean} isSingleYAxis - whether single y axis or not + * @returns {{options: object, areaType: string, chartType: string, additionalParams: object}} + * @private + * from verticalTypeComboMixer + */ + _makeYAxisScaleOption: function(name, chartType, isSingleYAxis) { + var yAxisOption = this.yAxisOptions[chartType]; + var additionalOptions = { + isSingleYAxis: !!isSingleYAxis + }; + + if (isSingleYAxis && this.options.series) { + this._setAdditionalOptions(additionalOptions); + } + + return { + options: yAxisOption, + areaType: 'yAxis', + chartType: chartType, + additionalOptions: additionalOptions + }; + }, + /** + * Make yAxis options. + * @param {Array.} chartTypes chart types + * @param {?object} yAxisOptions yAxis options + * @returns {{column: ?object, line: ?object}} options map + * @private + * from verticalTypeComboMixer + */ + _makeYAxisOptions: function(chartTypes, yAxisOptions) { + var options = {}; + yAxisOptions = yAxisOptions || {}; + snippet.forEachArray(chartTypes, function(chartType, index) { + options[chartType] = yAxisOptions[index] || yAxisOptions; + }); + + return options; + }, + /** + * Add data. + * @param {string} category - category + * @param {Array} values - values + */ + addData: function(category, values) { + this._dynamicDataHelper.addData(category, values); + }, + /** + * Set additional parameter for making y axis scale option. + * @param {{isSingleYAxis: boolean}} additionalOptions - additional options + * @private + * from verticalTypeComboMixer + */ + _setAdditionalOptions: function(additionalOptions) { + var dataProcessor = this.dataProcessor; + + snippet.forEach(this.options.series, function(seriesOption, seriesType) { + var chartType; + + if (!seriesOption.stackType) { + return; + } + + chartType = dataProcessor.findChartType(seriesType); + + if (!predicate.isAllowedStackOption(chartType)) { + return; + } + + additionalOptions.chartType = chartType; + additionalOptions.stackType = seriesOption.stackType; + }); + }, + /** + * Add data ratios. + * @override + */ + addDataRatios: function(limitMap) { + var self = this; + var chartTypes = this.chartTypes || [this.chartType]; + var seriesOption = this.options.series || {}; + var addDataRatio; + + if (this.dataProcessor.isCoordinateType()) { + addDataRatio = function(chartType) { + self.dataProcessor.addDataRatiosForCoordinateType(chartType, limitMap, false); + }; + } else { + addDataRatio = function(chartType) { + var stackType = (seriesOption[chartType] || seriesOption).stackType; + + self.dataProcessor.addDataRatios(limitMap[chartType], stackType, chartType); + }; + } + + snippet.forEachArray(chartTypes, addDataRatio); + }, + /** + * Render for zoom. + * from chart/zoomMixer + * @param {boolean} isResetZoom - whether reset zoom or not + * @private + */ + _renderForZoom: function(isResetZoom) { + var boundsAndScale = this.readyForRender(); + + this.componentManager.render('zoom', boundsAndScale, { + isResetZoom: isResetZoom + }); + }, + + /** + * On zoom. + * nnfrom chart/zoomMixer + * @param {Array.} indexRange - index range for zoom + * @override + */ + onZoom: function(indexRange) { + this._dynamicDataHelper.pauseAnimation(); + this.dataProcessor.updateRawDataForZoom(indexRange); + this._renderForZoom(false); + }, + + /** + * On reset zoom. + * from chart/zoomMixer + * @override + */ + onResetZoom: function() { + var rawData = this.dataProcessor.getOriginalRawData(); + + if (this._dynamicDataHelper.checkedLegends) { + rawData = rawDataHandler.filterCheckedRawData(rawData, this._dynamicDataHelper.checkedLegends); + } + + this.dataProcessor.initData(rawData); + this.dataProcessor.initZoomedRawData(); + this.dataProcessor.addDataFromRemainDynamicData(snippet.pick(this.options.series, 'shifting')); + this._renderForZoom(true); + this._dynamicDataHelper.restartAnimation(); + } + }); + + module.exports = LineAreaComboChart; + + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Pie and Donut Combo chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var rawDataHandler = __webpack_require__(31); + var snippet = __webpack_require__(6); + + var PieDonutComboChart = snippet.defineClass(ChartBase, /** @lends PieDonutComboChart.prototype */ { + /** + * className + * @type {string} + */ + className: 'tui-combo-chart', + + /** + * Pie and Donut Combo chart. + * @constructs PieDonutComboChart + * @extends ChartBase + * @param {Array.} rawData raw data + * @param {object} theme chart theme + * @param {object} options chart options + */ + init: function(rawData, theme, options) { + /** + * chart types. + * @type {Array.} + */ + this.seriesTypes = snippet.keys(rawData.series).sort(); + + /** + * chart types + * @type {Object} + */ + this.chartTypes = ['pie', 'pie']; + + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options, + isVertical: true + }); + }, + + /** + * Add components + * @override + */ + addComponents: function() { + this.componentManager.register('title', 'title'); + this.componentManager.register('legend', 'legend'); + + this.componentManager.register('pie1Series', 'pieSeries'); + this.componentManager.register('pie2Series', 'pieSeries'); + + this.componentManager.register('chartExportMenu', 'chartExportMenu'); + this.componentManager.register('tooltip', 'tooltip'); + this.componentManager.register('mouseEventDetector', 'mouseEventDetector'); + }, + /** + * Add data ratios. + * @override + */ + addDataRatios: function() { + var self = this; + var seriesTypes = this.seriesTypes || [this.chartType]; + + snippet.forEachArray(seriesTypes, function(chartType) { + self.dataProcessor.addDataRatiosOfPieChart(chartType); + }); + }, + + /** + * On change selected legend. + * @param {Array. | {line: ?Array., column: ?Array.}} checkedLegends checked legends + * @override + */ + onChangeCheckedLegends: function(checkedLegends) { + var originalRawData = this.dataProcessor.getOriginalRawData(); + var rawData = rawDataHandler.filterCheckedRawData(originalRawData, checkedLegends); + + ChartBase.prototype.onChangeCheckedLegends.call(this, checkedLegends, rawData, { + seriesTypes: this.seriesTypes + }); + } + }); + + module.exports = PieDonutComboChart; + + +/***/ }), +/* 133 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Pie chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var chartConst = __webpack_require__(8); + var snippet = __webpack_require__(6); + + var PieChart = snippet.defineClass(ChartBase, /** @lends PieChart.prototype */ { + /** + * className + * @type {string} + */ + className: 'tui-pie-chart', + + /** + * Pie chart. + * @constructs PieChart + * @extends ChartBase + * @param {Array.} rawData raw data + * @param {object} theme chart theme + * @param {object} options chart options + */ + init: function(rawData, theme, options) { + options.tooltip = options.tooltip || {}; + + if (!options.tooltip.align) { + options.tooltip.align = chartConst.TOOLTIP_DEFAULT_ALIGN_OPTION; + } + + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options + }); + }, + + /** + * Add components + * @override + */ + addComponents: function() { + this.componentManager.register('title', 'title'); + this.componentManager.register('legend', 'legend'); + + this.componentManager.register('pieSeries', 'pieSeries'); + + this.componentManager.register('chartExportMenu', 'chartExportMenu'); + this.componentManager.register('tooltip', 'tooltip'); + this.componentManager.register('mouseEventDetector', 'mouseEventDetector'); + }, + + /** + * Add data ratios. + * @override + */ + addDataRatios: function() { + this.dataProcessor.addDataRatiosOfPieChart(this.chartType); + } + }); + + module.exports = PieChart; + + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Bubble chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var chartConst = __webpack_require__(8); + var snippet = __webpack_require__(6); + + var BubbleChart = snippet.defineClass(ChartBase, /** @lends BubbleChart.prototype */ { + /** + * className + * @type {string} + */ + className: 'tui-bubble-chart', + /** + * Bubble chart. + * @constructs BubbleChart + * @extends ChartBase + * @mixes axisTypeMixer + * @param {Array.} rawData raw data + * @param {object} theme chart theme + * @param {object} options chart options + */ + init: function(rawData, theme, options) { + options.tooltip = options.tooltip || {}; + options.circleLegend = options.circleLegend || {}; + + if (!options.tooltip.align) { + options.tooltip.align = chartConst.TOOLTIP_DEFAULT_ALIGN_OPTION; + } + + if (snippet.isUndefined(options.circleLegend.visible)) { + options.circleLegend.visible = true; + } + + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options, + hasAxes: true + }); + }, + + /** + * Get scale option. + * @returns {{xAxis: ?{valueType:string}, yAxis: ?{valueType:string}}} + * @override + */ + getScaleOption: function() { + var scaleOption = {}; + + if (this.dataProcessor.hasXValue(this.chartType)) { + scaleOption.xAxis = { + valueType: 'x' + }; + } + if (this.dataProcessor.hasYValue(this.chartType)) { + scaleOption.yAxis = { + valueType: 'y' + }; + } + + return scaleOption; + }, + + /** + * Set default options. + * @param {object} options - options for bubble chart + * @private + * @override + */ + _setDefaultOptions: function(options) { + ChartBase.prototype._setDefaultOptions.call(this, options); + this.options.circleLegend = this.options.circleLegend || {}; + + if (snippet.isUndefined(this.options.circleLegend.visible)) { + this.options.circleLegend.visible = true; + } + }, + + /** + * Add components + * @override + */ + addComponents: function() { + this.componentManager.register('title', 'title'); + this.componentManager.register('plot', 'plot'); + this.componentManager.register('legend', 'legend'); + this.componentManager.register('circleLegend', 'circleLegend'); + + this.componentManager.register('bubbleSeries', 'bubbleSeries'); + + this.componentManager.register('yAxis', 'axis'); + this.componentManager.register('xAxis', 'axis'); + + this.componentManager.register('chartExportMenu', 'chartExportMenu'); + this.componentManager.register('tooltip', 'tooltip'); + this.componentManager.register('mouseEventDetector', 'mouseEventDetector'); + }, + /** + * Add data ratios. + * @override + */ + addDataRatios: function(limitMap) { + this.dataProcessor.addDataRatiosForCoordinateType(this.chartType, limitMap, true); + } + }); + + module.exports = BubbleChart; + + +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Scatter chart is a type of plot or mathematical diagram using Cartesian coordinates + * to display values for typically two variables for a set of data. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var chartConst = __webpack_require__(8); + var snippet = __webpack_require__(6); + + var ScatterChart = snippet.defineClass(ChartBase, /** @lends ScatterChart.prototype */ { + /** + * className + * @type {string} + */ + className: 'tui-scatter-chart', + /** + * Scatter chart is a type of plot or mathematical diagram using Cartesian coordinates + * to display values for typically two variables for a set of data. + * @constructs ScatterChart + * @extends ChartBase + * @mixes axisTypeMixer + * @param {Array.} rawData raw data + * @param {object} theme chart theme + * @param {object} options chart options + */ + init: function(rawData, theme, options) { + options.tooltip = options.tooltip || {}; + + if (!options.tooltip.align) { + options.tooltip.align = chartConst.TOOLTIP_DEFAULT_ALIGN_OPTION; + } + + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options, + hasAxes: true + }); + }, + + /** + * Get scale option. + * @returns {{xAxis: {valueType: string}, yAxis: {valueType: string}}} + * @override + */ + getScaleOption: function() { + return { + xAxis: { + valueType: 'x' + }, + yAxis: { + valueType: 'y' + } + }; + }, + /** + * Add components + * @override + */ + addComponents: function() { + this.componentManager.register('title', 'title'); + this.componentManager.register('plot', 'plot'); + this.componentManager.register('legend', 'legend'); + + this.componentManager.register('scatterSeries', 'scatterSeries'); + + this.componentManager.register('yAxis', 'axis'); + this.componentManager.register('xAxis', 'axis'); + + this.componentManager.register('chartExportMenu', 'chartExportMenu'); + this.componentManager.register('tooltip', 'tooltip'); + this.componentManager.register('mouseEventDetector', 'mouseEventDetector'); + }, + /** + * Add data ratios. + * @override + */ + addDataRatios: function(limitMap) { + this.dataProcessor.addDataRatiosForCoordinateType(this.chartType, limitMap, false); + } + }); + + module.exports = ScatterChart; + + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Heatmap chart is a graphical representation of data where the individual values contained + * in a matrix are represented as colors. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var ColorSpectrum = __webpack_require__(137); + var chartConst = __webpack_require__(8); + var snippet = __webpack_require__(6); + + var HeatmapChart = snippet.defineClass(ChartBase, /** @lends HeatmapChart.prototype */ { + /** + * + * className + * @type {string} + */ + className: 'tui-heatmap-chart', + /** + * Heatmap chart is a graphical representation of data where the individual values contained + * in a matrix are represented as colors. + * @constructs HeatmapChart + * @extends ChartBase + * @mixes axisTypeMixer + * @param {Array.} rawData raw data + * @param {object} theme chart theme + * @param {object} options chart options + */ + init: function(rawData, theme, options) { + options.tooltip = options.tooltip || {}; + + if (!options.tooltip.align) { + options.tooltip.align = chartConst.TOOLTIP_DEFAULT_ALIGN_OPTION; + } + + options.tooltip.grouped = false; + + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options, + hasAxes: true, + isVertical: true + }); + }, + + /** + * Add components. + * @private + */ + _addComponents: function() { + var seriesTheme = this.theme.series[this.chartType]; + var colorSpectrum = new ColorSpectrum(seriesTheme.startColor, seriesTheme.endColor); + + this._addComponentsForAxisType({ + axis: [ + { + name: 'yAxis', + isVertical: true + }, + { + name: 'xAxis' + } + ], + legend: { + classType: 'spectrumLegend', + additionalParams: { + colorSpectrum: colorSpectrum + } + }, + series: [ + { + name: 'heatmapSeries', + data: { + colorSpectrum: colorSpectrum + } + } + ], + tooltip: true, + mouseEventDetector: true + }); + }, + + /** + * Get scale option. + * @returns {{legend: boolean}} + * @override + */ + getScaleOption: function() { + return { + legend: true + }; + }, + + /** + * Add data ratios. + * @override + */ + addDataRatios: function(limitMap) { + this.dataProcessor.addDataRatios(limitMap.legend, null, this.chartType); + }, + + /** + * Add components. + * @override + * @private + */ + addComponents: function() { + var seriesTheme = this.theme.series[this.chartType]; + var colorSpectrum = new ColorSpectrum(seriesTheme.startColor, seriesTheme.endColor); + + this.componentManager.register('title', 'title'); + this.componentManager.register('legend', 'spectrumLegend', { + colorSpectrum: colorSpectrum + }); + + this.componentManager.register('heatmapSeries', 'heatmapSeries', { + colorSpectrum: colorSpectrum + }); + + this.componentManager.register('xAxis', 'axis'); + this.componentManager.register('yAxis', 'axis'); + + this.componentManager.register('chartExportMenu', 'chartExportMenu'); + this.componentManager.register('tooltip', 'tooltip'); + this.componentManager.register('mouseEventDetector', 'mouseEventDetector'); + } + }); + + module.exports = HeatmapChart; + + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview ColorSpectrum create a color spectrum and provide color value. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var colorutil = __webpack_require__(138); + var snippet = __webpack_require__(6); + + var ColorSpectrum = snippet.defineClass(/** @lends ColorSpectrum.prototype */ { + /** + * ColorSpectrum create a color spectrum and provide color value. + * @constructs ColorSpectrum + * @private + * @param {string} startColor hex color + * @param {string} endColor hex color + */ + init: function(startColor, endColor) { + var endRGB; + + this.start = colorutil.colorNameToHex(startColor); + this.startRGB = colorutil.hexToRGB(this.start); + this.end = colorutil.colorNameToHex(endColor); + + endRGB = colorutil.hexToRGB(this.end); + this.distances = this._makeDistances(this.startRGB, endRGB); + this.colorMap = {}; + }, + + /** + * Make distances start RGB to end RGB. + * @param {Array.} startRGB start RGB + * @param {Array.} endRGB end RGB + * @returns {Array.} distances + * @private + */ + _makeDistances: function(startRGB, endRGB) { + return snippet.map(startRGB, function(value, index) { + return endRGB[index] - value; + }); + }, + + /** + * Get hex color. + * @param {number} ratio ratio + * @returns {string} hex color + */ + getColor: function(ratio) { + var hexColor = this.colorMap[ratio]; + var distances, rgbColor; + + if (!hexColor) { + distances = this.distances; + rgbColor = snippet.map(this.startRGB, function(start, index) { + return start + parseInt(distances[index] * ratio, 10); + }); + hexColor = colorutil.rgbToHEX.apply(null, rgbColor); + } + + return hexColor || null; + } + }); + + module.exports = ColorSpectrum; + + +/***/ }), +/* 138 */ +/***/ (function(module, exports) { + + /** + * @fileoverview Utility methods to manipulate colors + * @author NHN Ent. FE Development Lab + */ + + 'use strict'; + + var hexRX = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i; + + /** + * Color map. + * http://stackoverflow.com/questions/1573053/javascript-function-to-convert-color-names-to-hex-codes + * http://www.w3schools.com/HTML/html_colornames.asp + * @type {object} + * @ignore + */ + var colorMap = { + 'aliceblue': '#f0f8ff', + 'antiquewhite': '#faebd7', + 'aqua': '#00ffff', + 'aquamarine': '#7fffd4', + 'azure': '#f0ffff', + 'beige': '#f5f5dc', + 'bisque': '#ffe4c4', + 'black': '#000000', + 'blanchedalmond': '#ffebcd', + 'blue': '#0000ff', + 'blueviolet': '#8a2be2', + 'brown': '#a52a2a', + 'burlywood': '#deb887', + 'cadetblue': '#5f9ea0', + 'chartreuse': '#7fff00', + 'chocolate': '#d2691e', + 'coral': '#ff7f50', + 'cornflowerblue': '#6495ed', + 'cornsilk': '#fff8dc', + 'crimson': '#dc143c', + 'cyan': '#00ffff', + 'darkblue': '#00008b', + 'darkcyan': '#008b8b', + 'darkgoldenrod': '#b8860b', + 'darkgray': '#a9a9a9', + 'darkgreen': '#006400', + 'darkkhaki': '#bdb76b', + 'darkmagenta': '#8b008b', + 'darkolivegreen': '#556b2f', + 'darkorange': '#ff8c00', + 'darkorchid': '#9932cc', + 'darkred': '#8b0000', + 'darksalmon': '#e9967a', + 'darkseagreen': '#8fbc8f', + 'darkslateblue': '#483d8b', + 'darkslategray': '#2f4f4f', + 'darkturquoise': '#00ced1', + 'darkviolet': '#9400d3', + 'deeppink': '#ff1493', + 'deepskyblue': '#00bfff', + 'dimgray': '#696969', + 'dodgerblue': '#1e90ff', + 'firebrick': '#b22222', + 'floralwhite': '#fffaf0', + 'forestgreen': '#228b22', + 'fuchsia': '#ff00ff', + 'gainsboro': '#dcdcdc', + 'ghostwhite': '#f8f8ff', + 'gold': '#ffd700', + 'goldenrod': '#daa520', + 'gray': '#808080', + 'green': '#008000', + 'greenyellow': '#adff2f', + 'honeydew': '#f0fff0', + 'hotpink': '#ff69b4', + 'indianred ': '#cd5c5c', + 'indigo': '#4b0082', + 'ivory': '#fffff0', + 'khaki': '#f0e68c', + 'lavender': '#e6e6fa', + 'lavenderblush': '#fff0f5', + 'lawngreen': '#7cfc00', + 'lemonchiffon': '#fffacd', + 'lightblue': '#add8e6', + 'lightcoral': '#f08080', + 'lightcyan': '#e0ffff', + 'lightgoldenrodyellow': '#fafad2', + 'lightgrey': '#d3d3d3', + 'lightgreen': '#90ee90', + 'lightpink': '#ffb6c1', + 'lightsalmon': '#ffa07a', + 'lightseagreen': '#20b2aa', + 'lightskyblue': '#87cefa', + 'lightslategray': '#778899', + 'lightsteelblue': '#b0c4de', + 'lightyellow': '#ffffe0', + 'lime': '#00ff00', + 'limegreen': '#32cd32', + 'linen': '#faf0e6', + 'magenta': '#ff00ff', + 'maroon': '#800000', + 'mediumaquamarine': '#66cdaa', + 'mediumblue': '#0000cd', + 'mediumorchid': '#ba55d3', + 'mediumpurple': '#9370d8', + 'mediumseagreen': '#3cb371', + 'mediumslateblue': '#7b68ee', + 'mediumspringgreen': '#00fa9a', + 'mediumturquoise': '#48d1cc', + 'mediumvioletred': '#c71585', + 'midnightblue': '#191970', + 'mintcream': '#f5fffa', + 'mistyrose': '#ffe4e1', + 'moccasin': '#ffe4b5', + 'navajowhite': '#ffdead', + 'navy': '#000080', + 'oldlace': '#fdf5e6', + 'olive': '#808000', + 'olivedrab': '#6b8e23', + 'orange': '#ffa500', + 'orangered': '#ff4500', + 'orchid': '#da70d6', + 'palegoldenrod': '#eee8aa', + 'palegreen': '#98fb98', + 'paleturquoise': '#afeeee', + 'palevioletred': '#d87093', + 'papayawhip': '#ffefd5', + 'peachpuff': '#ffdab9', + 'peru': '#cd853f', + 'pink': '#ffc0cb', + 'plum': '#dda0dd', + 'powderblue': '#b0e0e6', + 'purple': '#800080', + 'red': '#ff0000', + 'rosybrown': '#bc8f8f', + 'royalblue': '#4169e1', + 'saddlebrown': '#8b4513', + 'salmon': '#fa8072', + 'sandybrown': '#f4a460', + 'seagreen': '#2e8b57', + 'seashell': '#fff5ee', + 'sienna': '#a0522d', + 'silver': '#c0c0c0', + 'skyblue': '#87ceeb', + 'slateblue': '#6a5acd', + 'slategray': '#708090', + 'snow': '#fffafa', + 'springgreen': '#00ff7f', + 'steelblue': '#4682b4', + 'tan': '#d2b48c', + 'teal': '#008080', + 'thistle': '#d8bfd8', + 'tomato': '#ff6347', + 'turquoise': '#40e0d0', + 'violet': '#ee82ee', + 'wheat': '#f5deb3', + 'white': '#ffffff', + 'whitesmoke': '#f5f5f5', + 'yellow': '#ffff00', + 'yellowgreen': '#9acd32' + }; + + var colorutil = { + /** + * pad left zero characters. + * @param {number} number number value to pad zero. + * @param {number} length pad length to want. + * @returns {string} padded string. + */ + leadingZero: function(number, length) { + var zero = '', + i = 0; + + if (String(number).length > length) { + return String(number); + } + + for (; i < (length - 1); i += 1) { + zero += '0'; + } + + return (zero + number).slice(length * -1); + }, + + /** + * Check validate of hex string value is RGB + * @param {string} str - rgb hex string + * @returns {boolean} return true when supplied str is valid RGB hex string + */ + isValidRGB: function(str) { + return hexRX.test(str); + }, + + // @license RGB <-> HSV conversion utilities based off of http://www.cs.rit.edu/~ncs/color/t_convert.html + + /** + * Convert color hex string to rgb number array + * @param {string} hexStr - hex string + * @returns {number[]} rgb numbers + */ + hexToRGB: function(hexStr) { + var r, g, b; + + if (!colorutil.isValidRGB(hexStr)) { + return false; + } + + hexStr = hexStr.substring(1); + + r = parseInt(hexStr.substr(0, 2), 16); + g = parseInt(hexStr.substr(2, 2), 16); + b = parseInt(hexStr.substr(4, 2), 16); + + return [r, g, b]; + }, + + /** + * Convert rgb number to hex string + * @param {number} r - red + * @param {number} g - green + * @param {number} b - blue + * @returns {string|boolean} return false when supplied rgb number is not valid. otherwise, converted hex string + */ + rgbToHEX: function(r, g, b) { + var hexStr = '#' + + colorutil.leadingZero(r.toString(16), 2) + + colorutil.leadingZero(g.toString(16), 2) + + colorutil.leadingZero(b.toString(16), 2); + + if (colorutil.isValidRGB(hexStr)) { + return hexStr; + } + + return false; + }, + + /** + * Color name to hex. + * @param {string} colorName color name + * @returns {string} hex + */ + colorNameToHex: function(colorName) { + return colorMap[colorName.toLowerCase()] || colorName; + } + }; + + module.exports = colorutil; + + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Treemap chart is graphical representation of hierarchical data by using rectangles. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var ColorSpectrum = __webpack_require__(137); + var snippet = __webpack_require__(6); + + var TreemapChart = snippet.defineClass(ChartBase, /** @lends TreemapChart.prototype */ { + /** + * className + * @type {string} + */ + className: 'tui-treemap-chart', + /** + * Treemap chart is graphical representation of hierarchical data by using rectangles. + * @constructs TreemapChart + * @extends ChartBase + * @param {Array.} rawData raw data + * @param {object} theme chart theme + * @param {object} options chart options + */ + init: function(rawData, theme, options) { + // options.series = options.series || {}; + options.tooltip = options.tooltip || {}; + options.tooltip.grouped = false; + + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options, + hasAxes: false, + isVertical: true + }); + }, + + /** + * Add components. + * @override + */ + addComponents: function() { + var seriesTheme = this.theme.series[this.chartType]; + var useColorValue = this.options.series.useColorValue; + var colorSpectrum = useColorValue ? (new ColorSpectrum(seriesTheme.startColor, seriesTheme.endColor)) : null; + this.componentManager.register('title', 'title'); + this.componentManager.register('treemapSeries', 'treemapSeries', { + colorSpectrum: colorSpectrum + }); + + if (useColorValue && this.options.legend.visible) { + this.componentManager.register('legend', 'spectrumLegend', { + colorSpectrum: colorSpectrum + }); + } + + this.componentManager.register('tooltip', 'tooltip', snippet.extend({ + labelTheme: snippet.pick(this.theme, 'series', 'label') + })); + + this.componentManager.register('mouseEventDetector', 'mouseEventDetector'); + this.componentManager.register('chartExportMenu', 'chartExportMenu'); + }, + + /** + * Get scale option. + * @returns {{legend: boolean}} + * @override + */ + getScaleOption: function() { + return { + legend: true + }; + }, + + /** + * Add data ratios to dataProcessor for rendering graph. + * @override + */ + addDataRatios: function(limitMap) { + this.dataProcessor.addDataRatiosForTreemapChart(limitMap.legend, this.chartType); + }, + + /** + * On zoom. + * @param {number} index - index of target seriesItem + */ + onZoom: function(index) { + this.componentManager.render('zoom', null, { + index: index + }); + } + }); + + module.exports = TreemapChart; + + +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Map chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var mapManager = __webpack_require__(35); + var MapChartMapModel = __webpack_require__(141); + var MapChartDataProcessor = __webpack_require__(142); + var ColorSpectrum = __webpack_require__(137); + var snippet = __webpack_require__(6); + + var MapChart = snippet.defineClass(ChartBase, /** @lends MapChart.prototype */ { + /** + * Map chart. + * @constructs MapChart + * @extends ChartBase + * @param {Array.} rawData raw data + * @param {object} theme chart theme + * @param {object} options chart options + */ + init: function(rawData, theme, options) { + /** + * class name + * @type {string} + */ + this.className = 'tui-map-chart'; + + options.map = mapManager.get(options.map); + options.tooltip = options.tooltip || {}; + options.legend = options.legend || {}; + + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options, + DataProcessor: MapChartDataProcessor + }); + }, + + /** + * Add components. + * @override + * @private + */ + addComponents: function() { + var seriesTheme = this.theme.series[this.chartType]; + var mapModel = new MapChartMapModel(this.dataProcessor, this.options.map); + var colorSpectrum = new ColorSpectrum(seriesTheme.startColor, seriesTheme.endColor); + + this.componentManager.register('mapSeries', 'mapSeries', { + mapModel: mapModel, + colorSpectrum: colorSpectrum + }); + + this.componentManager.register('title', 'title'); + + this.componentManager.register('legend', 'spectrumLegend', { + colorSpectrum: colorSpectrum + }); + + this.componentManager.register('tooltip', 'tooltip', { + mapModel: mapModel + }); + + this.componentManager.register('zoom', 'zoom'); + this.componentManager.register('mouseEventDetector', 'mapChartEventDetector'); + }, + + /** + * Get scale option. + * @returns {{legend: boolean}} + * @override + */ + getScaleOption: function() { + return { + legend: true + }; + }, + + /** + * Add data ratios. + * @override + */ + addDataRatios: function(limitMap) { + this.dataProcessor.addDataRatios(limitMap.legend); + } + }); + + module.exports = MapChart; + + +/***/ }), +/* 141 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview MapChartMapModel is map model of map chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var chartConst = __webpack_require__(8); + var arrayUtil = __webpack_require__(10); + var snippet = __webpack_require__(6); + + var MapChartMapModel = snippet.defineClass(/** @lends MapChartMapModel.prototype */ { + /** + * MapChartMapModel is map model of map chart. + * @constructs MapChartMapModel + * @param {MapChartDataProcessor} dataProcessor Map chart data processor + * @param {Array.<{name: string, path: string, labelCoordinate: ?{x: number, y:number}}>} rawMapData raw map data + */ + init: function(dataProcessor, rawMapData) { + /** + * Command function map. + * @type {{ + * M: MapChartMapModel._makeCoordinate, m: MapChartMapModel._makeCoordinateFromRelativeCoordinate, + * L: MapChartMapModel._makeCoordinate, l: MapChartMapModel._makeCoordinateFromRelativeCoordinate, + * H: MapChartMapModel._makeXCoordinate, h: MapChartMapModel._makeXCoordinateFroRelativeCoordinate, + * V: MapChartMapModel._makeYCoordinate, v: MapChartMapModel._makeYCoordinateFromRelativeCoordinate + * }} + */ + this.commandFuncMap = { + M: snippet.bind(this._makeCoordinate, this), + m: snippet.bind(this._makeCoordinateFromRelativeCoordinate, this), + L: snippet.bind(this._makeCoordinate, this), + l: snippet.bind(this._makeCoordinateFromRelativeCoordinate, this), + H: snippet.bind(this._makeXCoordinate, this), + h: snippet.bind(this._makeXCoordinateFroRelativeCoordinate, this), + V: snippet.bind(this._makeYCoordinate, this), + v: snippet.bind(this._makeYCoordinateFromRelativeCoordinate, this) + }; + + /** + * Ignore command map. + * @type {{Z: boolean, z: boolean}} + */ + this.ignoreCommandMap = { + Z: true, + z: true + }; + + /** + * Map dimension + * @type {{width: number, height: number}} + */ + this.mapDimension = null; + + /** + * Map chart data processor. + * @type {MapChartDataProcessor} + */ + this.dataProcessor = dataProcessor; + + /** + * Raw map data. + * @type {Array.<{name: string, path: string, labelCoordinate: ?{x: number, y: number}}>} + */ + this.rawMapData = rawMapData; + + /** + * Map data. + * @type {null|Array.} + */ + this.mapData = null; + }, + + /** + * Split coordinate string. + * @param {string} coordinateStr coordinate string + * @returns {{x: number, y: number}} coordinate map + * @private + */ + _splitCoordinate: function(coordinateStr) { + var coordinates = coordinateStr.split(','), + result = { + x: parseFloat(coordinates[0]) + }; + + if (coordinates[1]) { + result.y = parseFloat(coordinates[1]); + } + + return result; + }, + + /** + * Make coordinate + * @param {string} coordinateStr coordinate + * @returns {{x: number, y: number}} coordinate + * @private + */ + _makeCoordinate: function(coordinateStr) { + return this._splitCoordinate(coordinateStr); + }, + + /** + * Make coordinate from relative coordinate. + * @param {string} coordinateStr coordinate + * @param {{x: number, y: number}} prevCoordinate previous coordinate + * @returns {{x: number, y: number}} coordinate + * @private + */ + _makeCoordinateFromRelativeCoordinate: function(coordinateStr, prevCoordinate) { + var coordinate = this._splitCoordinate(coordinateStr); + + return { + x: coordinate.x + prevCoordinate.x, + y: coordinate.y + prevCoordinate.y + }; + }, + + /** + * Make x coordinate. + * @param {string} coordinateStr coordinate + * @returns {{x: number}} x coordinate + * @private + */ + _makeXCoordinate: function(coordinateStr) { + var coordinate = this._splitCoordinate(coordinateStr); + + return { + x: coordinate.x + }; + }, + + /** + * Make x coordinate from relative coordinate. + * @param {string} coordinateStr coordinate + * @param {{x: number, y: number}} prevCoordinate previous coordinate + * @returns {{x: number}} x coordinate + * @private + */ + _makeXCoordinateFroRelativeCoordinate: function(coordinateStr, prevCoordinate) { + var coordinate = this._splitCoordinate(coordinateStr); + + return { + x: coordinate.x + prevCoordinate.x + }; + }, + + /** + * Make y coordinate. + * @param {string} coordinateStr coordinate + * @returns {{y: number}} y coordinate + * @private + */ + _makeYCoordinate: function(coordinateStr) { + var coordinate = this._splitCoordinate(coordinateStr); + + return { + y: coordinate.x + }; + }, + + /** + * Make y coordinate from relative coordinate. + * @param {string} coordinateStr coordinate + * @param {{x: number, y: number}} prevCoordinate previous coordinate + * @returns {{y: number}} y coordinate + * @private + */ + _makeYCoordinateFromRelativeCoordinate: function(coordinateStr, prevCoordinate) { + var coordinate = this._splitCoordinate(coordinateStr); + + return { + y: coordinate.x + prevCoordinate.y + }; + }, + + /** + * Split path. + * @param {string} path path + * @returns {Array.<{type: string, coordinate: string}>} splitted path data + * @private + */ + _splitPath: function(path) { + var i = 0, + len = path.length, + pathData = [], + coordinate = '', + chr, commandType; + + for (; i < len; i += 1) { + chr = path.charAt(i); + if (this.commandFuncMap[chr]) { + if (commandType && coordinate) { + pathData.push({ + type: commandType, + coordinate: coordinate + }); + } + commandType = chr; + coordinate = ''; + } else if (!this.ignoreCommandMap[chr]) { + coordinate += chr; + } + } + + if (commandType && coordinate) { + pathData.push({ + type: commandType, + coordinate: coordinate + }); + } + + return pathData; + }, + + /** + * Make coordinates from path. + * @param {string} path path + * @returns {Array.<{x: number, y: number}>} coordinates + * @private + */ + _makeCoordinatesFromPath: function(path) { + var self = this, + pathData = this._splitPath(path), + prevCoordinate = { + x: 0, + y: 0 + }; + + return snippet.map(pathData, function(datum) { + var commandFunc = self.commandFuncMap[datum.type], + coordinate = commandFunc(datum.coordinate, prevCoordinate); + + snippet.extend(prevCoordinate, coordinate); + + return coordinate; + }); + }, + + /** + * Find bound from coordinates. + * @param {Array.<{left: number, top: number}>} coordinates coordinates + * @returns {{dimension: {width: number, height: number}, position: {top: number, left: number}}} bound + * @private + */ + _findBoundFromCoordinates: function(coordinates) { + var xs = snippet.filter(snippet.pluck(coordinates, 'x'), function(x) { + return !snippet.isUndefined(x); + }), + ys = snippet.filter(snippet.pluck(coordinates, 'y'), function(y) { + return !snippet.isUndefined(y); + }), + maxLeft = arrayUtil.max(xs), + minLeft = arrayUtil.min(xs), + maxTop = arrayUtil.max(ys), + minTop = arrayUtil.min(ys); + + return { + dimension: { + width: maxLeft - minLeft, + height: maxTop - minTop + }, + position: { + left: minLeft, + top: minTop + } + }; + }, + + /** + * Make label position. + * @param {{dimension: {width: number, height: number}, position: {top: number, left: number}}} bound bound + * @param {?{left: number, top: number}} positionRatio position ratio + * @returns {{left: number, top: number}} label position + * @private + */ + _makeLabelPosition: function(bound, positionRatio) { + positionRatio = positionRatio || chartConst.MAP_CHART_LABEL_DEFAULT_POSITION_RATIO; + + return { + left: bound.position.left + (bound.dimension.width * positionRatio.x), + top: bound.position.top + (bound.dimension.height * positionRatio.y) + }; + }, + + /** + * Create map data. + * @param {Array.<{name: string, path: string, labelCoordinate: ?{x: number, y:number}}>} rawMapData raw map data + * @returns {Array.} + * @private + */ + _createMapData: function(rawMapData) { + var self = this; + + return snippet.map(rawMapData, function(datum) { + var coordinate = self._makeCoordinatesFromPath(datum.path), + bound = self._findBoundFromCoordinates(coordinate), + userData = self.dataProcessor.getValueMapDatum(datum.code), + name, labelCoordinate, label, ratio, resultData; + + if (userData) { + label = userData.label; + ratio = userData.ratio; + name = userData.name || datum.name; + labelCoordinate = userData.labelCoordinate || datum.labelCoordinate; + } + + resultData = { + code: datum.code, + name: name, + path: datum.path, + bound: bound, + labelPosition: self._makeLabelPosition(bound, labelCoordinate) + }; + + if (label) { + resultData.label = label; + } + + if (ratio >= 0) { + resultData.ratio = ratio; + } + + return resultData; + }); + }, + + /** + * Get map data. + * @returns {Array.} + */ + getMapData: function() { + if (!this.mapData) { + this.mapData = this._createMapData(this.rawMapData); + } + + return this.mapData; + }, + + /** + * Get map datum. + * @param {number} index - index + * @returns {object} + */ + getDatum: function(index) { + return this.getMapData()[index]; + }, + + /** + * Get label data. + * @param {number} ratio ratio + * @returns {Array.<{name: string, bound: {dimension: {width: number, height: number}, + * position: {top: number, left: number}}, labelPosition: {width: number, height: number}}>} map data + */ + getLabelData: function(ratio) { + var self = this; + var mapData = this.getMapData(); + var labelData = snippet.filter(mapData, function(datum) { + return self.dataProcessor.getValueMapDatum(datum.code); + }); + + return snippet.map(labelData, function(datum) { + return { + name: datum.name, + labelPosition: { + left: datum.labelPosition.left * ratio, + top: datum.labelPosition.top * ratio + } + }; + }); + }, + + /** + * Make map dimension + * @returns {{width: number, height: number}} map dimension + * @private + */ + _makeMapDimension: function() { + var mapData = this.getMapData(); + var lefts = snippet.map(mapData, function(datum) { + return datum.bound.position.left; + }); + var rights = snippet.map(mapData, function(datum) { + return datum.bound.position.left + datum.bound.dimension.width; + }); + var tops = snippet.map(mapData, function(datum) { + return datum.bound.position.top; + }); + var bottoms = snippet.map(mapData, function(datum) { + return datum.bound.position.top + datum.bound.dimension.height; + }); + + return { + width: arrayUtil.max(rights) - arrayUtil.min(lefts), + height: arrayUtil.max(bottoms) - arrayUtil.min(tops) + }; + }, + + /** + * Get map dimension. + * @returns {{width: number, height: number}} map dimension + */ + getMapDimension: function() { + if (!this.mapDimension) { + this.mapDimension = this._makeMapDimension(); + } + + return this.mapDimension; + } + }); + + module.exports = MapChartMapModel; + + +/***/ }), +/* 142 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Data processor for map chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var DataProcessorBase = __webpack_require__(102); + var renderUtil = __webpack_require__(7); + var snippet = __webpack_require__(6); + + /** + * Raw series data. + * @typedef {Array.<{code: string, name: ?string, data: number}>} rawSeriesData + * @private + */ + + /** + * Value map. + * @typedef {{value: number, label: string, name: ?string}} valueMap + * @private + */ + + var MapChartDataProcessor = snippet.defineClass(DataProcessorBase, /** @lends MapChartDataProcessor.prototype */{ + /** + * Data processor for map chart. + * @param {rawData} rawData raw data + * @param {string} chartType chart type + * @param {object} options options + * @constructs MapChartDataProcessor + * @private + * @extends DataProcessor + */ + init: function(rawData, chartType, options) { + /** + * raw data + * @type {rawData} + */ + this.rawData = rawData; + + /** + * chart options + * @type {Object} + */ + this.options = options; + }, + + /** + * Update raw data. + * @param {{series: rawSeriesData}} rawData raw data + */ + initData: function(rawData) { + this.rawData = rawData; + + /** + * value map + * @type {valueMap} + */ + this.valueMap = null; + }, + + /** + * Make value map. + * @returns {valueMap} value map + * @private + */ + _makeValueMap: function() { + var rawSeriesData = this.rawData.series.map; + var valueMap = {}; + var formatFunctions = this._findFormatFunctions(); + + snippet.forEachArray(rawSeriesData, function(datum) { + var result = { + value: datum.data, + label: renderUtil.formatValue({ + value: datum.data, + formatFunctions: formatFunctions, + chartType: 'map', + areaType: 'series' + }) + }; + + if (datum.name) { + result.name = datum.name; + } + + if (datum.labelCoordinate) { + result.labelCoordinate = datum.labelCoordinate; + } + + valueMap[datum.code] = result; + }); + + return valueMap; + }, + + /** + * Get value map. + * @returns {number} value + */ + getValueMap: function() { + if (!this.valueMap) { + this.valueMap = this._makeValueMap(); + } + + return this.valueMap; + }, + + /** + * Get values. + * @returns {Array.} picked values. + */ + getValues: function() { + return snippet.pluck(this.getValueMap(), 'value'); + }, + + /** + * Get valueMap datum. + * @param {string} code map code + * @returns {{code: string, name: string, label: number, + * labelCoordinate: {x: number, y: number}}} valueMap datum + */ + getValueMapDatum: function(code) { + return this.getValueMap()[code]; + }, + + /** + * Add data ratios of map chart. + * @param {{min: number, max: number}} limit axis limit + */ + addDataRatios: function(limit) { + var min = limit.min, + max = limit.max - min; + snippet.forEach(this.getValueMap(), function(map) { + map.ratio = (map.value - min) / max; + }); + }, + + createBaseValuesForLimit: function() { + return this.getValues(); + }, + getLegendVisibility: function() { + return null; + } + }); + + module.exports = MapChartDataProcessor; + + +/***/ }), +/* 143 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Radial chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var snippet = __webpack_require__(6); + var Series = __webpack_require__(85); + + var RadialChart = snippet.defineClass(ChartBase, /** @lends RadialChart.prototype */ { + /** + * className + * @type {string} + */ + className: 'tui-radial-chart', + + /** + * Series class + * @type {function} + */ + Series: Series, + + /** + * Radial chart. + * @constructs RadialChart + * @extends ChartBase + * @param {Array.} rawData raw data + * @param {object} theme chart theme + * @param {object} options chart options + */ + init: function(rawData, theme, options) { + // radial chart doesn't supprot group tooltip + // should delete this code, when it supports group tooltip + if (options.tooltip) { + options.tooltip.grouped = false; + } + + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options, + hasAxes: true, + isVertical: true + }); + }, + /** + * Add components + * @override + */ + addComponents: function() { + this.componentManager.register('title', 'title'); + this.componentManager.register('legend', 'legend'); + this.componentManager.register('plot', 'radialPlot'); + + this.componentManager.register('radialSeries', 'radialSeries'); + + this.componentManager.register('chartExportMenu', 'chartExportMenu'); + this.componentManager.register('tooltip', 'tooltip'); + this.componentManager.register('mouseEventDetector', 'mouseEventDetector'); + }, + /** + * Add data ratios. + * @override + */ + addDataRatios: function(limitMap) { + this.dataProcessor.addDataRatios(limitMap[this.chartType], null, this.chartType); + }, + + /** + * Get scale option. + * @returns {{xAxis: ?{valueType:string}, yAxis: ?(boolean|{valueType:string})}} + * @override + */ + getScaleOption: function() { + return { + yAxis: {} + }; + } + }); + + module.exports = RadialChart; + + +/***/ }), +/* 144 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Boxplot chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var rawDataHandler = __webpack_require__(31); + var snippet = __webpack_require__(6); + + var BoxplotChart = snippet.defineClass(ChartBase, /** @lends BoxplotChart.prototype */ { + /** + * className + * @type {string} + */ + className: 'tui-boxplot-chart', + + /** + * Boxplot chart. + * @constructs BoxplotChart + * @extends ChartBase + * @mixes axisTypeMixer + * @param {Array.} rawData raw data + * @param {object} theme chart theme + * @param {object} options chart options + */ + init: function(rawData, theme, options) { + rawDataHandler.appendOutliersToSeriesData(rawData); + + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options, + hasAxes: true, + isVertical: true + }); + }, + + /** + * Add components + * @override + */ + addComponents: function() { + this.componentManager.register('title', 'title'); + this.componentManager.register('plot', 'plot'); + this.componentManager.register('legend', 'legend'); + + this.componentManager.register('boxplotSeries', 'boxplotSeries'); + + this.componentManager.register('yAxis', 'axis'); + this.componentManager.register('xAxis', 'axis'); + + this.componentManager.register('chartExportMenu', 'chartExportMenu'); + this.componentManager.register('tooltip', 'tooltip'); + this.componentManager.register('mouseEventDetector', 'mouseEventDetector'); + }, + + /** + * Get scale option. + * @returns {{xAxis: boolean}} + * @override + */ + getScaleOption: function() { + return { + yAxis: true + }; + }, + + /** + * On change selected legend. + * @param {Array. | {line: ?Array., column: ?Array.}} checkedLegends checked legends + */ + onChangeCheckedLegends: function(checkedLegends) { + var boundParams; + + if (this.hasRightYAxis) { + boundParams = { + optionChartTypes: ['boxplot', 'boxplot'] + }; + } + ChartBase.prototype.onChangeCheckedLegends.call(this, checkedLegends, null, boundParams); + }, + + /** + * Add data ratios. + * @override + * modified from axisTypeMixer + */ + addDataRatios: function(limitMap) { + var seriesOption = this.options.series || {}; + var chartType = this.chartType; + var stackType = (seriesOption[chartType] || seriesOption).stackType; + + this.dataProcessor.addDataRatios(limitMap[chartType], stackType, chartType); + } + }); + + module.exports = BoxplotChart; + + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + + /** + * @fileoverview Bullet chart. + * @author NHN Ent. + * FE Development Lab + */ + + 'use strict'; + + var ChartBase = __webpack_require__(42); + var rawDataHandler = __webpack_require__(31); + var snippet = __webpack_require__(6); + + var BulletChart = snippet.defineClass(ChartBase, /** @lends BulletChart.prototype */ { + /** + * className + * @type {string} + */ + className: 'tui-bullet-chart', + + /** + * Bullet chart. + * @constructs BulletChart + * @extends ChartBase + * @mixes axisTypeMixer + * @param {Array.} rawData raw data + * @param {object} theme chart theme + * @param {object} options chart options + */ + init: function(rawData, theme, options) { + var isVertical = !!options.series.vertical; + + rawDataHandler._makeRawSeriesDataForBulletChart(rawData); + + ChartBase.call(this, { + rawData: rawData, + theme: theme, + options: options, + hasAxes: true, + isVertical: isVertical + }); + }, + + /** + * Add components + * @override + */ + addComponents: function() { + this.componentManager.register('title', 'title'); + this.componentManager.register('plot', 'plot'); + this.componentManager.register('legend', 'legend'); + + this.componentManager.register('bulletSeries', 'bulletSeries'); + + this.componentManager.register('yAxis', 'axis'); + this.componentManager.register('xAxis', 'axis'); + + this.componentManager.register('chartExportMenu', 'chartExportMenu', {chartType: 'bullet'}); + this.componentManager.register('tooltip', 'tooltip'); + this.componentManager.register('mouseEventDetector', 'mouseEventDetector'); + }, + + /** + * Get scale option. + * @returns {{xAxis: boolean}} + * @override + */ + getScaleOption: function() { + if (this.isVertical) { + return { + yAxis: true + }; + } + + return { + xAxis: true + }; + }, + + /** + * Add data ratios. + * @override + * modified from axisTypeMixer + */ + addDataRatios: function(limitMap) { + var chartType = this.chartType; + + this.dataProcessor.addDataRatios(limitMap[chartType], null, chartType); + } + }); + + module.exports = BulletChart; + + +/***/ }), +/* 146 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var chartConst = __webpack_require__(8); + var themeManager = __webpack_require__(33); + var defaultTheme = __webpack_require__(34); + + themeManager.register(chartConst.DEFAULT_THEME_NAME, defaultTheme); + + +/***/ }), +/* 147 */ +/***/ (function(module, exports) { + + // removed by extract-text-webpack-plugin + +/***/ }) +/******/ ]) +}); +; \ No newline at end of file diff --git a/dist/tui-chart.min.css b/dist/tui-chart.min.css new file mode 100644 index 000000000..7f1bb05f1 --- /dev/null +++ b/dist/tui-chart.min.css @@ -0,0 +1,10 @@ +/*! + * tui-chart.min + * @fileoverview tui-chart + * @author NHN Ent. FE Development Lab + * @version 2.17.0 + * @license MIT + * @link https://github.com/nhnent/tui.chart + * bundle created at "Tue Mar 13 2018 14:13:16 GMT+0900 (KST)" + */ +.tui-chart{position:relative;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.tui-chart,.tui-chart *{box-sizing:border-box;line-height:1}.tui-chart .tui-chart-title{position:absolute;top:0;left:0;width:100%;text-align:center;padding:10px 0;z-index:350}.tui-chart .tui-chart-axis-area{z-index:300;position:absolute}.tui-chart .tui-chart-axis-area *{user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.tui-chart .tui-chart-axis-area .tui-chart-title-area{position:absolute}.tui-chart .tui-chart-axis-area .tui-chart-label-area,.tui-chart .tui-chart-axis-area .tui-chart-tick-area{position:absolute;top:0;width:100%;height:100%}.tui-chart .tui-chart-axis-area .tui-chart-tick-area .tui-chart-tick{position:absolute;background-color:#000}.tui-chart .tui-chart-axis-area .tui-chart-label-area .tui-chart-label{position:absolute}.tui-chart .tui-chart-axis-area .tui-chart-label-area .tui-chart-label>span{line-height:1.2}.tui-chart .tui-chart-axis-area.vertical{top:10px}.tui-chart .tui-chart-axis-area.vertical .tui-chart-title-area{text-align:center;white-space:nowrap;top:0}.tui-chart .tui-chart-axis-area.vertical .tui-chart-title-area.rotation{transform-origin:top left;transform:rotate(-90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3)}.tui-chart .tui-chart-axis-area.vertical .tui-chart-tick-area{right:0}.tui-chart .tui-chart-axis-area.vertical .tui-chart-tick-area .tui-chart-tick{right:1px;width:5px;height:1px}.tui-chart .tui-chart-axis-area.vertical .tui-chart-tick-area .tui-chart-tick-line{left:auto;right:0;width:1px;background-color:#000;position:absolute}.tui-chart .tui-chart-axis-area.vertical .tui-chart-label-area{right:10px}.tui-chart .tui-chart-axis-area.vertical .tui-chart-label-area .tui-chart-label{left:0;width:100%;text-align:right;white-space:nowrap}.tui-chart .tui-chart-axis-area.vertical.right .tui-chart-title-area{text-align:center;white-space:nowrap;top:0}.tui-chart .tui-chart-axis-area.vertical.right .tui-chart-title-area.rotation{transform-origin:top left;transform:rotate(90deg);filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1)}.tui-chart .tui-chart-axis-area.vertical.right .tui-chart-label-area,.tui-chart .tui-chart-axis-area.vertical.right .tui-chart-tick-area{left:0}.tui-chart .tui-chart-axis-area.vertical.right .tui-chart-label-area .tui-chart-label{text-align:left;padding-right:0;padding-left:10px}.tui-chart .tui-chart-axis-area.vertical.center .tui-chart-title-area{width:100%!important;transform:rotate(0deg);filter:none;top:auto}.tui-chart .tui-chart-axis-area.vertical.center .tui-chart-label-area{left:0;width:100%!important}.tui-chart .tui-chart-axis-area.vertical.center .tui-chart-label-area .tui-chart-label{text-align:center}.tui-chart .tui-chart-axis-area.vertical.center .tui-chart-tick-area.opposite-side,.tui-chart .tui-chart-axis-area.vertical.right .tui-chart-tick-area{border-right:none}.tui-chart .tui-chart-axis-area.vertical.center .tui-chart-tick-area.opposite-side .tui-chart-tick,.tui-chart .tui-chart-axis-area.vertical.right .tui-chart-tick-area .tui-chart-tick{left:1px}.tui-chart .tui-chart-axis-area.vertical.center .tui-chart-tick-area.opposite-side .tui-chart-tick-line,.tui-chart .tui-chart-axis-area.vertical.right .tui-chart-tick-area .tui-chart-tick-line{right:auto;left:0}.tui-chart .tui-chart-axis-area.horizontal{right:10px}.tui-chart .tui-chart-axis-area.horizontal .tui-chart-title-area{bottom:0;width:100%;text-align:center}.tui-chart .tui-chart-axis-area.horizontal.division .tui-chart-title-area{left:0;width:auto}.tui-chart .tui-chart-axis-area.horizontal.division .tui-chart-title-area.right{left:auto;right:0}.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area,.tui-chart .tui-chart-axis-area.horizontal .tui-chart-tick-area{left:0}.tui-chart .tui-chart-axis-area.horizontal .tui-chart-tick-area .tui-chart-tick-line{top:0;height:1px;background-color:#000;position:absolute}.tui-chart .tui-chart-axis-area.horizontal .tui-chart-tick-area .tui-chart-ticks{width:100%;position:absolute;left:0;top:0}.tui-chart .tui-chart-axis-area.horizontal .tui-chart-tick-area .tui-chart-tick{top:0;width:1px;height:6px}.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label{top:10px;text-align:center;word-wrap:break-word;word-break:keep-all}.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation{text-align:right;white-space:nowrap}.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation span{position:absolute;right:0;top:0}.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation25{transform:rotate(-25deg)}.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation25 span{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.9063077870366499, M12=0.42261826174069944, M21=-0.42261826174069944, M22=0.9063077870366499)"}.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation45{transform:rotate(-45deg)}.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation45 span{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=0.7071067811865475, M21=-0.7071067811865475, M22=0.7071067811865476)"}.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation65{transform:rotate(-65deg)}.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation65 span{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.42261826174069944, M12=0.9063077870366499, M21=-0.9063077870366499, M22=0.42261826174069944)"}.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation85{transform:rotate(-85deg)}.tui-chart .tui-chart-axis-area.horizontal .tui-chart-label-area .tui-chart-label.tui-chart-xaxis-rotation85 span{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.08715574274765814, M12=0.9961946980917455, M21=-0.9961946980917455, M22=0.08715574274765814)"}.tui-chart .tui-chart-plot-area{position:absolute;right:10px;top:10px;z-index:-100}.tui-chart .tui-chart-plot-area .tui-chart-plot-optional-lines-area{left:0;top:0;width:100%;height:100%;position:absolute}.tui-chart .tui-chart-plot-area .tui-chart-plot-lines-area{width:100%;height:100%;position:relative}.tui-chart .tui-chart-plot-area .tui-chart-plot-line{background-color:#ccc;position:absolute}.tui-chart .tui-chart-plot-area .tui-chart-plot-line.vertical{top:0;width:1px}.tui-chart .tui-chart-plot-area .tui-chart-plot-line.horizontal{left:0;height:1px}.tui-chart .tui-chart-series-area{z-index:200;position:absolute;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.tui-chart .tui-chart-series-area:first-child{overflow:visible}.tui-chart .tui-chart-series-area .tui-chart-series-block-area{position:absolute;left:10px;top:10px}.tui-chart .tui-chart-series-area .tui-chart-series-block-area .tui-chart-series-block{position:absolute}.tui-chart .tui-chart-series-area .tui-chart-series-label-area{position:absolute;overflow:visible;left:0;top:0;display:none;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);opacity:0}.tui-chart .tui-chart-series-area .tui-chart-series-label-area .tui-chart-series-label{position:absolute;cursor:default;text-align:center;white-space:nowrap;text-shadow:#fff 0 0 3px}.tui-chart .tui-chart-series-area .tui-chart-series-label-area.show{display:block}.tui-chart .tui-chart-series-area .tui-chart-series-label-area.opacity{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter:alpha(opacity=100);opacity:1}.tui-chart .tui-chart-series-area .tui-chart-series-graph-area{position:absolute;left:0;top:0}.tui-chart .tui-chart-zoom-area{z-index:1500;position:absolute;border:1px solid #ccc;background-color:#ccc;border-radius:4px;background-clip:padding-box}.tui-chart .tui-chart-zoom-area>.tui-chart-zoom-btn{width:21px;height:21px;display:block;background-color:#fff;cursor:pointer;position:relative}.tui-chart .tui-chart-zoom-area>.tui-chart-zoom-btn:first-child{margin-bottom:1px;border-radius:4px 4px 0 0;background-clip:padding-box}.tui-chart .tui-chart-zoom-area>.tui-chart-zoom-btn:last-child{border-radius:0 0 4px 4px;background-clip:padding-box}.tui-chart .tui-chart-zoom-area>.tui-chart-zoom-btn:hover{background-color:#efefef}.tui-chart .tui-chart-zoom-area>.tui-chart-zoom-btn>div{font-szie:0;background-color:#555;position:absolute}.tui-chart .tui-chart-zoom-area>.tui-chart-zoom-btn>div.horizontal-line{width:9px;height:1px;left:6px;top:10px}.tui-chart .tui-chart-zoom-area>.tui-chart-zoom-btn>div.vertical-line{width:1px;height:9px;left:10px;top:6px}.tui-chart .tui-chart-series-custom-event-area{z-index:1000;position:absolute;left:0;top:0}.tui-chart .tui-chart-series-custom-event-area.hide{display:none}.tui-chart .tui-chart-series-custom-event-area.drag{cursor:move}.tui-chart .tui-chart-series-custom-event-area .tui-chart-drag-selection{top:10px;height:100%;background-color:gray;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";filter:alpha(opacity=30);opacity:.3;position:absolute;display:none}.tui-chart .tui-chart-series-custom-event-area .tui-chart-drag-selection.show{display:block}.tui-chart .tui-chart-series-custom-event-area .tui-chart-reset-zoom-btn{position:absolute;left:20px;top:20px;font-size:11px;padding:5px;border:1px solid #ccc;background-color:#efefef;cursor:pointer;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.tui-chart .tui-chart-legend-rect{margin-top:2px;width:12px;height:12px}.tui-chart .tui-chart-legend-rect.line{height:2px}.tui-chart .tui-chart-legend-rect.area,.tui-chart .tui-chart-legend-rect.bubble{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";filter:alpha(opacity=50);opacity:.5}.tui-chart .tui-chart-chartExportMenu-area{z-index:900;position:absolute;font-family:Verdana;margin:0;padding:10px 0 0;z-index:5000}.tui-chart .tui-chart-chartExportMenu-area .tui-chart-chartExportMenu-button{position:absolute;width:26px;height:20px;right:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAPCAYAAADkmO9VAAAAKklEQVQ4EWMsKCj4z0BFwERFs8BGUd1AajtwCJjHOBrLQyCWKHXiCIxlAM/yBv2WsAlAAAAAAElFTkSuQmCC) 0 0 no-repeat;border:0;font-size:12px;padding:3px 5px;margin:0;cursor:pointer}.tui-chart .tui-chart-chartExportMenu-area ul{display:none;position:absolute;top:30px;right:0;width:120px;background:#fff;border:.5px solid #000;font-size:.8em;padding:0;margin:0;box-shadow:3px 3px 5px #888}.tui-chart .tui-chart-chartExportMenu-area ul>li{margin:0;padding:7px 3px;border-collapse:collapse;text-align:center;list-style-type:none;line-height:1;cursor:pointer}.tui-chart .tui-chart-chartExportMenu-area ul>li:hover{background-color:#91ade5}.tui-chart .tui-chart-legend-area{z-index:400;position:absolute;padding:10px;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.tui-chart .tui-chart-legend-area .tui-chart-legend{clear:both}.tui-chart .tui-chart-legend-area .tui-chart-legend>div{float:left}.tui-chart .tui-chart-legend-area .tui-chart-legend .tui-chart-legend-checkbox-area{width:20px;height:20px;position:relative;box-sizing:border-box}.tui-chart .tui-chart-legend-area .tui-chart-legend .tui-chart-legend-checkbox-area input{left:2px;top:2px;*left:-2px;*top:-2px;position:absolute;padding:0;margin:0}.tui-chart .tui-chart-legend-area .tui-chart-legend .tui-chart-legend-label{padding:2px 0 2px 4px;cursor:pointer;box-sizing:content-box;line-height:1}.tui-chart .tui-chart-legend-area .tui-chart-legend.unselected .tui-chart-legend-label,.tui-chart .tui-chart-legend-area .tui-chart-legend.unselected .tui-chart-legend-rect{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";filter:alpha(opacity=30);opacity:.3}.tui-chart .tui-chart-legend-area .tui-chart-legend-tick-area{position:absolute;left:10px;top:10px}.tui-chart .tui-chart-legend-area .tui-chart-legend-tick-area .tui-chart-map-legend-tick{width:15px;height:1px;background-color:#ccc;position:absolute;left:0}.tui-chart .tui-chart-legend-area .tui-chart-legend-tick-area .tui-chart-map-legend-tick-label{position:absolute;left:30px;text-align:left}.tui-chart .tui-chart-legend-area .tui-chart-legend-tick-area.horizontal .tui-chart-map-legend-tick{top:0;width:1px;height:15px}.tui-chart .tui-chart-legend-area .tui-chart-legend-tick-area.horizontal .tui-chart-map-legend-tick-label{top:30px}.tui-chart .tui-chart-legend-area .tui-chart-map-legend-wedge{position:absolute;width:19px;height:4px;border-left:2px solid #777;border-right:2px solid #777;left:8px;top:30px;display:none}.tui-chart .tui-chart-legend-area .tui-chart-map-legend-wedge.show{display:block}.tui-chart .tui-chart-legend-area.horizontal{padding-left:0;padding-right:0}.tui-chart .tui-chart-legend-area.horizontal .tui-chart-legend{clear:none;float:left;white-space:nowrap}.tui-chart .tui-chart-circle-legend-area{position:absolute;z-index:400}.tui-chart .tui-chart-circle-legend-area .tui-chart-circle-legend-label-area{position:absolute;left:0;top:0}.tui-chart .tui-chart-circle-legend-area .tui-chart-circle-legend-label-area .tui-chart-circle-legend-label{position:absolute;font-size:9px;white-space:nowrap;text-shadow:#fff 0 0 3px}.tui-chart .tui-chart-tooltip-area{position:absolute;z-index:500}.tui-chart .tui-chart-tooltip-area *{user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip{z-index:100;position:absolute;display:none;user-select:none}.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip.show{display:block}.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip{padding:4px 0;font-size:12px;min-width:100px;color:#fff;border-radius:5px;background-clip:padding-box;background-color:rgba(0,0,0,.7);background-color:#555\9}.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip>*{padding:2px 7px;text-align:center;white-space:nowrap}.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip>:first-child{backgound-color:#fff;font-weight:700}.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip.tui-chart-group-tooltip>*{text-align:left;position:relative;padding-left:20px;padding-top:4px;padding-bottom:4px}.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip.tui-chart-group-tooltip .tui-chart-legend-rect{position:absolute;left:7px;top:2px}.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip.tui-chart-group-tooltip .tui-chart-legend-rect.line{top:7px}.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip.tui-chart-group-tooltip>:first-child{padding-left:7px;padding-top:6px;padding-bottom:6px;text-align:center}.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip.tui-chart-group-tooltip>.tui-chart-tooltip-type{padding-left:7px}.tui-chart .tui-chart-tooltip-area .tui-chart-tooltip .tui-chart-default-tooltip .hide{display:none}.tui-chart .tui-chart-tooltip-area .tui-chart-group-tooltip-sector{z-index:50;position:absolute;background-color:#aaa;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";filter:alpha(opacity=30);opacity:.3;display:none}.tui-chart .tui-chart-tooltip-area .tui-chart-group-tooltip-sector.show{display:block}.tui-chart.tui-map-chart .tui-chart-series-area{overflow:hidden}.tui-chart.tui-map-chart .tui-chart-tooltip-area .tui-chart-default-tooltip>:first-child{font-weight:400}.tui-chart-size-check-element{clear:both;position:absolute;word-wrap:break-word;word-break:keep-all;top:100000px;left:100000px;width:1000px;height:100px;padding:0;line-height:1}.tui-chart-size-check-element>span{display:inline-block;box-sizing:border-box;text-align:center;padding:0}:root .tui-chart .tui-chart-axis-area.horizontal .tui-chart-label.tui-chart-xaxis-rotation25 span,:root .tui-chart .tui-chart-axis-area.horizontal .tui-chart-label.tui-chart-xaxis-rotation45 span,:root .tui-chart .tui-chart-axis-area.horizontal .tui-chart-label.tui-chart-xaxis-rotation65 span,:root .tui-chart .tui-chart-axis-area.horizontal .tui-chart-label.tui-chart-xaxis-rotation85 span,:root .tui-chart .tui-chart-axis-area.vertical .tui-chart-title-area{filter:none \0} \ No newline at end of file diff --git a/dist/tui-chart.min.js b/dist/tui-chart.min.js new file mode 100644 index 000000000..fc99e5597 --- /dev/null +++ b/dist/tui-chart.min.js @@ -0,0 +1,21 @@ +/*! + * tui-chart.min + * @fileoverview tui-chart + * @author NHN Ent. FE Development Lab + * @version 2.17.0 + * @license MIT + * @link https://github.com/nhnent/tui.chart + * bundle created at "Tue Mar 13 2018 14:13:16 GMT+0900 (KST)" + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("raphael"),require("tui-code-snippet")):"function"==typeof define&&define.amd?define(["raphael","tui-code-snippet"],e):"object"==typeof exports?exports.chart=e(require("raphael"),require("tui-code-snippet")):(t.tui=t.tui||{},t.tui.chart=e(t.Raphael,t.tui&&t.tui.util))}(this,function(__WEBPACK_EXTERNAL_MODULE_3__,__WEBPACK_EXTERNAL_MODULE_6__){return function(t){function e(n){if(i[n])return i[n].exports;var o=i[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var i={};return e.m=t,e.c=i,e.p="/dist/",e(0)}([function(t,e,i){"use strict";var n=i(2),o=i(29);i(147),o.registerPlugin(n.name,n.plugins,n.callback),o.renderUtil=i(7),o.arrayUtil=i(10),o.colorutil=i(138),t.exports=o},,function(t,e,i){"use strict";function n(t){var e=document.createElementNS("http://www.w3.org/2000/svg","filter"),i=document.createElementNS("http://www.w3.org/2000/svg","feGaussianBlur"),n=document.createElementNS("http://www.w3.org/2000/svg","feFlood"),o=document.createElementNS("http://www.w3.org/2000/svg","feComposite"),r=document.createElementNS("http://www.w3.org/2000/svg","feMorphology"),a=document.createElementNS("http://www.w3.org/2000/svg","feMerge"),s=document.createElementNS("http://www.w3.org/2000/svg","feMergeNode"),h=document.createElementNS("http://www.w3.org/2000/svg","feMergeNode");e.id="glow",n.setAttribute("result","flood"),n.setAttribute("flood-color","#ffffff"),n.setAttribute("flood-opacity","0.5"),o.setAttribute("in","flood"),o.setAttribute("result","mask"),o.setAttribute("in2","SourceGraphic"),o.setAttribute("operator","in"),r.setAttribute("in","mask"),r.setAttribute("result","dilated"),r.setAttribute("operator","dilate"),r.setAttribute("radius","2"),i.setAttribute("in","dilated"),i.setAttribute("result","blurred"),i.setAttribute("stdDeviation","1"),s.setAttribute("in","blurred"),h.setAttribute("in","SourceGraphic"),e.appendChild(n),e.appendChild(o),e.appendChild(r),e.appendChild(i),e.appendChild(a),a.appendChild(s),a.appendChild(h),t.defs.appendChild(e)}var o=i(3),r=i(4),a=i(12),s=i(13),h=i(14),l=i(16),u=i(18),c=i(19),d=i(20),p=i(21),f=i(22),m=i(23),g=i(24),_=i(25),T=i(26),v=i(27),y=i(28),x={bar:r,boxplot:a,bullet:s,column:r,line:h,area:l,pie:u,bubble:d,scatter:d,heatmap:p,treemap:p,map:f,radial:c,legend:m,mapLegend:g,circleLegend:_,radialPlot:y,title:T,axis:v},A=function(t,e){var i=o(t,e.width,e.height),r=i.rect(0,0,e.width,e.height);return i.raphael.svg&&n(i),i.pushDownBackgroundToBottom=function(){r.toBack()},i.changeChartBackgroundColor=function(t){r.attr({fill:t})},i.changeChartBackgroundOpacity=function(t){r.attr({"fill-opacity":t})},i.resizeBackground=function(t,e){r.attr({width:t,height:e})},r.attr({fill:"#fff","stroke-width":0}),i};t.exports={name:"Raphael",plugins:x,callback:A}},function(t,e){t.exports=__WEBPACK_EXTERNAL_MODULE_3__},function(t,e,i){"use strict";var n=i(5),o=i(6),r=i(3),a=700,s=1,h=.3,l=.2,u=o.defineClass({render:function(t,e){var i=e.groupBounds;return i?(this.paper=t,this.theme=e.theme,this.seriesDataModel=e.seriesDataModel,this.chartType=e.chartType,this.paper.setStart(),this.options=e.options,this.theme=e.theme,this.groupBars=this._renderBars(i),this.groupBorders=this._renderBarBorders(i),this.overlay=this._renderOverlay(),this.groupBounds=i,this.paper.setFinish()):null},_renderOverlay:function(){var t={width:1,height:1,left:0,top:0},e={"fill-opacity":0};return this._renderBar(t,"#fff",e)},_renderBar:function(t,e,i){var r;return t.width<0||t.height<0?null:r=n.renderRect(this.paper,t,o.extend({fill:e,stroke:"none"},i))},_renderBars:function(t){var e=this,i=this.theme.colors,n=this.options.colorByPoint,r=o.map(t,function(t,r){return o.map(t,function(t,o){var a,s,h;return t?(h=e.seriesDataModel.getSeriesItem(r,o),a=n?i[r]:i[o],s=e._renderBar(t.start,a),{rect:s,color:a,bound:t.end,item:h,groupIndex:r,index:o,isRange:h.isRange}):null})});return r},_makeRectPoints:function(t){return{leftTop:{left:Math.ceil(t.left),top:Math.ceil(t.top)},rightTop:{left:Math.ceil(t.left+t.width),top:Math.ceil(t.top)},rightBottom:{left:Math.ceil(t.left+t.width),top:Math.ceil(t.top+t.height)},leftBottom:{left:Math.ceil(t.left),top:Math.ceil(t.top+t.height)}}},_makeTopLinePath:function(t,e,i){var r,a=null,s=i.value;return("bar"===e||s>=0||i.isRange)&&(r=o.extend({},t.leftTop),r.left-="column"===e||s<0?1:0,a=n.makeLinePath(r,t.rightTop).join(" ")),a},_makeRightLinePath:function(t,e,i){var o=null;return("column"===e||i.value>=0||i.isRange)&&(o=n.makeLinePath(t.rightTop,t.rightBottom).join(" ")),o},_makeBottomLinePath:function(t,e,i){var o=null;return("bar"===e||i.value<0||i.isRange)&&(o=n.makeLinePath(t.leftBottom,t.rightBottom).join(" ")),o},_makeLeftLinePath:function(t,e,i){var o=null;return("column"===e||i.value<0||i.isRange)&&(o=n.makeLinePath(t.leftTop,t.leftBottom).join(" ")),o},_makeBorderLinesPaths:function(t,e,i){var n=this._makeRectPoints(t),r={top:this._makeTopLinePath(n,e,i),right:this._makeRightLinePath(n,e,i),bottom:this._makeBottomLinePath(n,e,i),left:this._makeLeftLinePath(n,e,i)};return o.filter(r,function(t){return t})},_renderBorderLines:function(t,e,i,r){var a=this,s=this._makeBorderLinesPaths(t,i,r),h={};return o.forEach(s,function(t,i){h[i]=n.renderLine(a.paper,t,e,1)}),h},_renderBarBorders:function(t){var e,i=this,n=this.theme.borderColor;return n?e=o.map(t,function(t,e){return o.map(t,function(t,o){var r;return t?(r=i.seriesDataModel.getSeriesItem(e,o),i._renderBorderLines(t.start,n,i.chartType,r)):null})}):null},_animateRect:function(t,e){t.animate({x:e.left,y:e.top,width:e.width,height:e.height},a,">")},_animateBorders:function(t,e,i,n){var r=this._makeBorderLinesPaths(e,i,n);o.forEach(t,function(t,e){t.animate({path:r[e]},a,">")})},animate:function(t){var e=this,i=this.groupBorders||[];n.forEach2dArray(this.groupBars,function(t,n,o){var r=i[n]&&i[n][o];t&&(e._animateRect(t.rect,t.bound),r&&e._animateBorders(r,t.bound,e.chartType,t.item))}),t&&(this.callbackTimeout=setTimeout(function(){t(),delete e.callbackTimeout},a))},showAnimation:function(t){var e=this.groupBars[t.groupIndex][t.index],i=e.bound;this.overlay.attr({width:i.width,height:i.height,x:i.left,y:i.top,"fill-opacity":.3})},hideAnimation:function(){this.overlay.attr({width:1,height:1,x:0,y:0,"fill-opacity":0})},_updateRectBound:function(t,e){t.attr({x:e.left,y:e.top,width:e.width,height:e.height})},resize:function(t){var e=this,i=this.groupBorders||[],o=t.dimension,r=t.groupBounds;this.groupBounds=r,this.paper.setSize(o.width,o.height),n.forEach2dArray(this.groupBars,function(t,o,a){var s,h;t&&(s=i[o]&&i[o][a],h=r[o][a].end,t.bound=h,n.updateRectBound(t.rect,h),s&&e._updateBordersPath(s,h,e.chartType,t.item))})},_changeBordersColor:function(t,e){o.forEach(t,function(t){t.attr({stroke:e})})},_changeBarColor:function(t,e,i){var n,o=this.groupBars[t.groupIndex][t.index];o.rect.attr({fill:e}),i&&(n=this.groupBorders[t.groupIndex][t.index],this._changeBordersColor(n,i))},selectSeries:function(t){var e,i=this.groupBars[t.groupIndex][t.index],o=r.color(i.color),a=this.theme.selectionColor,s=a||n.makeChangedLuminanceColor(o.hex,l),h=this.theme.borderColor;h&&(e=r.color(h),h=n.makeChangedLuminanceColor(e.hex,l)),this._changeBarColor(t,s,h)},unselectSeries:function(t){var e=this.groupBars[t.groupIndex][t.index],i=this.theme.borderColor;this._changeBarColor(t,e.color,i)},selectLegend:function(t){var e=this.groupBorders||[],i=o.isNull(t);n.forEach2dArray(this.groupBars,function(n,r,a){var l,u;n&&(l=e[r]&&e[r][a],u=i||t===a?s:h,n.rect.attr({"fill-opacity":u}),l&&o.forEach(l,function(t){t.attr({"stroke-opacity":u})}))})},renderSeriesLabel:function(t,e,i,r,a){var s=a||"column"===this.chartType?"middle":"start",h={"font-size":r.fontSize,"font-family":r.fontFamily,"font-weight":r.fontWeight,fill:r.color,opacity:0,"text-anchor":s},l=t.set();return o.forEach(i,function(i,r){o.forEach(i,function(i,o){var a,s=e[r][o],u=n.renderText(t,s.end,i.end,h);u.node.style.userSelect="none",u.node.style.cursor="default",u.node.setAttribute("filter","url(#glow)"),l.push(u),s.start&&(a=n.renderText(t,s.start,i.start,h),a.node.style.userSelect="none",a.node.style.cursor="default",a.node.setAttribute("filter","url(#glow)"),l.push(a))})}),l}});t.exports=u},function(t,e,i){"use strict";function n(t){return o.isExisty(t)&&"number"==typeof t}var o=i(6),r=i(7),a=i(3),s={makeLinePath:function(t,e,i){var n,r=[t.left,t.top],a=[e.left,e.top];return i=i||1,n=i%2/2,o.forEachArray(r,function(t,e){t===a[e]&&(r[e]=a[e]=Math.round(t)-n)}),["M"].concat(r).concat("L").concat(a)},renderLine:function(t,e,i,n){var o=t.path([e]),r={stroke:i,"stroke-width":n||2};return"transparent"===i&&(r.stroke="#fff",r["stroke-opacity"]=0),o.attr(r),o},getEllipsisText:function(t,e,i){for(var n=t.split(""),o=n.length,r=this.getRenderedTextSize(".",i.fontSize,i.fontFamily).width,a=2*r,s="",h=0;h=e){s+="..";break}s+=n[h]}return s},renderText:function(t,e,i,n){var r=t.text(e.left,e.top,o.decodeHTMLEntity(String(i)));return n&&(n["dominant-baseline"]?r.node.setAttribute("dominant-baseline",n["dominant-baseline"]):r.node.setAttribute("dominant-baseline","central"),r.attr(n)),r},renderArea:function(t,e,i){var n=t.path(e);return i=o.extend({"stroke-opacity":0},i),n.attr(i),n},renderCircle:function(t,e,i,n){var o=t.circle(e.left,e.top,i);return n&&o.attr(n),o},renderRect:function(t,e,i){var n=t.rect(e.left,e.top,e.width,e.height);return i&&n.attr(i),n},updateRectBound:function(t,e){t.attr({x:e.left,y:e.top,width:e.width,height:e.height})},forEach2dArray:function(t,e){t&&o.forEachArray(t,function(t,i){o.forEachArray(t,function(t,n){e(t,i,n)})})},makeChangedLuminanceColor:function(t,e){var i;return t=t.replace("#",""),e=e||0,i=o.map(o.range(3),function(i){var n=parseInt(t.substr(2*i,2),16),o=n+n*e;return o=Math.round(Math.min(Math.max(0,o),255)).toString(16),r.formatToZeroFill(o,2)}).join(""),"#"+i},getRenderedTextSize:function(t,e,i){var n=a(document.body,100,100),o=n.text(0,0,t).attr({"font-size":e,"font-family":i}),r=o.getBBox();return o.remove(),n.remove(),{width:r.width,height:r.height}},animateOpacity:function(t,e,i,o){var r=n(o)?o:600,s=n(e)?e:0,h=n(i)?i:1,l=a.animation({opacity:h},r);t.attr({opacity:s}),t.animate(l)}};t.exports=s},function(t,e){t.exports=__WEBPACK_EXTERNAL_MODULE_6__},function(t,e,i){"use strict";function n(t,e){t=h.isArray(t)?t:[t],h.forEachArray(t,e)}function o(t){return"alpha(opacity="+t*r.OLD_BROWSER_OPACITY_100+")"}var r=i(8),a=i(9),s=i(10),h=i(6),l=i(11),u=Array.prototype.concat,c=h.browser,d=c.msie&&7===c.version,p=c.msie&&c.version<=8,f=window.getComputedStyle||!1,m=0,g="clipRectForAnimation",_={concatStr:function(){return String.prototype.concat.apply("",arguments)},makeFontCssText:function(t){var e=[];return t?(t.fontSize&&e.push(this.concatStr("font-size:",t.fontSize,"px")),t.fontFamily&&e.push(this.concatStr("font-family:",t.fontFamily)),t.color&&e.push(this.concatStr("color:",t.color)),t.fontWeight&&e.push(this.concatStr("font-weight:",t.fontWeight)),e.join(";")):""},checkEl:null,_createSizeCheckEl:function(){var t,e;return this.checkEl?this.checkEl.style.cssText="":(t=a.create("DIV","tui-chart-size-check-element"),e=a.create("SPAN"),t.appendChild(e),this.checkEl=t),this.checkEl},_makeCachingKey:function(t,e,i){var n=[t,i];return h.forEach(e,function(t,e){n.push(t+e)}),n.join("-")},_addCssStyle:function(t,e){t.style.fontSize=(e.fontSize||r.DEFAULT_LABEL_FONT_SIZE)+"px",e.fontFamily&&(t.style.fontFamily=e.fontFamily),e.fontWeight&&(t.style.fontWeight=e.fontWeight),e.cssText&&(t.style.cssText+=e.cssText)},sizeCache:{},_getRenderedLabelSize:function(t,e,i){var n,o,r,a;return e=e||{},(t=h.isExisty(t)?String(t):"")?(n=this._makeCachingKey(t,e,i),a=this.sizeCache[n],a||(o=this._createSizeCheckEl(),r=o.firstChild,r.innerHTML=t,this._addCssStyle(o,e),document.body.appendChild(o),a=r[i],document.body.removeChild(o),this.sizeCache[n]=a),a):0},getRenderedLabelWidth:function(t,e){var i=this._getRenderedLabelSize(t,e,"offsetWidth");return i},getRenderedLabelHeight:function(t,e){var i=this._getRenderedLabelSize(t,e,"offsetHeight");return i},_getRenderedLabelsMaxSize:function(t,e,i){var n,o=0;return t&&t.length&&(n=h.map(t,function(t){return i(t,e)}),o=s.max(n)),o},getRenderedLabelsMaxWidth:function(t,e){var i=h.bind(this.getRenderedLabelWidth,this),n=this._getRenderedLabelsMaxSize(t,e,i);return n},getRenderedLabelsMaxHeight:function(t,e){var i=h.bind(this.getRenderedLabelHeight,this),n=this._getRenderedLabelsMaxSize(t,e,i);return n},renderDimension:function(t,e){t.style.cssText=[this.concatStr("width:",e.width,"px"),this.concatStr("height:",e.height,"px")].join(";")},renderPosition:function(t,e){h.isUndefined(e)||h.forEachArray(["top","bottom","left","right"],function(i){var n=e[i];h.isNumber(n)&&(t.style[i]=e[i]+"px")})},renderBackground:function(t,e){e&&(t.style.background=e)},renderFontFamily:function(t,e){e&&(t.style.fontFamily=e)},renderTitle:function(t,e,i){var n,o;return t?(n=a.create("DIV",i),n.innerHTML=t,o=_.makeFontCssText(e),e.background&&(o+=";"+this.concatStr("background:",e.background)),n.style.cssText=o,n):null},expandBound:function(t){var e=t.dimension,i=t.position;return{dimension:{width:e.width+2*r.SERIES_EXPAND_SIZE,height:e.height+2*r.SERIES_EXPAND_SIZE},position:{left:i.left-r.SERIES_EXPAND_SIZE,top:i.top-r.SERIES_EXPAND_SIZE}}},_properCase:function(t){return t.substring(0,1).toUpperCase()+t.substring(1)},makeMouseEventDetectorName:function(t,e,i){return t+this._properCase(e)+this._properCase(i)},formatValue:function(t){var e=t.value,i=t.formatFunctions,n=t.valueType||"value",o=t.areaType,r=t.chartType,a=t.legendName,s=[String(e)].concat(i||[]);return h.reduce(s,function(t,e){return e(t,r,o,n,a)})},formatValues:function(t,e,i,n,o){var r;return e&&e.length?r=h.map(t,function(t){return _.formatValue({value:t,formatFunctions:e,chartType:i,areaType:n,valueType:o})}):t},formatDate:function(t,e){var i=h.isDate(t)?t:new Date(t);return e=e||r.DEFAULT_DATE_FORMAT,h.formatDate(e,i)||t},formatDates:function(t,e){var i=this.formatDate;return e=e||r.DEFAULT_DATE_FORMAT,h.map(t,function(t){return i(t,e)})},cancelAnimation:function(t){t&&t.id&&(cancelAnimationFrame(t.id),delete t.id)},startAnimation:function(t,e,i){function n(){var a=(new Date).getTime()-o,s=Math.min(a/t,1);e(s),1===s?(delete r.id,i&&i()):r.id=requestAnimationFrame(n)}var o,r={};return o=(new Date).getTime(),r.id=requestAnimationFrame(n),r},isIE7:function(){return d},isOldBrowser:function(){return p},formatToZeroFill:function(t,e){var i="0";if(t=String(t),t.length>=e)return t;for(;t.length-1?"-":"",t.indexOf(".")>-1?(i=t.split("."),t=String(Math.abs(i[0])),a="."+i[1]):t=String(Math.abs(t)),t.length<=s?o=l:(i=t.split("").reverse(),n=i.length-1,i=h.map(i,function(t,e){var i=[t];return e-1||(i.push(e),t.className=i.join(" ")))},removeClass:function(t,e){var i=this._getClassNames(t),o=n.inArray(e,i);o!==-1&&(i.splice(o,1),t.className=i.join(" "))},hasClass:function(t,e){var i=this._getClassNames(t),o=n.inArray(e,i);return o>-1},findParentByClass:function(t,e,i){var n,o=t.parentNode;return n=o?this.hasClass(o,e)?o:"BODY"===o.nodeName||this.hasClass(o,i)?null:this.findParentByClass(o,e,i):null},append:function(t,e){t&&e&&(e=n.isArray(e)?e:[e],n.forEachArray(e,function(e){e&&t.appendChild(e)}))}};t.exports=r},function(t,e,i){"use strict";var n=i(6),o=function(t,e,i){var o,r,a;return e?(o=t[0],r=e.call(i,o,0),a=t.slice(1),n.forEachArray(a,function(t,n){var a=e.call(i,t,n+1);ar&&(r=a,o=t)})):o=Math.max.apply(null,t),o},a=function(t,e,i){var o=!1;return n.forEach(t,function(n,r){return e.call(i,n,r,t)&&(o=!0),!o}),o},s=function(t,e,i){var o=!!(t||[]).length;return n.forEach(t,function(n,r){return e.call(i,n,r,t)||(o=!1),o!==!1}),o},h=function(t,e,i,o){var r,a=[];return n.isBoolean(e)||(o=i,i=e,e=!1),i=i||function(t){return t},e?n.forEachArray(t,function(e,n){e=i.call(o,e,n,t),n&&r===e||a.push(e),r=e}):n.forEachArray(t,function(e,r){e=i.call(o,e,r,t),n.inArray(e,a)===-1&&a.push(e)}),a},l=function(t){var e,i=[],o=r(n.map(t,function(t){return t.length}));return n.forEachArray(t,function(t){for(e=0;e1&&!e},isDatetimeType:function(t){return t===n.AXIS_TYPE_DATETIME},isSupportPublicShowTooptipAPI:function(t){return this.isBarChart(t)||this.isColumnChart(t)||this.isLineChart(t)||this.isAreaChart(t)||this.isBoxplotChart(t)},isSupportPublicHideTooptipAPI:function(t){return this.isBarChart(t)||this.isColumnChart(t)||this.isLineChart(t)||this.isAreaChart(t)||this.isBoxplotChart(t)}};t.exports=r},function(t,e,i){"use strict";var n=i(5),o=i(6),r=i(3),a=700,s=1,h=.3,l=.2,u=1,c=2,d=2,p=1,f=o.defineClass({render:function(t,e){var i=e.groupBounds;return i?(this.paper=t,this.theme=e.theme,this.options=e.options,this.seriesDataModel=e.seriesDataModel,this.chartType=e.chartType,this.paper.setStart(),this.groupWhiskers=[],this.groupMedians=[],this.groupBoxes=this._renderBoxplots(i),this.groupBorders=this._renderBoxBorders(i),this.rectOverlay=this._renderRectOverlay(),this.circleOverlay=this._renderCircleOverlay(),this.groupBounds=i,this.paper.setFinish()):null},_renderRectOverlay:function(){var t={width:1,height:1,left:0,top:0},e={"fill-opacity":0};return n.renderRect(this.paper,t,o.extend({"stroke-width":0},e))},_renderCircleOverlay:function(){var t={left:0,top:0},e={"fill-opacity":0};return n.renderCircle(this.paper,t,0,o.extend({"stroke-width":0},e))},_renderBox:function(t,e,i){var r;return t.width<0||t.height<0?null:r=n.renderRect(this.paper,t,o.extend({fill:"#fff",stroke:e,"stroke-width":u},i))},_renderBoxes:function(t){var e=this,i=this.theme.colors,n=this.options.colorByPoint;return o.map(t,function(t,r){return o.map(t,function(t,o){var a,s,h;return t?(h=e.seriesDataModel.getSeriesItem(r,o),a=n?i[r]:i[o],t.start&&(s=e._renderBox(t.start,a)),{rect:s,color:a,bound:t.end,item:h,groupIndex:r,index:o}):null})})},_renderBoxplots:function(t){var e=this._renderBoxes(t);return this.groupWhiskers=this._renderWhiskers(t),this.groupMedians=this._renderMedianLines(t),this.groupOutliers=this._renderOutliers(t),e},_renderWhisker:function(t,e,i){var o=this.paper,r=e.top-t.top,a=r>0?1:-1,s=t.width,h=t.left,l=s/4,u="M"+(h+l)+","+t.top+"H"+(h+3*l),d="M"+(h+2*l)+","+t.top+"V"+(t.top+Math.abs(r)*a),f=n.renderLine(o,u,i,c),m=n.renderLine(o,d,i,p),g=[];return f.attr({opacity:0}),m.attr({opacity:0}),g.push(f),g.push(m),g},_renderWhiskers:function(t){var e=this,i=this.theme.colors,n=this.options.colorByPoint,r=[];return o.forEach(t,function(t,a){var s=[];o.forEach(t,function(t,o){var r=n?i[a]:i[o];t&&(s=s.concat(e._renderWhisker(t.min,t.start,r)),s=s.concat(e._renderWhisker(t.max,t.end,r)))}),r.push(s)}),r},_renderMedianLine:function(t,e){var i=t.width,o="M"+t.left+","+t.top+"H"+(t.left+i),r=n.renderLine(this.paper,o,e,d);return r.attr({opacity:0}),r},_renderMedianLines:function(t){var e=this,i=this.theme.colors,n=this.options.colorByPoint,r=[];return o.forEach(t,function(t,a){var s=[];o.forEach(t,function(t,o){var r=n?i[a]:i[o];t&&s.push(e._renderMedianLine(t.median,r))}),r.push(s)}),r},_renderOutlier:function(t,e){var i=n.renderCircle(this.paper,{left:t.left,top:t.top},3,{stroke:e});return i.attr({opacity:0}),i},_renderOutliers:function(t){var e=this,i=this.theme.colors,n=this.options.colorByPoint,r=[];return o.forEach(t,function(t,a){var s=[];o.forEach(t,function(t,r){var h=n?i[a]:i[r],l=[];t&&(t.outliers.length&&o.forEach(t.outliers,function(t){l.push(e._renderOutlier(t,h))}),s.push(l))}),r.push(s)}),r},_makeRectPoints:function(t){return{leftTop:{left:Math.ceil(t.left),top:Math.ceil(t.top)},rightTop:{left:Math.ceil(t.left+t.width),top:Math.ceil(t.top)},rightBottom:{left:Math.ceil(t.left+t.width),top:Math.ceil(t.top+t.height)},leftBottom:{left:Math.ceil(t.left),top:Math.ceil(t.top+t.height)}}},_renderBorderLines:function(t,e,i,r){var a=this,s=this._makeBorderLinesPaths(t,i,r),h={};return o.forEach(s,function(t,i){h[i]=n.renderLine(a.paper,t,e,1)}),h},_renderBoxBorders:function(t){var e,i=this,n=this.theme.borderColor;return n?e=o.map(t,function(t,e){return o.map(t,function(t,o){var r;return t?(r=i.seriesDataModel.getSeriesItem(e,o),i._renderBorderLines(t.start,n,i.chartType,r)):null})}):null},_animateRect:function(t,e){t.animate({x:e.left,y:e.top,width:e.width,height:e.height},a,">")},animate:function(t){var e=this,i=r.animation({opacity:1},a);n.forEach2dArray(this.groupBoxes,function(t){t&&e._animateRect(t.rect,t.bound)}),n.forEach2dArray(e.groupWhiskers,function(t){t.animate(i.delay(a))}),n.forEach2dArray(e.groupMedians,function(t){ +t.animate(i.delay(a))}),n.forEach2dArray(e.groupOutliers,function(t){o.forEach(t,function(t){t.animate(i.delay(a))})}),t&&(this.callbackTimeout=setTimeout(function(){t(),delete e.callbackTimeout},a))},showAnimation:function(t){o.isNumber(t.outlierIndex)?this.showOutlierAnimation(t):this.showRectAnimation(t)},showRectAnimation:function(t){var e=this.groupBoxes[t.groupIndex][t.index],i=e.bound;this.rectOverlay.attr({width:i.width,height:i.height,x:i.left,y:i.top,fill:e.color,"fill-opacity":.3})},showOutlierAnimation:function(t){var e=this.groupOutliers[t.groupIndex][t.index][t.outlierIndex].attr();this.circleOverlay.attr({r:e.r,cx:e.cx,cy:e.cy,fill:e.stroke,"fill-opacity":.3,stroke:e.stroke,"stroke-width":2})},hideAnimation:function(){this.circleOverlay.attr({width:1,height:1,x:0,y:0,"fill-opacity":0,"stroke-width":0}),this.rectOverlay.attr({width:1,height:1,x:0,y:0,"fill-opacity":0})},_updateRectBound:function(t,e){t.attr({x:e.left,y:e.top,width:e.width,height:e.height})},resize:function(t){var e=t.dimension,i=t.groupBounds;this.groupBounds=i,this.paper.setSize(e.width,e.height),n.forEach2dArray(this.groupBoxes,function(t,e,o){var r;t&&(r=i[e][o].end,t.bound=r,n.updateRectBound(t.rect,r))})},_changeBordersColor:function(t,e){o.forEach(t,function(t){t.attr({stroke:e})})},_changeBoxColor:function(t,e,i){var n,o=this.groupBoxes[t.groupIndex][t.index];o.rect.attr({stroke:e}),i&&(n=this.groupBorders[t.groupIndex][t.index],this._changeBordersColor(n,i))},selectSeries:function(t){var e,i=this.groupBoxes[t.groupIndex][t.index],o=r.color(i.color),a=this.theme.selectionColor,s=a||n.makeChangedLuminanceColor(o.hex,l),h=this.theme.borderColor;h&&(e=r.color(h),h=n.makeChangedLuminanceColor(e.hex,l)),this._changeBoxColor(t,s,h)},unselectSeries:function(t){var e=this.groupBoxes[t.groupIndex][t.index],i=this.theme.borderColor;this._changeBoxColor(t,e.color,i)},selectLegend:function(t){var e=o.isNull(t);n.forEach2dArray(this.groupBoxes,function(i,n,o){var r;i&&(r=e||t===o?s:h,i.rect.attr({"stroke-opacity":r}))}),n.forEach2dArray(this.groupWhiskers,function(i,n,o){var r=e||t===o?s:h;i.attr({"stroke-opacity":r})}),n.forEach2dArray(this.groupMedians,function(i,n,o){var r=e||t===o?s:h;i.attr({"stroke-opacity":r})})},renderSeriesLabel:function(t,e,i,r,a){var s={"font-size":r.fontSize,"font-family":r.fontFamily,"font-weight":r.fontWeight,fill:r.color,opacity:0,"text-anchor":a?"middle":"start"},h=t.set();return o.forEach(i,function(i,r){o.forEach(i,function(i,o){var a,l=e[r][o],u=n.renderText(t,l.end,i.end,s);u.node.style.userSelect="none",u.node.style.cursor="default",u.node.setAttribute("filter","url(#glow)"),h.push(u),l.start&&(a=n.renderText(t,l.start,i.start,s),a.node.style.userSelect="none",a.node.style.cursor="default",a.node.setAttribute("filter","url(#glow)"),h.push(a))})}),h}});t.exports=f},function(t,e,i){"use strict";function n(t,e,i,n){var o=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),r=t.rect(e.left,e.top,i.width,i.height);return r.id=n+"_rect",o.id=n,o.appendChild(r.node),t.defs.appendChild(o),r}var o=i(5),r=i(8),a=i(6),s=i(7),h=a.browser,l=h.msie&&h.version<=8,u=700,c=700,d=1,p=.3,f=20,m=a.defineClass({render:function(t,e){var i=e.groupBounds,n=e.seriesDataModel;return i&&i.length?(this.paper=t,this.theme=e.theme,this.dimension=e.dimension,this.position=e.position,this.options=e.options,this.chartType=e.chartType,this.isVertical=e.isVertical,this.seriesDataModel=n,this.maxRangeCount=n.maxRangeCount,this.maxMarkerCount=n.maxMarkerCount,this.rangeOpacities={},this.paper.setStart(),this._renderBounds(i),this.paper.setFinish()):null},_getRangeOpacity:function(t){var e=this.maxRangeCount;return this.prevMaxRangeCount!==e&&this._updateOpacityStep(e),t",t)),t&&(this.callbackTimeout=setTimeout(function(){t(),delete self.callbackTimeout},c))},resize:function(t){var e=t.dimension,i=t.groupBounds,n=e.width,o=e.height;this.dimension=t.dimension,this.groupBounds=i,this.resizeClipRect(n,o),this.paper.setSize(n,o),this._renderBounds(i)},resizeClipRect:function(t,e){var i=this.paper.getById(this._getClipRectId()+"_rect");i.attr({width:t,height:e})},setClipRectPosition:function(t){var e=this.paper.getById(this._getClipRectId()+"_rect");e.attr({x:t.left,y:t.top})},_getClipRectId:function(){return this.clipRectId||(this.clipRectId=s.generateClipRectId()),this.clipRectId},_changeBordersColor:function(t,e){a.forEach(t,function(t){t.attr({stroke:e})})},selectLegend:function(t){var e=a.isNull(t);a.forEachArray(this.groupBars,function(i,n){var o=e||t===n?d:p;this.groupBars[n].attr({"fill-opacity":o}),this.groupLabels[n].attr({opacity:o}),a.forEachArray(this.groupLabels[n],function(t){t.attr({opacity:o})})},this)},renderSeriesLabel:function(t,e,i,n){var o={"font-size":n.fontSize,"font-family":n.fontFamily,"font-weight":n.fontWeight,fill:n.color,opacity:0,"text-anchor":this.isVertical?"middle":"start"},r=t.set();return this.groupLabels=a.map(i,function(i,n){var s=t.set();return a.forEach(i,function(i,a){var h=this._renderLabel(t,e[n][a],o,i);s.push(h),r.push(h)},this),s},this),r},_renderLabel:function(t,e,i,n){var r=o.renderText(t,e,n,i),a=r.node,s=a.style;return s.userSelect="none",s.cursor="default",a.setAttribute("filter","url(#glow)"),r},getGraphColors:function(){return a.map(this.groupBars,function(t,e){var i,n=[],o=this.groupLines[e].length,r=0;for(t.forEach(function(t){n.push(t.attrs.fill)}),i=n[n.length-1];r<=o;r+=1)n.push(i);return n},this)}});t.exports=m},function(t,e,i){"use strict";var n=i(15),o=i(5),r=i(6),a=1,s=.3,h=r.defineClass(n,{init:function(){this.selectedLegendIndex=null,this.chartType="line",this.lineWidth=2},render:function(t,e){var i,n=e.dimension,o=e.groupPositions,a=e.theme,s=a.colors,h=e.options,l=h.showDot?1:0,u=h.spline,c=this.lineWidth=r.isNumber(h.pointWidth)?h.pointWidth:this.lineWidth,d=this.makeBorderStyle(a.borderColor,l),p=this.makeOutDotStyle(l,d);return i=u?this._getSplineLinesPath(o,h.connectNulls):this._getLinesPath(o,h.connectNulls),this.paper=t,this.theme=e.theme,this.isSpline=u,this.dimension=n,this.position=e.position,t.setStart(),this.groupLines=this._renderLines(t,i,s,c),this.tooltipLine=this._renderTooltipLine(t,n.height),this.groupDots=this._renderDots(t,o,s,l),h.allowSelect&&(this.selectionDot=this._makeSelectionDot(t),this.selectionColor=a.selectionColor),this.colors=s,this.borderStyle=d,this.outDotStyle=p,this.groupPositions=o,this.groupPaths=i,this.dotOpacity=l,delete this.pivotGroupDots,t.setFinish()},_getLinesPath:function(t,e){var i=this;return r.map(t,function(t){return i._makeLinesPath(t,null,e)})},_getSplineLinesPath:function(t,e){var i=this;return r.map(t,function(t){return i._makeSplineLinesPath(t,e)})},_renderLines:function(t,e,i,n){return r.map(e,function(e,r){var a=i[r]||"transparent";return o.renderLine(t,e.join(" "),a,n)})},resize:function(t){var e=this,i=t.dimension,n=t.groupPositions;this.resizeClipRect(i.width,i.height),this.groupPositions=n,this.groupPaths=this.isSpline?this._getSplineLinesPath(n):this._getLinesPath(n),this.paper.setSize(i.width,i.height),this.tooltipLine.attr({top:i.height}),r.forEachArray(this.groupPaths,function(t,i){e.groupLines[i].attr({path:t.join(" ")}),r.forEachArray(e.groupDots[i],function(t,o){t.endDot&&e.moveDot(t.endDot.dot,n[i][o])})})},selectLegend:function(t){var e=r.isNull(t);this.selectedLegendIndex&&this.selectedLegendIndex!==-1&&this.resetSeriesOrder(this.selectedLegendIndex),this.selectedLegendIndex=t,r.forEachArray(this.groupLines,function(i,n){var o=t===n,h=e||o?a:s,l=this.groupDots[n];i.attr({"stroke-opacity":h}),r.forEachArray(l,function(t){t.opacity=h,this.dotOpacity&&t.endDot.dot.attr({"fill-opacity":h})},this),o&&this.moveSeriesToFront(i,l)},this),e&&r.forEachArray(this.groupLines,function(t,e){this.moveSeriesToFront(t,this.groupDots[e])},this)},resetSeriesOrder:function(t){var e=t+10&&(n[0]="M"),n},_getAnchor:function(t,e,i){var n,o,r,a,s,h=(e.left-t.left)/2,l=(i.left-e.left)/2,u=Math.atan((e.left-t.left)/Math.abs(e.top-t.top)),c=Math.atan((i.left-e.left)/Math.abs(e.top-i.top));return u=t.top0&&!e||a)&&(i.push(n),n=[])}),i},_getSplinePartialPaths:function(t){var e,i,n,o,r,s,h,l=this,u=[];return a.forEach(t,function(t){h=e=t[0],n=t.length,o=e,i=t[n-1],r=t.slice(1).slice(0,n-2),s=a.map(r,function(e,i){var n=t[i+2],r=l._getAnchor(o,e,n);return o=e,Math.abs(r.y1-h.top)>Math.abs(h.top-e.top)&&(r.y1=e.top),Math.abs(r.y2-n.top)>Math.abs(n.top-e.top)&&(r.y2=e.top),h=e,[r.x1,r.y1,e.left,e.top,r.x2,r.y2]}),s.push([i.left,i.top,i.left,i.top]),s.unshift(["M",e.left,e.top,"C",e.left,e.top]),u.push(s)}),u},_makeSplineLinesPath:function(t,e){var i=[],n=this._getSplinePositionsGroups(t,e),o=this._getSplinePartialPaths(n);return a.forEach(o,function(t){i=i.concat(t)}),i},_renderTooltipLine:function(t,e){var i=o.makeLinePath({left:10,top:e},{left:10,top:0});return o.renderLine(t,i,"transparent",1)},makeBorderStyle:function(t,e){var i;return t&&(i={stroke:t,"stroke-width":1,"stroke-opacity":e}),i},makeOutDotStyle:function(t,e){var i={"fill-opacity":t,"stroke-opacity":0,r:c};return e&&a.extend(i,e),i},renderDot:function(t,e,i,n){var o,r,s,h=this.theme&&this.theme.dot||{dot:{}};return e&&(o=t.circle(e.left,e.top,h.radius||c),r={fill:h.fillColor||i,"fill-opacity":a.isNumber(n)?n:h.fillOpacity,stroke:h.strokeColor||i,"stroke-opacity":a.isNumber(n)?n:h.strokeOpacity,"stroke-width":h.strokeWidth},o.attr(r),s={dot:o,color:i}),s},_moveDotsToFront:function(t){o.forEach2dArray(t,function(t){t.endDot.dot.toFront(),t.startDot&&t.startDot.dot.toFront()})},_renderDots:function(t,e,i,n,o){var r,s=this;return r=a.map(e,function(e,r){var h=i[r];return a.map(e,function(e){var i,r={endDot:s.renderDot(t,e,h,n)};return s.hasRangeData&&(i=a.extend({},e),i.top=i.startTop,r.startDot=s.renderDot(t,i,h,n)),o&&(o.push(r.endDot.dot),r.startDot&&o.push(r.startDot.dot)),r})})},_getCenter:function(t,e){return{left:(t.left+e.left)/2,top:(t.top+e.top)/2}},_showDot:function(t,e){var i=this.theme.dot.hover,n={"fill-opacity":i.fillOpacity,stroke:i.strokeColor||t.color,"stroke-opacity":i.strokeOpacity,"stroke-width":i.strokeWidth,r:i.radius};this._setPrevDotAttributes(e,t.dot),i.fillColor&&(n.fill=i.fillColor),t.dot.attr(n)},_setPrevDotAttributes:function(t,e){this._prevDotAttributes||(this._prevDotAttributes={}),this._prevDotAttributes[t]=e.attr()},_updateLineStrokeWidth:function(t,e){t.attr({"stroke-width":e})},showAnimation:function(t){var e,i,n=t.groupIndex,o=t.index,r=this.groupLines?this.groupLines[o]:this.groupAreas[o],a=this.groupDots[o][n];a&&("area"===this.chartType?(e=2*this.lineWidth,i=r.startLine,r=r.line):e=2*this.lineWidth,this._updateLineStrokeWidth(r,e),i&&this._updateLineStrokeWidth(i,e),this._showDot(a.endDot,o),a.startDot&&this._showDot(a.startDot,o))},_getPivotGroupDots:function(){return!this.pivotGroupDots&&this.groupDots&&(this.pivotGroupDots=s.pivot(this.groupDots)),this.pivotGroupDots},_showGroupDots:function(t){var e=this,i=this._getPivotGroupDots();i&&i[t]&&a.forEachArray(i[t],function(t,i){t.endDot&&e._showDot(t.endDot,i),t.startDot&&e._showDot(t.startDot,i)})},showGroupTooltipLine:function(t,e){var i=Math.max(t.position.left,11),n=o.makeLinePath({left:i,top:e.position.top+t.dimension.height},{left:i,top:e.position.top});this.tooltipLine&&this.tooltipLine.attr({path:n,stroke:"#999","stroke-opacity":1})},showGroupAnimation:function(t){this._showGroupDots(t)},_hideDot:function(t,e,i){var n=this._prevDotAttributes[e],o=this.outDotStyle;n&&!a.isUndefined(i)&&(o=a.extend({r:n.r,stroke:n.stroke,fill:n.fill,"stroke-opacity":n["stroke-opacity"],"stroke-width":n["stroke-width"]},{"fill-opacity":i})),t.attr(o)},hideAnimation:function(t){var e,i,n,o,r=t.groupIndex,s=t.index,h=this.dotOpacity,l=this.groupDots[s];l&&l[r]&&(e=this.groupLines?this.groupLines[s]:this.groupAreas[s],i=l[r],"area"===this.chartType?(n=this.lineWidth,o=e.startLine,e=e.line):n=this.lineWidth,h&&!a.isNull(this.selectedLegendIndex)&&this.selectedLegendIndex!==s&&(h=p),e&&this._updateLineStrokeWidth(e,n),o&&this._updateLineStrokeWidth(o,n),i&&(this._hideDot(i.endDot.dot,s,h),i.startDot&&this._hideDot(i.startDot.dot,s,h)))},_hideGroupDots:function(t){var e=this,i=!a.isNull(this.selectedLegendIndex),n=this.dotOpacity,o=this._getPivotGroupDots();o&&o[t]&&a.forEachArray(o[t],function(t,o){var r=n;r&&i&&e.selectedLegendIndex!==o&&(r=p),t.endDot&&e._hideDot(t.endDot.dot,o,r),t.startDot&&e._hideDot(t.startDot.dot,o,r)})},hideGroupTooltipLine:function(){this.tooltipLine.attr({"stroke-opacity":0})},hideGroupAnimation:function(t){this._hideGroupDots(t)},_moveDot:function(t,e){var i={cx:e.left,cy:e.top};this.dotOpacity&&(i=a.extend({"fill-opacity":this.dotOpacity},i,this.borderStyle)),t.attr(i)},animate:function(t,e){var i=this.paper,o=this.dimension,r=this.position,a=this.clipRect,s=this._getClipRectId();!l&&o&&(a?a.attr({width:0,height:o.height}):(a=n(i,r,o,s),this.clipRect=a),e.forEach(function(t){t.node.setAttribute("clip-path","url(#"+s+")")}),a.animate({width:o.width},u,">",t))},_makeSelectionDot:function(t){var e=t.circle(0,0,d);return e.attr({fill:"#ffffff","fill-opacity":0,"stroke-opacity":0,"stroke-width":2}),e},selectSeries:function(t){var e=this.groupDots[t.index][t.groupIndex],i=this.groupPositions[t.index][t.groupIndex];this.selectedItem=e,this.selectionDot.attr({cx:i.left,cy:i.top,"fill-opacity":.5,"stroke-opacity":1,stroke:this.selectionColor||e.endDot.color}),this.selectionStartDot&&this.selectionStartDot.attr({cx:i.left,cy:i.startTop,"fill-opacity":.5,"stroke-opacity":1,stroke:this.selectionColor||e.startDot.color})},unselectSeries:function(t){var e=this.groupDots[t.index][t.groupIndex];this.selectedItem===e&&this.selectionDot.attr({"fill-opacity":0,"stroke-opacity":0}),this.selectionStartDot&&this.selectionStartDot.attr({"fill-opacity":0,"stroke-opacity":0})},setSize:function(t,e){t=t||this.dimension.width,e=e||this.dimension.height,this.paper.setSize(t,e)},_animateByPosition:function(t,e,i){var n={cx:e.left,cy:e.top};a.isExisty(i)&&(n.transform="t-"+i+",0"),t.animate(n,f)},_animateByPath:function(t,e,i){var n={path:e.join(" ")};a.isExisty(i)&&(n.transform="t-"+i+",0"),t.animate(n,f)},_removeFirstDot:function(t){var e=t.shift();e.endDot.dot.remove(),e.startDot&&e.startDot.dot.remove()},clear:function(){delete this.paper.dots,this.paper.clear()},resizeClipRect:function(t,e){var i=this.paper.getById(this._getClipRectId()+"_rect");i.attr({width:t,height:e})},_getClipRectId:function(){return this.clipRectId||(this.clipRectId=r.generateClipRectId()),this.clipRectId},resetSeriesOrder:function(){},moveSeriesToFront:function(){}});t.exports=g},function(t,e,i){"use strict";var n=i(15),o=i(5),r=i(6),a=1,s=.3,h=Array.prototype.concat,l=i(8).GUIDE_AREACHART_AREAOPACITY_TYPE,u=i(17),c=r.defineClass(n,{init:function(){this.selectedLegendIndex=null,this.chartType="area",this.lineWidth=1},render:function(t,e){var i=e.dimension,n=e.groupPositions,o=e.theme,a=o.colors,s=e.options,h=this._isAreaOpacityNumber(s.areaOpacity)?s.areaOpacity:.5,l=s.showDot?1:0,u=this.makeBorderStyle(o.borderColor,l),c=this.makeOutDotStyle(l,u),d=this.lineWidth=r.isNumber(s.pointWidth)?s.pointWidth:this.lineWidth;return this.paper=t,this.theme=e.theme,this.isSpline=s.spline,this.dimension=i,this.position=e.position,this.zeroTop=e.zeroTop,this.hasRangeData=e.hasRangeData,t.setStart(),this.groupPaths=this._getAreaChartPath(n,null,s.connectNulls),this.groupAreas=this._renderAreas(t,this.groupPaths,a,d,h),this.tooltipLine=this._renderTooltipLine(t,i.height),this.groupDots=this._renderDots(t,n,a,l),s.allowSelect&&(this.selectionDot=this._makeSelectionDot(t),this.selectionColor=o.selectionColor,this.hasRangeData&&(this.selectionStartDot=this._makeSelectionDot(t))),this.outDotStyle=c,this.groupPositions=n,this.dotOpacity=l,this.pivotGroupDots=null,t.setFinish()},_getAreaChartPath:function(t,e,i){var n;return n=this.isSpline?this._makeSplineAreaChartPath(t,e):this._makeAreaChartPath(t,e,i)},_renderAreas:function(t,e,i,n,a){var s;return i=i.slice(0,e.length),i.reverse(),e.reverse(),s=r.map(e,function(e,r){var s=i[r]||"transparent",h=s,l={area:o.renderArea(t,e.area.join(" "),{fill:s,opacity:a,stroke:s}),line:o.renderLine(t,e.line.join(" "),h,n)};return e.startLine&&(l.startLine=o.renderLine(t,e.startLine.join(" "),h,1)),l}),s.reverse()},_makeHeight:function(t,e){return Math.abs(t-e)},_makeAreasPath:function(t,e){var i,n=[],o=[],a=!1,s=t.length,l=[],u=[];return r.forEachArray(t,function(t,e){var i;t?(a?(i="M",a=!1):i="L",l.push([i,t.left,t.top]),u.unshift(["L",t.left,t.startTop])):(a=!0,u.push(["z"])),t&&e!==s-1||(o.push(l.concat(u)),l=[],u=[])}),r.forEachArray(o,function(t){n=n.concat(t)}),e!==!1&&(i=t.length-1,n.splice(i+1,0,n[i],n[i+1])),n=h.apply([],n),n[0]="M",n},_makeAreaChartPath:function(t,e,i){var n=this;return r.map(t,function(t){var o;return o={area:n._makeAreasPath(t,e),line:n._makeLinesPath(t,null,i)},n.hasRangeData&&(o.startLine=n._makeLinesPath(t,"startTop")),o})},_makeSplineAreaBottomPath:function(t){var e=this;return r.map(t,function(t){return["L",t.left,e.zeroTop]}).reverse()},_makeSplineAreaChartPath:function(t,e){var i=this;return r.map(t,function(t){var n,o=i._makeSplineLinesPath(t),r=JSON.parse(JSON.stringify(o)),a=i._makeSplineAreaBottomPath(t);return e!==!1&&(n=t[t.length-1],r.push(["L",n.left,n.top]),a.unshift(["L",n.left,i.zeroTop])),{area:r.concat(a),line:o}})},resize:function(t){var e=this,i=t.dimension,n=t.groupPositions;this.resizeClipRect(i.width,i.height),this.zeroTop=t.zeroTop,this.groupPositions=n,this.groupPaths=this._getAreaChartPath(n),this.paper.setSize(i.width,i.height),this.tooltipLine.attr({top:i.height}),r.forEachArray(this.groupPaths,function(t,i){var o=e.groupAreas[i];o.area.attr({path:t.area.join(" ")}),o.line.attr({path:t.line.join(" ")}),o.startLine&&o.startLine.attr({path:t.startLine.join(" ")}),r.forEachArray(e.groupDots[i],function(t,o){var a,s=n[i][o];t.endDot&&e._moveDot(t.endDot.dot,s),t.startDot&&(a=r.extend({},s),a.top=a.startTop,e._moveDot(t.startDot.dot,a))})})},selectLegend:function(t){var e=r.isNull(t);this.selectedLegendIndex&&this.selectedLegendIndex!==-1&&this.resetSeriesOrder(this.selectedLegendIndex),this.selectedLegendIndex=t,r.forEachArray(this.groupAreas,function(i,n){var o=t===n,h=e||o?a:s,l=this.groupDots[n];i.area.attr({"fill-opacity":h}),i.line.attr({"stroke-opacity":h}),i.startLine&&i.startLine.attr({"stroke-opacity":h}),r.forEachArray(l,function(t){this.dotOpacity&&(t.endDot.dot.attr({"fill-opacity":h}),t.startDot&&t.startDot.dot.attr({"fill-opacity":h}))},this),o&&this.moveSeriesToFront(i,l)},this)},resetSeriesOrder:function(t){var e=t+11)&&u.print(l,"warn"):r.isUndefined(t)||u.print(l,"error"),e}});t.exports=c},function(t,e){"use strict";t.exports={print:function(t,e){e=e||"log",window.console&&window.console[e](t)}}},function(t,e,i){"use strict";var n=i(5),o=i(6),r=i(3),a=180,s=360,h=.01,l=Math.PI/a,u=700,c=1,d=.3,p=.3,f=.2,m="overlay",g=20,_=o.defineClass({render:function(t,e,i){var n=t.set();return this.paper=t,this.holeRatio=e.options.radiusRange[0],this.chartBackground=e.chartBackground,this.chartType=e.chartType,this.callbacks=i,this.selectionColor=e.theme.selectionColor,this.circleBound=e.circleBound,this.sectorName="sector_"+this.chartType,this._setSectorAttr(),this.sectorInfos=this._renderPie(e.sectorData,e.theme.colors,e.additionalIndex,n),this.overlay=this._renderOverlay(),this.prevPosition=null,this.prevHoverSector=null,n},clear:function(){this.legendLines=null,this.paper.clear()},_makeSectorPath:function(t,e,i,n,o){var r=n*l,s=o*l,h=t+i*Math.sin(r),u=e-i*Math.cos(r),c=t+i*Math.sin(s),d=e-i*Math.cos(s),p=o-n>a?1:0,f=["M",t,e,"L",h,u,"A",i,i,0,p,1,c,d,"Z"];return{path:f}},_makeDonutSectorPath:function(t,e,i,n,o,r){var s=n*l,h=o*l,u=r||i*this.holeRatio,c=t+i*Math.sin(s),d=e-i*Math.cos(s),p=t+u*Math.sin(s),f=e-u*Math.cos(s),m=t+i*Math.sin(h),g=e-i*Math.cos(h),_=t+u*Math.sin(h),T=e-u*Math.cos(h),v=o-n>a?1:0,y=["M",c,d,"A",i,i,0,v,1,m,g,"L",_,T,"A",u,u,0,v,0,p,f,"Z"];return{path:y}},_setSectorAttr:function(){var t;this.paper.customAttributes[this.sectorName]||(t=this.holeRatio?this._makeDonutSectorPath:this._makeSectorPath,this.paper.customAttributes[this.sectorName]=o.bind(t,this))},_renderOverlay:function(){var t={paper:this.paper,circleBound:{cx:0,cy:0,r:0},angles:{startAngle:0,endAngle:0},attrs:{fill:"none",opacity:0,stroke:this.chartBackground.color,"stroke-width":1}},e=this._renderSector(t);return e.data("id",m),e.data("chartType",this.chartType),{inner:e,outer:this._renderSector(t)}},_renderSector:function(t){var e=t.circleBound,i=t.angles,n=t.attrs;return n[this.sectorName]=[e.cx,e.cy,e.r,i.startAngle,i.endAngle],t.paper.path().attr(n)},_renderPie:function(t,e,i,n){var r=this,a=this.circleBound,s=this.chartBackground,h=[];return o.forEachArray(t,function(t,o){var l=t.ratio,u=e[o],c=r._renderSector({paper:r.paper,circleBound:a,angles:t.angles.start,attrs:{fill:s.color,stroke:s.color,"stroke-width":1}});c.data("index",o),c.data("legendIndex",o+i),c.data("chartType",r.chartType),h.push({sector:c,color:u,angles:t.angles.end,ratio:l}),n.push(c)}),h},renderLegendLines:function(t){var e,i=this.paper;this.legendLines||(e=this._makeLinePaths(t),this.legendLines=o.map(e,function(t){return n.renderLine(i,t,"transparent",1)}))},_makeLinePaths:function(t){return o.map(t,function(t){return[n.makeLinePath(t.start,t.middle),n.makeLinePath(t.middle,t.end),"Z"].join("")})},_showOverlay:function(t,e){var i,n=this.overlay,o=this.sectorInfos[t],r=o.angles.startAngle,a=o.angles.endAngle,s=this.circleBound;i={fill:"#fff",opacity:d},i[this.sectorName]=[s.cx,s.cy,s.r,r,a,s.r*this.holeRatio],n.inner.attr(i),n.inner.data("index",t),n.inner.data("legendIndex",e),n.outer.attr({path:this._makeDonutSectorPath(s.cx,s.cy,s.r+10,r,a,s.r).path,fill:o.color,opacity:d})},_hideOverlay:function(){var t=this.overlay,e={fill:"none",opacity:0};t.inner.attr(e),t.outer.attr(e)},animate:function(t){var e=0,i=this.sectorName,n=this.circleBound,a=[n.cx,n.cy,n.r];o.forEachArray(this.sectorInfos,function(t){var n,o=t.angles,l={fill:t.color},c=u*t.ratio;0===o.startAngle&&o.endAngle===s&&(o.endAngle=s-h),l[i]=a.concat([o.startAngle,o.endAngle]),n=r.animation(l,c,">"),t.sector.animate(n.delay(e)),e+=c}),t&&setTimeout(t,e)},animateLegendLines:function(t){var e;this.legendLines&&(e=o.isNull(t),o.forEachArray(this.legendLines,function(i,n){var o=e||t===n?c:p;i.animate({stroke:"black","stroke-opacity":o})}))},resize:function(t){var e=t.dimension,i=t.circleBound,n=this.sectorName,r=this.labelSet;this.circleBound=i,this.paper.setSize(e.width,e.height),o.forEachArray(this.sectorInfos,function(t,e){var o,a=t.angles,s={};s[n]=[i.cx,i.cy,i.r,a.startAngle,a.endAngle],t.sector.attr(s),r&&r.length&&(o=t.sector.getBBox(),r[e].attr({x:o.x+o.width/2,y:o.y+o.height/2}))})},moveLegendLines:function(t){var e;this.legendLines&&(e=this._makeLinePaths(t),o.forEachArray(this.legendLines,function(t,i){return t.attr({path:e[i]}),t}))},findSectorInfo:function(t){var e=this.paper&&this.paper.getElementByPoint(t.left,t.top),i=null;return e&&(i={legendIndex:o.isExisty(e.data("legendIndex"))?e.data("legendIndex"):-1,index:o.isExisty(e.data("index"))?e.data("index"):-1,chartType:e.data("chartType")}),i},_isChangedPosition:function(t,e){return!t||t.left!==e.left||t.top!==e.top},_showTooltip:function(t,e){var i=[{},0,t.data("index"),{left:e.left-g,top:e.top-g}];this.callbacks.showTooltip.apply(null,i)},_isValidSector:function(t){return t&&t.data("chartType")===this.chartType},moveMouseOnSeries:function(t){var e=this.paper&&this.paper.getElementByPoint(t.left,t.top);this._isValidSector(e)?(this.prevHoverSector!==e&&(this._showOverlay(e.data("index"),e.data("legendIndex")),this.prevHoverSector=e),this._isChangedPosition(this.prevPosition,t)&&this._showTooltip(e,t)):this.prevHoverSector&&(this._hideOverlay(),this.callbacks.hideTooltip(),this.prevHoverSector=null),this.prevPosition=t},selectSeries:function(t){var e,i,o,a=this.sectorInfos[t.index];a&&(i=r.color(a.color),e=n.makeChangedLuminanceColor(i.hex,f),o=this.selectionColor||e,a.sector.attr({fill:o}))},unselectSeries:function(t){var e=this.sectorInfos[t.index];e&&e.sector.attr({fill:e.color})},selectLegend:function(t){var e=o.isNull(t),i=this.legendLines;o.forEachArray(this.sectorInfos,function(n,o){var r=e||t===o?c:p;n.sector.attr({"fill-opacity":r}),i&&i[o].attr({"stroke-opacity":r})})},getRenderedLabelWidth:function(t,e){return n.getRenderedTextSize(t,e.fontSize,e.fontFamily).width},getRenderedLabelHeight:function(t,e){return n.getRenderedTextSize(t,e.fontSize,e.fontFamily).height},renderLabels:function(t,e,i,r){var a=t.set(),s={"font-size":r.fontSize,"font-family":r.fontFamily,"font-weight":r.fontWeight,"text-anchor":"middle",fill:r.color,opacity:0};return o.forEach(e,function(e,o){var r;e&&(r=n.renderText(t,e,i[o],s),r.node.style.userSelect="none",r.node.style.cursor="default",r.node.setAttribute("filter","url(#glow)")),a.push(r)}),this.labelSet=a,a}});t.exports=_},function(t,e,i){"use strict";var n=i(15),o=i(5),r=i(6),a=1,s=.3,h=r.defineClass(n,{init:function(){this.selectedLegendIndex=null,this.chartType="radial",this.lineWidth=2},render:function(t,e){var i=e.dimension,n=e.groupPositions,o=e.theme,r=o.colors,a=e.options.showDot?1:0,s=e.options.showArea,h=this._getLinesPath(n),l=this.makeBorderStyle(o.borderColor,a),u=this.makeOutDotStyle(a,l),c=t.set(),d=this.lineWidth=e.options.pointWidth?e.options.pointWidth:this.lineWidth;return this.paper=t,this.theme=e.theme,this.dimension=i,this.position=e.position,s&&(this.groupAreas=this._renderArea(t,h,r,c)),this.groupLines=this._renderLines(t,h,r,d,c),this.groupDots=this._renderDots(t,n,r,a,c),e.options.allowSelect&&(this.selectionDot=this._makeSelectionDot(t),this.selectionColor=o.selectionColor),this.colors=r,this.borderStyle=l,this.outDotStyle=u,this.groupPositions=n,this.groupPaths=h,this.dotOpacity=a,c},_getLinesPath:function(t){var e=this;return r.map(t,function(t){return e._makeLinesPath(t)})},_renderLines:function(t,e,i,n,a){return r.map(e,function(e,r){var s=i[r]||"transparent",h=o.renderLine(t,e.join(" "),s,n);return a.push(h),h})},_renderArea:function(t,e,i,n){return r.map(e,function(e,r){var a=i[r]||"transparent",s=o.renderArea(t,e,{fill:a,opacity:.4,"stroke-width":0,stroke:a});return n.push(s),s})},resize:function(t){var e=this,i=t.dimension,n=t.groupPositions;this.groupPositions=n,this.groupPaths=this._getLinesPath(n),this.paper.setSize(i.width,i.height),r.forEachArray(this.groupPaths,function(t,i){e.groupLines[i].attr({path:t.join(" ")}),e.groupAreas[i].attr({path:t.join(" ")}),r.forEachArray(e.groupDots[i],function(t,o){e._moveDot(t.endDot.dot,n[i][o])})})},selectLegend:function(t){var e=this,i=r.isNull(t); +this.selectedLegendIndex=t,r.forEachArray(this.groupLines,function(n,o){var h=i||t===o?a:s;n.attr({"stroke-opacity":h}),r.forEachArray(e.groupDots[o],function(t){t.opacity=h,e.dotOpacity&&t.endDot.dot.attr({"fill-opacity":h})})})}});t.exports=h},function(t,e,i){"use strict";var n=i(5),o=i(6),r=i(3),a=700,s=.5,h=.3,l=.5,u=.3,c=.2,d=2,p=20,f=o.defineClass({render:function(t,e,i){var n=t.set();return this.paper=t,this.theme=e.theme,this.seriesDataModel=e.seriesDataModel,this.groupBounds=e.groupBounds,this.callbacks=i,this.overlay=this._renderOverlay(),this.groupCircleInfos=this._renderCircles(n),this.prevCircle=null,this.prevOverCircle=null,this.animationTimeoutId=null,n},_renderOverlay:function(){var t={left:0,top:0},e={fill:"none",stroke:"#fff","stroke-opacity":h,"stroke-width":2},i=n.renderCircle(this.paper,t,0,e);return i},_renderCircles:function(t){var e=this,i=this.theme.colors;return o.map(this.groupBounds,function(r,a){return o.map(r,function(o,r){var s,h,l=null;return o&&(s=i[r],h=n.renderCircle(e.paper,o,0,{fill:s,opacity:0,stroke:"none"}),t.push(h),h.data("groupIndex",a),h.data("index",r),l={circle:h,color:s,bound:o}),l})})},_animateCircle:function(t,e){t.animate({r:e,opacity:s},a,">")},animate:function(){var t=this;n.forEach2dArray(this.groupCircleInfos,function(e){e&&t._animateCircle(e.circle,e.bound.radius)})},_updatePosition:function(t,e){t.attr({cx:e.left,cy:e.top,r:e.radius})},resize:function(t){var e=this,i=t.dimension,o=t.groupBounds;this.groupBounds=o,this.paper.setSize(i.width,i.height),n.forEach2dArray(this.groupCircleInfos,function(t,i,n){var r=o[i][n];t&&(t.bound=r,e._updatePosition(t.circle,r))})},findIndexes:function(t){var e=this.paper.getElementByPoint(t.left,t.top),i=null;return e&&(i={index:e.data("index"),groupIndex:e.data("groupIndex")}),i},_isChangedPosition:function(t,e){return!t||t.left!==e.left||t.top!==e.top},showAnimation:function(t){var e=this.groupCircleInfos[t.groupIndex][t.index],i=e.bound;this.overlay.attr({cx:i.left,cy:i.top,r:i.radius+d,stroke:e.color,opacity:1})},hideAnimation:function(){this.overlay.attr({cx:0,cy:0,r:0,opacity:0})},_findCircle:function(t){for(var e,i,n=[],r=this.paper;o.isUndefined(e);)i=r.getElementByPoint(t.left,t.top),i?i.attrs.opacity>u?e=i:(n.push(i),i.hide()):e=null;return e||(e=n[0]),o.forEachArray(n,function(t){t.show()}),e},moveMouseOnSeries:function(t){var e,i,n,r=this._findCircle(t);r&&o.isExisty(r.data("groupIndex"))?(e=r.data("groupIndex"),i=r.data("index"),n=[{},e,i,{left:t.left-p,top:t.top-p}],this._isChangedPosition(this.prevPosition,t)&&(this.callbacks.showTooltip.apply(null,n),this.prevOverCircle=r)):this.prevOverCircle&&(this.callbacks.hideTooltip(),this.prevOverCircle=null),this.prevPosition=t},selectSeries:function(t){var e=t.groupIndex,i=t.index,o=this.groupCircleInfos[e][i],a=r.color(o.color),s=this.theme.selectionColor,h=s||n.makeChangedLuminanceColor(a.hex,c);o.circle.attr({fill:h})},unselectSeries:function(t){var e=t.groupIndex,i=t.index,n=this.groupCircleInfos[e][i];n.circle.attr({fill:n.color})},selectLegend:function(t){var e=o.isNull(t);n.forEach2dArray(this.groupCircleInfos,function(i,n,o){var r;i&&(r=e||t===o?l:u,i.circle.attr({opacity:r}))})}});t.exports=f},function(t,e,i){"use strict";var n=i(5),o=i(6),r=100,a=1,s=3,h=o.defineClass({render:function(t,e){var i=t.set();return this.paper=t,this.theme=e.theme||{},this.colorSpectrum=e.colorSpectrum,this.chartBackground=e.chartBackground,this.zoomable=e.zoomable,this.borderColor=this.theme.borderColor||"none",this.borderWidth=this.theme.borderWidth,this.groupBounds=e.groupBounds,this.boundMap=e.boundMap,this._bindGetBoundFunction(),this._bindGetColorFunction(),this.boxesSet=this._renderBoxes(e.seriesDataModel,e.startDepth,!!e.isPivot,i),i},_bindGetBoundFunction:function(){this.boundMap?this._getBound=this._getBoundFromBoundMap:this._getBound=this._getBoundFromGroupBounds},_bindGetColorFunction:function(){this.colorSpectrum?this._getColor=this._getColorFromSpectrum:this.zoomable?this._getColor=this._getColorFromColorsWhenZoomable:this._getColor=this._getColorFromColors},_getBoundFromGroupBounds:function(t){return this.groupBounds[t.groupIndex][t.index].end},_getBoundFromBoundMap:function(t){return this.boundMap[t.id]},_getColorFromSpectrum:function(t){var e;return e=t.hasChild?"none":this.colorSpectrum.getColor(t.colorRatio||t.ratio)||this.chartBackground},_getColorFromColors:function(t){return t.hasChild?"none":this.theme.colors[t.group]},_getColorFromColorsWhenZoomable:function(t,e){return t.depth===e?this.theme.colors[t.group]:"none"},_renderRect:function(t,e,i){return n.renderRect(this.paper,t,{fill:e,stroke:this.borderColor,"stroke-width":i})},_getStrokeWidth:function(t,e){var i;return i=this.borderWidth?this.borderWidth:o.isExisty(t)?Math.max(a,s-(t-e)):a},_renderBoxes:function(t,e,i,n){var o,r=this;return o=this.colorSpectrum||!this.zoomable?function(t){t.toBack()}:function(){},t.map(function(t,i){return t.map(function(t,a){var s,h,l=null,u=r._getStrokeWidth(t.depth,e);return t.groupIndex=i,t.index=a,s=r._getBound(t),s&&(h=r._getColor(t,e),l={rect:r._renderRect(s,h,u),seriesItem:t,color:h},o(l.rect),n&&n.push(l.rect)),l})},i)},_animateChangingColor:function(t,e,i){var n={"fill-opacity":o.isExisty(i)?i:1};e&&(n.fill=e),t.animate(n,r,">")},showAnimation:function(t,e,i){var n,r=this.boxesSet[t.groupIndex][t.index];r&&(e=!!o.isUndefined(e)||e,n=e?this.theme.overColor:r.color,r.seriesItem.hasChild&&(e&&r.rect.attr({"fill-opacity":0}),r.rect.toFront()),this._animateChangingColor(r.rect,n,i))},hideAnimation:function(t,e){var i,n,o=this.colorSpectrum,a=this.boxesSet[t.groupIndex][t.index],s=1;a&&(n=a.rect.paper,a.seriesItem.hasChild?(i=null,e&&(s=0)):i=a.color,this._animateChangingColor(a.rect,i,s),setTimeout(function(){!o&&a.seriesItem.hasChild&&(a.rect.toBack(),n.pushDownBackgroundToBottom())},r))},resize:function(t){var e=this,i=t.dimension;this.boundMap=t.boundMap,this.groupBounds=t.groupBounds,this.paper.setSize(i.width,i.height),n.forEach2dArray(this.boxesSet,function(t,i,o){var r;t&&(r=e._getBound(t.seriesItem,i,o),r&&n.updateRectBound(t.rect,r))})},renderSeriesLabel:function(t,e,i,r){var a=t.set(),s={"font-size":r.fontSize,"font-family":r.fontFamily,"font-weight":r.fontWeight,fill:r.color,opacity:0};return o.forEach(i,function(i,r){o.forEach(i,function(i,o){var h=n.renderText(t,e[r][o].end,i,s);h.node.style.userSelect="none",h.node.style.cursor="default",h.node.setAttribute("filter","url(#glow)"),a.push(h)})}),a},renderSeriesLabelForTreemap:function(t,e,i,r){var a=t.set(),s={"font-size":r.fontSize,"font-family":r.fontFamily,"font-weight":r.fontWeight,fill:r.color,opacity:0};return o.forEach(i,function(i,o){var r=n.renderText(t,e[o],i,s);r.node.style.userSelect="none",r.node.style.cursor="default",r.node.setAttribute("filter","url(#glow)"),a.push(r)}),a}});t.exports=h},function(t,e,i){"use strict";function n(t,e,i){var n=document.createElementNS("http://www.w3.org/2000/svg","g");return n.id=i,e.forEach(function(t){r.append(n,t.node)}),t.canvas.appendChild(n),n}var o=i(5),r=i(9),a=i(6),s=a.browser,h=s.msie&&s.version<=8,l="gray",u=100,c="tui-chart-series-group",d=a.defineClass({render:function(t,e){var i=e.mapModel.getMapDimension();this.ratio=this._getDimensionRatio(e.layout.dimension,i),this.dimension=e.layout.dimension,this.position=e.layout.position,this.paper=t,this.sectorSet=t.set(),this.sectors=this._renderMap(e,this.ratio),h||(this.g=n(t,this.sectorSet,c)),this.overColor=e.theme.overColor},_getDimensionRatio:function(t,e){return Math.min(t.height/e.height,t.width/e.width)},_renderMap:function(t,e){var i=this.sectorSet,n=t.layout.position,r=this.paper,s=t.colorSpectrum;return a.map(t.mapModel.getMapData(),function(t,a){var h=t.ratio||0,u=s.getColor(h),c=o.renderArea(r,t.path,{fill:u,opacity:1,stroke:l,"stroke-opacity":1,transform:"s"+e+","+e+",0,0t"+n.left/e+","+n.top/e});return c.data("index",a),i.push(c),{sector:c,color:u,ratio:t.ratio}})},findSectorIndex:function(t){var e=this.paper.getElementByPoint(t.left,t.top),i=e&&e.data("index"),n=!a.isUndefined(i)&&this.sectors[i];return n&&!a.isUndefined(n.ratio)?i:null},changeColor:function(t){var e=this.sectors[t];e.sector.animate({fill:this.overColor},u,">")},restoreColor:function(t){var e=this.sectors[t];e.sector.animate({fill:e.color},u,">")},scaleMapPaths:function(t,e,i,n,o){var r,a,s=this.g.transform.baseVal,h=this.paper.canvas.createSVGTransform(),l=this.paper.canvas.createSVGMatrix(),u=this.paper.raphael.matrix(),c=s.numberOfItems?s.getItem(0).matrix:{a:1,b:0,c:0,d:1,e:0,f:0},d=o.width-this.dimension.width,p=o.height-this.dimension.height,f=c.e/c.a,m=c.f/c.d,g=-d/c.a,_=-p/c.d;u.scale(t,t,e.left*i-f*t,e.top*i-m*t),r=u.e/u.a+f,a=u.f/u.d+m,r>=0?u.e=-f*u.a:r=0?u.f=-m*u.a:a<_&&(u.f=_-m),l.a=u.a,l.b=u.b,l.c=u.c,l.d=u.d,l.e=u.e,l.f=u.f,h.setMatrix(l),s.appendItem(h),s.initialize(s.consolidate())},moveMapPaths:function(t,e){var i,n,o,r,a=this.paper.canvas.createSVGMatrix(),s=this.paper.raphael.matrix(),h=this.g.transform.baseVal,l=this.paper.canvas.createSVGTransform(),u=e.width-this.dimension.width,c=e.height-this.dimension.height,d=h.numberOfItems?h.getItem(0).matrix:{a:1,b:0,c:0,d:1,e:0,f:0};s.translate(t.x,t.y),o=s.e/s.a,r=s.f/s.d,i=o+d.e/d.a,n=r+d.f/d.d,i>=0&&o>0?s.e=0:i<0&&i<-u/d.a&&o<0&&(s.e=0),n>=0&&r>0?s.f=0:n<0&&n<-c/d.d&&r<0&&(s.f=0),a.a=s.a,a.b=s.b,a.c=s.c,a.d=s.d,a.e=s.e,a.f=s.f,l.setMatrix(a),h.appendItem(l),h.initialize(h.consolidate())},renderSeriesLabels:function(t,e,i){var n={"font-size":i.fontSize,"font-family":i.fontFamily,"font-weight":i.fontWeight,fill:i.color,"text-anchor":"middle",opacity:0,transform:"s"+this.ratio+","+this.ratio+",0,0t"+this.position.left/this.ratio+","+this.position.top/this.ratio},r=t.set(),s=this;return a.forEach(e,function(e){var i=e.labelPosition,a=o.renderText(t,i,e.name||e.code,n);r.push(a),a.node.style.userSelect="none",a.node.style.cursor="default",a.node.setAttribute("filter","url(#glow)"),h||s.g.appendChild(a.node)}),r}});t.exports=d},function(t,e,i){"use strict";function n(){return r.LEGEND_ICON_WIDTH+r.LEGEND_LABEL_LEFT_PADDING}var o,r=i(8),a=i(5),s=i(10),h=i(6),l=.5;o=h.defineClass({init:function(){this._checkBoxWidth=0,this._checkBoxHeight=0,this._iconHeight=0,this._legendItemHeight=0,this._currentPageCount=1,this._showCheckbox=!0},_renderLegendItems:function(t){var e=this,i=r.LEGEND_LABEL_LEFT_PADDING,n=h.extend({},this.basePosition);h.forEach(t,function(t,o){var a=t.iconType,s=t.index,h=t.colorByPoint?"#aaa":t.theme.color,l=t.isUnselected,u=t.labelHeight,c=t.checkbox,d=n.left+e._calculateSingleLegendWidth(s,a),p=d>=e.paper.width;e.isHorizontal&&p&&(n.top+=e._legendItemHeight+r.LABEL_PADDING_TOP,n.left=e.basePosition.left),e._showCheckbox&&(e._renderCheckbox(n,{isChecked:c.checked,legendIndex:s,legendSet:e.legendSet}),n.left+=e._checkBoxWidth+i),e._renderIcon(n,{legendColor:h,iconType:a,labelHeight:u,isUnselected:l,legendIndex:s,legendSet:e.legendSet}),n.left+=r.LEGEND_ICON_WIDTH+i,e._renderLabel(n,{labelText:t.label,labelHeight:u,isUnselected:l,legendIndex:s,legendSet:e.legendSet}),e.isHorizontal?n.left+=e.labelWidths[o]+i:(n.left=e.basePosition.left,n.top+=e._legendItemHeight+r.LINE_MARGIN_TOP)})},_getLegendData:function(t,e){var i,n,o,a=this.basePosition.top,s=this.dimension.height,h=this.paper.height,l=t;return!this.isHorizontal&&s+2*a>h&&(i=h-2*a,this._legendItemHeight=Math.max(t[0].labelHeight,r.LEGEND_ICON_HEIGHT),n=this._legendItemHeight+r.LINE_MARGIN_TOP,o=Math.floor(i/n),l=t.slice((e-1)*o,e*o)),l},render:function(t){var e,i;return this.eventBus=t.eventBus,this.paper=t.paper,this.dimension=t.dimension,this.legendSet=this.paper.set(),this.labelWidths=t.labelWidths,this.labelTheme=t.labelTheme,this.basePosition=t.position,this.isHorizontal=t.isHorizontal,this.originalLegendData=t.legendData,this.originalLegendData.length&&(this._showCheckbox=h.isExisty(t.legendData[0].checkbox),this._setComponentDimensionsBaseOnLabelHeight(t.legendData[0].labelHeight),e=this._getLegendData(t.legendData,this._currentPageCount),this._renderLegendItems(e),!this.isHorizontal&&e&&e.length1&&(i._paginateLegendAreaTo("previous"),i._currentPageCount-=1)}),this.lowerButton.click(function(){i._currentPageCounti&&(n=i),n+r.LEGEND_LABEL_LEFT_PADDING})},getRenderedLabelHeight:function(t,e){return a.getRenderedTextSize(t,e.fontSize,e.fontFamily).height},_renderLabel:function(t,e){var i=this.eventBus,n=this.labelTheme,o={left:t.left,top:t.top+this._iconHeight/2},r={fill:n.color,"font-size":n.fontSize,"font-family":n.fontFamily,"font-weight":n.fontWeight,opacity:e.isUnselected?l:1,"text-anchor":"start"},s=a.renderText(this.paper,o,e.labelText,r);s.data("index",e.legendIndex),s.node.style.userSelect="none",s.node.style.cursor="pointer",e.legendSet.push(s),s.click(function(){i.fire("labelClicked",e.legendIndex)})},_renderCheckbox:function(t,e){var i,n=this,o=t.left,r=t.top+(this._legendItemHeight-this._checkBoxHeight)/2,a="M"+(.3*this._checkBoxWidth+o)+","+(.5*this._checkBoxHeight+r)+"L"+(.5*this._checkBoxWidth+o)+","+(.7*this._checkBoxHeight+r)+"L"+(.8*this._checkBoxWidth+o)+","+(.2*this._checkBoxHeight+r);i=this.paper.set(),i.push(this.paper.rect(o,r,this._checkBoxWidth,this._checkBoxHeight,2).attr({fill:"#fff"})),e.isChecked&&i.push(this.paper.path(a)),i.data("index",e.legendIndex),i.click(function(){n.eventBus.fire("checkboxClicked",e.legendIndex)}),i.forEach(function(t){e.legendSet.push(t)})},_renderIcon:function(t,e){var i,n,o=this;this.paper.setStart(),"line"===e.iconType?(n="M"+t.left+","+(t.top+this._legendItemHeight/2)+"H"+(t.left+r.LEGEND_ICON_WIDTH),i=a.renderLine(this.paper,n,e.legendColor,3),i.attr("stroke-opacity",e.isUnselected?l:1)):i=a.renderRect(this.paper,{left:t.left,top:t.top,width:r.LEGEND_ICON_WIDTH,height:this._iconHeight},{"stroke-width":0,fill:e.legendColor,opacity:e.isUnselected?l:1}),i.data("icon",e.iconType),i.data("index",e.legendIndex),i.click(function(){o.eventBus.fire("labelClicked",e.legendIndex)}),e.legendSet.push(i)},selectLegend:function(t,e){e.forEach(function(e){var i=e.data("index"),n="line"===e.data("icon")?"stroke-opacity":"opacity";h.isNull(i)||h.isUndefined(i)?e.attr(n,1):h.isUndefined(i)||(h.isNumber(t)&&i!==t?e.attr(n,l):e.attr(n,1))})},_getCheckboxWidth:function(){return this._showCheckbox?this._checkBoxWidth+r.LEGEND_LABEL_LEFT_PADDING:0},_getLabelWidth:function(t){var e;return e=t?this.labelWidths[t]||0:s.max(this.labelWidths)},_calculateLegendWidth:function(){return this._calculateSingleLegendWidth()},_calculateSingleLegendWidth:function(t){return r.LEGEND_AREA_PADDING+this._getCheckboxWidth()+n()+this._getLabelWidth(t)+r.LEGEND_AREA_PADDING},_setComponentDimensionsBaseOnLabelHeight:function(t){this._legendItemHeight=Math.max(t,r.LEGEND_ICON_HEIGHT),this._iconHeight=this._legendItemHeight,this._checkBoxWidth=this._checkBoxHeight=t}}),t.exports=o},function(t,e,i){"use strict";var n=i(5),o=i(8),r=i(6),a=o.LEGEND_AREA_PADDING,s=360,h=270,l=35,u=15,c=3,d=r.defineClass({render:function(t,e,i,n,o){var r;e.position.left+=2*a,e.position.top+=a,r=this._renderGradientBar(t,e,i,n),o.push(r),this.wedge=this._renderWedge(t,e.position),o.push(this.wedge),this.gradientBar=r},renderTicksAndLabels:function(t,e,i,o,a){r.forEach(i,function(i,s){var h=e.step*s,c=r.extend({},e.position),d="M";o?(c.left+=h,d+=c.left+","+(c.top-l)+"V"+(c.top-l+u)):(c.top+=h,d+=c.left-l+","+c.top+"H"+(c.left-l+u)),a.push(n.renderLine(t,d,"#ccc",1)),a.push(n.renderText(t,c,i))})},_renderGradientBar:function(t,e,i,o){var r,l,u,c=e.dimension.height,d=e.position.left;return o?(c-=a,r=s,this._makeWedghPath=this._makeHorizontalWedgePath):(r=h,this._makeWedghPath=this._makeVerticalWedgePath),u=r+"-"+i.start+"-"+i.end,l={left:d,top:e.position.top,width:e.dimension.width-a,height:c},n.renderRect(t,l,{fill:u,stroke:"none"})},_renderWedge:function(t,e){return t.path(this.verticalBasePath).attr({fill:"gray",stroke:"none",opacity:0,transform:"t"+e.left+","+e.top})},verticalBasePath:["M",16,6,"L",24,3,"L",24,9],_makeVerticalWedgePath:function(t){var e=this.verticalBasePath;return e[2]=t,e[5]=t-c,e[8]=t+c,e},horizontalBasePath:["M",5,16,"L",8,24,"L",2,24],_makeHorizontalWedgePath:function(t){var e=this.horizontalBasePath;return e[1]=t,e[4]=t+c,e[7]=t-c,e},showWedge:function(t){var e=this._makeWedghPath(t);this.wedge.attr({path:e,opacity:1})},hideWedge:function(){this.wedge.attr({opacity:0})},removeLocationURLFromFillAttribute:function(){var t=this.gradientBar,e=t.node.getAttribute("fill");this.locationURL=/url\('?([^#]+)#[^#]+'?\)/.exec(e)[1],t.node.setAttribute("fill",e.replace(this.locationURL,""))},restoreLocationURLToFillAttribute:function(){var t=this.gradientBar,e=t.node.getAttribute("fill");t.node.setAttribute("fill",e.replace("#",this.locationURL+"#"))}});t.exports=d},function(t,e,i){"use strict";var n=i(5),o=i(6),r=o.defineClass({render:function(t,e,i,r,a){var s=e.position.left+e.dimension.width/2,h=t.set();return o.forEachArray(r,function(o,r){var l=i*o,u=e.position.top+e.dimension.height-l,c=n.renderCircle(t,{left:s,top:u},l,{fill:"none",opacity:1,stroke:"#888","stroke-width":1});h.push(c),h.push(n.renderText(t,{left:s,top:u-l-5},a[r]))}),h}});t.exports=r},function(t,e,i){"use strict";var n=i(5),o=i(8),r=i(6),a=r.defineClass({render:function(t,e,i,r){var a=r.fontSize,s=r.fontFamily,h=n.getRenderedTextSize(e,a,s),l={left:t.width/2,top:(h.height+o.TITLE_PADDING)/2},u=t.set();return i&&(i.x?l.left+=i.x:i.y&&(l.top+=i.y)),u.push(n.renderText(t,l,e,{"font-family":r.fontFamily,"font-size":r.fontSize,"font-weight":r.fontWeight,fill:r.color,"text-anchor":"middle"})),u},resize:function(t,e){e.attr({x:t/2})}});t.exports=a},function(t,e,i){"use strict";function n(t,e){var i=h.getRenderedTextSize(t,e.fontSize,e.fontFamily);return i.height}function o(t){return!u.isExisty(t.rotateTitle)||t.rotateTitle===!0}function r(t,e,i){var n=t?e.height:e.width,o=t?i.top:i.left;return n/2+o}function a(t,e){e&&(e.x&&(t.left+=e.x),e.y&&(t.top+=e.y))}function s(t,e){var i="none";return t.isPositionRight?i="r90,"+e.left+","+e.top:t.isVertical&&o(t)&&(i="r-90,"+e.left+","+e.top),i}var h=i(5),l=4,u=i(6),c=u.defineClass({init:function(){this.ticks=[]},renderBackground:function(t,e,i,n){var o=n&&n.background||{},r=o.color||"#fff",a=o.opacity||1;return h.renderRect(t,{left:0,top:e.top,width:i.width+e.left-l,height:i.height},{fill:r,opacity:a,"stroke-width":0})},renderTitle:function(t,e){var i,n=e.theme,o={"dominant-baseline":"auto","font-family":n.fontFamily,"font-size":n.fontSize,"font-weight":n.fontWeight,fill:n.color,"text-anchor":"middle"},r=this.calculatePosition(t,e);o.transform=s(e.rotationInfo,r),i=h.renderText(t,r,e.text,o),i.node.style.userSelect="none",i.node.style.cursor="default",e.set.push(i)},renderLabel:function(t){var e,i=t.positionTopAndLeft,n=t.labelText,o=t.paper,r=t.isVertical,a=t.isPositionRight,s=t.theme,l={"dominant-baseline":"central","font-family":s.fontFamily,"font-size":s.fontSize,"font-weight":s.fontWeight,fill:s.color};a?l["text-anchor"]="start":r?l["text-anchor"]="end":l["text-anchor"]="middle",e=h.renderText(o,i,n,l),e.node.style.userSelect="none",e.node.style.cursor="default",t.set.push(e),this.ticks.push(e)},renderRotatedLabel:function(t){var e=t.positionTopAndLeft,i=t.labelText,n=t.paper,o=t.theme,r=h.renderText(n,e,i,{"dominant-baseline":"central","font-family":o.fontFamily,"font-size":o.fontSize,"font-weight":o.fontWeight,fill:o.color,"text-anchor":"end",transform:"r"+-t.degree+","+(e.left+20)+","+e.top});r.node.style.userSelect="none",r.node.style.cursor="arrow",t.set.push(r),this.ticks.push(r)},renderTicks:function(t){var e,i=this,n=t.paper,o=t.positions,r=t.additionalSize,a=t.isVertical,s=t.isCenter,h=t.isPositionRight,l=t.tickColor,c=t.layout,d=c.position.left+c.dimension.width,p=c.position.top,f=c.position.left,m=function(t){var e=a?"height":"width";return t>c.dimension[e]};u.forEach(o,function(o){var u="M";o+=r,m(o)||(a?s?(u+=f+","+(p+o),u+="H"+(f+5),u+="M"+d+","+(p+o),u+="H"+(d-5)):h?(u+=f+","+(p+o),u+="H"+(f+5)):(u+=d+","+(p+o),u+="H"+(d-5)):(u+=f+o+","+p,u+="V"+(p+5)),isNaN(o)||(e=n.path(u).attr({stroke:l}),t.set.push(e),i.ticks.push(e)))})},renderTickLine:function(t){var e,i,n,o=t.areaSize,r=o,a=t.paper,s=t.layout,h=t.isNotDividedXAxis,l=t.additionalSize,u=t.isPositionRight,c=t.isCenter,d=t.isVertical,p=t.tickColor,f="M",m=s.position.top,g=s.position.left,_=s.dimension.height+m,T=g+s.dimension.width;u?(f+=g+","+m,f+="V"+_):d?(e=m,f+=T+","+e,c?(f+="V"+_,f+="M"+g+","+e,f+="V"+_):(n=m+r,f+="V"+n)):(f+=h?g:g+l,f+=","+m+"H",i=g+r,h||(i+=l),f+=i),t.set.push(a.path(f).attr({"stroke-width":1,stroke:p}))},animateForAddingData:function(t){u.forEach(this.ticks,function(e){e.animate({transform:"t-"+t+",0"},300)})},calculatePosition:function(t,e){var i=e.rotationInfo,o=n(e.text,e.theme),s=e.layout,h=r(i.isVertical,s.dimension,s.position),l={};return i.isCenter?(l.top=t.height-o/2,l.left=s.position.left+s.dimension.width/2):i.isPositionRight?(l.top=h,l.left=s.position.left+s.dimension.width):i.isVertical?(l.top=h,l.left=s.position.left+o/2):(l.top=s.position.top+s.dimension.height,l.left=h),i.isCenter||a(l,e.offset),l}});t.exports=c},function(t,e,i){"use strict";var n=i(5),o=i(10),r=i(6),a=8,s=3,h=r.defineClass({render:function(t){var e=t.paper.set();return this.paper=t.paper,this.layout=t.layout,this.plotPositions=t.plotPositions,this.theme=t.theme,this.options=t.options,this.labelData=t.labelData,this._renderPlot(e),this._renderLabels(e),e.toBack(),this.paper.pushDownBackgroundToBottom(),e},_renderPlot:function(t){"circle"===this.options.type?this._renderCirclePlot(t):this._renderSpiderwebPlot(t),this._renderCatergoryLines(t)},_renderSpiderwebPlot:function(t){var e=this._getLinesPath(this.plotPositions);this._renderLines(e,this.theme.lineColor,t)},_renderCirclePlot:function(t){var e,i,o,r=this.plotPositions,a=r[0][0],s=this.theme.lineColor;for(e=1;e=r&&(a=0);return o},_setSeriesColors:function(t,e,i,n){var o,s,h,l=0;i=i||{},a.forEachArray(t,function(t){i[t]?(o=i[t].colors,h=!0):(o=i.colors||r.series.colors,h=!1),s=this._getSeriesThemeColorCount(n[t]),e[t].colors=this._makeEachSeriesColors(o,s,!h&&l),h||(l=(s+l)%o.length)},this)},_getSeriesThemeColorCount:function(t){var e=0;return t&&t.length&&(e=t.colorLength?t.colorLength:t[0]&&t[0].data&&t[0].data.length?Math.max(t.length,t[0].data.length):t.length),e},_initTheme:function(t,e,i,o){var a;return t!==n.DEFAULT_THEME_NAME?(a=JSON.parse(JSON.stringify(r)),this._overwriteTheme(e,a)):a=JSON.parse(JSON.stringify(e)),a.yAxis=this._createComponentThemeWithSeriesName(i,e.yAxis,a.yAxis,"yAxis"),a.series=this._createComponentThemeWithSeriesName(i,e.series,a.series,"series"),this._setSeriesColors(i,a.series,e.series,o),a},_createTargetThemesForFontInherit:function(t){var e=[t.title,t.xAxis.title,t.xAxis.label,t.legend.label,t.plot.label];return a.forEach(t.yAxis,function(t){e.push(t.title,t.label)}),a.forEach(t.series,function(t){e.push(t.label)}),e},_inheritThemeFont:function(t){var e=this._createTargetThemesForFontInherit(t),i=t.chart.fontFamily;a.forEachArray(e,function(t){t.fontFamily||(t.fontFamily=i)})},_copySeriesColorTheme:function(t,e,i){e[i]={colors:t.colors,borderColor:t.borderColor,selectionColor:t.selectionColor}},_copySeriesColorThemeToOther:function(t){var e=this;a.forEach(t.series,function(i,n){e._copySeriesColorTheme(i,t.legend,n),e._copySeriesColorTheme(i,t.tooltip,n)})},get:function(t,e,i){var n,o,r=s[t];if(!r)throw new Error("Not exist "+t+" theme.");return o=this._pickSeriesNames(e,i),n=this._initTheme(t,r,o,i),this._inheritThemeFont(n,o),this._copySeriesColorThemeToOther(n),n}}},function(t,e){"use strict";var i="#000000",n="#ffffff",o="normal",r="",a={tickColor:i, +title:{fontSize:12,fontFamily:r,color:i,fontWeight:o},label:{fontSize:12,fontFamily:r,color:i,fontWeight:o}},s={chart:{background:{color:n,opacity:1},fontFamily:"Verdana"},title:{fontSize:18,fontFamily:r,color:i,fontWeight:o},yAxis:a,xAxis:a,plot:{lineColor:"#dddddd",background:"#ffffff",label:{fontSize:11,fontFamily:r,color:"#888"}},series:{label:{fontSize:11,fontFamily:r,color:i,fontWeight:o},colors:["#ac4142","#d28445","#f4bf75","#90a959","#75b5aa","#6a9fb5","#aa759f","#8f5536"],borderColor:r,borderWidth:r,selectionColor:r,startColor:"#F4F4F4",endColor:"#345391",overColor:"#F0C952",dot:{fillColor:r,fillOpacity:1,strokeColor:r,strokeOpacity:1,strokeWidth:2,radius:2,hover:{fillColor:r,fillOpacity:1,strokeColor:r,strokeOpacity:.8,strokeWidth:3,radius:4}},ranges:[]},legend:{label:{fontSize:12,fontFamily:r,color:i,fontWeight:o}},tooltip:{},chartExportMenu:{backgroundColor:"#fff",borderRadius:0,borderWidth:1,color:"#000"}};t.exports=s},function(t,e){"use strict";var i={};t.exports={get:function(t){var e=i[t];if(!e)throw new Error("Not exist "+t+" map.");return e},register:function(t,e){i[t]=e}}},function(t,e,i){"use strict";var n=i(6),o=function(t){var e;return n.isArray(t)?(e=[],n.forEachArray(t,function(t,i){e[i]=o(t)})):n.isFunction(t)||n.isDate(t)?e=t:n.isObject(t)?(e={},n.forEach(t,function(t,i){e[i]=o(t)})):e=t,e},r={deepCopy:o};t.exports=r},function(t,e,i){"use strict";function n(t){var e;return t.length>0&&(e={},e.categories=[],e.series=[],e.categories=t.shift().slice(1),s.forEach(t,function(t){var i={};i.name=t[0],i.data=t.slice(1),e.series.push(i)})),e}function o(t){var e=[],i=[],n=[];return t&&(e=s.toArray(t.getElementsByTagName("TR")),s.forEach(e,function(t,e){var n=0===e?"TH":"TD",o=s.toArray(t.getElementsByTagName(n)),r=s.pluck(o,"innerText");i.push(r)}),i[0].length1,e=a.isYAxisAlignCenter(this.hasRightYAxis,t.yAxis.align),t.yAxis.isCenter=e,t.xAxis.divided=e,t.series.divided=e,t.plot.divided=e)},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("barSeries","barSeries"),this.componentManager.register("yAxis","axis"),this.componentManager.register("xAxis","axis"),this.hasRightYAxis&&this.componentManager.register("rightYAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},getScaleOption:function(){return{xAxis:!0}},onChangeCheckedLegends:function(t){var e;this.hasRightYAxis&&(e={optionChartTypes:["bar","bar"]}),n.prototype.onChangeCheckedLegends.call(this,t,null,e)},addDataRatios:function(t){var e=this.options.series||{},i=this.chartType,n=(e[i]||e).stackType;this.dataProcessor.addDataRatios(t[i],n,i)}});t.exports=h},function(t,e,i){"use strict";var n=i(8),o=i(43),r=i(101),a=i(31),s=i(9),h=i(7),l=i(112),u=i(11),c=i(6),d=c.defineClass({init:function(t){this.theme=t.theme,this._initializeOptions(t.options),this.chartType=this.options.chartType,this.hasAxes=t.hasAxes,this.isVertical=!!t.isVertical,this.dataProcessor=this._createDataProcessor(t),this.eventBus=new c.CustomEvents,this.prevXAxisData=null,this.componentManager=this._createComponentManager(),this.addComponents(),this._attachToEventBus()},_attachToEventBus:function(){this.eventBus.on("changeCheckedLegends",this.onChangeCheckedLegends,this),this.onZoom&&this.eventBus.on({zoom:this.onZoom,resetZoom:this.onResetZoom},this)},_setOffsetProperty:function(t,e,i){c.isExisty(t[e])&&(t.offset=t.offset||{},t.offset[i]=t[e],delete t[e])},_initializeOffset:function(t){t&&(this._setOffsetProperty(t,"offsetX","x"),this._setOffsetProperty(t,"offsetY","y"))},_initializeTitleOptions:function(t){var e,i=this;t&&(e=c.isArray(t)?t:[t],c.forEachArray(e,function(t){var e=t.title;c.isString(e)&&(t.title={text:e}),i._initializeOffset(t.title)}))},_initializeTooltipOptions:function(t){var e=t.position;t.grouped=!!t.grouped,this._initializeOffset(t),!t.offset&&e&&(t.offset={x:e.left,y:e.top}),delete t.position},_initializeOptions:function(t){t.chartTypes=this.charTypes,t.xAxis=t.xAxis||{},t.series=t.series||{},t.tooltip=t.tooltip||{},t.legend=t.legend||{},t.chartExportMenu=t.chartExportMenu||{},this._initializeTitleOptions(t.chart),this._initializeTitleOptions(t.xAxis),this._initializeTitleOptions(t.yAxis),c.isUndefined(t.legend.visible)&&(t.legend.visible=!0),c.isUndefined(t.chartExportMenu.visible)&&(t.chartExportMenu.visible=!0),this._initializeTooltipOptions(t.tooltip),this.options=t},_createDataProcessor:function(t){var e,i;return e=t.DataProcessor||r,i=new e(t.rawData,this.chartType,t.options,this.seriesTypes)},_createComponentManager:function(){return new o({options:this.options,theme:this.theme,dataProcessor:this.dataProcessor,hasAxes:this.hasAxes,eventBus:this.eventBus,isVertical:this.isVertical,seriesTypes:this.seriesTypes||[this.chartType]})},addComponents:function(){},getScaleOption:function(){},_buildBoundsAndScaleData:function(t,e){return l.build(this.dataProcessor,this.componentManager,{chartType:this.chartType,seriesTypes:this.seriesTypes,options:this.options,theme:this.theme,hasAxes:this.hasAxes,scaleOption:this.getScaleOption(),isVertical:this.isVertical,hasRightYAxis:this.hasRightYAxis,addedDataCount:this._dynamicDataHelper?this._dynamicDataHelper.addedDataCount:null,prevXAxisData:t,addingDataMode:e})},addDataRatios:function(){},readyForRender:function(t){var e=this._buildBoundsAndScaleData(this.prevXAxisData,t);return e.axisDataMap.xAxis&&(this.prevXAxisData=e.axisDataMap.xAxis),this.addDataRatios(e.limitMap),e},render:function(t){var e,i=s.create("DIV","tui-chart "+this.className),o=this.componentManager,r=this.dataProcessor,l=r.getLegendVisibility(),u=a.filterCheckedRawData(r.rawData,l),c=o.drawingToolPicker.getPaper(i,n.COMPONENT_TYPE_RAPHAEL);this.dataProcessor.initData(u),c.changeChartBackgroundColor(this.theme.chart.background.color),c.changeChartBackgroundOpacity(this.theme.chart.background.opacity),h.renderFontFamily(i,this.theme.chart.fontFamily),s.append(t,i),e=this.readyForRender(),h.renderDimension(i,e.dimensionMap.chart),o.render("render",e,{checkedLegends:l},i),this.chartContainer=i,this.paper=c},rerender:function(t,e){var i,n=this.dataProcessor;e||(e=a.filterCheckedRawData(n.getZoomedRawData(),t)),this.dataProcessor.initData(e),i=this.readyForRender(),this.componentManager.render("rerender",i,{checkedLegends:t},this.chartContainer)},onChangeCheckedLegends:function(t,e,i){this.rerender(t,e,i)},animateChart:function(){this.componentManager.execute("animateComponent")},on:function(t,e){n.PUBLIC_EVENT_MAP[t]&&this.eventBus.on(n.PUBLIC_EVENT_PREFIX+t,e)},off:function(t,e){n.PUBLIC_EVENT_MAP[t]&&this.eventBus.off(n.PUBLIC_EVENT_PREFIX+t,e)},_updateChartDimension:function(t){var e=!1,i=this.options;return i.chart=i.chart||{},t.width&&t.width>0&&i.chart.width!==t.width&&(i.chart.width=t.width,e=!0),t.height&&t.height>0&&i.chart.height!==t.height&&(i.chart.height=t.height,e=!0),e},resize:function(t){var e,i,n;t&&(e=this._updateChartDimension(t),e&&(i=this.readyForRender(),n=i.dimensionMap.chart,h.renderDimension(this.chartContainer,n),this.paper.resizeBackground(n.width,n.height),this.componentManager.render("resize",i)))},setTooltipAlign:function(t){this.componentManager.get("tooltip").setAlign(t)},setTooltipOffset:function(t){this.componentManager.get("tooltip").setOffset(t)},setTooltipPosition:function(t){this.componentManager.get("tooltip").setPosition(t)},resetTooltipAlign:function(){this.componentManager.get("tooltip").resetAlign()},resetTooltipOffset:function(){this.componentManager.get("tooltip").resetOffset()},resetTooltipPosition:function(){this.resetTooltipOffset()},showSeriesLabel:function(){var t=this.componentManager.where({componentType:"series"});c.forEachArray(t,function(t){t.showLabel()})},hideSeriesLabel:function(){var t=this.componentManager.where({componentType:"series"});c.forEachArray(t,function(t){t.hideLabel()})},addData:function(){},addPlotLine:function(){},addPlotBand:function(){},removePlotLine:function(){},removePlotBand:function(){},_getSeriesData:function(t,e,i){var n={index:t,seriesIndex:e,outlierIndex:i};return e<0?null:this.componentManager.get("mouseEventDetector").findDataByIndexes(n)},_findSeriesIndexByLabel:function(t,e){for(var i=this.dataProcessor.getLegendLabels(t),n=-1,o=0,r=i?i.length:0;o=0||!t&&e.prevFoundData)&&e._hideTooltip({silent:!0}))}});t.exports=d},function(t,e,i){"use strict";var n=i(8),o=i(9),r=i(44),a=i(46),s=i(47),h=i(48),l=i(50),u=i(38),c=i(56),d=i(58),p=i(59),f=i(60),m=i(66),g=i(68),_=i(69),T=i(73),v=i(80),y=i(84),x=i(85),A=i(87),D=i(88),E=i(89),C=i(91),L=i(92),S=i(93),P=i(94),M=i(95),b=i(97),R=i(98),k=i(99),I=i(6),w={axis:r,plot:a,radialPlot:h,legend:c,spectrumLegend:d,circleLegend:p,tooltip:f,groupTooltip:m,mapChartTooltip:g,mapChartEventDetector:_,mouseEventDetector:T,barSeries:v,columnSeries:y,lineSeries:x,radialSeries:A,areaSeries:D,bubbleSeries:E,scatterSeries:C,mapSeries:L,pieSeries:S,heatmapSeries:P,treemapSeries:M,boxplotSeries:b,bulletSeries:R,zoom:k,chartExportMenu:l,title:s},B=I.defineClass({init:function(t){var e=t.options.chart,i=I.pick(e,"width")||n.CHART_DEFAULT_WIDTH,o=I.pick(e,"height")||n.CHART_DEFAULT_HEIGHT;this.components=[],this.componentMap={},this.theme=t.theme||{},this.options=t.options||{},this.dataProcessor=t.dataProcessor,this.hasAxes=t.hasAxes,this.isVertical=t.isVertical,this.eventBus=t.eventBus,this.drawingToolPicker=new u,this.drawingToolPicker.initDimension({width:i,height:o}),this.seriesTypes=t.seriesTypes},_makeComponentOptions:function(t,e,i,n){return t=t||this.options[e],t=I.isArray(t)?t[n]:t||{}},register:function(t,e,i){var n,o,r,a,s;i=i||{},i.name=t,n=i.index||0,a=w[e],r=a.componentType,i.chartTheme=this.theme,i.chartOptions=this.options,i.seriesTypes=this.seriesTypes,s="axis"===r?t:r,i.theme=this.theme[s],i.options=this.options[s],i.theme||"rightYAxis"!==s||(i.theme=this.theme.yAxis),i.options||"rightYAxis"!==s||(i.options=this.options.yAxis),"series"===s&&I.forEach(this.seriesTypes,function(e){return 0!==t.indexOf(e)||(i.options=i.options[e]||i.options,i.theme=i.theme[e],I.isArray(i.options)&&(i.options=i.options[n]||{}),!1)}),i.dataProcessor=this.dataProcessor,i.hasAxes=this.hasAxes,i.isVertical=this.isVertical,i.eventBus=this.eventBus,i.alternativeModel=this.alternativeModel,o=a(i),o&&(o.componentName=t,o.componentType=r,this.components.push(o),this.componentMap[t]=o)},_makeDataForRendering:function(t,e,i,n,o){var r=I.extend({paper:i},o);return n&&(I.extend(r,n),r.layout={dimension:r.dimensionMap[t]||r.dimensionMap[e],position:r.positionMap[t]||r.positionMap[e]}),r},render:function(t,e,i,n){var r,a,s=this,h=I.map(this.components,function(o){var h,l,u,c=null;return o[t]&&(r=o.componentName,a=o.componentType,u=s.drawingToolPicker.getPaper(n,o.drawingType),h=s._makeDataForRendering(r,a,u,e,i),l=o[t](h),l&&!l.paper&&(c=l)),c});n&&o.append(n,h)},where:function(t){return I.filter(this.components,function(e){var i=!0;return I.forEach(t,function(t,n){return e[n]!==t&&(i=!1),i}),i})},execute:function(t){var e=Array.prototype.slice.call(arguments,1);I.forEachArray(this.components,function(i){i[t]&&i[t].apply(i,e)})},get:function(t){return this.componentMap[t]},has:function(t){return!!this.get(t)}});t.exports=B},function(t,e,i){"use strict";function n(t){var e=t.chartOptions.chartType,i=t.name;return t.isYAxis="yAxis"===i||"rightYAxis"===i,t.shifting=t.chartOptions.series.shifting,"combo"===e?t.isYAxis?t.theme=t.theme[t.seriesTypes[0]]:"rightYAxis"===i&&(t.componentType="yAxis",t.theme=t.theme[t.seriesTypes[1]],t.index=1):t.isYAxis?t.theme=t.theme[e]:t.theme=t.theme,new u(t)}var o=i(8),r=i(11),a=i(45),s=i(32),h=i(7),l=i(6),u=l.defineClass({init:function(t){this.className="tui-chart-axis-area",this.dataProcessor=t.dataProcessor,this.options=t.options||{},this.theme=l.extend({},t.theme,{background:t.chartTheme.chart.background}),this.isLabelAxis=!1,this.isYAxis=t.isYAxis,this.shifting=t.shifting,this.data={},this.layout=null,this.dimensionMap=null,this.axisDataMap=null,this.graphRenderer=s.get(o.COMPONENT_TYPE_RAPHAEL,"axis"),this.drawingType=o.COMPONENT_TYPE_RAPHAEL,this.paperAdditionalWidth=0,this.paperAdditionalHeight=0,this._elBg=null},_renderBackground:function(){var t=l.extend({},this.layout.dimension),e=l.extend({},this.layout.position);this.isYAxis&&(t.height=this.dimensionMap.chart.height,e.top=0),this._elBg&&this._elBg.remove(),this._elBg=this.graphRenderer.renderBackground(this.paper,e,t,this.theme.background)},_renderChildContainers:function(t,e,i,n){var o=this.isYAxis&&this.data.aligned;this.isYAxis&&!this.data.isPositionRight&&!this.options.isCenter&&this.shifting&&this._renderBackground(),this._renderTitleArea(),this.options.showLabel!==!1&&this._renderLabelArea(t,e,i,n),o||this._renderTickArea(t,e,n)},_renderDividedAxis:function(t){var e=this.data,i=Math.round(t.width/2),n=t.width-i-1,o=e.tickCount,r=parseInt(o/2,10)+1,a=e.labels,s=a.slice(0,r),h=a.slice(r-1,o),l=i/r,u=i+this.dimensionMap.yAxis.width-1;this.paperAdditionalWidth=l,this._renderChildContainers(i,r,s,0),this._renderChildContainers(n+1,r,h,u)},_renderNotDividedAxis:function(t){var e=this.data,i=this.isYAxis,n=i?t.height:t.width,o=0;e.positionRatio&&(o=n*e.positionRatio),this._renderChildContainers(n,e.tickCount,e.labels,o)},_renderAxisArea:function(){var t=this.layout.dimension,e=this.data;this.isLabelAxis=e.isLabelAxis,this.options.divided?(this.containerWidth=t.width+this.dimensionMap.yAxis.width,this._renderDividedAxis(t),t.width=this.containerWidth):(t.width+=this.options.isCenter?1:0,this._renderNotDividedAxis(t))},_setDataForRendering:function(t){this.layout=t.layout,this.dimensionMap=t.dimensionMap,this.data=t.axisDataMap[this.componentName],this.options=this.data.options},render:function(t){this.paper=t.paper,this.axisSet=t.paper.set(),this._setDataForRendering(t),this._renderAxisArea()},rerender:function(t){this.axisSet.remove(),this.render(t)},resize:function(t){this.rerender(t)},zoom:function(t){this.rerender(t)},_renderTitleArea:function(){var t=this.options.title||{};t.text&&this.graphRenderer.renderTitle(this.paper,{text:t.text,offset:t.offset,theme:this.theme.title,rotationInfo:{rotateTitle:this.options.rotateTitle,isVertical:this.isYAxis,isPositionRight:this.data.isPositionRight,isCenter:this.options.isCenter},layout:this.layout,set:this.axisSet})},_renderTickLine:function(t,e,i){this.graphRenderer.renderTickLine({areaSize:t,additionalSize:i,additionalWidth:this.paperAdditionalWidth,additionalHeight:this.paperAdditionalHeight,isPositionRight:this.data.isPositionRight,isCenter:this.data.options.isCenter,isNotDividedXAxis:e,isVertical:this.isYAxis,tickColor:this.theme.tickColor,layout:this.layout,paper:this.paper,set:this.axisSet})},_renderTicks:function(t,e,i,n){var o=this.theme.tickColor,r=this.data,s=r.sizeRatio||1,h=this.isYAxis,l=this.data.options.isCenter,u=this.data.isPositionRight,c=a.makeTickPixelPositions(t*s,e),d=this.paperAdditionalHeight+1,p=this.paperAdditionalWidth;c.length=r.tickCount,this.graphRenderer.renderTicks({paper:this.paper,layout:this.layout,positions:c,isVertical:h,isCenter:l,additionalSize:n,additionalWidth:p,additionalHeight:d,isPositionRight:u,tickColor:o,set:this.axisSet})},_renderTickArea:function(t,e,i){var n=!this.isYAxis&&!this.options.divided;this._renderTickLine(t,n,i||0),this._renderTicks(t,e,n,i||0)},_renderLabelArea:function(t,e,i,n){var o=this.data.sizeRatio||1,r=a.makeTickPixelPositions(t*o,e,0),s=r[1]-r[0];this._renderLabels(r,i,s,n||0)},_renderRotationLabels:function(t,e,i,n){var r=this,a=this.graphRenderer,s=this.isYAxis,h=this.theme.label,u=this.data.degree,c=i/2,d=this.layout.position.top+o.AXIS_LABEL_PADDING,p=this.layout.position.left,f=this.options.labelMargin||0;l.forEach(t,function(t,o){var l=t+(n||0),m={};s?(m.top=l+c,m.left=i+f):(m.top=d+f,m.left=p+l,r.isLabelAxis&&(m.left+=c)),a.renderRotatedLabel({degree:u,labelText:e[o],paper:r.paper,positionTopAndLeft:m,set:r.axisSet,theme:h})})},_renderNormalLabels:function(t,e,i,n){var a=this,s=this.graphRenderer,h=this.isYAxis,u=this.data.isPositionRight,c=this.isLabelAxis,d=this.theme.label,p=this.dataProcessor,f=r.isLineTypeChart(p.chartType,p.seriesTypes),m=f&&this.options.pointOnColumn,g=this.layout,_=this.options.labelMargin||0;l.forEach(t,function(t,r){var l,p,T=t+n,v=i/2,y={};T<0||(h?(l=T,c?l+=v+g.position.top:l=g.dimension.height+g.position.top-l,p=u?g.position.left+o.AXIS_LABEL_PADDING+_:g.position.left+g.dimension.width-o.AXIS_LABEL_PADDING-_):(l=g.position.top+o.CHART_PADDING+o.AXIS_LABEL_PADDING+_,p=T+g.position.left,c&&(f&&!m||(p+=v))),y.top=Math.round(l),y.left=Math.round(p),s.renderLabel({isPositionRight:u,isVertical:h,labelSize:i,labelText:e[r],paper:a.paper,positionTopAndLeft:y,set:a.axisSet,theme:d}))})},_renderLabels:function(t,e,i,n){var o,r=!this.isYAxis&&this.isLabelAxis&&this.options.rotateLabel===!1,a="xAxis"===this.componentName&&this.data.degree;o=r?this.data.multilineLabels:e,o.length&&(t.length=o.length),o=h.addPrefixSuffix(o,this.options.prefix,this.options.suffix),a?this._renderRotationLabels(t,o,i,n):this._renderNormalLabels(t,o,i,n)},animateForAddingData:function(t){this.isYAxis||this.graphRenderer.animateForAddingData(t.tickSize)}});n.componentType="axis",n.Axis=u,t.exports=n},function(t,e,i){"use strict";var n=i(6),o=i(10),r=100,a={calculateLimit:function(t,e){var i,n=0,o={};return t<0&&(n=t,e-=t,t=0),i=(e-t)/20,o.max=e+i+n,e/6>t?o.min=n:o.min=t-i+n,o},makeTickPixelPositions:function(t,e,i){var o=[];return i=i||0,e>0&&(o=n.map(n.range(0,e),function(n){var o=0===n?0:n/(e-1);return o*t+i}),o[o.length-1]-=1),o},makeLabelsFromLimit:function(t,e){var i=a.findMultipleNum(e),o=Math.round(t.min*i),r=Math.round(t.max*i),s=n.range(o,r+1,e*i);return n.map(s,function(t){return t/i})},calculateStepFromLimit:function(t,e){return a.divide(a.subtract(t.max,t.min),e-1)},sumPlusValues:function(t){var e=n.filter(t,function(t){return t>0});return a.sum(e)},sumMinusValues:function(t){var e=n.filter(t,function(t){return t<0});return a.sum(e)},makePercentageValue:function(t,e){return t/e*r},calculateRatio:function(t,e,i,n){return(t-i)/e*n}},s=function(t){var e=String(t).split(".");return 2===e.length?e[1].length:0},h=function(){var t=[].slice.call(arguments),e=n.map(t,function(t){return a.getDecimalLength(t)}),i=o.max(e);return Math.pow(10,i)},l=function(t,e){var i,n=a.findMultipleNum(e);return i=1===n?t%e:t*n%(e*n)/n},u=function(t,e){var i=a.findMultipleNum(t,e);return(t*i+e*i)/i},c=function(t,e){var i=a.findMultipleNum(t,e);return(t*i-e*i)/i},d=function(t,e){var i=a.findMultipleNum(t,e);return t*i*(e*i)/(i*i)},p=function(t,e){var i=a.findMultipleNum(t,e);return t*i/(e*i)},f=function(t){var e=t.slice();return e.unshift(0),n.reduce(e,function(t,e){return a.add(parseFloat(t),parseFloat(e))})};a.getDecimalLength=s,a.findMultipleNum=h,a.mod=l,a.add=u,a.subtract=c,a.multiply=d,a.divide=p,a.sum=f,t.exports=a},function(t,e,i){"use strict";function n(t,e){return t.start-e.start}function o(t){var e=t.chartOptions.chartType,i=t.seriesTypes,n=t.chartOptions.xAxis.type;return t.chartType=e,t.chartTypes=i,t.xAxisTypeOption=n,new u(t)}var r=i(8),a=i(11),s=i(45),h=i(6),l=h.map,u=h.defineClass({init:function(t){this.className="tui-chart-plot-area",this.dataProcessor=t.dataProcessor,this.options=t.options||{},this.options.showLine=!!h.isUndefined(this.options.showLine)||this.options.showLine,this.options.lines=this.options.lines||[],this.options.bands=this.options.bands||[],this.xAxisTypeOption=t.xAxisTypeOption,this.theme=t.theme||{},this.chartType=t.chartType,this.chartTypes=t.chartTypes,this.layout=null,this.axisDataMap=null,this.drawingType=r.COMPONENT_TYPE_RAPHAEL},_renderPlotArea:function(t){var e;e=this.layout.dimension,a.isLineTypeChart(this.chartType,this.chartTypes)&&this._renderOptionalLines(t,e),this.options.showLine&&this._renderPlotLines(t,e)},_setDataForRendering:function(t){t&&(this.layout=t.layout,this.dimensionMap=t.dimensionMap,this.axisDataMap=t.axisDataMap,this.paper=t.paper)},render:function(t){var e=t&&t.paper||this.paper;this.plotSet=e.set(),this.additionalPlotSet=e.set(),this._setDataForRendering(t),this._renderPlotArea(this.paper),this.additionalPlotSet.toBack(),this.plotSet.toBack(),e.pushDownBackgroundToBottom()},rerender:function(t){this.additionalPlotSet.remove(),this.plotSet.remove(),this.render(t)},resize:function(t){this.rerender(t)},zoom:function(t){this.rerender(t)},_makeVerticalLineTemplateParams:function(t){return h.extend({className:"vertical",positionType:"left",width:"1px"},t)},_makeHorizontalLineTemplateParams:function(t){return h.extend({className:"horizontal",positionType:"bottom",height:"1px"},t)},_renderLine:function(t,e){var i=this.layout.position.top,n=this.layout.dimension.height,o="M"+t+","+i+"V"+(i+n),r=this.paper.path(o);return r.attr({opacity:e.opacity||1,stroke:e.color}),this.additionalPlotSet.push(r),r},_renderBand:function(t,e,i){var n=this.layout.position,o=this.layout.dimension,r=o.width-t+n.left,a=e<0?r:e,s=this.paper.rect(t,n.top,a,o.height);return s.attr({fill:i.color,opacity:i.opacity||1,stroke:i.color}),this.additionalPlotSet.push(s),s},_createOptionalLineValueRange:function(t){var e=t.range||[t.value];return a.isDatetimeType(this.xAxisTypeOption)&&(e=l(e,function(t){var e=new Date(t);return e.getTime()||t})),e},_createOptionalLinePosition:function(t,e,i){var n=(i-t.dataMin)/t.distance,o=n*e;return 1===n&&(o-=1),o<0&&(o=null),o},_createOptionalLinePositionWhenLabelAxis:function(t,e){var i,n=this.dataProcessor,o=n.findCategoryIndex(e),r=null;return h.isNull(o)||(i=0===o?0:o/(n.getCategoryCount()-1),r=i*t),1===i&&(r-=1),r},_createOptionalLinePositionMap:function(t,e,i){var n,o,r=this.dataProcessor.getCategories(),a=this._createOptionalLineValueRange(t);return e.isLabelAxis?(n=this._createOptionalLinePositionWhenLabelAxis(i,a[0]),o=this._createOptionalLinePositionWhenLabelAxis(i,a[1])):(n=this._createOptionalLinePosition(e,i,a[0]),o=a[1]&&this._createOptionalLinePosition(e,i,a[1])),h.isNull(n)&&(n=this._isBeforeVisibleCategories(a[0],r[0])?0:-1),h.isNull(o)&&(o=this._isAfterVisibleCatgories(a[1],r[r.length-1])?i:-1),{start:n,end:o}},_isBeforeVisibleCategories:function(t,e){var i,n,o=this.dataProcessor;return!!h.isExisty(t)&&(a.isDatetimeType(this.xAxisTypeOption)?t=0&&ie:(i=o.findAbsoluteCategoryIndex(t),n=o.findAbsoluteCategoryIndex(e),i>=0&&i>n))},_renderOptionalLine:function(t,e,i,n){var o,r=this._createOptionalLinePositionMap(n,t,e);return r.start>=0&&r.start<=e&&(i.width=1,i.color=n.color||"transparent",i.opacity=n.opacity,o=this._renderLine(r.start+this.layout.position.left,i)),o},_makeOptionalBand:function(t,e,i,o){var r,a=o.range;return a&&a.length&&this._makeRangeTo2DArray(o),r=l(o.range,function(i){return this._createOptionalLinePositionMap({range:i},t,e)},this),o.mergeOverlappingRanges&&(r.sort(n),r=this._mergeOverlappingPositionMaps(r)),l(r,function(t){var n,r,a=t.start>=0&&t.start<=e;return a&&t.end>=0&&(i.color=o.color||"transparent",i.opacity=o.opacity,n=t.end-t.start,r=this._renderBand(t.start+this.layout.position.left,n,i)),r},this)},_makeOptionalLines:function(t,e){var i=e.width,n=this.axisDataMap.xAxis,o=this._makeVerticalLineTemplateParams({height:e.height+"px"}),r=h.bind(this._renderOptionalLine,this,n,i,o);return l(t,r)},_makeOptionalBands:function(t,e){var i=e.width,n=this.axisDataMap.xAxis,o=this._makeVerticalLineTemplateParams({height:e.height+"px"}),r=h.bind(this._makeOptionalBand,this,n,i,o);return l(t,r)},_renderOptionalLines:function(t,e){var i=[];i.concat(this._makeOptionalBands(this.options.bands,e)),i.concat(this._makeOptionalLines(this.options.lines,e)),this.optionalLines=i},_renderVerticalLines:function(t,e){var i=this._makeHorizontalPositions(t.width),n=this,o=this.layout,r=o.position.left,a=o.position.top;h.forEach(i,function(t){var i="M"+(t+r)+","+a+"V"+(a+o.dimension.height),s=n.paper.path(i);s.attr({stroke:e,"stroke-width":1}),n.plotSet.push(s)})},_renderHorizontalLines:function(t,e){var i=this._makeVerticalPositions(t.height),n=this,o=this.layout,r=o.position.left,a=o.position.top,s=i[1]-i[0];h.forEach(i,function(t,i){var h="M"+r+","+(s*i+a)+"H"+(r+o.dimension.width),l=n.paper.path(h);l.attr({stroke:e,"stroke-width":1}),n.plotSet.push(l)})},_renderPlotLines:function(t,e){var i=this.theme;a.isLineTypeChart(this.chartType)||this._renderVerticalLines(e,i.lineColor),this._renderHorizontalLines(e,i.lineColor)},_makeVerticalPositions:function(t){var e=this.axisDataMap,i=e.yAxis||e.rightYAxis,n=s.makeTickPixelPositions(t,i.validTickCount);return n.shift(),n},_makeDividedPlotPositions:function(t,e){var i,n,o,r,a=this.dimensionMap.yAxis.width;return e=parseInt(e/2,10)+1,t-=a,i=Math.round(t/2),n=t-i,o=s.makeTickPixelPositions(i,e),r=s.makeTickPixelPositions(n,e,i+a),o.pop(),r.shift(),o.concat(r)},_makeHorizontalPositions:function(t){var e,i=this.axisDataMap.xAxis.validTickCount;return this.options.divided?e=this._makeDividedPlotPositions(t,i):(e=s.makeTickPixelPositions(t,i),e.shift()),e},addPlotLine:function(t){this.options.lines.push(t),this.rerender()},addPlotBand:function(t){this.options.bands.push(t),this.rerender()},removePlotLine:function(t){this.options.lines=h.filter(this.options.lines,function(e){return e.id!==t}),this.rerender()},removePlotBand:function(t){this.options.bands=h.filter(this.options.bands,function(e){return e.id!==t}),this.rerender()},animateForAddingData:function(t){var e=this;this.dataProcessor.isCoordinateType()||t.shifting&&h.forEach(this.optionalLines,function(i){var n=i.getBBox();n.x-t.tickSize0&&r<180?"end":r>180&&r<360?"start":"middle",f.push({left:i.x,top:h-i.y,anchor:e});return f}function r(t){return new u(t)}var a=i(49),s=i(8),h=i(32),l=i(6),u=l.defineClass({className:"tui-chart-plot-area",init:function(t){this.options=l.extend({type:"spiderweb"},t.options),this.theme=t.theme||{},this.graphRenderer=h.get(s.COMPONENT_TYPE_RAPHAEL,"radialPlot"),this.drawingType=s.COMPONENT_TYPE_RAPHAEL},_renderPlotArea:function(t,e,i,n){var o={paper:t,layout:e,plotPositions:i,labelData:n,theme:this.theme,options:this.options};return this.graphRenderer.render(o)},_makePositions:function(t,e){var i=e.dimension.width-s.RADIAL_PLOT_PADDING-s.RADIAL_MARGIN_FOR_CATEGORY,o=e.dimension.height-s.RADIAL_PLOT_PADDING-s.RADIAL_MARGIN_FOR_CATEGORY,r=i/2+s.RADIAL_PLOT_PADDING/2+s.RADIAL_MARGIN_FOR_CATEGORY/2+e.position.left,a=o/2-s.RADIAL_PLOT_PADDING/2-s.RADIAL_MARGIN_FOR_CATEGORY/2-e.position.top,h=t.yAxis.tickCount,l=t.xAxis.labels.length;return n({width:i,height:o,centerX:r,centerY:a,angleStepCount:l,stepCount:h})},_makeCategoryPositions:function(t,e){var i=e.dimension.width-s.RADIAL_PLOT_PADDING-s.RADIAL_CATEGORY_PADDING,n=e.dimension.height-s.RADIAL_PLOT_PADDING-s.RADIAL_CATEGORY_PADDING,r=i/2+s.RADIAL_PLOT_PADDING/2+s.RADIAL_CATEGORY_PADDING/2+e.position.left,a=n/2-s.RADIAL_PLOT_PADDING/2-s.RADIAL_CATEGORY_PADDING/2-e.position.top,h=t.xAxis.labels.length;return o({width:i,height:n,centerX:r,centerY:a,angleStepCount:h})},_makeLabelData:function(t,e,i){var n,o,r=t.xAxis.labels,a=t.yAxis.labels,s=this._makeCategoryPositions(t,e),h=[],l=[];for(n=0;n0?t[o][0]:"")+"~"+(t[o].length>1?t[o][1]:"")),n.push(i);return n}function a(t,e){for(var i,n=[],o=0;o",m.forEach(t,function(t,o){var r=0!==i||0===o?' class="number"':"",a="<"+n+r+">"+t+"";e+=a}),e+=""}),e+=""}function c(t){var e=''+u(t)+"";return window.btoa(unescape(encodeURIComponent(e)))}function d(t,e){var i="",n=e&&e.lineDelimiter||"\n",o=e&&e.itemDelimiter||",",r=t.length-1;return m.forEachArray(t,function(t,e){var a=t.length-1;m.forEachArray(t,function(t,e){var n=m.isNumber(t)?t:'"'+t+'"';i+=n,e0?(this.legendModel.updateCheckedLegendsWith(e),this._checkLegend()):this.legendModel.toggleCheckedIndex(t)},_labelClick:function(t){this._selectLegend(t)},_listenEvents:function(){this.eventBus.on("checkboxClicked",this._checkboxClick,this),this.eventBus.on("labelClicked",this._labelClick,this)}});l.CustomEvents.mixin(c),n.componentType="legend",n.Legend=c,t.exports=n},function(t,e,i){"use strict";var n=i(6),o=Array.prototype.concat,r=n.forEachArray,a=n.defineClass({init:function(t){this.theme=t.theme,this.labels=t.labels,this.legendData=t.legendData,this.seriesTypes=t.seriesTypes||[],this.chartType=t.chartType,this.data=null,this.selectedIndex=null,this.checkedIndexesMap={},this.checkedWholeIndexes=[],this._setData(),this._initCheckedIndexes()},_initCheckedIndexes:function(){var t=this,e=[];r(this.legendData,function(i,n){i.visible&&e.push(n),t.checkedWholeIndexes[n]=i.visible}),this.updateCheckedLegendsWith(e)},_setThemeToLegendData:function(t,e,i){var o=0;r(t,function(t,r){var a={color:e.colors[r]};e.borderColor&&(a.borderColor=e.borderColor),t.theme=a,t.index=r,i&&n.isUndefined(i[r])?t.seriesIndex=-1:(t.seriesIndex=o,o+=1)})},_setData:function(){var t,e,i=this,r=this.theme,a=this.chartType,s=this.seriesTypes,h=this.legendData,l=this.checkedIndexesMap;!s||s.length<2?(this._setThemeToLegendData(h,r[a],l[a]),t=h):(e=0,t=o.apply([],n.map(s,function(t){var n,o,a=i.labels[t].length,s=e+a;return n=h.slice(e,s),o=l[t],e=s,i._setThemeToLegendData(n,r[t],o),n}))),this.data=t},getData:function(){return this.data},getDatum:function(t){return this.data[t]},getDatumByLabel:function(t){var e=null;return r(this.data,function(i){return i.label===t&&(e=i),!e}),e},getSelectedDatum:function(){return this.getDatum(this.selectedIndex)},updateSelectedIndex:function(t){this.selectedIndex=t},toggleSelectedIndex:function(t){var e;e=this.selectedIndex===t?null:t,this.updateSelectedIndex(e)},getSelectedIndex:function(){return this.selectedIndex},isUnselectedIndex:function(t){return!n.isNull(this.selectedIndex)&&this.selectedIndex!==t},isCheckedSelectedIndex:function(){return this.isCheckedIndex(this.selectedIndex)},toggleCheckedIndex:function(t){this.checkedWholeIndexes[t]=!this.checkedWholeIndexes[t]},_updateCheckedIndex:function(t){this.checkedWholeIndexes[t]=!0},isCheckedIndex:function(t){return!!this.checkedWholeIndexes[t]},_addSendingDatum:function(t){var e=this.getDatum(t);this.checkedIndexesMap[e.chartType]||(this.checkedIndexesMap[e.chartType]=[]),this.checkedIndexesMap[e.chartType][e.index]=!0},checkSelectedIndex:function(){this._updateCheckedIndex(this.selectedIndex),this._addSendingDatum(this.selectedIndex),this._setData()},getCheckedIndexes:function(){return this.checkedIndexesMap},_resetCheckedData:function(){this.checkedWholeIndexes=[],this.checkedIndexesMap={}},updateCheckedLegendsWith:function(t){var e=this;this._resetCheckedData(),r(t,function(t){e._updateCheckedIndex(t),e._addSendingDatum(t)}),this._setData()}});t.exports=a},function(t,e,i){"use strict";function n(t){var e=!!s.isUndefined(t.options.visible)||t.options.visible,i=t.chartOptions.chartType,n=null;return e&&(t.chartType=i,n=new h(t)),n}var o=i(8),r=i(11),a=i(32),s=i(6),h=s.defineClass({init:function(t){var e=t.libType;this.chartType=t.chartType,this.theme=t.theme,this.options=t.options||{},this.dataProcessor=t.dataProcessor,this.colorSpectrum=t.colorSpectrum,this.eventBus=t.eventBus,this.graphRenderer=a.get(e,"mapLegend"),this.isHorizontal=r.isHorizontalLegend(this.options.align),this.scaleData=null,this.drawingType=o.COMPONENT_TYPE_RAPHAEL,this._attachToEventBus()},_attachToEventBus:function(){this.eventBus.on({showWedge:this.onShowWedge,hideTooltip:this.onHideWedge},this),this.eventBus.on("beforeImageDownload",s.bind(this._removeLocationURLFromFillAttribute,this)),this.eventBus.on("afterImageDownload",s.bind(this._restoreLocationURLToFillAttribute,this))},_removeLocationURLFromFillAttribute:function(){this.graphRenderer.removeLocationURLFromFillAttribute()},_restoreLocationURLToFillAttribute:function(){this.graphRenderer.restoreLocationURLToFillAttribute()},_makeBaseDataToMakeTickArea:function(){var t=this.layout.dimension,e=this.scaleData,i=e.stepCount||e.tickCount-1,n={};return n.position=this.layout.position,this.isHorizontal?(n.step=t.width/i,n.position.top+=o.MAP_LEGEND_GRAPH_SIZE+o.MAP_LEGEND_LABEL_PADDING):(n.step=t.height/i,n.position.left+=o.MAP_LEGEND_GRAPH_SIZE+o.MAP_LEGEND_LABEL_PADDING),n},_renderTickArea:function(t){this.options.reversed&&this.scaleData.labels.sort(function(t,e){return e-t}),this.graphRenderer.renderTicksAndLabels(this.paper,this._makeBaseDataToMakeTickArea(),this.scaleData.labels,this.isHorizontal,t)},_makeVerticalGraphDimension:function(){return{width:o.MAP_LEGEND_GRAPH_SIZE,height:this.layout.dimension.height}},_makeHorizontalGraphDimension:function(){return{width:this.layout.dimension.width+10,height:o.MAP_LEGEND_GRAPH_SIZE}},_renderGraph:function(t){var e,i;e=this.isHorizontal?this._makeHorizontalGraphDimension():this._makeVerticalGraphDimension(),this.options.reversed&&(i=this.colorSpectrum.start,this.colorSpectrum.start=this.colorSpectrum.end,this.colorSpectrum.end=i),this.graphRenderer.render(this.paper,{dimension:e,position:this.layout.position},this.colorSpectrum,this.isHorizontal,t)},_renderLegendArea:function(){var t=this.paper.set();return this._renderGraph(t),this._renderTickArea(t),t},_setDataForRendering:function(t){this.layout=t.layout,this.paper=t.paper,this.scaleData=t.legendScaleData},render:function(t){this._setDataForRendering(t),this.legnedSet=this._renderLegendArea()},rerender:function(t){this.legnedSet.remove(),this.render(t)},resize:function(t){this.rerender(t)},onShowWedge:function(t){t=this.options.reversed?1-t:t,this.graphRenderer.showWedge(o.MAP_LEGEND_SIZE*t)},onHideWedge:function(){this.graphRenderer.hideWedge()}});n.componentType="legend",n.SpectrumLegend=h,t.exports=n},function(t,e,i){"use strict";function n(t){var e,i=t.chartOptions.chartType,n=t.chartTheme,o=h.pick(t.chartOptions,"circleLegend","visible"),r=null;return e=!!h.isUndefined(o)||o,e&&(t.chartType=i,t.baseFontFamily=n.chart.fontFamily,r=new l(t)),r}var o=i(8),r=i(45),a=i(7),s=i(32),h=i(6),l=h.defineClass({circleRatios:[1,.5,.25],init:function(t){var e=t.libType;this.chartType=t.chartType,this.dataProcessor=t.dataProcessor,this.labelTheme={fontSize:o.CIRCLE_LEGEND_LABEL_FONT_SIZE,fontFamily:t.baseFontFamily},this.graphRenderer=s.get(e,"circleLegend"),this.layout=null,this.maxRadius=null,this.drawingType=o.COMPONENT_TYPE_RAPHAEL},_formatLabel:function(t,e){var i,n=this.dataProcessor.getFormatFunctions();return i=0===e?String(parseInt(t,10)):a.formatToDecimal(String(t),e),a.formatValue({value:i,formatFunctions:n,chartType:this.chartType,areaType:"circleLegend",valueType:"r"})},_makeLabels:function(){var t=this,e=this.dataProcessor.getMaxValue(this.chartType,"r"),i=r.getDecimalLength(e);return h.map(this.circleRatios,function(n){return t._formatLabel(e*n,i)})},_render:function(t){return this.graphRenderer.render(t,this.layout,this.maxRadius,this.circleRatios,this._makeLabels())},_setDataForRendering:function(t){this.layout=t.layout,this.maxRadius=t.maxRadius},render:function(t){this._setDataForRendering(t),this.circleLegendSet=this._render(t.paper)},rerender:function(t){this.circleLegendSet.remove(),this._setDataForRendering(t),this.circleLegendSet=this._render(t.paper)},resize:function(t){this.rerender(t)}});n.componentType="legend",n.CircleLegend=l,t.exports=n},function(t,e,i){"use strict";function n(t,e,i){var n,o=(100*t.ratio).toFixed(4),r=parseFloat(o),a=r<9e-4||o.length>5;return o=a?o.substr(0,4):String(r),n=o+" % "||"",e.ratioLabel=i+n,e.label=t.tooltipLabel||(t.label?t.label:""),e}function o(t){var e,i=t.chartOptions.chartType,o=t.seriesTypes,u=t.chartOptions.xAxis,c=[];return l.forEach(l.filter(t.chartTheme.legend,function(t){return l.isArray(t.colors)}),function(t){c=c.concat(t.colors)}),e="map"===i?s:t.options.grouped?a:r,("pie"===i||h.isPieDonutComboChart(i,o))&&(t.labelFormatter=n),t.chartType=i,t.chartTypes=o,t.xAxisType=u.type,t.dateFormat=u.dateFormat,t.colors=c,e(t)}var r=i(61),a=i(66),s=i(68),h=i(11),l=i(6);o.componentType="tooltip",t.exports=o},function(t,e,i){"use strict";function n(t){return new u(t)}var o=i(62),r=i(63),a=i(8),s=i(11),h=i(64),l=i(6),u=l.defineClass(o,{init:function(){o.apply(this,arguments)},_makeTooltipHtml:function(t,e){var i=this._getTooltipTemplate(e);return i(l.extend({categoryVisible:t?"show":"hide",category:t},e))},_getTooltipTemplate:function(t){var e=h.tplDefault;return s.isBoxplotChart(this.chartType)?e=this._getBoxplotTooltipTemplate(t):s.isPieChart(this.chartType)||s.isPieDonutComboChart(this.chartType,this.chartTypes)?e=h.tplPieChart:this.dataProcessor.coordinateType?e=h.tplCoordinatetypeChart:s.isBulletChart(this.chartType)&&(e=h.tplBulletChartDefault),e},_getBoxplotTooltipTemplate:function(t){var e=h.tplBoxplotChartDefault;return l.isNumber(t.outlierIndex)&&(e=h.tplBoxplotChartOutlier,t.label=t.outliers[t.outlierIndex].label),e},_makeHtmlForValueTypes:function(t,e){return l.map(e,function(e){return t[e]?"
"+e+": "+t[e]+"
":""}).join("")},_makeSingleTooltipHtml:function(t,e){var i=e.groupIndex,n=l.extend({},l.pick(this.data,t,e.groupIndex,e.index));return s.isBoxplotChart(this.chartType)&&l.isNumber(e.outlierIndex)&&(n.outlierIndex=e.outlierIndex),n=l.extend({suffix:this.suffix},n),n.valueTypes=this._makeHtmlForValueTypes(n,["x","y","r"]),this.templateFunc(n.category,n,this.getRawCategory(i))},_setDefaultTooltipPositionOption:function(){this.options.align||(this.isVertical?this.options.align=a.TOOLTIP_DEFAULT_ALIGN_OPTION:this.options.align=a.TOOLTIP_DEFAULT_HORIZONTAL_ALIGN_OPTION)},_makeShowTooltipParams:function(t,e){var i,n,o=t.index,r=this.dataProcessor.getLegendItem(o);return r?(i=r.chartType,n=l.extend({chartType:i,legend:r.label,legendIndex:o,index:t.groupIndex},e),s.isBoxplotChart(i)&&l.isNumber(t.outlierIndex)&&(n.outlierIndex=t.outlierIndex),n):null},_makeTooltipDatum:function(t,e,i){var n=t&&i.label?": ":"",o=i.tooltipLabel,r=this.labelFormatter,a={legend:t||"",label:o||(i.label?n+i.label:""),category:e||""};return r&&(a=r(i,a,n)),a.category=e||"",l.extend(a,i.pickValueMapForTooltip())},makeTooltipData:function(){var t=this,e=this.dataProcessor.getLegendLabels(),i=s.isTreemapChart(this.chartType),n={},o={};return l.isArray(e)?n[this.chartType]=e:n=e,this.dataProcessor.eachBySeriesGroup(function(e,i,r){var a,h;r=r||t.chartType,h=s.isBulletChart(r),a=e.map(function(e,o){var a=t.dataProcessor.makeTooltipCategory(i,o,t.isVertical),s=h?i:o;return e?t._makeTooltipDatum(n[r][s],a,e):null}),o[r]||(o[r]=[]),o[r].push(a)},i),o}});r.mixin(u),n.componentType="tooltip",n.NormalTooltip=u,t.exports=n},function(t,e,i){"use strict";var n=i(6),o=i(8),r=i(9),a=i(11),s=i(7),h=n.defineClass({init:function(t){var e=a.isPieChart(t.chartType);this.chartType=t.chartType,this.chartTypes=t.chartTypes,this.dataProcessor=t.dataProcessor,this.options=t.options,this.colors=t.colors,this.theme=t.theme,this.isVertical=t.isVertical,this.eventBus=t.eventBus,this.labelTheme=t.labelTheme,this.xAxisType=t.xAxisType,this.dateFormat=t.dateFormat,this.labelFormatter=t.labelFormatter,this.className="tui-chart-tooltip-area",this.tooltipContainer=null,this.suffix=this.options.suffix?" "+this.options.suffix:"",this.templateFunc=this.options.template||n.bind(this._makeTooltipHtml,this),this.animationTime=e?o.TOOLTIP_PIE_ANIMATION_TIME:o.TOOLTIP_ANIMATION_TIME,this.data=[],this.layout=null,this.dimensionMap=null,this.positionMap=null,this.drawingType=o.COMPONENT_TYPE_DOM,this._setDefaultTooltipPositionOption(),this._saveOriginalPositionOptions(),this._attachToEventBus()},_attachToEventBus:function(){this.eventBus.on({showTooltip:this.onShowTooltip,hideTooltip:this.onHideTooltip},this),this.onShowTooltipContainer&&this.eventBus.on({showTooltipContainer:this.onShowTooltipContainer,hideTooltipContainer:this.onHideTooltipContainer},this)},_makeTooltipHtml:function(){},_setDefaultTooltipPositionOption:function(){},_saveOriginalPositionOptions:function(){this.orgPositionOptions={align:this.options.align,offset:this.options.offset}},makeTooltipData:function(){},_setDataForRendering:function(t){this.layout=t.layout,this.dimensionMap=t.dimensionMap,this.positionMap=t.positionMap},render:function(t){var e=t.paper;return r.addClass(e,this.className),this._setDataForRendering(t),this.data=this.makeTooltipData(),s.renderPosition(e,this.layout.position),this.tooltipContainer=e,e},rerender:function(t){this.resize(t),this.data=this.makeTooltipData()},resize:function(t){this._setDataForRendering(t),s.renderPosition(this.tooltipContainer,this.layout.position),this.positionModel&&this.positionModel.updateBound(this.layout)},zoom:function(){this.data=this.makeTooltipData()},_getTooltipElement:function(){var t;return this.tooltipElement||(this.tooltipElement=t=r.create("DIV","tui-chart-tooltip"),r.append(this.tooltipContainer,t)),this.tooltipElement},onShowTooltip:function(t){var e,i=this._getTooltipElement(),n=a.isComboChart(this.chartType)&&a.isScatterChart(t.chartType);a.isChartToDetectMouseEventOnSeries(t.chartType)&&!n||!i.offsetWidth||(e={left:i.offsetLeft,top:i.offsetTop}),this._showTooltip(i,t,e)},getTooltipDimension:function(t){return{width:t.offsetWidth,height:t.offsetHeight}},_moveToPosition:function(t,e,i){i?this._slideTooltip(t,i,e):s.renderPosition(t,e)},_slideTooltip:function(t,e,i){var n=i.top-e.top,o=i.left-e.left;s.cancelAnimation(this.slidingAnimation),this.slidingAnimation=s.startAnimation(this.animationTime,function(i){var r=o*i,a=n*i;t.style.left=e.left+r+"px",t.style.top=e.top+a+"px"})},onHideTooltip:function(t,e){var i=this._getTooltipElement();this._hideTooltip(i,t,e)},setAlign:function(t){this.options.align=t,this.positionModel&&this.positionModel.updateOptions(this.options)},_updateOffsetOption:function(t){this.options.offset=t,this.positionModel&&this.positionModel.updateOptions(this.options)},setOffset:function(t){var e=n.extend({},this.options.offset);n.isExisty(t.x)&&(e.x=t.x),n.isExisty(t.y)&&(e.y=t.y),this._updateOffsetOption(n.extend({},this.options.offset,e))},setPosition:function(t){var e=n.extend({},this.options.offset);n.isExisty(t.left)&&(e.x=t.left),n.isExisty(t.top)&&(e.y=t.y),this._updateOffsetOption(e)},resetAlign:function(){var t=this.orgPositionOptions.align;this.options.align=t,this.positionModel&&this.positionModel.updateOptions(this.options)},resetOffset:function(){this.options.offset=this.orgPositionOptions.offset,this._updateOffsetOption(this.options.offset)},getRawCategory:function(t,e){var i=this.isVertical?"x":"y",n=this.dataProcessor.categoriesMap?this.dataProcessor.categoriesMap[i]:null,o="";return n&&(o=n[t]),e&&(o=s.formatDate(o,e)),o}});t.exports=h},function(t,e,i){"use strict";var n=i(6),o=i(8),r=i(11),a=i(9),s=i(7),h={_setIndexesCustomAttribute:function(t,e){t.setAttribute("data-groupIndex",e.groupIndex), +t.setAttribute("data-index",e.index)},_getIndexesCustomAttribute:function(t){var e=t.getAttribute("data-groupIndex"),i=t.getAttribute("data-index"),o=null;return n.isNull(e)||n.isNull(i)||(o={groupIndex:parseInt(e,10),index:parseInt(i,10)}),o},_setShowedCustomAttribute:function(t,e){t.setAttribute("data-showed",e)},_isShowedTooltip:function(t){var e=t.getAttribute("data-showed");return"true"===e||e===!0},_makeTooltipPositionForBulletChart:function(t){var e=t.mousePosition,i=this.layout.position;return{left:e.left-i.left,top:e.top-i.top}},_makeLeftPositionOfNotBarChart:function(t,e,i,n){var r=t,a=i||0,s=n||o.TOOLTIP_GAP;return e.indexOf("left")>-1?r-=a+s:e.indexOf("center")>-1&&a?r-=a/2:r+=s,r},_makeTopPositionOfNotBarChart:function(t,e,i,n){var r=t,a=i||0;return e.indexOf("bottom")>-1?r+=a+n:e.indexOf("middle")>-1&&a?r+=a/2:r-=a+o.TOOLTIP_GAP,r},_makeTooltipPositionForNotBarChart:function(t){var e=t.bound,i=t.positionOption,n=t.dimension.width-(e.width||0),r=e.width?0:o.TOOLTIP_GAP,a=t.alignOption||"",s=t.dimension.height,h=e.left-this.layout.position.left+i.left,l=e.top-this.layout.position.top+i.top-o.TOOLTIP_GAP;return{left:this._makeLeftPositionOfNotBarChart(h,a,n,r),top:this._makeTopPositionOfNotBarChart(l,a,s,r)}},_makeTooltipPositionToMousePosition:function(t){return t.bound||(t.bound=t.bound||{},n.extend(t.bound,t.mousePosition)),this._makeTooltipPositionForNotBarChart(t)},_makeLeftPositionForBarChart:function(t,e,i){var n=t;return e.indexOf("left")>-1?n-=i:e.indexOf("center")>-1?n-=i/2:n+=o.TOOLTIP_GAP,n},_makeTopPositionForBarChart:function(t,e,i){var n=t;return e.indexOf("top")>-1?n-=i:e.indexOf("middle")>-1&&(n-=i/2),n},_makeTooltipPositionForBarChart:function(t){var e=this.layout.position,i=t.bound,n=t.positionOption,o=t.dimension.height-(i.height||0),r=t.alignOption||"",a=t.dimension.width,s=i.left+i.width+n.left-e.left,h=i.top+n.top-e.top;return{left:this._makeLeftPositionForBarChart(s,r,a),top:this._makeTopPositionForBarChart(h,r,o)}},_makeTooltipPositionForTreemapChart:function(t){var e=this.layout.position,i=t.bound,n=t.positionOption,r=s.getRenderedLabelHeight(o.MAX_HEIGHT_WORD,this.labelTheme);return{left:i.left+(i.width-t.dimension.width)/2+n.left-e.left,top:i.top+i.height/2-r+n.top-e.top}},_adjustPosition:function(t,e){var i=this.dimensionMap.chart,n=this.layout.position;return e.left=Math.max(e.left,-n.left),e.left=Math.min(e.left,i.width-n.left-t.width),e.top=Math.max(e.top,-n.top),e.top=Math.min(e.top,i.height-n.top-t.height),e},_makeTooltipPosition:function(t){var e,i,n,o={};return t.mousePosition?o=this._makeTooltipPositionToMousePosition(t):(r.isBarChart(t.chartType)?(o=this._makeTooltipPositionForBarChart(t),e="width",i="left",n=1):r.isTreemapChart(t.chartType)?o=this._makeTooltipPositionForTreemapChart(t):(o=this._makeTooltipPositionForNotBarChart(t),e="height",i="top",n=-1),t.allowNegativeTooltip&&(o=this._moveToSymmetry(o,{bound:t.bound,indexes:t.indexes,dimension:t.dimension,chartType:t.chartType,sizeType:e,positionType:i,addPadding:n})),o=this._adjustPosition(t.dimension,o)),o},_moveToSymmetry:function(t,e){var i,n,o,a=e.bound,s=e.sizeType,h=e.positionType,l=e.seriesType||e.chartType,u=this.dataProcessor.getValue(e.indexes.groupIndex,e.indexes.index,l),c=r.isBarChart(this.chartType)?-1:1;return u<0&&(i=e.dimension[s],n=a[s],o=t[h]+(n+i)*c,t[h]=o),t},_isChangedIndexes:function(t,e){return!!t&&(t.groupIndex!==e.groupIndex||t.index!==e.index)},_showTooltip:function(t,e,i){var r,s=this.tooltipContainer.parentNode.getBoundingClientRect(),h=e.indexes,l=this._getIndexesCustomAttribute(t),u=this.options.offset||{},c={},d=t&&t.getAttribute("data-chart-type");!e.bound&&e.mousePosition&&(e.bound={left:e.mousePosition.left-s.left+o.CHART_PADDING,top:e.mousePosition.top-s.top+o.CHART_PADDING}),(this._isChangedIndexes(l,h)||d!==e.chartType)&&this.eventBus.fire("hoverOffSeries",l,d),t.innerHTML=this._makeSingleTooltipHtml(e.seriesType||e.chartType,h),t.setAttribute("data-chart-type",e.chartType),this._setIndexesCustomAttribute(t,h),this._setShowedCustomAttribute(t,!0),this._fireBeforeShowTooltipPublicEvent(h,e.silent),a.addClass(t,"show"),c.left=u.x||0,c.top=u.y||0,r=this._makeTooltipPosition(n.extend({dimension:this.getTooltipDimension(t),positionOption:c,alignOption:this.options.align||""},e)),this._moveToPosition(t,r,i),this.eventBus.fire("hoverSeries",h,e.chartType),this._fireAfterShowTooltipPublicEvent(h,{element:t,position:r},e.silent),delete e.silent},_fireBeforeShowTooltipPublicEvent:function(t,e){var i;e||(i=this._makeShowTooltipParams(t),this.eventBus.fire(o.PUBLIC_EVENT_PREFIX+"beforeShowTooltip",i))},_fireAfterShowTooltipPublicEvent:function(t,e,i){var n;i||(n=this._makeShowTooltipParams(t,e),this.eventBus.fire(o.PUBLIC_EVENT_PREFIX+"afterShowTooltip",n))},_executeHidingTooltip:function(t){a.removeClass(t,"show"),t.removeAttribute("data-groupIndex"),t.removeAttribute("data-index"),t.style.cssText=""},_hideTooltip:function(t,e,i){var n=this,a=this._getIndexesCustomAttribute(t),s=t.getAttribute("data-chart-type"),h=!(!i||!i.silent);r.isChartToDetectMouseEventOnSeries(s)?(this.eventBus.fire("hoverOffSeries",a,s),this._fireBeforeHideTooltipPublicEvent(a,h),this._executeHidingTooltip(t)):s&&(this._setShowedCustomAttribute(t,!1),this.eventBus.fire("hoverOffSeries",a,s),this._isChangedIndexes(this.prevIndexes,a)&&delete this.prevIndexes,setTimeout(function(){n._isShowedTooltip(t)||(n._fireBeforeHideTooltipPublicEvent(a,h),n._executeHidingTooltip(t))},o.HIDE_DELAY))},_fireBeforeHideTooltipPublicEvent:function(t,e){var i;e||this.eventBus.fire(o.PUBLIC_EVENT_PREFIX+"beforeHideTooltip",i)},onShowTooltipContainer:function(){this.tooltipContainer.style.zIndex=o.TOOLTIP_ZINDEX},onHideTooltipContainer:function(){this.tooltipContainer.style.zIndex=0},mixin:function(t){n.extend(t.prototype,this)}};t.exports=h},function(t,e,i){"use strict";var n=i(65),o={HTML_DEFAULT_TEMPLATE:'
{{ category }}
{{ legend }}{{ label }}{{ suffix }}
',HTML_PIE_TEMPLATE:'
{{ category }}
{{ legend }}{{ ratioLabel }}( {{ label }} {{ suffix }})
',HTML_COORDINATE_TYPE_CHART_TEMPLATE:'
{{ category }}
{{ legend }}{{ label }}
{{ valueTypes }}
',HTML_GROUP:'
{{ category }}
{{ items }}
',HTML_GROUP_TYPE:'
{{ type }}
',HTML_GROUP_ITEM:'
 {{ legend }}{{ value }}{{ suffix }}
',GROUP_CSS_TEXT:"background-color:{{ color }}",HTML_MAP_CHART_DEFAULT_TEMPLATE:'
{{ name }}: {{ value }}{{ suffix }}
',HTML_BOXPLOT_TEMPLATE:'
{{ category }}
{{ legend }}
Maximum: {{ maxLabel }}{{ suffix }}
Upper Quartile: {{ uqLabel }}{{ suffix }}
Median: {{ medianLabel }}{{ suffix }}
Lower Quartile: {{ lqLabel }}{{ suffix }}
Minimum: {{ minLabel }}{{ suffix }}
',HTML_BOXPLOT_OUTLIER:'
{{ category }}
{{ legend }}
Outlier: {{ label }}{{ suffix }}
',HTML_BULLET_TEMPLATE:'
{{ category }}{{ label }}{{ suffix }}
'};t.exports={tplDefault:n.template(o.HTML_DEFAULT_TEMPLATE),tplPieChart:n.template(o.HTML_PIE_TEMPLATE),tplCoordinatetypeChart:n.template(o.HTML_COORDINATE_TYPE_CHART_TEMPLATE),tplGroup:n.template(o.HTML_GROUP),tplGroupType:n.template(o.HTML_GROUP_TYPE),tplGroupItem:n.template(o.HTML_GROUP_ITEM),tplGroupCssText:n.template(o.GROUP_CSS_TEXT),tplMapChartDefault:n.template(o.HTML_MAP_CHART_DEFAULT_TEMPLATE),tplBoxplotChartDefault:n.template(o.HTML_BOXPLOT_TEMPLATE),tplBoxplotChartOutlier:n.template(o.HTML_BOXPLOT_OUTLIER),tplBulletChartDefault:n.template(o.HTML_BULLET_TEMPLATE)}},function(t,e,i){"use strict";var n=i(6);t.exports={template:function(t){return function(e){var i=t;return n.forEach(e,function(t,e){var n=new RegExp("{{\\s*"+e+"\\s*}}","g");i=i.replace(n,String(t).replace("$","$"))}),i}}}},function(t,e,i){"use strict";function n(t){return new p(t)}var o=i(62),r=i(67),a=i(8),s=i(9),h=i(7),l=i(34),u=i(64),c=i(6),d=i(11),p=c.defineClass(o,{init:function(t){this.prevIndex=null,this.isBullet=d.isBulletChart(t.chartType),o.call(this,t)},_makeTooltipHtml:function(t,e,i,n){var o,r,a=u.tplGroupItem,s=u.tplGroupCssText,h=this._makeColors(this.theme,n);return r=c.map(e,function(t,e){var i=t.type,n="data"!==i&&o!==i,r="";return o=i,t.value?(n&&(r=u.tplGroupType({type:i})),r+=a(c.extend({cssText:s({color:h[e]})},t))):null}).join(""),u.tplGroup({category:t,items:r})},_setDefaultTooltipPositionOption:function(){this.options.align||(this.isVertical?this.options.align=a.TOOLTIP_DEFAULT_GROUP_ALIGN_OPTION:this.options.align=a.TOOLTIP_DEFAULT_GROUP_HORIZONTAL_ALIGN_OPTION)},render:function(t){var e=o.prototype.render.call(this,t),i=this.dimensionMap.chart,n=this.layout;return t.checkedLegends&&(this.theme={colors:this.colors}),this.positionModel=new r(i,n,this.isVertical,this.options),e},rerender:function(t){o.prototype.rerender.call(this,t),this.prevIndex=null,t.checkedLegends&&(this.theme=this._updateLegendTheme(t.checkedLegends))},zoom:function(){this.prevIndex=null,o.prototype.zoom.call(this)},_updateLegendTheme:function(t){var e=[];return c.forEachArray(this.dataProcessor.getOriginalLegendData(),function(i){var n=t[i.chartType]||t;n[i.index]&&e.push(i.theme.color)}),{colors:e}},makeTooltipData:function(){var t=this.dataProcessor.getCategoryCount(this.isVertical);return c.map(this.dataProcessor.getSeriesGroups(),function(e,i){var n=e.map(function(t){return{type:t.type||"data",label:t.label}});return{category:this.dataProcessor.makeTooltipCategory(i,t-i,this.isVertical),values:n}},this)},_makeColors:function(t,e){var i,n,o,r=0,a=this.dataProcessor.getLegendData();return this.isBullet?this.dataProcessor.getGraphColors()[e]:t.colors?t.colors:(i=l.series.colors.slice(0,a.length),c.map(c.pluck(a,"chartType"),function(e){var a;return o!==e&&(n=t[e]?t[e].colors:i,r=0),o=e,a=n[r],r+=1,a}))},_makeItemRenderingData:function(t,e){var i=this.dataProcessor,n=this.suffix;return c.map(t,function(t,o){var r,a={value:t.label,type:t.type,suffix:n,legend:""};return this.isBullet?r=i.getLegendItem(e):(r=i.getLegendItem(o),a.legend=r.label),a.chartType=r.chartType,a},this)},_makeGroupTooltipHtml:function(t){var e,i=this.data[t],n="";return i&&(e=this._makeItemRenderingData(i.values,t),n=this.templateFunc(i.category,e,this.getRawCategory(t),t)),n},_getTooltipSectorElement:function(){var t;return this.groupTooltipSector||(this.groupTooltipSector=t=s.create("DIV","tui-chart-group-tooltip-sector"),s.append(this.tooltipContainer,t)),this.groupTooltipSector},_makeVerticalTooltipSectorBound:function(t,e,i){var n;return n=i?1:e.end-e.start,{dimension:{width:n,height:t},position:{left:e.start,top:a.SERIES_EXPAND_SIZE}}},_makeHorizontalTooltipSectorBound:function(t,e){return{dimension:{width:t,height:e.end-e.start},position:{left:a.SERIES_EXPAND_SIZE,top:e.start}}},_makeTooltipSectorBound:function(t,e,i,n){var o;return o=i?this._makeVerticalTooltipSectorBound(t,e,n):this._makeHorizontalTooltipSectorBound(t,e)},_showTooltipSector:function(t,e,i,n,o){var r=this._getTooltipSectorElement(),a=e.start===e.end,l=this._makeTooltipSectorBound(t,e,i,a);a?this.eventBus.fire("showGroupTooltipLine",l):(h.renderDimension(r,l.dimension),h.renderPosition(r,l.position),s.addClass(r,"show")),o&&(n-=1),this.eventBus.fire("showGroupAnimation",n)},_hideTooltipSector:function(t){var e=this._getTooltipSectorElement();s.hasClass(e,"show")?s.removeClass(e,"show"):this.eventBus.fire("hideGroupTooltipLine"),this.eventBus.fire("hideGroupAnimation",t),this.eventBus.fire("hideGroupTooltipLine")},_showTooltip:function(t,e,i){var n,o;c.isNull(this.prevIndex)||this.eventBus.fire("hideGroupAnimation",this.prevIndex),t.innerHTML=this._makeGroupTooltipHtml(e.index),this._fireBeforeShowTooltipPublicEvent(e.index,e.range,e.silent),s.addClass(t,"show"),this._showTooltipSector(e.size,e.range,e.isVertical,e.index,e.isMoving),n=this.getTooltipDimension(t),o=this.positionModel.calculatePosition(n,e.range),this._moveToPosition(t,o,i),this._fireAfterShowTooltipPublicEvent(e.index,e.range,{element:t,position:o},e.silent),this.prevIndex=e.index},_fireBeforeShowTooltipPublicEvent:function(t,e,i){i||this.eventBus.fire(a.PUBLIC_EVENT_PREFIX+"beforeShowTooltip",{chartType:this.chartType,index:t,range:e})},_fireAfterShowTooltipPublicEvent:function(t,e,i,n){n||this.eventBus.fire(a.PUBLIC_EVENT_PREFIX+"afterShowTooltip",c.extend({chartType:this.chartType,index:t,range:e},i))},_hideTooltip:function(t,e,i){var n=!(!i||!i.silent);this.prevIndex=null,this._fireBeforeHideTooltipPublicEvent(e,n),this._hideTooltipSector(e),s.removeClass(t,"show"),t.style.cssText=""},_fireBeforeHideTooltipPublicEvent:function(t,e){e||this.eventBus.fire(a.PUBLIC_EVENT_PREFIX+"beforeHideTooltip",{chartType:this.chartType,index:t})}});n.componentType="tooltip",n.GroupTooltip=p,t.exports=n},function(t,e,i){"use strict";var n=i(8),o=i(6),r=o.defineClass({init:function(t,e,i,n){this.chartDimension=t,this.areaBound=e,this.isVertical=i,this.options=n,this.positions={},this._setData(t,e,i,n)},_getHorizontalDirection:function(t){var e;return t=t||"",e=t.indexOf("left")>-1?n.TOOLTIP_DIRECTION_BACKWARD:t.indexOf("center")>-1?n.TOOLTIP_DIRECTION_CENTER:n.TOOLTIP_DIRECTION_FORWARD},_makeVerticalData:function(t,e,i){var o=this._getHorizontalDirection(i);return{positionType:"left",sizeType:"width",direction:o,areaPosition:e.position.left,areaSize:e.dimension.width,chartSize:t.width,basePosition:n.SERIES_EXPAND_SIZE}},_getVerticalDirection:function(t){var e;return t=t||"",e=t.indexOf("top")>-1?n.TOOLTIP_DIRECTION_BACKWARD:t.indexOf("bottom")>-1?n.TOOLTIP_DIRECTION_FORWARD:n.TOOLTIP_DIRECTION_CENTER},_makeHorizontalData:function(t,e,i){var o=this._getVerticalDirection(i);return{positionType:"top",sizeType:"height",direction:o,areaPosition:e.position.top,areaSize:e.dimension.height,chartSize:t.height,basePosition:n.SERIES_EXPAND_SIZE}},_setData:function(t,e,i,n){var o=this._makeVerticalData(t,e,n.align),r=this._makeHorizontalData(t,e,n.align),a=n.offset||{};i?(this.mainData=o,this.subData=r):(this.mainData=r,this.subData=o),this.positionOption={},this.positionOption.left=a.x||0,this.positionOption.top=a.y||0,this.positions={}},_calculateMainPositionValue:function(t,e,i){var o=e.start===e.end,r=9,a=5,s=o?r:a,h=i.basePosition;return h+=i.direction===n.TOOLTIP_DIRECTION_FORWARD?e.end+s:i.direction===n.TOOLTIP_DIRECTION_BACKWARD?e.start-t-s:o?e.start-t/2:e.start+(e.end-e.start-t)/2},_calculateSubPositionValue:function(t,e){var i,o=e.areaSize/2;return i=e.direction===n.TOOLTIP_DIRECTION_FORWARD?o+e.basePosition:e.direction===n.TOOLTIP_DIRECTION_BACKWARD?o-t+e.basePosition:o-t/2+e.basePosition},_makePositionValueDiff:function(t,e,i){return t+i.areaPosition+e-i.chartSize},_adjustBackwardPositionValue:function(t,e,i,o){var r;return t<-o.areaPosition&&(r=this._calculateMainPositionValue(i,e,{direction:n.TOOLTIP_DIRECTION_FORWARD,basePosition:o.basePosition}),t=this._makePositionValueDiff(r,i,o)>0?-o.areaPosition:r),t},_adjustForwardPositionValue:function(t,e,i,o){var r,a=this._makePositionValueDiff(t,i,o);return a>0&&(r=this._calculateMainPositionValue(i,e,{direction:n.TOOLTIP_DIRECTION_BACKWARD,basePosition:o.basePosition}),r<-o.areaPosition?t-=a:t=r),t},_adjustMainPositionValue:function(t,e,i,o){return o.direction===n.TOOLTIP_DIRECTION_BACKWARD?t=this._adjustBackwardPositionValue(t,e,i,o):o.direction===n.TOOLTIP_DIRECTION_FORWARD?t=this._adjustForwardPositionValue(t,e,i,o):(t=Math.max(t,-o.areaPosition),t=Math.min(t,o.chartSize-o.areaPosition-i)),t},_adjustSubPositionValue:function(t,e,i){return t=i.direction===n.TOOLTIP_DIRECTION_FORWARD?Math.min(t,i.chartSize-i.areaPosition-e):Math.max(t,-i.areaPosition)},_makeCachingKey:function(t){return t.start+"-"+t.end},_addPositionOptionValue:function(t,e){return t+this.positionOption[e]},_makeMainPositionValue:function(t,e,i){var n;return n=this._calculateMainPositionValue(t[i.sizeType],e,i),n=this._addPositionOptionValue(n,i.positionType),n=this._adjustMainPositionValue(n,e,t[i.sizeType],i)},_makeSubPositionValue:function(t,e){var i;return i=this._calculateSubPositionValue(t[e.sizeType],e),i=this._addPositionOptionValue(i,e.positionType),i=this._adjustSubPositionValue(i,t[e.sizeType],e)},calculatePosition:function(t,e){var i=this._makeCachingKey(e),n=this.mainData,o=this.subData,r=this.positions[i];return r||(r={},r[n.positionType]=this._makeMainPositionValue(t,e,n),r[o.positionType]=this._makeSubPositionValue(t,o),this.positions[i]=r),r},updateOptions:function(t){this.options=t,this._setData(this.chartDimension,this.areaBound,this.isVertical,t)},updateBound:function(t){this.areaBound=t,this._setData(this.chartDimension,t,this.isVertical,this.options)}});t.exports=r},function(t,e,i){"use strict";function n(t){return new l(t)}var o=i(8),r=i(62),a=i(63),s=i(64),h=i(6),l=h.defineClass(r,{init:function(t){this.mapModel=t.mapModel,r.apply(this,arguments)},_makeTooltipHtml:function(t){return s.tplMapChartDefault(t)},_makeSingleTooltipHtml:function(t,e){var i=this.mapModel.getDatum(e.index),n=this.options.suffix?" "+this.options.suffix:"";return this.templateFunc({name:i.name||i.code,value:i.label,suffix:n})},_makeShowTooltipParams:function(t,e){var i,n=this.mapModel.getDatum(t.index);return i=h.extend({chartType:this.chartType,code:n.code,name:n.name,value:n.label,index:t.index},e)},_setDefaultTooltipPositionOption:function(){this.options.align||(this.options.align=o.TOOLTIP_DEFAULT_ALIGN_OPTION)}});a.mixin(l),n.componentType="tooltip",t.exports=n},function(t,e,i){"use strict";function n(t){return new u(t)}var o=i(70),r=i(8),a=i(55),s=i(9),h=i(7),l=i(6),u=l.defineClass(o,{init:function(t){this.chartType=t.chartType,this.eventBus=t.eventBus,this.isDown=!1,this.drawingType=r.COMPONENT_TYPE_DOM},_renderMouseEventDetectorArea:function(t){h.renderDimension(t,this.layout.dimension),h.renderPosition(t,this.layout.position)},_onClick:function(){},_onMousedown:function(t){this.isDown=!0,this.eventBus.fire("dragStartMapSeries",{left:t.clientX,top:t.clientY})},_dragEnd:function(){this.isDrag=!1,s.removeClass(this.mouseEventDetectorContainer,"drag"),this.eventBus.fire("dragEndMapSeries")},_onMouseup:function(t){this.isDown=!1,this.isDrag?this._dragEnd():this._onMouseEvent("click",t),this.isMove=!1},_onMousemove:function(t){this.isDown?(this.isDrag||s.addClass(this.mouseEventDetectorContainer,"drag"),this.isDrag=!0,this.eventBus.fire("dragMapSeries",{left:t.clientX,top:t.clientY})):(this.isMove=!0,this._onMouseEvent("move",t))},_onMouseout:function(t){this.isDrag?this._dragEnd():this._onMouseEvent("move",t),this.isDown=!1},_onMousewheel:function(t){var e=t.wheelDelta||t.detail*r.FF_WHEELDELTA_ADJUSTING_VALUE;return this.eventBus.fire("wheel",e,{left:t.clientX,top:t.clientY}),t.preventDefault&&t.preventDefault(),!1},attachEvent:function(t){o.prototype.attachEvent.call(this,t),l.browser.firefox?a.on(t,"DOMMouseScroll",this._onMousewheel,this):a.on(t,"mousewheel",this._onMousewheel,this)}});n.componentType="mouseEventDetector",t.exports=n},function(t,e,i){"use strict";var n=i(71),o=i(72),r=i(8),a=i(55),s=i(11),h=i(9),l=i(7),u=i(6),c=u.defineClass({init:function(t){var e;this.chartType=t.chartType,this.chartTypes=t.chartTypes,this.isVertical=t.isVertical,this.dataProcessor=t.dataProcessor,this.allowSelect=t.allowSelect,this.eventBus=t.eventBus,this.layout=null,this.selectedData=null,e=s.isLineTypeChart(this.chartType,this.chartTypes),this.expandSize=e?r.SERIES_EXPAND_SIZE:0,this.seriesItemBoundsData=[],this.seriesCount=s.isComboChart(this.chartType)?2:1,this._attachToEventBus(),this.drawingType=r.COMPONENT_TYPE_DOM},_attachToEventBus:function(){this.eventBus.on("receiveSeriesData",this.onReceiveSeriesData,this)},_getRenderingBound:function(){var t=l.expandBound(this.layout);return t},_renderMouseEventDetectorArea:function(t,e){var i,o,r=this.layout.dimension;this.dimension=r,o=new n(this.layout,e,this.chartType,this.isVertical,this.chartTypes),this.tickBaseCoordinateModel=o,i=this._getRenderingBound(),l.renderDimension(t,i.dimension),l.renderPosition(t,i.position)},_setDataForRendering:function(t){this.layout=t.layout},_pickTickCount:function(t){var e;return e=this.isVertical?t.xAxis.eventTickCount||t.xAxis.tickCount:t.yAxis.tickCount},render:function(t){var e,i=t.paper;return this.positionMap=t.positionMap,h.addClass(i,"tui-chart-series-custom-event-area"),t.axisDataMap.xAxis&&(e=this._pickTickCount(t.axisDataMap)),this._setDataForRendering(t),this._renderMouseEventDetectorArea(i,e),this.attachEvent(i),this.mouseEventDetectorContainer=i,this.transparentChild=this._createTransparentChild(),h.append(i,this.transparentChild),i},_createTransparentChild:function(){var t=document.createElement("DIV"),e=t.style;return e.backgroundColor="#fff",e.height=l.getStyle(this.mouseEventDetectorContainer).height,l.setOpacity(t,0),t},_calculateLayerPosition:function(t,e,i){var n,o,a=this.mouseEventDetectorContainer.getBoundingClientRect(),s=this.positionMap.series,h=this.expandSize,l={};return i=!!u.isUndefined(i)||i,i&&(n=a.right-h,o=a.left+h,t=Math.min(Math.max(t,o),n)),l.x=t-a.left+s.left-r.CHART_PADDING,u.isUndefined(e)||(l.y=e-a.top+s.top-r.CHART_PADDING),l},onReceiveSeriesData:function(t){var e=this.seriesItemBoundsData,i=this.seriesCount;e.length===i&&(e=[]),e.push(t),e.length===i&&(this.boundsBaseCoordinateModel=new o(e))},rerender:function(t){var e;t.axisDataMap.xAxis&&(e=this._pickTickCount(t.axisDataMap)),this.selectedData=null,this._setDataForRendering(t),this._renderMouseEventDetectorArea(this.mouseEventDetectorContainer,e),this.transparentChild.style.height=l.getStyle(this.mouseEventDetectorContainer).height},resize:function(t){this.containerBound=null,this.rerender(t)},_isChangedSelectData:function(t,e){return!t||!e||t.chartType!==e.chartType||t.indexes.groupIndex!==e.indexes.groupIndex||t.indexes.index!==e.indexes.index},_findDataFromBoundsCoordinateModel:function(t){var e,i=t.x,n=t.y;return e=s.isTreemapChart(this.chartType)?0:this.tickBaseCoordinateModel.findIndex(this.isVertical?i:n),this.boundsBaseCoordinateModel.findData(e,i,n)},_findData:function(t,e){var i=this._calculateLayerPosition(t,e);return this._findDataFromBoundsCoordinateModel(i)},_showTooltip:function(){},_hideTooltip:function(){},_onMouseEvent:function(t,e){h.addClass(this.mouseEventDetectorContainer,"hide"),this.eventBus.fire(t+"Series",{left:e.clientX,top:e.clientY}),h.removeClass(this.mouseEventDetectorContainer,"hide")},_unselectSelectedData:function(){this.eventBus.fire("unselectSeries",this.selectedData),this.selectedData=null},_onClick:function(t){var e=this._findData(t.clientX,t.clientY);this._isChangedSelectData(this.selectedData,e)?e&&(this.selectedData&&this._unselectSelectedData(),this.eventBus.fire("selectSeries",e),this.allowSelect&&(this.selectedData=e)):this._unselectSelectedData()},_onMousedown:function(){},_onMouseup:function(){},_onMousemove:function(){},_onMouseout:function(){},attachEvent:function(t){a.on(t,{click:this._onClick,mousedown:this._onMousedown,mouseup:this._onMouseup,mousemove:this._onMousemove,mouseout:this._onMouseout},this)},findDataByIndexes:function(){},_setPrevClientPosition:function(t){t?this.prevClientPosition={x:t.clientX,y:t.clientY}:this.prevClientPosition=null}});u.CustomEvents.mixin(c),t.exports=c},function(t,e,i){"use strict";var n=i(11),o=i(10),r=i(6),a=r.defineClass({init:function(t,e,i,o,r){this.isLineType=n.isLineTypeChart(i,r),this.data=this._makeData(t,e,o)},_getRanges:function(t,e,i){var n=e,o=i/2;return r.map(r.range(0,t),function(){var t={min:n-o,max:n+o};return n+=i,t})},_makeLineTypeData:function(t,e,i){var n=(t+1)/(e-1),o=this._getRanges(e,i||0,n);return o[e-1].max-=1,o},_makeNormalData:function(t,e,i){var n=e-1,a=t/n,s=i||0;return r.map(r.range(0,n),function(){var e=o.min([t+s,a+s]),i={min:s,max:e};return s=e,i})},_makeData:function(t,e,i){var n,o=i?"width":"height",r=i?"left":"top";return n=this.isLineType?this._makeLineTypeData(t.dimension[o],e,t.position[r]):this._makeNormalData(t.dimension[o],e,t.position[r])},findIndex:function(t){var e=-1;return r.forEachArray(this.data,function(i,n){return!(i.min=t)||(e=n,!1)}),e},getLastIndex:function(){return this.data.length-1},makeRange:function(t,e){var i,n,o=this.data[t];return this.isLineType?(n=parseInt(o.max-(o.max-o.min)/2,10),i={start:n,end:n}):i={start:o.min-(e||0),end:o.max-(e||0)},i}});t.exports=a},function(t,e,i){"use strict";var n=i(8),o=i(11),r=i(10),a=i(6),s=a.defineClass({init:function(t){this.data=this._makeData(t)},_makeTooltipData:function(t,e,i,n){return{sendData:{chartType:t,indexes:e,allowNegativeTooltip:i,bound:n},bound:{left:n.left,top:n.top,right:n.left+n.width,bottom:n.top+n.height}}},_makeRectTypePositionData:function(t,e){var i=!o.isBoxTypeChart(e);return a.map(t,function(t,n){return a.map(t,function(t,o){return t?this._makeTooltipData(e,{groupIndex:n,index:o},i,t.end||t):null},this)},this)},_makeOutliersPositionDataForBoxplot:function(t,e,i){var n=!o.isBoxTypeChart(e),r=[].concat(t);a.forEach(r,function(t,o){a.forEach(t,function(t,r){var s;t.outliers&&t.outliers.length&&(s=a.map(t.outliers,function(t,i){var a={top:t.top-3,left:t.left-3,width:6,height:6};return this._makeTooltipData(e,{groupIndex:o,index:r,outlierIndex:i},n,a)},this),i[o]=i[o].concat(s))},this)},this)},_makeDotTypePositionData:function(t,e){return t?a.map(r.pivot(t),function(t,i){return a.map(t,function(t,o){return t?{sendData:{chartType:e,indexes:{groupIndex:i,index:o},bound:t},bound:{left:t.left-n.DOT_RADIUS,top:t.top-n.DOT_RADIUS,right:t.left+n.DOT_RADIUS,bottom:t.top+n.DOT_RADIUS}}:null})}):[]},_joinData:function(t){var e=[];return a.forEachArray(t,function(t){a.forEachArray(t,function(t,i){var n;e[i]?(n=e[i].length,a.forEachArray(t,function(t){t&&(t.sendData.indexes.legendIndex=t.sendData.indexes.index+n)}),e[i]=e[i].concat(t)):e[i]=t})}),e},_makeData:function(t){var e=a.map(t,function(t){var e;return e=o.isLineTypeChart(t.chartType)?this._makeDotTypePositionData(t.data.groupPositions,t.chartType):this._makeRectTypePositionData(t.data.groupBounds,t.chartType),o.isBoxplotChart(t.chartType)&&this._makeOutliersPositionDataForBoxplot(t.data.groupBounds,t.chartType,e),e},this);return this._joinData(e)},_findCandidates:function(t,e,i){return a.filter(t,function(t){var n,o,r=t&&t.bound,a=!1;return r&&(n=r.left<=e&&r.right>=e,o=r.top<=i&&r.bottom>=i,a=n&&o),a})},findData:function(t,e,i){var n,o=1e4,r=null;return t>-1&&this.data[t]&&(n=this._findCandidates(this.data[t],e,i),a.forEachArray(n,function(t){var e=Math.abs(i-t.bound.top);o>e&&(o=e,r=t.sendData)})),r},findDataByIndexes:function(t){var e=this.data[t.index][t.seriesIndex].sendData;return a.isNumber(t.outlierIndex)?this._findOutlierDataByIndexes(t):e},_findOutlierDataByIndexes:function(t){var e=null;return a.forEachArray(this.data[t.index],function(i){var n=i.sendData.indexes,o=n.index===t.seriesIndex&&n.outlierIndex===t.outlierIndex;return o&&(e=i.sendData),!o}),e}});t.exports=s},function(t,e,i){"use strict";function n(t){var e,i=t.chartOptions.chartType,n=t.seriesTypes,u=t.chartOptions.series.zoomable,c=t.chartOptions.series.allowSelect;return e=t.chartOptions.tooltip.grouped?s:o.isMapChart(i)?l:o.isBarTypeChart(i)||o.isBoxplotChart(i)||o.isHeatmapChart(i)||o.isTreemapChart(i)||o.isBulletChart(i)?h:o.isCoordinateTypeChart(i)||o.isPieChart(i)||o.isPieDonutComboChart(i,n)?a:r,t.chartType=i,t.chartTypes=n,t.zoomable=u,t.allowSelect=c,e(t)}var o=i(11),r=i(74),a=i(77),s=i(78),h=i(79),l=i(69);n.componentType="mouseEventDetector",t.exports=n},function(t,e,i){"use strict";function n(t){return new l(t)}var o=i(70),r=i(75),a=i(76),s=i(6),h=50,l=s.defineClass(o,{init:function(t){o.call(this,t),this.prevFoundData=null,this.prevClientPosition=null,this.zoomable=t.zoomable,this.zoomable&&(s.extend(this,r),this._initForZoom(t.zoomable))},animateForAddingData:function(){var t,e;this.prevClientPosition&&(t=this._findData(this.prevClientPosition.x,this.prevClientPosition.y),t&&(e=this.prevFoundData&&this.prevFoundData.indexes.groupIndex===t.indexes.groupIndex,this._showTooltip(t,e)),this.prevFoundData=t)},onReceiveSeriesData:function(t){var e=this.seriesItemBoundsData,i=this.seriesCount;e.length===i&&(e=[]),e.push(t),e.length===i&&(this.dataModel=new a(e)),this.zoomable&&this._showTooltipAfterZoom()},_findData:function(t,e){var i=this._calculateLayerPosition(t,e),n=this.dataProcessor.selectLegendIndex;return this.dataModel.findData(i,h,n)},_findDataForZoomable:function(t,e){var i=this._calculateLayerPosition(t,e);return this.dataModel.findData(i)},_getFirstData:function(t){return this.dataModel.getFirstData(t)},_getLastData:function(t){return this.dataModel.getLastData(t)},_showTooltip:function(t){this.eventBus.fire("showTooltip",t),this.prevFoundData=t},_hideTooltip:function(t){this.eventBus.fire("hideTooltip",this.prevFoundData,t),this.prevFoundData=null},_onMousemove:function(t){var e,i;this._setPrevClientPosition(t),i=this._findData(t.clientX,t.clientY),this.zoomable&&(e=this._isAfterDragMouseup()),!e&&this._isChangedSelectData(this.prevFoundData,i)&&(i?this._showTooltip(i):this.prevFoundData&&this._hideTooltip(),this.prevFoundData=i)},_onMouseout:function(){this.prevFoundData&&this._hideTooltip(),this.prevClientPosition=null,this.prevFoundData=null},findDataByIndexes:function(t){return this.dataModel.findDataByIndexes(t)},_setPrevClientPosition:function(t){t?this.prevClientPosition={x:t.clientX,y:t.clientY}:this.prevClientPosition=null}});n.componentType="mouseEventDetector",t.exports=n},function(t,e,i){"use strict";var n=i(70),o=i(8),r=i(9),a=i(7),s=i(55),h=i(6),l={_initForZoom:function(t){this.zoomable=t,this.dragStartIndexes=null,this.startClientPosition=null,this.startLayerX=null,this.dragSelectionElement=null,this.containerBound=null,this.isShowTooltipAfterZoom=!1,this.afterMouseup=!1,this.prevDistanceOfRange=null,this.reverseMove=null,this.resetZoomBtn=null},_showTooltipAfterZoom:function(){var t,e=this.isShowTooltipAfterZoom;this.isShowTooltipAfterZoom=!1,e&&this.dragStartIndexes&&(t=this.reverseMove?this._getFirstData(this.dragStartIndexes.index):this._getLastData(this.dragEndIndexes.index),t&&this._showTooltip(t))},_updateDimensionForDragSelection:function(t){a.renderDimension(t,{height:this.layout.dimension.height})},_renderDragSelection:function(){var t=r.create("DIV","tui-chart-drag-selection");return this._updateDimensionForDragSelection(t),t},render:function(t){var e=n.prototype.render.call(this,t),i=this._renderDragSelection();return r.append(e,i),this.dragSelectionElement=i,e},resize:function(t){this.containerBound=null,n.prototype.resize.call(this,t),this._updateDimensionForDragSelection(this.dragSelectionElement)},_onClick:function(){},_isAfterDragMouseup:function(){var t=this.afterMouseup;return t&&(this.afterMouseup=!1),t},_bindDragEvent:function(t){t.setCapture&&t.setCapture(),s.on(document,"mousemove",this._onDrag,this),s.off(this.mouseEventDetectorContainer,"mouseup",this._onMouseup,this),s.on(document,"mouseup",this._onMouseupAfterDrag,this)},_unbindDragEvent:function(){ +this.downTarget&&this.downTarget.releaseCapture&&this.downTarget.releaseCapture(),s.off(document,"mousemove",this._onDrag,this),s.off(document,"mouseup",this._onMouseupAfterDrag,this),s.on(this.mouseEventDetectorContainer,"mouseup",this._onMouseup,this)},_onMousedown:function(t){var e;this.zoomable&&(e=t.target||t.srcElement,this.startClientPosition={x:t.clientX,y:t.clientY},this.startLayerX=this._calculateLayerPosition(t.clientX).x,this.downTarget=e,this._bindDragEvent(e))},_showDragSelection:function(t){var e=this._calculateLayerPosition(t).x,i=Math.min(e,this.startLayerX)-this.layout.position.left,n=Math.abs(e-this.startLayerX),o=this.dragSelectionElement;o.style.left=i+"px",o.style.width=n+"px",r.addClass(o,"show")},_hideDragSelection:function(){r.removeClass(this.dragSelectionElement,"show")},_onDrag:function(t){var e,i=this.startClientPosition,n=t.target||t.srcElement;i&&(e=this._findDataForZoomable(i.x,i.y),r.hasClass(n,o.CLASS_NAME_RESET_ZOOM_BTN)||(h.isNull(this.dragStartIndexes)?this.dragStartIndexes=e?e.indexes:{}:this._showDragSelection(t.clientX)))},_adjustIndexRange:function(t,e){var i=[t,e].sort(function(t,e){return t-e}),n=i[1]-i[0];return 0===n?0===i[0]?i[1]+=2:(i[0]-=1,i[1]+=1):1===n&&(0===i[0]?i[1]+=1:i[0]-=1),i},_fireZoom:function(t,e){var i=t>e,n=this._adjustIndexRange(t,e),o=n[1]-n[0];this.prevDistanceOfRange!==o&&(this.prevDistanceOfRange=o,this.reverseMove=i,this.eventBus.fire("zoom",n))},_setIsShowTooltipAfterZoomFlag:function(t,e){var i=this._calculateLayerPosition(t,e,!1).x,n=this._calculateLayerPosition(t,e).x;this.isShowTooltipAfterZoom=i===n},_onMouseupAfterDrag:function(t){var e,i=this._findDataForZoomable(t.clientX,t.clientY);this._unbindDragEvent(),h.isNull(this.dragStartIndexes)?(e=t.target||t.srcElement,r.hasClass(e,o.CLASS_NAME_RESET_ZOOM_BTN)?(this._hideTooltip(),this.prevDistanceOfRange=null,this.eventBus.fire("resetZoom")):n.prototype._onClick.call(this,t)):this.dragStartIndexes&&i?(this.dragEndIndexes=i.indexes,this._setIsShowTooltipAfterZoomFlag(t.clientX,t.clientY),this._hideDragSelection(),this._fireZoom(this.dragStartIndexes.groupIndex,this.dragEndIndexes.groupIndex)):(this._setIsShowTooltipAfterZoomFlag(t.clientX,t.clientY),this._hideDragSelection()),this.startClientPosition=null,this.dragStartIndexes=null,this.startLayerX=null,this.afterMouseup=!0},_renderResetZoomBtn:function(){var t=r.create("DIV",o.CLASS_NAME_RESET_ZOOM_BTN);return t.innerHTML="Reset Zoom",t},zoom:function(t){this.prevFoundData=null,this.rerender(t),this._updateDimensionForDragSelection(this.dragSelectionElement),this.resetZoomBtn?t.isResetZoom&&(this.mouseEventDetectorContainer.removeChild(this.resetZoomBtn),this.resetZoomBtn=null):(this.resetZoomBtn=this._renderResetZoomBtn(),r.append(this.mouseEventDetectorContainer,this.resetZoomBtn))}};t.exports=l},function(t,e,i){"use strict";var n=i(11),o=i(10),r=i(6),a=Array.prototype.concat,s=r.defineClass({init:function(t){this.data=this._makeData(t),this.lastGroupIndex=0},_makeData:function(t){var e=0,i=t.length,s=r.map(t,function(t,a){var s=t.data.groupPositions||t.data.groupBounds,h=t.chartType;return(n.isLineTypeChart(h)||n.isRadialChart(h))&&(s=o.pivot(s)),e=Math.max(s.length-1,e),r.map(s,function(t,e){return r.map(t,function(t,n){var o=null;return t&&(o={chartType:h,indexes:{groupIndex:e,index:n},bound:t}),i>1&&(o.indexes.legendIndex=a),o})})});return s=a.apply([],s),this.lastGroupIndex=e,r.filter(a.apply([],s),function(t){return!!t})},findData:function(t,e,i){var n,o=1e5,a={};return e=e||Number.MAX_VALUE,r.forEach(this.data,function(i){var r=t.x-i.bound.left,s=t.y-i.bound.top,h=Math.sqrt(Math.pow(r,2)+Math.pow(s,2));hs+n||ea+o},_showTooltip:function(t,e){var i=t.indexes.groupIndex,n=(this.isVertical?this.layout.position.left:this.layout.position.top)-o.CHART_PADDING;this.tickBaseCoordinateModel.data.length>i&&(this.eventBus.fire("showTooltip",{index:i,range:this.tickBaseCoordinateModel.makeRange(i,n),size:this.dimension[this.sizeType],isVertical:this.isVertical,isMoving:e,silent:t.silent}),this.prevIndex=i)},_hideTooltip:function(t){this.eventBus.fire("hideTooltip",this.prevIndex,t),this.prevIndex=null},_onMousemove:function(t){var e,i;this.zoomable&&this._isAfterDragMouseup()||(e=this._findGroupData(t.clientX,t.clientY),i=e.indexes.groupIndex,i===-1?this._onMouseout(t):this.prevIndex!==i&&this._showTooltip(e))},_onMouseout:function(t){var e;e=this._calculateLayerPosition(t.clientX,t.clientY,!1),this._isOuterPosition(e.x,e.y)&&!s.isNull(this.prevIndex)&&this._hideTooltip()}});n.componentType="mouseEventDetector",t.exports=n},function(t,e,i){"use strict";function n(t){return new l(t)}var o=i(70),r=i(8),a=i(11),s=i(9),h=i(6),l=h.defineClass(o,{init:function(){o.apply(this,arguments),this.prevFoundData=null,this.zoomHistory=[-1],this.historyBackBtn=null},_attachToEventBus:function(){o.prototype._attachToEventBus.call(this),this.eventBus.on("afterZoom",this.onAfterZoom,this)},_showTooltip:function(t){this.eventBus.fire("showTooltip",t),this.prevFoundData=t},_hideTooltip:function(t){this.eventBus.fire("hideTooltip",this.prevFoundData,t),this.prevFoundData=null,this.styleCursor(!1)},styleCursor:function(t){var e=this.mouseEventDetectorContainer;t?e.style.cursor="pointer":e.style.cursor="default"},_onMousemove:function(t){var e,i=t.clientX,n=t.clientY,o=this._calculateLayerPosition(i,n),r=this._findDataFromBoundsCoordinateModel(o);this._isChangedSelectData(this.prevFoundData,r)&&(this.prevFoundData&&this._hideTooltip(),this.prevFoundData=r,r&&(a.isTreemapChart(this.chartType)?(e=this._getSeriesItemByIndexes(r.indexes),this.styleCursor(e.hasChild)):a.isBulletChart(this.chartType)&&(r.mousePosition={left:i,top:n}),this._showTooltip(r)))},_zoomHistoryBack:function(){var t=this.zoomHistory[this.zoomHistory.length-2];this.zoomHistory.pop(),this.eventBus.fire("zoom",t),1===this.zoomHistory.length&&(this.mouseEventDetectorContainer.removeChild(this.historyBackBtn),this.historyBackBtn=null)},_getSeriesItemByIndexes:function(t){var e=this.dataProcessor.getSeriesDataModel(r.CHART_TYPE_TREEMAP);return e.getSeriesItem(t.groupIndex,t.index,!0)},_onClick:function(t){var e,i,n,h=t.target||t.srcElement;if(o.prototype._onClick.call(this,t),a.isTreemapChart(this.chartType)){if(s.hasClass(h,r.CLASS_NAME_RESET_ZOOM_BTN))return this._hideTooltip(),void this._zoomHistoryBack();if(e=this._calculateLayerPosition(t.clientX,t.clientY),i=this._findDataFromBoundsCoordinateModel(e)){if(n=this._getSeriesItemByIndexes(i.indexes),!n.hasChild)return;this._hideTooltip(),this.eventBus.fire("zoom",i.indexes.index)}}},_onMouseout:function(t){var e=this.mouseEventDetectorContainer.getBoundingClientRect(),i=t.clientX,n=t.clientY;e.left<=i&&e.top<=n&&e.right>=i&&e.bottom>=n||(this.prevFoundData&&this._hideTooltip(),this.prevFoundData=null)},onAfterZoom:function(t){this.historyBackBtn||(this.historyBackBtn=s.create("DIV",r.CLASS_NAME_RESET_ZOOM_BTN),this.historyBackBtn.innerHTML="< Back",s.append(this.mouseEventDetectorContainer,this.historyBackBtn)),this.zoomHistory[this.zoomHistory.length-1]!==t&&this.zoomHistory.push(t)},findDataByIndexes:function(t){return this.boundsBaseCoordinateModel.findDataByIndexes(t)}});n.componentType="mouseEventDetector",t.exports=n},function(t,e,i){"use strict";function n(t){var e=t.chartOptions.libType,i=t.chartTheme;return t.libType=e,t.chartType="bar",t.chartBackground=i.chart.background,new l(t)}var o=i(81),r=i(82),a=i(8),s=i(11),h=i(6),l=h.defineClass(o,{init:function(){o.apply(this,arguments)},_makeBound:function(t,e,i,n,o){return{start:{top:i,left:n,width:0,height:e},end:{top:i,left:o,width:t,height:e}}},_calculateAdditionalLeft:function(t){var e=0;return this.options.divided&&t>0&&(e=this.dimensionMap.yAxis.width+a.OVERLAPPING_WIDTH),e},_makeBarChartBound:function(t,e,i,n,o){var r,a,s,h,l=t.baseBarSize*n.ratioDistance,u=this._calculateAdditionalLeft(n.value),c=t.baseBarSize*n.startRatio,d=t.basePosition+c+u,p=n.stack!==e.prevStack;return(!i||!this.options.diverging&&p)&&(r=i?this.dataProcessor.findStackIndex(n.stack):o,e.top=e.baseTop+t.pointInterval*r,e.plusLeft=0,e.minusLeft=0),n.value>=0?(a=d+e.plusLeft,e.plusLeft+=l):(e.minusLeft-=l,a=d+e.minusLeft),e.prevStack=n.stack,h=e.top+t.pointInterval-t.barSize/2,s=this._makeBound(l,t.barSize,h,d,a)},_makeBounds:function(){var t=this,e=this._getSeriesDataModel(),i=s.isValidStackOption(this.options.stackType),n=this.layout.dimension,o=this._makeBaseDataForMakingBound(n.height,n.width);return e.map(function(e,n){var r=n*o.groupSize+t.layout.position.top,a={baseTop:r,top:r,plusLeft:0,minusLeft:0,prevStack:null},s=h.bind(t._makeBarChartBound,t,o,a,i);return e.map(s)})},_calculateTopPositionOfSumLabel:function(t,e){return t.top+(t.height-e+a.TEXT_PADDING)/2}});r.mixin(l),n.componentType="series",n.BarChartSeries=l,t.exports=n},function(t,e,i){"use strict";var n=i(6),o=600,r=n.browser,a=r.msie&&7===r.version,s=i(8),h=i(9),l=i(11),u=i(7),c=i(32),d=i(5),p=n.defineClass({className:"tui-chart-series-area",init:function(t){var e=t.libType;this.chartType=t.chartType,this.seriesType=t.seriesType||t.chartType,this.componentType=t.componentType,this.dataProcessor=t.dataProcessor,this.eventBus=t.eventBus,this.chartBackground=t.chartBackground,this.options=t.options||{},this.orgTheme=this.theme=t.theme,this.graphRenderer=c.get(e,t.chartType),this.seriesContainer=null,this.seriesLabelContainer=null,this.seriesData=[],this.selectedLegendIndex=null,this.labelShowEffector=null,this.paper=null,this.limit=null,this.aligned=null,this.layout=null,this.dimensionMap=null,this.positionMap=null,this.axisDataMap=null,this.beforeAxisDataMap=null,this.drawingType=s.COMPONENT_TYPE_RAPHAEL,this.supportSeriesLable=!0,this._attachToEventBus()},_attachToEventBus:function(){var t=n.bind(function(){this.isInitRenderCompleted=!0,this.eventBus.off("load",t)},this);this.eventBus.on(s.PUBLIC_EVENT_PREFIX+"load",t),this.eventBus.on({selectLegend:this.onSelectLegend,selectSeries:this.onSelectSeries,unselectSeries:this.onUnselectSeries,hoverSeries:this.onHoverSeries,hoverOffSeries:this.onHoverOffSeries,showGroupAnimation:this.onShowGroupAnimation,hideGroupAnimation:this.onHideGroupAnimation},this),this.onShowTooltip&&this.eventBus.on("showTooltip",this.onShowTooltip,this),this.onShowGroupTooltipLine&&this.eventBus.on({showGroupTooltipLine:this.onShowGroupTooltipLine,hideGroupTooltipLine:this.onHideGroupTooltipLine},this),this.onClickSeries&&this.eventBus.on({clickSeries:this.onClickSeries,moveSeries:this.onMoveSeries},this)},_getSeriesDataModel:function(){return this.dataProcessor.getSeriesDataModel(this.seriesType)},_makeSeriesData:function(){},getSeriesData:function(){return this.seriesData},_renderSeriesLabel:function(){},_renderSeriesLabelArea:function(t){return this._renderSeriesLabel(t)},_sendBoundsToMouseEventDetector:function(t){this.eventBus.fire("receiveSeriesData",{chartType:this.chartType,data:t})},_renderSeriesArea:function(t,e){var i,n;i=this.dimensionMap.extendedSeries,this.seriesData=n=this._makeSeriesData(),this._sendBoundsToMouseEventDetector(n),(this.hasDataForRendering(n)||"map"===this.chartType)&&(e&&(this.seriesSet=e(i,n,t)),l.isShowLabel(this.options)&&this.supportSeriesLable&&(this.labelSet=this._renderSeriesLabelArea(t)))},_makeParamsForGraphRendering:function(t,e){return n.extend({dimension:t,position:this.layout.position,chartType:this.seriesType,theme:this.theme,options:this.options},e)},_renderGraph:function(t,e,i){var n=this._makeParamsForGraphRendering(t,e);return this.graphRenderer.render(i,n)},_setDataForRendering:function(t){this.paper=t.paper,this.limit=t.limitMap[this.chartType],t.axisDataMap&&t.axisDataMap.xAxis&&(this.aligned=t.axisDataMap.xAxis.aligned),this.layout=t.layout,this.dimensionMap=t.dimensionMap,this.positionMap=t.positionMap,this.axisDataMap=t.axisDataMap},render:function(t){var e;this.paper=t.paper,this._setDataForRendering(t),this._clearSeriesContainer(),this.beforeAxisDataMap=this.axisDataMap,t.checkedLegends&&(e=t.checkedLegends[this.seriesType],this.options.colorByPoint||(this.theme=this._getCheckedSeriesTheme(this.orgTheme,e))),this._renderSeriesArea(t.paper,n.bind(this._renderGraph,this)),this.paper.pushDownBackgroundToBottom&&this.paper.pushDownBackgroundToBottom()},_getCheckedSeriesTheme:function(t,e){var i;return e.length?(i=JSON.parse(JSON.stringify(t)),i.colors=n.filter(i.colors,function(t,i){return e[i]}),i):t},_clearSeriesContainer:function(){this.seriesSet&&this.seriesSet.remove&&(this.seriesSet.forEach(function(t){t.remove()},this),this.seriesSet.remove()),this.labelSet&&this.labelSet.remove&&(this.labelSet.forEach(function(t){t.remove()},this),this.labelSet.remove()),this.seriesData=[]},rerender:function(t){var e;this.dataProcessor.getGroupCount(this.seriesType)&&(t.checkedLegends&&(e=t.checkedLegends[this.seriesType],this.theme=this._getCheckedSeriesTheme(this.orgTheme,e)),this._setDataForRendering(t),this._clearSeriesContainer(),this._renderSeriesArea(t.paper,n.bind(this._renderGraph,this)),this.labelShowEffector&&clearInterval(this.labelShowEffector.timerId),!e&&this.isInitRenderCompleted||this.animateComponent(!0),n.isNull(this.selectedLegendIndex)||this.graphRenderer.selectLegend(this.selectedLegendIndex))},_isLabelVisible:function(){return!(!this.options.showLabel&&!this.options.showLegend)},_resizeGraph:function(t,e){return this.graphRenderer.resize(n.extend({dimension:this.dimensionMap.chart},e)),this.seriesSet},resize:function(t){this._clearSeriesContainer(),this._setDataForRendering(t),this._renderSeriesArea(t.paper,n.bind(this._resizeGraph,this))},_renderPosition:function(t,e){var i=u.isOldBrowser()?1:0;u.renderPosition(t,{top:e.top-i,left:e.left-2*i})},_getLimitDistanceFromZeroPoint:function(t,e){var i=e.min,n=e.max,o=n-i,r=0,a=0;return i<=0&&n>=0?(r=(o+i)/o*t,a=(o-n)/o*t):i>0&&(r=t),{toMax:r,toMin:a}},_findLabelElement:function(t){var e=null;return e=h.hasClass(t,s.CLASS_NAME_SERIES_LABEL)?t:h.findParentByClass(t,s.CLASS_NAME_SERIES_LABEL)},onHoverSeries:function(t,e){e===this.chartType&&this.graphRenderer.showAnimation&&this.graphRenderer.showAnimation(t)},onHoverOffSeries:function(t,e){e===this.chartType&&this.graphRenderer.hideAnimation&&t&&this.graphRenderer.hideAnimation(t)},onShowGroupAnimation:function(t){this.graphRenderer.showGroupAnimation&&this.graphRenderer.showGroupAnimation(t)},onHideGroupAnimation:function(t){this.graphRenderer.hideGroupAnimation&&this.graphRenderer.hideGroupAnimation(t)},animateComponent:function(t){this.graphRenderer.animate&&this.seriesSet?this.graphRenderer.animate(n.bind(this.animateSeriesLabelArea,this,t),this.seriesSet):this.animateSeriesLabelArea(t)},_fireLoadEvent:function(t){t||this.eventBus.fire(s.PUBLIC_EVENT_PREFIX+"load")},animateSeriesLabelArea:function(t){return this._isLabelVisible()?void(a?(this._fireLoadEvent(t),this.labelSet.attr({opacity:1})):this.labelSet&&this.labelSet.length&&d.animateOpacity(this.labelSet,0,1,o)):void this._fireLoadEvent(t)},_makeExportationSeriesData:function(t){var e,i=t.indexes,o=n.isExisty(i.legendIndex)?i.legendIndex:i.index,r=this.dataProcessor.getLegendItem(o),a=n.isExisty(i.groupIndex)?i.groupIndex:0,s=this._getSeriesDataModel().getSeriesItem(a,i.index);return n.isExisty(s)&&(e={chartType:r.chartType,legend:r.label,legendIndex:o},e.index=s.index),e},_executeGraphRenderer:function(t,e){var i,n=!1;return this.eventBus.fire("hideTooltipContainer"),this.seriesLabelContainer&&h.hasClass(this.seriesLabelContainer,"show")&&(h.removeClass(this.seriesLabelContainer,"show"),n=!0),i=this.graphRenderer[e](t),n&&h.addClass(this.seriesLabelContainer,"show"),this.eventBus.fire("showTooltipContainer"),i},onSelectSeries:function(t,e){var i;t.chartType===this.chartType&&(i=s.PUBLIC_EVENT_PREFIX+"selectSeries",this.eventBus.fire(i,this._makeExportationSeriesData(t)),e=!!n.isEmpty(e)||e,this.options.allowSelect&&this.graphRenderer.selectSeries&&e&&this.graphRenderer.selectSeries(t.indexes))},onUnselectSeries:function(t){var e;t.chartType===this.chartType&&(e=s.PUBLIC_EVENT_PREFIX+"unselectSeries",this.eventBus.fire(e,this._makeExportationSeriesData(t)),this.options.allowSelect&&this.graphRenderer.unselectSeries&&this.graphRenderer.unselectSeries(t.indexes))},onSelectLegend:function(t,e){this.seriesType===t||n.isNull(e)||(e=-1),this.selectedLegendIndex=e,this._getSeriesDataModel().getGroupCount()&&this.graphRenderer.selectLegend(e)},showLabel:function(){this.options.showLabel=!0,!this.seriesLabelContainer&&this.supportSeriesLable&&this._renderSeriesLabelArea(this.paper)},hideLabel:function(){this.options.showLabel=!1,this.seriesLabelContainer&&(h.removeClass(this.seriesLabelContainer,"show"),h.removeClass(this.seriesLabelContainer,"opacity"))},hasDataForRendering:function(t){return!(!t||!t.isAvailable())}});t.exports=p},function(t,e,i){"use strict";var n=i(8),o=i(83),r=i(11),a=i(45),s=i(7),h=i(5),l=i(6),u=.8,c=l.defineClass({_makeSeriesData:function(){var t=this._makeBounds(this.layout.dimension);return this.groupBounds=t,{groupBounds:t,seriesDataModel:this._getSeriesDataModel(),isAvailable:function(){return t&&t.length>0}}},_getBarWidthOptionSize:function(t,e){var i=0;return e&&(e/2>=t?e=2*t:e<0&&(e=0),i=e),i},_calculateAdditionalPosition:function(t,e,i){var n=0;return e&&e0&&(o=d?this.options.diverging?1:this.dataProcessor.getStackCount(this.seriesType):p.getFirstSeriesGroup().getSeriesItemCount(),l=f/(o+1),a=l*u,s=this.options.barWidth||this.options.pointWidth,a=this._getBarWidthOptionSize(l,s)||a,h=g+i,r.isColumnChart(this.chartType)&&(h=e-h),r.isBoxplotChart(this.chartType)&&g&&(h-=2*g),c={baseBarSize:e,groupSize:f,barSize:a,pointInterval:l,firstAdditionalPosition:l,basePosition:h}),c},_renderNormalSeriesLabel:function(t){var e,i=this.graphRenderer,n=this._getSeriesDataModel(),a=this.seriesData.groupBounds,s=this.theme.label,h=this.selectedLegendIndex,u=n.map(function(t){return t.map(function(t){var e={end:t.endLabel};return l.isExisty(t.start)&&(e.start=t.startLabel),e})});return e=r.isBarChart(this.chartType)?o.boundsToLabelPositionsForBarChart(n,a,s):o.boundsToLabelPositionsForColumnChart(n,a,s),i.renderSeriesLabel(t,e,u,s,h)},_makeSumValues:function(t){var e=a.sum(t);return s.formatValue({value:e,formatFunctions:this.dataProcessor.getFormatFunctions(),chartType:this.chartType,areaType:"series"})},_makeStackedLabelPosition:function(t){var e=t.left+t.width/2,i=t.top+t.height/2;return{left:e,top:i}},_makeStackedLabelPositions:function(t){var e=this,i=t.seriesGroup,n=i.map(function(i,n){var o,r=t.bounds[n];return r&&i&&(o=e._makeStackedLabelPosition(r.end)),{end:o}});return n},getGroupLabels:function(t,e,i){var n=r.isNormalStack(this.options.stackType);return t.map(function(t){var o,r=t.map(function(t){return{end:t.endLabel}});return n&&(e.push(a.sumPlusValues(t.pluck("value"))),o=a.sumMinusValues(t.pluck("value")),o<0&&i.push(o)),r})},getGroupPositions:function(t,e){var i=this;return t.map(function(t,n){return i._makeStackedLabelPositions({seriesGroup:t,bounds:e[n]})})},_renderStackedSeriesLabel:function(t){var e=this,i=[],o=[],a=this.theme.label,u=this.seriesData.groupBounds,c=this._getSeriesDataModel(),d=this.getGroupPositions(c,u),p=this.getGroupLabels(c,i,o),f=!0,m=r.isNormalStack(this.options.stackType),g=r.isBarChart(this.chartType),_=g?"width":"height",T=g?"left":"top",v=g?1:-1;return m&&(l.forEach(p,function(t,n){var r=i[n],a=o[n];a<0&&e.options.diverging&&(a*=-1),t.push({end:s.formatToComma(r)}),o.length&&t.push({end:s.formatToComma(a)})}),l.forEach(d,function(t,r){var s=u[r],l=s[s.length-1].end,c=s[Math.max(parseInt(s.length/2,10),1)-1].end,d=e._makeStackedLabelPosition(l),p=e._makeStackedLabelPosition(c),f=i[r],m=o[r],g=h.getRenderedTextSize(f,a.fontSize,a.fontFamily),y=h.getRenderedTextSize(m,a.fontSize,a.fontFamily),x=(l[_]+g[_])/2,A=(c[_]+y[_])/2;d[T]+=(x+n.LEGEND_LABEL_LEFT_PADDING)*v,p[T]-=(A+n.LEGEND_LABEL_LEFT_PADDING)*v,t.push({end:d}),o.length&&t.push({end:p})})),this.graphRenderer.renderSeriesLabel(t,d,p,a,f)},_renderSeriesLabel:function(t){var e;return e=this.options.stackType?this._renderStackedSeriesLabel(t):this._renderNormalSeriesLabel(t)}});c.mixin=function(t){l.extend(t.prototype,c.prototype)},t.exports=c},function(t,e,i){"use strict";var n=i(8),o=i(7),r=i(6),a={_calculateLeftPositionForCenterAlign:function(t){return t.left+t.width/2},_calculateTopPositionForMiddleAlign:function(t){return t.top+t.height/2},_makePositionForBoundType:function(t){return{left:this._calculateLeftPositionForCenterAlign(t),top:this._calculateTopPositionForMiddleAlign(t)}},_makePositionMap:function(t,e,i,n,o){var r=t.value,a=r>=0,s={end:o(e,i,t.endLabel||t.label,n,a)};return t.isRange&&(a=r<0,s.start=o(e,i,t.startLabel,n,a)),s},boundsToLabelPositions:function(t,e,i,a,s){var h=this,l=o.getRenderedLabelHeight(n.MAX_HEIGHT_WORD,i);return a=a||r.bind(this._makePositionForBoundType,this),s=!!s,t.map(function(t,n){var o=e[n];return t.map(function(t,e){var n=o[e].end;return h._makePositionMap(t,n,l,i,a)})},s)},_makePositionForBarChart:function(t,e,i,r,a){var s=o.getRenderedLabelWidth(i,r),h=t.left;return a?h+=t.width+n.SERIES_LABEL_PADDING:h-=s+n.SERIES_LABEL_PADDING,{left:h,top:this._calculateTopPositionForMiddleAlign(t)}},boundsToLabelPositionsForBarChart:function(t,e,i){var n=r.bind(this._makePositionForBarChart,this);return this.boundsToLabelPositions(t,e,i,n)},_makePositionForColumnChart:function(t,e,i,o,r){var a=t.top;return r?a-=e+n.SERIES_LABEL_PADDING:a+=t.height+n.SERIES_LABEL_PADDING,{left:this._calculateLeftPositionForCenterAlign(t),top:a}},boundsToLabelPositionsForColumnChart:function(t,e,i){var n=r.bind(this._makePositionForColumnChart,this);return this.boundsToLabelPositions(t,e,i,n)},boundsToLabelPostionsForTreemap:function(t,e){var i=this,n=r.map(t,function(t){var n,o=e[t.id];return o&&(n=i._makePositionForBoundType(o)),n});return n}};t.exports=a},function(t,e,i){"use strict";function n(t){var e=t.chartOptions.libType,i=t.chartTheme;return t.libType=e,t.chartType="column",t.chartBackground=i.chart.background,new u(t)}var o=i(81),r=i(82),a=i(8),s=i(11),h=i(7),l=i(6),u=l.defineClass(o,{init:function(){o.apply(this,arguments)},_makeBound:function(t,e,i,n,o){return{start:{top:n,left:i,width:t,height:0},end:{top:o,left:i,width:t,height:e}}},_makeColumnChartBound:function(t,e,i,n,o){var r,s,h,l,u=Math.abs(t.baseBarSize*n.ratioDistance),c=t.baseBarSize*n.startRatio,d=t.basePosition+c+a.SERIES_EXPAND_SIZE,p=n.stack!==e.prevStack;return(!i||!this.options.diverging&&p)&&(r=i?this.dataProcessor.findStackIndex(n.stack):o,e.left=e.baseLeft+t.pointInterval*r,e.plusTop=0,e.minusTop=0),n.value>=0?(e.plusTop-=u,s=d+e.plusTop):(s=d+e.minusTop,e.minusTop+=u),e.prevStack=n.stack,l=e.left+t.pointInterval-t.barSize/2,h=this._makeBound(t.barSize,u,l,d,s)},_makeBounds:function(){var t=this,e=this._getSeriesDataModel(),i=s.isValidStackOption(this.options.stackType),n=this.layout.dimension,o=this._makeBaseDataForMakingBound(n.width,n.height);return e.map(function(e,n){var r=n*o.groupSize+t.layout.position.left,a={baseLeft:r,left:r,plusTop:0,minusTop:0,prevStack:null},s=l.bind(t._makeColumnChartBound,t,o,a,i);return e.map(s)})},_calculateLeftPositionOfSumLabel:function(t,e){var i=h.getRenderedLabelWidth(e,this.theme.label);return t.left+(t.width-i+a.TEXT_PADDING)/2}});r.mixin(u),n.componentType="series",n.ColumnChartSeries=u,t.exports=n},function(t,e,i){"use strict";function n(t){var e=t.chartOptions.libType,i=t.chartTheme;return t.libType=e,t.chartType="line",t.chartBackground=i.chart.background,new s(t)}var o=i(81),r=i(86),a=i(6),s=a.defineClass(o,{init:function(){o.apply(this,arguments),this.movingAnimation=null},_makePositions:function(t){return this._makeBasicPositions(t)},_makeSeriesData:function(){var t=this._makePositions();return{chartBackground:this.chartBackground,groupPositions:t,isAvailable:function(){return t&&t.length>0}}},rerender:function(t){var e;return this._cancelMovingAnimation(),e=o.prototype.rerender.call(this,t)}});r.mixin(s),n.componentType="series",t.exports=n},function(t,e,i){"use strict";var n=i(10),o=i(8),r=i(11),a=i(45),s=i(7),h=i(6),l=h.defineClass({_makePositionsForDefaultType:function(t){var e,i=this.layout.dimension,n=this._getSeriesDataModel(),o=t||i.width||0,r=i.height,a=n.getGroupCount(),s=this.layout.position.top,l=this.layout.position.left;return this.aligned?e=o/(a>1?a-1:a):(e=o/a,l+=e/2),n.map(function(t){return t.map(function(t,i){var n;return h.isNull(t.end)||(n={left:l+e*i,top:s+r-t.ratio*r},h.isExisty(t.startRatio)&&(n.startTop=s+r-t.startRatio*r)),n})},!0)},_makePositionForCoordinateType:function(t){var e=this.layout.dimension,i=this._getSeriesDataModel(),n=t||e.width||0,r=e.height,s=this.axisDataMap.xAxis,l=0,u=this.layout.position.top,c=this.layout.position.left;return s.sizeRatio&&(l=a.multiply(n,s.positionRatio),n=a.multiply(n,s.sizeRatio)),i.map(function(t){return t.map(function(t){var e;return h.isNull(t.end)||(e={left:c+t.ratioMap.x*n+l,top:u+r-t.ratioMap.y*r},h.isExisty(t.ratioMap.start)&&(e.startTop=r-t.ratioMap.start*r+o.SERIES_EXPAND_SIZE)),e})},!0)},_makeBasicPositions:function(t){var e;return e=this.dataProcessor.isCoordinateType()?this._makePositionForCoordinateType(t):this._makePositionsForDefaultType(t)},_calculateLabelPositionTop:function(t,e,i,n){var a,s=t.top;return a=r.isValidStackOption(this.options.stackType)?(t.startTop+s-i)/2+1:e>=0&&!n||e<0&&n?s-i-o.SERIES_LABEL_PADDING:s+o.SERIES_LABEL_PADDING},_makeLabelPosition:function(t,e,i,n,o){return{left:t.left,top:this._calculateLabelPositionTop(t,n,e/2,o)}},_getLabelPositions:function(t,e){var i=this,r=n.pivot(this.seriesData.groupPositions),a=s.getRenderedLabelHeight(o.MAX_HEIGHT_WORD,e);return t.map(function(t,e){return t.map(function(t,n){var o=r[e][n],s=i._makeLabelPosition(o,a,t.endLabel,t.end),h={end:s};return t.isRange&&(o.top=o.startTop,h.start=i._makeLabelPosition(o,a,t.startLabel,t.start)),h})})},_getLabelTexts:function(t){return t.map(function(t){return t.map(function(t){var e={end:t.endLabel};return t.isRange&&(e.start=t.startLabel),e})})},_renderSeriesLabel:function(t){var e=this.theme.label,i=this._getSeriesDataModel(),n=this._getLabelTexts(i),o=this._getLabelPositions(i,e);return this.graphRenderer.renderSeriesLabel(t,o,n,e)},onShowGroupTooltipLine:function(t){this.graphRenderer.showGroupTooltipLine&&this.graphRenderer.showGroupTooltipLine(t,this.layout)},onHideGroupTooltipLine:function(){this.seriesData&&this.seriesData.isAvailable()&&this.graphRenderer.hideGroupTooltipLine&&this.graphRenderer.hideGroupTooltipLine()},zoom:function(t){this._cancelMovingAnimation(),this._clearSeriesContainer(t.paper),this._setDataForRendering(t),this._renderSeriesArea(t.paper,h.bind(this._renderGraph,this)),this.animateComponent(!0),h.isNull(this.selectedLegendIndex)||this.graphRenderer.selectLegend(this.selectedLegendIndex)},_isChangedLimit:function(t,e){return t.min!==e.min||t.max!==e.max},_isChangedAxisLimit:function(){var t=this.beforeAxisDataMap,e=this.axisDataMap,i=!0;return t&&(i=this._isChangedLimit(t.yAxis.limit,e.yAxis.limit),e.xAxis.limit&&(i=i||this._isChangedLimit(t.xAxis.limit,e.xAxis.limit))),this.beforeAxisDataMap=e,i},_animate:function(t){var e=this,i=o.ADDING_DATA_ANIMATION_DURATION,n=this._isChangedAxisLimit();n&&this.seriesLabelContainer&&(this.seriesLabelContainer.innerHTML=""),t&&(this.movingAnimation=s.startAnimation(i,t,function(){e.movingAnimation=null}))},_makeZeroTopForAddingData:function(){var t=this.layout.dimension.height,e=this.axisDataMap.yAxis.limit;return this._getLimitDistanceFromZeroPoint(t,e).toMax+o.SERIES_EXPAND_SIZE},animateForAddingData:function(t){var e,i,n,o,r=this.dimensionMap.extendedSeries,a=this.layout.dimension.width,s=t.tickSize,h=this.options.shifting;this.limit=t.limitMap[this.chartType],this.axisDataMap=t.axisDataMap,e=this._makeSeriesData(),i=this._makeParamsForGraphRendering(r,e),h&&(a+=s),n=this._makePositions(a),o=this._makeZeroTopForAddingData(),this.graphRenderer.animateForAddingData(i,s,n,h,o)},_cancelMovingAnimation:function(){this.movingAnimation&&(cancelAnimationFrame(this.movingAnimation.id),this.movingAnimation=null)}});l.mixin=function(t){h.extend(t.prototype,l.prototype)},t.exports=l},function(t,e,i){"use strict";function n(t){var e=t.chartOptions.chartType,i=t.chartOptions.libType,n=t.chartTheme;return t.libType=i,t.chartType=e,t.chartBackground=n.background,new h(t)}var o=i(81),r=i(8),a=i(49),s=i(6),h=s.defineClass(o,{init:function(){o.apply(this,arguments),this.options=s.extend({showDot:!0,showArea:!0},this.options),this.movingAnimation=null,this.drawingType=r.COMPONENT_TYPE_RAPHAEL},_makePositionsForRadial:function(t,e){var i,n=this.layout,o=n.dimension,h=o.width-r.RADIAL_PLOT_PADDING-r.RADIAL_MARGIN_FOR_CATEGORY,l=o.height-r.RADIAL_PLOT_PADDING-r.RADIAL_MARGIN_FOR_CATEGORY,u=h/2+r.RADIAL_PLOT_PADDING/2+r.RADIAL_MARGIN_FOR_CATEGORY/2+n.position.left,c=l/2-r.RADIAL_PLOT_PADDING/2-r.RADIAL_MARGIN_FOR_CATEGORY/2-n.position.top,d=360/e;return i=Math.min(h,l)/2,s.map(t,function(t){var e=s.map(t,function(t,e){var n,o,r,h,p;return s.isNull(t.end)||(p=t.ratio*i,o=c+p,r=360-d*e,h=a.rotatePointAroundOrigin(u,c,u,o,r),n={left:h.x,top:l-h.y}),n});return e.push(e[0]),e},!0)},_getSeriesGroups:function(){var t=this._getSeriesDataModel();return t.map(function(t){return t.map(function(t){return t})},!0)},_makeSeriesData:function(){var t=this._getSeriesGroups(),e=this._makePositionsForRadial(t,this._getSeriesDataModel().getGroupCount());return{groupPositions:e,isAvailable:function(){return e&&e.length>0}}},rerender:function(t){return o.prototype.rerender.call(this,t)}});n.componentType="series",n.RadialChartSeries=h, +t.exports=n},function(t,e,i){"use strict";function n(t){var e=t.chartOptions.libType,i=t.chartTheme;return t.libType=e,t.chartType="area",t.chartBackground=i.chart.background,new h(t)}var o=i(81),r=i(86),a=i(11),s=i(6),h=s.defineClass(o,{init:function(){o.apply(this,arguments),this.movingAnimation=null},_makePositionTopOfZeroPoint:function(){var t=this.layout.dimension,e=this.axisDataMap.yAxis.limit,i=this.layout.position.top,n=this._getLimitDistanceFromZeroPoint(t.height,e).toMax+i;return e.min>=0&&!n&&(n=t.height),n},_makeStackedPositions:function(t){var e=this.layout.dimension.height,i=this.layout.position.top,n=this._makePositionTopOfZeroPoint(),o=[];return s.map(t,function(t){return s.map(t,function(t,r){var a=o[r]||n,s=t?t.top:0,h=e-s+i,l=t?a-h:a;return t&&(t.startTop=a,t.top=l),o[r]=l,t})})},_makePositions:function(t){var e=this._makeBasicPositions(t);return a.isValidStackOption(this.options.stackType)&&(e=this._makeStackedPositions(e)),e},_makeSeriesData:function(){var t=this.layout.dimension,e=this.layout.position.top,i=this._getLimitDistanceFromZeroPoint(t.height,this.limit).toMax+e,n=this._makePositions();return{chartBackground:this.chartBackground,groupPositions:n,hasRangeData:this._getSeriesDataModel().hasRangeData(),zeroTop:i,isAvailable:function(){return n&&n.length>0}}},rerender:function(t){var e;return this._cancelMovingAnimation(),e=o.prototype.rerender.call(this,t)}});r.mixin(h),n.componentType="series",n.AreaChartSeries=h,t.exports=n},function(t,e,i){"use strict";function n(t){var e=t.chartOptions.libType,i=t.chartTheme;return t.libType=e,t.chartType="bubble",t.chartBackground=i.chart.background,new h(t)}var o=i(8),r=i(81),a=i(90),s=i(6),h=s.defineClass(r,{init:function(){this.prevClickedIndex=null,this.maxRadius=null,this.drawingType=o.COMPONENT_TYPE_RAPHAEL,r.apply(this,arguments)},_calculateStep:function(){var t,e,i,n=0,o=this.dataProcessor.isXCountGreaterThanYCount(this.chartType);return this.dataProcessor.hasCategories(o)&&(t=this.layout.dimension,i=this.dataProcessor.getCategoryCount(o),e=o?t.height:t.width,n=e/i),n},_makeBound:function(t,e,i){var n=this.layout.dimension,o=this.layout.position,r=s.isExisty(t.x)?t.x*n.width:e,a=s.isExisty(t.y)?t.y*n.height:e;return{left:o.left+r,top:o.top+n.height-a,radius:Math.max(i*t.r,2)}},_makeBounds:function(){var t=this,e=this._getSeriesDataModel(),i=this.maxRadius,n=this._calculateStep(),o=n?n/2:0;return e.map(function(e,r){var a=o+n*r;return e.map(function(e){var n=e&&e.ratioMap;return n?t._makeBound(e.ratioMap,a,i):null})})},_setDataForRendering:function(t){this.maxRadius=t.maxRadius,r.prototype._setDataForRendering.call(this,t)}});a.mixin(h),n.componentType="series",n.BubbleChartSeries=h,t.exports=n},function(t,e,i){"use strict";var n=i(6),o=n.defineClass({_makeSeriesData:function(){var t=this._makeBounds();return{groupBounds:t,seriesDataModel:this._getSeriesDataModel(),isAvailable:function(){return t&&t.length>0}}},showTooltip:function(t,e,i,o,r){this.eventBus.fire("showTooltip",n.extend({indexes:{groupIndex:i,index:o},mousePosition:r},t))},hideTooltip:function(){this.eventBus.fire("hideTooltip")},_renderGraph:function(t,e,i){var o=n.bind(this.showTooltip,this,{chartType:this.chartType}),r={showTooltip:o,hideTooltip:n.bind(this.hideTooltip,this)},a=this._makeParamsForGraphRendering(t,e);return this.graphRenderer.render(i,a,r)},onClickSeries:function(t){var e,i=this._executeGraphRenderer(t,"findIndexes"),n=this.prevClickedIndexes,o=this.options.allowSelect;i&&n&&(this.onUnselectSeries({indexes:n}),this.prevClickedIndexes=null),i&&(e=!n||i.index!==n.index||i.groupIndex!==n.groupIndex,o&&!e||(this.onSelectSeries({chartType:this.chartType,indexes:i},e),o&&(this.prevClickedIndexes=i)))},onMoveSeries:function(t){this._executeGraphRenderer(t,"moveMouseOnSeries")}});o.mixin=function(t){n.extend(t.prototype,o.prototype)},t.exports=o},function(t,e,i){"use strict";function n(t){var e=t.chartOptions.libType,i=t.chartTheme;return t.libType=e,t.chartType="scatter",t.chartBackground=i.chart.background,new h(t)}var o=i(81),r=i(90),a=i(8),s=i(6),h=s.defineClass(o,{init:function(){this.prevClickedIndex=null,o.apply(this,arguments)},_makeBound:function(t){var e=this.layout.dimension,i=this.layout.position;return{left:i.left+t.x*e.width,top:e.height-t.y*e.height+i.top,radius:a.SCATTER_RADIUS}},_makeBounds:function(){var t=this,e=this._getSeriesDataModel();return e.map(function(e){return e.map(function(e){var i=e&&e.ratioMap;return i?t._makeBound(e.ratioMap):null})})}});r.mixin(h),n.componentType="series",n.ScatterChartSeries=h,t.exports=n},function(t,e,i){"use strict";function n(t){var e=t.chartOptions.libType;return t.libType=e,t.chartType="map",new l(t)}var o=i(81),r=i(8),a=i(6),s=a.browser,h=s.msie&&s.version<=8,l=a.defineClass(o,{init:function(t){this.basePosition={left:0,top:0},this.zoomMagn=1,this.mapRatio=1,this.graphDimension={},this.limitPosition={},this.mapModel=t.mapModel,this.colorSpectrum=t.colorSpectrum,this.prevPosition=null,this.prevMovedIndex=null,this.isDrag=!1,this.startPosition=null,o.call(this,t)},_attachToEventBus:function(){o.prototype._attachToEventBus.call(this),h||this.eventBus.on({dragStartMapSeries:this.onDragStartMapSeries,dragMapSeries:this.onDragMapSeries,dragEndMapSeries:this.onDragEndMapSeries,zoomMap:this.onZoomMap},this)},_setMapRatio:function(t){var e=this.layout.dimension,i=t||this.mapModel.getMapDimension(),n=e.width/i.width,o=e.height/i.height;this.mapRatio=Math.min(n,o)},_setGraphDimension:function(){var t=this.layout.dimension;this.graphDimension={width:t.width*this.zoomMagn,height:t.height*this.zoomMagn}},render:function(t){o.prototype.render.call(this,t),this._setMapRatio()},_setLimitPositionToMoveMap:function(){var t=this.layout.dimension,e=this.graphDimension;this.limitPosition={left:t.width-e.width,top:t.height-e.height}},_renderGraph:function(){this._setGraphDimension(),this._setLimitPositionToMoveMap(),this.graphRenderer.render(this.paper,{colorSpectrum:this.colorSpectrum,mapModel:this.mapModel,layout:this.layout,theme:this.theme})},_renderSeriesLabel:function(){var t=this.mapModel.getLabelData(this.zoomMagn*this.mapRatio);return this.graphRenderer.renderSeriesLabels(this.paper,t,this.theme.label)},_renderSeriesArea:function(t,e,i){o.prototype._renderSeriesArea.call(this,t,e,i)},_adjustMapPosition:function(t){return{left:Math.max(Math.min(t.left,0),this.limitPosition.left),top:Math.max(Math.min(t.top,0),this.limitPosition.top)}},_updateBasePositionForZoom:function(t,e,i){var n=this.basePosition,o=n.left-e.left/2,r=n.top-e.top/2,a={left:o*i+this.limitPosition.left/2,top:r*i+this.limitPosition.top/2};this.basePosition=this._adjustMapPosition(a)},_zoom:function(t,e){var i=this.graphDimension,n=this.limitPosition;this._setGraphDimension(),this._setLimitPositionToMoveMap(),this._updateBasePositionForZoom(i,n,t),this._setMapRatio(this.graphDimension),this.graphRenderer.scaleMapPaths(t,e,this.mapRatio,i,i)},_updatePositionsToResize:function(t){var e=this.mapRatio/t;this.basePosition.left*=e,this.basePosition.top*=e,this.limitPosition.left*=e,this.limitPosition.top*=e},onClickSeries:function(t){var e=this._executeGraphRenderer(t,"findSectorIndex");a.isNull(e)||this.eventBus.fire("selectSeries",{chartType:this.chartType,index:e,code:this.mapModel.getDatum(e).code})},_isChangedPosition:function(t,e){return!t||t.left!==e.left||t.top!==e.top},_showWedge:function(t){var e=this.mapModel.getDatum(t);a.isUndefined(e.ratio)||this.eventBus.fire("showWedge",e.ratio)},_showTooltip:function(t,e){this.eventBus.fire("showTooltip",{chartType:this.chartType,indexes:{index:t},mousePosition:{left:e.left,top:e.top-r.TOOLTIP_GAP}})},onMoveSeries:function(t){var e=this._executeGraphRenderer(t,"findSectorIndex");a.isNull(e)?a.isNull(this.prevMovedIndex)||(this.graphRenderer.restoreColor(this.prevMovedIndex),this.eventBus.fire("hideTooltip"),this.prevMovedIndex=null):(this.prevMovedIndex!==e&&(a.isNull(this.prevMovedIndex)||(this.graphRenderer.restoreColor(this.prevMovedIndex),this.eventBus.fire("hideTooltip")),this.graphRenderer.changeColor(e)),this._isChangedPosition(this.prevPosition,t)&&(this._showTooltip(e,{left:t.left,top:t.top}),this.prevMovedIndex=e),this._showWedge(e)),this.prevPosition=t},onDragStartMapSeries:function(t){this.startPosition={left:t.left,top:t.top}},_movePosition:function(t,e){var i={x:(e.left-t.left)*this.mapRatio,y:(e.top-t.top)*this.mapRatio};this.graphRenderer.moveMapPaths(i,this.graphDimension)},onDragMapSeries:function(t){this._movePosition(this.startPosition,t),this.startPosition=t,this.isDrag||(this.isDrag=!0,this.eventBus.fire("hideTooltip"))},onDragEndMapSeries:function(){this.isDrag=!1},onZoomMap:function(t,e){var i=t/this.zoomMagn,n=this.layout.position,o=e?e:{left:this.layout.dimension.width/2,top:this.layout.dimension.height/2};this.zoomMagn=t,this._zoom(i,{left:o.left-n.left,top:o.top-n.top}),this.eventBus.fire(r.PUBLIC_EVENT_PREFIX+"zoom",t)},_makeExportationSeriesData:function(t){return t}});n.componentType="series",n.MapChartSeries=l,t.exports=n},function(t,e,i){"use strict";function n(t){var e=t.chartOptions.libType,i=t.chartTheme,n=t.chartOptions.chartType,o=t.chartOptions.legend;return t.libType=e,t.chartType="pie","combo"===n&&(t.seriesType=t.name.split("Series")[0],t.isCombo=!0),o&&(t.legendMaxWidth=o.maxWidth),t.chartBackground=i.chart.background,new l(t)}var o=i(81),r=i(8),a=i(11),s=i(6),h=i(5),l=s.defineClass(o,{init:function(t){o.call(this,t),this.isCombo=!!t.isCombo,this.isShowOuterLabel=a.isShowOuterLabel(this.options),this.quadrantRange=null,this.prevClickedIndex=null,this.drawingType=r.COMPONENT_TYPE_RAPHAEL,this.legendMaxWidth=t.legendMaxWidth,this._setDefaultOptions()},_makeValidAngle:function(t,e){return s.isUndefined(t)?t=e:t<0?t=r.ANGLE_360-Math.abs(t)%r.ANGLE_360:t>0&&(t%=r.ANGLE_360),t},_transformRadiusRange:function(t){return t=t||["0%","100%"],s.map(t,function(t){var e=.01*parseInt(t,10);return Math.max(Math.min(e,1),0)})},_setDefaultOptions:function(){var t=this.options;t.startAngle=this._makeValidAngle(t.startAngle,0),t.endAngle=this._makeValidAngle(t.endAngle,t.startAngle),t.radiusRange=this._transformRadiusRange(t.radiusRange),1===t.radiusRange.length&&t.radiusRange.unshift(0)},_calculateAngleForRendering:function(){var t,e=this.options.startAngle,i=this.options.endAngle;return t=ei?r.ANGLE_360-(e-i):r.ANGLE_360},_makeSectorData:function(t){var e,i=this,n=this._getSeriesDataModel().getFirstSeriesGroup(),o=t.cx,r=t.cy,a=t.r,h=this.options.startAngle,l=this._calculateAngleForRendering(),u=10,c=this.options.radiusRange[0],d=.5*a;return c&&(d+=d*c),n?e=n.map(function(t){var e=t?t.ratio:0,n=l*e,c=h+n,p=h+n/2,f={start:{startAngle:h,endAngle:h},end:{startAngle:h,endAngle:c}},m={cx:o,cy:r,angle:p};return h=c,{ratio:e,angles:f,centerPosition:i._getArcPosition(s.extend({r:d},m)),outerPosition:{start:i._getArcPosition(s.extend({r:a},m)),middle:i._getArcPosition(s.extend({r:a+u},m))}}}):null},_makeSeriesData:function(){var t=this._makeCircleBound(),e=this._makeSectorData(t);return{chartBackground:this.chartBackground,circleBound:t,sectorData:e,isAvailable:function(){return e&&e.length>0}}},_getQuadrantFromAngle:function(t,e){var i=parseInt(t/r.ANGLE_90,10)+1;return e&&t%r.ANGLE_90===0&&(i+=1===i?3:-1),i},_getRangeForQuadrant:function(){return this.quadrantRange||(this.quadrantRange={start:this._getQuadrantFromAngle(this.options.startAngle),end:this._getQuadrantFromAngle(this.options.endAngle,!0)}),this.quadrantRange},_isInQuadrantRange:function(t,e){var i=this._getRangeForQuadrant();return i.start===t&&i.end===e},_calculateBaseSize:function(){var t,e=this.layout.dimension,i=e.width,n=e.height;return this.isCombo||(t=this._getRangeForQuadrant(),this._isInQuadrantRange(2,3)||this._isInQuadrantRange(4,1)?n*=2:this._isInQuadrantRange(1,2)||this._isInQuadrantRange(3,4)?i*=2:t.start===t.end&&(i*=2,n*=2)),Math.min(i,n)},_calculateRadius:function(){var t=this.isShowOuterLabel?r.PIE_GRAPH_SMALL_RATIO:r.PIE_GRAPH_DEFAULT_RATIO,e=this._calculateBaseSize();return e*t*this.options.radiusRange[1]/2},_calculateCenterXY:function(t){var e=this.layout.dimension,i=this.layout.position,n=t/2,o=e.width/2+i.left,r=e.height/2+i.top;return this.isCombo||(this._isInQuadrantRange(1,1)?(o-=n,r+=n):this._isInQuadrantRange(1,2)?o-=n:this._isInQuadrantRange(2,2)?(o-=n,r-=n):this._isInQuadrantRange(2,3)?r-=n:this._isInQuadrantRange(3,3)?(o+=n,r-=n):this._isInQuadrantRange(3,4)?o+=n:this._isInQuadrantRange(4,1)?r+=n:this._isInQuadrantRange(4,4)&&(o+=n,r+=n)),{cx:o,cy:r}},_makeCircleBound:function(){var t=this._calculateRadius(),e=this._calculateCenterXY(t);return s.extend({r:t},e)},_getArcPosition:function(t){return{left:t.cx+t.r*Math.sin(t.angle*r.RAD),top:t.cy-t.r*Math.cos(t.angle*r.RAD)}},_renderGraph:function(t,e,i){var n=s.bind(this.showTooltip,this,{allowNegativeTooltip:!!this.allowNegativeTooltip,seriesType:this.seriesType,chartType:this.chartType}),o={showTooltip:n,hideTooltip:s.bind(this.hideTooltip,this)},r=this._makeParamsForGraphRendering(t,e),a=this.seriesType,h=this.dataProcessor.seriesDataModelMap,l=[],u=0;return s.forEach(this.dataProcessor.seriesTypes,function(t){var e=!0;return t!==a?l.push(t):e=!1,e}),s.forEach(l,function(t){u+=h[t].baseGroups.length}),r.additionalIndex=u,this.graphRenderer.render(i,r,o)},resize:function(){o.prototype.resize.apply(this,arguments),this._moveLegendLines()},showTooltip:function(t,e,i,n,o){this.eventBus.fire("showTooltip",s.extend({indexes:{groupIndex:i,index:n},mousePosition:o},t))},hideTooltip:function(){this.eventBus.fire("hideTooltip")},_makeSeriesDataBySelection:function(t){return{indexes:{index:t,groupIndex:t}}},_getSeriesLabel:function(t,e){var i="";return this.options.showLegend&&(i=h.getEllipsisText(t,this.legendMaxWidth,this.theme.label)),this.options.showLabel&&(i+=(i?r.LABEL_SEPARATOR:"")+e),i},_pickPositionsFromSectorData:function(t){return s.map(this.seriesData.sectorData,function(e){return e.ratio?e[t]:null})},_addEndPosition:function(t,e){s.forEachArray(e,function(e){var i;e&&(i=s.extend({},e.middle),i.left-1&&e!==o,r&&!i||(this.onSelectSeries({chartType:this.chartType,indexes:{index:e,legendIndex:n.legendIndex}},i),r&&e>-1&&(this.prevClickedIndex=e)))},onMoveSeries:function(t){this._executeGraphRenderer(t,"moveMouseOnSeries")}});n.componentType="series",n.PieChartSeries=l,t.exports=n},function(t,e,i){"use strict";function n(t){var e=t.chartOptions.libType;return t.libType=e,t.chartType="heatmap",new s(t)}var o=i(81),r=i(83),a=i(6),s=a.defineClass(o,{init:function(t){this.colorSpectrum=t.colorSpectrum,o.call(this,t)},_makeSeriesData:function(){var t=this._makeBounds(),e=this._getSeriesDataModel();return{colorSpectrum:this.colorSpectrum,groupBounds:t,seriesDataModel:e,isAvailable:function(){return t&&t.length>0}}},_makeBound:function(t,e,i,n){var o=this.layout.dimension.height,r=t*i+this.layout.position.left,a=o-e*(n+1)+this.layout.position.top;return{end:{left:r,top:a,width:t,height:e}}},_makeBounds:function(){var t=this,e=this._getSeriesDataModel(),i=this.layout.dimension,n=i.width/this.dataProcessor.getCategoryCount(!1),o=i.height/this.dataProcessor.getCategoryCount(!0);return e.map(function(e,i){return e.map(function(e,r){return t._makeBound(n,o,i,r)})})},onShowTooltip:function(t){var e=this._getSeriesDataModel(),i=t.indexes,n=e.getSeriesItem(i.groupIndex,i.index).ratio;this.eventBus.fire("showWedge",n)},_renderSeriesLabel:function(t){var e=this._getSeriesDataModel(),i=this.seriesData.groupBounds,n=this.theme.label,o=this.selectedLegendIndex,a=r.boundsToLabelPositions(e,i,n),s=e.map(function(t){return t.valuesMap.value});return this.graphRenderer.renderSeriesLabel(t,a,s,n,o)},resize:function(){this.boundMap=null,o.prototype.resize.apply(this,arguments)},_makeExportationSeriesData:function(t){return{x:t.indexes.groupIndex,y:t.indexes.index}}});n.componentType="series",n.HeatmapChartSeries=s,t.exports=n},function(t,e,i){"use strict";function n(t){var e=t.chartOptions.libType,i=t.chartTheme;return t.libType=e,t.chartType="treemap",t.chartBackground=i.chart.background,new u(t)}var o=i(81),r=i(96),a=i(83),s=i(8),h=i(11),l=i(6),u=l.defineClass(o,{init:function(t){o.call(this,t),this.theme.borderColor=this.theme.borderColor||s.TREEMAP_DEFAULT_BORDER,this.rootId=s.TREEMAP_ROOT_ID,this.startDepth=1,this.selectedGroup=null,this.boundMap=null,this.colorSpectrum=t.colorSpectrum,this._initOptions()},_initOptions:function(){this.options.useColorValue=!!this.options.useColorValue,l.isUndefined(this.options.zoomable)&&(this.options.zoomable=!this.options.useColorValue),l.isUndefined(this.options.useLeafLabel)&&(this.options.useLeafLabel=!this.options.zoomable)},_makeSeriesData:function(){var t=this._getBoundMap(),e=this._makeBounds(t);return{boundMap:t,groupBounds:e,seriesDataModel:this._getSeriesDataModel(),startDepth:this.startDepth,isPivot:!0,colorSpectrum:this.options.useColorValue?this.colorSpectrum:null,chartBackground:this.chartBackground,zoomable:this.options.zoomable,isAvailable:function(){return e&&e.length>0}}},_makeBoundMap:function(t,e,i){var n,o=this,a=this._getSeriesDataModel(),s=l.extend({},this.layout.dimension,this.layout.position);return i=i||s,n=a.findSeriesItemsByParent(t),e=l.extend(e||{},r.squarify(i,n)),l.forEachArray(n,function(t){e=o._makeBoundMap(t.id,e,e[t.id])}),e},_makeBounds:function(t){var e,i=this.startDepth,n=this._getSeriesDataModel();return e=this.options.zoomable?function(t){return t.depth===i}:function(t){return!t.hasChild},n.map(function(i){return i.map(function(i){var n=t[i.id],o=null;return n&&e(i)&&(o={end:n}),o},!0)},!0)},_getBoundMap:function(){return this.boundMap||(this.boundMap=this._makeBoundMap(this.rootId)),this.boundMap},_shouldDimmed:function(t,e,i){var n,o=!1;return e&&i.id!==e.id&&i.group===e.group&&(n=t.findParentByDepth(i.id,e.depth+1),n&&n.parent===e.id&&(o=!0)),o},_renderSeriesLabel:function(t){var e,i,n,o=this._getSeriesDataModel(),r=this._getBoundMap(),s=this.theme.label,h=this.options.labelTemplate;return i=this.options.useLeafLabel?o.findLeafSeriesItems(this.selectedGroup):o.findSeriesItemsByDepth(this.startDepth,this.selectedGroup),n=l.map(i,function(t){var e=h?h(t.pickLabelTemplateData()):t.label;return e}),e=a.boundsToLabelPostionsForTreemap(i,r,s),this.graphRenderer.renderSeriesLabelForTreemap(t,e,n,s)},resize:function(){this.boundMap=null,o.prototype.resize.apply(this,arguments)},_zoom:function(t,e,i){this._clearSeriesContainer(),this.boundMap=null,this.rootId=t,this.startDepth=e,this.selectedGroup=i,this._renderSeriesArea(this.paper,l.bind(this._renderGraph,this)),this.animateComponent(!0)},zoom:function(t){var e,i,n=t.index;return this.labelSet.remove(),n===-1?void this._zoom(s.TREEMAP_ROOT_ID,1,null):(e=this._getSeriesDataModel(),i=e.getSeriesItem(0,n,!0),void(i&&i.hasChild&&(this._zoom(i.id,i.depth+1,i.group),this.eventBus.fire("afterZoom",n))))},_makeExportationSeriesData:function(t){var e=t.indexes,i=this._getSeriesDataModel().getSeriesItem(e.groupIndex,e.index,!0);return l.extend({chartType:this.chartType,indexes:i.indexes})},onHoverSeries:function(t){h.isShowLabel(this.options)&&this.graphRenderer.showAnimation(t,this.options.useColorValue,.6)},onHoverOffSeries:function(t){h.isShowLabel(this.options)&&t&&this.graphRenderer.hideAnimation(t,this.options.useColorValue)},onShowTooltip:function(t){var e=this._getSeriesDataModel(),i=t.indexes,n=e.getSeriesItem(i.groupIndex,i.index,!0).colorRatio;n>-1&&this.eventBus.fire("showWedge",n)}});n.componentType="series",n.TreemapChartSeries=u,t.exports=n},function(t,e,i){"use strict";var n=i(45),o=i(10),r=i(6),a={boundMap:{},_makeBaseBound:function(t){return r.extend({},t)},_calculateScale:function(t,e,i){return e*i/n.sum(t)},_makeBaseData:function(t,e,i){var n=this._calculateScale(r.pluck(t,"value"),e,i),o=r.map(t,function(t){return{id:t.id,weight:t.value*n}}).sort(function(t,e){return e.weight-t.weight});return o},_worst:function(t,e,i,n){var o=t*t,r=n*n;return Math.max(r*i/o,o/(r*e))},_changedStackDirection:function(t,e,i,n){var r=o.min(e),a=o.max(e),s=this._worst(t,r,a,i),h=this._worst(t+n,Math.min(r,n),Math.max(a,n),i);return h>=s},_isVerticalStack:function(t){return t.height=0?(e.plusTop-=c,s=p+e.plusTop):(s=p+e.minusTop,e.minusTop+=c),h=e.left+t.pointInterval-t.barSize/2,u=l.map(n.outliers,function(e){return{top:t.baseBarSize*(1-e.ratio)+f,left:h+t.barSize/2}}),{start:{top:p,left:h,width:t.barSize,height:0},end:{top:s,left:h,width:t.barSize,height:c},min:{top:t.baseBarSize*(1-n.minRatio)+f,left:h,width:t.barSize,height:0},max:{top:t.baseBarSize*(1-n.maxRatio)+f,left:h,width:t.barSize,height:0},median:{top:t.baseBarSize*(1-n.medianRatio)+f,left:h,width:t.barSize,height:0},outliers:u}},_makeBounds:function(){var t=this,e=this._getSeriesDataModel(),i=s.isValidStackOption(this.options.stackType),n=this.layout.dimension,o=this._makeBaseDataForMakingBound(n.width,n.height);return e.map(function(e,n){var r=n*o.groupSize+t.layout.position.left,a={baseLeft:r,left:r,plusTop:0,minusTop:0,prevStack:null},s=l.bind(t._makeBoxplotChartBound,t,o,a,i);return e.map(s)})},_calculateLeftPositionOfSumLabel:function(t,e){var i=h.getRenderedLabelWidth(e,this.theme.label);return t.left+(t.width-i+a.TEXT_PADDING)/2}});r.mixin(u),n.componentType="series",n.BoxplotChartSeries=u,t.exports=n},function(t,e,i){"use strict";function n(t){var e=t.chartTheme;return t.libType=t.chartOptions.libType,t.chartType="bullet",t.chartBackground=e.chart.background,new h(t)}var o=i(81),r=i(7),a=i(8),s=i(6),h=s.defineClass(o,{init:function(t){o.call(this,t),this.isVertical=t.isVertical},_makeSeriesData:function(){var t=this._makeBounds();return{groupBounds:t,seriesDataModel:this._getSeriesDataModel(),isVertical:this.isVertical,isAvailable:function(){return t&&t.length>0}}},_makeBounds:function(){var t=this,e=this._getSeriesDataModel(),i=this._makeBaseDataForMakingBound(),n={renderedItemCount:0,top:i.categoryAxisTop,left:i.categoryAxisLeft};return e.map(function(e){var o=s.bind(t._makeBulletChartBound,t,i,n),r=e.map(o);return t._updateIterationData(n,i.itemWidth),r})},_makeBaseDataForMakingBound:function(){var t,e,i,n=this._getSeriesDataModel().getGroupCount(),o=this.layout.dimension,r=o.width,a=o.height,s=this.layout.position,h=s.top,l=s.left;return this.isVertical?(h+=a,t=r,e=a):(t=a,e=r),i=t/n,{categoryAxisTop:h,categoryAxisLeft:l,categoryAxisWidth:t,valueAxisWidth:e,itemWidth:i}},_makeBulletChartBound:function(t,e,i){var n,o=i.type;return o===a.BULLET_TYPE_ACTUAL?n=this._makeBarBound(i,a.BULLET_ACTUAL_HEIGHT_RATIO,t,e):o===a.BULLET_TYPE_RANGE?n=this._makeBarBound(i,a.BULLET_RANGES_HEIGHT_RATIO,t,e):o===a.BULLET_TYPE_MARKER&&(n=this._makeLineBound(i,a.BULLET_MARKERS_HEIGHT_RATIO,t,e)),n.type=o,n},_makeBarBound:function(t,e,i,n){var o,r=i.itemWidth*e,a=i.valueAxisWidth*t.ratioDistance,s=i.valueAxisWidth*t.endRatio;return o=this.isVertical?this._makeVerticalBarBound(n,i,r,a,s):this._makeHorizontalBarBound(n,i,r,a,s)},_makeVerticalBarBound:function(t,e,i,n,o){return{top:t.top-o,left:t.left+(e.itemWidth-i)/2,width:i,height:n}},_makeHorizontalBarBound:function(t,e,i,n,o){return{top:t.top+(e.itemWidth-i)/2,left:t.left+o-n,width:n,height:i}},_makeLineBound:function(t,e,i,n){var o,r,s=i.itemWidth*e,h=i.valueAxisWidth*t.endRatio,l=a.BULLET_MARKER_DETECT_PADDING,u=a.BULLET_MARKER_DETECT_PADDING;return this.isVertical?(o=n.top-h,r=n.left+(i.itemWidth-s)/2,l=s):(o=n.top+(i.itemWidth-s)/2,r=n.left+h,u=s),{top:o,left:r,length:s,width:l,height:u}},_updateIterationData:function(t,e){t.renderedItemCount+=1,this.isVertical?t.left+=e:t.top+=e},_renderSeriesArea:function(t,e){o.prototype._renderSeriesArea.call(this,t,e),this.dataProcessor.setGraphColors(this.graphRenderer.getGraphColors())},_renderSeriesLabel:function(t){var e=this.theme.label,i=this._getSeriesDataModel(),n=this._getLabelTexts(i),o=this._calculateLabelPositions(i,e);return this.graphRenderer.renderSeriesLabel(t,o,n,e)},_getLabelTexts:function(t){return t.map(function(t){var e=[];return t.each(function(t){t.type!==a.BULLET_TYPE_RANGE&&e.push(t.endLabel)}),e})},_calculateLabelPositions:function(t,e){var i=this.seriesData.groupBounds,n=r.getRenderedLabelHeight(a.MAX_HEIGHT_WORD,e);return s.map(i,function(t){var e=[];return s.forEach(t,function(t){t.type!==a.BULLET_TYPE_RANGE&&e.push(this._makePositionByBound(t,n))},this),e},this)},_makePositionByBound:function(t,e){var i,n,o=t.top,r=t.left,a={};return this.isVertical?(i=t.width||t.length,a.top=o-e,a.left=r+i/2):(i=t.width||0,n=t.height||t.length,a.top=o+n/2,a.left=r+5+(i||0)),a}});n.componentType="series",n.BulletChartSeries=h,t.exports=n},function(t,e,i){"use strict";function n(t){return new c(t)}var o=i(6),r=o.browser.msie&&o.browser.version<=8,a=i(100),s=i(8),h=i(9),l=i(7),u=i(55),c=o.defineClass({className:"tui-chart-zoom-area",init:function(t){this.eventBus=t.eventBus,this.magn=1,this.stackedWheelDelta=0,this.drawingType=s.COMPONENT_TYPE_DOM,this._attachToEventBus()},_attachToEventBus:function(){this.eventBus.on("wheel",this.onWheel,this)},render:function(t){var e;return r||(e=h.create("DIV",this.className),e.innerHTML+=a.ZOOM_BUTTONS,l.renderPosition(e,t.positionMap.series),this._attachEvent(e)),e},_findBtnElement:function(t){var e="tui-chart-zoom-btn",i=t;return h.hasClass(t,e)||(i=h.findParentByClass(t,e)),i},_zoom:function(t,e){this.eventBus.fire("zoomMap",t,e)},_onClick:function(t){var e=t.target||t.srcElement,i=this._findBtnElement(e),n=i.getAttribute("data-magn"),o=this._calculateMagn(n);return o>5?this.magn=5:o<1?this.magn=1:o>=1&&this._zoom(o),t.preventDefault&&t.preventDefault(),!1},_attachEvent:function(t){u.on(t,"click",this._onClick,this)},_calculateMagn:function(t){return t>0?this.magn+=.1:t<0&&(this.magn-=.1),this.magn},onWheel:function(t,e){var i=this._calculateMagn(t);i>5?this.magn=5:i<1?this.magn=1:i>=1&&this._zoom(i,e)}});n.componentType="zoom",t.exports=n},function(t,e,i){"use strict";var n=i(65),o={HTML_SERIES_LABEL:'
{{ label }}
',TEXT_CSS_TEXT:"left:{{ left }}px;top:{{ top }}px;font-family:{{ fontFamily }};font-size:{{ fontSize }}px;font-weight:{{ fontWeight }}{{opacity}}",TEXT_CSS_TEXT_FOR_LINE_TYPE:"left:{{ left }}%;top:{{ top }}%;font-family:{{ fontFamily }};font-size:{{ fontSize }}px;font-weight:{{ fontWeight }}{{opacity}}",HTML_ZOOM_BUTTONS:'
',HTML_SERIES_BLOCK:'
{{ label }}
'};t.exports={tplSeriesLabel:n.template(o.HTML_SERIES_LABEL),tplCssText:n.template(o.TEXT_CSS_TEXT),tplCssTextForLineType:n.template(o.TEXT_CSS_TEXT_FOR_LINE_TYPE),ZOOM_BUTTONS:o.HTML_ZOOM_BUTTONS,tplSeriesBlock:n.template(o.HTML_SERIES_BLOCK)}},function(t,e,i){"use strict";var n=i(8),o=i(102),r=i(103),a=i(107),s=i(109),h=i(110),l=i(104),u=i(31),c=i(11),d=i(7),p=i(45),f=i(36),m=i(6),g=Array.prototype.concat,_=m.isUndefined,T=m.defineClass(o,{init:function(t,e,i,n){this.originalRawData=f.deepCopy(t),this.chartType=e,this.options=i,this.seriesTypes=n,this.originalLegendData=null,this.selectLegendIndex=null,this.dynamicData=[],this.defaultValues=[0,500],this.initData(t),this.initZoomedRawData(),this.baseInit()},getOriginalRawData:function(){return f.deepCopy(this.originalRawData)},getZoomedRawData:function(){var t=this.zoomedRawData;return t=t?f.deepCopy(t):this.getOriginalRawData()},_filterSeriesDataByIndexRange:function(t,e,i){return m.forEachArray(t,function(t){t.data=t.data.slice(e,i+1)}),t},_filterRawDataByIndexRange:function(t,e){var i=this,n=e[0],o=e[1];return m.forEach(t.series,function(e,r){t.series[r]=i._filterSeriesDataByIndexRange(e,n,o)}),t.categories&&(t.categories=t.categories.slice(n,o+1)),t},updateRawDataForZoom:function(t){var e=this.getRawData(),i=this.getZoomedRawData();this.zoomedRawData=this._filterRawDataByIndexRange(i,t),e=this._filterRawDataByIndexRange(e,t), +this.initData(e)},initZoomedRawData:function(){this.zoomedRawData=null},initData:function(t){this.rawData=t,this.categoriesMap=null,this.categoriesIsDateTime={},this.stacks=null,this.seriesDataModelMap={},this.seriesGroups=null,this.valuesMap={},this.legendLabels=null,this.legendData=null,this.multilineCategories=null,this.coordinateType=null},getRawData:function(){return this.rawData},findChartType:function(t){return u.findChartType(this.rawData.seriesAlias,t)},_escapeCategories:function(t){return m.map(t,function(t){return m.encodeHTMLEntity(String(t))})},_mapCategories:function(t,e){var i=e+"Axis",n=this.options[i]||{},o=!1;return o=m.isArray(n)?m.filter(n,function(t){return t.type&&c.isDatetimeType(t.type)}):n.type&&c.isDatetimeType(n.type),t=o?m.map(t,function(t){var e=this.chageDatetypeToTimestamp(t);return e},this):this._escapeCategories(t),this.categoriesIsDateTime[e]=o,t},_processCategories:function(t){var e=this.rawData.categories,i={};return m.isArray(e)?i[t]=this._mapCategories(e,t):e&&(e.x&&(i.x=this._mapCategories(e.x,"x")),e.y&&(i.y=this._mapCategories(e.y,"y").reverse())),i},getCategories:function(t){var e=t?"y":"x",i=[];return this.categoriesMap||(this.categoriesMap=this._processCategories(e)),m.isExisty(t)?i=this.categoriesMap[e]||[]:m.forEach(this.categoriesMap,function(t){return i=t,!1}),i},getCategorieDateType:function(t){var e=t?"y":"x";return this.categoriesIsDateTime[e]},chageDatetypeToTimestamp:function(t){var e=new Date(t);return e.getTime()>0||(e=new Date(parseInt(t,10))),e.getTime()||t},getCategoryCount:function(t){var e=this.getCategories(t);return e?e.length:0},hasCategories:function(t){return!!this.getCategoryCount(t)},isXCountGreaterThanYCount:function(t){var e=this.getSeriesDataModel(t);return e.isXCountGreaterThanYCount()},hasXValue:function(t){var e=this.isXCountGreaterThanYCount(t);return!this.hasCategories(e)||e},hasYValue:function(t){var e=this.isXCountGreaterThanYCount(t);return!this.hasCategories(e)||!e},getCategory:function(t,e){return this.getCategories(e)[t]},findCategoryIndex:function(t){var e=this.getCategories(),i=this.getCategorieDateType(),n=null;return m.forEachArray(e,function(e,o){return i&&(t=this.chageDatetypeToTimestamp(t)),e===t&&(n=o),m.isNull(n)},this),n},findAbsoluteCategoryIndex:function(t){var e=this.originalRawData?this.originalRawData.categories:null,i=-1;return e?(m.forEach(e,function(e,n){var o=e===t;return o&&(i=n),!o}),i):i},_getTooltipCategory:function(t,e){var i=this.getCategory(t,e),n=e?"yAxis":"xAxis",o=this.options[n]||{},r=this.options.tooltip||{};return c.isDatetimeType(r.type)?i=d.formatDate(i,r.dateFormat):c.isDatetimeType(o.type)&&(i=d.formatDate(i,o.dateFormat)),i},makeTooltipCategory:function(t,e,i){var n=!i,o=this._getTooltipCategory(t,n),r=this.getCategoryCount(!n);return r&&(o+=", "+this._getTooltipCategory(r-e-1,!n)),o},getStacks:function(t){return this.stacks||(this.stacks=u.pickStacks(this.rawData.series[t])),this.stacks},getStackCount:function(t){return this.getStacks(t).length},findStackIndex:function(t){return m.inArray(t,this.getStacks())},isCoordinateType:function(){var t=this.chartType,e=this.coordinateType;return m.isExisty(e)||(e=c.isCoordinateTypeChart(t),e=e||c.isLineScatterComboChart(t,this.seriesTypes),e=e||c.isLineTypeChart(t)&&!this.hasCategories(),this.coordinateType=e),e},getSeriesDataModel:function(t){var e,i,n;return this.seriesDataModelMap[t]||(i=this.findChartType(t),e=this.rawData.series[t],n=c.isBoxplotChart(this.chartType)?a:c.isTreemapChart(this.chartType)?h:c.isBulletChart(this.chartType)?s:r,this.seriesDataModelMap[t]=new n(e,i,this.options,this.getFormatFunctions(),this.isCoordinateType())),this.seriesDataModelMap[t]},getGroupCount:function(t){return this.getSeriesDataModel(t).getGroupCount()},_pushCategory:function(t){this.rawData.categories&&(this.rawData.categories.push(t),this.originalRawData.categories.push(t))},_shiftCategory:function(){this.rawData.categories&&(this.rawData.categories.shift(),this.originalRawData.categories.shift())},_findRawSeriesDatumByName:function(t,e){var i=null,n=this.rawData.series[e];return m.forEachArray(n,function(e){var n=e.name===t;return n&&(i=e),!n}),i},_pushValue:function(t,e,i){var n=this._findRawSeriesDatumByName(t.name,i);t.data.push(e),n&&n.data.push(e)},_pushValues:function(t,e,i){var n=this;m.forEachArray(t,function(t,o){n._pushValue(t,e[o],i)})},_pushSeriesData:function(t){var e,i=this;"combo"!==this.chartType&&m.isArray(t)&&(e=t,t={},t[this.chartType]=e),m.forEach(this.originalRawData.series,function(e,n){i._pushValues(e,t[n],n)})},_shiftValues:function(t,e){var i=this;m.forEachArray(t,function(t){var n=i._findRawSeriesDatumByName(t.name,e);t.data.shift(),n&&n.data.shift()})},_shiftSeriesData:function(){var t=this;m.forEach(this.originalRawData.series,function(e,i){t._shiftValues(e,i)})},addDynamicData:function(t,e){this.dynamicData.push({category:t,values:e})},_pushDynamicData:function(t){this._pushCategory(t.category),this._pushSeriesData(t.values)},_pushDynamicDataForCoordinateType:function(t){var e=this;m.forEachArray(this.originalRawData.series,function(i){e._pushValue(i,t[i.name])})},addDataFromDynamicData:function(){var t=this.dynamicData.shift();return t&&(this.isCoordinateType()?this._pushDynamicDataForCoordinateType(t.values):this._pushDynamicData(t),this.initData(this.rawData)),!!t},shiftData:function(){this._shiftCategory(),this._shiftSeriesData(),this.initData(this.rawData)},addDataFromRemainDynamicData:function(t){var e=this,i=this.dynamicData;this.dynamicData=[],m.forEach(i,function(i){e._pushCategory(i.category),e._pushSeriesData(i.values),t&&(e._shiftCategory(),e._shiftSeriesData())}),this.initData(this.rawData)},_eachByAllSeriesDataModel:function(t){var e=this,i=this.seriesTypes||[this.chartType];m.forEachArray(i,function(i){return t(e.getSeriesDataModel(i),i)})},isValidAllSeriesDataModel:function(){var t=!0;return this._eachByAllSeriesDataModel(function(e){return t=!!e.getGroupCount()}),t},_makeSeriesGroups:function(){var t,e=[];return this._eachByAllSeriesDataModel(function(t){t.each(function(t,i){e[i]||(e[i]=[]),e[i]=e[i].concat(t.items)})}),t=m.map(e,function(t){return new l(t)})},getSeriesGroups:function(){return this.seriesGroups||(this.seriesGroups=this._makeSeriesGroups()),this.seriesGroups},getValue:function(t,e,i){return this.getSeriesDataModel(i).getValue(t,e)},getDefaultDatetimeValues:function(){var t=36e5,e=Date.now();return[e-t,e]},isSeriesDataEmpty:function(t){var e=this.rawData,i=e&&!e.series;return!e||i||!e.series[t]||e.series[t]&&!e.series[t].length},isLimitOptionsEmpty:function(t){var e=this.options[t]||{};return _(e.min)&&_(e.max)},isLimitOptionsInsufficient:function(t){var e=this.options[t]||{};return _(e.min)||_(e.max)},_createValues:function(t,e,i){var n,o,r=this.options,a=r.plot,s=r[i]||{},h=s.type,l=this.isSeriesDataEmpty(t),u=this.isLimitOptionsEmpty(i),d=this.isLimitOptionsInsufficient(i),p=c.isLineChart(t)||c.isAreaChart(t)||c.isLineAreaComboChart(t,this.seriesTypes),f=this.defaultValues;return c.isComboChart(t)?(n=[],this._eachByAllSeriesDataModel(function(t){n=n.concat(t.getValues(e))})):l&&d?(!u&&d&&(f=f.concat([s.min||s.max])),"x"===e&&"datetime"===h?(n=this.getDefaultDatetimeValues(),p&&a&&(o=this.getValuesFromPlotOptions(a,h),n=n.concat(o))):n=f):n=this.getSeriesDataModel(t).getValues(e),n},getValuesFromPlotOptions:function(t,e){var i=[];return t.lines&&m.forEach(t.lines,function(t){i.push("datetime"!==e?t.value:new Date(t.value))}),t.bands&&m.forEach(t.bands,function(t){var n=m.map(t.range,function(t){return"datetime"!==e?t:new Date(t)});i=i.concat(n)}),i},getValues:function(t,e,i){var n;return n=t+e,this.valuesMap[n]||(this.valuesMap[n]=this._createValues(t,e,i)),this.valuesMap[n]},eachBySeriesGroup:function(t,e){this._eachByAllSeriesDataModel(function(i,n){i.each(function(e,i){t(e,i,n)},e)})},_pickLegendLabel:function(t){return t.name?m.encodeHTMLEntity(t.name):null},_isVisibleLegend:function(t){var e=!0;return m.isExisty(t.visible)&&t.visible===!1&&(e=!1),e},_pickLegendData:function(t){var e,i=this.rawData.series,n={};return"visibility"===t?e=this._isVisibleLegend:"label"===t&&(e=this._pickLegendLabel),e&&(m.forEach(i,function(t,i){n[i]=m.map(t,e)}),n=m.filter(n,m.isExisty)),n},getLegendLabels:function(t){return this.legendLabels||(this.legendLabels=this._pickLegendData("label")),this.legendLabels[t]||this.legendLabels},getLegendVisibility:function(t){return this.legendVisibilities||(this.legendVisibilities=this._pickLegendData("visibility")),this.legendVisibilities[t]||this.legendVisibilities},_makeLegendData:function(){var t,e,i=this.getLegendLabels(this.chartType),n=this.seriesTypes||[this.chartType],o=this.getLegendVisibility();return m.isArray(i)?(t=[this.chartType],t[this.chartType]=i):(n=this.seriesTypes,t=i),e=m.map(n,function(e){return m.map(t[e],function(t,i){var n=m.isArray(o[e]);return{chartType:e,label:t,visible:n?o[e][i]:o[i]}})}),g.apply([],e)},getLegendData:function(){return this.legendData||(this.legendData=this._makeLegendData()),this.originalLegendData||(this.originalLegendData=this.legendData),this.legendData},getOriginalLegendData:function(){return this.originalLegendData},getLegendItem:function(t){return this.getLegendData()[t]},getFirstItemLabel:function(t){return this.getSeriesDataModel(t).getFirstItemLabel()},addDataRatiosOfPieChart:function(t){this.getSeriesDataModel(t).addDataRatiosOfPieChart()},addDataRatiosForCoordinateType:function(t,e,i){c.isLineTypeChart(t)&&this._addStartValueToAllSeriesItem(e.yAxis,t),this.getSeriesDataModel(t).addDataRatiosForCoordinateType(e,i)},_addStartValueToAllSeriesItem:function(t,e){var i=0;t.min>=0?i=t.min:t.max<=0&&(i=t.max),this.getSeriesDataModel(e).addStartValueToAllSeriesItem(i)},addDataRatios:function(t,e,i){var n=this.getSeriesDataModel(i);this._addStartValueToAllSeriesItem(t,i),n.addDataRatios(t,e)},addDataRatiosForTreemapChart:function(t,e){this.getSeriesDataModel(e).addDataRatios(t)},_createBaseValuesForNormalStackedChart:function(t){var e=this.getSeriesDataModel(t),i=[];return e.each(function(t){var e=t._makeValuesMapPerStack();m.forEach(e,function(t){var e=p.sumPlusValues(t),n=p.sumMinusValues(t);i=i.concat([e,n])})}),i},createBaseValuesForLimit:function(t,e,i,n,o){var r;return c.isComboChart(this.chartType)&&e?(r=this.getValues(this.chartType,n),c.isNormalStackChart(t,i)&&(r=r.concat(this._createBaseValuesForNormalStackedChart(t)))):r=c.isTreemapChart(t)?this.getValues(t,"colorValue"):c.isNormalStackChart(t,i)?this._createBaseValuesForNormalStackedChart(t):this.getValues(t,n,o),r},findOverflowItem:function(t,e){var i=this.getSeriesDataModel(t),o=i.getMaxValue("r"),r=function(t){return t.r/o>n.HALF_RATIO};return{minItem:i.findMinSeriesItem(e,r),maxItem:i.findMaxSeriesItem(e,r)}},setGraphColors:function(t){this.graphColors=t},getGraphColors:function(){return this.graphColors}});t.exports=T},function(t,e,i){"use strict";var n=i(10),o=i(7),r=i(45),a=i(6),s=a.defineClass({baseInit:function(){this.formatFunctions=null},getValues:function(){},getMaxValue:function(t,e){return n.max(this.getValues(t,e))},getFormattedMaxValue:function(t,e,i){var n=this.getMaxValue(t,i),r=this.getFormatFunctions();return o.formatValue({value:n,formatFunctions:r,chartType:t,areaType:e,valueType:i})},_pickMaxLenUnderPoint:function(t){var e=0;return a.forEachArray(t,function(t){var i=r.getDecimalLength(t);i>e&&(e=i)}),e},_isZeroFill:function(t){return t.length>2&&"0"===t.charAt(0)},_isDecimal:function(t){var e=t.indexOf(".");return e>-1&&e-1},_formatToZeroFill:function(t,e){var i=e<0;return e=o.formatToZeroFill(Math.abs(e),t),(i?"-":"")+e},_formatToDecimal:function(t,e){return o.formatToDecimal(e,t)},_findSimpleTypeFormatFunctions:function(t){var e,i=[];if(this._isDecimal(t))e=this._pickMaxLenUnderPoint([t]),i=[a.bind(this._formatToDecimal,this,e)];else if(this._isZeroFill(t))return e=t.length,i=[a.bind(this._formatToZeroFill,this,e)];return this._isComma(t)&&i.push(o.formatToComma),i},_findFormatFunctions:function(){var t=a.pick(this.options,"chart","format"),e=[];return a.isFunction(t)?e=[t]:a.isString(t)&&(e=this._findSimpleTypeFormatFunctions(t)),e},getFormatFunctions:function(){return this.formatFunctions||(this.formatFunctions=this._findFormatFunctions()),this.formatFunctions}});t.exports=s},function(t,e,i){"use strict";var n=i(104),o=i(105),r=i(106),a=i(11),s=i(45),h=i(10),l=i(6),u=Array.prototype.concat,c=l.defineClass({init:function(t,e,i,n,o){this.chartType=e,this.options=i||{},this.formatFunctions=n,this.rawSeriesData=t||[],this.isCoordinateType=o,this.baseGroups=null,this.groups=null,this.options.series=this.options.series||{},this.isDivergingChart=a.isDivergingChart(e,this.options.series.diverging),this.valuesMap={},this._removeRangeValue()},_removeRangeValue:function(){var t=l.pick(this.options,"series")||{},e=a.isAllowRangeData(this.chartType)&&!a.isValidStackOption(t.stackType)&&!t.spline;e||this.isCoordinateType||l.forEachArray(this.rawSeriesData,function(t){l.isArray(t.data)&&l.forEachArray(t.data,function(e,i){l.isExisty(e)&&(t.data[i]=u.apply(e)[0])})})},_createBaseGroups:function(){var t,e,i=this.chartType,n=this.formatFunctions,s=this.options.xAxis,h=this.isDivergingChart,u=this.isCoordinateType,c=a.isPieChart(this.chartType),d=a.isHeatmapChart(this.chartType)||a.isTreemapChart(this.chartType);return u?(e=r,t=function(t){t.sort(function(t,e){return t.x-e.x})}):(e=o,t=function(){}),l.map(this.rawSeriesData,function(o){var r,a,p,f;return a=l.isArray(o)?o:[].concat(o.data),d||(r=o.stack),o.name&&(p=o.name),(u||c)&&(a=l.filter(a,l.isExisty)),f=l.map(a,function(t,o){return new e({datum:t,chartType:i,formatFunctions:n,index:o,legendName:p,stack:r,isDivergingChart:h,xAxisType:s.type,dateFormat:s.dateFormat})}),t(f),f})},_getBaseGroups:function(){return this.baseGroups||(this.baseGroups=this._createBaseGroups()),this.baseGroups},_createSeriesGroupsFromRawData:function(t){var e=this._getBaseGroups();return t&&(e=h.pivot(e)),l.map(e,function(t){return new n(t)})},_getSeriesGroups:function(){return this.groups||(this.groups=this._createSeriesGroupsFromRawData(!0)),this.groups},getGroupCount:function(){return this._getSeriesGroups().length},_getPivotGroups:function(){return this.pivotGroups||(this.pivotGroups=this._createSeriesGroupsFromRawData()),this.pivotGroups},getSeriesGroup:function(t,e){return e?this._getPivotGroups()[t]:this._getSeriesGroups()[t]},getFirstSeriesGroup:function(t){return this.getSeriesGroup(0,t)},getFirstItemLabel:function(){return this.getFirstSeriesGroup().getFirstSeriesItem().label},getSeriesItem:function(t,e,i){return this.getSeriesGroup(t,i).getSeriesItem(e)},getFirstSeriesItem:function(){return this.getSeriesItem(0,0)},getValue:function(t,e){return this.getSeriesItem(t,e).value},getMinValue:function(t){return h.min(this.getValues(t))},getMaxValue:function(t){return h.max(this.getValues(t))},_findSeriesItem:function(t){var e;return this.each(function(i){return e=i.find(t),!e}),e},_findSeriesItemByValue:function(t,e,i){return i=i||function(){return null},this._findSeriesItem(function(n){return n&&n[t]===e&&i(n)})},findMinSeriesItem:function(t,e){var i=this.getMinValue(t);return this._findSeriesItemByValue(t,i,e)},findMaxSeriesItem:function(t,e){var i=this.getMaxValue(t);return this._findSeriesItemByValue(t,i,e)},_createValues:function(t){var e=this.map(function(e){return e.getValues(t)});return e=u.apply([],e),l.filter(e,function(t){return!isNaN(t)})},getValues:function(t){return t=t||"value",this.valuesMap[t]||(this.valuesMap[t]=this._createValues(t)),this.valuesMap[t]},isXCountGreaterThanYCount:function(){return this.getValues("x").length>this.getValues("y").length},_addRatiosWhenNormalStacked:function(t){var e=Math.abs(t.max-t.min);this.each(function(t){t.addRatios(e)})},_calculateBaseRatio:function(){var t=this.getValues(),e=s.sumPlusValues(t),i=Math.abs(s.sumMinusValues(t)),n=e>0&&i>0?.5:1;return n},_addRatiosWhenPercentStacked:function(){var t=this._calculateBaseRatio();this.each(function(e){e.addRatiosWhenPercentStacked(t)})},_addRatiosWhenDivergingStacked:function(){this.each(function(t){var e=t.pluck("value"),i=s.sumPlusValues(e),n=Math.abs(s.sumMinusValues(e));t.addRatiosWhenDivergingStacked(i,n)})},_makeSubtractionValue:function(t){var e=a.allowMinusPointRender(this.chartType),i=0;return!e&&a.isMinusLimit(t)?i=t.max:(e||t.min>=0)&&(i=t.min),i},_addRatios:function(t){var e=Math.abs(t.max-t.min),i=this._makeSubtractionValue(t);this.each(function(t){t.addRatios(e,i)})},addDataRatios:function(t,e){var i=a.isAllowedStackOption(this.chartType);i&&a.isNormalStack(e)?this._addRatiosWhenNormalStacked(t):i&&a.isPercentStack(e)?this.isDivergingChart?this._addRatiosWhenDivergingStacked():this._addRatiosWhenPercentStacked():this._addRatios(t)},addDataRatiosOfPieChart:function(){this.each(function(t){var e=s.sum(t.pluck("value"));t.addRatios(e)})},addDataRatiosForCoordinateType:function(t,e){var i,n,o,r,a=t.xAxis,s=t.yAxis,u=e?h.max(this.getValues("r")):0;a&&(i=Math.abs(a.max-a.min),n=this._makeSubtractionValue(a)),s&&(o=Math.abs(s.max-s.min),r=this._makeSubtractionValue(s)),this.each(function(t){t.each(function(t){t&&(t.addRatio("x",i,n),t.addRatio("y",o,r),t.addRatio("r",u,0),l.isExisty(t.start)&&t.addRatio("start",o,r))})})},addStartValueToAllSeriesItem:function(t){this.each(function(e){e.addStartValueToAllSeriesItem(t)})},hasRangeData:function(){var t=!1;return this.each(function(e){return t=e.hasRangeData(),!t}),t},each:function(t,e){var i=e?this._getPivotGroups():this._getSeriesGroups();l.forEachArray(i,function(e,i){return t(e,i)})},map:function(t,e){var i=[];return this.each(function(e,n){i.push(t(e,n))},e),i}});t.exports=c},function(t,e,i){"use strict";var n=i(45),o=i(6),r=o.defineClass({init:function(t){this.items=t,this.valuesMap={},this.valuesMapPerStack=null},getSeriesItemCount:function(){return this.items.length},getSeriesItem:function(t){return this.items[t]},getFirstSeriesItem:function(){return this.getSeriesItem(0)},_createValues:function(t){var e=[];return this.each(function(i){i&&(o.isExisty(i[t])&&e.push(i[t]),o.isExisty(i.start)&&e.push(i.start))}),e},getValues:function(t){return t=t||"value",this.valuesMap[t]||(this.valuesMap[t]=this._createValues(t)),this.valuesMap[t]},_makeValuesMapPerStack:function(){var t={};return this.each(function(e){t[e.stack]||(t[e.stack]=[]),t[e.stack].push(e.value)}),t},getValuesMapPerStack:function(){return this.valuesMapPerStack||(this.valuesMapPerStack=this._makeValuesMapPerStack()),this.valuesMapPerStack},_makeSumMapPerStack:function(){var t=this.getValuesMapPerStack(),e={};return o.forEach(t,function(t,i){e[i]=n.sum(o.map(t,function(t){return Math.abs(t)}))}),e},addStartValueToAllSeriesItem:function(t){this.each(function(e){e&&e.addStart(t)})},addRatiosWhenPercentStacked:function(t){var e=this._makeSumMapPerStack();this.each(function(i){var n=e[i.stack];i.addRatio(n,0,t)})},addRatiosWhenDivergingStacked:function(t,e){this.each(function(i){var n=i.value>=0?t:e;i.addRatio(n,0,.5)})},addRatios:function(t,e){this.each(function(i){i&&i.addRatio(t,e)})},hasRangeData:function(){var t=!1;return this.each(function(e){return t=e&&e.isRange,!t}),t},each:function(t){o.forEachArray(this.items,t)},map:function(t){return o.map(this.items,t)},pluck:function(t){var e=o.filter(this.items,o.isExisty);return o.pluck(e,t)},find:function(t){var e;return this.each(function(i){return t(i)&&(e=i),!e}),e||null},filter:function(t){return o.filter(this.items,t)}});t.exports=r},function(t,e,i){"use strict";var n=i(8),o=i(7),r=i(45),a=i(11),s=i(6),h=s.defineClass({init:function(t){this.chartType=t.chartType,this.stack=t.stack||n.DEFAULT_STACK,this.isDivergingChart=t.isDivergingChart,this.formatFunctions=t.formatFunctions,this.isRange=!1,this.value=null,this.label=null,this.ratio=null,this.end=null,this.endLabel=null,this.endRatio=null,this.start=null,this.startLabel=null,this.startRatio=null,this.ratioDistance=null,a.isBulletChart(this.chartType)&&(this.type=t.type),this.legendName=t.legendName,this._initValues(t.datum,t.index)},_initValues:function(t,e){var i=this._createValues(t),n="makingSeriesLabel",r=i.length>1,a=i[0];this.value=this.end=a,this.index=e,this.isDivergingChart&&(a=Math.abs(a)),s.isNull(a)?this.label="":this.label=o.formatValue({value:a,formatFunctions:this.formatFunctions,chartType:this.chartType,areaType:n,legendName:this.legendName}),this.endLabel=this.label,r&&(this.addStart(i[1],!0),this._updateFormattedValueforRange(),this.isRange=!0)},_createValues:function(t){var e=s.map([].concat(t),function(t){return s.isNull(t)?null:parseFloat(t)});return e=e.sort(function(t,e){return t<0&&e<0?t-e:e-t})},addStart:function(t){s.isNull(this.start)&&(this.start=t,this.startLabel=o.formatValue({value:t,formatFunctions:this.formatFunctions,chartType:this.chartType,areaType:"series",legendName:this.legendName}))},_updateFormattedValueforRange:function(){this.label=this.startLabel+" ~ "+this.endLabel},addRatio:function(t,e,i){t=t||1,i=i||1,e=e||0,this.ratio=this.endRatio=r.calculateRatio(this.value,t,e,i),s.isExisty(this.start)&&(this.startRatio=r.calculateRatio(this.start,t,e,i),this.ratioDistance=Math.abs(this.endRatio-this.startRatio))},_getFormattedValueForTooltip:function(t){return o.formatValue({value:this[t],formatFunctions:this.formatFunctions,chartType:this.chartType,areaType:"tooltip",valueType:t,legendName:this.legendName})},pickValueMapForTooltip:function(){var t={value:this._getFormattedValueForTooltip("value"),ratio:this.ratio};return s.isExisty(this.start)&&(t.start=this._getFormattedValueForTooltip("start"),t.end=this._getFormattedValueForTooltip("end"),t.startRatio=this.startRatio,t.endRatio=this.endRatio),t}});t.exports=h},function(t,e,i){"use strict";var n=i(11),o=i(7),r=i(6),a=r.defineClass({init:function(t){this.chartType=t.chartType,this.formatFunctions=t.formatFunctions,this.xAxisType=t.xAxisType,this.dateFormat=t.dateFormat,this.ratioMap={},this._initData(t.datum,t.index)},_initData:function(t,e){var i;r.isArray(t)?(this.x=t[0]||0,this.y=t[1]||0,n.isBubbleChart(this.chartType)?(this.r=t[2],this.label=t[3]||""):this.label=t[2]||""):(this.x=t.x,this.y=t.y,this.r=t.r,this.label=t.label||""),n.isDatetimeType(this.xAxisType)&&(i=r.isDate(this.x)?this.x:new Date(this.x),this.x=i.getTime()||0),this.index=e,this.label||(n.isLineTypeChart(this.chartType)&&n.isDatetimeType(this.xAxisType)?this.label=o.formatDate(this.x,this.dateFormat):this.label=o.formatValue({value:this.x,formatFunctions:this.formatFunctions,chartType:this.chartType,areaType:"series"}),this.label+=", "+o.formatValue({value:this.y,formatFunctions:this.formatFunctions,chartType:this.chartType,areaType:"series"}))},addStart:function(t){this.start=t},addRatio:function(t,e,i){!r.isExisty(this.ratioMap[t])&&e&&(this.ratioMap[t]=(this[t]-i)/e)},_getFormattedValueForTooltip:function(t){var e=this.ratioMap[t],i=this[t],n=o.formatValue({value:i,formatFunctions:this.formatFunctions,chartType:this.chartType,areaType:"tooltip",valueType:t});return r.isNumber(e)?n:i},pickValueMapForTooltip:function(){var t={x:this._getFormattedValueForTooltip("x"),y:this._getFormattedValueForTooltip("y"),xRatio:this.ratioMap.x,yRatio:this.ratioMap.y};return r.isExisty(this.r)&&(t.r=this._getFormattedValueForTooltip("r"),t.rRatio=this.ratioMap.r),t}});t.exports=a},function(t,e,i){"use strict";var n=i(108),o=i(103),r=i(6),a=Array.prototype.concat,s=r.defineClass(o,{init:function(t,e,i,n){this.chartType=e,this.options=i||{},this.formatFunctions=n,this.rawSeriesData=t||[],this.baseGroups=null,this.groups=null,this.options.series=this.options.series||{},this.valuesMap={}},_createBaseGroups:function(){var t=this.chartType,e=this.formatFunctions;return r.map(this.rawSeriesData,function(i){var o=r.isArray(i)?i:[].concat(i.data),a=r.map(o,function(o,r){return new n({datum:o,chartType:t,formatFunctions:e,index:r,legendName:i.name})});return a})},_createValues:function(){var t=[];return this.map(function(e){return r.forEach(e.items,function(e){t.push(e.min),t.push(e.max),t.push(e.uq),t.push(e.lq),t.push(e.median)})}),t=a.apply([],t),r.filter(t,function(t){return!isNaN(t)})}});t.exports=s},function(t,e,i){"use strict";var n=i(7),o=i(45),r=i(6),a=r.defineClass({init:function(t){this.chartType=t.chartType,this.formatFunctions=t.formatFunctions,this.value=null,this.label=null,this.ratio=null,this.min=null,this.minLabel=null,this.minRatio=null,this.max=null,this.maxLabel=null,this.maxRatio=null,this.median=null,this.medianLabel=null,this.medianRatio=null,this.lq=null,this.lqLabel=null,this.lqRatio=null,this.uq=null,this.uqLabel=null,this.uqRatio=null,this.ratioDistance=null,this.legendName=t.legendName,this._initValues(t.datum,t.index)},_initValues:function(t,e){var i,o=this._createValues(t),a=o[4],s=o[3],h=o[2],l=o[1],u=o[0],c=o.length>5,d=r.bind(function(t){return n.formatValue({value:t,formatFunctions:this.formatFunctions,chartType:this.chartType,areaType:"makingSeriesLabel",legendName:this.legendName})},this);this.value=this.max=a,this.uq=s,this.median=h,this.lq=l,this.min=u,this.index=e,c&&(this.outliers=[],i=this.outliers,r.forEach(o.slice(5),function(t){i.push({value:t,label:d(t)})})),this.label=d(a),this.uqLabel=d(s),this.medianLabel=d(h),this.lqLabel=d(l),this.minLabel=d(u),this.maxLabel=this.label},_createValues:function(t){var e=r.map([].concat(t),function(t){return r.isNull(t)?null:parseFloat(t)});return e},addStart:function(t){r.isNull(this.min)&&(this.min=t,this.minLabel=n.formatValue({value:t,formatFunctions:this.formatFunctions,chartType:this.chartType,areaType:"series",legendName:this.legendName}))},_updateFormattedValueforRange:function(){this.label=this.minLabel+" ~ "+this.maxLabel},addRatio:function(t,e,i){var n=o.calculateRatio;t=t||1,i=i||1,e=e||0,this.ratio=this.maxRatio=n(this.max,t,e,i),this.uqRatio=n(this.uq,t,e,i),this.medianRatio=n(this.median,t,e,i),this.lqRatio=n(this.lq,t,e,i),this.minRatio=n(this.min,t,e,i),r.forEach(this.outliers,function(o){o.ratio=n(o.value,t,e,i)}),this.ratioDistance=Math.abs(this.uqRatio-this.lqRatio)},_getFormattedValueForTooltip:function(t){return n.formatValue({value:this[t],formatFunctions:this.formatFunctions,chartType:this.chartType,areaType:"tooltip",valueType:t,legendName:this.legendName})},pickValueMapForTooltip:function(){var t={value:this._getFormattedValueForTooltip("value"),ratio:this.ratio};return r.isExisty(this.min)&&(t.min=this._getFormattedValueForTooltip("min"),t.max=this._getFormattedValueForTooltip("max"),t.minRatio=this.minRatio,t.maxRatio=this.maxRatio,t.maxLabel=this.maxLabel,t.minLabel=this.minLabel,t.uqLabel=this.uqLabel,t.lqLabel=this.lqLabel,t.medianLabel=this.medianLabel,t.outliers=this.outliers),t}});t.exports=a},function(t,e,i){"use strict";var n=i(105),o=i(103),r=i(8),a=i(6),s=a.defineClass(o,{init:function(t,e,i,n){o.call(this,t,e,i,n)},_createBaseGroups:function(){var t=this.chartType,e=this.formatFunctions,i=0,o=0,s=a.map(this.rawSeriesData,function(s){var h=[],l=s.data,u=s.markers,c=u.length,d=s.ranges,p=d.length;return d&&p&&(a.map(d,function(i){h.push(new n({datum:i,chartType:t,formatFunctions:e,type:r.BULLET_TYPE_RANGE}))}),i=Math.max(i,p)),l&&h.push(new n({datum:l,chartType:t,formatFunctions:e,type:r.BULLET_TYPE_ACTUAL})),u&&c&&(a.map(u,function(i){h.push(new n({datum:i,chartType:t,formabutFunctions:e,type:r.BULLET_TYPE_MARKER}))}),o=Math.max(o,c)),h});return this.maxMarkerCount=o,this.maxRangeCount=i,s},_createSeriesGroupsFromRawData:function(){return o.prototype._createSeriesGroupsFromRawData.call(this)}});t.exports=s},function(t,e,i){"use strict";var n=i(103),o=i(111),r=i(8),a=i(45),s=i(6),h=Array.prototype.slice,l=s.defineClass(n,{init:function(){n.apply(this,arguments),this.foundSeriesItemsMap={},this.seriesItemMap={}},_flattenHierarchicalData:function(t,e,i){var n,o=this,a=[];return e?n=e+"_":(n=r.TREEMAP_ID_PREFIX,e=r.TREEMAP_ROOT_ID),i=i||[],s.forEachArray(t,function(t,r){var h=n+r,l=t.children,u=i.concat(r);t.indexes=u,s.isNull(t.value)||a.push(t),t.id||(t.id=h),t.parent||(t.parent=e),l&&(a=a.concat(o._flattenHierarchicalData(l,h,u)),delete t.children)}),a},_partitionRawSeriesDataByParent:function(t,e){var i=[],n=[];return s.forEachArray(t,function(t){t.parent===e?i.push(t):n.push(t)}),[i,n]},_setTreeProperties:function(t,e,i,n){var o=this,r=this._partitionRawSeriesDataByParent(t,i),h=r[0],l=r[1],u=e+1;return s.forEachArray(h,function(t,i){var r,c;t.depth=e,t.group=s.isUndefined(n)?i:n,r=o._setTreeProperties(l,u,t.id,t.group),c=s.filter(r,function(t){return t.depth===u}),c.length?(t.value=a.sum(s.pluck(c,"value")),t.hasChild=!0):t.hasChild=!1,h=h.concat(r)}),h},_setRatio:function(t,e){var i=this,n=this._partitionRawSeriesDataByParent(t,e),o=n[0],r=n[1],h=a.sum(s.pluck(o,"value"));s.forEachArray(o,function(t){var e=s.isNull(t.value)?0:t.value;t.ratio=e/h,t.hasChild&&i._setRatio(r,t.id)})},_createBaseGroups:function(){var t=this.chartType,e=this.seriesItemMap,i=this.formatFunctions,n=this._flattenHierarchicalData(this.rawSeriesData);return n=this._setTreeProperties(n,1,r.TREEMAP_ROOT_ID),this._setRatio(n,r.TREEMAP_ROOT_ID),[s.map(n,function(n){var r=new o(n,i,t);return e[r.id]=r,r})]},_findSeriesItems:function(t,e){return this.foundSeriesItemsMap[t]||(this.foundSeriesItemsMap[t]=this.getFirstSeriesGroup(!0).filter(e)),this.foundSeriesItemsMap[t]},_makeCacheKey:function(t){var e=t;return arguments.length>1&&(e+=h.call(arguments,1).join("_")),e},_isValidGroup:function(t,e){return!s.isExisty(e)||t===e},findSeriesItemsByDepth:function(t,e){var i=this,n=this._makeCacheKey(r.TREEMAP_DEPTH_KEY_PREFIX,t,e);return this._findSeriesItems(n,function(n){return n.depth===t&&i._isValidGroup(n.group,e)})},findSeriesItemsByParent:function(t){var e=this._makeCacheKey(r.TREEMAP_PARENT_KEY_PREFIX,t);return this._findSeriesItems(e,function(e){return e.parent===t})},findLeafSeriesItems:function(t){var e=this,i=this._makeCacheKey(r.TREEMAP_LEAF_KEY_PREFIX,t);return this._findSeriesItems(i,function(i){return!i.hasChild&&e._isValidGroup(i.group,t)})},findParentByDepth:function(t,e){var i=this.seriesItemMap[t]||null;return i&&i.depth!==e&&(i=this.findParentByDepth(i.parent,e)),i},initSeriesItemsMap:function(){this.foundSeriesItemsMap=null}});t.exports=l},function(t,e,i){"use strict";var n=i(45),o=i(7),r=i(6),a=r.defineClass({init:function(t,e,i){this.chartType=i,this.formatFunctions=e,this.id=t.id,this.parent=t.parent,this.value=t.value,this.ratio=t.ratio,this.colorValue=t.colorValue,this.depth=t.depth,this.label=t.label||"",this.group=t.group,this.hasChild=!!t.hasChild,this.indexes=t.indexes},addRatio:function(t,e){t=t||1,e=e||0,this.colorRatio=n.calculateRatio(this.colorValue,t,e,1)||-1},pickValueMapForTooltip:function(){var t=this.formatFunctions,e=this.chartType,i=this.colorValue,n=o.formatValue({value:this.value,formatFunctions:t,chartType:e,areaType:"tooltipValue"}),a=(this.label?this.label+": ":"")+n,s={value:n,label:a,ratio:this.ratio};return r.isExisty(i)&&(s.colorValue=o.formatValue({value:i,formatFunctions:t,chartType:e,areaType:"tooltipColorValue"}),s.colorRatio=this.colorRatio),s},pickLabelTemplateData:function(){var t={value:this.value,ratio:this.ratio,label:this.label};return r.isExisty(this.colorValue)&&(t.colorValue=this.colorValue,t.colorValueRatio=this.ratio),t}});t.exports=a},function(t,e,i){"use strict";var n=i(113),o=i(119),r=i(8),a=i(11),s={_createBoundsModel:function(t,e){return new n({chartType:e.chartType,seriesTypes:e.seriesTypes,options:e.options,theme:e.theme,dataProcessor:t,hasAxes:e.hasAxes,isVertical:e.isVertical})},_createScaleDataModel:function(t,e,i){return new o({chartType:i.chartType,seriesTypes:i.seriesTypes,options:i.options,theme:i.theme,dataProcessor:t,boundsModel:e,hasRightYAxis:i.hasRightYAxis,addedDataCount:i.addedDataCount})},addYAxisScale:function(t,e,i,n){t.addScale(e,i&&i.options||n||{},{valueType:i.valueType||"value",areaType:i.areaType,chartType:i.chartType},i.additionalOptions)},_registerYAxisDimension:function(t,e,i,n,o){var r,a=t.get(n),s=null; +a&&(r=i[n],r&&(s=r.limit),e.registerYAxisDimension(s,n,a.options,a.theme,o))},_setLayoutBoundsAndScale:function(t,e,i,n,o){var s,h=o.options,l=o.scaleOption||{},u=o.addingDataMode,c=o.isVertical;e.has("xAxis")&&i.registerXAxisHeight(),e.has("legend")&&(e.get("legend").colorSpectrum?i.registerSpectrumLegendDimension():i.registerLegendDimension()),l.yAxis&&this.addYAxisScale(n,"yAxis",l.yAxis,o.options.yAxis),l.rightYAxis&&this.addYAxisScale(n,"rightYAxis",l.rightYAxis),l.legend&&n.addScale("legend",{},{chartType:o.chartType},{tickCounts:[r.SPECTRUM_LEGEND_TICK_COUNT]}),s=n.scaleDataMap,this._registerYAxisDimension(e,i,s,"yAxis",c),this._registerYAxisDimension(e,i,s,"rightYAxis",c),l.xAxis&&n.addScale("xAxis",h.xAxis,{valueType:l.xAxis.valueType||"value"},l.xAxis.additionalOptions),o.hasAxes&&n.setAxisDataMap(),i.registerSeriesDimension(),e.has("circleLegend")&&h.circleLegend.visible&&i.registerCircleLegendDimension(n.axisDataMap),e.has("xAxis")&&(a.isAutoTickInterval(h.xAxis.tickInterval)&&n.updateXAxisDataForAutoTickInterval(o.prevXAxisData,u),n.updateXAxisDataForLabel(u)),i.registerBoundsData(n.axisDataMap.xAxis)},build:function(t,e,i){var n,o=this._createBoundsModel(t,i),r=this._createScaleDataModel(t,o,i);return this._setLayoutBoundsAndScale(t,e,o,r,i),n={dimensionMap:o.dimensionMap,positionMap:o.positionMap,limitMap:r.makeLimitMap(i.seriesTypes||[i.chartType],i.isVertical)},r.axisDataMap&&(n.axisDataMap=r.axisDataMap),a.isBubbleChart(i.chartType)&&(n.maxRadius=o.calculateMaxRadius(r.axisDataMap)),r.scaleDataMap.legend&&(n.legendScaleData=r.scaleDataMap.legend),n}};t.exports=s},function(t,e,i){"use strict";var n=i(8),o=i(11),r=i(7),a=i(5),s=i(114),h=i(115),l=i(116),u=i(117),c=i(118),d=i(6),p=d.defineClass({init:function(t){this.options=t.options||{},this.options.legend=this.options.legend||{},this.options.yAxis=this.options.yAxis||{},this.theme=t.theme||{},this.hasAxes=t.hasAxes,this.chartType=t.chartType,this.seriesTypes=t.seriesTypes||[],this.dataProcessor=t.dataProcessor,this.initBoundsData()},initBoundsData:function(){this.dimensionMap={legend:{width:0},yAxis:{width:0},rightYAxis:{width:0},xAxis:{height:0},circleLegend:{width:0},chartExportMenu:{width:0}},this.positionMap={},this.chartLeftPadding=n.CHART_PADDING,this.maxRadiusForBubbleChart=null,this._registerChartDimension(),this._registerTitleDimension(),this._registerChartExportMenuDimension()},_registerDimension:function(t,e){this.dimensionMap[t]=d.extend(this.dimensionMap[t]||{},e)},getBound:function(t){return{dimension:this.dimensionMap[t]||{},position:this.positionMap[t]||{}}},_setBound:function(t,e){this.dimensionMap[t]=e.dimension,this.positionMap[t]=e.position},getDimension:function(t){return this.dimensionMap[t]},getDimensionMap:function(t){var e=this,i={};return t&&t.length?d.forEachArray(t,function(t){i[t]=e.dimensionMap[t]}):i=this.dimensionMap,JSON.parse(JSON.stringify(i))},getPosition:function(t){return this.positionMap[t]},_registerChartDimension:function(){var t=this.options.chart||{},e={width:t.width||n.CHART_DEFAULT_WIDTH,height:t.height||n.CHART_DEFAULT_HEIGHT};this._registerDimension("chart",e)},_registerTitleDimension:function(){var t=this.options.chart||{},e=d.isExisty(t.title),i=e?a.getRenderedTextSize(t.title.text,this.theme.title.fontSize,this.theme.title.fontFamily).height:0,o={height:i?i+n.TITLE_PADDING:0};this._registerDimension("title",o)},_registerChartExportMenuDimension:function(){var t;t=this.options.chartExportMenu.visible?{height:17+n.CHART_PADDING,width:60}:{width:0,height:0},this._registerDimension("chartExportMenu",t)},registerXAxisHeight:function(){this._registerDimension("xAxis",{height:h.calculateXAxisHeight(this.options.xAxis,this.theme.xAxis)})},registerLegendDimension:function(){var t=d.pluck(this.dataProcessor.getOriginalLegendData(),"label"),e=this.options.legend,i=this.theme.legend.label,n=this.getDimension("chart").width,o=l.calculate(e,i,t,n);this._registerDimension("legend",o)},registerSpectrumLegendDimension:function(){var t,e=this.dataProcessor.getFormattedMaxValue(this.chartType,"legend"),i=this.theme.label;t=o.isHorizontalLegend(this.options.legend.align)?c._makeHorizontalDimension(e,i):c._makeVerticalDimension(e,i),this._registerDimension("legend",t)},registerYAxisDimension:function(t,e,i,n,r){var a,s;if(t)a=[t.min,t.max];else{if(!o.isHeatmapChart(this.chartType)&&r)return;a=this.dataProcessor.getCategories(!0)}s=d.isArray(i)?"yAxis"===e?i[0]:i[1]:i,this._registerDimension(e,{width:h.calculateYAxisWidth(a,s,n)})},calculateSeriesWidth:function(){var t=this.getDimensionMap(["chart","yAxis","legend","rightYAxis"]);return u.calculateWidth(t,this.options.legend)},calculateSeriesHeight:function(){var t=this.getDimensionMap(["chart","title","legend","xAxis","chartExportMenu"]);return u.calculateHeight(t,this.options.legend,this.chartType,this.theme.series)},getBaseSizeForLimit:function(t){var e;return e=t?this.calculateSeriesHeight():this.calculateSeriesWidth()},_makeSeriesDimension:function(){return{width:this.calculateSeriesWidth(),height:this.calculateSeriesHeight()}},registerSeriesDimension:function(){var t=this._makeSeriesDimension();this._registerDimension("series",t)},_updateLegendAndSeriesWidth:function(t,e){var i=this.options.legend;o.isVerticalLegend(i.align)&&i.visible&&this._registerDimension("legend",{width:t}),this._registerDimension("series",{width:this.getDimension("series").width-e})},registerCircleLegendDimension:function(t){var e,i,r=this.getDimension("series"),a=this.options.legend,h=this.dataProcessor.getFormattedMaxValue(this.chartType,"circleLegend","r"),l=this.theme.chart.fontFamily,u=s.calculateCircleLegendWidth(r,t,h,l);e=o.isVerticalLegend(a.align)&&a.visible?this.getDimension("legend").width:0,u=Math.min(u,Math.max(e,n.MIN_LEGEND_WIDTH)),i=u-e,this._registerDimension("circleLegend",{width:u,height:u}),i>0&&this._updateLegendAndSeriesWidth(u,i)},_makePlotDimension:function(){var t=this.getDimension("series");return{width:t.width,height:t.height+n.OVERLAPPING_WIDTH}},_registerCenterComponentsDimension:function(){var t=this.getDimension("series");this._registerDimension("tooltip",t),this._registerDimension("mouseEventDetector",t)},_registerAxisComponentsDimension:function(){var t=this._makePlotDimension();this._registerDimension("plot",t),this._registerDimension("xAxis",{width:t.width}),this._registerDimension("yAxis",{height:t.height}),this._registerDimension("rightYAxis",{height:t.height})},_updateDimensionsWidth:function(t){var e=Math.max(t.overflowLeft,0),i=Math.max(t.overflowRight,0),n=e+i;this.chartLeftPadding+=e,this.dimensionMap.plot.width-=n,this.dimensionMap.series.width-=n,this.dimensionMap.mouseEventDetector.width-=n,this.dimensionMap.xAxis.width-=n},_updateDimensionsHeight:function(t){this.dimensionMap.plot.height-=t,this.dimensionMap.series.height-=t,this.dimensionMap.mouseEventDetector.height-=t,this.dimensionMap.tooltip.height-=t,this.dimensionMap.yAxis.height-=t,this.dimensionMap.rightYAxis.height-=t,this.dimensionMap.xAxis.height+=t},_updateDimensionsForXAxisLabel:function(t){(t.overflowRight>0||t.overflowLeft>0)&&this._updateDimensionsWidth(t),t.overflowHeight&&this._updateDimensionsHeight(t.overflowHeight)},_registerAxisComponentsPosition:function(t){var e=this.getPosition("series"),i=this.getDimension("series"),o=this.getDimension("yAxis").width,r=t+o+i.width;this.positionMap.plot={top:e.top,left:e.left},this.positionMap.yAxis={top:e.top,left:this.chartLeftPadding+t},this.positionMap.xAxis={top:e.top+i.height,left:e.left},this.positionMap.rightYAxis={top:e.top,left:this.chartLeftPadding+r-n.OVERLAPPING_WIDTH}},_makeLegendPosition:function(){var t,e,i=this.dimensionMap,r=this.getDimension("series"),a=this.options.legend,s=i.title.height||i.chartExportMenu.height;return o.isLegendAlignBottom(a.align)&&(s+=r.height+this.getDimension("xAxis").height+n.LEGEND_AREA_PADDING),o.isHorizontalLegend(a.align)?e=(this.getDimension("chart").width-this.getDimension("legend").width)/2:o.isLegendAlignLeft(a.align)?e=this.chartLeftPadding:(t=this.getDimension("yAxis").width+this.getDimension("rightYAxis").width,e=this.chartLeftPadding+t+r.width),{top:s,left:e}},_makeChartExportMenuPosition:function(){return{top:1,right:20}},_makeCircleLegendPosition:function(){var t,e,i=this.getPosition("series"),r=this.getDimension("series"),a=this.getDimension("circleLegend"),s=this.options.legend;return t=o.isLegendAlignLeft(s.align)?0:i.left+r.width,o.isVerticalLegend(s.align)&&s.visible&&(e=this.getDimension("legend").width+n.CHART_PADDING,t+=(e-a.width)/2),{top:i.top+r.height-a.height,left:t}},_isNeedExpansionSeries:function(){var t=this.chartType;return!(o.isPieChart(t)||o.isMapChart(t)||o.isTreemapChart(t)||o.isRadialChart(t)||o.isPieDonutComboChart(t,this.seriesTypes))},_registerEssentialComponentsPositions:function(){var t,e=this.getPosition("series");this.positionMap.mouseEventDetector=d.extend({},e),this.positionMap.legend=this._makeLegendPosition(),this.positionMap.chartExportMenu=this._makeChartExportMenuPosition(),this.getDimension("circleLegend").width&&(this.positionMap.circleLegend=this._makeCircleLegendPosition()),t=this._isNeedExpansionSeries()?{top:e.top-n.SERIES_EXPAND_SIZE,left:e.left-n.SERIES_EXPAND_SIZE}:e,this.positionMap.tooltip=t},_registerPositions:function(){var t=this.options.legend.align,e=this.options.legend.visible,i=this.getDimension("legend"),a=o.isLegendAlignTop(t)&&e?i.height:0,s=o.isLegendAlignLeft(t)&&e?i.width:0,h=Math.max(this.getDimension("title").height,this.getDimension("chartExportMenu").height),l=h+a,u=r.getDefaultSeriesTopAreaHeight(this.chartType,this.theme.series),c={top:(l?l:u)+n.CHART_PADDING,left:this.chartLeftPadding+s+this.getDimension("yAxis").width};this.positionMap.series=c,this.hasAxes&&this._registerAxisComponentsPosition(s),this._registerEssentialComponentsPositions()},_registerExtendedSeriesBound:function(){var t=this.getBound("series");this._isNeedExpansionSeries()&&(t=r.expandBound(t)),this._setBound("extendedSeries",t)},_updateBoundsForYAxisCenterOption:function(){var t=this.getDimension("yAxis").width,e=Math.floor(this.getDimension("series").width/2)+n.OVERLAPPING_WIDTH,i=t-n.OVERLAPPING_WIDTH,o=r.isOldBrowser()?1:0;this.dimensionMap.extendedSeries.width+=t,this.dimensionMap.xAxis.width+=n.OVERLAPPING_WIDTH,this.dimensionMap.plot.width+=t+n.OVERLAPPING_WIDTH,this.dimensionMap.mouseEventDetector.width+=t,this.dimensionMap.tooltip.width+=t,this.positionMap.series.left-=t-o,this.positionMap.extendedSeries.left-=i-o,this.positionMap.plot.left-=i,this.positionMap.yAxis.left+=e,this.positionMap.xAxis.left-=i,this.positionMap.mouseEventDetector.left-=i,this.positionMap.tooltip.left-=i},registerBoundsData:function(t){this._registerCenterComponentsDimension(),this.hasAxes&&(this._registerAxisComponentsDimension(),this._updateDimensionsForXAxisLabel(t)),this._registerPositions(),this._registerExtendedSeriesBound(),this.options.yAxis.isCenter&&this._updateBoundsForYAxisCenterOption()},calculateMaxRadius:function(t){var e=this.getDimensionMap(["series","circleLegend"]),i=!!this.options.circleLegend&&this.options.circleLegend.visible;return s.calculateMaxRadius(e,t,i)}});t.exports=p},function(t,e,i){"use strict";var n=i(8),o=i(7),r={_calculatePixelStep:function(t,e){var i,n=t.tickCount;return i=t.isLabelAxis?e/n/2:e/(n-1),parseInt(i,10)},_calculateRadiusByAxisData:function(t,e){var i=this._calculatePixelStep(e.yAxis,t.height),n=this._calculatePixelStep(e.xAxis,t.width);return Math.min(i,n)},_getCircleLegendLabelMaxWidth:function(t,e){return o.getRenderedLabelWidth(t,{fontSize:n.CIRCLE_LEGEND_LABEL_FONT_SIZE,fontFamily:e})},calculateCircleLegendWidth:function(t,e,i,o){var r=this._calculateRadiusByAxisData(t,e),a=this._getCircleLegendLabelMaxWidth(i,o);return Math.max(2*r,a)+n.CIRCLE_LEGEND_PADDING},calculateMaxRadius:function(t,e,i){var o=this._calculateRadiusByAxisData(t.series,e),r=t.circleLegend.width;return i?Math.min((r-n.CIRCLE_LEGEND_PADDING)/2,o):o}};t.exports=r},function(t,e,i){"use strict";var n=i(8),o=i(11),r=i(7),a={calculateXAxisHeight:function(t,e){var i=t.title,o=i?r.getRenderedLabelHeight(i.text,e.title):0,a=o?o+n.TITLE_PADDING:0,s=t.labelMargin||0,h=r.getRenderedLabelHeight(n.MAX_HEIGHT_WORD,e.label),l=a+n.CHART_PADDING;return s>0&&(l+=s),t.showLabel!==!1&&(l+=h),l},calculateYAxisWidth:function(t,e,i){var a=e.title||"",s=0,h=e.labelMargin||0,l=0;return t=r.addPrefixSuffix(t,e.prefix,e.suffix),e.isCenter?l+=n.AXIS_LABEL_PADDING:s=e.rotateTitle===!1?r.getRenderedLabelWidth(a.text,i.title)+n.TITLE_PADDING:r.getRenderedLabelHeight(a.text,i.title)+n.TITLE_PADDING,o.isDatetimeType(e.type)&&(t=r.formatDates(t,e.dateFormat)),h>0&&(l+=h),e.showLabel!==!1&&(l+=r.getRenderedLabelsMaxWidth(t,i.label)),l+=s+n.AXIS_LABEL_PADDING}};t.exports=a},function(t,e,i){"use strict";var n=i(6),o=i(8),r=i(11),a=i(45),s=i(7),h=i(10),l=o.LEGEND_CHECKBOX_WIDTH,u=o.LEGEND_ICON_WIDTH,c=o.LEGEND_ICON_HEIGHT,d=o.LEGEND_LABEL_LEFT_PADDING,p=o.LEGEND_AREA_PADDING,f={legendMargin:d+p,_calculateLegendsWidthSum:function(t,e,i,o){var r=p+i+u+d,h=this.legendMargin;return a.sum(n.map(t,function(t){var i=s.getRenderedLabelWidth(t,e);return o&&i>o&&(i=o),i+=r,i+h}))},_divideLegendLabels:function(t,e){var i=Math.round(t.length/e),o=[],r=[];return n.forEachArray(t,function(t){r.length=e);return{labels:r,maxLineWidth:h}},_calculateHorizontalLegendHeight:function(t,e){var i=Math.max.apply(null,n.map(t,function(t){return s.getRenderedLabelsMaxHeight(t,e)})),r=Math.max(c,i)+o.LINE_MARGIN_TOP,a=r*t.length-o.LINE_MARGIN_TOP;return a},_makeHorizontalDimension:function(t,e,i,n,r){var a=this._makeDividedLabelsAndMaxLineWidth(e,i,t,n,r),s=this._calculateHorizontalLegendHeight(a.labels,t),h=s+2*p;return{width:Math.max(a.maxLineWidth,o.MIN_LEGEND_WIDTH),height:h}},_makeVerticalDimension:function(t,e,i,n){var o=s.getRenderedLabelsMaxWidth(e,t);return n&&o>n&&(o=n),o+=p+i+u+d,{width:o+this.legendMargin,height:0}},calculate:function(t,e,i,n){var o=t.showCheckbox===!1?0:l+d,a=t.maxWidth,s={};return t.visible?s=r.isHorizontalLegend(t.align)?this._makeHorizontalDimension(e,i,n,o,a):this._makeVerticalDimension(e,i,o,a):s.width=0,s}};t.exports=f},function(t,e,i){"use strict";var n=i(8),o=i(11),r=i(7),a={calculateWidth:function(t,e){var i=t.chart.width,r=t.yAxis.width+t.rightYAxis.width,a=t.legend,s=0;return o.isVerticalLegend(e.align)&&e.visible&&(s=a?a.width:0),i-2*n.CHART_PADDING-r-s},calculateHeight:function(t,e,i,a){var s=t.chart.height,h=r.getDefaultSeriesTopAreaHeight(i,a),l=Math.max(t.title.height,t.chartExportMenu.height),u=t.xAxis.height,c=e.visible?t.legend.height:0,d=e.align;return u+=o.isLegendAlignBottom(d)?c:0,l+=o.isLegendAlignTop(d)?c:0,l=l||h,s-2*n.CHART_PADDING-l-u}};t.exports=a},function(t,e,i){"use strict";var n=i(8),o=i(7),r={_makeVerticalDimension:function(t,e){var i=o.getRenderedLabelWidth(t,e),r=n.LEGEND_AREA_PADDING+n.MAP_LEGEND_LABEL_PADDING;return{width:n.MAP_LEGEND_GRAPH_SIZE+i+r,height:n.MAP_LEGEND_SIZE}},_makeHorizontalDimension:function(t,e){var i=o.getRenderedLabelHeight(t,e),r=n.LEGEND_AREA_PADDING+n.MAP_LEGEND_LABEL_PADDING;return{width:n.MAP_LEGEND_SIZE,height:n.MAP_LEGEND_GRAPH_SIZE+i+r}}};t.exports=r},function(t,e,i){"use strict";var n=i(120),o=i(122),r=i(123),a=i(11),s=i(7),h=i(6),l=h.defineClass({init:function(t){this.chartType=t.chartType,this.seriesTypes=t.seriesTypes,this.dataProcessor=t.dataProcessor,this.boundsModel=t.boundsModel,this.options=t.options,this.theme=t.theme,this.hasRightYAxis=!!t.hasRightYAxis,this.prevValidLabelCount=null,this.initScaleData(t.addedDataCount),this.initForAutoTickInterval()},initScaleData:function(t){this.scaleDataMap={},this.axisDataMap={},this.addedDataCount=t},initForAutoTickInterval:function(){this.firstTickCount=null},_pickLimitOption:function(t){return t=t||{},{min:t.min,max:t.max}},_createBaseScaleData:function(t,e,i,o){var r=t.chartType,s="xAxis"!==t.areaType,l=this.dataProcessor.createBaseValuesForLimit(r,o.isSingleYAxis,e.stackType,t.valueType,t.areaType),u=this.boundsModel.getBaseSizeForLimit(s),c=h.extend(e,{isVertical:s,limitOption:this._pickLimitOption(i),tickCounts:o.tickCounts});return a.isBubbleChart(r)&&(c.overflowItem=this.dataProcessor.findOverflowItem(r,t.valueType)),n.makeScaleData(l,u,r,c)},_createScaleLabels:function(t,e,i,n){var r=this.dataProcessor.getFormatFunctions(),a=h.extend(i,{dateFormat:n});return o.createFormattedLabels(t,e,a,r)},_createScaleData:function(t,e,i){var n,o,r=this.options.series,a=e.chartType||this.chartType;return e.chartType=a,r=r[a]||r,n={stackType:i.stackType||r.stackType,diverging:r.diverging,type:t.type},o=this._createBaseScaleData(e,n,t,i),h.extend(o,{labels:this._createScaleLabels(o,e,n,t.dateFormat),axisOptions:t})},_createValueAxisData:function(t,e,i,n,o){var a,s,l=this.dataProcessor.hasCategories(),u=!n&&!l&&i,c=t.labels,d=t.limit,p=t.step,f=c.length,m=r.makeValueAxisData({labels:c,tickCount:c.length,limit:d,step:p,options:t.axisOptions,labelTheme:e,isVertical:!!n,isPositionRight:!!o,aligned:i});return u&&(a=this.dataProcessor.getValues(this.chartType,"x"),s=r.makeAdditionalDataForCoordinateLineType(c,a,d,p,f),h.extend(m,s)),m},_createLabelAxisData:function(t,e,i,n,o){return r.makeLabelAxisData({labels:this.dataProcessor.getCategories(n),options:t,labelTheme:e,isVertical:!!n,isPositionRight:!!o,aligned:i,addedDataCount:this.options.series.shifting?this.addedDataCount:0})},_createAxisData:function(t,e,i,n,o){var r,s=a.isLineTypeChart(this.chartType,this.seriesTypes)&&!e.pointOnColumn;return r=t?this._createValueAxisData(t,i,s,n,o):this._createLabelAxisData(e,i,s,n,o)},_createAxesData:function(){var t=this.scaleDataMap,e=this.options,i=this.theme,n=h.isArray(e.yAxis)?e.yAxis:[e.yAxis],o={};return o.xAxis=this._createAxisData(t.xAxis,e.xAxis,i.xAxis.label),o.yAxis=this._createAxisData(t.yAxis,n[0],i.yAxis.label,!0),this.hasRightYAxis&&(o.rightYAxis=this._createAxisData(t.rightYAxis,n[1],i.yAxis.label,!0,!0),o.rightYAxis.aligned=o.xAxis.aligned),o},addScale:function(t,e,i,n){i=i||{},n=n||{},i.areaType=i.areaType||t,i.chartType=n.chartType||i.chartType,this.scaleDataMap[t]=this._createScaleData(e,i,n)},setAxisDataMap:function(){this.axisDataMap=this._createAxesData()},updateXAxisDataForAutoTickInterval:function(t,e){var i=this.options.series.shifting,n=this.options.series.zoomable,o=this.axisDataMap.xAxis,a=this.boundsModel.getDimension("series").width,s=this.addedDataCount;i||!t||n?r.updateLabelAxisDataForAutoTickInterval(o,a,s,e):r.updateLabelAxisDataForStackingDynamicData(o,t,this.firstTickCount),this.firstTickCount||(this.firstTickCount=o.tickCount)},updateXAxisDataForLabel:function(t){var e,i,n,o=this.axisDataMap.xAxis,a=o.labels,l=this.boundsModel.getDimensionMap(["series","yAxis","chart"]),u=o.isLabelAxis,c=this.theme.xAxis.label;t&&(a=a.slice(0,a.length-1)),a=s.addPrefixSuffix(a,this.options.xAxis.prefix,this.options.xAxis.suffix),e=h.filter(a,function(t){return!!t}),i=h.isNull(this.prevValidLabelCount)?e.length:this.prevValidLabelCount,this.options.yAxis.isCenter&&(i+=1,l.yAxis.width=0),n=o.options.rotateLabel===!1?r.makeAdditionalDataForMultilineLabels(a,i,c,u,l):r.makeAdditionalDataForRotatedLabels(e,i,c,u,l),this.prevValidLabelCount=i,h.extend(o,n)},_findLimit:function(t,e,i){var n;return n=0===e?i?t.yAxis:t.xAxis:t.rightYAxis?t.rightYAxis:t.yAxis},makeLimitMap:function(t,e){var i=this,n=this.scaleDataMap,o={};return n.xAxis&&(o.xAxis=n.xAxis.limit),n.yAxis&&(o.yAxis=n.yAxis.limit),n.rightYAxis&&(o.rightYAxis=n.rightYAxis.limit),n.legend&&(o.legend=n.legend.limit),h.forEachArray(t,function(t,n){o[t]=i._findLimit(o,n,e)}),o}});t.exports=l},function(t,e,i){"use strict";var n=i(8),o=i(11),r=i(45),a=i(10),s=i(121),h=i(6),l=Math.abs,u={_makeLimitForDivergingOption:function(t){var e=Math.max(l(t.min),l(t.max));return{min:-e,max:e}},_adjustLimitForOverflow:function(t,e,i){var n=t.min,o=t.max;return i.min&&(n=r.subtract(n,e)),i.max&&(o=r.add(o,e)),{min:n,max:o}},millisecondMap:{year:31536e6,month:26784e5,week:6048e5,date:864e5,hour:36e5,minute:6e4,second:1e3},millisecondTypes:["year","month","week","date","hour","minute","second"],_findDateType:function(t,e){var i,o=t.max-t.min,r=this.millisecondTypes,a=this.millisecondMap,s=r.length-1;return o?h.forEachArray(r,function(t,n){var l,u=a[t],c=Math.floor(o/u);return c&&(l=n0?i.min=0:0===e?i.max=10:i.max=0):0===i.min&&0===i.max?i.max=10:i.min===i.max&&(i.min-=i.min/10,i.max+=i.max/10),i},_calculateDatetimeScale:function(t,e,i){var n,o,r;return n=this._makeDatetimeInfo(this._getLimitSafely(t),t.length),r=n.dataLimit,i&&(r=this._makeLimitForDivergingOption(r)),o=s({min:r.min,max:r.max,offsetSize:e,minimumStepSize:1}),o=this._restoreScaleToDatetimeType(o,n.minDate,n.divisionNumber)},_calculatePercentStackedScale:function(t,e){var i;return i=0===r.sumMinusValues(t)?n.PERCENT_STACKED_AXIS_SCALE:0===r.sumPlusValues(t)?n.MINUS_PERCENT_STACKED_AXIS_SCALE:e?n.DIVERGING_PERCENT_STACKED_AXIS_SCALE:n.DUAL_PERCENT_STACKED_AXIS_SCALE},_calculateCoordinateScale:function(t){var e,i,n=t.options,r=t.baseSize,a=t.overflowItem,l=t.chartType,u=this._getLimitSafely(t.baseValues),c=n.limitOption||{},d=h.isExisty(c.min),p=h.isExisty(c.max),f=u.min,m=u.max,g=n.stepCount;return d&&(f=c.min,g=null),p&&(m=c.max,g=null),i=s({min:f,max:m,stepCount:g,offsetSize:r}),e=this._isOverflowed(a,i,u,d,p),e&&!o.isMapTypeChart(l)&&(i.limit=this._adjustLimitForOverflow(i.limit,i.step,e)),t.isDiverging&&(i.limit=this._makeLimitForDivergingOption(i.limit)),i},_isOverflowed:function(t,e,i,n,o){var r=!(!t||!t.minItem),a=!(!t||!t.maxItem),s=e.limit,h=r||!n&&s.min===i.min&&0!==s.min,l=a||!o&&s.max===i.max&&0!==s.max;return h||l?{min:h,max:l}:null},makeScaleData:function(t,e,i,n){var r,a=o.isDivergingChart(i,n.diverging),s=n.overflowItem;return o.isPercentStackChart(i,n.stackType)?r=this._calculatePercentStackedScale(t,a):o.isDatetimeType(n.type)?r=this._calculateDatetimeScale(t,e,a):(o.isRadialChart(i)&&(n.stepCount=Math.floor(e/100)),r=this._calculateCoordinateScale({baseValues:t,baseSize:e,overflowItem:s,isDiverging:a,chartType:i,options:n})),r}};t.exports=u},function(t,e,i){"use strict";function n(t){var e=0===t?1:Math.log(Math.abs(t))/Math.LN10;return Math.pow(10,Math.floor(e))}function o(t){var e,i,n,o;for(n=0,o=d.length;n1?1:1/o,a=i*r;return e=Math.ceil(e*r/a)*a/r,t=t>i?Math.floor(t*r/a)*a/r:t<0?-(Math.ceil(Math.abs(t)*r/a)*a)/r:0,{min:t,max:e}}function s(t,e){var i=1/Math.min(n(t),n(e));return Math.ceil(t*i/(e*i))}function h(t){var e=r(t.step),i=a(t.limit.min,t.limit.max,e),n=Math.abs(i.max-i.min),o=s(n,e);return{limit:{min:i.min,max:i.max},step:e,stepCount:o}}function l(t,e,i,n,o){var r,a,s=Math.abs(e-t),h=s/i;return n||(n=Math.ceil(i/p)),r=i/n,a=h*r,c.isNumber(o)&&ai.labelInterval&&(n=this._makeLabelsByIntervalOption(t.labels,i.labelInterval,t.addedDataCount)),o.isDatetimeType(i.type)&&(n=a.formatDates(n,i.dateFormat)),t.aligned||(e+=1),{labels:n,tickCount:e,validTickCount:0,isLabelAxis:!0,options:i,isVertical:!!t.isVertical,isPositionRight:!!t.isPositionRight,aligned:!!t.aligned}},makeValueAxisData:function(t){var e=t.labels,i=t.tickCount,n=t.limit,o={labels:e,tickCount:i,validTickCount:i,limit:n,dataMin:n.min,distance:n.max-n.min,step:t.step,options:t.options,isVertical:!!t.isVertical,isPositionRight:!!t.isPositionRight,aligned:!!t.aligned};return o},makeAdditionalDataForCoordinateLineType:function(t,e,i,n,o){var r,a=1,h=0,l=s.min(e),u=s.max(e);return r=u-l,r&&(i.minu&&(i.max-=n,a-=(u-i.max)/r,o-=1,t.pop())),{labels:t,tickCount:o,validTickCount:o,limit:i,dataMin:l,distance:r,positionRatio:h,sizeRatio:a}},_makeAdjustingIntervalInfo:function(t,e,i){var n,o=parseInt(e/i,10),r=parseInt(t/o,10),a=null;return r>1&&(n=t-r*o,n>=r&&(o+=parseInt(n/r,0),n%=r),a={blockCount:o,beforeRemainBlockCount:n,interval:r}),a},_makeCandidatesForAdjustingInterval:function(t,e){var i=this,n=h.range(90,121,5),o=h.map(n,function(n){return i._makeAdjustingIntervalInfo(t,e,n)});return h.filter(o,function(t){return!!t})},_calculateAdjustingIntervalInfo:function(t,e){var i=this._makeCandidatesForAdjustingInterval(t,e),n=null;return i.length&&(n=s.min(i,function(t){return t.blockCount})),n},_makeFilteredLabelsByInterval:function(t,e,i){return h.filter(t.slice(e),function(t,e){return e%i===0})},updateLabelAxisDataForAutoTickInterval:function(t,e,i,n){var o,r,a,s,l,u;n&&(t.tickCount-=1,t.labels.pop()),o=t.tickCount-1,r=this._calculateAdjustingIntervalInfo(o,e),r&&(a=r.blockCount,s=r.interval,l=r.beforeRemainBlockCount,t.eventTickCount=t.tickCount,u=Math.round(l/2)-i%s,u<0&&(u+=s),t.labels=this._makeFilteredLabelsByInterval(t.labels,u,s),h.extend(t,{startIndex:u,tickCount:a+1,positionRatio:u/o,sizeRatio:1-l/o,interval:s}))},updateLabelAxisDataForStackingDynamicData:function(t,e,i){var n,o=e.interval,r=e.startIndex,a=t.tickCount-1,s=a/o,l=i?i-1:0;l&&2*l<=s&&(o*=2),t.labels=this._makeFilteredLabelsByInterval(t.labels,r,o),s=t.labels.length-1,n=a-o*s,h.extend(t,{startIndex:r,eventTickCount:t.tickCount,tickCount:t.labels.length,positionRatio:r/a,sizeRatio:1-n/a,interval:o})},_calculateXAxisLabelAreaWidth:function(t,e,i){return t||(i-=1),e/i},_createMultilineLabel:function(t,e,i){var n=String(t).split(/\s+/),o=n[0],r=[];return h.forEachArray(n.slice(1),function(t){var n=a.getRenderedLabelWidth(o+" "+t,i);n>e?(r.push(o),o=t):o+=" "+t}),o&&r.push(o),r.join("
")},_createMultilineLabels:function(t,e,i){var n=this._createMultilineLabel;return h.map(t,function(t){return n(t,i,e)})},_calculateMultilineHeight:function(t,e,i){return a.getRenderedLabelsMaxHeight(t,h.extend({cssText:"line-height:1.2;width:"+i+"px"},e))},makeAdditionalDataForMultilineLabels:function(t,e,i,n,o){var r=o.series.width,s=this._calculateXAxisLabelAreaWidth(n,r,e),h=this._createMultilineLabels(t,i,r),l=this._calculateMultilineHeight(h,i,s),u=a.getRenderedLabelsMaxHeight(t,i);return{multilineLabels:h,overflowHeight:l-u,overflowLeft:s/2-o.yAxis.width}},_findRotationDegree:function(t,e,i){var o=null;return h.forEachArray(n.DEGREE_CANDIDATES,function(a){var s=r.calculateRotatedWidth(a,e,i);return o=a,!(s<=t+n.XAXIS_LABEL_COMPARE_MARGIN)}),o},_calculateRotatedWidth:function(t,e,i,o){var s=a.getRenderedLabelWidth(e,o),h=r.calculateRotatedWidth(t,s,i);return h-=r.calculateAdjacent(n.ANGLE_90-t,i/2)},_calculateLimitWidth:function(t,e,i){var n=t;return e&&(n+=i/2),n},makeAdditionalDataForRotatedLabels:function(t,e,i,o,s){var h,l,u,c,d,p=a.getRenderedLabelsMaxWidth(t,i),f=s.series.width,m=this._calculateXAxisLabelAreaWidth(o,f,e),g=null,_=n.CHART_PADDING+s.yAxis.width+f;return m1,i.tooltip=i.tooltip||{},i.tooltip.grouped=!0,n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0,isVertical:!0})},_makeYAxisOptions:function(t,e){var i={};return e=e||{},s.forEachArray(t,function(t,n){i[t]=e[n]||e}),i},onChangeCheckedLegends:function(t){var e=this.dataProcessor.getOriginalRawData(),i=o.filterCheckedRawData(e,t),n=a({rawSeriesData:i.series,yAxisOptions:this.options.yAxis});this.chartTypes=n.chartTypes,this.seriesTypes=n.seriesTypes,this.rerender(t,i,n)},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("columnSeries","columnSeries"),this.componentManager.register("lineSeries","lineSeries"),this.componentManager.register("yAxis","axis"),this.hasRightYAxis&&this.componentManager.register("rightYAxis","axis"),this.componentManager.register("xAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},getScaleOption:function(){var t={yAxis:this._makeYAxisScaleOption("yAxis",this.chartTypes[0],!this.hasRightYAxis)};return this.hasRightYAxis&&(t.rightYAxis=this._makeYAxisScaleOption("rightYAxis",this.chartTypes[1])),t},_makeYAxisScaleOption:function(t,e,i){var n=this.yAxisOptions[e],o={isSingleYAxis:!!i};return i&&this.options.series&&this._setAdditionalOptions(o),{options:n,areaType:"yAxis",chartType:e,additionalOptions:o}},_setAdditionalOptions:function(t){var e=this.dataProcessor;s.forEach(this.options.series,function(i,n){var o;i.stackType&&(o=e.findChartType(n),r.isAllowedStackOption(o)&&(t.chartType=o,t.stackType=i.stackType))})},addDataRatios:function(t){var e,i=this,n=this.chartTypes||[this.chartType],o=this.options.series||{};e=function(e){var n=(o[e]||o).stackType;i.dataProcessor.addDataRatios(t[e],n,e)},s.forEachArray(n,e)}});t.exports=h},function(t,e,i){"use strict";function n(t){var e=t.rawSeriesData,i=t.yAxisOptions,n=o(e,i);return{chartTypes:n.chartTypes,seriesTypes:n.seriesTypes}}function o(t,e){var i,n=a.keys(t).sort(),o=r(n,e),s=o.length?o:n,h=a.filter(o,function(e){return t[e].length});return i=1===h.length?{chartTypes:h,seriesTypes:h}:{chartTypes:s,seriesTypes:n}}function r(t,e){var i,n=t.slice(),o=[].concat(e||[]),r=!1;return!o.length||1===o.length&&!o[0].chartType?n=[]:o.length&&(i=a.map(o,function(t){return t.chartType}),a.forEachArray(i,function(t,e){r=r||t&&n[e]!==t||!1}),r&&n.reverse()),n}var a=i(6);t.exports=n},function(t,e,i){"use strict";var n=i(42),o=i(6),r=o.defineClass(n,{init:function(t,e,i){this.chartTypes=["line","scatter"],this.seriesTypes=["line","scatter"],n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0,isVertical:!0})},getScaleOption:function(){return{yAxis:{valueType:"y"},xAxis:{valueType:"x"}}},addDataRatios:function(t){var e,i=this,n=this.chartTypes||[this.chartType];e=function(e){i.dataProcessor.addDataRatiosForCoordinateType(e,t,!1)},o.forEachArray(n,e)},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("lineSeries","lineSeries"),this.componentManager.register("scatterSeries","scatterSeries"),this.componentManager.register("yAxis","axis"),this.componentManager.register("xAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")}});t.exports=r},function(t,e,i){"use strict";var n=i(42),o=i(31),r=i(11),a=i(129),s=i(126),h=i(6),l=h.defineClass(n,{className:"tui-combo-chart",init:function(t,e,i){var o=a({rawSeriesData:t.series,yAxisOptions:i.yAxis});this.chartTypes=o.chartTypes,this.seriesTypes=o.seriesTypes,this.yAxisOptions=this._makeYAxisOptions(this.chartTypes,i.yAxis),this.hasRightYAxis=h.isArray(i.yAxis)&&i.yAxis.length>1,i.tooltip=i.tooltip||{},i.tooltip.grouped=!0,n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0,isVertical:!0}),this._dynamicDataHelper=new s(this)},onChangeCheckedLegends:function(t){var e=this.dataProcessor.getZoomedRawData(),i=o.filterCheckedRawData(e,t),n=a({rawSeriesData:i.series,yAxisOptions:this.options.yAxis});this._dynamicDataHelper.reset(),this._dynamicDataHelper.changeCheckedLegends(t,i,n)},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("areaSeries","areaSeries"),this.componentManager.register("lineSeries","lineSeries"),this.componentManager.register("xAxis","axis"),this.componentManager.register("yAxis","axis"),this.hasRightYAxis&&this.componentManager.register("rightYAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},getScaleOption:function(){var t={yAxis:this._makeYAxisScaleOption("yAxis",this.chartTypes[0],!this.hasRightYAxis)};return this.hasRightYAxis&&(t.rightYAxis=this._makeYAxisScaleOption("rightYAxis",this.chartTypes[1])),t},_makeYAxisScaleOption:function(t,e,i){var n=this.yAxisOptions[e],o={isSingleYAxis:!!i};return i&&this.options.series&&this._setAdditionalOptions(o),{options:n,areaType:"yAxis",chartType:e,additionalOptions:o}},_makeYAxisOptions:function(t,e){var i={};return e=e||{},h.forEachArray(t,function(t,n){i[t]=e[n]||e}),i},addData:function(t,e){this._dynamicDataHelper.addData(t,e)},_setAdditionalOptions:function(t){var e=this.dataProcessor;h.forEach(this.options.series,function(i,n){var o;i.stackType&&(o=e.findChartType(n),r.isAllowedStackOption(o)&&(t.chartType=o,t.stackType=i.stackType))})},addDataRatios:function(t){var e,i=this,n=this.chartTypes||[this.chartType],o=this.options.series||{};e=this.dataProcessor.isCoordinateType()?function(e){i.dataProcessor.addDataRatiosForCoordinateType(e,t,!1)}:function(e){var n=(o[e]||o).stackType;i.dataProcessor.addDataRatios(t[e],n,e)},h.forEachArray(n,e)},_renderForZoom:function(t){var e=this.readyForRender();this.componentManager.render("zoom",e,{isResetZoom:t})},onZoom:function(t){this._dynamicDataHelper.pauseAnimation(),this.dataProcessor.updateRawDataForZoom(t),this._renderForZoom(!1)},onResetZoom:function(){var t=this.dataProcessor.getOriginalRawData();this._dynamicDataHelper.checkedLegends&&(t=o.filterCheckedRawData(t,this._dynamicDataHelper.checkedLegends)),this.dataProcessor.initData(t),this.dataProcessor.initZoomedRawData(),this.dataProcessor.addDataFromRemainDynamicData(h.pick(this.options.series,"shifting")),this._renderForZoom(!0),this._dynamicDataHelper.restartAnimation()}});t.exports=l},function(t,e,i){"use strict";var n=i(42),o=i(31),r=i(6),a=r.defineClass(n,{className:"tui-combo-chart",init:function(t,e,i){this.seriesTypes=r.keys(t.series).sort(),this.chartTypes=["pie","pie"],n.call(this,{rawData:t,theme:e,options:i,isVertical:!0})},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("legend","legend"),this.componentManager.register("pie1Series","pieSeries"),this.componentManager.register("pie2Series","pieSeries"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},addDataRatios:function(){var t=this,e=this.seriesTypes||[this.chartType];r.forEachArray(e,function(e){t.dataProcessor.addDataRatiosOfPieChart(e)})},onChangeCheckedLegends:function(t){var e=this.dataProcessor.getOriginalRawData(),i=o.filterCheckedRawData(e,t);n.prototype.onChangeCheckedLegends.call(this,t,i,{seriesTypes:this.seriesTypes})}});t.exports=a},function(t,e,i){"use strict";var n=i(42),o=i(8),r=i(6),a=r.defineClass(n,{className:"tui-pie-chart",init:function(t,e,i){i.tooltip=i.tooltip||{},i.tooltip.align||(i.tooltip.align=o.TOOLTIP_DEFAULT_ALIGN_OPTION),n.call(this,{rawData:t,theme:e,options:i})},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("legend","legend"),this.componentManager.register("pieSeries","pieSeries"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},addDataRatios:function(){this.dataProcessor.addDataRatiosOfPieChart(this.chartType)}});t.exports=a},function(t,e,i){"use strict";var n=i(42),o=i(8),r=i(6),a=r.defineClass(n,{className:"tui-bubble-chart",init:function(t,e,i){i.tooltip=i.tooltip||{},i.circleLegend=i.circleLegend||{},i.tooltip.align||(i.tooltip.align=o.TOOLTIP_DEFAULT_ALIGN_OPTION),r.isUndefined(i.circleLegend.visible)&&(i.circleLegend.visible=!0),n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0})},getScaleOption:function(){var t={};return this.dataProcessor.hasXValue(this.chartType)&&(t.xAxis={valueType:"x"}),this.dataProcessor.hasYValue(this.chartType)&&(t.yAxis={valueType:"y"}),t},_setDefaultOptions:function(t){n.prototype._setDefaultOptions.call(this,t),this.options.circleLegend=this.options.circleLegend||{},r.isUndefined(this.options.circleLegend.visible)&&(this.options.circleLegend.visible=!0)},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("circleLegend","circleLegend"),this.componentManager.register("bubbleSeries","bubbleSeries"),this.componentManager.register("yAxis","axis"),this.componentManager.register("xAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},addDataRatios:function(t){this.dataProcessor.addDataRatiosForCoordinateType(this.chartType,t,!0)}});t.exports=a},function(t,e,i){"use strict";var n=i(42),o=i(8),r=i(6),a=r.defineClass(n,{className:"tui-scatter-chart",init:function(t,e,i){i.tooltip=i.tooltip||{},i.tooltip.align||(i.tooltip.align=o.TOOLTIP_DEFAULT_ALIGN_OPTION),n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0})},getScaleOption:function(){return{xAxis:{valueType:"x"},yAxis:{valueType:"y"}}},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("scatterSeries","scatterSeries"),this.componentManager.register("yAxis","axis"),this.componentManager.register("xAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},addDataRatios:function(t){this.dataProcessor.addDataRatiosForCoordinateType(this.chartType,t,!1)}});t.exports=a},function(t,e,i){"use strict";var n=i(42),o=i(137),r=i(8),a=i(6),s=a.defineClass(n,{className:"tui-heatmap-chart",init:function(t,e,i){i.tooltip=i.tooltip||{},i.tooltip.align||(i.tooltip.align=r.TOOLTIP_DEFAULT_ALIGN_OPTION),i.tooltip.grouped=!1,n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0,isVertical:!0})},_addComponents:function(){var t=this.theme.series[this.chartType],e=new o(t.startColor,t.endColor);this._addComponentsForAxisType({axis:[{name:"yAxis",isVertical:!0},{name:"xAxis"}],legend:{classType:"spectrumLegend",additionalParams:{colorSpectrum:e}},series:[{name:"heatmapSeries",data:{colorSpectrum:e}}],tooltip:!0,mouseEventDetector:!0})},getScaleOption:function(){return{legend:!0}},addDataRatios:function(t){this.dataProcessor.addDataRatios(t.legend,null,this.chartType)},addComponents:function(){var t=this.theme.series[this.chartType],e=new o(t.startColor,t.endColor);this.componentManager.register("title","title"),this.componentManager.register("legend","spectrumLegend",{colorSpectrum:e}),this.componentManager.register("heatmapSeries","heatmapSeries",{colorSpectrum:e}),this.componentManager.register("xAxis","axis"),this.componentManager.register("yAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")}});t.exports=s},function(t,e,i){"use strict";var n=i(138),o=i(6),r=o.defineClass({init:function(t,e){var i;this.start=n.colorNameToHex(t),this.startRGB=n.hexToRGB(this.start),this.end=n.colorNameToHex(e),i=n.hexToRGB(this.end),this.distances=this._makeDistances(this.startRGB,i),this.colorMap={}},_makeDistances:function(t,e){return o.map(t,function(t,i){return e[i]-t})},getColor:function(t){var e,i,r=this.colorMap[t];return r||(e=this.distances,i=o.map(this.startRGB,function(i,n){return i+parseInt(e[n]*t,10)}),r=n.rgbToHEX.apply(null,i)),r||null}});t.exports=r},function(t,e){"use strict";var i=/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i,n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},o={leadingZero:function(t,e){var i="",n=0;if(String(t).length>e)return String(t);for(;n=0&&(a.ratio=r),a})},getMapData:function(){return this.mapData||(this.mapData=this._createMapData(this.rawMapData)),this.mapData},getDatum:function(t){return this.getMapData()[t]},getLabelData:function(t){var e=this,i=this.getMapData(),n=r.filter(i,function(t){return e.dataProcessor.getValueMapDatum(t.code)});return r.map(n,function(e){return{name:e.name,labelPosition:{left:e.labelPosition.left*t,top:e.labelPosition.top*t}}})},_makeMapDimension:function(){var t=this.getMapData(),e=r.map(t,function(t){return t.bound.position.left}),i=r.map(t,function(t){return t.bound.position.left+t.bound.dimension.width}),n=r.map(t,function(t){return t.bound.position.top}),a=r.map(t,function(t){return t.bound.position.top+t.bound.dimension.height});return{width:o.max(i)-o.min(e),height:o.max(a)-o.min(n)}},getMapDimension:function(){return this.mapDimension||(this.mapDimension=this._makeMapDimension()),this.mapDimension}});t.exports=a},function(t,e,i){"use strict";var n=i(102),o=i(7),r=i(6),a=r.defineClass(n,{init:function(t,e,i){this.rawData=t,this.options=i},initData:function(t){this.rawData=t,this.valueMap=null},_makeValueMap:function(){var t=this.rawData.series.map,e={},i=this._findFormatFunctions();return r.forEachArray(t,function(t){var n={value:t.data,label:o.formatValue({value:t.data,formatFunctions:i,chartType:"map",areaType:"series"})};t.name&&(n.name=t.name),t.labelCoordinate&&(n.labelCoordinate=t.labelCoordinate),e[t.code]=n}),e},getValueMap:function(){return this.valueMap||(this.valueMap=this._makeValueMap()),this.valueMap},getValues:function(){return r.pluck(this.getValueMap(),"value")},getValueMapDatum:function(t){return this.getValueMap()[t]},addDataRatios:function(t){var e=t.min,i=t.max-e;r.forEach(this.getValueMap(),function(t){t.ratio=(t.value-e)/i})},createBaseValuesForLimit:function(){return this.getValues()},getLegendVisibility:function(){return null}});t.exports=a},function(t,e,i){"use strict";var n=i(42),o=i(6),r=i(85),a=o.defineClass(n,{className:"tui-radial-chart",Series:r,init:function(t,e,i){i.tooltip&&(i.tooltip.grouped=!1),n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0,isVertical:!0})},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("legend","legend"),this.componentManager.register("plot","radialPlot"),this.componentManager.register("radialSeries","radialSeries"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},addDataRatios:function(t){this.dataProcessor.addDataRatios(t[this.chartType],null,this.chartType)},getScaleOption:function(){return{yAxis:{}}}});t.exports=a},function(t,e,i){"use strict";var n=i(42),o=i(31),r=i(6),a=r.defineClass(n,{className:"tui-boxplot-chart",init:function(t,e,i){o.appendOutliersToSeriesData(t),n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0,isVertical:!0})},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("boxplotSeries","boxplotSeries"),this.componentManager.register("yAxis","axis"),this.componentManager.register("xAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu"),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},getScaleOption:function(){return{yAxis:!0}},onChangeCheckedLegends:function(t){var e;this.hasRightYAxis&&(e={optionChartTypes:["boxplot","boxplot"]}),n.prototype.onChangeCheckedLegends.call(this,t,null,e)},addDataRatios:function(t){var e=this.options.series||{},i=this.chartType,n=(e[i]||e).stackType;this.dataProcessor.addDataRatios(t[i],n,i)}});t.exports=a},function(t,e,i){"use strict";var n=i(42),o=i(31),r=i(6),a=r.defineClass(n,{className:"tui-bullet-chart",init:function(t,e,i){var r=!!i.series.vertical;o._makeRawSeriesDataForBulletChart(t),n.call(this,{rawData:t,theme:e,options:i,hasAxes:!0,isVertical:r})},addComponents:function(){this.componentManager.register("title","title"),this.componentManager.register("plot","plot"),this.componentManager.register("legend","legend"),this.componentManager.register("bulletSeries","bulletSeries"),this.componentManager.register("yAxis","axis"),this.componentManager.register("xAxis","axis"),this.componentManager.register("chartExportMenu","chartExportMenu",{chartType:"bullet"}),this.componentManager.register("tooltip","tooltip"),this.componentManager.register("mouseEventDetector","mouseEventDetector")},getScaleOption:function(){return this.isVertical?{yAxis:!0}:{xAxis:!0}},addDataRatios:function(t){var e=this.chartType;this.dataProcessor.addDataRatios(t[e],null,e)}});t.exports=a},function(t,e,i){"use strict";var n=i(8),o=i(33),r=i(34);o.register(n.DEFAULT_THEME_NAME,r); +},function(t,e){}])}); \ No newline at end of file From 8be6e73028d8abef41104da3b96da363c19c9cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EC=A7=84=EC=9A=B0?= Date: Tue, 13 Mar 2018 14:23:52 +0900 Subject: [PATCH 13/13] chore: update package-lock.json --- package-lock.json | 125 +++++++++++++++++++++++----------------------- 1 file changed, 63 insertions(+), 62 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5310d10d3..680bbf2cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -694,7 +694,7 @@ "dev": true, "requires": { "caniuse-db": "1.0.30000813", - "electron-to-chromium": "1.3.36" + "electron-to-chromium": "1.3.37" } }, "buffer": { @@ -742,13 +742,13 @@ "chownr": "1.0.1", "glob": "7.1.2", "graceful-fs": "4.1.11", - "lru-cache": "4.1.1", + "lru-cache": "4.1.2", "mississippi": "2.0.0", "mkdirp": "0.5.1", "move-concurrently": "1.0.1", "promise-inflight": "1.0.1", "rimraf": "2.6.2", - "ssri": "5.2.4", + "ssri": "5.3.0", "unique-filename": "1.1.0", "y18n": "4.0.0" } @@ -1287,9 +1287,9 @@ } }, "copy-webpack-plugin": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-4.5.0.tgz", - "integrity": "sha512-ROQ85fWKuhJfUkBTdHvfV+Zv6Ltm3G/vPVFdLPFwzWzd9RUY1yLw3rt6FmKK2PaeNQCNvmwgFhuarkjuV4PVDQ==", + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-4.5.1.tgz", + "integrity": "sha512-OlTo6DYg0XfTKOF8eLf79wcHm4Ut10xU2cRBRPMW/NA5F9VMjZGTfRHWDIYC3s+1kObGYrBLshXWU1K0hILkNQ==", "dev": true, "requires": { "cacache": "10.0.4", @@ -1438,7 +1438,7 @@ "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, "requires": { - "lru-cache": "4.1.1", + "lru-cache": "4.1.2", "shebang-command": "1.2.0", "which": "1.3.0" } @@ -1857,9 +1857,9 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.36", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.36.tgz", - "integrity": "sha1-Dqv3Gp6+qQE/scw1o5DgaGJPJ+g=", + "version": "1.3.37", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.37.tgz", + "integrity": "sha1-SpJzTgBEyM8LFVO+V+riGkxuX6s=", "dev": true }, "emojis-list": { @@ -2279,6 +2279,9 @@ "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", "dev": true }, + "eve": { + "version": "git://github.com/adobe-webplatform/eve.git#eef80ed8d188423c2272746fb8ae5cc8dad84cb1" + }, "eventemitter3": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz", @@ -2363,9 +2366,9 @@ } }, "express": { - "version": "4.16.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.16.2.tgz", - "integrity": "sha1-41xt/i1kt9ygpc1PIXgb4ymeB2w=", + "version": "4.16.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", + "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", "dev": true, "requires": { "accepts": "1.3.5", @@ -2380,7 +2383,7 @@ "encodeurl": "1.0.2", "escape-html": "1.0.3", "etag": "1.8.1", - "finalhandler": "1.1.0", + "finalhandler": "1.1.1", "fresh": "0.5.2", "merge-descriptors": "1.0.1", "methods": "1.1.2", @@ -2391,10 +2394,10 @@ "qs": "6.5.1", "range-parser": "1.2.0", "safe-buffer": "5.1.1", - "send": "0.16.1", - "serve-static": "1.13.1", + "send": "0.16.2", + "serve-static": "1.13.2", "setprototypeof": "1.1.0", - "statuses": "1.3.1", + "statuses": "1.4.0", "type-is": "1.6.16", "utils-merge": "1.0.1", "vary": "1.1.2" @@ -2419,6 +2422,21 @@ "ms": "2.0.0" } }, + "finalhandler": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "statuses": "1.4.0", + "unpipe": "1.0.0" + } + }, "negotiator": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", @@ -2430,12 +2448,6 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", "dev": true - }, - "statuses": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", - "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", - "dev": true } } }, @@ -4489,7 +4501,7 @@ "dev": true, "requires": { "convert-source-map": "1.5.1", - "istanbul-lib-instrument": "1.9.2", + "istanbul-lib-instrument": "1.10.1", "loader-utils": "0.2.17", "object-assign": "4.1.1" }, @@ -4509,15 +4521,15 @@ } }, "istanbul-lib-coverage": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.2.tgz", - "integrity": "sha512-tZYA0v5A7qBSsOzcebJJ/z3lk3oSzH62puG78DbBA1+zupipX2CakDyiPV3pOb8He+jBwVimuwB0dTnh38hX0w==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.0.tgz", + "integrity": "sha512-GvgM/uXRwm+gLlvkWHTjDAvwynZkL9ns15calTrmhGgowlwJBbWMYzWbKqE2DT6JDP1AFXKa+Zi0EkqNCUqY0A==", "dev": true }, "istanbul-lib-instrument": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.2.tgz", - "integrity": "sha512-nz8t4HQ2206a/3AXi+NHFWEa844DMpPsgbcUteJbt1j8LX1xg56H9rOMnhvcvVvPbW60qAIyrSk44H8ZDqaSSA==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.10.1.tgz", + "integrity": "sha512-1dYuzkOCbuR5GRJqySuZdsmsNKPL3PTuyPevQfoCXJePT9C8y1ga75neU+Tuy9+yS3G/dgx8wgOmp2KLpgdoeQ==", "dev": true, "requires": { "babel-generator": "6.26.1", @@ -4525,7 +4537,7 @@ "babel-traverse": "6.26.0", "babel-types": "6.26.0", "babylon": "6.18.0", - "istanbul-lib-coverage": "1.1.2", + "istanbul-lib-coverage": "1.2.0", "semver": "5.5.0" } }, @@ -5114,7 +5126,7 @@ "requires": { "assert-plus": "0.2.0", "jsprim": "1.4.1", - "sshpk": "1.13.1" + "sshpk": "1.14.1" } }, "oauth-sign": { @@ -5554,9 +5566,9 @@ } }, "lru-cache": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", - "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.2.tgz", + "integrity": "sha512-wgeVXhrDwAWnIF/yZARsFnMBtdFXOg1b8RIrhilp+0iDYN4mdQcNZElDZ0e4B64BhaxeQ5zN7PMyvu7we1kPeQ==", "dev": true, "requires": { "pseudomap": "1.0.2", @@ -7063,11 +7075,6 @@ "version": "git+https://github.com/nhnent/raphael.git#78a6ed3ec269f33b6457b0ec66f8c3d1f2ed70e0", "requires": { "eve": "git://github.com/adobe-webplatform/eve.git#eef80ed8d188423c2272746fb8ae5cc8dad84cb1" - }, - "dependencies": { - "eve": { - "version": "git://github.com/adobe-webplatform/eve.git#eef80ed8d188423c2272746fb8ae5cc8dad84cb1" - } } }, "raw-body": { @@ -7488,9 +7495,9 @@ "dev": true }, "send": { - "version": "0.16.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.16.1.tgz", - "integrity": "sha512-ElCLJdJIKPk6ux/Hocwhk7NFHpI3pVm/IZOYWqUmoxcgeyM+MpxHHKhb8QmlJDX1pU6WrgaHBkVNm73Sv7uc2A==", + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", "dev": true, "requires": { "debug": "2.6.9", @@ -7505,7 +7512,7 @@ "ms": "2.0.0", "on-finished": "2.3.0", "range-parser": "1.2.0", - "statuses": "1.3.1" + "statuses": "1.4.0" }, "dependencies": { "debug": { @@ -7522,12 +7529,6 @@ "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==", "dev": true - }, - "statuses": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", - "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", - "dev": true } } }, @@ -7580,15 +7581,15 @@ } }, "serve-static": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.1.tgz", - "integrity": "sha512-hSMUZrsPa/I09VYFJwa627JJkNs0NrfL1Uzuup+GqHfToR2KcsXFymXSV90hoyw3M+msjFuQly+YzIH/q0MGlQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", "dev": true, "requires": { "encodeurl": "1.0.2", "escape-html": "1.0.3", "parseurl": "1.3.2", - "send": "0.16.1" + "send": "0.16.2" } }, "set-immediate-shim": { @@ -7947,9 +7948,9 @@ "dev": true }, "sshpk": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", - "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", + "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", "dev": true, "optional": true, "requires": { @@ -7980,9 +7981,9 @@ } }, "ssri": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.2.4.tgz", - "integrity": "sha512-UnEAgMZa15973iH7cUi0AHjJn1ACDIkaMyZILoqwN6yzt+4P81I8tBc5Hl+qwi5auMplZtPQsHrPBR5vJLcQtQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz", + "integrity": "sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==", "dev": true, "requires": { "safe-buffer": "5.1.1" @@ -8546,7 +8547,7 @@ "integrity": "sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw==", "dev": true, "requires": { - "lru-cache": "4.1.1", + "lru-cache": "4.1.2", "tmp": "0.0.33" } }, @@ -8827,7 +8828,7 @@ "requires": { "compression": "1.7.2", "connect-history-api-fallback": "1.5.0", - "express": "4.16.2", + "express": "4.16.3", "http-proxy-middleware": "0.17.4", "open": "0.0.5", "optimist": "0.6.1",