aboutsummaryrefslogtreecommitdiffstats
path: root/umc-iui/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'umc-iui/src/main')
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/createtestdata.html618
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/css/itm.css342
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/css/vnf.css916
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/i18n/ngict-umc-monitor-i18n-en-US.properties24
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/i18n/ngict-umc-monitor-i18n-zh-CN.properties24
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/images/aos_view-fm.gifbin205 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/images/arrow.pngbin3075 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/images/details_close.pngbin3306 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/images/details_open1.pngbin3304 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/images/down.pngbin2938 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/images/filter.pngbin6756 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/images/up.pngbin2926 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/index.html26
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/js/Constants.js26
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/js/avalon.modern.js4455
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/js/commonUtil.js52
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/js/d3.js9253
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/js/echarts-all.js40
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/js/jquery-1.10.2.min.js19
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/js/mockdataController.js587
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/js/monitorHeadChart.js94
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/js/monitors.js494
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/js/vnfController.js607
-rw-r--r--umc-iui/src/main/resources/webroot/umc-drill/monitorns.html613
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/css/alarmsQuery.css735
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/css/delete.me0
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/html/fm_currentAlarm_view.html364
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/i18n/delete.me0
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/i18n/ngict-curalarms-iui-i18n-en-US.properties108
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/i18n/ngict-curalarms-iui-i18n-zh-CN.properties98
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/images/Thumbs.dbbin20992 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/images/aos_view-fm.gifbin205 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/images/arrow.pngbin5680 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/images/details_close.pngbin3300 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/images/details_open.pngbin3304 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/images/down.pngbin2938 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/images/filter.pngbin7780 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/images/statistics.pngbin25116 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/images/up.pngbin2926 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/js/CommonUtil.js42
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/js/alarmConds.js261
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/js/alarmsServerPageTable.js514
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/js/alarmsUtil.js1154
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/js/avalon.modern.js4935
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/js/curAlarmsController.js475
-rw-r--r--umc-iui/src/main/resources/webroot/umc-fm/js/delete.me0
-rw-r--r--umc-iui/src/main/resources/webroot/umc-monitor/css/dac.css220
-rw-r--r--umc-iui/src/main/resources/webroot/umc-monitor/css/dataTables.bootstrap.css331
-rw-r--r--umc-iui/src/main/resources/webroot/umc-monitor/css/monitorSetting.css167
-rw-r--r--umc-iui/src/main/resources/webroot/umc-monitor/dacList.html253
-rw-r--r--umc-iui/src/main/resources/webroot/umc-monitor/i18n/loadi18nApp_ngict-umc-monitor.js42
-rw-r--r--umc-iui/src/main/resources/webroot/umc-monitor/i18n/umc-monitor-iui-i18n-en-US.properties103
-rw-r--r--umc-iui/src/main/resources/webroot/umc-monitor/i18n/umc-monitor-iui-i18n-zh-CN.properties103
-rw-r--r--umc-iui/src/main/resources/webroot/umc-monitor/images/throbber.gifbin9257 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-monitor/js/dacController.js275
-rw-r--r--umc-iui/src/main/resources/webroot/umc-monitor/js/monitorSettingController.js435
-rw-r--r--umc-iui/src/main/resources/webroot/umc-monitor/js/monitorSettingUtil.js169
-rw-r--r--umc-iui/src/main/resources/webroot/umc-monitor/monitorSetting.html487
-rw-r--r--umc-iui/src/main/resources/webroot/umc-monitor/monitorSettingList.html126
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/css/delete.me0
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/css/meataskQuery.css872
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/css/performanceChart.css45
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/css/pmQueryBox.css299
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/html/index/indexManage.html163
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/html/index/indexView.html74
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/html/meatask/meataskQueryRule.html184
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/html/meatask/meataskQueryView.html151
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/html/meataskQueryView.html149
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/i18n/delete.me0
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/i18n/ngict-pm-iui-i18n-en-US.properties130
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/i18n/ngict-pm-iui-i18n-zh-CN.properties131
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/images/aos_view-fm.gifbin205 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/images/arrow.pngbin5680 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/images/chart.pngbin1727 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/images/delete.pngbin3029 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/images/details_close.pngbin3300 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/images/details_open.pngbin3304 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/images/down.pngbin2938 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/images/filter.pngbin7780 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/images/statistics.pngbin25116 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/images/table.pngbin1668 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/images/up.pngbin2926 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/js/avalon.js5875
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/js/commonUtil.js69
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/js/dataRangeUtil.js354
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/js/delete.me0
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/js/i18n/loadi18n.js23
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/js/index/indexController.js228
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/js/index/indexManage.js187
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/js/meatask/echarts.js54502
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/js/meatask/meataskQueryController.js843
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/js/meatask/performanceChart.js181
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/js/pmUtil.js458
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/json/counters.json25
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/json/index.json18
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/json/indexes.json50
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/json/meatask/meatasks_content.json97
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/json/meatask/moType.json25
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/json/meatask/moType1.json9
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/json/meatask/resourceType.json29
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/json/meatask/resources.json115
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/json/meatask/resources1.json35
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/json/meatask/resources2.json30
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/json/meatasks.json97
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/json/meatasks_content.json94
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/json/resourceType.json8
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/json/test.json152
-rw-r--r--umc-iui/src/main/resources/webroot/umc-pm/json/thresholdList.json116
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/css/main.css161
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/NS.pngbin22438 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/NS1.pngbin23065 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/VDU.pngbin21080 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/VDU1.pngbin21168 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/VNF.pngbin22868 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/VNF1.pngbin23757 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/VNFC.pngbin20496 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/VNFC1 .pngbin21207 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/off/Bridge.gifbin426 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/off/Computer.gifbin328 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/off/Hub.gifbin441 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/off/InternetServer.gifbin1106 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/off/MiniComputer.gifbin600 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/off/Multiplexer.gifbin571 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/off/Router.gifbin631 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/off/Server.gifbin523 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/off/Switch.gifbin1052 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/off/TerminalServer.gifbin455 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/off/vim.pngbin2990 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/Bridge.gifbin443 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/BridgeMinus.gifbin476 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/BridgePlus.gifbin491 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/Computer.pngbin14541 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/ComputerMinusbak.gifbin507 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/ComputerPlusbak.gifbin520 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/Computerbak.gifbin1180 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/Hub.gifbin5813 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/HubPlus.gifbin805 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/InternetServer.gifbin1103 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/MiniComputer.gifbin710 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/Multiplexer.gifbin594 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/Router.gifbin672 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/Server.gifbin519 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/Switch.gifbin1818 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/TerminalServer.gifbin489 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/hostMinus.pngbin11968 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/hostPlus.pngbin12005 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/vdu.pngbin8569 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/vimMinus.pngbin20055 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/vimMinusbak.pngbin3109 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/vimPlus.pngbin20150 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/on/vimPlusbak.pngbin3157 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/images/vim.pngbin27134 -> 0 bytes
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/js/physicalTopology.js356
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/js/serviceTopology.js503
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/js/topoDialog.js165
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/js/topoTool.js344
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/physicalTopology.html24
-rw-r--r--umc-iui/src/main/resources/webroot/umc-topo/serviceTopology.html24
158 files changed, 0 insertions, 96982 deletions
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/createtestdata.html b/umc-iui/src/main/resources/webroot/umc-drill/createtestdata.html
deleted file mode 100644
index 384d96f9..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/createtestdata.html
+++ /dev/null
@@ -1,618 +0,0 @@
-<!--
-
- Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<!DOCTYPE html>
-<html>
-<head>
- <title>模拟分层钻取相关结点</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <link rel="stylesheet" type="text/css" href="../component/thirdparty/font-awesome/css/font-awesome.min.css" id="font_awesome"/>
- <link rel="stylesheet" type="text/css" href="../component/thirdparty/bootstrap/css/bootstrap.min.css" />
- <link rel="stylesheet" type="text/css" href="../component/thirdparty/uniform/css/uniform.default.css" />
-</head>
-<body>
-
- <ul id="myTab" class="nav nav-tabs">
- <li class="active navbar-header"><a class="navbar-brand" href="#home" data-toggle="tab">Data Maker</a></li>
- <li><a href="#hostpanel" data-toggle="tab" onclick="updateSelectForAddHOST()">增加Host</a></li>
- <li><a href="#vnfpanel" data-toggle="tab" onclick="updateSelectForAddVNF()">增加VNF</a></li>
- <li><a href="#vdupanel" data-toggle="tab" onclick="updateSelectForAddVDU()">增加VDU</a></li>
- <li><a href="#vnfcpanel" data-toggle="tab" onclick="updateSelectForAddVNFC()">增加VNFC</a></li>
- <li><a href="#nspanel" data-toggle="tab" onclick="updateSelectForAddNS()">编排NS</a></li>
- <!--
- <li class="dropdown"><a href="#" id="myTabDrop1"
- class="dropdown-toggle" data-toggle="dropdown">Java <b
- class="caret"></b>
- </a>
- <ul class="dropdown-menu" role="menu" aria-labelledby="myTabDrop1">
- <li><a href="#jmeter" tabindex="-1" data-toggle="tab">jmeter</a></li>
- <li><a href="#ejb" tabindex="-1" data-toggle="tab">ejb</a></li>
- </ul></li>
- -->
- </ul>
-
- <div id="bodyContent" class="tab-content"
- ms-controller="mockdataController">
-
- <div class="alert alert-info" ms-visible="server_rtn.info_block"
- ms-html="server_rtn.info_text"></div>
- <div class="alert alert-danger "
- ms-visible="server_rtn.warning_block"
- ms-html="server_rtn.warning_text"></div>
-
- <div id="myTabContent" class="tab-content">
- <div class="tab-pane fade in active" id="home">
- <h4 id="notes">
- 功能介绍:<br><br>
- 主要用于模拟分层钻取相关的各层数据!
- <br>
- <br>
- 建议创建顺序为:VNFM->VIM->Host->VNF->VDU->VNFC->NS,其中VNFM和VIM要首先创建!
- </h4>
- </div>
-
- <div class="tab-pane fade" id="hostpanel">
- <div class="modal-header">
- <h4 id="addVNFLabel" ms-text="$addHOSTtitleName"></h4>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>名称</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="HOSTInfo.name" name="name"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>moc</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="HOSTInfo.moc" name="moc"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>IP地址</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="HOSTInfo.ipAddress" name="ipAddress"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>user</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="HOSTInfo.user" name="user"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>password</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="HOSTInfo.password" name="password"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>protocol</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="HOSTInfo.protocol" name="protocol"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>port</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="HOSTInfo.port" name="port"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>所属VIM</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <select id="host-vimSelect" ms-duplex="HOSTInfo.vimId">
- <option ms-repeat="vimList" ms-attr-value="el.oid">{{el.name}}</option>
- </select> <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>type</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="HOSTInfo.type" name="type"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>version</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="HOSTInfo.version" name="version"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>vendor</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="HOSTInfo.vendor" name="vendor"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <button class="btn btn-primary" type="button" ms-click="$addHost()">保存</button>
- <input class="btn btn-primary" type="button" ms-attr-title="$mockAlarmTooltip" ms-duplex="HOSTInfo.alarmbtnvalue" ms-attr-disabled="HOSTInfo.alarmbtndisabled" ms-click="$raiseAlarm(HOSTInfo.oid,HOSTInfo.name)"/>
- <h4 ms-html="$mockAlarmRemark"></h4>
- </div>
-
-
-
- <div class="tab-pane fade" id="vnfpanel">
- <div class="modal-header">
- <h4 id="addVNFLabel" ms-text="$addVNFtitleName"></h4>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>名称</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VNFInfo.name" name="name"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>vnfd名称</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VNFInfo.vnfd" name="vnfd"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>状态</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VNFInfo.status" name="status"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>所属VNFM</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <select id="vnf-vnfmSelect" ms-duplex="VNFInfo.vnfmid">
- <option ms-repeat="vnfmList" ms-attr-value="el.oid">{{el.name}}</option>
- </select> <span class="help-block"></span>
- </div>
-
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>所属VIM</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <select id="vnf-vimSelect" ms-duplex="VNFInfo.vimId">
- <option ms-repeat="vimList" ms-attr-value="el.oid">{{el.name}}</option>
- </select> <span class="help-block"></span>
- </div>
-
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>moc</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VNFInfo.moc" name="moc"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>localization</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VNFInfo.localization" name="localization"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>flavourId</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VNFInfo.flavourId" name="flavourId"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>type</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VNFInfo.type" name="type"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>version</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VNFInfo.version" name="version"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>vendor</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VNFInfo.vendor" name="vendor"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <button class="btn btn-primary" type="button" ms-click="$addVNF()">保存</button>
- <input class="btn btn-primary" type="button" ms-attr-title="$mockAlarmTooltip" ms-duplex="VNFInfo.alarmbtnvalue" ms-attr-disabled="VNFInfo.alarmbtndisabled" ms-click="$raiseAlarm(VNFInfo.oid,VNFInfo.name)"/>
- <h4 ms-html="$mockAlarmRemark"></h4>
- </div>
-
-
- <div class="tab-pane fade" id="vdupanel">
- <div class="modal-header">
- <h4 id="addVDULabel" ms-text="$addVDUtitleName"></h4>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>名称</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VDUInfo.name" name="name"
- class="form-control" /> <span class="help-block"></span>
- </div>
-
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>vdu镜像</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VDUInfo.vduImage"
- placeholder="参考格式:http://xx.xx.xx.xx:5000/v2.0" name="vduImage"
- class="form-control" /> <span class="help-block"></span>
- </div>
-
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>IP地址</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VDUInfo.ipAddress" name="ipAddress"
- class="form-control" /> <span class="help-block"></span>
- </div>
-
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>所属VNF</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <select id="vdu-vnfSelect" ms-duplex="VDUInfo.vnfId">
- <option ms-repeat="vnfList" ms-attr-value="el.oid">{{el.name}}</option>
- </select> <span class="help-block"></span>
- </div>
-
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>所属VIM</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <select id="vdu-vimSelect" ms-duplex="VDUInfo.vimId">
- <option ms-repeat="vimList" ms-attr-value="el.oid">{{el.name}}</option>
- </select> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>所属Host</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <select id="vdu-hostSelect" ms-duplex="VDUInfo.hostId">
- <option ms-repeat="hostList" ms-attr-value="el.oid">{{el.name}}</option>
- </select> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>moc</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VDUInfo.moc" name="moc"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>flavourId</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VDUInfo.flavourId" name="flavourId"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>type</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VDUInfo.type" name="type"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>version</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VDUInfo.version" name="version"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>vendor</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VDUInfo.vendor" name="vendor"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <button class="btn btn-primary" type="button" ms-click="$addVDU()">保存</button>
- <input class="btn btn-primary" type="button" ms-attr-title="$mockAlarmTooltip" ms-duplex="VDUInfo.alarmbtnvalue" ms-attr-disabled="VDUInfo.alarmbtndisabled" ms-click="$raiseAlarm(VDUInfo.oid,VDUInfo.name)"/>
- <h4 ms-html="$mockAlarmRemark"></h4>
- </div>
-
- <div class="tab-pane fade" id="vnfcpanel">
- <div class="modal-header">
- <h4 id="addVDULabel" ms-text="$addVNFCtitleName"></h4>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>名称</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VNFCInfo.name" name="name"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>所属VNF</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <select id="vnfc-vnfSelect" ms-duplex="VNFCInfo.vnfId">
- <option ms-repeat="vnfList" ms-attr-value="el.oid">{{el.name}}</option>
- </select> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>所属VDU</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <select id="vnfc-vduSelect" ms-duplex="VNFCInfo.vduId">
- <option ms-repeat="vduList" ms-attr-value="el.oid">{{el.name}}</option>
- </select> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>moc</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VNFCInfo.moc" name="moc"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>IP地址</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VNFCInfo.ipAddress" name="ipAddress"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>type</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VNFCInfo.type" name="type"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>version</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VNFCInfo.version" name="version"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>vendor</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="VNFCInfo.vendor" name="vendor"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <button class="btn btn-primary" type="button" ms-click="$addVNFC()">保存</button>
- <input class="btn btn-primary" type="button" ms-attr-title="$mockAlarmTooltip" ms-duplex="VNFCInfo.alarmbtnvalue" ms-attr-disabled="VNFCInfo.alarmbtndisabled" ms-click="$raiseAlarm(VNFCInfo.oid,VNFCInfo.name)"/>
- <h4 ms-html="$mockAlarmRemark"></h4>
- </div>
-
-
-
-
- <div class="tab-pane fade" id="nspanel">
- <div class="modal-header">
- <h4 id="addNSLabel" ms-text="$addNStitleName"></h4>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>名称</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="NSInfo.name" name="name"
- class="form-control" /> <span class="help-block"></span>
- </div>
-
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>moc</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="NSInfo.moc" name="moc"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>nsd</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="NSInfo.nsd" name="nsd"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>包含的VNF</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <span ms-repeat="vnfList" >
- <input type="checkbox" ms-attr-value="el.oid" ms-duplex="NSInfo.vnfIds">{{el.name}}
- </span>
- <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>autoScalePolicy</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="NSInfo.autoScalePolicy" name="autoScalePolicy"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>status</span> <span
- class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="NSInfo.status" name="status"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>flavour</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="NSInfo.flavour" name="flavourId"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>type</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="NSInfo.type" name="type"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>version</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="NSInfo.version" name="version"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3"> <span>vendor</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="NSInfo.vendor" name="vendor"
- class="form-control" /> <span class="help-block"></span>
- </div>
- </div>
- <button class="btn btn-primary" type="button" ms-click="$addNS()">保存</button>
- <input class="btn btn-primary" type="button" ms-attr-title="$mockAlarmTooltip" ms-duplex="NSInfo.alarmbtnvalue" ms-attr-disabled="NSInfo.alarmbtndisabled" ms-click="$raiseAlarm(NSInfo.oid,NSInfo.name)"/>
- <h4 ms-html="$mockAlarmRemark"></h4>
- </div>
-
-
- <div class="tab-pane fade" id="jmeter">
- <p>jMeter 是一款开源的测试软件。它是 100% 纯 Java 应用程序,用于负载和性能测试。</p>
- </div>
- <div class="tab-pane fade" id="ejb">
- <p>Enterprise Java
- Beans(EJB)是一个创建高度可扩展性和强大企业级应用程序的开发架构,部署在兼容应用程序服务器(比如 JBOSS、Web Logic
- 等)的 J2EE 上。</p>
- </div>
- </div>
- </div>
- <script type="text/javascript" src="../component/thirdparty/jquery/jquery-1.10.2.min.js"></script>
- <script type="text/javascript" src="../component/thirdparty/bootstrap/js/bootstrap.min.js"></script>
- <script type="text/javascript" src="../vendor/bootstrap-daterangepicker/daterangepicker.js"></script>
- <script src="js/commonUtil.js"></script>
- <script src="js/avalon.modern.js"></script>
- <script src="js/mockdataController.js"></script>
-</body>
-</html>
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/css/itm.css b/umc-iui/src/main/resources/webroot/umc-drill/css/itm.css
deleted file mode 100644
index a19b5851..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/css/itm.css
+++ /dev/null
@@ -1,342 +0,0 @@
-/**
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-.container {
-width: 100%;
-/*overflow:auto;*/
-padding-right: 0;
-padding-left: 0;
-background-color: RGB(241,243,250);
-}
-
-/** Content of the panel **/
-.itm-panel-content{
- /*padding: 15px;*/
-}
-.itm-devicebtn{
- margin: 8px auto 8px auto;
-}
-.itm-inline-form{
- margin-left: 1.5%;
-}
-/**���ҳ��top���� begin**/
-.itm-monitor-top-panel-content{
- height:195px;
- background-color: white;
-}
-.itm-monitor-top-panel-content-left{
- padding-right: 10px;
-}
-.itm-monitor-top-panel-content-right{
- padding-left: 10px;
-}
-.itm-monitor-top-panel-content-right-head{
- height: 30%;
- border-bottom: 1px #eaeaea solid;
- margin: auto 10px auto 10px;
-}
-.itm-monitor-top-panel-content-right-body{
- height: 70%;
-}
-.headText{
- color: deepskyblue;
- font-size: 15px;
- height: 100%;
- padding: 4%;
-}
-.headImgs{
- height: 100%;
- padding: 4%;
-}
-.headImg{
- border-radius: 10px !important;
- height: 20px;
- width: 20px;
- cursor: pointer;
- color: #fff;
-}
-.headImg.a1{
- background-color: #E82222;
- margin-right: 20px;
- padding: 0;
-}
-.headImg.a2{
- background-color: #FF7F0E;
- margin-right: 20px;
- padding: 0;
-}
-.headImg.a3{
- background-color: #FAD592;
- margin-right: 20px;
- padding: 0;
-}
-.headImg.a4{
- background-color: #43B8F5;
- margin-right: 20px;
- padding: 0;
-}
-.devicePMbody{
- margin-top: 30px;
-}
-.bodyblock{
- color: deepskyblue;
- height: 80%;
- border-right: 1px #eaeaea solid;
- margin: 10px auto 10px auto;
-}
-.bodyblockLast{
- color: deepskyblue;
- height: 80%;
- margin: 10px auto 10px auto;
-}
-.DeviceDetailTitle{
- margin-bottom: 20px;
-}
-.DeviceDetail{
- font-size: 15px;
- font-weight: bolder;
-}
-#ItDeviceInfo ul{
- list-style:none;
- margin: 40px auto auto 10px;
-}
-#ItDeviceInfo ul li{
- color: deepskyblue;
- margin: 10px auto 10px auto;
- font-size: 14px;
-}
-.itm-monintor-top-panel-content-baseInfo{
- padding-top:10px;
- color:#5AB1EF;
- padding-bottom:5px;
-}
-.itm-monintor-top-panel-content-baseInfo-alarm
-{
-/*display: inline-block;*/
-width: 100%;
-font-size: 13px;
-font-weight: 700;
-line-height: 1;
-vertical-align: baseline;
-white-space: nowrap;
-text-align: center;
-color:#F2F6F9;
-}
-.itm-monintor-top-panel-content-baseInfo-alarm-leve-1
-{
-/*min-width: 12px;*/
-padding: 3px 7px;
-background-color: #E82222;
-}
-.itm-monintor-top-panel-content-baseInfo-alarm-leve-2
-{
-/*min-width: 12px;*/
-padding: 3px 7px;
-background-color: #FF7F0E;
-}
-.itm-monintor-top-panel-content-baseInfo-alarm-leve-3
-{
-/*min-width: 12px;*/
-padding: 3px 7px;
-background-color: #FAD592;
-}
-.itm-monintor-top-panel-content-baseInfo-alarm-leve-4
-{
-/*min-width: 12px;*/
-padding: 3px 7px;
-background-color: #43B8F5;
-}
-/***���ҳ��d3�DZ��� begin**/
-#power-gauge g.arc {
- fill: steelblue;
- }
-
- #power-gauge g.pointer {
- fill: #e85116;
- stroke: #b64011;
- }
-
- #power-gauge g.label text {
- text-anchor: middle;
- font-size: 14px;
- font-weight: bold;
- fill: #666;
-
-}
-/** 主机信息显示 */
-.full{
- padding: 0;
-}
-.ms-controller{
- /* visibility: hidden; */
-}
-
-body{
- font-family: microsoft yahei !important;
-}
-.dashBoardHeader{
- margin: 10px auto 10px auto;
-}
-/* itmBtnGroup pill (inspired by iTunes)
-*******************************************************************************/
-
-.itmBtnGroup {
- background-color: RGB(241,243,250);
- border-radius: 20px !important;
- color:#5b9bd1;
- font-weight:bold;
- padding: 8px 0;
- text-align: center;
- width: 100px;
-}
-.itmBtnGroup:hover {
- background-color: #fff;
- color:#5b9bd1;
-}
-.itmBtnGroup.selected{
- border:0;
- background-color: #5b9bd1;
- color:#fff;
-}
-.itmBtnGroup.selected:hover{
- border:0;
- background-color: #5b9bd1;
- color:#fff;
-}
-a {
- font-weight: bold;
- text-decoration: none; }
-
-p {
- color: #444;
- font-size: 14px;
- font-weight: normal;
- line-height: 21px;
- margin: 0 0 12px 0; }
-
-ul.column {
- float: left;
- list-style: none;
- width: 675px; }
-ul.column li {
- background: #eee;
- -webkit-border-radius: 5px;
- border-radius: 5px;
- -webkit-box-shadow: inset 0 1px 1px 0 #c7c7c7;
- box-shadow: inset 0 1px 1px 0 #c7c7c7;
- float: left;
- margin: 10px 0 0 10px;
- display: block;
- height: 150px;
- text-align: center;
- width: 215px; }
-
-.itmbtnGroup:selected{
- border:0;
- background-color: #5b9bd1;
-
-}
-.btn {
- /* border-width: 0; */
- /* padding: 7px 14px; */
- /* font-size: 14px; */
- /* outline: none !important; */
- /* background-image: none !important; */
- /* filter: none; */
- /* -webkit-box-shadow: none; */
- -moz-box-shadow: none;
- /* box-shadow: none; */
- /* text-shadow: none; */
-}
-
-
-.btn-default, select {
- border-width: 1px;
- padding: 4px 1px;
- border-radius: 4px;
-}
-.btn-block {
- display: block;
- width: 100%;
- padding-left: 0;
- padding-right: 0;
-}
-
-/* Bootstrap buttons */
-.btn-default {
- color: #5b9bd1;
- background-color: #fff;
- border-color: #ccc;
-
-}
-.btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default.active {
- color: #333;
- background-color: #ededed;
- border-color: #b3b3b3;
-}
-.open .btn-default.dropdown-toggle {
- color: #333;
- background-color: #ededed;
- border-color: #b3b3b3;
-}
-.btn-default:active, .btn-default.active {
- background-image: none;
- background-color: #e0e0e0;
- font-weight: bold;
-}
-.btn-default:active:hover, .btn-default.active:hover {
- background-color: #e6e6e6;
-}
-.open .btn-default.dropdown-toggle {
- background-image: none;
-}
-.btn-default.disabled, .btn-default.disabled:hover, .btn-default.disabled:focus, .btn-default.disabled:active, .btn-default.disabled.active, .btn-default[disabled], .btn-default[disabled]:hover, .btn-default[disabled]:focus, .btn-default[disabled]:active, .btn-default[disabled].active, fieldset[disabled] .btn-default, fieldset[disabled] .btn-default:hover, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default:active, fieldset[disabled] .btn-default.active {
- background-color: #fff;
- border-color: #ccc;
-}
-.btn-default .badge {
- color: #fff;
- background-color: #333;
-}
-.btn-default > i {
- color: #aaa;
-}
-.btn-default > i[class^="icon-"],
-.btn-default > i[class*="icon-"] {
- color: #8c8c8c;
-}
-div[data-name="cond_zone"] div{
- /*background-color: #fff;*/
- margin-top:15px;
- margin-bottom:15px;
-}
-.dropdown-toggle{
- color:#5b9bd1;
-}
-
-.btn.dropdown-toggle, .btn-group .btn.dropdown-toggle, .btn:hover, .btn:disabled, .btn[disabled], .btn:focus, .btn:active, .btn.active {
- outline: none !important;
- background-image: none !important;
- filter: none;
- -webkit-box-shadow: none;
- -moz-box-shadow: none;
- box-shadow: none;
- text-shadow: none;
-}
-.btn:focus, .btn:active:focus, .btn.active:focus{
- outline:0;
-}
-
-
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/css/vnf.css b/umc-iui/src/main/resources/webroot/umc-drill/css/vnf.css
deleted file mode 100644
index 4a1d1f4f..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/css/vnf.css
+++ /dev/null
@@ -1,916 +0,0 @@
-/**
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-body{
- font-family: microsoft yahei !important;
-}
-body {
- font-family: 'Open Sans', sans-serif;
- background-color: #f1f3fa;
- width: '100%';
- height: '100%';
- margin-top: 5px;
-}
-
-/* blue pill (inspired by iTunes)
-*******************************************************************************/
-/*.previous, .green {
- border-radius: 20px;
- padding: 8px 0;
- text-align: center;
- width: 100px;
- margin-right: 20px;
-}
-.blue {
- background-color: #fff;
- border-radius: 20px;
- color:#5b9bd1;
- font-weight:bold;
- padding: 8px 0;
- text-align: center;
- width: 100px;
- margin-right: 20px;
-}
-.blue:hover {
- background-color: #e8f3fd;
- color:#5b9bd1;
- }
-.blue.selected{
-border:0;
-background-color: #5b9bd1;
-color:#fff;
-}
-.blue.selected:hover{
-border:0;
-background-color: #5b9bd1;
-color:#fff;
-}*/
-
-a {
- /* font-weight: bold;*/
- text-decoration: none !important; }
-
-p {
- color: #444;
- font-size: 14px;
- font-weight: normal;
- line-height: 21px;
- margin: 0 0 12px 0; }
-
-p.credit {
- border-top: 1px solid #ccc;
- font-size: 14px;
- line-height: 140%;
- margin: 36px 0 12px 0;
- padding: 8px 0 0 0;
- text-align: center; }
-
-
-ul.column {
- float: left;
- list-style: none;
- width: 675px; }
-ul.column li {
- background: #eee;
- -webkit-border-radius: 5px;
- border-radius: 5px;
- -webkit-box-shadow: inset 0 1px 1px 0 #c7c7c7;
- box-shadow: inset 0 1px 1px 0 #c7c7c7;
- float: left;
- margin: 10px 0 0 10px;
- display: block;
- height: 150px;
- text-align: center;
- width: 215px; }
-
-
-/* Clear Floated Elements
-------------------------------------------------------------------------------*/
-.column:after,
-.button-collection:after,
-.clearfix:after,
-div.project-info:after {
- clear: both;
- content: ' ';
- display: block;
- font-size: 0;
- line-height: 0;
- visibility: hidden;
- width: 0;
- height: 0; }
-
-.nav-tabs{
-border:0;
-}
-.nav-tabs>li.active>a, .nav-tabs>li.active>a:hover, .nav-tabs>li.active>a:focus{
-border:0;
-border-top:3px solid #F3565D;
-}
-.nav-tabs>li>a{
-border-radius:0;
-}
-.nav-tabs>li>a:hover{
-background-color:#f1f3fa;
-border:1Px solid #f1f3fa;
-}
-.c3{
-margin-top:120px;
-}
-.skills-chart-breadcrumb{
-
-}
-
-.blue:selected{
-border:0;
-background-color: #5b9bd1;
-}
-.btn {
- /* border-width: 0; */
- /* padding: 7px 14px; */
- /* font-size: 14px; */
- /* outline: none !important; */
- /* background-image: none !important; */
- /* filter: none; */
- /* -webkit-box-shadow: none; */
- -moz-box-shadow: none;
- /* box-shadow: none; */
- /* text-shadow: none; */
-}
-
-.btn-default, select {
-border-width: 1px;
-padding: 4px 1px;
-border-radius: 4px;
-}
-
-.input-sm {
- padding: 4px 10px;
-}
-
-.btn-block {
- display: block;
- width: 100%;
- padding-left: 0;
- padding-right: 0;
-}
-
-/* Bootstrap buttons */
-.btn-default {
- color: #5b9bd1;
- background-color: #fff;
- border-color: #ccc;
-
-}
-.btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default.active {
- color: #333;
- background-color: #ededed;
- border-color: #b3b3b3;
-}
-.open .btn-default.dropdown-toggle {
- color: #333;
- background-color: #ededed;
- border-color: #b3b3b3;
-}
-.btn-default:active, .btn-default.active {
- background-image: none;
- background-color: #e0e0e0;
- font-weight: bold;
-}
-.btn-default:active:hover, .btn-default.active:hover {
- background-color: #e6e6e6;
-}
-.open .btn-default.dropdown-toggle {
- background-image: none;
-}
-.btn-default.disabled, .btn-default.disabled:hover, .btn-default.disabled:focus, .btn-default.disabled:active, .btn-default.disabled.active, .btn-default[disabled], .btn-default[disabled]:hover, .btn-default[disabled]:focus, .btn-default[disabled]:active, .btn-default[disabled].active, fieldset[disabled] .btn-default, fieldset[disabled] .btn-default:hover, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default:active, fieldset[disabled] .btn-default.active {
- background-color: #fff;
- border-color: #ccc;
-}
-.btn-default .badge {
- color: #fff;
- background-color: #333;
-}
-.btn-default > i {
- color: #aaa;
-}
-.btn-default > i[class^="icon-"],
-.btn-default > i[class*="icon-"] {
- color: #8c8c8c;
-}
-
-div[data-name="tab_zone"] div{
- background-color:#f1f3fa;
- padding:0px;
-}
-
-
-div[data-name="cond_zone"] div{
- background-color: #fff;
- margin-top:15px;
- margin-bottom:15px;
-}
-
-div[data-name="log-otherConds-zone"]{
- display:inline;
-}
-
-div[data-name="log-otherConds-zone"] select ,div[data-name="log-otherConds-zone"] span{
- /**height:33px;*/
- margin-left:15px;
- color:#5b9bd1;
- border-color:#ccc;
- font-weight: bold;
-}
-
-div.separator div{
- text-align: center;
- line-height:0;
-}
-div.separator-sline{
- height:28px ;
- width:3px;
-}
-
-.dropdown-toggle{
-color:#5b9bd1;
-}
-.calendar-date{
-color:#5b9bd1;
-}
-.range_inputs{
-color:#5b9bd1;
-}
-.btn.dropdown-toggle, .btn-group .btn.dropdown-toggle, .btn:hover, .btn:disabled, .btn[disabled], .btn:focus, .btn:active, .btn.active {
- outline: none !important;
- background-image: none !important;
- filter: none;
- -webkit-box-shadow: none;
- -moz-box-shadow: none;
- box-shadow: none;
- text-shadow: none;
-}
-
-#skills-chart-breadcrumb{
-margin-bottom:10px
-}
-
-
-/*增加daterangepicker的css*/
-input[name="daterange"]{
- width: 220px;
- line-height:0;
- height: 31px;
- vertical-align: top;
- margin-top: 2px;
-
-}
-
-.daterangepicker .ranges{
- width: 205px;
-}
-.daterangepicker .ranges input{
- width:95px !important;
-}
-
-td.details-control {
- background: url('../images/details_open.png') no-repeat center center;
- cursor: pointer;
-}
-tr.shown td.details-control {
- background: url('../images/details_close.png') no-repeat center center;
-}
-
-
-.details table td{
- word-wrap: break-word;
- word-break: normal;
- border-top: 1px solid #dddddd;
-}
-
-.details table tr:first-child td {
- border-top: none;
-}
-
-.details table{
- table-layout:fixed;
- width:100%;
-}
-
-td.title{
- width:10%;
-}
-
-table.dataTable tbody th, table.dataTable tbody td {
-padding: 8px 10px;
-}
-
-div.dataTables_length ,div.dataTables_info{
- display: inline;
-}
-
-div.dataTables_paginate{
- display: inline;
- float: right;
-}
-
-div.pagination-panel{
- margin-right:10px;
-}
-
-input.pagination-panel-input{
- width:50px;
-}
-
-#ict_log_table_div{
- margin-top:15px;
-}
-
-
-#ict_sm_table_div label{
- font-weight:100;
-}
-
-.daterangepicker .daterangepicker_start_input label, .daterangepicker .daterangepicker_end_input label{
-color:#5b9bd1;
-
-}
-.daterangepicker .ranges .input-mini{
- color:#5b9bd1;
- }
-.cancelBtn {
- padding:5px 10px 5px 10px;
-}
-.btn:focus, .btn:active:focus, .btn.active:focus{
- outline:0;
-}
-
-#ict_log_table_div table{
-
-}
-
-.box{
-height:115px ;
-color:white;
-text-align:right;
-border-radius:8px;
-padding-right:10%;
-padding-top:30px;
-padding-bottom:100px;
-font-size:14px;
-margin: 5px;
-}
-.box0{
-display:none !important
-
-}
-.box1{
-background-image:url(../images/userGroup.png);
-background-repeat:no-repeat;
-background-color:#578ebe !important;
-height:3px !important;
-background-position-y:100%;
-}
-.box2{
-background-image:url(../images/loginUser.png);
-background-repeat:no-repeat;
-background-color:#44b6ae !important;
-height:3px !important;
-background-position-y:100%;
-}
-.box3{
-background-image:url(../images/blackList.png);
-background-repeat:no-repeat;
-background-color:#c0af69 !important;
-height:3px !important;
-background-position-y:100%;
-}
-.box4{
-background-image:url(../images/lockUser.png);
-background-repeat:no-repeat;
-background-color:#e35b5a !important;
-height:3px !important;
-background-position-y:100%;
-}
-.box5{
-background-image:url(../images/userGroup.png);
-background-repeat:no-repeat;
-background-color:#578ebe !important;
-height:3px !important;
-background-position-y:100%;
-}
-.box6{
-background-image:url(../images/loginUser.png);
-background-repeat:no-repeat;
-background-color:#44b6ae !important;
-height:3px !important;
-background-position-y:100%;
-}
-.box7{
-background-image:url(../images/lockUser.png);
-background-repeat:no-repeat;
-background-color:#e35b5a !important;
-height:3px !important;
-background-position-y:100%;
-}
-.box8{
-background-image:url(../images/userGroup.png);
-background-repeat:no-repeat;
-background-color:#578ebe !important;
-height:3px !important;
-background-position-y:100%;
-}
-.box9{
-background-image:url(../images/loginUser.png);
-background-repeat:no-repeat;
-background-color:#44b6ae !important;
-height:3px !important;
-background-position-y:100%;
-}
-
-.row1 .separator-line{
-margin-bottom:5px;
-}
-.row a{
-/*color:white;*/
-font-weight:normal;
-font-size:14px;
-
-}
-.btnBlue {
- background-color: #5b9bd1;
- border-radius: 20px;
- color: white;
- font-weight: normal;
- text-align: center;
- min-width: 80px;
-}
-.btnBlue:hover{
- background-color: #487ca9 !important;
- color:#fff !important;
-}
-.btnBlue1 {
- background-color: #5b9bd1;
- border-radius: 20px;
- color: white;
- font-weight: normal;
- text-align: center;
- min-width: 80px;
-}
-.btnGrey {
- background-color: #d3d1d1;
- border-radius: 20px;
- color: black !important;
- font-weight: normal;
- padding: 8px 0;
- text-align: center;
- width: 70px;
-}
-.smLianJie {
-color:#5b9bd1 !important;
-font-weight:normal;
-display:inline-block;
-margin-top:25px;
-font-size:14px
-}
-
-.smLianJie span{
-padding:2px;
-}
-.rightDiv{
-float:right;
-color:#5b9bd1 !important;
-}
-.num{
-font-size:30px;
-font-family:arial;
-font-weight:bold;
-}
-.numdiv{
-margin-bottom:20px;
-}
-.ruleDiv{
-text-align:center;
-}
-
-.ruleDiv1{
-padding-top:20px;
-text-align:center;
-}
-.fmTypeDiv{
- padding: 20px;
- text-align: center;
- font-size: 16px;
- background: white;
- margin-top: 5px;
- margin-left: 30px;
- margin-right: 10px;
- height: 105px;
-}
-.container-fluid{
-background-color:white ;
-/*margin-top:25px;*/
-//min-height:500px;
-}
-.titlefont{
- font-size:16px;
-}
-.label{
- font-weight: 400;
- /*font-size: 14px; */
-}
-.v5h5{
- font-size: 16px;
- color:#5b9bd1 !important;
- font-weight:bold !important;
-}
-.v5label{
- padding-top: 5px !important;
- font-size: 13px;
- text-align:right;
-}
-.v5lineColor1{
- background-color:#578ebe !important;
-}
-.box1:hover{
- background-color:#487ca9 !important;
-}
-
-.box2:hover{
- background-color: #329d96 !important;
-}
-.box3:hover{
- background-color:#ad9a4d !important;
-}
-.box4:hover{
- background-color:#d45150 !important;
-}
-.v5spinner{
- width:50px;
- margin-left:10px;
- margin-right:10px;
-}
-.ff{
- float:left;/*左漂浮*/
- width: 1px;
- height: 25px;/*竖线高度*/
- background: #000;/*填充颜色*/
-}
-.radio-list{
- padding-top:0px;
-}
-.row1{
- margin-right: 0px !important;
-}
-
-#ict_sm_tableloginUser_wrapper .ict-legendshow,
-#ict_sm_tablelockUser .ict-unlock
-{
- margin-right:6px;
-}
-#ict_sm_tableallUser > thead > tr > th,#ict_sm_tableloginUser > thead > tr > th,#ict_sm_tablelockUser > thead > tr > th{
- background:white;
- background-color:white !important;
-}
-#weakregularity{color:#468ECE;border-bottom: 1px #468ECE dotted;margin:0px !important;}
-#weakregularity_tip{
- position:absolute;
- display:none;
- background:#000;
- opacity:0.8;
- border:1px solid #ddd !important;
- font-size:0.8em;
- margin-top:-1%;
- margin-left:15%;
- box-shadow:2px 3px 5px #C8C8C8;
- border-radius:8px;
- padding:20px 5px;
- z-index:999;
- width:530px;
- height:270px;
- color:#fff;
- line-height:25px;
-}
-#weakregularity_tip > ul > li{margin-top:4px;list-style-type:disc;}
-#weakregularity_tip > ul > li:first-child{margin-top:0px;}
-#com_zte_ums_ict_sm_new_user_isPasswordChanged > span,
-#com_zte_ums_ict_sm_new_user_passwordvaliddays > span
-{
- margin:0px 6px;
-}
-#forceExit{
- /**padding:3px 18px 3px 10px;
- cursor:pointer;
- border:1px solid #ddd;
- border-radius:12px;
- text-shadow:0 1px 0 hsla(0,0%,100%,0.75);
- //background-image:url("../images/forceOut.png");
- //background-repeat:no-repeat;
- //background-size:20% 70%;
- background-position:left 10% top 45%;**/
- margin-bottom:10px;
-}
-
-/*#forceExit:hover{
- background-color:#F9F9F9;
-}*/
-.smLianJie:hover{
- cursor:pointer;
-}
-div.checker,div.checker span{
- width:22px;
- height:22px;
- background:#fff;
-}
-.row1 .col-xs-10, .row1 .col-md-10, .row1 .col-sm-10, .row1 .col-lg-10{
-width:87% !important;
-}
-.row1 .col-xs-2, .row1 .col-md-2, .row1 .col-sm-2, .row1 .col-lg-2{
-width:13% !important;
-}
-.modify_user{
-padding-left:0px;
-}
-.btn-xs{
-color:#333;
-font-size:14px;
-}
-.btn-xs:hover{
-color:#333
-}
-ul.ztree {margin-top: 10px;border: 1px solid #E0E0E0;/*background: #f0f6e4;width:220px;height:360px;*/overflow-y:auto;overflow-x:auto;/*ict*/padding: 25px;}
-#new_rule_body{
-padding-left:25px;
-}
-.rule_title{
-padding:8px;
-margin-bottom:25px;
-border-left: 2px solid #5b9bd1;
-color:#1A78CA;
-font-size:16px;
-}
-.group{
-margin-top:25px;
-}
-
-h5.form-section, .checkbox-list, .panel-title{
- font-family: microsoft yahei !important;
- color: #333;
- <!-- padding-bottom: 15px !important; -->
-}
-.right_assign_box{
-height:400px;
-overflow-y:auto;
-overflow-x:hidden;
-border:1px solid #e0e0e0;
-}
-.right_assign_box ul.ztree{
-border:0;
-}
-.right_assign_box .table-bordered{
- border:0;
- }
-.right_assign_box .table-bordered>thead>tr>th, .right_assign_box .table-bordered>tbody>tr>th, .right_assign_box .table-bordered>tfoot>tr>th, .right_assign_box .table-bordered>thead>tr>td, .right_assign_box .table-bordered>tbody>tr>td, .right_assign_box .table-bordered>tfoot>tr>td{
- border-left:0;
- padding:8px 18px;
-}
-.right_assign_box .table>thead>tr>th{
- border:0;
-}
-#com_zte_ums_ict_sm_new_user_maxlogin .form-control{
-width:30%;
-display:inline;
-margin-left:10px;
-}
-
-.div_padding{
- padding-left:75px;
-}
-#lockThreshold{width:80%;}
-#lockThreshold_select{width:100%;height:20px;font-size:0.8em;color:black;margin-top:10px;}
-#lockThreshold_1{position:absolute;cursor:pointer;width:auto;}
-#lockThreshold_2{position:absolute;cursor:pointer;width:auto;}
-#lockThreshold_3{position:absolute;cursor:pointer;width:auto;}
-
-.delete-icon {
- float: right;
- /* padding: 5px; */
- cursor: pointer;
- position: relative;
- display: inline-block;
- margin-right: 2%;
-}
-.delete-icon img {
- position: absolute;
- right: 0px;
-}
-.removeIcon {
- width: 22px;
- height: 22px;
- float: right;
- margin-right: -8px;
- margin-top: -8px;
- background: url(/ngict/iui/component/ict/ict-dashboard/images/delete.png) no-repeat 0px 0px;
- cursor: pointer;
-}
-.deleteIconHidden{
- opacity:0;
-}
-.nam{
- font-size: 15px;
-}
-.queryLink{
- font-size: 15px;
- margin-top: 10px;
-}
-.carousel-control {
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- width: 3% !important;
- opacity: .5;
- filter: alpha(opacity=50);
- font-size: 20px;
- color: #fff;
- text-align: center;
- text-shadow: 0 1px 2px rgba(0,0,0,.6);
-}
-.carousel-control .glyphicon-chevron-right {
- right: 10%;
-}
-.item {
- overflow: hidden;
- display: block;
- margin-bottom: 0px !important;
-}
-.parentWrapper{
- border: 2px solid #7AB4E5;
- padding-bottom:25px;
- border-radius: 4px;
- /* margin-top: 30px; */
-}
-.sunWrapper{
- border: 2px solid #7AB4E5;
- padding-top: 25px;
- /* background: #E4E8EB;*/
- border-radius: 4px;
- /* margin-top: 17px;*/
- margin-top: -10px;
-}
-.seperateLine{
- margin-top: -10px;
- z-index: -1;
- position: absolute;
- height: 2px;
- background:#89BEDF;
-}
-.rootIcon{
- text-align: center;
- padding-top: 10px;
-}
-.fixed{
- position:fixed;
- top:20px;
- background: #F1F3FA;
- /*width: 304px; */
-}
-.fixed_side{
- margin-top: 10px;
- background: #F1F3FA;
- /*height:100%;*/
-}
-.vnfBox {
- height: 165px;
- min-width:190px;
- color: #616161 !important;
- text-align: right;
- border-radius: 5px 5px 5px 5px;
- font-size: 12px;
- margin-top: 5px;
- margin-bottom: 10px;
- background: white;
- /*border: 2px solid #E1ECF2;*/
- border: 2px solid #7AB4E5;
- /* 过渡效果 */
- -webkit-transition: all 0.5s ease-in-out;
- -moz-transition: all 0.5s ease-in-out;
- -o-transition: all 0.5s ease-in-out;
- -ms-transition: all 0.5s ease-in-out;
- transition: all 0.5s ease-in-out;
-}
-.vnfBox.self {
- margin-bottom: 10px;
-}
-.vnfBox:hover {
- /* box-shadow: 0 1px 50px rgba(0,0,0,0.1);
- -webkit-box-shadow:0 1px 50px rgba(0,0,0,0.1); */
- box-shadow: 0 1px 50px #7AB4E5;
- -webkit-box-shadow:0 1px 50px #7AB4E5;
-}
-.vnfBoxShrink{
- -webkit-transform:scale(0,0);
- -moz-transform:scale(0,0);
- -o-transform:scale(0,0);
- transform:scale(0,0);
-}
-#mainContent{
- padding-left:30px;
- padding-top:10px;
- /* 过渡效果 */
- -webkit-transition: all 0.5s ease-in-out;
- -moz-transition: all 0.5s ease-in-out;
- -o-transition: all 0.5s ease-in-out;
- -ms-transition: all 0.5s ease-in-out;
- transition: all 0.5s ease-in-out;
-}
-.mainContentShrink{
- -webkit-transform:scale(0,0);
- -moz-transform:scale(0,0);
- -o-transform:scale(0,0);
- transform:scale(0,0);
-}
-.mainContentExpand{
- -webkit-transform:scale(1,1);
- -moz-transform:scale(1,1);
- -o-transform:scale(1,1);
- transform:scale(1,1);
-}
-.titleArea{
- margin-left: 0px;
- margin-right: 0px;
- /*border-radius: 8px 8px 0px 0px;*/
-}
-.titleAreaHover{
- background:#7AB4E5;
-}
-.portletIcon{
- color: #B1C2CD;
- text-align: center;
- padding-top: 8px;
- border-bottom: 1px solid #e1e1e1;
- height: 38px;
- font: 16px Microsoft yahei;
-}
-.portletIconHover{
- color: #fff;
-}
-.portletLabel {
- color: #3778A2;
- /*width: 100%;*/
- height: 38px;
- /* float: left; */
- border-radius: 8px 8px 0px 0px;
- border-bottom: 1px solid #e1e1e1;
- font: 16px Microsoft yahei;
- /*background: #89BEDF;*/
- text-align: center;
- padding-top: 8px;
- padding-left: 0px;
-}
-.portletLabelHover{
- color: #fff;
-}
-.portletLabel:hover{
- color: #1178EE;
-}
-.fmPmJumpLabel{
-
- font-size: 14px;
- font-family:"Microsoft yahei", arial;
- /*background-color: #7AB4E5;*/
- padding-top: 0px;
- padding-bottom: 10px;
- border-radius: 8px;
-}
-.nodeWrapper:hover{
- cursor:pointer;
-}
-.contain:hover{
- cursor:pointer;
-}
-.icon-alarm{
-text-align:center;
-}
-.contain{
-margin: 0 auto;
-margin-top:5px;
-}
-.arrow{
-text-align:center;
-}
-#contianArea{
-margin-top:-30px;
-background-color:transparent;
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/i18n/ngict-umc-monitor-i18n-en-US.properties b/umc-iui/src/main/resources/webroot/umc-drill/i18n/ngict-umc-monitor-i18n-en-US.properties
deleted file mode 100644
index b86ba6b4..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/i18n/ngict-umc-monitor-i18n-en-US.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-#add your custome i18n "key-value" here,example:
-#com_zte_ums_nfv_zxconductor_umc_ups_pkg_management=Package Management
-com_zte_umc_monitor_default_tip=Instance Graph
-com_zte_umc_monitor_information_tip=Monitor Information
-com_zte_umc_monitor_moc=MOC
-com_zte_umc_monitor_provider=Vendor
-com_zte_umc_monitor_status=Status
-com_zte_umc_monitor_contains=Contains
-com_zte_umc_monitor_detail_info=Detail
-
-com_zte_umc_monitor_service_provider=Vendor
-com_zte_umc_monitor_title=Title
-com_zte_umc_monitor_version_no=Version No.
-com_zte_umc_monitor_vnfm_blongs_to=VNFM
-com_zte_umc_monitor_vim_blongs_to=VIM
-com_zte_umc_monitor_ip_address=IP
-com_zte_umc_monitor_create_time=Create Time
-com_zte_umc_monitor_protocol=Protocol
-com_zte_umc_monitor_port=Port
-com_zte_umc_monitor_user_name=User Name
-
-com_zte_umc_monitor_detail_moc=MOC
-com_zte_umc_monitor_detail_moc_id=MOC_ID
-com_zte_umc_monitor_type=Type \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/i18n/ngict-umc-monitor-i18n-zh-CN.properties b/umc-iui/src/main/resources/webroot/umc-drill/i18n/ngict-umc-monitor-i18n-zh-CN.properties
deleted file mode 100644
index ab50c9d9..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/i18n/ngict-umc-monitor-i18n-zh-CN.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-#增加国际化中的键值对,示例如下
-#com_zte_ums_nfv_zxconductor_umc_ups_pkg_management=包管理
-com_zte_umc_monitor_default_tip=实例图
-com_zte_umc_monitor_information_tip=监控信息
-com_zte_umc_monitor_moc=MOC
-com_zte_umc_monitor_provider=提供商
-com_zte_umc_monitor_status=状态
-com_zte_umc_monitor_contains=包含
-com_zte_umc_monitor_detail_info=详细信息
-
-com_zte_umc_monitor_service_provider=网络服务提供商
-com_zte_umc_monitor_title=标题
-com_zte_umc_monitor_version_no=版本号
-com_zte_umc_monitor_vnfm_blongs_to=归属VNFM
-com_zte_umc_monitor_vim_blongs_to=归属VIM
-com_zte_umc_monitor_ip_address=IP地址
-com_zte_umc_monitor_create_time=创建时间
-com_zte_umc_monitor_protocol=协议
-com_zte_umc_monitor_port=端口
-com_zte_umc_monitor_user_name=用户名
-
-com_zte_umc_monitor_detail_moc=网元类型
-com_zte_umc_monitor_detail_moc_id=网元类型ID
-com_zte_umc_monitor_type=类型 \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/images/aos_view-fm.gif b/umc-iui/src/main/resources/webroot/umc-drill/images/aos_view-fm.gif
deleted file mode 100644
index 7914b55a..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/images/aos_view-fm.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/images/arrow.png b/umc-iui/src/main/resources/webroot/umc-drill/images/arrow.png
deleted file mode 100644
index 89c486c8..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/images/arrow.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/images/details_close.png b/umc-iui/src/main/resources/webroot/umc-drill/images/details_close.png
deleted file mode 100644
index 493a2ef3..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/images/details_close.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/images/details_open1.png b/umc-iui/src/main/resources/webroot/umc-drill/images/details_open1.png
deleted file mode 100644
index 5bf4389c..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/images/details_open1.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/images/down.png b/umc-iui/src/main/resources/webroot/umc-drill/images/down.png
deleted file mode 100644
index f7732ba8..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/images/down.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/images/filter.png b/umc-iui/src/main/resources/webroot/umc-drill/images/filter.png
deleted file mode 100644
index e535a73d..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/images/filter.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/images/up.png b/umc-iui/src/main/resources/webroot/umc-drill/images/up.png
deleted file mode 100644
index 8bd53741..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/images/up.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/index.html b/umc-iui/src/main/resources/webroot/umc-drill/index.html
deleted file mode 100644
index ddfc31ce..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/index.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!--
-
- Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<html>
- <head>
- <meta charset="UTF-8">
- <title>umc-monitor index page</title>
- </head>
- <body>
- 努力开发中
- </body>
-</html> \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/js/Constants.js b/umc-iui/src/main/resources/webroot/umc-drill/js/Constants.js
deleted file mode 100644
index 43fd4004..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/js/Constants.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Created by 10184303 on 15-4-27.
- */
-/** 全局变量、常量定义 */
-var Constants = {
- SUSEHEAD: "html/monitor.host.head.html",
- SYBASEIQHEAD: "html/monitor.sybaseiq.head.html",
- MOC_SUSE: "itm.server.suse",
- MOC_SYBASEIQ: "itm.database.sybaseiq",
- METRIC: ["com_zte_ums_ngict_itm_metric_hour","com_zte_ums_ngict_itm_metric_today","com_zte_ums_ngict_itm_metric_seven_days","com_zte_ums_ngict_itm_metric_group_thirty_days"]
-}; \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/js/avalon.modern.js b/umc-iui/src/main/resources/webroot/umc-drill/js/avalon.modern.js
deleted file mode 100644
index 84d7e49c..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/js/avalon.modern.js
+++ /dev/null
@@ -1,4455 +0,0 @@
-/*
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*==================================================
- Copyright (c) 2013-2014 司徒正美 and other contributors
- http://www.cnblogs.com/rubylouvre/
- https://github.com/RubyLouvre
- http://weibo.com/jslouvre/
-
- Released under the MIT license
- avalon.modern.js 1.39 build in 2015.1.15
-______________________________
- support IE6+ and other browsers
- ==================================================*/
-(function(global, factory) {
-
- if (typeof module === "object" && typeof module.exports === "object") {
- // For CommonJS and CommonJS-like environments where a proper `window`
- // is present, execute the factory and get avalon.
- // For environments that do not have a `window` with a `document`
- // (such as Node.js), expose a factory as module.exports.
- // This accentuates the need for the creation of a real `window`.
- // e.g. var avalon = require("avalon")(window);
- module.exports = global.document ? factory(global, true) : function(w) {
- if (!w.document) {
- throw new Error("Avalon requires a window with a document")
- }
- return factory(w)
- }
- } else {
- factory(global)
- }
-
-// Pass this if window is not defined yet
-}(typeof window !== "undefined" ? window : this, function(window, noGlobal){
-
-/*********************************************************************
- * 全局变量及方法 *
- **********************************************************************/
-var expose = Date.now()
-//http://stackoverflow.com/questions/7290086/javascript-use-strict-and-nicks-find-global-function
-var DOC = window.document
-var head = DOC.head //HEAD元素
-head.insertAdjacentHTML("afterBegin", '<avalon ms-skip><style id="avalonStyle">.avalonHide{ display: none!important }</style></avalon>')
-var ifGroup = head.firstChild
-
-function log() {
- if (avalon.config.debug) {
-// http://stackoverflow.com/questions/8785624/how-to-safely-wrap-console-log
- console.log.apply(console, arguments)
- }
-}
-
-var subscribers = "$" + expose
-var otherRequire = window.require
-var otherDefine = window.define
-var stopRepeatAssign = false
-var rword = /[^, ]+/g //切割字符串为一个个小块,以空格或豆号分开它们,结合replace实现字符串的forEach
-var rcomplexType = /^(?:object|array)$/
-var rsvg = /^\[object SVG\w*Element\]$/
-var rwindow = /^\[object (?:Window|DOMWindow|global)\]$/
-var oproto = Object.prototype
-var ohasOwn = oproto.hasOwnProperty
-var serialize = oproto.toString
-var ap = Array.prototype
-var aslice = ap.slice
-var Registry = {} //将函数曝光到此对象上,方便访问器收集依赖
-var W3C = window.dispatchEvent
-var root = DOC.documentElement
-var hyperspace = DOC.createDocumentFragment()
-var cinerator = DOC.createElement("div")
-var class2type = {}
-"Boolean Number String Function Array Date RegExp Object Error".replace(rword, function(name) {
- class2type["[object " + name + "]"] = name.toLowerCase()
-})
-
-
-function noop() {
-}
-
-
-function oneObject(array, val) {
- if (typeof array === "string") {
- array = array.match(rword) || []
- }
- var result = {},
- value = val !== void 0 ? val : 1
- for (var i = 0, n = array.length; i < n; i++) {
- result[array[i]] = value
- }
- return result
-}
-
-function createCache(maxLength) {
- var keys = []
- function cache(key, value) {
- if (keys.push(key) > maxLength) {
- delete cache[keys.shift()]
- }
- return cache[key] = value;
- }
- return cache;
-}
-//生成UUID http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
-var generateID = function(prefix) {
- prefix = prefix || "avalon"
- return (prefix + Math.random() + Math.random()).replace(/0\./g, "")
-}
-function IE() {
- if (window.VBArray) {
- var mode = document.documentMode
- return mode ? mode : window.XMLHttpRequest ? 7 : 6
- } else {
- return 0
- }
-}
-var IEVersion = IE()
-/*********************************************************************
- * avalon的静态方法定义区 *
- **********************************************************************/
-avalon = function(el) { //创建jQuery式的无new 实例化结构
- return new avalon.init(el)
-}
-
-avalon.init = function(el) {
- this[0] = this.element = el
-}
-avalon.fn = avalon.prototype = avalon.init.prototype
-
-avalon.type = function(obj) { //取得目标的类型
- if (obj == null) {
- return String(obj)
- }
- // 早期的webkit内核浏览器实现了已废弃的ecma262v4标准,可以将正则字面量当作函数使用,因此typeof在判定正则时会返回function
- return typeof obj === "object" || typeof obj === "function" ?
- class2type[serialize.call(obj)] || "object" :
- typeof obj
-}
-
-var isFunction = function(fn) {
- return serialize.call(fn) == "[object Function]"
-}
-
-avalon.isFunction = isFunction
-
-avalon.isWindow = function(obj) {
- return rwindow.test(serialize.call(obj))
-}
-
-/*判定是否是一个朴素的javascript对象(Object),不是DOM对象,不是BOM对象,不是自定义类的实例*/
-
-avalon.isPlainObject = function(obj) {
- // 简单的 typeof obj === "object"检测,会致使用isPlainObject(window)在opera下通不过
- return serialize.call(obj) === "[object Object]" && Object.getPrototypeOf(obj) === oproto
-}
-
-//与jQuery.extend方法,可用于浅拷贝,深拷贝
-avalon.mix = avalon.fn.mix = function() {
- var options, name, src, copy, copyIsArray, clone,
- target = arguments[0] || {},
- i = 1,
- length = arguments.length,
- deep = false
-
- // 如果第一个参数为布尔,判定是否深拷贝
- if (typeof target === "boolean") {
- deep = target
- target = arguments[1] || {}
- i++
- }
-
- //确保接受方为一个复杂的数据类型
- if (typeof target !== "object" && !isFunction(target)) {
- target = {}
- }
-
- //如果只有一个参数,那么新成员添加于mix所在的对象上
- if (i === length) {
- target = this
- i--
- }
-
- for (; i < length; i++) {
- //只处理非空参数
- if ((options = arguments[i]) != null) {
- for (name in options) {
- src = target[name]
- copy = options[name]
- // 防止环引用
- if (target === copy) {
- continue
- }
- if (deep && copy && (avalon.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) {
-
- if (copyIsArray) {
- copyIsArray = false
- clone = src && Array.isArray(src) ? src : []
-
- } else {
- clone = src && avalon.isPlainObject(src) ? src : {}
- }
-
- target[name] = avalon.mix(deep, clone, copy)
- } else if (copy !== void 0) {
- target[name] = copy
- }
- }
- }
- }
- return target
-}
-
-function _number(a, len) { //用于模拟slice, splice的效果
- a = Math.floor(a) || 0
- return a < 0 ? Math.max(len + a, 0) : Math.min(a, len);
-}
-avalon.mix({
- rword: rword,
- subscribers: subscribers,
- version: 1.39,
- ui: {},
- log: log,
- slice: function(nodes, start, end) {
- return aslice.call(nodes, start, end)
- },
- noop: noop,
- /*如果不用Error对象封装一下,str在控制台下可能会乱码*/
- error: function(str, e) {
- throw new (e || Error)(str)
- },
- /*将一个以空格或逗号隔开的字符串或数组,转换成一个键值都为1的对象*/
- oneObject: oneObject,
- /* avalon.range(10)
- => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
- avalon.range(1, 11)
- => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
- avalon.range(0, 30, 5)
- => [0, 5, 10, 15, 20, 25]
- avalon.range(0, -10, -1)
- => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
- avalon.range(0)
- => []*/
- range: function(start, end, step) { // 用于生成整数数组
- step || (step = 1)
- if (end == null) {
- end = start || 0
- start = 0
- }
- var index = -1,
- length = Math.max(0, Math.ceil((end - start) / step)),
- result = Array(length)
- while (++index < length) {
- result[index] = start
- start += step
- }
- return result
- },
- eventHooks: {},
- /*绑定事件*/
- bind: function(el, type, fn, phase) {
- var hooks = avalon.eventHooks
- var hook = hooks[type]
- if (typeof hook === "object") {
- type = hook.type
- if (hook.deel) {
- fn = hook.deel(el, fn)
- }
- }
- el.addEventListener(type, fn, !!phase)
- return fn
- },
- /*卸载事件*/
- unbind: function(el, type, fn, phase) {
- var hooks = avalon.eventHooks
- var hook = hooks[type]
- var callback = fn || noop
- if (typeof hook === "object") {
- type = hook.type
- }
- el.removeEventListener(type, callback, !!phase)
- },
- /*读写删除元素节点的样式*/
- css: function(node, name, value) {
- if (node instanceof avalon) {
- node = node[0]
- }
- var prop = /[_-]/.test(name) ? camelize(name) : name
- name = avalon.cssName(prop) || prop
- if (value === void 0 || typeof value === "boolean") { //获取样式
- var fn = cssHooks[prop + ":get"] || cssHooks["@:get"]
- if (name === "background") {
- name = "backgroundColor"
- }
- var val = fn(node, name)
- return value === true ? parseFloat(val) || 0 : val
- } else if (value === "") { //请除样式
- node.style[name] = ""
- } else { //设置样式
- if (value == null || value !== value) {
- return
- }
- if (isFinite(value) && !avalon.cssNumber[prop]) {
- value += "px"
- }
- fn = cssHooks[prop + ":set"] || cssHooks["@:set"]
- fn(node, name, value)
- }
- },
- /*遍历数组与对象,回调的第一个参数为索引或键名,第二个或元素或键值*/
- each: function(obj, fn) {
- if (obj) { //排除null, undefined
- var i = 0
- if (isArrayLike(obj)) {
- for (var n = obj.length; i < n; i++) {
- fn(i, obj[i])
- }
- } else {
- for (i in obj) {
- if (obj.hasOwnProperty(i)) {
- fn(i, obj[i])
- }
- }
- }
- }
- },
- //收集元素的data-{{prefix}}-*属性,并转换为对象
- getWidgetData: function(elem, prefix) {
- var raw = avalon(elem).data()
- var result = {}
- for (var i in raw) {
- if (i.indexOf(prefix) === 0) {
- result[i.replace(prefix, "").replace(/\w/, function(a) {
- return a.toLowerCase()
- })] = raw[i]
- }
- }
- return result
- },
- Array: {
- /*只有当前数组不存在此元素时只添加它*/
- ensure: function(target, item) {
- if (target.indexOf(item) === -1) {
- return target.push(item)
- }
- },
- /*移除数组中指定位置的元素,返回布尔表示成功与否*/
- removeAt: function(target, index) {
- return !!target.splice(index, 1).length
- },
- /*移除数组中第一个匹配传参的那个元素,返回布尔表示成功与否*/
- remove: function(target, item) {
- var index = target.indexOf(item)
- if (~index)
- return avalon.Array.removeAt(target, index)
- return false
- }
- }
-})
-
-var bindingHandlers = avalon.bindingHandlers = {}
-var bindingExecutors = avalon.bindingExecutors = {}
-
-/*判定是否类数组,如节点集合,纯数组,arguments与拥有非负整数的length属性的纯JS对象*/
-function isArrayLike(obj) {
- if (obj && typeof obj === "object") {
- var n = obj.length,
- str = serialize.call(obj)
- if (/(Array|List|Collection|Map|Arguments)\]$/.test(str)) {
- return true
- } else if (str === "[object Object]" && n === (n >>> 0)) {
- return true //由于ecma262v5能修改对象属性的enumerable,因此不能用propertyIsEnumerable来判定了
- }
- }
- return false
-}
-/*视浏览器情况采用最快的异步回调(在avalon.ready里,还有一个分支,用于处理IE6-9)*/
-avalon.nextTick = window.setImmediate ? setImmediate.bind(window) : function(callback) {
- setTimeout(callback, 0) //IE10-11 or W3C
-}
-
-/*********************************************************************
- * DOM 底层补丁 *
- **********************************************************************/
-if (!root.contains) { //safari5+是把contains方法放在Element.prototype上而不是Node.prototype
- Node.prototype.contains = function(arg) {
- return !!(this.compareDocumentPosition(arg) & 16)
- }
-}
-avalon.contains = function(root, el) {
- try {
- while ((el = el.parentNode))
- if (el === root)
- return true;
- return false
- } catch (e) {
- return false
- }
-}
-if (window.SVGElement) {
- var svgns = "http://www.w3.org/2000/svg"
- var svg = DOC.createElementNS(svgns, "svg")
- svg.innerHTML = '<circle cx="50" cy="50" r="40" fill="red" />'
- if (!rsvg.test(svg.firstChild)) {// #409
-
- function enumerateNode(node, targetNode) {
- if (node && node.childNodes) {
- var nodes = node.childNodes
- for (var i = 0, el; el = nodes[i++]; ) {
- if (el.tagName) {
- var svg = DOC.createElementNS(svgns,
- el.tagName.toLowerCase())
- // copy attrs
- ap.forEach.call(el.attributes, function(attr) {
- svg.setAttribute(attr.name, attr.value)
- })
- // 递归处理子节点
- enumerateNode(el, svg)
- targetNode.appendChild(svg)
- }
- }
- }
- }
- Object.defineProperties(SVGElement.prototype, {
- "outerHTML": {//IE9-11,firefox不支持SVG元素的innerHTML,outerHTML属性
- enumerable: true,
- configurable: true,
- get: function() {
- return new XMLSerializer().serializeToString(this)
- },
- set: function(html) {
- var tagName = this.tagName.toLowerCase(),
- par = this.parentNode,
- frag = avalon.parseHTML(html)
- // 操作的svg,直接插入
- if (tagName === "svg") {
- par.insertBefore(frag, this)
- // svg节点的子节点类似
- } else {
- var newFrag = DOC.createDocumentFragment()
- enumerateNode(frag, newFrag)
- par.insertBefore(newFrag, this)
- }
- par.removeChild(this)
- }
- },
- "innerHTML": {
- enumerable: true,
- configurable: true,
- get: function() {
- var s = this.outerHTML
- var ropen = new RegExp("<" + this.nodeName + '\\b(?:(["\'])[^"]*?(\\1)|[^>])*>', "i")
- var rclose = new RegExp("<\/" + this.nodeName + ">$", "i")
- return s.replace(ropen, "").replace(rclose, "")
- },
- set: function(html) {
- if (avalon.clearHTML) {
- avalon.clearHTML(this)
- var frag = avalon.parseHTML(html)
- enumerateNode(frag, this)
- }
- }
- }
- })
- }
-}
-//========================= event binding ====================
-var eventHooks = avalon.eventHooks
-//针对firefox, chrome修正mouseenter, mouseleave(chrome30+)
-if (!("onmouseenter" in root)) {
- avalon.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout"
- }, function(origType, fixType) {
- eventHooks[origType] = {
- type: fixType,
- deel: function(elem, fn) {
- return function(e) {
- var t = e.relatedTarget
- if (!t || (t !== elem && !(elem.compareDocumentPosition(t) & 16))) {
- delete e.type
- e.type = origType
- return fn.call(elem, e)
- }
- }
- }
- }
- })
-}
-//针对IE9+, w3c修正animationend
-avalon.each({
- AnimationEvent: "animationend",
- WebKitAnimationEvent: "webkitAnimationEnd"
-}, function(construct, fixType) {
- if (window[construct] && !eventHooks.animationend) {
- eventHooks.animationend = {
- type: fixType
- }
- }
-})
-
-if (DOC.onmousewheel === void 0) {
- /* IE6-11 chrome mousewheel wheelDetla 下 -120 上 120
- firefox DOMMouseScroll detail 下3 上-3
- firefox wheel detlaY 下3 上-3
- IE9-11 wheel deltaY 下40 上-40
- chrome wheel deltaY 下100 上-100 */
- eventHooks.mousewheel = {
- type: "wheel",
- deel: function(elem, fn) {
- return function(e) {
- e.wheelDeltaY = e.wheelDelta = e.deltaY > 0 ? -120 : 120
- e.wheelDeltaX = 0
- Object.defineProperty(e, "type", {
- value: "mousewheel"
- })
- fn.call(elem, e)
- }
- }
- }
-}
-
-/*********************************************************************
- * 配置系统 *
- **********************************************************************/
-
-function kernel(settings) {
- for (var p in settings) {
- if (!ohasOwn.call(settings, p))
- continue
- var val = settings[p]
- if (typeof kernel.plugins[p] === "function") {
- kernel.plugins[p](val)
- } else if (typeof kernel[p] === "object") {
- avalon.mix(kernel[p], val)
- } else {
- kernel[p] = val
- }
- }
- return this
-}
-var openTag, closeTag, rexpr, rexprg, rbind, rregexp = /[-.*+?^${}()|[\]\/\\]/g
-
-function escapeRegExp(target) {
- //http://stevenlevithan.com/regex/xregexp/
- //将字符串安全格式化为正则表达式的源码
- return (target + "").replace(rregexp, "\\$&")
-}
-var innerRequire = noop
-var plugins = {
- loader: function(builtin) {
- window.define = builtin ? innerRequire.define : otherDefine
- window.require = builtin ? innerRequire : otherRequire
- },
- interpolate: function(array) {
- openTag = array[0]
- closeTag = array[1]
- if (openTag === closeTag) {
- throw new SyntaxError("openTag!==closeTag")
- } else if (array + "" === "<!--,-->") {
- kernel.commentInterpolate = true
- } else {
- var test = openTag + "test" + closeTag
- cinerator.innerHTML = test
- if (cinerator.innerHTML !== test && cinerator.innerHTML.indexOf("&lt;") > -1) {
- throw new SyntaxError("此定界符不合法")
- }
- cinerator.innerHTML = ""
- }
- var o = escapeRegExp(openTag),
- c = escapeRegExp(closeTag)
- rexpr = new RegExp(o + "(.*?)" + c)
- rexprg = new RegExp(o + "(.*?)" + c, "g")
- rbind = new RegExp(o + ".*?" + c + "|\\sms-")
- }
-}
-
-kernel.debug = true
-kernel.plugins = plugins
-kernel.plugins['interpolate'](["{{", "}}"])
-kernel.paths = {}
-kernel.shim = {}
-kernel.maxRepeatSize = 100
-avalon.config = kernel
-/*********************************************************************
- * 事件总线 *
- **********************************************************************/
-var EventBus = {
- $watch: function(type, callback) {
- if (typeof callback === "function") {
- var callbacks = this.$events[type]
- if (callbacks) {
- callbacks.push(callback)
- } else {
- this.$events[type] = [callback]
- }
- } else { //重新开始监听此VM的第一重简单属性的变动
- this.$events = this.$watch.backup
- }
- return this
- },
- $unwatch: function(type, callback) {
- var n = arguments.length
- if (n === 0) { //让此VM的所有$watch回调无效化
- this.$watch.backup = this.$events
- this.$events = {}
- } else if (n === 1) {
- this.$events[type] = []
- } else {
- var callbacks = this.$events[type] || []
- var i = callbacks.length
- while (~--i < 0) {
- if (callbacks[i] === callback) {
- return callbacks.splice(i, 1)
- }
- }
- }
- return this
- },
- $fire: function(type) {
- var special
- if (/^(\w+)!(\S+)$/.test(type)) {
- special = RegExp.$1
- type = RegExp.$2
- }
- var events = this.$events
- var args = aslice.call(arguments, 1)
- var detail = [type].concat(args)
- if (special === "all") {
- for (var i in avalon.vmodels) {
- var v = avalon.vmodels[i]
- if (v !== this) {
- v.$fire.apply(v, detail)
- }
- }
- } else if (special === "up" || special === "down") {
- var elements = events.expr ? findNodes(events.expr) : []
- if (elements.length === 0)
- return
- for (var i in avalon.vmodels) {
- var v = avalon.vmodels[i]
- if (v !== this) {
- if (v.$events.expr) {
- var eventNodes = findNodes(v.$events.expr)
- if (eventNodes.length === 0) {
- continue
- }
- //循环两个vmodel中的节点,查找匹配(向上匹配或者向下匹配)的节点并设置标识
- Array.prototype.forEach.call(eventNodes, function(node) {
- Array.prototype.forEach.call(elements, function(element) {
- var ok = special === "down" ? element.contains(node) : //向下捕获
- node.contains(element) //向上冒泡
-
- if (ok) {
- node._avalon = v //符合条件的加一个标识
- }
- });
- })
- }
- }
- }
- var nodes = DOC.getElementsByTagName("*") //实现节点排序
- var alls = []
- Array.prototype.forEach.call(nodes, function(el) {
- if (el._avalon) {
- alls.push(el._avalon)
- el._avalon = ""
- el.removeAttribute("_avalon")
- }
- })
- if (special === "up") {
- alls.reverse()
- }
- for (var i = 0, el; el = alls[i++]; ) {
- if (el.$fire.apply(el, detail) === false) {
- break
- }
- }
- } else {
- var callbacks = events[type] || []
- var all = events.$all || []
- for (var i = 0, callback; callback = callbacks[i++]; ) {
- if (isFunction(callback))
- callback.apply(this, args)
- }
- for (var i = 0, callback; callback = all[i++]; ) {
- if (isFunction(callback))
- callback.apply(this, arguments)
- }
- }
- }
-}
-
-var ravalon = /(\w+)\[(avalonctrl)="(\S+)"\]/
-var findNodes = function(str) {
- //pc safari v5.1: typeof DOC.querySelectorAll(str) === 'function'
- //https://gist.github.com/DavidBruant/1016007
- return DOC.querySelectorAll(str)
-}
-/*********************************************************************
- * modelFactory *
- **********************************************************************/
-//avalon最核心的方法的两个方法之一(另一个是avalon.scan),返回一个ViewModel(VM)
-var VMODELS = avalon.vmodels = {} //所有vmodel都储存在这里
-avalon.define = function(id, factory) {
- var $id = id.$id || id
- if (!$id) {
- log("warning: vm必须指定$id")
- }
- if (VMODELS[$id]) {
- log("warning: " + $id + " 已经存在于avalon.vmodels中")
- }
- if (typeof id === "object") {
- var model = modelFactory(id)
- } else {
- var scope = {
- $watch: noop
- }
- factory(scope) //得到所有定义
- model = modelFactory(scope) //偷天换日,将scope换为model
- stopRepeatAssign = true
- factory(model)
- stopRepeatAssign = false
- }
- model.$id = $id
- return VMODELS[$id] = model
-}
-
-//一些不需要被监听的属性
-var $$skipArray = String("$id,$watch,$unwatch,$fire,$events,$model,$skipArray").match(rword)
-
-function isObservable(name, value, $skipArray) {
- if (isFunction(value) || value && value.nodeType) {
- return false
- }
- if ($skipArray.indexOf(name) !== -1) {
- return false
- }
- if ($$skipArray.indexOf(name) !== -1) {
- return false
- }
- var $special = $skipArray.$special
- if (name && name.charAt(0) === "$" && !$special[name]) {
- return false
- }
- return true
-}
-//ms-with,ms-each, ms-repeat绑定生成的代理对象储存池
-var midway = {}
-function getNewValue(accessor, name, value, $vmodel) {
- switch (accessor.type) {
- case 0://计算属性
- var getter = accessor.get
- var setter = accessor.set
- if (isFunction(setter)) {
- var $events = $vmodel.$events
- var lock = $events[name]
- $events[name] = [] //清空回调,防止内部冒泡而触发多次$fire
- setter.call($vmodel, value)
- $events[name] = lock
- }
- return getter.call($vmodel) //同步$model
- case 1://监控属性
- return value
- case 2://对象属性(包括数组与哈希)
- if (value !== $vmodel.$model[name]) {
- var svmodel = accessor.svmodel = objectFactory($vmodel, name, value, accessor.valueType)
- value = svmodel.$model //同步$model
- var fn = midway[svmodel.$id]
- fn && fn() //同步视图
- }
- return value
- }
-}
-
-var defineProperty = Object.defineProperty
-var canHideOwn = true
-//如果浏览器不支持ecma262v5的Object.defineProperties或者存在BUG,比如IE8
-//标准浏览器使用__defineGetter__, __defineSetter__实现
-try {
- defineProperty({}, "_", {
- value: "x"
- })
- var defineProperties = Object.defineProperties
-} catch (e) {
- canHideOwn = false
-}
-function modelFactory(source, $special, $model) {
- if (Array.isArray(source)) {
- var arr = source.concat()
- source.length = 0
- var collection = Collection(source)
- collection.pushArray(arr)
- return collection
- }
- if (typeof source.nodeType === "number") {
- return source
- }
- if (source.$id && source.$events) { //fix IE6-8 createWithProxy $val: val引发的BUG
- return source
- }
- if (!Array.isArray(source.$skipArray)) {
- source.$skipArray = []
- }
- source.$skipArray.$special = $special || {} //强制要监听的属性
- var $vmodel = {} //要返回的对象, 它在IE6-8下可能被偷龙转凤
- $model = $model || {} //vmodels.$model属性
- var $events = {} //vmodel.$events属性
- var watchedProperties = {} //监控属性
- var initCallbacks = [] //初始化才执行的函数
- for (var i in source) {
- (function(name, val) {
- $model[name] = val
- if (!isObservable(name, val, source.$skipArray)) {
- return //过滤所有非监控属性
- }
- //总共产生三种accessor
- $events[name] = []
- var valueType = avalon.type(val)
- var accessor = function(newValue) {
- var name = accessor._name
- var $vmodel = this
- var $model = $vmodel.$model
- var oldValue = $model[name]
- var $events = $vmodel.$events
-
- if (arguments.length) {
- if (stopRepeatAssign) {
- return
- }
- //计算属性与对象属性需要重新计算newValue
- if (accessor.type !== 1) {
- newValue = getNewValue(accessor, name, newValue, $vmodel)
- }
- if (!isEqual(oldValue, newValue)) {
- $model[name] = newValue
- if ($events.$digest) {
- if(accessor.pedding)
- return
- accessor.pedding = true
- setTimeout(function() {
- notifySubscribers($events[name]) //同步视图
- safeFire($vmodel, name, $model[name], oldValue) //触发$watch回调
- accessor.pedding = false
- })
- } else {
- notifySubscribers($events[name]) //同步视图
- safeFire($vmodel, name, newValue, oldValue) //触发$watch回调
- }
- }
- } else {
- if (accessor.type === 0) { //type 0 计算属性 1 监控属性 2 对象属性
- //计算属性不需要收集视图刷新函数,都是由其他监控属性代劳
- return $model[name] = accessor.get.call($vmodel)
- } else {
- collectSubscribers($events[name]) //收集视图函数
- return accessor.svmodel || oldValue
- }
- }
- }
- //总共产生三种accessor
- if (valueType === "object" && isFunction(val.get) && Object.keys(val).length <= 2) {
- //第1种为计算属性, 因变量,通过其他监控属性触发其改变
- accessor.set = val.set
- accessor.get = val.get
- accessor.type = 0
- initCallbacks.push(function() {
- var data = {
- evaluator: function() {
- data.element = null
- data.type = new Date - 0
- $model[name] = accessor.get.call($vmodel)
- },
- element: head,
- type: new Date - 0,
- handler: noop,
- args: []
- }
- Registry[expose] = data
- accessor.call($vmodel)
- delete Registry[expose]
- })
- } else if (rcomplexType.test(valueType)) {
- //第2种为对象属性,产生子VM与监控数组
- accessor.type = 2
- accessor.valueType = val.valueType
- initCallbacks.push(function() {
- var svmodel = modelFactory(val, 0, $model[name])
- accessor.svmodel = svmodel
- svmodel.$events[subscribers] = $events[name]
- })
- } else {
- accessor.type = 1
- //第3种为监控属性,对应简单的数据类型,自变量
- }
- accessor._name = name
- watchedProperties[name] = accessor
- })(i, source[i])
- }
-
- $$skipArray.forEach(function(name) {
- delete source[name]
- delete $model[name] //这些特殊属性不应该在$model中出现
- })
-
- $vmodel = defineProperties($vmodel, descriptorFactory(watchedProperties), source) //生成一个空的ViewModel
- for (var name in source) {
- if (!watchedProperties[name]) {
- $vmodel[name] = source[name]
- }
- }
- //添加$id, $model, $events, $watch, $unwatch, $fire
- $vmodel.$id = generateID()
- $vmodel.$model = $model
- $vmodel.$events = $events
- for (var i in EventBus) {
- var fn = EventBus[i]
- if (!W3C) { //在IE6-8下,VB对象的方法里的this并不指向自身,需要用bind处理一下
- fn = fn.bind($vmodel)
- }
- $vmodel[i] = fn
- }
-
- if (canHideOwn) {
- Object.defineProperty($vmodel, "hasOwnProperty", {
- value: function(name) {
- return name in this.$model
- },
- writable: false,
- enumerable: false,
- configurable: true
- })
-
- } else {
- $vmodel.hasOwnProperty = function(name) {
- return name in $vmodel.$model
- }
- }
- initCallbacks.forEach(function(cb) { //收集依赖
- cb()
- })
- return $vmodel
-}
-
-//比较两个值是否相等
-var isEqual = Object.is || function(v1, v2) {
- if (v1 === 0 && v2 === 0) {
- return 1 / v1 === 1 / v2
- } else if (v1 !== v1) {
- return v2 !== v2
- } else {
- return v1 === v2
- }
-}
-
-function safeFire(a, b, c, d) {
- if (a.$events) {
- EventBus.$fire.call(a, b, c, d)
- }
-}
-
-var descriptorFactory = W3C ? function(obj) {
- var descriptors = {}
- for (var i in obj) {
- descriptors[i] = {
- get: obj[i],
- set: obj[i],
- enumerable: true,
- configurable: true
- }
- }
- return descriptors
-} : function(a) {
- return a
-}
-
-
-
-//应用于第2种accessor
-function objectFactory(parent, name, value, valueType) {
- //a为原来的VM, b为新数组或新对象
- var son = parent[name]
- if (valueType === "array") {
- if (!Array.isArray(value) || son === value) {
- return son //fix https://github.com/RubyLouvre/avalon/issues/261
- }
- son.clear()
- son.pushArray(value.concat())
- return son
- } else {
- var iterators = parent.$events[name]
- var pool = son.$events.$withProxyPool
- if (pool) {
- recycleProxies(pool, "with")
- son.$events.$withProxyPool = null
- }
- var ret = modelFactory(value)
- ret.$events[subscribers] = iterators
- midway[ret.$id] = function(data) {
- while (data = iterators.shift()) {
- (function(el) {
- avalon.nextTick(function() {
- if (el.type) { //重新绑定
- el.rollback && el.rollback() //还原 ms-with ms-on
- bindingHandlers[el.type](el, el.vmodels)
- }
- })
- })(data)
- }
- delete midway[ret.$id]
- }
- return ret
- }
-}
-/*********************************************************************
- * 监控数组(与ms-each, ms-repeat配合使用) *
- **********************************************************************/
-
-function Collection(model) {
- var array = []
- array.$id = generateID()
- array.$model = model //数据模型
- array.$events = {}
- array.$events[subscribers] = []
- array._ = modelFactory({
- length: model.length
- })
- array._.$watch("length", function(a, b) {
- array.$fire("length", a, b)
- })
- for (var i in EventBus) {
- array[i] = EventBus[i]
- }
- avalon.mix(array, CollectionPrototype)
- return array
-}
-
-function mutateArray(method, pos, n, index, method2, pos2, n2) {
- var oldLen = this.length, loop = 2
- while (--loop) {
- switch (method) {
- case "add":
- var array = this.$model.slice(pos, pos + n).map(function(el) {
- if (rcomplexType.test(avalon.type(el))) {
- return el.$id ? el : modelFactory(el, 0, el)
- } else {
- return el
- }
- })
- _splice.apply(this, [pos, 0].concat(array))
- this._fire("add", pos, n)
- break
- case "del":
- var ret = this._splice(pos, n)
- this._fire("del", pos, n)
- break
- }
- if (method2) {
- method = method2
- pos = pos2
- n = n2
- loop = 2
- method2 = 0
- }
- }
- this._fire("index", index)
- if (this.length !== oldLen) {
- this._.length = this.length
- }
- return ret
-}
-
-var _splice = ap.splice
-var CollectionPrototype = {
- _splice: _splice,
- _fire: function(method, a, b) {
- var list = this.$events[subscribers]
- for (var i = 0, fn; fn = list[i++]; ) {
- if (fn.$repeat) {
- fn.handler.call(fn, method, a, b) //处理监控数组的方法
- }
- }
- },
- size: function() { //取得数组长度,这个函数可以同步视图,length不能
- return this._.length
- },
- pushArray: function(array) {
- var m = array.length, n = this.length
- if (m) {
- ap.push.apply(this.$model, array)
- mutateArray.call(this, "add", n, m, n)
- }
- return m + n
- },
- push: function() {
- //http://jsperf.com/closure-with-arguments
- var array = []
- var i, n = arguments.length
- for (i = 0; i < n; i++) {
- array[i] = arguments[i]
- }
- return this.pushArray(arguments)
- },
- unshift: function() {
- var m = arguments.length, n = this.length
- if (m) {
- ap.unshift.apply(this.$model, arguments)
- mutateArray.call(this, "add", 0, m, 0)
- }
- return m + n //IE67的unshift不会返回长度
- },
- shift: function() {
- if (this.length) {
- var el = this.$model.shift()
- mutateArray.call(this, "del", 0, 1, 0)
- return el //返回被移除的元素
- }
- },
- pop: function() {
- var m = this.length
- if (m) {
- var el = this.$model.pop()
- mutateArray.call(this, "del", m - 1, 1, Math.max(0, m - 2))
- return el //返回被移除的元素
- }
- },
- splice: function(start) {
- var m = arguments.length, args = [], change
- var removed = _splice.apply(this.$model, arguments)
- if (removed.length) { //如果用户删掉了元素
- args.push("del", start, removed.length, 0)
- change = true
- }
- if (m > 2) { //如果用户添加了元素
- args.splice(3, 1, 0, "add", start, m - 2)
- change = true
- }
- if (change) { //返回被移除的元素
- return mutateArray.apply(this, args)
- } else {
- return []
- }
- },
- contains: function(el) { //判定是否包含
- return this.indexOf(el) !== -1
- },
- remove: function(el) { //移除第一个等于给定值的元素
- return this.removeAt(this.indexOf(el))
- },
- removeAt: function(index) { //移除指定索引上的元素
- if (index >= 0) {
- this.$model.splice(index, 1)
- return mutateArray.call(this, "del", index, 1, 0)
- }
- return []
- },
- clear: function() {
- this.$model.length = this.length = this._.length = 0 //清空数组
- this._fire("clear", 0)
- return this
- },
- removeAll: function(all) { //移除N个元素
- if (Array.isArray(all)) {
- all.forEach(function(el) {
- this.remove(el)
- }, this)
- } else if (typeof all === "function") {
- for (var i = this.length - 1; i >= 0; i--) {
- var el = this[i]
- if (all(el, i)) {
- this.removeAt(i)
- }
- }
- } else {
- this.clear()
- }
- },
- ensure: function(el) {
- if (!this.contains(el)) { //只有不存在才push
- this.push(el)
- }
- return this
- },
- set: function(index, val) {
- if (index >= 0) {
- var valueType = avalon.type(val)
- if (val && val.$model) {
- val = val.$model
- }
- var target = this[index]
- if (valueType === "object") {
- for (var i in val) {
- if (target.hasOwnProperty(i)) {
- target[i] = val[i]
- }
- }
- } else if (valueType === "array") {
- target.clear().push.apply(target, val)
- } else if (target !== val) {
- this[index] = val
- this.$model[index] = val
- this._fire("set", index, val)
- }
- }
- return this
- }
-}
-
-function sortByIndex(array, indexes) {
- var map = {};
- for (var i = 0, n = indexes.length; i < n; i++) {
- map[i] = array[i] // preserve
- var j = indexes[i]
- if (j in map) {
- array[i] = map[j]
- delete map[j]
- } else {
- array[i] = array[j]
- }
- }
-}
-
-"sort,reverse".replace(rword, function(method) {
- CollectionPrototype[method] = function() {
- var newArray = this.$model//这是要排序的新数组
- var oldArray = newArray.concat() //保持原来状态的旧数组
- var mask = Math.random()
- var indexes = []
- var hasSort
- ap[method].apply(newArray, arguments) //排序
- for (var i = 0, n = oldArray.length; i < n; i++) {
- var neo = newArray[i]
- var old = oldArray[i]
- if (isEqual(neo, old)) {
- indexes.push(i)
- } else {
- var index = oldArray.indexOf(neo)
- indexes.push(index)//得到新数组的每个元素在旧数组对应的位置
- oldArray[index] = mask //屏蔽已经找过的元素
- hasSort = true
- }
- }
- if (hasSort) {
- sortByIndex(this, indexes)
- this._fire("move", indexes)
- this._fire("index", 0)
- }
- return this
- }
-})
-
-/*********************************************************************
- * 依赖调度系统 *
- **********************************************************************/
-var ronduplex = /^(duplex|on)$/
-
-function registerSubscriber(data) {
- Registry[expose] = data //暴光此函数,方便collectSubscribers收集
- avalon.openComputedCollect = true
- var fn = data.evaluator
- if (fn) { //如果是求值函数
- try {
- var c = ronduplex.test(data.type) ? data : fn.apply(0, data.args)
- data.handler(c, data.element, data)
- } catch (e) {
- //log("warning:exception throwed in [registerSubscriber] " + e)
- delete data.evaluator
- var node = data.element
- if (node.nodeType === 3) {
- var parent = node.parentNode
- if (kernel.commentInterpolate) {
- parent.replaceChild(DOC.createComment(data.value), node)
- } else {
- node.data = openTag + data.value + closeTag
- }
- }
- }
- }
- avalon.openComputedCollect = false
- delete Registry[expose]
-}
-
-function collectSubscribers(list) { //收集依赖于这个访问器的订阅者
- var data = Registry[expose]
- if (list && data && avalon.Array.ensure(list, data) && data.element) { //只有数组不存在此元素才push进去
- addSubscribers(data, list)
- }
-}
-
-
-function addSubscribers(data, list) {
- data.$uuid = data.$uuid || generateID()
- list.$uuid = list.$uuid || generateID()
- var obj = {
- data: data,
- list: list,
- $$uuid: data.$uuid + list.$uuid
- }
- if (!$$subscribers[obj.$$uuid]) {
- $$subscribers[obj.$$uuid] = 1
- $$subscribers.push(obj)
- }
-}
-
-function disposeData(data) {
- data.element = null
- data.rollback && data.rollback()
- for (var key in data) {
- data[key] = null
- }
-}
-
-function isRemove(el) {
- try {//IE下,如果文本节点脱离DOM树,访问parentNode会报错
- if (!el.parentNode) {
- return true
- }
- } catch (e) {
- return true
- }
- return el.msRetain ? 0 : (el.nodeType === 1 ? typeof el.sourceIndex === "number" ?
- el.sourceIndex === 0 : !root.contains(el) : !avalon.contains(root, el))
-}
-var $$subscribers = avalon.$$subscribers = []
-var beginTime = new Date()
-var oldInfo = {}
-function removeSubscribers() {
- var i = $$subscribers.length
- var n = i
- var k = 0
- var obj
- var types = []
- var newInfo = {}
- var needTest = {}
- while (obj = $$subscribers[--i]) {
- var data = obj.data
- var type = data.type
- if (newInfo[type]) {
- newInfo[type]++
- } else {
- newInfo[type] = 1
- types.push(type)
- }
- }
- var diff = false
- types.forEach(function(type) {
- if (oldInfo[type] !== newInfo[type]) {
- needTest[type] = 1
- diff = true
- }
- })
- i = n
- //avalon.log("需要检测的个数 " + i)
- if (diff) {
- //avalon.log("有需要移除的元素")
- while (obj = $$subscribers[--i]) {
- var data = obj.data
- if (data.element === void 0)
- continue
- if (needTest[data.type] && isRemove(data.element)) { //如果它没有在DOM树
- k++
- $$subscribers.splice(i, 1)
- delete $$subscribers[obj.$$uuid]
- avalon.Array.remove(obj.list, data)
- //log("debug: remove " + data.type)
- disposeData(data)
- obj.data = obj.list = null
- }
- }
- }
- oldInfo = newInfo
- // avalon.log("已经移除的个数 " + k)
- beginTime = new Date()
-}
-
-function notifySubscribers(list) { //通知依赖于这个访问器的订阅者更新自身
- if (list && list.length) {
- if (new Date() - beginTime > 444 && typeof list[0] === "object") {
- removeSubscribers()
- }
- var args = aslice.call(arguments, 1)
- for (var i = list.length, fn; fn = list[--i]; ) {
- var el = fn.element
- if (el && el.parentNode) {
- if (fn.$repeat) {
- fn.handler.apply(fn, args) //处理监控数组的方法
- } else if (fn.type !== "on") { //事件绑定只能由用户触发,不能由程序触发
- var fun = fn.evaluator || noop
- fn.handler(fun.apply(0, fn.args || []), el, fn)
- }
- }
- }
- }
-}
-
-/************************************************************************
- * HTML处理(parseHTML, innerHTML, clearHTML) *
- **************************************************************************/
-//parseHTML的辅助变量
-var tagHooks = new function() {
- avalon.mix(this, {
- option: DOC.createElement("select"),
- thead: DOC.createElement("table"),
- td: DOC.createElement("tr"),
- area: DOC.createElement("map"),
- tr: DOC.createElement("tbody"),
- col: DOC.createElement("colgroup"),
- legend: DOC.createElement("fieldset"),
- _default: DOC.createElement("div"),
- "g": DOC.createElementNS("http://www.w3.org/2000/svg", "svg")
- })
- this.optgroup = this.option
- this.tbody = this.tfoot = this.colgroup = this.caption = this.thead
- this.th = this.td
-}
-
-tagHooks.optgroup = tagHooks.option
-tagHooks.tbody = tagHooks.tfoot = tagHooks.colgroup = tagHooks.caption = tagHooks.thead
-tagHooks.th = tagHooks.td
-
-String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(rword, function(tag) {
- tagHooks[tag] = tagHooks.g //处理SVG
-})
-var rtagName = /<([\w:]+)/
-var rxhtml = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig
-var scriptTypes = oneObject(["", "text/javascript", "text/ecmascript", "application/ecmascript", "application/javascript"])
-var script = DOC.createElement("script")
-
-avalon.parseHTML = function(html) {
- if (typeof html !== "string") {
- html = html + ""
- }
- html = html.replace(rxhtml, "<$1></$2>").trim()
- var tag = (rtagName.exec(html) || ["", ""])[1].toLowerCase(),
- //取得其标签名
- wrapper = tagHooks[tag] || tagHooks._default,
- fragment = hyperspace.cloneNode(false),
- firstChild
- wrapper.innerHTML = html
- var els = wrapper.getElementsByTagName("script")
- if (els.length) { //使用innerHTML生成的script节点不会发出请求与执行text属性
- for (var i = 0, el; el = els[i++]; ) {
- if (scriptTypes[el.type]) {
- var neo = script.cloneNode(false) //FF不能省略参数
- ap.forEach.call(el.attributes, function(attr) {
- neo.setAttribute(attr.name, attr.value)
- })
- neo.text = el.text
- el.parentNode.replaceChild(neo, el)
- }
- }
- }
-
- while (firstChild = wrapper.firstChild) { // 将wrapper上的节点转移到文档碎片上!
- fragment.appendChild(firstChild)
- }
- return fragment
-}
-
-avalon.innerHTML = function(node, html) {
- var a = this.parseHTML(html)
- this.clearHTML(node).appendChild(a)
-}
-
-avalon.clearHTML = function(node) {
- node.textContent = ""
- while (node.firstChild) {
- node.removeChild(node.firstChild)
- }
- return node
-}
-/*********************************************************************
- * 扫描系统 *
- **********************************************************************/
-
-avalon.scan = function(elem, vmodel, group) {
- elem = elem || root
- var vmodels = vmodel ? [].concat(vmodel) : []
- scanTag(elem, vmodels)
-}
-
-//http://www.w3.org/TR/html5/syntax.html#void-elements
-var stopScan = oneObject("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase())
-
-function checkScan(elem, callback, innerHTML) {
- var id = setTimeout(function() {
- var currHTML = elem.innerHTML
- clearTimeout(id)
- if (currHTML === innerHTML) {
- callback()
- } else {
- checkScan(elem, callback, currHTML)
- }
- })
-}
-
-
-function createSignalTower(elem, vmodel) {
- var id = elem.getAttribute("avalonctrl") || vmodel.$id
- elem.setAttribute("avalonctrl", id)
- vmodel.$events.expr = elem.tagName + '[avalonctrl="' + id + '"]'
-}
-
-var getBindingCallback = function(elem, name, vmodels) {
- var callback = elem.getAttribute(name)
- if (callback) {
- for (var i = 0, vm; vm = vmodels[i++]; ) {
- if (vm.hasOwnProperty(callback) && typeof vm[callback] === "function") {
- return vm[callback]
- }
- }
- }
-}
-
-function executeBindings(bindings, vmodels) {
- for (var i = 0, data; data = bindings[i++]; ) {
- data.vmodels = vmodels
- bindingHandlers[data.type](data, vmodels)
- if (data.evaluator && data.element && data.element.nodeType === 1) { //移除数据绑定,防止被二次解析
- //chrome使用removeAttributeNode移除不存在的特性节点时会报错 https://github.com/RubyLouvre/avalon/issues/99
- data.element.removeAttribute(data.name)
- }
- }
- bindings.length = 0
-}
-
-//https://github.com/RubyLouvre/avalon/issues/636
-var mergeTextNodes = IEVersion && window.MutationObserver ? function (elem) {
- var node = elem.firstChild, text
- while (node) {
- var aaa = node.nextSibling
- if (node.nodeType === 3) {
- if (text) {
- text.nodeValue += node.nodeValue
- elem.removeChild(node)
- } else {
- text = node
- }
- } else {
- text = null
- }
- node = aaa
- }
-} : 0
-
-var rmsAttr = /ms-(\w+)-?(.*)/
-var priorityMap = {
- "if": 10,
- "repeat": 90,
- "data": 100,
- "widget": 110,
- "each": 1400,
- "with": 1500,
- "duplex": 2000,
- "on": 3000
-}
-
-var events = oneObject("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit")
-var obsoleteAttrs = oneObject("value,title,alt,checked,selected,disabled,readonly,enabled")
-function bindingSorter(a, b) {
- return a.priority - b.priority
-}
-
-function scanTag(elem, vmodels, node) {
- //扫描顺序 ms-skip(0) --> ms-important(1) --> ms-controller(2) --> ms-if(10) --> ms-repeat(100)
- //--> ms-if-loop(110) --> ms-attr(970) ...--> ms-each(1400)-->ms-with(1500)--〉ms-duplex(2000)垫后
- var a = elem.getAttribute("ms-skip")
- var b = elem.getAttributeNode("ms-important")
- var c = elem.getAttributeNode("ms-controller")
- if (typeof a === "string") {
- return
- } else if (node = b || c) {
- var newVmodel = avalon.vmodels[node.value]
- if (!newVmodel) {
- return
- }
- //ms-important不包含父VM,ms-controller相反
- vmodels = node === b ? [newVmodel] : [newVmodel].concat(vmodels)
- elem.removeAttribute(node.name) //removeAttributeNode不会刷新[ms-controller]样式规则
- elem.classList.remove(node.name)
- createSignalTower(elem, newVmodel)
- }
- scanAttr(elem, vmodels) //扫描特性节点
-}
-function scanNodeList(parent, vmodels) {
- var node = parent.firstChild
- while (node) {
- var nextNode = node.nextSibling
- scanNode(node, node.nodeType, vmodels)
- node = nextNode
- }
-}
-
-function scanNodeArray(nodes, vmodels) {
- for (var i = 0, node; node = nodes[i++]; ) {
- scanNode(node, node.nodeType, vmodels)
- }
-}
-function scanNode(node, nodeType, vmodels) {
- if (nodeType === 1) {
- scanTag(node, vmodels) //扫描元素节点
- } else if (nodeType === 3 && rexpr.test(node.data)){
- scanText(node, vmodels) //扫描文本节点
- } else if (kernel.commentInterpolate && nodeType === 8 && !rexpr.test(node.nodeValue)) {
- scanText(node, vmodels) //扫描注释节点
- }
-}
-function scanAttr(elem, vmodels) {
- //防止setAttribute, removeAttribute时 attributes自动被同步,导致for循环出错
- var attributes = elem.hasAttributes() ? avalon.slice(elem.attributes) : []
- var bindings = [],
- msData = {},
- match
- for (var i = 0, attr; attr = attributes[i++]; ) {
- if (attr.specified) {
- if (match = attr.name.match(rmsAttr)) {
- //如果是以指定前缀命名的
- var type = match[1]
- var param = match[2] || ""
- var value = attr.value
- var name = attr.name
- msData[name] = value
- if (events[type]) {
- param = type
- type = "on"
- } else if (obsoleteAttrs[type]) {
- log("ms-" + type + "已经被废弃,请使用ms-attr-*代替")
- if (type === "enabled") {//吃掉ms-enabled绑定,用ms-disabled代替
- type = "disabled"
- value = "!(" + value + ")"
- }
- param = type
- type = "attr"
- elem.removeAttribute(name)
- name = "ms-attr-" + param
- elem.setAttribute(name, value)
- match = [name]
- msData[name] = value
- }
- if (typeof bindingHandlers[type] === "function") {
- var binding = {
- type: type,
- param: param,
- element: elem,
- name: match[0],
- value: value,
- priority: type in priorityMap ? priorityMap[type] : type.charCodeAt(0) * 10 + (Number(param) || 0)
- }
- if (type === "html" || type === "text") {
- var token = getToken(value)
- avalon.mix(binding, token)
- binding.filters = binding.filters.replace(rhasHtml, function() {
- binding.type = "html"
- binding.group = 1
- return ""
- })
- }
- if (name === "ms-if-loop") {
- binding.priority += 100
- }
- if (vmodels.length) {
- bindings.push(binding)
- if (type === "widget") {
- elem.msData = elem.msData || msData
- }
- }
- }
- }
- }
- }
- if (msData["ms-attr-checked"] && msData["ms-duplex"]) {
- log("warning!一个元素上不能同时定义ms-attr-checked与ms-duplex")
- }
- bindings.sort(bindingSorter)
- var scanNode = true
- for (var i = 0, binding; binding = bindings[i]; i++) {
- var type = binding.type
- if (rnoscanAttrBinding.test(type)) {
- return executeBindings(bindings.slice(0, i + 1), vmodels)
- } else if (scanNode) {
- scanNode = !rnoscanNodeBinding.test(type)
- }
- }
- executeBindings(bindings, vmodels)
- if (scanNode && !stopScan[elem.tagName] && rbind.test(elem.innerHTML + elem.textContent)) {
- mergeTextNodes && mergeTextNodes(elem)
- scanNodeList(elem, vmodels) //扫描子孙元素
- }
-}
-
-var rnoscanAttrBinding = /^if|widget|repeat$/
-var rnoscanNodeBinding = /^each|with|html|include$/
-var rhasHtml = /\|\s*html\s*/,
- r11a = /\|\|/g,
- rlt = /&lt;/g,
- rgt = /&gt;/g
-
-function getToken(value) {
- if (value.indexOf("|") > 0) {
- var index = value.replace(r11a, "\u1122\u3344").indexOf("|") //干掉所有短路或
- if (index > -1) {
- return {
- filters: value.slice(index),
- value: value.slice(0, index),
- expr: true
- }
- }
- }
- return {
- value: value,
- filters: "",
- expr: true
- }
-}
-
-function scanExpr(str) {
- var tokens = [],
- value, start = 0,
- stop
- do {
- stop = str.indexOf(openTag, start)
- if (stop === -1) {
- break
- }
- value = str.slice(start, stop)
- if (value) { // {{ 左边的文本
- tokens.push({
- value: value,
- filters: "",
- expr: false
- })
- }
- start = stop + openTag.length
- stop = str.indexOf(closeTag, start)
- if (stop === -1) {
- break
- }
- value = str.slice(start, stop)
- if (value) { //处理{{ }}插值表达式
- tokens.push(getToken(value))
- }
- start = stop + closeTag.length
- } while (1)
- value = str.slice(start)
- if (value) { //}} 右边的文本
- tokens.push({
- value: value,
- expr: false,
- filters: ""
- })
- }
- return tokens
-}
-
-function scanText(textNode, vmodels) {
- var bindings = []
- if (textNode.nodeType === 8) {
- var token = getToken(textNode.nodeValue)
- var tokens = [token]
- } else {
- tokens = scanExpr(textNode.data)
- }
- if (tokens.length) {
- for (var i = 0, token; token = tokens[i++]; ) {
- var node = DOC.createTextNode(token.value) //将文本转换为文本节点,并替换原来的文本节点
- if (token.expr) {
- token.type = "text"
- token.element = node
- token.filters = token.filters.replace(rhasHtml, function() {
- token.type = "html"
- token.group = 1
- return ""
- })
- bindings.push(token) //收集带有插值表达式的文本
- }
- hyperspace.appendChild(node)
- }
- textNode.parentNode.replaceChild(hyperspace, textNode)
- if (bindings.length)
- executeBindings(bindings, vmodels)
- }
-}
-
-
-/*********************************************************************
- * avalon的原型方法定义区 *
- **********************************************************************/
-function hyphen(target) {
- //转换为连字符线风格
- return target.replace(/([a-z\d])([A-Z]+)/g, "$1-$2").toLowerCase()
-}
-function camelize(target) {
- //转换为驼峰风格
- if (target.indexOf("-") < 0 && target.indexOf("_") < 0) {
- return target //提前判断,提高getStyle等的效率
- }
- return target.replace(/[-_][^-_]/g, function(match) {
- return match.charAt(1).toUpperCase()
- })
-}
-
-"add,remove".replace(rword, function(method) {
- avalon.fn[method + "Class"] = function(cls) {
- var el = this[0]
- //https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/26
- if (cls && typeof cls === "string" && el && el.nodeType === 1) {
- cls.replace(/\S+/g, function(c) {
- el.classList[method](c)
- })
- }
- return this
- }
-})
-
-avalon.fn.mix({
- hasClass: function(cls) {
- var el = this[0] || {} //IE10+, chrome8+, firefox3.6+, safari5.1+,opera11.5+支持classList,chrome24+,firefox26+支持classList2.0
- return el.nodeType === 1 && el.classList.contains(cls)
- },
- toggleClass: function(value, stateVal) {
- var className, i = 0
- var classNames = value.split(/\s+/)
- var isBool = typeof stateVal === "boolean"
- while ((className = classNames[i++])) {
- var state = isBool ? stateVal : !this.hasClass(className)
- this[state ? "addClass" : "removeClass"](className)
- }
- return this
- },
- attr: function(name, value) {
- if (arguments.length === 2) {
- this[0].setAttribute(name, value)
- return this
- } else {
- return this[0].getAttribute(name)
- }
- },
- data: function(name, value) {
- name = "data-" + hyphen(name || "")
- switch (arguments.length) {
- case 2:
- this.attr(name, value)
- return this
- case 1:
- var val = this.attr(name)
- return parseData(val)
- case 0:
- var ret = {}
- ap.forEach.call(this[0].attributes, function(attr) {
- if (attr) {
- name = attr.name
- if (!name.indexOf("data-")) {
- name = camelize(name.slice(5))
- ret[name] = parseData(attr.value)
- }
- }
- })
- return ret
- }
- },
- removeData: function(name) {
- name = "data-" + hyphen(name)
- this[0].removeAttribute(name)
- return this
- },
- css: function(name, value) {
- if (avalon.isPlainObject(name)) {
- for (var i in name) {
- avalon.css(this, i, name[i])
- }
- } else {
- var ret = avalon.css(this, name, value)
- }
- return ret !== void 0 ? ret : this
- },
- position: function() {
- var offsetParent, offset,
- elem = this[0],
- parentOffset = {
- top: 0,
- left: 0
- };
- if (!elem) {
- return
- }
- if (this.css("position") === "fixed") {
- offset = elem.getBoundingClientRect()
- } else {
- offsetParent = this.offsetParent() //得到真正的offsetParent
- offset = this.offset() // 得到正确的offsetParent
- if (offsetParent[0].tagName !== "HTML") {
- parentOffset = offsetParent.offset()
- }
- parentOffset.top += avalon.css(offsetParent[0], "borderTopWidth", true)
- parentOffset.left += avalon.css(offsetParent[0], "borderLeftWidth", true)
- }
- return {
- top: offset.top - parentOffset.top - avalon.css(elem, "marginTop", true),
- left: offset.left - parentOffset.left - avalon.css(elem, "marginLeft", true)
- }
- },
- offsetParent: function() {
- var offsetParent = this[0].offsetParent
- while (offsetParent && avalon.css(offsetParent, "position") === "static") {
- offsetParent = offsetParent.offsetParent;
- }
- return avalon(offsetParent)
- },
- bind: function(type, fn, phase) {
- if (this[0]) { //此方法不会链
- return avalon.bind(this[0], type, fn, phase)
- }
- },
- unbind: function(type, fn, phase) {
- if (this[0]) {
- avalon.unbind(this[0], type, fn, phase)
- }
- return this
- },
- val: function(value) {
- var node = this[0]
- if (node && node.nodeType === 1) {
- var get = arguments.length === 0
- var access = get ? ":get" : ":set"
- var fn = valHooks[getValType(node) + access]
- if (fn) {
- var val = fn(node, value)
- } else if (get) {
- return (node.value || "").replace(/\r/g, "")
- } else {
- node.value = value
- }
- }
- return get ? val : this
- }
-})
-
-if (root.dataset) {
- avalon.fn.data = function(name, val) {
- var dataset = this[0].dataset
- switch (arguments.length) {
- case 2:
- dataset[name] = val
- return this
- case 1:
- val = dataset[name]
- return parseData(val)
- case 0:
- var ret = {}
- for (var name in dataset) {
- ret[name] = parseData(dataset[name])
- }
- return ret
- }
- }
-}
-var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/
-avalon.parseJSON = JSON.parse
-
-function parseData(data) {
- try {
- if (typeof data === "object")
- return data
- data = data === "true" ? true :
- data === "false" ? false :
- data === "null" ? null : +data + "" === data ? +data : rbrace.test(data) ? JSON.parse(data) : data
- } catch (e) {
- }
- return data
-}
-avalon.each({
- scrollLeft: "pageXOffset",
- scrollTop: "pageYOffset"
-}, function(method, prop) {
- avalon.fn[method] = function(val) {
- var node = this[0] || {}, win = getWindow(node),
- top = method === "scrollTop"
- if (!arguments.length) {
- return win ? win[prop] : node[method]
- } else {
- if (win) {
- win.scrollTo(!top ? val : avalon(win).scrollLeft(), top ? val : avalon(win).scrollTop())
- } else {
- node[method] = val
- }
- }
- }
-})
-
-function getWindow(node) {
- return node.window && node.document ? node : node.nodeType === 9 ? node.defaultView : false
-}
-
-//=============================css相关==================================
-var cssHooks = avalon.cssHooks = {}
-var prefixes = ["", "-webkit-", "-moz-", "-ms-"]//去掉opera-15的支持
-var cssMap = {
- "float": "cssFloat"
-}
-avalon.cssNumber = oneObject("columnCount,order,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom")
-
-avalon.cssName = function(name, host, camelCase) {
- if (cssMap[name]) {
- return cssMap[name]
- }
- host = host || root.style
- for (var i = 0, n = prefixes.length; i < n; i++) {
- camelCase = camelize(prefixes[i] + name)
- if (camelCase in host) {
- return (cssMap[name] = camelCase)
- }
- }
- return null
-}
-cssHooks["@:set"] = function(node, name, value) {
- node.style[name] = value
-}
-
-cssHooks["@:get"] = function(node, name) {
- if (!node || !node.style) {
- throw new Error("getComputedStyle要求传入一个节点 " + node)
- }
- var ret, computed = getComputedStyle(node, null)
- if (computed) {
- ret = name === "filter" ? computed.getPropertyValue(name) : computed[name]
- if (ret === "") {
- ret = node.style[name] //其他浏览器需要我们手动取内联样式
- }
- }
- return ret
-}
-cssHooks["opacity:get"] = function(node) {
- var ret = cssHooks["@:get"](node, "opacity")
- return ret === "" ? "1" : ret
-}
-
-"top,left".replace(rword, function(name) {
- cssHooks[name + ":get"] = function(node) {
- var computed = cssHooks["@:get"](node, name)
- return /px$/.test(computed) ? computed :
- avalon(node).position()[name] + "px"
- }
-})
-var cssShow = {
- position: "absolute",
- visibility: "hidden",
- display: "block"
-}
-var rdisplayswap = /^(none|table(?!-c[ea]).+)/
-
-function showHidden(node, array) {
- //http://www.cnblogs.com/rubylouvre/archive/2012/10/27/2742529.html
- if (node.offsetWidth <= 0) { //opera.offsetWidth可能小于0
- var styles = getComputedStyle(node, null)
- if (rdisplayswap.test(styles["display"])) {
- var obj = {
- node: node
- }
- for (var name in cssShow) {
- obj[name] = styles[name]
- node.style[name] = cssShow[name]
- }
- array.push(obj)
- }
- var parent = node.parentNode
- if (parent && parent.nodeType === 1) {
- showHidden(parent, array)
- }
- }
-}
-
-"Width,Height".replace(rword, function(name) {//fix 481
- var method = name.toLowerCase(),
- clientProp = "client" + name,
- scrollProp = "scroll" + name,
- offsetProp = "offset" + name
- cssHooks[method + ":get"] = function(node, which, override) {
- var boxSizing = -4
- if (typeof override === "number") {
- boxSizing = override
- }
- which = name === "Width" ? ["Left", "Right"] : ["Top", "Bottom"]
- var ret = node[offsetProp] // border-box 0
- if (boxSizing === 2) { // margin-box 2
- return ret
- + avalon.css(node, "margin" + which[0], true)
- + avalon.css(node, "margin" + which[1], true)
- }
- if (boxSizing < 0) { // padding-box -2
- ret = ret
- - avalon.css(node, "border" + which[0] + "Width", true)
- - avalon.css(node, "border" + which[1] + "Width", true)
- }
- if (boxSizing === -4) { // content-box -4
- ret = ret
- - avalon.css(node, "padding" + which[0], true)
- - avalon.css(node, "padding" + which[1], true)
- }
- return ret
- }
- cssHooks[method + "&get"] = function(node) {
- var hidden = [];
- showHidden(node, hidden);
- var val = cssHooks[method + ":get"](node)
- for (var i = 0, obj; obj = hidden[i++]; ) {
- node = obj.node
- for (var n in obj) {
- if (typeof obj[n] === "string") {
- node.style[n] = obj[n]
- }
- }
- }
- return val;
- }
- avalon.fn[method] = function(value) { //会忽视其display
- var node = this[0]
- if (arguments.length === 0) {
- if (node.setTimeout) { //取得窗口尺寸,IE9后可以用node.innerWidth /innerHeight代替
- return node["inner" + name] || node.document.documentElement[clientProp]
- }
- if (node.nodeType === 9) { //取得页面尺寸
- var doc = node.documentElement
- //FF chrome html.scrollHeight< body.scrollHeight
- //IE 标准模式 : html.scrollHeight> body.scrollHeight
- //IE 怪异模式 : html.scrollHeight 最大等于可视窗口多一点?
- return Math.max(node.body[scrollProp], doc[scrollProp], node.body[offsetProp], doc[offsetProp], doc[clientProp])
- }
- return cssHooks[method + "&get"](node)
- } else {
- return this.css(method, value)
- }
- }
- avalon.fn["inner" + name] = function() {
- return cssHooks[method + ":get"](this[0], void 0, -2)
- }
- avalon.fn["outer" + name] = function(includeMargin) {
- return cssHooks[method + ":get"](this[0], void 0, includeMargin === true ? 2 : 0)
- }
-})
-avalon.fn.offset = function() { //取得距离页面左右角的坐标
- var node = this[0], box = {
- left: 0,
- top: 0
- }
- if (!node || !node.tagName || !node.ownerDocument) {
- return box
- }
- var doc = node.ownerDocument,
- root = doc.documentElement,
- win = doc.defaultView
- if (!root.contains(node)) {
- return box
- }
- if (node.getBoundingClientRect !== void 0) {
- box = node.getBoundingClientRect()
- }
- return {
- top: box.top + win.pageYOffset - root.clientTop,
- left: box.left + win.pageXOffset - root.clientLeft
- }
-}
-//=============================val相关=======================
-
-function getValType(el) {
- var ret = el.tagName.toLowerCase()
- return ret === "input" && /checkbox|radio/.test(el.type) ? "checked" : ret
-}
-var valHooks = {
- "select:get": function(node, value) {
- var option, options = node.options,
- index = node.selectedIndex,
- one = node.type === "select-one" || index < 0,
- values = one ? null : [],
- max = one ? index + 1 : options.length,
- i = index < 0 ? max : one ? index : 0
- for (; i < max; i++) {
- option = options[i]
- //旧式IE在reset后不会改变selected,需要改用i === index判定
- //我们过滤所有disabled的option元素,但在safari5下,如果设置select为disable,那么其所有孩子都disable
- //因此当一个元素为disable,需要检测其是否显式设置了disable及其父节点的disable情况
- if ((option.selected || i === index) && !option.disabled) {
- value = option.value
- if (one) {
- return value
- }
- //收集所有selected值组成数组返回
- values.push(value)
- }
- }
- return values
- },
- "select:set": function(node, values, optionSet) {
- values = [].concat(values) //强制转换为数组
- for (var i = 0, el; el = node.options[i++]; ) {
- if ((el.selected = values.indexOf(el.value) > -1)) {
- optionSet = true
- }
- }
- if (!optionSet) {
- node.selectedIndex = -1
- }
- }
-}
-
-/*********************************************************************
- * 编译系统 *
- **********************************************************************/
-var quote = JSON.stringify
-
-var keywords =
- // 关键字
- "break,case,catch,continue,debugger,default,delete,do,else,false" +
- ",finally,for,function,if,in,instanceof,new,null,return,switch,this" +
- ",throw,true,try,typeof,var,void,while,with"
- // 保留字
- + ",abstract,boolean,byte,char,class,const,double,enum,export,extends" +
- ",final,float,goto,implements,import,int,interface,long,native" +
- ",package,private,protected,public,short,static,super,synchronized" +
- ",throws,transient,volatile"
- // ECMA 5 - use strict
- + ",arguments,let,yield" + ",undefined"
-var rrexpstr = /\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g
-var rsplit = /[^\w$]+/g
-var rkeywords = new RegExp(["\\b" + keywords.replace(/,/g, '\\b|\\b') + "\\b"].join('|'), 'g')
-var rnumber = /\b\d[^,]*/g
-var rcomma = /^,+|,+$/g
-var cacheVars = createCache(512)
-var getVariables = function(code) {
- var key = "," + code.trim()
- if (cacheVars[key]) {
- return cacheVars[key]
- }
- var match = code
- .replace(rrexpstr, "")
- .replace(rsplit, ",")
- .replace(rkeywords, "")
- .replace(rnumber, "")
- .replace(rcomma, "")
- .split(/^$|,+/)
- return cacheVars(key, uniqSet(match))
-}
-/*添加赋值语句*/
-
-function addAssign(vars, scope, name, data) {
- var ret = [],
- prefix = " = " + name + "."
- for (var i = vars.length, prop; prop = vars[--i]; ) {
- if (scope.hasOwnProperty(prop)) {
- ret.push(prop + prefix + prop)
- data.vars.push(prop)
- if (data.type === "duplex") {
- vars.get = name + "." + prop
- }
- vars.splice(i, 1)
- }
- }
- return ret
-}
-
-function uniqSet(array) {
- var ret = [],
- unique = {}
- for (var i = 0; i < array.length; i++) {
- var el = array[i]
- var id = el && typeof el.$id === "string" ? el.$id : el
- if (!unique[id]) {
- unique[id] = ret.push(el)
- }
- }
- return ret
-}
-//缓存求值函数,以便多次利用
-var cacheExprs = createCache(128)
-//取得求值函数及其传参
-var rduplex = /\w\[.*\]|\w\.\w/
-var rproxy = /(\$proxy\$[a-z]+)\d+$/
-var rthimRightParentheses = /\)\s*$/
-var rthimOtherParentheses = /\)\s*\|/g
-var rquoteFilterName = /\|\s*([$\w]+)/g
-var rpatchBracket = /"\s*\["/g
-var rthimLeftParentheses = /"\s*\(/g
-function parseFilter(val, filters) {
- filters = filters
- .replace(rthimRightParentheses, "")//处理最后的小括号
- .replace(rthimOtherParentheses, function() {//处理其他小括号
- return "],|"
- })
- .replace(rquoteFilterName, function(a, b) { //处理|及它后面的过滤器的名字
- return "[" + quote(b)
- })
- .replace(rpatchBracket, function() {
- return '"],["'
- })
- .replace(rthimLeftParentheses, function() {
- return '",'
- }) + "]"
- return "return avalon.filters.$filter(" + val + ", " + filters + ")"
-}
-
-function parseExpr(code, scopes, data) {
- var dataType = data.type
- var filters = data.filters || ""
- var exprId = scopes.map(function(el) {
- return String(el.$id).replace(rproxy, "$1")
- }) + code + dataType + filters
- var vars = getVariables(code).concat(),
- assigns = [],
- names = [],
- args = [],
- prefix = ""
- //args 是一个对象数组, names 是将要生成的求值函数的参数
- scopes = uniqSet(scopes)
- data.vars = []
- for (var i = 0, sn = scopes.length; i < sn; i++) {
- if (vars.length) {
- var name = "vm" + expose + "_" + i
- names.push(name)
- args.push(scopes[i])
- assigns.push.apply(assigns, addAssign(vars, scopes[i], name, data))
- }
- }
- if (!assigns.length && dataType === "duplex") {
- return
- }
- if (dataType !== "duplex" && (code.indexOf("||") > -1 || code.indexOf("&&") > -1)) {
- //https://github.com/RubyLouvre/avalon/issues/583
- data.vars.forEach(function(v) {
- var reg = new RegExp("\\b" + v + "(?:\\.\\w+|\\[\\w+\\])+", "ig")
- code = code.replace(reg, function(_) {
- var c = _.charAt(v.length)
- var r = IEVersion ? code.slice(arguments[1] + _.length) : RegExp.rightContext
- var method = /^\s*\(/.test(r)
- if (c === "." || c === "[" || method) {//比如v为aa,我们只匹配aa.bb,aa[cc],不匹配aaa.xxx
- var name = "var" + String(Math.random()).replace(/^0\./, "")
- if (method) {//array.size()
- var array = _.split(".")
- if (array.length > 2) {
- var last = array.pop()
- assigns.push(name + " = " + array.join("."))
- return name + "." + last
- } else {
- return _
- }
- }
- assigns.push(name + " = " + _)
- return name
- } else {
- return _
- }
- })
- })
- }
- //---------------args----------------
- data.args = args
- //---------------cache----------------
- var fn = cacheExprs[exprId] //直接从缓存,免得重复生成
- if (fn) {
- data.evaluator = fn
- return
- }
- var prefix = assigns.join(", ")
- if (prefix) {
- prefix = "var " + prefix
- }
- if (/\S/.test(filters)) { //文本绑定,双工绑定才有过滤器
- if (!/text|html/.test(data.type)) {
- throw Error("ms-" + data.type + "不支持过滤器")
- }
- code = "\nvar ret" + expose + " = " + code + ";\r\n"
- code += parseFilter("ret" + expose, filters)
- } else if (dataType === "duplex") { //双工绑定
- var _body = "'use strict';\nreturn function(vvv){\n\t" +
- prefix +
- ";\n\tif(!arguments.length){\n\t\treturn " +
- code +
- "\n\t}\n\t" + (!rduplex.test(code) ? vars.get : code) +
- "= vvv;\n} "
- try {
- fn = Function.apply(noop, names.concat(_body))
- data.evaluator = cacheExprs(exprId, fn)
- } catch (e) {
- log("debug: parse error," + e.message)
- }
- return
- } else if (dataType === "on") { //事件绑定
- if (code.indexOf("(") === -1) {
- code += ".call(this, $event)"
- } else {
- code = code.replace("(", ".call(this,")
- }
- names.push("$event")
- code = "\nreturn " + code + ";" //IE全家 Function("return ")出错,需要Function("return ;")
- var lastIndex = code.lastIndexOf("\nreturn")
- var header = code.slice(0, lastIndex)
- var footer = code.slice(lastIndex)
- code = header + "\n" + footer
- } else { //其他绑定
- code = "\nreturn " + code + ";" //IE全家 Function("return ")出错,需要Function("return ;")
- }
- try {
- fn = Function.apply(noop, names.concat("'use strict';\n" + prefix + code))
- data.evaluator = cacheExprs(exprId, fn)
- } catch (e) {
- log("debug: parse error," + e.message)
- } finally {
- vars = textBuffer = names = null //释放内存
- }
-}
-
-
-//parseExpr的智能引用代理
-
-function parseExprProxy(code, scopes, data, tokens, noregister) {
- if (Array.isArray(tokens)) {
- code = tokens.map(function(el) {
- return el.expr ? "(" + el.value + ")" : quote(el.value)
- }).join(" + ")
- }
- parseExpr(code, scopes, data)
- if (data.evaluator && !noregister) {
- data.handler = bindingExecutors[data.handlerName || data.type]
- //方便调试
- //这里非常重要,我们通过判定视图刷新函数的element是否在DOM树决定
- //将它移出订阅者列表
- registerSubscriber(data)
- }
-}
-avalon.parseExprProxy = parseExprProxy
-/*********************************************************************
- * 各种指令 *
- **********************************************************************/
-//ms-skip绑定已经在scanTag 方法中实现
-//ms-controller绑定已经在scanTag 方法中实现
-//ms-important绑定已经在scanTag 方法中实现
-var bools = "autofocus,autoplay,async,allowTransparency,checked,controls,declare,disabled,defer,defaultChecked,defaultSelected" +
- "contentEditable,isMap,loop,multiple,noHref,noResize,noShade,open,readOnly,selected"
-var boolMap = {}
-bools.replace(rword, function(name) {
- boolMap[name.toLowerCase()] = name
-})
-
-var propMap = {//属性名映射
- "accept-charset": "acceptCharset",
- "char": "ch",
- "charoff": "chOff",
- "class": "className",
- "for": "htmlFor",
- "http-equiv": "httpEquiv"
-}
-
-var anomaly = "accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan," + "dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight," + "rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"
-anomaly.replace(rword, function(name) {
- propMap[name.toLowerCase()] = name
-})
-
-var rnoscripts = /<noscript.*?>(?:[\s\S]+?)<\/noscript>/img
-var rnoscriptText = /<noscript.*?>([\s\S]+?)<\/noscript>/im
-
-var getXHR = function() {
- return new (window.XMLHttpRequest || ActiveXObject)("Microsoft.XMLHTTP")
-}
-
-var cacheTmpls = avalon.templateCache = {}
-
-bindingHandlers.attr = function(data, vmodels) {
- var text = data.value.trim(),
- simple = true
- if (text.indexOf(openTag) > -1 && text.indexOf(closeTag) > 2) {
- simple = false
- if (rexpr.test(text) && RegExp.rightContext === "" && RegExp.leftContext === "") {
- simple = true
- text = RegExp.$1
- }
- }
- if (data.type === "include") {
- var elem = data.element
- data.includeRendered = getBindingCallback(elem, "data-include-rendered", vmodels)
- data.includeLoaded = getBindingCallback(elem, "data-include-loaded", vmodels)
- var outer = data.includeReplaced = !!avalon(elem).data("includeReplace")
- data.startInclude = DOC.createComment("ms-include")
- data.endInclude = DOC.createComment("ms-include-end")
- if (outer) {
- data.element = data.startInclude
- elem.parentNode.insertBefore(data.startInclude, elem)
- elem.parentNode.insertBefore(data.endInclude, elem.nextSibling)
- } else {
- elem.insertBefore(data.startInclude, elem.firstChild)
- elem.appendChild(data.endInclude)
- }
- }
- data.handlerName = "attr" //handleName用于处理多种绑定共用同一种bindingExecutor的情况
- parseExprProxy(text, vmodels, data, (simple ? 0 : scanExpr(data.value)))
-}
-
-bindingExecutors.attr = function(val, elem, data) {
- var method = data.type,
- attrName = data.param
- if (method === "css") {
- avalon(elem).css(attrName, val)
- } else if (method === "attr") {
- // ms-attr-class="xxx" vm.xxx="aaa bbb ccc"将元素的className设置为aaa bbb ccc
- // ms-attr-class="xxx" vm.xxx=false 清空元素的所有类名
- // ms-attr-name="yyy" vm.yyy="ooo" 为元素设置name属性
- if (boolMap[attrName]) {
- var bool = boolMap[attrName]
- if (typeof elem[bool] === "boolean") {
- // IE6-11不支持动态设置fieldset的disabled属性,IE11下样式是生效了,但无法阻止用户对其底下的input元素进行设值……
- return elem[bool] = !!val
- }
- }
- var toRemove = (val === false) || (val === null) || (val === void 0)
-
- if (!W3C && propMap[attrName]) { //旧式IE下需要进行名字映射
- attrName = propMap[attrName]
- }
- if (toRemove) {
- return elem.removeAttribute(attrName)
- }
- //SVG只能使用setAttribute(xxx, yyy), VML只能使用elem.xxx = yyy ,HTML的固有属性必须elem.xxx = yyy
- var isInnate = rsvg.test(elem) ? false : (DOC.namespaces && isVML(elem)) ? true : attrName in elem.cloneNode(false)
- if (isInnate) {
- elem[attrName] = val
- } else {
- elem.setAttribute(attrName, val)
- }
- } else if (method === "include" && val) {
- var vmodels = data.vmodels
- var rendered = data.includeRendered
- var loaded = data.includeLoaded
- var replace = data.includeReplaced
- var target = replace ? elem.parentNode : elem
- function scanTemplate(text) {
- if (loaded) {
- text = loaded.apply(target, [text].concat(vmodels))
- }
- if (rendered) {
- checkScan(target, function() {
- rendered.call(target)
- }, NaN)
- }
- while (true) {
- var node = data.startInclude.nextSibling
- if (node && node !== data.endInclude) {
- target.removeChild(node)
- } else {
- break
- }
- }
- var dom = avalon.parseHTML(text)
- var nodes = avalon.slice(dom.childNodes)
- target.insertBefore(dom, data.endInclude)
- scanNodeArray(nodes, vmodels)
- }
- if (data.param === "src") {
- if (cacheTmpls[val]) {
- avalon.nextTick(function() {
- scanTemplate(cacheTmpls[val])
- })
- } else {
- var xhr = getXHR()
- xhr.onreadystatechange = function() {
- if (xhr.readyState === 4) {
- var s = xhr.status
- if (s >= 200 && s < 300 || s === 304 || s === 1223) {
- scanTemplate(cacheTmpls[val] = xhr.responseText)
- }
- }
- }
- xhr.open("GET", val, true)
- if ("withCredentials" in xhr) {
- xhr.withCredentials = true
- }
- xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest")
- xhr.send(null)
- }
- } else {
- //IE系列与够新的标准浏览器支持通过ID取得元素(firefox14+)
- //http://tjvantoll.com/2012/07/19/dom-element-references-as-global-variables/
- var el = val && val.nodeType === 1 ? val : DOC.getElementById(val)
- if (el) {
- if (el.tagName === "NOSCRIPT" && !(el.innerHTML || el.fixIE78)) { //IE7-8 innerText,innerHTML都无法取得其内容,IE6能取得其innerHTML
- var xhr = getXHR() //IE9-11与chrome的innerHTML会得到转义的内容,它们的innerText可以
- xhr.open("GET", location, false) //谢谢Nodejs 乱炖群 深圳-纯属虚构
- xhr.send(null)
- //http://bbs.csdn.net/topics/390349046?page=1#post-393492653
- var noscripts = DOC.getElementsByTagName("noscript")
- var array = (xhr.responseText || "").match(rnoscripts) || []
- var n = array.length
- for (var i = 0; i < n; i++) {
- var tag = noscripts[i]
- if (tag) { //IE6-8中noscript标签的innerHTML,innerText是只读的
- tag.style.display = "none" //http://haslayout.net/css/noscript-Ghost-Bug
- tag.fixIE78 = (array[i].match(rnoscriptText) || ["", "&nbsp;"])[1]
- }
- }
- }
- avalon.nextTick(function() {
- scanTemplate(el.fixIE78 || el.value || el.innerText || el.innerHTML)
- })
- }
- }
- } else {
- if (!root.hasAttribute && typeof val === "string" && (method === "src" || method === "href")) {
- val = val.replace(/&amp;/g, "&") //处理IE67自动转义的问题
- }
- elem[method] = val
- if (window.chrome && elem.tagName === "EMBED") {
- var parent = elem.parentNode //#525 chrome1-37下embed标签动态设置src不能发生请求
- var comment = document.createComment("ms-src")
- parent.replaceChild(comment, elem)
- parent.replaceChild(elem, comment)
- }
- }
-}
-
-//这几个指令都可以使用插值表达式,如ms-src="aaa/{{b}}/{{c}}.html"
-"title,alt,src,value,css,include,href".replace(rword, function(name) {
- bindingHandlers[name] = bindingHandlers.attr
-})
-//ms-include绑定已由ms-attr绑定实现
-
-//根据VM的属性值或表达式的值切换类名,ms-class="xxx yyy zzz:flag"
-//http://www.cnblogs.com/rubylouvre/archive/2012/12/17/2818540.html
-bindingHandlers["class"] = function(data, vmodels) {
- var oldStyle = data.param,
- text = data.value,
- rightExpr
- data.handlerName = "class"
- if (!oldStyle || isFinite(oldStyle)) {
- data.param = "" //去掉数字
- var noExpr = text.replace(rexprg, function(a) {
- return a.replace(/./g, "0")
- //return Math.pow(10, a.length - 1) //将插值表达式插入10的N-1次方来占位
- })
- var colonIndex = noExpr.indexOf(":") //取得第一个冒号的位置
- if (colonIndex === -1) { // 比如 ms-class="aaa bbb ccc" 的情况
- var className = text
- } else { // 比如 ms-class-1="ui-state-active:checked" 的情况
- className = text.slice(0, colonIndex)
- rightExpr = text.slice(colonIndex + 1)
- parseExpr(rightExpr, vmodels, data) //决定是添加还是删除
- if (!data.evaluator) {
- log("debug: ms-class '" + (rightExpr || "").trim() + "' 不存在于VM中")
- return false
- } else {
- data._evaluator = data.evaluator
- data._args = data.args
- }
- }
- var hasExpr = rexpr.test(className) //比如ms-class="width{{w}}"的情况
- if (!hasExpr) {
- data.immobileClass = className
- }
- parseExprProxy("", vmodels, data, (hasExpr ? scanExpr(className) : 0))
- } else {
- data.immobileClass = data.oldStyle = data.param
- parseExprProxy(text, vmodels, data)
- }
-}
-
-bindingExecutors ["class"] = function(val, elem, data) {
- var $elem = avalon(elem),
- method = data.type
- if (method === "class" && data.oldStyle) { //如果是旧风格
- $elem.toggleClass(data.oldStyle, !!val)
- } else {
- //如果存在冒号就有求值函数
- data.toggleClass = data._evaluator ? !!data._evaluator.apply(elem, data._args) : true
- data.newClass = data.immobileClass || val
- if (data.oldClass && data.newClass !== data.oldClass) {
- $elem.removeClass(data.oldClass)
- }
- data.oldClass = data.newClass
- switch (method) {
- case "class":
- $elem.toggleClass(data.newClass, data.toggleClass)
- break
- case "hover":
- case "active":
- if (!data.hasBindEvent) { //确保只绑定一次
- var activate = "mouseenter" //在移出移入时切换类名
- var abandon = "mouseleave"
- if (method === "active") { //在聚焦失焦中切换类名
- elem.tabIndex = elem.tabIndex || -1
- activate = "mousedown"
- abandon = "mouseup"
- var fn0 = $elem.bind("mouseleave", function() {
- data.toggleClass && $elem.removeClass(data.newClass)
- })
- }
- var fn1 = $elem.bind(activate, function() {
- data.toggleClass && $elem.addClass(data.newClass)
- })
- var fn2 = $elem.bind(abandon, function() {
- data.toggleClass && $elem.removeClass(data.newClass)
- })
- data.rollback = function() {
- $elem.unbind("mouseleave", fn0)
- $elem.unbind(activate, fn1)
- $elem.unbind(abandon, fn2)
- }
- data.hasBindEvent = true
- }
- break;
- }
- }
-}
-
-"hover,active".replace(rword, function(method) {
- bindingHandlers[method] = bindingHandlers["class"]
-})
-// bindingHandlers.data 定义在if.js
-bindingExecutors.data = function(val, elem, data) {
- var key = "data-" + data.param
- if (val && typeof val === "object") {
- elem[key] = val
- } else {
- elem.setAttribute(key, String(val))
- }
-}
-
-// bindingHandlers.text 定义在if.js
-bindingExecutors.text = function(val, elem) {
- val = val == null ? "" : val //不在页面上显示undefined null
- if (elem.nodeType === 3) { //绑定在文本节点上
- try { //IE对游离于DOM树外的节点赋值会报错
- elem.data = val
- } catch (e) {
- }
- } else { //绑定在特性节点上
- elem.textContent = val
- }
-}
-
-// bindingHandlers.html 定义在if.js
-bindingExecutors.html = function(val, elem, data) {
- val = val == null ? "" : val
- var isHtmlFilter = "group" in data
- var parent = isHtmlFilter ? elem.parentNode : elem
- if (!parent)
- return
- if (val.nodeType === 11) { //将val转换为文档碎片
- var fragment = val
- } else if (val.nodeType === 1 || val.item) {
- var nodes = val.nodeType === 1 ? val.childNodes : val.item ? val : []
- fragment = hyperspace.cloneNode(true)
- while (nodes[0]) {
- fragment.appendChild(nodes[0])
- }
- } else {
- fragment = avalon.parseHTML(val)
- }
- //插入占位符, 如果是过滤器,需要有节制地移除指定的数量,如果是html指令,直接清空
- var comment = DOC.createComment("ms-html")
- if (isHtmlFilter) {
- parent.insertBefore(comment, elem)
- var n = data.group, i = 1
- while (i < n) {
- var node = elem.nextSibling
- if (node) {
- parent.removeChild(node)
- i++
- }
- }
- parent.removeChild(elem)
- data.element = comment //防止被CG
- } else {
- avalon.clearHTML(parent).appendChild(comment)
- }
- if (isHtmlFilter) {
- data.group = fragment.childNodes.length || 1
- }
- var nodes = avalon.slice(fragment.childNodes)
- if (nodes[0]) {
- if (comment.parentNode)
- comment.parentNode.replaceChild(fragment, comment)
- if (isHtmlFilter) {
- data.element = nodes[0]
- }
- }
- scanNodeArray(nodes, data.vmodels)
-}
-
-bindingHandlers["if"] =
- bindingHandlers.data =
- bindingHandlers.text =
- bindingHandlers.html =
- function(data, vmodels) {
- parseExprProxy(data.value, vmodels, data)
- }
-
-bindingExecutors["if"] = function(val, elem, data) {
- if (val) { //插回DOM树
- if (elem.nodeType === 8) {
- elem.parentNode.replaceChild(data.template, elem)
- elem = data.element = data.template //这时可能为null
- }
- if (elem.getAttribute(data.name)) {
- elem.removeAttribute(data.name)
- scanAttr(elem, data.vmodels)
- }
- data.rollback = null
- } else { //移出DOM树,并用注释节点占据原位置
- if (elem.nodeType === 1) {
- var node = data.element = DOC.createComment("ms-if")
- elem.parentNode.replaceChild(node, elem)
- data.template = elem //元素节点
- ifGroup.appendChild(elem)
- data.rollback = function() {
- if (elem.parentNode === ifGroup) {
- ifGroup.removeChild(elem)
- }
- }
- }
- }
-}
-
-
-function parseDisplay(nodeName, val) {
- //用于取得此类标签的默认display值
- var key = "_" + nodeName
- if (!parseDisplay[key]) {
- var node = DOC.createElement(nodeName)
- root.appendChild(node)
- if (W3C) {
- val = getComputedStyle(node, null).display
- } else {
- val = node.currentStyle.display
- }
- root.removeChild(node)
- parseDisplay[key] = val
- }
- return parseDisplay[key]
-}
-
-avalon.parseDisplay = parseDisplay
-
-bindingHandlers.visible = function(data, vmodels) {
- var elem = avalon(data.element)
- var display = elem.css("display")
- if (display === "none") {
- var style = elem[0].style
- var has = /visibility/i.test(style.cssText)
- var visible = elem.css("visibility")
- style.display = ""
- style.visibility = "hidden"
- display = elem.css("display")
- if (display === "none") {
- display = parseDisplay(elem[0].nodeName)
- }
- style.visibility = has ? visible : ""
- }
- data.display = display
- parseExprProxy(data.value, vmodels, data)
-}
-
-bindingExecutors.visible = function(val, elem, data) {
- elem.style.display = val ? data.display : "none"
-}
-
-var rdash = /\(([^)]*)\)/
-bindingHandlers.on = function(data, vmodels) {
- var value = data.value
- var eventType = data.param.replace(/-\d+$/, "") // ms-on-mousemove-10
- if (typeof bindingHandlers.on[eventType + "Hook"] === "function") {
- bindingHandlers.on[eventType + "Hook"](data)
- }
- if (value.indexOf("(") > 0 && value.indexOf(")") > -1) {
- var matched = (value.match(rdash) || ["", ""])[1].trim()
- if (matched === "" || matched === "$event") { // aaa() aaa($event)当成aaa处理
- value = value.replace(rdash, "")
- }
- }
- parseExprProxy(value, vmodels, data)
-}
-
-bindingExecutors.on = function(callback, elem, data) {
- data.type = "on"
- callback = function(e) {
- var fn = data.evaluator || noop
- return fn.apply(this, data.args.concat(e))
- }
- var eventType = data.param.replace(/-\d+$/, "") // ms-on-mousemove-10
- if (eventType === "scan") {
- callback.call(elem, {
- type: eventType
- })
- } else if (typeof data.specialBind === "function") {
- data.specialBind(elem, callback)
- } else {
- var removeFn = avalon.bind(elem, eventType, callback)
- }
- data.rollback = function() {
- if (typeof data.specialUnbind === "function") {
- data.specialUnbind()
- } else {
- avalon.unbind(elem, eventType, removeFn)
- }
- }
-}
-
-
-bindingHandlers.widget = function(data, vmodels) {
- var args = data.value.match(rword)
- var elem = data.element
- var widget = args[0]
- var id = args[1]
- if (!id || id === "$") {//没有定义或为$时,取组件名+随机数
- id = generateID(widget)
- }
- var optName = args[2] || widget//没有定义,取组件名
- var constructor = avalon.ui[widget]
- if (typeof constructor === "function") { //ms-widget="tabs,tabsAAA,optname"
- vmodels = elem.vmodels || vmodels
- for (var i = 0, v; v = vmodels[i++]; ) {
- if (v.hasOwnProperty(optName) && typeof v[optName] === "object") {
- var vmOptions = v[optName]
- vmOptions = vmOptions.$model || vmOptions
- break
- }
- }
- if (vmOptions) {
- var wid = vmOptions[widget + "Id"]
- if (typeof wid === "string") {
- id = wid
- }
- }
- //抽取data-tooltip-text、data-tooltip-attr属性,组成一个配置对象
- var widgetData = avalon.getWidgetData(elem, widget)
- data.value = [widget, id, optName].join(",")
- data[widget + "Id"] = id
- data.evaluator = noop
- elem.msData["ms-widget-id"] = id
- var options = data[widget + "Options"] = avalon.mix({}, constructor.defaults, vmOptions || {}, widgetData)
- elem.removeAttribute("ms-widget")
- var vmodel = constructor(elem, data, vmodels) || {} //防止组件不返回VM
- if (vmodel.$id) {
- avalon.vmodels[id] = vmodel
- createSignalTower(elem, vmodel)
- if (vmodel.hasOwnProperty("$init")) {
- vmodel.$init(function() {
- avalon.scan(elem, [vmodel].concat(vmodels))
- if (typeof options.onInit === "function") {
- options.onInit.call(elem, vmodel, options, vmodels)
- }
- })
- }
- data.rollback = function() {
- try {
- vmodel.widgetElement = null
- vmodel.$remove()
- } catch (e) {
- }
- elem.msData = {}
- delete avalon.vmodels[vmodel.$id]
- }
- addSubscribers(data, widgetList)
- if (window.chrome) {
- elem.addEventListener("DOMNodeRemovedFromDocument", function() {
- setTimeout(removeSubscribers)
- })
- }
- } else {
- avalon.scan(elem, vmodels)
- }
- } else if (vmodels.length) { //如果该组件还没有加载,那么保存当前的vmodels
- elem.vmodels = vmodels
- }
-}
-var widgetList = []
-//不存在 bindingExecutors.widget
-//双工绑定
-var duplexBinding = bindingHandlers.duplex = function(data, vmodels) {
- var elem = data.element,
- hasCast
- parseExprProxy(data.value, vmodels, data, 0, 1)
-
- data.changed = getBindingCallback(elem, "data-duplex-changed", vmodels) || noop
- if (data.evaluator && data.args) {
- var params = []
- var casting = oneObject("string,number,boolean,checked")
- if (elem.type === "radio" && data.param === "") {
- data.param = "checked"
- }
- if (elem.msData) {
- elem.msData["ms-duplex"] = data.value
- }
- data.param.replace(/\w+/g, function(name) {
- if (/^(checkbox|radio)$/.test(elem.type) && /^(radio|checked)$/.test(name)) {
- if (name === "radio")
- log("ms-duplex-radio已经更名为ms-duplex-checked")
- name = "checked"
- data.isChecked = true
- }
- if (name === "bool") {
- name = "boolean"
- log("ms-duplex-bool已经更名为ms-duplex-boolean")
- } else if (name === "text") {
- name = "string"
- log("ms-duplex-text已经更名为ms-duplex-string")
- }
- if (casting[name]) {
- hasCast = true
- }
- avalon.Array.ensure(params, name)
- })
- if (!hasCast) {
- params.push("string")
- }
- data.param = params.join("-")
- data.bound = function(type, callback) {
- if (elem.addEventListener) {
- elem.addEventListener(type, callback, false)
- } else {
- elem.attachEvent("on" + type, callback)
- }
- var old = data.rollback
- data.rollback = function() {
- elem.avalonSetter = null
- avalon.unbind(elem, type, callback)
- old && old()
- }
- }
- for (var i in avalon.vmodels) {
- var v = avalon.vmodels[i]
- v.$fire("avalon-ms-duplex-init", data)
- }
- var cpipe = data.pipe || (data.pipe = pipe)
- cpipe(null, data, "init")
- var tagName = elem.tagName
- duplexBinding[tagName] && duplexBinding[tagName](elem, data.evaluator.apply(null, data.args), data)
- }
-}
-//不存在 bindingExecutors.duplex
-function fixNull(val) {
- return val == null ? "" : val
-}
-avalon.duplexHooks = {
- checked: {
- get: function(val, data) {
- return !data.element.oldValue
- }
- },
- string: {
- get: function(val) { //同步到VM
- return val
- },
- set: fixNull
- },
- "boolean": {
- get: function(val) {
- return val === "true"
- },
- set: fixNull
- },
- number: {
- get: function(val) {
- return isFinite(val) ? parseFloat(val) || 0 : val
- },
- set: fixNull
- }
-}
-
-function pipe(val, data, action, e) {
- data.param.replace(/\w+/g, function(name) {
- var hook = avalon.duplexHooks[name]
- if (hook && typeof hook[action] === "function") {
- val = hook[action](val, data)
- }
- })
- return val
-}
-
-var TimerID, ribbon = []
-function W3CFire(el, name, detail) {
- var event = DOC.createEvent("Events")
- event.initEvent(name, true, true)
- event.fireByAvalon = true//签名,标记事件是由avalon触发
- //event.isTrusted = false 设置这个opera会报错
- if (detail)
- event.detail = detail
- el.dispatchEvent(event)
-}
-
-
-avalon.tick = function(fn) {
- if (ribbon.push(fn) === 1) {
- TimerID = setInterval(ticker, 60)
- }
-}
-
-function ticker() {
- for (var n = ribbon.length - 1; n >= 0; n--) {
- var el = ribbon[n]
- if (el() === false) {
- ribbon.splice(n, 1)
- }
- }
- if (!ribbon.length) {
- clearInterval(TimerID)
- }
-}
-
-var watchValueInTimer = noop
-new function() {
- try {//#272 IE9-IE11, firefox
- var setters = {}
- var aproto = HTMLInputElement.prototype
- var bproto = HTMLTextAreaElement.prototype
- function newSetter(value) {
- if (avalon.contains(root, this)) {
- setters[this.tagName].call(this, value)
- if (this.avalonSetter) {
- this.avalonSetter()
- }
- }
- }
- var inputProto = HTMLInputElement.prototype
- Object.getOwnPropertyNames(inputProto) //故意引发IE6-8等浏览器报错
- setters["INPUT"] = Object.getOwnPropertyDescriptor(aproto, "value").set
- Object.defineProperty(aproto, "value", {
- set: newSetter
- })
- setters["TEXTAREA"] = Object.getOwnPropertyDescriptor(bproto, "value").set
- Object.defineProperty(bproto, "value", {
- set: newSetter
- })
- } catch (e) {
- watchValueInTimer = avalon.tick
- }
-}
-
-
-//处理radio, checkbox, text, textarea, password
-duplexBinding.INPUT = function(element, evaluator, data) {
- var type = element.type,
- bound = data.bound,
- $elem = avalon(element),
- composing = false
- function callback(value) {
- data.changed.call(this, value, data)
- }
- function compositionStart() {
- composing = true
- }
- function compositionEnd() {
- composing = false
- }
- //当value变化时改变model的值
- function updateVModel() {
- if (composing)//处理中文输入法在minlengh下引发的BUG
- return
- var val = element.oldValue = element.value //防止递归调用形成死循环
- var lastValue = data.pipe(val, data, "get")
- if ($elem.data("duplex-observe") !== false) {
- evaluator(lastValue)
- callback.call(element, lastValue)
- if ($elem.data("duplex-focus")) {
- avalon.nextTick(function() {
- element.focus()
- })
- }
- }
- }
- //当model变化时,它就会改变value的值
- data.handler = function() {
- var val = data.pipe(evaluator(), data, "set")
- if (val !== element.oldValue) {
- element.value = val
- }
- }
- if (data.isChecked || element.type === "radio") {
- updateVModel = function() {
- if ($elem.data("duplex-observe") !== false) {
- var lastValue = data.pipe(element.value, data, "get")
- evaluator(lastValue)
- callback.call(element, lastValue)
- }
- }
- data.handler = function() {
- var val = evaluator()
- var checked = data.isChecked ? !!val : val + "" === element.value
- element.checked = element.oldValue = checked
- }
- bound("click", updateVModel)
- } else if (type === "checkbox") {
- updateVModel = function() {
- if ($elem.data("duplex-observe") !== false) {
- var method = element.checked ? "ensure" : "remove"
- var array = evaluator()
- if (!Array.isArray(array)) {
- log("ms-duplex应用于checkbox上要对应一个数组")
- array = [array]
- }
- avalon.Array[method](array, data.pipe(element.value, data, "get"))
- callback.call(element, array)
- }
- }
- data.handler = function() {
- var array = [].concat(evaluator()) //强制转换为数组
- element.checked = array.indexOf(data.pipe(element.value, data, "get")) > -1
- }
- bound("change", updateVModel)
- } else {
- var events = element.getAttribute("data-duplex-event") || element.getAttribute("data-event") || "input"
- if (element.attributes["data-event"]) {
- log("data-event指令已经废弃,请改用data-duplex-event")
- }
- events.replace(rword, function(name) {
- switch (name) {
- case "input":
- bound("input", updateVModel)
- bound("DOMAutoComplete", updateVModel)
- if (!IEVersion) {
- bound("compositionstart", compositionStart)
- bound("compositionend", compositionEnd)
- }
- break
- default:
- bound(name, updateVModel)
- break
- }
- })
- }
-
- if (/text|password/.test(element.type)) {
- watchValueInTimer(function() {
- if (root.contains(element)) {
- if (element.value !== element.oldValue) {
- updateVModel()
- }
- } else if (!element.msRetain) {
- return false
- }
- })
- }
-
- element.avalonSetter = updateVModel
- element.oldValue = element.value
- registerSubscriber(data)
- callback.call(element, element.value)
-}
-duplexBinding.TEXTAREA = duplexBinding.INPUT
-duplexBinding.SELECT = function(element, evaluator, data) {
- var $elem = avalon(element)
- function updateVModel() {
- if ($elem.data("duplex-observe") !== false) {
- var val = $elem.val() //字符串或字符串数组
- if (Array.isArray(val)) {
- val = val.map(function(v) {
- return data.pipe(v, data, "get")
- })
- } else {
- val = data.pipe(val, data, "get")
- }
- if (val + "" !== element.oldValue) {
- evaluator(val)
- }
- data.changed.call(element, val, data)
- }
- }
- data.handler = function() {
- var val = evaluator()
- val = val && val.$model || val
- if (Array.isArray(val)) {
- if (!element.multiple) {
- log("ms-duplex在<select multiple=true>上要求对应一个数组")
- }
- } else {
- if (element.multiple) {
- log("ms-duplex在<select multiple=false>不能对应一个数组")
- }
- }
- //必须变成字符串后才能比较
- val = Array.isArray(val) ? val.map(String) : val + ""
- if (val + "" !== element.oldValue) {
- $elem.val(val)
- element.oldValue = val + ""
- }
- }
- data.bound("change", updateVModel)
- checkScan(element, function() {
- registerSubscriber(data)
- data.changed.call(element, evaluator(), data)
- }, NaN)
-}
-
-
-bindingHandlers.repeat = function(data, vmodels) {
- var type = data.type
- parseExprProxy(data.value, vmodels, data, 0, 1)
- data.proxies = []
- var freturn = false
- try {
- var $repeat = data.$repeat = data.evaluator.apply(0, data.args || [])
- var xtype = avalon.type($repeat)
- if (xtype !== "object" && xtype !== "array") {
- freturn = true
- avalon.log("warning:" + data.value + "对应类型不正确")
- }
- } catch (e) {
- freturn = true
- avalon.log("warning:" + data.value + "编译出错")
- }
-
- var arr = data.value.split(".") || []
- if (arr.length > 1) {
- arr.pop()
- var n = arr[0]
- for (var i = 0, v; v = vmodels[i++]; ) {
- if (v && v.hasOwnProperty(n)) {
- var events = v[n].$events || {}
- events[subscribers] = events[subscribers] || []
- events[subscribers].push(data)
- break
- }
- }
- }
- var elem = data.element
- elem.removeAttribute(data.name)
-
- data.sortedCallback = getBindingCallback(elem, "data-with-sorted", vmodels)
- data.renderedCallback = getBindingCallback(elem, "data-" + type + "-rendered", vmodels)
- var signature = generateID(type)
- var comment = data.element = DOC.createComment(signature + ":end")
- data.clone = DOC.createComment(signature)
- hyperspace.appendChild(comment)
-
- if (type === "each" || type === "with") {
- data.template = elem.innerHTML.trim()
- avalon.clearHTML(elem).appendChild(comment)
- } else {
- data.template = elem.outerHTML.trim()
- elem.parentNode.replaceChild(comment, elem)
- }
- data.template = avalon.parseHTML(data.template)
- data.rollback = function() {
- var elem = data.element
- if (!elem)
- return
- bindingExecutors.repeat.call(data, "clear")
- var parentNode = elem.parentNode
- var content = data.template
- var target = content.firstChild
- parentNode.replaceChild(content, elem)
- var start = data.$stamp
- start && start.parentNode && start.parentNode.removeChild(start)
- target = data.element = data.type === "repeat" ? target : parentNode
- }
- if (freturn) {
- return
- }
- data.handler = bindingExecutors.repeat
- data.$outer = {}
- var check0 = "$key"
- var check1 = "$val"
- if (Array.isArray($repeat)) {
- check0 = "$first"
- check1 = "$last"
- }
- for (var i = 0, p; p = vmodels[i++]; ) {
- if (p.hasOwnProperty(check0) && p.hasOwnProperty(check1)) {
- data.$outer = p
- break
- }
- }
- var $events = $repeat.$events
- var $list = ($events || {})[subscribers]
- if ($list && avalon.Array.ensure($list, data)) {
- addSubscribers(data, $list)
- }
- if (xtype === "object") {
- data.$with = true
- var pool = !$events ? {} : $events.$withProxyPool || ($events.$withProxyPool = {})
- data.handler("append", $repeat, pool)
- } else if ($repeat.length) {
- data.handler("add", 0, $repeat.length)
- }
-}
-
-bindingExecutors.repeat = function(method, pos, el) {
- if (method) {
- var data = this
- var end = data.element
- var parent = end.parentNode
- var proxies = data.proxies
- var transation = hyperspace.cloneNode(false)
- switch (method) {
- case "add": //在pos位置后添加el数组(pos为数字,el为数组)
- var n = pos + el
- var array = data.$repeat
- var last = array.length - 1
- var fragments = []
- var start = locateNode(data, pos)
- for (var i = pos; i < n; i++) {
- var proxy = eachProxyAgent(i, data)
- proxies.splice(i, 0, proxy)
- shimController(data, transation, proxy, fragments)
- }
- parent.insertBefore(transation, start)
- for (var i = 0, fragment; fragment = fragments[i++]; ) {
- scanNodeArray(fragment.nodes, fragment.vmodels)
- fragment.nodes = fragment.vmodels = null
- }
- break
- case "del": //将pos后的el个元素删掉(pos, el都是数字)
- start = proxies[pos].$stamp
- end = locateNode(data, pos + el)
- sweepNodes(start, end)
- var removed = proxies.splice(pos, el)
- recycleProxies(removed, "each")
- break
- case "clear":
- var check = data.$stamp || proxies[0]
- if (check) {
- start = check.$stamp || check
- sweepNodes(start, end)
- }
- recycleProxies(proxies, "each")
- break
- case "move":
- start = proxies[0].$stamp
- var signature = start.nodeValue
- var rooms = []
- var room = [], node
- sweepNodes(start, end, function() {
- room.unshift(this)
- if (this.nodeValue === signature) {
- rooms.unshift(room)
- room = []
- }
- })
- sortByIndex(proxies, pos)
- sortByIndex(rooms, pos)
- while (room = rooms.shift()) {
- while (node = room.shift()) {
- transation.appendChild(node)
- }
- }
- parent.insertBefore(transation, end)
- break
- case "index": //将proxies中的第pos个起的所有元素重新索引
- var last = proxies.length - 1
- for (; el = proxies[pos]; pos++) {
- el.$index = pos
- el.$first = pos === 0
- el.$last = pos === last
- }
- return
- case "set": //将proxies中的第pos个元素的VM设置为el(pos为数字,el任意)
- var proxy = proxies[pos]
- if (proxy) {
- notifySubscribers(proxy.$events.$index)
- }
- return
- case "append": //将pos的键值对从el中取出(pos为一个普通对象,el为预先生成好的代理VM对象池)
- var pool = el
- var keys = []
- var fragments = []
- for (var key in pos) { //得到所有键名
- if (pos.hasOwnProperty(key) && key !== "hasOwnProperty") {
- keys.push(key)
- }
- }
- if (data.sortedCallback) { //如果有回调,则让它们排序
- var keys2 = data.sortedCallback.call(parent, keys)
- if (keys2 && Array.isArray(keys2) && keys2.length) {
- keys = keys2
- }
- }
- for (var i = 0, key; key = keys[i++]; ) {
- if (key !== "hasOwnProperty") {
- if (!pool[key]) {
- pool[key] = withProxyAgent(key, data)
- }
- shimController(data, transation, pool[key], fragments)
- }
- }
- var comment = data.$stamp = data.clone
- parent.insertBefore(comment, end)
- parent.insertBefore(transation, end)
- for (var i = 0, fragment; fragment = fragments[i++]; ) {
- scanNodeArray(fragment.nodes, fragment.vmodels)
- fragment.nodes = fragment.vmodels = null
- }
- break
- }
- if (method === "clear")
- method = "del"
- var callback = data.renderedCallback || noop,
- args = arguments
- checkScan(parent, function() {
- callback.apply(parent, args)
- if (parent.oldValue && parent.tagName === "SELECT") { //fix #503
- avalon(parent).val(parent.oldValue.split(","))
- }
- }, NaN)
- }
-}
-
-"with,each".replace(rword, function(name) {
- bindingHandlers[name] = bindingHandlers.repeat
-})
-
-function shimController(data, transation, proxy, fragments) {
- var content = data.template.cloneNode(true)
- var nodes = avalon.slice(content.childNodes)
- if (proxy.$stamp) {
- content.insertBefore(proxy.$stamp, content.firstChild)
- }
- transation.appendChild(content)
- var nv = [proxy].concat(data.vmodels)
- var fragment = {
- nodes: nodes,
- vmodels: nv
- }
- fragments.push(fragment)
-}
-
-function locateNode(data, pos) {
- var proxy = data.proxies[pos]
- return proxy ? proxy.$stamp : data.element
-}
-
-function sweepNodes(start, end, callback) {
- while (true) {
- var node = end.previousSibling
- if (!node)
- break
- node.parentNode.removeChild(node)
- callback && callback.call(node)
- if (node === start) {
- break
- }
- }
-}
-
-// 为ms-each,ms-with, ms-repeat会创建一个代理VM,
-// 通过它们保持一个下上文,让用户能调用$index,$first,$last,$remove,$key,$val,$outer等属性与方法
-// 所有代理VM的产生,消费,收集,存放通过xxxProxyFactory,xxxProxyAgent, recycleProxies,xxxProxyPool实现
-var eachProxyPool = []
-var withProxyPool = []
-function eachProxyFactory(name) {
- var source = {
- $host: [],
- $outer: {},
- $stamp: 1,
- $index: 0,
- $first: false,
- $last: false,
- $remove: avalon.noop
- }
- source[name] = {
- get: function() {
- return this.$host[this.$index]
- },
- set: function(val) {
- this.$host.set(this.$index, val)
- }
- }
- var second = {
- $last: 1,
- $first: 1,
- $index: 1
- }
- var proxy = modelFactory(source, second)
- var e = proxy.$events
- e[name] = e.$first = e.$last = e.$index
- proxy.$id = generateID("$proxy$each")
- return proxy
-}
-
-function eachProxyAgent(index, data) {
- var param = data.param || "el", proxy
- for (var i = 0, n = eachProxyPool.length; i < n; i++) {
- var candidate = eachProxyPool[i]
- if (candidate && candidate.hasOwnProperty(param)) {
- proxy = candidate
- eachProxyPool.splice(i, 1)
- }
- }
- if (!proxy) {
- proxy = eachProxyFactory(param)
- }
- var host = data.$repeat
- var last = host.length - 1
- proxy.$index = index
- proxy.$first = index === 0
- proxy.$last = index === last
- proxy.$host = host
- proxy.$outer = data.$outer
- proxy.$stamp = data.clone.cloneNode(false)
- proxy.$remove = function() {
- return host.removeAt(proxy.$index)
- }
- return proxy
-}
-
-function withProxyFactory() {
- var proxy = modelFactory({
- $key: "",
- $outer: {},
- $host: {},
- $val: {
- get: function() {
- return this.$host[this.$key]
- },
- set: function(val) {
- this.$host[this.$key] = val
- }
- }
- }, {
- $val: 1
- })
- proxy.$id = generateID("$proxy$with")
- return proxy
-}
-
-function withProxyAgent(key, data) {
- var proxy = withProxyPool.pop()
- if (!proxy) {
- proxy = withProxyFactory()
- }
- var host = data.$repeat
- proxy.$key = key
- proxy.$host = host
- proxy.$outer = data.$outer
- if (host.$events) {
- proxy.$events.$val = host.$events[key]
- } else {
- proxy.$events = {}
- }
- return proxy
-}
-
-function recycleProxies(proxies, type) {
- var proxyPool = type === "each" ? eachProxyPool : withProxyPool
- avalon.each(proxies, function(key, proxy) {
- if (proxy.$events) {
- for (var i in proxy.$events) {
- if (Array.isArray(proxy.$events[i])) {
- proxy.$events[i].forEach(function(data) {
- if (typeof data === "object")
- disposeData(data)
- })
- proxy.$events[i].length = 0
- }
- }
- proxy.$host = proxy.$outer = {}
- if (proxyPool.unshift(proxy) > kernel.maxRepeatSize) {
- proxyPool.pop()
- }
- }
- })
- if (type === "each")
- proxies.length = 0
-}
-
-
-
-
-/*********************************************************************
- * 自带过滤器 *
- **********************************************************************/
-var rscripts = /<script[^>]*>([\S\s]*?)<\/script\s*>/gim
-var ron = /\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g
-var ropen = /<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/ig
-var rsanitize = {
- a: /\b(href)\=("javascript[^"]*"|'javascript[^']*')/ig,
- img: /\b(src)\=("javascript[^"]*"|'javascript[^']*')/ig,
- form: /\b(action)\=("javascript[^"]*"|'javascript[^']*')/ig
-}
-var rsurrogate = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g
-var rnoalphanumeric = /([^\#-~| |!])/g;
-
-function numberFormat(number, decimals, dec_point, thousands_sep) {
- //form http://phpjs.org/functions/number_format/
- //number 必需,要格式化的数字
- //decimals 可选,规定多少个小数位。
- //dec_point 可选,规定用作小数点的字符串(默认为 . )。
- //thousands_sep 可选,规定用作千位分隔符的字符串(默认为 , ),如果设置了该参数,那么所有其他参数都是必需的。
- number = (number + '')
- .replace(/[^0-9+\-Ee.]/g, '')
- var n = !isFinite(+number) ? 0 : +number,
- prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
- sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
- dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
- s = '',
- toFixedFix = function(n, prec) {
- var k = Math.pow(10, prec)
- return '' + (Math.round(n * k) / k)
- .toFixed(prec)
- }
- // Fix for IE parseFloat(0.55).toFixed(0) = 0;
- s = (prec ? toFixedFix(n, prec) : '' + Math.round(n))
- .split('.')
- if (s[0].length > 3) {
- s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep)
- }
- if ((s[1] || '')
- .length < prec) {
- s[1] = s[1] || ''
- s[1] += new Array(prec - s[1].length + 1)
- .join('0')
- }
- return s.join(dec)
-}
-
-
-var filters = avalon.filters = {
- uppercase: function(str) {
- return str.toUpperCase()
- },
- lowercase: function(str) {
- return str.toLowerCase()
- },
- truncate: function(str, length, truncation) {
- //length,新字符串长度,truncation,新字符串的结尾的字段,返回新字符串
- length = length || 30
- truncation = truncation === void(0) ? "..." : truncation
- return str.length > length ? str.slice(0, length - truncation.length) + truncation : String(str)
- },
- $filter: function(val) {
- for (var i = 1, n = arguments.length; i < n; i++) {
- var array = arguments[i]
- var fn = avalon.filters[array.shift()]
- if (typeof fn === "function") {
- var arr = [val].concat(array)
- val = fn.apply(null, arr)
- }
- }
- return val
- },
- camelize: camelize,
- //https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
- // <a href="javasc&NewLine;ript&colon;alert('XSS')">chrome</a>
- // <a href="data:text/html;base64, PGltZyBzcmM9eCBvbmVycm9yPWFsZXJ0KDEpPg==">chrome</a>
- // <a href="jav ascript:alert('XSS');">IE67chrome</a>
- // <a href="jav&#x09;ascript:alert('XSS');">IE67chrome</a>
- // <a href="jav&#x0A;ascript:alert('XSS');">IE67chrome</a>
- sanitize: function(str) {
- return str.replace(rscripts, "").replace(ropen, function(a, b) {
- var match = a.toLowerCase().match(/<(\w+)\s/)
- if (match) { //处理a标签的href属性,img标签的src属性,form标签的action属性
- var reg = rsanitize[match[1]]
- if (reg) {
- a = a.replace(reg, function(s, name, value) {
- var quote = value.charAt(0)
- return name + "=" + quote + "javascript:void(0)" + quote
- })
- }
- }
- return a.replace(ron, " ").replace(/\s+/g, " ") //移除onXXX事件
- })
- },
- escape: function(str) {
- //将字符串经过 str 转义得到适合在页面中显示的内容, 例如替换 < 为 &lt
- return String(str).
- replace(/&/g, '&amp;').
- replace(rsurrogate, function(value) {
- var hi = value.charCodeAt(0)
- var low = value.charCodeAt(1)
- return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';'
- }).
- replace(rnoalphanumeric, function(value) {
- return '&#' + value.charCodeAt(0) + ';'
- }).
- replace(/</g, '&lt;').
- replace(/>/g, '&gt;')
- },
- currency: function(amount, symbol, fractionSize) {
- return (symbol || "\uFFE5") + numberFormat(amount, isFinite(fractionSize) ? fractionSize: 2)
- },
- number: function(number, fractionSize) {
- return numberFormat(number, isFinite(fractionSize) ? fractionSize: 3 )
- }
-}
-/*
- 'yyyy': 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010)
- 'yy': 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)
- 'y': 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)
- 'MMMM': Month in year (January-December)
- 'MMM': Month in year (Jan-Dec)
- 'MM': Month in year, padded (01-12)
- 'M': Month in year (1-12)
- 'dd': Day in month, padded (01-31)
- 'd': Day in month (1-31)
- 'EEEE': Day in Week,(Sunday-Saturday)
- 'EEE': Day in Week, (Sun-Sat)
- 'HH': Hour in day, padded (00-23)
- 'H': Hour in day (0-23)
- 'hh': Hour in am/pm, padded (01-12)
- 'h': Hour in am/pm, (1-12)
- 'mm': Minute in hour, padded (00-59)
- 'm': Minute in hour (0-59)
- 'ss': Second in minute, padded (00-59)
- 's': Second in minute (0-59)
- 'a': am/pm marker
- 'Z': 4 digit (+sign) representation of the timezone offset (-1200-+1200)
- format string can also be one of the following predefined localizable formats:
-
- 'medium': equivalent to 'MMM d, y h:mm:ss a' for en_US locale (e.g. Sep 3, 2010 12:05:08 pm)
- 'short': equivalent to 'M/d/yy h:mm a' for en_US locale (e.g. 9/3/10 12:05 pm)
- 'fullDate': equivalent to 'EEEE, MMMM d,y' for en_US locale (e.g. Friday, September 3, 2010)
- 'longDate': equivalent to 'MMMM d, y' for en_US locale (e.g. September 3, 2010
- 'mediumDate': equivalent to 'MMM d, y' for en_US locale (e.g. Sep 3, 2010)
- 'shortDate': equivalent to 'M/d/yy' for en_US locale (e.g. 9/3/10)
- 'mediumTime': equivalent to 'h:mm:ss a' for en_US locale (e.g. 12:05:08 pm)
- 'shortTime': equivalent to 'h:mm a' for en_US locale (e.g. 12:05 pm)
- */
-new function() {
- function toInt(str) {
- return parseInt(str, 10)
- }
-
- function padNumber(num, digits, trim) {
- var neg = ""
- if (num < 0) {
- neg = '-'
- num = -num
- }
- num = "" + num
- while (num.length < digits)
- num = "0" + num
- if (trim)
- num = num.substr(num.length - digits)
- return neg + num
- }
-
- function dateGetter(name, size, offset, trim) {
- return function(date) {
- var value = date["get" + name]()
- if (offset > 0 || value > -offset)
- value += offset
- if (value === 0 && offset === -12) {
- value = 12
- }
- return padNumber(value, size, trim)
- }
- }
-
- function dateStrGetter(name, shortForm) {
- return function(date, formats) {
- var value = date["get" + name]()
- var get = (shortForm ? ("SHORT" + name) : name).toUpperCase()
- return formats[get][value]
- }
- }
-
- function timeZoneGetter(date) {
- var zone = -1 * date.getTimezoneOffset()
- var paddedZone = (zone >= 0) ? "+" : ""
- paddedZone += padNumber(Math[zone > 0 ? "floor" : "ceil"](zone / 60), 2) + padNumber(Math.abs(zone % 60), 2)
- return paddedZone
- }
- //取得上午下午
-
- function ampmGetter(date, formats) {
- return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1]
- }
- var DATE_FORMATS = {
- yyyy: dateGetter("FullYear", 4),
- yy: dateGetter("FullYear", 2, 0, true),
- y: dateGetter("FullYear", 1),
- MMMM: dateStrGetter("Month"),
- MMM: dateStrGetter("Month", true),
- MM: dateGetter("Month", 2, 1),
- M: dateGetter("Month", 1, 1),
- dd: dateGetter("Date", 2),
- d: dateGetter("Date", 1),
- HH: dateGetter("Hours", 2),
- H: dateGetter("Hours", 1),
- hh: dateGetter("Hours", 2, -12),
- h: dateGetter("Hours", 1, -12),
- mm: dateGetter("Minutes", 2),
- m: dateGetter("Minutes", 1),
- ss: dateGetter("Seconds", 2),
- s: dateGetter("Seconds", 1),
- sss: dateGetter("Milliseconds", 3),
- EEEE: dateStrGetter("Day"),
- EEE: dateStrGetter("Day", true),
- a: ampmGetter,
- Z: timeZoneGetter
- }
- var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,
- NUMBER_STRING = /^\d+$/
- var riso8601 = /^(\d{4})-?(\d+)-?(\d+)(?:T(\d+)(?::?(\d+)(?::?(\d+)(?:\.(\d+))?)?)?(Z|([+-])(\d+):?(\d+))?)?$/
- // 1 2 3 4 5 6 7 8 9 10 11
-
- function jsonStringToDate(string) {
- var match
- if (match = string.match(riso8601)) {
- var date = new Date(0),
- tzHour = 0,
- tzMin = 0,
- dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear,
- timeSetter = match[8] ? date.setUTCHours : date.setHours
- if (match[9]) {
- tzHour = toInt(match[9] + match[10])
- tzMin = toInt(match[9] + match[11])
- }
- dateSetter.call(date, toInt(match[1]), toInt(match[2]) - 1, toInt(match[3]))
- var h = toInt(match[4] || 0) - tzHour
- var m = toInt(match[5] || 0) - tzMin
- var s = toInt(match[6] || 0)
- var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000)
- timeSetter.call(date, h, m, s, ms)
- return date
- }
- return string
- }
- var rfixYMD = /^(\d+)\D(\d+)\D(\d+)/
- filters.date = function(date, format) {
- var locate = filters.date.locate,
- text = "",
- parts = [],
- fn, match
- format = format || "mediumDate"
- format = locate[format] || format
- if (typeof date === "string") {
- if (NUMBER_STRING.test(date)) {
- date = toInt(date)
- } else {
- var trimDate = date.trim()
- date = trimDate.replace(rfixYMD, function(a, b, c, d) {
- var array = d.length === 4 ? [d, b, c] : [b, c, d]
- return array.join("-")
- })
- date = jsonStringToDate(date)
- }
- date = new Date(date)
- }
- if (typeof date === "number") {
- date = new Date(date)
- }
- if (avalon.type(date) !== "date") {
- return
- }
- while (format) {
- match = DATE_FORMATS_SPLIT.exec(format)
- if (match) {
- parts = parts.concat(match.slice(1))
- format = parts.pop()
- } else {
- parts.push(format)
- format = null
- }
- }
- parts.forEach(function(value) {
- fn = DATE_FORMATS[value]
- text += fn ? fn(date, locate) : value.replace(/(^'|'$)/g, "").replace(/''/g, "'")
- })
- return text
- }
- var locate = {
- AMPMS: {
- 0: "上午",
- 1: "下午"
- },
- DAY: {
- 0: "星期日",
- 1: "星期一",
- 2: "星期二",
- 3: "星期三",
- 4: "星期四",
- 5: "星期五",
- 6: "星期六"
- },
- MONTH: {
- 0: "1月",
- 1: "2月",
- 2: "3月",
- 3: "4月",
- 4: "5月",
- 5: "6月",
- 6: "7月",
- 7: "8月",
- 8: "9月",
- 9: "10月",
- 10: "11月",
- 11: "12月"
- },
- SHORTDAY: {
- "0": "周日",
- "1": "周一",
- "2": "周二",
- "3": "周三",
- "4": "周四",
- "5": "周五",
- "6": "周六"
- },
- fullDate: "y年M月d日EEEE",
- longDate: "y年M月d日",
- medium: "yyyy-M-d H:mm:ss",
- mediumDate: "yyyy-M-d",
- mediumTime: "H:mm:ss",
- "short": "yy-M-d ah:mm",
- shortDate: "yy-M-d",
- shortTime: "ah:mm"
- }
- locate.SHORTMONTH = locate.MONTH
- filters.date.locate = locate
-}
-/*********************************************************************
- * AMD加载器 *
- **********************************************************************/
-var modules = avalon.modules = {
- "ready!": {
- exports: avalon
- },
- "avalon": {
- exports: avalon,
- state: 2
- }
-}
-
-new function() {
- var loadings = [] //正在加载中的模块列表
- var factorys = [] //储存需要绑定ID与factory对应关系的模块(标准浏览器下,先parse的script节点会先onload)
- var basepath
-
- function trimHashAndQuery(url) {
- return (url || "").replace(/[?#].*/, "")
- }
-
- var cur = getCurrentScript(true) //求得当前avalon.js 所在的JS文件的路径
- if (!cur) { //处理window safari的Error没有stack的问题
- cur = avalon.slice(DOC.scripts).pop().src
- }
- var url = trimHashAndQuery(cur)
- basepath = kernel.base = url.slice(0, url.lastIndexOf("/") + 1)
-
- function getCurrentScript(base) {
- // 参考 https://github.com/samyk/jiagra/blob/master/jiagra.js
- var stack
- try {
- a.b.c() //强制报错,以便捕获e.stack
- } catch (e) { //safari的错误对象只有line,sourceId,sourceURL
- stack = e.stack
- if (!stack && window.opera) {
- //opera 9没有e.stack,但有e.Backtrace,但不能直接取得,需要对e对象转字符串进行抽取
- stack = (String(e).match(/of linked script \S+/g) || []).join(" ")
- }
- }
- if (stack) {
- /**e.stack最后一行在所有支持的浏览器大致如下:
- *chrome23:
- * at http://113.93.50.63/data.js:4:1
- *firefox17:
- *@http://113.93.50.63/query.js:4
- *opera12:http://www.oldapps.com/opera.php?system=Windows_XP
- *@http://113.93.50.63/data.js:4
- *IE10:
- * at Global code (http://113.93.50.63/data.js:4:1)
- * //firefox4+ 可以用document.currentScript
- */
- stack = stack.split(/[@ ]/g).pop() //取得最后一行,最后一个空格或@之后的部分
- stack = stack[0] === "(" ? stack.slice(1, -1) : stack.replace(/\s/, "") //去掉换行符
- return stack.replace(/(:\d+)?:\d+$/i, "") //去掉行号与或许存在的出错字符起始位置
- }
- var nodes = (base ? DOC : head).getElementsByTagName("script") //只在head标签中寻找
- for (var i = nodes.length, node; node = nodes[--i]; ) {
- if ((base || node.className === subscribers) && node.readyState === "interactive") {
- return node.className = node.src
- }
- }
- }
-
- innerRequire = avalon.require = function(array, factory, parent) {
- if (!Array.isArray(array)) {
- avalon.error("require的第一个参数必须是依赖列数,类型为数组 " + array)
- }
- var args = [] // 放置所有依赖项的完整路径
- var deps = {} // args的另一种表现形式,为的是方便去重
- var dn = 0 //需要安装的模块数
- var cn = 0 // 已安装完的模块数
- var id = parent || "callback" + setTimeout("1")
- parent = parent || basepath
-
- array.forEach(function(el) {
- var url = loadResources(el, parent) //加载资源,并返回能加载资源的完整路径
- if (url) {
- dn++
- if (modules[url] && modules[url].state === 2) {
- cn++
- }
- if (!deps[url]) {
- args.push(url)
- deps[url] = "司徒正美" //去重
- }
- }
- })
- modules[id] = {//保存此模块的相关信息
- id: id,
- factory: factory,
- deps: deps,
- args: args,
- state: 1
- }
- if (dn === cn) { //如果需要安装的等于已安装好的
- fireFactory(id, args, factory) //安装到框架中
- } else {
- //放到检测列队中,等待checkDeps处理
- loadings.unshift(id)
- }
- checkDeps()
- }
-
- innerRequire.define = function(urlOrId, deps, factory) { //模块名,依赖列表,模块本身
- var args = aslice.call(arguments)
- if (typeof urlOrId === "string") {
- var id = args.shift()
- }
- if (typeof args[0] === "function") {
- args.unshift([])
- }
- //上线合并后能直接得到模块ID,否则寻找当前正在解析中的script节点的src作为模块ID
- //现在除了safari5,1-外,我们都能直接通过getCurrentScript一步到位得到当前执行的script节点,
- //safari可通过onload+delay闭包组合解决
- var url = modules[id] && modules[id].state >= 1 ? id : trimHashAndQuery(getCurrentScript())
- if (!modules[url] && id) {
- modules[url] = {
- id: url,
- factory: factory,
- state: 1
- }
- }
- factory = args[1]
- factory.id = id //用于调试
- factory.delay = function(d) {
- args.push(d)
- var isCycle = true
- try {
- isCycle = checkCycle(modules[d].deps, d)
- } catch (e) {
- }
- if (isCycle) {
- avalon.error(d + "模块与之前的模块存在循环依赖,请不要直接用script标签引入" + d + "模块")
- }
- delete factory.delay //释放内存
- innerRequire.apply(null, args) //0,1,2 --> 1,2,0
- }
- if (url) {
- factory.delay(url)
- } else { //先进先出
- factorys.push(factory)
- }
- }
- innerRequire.define.amd = modules
-
- function checkCycle(deps, nick) {
- //检测是否存在循环依赖
- for (var id in deps) {
- if (deps[id] === "司徒正美" && modules[id].state !== 2 && (id === nick || checkCycle(modules[id].deps, nick))) {
- return true
- }
- }
- }
-
- function checkDeps() {
- //检测此JS模块的依赖是否都已安装完毕,是则安装自身
- loop: for (var i = loadings.length, id; id = loadings[--i]; ) {
-
- var obj = modules[id],
- deps = obj.deps
- for (var key in deps) {
- if (ohasOwn.call(deps, key) && modules[key].state !== 2) {
- continue loop
- }
- }
- //如果deps是空对象或者其依赖的模块的状态都是2
- if (obj.state !== 2) {
- loadings.splice(i, 1) //必须先移除再安装,防止在IE下DOM树建完后手动刷新页面,会多次执行它
- fireFactory(obj.id, obj.args, obj.factory)
- checkDeps() //如果成功,则再执行一次,以防有些模块就差本模块没有安装好
- }
- }
- }
-
- function checkFail(node, onError, fuckIE) {
- var id = trimHashAndQuery(node.src) //检测是否死链
- node.onload = node.onreadystatechange = node.onerror = null
- if (onError || (fuckIE && !modules[id].state)) {
- setTimeout(function() {
- head.removeChild(node)
- node = null // 处理旧式IE下的循环引用问题
- })
- log("debug: 加载 " + id + " 失败" + onError + " " + (!modules[id].state))
- } else {
- return true
- }
- }
- var rdeuce = /\/\w+\/\.\./
-
- function loadResources(url, parent, ret, shim) {
- //1. 特别处理mass|ready标识符
- if (url === "ready!" || (modules[url] && modules[url].state === 2)) {
- return url
- }
- //2. 处理text! css! 等资源
- var plugin
- url = url.replace(/^\w+!/, function(a) {
- plugin = a.slice(0, -1)
- return ""
- })
- plugin = plugin || "js"
- plugin = plugins[plugin] || noop
- //3. 转化为完整路径
- if (typeof kernel.shim[url] === "object") {
- shim = kernel.shim[url]
- }
- url = url.split('/');
- //For each module name segment, see if there is a path
- //registered for it. Start with most specific name
- //and work up from it.
- for (var i = url.length, parentModule, parentPath; i > 0; i -= 1) {
- parentModule = url.slice(0, i).join('/');
-
- parentPath = kernel.paths[parentModule];
- if (parentPath) {
- //If an array, it means there are a few choices,
- //Choose the one that is desired
- if (Array.isArray(parentPath)) {
- parentPath = parentPath[0];
- }
- url.splice(0, i, parentPath);
- break;
- }
- }
- //Join the path parts together, then figure out if baseUrl is needed.
- url = url.join('/');
-
- //4. 补全路径
- if (/^(\w+)(\d)?:.*/.test(url)) {
- ret = url
- } else {
- parent = parent.substr(0, parent.lastIndexOf("/"))
- var tmp = url.charAt(0)
- if (tmp !== "." && tmp !== "/") { //相对于根路径
- ret = basepath + url
- } else if (url.slice(0, 2) === "./") { //相对于兄弟路径
- ret = parent + url.slice(1)
- } else if (url.slice(0, 2) === "..") { //相对于父路径
- ret = parent + "/" + url
- while (rdeuce.test(ret)) {
- ret = ret.replace(rdeuce, "")
- }
- } else if (tmp === "/") {
- ret = url //相对于根路径
- } else {
- avalon.error("不符合模块标识规则: " + url)
- }
- }
- //5. 补全扩展名
- url = trimHashAndQuery(ret)
- var ext = plugin.ext
- if (ext) {
- if (url.slice(0 - ext.length) !== ext) {
- ret += ext
- }
- }
- //6. 缓存处理
- if (kernel.nocache) {
- ret += (ret.indexOf("?") === -1 ? "?" : "&") + (new Date - 0)
- }
- return plugin(ret, shim)
- }
-
- function loadJS(url, id, callback) {
- //通过script节点加载目标模块
- var node = DOC.createElement("script")
- node.className = subscribers //让getCurrentScript只处理类名为subscribers的script节点
- node[W3C ? "onload" : "onreadystatechange"] = function() {
- if (W3C || /loaded|complete/i.test(node.readyState)) {
- //mass Framework会在_checkFail把它上面的回调清掉,尽可能释放回存,尽管DOM0事件写法在IE6下GC无望
- var factory = factorys.pop()
- factory && factory.delay(id)
- if (callback) {
- callback()
- }
- if (checkFail(node, false, !W3C)) {
- log("debug: 已成功加载 " + url)
- }
- }
- }
- node.onerror = function() {
- checkFail(node, true)
- }
- node.src = url //插入到head的第一个节点前,防止IE6下head标签没闭合前使用appendChild抛错
- head.insertBefore(node, head.firstChild) //chrome下第二个参数不能为null
- log("debug: 正准备加载 " + url) //更重要的是IE6下可以收窄getCurrentScript的寻找范围
- }
-
- function fireFactory(id, deps, factory) {
- for (var i = 0, array = [], d; d = deps[i++]; ) {
- array.push(modules[d].exports)
- }
- var module = Object(modules[id]),
- ret = factory.apply(window, array)
- module.state = 2
- if (ret !== void 0) {
- modules[id].exports = ret
- }
- return ret
- }
-
- plugins.js = function(url, shim) {
- var id = trimHashAndQuery(url)
- if (!modules[id]) { //如果之前没有加载过
- modules[id] = {
- id: id,
- exports: {}
- }
- if (shim) { //shim机制
- innerRequire(shim.deps || "", function() {
- loadJS(url, id, function() {
- modules[id].state = 2
- var s = shim.exports
- if (s && modules[id].exports === void 0) {
- modules[id].exports = typeof s === "function" ?
- s() : window[s]
- }
- innerRequire.checkDeps()
- })
- })
- } else {
- loadJS(url, id)
- }
- }
- return id
- }
- plugins.css = function(url) {
- var id = trimHashAndQuery(url).replace(/\W/g, "_") ////用于处理掉href中的hash与所有特殊符号
- if (!DOC.getElementById(id)) {
- var node = DOC.createElement("link")
- node.rel = "stylesheet"
- node.href = url
- node.id = id
- head.insertBefore(node, head.firstChild)
- }
- }
- plugins.css.ext = ".css"
- plugins.js.ext = ".js"
-
- plugins.text = function(url) {
- var xhr = getXHR()
- var id = trimHashAndQuery(url)
- modules[id] = {}
- xhr.onreadystatechange = function() {
- if (xhr.readyState === 4) {
- var status = xhr.status;
- if (status > 399 && status < 600) {
- avalon.error(url + " 对应资源不存在或没有开启 CORS")
- } else {
- modules[id].state = 2
- modules[id].exports = xhr.responseText
- innerRequire.checkDeps()
- }
- }
- }
- xhr.open("GET", url, true)
- if ("withCredentials" in xhr) {
- xhr.withCredentials = true
- }
- xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest")
- xhr.send()
- return id
- }
-
- innerRequire.config = kernel
- innerRequire.checkDeps = checkDeps
-}
-
-/*********************************************************************
- * DOMReady *
- **********************************************************************/
-var readyList = []
-function fireReady() {
- if (innerRequire) {
- modules["ready!"].state = 2
- innerRequire.checkDeps()//隋性函数,防止IE9二次调用_checkDeps
- } else {
- readyList.forEach(function(a) {
- a(avalon)
- })
- }
- fireReady = noop //隋性函数,防止IE9二次调用_checkDeps
-}
-
-if (DOC.readyState === "complete") {
- setTimeout(fireReady) //如果在domReady之外加载
-} else {
- DOC.addEventListener("DOMContentLoaded", fireReady)
- window.addEventListener("load", fireReady)
-}
-avalon.ready = function(fn) {
- if (innerRequire) {
- innerRequire(["ready!"], fn)
- } else if (fireReady === noop) {
- fn(avalon)
- } else {
- readyList.push(fn)
- }
-}
-avalon.config({
- loader: true
-})
-avalon.ready(function() {
- avalon.scan(DOC.body)
-})
-
-// Register as a named AMD module, since avalon can be concatenated with other
-// files that may use define, but not via a proper concatenation script that
-// understands anonymous AMD modules. A named AMD is safest and most robust
-// way to register. Lowercase avalon is used because AMD module names are
-// derived from file names, and Avalon is normally delivered in a lowercase
-// file name. Do this after creating the global so that if an AMD module wants
-// to call noConflict to hide this version of avalon, it will work.
-
-// Note that for maximum portability, libraries that are not avalon should
-// declare themselves as anonymous modules, and avoid setting a global if an
-// AMD loader is present. avalon is a special case. For more information, see
-// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
- if (typeof define === "function" && define.amd) {
- define("avalon", [], function() {
- return avalon
- })
- }
-// Map over avalon in case of overwrite
- var _avalon = window.avalon
- avalon.noConflict = function(deep) {
- if (deep && window.avalon === avalon) {
- window.avalon = avalon
- }
- return avalon
- }
-// Expose avalon and $ identifiers, even in AMD
-// and CommonJS for browser emulators
- if (noGlobal === void 0) {
- window.avalon = avalon
- }
- return avalon
-
-}));
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/js/commonUtil.js b/umc-iui/src/main/resources/webroot/umc-drill/js/commonUtil.js
deleted file mode 100644
index 0024b372..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/js/commonUtil.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var commonUtil = {};
-commonUtil.arrayRemove = function( aryInstance , index ){
- if(aryInstance == undefined || aryInstance == null){
- return;
- }
- for(var i=0,n=0;i<aryInstance.length;i++) {
- if(aryInstance[i]!=aryInstance[dx]) {
- aryInstance[n++]=aryInstance[i];
- }
- }
- aryInstance.length-=1;
-};
-
-//对Date的扩展,将 Date 转化为指定格式的String
-// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
-// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
-// 例子:
-// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
-// (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
-commonUtil.parseDate = function( dateObj , format){
- var o = {
- "M+" : dateObj.getMonth()+1, //month
- "d+" : dateObj.getDate(), //day
- "h+" : dateObj.getHours(), //hour
- "m+" : dateObj.getMinutes(), //minute
- "s+" : dateObj.getSeconds(), //second
- "q+" : Math.floor((dateObj.getMonth()+3)/3), //quarter
- "S" : dateObj.getMilliseconds() //millisecond
- }
- if(/(y+)/.test(format)) format=format.replace(RegExp.$1,
- (dateObj.getFullYear()+"").substr(4 - RegExp.$1.length));
- for(var k in o)
- if(new RegExp("("+ k +")").test(format))
- format = format.replace(RegExp.$1, RegExp.$1.length==1 ? o[k] :
- ("00"+ o[k]).substr((""+ o[k]).length));
- return format;
-};
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/js/d3.js b/umc-iui/src/main/resources/webroot/umc-drill/js/d3.js
deleted file mode 100644
index 8793f6d7..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/js/d3.js
+++ /dev/null
@@ -1,9253 +0,0 @@
-/*
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-!function() {
- var d3 = {
- version: "3.4.12"
- };
- if (!Date.now) Date.now = function() {
- return +new Date();
- };
- var d3_arraySlice = [].slice, d3_array = function(list) {
- return d3_arraySlice.call(list);
- };
- var d3_document = document, d3_documentElement = d3_document.documentElement, d3_window = window;
- try {
- d3_array(d3_documentElement.childNodes)[0].nodeType;
- } catch (e) {
- d3_array = function(list) {
- var i = list.length, array = new Array(i);
- while (i--) array[i] = list[i];
- return array;
- };
- }
- try {
- d3_document.createElement("div").style.setProperty("opacity", 0, "");
- } catch (error) {
- var d3_element_prototype = d3_window.Element.prototype, d3_element_setAttribute = d3_element_prototype.setAttribute, d3_element_setAttributeNS = d3_element_prototype.setAttributeNS, d3_style_prototype = d3_window.CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty;
- d3_element_prototype.setAttribute = function(name, value) {
- d3_element_setAttribute.call(this, name, value + "");
- };
- d3_element_prototype.setAttributeNS = function(space, local, value) {
- d3_element_setAttributeNS.call(this, space, local, value + "");
- };
- d3_style_prototype.setProperty = function(name, value, priority) {
- d3_style_setProperty.call(this, name, value + "", priority);
- };
- }
- d3.ascending = d3_ascending;
- function d3_ascending(a, b) {
- return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
- }
- d3.descending = function(a, b) {
- return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
- };
- d3.min = function(array, f) {
- var i = -1, n = array.length, a, b;
- if (arguments.length === 1) {
- while (++i < n && !((a = array[i]) != null && a <= a)) a = undefined;
- while (++i < n) if ((b = array[i]) != null && a > b) a = b;
- } else {
- while (++i < n && !((a = f.call(array, array[i], i)) != null && a <= a)) a = undefined;
- while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b;
- }
- return a;
- };
- d3.max = function(array, f) {
- var i = -1, n = array.length, a, b;
- if (arguments.length === 1) {
- while (++i < n && !((a = array[i]) != null && a <= a)) a = undefined;
- while (++i < n) if ((b = array[i]) != null && b > a) a = b;
- } else {
- while (++i < n && !((a = f.call(array, array[i], i)) != null && a <= a)) a = undefined;
- while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b;
- }
- return a;
- };
- d3.extent = function(array, f) {
- var i = -1, n = array.length, a, b, c;
- if (arguments.length === 1) {
- while (++i < n && !((a = c = array[i]) != null && a <= a)) a = c = undefined;
- while (++i < n) if ((b = array[i]) != null) {
- if (a > b) a = b;
- if (c < b) c = b;
- }
- } else {
- while (++i < n && !((a = c = f.call(array, array[i], i)) != null && a <= a)) a = undefined;
- while (++i < n) if ((b = f.call(array, array[i], i)) != null) {
- if (a > b) a = b;
- if (c < b) c = b;
- }
- }
- return [ a, c ];
- };
- d3.sum = function(array, f) {
- var s = 0, n = array.length, a, i = -1;
- if (arguments.length === 1) {
- while (++i < n) if (!isNaN(a = +array[i])) s += a;
- } else {
- while (++i < n) if (!isNaN(a = +f.call(array, array[i], i))) s += a;
- }
- return s;
- };
- function d3_number(x) {
- return x != null && !isNaN(x);
- }
- d3.mean = function(array, f) {
- var s = 0, n = array.length, a, i = -1, j = n;
- if (arguments.length === 1) {
- while (++i < n) if (d3_number(a = array[i])) s += a; else --j;
- } else {
- while (++i < n) if (d3_number(a = f.call(array, array[i], i))) s += a; else --j;
- }
- return j ? s / j : undefined;
- };
- d3.quantile = function(values, p) {
- var H = (values.length - 1) * p + 1, h = Math.floor(H), v = +values[h - 1], e = H - h;
- return e ? v + e * (values[h] - v) : v;
- };
- d3.median = function(array, f) {
- if (arguments.length > 1) array = array.map(f);
- array = array.filter(d3_number);
- return array.length ? d3.quantile(array.sort(d3_ascending), .5) : undefined;
- };
- function d3_bisector(compare) {
- return {
- left: function(a, x, lo, hi) {
- if (arguments.length < 3) lo = 0;
- if (arguments.length < 4) hi = a.length;
- while (lo < hi) {
- var mid = lo + hi >>> 1;
- if (compare(a[mid], x) < 0) lo = mid + 1; else hi = mid;
- }
- return lo;
- },
- right: function(a, x, lo, hi) {
- if (arguments.length < 3) lo = 0;
- if (arguments.length < 4) hi = a.length;
- while (lo < hi) {
- var mid = lo + hi >>> 1;
- if (compare(a[mid], x) > 0) hi = mid; else lo = mid + 1;
- }
- return lo;
- }
- };
- }
- var d3_bisect = d3_bisector(d3_ascending);
- d3.bisectLeft = d3_bisect.left;
- d3.bisect = d3.bisectRight = d3_bisect.right;
- d3.bisector = function(f) {
- return d3_bisector(f.length === 1 ? function(d, x) {
- return d3_ascending(f(d), x);
- } : f);
- };
- d3.shuffle = function(array) {
- var m = array.length, t, i;
- while (m) {
- i = Math.random() * m-- | 0;
- t = array[m], array[m] = array[i], array[i] = t;
- }
- return array;
- };
- d3.permute = function(array, indexes) {
- var i = indexes.length, permutes = new Array(i);
- while (i--) permutes[i] = array[indexes[i]];
- return permutes;
- };
- d3.pairs = function(array) {
- var i = 0, n = array.length - 1, p0, p1 = array[0], pairs = new Array(n < 0 ? 0 : n);
- while (i < n) pairs[i] = [ p0 = p1, p1 = array[++i] ];
- return pairs;
- };
- d3.zip = function() {
- if (!(n = arguments.length)) return [];
- for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m; ) {
- for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n; ) {
- zip[j] = arguments[j][i];
- }
- }
- return zips;
- };
- function d3_zipLength(d) {
- return d.length;
- }
- d3.transpose = function(matrix) {
- return d3.zip.apply(d3, matrix);
- };
- d3.keys = function(map) {
- var keys = [];
- for (var key in map) keys.push(key);
- return keys;
- };
- d3.values = function(map) {
- var values = [];
- for (var key in map) values.push(map[key]);
- return values;
- };
- d3.entries = function(map) {
- var entries = [];
- for (var key in map) entries.push({
- key: key,
- value: map[key]
- });
- return entries;
- };
- d3.merge = function(arrays) {
- var n = arrays.length, m, i = -1, j = 0, merged, array;
- while (++i < n) j += arrays[i].length;
- merged = new Array(j);
- while (--n >= 0) {
- array = arrays[n];
- m = array.length;
- while (--m >= 0) {
- merged[--j] = array[m];
- }
- }
- return merged;
- };
- var abs = Math.abs;
- d3.range = function(start, stop, step) {
- if (arguments.length < 3) {
- step = 1;
- if (arguments.length < 2) {
- stop = start;
- start = 0;
- }
- }
- if ((stop - start) / step === Infinity) throw new Error("infinite range");
- var range = [], k = d3_range_integerScale(abs(step)), i = -1, j;
- start *= k, stop *= k, step *= k;
- if (step < 0) while ((j = start + step * ++i) > stop) range.push(j / k); else while ((j = start + step * ++i) < stop) range.push(j / k);
- return range;
- };
- function d3_range_integerScale(x) {
- var k = 1;
- while (x * k % 1) k *= 10;
- return k;
- }
- function d3_class(ctor, properties) {
- try {
- for (var key in properties) {
- Object.defineProperty(ctor.prototype, key, {
- value: properties[key],
- enumerable: false
- });
- }
- } catch (e) {
- ctor.prototype = properties;
- }
- }
- d3.map = function(object) {
- var map = new d3_Map();
- if (object instanceof d3_Map) object.forEach(function(key, value) {
- map.set(key, value);
- }); else for (var key in object) map.set(key, object[key]);
- return map;
- };
- function d3_Map() {}
- d3_class(d3_Map, {
- has: d3_map_has,
- get: function(key) {
- return this[d3_map_prefix + key];
- },
- set: function(key, value) {
- return this[d3_map_prefix + key] = value;
- },
- remove: d3_map_remove,
- keys: d3_map_keys,
- values: function() {
- var values = [];
- this.forEach(function(key, value) {
- values.push(value);
- });
- return values;
- },
- entries: function() {
- var entries = [];
- this.forEach(function(key, value) {
- entries.push({
- key: key,
- value: value
- });
- });
- return entries;
- },
- size: d3_map_size,
- empty: d3_map_empty,
- forEach: function(f) {
- for (var key in this) if (key.charCodeAt(0) === d3_map_prefixCode) f.call(this, key.slice(1), this[key]);
- }
- });
- var d3_map_prefix = "\x00", d3_map_prefixCode = d3_map_prefix.charCodeAt(0);
- function d3_map_has(key) {
- return d3_map_prefix + key in this;
- }
- function d3_map_remove(key) {
- key = d3_map_prefix + key;
- return key in this && delete this[key];
- }
- function d3_map_keys() {
- var keys = [];
- this.forEach(function(key) {
- keys.push(key);
- });
- return keys;
- }
- function d3_map_size() {
- var size = 0;
- for (var key in this) if (key.charCodeAt(0) === d3_map_prefixCode) ++size;
- return size;
- }
- function d3_map_empty() {
- for (var key in this) if (key.charCodeAt(0) === d3_map_prefixCode) return false;
- return true;
- }
- d3.nest = function() {
- var nest = {}, keys = [], sortKeys = [], sortValues, rollup;
- function map(mapType, array, depth) {
- if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array;
- var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values;
- while (++i < n) {
- if (values = valuesByKey.get(keyValue = key(object = array[i]))) {
- values.push(object);
- } else {
- valuesByKey.set(keyValue, [ object ]);
- }
- }
- if (mapType) {
- object = mapType();
- setter = function(keyValue, values) {
- object.set(keyValue, map(mapType, values, depth));
- };
- } else {
- object = {};
- setter = function(keyValue, values) {
- object[keyValue] = map(mapType, values, depth);
- };
- }
- valuesByKey.forEach(setter);
- return object;
- }
- function entries(map, depth) {
- if (depth >= keys.length) return map;
- var array = [], sortKey = sortKeys[depth++];
- map.forEach(function(key, keyMap) {
- array.push({
- key: key,
- values: entries(keyMap, depth)
- });
- });
- return sortKey ? array.sort(function(a, b) {
- return sortKey(a.key, b.key);
- }) : array;
- }
- nest.map = function(array, mapType) {
- return map(mapType, array, 0);
- };
- nest.entries = function(array) {
- return entries(map(d3.map, array, 0), 0);
- };
- nest.key = function(d) {
- keys.push(d);
- return nest;
- };
- nest.sortKeys = function(order) {
- sortKeys[keys.length - 1] = order;
- return nest;
- };
- nest.sortValues = function(order) {
- sortValues = order;
- return nest;
- };
- nest.rollup = function(f) {
- rollup = f;
- return nest;
- };
- return nest;
- };
- d3.set = function(array) {
- var set = new d3_Set();
- if (array) for (var i = 0, n = array.length; i < n; ++i) set.add(array[i]);
- return set;
- };
- function d3_Set() {}
- d3_class(d3_Set, {
- has: d3_map_has,
- add: function(value) {
- this[d3_map_prefix + value] = true;
- return value;
- },
- remove: function(value) {
- value = d3_map_prefix + value;
- return value in this && delete this[value];
- },
- values: d3_map_keys,
- size: d3_map_size,
- empty: d3_map_empty,
- forEach: function(f) {
- for (var value in this) if (value.charCodeAt(0) === d3_map_prefixCode) f.call(this, value.slice(1));
- }
- });
- d3.behavior = {};
- d3.rebind = function(target, source) {
- var i = 1, n = arguments.length, method;
- while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]);
- return target;
- };
- function d3_rebind(target, source, method) {
- return function() {
- var value = method.apply(source, arguments);
- return value === source ? target : value;
- };
- }
- function d3_vendorSymbol(object, name) {
- if (name in object) return name;
- name = name.charAt(0).toUpperCase() + name.slice(1);
- for (var i = 0, n = d3_vendorPrefixes.length; i < n; ++i) {
- var prefixName = d3_vendorPrefixes[i] + name;
- if (prefixName in object) return prefixName;
- }
- }
- var d3_vendorPrefixes = [ "webkit", "ms", "moz", "Moz", "o", "O" ];
- function d3_noop() {}
- d3.dispatch = function() {
- var dispatch = new d3_dispatch(), i = -1, n = arguments.length;
- while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);
- return dispatch;
- };
- function d3_dispatch() {}
- d3_dispatch.prototype.on = function(type, listener) {
- var i = type.indexOf("."), name = "";
- if (i >= 0) {
- name = type.slice(i + 1);
- type = type.slice(0, i);
- }
- if (type) return arguments.length < 2 ? this[type].on(name) : this[type].on(name, listener);
- if (arguments.length === 2) {
- if (listener == null) for (type in this) {
- if (this.hasOwnProperty(type)) this[type].on(name, null);
- }
- return this;
- }
- };
- function d3_dispatch_event(dispatch) {
- var listeners = [], listenerByName = new d3_Map();
- function event() {
- var z = listeners, i = -1, n = z.length, l;
- while (++i < n) if (l = z[i].on) l.apply(this, arguments);
- return dispatch;
- }
- event.on = function(name, listener) {
- var l = listenerByName.get(name), i;
- if (arguments.length < 2) return l && l.on;
- if (l) {
- l.on = null;
- listeners = listeners.slice(0, i = listeners.indexOf(l)).concat(listeners.slice(i + 1));
- listenerByName.remove(name);
- }
- if (listener) listeners.push(listenerByName.set(name, {
- on: listener
- }));
- return dispatch;
- };
- return event;
- }
- d3.event = null;
- function d3_eventPreventDefault() {
- d3.event.preventDefault();
- }
- function d3_eventSource() {
- var e = d3.event, s;
- while (s = e.sourceEvent) e = s;
- return e;
- }
- function d3_eventDispatch(target) {
- var dispatch = new d3_dispatch(), i = 0, n = arguments.length;
- while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);
- dispatch.of = function(thiz, argumentz) {
- return function(e1) {
- try {
- var e0 = e1.sourceEvent = d3.event;
- e1.target = target;
- d3.event = e1;
- dispatch[e1.type].apply(thiz, argumentz);
- } finally {
- d3.event = e0;
- }
- };
- };
- return dispatch;
- }
- d3.requote = function(s) {
- return s.replace(d3_requote_re, "\\$&");
- };
- var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
- var d3_subclass = {}.__proto__ ? function(object, prototype) {
- object.__proto__ = prototype;
- } : function(object, prototype) {
- for (var property in prototype) object[property] = prototype[property];
- };
- function d3_selection(groups) {
- d3_subclass(groups, d3_selectionPrototype);
- return groups;
- }
- var d3_select = function(s, n) {
- return n.querySelector(s);
- }, d3_selectAll = function(s, n) {
- return n.querySelectorAll(s);
- }, d3_selectMatcher = d3_documentElement.matches || d3_documentElement[d3_vendorSymbol(d3_documentElement, "matchesSelector")], d3_selectMatches = function(n, s) {
- return d3_selectMatcher.call(n, s);
- };
- if (typeof Sizzle === "function") {
- d3_select = function(s, n) {
- return Sizzle(s, n)[0] || null;
- };
- d3_selectAll = Sizzle;
- d3_selectMatches = Sizzle.matchesSelector;
- }
- d3.selection = function() {
- return d3_selectionRoot;
- };
- var d3_selectionPrototype = d3.selection.prototype = [];
- d3_selectionPrototype.select = function(selector) {
- var subgroups = [], subgroup, subnode, group, node;
- selector = d3_selection_selector(selector);
- for (var j = -1, m = this.length; ++j < m; ) {
- subgroups.push(subgroup = []);
- subgroup.parentNode = (group = this[j]).parentNode;
- for (var i = -1, n = group.length; ++i < n; ) {
- if (node = group[i]) {
- subgroup.push(subnode = selector.call(node, node.__data__, i, j));
- if (subnode && "__data__" in node) subnode.__data__ = node.__data__;
- } else {
- subgroup.push(null);
- }
- }
- }
- return d3_selection(subgroups);
- };
- function d3_selection_selector(selector) {
- return typeof selector === "function" ? selector : function() {
- return d3_select(selector, this);
- };
- }
- d3_selectionPrototype.selectAll = function(selector) {
- var subgroups = [], subgroup, node;
- selector = d3_selection_selectorAll(selector);
- for (var j = -1, m = this.length; ++j < m; ) {
- for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
- if (node = group[i]) {
- subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i, j)));
- subgroup.parentNode = node;
- }
- }
- }
- return d3_selection(subgroups);
- };
- function d3_selection_selectorAll(selector) {
- return typeof selector === "function" ? selector : function() {
- return d3_selectAll(selector, this);
- };
- }
- var d3_nsPrefix = {
- svg: "http://www.w3.org/2000/svg",
- xhtml: "http://www.w3.org/1999/xhtml",
- xlink: "http://www.w3.org/1999/xlink",
- xml: "http://www.w3.org/XML/1998/namespace",
- xmlns: "http://www.w3.org/2000/xmlns/"
- };
- d3.ns = {
- prefix: d3_nsPrefix,
- qualify: function(name) {
- var i = name.indexOf(":"), prefix = name;
- if (i >= 0) {
- prefix = name.slice(0, i);
- name = name.slice(i + 1);
- }
- return d3_nsPrefix.hasOwnProperty(prefix) ? {
- space: d3_nsPrefix[prefix],
- local: name
- } : name;
- }
- };
- d3_selectionPrototype.attr = function(name, value) {
- if (arguments.length < 2) {
- if (typeof name === "string") {
- var node = this.node();
- name = d3.ns.qualify(name);
- return name.local ? node.getAttributeNS(name.space, name.local) : node.getAttribute(name);
- }
- for (value in name) this.each(d3_selection_attr(value, name[value]));
- return this;
- }
- return this.each(d3_selection_attr(name, value));
- };
- function d3_selection_attr(name, value) {
- name = d3.ns.qualify(name);
- function attrNull() {
- this.removeAttribute(name);
- }
- function attrNullNS() {
- this.removeAttributeNS(name.space, name.local);
- }
- function attrConstant() {
- this.setAttribute(name, value);
- }
- function attrConstantNS() {
- this.setAttributeNS(name.space, name.local, value);
- }
- function attrFunction() {
- var x = value.apply(this, arguments);
- if (x == null) this.removeAttribute(name); else this.setAttribute(name, x);
- }
- function attrFunctionNS() {
- var x = value.apply(this, arguments);
- if (x == null) this.removeAttributeNS(name.space, name.local); else this.setAttributeNS(name.space, name.local, x);
- }
- return value == null ? name.local ? attrNullNS : attrNull : typeof value === "function" ? name.local ? attrFunctionNS : attrFunction : name.local ? attrConstantNS : attrConstant;
- }
- function d3_collapse(s) {
- return s.trim().replace(/\s+/g, " ");
- }
- d3_selectionPrototype.classed = function(name, value) {
- if (arguments.length < 2) {
- if (typeof name === "string") {
- var node = this.node(), n = (name = d3_selection_classes(name)).length, i = -1;
- if (value = node.classList) {
- while (++i < n) if (!value.contains(name[i])) return false;
- } else {
- value = node.getAttribute("class");
- while (++i < n) if (!d3_selection_classedRe(name[i]).test(value)) return false;
- }
- return true;
- }
- for (value in name) this.each(d3_selection_classed(value, name[value]));
- return this;
- }
- return this.each(d3_selection_classed(name, value));
- };
- function d3_selection_classedRe(name) {
- return new RegExp("(?:^|\\s+)" + d3.requote(name) + "(?:\\s+|$)", "g");
- }
- function d3_selection_classes(name) {
- return (name + "").trim().split(/^|\s+/);
- }
- function d3_selection_classed(name, value) {
- name = d3_selection_classes(name).map(d3_selection_classedName);
- var n = name.length;
- function classedConstant() {
- var i = -1;
- while (++i < n) name[i](this, value);
- }
- function classedFunction() {
- var i = -1, x = value.apply(this, arguments);
- while (++i < n) name[i](this, x);
- }
- return typeof value === "function" ? classedFunction : classedConstant;
- }
- function d3_selection_classedName(name) {
- var re = d3_selection_classedRe(name);
- return function(node, value) {
- if (c = node.classList) return value ? c.add(name) : c.remove(name);
- var c = node.getAttribute("class") || "";
- if (value) {
- re.lastIndex = 0;
- if (!re.test(c)) node.setAttribute("class", d3_collapse(c + " " + name));
- } else {
- node.setAttribute("class", d3_collapse(c.replace(re, " ")));
- }
- };
- }
- d3_selectionPrototype.style = function(name, value, priority) {
- var n = arguments.length;
- if (n < 3) {
- if (typeof name !== "string") {
- if (n < 2) value = "";
- for (priority in name) this.each(d3_selection_style(priority, name[priority], value));
- return this;
- }
- if (n < 2) return d3_window.getComputedStyle(this.node(), null).getPropertyValue(name);
- priority = "";
- }
- return this.each(d3_selection_style(name, value, priority));
- };
- function d3_selection_style(name, value, priority) {
- function styleNull() {
- this.style.removeProperty(name);
- }
- function styleConstant() {
- this.style.setProperty(name, value, priority);
- }
- function styleFunction() {
- var x = value.apply(this, arguments);
- if (x == null) this.style.removeProperty(name); else this.style.setProperty(name, x, priority);
- }
- return value == null ? styleNull : typeof value === "function" ? styleFunction : styleConstant;
- }
- d3_selectionPrototype.property = function(name, value) {
- if (arguments.length < 2) {
- if (typeof name === "string") return this.node()[name];
- for (value in name) this.each(d3_selection_property(value, name[value]));
- return this;
- }
- return this.each(d3_selection_property(name, value));
- };
- function d3_selection_property(name, value) {
- function propertyNull() {
- delete this[name];
- }
- function propertyConstant() {
- this[name] = value;
- }
- function propertyFunction() {
- var x = value.apply(this, arguments);
- if (x == null) delete this[name]; else this[name] = x;
- }
- return value == null ? propertyNull : typeof value === "function" ? propertyFunction : propertyConstant;
- }
- d3_selectionPrototype.text = function(value) {
- return arguments.length ? this.each(typeof value === "function" ? function() {
- var v = value.apply(this, arguments);
- this.textContent = v == null ? "" : v;
- } : value == null ? function() {
- this.textContent = "";
- } : function() {
- this.textContent = value;
- }) : this.node().textContent;
- };
- d3_selectionPrototype.html = function(value) {
- return arguments.length ? this.each(typeof value === "function" ? function() {
- var v = value.apply(this, arguments);
- this.innerHTML = v == null ? "" : v;
- } : value == null ? function() {
- this.innerHTML = "";
- } : function() {
- this.innerHTML = value;
- }) : this.node().innerHTML;
- };
- d3_selectionPrototype.append = function(name) {
- name = d3_selection_creator(name);
- return this.select(function() {
- return this.appendChild(name.apply(this, arguments));
- });
- };
- function d3_selection_creator(name) {
- return typeof name === "function" ? name : (name = d3.ns.qualify(name)).local ? function() {
- return this.ownerDocument.createElementNS(name.space, name.local);
- } : function() {
- return this.ownerDocument.createElementNS(this.namespaceURI, name);
- };
- }
- d3_selectionPrototype.insert = function(name, before) {
- name = d3_selection_creator(name);
- before = d3_selection_selector(before);
- return this.select(function() {
- return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments) || null);
- });
- };
- d3_selectionPrototype.remove = function() {
- return this.each(function() {
- var parent = this.parentNode;
- if (parent) parent.removeChild(this);
- });
- };
- d3_selectionPrototype.data = function(value, key) {
- var i = -1, n = this.length, group, node;
- if (!arguments.length) {
- value = new Array(n = (group = this[0]).length);
- while (++i < n) {
- if (node = group[i]) {
- value[i] = node.__data__;
- }
- }
- return value;
- }
- function bind(group, groupData) {
- var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData;
- if (key) {
- var nodeByKeyValue = new d3_Map(), dataByKeyValue = new d3_Map(), keyValues = [], keyValue;
- for (i = -1; ++i < n; ) {
- keyValue = key.call(node = group[i], node.__data__, i);
- if (nodeByKeyValue.has(keyValue)) {
- exitNodes[i] = node;
- } else {
- nodeByKeyValue.set(keyValue, node);
- }
- keyValues.push(keyValue);
- }
- for (i = -1; ++i < m; ) {
- keyValue = key.call(groupData, nodeData = groupData[i], i);
- if (node = nodeByKeyValue.get(keyValue)) {
- updateNodes[i] = node;
- node.__data__ = nodeData;
- } else if (!dataByKeyValue.has(keyValue)) {
- enterNodes[i] = d3_selection_dataNode(nodeData);
- }
- dataByKeyValue.set(keyValue, nodeData);
- nodeByKeyValue.remove(keyValue);
- }
- for (i = -1; ++i < n; ) {
- if (nodeByKeyValue.has(keyValues[i])) {
- exitNodes[i] = group[i];
- }
- }
- } else {
- for (i = -1; ++i < n0; ) {
- node = group[i];
- nodeData = groupData[i];
- if (node) {
- node.__data__ = nodeData;
- updateNodes[i] = node;
- } else {
- enterNodes[i] = d3_selection_dataNode(nodeData);
- }
- }
- for (;i < m; ++i) {
- enterNodes[i] = d3_selection_dataNode(groupData[i]);
- }
- for (;i < n; ++i) {
- exitNodes[i] = group[i];
- }
- }
- enterNodes.update = updateNodes;
- enterNodes.parentNode = updateNodes.parentNode = exitNodes.parentNode = group.parentNode;
- enter.push(enterNodes);
- update.push(updateNodes);
- exit.push(exitNodes);
- }
- var enter = d3_selection_enter([]), update = d3_selection([]), exit = d3_selection([]);
- if (typeof value === "function") {
- while (++i < n) {
- bind(group = this[i], value.call(group, group.parentNode.__data__, i));
- }
- } else {
- while (++i < n) {
- bind(group = this[i], value);
- }
- }
- update.enter = function() {
- return enter;
- };
- update.exit = function() {
- return exit;
- };
- return update;
- };
- function d3_selection_dataNode(data) {
- return {
- __data__: data
- };
- }
- d3_selectionPrototype.datum = function(value) {
- return arguments.length ? this.property("__data__", value) : this.property("__data__");
- };
- d3_selectionPrototype.filter = function(filter) {
- var subgroups = [], subgroup, group, node;
- if (typeof filter !== "function") filter = d3_selection_filter(filter);
- for (var j = 0, m = this.length; j < m; j++) {
- subgroups.push(subgroup = []);
- subgroup.parentNode = (group = this[j]).parentNode;
- for (var i = 0, n = group.length; i < n; i++) {
- if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {
- subgroup.push(node);
- }
- }
- }
- return d3_selection(subgroups);
- };
- function d3_selection_filter(selector) {
- return function() {
- return d3_selectMatches(this, selector);
- };
- }
- d3_selectionPrototype.order = function() {
- for (var j = -1, m = this.length; ++j < m; ) {
- for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0; ) {
- if (node = group[i]) {
- if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next);
- next = node;
- }
- }
- }
- return this;
- };
- d3_selectionPrototype.sort = function(comparator) {
- comparator = d3_selection_sortComparator.apply(this, arguments);
- for (var j = -1, m = this.length; ++j < m; ) this[j].sort(comparator);
- return this.order();
- };
- function d3_selection_sortComparator(comparator) {
- if (!arguments.length) comparator = d3_ascending;
- return function(a, b) {
- return a && b ? comparator(a.__data__, b.__data__) : !a - !b;
- };
- }
- d3_selectionPrototype.each = function(callback) {
- return d3_selection_each(this, function(node, i, j) {
- callback.call(node, node.__data__, i, j);
- });
- };
- function d3_selection_each(groups, callback) {
- for (var j = 0, m = groups.length; j < m; j++) {
- for (var group = groups[j], i = 0, n = group.length, node; i < n; i++) {
- if (node = group[i]) callback(node, i, j);
- }
- }
- return groups;
- }
- d3_selectionPrototype.call = function(callback) {
- var args = d3_array(arguments);
- callback.apply(args[0] = this, args);
- return this;
- };
- d3_selectionPrototype.empty = function() {
- return !this.node();
- };
- d3_selectionPrototype.node = function() {
- for (var j = 0, m = this.length; j < m; j++) {
- for (var group = this[j], i = 0, n = group.length; i < n; i++) {
- var node = group[i];
- if (node) return node;
- }
- }
- return null;
- };
- d3_selectionPrototype.size = function() {
- var n = 0;
- d3_selection_each(this, function() {
- ++n;
- });
- return n;
- };
- function d3_selection_enter(selection) {
- d3_subclass(selection, d3_selection_enterPrototype);
- return selection;
- }
- var d3_selection_enterPrototype = [];
- d3.selection.enter = d3_selection_enter;
- d3.selection.enter.prototype = d3_selection_enterPrototype;
- d3_selection_enterPrototype.append = d3_selectionPrototype.append;
- d3_selection_enterPrototype.empty = d3_selectionPrototype.empty;
- d3_selection_enterPrototype.node = d3_selectionPrototype.node;
- d3_selection_enterPrototype.call = d3_selectionPrototype.call;
- d3_selection_enterPrototype.size = d3_selectionPrototype.size;
- d3_selection_enterPrototype.select = function(selector) {
- var subgroups = [], subgroup, subnode, upgroup, group, node;
- for (var j = -1, m = this.length; ++j < m; ) {
- upgroup = (group = this[j]).update;
- subgroups.push(subgroup = []);
- subgroup.parentNode = group.parentNode;
- for (var i = -1, n = group.length; ++i < n; ) {
- if (node = group[i]) {
- subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i, j));
- subnode.__data__ = node.__data__;
- } else {
- subgroup.push(null);
- }
- }
- }
- return d3_selection(subgroups);
- };
- d3_selection_enterPrototype.insert = function(name, before) {
- if (arguments.length < 2) before = d3_selection_enterInsertBefore(this);
- return d3_selectionPrototype.insert.call(this, name, before);
- };
- function d3_selection_enterInsertBefore(enter) {
- var i0, j0;
- return function(d, i, j) {
- var group = enter[j].update, n = group.length, node;
- if (j != j0) j0 = j, i0 = 0;
- if (i >= i0) i0 = i + 1;
- while (!(node = group[i0]) && ++i0 < n) ;
- return node;
- };
- }
- d3_selectionPrototype.transition = function() {
- var id = d3_transitionInheritId || ++d3_transitionId, subgroups = [], subgroup, node, transition = d3_transitionInherit || {
- time: Date.now(),
- ease: d3_ease_cubicInOut,
- delay: 0,
- duration: 250
- };
- for (var j = -1, m = this.length; ++j < m; ) {
- subgroups.push(subgroup = []);
- for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
- if (node = group[i]) d3_transitionNode(node, i, id, transition);
- subgroup.push(node);
- }
- }
- return d3_transition(subgroups, id);
- };
- d3_selectionPrototype.interrupt = function() {
- return this.each(d3_selection_interrupt);
- };
- function d3_selection_interrupt() {
- var lock = this.__transition__;
- if (lock) ++lock.active;
- }
- d3.select = function(node) {
- var group = [ typeof node === "string" ? d3_select(node, d3_document) : node ];
- group.parentNode = d3_documentElement;
- return d3_selection([ group ]);
- };
- d3.selectAll = function(nodes) {
- var group = d3_array(typeof nodes === "string" ? d3_selectAll(nodes, d3_document) : nodes);
- group.parentNode = d3_documentElement;
- return d3_selection([ group ]);
- };
- var d3_selectionRoot = d3.select(d3_documentElement);
- d3_selectionPrototype.on = function(type, listener, capture) {
- var n = arguments.length;
- if (n < 3) {
- if (typeof type !== "string") {
- if (n < 2) listener = false;
- for (capture in type) this.each(d3_selection_on(capture, type[capture], listener));
- return this;
- }
- if (n < 2) return (n = this.node()["__on" + type]) && n._;
- capture = false;
- }
- return this.each(d3_selection_on(type, listener, capture));
- };
- function d3_selection_on(type, listener, capture) {
- var name = "__on" + type, i = type.indexOf("."), wrap = d3_selection_onListener;
- if (i > 0) type = type.slice(0, i);
- var filter = d3_selection_onFilters.get(type);
- if (filter) type = filter, wrap = d3_selection_onFilter;
- function onRemove() {
- var l = this[name];
- if (l) {
- this.removeEventListener(type, l, l.$);
- delete this[name];
- }
- }
- function onAdd() {
- var l = wrap(listener, d3_array(arguments));
- onRemove.call(this);
- this.addEventListener(type, this[name] = l, l.$ = capture);
- l._ = listener;
- }
- function removeAll() {
- var re = new RegExp("^__on([^.]+)" + d3.requote(type) + "$"), match;
- for (var name in this) {
- if (match = name.match(re)) {
- var l = this[name];
- this.removeEventListener(match[1], l, l.$);
- delete this[name];
- }
- }
- }
- return i ? listener ? onAdd : onRemove : listener ? d3_noop : removeAll;
- }
- var d3_selection_onFilters = d3.map({
- mouseenter: "mouseover",
- mouseleave: "mouseout"
- });
- d3_selection_onFilters.forEach(function(k) {
- if ("on" + k in d3_document) d3_selection_onFilters.remove(k);
- });
- function d3_selection_onListener(listener, argumentz) {
- return function(e) {
- var o = d3.event;
- d3.event = e;
- argumentz[0] = this.__data__;
- try {
- listener.apply(this, argumentz);
- } finally {
- d3.event = o;
- }
- };
- }
- function d3_selection_onFilter(listener, argumentz) {
- var l = d3_selection_onListener(listener, argumentz);
- return function(e) {
- var target = this, related = e.relatedTarget;
- if (!related || related !== target && !(related.compareDocumentPosition(target) & 8)) {
- l.call(target, e);
- }
- };
- }
- var d3_event_dragSelect = "onselectstart" in d3_document ? null : d3_vendorSymbol(d3_documentElement.style, "userSelect"), d3_event_dragId = 0;
- function d3_event_dragSuppress() {
- var name = ".dragsuppress-" + ++d3_event_dragId, click = "click" + name, w = d3.select(d3_window).on("touchmove" + name, d3_eventPreventDefault).on("dragstart" + name, d3_eventPreventDefault).on("selectstart" + name, d3_eventPreventDefault);
- if (d3_event_dragSelect) {
- var style = d3_documentElement.style, select = style[d3_event_dragSelect];
- style[d3_event_dragSelect] = "none";
- }
- return function(suppressClick) {
- w.on(name, null);
- if (d3_event_dragSelect) style[d3_event_dragSelect] = select;
- if (suppressClick) {
- function off() {
- w.on(click, null);
- }
- w.on(click, function() {
- d3_eventPreventDefault();
- off();
- }, true);
- setTimeout(off, 0);
- }
- };
- }
- d3.mouse = function(container) {
- return d3_mousePoint(container, d3_eventSource());
- };
- var d3_mouse_bug44083 = /WebKit/.test(d3_window.navigator.userAgent) ? -1 : 0;
- function d3_mousePoint(container, e) {
- if (e.changedTouches) e = e.changedTouches[0];
- var svg = container.ownerSVGElement || container;
- if (svg.createSVGPoint) {
- var point = svg.createSVGPoint();
- if (d3_mouse_bug44083 < 0 && (d3_window.scrollX || d3_window.scrollY)) {
- svg = d3.select("body").append("svg").style({
- position: "absolute",
- top: 0,
- left: 0,
- margin: 0,
- padding: 0,
- border: "none"
- }, "important");
- var ctm = svg[0][0].getScreenCTM();
- d3_mouse_bug44083 = !(ctm.f || ctm.e);
- svg.remove();
- }
- if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX,
- point.y = e.clientY;
- point = point.matrixTransform(container.getScreenCTM().inverse());
- return [ point.x, point.y ];
- }
- var rect = container.getBoundingClientRect();
- return [ e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop ];
- }
- d3.touch = function(container, touches, identifier) {
- if (arguments.length < 3) identifier = touches, touches = d3_eventSource().changedTouches;
- if (touches) for (var i = 0, n = touches.length, touch; i < n; ++i) {
- if ((touch = touches[i]).identifier === identifier) {
- return d3_mousePoint(container, touch);
- }
- }
- };
- d3.behavior.drag = function() {
- var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_behavior_dragMouseSubject, "mousemove", "mouseup"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_behavior_dragTouchSubject, "touchmove", "touchend");
- function drag() {
- this.on("mousedown.drag", mousedown).on("touchstart.drag", touchstart);
- }
- function dragstart(id, position, subject, move, end) {
- return function() {
- var that = this, target = d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject()).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(), position0 = position(parent, dragId);
- if (origin) {
- dragOffset = origin.apply(that, arguments);
- dragOffset = [ dragOffset.x - position0[0], dragOffset.y - position0[1] ];
- } else {
- dragOffset = [ 0, 0 ];
- }
- dispatch({
- type: "dragstart"
- });
- function moved() {
- var position1 = position(parent, dragId), dx, dy;
- if (!position1) return;
- dx = position1[0] - position0[0];
- dy = position1[1] - position0[1];
- dragged |= dx | dy;
- position0 = position1;
- dispatch({
- type: "drag",
- x: position1[0] + dragOffset[0],
- y: position1[1] + dragOffset[1],
- dx: dx,
- dy: dy
- });
- }
- function ended() {
- if (!position(parent, dragId)) return;
- dragSubject.on(move + dragName, null).on(end + dragName, null);
- dragRestore(dragged && d3.event.target === target);
- dispatch({
- type: "dragend"
- });
- }
- };
- }
- drag.origin = function(x) {
- if (!arguments.length) return origin;
- origin = x;
- return drag;
- };
- return d3.rebind(drag, event, "on");
- };
- function d3_behavior_dragTouchId() {
- return d3.event.changedTouches[0].identifier;
- }
- function d3_behavior_dragTouchSubject() {
- return d3.event.target;
- }
- function d3_behavior_dragMouseSubject() {
- return d3_window;
- }
- d3.touches = function(container, touches) {
- if (arguments.length < 2) touches = d3_eventSource().touches;
- return touches ? d3_array(touches).map(function(touch) {
- var point = d3_mousePoint(container, touch);
- point.identifier = touch.identifier;
- return point;
- }) : [];
- };
- var π = Math.PI, τ = 2 * π, halfπ = π / 2, ε = 1e-6, ε2 = ε * ε, d3_radians = π / 180, d3_degrees = 180 / π;
- function d3_sgn(x) {
- return x > 0 ? 1 : x < 0 ? -1 : 0;
- }
- function d3_cross2d(a, b, c) {
- return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
- }
- function d3_acos(x) {
- return x > 1 ? 0 : x < -1 ? π : Math.acos(x);
- }
- function d3_asin(x) {
- return x > 1 ? halfπ : x < -1 ? -halfπ : Math.asin(x);
- }
- function d3_sinh(x) {
- return ((x = Math.exp(x)) - 1 / x) / 2;
- }
- function d3_cosh(x) {
- return ((x = Math.exp(x)) + 1 / x) / 2;
- }
- function d3_tanh(x) {
- return ((x = Math.exp(2 * x)) - 1) / (x + 1);
- }
- function d3_haversin(x) {
- return (x = Math.sin(x / 2)) * x;
- }
- var ρ = Math.SQRT2, ρ2 = 2, ρ4 = 4;
- d3.interpolateZoom = function(p0, p1) {
- var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2];
- var dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + ρ4 * d2) / (2 * w0 * ρ2 * d1), b1 = (w1 * w1 - w0 * w0 - ρ4 * d2) / (2 * w1 * ρ2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1), dr = r1 - r0, S = (dr || Math.log(w1 / w0)) / ρ;
- function interpolate(t) {
- var s = t * S;
- if (dr) {
- var coshr0 = d3_cosh(r0), u = w0 / (ρ2 * d1) * (coshr0 * d3_tanh(ρ * s + r0) - d3_sinh(r0));
- return [ ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / d3_cosh(ρ * s + r0) ];
- }
- return [ ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(ρ * s) ];
- }
- interpolate.duration = S * 1e3;
- return interpolate;
- };
- d3.behavior.zoom = function() {
- var view = {
- x: 0,
- y: 0,
- k: 1
- }, translate0, center0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, mousedown = "mousedown.zoom", mousemove = "mousemove.zoom", mouseup = "mouseup.zoom", mousewheelTimer, touchstart = "touchstart.zoom", touchtime, event = d3_eventDispatch(zoom, "zoomstart", "zoom", "zoomend"), x0, x1, y0, y1;
- function zoom(g) {
- g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on("dblclick.zoom", dblclicked).on(touchstart, touchstarted);
- }
- zoom.event = function(g) {
- g.each(function() {
- var dispatch = event.of(this, arguments), view1 = view;
- if (d3_transitionInheritId) {
- d3.select(this).transition().each("start.zoom", function() {
- view = this.__chart__ || {
- x: 0,
- y: 0,
- k: 1
- };
- zoomstarted(dispatch);
- }).tween("zoom:zoom", function() {
- var dx = size[0], dy = size[1], cx = dx / 2, cy = dy / 2, i = d3.interpolateZoom([ (cx - view.x) / view.k, (cy - view.y) / view.k, dx / view.k ], [ (cx - view1.x) / view1.k, (cy - view1.y) / view1.k, dx / view1.k ]);
- return function(t) {
- var l = i(t), k = dx / l[2];
- this.__chart__ = view = {
- x: cx - l[0] * k,
- y: cy - l[1] * k,
- k: k
- };
- zoomed(dispatch);
- };
- }).each("end.zoom", function() {
- zoomended(dispatch);
- });
- } else {
- this.__chart__ = view;
- zoomstarted(dispatch);
- zoomed(dispatch);
- zoomended(dispatch);
- }
- });
- };
- zoom.translate = function(_) {
- if (!arguments.length) return [ view.x, view.y ];
- view = {
- x: +_[0],
- y: +_[1],
- k: view.k
- };
- rescale();
- return zoom;
- };
- zoom.scale = function(_) {
- if (!arguments.length) return view.k;
- view = {
- x: view.x,
- y: view.y,
- k: +_
- };
- rescale();
- return zoom;
- };
- zoom.scaleExtent = function(_) {
- if (!arguments.length) return scaleExtent;
- scaleExtent = _ == null ? d3_behavior_zoomInfinity : [ +_[0], +_[1] ];
- return zoom;
- };
- zoom.center = function(_) {
- if (!arguments.length) return center;
- center = _ && [ +_[0], +_[1] ];
- return zoom;
- };
- zoom.size = function(_) {
- if (!arguments.length) return size;
- size = _ && [ +_[0], +_[1] ];
- return zoom;
- };
- zoom.x = function(z) {
- if (!arguments.length) return x1;
- x1 = z;
- x0 = z.copy();
- view = {
- x: 0,
- y: 0,
- k: 1
- };
- return zoom;
- };
- zoom.y = function(z) {
- if (!arguments.length) return y1;
- y1 = z;
- y0 = z.copy();
- view = {
- x: 0,
- y: 0,
- k: 1
- };
- return zoom;
- };
- function location(p) {
- return [ (p[0] - view.x) / view.k, (p[1] - view.y) / view.k ];
- }
- function point(l) {
- return [ l[0] * view.k + view.x, l[1] * view.k + view.y ];
- }
- function scaleTo(s) {
- view.k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], s));
- }
- function translateTo(p, l) {
- l = point(l);
- view.x += p[0] - l[0];
- view.y += p[1] - l[1];
- }
- function rescale() {
- if (x1) x1.domain(x0.range().map(function(x) {
- return (x - view.x) / view.k;
- }).map(x0.invert));
- if (y1) y1.domain(y0.range().map(function(y) {
- return (y - view.y) / view.k;
- }).map(y0.invert));
- }
- function zoomstarted(dispatch) {
- dispatch({
- type: "zoomstart"
- });
- }
- function zoomed(dispatch) {
- rescale();
- dispatch({
- type: "zoom",
- scale: view.k,
- translate: [ view.x, view.y ]
- });
- }
- function zoomended(dispatch) {
- dispatch({
- type: "zoomend"
- });
- }
- function mousedowned() {
- var that = this, target = d3.event.target, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress();
- d3_selection_interrupt.call(that);
- zoomstarted(dispatch);
- function moved() {
- dragged = 1;
- translateTo(d3.mouse(that), location0);
- zoomed(dispatch);
- }
- function ended() {
- subject.on(mousemove, null).on(mouseup, null);
- dragRestore(dragged && d3.event.target === target);
- zoomended(dispatch);
- }
- }
- function touchstarted() {
- var that = this, dispatch = event.of(that, arguments), locations0 = {}, distance0 = 0, scale0, zoomName = ".zoom-" + d3.event.changedTouches[0].identifier, touchmove = "touchmove" + zoomName, touchend = "touchend" + zoomName, targets = [], subject = d3.select(that), dragRestore = d3_event_dragSuppress();
- d3_selection_interrupt.call(that);
- started();
- zoomstarted(dispatch);
- subject.on(mousedown, null).on(touchstart, started);
- function relocate() {
- var touches = d3.touches(that);
- scale0 = view.k;
- touches.forEach(function(t) {
- if (t.identifier in locations0) locations0[t.identifier] = location(t);
- });
- return touches;
- }
- function started() {
- var target = d3.event.target;
- d3.select(target).on(touchmove, moved).on(touchend, ended);
- targets.push(target);
- var changed = d3.event.changedTouches;
- for (var i = 0, n = changed.length; i < n; ++i) {
- locations0[changed[i].identifier] = null;
- }
- var touches = relocate(), now = Date.now();
- if (touches.length === 1) {
- if (now - touchtime < 500) {
- var p = touches[0], l = locations0[p.identifier];
- scaleTo(view.k * 2);
- translateTo(p, l);
- d3_eventPreventDefault();
- zoomed(dispatch);
- }
- touchtime = now;
- } else if (touches.length > 1) {
- var p = touches[0], q = touches[1], dx = p[0] - q[0], dy = p[1] - q[1];
- distance0 = dx * dx + dy * dy;
- }
- }
- function moved() {
- var touches = d3.touches(that), p0, l0, p1, l1;
- for (var i = 0, n = touches.length; i < n; ++i, l1 = null) {
- p1 = touches[i];
- if (l1 = locations0[p1.identifier]) {
- if (l0) break;
- p0 = p1, l0 = l1;
- }
- }
- if (l1) {
- var distance1 = (distance1 = p1[0] - p0[0]) * distance1 + (distance1 = p1[1] - p0[1]) * distance1, scale1 = distance0 && Math.sqrt(distance1 / distance0);
- p0 = [ (p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2 ];
- l0 = [ (l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2 ];
- scaleTo(scale1 * scale0);
- }
- touchtime = null;
- translateTo(p0, l0);
- zoomed(dispatch);
- }
- function ended() {
- if (d3.event.touches.length) {
- var changed = d3.event.changedTouches;
- for (var i = 0, n = changed.length; i < n; ++i) {
- delete locations0[changed[i].identifier];
- }
- for (var identifier in locations0) {
- return void relocate();
- }
- }
- d3.selectAll(targets).on(zoomName, null);
- subject.on(mousedown, mousedowned).on(touchstart, touchstarted);
- dragRestore();
- zoomended(dispatch);
- }
- }
- function mousewheeled() {
- var dispatch = event.of(this, arguments);
- if (mousewheelTimer) clearTimeout(mousewheelTimer); else translate0 = location(center0 = center || d3.mouse(this)),
- d3_selection_interrupt.call(this), zoomstarted(dispatch);
- mousewheelTimer = setTimeout(function() {
- mousewheelTimer = null;
- zoomended(dispatch);
- }, 50);
- d3_eventPreventDefault();
- scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k);
- translateTo(center0, translate0);
- zoomed(dispatch);
- }
- function dblclicked() {
- var dispatch = event.of(this, arguments), p = d3.mouse(this), l = location(p), k = Math.log(view.k) / Math.LN2;
- zoomstarted(dispatch);
- scaleTo(Math.pow(2, d3.event.shiftKey ? Math.ceil(k) - 1 : Math.floor(k) + 1));
- translateTo(p, l);
- zoomed(dispatch);
- zoomended(dispatch);
- }
- return d3.rebind(zoom, event, "on");
- };
- var d3_behavior_zoomInfinity = [ 0, Infinity ];
- var d3_behavior_zoomDelta, d3_behavior_zoomWheel = "onwheel" in d3_document ? (d3_behavior_zoomDelta = function() {
- return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1);
- }, "wheel") : "onmousewheel" in d3_document ? (d3_behavior_zoomDelta = function() {
- return d3.event.wheelDelta;
- }, "mousewheel") : (d3_behavior_zoomDelta = function() {
- return -d3.event.detail;
- }, "MozMousePixelScroll");
- d3.color = d3_color;
- function d3_color() {}
- d3_color.prototype.toString = function() {
- return this.rgb() + "";
- };
- d3.hsl = d3_hsl;
- function d3_hsl(h, s, l) {
- return this instanceof d3_hsl ? void (this.h = +h, this.s = +s, this.l = +l) : arguments.length < 2 ? h instanceof d3_hsl ? new d3_hsl(h.h, h.s, h.l) : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl) : new d3_hsl(h, s, l);
- }
- var d3_hslPrototype = d3_hsl.prototype = new d3_color();
- d3_hslPrototype.brighter = function(k) {
- k = Math.pow(.7, arguments.length ? k : 1);
- return new d3_hsl(this.h, this.s, this.l / k);
- };
- d3_hslPrototype.darker = function(k) {
- k = Math.pow(.7, arguments.length ? k : 1);
- return new d3_hsl(this.h, this.s, k * this.l);
- };
- d3_hslPrototype.rgb = function() {
- return d3_hsl_rgb(this.h, this.s, this.l);
- };
- function d3_hsl_rgb(h, s, l) {
- var m1, m2;
- h = isNaN(h) ? 0 : (h %= 360) < 0 ? h + 360 : h;
- s = isNaN(s) ? 0 : s < 0 ? 0 : s > 1 ? 1 : s;
- l = l < 0 ? 0 : l > 1 ? 1 : l;
- m2 = l <= .5 ? l * (1 + s) : l + s - l * s;
- m1 = 2 * l - m2;
- function v(h) {
- if (h > 360) h -= 360; else if (h < 0) h += 360;
- if (h < 60) return m1 + (m2 - m1) * h / 60;
- if (h < 180) return m2;
- if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60;
- return m1;
- }
- function vv(h) {
- return Math.round(v(h) * 255);
- }
- return new d3_rgb(vv(h + 120), vv(h), vv(h - 120));
- }
- d3.hcl = d3_hcl;
- function d3_hcl(h, c, l) {
- return this instanceof d3_hcl ? void (this.h = +h, this.c = +c, this.l = +l) : arguments.length < 2 ? h instanceof d3_hcl ? new d3_hcl(h.h, h.c, h.l) : h instanceof d3_lab ? d3_lab_hcl(h.l, h.a, h.b) : d3_lab_hcl((h = d3_rgb_lab((h = d3.rgb(h)).r, h.g, h.b)).l, h.a, h.b) : new d3_hcl(h, c, l);
- }
- var d3_hclPrototype = d3_hcl.prototype = new d3_color();
- d3_hclPrototype.brighter = function(k) {
- return new d3_hcl(this.h, this.c, Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)));
- };
- d3_hclPrototype.darker = function(k) {
- return new d3_hcl(this.h, this.c, Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)));
- };
- d3_hclPrototype.rgb = function() {
- return d3_hcl_lab(this.h, this.c, this.l).rgb();
- };
- function d3_hcl_lab(h, c, l) {
- if (isNaN(h)) h = 0;
- if (isNaN(c)) c = 0;
- return new d3_lab(l, Math.cos(h *= d3_radians) * c, Math.sin(h) * c);
- }
- d3.lab = d3_lab;
- function d3_lab(l, a, b) {
- return this instanceof d3_lab ? void (this.l = +l, this.a = +a, this.b = +b) : arguments.length < 2 ? l instanceof d3_lab ? new d3_lab(l.l, l.a, l.b) : l instanceof d3_hcl ? d3_hcl_lab(l.l, l.c, l.h) : d3_rgb_lab((l = d3_rgb(l)).r, l.g, l.b) : new d3_lab(l, a, b);
- }
- var d3_lab_K = 18;
- var d3_lab_X = .95047, d3_lab_Y = 1, d3_lab_Z = 1.08883;
- var d3_labPrototype = d3_lab.prototype = new d3_color();
- d3_labPrototype.brighter = function(k) {
- return new d3_lab(Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);
- };
- d3_labPrototype.darker = function(k) {
- return new d3_lab(Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);
- };
- d3_labPrototype.rgb = function() {
- return d3_lab_rgb(this.l, this.a, this.b);
- };
- function d3_lab_rgb(l, a, b) {
- var y = (l + 16) / 116, x = y + a / 500, z = y - b / 200;
- x = d3_lab_xyz(x) * d3_lab_X;
- y = d3_lab_xyz(y) * d3_lab_Y;
- z = d3_lab_xyz(z) * d3_lab_Z;
- return new d3_rgb(d3_xyz_rgb(3.2404542 * x - 1.5371385 * y - .4985314 * z), d3_xyz_rgb(-.969266 * x + 1.8760108 * y + .041556 * z), d3_xyz_rgb(.0556434 * x - .2040259 * y + 1.0572252 * z));
- }
- function d3_lab_hcl(l, a, b) {
- return l > 0 ? new d3_hcl(Math.atan2(b, a) * d3_degrees, Math.sqrt(a * a + b * b), l) : new d3_hcl(NaN, NaN, l);
- }
- function d3_lab_xyz(x) {
- return x > .206893034 ? x * x * x : (x - 4 / 29) / 7.787037;
- }
- function d3_xyz_lab(x) {
- return x > .008856 ? Math.pow(x, 1 / 3) : 7.787037 * x + 4 / 29;
- }
- function d3_xyz_rgb(r) {
- return Math.round(255 * (r <= .00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - .055));
- }
- d3.rgb = d3_rgb;
- function d3_rgb(r, g, b) {
- return this instanceof d3_rgb ? void (this.r = ~~r, this.g = ~~g, this.b = ~~b) : arguments.length < 2 ? r instanceof d3_rgb ? new d3_rgb(r.r, r.g, r.b) : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb) : new d3_rgb(r, g, b);
- }
- function d3_rgbNumber(value) {
- return new d3_rgb(value >> 16, value >> 8 & 255, value & 255);
- }
- function d3_rgbString(value) {
- return d3_rgbNumber(value) + "";
- }
- var d3_rgbPrototype = d3_rgb.prototype = new d3_color();
- d3_rgbPrototype.brighter = function(k) {
- k = Math.pow(.7, arguments.length ? k : 1);
- var r = this.r, g = this.g, b = this.b, i = 30;
- if (!r && !g && !b) return new d3_rgb(i, i, i);
- if (r && r < i) r = i;
- if (g && g < i) g = i;
- if (b && b < i) b = i;
- return new d3_rgb(Math.min(255, r / k), Math.min(255, g / k), Math.min(255, b / k));
- };
- d3_rgbPrototype.darker = function(k) {
- k = Math.pow(.7, arguments.length ? k : 1);
- return new d3_rgb(k * this.r, k * this.g, k * this.b);
- };
- d3_rgbPrototype.hsl = function() {
- return d3_rgb_hsl(this.r, this.g, this.b);
- };
- d3_rgbPrototype.toString = function() {
- return "#" + d3_rgb_hex(this.r) + d3_rgb_hex(this.g) + d3_rgb_hex(this.b);
- };
- function d3_rgb_hex(v) {
- return v < 16 ? "0" + Math.max(0, v).toString(16) : Math.min(255, v).toString(16);
- }
- function d3_rgb_parse(format, rgb, hsl) {
- var r = 0, g = 0, b = 0, m1, m2, color;
- m1 = /([a-z]+)\((.*)\)/i.exec(format);
- if (m1) {
- m2 = m1[2].split(",");
- switch (m1[1]) {
- case "hsl":
- {
- return hsl(parseFloat(m2[0]), parseFloat(m2[1]) / 100, parseFloat(m2[2]) / 100);
- }
-
- case "rgb":
- {
- return rgb(d3_rgb_parseNumber(m2[0]), d3_rgb_parseNumber(m2[1]), d3_rgb_parseNumber(m2[2]));
- }
- }
- }
- if (color = d3_rgb_names.get(format)) return rgb(color.r, color.g, color.b);
- if (format != null && format.charAt(0) === "#" && !isNaN(color = parseInt(format.slice(1), 16))) {
- if (format.length === 4) {
- r = (color & 3840) >> 4;
- r = r >> 4 | r;
- g = color & 240;
- g = g >> 4 | g;
- b = color & 15;
- b = b << 4 | b;
- } else if (format.length === 7) {
- r = (color & 16711680) >> 16;
- g = (color & 65280) >> 8;
- b = color & 255;
- }
- }
- return rgb(r, g, b);
- }
- function d3_rgb_hsl(r, g, b) {
- var min = Math.min(r /= 255, g /= 255, b /= 255), max = Math.max(r, g, b), d = max - min, h, s, l = (max + min) / 2;
- if (d) {
- s = l < .5 ? d / (max + min) : d / (2 - max - min);
- if (r == max) h = (g - b) / d + (g < b ? 6 : 0); else if (g == max) h = (b - r) / d + 2; else h = (r - g) / d + 4;
- h *= 60;
- } else {
- h = NaN;
- s = l > 0 && l < 1 ? 0 : h;
- }
- return new d3_hsl(h, s, l);
- }
- function d3_rgb_lab(r, g, b) {
- r = d3_rgb_xyz(r);
- g = d3_rgb_xyz(g);
- b = d3_rgb_xyz(b);
- var x = d3_xyz_lab((.4124564 * r + .3575761 * g + .1804375 * b) / d3_lab_X), y = d3_xyz_lab((.2126729 * r + .7151522 * g + .072175 * b) / d3_lab_Y), z = d3_xyz_lab((.0193339 * r + .119192 * g + .9503041 * b) / d3_lab_Z);
- return d3_lab(116 * y - 16, 500 * (x - y), 200 * (y - z));
- }
- function d3_rgb_xyz(r) {
- return (r /= 255) <= .04045 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4);
- }
- function d3_rgb_parseNumber(c) {
- var f = parseFloat(c);
- return c.charAt(c.length - 1) === "%" ? Math.round(f * 2.55) : f;
- }
- var d3_rgb_names = d3.map({
- aliceblue: 15792383,
- antiquewhite: 16444375,
- aqua: 65535,
- aquamarine: 8388564,
- azure: 15794175,
- beige: 16119260,
- bisque: 16770244,
- black: 0,
- blanchedalmond: 16772045,
- blue: 255,
- blueviolet: 9055202,
- brown: 10824234,
- burlywood: 14596231,
- cadetblue: 6266528,
- chartreuse: 8388352,
- chocolate: 13789470,
- coral: 16744272,
- cornflowerblue: 6591981,
- cornsilk: 16775388,
- crimson: 14423100,
- cyan: 65535,
- darkblue: 139,
- darkcyan: 35723,
- darkgoldenrod: 12092939,
- darkgray: 11119017,
- darkgreen: 25600,
- darkgrey: 11119017,
- darkkhaki: 12433259,
- darkmagenta: 9109643,
- darkolivegreen: 5597999,
- darkorange: 16747520,
- darkorchid: 10040012,
- darkred: 9109504,
- darksalmon: 15308410,
- darkseagreen: 9419919,
- darkslateblue: 4734347,
- darkslategray: 3100495,
- darkslategrey: 3100495,
- darkturquoise: 52945,
- darkviolet: 9699539,
- deeppink: 16716947,
- deepskyblue: 49151,
- dimgray: 6908265,
- dimgrey: 6908265,
- dodgerblue: 2003199,
- firebrick: 11674146,
- floralwhite: 16775920,
- forestgreen: 2263842,
- fuchsia: 16711935,
- gainsboro: 14474460,
- ghostwhite: 16316671,
- gold: 16766720,
- goldenrod: 14329120,
- gray: 8421504,
- green: 32768,
- greenyellow: 11403055,
- grey: 8421504,
- honeydew: 15794160,
- hotpink: 16738740,
- indianred: 13458524,
- indigo: 4915330,
- ivory: 16777200,
- khaki: 15787660,
- lavender: 15132410,
- lavenderblush: 16773365,
- lawngreen: 8190976,
- lemonchiffon: 16775885,
- lightblue: 11393254,
- lightcoral: 15761536,
- lightcyan: 14745599,
- lightgoldenrodyellow: 16448210,
- lightgray: 13882323,
- lightgreen: 9498256,
- lightgrey: 13882323,
- lightpink: 16758465,
- lightsalmon: 16752762,
- lightseagreen: 2142890,
- lightskyblue: 8900346,
- lightslategray: 7833753,
- lightslategrey: 7833753,
- lightsteelblue: 11584734,
- lightyellow: 16777184,
- lime: 65280,
- limegreen: 3329330,
- linen: 16445670,
- magenta: 16711935,
- maroon: 8388608,
- mediumaquamarine: 6737322,
- mediumblue: 205,
- mediumorchid: 12211667,
- mediumpurple: 9662683,
- mediumseagreen: 3978097,
- mediumslateblue: 8087790,
- mediumspringgreen: 64154,
- mediumturquoise: 4772300,
- mediumvioletred: 13047173,
- midnightblue: 1644912,
- mintcream: 16121850,
- mistyrose: 16770273,
- moccasin: 16770229,
- navajowhite: 16768685,
- navy: 128,
- oldlace: 16643558,
- olive: 8421376,
- olivedrab: 7048739,
- orange: 16753920,
- orangered: 16729344,
- orchid: 14315734,
- palegoldenrod: 15657130,
- palegreen: 10025880,
- paleturquoise: 11529966,
- palevioletred: 14381203,
- papayawhip: 16773077,
- peachpuff: 16767673,
- peru: 13468991,
- pink: 16761035,
- plum: 14524637,
- powderblue: 11591910,
- purple: 8388736,
- red: 16711680,
- rosybrown: 12357519,
- royalblue: 4286945,
- saddlebrown: 9127187,
- salmon: 16416882,
- sandybrown: 16032864,
- seagreen: 3050327,
- seashell: 16774638,
- sienna: 10506797,
- silver: 12632256,
- skyblue: 8900331,
- slateblue: 6970061,
- slategray: 7372944,
- slategrey: 7372944,
- snow: 16775930,
- springgreen: 65407,
- steelblue: 4620980,
- tan: 13808780,
- teal: 32896,
- thistle: 14204888,
- tomato: 16737095,
- turquoise: 4251856,
- violet: 15631086,
- wheat: 16113331,
- white: 16777215,
- whitesmoke: 16119285,
- yellow: 16776960,
- yellowgreen: 10145074
- });
- d3_rgb_names.forEach(function(key, value) {
- d3_rgb_names.set(key, d3_rgbNumber(value));
- });
- function d3_functor(v) {
- return typeof v === "function" ? v : function() {
- return v;
- };
- }
- d3.functor = d3_functor;
- function d3_identity(d) {
- return d;
- }
- d3.xhr = d3_xhrType(d3_identity);
- function d3_xhrType(response) {
- return function(url, mimeType, callback) {
- if (arguments.length === 2 && typeof mimeType === "function") callback = mimeType,
- mimeType = null;
- return d3_xhr(url, mimeType, response, callback);
- };
- }
- function d3_xhr(url, mimeType, response, callback) {
- var xhr = {}, dispatch = d3.dispatch("beforesend", "progress", "load", "error"), headers = {}, request = new XMLHttpRequest(), responseType = null;
- if (d3_window.XDomainRequest && !("withCredentials" in request) && /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest();
- "onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() {
- request.readyState > 3 && respond();
- };
- function respond() {
- var status = request.status, result;
- if (!status && d3_xhrHasResponse(request) || status >= 200 && status < 300 || status === 304) {
- try {
- result = response.call(xhr, request);
- } catch (e) {
- dispatch.error.call(xhr, e);
- return;
- }
- dispatch.load.call(xhr, result);
- } else {
- dispatch.error.call(xhr, request);
- }
- }
- request.onprogress = function(event) {
- var o = d3.event;
- d3.event = event;
- try {
- dispatch.progress.call(xhr, request);
- } finally {
- d3.event = o;
- }
- };
- xhr.header = function(name, value) {
- name = (name + "").toLowerCase();
- if (arguments.length < 2) return headers[name];
- if (value == null) delete headers[name]; else headers[name] = value + "";
- return xhr;
- };
- xhr.mimeType = function(value) {
- if (!arguments.length) return mimeType;
- mimeType = value == null ? null : value + "";
- return xhr;
- };
- xhr.responseType = function(value) {
- if (!arguments.length) return responseType;
- responseType = value;
- return xhr;
- };
- xhr.response = function(value) {
- response = value;
- return xhr;
- };
- [ "get", "post" ].forEach(function(method) {
- xhr[method] = function() {
- return xhr.send.apply(xhr, [ method ].concat(d3_array(arguments)));
- };
- });
- xhr.send = function(method, data, callback) {
- if (arguments.length === 2 && typeof data === "function") callback = data, data = null;
- request.open(method, url, true);
- if (mimeType != null && !("accept" in headers)) headers["accept"] = mimeType + ",*/*";
- if (request.setRequestHeader) for (var name in headers) request.setRequestHeader(name, headers[name]);
- if (mimeType != null && request.overrideMimeType) request.overrideMimeType(mimeType);
- if (responseType != null) request.responseType = responseType;
- if (callback != null) xhr.on("error", callback).on("load", function(request) {
- callback(null, request);
- });
- dispatch.beforesend.call(xhr, request);
- request.send(data == null ? null : data);
- return xhr;
- };
- xhr.abort = function() {
- request.abort();
- return xhr;
- };
- d3.rebind(xhr, dispatch, "on");
- return callback == null ? xhr : xhr.get(d3_xhr_fixCallback(callback));
- }
- function d3_xhr_fixCallback(callback) {
- return callback.length === 1 ? function(error, request) {
- callback(error == null ? request : null);
- } : callback;
- }
- function d3_xhrHasResponse(request) {
- var type = request.responseType;
- return type && type !== "text" ? request.response : request.responseText;
- }
- d3.dsv = function(delimiter, mimeType) {
- var reFormat = new RegExp('["' + delimiter + "\n]"), delimiterCode = delimiter.charCodeAt(0);
- function dsv(url, row, callback) {
- if (arguments.length < 3) callback = row, row = null;
- var xhr = d3_xhr(url, mimeType, row == null ? response : typedResponse(row), callback);
- xhr.row = function(_) {
- return arguments.length ? xhr.response((row = _) == null ? response : typedResponse(_)) : row;
- };
- return xhr;
- }
- function response(request) {
- return dsv.parse(request.responseText);
- }
- function typedResponse(f) {
- return function(request) {
- return dsv.parse(request.responseText, f);
- };
- }
- dsv.parse = function(text, f) {
- var o;
- return dsv.parseRows(text, function(row, i) {
- if (o) return o(row, i - 1);
- var a = new Function("d", "return {" + row.map(function(name, i) {
- return JSON.stringify(name) + ": d[" + i + "]";
- }).join(",") + "}");
- o = f ? function(row, i) {
- return f(a(row), i);
- } : a;
- });
- };
- dsv.parseRows = function(text, f) {
- var EOL = {}, EOF = {}, rows = [], N = text.length, I = 0, n = 0, t, eol;
- function token() {
- if (I >= N) return EOF;
- if (eol) return eol = false, EOL;
- var j = I;
- if (text.charCodeAt(j) === 34) {
- var i = j;
- while (i++ < N) {
- if (text.charCodeAt(i) === 34) {
- if (text.charCodeAt(i + 1) !== 34) break;
- ++i;
- }
- }
- I = i + 2;
- var c = text.charCodeAt(i + 1);
- if (c === 13) {
- eol = true;
- if (text.charCodeAt(i + 2) === 10) ++I;
- } else if (c === 10) {
- eol = true;
- }
- return text.slice(j + 1, i).replace(/""/g, '"');
- }
- while (I < N) {
- var c = text.charCodeAt(I++), k = 1;
- if (c === 10) eol = true; else if (c === 13) {
- eol = true;
- if (text.charCodeAt(I) === 10) ++I, ++k;
- } else if (c !== delimiterCode) continue;
- return text.slice(j, I - k);
- }
- return text.slice(j);
- }
- while ((t = token()) !== EOF) {
- var a = [];
- while (t !== EOL && t !== EOF) {
- a.push(t);
- t = token();
- }
- if (f && !(a = f(a, n++))) continue;
- rows.push(a);
- }
- return rows;
- };
- dsv.format = function(rows) {
- if (Array.isArray(rows[0])) return dsv.formatRows(rows);
- var fieldSet = new d3_Set(), fields = [];
- rows.forEach(function(row) {
- for (var field in row) {
- if (!fieldSet.has(field)) {
- fields.push(fieldSet.add(field));
- }
- }
- });
- return [ fields.map(formatValue).join(delimiter) ].concat(rows.map(function(row) {
- return fields.map(function(field) {
- return formatValue(row[field]);
- }).join(delimiter);
- })).join("\n");
- };
- dsv.formatRows = function(rows) {
- return rows.map(formatRow).join("\n");
- };
- function formatRow(row) {
- return row.map(formatValue).join(delimiter);
- }
- function formatValue(text) {
- return reFormat.test(text) ? '"' + text.replace(/\"/g, '""') + '"' : text;
- }
- return dsv;
- };
- d3.csv = d3.dsv(",", "text/csv");
- d3.tsv = d3.dsv(" ", "text/tab-separated-values");
- var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_active, d3_timer_frame = d3_window[d3_vendorSymbol(d3_window, "requestAnimationFrame")] || function(callback) {
- setTimeout(callback, 17);
- };
- d3.timer = function(callback, delay, then) {
- var n = arguments.length;
- if (n < 2) delay = 0;
- if (n < 3) then = Date.now();
- var time = then + delay, timer = {
- c: callback,
- t: time,
- f: false,
- n: null
- };
- if (d3_timer_queueTail) d3_timer_queueTail.n = timer; else d3_timer_queueHead = timer;
- d3_timer_queueTail = timer;
- if (!d3_timer_interval) {
- d3_timer_timeout = clearTimeout(d3_timer_timeout);
- d3_timer_interval = 1;
- d3_timer_frame(d3_timer_step);
- }
- };
- function d3_timer_step() {
- var now = d3_timer_mark(), delay = d3_timer_sweep() - now;
- if (delay > 24) {
- if (isFinite(delay)) {
- clearTimeout(d3_timer_timeout);
- d3_timer_timeout = setTimeout(d3_timer_step, delay);
- }
- d3_timer_interval = 0;
- } else {
- d3_timer_interval = 1;
- d3_timer_frame(d3_timer_step);
- }
- }
- d3.timer.flush = function() {
- d3_timer_mark();
- d3_timer_sweep();
- };
- function d3_timer_mark() {
- var now = Date.now();
- d3_timer_active = d3_timer_queueHead;
- while (d3_timer_active) {
- if (now >= d3_timer_active.t) d3_timer_active.f = d3_timer_active.c(now - d3_timer_active.t);
- d3_timer_active = d3_timer_active.n;
- }
- return now;
- }
- function d3_timer_sweep() {
- var t0, t1 = d3_timer_queueHead, time = Infinity;
- while (t1) {
- if (t1.f) {
- t1 = t0 ? t0.n = t1.n : d3_timer_queueHead = t1.n;
- } else {
- if (t1.t < time) time = t1.t;
- t1 = (t0 = t1).n;
- }
- }
- d3_timer_queueTail = t0;
- return time;
- }
- function d3_format_precision(x, p) {
- return p - (x ? Math.ceil(Math.log(x) / Math.LN10) : 1);
- }
- d3.round = function(x, n) {
- return n ? Math.round(x * (n = Math.pow(10, n))) / n : Math.round(x);
- };
- var d3_formatPrefixes = [ "y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" ].map(d3_formatPrefix);
- d3.formatPrefix = function(value, precision) {
- var i = 0;
- if (value) {
- if (value < 0) value *= -1;
- if (precision) value = d3.round(value, d3_format_precision(value, precision));
- i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10);
- i = Math.max(-24, Math.min(24, Math.floor((i - 1) / 3) * 3));
- }
- return d3_formatPrefixes[8 + i / 3];
- };
- function d3_formatPrefix(d, i) {
- var k = Math.pow(10, abs(8 - i) * 3);
- return {
- scale: i > 8 ? function(d) {
- return d / k;
- } : function(d) {
- return d * k;
- },
- symbol: d
- };
- }
- function d3_locale_numberFormat(locale) {
- var locale_decimal = locale.decimal, locale_thousands = locale.thousands, locale_grouping = locale.grouping, locale_currency = locale.currency, formatGroup = locale_grouping ? function(value) {
- var i = value.length, t = [], j = 0, g = locale_grouping[0];
- while (g > 0 && i > 0) {
- t.push(value.substring(i -= g, i + g));
- g = locale_grouping[j = (j + 1) % locale_grouping.length];
- }
- return t.reverse().join(locale_thousands);
- } : d3_identity;
- return function(specifier) {
- var match = d3_format_re.exec(specifier), fill = match[1] || " ", align = match[2] || ">", sign = match[3] || "", symbol = match[4] || "", zfill = match[5], width = +match[6], comma = match[7], precision = match[8], type = match[9], scale = 1, prefix = "", suffix = "", integer = false;
- if (precision) precision = +precision.substring(1);
- if (zfill || fill === "0" && align === "=") {
- zfill = fill = "0";
- align = "=";
- if (comma) width -= Math.floor((width - 1) / 4);
- }
- switch (type) {
- case "n":
- comma = true;
- type = "g";
- break;
-
- case "%":
- scale = 100;
- suffix = "%";
- type = "f";
- break;
-
- case "p":
- scale = 100;
- suffix = "%";
- type = "r";
- break;
-
- case "b":
- case "o":
- case "x":
- case "X":
- if (symbol === "#") prefix = "0" + type.toLowerCase();
-
- case "c":
- case "d":
- integer = true;
- precision = 0;
- break;
-
- case "s":
- scale = -1;
- type = "r";
- break;
- }
- if (symbol === "$") prefix = locale_currency[0], suffix = locale_currency[1];
- if (type == "r" && !precision) type = "g";
- if (precision != null) {
- if (type == "g") precision = Math.max(1, Math.min(21, precision)); else if (type == "e" || type == "f") precision = Math.max(0, Math.min(20, precision));
- }
- type = d3_format_types.get(type) || d3_format_typeDefault;
- var zcomma = zfill && comma;
- return function(value) {
- var fullSuffix = suffix;
- if (integer && value % 1) return "";
- var negative = value < 0 || value === 0 && 1 / value < 0 ? (value = -value, "-") : sign;
- if (scale < 0) {
- var unit = d3.formatPrefix(value, precision);
- value = unit.scale(value);
- fullSuffix = unit.symbol + suffix;
- } else {
- value *= scale;
- }
- value = type(value, precision);
- var i = value.lastIndexOf("."), before = i < 0 ? value : value.substring(0, i), after = i < 0 ? "" : locale_decimal + value.substring(i + 1);
- if (!zfill && comma) before = formatGroup(before);
- var length = prefix.length + before.length + after.length + (zcomma ? 0 : negative.length), padding = length < width ? new Array(length = width - length + 1).join(fill) : "";
- if (zcomma) before = formatGroup(padding + before);
- negative += prefix;
- value = before + after;
- return (align === "<" ? negative + value + padding : align === ">" ? padding + negative + value : align === "^" ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) : negative + (zcomma ? value : padding + value)) + fullSuffix;
- };
- };
- }
- var d3_format_re = /(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i;
- var d3_format_types = d3.map({
- b: function(x) {
- return x.toString(2);
- },
- c: function(x) {
- return String.fromCharCode(x);
- },
- o: function(x) {
- return x.toString(8);
- },
- x: function(x) {
- return x.toString(16);
- },
- X: function(x) {
- return x.toString(16).toUpperCase();
- },
- g: function(x, p) {
- return x.toPrecision(p);
- },
- e: function(x, p) {
- return x.toExponential(p);
- },
- f: function(x, p) {
- return x.toFixed(p);
- },
- r: function(x, p) {
- return (x = d3.round(x, d3_format_precision(x, p))).toFixed(Math.max(0, Math.min(20, d3_format_precision(x * (1 + 1e-15), p))));
- }
- });
- function d3_format_typeDefault(x) {
- return x + "";
- }
- var d3_time = d3.time = {}, d3_date = Date;
- function d3_date_utc() {
- this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]);
- }
- d3_date_utc.prototype = {
- getDate: function() {
- return this._.getUTCDate();
- },
- getDay: function() {
- return this._.getUTCDay();
- },
- getFullYear: function() {
- return this._.getUTCFullYear();
- },
- getHours: function() {
- return this._.getUTCHours();
- },
- getMilliseconds: function() {
- return this._.getUTCMilliseconds();
- },
- getMinutes: function() {
- return this._.getUTCMinutes();
- },
- getMonth: function() {
- return this._.getUTCMonth();
- },
- getSeconds: function() {
- return this._.getUTCSeconds();
- },
- getTime: function() {
- return this._.getTime();
- },
- getTimezoneOffset: function() {
- return 0;
- },
- valueOf: function() {
- return this._.valueOf();
- },
- setDate: function() {
- d3_time_prototype.setUTCDate.apply(this._, arguments);
- },
- setDay: function() {
- d3_time_prototype.setUTCDay.apply(this._, arguments);
- },
- setFullYear: function() {
- d3_time_prototype.setUTCFullYear.apply(this._, arguments);
- },
- setHours: function() {
- d3_time_prototype.setUTCHours.apply(this._, arguments);
- },
- setMilliseconds: function() {
- d3_time_prototype.setUTCMilliseconds.apply(this._, arguments);
- },
- setMinutes: function() {
- d3_time_prototype.setUTCMinutes.apply(this._, arguments);
- },
- setMonth: function() {
- d3_time_prototype.setUTCMonth.apply(this._, arguments);
- },
- setSeconds: function() {
- d3_time_prototype.setUTCSeconds.apply(this._, arguments);
- },
- setTime: function() {
- d3_time_prototype.setTime.apply(this._, arguments);
- }
- };
- var d3_time_prototype = Date.prototype;
- function d3_time_interval(local, step, number) {
- function round(date) {
- var d0 = local(date), d1 = offset(d0, 1);
- return date - d0 < d1 - date ? d0 : d1;
- }
- function ceil(date) {
- step(date = local(new d3_date(date - 1)), 1);
- return date;
- }
- function offset(date, k) {
- step(date = new d3_date(+date), k);
- return date;
- }
- function range(t0, t1, dt) {
- var time = ceil(t0), times = [];
- if (dt > 1) {
- while (time < t1) {
- if (!(number(time) % dt)) times.push(new Date(+time));
- step(time, 1);
- }
- } else {
- while (time < t1) times.push(new Date(+time)), step(time, 1);
- }
- return times;
- }
- function range_utc(t0, t1, dt) {
- try {
- d3_date = d3_date_utc;
- var utc = new d3_date_utc();
- utc._ = t0;
- return range(utc, t1, dt);
- } finally {
- d3_date = Date;
- }
- }
- local.floor = local;
- local.round = round;
- local.ceil = ceil;
- local.offset = offset;
- local.range = range;
- var utc = local.utc = d3_time_interval_utc(local);
- utc.floor = utc;
- utc.round = d3_time_interval_utc(round);
- utc.ceil = d3_time_interval_utc(ceil);
- utc.offset = d3_time_interval_utc(offset);
- utc.range = range_utc;
- return local;
- }
- function d3_time_interval_utc(method) {
- return function(date, k) {
- try {
- d3_date = d3_date_utc;
- var utc = new d3_date_utc();
- utc._ = date;
- return method(utc, k)._;
- } finally {
- d3_date = Date;
- }
- };
- }
- d3_time.year = d3_time_interval(function(date) {
- date = d3_time.day(date);
- date.setMonth(0, 1);
- return date;
- }, function(date, offset) {
- date.setFullYear(date.getFullYear() + offset);
- }, function(date) {
- return date.getFullYear();
- });
- d3_time.years = d3_time.year.range;
- d3_time.years.utc = d3_time.year.utc.range;
- d3_time.day = d3_time_interval(function(date) {
- var day = new d3_date(2e3, 0);
- day.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
- return day;
- }, function(date, offset) {
- date.setDate(date.getDate() + offset);
- }, function(date) {
- return date.getDate() - 1;
- });
- d3_time.days = d3_time.day.range;
- d3_time.days.utc = d3_time.day.utc.range;
- d3_time.dayOfYear = function(date) {
- var year = d3_time.year(date);
- return Math.floor((date - year - (date.getTimezoneOffset() - year.getTimezoneOffset()) * 6e4) / 864e5);
- };
- [ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ].forEach(function(day, i) {
- i = 7 - i;
- var interval = d3_time[day] = d3_time_interval(function(date) {
- (date = d3_time.day(date)).setDate(date.getDate() - (date.getDay() + i) % 7);
- return date;
- }, function(date, offset) {
- date.setDate(date.getDate() + Math.floor(offset) * 7);
- }, function(date) {
- var day = d3_time.year(date).getDay();
- return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7) - (day !== i);
- });
- d3_time[day + "s"] = interval.range;
- d3_time[day + "s"].utc = interval.utc.range;
- d3_time[day + "OfYear"] = function(date) {
- var day = d3_time.year(date).getDay();
- return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7);
- };
- });
- d3_time.week = d3_time.sunday;
- d3_time.weeks = d3_time.sunday.range;
- d3_time.weeks.utc = d3_time.sunday.utc.range;
- d3_time.weekOfYear = d3_time.sundayOfYear;
- function d3_locale_timeFormat(locale) {
- var locale_dateTime = locale.dateTime, locale_date = locale.date, locale_time = locale.time, locale_periods = locale.periods, locale_days = locale.days, locale_shortDays = locale.shortDays, locale_months = locale.months, locale_shortMonths = locale.shortMonths;
- function d3_time_format(template) {
- var n = template.length;
- function format(date) {
- var string = [], i = -1, j = 0, c, p, f;
- while (++i < n) {
- if (template.charCodeAt(i) === 37) {
- string.push(template.slice(j, i));
- if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i);
- if (f = d3_time_formats[c]) c = f(date, p == null ? c === "e" ? " " : "0" : p);
- string.push(c);
- j = i + 1;
- }
- }
- string.push(template.slice(j, i));
- return string.join("");
- }
- format.parse = function(string) {
- var d = {
- y: 1900,
- m: 0,
- d: 1,
- H: 0,
- M: 0,
- S: 0,
- L: 0,
- Z: null
- }, i = d3_time_parse(d, template, string, 0);
- if (i != string.length) return null;
- if ("p" in d) d.H = d.H % 12 + d.p * 12;
- var localZ = d.Z != null && d3_date !== d3_date_utc, date = new (localZ ? d3_date_utc : d3_date)();
- if ("j" in d) date.setFullYear(d.y, 0, d.j); else if ("w" in d && ("W" in d || "U" in d)) {
- date.setFullYear(d.y, 0, 1);
- date.setFullYear(d.y, 0, "W" in d ? (d.w + 6) % 7 + d.W * 7 - (date.getDay() + 5) % 7 : d.w + d.U * 7 - (date.getDay() + 6) % 7);
- } else date.setFullYear(d.y, d.m, d.d);
- date.setHours(d.H + (d.Z / 100 | 0), d.M + d.Z % 100, d.S, d.L);
- return localZ ? date._ : date;
- };
- format.toString = function() {
- return template;
- };
- return format;
- }
- function d3_time_parse(date, template, string, j) {
- var c, p, t, i = 0, n = template.length, m = string.length;
- while (i < n) {
- if (j >= m) return -1;
- c = template.charCodeAt(i++);
- if (c === 37) {
- t = template.charAt(i++);
- p = d3_time_parsers[t in d3_time_formatPads ? template.charAt(i++) : t];
- if (!p || (j = p(date, string, j)) < 0) return -1;
- } else if (c != string.charCodeAt(j++)) {
- return -1;
- }
- }
- return j;
- }
- d3_time_format.utc = function(template) {
- var local = d3_time_format(template);
- function format(date) {
- try {
- d3_date = d3_date_utc;
- var utc = new d3_date();
- utc._ = date;
- return local(utc);
- } finally {
- d3_date = Date;
- }
- }
- format.parse = function(string) {
- try {
- d3_date = d3_date_utc;
- var date = local.parse(string);
- return date && date._;
- } finally {
- d3_date = Date;
- }
- };
- format.toString = local.toString;
- return format;
- };
- d3_time_format.multi = d3_time_format.utc.multi = d3_time_formatMulti;
- var d3_time_periodLookup = d3.map(), d3_time_dayRe = d3_time_formatRe(locale_days), d3_time_dayLookup = d3_time_formatLookup(locale_days), d3_time_dayAbbrevRe = d3_time_formatRe(locale_shortDays), d3_time_dayAbbrevLookup = d3_time_formatLookup(locale_shortDays), d3_time_monthRe = d3_time_formatRe(locale_months), d3_time_monthLookup = d3_time_formatLookup(locale_months), d3_time_monthAbbrevRe = d3_time_formatRe(locale_shortMonths), d3_time_monthAbbrevLookup = d3_time_formatLookup(locale_shortMonths);
- locale_periods.forEach(function(p, i) {
- d3_time_periodLookup.set(p.toLowerCase(), i);
- });
- var d3_time_formats = {
- a: function(d) {
- return locale_shortDays[d.getDay()];
- },
- A: function(d) {
- return locale_days[d.getDay()];
- },
- b: function(d) {
- return locale_shortMonths[d.getMonth()];
- },
- B: function(d) {
- return locale_months[d.getMonth()];
- },
- c: d3_time_format(locale_dateTime),
- d: function(d, p) {
- return d3_time_formatPad(d.getDate(), p, 2);
- },
- e: function(d, p) {
- return d3_time_formatPad(d.getDate(), p, 2);
- },
- H: function(d, p) {
- return d3_time_formatPad(d.getHours(), p, 2);
- },
- I: function(d, p) {
- return d3_time_formatPad(d.getHours() % 12 || 12, p, 2);
- },
- j: function(d, p) {
- return d3_time_formatPad(1 + d3_time.dayOfYear(d), p, 3);
- },
- L: function(d, p) {
- return d3_time_formatPad(d.getMilliseconds(), p, 3);
- },
- m: function(d, p) {
- return d3_time_formatPad(d.getMonth() + 1, p, 2);
- },
- M: function(d, p) {
- return d3_time_formatPad(d.getMinutes(), p, 2);
- },
- p: function(d) {
- return locale_periods[+(d.getHours() >= 12)];
- },
- S: function(d, p) {
- return d3_time_formatPad(d.getSeconds(), p, 2);
- },
- U: function(d, p) {
- return d3_time_formatPad(d3_time.sundayOfYear(d), p, 2);
- },
- w: function(d) {
- return d.getDay();
- },
- W: function(d, p) {
- return d3_time_formatPad(d3_time.mondayOfYear(d), p, 2);
- },
- x: d3_time_format(locale_date),
- X: d3_time_format(locale_time),
- y: function(d, p) {
- return d3_time_formatPad(d.getFullYear() % 100, p, 2);
- },
- Y: function(d, p) {
- return d3_time_formatPad(d.getFullYear() % 1e4, p, 4);
- },
- Z: d3_time_zone,
- "%": function() {
- return "%";
- }
- };
- var d3_time_parsers = {
- a: d3_time_parseWeekdayAbbrev,
- A: d3_time_parseWeekday,
- b: d3_time_parseMonthAbbrev,
- B: d3_time_parseMonth,
- c: d3_time_parseLocaleFull,
- d: d3_time_parseDay,
- e: d3_time_parseDay,
- H: d3_time_parseHour24,
- I: d3_time_parseHour24,
- j: d3_time_parseDayOfYear,
- L: d3_time_parseMilliseconds,
- m: d3_time_parseMonthNumber,
- M: d3_time_parseMinutes,
- p: d3_time_parseAmPm,
- S: d3_time_parseSeconds,
- U: d3_time_parseWeekNumberSunday,
- w: d3_time_parseWeekdayNumber,
- W: d3_time_parseWeekNumberMonday,
- x: d3_time_parseLocaleDate,
- X: d3_time_parseLocaleTime,
- y: d3_time_parseYear,
- Y: d3_time_parseFullYear,
- Z: d3_time_parseZone,
- "%": d3_time_parseLiteralPercent
- };
- function d3_time_parseWeekdayAbbrev(date, string, i) {
- d3_time_dayAbbrevRe.lastIndex = 0;
- var n = d3_time_dayAbbrevRe.exec(string.slice(i));
- return n ? (date.w = d3_time_dayAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
- }
- function d3_time_parseWeekday(date, string, i) {
- d3_time_dayRe.lastIndex = 0;
- var n = d3_time_dayRe.exec(string.slice(i));
- return n ? (date.w = d3_time_dayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
- }
- function d3_time_parseMonthAbbrev(date, string, i) {
- d3_time_monthAbbrevRe.lastIndex = 0;
- var n = d3_time_monthAbbrevRe.exec(string.slice(i));
- return n ? (date.m = d3_time_monthAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
- }
- function d3_time_parseMonth(date, string, i) {
- d3_time_monthRe.lastIndex = 0;
- var n = d3_time_monthRe.exec(string.slice(i));
- return n ? (date.m = d3_time_monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
- }
- function d3_time_parseLocaleFull(date, string, i) {
- return d3_time_parse(date, d3_time_formats.c.toString(), string, i);
- }
- function d3_time_parseLocaleDate(date, string, i) {
- return d3_time_parse(date, d3_time_formats.x.toString(), string, i);
- }
- function d3_time_parseLocaleTime(date, string, i) {
- return d3_time_parse(date, d3_time_formats.X.toString(), string, i);
- }
- function d3_time_parseAmPm(date, string, i) {
- var n = d3_time_periodLookup.get(string.slice(i, i += 2).toLowerCase());
- return n == null ? -1 : (date.p = n, i);
- }
- return d3_time_format;
- }
- var d3_time_formatPads = {
- "-": "",
- _: " ",
- "0": "0"
- }, d3_time_numberRe = /^\s*\d+/, d3_time_percentRe = /^%/;
- function d3_time_formatPad(value, fill, width) {
- var sign = value < 0 ? "-" : "", string = (sign ? -value : value) + "", length = string.length;
- return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
- }
- function d3_time_formatRe(names) {
- return new RegExp("^(?:" + names.map(d3.requote).join("|") + ")", "i");
- }
- function d3_time_formatLookup(names) {
- var map = new d3_Map(), i = -1, n = names.length;
- while (++i < n) map.set(names[i].toLowerCase(), i);
- return map;
- }
- function d3_time_parseWeekdayNumber(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 1));
- return n ? (date.w = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseWeekNumberSunday(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i));
- return n ? (date.U = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseWeekNumberMonday(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i));
- return n ? (date.W = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseFullYear(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 4));
- return n ? (date.y = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseYear(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1;
- }
- function d3_time_parseZone(date, string, i) {
- return /^[+-]\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string,
- i + 5) : -1;
- }
- function d3_time_expandYear(d) {
- return d + (d > 68 ? 1900 : 2e3);
- }
- function d3_time_parseMonthNumber(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.m = n[0] - 1, i + n[0].length) : -1;
- }
- function d3_time_parseDay(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.d = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseDayOfYear(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 3));
- return n ? (date.j = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseHour24(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.H = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseMinutes(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.M = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseSeconds(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.S = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseMilliseconds(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 3));
- return n ? (date.L = +n[0], i + n[0].length) : -1;
- }
- function d3_time_zone(d) {
- var z = d.getTimezoneOffset(), zs = z > 0 ? "-" : "+", zh = abs(z) / 60 | 0, zm = abs(z) % 60;
- return zs + d3_time_formatPad(zh, "0", 2) + d3_time_formatPad(zm, "0", 2);
- }
- function d3_time_parseLiteralPercent(date, string, i) {
- d3_time_percentRe.lastIndex = 0;
- var n = d3_time_percentRe.exec(string.slice(i, i + 1));
- return n ? i + n[0].length : -1;
- }
- function d3_time_formatMulti(formats) {
- var n = formats.length, i = -1;
- while (++i < n) formats[i][0] = this(formats[i][0]);
- return function(date) {
- var i = 0, f = formats[i];
- while (!f[1](date)) f = formats[++i];
- return f[0](date);
- };
- }
- d3.locale = function(locale) {
- return {
- numberFormat: d3_locale_numberFormat(locale),
- timeFormat: d3_locale_timeFormat(locale)
- };
- };
- var d3_locale_enUS = d3.locale({
- decimal: ".",
- thousands: ",",
- grouping: [ 3 ],
- currency: [ "$", "" ],
- dateTime: "%a %b %e %X %Y",
- date: "%m/%d/%Y",
- time: "%H:%M:%S",
- periods: [ "AM", "PM" ],
- days: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
- shortDays: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
- months: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ],
- shortMonths: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]
- });
- d3.format = d3_locale_enUS.numberFormat;
- d3.geo = {};
- function d3_adder() {}
- d3_adder.prototype = {
- s: 0,
- t: 0,
- add: function(y) {
- d3_adderSum(y, this.t, d3_adderTemp);
- d3_adderSum(d3_adderTemp.s, this.s, this);
- if (this.s) this.t += d3_adderTemp.t; else this.s = d3_adderTemp.t;
- },
- reset: function() {
- this.s = this.t = 0;
- },
- valueOf: function() {
- return this.s;
- }
- };
- var d3_adderTemp = new d3_adder();
- function d3_adderSum(a, b, o) {
- var x = o.s = a + b, bv = x - a, av = x - bv;
- o.t = a - av + (b - bv);
- }
- d3.geo.stream = function(object, listener) {
- if (object && d3_geo_streamObjectType.hasOwnProperty(object.type)) {
- d3_geo_streamObjectType[object.type](object, listener);
- } else {
- d3_geo_streamGeometry(object, listener);
- }
- };
- function d3_geo_streamGeometry(geometry, listener) {
- if (geometry && d3_geo_streamGeometryType.hasOwnProperty(geometry.type)) {
- d3_geo_streamGeometryType[geometry.type](geometry, listener);
- }
- }
- var d3_geo_streamObjectType = {
- Feature: function(feature, listener) {
- d3_geo_streamGeometry(feature.geometry, listener);
- },
- FeatureCollection: function(object, listener) {
- var features = object.features, i = -1, n = features.length;
- while (++i < n) d3_geo_streamGeometry(features[i].geometry, listener);
- }
- };
- var d3_geo_streamGeometryType = {
- Sphere: function(object, listener) {
- listener.sphere();
- },
- Point: function(object, listener) {
- object = object.coordinates;
- listener.point(object[0], object[1], object[2]);
- },
- MultiPoint: function(object, listener) {
- var coordinates = object.coordinates, i = -1, n = coordinates.length;
- while (++i < n) object = coordinates[i], listener.point(object[0], object[1], object[2]);
- },
- LineString: function(object, listener) {
- d3_geo_streamLine(object.coordinates, listener, 0);
- },
- MultiLineString: function(object, listener) {
- var coordinates = object.coordinates, i = -1, n = coordinates.length;
- while (++i < n) d3_geo_streamLine(coordinates[i], listener, 0);
- },
- Polygon: function(object, listener) {
- d3_geo_streamPolygon(object.coordinates, listener);
- },
- MultiPolygon: function(object, listener) {
- var coordinates = object.coordinates, i = -1, n = coordinates.length;
- while (++i < n) d3_geo_streamPolygon(coordinates[i], listener);
- },
- GeometryCollection: function(object, listener) {
- var geometries = object.geometries, i = -1, n = geometries.length;
- while (++i < n) d3_geo_streamGeometry(geometries[i], listener);
- }
- };
- function d3_geo_streamLine(coordinates, listener, closed) {
- var i = -1, n = coordinates.length - closed, coordinate;
- listener.lineStart();
- while (++i < n) coordinate = coordinates[i], listener.point(coordinate[0], coordinate[1], coordinate[2]);
- listener.lineEnd();
- }
- function d3_geo_streamPolygon(coordinates, listener) {
- var i = -1, n = coordinates.length;
- listener.polygonStart();
- while (++i < n) d3_geo_streamLine(coordinates[i], listener, 1);
- listener.polygonEnd();
- }
- d3.geo.area = function(object) {
- d3_geo_areaSum = 0;
- d3.geo.stream(object, d3_geo_area);
- return d3_geo_areaSum;
- };
- var d3_geo_areaSum, d3_geo_areaRingSum = new d3_adder();
- var d3_geo_area = {
- sphere: function() {
- d3_geo_areaSum += 4 * π;
- },
- point: d3_noop,
- lineStart: d3_noop,
- lineEnd: d3_noop,
- polygonStart: function() {
- d3_geo_areaRingSum.reset();
- d3_geo_area.lineStart = d3_geo_areaRingStart;
- },
- polygonEnd: function() {
- var area = 2 * d3_geo_areaRingSum;
- d3_geo_areaSum += area < 0 ? 4 * π + area : area;
- d3_geo_area.lineStart = d3_geo_area.lineEnd = d3_geo_area.point = d3_noop;
- }
- };
- function d3_geo_areaRingStart() {
- var λ00, φ00, λ0, cosφ0, sinφ0;
- d3_geo_area.point = function(λ, φ) {
- d3_geo_area.point = nextPoint;
- λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4),
- sinφ0 = Math.sin(φ);
- };
- function nextPoint(λ, φ) {
- λ *= d3_radians;
- φ = φ * d3_radians / 2 + π / 4;
- var dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, cosφ = Math.cos(φ), sinφ = Math.sin(φ), k = sinφ0 * sinφ, u = cosφ0 * cosφ + k * Math.cos(adλ), v = k * sdλ * Math.sin(adλ);
- d3_geo_areaRingSum.add(Math.atan2(v, u));
- λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ;
- }
- d3_geo_area.lineEnd = function() {
- nextPoint(λ00, φ00);
- };
- }
- function d3_geo_cartesian(spherical) {
- var λ = spherical[0], φ = spherical[1], cosφ = Math.cos(φ);
- return [ cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ) ];
- }
- function d3_geo_cartesianDot(a, b) {
- return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
- }
- function d3_geo_cartesianCross(a, b) {
- return [ a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0] ];
- }
- function d3_geo_cartesianAdd(a, b) {
- a[0] += b[0];
- a[1] += b[1];
- a[2] += b[2];
- }
- function d3_geo_cartesianScale(vector, k) {
- return [ vector[0] * k, vector[1] * k, vector[2] * k ];
- }
- function d3_geo_cartesianNormalize(d) {
- var l = Math.sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
- d[0] /= l;
- d[1] /= l;
- d[2] /= l;
- }
- function d3_geo_spherical(cartesian) {
- return [ Math.atan2(cartesian[1], cartesian[0]), d3_asin(cartesian[2]) ];
- }
- function d3_geo_sphericalEqual(a, b) {
- return abs(a[0] - b[0]) < ε && abs(a[1] - b[1]) < ε;
- }
- d3.geo.bounds = function() {
- var λ0, φ0, λ1, φ1, λ_, λ__, φ__, p0, dλSum, ranges, range;
- var bound = {
- point: point,
- lineStart: lineStart,
- lineEnd: lineEnd,
- polygonStart: function() {
- bound.point = ringPoint;
- bound.lineStart = ringStart;
- bound.lineEnd = ringEnd;
- dλSum = 0;
- d3_geo_area.polygonStart();
- },
- polygonEnd: function() {
- d3_geo_area.polygonEnd();
- bound.point = point;
- bound.lineStart = lineStart;
- bound.lineEnd = lineEnd;
- if (d3_geo_areaRingSum < 0) λ0 = -(λ1 = 180), φ0 = -(φ1 = 90); else if (dλSum > ε) φ1 = 90; else if (dλSum < -ε) φ0 = -90;
- range[0] = λ0, range[1] = λ1;
- }
- };
- function point(λ, φ) {
- ranges.push(range = [ λ0 = λ, λ1 = λ ]);
- if (φ < φ0) φ0 = φ;
- if (φ > φ1) φ1 = φ;
- }
- function linePoint(λ, φ) {
- var p = d3_geo_cartesian([ λ * d3_radians, φ * d3_radians ]);
- if (p0) {
- var normal = d3_geo_cartesianCross(p0, p), equatorial = [ normal[1], -normal[0], 0 ], inflection = d3_geo_cartesianCross(equatorial, normal);
- d3_geo_cartesianNormalize(inflection);
- inflection = d3_geo_spherical(inflection);
- var dλ = λ - λ_, s = dλ > 0 ? 1 : -1, λi = inflection[0] * d3_degrees * s, antimeridian = abs(dλ) > 180;
- if (antimeridian ^ (s * λ_ < λi && λi < s * λ)) {
- var φi = inflection[1] * d3_degrees;
- if (φi > φ1) φ1 = φi;
- } else if (λi = (λi + 360) % 360 - 180, antimeridian ^ (s * λ_ < λi && λi < s * λ)) {
- var φi = -inflection[1] * d3_degrees;
- if (φi < φ0) φ0 = φi;
- } else {
- if (φ < φ0) φ0 = φ;
- if (φ > φ1) φ1 = φ;
- }
- if (antimeridian) {
- if (λ < λ_) {
- if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;
- } else {
- if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;
- }
- } else {
- if (λ1 >= λ0) {
- if (λ < λ0) λ0 = λ;
- if (λ > λ1) λ1 = λ;
- } else {
- if (λ > λ_) {
- if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;
- } else {
- if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;
- }
- }
- }
- } else {
- point(λ, φ);
- }
- p0 = p, λ_ = λ;
- }
- function lineStart() {
- bound.point = linePoint;
- }
- function lineEnd() {
- range[0] = λ0, range[1] = λ1;
- bound.point = point;
- p0 = null;
- }
- function ringPoint(λ, φ) {
- if (p0) {
- var dλ = λ - λ_;
- dλSum += abs(dλ) > 180 ? dλ + (dλ > 0 ? 360 : -360) : dλ;
- } else λ__ = λ, φ__ = φ;
- d3_geo_area.point(λ, φ);
- linePoint(λ, φ);
- }
- function ringStart() {
- d3_geo_area.lineStart();
- }
- function ringEnd() {
- ringPoint(λ__, φ__);
- d3_geo_area.lineEnd();
- if (abs(dλSum) > ε) λ0 = -(λ1 = 180);
- range[0] = λ0, range[1] = λ1;
- p0 = null;
- }
- function angle(λ0, λ1) {
- return (λ1 -= λ0) < 0 ? λ1 + 360 : λ1;
- }
- function compareRanges(a, b) {
- return a[0] - b[0];
- }
- function withinRange(x, range) {
- return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;
- }
- return function(feature) {
- φ1 = λ1 = -(λ0 = φ0 = Infinity);
- ranges = [];
- d3.geo.stream(feature, bound);
- var n = ranges.length;
- if (n) {
- ranges.sort(compareRanges);
- for (var i = 1, a = ranges[0], b, merged = [ a ]; i < n; ++i) {
- b = ranges[i];
- if (withinRange(b[0], a) || withinRange(b[1], a)) {
- if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];
- if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];
- } else {
- merged.push(a = b);
- }
- }
- var best = -Infinity, dλ;
- for (var n = merged.length - 1, i = 0, a = merged[n], b; i <= n; a = b, ++i) {
- b = merged[i];
- if ((dλ = angle(a[1], b[0])) > best) best = dλ, λ0 = b[0], λ1 = a[1];
- }
- }
- ranges = range = null;
- return λ0 === Infinity || φ0 === Infinity ? [ [ NaN, NaN ], [ NaN, NaN ] ] : [ [ λ0, φ0 ], [ λ1, φ1 ] ];
- };
- }();
- d3.geo.centroid = function(object) {
- d3_geo_centroidW0 = d3_geo_centroidW1 = d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0;
- d3.geo.stream(object, d3_geo_centroid);
- var x = d3_geo_centroidX2, y = d3_geo_centroidY2, z = d3_geo_centroidZ2, m = x * x + y * y + z * z;
- if (m < ε2) {
- x = d3_geo_centroidX1, y = d3_geo_centroidY1, z = d3_geo_centroidZ1;
- if (d3_geo_centroidW1 < ε) x = d3_geo_centroidX0, y = d3_geo_centroidY0, z = d3_geo_centroidZ0;
- m = x * x + y * y + z * z;
- if (m < ε2) return [ NaN, NaN ];
- }
- return [ Math.atan2(y, x) * d3_degrees, d3_asin(z / Math.sqrt(m)) * d3_degrees ];
- };
- var d3_geo_centroidW0, d3_geo_centroidW1, d3_geo_centroidX0, d3_geo_centroidY0, d3_geo_centroidZ0, d3_geo_centroidX1, d3_geo_centroidY1, d3_geo_centroidZ1, d3_geo_centroidX2, d3_geo_centroidY2, d3_geo_centroidZ2;
- var d3_geo_centroid = {
- sphere: d3_noop,
- point: d3_geo_centroidPoint,
- lineStart: d3_geo_centroidLineStart,
- lineEnd: d3_geo_centroidLineEnd,
- polygonStart: function() {
- d3_geo_centroid.lineStart = d3_geo_centroidRingStart;
- },
- polygonEnd: function() {
- d3_geo_centroid.lineStart = d3_geo_centroidLineStart;
- }
- };
- function d3_geo_centroidPoint(λ, φ) {
- λ *= d3_radians;
- var cosφ = Math.cos(φ *= d3_radians);
- d3_geo_centroidPointXYZ(cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ));
- }
- function d3_geo_centroidPointXYZ(x, y, z) {
- ++d3_geo_centroidW0;
- d3_geo_centroidX0 += (x - d3_geo_centroidX0) / d3_geo_centroidW0;
- d3_geo_centroidY0 += (y - d3_geo_centroidY0) / d3_geo_centroidW0;
- d3_geo_centroidZ0 += (z - d3_geo_centroidZ0) / d3_geo_centroidW0;
- }
- function d3_geo_centroidLineStart() {
- var x0, y0, z0;
- d3_geo_centroid.point = function(λ, φ) {
- λ *= d3_radians;
- var cosφ = Math.cos(φ *= d3_radians);
- x0 = cosφ * Math.cos(λ);
- y0 = cosφ * Math.sin(λ);
- z0 = Math.sin(φ);
- d3_geo_centroid.point = nextPoint;
- d3_geo_centroidPointXYZ(x0, y0, z0);
- };
- function nextPoint(λ, φ) {
- λ *= d3_radians;
- var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), w = Math.atan2(Math.sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);
- d3_geo_centroidW1 += w;
- d3_geo_centroidX1 += w * (x0 + (x0 = x));
- d3_geo_centroidY1 += w * (y0 + (y0 = y));
- d3_geo_centroidZ1 += w * (z0 + (z0 = z));
- d3_geo_centroidPointXYZ(x0, y0, z0);
- }
- }
- function d3_geo_centroidLineEnd() {
- d3_geo_centroid.point = d3_geo_centroidPoint;
- }
- function d3_geo_centroidRingStart() {
- var λ00, φ00, x0, y0, z0;
- d3_geo_centroid.point = function(λ, φ) {
- λ00 = λ, φ00 = φ;
- d3_geo_centroid.point = nextPoint;
- λ *= d3_radians;
- var cosφ = Math.cos(φ *= d3_radians);
- x0 = cosφ * Math.cos(λ);
- y0 = cosφ * Math.sin(λ);
- z0 = Math.sin(φ);
- d3_geo_centroidPointXYZ(x0, y0, z0);
- };
- d3_geo_centroid.lineEnd = function() {
- nextPoint(λ00, φ00);
- d3_geo_centroid.lineEnd = d3_geo_centroidLineEnd;
- d3_geo_centroid.point = d3_geo_centroidPoint;
- };
- function nextPoint(λ, φ) {
- λ *= d3_radians;
- var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = Math.sqrt(cx * cx + cy * cy + cz * cz), u = x0 * x + y0 * y + z0 * z, v = m && -d3_acos(u) / m, w = Math.atan2(m, u);
- d3_geo_centroidX2 += v * cx;
- d3_geo_centroidY2 += v * cy;
- d3_geo_centroidZ2 += v * cz;
- d3_geo_centroidW1 += w;
- d3_geo_centroidX1 += w * (x0 + (x0 = x));
- d3_geo_centroidY1 += w * (y0 + (y0 = y));
- d3_geo_centroidZ1 += w * (z0 + (z0 = z));
- d3_geo_centroidPointXYZ(x0, y0, z0);
- }
- }
- function d3_true() {
- return true;
- }
- function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) {
- var subject = [], clip = [];
- segments.forEach(function(segment) {
- if ((n = segment.length - 1) <= 0) return;
- var n, p0 = segment[0], p1 = segment[n];
- if (d3_geo_sphericalEqual(p0, p1)) {
- listener.lineStart();
- for (var i = 0; i < n; ++i) listener.point((p0 = segment[i])[0], p0[1]);
- listener.lineEnd();
- return;
- }
- var a = new d3_geo_clipPolygonIntersection(p0, segment, null, true), b = new d3_geo_clipPolygonIntersection(p0, null, a, false);
- a.o = b;
- subject.push(a);
- clip.push(b);
- a = new d3_geo_clipPolygonIntersection(p1, segment, null, false);
- b = new d3_geo_clipPolygonIntersection(p1, null, a, true);
- a.o = b;
- subject.push(a);
- clip.push(b);
- });
- clip.sort(compare);
- d3_geo_clipPolygonLinkCircular(subject);
- d3_geo_clipPolygonLinkCircular(clip);
- if (!subject.length) return;
- for (var i = 0, entry = clipStartInside, n = clip.length; i < n; ++i) {
- clip[i].e = entry = !entry;
- }
- var start = subject[0], points, point;
- while (1) {
- var current = start, isSubject = true;
- while (current.v) if ((current = current.n) === start) return;
- points = current.z;
- listener.lineStart();
- do {
- current.v = current.o.v = true;
- if (current.e) {
- if (isSubject) {
- for (var i = 0, n = points.length; i < n; ++i) listener.point((point = points[i])[0], point[1]);
- } else {
- interpolate(current.x, current.n.x, 1, listener);
- }
- current = current.n;
- } else {
- if (isSubject) {
- points = current.p.z;
- for (var i = points.length - 1; i >= 0; --i) listener.point((point = points[i])[0], point[1]);
- } else {
- interpolate(current.x, current.p.x, -1, listener);
- }
- current = current.p;
- }
- current = current.o;
- points = current.z;
- isSubject = !isSubject;
- } while (!current.v);
- listener.lineEnd();
- }
- }
- function d3_geo_clipPolygonLinkCircular(array) {
- if (!(n = array.length)) return;
- var n, i = 0, a = array[0], b;
- while (++i < n) {
- a.n = b = array[i];
- b.p = a;
- a = b;
- }
- a.n = b = array[0];
- b.p = a;
- }
- function d3_geo_clipPolygonIntersection(point, points, other, entry) {
- this.x = point;
- this.z = points;
- this.o = other;
- this.e = entry;
- this.v = false;
- this.n = this.p = null;
- }
- function d3_geo_clip(pointVisible, clipLine, interpolate, clipStart) {
- return function(rotate, listener) {
- var line = clipLine(listener), rotatedClipStart = rotate.invert(clipStart[0], clipStart[1]);
- var clip = {
- point: point,
- lineStart: lineStart,
- lineEnd: lineEnd,
- polygonStart: function() {
- clip.point = pointRing;
- clip.lineStart = ringStart;
- clip.lineEnd = ringEnd;
- segments = [];
- polygon = [];
- },
- polygonEnd: function() {
- clip.point = point;
- clip.lineStart = lineStart;
- clip.lineEnd = lineEnd;
- segments = d3.merge(segments);
- var clipStartInside = d3_geo_pointInPolygon(rotatedClipStart, polygon);
- if (segments.length) {
- if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
- d3_geo_clipPolygon(segments, d3_geo_clipSort, clipStartInside, interpolate, listener);
- } else if (clipStartInside) {
- if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
- listener.lineStart();
- interpolate(null, null, 1, listener);
- listener.lineEnd();
- }
- if (polygonStarted) listener.polygonEnd(), polygonStarted = false;
- segments = polygon = null;
- },
- sphere: function() {
- listener.polygonStart();
- listener.lineStart();
- interpolate(null, null, 1, listener);
- listener.lineEnd();
- listener.polygonEnd();
- }
- };
- function point(λ, φ) {
- var point = rotate(λ, φ);
- if (pointVisible(λ = point[0], φ = point[1])) listener.point(λ, φ);
- }
- function pointLine(λ, φ) {
- var point = rotate(λ, φ);
- line.point(point[0], point[1]);
- }
- function lineStart() {
- clip.point = pointLine;
- line.lineStart();
- }
- function lineEnd() {
- clip.point = point;
- line.lineEnd();
- }
- var segments;
- var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygonStarted = false, polygon, ring;
- function pointRing(λ, φ) {
- ring.push([ λ, φ ]);
- var point = rotate(λ, φ);
- ringListener.point(point[0], point[1]);
- }
- function ringStart() {
- ringListener.lineStart();
- ring = [];
- }
- function ringEnd() {
- pointRing(ring[0][0], ring[0][1]);
- ringListener.lineEnd();
- var clean = ringListener.clean(), ringSegments = buffer.buffer(), segment, n = ringSegments.length;
- ring.pop();
- polygon.push(ring);
- ring = null;
- if (!n) return;
- if (clean & 1) {
- segment = ringSegments[0];
- var n = segment.length - 1, i = -1, point;
- if (n > 0) {
- if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
- listener.lineStart();
- while (++i < n) listener.point((point = segment[i])[0], point[1]);
- listener.lineEnd();
- }
- return;
- }
- if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
- segments.push(ringSegments.filter(d3_geo_clipSegmentLength1));
- }
- return clip;
- };
- }
- function d3_geo_clipSegmentLength1(segment) {
- return segment.length > 1;
- }
- function d3_geo_clipBufferListener() {
- var lines = [], line;
- return {
- lineStart: function() {
- lines.push(line = []);
- },
- point: function(λ, φ) {
- line.push([ λ, φ ]);
- },
- lineEnd: d3_noop,
- buffer: function() {
- var buffer = lines;
- lines = [];
- line = null;
- return buffer;
- },
- rejoin: function() {
- if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));
- }
- };
- }
- function d3_geo_clipSort(a, b) {
- return ((a = a.x)[0] < 0 ? a[1] - halfπ - ε : halfπ - a[1]) - ((b = b.x)[0] < 0 ? b[1] - halfπ - ε : halfπ - b[1]);
- }
- var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, [ -π, -π / 2 ]);
- function d3_geo_clipAntimeridianLine(listener) {
- var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean;
- return {
- lineStart: function() {
- listener.lineStart();
- clean = 1;
- },
- point: function(λ1, φ1) {
- var sλ1 = λ1 > 0 ? π : -π, dλ = abs(λ1 - λ0);
- if (abs(dλ - π) < ε) {
- listener.point(λ0, φ0 = (φ0 + φ1) / 2 > 0 ? halfπ : -halfπ);
- listener.point(sλ0, φ0);
- listener.lineEnd();
- listener.lineStart();
- listener.point(sλ1, φ0);
- listener.point(λ1, φ0);
- clean = 0;
- } else if (sλ0 !== sλ1 && dλ >= π) {
- if (abs(λ0 - sλ0) < ε) λ0 -= sλ0 * ε;
- if (abs(λ1 - sλ1) < ε) λ1 -= sλ1 * ε;
- φ0 = d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1);
- listener.point(sλ0, φ0);
- listener.lineEnd();
- listener.lineStart();
- listener.point(sλ1, φ0);
- clean = 0;
- }
- listener.point(λ0 = λ1, φ0 = φ1);
- sλ0 = sλ1;
- },
- lineEnd: function() {
- listener.lineEnd();
- λ0 = φ0 = NaN;
- },
- clean: function() {
- return 2 - clean;
- }
- };
- }
- function d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1) {
- var cosφ0, cosφ1, sinλ0_λ1 = Math.sin(λ0 - λ1);
- return abs(sinλ0_λ1) > ε ? Math.atan((Math.sin(φ0) * (cosφ1 = Math.cos(φ1)) * Math.sin(λ1) - Math.sin(φ1) * (cosφ0 = Math.cos(φ0)) * Math.sin(λ0)) / (cosφ0 * cosφ1 * sinλ0_λ1)) : (φ0 + φ1) / 2;
- }
- function d3_geo_clipAntimeridianInterpolate(from, to, direction, listener) {
- var φ;
- if (from == null) {
- φ = direction * halfπ;
- listener.point(-π, φ);
- listener.point(0, φ);
- listener.point(π, φ);
- listener.point(π, 0);
- listener.point(π, -φ);
- listener.point(0, -φ);
- listener.point(-π, -φ);
- listener.point(-π, 0);
- listener.point(-π, φ);
- } else if (abs(from[0] - to[0]) > ε) {
- var s = from[0] < to[0] ? π : -π;
- φ = direction * s / 2;
- listener.point(-s, φ);
- listener.point(0, φ);
- listener.point(s, φ);
- } else {
- listener.point(to[0], to[1]);
- }
- }
- function d3_geo_pointInPolygon(point, polygon) {
- var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0;
- d3_geo_areaRingSum.reset();
- for (var i = 0, n = polygon.length; i < n; ++i) {
- var ring = polygon[i], m = ring.length;
- if (!m) continue;
- var point0 = ring[0], λ0 = point0[0], φ0 = point0[1] / 2 + π / 4, sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), j = 1;
- while (true) {
- if (j === m) j = 0;
- point = ring[j];
- var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, antimeridian = adλ > π, k = sinφ0 * sinφ;
- d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(adλ), cosφ0 * cosφ + k * Math.cos(adλ)));
- polarAngle += antimeridian ? dλ + sdλ * τ : dλ;
- if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) {
- var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point));
- d3_geo_cartesianNormalize(arc);
- var intersection = d3_geo_cartesianCross(meridianNormal, arc);
- d3_geo_cartesianNormalize(intersection);
- var φarc = (antimeridian ^ dλ >= 0 ? -1 : 1) * d3_asin(intersection[2]);
- if (parallel > φarc || parallel === φarc && (arc[0] || arc[1])) {
- winding += antimeridian ^ dλ >= 0 ? 1 : -1;
- }
- }
- if (!j++) break;
- λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point;
- }
- }
- return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < 0) ^ winding & 1;
- }
- function d3_geo_clipCircle(radius) {
- var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians);
- return d3_geo_clip(visible, clipLine, interpolate, smallRadius ? [ 0, -radius ] : [ -π, radius - π ]);
- function visible(λ, φ) {
- return Math.cos(λ) * Math.cos(φ) > cr;
- }
- function clipLine(listener) {
- var point0, c0, v0, v00, clean;
- return {
- lineStart: function() {
- v00 = v0 = false;
- clean = 1;
- },
- point: function(λ, φ) {
- var point1 = [ λ, φ ], point2, v = visible(λ, φ), c = smallRadius ? v ? 0 : code(λ, φ) : v ? code(λ + (λ < 0 ? π : -π), φ) : 0;
- if (!point0 && (v00 = v0 = v)) listener.lineStart();
- if (v !== v0) {
- point2 = intersect(point0, point1);
- if (d3_geo_sphericalEqual(point0, point2) || d3_geo_sphericalEqual(point1, point2)) {
- point1[0] += ε;
- point1[1] += ε;
- v = visible(point1[0], point1[1]);
- }
- }
- if (v !== v0) {
- clean = 0;
- if (v) {
- listener.lineStart();
- point2 = intersect(point1, point0);
- listener.point(point2[0], point2[1]);
- } else {
- point2 = intersect(point0, point1);
- listener.point(point2[0], point2[1]);
- listener.lineEnd();
- }
- point0 = point2;
- } else if (notHemisphere && point0 && smallRadius ^ v) {
- var t;
- if (!(c & c0) && (t = intersect(point1, point0, true))) {
- clean = 0;
- if (smallRadius) {
- listener.lineStart();
- listener.point(t[0][0], t[0][1]);
- listener.point(t[1][0], t[1][1]);
- listener.lineEnd();
- } else {
- listener.point(t[1][0], t[1][1]);
- listener.lineEnd();
- listener.lineStart();
- listener.point(t[0][0], t[0][1]);
- }
- }
- }
- if (v && (!point0 || !d3_geo_sphericalEqual(point0, point1))) {
- listener.point(point1[0], point1[1]);
- }
- point0 = point1, v0 = v, c0 = c;
- },
- lineEnd: function() {
- if (v0) listener.lineEnd();
- point0 = null;
- },
- clean: function() {
- return clean | (v00 && v0) << 1;
- }
- };
- }
- function intersect(a, b, two) {
- var pa = d3_geo_cartesian(a), pb = d3_geo_cartesian(b);
- var n1 = [ 1, 0, 0 ], n2 = d3_geo_cartesianCross(pa, pb), n2n2 = d3_geo_cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2;
- if (!determinant) return !two && a;
- var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = d3_geo_cartesianCross(n1, n2), A = d3_geo_cartesianScale(n1, c1), B = d3_geo_cartesianScale(n2, c2);
- d3_geo_cartesianAdd(A, B);
- var u = n1xn2, w = d3_geo_cartesianDot(A, u), uu = d3_geo_cartesianDot(u, u), t2 = w * w - uu * (d3_geo_cartesianDot(A, A) - 1);
- if (t2 < 0) return;
- var t = Math.sqrt(t2), q = d3_geo_cartesianScale(u, (-w - t) / uu);
- d3_geo_cartesianAdd(q, A);
- q = d3_geo_spherical(q);
- if (!two) return q;
- var λ0 = a[0], λ1 = b[0], φ0 = a[1], φ1 = b[1], z;
- if (λ1 < λ0) z = λ0, λ0 = λ1, λ1 = z;
- var δλ = λ1 - λ0, polar = abs(δλ - π) < ε, meridian = polar || δλ < ε;
- if (!polar && φ1 < φ0) z = φ0, φ0 = φ1, φ1 = z;
- if (meridian ? polar ? φ0 + φ1 > 0 ^ q[1] < (abs(q[0] - λ0) < ε ? φ0 : φ1) : φ0 <= q[1] && q[1] <= φ1 : δλ > π ^ (λ0 <= q[0] && q[0] <= λ1)) {
- var q1 = d3_geo_cartesianScale(u, (-w + t) / uu);
- d3_geo_cartesianAdd(q1, A);
- return [ q, d3_geo_spherical(q1) ];
- }
- }
- function code(λ, φ) {
- var r = smallRadius ? radius : π - radius, code = 0;
- if (λ < -r) code |= 1; else if (λ > r) code |= 2;
- if (φ < -r) code |= 4; else if (φ > r) code |= 8;
- return code;
- }
- }
- function d3_geom_clipLine(x0, y0, x1, y1) {
- return function(line) {
- var a = line.a, b = line.b, ax = a.x, ay = a.y, bx = b.x, by = b.y, t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r;
- r = x0 - ax;
- if (!dx && r > 0) return;
- r /= dx;
- if (dx < 0) {
- if (r < t0) return;
- if (r < t1) t1 = r;
- } else if (dx > 0) {
- if (r > t1) return;
- if (r > t0) t0 = r;
- }
- r = x1 - ax;
- if (!dx && r < 0) return;
- r /= dx;
- if (dx < 0) {
- if (r > t1) return;
- if (r > t0) t0 = r;
- } else if (dx > 0) {
- if (r < t0) return;
- if (r < t1) t1 = r;
- }
- r = y0 - ay;
- if (!dy && r > 0) return;
- r /= dy;
- if (dy < 0) {
- if (r < t0) return;
- if (r < t1) t1 = r;
- } else if (dy > 0) {
- if (r > t1) return;
- if (r > t0) t0 = r;
- }
- r = y1 - ay;
- if (!dy && r < 0) return;
- r /= dy;
- if (dy < 0) {
- if (r > t1) return;
- if (r > t0) t0 = r;
- } else if (dy > 0) {
- if (r < t0) return;
- if (r < t1) t1 = r;
- }
- if (t0 > 0) line.a = {
- x: ax + t0 * dx,
- y: ay + t0 * dy
- };
- if (t1 < 1) line.b = {
- x: ax + t1 * dx,
- y: ay + t1 * dy
- };
- return line;
- };
- }
- var d3_geo_clipExtentMAX = 1e9;
- d3.geo.clipExtent = function() {
- var x0, y0, x1, y1, stream, clip, clipExtent = {
- stream: function(output) {
- if (stream) stream.valid = false;
- stream = clip(output);
- stream.valid = true;
- return stream;
- },
- extent: function(_) {
- if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];
- clip = d3_geo_clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]);
- if (stream) stream.valid = false, stream = null;
- return clipExtent;
- }
- };
- return clipExtent.extent([ [ 0, 0 ], [ 960, 500 ] ]);
- };
- function d3_geo_clipExtent(x0, y0, x1, y1) {
- return function(listener) {
- var listener_ = listener, bufferListener = d3_geo_clipBufferListener(), clipLine = d3_geom_clipLine(x0, y0, x1, y1), segments, polygon, ring;
- var clip = {
- point: point,
- lineStart: lineStart,
- lineEnd: lineEnd,
- polygonStart: function() {
- listener = bufferListener;
- segments = [];
- polygon = [];
- clean = true;
- },
- polygonEnd: function() {
- listener = listener_;
- segments = d3.merge(segments);
- var clipStartInside = insidePolygon([ x0, y1 ]), inside = clean && clipStartInside, visible = segments.length;
- if (inside || visible) {
- listener.polygonStart();
- if (inside) {
- listener.lineStart();
- interpolate(null, null, 1, listener);
- listener.lineEnd();
- }
- if (visible) {
- d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener);
- }
- listener.polygonEnd();
- }
- segments = polygon = ring = null;
- }
- };
- function insidePolygon(p) {
- var wn = 0, n = polygon.length, y = p[1];
- for (var i = 0; i < n; ++i) {
- for (var j = 1, v = polygon[i], m = v.length, a = v[0], b; j < m; ++j) {
- b = v[j];
- if (a[1] <= y) {
- if (b[1] > y && d3_cross2d(a, b, p) > 0) ++wn;
- } else {
- if (b[1] <= y && d3_cross2d(a, b, p) < 0) --wn;
- }
- a = b;
- }
- }
- return wn !== 0;
- }
- function interpolate(from, to, direction, listener) {
- var a = 0, a1 = 0;
- if (from == null || (a = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoints(from, to) < 0 ^ direction > 0) {
- do {
- listener.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);
- } while ((a = (a + direction + 4) % 4) !== a1);
- } else {
- listener.point(to[0], to[1]);
- }
- }
- function pointVisible(x, y) {
- return x0 <= x && x <= x1 && y0 <= y && y <= y1;
- }
- function point(x, y) {
- if (pointVisible(x, y)) listener.point(x, y);
- }
- var x__, y__, v__, x_, y_, v_, first, clean;
- function lineStart() {
- clip.point = linePoint;
- if (polygon) polygon.push(ring = []);
- first = true;
- v_ = false;
- x_ = y_ = NaN;
- }
- function lineEnd() {
- if (segments) {
- linePoint(x__, y__);
- if (v__ && v_) bufferListener.rejoin();
- segments.push(bufferListener.buffer());
- }
- clip.point = point;
- if (v_) listener.lineEnd();
- }
- function linePoint(x, y) {
- x = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, x));
- y = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, y));
- var v = pointVisible(x, y);
- if (polygon) ring.push([ x, y ]);
- if (first) {
- x__ = x, y__ = y, v__ = v;
- first = false;
- if (v) {
- listener.lineStart();
- listener.point(x, y);
- }
- } else {
- if (v && v_) listener.point(x, y); else {
- var l = {
- a: {
- x: x_,
- y: y_
- },
- b: {
- x: x,
- y: y
- }
- };
- if (clipLine(l)) {
- if (!v_) {
- listener.lineStart();
- listener.point(l.a.x, l.a.y);
- }
- listener.point(l.b.x, l.b.y);
- if (!v) listener.lineEnd();
- clean = false;
- } else if (v) {
- listener.lineStart();
- listener.point(x, y);
- clean = false;
- }
- }
- }
- x_ = x, y_ = y, v_ = v;
- }
- return clip;
- };
- function corner(p, direction) {
- return abs(p[0] - x0) < ε ? direction > 0 ? 0 : 3 : abs(p[0] - x1) < ε ? direction > 0 ? 2 : 1 : abs(p[1] - y0) < ε ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2;
- }
- function compare(a, b) {
- return comparePoints(a.x, b.x);
- }
- function comparePoints(a, b) {
- var ca = corner(a, 1), cb = corner(b, 1);
- return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0];
- }
- }
- function d3_geo_compose(a, b) {
- function compose(x, y) {
- return x = a(x, y), b(x[0], x[1]);
- }
- if (a.invert && b.invert) compose.invert = function(x, y) {
- return x = b.invert(x, y), x && a.invert(x[0], x[1]);
- };
- return compose;
- }
- function d3_geo_conic(projectAt) {
- var φ0 = 0, φ1 = π / 3, m = d3_geo_projectionMutator(projectAt), p = m(φ0, φ1);
- p.parallels = function(_) {
- if (!arguments.length) return [ φ0 / π * 180, φ1 / π * 180 ];
- return m(φ0 = _[0] * π / 180, φ1 = _[1] * π / 180);
- };
- return p;
- }
- function d3_geo_conicEqualArea(φ0, φ1) {
- var sinφ0 = Math.sin(φ0), n = (sinφ0 + Math.sin(φ1)) / 2, C = 1 + sinφ0 * (2 * n - sinφ0), ρ0 = Math.sqrt(C) / n;
- function forward(λ, φ) {
- var ρ = Math.sqrt(C - 2 * n * Math.sin(φ)) / n;
- return [ ρ * Math.sin(λ *= n), ρ0 - ρ * Math.cos(λ) ];
- }
- forward.invert = function(x, y) {
- var ρ0_y = ρ0 - y;
- return [ Math.atan2(x, ρ0_y) / n, d3_asin((C - (x * x + ρ0_y * ρ0_y) * n * n) / (2 * n)) ];
- };
- return forward;
- }
- (d3.geo.conicEqualArea = function() {
- return d3_geo_conic(d3_geo_conicEqualArea);
- }).raw = d3_geo_conicEqualArea;
- d3.geo.albers = function() {
- return d3.geo.conicEqualArea().rotate([ 96, 0 ]).center([ -.6, 38.7 ]).parallels([ 29.5, 45.5 ]).scale(1070);
- };
- d3.geo.albersUsa = function() {
- var lower48 = d3.geo.albers();
- var alaska = d3.geo.conicEqualArea().rotate([ 154, 0 ]).center([ -2, 58.5 ]).parallels([ 55, 65 ]);
- var hawaii = d3.geo.conicEqualArea().rotate([ 157, 0 ]).center([ -3, 19.9 ]).parallels([ 8, 18 ]);
- var point, pointStream = {
- point: function(x, y) {
- point = [ x, y ];
- }
- }, lower48Point, alaskaPoint, hawaiiPoint;
- function albersUsa(coordinates) {
- var x = coordinates[0], y = coordinates[1];
- point = null;
- (lower48Point(x, y), point) || (alaskaPoint(x, y), point) || hawaiiPoint(x, y);
- return point;
- }
- albersUsa.invert = function(coordinates) {
- var k = lower48.scale(), t = lower48.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;
- return (y >= .12 && y < .234 && x >= -.425 && x < -.214 ? alaska : y >= .166 && y < .234 && x >= -.214 && x < -.115 ? hawaii : lower48).invert(coordinates);
- };
- albersUsa.stream = function(stream) {
- var lower48Stream = lower48.stream(stream), alaskaStream = alaska.stream(stream), hawaiiStream = hawaii.stream(stream);
- return {
- point: function(x, y) {
- lower48Stream.point(x, y);
- alaskaStream.point(x, y);
- hawaiiStream.point(x, y);
- },
- sphere: function() {
- lower48Stream.sphere();
- alaskaStream.sphere();
- hawaiiStream.sphere();
- },
- lineStart: function() {
- lower48Stream.lineStart();
- alaskaStream.lineStart();
- hawaiiStream.lineStart();
- },
- lineEnd: function() {
- lower48Stream.lineEnd();
- alaskaStream.lineEnd();
- hawaiiStream.lineEnd();
- },
- polygonStart: function() {
- lower48Stream.polygonStart();
- alaskaStream.polygonStart();
- hawaiiStream.polygonStart();
- },
- polygonEnd: function() {
- lower48Stream.polygonEnd();
- alaskaStream.polygonEnd();
- hawaiiStream.polygonEnd();
- }
- };
- };
- albersUsa.precision = function(_) {
- if (!arguments.length) return lower48.precision();
- lower48.precision(_);
- alaska.precision(_);
- hawaii.precision(_);
- return albersUsa;
- };
- albersUsa.scale = function(_) {
- if (!arguments.length) return lower48.scale();
- lower48.scale(_);
- alaska.scale(_ * .35);
- hawaii.scale(_);
- return albersUsa.translate(lower48.translate());
- };
- albersUsa.translate = function(_) {
- if (!arguments.length) return lower48.translate();
- var k = lower48.scale(), x = +_[0], y = +_[1];
- lower48Point = lower48.translate(_).clipExtent([ [ x - .455 * k, y - .238 * k ], [ x + .455 * k, y + .238 * k ] ]).stream(pointStream).point;
- alaskaPoint = alaska.translate([ x - .307 * k, y + .201 * k ]).clipExtent([ [ x - .425 * k + ε, y + .12 * k + ε ], [ x - .214 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point;
- hawaiiPoint = hawaii.translate([ x - .205 * k, y + .212 * k ]).clipExtent([ [ x - .214 * k + ε, y + .166 * k + ε ], [ x - .115 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point;
- return albersUsa;
- };
- return albersUsa.scale(1070);
- };
- var d3_geo_pathAreaSum, d3_geo_pathAreaPolygon, d3_geo_pathArea = {
- point: d3_noop,
- lineStart: d3_noop,
- lineEnd: d3_noop,
- polygonStart: function() {
- d3_geo_pathAreaPolygon = 0;
- d3_geo_pathArea.lineStart = d3_geo_pathAreaRingStart;
- },
- polygonEnd: function() {
- d3_geo_pathArea.lineStart = d3_geo_pathArea.lineEnd = d3_geo_pathArea.point = d3_noop;
- d3_geo_pathAreaSum += abs(d3_geo_pathAreaPolygon / 2);
- }
- };
- function d3_geo_pathAreaRingStart() {
- var x00, y00, x0, y0;
- d3_geo_pathArea.point = function(x, y) {
- d3_geo_pathArea.point = nextPoint;
- x00 = x0 = x, y00 = y0 = y;
- };
- function nextPoint(x, y) {
- d3_geo_pathAreaPolygon += y0 * x - x0 * y;
- x0 = x, y0 = y;
- }
- d3_geo_pathArea.lineEnd = function() {
- nextPoint(x00, y00);
- };
- }
- var d3_geo_pathBoundsX0, d3_geo_pathBoundsY0, d3_geo_pathBoundsX1, d3_geo_pathBoundsY1;
- var d3_geo_pathBounds = {
- point: d3_geo_pathBoundsPoint,
- lineStart: d3_noop,
- lineEnd: d3_noop,
- polygonStart: d3_noop,
- polygonEnd: d3_noop
- };
- function d3_geo_pathBoundsPoint(x, y) {
- if (x < d3_geo_pathBoundsX0) d3_geo_pathBoundsX0 = x;
- if (x > d3_geo_pathBoundsX1) d3_geo_pathBoundsX1 = x;
- if (y < d3_geo_pathBoundsY0) d3_geo_pathBoundsY0 = y;
- if (y > d3_geo_pathBoundsY1) d3_geo_pathBoundsY1 = y;
- }
- function d3_geo_pathBuffer() {
- var pointCircle = d3_geo_pathBufferCircle(4.5), buffer = [];
- var stream = {
- point: point,
- lineStart: function() {
- stream.point = pointLineStart;
- },
- lineEnd: lineEnd,
- polygonStart: function() {
- stream.lineEnd = lineEndPolygon;
- },
- polygonEnd: function() {
- stream.lineEnd = lineEnd;
- stream.point = point;
- },
- pointRadius: function(_) {
- pointCircle = d3_geo_pathBufferCircle(_);
- return stream;
- },
- result: function() {
- if (buffer.length) {
- var result = buffer.join("");
- buffer = [];
- return result;
- }
- }
- };
- function point(x, y) {
- buffer.push("M", x, ",", y, pointCircle);
- }
- function pointLineStart(x, y) {
- buffer.push("M", x, ",", y);
- stream.point = pointLine;
- }
- function pointLine(x, y) {
- buffer.push("L", x, ",", y);
- }
- function lineEnd() {
- stream.point = point;
- }
- function lineEndPolygon() {
- buffer.push("Z");
- }
- return stream;
- }
- function d3_geo_pathBufferCircle(radius) {
- return "m0," + radius + "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius + "z";
- }
- var d3_geo_pathCentroid = {
- point: d3_geo_pathCentroidPoint,
- lineStart: d3_geo_pathCentroidLineStart,
- lineEnd: d3_geo_pathCentroidLineEnd,
- polygonStart: function() {
- d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidRingStart;
- },
- polygonEnd: function() {
- d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;
- d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidLineStart;
- d3_geo_pathCentroid.lineEnd = d3_geo_pathCentroidLineEnd;
- }
- };
- function d3_geo_pathCentroidPoint(x, y) {
- d3_geo_centroidX0 += x;
- d3_geo_centroidY0 += y;
- ++d3_geo_centroidZ0;
- }
- function d3_geo_pathCentroidLineStart() {
- var x0, y0;
- d3_geo_pathCentroid.point = function(x, y) {
- d3_geo_pathCentroid.point = nextPoint;
- d3_geo_pathCentroidPoint(x0 = x, y0 = y);
- };
- function nextPoint(x, y) {
- var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy);
- d3_geo_centroidX1 += z * (x0 + x) / 2;
- d3_geo_centroidY1 += z * (y0 + y) / 2;
- d3_geo_centroidZ1 += z;
- d3_geo_pathCentroidPoint(x0 = x, y0 = y);
- }
- }
- function d3_geo_pathCentroidLineEnd() {
- d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;
- }
- function d3_geo_pathCentroidRingStart() {
- var x00, y00, x0, y0;
- d3_geo_pathCentroid.point = function(x, y) {
- d3_geo_pathCentroid.point = nextPoint;
- d3_geo_pathCentroidPoint(x00 = x0 = x, y00 = y0 = y);
- };
- function nextPoint(x, y) {
- var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy);
- d3_geo_centroidX1 += z * (x0 + x) / 2;
- d3_geo_centroidY1 += z * (y0 + y) / 2;
- d3_geo_centroidZ1 += z;
- z = y0 * x - x0 * y;
- d3_geo_centroidX2 += z * (x0 + x);
- d3_geo_centroidY2 += z * (y0 + y);
- d3_geo_centroidZ2 += z * 3;
- d3_geo_pathCentroidPoint(x0 = x, y0 = y);
- }
- d3_geo_pathCentroid.lineEnd = function() {
- nextPoint(x00, y00);
- };
- }
- function d3_geo_pathContext(context) {
- var pointRadius = 4.5;
- var stream = {
- point: point,
- lineStart: function() {
- stream.point = pointLineStart;
- },
- lineEnd: lineEnd,
- polygonStart: function() {
- stream.lineEnd = lineEndPolygon;
- },
- polygonEnd: function() {
- stream.lineEnd = lineEnd;
- stream.point = point;
- },
- pointRadius: function(_) {
- pointRadius = _;
- return stream;
- },
- result: d3_noop
- };
- function point(x, y) {
- context.moveTo(x, y);
- context.arc(x, y, pointRadius, 0, τ);
- }
- function pointLineStart(x, y) {
- context.moveTo(x, y);
- stream.point = pointLine;
- }
- function pointLine(x, y) {
- context.lineTo(x, y);
- }
- function lineEnd() {
- stream.point = point;
- }
- function lineEndPolygon() {
- context.closePath();
- }
- return stream;
- }
- function d3_geo_resample(project) {
- var δ2 = .5, cosMinDistance = Math.cos(30 * d3_radians), maxDepth = 16;
- function resample(stream) {
- return (maxDepth ? resampleRecursive : resampleNone)(stream);
- }
- function resampleNone(stream) {
- return d3_geo_transformPoint(stream, function(x, y) {
- x = project(x, y);
- stream.point(x[0], x[1]);
- });
- }
- function resampleRecursive(stream) {
- var λ00, φ00, x00, y00, a00, b00, c00, λ0, x0, y0, a0, b0, c0;
- var resample = {
- point: point,
- lineStart: lineStart,
- lineEnd: lineEnd,
- polygonStart: function() {
- stream.polygonStart();
- resample.lineStart = ringStart;
- },
- polygonEnd: function() {
- stream.polygonEnd();
- resample.lineStart = lineStart;
- }
- };
- function point(x, y) {
- x = project(x, y);
- stream.point(x[0], x[1]);
- }
- function lineStart() {
- x0 = NaN;
- resample.point = linePoint;
- stream.lineStart();
- }
- function linePoint(λ, φ) {
- var c = d3_geo_cartesian([ λ, φ ]), p = project(λ, φ);
- resampleLineTo(x0, y0, λ0, a0, b0, c0, x0 = p[0], y0 = p[1], λ0 = λ, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);
- stream.point(x0, y0);
- }
- function lineEnd() {
- resample.point = point;
- stream.lineEnd();
- }
- function ringStart() {
- lineStart();
- resample.point = ringPoint;
- resample.lineEnd = ringEnd;
- }
- function ringPoint(λ, φ) {
- linePoint(λ00 = λ, φ00 = φ), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;
- resample.point = linePoint;
- }
- function ringEnd() {
- resampleLineTo(x0, y0, λ0, a0, b0, c0, x00, y00, λ00, a00, b00, c00, maxDepth, stream);
- resample.lineEnd = lineEnd;
- lineEnd();
- }
- return resample;
- }
- function resampleLineTo(x0, y0, λ0, a0, b0, c0, x1, y1, λ1, a1, b1, c1, depth, stream) {
- var dx = x1 - x0, dy = y1 - y0, d2 = dx * dx + dy * dy;
- if (d2 > 4 * δ2 && depth--) {
- var a = a0 + a1, b = b0 + b1, c = c0 + c1, m = Math.sqrt(a * a + b * b + c * c), φ2 = Math.asin(c /= m), λ2 = abs(abs(c) - 1) < ε || abs(λ0 - λ1) < ε ? (λ0 + λ1) / 2 : Math.atan2(b, a), p = project(λ2, φ2), x2 = p[0], y2 = p[1], dx2 = x2 - x0, dy2 = y2 - y0, dz = dy * dx2 - dx * dy2;
- if (dz * dz / d2 > δ2 || abs((dx * dx2 + dy * dy2) / d2 - .5) > .3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) {
- resampleLineTo(x0, y0, λ0, a0, b0, c0, x2, y2, λ2, a /= m, b /= m, c, depth, stream);
- stream.point(x2, y2);
- resampleLineTo(x2, y2, λ2, a, b, c, x1, y1, λ1, a1, b1, c1, depth, stream);
- }
- }
- }
- resample.precision = function(_) {
- if (!arguments.length) return Math.sqrt(δ2);
- maxDepth = (δ2 = _ * _) > 0 && 16;
- return resample;
- };
- return resample;
- }
- d3.geo.path = function() {
- var pointRadius = 4.5, projection, context, projectStream, contextStream, cacheStream;
- function path(object) {
- if (object) {
- if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments));
- if (!cacheStream || !cacheStream.valid) cacheStream = projectStream(contextStream);
- d3.geo.stream(object, cacheStream);
- }
- return contextStream.result();
- }
- path.area = function(object) {
- d3_geo_pathAreaSum = 0;
- d3.geo.stream(object, projectStream(d3_geo_pathArea));
- return d3_geo_pathAreaSum;
- };
- path.centroid = function(object) {
- d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0;
- d3.geo.stream(object, projectStream(d3_geo_pathCentroid));
- return d3_geo_centroidZ2 ? [ d3_geo_centroidX2 / d3_geo_centroidZ2, d3_geo_centroidY2 / d3_geo_centroidZ2 ] : d3_geo_centroidZ1 ? [ d3_geo_centroidX1 / d3_geo_centroidZ1, d3_geo_centroidY1 / d3_geo_centroidZ1 ] : d3_geo_centroidZ0 ? [ d3_geo_centroidX0 / d3_geo_centroidZ0, d3_geo_centroidY0 / d3_geo_centroidZ0 ] : [ NaN, NaN ];
- };
- path.bounds = function(object) {
- d3_geo_pathBoundsX1 = d3_geo_pathBoundsY1 = -(d3_geo_pathBoundsX0 = d3_geo_pathBoundsY0 = Infinity);
- d3.geo.stream(object, projectStream(d3_geo_pathBounds));
- return [ [ d3_geo_pathBoundsX0, d3_geo_pathBoundsY0 ], [ d3_geo_pathBoundsX1, d3_geo_pathBoundsY1 ] ];
- };
- path.projection = function(_) {
- if (!arguments.length) return projection;
- projectStream = (projection = _) ? _.stream || d3_geo_pathProjectStream(_) : d3_identity;
- return reset();
- };
- path.context = function(_) {
- if (!arguments.length) return context;
- contextStream = (context = _) == null ? new d3_geo_pathBuffer() : new d3_geo_pathContext(_);
- if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius);
- return reset();
- };
- path.pointRadius = function(_) {
- if (!arguments.length) return pointRadius;
- pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_);
- return path;
- };
- function reset() {
- cacheStream = null;
- return path;
- }
- return path.projection(d3.geo.albersUsa()).context(null);
- };
- function d3_geo_pathProjectStream(project) {
- var resample = d3_geo_resample(function(x, y) {
- return project([ x * d3_degrees, y * d3_degrees ]);
- });
- return function(stream) {
- return d3_geo_projectionRadians(resample(stream));
- };
- }
- d3.geo.transform = function(methods) {
- return {
- stream: function(stream) {
- var transform = new d3_geo_transform(stream);
- for (var k in methods) transform[k] = methods[k];
- return transform;
- }
- };
- };
- function d3_geo_transform(stream) {
- this.stream = stream;
- }
- d3_geo_transform.prototype = {
- point: function(x, y) {
- this.stream.point(x, y);
- },
- sphere: function() {
- this.stream.sphere();
- },
- lineStart: function() {
- this.stream.lineStart();
- },
- lineEnd: function() {
- this.stream.lineEnd();
- },
- polygonStart: function() {
- this.stream.polygonStart();
- },
- polygonEnd: function() {
- this.stream.polygonEnd();
- }
- };
- function d3_geo_transformPoint(stream, point) {
- return {
- point: point,
- sphere: function() {
- stream.sphere();
- },
- lineStart: function() {
- stream.lineStart();
- },
- lineEnd: function() {
- stream.lineEnd();
- },
- polygonStart: function() {
- stream.polygonStart();
- },
- polygonEnd: function() {
- stream.polygonEnd();
- }
- };
- }
- d3.geo.projection = d3_geo_projection;
- d3.geo.projectionMutator = d3_geo_projectionMutator;
- function d3_geo_projection(project) {
- return d3_geo_projectionMutator(function() {
- return project;
- })();
- }
- function d3_geo_projectionMutator(projectAt) {
- var project, rotate, projectRotate, projectResample = d3_geo_resample(function(x, y) {
- x = project(x, y);
- return [ x[0] * k + δx, δy - x[1] * k ];
- }), k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, preclip = d3_geo_clipAntimeridian, postclip = d3_identity, clipAngle = null, clipExtent = null, stream;
- function projection(point) {
- point = projectRotate(point[0] * d3_radians, point[1] * d3_radians);
- return [ point[0] * k + δx, δy - point[1] * k ];
- }
- function invert(point) {
- point = projectRotate.invert((point[0] - δx) / k, (δy - point[1]) / k);
- return point && [ point[0] * d3_degrees, point[1] * d3_degrees ];
- }
- projection.stream = function(output) {
- if (stream) stream.valid = false;
- stream = d3_geo_projectionRadians(preclip(rotate, projectResample(postclip(output))));
- stream.valid = true;
- return stream;
- };
- projection.clipAngle = function(_) {
- if (!arguments.length) return clipAngle;
- preclip = _ == null ? (clipAngle = _, d3_geo_clipAntimeridian) : d3_geo_clipCircle((clipAngle = +_) * d3_radians);
- return invalidate();
- };
- projection.clipExtent = function(_) {
- if (!arguments.length) return clipExtent;
- clipExtent = _;
- postclip = _ ? d3_geo_clipExtent(_[0][0], _[0][1], _[1][0], _[1][1]) : d3_identity;
- return invalidate();
- };
- projection.scale = function(_) {
- if (!arguments.length) return k;
- k = +_;
- return reset();
- };
- projection.translate = function(_) {
- if (!arguments.length) return [ x, y ];
- x = +_[0];
- y = +_[1];
- return reset();
- };
- projection.center = function(_) {
- if (!arguments.length) return [ λ * d3_degrees, φ * d3_degrees ];
- λ = _[0] % 360 * d3_radians;
- φ = _[1] % 360 * d3_radians;
- return reset();
- };
- projection.rotate = function(_) {
- if (!arguments.length) return [ δλ * d3_degrees, δφ * d3_degrees, δγ * d3_degrees ];
- δλ = _[0] % 360 * d3_radians;
- δφ = _[1] % 360 * d3_radians;
- δγ = _.length > 2 ? _[2] % 360 * d3_radians : 0;
- return reset();
- };
- d3.rebind(projection, projectResample, "precision");
- function reset() {
- projectRotate = d3_geo_compose(rotate = d3_geo_rotation(δλ, δφ, δγ), project);
- var center = project(λ, φ);
- δx = x - center[0] * k;
- δy = y + center[1] * k;
- return invalidate();
- }
- function invalidate() {
- if (stream) stream.valid = false, stream = null;
- return projection;
- }
- return function() {
- project = projectAt.apply(this, arguments);
- projection.invert = project.invert && invert;
- return reset();
- };
- }
- function d3_geo_projectionRadians(stream) {
- return d3_geo_transformPoint(stream, function(x, y) {
- stream.point(x * d3_radians, y * d3_radians);
- });
- }
- function d3_geo_equirectangular(λ, φ) {
- return [ λ, φ ];
- }
- (d3.geo.equirectangular = function() {
- return d3_geo_projection(d3_geo_equirectangular);
- }).raw = d3_geo_equirectangular.invert = d3_geo_equirectangular;
- d3.geo.rotation = function(rotate) {
- rotate = d3_geo_rotation(rotate[0] % 360 * d3_radians, rotate[1] * d3_radians, rotate.length > 2 ? rotate[2] * d3_radians : 0);
- function forward(coordinates) {
- coordinates = rotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians);
- return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates;
- }
- forward.invert = function(coordinates) {
- coordinates = rotate.invert(coordinates[0] * d3_radians, coordinates[1] * d3_radians);
- return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates;
- };
- return forward;
- };
- function d3_geo_identityRotation(λ, φ) {
- return [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];
- }
- d3_geo_identityRotation.invert = d3_geo_equirectangular;
- function d3_geo_rotation(δλ, δφ, δγ) {
- return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_identityRotation;
- }
- function d3_geo_forwardRotationλ(δλ) {
- return function(λ, φ) {
- return λ += δλ, [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];
- };
- }
- function d3_geo_rotationλ(δλ) {
- var rotation = d3_geo_forwardRotationλ(δλ);
- rotation.invert = d3_geo_forwardRotationλ(-δλ);
- return rotation;
- }
- function d3_geo_rotationφγ(δφ, δγ) {
- var cosδφ = Math.cos(δφ), sinδφ = Math.sin(δφ), cosδγ = Math.cos(δγ), sinδγ = Math.sin(δγ);
- function rotation(λ, φ) {
- var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδφ + x * sinδφ;
- return [ Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ), d3_asin(k * cosδγ + y * sinδγ) ];
- }
- rotation.invert = function(λ, φ) {
- var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδγ - y * sinδγ;
- return [ Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ), d3_asin(k * cosδφ - x * sinδφ) ];
- };
- return rotation;
- }
- d3.geo.circle = function() {
- var origin = [ 0, 0 ], angle, precision = 6, interpolate;
- function circle() {
- var center = typeof origin === "function" ? origin.apply(this, arguments) : origin, rotate = d3_geo_rotation(-center[0] * d3_radians, -center[1] * d3_radians, 0).invert, ring = [];
- interpolate(null, null, 1, {
- point: function(x, y) {
- ring.push(x = rotate(x, y));
- x[0] *= d3_degrees, x[1] *= d3_degrees;
- }
- });
- return {
- type: "Polygon",
- coordinates: [ ring ]
- };
- }
- circle.origin = function(x) {
- if (!arguments.length) return origin;
- origin = x;
- return circle;
- };
- circle.angle = function(x) {
- if (!arguments.length) return angle;
- interpolate = d3_geo_circleInterpolate((angle = +x) * d3_radians, precision * d3_radians);
- return circle;
- };
- circle.precision = function(_) {
- if (!arguments.length) return precision;
- interpolate = d3_geo_circleInterpolate(angle * d3_radians, (precision = +_) * d3_radians);
- return circle;
- };
- return circle.angle(90);
- };
- function d3_geo_circleInterpolate(radius, precision) {
- var cr = Math.cos(radius), sr = Math.sin(radius);
- return function(from, to, direction, listener) {
- var step = direction * precision;
- if (from != null) {
- from = d3_geo_circleAngle(cr, from);
- to = d3_geo_circleAngle(cr, to);
- if (direction > 0 ? from < to : from > to) from += direction * τ;
- } else {
- from = radius + direction * τ;
- to = radius - .5 * step;
- }
- for (var point, t = from; direction > 0 ? t > to : t < to; t -= step) {
- listener.point((point = d3_geo_spherical([ cr, -sr * Math.cos(t), -sr * Math.sin(t) ]))[0], point[1]);
- }
- };
- }
- function d3_geo_circleAngle(cr, point) {
- var a = d3_geo_cartesian(point);
- a[0] -= cr;
- d3_geo_cartesianNormalize(a);
- var angle = d3_acos(-a[1]);
- return ((-a[2] < 0 ? -angle : angle) + 2 * Math.PI - ε) % (2 * Math.PI);
- }
- d3.geo.distance = function(a, b) {
- var Δλ = (b[0] - a[0]) * d3_radians, φ0 = a[1] * d3_radians, φ1 = b[1] * d3_radians, sinΔλ = Math.sin(Δλ), cosΔλ = Math.cos(Δλ), sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1), t;
- return Math.atan2(Math.sqrt((t = cosφ1 * sinΔλ) * t + (t = cosφ0 * sinφ1 - sinφ0 * cosφ1 * cosΔλ) * t), sinφ0 * sinφ1 + cosφ0 * cosφ1 * cosΔλ);
- };
- d3.geo.graticule = function() {
- var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5;
- function graticule() {
- return {
- type: "MultiLineString",
- coordinates: lines()
- };
- }
- function lines() {
- return d3.range(Math.ceil(X0 / DX) * DX, X1, DX).map(X).concat(d3.range(Math.ceil(Y0 / DY) * DY, Y1, DY).map(Y)).concat(d3.range(Math.ceil(x0 / dx) * dx, x1, dx).filter(function(x) {
- return abs(x % DX) > ε;
- }).map(x)).concat(d3.range(Math.ceil(y0 / dy) * dy, y1, dy).filter(function(y) {
- return abs(y % DY) > ε;
- }).map(y));
- }
- graticule.lines = function() {
- return lines().map(function(coordinates) {
- return {
- type: "LineString",
- coordinates: coordinates
- };
- });
- };
- graticule.outline = function() {
- return {
- type: "Polygon",
- coordinates: [ X(X0).concat(Y(Y1).slice(1), X(X1).reverse().slice(1), Y(Y0).reverse().slice(1)) ]
- };
- };
- graticule.extent = function(_) {
- if (!arguments.length) return graticule.minorExtent();
- return graticule.majorExtent(_).minorExtent(_);
- };
- graticule.majorExtent = function(_) {
- if (!arguments.length) return [ [ X0, Y0 ], [ X1, Y1 ] ];
- X0 = +_[0][0], X1 = +_[1][0];
- Y0 = +_[0][1], Y1 = +_[1][1];
- if (X0 > X1) _ = X0, X0 = X1, X1 = _;
- if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;
- return graticule.precision(precision);
- };
- graticule.minorExtent = function(_) {
- if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];
- x0 = +_[0][0], x1 = +_[1][0];
- y0 = +_[0][1], y1 = +_[1][1];
- if (x0 > x1) _ = x0, x0 = x1, x1 = _;
- if (y0 > y1) _ = y0, y0 = y1, y1 = _;
- return graticule.precision(precision);
- };
- graticule.step = function(_) {
- if (!arguments.length) return graticule.minorStep();
- return graticule.majorStep(_).minorStep(_);
- };
- graticule.majorStep = function(_) {
- if (!arguments.length) return [ DX, DY ];
- DX = +_[0], DY = +_[1];
- return graticule;
- };
- graticule.minorStep = function(_) {
- if (!arguments.length) return [ dx, dy ];
- dx = +_[0], dy = +_[1];
- return graticule;
- };
- graticule.precision = function(_) {
- if (!arguments.length) return precision;
- precision = +_;
- x = d3_geo_graticuleX(y0, y1, 90);
- y = d3_geo_graticuleY(x0, x1, precision);
- X = d3_geo_graticuleX(Y0, Y1, 90);
- Y = d3_geo_graticuleY(X0, X1, precision);
- return graticule;
- };
- return graticule.majorExtent([ [ -180, -90 + ε ], [ 180, 90 - ε ] ]).minorExtent([ [ -180, -80 - ε ], [ 180, 80 + ε ] ]);
- };
- function d3_geo_graticuleX(y0, y1, dy) {
- var y = d3.range(y0, y1 - ε, dy).concat(y1);
- return function(x) {
- return y.map(function(y) {
- return [ x, y ];
- });
- };
- }
- function d3_geo_graticuleY(x0, x1, dx) {
- var x = d3.range(x0, x1 - ε, dx).concat(x1);
- return function(y) {
- return x.map(function(x) {
- return [ x, y ];
- });
- };
- }
- function d3_source(d) {
- return d.source;
- }
- function d3_target(d) {
- return d.target;
- }
- d3.geo.greatArc = function() {
- var source = d3_source, source_, target = d3_target, target_;
- function greatArc() {
- return {
- type: "LineString",
- coordinates: [ source_ || source.apply(this, arguments), target_ || target.apply(this, arguments) ]
- };
- }
- greatArc.distance = function() {
- return d3.geo.distance(source_ || source.apply(this, arguments), target_ || target.apply(this, arguments));
- };
- greatArc.source = function(_) {
- if (!arguments.length) return source;
- source = _, source_ = typeof _ === "function" ? null : _;
- return greatArc;
- };
- greatArc.target = function(_) {
- if (!arguments.length) return target;
- target = _, target_ = typeof _ === "function" ? null : _;
- return greatArc;
- };
- greatArc.precision = function() {
- return arguments.length ? greatArc : 0;
- };
- return greatArc;
- };
- d3.geo.interpolate = function(source, target) {
- return d3_geo_interpolate(source[0] * d3_radians, source[1] * d3_radians, target[0] * d3_radians, target[1] * d3_radians);
- };
- function d3_geo_interpolate(x0, y0, x1, y1) {
- var cy0 = Math.cos(y0), sy0 = Math.sin(y0), cy1 = Math.cos(y1), sy1 = Math.sin(y1), kx0 = cy0 * Math.cos(x0), ky0 = cy0 * Math.sin(x0), kx1 = cy1 * Math.cos(x1), ky1 = cy1 * Math.sin(x1), d = 2 * Math.asin(Math.sqrt(d3_haversin(y1 - y0) + cy0 * cy1 * d3_haversin(x1 - x0))), k = 1 / Math.sin(d);
- var interpolate = d ? function(t) {
- var B = Math.sin(t *= d) * k, A = Math.sin(d - t) * k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1;
- return [ Math.atan2(y, x) * d3_degrees, Math.atan2(z, Math.sqrt(x * x + y * y)) * d3_degrees ];
- } : function() {
- return [ x0 * d3_degrees, y0 * d3_degrees ];
- };
- interpolate.distance = d;
- return interpolate;
- }
- d3.geo.length = function(object) {
- d3_geo_lengthSum = 0;
- d3.geo.stream(object, d3_geo_length);
- return d3_geo_lengthSum;
- };
- var d3_geo_lengthSum;
- var d3_geo_length = {
- sphere: d3_noop,
- point: d3_noop,
- lineStart: d3_geo_lengthLineStart,
- lineEnd: d3_noop,
- polygonStart: d3_noop,
- polygonEnd: d3_noop
- };
- function d3_geo_lengthLineStart() {
- var λ0, sinφ0, cosφ0;
- d3_geo_length.point = function(λ, φ) {
- λ0 = λ * d3_radians, sinφ0 = Math.sin(φ *= d3_radians), cosφ0 = Math.cos(φ);
- d3_geo_length.point = nextPoint;
- };
- d3_geo_length.lineEnd = function() {
- d3_geo_length.point = d3_geo_length.lineEnd = d3_noop;
- };
- function nextPoint(λ, φ) {
- var sinφ = Math.sin(φ *= d3_radians), cosφ = Math.cos(φ), t = abs((λ *= d3_radians) - λ0), cosΔλ = Math.cos(t);
- d3_geo_lengthSum += Math.atan2(Math.sqrt((t = cosφ * Math.sin(t)) * t + (t = cosφ0 * sinφ - sinφ0 * cosφ * cosΔλ) * t), sinφ0 * sinφ + cosφ0 * cosφ * cosΔλ);
- λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ;
- }
- }
- function d3_geo_azimuthal(scale, angle) {
- function azimuthal(λ, φ) {
- var cosλ = Math.cos(λ), cosφ = Math.cos(φ), k = scale(cosλ * cosφ);
- return [ k * cosφ * Math.sin(λ), k * Math.sin(φ) ];
- }
- azimuthal.invert = function(x, y) {
- var ρ = Math.sqrt(x * x + y * y), c = angle(ρ), sinc = Math.sin(c), cosc = Math.cos(c);
- return [ Math.atan2(x * sinc, ρ * cosc), Math.asin(ρ && y * sinc / ρ) ];
- };
- return azimuthal;
- }
- var d3_geo_azimuthalEqualArea = d3_geo_azimuthal(function(cosλcosφ) {
- return Math.sqrt(2 / (1 + cosλcosφ));
- }, function(ρ) {
- return 2 * Math.asin(ρ / 2);
- });
- (d3.geo.azimuthalEqualArea = function() {
- return d3_geo_projection(d3_geo_azimuthalEqualArea);
- }).raw = d3_geo_azimuthalEqualArea;
- var d3_geo_azimuthalEquidistant = d3_geo_azimuthal(function(cosλcosφ) {
- var c = Math.acos(cosλcosφ);
- return c && c / Math.sin(c);
- }, d3_identity);
- (d3.geo.azimuthalEquidistant = function() {
- return d3_geo_projection(d3_geo_azimuthalEquidistant);
- }).raw = d3_geo_azimuthalEquidistant;
- function d3_geo_conicConformal(φ0, φ1) {
- var cosφ0 = Math.cos(φ0), t = function(φ) {
- return Math.tan(π / 4 + φ / 2);
- }, n = φ0 === φ1 ? Math.sin(φ0) : Math.log(cosφ0 / Math.cos(φ1)) / Math.log(t(φ1) / t(φ0)), F = cosφ0 * Math.pow(t(φ0), n) / n;
- if (!n) return d3_geo_mercator;
- function forward(λ, φ) {
- if (F > 0) {
- if (φ < -halfπ + ε) φ = -halfπ + ε;
- } else {
- if (φ > halfπ - ε) φ = halfπ - ε;
- }
- var ρ = F / Math.pow(t(φ), n);
- return [ ρ * Math.sin(n * λ), F - ρ * Math.cos(n * λ) ];
- }
- forward.invert = function(x, y) {
- var ρ0_y = F - y, ρ = d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y);
- return [ Math.atan2(x, ρ0_y) / n, 2 * Math.atan(Math.pow(F / ρ, 1 / n)) - halfπ ];
- };
- return forward;
- }
- (d3.geo.conicConformal = function() {
- return d3_geo_conic(d3_geo_conicConformal);
- }).raw = d3_geo_conicConformal;
- function d3_geo_conicEquidistant(φ0, φ1) {
- var cosφ0 = Math.cos(φ0), n = φ0 === φ1 ? Math.sin(φ0) : (cosφ0 - Math.cos(φ1)) / (φ1 - φ0), G = cosφ0 / n + φ0;
- if (abs(n) < ε) return d3_geo_equirectangular;
- function forward(λ, φ) {
- var ρ = G - φ;
- return [ ρ * Math.sin(n * λ), G - ρ * Math.cos(n * λ) ];
- }
- forward.invert = function(x, y) {
- var ρ0_y = G - y;
- return [ Math.atan2(x, ρ0_y) / n, G - d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y) ];
- };
- return forward;
- }
- (d3.geo.conicEquidistant = function() {
- return d3_geo_conic(d3_geo_conicEquidistant);
- }).raw = d3_geo_conicEquidistant;
- var d3_geo_gnomonic = d3_geo_azimuthal(function(cosλcosφ) {
- return 1 / cosλcosφ;
- }, Math.atan);
- (d3.geo.gnomonic = function() {
- return d3_geo_projection(d3_geo_gnomonic);
- }).raw = d3_geo_gnomonic;
- function d3_geo_mercator(λ, φ) {
- return [ λ, Math.log(Math.tan(π / 4 + φ / 2)) ];
- }
- d3_geo_mercator.invert = function(x, y) {
- return [ x, 2 * Math.atan(Math.exp(y)) - halfπ ];
- };
- function d3_geo_mercatorProjection(project) {
- var m = d3_geo_projection(project), scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, clipAuto;
- m.scale = function() {
- var v = scale.apply(m, arguments);
- return v === m ? clipAuto ? m.clipExtent(null) : m : v;
- };
- m.translate = function() {
- var v = translate.apply(m, arguments);
- return v === m ? clipAuto ? m.clipExtent(null) : m : v;
- };
- m.clipExtent = function(_) {
- var v = clipExtent.apply(m, arguments);
- if (v === m) {
- if (clipAuto = _ == null) {
- var k = π * scale(), t = translate();
- clipExtent([ [ t[0] - k, t[1] - k ], [ t[0] + k, t[1] + k ] ]);
- }
- } else if (clipAuto) {
- v = null;
- }
- return v;
- };
- return m.clipExtent(null);
- }
- (d3.geo.mercator = function() {
- return d3_geo_mercatorProjection(d3_geo_mercator);
- }).raw = d3_geo_mercator;
- var d3_geo_orthographic = d3_geo_azimuthal(function() {
- return 1;
- }, Math.asin);
- (d3.geo.orthographic = function() {
- return d3_geo_projection(d3_geo_orthographic);
- }).raw = d3_geo_orthographic;
- var d3_geo_stereographic = d3_geo_azimuthal(function(cosλcosφ) {
- return 1 / (1 + cosλcosφ);
- }, function(ρ) {
- return 2 * Math.atan(ρ);
- });
- (d3.geo.stereographic = function() {
- return d3_geo_projection(d3_geo_stereographic);
- }).raw = d3_geo_stereographic;
- function d3_geo_transverseMercator(λ, φ) {
- return [ Math.log(Math.tan(π / 4 + φ / 2)), -λ ];
- }
- d3_geo_transverseMercator.invert = function(x, y) {
- return [ -y, 2 * Math.atan(Math.exp(x)) - halfπ ];
- };
- (d3.geo.transverseMercator = function() {
- var projection = d3_geo_mercatorProjection(d3_geo_transverseMercator), center = projection.center, rotate = projection.rotate;
- projection.center = function(_) {
- return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ _[1], -_[0] ]);
- };
- projection.rotate = function(_) {
- return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(),
- [ _[0], _[1], _[2] - 90 ]);
- };
- return rotate([ 0, 0, 90 ]);
- }).raw = d3_geo_transverseMercator;
- d3.geom = {};
- function d3_geom_pointX(d) {
- return d[0];
- }
- function d3_geom_pointY(d) {
- return d[1];
- }
- d3.geom.hull = function(vertices) {
- var x = d3_geom_pointX, y = d3_geom_pointY;
- if (arguments.length) return hull(vertices);
- function hull(data) {
- if (data.length < 3) return [];
- var fx = d3_functor(x), fy = d3_functor(y), i, n = data.length, points = [], flippedPoints = [];
- for (i = 0; i < n; i++) {
- points.push([ +fx.call(this, data[i], i), +fy.call(this, data[i], i), i ]);
- }
- points.sort(d3_geom_hullOrder);
- for (i = 0; i < n; i++) flippedPoints.push([ points[i][0], -points[i][1] ]);
- var upper = d3_geom_hullUpper(points), lower = d3_geom_hullUpper(flippedPoints);
- var skipLeft = lower[0] === upper[0], skipRight = lower[lower.length - 1] === upper[upper.length - 1], polygon = [];
- for (i = upper.length - 1; i >= 0; --i) polygon.push(data[points[upper[i]][2]]);
- for (i = +skipLeft; i < lower.length - skipRight; ++i) polygon.push(data[points[lower[i]][2]]);
- return polygon;
- }
- hull.x = function(_) {
- return arguments.length ? (x = _, hull) : x;
- };
- hull.y = function(_) {
- return arguments.length ? (y = _, hull) : y;
- };
- return hull;
- };
- function d3_geom_hullUpper(points) {
- var n = points.length, hull = [ 0, 1 ], hs = 2;
- for (var i = 2; i < n; i++) {
- while (hs > 1 && d3_cross2d(points[hull[hs - 2]], points[hull[hs - 1]], points[i]) <= 0) --hs;
- hull[hs++] = i;
- }
- return hull.slice(0, hs);
- }
- function d3_geom_hullOrder(a, b) {
- return a[0] - b[0] || a[1] - b[1];
- }
- d3.geom.polygon = function(coordinates) {
- d3_subclass(coordinates, d3_geom_polygonPrototype);
- return coordinates;
- };
- var d3_geom_polygonPrototype = d3.geom.polygon.prototype = [];
- d3_geom_polygonPrototype.area = function() {
- var i = -1, n = this.length, a, b = this[n - 1], area = 0;
- while (++i < n) {
- a = b;
- b = this[i];
- area += a[1] * b[0] - a[0] * b[1];
- }
- return area * .5;
- };
- d3_geom_polygonPrototype.centroid = function(k) {
- var i = -1, n = this.length, x = 0, y = 0, a, b = this[n - 1], c;
- if (!arguments.length) k = -1 / (6 * this.area());
- while (++i < n) {
- a = b;
- b = this[i];
- c = a[0] * b[1] - b[0] * a[1];
- x += (a[0] + b[0]) * c;
- y += (a[1] + b[1]) * c;
- }
- return [ x * k, y * k ];
- };
- d3_geom_polygonPrototype.clip = function(subject) {
- var input, closed = d3_geom_polygonClosed(subject), i = -1, n = this.length - d3_geom_polygonClosed(this), j, m, a = this[n - 1], b, c, d;
- while (++i < n) {
- input = subject.slice();
- subject.length = 0;
- b = this[i];
- c = input[(m = input.length - closed) - 1];
- j = -1;
- while (++j < m) {
- d = input[j];
- if (d3_geom_polygonInside(d, a, b)) {
- if (!d3_geom_polygonInside(c, a, b)) {
- subject.push(d3_geom_polygonIntersect(c, d, a, b));
- }
- subject.push(d);
- } else if (d3_geom_polygonInside(c, a, b)) {
- subject.push(d3_geom_polygonIntersect(c, d, a, b));
- }
- c = d;
- }
- if (closed) subject.push(subject[0]);
- a = b;
- }
- return subject;
- };
- function d3_geom_polygonInside(p, a, b) {
- return (b[0] - a[0]) * (p[1] - a[1]) < (b[1] - a[1]) * (p[0] - a[0]);
- }
- function d3_geom_polygonIntersect(c, d, a, b) {
- var x1 = c[0], x3 = a[0], x21 = d[0] - x1, x43 = b[0] - x3, y1 = c[1], y3 = a[1], y21 = d[1] - y1, y43 = b[1] - y3, ua = (x43 * (y1 - y3) - y43 * (x1 - x3)) / (y43 * x21 - x43 * y21);
- return [ x1 + ua * x21, y1 + ua * y21 ];
- }
- function d3_geom_polygonClosed(coordinates) {
- var a = coordinates[0], b = coordinates[coordinates.length - 1];
- return !(a[0] - b[0] || a[1] - b[1]);
- }
- var d3_geom_voronoiEdges, d3_geom_voronoiCells, d3_geom_voronoiBeaches, d3_geom_voronoiBeachPool = [], d3_geom_voronoiFirstCircle, d3_geom_voronoiCircles, d3_geom_voronoiCirclePool = [];
- function d3_geom_voronoiBeach() {
- d3_geom_voronoiRedBlackNode(this);
- this.edge = this.site = this.circle = null;
- }
- function d3_geom_voronoiCreateBeach(site) {
- var beach = d3_geom_voronoiBeachPool.pop() || new d3_geom_voronoiBeach();
- beach.site = site;
- return beach;
- }
- function d3_geom_voronoiDetachBeach(beach) {
- d3_geom_voronoiDetachCircle(beach);
- d3_geom_voronoiBeaches.remove(beach);
- d3_geom_voronoiBeachPool.push(beach);
- d3_geom_voronoiRedBlackNode(beach);
- }
- function d3_geom_voronoiRemoveBeach(beach) {
- var circle = beach.circle, x = circle.x, y = circle.cy, vertex = {
- x: x,
- y: y
- }, previous = beach.P, next = beach.N, disappearing = [ beach ];
- d3_geom_voronoiDetachBeach(beach);
- var lArc = previous;
- while (lArc.circle && abs(x - lArc.circle.x) < ε && abs(y - lArc.circle.cy) < ε) {
- previous = lArc.P;
- disappearing.unshift(lArc);
- d3_geom_voronoiDetachBeach(lArc);
- lArc = previous;
- }
- disappearing.unshift(lArc);
- d3_geom_voronoiDetachCircle(lArc);
- var rArc = next;
- while (rArc.circle && abs(x - rArc.circle.x) < ε && abs(y - rArc.circle.cy) < ε) {
- next = rArc.N;
- disappearing.push(rArc);
- d3_geom_voronoiDetachBeach(rArc);
- rArc = next;
- }
- disappearing.push(rArc);
- d3_geom_voronoiDetachCircle(rArc);
- var nArcs = disappearing.length, iArc;
- for (iArc = 1; iArc < nArcs; ++iArc) {
- rArc = disappearing[iArc];
- lArc = disappearing[iArc - 1];
- d3_geom_voronoiSetEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex);
- }
- lArc = disappearing[0];
- rArc = disappearing[nArcs - 1];
- rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, rArc.site, null, vertex);
- d3_geom_voronoiAttachCircle(lArc);
- d3_geom_voronoiAttachCircle(rArc);
- }
- function d3_geom_voronoiAddBeach(site) {
- var x = site.x, directrix = site.y, lArc, rArc, dxl, dxr, node = d3_geom_voronoiBeaches._;
- while (node) {
- dxl = d3_geom_voronoiLeftBreakPoint(node, directrix) - x;
- if (dxl > ε) node = node.L; else {
- dxr = x - d3_geom_voronoiRightBreakPoint(node, directrix);
- if (dxr > ε) {
- if (!node.R) {
- lArc = node;
- break;
- }
- node = node.R;
- } else {
- if (dxl > -ε) {
- lArc = node.P;
- rArc = node;
- } else if (dxr > -ε) {
- lArc = node;
- rArc = node.N;
- } else {
- lArc = rArc = node;
- }
- break;
- }
- }
- }
- var newArc = d3_geom_voronoiCreateBeach(site);
- d3_geom_voronoiBeaches.insert(lArc, newArc);
- if (!lArc && !rArc) return;
- if (lArc === rArc) {
- d3_geom_voronoiDetachCircle(lArc);
- rArc = d3_geom_voronoiCreateBeach(lArc.site);
- d3_geom_voronoiBeaches.insert(newArc, rArc);
- newArc.edge = rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site);
- d3_geom_voronoiAttachCircle(lArc);
- d3_geom_voronoiAttachCircle(rArc);
- return;
- }
- if (!rArc) {
- newArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site);
- return;
- }
- d3_geom_voronoiDetachCircle(lArc);
- d3_geom_voronoiDetachCircle(rArc);
- var lSite = lArc.site, ax = lSite.x, ay = lSite.y, bx = site.x - ax, by = site.y - ay, rSite = rArc.site, cx = rSite.x - ax, cy = rSite.y - ay, d = 2 * (bx * cy - by * cx), hb = bx * bx + by * by, hc = cx * cx + cy * cy, vertex = {
- x: (cy * hb - by * hc) / d + ax,
- y: (bx * hc - cx * hb) / d + ay
- };
- d3_geom_voronoiSetEdgeEnd(rArc.edge, lSite, rSite, vertex);
- newArc.edge = d3_geom_voronoiCreateEdge(lSite, site, null, vertex);
- rArc.edge = d3_geom_voronoiCreateEdge(site, rSite, null, vertex);
- d3_geom_voronoiAttachCircle(lArc);
- d3_geom_voronoiAttachCircle(rArc);
- }
- function d3_geom_voronoiLeftBreakPoint(arc, directrix) {
- var site = arc.site, rfocx = site.x, rfocy = site.y, pby2 = rfocy - directrix;
- if (!pby2) return rfocx;
- var lArc = arc.P;
- if (!lArc) return -Infinity;
- site = lArc.site;
- var lfocx = site.x, lfocy = site.y, plby2 = lfocy - directrix;
- if (!plby2) return lfocx;
- var hl = lfocx - rfocx, aby2 = 1 / pby2 - 1 / plby2, b = hl / plby2;
- if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx;
- return (rfocx + lfocx) / 2;
- }
- function d3_geom_voronoiRightBreakPoint(arc, directrix) {
- var rArc = arc.N;
- if (rArc) return d3_geom_voronoiLeftBreakPoint(rArc, directrix);
- var site = arc.site;
- return site.y === directrix ? site.x : Infinity;
- }
- function d3_geom_voronoiCell(site) {
- this.site = site;
- this.edges = [];
- }
- d3_geom_voronoiCell.prototype.prepare = function() {
- var halfEdges = this.edges, iHalfEdge = halfEdges.length, edge;
- while (iHalfEdge--) {
- edge = halfEdges[iHalfEdge].edge;
- if (!edge.b || !edge.a) halfEdges.splice(iHalfEdge, 1);
- }
- halfEdges.sort(d3_geom_voronoiHalfEdgeOrder);
- return halfEdges.length;
- };
- function d3_geom_voronoiCloseCells(extent) {
- var x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], x2, y2, x3, y3, cells = d3_geom_voronoiCells, iCell = cells.length, cell, iHalfEdge, halfEdges, nHalfEdges, start, end;
- while (iCell--) {
- cell = cells[iCell];
- if (!cell || !cell.prepare()) continue;
- halfEdges = cell.edges;
- nHalfEdges = halfEdges.length;
- iHalfEdge = 0;
- while (iHalfEdge < nHalfEdges) {
- end = halfEdges[iHalfEdge].end(), x3 = end.x, y3 = end.y;
- start = halfEdges[++iHalfEdge % nHalfEdges].start(), x2 = start.x, y2 = start.y;
- if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) {
- halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? {
- x: x0,
- y: abs(x2 - x0) < ε ? y2 : y1
- } : abs(y3 - y1) < ε && x1 - x3 > ε ? {
- x: abs(y2 - y1) < ε ? x2 : x1,
- y: y1
- } : abs(x3 - x1) < ε && y3 - y0 > ε ? {
- x: x1,
- y: abs(x2 - x1) < ε ? y2 : y0
- } : abs(y3 - y0) < ε && x3 - x0 > ε ? {
- x: abs(y2 - y0) < ε ? x2 : x0,
- y: y0
- } : null), cell.site, null));
- ++nHalfEdges;
- }
- }
- }
- }
- function d3_geom_voronoiHalfEdgeOrder(a, b) {
- return b.angle - a.angle;
- }
- function d3_geom_voronoiCircle() {
- d3_geom_voronoiRedBlackNode(this);
- this.x = this.y = this.arc = this.site = this.cy = null;
- }
- function d3_geom_voronoiAttachCircle(arc) {
- var lArc = arc.P, rArc = arc.N;
- if (!lArc || !rArc) return;
- var lSite = lArc.site, cSite = arc.site, rSite = rArc.site;
- if (lSite === rSite) return;
- var bx = cSite.x, by = cSite.y, ax = lSite.x - bx, ay = lSite.y - by, cx = rSite.x - bx, cy = rSite.y - by;
- var d = 2 * (ax * cy - ay * cx);
- if (d >= -ε2) return;
- var ha = ax * ax + ay * ay, hc = cx * cx + cy * cy, x = (cy * ha - ay * hc) / d, y = (ax * hc - cx * ha) / d, cy = y + by;
- var circle = d3_geom_voronoiCirclePool.pop() || new d3_geom_voronoiCircle();
- circle.arc = arc;
- circle.site = cSite;
- circle.x = x + bx;
- circle.y = cy + Math.sqrt(x * x + y * y);
- circle.cy = cy;
- arc.circle = circle;
- var before = null, node = d3_geom_voronoiCircles._;
- while (node) {
- if (circle.y < node.y || circle.y === node.y && circle.x <= node.x) {
- if (node.L) node = node.L; else {
- before = node.P;
- break;
- }
- } else {
- if (node.R) node = node.R; else {
- before = node;
- break;
- }
- }
- }
- d3_geom_voronoiCircles.insert(before, circle);
- if (!before) d3_geom_voronoiFirstCircle = circle;
- }
- function d3_geom_voronoiDetachCircle(arc) {
- var circle = arc.circle;
- if (circle) {
- if (!circle.P) d3_geom_voronoiFirstCircle = circle.N;
- d3_geom_voronoiCircles.remove(circle);
- d3_geom_voronoiCirclePool.push(circle);
- d3_geom_voronoiRedBlackNode(circle);
- arc.circle = null;
- }
- }
- function d3_geom_voronoiClipEdges(extent) {
- var edges = d3_geom_voronoiEdges, clip = d3_geom_clipLine(extent[0][0], extent[0][1], extent[1][0], extent[1][1]), i = edges.length, e;
- while (i--) {
- e = edges[i];
- if (!d3_geom_voronoiConnectEdge(e, extent) || !clip(e) || abs(e.a.x - e.b.x) < ε && abs(e.a.y - e.b.y) < ε) {
- e.a = e.b = null;
- edges.splice(i, 1);
- }
- }
- }
- function d3_geom_voronoiConnectEdge(edge, extent) {
- var vb = edge.b;
- if (vb) return true;
- var va = edge.a, x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], lSite = edge.l, rSite = edge.r, lx = lSite.x, ly = lSite.y, rx = rSite.x, ry = rSite.y, fx = (lx + rx) / 2, fy = (ly + ry) / 2, fm, fb;
- if (ry === ly) {
- if (fx < x0 || fx >= x1) return;
- if (lx > rx) {
- if (!va) va = {
- x: fx,
- y: y0
- }; else if (va.y >= y1) return;
- vb = {
- x: fx,
- y: y1
- };
- } else {
- if (!va) va = {
- x: fx,
- y: y1
- }; else if (va.y < y0) return;
- vb = {
- x: fx,
- y: y0
- };
- }
- } else {
- fm = (lx - rx) / (ry - ly);
- fb = fy - fm * fx;
- if (fm < -1 || fm > 1) {
- if (lx > rx) {
- if (!va) va = {
- x: (y0 - fb) / fm,
- y: y0
- }; else if (va.y >= y1) return;
- vb = {
- x: (y1 - fb) / fm,
- y: y1
- };
- } else {
- if (!va) va = {
- x: (y1 - fb) / fm,
- y: y1
- }; else if (va.y < y0) return;
- vb = {
- x: (y0 - fb) / fm,
- y: y0
- };
- }
- } else {
- if (ly < ry) {
- if (!va) va = {
- x: x0,
- y: fm * x0 + fb
- }; else if (va.x >= x1) return;
- vb = {
- x: x1,
- y: fm * x1 + fb
- };
- } else {
- if (!va) va = {
- x: x1,
- y: fm * x1 + fb
- }; else if (va.x < x0) return;
- vb = {
- x: x0,
- y: fm * x0 + fb
- };
- }
- }
- }
- edge.a = va;
- edge.b = vb;
- return true;
- }
- function d3_geom_voronoiEdge(lSite, rSite) {
- this.l = lSite;
- this.r = rSite;
- this.a = this.b = null;
- }
- function d3_geom_voronoiCreateEdge(lSite, rSite, va, vb) {
- var edge = new d3_geom_voronoiEdge(lSite, rSite);
- d3_geom_voronoiEdges.push(edge);
- if (va) d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, va);
- if (vb) d3_geom_voronoiSetEdgeEnd(edge, rSite, lSite, vb);
- d3_geom_voronoiCells[lSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, lSite, rSite));
- d3_geom_voronoiCells[rSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, rSite, lSite));
- return edge;
- }
- function d3_geom_voronoiCreateBorderEdge(lSite, va, vb) {
- var edge = new d3_geom_voronoiEdge(lSite, null);
- edge.a = va;
- edge.b = vb;
- d3_geom_voronoiEdges.push(edge);
- return edge;
- }
- function d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, vertex) {
- if (!edge.a && !edge.b) {
- edge.a = vertex;
- edge.l = lSite;
- edge.r = rSite;
- } else if (edge.l === rSite) {
- edge.b = vertex;
- } else {
- edge.a = vertex;
- }
- }
- function d3_geom_voronoiHalfEdge(edge, lSite, rSite) {
- var va = edge.a, vb = edge.b;
- this.edge = edge;
- this.site = lSite;
- this.angle = rSite ? Math.atan2(rSite.y - lSite.y, rSite.x - lSite.x) : edge.l === lSite ? Math.atan2(vb.x - va.x, va.y - vb.y) : Math.atan2(va.x - vb.x, vb.y - va.y);
- }
- d3_geom_voronoiHalfEdge.prototype = {
- start: function() {
- return this.edge.l === this.site ? this.edge.a : this.edge.b;
- },
- end: function() {
- return this.edge.l === this.site ? this.edge.b : this.edge.a;
- }
- };
- function d3_geom_voronoiRedBlackTree() {
- this._ = null;
- }
- function d3_geom_voronoiRedBlackNode(node) {
- node.U = node.C = node.L = node.R = node.P = node.N = null;
- }
- d3_geom_voronoiRedBlackTree.prototype = {
- insert: function(after, node) {
- var parent, grandpa, uncle;
- if (after) {
- node.P = after;
- node.N = after.N;
- if (after.N) after.N.P = node;
- after.N = node;
- if (after.R) {
- after = after.R;
- while (after.L) after = after.L;
- after.L = node;
- } else {
- after.R = node;
- }
- parent = after;
- } else if (this._) {
- after = d3_geom_voronoiRedBlackFirst(this._);
- node.P = null;
- node.N = after;
- after.P = after.L = node;
- parent = after;
- } else {
- node.P = node.N = null;
- this._ = node;
- parent = null;
- }
- node.L = node.R = null;
- node.U = parent;
- node.C = true;
- after = node;
- while (parent && parent.C) {
- grandpa = parent.U;
- if (parent === grandpa.L) {
- uncle = grandpa.R;
- if (uncle && uncle.C) {
- parent.C = uncle.C = false;
- grandpa.C = true;
- after = grandpa;
- } else {
- if (after === parent.R) {
- d3_geom_voronoiRedBlackRotateLeft(this, parent);
- after = parent;
- parent = after.U;
- }
- parent.C = false;
- grandpa.C = true;
- d3_geom_voronoiRedBlackRotateRight(this, grandpa);
- }
- } else {
- uncle = grandpa.L;
- if (uncle && uncle.C) {
- parent.C = uncle.C = false;
- grandpa.C = true;
- after = grandpa;
- } else {
- if (after === parent.L) {
- d3_geom_voronoiRedBlackRotateRight(this, parent);
- after = parent;
- parent = after.U;
- }
- parent.C = false;
- grandpa.C = true;
- d3_geom_voronoiRedBlackRotateLeft(this, grandpa);
- }
- }
- parent = after.U;
- }
- this._.C = false;
- },
- remove: function(node) {
- if (node.N) node.N.P = node.P;
- if (node.P) node.P.N = node.N;
- node.N = node.P = null;
- var parent = node.U, sibling, left = node.L, right = node.R, next, red;
- if (!left) next = right; else if (!right) next = left; else next = d3_geom_voronoiRedBlackFirst(right);
- if (parent) {
- if (parent.L === node) parent.L = next; else parent.R = next;
- } else {
- this._ = next;
- }
- if (left && right) {
- red = next.C;
- next.C = node.C;
- next.L = left;
- left.U = next;
- if (next !== right) {
- parent = next.U;
- next.U = node.U;
- node = next.R;
- parent.L = node;
- next.R = right;
- right.U = next;
- } else {
- next.U = parent;
- parent = next;
- node = next.R;
- }
- } else {
- red = node.C;
- node = next;
- }
- if (node) node.U = parent;
- if (red) return;
- if (node && node.C) {
- node.C = false;
- return;
- }
- do {
- if (node === this._) break;
- if (node === parent.L) {
- sibling = parent.R;
- if (sibling.C) {
- sibling.C = false;
- parent.C = true;
- d3_geom_voronoiRedBlackRotateLeft(this, parent);
- sibling = parent.R;
- }
- if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) {
- if (!sibling.R || !sibling.R.C) {
- sibling.L.C = false;
- sibling.C = true;
- d3_geom_voronoiRedBlackRotateRight(this, sibling);
- sibling = parent.R;
- }
- sibling.C = parent.C;
- parent.C = sibling.R.C = false;
- d3_geom_voronoiRedBlackRotateLeft(this, parent);
- node = this._;
- break;
- }
- } else {
- sibling = parent.L;
- if (sibling.C) {
- sibling.C = false;
- parent.C = true;
- d3_geom_voronoiRedBlackRotateRight(this, parent);
- sibling = parent.L;
- }
- if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) {
- if (!sibling.L || !sibling.L.C) {
- sibling.R.C = false;
- sibling.C = true;
- d3_geom_voronoiRedBlackRotateLeft(this, sibling);
- sibling = parent.L;
- }
- sibling.C = parent.C;
- parent.C = sibling.L.C = false;
- d3_geom_voronoiRedBlackRotateRight(this, parent);
- node = this._;
- break;
- }
- }
- sibling.C = true;
- node = parent;
- parent = parent.U;
- } while (!node.C);
- if (node) node.C = false;
- }
- };
- function d3_geom_voronoiRedBlackRotateLeft(tree, node) {
- var p = node, q = node.R, parent = p.U;
- if (parent) {
- if (parent.L === p) parent.L = q; else parent.R = q;
- } else {
- tree._ = q;
- }
- q.U = parent;
- p.U = q;
- p.R = q.L;
- if (p.R) p.R.U = p;
- q.L = p;
- }
- function d3_geom_voronoiRedBlackRotateRight(tree, node) {
- var p = node, q = node.L, parent = p.U;
- if (parent) {
- if (parent.L === p) parent.L = q; else parent.R = q;
- } else {
- tree._ = q;
- }
- q.U = parent;
- p.U = q;
- p.L = q.R;
- if (p.L) p.L.U = p;
- q.R = p;
- }
- function d3_geom_voronoiRedBlackFirst(node) {
- while (node.L) node = node.L;
- return node;
- }
- function d3_geom_voronoi(sites, bbox) {
- var site = sites.sort(d3_geom_voronoiVertexOrder).pop(), x0, y0, circle;
- d3_geom_voronoiEdges = [];
- d3_geom_voronoiCells = new Array(sites.length);
- d3_geom_voronoiBeaches = new d3_geom_voronoiRedBlackTree();
- d3_geom_voronoiCircles = new d3_geom_voronoiRedBlackTree();
- while (true) {
- circle = d3_geom_voronoiFirstCircle;
- if (site && (!circle || site.y < circle.y || site.y === circle.y && site.x < circle.x)) {
- if (site.x !== x0 || site.y !== y0) {
- d3_geom_voronoiCells[site.i] = new d3_geom_voronoiCell(site);
- d3_geom_voronoiAddBeach(site);
- x0 = site.x, y0 = site.y;
- }
- site = sites.pop();
- } else if (circle) {
- d3_geom_voronoiRemoveBeach(circle.arc);
- } else {
- break;
- }
- }
- if (bbox) d3_geom_voronoiClipEdges(bbox), d3_geom_voronoiCloseCells(bbox);
- var diagram = {
- cells: d3_geom_voronoiCells,
- edges: d3_geom_voronoiEdges
- };
- d3_geom_voronoiBeaches = d3_geom_voronoiCircles = d3_geom_voronoiEdges = d3_geom_voronoiCells = null;
- return diagram;
- }
- function d3_geom_voronoiVertexOrder(a, b) {
- return b.y - a.y || b.x - a.x;
- }
- d3.geom.voronoi = function(points) {
- var x = d3_geom_pointX, y = d3_geom_pointY, fx = x, fy = y, clipExtent = d3_geom_voronoiClipExtent;
- if (points) return voronoi(points);
- function voronoi(data) {
- var polygons = new Array(data.length), x0 = clipExtent[0][0], y0 = clipExtent[0][1], x1 = clipExtent[1][0], y1 = clipExtent[1][1];
- d3_geom_voronoi(sites(data), clipExtent).cells.forEach(function(cell, i) {
- var edges = cell.edges, site = cell.site, polygon = polygons[i] = edges.length ? edges.map(function(e) {
- var s = e.start();
- return [ s.x, s.y ];
- }) : site.x >= x0 && site.x <= x1 && site.y >= y0 && site.y <= y1 ? [ [ x0, y1 ], [ x1, y1 ], [ x1, y0 ], [ x0, y0 ] ] : [];
- polygon.point = data[i];
- });
- return polygons;
- }
- function sites(data) {
- return data.map(function(d, i) {
- return {
- x: Math.round(fx(d, i) / ε) * ε,
- y: Math.round(fy(d, i) / ε) * ε,
- i: i
- };
- });
- }
- voronoi.links = function(data) {
- return d3_geom_voronoi(sites(data)).edges.filter(function(edge) {
- return edge.l && edge.r;
- }).map(function(edge) {
- return {
- source: data[edge.l.i],
- target: data[edge.r.i]
- };
- });
- };
- voronoi.triangles = function(data) {
- var triangles = [];
- d3_geom_voronoi(sites(data)).cells.forEach(function(cell, i) {
- var site = cell.site, edges = cell.edges.sort(d3_geom_voronoiHalfEdgeOrder), j = -1, m = edges.length, e0, s0, e1 = edges[m - 1].edge, s1 = e1.l === site ? e1.r : e1.l;
- while (++j < m) {
- e0 = e1;
- s0 = s1;
- e1 = edges[j].edge;
- s1 = e1.l === site ? e1.r : e1.l;
- if (i < s0.i && i < s1.i && d3_geom_voronoiTriangleArea(site, s0, s1) < 0) {
- triangles.push([ data[i], data[s0.i], data[s1.i] ]);
- }
- }
- });
- return triangles;
- };
- voronoi.x = function(_) {
- return arguments.length ? (fx = d3_functor(x = _), voronoi) : x;
- };
- voronoi.y = function(_) {
- return arguments.length ? (fy = d3_functor(y = _), voronoi) : y;
- };
- voronoi.clipExtent = function(_) {
- if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent;
- clipExtent = _ == null ? d3_geom_voronoiClipExtent : _;
- return voronoi;
- };
- voronoi.size = function(_) {
- if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent && clipExtent[1];
- return voronoi.clipExtent(_ && [ [ 0, 0 ], _ ]);
- };
- return voronoi;
- };
- var d3_geom_voronoiClipExtent = [ [ -1e6, -1e6 ], [ 1e6, 1e6 ] ];
- function d3_geom_voronoiTriangleArea(a, b, c) {
- return (a.x - c.x) * (b.y - a.y) - (a.x - b.x) * (c.y - a.y);
- }
- d3.geom.delaunay = function(vertices) {
- return d3.geom.voronoi().triangles(vertices);
- };
- d3.geom.quadtree = function(points, x1, y1, x2, y2) {
- var x = d3_geom_pointX, y = d3_geom_pointY, compat;
- if (compat = arguments.length) {
- x = d3_geom_quadtreeCompatX;
- y = d3_geom_quadtreeCompatY;
- if (compat === 3) {
- y2 = y1;
- x2 = x1;
- y1 = x1 = 0;
- }
- return quadtree(points);
- }
- function quadtree(data) {
- var d, fx = d3_functor(x), fy = d3_functor(y), xs, ys, i, n, x1_, y1_, x2_, y2_;
- if (x1 != null) {
- x1_ = x1, y1_ = y1, x2_ = x2, y2_ = y2;
- } else {
- x2_ = y2_ = -(x1_ = y1_ = Infinity);
- xs = [], ys = [];
- n = data.length;
- if (compat) for (i = 0; i < n; ++i) {
- d = data[i];
- if (d.x < x1_) x1_ = d.x;
- if (d.y < y1_) y1_ = d.y;
- if (d.x > x2_) x2_ = d.x;
- if (d.y > y2_) y2_ = d.y;
- xs.push(d.x);
- ys.push(d.y);
- } else for (i = 0; i < n; ++i) {
- var x_ = +fx(d = data[i], i), y_ = +fy(d, i);
- if (x_ < x1_) x1_ = x_;
- if (y_ < y1_) y1_ = y_;
- if (x_ > x2_) x2_ = x_;
- if (y_ > y2_) y2_ = y_;
- xs.push(x_);
- ys.push(y_);
- }
- }
- var dx = x2_ - x1_, dy = y2_ - y1_;
- if (dx > dy) y2_ = y1_ + dx; else x2_ = x1_ + dy;
- function insert(n, d, x, y, x1, y1, x2, y2) {
- if (isNaN(x) || isNaN(y)) return;
- if (n.leaf) {
- var nx = n.x, ny = n.y;
- if (nx != null) {
- if (abs(nx - x) + abs(ny - y) < .01) {
- insertChild(n, d, x, y, x1, y1, x2, y2);
- } else {
- var nPoint = n.point;
- n.x = n.y = n.point = null;
- insertChild(n, nPoint, nx, ny, x1, y1, x2, y2);
- insertChild(n, d, x, y, x1, y1, x2, y2);
- }
- } else {
- n.x = x, n.y = y, n.point = d;
- }
- } else {
- insertChild(n, d, x, y, x1, y1, x2, y2);
- }
- }
- function insertChild(n, d, x, y, x1, y1, x2, y2) {
- var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, right = x >= sx, bottom = y >= sy, i = (bottom << 1) + right;
- n.leaf = false;
- n = n.nodes[i] || (n.nodes[i] = d3_geom_quadtreeNode());
- if (right) x1 = sx; else x2 = sx;
- if (bottom) y1 = sy; else y2 = sy;
- insert(n, d, x, y, x1, y1, x2, y2);
- }
- var root = d3_geom_quadtreeNode();
- root.add = function(d) {
- insert(root, d, +fx(d, ++i), +fy(d, i), x1_, y1_, x2_, y2_);
- };
- root.visit = function(f) {
- d3_geom_quadtreeVisit(f, root, x1_, y1_, x2_, y2_);
- };
- i = -1;
- if (x1 == null) {
- while (++i < n) {
- insert(root, data[i], xs[i], ys[i], x1_, y1_, x2_, y2_);
- }
- --i;
- } else data.forEach(root.add);
- xs = ys = data = d = null;
- return root;
- }
- quadtree.x = function(_) {
- return arguments.length ? (x = _, quadtree) : x;
- };
- quadtree.y = function(_) {
- return arguments.length ? (y = _, quadtree) : y;
- };
- quadtree.extent = function(_) {
- if (!arguments.length) return x1 == null ? null : [ [ x1, y1 ], [ x2, y2 ] ];
- if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0],
- y2 = +_[1][1];
- return quadtree;
- };
- quadtree.size = function(_) {
- if (!arguments.length) return x1 == null ? null : [ x2 - x1, y2 - y1 ];
- if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = y1 = 0, x2 = +_[0], y2 = +_[1];
- return quadtree;
- };
- return quadtree;
- };
- function d3_geom_quadtreeCompatX(d) {
- return d.x;
- }
- function d3_geom_quadtreeCompatY(d) {
- return d.y;
- }
- function d3_geom_quadtreeNode() {
- return {
- leaf: true,
- nodes: [],
- point: null,
- x: null,
- y: null
- };
- }
- function d3_geom_quadtreeVisit(f, node, x1, y1, x2, y2) {
- if (!f(node, x1, y1, x2, y2)) {
- var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, children = node.nodes;
- if (children[0]) d3_geom_quadtreeVisit(f, children[0], x1, y1, sx, sy);
- if (children[1]) d3_geom_quadtreeVisit(f, children[1], sx, y1, x2, sy);
- if (children[2]) d3_geom_quadtreeVisit(f, children[2], x1, sy, sx, y2);
- if (children[3]) d3_geom_quadtreeVisit(f, children[3], sx, sy, x2, y2);
- }
- }
- d3.interpolateRgb = d3_interpolateRgb;
- function d3_interpolateRgb(a, b) {
- a = d3.rgb(a);
- b = d3.rgb(b);
- var ar = a.r, ag = a.g, ab = a.b, br = b.r - ar, bg = b.g - ag, bb = b.b - ab;
- return function(t) {
- return "#" + d3_rgb_hex(Math.round(ar + br * t)) + d3_rgb_hex(Math.round(ag + bg * t)) + d3_rgb_hex(Math.round(ab + bb * t));
- };
- }
- d3.interpolateObject = d3_interpolateObject;
- function d3_interpolateObject(a, b) {
- var i = {}, c = {}, k;
- for (k in a) {
- if (k in b) {
- i[k] = d3_interpolate(a[k], b[k]);
- } else {
- c[k] = a[k];
- }
- }
- for (k in b) {
- if (!(k in a)) {
- c[k] = b[k];
- }
- }
- return function(t) {
- for (k in i) c[k] = i[k](t);
- return c;
- };
- }
- d3.interpolateNumber = d3_interpolateNumber;
- function d3_interpolateNumber(a, b) {
- b -= a = +a;
- return function(t) {
- return a + b * t;
- };
- }
- d3.interpolateString = d3_interpolateString;
- function d3_interpolateString(a, b) {
- var bi = d3_interpolate_numberA.lastIndex = d3_interpolate_numberB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = [];
- a = a + "", b = b + "";
- while ((am = d3_interpolate_numberA.exec(a)) && (bm = d3_interpolate_numberB.exec(b))) {
- if ((bs = bm.index) > bi) {
- bs = b.slice(bi, bs);
- if (s[i]) s[i] += bs; else s[++i] = bs;
- }
- if ((am = am[0]) === (bm = bm[0])) {
- if (s[i]) s[i] += bm; else s[++i] = bm;
- } else {
- s[++i] = null;
- q.push({
- i: i,
- x: d3_interpolateNumber(am, bm)
- });
- }
- bi = d3_interpolate_numberB.lastIndex;
- }
- if (bi < b.length) {
- bs = b.slice(bi);
- if (s[i]) s[i] += bs; else s[++i] = bs;
- }
- return s.length < 2 ? q[0] ? (b = q[0].x, function(t) {
- return b(t) + "";
- }) : function() {
- return b;
- } : (b = q.length, function(t) {
- for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
- return s.join("");
- });
- }
- var d3_interpolate_numberA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, d3_interpolate_numberB = new RegExp(d3_interpolate_numberA.source, "g");
- d3.interpolate = d3_interpolate;
- function d3_interpolate(a, b) {
- var i = d3.interpolators.length, f;
- while (--i >= 0 && !(f = d3.interpolators[i](a, b))) ;
- return f;
- }
- d3.interpolators = [ function(a, b) {
- var t = typeof b;
- return (t === "string" ? d3_rgb_names.has(b) || /^(#|rgb\(|hsl\()/.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_color ? d3_interpolateRgb : Array.isArray(b) ? d3_interpolateArray : t === "object" && isNaN(b) ? d3_interpolateObject : d3_interpolateNumber)(a, b);
- } ];
- d3.interpolateArray = d3_interpolateArray;
- function d3_interpolateArray(a, b) {
- var x = [], c = [], na = a.length, nb = b.length, n0 = Math.min(a.length, b.length), i;
- for (i = 0; i < n0; ++i) x.push(d3_interpolate(a[i], b[i]));
- for (;i < na; ++i) c[i] = a[i];
- for (;i < nb; ++i) c[i] = b[i];
- return function(t) {
- for (i = 0; i < n0; ++i) c[i] = x[i](t);
- return c;
- };
- }
- var d3_ease_default = function() {
- return d3_identity;
- };
- var d3_ease = d3.map({
- linear: d3_ease_default,
- poly: d3_ease_poly,
- quad: function() {
- return d3_ease_quad;
- },
- cubic: function() {
- return d3_ease_cubic;
- },
- sin: function() {
- return d3_ease_sin;
- },
- exp: function() {
- return d3_ease_exp;
- },
- circle: function() {
- return d3_ease_circle;
- },
- elastic: d3_ease_elastic,
- back: d3_ease_back,
- bounce: function() {
- return d3_ease_bounce;
- }
- });
- var d3_ease_mode = d3.map({
- "in": d3_identity,
- out: d3_ease_reverse,
- "in-out": d3_ease_reflect,
- "out-in": function(f) {
- return d3_ease_reflect(d3_ease_reverse(f));
- }
- });
- d3.ease = function(name) {
- var i = name.indexOf("-"), t = i >= 0 ? name.slice(0, i) : name, m = i >= 0 ? name.slice(i + 1) : "in";
- t = d3_ease.get(t) || d3_ease_default;
- m = d3_ease_mode.get(m) || d3_identity;
- return d3_ease_clamp(m(t.apply(null, d3_arraySlice.call(arguments, 1))));
- };
- function d3_ease_clamp(f) {
- return function(t) {
- return t <= 0 ? 0 : t >= 1 ? 1 : f(t);
- };
- }
- function d3_ease_reverse(f) {
- return function(t) {
- return 1 - f(1 - t);
- };
- }
- function d3_ease_reflect(f) {
- return function(t) {
- return .5 * (t < .5 ? f(2 * t) : 2 - f(2 - 2 * t));
- };
- }
- function d3_ease_quad(t) {
- return t * t;
- }
- function d3_ease_cubic(t) {
- return t * t * t;
- }
- function d3_ease_cubicInOut(t) {
- if (t <= 0) return 0;
- if (t >= 1) return 1;
- var t2 = t * t, t3 = t2 * t;
- return 4 * (t < .5 ? t3 : 3 * (t - t2) + t3 - .75);
- }
- function d3_ease_poly(e) {
- return function(t) {
- return Math.pow(t, e);
- };
- }
- function d3_ease_sin(t) {
- return 1 - Math.cos(t * halfπ);
- }
- function d3_ease_exp(t) {
- return Math.pow(2, 10 * (t - 1));
- }
- function d3_ease_circle(t) {
- return 1 - Math.sqrt(1 - t * t);
- }
- function d3_ease_elastic(a, p) {
- var s;
- if (arguments.length < 2) p = .45;
- if (arguments.length) s = p / τ * Math.asin(1 / a); else a = 1, s = p / 4;
- return function(t) {
- return 1 + a * Math.pow(2, -10 * t) * Math.sin((t - s) * τ / p);
- };
- }
- function d3_ease_back(s) {
- if (!s) s = 1.70158;
- return function(t) {
- return t * t * ((s + 1) * t - s);
- };
- }
- function d3_ease_bounce(t) {
- return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375;
- }
- d3.interpolateHcl = d3_interpolateHcl;
- function d3_interpolateHcl(a, b) {
- a = d3.hcl(a);
- b = d3.hcl(b);
- var ah = a.h, ac = a.c, al = a.l, bh = b.h - ah, bc = b.c - ac, bl = b.l - al;
- if (isNaN(bc)) bc = 0, ac = isNaN(ac) ? b.c : ac;
- if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360;
- return function(t) {
- return d3_hcl_lab(ah + bh * t, ac + bc * t, al + bl * t) + "";
- };
- }
- d3.interpolateHsl = d3_interpolateHsl;
- function d3_interpolateHsl(a, b) {
- a = d3.hsl(a);
- b = d3.hsl(b);
- var ah = a.h, as = a.s, al = a.l, bh = b.h - ah, bs = b.s - as, bl = b.l - al;
- if (isNaN(bs)) bs = 0, as = isNaN(as) ? b.s : as;
- if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360;
- return function(t) {
- return d3_hsl_rgb(ah + bh * t, as + bs * t, al + bl * t) + "";
- };
- }
- d3.interpolateLab = d3_interpolateLab;
- function d3_interpolateLab(a, b) {
- a = d3.lab(a);
- b = d3.lab(b);
- var al = a.l, aa = a.a, ab = a.b, bl = b.l - al, ba = b.a - aa, bb = b.b - ab;
- return function(t) {
- return d3_lab_rgb(al + bl * t, aa + ba * t, ab + bb * t) + "";
- };
- }
- d3.interpolateRound = d3_interpolateRound;
- function d3_interpolateRound(a, b) {
- b -= a;
- return function(t) {
- return Math.round(a + b * t);
- };
- }
- d3.transform = function(string) {
- var g = d3_document.createElementNS(d3.ns.prefix.svg, "g");
- return (d3.transform = function(string) {
- if (string != null) {
- g.setAttribute("transform", string);
- var t = g.transform.baseVal.consolidate();
- }
- return new d3_transform(t ? t.matrix : d3_transformIdentity);
- })(string);
- };
- function d3_transform(m) {
- var r0 = [ m.a, m.b ], r1 = [ m.c, m.d ], kx = d3_transformNormalize(r0), kz = d3_transformDot(r0, r1), ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0;
- if (r0[0] * r1[1] < r1[0] * r0[1]) {
- r0[0] *= -1;
- r0[1] *= -1;
- kx *= -1;
- kz *= -1;
- }
- this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_degrees;
- this.translate = [ m.e, m.f ];
- this.scale = [ kx, ky ];
- this.skew = ky ? Math.atan2(kz, ky) * d3_degrees : 0;
- }
- d3_transform.prototype.toString = function() {
- return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")";
- };
- function d3_transformDot(a, b) {
- return a[0] * b[0] + a[1] * b[1];
- }
- function d3_transformNormalize(a) {
- var k = Math.sqrt(d3_transformDot(a, a));
- if (k) {
- a[0] /= k;
- a[1] /= k;
- }
- return k;
- }
- function d3_transformCombine(a, b, k) {
- a[0] += k * b[0];
- a[1] += k * b[1];
- return a;
- }
- var d3_transformIdentity = {
- a: 1,
- b: 0,
- c: 0,
- d: 1,
- e: 0,
- f: 0
- };
- d3.interpolateTransform = d3_interpolateTransform;
- function d3_interpolateTransform(a, b) {
- var s = [], q = [], n, A = d3.transform(a), B = d3.transform(b), ta = A.translate, tb = B.translate, ra = A.rotate, rb = B.rotate, wa = A.skew, wb = B.skew, ka = A.scale, kb = B.scale;
- if (ta[0] != tb[0] || ta[1] != tb[1]) {
- s.push("translate(", null, ",", null, ")");
- q.push({
- i: 1,
- x: d3_interpolateNumber(ta[0], tb[0])
- }, {
- i: 3,
- x: d3_interpolateNumber(ta[1], tb[1])
- });
- } else if (tb[0] || tb[1]) {
- s.push("translate(" + tb + ")");
- } else {
- s.push("");
- }
- if (ra != rb) {
- if (ra - rb > 180) rb += 360; else if (rb - ra > 180) ra += 360;
- q.push({
- i: s.push(s.pop() + "rotate(", null, ")") - 2,
- x: d3_interpolateNumber(ra, rb)
- });
- } else if (rb) {
- s.push(s.pop() + "rotate(" + rb + ")");
- }
- if (wa != wb) {
- q.push({
- i: s.push(s.pop() + "skewX(", null, ")") - 2,
- x: d3_interpolateNumber(wa, wb)
- });
- } else if (wb) {
- s.push(s.pop() + "skewX(" + wb + ")");
- }
- if (ka[0] != kb[0] || ka[1] != kb[1]) {
- n = s.push(s.pop() + "scale(", null, ",", null, ")");
- q.push({
- i: n - 4,
- x: d3_interpolateNumber(ka[0], kb[0])
- }, {
- i: n - 2,
- x: d3_interpolateNumber(ka[1], kb[1])
- });
- } else if (kb[0] != 1 || kb[1] != 1) {
- s.push(s.pop() + "scale(" + kb + ")");
- }
- n = q.length;
- return function(t) {
- var i = -1, o;
- while (++i < n) s[(o = q[i]).i] = o.x(t);
- return s.join("");
- };
- }
- function d3_uninterpolateNumber(a, b) {
- b = b - (a = +a) ? 1 / (b - a) : 0;
- return function(x) {
- return (x - a) * b;
- };
- }
- function d3_uninterpolateClamp(a, b) {
- b = b - (a = +a) ? 1 / (b - a) : 0;
- return function(x) {
- return Math.max(0, Math.min(1, (x - a) * b));
- };
- }
- d3.layout = {};
- d3.layout.bundle = function() {
- return function(links) {
- var paths = [], i = -1, n = links.length;
- while (++i < n) paths.push(d3_layout_bundlePath(links[i]));
- return paths;
- };
- };
- function d3_layout_bundlePath(link) {
- var start = link.source, end = link.target, lca = d3_layout_bundleLeastCommonAncestor(start, end), points = [ start ];
- while (start !== lca) {
- start = start.parent;
- points.push(start);
- }
- var k = points.length;
- while (end !== lca) {
- points.splice(k, 0, end);
- end = end.parent;
- }
- return points;
- }
- function d3_layout_bundleAncestors(node) {
- var ancestors = [], parent = node.parent;
- while (parent != null) {
- ancestors.push(node);
- node = parent;
- parent = parent.parent;
- }
- ancestors.push(node);
- return ancestors;
- }
- function d3_layout_bundleLeastCommonAncestor(a, b) {
- if (a === b) return a;
- var aNodes = d3_layout_bundleAncestors(a), bNodes = d3_layout_bundleAncestors(b), aNode = aNodes.pop(), bNode = bNodes.pop(), sharedNode = null;
- while (aNode === bNode) {
- sharedNode = aNode;
- aNode = aNodes.pop();
- bNode = bNodes.pop();
- }
- return sharedNode;
- }
- d3.layout.chord = function() {
- var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords;
- function relayout() {
- var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j;
- chords = [];
- groups = [];
- k = 0, i = -1;
- while (++i < n) {
- x = 0, j = -1;
- while (++j < n) {
- x += matrix[i][j];
- }
- groupSums.push(x);
- subgroupIndex.push(d3.range(n));
- k += x;
- }
- if (sortGroups) {
- groupIndex.sort(function(a, b) {
- return sortGroups(groupSums[a], groupSums[b]);
- });
- }
- if (sortSubgroups) {
- subgroupIndex.forEach(function(d, i) {
- d.sort(function(a, b) {
- return sortSubgroups(matrix[i][a], matrix[i][b]);
- });
- });
- }
- k = (τ - padding * n) / k;
- x = 0, i = -1;
- while (++i < n) {
- x0 = x, j = -1;
- while (++j < n) {
- var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k;
- subgroups[di + "-" + dj] = {
- index: di,
- subindex: dj,
- startAngle: a0,
- endAngle: a1,
- value: v
- };
- }
- groups[di] = {
- index: di,
- startAngle: x0,
- endAngle: x,
- value: (x - x0) / k
- };
- x += padding;
- }
- i = -1;
- while (++i < n) {
- j = i - 1;
- while (++j < n) {
- var source = subgroups[i + "-" + j], target = subgroups[j + "-" + i];
- if (source.value || target.value) {
- chords.push(source.value < target.value ? {
- source: target,
- target: source
- } : {
- source: source,
- target: target
- });
- }
- }
- }
- if (sortChords) resort();
- }
- function resort() {
- chords.sort(function(a, b) {
- return sortChords((a.source.value + a.target.value) / 2, (b.source.value + b.target.value) / 2);
- });
- }
- chord.matrix = function(x) {
- if (!arguments.length) return matrix;
- n = (matrix = x) && matrix.length;
- chords = groups = null;
- return chord;
- };
- chord.padding = function(x) {
- if (!arguments.length) return padding;
- padding = x;
- chords = groups = null;
- return chord;
- };
- chord.sortGroups = function(x) {
- if (!arguments.length) return sortGroups;
- sortGroups = x;
- chords = groups = null;
- return chord;
- };
- chord.sortSubgroups = function(x) {
- if (!arguments.length) return sortSubgroups;
- sortSubgroups = x;
- chords = null;
- return chord;
- };
- chord.sortChords = function(x) {
- if (!arguments.length) return sortChords;
- sortChords = x;
- if (chords) resort();
- return chord;
- };
- chord.chords = function() {
- if (!chords) relayout();
- return chords;
- };
- chord.groups = function() {
- if (!groups) relayout();
- return groups;
- };
- return chord;
- };
- d3.layout.force = function() {
- var force = {}, event = d3.dispatch("start", "tick", "end"), size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, chargeDistance2 = d3_layout_forceChargeDistance2, gravity = .1, theta2 = .64, nodes = [], links = [], distances, strengths, charges;
- function repulse(node) {
- return function(quad, x1, _, x2) {
- if (quad.point !== node) {
- var dx = quad.cx - node.x, dy = quad.cy - node.y, dw = x2 - x1, dn = dx * dx + dy * dy;
- if (dw * dw / theta2 < dn) {
- if (dn < chargeDistance2) {
- var k = quad.charge / dn;
- node.px -= dx * k;
- node.py -= dy * k;
- }
- return true;
- }
- if (quad.point && dn && dn < chargeDistance2) {
- var k = quad.pointCharge / dn;
- node.px -= dx * k;
- node.py -= dy * k;
- }
- }
- return !quad.charge;
- };
- }
- force.tick = function() {
- if ((alpha *= .99) < .005) {
- event.end({
- type: "end",
- alpha: alpha = 0
- });
- return true;
- }
- var n = nodes.length, m = links.length, q, i, o, s, t, l, k, x, y;
- for (i = 0; i < m; ++i) {
- o = links[i];
- s = o.source;
- t = o.target;
- x = t.x - s.x;
- y = t.y - s.y;
- if (l = x * x + y * y) {
- l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l;
- x *= l;
- y *= l;
- t.x -= x * (k = s.weight / (t.weight + s.weight));
- t.y -= y * k;
- s.x += x * (k = 1 - k);
- s.y += y * k;
- }
- }
- if (k = alpha * gravity) {
- x = size[0] / 2;
- y = size[1] / 2;
- i = -1;
- if (k) while (++i < n) {
- o = nodes[i];
- o.x += (x - o.x) * k;
- o.y += (y - o.y) * k;
- }
- }
- if (charge) {
- d3_layout_forceAccumulate(q = d3.geom.quadtree(nodes), alpha, charges);
- i = -1;
- while (++i < n) {
- if (!(o = nodes[i]).fixed) {
- q.visit(repulse(o));
- }
- }
- }
- i = -1;
- while (++i < n) {
- o = nodes[i];
- if (o.fixed) {
- o.x = o.px;
- o.y = o.py;
- } else {
- o.x -= (o.px - (o.px = o.x)) * friction;
- o.y -= (o.py - (o.py = o.y)) * friction;
- }
- }
- event.tick({
- type: "tick",
- alpha: alpha
- });
- };
- force.nodes = function(x) {
- if (!arguments.length) return nodes;
- nodes = x;
- return force;
- };
- force.links = function(x) {
- if (!arguments.length) return links;
- links = x;
- return force;
- };
- force.size = function(x) {
- if (!arguments.length) return size;
- size = x;
- return force;
- };
- force.linkDistance = function(x) {
- if (!arguments.length) return linkDistance;
- linkDistance = typeof x === "function" ? x : +x;
- return force;
- };
- force.distance = force.linkDistance;
- force.linkStrength = function(x) {
- if (!arguments.length) return linkStrength;
- linkStrength = typeof x === "function" ? x : +x;
- return force;
- };
- force.friction = function(x) {
- if (!arguments.length) return friction;
- friction = +x;
- return force;
- };
- force.charge = function(x) {
- if (!arguments.length) return charge;
- charge = typeof x === "function" ? x : +x;
- return force;
- };
- force.chargeDistance = function(x) {
- if (!arguments.length) return Math.sqrt(chargeDistance2);
- chargeDistance2 = x * x;
- return force;
- };
- force.gravity = function(x) {
- if (!arguments.length) return gravity;
- gravity = +x;
- return force;
- };
- force.theta = function(x) {
- if (!arguments.length) return Math.sqrt(theta2);
- theta2 = x * x;
- return force;
- };
- force.alpha = function(x) {
- if (!arguments.length) return alpha;
- x = +x;
- if (alpha) {
- if (x > 0) alpha = x; else alpha = 0;
- } else if (x > 0) {
- event.start({
- type: "start",
- alpha: alpha = x
- });
- d3.timer(force.tick);
- }
- return force;
- };
- force.start = function() {
- var i, n = nodes.length, m = links.length, w = size[0], h = size[1], neighbors, o;
- for (i = 0; i < n; ++i) {
- (o = nodes[i]).index = i;
- o.weight = 0;
- }
- for (i = 0; i < m; ++i) {
- o = links[i];
- if (typeof o.source == "number") o.source = nodes[o.source];
- if (typeof o.target == "number") o.target = nodes[o.target];
- ++o.source.weight;
- ++o.target.weight;
- }
- for (i = 0; i < n; ++i) {
- o = nodes[i];
- if (isNaN(o.x)) o.x = position("x", w);
- if (isNaN(o.y)) o.y = position("y", h);
- if (isNaN(o.px)) o.px = o.x;
- if (isNaN(o.py)) o.py = o.y;
- }
- distances = [];
- if (typeof linkDistance === "function") for (i = 0; i < m; ++i) distances[i] = +linkDistance.call(this, links[i], i); else for (i = 0; i < m; ++i) distances[i] = linkDistance;
- strengths = [];
- if (typeof linkStrength === "function") for (i = 0; i < m; ++i) strengths[i] = +linkStrength.call(this, links[i], i); else for (i = 0; i < m; ++i) strengths[i] = linkStrength;
- charges = [];
- if (typeof charge === "function") for (i = 0; i < n; ++i) charges[i] = +charge.call(this, nodes[i], i); else for (i = 0; i < n; ++i) charges[i] = charge;
- function position(dimension, size) {
- if (!neighbors) {
- neighbors = new Array(n);
- for (j = 0; j < n; ++j) {
- neighbors[j] = [];
- }
- for (j = 0; j < m; ++j) {
- var o = links[j];
- neighbors[o.source.index].push(o.target);
- neighbors[o.target.index].push(o.source);
- }
- }
- var candidates = neighbors[i], j = -1, m = candidates.length, x;
- while (++j < m) if (!isNaN(x = candidates[j][dimension])) return x;
- return Math.random() * size;
- }
- return force.resume();
- };
- force.resume = function() {
- return force.alpha(.1);
- };
- force.stop = function() {
- return force.alpha(0);
- };
- force.drag = function() {
- if (!drag) drag = d3.behavior.drag().origin(d3_identity).on("dragstart.force", d3_layout_forceDragstart).on("drag.force", dragmove).on("dragend.force", d3_layout_forceDragend);
- if (!arguments.length) return drag;
- this.on("mouseover.force", d3_layout_forceMouseover).on("mouseout.force", d3_layout_forceMouseout).call(drag);
- };
- function dragmove(d) {
- d.px = d3.event.x, d.py = d3.event.y;
- force.resume();
- }
- return d3.rebind(force, event, "on");
- };
- function d3_layout_forceDragstart(d) {
- d.fixed |= 2;
- }
- function d3_layout_forceDragend(d) {
- d.fixed &= ~6;
- }
- function d3_layout_forceMouseover(d) {
- d.fixed |= 4;
- d.px = d.x, d.py = d.y;
- }
- function d3_layout_forceMouseout(d) {
- d.fixed &= ~4;
- }
- function d3_layout_forceAccumulate(quad, alpha, charges) {
- var cx = 0, cy = 0;
- quad.charge = 0;
- if (!quad.leaf) {
- var nodes = quad.nodes, n = nodes.length, i = -1, c;
- while (++i < n) {
- c = nodes[i];
- if (c == null) continue;
- d3_layout_forceAccumulate(c, alpha, charges);
- quad.charge += c.charge;
- cx += c.charge * c.cx;
- cy += c.charge * c.cy;
- }
- }
- if (quad.point) {
- if (!quad.leaf) {
- quad.point.x += Math.random() - .5;
- quad.point.y += Math.random() - .5;
- }
- var k = alpha * charges[quad.point.index];
- quad.charge += quad.pointCharge = k;
- cx += k * quad.point.x;
- cy += k * quad.point.y;
- }
- quad.cx = cx / quad.charge;
- quad.cy = cy / quad.charge;
- }
- var d3_layout_forceLinkDistance = 20, d3_layout_forceLinkStrength = 1, d3_layout_forceChargeDistance2 = Infinity;
- d3.layout.hierarchy = function() {
- var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue;
- function hierarchy(root) {
- var stack = [ root ], nodes = [], node;
- root.depth = 0;
- while ((node = stack.pop()) != null) {
- nodes.push(node);
- if ((childs = children.call(hierarchy, node, node.depth)) && (n = childs.length)) {
- var n, childs, child;
- while (--n >= 0) {
- stack.push(child = childs[n]);
- child.parent = node;
- child.depth = node.depth + 1;
- }
- if (value) node.value = 0;
- node.children = childs;
- } else {
- if (value) node.value = +value.call(hierarchy, node, node.depth) || 0;
- delete node.children;
- }
- }
- d3_layout_hierarchyVisitAfter(root, function(node) {
- var childs, parent;
- if (sort && (childs = node.children)) childs.sort(sort);
- if (value && (parent = node.parent)) parent.value += node.value;
- });
- return nodes;
- }
- hierarchy.sort = function(x) {
- if (!arguments.length) return sort;
- sort = x;
- return hierarchy;
- };
- hierarchy.children = function(x) {
- if (!arguments.length) return children;
- children = x;
- return hierarchy;
- };
- hierarchy.value = function(x) {
- if (!arguments.length) return value;
- value = x;
- return hierarchy;
- };
- hierarchy.revalue = function(root) {
- if (value) {
- d3_layout_hierarchyVisitBefore(root, function(node) {
- if (node.children) node.value = 0;
- });
- d3_layout_hierarchyVisitAfter(root, function(node) {
- var parent;
- if (!node.children) node.value = +value.call(hierarchy, node, node.depth) || 0;
- if (parent = node.parent) parent.value += node.value;
- });
- }
- return root;
- };
- return hierarchy;
- };
- function d3_layout_hierarchyRebind(object, hierarchy) {
- d3.rebind(object, hierarchy, "sort", "children", "value");
- object.nodes = object;
- object.links = d3_layout_hierarchyLinks;
- return object;
- }
- function d3_layout_hierarchyVisitBefore(node, callback) {
- var nodes = [ node ];
- while ((node = nodes.pop()) != null) {
- callback(node);
- if ((children = node.children) && (n = children.length)) {
- var n, children;
- while (--n >= 0) nodes.push(children[n]);
- }
- }
- }
- function d3_layout_hierarchyVisitAfter(node, callback) {
- var nodes = [ node ], nodes2 = [];
- while ((node = nodes.pop()) != null) {
- nodes2.push(node);
- if ((children = node.children) && (n = children.length)) {
- var i = -1, n, children;
- while (++i < n) nodes.push(children[i]);
- }
- }
- while ((node = nodes2.pop()) != null) {
- callback(node);
- }
- }
- function d3_layout_hierarchyChildren(d) {
- return d.children;
- }
- function d3_layout_hierarchyValue(d) {
- return d.value;
- }
- function d3_layout_hierarchySort(a, b) {
- return b.value - a.value;
- }
- function d3_layout_hierarchyLinks(nodes) {
- return d3.merge(nodes.map(function(parent) {
- return (parent.children || []).map(function(child) {
- return {
- source: parent,
- target: child
- };
- });
- }));
- }
- d3.layout.partition = function() {
- var hierarchy = d3.layout.hierarchy(), size = [ 1, 1 ];
- function position(node, x, dx, dy) {
- var children = node.children;
- node.x = x;
- node.y = node.depth * dy;
- node.dx = dx;
- node.dy = dy;
- if (children && (n = children.length)) {
- var i = -1, n, c, d;
- dx = node.value ? dx / node.value : 0;
- while (++i < n) {
- position(c = children[i], x, d = c.value * dx, dy);
- x += d;
- }
- }
- }
- function depth(node) {
- var children = node.children, d = 0;
- if (children && (n = children.length)) {
- var i = -1, n;
- while (++i < n) d = Math.max(d, depth(children[i]));
- }
- return 1 + d;
- }
- function partition(d, i) {
- var nodes = hierarchy.call(this, d, i);
- position(nodes[0], 0, size[0], size[1] / depth(nodes[0]));
- return nodes;
- }
- partition.size = function(x) {
- if (!arguments.length) return size;
- size = x;
- return partition;
- };
- return d3_layout_hierarchyRebind(partition, hierarchy);
- };
- d3.layout.pie = function() {
- var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = τ;
- function pie(data) {
- var values = data.map(function(d, i) {
- return +value.call(pie, d, i);
- });
- var a = +(typeof startAngle === "function" ? startAngle.apply(this, arguments) : startAngle);
- var k = ((typeof endAngle === "function" ? endAngle.apply(this, arguments) : endAngle) - a) / d3.sum(values);
- var index = d3.range(data.length);
- if (sort != null) index.sort(sort === d3_layout_pieSortByValue ? function(i, j) {
- return values[j] - values[i];
- } : function(i, j) {
- return sort(data[i], data[j]);
- });
- var arcs = [];
- index.forEach(function(i) {
- var d;
- arcs[i] = {
- data: data[i],
- value: d = values[i],
- startAngle: a,
- endAngle: a += d * k
- };
- });
- return arcs;
- }
- pie.value = function(x) {
- if (!arguments.length) return value;
- value = x;
- return pie;
- };
- pie.sort = function(x) {
- if (!arguments.length) return sort;
- sort = x;
- return pie;
- };
- pie.startAngle = function(x) {
- if (!arguments.length) return startAngle;
- startAngle = x;
- return pie;
- };
- pie.endAngle = function(x) {
- if (!arguments.length) return endAngle;
- endAngle = x;
- return pie;
- };
- return pie;
- };
- var d3_layout_pieSortByValue = {};
- d3.layout.stack = function() {
- var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZero, out = d3_layout_stackOut, x = d3_layout_stackX, y = d3_layout_stackY;
- function stack(data, index) {
- var series = data.map(function(d, i) {
- return values.call(stack, d, i);
- });
- var points = series.map(function(d) {
- return d.map(function(v, i) {
- return [ x.call(stack, v, i), y.call(stack, v, i) ];
- });
- });
- var orders = order.call(stack, points, index);
- series = d3.permute(series, orders);
- points = d3.permute(points, orders);
- var offsets = offset.call(stack, points, index);
- var n = series.length, m = series[0].length, i, j, o;
- for (j = 0; j < m; ++j) {
- out.call(stack, series[0][j], o = offsets[j], points[0][j][1]);
- for (i = 1; i < n; ++i) {
- out.call(stack, series[i][j], o += points[i - 1][j][1], points[i][j][1]);
- }
- }
- return data;
- }
- stack.values = function(x) {
- if (!arguments.length) return values;
- values = x;
- return stack;
- };
- stack.order = function(x) {
- if (!arguments.length) return order;
- order = typeof x === "function" ? x : d3_layout_stackOrders.get(x) || d3_layout_stackOrderDefault;
- return stack;
- };
- stack.offset = function(x) {
- if (!arguments.length) return offset;
- offset = typeof x === "function" ? x : d3_layout_stackOffsets.get(x) || d3_layout_stackOffsetZero;
- return stack;
- };
- stack.x = function(z) {
- if (!arguments.length) return x;
- x = z;
- return stack;
- };
- stack.y = function(z) {
- if (!arguments.length) return y;
- y = z;
- return stack;
- };
- stack.out = function(z) {
- if (!arguments.length) return out;
- out = z;
- return stack;
- };
- return stack;
- };
- function d3_layout_stackX(d) {
- return d.x;
- }
- function d3_layout_stackY(d) {
- return d.y;
- }
- function d3_layout_stackOut(d, y0, y) {
- d.y0 = y0;
- d.y = y;
- }
- var d3_layout_stackOrders = d3.map({
- "inside-out": function(data) {
- var n = data.length, i, j, max = data.map(d3_layout_stackMaxIndex), sums = data.map(d3_layout_stackReduceSum), index = d3.range(n).sort(function(a, b) {
- return max[a] - max[b];
- }), top = 0, bottom = 0, tops = [], bottoms = [];
- for (i = 0; i < n; ++i) {
- j = index[i];
- if (top < bottom) {
- top += sums[j];
- tops.push(j);
- } else {
- bottom += sums[j];
- bottoms.push(j);
- }
- }
- return bottoms.reverse().concat(tops);
- },
- reverse: function(data) {
- return d3.range(data.length).reverse();
- },
- "default": d3_layout_stackOrderDefault
- });
- var d3_layout_stackOffsets = d3.map({
- silhouette: function(data) {
- var n = data.length, m = data[0].length, sums = [], max = 0, i, j, o, y0 = [];
- for (j = 0; j < m; ++j) {
- for (i = 0, o = 0; i < n; i++) o += data[i][j][1];
- if (o > max) max = o;
- sums.push(o);
- }
- for (j = 0; j < m; ++j) {
- y0[j] = (max - sums[j]) / 2;
- }
- return y0;
- },
- wiggle: function(data) {
- var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = [];
- y0[0] = o = o0 = 0;
- for (j = 1; j < m; ++j) {
- for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1];
- for (i = 0, s2 = 0, dx = x[j][0] - x[j - 1][0]; i < n; ++i) {
- for (k = 0, s3 = (data[i][j][1] - data[i][j - 1][1]) / (2 * dx); k < i; ++k) {
- s3 += (data[k][j][1] - data[k][j - 1][1]) / dx;
- }
- s2 += s3 * data[i][j][1];
- }
- y0[j] = o -= s1 ? s2 / s1 * dx : 0;
- if (o < o0) o0 = o;
- }
- for (j = 0; j < m; ++j) y0[j] -= o0;
- return y0;
- },
- expand: function(data) {
- var n = data.length, m = data[0].length, k = 1 / n, i, j, o, y0 = [];
- for (j = 0; j < m; ++j) {
- for (i = 0, o = 0; i < n; i++) o += data[i][j][1];
- if (o) for (i = 0; i < n; i++) data[i][j][1] /= o; else for (i = 0; i < n; i++) data[i][j][1] = k;
- }
- for (j = 0; j < m; ++j) y0[j] = 0;
- return y0;
- },
- zero: d3_layout_stackOffsetZero
- });
- function d3_layout_stackOrderDefault(data) {
- return d3.range(data.length);
- }
- function d3_layout_stackOffsetZero(data) {
- var j = -1, m = data[0].length, y0 = [];
- while (++j < m) y0[j] = 0;
- return y0;
- }
- function d3_layout_stackMaxIndex(array) {
- var i = 1, j = 0, v = array[0][1], k, n = array.length;
- for (;i < n; ++i) {
- if ((k = array[i][1]) > v) {
- j = i;
- v = k;
- }
- }
- return j;
- }
- function d3_layout_stackReduceSum(d) {
- return d.reduce(d3_layout_stackSum, 0);
- }
- function d3_layout_stackSum(p, d) {
- return p + d[1];
- }
- d3.layout.histogram = function() {
- var frequency = true, valuer = Number, ranger = d3_layout_histogramRange, binner = d3_layout_histogramBinSturges;
- function histogram(data, i) {
- var bins = [], values = data.map(valuer, this), range = ranger.call(this, values, i), thresholds = binner.call(this, range, values, i), bin, i = -1, n = values.length, m = thresholds.length - 1, k = frequency ? 1 : 1 / n, x;
- while (++i < m) {
- bin = bins[i] = [];
- bin.dx = thresholds[i + 1] - (bin.x = thresholds[i]);
- bin.y = 0;
- }
- if (m > 0) {
- i = -1;
- while (++i < n) {
- x = values[i];
- if (x >= range[0] && x <= range[1]) {
- bin = bins[d3.bisect(thresholds, x, 1, m) - 1];
- bin.y += k;
- bin.push(data[i]);
- }
- }
- }
- return bins;
- }
- histogram.value = function(x) {
- if (!arguments.length) return valuer;
- valuer = x;
- return histogram;
- };
- histogram.range = function(x) {
- if (!arguments.length) return ranger;
- ranger = d3_functor(x);
- return histogram;
- };
- histogram.bins = function(x) {
- if (!arguments.length) return binner;
- binner = typeof x === "number" ? function(range) {
- return d3_layout_histogramBinFixed(range, x);
- } : d3_functor(x);
- return histogram;
- };
- histogram.frequency = function(x) {
- if (!arguments.length) return frequency;
- frequency = !!x;
- return histogram;
- };
- return histogram;
- };
- function d3_layout_histogramBinSturges(range, values) {
- return d3_layout_histogramBinFixed(range, Math.ceil(Math.log(values.length) / Math.LN2 + 1));
- }
- function d3_layout_histogramBinFixed(range, n) {
- var x = -1, b = +range[0], m = (range[1] - b) / n, f = [];
- while (++x <= n) f[x] = m * x + b;
- return f;
- }
- function d3_layout_histogramRange(values) {
- return [ d3.min(values), d3.max(values) ];
- }
- d3.layout.pack = function() {
- var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ], radius;
- function pack(d, i) {
- var nodes = hierarchy.call(this, d, i), root = nodes[0], w = size[0], h = size[1], r = radius == null ? Math.sqrt : typeof radius === "function" ? radius : function() {
- return radius;
- };
- root.x = root.y = 0;
- d3_layout_hierarchyVisitAfter(root, function(d) {
- d.r = +r(d.value);
- });
- d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);
- if (padding) {
- var dr = padding * (radius ? 1 : Math.max(2 * root.r / w, 2 * root.r / h)) / 2;
- d3_layout_hierarchyVisitAfter(root, function(d) {
- d.r += dr;
- });
- d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);
- d3_layout_hierarchyVisitAfter(root, function(d) {
- d.r -= dr;
- });
- }
- d3_layout_packTransform(root, w / 2, h / 2, radius ? 1 : 1 / Math.max(2 * root.r / w, 2 * root.r / h));
- return nodes;
- }
- pack.size = function(_) {
- if (!arguments.length) return size;
- size = _;
- return pack;
- };
- pack.radius = function(_) {
- if (!arguments.length) return radius;
- radius = _ == null || typeof _ === "function" ? _ : +_;
- return pack;
- };
- pack.padding = function(_) {
- if (!arguments.length) return padding;
- padding = +_;
- return pack;
- };
- return d3_layout_hierarchyRebind(pack, hierarchy);
- };
- function d3_layout_packSort(a, b) {
- return a.value - b.value;
- }
- function d3_layout_packInsert(a, b) {
- var c = a._pack_next;
- a._pack_next = b;
- b._pack_prev = a;
- b._pack_next = c;
- c._pack_prev = b;
- }
- function d3_layout_packSplice(a, b) {
- a._pack_next = b;
- b._pack_prev = a;
- }
- function d3_layout_packIntersects(a, b) {
- var dx = b.x - a.x, dy = b.y - a.y, dr = a.r + b.r;
- return .999 * dr * dr > dx * dx + dy * dy;
- }
- function d3_layout_packSiblings(node) {
- if (!(nodes = node.children) || !(n = nodes.length)) return;
- var nodes, xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, a, b, c, i, j, k, n;
- function bound(node) {
- xMin = Math.min(node.x - node.r, xMin);
- xMax = Math.max(node.x + node.r, xMax);
- yMin = Math.min(node.y - node.r, yMin);
- yMax = Math.max(node.y + node.r, yMax);
- }
- nodes.forEach(d3_layout_packLink);
- a = nodes[0];
- a.x = -a.r;
- a.y = 0;
- bound(a);
- if (n > 1) {
- b = nodes[1];
- b.x = b.r;
- b.y = 0;
- bound(b);
- if (n > 2) {
- c = nodes[2];
- d3_layout_packPlace(a, b, c);
- bound(c);
- d3_layout_packInsert(a, c);
- a._pack_prev = c;
- d3_layout_packInsert(c, b);
- b = a._pack_next;
- for (i = 3; i < n; i++) {
- d3_layout_packPlace(a, b, c = nodes[i]);
- var isect = 0, s1 = 1, s2 = 1;
- for (j = b._pack_next; j !== b; j = j._pack_next, s1++) {
- if (d3_layout_packIntersects(j, c)) {
- isect = 1;
- break;
- }
- }
- if (isect == 1) {
- for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) {
- if (d3_layout_packIntersects(k, c)) {
- break;
- }
- }
- }
- if (isect) {
- if (s1 < s2 || s1 == s2 && b.r < a.r) d3_layout_packSplice(a, b = j); else d3_layout_packSplice(a = k, b);
- i--;
- } else {
- d3_layout_packInsert(a, c);
- b = c;
- bound(c);
- }
- }
- }
- }
- var cx = (xMin + xMax) / 2, cy = (yMin + yMax) / 2, cr = 0;
- for (i = 0; i < n; i++) {
- c = nodes[i];
- c.x -= cx;
- c.y -= cy;
- cr = Math.max(cr, c.r + Math.sqrt(c.x * c.x + c.y * c.y));
- }
- node.r = cr;
- nodes.forEach(d3_layout_packUnlink);
- }
- function d3_layout_packLink(node) {
- node._pack_next = node._pack_prev = node;
- }
- function d3_layout_packUnlink(node) {
- delete node._pack_next;
- delete node._pack_prev;
- }
- function d3_layout_packTransform(node, x, y, k) {
- var children = node.children;
- node.x = x += k * node.x;
- node.y = y += k * node.y;
- node.r *= k;
- if (children) {
- var i = -1, n = children.length;
- while (++i < n) d3_layout_packTransform(children[i], x, y, k);
- }
- }
- function d3_layout_packPlace(a, b, c) {
- var db = a.r + c.r, dx = b.x - a.x, dy = b.y - a.y;
- if (db && (dx || dy)) {
- var da = b.r + c.r, dc = dx * dx + dy * dy;
- da *= da;
- db *= db;
- var x = .5 + (db - da) / (2 * dc), y = Math.sqrt(Math.max(0, 2 * da * (db + dc) - (db -= dc) * db - da * da)) / (2 * dc);
- c.x = a.x + x * dx + y * dy;
- c.y = a.y + x * dy - y * dx;
- } else {
- c.x = a.x + db;
- c.y = a.y;
- }
- }
- d3.layout.tree = function() {
- var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = null;
- function tree(d, i) {
- var nodes = hierarchy.call(this, d, i), root0 = nodes[0], root1 = wrapTree(root0);
- d3_layout_hierarchyVisitAfter(root1, firstWalk), root1.parent.m = -root1.z;
- d3_layout_hierarchyVisitBefore(root1, secondWalk);
- if (nodeSize) d3_layout_hierarchyVisitBefore(root0, sizeNode); else {
- var left = root0, right = root0, bottom = root0;
- d3_layout_hierarchyVisitBefore(root0, function(node) {
- if (node.x < left.x) left = node;
- if (node.x > right.x) right = node;
- if (node.depth > bottom.depth) bottom = node;
- });
- var tx = separation(left, right) / 2 - left.x, kx = size[0] / (right.x + separation(right, left) / 2 + tx), ky = size[1] / (bottom.depth || 1);
- d3_layout_hierarchyVisitBefore(root0, function(node) {
- node.x = (node.x + tx) * kx;
- node.y = node.depth * ky;
- });
- }
- return nodes;
- }
- function wrapTree(root0) {
- var root1 = {
- A: null,
- children: [ root0 ]
- }, queue = [ root1 ], node1;
- while ((node1 = queue.pop()) != null) {
- for (var children = node1.children, child, i = 0, n = children.length; i < n; ++i) {
- queue.push((children[i] = child = {
- _: children[i],
- parent: node1,
- children: (child = children[i].children) && child.slice() || [],
- A: null,
- a: null,
- z: 0,
- m: 0,
- c: 0,
- s: 0,
- t: null,
- i: i
- }).a = child);
- }
- }
- return root1.children[0];
- }
- function firstWalk(v) {
- var children = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null;
- if (children.length) {
- d3_layout_treeShift(v);
- var midpoint = (children[0].z + children[children.length - 1].z) / 2;
- if (w) {
- v.z = w.z + separation(v._, w._);
- v.m = v.z - midpoint;
- } else {
- v.z = midpoint;
- }
- } else if (w) {
- v.z = w.z + separation(v._, w._);
- }
- v.parent.A = apportion(v, w, v.parent.A || siblings[0]);
- }
- function secondWalk(v) {
- v._.x = v.z + v.parent.m;
- v.m += v.parent.m;
- }
- function apportion(v, w, ancestor) {
- if (w) {
- var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift;
- while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) {
- vom = d3_layout_treeLeft(vom);
- vop = d3_layout_treeRight(vop);
- vop.a = v;
- shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);
- if (shift > 0) {
- d3_layout_treeMove(d3_layout_treeAncestor(vim, v, ancestor), v, shift);
- sip += shift;
- sop += shift;
- }
- sim += vim.m;
- sip += vip.m;
- som += vom.m;
- sop += vop.m;
- }
- if (vim && !d3_layout_treeRight(vop)) {
- vop.t = vim;
- vop.m += sim - sop;
- }
- if (vip && !d3_layout_treeLeft(vom)) {
- vom.t = vip;
- vom.m += sip - som;
- ancestor = v;
- }
- }
- return ancestor;
- }
- function sizeNode(node) {
- node.x *= size[0];
- node.y = node.depth * size[1];
- }
- tree.separation = function(x) {
- if (!arguments.length) return separation;
- separation = x;
- return tree;
- };
- tree.size = function(x) {
- if (!arguments.length) return nodeSize ? null : size;
- nodeSize = (size = x) == null ? sizeNode : null;
- return tree;
- };
- tree.nodeSize = function(x) {
- if (!arguments.length) return nodeSize ? size : null;
- nodeSize = (size = x) == null ? null : sizeNode;
- return tree;
- };
- return d3_layout_hierarchyRebind(tree, hierarchy);
- };
- function d3_layout_treeSeparation(a, b) {
- return a.parent == b.parent ? 1 : 2;
- }
- function d3_layout_treeLeft(v) {
- var children = v.children;
- return children.length ? children[0] : v.t;
- }
- function d3_layout_treeRight(v) {
- var children = v.children, n;
- return (n = children.length) ? children[n - 1] : v.t;
- }
- function d3_layout_treeMove(wm, wp, shift) {
- var change = shift / (wp.i - wm.i);
- wp.c -= change;
- wp.s += shift;
- wm.c += change;
- wp.z += shift;
- wp.m += shift;
- }
- function d3_layout_treeShift(v) {
- var shift = 0, change = 0, children = v.children, i = children.length, w;
- while (--i >= 0) {
- w = children[i];
- w.z += shift;
- w.m += shift;
- shift += w.s + (change += w.c);
- }
- }
- function d3_layout_treeAncestor(vim, v, ancestor) {
- return vim.a.parent === v.parent ? vim.a : ancestor;
- }
- d3.layout.cluster = function() {
- var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false;
- function cluster(d, i) {
- var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0;
- d3_layout_hierarchyVisitAfter(root, function(node) {
- var children = node.children;
- if (children && children.length) {
- node.x = d3_layout_clusterX(children);
- node.y = d3_layout_clusterY(children);
- } else {
- node.x = previousNode ? x += separation(node, previousNode) : 0;
- node.y = 0;
- previousNode = node;
- }
- });
- var left = d3_layout_clusterLeft(root), right = d3_layout_clusterRight(root), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2;
- d3_layout_hierarchyVisitAfter(root, nodeSize ? function(node) {
- node.x = (node.x - root.x) * size[0];
- node.y = (root.y - node.y) * size[1];
- } : function(node) {
- node.x = (node.x - x0) / (x1 - x0) * size[0];
- node.y = (1 - (root.y ? node.y / root.y : 1)) * size[1];
- });
- return nodes;
- }
- cluster.separation = function(x) {
- if (!arguments.length) return separation;
- separation = x;
- return cluster;
- };
- cluster.size = function(x) {
- if (!arguments.length) return nodeSize ? null : size;
- nodeSize = (size = x) == null;
- return cluster;
- };
- cluster.nodeSize = function(x) {
- if (!arguments.length) return nodeSize ? size : null;
- nodeSize = (size = x) != null;
- return cluster;
- };
- return d3_layout_hierarchyRebind(cluster, hierarchy);
- };
- function d3_layout_clusterY(children) {
- return 1 + d3.max(children, function(child) {
- return child.y;
- });
- }
- function d3_layout_clusterX(children) {
- return children.reduce(function(x, child) {
- return x + child.x;
- }, 0) / children.length;
- }
- function d3_layout_clusterLeft(node) {
- var children = node.children;
- return children && children.length ? d3_layout_clusterLeft(children[0]) : node;
- }
- function d3_layout_clusterRight(node) {
- var children = node.children, n;
- return children && (n = children.length) ? d3_layout_clusterRight(children[n - 1]) : node;
- }
- d3.layout.treemap = function() {
- var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [ 1, 1 ], padding = null, pad = d3_layout_treemapPadNull, sticky = false, stickies, mode = "squarify", ratio = .5 * (1 + Math.sqrt(5));
- function scale(children, k) {
- var i = -1, n = children.length, child, area;
- while (++i < n) {
- area = (child = children[i]).value * (k < 0 ? 0 : k);
- child.area = isNaN(area) || area <= 0 ? 0 : area;
- }
- }
- function squarify(node) {
- var children = node.children;
- if (children && children.length) {
- var rect = pad(node), row = [], remaining = children.slice(), child, best = Infinity, score, u = mode === "slice" ? rect.dx : mode === "dice" ? rect.dy : mode === "slice-dice" ? node.depth & 1 ? rect.dy : rect.dx : Math.min(rect.dx, rect.dy), n;
- scale(remaining, rect.dx * rect.dy / node.value);
- row.area = 0;
- while ((n = remaining.length) > 0) {
- row.push(child = remaining[n - 1]);
- row.area += child.area;
- if (mode !== "squarify" || (score = worst(row, u)) <= best) {
- remaining.pop();
- best = score;
- } else {
- row.area -= row.pop().area;
- position(row, u, rect, false);
- u = Math.min(rect.dx, rect.dy);
- row.length = row.area = 0;
- best = Infinity;
- }
- }
- if (row.length) {
- position(row, u, rect, true);
- row.length = row.area = 0;
- }
- children.forEach(squarify);
- }
- }
- function stickify(node) {
- var children = node.children;
- if (children && children.length) {
- var rect = pad(node), remaining = children.slice(), child, row = [];
- scale(remaining, rect.dx * rect.dy / node.value);
- row.area = 0;
- while (child = remaining.pop()) {
- row.push(child);
- row.area += child.area;
- if (child.z != null) {
- position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length);
- row.length = row.area = 0;
- }
- }
- children.forEach(stickify);
- }
- }
- function worst(row, u) {
- var s = row.area, r, rmax = 0, rmin = Infinity, i = -1, n = row.length;
- while (++i < n) {
- if (!(r = row[i].area)) continue;
- if (r < rmin) rmin = r;
- if (r > rmax) rmax = r;
- }
- s *= s;
- u *= u;
- return s ? Math.max(u * rmax * ratio / s, s / (u * rmin * ratio)) : Infinity;
- }
- function position(row, u, rect, flush) {
- var i = -1, n = row.length, x = rect.x, y = rect.y, v = u ? round(row.area / u) : 0, o;
- if (u == rect.dx) {
- if (flush || v > rect.dy) v = rect.dy;
- while (++i < n) {
- o = row[i];
- o.x = x;
- o.y = y;
- o.dy = v;
- x += o.dx = Math.min(rect.x + rect.dx - x, v ? round(o.area / v) : 0);
- }
- o.z = true;
- o.dx += rect.x + rect.dx - x;
- rect.y += v;
- rect.dy -= v;
- } else {
- if (flush || v > rect.dx) v = rect.dx;
- while (++i < n) {
- o = row[i];
- o.x = x;
- o.y = y;
- o.dx = v;
- y += o.dy = Math.min(rect.y + rect.dy - y, v ? round(o.area / v) : 0);
- }
- o.z = false;
- o.dy += rect.y + rect.dy - y;
- rect.x += v;
- rect.dx -= v;
- }
- }
- function treemap(d) {
- var nodes = stickies || hierarchy(d), root = nodes[0];
- root.x = 0;
- root.y = 0;
- root.dx = size[0];
- root.dy = size[1];
- if (stickies) hierarchy.revalue(root);
- scale([ root ], root.dx * root.dy / root.value);
- (stickies ? stickify : squarify)(root);
- if (sticky) stickies = nodes;
- return nodes;
- }
- treemap.size = function(x) {
- if (!arguments.length) return size;
- size = x;
- return treemap;
- };
- treemap.padding = function(x) {
- if (!arguments.length) return padding;
- function padFunction(node) {
- var p = x.call(treemap, node, node.depth);
- return p == null ? d3_layout_treemapPadNull(node) : d3_layout_treemapPad(node, typeof p === "number" ? [ p, p, p, p ] : p);
- }
- function padConstant(node) {
- return d3_layout_treemapPad(node, x);
- }
- var type;
- pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === "function" ? padFunction : type === "number" ? (x = [ x, x, x, x ],
- padConstant) : padConstant;
- return treemap;
- };
- treemap.round = function(x) {
- if (!arguments.length) return round != Number;
- round = x ? Math.round : Number;
- return treemap;
- };
- treemap.sticky = function(x) {
- if (!arguments.length) return sticky;
- sticky = x;
- stickies = null;
- return treemap;
- };
- treemap.ratio = function(x) {
- if (!arguments.length) return ratio;
- ratio = x;
- return treemap;
- };
- treemap.mode = function(x) {
- if (!arguments.length) return mode;
- mode = x + "";
- return treemap;
- };
- return d3_layout_hierarchyRebind(treemap, hierarchy);
- };
- function d3_layout_treemapPadNull(node) {
- return {
- x: node.x,
- y: node.y,
- dx: node.dx,
- dy: node.dy
- };
- }
- function d3_layout_treemapPad(node, padding) {
- var x = node.x + padding[3], y = node.y + padding[0], dx = node.dx - padding[1] - padding[3], dy = node.dy - padding[0] - padding[2];
- if (dx < 0) {
- x += dx / 2;
- dx = 0;
- }
- if (dy < 0) {
- y += dy / 2;
- dy = 0;
- }
- return {
- x: x,
- y: y,
- dx: dx,
- dy: dy
- };
- }
- d3.random = {
- normal: function(µ, σ) {
- var n = arguments.length;
- if (n < 2) σ = 1;
- if (n < 1) µ = 0;
- return function() {
- var x, y, r;
- do {
- x = Math.random() * 2 - 1;
- y = Math.random() * 2 - 1;
- r = x * x + y * y;
- } while (!r || r > 1);
- return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
- };
- },
- logNormal: function() {
- var random = d3.random.normal.apply(d3, arguments);
- return function() {
- return Math.exp(random());
- };
- },
- bates: function(m) {
- var random = d3.random.irwinHall(m);
- return function() {
- return random() / m;
- };
- },
- irwinHall: function(m) {
- return function() {
- for (var s = 0, j = 0; j < m; j++) s += Math.random();
- return s;
- };
- }
- };
- d3.scale = {};
- function d3_scaleExtent(domain) {
- var start = domain[0], stop = domain[domain.length - 1];
- return start < stop ? [ start, stop ] : [ stop, start ];
- }
- function d3_scaleRange(scale) {
- return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range());
- }
- function d3_scale_bilinear(domain, range, uninterpolate, interpolate) {
- var u = uninterpolate(domain[0], domain[1]), i = interpolate(range[0], range[1]);
- return function(x) {
- return i(u(x));
- };
- }
- function d3_scale_nice(domain, nice) {
- var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], dx;
- if (x1 < x0) {
- dx = i0, i0 = i1, i1 = dx;
- dx = x0, x0 = x1, x1 = dx;
- }
- domain[i0] = nice.floor(x0);
- domain[i1] = nice.ceil(x1);
- return domain;
- }
- function d3_scale_niceStep(step) {
- return step ? {
- floor: function(x) {
- return Math.floor(x / step) * step;
- },
- ceil: function(x) {
- return Math.ceil(x / step) * step;
- }
- } : d3_scale_niceIdentity;
- }
- var d3_scale_niceIdentity = {
- floor: d3_identity,
- ceil: d3_identity
- };
- function d3_scale_polylinear(domain, range, uninterpolate, interpolate) {
- var u = [], i = [], j = 0, k = Math.min(domain.length, range.length) - 1;
- if (domain[k] < domain[0]) {
- domain = domain.slice().reverse();
- range = range.slice().reverse();
- }
- while (++j <= k) {
- u.push(uninterpolate(domain[j - 1], domain[j]));
- i.push(interpolate(range[j - 1], range[j]));
- }
- return function(x) {
- var j = d3.bisect(domain, x, 1, k) - 1;
- return i[j](u[j](x));
- };
- }
- d3.scale.linear = function() {
- return d3_scale_linear([ 0, 1 ], [ 0, 1 ], d3_interpolate, false);
- };
- function d3_scale_linear(domain, range, interpolate, clamp) {
- var output, input;
- function rescale() {
- var linear = Math.min(domain.length, range.length) > 2 ? d3_scale_polylinear : d3_scale_bilinear, uninterpolate = clamp ? d3_uninterpolateClamp : d3_uninterpolateNumber;
- output = linear(domain, range, uninterpolate, interpolate);
- input = linear(range, domain, uninterpolate, d3_interpolate);
- return scale;
- }
- function scale(x) {
- return output(x);
- }
- scale.invert = function(y) {
- return input(y);
- };
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- domain = x.map(Number);
- return rescale();
- };
- scale.range = function(x) {
- if (!arguments.length) return range;
- range = x;
- return rescale();
- };
- scale.rangeRound = function(x) {
- return scale.range(x).interpolate(d3_interpolateRound);
- };
- scale.clamp = function(x) {
- if (!arguments.length) return clamp;
- clamp = x;
- return rescale();
- };
- scale.interpolate = function(x) {
- if (!arguments.length) return interpolate;
- interpolate = x;
- return rescale();
- };
- scale.ticks = function(m) {
- return d3_scale_linearTicks(domain, m);
- };
- scale.tickFormat = function(m, format) {
- return d3_scale_linearTickFormat(domain, m, format);
- };
- scale.nice = function(m) {
- d3_scale_linearNice(domain, m);
- return rescale();
- };
- scale.copy = function() {
- return d3_scale_linear(domain, range, interpolate, clamp);
- };
- return rescale();
- }
- function d3_scale_linearRebind(scale, linear) {
- return d3.rebind(scale, linear, "range", "rangeRound", "interpolate", "clamp");
- }
- function d3_scale_linearNice(domain, m) {
- return d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2]));
- }
- function d3_scale_linearTickRange(domain, m) {
- if (m == null) m = 10;
- var extent = d3_scaleExtent(domain), span = extent[1] - extent[0], step = Math.pow(10, Math.floor(Math.log(span / m) / Math.LN10)), err = m / span * step;
- if (err <= .15) step *= 10; else if (err <= .35) step *= 5; else if (err <= .75) step *= 2;
- extent[0] = Math.ceil(extent[0] / step) * step;
- extent[1] = Math.floor(extent[1] / step) * step + step * .5;
- extent[2] = step;
- return extent;
- }
- function d3_scale_linearTicks(domain, m) {
- return d3.range.apply(d3, d3_scale_linearTickRange(domain, m));
- }
- function d3_scale_linearTickFormat(domain, m, format) {
- var range = d3_scale_linearTickRange(domain, m);
- if (format) {
- var match = d3_format_re.exec(format);
- match.shift();
- if (match[8] === "s") {
- var prefix = d3.formatPrefix(Math.max(abs(range[0]), abs(range[1])));
- if (!match[7]) match[7] = "." + d3_scale_linearPrecision(prefix.scale(range[2]));
- match[8] = "f";
- format = d3.format(match.join(""));
- return function(d) {
- return format(prefix.scale(d)) + prefix.symbol;
- };
- }
- if (!match[7]) match[7] = "." + d3_scale_linearFormatPrecision(match[8], range);
- format = match.join("");
- } else {
- format = ",." + d3_scale_linearPrecision(range[2]) + "f";
- }
- return d3.format(format);
- }
- var d3_scale_linearFormatSignificant = {
- s: 1,
- g: 1,
- p: 1,
- r: 1,
- e: 1
- };
- function d3_scale_linearPrecision(value) {
- return -Math.floor(Math.log(value) / Math.LN10 + .01);
- }
- function d3_scale_linearFormatPrecision(type, range) {
- var p = d3_scale_linearPrecision(range[2]);
- return type in d3_scale_linearFormatSignificant ? Math.abs(p - d3_scale_linearPrecision(Math.max(abs(range[0]), abs(range[1])))) + +(type !== "e") : p - (type === "%") * 2;
- }
- d3.scale.log = function() {
- return d3_scale_log(d3.scale.linear().domain([ 0, 1 ]), 10, true, [ 1, 10 ]);
- };
- function d3_scale_log(linear, base, positive, domain) {
- function log(x) {
- return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(x > 0 ? 0 : -x)) / Math.log(base);
- }
- function pow(x) {
- return positive ? Math.pow(base, x) : -Math.pow(base, -x);
- }
- function scale(x) {
- return linear(log(x));
- }
- scale.invert = function(x) {
- return pow(linear.invert(x));
- };
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- positive = x[0] >= 0;
- linear.domain((domain = x.map(Number)).map(log));
- return scale;
- };
- scale.base = function(_) {
- if (!arguments.length) return base;
- base = +_;
- linear.domain(domain.map(log));
- return scale;
- };
- scale.nice = function() {
- var niced = d3_scale_nice(domain.map(log), positive ? Math : d3_scale_logNiceNegative);
- linear.domain(niced);
- domain = niced.map(pow);
- return scale;
- };
- scale.ticks = function() {
- var extent = d3_scaleExtent(domain), ticks = [], u = extent[0], v = extent[1], i = Math.floor(log(u)), j = Math.ceil(log(v)), n = base % 1 ? 2 : base;
- if (isFinite(j - i)) {
- if (positive) {
- for (;i < j; i++) for (var k = 1; k < n; k++) ticks.push(pow(i) * k);
- ticks.push(pow(i));
- } else {
- ticks.push(pow(i));
- for (;i++ < j; ) for (var k = n - 1; k > 0; k--) ticks.push(pow(i) * k);
- }
- for (i = 0; ticks[i] < u; i++) {}
- for (j = ticks.length; ticks[j - 1] > v; j--) {}
- ticks = ticks.slice(i, j);
- }
- return ticks;
- };
- scale.tickFormat = function(n, format) {
- if (!arguments.length) return d3_scale_logFormat;
- if (arguments.length < 2) format = d3_scale_logFormat; else if (typeof format !== "function") format = d3.format(format);
- var k = Math.max(.1, n / scale.ticks().length), f = positive ? (e = 1e-12, Math.ceil) : (e = -1e-12,
- Math.floor), e;
- return function(d) {
- return d / pow(f(log(d) + e)) <= k ? format(d) : "";
- };
- };
- scale.copy = function() {
- return d3_scale_log(linear.copy(), base, positive, domain);
- };
- return d3_scale_linearRebind(scale, linear);
- }
- var d3_scale_logFormat = d3.format(".0e"), d3_scale_logNiceNegative = {
- floor: function(x) {
- return -Math.ceil(-x);
- },
- ceil: function(x) {
- return -Math.floor(-x);
- }
- };
- d3.scale.pow = function() {
- return d3_scale_pow(d3.scale.linear(), 1, [ 0, 1 ]);
- };
- function d3_scale_pow(linear, exponent, domain) {
- var powp = d3_scale_powPow(exponent), powb = d3_scale_powPow(1 / exponent);
- function scale(x) {
- return linear(powp(x));
- }
- scale.invert = function(x) {
- return powb(linear.invert(x));
- };
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- linear.domain((domain = x.map(Number)).map(powp));
- return scale;
- };
- scale.ticks = function(m) {
- return d3_scale_linearTicks(domain, m);
- };
- scale.tickFormat = function(m, format) {
- return d3_scale_linearTickFormat(domain, m, format);
- };
- scale.nice = function(m) {
- return scale.domain(d3_scale_linearNice(domain, m));
- };
- scale.exponent = function(x) {
- if (!arguments.length) return exponent;
- powp = d3_scale_powPow(exponent = x);
- powb = d3_scale_powPow(1 / exponent);
- linear.domain(domain.map(powp));
- return scale;
- };
- scale.copy = function() {
- return d3_scale_pow(linear.copy(), exponent, domain);
- };
- return d3_scale_linearRebind(scale, linear);
- }
- function d3_scale_powPow(e) {
- return function(x) {
- return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e);
- };
- }
- d3.scale.sqrt = function() {
- return d3.scale.pow().exponent(.5);
- };
- d3.scale.ordinal = function() {
- return d3_scale_ordinal([], {
- t: "range",
- a: [ [] ]
- });
- };
- function d3_scale_ordinal(domain, ranger) {
- var index, range, rangeBand;
- function scale(x) {
- return range[((index.get(x) || (ranger.t === "range" ? index.set(x, domain.push(x)) : NaN)) - 1) % range.length];
- }
- function steps(start, step) {
- return d3.range(domain.length).map(function(i) {
- return start + step * i;
- });
- }
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- domain = [];
- index = new d3_Map();
- var i = -1, n = x.length, xi;
- while (++i < n) if (!index.has(xi = x[i])) index.set(xi, domain.push(xi));
- return scale[ranger.t].apply(scale, ranger.a);
- };
- scale.range = function(x) {
- if (!arguments.length) return range;
- range = x;
- rangeBand = 0;
- ranger = {
- t: "range",
- a: arguments
- };
- return scale;
- };
- scale.rangePoints = function(x, padding) {
- if (arguments.length < 2) padding = 0;
- var start = x[0], stop = x[1], step = (stop - start) / (Math.max(1, domain.length - 1) + padding);
- range = steps(domain.length < 2 ? (start + stop) / 2 : start + step * padding / 2, step);
- rangeBand = 0;
- ranger = {
- t: "rangePoints",
- a: arguments
- };
- return scale;
- };
- scale.rangeBands = function(x, padding, outerPadding) {
- if (arguments.length < 2) padding = 0;
- if (arguments.length < 3) outerPadding = padding;
- var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = (stop - start) / (domain.length - padding + 2 * outerPadding);
- range = steps(start + step * outerPadding, step);
- if (reverse) range.reverse();
- rangeBand = step * (1 - padding);
- ranger = {
- t: "rangeBands",
- a: arguments
- };
- return scale;
- };
- scale.rangeRoundBands = function(x, padding, outerPadding) {
- if (arguments.length < 2) padding = 0;
- if (arguments.length < 3) outerPadding = padding;
- var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = Math.floor((stop - start) / (domain.length - padding + 2 * outerPadding)), error = stop - start - (domain.length - padding) * step;
- range = steps(start + Math.round(error / 2), step);
- if (reverse) range.reverse();
- rangeBand = Math.round(step * (1 - padding));
- ranger = {
- t: "rangeRoundBands",
- a: arguments
- };
- return scale;
- };
- scale.rangeBand = function() {
- return rangeBand;
- };
- scale.rangeExtent = function() {
- return d3_scaleExtent(ranger.a[0]);
- };
- scale.copy = function() {
- return d3_scale_ordinal(domain, ranger);
- };
- return scale.domain(domain);
- }
- d3.scale.category10 = function() {
- return d3.scale.ordinal().range(d3_category10);
- };
- d3.scale.category20 = function() {
- return d3.scale.ordinal().range(d3_category20);
- };
- d3.scale.category20b = function() {
- return d3.scale.ordinal().range(d3_category20b);
- };
- d3.scale.category20c = function() {
- return d3.scale.ordinal().range(d3_category20c);
- };
- var d3_category10 = [ 2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175 ].map(d3_rgbString);
- var d3_category20 = [ 2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725 ].map(d3_rgbString);
- var d3_category20b = [ 3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654 ].map(d3_rgbString);
- var d3_category20c = [ 3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081 ].map(d3_rgbString);
- d3.scale.quantile = function() {
- return d3_scale_quantile([], []);
- };
- function d3_scale_quantile(domain, range) {
- var thresholds;
- function rescale() {
- var k = 0, q = range.length;
- thresholds = [];
- while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q);
- return scale;
- }
- function scale(x) {
- if (!isNaN(x = +x)) return range[d3.bisect(thresholds, x)];
- }
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- domain = x.filter(d3_number).sort(d3_ascending);
- return rescale();
- };
- scale.range = function(x) {
- if (!arguments.length) return range;
- range = x;
- return rescale();
- };
- scale.quantiles = function() {
- return thresholds;
- };
- scale.invertExtent = function(y) {
- y = range.indexOf(y);
- return y < 0 ? [ NaN, NaN ] : [ y > 0 ? thresholds[y - 1] : domain[0], y < thresholds.length ? thresholds[y] : domain[domain.length - 1] ];
- };
- scale.copy = function() {
- return d3_scale_quantile(domain, range);
- };
- return rescale();
- }
- d3.scale.quantize = function() {
- return d3_scale_quantize(0, 1, [ 0, 1 ]);
- };
- function d3_scale_quantize(x0, x1, range) {
- var kx, i;
- function scale(x) {
- return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))];
- }
- function rescale() {
- kx = range.length / (x1 - x0);
- i = range.length - 1;
- return scale;
- }
- scale.domain = function(x) {
- if (!arguments.length) return [ x0, x1 ];
- x0 = +x[0];
- x1 = +x[x.length - 1];
- return rescale();
- };
- scale.range = function(x) {
- if (!arguments.length) return range;
- range = x;
- return rescale();
- };
- scale.invertExtent = function(y) {
- y = range.indexOf(y);
- y = y < 0 ? NaN : y / kx + x0;
- return [ y, y + 1 / kx ];
- };
- scale.copy = function() {
- return d3_scale_quantize(x0, x1, range);
- };
- return rescale();
- }
- d3.scale.threshold = function() {
- return d3_scale_threshold([ .5 ], [ 0, 1 ]);
- };
- function d3_scale_threshold(domain, range) {
- function scale(x) {
- if (x <= x) return range[d3.bisect(domain, x)];
- }
- scale.domain = function(_) {
- if (!arguments.length) return domain;
- domain = _;
- return scale;
- };
- scale.range = function(_) {
- if (!arguments.length) return range;
- range = _;
- return scale;
- };
- scale.invertExtent = function(y) {
- y = range.indexOf(y);
- return [ domain[y - 1], domain[y] ];
- };
- scale.copy = function() {
- return d3_scale_threshold(domain, range);
- };
- return scale;
- }
- d3.scale.identity = function() {
- return d3_scale_identity([ 0, 1 ]);
- };
- function d3_scale_identity(domain) {
- function identity(x) {
- return +x;
- }
- identity.invert = identity;
- identity.domain = identity.range = function(x) {
- if (!arguments.length) return domain;
- domain = x.map(identity);
- return identity;
- };
- identity.ticks = function(m) {
- return d3_scale_linearTicks(domain, m);
- };
- identity.tickFormat = function(m, format) {
- return d3_scale_linearTickFormat(domain, m, format);
- };
- identity.copy = function() {
- return d3_scale_identity(domain);
- };
- return identity;
- }
- d3.svg = {};
- d3.svg.arc = function() {
- var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle;
- function arc() {
- var r0 = innerRadius.apply(this, arguments), r1 = outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) + d3_svg_arcOffset, a1 = endAngle.apply(this, arguments) + d3_svg_arcOffset, da = (a1 < a0 && (da = a0,
- a0 = a1, a1 = da), a1 - a0), df = da < π ? "0" : "1", c0 = Math.cos(a0), s0 = Math.sin(a0), c1 = Math.cos(a1), s1 = Math.sin(a1);
- return da >= d3_svg_arcMax ? r0 ? "M0," + r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + -r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + r1 + "M0," + r0 + "A" + r0 + "," + r0 + " 0 1,0 0," + -r0 + "A" + r0 + "," + r0 + " 0 1,0 0," + r0 + "Z" : "M0," + r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + -r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + r1 + "Z" : r0 ? "M" + r1 * c0 + "," + r1 * s0 + "A" + r1 + "," + r1 + " 0 " + df + ",1 " + r1 * c1 + "," + r1 * s1 + "L" + r0 * c1 + "," + r0 * s1 + "A" + r0 + "," + r0 + " 0 " + df + ",0 " + r0 * c0 + "," + r0 * s0 + "Z" : "M" + r1 * c0 + "," + r1 * s0 + "A" + r1 + "," + r1 + " 0 " + df + ",1 " + r1 * c1 + "," + r1 * s1 + "L0,0" + "Z";
- }
- arc.innerRadius = function(v) {
- if (!arguments.length) return innerRadius;
- innerRadius = d3_functor(v);
- return arc;
- };
- arc.outerRadius = function(v) {
- if (!arguments.length) return outerRadius;
- outerRadius = d3_functor(v);
- return arc;
- };
- arc.startAngle = function(v) {
- if (!arguments.length) return startAngle;
- startAngle = d3_functor(v);
- return arc;
- };
- arc.endAngle = function(v) {
- if (!arguments.length) return endAngle;
- endAngle = d3_functor(v);
- return arc;
- };
- arc.centroid = function() {
- var r = (innerRadius.apply(this, arguments) + outerRadius.apply(this, arguments)) / 2, a = (startAngle.apply(this, arguments) + endAngle.apply(this, arguments)) / 2 + d3_svg_arcOffset;
- return [ Math.cos(a) * r, Math.sin(a) * r ];
- };
- return arc;
- };
- var d3_svg_arcOffset = -halfπ, d3_svg_arcMax = τ - ε;
- function d3_svg_arcInnerRadius(d) {
- return d.innerRadius;
- }
- function d3_svg_arcOuterRadius(d) {
- return d.outerRadius;
- }
- function d3_svg_arcStartAngle(d) {
- return d.startAngle;
- }
- function d3_svg_arcEndAngle(d) {
- return d.endAngle;
- }
- function d3_svg_line(projection) {
- var x = d3_geom_pointX, y = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, tension = .7;
- function line(data) {
- var segments = [], points = [], i = -1, n = data.length, d, fx = d3_functor(x), fy = d3_functor(y);
- function segment() {
- segments.push("M", interpolate(projection(points), tension));
- }
- while (++i < n) {
- if (defined.call(this, d = data[i], i)) {
- points.push([ +fx.call(this, d, i), +fy.call(this, d, i) ]);
- } else if (points.length) {
- segment();
- points = [];
- }
- }
- if (points.length) segment();
- return segments.length ? segments.join("") : null;
- }
- line.x = function(_) {
- if (!arguments.length) return x;
- x = _;
- return line;
- };
- line.y = function(_) {
- if (!arguments.length) return y;
- y = _;
- return line;
- };
- line.defined = function(_) {
- if (!arguments.length) return defined;
- defined = _;
- return line;
- };
- line.interpolate = function(_) {
- if (!arguments.length) return interpolateKey;
- if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key;
- return line;
- };
- line.tension = function(_) {
- if (!arguments.length) return tension;
- tension = _;
- return line;
- };
- return line;
- }
- d3.svg.line = function() {
- return d3_svg_line(d3_identity);
- };
- var d3_svg_lineInterpolators = d3.map({
- linear: d3_svg_lineLinear,
- "linear-closed": d3_svg_lineLinearClosed,
- step: d3_svg_lineStep,
- "step-before": d3_svg_lineStepBefore,
- "step-after": d3_svg_lineStepAfter,
- basis: d3_svg_lineBasis,
- "basis-open": d3_svg_lineBasisOpen,
- "basis-closed": d3_svg_lineBasisClosed,
- bundle: d3_svg_lineBundle,
- cardinal: d3_svg_lineCardinal,
- "cardinal-open": d3_svg_lineCardinalOpen,
- "cardinal-closed": d3_svg_lineCardinalClosed,
- monotone: d3_svg_lineMonotone
- });
- d3_svg_lineInterpolators.forEach(function(key, value) {
- value.key = key;
- value.closed = /-closed$/.test(key);
- });
- function d3_svg_lineLinear(points) {
- return points.join("L");
- }
- function d3_svg_lineLinearClosed(points) {
- return d3_svg_lineLinear(points) + "Z";
- }
- function d3_svg_lineStep(points) {
- var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
- while (++i < n) path.push("H", (p[0] + (p = points[i])[0]) / 2, "V", p[1]);
- if (n > 1) path.push("H", p[0]);
- return path.join("");
- }
- function d3_svg_lineStepBefore(points) {
- var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
- while (++i < n) path.push("V", (p = points[i])[1], "H", p[0]);
- return path.join("");
- }
- function d3_svg_lineStepAfter(points) {
- var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
- while (++i < n) path.push("H", (p = points[i])[0], "V", p[1]);
- return path.join("");
- }
- function d3_svg_lineCardinalOpen(points, tension) {
- return points.length < 4 ? d3_svg_lineLinear(points) : points[1] + d3_svg_lineHermite(points.slice(1, points.length - 1), d3_svg_lineCardinalTangents(points, tension));
- }
- function d3_svg_lineCardinalClosed(points, tension) {
- return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite((points.push(points[0]),
- points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension));
- }
- function d3_svg_lineCardinal(points, tension) {
- return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineCardinalTangents(points, tension));
- }
- function d3_svg_lineHermite(points, tangents) {
- if (tangents.length < 1 || points.length != tangents.length && points.length != tangents.length + 2) {
- return d3_svg_lineLinear(points);
- }
- var quad = points.length != tangents.length, path = "", p0 = points[0], p = points[1], t0 = tangents[0], t = t0, pi = 1;
- if (quad) {
- path += "Q" + (p[0] - t0[0] * 2 / 3) + "," + (p[1] - t0[1] * 2 / 3) + "," + p[0] + "," + p[1];
- p0 = points[1];
- pi = 2;
- }
- if (tangents.length > 1) {
- t = tangents[1];
- p = points[pi];
- pi++;
- path += "C" + (p0[0] + t0[0]) + "," + (p0[1] + t0[1]) + "," + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1];
- for (var i = 2; i < tangents.length; i++, pi++) {
- p = points[pi];
- t = tangents[i];
- path += "S" + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1];
- }
- }
- if (quad) {
- var lp = points[pi];
- path += "Q" + (p[0] + t[0] * 2 / 3) + "," + (p[1] + t[1] * 2 / 3) + "," + lp[0] + "," + lp[1];
- }
- return path;
- }
- function d3_svg_lineCardinalTangents(points, tension) {
- var tangents = [], a = (1 - tension) / 2, p0, p1 = points[0], p2 = points[1], i = 1, n = points.length;
- while (++i < n) {
- p0 = p1;
- p1 = p2;
- p2 = points[i];
- tangents.push([ a * (p2[0] - p0[0]), a * (p2[1] - p0[1]) ]);
- }
- return tangents;
- }
- function d3_svg_lineBasis(points) {
- if (points.length < 3) return d3_svg_lineLinear(points);
- var i = 1, n = points.length, pi = points[0], x0 = pi[0], y0 = pi[1], px = [ x0, x0, x0, (pi = points[1])[0] ], py = [ y0, y0, y0, pi[1] ], path = [ x0, ",", y0, "L", d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ];
- points.push(points[n - 1]);
- while (++i <= n) {
- pi = points[i];
- px.shift();
- px.push(pi[0]);
- py.shift();
- py.push(pi[1]);
- d3_svg_lineBasisBezier(path, px, py);
- }
- points.pop();
- path.push("L", pi);
- return path.join("");
- }
- function d3_svg_lineBasisOpen(points) {
- if (points.length < 4) return d3_svg_lineLinear(points);
- var path = [], i = -1, n = points.length, pi, px = [ 0 ], py = [ 0 ];
- while (++i < 3) {
- pi = points[i];
- px.push(pi[0]);
- py.push(pi[1]);
- }
- path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px) + "," + d3_svg_lineDot4(d3_svg_lineBasisBezier3, py));
- --i;
- while (++i < n) {
- pi = points[i];
- px.shift();
- px.push(pi[0]);
- py.shift();
- py.push(pi[1]);
- d3_svg_lineBasisBezier(path, px, py);
- }
- return path.join("");
- }
- function d3_svg_lineBasisClosed(points) {
- var path, i = -1, n = points.length, m = n + 4, pi, px = [], py = [];
- while (++i < 4) {
- pi = points[i % n];
- px.push(pi[0]);
- py.push(pi[1]);
- }
- path = [ d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ];
- --i;
- while (++i < m) {
- pi = points[i % n];
- px.shift();
- px.push(pi[0]);
- py.shift();
- py.push(pi[1]);
- d3_svg_lineBasisBezier(path, px, py);
- }
- return path.join("");
- }
- function d3_svg_lineBundle(points, tension) {
- var n = points.length - 1;
- if (n) {
- var x0 = points[0][0], y0 = points[0][1], dx = points[n][0] - x0, dy = points[n][1] - y0, i = -1, p, t;
- while (++i <= n) {
- p = points[i];
- t = i / n;
- p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx);
- p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy);
- }
- }
- return d3_svg_lineBasis(points);
- }
- function d3_svg_lineDot4(a, b) {
- return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
- }
- var d3_svg_lineBasisBezier1 = [ 0, 2 / 3, 1 / 3, 0 ], d3_svg_lineBasisBezier2 = [ 0, 1 / 3, 2 / 3, 0 ], d3_svg_lineBasisBezier3 = [ 0, 1 / 6, 2 / 3, 1 / 6 ];
- function d3_svg_lineBasisBezier(path, x, y) {
- path.push("C", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier1, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, y));
- }
- function d3_svg_lineSlope(p0, p1) {
- return (p1[1] - p0[1]) / (p1[0] - p0[0]);
- }
- function d3_svg_lineFiniteDifferences(points) {
- var i = 0, j = points.length - 1, m = [], p0 = points[0], p1 = points[1], d = m[0] = d3_svg_lineSlope(p0, p1);
- while (++i < j) {
- m[i] = (d + (d = d3_svg_lineSlope(p0 = p1, p1 = points[i + 1]))) / 2;
- }
- m[i] = d;
- return m;
- }
- function d3_svg_lineMonotoneTangents(points) {
- var tangents = [], d, a, b, s, m = d3_svg_lineFiniteDifferences(points), i = -1, j = points.length - 1;
- while (++i < j) {
- d = d3_svg_lineSlope(points[i], points[i + 1]);
- if (abs(d) < ε) {
- m[i] = m[i + 1] = 0;
- } else {
- a = m[i] / d;
- b = m[i + 1] / d;
- s = a * a + b * b;
- if (s > 9) {
- s = d * 3 / Math.sqrt(s);
- m[i] = s * a;
- m[i + 1] = s * b;
- }
- }
- }
- i = -1;
- while (++i <= j) {
- s = (points[Math.min(j, i + 1)][0] - points[Math.max(0, i - 1)][0]) / (6 * (1 + m[i] * m[i]));
- tangents.push([ s || 0, m[i] * s || 0 ]);
- }
- return tangents;
- }
- function d3_svg_lineMonotone(points) {
- return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineMonotoneTangents(points));
- }
- d3.svg.line.radial = function() {
- var line = d3_svg_line(d3_svg_lineRadial);
- line.radius = line.x, delete line.x;
- line.angle = line.y, delete line.y;
- return line;
- };
- function d3_svg_lineRadial(points) {
- var point, i = -1, n = points.length, r, a;
- while (++i < n) {
- point = points[i];
- r = point[0];
- a = point[1] + d3_svg_arcOffset;
- point[0] = r * Math.cos(a);
- point[1] = r * Math.sin(a);
- }
- return points;
- }
- function d3_svg_area(projection) {
- var x0 = d3_geom_pointX, x1 = d3_geom_pointX, y0 = 0, y1 = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, interpolateReverse = interpolate, L = "L", tension = .7;
- function area(data) {
- var segments = [], points0 = [], points1 = [], i = -1, n = data.length, d, fx0 = d3_functor(x0), fy0 = d3_functor(y0), fx1 = x0 === x1 ? function() {
- return x;
- } : d3_functor(x1), fy1 = y0 === y1 ? function() {
- return y;
- } : d3_functor(y1), x, y;
- function segment() {
- segments.push("M", interpolate(projection(points1), tension), L, interpolateReverse(projection(points0.reverse()), tension), "Z");
- }
- while (++i < n) {
- if (defined.call(this, d = data[i], i)) {
- points0.push([ x = +fx0.call(this, d, i), y = +fy0.call(this, d, i) ]);
- points1.push([ +fx1.call(this, d, i), +fy1.call(this, d, i) ]);
- } else if (points0.length) {
- segment();
- points0 = [];
- points1 = [];
- }
- }
- if (points0.length) segment();
- return segments.length ? segments.join("") : null;
- }
- area.x = function(_) {
- if (!arguments.length) return x1;
- x0 = x1 = _;
- return area;
- };
- area.x0 = function(_) {
- if (!arguments.length) return x0;
- x0 = _;
- return area;
- };
- area.x1 = function(_) {
- if (!arguments.length) return x1;
- x1 = _;
- return area;
- };
- area.y = function(_) {
- if (!arguments.length) return y1;
- y0 = y1 = _;
- return area;
- };
- area.y0 = function(_) {
- if (!arguments.length) return y0;
- y0 = _;
- return area;
- };
- area.y1 = function(_) {
- if (!arguments.length) return y1;
- y1 = _;
- return area;
- };
- area.defined = function(_) {
- if (!arguments.length) return defined;
- defined = _;
- return area;
- };
- area.interpolate = function(_) {
- if (!arguments.length) return interpolateKey;
- if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key;
- interpolateReverse = interpolate.reverse || interpolate;
- L = interpolate.closed ? "M" : "L";
- return area;
- };
- area.tension = function(_) {
- if (!arguments.length) return tension;
- tension = _;
- return area;
- };
- return area;
- }
- d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter;
- d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore;
- d3.svg.area = function() {
- return d3_svg_area(d3_identity);
- };
- d3.svg.area.radial = function() {
- var area = d3_svg_area(d3_svg_lineRadial);
- area.radius = area.x, delete area.x;
- area.innerRadius = area.x0, delete area.x0;
- area.outerRadius = area.x1, delete area.x1;
- area.angle = area.y, delete area.y;
- area.startAngle = area.y0, delete area.y0;
- area.endAngle = area.y1, delete area.y1;
- return area;
- };
- d3.svg.chord = function() {
- var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle;
- function chord(d, i) {
- var s = subgroup(this, source, d, i), t = subgroup(this, target, d, i);
- return "M" + s.p0 + arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t) ? curve(s.r, s.p1, s.r, s.p0) : curve(s.r, s.p1, t.r, t.p0) + arc(t.r, t.p1, t.a1 - t.a0) + curve(t.r, t.p1, s.r, s.p0)) + "Z";
- }
- function subgroup(self, f, d, i) {
- var subgroup = f.call(self, d, i), r = radius.call(self, subgroup, i), a0 = startAngle.call(self, subgroup, i) + d3_svg_arcOffset, a1 = endAngle.call(self, subgroup, i) + d3_svg_arcOffset;
- return {
- r: r,
- a0: a0,
- a1: a1,
- p0: [ r * Math.cos(a0), r * Math.sin(a0) ],
- p1: [ r * Math.cos(a1), r * Math.sin(a1) ]
- };
- }
- function equals(a, b) {
- return a.a0 == b.a0 && a.a1 == b.a1;
- }
- function arc(r, p, a) {
- return "A" + r + "," + r + " 0 " + +(a > π) + ",1 " + p;
- }
- function curve(r0, p0, r1, p1) {
- return "Q 0,0 " + p1;
- }
- chord.radius = function(v) {
- if (!arguments.length) return radius;
- radius = d3_functor(v);
- return chord;
- };
- chord.source = function(v) {
- if (!arguments.length) return source;
- source = d3_functor(v);
- return chord;
- };
- chord.target = function(v) {
- if (!arguments.length) return target;
- target = d3_functor(v);
- return chord;
- };
- chord.startAngle = function(v) {
- if (!arguments.length) return startAngle;
- startAngle = d3_functor(v);
- return chord;
- };
- chord.endAngle = function(v) {
- if (!arguments.length) return endAngle;
- endAngle = d3_functor(v);
- return chord;
- };
- return chord;
- };
- function d3_svg_chordRadius(d) {
- return d.radius;
- }
- d3.svg.diagonal = function() {
- var source = d3_source, target = d3_target, projection = d3_svg_diagonalProjection;
- function diagonal(d, i) {
- var p0 = source.call(this, d, i), p3 = target.call(this, d, i), m = (p0.y + p3.y) / 2, p = [ p0, {
- x: p0.x,
- y: m
- }, {
- x: p3.x,
- y: m
- }, p3 ];
- p = p.map(projection);
- return "M" + p[0] + "C" + p[1] + " " + p[2] + " " + p[3];
- }
- diagonal.source = function(x) {
- if (!arguments.length) return source;
- source = d3_functor(x);
- return diagonal;
- };
- diagonal.target = function(x) {
- if (!arguments.length) return target;
- target = d3_functor(x);
- return diagonal;
- };
- diagonal.projection = function(x) {
- if (!arguments.length) return projection;
- projection = x;
- return diagonal;
- };
- return diagonal;
- };
- function d3_svg_diagonalProjection(d) {
- return [ d.x, d.y ];
- }
- d3.svg.diagonal.radial = function() {
- var diagonal = d3.svg.diagonal(), projection = d3_svg_diagonalProjection, projection_ = diagonal.projection;
- diagonal.projection = function(x) {
- return arguments.length ? projection_(d3_svg_diagonalRadialProjection(projection = x)) : projection;
- };
- return diagonal;
- };
- function d3_svg_diagonalRadialProjection(projection) {
- return function() {
- var d = projection.apply(this, arguments), r = d[0], a = d[1] + d3_svg_arcOffset;
- return [ r * Math.cos(a), r * Math.sin(a) ];
- };
- }
- d3.svg.symbol = function() {
- var type = d3_svg_symbolType, size = d3_svg_symbolSize;
- function symbol(d, i) {
- return (d3_svg_symbols.get(type.call(this, d, i)) || d3_svg_symbolCircle)(size.call(this, d, i));
- }
- symbol.type = function(x) {
- if (!arguments.length) return type;
- type = d3_functor(x);
- return symbol;
- };
- symbol.size = function(x) {
- if (!arguments.length) return size;
- size = d3_functor(x);
- return symbol;
- };
- return symbol;
- };
- function d3_svg_symbolSize() {
- return 64;
- }
- function d3_svg_symbolType() {
- return "circle";
- }
- function d3_svg_symbolCircle(size) {
- var r = Math.sqrt(size / π);
- return "M0," + r + "A" + r + "," + r + " 0 1,1 0," + -r + "A" + r + "," + r + " 0 1,1 0," + r + "Z";
- }
- var d3_svg_symbols = d3.map({
- circle: d3_svg_symbolCircle,
- cross: function(size) {
- var r = Math.sqrt(size / 5) / 2;
- return "M" + -3 * r + "," + -r + "H" + -r + "V" + -3 * r + "H" + r + "V" + -r + "H" + 3 * r + "V" + r + "H" + r + "V" + 3 * r + "H" + -r + "V" + r + "H" + -3 * r + "Z";
- },
- diamond: function(size) {
- var ry = Math.sqrt(size / (2 * d3_svg_symbolTan30)), rx = ry * d3_svg_symbolTan30;
- return "M0," + -ry + "L" + rx + ",0" + " 0," + ry + " " + -rx + ",0" + "Z";
- },
- square: function(size) {
- var r = Math.sqrt(size) / 2;
- return "M" + -r + "," + -r + "L" + r + "," + -r + " " + r + "," + r + " " + -r + "," + r + "Z";
- },
- "triangle-down": function(size) {
- var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2;
- return "M0," + ry + "L" + rx + "," + -ry + " " + -rx + "," + -ry + "Z";
- },
- "triangle-up": function(size) {
- var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2;
- return "M0," + -ry + "L" + rx + "," + ry + " " + -rx + "," + ry + "Z";
- }
- });
- d3.svg.symbolTypes = d3_svg_symbols.keys();
- var d3_svg_symbolSqrt3 = Math.sqrt(3), d3_svg_symbolTan30 = Math.tan(30 * d3_radians);
- function d3_transition(groups, id) {
- d3_subclass(groups, d3_transitionPrototype);
- groups.id = id;
- return groups;
- }
- var d3_transitionPrototype = [], d3_transitionId = 0, d3_transitionInheritId, d3_transitionInherit;
- d3_transitionPrototype.call = d3_selectionPrototype.call;
- d3_transitionPrototype.empty = d3_selectionPrototype.empty;
- d3_transitionPrototype.node = d3_selectionPrototype.node;
- d3_transitionPrototype.size = d3_selectionPrototype.size;
- d3.transition = function(selection) {
- return arguments.length ? d3_transitionInheritId ? selection.transition() : selection : d3_selectionRoot.transition();
- };
- d3.transition.prototype = d3_transitionPrototype;
- d3_transitionPrototype.select = function(selector) {
- var id = this.id, subgroups = [], subgroup, subnode, node;
- selector = d3_selection_selector(selector);
- for (var j = -1, m = this.length; ++j < m; ) {
- subgroups.push(subgroup = []);
- for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
- if ((node = group[i]) && (subnode = selector.call(node, node.__data__, i, j))) {
- if ("__data__" in node) subnode.__data__ = node.__data__;
- d3_transitionNode(subnode, i, id, node.__transition__[id]);
- subgroup.push(subnode);
- } else {
- subgroup.push(null);
- }
- }
- }
- return d3_transition(subgroups, id);
- };
- d3_transitionPrototype.selectAll = function(selector) {
- var id = this.id, subgroups = [], subgroup, subnodes, node, subnode, transition;
- selector = d3_selection_selectorAll(selector);
- for (var j = -1, m = this.length; ++j < m; ) {
- for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
- if (node = group[i]) {
- transition = node.__transition__[id];
- subnodes = selector.call(node, node.__data__, i, j);
- subgroups.push(subgroup = []);
- for (var k = -1, o = subnodes.length; ++k < o; ) {
- if (subnode = subnodes[k]) d3_transitionNode(subnode, k, id, transition);
- subgroup.push(subnode);
- }
- }
- }
- }
- return d3_transition(subgroups, id);
- };
- d3_transitionPrototype.filter = function(filter) {
- var subgroups = [], subgroup, group, node;
- if (typeof filter !== "function") filter = d3_selection_filter(filter);
- for (var j = 0, m = this.length; j < m; j++) {
- subgroups.push(subgroup = []);
- for (var group = this[j], i = 0, n = group.length; i < n; i++) {
- if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {
- subgroup.push(node);
- }
- }
- }
- return d3_transition(subgroups, this.id);
- };
- d3_transitionPrototype.tween = function(name, tween) {
- var id = this.id;
- if (arguments.length < 2) return this.node().__transition__[id].tween.get(name);
- return d3_selection_each(this, tween == null ? function(node) {
- node.__transition__[id].tween.remove(name);
- } : function(node) {
- node.__transition__[id].tween.set(name, tween);
- });
- };
- function d3_transition_tween(groups, name, value, tween) {
- var id = groups.id;
- return d3_selection_each(groups, typeof value === "function" ? function(node, i, j) {
- node.__transition__[id].tween.set(name, tween(value.call(node, node.__data__, i, j)));
- } : (value = tween(value), function(node) {
- node.__transition__[id].tween.set(name, value);
- }));
- }
- d3_transitionPrototype.attr = function(nameNS, value) {
- if (arguments.length < 2) {
- for (value in nameNS) this.attr(value, nameNS[value]);
- return this;
- }
- var interpolate = nameNS == "transform" ? d3_interpolateTransform : d3_interpolate, name = d3.ns.qualify(nameNS);
- function attrNull() {
- this.removeAttribute(name);
- }
- function attrNullNS() {
- this.removeAttributeNS(name.space, name.local);
- }
- function attrTween(b) {
- return b == null ? attrNull : (b += "", function() {
- var a = this.getAttribute(name), i;
- return a !== b && (i = interpolate(a, b), function(t) {
- this.setAttribute(name, i(t));
- });
- });
- }
- function attrTweenNS(b) {
- return b == null ? attrNullNS : (b += "", function() {
- var a = this.getAttributeNS(name.space, name.local), i;
- return a !== b && (i = interpolate(a, b), function(t) {
- this.setAttributeNS(name.space, name.local, i(t));
- });
- });
- }
- return d3_transition_tween(this, "attr." + nameNS, value, name.local ? attrTweenNS : attrTween);
- };
- d3_transitionPrototype.attrTween = function(nameNS, tween) {
- var name = d3.ns.qualify(nameNS);
- function attrTween(d, i) {
- var f = tween.call(this, d, i, this.getAttribute(name));
- return f && function(t) {
- this.setAttribute(name, f(t));
- };
- }
- function attrTweenNS(d, i) {
- var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local));
- return f && function(t) {
- this.setAttributeNS(name.space, name.local, f(t));
- };
- }
- return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween);
- };
- d3_transitionPrototype.style = function(name, value, priority) {
- var n = arguments.length;
- if (n < 3) {
- if (typeof name !== "string") {
- if (n < 2) value = "";
- for (priority in name) this.style(priority, name[priority], value);
- return this;
- }
- priority = "";
- }
- function styleNull() {
- this.style.removeProperty(name);
- }
- function styleString(b) {
- return b == null ? styleNull : (b += "", function() {
- var a = d3_window.getComputedStyle(this, null).getPropertyValue(name), i;
- return a !== b && (i = d3_interpolate(a, b), function(t) {
- this.style.setProperty(name, i(t), priority);
- });
- });
- }
- return d3_transition_tween(this, "style." + name, value, styleString);
- };
- d3_transitionPrototype.styleTween = function(name, tween, priority) {
- if (arguments.length < 3) priority = "";
- function styleTween(d, i) {
- var f = tween.call(this, d, i, d3_window.getComputedStyle(this, null).getPropertyValue(name));
- return f && function(t) {
- this.style.setProperty(name, f(t), priority);
- };
- }
- return this.tween("style." + name, styleTween);
- };
- d3_transitionPrototype.text = function(value) {
- return d3_transition_tween(this, "text", value, d3_transition_text);
- };
- function d3_transition_text(b) {
- if (b == null) b = "";
- return function() {
- this.textContent = b;
- };
- }
- d3_transitionPrototype.remove = function() {
- return this.each("end.transition", function() {
- var p;
- if (this.__transition__.count < 2 && (p = this.parentNode)) p.removeChild(this);
- });
- };
- d3_transitionPrototype.ease = function(value) {
- var id = this.id;
- if (arguments.length < 1) return this.node().__transition__[id].ease;
- if (typeof value !== "function") value = d3.ease.apply(d3, arguments);
- return d3_selection_each(this, function(node) {
- node.__transition__[id].ease = value;
- });
- };
- d3_transitionPrototype.delay = function(value) {
- var id = this.id;
- if (arguments.length < 1) return this.node().__transition__[id].delay;
- return d3_selection_each(this, typeof value === "function" ? function(node, i, j) {
- node.__transition__[id].delay = +value.call(node, node.__data__, i, j);
- } : (value = +value, function(node) {
- node.__transition__[id].delay = value;
- }));
- };
- d3_transitionPrototype.duration = function(value) {
- var id = this.id;
- if (arguments.length < 1) return this.node().__transition__[id].duration;
- return d3_selection_each(this, typeof value === "function" ? function(node, i, j) {
- node.__transition__[id].duration = Math.max(1, value.call(node, node.__data__, i, j));
- } : (value = Math.max(1, value), function(node) {
- node.__transition__[id].duration = value;
- }));
- };
- d3_transitionPrototype.each = function(type, listener) {
- var id = this.id;
- if (arguments.length < 2) {
- var inherit = d3_transitionInherit, inheritId = d3_transitionInheritId;
- d3_transitionInheritId = id;
- d3_selection_each(this, function(node, i, j) {
- d3_transitionInherit = node.__transition__[id];
- type.call(node, node.__data__, i, j);
- });
- d3_transitionInherit = inherit;
- d3_transitionInheritId = inheritId;
- } else {
- d3_selection_each(this, function(node) {
- var transition = node.__transition__[id];
- (transition.event || (transition.event = d3.dispatch("start", "end"))).on(type, listener);
- });
- }
- return this;
- };
- d3_transitionPrototype.transition = function() {
- var id0 = this.id, id1 = ++d3_transitionId, subgroups = [], subgroup, group, node, transition;
- for (var j = 0, m = this.length; j < m; j++) {
- subgroups.push(subgroup = []);
- for (var group = this[j], i = 0, n = group.length; i < n; i++) {
- if (node = group[i]) {
- transition = Object.create(node.__transition__[id0]);
- transition.delay += transition.duration;
- d3_transitionNode(node, i, id1, transition);
- }
- subgroup.push(node);
- }
- }
- return d3_transition(subgroups, id1);
- };
- function d3_transitionNode(node, i, id, inherit) {
- var lock = node.__transition__ || (node.__transition__ = {
- active: 0,
- count: 0
- }), transition = lock[id];
- if (!transition) {
- var time = inherit.time;
- transition = lock[id] = {
- tween: new d3_Map(),
- time: time,
- ease: inherit.ease,
- delay: inherit.delay,
- duration: inherit.duration
- };
- ++lock.count;
- d3.timer(function(elapsed) {
- var d = node.__data__, ease = transition.ease, delay = transition.delay, duration = transition.duration, timer = d3_timer_active, tweened = [];
- timer.t = delay + time;
- if (delay <= elapsed) return start(elapsed - delay);
- timer.c = start;
- function start(elapsed) {
- if (lock.active > id) return stop();
- lock.active = id;
- transition.event && transition.event.start.call(node, d, i);
- transition.tween.forEach(function(key, value) {
- if (value = value.call(node, d, i)) {
- tweened.push(value);
- }
- });
- d3.timer(function() {
- timer.c = tick(elapsed || 1) ? d3_true : tick;
- return 1;
- }, 0, time);
- }
- function tick(elapsed) {
- if (lock.active !== id) return stop();
- var t = elapsed / duration, e = ease(t), n = tweened.length;
- while (n > 0) {
- tweened[--n].call(node, e);
- }
- if (t >= 1) {
- transition.event && transition.event.end.call(node, d, i);
- return stop();
- }
- }
- function stop() {
- if (--lock.count) delete lock[id]; else delete node.__transition__;
- return 1;
- }
- }, 0, time);
- }
- }
- d3.svg.axis = function() {
- var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, innerTickSize = 6, outerTickSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_;
- function axis(g) {
- g.each(function() {
- var g = d3.select(this);
- var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy();
- var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick.order()).style("opacity", 1), tickTransform;
- var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"),
- d3.transition(path));
- tickEnter.append("line");
- tickEnter.append("text");
- var lineEnter = tickEnter.select("line"), lineUpdate = tickUpdate.select("line"), text = tick.select("text").text(tickFormat), textEnter = tickEnter.select("text"), textUpdate = tickUpdate.select("text");
- switch (orient) {
- case "bottom":
- {
- tickTransform = d3_svg_axisX;
- lineEnter.attr("y2", innerTickSize);
- textEnter.attr("y", Math.max(innerTickSize, 0) + tickPadding);
- lineUpdate.attr("x2", 0).attr("y2", innerTickSize);
- textUpdate.attr("x", 0).attr("y", Math.max(innerTickSize, 0) + tickPadding);
- text.attr("dy", ".71em").style("text-anchor", "middle");
- pathUpdate.attr("d", "M" + range[0] + "," + outerTickSize + "V0H" + range[1] + "V" + outerTickSize);
- break;
- }
-
- case "top":
- {
- tickTransform = d3_svg_axisX;
- lineEnter.attr("y2", -innerTickSize);
- textEnter.attr("y", -(Math.max(innerTickSize, 0) + tickPadding));
- lineUpdate.attr("x2", 0).attr("y2", -innerTickSize);
- textUpdate.attr("x", 0).attr("y", -(Math.max(innerTickSize, 0) + tickPadding));
- text.attr("dy", "0em").style("text-anchor", "middle");
- pathUpdate.attr("d", "M" + range[0] + "," + -outerTickSize + "V0H" + range[1] + "V" + -outerTickSize);
- break;
- }
-
- case "left":
- {
- tickTransform = d3_svg_axisY;
- lineEnter.attr("x2", -innerTickSize);
- textEnter.attr("x", -(Math.max(innerTickSize, 0) + tickPadding));
- lineUpdate.attr("x2", -innerTickSize).attr("y2", 0);
- textUpdate.attr("x", -(Math.max(innerTickSize, 0) + tickPadding)).attr("y", 0);
- text.attr("dy", ".32em").style("text-anchor", "end");
- pathUpdate.attr("d", "M" + -outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + -outerTickSize);
- break;
- }
-
- case "right":
- {
- tickTransform = d3_svg_axisY;
- lineEnter.attr("x2", innerTickSize);
- textEnter.attr("x", Math.max(innerTickSize, 0) + tickPadding);
- lineUpdate.attr("x2", innerTickSize).attr("y2", 0);
- textUpdate.attr("x", Math.max(innerTickSize, 0) + tickPadding).attr("y", 0);
- text.attr("dy", ".32em").style("text-anchor", "start");
- pathUpdate.attr("d", "M" + outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + outerTickSize);
- break;
- }
- }
- if (scale1.rangeBand) {
- var x = scale1, dx = x.rangeBand() / 2;
- scale0 = scale1 = function(d) {
- return x(d) + dx;
- };
- } else if (scale0.rangeBand) {
- scale0 = scale1;
- } else {
- tickExit.call(tickTransform, scale1);
- }
- tickEnter.call(tickTransform, scale0);
- tickUpdate.call(tickTransform, scale1);
- });
- }
- axis.scale = function(x) {
- if (!arguments.length) return scale;
- scale = x;
- return axis;
- };
- axis.orient = function(x) {
- if (!arguments.length) return orient;
- orient = x in d3_svg_axisOrients ? x + "" : d3_svg_axisDefaultOrient;
- return axis;
- };
- axis.ticks = function() {
- if (!arguments.length) return tickArguments_;
- tickArguments_ = arguments;
- return axis;
- };
- axis.tickValues = function(x) {
- if (!arguments.length) return tickValues;
- tickValues = x;
- return axis;
- };
- axis.tickFormat = function(x) {
- if (!arguments.length) return tickFormat_;
- tickFormat_ = x;
- return axis;
- };
- axis.tickSize = function(x) {
- var n = arguments.length;
- if (!n) return innerTickSize;
- innerTickSize = +x;
- outerTickSize = +arguments[n - 1];
- return axis;
- };
- axis.innerTickSize = function(x) {
- if (!arguments.length) return innerTickSize;
- innerTickSize = +x;
- return axis;
- };
- axis.outerTickSize = function(x) {
- if (!arguments.length) return outerTickSize;
- outerTickSize = +x;
- return axis;
- };
- axis.tickPadding = function(x) {
- if (!arguments.length) return tickPadding;
- tickPadding = +x;
- return axis;
- };
- axis.tickSubdivide = function() {
- return arguments.length && axis;
- };
- return axis;
- };
- var d3_svg_axisDefaultOrient = "bottom", d3_svg_axisOrients = {
- top: 1,
- right: 1,
- bottom: 1,
- left: 1
- };
- function d3_svg_axisX(selection, x) {
- selection.attr("transform", function(d) {
- return "translate(" + x(d) + ",0)";
- });
- }
- function d3_svg_axisY(selection, y) {
- selection.attr("transform", function(d) {
- return "translate(0," + y(d) + ")";
- });
- }
- d3.svg.brush = function() {
- var event = d3_eventDispatch(brush, "brushstart", "brush", "brushend"), x = null, y = null, xExtent = [ 0, 0 ], yExtent = [ 0, 0 ], xExtentDomain, yExtentDomain, xClamp = true, yClamp = true, resizes = d3_svg_brushResizes[0];
- function brush(g) {
- g.each(function() {
- var g = d3.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", brushstart).on("touchstart.brush", brushstart);
- var background = g.selectAll(".background").data([ 0 ]);
- background.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair");
- g.selectAll(".extent").data([ 0 ]).enter().append("rect").attr("class", "extent").style("cursor", "move");
- var resize = g.selectAll(".resize").data(resizes, d3_identity);
- resize.exit().remove();
- resize.enter().append("g").attr("class", function(d) {
- return "resize " + d;
- }).style("cursor", function(d) {
- return d3_svg_brushCursor[d];
- }).append("rect").attr("x", function(d) {
- return /[ew]$/.test(d) ? -3 : null;
- }).attr("y", function(d) {
- return /^[ns]/.test(d) ? -3 : null;
- }).attr("width", 6).attr("height", 6).style("visibility", "hidden");
- resize.style("display", brush.empty() ? "none" : null);
- var gUpdate = d3.transition(g), backgroundUpdate = d3.transition(background), range;
- if (x) {
- range = d3_scaleRange(x);
- backgroundUpdate.attr("x", range[0]).attr("width", range[1] - range[0]);
- redrawX(gUpdate);
- }
- if (y) {
- range = d3_scaleRange(y);
- backgroundUpdate.attr("y", range[0]).attr("height", range[1] - range[0]);
- redrawY(gUpdate);
- }
- redraw(gUpdate);
- });
- }
- brush.event = function(g) {
- g.each(function() {
- var event_ = event.of(this, arguments), extent1 = {
- x: xExtent,
- y: yExtent,
- i: xExtentDomain,
- j: yExtentDomain
- }, extent0 = this.__chart__ || extent1;
- this.__chart__ = extent1;
- if (d3_transitionInheritId) {
- d3.select(this).transition().each("start.brush", function() {
- xExtentDomain = extent0.i;
- yExtentDomain = extent0.j;
- xExtent = extent0.x;
- yExtent = extent0.y;
- event_({
- type: "brushstart"
- });
- }).tween("brush:brush", function() {
- var xi = d3_interpolateArray(xExtent, extent1.x), yi = d3_interpolateArray(yExtent, extent1.y);
- xExtentDomain = yExtentDomain = null;
- return function(t) {
- xExtent = extent1.x = xi(t);
- yExtent = extent1.y = yi(t);
- event_({
- type: "brush",
- mode: "resize"
- });
- };
- }).each("end.brush", function() {
- xExtentDomain = extent1.i;
- yExtentDomain = extent1.j;
- event_({
- type: "brush",
- mode: "resize"
- });
- event_({
- type: "brushend"
- });
- });
- } else {
- event_({
- type: "brushstart"
- });
- event_({
- type: "brush",
- mode: "resize"
- });
- event_({
- type: "brushend"
- });
- }
- });
- };
- function redraw(g) {
- g.selectAll(".resize").attr("transform", function(d) {
- return "translate(" + xExtent[+/e$/.test(d)] + "," + yExtent[+/^s/.test(d)] + ")";
- });
- }
- function redrawX(g) {
- g.select(".extent").attr("x", xExtent[0]);
- g.selectAll(".extent,.n>rect,.s>rect").attr("width", xExtent[1] - xExtent[0]);
- }
- function redrawY(g) {
- g.select(".extent").attr("y", yExtent[0]);
- g.selectAll(".extent,.e>rect,.w>rect").attr("height", yExtent[1] - yExtent[0]);
- }
- function brushstart() {
- var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed("extent"), dragRestore = d3_event_dragSuppress(), center, origin = d3.mouse(target), offset;
- var w = d3.select(d3_window).on("keydown.brush", keydown).on("keyup.brush", keyup);
- if (d3.event.changedTouches) {
- w.on("touchmove.brush", brushmove).on("touchend.brush", brushend);
- } else {
- w.on("mousemove.brush", brushmove).on("mouseup.brush", brushend);
- }
- g.interrupt().selectAll("*").interrupt();
- if (dragging) {
- origin[0] = xExtent[0] - origin[0];
- origin[1] = yExtent[0] - origin[1];
- } else if (resizing) {
- var ex = +/w$/.test(resizing), ey = +/^n/.test(resizing);
- offset = [ xExtent[1 - ex] - origin[0], yExtent[1 - ey] - origin[1] ];
- origin[0] = xExtent[ex];
- origin[1] = yExtent[ey];
- } else if (d3.event.altKey) center = origin.slice();
- g.style("pointer-events", "none").selectAll(".resize").style("display", null);
- d3.select("body").style("cursor", eventTarget.style("cursor"));
- event_({
- type: "brushstart"
- });
- brushmove();
- function keydown() {
- if (d3.event.keyCode == 32) {
- if (!dragging) {
- center = null;
- origin[0] -= xExtent[1];
- origin[1] -= yExtent[1];
- dragging = 2;
- }
- d3_eventPreventDefault();
- }
- }
- function keyup() {
- if (d3.event.keyCode == 32 && dragging == 2) {
- origin[0] += xExtent[1];
- origin[1] += yExtent[1];
- dragging = 0;
- d3_eventPreventDefault();
- }
- }
- function brushmove() {
- var point = d3.mouse(target), moved = false;
- if (offset) {
- point[0] += offset[0];
- point[1] += offset[1];
- }
- if (!dragging) {
- if (d3.event.altKey) {
- if (!center) center = [ (xExtent[0] + xExtent[1]) / 2, (yExtent[0] + yExtent[1]) / 2 ];
- origin[0] = xExtent[+(point[0] < center[0])];
- origin[1] = yExtent[+(point[1] < center[1])];
- } else center = null;
- }
- if (resizingX && move1(point, x, 0)) {
- redrawX(g);
- moved = true;
- }
- if (resizingY && move1(point, y, 1)) {
- redrawY(g);
- moved = true;
- }
- if (moved) {
- redraw(g);
- event_({
- type: "brush",
- mode: dragging ? "move" : "resize"
- });
- }
- }
- function move1(point, scale, i) {
- var range = d3_scaleRange(scale), r0 = range[0], r1 = range[1], position = origin[i], extent = i ? yExtent : xExtent, size = extent[1] - extent[0], min, max;
- if (dragging) {
- r0 -= position;
- r1 -= size + position;
- }
- min = (i ? yClamp : xClamp) ? Math.max(r0, Math.min(r1, point[i])) : point[i];
- if (dragging) {
- max = (min += position) + size;
- } else {
- if (center) position = Math.max(r0, Math.min(r1, 2 * center[i] - min));
- if (position < min) {
- max = min;
- min = position;
- } else {
- max = position;
- }
- }
- if (extent[0] != min || extent[1] != max) {
- if (i) yExtentDomain = null; else xExtentDomain = null;
- extent[0] = min;
- extent[1] = max;
- return true;
- }
- }
- function brushend() {
- brushmove();
- g.style("pointer-events", "all").selectAll(".resize").style("display", brush.empty() ? "none" : null);
- d3.select("body").style("cursor", null);
- w.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null);
- dragRestore();
- event_({
- type: "brushend"
- });
- }
- }
- brush.x = function(z) {
- if (!arguments.length) return x;
- x = z;
- resizes = d3_svg_brushResizes[!x << 1 | !y];
- return brush;
- };
- brush.y = function(z) {
- if (!arguments.length) return y;
- y = z;
- resizes = d3_svg_brushResizes[!x << 1 | !y];
- return brush;
- };
- brush.clamp = function(z) {
- if (!arguments.length) return x && y ? [ xClamp, yClamp ] : x ? xClamp : y ? yClamp : null;
- if (x && y) xClamp = !!z[0], yClamp = !!z[1]; else if (x) xClamp = !!z; else if (y) yClamp = !!z;
- return brush;
- };
- brush.extent = function(z) {
- var x0, x1, y0, y1, t;
- if (!arguments.length) {
- if (x) {
- if (xExtentDomain) {
- x0 = xExtentDomain[0], x1 = xExtentDomain[1];
- } else {
- x0 = xExtent[0], x1 = xExtent[1];
- if (x.invert) x0 = x.invert(x0), x1 = x.invert(x1);
- if (x1 < x0) t = x0, x0 = x1, x1 = t;
- }
- }
- if (y) {
- if (yExtentDomain) {
- y0 = yExtentDomain[0], y1 = yExtentDomain[1];
- } else {
- y0 = yExtent[0], y1 = yExtent[1];
- if (y.invert) y0 = y.invert(y0), y1 = y.invert(y1);
- if (y1 < y0) t = y0, y0 = y1, y1 = t;
- }
- }
- return x && y ? [ [ x0, y0 ], [ x1, y1 ] ] : x ? [ x0, x1 ] : y && [ y0, y1 ];
- }
- if (x) {
- x0 = z[0], x1 = z[1];
- if (y) x0 = x0[0], x1 = x1[0];
- xExtentDomain = [ x0, x1 ];
- if (x.invert) x0 = x(x0), x1 = x(x1);
- if (x1 < x0) t = x0, x0 = x1, x1 = t;
- if (x0 != xExtent[0] || x1 != xExtent[1]) xExtent = [ x0, x1 ];
- }
- if (y) {
- y0 = z[0], y1 = z[1];
- if (x) y0 = y0[1], y1 = y1[1];
- yExtentDomain = [ y0, y1 ];
- if (y.invert) y0 = y(y0), y1 = y(y1);
- if (y1 < y0) t = y0, y0 = y1, y1 = t;
- if (y0 != yExtent[0] || y1 != yExtent[1]) yExtent = [ y0, y1 ];
- }
- return brush;
- };
- brush.clear = function() {
- if (!brush.empty()) {
- xExtent = [ 0, 0 ], yExtent = [ 0, 0 ];
- xExtentDomain = yExtentDomain = null;
- }
- return brush;
- };
- brush.empty = function() {
- return !!x && xExtent[0] == xExtent[1] || !!y && yExtent[0] == yExtent[1];
- };
- return d3.rebind(brush, event, "on");
- };
- var d3_svg_brushCursor = {
- n: "ns-resize",
- e: "ew-resize",
- s: "ns-resize",
- w: "ew-resize",
- nw: "nwse-resize",
- ne: "nesw-resize",
- se: "nwse-resize",
- sw: "nesw-resize"
- };
- var d3_svg_brushResizes = [ [ "n", "e", "s", "w", "nw", "ne", "se", "sw" ], [ "e", "w" ], [ "n", "s" ], [] ];
- var d3_time_format = d3_time.format = d3_locale_enUS.timeFormat;
- var d3_time_formatUtc = d3_time_format.utc;
- var d3_time_formatIso = d3_time_formatUtc("%Y-%m-%dT%H:%M:%S.%LZ");
- d3_time_format.iso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z") ? d3_time_formatIsoNative : d3_time_formatIso;
- function d3_time_formatIsoNative(date) {
- return date.toISOString();
- }
- d3_time_formatIsoNative.parse = function(string) {
- var date = new Date(string);
- return isNaN(date) ? null : date;
- };
- d3_time_formatIsoNative.toString = d3_time_formatIso.toString;
- d3_time.second = d3_time_interval(function(date) {
- return new d3_date(Math.floor(date / 1e3) * 1e3);
- }, function(date, offset) {
- date.setTime(date.getTime() + Math.floor(offset) * 1e3);
- }, function(date) {
- return date.getSeconds();
- });
- d3_time.seconds = d3_time.second.range;
- d3_time.seconds.utc = d3_time.second.utc.range;
- d3_time.minute = d3_time_interval(function(date) {
- return new d3_date(Math.floor(date / 6e4) * 6e4);
- }, function(date, offset) {
- date.setTime(date.getTime() + Math.floor(offset) * 6e4);
- }, function(date) {
- return date.getMinutes();
- });
- d3_time.minutes = d3_time.minute.range;
- d3_time.minutes.utc = d3_time.minute.utc.range;
- d3_time.hour = d3_time_interval(function(date) {
- var timezone = date.getTimezoneOffset() / 60;
- return new d3_date((Math.floor(date / 36e5 - timezone) + timezone) * 36e5);
- }, function(date, offset) {
- date.setTime(date.getTime() + Math.floor(offset) * 36e5);
- }, function(date) {
- return date.getHours();
- });
- d3_time.hours = d3_time.hour.range;
- d3_time.hours.utc = d3_time.hour.utc.range;
- d3_time.month = d3_time_interval(function(date) {
- date = d3_time.day(date);
- date.setDate(1);
- return date;
- }, function(date, offset) {
- date.setMonth(date.getMonth() + offset);
- }, function(date) {
- return date.getMonth();
- });
- d3_time.months = d3_time.month.range;
- d3_time.months.utc = d3_time.month.utc.range;
- function d3_time_scale(linear, methods, format) {
- function scale(x) {
- return linear(x);
- }
- scale.invert = function(x) {
- return d3_time_scaleDate(linear.invert(x));
- };
- scale.domain = function(x) {
- if (!arguments.length) return linear.domain().map(d3_time_scaleDate);
- linear.domain(x);
- return scale;
- };
- function tickMethod(extent, count) {
- var span = extent[1] - extent[0], target = span / count, i = d3.bisect(d3_time_scaleSteps, target);
- return i == d3_time_scaleSteps.length ? [ methods.year, d3_scale_linearTickRange(extent.map(function(d) {
- return d / 31536e6;
- }), count)[2] ] : !i ? [ d3_time_scaleMilliseconds, d3_scale_linearTickRange(extent, count)[2] ] : methods[target / d3_time_scaleSteps[i - 1] < d3_time_scaleSteps[i] / target ? i - 1 : i];
- }
- scale.nice = function(interval, skip) {
- var domain = scale.domain(), extent = d3_scaleExtent(domain), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" && tickMethod(extent, interval);
- if (method) interval = method[0], skip = method[1];
- function skipped(date) {
- return !isNaN(date) && !interval.range(date, d3_time_scaleDate(+date + 1), skip).length;
- }
- return scale.domain(d3_scale_nice(domain, skip > 1 ? {
- floor: function(date) {
- while (skipped(date = interval.floor(date))) date = d3_time_scaleDate(date - 1);
- return date;
- },
- ceil: function(date) {
- while (skipped(date = interval.ceil(date))) date = d3_time_scaleDate(+date + 1);
- return date;
- }
- } : interval));
- };
- scale.ticks = function(interval, skip) {
- var extent = d3_scaleExtent(scale.domain()), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" ? tickMethod(extent, interval) : !interval.range && [ {
- range: interval
- }, skip ];
- if (method) interval = method[0], skip = method[1];
- return interval.range(extent[0], d3_time_scaleDate(+extent[1] + 1), skip < 1 ? 1 : skip);
- };
- scale.tickFormat = function() {
- return format;
- };
- scale.copy = function() {
- return d3_time_scale(linear.copy(), methods, format);
- };
- return d3_scale_linearRebind(scale, linear);
- }
- function d3_time_scaleDate(t) {
- return new Date(t);
- }
- var d3_time_scaleSteps = [ 1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6 ];
- var d3_time_scaleLocalMethods = [ [ d3_time.second, 1 ], [ d3_time.second, 5 ], [ d3_time.second, 15 ], [ d3_time.second, 30 ], [ d3_time.minute, 1 ], [ d3_time.minute, 5 ], [ d3_time.minute, 15 ], [ d3_time.minute, 30 ], [ d3_time.hour, 1 ], [ d3_time.hour, 3 ], [ d3_time.hour, 6 ], [ d3_time.hour, 12 ], [ d3_time.day, 1 ], [ d3_time.day, 2 ], [ d3_time.week, 1 ], [ d3_time.month, 1 ], [ d3_time.month, 3 ], [ d3_time.year, 1 ] ];
- var d3_time_scaleLocalFormat = d3_time_format.multi([ [ ".%L", function(d) {
- return d.getMilliseconds();
- } ], [ ":%S", function(d) {
- return d.getSeconds();
- } ], [ "%I:%M", function(d) {
- return d.getMinutes();
- } ], [ "%I %p", function(d) {
- return d.getHours();
- } ], [ "%a %d", function(d) {
- return d.getDay() && d.getDate() != 1;
- } ], [ "%b %d", function(d) {
- return d.getDate() != 1;
- } ], [ "%B", function(d) {
- return d.getMonth();
- } ], [ "%Y", d3_true ] ]);
- var d3_time_scaleMilliseconds = {
- range: function(start, stop, step) {
- return d3.range(Math.ceil(start / step) * step, +stop, step).map(d3_time_scaleDate);
- },
- floor: d3_identity,
- ceil: d3_identity
- };
- d3_time_scaleLocalMethods.year = d3_time.year;
- d3_time.scale = function() {
- return d3_time_scale(d3.scale.linear(), d3_time_scaleLocalMethods, d3_time_scaleLocalFormat);
- };
- var d3_time_scaleUtcMethods = d3_time_scaleLocalMethods.map(function(m) {
- return [ m[0].utc, m[1] ];
- });
- var d3_time_scaleUtcFormat = d3_time_formatUtc.multi([ [ ".%L", function(d) {
- return d.getUTCMilliseconds();
- } ], [ ":%S", function(d) {
- return d.getUTCSeconds();
- } ], [ "%I:%M", function(d) {
- return d.getUTCMinutes();
- } ], [ "%I %p", function(d) {
- return d.getUTCHours();
- } ], [ "%a %d", function(d) {
- return d.getUTCDay() && d.getUTCDate() != 1;
- } ], [ "%b %d", function(d) {
- return d.getUTCDate() != 1;
- } ], [ "%B", function(d) {
- return d.getUTCMonth();
- } ], [ "%Y", d3_true ] ]);
- d3_time_scaleUtcMethods.year = d3_time.year.utc;
- d3_time.scale.utc = function() {
- return d3_time_scale(d3.scale.linear(), d3_time_scaleUtcMethods, d3_time_scaleUtcFormat);
- };
- d3.text = d3_xhrType(function(request) {
- return request.responseText;
- });
- d3.json = function(url, callback) {
- return d3_xhr(url, "application/json", d3_json, callback);
- };
- function d3_json(request) {
- return JSON.parse(request.responseText);
- }
- d3.html = function(url, callback) {
- return d3_xhr(url, "text/html", d3_html, callback);
- };
- function d3_html(request) {
- var range = d3_document.createRange();
- range.selectNode(d3_document.body);
- return range.createContextualFragment(request.responseText);
- }
- d3.xml = d3_xhrType(function(request) {
- return request.responseXML;
- });
- if (typeof define === "function" && define.amd) define(d3); else if (typeof module === "object" && module.exports) module.exports = d3;
- this.d3 = d3;
-}(); \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/js/echarts-all.js b/umc-iui/src/main/resources/webroot/umc-drill/js/echarts-all.js
deleted file mode 100644
index 81612a6f..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/js/echarts-all.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-!function(e){var t,n;!function(){function e(e,t){if(!t)return e;if(0===e.indexOf(".")){var n=t.split("/"),i=e.split("/"),a=n.length-1,o=i.length,r=0,s=0;e:for(var l=0;o>l;l++)switch(i[l]){case"..":if(!(a>r))break e;r++,s++;break;case".":s++;break;default:break e}return n.length=a-r,i=i.slice(s),n.concat(i).join("/")}return e}function i(t){function n(n,r){if("string"==typeof n){var s=i[n];return s||(s=o(e(n,t)),i[n]=s),s}n instanceof Array&&(r=r||function(){},r.apply(this,a(n,r,t)))}var i={};return n}function a(n,i,a){for(var s=[],l=r[a],h=0,m=Math.min(n.length,i.length);m>h;h++){var V,U=e(n[h],a);switch(U){case"require":V=l&&l.require||t;break;case"exports":V=l.exports;break;case"module":V=l;break;default:V=o(U)}s.push(V)}return s}function o(e){var t=r[e];if(!t)throw new Error("No "+e);if(!t.defined){var n=t.factory,i=n.apply(this,a(t.deps||[],n,e));"undefined"!=typeof i&&(t.exports=i),t.defined=1}return t.exports}var r={};n=function(e,t,n){r[e]={id:e,deps:t,factory:n,defined:0,exports:{},require:i(e)}},t=i("")}(),n("echarts",["echarts/echarts"],function(e){return e}),n("echarts/echarts",["require","./config","zrender/tool/util","zrender/tool/event","zrender/tool/env","zrender","zrender/config","./chart/island","./component/toolbox","./component","./component/title","./component/tooltip","./component/legend","./util/ecData","./chart","zrender/tool/color","./component/timeline","zrender/shape/Image","zrender/loadingEffect/Bar","zrender/loadingEffect/Bubble","zrender/loadingEffect/DynamicLine","zrender/loadingEffect/Ring","zrender/loadingEffect/Spin","zrender/loadingEffect/Whirling","./theme/macarons","./theme/infographic"],function(e){function t(){r.Dispatcher.call(this)}function n(e){e.innerHTML="",this._themeConfig={},this.dom=e,this._connected=!1,this._status={dragIn:!1,dragOut:!1,needRefresh:!1},this._curEventType=!1,this._chartList=[],this._messageCenter=new t,this._messageCenterOutSide=new t,this.resize=this.resize(),this._init()}function i(e,t,n,i,a){for(var o=e._chartList,r=o.length;r--;){var s=o[r];"function"==typeof s[t]&&s[t](n,i,a)}}var a=e("./config"),o=e("zrender/tool/util"),r=e("zrender/tool/event"),s={},l=e("zrender/tool/env").canvasSupported,h=new Date-0,m={},V="_echarts_instance_";s.version="2.2.0",s.dependencies={zrender:"2.0.7"},s.init=function(t,i){var a=e("zrender");a.version.replace(".","")-0<s.dependencies.zrender.replace(".","")-0&&console.error("ZRender "+a.version+" is too old for ECharts "+s.version+". Current version need ZRender "+s.dependencies.zrender+"+"),t=t instanceof Array?t[0]:t;var o=t.getAttribute(V);return o||(o=h++,t.setAttribute(V,o)),m[o]&&m[o].dispose(),m[o]=new n(t),m[o].id=o,m[o].canvasSupported=l,m[o].setTheme(i),m[o]},s.getInstanceById=function(e){return m[e]},o.merge(t.prototype,r.Dispatcher.prototype,!0);var U=e("zrender/config").EVENT,d=["CLICK","DBLCLICK","MOUSEOVER","MOUSEOUT","DRAGSTART","DRAGEND","DRAGENTER","DRAGOVER","DRAGLEAVE","DROP"];return n.prototype={_init:function(){var t=this,n=e("zrender").init(this.dom);this._zr=n,this._messageCenter.dispatch=function(e,n,i,a){i=i||{},i.type=e,i.event=n,t._messageCenter.dispatchWithContext(e,i,a),"HOVER"!=e&&"MOUSEOUT"!=e?setTimeout(function(){t._messageCenterOutSide.dispatchWithContext(e,i,a)},50):t._messageCenterOutSide.dispatchWithContext(e,i,a)},this._onevent=function(e){return t.__onevent(e)};for(var i in a.EVENT)"CLICK"!=i&&"DBLCLICK"!=i&&"HOVER"!=i&&"MOUSEOUT"!=i&&"MAP_ROAM"!=i&&this._messageCenter.bind(a.EVENT[i],this._onevent,this);var o={};this._onzrevent=function(e){return t[o[e.type]](e)};for(var r=0,s=d.length;s>r;r++){var l=d[r],h=U[l];o[h]="_on"+l.toLowerCase(),n.on(h,this._onzrevent)}this.chart={},this.component={};var m=e("./chart/island");this._island=new m(this._themeConfig,this._messageCenter,n,{},this),this.chart.island=this._island;var V=e("./component/toolbox");this._toolbox=new V(this._themeConfig,this._messageCenter,n,{},this),this.component.toolbox=this._toolbox;var p=e("./component");p.define("title",e("./component/title")),p.define("tooltip",e("./component/tooltip")),p.define("legend",e("./component/legend")),(0===n.getWidth()||0===n.getHeight())&&console.error("Dom’s width & height should be ready before init.")},__onevent:function(e){e.__echartsId=e.__echartsId||this.id;var t=e.__echartsId===this.id;switch(this._curEventType||(this._curEventType=e.type),e.type){case a.EVENT.LEGEND_SELECTED:this._onlegendSelected(e);break;case a.EVENT.DATA_ZOOM:if(!t){var n=this.component.dataZoom;n&&(n.silence(!0),n.absoluteZoom(e.zoom),n.silence(!1))}this._ondataZoom(e);break;case a.EVENT.DATA_RANGE:t&&this._ondataRange(e);break;case a.EVENT.MAGIC_TYPE_CHANGED:if(!t){var i=this.component.toolbox;i&&(i.silence(!0),i.setMagicType(e.magicType),i.silence(!1))}this._onmagicTypeChanged(e);break;case a.EVENT.DATA_VIEW_CHANGED:t&&this._ondataViewChanged(e);break;case a.EVENT.TOOLTIP_HOVER:t&&this._tooltipHover(e);break;case a.EVENT.RESTORE:this._onrestore();break;case a.EVENT.REFRESH:t&&this._onrefresh(e);break;case a.EVENT.TOOLTIP_IN_GRID:case a.EVENT.TOOLTIP_OUT_GRID:if(t){if(this._connected){var o=this.component.grid;o&&(e.x=(e.event.zrenderX-o.getX())/o.getWidth(),e.y=(e.event.zrenderY-o.getY())/o.getHeight())}}else{var o=this.component.grid;o&&this._zr.trigger("mousemove",{connectTrigger:!0,zrenderX:o.getX()+e.x*o.getWidth(),zrenderY:o.getY()+e.y*o.getHeight()})}}if(this._connected&&t&&this._curEventType===e.type){for(var r in this._connected)this._connected[r].connectedEventHandler(e);this._curEventType=null}(!t||!this._connected&&t)&&(this._curEventType=null)},_onclick:function(e){if(i(this,"onclick",e),e.target){var t=this._eventPackage(e.target);t&&null!=t.seriesIndex&&this._messageCenter.dispatch(a.EVENT.CLICK,e.event,t,this)}},_ondblclick:function(e){if(i(this,"ondblclick",e),e.target){var t=this._eventPackage(e.target);t&&null!=t.seriesIndex&&this._messageCenter.dispatch(a.EVENT.DBLCLICK,e.event,t,this)}},_onmouseover:function(e){if(e.target){var t=this._eventPackage(e.target);t&&null!=t.seriesIndex&&this._messageCenter.dispatch(a.EVENT.HOVER,e.event,t,this)}},_onmouseout:function(e){if(e.target){var t=this._eventPackage(e.target);t&&null!=t.seriesIndex&&this._messageCenter.dispatch(a.EVENT.MOUSEOUT,e.event,t,this)}},_ondragstart:function(e){this._status={dragIn:!1,dragOut:!1,needRefresh:!1},i(this,"ondragstart",e)},_ondragenter:function(e){i(this,"ondragenter",e)},_ondragover:function(e){i(this,"ondragover",e)},_ondragleave:function(e){i(this,"ondragleave",e)},_ondrop:function(e){i(this,"ondrop",e,this._status),this._island.ondrop(e,this._status)},_ondragend:function(e){if(i(this,"ondragend",e,this._status),this._timeline&&this._timeline.ondragend(e,this._status),this._island.ondragend(e,this._status),this._status.needRefresh){this._syncBackupData(this._option);var t=this._messageCenter;t.dispatch(a.EVENT.DATA_CHANGED,e.event,this._eventPackage(e.target),this),t.dispatch(a.EVENT.REFRESH,null,null,this)}},_onlegendSelected:function(e){this._status.needRefresh=!1,i(this,"onlegendSelected",e,this._status),this._status.needRefresh&&this._messageCenter.dispatch(a.EVENT.REFRESH,null,null,this)},_ondataZoom:function(e){this._status.needRefresh=!1,i(this,"ondataZoom",e,this._status),this._status.needRefresh&&this._messageCenter.dispatch(a.EVENT.REFRESH,null,null,this)},_ondataRange:function(e){this._clearEffect(),this._status.needRefresh=!1,i(this,"ondataRange",e,this._status),this._status.needRefresh&&this._zr.refreshNextFrame()},_onmagicTypeChanged:function(){this._clearEffect(),this._render(this._toolbox.getMagicOption())},_ondataViewChanged:function(e){this._syncBackupData(e.option),this._messageCenter.dispatch(a.EVENT.DATA_CHANGED,null,e,this),this._messageCenter.dispatch(a.EVENT.REFRESH,null,null,this)},_tooltipHover:function(e){var t=[];i(this,"ontooltipHover",e,t)},_onrestore:function(){this.restore()},_onrefresh:function(e){this._refreshInside=!0,this.refresh(e),this._refreshInside=!1},_syncBackupData:function(e){this.component.dataZoom&&this.component.dataZoom.syncBackupData(e)},_eventPackage:function(t){if(t){var n=e("./util/ecData"),i=n.get(t,"seriesIndex"),a=n.get(t,"dataIndex");return a=-1!=i&&this.component.dataZoom?this.component.dataZoom.getRealDataIndex(i,a):a,{seriesIndex:i,seriesName:(n.get(t,"series")||{}).name,dataIndex:a,data:n.get(t,"data"),name:n.get(t,"name"),value:n.get(t,"value"),special:n.get(t,"special")}}},_noDataCheck:function(e){for(var t=e.series,n=0,i=t.length;i>n;n++)if(t[n].type==a.CHART_TYPE_MAP||t[n].data&&t[n].data.length>0||t[n].markPoint&&t[n].markPoint.data&&t[n].markPoint.data.length>0||t[n].markLine&&t[n].markLine.data&&t[n].markLine.data.length>0||t[n].nodes&&t[n].nodes.length>0||t[n].links&&t[n].links.length>0||t[n].matrix&&t[n].matrix.length>0||t[n].eventList&&t[n].eventList.length>0)return!1;this.clear();var o=this._option&&this._option.noDataLoadingOption||this._themeConfig.noDataLoadingOption||a.noDataLoadingOption||{text:this._option&&this._option.noDataText||this._themeConfig.noDataText||a.noDataText,effect:this._option&&this._option.noDataEffect||this._themeConfig.noDataEffect||a.noDataEffect};return this.showLoading(o),!0},_render:function(t){if(this._mergeGlobalConifg(t),!this._noDataCheck(t)){var n=t.backgroundColor;if(n)if(l||-1==n.indexOf("rgba"))this.dom.style.backgroundColor=n;else{var i=n.split(",");this.dom.style.filter="alpha(opacity="+100*i[3].substring(0,i[3].lastIndexOf(")"))+")",i.length=3,i[0]=i[0].replace("a",""),this.dom.style.backgroundColor=i.join(",")+")"}this._zr.clearAnimation(),this._chartList=[];var o=e("./chart"),r=e("./component");(t.xAxis||t.yAxis)&&(t.grid=t.grid||{},t.dataZoom=t.dataZoom||{});for(var s,h,m,V=["title","legend","tooltip","dataRange","roamController","grid","dataZoom","xAxis","yAxis","polar"],U=0,d=V.length;d>U;U++)h=V[U],m=this.component[h],t[h]?(m?m.refresh&&m.refresh(t):(s=r.get(/^[xy]Axis$/.test(h)?"axis":h),m=new s(this._themeConfig,this._messageCenter,this._zr,t,this,h),this.component[h]=m),this._chartList.push(m)):m&&(m.dispose(),this.component[h]=null,delete this.component[h]);for(var p,c,u,y={},U=0,d=t.series.length;d>U;U++)c=t.series[U].type,c?y[c]||(y[c]=!0,p=o.get(c),p?(this.chart[c]?(u=this.chart[c],u.refresh(t)):u=new p(this._themeConfig,this._messageCenter,this._zr,t,this),this._chartList.push(u),this.chart[c]=u):console.error(c+" has not been required.")):console.error("series["+U+"] chart type has not been defined.");for(c in this.chart)c==a.CHART_TYPE_ISLAND||y[c]||(this.chart[c].dispose(),this.chart[c]=null,delete this.chart[c]);this.component.grid&&this.component.grid.refixAxisShape(this.component),this._island.refresh(t),this._toolbox.refresh(t),t.animation&&!t.renderAsImage?this._zr.refresh():this._zr.render();var g="IMG"+this.id,b=document.getElementById(g);t.renderAsImage&&l?(b?b.src=this.getDataURL(t.renderAsImage):(b=this.getImage(t.renderAsImage),b.id=g,b.style.position="absolute",b.style.left=0,b.style.top=0,this.dom.firstChild.appendChild(b)),this.un(),this._zr.un(),this._disposeChartList(),this._zr.clear()):b&&b.parentNode.removeChild(b),b=null,this._option=t}},restore:function(){this._clearEffect(),this._option=o.clone(this._optionRestore),this._disposeChartList(),this._island.clear(),this._toolbox.reset(this._option,!0),this._render(this._option)},refresh:function(e){this._clearEffect(),e=e||{};var t=e.option;!this._refreshInside&&t&&(t=this.getOption(),o.merge(t,e.option,!0),o.merge(this._optionRestore,e.option,!0),this._toolbox.reset(t)),this._island.refresh(t),this._toolbox.refresh(t),this._zr.clearAnimation();for(var n=0,i=this._chartList.length;i>n;n++)this._chartList[n].refresh&&this._chartList[n].refresh(t);this.component.grid&&this.component.grid.refixAxisShape(this.component),this._zr.refresh()},_disposeChartList:function(){this._clearEffect(),this._zr.clearAnimation();for(var e=this._chartList.length;e--;){var t=this._chartList[e];if(t){var n=t.type;this.chart[n]&&delete this.chart[n],this.component[n]&&delete this.component[n],t.dispose&&t.dispose()}}this._chartList=[]},_mergeGlobalConifg:function(t){for(var n=["backgroundColor","calculable","calculableColor","calculableHolderColor","nameConnector","valueConnector","animation","animationThreshold","animationDuration","animationDurationUpdate","animationEasing","addDataAnimation","symbolList","DRAG_ENABLE_TIME"],i=n.length;i--;){var o=n[i];null==t[o]&&(t[o]=null!=this._themeConfig[o]?this._themeConfig[o]:a[o])}var r=t.color;r&&r.length||(r=this._themeConfig.color||a.color),this._zr.getColor=function(t){var n=e("zrender/tool/color");return n.getColor(t,r)},l||(t.animation=!1,t.addDataAnimation=!1)},setOption:function(e,t){return e.timeline?this._setTimelineOption(e):this._setOption(e,t)},_setOption:function(e,t){return this._option=!t&&this._option?o.merge(this.getOption(),o.clone(e),!0):o.clone(e),this._optionRestore=o.clone(this._option),this._option.series&&0!==this._option.series.length?(this.component.dataZoom&&(this._option.dataZoom||this._option.toolbox&&this._option.toolbox.feature&&this._option.toolbox.feature.dataZoom&&this._option.toolbox.feature.dataZoom.show)&&this.component.dataZoom.syncOption(this._option),this._toolbox.reset(this._option),this._render(this._option),this):void this._zr.clear()},getOption:function(){function e(e){var i=n._optionRestore[e];if(i)if(i instanceof Array)for(var a=i.length;a--;)t[e][a].data=o.clone(i[a].data);else t[e].data=o.clone(i.data)}var t=o.clone(this._option),n=this;return e("xAxis"),e("yAxis"),e("series"),t},setSeries:function(e,t){return t?(this._option.series=e,this.setOption(this._option,t)):this.setOption({series:e}),this},getSeries:function(){return this.getOption().series},_setTimelineOption:function(t){this._timeline&&this._timeline.dispose();var n=e("./component/timeline"),i=new n(this._themeConfig,this._messageCenter,this._zr,t,this);return this._timeline=i,this.component.timeline=this._timeline,this},addData:function(e,t,n,i,r){for(var s=e instanceof Array?e:[[e,t,n,i,r]],l=this.getOption(),h=this._optionRestore,m=0,V=s.length;V>m;m++){e=s[m][0],t=s[m][1],n=s[m][2],i=s[m][3],r=s[m][4];var U=h.series[e],d=n?"unshift":"push",p=n?"pop":"shift";if(U){var c=U.data,u=l.series[e].data;if(c[d](t),u[d](t),i||(c[p](),t=u[p]()),null!=r){var y,g;if(U.type===a.CHART_TYPE_PIE&&(y=h.legend)&&(g=y.data)){var b=l.legend.data;if(g[d](r),b[d](r),!i){var f=o.indexOf(g,t.name);-1!=f&&g.splice(f,1),f=o.indexOf(b,t.name),-1!=f&&b.splice(f,1)}}else if(null!=h.xAxis&&null!=h.yAxis){var k,x,_=U.xAxisIndex||0;(null==h.xAxis[_].type||"category"===h.xAxis[_].type)&&(k=h.xAxis[_].data,x=l.xAxis[_].data,k[d](r),x[d](r),i||(k[p](),x[p]())),_=U.yAxisIndex||0,"category"===h.yAxis[_].type&&(k=h.yAxis[_].data,x=l.yAxis[_].data,k[d](r),x[d](r),i||(k[p](),x[p]()))}}this._option.series[e].data=l.series[e].data}}this._zr.clearAnimation();for(var L=this._chartList,m=0,V=L.length;V>m;m++)l.addDataAnimation&&L[m].addDataAnimation&&L[m].addDataAnimation(s);this.component.dataZoom&&this.component.dataZoom.syncOption(l),this._option=l;var W=this;return setTimeout(function(){if(W._zr){W._zr.clearAnimation();for(var e=0,t=L.length;t>e;e++)L[e].motionlessOnce=l.addDataAnimation&&L[e].addDataAnimation;W._messageCenter.dispatch(a.EVENT.REFRESH,null,{option:l},W)}},l.addDataAnimation?l.animationDurationUpdate:0),this},addMarkPoint:function(e,t){return this._addMark(e,t,"markPoint")},addMarkLine:function(e,t){return this._addMark(e,t,"markLine")},_addMark:function(e,t,n){var i,a=this._option.series;if(a&&(i=a[e])){var r=this._optionRestore.series,s=r[e],l=i[n],h=s[n];l=i[n]=l||{data:[]},h=s[n]=h||{data:[]};for(var m in t)"data"===m?(l.data=l.data.concat(t.data),h.data=h.data.concat(t.data)):"object"!=typeof t[m]||null==l[m]?l[m]=h[m]=t[m]:(o.merge(l[m],t[m],!0),o.merge(h[m],t[m],!0));var V=this.chart[i.type];V&&V.addMark(e,t,n)}return this},delMarkPoint:function(e,t){return this._delMark(e,t,"markPoint")},delMarkLine:function(e,t){return this._delMark(e,t,"markLine")},_delMark:function(e,t,n){var i,a,o,r=this._option.series;if(!(r&&(i=r[e])&&(a=i[n])&&(o=a.data)))return this;t=t.split(" > ");for(var s=-1,l=0,h=o.length;h>l;l++){var m=o[l];if(m instanceof Array){if(m[0].name===t[0]&&m[1].name===t[1]){s=l;break}}else if(m.name===t[0]){s=l;break}}if(s>-1){o.splice(s,1),this._optionRestore.series[e][n].data.splice(s,1);var V=this.chart[i.type];V&&V.delMark(e,t.join(" > "),n)}return this},getDom:function(){return this.dom},getZrender:function(){return this._zr},getDataURL:function(e){if(!l)return"";if(0===this._chartList.length){var t="IMG"+this.id,n=document.getElementById(t);if(n)return n.src}var i=this.component.tooltip;switch(i&&i.hideTip(),e){case"jpeg":break;default:e="png"}var a=this._option.backgroundColor;return a&&"rgba(0,0,0,0)"===a.replace(" ","")&&(a="#fff"),this._zr.toDataURL("image/"+e,a)},getImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getDataURL(e),n.title=t&&t.text||"ECharts",n},getConnectedDataURL:function(t){if(!this.isConnected())return this.getDataURL(t);var n=this.dom,i={self:{img:this.getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight}},a=i.self.left,o=i.self.top,r=i.self.right,s=i.self.bottom;for(var l in this._connected)n=this._connected[l].getDom(),i[l]={img:this._connected[l].getDataURL(t),left:n.offsetLeft,top:n.offsetTop,right:n.offsetLeft+n.offsetWidth,bottom:n.offsetTop+n.offsetHeight},a=Math.min(a,i[l].left),o=Math.min(o,i[l].top),r=Math.max(r,i[l].right),s=Math.max(s,i[l].bottom);var h=document.createElement("div");h.style.position="absolute",h.style.left="-4000px",h.style.width=r-a+"px",h.style.height=s-o+"px",document.body.appendChild(h);var m=e("zrender").init(h),V=e("zrender/shape/Image");for(var l in i)m.addShape(new V({style:{x:i[l].left-a,y:i[l].top-o,image:i[l].img}}));m.render();var U=this._option.backgroundColor;U&&"rgba(0,0,0,0)"===U.replace(/ /g,"")&&(U="#fff");var d=m.toDataURL("image/png",U);return setTimeout(function(){m.dispose(),h.parentNode.removeChild(h),h=null},100),d},getConnectedImage:function(e){var t=this._optionRestore.title,n=document.createElement("img");return n.src=this.getConnectedDataURL(e),n.title=t&&t.text||"ECharts",n},on:function(e,t){return this._messageCenterOutSide.bind(e,t,this),this},un:function(e,t){return this._messageCenterOutSide.unbind(e,t),this},connect:function(e){if(!e)return this;if(this._connected||(this._connected={}),e instanceof Array)for(var t=0,n=e.length;n>t;t++)this._connected[e[t].id]=e[t];else this._connected[e.id]=e;return this},disConnect:function(e){if(!e||!this._connected)return this;if(e instanceof Array)for(var t=0,n=e.length;n>t;t++)delete this._connected[e[t].id];else delete this._connected[e.id];for(var i in this._connected)return this;return this._connected=!1,this},connectedEventHandler:function(e){e.__echartsId!=this.id&&this._onevent(e)},isConnected:function(){return!!this._connected},showLoading:function(t){var n={bar:e("zrender/loadingEffect/Bar"),bubble:e("zrender/loadingEffect/Bubble"),dynamicLine:e("zrender/loadingEffect/DynamicLine"),ring:e("zrender/loadingEffect/Ring"),spin:e("zrender/loadingEffect/Spin"),whirling:e("zrender/loadingEffect/Whirling")};this._toolbox.hideDataView(),t=t||{};var i=t.textStyle||{};t.textStyle=i;var r=o.merge(o.merge(o.clone(i),this._themeConfig.textStyle),a.textStyle);i.textFont=r.fontStyle+" "+r.fontWeight+" "+r.fontSize+"px "+r.fontFamily,i.text=t.text||this._option&&this._option.loadingText||this._themeConfig.loadingText||a.loadingText,null!=t.x&&(i.x=t.x),null!=t.y&&(i.y=t.y),t.effectOption=t.effectOption||{},t.effectOption.textStyle=i;var s=t.effect;return("string"==typeof s||null==s)&&(s=n[t.effect||this._option&&this._option.loadingEffect||this._themeConfig.loadingEffect||a.loadingEffect]||n.spin),this._zr.showLoading(new s(t.effectOption)),this},hideLoading:function(){return this._zr.hideLoading(),this},setTheme:function(t){if(t){if("string"==typeof t)switch(t){case"macarons":t=e("./theme/macarons");break;case"infographic":t=e("./theme/infographic");break;default:t={}}else t=t||{};this._themeConfig=t}if(!l){var n=this._themeConfig.textStyle;n&&n.fontFamily&&n.fontFamily2&&(n.fontFamily=n.fontFamily2),n=a.textStyle,n.fontFamily=n.fontFamily2}this._timeline&&this._timeline.setTheme(!0),this._optionRestore&&this.restore()},resize:function(){var e=this;return function(){if(e._clearEffect(),e._zr.resize(),e._option&&e._option.renderAsImage&&l)return e._render(e._option),e;e._zr.clearAnimation(),e._island.resize(),e._toolbox.resize(),e._timeline&&e._timeline.resize();for(var t=0,n=e._chartList.length;n>t;t++)e._chartList[t].resize&&e._chartList[t].resize();return e.component.grid&&e.component.grid.refixAxisShape(e.component),e._zr.refresh(),e._messageCenter.dispatch(a.EVENT.RESIZE,null,null,e),e}},_clearEffect:function(){this._zr.modLayer(a.EFFECT_ZLEVEL,{motionBlur:!1}),this._zr.painter.clearLayer(a.EFFECT_ZLEVEL)},clear:function(){return this._disposeChartList(),this._zr.clear(),this._option={},this._optionRestore={},this.dom.style.backgroundColor=null,this},dispose:function(){var e=this.dom.getAttribute(V);e&&delete m[e],this._island.dispose(),this._toolbox.dispose(),this._timeline&&this._timeline.dispose(),this._messageCenter.unbind(),this.clear(),this._zr.dispose(),this._zr=null}},s}),n("echarts/config",[],function(){var e={CHART_TYPE_LINE:"line",CHART_TYPE_BAR:"bar",CHART_TYPE_SCATTER:"scatter",CHART_TYPE_PIE:"pie",CHART_TYPE_RADAR:"radar",CHART_TYPE_MAP:"map",CHART_TYPE_K:"k",CHART_TYPE_ISLAND:"island",CHART_TYPE_FORCE:"force",CHART_TYPE_CHORD:"chord",CHART_TYPE_GAUGE:"gauge",CHART_TYPE_FUNNEL:"funnel",CHART_TYPE_EVENTRIVER:"eventRiver",COMPONENT_TYPE_TITLE:"title",COMPONENT_TYPE_LEGEND:"legend",COMPONENT_TYPE_DATARANGE:"dataRange",COMPONENT_TYPE_DATAVIEW:"dataView",COMPONENT_TYPE_DATAZOOM:"dataZoom",COMPONENT_TYPE_TOOLBOX:"toolbox",COMPONENT_TYPE_TOOLTIP:"tooltip",COMPONENT_TYPE_GRID:"grid",COMPONENT_TYPE_AXIS:"axis",COMPONENT_TYPE_POLAR:"polar",COMPONENT_TYPE_X_AXIS:"xAxis",COMPONENT_TYPE_Y_AXIS:"yAxis",COMPONENT_TYPE_AXIS_CATEGORY:"categoryAxis",COMPONENT_TYPE_AXIS_VALUE:"valueAxis",COMPONENT_TYPE_TIMELINE:"timeline",COMPONENT_TYPE_ROAMCONTROLLER:"roamController",backgroundColor:"rgba(0,0,0,0)",color:["#ff7f50","#87cefa","#da70d6","#32cd32","#6495ed","#ff69b4","#ba55d3","#cd5c5c","#ffa500","#40e0d0","#1e90ff","#ff6347","#7b68ee","#00fa9a","#ffd700","#6699FF","#ff6666","#3cb371","#b8860b","#30e0e0"],markPoint:{clickable:!0,symbol:"pin",symbolSize:10,large:!1,effect:{show:!1,loop:!0,period:15,type:"scale",scaleSize:2,bounceDistance:10},itemStyle:{normal:{borderWidth:2,label:{show:!0,position:"inside"}},emphasis:{label:{show:!0}}}},markLine:{clickable:!0,symbol:["circle","arrow"],symbolSize:[2,4],smoothRadian:.2,precision:2,effect:{show:!1,loop:!0,period:15,scaleSize:2},itemStyle:{normal:{borderWidth:1.5,label:{show:!0,position:"end"},lineStyle:{type:"dashed"}},emphasis:{label:{show:!1},lineStyle:{}}}},textStyle:{decoration:"none",fontFamily:"Arial, Verdana, sans-serif",fontFamily2:"微软雅黑",fontSize:12,fontStyle:"normal",fontWeight:"normal"},EVENT:{REFRESH:"refresh",RESTORE:"restore",RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",HOVER:"hover",MOUSEOUT:"mouseout",DATA_CHANGED:"dataChanged",DATA_ZOOM:"dataZoom",DATA_RANGE:"dataRange",DATA_RANGE_SELECTED:"dataRangeSelected",DATA_RANGE_HOVERLINK:"dataRangeHoverLink",LEGEND_SELECTED:"legendSelected",LEGEND_HOVERLINK:"legendHoverLink",MAP_SELECTED:"mapSelected",PIE_SELECTED:"pieSelected",MAGIC_TYPE_CHANGED:"magicTypeChanged",DATA_VIEW_CHANGED:"dataViewChanged",TIMELINE_CHANGED:"timelineChanged",MAP_ROAM:"mapRoam",FORCE_LAYOUT_END:"forceLayoutEnd",TOOLTIP_HOVER:"tooltipHover",TOOLTIP_IN_GRID:"tooltipInGrid",TOOLTIP_OUT_GRID:"tooltipOutGrid",ROAMCONTROLLER:"roamController"},DRAG_ENABLE_TIME:120,EFFECT_ZLEVEL:10,symbolList:["circle","rectangle","triangle","diamond","emptyCircle","emptyRectangle","emptyTriangle","emptyDiamond"],loadingEffect:"spin",loadingText:"数据读取中...",noDataEffect:"bubble",noDataText:"暂无数据",calculable:!1,calculableColor:"rgba(255,165,0,0.6)",calculableHolderColor:"#ccc",nameConnector:" & ",valueConnector:": ",animation:!0,addDataAnimation:!0,animationThreshold:2e3,animationDuration:2e3,animationDurationUpdate:500,animationEasing:"ExponentialOut"};return e}),n("zrender/tool/util",["require","../dep/excanvas"],function(e){function t(e){return e&&1===e.nodeType&&"string"==typeof e.nodeName}function n(e){if("object"==typeof e&&null!==e){var i=e;if(e instanceof Array){i=[];for(var a=0,o=e.length;o>a;a++)i[a]=n(e[a])}else if(!u[y.call(e)]&&!t(e)){i={};for(var r in e)e.hasOwnProperty(r)&&(i[r]=n(e[r]))}return i}return e}function i(e,n,i,o){if(n.hasOwnProperty(i)){var r=e[i];"object"!=typeof r||u[y.call(r)]||t(r)?!o&&i in e||(e[i]=n[i]):a(e[i],n[i],o)}}function a(e,t,n){for(var a in t)i(e,t,a,n);return e}function o(){if(!V)if(e("../dep/excanvas"),window.G_vmlCanvasManager){var t=document.createElement("div");t.style.position="absolute",t.style.top="-1000px",document.body.appendChild(t),V=G_vmlCanvasManager.initElement(t).getContext("2d")}else V=document.createElement("canvas").getContext("2d");return V}function r(){return d||(U=document.createElement("canvas"),p=U.width,c=U.height,d=U.getContext("2d")),d}function s(e,t){var n,i=100;e+g>p&&(p=e+g+i,U.width=p,n=!0),t+b>c&&(c=t+b+i,U.height=c,n=!0),-g>e&&(g=Math.ceil(-e/i)*i,p+=g,U.width=p,n=!0),-b>t&&(b=Math.ceil(-t/i)*i,c+=b,U.height=c,n=!0),n&&d.translate(g,b)}function l(){return{x:g,y:b}}function h(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;i>n;n++)if(e[n]===t)return n;return-1}function m(e,t){function n(){}var i=e.prototype;n.prototype=t.prototype,e.prototype=new n;for(var a in i)e.prototype[a]=i[a];e.constructor=e}var V,U,d,p,c,u={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1},y=Object.prototype.toString,g=0,b=0;return{inherits:m,clone:n,merge:a,getContext:o,getPixelContext:r,getPixelOffset:l,adjustCanvasSize:s,indexOf:h}}),n("zrender/tool/event",["require","../mixin/Eventful"],function(e){"use strict";function t(e){return"undefined"!=typeof e.zrenderX&&e.zrenderX||"undefined"!=typeof e.offsetX&&e.offsetX||"undefined"!=typeof e.layerX&&e.layerX||"undefined"!=typeof e.clientX&&e.clientX}function n(e){return"undefined"!=typeof e.zrenderY&&e.zrenderY||"undefined"!=typeof e.offsetY&&e.offsetY||"undefined"!=typeof e.layerY&&e.layerY||"undefined"!=typeof e.clientY&&e.clientY}function i(e){return"undefined"!=typeof e.zrenderDelta&&e.zrenderDelta||"undefined"!=typeof e.wheelDelta&&e.wheelDelta||"undefined"!=typeof e.detail&&-e.detail}var a=e("../mixin/Eventful"),o="function"==typeof window.addEventListener?function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0}:function(e){e.returnValue=!1,e.cancelBubble=!0};return{getX:t,getY:n,getDelta:i,stop:o,Dispatcher:a}}),n("zrender/tool/env",[],function(){function e(e){var t=this.os={},n=this.browser={},i=e.match(/Web[kK]it[\/]{0,1}([\d.]+)/),a=e.match(/(Android);?[\s\/]+([\d.]+)?/),o=e.match(/(iPad).*OS\s([\d_]+)/),r=e.match(/(iPod)(.*OS\s([\d_]+))?/),s=!o&&e.match(/(iPhone\sOS)\s([\d_]+)/),l=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),h=l&&e.match(/TouchPad/),m=e.match(/Kindle\/([\d.]+)/),V=e.match(/Silk\/([\d._]+)/),U=e.match(/(BlackBerry).*Version\/([\d.]+)/),d=e.match(/(BB10).*Version\/([\d.]+)/),p=e.match(/(RIM\sTablet\sOS)\s([\d.]+)/),c=e.match(/PlayBook/),u=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/),y=e.match(/Firefox\/([\d.]+)/),g=e.match(/MSIE ([\d.]+)/),b=i&&e.match(/Mobile\//)&&!u,f=e.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/)&&!u,g=e.match(/MSIE\s([\d.]+)/);return(n.webkit=!!i)&&(n.version=i[1]),a&&(t.android=!0,t.version=a[2]),s&&!r&&(t.ios=t.iphone=!0,t.version=s[2].replace(/_/g,".")),o&&(t.ios=t.ipad=!0,t.version=o[2].replace(/_/g,".")),r&&(t.ios=t.ipod=!0,t.version=r[3]?r[3].replace(/_/g,"."):null),l&&(t.webos=!0,t.version=l[2]),h&&(t.touchpad=!0),U&&(t.blackberry=!0,t.version=U[2]),d&&(t.bb10=!0,t.version=d[2]),p&&(t.rimtabletos=!0,t.version=p[2]),c&&(n.playbook=!0),m&&(t.kindle=!0,t.version=m[1]),V&&(n.silk=!0,n.version=V[1]),!V&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),u&&(n.chrome=!0,n.version=u[1]),y&&(n.firefox=!0,n.version=y[1]),g&&(n.ie=!0,n.version=g[1]),b&&(e.match(/Safari/)||t.ios)&&(n.safari=!0),f&&(n.webview=!0),g&&(n.ie=!0,n.version=g[1]),t.tablet=!!(o||c||a&&!e.match(/Mobile/)||y&&e.match(/Tablet/)||g&&!e.match(/Phone/)&&e.match(/Touch/)),t.phone=!(t.tablet||t.ipod||!(a||s||l||U||d||u&&e.match(/Android/)||u&&e.match(/CriOS\/([\d.]+)/)||y&&e.match(/Mobile/)||g&&e.match(/Touch/))),{browser:n,os:t,canvasSupported:document.createElement("canvas").getContext?!0:!1}}return e(navigator.userAgent)}),n("zrender",["zrender/zrender"],function(e){return e}),n("zrender/zrender",["require","./dep/excanvas","./tool/util","./tool/log","./tool/guid","./Handler","./Painter","./Storage","./animation/Animation","./tool/env"],function(e){function t(e){return function(){for(var t=e.animatingElements,n=0,i=t.length;i>n;n++)e.storage.mod(t[n].id);(t.length||e._needsRefreshNextFrame)&&e.refresh()}}e("./dep/excanvas");var n=e("./tool/util"),i=e("./tool/log"),a=e("./tool/guid"),o=e("./Handler"),r=e("./Painter"),s=e("./Storage"),l=e("./animation/Animation"),h={},m={};m.version="2.0.7",m.init=function(e){var t=new V(a(),e);return h[t.id]=t,t},m.dispose=function(e){if(e)e.dispose();else{for(var t in h)h[t].dispose();h={}}return m},m.getInstance=function(e){return h[e]},m.delInstance=function(e){return delete h[e],m};var V=function(n,i){this.id=n,this.env=e("./tool/env"),this.storage=new s,this.painter=new r(i,this.storage),this.handler=new o(i,this.storage,this.painter),this.animatingElements=[],this.animation=new l({stage:{update:t(this)}}),this.animation.start();var a=this;this.painter.refreshNextFrame=function(){a.refreshNextFrame()},this._needsRefreshNextFrame=!1};return V.prototype.getId=function(){return this.id},V.prototype.addShape=function(e){return this.storage.addRoot(e),this},V.prototype.addGroup=function(e){return this.storage.addRoot(e),this},V.prototype.delShape=function(e){return this.storage.delRoot(e),this},V.prototype.delGroup=function(e){return this.storage.delRoot(e),this},V.prototype.modShape=function(e,t){return this.storage.mod(e,t),this},V.prototype.modGroup=function(e,t){return this.storage.mod(e,t),this},V.prototype.modLayer=function(e,t){return this.painter.modLayer(e,t),this},V.prototype.addHoverShape=function(e){return this.storage.addHover(e),this},V.prototype.render=function(e){return this.painter.render(e),this._needsRefreshNextFrame=!1,this},V.prototype.refresh=function(e){return this.painter.refresh(e),this._needsRefreshNextFrame=!1,this},V.prototype.refreshNextFrame=function(){return this._needsRefreshNextFrame=!0,this},V.prototype.refreshHover=function(e){return this.painter.refreshHover(e),this},V.prototype.refreshShapes=function(e,t){return this.painter.refreshShapes(e,t),this},V.prototype.resize=function(){return this.painter.resize(),this},V.prototype.animate=function(e,t,a){if("string"==typeof e&&(e=this.storage.get(e)),e){var o;if(t){for(var r=t.split("."),s=e,l=0,h=r.length;h>l;l++)s&&(s=s[r[l]]);s&&(o=s)}else o=e;if(!o)return void i('Property "'+t+'" is not existed in element '+e.id);var m=this.animatingElements;return"undefined"==typeof e.__aniCount&&(e.__aniCount=0),0===e.__aniCount&&m.push(e),e.__aniCount++,this.animation.animate(o,{loop:a}).done(function(){if(e.__aniCount--,0===e.__aniCount){var t=n.indexOf(m,e);m.splice(t,1)}})}i("Element not existed")},V.prototype.clearAnimation=function(){this.animation.clear()},V.prototype.showLoading=function(e){return this.painter.showLoading(e),this},V.prototype.hideLoading=function(){return this.painter.hideLoading(),this},V.prototype.getWidth=function(){return this.painter.getWidth()},V.prototype.getHeight=function(){return this.painter.getHeight()},V.prototype.toDataURL=function(e,t,n){return this.painter.toDataURL(e,t,n)
-},V.prototype.shapeToImage=function(e,t,n){var i=a();return this.painter.shapeToImage(i,e,t,n)},V.prototype.on=function(e,t,n){return this.handler.on(e,t,n),this},V.prototype.un=function(e,t){return this.handler.un(e,t),this},V.prototype.trigger=function(e,t){return this.handler.trigger(e,t),this},V.prototype.clear=function(){return this.storage.delRoot(),this.painter.clear(),this},V.prototype.dispose=function(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.animatingElements=this.storage=this.painter=this.handler=null,m.delInstance(this.id)},m}),n("zrender/config",[],function(){var e={EVENT:{RESIZE:"resize",CLICK:"click",DBLCLICK:"dblclick",MOUSEWHEEL:"mousewheel",MOUSEMOVE:"mousemove",MOUSEOVER:"mouseover",MOUSEOUT:"mouseout",MOUSEDOWN:"mousedown",MOUSEUP:"mouseup",GLOBALOUT:"globalout",DRAGSTART:"dragstart",DRAGEND:"dragend",DRAGENTER:"dragenter",DRAGOVER:"dragover",DRAGLEAVE:"dragleave",DROP:"drop",touchClickDelay:300},catchBrushException:!1,debugMode:0,devicePixelRatio:Math.max(window.devicePixelRatio||1,1)};return e}),n("echarts/chart/island",["require","./base","zrender/shape/Circle","../config","../util/ecData","zrender/tool/util","zrender/tool/event","zrender/tool/color","../util/accMath","../chart"],function(e){function t(e,t,i,a,r){n.call(this,e,t,i,a,r),this._nameConnector,this._valueConnector,this._zrHeight=this.zr.getHeight(),this._zrWidth=this.zr.getWidth();var l=this;l.shapeHandler.onmousewheel=function(e){var t=e.target,n=e.event,i=s.getDelta(n);i=i>0?-1:1,t.style.r-=i,t.style.r=t.style.r<5?5:t.style.r;var a=o.get(t,"value"),r=a*l.option.island.calculateStep;a=r>1?Math.round(a-r*i):+(a-r*i).toFixed(2);var h=o.get(t,"name");t.style.text=h+":"+a,o.set(t,"value",a),o.set(t,"name",h),l.zr.modShape(t.id),l.zr.refreshNextFrame(),s.stop(n)}}var n=e("./base"),i=e("zrender/shape/Circle"),a=e("../config");a.island={zlevel:0,z:5,r:15,calculateStep:.1};var o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/event");return t.prototype={type:a.CHART_TYPE_ISLAND,_combine:function(t,n){var i=e("zrender/tool/color"),a=e("../util/accMath"),r=a.accAdd(o.get(t,"value"),o.get(n,"value")),s=o.get(t,"name")+this._nameConnector+o.get(n,"name");t.style.text=s+this._valueConnector+r,o.set(t,"value",r),o.set(t,"name",s),t.style.r=this.option.island.r,t.style.color=i.mix(t.style.color,n.style.color)},refresh:function(e){e&&(e.island=this.reformOption(e.island),this.option=e,this._nameConnector=this.option.nameConnector,this._valueConnector=this.option.valueConnector)},getOption:function(){return this.option},resize:function(){var e=this.zr.getWidth(),t=this.zr.getHeight(),n=e/(this._zrWidth||e),i=t/(this._zrHeight||t);if(1!==n||1!==i){this._zrWidth=e,this._zrHeight=t;for(var a=0,o=this.shapeList.length;o>a;a++)this.zr.modShape(this.shapeList[a].id,{style:{x:Math.round(this.shapeList[a].style.x*n),y:Math.round(this.shapeList[a].style.y*i)}})}},add:function(e){var t=o.get(e,"name"),n=o.get(e,"value"),a=null!=o.get(e,"series")?o.get(e,"series").name:"",r=this.getFont(this.option.island.textStyle),s={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:e.style.x,y:e.style.y,r:this.option.island.r,color:e.style.color||e.style.strokeColor,text:t+this._valueConnector+n,textFont:r},draggable:!0,hoverable:!0,onmousewheel:this.shapeHandler.onmousewheel,_type:"island"};"#fff"===s.style.color&&(s.style.color=e.style.strokeColor),this.setCalculable(s),s.dragEnableTime=0,o.pack(s,{name:a},-1,n,-1,t),s=new i(s),this.shapeList.push(s),this.zr.addShape(s)},del:function(e){this.zr.delShape(e.id);for(var t=[],n=0,i=this.shapeList.length;i>n;n++)this.shapeList[n].id!=e.id&&t.push(this.shapeList[n]);this.shapeList=t},ondrop:function(e,t){if(this.isDrop&&e.target){var n=e.target,i=e.dragged;this._combine(n,i),this.zr.modShape(n.id),t.dragIn=!0,this.isDrop=!1}},ondragend:function(e,t){var n=e.target;this.isDragend?t.dragIn&&(this.del(n),t.needRefresh=!0):t.dragIn||(n.style.x=s.getX(e.event),n.style.y=s.getY(e.event),this.add(n),t.needRefresh=!0),this.isDragend=!1}},r.inherits(t,n),e("../chart").define("island",t),t}),n("echarts/component/toolbox",["require","./base","zrender/shape/Line","zrender/shape/Image","zrender/shape/Rectangle","../util/shape/Icon","../config","zrender/tool/util","zrender/config","zrender/tool/event","./dataView","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.dom=o.dom,this._magicType={},this._magicMap={},this._isSilence=!1,this._iconList,this._iconShapeMap={},this._featureTitle={},this._featureIcon={},this._featureColor={},this._featureOption={},this._enableColor="red",this._disableColor="#ccc",this._markShapeList=[];var r=this;r._onMark=function(e){r.__onMark(e)},r._onMarkUndo=function(e){r.__onMarkUndo(e)},r._onMarkClear=function(e){r.__onMarkClear(e)},r._onDataZoom=function(e){r.__onDataZoom(e)},r._onDataZoomReset=function(e){r.__onDataZoomReset(e)},r._onDataView=function(e){r.__onDataView(e)},r._onRestore=function(e){r.__onRestore(e)},r._onSaveAsImage=function(e){r.__onSaveAsImage(e)},r._onMagicType=function(e){r.__onMagicType(e)},r._onCustomHandler=function(e){r.__onCustomHandler(e)},r._onmousemove=function(e){return r.__onmousemove(e)},r._onmousedown=function(e){return r.__onmousedown(e)},r._onmouseup=function(e){return r.__onmouseup(e)},r._onclick=function(e){return r.__onclick(e)}}var n=e("./base"),i=e("zrender/shape/Line"),a=e("zrender/shape/Image"),o=e("zrender/shape/Rectangle"),r=e("../util/shape/Icon"),s=e("../config");s.toolbox={zlevel:0,z:6,show:!1,orient:"horizontal",x:"right",y:"top",color:["#1e90ff","#22bb22","#4b0082","#d2691e"],disableColor:"#ddd",effectiveColor:"red",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemSize:16,showTitle:!0,feature:{mark:{show:!1,title:{mark:"辅助线开关",markUndo:"删除辅助线",markClear:"清空辅助线"},lineStyle:{width:1,color:"#1e90ff",type:"dashed"}},dataZoom:{show:!1,title:{dataZoom:"区域缩放",dataZoomReset:"区域缩放后退"}},dataView:{show:!1,title:"数据视图",readOnly:!1,lang:["数据视图","关闭","刷新"]},magicType:{show:!1,title:{line:"折线图切换",bar:"柱形图切换",stack:"堆积",tiled:"平铺",force:"力导向布局图切换",chord:"和弦图切换",pie:"饼图切换",funnel:"漏斗图切换"},type:[]},restore:{show:!1,title:"还原"},saveAsImage:{show:!1,title:"保存为图片",type:"png",lang:["点击保存"]}}};var l=e("zrender/tool/util"),h=e("zrender/config"),m=e("zrender/tool/event"),V="stack",U="tiled";return t.prototype={type:s.COMPONENT_TYPE_TOOLBOX,_buildShape:function(){this._iconList=[];var e=this.option.toolbox;this._enableColor=e.effectiveColor,this._disableColor=e.disableColor;var t=e.feature,n=[];for(var i in t)if(t[i].show)switch(i){case"mark":n.push({key:i,name:"mark"}),n.push({key:i,name:"markUndo"}),n.push({key:i,name:"markClear"});break;case"magicType":for(var a=0,o=t[i].type.length;o>a;a++)t[i].title[t[i].type[a]+"Chart"]=t[i].title[t[i].type[a]],t[i].option&&(t[i].option[t[i].type[a]+"Chart"]=t[i].option[t[i].type[a]]),n.push({key:i,name:t[i].type[a]+"Chart"});break;case"dataZoom":n.push({key:i,name:"dataZoom"}),n.push({key:i,name:"dataZoomReset"});break;case"saveAsImage":this.canvasSupported&&n.push({key:i,name:"saveAsImage"});break;default:n.push({key:i,name:i})}if(n.length>0){for(var r,i,a=0,o=n.length;o>a;a++)r=n[a].name,i=n[a].key,this._iconList.push(r),this._featureTitle[r]=t[i].title[r]||t[i].title,t[i].icon&&(this._featureIcon[r]=t[i].icon[r]||t[i].icon),t[i].color&&(this._featureColor[r]=t[i].color[r]||t[i].color),t[i].option&&(this._featureOption[r]=t[i].option[r]||t[i].option);this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var a=0,o=this.shapeList.length;o>a;a++)this.zr.addShape(this.shapeList[a]);this._iconShapeMap.mark&&(this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear)),this._iconShapeMap.dataZoomReset&&0===this._zoomQueue.length&&this._iconDisable(this._iconShapeMap.dataZoomReset)}},_buildItem:function(){var t,n,i,o,s=this.option.toolbox,l=this._iconList.length,h=this._itemGroupLocation.x,m=this._itemGroupLocation.y,V=s.itemSize,U=s.itemGap,d=s.color instanceof Array?s.color:[s.color],p=this.getFont(s.textStyle);"horizontal"===s.orient?(n=this._itemGroupLocation.y/this.zr.getHeight()<.5?"bottom":"top",i=this._itemGroupLocation.x/this.zr.getWidth()<.5?"left":"right",o=this._itemGroupLocation.y/this.zr.getHeight()<.5?"top":"bottom"):n=this._itemGroupLocation.x/this.zr.getWidth()<.5?"right":"left",this._iconShapeMap={};for(var c=this,u=0;l>u;u++){switch(t={type:"icon",zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:h,y:m,width:V,height:V,iconType:this._iconList[u],lineWidth:1,strokeColor:this._featureColor[this._iconList[u]]||d[u%d.length],brushType:"stroke"},highlightStyle:{lineWidth:1,text:s.showTitle?this._featureTitle[this._iconList[u]]:void 0,textFont:p,textPosition:n,strokeColor:this._featureColor[this._iconList[u]]||d[u%d.length]},hoverable:!0,clickable:!0},this._featureIcon[this._iconList[u]]&&(t.style.image=this._featureIcon[this._iconList[u]].replace(new RegExp("^image:\\/\\/"),""),t.style.opacity=.8,t.highlightStyle.opacity=1,t.type="image"),"horizontal"===s.orient&&(0===u&&"left"===i&&(t.highlightStyle.textPosition="specific",t.highlightStyle.textAlign=i,t.highlightStyle.textBaseline=o,t.highlightStyle.textX=h,t.highlightStyle.textY="top"===o?m+V+10:m-10),u===l-1&&"right"===i&&(t.highlightStyle.textPosition="specific",t.highlightStyle.textAlign=i,t.highlightStyle.textBaseline=o,t.highlightStyle.textX=h+V,t.highlightStyle.textY="top"===o?m+V+10:m-10)),this._iconList[u]){case"mark":t.onclick=c._onMark;break;case"markUndo":t.onclick=c._onMarkUndo;break;case"markClear":t.onclick=c._onMarkClear;break;case"dataZoom":t.onclick=c._onDataZoom;break;case"dataZoomReset":t.onclick=c._onDataZoomReset;break;case"dataView":if(!this._dataView){var y=e("./dataView");this._dataView=new y(this.ecTheme,this.messageCenter,this.zr,this.option,this.myChart)}t.onclick=c._onDataView;break;case"restore":t.onclick=c._onRestore;break;case"saveAsImage":t.onclick=c._onSaveAsImage;break;default:this._iconList[u].match("Chart")?(t._name=this._iconList[u].replace("Chart",""),t.onclick=c._onMagicType):t.onclick=c._onCustomHandler}"icon"===t.type?t=new r(t):"image"===t.type&&(t=new a(t)),this.shapeList.push(t),this._iconShapeMap[this._iconList[u]]=t,"horizontal"===s.orient?h+=V+U:m+=V+U}},_buildBackground:function(){var e=this.option.toolbox,t=this.reformCssArray(this.option.toolbox.padding);this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-t[3],y:this._itemGroupLocation.y-t[0],width:this._itemGroupLocation.width+t[3]+t[1],height:this._itemGroupLocation.height+t[0]+t[2],brushType:0===e.borderWidth?"fill":"both",color:e.backgroundColor,strokeColor:e.borderColor,lineWidth:e.borderWidth}}))},_getItemGroupLocation:function(){var e=this.option.toolbox,t=this.reformCssArray(this.option.toolbox.padding),n=this._iconList.length,i=e.itemGap,a=e.itemSize,o=0,r=0;"horizontal"===e.orient?(o=(a+i)*n-i,r=a):(r=(a+i)*n-i,o=a);var s,l=this.zr.getWidth();switch(e.x){case"center":s=Math.floor((l-o)/2);break;case"left":s=t[3]+e.borderWidth;break;case"right":s=l-o-t[1]-e.borderWidth;break;default:s=e.x-0,s=isNaN(s)?0:s}var h,m=this.zr.getHeight();switch(e.y){case"top":h=t[0]+e.borderWidth;break;case"bottom":h=m-r-t[2]-e.borderWidth;break;case"center":h=Math.floor((m-r)/2);break;default:h=e.y-0,h=isNaN(h)?0:h}return{x:s,y:h,width:o,height:r}},__onmousemove:function(e){this._marking&&(this._markShape.style.xEnd=m.getX(e.event),this._markShape.style.yEnd=m.getY(e.event),this.zr.addHoverShape(this._markShape)),this._zooming&&(this._zoomShape.style.width=m.getX(e.event)-this._zoomShape.style.x,this._zoomShape.style.height=m.getY(e.event)-this._zoomShape.style.y,this.zr.addHoverShape(this._zoomShape),this.dom.style.cursor="crosshair",m.stop(e.event)),this._zoomStart&&"pointer"!=this.dom.style.cursor&&"move"!=this.dom.style.cursor&&(this.dom.style.cursor="crosshair")},__onmousedown:function(e){if(!e.target){this._zooming=!0;var t=m.getX(e.event),n=m.getY(e.event),i=this.option.dataZoom||{};return this._zoomShape=new o({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:t,y:n,width:1,height:1,brushType:"both"},highlightStyle:{lineWidth:2,color:i.fillerColor||s.dataZoom.fillerColor,strokeColor:i.handleColor||s.dataZoom.handleColor,brushType:"both"}}),this.zr.addHoverShape(this._zoomShape),!0}},__onmouseup:function(){if(!this._zoomShape||Math.abs(this._zoomShape.style.width)<10||Math.abs(this._zoomShape.style.height)<10)return this._zooming=!1,!0;if(this._zooming&&this.component.dataZoom){this._zooming=!1;var e=this.component.dataZoom.rectZoom(this._zoomShape.style);e&&(this._zoomQueue.push({start:e.start,end:e.end,start2:e.start2,end2:e.end2}),this._iconEnable(this._iconShapeMap.dataZoomReset),this.zr.refreshNextFrame())}return!0},__onclick:function(e){if(!e.target)if(this._marking)this._marking=!1,this._markShapeList.push(this._markShape),this._iconEnable(this._iconShapeMap.markUndo),this._iconEnable(this._iconShapeMap.markClear),this.zr.addShape(this._markShape),this.zr.refreshNextFrame();else if(this._markStart){this._marking=!0;var t=m.getX(e.event),n=m.getY(e.event);this._markShape=new i({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{xStart:t,yStart:n,xEnd:t,yEnd:n,lineWidth:this.query(this.option,"toolbox.feature.mark.lineStyle.width"),strokeColor:this.query(this.option,"toolbox.feature.mark.lineStyle.color"),lineType:this.query(this.option,"toolbox.feature.mark.lineStyle.type")}}),this.zr.addHoverShape(this._markShape)}},__onMark:function(e){var t=e.target;if(this._marking||this._markStart)this._resetMark(),this.zr.refreshNextFrame();else{this._resetZoom(),this.zr.modShape(t.id,{style:{strokeColor:this._enableColor}}),this.zr.refreshNextFrame(),this._markStart=!0;var n=this;setTimeout(function(){n.zr&&n.zr.on(h.EVENT.CLICK,n._onclick)&&n.zr.on(h.EVENT.MOUSEMOVE,n._onmousemove)},10)}return!0},__onMarkUndo:function(){if(this._marking)this._marking=!1;else{var e=this._markShapeList.length;if(e>=1){var t=this._markShapeList[e-1];this.zr.delShape(t.id),this.zr.refreshNextFrame(),this._markShapeList.pop(),1===e&&(this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear))}}return!0},__onMarkClear:function(){this._marking&&(this._marking=!1);var e=this._markShapeList.length;if(e>0){for(;e--;)this.zr.delShape(this._markShapeList.pop().id);this._iconDisable(this._iconShapeMap.markUndo),this._iconDisable(this._iconShapeMap.markClear),this.zr.refreshNextFrame()}return!0},__onDataZoom:function(e){var t=e.target;if(this._zooming||this._zoomStart)this._resetZoom(),this.zr.refreshNextFrame(),this.dom.style.cursor="default";else{this._resetMark(),this.zr.modShape(t.id,{style:{strokeColor:this._enableColor}}),this.zr.refreshNextFrame(),this._zoomStart=!0;var n=this;setTimeout(function(){n.zr&&n.zr.on(h.EVENT.MOUSEDOWN,n._onmousedown)&&n.zr.on(h.EVENT.MOUSEUP,n._onmouseup)&&n.zr.on(h.EVENT.MOUSEMOVE,n._onmousemove)},10),this.dom.style.cursor="crosshair"}return!0},__onDataZoomReset:function(){return this._zooming&&(this._zooming=!1),this._zoomQueue.pop(),this._zoomQueue.length>0?this.component.dataZoom.absoluteZoom(this._zoomQueue[this._zoomQueue.length-1]):(this.component.dataZoom.rectZoom(),this._iconDisable(this._iconShapeMap.dataZoomReset),this.zr.refreshNextFrame()),!0},_resetMark:function(){this._marking=!1,this._markStart&&(this._markStart=!1,this._iconShapeMap.mark&&this.zr.modShape(this._iconShapeMap.mark.id,{style:{strokeColor:this._iconShapeMap.mark.highlightStyle.strokeColor}}),this.zr.un(h.EVENT.CLICK,this._onclick),this.zr.un(h.EVENT.MOUSEMOVE,this._onmousemove))},_resetZoom:function(){this._zooming=!1,this._zoomStart&&(this._zoomStart=!1,this._iconShapeMap.dataZoom&&this.zr.modShape(this._iconShapeMap.dataZoom.id,{style:{strokeColor:this._iconShapeMap.dataZoom.highlightStyle.strokeColor}}),this.zr.un(h.EVENT.MOUSEDOWN,this._onmousedown),this.zr.un(h.EVENT.MOUSEUP,this._onmouseup),this.zr.un(h.EVENT.MOUSEMOVE,this._onmousemove))},_iconDisable:function(e){"image"!=e.type?this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{strokeColor:this._disableColor}}):this.zr.modShape(e.id,{hoverable:!1,clickable:!1,style:{opacity:.3}})},_iconEnable:function(e){"image"!=e.type?this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{strokeColor:e.highlightStyle.strokeColor}}):this.zr.modShape(e.id,{hoverable:!0,clickable:!0,style:{opacity:.8}})},__onDataView:function(){return this._dataView.show(this.option),!0},__onRestore:function(){return this._resetMark(),this._resetZoom(),this.messageCenter.dispatch(s.EVENT.RESTORE,null,null,this.myChart),!0},__onSaveAsImage:function(){var e=this.option.toolbox.feature.saveAsImage,t=e.type||"png";"png"!=t&&"jpeg"!=t&&(t="png");var n;n=this.myChart.isConnected()?this.myChart.getConnectedDataURL(t):this.zr.toDataURL("image/"+t,this.option.backgroundColor&&"rgba(0,0,0,0)"===this.option.backgroundColor.replace(" ","")?"#fff":this.option.backgroundColor);var i=document.createElement("div");i.id="__echarts_download_wrap__",i.style.cssText="position:fixed;z-index:99999;display:block;top:0;left:0;background-color:rgba(33,33,33,0.5);text-align:center;width:100%;height:100%;line-height:"+document.documentElement.clientHeight+"px;";var a=document.createElement("a");a.href=n,a.setAttribute("download",(e.name?e.name:this.option.title&&(this.option.title.text||this.option.title.subtext)?this.option.title.text||this.option.title.subtext:"ECharts")+"."+t),a.innerHTML='<img style="vertical-align:middle" src="'+n+'" title="'+(window.ActiveXObject||"ActiveXObject"in window?"右键->图片另存为":e.lang?e.lang[0]:"点击保存")+'"/>',i.appendChild(a),document.body.appendChild(i),a=null,i=null,setTimeout(function(){var e=document.getElementById("__echarts_download_wrap__");e&&(e.onclick=function(){var e=document.getElementById("__echarts_download_wrap__");e.onclick=null,e.innerHTML="",document.body.removeChild(e),e=null},e=null)},500)},__onMagicType:function(e){this._resetMark();var t=e.target._name;return this._magicType[t]||(this._magicType[t]=!0,t===s.CHART_TYPE_LINE?this._magicType[s.CHART_TYPE_BAR]=!1:t===s.CHART_TYPE_BAR&&(this._magicType[s.CHART_TYPE_LINE]=!1),t===s.CHART_TYPE_PIE?this._magicType[s.CHART_TYPE_FUNNEL]=!1:t===s.CHART_TYPE_FUNNEL&&(this._magicType[s.CHART_TYPE_PIE]=!1),t===s.CHART_TYPE_FORCE?this._magicType[s.CHART_TYPE_CHORD]=!1:t===s.CHART_TYPE_CHORD&&(this._magicType[s.CHART_TYPE_FORCE]=!1),t===V?this._magicType[U]=!1:t===U&&(this._magicType[V]=!1),this.messageCenter.dispatch(s.EVENT.MAGIC_TYPE_CHANGED,e.event,{magicType:this._magicType},this.myChart)),!0},setMagicType:function(e){this._resetMark(),this._magicType=e,!this._isSilence&&this.messageCenter.dispatch(s.EVENT.MAGIC_TYPE_CHANGED,null,{magicType:this._magicType},this.myChart)},__onCustomHandler:function(e){var t=e.target.style.iconType,n=this.option.toolbox.feature[t].onclick;"function"==typeof n&&n.call(this,this.option)},reset:function(e,t){if(t&&this.clear(),this.query(e,"toolbox.show")&&this.query(e,"toolbox.feature.magicType.show")){var n=e.toolbox.feature.magicType.type,i=n.length;for(this._magicMap={};i--;)this._magicMap[n[i]]=!0;i=e.series.length;for(var a,o;i--;)a=e.series[i].type,this._magicMap[a]&&(o=e.xAxis instanceof Array?e.xAxis[e.series[i].xAxisIndex||0]:e.xAxis,o&&"category"===(o.type||"category")&&(o.__boundaryGap=null!=o.boundaryGap?o.boundaryGap:!0),o=e.yAxis instanceof Array?e.yAxis[e.series[i].yAxisIndex||0]:e.yAxis,o&&"category"===o.type&&(o.__boundaryGap=null!=o.boundaryGap?o.boundaryGap:!0),e.series[i].__type=a,e.series[i].__itemStyle=l.clone(e.series[i].itemStyle||{})),(this._magicMap[V]||this._magicMap[U])&&(e.series[i].__stack=e.series[i].stack)}this._magicType=t?{}:this._magicType||{};for(var r in this._magicType)if(this._magicType[r]){this.option=e,this.getMagicOption();break}var s=e.dataZoom;if(s&&s.show){var h=null!=s.start&&s.start>=0&&s.start<=100?s.start:0,m=null!=s.end&&s.end>=0&&s.end<=100?s.end:100;h>m&&(h+=m,m=h-m,h-=m),this._zoomQueue=[{start:h,end:m,start2:0,end2:100}]}else this._zoomQueue=[]},getMagicOption:function(){var e,t;if(this._magicType[s.CHART_TYPE_LINE]||this._magicType[s.CHART_TYPE_BAR]){for(var n=this._magicType[s.CHART_TYPE_LINE]?!1:!0,i=0,a=this.option.series.length;a>i;i++)t=this.option.series[i].type,(t==s.CHART_TYPE_LINE||t==s.CHART_TYPE_BAR)&&(e=this.option.xAxis instanceof Array?this.option.xAxis[this.option.series[i].xAxisIndex||0]:this.option.xAxis,e&&"category"===(e.type||"category")&&(e.boundaryGap=n?!0:e.__boundaryGap),e=this.option.yAxis instanceof Array?this.option.yAxis[this.option.series[i].yAxisIndex||0]:this.option.yAxis,e&&"category"===e.type&&(e.boundaryGap=n?!0:e.__boundaryGap));this._defaultMagic(s.CHART_TYPE_LINE,s.CHART_TYPE_BAR)}if(this._defaultMagic(s.CHART_TYPE_CHORD,s.CHART_TYPE_FORCE),this._defaultMagic(s.CHART_TYPE_PIE,s.CHART_TYPE_FUNNEL),this._magicType[V]||this._magicType[U])for(var i=0,a=this.option.series.length;a>i;i++)this._magicType[V]?(this.option.series[i].stack="_ECHARTS_STACK_KENER_2014_",t=V):this._magicType[U]&&(this.option.series[i].stack=null,t=U),this._featureOption[t+"Chart"]&&l.merge(this.option.series[i],this._featureOption[t+"Chart"]||{},!0);return this.option},_defaultMagic:function(e,t){if(this._magicType[e]||this._magicType[t])for(var n=0,i=this.option.series.length;i>n;n++){var a=this.option.series[n].type;(a==e||a==t)&&(this.option.series[n].type=this._magicType[e]?e:t,this.option.series[n].itemStyle=l.clone(this.option.series[n].__itemStyle),a=this.option.series[n].type,this._featureOption[a+"Chart"]&&l.merge(this.option.series[n],this._featureOption[a+"Chart"]||{},!0))}},silence:function(e){this._isSilence=e},resize:function(){this._resetMark(),this.clear(),this.option&&this.option.toolbox&&this.option.toolbox.show&&this._buildShape(),this._dataView&&this._dataView.resize()},hideDataView:function(){this._dataView&&this._dataView.hide()},clear:function(e){this.zr&&(this.zr.delShape(this.shapeList),this.shapeList=[],e||(this.zr.delShape(this._markShapeList),this._markShapeList=[]))},onbeforDispose:function(){this._dataView&&(this._dataView.dispose(),this._dataView=null),this._markShapeList=null},refresh:function(e){e&&(this._resetMark(),this._resetZoom(),e.toolbox=this.reformOption(e.toolbox),this.option=e,this.clear(!0),e.toolbox.show&&this._buildShape(),this.hideDataView())}},l.inherits(t,n),e("../component").define("toolbox",t),t}),n("echarts/component",[],function(){var e={},t={};return e.define=function(n,i){return t[n]=i,e},e.get=function(e){return t[e]},e}),n("echarts/component/title",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../config","zrender/tool/util","zrender/tool/area","zrender/tool/color","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Rectangle"),o=e("../config");o.title={zlevel:0,z:6,show:!0,text:"",subtext:"",x:"left",y:"top",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:5,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}};var r=e("zrender/tool/util"),s=e("zrender/tool/area"),l=e("zrender/tool/color");return t.prototype={type:o.COMPONENT_TYPE_TITLE,_buildShape:function(){if(this.titleOption.show){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildItem:function(){var e=this.titleOption.text,t=this.titleOption.link,n=this.titleOption.target,a=this.titleOption.subtext,o=this.titleOption.sublink,r=this.titleOption.subtarget,s=this.getFont(this.titleOption.textStyle),h=this.getFont(this.titleOption.subtextStyle),m=this._itemGroupLocation.x,V=this._itemGroupLocation.y,U=this._itemGroupLocation.width,d=this._itemGroupLocation.height,p={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{y:V,color:this.titleOption.textStyle.color,text:e,textFont:s,textBaseline:"top"},highlightStyle:{color:l.lift(this.titleOption.textStyle.color,1),brushType:"fill"},hoverable:!1};t&&(p.hoverable=!0,p.clickable=!0,p.onclick=function(){n&&"self"==n?window.location=t:window.open(t)});var c={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{y:V+d,color:this.titleOption.subtextStyle.color,text:a,textFont:h,textBaseline:"bottom"},highlightStyle:{color:l.lift(this.titleOption.subtextStyle.color,1),brushType:"fill"},hoverable:!1};switch(o&&(c.hoverable=!0,c.clickable=!0,c.onclick=function(){r&&"self"==r?window.location=o:window.open(o)}),this.titleOption.x){case"center":p.style.x=c.style.x=m+U/2,p.style.textAlign=c.style.textAlign="center";break;case"left":p.style.x=c.style.x=m,p.style.textAlign=c.style.textAlign="left";break;case"right":p.style.x=c.style.x=m+U,p.style.textAlign=c.style.textAlign="right";break;default:m=this.titleOption.x-0,m=isNaN(m)?0:m,p.style.x=c.style.x=m}this.titleOption.textAlign&&(p.style.textAlign=c.style.textAlign=this.titleOption.textAlign),this.shapeList.push(new i(p)),""!==a&&this.shapeList.push(new i(c))},_buildBackground:function(){var e=this.reformCssArray(this.titleOption.padding);this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-e[3],y:this._itemGroupLocation.y-e[0],width:this._itemGroupLocation.width+e[3]+e[1],height:this._itemGroupLocation.height+e[0]+e[2],brushType:0===this.titleOption.borderWidth?"fill":"both",color:this.titleOption.backgroundColor,strokeColor:this.titleOption.borderColor,lineWidth:this.titleOption.borderWidth}}))},_getItemGroupLocation:function(){var e,t=this.reformCssArray(this.titleOption.padding),n=this.titleOption.text,i=this.titleOption.subtext,a=this.getFont(this.titleOption.textStyle),o=this.getFont(this.titleOption.subtextStyle),r=Math.max(s.getTextWidth(n,a),s.getTextWidth(i,o)),l=s.getTextHeight(n,a)+(""===i?0:this.titleOption.itemGap+s.getTextHeight(i,o)),h=this.zr.getWidth();switch(this.titleOption.x){case"center":e=Math.floor((h-r)/2);break;case"left":e=t[3]+this.titleOption.borderWidth;break;case"right":e=h-r-t[1]-this.titleOption.borderWidth;break;default:e=this.titleOption.x-0,e=isNaN(e)?0:e}var m,V=this.zr.getHeight();switch(this.titleOption.y){case"top":m=t[0]+this.titleOption.borderWidth;break;case"bottom":m=V-l-t[2]-this.titleOption.borderWidth;break;case"center":m=Math.floor((V-l)/2);break;default:m=this.titleOption.y-0,m=isNaN(m)?0:m}return{x:e,y:m,width:r,height:l}},refresh:function(e){e&&(this.option=e,this.option.title=this.reformOption(this.option.title),this.titleOption=this.option.title,this.titleOption.textStyle=this.getTextStyle(this.titleOption.textStyle),this.titleOption.subtextStyle=this.getTextStyle(this.titleOption.subtextStyle)),this.clear(),this._buildShape()}},r.inherits(t,n),e("../component").define("title",t),t}),n("echarts/component/tooltip",["require","./base","../util/shape/Cross","zrender/shape/Line","zrender/shape/Rectangle","../config","../util/ecData","zrender/config","zrender/tool/event","zrender/tool/area","zrender/tool/color","zrender/tool/util","zrender/shape/Base","../component"],function(e){function t(e,t,o,r,s){n.call(this,e,t,o,r,s),this.dom=s.dom;var l=this;l._onmousemove=function(e){return l.__onmousemove(e)},l._onglobalout=function(e){return l.__onglobalout(e)},this.zr.on(h.EVENT.MOUSEMOVE,l._onmousemove),this.zr.on(h.EVENT.GLOBALOUT,l._onglobalout),l._hide=function(e){return l.__hide(e)},l._tryShow=function(e){return l.__tryShow(e)},l._refixed=function(e){return l.__refixed(e)},l._setContent=function(e,t){return l.__setContent(e,t)},this._tDom=this._tDom||document.createElement("div"),this._tDom.onselectstart=function(){return!1},this._tDom.onmouseover=function(){l._mousein=!0},this._tDom.onmouseout=function(){l._mousein=!1},this._tDom.className="echarts-tooltip",this._tDom.style.position="absolute",this.hasAppend=!1,this._axisLineShape&&this.zr.delShape(this._axisLineShape.id),this._axisLineShape=new a({zlevel:this.getZlevelBase(),z:this.getZBase(),invisible:!0,hoverable:!1}),this.shapeList.push(this._axisLineShape),this.zr.addShape(this._axisLineShape),this._axisShadowShape&&this.zr.delShape(this._axisShadowShape.id),this._axisShadowShape=new a({zlevel:this.getZlevelBase(),z:1,invisible:!0,hoverable:!1}),this.shapeList.push(this._axisShadowShape),this.zr.addShape(this._axisShadowShape),this._axisCrossShape&&this.zr.delShape(this._axisCrossShape.id),this._axisCrossShape=new i({zlevel:this.getZlevelBase(),z:this.getZBase(),invisible:!0,hoverable:!1}),this.shapeList.push(this._axisCrossShape),this.zr.addShape(this._axisCrossShape),this.showing=!1,this.refresh(r)}var n=e("./base"),i=e("../util/shape/Cross"),a=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),r=new o({}),s=e("../config");s.tooltip={zlevel:1,z:8,show:!0,showContent:!0,trigger:"item",islandFormatter:"{a} <br/>{b} : {c}",showDelay:20,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(0,0,0,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,axisPointer:{type:"line",lineStyle:{color:"#48b",width:2,type:"solid"},crossStyle:{color:"#1e90ff",width:1,type:"dashed"},shadowStyle:{color:"rgba(150,150,150,0.3)",width:"auto",type:"default"}},textStyle:{color:"#fff"}};var l=e("../util/ecData"),h=e("zrender/config"),m=e("zrender/tool/event"),V=e("zrender/tool/area"),U=e("zrender/tool/color"),d=e("zrender/tool/util"),p=e("zrender/shape/Base");return t.prototype={type:s.COMPONENT_TYPE_TOOLTIP,_gCssText:"position:absolute;display:block;border-style:solid;white-space:nowrap;",_style:function(e){if(!e)return"";var t=[];if(e.transitionDuration){var n="left "+e.transitionDuration+"s,top "+e.transitionDuration+"s";t.push("transition:"+n),t.push("-moz-transition:"+n),t.push("-webkit-transition:"+n),t.push("-o-transition:"+n)}e.backgroundColor&&(t.push("background-Color:"+U.toHex(e.backgroundColor)),t.push("filter:alpha(opacity=70)"),t.push("background-Color:"+e.backgroundColor)),null!=e.borderWidth&&t.push("border-width:"+e.borderWidth+"px"),null!=e.borderColor&&t.push("border-color:"+e.borderColor),null!=e.borderRadius&&(t.push("border-radius:"+e.borderRadius+"px"),t.push("-moz-border-radius:"+e.borderRadius+"px"),t.push("-webkit-border-radius:"+e.borderRadius+"px"),t.push("-o-border-radius:"+e.borderRadius+"px"));var i=e.textStyle;i&&(i.color&&t.push("color:"+i.color),i.decoration&&t.push("text-decoration:"+i.decoration),i.align&&t.push("text-align:"+i.align),i.fontFamily&&t.push("font-family:"+i.fontFamily),i.fontSize&&t.push("font-size:"+i.fontSize+"px"),i.fontSize&&t.push("line-height:"+Math.round(3*i.fontSize/2)+"px"),i.fontStyle&&t.push("font-style:"+i.fontStyle),i.fontWeight&&t.push("font-weight:"+i.fontWeight));var a=e.padding;return null!=a&&(a=this.reformCssArray(a),t.push("padding:"+a[0]+"px "+a[1]+"px "+a[2]+"px "+a[3]+"px")),t=t.join(";")+";"},__hide:function(){this._lastDataIndex=-1,this._lastSeriesIndex=-1,this._lastItemTriggerId=-1,this._tDom&&(this._tDom.style.display="none");var e=!1;this._axisLineShape.invisible||(this._axisLineShape.invisible=!0,this.zr.modShape(this._axisLineShape.id),e=!0),this._axisShadowShape.invisible||(this._axisShadowShape.invisible=!0,this.zr.modShape(this._axisShadowShape.id),e=!0),this._axisCrossShape.invisible||(this._axisCrossShape.invisible=!0,this.zr.modShape(this._axisCrossShape.id),e=!0),this._lastTipShape&&this._lastTipShape.tipShape.length>0&&(this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2),e&&this.zr.refreshNextFrame(),this.showing=!1},_show:function(e,t,n,i){var a=this._tDom.offsetHeight,o=this._tDom.offsetWidth;e&&("function"==typeof e&&(e=e([t,n])),e instanceof Array&&(t=e[0],n=e[1])),t+o>this._zrWidth&&(t-=o+40),n+a>this._zrHeight&&(n-=a-20),20>n&&(n=0),this._tDom.style.cssText=this._gCssText+this._defaultCssText+(i?i:"")+"left:"+t+"px;top:"+n+"px;",(10>a||10>o)&&setTimeout(this._refixed,20),this.showing=!0
-},__refixed:function(){if(this._tDom){var e="",t=this._tDom.offsetHeight,n=this._tDom.offsetWidth;this._tDom.offsetLeft+n>this._zrWidth&&(e+="left:"+(this._zrWidth-n-20)+"px;"),this._tDom.offsetTop+t>this._zrHeight&&(e+="top:"+(this._zrHeight-t-10)+"px;"),""!==e&&(this._tDom.style.cssText+=e)}},__tryShow:function(){var e,t;if(this._curTarget){if("island"===this._curTarget._type&&this.option.tooltip.show)return void this._showItemTrigger();var n=l.get(this._curTarget,"series"),i=l.get(this._curTarget,"data");e=this.deepQuery([i,n,this.option],"tooltip.show"),null!=n&&null!=i&&e?(t=this.deepQuery([i,n,this.option],"tooltip.trigger"),"axis"===t?this._showAxisTrigger(n.xAxisIndex,n.yAxisIndex,l.get(this._curTarget,"dataIndex")):this._showItemTrigger()):(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay))}else this._findPolarTrigger()||this._findAxisTrigger()},_findAxisTrigger:function(){if(!this.component.xAxis||!this.component.yAxis)return void(this._hidingTicket=setTimeout(this._hide,this._hideDelay));for(var e,t,n=this.option.series,i=0,a=n.length;a>i;i++)if("axis"===this.deepQuery([n[i],this.option],"tooltip.trigger"))return e=n[i].xAxisIndex||0,t=n[i].yAxisIndex||0,this.component.xAxis.getAxis(e)&&this.component.xAxis.getAxis(e).type===s.COMPONENT_TYPE_AXIS_CATEGORY?void this._showAxisTrigger(e,t,this._getNearestDataIndex("x",this.component.xAxis.getAxis(e))):this.component.yAxis.getAxis(t)&&this.component.yAxis.getAxis(t).type===s.COMPONENT_TYPE_AXIS_CATEGORY?void this._showAxisTrigger(e,t,this._getNearestDataIndex("y",this.component.yAxis.getAxis(t))):void this._showAxisTrigger(e,t,-1);"cross"===this.option.tooltip.axisPointer.type&&this._showAxisTrigger(-1,-1,-1)},_findPolarTrigger:function(){if(!this.component.polar)return!1;var e,t=m.getX(this._event),n=m.getY(this._event),i=this.component.polar.getNearestIndex([t,n]);return i?(e=i.valueIndex,i=i.polarIndex):i=-1,-1!=i?this._showPolarTrigger(i,e):!1},_getNearestDataIndex:function(e,t){var n=-1,i=m.getX(this._event),a=m.getY(this._event);if("x"===e){for(var o,r,s=this.component.grid.getXend(),l=t.getCoordByIndex(n);s>l&&(r=l,i>=l);)o=l,l=t.getCoordByIndex(++n);return 0>=n?n=0:r-i>=i-o?n-=1:null==t.getNameByIndex(n)&&(n-=1),n}for(var h,V,U=this.component.grid.getY(),l=t.getCoordByIndex(n);l>U&&(h=l,l>=a);)V=l,l=t.getCoordByIndex(++n);return 0>=n?n=0:a-h>=V-a?n-=1:null==t.getNameByIndex(n)&&(n-=1),n},_showAxisTrigger:function(e,t,n){if(!this._event.connectTrigger&&this.messageCenter.dispatch(s.EVENT.TOOLTIP_IN_GRID,this._event,null,this.myChart),null==this.component.xAxis||null==this.component.yAxis||null==e||null==t)return clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),void(this._hidingTicket=setTimeout(this._hide,this._hideDelay));var i,a,o,r,l=this.option.series,h=[],V=[],U="";if("axis"===this.option.tooltip.trigger){if(!this.option.tooltip.show)return;a=this.option.tooltip.formatter,o=this.option.tooltip.position}var d,p,c=-1!=e&&this.component.xAxis.getAxis(e).type===s.COMPONENT_TYPE_AXIS_CATEGORY?"xAxis":-1!=t&&this.component.yAxis.getAxis(t).type===s.COMPONENT_TYPE_AXIS_CATEGORY?"yAxis":!1;if(c){var u="xAxis"==c?e:t;i=this.component[c].getAxis(u);for(var y=0,g=l.length;g>y;y++)this._isSelected(l[y].name)&&l[y][c+"Index"]===u&&"axis"===this.deepQuery([l[y],this.option],"tooltip.trigger")&&(r=this.query(l[y],"tooltip.showContent")||r,a=this.query(l[y],"tooltip.formatter")||a,o=this.query(l[y],"tooltip.position")||o,U+=this._style(this.query(l[y],"tooltip")),null!=l[y].stack&&"xAxis"==c?(h.unshift(l[y]),V.unshift(y)):(h.push(l[y]),V.push(y)));this.messageCenter.dispatch(s.EVENT.TOOLTIP_HOVER,this._event,{seriesIndex:V,dataIndex:n},this.myChart);var b;"xAxis"==c?(d=this.subPixelOptimize(i.getCoordByIndex(n),this._axisLineWidth),p=m.getY(this._event),b=[d,this.component.grid.getY(),d,this.component.grid.getYend()]):(d=m.getX(this._event),p=this.subPixelOptimize(i.getCoordByIndex(n),this._axisLineWidth),b=[this.component.grid.getX(),p,this.component.grid.getXend(),p]),this._styleAxisPointer(h,b[0],b[1],b[2],b[3],i.getGap(),d,p)}else d=m.getX(this._event),p=m.getY(this._event),this._styleAxisPointer(l,this.component.grid.getX(),p,this.component.grid.getXend(),p,0,d,p),n>=0?this._showItemTrigger(!0):(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._tDom.style.display="none");if(h.length>0){if(this._lastItemTriggerId=-1,this._lastDataIndex!=n||this._lastSeriesIndex!=V[0]){this._lastDataIndex=n,this._lastSeriesIndex=V[0];var f,k;if("function"==typeof a){for(var x=[],y=0,g=h.length;g>y;y++)f=h[y].data[n],k=this.getDataFromOption(f,"-"),x.push({seriesIndex:V[y],seriesName:h[y].name||"",series:h[y],dataIndex:n,data:f,name:i.getNameByIndex(n),value:k,0:h[y].name||"",1:i.getNameByIndex(n),2:k,3:f});this._curTicket="axis:"+n,this._tDom.innerHTML=a.call(this.myChart,x,this._curTicket,this._setContent)}else if("string"==typeof a){this._curTicket=0/0,a=a.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}");for(var y=0,g=h.length;g>y;y++)a=a.replace("{a"+y+"}",this._encodeHTML(h[y].name||"")),a=a.replace("{b"+y+"}",this._encodeHTML(i.getNameByIndex(n))),f=h[y].data[n],f=this.getDataFromOption(f,"-"),a=a.replace("{c"+y+"}",f instanceof Array?f:this.numAddCommas(f));this._tDom.innerHTML=a}else{this._curTicket=0/0,a=this._encodeHTML(i.getNameByIndex(n));for(var y=0,g=h.length;g>y;y++)a+="<br/>"+this._encodeHTML(h[y].name||"")+" : ",f=h[y].data[n],f=this.getDataFromOption(f,"-"),a+=f instanceof Array?f:this.numAddCommas(f);this._tDom.innerHTML=a}}if(r===!1||!this.option.tooltip.showContent)return;this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(o,d+10,p+10,U)}},_showPolarTrigger:function(e,t){if(null==this.component.polar||null==e||null==t||0>t)return!1;var n,i,a,o=this.option.series,r=[],s=[],l="";if("axis"===this.option.tooltip.trigger){if(!this.option.tooltip.show)return!1;n=this.option.tooltip.formatter,i=this.option.tooltip.position}for(var h=this.option.polar[e].indicator[t].text,V=0,U=o.length;U>V;V++)this._isSelected(o[V].name)&&o[V].polarIndex===e&&"axis"===this.deepQuery([o[V],this.option],"tooltip.trigger")&&(a=this.query(o[V],"tooltip.showContent")||a,n=this.query(o[V],"tooltip.formatter")||n,i=this.query(o[V],"tooltip.position")||i,l+=this._style(this.query(o[V],"tooltip")),r.push(o[V]),s.push(V));if(r.length>0){for(var d,p,c,u=[],V=0,U=r.length;U>V;V++){d=r[V].data;for(var y=0,g=d.length;g>y;y++)p=d[y],this._isSelected(p.name)&&(p=null!=p?p:{name:"",value:{dataIndex:"-"}},c=this.getDataFromOption(p.value[t]),u.push({seriesIndex:s[V],seriesName:r[V].name||"",series:r[V],dataIndex:t,data:p,name:p.name,indicator:h,value:c,0:r[V].name||"",1:p.name,2:c,3:h}))}if(u.length<=0)return;if(this._lastItemTriggerId=-1,this._lastDataIndex!=t||this._lastSeriesIndex!=s[0])if(this._lastDataIndex=t,this._lastSeriesIndex=s[0],"function"==typeof n)this._curTicket="axis:"+t,this._tDom.innerHTML=n.call(this.myChart,u,this._curTicket,this._setContent);else if("string"==typeof n){n=n.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}");for(var V=0,U=u.length;U>V;V++)n=n.replace("{a"+V+"}",this._encodeHTML(u[V].seriesName)),n=n.replace("{b"+V+"}",this._encodeHTML(u[V].name)),n=n.replace("{c"+V+"}",this.numAddCommas(u[V].value)),n=n.replace("{d"+V+"}",this._encodeHTML(u[V].indicator));this._tDom.innerHTML=n}else{n=this._encodeHTML(u[0].name)+"<br/>"+this._encodeHTML(u[0].indicator)+" : "+this.numAddCommas(u[0].value);for(var V=1,U=u.length;U>V;V++)n+="<br/>"+this._encodeHTML(u[V].name)+"<br/>",n+=this._encodeHTML(u[V].indicator)+" : "+this.numAddCommas(u[V].value);this._tDom.innerHTML=n}if(a===!1||!this.option.tooltip.showContent)return;return this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(i,m.getX(this._event),m.getY(this._event),l),!0}},_showItemTrigger:function(e){if(this._curTarget){var t,n,i,a=l.get(this._curTarget,"series"),o=l.get(this._curTarget,"seriesIndex"),r=l.get(this._curTarget,"data"),h=l.get(this._curTarget,"dataIndex"),V=l.get(this._curTarget,"name"),U=l.get(this._curTarget,"value"),d=l.get(this._curTarget,"special"),p=l.get(this._curTarget,"special2"),c=[r,a,this.option],u="";if("island"!=this._curTarget._type){var y=e?"axis":"item";this.option.tooltip.trigger===y&&(t=this.option.tooltip.formatter,n=this.option.tooltip.position),this.query(a,"tooltip.trigger")===y&&(i=this.query(a,"tooltip.showContent")||i,t=this.query(a,"tooltip.formatter")||t,n=this.query(a,"tooltip.position")||n,u+=this._style(this.query(a,"tooltip"))),i=this.query(r,"tooltip.showContent")||i,t=this.query(r,"tooltip.formatter")||t,n=this.query(r,"tooltip.position")||n,u+=this._style(this.query(r,"tooltip"))}else this._lastItemTriggerId=0/0,i=this.deepQuery(c,"tooltip.showContent"),t=this.deepQuery(c,"tooltip.islandFormatter"),n=this.deepQuery(c,"tooltip.islandPosition");this._lastDataIndex=-1,this._lastSeriesIndex=-1,this._lastItemTriggerId!==this._curTarget.id&&(this._lastItemTriggerId=this._curTarget.id,"function"==typeof t?(this._curTicket=(a.name||"")+":"+h,this._tDom.innerHTML=t.call(this.myChart,{seriesIndex:o,seriesName:a.name||"",series:a,dataIndex:h,data:r,name:V,value:U,percent:d,indicator:d,value2:p,indicator2:p,0:a.name||"",1:V,2:U,3:d,4:p,5:r,6:o,7:h},this._curTicket,this._setContent)):"string"==typeof t?(this._curTicket=0/0,t=t.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}"),t=t.replace("{a0}",this._encodeHTML(a.name||"")).replace("{b0}",this._encodeHTML(V)).replace("{c0}",U instanceof Array?U:this.numAddCommas(U)),t=t.replace("{d}","{d0}").replace("{d0}",d||""),t=t.replace("{e}","{e0}").replace("{e0}",l.get(this._curTarget,"special2")||""),this._tDom.innerHTML=t):(this._curTicket=0/0,this._tDom.innerHTML=a.type===s.CHART_TYPE_RADAR&&d?this._itemFormatter.radar.call(this,a,V,U,d):a.type===s.CHART_TYPE_EVENTRIVER?this._itemFormatter.eventRiver.call(this,a,V,U,r):""+(null!=a.name?this._encodeHTML(a.name)+"<br/>":"")+(""===V?"":this._encodeHTML(V)+" : ")+(U instanceof Array?U:this.numAddCommas(U))));var g=m.getX(this._event),b=m.getY(this._event);this.deepQuery(c,"tooltip.axisPointer.show")&&this.component.grid&&this._styleAxisPointer([a],this.component.grid.getX(),b,this.component.grid.getXend(),b,0,g,b),i!==!1&&this.option.tooltip.showContent&&(this.hasAppend||(this._tDom.style.left=this._zrWidth/2+"px",this._tDom.style.top=this._zrHeight/2+"px",this.dom.firstChild.appendChild(this._tDom),this.hasAppend=!0),this._show(n,g+20,b-20,u))}},_itemFormatter:{radar:function(e,t,n,i){var a="";a+=this._encodeHTML(""===t?e.name||"":t),a+=""===a?"":"<br />";for(var o=0;o<i.length;o++)a+=this._encodeHTML(i[o].text)+" : "+this.numAddCommas(n[o])+"<br />";return a},chord:function(e,t,n,i,a){if(null==a)return this._encodeHTML(t)+" ("+this.numAddCommas(n)+")";var o=this._encodeHTML(t),r=this._encodeHTML(i);return""+(null!=e.name?this._encodeHTML(e.name)+"<br/>":"")+o+" -> "+r+" ("+this.numAddCommas(n)+")<br />"+r+" -> "+o+" ("+this.numAddCommas(a)+")"},eventRiver:function(e,t,n,i){var a="";a+=this._encodeHTML(""===e.name?"":e.name+" : "),a+=this._encodeHTML(t),a+=""===a?"":"<br />",i=i.evolution;for(var o=0,r=i.length;r>o;o++)a+='<div style="padding-top:5px;">',i[o].detail&&(i[o].detail.img&&(a+='<img src="'+i[o].detail.img+'" style="float:left;width:40px;height:40px;">'),a+='<div style="margin-left:45px;">'+i[o].time+"<br/>",a+='<a href="'+i[o].detail.link+'" target="_blank">',a+=i[o].detail.text+"</a></div>",a+="</div>");return a}},_styleAxisPointer:function(e,t,n,i,a,o,r,s){if(e.length>0){var l,h,m=this.option.tooltip.axisPointer,V=m.type,U={line:{},cross:{},shadow:{}};for(var d in U)U[d].color=m[d+"Style"].color,U[d].width=m[d+"Style"].width,U[d].type=m[d+"Style"].type;for(var p=0,c=e.length;c>p;p++)l=e[p],h=this.query(l,"tooltip.axisPointer.type"),V=h||V,h&&(U[h].color=this.query(l,"tooltip.axisPointer."+h+"Style.color")||U[h].color,U[h].width=this.query(l,"tooltip.axisPointer."+h+"Style.width")||U[h].width,U[h].type=this.query(l,"tooltip.axisPointer."+h+"Style.type")||U[h].type);if("line"===V){var u=U.line.width,y=t==i;this._axisLineShape.style={xStart:y?this.subPixelOptimize(t,u):t,yStart:y?n:this.subPixelOptimize(n,u),xEnd:y?this.subPixelOptimize(i,u):i,yEnd:y?a:this.subPixelOptimize(a,u),strokeColor:U.line.color,lineWidth:u,lineType:U.line.type},this._axisLineShape.invisible=!1,this.zr.modShape(this._axisLineShape.id)}else if("cross"===V){var g=U.cross.width;this._axisCrossShape.style={brushType:"stroke",rect:this.component.grid.getArea(),x:this.subPixelOptimize(r,g),y:this.subPixelOptimize(s,g),text:("( "+this.component.xAxis.getAxis(0).getValueFromCoord(r)+" , "+this.component.yAxis.getAxis(0).getValueFromCoord(s)+" )").replace(" , "," ").replace(" , "," "),textPosition:"specific",strokeColor:U.cross.color,lineWidth:g,lineType:U.cross.type},this.component.grid.getXend()-r>100?(this._axisCrossShape.style.textAlign="left",this._axisCrossShape.style.textX=r+10):(this._axisCrossShape.style.textAlign="right",this._axisCrossShape.style.textX=r-10),s-this.component.grid.getY()>50?(this._axisCrossShape.style.textBaseline="bottom",this._axisCrossShape.style.textY=s-10):(this._axisCrossShape.style.textBaseline="top",this._axisCrossShape.style.textY=s+10),this._axisCrossShape.invisible=!1,this.zr.modShape(this._axisCrossShape.id)}else"shadow"===V&&((null==U.shadow.width||"auto"===U.shadow.width||isNaN(U.shadow.width))&&(U.shadow.width=o),t===i?Math.abs(this.component.grid.getX()-t)<2?(U.shadow.width/=2,t=i+=U.shadow.width/2):Math.abs(this.component.grid.getXend()-t)<2&&(U.shadow.width/=2,t=i-=U.shadow.width/2):n===a&&(Math.abs(this.component.grid.getY()-n)<2?(U.shadow.width/=2,n=a+=U.shadow.width/2):Math.abs(this.component.grid.getYend()-n)<2&&(U.shadow.width/=2,n=a-=U.shadow.width/2)),this._axisShadowShape.style={xStart:t,yStart:n,xEnd:i,yEnd:a,strokeColor:U.shadow.color,lineWidth:U.shadow.width},this._axisShadowShape.invisible=!1,this.zr.modShape(this._axisShadowShape.id));this.zr.refreshNextFrame()}},__onmousemove:function(e){if(clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),!this._mousein||!this._enterable){var t=e.target,n=m.getX(e.event),i=m.getY(e.event);if(t){this._curTarget=t,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=i;var a;if(this._needAxisTrigger&&this.component.polar&&-1!=(a=this.component.polar.isInside([n,i])))for(var o=this.option.series,l=0,h=o.length;h>l;l++)if(o[l].polarIndex===a&&"axis"===this.deepQuery([o[l],this.option],"tooltip.trigger")){this._curTarget=null;break}this._showingTicket=setTimeout(this._tryShow,this._showDelay)}else this._curTarget=!1,this._event=e.event,this._event.zrenderX=n,this._event.zrenderY=i,this._needAxisTrigger&&this.component.grid&&V.isInside(r,this.component.grid.getArea(),n,i)?this._showingTicket=setTimeout(this._tryShow,this._showDelay):this._needAxisTrigger&&this.component.polar&&-1!=this.component.polar.isInside([n,i])?this._showingTicket=setTimeout(this._tryShow,this._showDelay):(!this._event.connectTrigger&&this.messageCenter.dispatch(s.EVENT.TOOLTIP_OUT_GRID,this._event,null,this.myChart),this._hidingTicket=setTimeout(this._hide,this._hideDelay))}},__onglobalout:function(){clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this._hidingTicket=setTimeout(this._hide,this._hideDelay)},__setContent:function(e,t){this._tDom&&(e===this._curTicket&&(this._tDom.innerHTML=t),setTimeout(this._refixed,20))},ontooltipHover:function(e,t){if(!this._lastTipShape||this._lastTipShape&&this._lastTipShape.dataIndex!=e.dataIndex){this._lastTipShape&&this._lastTipShape.tipShape.length>0&&(this.zr.delShape(this._lastTipShape.tipShape),this.shapeList.length=2);for(var n=0,i=t.length;i>n;n++)t[n].zlevel=this.getZlevelBase(),t[n].z=this.getZBase(),t[n].style=p.prototype.getHighlightStyle(t[n].style,t[n].highlightStyle),t[n].draggable=!1,t[n].hoverable=!1,t[n].clickable=!1,t[n].ondragend=null,t[n].ondragover=null,t[n].ondrop=null,this.shapeList.push(t[n]),this.zr.addShape(t[n]);this._lastTipShape={dataIndex:e.dataIndex,tipShape:t}}},ondragend:function(){this._hide()},onlegendSelected:function(e){this._selectedMap=e.selected},_setSelectedMap:function(){this._selectedMap=this.component.legend?d.clone(this.component.legend.getSelectedMap()):{}},_isSelected:function(e){return null!=this._selectedMap[e]?this._selectedMap[e]:!0},showTip:function(e){if(e){var t,n=this.option.series;if(null!=e.seriesIndex)t=e.seriesIndex;else for(var i=e.seriesName,a=0,o=n.length;o>a;a++)if(n[a].name===i){t=a;break}var r=n[t];if(null!=r){var m=this.myChart.chart[r.type],V="axis"===this.deepQuery([r,this.option],"tooltip.trigger");if(m)if(V){var U=e.dataIndex;switch(m.type){case s.CHART_TYPE_LINE:case s.CHART_TYPE_BAR:case s.CHART_TYPE_K:if(null==this.component.xAxis||null==this.component.yAxis||r.data.length<=U)return;var d=r.xAxisIndex||0,p=r.yAxisIndex||0;this._event=this.component.xAxis.getAxis(d).type===s.COMPONENT_TYPE_AXIS_CATEGORY?{zrenderX:this.component.xAxis.getAxis(d).getCoordByIndex(U),zrenderY:this.component.grid.getY()+(this.component.grid.getYend()-this.component.grid.getY())/4}:{zrenderX:this.component.grid.getX()+(this.component.grid.getXend()-this.component.grid.getX())/4,zrenderY:this.component.yAxis.getAxis(p).getCoordByIndex(U)},this._showAxisTrigger(d,p,U);break;case s.CHART_TYPE_RADAR:if(null==this.component.polar||r.data[0].value.length<=U)return;var c=r.polarIndex||0,u=this.component.polar.getVector(c,U,"max");this._event={zrenderX:u[0],zrenderY:u[1]},this._showPolarTrigger(c,U)}}else{var y,g,b=m.shapeList;switch(m.type){case s.CHART_TYPE_LINE:case s.CHART_TYPE_BAR:case s.CHART_TYPE_K:case s.CHART_TYPE_SCATTER:for(var U=e.dataIndex,a=0,o=b.length;o>a;a++)if(null==b[a]._mark&&l.get(b[a],"seriesIndex")==t&&l.get(b[a],"dataIndex")==U){this._curTarget=b[a],y=b[a].style.x,g=m.type!=s.CHART_TYPE_K?b[a].style.y:b[a].style.y[0];break}break;case s.CHART_TYPE_RADAR:for(var U=e.dataIndex,a=0,o=b.length;o>a;a++)if("polygon"===b[a].type&&l.get(b[a],"seriesIndex")==t&&l.get(b[a],"dataIndex")==U){this._curTarget=b[a];var u=this.component.polar.getCenter(r.polarIndex||0);y=u[0],g=u[1];break}break;case s.CHART_TYPE_PIE:for(var f=e.name,a=0,o=b.length;o>a;a++)if("sector"===b[a].type&&l.get(b[a],"seriesIndex")==t&&l.get(b[a],"name")==f){this._curTarget=b[a];var k=this._curTarget.style,x=(k.startAngle+k.endAngle)/2*Math.PI/180;y=this._curTarget.style.x+Math.cos(x)*k.r/1.5,g=this._curTarget.style.y-Math.sin(x)*k.r/1.5;break}break;case s.CHART_TYPE_MAP:for(var f=e.name,_=r.mapType,a=0,o=b.length;o>a;a++)if("text"===b[a].type&&b[a]._mapType===_&&b[a].style._name===f){this._curTarget=b[a],y=this._curTarget.style.x+this._curTarget.position[0],g=this._curTarget.style.y+this._curTarget.position[1];break}break;case s.CHART_TYPE_CHORD:for(var f=e.name,a=0,o=b.length;o>a;a++)if("sector"===b[a].type&&l.get(b[a],"name")==f){this._curTarget=b[a];var k=this._curTarget.style,x=(k.startAngle+k.endAngle)/2*Math.PI/180;return y=this._curTarget.style.x+Math.cos(x)*(k.r-2),g=this._curTarget.style.y-Math.sin(x)*(k.r-2),void this.zr.trigger(h.EVENT.MOUSEMOVE,{zrenderX:y,zrenderY:g})}break;case s.CHART_TYPE_FORCE:for(var f=e.name,a=0,o=b.length;o>a;a++)if("circle"===b[a].type&&l.get(b[a],"name")==f){this._curTarget=b[a],y=this._curTarget.position[0],g=this._curTarget.position[1];break}}null!=y&&null!=g&&(this._event={zrenderX:y,zrenderY:g},this.zr.addHoverShape(this._curTarget),this.zr.refreshHover(),this._showItemTrigger())}}}},hideTip:function(){this._hide()},refresh:function(e){if(this._zrHeight=this.zr.getHeight(),this._zrWidth=this.zr.getWidth(),this._lastTipShape&&this._lastTipShape.tipShape.length>0&&this.zr.delShape(this._lastTipShape.tipShape),this._lastTipShape=!1,this.shapeList.length=2,this._lastDataIndex=-1,this._lastSeriesIndex=-1,this._lastItemTriggerId=-1,e){this.option=e,this.option.tooltip=this.reformOption(this.option.tooltip),this.option.tooltip.textStyle=d.merge(this.option.tooltip.textStyle,this.ecTheme.textStyle),this._needAxisTrigger=!1,"axis"===this.option.tooltip.trigger&&(this._needAxisTrigger=!0);for(var t=this.option.series,n=0,i=t.length;i>n;n++)if("axis"===this.query(t[n],"tooltip.trigger")){this._needAxisTrigger=!0;break}this._showDelay=this.option.tooltip.showDelay,this._hideDelay=this.option.tooltip.hideDelay,this._defaultCssText=this._style(this.option.tooltip),this._setSelectedMap(),this._axisLineWidth=this.option.tooltip.axisPointer.lineStyle.width,this._enterable=this.option.tooltip.enterable}if(this.showing){var a=this;setTimeout(function(){a.zr.trigger(h.EVENT.MOUSEMOVE,a.zr.handler._event)},50)}},onbeforDispose:function(){this._lastTipShape&&this._lastTipShape.tipShape.length>0&&this.zr.delShape(this._lastTipShape.tipShape),clearTimeout(this._hidingTicket),clearTimeout(this._showingTicket),this.zr.un(h.EVENT.MOUSEMOVE,this._onmousemove),this.zr.un(h.EVENT.GLOBALOUT,this._onglobalout),this.hasAppend&&this.dom.firstChild&&this.dom.firstChild.removeChild(this._tDom),this._tDom=null},_encodeHTML:function(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}},d.inherits(t,n),e("../component").define("tooltip",t),t}),n("echarts/component/legend",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","zrender/shape/Sector","../util/shape/Icon","../util/shape/Candle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function t(e,t,i,a,o){if(!this.query(a,"legend.data"))return void console.error("option.legend.data has not been defined.");n.call(this,e,t,i,a,o);var r=this;r._legendSelected=function(e){r.__legendSelected(e)},r._dispatchHoverLink=function(e){return r.__dispatchHoverLink(e)},this._colorIndex=0,this._colorMap={},this._selectedMap={},this._hasDataMap={},this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Rectangle"),o=e("zrender/shape/Sector"),r=e("../util/shape/Icon"),s=e("../util/shape/Candle"),l=e("../config");l.legend={zlevel:0,z:4,show:!0,orient:"horizontal",x:"center",y:"top",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemWidth:20,itemHeight:14,textStyle:{color:"#333"},selectedMode:!0};var h=e("zrender/tool/util"),m=e("zrender/tool/area");t.prototype={type:l.COMPONENT_TYPE_LEGEND,_buildShape:function(){if(this.legendOption.show){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildItem:function(){var e,t,n,a,o,s,l,V,U=this.legendOption.data,d=U.length,p=this.legendOption.textStyle,c=this.zr.getWidth(),u=this.zr.getHeight(),y=this._itemGroupLocation.x,g=this._itemGroupLocation.y,b=this.legendOption.itemWidth,f=this.legendOption.itemHeight,k=this.legendOption.itemGap;"vertical"===this.legendOption.orient&&"right"===this.legendOption.x&&(y=this._itemGroupLocation.x+this._itemGroupLocation.width-b);for(var x=0;d>x;x++)o=h.merge(U[x].textStyle||{},p),s=this.getFont(o),e=this._getName(U[x]),l=this._getFormatterName(e),""!==e?(t=U[x].icon||this._getSomethingByName(e).type,V=this.getColor(e),"horizontal"===this.legendOption.orient?200>c-y&&b+5+m.getTextWidth(l,s)+(x===d-1||""===U[x+1]?0:k)>=c-y&&(y=this._itemGroupLocation.x,g+=f+k):200>u-g&&f+(x===d-1||""===U[x+1]?0:k)>=u-g&&("right"===this.legendOption.x?y-=this._itemGroupLocation.maxWidth+k:y+=this._itemGroupLocation.maxWidth+k,g=this._itemGroupLocation.y),n=this._getItemShapeByType(y,g,b,f,this._selectedMap[e]&&this._hasDataMap[e]?V:"#ccc",t,V),n._name=e,n=new r(n),a={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:y+b+5,y:g+f/2,color:this._selectedMap[e]?"auto"===o.color?V:o.color:"#ccc",text:l,textFont:s,textBaseline:"middle"},highlightStyle:{color:V,brushType:"fill"},hoverable:!!this.legendOption.selectedMode,clickable:!!this.legendOption.selectedMode},"vertical"===this.legendOption.orient&&"right"===this.legendOption.x&&(a.style.x-=b+10,a.style.textAlign="right"),a._name=e,a=new i(a),this.legendOption.selectedMode&&(n.onclick=a.onclick=this._legendSelected,n.onmouseover=a.onmouseover=this._dispatchHoverLink,n.hoverConnect=a.id,a.hoverConnect=n.id),this.shapeList.push(n),this.shapeList.push(a),"horizontal"===this.legendOption.orient?y+=b+5+m.getTextWidth(l,s)+k:g+=f+k):"horizontal"===this.legendOption.orient?(y=this._itemGroupLocation.x,g+=f+k):("right"===this.legendOption.x?y-=this._itemGroupLocation.maxWidth+k:y+=this._itemGroupLocation.maxWidth+k,g=this._itemGroupLocation.y);"horizontal"===this.legendOption.orient&&"center"===this.legendOption.x&&g!=this._itemGroupLocation.y&&this._mLineOptimize()},_getName:function(e){return"undefined"!=typeof e.name?e.name:e},_getFormatterName:function(e){var t,n=this.legendOption.formatter;return t="function"==typeof n?n.call(this.myChart,e):"string"==typeof n?n.replace("{name}",e):e},_getFormatterNameFromData:function(e){var t=this._getName(e);return this._getFormatterName(t)},_mLineOptimize:function(){for(var e=[],t=this._itemGroupLocation.x,n=2,i=this.shapeList.length;i>n;n++)this.shapeList[n].style.x===t?e.push((this._itemGroupLocation.width-(this.shapeList[n-1].style.x+m.getTextWidth(this.shapeList[n-1].style.text,this.shapeList[n-1].style.textFont)-t))/2):n===i-1&&e.push((this._itemGroupLocation.width-(this.shapeList[n].style.x+m.getTextWidth(this.shapeList[n].style.text,this.shapeList[n].style.textFont)-t))/2);for(var a=-1,n=1,i=this.shapeList.length;i>n;n++)this.shapeList[n].style.x===t&&a++,0!==e[a]&&(this.shapeList[n].style.x+=e[a])},_buildBackground:function(){var e=this.reformCssArray(this.legendOption.padding);this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-e[3],y:this._itemGroupLocation.y-e[0],width:this._itemGroupLocation.width+e[3]+e[1],height:this._itemGroupLocation.height+e[0]+e[2],brushType:0===this.legendOption.borderWidth?"fill":"both",color:this.legendOption.backgroundColor,strokeColor:this.legendOption.borderColor,lineWidth:this.legendOption.borderWidth}}))},_getItemGroupLocation:function(){var e=this.legendOption.data,t=e.length,n=this.legendOption.itemGap,i=this.legendOption.itemWidth+5,a=this.legendOption.itemHeight,o=this.legendOption.textStyle,r=this.getFont(o),s=0,l=0,V=this.reformCssArray(this.legendOption.padding),U=this.zr.getWidth()-V[1]-V[3],d=this.zr.getHeight()-V[0]-V[2],p=0,c=0;if("horizontal"===this.legendOption.orient){l=a;for(var u=0;t>u;u++)if(""!==this._getName(e[u])){var y=m.getTextWidth(this._getFormatterNameFromData(e[u]),e[u].textStyle?this.getFont(h.merge(e[u].textStyle||{},o)):r);p+i+y+n>U?(p-=n,s=Math.max(s,p),l+=a+n,p=0):(p+=i+y+n,s=Math.max(s,p-n))}else p-=n,s=Math.max(s,p),l+=a+n,p=0}else{for(var u=0;t>u;u++)c=Math.max(c,m.getTextWidth(this._getFormatterNameFromData(e[u]),e[u].textStyle?this.getFont(h.merge(e[u].textStyle||{},o)):r));c+=i,s=c;for(var u=0;t>u;u++)""!==this._getName(e[u])?p+a+n>d?(s+=c+n,p-=n,l=Math.max(l,p),p=0):(p+=a+n,l=Math.max(l,p-n)):(s+=c+n,p-=n,l=Math.max(l,p),p=0)}U=this.zr.getWidth(),d=this.zr.getHeight();var g;switch(this.legendOption.x){case"center":g=Math.floor((U-s)/2);break;case"left":g=V[3]+this.legendOption.borderWidth;break;case"right":g=U-s-V[1]-V[3]-2*this.legendOption.borderWidth;break;default:g=this.parsePercent(this.legendOption.x,U)}var b;switch(this.legendOption.y){case"top":b=V[0]+this.legendOption.borderWidth;break;case"bottom":b=d-l-V[0]-V[2]-2*this.legendOption.borderWidth;break;case"center":b=Math.floor((d-l)/2);break;default:b=this.parsePercent(this.legendOption.y,d)}return{x:g,y:b,width:s,height:l,maxWidth:c}},_getSomethingByName:function(e){for(var t,n=this.option.series,i=0,a=n.length;a>i;i++){if(n[i].name===e)return{type:n[i].type,series:n[i],seriesIndex:i,data:null,dataIndex:-1};if(n[i].type===l.CHART_TYPE_PIE||n[i].type===l.CHART_TYPE_RADAR||n[i].type===l.CHART_TYPE_CHORD||n[i].type===l.CHART_TYPE_FORCE||n[i].type===l.CHART_TYPE_FUNNEL){t=n[i].categories||n[i].data||n[i].nodes;for(var o=0,r=t.length;r>o;o++)if(t[o].name===e)return{type:n[i].type,series:n[i],seriesIndex:i,data:t[o],dataIndex:o}}}return{type:"bar",series:null,seriesIndex:-1,data:null,dataIndex:-1}},_getItemShapeByType:function(e,t,n,i,a,o,r){var s,h="#ccc"===a?r:a,m={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{iconType:"legendicon"+o,x:e,y:t,width:n,height:i,color:a,strokeColor:a,lineWidth:2},highlightStyle:{color:h,strokeColor:h,lineWidth:1},hoverable:this.legendOption.selectedMode,clickable:this.legendOption.selectedMode};if(o.match("image")){var s=o.replace(new RegExp("^image:\\/\\/"),"");o="image"}switch(o){case"line":m.style.brushType="stroke",m.highlightStyle.lineWidth=3;break;case"radar":case"scatter":m.highlightStyle.lineWidth=3;break;case"k":m.style.brushType="both",m.highlightStyle.lineWidth=3,m.highlightStyle.color=m.style.color=this.deepQuery([this.ecTheme,l],"k.itemStyle.normal.color")||"#fff",m.style.strokeColor="#ccc"!=a?this.deepQuery([this.ecTheme,l],"k.itemStyle.normal.lineStyle.color")||"#ff3200":a;break;case"image":m.style.iconType="image",m.style.image=s,"#ccc"===a&&(m.style.opacity=.5)}return m},__legendSelected:function(e){var t=e.target._name;if("single"===this.legendOption.selectedMode)for(var n in this._selectedMap)this._selectedMap[n]=!1;this._selectedMap[t]=!this._selectedMap[t],this.messageCenter.dispatch(l.EVENT.LEGEND_SELECTED,e.event,{selected:this._selectedMap,target:t},this.myChart)},__dispatchHoverLink:function(e){this.messageCenter.dispatch(l.EVENT.LEGEND_HOVERLINK,e.event,{target:e.target._name},this.myChart)},refresh:function(e){if(e){this.option=e||this.option,this.option.legend=this.reformOption(this.option.legend),this.legendOption=this.option.legend;var t,n,i,a,o=this.legendOption.data||[];if(this.legendOption.selected)for(var r in this.legendOption.selected)this._selectedMap[r]="undefined"!=typeof this._selectedMap[r]?this._selectedMap[r]:this.legendOption.selected[r];for(var s=0,h=o.length;h>s;s++)t=this._getName(o[s]),""!==t&&(n=this._getSomethingByName(t),n.series?(this._hasDataMap[t]=!0,a=!n.data||n.type!==l.CHART_TYPE_PIE&&n.type!==l.CHART_TYPE_FORCE&&n.type!==l.CHART_TYPE_FUNNEL?[n.series]:[n.data,n.series],i=this.getItemStyleColor(this.deepQuery(a,"itemStyle.normal.color"),n.seriesIndex,n.dataIndex,n.data),i&&n.type!=l.CHART_TYPE_K&&this.setColor(t,i),this._selectedMap[t]=null!=this._selectedMap[t]?this._selectedMap[t]:!0):this._hasDataMap[t]=!1)}this.clear(),this._buildShape()},getRelatedAmount:function(e){for(var t,n=0,i=this.option.series,a=0,o=i.length;o>a;a++)if(i[a].name===e&&n++,i[a].type===l.CHART_TYPE_PIE||i[a].type===l.CHART_TYPE_RADAR||i[a].type===l.CHART_TYPE_CHORD||i[a].type===l.CHART_TYPE_FORCE||i[a].type===l.CHART_TYPE_FUNNEL){t=i[a].type!=l.CHART_TYPE_FORCE?i[a].data:i[a].categories;for(var r=0,s=t.length;s>r;r++)t[r].name===e&&"-"!=t[r].value&&n++}return n},setColor:function(e,t){this._colorMap[e]=t},getColor:function(e){return this._colorMap[e]||(this._colorMap[e]=this.zr.getColor(this._colorIndex++)),this._colorMap[e]},hasColor:function(e){return this._colorMap[e]?this._colorMap[e]:!1},add:function(e,t){for(var n=this.legendOption.data,i=0,a=n.length;a>i;i++)if(this._getName(n[i])===e)return;this.legendOption.data.push(e),this.setColor(e,t),this._selectedMap[e]=!0,this._hasDataMap[e]=!0},del:function(e){for(var t=this.legendOption.data,n=0,i=t.length;i>n;n++)if(this._getName(t[n])===e)return this.legendOption.data.splice(n,1)},getItemShape:function(e){if(null!=e)for(var t,n=0,i=this.shapeList.length;i>n;n++)if(t=this.shapeList[n],t._name===e&&"text"!=t.type)return t},setItemShape:function(e,t){for(var n,i=0,a=this.shapeList.length;a>i;i++)n=this.shapeList[i],n._name===e&&"text"!=n.type&&(this._selectedMap[e]||(t.style.color="#ccc",t.style.strokeColor="#ccc"),this.zr.modShape(n.id,t))
-},isSelected:function(e){return"undefined"!=typeof this._selectedMap[e]?this._selectedMap[e]:!0},getSelectedMap:function(){return this._selectedMap},setSelected:function(e,t){if("single"===this.legendOption.selectedMode)for(var n in this._selectedMap)this._selectedMap[n]=!1;this._selectedMap[e]=t,this.messageCenter.dispatch(l.EVENT.LEGEND_SELECTED,null,{selected:this._selectedMap,target:e},this.myChart)},onlegendSelected:function(e,t){var n=e.selected;for(var i in n)this._selectedMap[i]!=n[i]&&(t.needRefresh=!0),this._selectedMap[i]=n[i]}};var V={line:function(e,t){var n=t.height/2;e.moveTo(t.x,t.y+n),e.lineTo(t.x+t.width,t.y+n)},pie:function(e,t){var n=t.x,i=t.y,a=t.width,r=t.height;o.prototype.buildPath(e,{x:n+a/2,y:i+r+2,r:r,r0:6,startAngle:45,endAngle:135})},eventRiver:function(e,t){var n=t.x,i=t.y,a=t.width,o=t.height;e.moveTo(n,i+o),e.bezierCurveTo(n+a,i+o,n,i+4,n+a,i+4),e.lineTo(n+a,i),e.bezierCurveTo(n,i,n+a,i+o-4,n,i+o-4),e.lineTo(n,i+o)},k:function(e,t){var n=t.x,i=t.y,a=t.width,o=t.height;s.prototype.buildPath(e,{x:n+a/2,y:[i+1,i+1,i+o-6,i+o],width:a-6})},bar:function(e,t){var n=t.x,i=t.y+1,a=t.width,o=t.height-2,r=3;e.moveTo(n+r,i),e.lineTo(n+a-r,i),e.quadraticCurveTo(n+a,i,n+a,i+r),e.lineTo(n+a,i+o-r),e.quadraticCurveTo(n+a,i+o,n+a-r,i+o),e.lineTo(n+r,i+o),e.quadraticCurveTo(n,i+o,n,i+o-r),e.lineTo(n,i+r),e.quadraticCurveTo(n,i,n+r,i)},force:function(e,t){r.prototype.iconLibrary.circle(e,t)},radar:function(e,t){var n=6,i=t.x+t.width/2,a=t.y+t.height/2,o=t.height/2,r=2*Math.PI/n,s=-Math.PI/2,l=i+o*Math.cos(s),h=a+o*Math.sin(s);e.moveTo(l,h),s+=r;for(var m=0,V=n-1;V>m;m++)e.lineTo(i+o*Math.cos(s),a+o*Math.sin(s)),s+=r;e.lineTo(l,h)}};V.chord=V.pie,V.map=V.bar;for(var U in V)r.prototype.iconLibrary["legendicon"+U]=V[U];return h.inherits(t,n),e("../component").define("legend",t),t}),n("echarts/util/ecData",[],function(){function e(e,t,n,i,a,o,r,s){var l;return"undefined"!=typeof i&&(l=null==i.value?i:i.value),e._echartsData={_series:t,_seriesIndex:n,_data:i,_dataIndex:a,_name:o,_value:l,_special:r,_special2:s},e._echartsData}function t(e,t){var n=e._echartsData;if(!t)return n;switch(t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":return n&&n["_"+t]}return null}function n(e,t,n){switch(e._echartsData=e._echartsData||{},t){case"series":case"seriesIndex":case"data":case"dataIndex":case"name":case"value":case"special":case"special2":e._echartsData["_"+t]=n}}function i(e,t){t._echartsData={_series:e._echartsData._series,_seriesIndex:e._echartsData._seriesIndex,_data:e._echartsData._data,_dataIndex:e._echartsData._dataIndex,_name:e._echartsData._name,_value:e._echartsData._value,_special:e._echartsData._special,_special2:e._echartsData._special2}}return{pack:e,set:n,get:t,clone:i}}),n("echarts/chart",[],function(){var e={},t={};return e.define=function(n,i){return t[n]=i,e},e.get=function(e){return t[e]},e}),n("zrender/tool/color",["require","../tool/util"],function(e){function t(e){P=e}function n(){P=N}function i(e,t){return e=0|e,t=t||P,t[e%t.length]}function a(e){B=e}function o(){H=B}function r(){return B}function s(e,t,n,i,a,o,r){O||(O=D.getContext());for(var s=O.createRadialGradient(e,t,n,i,a,o),l=0,h=r.length;h>l;l++)s.addColorStop(r[l][0],r[l][1]);return s.__nonRecursion=!0,s}function l(e,t,n,i,a){O||(O=D.getContext());for(var o=O.createLinearGradient(e,t,n,i),r=0,s=a.length;s>r;r++)o.addColorStop(a[r][0],a[r][1]);return o.__nonRecursion=!0,o}function h(e,t,n){e=p(e),t=p(t),e=v(e),t=v(t);for(var i=[],a=(t[0]-e[0])/n,o=(t[1]-e[1])/n,r=(t[2]-e[2])/n,s=(t[3]-e[3])/n,l=0,h=e[0],m=e[1],U=e[2],d=e[3];n>l;l++)i[l]=V([S(Math.floor(h),[0,255]),S(Math.floor(m),[0,255]),S(Math.floor(U),[0,255]),d.toFixed(4)-0],"rgba"),h+=a,m+=o,U+=r,d+=s;return h=t[0],m=t[1],U=t[2],d=t[3],i[l]=V([h,m,U,d],"rgba"),i}function m(e,t){var n=[],i=e.length;if(void 0===t&&(t=20),1===i)n=h(e[0],e[0],t);else if(i>1)for(var a=0,o=i-1;o>a;a++){var r=h(e[a],e[a+1],t);o-1>a&&r.pop(),n=n.concat(r)}return n}function V(e,t){if(t=t||"rgb",e&&(3===e.length||4===e.length)){if(e=C(e,function(e){return e>1?Math.ceil(e):e}),t.indexOf("hex")>-1)return"#"+((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1);if(t.indexOf("hs")>-1){var n=C(e.slice(1,3),function(e){return e+"%"});e[1]=n[0],e[2]=n[1]}return t.indexOf("a")>-1?(3===e.length&&e.push(1),e[3]=S(e[3],[0,1]),t+"("+e.slice(0,4).join(",")+")"):t+"("+e.slice(0,3).join(",")+")"}}function U(e){e=L(e),e.indexOf("rgba")<0&&(e=p(e));var t=[],n=0;return e.replace(/[\d.]+/g,function(e){e=3>n?0|e:+e,t[n++]=e}),t}function d(e,t){if(!E(e))return e;var n=v(e),i=n[3];return"undefined"==typeof i&&(i=1),e.indexOf("hsb")>-1?n=F(n):e.indexOf("hsl")>-1&&(n=T(n)),t.indexOf("hsb")>-1||t.indexOf("hsv")>-1?n=M(n):t.indexOf("hsl")>-1&&(n=z(n)),n[3]=i,V(n,t)}function p(e){return d(e,"rgba")}function c(e){return d(e,"rgb")}function u(e){return d(e,"hex")}function y(e){return d(e,"hsva")}function g(e){return d(e,"hsv")}function b(e){return d(e,"hsba")}function f(e){return d(e,"hsb")}function k(e){return d(e,"hsla")}function x(e){return d(e,"hsl")}function _(e){for(var t in G)if(u(G[t])===u(e))return t;return null}function L(e){return String(e).replace(/\s+/g,"")}function W(e){if(G[e]&&(e=G[e]),e=L(e),e=e.replace(/hsv/i,"hsb"),/^#[\da-f]{3}$/i.test(e)){e=parseInt(e.slice(1),16);var t=(3840&e)<<8,n=(240&e)<<4,i=15&e;e="#"+((1<<24)+(t<<4)+t+(n<<4)+n+(i<<4)+i).toString(16).slice(1)}return e}function X(e,t){if(!E(e))return e;var n=t>0?1:-1;"undefined"==typeof t&&(t=0),t=Math.abs(t)>1?1:Math.abs(t),e=c(e);for(var i=v(e),a=0;3>a;a++)i[a]=1===n?i[a]*(1-t)|0:(255-i[a])*t+i[a]|0;return"rgb("+i.join(",")+")"}function K(e){if(!E(e))return e;var t=v(p(e));return t=C(t,function(e){return 255-e}),V(t,"rgb")}function w(e,t,n){if(!E(e)||!E(t))return e;"undefined"==typeof n&&(n=.5),n=1-S(n,[0,1]);for(var i=2*n-1,a=v(p(e)),o=v(p(t)),r=a[3]-o[3],s=((i*r===-1?i:(i+r)/(1+i*r))+1)/2,l=1-s,h=[],m=0;3>m;m++)h[m]=a[m]*s+o[m]*l;var U=a[3]*n+o[3]*(1-n);return U=Math.max(0,Math.min(1,U)),1===a[3]&&1===o[3]?V(h,"rgb"):(h[3]=U,V(h,"rgba"))}function I(){return"#"+(Math.random().toString(16)+"0000").slice(2,8)}function v(e){e=W(e);var t=e.match(R);if(null===t)throw new Error("The color format error");var n,i,a,o=[];if(t[2])n=t[2].replace("#","").split(""),a=[n[0]+n[1],n[2]+n[3],n[4]+n[5]],o=C(a,function(e){return S(parseInt(e,16),[0,255])});else if(t[4]){var r=t[4].split(",");i=r[3],a=r.slice(0,3),o=C(a,function(e){return e=Math.floor(e.indexOf("%")>0?2.55*parseInt(e,0):e),S(e,[0,255])}),"undefined"!=typeof i&&o.push(S(parseFloat(i),[0,1]))}else if(t[5]||t[6]){var s=(t[5]||t[6]).split(","),l=parseInt(s[0],0)/360,h=s[1],m=s[2];i=s[3],o=C([h,m],function(e){return S(parseFloat(e)/100,[0,1])}),o.unshift(l),"undefined"!=typeof i&&o.push(S(parseFloat(i),[0,1]))}return o}function J(e,t){if(!E(e))return e;null===t&&(t=1);var n=v(p(e));return n[3]=S(Number(t).toFixed(4),[0,1]),V(n,"rgba")}function C(e,t){if("function"!=typeof t)throw new TypeError;for(var n=e?e.length:0,i=0;n>i;i++)e[i]=t(e[i]);return e}function S(e,t){return e<=t[0]?e=t[0]:e>=t[1]&&(e=t[1]),e}function E(e){return e instanceof Array||"string"==typeof e}function F(e){var t,n,i,a=e[0],o=e[1],r=e[2];if(0===o)t=255*r,n=255*r,i=255*r;else{var s=6*a;6===s&&(s=0);var l=0|s,h=r*(1-o),m=r*(1-o*(s-l)),V=r*(1-o*(1-(s-l))),U=0,d=0,p=0;0===l?(U=r,d=V,p=h):1===l?(U=m,d=r,p=h):2===l?(U=h,d=r,p=V):3===l?(U=h,d=m,p=r):4===l?(U=V,d=h,p=r):(U=r,d=h,p=m),t=255*U,n=255*d,i=255*p}return[t,n,i]}function T(e){var t,n,i,a=e[0],o=e[1],r=e[2];if(0===o)t=255*r,n=255*r,i=255*r;else{var s;s=.5>r?r*(1+o):r+o-o*r;var l=2*r-s;t=255*A(l,s,a+1/3),n=255*A(l,s,a),i=255*A(l,s,a-1/3)}return[t,n,i]}function A(e,t,n){return 0>n&&(n+=1),n>1&&(n-=1),1>6*n?e+6*(t-e)*n:1>2*n?t:2>3*n?e+(t-e)*(2/3-n)*6:e}function M(e){var t,n,i=e[0]/255,a=e[1]/255,o=e[2]/255,r=Math.min(i,a,o),s=Math.max(i,a,o),l=s-r,h=s;if(0===l)t=0,n=0;else{n=l/s;var m=((s-i)/6+l/2)/l,V=((s-a)/6+l/2)/l,U=((s-o)/6+l/2)/l;i===s?t=U-V:a===s?t=1/3+m-U:o===s&&(t=2/3+V-m),0>t&&(t+=1),t>1&&(t-=1)}return t=360*t,n=100*n,h=100*h,[t,n,h]}function z(e){var t,n,i=e[0]/255,a=e[1]/255,o=e[2]/255,r=Math.min(i,a,o),s=Math.max(i,a,o),l=s-r,h=(s+r)/2;if(0===l)t=0,n=0;else{n=.5>h?l/(s+r):l/(2-s-r);var m=((s-i)/6+l/2)/l,V=((s-a)/6+l/2)/l,U=((s-o)/6+l/2)/l;i===s?t=U-V:a===s?t=1/3+m-U:o===s&&(t=2/3+V-m),0>t&&(t+=1),t>1&&(t-=1)}return t=360*t,n=100*n,h=100*h,[t,n,h]}var O,D=e("../tool/util"),P=["#ff9277"," #dddd00"," #ffc877"," #bbe3ff"," #d5ffbb","#bbbbff"," #ddb000"," #b0dd00"," #e2bbff"," #ffbbe3","#ff7777"," #ff9900"," #83dd00"," #77e3ff"," #778fff","#c877ff"," #ff77ab"," #ff6600"," #aa8800"," #77c7ff","#ad77ff"," #ff77ff"," #dd0083"," #777700"," #00aa00","#0088aa"," #8400dd"," #aa0088"," #dd0000"," #772e00"],N=P,B="rgba(255,255,0,0.5)",H=B,R=/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i,G={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#0ff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000",blanchedalmond:"#ffebcd",blue:"#00f",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#f0f",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#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",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#789",lightslategrey:"#789",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#0f0",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#f0f",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:"#f00",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#fff",whitesmoke:"#f5f5f5",yellow:"#ff0",yellowgreen:"#9acd32"};return{customPalette:t,resetPalette:n,getColor:i,getHighlightColor:r,customHighlight:a,resetHighlight:o,getRadialGradient:s,getLinearGradient:l,getGradientColors:m,getStepColors:h,reverse:K,mix:w,lift:X,trim:L,random:I,toRGB:c,toRGBA:p,toHex:u,toHSL:x,toHSLA:k,toHSB:f,toHSBA:b,toHSV:g,toHSVA:y,toName:_,toColor:V,toArray:U,alpha:J,getData:v}}),n("echarts/component/timeline",["require","./base","zrender/shape/Rectangle","../util/shape/Icon","../util/shape/Chain","../config","zrender/tool/util","zrender/tool/area","zrender/tool/event","../component"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o);var r=this;if(r._onclick=function(e){return r.__onclick(e)},r._ondrift=function(e,t){return r.__ondrift(this,e,t)},r._ondragend=function(){return r.__ondragend()},r._setCurrentOption=function(){var e=r.timelineOption;r.currentIndex%=e.data.length;var t=r.options[r.currentIndex]||{};r.myChart.setOption(t,e.notMerge),r.messageCenter.dispatch(s.EVENT.TIMELINE_CHANGED,null,{currentIndex:r.currentIndex,data:null!=e.data[r.currentIndex].name?e.data[r.currentIndex].name:e.data[r.currentIndex]},r.myChart)},r._onFrame=function(){r._setCurrentOption(),r._syncHandleShape(),r.timelineOption.autoPlay&&(r.playTicket=setTimeout(function(){return r.currentIndex+=1,!r.timelineOption.loop&&r.currentIndex>=r.timelineOption.data.length?(r.currentIndex=r.timelineOption.data.length-1,void r.stop()):void r._onFrame()},r.timelineOption.playInterval))},this.setTheme(!1),this.options=this.option.options,this.currentIndex=this.timelineOption.currentIndex%this.timelineOption.data.length,this.timelineOption.notMerge||0===this.currentIndex||(this.options[this.currentIndex]=l.merge(this.options[this.currentIndex],this.options[0])),this.timelineOption.show&&(this._buildShape(),this._syncHandleShape()),this._setCurrentOption(),this.timelineOption.autoPlay){var r=this;this.playTicket=setTimeout(function(){r.play()},null!=this.ecTheme.animationDuration?this.ecTheme.animationDuration:s.animationDuration)}}function n(e,t){var n=2,i=t.x+n,a=t.y+n+2,r=t.width-n,s=t.height-n,l=t.symbol;if("last"===l)e.moveTo(i+r-2,a+s/3),e.lineTo(i+r-2,a),e.lineTo(i+2,a+s/2),e.lineTo(i+r-2,a+s),e.lineTo(i+r-2,a+s/3*2),e.moveTo(i,a),e.lineTo(i,a);else if("next"===l)e.moveTo(i+2,a+s/3),e.lineTo(i+2,a),e.lineTo(i+r-2,a+s/2),e.lineTo(i+2,a+s),e.lineTo(i+2,a+s/3*2),e.moveTo(i,a),e.lineTo(i,a);else if("play"===l)if("stop"===t.status)e.moveTo(i+2,a),e.lineTo(i+r-2,a+s/2),e.lineTo(i+2,a+s),e.lineTo(i+2,a);else{var h="both"===t.brushType?2:3;e.rect(i+2,a,h,s),e.rect(i+r-h-2,a,h,s)}else if(l.match("image")){var m="";m=l.replace(new RegExp("^image:\\/\\/"),""),l=o.prototype.iconLibrary.image,l(e,{x:i,y:a,width:r,height:s,image:m})}}var i=e("./base"),a=e("zrender/shape/Rectangle"),o=e("../util/shape/Icon"),r=e("../util/shape/Chain"),s=e("../config");s.timeline={zlevel:0,z:4,show:!0,type:"time",notMerge:!1,realtime:!0,x:80,x2:80,y2:0,height:50,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,controlPosition:"left",autoPlay:!1,loop:!0,playInterval:2e3,lineStyle:{width:1,color:"#666",type:"dashed"},label:{show:!0,interval:"auto",rotate:0,textStyle:{color:"#333"}},checkpointStyle:{symbol:"auto",symbolSize:"auto",color:"auto",borderColor:"auto",borderWidth:"auto",label:{show:!1,textStyle:{color:"auto"}}},controlStyle:{itemSize:15,itemGap:5,normal:{color:"#333"},emphasis:{color:"#1e90ff"}},symbol:"emptyDiamond",symbolSize:4,currentIndex:0};var l=e("zrender/tool/util"),h=e("zrender/tool/area"),m=e("zrender/tool/event");return t.prototype={type:s.COMPONENT_TYPE_TIMELINE,_buildShape:function(){if(this._location=this._getLocation(),this._buildBackground(),this._buildControl(),this._chainPoint=this._getChainPoint(),this.timelineOption.label.show)for(var e=this._getInterval(),t=0,n=this._chainPoint.length;n>t;t+=e)this._chainPoint[t].showLabel=!0;this._buildChain(),this._buildHandle();for(var t=0,i=this.shapeList.length;i>t;t++)this.zr.addShape(this.shapeList[t])},_getLocation:function(){var e,t=this.timelineOption,n=this.reformCssArray(this.timelineOption.padding),i=this.zr.getWidth(),a=this.parsePercent(t.x,i),o=this.parsePercent(t.x2,i);null==t.width?(e=i-a-o,o=i-o):(e=this.parsePercent(t.width,i),o=a+e);var r,s,l=this.zr.getHeight(),h=this.parsePercent(t.height,l);return null!=t.y?(r=this.parsePercent(t.y,l),s=r+h):(s=l-this.parsePercent(t.y2,l),r=s-h),{x:a+n[3],y:r+n[0],x2:o-n[1],y2:s-n[2],width:e-n[1]-n[3],height:h-n[0]-n[2]}},_getReformedLabel:function(e){var t=this.timelineOption,n=null!=t.data[e].name?t.data[e].name:t.data[e],i=t.data[e].formatter||t.label.formatter;return i&&("function"==typeof i?n=i.call(this.myChart,n):"string"==typeof i&&(n=i.replace("{value}",n))),n},_getInterval:function(){var e=this._chainPoint,t=this.timelineOption,n=t.label.interval;if("auto"===n){var i=t.label.textStyle.fontSize,a=t.data,o=t.data.length;if(o>3){var r,s,l=!1;for(n=0;!l&&o>n;){n++,l=!0;for(var m=n;o>m;m+=n){if(r=e[m].x-e[m-n].x,0!==t.label.rotate)s=i;else if(a[m].textStyle)s=h.getTextWidth(e[m].name,e[m].textFont);else{var V=e[m].name+"",U=(V.match(/\w/g)||"").length,d=V.length-U;s=U*i*2/3+d*i}if(s>r){l=!1;break}}}}else n=1}else n=n-0+1;return n},_getChainPoint:function(){function e(e){return null!=h[e].name?h[e].name:h[e]+""}var t,n=this.timelineOption,i=n.symbol.toLowerCase(),a=n.symbolSize,o=n.label.rotate,r=n.label.textStyle,s=this.getFont(r),h=n.data,m=this._location.x,V=this._location.y+this._location.height/4*3,U=this._location.x2-this._location.x,d=h.length,p=[];if(d>1){var c=U/d;if(c=c>50?50:20>c?5:c,U-=2*c,"number"===n.type)for(var u=0;d>u;u++)p.push(m+c+U/(d-1)*u);else{p[0]=new Date(e(0).replace(/-/g,"/")),p[d-1]=new Date(e(d-1).replace(/-/g,"/"))-p[0];for(var u=1;d>u;u++)p[u]=m+c+U*(new Date(e(u).replace(/-/g,"/"))-p[0])/p[d-1];p[0]=m+c}}else p.push(m+U/2);for(var y,g,b,f,k,x=[],u=0;d>u;u++)m=p[u],y=h[u].symbol&&h[u].symbol.toLowerCase()||i,y.match("empty")?(y=y.replace("empty",""),b=!0):b=!1,y.match("star")&&(g=y.replace("star","")-0||5,y="star"),t=h[u].textStyle?l.merge(h[u].textStyle||{},r):r,f=t.align||"center",o?(f=o>0?"right":"left",k=[o*Math.PI/180,m,V-5]):k=!1,x.push({x:m,n:g,isEmpty:b,symbol:y,symbolSize:h[u].symbolSize||a,color:h[u].color,borderColor:h[u].borderColor,borderWidth:h[u].borderWidth,name:this._getReformedLabel(u),textColor:t.color,textAlign:f,textBaseline:t.baseline||"middle",textX:m,textY:V-(o?5:0),textFont:h[u].textStyle?this.getFont(t):s,rotation:k,showLabel:!1});return x},_buildBackground:function(){var e=this.timelineOption,t=this.reformCssArray(this.timelineOption.padding),n=this._location.width,i=this._location.height;(0!==e.borderWidth||"rgba(0,0,0,0)"!=e.backgroundColor.replace(/\s/g,""))&&this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._location.x-t[3],y:this._location.y-t[0],width:n+t[1]+t[3],height:i+t[0]+t[2],brushType:0===e.borderWidth?"fill":"both",color:e.backgroundColor,strokeColor:e.borderColor,lineWidth:e.borderWidth}}))},_buildControl:function(){var e=this,t=this.timelineOption,n=t.lineStyle,i=t.controlStyle;if("none"!==t.controlPosition){var a,r=i.itemSize,s=i.itemGap;"left"===t.controlPosition?(a=this._location.x,this._location.x+=3*(r+s)):(a=this._location.x2-(3*(r+s)-s),this._location.x2-=3*(r+s));var h=this._location.y,m={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{iconType:"timelineControl",symbol:"last",x:a,y:h,width:r,height:r,brushType:"stroke",color:i.normal.color,strokeColor:i.normal.color,lineWidth:n.width},highlightStyle:{color:i.emphasis.color,strokeColor:i.emphasis.color,lineWidth:n.width+1},clickable:!0};this._ctrLastShape=new o(m),this._ctrLastShape.onclick=function(){e.last()},this.shapeList.push(this._ctrLastShape),a+=r+s,this._ctrPlayShape=new o(l.clone(m)),this._ctrPlayShape.style.brushType="fill",this._ctrPlayShape.style.symbol="play",this._ctrPlayShape.style.status=this.timelineOption.autoPlay?"playing":"stop",this._ctrPlayShape.style.x=a,this._ctrPlayShape.onclick=function(){"stop"===e._ctrPlayShape.style.status?e.play():e.stop()},this.shapeList.push(this._ctrPlayShape),a+=r+s,this._ctrNextShape=new o(l.clone(m)),this._ctrNextShape.style.symbol="next",this._ctrNextShape.style.x=a,this._ctrNextShape.onclick=function(){e.next()},this.shapeList.push(this._ctrNextShape)}},_buildChain:function(){var e=this.timelineOption,t=e.lineStyle;this._timelineShae={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:this._location.x,y:this.subPixelOptimize(this._location.y,t.width),width:this._location.x2-this._location.x,height:this._location.height,chainPoint:this._chainPoint,brushType:"both",strokeColor:t.color,lineWidth:t.width,lineType:t.type},hoverable:!1,clickable:!0,onclick:this._onclick},this._timelineShae=new r(this._timelineShae),this.shapeList.push(this._timelineShae)},_buildHandle:function(){var e=this._chainPoint[this.currentIndex],t=e.symbolSize+1;t=5>t?5:t,this._handleShape={zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,draggable:!0,style:{iconType:"diamond",n:e.n,x:e.x-t,y:this._location.y+this._location.height/4-t,width:2*t,height:2*t,brushType:"both",textPosition:"specific",textX:e.x,textY:this._location.y-this._location.height/4,textAlign:"center",textBaseline:"middle"},highlightStyle:{},ondrift:this._ondrift,ondragend:this._ondragend},this._handleShape=new o(this._handleShape),this.shapeList.push(this._handleShape)},_syncHandleShape:function(){if(this.timelineOption.show){var e=this.timelineOption,t=e.checkpointStyle,n=this._chainPoint[this.currentIndex];this._handleShape.style.text=t.label.show?n.name:"",this._handleShape.style.textFont=n.textFont,this._handleShape.style.n=n.n,"auto"===t.symbol?this._handleShape.style.iconType="none"!=n.symbol?n.symbol:"diamond":(this._handleShape.style.iconType=t.symbol,t.symbol.match("star")&&(this._handleShape.style.n=t.symbol.replace("star","")-0||5,this._handleShape.style.iconType="star"));var i;"auto"===t.symbolSize?(i=n.symbolSize+2,i=5>i?5:i):i=t.symbolSize-0,this._handleShape.style.color="auto"===t.color?n.color?n.color:e.controlStyle.emphasis.color:t.color,this._handleShape.style.textColor="auto"===t.label.textStyle.color?this._handleShape.style.color:t.label.textStyle.color,this._handleShape.highlightStyle.strokeColor=this._handleShape.style.strokeColor="auto"===t.borderColor?n.borderColor?n.borderColor:"#fff":t.borderColor,this._handleShape.style.lineWidth="auto"===t.borderWidth?n.borderWidth?n.borderWidth:0:t.borderWidth-0,this._handleShape.highlightStyle.lineWidth=this._handleShape.style.lineWidth+1,this.zr.animate(this._handleShape.id,"style").when(500,{x:n.x-i,textX:n.x,y:this._location.y+this._location.height/4-i,width:2*i,height:2*i}).start("ExponentialOut")}},_findChainIndex:function(e){var t=this._chainPoint,n=t.length;if(e<=t[0].x)return 0;if(e>=t[n-1].x)return n-1;for(var i=0;n-1>i;i++)if(e>=t[i].x&&e<=t[i+1].x)return Math.abs(e-t[i].x)<Math.abs(e-t[i+1].x)?i:i+1},__onclick:function(e){var t=m.getX(e.event),n=this._findChainIndex(t);return n===this.currentIndex?!0:(this.currentIndex=n,this.timelineOption.autoPlay&&this.stop(),clearTimeout(this.playTicket),void this._onFrame())},__ondrift:function(e,t){this.timelineOption.autoPlay&&this.stop();var n,i=this._chainPoint,a=i.length;e.style.x+t<=i[0].x-i[0].symbolSize?(e.style.x=i[0].x-i[0].symbolSize,n=0):e.style.x+t>=i[a-1].x-i[a-1].symbolSize?(e.style.x=i[a-1].x-i[a-1].symbolSize,n=a-1):(e.style.x+=t,n=this._findChainIndex(e.style.x));var o=i[n],r=o.symbolSize+2;if(e.style.iconType=o.symbol,e.style.n=o.n,e.style.textX=e.style.x+r/2,e.style.y=this._location.y+this._location.height/4-r,e.style.width=2*r,e.style.height=2*r,e.style.text=o.name,n===this.currentIndex)return!0;if(this.currentIndex=n,this.timelineOption.realtime){clearTimeout(this.playTicket);var s=this;this.playTicket=setTimeout(function(){s._setCurrentOption()},200)}return!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){this.isDragend&&e.target&&(!this.timelineOption.realtime&&this._setCurrentOption(),t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1,this._syncHandleShape())},last:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex-=1,this.currentIndex<0&&(this.currentIndex=this.timelineOption.data.length-1),this._onFrame(),this.currentIndex},next:function(){return this.timelineOption.autoPlay&&this.stop(),this.currentIndex+=1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},play:function(e,t){return this._ctrPlayShape&&"playing"!=this._ctrPlayShape.style.status&&(this._ctrPlayShape.style.status="playing",this.zr.modShape(this._ctrPlayShape.id),this.zr.refreshNextFrame()),this.timelineOption.autoPlay=null!=t?t:!0,this.timelineOption.autoPlay||clearTimeout(this.playTicket),this.currentIndex=null!=e?e:this.currentIndex+1,this.currentIndex>=this.timelineOption.data.length&&(this.currentIndex=0),this._onFrame(),this.currentIndex},stop:function(){return this._ctrPlayShape&&"stop"!=this._ctrPlayShape.style.status&&(this._ctrPlayShape.style.status="stop",this.zr.modShape(this._ctrPlayShape.id),this.zr.refreshNextFrame()),this.timelineOption.autoPlay=!1,clearTimeout(this.playTicket),this.currentIndex},resize:function(){this.timelineOption.show&&(this.clear(),this._buildShape(),this._syncHandleShape())},setTheme:function(e){this.timelineOption=this.reformOption(l.clone(this.option.timeline)),this.timelineOption.label.textStyle=this.getTextStyle(this.timelineOption.label.textStyle),this.timelineOption.checkpointStyle.label.textStyle=this.getTextStyle(this.timelineOption.checkpointStyle.label.textStyle),this.myChart.canvasSupported||(this.timelineOption.realtime=!1),this.timelineOption.show&&e&&(this.clear(),this._buildShape(),this._syncHandleShape())},onbeforDispose:function(){clearTimeout(this.playTicket)}},o.prototype.iconLibrary.timelineControl=n,l.inherits(t,i),e("../component").define("timeline",t),t}),n("zrender/shape/Image",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"image",brush:function(e,t,n){var i=this.style||{};t&&(i=this.getHighlightStyle(i,this.highlightStyle||{}));var a=i.image,o=this;if(this._imageCache||(this._imageCache={}),"string"==typeof a){var r=a;this._imageCache[r]?a=this._imageCache[r]:(a=new Image,a.onload=function(){a.onload=null,o.modSelf(),n()},a.src=r,this._imageCache[r]=a)}if(a){if("IMG"==a.nodeName.toUpperCase())if(window.ActiveXObject){if("complete"!=a.readyState)return}else if(!a.complete)return;var s=i.width||a.width,l=i.height||a.height,h=i.x,m=i.y;if(!a.width||!a.height)return;if(e.save(),this.doClip(e),this.setContext(e,i),this.setTransform(e),i.sWidth&&i.sHeight){var V=i.sx||0,U=i.sy||0;e.drawImage(a,V,U,i.sWidth,i.sHeight,h,m,s,l)}else if(i.sx&&i.sy){var V=i.sx,U=i.sy,d=s-V,p=l-U;e.drawImage(a,V,U,d,p,h,m,s,l)}else e.drawImage(a,h,m,s,l);i.width||(i.width=s),i.height||(i.height=l),this.style.width||(this.style.width=s),this.style.height||(this.style.height=l),this.drawText(e,i,this.style),e.restore()}},getRect:function(e){return{x:e.x,y:e.y,width:e.width,height:e.height}},clearCache:function(){this._imageCache={}}},e("../tool/util").inherits(n,t),n}),n("zrender/loadingEffect/Bar",["require","./Base","../tool/util","../tool/color","../shape/Rectangle"],function(e){function t(e){n.call(this,e)}var n=e("./Base"),i=e("../tool/util"),a=e("../tool/color"),o=e("../shape/Rectangle");return i.inherits(t,n),t.prototype._start=function(e,t){var n=i.merge(this.options,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effectOption:{x:0,y:this.canvasHeight/2-30,width:this.canvasWidth,height:5,brushType:"fill",timeInterval:100}}),r=this.createTextShape(n.textStyle),s=this.createBackgroundShape(n.backgroundColor),l=n.effectOption,h=new o({highlightStyle:i.clone(l)});return h.highlightStyle.color=l.color||a.getLinearGradient(l.x,l.y,l.x+l.width,l.y+l.height,[[0,"#ff6400"],[.5,"#ffe100"],[1,"#b1ff00"]]),null!=n.progress?(e(s),h.highlightStyle.width=this.adjust(n.progress,[0,1])*n.effectOption.width,e(h),e(r),void t()):(h.highlightStyle.width=0,setInterval(function(){e(s),h.highlightStyle.width<l.width?h.highlightStyle.width+=8:h.highlightStyle.width=0,e(h),e(r),t()},l.timeInterval))},t}),n("zrender/loadingEffect/Bubble",["require","./Base","../tool/util","../tool/color","../shape/Circle"],function(e){function t(e){n.call(this,e)}var n=e("./Base"),i=e("../tool/util"),a=e("../tool/color"),o=e("../shape/Circle");return i.inherits(t,n),t.prototype._start=function(e,t){for(var n=i.merge(this.options,{textStyle:{color:"#888"},backgroundColor:"rgba(250, 250, 250, 0.8)",effect:{n:50,lineWidth:2,brushType:"stroke",color:"random",timeInterval:100}}),r=this.createTextShape(n.textStyle),s=this.createBackgroundShape(n.backgroundColor),l=n.effect,h=l.n,m=l.brushType,V=l.lineWidth,U=[],d=this.canvasWidth,p=this.canvasHeight,c=0;h>c;c++){var u="random"==l.color?a.alpha(a.random(),.3):l.color;U[c]=new o({highlightStyle:{x:Math.ceil(Math.random()*d),y:Math.ceil(Math.random()*p),r:Math.ceil(40*Math.random()),brushType:m,color:u,strokeColor:u,lineWidth:V},animationY:Math.ceil(20*Math.random())})}return setInterval(function(){e(s);for(var n=0;h>n;n++){var i=U[n].highlightStyle;i.y-U[n].animationY+i.r<=0&&(U[n].highlightStyle.y=p+i.r,U[n].highlightStyle.x=Math.ceil(Math.random()*d)),U[n].highlightStyle.y-=U[n].animationY,e(U[n])}e(r),t()},l.timeInterval)},t}),n("zrender/loadingEffect/DynamicLine",["require","./Base","../tool/util","../tool/color","../shape/Line"],function(e){function t(e){n.call(this,e)}var n=e("./Base"),i=e("../tool/util"),a=e("../tool/color"),o=e("../shape/Line");return i.inherits(t,n),t.prototype._start=function(e,t){for(var n=i.merge(this.options,{textStyle:{color:"#fff"},backgroundColor:"rgba(0, 0, 0, 0.8)",effectOption:{n:30,lineWidth:1,color:"random",timeInterval:100}}),r=this.createTextShape(n.textStyle),s=this.createBackgroundShape(n.backgroundColor),l=n.effectOption,h=l.n,m=l.lineWidth,V=[],U=this.canvasWidth,d=this.canvasHeight,p=0;h>p;p++){var c=-Math.ceil(1e3*Math.random()),u=Math.ceil(400*Math.random()),y=Math.ceil(Math.random()*d),g="random"==l.color?a.random():l.color;V[p]=new o({highlightStyle:{xStart:c,yStart:y,xEnd:c+u,yEnd:y,strokeColor:g,lineWidth:m},animationX:Math.ceil(100*Math.random()),len:u})}return setInterval(function(){e(s);for(var n=0;h>n;n++){var i=V[n].highlightStyle;i.xStart>=U&&(V[n].len=Math.ceil(400*Math.random()),i.xStart=-400,i.xEnd=-400+V[n].len,i.yStart=Math.ceil(Math.random()*d),i.yEnd=i.yStart),i.xStart+=V[n].animationX,i.xEnd+=V[n].animationX,e(V[n])}e(r),t()},l.timeInterval)},t}),n("zrender/loadingEffect/Ring",["require","./Base","../tool/util","../tool/color","../shape/Ring","../shape/Sector"],function(e){function t(e){n.call(this,e)}var n=e("./Base"),i=e("../tool/util"),a=e("../tool/color"),o=e("../shape/Ring"),r=e("../shape/Sector");return i.inherits(t,n),t.prototype._start=function(e,t){var n=i.merge(this.options,{textStyle:{color:"#07a"},backgroundColor:"rgba(250, 250, 250, 0.8)",effect:{x:this.canvasWidth/2,y:this.canvasHeight/2,r0:60,r:100,color:"#bbdcff",brushType:"fill",textPosition:"inside",textFont:"normal 30px verdana",textColor:"rgba(30, 144, 255, 0.6)",timeInterval:100}}),s=n.effect,l=n.textStyle;null==l.x&&(l.x=s.x),null==l.y&&(l.y=s.y+(s.r0+s.r)/2-5);for(var h=this.createTextShape(n.textStyle),m=this.createBackgroundShape(n.backgroundColor),V=s.x,U=s.y,d=s.r0+6,p=s.r-6,c=s.color,u=a.lift(c,.1),y=new o({highlightStyle:i.clone(s)}),g=[],b=a.getGradientColors(["#ff6400","#ffe100","#97ff00"],25),f=15,k=240,x=0;16>x;x++)g.push(new r({highlightStyle:{x:V,y:U,r0:d,r:p,startAngle:k-f,endAngle:k,brushType:"fill",color:u},_color:a.getLinearGradient(V+d*Math.cos(k,!0),U-d*Math.sin(k,!0),V+d*Math.cos(k-f,!0),U-d*Math.sin(k-f,!0),[[0,b[2*x]],[1,b[2*x+1]]])})),k-=f;k=360;for(var x=0;4>x;x++)g.push(new r({highlightStyle:{x:V,y:U,r0:d,r:p,startAngle:k-f,endAngle:k,brushType:"fill",color:u},_color:a.getLinearGradient(V+d*Math.cos(k,!0),U-d*Math.sin(k,!0),V+d*Math.cos(k-f,!0),U-d*Math.sin(k-f,!0),[[0,b[2*x+32]],[1,b[2*x+33]]])})),k-=f;
-var _=0;if(null!=n.progress){e(m),_=100*this.adjust(n.progress,[0,1]).toFixed(2)/5,y.highlightStyle.text=5*_+"%",e(y);for(var x=0;20>x;x++)g[x].highlightStyle.color=_>x?g[x]._color:u,e(g[x]);return e(h),void t()}return setInterval(function(){e(m),_+=_>=20?-20:1,e(y);for(var n=0;20>n;n++)g[n].highlightStyle.color=_>n?g[n]._color:u,e(g[n]);e(h),t()},s.timeInterval)},t}),n("zrender/loadingEffect/Spin",["require","./Base","../tool/util","../tool/color","../tool/area","../shape/Sector"],function(e){function t(e){n.call(this,e)}var n=e("./Base"),i=e("../tool/util"),a=e("../tool/color"),o=e("../tool/area"),r=e("../shape/Sector");return i.inherits(t,n),t.prototype._start=function(e,t){var n=i.merge(this.options,{textStyle:{color:"#fff",textAlign:"start"},backgroundColor:"rgba(0, 0, 0, 0.8)"}),s=this.createTextShape(n.textStyle),l=10,h=o.getTextWidth(s.highlightStyle.text,s.highlightStyle.textFont),m=o.getTextHeight(s.highlightStyle.text,s.highlightStyle.textFont),V=i.merge(this.options.effect||{},{r0:9,r:15,n:18,color:"#fff",timeInterval:100}),U=this.getLocation(this.options.textStyle,h+l+2*V.r,Math.max(2*V.r,m));V.x=U.x+V.r,V.y=s.highlightStyle.y=U.y+U.height/2,s.highlightStyle.x=V.x+V.r+l;for(var d=this.createBackgroundShape(n.backgroundColor),p=V.n,c=V.x,u=V.y,y=V.r0,g=V.r,b=V.color,f=[],k=Math.round(180/p),x=0;p>x;x++)f[x]=new r({highlightStyle:{x:c,y:u,r0:y,r:g,startAngle:k*x*2,endAngle:k*x*2+k,color:a.alpha(b,(x+1)/p),brushType:"fill"}});var _=[0,c,u];return setInterval(function(){e(d),_[0]-=.3;for(var n=0;p>n;n++)f[n].rotation=_,e(f[n]);e(s),t()},V.timeInterval)},t}),n("zrender/loadingEffect/Whirling",["require","./Base","../tool/util","../tool/area","../shape/Ring","../shape/Droplet","../shape/Circle"],function(e){function t(e){n.call(this,e)}var n=e("./Base"),i=e("../tool/util"),a=e("../tool/area"),o=e("../shape/Ring"),r=e("../shape/Droplet"),s=e("../shape/Circle");return i.inherits(t,n),t.prototype._start=function(e,t){var n=i.merge(this.options,{textStyle:{color:"#888",textAlign:"start"},backgroundColor:"rgba(250, 250, 250, 0.8)"}),l=this.createTextShape(n.textStyle),h=10,m=a.getTextWidth(l.highlightStyle.text,l.highlightStyle.textFont),V=a.getTextHeight(l.highlightStyle.text,l.highlightStyle.textFont),U=i.merge(this.options.effect||{},{r:18,colorIn:"#fff",colorOut:"#555",colorWhirl:"#6cf",timeInterval:50}),d=this.getLocation(this.options.textStyle,m+h+2*U.r,Math.max(2*U.r,V));U.x=d.x+U.r,U.y=l.highlightStyle.y=d.y+d.height/2,l.highlightStyle.x=U.x+U.r+h;var p=this.createBackgroundShape(n.backgroundColor),c=new r({highlightStyle:{a:Math.round(U.r/2),b:Math.round(U.r-U.r/6),brushType:"fill",color:U.colorWhirl}}),u=new s({highlightStyle:{r:Math.round(U.r/6),brushType:"fill",color:U.colorIn}}),y=new o({highlightStyle:{r0:Math.round(U.r-U.r/3),r:U.r,brushType:"fill",color:U.colorOut}}),g=[0,U.x,U.y];return c.highlightStyle.x=u.highlightStyle.x=y.highlightStyle.x=g[1],c.highlightStyle.y=u.highlightStyle.y=y.highlightStyle.y=g[2],setInterval(function(){e(p),e(y),g[0]-=.3,c.rotation=g,e(c),e(u),e(l),t()},U.timeInterval)},t}),n("echarts/theme/macarons",[],function(){var e={color:["#2ec7c9","#b6a2de","#5ab1ef","#ffb980","#d87a80","#8d98b3","#e5cf0d","#97b552","#95706d","#dc69aa","#07a2a4","#9a7fd1","#588dd5","#f5994e","#c05050","#59678c","#c9ab00","#7eb00a","#6f5553","#c14089"],title:{textStyle:{fontWeight:"normal",color:"#008acd"}},dataRange:{itemWidth:15,color:["#5ab1ef","#e0ffff"]},toolbox:{color:["#1e90ff","#1e90ff","#1e90ff","#1e90ff"],effectiveColor:"#ff4500"},tooltip:{backgroundColor:"rgba(50,50,50,0.5)",axisPointer:{type:"line",lineStyle:{color:"#008acd"},crossStyle:{color:"#008acd"},shadowStyle:{color:"rgba(200,200,200,0.2)"}}},dataZoom:{dataBackgroundColor:"#efefff",fillerColor:"rgba(182,162,222,0.2)",handleColor:"#008acd"},grid:{borderColor:"#eee"},categoryAxis:{axisLine:{lineStyle:{color:"#008acd"}},splitLine:{lineStyle:{color:["#eee"]}}},valueAxis:{axisLine:{lineStyle:{color:"#008acd"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.1)","rgba(200,200,200,0.1)"]}},splitLine:{lineStyle:{color:["#eee"]}}},polar:{axisLine:{lineStyle:{color:"#ddd"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(200,200,200,0.2)"]}},splitLine:{lineStyle:{color:"#ddd"}}},timeline:{lineStyle:{color:"#008acd"},controlStyle:{normal:{color:"#008acd"},emphasis:{color:"#008acd"}},symbol:"emptyCircle",symbolSize:3},bar:{itemStyle:{normal:{barBorderRadius:5},emphasis:{barBorderRadius:5}}},line:{smooth:!0,symbol:"emptyCircle",symbolSize:3},k:{itemStyle:{normal:{color:"#d87a80",color0:"#2ec7c9",lineStyle:{color:"#d87a80",color0:"#2ec7c9"}}}},scatter:{symbol:"circle",symbolSize:4},radar:{symbol:"emptyCircle",symbolSize:3},map:{itemStyle:{normal:{areaStyle:{color:"#ddd"},label:{textStyle:{color:"#d87a80"}}},emphasis:{areaStyle:{color:"#fe994e"}}}},force:{itemStyle:{normal:{linkStyle:{color:"#1e90ff"}}}},chord:{itemStyle:{normal:{borderWidth:1,borderColor:"rgba(128, 128, 128, 0.5)",chordStyle:{lineStyle:{color:"rgba(128, 128, 128, 0.5)"}}},emphasis:{borderWidth:1,borderColor:"rgba(128, 128, 128, 0.5)",chordStyle:{lineStyle:{color:"rgba(128, 128, 128, 0.5)"}}}}},gauge:{axisLine:{lineStyle:{color:[[.2,"#2ec7c9"],[.8,"#5ab1ef"],[1,"#d87a80"]],width:10}},axisTick:{splitNumber:10,length:15,lineStyle:{color:"auto"}},splitLine:{length:22,lineStyle:{color:"auto"}},pointer:{width:5}},textStyle:{fontFamily:"微软雅黑, Arial, Verdana, sans-serif"}};return e}),n("echarts/theme/infographic",[],function(){var e={color:["#C1232B","#B5C334","#FCCE10","#E87C25","#27727B","#FE8463","#9BCA63","#FAD860","#F3A43B","#60C0DD","#D7504B","#C6E579","#F4E001","#F0805A","#26C0C0"],title:{textStyle:{fontWeight:"normal",color:"#27727B"}},dataRange:{x:"right",y:"center",itemWidth:5,itemHeight:25,color:["#C1232B","#FCCE10"]},toolbox:{color:["#C1232B","#B5C334","#FCCE10","#E87C25","#27727B","#FE8463","#9BCA63","#FAD860","#F3A43B","#60C0DD"],effectiveColor:"#ff4500"},tooltip:{backgroundColor:"rgba(50,50,50,0.5)",axisPointer:{type:"line",lineStyle:{color:"#27727B",type:"dashed"},crossStyle:{color:"#27727B"},shadowStyle:{color:"rgba(200,200,200,0.3)"}}},dataZoom:{dataBackgroundColor:"rgba(181,195,52,0.3)",fillerColor:"rgba(181,195,52,0.2)",handleColor:"#27727B"},grid:{borderWidth:0},categoryAxis:{axisLine:{lineStyle:{color:"#27727B"}},splitLine:{show:!1}},valueAxis:{axisLine:{show:!1},splitArea:{show:!1},splitLine:{lineStyle:{color:["#ccc"],type:"dashed"}}},polar:{axisLine:{lineStyle:{color:"#ddd"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(200,200,200,0.2)"]}},splitLine:{lineStyle:{color:"#ddd"}}},timeline:{lineStyle:{color:"#27727B"},controlStyle:{normal:{color:"#27727B"},emphasis:{color:"#27727B"}},symbol:"emptyCircle",symbolSize:3},line:{itemStyle:{normal:{borderWidth:2,borderColor:"#fff",lineStyle:{width:3}},emphasis:{borderWidth:0}},symbol:"circle",symbolSize:3.5},k:{itemStyle:{normal:{color:"#C1232B",color0:"#B5C334",lineStyle:{width:1,color:"#C1232B",color0:"#B5C334"}}}},scatter:{itemdStyle:{normal:{borderWidth:1,borderColor:"rgba(200,200,200,0.5)"},emphasis:{borderWidth:0}},symbol:"star4",symbolSize:4},radar:{symbol:"emptyCircle",symbolSize:3},map:{itemStyle:{normal:{areaStyle:{color:"#ddd"},label:{textStyle:{color:"#C1232B"}}},emphasis:{areaStyle:{color:"#fe994e"},label:{textStyle:{color:"rgb(100,0,0)"}}}}},force:{itemStyle:{normal:{linkStyle:{color:"#27727B"}}}},chord:{itemStyle:{normal:{borderWidth:1,borderColor:"rgba(128, 128, 128, 0.5)",chordStyle:{lineStyle:{color:"rgba(128, 128, 128, 0.5)"}}},emphasis:{borderWidth:1,borderColor:"rgba(128, 128, 128, 0.5)",chordStyle:{lineStyle:{color:"rgba(128, 128, 128, 0.5)"}}}}},gauge:{center:["50%","80%"],radius:"100%",startAngle:180,endAngle:0,axisLine:{show:!0,lineStyle:{color:[[.2,"#B5C334"],[.8,"#27727B"],[1,"#C1232B"]],width:"40%"}},axisTick:{splitNumber:2,length:5,lineStyle:{color:"#fff"}},axisLabel:{textStyle:{color:"#fff",fontWeight:"bolder"}},splitLine:{length:"5%",lineStyle:{color:"#fff"}},pointer:{width:"40%",length:"80%",color:"#fff"},title:{offsetCenter:[0,-20],textStyle:{color:"auto",fontSize:20}},detail:{offsetCenter:[0,0],textStyle:{color:"auto",fontSize:40}}},textStyle:{fontFamily:"微软雅黑, Arial, Verdana, sans-serif"}};return e}),n("zrender/dep/excanvas",["require"],function(){return document.createElement("canvas").getContext?G_vmlCanvasManager=!1:!function(){function e(){return this.context_||(this.context_=new f(this))}function t(e,t){var n=O.call(arguments,2);return function(){return e.apply(t,n.concat(O.call(arguments)))}}function n(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}function i(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function a(e){if(i(e,"g_vml_","urn:schemas-microsoft-com:vml"),i(e,"g_o_","urn:schemas-microsoft-com:office:office"),!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function o(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function r(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function s(){return[[1,0,0],[0,1,0],[0,0,1]]}function l(e,t){for(var n=s(),i=0;3>i;i++)for(var a=0;3>a;a++){for(var o=0,r=0;3>r;r++)o+=e[i][r]*t[r][a];n[i][a]=o}return n}function h(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.scaleX_=e.scaleX_,t.scaleY_=e.scaleY_,t.lineScale_=e.lineScale_}function m(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),i=e.substring(t+1,n).split(",");return(4!=i.length||"a"!=e.charAt(3))&&(i[3]=1),i}function V(e){return parseFloat(e)/100}function U(e,t,n){return Math.min(n,Math.max(t,e))}function d(e){var t,n,i,a,o,r;if(a=parseFloat(e[0])/360%360,0>a&&a++,o=U(V(e[1]),0,1),r=U(V(e[2]),0,1),0==o)t=n=i=r;else{var s=.5>r?r*(1+o):r+o-r*o,l=2*r-s;t=p(l,s,a+1/3),n=p(l,s,a),i=p(l,s,a-1/3)}return"#"+P[Math.floor(255*t)]+P[Math.floor(255*n)]+P[Math.floor(255*i)]}function p(e,t,n){return 0>n&&n++,n>1&&n--,1>6*n?e+6*(t-e)*n:1>2*n?t:2>3*n?e+(t-e)*(2/3-n)*6:e}function c(e){if(e in R)return R[e];var t,n=1;if(e=String(e),"#"==e.charAt(0))t=e;else if(/^rgb/.test(e)){for(var i,a=m(e),t="#",o=0;3>o;o++)i=-1!=a[o].indexOf("%")?Math.floor(255*V(a[o])):+a[o],t+=P[U(i,0,255)];n=+a[3]}else if(/^hsl/.test(e)){var a=m(e);t=d(a),n=a[3]}else t=H[e]||e;return R[e]={color:t,alpha:n}}function u(e){if(Y[e])return Y[e];var t,n=document.createElement("div"),i=n.style;try{i.font=e,t=i.fontFamily.split(",")[0]}catch(a){}return Y[e]={style:i.fontStyle||G.style,variant:i.fontVariant||G.variant,weight:i.fontWeight||G.weight,size:i.fontSize||G.size,family:t||G.family}}function y(e,t){var n={};for(var i in e)n[i]=e[i];var a=parseFloat(t.currentStyle.fontSize),o=parseFloat(e.size);return n.size="number"==typeof e.size?e.size:-1!=e.size.indexOf("px")?o:-1!=e.size.indexOf("em")?a*o:-1!=e.size.indexOf("%")?a/100*o:-1!=e.size.indexOf("pt")?o/.75:a,n}function g(e){return e.style+" "+e.variant+" "+e.weight+" "+e.size+"px '"+e.family+"'"}function b(e){return Q[e]||"square"}function f(e){this.m_=s(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=1*M,this.globalAlpha=1,this.font="12px 微软雅黑",this.textAlign="left",this.textBaseline="alphabetic",this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var i=n.cloneNode(!1);i.style.backgroundColor="#fff",i.style.filter="alpha(opacity=0)",e.appendChild(i),this.element_=n,this.scaleX_=1,this.scaleY_=1,this.lineScale_=1}function k(e,t,n,i){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:i.x,y:i.y}),e.currentX_=i.x,e.currentY_=i.y}function x(e,t){var n=c(e.strokeStyle),i=n.color,a=n.alpha*e.globalAlpha,o=e.lineScale_*e.lineWidth;1>o&&(a*=o),t.push("<g_vml_:stroke",' opacity="',a,'"',' joinstyle="',e.lineJoin,'"',' miterlimit="',e.miterLimit,'"',' endcap="',b(e.lineCap),'"',' weight="',o,'px"',' color="',i,'" />')}function _(e,t,n,i){var a=e.fillStyle,o=e.scaleX_,r=e.scaleY_,s=i.x-n.x,l=i.y-n.y;if(a instanceof K){var h=0,m={x:0,y:0},V=0,U=1;if("gradient"==a.type_){var d=a.x0_/o,p=a.y0_/r,u=a.x1_/o,y=a.y1_/r,g=L(e,d,p),b=L(e,u,y),f=b.x-g.x,k=b.y-g.y;h=180*Math.atan2(f,k)/Math.PI,0>h&&(h+=360),1e-6>h&&(h=0)}else{var g=L(e,a.x0_,a.y0_);m={x:(g.x-n.x)/s,y:(g.y-n.y)/l},s/=o*M,l/=r*M;var x=C.max(s,l);V=2*a.r0_/x,U=2*a.r1_/x-V}var _=a.colors_;_.sort(function(e,t){return e.offset-t.offset});for(var W=_.length,X=_[0].color,I=_[W-1].color,v=_[0].alpha*e.globalAlpha,J=_[W-1].alpha*e.globalAlpha,S=[],E=0;W>E;E++){var F=_[E];S.push(F.offset*U+V+" "+F.color)}t.push('<g_vml_:fill type="',a.type_,'"',' method="none" focus="100%"',' color="',X,'"',' color2="',I,'"',' colors="',S.join(","),'"',' opacity="',J,'"',' g_o_:opacity2="',v,'"',' angle="',h,'"',' focusposition="',m.x,",",m.y,'" />')}else if(a instanceof w){if(s&&l){var T=-n.x,A=-n.y;t.push("<g_vml_:fill",' position="',T/s*o*o,",",A/l*r*r,'"',' type="tile"',' src="',a.src_,'" />')}}else{var z=c(e.fillStyle),O=z.color,D=z.alpha*e.globalAlpha;t.push('<g_vml_:fill color="',O,'" opacity="',D,'" />')}}function L(e,t,n){var i=e.m_;return{x:M*(t*i[0][0]+n*i[1][0]+i[2][0])-z,y:M*(t*i[0][1]+n*i[1][1]+i[2][1])-z}}function W(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function X(e,t,n){if(W(t)&&(e.m_=t,e.scaleX_=Math.sqrt(t[0][0]*t[0][0]+t[0][1]*t[0][1]),e.scaleY_=Math.sqrt(t[1][0]*t[1][0]+t[1][1]*t[1][1]),n)){var i=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=A(T(i))}}function K(e){this.type_=e,this.x0_=0,this.y0_=0,this.r0_=0,this.x1_=0,this.y1_=0,this.r1_=0,this.colors_=[]}function w(e,t){switch(v(e),t){case"repeat":case null:case"":this.repetition_="repeat";break;case"repeat-x":case"repeat-y":case"no-repeat":this.repetition_=t;break;default:I("SYNTAX_ERR")}this.src_=e.src,this.width_=e.width,this.height_=e.height}function I(e){throw new J(e)}function v(e){e&&1==e.nodeType&&"IMG"==e.tagName||I("TYPE_MISMATCH_ERR"),"complete"!=e.readyState&&I("INVALID_STATE_ERR")}function J(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var C=Math,S=C.round,E=C.sin,F=C.cos,T=C.abs,A=C.sqrt,M=10,z=M/2,O=(+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],Array.prototype.slice);a(document);var D={init:function(e){var n=e||document;n.createElement("canvas"),n.attachEvent("onreadystatechange",t(this.init_,this,n))},init_:function(e){for(var t=e.getElementsByTagName("canvas"),n=0;n<t.length;n++)this.initElement(t[n])},initElement:function(t){if(!t.getContext){t.getContext=e,a(t.ownerDocument),t.innerHTML="",t.attachEvent("onpropertychange",o),t.attachEvent("onresize",r);var n=t.attributes;n.width&&n.width.specified?t.style.width=n.width.nodeValue+"px":t.width=t.clientWidth,n.height&&n.height.specified?t.style.height=n.height.nodeValue+"px":t.height=t.clientHeight}return t}};D.init();for(var P=[],N=0;16>N;N++)for(var B=0;16>B;B++)P[16*N+B]=N.toString(16)+B.toString(16);var H={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",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",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",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",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"},R={},G={style:"normal",variant:"normal",weight:"normal",size:12,family:"微软雅黑"},Y={},Q={butt:"flat",round:"round"},Z=f.prototype;Z.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null),this.element_.innerHTML=""},Z.beginPath=function(){this.currentPath_=[]},Z.moveTo=function(e,t){var n=L(this,e,t);this.currentPath_.push({type:"moveTo",x:n.x,y:n.y}),this.currentX_=n.x,this.currentY_=n.y},Z.lineTo=function(e,t){var n=L(this,e,t);this.currentPath_.push({type:"lineTo",x:n.x,y:n.y}),this.currentX_=n.x,this.currentY_=n.y},Z.bezierCurveTo=function(e,t,n,i,a,o){var r=L(this,a,o),s=L(this,e,t),l=L(this,n,i);k(this,s,l,r)},Z.quadraticCurveTo=function(e,t,n,i){var a=L(this,e,t),o=L(this,n,i),r={x:this.currentX_+2/3*(a.x-this.currentX_),y:this.currentY_+2/3*(a.y-this.currentY_)},s={x:r.x+(o.x-this.currentX_)/3,y:r.y+(o.y-this.currentY_)/3};k(this,r,s,o)},Z.arc=function(e,t,n,i,a,o){n*=M;var r=o?"at":"wa",s=e+F(i)*n-z,l=t+E(i)*n-z,h=e+F(a)*n-z,m=t+E(a)*n-z;s!=h||o||(s+=.125);var V=L(this,e,t),U=L(this,s,l),d=L(this,h,m);this.currentPath_.push({type:r,x:V.x,y:V.y,radius:n,xStart:U.x,yStart:U.y,xEnd:d.x,yEnd:d.y})},Z.rect=function(e,t,n,i){this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+i),this.lineTo(e,t+i),this.closePath()},Z.strokeRect=function(e,t,n,i){var a=this.currentPath_;this.beginPath(),this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+i),this.lineTo(e,t+i),this.closePath(),this.stroke(),this.currentPath_=a},Z.fillRect=function(e,t,n,i){var a=this.currentPath_;this.beginPath(),this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+i),this.lineTo(e,t+i),this.closePath(),this.fill(),this.currentPath_=a},Z.createLinearGradient=function(e,t,n,i){var a=new K("gradient");return a.x0_=e,a.y0_=t,a.x1_=n,a.y1_=i,a},Z.createRadialGradient=function(e,t,n,i,a,o){var r=new K("gradientradial");return r.x0_=e,r.y0_=t,r.r0_=n,r.x1_=i,r.y1_=a,r.r1_=o,r},Z.drawImage=function(e){var t,n,i,a,o,r,s,l,h=e.runtimeStyle.width,m=e.runtimeStyle.height;e.runtimeStyle.width="auto",e.runtimeStyle.height="auto";var V=e.width,U=e.height;if(e.runtimeStyle.width=h,e.runtimeStyle.height=m,3==arguments.length)t=arguments[1],n=arguments[2],o=r=0,s=i=V,l=a=U;else if(5==arguments.length)t=arguments[1],n=arguments[2],i=arguments[3],a=arguments[4],o=r=0,s=V,l=U;else{if(9!=arguments.length)throw Error("Invalid number of arguments");o=arguments[1],r=arguments[2],s=arguments[3],l=arguments[4],t=arguments[5],n=arguments[6],i=arguments[7],a=arguments[8]}var d=L(this,t,n),p=[],c=10,u=10,y=b=1;if(p.push(" <g_vml_:group",' coordsize="',M*c,",",M*u,'"',' coordorigin="0,0"',' style="width:',c,"px;height:",u,"px;position:absolute;"),1!=this.m_[0][0]||this.m_[0][1]||1!=this.m_[1][1]||this.m_[1][0]){var g=[],y=this.scaleX_,b=this.scaleY_;g.push("M11=",this.m_[0][0]/y,",","M12=",this.m_[1][0]/b,",","M21=",this.m_[0][1]/y,",","M22=",this.m_[1][1]/b,",","Dx=",S(d.x/M),",","Dy=",S(d.y/M),"");var f=d,k=L(this,t+i,n),x=L(this,t,n+a),_=L(this,t+i,n+a);f.x=C.max(f.x,k.x,x.x,_.x),f.y=C.max(f.y,k.y,x.y,_.y),p.push("padding:0 ",S(f.x/M),"px ",S(f.y/M),"px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",g.join(""),", SizingMethod='clip');")}else p.push("top:",S(d.y/M),"px;left:",S(d.x/M),"px;");p.push(' ">'),(o||r)&&p.push('<div style="overflow: hidden; width:',Math.ceil((i+o*i/s)*y),"px;"," height:",Math.ceil((a+r*a/l)*b),"px;"," filter:progid:DxImageTransform.Microsoft.Matrix(Dx=",-o*i/s*y,",Dy=",-r*a/l*b,');">'),p.push('<div style="width:',Math.round(y*V*i/s),"px;"," height:",Math.round(b*U*a/l),"px;"," filter:"),this.globalAlpha<1&&p.push(" progid:DXImageTransform.Microsoft.Alpha(opacity="+100*this.globalAlpha+")"),p.push(" progid:DXImageTransform.Microsoft.AlphaImageLoader(src=",e.src,',sizingMethod=scale)">'),(o||r)&&p.push("</div>"),p.push("</div></div>"),this.element_.insertAdjacentHTML("BeforeEnd",p.join(""))},Z.stroke=function(e){var t=[],n=10,i=10;t.push("<g_vml_:shape",' filled="',!!e,'"',' style="position:absolute;width:',n,"px;height:",i,'px;"',' coordorigin="0,0"',' coordsize="',M*n,",",M*i,'"',' stroked="',!e,'"',' path="');for(var a={x:null,y:null},o={x:null,y:null},r=0;r<this.currentPath_.length;r++){var s,l=this.currentPath_[r];switch(l.type){case"moveTo":s=l,t.push(" m ",S(l.x),",",S(l.y));break;case"lineTo":t.push(" l ",S(l.x),",",S(l.y));break;case"close":t.push(" x "),l=null;break;case"bezierCurveTo":t.push(" c ",S(l.cp1x),",",S(l.cp1y),",",S(l.cp2x),",",S(l.cp2y),",",S(l.x),",",S(l.y));break;case"at":case"wa":t.push(" ",l.type," ",S(l.x-this.scaleX_*l.radius),",",S(l.y-this.scaleY_*l.radius)," ",S(l.x+this.scaleX_*l.radius),",",S(l.y+this.scaleY_*l.radius)," ",S(l.xStart),",",S(l.yStart)," ",S(l.xEnd),",",S(l.yEnd))}l&&((null==a.x||l.x<a.x)&&(a.x=l.x),(null==o.x||l.x>o.x)&&(o.x=l.x),(null==a.y||l.y<a.y)&&(a.y=l.y),(null==o.y||l.y>o.y)&&(o.y=l.y))}t.push(' ">'),e?_(this,t,a,o):x(this,t),t.push("</g_vml_:shape>"),this.element_.insertAdjacentHTML("beforeEnd",t.join(""))},Z.fill=function(){this.stroke(!0)},Z.closePath=function(){this.currentPath_.push({type:"close"})},Z.save=function(){var e={};h(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=l(s(),this.m_)},Z.restore=function(){this.aStack_.length&&(h(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},Z.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];X(this,l(n,this.m_),!1)},Z.rotate=function(e){var t=F(e),n=E(e),i=[[t,n,0],[-n,t,0],[0,0,1]];X(this,l(i,this.m_),!1)},Z.scale=function(e,t){var n=[[e,0,0],[0,t,0],[0,0,1]];X(this,l(n,this.m_),!0)},Z.transform=function(e,t,n,i,a,o){var r=[[e,t,0],[n,i,0],[a,o,1]];X(this,l(r,this.m_),!0)},Z.setTransform=function(e,t,n,i,a,o){var r=[[e,t,0],[n,i,0],[a,o,1]];X(this,r,!0)},Z.drawText_=function(e,t,i,a,o){var r=this.m_,s=1e3,l=0,h=s,m={x:0,y:0},V=[],U=y(u(this.font),this.element_),d=g(U),p=this.element_.currentStyle,c=this.textAlign.toLowerCase();switch(c){case"left":case"center":case"right":break;case"end":c="ltr"==p.direction?"right":"left";break;case"start":c="rtl"==p.direction?"right":"left";break;default:c="left"}switch(this.textBaseline){case"hanging":case"top":m.y=U.size/1.75;break;case"middle":break;default:case null:case"alphabetic":case"ideographic":case"bottom":m.y=-U.size/2.25}switch(c){case"right":l=s,h=.05;break;case"center":l=h=s/2}var b=L(this,t+m.x,i+m.y);V.push('<g_vml_:line from="',-l,' 0" to="',h,' 0.05" ',' coordsize="100 100" coordorigin="0 0"',' filled="',!o,'" stroked="',!!o,'" style="position:absolute;width:1px;height:1px;">'),o?x(this,V):_(this,V,{x:-l,y:0},{x:h,y:U.size});var f=r[0][0].toFixed(3)+","+r[1][0].toFixed(3)+","+r[0][1].toFixed(3)+","+r[1][1].toFixed(3)+",0,0",k=S(b.x/M)+","+S(b.y/M);V.push('<g_vml_:skew on="t" matrix="',f,'" ',' offset="',k,'" origin="',l,' 0" />','<g_vml_:path textpathok="true" />','<g_vml_:textpath on="true" string="',n(e),'" style="v-text-align:',c,";font:",n(d),'" /></g_vml_:line>'),this.element_.insertAdjacentHTML("beforeEnd",V.join(""))},Z.fillText=function(e,t,n,i){this.drawText_(e,t,n,i,!1)},Z.strokeText=function(e,t,n,i){this.drawText_(e,t,n,i,!0)},Z.measureText=function(e){if(!this.textMeasureEl_){var t='<span style="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;"></span>';this.element_.insertAdjacentHTML("beforeEnd",t),this.textMeasureEl_=this.element_.lastChild}var n=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";try{this.textMeasureEl_.style.font=this.font}catch(i){}return this.textMeasureEl_.appendChild(n.createTextNode(e)),{width:this.textMeasureEl_.offsetWidth}},Z.clip=function(){},Z.arcTo=function(){},Z.createPattern=function(e,t){return new w(e,t)},K.prototype.addColorStop=function(e,t){t=c(t),this.colors_.push({offset:e,color:t.color,alpha:t.alpha})};var q=J.prototype=new Error;q.INDEX_SIZE_ERR=1,q.DOMSTRING_SIZE_ERR=2,q.HIERARCHY_REQUEST_ERR=3,q.WRONG_DOCUMENT_ERR=4,q.INVALID_CHARACTER_ERR=5,q.NO_DATA_ALLOWED_ERR=6,q.NO_MODIFICATION_ALLOWED_ERR=7,q.NOT_FOUND_ERR=8,q.NOT_SUPPORTED_ERR=9,q.INUSE_ATTRIBUTE_ERR=10,q.INVALID_STATE_ERR=11,q.SYNTAX_ERR=12,q.INVALID_MODIFICATION_ERR=13,q.NAMESPACE_ERR=14,q.INVALID_ACCESS_ERR=15,q.VALIDATION_ERR=16,q.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=D,CanvasRenderingContext2D=f,CanvasGradient=K,CanvasPattern=w,DOMException=J}(),G_vmlCanvasManager}),n("zrender/mixin/Eventful",["require"],function(){var e=function(){this._handlers={}};return e.prototype.one=function(e,t,n){var i=this._handlers;return t&&e?(i[e]||(i[e]=[]),i[e].push({h:t,one:!0,ctx:n||this}),this):this},e.prototype.bind=function(e,t,n){var i=this._handlers;return t&&e?(i[e]||(i[e]=[]),i[e].push({h:t,one:!1,ctx:n||this}),this):this},e.prototype.unbind=function(e,t){var n=this._handlers;if(!e)return this._handlers={},this;if(t){if(n[e]){for(var i=[],a=0,o=n[e].length;o>a;a++)n[e][a].h!=t&&i.push(n[e][a]);n[e]=i}n[e]&&0===n[e].length&&delete n[e]}else delete n[e];return this},e.prototype.dispatch=function(e){if(this._handlers[e]){var t=arguments,n=t.length;n>3&&(t=Array.prototype.slice.call(t,1));for(var i=this._handlers[e],a=i.length,o=0;a>o;){switch(n){case 1:i[o].h.call(i[o].ctx);break;case 2:i[o].h.call(i[o].ctx,t[1]);break;case 3:i[o].h.call(i[o].ctx,t[1],t[2]);break;default:i[o].h.apply(i[o].ctx,t)}i[o].one?(i.splice(o,1),a--):o++}}return this},e.prototype.dispatchWithContext=function(e){if(this._handlers[e]){var t=arguments,n=t.length;n>4&&(t=Array.prototype.slice.call(t,1,t.length-1));for(var i=t[t.length-1],a=this._handlers[e],o=a.length,r=0;o>r;){switch(n){case 1:a[r].h.call(i);break;case 2:a[r].h.call(i,t[1]);break;case 3:a[r].h.call(i,t[1],t[2]);break;default:a[r].h.apply(i,t)}a[r].one?(a.splice(r,1),o--):r++}}return this},e}),n("zrender/tool/log",["require","../config"],function(e){var t=e("../config");return function(){if(0!==t.debugMode)if(1==t.debugMode)for(var e in arguments)throw new Error(arguments[e]);else if(t.debugMode>1)for(var e in arguments)console.log(arguments[e])}}),n("zrender/tool/guid",[],function(){var e=2311;return function(){return"zrender__"+e++}}),n("zrender/Handler",["require","./config","./tool/env","./tool/event","./tool/util","./tool/vector","./tool/matrix","./mixin/Eventful"],function(e){"use strict";function t(e,t){return function(n){return e.call(t,n)}}function n(e,t){return function(n,i,a){return e.call(t,n,i,a)}}function i(e){for(var n=d.length;n--;){var i=d[n];e["_"+i+"Handler"]=t(p[i],e)}}function a(e,t,n){if(this._draggingTarget&&this._draggingTarget.id==e.id||e.isSilent())return!1;var i=this._event;if(e.isCover(t,n)){e.hoverable&&this.storage.addHover(e);for(var a=e.parent;a;){if(a.clipShape&&!a.clipShape.isCover(this._mouseX,this._mouseY))return!1;a=a.parent}return this._lastHover!=e&&(this._processOutShape(i),this._processDragLeave(i),this._lastHover=e,this._processDragEnter(i)),this._processOverShape(i),this._processDragOver(i),this._hasfound=1,!0}return!1}var o=e("./config"),r=e("./tool/env"),s=e("./tool/event"),l=e("./tool/util"),h=e("./tool/vector"),m=e("./tool/matrix"),V=o.EVENT,U=e("./mixin/Eventful"),d=["resize","click","dblclick","mousewheel","mousemove","mouseout","mouseup","mousedown","touchstart","touchend","touchmove"],p={resize:function(e){e=e||window.event,this._lastHover=null,this._isMouseDown=0,this.dispatch(V.RESIZE,e)},click:function(e){e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._clickThreshold<5&&this._dispatchAgency(t,V.CLICK,e),this._mousemoveHandler(e)},dblclick:function(e){e=e||window.event,e=this._zrenderEventFixed(e);var t=this._lastHover;(t&&t.clickable||!t)&&this._clickThreshold<5&&this._dispatchAgency(t,V.DBLCLICK,e),this._mousemoveHandler(e)},mousewheel:function(e){e=this._zrenderEventFixed(e);var t=e.wheelDelta||-e.detail,n=t>0?1.1:1/1.1,i=!1,a=this._mouseX,o=this._mouseY;this.painter.eachBuildinLayer(function(t){var r=t.position;if(t.zoomable){t.__zoom=t.__zoom||1;var l=t.__zoom;l*=n,l=Math.max(Math.min(t.maxZoom,l),t.minZoom),n=l/t.__zoom,t.__zoom=l,r[0]-=(a-r[0])*(n-1),r[1]-=(o-r[1])*(n-1),t.scale[0]*=n,t.scale[1]*=n,t.dirty=!0,i=!0,s.stop(e)}}),i&&this.painter.refresh(),this._dispatchAgency(this._lastHover,V.MOUSEWHEEL,e),this._mousemoveHandler(e)},mousemove:function(e){if(!this.painter.isLoading()){e=this._zrenderEventFixed(e),this._lastX=this._mouseX,this._lastY=this._mouseY,this._mouseX=s.getX(e),this._mouseY=s.getY(e);var t=this._mouseX-this._lastX,n=this._mouseY-this._lastY;this._processDragStart(e),this._hasfound=0,this._event=e,this._iterateAndFindHover(),this._hasfound||((!this._draggingTarget||this._lastHover&&this._lastHover!=this._draggingTarget)&&(this._processOutShape(e),this._processDragLeave(e)),this._lastHover=null,this.storage.delHover(),this.painter.clearHover());var i="default";if(this._draggingTarget)this.storage.drift(this._draggingTarget.id,t,n),this._draggingTarget.modSelf(),this.storage.addHover(this._draggingTarget),this._clickThreshold++;else if(this._isMouseDown){var a=!1;this.painter.eachBuildinLayer(function(e){e.panable&&(i="move",e.position[0]+=t,e.position[1]+=n,a=!0,e.dirty=!0)}),a&&this.painter.refresh()}this._draggingTarget||this._hasfound&&this._lastHover.draggable?i="move":this._hasfound&&this._lastHover.clickable&&(i="pointer"),this.root.style.cursor=i,this._dispatchAgency(this._lastHover,V.MOUSEMOVE,e),(this._draggingTarget||this._hasfound||this.storage.hasHoverShape())&&this.painter.refreshHover()}},mouseout:function(e){e=this._zrenderEventFixed(e);var t=e.toElement||e.relatedTarget;if(t!=this.root)for(;t&&9!=t.nodeType;){if(t==this.root)return void this._mousemoveHandler(e);t=t.parentNode}e.zrenderX=this._lastX,e.zrenderY=this._lastY,this.root.style.cursor="default",this._isMouseDown=0,this._processOutShape(e),this._processDrop(e),this._processDragEnd(e),this.painter.isLoading()||this.painter.refreshHover(),this.dispatch(V.GLOBALOUT,e)
-},mousedown:function(e){return this._clickThreshold=0,2==this._lastDownButton?(this._lastDownButton=e.button,void(this._mouseDownTarget=null)):(this._lastMouseDownMoment=new Date,e=this._zrenderEventFixed(e),this._isMouseDown=1,this._mouseDownTarget=this._lastHover,this._dispatchAgency(this._lastHover,V.MOUSEDOWN,e),void(this._lastDownButton=e.button))},mouseup:function(e){e=this._zrenderEventFixed(e),this.root.style.cursor="default",this._isMouseDown=0,this._mouseDownTarget=null,this._dispatchAgency(this._lastHover,V.MOUSEUP,e),this._processDrop(e),this._processDragEnd(e)},touchstart:function(e){e=this._zrenderEventFixed(e,!0),this._lastTouchMoment=new Date,this._mobileFindFixed(e),this._mousedownHandler(e)},touchmove:function(e){e=this._zrenderEventFixed(e,!0),this._mousemoveHandler(e),this._isDragging&&s.stop(e)},touchend:function(e){e=this._zrenderEventFixed(e,!0),this._mouseupHandler(e);var t=new Date;t-this._lastTouchMoment<V.touchClickDelay&&(this._mobileFindFixed(e),this._clickHandler(e),t-this._lastClickMoment<V.touchClickDelay/2&&(this._dblclickHandler(e),this._lastHover&&this._lastHover.clickable&&s.stop(e)),this._lastClickMoment=t),this.painter.clearHover()}},c=function(e,t,o){U.call(this),this.root=e,this.storage=t,this.painter=o,this._lastX=this._lastY=this._mouseX=this._mouseY=0,this._findHover=n(a,this),this._domHover=o.getDomHover(),i(this),window.addEventListener?(window.addEventListener("resize",this._resizeHandler),r.os.tablet||r.os.phone?(e.addEventListener("touchstart",this._touchstartHandler),e.addEventListener("touchmove",this._touchmoveHandler),e.addEventListener("touchend",this._touchendHandler)):(e.addEventListener("click",this._clickHandler),e.addEventListener("dblclick",this._dblclickHandler),e.addEventListener("mousewheel",this._mousewheelHandler),e.addEventListener("mousemove",this._mousemoveHandler),e.addEventListener("mousedown",this._mousedownHandler),e.addEventListener("mouseup",this._mouseupHandler)),e.addEventListener("DOMMouseScroll",this._mousewheelHandler),e.addEventListener("mouseout",this._mouseoutHandler)):(window.attachEvent("onresize",this._resizeHandler),e.attachEvent("onclick",this._clickHandler),e.ondblclick=this._dblclickHandler,e.attachEvent("onmousewheel",this._mousewheelHandler),e.attachEvent("onmousemove",this._mousemoveHandler),e.attachEvent("onmouseout",this._mouseoutHandler),e.attachEvent("onmousedown",this._mousedownHandler),e.attachEvent("onmouseup",this._mouseupHandler))};c.prototype.on=function(e,t,n){return this.bind(e,t,n),this},c.prototype.un=function(e,t){return this.unbind(e,t),this},c.prototype.trigger=function(e,t){switch(e){case V.RESIZE:case V.CLICK:case V.DBLCLICK:case V.MOUSEWHEEL:case V.MOUSEMOVE:case V.MOUSEDOWN:case V.MOUSEUP:case V.MOUSEOUT:this["_"+e+"Handler"](t)}},c.prototype.dispose=function(){var e=this.root;window.removeEventListener?(window.removeEventListener("resize",this._resizeHandler),r.os.tablet||r.os.phone?(e.removeEventListener("touchstart",this._touchstartHandler),e.removeEventListener("touchmove",this._touchmoveHandler),e.removeEventListener("touchend",this._touchendHandler)):(e.removeEventListener("click",this._clickHandler),e.removeEventListener("dblclick",this._dblclickHandler),e.removeEventListener("mousewheel",this._mousewheelHandler),e.removeEventListener("mousemove",this._mousemoveHandler),e.removeEventListener("mousedown",this._mousedownHandler),e.removeEventListener("mouseup",this._mouseupHandler)),e.removeEventListener("DOMMouseScroll",this._mousewheelHandler),e.removeEventListener("mouseout",this._mouseoutHandler)):(window.detachEvent("onresize",this._resizeHandler),e.detachEvent("onclick",this._clickHandler),e.detachEvent("dblclick",this._dblclickHandler),e.detachEvent("onmousewheel",this._mousewheelHandler),e.detachEvent("onmousemove",this._mousemoveHandler),e.detachEvent("onmouseout",this._mouseoutHandler),e.detachEvent("onmousedown",this._mousedownHandler),e.detachEvent("onmouseup",this._mouseupHandler)),this.root=this._domHover=this.storage=this.painter=null,this.un()},c.prototype._processDragStart=function(e){var t=this._lastHover;if(this._isMouseDown&&t&&t.draggable&&!this._draggingTarget&&this._mouseDownTarget==t){if(t.dragEnableTime&&new Date-this._lastMouseDownMoment<t.dragEnableTime)return;var n=t;this._draggingTarget=n,this._isDragging=1,n.invisible=!0,this.storage.mod(n.id),this._dispatchAgency(n,V.DRAGSTART,e),this.painter.refresh()}},c.prototype._processDragEnter=function(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,V.DRAGENTER,e,this._draggingTarget)},c.prototype._processDragOver=function(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,V.DRAGOVER,e,this._draggingTarget)},c.prototype._processDragLeave=function(e){this._draggingTarget&&this._dispatchAgency(this._lastHover,V.DRAGLEAVE,e,this._draggingTarget)},c.prototype._processDrop=function(e){this._draggingTarget&&(this._draggingTarget.invisible=!1,this.storage.mod(this._draggingTarget.id),this.painter.refresh(),this._dispatchAgency(this._lastHover,V.DROP,e,this._draggingTarget))},c.prototype._processDragEnd=function(e){this._draggingTarget&&(this._dispatchAgency(this._draggingTarget,V.DRAGEND,e),this._lastHover=null),this._isDragging=0,this._draggingTarget=null},c.prototype._processOverShape=function(e){this._dispatchAgency(this._lastHover,V.MOUSEOVER,e)},c.prototype._processOutShape=function(e){this._dispatchAgency(this._lastHover,V.MOUSEOUT,e)},c.prototype._dispatchAgency=function(e,t,n,i){var a="on"+t,o={type:t,event:n,target:e,cancelBubble:!1},r=e;for(i&&(o.dragged=i);r&&(r[a]&&(o.cancelBubble=r[a](o)),r.dispatch(t,o),r=r.parent,!o.cancelBubble););if(e)o.cancelBubble||this.dispatch(t,o);else if(!i){var s={type:t,event:n};this.dispatch(t,s),this.painter.eachOtherLayer(function(e){"function"==typeof e[a]&&e[a](s),e.dispatch&&e.dispatch(t,s)})}},c.prototype._iterateAndFindHover=function(){var e=m.create();return function(){for(var t,n,i=this.storage.getShapeList(),a=[0,0],o=i.length-1;o>=0;o--){var r=i[o];if(t!==r.zlevel&&(n=this.painter.getLayer(r.zlevel,n),a[0]=this._mouseX,a[1]=this._mouseY,n.needTransform&&(m.invert(e,n.transform),h.applyTransform(a,a,e))),this._findHover(r,a[0],a[1]))break}}}();var u=[{x:10},{x:-20},{x:10,y:10},{y:-20}];return c.prototype._mobileFindFixed=function(e){this._lastHover=null,this._mouseX=e.zrenderX,this._mouseY=e.zrenderY,this._event=e,this._iterateAndFindHover();for(var t=0;!this._lastHover&&t<u.length;t++){var n=u[t];n.x&&(this._mouseX+=n.x),n.y&&(this._mouseY+=n.y),this._iterateAndFindHover()}this._lastHover&&(e.zrenderX=this._mouseX,e.zrenderY=this._mouseY)},c.prototype._zrenderEventFixed=function(e,t){if(e.zrenderFixed)return e;if(t){var n="touchend"!=e.type?e.targetTouches[0]:e.changedTouches[0];if(n){var i=this.painter._domRoot.getBoundingClientRect();e.zrenderX=n.clientX-i.left,e.zrenderY=n.clientY-i.top}}else{e=e||window.event;var a=e.toElement||e.relatedTarget||e.srcElement||e.target;a&&a!=this._domHover&&(e.zrenderX=("undefined"!=typeof e.offsetX?e.offsetX:e.layerX)+a.offsetLeft,e.zrenderY=("undefined"!=typeof e.offsetY?e.offsetY:e.layerY)+a.offsetTop)}return e.zrenderFixed=1,e},l.merge(c.prototype,U.prototype,!0),c}),n("zrender/Painter",["require","./config","./tool/util","./tool/log","./loadingEffect/Base","./Layer","./shape/Image"],function(e){"use strict";function t(){return!1}function n(){}function i(e){return e?e.isBuildin?!0:"function"!=typeof e.resize||"function"!=typeof e.refresh?!1:!0:!1}var a=e("./config"),o=e("./tool/util"),r=e("./tool/log"),s=e("./loadingEffect/Base"),l=e("./Layer"),h=function(e,n){this.root=e,e.style["-webkit-tap-highlight-color"]="transparent",e.style["-webkit-user-select"]="none",e.style["user-select"]="none",e.style["-webkit-touch-callout"]="none",this.storage=n,e.innerHTML="",this._width=this._getWidth(),this._height=this._getHeight();var i=document.createElement("div");this._domRoot=i,i.style.position="relative",i.style.overflow="hidden",i.style.width=this._width+"px",i.style.height=this._height+"px",e.appendChild(i),this._layers={},this._zlevelList=[],this._layerConfig={},this._loadingEffect=new s({}),this.shapeToImage=this._createShapeToImageProcessor(),this._bgDom=document.createElement("div"),this._bgDom.style.cssText=["position:absolute;left:0px;top:0px;width:",this._width,"px;height:",this._height+"px;","-webkit-user-select:none;user-select;none;","-webkit-touch-callout:none;"].join(""),this._bgDom.setAttribute("data-zr-dom-id","bg"),i.appendChild(this._bgDom),this._bgDom.onselectstart=t;var a=new l("_zrender_hover_",this);this._layers.hover=a,i.appendChild(a.dom),a.initContext(),a.dom.onselectstart=t,a.dom.style["-webkit-user-select"]="none",a.dom.style["user-select"]="none",a.dom.style["-webkit-touch-callout"]="none",this.refreshNextFrame=null};return h.prototype.render=function(e){return this.isLoading()&&this.hideLoading(),this.refresh(e,!0),this},h.prototype.refresh=function(e,t){var n=this.storage.getShapeList(!0);this._paintList(n,t);for(var i=0;i<this._zlevelList.length;i++){var a=this._zlevelList[i],o=this._layers[a];!o.isBuildin&&o.refresh&&o.refresh()}return"function"==typeof e&&e(),this},h.prototype._preProcessLayer=function(e){e.unusedCount++,e.updateTransform()},h.prototype._postProcessLayer=function(e){e.dirty=!1,1==e.unusedCount&&e.clear()},h.prototype._paintList=function(e,t){"undefined"==typeof t&&(t=!1),this._updateLayerStatus(e);var n,i,o;this.eachBuildinLayer(this._preProcessLayer);for(var s=0,l=e.length;l>s;s++){var h=e[s];if(i!==h.zlevel&&(n&&(n.needTransform&&o.restore(),o.flush&&o.flush()),i=h.zlevel,n=this.getLayer(i),n.isBuildin||r("ZLevel "+i+" has been used by unkown layer "+n.id),o=n.ctx,n.unusedCount=0,(n.dirty||t)&&n.clear(),n.needTransform&&(o.save(),n.setTransform(o))),(n.dirty||t)&&!h.invisible&&(!h.onbrush||h.onbrush&&!h.onbrush(o,!1)))if(a.catchBrushException)try{h.brush(o,!1,this.refreshNextFrame)}catch(m){r(m,"brush error of "+h.type,h)}else h.brush(o,!1,this.refreshNextFrame);h.__dirty=!1}n&&(n.needTransform&&o.restore(),o.flush&&o.flush()),this.eachBuildinLayer(this._postProcessLayer)},h.prototype.getLayer=function(e){var t=this._layers[e];return t||(t=new l(e,this),t.isBuildin=!0,this._layerConfig[e]&&o.merge(t,this._layerConfig[e],!0),t.updateTransform(),this.insertLayer(e,t),t.initContext()),t},h.prototype.insertLayer=function(e,t){if(this._layers[e])return void r("ZLevel "+e+" has been used already");if(!i(t))return void r("Layer of zlevel "+e+" is not valid");var n=this._zlevelList.length,a=null,o=-1;if(n>0&&e>this._zlevelList[0]){for(o=0;n-1>o&&!(this._zlevelList[o]<e&&this._zlevelList[o+1]>e);o++);a=this._layers[this._zlevelList[o]]}this._zlevelList.splice(o+1,0,e);var s=a?a.dom:this._bgDom;s.nextSibling?s.parentNode.insertBefore(t.dom,s.nextSibling):s.parentNode.appendChild(t.dom),this._layers[e]=t},h.prototype.eachLayer=function(e,t){for(var n=0;n<this._zlevelList.length;n++){var i=this._zlevelList[n];e.call(t,this._layers[i],i)}},h.prototype.eachBuildinLayer=function(e,t){for(var n=0;n<this._zlevelList.length;n++){var i=this._zlevelList[n],a=this._layers[i];a.isBuildin&&e.call(t,a,i)}},h.prototype.eachOtherLayer=function(e,t){for(var n=0;n<this._zlevelList.length;n++){var i=this._zlevelList[n],a=this._layers[i];a.isBuildin||e.call(t,a,i)}},h.prototype.getLayers=function(){return this._layers},h.prototype._updateLayerStatus=function(e){var t=this._layers,n={};this.eachBuildinLayer(function(e,t){n[t]=e.elCount,e.elCount=0});for(var i=0,a=e.length;a>i;i++){var o=e[i],r=o.zlevel,s=t[r];if(s){if(s.elCount++,s.dirty)continue;s.dirty=o.__dirty}}this.eachBuildinLayer(function(e,t){n[t]!==e.elCount&&(e.dirty=!0)})},h.prototype.refreshShapes=function(e,t){for(var n=0,i=e.length;i>n;n++){var a=e[n];a.modSelf()}return this.refresh(t),this},h.prototype.setLoadingEffect=function(e){return this._loadingEffect=e,this},h.prototype.clear=function(){return this.eachBuildinLayer(this._clearLayer),this},h.prototype._clearLayer=function(e){e.clear()},h.prototype.modLayer=function(e,t){if(t){this._layerConfig[e]?o.merge(this._layerConfig[e],t,!0):this._layerConfig[e]=t;var n=this._layers[e];n&&o.merge(n,this._layerConfig[e],!0)}},h.prototype.delLayer=function(e){var t=this._layers[e];t&&(this.modLayer(e,{position:t.position,rotation:t.rotation,scale:t.scale}),t.dom.parentNode.removeChild(t.dom),delete this._layers[e],this._zlevelList.splice(o.indexOf(this._zlevelList,e),1))},h.prototype.refreshHover=function(){this.clearHover();for(var e=this.storage.getHoverShapes(!0),t=0,n=e.length;n>t;t++)this._brushHover(e[t]);var i=this._layers.hover.ctx;return i.flush&&i.flush(),this.storage.delHover(),this},h.prototype.clearHover=function(){var e=this._layers.hover;return e&&e.clear(),this},h.prototype.showLoading=function(e){return this._loadingEffect&&this._loadingEffect.stop(),e&&this.setLoadingEffect(e),this._loadingEffect.start(this),this.loading=!0,this},h.prototype.hideLoading=function(){return this._loadingEffect.stop(),this.clearHover(),this.loading=!1,this},h.prototype.isLoading=function(){return this.loading},h.prototype.resize=function(){var e=this._domRoot;e.style.display="none";var t=this._getWidth(),n=this._getHeight();if(e.style.display="",this._width!=t||n!=this._height){this._width=t,this._height=n,e.style.width=t+"px",e.style.height=n+"px";for(var i in this._layers)this._layers[i].resize(t,n);this.refresh(null,!0)}return this},h.prototype.clearLayer=function(e){var t=this._layers[e];t&&t.clear()},h.prototype.dispose=function(){this.isLoading()&&this.hideLoading(),this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},h.prototype.getDomHover=function(){return this._layers.hover.dom},h.prototype.toDataURL=function(e,t,n){if(window.G_vmlCanvasManager)return null;var i=new l("image",this);this._bgDom.appendChild(i.dom),i.initContext();var o=i.ctx;i.clearColor=t||"#fff",i.clear();var s=this;this.storage.iterShape(function(e){if(!e.invisible&&(!e.onbrush||e.onbrush&&!e.onbrush(o,!1)))if(a.catchBrushException)try{e.brush(o,!1,s.refreshNextFrame)}catch(t){r(t,"brush error of "+e.type,e)}else e.brush(o,!1,s.refreshNextFrame)},{normal:"up",update:!0});var h=i.dom.toDataURL(e,n);return o=null,this._bgDom.removeChild(i.dom),h},h.prototype.getWidth=function(){return this._width},h.prototype.getHeight=function(){return this._height},h.prototype._getWidth=function(){var e=this.root,t=e.currentStyle||document.defaultView.getComputedStyle(e);return((e.clientWidth||parseInt(t.width,10))-parseInt(t.paddingLeft,10)-parseInt(t.paddingRight,10)).toFixed(0)-0},h.prototype._getHeight=function(){var e=this.root,t=e.currentStyle||document.defaultView.getComputedStyle(e);return((e.clientHeight||parseInt(t.height,10))-parseInt(t.paddingTop,10)-parseInt(t.paddingBottom,10)).toFixed(0)-0},h.prototype._brushHover=function(e){var t=this._layers.hover.ctx;if(!e.onbrush||e.onbrush&&!e.onbrush(t,!0)){var n=this.getLayer(e.zlevel);if(n.needTransform&&(t.save(),n.setTransform(t)),a.catchBrushException)try{e.brush(t,!0,this.refreshNextFrame)}catch(i){r(i,"hoverBrush error of "+e.type,e)}else e.brush(t,!0,this.refreshNextFrame);n.needTransform&&t.restore()}},h.prototype._shapeToImage=function(t,n,i,a,o){var r=document.createElement("canvas"),s=r.getContext("2d");r.style.width=i+"px",r.style.height=a+"px",r.setAttribute("width",i*o),r.setAttribute("height",a*o),s.clearRect(0,0,i*o,a*o);var l={position:n.position,rotation:n.rotation,scale:n.scale};n.position=[0,0,0],n.rotation=0,n.scale=[1,1],n&&n.brush(s,!1);var h=e("./shape/Image"),m=new h({id:t,style:{x:0,y:0,image:r}});return null!=l.position&&(m.position=n.position=l.position),null!=l.rotation&&(m.rotation=n.rotation=l.rotation),null!=l.scale&&(m.scale=n.scale=l.scale),m},h.prototype._createShapeToImageProcessor=function(){if(window.G_vmlCanvasManager)return n;var e=this;return function(t,n,i,o){return e._shapeToImage(t,n,i,o,a.devicePixelRatio)}},h}),n("zrender/Storage",["require","./tool/util","./Group"],function(e){"use strict";function t(e,t){return e.zlevel==t.zlevel?e.z==t.z?e.__renderidx-t.__renderidx:e.z-t.z:e.zlevel-t.zlevel}var n=e("./tool/util"),i=e("./Group"),a={hover:!1,normal:"down",update:!1},o=function(){this._elements={},this._hoverElements=[],this._roots=[],this._shapeList=[],this._shapeListOffset=0};return o.prototype.iterShape=function(e,t){if(t||(t=a),t.hover)for(var n=0,i=this._hoverElements.length;i>n;n++){var o=this._hoverElements[n];if(o.updateTransform(),e(o))return this}switch(t.update&&this.updateShapeList(),t.normal){case"down":for(var i=this._shapeList.length;i--;)if(e(this._shapeList[i]))return this;break;default:for(var n=0,i=this._shapeList.length;i>n;n++)if(e(this._shapeList[n]))return this}return this},o.prototype.getHoverShapes=function(e){for(var n=[],i=0,a=this._hoverElements.length;a>i;i++){n.push(this._hoverElements[i]);var o=this._hoverElements[i].hoverConnect;if(o){var r;o=o instanceof Array?o:[o];for(var s=0,l=o.length;l>s;s++)r=o[s].id?o[s]:this.get(o[s]),r&&n.push(r)}}if(n.sort(t),e)for(var i=0,a=n.length;a>i;i++)n[i].updateTransform();return n},o.prototype.getShapeList=function(e){return e&&this.updateShapeList(),this._shapeList},o.prototype.updateShapeList=function(){this._shapeListOffset=0;for(var e=0,n=this._roots.length;n>e;e++){var i=this._roots[e];this._updateAndAddShape(i)}this._shapeList.length=this._shapeListOffset;for(var e=0,n=this._shapeList.length;n>e;e++)this._shapeList[e].__renderidx=e;this._shapeList.sort(t)},o.prototype._updateAndAddShape=function(e,t){if(!e.ignore)if(e.updateTransform(),"group"==e.type){e.clipShape&&(e.clipShape.parent=e,e.clipShape.updateTransform(),t?(t=t.slice(),t.push(e.clipShape)):t=[e.clipShape]);for(var n=0;n<e._children.length;n++){var i=e._children[n];i.__dirty=e.__dirty||i.__dirty,this._updateAndAddShape(i,t)}e.__dirty=!1}else e.__clipShapes=t,this._shapeList[this._shapeListOffset++]=e},o.prototype.mod=function(e,t){var i=this._elements[e];if(i&&(i.modSelf(),t))if(t.parent||t._storage||t.__clipShapes){var a={};for(var o in t)"parent"!==o&&"_storage"!==o&&"__clipShapes"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);n.merge(i,a,!0)}else n.merge(i,t,!0);return this},o.prototype.drift=function(e,t,n){var i=this._elements[e];return i&&(i.needTransform=!0,"horizontal"===i.draggable?n=0:"vertical"===i.draggable&&(t=0),(!i.ondrift||i.ondrift&&!i.ondrift(t,n))&&i.drift(t,n)),this},o.prototype.addHover=function(e){return e.updateNeedTransform(),this._hoverElements.push(e),this},o.prototype.delHover=function(){return this._hoverElements=[],this},o.prototype.hasHoverShape=function(){return this._hoverElements.length>0},o.prototype.addRoot=function(e){e instanceof i&&e.addChildrenToStorage(this),this.addToMap(e),this._roots.push(e)},o.prototype.delRoot=function(e){if("undefined"==typeof e){for(var t=0;t<this._roots.length;t++){var a=this._roots[t];a instanceof i&&a.delChildrenFromStorage(this)}return this._elements={},this._hoverElements=[],this._roots=[],this._shapeList=[],void(this._shapeListOffset=0)}if(e instanceof Array)for(var t=0,o=e.length;o>t;t++)this.delRoot(e[t]);else{var r;r="string"==typeof e?this._elements[e]:e;var s=n.indexOf(this._roots,r);s>=0&&(this.delFromMap(r.id),this._roots.splice(s,1),r instanceof i&&r.delChildrenFromStorage(this))}},o.prototype.addToMap=function(e){return e instanceof i&&(e._storage=this),e.modSelf(),this._elements[e.id]=e,this},o.prototype.get=function(e){return this._elements[e]},o.prototype.delFromMap=function(e){var t=this._elements[e];return t&&(delete this._elements[e],t instanceof i&&(t._storage=null)),this},o.prototype.dispose=function(){this._elements=this._renderList=this._roots=this._hoverElements=null},o}),n("zrender/animation/Animation",["require","./Clip","../tool/color","../tool/util","../tool/event"],function(e){"use strict";function t(e,t){return e[t]}function n(e,t,n){e[t]=n}function i(e,t,n){return(t-e)*n+e}function a(e,t,n,a,o){var r=e.length;if(1==o)for(var s=0;r>s;s++)a[s]=i(e[s],t[s],n);else for(var l=e[0].length,s=0;r>s;s++)for(var h=0;l>h;h++)a[s][h]=i(e[s][h],t[s][h],n)}function o(e){switch(typeof e){case"undefined":case"string":return!1}return"undefined"!=typeof e.length}function r(e,t,n,i,a,o,r,l,h){var m=e.length;if(1==h)for(var V=0;m>V;V++)l[V]=s(e[V],t[V],n[V],i[V],a,o,r);else for(var U=e[0].length,V=0;m>V;V++)for(var d=0;U>d;d++)l[V][d]=s(e[V][d],t[V][d],n[V][d],i[V][d],a,o,r)}function s(e,t,n,i,a,o,r){var s=.5*(n-e),l=.5*(i-t);return(2*(t-n)+s+l)*r+(-3*(t-n)-2*s-l)*o+s*a+t}function l(e){if(o(e)){var t=e.length;if(o(e[0])){for(var n=[],i=0;t>i;i++)n.push(c.call(e[i]));return n}return c.call(e)}return e}function h(e){return e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.floor(e[2]),"rgba("+e.join(",")+")"}var m=e("./Clip"),V=e("../tool/color"),U=e("../tool/util"),d=e("../tool/event").Dispatcher,p=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){setTimeout(e,16)},c=Array.prototype.slice,u=function(e){e=e||{},this.stage=e.stage||{},this.onframe=e.onframe||function(){},this._clips=[],this._running=!1,this._time=0,d.call(this)};u.prototype={add:function(e){this._clips.push(e)},remove:function(e){var t=U.indexOf(this._clips,e);t>=0&&this._clips.splice(t,1)},_update:function(){for(var e=(new Date).getTime(),t=e-this._time,n=this._clips,i=n.length,a=[],o=[],r=0;i>r;r++){var s=n[r],l=s.step(e);l&&(a.push(l),o.push(s))}for(var r=0;i>r;)n[r]._needsRemove?(n[r]=n[i-1],n.pop(),i--):r++;i=a.length;for(var r=0;i>r;r++)o[r].fire(a[r]);this._time=e,this.onframe(t),this.dispatch("frame",t),this.stage.update&&this.stage.update()},start:function(){function e(){t._running&&(t._update(),p(e))}var t=this;this._running=!0,this._time=(new Date).getTime(),p(e)},stop:function(){this._running=!1},clear:function(){this._clips=[]},animate:function(e,t){t=t||{};var n=new y(e,t.loop,t.getter,t.setter);return n.animation=this,n},constructor:u},U.merge(u.prototype,d.prototype,!0);var y=function(e,i,a,o){this._tracks={},this._target=e,this._loop=i||!1,this._getter=a||t,this._setter=o||n,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};return y.prototype={when:function(e,t){for(var n in t)this._tracks[n]||(this._tracks[n]=[],0!==e&&this._tracks[n].push({time:0,value:l(this._getter(this._target,n))})),this._tracks[n].push({time:parseInt(e,10),value:t[n]});return this},during:function(e){return this._onframeList.push(e),this},start:function(e){var t=this,n=this._setter,l=this._getter,U="spline"===e,d=function(){if(t._clipCount--,0===t._clipCount){t._tracks={};for(var e=t._doneList.length,n=0;e>n;n++)t._doneList[n].call(t)}},p=function(p,c){var u=p.length;if(u){var y=p[0].value,g=o(y),b=!1,f=g&&o(y[0])?2:1;p.sort(function(e,t){return e.time-t.time});var k;if(u){k=p[u-1].time;for(var x=[],_=[],L=0;u>L;L++){x.push(p[L].time/k);var W=p[L].value;"string"==typeof W&&(W=V.toArray(W),0===W.length&&(W[0]=W[1]=W[2]=0,W[3]=1),b=!0),_.push(W)}var X,L,K,w,I,v,J,C=0,S=0;if(b)var E=[0,0,0,0];var F=function(e,o){if(S>o){for(X=Math.min(C+1,u-1),L=X;L>=0&&!(x[L]<=o);L--);L=Math.min(L,u-2)}else{for(L=C;u>L&&!(x[L]>o);L++);L=Math.min(L-1,u-2)}C=L,S=o;var m=x[L+1]-x[L];if(0!==m){if(K=(o-x[L])/m,U)if(I=_[L],w=_[0===L?L:L-1],v=_[L>u-2?u-1:L+1],J=_[L>u-3?u-1:L+2],g)r(w,I,v,J,K,K*K,K*K*K,l(e,c),f);else{var V;b?(V=r(w,I,v,J,K,K*K,K*K*K,E,1),V=h(E)):V=s(w,I,v,J,K,K*K,K*K*K),n(e,c,V)}else if(g)a(_[L],_[L+1],K,l(e,c),f);else{var V;b?(a(_[L],_[L+1],K,E,1),V=h(E)):V=i(_[L],_[L+1],K),n(e,c,V)}for(L=0;L<t._onframeList.length;L++)t._onframeList[L](e,o)}},T=new m({target:t._target,life:k,loop:t._loop,delay:t._delay,onframe:F,ondestroy:d});e&&"spline"!==e&&(T.easing=e),t._clipList.push(T),t._clipCount++,t.animation.add(T)}}};for(var c in this._tracks)p(this._tracks[c],c);return this},stop:function(){for(var e=0;e<this._clipList.length;e++){var t=this._clipList[e];this.animation.remove(t)}this._clipList=[]},delay:function(e){return this._delay=e,this},done:function(e){return e&&this._doneList.push(e),this}},u}),n("zrender/tool/vector",[],function(){var e="undefined"==typeof Float32Array?Array:Float32Array,t={create:function(t,n){var i=new e(2);return i[0]=t||0,i[1]=n||0,i},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},scaleAndAdd:function(e,t,n,i){return e[0]=t[0]+n[0]*i,e[1]=t[1]+n[1]*i,e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},len:function(e){return Math.sqrt(this.lenSquare(e))},lenSquare:function(e){return e[0]*e[0]+e[1]*e[1]},mul:function(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e},div:function(e,t,n){return e[0]=t[0]/n[0],e[1]=t[1]/n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},normalize:function(e,n){var i=t.len(n);return 0===i?(e[0]=0,e[1]=0):(e[0]=n[0]/i,e[1]=n[1]/i),e},distance:function(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))},distanceSquare:function(e,t){return(e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},lerp:function(e,t,n,i){return e[0]=t[0]+i*(n[0]-t[0]),e[1]=t[1]+i*(n[1]-t[1]),e},applyTransform:function(e,t,n){var i=t[0],a=t[1];return e[0]=n[0]*i+n[2]*a+n[4],e[1]=n[1]*i+n[3]*a+n[5],e},min:function(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e},max:function(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e}};return t.length=t.len,t.lengthSquare=t.lenSquare,t.dist=t.distance,t.distSquare=t.distanceSquare,t}),n("zrender/tool/matrix",[],function(){var e="undefined"==typeof Float32Array?Array:Float32Array,t={create:function(){var n=new e(6);return t.identity(n),n},identity:function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},mul:function(e,t,n){return e[0]=t[0]*n[0]+t[2]*n[1],e[1]=t[1]*n[0]+t[3]*n[1],e[2]=t[0]*n[2]+t[2]*n[3],e[3]=t[1]*n[2]+t[3]*n[3],e[4]=t[0]*n[4]+t[2]*n[5]+t[4],e[5]=t[1]*n[4]+t[3]*n[5]+t[5],e},translate:function(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e},rotate:function(e,t,n){var i=t[0],a=t[2],o=t[4],r=t[1],s=t[3],l=t[5],h=Math.sin(n),m=Math.cos(n);return e[0]=i*m+r*h,e[1]=-i*h+r*m,e[2]=a*m+s*h,e[3]=-a*h+m*s,e[4]=m*o+h*l,e[5]=m*l-h*o,e},scale:function(e,t,n){var i=n[0],a=n[1];return e[0]=t[0]*i,e[1]=t[1]*a,e[2]=t[2]*i,e[3]=t[3]*a,e[4]=t[4]*i,e[5]=t[5]*a,e},invert:function(e,t){var n=t[0],i=t[2],a=t[4],o=t[1],r=t[3],s=t[5],l=n*r-o*i;return l?(l=1/l,e[0]=r*l,e[1]=-o*l,e[2]=-i*l,e[3]=n*l,e[4]=(i*s-r*a)*l,e[5]=(o*a-n*s)*l,e):null},mulVector:function(e,t,n){var i=t[0],a=t[2],o=t[4],r=t[1],s=t[3],l=t[5];return e[0]=n[0]*i+n[1]*a+o,e[1]=n[0]*r+n[1]*s+l,e}};return t}),n("zrender/loadingEffect/Base",["require","../tool/util","../shape/Text","../shape/Rectangle"],function(e){function t(e){this.setOptions(e)}var n=e("../tool/util"),i=e("../shape/Text"),a=e("../shape/Rectangle"),o="Loading...",r="normal 16px Arial";return t.prototype.createTextShape=function(e){return new i({highlightStyle:n.merge({x:this.canvasWidth/2,y:this.canvasHeight/2,text:o,textAlign:"center",textBaseline:"middle",textFont:r,color:"#333",brushType:"fill"},e,!0)})},t.prototype.createBackgroundShape=function(e){return new a({highlightStyle:{x:0,y:0,width:this.canvasWidth,height:this.canvasHeight,brushType:"fill",color:e}})},t.prototype.start=function(e){function t(t){e.storage.addHover(t)}function n(){e.refreshHover()}this.canvasWidth=e._width,this.canvasHeight=e._height,this.loadingTimer=this._start(t,n)},t.prototype._start=function(){return setInterval(function(){},1e4)},t.prototype.stop=function(){clearInterval(this.loadingTimer)},t.prototype.setOptions=function(e){this.options=e||{}},t.prototype.adjust=function(e,t){return e<=t[0]?e=t[0]:e>=t[1]&&(e=t[1]),e},t.prototype.getLocation=function(e,t,n){var i=null!=e.x?e.x:"center";switch(i){case"center":i=Math.floor((this.canvasWidth-t)/2);break;case"left":i=0;break;case"right":i=this.canvasWidth-t}var a=null!=e.y?e.y:"center";switch(a){case"center":a=Math.floor((this.canvasHeight-n)/2);break;case"top":a=0;break;case"bottom":a=this.canvasHeight-n}return{x:i,y:a,width:t,height:n}},t}),n("zrender/Layer",["require","./mixin/Transformable","./tool/util","./config"],function(e){function t(){return!1}function n(e,t,n){var i=document.createElement(t),a=n.getWidth(),o=n.getHeight();return i.style.position="absolute",i.style.left=0,i.style.top=0,i.style.width=a+"px",i.style.height=o+"px",i.width=a*r.devicePixelRatio,i.height=o*r.devicePixelRatio,i.setAttribute("data-zr-dom-id",e),i}var i=e("./mixin/Transformable"),a=e("./tool/util"),o=window.G_vmlCanvasManager,r=e("./config"),s=function(e,a){this.id=e,this.dom=n(e,"canvas",a),this.dom.onselectstart=t,this.dom.style["-webkit-user-select"]="none",this.dom.style["user-select"]="none",this.dom.style["-webkit-touch-callout"]="none",this.dom.style["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",o&&o.initElement(this.dom),this.domBack=null,this.ctxBack=null,this.painter=a,this.unusedCount=0,this.config=null,this.dirty=!0,this.elCount=0,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.zoomable=!1,this.panable=!1,this.maxZoom=1/0,this.minZoom=0,i.call(this)};return s.prototype.initContext=function(){this.ctx=this.dom.getContext("2d");var e=r.devicePixelRatio;1!=e&&this.ctx.scale(e,e)},s.prototype.createBackBuffer=function(){if(!o){this.domBack=n("back-"+this.id,"canvas",this.painter),this.ctxBack=this.domBack.getContext("2d");var e=r.devicePixelRatio;1!=e&&this.ctxBack.scale(e,e)}},s.prototype.resize=function(e,t){var n=r.devicePixelRatio;this.dom.style.width=e+"px",this.dom.style.height=t+"px",this.dom.setAttribute("width",e*n),this.dom.setAttribute("height",t*n),1!=n&&this.ctx.scale(n,n),this.domBack&&(this.domBack.setAttribute("width",e*n),this.domBack.setAttribute("height",t*n),1!=n&&this.ctxBack.scale(n,n))},s.prototype.clear=function(){var e=this.dom,t=this.ctx,n=e.width,i=e.height,a=this.clearColor&&!o,s=this.motionBlur&&!o,l=this.lastFrameAlpha,h=r.devicePixelRatio;if(s&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(e,0,0,n/h,i/h)),t.clearRect(0,0,n/h,i/h),a&&(t.save(),t.fillStyle=this.clearColor,t.fillRect(0,0,n/h,i/h),t.restore()),s){var m=this.domBack;t.save(),t.globalAlpha=l,t.drawImage(m,0,0,n/h,i/h),t.restore()}},a.merge(s.prototype,i.prototype),s}),n("zrender/shape/Text",["require","../tool/area","./Base","../tool/util"],function(e){var t=e("../tool/area"),n=e("./Base"),i=function(e){n.call(this,e)};return i.prototype={type:"text",brush:function(e,n){var i=this.style;if(n&&(i=this.getHighlightStyle(i,this.highlightStyle||{})),"undefined"!=typeof i.text&&i.text!==!1){e.save(),this.doClip(e),this.setContext(e,i),this.setTransform(e),i.textFont&&(e.font=i.textFont),e.textAlign=i.textAlign||"start",e.textBaseline=i.textBaseline||"middle";var a,o=(i.text+"").split("\n"),r=t.getTextHeight("国",i.textFont),s=this.getRect(i),l=i.x;a="top"==i.textBaseline?s.y:"bottom"==i.textBaseline?s.y+r:s.y+r/2;for(var h=0,m=o.length;m>h;h++){if(i.maxWidth)switch(i.brushType){case"fill":e.fillText(o[h],l,a,i.maxWidth);break;case"stroke":e.strokeText(o[h],l,a,i.maxWidth);break;case"both":e.fillText(o[h],l,a,i.maxWidth),e.strokeText(o[h],l,a,i.maxWidth);break;default:e.fillText(o[h],l,a,i.maxWidth)}else switch(i.brushType){case"fill":e.fillText(o[h],l,a);break;case"stroke":e.strokeText(o[h],l,a);break;case"both":e.fillText(o[h],l,a),e.strokeText(o[h],l,a);break;default:e.fillText(o[h],l,a)}a+=r}e.restore()}},getRect:function(e){if(e.__rect)return e.__rect;var n=t.getTextWidth(e.text,e.textFont),i=t.getTextHeight(e.text,e.textFont),a=e.x;"end"==e.textAlign||"right"==e.textAlign?a-=n:"center"==e.textAlign&&(a-=n/2);var o;return o="top"==e.textBaseline?e.y:"bottom"==e.textBaseline?e.y-i:e.y-i/2,e.__rect={x:a,y:o,width:n,height:i},e.__rect
-}},e("../tool/util").inherits(i,n),i}),n("zrender/shape/Rectangle",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"rectangle",_buildRadiusPath:function(e,t){var n,i,a,o,r=t.x,s=t.y,l=t.width,h=t.height,m=t.radius;"number"==typeof m?n=i=a=o=m:m instanceof Array?1===m.length?n=i=a=o=m[0]:2===m.length?(n=a=m[0],i=o=m[1]):3===m.length?(n=m[0],i=o=m[1],a=m[2]):(n=m[0],i=m[1],a=m[2],o=m[3]):n=i=a=o=0;var V;n+i>l&&(V=n+i,n*=l/V,i*=l/V),a+o>l&&(V=a+o,a*=l/V,o*=l/V),i+a>h&&(V=i+a,i*=h/V,a*=h/V),n+o>h&&(V=n+o,n*=h/V,o*=h/V),e.moveTo(r+n,s),e.lineTo(r+l-i,s),0!==i&&e.quadraticCurveTo(r+l,s,r+l,s+i),e.lineTo(r+l,s+h-a),0!==a&&e.quadraticCurveTo(r+l,s+h,r+l-a,s+h),e.lineTo(r+o,s+h),0!==o&&e.quadraticCurveTo(r,s+h,r,s+h-o),e.lineTo(r,s+n),0!==n&&e.quadraticCurveTo(r,s,r+n,s)},buildPath:function(e,t){t.radius?this._buildRadiusPath(e,t):(e.moveTo(t.x,t.y),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x,t.y)),e.closePath()},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-t/2),y:Math.round(e.y-t/2),width:e.width+t,height:e.height+t},e.__rect}},e("../tool/util").inherits(n,t),n}),n("zrender/tool/area",["require","./util","./curve"],function(e){"use strict";function t(e){return e%=C,0>e&&(e+=C),e}function n(e,t,n,o){if(!t||!e)return!1;var r=e.type;L=L||W.getContext();var s=i(e,t,n,o);if("undefined"!=typeof s)return s;if(e.buildPath&&L.isPointInPath)return a(e,L,t,n,o);switch(r){case"ellipse":return!0;case"trochoid":var l="out"==t.location?t.r1+t.r2+t.d:t.r1-t.r2+t.d;return d(t,n,o,l);case"rose":return d(t,n,o,t.maxr);default:return!1}}function i(e,t,n,i){var a=e.type;switch(a){case"bezier-curve":return"undefined"==typeof t.cpX2?l(t.xStart,t.yStart,t.cpX1,t.cpY1,t.xEnd,t.yEnd,t.lineWidth,n,i):s(t.xStart,t.yStart,t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd,t.lineWidth,n,i);case"line":return r(t.xStart,t.yStart,t.xEnd,t.yEnd,t.lineWidth,n,i);case"polyline":return m(t.pointList,t.lineWidth,n,i);case"ring":return V(t.x,t.y,t.r0,t.r,n,i);case"circle":return d(t.x,t.y,t.r,n,i);case"sector":var o=t.startAngle*Math.PI/180,h=t.endAngle*Math.PI/180;return t.clockWise||(o=-o,h=-h),p(t.x,t.y,t.r0,t.r,o,h,!t.clockWise,n,i);case"path":return t.pathArray&&k(t.pathArray,Math.max(t.lineWidth,5),t.brushType,n,i);case"polygon":case"star":case"isogon":return c(t.pointList,n,i);case"text":var u=t.__rect||e.getRect(t);return U(u.x,u.y,u.width,u.height,n,i);case"rectangle":case"image":return U(t.x,t.y,t.width,t.height,n,i)}}function a(e,t,n,i,a){return t.beginPath(),e.buildPath(t,n),t.closePath(),t.isPointInPath(i,a)}function o(e,t,i,a){return!n(e,t,i,a)}function r(e,t,n,i,a,o,r){if(0===a)return!1;var s=Math.max(a,5),l=0,h=e;if(r>t+s&&r>i+s||t-s>r&&i-s>r||o>e+s&&o>n+s||e-s>o&&n-s>o)return!1;if(e===n)return Math.abs(o-e)<=s/2;l=(t-i)/(e-n),h=(e*i-n*t)/(e-n);var m=l*o-r+h,V=m*m/(l*l+1);return s/2*s/2>=V}function s(e,t,n,i,a,o,r,s,l,h,m){if(0===l)return!1;var V=Math.max(l,5);if(m>t+V&&m>i+V&&m>o+V&&m>s+V||t-V>m&&i-V>m&&o-V>m&&s-V>m||h>e+V&&h>n+V&&h>a+V&&h>r+V||e-V>h&&n-V>h&&a-V>h&&r-V>h)return!1;var U=X.cubicProjectPoint(e,t,n,i,a,o,r,s,h,m,null);return V/2>=U}function l(e,t,n,i,a,o,r,s,l){if(0===r)return!1;var h=Math.max(r,5);if(l>t+h&&l>i+h&&l>o+h||t-h>l&&i-h>l&&o-h>l||s>e+h&&s>n+h&&s>a+h||e-h>s&&n-h>s&&a-h>s)return!1;var m=X.quadraticProjectPoint(e,t,n,i,a,o,s,l,null);return h/2>=m}function h(e,n,i,a,o,r,s,l,h){if(0===s)return!1;var m=Math.max(s,5);l-=e,h-=n;var V=Math.sqrt(l*l+h*h);if(V-m>i||i>V+m)return!1;if(Math.abs(a-o)>=C)return!0;if(r){var U=a;a=t(o),o=t(U)}else a=t(a),o=t(o);a>o&&(o+=C);var d=Math.atan2(h,l);return 0>d&&(d+=C),d>=a&&o>=d||d+C>=a&&o>=d+C}function m(e,t,n,i){for(var t=Math.max(t,10),a=0,o=e.length-1;o>a;a++){var s=e[a][0],l=e[a][1],h=e[a+1][0],m=e[a+1][1];if(r(s,l,h,m,t,n,i))return!0}return!1}function V(e,t,n,i,a,o){var r=(a-e)*(a-e)+(o-t)*(o-t);return i*i>r&&r>n*n}function U(e,t,n,i,a,o){return a>=e&&e+n>=a&&o>=t&&t+i>=o}function d(e,t,n,i,a){return n*n>(i-e)*(i-e)+(a-t)*(a-t)}function p(e,t,n,i,a,o,r,s,l){return h(e,t,(n+i)/2,a,o,r,i-n,s,l)}function c(e,t,n){for(var i=e.length,a=0,o=0,r=i-1;i>o;o++){var s=e[r][0],l=e[r][1],h=e[o][0],m=e[o][1];a+=u(s,l,h,m,t,n),r=o}return 0!==a}function u(e,t,n,i,a,o){if(o>t&&o>i||t>o&&i>o)return 0;if(i==t)return 0;var r=t>i?1:-1,s=(o-t)/(i-t),l=s*(n-e)+e;return l>a?r:0}function y(){var e=E[0];E[0]=E[1],E[1]=e}function g(e,t,n,i,a,o,r,s,l,h){if(h>t&&h>i&&h>o&&h>s||t>h&&i>h&&o>h&&s>h)return 0;var m=X.cubicRootAt(t,i,o,s,h,S);if(0===m)return 0;for(var V,U,d=0,p=-1,c=0;m>c;c++){var u=S[c],g=X.cubicAt(e,n,a,r,u);l>g||(0>p&&(p=X.cubicExtrema(t,i,o,s,E),E[1]<E[0]&&p>1&&y(),V=X.cubicAt(t,i,o,s,E[0]),p>1&&(U=X.cubicAt(t,i,o,s,E[1]))),d+=2==p?u<E[0]?t>V?1:-1:u<E[1]?V>U?1:-1:U>s?1:-1:u<E[0]?t>V?1:-1:V>s?1:-1)}return d}function b(e,t,n,i,a,o,r,s){if(s>t&&s>i&&s>o||t>s&&i>s&&o>s)return 0;var l=X.quadraticRootAt(t,i,o,s,S);if(0===l)return 0;var h=X.quadraticExtremum(t,i,o);if(h>=0&&1>=h){for(var m=0,V=X.quadraticAt(t,i,o,h),U=0;l>U;U++){var d=X.quadraticAt(e,n,a,S[U]);d>r||(m+=S[U]<h?t>V?1:-1:V>o?1:-1)}return m}var d=X.quadraticAt(e,n,a,S[0]);return d>r?0:t>o?1:-1}function f(e,n,i,a,o,r,s,l){if(l-=n,l>i||-i>l)return 0;var h=Math.sqrt(i*i-l*l);if(S[0]=-h,S[1]=h,Math.abs(a-o)>=C){a=0,o=C;var m=r?1:-1;return s>=S[0]+e&&s<=S[1]+e?m:0}if(r){var h=a;a=t(o),o=t(h)}else a=t(a),o=t(o);a>o&&(o+=C);for(var V=0,U=0;2>U;U++){var d=S[U];if(d+e>s){var p=Math.atan2(l,d),m=r?1:-1;0>p&&(p=C+p),(p>=a&&o>=p||p+C>=a&&o>=p+C)&&(p>Math.PI/2&&p<1.5*Math.PI&&(m=-m),V+=m)}}return V}function k(e,t,n,i,a){var o=0,m=0,V=0,U=0,d=0,p=!0,c=!0;n=n||"fill";for(var y="stroke"===n||"both"===n,k="fill"===n||"both"===n,x=0;x<e.length;x++){var _=e[x],L=_.points;if(p||"M"===_.command){if(x>0&&(k&&(o+=u(m,V,U,d,i,a)),0!==o))return!0;U=L[L.length-2],d=L[L.length-1],p=!1,c&&"A"!==_.command&&(c=!1,m=U,V=d)}switch(_.command){case"M":m=L[0],V=L[1];break;case"L":if(y&&r(m,V,L[0],L[1],t,i,a))return!0;k&&(o+=u(m,V,L[0],L[1],i,a)),m=L[0],V=L[1];break;case"C":if(y&&s(m,V,L[0],L[1],L[2],L[3],L[4],L[5],t,i,a))return!0;k&&(o+=g(m,V,L[0],L[1],L[2],L[3],L[4],L[5],i,a)),m=L[4],V=L[5];break;case"Q":if(y&&l(m,V,L[0],L[1],L[2],L[3],t,i,a))return!0;k&&(o+=b(m,V,L[0],L[1],L[2],L[3],i,a)),m=L[2],V=L[3];break;case"A":var W=L[0],X=L[1],K=L[2],w=L[3],I=L[4],v=L[5],J=Math.cos(I)*K+W,C=Math.sin(I)*w+X;c?(c=!1,U=J,d=C):o+=u(m,V,J,C);var S=(i-W)*w/K+W;if(y&&h(W,X,w,I,I+v,1-L[7],t,S,a))return!0;k&&(o+=f(W,X,w,I,I+v,1-L[7],S,a)),m=Math.cos(I+v)*K+W,V=Math.sin(I+v)*w+X;break;case"z":if(y&&r(m,V,U,d,t,i,a))return!0;p=!0}}return k&&(o+=u(m,V,U,d,i,a)),0!==o}function x(e,t){var n=e+":"+t;if(K[n])return K[n];L=L||W.getContext(),L.save(),t&&(L.font=t),e=(e+"").split("\n");for(var i=0,a=0,o=e.length;o>a;a++)i=Math.max(L.measureText(e[a]).width,i);return L.restore(),K[n]=i,++I>J&&(I=0,K={}),i}function _(e,t){var n=e+":"+t;if(w[n])return w[n];L=L||W.getContext(),L.save(),t&&(L.font=t),e=(e+"").split("\n");var i=(L.measureText("国").width+2)*e.length;return L.restore(),w[n]=i,++v>J&&(v=0,w={}),i}var L,W=e("./util"),X=e("./curve"),K={},w={},I=0,v=0,J=5e3,C=2*Math.PI,S=[-1,-1,-1],E=[-1,-1];return{isInside:n,isOutside:o,getTextWidth:x,getTextHeight:_,isInsidePath:k,isInsidePolygon:c,isInsideSector:p,isInsideCircle:d,isInsideLine:r,isInsideRect:U,isInsidePolyline:m,isInsideCubicStroke:s,isInsideQuadraticStroke:l}}),n("zrender/shape/Base",["require","../tool/matrix","../tool/guid","../tool/util","../tool/log","../mixin/Transformable","../mixin/Eventful","../tool/area","../tool/color"],function(e){function t(t,i,a,o,r,s,l){r&&(t.font=r),t.textAlign=s,t.textBaseline=l;var h=n(i,a,o,r,s,l);i=(i+"").split("\n");var m=e("../tool/area").getTextHeight("国",r);switch(l){case"top":o=h.y;break;case"bottom":o=h.y+m;break;default:o=h.y+m/2}for(var V=0,U=i.length;U>V;V++)t.fillText(i[V],a,o),o+=m}function n(t,n,i,a,o,r){var s=e("../tool/area"),l=s.getTextWidth(t,a),h=s.getTextHeight("国",a);switch(t=(t+"").split("\n"),o){case"end":case"right":n-=l;break;case"center":n-=l/2}switch(r){case"top":break;case"bottom":i-=h*t.length;break;default:i-=h*t.length/2}return{x:n,y:i,width:l,height:h*t.length}}var i=window.G_vmlCanvasManager,a=e("../tool/matrix"),o=e("../tool/guid"),r=e("../tool/util"),s=e("../tool/log"),l=e("../mixin/Transformable"),h=e("../mixin/Eventful"),m=function(e){e=e||{},this.id=e.id||o();for(var t in e)this[t]=e[t];this.style=this.style||{},this.highlightStyle=this.highlightStyle||null,this.parent=null,this.__dirty=!0,this.__clipShapes=[],l.call(this),h.call(this)};m.prototype.invisible=!1,m.prototype.ignore=!1,m.prototype.zlevel=0,m.prototype.draggable=!1,m.prototype.clickable=!1,m.prototype.hoverable=!0,m.prototype.z=0,m.prototype.brush=function(e,t){var n=this.beforeBrush(e,t);switch(e.beginPath(),this.buildPath(e,n),n.brushType){case"both":e.fill();case"stroke":n.lineWidth>0&&e.stroke();break;default:e.fill()}this.drawText(e,n,this.style),this.afterBrush(e)},m.prototype.beforeBrush=function(e,t){var n=this.style;return this.brushTypeOnly&&(n.brushType=this.brushTypeOnly),t&&(n=this.getHighlightStyle(n,this.highlightStyle||{},this.brushTypeOnly)),"stroke"==this.brushTypeOnly&&(n.strokeColor=n.strokeColor||n.color),e.save(),this.doClip(e),this.setContext(e,n),this.setTransform(e),n},m.prototype.afterBrush=function(e){e.restore()};var V=[["color","fillStyle"],["strokeColor","strokeStyle"],["opacity","globalAlpha"],["lineCap","lineCap"],["lineJoin","lineJoin"],["miterLimit","miterLimit"],["lineWidth","lineWidth"],["shadowBlur","shadowBlur"],["shadowColor","shadowColor"],["shadowOffsetX","shadowOffsetX"],["shadowOffsetY","shadowOffsetY"]];m.prototype.setContext=function(e,t){for(var n=0,i=V.length;i>n;n++){var a=V[n][0],o=t[a],r=V[n][1];"undefined"!=typeof o&&(e[r]=o)}};var U=a.create();return m.prototype.doClip=function(e){if(this.__clipShapes&&!i)for(var t=0;t<this.__clipShapes.length;t++){var n=this.__clipShapes[t];if(n.needTransform){var o=n.transform;a.invert(U,o),e.transform(o[0],o[1],o[2],o[3],o[4],o[5])}if(e.beginPath(),n.buildPath(e,n.style),e.clip(),n.needTransform){var o=U;e.transform(o[0],o[1],o[2],o[3],o[4],o[5])}}},m.prototype.getHighlightStyle=function(t,n,i){var a={};for(var o in t)a[o]=t[o];var r=e("../tool/color"),s=r.getHighlightColor();"stroke"!=t.brushType?(a.strokeColor=s,a.lineWidth=(t.lineWidth||1)+this.getHighlightZoom(),a.brushType="both"):"stroke"!=i?(a.strokeColor=s,a.lineWidth=(t.lineWidth||1)+this.getHighlightZoom()):a.strokeColor=n.strokeColor||r.mix(t.strokeColor,r.toRGB(s));for(var o in n)"undefined"!=typeof n[o]&&(a[o]=n[o]);return a},m.prototype.getHighlightZoom=function(){return"text"!=this.type?6:2},m.prototype.drift=function(e,t){this.position[0]+=e,this.position[1]+=t},m.prototype.getTansform=function(){var e=[];return function(t,n){var i=[t,n];return this.needTransform&&this.transform&&(a.invert(e,this.transform),a.mulVector(i,e,[t,n,1]),t==i[0]&&n==i[1]&&this.updateNeedTransform()),i}}(),m.prototype.buildPath=function(){s("buildPath not implemented in "+this.type)},m.prototype.getRect=function(){s("getRect not implemented in "+this.type)},m.prototype.isCover=function(t,n){var i=this.getTansform(t,n);t=i[0],n=i[1];var a=this.style.__rect;return a||(a=this.style.__rect=this.getRect(this.style)),t>=a.x&&t<=a.x+a.width&&n>=a.y&&n<=a.y+a.height?e("../tool/area").isInside(this,this.style,t,n):!1},m.prototype.drawText=function(e,n,i){if("undefined"!=typeof n.text&&n.text!==!1){var a=n.textColor||n.color||n.strokeColor;e.fillStyle=a;var o,r,s,l,h=10,m=n.textPosition||this.textPosition||"top";switch(m){case"inside":case"top":case"bottom":case"left":case"right":if(this.getRect){var V=(i||n).__rect||this.getRect(i||n);switch(m){case"inside":s=V.x+V.width/2,l=V.y+V.height/2,o="center",r="middle","stroke"!=n.brushType&&a==n.color&&(e.fillStyle="#fff");break;case"left":s=V.x-h,l=V.y+V.height/2,o="end",r="middle";break;case"right":s=V.x+V.width+h,l=V.y+V.height/2,o="start",r="middle";break;case"top":s=V.x+V.width/2,l=V.y-h,o="center",r="bottom";break;case"bottom":s=V.x+V.width/2,l=V.y+V.height+h,o="center",r="top"}}break;case"start":case"end":var U=n.pointList||[[n.xStart||0,n.yStart||0],[n.xEnd||0,n.yEnd||0]],d=U.length;if(2>d)return;var p,c,u,y;switch(m){case"start":p=U[1][0],c=U[0][0],u=U[1][1],y=U[0][1];break;case"end":p=U[d-2][0],c=U[d-1][0],u=U[d-2][1],y=U[d-1][1]}s=c,l=y;var g=Math.atan((u-y)/(c-p))/Math.PI*180;0>c-p?g+=180:0>u-y&&(g+=360),h=5,g>=30&&150>=g?(o="center",r="bottom",l-=h):g>150&&210>g?(o="right",r="middle",s-=h):g>=210&&330>=g?(o="center",r="top",l+=h):(o="left",r="middle",s+=h);break;case"specific":s=n.textX||0,l=n.textY||0,o="start",r="middle"}null!=s&&null!=l&&t(e,n.text,s,l,n.textFont,n.textAlign||o,n.textBaseline||r)}},m.prototype.modSelf=function(){this.__dirty=!0,this.style&&(this.style.__rect=null),this.highlightStyle&&(this.highlightStyle.__rect=null)},m.prototype.isSilent=function(){return!(this.hoverable||this.draggable||this.clickable||this.onmousemove||this.onmouseover||this.onmouseout||this.onmousedown||this.onmouseup||this.onclick||this.ondragenter||this.ondragover||this.ondragleave||this.ondrop)},r.merge(m.prototype,l.prototype,!0),r.merge(m.prototype,h.prototype,!0),m}),n("zrender/tool/curve",["require","./vector"],function(e){function t(e){return e>-c&&c>e}function n(e){return e>c||-c>e}function i(e,t,n,i,a){var o=1-a;return o*o*(o*e+3*a*t)+a*a*(a*i+3*o*n)}function a(e,t,n,i,a){var o=1-a;return 3*(((t-e)*o+2*(n-t)*a)*o+(i-n)*a*a)}function o(e,n,i,a,o,r){var s=a+3*(n-i)-e,l=3*(i-2*n+e),h=3*(n-e),m=e-o,V=l*l-3*s*h,U=l*h-9*s*m,d=h*h-3*l*m,p=0;if(t(V)&&t(U))if(t(l))r[0]=0;else{var c=-h/l;c>=0&&1>=c&&(r[p++]=c)}else{var g=U*U-4*V*d;if(t(g)){var b=U/V,c=-l/s+b,f=-b/2;c>=0&&1>=c&&(r[p++]=c),f>=0&&1>=f&&(r[p++]=f)}else if(g>0){var k=Math.sqrt(g),x=V*l+1.5*s*(-U+k),_=V*l+1.5*s*(-U-k);x=0>x?-Math.pow(-x,y):Math.pow(x,y),_=0>_?-Math.pow(-_,y):Math.pow(_,y);var c=(-l-(x+_))/(3*s);c>=0&&1>=c&&(r[p++]=c)}else{var L=(2*V*l-3*s*U)/(2*Math.sqrt(V*V*V)),W=Math.acos(L)/3,X=Math.sqrt(V),K=Math.cos(W),c=(-l-2*X*K)/(3*s),f=(-l+X*(K+u*Math.sin(W)))/(3*s),w=(-l+X*(K-u*Math.sin(W)))/(3*s);c>=0&&1>=c&&(r[p++]=c),f>=0&&1>=f&&(r[p++]=f),w>=0&&1>=w&&(r[p++]=w)}}return p}function r(e,i,a,o,r){var s=6*a-12*i+6*e,l=9*i+3*o-3*e-9*a,h=3*i-3*e,m=0;if(t(l)){if(n(s)){var V=-h/s;V>=0&&1>=V&&(r[m++]=V)}}else{var U=s*s-4*l*h;if(t(U))r[0]=-s/(2*l);else if(U>0){var d=Math.sqrt(U),V=(-s+d)/(2*l),p=(-s-d)/(2*l);V>=0&&1>=V&&(r[m++]=V),p>=0&&1>=p&&(r[m++]=p)}}return m}function s(e,t,n,i,a,o){var r=(t-e)*a+e,s=(n-t)*a+t,l=(i-n)*a+n,h=(s-r)*a+r,m=(l-s)*a+s,V=(m-h)*a+h;o[0]=e,o[1]=r,o[2]=h,o[3]=V,o[4]=V,o[5]=m,o[6]=l,o[7]=i}function l(e,t,n,a,o,r,s,l,h,m,V){var U,d=.005,u=1/0;g[0]=h,g[1]=m;for(var y=0;1>y;y+=.05){b[0]=i(e,n,o,s,y),b[1]=i(t,a,r,l,y);var k=p.distSquare(g,b);u>k&&(U=y,u=k)}u=1/0;for(var x=0;32>x&&!(c>d);x++){var _=U-d,L=U+d;b[0]=i(e,n,o,s,_),b[1]=i(t,a,r,l,_);var k=p.distSquare(b,g);if(_>=0&&u>k)U=_,u=k;else{f[0]=i(e,n,o,s,L),f[1]=i(t,a,r,l,L);var W=p.distSquare(f,g);1>=L&&u>W?(U=L,u=W):d*=.5}}return V&&(V[0]=i(e,n,o,s,U),V[1]=i(t,a,r,l,U)),Math.sqrt(u)}function h(e,t,n,i){var a=1-i;return a*(a*e+2*i*t)+i*i*n}function m(e,t,n,i){return 2*((1-i)*(t-e)+i*(n-t))}function V(e,i,a,o,r){var s=e-2*i+a,l=2*(i-e),h=e-o,m=0;if(t(s)){if(n(l)){var V=-h/l;V>=0&&1>=V&&(r[m++]=V)}}else{var U=l*l-4*s*h;if(t(U)){var V=-l/(2*s);V>=0&&1>=V&&(r[m++]=V)}else if(U>0){var d=Math.sqrt(U),V=(-l+d)/(2*s),p=(-l-d)/(2*s);V>=0&&1>=V&&(r[m++]=V),p>=0&&1>=p&&(r[m++]=p)}}return m}function U(e,t,n){var i=e+n-2*t;return 0===i?.5:(e-t)/i}function d(e,t,n,i,a,o,r,s,l){var m,V=.005,U=1/0;g[0]=r,g[1]=s;for(var d=0;1>d;d+=.05){b[0]=h(e,n,a,d),b[1]=h(t,i,o,d);var u=p.distSquare(g,b);U>u&&(m=d,U=u)}U=1/0;for(var y=0;32>y&&!(c>V);y++){var k=m-V,x=m+V;b[0]=h(e,n,a,k),b[1]=h(t,i,o,k);var u=p.distSquare(b,g);if(k>=0&&U>u)m=k,U=u;else{f[0]=h(e,n,a,x),f[1]=h(t,i,o,x);var _=p.distSquare(f,g);1>=x&&U>_?(m=x,U=_):V*=.5}}return l&&(l[0]=h(e,n,a,m),l[1]=h(t,i,o,m)),Math.sqrt(U)}var p=e("./vector"),c=1e-4,u=Math.sqrt(3),y=1/3,g=p.create(),b=p.create(),f=p.create();return{cubicAt:i,cubicDerivativeAt:a,cubicRootAt:o,cubicExtrema:r,cubicSubdivide:s,cubicProjectPoint:l,quadraticAt:h,quadraticDerivativeAt:m,quadraticRootAt:V,quadraticExtremum:U,quadraticProjectPoint:d}}),n("zrender/mixin/Transformable",["require","../tool/matrix","../tool/vector"],function(e){"use strict";function t(e){return e>-r&&r>e}function n(e){return e>r||-r>e}var i=e("../tool/matrix"),a=e("../tool/vector"),o=[0,0],r=5e-5,s=function(){this.position||(this.position=[0,0]),"undefined"==typeof this.rotation&&(this.rotation=[0,0,0]),this.scale||(this.scale=[1,1,0,0]),this.needLocalTransform=!1,this.needTransform=!1};return s.prototype={constructor:s,updateNeedTransform:function(){this.needLocalTransform=n(this.rotation[0])||n(this.position[0])||n(this.position[1])||n(this.scale[0]-1)||n(this.scale[1]-1)},updateTransform:function(){if(this.updateNeedTransform(),this.needTransform=this.parent?this.needLocalTransform||this.parent.needTransform:this.needLocalTransform,this.needTransform){var e=this.transform||i.create();if(i.identity(e),this.needLocalTransform){if(n(this.scale[0])||n(this.scale[1])){o[0]=-this.scale[2]||0,o[1]=-this.scale[3]||0;var t=n(o[0])||n(o[1]);t&&i.translate(e,e,o),i.scale(e,e,this.scale),t&&(o[0]=-o[0],o[1]=-o[1],i.translate(e,e,o))}if(this.rotation instanceof Array){if(0!==this.rotation[0]){o[0]=-this.rotation[1]||0,o[1]=-this.rotation[2]||0;var t=n(o[0])||n(o[1]);t&&i.translate(e,e,o),i.rotate(e,e,this.rotation[0]),t&&(o[0]=-o[0],o[1]=-o[1],i.translate(e,e,o))}}else 0!==this.rotation&&i.rotate(e,e,this.rotation);(n(this.position[0])||n(this.position[1]))&&i.translate(e,e,this.position)}this.transform=e,this.parent&&this.parent.needTransform&&(this.needLocalTransform?i.mul(this.transform,this.parent.transform,this.transform):i.copy(this.transform,this.parent.transform))}},setTransform:function(e){if(this.needTransform){var t=this.transform;e.transform(t[0],t[1],t[2],t[3],t[4],t[5])}},lookAt:function(){var e=a.create();return function(n){this.transform||(this.transform=i.create());var o=this.transform;a.sub(e,n,this.position),t(e[0])&&t(e[1])||(a.normalize(e,e),o[2]=e[0]*this.scale[1],o[3]=e[1]*this.scale[1],o[0]=e[1]*this.scale[0],o[1]=-e[0]*this.scale[0],o[4]=this.position[0],o[5]=this.position[1],this.decomposeTransform())}}(),decomposeTransform:function(){if(this.transform){var e=this.transform,t=e[0]*e[0]+e[1]*e[1],i=this.position,a=this.scale,o=this.rotation;n(t-1)&&(t=Math.sqrt(t));var r=e[2]*e[2]+e[3]*e[3];n(r-1)&&(r=Math.sqrt(r)),i[0]=e[4],i[1]=e[5],a[0]=t,a[1]=r,a[2]=a[3]=0,o[0]=Math.atan2(-e[1]/r,e[0]/t),o[1]=o[2]=0}}},s}),n("zrender/Group",["require","./tool/guid","./tool/util","./mixin/Transformable","./mixin/Eventful"],function(e){var t=e("./tool/guid"),n=e("./tool/util"),i=e("./mixin/Transformable"),a=e("./mixin/Eventful"),o=function(e){e=e||{},this.id=e.id||t();for(var n in e)this[n]=e[n];this.type="group",this.clipShape=null,this._children=[],this._storage=null,this.__dirty=!0,i.call(this),a.call(this)};return o.prototype.ignore=!1,o.prototype.children=function(){return this._children.slice()},o.prototype.childAt=function(e){return this._children[e]},o.prototype.addChild=function(e){e!=this&&e.parent!=this&&(e.parent&&e.parent.removeChild(e),this._children.push(e),e.parent=this,this._storage&&this._storage!==e._storage&&(this._storage.addToMap(e),e instanceof o&&e.addChildrenToStorage(this._storage)))},o.prototype.removeChild=function(e){var t=n.indexOf(this._children,e);this._children.splice(t,1),e.parent=null,this._storage&&(this._storage.delFromMap(e.id),e instanceof o&&e.delChildrenFromStorage(this._storage))},o.prototype.clearChildren=function(){for(var e=0;e<this._children.length;e++){var t=this._children[e];this._storage&&(this._storage.delFromMap(t.id),t instanceof o&&t.delChildrenFromStorage(this._storage))}this._children.length=0},o.prototype.eachChild=function(e,t){for(var n=!!t,i=0;i<this._children.length;i++){var a=this._children[i];n?e.call(t,a):e(a)}},o.prototype.traverse=function(e,t){for(var n=!!t,i=0;i<this._children.length;i++){var a=this._children[i];n?e.call(t,a):e(a),"group"===a.type&&a.traverse(e,t)}},o.prototype.addChildrenToStorage=function(e){for(var t=0;t<this._children.length;t++){var n=this._children[t];e.addToMap(n),n instanceof o&&n.addChildrenToStorage(e)}},o.prototype.delChildrenFromStorage=function(e){for(var t=0;t<this._children.length;t++){var n=this._children[t];e.delFromMap(n.id),n instanceof o&&n.delChildrenFromStorage(e)}},o.prototype.modSelf=function(){this.__dirty=!0},n.merge(o.prototype,i.prototype,!0),n.merge(o.prototype,a.prototype,!0),o}),n("zrender/animation/Clip",["require","./easing"],function(e){function t(e){this._targetPool=e.target||{},this._targetPool instanceof Array||(this._targetPool=[this._targetPool]),this._life=e.life||1e3,this._delay=e.delay||0,this._startTime=(new Date).getTime()+this._delay,this._endTime=this._startTime+1e3*this._life,this.loop="undefined"==typeof e.loop?!1:e.loop,this.gap=e.gap||0,this.easing=e.easing||"Linear",this.onframe=e.onframe,this.ondestroy=e.ondestroy,this.onrestart=e.onrestart}var n=e("./easing");return t.prototype={step:function(e){var t=(e-this._startTime)/this._life;if(!(0>t)){t=Math.min(t,1);var i="string"==typeof this.easing?n[this.easing]:this.easing,a="function"==typeof i?i(t):t;return this.fire("frame",a),1==t?this.loop?(this.restart(),"restart"):(this._needsRemove=!0,"destroy"):null}},restart:function(){var e=(new Date).getTime(),t=(e-this._startTime)%this._life;this._startTime=(new Date).getTime()-t+this.gap,this._needsRemove=!1},fire:function(e,t){for(var n=0,i=this._targetPool.length;i>n;n++)this["on"+e]&&this["on"+e](this._targetPool[n],t)},constructor:t},t}),n("zrender/animation/easing",[],function(){var e={Linear:function(e){return e},QuadraticIn:function(e){return e*e},QuadraticOut:function(e){return e*(2-e)},QuadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},CubicIn:function(e){return e*e*e},CubicOut:function(e){return--e*e*e+1},CubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},QuarticIn:function(e){return e*e*e*e},QuarticOut:function(e){return 1- --e*e*e*e},QuarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},QuinticIn:function(e){return e*e*e*e*e},QuinticOut:function(e){return--e*e*e*e*e+1},QuinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},SinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},SinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},SinusoidalInOut:function(e){return.5*(1-Math.cos(Math.PI*e))},ExponentialIn:function(e){return 0===e?0:Math.pow(1024,e-1)},ExponentialOut:function(e){return 1===e?1:1-Math.pow(2,-10*e)},ExponentialInOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)},CircularIn:function(e){return 1-Math.sqrt(1-e*e)},CircularOut:function(e){return Math.sqrt(1- --e*e)},CircularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},ElasticIn:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||1>n?(n=1,t=i/4):t=i*Math.asin(1/n)/(2*Math.PI),-(n*Math.pow(2,10*(e-=1))*Math.sin(2*(e-t)*Math.PI/i)))},ElasticOut:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||1>n?(n=1,t=i/4):t=i*Math.asin(1/n)/(2*Math.PI),n*Math.pow(2,-10*e)*Math.sin(2*(e-t)*Math.PI/i)+1)},ElasticInOut:function(e){var t,n=.1,i=.4;return 0===e?0:1===e?1:(!n||1>n?(n=1,t=i/4):t=i*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-.5*n*Math.pow(2,10*(e-=1))*Math.sin(2*(e-t)*Math.PI/i):n*Math.pow(2,-10*(e-=1))*Math.sin(2*(e-t)*Math.PI/i)*.5+1)},BackIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},BackOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},BackInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*e*e*((t+1)*e-t):.5*((e-=2)*e*((t+1)*e+t)+2)},BounceIn:function(t){return 1-e.BounceOut(1-t)},BounceOut:function(e){return 1/2.75>e?7.5625*e*e:2/2.75>e?7.5625*(e-=1.5/2.75)*e+.75:2.5/2.75>e?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},BounceInOut:function(t){return.5>t?.5*e.BounceIn(2*t):.5*e.BounceOut(2*t-1)+.5}};return e}),n("echarts/chart/base",["require","zrender/shape/Image","../util/shape/Icon","../util/shape/MarkLine","../util/shape/Symbol","../config","../util/ecData","../util/ecAnimation","../util/ecEffect","../util/accMath","../component/base","zrender/tool/util","zrender/tool/area"],function(e){function t(e,t,n,i,a){V.call(this,e,t,n,i,a);var o=this;this.selectedMap={},this.lastShapeList=[],this.shapeHandler={onclick:function(){o.isClick=!0},ondragover:function(e){var t=e.target;t.highlightStyle=t.highlightStyle||{};var n=t.highlightStyle,i=n.brushTyep,a=n.strokeColor,s=n.lineWidth;n.brushType="stroke",n.strokeColor=o.ecTheme.calculableColor||r.calculableColor,n.lineWidth="icon"===t.type?30:10,o.zr.addHoverShape(t),setTimeout(function(){n&&(n.brushType=i,n.strokeColor=a,n.lineWidth=s)},20)},ondrop:function(e){null!=s.get(e.dragged,"data")&&(o.isDrop=!0)},ondragend:function(){o.isDragend=!0}}}var n=e("zrender/shape/Image"),i=e("../util/shape/Icon"),a=e("../util/shape/MarkLine"),o=e("../util/shape/Symbol"),r=e("../config"),s=e("../util/ecData"),l=e("../util/ecAnimation"),h=e("../util/ecEffect"),m=e("../util/accMath"),V=e("../component/base"),U=e("zrender/tool/util"),d=e("zrender/tool/area");return t.prototype={setCalculable:function(e){return e.dragEnableTime=this.ecTheme.DRAG_ENABLE_TIME||r.DRAG_ENABLE_TIME,e.ondragover=this.shapeHandler.ondragover,e.ondragend=this.shapeHandler.ondragend,e.ondrop=this.shapeHandler.ondrop,e},ondrop:function(e,t){if(this.isDrop&&e.target&&!t.dragIn){var n,i=e.target,a=e.dragged,o=s.get(i,"seriesIndex"),l=s.get(i,"dataIndex"),h=this.series,V=this.component.legend;if(-1===l){if(s.get(a,"seriesIndex")==o)return t.dragOut=t.dragIn=t.needRefresh=!0,void(this.isDrop=!1);n={value:s.get(a,"value"),name:s.get(a,"name")},this.type===r.CHART_TYPE_PIE&&n.value<0&&(n.value=0);for(var U=!1,d=h[o].data,p=0,c=d.length;c>p;p++)d[p].name===n.name&&"-"===d[p].value&&(h[o].data[p].value=n.value,U=!0);!U&&h[o].data.push(n),V&&V.add(n.name,a.style.color||a.style.strokeColor)}else n=h[o].data[l]||"-",null!=n.value?(h[o].data[l].value="-"!=n.value?m.accAdd(h[o].data[l].value,s.get(a,"value")):s.get(a,"value"),(this.type===r.CHART_TYPE_FUNNEL||this.type===r.CHART_TYPE_PIE)&&(V&&1===V.getRelatedAmount(n.name)&&this.component.legend.del(n.name),n.name+=this.option.nameConnector+s.get(a,"name"),V&&V.add(n.name,a.style.color||a.style.strokeColor))):h[o].data[l]="-"!=n?m.accAdd(h[o].data[l],s.get(a,"value")):s.get(a,"value");t.dragIn=t.dragIn||!0,this.isDrop=!1;var u=this;setTimeout(function(){u.zr.trigger("mousemove",e.event)},300)}},ondragend:function(e,t){if(this.isDragend&&e.target&&!t.dragOut){var n=e.target,i=s.get(n,"seriesIndex"),a=s.get(n,"dataIndex"),o=this.series;if(null!=o[i].data[a].value){o[i].data[a].value="-";var r=o[i].data[a].name,l=this.component.legend;l&&0===l.getRelatedAmount(r)&&l.del(r)}else o[i].data[a]="-";t.dragOut=!0,t.needRefresh=!0,this.isDragend=!1}},onlegendSelected:function(e,t){var n=e.selected;for(var i in this.selectedMap)this.selectedMap[i]!=n[i]&&(t.needRefresh=!0),this.selectedMap[i]=n[i]},_buildPosition:function(){this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this._sIndex2ColorMap={},this.selectedMap={},this.xMarkMap={};for(var e,t,n,i,a=this.series,o={top:[],bottom:[],left:[],right:[],other:[]},s=0,l=a.length;l>s;s++)a[s].type===this.type&&(a[s]=this.reformOption(a[s]),this.legendHoverLink=a[s].legendHoverLink||this.legendHoverLink,e=a[s].xAxisIndex,t=a[s].yAxisIndex,n=this.component.xAxis.getAxis(e),i=this.component.yAxis.getAxis(t),n.type===r.COMPONENT_TYPE_AXIS_CATEGORY?o[n.getPosition()].push(s):i.type===r.COMPONENT_TYPE_AXIS_CATEGORY?o[i.getPosition()].push(s):o.other.push(s));for(var h in o)o[h].length>0&&this._buildSinglePosition(h,o[h]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),i=n.locationMap,a=n.maxDataLength;if(0!==a&&0!==i.length){switch(e){case"bottom":case"top":this._buildHorizontal(t,a,i,this.xMarkMap);break;case"left":case"right":this._buildVertical(t,a,i,this.xMarkMap);break;case"other":this._buildOther(t,a,i,this.xMarkMap)}for(var o=0,r=t.length;r>o;o++)this.buildMark(t[o])}},_mapData:function(e){for(var t,n,i,a,o=this.series,s=0,l={},h="__kener__stack__",m=this.component.legend,V=[],U=0,d=0,p=e.length;p>d;d++){if(t=o[e[d]],i=t.name,this._sIndex2ShapeMap[e[d]]=this._sIndex2ShapeMap[e[d]]||this.query(t,"symbol")||this._symbol[d%this._symbol.length],m){if(this.selectedMap[i]=m.isSelected(i),this._sIndex2ColorMap[e[d]]=m.getColor(i),a=m.getItemShape(i)){var c=a.style;if(this.type==r.CHART_TYPE_LINE)c.iconType="legendLineIcon",c.symbol=this._sIndex2ShapeMap[e[d]];else if(t.itemStyle.normal.barBorderWidth>0){var u=a.highlightStyle;c.brushType="both",c.x+=1,c.y+=1,c.width-=2,c.height-=2,c.strokeColor=u.strokeColor=t.itemStyle.normal.barBorderColor,u.lineWidth=3}m.setItemShape(i,a)}}else this.selectedMap[i]=!0,this._sIndex2ColorMap[e[d]]=this.zr.getColor(e[d]);this.selectedMap[i]&&(n=t.stack||h+e[d],null==l[n]?(l[n]=s,V[s]=[e[d]],s++):V[l[n]].push(e[d])),U=Math.max(U,t.data.length)}return{locationMap:V,maxDataLength:U}},_calculMarkMapXY:function(e,t,n){for(var i=this.series,a=0,o=t.length;o>a;a++)for(var r=0,s=t[a].length;s>r;r++){var l=t[a][r],h="xy"==n?0:"",m=this.component.grid,V=e[l];if("-1"!=n.indexOf("x")){V["counter"+h]>0&&(V["average"+h]=V["sum"+h]/V["counter"+h]);var U=this.component.xAxis.getAxis(i[l].xAxisIndex||0).getCoord(V["average"+h]);V["averageLine"+h]=[[U,m.getYend()],[U,m.getY()]],V["minLine"+h]=[[V["minX"+h],m.getYend()],[V["minX"+h],m.getY()]],V["maxLine"+h]=[[V["maxX"+h],m.getYend()],[V["maxX"+h],m.getY()]],V.isHorizontal=!1}if(h="xy"==n?1:"","-1"!=n.indexOf("y")){V["counter"+h]>0&&(V["average"+h]=V["sum"+h]/V["counter"+h]);var d=this.component.yAxis.getAxis(i[l].yAxisIndex||0).getCoord(V["average"+h]);V["averageLine"+h]=[[m.getX(),d],[m.getXend(),d]],V["minLine"+h]=[[m.getX(),V["minY"+h]],[m.getXend(),V["minY"+h]]],V["maxLine"+h]=[[m.getX(),V["maxY"+h]],[m.getXend(),V["maxY"+h]]],V.isHorizontal=!0}}},addLabel:function(e,t,n,i,a){var o=[n,t],r=this.deepMerge(o,"itemStyle.normal.label"),s=this.deepMerge(o,"itemStyle.emphasis.label"),l=r.textStyle||{},h=s.textStyle||{};if(r.show){var m=e.style;m.text=this._getLabelText(t,n,i,"normal"),m.textPosition=null==r.position?"horizontal"===a?"right":"top":r.position,m.textColor=l.color,m.textFont=this.getFont(l),m.textAlign=l.align,m.textBaseline=l.baseline}if(s.show){var V=e.highlightStyle;V.text=this._getLabelText(t,n,i,"emphasis"),V.textPosition=r.show?e.style.textPosition:null==s.position?"horizontal"===a?"right":"top":s.position,V.textColor=h.color,V.textFont=this.getFont(h),V.textAlign=h.align,V.textBaseline=h.baseline}return e},_getLabelText:function(e,t,n,i){var a=this.deepQuery([t,e],"itemStyle."+i+".label.formatter");a||"emphasis"!==i||(a=this.deepQuery([t,e],"itemStyle.normal.label.formatter"));var o=this.getDataFromOption(t,"-");return a?"function"==typeof a?a.call(this.myChart,{seriesName:e.name,series:e,name:n,value:o,data:t,status:i}):"string"==typeof a?a=a.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{a0}",e.name).replace("{b0}",n).replace("{c0}",this.numAddCommas(o)):void 0:o instanceof Array?null!=o[2]?this.numAddCommas(o[2]):o[0]+" , "+o[1]:this.numAddCommas(o)},buildMark:function(e){var t=this.series[e];this.selectedMap[t.name]&&(t.markLine&&this._buildMarkLine(e),t.markPoint&&this._buildMarkPoint(e))},_buildMarkPoint:function(e){for(var t,n,i=(this.markAttachStyle||{})[e],a=this.series[e],o=U.clone(a.markPoint),s=0,l=o.data.length;l>s;s++)t=o.data[s],n=this.getMarkCoord(e,t),t.x=null!=t.x?t.x:n[0],t.y=null!=t.y?t.y:n[1],!t.type||"max"!==t.type&&"min"!==t.type||(t.value=n[3],t.name=t.name||t.type,t.symbolSize=t.symbolSize||d.getTextWidth(n[3],this.getFont())/2+5);
-for(var h=this._markPoint(e,o),s=0,l=h.length;l>s;s++){var m=h[s];m.zlevel=this.getZlevelBase(),m.z=this.getZBase()+1;for(var V in i)m[V]=U.clone(i[V]);this.shapeList.push(m)}if(this.type===r.CHART_TYPE_FORCE||this.type===r.CHART_TYPE_CHORD)for(var s=0,l=h.length;l>s;s++)this.zr.addShape(h[s])},_buildMarkLine:function(e){for(var t,n=(this.markAttachStyle||{})[e],i=this.series[e],a=U.clone(i.markLine),o=0,s=a.data.length;s>o;o++){var l=a.data[o];!l.type||"max"!==l.type&&"min"!==l.type&&"average"!==l.type?t=[this.getMarkCoord(e,l[0]),this.getMarkCoord(e,l[1])]:(t=this.getMarkCoord(e,l),a.data[o]=[U.clone(l),{}],a.data[o][0].name=l.name||l.type,a.data[o][0].value="average"!==l.type?t[3]:+t[3].toFixed(null!=a.precision?a.precision:this.deepQuery([this.ecTheme,r],"markLine.precision")),t=t[2],l=[{},{}]),null!=t&&null!=t[0]&&null!=t[1]&&(a.data[o][0].x=null!=l[0].x?l[0].x:t[0][0],a.data[o][0].y=null!=l[0].y?l[0].y:t[0][1],a.data[o][1].x=null!=l[1].x?l[1].x:t[1][0],a.data[o][1].y=null!=l[1].y?l[1].y:t[1][1])}for(var h=this._markLine(e,a),o=0,s=h.length;s>o;o++){var m=h[o];m.zlevel=this.getZlevelBase(),m.z=this.getZBase()+1;for(var V in n)m[V]=U.clone(n[V]);this.shapeList.push(m)}if(this.type===r.CHART_TYPE_FORCE||this.type===r.CHART_TYPE_CHORD)for(var o=0,s=h.length;s>o;o++)this.zr.addShape(h[o])},_markPoint:function(e,t){var n=this.series[e],i=this.component;U.merge(U.merge(t,U.clone(this.ecTheme.markPoint||{})),U.clone(r.markPoint)),t.name=n.name;var a,o,l,h,m,V,d,p=[],c=t.data,u=i.dataRange,y=i.legend,g=this.zr.getWidth(),b=this.zr.getHeight();if(t.large)a=this.getLargeMarkPoingShape(e,t),a._mark="largePoint",a&&p.push(a);else for(var f=0,k=c.length;k>f;f++)null!=c[f].x&&null!=c[f].y&&(l=null!=c[f].value?c[f].value:"",y&&(o=y.getColor(n.name)),u&&(o=isNaN(l)?o:u.getColor(l),h=[c[f],t],m=this.deepQuery(h,"itemStyle.normal.color")||o,V=this.deepQuery(h,"itemStyle.emphasis.color")||m,null==m&&null==V)||(o=null==o?this.zr.getColor(e):o,c[f].tooltip=c[f].tooltip||t.tooltip||{trigger:"item"},c[f].name=null!=c[f].name?c[f].name:"",c[f].value=l,a=this.getSymbolShape(t,e,c[f],f,c[f].name,this.parsePercent(c[f].x,g),this.parsePercent(c[f].y,b),"pin",o,"rgba(0,0,0,0)","horizontal"),a._mark="point",d=this.deepMerge([c[f],t],"effect"),d.show&&(a.effect=d),n.type===r.CHART_TYPE_MAP&&(a._geo=this.getMarkGeo(c[f])),s.pack(a,n,e,c[f],f,c[f].name,l),p.push(a)));return p},_markLine:function(e,t){var n=this.series[e],i=this.component;U.merge(U.merge(t,U.clone(this.ecTheme.markLine||{})),U.clone(r.markLine)),t.symbol=t.symbol instanceof Array?t.symbol.length>1?t.symbol:[t.symbol[0],t.symbol[0]]:[t.symbol,t.symbol],t.symbolSize=t.symbolSize instanceof Array?t.symbolSize.length>1?t.symbolSize:[t.symbolSize[0],t.symbolSize[0]]:[t.symbolSize,t.symbolSize],t.symbolRotate=t.symbolRotate instanceof Array?t.symbolRotate.length>1?t.symbolRotate:[t.symbolRotate[0],t.symbolRotate[0]]:[t.symbolRotate,t.symbolRotate],t.name=n.name;for(var a,o,l,h,m,V,d,p,c=[],u=t.data,y=i.dataRange,g=i.legend,b=this.zr.getWidth(),f=this.zr.getHeight(),k=0,x=u.length;x>k;k++){var _=u[k];null!=_[0].x&&null!=_[0].y&&null!=_[1].x&&null!=_[1].y&&(o=g?g.getColor(n.name):this.zr.getColor(e),p=this.deepMerge(_),l=null!=p.value?p.value:"",y&&(o=isNaN(l)?o:y.getColor(l),h=[p,t],m=this.deepQuery(h,"itemStyle.normal.color")||o,V=this.deepQuery(h,"itemStyle.emphasis.color")||m,null==m&&null==V)||(_[0].tooltip=p.tooltip||t.tooltip||{trigger:"item"},_[0].name=null!=_[0].name?_[0].name:"",_[1].name=null!=_[1].name?_[1].name:"",_[0].value=l,a=this.getLineMarkShape(t,e,_,k,this.parsePercent(_[0].x,b),this.parsePercent(_[0].y,f),this.parsePercent(_[1].x,b),this.parsePercent(_[1].y,f),o),a._mark="line",d=this.deepMerge([p,t],"effect"),d.show&&(a.effect=d),n.type===r.CHART_TYPE_MAP&&(a._geo=[this.getMarkGeo(_[0]),this.getMarkGeo(_[1])]),s.pack(a,n,e,_[0],k,_[0].name+(""!==_[1].name?" > "+_[1].name:""),l),c.push(a)))}return c},getMarkCoord:function(){return[0,0]},getSymbolShape:function(e,t,a,o,r,l,h,m,V,U,d){var p=[a,e],c=this.getDataFromOption(a,"-");m=this.deepQuery(p,"symbol")||m;var u=this.deepQuery(p,"symbolSize");u="function"==typeof u?u(c):u;var y=this.deepQuery(p,"symbolRotate"),g=this.deepMerge(p,"itemStyle.normal"),b=this.deepMerge(p,"itemStyle.emphasis"),f=null!=g.borderWidth?g.borderWidth:g.lineStyle&&g.lineStyle.width;null==f&&(f=m.match("empty")?2:0);var k=null!=b.borderWidth?b.borderWidth:b.lineStyle&&b.lineStyle.width;null==k&&(k=f+2);var x=new i({style:{iconType:m.replace("empty","").toLowerCase(),x:l-u,y:h-u,width:2*u,height:2*u,brushType:"both",color:m.match("empty")?U:this.getItemStyleColor(g.color,t,o,a)||V,strokeColor:g.borderColor||this.getItemStyleColor(g.color,t,o,a)||V,lineWidth:f},highlightStyle:{color:m.match("empty")?U:this.getItemStyleColor(b.color,t,o,a),strokeColor:b.borderColor||g.borderColor||this.getItemStyleColor(g.color,t,o,a)||V,lineWidth:k},clickable:this.deepQuery(p,"clickable")});return m.match("image")&&(x.style.image=m.replace(new RegExp("^image:\\/\\/"),""),x=new n({style:x.style,highlightStyle:x.highlightStyle,clickable:this.deepQuery(p,"clickable")})),null!=y&&(x.rotation=[y*Math.PI/180,l,h]),m.match("star")&&(x.style.iconType="star",x.style.n=m.replace("empty","").replace("star","")-0||5),"none"===m&&(x.invisible=!0,x.hoverable=!1),x=this.addLabel(x,e,a,r,d),m.match("empty")&&(null==x.style.textColor&&(x.style.textColor=x.style.strokeColor),null==x.highlightStyle.textColor&&(x.highlightStyle.textColor=x.highlightStyle.strokeColor)),s.pack(x,e,t,a,o,r),x._x=l,x._y=h,x._dataIndex=o,x._seriesIndex=t,x},getLineMarkShape:function(e,t,n,i,o,r,s,l,h){var m=null!=n[0].value?n[0].value:"-",V=null!=n[1].value?n[1].value:"-",U=[this.query(n[0],"symbol")||e.symbol[0],this.query(n[1],"symbol")||e.symbol[1]],d=[this.query(n[0],"symbolSize")||e.symbolSize[0],this.query(n[1],"symbolSize")||e.symbolSize[1]];d[0]="function"==typeof d[0]?d[0](m):d[0],d[1]="function"==typeof d[1]?d[1](V):d[1];var p=[this.query(n[0],"symbolRotate")||e.symbolRotate[0],this.query(n[1],"symbolRotate")||e.symbolRotate[1]],c=[n[0],n[1],e],u=this.deepMerge(c,"itemStyle.normal");u.color=this.getItemStyleColor(u.color,t,i,n);var y=this.deepMerge(c,"itemStyle.emphasis");y.color=this.getItemStyleColor(y.color,t,i,n);var g=u.lineStyle,b=y.lineStyle,f=g.width;null==f&&(f=u.borderWidth);var k=b.width;null==k&&(k=null!=y.borderWidth?y.borderWidth:f+2);var x=new a({style:{smooth:this.deepQuery([n[0],n[1],e],"smooth")?"spline":!1,smoothRadian:this.deepQuery([n[0],n[1],e],"smoothRadian"),symbol:U,symbolSize:d,symbolRotate:p,xStart:o,yStart:r,xEnd:s,yEnd:l,brushType:"both",lineType:g.type,shadowColor:g.shadowColor||g.color||u.borderColor||u.color||h,shadowBlur:g.shadowBlur,shadowOffsetX:g.shadowOffsetX,shadowOffsetY:g.shadowOffsetY,color:u.color||h,strokeColor:g.color||u.borderColor||u.color||h,lineWidth:f,symbolBorderColor:u.borderColor||u.color||h,symbolBorder:u.borderWidth},highlightStyle:{shadowColor:b.shadowColor,shadowBlur:b.shadowBlur,shadowOffsetX:b.shadowOffsetX,shadowOffsetY:b.shadowOffsetY,color:y.color||u.color||h,strokeColor:b.color||g.color||y.borderColor||u.borderColor||y.color||u.color||h,lineWidth:k,symbolBorderColor:y.borderColor||u.borderColor||y.color||u.color||h,symbolBorder:null==y.borderWidth?u.borderWidth+2:y.borderWidth},clickable:this.deepQuery(c,"clickable")});return x=this.addLabel(x,e,n[0],n[0].name+" : "+n[1].name),x._x=s,x._y=l,x},getLargeMarkPoingShape:function(e,t){var n,i,a,r,s,l,h=this.series[e],m=this.component,V=t.data,U=m.dataRange,d=m.legend,p=[V[0],t];if(d&&(i=d.getColor(h.name)),!U||(a=null!=V[0].value?V[0].value:"",i=isNaN(a)?i:U.getColor(a),r=this.deepQuery(p,"itemStyle.normal.color")||i,s=this.deepQuery(p,"itemStyle.emphasis.color")||r,null!=r||null!=s)){i=this.deepMerge(p,"itemStyle.normal").color||i;var c=this.deepQuery(p,"symbol")||"circle";c=c.replace("empty","").replace(/\d/g,""),l=this.deepMerge([V[0],t],"effect");var u=window.devicePixelRatio||1;return n=new o({style:{pointList:V,color:i,strokeColor:i,shadowColor:l.shadowColor||i,shadowBlur:(null!=l.shadowBlur?l.shadowBlur:8)*u,size:this.deepQuery(p,"symbolSize"),iconType:c,brushType:"fill",lineWidth:1},draggable:!1,hoverable:!1}),l.show&&(n.effect=l),n}},backupShapeList:function(){this.shapeList&&this.shapeList.length>0?(this.lastShapeList=this.shapeList,this.shapeList=[]):this.lastShapeList=[]},addShapeList:function(){var e,t,n=this.option.animationThreshold/(this.canvasSupported?2:4),i=this.lastShapeList,a=this.shapeList,o=i.length>0,s=o?this.query(this.option,"animationDurationUpdate"):this.query(this.option,"animationDuration"),l=this.query(this.option,"animationEasing"),h={},m={};if(this.option.animation&&!this.option.renderAsImage&&a.length<n&&!this.motionlessOnce){for(var V=0,U=i.length;U>V;V++)t=this._getAnimationKey(i[V]),t.match("undefined")?this.zr.delShape(i[V].id):(t+=i[V].type,h[t]?this.zr.delShape(i[V].id):h[t]=i[V]);for(var V=0,U=a.length;U>V;V++)t=this._getAnimationKey(a[V]),t.match("undefined")?this.zr.addShape(a[V]):(t+=a[V].type,m[t]=a[V]);for(t in h)m[t]||this.zr.delShape(h[t].id);for(t in m)h[t]?(this.zr.delShape(h[t].id),this._animateMod(h[t],m[t],s,l,0,o)):(e=this.type!=r.CHART_TYPE_LINE&&this.type!=r.CHART_TYPE_RADAR||0===t.indexOf("icon")?0:s/2,this._animateMod(!1,m[t],s,l,e,o));this.zr.refresh(),this.animationEffect()}else{this.motionlessOnce=!1,this.zr.delShape(i);for(var V=0,U=a.length;U>V;V++)this.zr.addShape(a[V])}},_getAnimationKey:function(e){return this.type!=r.CHART_TYPE_MAP?s.get(e,"seriesIndex")+"_"+s.get(e,"dataIndex")+(e._mark?e._mark:"")+(this.type===r.CHART_TYPE_RADAR?s.get(e,"special"):""):s.get(e,"seriesIndex")+"_"+s.get(e,"dataIndex")+(e._mark?e._mark:"undefined")},_animateMod:function(e,t,n,i,a,o){switch(t.type){case"polyline":case"half-smooth-polygon":l.pointList(this.zr,e,t,n,i);break;case"rectangle":l.rectangle(this.zr,e,t,n,i);break;case"image":case"icon":l.icon(this.zr,e,t,n,i,a);break;case"candle":o?this.zr.addShape(t):l.candle(this.zr,e,t,n,i);break;case"ring":case"sector":case"circle":o?"sector"===t.type?l.sector(this.zr,e,t,n,i):this.zr.addShape(t):l.ring(this.zr,e,t,n+(s.get(t,"dataIndex")||0)%20*100,i);break;case"text":l.text(this.zr,e,t,n,i);break;case"polygon":o?l.pointList(this.zr,e,t,n,i):l.polygon(this.zr,e,t,n,i);break;case"ribbon":l.ribbon(this.zr,e,t,n,i);break;case"gauge-pointer":l.gaugePointer(this.zr,e,t,n,i);break;case"mark-line":l.markline(this.zr,e,t,n,i);break;case"bezier-curve":case"line":l.line(this.zr,e,t,n,i);break;default:this.zr.addShape(t)}},animationMark:function(e,t,n){for(var i=n||this.shapeList,a=0,o=i.length;o>a;a++)i[a]._mark&&this._animateMod(!1,i[a],e,t,0,!0);this.animationEffect(n)},animationEffect:function(e){!e&&this.clearEffectShape();var t=e||this.shapeList;if(null!=t){var n=r.EFFECT_ZLEVEL;this.canvasSupported&&this.zr.modLayer(n,{motionBlur:!0,lastFrameAlpha:.95});for(var i,a=0,o=t.length;o>a;a++)i=t[a],i._mark&&i.effect&&i.effect.show&&h[i._mark]&&(h[i._mark](this.zr,this.effectList,i,n),this.effectList[this.effectList.length-1]._mark=i._mark)}},clearEffectShape:function(e){this.zr&&this.effectList&&this.effectList.length>0&&(e&&this.zr.modLayer(r.EFFECT_ZLEVEL,{motionBlur:!1}),this.zr.delShape(this.effectList)),this.effectList=[]},addMark:function(e,t,n){var i=this.series[e];if(this.selectedMap[i.name]){var a=this.query(this.option,"animationDurationUpdate"),o=this.query(this.option,"animationEasing"),r=i[n].data,s=this.shapeList.length;if(i[n].data=t.data,this["_build"+n.replace("m","M")](e),this.option.animation&&!this.option.renderAsImage)this.animationMark(a,o,this.shapeList.slice(s));else{for(var l=s,h=this.shapeList.length;h>l;l++)this.zr.addShape(this.shapeList[l]);this.zr.refreshNextFrame()}i[n].data=r}},delMark:function(e,t,n){n=n.replace("mark","").replace("large","").toLowerCase();var i=this.series[e];if(this.selectedMap[i.name]){for(var a=!1,o=[this.shapeList,this.effectList],r=2;r--;)for(var l=0,h=o[r].length;h>l;l++)if(o[r][l]._mark==n&&s.get(o[r][l],"seriesIndex")==e&&s.get(o[r][l],"name")==t){this.zr.delShape(o[r][l].id),o[r].splice(l,1),a=!0;break}a&&this.zr.refreshNextFrame()}}},U.inherits(t,V),t}),n("zrender/shape/Circle",["require","./Base","../tool/util"],function(e){"use strict";var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"circle",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,2*Math.PI,!0)},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:2*e.r+t,height:2*e.r+t},e.__rect}},e("../tool/util").inherits(n,t),n}),n("echarts/util/accMath",[],function(){function e(e,t){var n=e.toString(),i=t.toString(),a=0;try{a=i.split(".")[1].length}catch(o){}try{a-=n.split(".")[1].length}catch(o){}return(n.replace(".","")-0)/(i.replace(".","")-0)*Math.pow(10,a)}function t(e,t){var n=e.toString(),i=t.toString(),a=0;try{a+=n.split(".")[1].length}catch(o){}try{a+=i.split(".")[1].length}catch(o){}return(n.replace(".","")-0)*(i.replace(".","")-0)/Math.pow(10,a)}function n(e,t){var n=0,i=0;try{n=e.toString().split(".")[1].length}catch(a){}try{i=t.toString().split(".")[1].length}catch(a){}var o=Math.pow(10,Math.max(n,i));return(Math.round(e*o)+Math.round(t*o))/o}function i(e,t){return n(e,-t)}return{accDiv:e,accMul:t,accAdd:n,accSub:i}}),n("echarts/util/shape/Icon",["require","zrender/tool/util","zrender/shape/Star","zrender/shape/Heart","zrender/shape/Droplet","zrender/shape/Image","zrender/shape/Base"],function(e){function t(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i+t.height),e.lineTo(n+5*a,i+14*o),e.lineTo(n+t.width,i+3*o),e.lineTo(n+13*a,i),e.lineTo(n+2*a,i+11*o),e.lineTo(n,i+t.height),e.moveTo(n+6*a,i+10*o),e.lineTo(n+14*a,i+2*o),e.moveTo(n+10*a,i+13*o),e.lineTo(n+t.width,i+13*o),e.moveTo(n+13*a,i+10*o),e.lineTo(n+13*a,i+t.height)}function n(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i+t.height),e.lineTo(n+5*a,i+14*o),e.lineTo(n+t.width,i+3*o),e.lineTo(n+13*a,i),e.lineTo(n+2*a,i+11*o),e.lineTo(n,i+t.height),e.moveTo(n+6*a,i+10*o),e.lineTo(n+14*a,i+2*o),e.moveTo(n+10*a,i+13*o),e.lineTo(n+t.width,i+13*o)}function i(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n+4*a,i+15*o),e.lineTo(n+9*a,i+13*o),e.lineTo(n+14*a,i+8*o),e.lineTo(n+11*a,i+5*o),e.lineTo(n+6*a,i+10*o),e.lineTo(n+4*a,i+15*o),e.moveTo(n+5*a,i),e.lineTo(n+11*a,i),e.moveTo(n+5*a,i+o),e.lineTo(n+11*a,i+o),e.moveTo(n,i+2*o),e.lineTo(n+t.width,i+2*o),e.moveTo(n,i+5*o),e.lineTo(n+3*a,i+t.height),e.lineTo(n+13*a,i+t.height),e.lineTo(n+t.width,i+5*o)}function a(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i+3*o),e.lineTo(n+6*a,i+3*o),e.moveTo(n+3*a,i),e.lineTo(n+3*a,i+6*o),e.moveTo(n+3*a,i+8*o),e.lineTo(n+3*a,i+t.height),e.lineTo(n+t.width,i+t.height),e.lineTo(n+t.width,i+3*o),e.lineTo(n+8*a,i+3*o)}function o(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n+6*a,i),e.lineTo(n+2*a,i+3*o),e.lineTo(n+6*a,i+6*o),e.moveTo(n+2*a,i+3*o),e.lineTo(n+14*a,i+3*o),e.lineTo(n+14*a,i+11*o),e.moveTo(n+2*a,i+5*o),e.lineTo(n+2*a,i+13*o),e.lineTo(n+14*a,i+13*o),e.moveTo(n+10*a,i+10*o),e.lineTo(n+14*a,i+13*o),e.lineTo(n+10*a,i+t.height)}function r(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16,r=t.width/2;e.lineWidth=1.5,e.arc(n+r,i+r,r-a,0,2*Math.PI/3),e.moveTo(n+3*a,i+t.height),e.lineTo(n+0*a,i+12*o),e.lineTo(n+5*a,i+11*o),e.moveTo(n,i+8*o),e.arc(n+r,i+r,r-a,Math.PI,5*Math.PI/3),e.moveTo(n+13*a,i),e.lineTo(n+t.width,i+4*o),e.lineTo(n+11*a,i+5*o)}function s(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i),e.lineTo(n,i+t.height),e.lineTo(n+t.width,i+t.height),e.moveTo(n+2*a,i+14*o),e.lineTo(n+7*a,i+6*o),e.lineTo(n+11*a,i+11*o),e.lineTo(n+15*a,i+2*o)}function l(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i),e.lineTo(n,i+t.height),e.lineTo(n+t.width,i+t.height),e.moveTo(n+3*a,i+14*o),e.lineTo(n+3*a,i+6*o),e.lineTo(n+4*a,i+6*o),e.lineTo(n+4*a,i+14*o),e.moveTo(n+7*a,i+14*o),e.lineTo(n+7*a,i+2*o),e.lineTo(n+8*a,i+2*o),e.lineTo(n+8*a,i+14*o),e.moveTo(n+11*a,i+14*o),e.lineTo(n+11*a,i+9*o),e.lineTo(n+12*a,i+9*o),e.lineTo(n+12*a,i+14*o)}function h(e,t){var n=t.x,i=t.y,a=t.width-2,o=t.height-2,r=Math.min(a,o)/2;i+=2,e.moveTo(n+r+3,i+r-3),e.arc(n+r+3,i+r-3,r-1,0,-Math.PI/2,!0),e.lineTo(n+r+3,i+r-3),e.moveTo(n+r,i),e.lineTo(n+r,i+r),e.arc(n+r,i+r,r,-Math.PI/2,2*Math.PI,!0),e.lineTo(n+r,i+r),e.lineWidth=1.5}function m(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;i-=o,e.moveTo(n+1*a,i+2*o),e.lineTo(n+15*a,i+2*o),e.lineTo(n+14*a,i+3*o),e.lineTo(n+2*a,i+3*o),e.moveTo(n+3*a,i+6*o),e.lineTo(n+13*a,i+6*o),e.lineTo(n+12*a,i+7*o),e.lineTo(n+4*a,i+7*o),e.moveTo(n+5*a,i+10*o),e.lineTo(n+11*a,i+10*o),e.lineTo(n+10*a,i+11*o),e.lineTo(n+6*a,i+11*o),e.moveTo(n+7*a,i+14*o),e.lineTo(n+9*a,i+14*o),e.lineTo(n+8*a,i+15*o),e.lineTo(n+7*a,i+15*o)}function V(e,t){var n=t.x,i=t.y,a=t.width,o=t.height,r=a/16,s=o/16,l=2*Math.min(r,s);e.moveTo(n+r+l,i+s+l),e.arc(n+r,i+s,l,Math.PI/4,3*Math.PI),e.lineTo(n+7*r-l,i+6*s-l),e.arc(n+7*r,i+6*s,l,Math.PI/4*5,4*Math.PI),e.arc(n+7*r,i+6*s,l/2,Math.PI/4*5,4*Math.PI),e.moveTo(n+7*r-l/2,i+6*s+l),e.lineTo(n+r+l,i+14*s-l),e.arc(n+r,i+14*s,l,-Math.PI/4,2*Math.PI),e.moveTo(n+7*r+l/2,i+6*s),e.lineTo(n+14*r-l,i+10*s-l/2),e.moveTo(n+16*r,i+10*s),e.arc(n+14*r,i+10*s,l,0,3*Math.PI),e.lineWidth=1.5}function U(e,t){var n=t.x,i=t.y,a=t.width,o=t.height,r=Math.min(a,o)/2;e.moveTo(n+a,i+o/2),e.arc(n+r,i+r,r,0,2*Math.PI),e.arc(n+r,i,r,Math.PI/4,Math.PI/5*4),e.arc(n,i+r,r,-Math.PI/3,Math.PI/3),e.arc(n+a,i+o,r,Math.PI,Math.PI/2*3),e.lineWidth=1.5}function d(e,t){for(var n=t.x,i=t.y,a=t.width,o=t.height,r=Math.round(o/3),s=Math.round((r-2)/2),l=3;l--;)e.rect(n,i+r*l+s,a,2)}function p(e,t){for(var n=t.x,i=t.y,a=t.width,o=t.height,r=Math.round(a/3),s=Math.round((r-2)/2),l=3;l--;)e.rect(n+r*l+s,i,2,o)}function c(e,t){var n=t.x,i=t.y,a=t.width/16;e.moveTo(n+a,i),e.lineTo(n+a,i+t.height),e.lineTo(n+15*a,i+t.height),e.lineTo(n+15*a,i),e.lineTo(n+a,i),e.moveTo(n+3*a,i+3*a),e.lineTo(n+13*a,i+3*a),e.moveTo(n+3*a,i+6*a),e.lineTo(n+13*a,i+6*a),e.moveTo(n+3*a,i+9*a),e.lineTo(n+13*a,i+9*a),e.moveTo(n+3*a,i+12*a),e.lineTo(n+9*a,i+12*a)}function u(e,t){var n=t.x,i=t.y,a=t.width/16,o=t.height/16;e.moveTo(n,i),e.lineTo(n,i+t.height),e.lineTo(n+t.width,i+t.height),e.lineTo(n+t.width,i),e.lineTo(n,i),e.moveTo(n+4*a,i),e.lineTo(n+4*a,i+8*o),e.lineTo(n+12*a,i+8*o),e.lineTo(n+12*a,i),e.moveTo(n+6*a,i+11*o),e.lineTo(n+6*a,i+13*o),e.lineTo(n+10*a,i+13*o),e.lineTo(n+10*a,i+11*o),e.lineTo(n+6*a,i+11*o)}function y(e,t){var n=t.x,i=t.y,a=t.width,o=t.height;e.moveTo(n,i+o/2),e.lineTo(n+a,i+o/2),e.moveTo(n+a/2,i),e.lineTo(n+a/2,i+o)}function g(e,t){var n=t.width/2,i=t.height/2,a=Math.min(n,i);e.moveTo(t.x+n+a,t.y+i),e.arc(t.x+n,t.y+i,a,0,2*Math.PI),e.closePath()}function b(e,t){e.rect(t.x,t.y,t.width,t.height),e.closePath()}function f(e,t){var n=t.width/2,i=t.height/2,a=t.x+n,o=t.y+i,r=Math.min(n,i);e.moveTo(a,o-r),e.lineTo(a+r,o+r),e.lineTo(a-r,o+r),e.lineTo(a,o-r),e.closePath()}function k(e,t){var n=t.width/2,i=t.height/2,a=t.x+n,o=t.y+i,r=Math.min(n,i);e.moveTo(a,o-r),e.lineTo(a+r,o),e.lineTo(a,o+r),e.lineTo(a-r,o),e.lineTo(a,o-r),e.closePath()}function x(e,t){var n=t.x,i=t.y,a=t.width/16;e.moveTo(n+8*a,i),e.lineTo(n+a,i+t.height),e.lineTo(n+8*a,i+t.height/4*3),e.lineTo(n+15*a,i+t.height),e.lineTo(n+8*a,i),e.closePath()}function _(t,n){var i=e("zrender/shape/Star"),a=n.width/2,o=n.height/2;i.prototype.buildPath(t,{x:n.x+a,y:n.y+o,r:Math.min(a,o),n:n.n||5})}function L(t,n){var i=e("zrender/shape/Heart");i.prototype.buildPath(t,{x:n.x+n.width/2,y:n.y+.2*n.height,a:n.width/2,b:.8*n.height})}function W(t,n){var i=e("zrender/shape/Droplet");i.prototype.buildPath(t,{x:n.x+.5*n.width,y:n.y+.5*n.height,a:.5*n.width,b:.8*n.height})}function X(e,t){var n=t.x,i=t.y-t.height/2*1.5,a=t.width/2,o=t.height/2,r=Math.min(a,o);e.arc(n+a,i+o,r,Math.PI/5*4,Math.PI/5),e.lineTo(n+a,i+o+1.5*r),e.closePath()}function K(t,n,i){var a=e("zrender/shape/Image");this._imageShape=this._imageShape||new a({style:{}});for(var o in n)this._imageShape.style[o]=n[o];this._imageShape.brush(t,!1,i)}function w(e){v.call(this,e)}var I=e("zrender/tool/util"),v=e("zrender/shape/Base");return w.prototype={type:"icon",iconLibrary:{mark:t,markUndo:n,markClear:i,dataZoom:a,dataZoomReset:o,restore:r,lineChart:s,barChart:l,pieChart:h,funnelChart:m,forceChart:V,chordChart:U,stackChart:d,tiledChart:p,dataView:c,saveAsImage:u,cross:y,circle:g,rectangle:b,triangle:f,diamond:k,arrow:x,star:_,heart:L,droplet:W,pin:X,image:K},brush:function(t,n,i){var a=n?this.highlightStyle:this.style;a=a||{};var o=a.iconType||this.style.iconType;if("image"===o){var r=e("zrender/shape/Image");r.prototype.brush.call(this,t,n,i)}else{var a=this.beforeBrush(t,n);switch(t.beginPath(),this.buildPath(t,a,i),a.brushType){case"both":t.fill();case"stroke":a.lineWidth>0&&t.stroke();break;default:t.fill()}this.drawText(t,a,this.style),this.afterBrush(t)}},buildPath:function(e,t,n){this.iconLibrary[t.iconType]?this.iconLibrary[t.iconType].call(this,e,t,n):(e.moveTo(t.x,t.y),e.lineTo(t.x+t.width,t.y),e.lineTo(t.x+t.width,t.y+t.height),e.lineTo(t.x,t.y+t.height),e.lineTo(t.x,t.y),e.closePath())},getRect:function(e){return e.__rect?e.__rect:(e.__rect={x:Math.round(e.x),y:Math.round(e.y-("pin"==e.iconType?e.height/2*1.5:0)),width:e.width,height:e.height*("pin"===e.iconType?1.25:1)},e.__rect)},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var i=this.style.__rect;i||(i=this.style.__rect=this.getRect(this.style));var a=i.height<8||i.width<8?4:0;return e>=i.x-a&&e<=i.x+i.width+a&&t>=i.y-a&&t<=i.y+i.height+a?!0:!1}},I.inherits(w,v),w}),n("echarts/util/shape/MarkLine",["require","zrender/shape/Base","./Icon","zrender/shape/Line","zrender/shape/Polyline","zrender/tool/matrix","zrender/tool/area","zrender/shape/util/dashedLineTo","zrender/shape/util/smoothSpline","zrender/tool/util"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("./Icon"),a=e("zrender/shape/Line"),o=new a({}),r=e("zrender/shape/Polyline"),s=new r({}),l=e("zrender/tool/matrix"),h=e("zrender/tool/area"),m=e("zrender/shape/util/dashedLineTo"),V=e("zrender/shape/util/smoothSpline"),U=e("zrender/tool/util");return t.prototype={type:"mark-line",brush:function(e,t){var n=this.style;t&&(n=this.getHighlightStyle(n,this.highlightStyle||{})),e.save(),this.setContext(e,n),this.setTransform(e),e.save(),e.beginPath(),this.buildLinePath(e,n,this.style.lineWidth||1),e.stroke(),e.restore(),this.brushSymbol(e,n,0),this.brushSymbol(e,n,1),this.drawText(e,n,this.style),e.restore()},buildLinePath:function(e,t,n){var i=t.pointList||this.getPointList(t);t.pointList=i;var a=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType)if("spline"!==t.smooth){var o=n*("dashed"==t.lineType?5:1);e.moveTo(i[0][0],i[0][1]);for(var r=1;a>r;r++)m(e,i[r-1][0],i[r-1][1],i[r][0],i[r][1],o)}else for(var r=1;a>r;r+=2)e.moveTo(i[r-1][0],i[r-1][1]),e.lineTo(i[r][0],i[r][1])}else{e.moveTo(i[0][0],i[0][1]);for(var r=1;a>r;r++)e.lineTo(i[r][0],i[r][1])}},brushSymbol:function(e,t,n){if("none"!=t.symbol[n]){e.save(),e.beginPath(),e.lineWidth=t.symbolBorder,e.strokeStyle=t.symbolBorderColor,t.iconType=t.symbol[n].replace("empty","").toLowerCase(),t.symbol[n].match("empty")&&(e.fillStyle="#fff");var a,o=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length)),r=0===n?t.pointList[0][0]:t.pointList[o-1][0],s=0===n?t.pointList[0][1]:t.pointList[o-1][1],h="undefined"!=typeof t.symbolRotate[n]?t.symbolRotate[n]-0:0;if(0!==h&&(a=l.create(),l.identity(a),(r||s)&&l.translate(a,a,[-r,-s]),l.rotate(a,a,h*Math.PI/180),(r||s)&&l.translate(a,a,[r,s]),e.transform.apply(e,a)),"arrow"==t.iconType&&0===h)this.buildArrawPath(e,t,n);else{var m=t.symbolSize[n];t.x=r-m,t.y=s-m,t.width=2*m,t.height=2*m,i.prototype.buildPath(e,t)}e.closePath(),e.fill(),e.stroke(),e.restore()}},buildArrawPath:function(e,t,n){var i=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length)),a=2*t.symbolSize[n],o=t.pointList[0][0],r=t.pointList[i-1][0],s=t.pointList[0][1],l=t.pointList[i-1][1],h=0;"spline"===t.smooth&&(h=t.smoothRadian*(r>=o?1:-1));var m=Math.atan(Math.abs((l-s)/(o-r)));0===n?r>o?l>s?m=2*Math.PI-m+h:m+=h:l>s?m+=Math.PI-h:m=Math.PI-m-h:o>r?s>l?m=2*Math.PI-m+h:m+=h:s>l?m+=Math.PI-h:m=Math.PI-m-h;var V=Math.PI/8,U=0===n?o:r,d=0===n?s:l,p=[[U+a*Math.cos(m-V),d-a*Math.sin(m-V)],[U+.6*a*Math.cos(m),d-.6*a*Math.sin(m)],[U+a*Math.cos(m+V),d-a*Math.sin(m+V)]];e.moveTo(U,d);for(var c=0,u=p.length;u>c;c++)e.lineTo(p[c][0],p[c][1]);e.lineTo(U,d)},getPointList:function(e){var t=[[e.xStart,e.yStart],[e.xEnd,e.yEnd]];if("spline"===e.smooth){var n=t[1][0],i=t[1][1];if(e.smoothRadian<=.8){t[3]=[n,i];var a=t[0][0]<=t[3][0];t[1]=this.getOffetPoint(t[0],t[3],a,e.smoothRadian),t[2]=this.getOffetPoint(t[3],t[0],a,e.smoothRadian)}else t[2]=[n,i],t[1]=this.getOffetPoint(t[0],t[2],t[0][0]<=t[2][0],e.smoothRadian);t=V(t,!1),t[t.length-1]=[n,i]}return t},getOffetPoint:function(e,t,n,i){var a,o=(2-Math.abs(i))/.6,r=Math.sqrt(Math.round((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])))/o,s=[e[0],e[1]];if(e[0]!=t[0]&&e[1]!=t[1]){var l=(t[1]-e[1])/(t[0]-e[0]);a=Math.atan(l)}else a=e[0]==t[0]?(e[1]<=t[1]?1:-1)*Math.PI/2:0;var h,m;return e[0]<=t[0]?(a-=i*(n?1:-1),h=Math.round(Math.cos(a)*r),m=Math.round(Math.sin(a)*r),s[0]+=h,s[1]+=m):(a+=i*(n?1:-1),h=Math.round(Math.cos(a)*r),m=Math.round(Math.sin(a)*r),s[0]-=h,s[1]-=m),s},getRect:function(e){if(e.__rect)return e.__rect;var t=e.lineWidth||1;return e.__rect={x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t},e.__rect},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var i=this.style.__rect;return i||(i=this.style.__rect=this.getRect(this.style)),e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height?"spline"!==this.style.smooth?h.isInside(o,this.style,e,t):h.isInside(s,this.style,e,t):!1}},U.inherits(t,n),t}),n("echarts/util/shape/Symbol",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/shape/Polygon"),a=new i({}),o=e("zrender/tool/util");return t.prototype={type:"symbol",buildPath:function(e,t){var n=t.pointList,i=n.length;if(0!==i)for(var a,o,r,s,l,h=1e4,m=Math.ceil(i/h),V=n[0]instanceof Array,U=t.size?t.size:2,d=U,p=U/2,c=2*Math.PI,u=0;m>u;u++){e.beginPath(),a=u*h,o=a+h,o=o>i?i:o;for(var y=a;o>y;y++)if(t.random&&(r=t["randomMap"+y%20]/100,d=U*r*r,p=d/2),V?(s=n[y][0],l=n[y][1]):(s=n[y].x,l=n[y].y),3>d)e.rect(s-p,l-p,d,d);else switch(t.iconType){case"circle":e.moveTo(s,l),e.arc(s,l,p,0,c,!0);break;case"diamond":e.moveTo(s,l-p),e.lineTo(s+p/3,l-p/3),e.lineTo(s+p,l),e.lineTo(s+p/3,l+p/3),e.lineTo(s,l+p),e.lineTo(s-p/3,l+p/3),e.lineTo(s-p,l),e.lineTo(s-p/3,l-p/3),e.lineTo(s,l-p);break;default:e.rect(s-p,l-p,d,d)}if(e.closePath(),m-1>u)switch(t.brushType){case"both":e.fill(),t.lineWidth>0&&e.stroke();break;case"stroke":t.lineWidth>0&&e.stroke();break;default:e.fill()}}},getRect:function(e){return e.__rect||a.getRect(e)},isCover:e("./normalIsCover")},o.inherits(t,n),t}),n("echarts/util/ecAnimation",["require","zrender/tool/util","zrender/shape/Polygon"],function(e){function t(e,t,n,i,a){var o,r=n.style.pointList,s=r.length;if(!t){if(o=[],"vertical"!=n._orient)for(var l=r[0][1],h=0;s>h;h++)o[h]=[r[h][0],l];else for(var m=r[0][0],h=0;s>h;h++)o[h]=[m,r[h][1]];"half-smooth-polygon"==n.type&&(o[s-1]=p.clone(r[s-1]),o[s-2]=p.clone(r[s-2])),t={style:{pointList:o}}}o=t.style.pointList;var V=o.length;n.style.pointList=V==s?o:s>V?o.concat(r.slice(V)):o.slice(0,s),e.addShape(n),n._animating=!0,e.animate(n.id,"style").when(i,{pointList:r}).done(function(){n._animating=!1}).start(a)}function n(e,t){for(var n=arguments.length,i=2;n>i;i++){var a=arguments[i];e.style[a]=t.style[a]}}function i(e,t,i,a,o){var r=i.style;t||(t={position:i.position,style:{x:r.x,y:"vertical"==i._orient?r.y+r.height:r.y,width:"vertical"==i._orient?r.width:0,height:"vertical"!=i._orient?r.height:0}});var s=r.x,l=r.y,h=r.width,m=r.height,V=[i.position[0],i.position[1]];n(i,t,"x","y","width","height"),i.position=t.position,e.addShape(i),(V[0]!=t.position[0]||V[1]!=t.position[1])&&e.animate(i.id,"").when(a,{position:V}).start(o),i._animating=!0,e.animate(i.id,"style").when(a,{x:s,y:l,width:h,height:m}).done(function(){i._animating=!1}).start(o)}function a(e,t,n,i,a){if(!t){var o=n.style.y;t={style:{y:[o[0],o[0],o[0],o[0]]}}}var r=n.style.y;n.style.y=t.style.y,e.addShape(n),n._animating=!0,e.animate(n.id,"style").when(i,{y:r}).done(function(){n._animating=!1}).start(a)}function o(e,t,n,i,a){var o=n.style.x,r=n.style.y,s=n.style.r0,l=n.style.r;n._animating=!0,"r"!=n._animationAdd?(n.style.r0=0,n.style.r=0,n.rotation=[2*Math.PI,o,r],e.addShape(n),e.animate(n.id,"style").when(i,{r0:s,r:l}).done(function(){n._animating=!1}).start(a),e.animate(n.id,"").when(Math.round(i/3*2),{rotation:[0,o,r]}).start(a)):(n.style.r0=n.style.r,e.addShape(n),e.animate(n.id,"style").when(i,{r0:s}).done(function(){n._animating=!1}).start(a))}function r(e,t,i,a,o){t||(t="r"!=i._animationAdd?{style:{startAngle:i.style.startAngle,endAngle:i.style.startAngle}}:{style:{r0:i.style.r}});var r=i.style.startAngle,s=i.style.endAngle;n(i,t,"startAngle","endAngle"),e.addShape(i),i._animating=!0,e.animate(i.id,"style").when(a,{startAngle:r,endAngle:s}).done(function(){i._animating=!1}).start(o)}function s(e,t,i,a,o){t||(t={style:{x:"left"==i.style.textAlign?i.style.x+100:i.style.x-100,y:i.style.y}});var r=i.style.x,s=i.style.y;n(i,t,"x","y"),e.addShape(i),i._animating=!0,e.animate(i.id,"style").when(a,{x:r,y:s}).done(function(){i._animating=!1}).start(o)}function l(t,n,i,a,o){var r=e("zrender/shape/Polygon").prototype.getRect(i.style),s=r.x+r.width/2,l=r.y+r.height/2;i.scale=[.1,.1,s,l],t.addShape(i),i._animating=!0,t.animate(i.id,"").when(a,{scale:[1,1,s,l]}).done(function(){i._animating=!1}).start(o)}function h(e,t,i,a,o){t||(t={style:{source0:0,source1:i.style.source1>0?360:-360,target0:0,target1:i.style.target1>0?360:-360}});var r=i.style.source0,s=i.style.source1,l=i.style.target0,h=i.style.target1;t.style&&n(i,t,"source0","source1","target0","target1"),e.addShape(i),i._animating=!0,e.animate(i.id,"style").when(a,{source0:r,source1:s,target0:l,target1:h}).done(function(){i._animating=!1}).start(o)}function m(e,t,n,i,a){t||(t={style:{angle:n.style.startAngle}});var o=n.style.angle;n.style.angle=t.style.angle,e.addShape(n),n._animating=!0,e.animate(n.id,"style").when(i,{angle:o}).done(function(){n._animating=!1}).start(a)}function V(e,t,n,a,o,r){if(n.style._x=n.style.x,n.style._y=n.style.y,n.style._width=n.style.width,n.style._height=n.style.height,t)i(e,t,n,a,o);else{var s=n._x||0,l=n._y||0;n.scale=[.01,.01,s,l],e.addShape(n),n._animating=!0,e.animate(n.id,"").delay(r).when(a,{scale:[1,1,s,l]}).done(function(){n._animating=!1}).start(o||"QuinticOut")}}function U(e,t,i,a,o){t||(t={style:{xStart:i.style.xStart,yStart:i.style.yStart,xEnd:i.style.xStart,yEnd:i.style.yStart}});var r=i.style.xStart,s=i.style.xEnd,l=i.style.yStart,h=i.style.yEnd;n(i,t,"xStart","xEnd","yStart","yEnd"),e.addShape(i),i._animating=!0,e.animate(i.id,"style").when(a,{xStart:r,xEnd:s,yStart:l,yEnd:h}).done(function(){i._animating=!1}).start(o)}function d(e,t,n,i,a){n.style.smooth?t?e.addShape(n):(n.style.pointListLength=1,e.addShape(n),n._animating=!0,n.style.pointList=n.style.pointList||n.getPointList(n.style),e.animate(n.id,"style").when(i,{pointListLength:n.style.pointList.length}).done(function(){n._animating=!1}).start(a||"QuinticOut")):(n.style.pointList=t?t.style.pointList:[[n.style.xStart,n.style.yStart],[n.style.xStart,n.style.yStart]],e.addShape(n),n._animating=!0,e.animate(n.id,"style").when(i,{pointList:[[n.style.xStart,n.style.yStart],[n._x||0,n._y||0]]}).done(function(){n._animating=!1}).start(a||"QuinticOut"))
-}var p=e("zrender/tool/util");return{pointList:t,rectangle:i,candle:a,ring:o,sector:r,text:s,polygon:l,ribbon:h,gaugePointer:m,icon:V,line:U,markline:d}}),n("echarts/util/ecEffect",["require","../util/ecData","zrender/shape/Circle","zrender/shape/Image","../util/shape/Icon","../util/shape/Symbol","zrender/tool/env"],function(e){function t(e,t,n,i){var o,l=n.effect,m=l.color||n.style.strokeColor||n.style.color,V=l.shadowColor||m,U=l.scaleSize,d=l.bounceDistance,p="undefined"!=typeof l.shadowBlur?l.shadowBlur:U;"image"!==n.type?(o=new s({zlevel:i,style:{brushType:"stroke",iconType:"droplet"!=n.style.iconType?n.style.iconType:"circle",x:p+1,y:p+1,n:n.style.n,width:n.style._width*U,height:n.style._height*U,lineWidth:1,strokeColor:m,shadowColor:V,shadowBlur:p},draggable:!1,hoverable:!1}),"pin"==n.style.iconType&&(o.style.y+=o.style.height/2*1.5),h&&(o.style.image=e.shapeToImage(o,o.style.width+2*p+2,o.style.height+2*p+2).style.image,o=new r({zlevel:o.zlevel,style:o.style,draggable:!1,hoverable:!1}))):o=new r({zlevel:i,style:n.style,draggable:!1,hoverable:!1}),a.clone(n,o),o.position=n.position,t.push(o),e.addShape(o);var c="image"!==n.type?window.devicePixelRatio||1:1,u=(o.style.width/c-n.style._width)/2;o.style.x=n.style._x-u,o.style.y=n.style._y-u,"pin"==n.style.iconType&&(o.style.y-=n.style.height/2*1.5);var y=100*(l.period+10*Math.random());e.modShape(n.id,{invisible:!0});var g=o.style.x+o.style.width/2/c,b=o.style.y+o.style.height/2/c;"scale"===l.type?(e.modShape(o.id,{scale:[.1,.1,g,b]}),e.animate(o.id,"",l.loop).when(y,{scale:[1,1,g,b]}).done(function(){n.effect.show=!1,e.delShape(o.id)}).start()):e.animate(o.id,"style",l.loop).when(y,{y:o.style.y-d}).when(2*y,{y:o.style.y}).done(function(){n.effect.show=!1,e.delShape(o.id)}).start()}function n(e,t,n,i){var a=n.effect,o=a.color||n.style.strokeColor||n.style.color,r=a.scaleSize,s=a.shadowColor||o,h="undefined"!=typeof a.shadowBlur?a.shadowBlur:2*r,m=window.devicePixelRatio||1,V=new l({zlevel:i,position:n.position,scale:n.scale,style:{pointList:n.style.pointList,iconType:n.style.iconType,color:o,strokeColor:o,shadowColor:s,shadowBlur:h*m,random:!0,brushType:"fill",lineWidth:1,size:n.style.size},draggable:!1,hoverable:!1});t.push(V),e.addShape(V),e.modShape(n.id,{invisible:!0});for(var U=Math.round(100*a.period),d={},p={},c=0;20>c;c++)V.style["randomMap"+c]=0,d={},d["randomMap"+c]=100,p={},p["randomMap"+c]=0,V.style["randomMap"+c]=100*Math.random(),e.animate(V.id,"style",!0).when(U,d).when(2*U,p).when(3*U,d).when(4*U,d).delay(Math.random()*U*c).start()}function i(e,t,n,i){var s,l=n.effect,m=l.color||n.style.strokeColor||n.style.color,V=l.shadowColor||n.style.strokeColor||m,U=n.style.lineWidth*l.scaleSize,d="undefined"!=typeof l.shadowBlur?l.shadowBlur:U,p=new o({zlevel:i,style:{x:d,y:d,r:U,color:m,shadowColor:V,shadowBlur:d},draggable:!1,hoverable:!1});h?(p.style.image=e.shapeToImage(p,2*(U+d),2*(U+d)).style.image,p=new r({zlevel:p.zlevel,style:p.style,draggable:!1,hoverable:!1}),s=d):s=0,a.clone(n,p),p.position=n.position,t.push(p),e.addShape(p),p.style.x=n.style.xStart-s,p.style.y=n.style.yStart-s;var c=(n.style.xStart-n.style.xEnd)*(n.style.xStart-n.style.xEnd)+(n.style.yStart-n.style.yEnd)*(n.style.yStart-n.style.yEnd),u=Math.round(Math.sqrt(Math.round(c*l.period*l.period)));if(n.style.smooth){var y=n.style.pointList||n.getPointList(n.style),g=y.length;u=Math.round(u/g);for(var b=e.animate(p.id,"style",l.loop),f=Math.ceil(g/8),k=0;g-f>k;k+=f)b.when(u*(k+1),{x:y[k][0]-s,y:y[k][1]-s});b.when(u*g,{x:y[g-1][0]-s,y:y[g-1][1]-s}),b.done(function(){n.effect.show=!1,e.delShape(p.id)}),b.start("spline")}else e.animate(p.id,"style",l.loop).when(u,{x:n._x-s,y:n._y-s}).done(function(){n.effect.show=!1,e.delShape(p.id)}).start()}var a=e("../util/ecData"),o=e("zrender/shape/Circle"),r=e("zrender/shape/Image"),s=e("../util/shape/Icon"),l=e("../util/shape/Symbol"),h=e("zrender/tool/env").canvasSupported;return{point:t,largePoint:n,line:i}}),n("echarts/component/base",["require","../config","../util/ecData","../util/ecQuery","../util/number","zrender/tool/util","zrender/tool/env"],function(e){function t(e,t,a,o,r){this.ecTheme=e,this.messageCenter=t,this.zr=a,this.option=o,this.series=o.series,this.myChart=r,this.component=r.component,this.shapeList=[],this.effectList=[];var s=this;s._onlegendhoverlink=function(e){if(s.legendHoverLink)for(var t,a=e.target,o=s.shapeList.length-1;o>=0;o--)t=s.type==n.CHART_TYPE_PIE||s.type==n.CHART_TYPE_FUNNEL?i.get(s.shapeList[o],"name"):(i.get(s.shapeList[o],"series")||{}).name,t!=a||s.shapeList[o].invisible||s.shapeList[o]._animating||s.zr.addHoverShape(s.shapeList[o])},t&&t.bind(n.EVENT.LEGEND_HOVERLINK,this._onlegendhoverlink)}var n=e("../config"),i=e("../util/ecData"),a=e("../util/ecQuery"),o=e("../util/number"),r=e("zrender/tool/util");return t.prototype={canvasSupported:e("zrender/tool/env").canvasSupported,_getZ:function(e){var t=this.ecTheme[this.type];return t&&null!=t[e]?t[e]:(t=n[this.type],t&&null!=t[e]?t[e]:0)},getZlevelBase:function(){return this._getZ("zlevel")},getZBase:function(){return this._getZ("z")},reformOption:function(e){return r.merge(r.merge(e||{},r.clone(this.ecTheme[this.type]||{})),r.clone(n[this.type]||{}))},reformCssArray:function(e){if(!(e instanceof Array))return[e,e,e,e];switch(e.length+""){case"4":return e;case"3":return[e[0],e[1],e[2],e[1]];case"2":return[e[0],e[1],e[0],e[1]];case"1":return[e[0],e[0],e[0],e[0]];case"0":return[0,0,0,0]}},getShapeById:function(e){for(var t=0,n=this.shapeList.length;n>t;t++)if(this.shapeList[t].id===e)return this.shapeList[t];return null},getFont:function(e){var t=this.getTextStyle(r.clone(e));return t.fontStyle+" "+t.fontWeight+" "+t.fontSize+"px "+t.fontFamily},getTextStyle:function(e){return r.merge(r.merge(e||{},this.ecTheme.textStyle),n.textStyle)},getItemStyleColor:function(e,t,n,i){return"function"==typeof e?e.call(this.myChart,{seriesIndex:t,series:this.series[t],dataIndex:n,data:i}):e},getDataFromOption:function(e,t){return null!=e?null!=e.value?e.value:e:t},subPixelOptimize:function(e,t){return e=t%2===1?Math.floor(e)+.5:Math.round(e)},resize:function(){this.refresh&&this.refresh(),this.clearEffectShape&&this.clearEffectShape(!0);var e=this;setTimeout(function(){e.animationEffect&&e.animationEffect()},200)},clear:function(){this.clearEffectShape&&this.clearEffectShape(),this.zr&&this.zr.delShape(this.shapeList),this.shapeList=[]},dispose:function(){this.onbeforDispose&&this.onbeforDispose(),this.clear(),this.shapeList=null,this.effectList=null,this.messageCenter&&this.messageCenter.unbind(n.EVENT.LEGEND_HOVERLINK,this._onlegendhoverlink),this.onafterDispose&&this.onafterDispose()},query:a.query,deepQuery:a.deepQuery,deepMerge:a.deepMerge,parsePercent:o.parsePercent,parseCenter:o.parseCenter,parseRadius:o.parseRadius,numAddCommas:o.addCommas},t}),n("zrender/shape/Star",["require","../tool/math","./Base","../tool/util"],function(e){var t=e("../tool/math"),n=t.sin,i=t.cos,a=Math.PI,o=e("./Base"),r=function(e){o.call(this,e)};return r.prototype={type:"star",buildPath:function(e,t){var o=t.n;if(o&&!(2>o)){var r=t.x,s=t.y,l=t.r,h=t.r0;null==h&&(h=o>4?l*i(2*a/o)/i(a/o):l/3);var m=a/o,V=-a/2,U=r+l*i(V),d=s+l*n(V);V+=m;var p=t.pointList=[];p.push([U,d]);for(var c,u=0,y=2*o-1;y>u;u++)c=u%2===0?h:l,p.push([r+c*i(V),s+c*n(V)]),V+=m;p.push([U,d]),e.moveTo(p[0][0],p[0][1]);for(var u=0;u<p.length;u++)e.lineTo(p[u][0],p[u][1]);e.closePath()}},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:2*e.r+t,height:2*e.r+t},e.__rect}},e("../tool/util").inherits(r,o),r}),n("zrender/shape/Heart",["require","./Base","./util/PathProxy","../tool/area","../tool/util"],function(e){"use strict";var t=e("./Base"),n=e("./util/PathProxy"),i=e("../tool/area"),a=function(e){t.call(this,e),this._pathProxy=new n};return a.prototype={type:"heart",buildPath:function(e,t){var i=this._pathProxy||new n;i.begin(e),i.moveTo(t.x,t.y),i.bezierCurveTo(t.x+t.a/2,t.y-2*t.b/3,t.x+2*t.a,t.y+t.b/3,t.x,t.y+t.b),i.bezierCurveTo(t.x-2*t.a,t.y+t.b/3,t.x-t.a/2,t.y-2*t.b/3,t.x,t.y),i.closePath()},getRect:function(e){return e.__rect?e.__rect:(this._pathProxy.isEmpty()||this.buildPath(null,e),this._pathProxy.fastBoundingRect())},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var a=this.getRect(this.style);return e>=a.x&&e<=a.x+a.width&&t>=a.y&&t<=a.y+a.height?i.isInsidePath(this._pathProxy.pathCommands,this.style.lineWidth,this.style.brushType,e,t):void 0}},e("../tool/util").inherits(a,t),a}),n("zrender/shape/Droplet",["require","./Base","./util/PathProxy","../tool/area","../tool/util"],function(e){"use strict";var t=e("./Base"),n=e("./util/PathProxy"),i=e("../tool/area"),a=function(e){t.call(this,e),this._pathProxy=new n};return a.prototype={type:"droplet",buildPath:function(e,t){var i=this._pathProxy||new n;i.begin(e),i.moveTo(t.x,t.y+t.a),i.bezierCurveTo(t.x+t.a,t.y+t.a,t.x+3*t.a/2,t.y-t.a/3,t.x,t.y-t.b),i.bezierCurveTo(t.x-3*t.a/2,t.y-t.a/3,t.x-t.a,t.y+t.a,t.x,t.y+t.a),i.closePath()},getRect:function(e){return e.__rect?e.__rect:(this._pathProxy.isEmpty()||this.buildPath(null,e),this._pathProxy.fastBoundingRect())},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var a=this.getRect(this.style);return e>=a.x&&e<=a.x+a.width&&t>=a.y&&t<=a.y+a.height?i.isInsidePath(this._pathProxy.pathCommands,this.style.lineWidth,this.style.brushType,e,t):void 0}},e("../tool/util").inherits(a,t),a}),n("zrender/tool/math",[],function(){function e(e,t){return Math.sin(t?e*a:e)}function t(e,t){return Math.cos(t?e*a:e)}function n(e){return e*a}function i(e){return e/a}var a=Math.PI/180;return{sin:e,cos:t,degreeToRadian:n,radianToDegree:i}}),n("zrender/shape/util/PathProxy",["require","../../tool/vector"],function(e){var t=e("../../tool/vector"),n=function(e,t){this.command=e,this.points=t||null},i=function(){this.pathCommands=[],this._ctx=null,this._min=[],this._max=[]};return i.prototype.fastBoundingRect=function(){var e=this._min,n=this._max;e[0]=e[1]=1/0,n[0]=n[1]=-1/0;for(var i=0;i<this.pathCommands.length;i++){var a=this.pathCommands[i],o=a.points;switch(a.command){case"M":t.min(e,e,o),t.max(n,n,o);break;case"L":t.min(e,e,o),t.max(n,n,o);break;case"C":for(var r=0;6>r;r+=2)e[0]=Math.min(e[0],e[0],o[r]),e[1]=Math.min(e[1],e[1],o[r+1]),n[0]=Math.max(n[0],n[0],o[r]),n[1]=Math.max(n[1],n[1],o[r+1]);break;case"Q":for(var r=0;4>r;r+=2)e[0]=Math.min(e[0],e[0],o[r]),e[1]=Math.min(e[1],e[1],o[r+1]),n[0]=Math.max(n[0],n[0],o[r]),n[1]=Math.max(n[1],n[1],o[r+1]);break;case"A":var s=o[0],l=o[1],h=o[2],m=o[3];e[0]=Math.min(e[0],e[0],s-h),e[1]=Math.min(e[1],e[1],l-m),n[0]=Math.max(n[0],n[0],s+h),n[1]=Math.max(n[1],n[1],l+m)}}return{x:e[0],y:e[1],width:n[0]-e[0],height:n[1]-e[1]}},i.prototype.begin=function(e){return this._ctx=e||null,this.pathCommands.length=0,this},i.prototype.moveTo=function(e,t){return this.pathCommands.push(new n("M",[e,t])),this._ctx&&this._ctx.moveTo(e,t),this},i.prototype.lineTo=function(e,t){return this.pathCommands.push(new n("L",[e,t])),this._ctx&&this._ctx.lineTo(e,t),this},i.prototype.bezierCurveTo=function(e,t,i,a,o,r){return this.pathCommands.push(new n("C",[e,t,i,a,o,r])),this._ctx&&this._ctx.bezierCurveTo(e,t,i,a,o,r),this},i.prototype.quadraticCurveTo=function(e,t,i,a){return this.pathCommands.push(new n("Q",[e,t,i,a])),this._ctx&&this._ctx.quadraticCurveTo(e,t,i,a),this},i.prototype.arc=function(e,t,i,a,o,r){return this.pathCommands.push(new n("A",[e,t,i,i,a,o-a,0,r?0:1])),this._ctx&&this._ctx.arc(e,t,i,a,o,r),this},i.prototype.arcTo=function(e,t,n,i,a){return this._ctx&&this._ctx.arcTo(e,t,n,i,a),this},i.prototype.rect=function(e,t,n,i){return this._ctx&&this._ctx.rect(e,t,n,i),this},i.prototype.closePath=function(){return this.pathCommands.push(new n("z")),this._ctx&&this._ctx.closePath(),this},i.prototype.isEmpty=function(){return 0===this.pathCommands.length},i.PathSegment=n,i}),n("zrender/shape/Line",["require","./Base","./util/dashedLineTo","../tool/util"],function(e){var t=e("./Base"),n=e("./util/dashedLineTo"),i=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return i.prototype={type:"line",buildPath:function(e,t){if(t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var i=(t.lineWidth||1)*("dashed"==t.lineType?5:1);n(e,t.xStart,t.yStart,t.xEnd,t.yEnd,i)}}else e.moveTo(t.xStart,t.yStart),e.lineTo(t.xEnd,t.yEnd)},getRect:function(e){if(e.__rect)return e.__rect;var t=e.lineWidth||1;return e.__rect={x:Math.min(e.xStart,e.xEnd)-t,y:Math.min(e.yStart,e.yEnd)-t,width:Math.abs(e.xStart-e.xEnd)+t,height:Math.abs(e.yStart-e.yEnd)+t},e.__rect}},e("../tool/util").inherits(i,t),i}),n("zrender/shape/Polyline",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","./Polygon","../tool/util"],function(e){var t=e("./Base"),n=e("./util/smoothSpline"),i=e("./util/smoothBezier"),a=e("./util/dashedLineTo"),o=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return o.prototype={type:"polyline",buildPath:function(e,t){var o=t.pointList;if(!(o.length<2)){var r=Math.min(t.pointList.length,Math.round(t.pointListLength||t.pointList.length));if(t.smooth&&"spline"!==t.smooth){var s=i(o,t.smooth,!1,t.smoothConstraint);e.moveTo(o[0][0],o[0][1]);for(var l,h,m,V=0;r-1>V;V++)l=s[2*V],h=s[2*V+1],m=o[V+1],e.bezierCurveTo(l[0],l[1],h[0],h[1],m[0],m[1])}else if("spline"===t.smooth&&(o=n(o),r=o.length),t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var U=(t.lineWidth||1)*("dashed"==t.lineType?5:1);e.moveTo(o[0][0],o[0][1]);for(var V=1;r>V;V++)a(e,o[V-1][0],o[V-1][1],o[V][0],o[V][1],U)}}else{e.moveTo(o[0][0],o[0][1]);for(var V=1;r>V;V++)e.lineTo(o[V][0],o[V][1])}}},getRect:function(t){return e("./Polygon").prototype.getRect(t)}},e("../tool/util").inherits(o,t),o}),n("zrender/shape/util/dashedLineTo",[],function(){var e=[5,5];return function(t,n,i,a,o,r){if(t.setLineDash)return e[0]=e[1]=r,t.setLineDash(e),t.moveTo(n,i),void t.lineTo(a,o);r="number"!=typeof r?5:r;var s=a-n,l=o-i,h=Math.floor(Math.sqrt(s*s+l*l)/r);s/=h,l/=h;for(var m=!0,V=0;h>V;++V)m?t.moveTo(n,i):t.lineTo(n,i),m=!m,n+=s,i+=l;t.lineTo(a,o)}}),n("zrender/shape/util/smoothSpline",["require","../../tool/vector"],function(e){function t(e,t,n,i,a,o,r){var s=.5*(n-e),l=.5*(i-t);return(2*(t-n)+s+l)*r+(-3*(t-n)-2*s-l)*o+s*a+t}var n=e("../../tool/vector");return function(e,i){for(var a=e.length,o=[],r=0,s=1;a>s;s++)r+=n.distance(e[s-1],e[s]);var l=r/5;l=a>l?a:l;for(var s=0;l>s;s++){var h,m,V,U=s/(l-1)*(i?a:a-1),d=Math.floor(U),p=U-d,c=e[d%a];i?(h=e[(d-1+a)%a],m=e[(d+1)%a],V=e[(d+2)%a]):(h=e[0===d?d:d-1],m=e[d>a-2?a-1:d+1],V=e[d>a-3?a-1:d+2]);var u=p*p,y=p*u;o.push([t(h[0],c[0],m[0],V[0],p,u,y),t(h[1],c[1],m[1],V[1],p,u,y)])}return o}}),n("zrender/shape/util/smoothBezier",["require","../../tool/vector"],function(e){var t=e("../../tool/vector");return function(e,n,i,a){var o,r,s,l,h=[],m=[],V=[],U=[],d=!!a;if(d){s=[1/0,1/0],l=[-1/0,-1/0];for(var p=0,c=e.length;c>p;p++)t.min(s,s,e[p]),t.max(l,l,e[p]);t.min(s,s,a[0]),t.max(l,l,a[1])}for(var p=0,c=e.length;c>p;p++){var o,r,u=e[p];if(i)o=e[p?p-1:c-1],r=e[(p+1)%c];else{if(0===p||p===c-1){h.push(e[p]);continue}o=e[p-1],r=e[p+1]}t.sub(m,r,o),t.scale(m,m,n);var y=t.distance(u,o),g=t.distance(u,r),b=y+g;0!==b&&(y/=b,g/=b),t.scale(V,m,-y),t.scale(U,m,g);var f=t.add([],u,V),k=t.add([],u,U);d&&(t.max(f,f,s),t.min(f,f,l),t.max(k,k,s),t.min(k,k,l)),h.push(f),h.push(k)}return i&&h.push(h.shift()),h}}),n("zrender/shape/Polygon",["require","./Base","./util/smoothSpline","./util/smoothBezier","./util/dashedLineTo","../tool/util"],function(e){var t=e("./Base"),n=e("./util/smoothSpline"),i=e("./util/smoothBezier"),a=e("./util/dashedLineTo"),o=function(e){t.call(this,e)};return o.prototype={type:"polygon",buildPath:function(e,t){var o=t.pointList;if(!(o.length<2)){if(t.smooth&&"spline"!==t.smooth){var r=i(o,t.smooth,!0,t.smoothConstraint);e.moveTo(o[0][0],o[0][1]);for(var s,l,h,m=o.length,V=0;m>V;V++)s=r[2*V],l=r[2*V+1],h=o[(V+1)%m],e.bezierCurveTo(s[0],s[1],l[0],l[1],h[0],h[1])}else if("spline"===t.smooth&&(o=n(o,!0)),t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var U=t._dashLength||(t.lineWidth||1)*("dashed"==t.lineType?5:1);t._dashLength=U,e.moveTo(o[0][0],o[0][1]);for(var V=1,d=o.length;d>V;V++)a(e,o[V-1][0],o[V-1][1],o[V][0],o[V][1],U);a(e,o[o.length-1][0],o[o.length-1][1],o[0][0],o[0][1],U)}}else{e.moveTo(o[0][0],o[0][1]);for(var V=1,d=o.length;d>V;V++)e.lineTo(o[V][0],o[V][1]);e.lineTo(o[0][0],o[0][1])}e.closePath()}},getRect:function(e){if(e.__rect)return e.__rect;for(var t=Number.MAX_VALUE,n=Number.MIN_VALUE,i=Number.MAX_VALUE,a=Number.MIN_VALUE,o=e.pointList,r=0,s=o.length;s>r;r++)o[r][0]<t&&(t=o[r][0]),o[r][0]>n&&(n=o[r][0]),o[r][1]<i&&(i=o[r][1]),o[r][1]>a&&(a=o[r][1]);var l;return l="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(t-l/2),y:Math.round(i-l/2),width:n-t+l,height:a-i+l},e.__rect}},e("../tool/util").inherits(o,t),o}),n("echarts/util/shape/normalIsCover",[],function(){return function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var i=this.style.__rect;return i||(i=this.style.__rect=this.getRect(this.style)),e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height}}),n("echarts/util/ecQuery",["require","zrender/tool/util"],function(e){function t(e,t){if("undefined"!=typeof e){if(!t)return e;t=t.split(".");for(var n=t.length,i=0;n>i;){if(e=e[t[i]],"undefined"==typeof e)return;i++}return e}}function n(e,n){for(var i,a=0,o=e.length;o>a;a++)if(i=t(e[a],n),"undefined"!=typeof i)return i}function i(e,n){for(var i,o=e.length;o--;){var r=t(e[o],n);"undefined"!=typeof r&&("undefined"==typeof i?i=a.clone(r):a.merge(i,r,!0))}return i}var a=e("zrender/tool/util");return{query:t,deepQuery:n,deepMerge:i}}),n("echarts/util/number",[],function(){function e(e){return e.replace(/^\s+/,"").replace(/\s+$/,"")}function t(t,n){return"string"==typeof t?e(t).match(/%$/)?parseFloat(t)/100*n:parseFloat(t):t}function n(e,n){return[t(n[0],e.getWidth()),t(n[1],e.getHeight())]}function i(e,n){n instanceof Array||(n=[0,n]);var i=Math.min(e.getWidth(),e.getHeight())/2;return[t(n[0],i),t(n[1],i)]}function a(e){return isNaN(e)?"-":(e=(e+"").split("."),e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:""))}return{parsePercent:t,parseCenter:n,parseRadius:i,addCommas:a}}),n("echarts/component/dataView",["require","./base","../config","zrender/tool/util","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.dom=o.dom,this._tDom=document.createElement("div"),this._textArea=document.createElement("textArea"),this._buttonRefresh=document.createElement("button"),this._buttonClose=document.createElement("button"),this._hasShow=!1,this._zrHeight=i.getHeight(),this._zrWidth=i.getWidth(),this._tDom.className="echarts-dataview",this.hide(),this.dom.firstChild.appendChild(this._tDom),window.addEventListener?(this._tDom.addEventListener("click",this._stop),this._tDom.addEventListener("mousewheel",this._stop),this._tDom.addEventListener("mousemove",this._stop),this._tDom.addEventListener("mousedown",this._stop),this._tDom.addEventListener("mouseup",this._stop),this._tDom.addEventListener("touchstart",this._stop),this._tDom.addEventListener("touchmove",this._stop),this._tDom.addEventListener("touchend",this._stop)):(this._tDom.attachEvent("onclick",this._stop),this._tDom.attachEvent("onmousewheel",this._stop),this._tDom.attachEvent("onmousemove",this._stop),this._tDom.attachEvent("onmousedown",this._stop),this._tDom.attachEvent("onmouseup",this._stop))}var n=e("./base"),i=e("../config"),a=e("zrender/tool/util");return t.prototype={type:i.COMPONENT_TYPE_DATAVIEW,_lang:["Data View","close","refresh"],_gCssText:"position:absolute;display:block;overflow:hidden;transition:height 0.8s,background-color 1s;-moz-transition:height 0.8s,background-color 1s;-webkit-transition:height 0.8s,background-color 1s;-o-transition:height 0.8s,background-color 1s;z-index:1;left:0;top:0;",hide:function(){this._sizeCssText="width:"+this._zrWidth+"px;height:0px;background-color:#f0ffff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},show:function(e){this._hasShow=!0;var t=this.query(this.option,"toolbox.feature.dataView.lang")||this._lang;this.option=e,this._tDom.innerHTML='<p style="padding:8px 0;margin:0 0 10px 0;border-bottom:1px solid #eee">'+(t[0]||this._lang[0])+"</p>",this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;height:"+(this._zrHeight-100)+"px;";var n=this.query(this.option,"toolbox.feature.dataView.optionToContent");this._textArea.value="function"!=typeof n?this._optionToContent():n(this.option),this._tDom.appendChild(this._textArea),this._buttonClose.style.cssText="float:right;padding:1px 6px;",this._buttonClose.innerHTML=t[1]||this._lang[1];var i=this;this._buttonClose.onclick=function(){i.hide()},this._tDom.appendChild(this._buttonClose),this.query(this.option,"toolbox.feature.dataView.readOnly")===!1?(this._buttonRefresh.style.cssText="float:right;margin-right:10px;padding:1px 6px;",this._buttonRefresh.innerHTML=t[2]||this._lang[2],this._buttonRefresh.onclick=function(){i._save()},this._tDom.appendChild(this._buttonRefresh),this._textArea.readOnly=!1,this._textArea.style.cursor="default"):(this._textArea.readOnly=!0,this._textArea.style.cursor="text"),this._sizeCssText="width:"+this._zrWidth+"px;height:"+this._zrHeight+"px;background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText},_optionToContent:function(){var e,t,n,a,o,r,s=[],l="";if(this.option.xAxis)for(s=this.option.xAxis instanceof Array?this.option.xAxis:[this.option.xAxis],e=0,a=s.length;a>e;e++)if("category"==(s[e].type||"category")){for(r=[],t=0,n=s[e].data.length;n>t;t++)r.push(this.getDataFromOption(s[e].data[t]));l+=r.join(", ")+"\n\n"}if(this.option.yAxis)for(s=this.option.yAxis instanceof Array?this.option.yAxis:[this.option.yAxis],e=0,a=s.length;a>e;e++)if("category"==s[e].type){for(r=[],t=0,n=s[e].data.length;n>t;t++)r.push(this.getDataFromOption(s[e].data[t]));l+=r.join(", ")+"\n\n"}var h,m=this.option.series;for(e=0,a=m.length;a>e;e++){for(r=[],t=0,n=m[e].data.length;n>t;t++)o=m[e].data[t],h=m[e].type==i.CHART_TYPE_PIE||m[e].type==i.CHART_TYPE_MAP?(o.name||"-")+":":"",m[e].type==i.CHART_TYPE_SCATTER&&(o=this.getDataFromOption(o).join(", ")),r.push(h+this.getDataFromOption(o));l+=(m[e].name||"-")+" : \n",l+=r.join(m[e].type==i.CHART_TYPE_SCATTER?"\n":", "),l+="\n\n"}return l},_save:function(){var e=this._textArea.value,t=this.query(this.option,"toolbox.feature.dataView.contentToOption");if("function"!=typeof t){e=e.split("\n");for(var n=[],a=0,o=e.length;o>a;a++)e[a]=this._trim(e[a]),""!==e[a]&&n.push(e[a]);this._contentToOption(n)}else t(e,this.option);this.hide();var r=this;setTimeout(function(){r.messageCenter&&r.messageCenter.dispatch(i.EVENT.DATA_VIEW_CHANGED,null,{option:r.option},r.myChart)},r.canvasSupported?800:100)},_contentToOption:function(e){var t,n,a,o,r,s,l,h=[],m=0;if(this.option.xAxis)for(h=this.option.xAxis instanceof Array?this.option.xAxis:[this.option.xAxis],t=0,o=h.length;o>t;t++)if("category"==(h[t].type||"category")){for(s=e[m].split(","),n=0,a=h[t].data.length;a>n;n++)l=this._trim(s[n]||""),r=h[t].data[n],"undefined"!=typeof h[t].data[n].value?h[t].data[n].value=l:h[t].data[n]=l;m++}if(this.option.yAxis)for(h=this.option.yAxis instanceof Array?this.option.yAxis:[this.option.yAxis],t=0,o=h.length;o>t;t++)if("category"==h[t].type){for(s=e[m].split(","),n=0,a=h[t].data.length;a>n;n++)l=this._trim(s[n]||""),r=h[t].data[n],"undefined"!=typeof h[t].data[n].value?h[t].data[n].value=l:h[t].data[n]=l;m++}var V=this.option.series;for(t=0,o=V.length;o>t;t++)if(m++,V[t].type==i.CHART_TYPE_SCATTER)for(var n=0,a=V[t].data.length;a>n;n++)s=e[m],l=s.replace(" ","").split(","),"undefined"!=typeof V[t].data[n].value?V[t].data[n].value=l:V[t].data[n]=l,m++;else{s=e[m].split(",");for(var n=0,a=V[t].data.length;a>n;n++)l=(s[n]||"").replace(/.*:/,""),l=this._trim(l),l="-"!=l&&""!==l?l-0:"-","undefined"!=typeof V[t].data[n].value?V[t].data[n].value=l:V[t].data[n]=l;m++}},_trim:function(e){var t=new RegExp("(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+$)","g");return e.replace(t,"")},_stop:function(e){e=e||window.event,e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},resize:function(){this._zrHeight=this.zr.getHeight(),this._zrWidth=this.zr.getWidth(),this._tDom.offsetHeight>10&&(this._sizeCssText="width:"+this._zrWidth+"px;height:"+this._zrHeight+"px;background-color:#fff;",this._tDom.style.cssText=this._gCssText+this._sizeCssText,this._textArea.style.cssText="display:block;margin:0 0 8px 0;padding:4px 6px;overflow:auto;width:"+(this._zrWidth-15)+"px;height:"+(this._zrHeight-100)+"px;")},dispose:function(){window.removeEventListener?(this._tDom.removeEventListener("click",this._stop),this._tDom.removeEventListener("mousewheel",this._stop),this._tDom.removeEventListener("mousemove",this._stop),this._tDom.removeEventListener("mousedown",this._stop),this._tDom.removeEventListener("mouseup",this._stop),this._tDom.removeEventListener("touchstart",this._stop),this._tDom.removeEventListener("touchmove",this._stop),this._tDom.removeEventListener("touchend",this._stop)):(this._tDom.detachEvent("onclick",this._stop),this._tDom.detachEvent("onmousewheel",this._stop),this._tDom.detachEvent("onmousemove",this._stop),this._tDom.detachEvent("onmousedown",this._stop),this._tDom.detachEvent("onmouseup",this._stop)),this._buttonRefresh.onclick=null,this._buttonClose.onclick=null,this._hasShow&&(this._tDom.removeChild(this._textArea),this._tDom.removeChild(this._buttonRefresh),this._tDom.removeChild(this._buttonClose)),this._textArea=null,this._buttonRefresh=null,this._buttonClose=null,this.dom.firstChild.removeChild(this._tDom),this._tDom=null}},a.inherits(t,n),e("../component").define("dataView",t),t}),n("echarts/util/shape/Cross",["require","zrender/shape/Base","zrender/shape/Line","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/shape/Line"),a=e("zrender/tool/util");return t.prototype={type:"cross",buildPath:function(e,t){var n=t.rect;t.xStart=n.x,t.xEnd=n.x+n.width,t.yStart=t.yEnd=t.y,i.prototype.buildPath(e,t),t.xStart=t.xEnd=t.x,t.yStart=n.y,t.yEnd=n.y+n.height,i.prototype.buildPath(e,t)},getRect:function(e){return e.rect},isCover:e("./normalIsCover")},a.inherits(t,n),t}),n("zrender/shape/Sector",["require","../tool/math","../tool/computeBoundingBox","../tool/vector","./Base","../tool/util"],function(e){var t=e("../tool/math"),n=e("../tool/computeBoundingBox"),i=e("../tool/vector"),a=e("./Base"),o=i.create(),r=i.create(),s=i.create(),l=i.create(),h=function(e){a.call(this,e)};return h.prototype={type:"sector",buildPath:function(e,n){var i=n.x,a=n.y,o=n.r0||0,r=n.r,s=n.startAngle,l=n.endAngle,h=n.clockWise||!1;s=t.degreeToRadian(s),l=t.degreeToRadian(l),h||(s=-s,l=-l);var m=t.cos(s),V=t.sin(s);e.moveTo(m*o+i,V*o+a),e.lineTo(m*r+i,V*r+a),e.arc(i,a,r,s,l,!h),e.lineTo(t.cos(l)*o+i,t.sin(l)*o+a),0!==o&&e.arc(i,a,o,l,s,h),e.closePath()},getRect:function(e){if(e.__rect)return e.__rect;var a=e.x,h=e.y,m=e.r0||0,V=e.r,U=t.degreeToRadian(e.startAngle),d=t.degreeToRadian(e.endAngle),p=e.clockWise;return p||(U=-U,d=-d),m>1?n.arc(a,h,m,U,d,!p,o,s):(o[0]=s[0]=a,o[1]=s[1]=h),n.arc(a,h,V,U,d,!p,r,l),i.min(o,o,r),i.max(s,s,l),e.__rect={x:o[0],y:o[1],width:s[0]-o[0],height:s[1]-o[1]},e.__rect}},e("../tool/util").inherits(h,a),h}),n("echarts/util/shape/Candle",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/tool/util");return t.prototype={type:"candle",_numberOrder:function(e,t){return t-e},buildPath:function(e,t){var n=i.clone(t.y).sort(this._numberOrder);e.moveTo(t.x,n[3]),e.lineTo(t.x,n[2]),e.moveTo(t.x-t.width/2,n[2]),e.rect(t.x-t.width/2,n[2],t.width,n[1]-n[2]),e.moveTo(t.x,n[1]),e.lineTo(t.x,n[0])},getRect:function(e){if(!e.__rect){var t=0;("stroke"==e.brushType||"fill"==e.brushType)&&(t=e.lineWidth||1);var n=i.clone(e.y).sort(this._numberOrder);e.__rect={x:Math.round(e.x-e.width/2-t/2),y:Math.round(n[3]-t/2),width:e.width+t,height:n[0]-n[3]+t}}return e.__rect},isCover:e("./normalIsCover")},i.inherits(t,n),t}),n("zrender/tool/computeBoundingBox",["require","./vector","./curve"],function(e){function t(e,t,n){if(0!==e.length){for(var i=e[0][0],a=e[0][0],o=e[0][1],r=e[0][1],s=1;s<e.length;s++){var l=e[s];l[0]<i&&(i=l[0]),l[0]>a&&(a=l[0]),l[1]<o&&(o=l[1]),l[1]>r&&(r=l[1])}t[0]=i,t[1]=o,n[0]=a,n[1]=r}}function n(e,t,n,i,a,r){var s=[];o.cubicExtrema(e[0],t[0],n[0],i[0],s);for(var l=0;l<s.length;l++)s[l]=o.cubicAt(e[0],t[0],n[0],i[0],s[l]);var h=[];o.cubicExtrema(e[1],t[1],n[1],i[1],h);for(var l=0;l<h.length;l++)h[l]=o.cubicAt(e[1],t[1],n[1],i[1],h[l]);s.push(e[0],i[0]),h.push(e[1],i[1]);var m=Math.min.apply(null,s),V=Math.max.apply(null,s),U=Math.min.apply(null,h),d=Math.max.apply(null,h);a[0]=m,a[1]=U,r[0]=V,r[1]=d}function i(e,t,n,i,a){var r=o.quadraticExtremum(e[0],t[0],n[0]),s=o.quadraticExtremum(e[1],t[1],n[1]);r=Math.max(Math.min(r,1),0),s=Math.max(Math.min(s,1),0);var l=1-r,h=1-s,m=l*l*e[0]+2*l*r*t[0]+r*r*n[0],V=l*l*e[1]+2*l*r*t[1]+r*r*n[1],U=h*h*e[0]+2*h*s*t[0]+s*s*n[0],d=h*h*e[1]+2*h*s*t[1]+s*s*n[1];i[0]=Math.min(e[0],n[0],m,U),i[1]=Math.min(e[1],n[1],V,d),a[0]=Math.max(e[0],n[0],m,U),a[1]=Math.max(e[1],n[1],V,d)}var a=e("./vector"),o=e("./curve"),r=a.create(),s=a.create(),l=a.create(),h=function(e,t,n,i,o,h,m,V){if(Math.abs(i-o)>=2*Math.PI)return m[0]=e-n,m[1]=t-n,V[0]=e+n,void(V[1]=t+n);if(r[0]=Math.cos(i)*n+e,r[1]=Math.sin(i)*n+t,s[0]=Math.cos(o)*n+e,s[1]=Math.sin(o)*n+t,a.min(m,r,s),a.max(V,r,s),i%=2*Math.PI,0>i&&(i+=2*Math.PI),o%=2*Math.PI,0>o&&(o+=2*Math.PI),i>o&&!h?o+=2*Math.PI:o>i&&h&&(i+=2*Math.PI),h){var U=o;o=i,i=U}for(var d=0;o>d;d+=Math.PI/2)d>i&&(l[0]=Math.cos(d)*n+e,l[1]=Math.sin(d)*n+t,a.min(m,l,m),a.max(V,l,V))};return t.cubeBezier=n,t.quadraticBezier=i,t.arc=h,t}),n("echarts/util/shape/Chain",["require","zrender/shape/Base","./Icon","zrender/shape/util/dashedLineTo","zrender/tool/util","zrender/tool/matrix"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("./Icon"),a=e("zrender/shape/util/dashedLineTo"),o=e("zrender/tool/util"),r=e("zrender/tool/matrix");return t.prototype={type:"chain",brush:function(e,t){var n=this.style;t&&(n=this.getHighlightStyle(n,this.highlightStyle||{})),e.save(),this.setContext(e,n),this.setTransform(e),e.save(),e.beginPath(),this.buildLinePath(e,n),e.stroke(),e.restore(),this.brushSymbol(e,n),e.restore()},buildLinePath:function(e,t){var n=t.x,i=t.y+5,o=t.width,r=t.height/2-10;if(e.moveTo(n,i),e.lineTo(n,i+r),e.moveTo(n+o,i),e.lineTo(n+o,i+r),e.moveTo(n,i+r/2),t.lineType&&"solid"!=t.lineType){if("dashed"==t.lineType||"dotted"==t.lineType){var s=(t.lineWidth||1)*("dashed"==t.lineType?5:1);a(e,n,i+r/2,n+o,i+r/2,s)}}else e.lineTo(n+o,i+r/2)},brushSymbol:function(e,t){var n=t.y+t.height/4;e.save();for(var a,o=t.chainPoint,r=0,s=o.length;s>r;r++){if(a=o[r],"none"!=a.symbol){e.beginPath();var l=a.symbolSize;i.prototype.buildPath(e,{iconType:a.symbol,x:a.x-l,y:n-l,width:2*l,height:2*l,n:a.n}),e.fillStyle=a.isEmpty?"#fff":t.strokeColor,e.closePath(),e.fill(),e.stroke()}a.showLabel&&(e.font=a.textFont,e.fillStyle=a.textColor,e.textAlign=a.textAlign,e.textBaseline=a.textBaseline,a.rotation?(e.save(),this._updateTextTransform(e,a.rotation),e.fillText(a.name,a.textX,a.textY),e.restore()):e.fillText(a.name,a.textX,a.textY))}e.restore()},_updateTextTransform:function(e,t){var n=r.create();if(r.identity(n),0!==t[0]){var i=t[1]||0,a=t[2]||0;(i||a)&&r.translate(n,n,[-i,-a]),r.rotate(n,n,t[0]),(i||a)&&r.translate(n,n,[i,a])}e.transform.apply(e,n)},isCover:function(e,t){var n=this.style;return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height?!0:!1}},o.inherits(t,n),t
-}),n("zrender/shape/Ring",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"ring",buildPath:function(e,t){e.arc(t.x,t.y,t.r,0,2*Math.PI,!1),e.moveTo(t.x+t.r0,t.y),e.arc(t.x,t.y,t.r0,0,2*Math.PI,!0)},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-e.r-t/2),y:Math.round(e.y-e.r-t/2),width:2*e.r+t,height:2*e.r+t},e.__rect}},e("../tool/util").inherits(n,t),n}),n("echarts/component/axis",["require","./base","zrender/shape/Line","../config","../util/ecData","zrender/tool/util","zrender/tool/color","./categoryAxis","./valueAxis","../component"],function(e){function t(e,t,i,a,o,r){n.call(this,e,t,i,a,o),this.axisType=r,this._axisList=[],this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Line"),a=e("../config"),o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:a.COMPONENT_TYPE_AXIS,axisBase:{_buildAxisLine:function(){var e=this.option.axisLine.lineStyle.width,t=e/2,n={_axisShape:"axisLine",zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1},a=this.grid;switch(this.option.position){case"left":n.style={xStart:a.getX()-t,yStart:a.getYend(),xEnd:a.getX()-t,yEnd:a.getY(),lineCap:"round"};break;case"right":n.style={xStart:a.getXend()+t,yStart:a.getYend(),xEnd:a.getXend()+t,yEnd:a.getY(),lineCap:"round"};break;case"bottom":n.style={xStart:a.getX(),yStart:a.getYend()+t,xEnd:a.getXend(),yEnd:a.getYend()+t,lineCap:"round"};break;case"top":n.style={xStart:a.getX(),yStart:a.getY()-t,xEnd:a.getXend(),yEnd:a.getY()-t,lineCap:"round"}}var o=n.style;""!==this.option.name&&(o.text=this.option.name,o.textPosition=this.option.nameLocation,o.textFont=this.getFont(this.option.nameTextStyle),this.option.nameTextStyle.align&&(o.textAlign=this.option.nameTextStyle.align),this.option.nameTextStyle.baseline&&(o.textBaseline=this.option.nameTextStyle.baseline),this.option.nameTextStyle.color&&(o.textColor=this.option.nameTextStyle.color)),o.strokeColor=this.option.axisLine.lineStyle.color,o.lineWidth=e,this.isHorizontal()?o.yStart=o.yEnd=this.subPixelOptimize(o.yEnd,e):o.xStart=o.xEnd=this.subPixelOptimize(o.xEnd,e),o.lineType=this.option.axisLine.lineStyle.type,n=new i(n),this.shapeList.push(n)},_axisLabelClickable:function(e,t){return e?(o.pack(t,void 0,-1,void 0,-1,t.style.text),t.hoverable=!0,t.clickable=!0,t.highlightStyle={color:s.lift(t.style.color,1),brushType:"fill"},t):t},refixAxisShape:function(e,t){if(this.option.axisLine.onZero){var n;if(this.isHorizontal()&&null!=t)for(var i=0,a=this.shapeList.length;a>i;i++)"axisLine"===this.shapeList[i]._axisShape?(this.shapeList[i].style.yStart=this.shapeList[i].style.yEnd=this.subPixelOptimize(t,this.shapeList[i].stylelineWidth),this.zr.modShape(this.shapeList[i].id)):"axisTick"===this.shapeList[i]._axisShape&&(n=this.shapeList[i].style.yEnd-this.shapeList[i].style.yStart,this.shapeList[i].style.yStart=t-n,this.shapeList[i].style.yEnd=t,this.zr.modShape(this.shapeList[i].id));if(!this.isHorizontal()&&null!=e)for(var i=0,a=this.shapeList.length;a>i;i++)"axisLine"===this.shapeList[i]._axisShape?(this.shapeList[i].style.xStart=this.shapeList[i].style.xEnd=this.subPixelOptimize(e,this.shapeList[i].stylelineWidth),this.zr.modShape(this.shapeList[i].id)):"axisTick"===this.shapeList[i]._axisShape&&(n=this.shapeList[i].style.xEnd-this.shapeList[i].style.xStart,this.shapeList[i].style.xStart=e,this.shapeList[i].style.xEnd=e+n,this.zr.modShape(this.shapeList[i].id))}},getPosition:function(){return this.option.position},isHorizontal:function(){return"bottom"===this.option.position||"top"===this.option.position}},reformOption:function(e){if(!e||e instanceof Array&&0===e.length?e=[{type:a.COMPONENT_TYPE_AXIS_VALUE}]:e instanceof Array||(e=[e]),e.length>2&&(e=[e[0],e[1]]),"xAxis"===this.axisType){(!e[0].position||"bottom"!=e[0].position&&"top"!=e[0].position)&&(e[0].position="bottom"),e.length>1&&(e[1].position="bottom"===e[0].position?"top":"bottom");for(var t=0,n=e.length;n>t;t++)e[t].type=e[t].type||"category",e[t].xAxisIndex=t,e[t].yAxisIndex=-1}else{(!e[0].position||"left"!=e[0].position&&"right"!=e[0].position)&&(e[0].position="left"),e.length>1&&(e[1].position="left"===e[0].position?"right":"left");for(var t=0,n=e.length;n>t;t++)e[t].type=e[t].type||"value",e[t].xAxisIndex=-1,e[t].yAxisIndex=t}return e},refresh:function(t){var n;t&&(this.option=t,"xAxis"===this.axisType?(this.option.xAxis=this.reformOption(t.xAxis),n=this.option.xAxis):(this.option.yAxis=this.reformOption(t.yAxis),n=this.option.yAxis),this.series=t.series);for(var i=e("./categoryAxis"),a=e("./valueAxis"),o=Math.max(n&&n.length||0,this._axisList.length),r=0;o>r;r++)!this._axisList[r]||!t||n[r]&&this._axisList[r].type==n[r].type||(this._axisList[r].dispose&&this._axisList[r].dispose(),this._axisList[r]=!1),this._axisList[r]?this._axisList[r].refresh&&this._axisList[r].refresh(n?n[r]:!1,this.series):n&&n[r]&&(this._axisList[r]="category"===n[r].type?new i(this.ecTheme,this.messageCenter,this.zr,n[r],this.myChart,this.axisBase):new a(this.ecTheme,this.messageCenter,this.zr,n[r],this.myChart,this.axisBase,this.series))},getAxis:function(e){return this._axisList[e]},clear:function(){for(var e=0,t=this._axisList.length;t>e;e++)this._axisList[e].dispose&&this._axisList[e].dispose();this._axisList=[]}},r.inherits(t,n),e("../component").define("axis",t),t}),n("echarts/component/grid",["require","./base","zrender/shape/Rectangle","../config","zrender/tool/util","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Rectangle"),a=e("../config");a.grid={zlevel:0,z:0,x:80,y:60,x2:80,y2:60,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"};var o=e("zrender/tool/util");return t.prototype={type:a.COMPONENT_TYPE_GRID,getX:function(){return this._x},getY:function(){return this._y},getWidth:function(){return this._width},getHeight:function(){return this._height},getXend:function(){return this._x+this._width},getYend:function(){return this._y+this._height},getArea:function(){return{x:this._x,y:this._y,width:this._width,height:this._height}},getBbox:function(){return[[this._x,this._y],[this.getXend(),this.getYend()]]},refixAxisShape:function(e){for(var t,n,i,o=e.xAxis._axisList.concat(e.yAxis?e.yAxis._axisList:[]),r=o.length;r--;)i=o[r],i.type==a.COMPONENT_TYPE_AXIS_VALUE&&i._min<0&&i._max>=0&&(i.isHorizontal()?t=i.getCoord(0):n=i.getCoord(0));if("undefined"!=typeof t||"undefined"!=typeof n)for(r=o.length;r--;)o[r].refixAxisShape(t,n)},refresh:function(e){if(e||this._zrWidth!=this.zr.getWidth()||this._zrHeight!=this.zr.getHeight()){this.clear(),this.option=e||this.option,this.option.grid=this.reformOption(this.option.grid);var t=this.option.grid;this._zrWidth=this.zr.getWidth(),this._zrHeight=this.zr.getHeight(),this._x=this.parsePercent(t.x,this._zrWidth),this._y=this.parsePercent(t.y,this._zrHeight);var n=this.parsePercent(t.x2,this._zrWidth),a=this.parsePercent(t.y2,this._zrHeight);this._width="undefined"==typeof t.width?this._zrWidth-this._x-n:this.parsePercent(t.width,this._zrWidth),this._width=this._width<=0?10:this._width,this._height="undefined"==typeof t.height?this._zrHeight-this._y-a:this.parsePercent(t.height,this._zrHeight),this._height=this._height<=0?10:this._height,this._x=this.subPixelOptimize(this._x,t.borderWidth),this._y=this.subPixelOptimize(this._y,t.borderWidth),this.shapeList.push(new i({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._x,y:this._y,width:this._width,height:this._height,brushType:t.borderWidth>0?"both":"fill",color:t.backgroundColor,strokeColor:t.borderColor,lineWidth:t.borderWidth}})),this.zr.addShape(this.shapeList[0])}}},o.inherits(t,n),e("../component").define("grid",t),t}),n("echarts/component/dataZoom",["require","./base","zrender/shape/Rectangle","zrender/shape/Polygon","../util/shape/Icon","../config","../util/date","zrender/tool/util","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o);var r=this;r._ondrift=function(e,t){return r.__ondrift(this,e,t)},r._ondragend=function(){return r.__ondragend()},this._fillerSize=30,this._isSilence=!1,this._zoom={},this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this._handleSize=this.zoomOption.handleSize,this.myChart.canvasSupported||(this.zoomOption.realtime=!1),this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom.show&&this._buildShape(),this._syncData()}var n=e("./base"),i=e("zrender/shape/Rectangle"),a=e("zrender/shape/Polygon"),o=e("../util/shape/Icon"),r=e("../config");r.dataZoom={zlevel:0,z:4,show:!1,orient:"horizontal",backgroundColor:"rgba(0,0,0,0)",dataBackgroundColor:"#eee",fillerColor:"rgba(144,197,237,0.2)",handleColor:"rgba(70,130,180,0.8)",handleSize:8,showDetail:!0,realtime:!0};var s=e("../util/date"),l=e("zrender/tool/util");return t.prototype={type:r.COMPONENT_TYPE_DATAZOOM,_buildShape:function(){this._buildBackground(),this._buildFiller(),this._buildHandle(),this._buildFrame();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e]);this._syncFrameShape()},_getLocation:function(){var e,t,n,i,a=this.component.grid;return"horizontal"==this.zoomOption.orient?(n=this.zoomOption.width||a.getWidth(),i=this.zoomOption.height||this._fillerSize,e=null!=this.zoomOption.x?this.zoomOption.x:a.getX(),t=null!=this.zoomOption.y?this.zoomOption.y:this.zr.getHeight()-i-2):(n=this.zoomOption.width||this._fillerSize,i=this.zoomOption.height||a.getHeight(),e=null!=this.zoomOption.x?this.zoomOption.x:2,t=null!=this.zoomOption.y?this.zoomOption.y:a.getY()),{x:e,y:t,width:n,height:i}},_getZoom:function(){var e=this.option.series,t=this.option.xAxis;!t||t instanceof Array||(t=[t],this.option.xAxis=t);var n=this.option.yAxis;!n||n instanceof Array||(n=[n],this.option.yAxis=n);var i,a,o=[],s=this.zoomOption.xAxisIndex;if(t&&null==s){i=[];for(var l=0,h=t.length;h>l;l++)("category"==t[l].type||null==t[l].type)&&i.push(l)}else i=s instanceof Array?s:null!=s?[s]:[];if(s=this.zoomOption.yAxisIndex,n&&null==s){a=[];for(var l=0,h=n.length;h>l;l++)"category"==n[l].type&&a.push(l)}else a=s instanceof Array?s:null!=s?[s]:[];for(var m,l=0,h=e.length;h>l;l++)if(m=e[l],m.type==r.CHART_TYPE_LINE||m.type==r.CHART_TYPE_BAR||m.type==r.CHART_TYPE_SCATTER||m.type==r.CHART_TYPE_K){for(var V=0,U=i.length;U>V;V++)if(i[V]==(m.xAxisIndex||0)){o.push(l);break}for(var V=0,U=a.length;U>V;V++)if(a[V]==(m.yAxisIndex||0)){o.push(l);break}null==this.zoomOption.xAxisIndex&&null==this.zoomOption.yAxisIndex&&m.data&&this.getDataFromOption(m.data[0])instanceof Array&&(m.type==r.CHART_TYPE_SCATTER||m.type==r.CHART_TYPE_LINE||m.type==r.CHART_TYPE_BAR)&&o.push(l)}var d=null!=this._zoom.start?this._zoom.start:null!=this.zoomOption.start?this.zoomOption.start:0,p=null!=this._zoom.end?this._zoom.end:null!=this.zoomOption.end?this.zoomOption.end:100;d>p&&(d+=p,p=d-p,d-=p);var c=Math.round((p-d)/100*("horizontal"==this.zoomOption.orient?this._location.width:this._location.height));return{start:d,end:p,start2:0,end2:100,size:c,xAxisIndex:i,yAxisIndex:a,seriesIndex:o,scatterMap:this._zoom.scatterMap||{}}},_backupData:function(){this._originalData={xAxis:{},yAxis:{},series:{}};for(var e=this.option.xAxis,t=this._zoom.xAxisIndex,n=0,i=t.length;i>n;n++)this._originalData.xAxis[t[n]]=e[t[n]].data;for(var a=this.option.yAxis,o=this._zoom.yAxisIndex,n=0,i=o.length;i>n;n++)this._originalData.yAxis[o[n]]=a[o[n]].data;for(var s,l=this.option.series,h=this._zoom.seriesIndex,n=0,i=h.length;i>n;n++)s=l[h[n]],this._originalData.series[h[n]]=s.data,s.data&&this.getDataFromOption(s.data[0])instanceof Array&&(s.type==r.CHART_TYPE_SCATTER||s.type==r.CHART_TYPE_LINE||s.type==r.CHART_TYPE_BAR)&&(this._backupScale(),this._calculScatterMap(h[n]))},_calculScatterMap:function(t){this._zoom.scatterMap=this._zoom.scatterMap||{},this._zoom.scatterMap[t]=this._zoom.scatterMap[t]||{};var n=e("../component"),i=n.get("axis"),a=l.clone(this.option.xAxis);"category"==a[0].type&&(a[0].type="value"),a[1]&&"category"==a[1].type&&(a[1].type="value");var o=new i(this.ecTheme,null,!1,{xAxis:a,series:this.option.series},this,"xAxis"),r=this.option.series[t].xAxisIndex||0;this._zoom.scatterMap[t].x=o.getAxis(r).getExtremum(),o.dispose(),a=l.clone(this.option.yAxis),"category"==a[0].type&&(a[0].type="value"),a[1]&&"category"==a[1].type&&(a[1].type="value"),o=new i(this.ecTheme,null,!1,{yAxis:a,series:this.option.series},this,"yAxis"),r=this.option.series[t].yAxisIndex||0,this._zoom.scatterMap[t].y=o.getAxis(r).getExtremum(),o.dispose()},_buildBackground:function(){var e=this._location.width,t=this._location.height;this.shapeList.push(new i({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._location.x,y:this._location.y,width:e,height:t,color:this.zoomOption.backgroundColor}}));for(var n=0,o=this._originalData.xAxis,s=this._zoom.xAxisIndex,l=0,h=s.length;h>l;l++)n=Math.max(n,o[s[l]].length);for(var m=this._originalData.yAxis,V=this._zoom.yAxisIndex,l=0,h=V.length;h>l;l++)n=Math.max(n,m[V[l]].length);for(var U,d=this._zoom.seriesIndex[0],p=this._originalData.series[d],c=Number.MIN_VALUE,u=Number.MAX_VALUE,l=0,h=p.length;h>l;l++)U=this.getDataFromOption(p[l],0),this.option.series[d].type==r.CHART_TYPE_K&&(U=U[1]),isNaN(U)&&(U=0),c=Math.max(c,U),u=Math.min(u,U);var y=c-u,g=[],b=e/(n-(n>1?1:0)),f=t/(n-(n>1?1:0)),k=1;"horizontal"==this.zoomOption.orient&&1>b?k=Math.floor(3*n/e):"vertical"==this.zoomOption.orient&&1>f&&(k=Math.floor(3*n/t));for(var l=0,h=n;h>l;l+=k)U=this.getDataFromOption(p[l],0),this.option.series[d].type==r.CHART_TYPE_K&&(U=U[1]),isNaN(U)&&(U=0),g.push("horizontal"==this.zoomOption.orient?[this._location.x+b*l,this._location.y+t-1-Math.round((U-u)/y*(t-10))]:[this._location.x+1+Math.round((U-u)/y*(e-10)),this._location.y+f*(h-l-1)]);"horizontal"==this.zoomOption.orient?(g.push([this._location.x+e,this._location.y+t]),g.push([this._location.x,this._location.y+t])):(g.push([this._location.x,this._location.y]),g.push([this._location.x,this._location.y+t])),this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:g,color:this.zoomOption.dataBackgroundColor},hoverable:!1}))},_buildFiller:function(){this._fillerShae={zlevel:this.getZlevelBase(),z:this.getZBase(),draggable:!0,ondrift:this._ondrift,ondragend:this._ondragend,_type:"filler"},this._fillerShae.style="horizontal"==this.zoomOption.orient?{x:this._location.x+Math.round(this._zoom.start/100*this._location.width)+this._handleSize,y:this._location.y,width:this._zoom.size-2*this._handleSize,height:this._location.height,color:this.zoomOption.fillerColor,text:":::",textPosition:"inside"}:{x:this._location.x,y:this._location.y+Math.round(this._zoom.start/100*this._location.height)+this._handleSize,width:this._location.width,height:this._zoom.size-2*this._handleSize,color:this.zoomOption.fillerColor,text:"::",textPosition:"inside"},this._fillerShae.highlightStyle={brushType:"fill",color:"rgba(0,0,0,0)"},this._fillerShae=new i(this._fillerShae),this.shapeList.push(this._fillerShae)},_buildHandle:function(){var e=this.zoomOption.showDetail?this._getDetail():{start:"",end:""};this._startShape={zlevel:this.getZlevelBase(),z:this.getZBase(),draggable:!0,style:{iconType:"rectangle",x:this._location.x,y:this._location.y,width:this._handleSize,height:this._handleSize,color:this.zoomOption.handleColor,text:"=",textPosition:"inside"},highlightStyle:{text:e.start,brushType:"fill",textPosition:"left"},ondrift:this._ondrift,ondragend:this._ondragend},"horizontal"==this.zoomOption.orient?(this._startShape.style.height=this._location.height,this._endShape=l.clone(this._startShape),this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endShape.highlightStyle.text=e.end,this._endShape.highlightStyle.textPosition="right"):(this._startShape.style.width=this._location.width,this._endShape=l.clone(this._startShape),this._startShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._startShape.highlightStyle.textPosition="bottom",this._endShape.style.y=this._fillerShae.style.y-this._handleSize,this._endShape.highlightStyle.text=e.end,this._endShape.highlightStyle.textPosition="top"),this._startShape=new o(this._startShape),this._endShape=new o(this._endShape),this.shapeList.push(this._startShape),this.shapeList.push(this._endShape)},_buildFrame:function(){var e=this.subPixelOptimize(this._location.x,1),t=this.subPixelOptimize(this._location.y,1);this._startFrameShape={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:e,y:t,width:this._location.width-(e>this._location.x?1:0),height:this._location.height-(t>this._location.y?1:0),lineWidth:1,brushType:"stroke",strokeColor:this.zoomOption.handleColor}},this._endFrameShape=l.clone(this._startFrameShape),this._startFrameShape=new i(this._startFrameShape),this._endFrameShape=new i(this._endFrameShape),this.shapeList.push(this._startFrameShape),this.shapeList.push(this._endFrameShape)},_syncHandleShape:function(){"horizontal"==this.zoomOption.orient?(this._startShape.style.x=this._fillerShae.style.x-this._handleSize,this._endShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._zoom.start=(this._startShape.style.x-this._location.x)/this._location.width*100,this._zoom.end=(this._endShape.style.x+this._handleSize-this._location.x)/this._location.width*100):(this._startShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._endShape.style.y=this._fillerShae.style.y-this._handleSize,this._zoom.start=(this._location.y+this._location.height-this._startShape.style.y)/this._location.height*100,this._zoom.end=(this._location.y+this._location.height-this._endShape.style.y-this._handleSize)/this._location.height*100),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this._syncFrameShape(),this.zr.refreshNextFrame()},_syncFillerShape:function(){var e,t;"horizontal"==this.zoomOption.orient?(e=this._startShape.style.x,t=this._endShape.style.x,this._fillerShae.style.x=Math.min(e,t)+this._handleSize,this._fillerShae.style.width=Math.abs(e-t)-this._handleSize,this._zoom.start=(Math.min(e,t)-this._location.x)/this._location.width*100,this._zoom.end=(Math.max(e,t)+this._handleSize-this._location.x)/this._location.width*100):(e=this._startShape.style.y,t=this._endShape.style.y,this._fillerShae.style.y=Math.min(e,t)+this._handleSize,this._fillerShae.style.height=Math.abs(e-t)-this._handleSize,this._zoom.start=(this._location.y+this._location.height-Math.max(e,t))/this._location.height*100,this._zoom.end=(this._location.y+this._location.height-Math.min(e,t)-this._handleSize)/this._location.height*100),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refreshNextFrame()},_syncFrameShape:function(){"horizontal"==this.zoomOption.orient?(this._startFrameShape.style.width=this._fillerShae.style.x-this._location.x,this._endFrameShape.style.x=this._fillerShae.style.x+this._fillerShae.style.width,this._endFrameShape.style.width=this._location.x+this._location.width-this._endFrameShape.style.x):(this._startFrameShape.style.y=this._fillerShae.style.y+this._fillerShae.style.height,this._startFrameShape.style.height=this._location.y+this._location.height-this._startFrameShape.style.y,this._endFrameShape.style.height=this._fillerShae.style.y-this._location.y),this.zr.modShape(this._startFrameShape.id),this.zr.modShape(this._endFrameShape.id)},_syncShape:function(){this.zoomOption.show&&("horizontal"==this.zoomOption.orient?(this._startShape.style.x=this._location.x+this._zoom.start/100*this._location.width,this._endShape.style.x=this._location.x+this._zoom.end/100*this._location.width-this._handleSize,this._fillerShae.style.x=this._startShape.style.x+this._handleSize,this._fillerShae.style.width=this._endShape.style.x-this._startShape.style.x-this._handleSize):(this._startShape.style.y=this._location.y+this._location.height-this._zoom.start/100*this._location.height,this._endShape.style.y=this._location.y+this._location.height-this._zoom.end/100*this._location.height-this._handleSize,this._fillerShae.style.y=this._endShape.style.y+this._handleSize,this._fillerShae.style.height=this._startShape.style.y-this._endShape.style.y-this._handleSize),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._fillerShae.id),this._syncFrameShape(),this.zr.refresh())},_syncData:function(e){var t,n,i,a,o;for(var s in this._originalData){t=this._originalData[s];for(var l in t)o=t[l],null!=o&&(a=o.length,n=Math.floor(this._zoom.start/100*a),i=Math.ceil(this._zoom.end/100*a),this.getDataFromOption(o[0])instanceof Array&&this.option[s][l].type!=r.CHART_TYPE_K?(this._setScale(),this.option[s][l].data=this._synScatterData(l,o)):this.option[s][l].data=o.slice(n,i))}this._isSilence||!this.zoomOption.realtime&&!e||this.messageCenter.dispatch(r.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart)},_synScatterData:function(e,t){if(0===this._zoom.start&&100==this._zoom.end&&0===this._zoom.start2&&100==this._zoom.end2)return t;var n,i,a,o,r,s=[],l=this._zoom.scatterMap[e];"horizontal"==this.zoomOption.orient?(n=l.x.max-l.x.min,i=this._zoom.start/100*n+l.x.min,a=this._zoom.end/100*n+l.x.min,n=l.y.max-l.y.min,o=this._zoom.start2/100*n+l.y.min,r=this._zoom.end2/100*n+l.y.min):(n=l.x.max-l.x.min,i=this._zoom.start2/100*n+l.x.min,a=this._zoom.end2/100*n+l.x.min,n=l.y.max-l.y.min,o=this._zoom.start/100*n+l.y.min,r=this._zoom.end/100*n+l.y.min);for(var h,m=0,V=t.length;V>m;m++)h=t[m].value||t[m],h[0]>=i&&h[0]<=a&&h[1]>=o&&h[1]<=r&&s.push(t[m]);return s},_setScale:function(){var e=0!==this._zoom.start||100!==this._zoom.end||0!==this._zoom.start2||100!==this._zoom.end2,t={xAxis:this.option.xAxis,yAxis:this.option.yAxis};for(var n in t)for(var i=0,a=t[n].length;a>i;i++)t[n][i].scale=e||t[n][i]._scale},_backupScale:function(){var e={xAxis:this.option.xAxis,yAxis:this.option.yAxis};for(var t in e)for(var n=0,i=e[t].length;i>n;n++)e[t][n]._scale=e[t][n].scale},_getDetail:function(){var e="horizontal"==this.zoomOption.orient?"xAxis":"yAxis",t=this._originalData[e];for(var n in t){var i=t[n];if(null!=i){var a=i.length,o=Math.floor(this._zoom.start/100*a),r=Math.ceil(this._zoom.end/100*a);return r-=r>0?1:0,{start:this.getDataFromOption(i[o]),end:this.getDataFromOption(i[r])}}}var l=this._zoom.seriesIndex[0],h=this.option.series[l][e+"Index"]||0,m=this.option[e][h].type,V=this._zoom.scatterMap[l][e.charAt(0)].min,U=this._zoom.scatterMap[l][e.charAt(0)].max,d=U-V;if("value"==m)return{start:V+d*this._zoom.start/100,end:V+d*this._zoom.end/100};if("time"==m){U=V+d*this._zoom.end/100,V+=d*this._zoom.start/100;var p=s.getAutoFormatter(V,U).formatter;return{start:s.format(p,V),end:s.format(p,U)}}return{start:"",end:""}},__ondrift:function(e,t,n){this.zoomOption.zoomLock&&(e=this._fillerShae);var i="filler"==e._type?this._handleSize:0;if("horizontal"==this.zoomOption.orient?e.style.x+t-i<=this._location.x?e.style.x=this._location.x+i:e.style.x+t+e.style.width+i>=this._location.x+this._location.width?e.style.x=this._location.x+this._location.width-e.style.width-i:e.style.x+=t:e.style.y+n-i<=this._location.y?e.style.y=this._location.y+i:e.style.y+n+e.style.height+i>=this._location.y+this._location.height?e.style.y=this._location.y+this._location.height-e.style.height-i:e.style.y+=n,"filler"==e._type?this._syncHandleShape():this._syncFillerShape(),this.zoomOption.realtime&&this._syncData(),this.zoomOption.showDetail){var a=this._getDetail();this._startShape.style.text=this._startShape.highlightStyle.text=a.start,this._endShape.style.text=this._endShape.highlightStyle.text=a.end,this._startShape.style.textPosition=this._startShape.highlightStyle.textPosition,this._endShape.style.textPosition=this._endShape.highlightStyle.textPosition}return!0},__ondragend:function(){this.zoomOption.showDetail&&(this._startShape.style.text=this._endShape.style.text="=",this._startShape.style.textPosition=this._endShape.style.textPosition="inside",this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.refreshNextFrame()),this.isDragend=!0},ondragend:function(e,t){this.isDragend&&e.target&&(!this.zoomOption.realtime&&this._syncData(),t.dragOut=!0,t.dragIn=!0,this._isSilence||this.zoomOption.realtime||this.messageCenter.dispatch(r.EVENT.DATA_ZOOM,null,{zoom:this._zoom},this.myChart),t.needRefresh=!1,this.isDragend=!1)},ondataZoom:function(e,t){t.needRefresh=!0},absoluteZoom:function(e){this._zoom.start=e.start,this._zoom.end=e.end,this._zoom.start2=e.start2,this._zoom.end2=e.end2,this._syncShape(),this._syncData(!0)},rectZoom:function(e){if(!e)return this._zoom.start=this._zoom.start2=0,this._zoom.end=this._zoom.end2=100,this._syncShape(),this._syncData(!0),this._zoom;var t=this.component.grid.getArea(),n={x:e.x,y:e.y,width:e.width,height:e.height};if(n.width<0&&(n.x+=n.width,n.width=-n.width),n.height<0&&(n.y+=n.height,n.height=-n.height),n.x>t.x+t.width||n.y>t.y+t.height)return!1;n.x<t.x&&(n.x=t.x),n.x+n.width>t.x+t.width&&(n.width=t.x+t.width-n.x),n.y+n.height>t.y+t.height&&(n.height=t.y+t.height-n.y);var i,a=(n.x-t.x)/t.width,o=1-(n.x+n.width-t.x)/t.width,r=1-(n.y+n.height-t.y)/t.height,s=(n.y-t.y)/t.height;return"horizontal"==this.zoomOption.orient?(i=this._zoom.end-this._zoom.start,this._zoom.start+=i*a,this._zoom.end-=i*o,i=this._zoom.end2-this._zoom.start2,this._zoom.start2+=i*r,this._zoom.end2-=i*s):(i=this._zoom.end-this._zoom.start,this._zoom.start+=i*r,this._zoom.end-=i*s,i=this._zoom.end2-this._zoom.start2,this._zoom.start2+=i*a,this._zoom.end2-=i*o),this._syncShape(),this._syncData(!0),this._zoom},syncBackupData:function(e){for(var t,n,i=this._originalData.series,a=e.series,o=0,r=a.length;r>o;o++){n=a[o].data||a[o].eventList,t=i[o]?Math.floor(this._zoom.start/100*i[o].length):0;for(var s=0,l=n.length;l>s;s++)i[o]&&(i[o][s+t]=n[s])}},syncOption:function(e){this.silence(!0),this.option=e,this.option.dataZoom=this.reformOption(this.option.dataZoom),this.zoomOption=this.option.dataZoom,this.myChart.canvasSupported||(this.zoomOption.realtime=!1),this.clear(),this._location=this._getLocation(),this._zoom=this._getZoom(),this._backupData(),this.option.dataZoom&&this.option.dataZoom.show&&this._buildShape(),this._syncData(),this.silence(!1)},silence:function(e){this._isSilence=e},getRealDataIndex:function(e,t){if(!this._originalData||0===this._zoom.start&&100==this._zoom.end)return t;var n=this._originalData.series;return n[e]?Math.floor(this._zoom.start/100*n[e].length)+t:-1},resize:function(){this.clear(),this._location=this._getLocation(),this._zoom=this._getZoom(),this.option.dataZoom.show&&this._buildShape()}},l.inherits(t,n),e("../component").define("dataZoom",t),t}),n("echarts/component/categoryAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","zrender/tool/util","zrender/tool/area","../component"],function(e){function t(e,t,i,a,o,r){if(a.data.length<1)return void console.error("option.data.length < 1.");n.call(this,e,t,i,a,o),this.grid=this.component.grid;for(var s in r)this[s]=r[s];this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),r=e("../config");r.categoryAxis={zlevel:0,z:0,show:!0,position:"bottom",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:!0,axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!0,interval:"auto",inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,interval:"auto",rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}};var s=e("zrender/tool/util"),l=e("zrender/tool/area");return t.prototype={type:r.COMPONENT_TYPE_AXIS_CATEGORY,_getReformedLabel:function(e){var t=this.getDataFromOption(this.option.data[e]),n=this.option.data[e].formatter||this.option.axisLabel.formatter;return n&&("function"==typeof n?t=n.call(this.myChart,t):"string"==typeof n&&(t=n.replace("{value}",t))),t},_getInterval:function(){var e=this.option.axisLabel.interval;if("auto"==e){var t=this.option.axisLabel.textStyle.fontSize,n=this.option.data,i=this.option.data.length;if(this.isHorizontal())if(i>3){var a,o,r=this.getGap(),h=!1,m=Math.floor(.5/r);for(m=1>m?1:m,e=Math.floor(15/r);!h&&i>e;){e+=m,h=!0,a=Math.floor(r*e);for(var V=Math.floor((i-1)/e)*e;V>=0;V-=e){if(0!==this.option.axisLabel.rotate)o=t;else if(n[V].textStyle)o=l.getTextWidth(this._getReformedLabel(V),this.getFont(s.merge(n[V].textStyle,this.option.axisLabel.textStyle)));else{var U=this._getReformedLabel(V)+"",d=(U.match(/\w/g)||"").length,p=U.length-d;o=d*t*2/3+p*t}if(o>a){h=!1;break}}}}else e=1;else if(i>3){var r=this.getGap();for(e=Math.floor(11/r);t>r*e-6&&i>e;)e++}else e=1}else e="function"==typeof e?1:e-0+1;return e},_buildShape:function(){if(this._interval=this._getInterval(),this.option.show){this.option.splitArea.show&&this._buildSplitArea(),this.option.splitLine.show&&this._buildSplitLine(),this.option.axisLine.show&&this._buildAxisLine(),this.option.axisTick.show&&this._buildAxisTick(),this.option.axisLabel.show&&this._buildAxisLabel();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildAxisTick:function(){var e,t=this.option.data,n=this.option.data.length,i=this.option.axisTick,o=i.length,r=i.lineStyle.color,s=i.lineStyle.width,l="function"==typeof i.interval?i.interval:"auto"==i.interval&&"function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,h=l?1:"auto"==i.interval?this._interval:i.interval-0+1,m=i.onGap,V=m?this.getGap()/2:"undefined"==typeof m&&this.option.boundaryGap?this.getGap()/2:0,U=V>0?-h:0;if(this.isHorizontal())for(var d,p="bottom"==this.option.position?i.inside?this.grid.getYend()-o-1:this.grid.getYend()+1:i.inside?this.grid.getY()+1:this.grid.getY()-o-1,c=U;n>c;c+=h)(!l||l(c,t[c]))&&(d=this.subPixelOptimize(this.getCoordByIndex(c)+(c>=0?V:0),s),e={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:d,yStart:p,xEnd:d,yEnd:p+o,strokeColor:r,lineWidth:s}},this.shapeList.push(new a(e)));else for(var u,y="left"==this.option.position?i.inside?this.grid.getX()+1:this.grid.getX()-o-1:i.inside?this.grid.getXend()-o-1:this.grid.getXend()+1,c=U;n>c;c+=h)(!l||l(c,t[c]))&&(u=this.subPixelOptimize(this.getCoordByIndex(c)-(c>=0?V:0),s),e={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:y,yStart:u,xEnd:y+o,yEnd:u,strokeColor:r,lineWidth:s}},this.shapeList.push(new a(e)))},_buildAxisLabel:function(){var e,t,n=this.option.data,a=this.option.data.length,o=this.option.axisLabel,r=o.rotate,l=o.margin,h=o.clickable,m=o.textStyle,V="function"==typeof o.interval?o.interval:!1;if(this.isHorizontal()){var U,d;"bottom"==this.option.position?(U=this.grid.getYend()+l,d="top"):(U=this.grid.getY()-l,d="bottom");for(var p=0;a>p;p+=this._interval)V&&!V(p,n[p])||""===this._getReformedLabel(p)||(t=s.merge(n[p].textStyle||{},m),e={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:this.getCoordByIndex(p),y:U,color:t.color,text:this._getReformedLabel(p),textFont:this.getFont(t),textAlign:t.align||"center",textBaseline:t.baseline||d}},r&&(e.style.textAlign=r>0?"bottom"==this.option.position?"right":"left":"bottom"==this.option.position?"left":"right",e.rotation=[r*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new i(this._axisLabelClickable(h,e))))}else{var c,u;"left"==this.option.position?(c=this.grid.getX()-l,u="right"):(c=this.grid.getXend()+l,u="left");for(var p=0;a>p;p+=this._interval)V&&!V(p,n[p])||""===this._getReformedLabel(p)||(t=s.merge(n[p].textStyle||{},m),e={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:c,y:this.getCoordByIndex(p),color:t.color,text:this._getReformedLabel(p),textFont:this.getFont(t),textAlign:t.align||u,textBaseline:t.baseline||0===p&&""!==this.option.name?"bottom":p==a-1&&""!==this.option.name?"top":"middle"}},r&&(e.rotation=[r*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new i(this._axisLabelClickable(h,e))))
-}},_buildSplitLine:function(){var e,t=this.option.data,n=this.option.data.length,i=this.option.splitLine,o=i.lineStyle.type,r=i.lineStyle.width,s=i.lineStyle.color;s=s instanceof Array?s:[s];var l=s.length,h="function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,m=i.onGap,V=m?this.getGap()/2:"undefined"==typeof m&&this.option.boundaryGap?this.getGap()/2:0;if(n-=m||"undefined"==typeof m&&this.option.boundaryGap?1:0,this.isHorizontal())for(var U,d=this.grid.getY(),p=this.grid.getYend(),c=0;n>c;c+=this._interval)(!h||h(c,t[c]))&&(U=this.subPixelOptimize(this.getCoordByIndex(c)+V,r),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:U,yStart:d,xEnd:U,yEnd:p,strokeColor:s[c/this._interval%l],lineType:o,lineWidth:r}},this.shapeList.push(new a(e)));else for(var u,y=this.grid.getX(),g=this.grid.getXend(),c=0;n>c;c+=this._interval)(!h||h(c,t[c]))&&(u=this.subPixelOptimize(this.getCoordByIndex(c)-V,r),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:y,yStart:u,xEnd:g,yEnd:u,strokeColor:s[c/this._interval%l],lineType:o,lineWidth:r}},this.shapeList.push(new a(e)))},_buildSplitArea:function(){var e,t=this.option.data,n=this.option.splitArea,i=n.areaStyle.color;if(i instanceof Array){var a=i.length,r=this.option.data.length,s="function"==typeof this.option.axisLabel.interval?this.option.axisLabel.interval:!1,l=n.onGap,h=l?this.getGap()/2:"undefined"==typeof l&&this.option.boundaryGap?this.getGap()/2:0;if(this.isHorizontal())for(var m,V=this.grid.getY(),U=this.grid.getHeight(),d=this.grid.getX(),p=0;r>=p;p+=this._interval)s&&!s(p,t[p])&&r>p||(m=r>p?this.getCoordByIndex(p)+h:this.grid.getXend(),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:d,y:V,width:m-d,height:U,color:i[p/this._interval%a]}},this.shapeList.push(new o(e)),d=m);else for(var c,u=this.grid.getX(),y=this.grid.getWidth(),g=this.grid.getYend(),p=0;r>=p;p+=this._interval)s&&!s(p,t[p])&&r>p||(c=r>p?this.getCoordByIndex(p)-h:this.grid.getY(),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:u,y:c,width:y,height:g-c,color:i[p/this._interval%a]}},this.shapeList.push(new o(e)),g=c)}else e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this.grid.getX(),y:this.grid.getY(),width:this.grid.getWidth(),height:this.grid.getHeight(),color:i}},this.shapeList.push(new o(e))},refresh:function(e){e&&(this.option=this.reformOption(e),this.option.axisLabel.textStyle=this.getTextStyle(this.option.axisLabel.textStyle)),this.clear(),this._buildShape()},getGap:function(){var e=this.option.data.length,t=this.isHorizontal()?this.grid.getWidth():this.grid.getHeight();return this.option.boundaryGap?t/e:t/(e>1?e-1:1)},getCoord:function(e){for(var t=this.option.data,n=t.length,i=this.getGap(),a=this.option.boundaryGap?i/2:0,o=0;n>o;o++){if(this.getDataFromOption(t[o])==e)return a=this.isHorizontal()?this.grid.getX()+a:this.grid.getYend()-a;a+=i}},getCoordByIndex:function(e){if(0>e)return this.isHorizontal()?this.grid.getX():this.grid.getYend();if(e>this.option.data.length-1)return this.isHorizontal()?this.grid.getXend():this.grid.getY();var t=this.getGap(),n=this.option.boundaryGap?t/2:0;return n+=e*t,n=this.isHorizontal()?this.grid.getX()+n:this.grid.getYend()-n},getNameByIndex:function(e){return this.getDataFromOption(this.option.data[e])},getIndexByName:function(e){for(var t=this.option.data,n=t.length,i=0;n>i;i++)if(this.getDataFromOption(t[i])==e)return i;return-1},getValueFromCoord:function(){return""},isMainAxis:function(e){return e%this._interval===0}},s.inherits(t,n),e("../component").define("categoryAxis",t),t}),n("echarts/component/valueAxis",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","../config","../util/date","zrender/tool/util","../util/smartSteps","../util/accMath","../component"],function(e){function t(e,t,i,a,o,r,s){if(!s||0===s.length)return void console.err("option.series.length == 0.");n.call(this,e,t,i,a,o),this.series=s,this.grid=this.component.grid;for(var l in r)this[l]=r[l];this.refresh(a,s)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Rectangle"),r=e("../config");r.valueAxis={zlevel:0,z:0,show:!0,position:"left",name:"",nameLocation:"end",nameTextStyle:{},boundaryGap:[0,0],axisLine:{show:!0,onZero:!0,lineStyle:{color:"#48b",width:2,type:"solid"}},axisTick:{show:!1,inside:!1,length:5,lineStyle:{color:"#333",width:1}},axisLabel:{show:!0,rotate:0,margin:8,textStyle:{color:"#333"}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}};var s=e("../util/date"),l=e("zrender/tool/util");return t.prototype={type:r.COMPONENT_TYPE_AXIS_VALUE,_buildShape:function(){if(this._hasData=!1,this._calculateValue(),this._hasData&&this.option.show){this.option.splitArea.show&&this._buildSplitArea(),this.option.splitLine.show&&this._buildSplitLine(),this.option.axisLine.show&&this._buildAxisLine(),this.option.axisTick.show&&this._buildAxisTick(),this.option.axisLabel.show&&this._buildAxisLabel();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildAxisTick:function(){var e,t=this._valueList,n=this._valueList.length,i=this.option.axisTick,o=i.length,r=i.lineStyle.color,s=i.lineStyle.width;if(this.isHorizontal())for(var l,h="bottom"===this.option.position?i.inside?this.grid.getYend()-o-1:this.grid.getYend()+1:i.inside?this.grid.getY()+1:this.grid.getY()-o-1,m=0;n>m;m++)l=this.subPixelOptimize(this.getCoord(t[m]),s),e={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:l,yStart:h,xEnd:l,yEnd:h+o,strokeColor:r,lineWidth:s}},this.shapeList.push(new a(e));else for(var V,U="left"===this.option.position?i.inside?this.grid.getX()+1:this.grid.getX()-o-1:i.inside?this.grid.getXend()-o-1:this.grid.getXend()+1,m=0;n>m;m++)V=this.subPixelOptimize(this.getCoord(t[m]),s),e={_axisShape:"axisTick",zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:U,yStart:V,xEnd:U+o,yEnd:V,strokeColor:r,lineWidth:s}},this.shapeList.push(new a(e))},_buildAxisLabel:function(){var e,t=this._valueList,n=this._valueList.length,a=this.option.axisLabel.rotate,o=this.option.axisLabel.margin,r=this.option.axisLabel.clickable,s=this.option.axisLabel.textStyle;if(this.isHorizontal()){var l,h;"bottom"===this.option.position?(l=this.grid.getYend()+o,h="top"):(l=this.grid.getY()-o,h="bottom");for(var m=0;n>m;m++)e={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:this.getCoord(t[m]),y:l,color:"function"==typeof s.color?s.color(t[m]):s.color,text:this._valueLabel[m],textFont:this.getFont(s),textAlign:s.align||"center",textBaseline:s.baseline||h}},a&&(e.style.textAlign=a>0?"bottom"===this.option.position?"right":"left":"bottom"===this.option.position?"left":"right",e.rotation=[a*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new i(this._axisLabelClickable(r,e)))}else{var V,U;"left"===this.option.position?(V=this.grid.getX()-o,U="right"):(V=this.grid.getXend()+o,U="left");for(var m=0;n>m;m++)e={zlevel:this.getZlevelBase(),z:this.getZBase()+3,hoverable:!1,style:{x:V,y:this.getCoord(t[m]),color:"function"==typeof s.color?s.color(t[m]):s.color,text:this._valueLabel[m],textFont:this.getFont(s),textAlign:s.align||U,textBaseline:s.baseline||(0===m&&""!==this.option.name?"bottom":m===n-1&&""!==this.option.name?"top":"middle")}},a&&(e.rotation=[a*Math.PI/180,e.style.x,e.style.y]),this.shapeList.push(new i(this._axisLabelClickable(r,e)))}},_buildSplitLine:function(){var e,t=this._valueList,n=this._valueList.length,i=this.option.splitLine,o=i.lineStyle.type,r=i.lineStyle.width,s=i.lineStyle.color;s=s instanceof Array?s:[s];var l=s.length;if(this.isHorizontal())for(var h,m=this.grid.getY(),V=this.grid.getYend(),U=0;n>U;U++)h=this.subPixelOptimize(this.getCoord(t[U]),r),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:h,yStart:m,xEnd:h,yEnd:V,strokeColor:s[U%l],lineType:o,lineWidth:r}},this.shapeList.push(new a(e));else for(var d,p=this.grid.getX(),c=this.grid.getXend(),U=0;n>U;U++)d=this.subPixelOptimize(this.getCoord(t[U]),r),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{xStart:p,yStart:d,xEnd:c,yEnd:d,strokeColor:s[U%l],lineType:o,lineWidth:r}},this.shapeList.push(new a(e))},_buildSplitArea:function(){var e,t=this.option.splitArea.areaStyle.color;if(t instanceof Array){var n=t.length,i=this._valueList,a=this._valueList.length;if(this.isHorizontal())for(var r,s=this.grid.getY(),l=this.grid.getHeight(),h=this.grid.getX(),m=0;a>=m;m++)r=a>m?this.getCoord(i[m]):this.grid.getXend(),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:h,y:s,width:r-h,height:l,color:t[m%n]}},this.shapeList.push(new o(e)),h=r;else for(var V,U=this.grid.getX(),d=this.grid.getWidth(),p=this.grid.getYend(),m=0;a>=m;m++)V=a>m?this.getCoord(i[m]):this.grid.getY(),e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:U,y:V,width:d,height:p-V,color:t[m%n]}},this.shapeList.push(new o(e)),p=V}else e={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this.grid.getX(),y:this.grid.getY(),width:this.grid.getWidth(),height:this.grid.getHeight(),color:t}},this.shapeList.push(new o(e))},_calculateValue:function(){if(isNaN(this.option.min-0)||isNaN(this.option.max-0)){for(var e,t,n={},i=this.component.legend,a=0,o=this.series.length;o>a;a++)!(this.series[a].type!=r.CHART_TYPE_LINE&&this.series[a].type!=r.CHART_TYPE_BAR&&this.series[a].type!=r.CHART_TYPE_SCATTER&&this.series[a].type!=r.CHART_TYPE_K&&this.series[a].type!=r.CHART_TYPE_EVENTRIVER||i&&!i.isSelected(this.series[a].name)||(e=this.series[a].xAxisIndex||0,t=this.series[a].yAxisIndex||0,this.option.xAxisIndex!=e&&this.option.yAxisIndex!=t||!this._calculSum(n,a)));var s;for(var a in n){s=n[a];for(var l=0,h=s.length;h>l;l++)if(!isNaN(s[l])){this._hasData=!0,this._min=s[l],this._max=s[l];break}if(this._hasData)break}for(var a in n){s=n[a];for(var l=0,h=s.length;h>l;l++)isNaN(s[l])||(this._min=Math.min(this._min,s[l]),this._max=Math.max(this._max,s[l]))}var m=Math.abs(this._max-this._min);this._min=isNaN(this.option.min-0)?this._min-Math.abs(m*this.option.boundaryGap[0]):this.option.min-0,this._max=isNaN(this.option.max-0)?this._max+Math.abs(m*this.option.boundaryGap[1]):this.option.max-0,this._min===this._max&&(0===this._max?this._max=1:this._max>0?this._min=this._max/this.option.splitNumber!=null?this.option.splitNumber:5:this._max=this._max/this.option.splitNumber!=null?this.option.splitNumber:5),"time"!=this.option.type?this._reformValue(this.option.scale):this._reformTimeValue()}else this._hasData=!0,this._min=this.option.min-0,this._max=this.option.max-0,"time"!=this.option.type?this._customerValue():this._reformTimeValue()},_calculSum:function(e,t){var n,i,a=this.series[t].name||"kener";if(this.series[t].stack){var o="__Magic_Key_Positive__"+this.series[t].stack,l="__Magic_Key_Negative__"+this.series[t].stack;e[o]=e[o]||[],e[l]=e[l]||[],e[a]=e[a]||[],i=this.series[t].data;for(var h=0,m=i.length;m>h;h++)n=this.getDataFromOption(i[h]),"-"!==n&&(n-=0,n>=0?null!=e[o][h]?e[o][h]+=n:e[o][h]=n:null!=e[l][h]?e[l][h]+=n:e[l][h]=n,this.option.scale&&e[a].push(n))}else if(e[a]=e[a]||[],this.series[t].type!=r.CHART_TYPE_EVENTRIVER){i=this.series[t].data;for(var h=0,m=i.length;m>h;h++)n=this.getDataFromOption(i[h]),this.series[t].type===r.CHART_TYPE_K?(e[a].push(n[0]),e[a].push(n[1]),e[a].push(n[2]),e[a].push(n[3])):n instanceof Array?(-1!=this.option.xAxisIndex&&e[a].push("time"!=this.option.type?n[0]:s.getNewDate(n[0])),-1!=this.option.yAxisIndex&&e[a].push("time"!=this.option.type?n[1]:s.getNewDate(n[1]))):e[a].push(n)}else{i=this.series[t].eventList;for(var h=0,m=i.length;m>h;h++)for(var V=i[h].evolution,U=0,d=V.length;d>U;U++)e[a].push(s.getNewDate(V[U].time))}},_reformValue:function(t){var n=e("../util/smartSteps"),i=this.option.splitNumber;!t&&this._min>=0&&this._max>=0&&(this._min=0),!t&&this._min<=0&&this._max<=0&&(this._max=0);var a=n(this._min,this._max,i);i=null!=i?i:a.secs,this._min=a.min,this._max=a.max,this._valueList=a.pnts,this._reformLabelData()},_reformTimeValue:function(){var e=null!=this.option.splitNumber?this.option.splitNumber:5,t=s.getAutoFormatter(this._min,this._max,e),n=t.formatter,i=t.gapValue;this._valueList=[s.getNewDate(this._min)];var a;switch(n){case"week":a=s.nextMonday(this._min);break;case"month":a=s.nextNthOnMonth(this._min,1);break;case"quarter":a=s.nextNthOnQuarterYear(this._min,1);break;case"half-year":a=s.nextNthOnHalfYear(this._min,1);break;case"year":a=s.nextNthOnYear(this._min,1);break;default:72e5>=i?a=(Math.floor(this._min/i)+1)*i:(a=s.getNewDate(this._min- -i),a.setHours(6*Math.round(a.getHours()/6)),a.setMinutes(0),a.setSeconds(0))}for(a-this._min<i/2&&(a-=-i),t=s.getNewDate(a),e*=1.5;e-->=0&&(("month"==n||"quarter"==n||"half-year"==n||"year"==n)&&t.setDate(1),!(this._max-t<i/2));)this._valueList.push(t),t=s.getNewDate(t- -i);this._valueList.push(s.getNewDate(this._max)),this._reformLabelData(n)},_customerValue:function(){var t=e("../util/accMath"),n=null!=this.option.splitNumber?this.option.splitNumber:5,i=(this._max-this._min)/n;this._valueList=[];for(var a=0;n>=a;a++)this._valueList.push(t.accAdd(this._min,t.accMul(i,a)));this._reformLabelData()},_reformLabelData:function(e){this._valueLabel=[];var t=this.option.axisLabel.formatter;if(t)for(var n=0,i=this._valueList.length;i>n;n++)"function"==typeof t?this._valueLabel.push(e?t.call(this.myChart,this._valueList[n],e):t.call(this.myChart,this._valueList[n])):"string"==typeof t&&this._valueLabel.push(e?s.format(t,this._valueList[n]):t.replace("{value}",this._valueList[n]));else if(e)for(var n=0,i=this._valueList.length;i>n;n++)this._valueLabel.push(s.format(e,this._valueList[n]));else for(var n=0,i=this._valueList.length;i>n;n++)this._valueLabel.push(this.numAddCommas(this._valueList[n]))},getExtremum:function(){return this._calculateValue(),{min:this._min,max:this._max}},refresh:function(e,t){e&&(this.option=this.reformOption(e),this.option.axisLabel.textStyle=l.merge(this.option.axisLabel.textStyle||{},this.ecTheme.textStyle),this.series=t),this.zr&&(this.clear(),this._buildShape())},getCoord:function(e){e=e<this._min?this._min:e,e=e>this._max?this._max:e;var t;return t=this.isHorizontal()?this.grid.getX()+(e-this._min)/(this._max-this._min)*this.grid.getWidth():this.grid.getYend()-(e-this._min)/(this._max-this._min)*this.grid.getHeight()},getCoordSize:function(e){return Math.abs(this.isHorizontal()?e/(this._max-this._min)*this.grid.getWidth():e/(this._max-this._min)*this.grid.getHeight())},getValueFromCoord:function(e){var t;return this.isHorizontal()?(e=e<this.grid.getX()?this.grid.getX():e,e=e>this.grid.getXend()?this.grid.getXend():e,t=this._min+(e-this.grid.getX())/this.grid.getWidth()*(this._max-this._min)):(e=e<this.grid.getY()?this.grid.getY():e,e=e>this.grid.getYend()?this.grid.getYend():e,t=this._max-(e-this.grid.getY())/this.grid.getHeight()*(this._max-this._min)),t.toFixed(2)-0},isMaindAxis:function(e){for(var t=0,n=this._valueList.length;n>t;t++)if(this._valueList[t]===e)return!0;return!1}},l.inherits(t,n),e("../component").define("valueAxis",t),t}),n("echarts/util/date",[],function(){function e(e,t,n){n=n>1?n:2;for(var i,a,o,r,s=0,l=m.length;l>s;s++)if(i=m[s].value,a=Math.ceil(t/i)*i-Math.floor(e/i)*i,Math.round(a/i)<=1.2*n){o=m[s].formatter,r=m[s].value;break}return null==o&&(o="year",i=317088e5,a=Math.ceil(t/i)*i-Math.floor(e/i)*i,r=Math.round(a/(n-1)/i)*i),{formatter:o,gapValue:r}}function t(e){return 10>e?"0"+e:e}function n(e,n){("week"==e||"month"==e||"quarter"==e||"half-year"==e||"year"==e)&&(e="MM - dd\nyyyy");var i=h(n),a=i.getFullYear(),o=i.getMonth()+1,r=i.getDate(),s=i.getHours(),l=i.getMinutes(),m=i.getSeconds();return e=e.replace("MM",t(o)),e=e.toLowerCase(),e=e.replace("yyyy",a),e=e.replace("yy",a%100),e=e.replace("dd",t(r)),e=e.replace("d",r),e=e.replace("hh",t(s)),e=e.replace("h",s),e=e.replace("mm",t(l)),e=e.replace("m",l),e=e.replace("ss",t(m)),e=e.replace("s",m)}function i(e){return e=h(e),e.setDate(e.getDate()+8-e.getDay()),e}function a(e,t,n){return e=h(e),e.setMonth(Math.ceil((e.getMonth()+1)/n)*n),e.setDate(t),e}function o(e,t){return a(e,t,1)}function r(e,t){return a(e,t,3)}function s(e,t){return a(e,t,6)}function l(e,t){return a(e,t,12)}function h(e){return e instanceof Date?e:new Date("string"==typeof e?e.replace(/-/g,"/"):e)}var m=[{formatter:"hh : mm : ss",value:1e3},{formatter:"hh : mm : ss",value:5e3},{formatter:"hh : mm : ss",value:1e4},{formatter:"hh : mm : ss",value:15e3},{formatter:"hh : mm : ss",value:3e4},{formatter:"hh : mm\nMM - dd",value:6e4},{formatter:"hh : mm\nMM - dd",value:3e5},{formatter:"hh : mm\nMM - dd",value:6e5},{formatter:"hh : mm\nMM - dd",value:9e5},{formatter:"hh : mm\nMM - dd",value:18e5},{formatter:"hh : mm\nMM - dd",value:36e5},{formatter:"hh : mm\nMM - dd",value:72e5},{formatter:"hh : mm\nMM - dd",value:216e5},{formatter:"hh : mm\nMM - dd",value:432e5},{formatter:"MM - dd\nyyyy",value:864e5},{formatter:"week",value:6048e5},{formatter:"month",value:26784e5},{formatter:"quarter",value:8208e6},{formatter:"half-year",value:16416e6},{formatter:"year",value:32832e6}];return{getAutoFormatter:e,getNewDate:h,format:n,nextMonday:i,nextNthPerNmonth:a,nextNthOnMonth:o,nextNthOnQuarterYear:r,nextNthOnHalfYear:s,nextNthOnYear:l}}),n("echarts/util/smartSteps",[],function(){function e(e){return X.log(v(e))/X.LN10}function t(e){return X.pow(10,e)}function n(e){return e===w(e)}function i(e,t,i,a){b=a||{},f=b.steps||L,k=b.secs||W,i=K(+i||0)%99,e=+e||0,t=+t||0,x=_=0,"min"in b&&(e=+b.min||0,x=1),"max"in b&&(t=+b.max||0,_=1),e>t&&(t=[e,e=t][0]);var o=t-e;if(x&&_)return g(e,t,i);if((i||5)>o){if(n(e)&&n(t))return d(e,t,i);if(0===o)return p(e,t,i)}return h(e,t,i)}function a(e,n,i,a){a=a||0;var s=o((n-e)/i,-1),l=o(e,-1,1),h=o(n,-1),m=X.min(s.e,l.e,h.e);0===l.c?m=X.min(s.e,h.e):0===h.c&&(m=X.min(s.e,l.e)),r(s,{c:0,e:m}),r(l,s,1),r(h,s),a+=m,e=l.c,n=h.c;for(var V=(n-e)/i,U=t(a),d=0,p=[],c=i+1;c--;)p[c]=(e+V*c)*U;if(0>a){d=u(U),V=+(V*U).toFixed(d),e=+(e*U).toFixed(d),n=+(n*U).toFixed(d);for(var c=p.length;c--;)p[c]=p[c].toFixed(d),0===+p[c]&&(p[c]="0")}else e*=U,n*=U,V*=U;return k=0,f=0,b=0,{min:e,max:n,secs:i,step:V,fix:d,exp:a,pnts:p}}function o(i,a,o){a=K(a%10)||2,0>a&&(n(i)?a=(""+v(i)).replace(/0+$/,"").length||1:(i=i.toFixed(15).replace(/0+$/,""),a=i.replace(".","").replace(/^[-0]+/,"").length,i=+i));var r=w(e(i))-a+1,s=+(i*t(-r)).toFixed(15)||0;return s=o?w(s):I(s),!s&&(r=0),(""+v(s)).length>a&&(r+=1,s/=10),{c:s,e:r}}function r(e,n,i){var a=n.e-e.e;a&&(e.e+=a,e.c*=t(-a),e.c=i?w(e.c):I(e.c))}function s(e,t,n){e.e<t.e?r(t,e,n):r(e,t,n)}function l(e,t){t=t||L,e=o(e);for(var n=e.c,i=0;n>t[i];)i++;if(!t[i])for(n/=10,e.e+=1,i=0;n>t[i];)i++;return e.c=t[i],e}function h(e,t,i){var s,h=i||+k.slice(-1),p=l((t-e)/h,f),u=o(t-e),g=o(e,-1,1),b=o(t,-1);if(r(u,p),r(g,p,1),r(b,p),i?s=V(g,b,h):h=m(g,b),n(e)&&n(t)&&e*t>=0){if(h>t-e)return d(e,t,h);h=U(e,t,i,g,b,h)}var L=c(e,t,g.c,b.c);return g.c=L[0],b.c=L[1],(x||_)&&y(e,t,g,b),a(g.c,b.c,h,b.e)}function m(e,n){for(var i,a,o,r,s=[],h=k.length;h--;)i=k[h],a=l((n.c-e.c)/i,f),a=a.c*t(a.e),o=w(e.c/a)*a,r=I(n.c/a)*a,s[h]={min:o,max:r,step:a,span:r-o};return s.sort(function(e,t){var n=e.span-t.span;return 0===n&&(n=e.step-t.step),n}),s=s[0],i=s.span/s.step,e.c=s.min,n.c=s.max,3>i?2*i:i}function V(e,n,i){for(var a,o,r=n.c,s=(n.c-e.c)/i-1;r>e.c;)s=l(s+1,f),s=s.c*t(s.e),a=s*i,o=I(n.c/s)*s,r=o-a;var h=e.c-r,m=o-n.c,V=h-m;return V>1.1*s&&(V=K(V/s/2)*s,r+=V,o+=V),e.c=r,n.c=o,s}function U(e,i,a,o,r,s){var l=r.c-o.c,h=l/s*t(r.e);if(!n(h)&&(h=w(h),l=h*s,i-e>l&&(h+=1,l=h*s,!a&&h*(s-1)>=i-e&&(s-=1,l=h*s)),l>=i-e)){var m=l-(i-e);o.c=K(e-m/2),r.c=K(i+m/2),o.e=0,r.e=0}return s}function d(e,t,n){if(n=n||5,x)t=e+n;else if(_)e=t-n;else{var i=n-(t-e),o=K(e-i/2),r=K(t+i/2),s=c(e,t,o,r);e=s[0],t=s[1]}return a(e,t,n)}function p(e,t,n){n=n||5;var i=X.min(v(t/n),n)/2.1;return x?t=e+i:_?e=t-i:(e-=i,t+=i),h(e,t,n)}function c(e,t,n,i){return e>=0&&0>n?(i-=n,n=0):0>=t&&i>0&&(n-=i,i=0),[n,i]}function u(e){return e=(+e).toFixed(15).split("."),e.pop().replace(/0+$/,"").length}function y(e,t,n,i){if(x){var a=o(e,4,1);n.e-a.e>6&&(a={c:0,e:n.e}),s(n,a),s(i,a),i.c+=a.c-n.c,n.c=a.c}else if(_){var r=o(t,4);i.e-r.e>6&&(r={c:0,e:i.e}),s(n,r),s(i,r),n.c+=r.c-i.c,i.c=r.c}}function g(e,t,n){var i=n?[n]:k,s=t-e;if(0===s)return t=o(t,3),n=i[0],t.c=K(t.c+n/2),a(t.c-n,t.c,n,t.e);v(t/s)<1e-6&&(t=0),v(e/s)<1e-6&&(e=0);var l,h,m,V=[[5,10],[10,2],[50,10],[100,2]],U=[],d=[],p=o(t-e,3),c=o(e,-1,1),u=o(t,-1);r(c,p,1),r(u,p),s=u.c-c.c,p.c=s;for(var y=i.length;y--;){n=i[y],l=I(s/n),h=l*n-s,m=3*(h+3),m+=2*(n-i[0]+2),n%5===0&&(m-=10);for(var g=V.length;g--;)l%V[g][0]===0&&(m/=V[g][1]);d[y]=[n,l,h,m].join(),U[y]={secs:n,step:l,delta:h,score:m}}return U.sort(function(e,t){return e.score-t.score}),U=U[0],c.c=K(c.c-U.delta/2),u.c=K(u.c+U.delta/2),a(c.c,u.c,U.secs,p.e)}var b,f,k,x,_,L=[10,20,25,50],W=[4,5,6],X=Math,K=X.round,w=X.floor,I=X.ceil,v=X.abs;return i}),n("echarts/chart/line",["require","./base","zrender/shape/Polyline","../util/shape/Icon","../util/shape/HalfSmoothPolygon","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,n,a,o){i.call(this,e,t,n,a,o),this.refresh(a)}function n(e,t,n){var i=t.x,a=t.y,r=t.width,s=t.height,l=s/2;t.symbol.match("empty")&&(e.fillStyle="#fff"),t.brushType="both";var h=t.symbol.replace("empty","").toLowerCase();h.match("star")?(l=h.replace("star","")-0||5,a-=1,h="star"):("rectangle"===h||"arrow"===h)&&(i+=(r-s)/2,r=s);var m="";if(h.match("image")&&(m=h.replace(new RegExp("^image:\\/\\/"),""),h="image",i+=Math.round((r-s)/2)-1,r=s+=2),h=o.prototype.iconLibrary[h]){var V=t.x,U=t.y;e.moveTo(V,U+l),e.lineTo(V+5,U+l),e.moveTo(V+t.width-5,U+l),e.lineTo(V+t.width,U+l);var d=this;h(e,{x:i+4,y:a+4,width:r-8,height:s-8,n:l,image:m},function(){d.modSelf(),n()})}else e.moveTo(i,a+l),e.lineTo(i+r,a+l)}var i=e("./base"),a=e("zrender/shape/Polyline"),o=e("../util/shape/Icon"),r=e("../util/shape/HalfSmoothPolygon");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var s=e("../config");s.line={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid",shadowColor:"rgba(0,0,0,0)",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0}},emphasis:{label:{show:!1}}},symbolSize:2,showAllSymbol:!1};var l=e("../util/ecData"),h=e("zrender/tool/util"),m=e("zrender/tool/color");return t.prototype={type:s.CHART_TYPE_LINE,_buildShape:function(){this.finalPLMap={},this._buildPosition()},_buildHorizontal:function(e,t,n,i){for(var a,o,r,s,l,h,m,V,U,d=this.series,p=n[0][0],c=d[p],u=this.component.xAxis.getAxis(c.xAxisIndex||0),y={},g=0,b=t;b>g&&null!=u.getNameByIndex(g);g++){o=u.getCoordByIndex(g);for(var f=0,k=n.length;k>f;f++){a=this.component.yAxis.getAxis(d[n[f][0]].yAxisIndex||0),l=s=m=h=a.getCoord(0);for(var x=0,_=n[f].length;_>x;x++)p=n[f][x],c=d[p],V=c.data[g],U=this.getDataFromOption(V,"-"),y[p]=y[p]||[],i[p]=i[p]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==U?(U>=0?(s-=x>0?a.getCoordSize(U):l-a.getCoord(U),r=s):0>U&&(h+=x>0?a.getCoordSize(U):a.getCoord(U)-m,r=h),y[p].push([o,r,g,u.getNameByIndex(g),o,l]),i[p].min>U&&(i[p].min=U,i[p].minY=r,i[p].minX=o),i[p].max<U&&(i[p].max=U,i[p].maxY=r,i[p].maxX=o),i[p].sum+=U,i[p].counter++):y[p].length>0&&(this.finalPLMap[p]=this.finalPLMap[p]||[],this.finalPLMap[p].push(y[p]),y[p]=[])}s=this.component.grid.getY();for(var L,f=0,k=n.length;k>f;f++)for(var x=0,_=n[f].length;_>x;x++)p=n[f][x],c=d[p],V=c.data[g],U=this.getDataFromOption(V,"-"),"-"==U&&this.deepQuery([V,c,this.option],"calculable")&&(L=this.deepQuery([V,c],"symbolSize"),s+=2*L+5,r=s,this.shapeList.push(this._getCalculableItem(p,g,u.getNameByIndex(g),o,r,"horizontal")))}for(var W in y)y[W].length>0&&(this.finalPLMap[W]=this.finalPLMap[W]||[],this.finalPLMap[W].push(y[W]),y[W]=[]);this._calculMarkMapXY(i,n,"y"),this._buildBorkenLine(e,this.finalPLMap,u,"horizontal")},_buildVertical:function(e,t,n,i){for(var a,o,r,s,l,h,m,V,U,d=this.series,p=n[0][0],c=d[p],u=this.component.yAxis.getAxis(c.yAxisIndex||0),y={},g=0,b=t;b>g&&null!=u.getNameByIndex(g);g++){r=u.getCoordByIndex(g);for(var f=0,k=n.length;k>f;f++){a=this.component.xAxis.getAxis(d[n[f][0]].xAxisIndex||0),l=s=m=h=a.getCoord(0);for(var x=0,_=n[f].length;_>x;x++)p=n[f][x],c=d[p],V=c.data[g],U=this.getDataFromOption(V,"-"),y[p]=y[p]||[],i[p]=i[p]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},"-"!==U?(U>=0?(s+=x>0?a.getCoordSize(U):a.getCoord(U)-l,o=s):0>U&&(h-=x>0?a.getCoordSize(U):m-a.getCoord(U),o=h),y[p].push([o,r,g,u.getNameByIndex(g),l,r]),i[p].min>U&&(i[p].min=U,i[p].minX=o,i[p].minY=r),i[p].max<U&&(i[p].max=U,i[p].maxX=o,i[p].maxY=r),i[p].sum+=U,i[p].counter++):y[p].length>0&&(this.finalPLMap[p]=this.finalPLMap[p]||[],this.finalPLMap[p].push(y[p]),y[p]=[])}s=this.component.grid.getXend();for(var L,f=0,k=n.length;k>f;f++)for(var x=0,_=n[f].length;_>x;x++)p=n[f][x],c=d[p],V=c.data[g],U=this.getDataFromOption(V,"-"),"-"==U&&this.deepQuery([V,c,this.option],"calculable")&&(L=this.deepQuery([V,c],"symbolSize"),s-=2*L+5,o=s,this.shapeList.push(this._getCalculableItem(p,g,u.getNameByIndex(g),o,r,"vertical")))}for(var W in y)y[W].length>0&&(this.finalPLMap[W]=this.finalPLMap[W]||[],this.finalPLMap[W].push(y[W]),y[W]=[]);this._calculMarkMapXY(i,n,"x"),this._buildBorkenLine(e,this.finalPLMap,u,"vertical")},_buildOther:function(e,t,n,i){for(var a,o=this.series,r={},s=0,l=n.length;l>s;s++)for(var h=0,m=n[s].length;m>h;h++){var V=n[s][h],U=o[V];a=this.component.xAxis.getAxis(U.xAxisIndex||0);var d=this.component.yAxis.getAxis(U.yAxisIndex||0),p=d.getCoord(0);r[V]=r[V]||[],i[V]=i[V]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var c=0,u=U.data.length;u>c;c++){var y=U.data[c],g=this.getDataFromOption(y,"-");if(g instanceof Array){var b=a.getCoord(g[0]),f=d.getCoord(g[1]);r[V].push([b,f,c,g[0],b,p]),i[V].min0>g[0]&&(i[V].min0=g[0],i[V].minY0=f,i[V].minX0=b),i[V].max0<g[0]&&(i[V].max0=g[0],i[V].maxY0=f,i[V].maxX0=b),i[V].sum0+=g[0],i[V].counter0++,i[V].min1>g[1]&&(i[V].min1=g[1],i[V].minY1=f,i[V].minX1=b),i[V].max1<g[1]&&(i[V].max1=g[1],i[V].maxY1=f,i[V].maxX1=b),i[V].sum1+=g[1],i[V].counter1++}}}for(var k in r)r[k].length>0&&(this.finalPLMap[k]=this.finalPLMap[k]||[],this.finalPLMap[k].push(r[k]),r[k]=[]);this._calculMarkMapXY(i,n,"xy"),this._buildBorkenLine(e,this.finalPLMap,a,"other")},_buildBorkenLine:function(e,t,n,i){for(var o,s="other"==i?"horizontal":i,V=this.series,U=e.length-1;U>=0;U--){var d=e[U],p=V[d],c=t[d];if(p.type===this.type&&null!=c)for(var u=this._getBbox(d,s),y=this._sIndex2ColorMap[d],g=this.query(p,"itemStyle.normal.lineStyle.width"),b=this.query(p,"itemStyle.normal.lineStyle.type"),f=this.query(p,"itemStyle.normal.lineStyle.color"),k=this.getItemStyleColor(this.query(p,"itemStyle.normal.color"),d,-1),x=null!=this.query(p,"itemStyle.normal.areaStyle"),_=this.query(p,"itemStyle.normal.areaStyle.color"),L=0,W=c.length;W>L;L++){var X=c[L],K="other"!=i&&this._isLarge(s,X);if(K)X=this._getLargePointList(s,X);else for(var w=0,I=X.length;I>w;w++)o=p.data[X[w][2]],(this.deepQuery([o,p,this.option],"calculable")||this.deepQuery([o,p],"showAllSymbol")||"categoryAxis"===n.type&&n.isMainAxis(X[w][2])&&"none"!=this.deepQuery([o,p],"symbol"))&&this.shapeList.push(this._getSymbol(d,X[w][2],X[w][3],X[w][0],X[w][1],s));var v=new a({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{miterLimit:g,pointList:X,strokeColor:f||k||y,lineWidth:g,lineType:b,smooth:this._getSmooth(p.smooth),smoothConstraint:u,shadowColor:this.query(p,"itemStyle.normal.lineStyle.shadowColor"),shadowBlur:this.query(p,"itemStyle.normal.lineStyle.shadowBlur"),shadowOffsetX:this.query(p,"itemStyle.normal.lineStyle.shadowOffsetX"),shadowOffsetY:this.query(p,"itemStyle.normal.lineStyle.shadowOffsetY")},hoverable:!1,_main:!0,_seriesIndex:d,_orient:s});if(l.pack(v,V[d],d,0,L,V[d].name),this.shapeList.push(v),x){var J=new r({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{miterLimit:g,pointList:h.clone(X).concat([[X[X.length-1][4],X[X.length-1][5]],[X[0][4],X[0][5]]]),brushType:"fill",smooth:this._getSmooth(p.smooth),smoothConstraint:u,color:_?_:m.alpha(y,.5)},highlightStyle:{brushType:"fill"},hoverable:!1,_main:!0,_seriesIndex:d,_orient:s});l.pack(J,V[d],d,0,L,V[d].name),this.shapeList.push(J)}}}},_getBbox:function(e,t){var n=this.component.grid.getBbox(),i=this.xMarkMap[e];return null!=i.minX0?[[Math.min(i.minX0,i.maxX0,i.minX1,i.maxX1),Math.min(i.minY0,i.maxY0,i.minY1,i.maxY1)],[Math.max(i.minX0,i.maxX0,i.minX1,i.maxX1),Math.max(i.minY0,i.maxY0,i.minY1,i.maxY1)]]:("horizontal"===t?(n[0][1]=Math.min(i.minY,i.maxY),n[1][1]=Math.max(i.minY,i.maxY)):(n[0][0]=Math.min(i.minX,i.maxX),n[1][0]=Math.max(i.minX,i.maxX)),n)},_isLarge:function(e,t){return t.length<2?!1:"horizontal"===e?Math.abs(t[0][0]-t[1][0])<.5:Math.abs(t[0][1]-t[1][1])<.5},_getLargePointList:function(e,t){var n;n="horizontal"===e?this.component.grid.getWidth():this.component.grid.getHeight();for(var i=t.length,a=[],o=0;n>o;o++)a[o]=t[Math.floor(i/n*o)];return a},_getSmooth:function(e){return e?.3:0},_getCalculableItem:function(e,t,n,i,a,o){var r=this.series,l=r[e].calculableHolderColor||this.ecTheme.calculableHolderColor||s.calculableHolderColor,h=this._getSymbol(e,t,n,i,a,o);return h.style.color=l,h.style.strokeColor=l,h.rotation=[0,0],h.hoverable=!1,h.draggable=!1,h.style.text=void 0,h},_getSymbol:function(e,t,n,i,a,o){var r=this.series,s=r[e],l=s.data[t],h=this.getSymbolShape(s,e,l,t,n,i,a,this._sIndex2ShapeMap[e],this._sIndex2ColorMap[e],"#fff","vertical"===o?"horizontal":"vertical");return h.zlevel=this.getZlevelBase(),h.z=this.getZBase()+1,this.deepQuery([l,s,this.option],"calculable")&&(this.setCalculable(h),h.draggable=!0),h},getMarkCoord:function(e,t){var n=this.series[e],i=this.xMarkMap[e],a=this.component.xAxis.getAxis(n.xAxisIndex),o=this.component.yAxis.getAxis(n.yAxisIndex);if(t.type&&("max"===t.type||"min"===t.type||"average"===t.type)){var r=null!=t.valueIndex?t.valueIndex:null!=i.maxX0?"1":"";return[i[t.type+"X"+r],i[t.type+"Y"+r],i[t.type+"Line"+r],i[t.type+r]]}return["string"!=typeof t.xAxis&&a.getCoordByIndex?a.getCoordByIndex(t.xAxis||0):a.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&o.getCoordByIndex?o.getCoordByIndex(t.yAxis||0):o.getCoord(t.yAxis||0)]},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},ontooltipHover:function(e,t){for(var n,i,a=e.seriesIndex,o=e.dataIndex,r=a.length;r--;)if(n=this.finalPLMap[a[r]])for(var s=0,l=n.length;l>s;s++){i=n[s];for(var h=0,m=i.length;m>h;h++)o===i[h][2]&&t.push(this._getSymbol(a[r],i[h][2],i[h][3],i[h][0],i[h][1],"horizontal"))}},addDataAnimation:function(e){for(var t=this.series,n={},i=0,a=e.length;a>i;i++)n[e[i][0]]=e[i];for(var o,r,s,l,h,m,V,i=this.shapeList.length-1;i>=0;i--)if(h=this.shapeList[i]._seriesIndex,n[h]&&!n[h][3]){if(this.shapeList[i]._main&&this.shapeList[i].style.pointList.length>1){if(m=this.shapeList[i].style.pointList,r=Math.abs(m[0][0]-m[1][0]),l=Math.abs(m[0][1]-m[1][1]),V="horizontal"===this.shapeList[i]._orient,n[h][2]){if("half-smooth-polygon"===this.shapeList[i].type){var U=m.length;this.shapeList[i].style.pointList[U-3]=m[U-2],this.shapeList[i].style.pointList[U-3][V?0:1]=m[U-4][V?0:1],this.shapeList[i].style.pointList[U-2]=m[U-1]}this.shapeList[i].style.pointList.pop(),V?(o=r,s=0):(o=0,s=-l)}else{if(this.shapeList[i].style.pointList.shift(),"half-smooth-polygon"===this.shapeList[i].type){var d=this.shapeList[i].style.pointList.pop();V?d[0]=m[0][0]:d[1]=m[0][1],this.shapeList[i].style.pointList.push(d)
-}V?(o=-r,s=0):(o=0,s=l)}this.zr.modShape(this.shapeList[i].id,{style:{pointList:this.shapeList[i].style.pointList}},!0)}else{if(n[h][2]&&this.shapeList[i]._dataIndex===t[h].data.length-1){this.zr.delShape(this.shapeList[i].id);continue}if(!n[h][2]&&0===this.shapeList[i]._dataIndex){this.zr.delShape(this.shapeList[i].id);continue}}this.shapeList[i].position=[0,0],this.zr.animate(this.shapeList[i].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[o,s]}).start()}}},o.prototype.iconLibrary.legendLineIcon=n,h.inherits(t,i),e("../chart").define("line",t),t}),n("echarts/util/shape/HalfSmoothPolygon",["require","zrender/shape/Base","zrender/shape/util/smoothBezier","zrender/tool/util","zrender/shape/Polygon"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/shape/util/smoothBezier"),a=e("zrender/tool/util");return t.prototype={type:"half-smooth-polygon",buildPath:function(t,n){var a=n.pointList;if(!(a.length<2))if(n.smooth){var o=i(a.slice(0,-2),n.smooth,!1,n.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var r,s,l,h=a.length,m=0;h-3>m;m++)r=o[2*m],s=o[2*m+1],l=a[m+1],t.bezierCurveTo(r[0],r[1],s[0],s[1],l[0],l[1]);t.lineTo(a[h-2][0],a[h-2][1]),t.lineTo(a[h-1][0],a[h-1][1]),t.lineTo(a[0][0],a[0][1])}else e("zrender/shape/Polygon").prototype.buildPath(t,n)}},a.inherits(t,n),t}),n("echarts/chart/bar",["require","./base","zrender/shape/Rectangle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Rectangle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var a=e("../config");a.bar={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,barMinHeight:0,barGap:"30%",barCategoryGap:"20%",itemStyle:{normal:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}},emphasis:{barBorderColor:"#fff",barBorderRadius:0,barBorderWidth:0,label:{show:!1}}}};var o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:a.CHART_TYPE_BAR,_buildShape:function(){this._buildPosition()},_buildNormal:function(e,t,n,o,r){for(var s,l,h,m,V,U,d,p,c,u,y,g,b=this.series,f=n[0][0],k=b[f],x="horizontal"==r,_=this.component.xAxis,L=this.component.yAxis,W=x?_.getAxis(k.xAxisIndex):L.getAxis(k.yAxisIndex),X=this._mapSize(W,n),K=X.gap,w=X.barGap,I=X.barWidthMap,v=X.barMaxWidthMap,J=X.barWidth,C=X.barMinHeightMap,S=X.interval,E=this.deepQuery([this.ecTheme,a],"island.r"),F=0,T=t;T>F&&null!=W.getNameByIndex(F);F++){x?m=W.getCoordByIndex(F)-K/2:V=W.getCoordByIndex(F)+K/2;for(var A=0,M=n.length;M>A;A++){var z=b[n[A][0]].yAxisIndex||0,O=b[n[A][0]].xAxisIndex||0;s=x?L.getAxis(z):_.getAxis(O),d=U=c=p=s.getCoord(0);for(var D=0,P=n[A].length;P>D;D++)f=n[A][D],k=b[f],y=k.data[F],g=this.getDataFromOption(y,"-"),o[f]=o[f]||{min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,counter:0,average:0},h=Math.min(v[f]||Number.MAX_VALUE,I[f]||J),"-"!==g&&(g>0?(l=D>0?s.getCoordSize(g):x?d-s.getCoord(g):s.getCoord(g)-d,1===P&&C[f]>l&&(l=C[f]),x?(U-=l,V=U):(m=U,U+=l)):0>g?(l=D>0?s.getCoordSize(g):x?s.getCoord(g)-c:c-s.getCoord(g),1===P&&C[f]>l&&(l=C[f]),x?(V=p,p+=l):(p-=l,m=p)):(l=0,x?(U-=l,V=U):(m=U,U+=l)),o[f][F]=x?m+h/2:V-h/2,o[f].min>g&&(o[f].min=g,x?(o[f].minY=V,o[f].minX=o[f][F]):(o[f].minX=m+l,o[f].minY=o[f][F])),o[f].max<g&&(o[f].max=g,x?(o[f].maxY=V,o[f].maxX=o[f][F]):(o[f].maxX=m+l,o[f].maxY=o[f][F])),o[f].sum+=g,o[f].counter++,F%S===0&&(u=this._getBarItem(f,F,W.getNameByIndex(F),m,V-(x?0:h),x?h:l,x?l:h,x?"vertical":"horizontal"),this.shapeList.push(new i(u))));for(var D=0,P=n[A].length;P>D;D++)f=n[A][D],k=b[f],y=k.data[F],g=this.getDataFromOption(y,"-"),h=Math.min(v[f]||Number.MAX_VALUE,I[f]||J),"-"==g&&this.deepQuery([y,k,this.option],"calculable")&&(x?(U-=E,V=U):(m=U,U+=E),u=this._getBarItem(f,F,W.getNameByIndex(F),m,V-(x?0:h),x?h:E,x?E:h,x?"vertical":"horizontal"),u.hoverable=!1,u.draggable=!1,u.style.lineWidth=1,u.style.brushType="stroke",u.style.strokeColor=k.calculableHolderColor||this.ecTheme.calculableHolderColor||a.calculableHolderColor,this.shapeList.push(new i(u)));x?m+=h+w:V-=h+w}}this._calculMarkMapXY(o,n,x?"y":"x")},_buildHorizontal:function(e,t,n,i){return this._buildNormal(e,t,n,i,"horizontal")},_buildVertical:function(e,t,n,i){return this._buildNormal(e,t,n,i,"vertical")},_buildOther:function(e,t,n,a){for(var o=this.series,r=0,s=n.length;s>r;r++)for(var l=0,h=n[r].length;h>l;l++){var m=n[r][l],V=o[m],U=V.xAxisIndex||0,d=this.component.xAxis.getAxis(U),p=d.getCoord(0),c=V.yAxisIndex||0,u=this.component.yAxis.getAxis(c),y=u.getCoord(0);a[m]=a[m]||{min0:Number.POSITIVE_INFINITY,min1:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum0:0,sum1:0,counter0:0,counter1:0,average0:0,average1:0};for(var g=0,b=V.data.length;b>g;g++){var f=V.data[g],k=this.getDataFromOption(f,"-");if(k instanceof Array){var x,_,L=d.getCoord(k[0]),W=u.getCoord(k[1]),X=[f,V],K=this.deepQuery(X,"barWidth")||10,w=this.deepQuery(X,"barHeight");null!=w?(x="horizontal",k[0]>0?(K=L-p,L-=K):K=k[0]<0?p-L:0,_=this._getBarItem(m,g,k[0],L,W-w/2,K,w,x)):(x="vertical",k[1]>0?w=y-W:k[1]<0?(w=W-y,W-=w):w=0,_=this._getBarItem(m,g,k[0],L-K/2,W,K,w,x)),this.shapeList.push(new i(_)),L=d.getCoord(k[0]),W=u.getCoord(k[1]),a[m].min0>k[0]&&(a[m].min0=k[0],a[m].minY0=W,a[m].minX0=L),a[m].max0<k[0]&&(a[m].max0=k[0],a[m].maxY0=W,a[m].maxX0=L),a[m].sum0+=k[0],a[m].counter0++,a[m].min1>k[1]&&(a[m].min1=k[1],a[m].minY1=W,a[m].minX1=L),a[m].max1<k[1]&&(a[m].max1=k[1],a[m].maxY1=W,a[m].maxX1=L),a[m].sum1+=k[1],a[m].counter1++}}}this._calculMarkMapXY(a,n,"xy")},_mapSize:function(e,t,n){var i,a,o=this._findSpecialBarSzie(t,n),r=o.barWidthMap,s=o.barMaxWidthMap,l=o.barMinHeightMap,h=o.sBarWidthCounter,m=o.sBarWidthTotal,V=o.barGap,U=o.barCategoryGap,d=1;if(t.length!=h){if(n)i=e.getGap(),V=0,a=+(i/t.length).toFixed(2),0>=a&&(d=Math.floor(t.length/i),a=1);else if(i="string"==typeof U&&U.match(/%$/)?(e.getGap()*(100-parseFloat(U))/100).toFixed(2)-0:e.getGap()-U,"string"==typeof V&&V.match(/%$/)?(V=parseFloat(V)/100,a=+((i-m)/((t.length-1)*V+t.length-h)).toFixed(2),V=a*V):(V=parseFloat(V),a=+((i-m-V*(t.length-1))/(t.length-h)).toFixed(2)),0>=a)return this._mapSize(e,t,!0)}else if(i=h>1?"string"==typeof U&&U.match(/%$/)?+(e.getGap()*(100-parseFloat(U))/100).toFixed(2):e.getGap()-U:m,a=0,V=h>1?+((i-m)/(h-1)).toFixed(2):0,0>V)return this._mapSize(e,t,!0);return this._recheckBarMaxWidth(t,r,s,l,i,a,V,d)},_findSpecialBarSzie:function(e,t){for(var n,i,a,o,r=this.series,s={},l={},h={},m=0,V=0,U=0,d=e.length;d>U;U++)for(var p={barWidth:!1,barMaxWidth:!1},c=0,u=e[U].length;u>c;c++){var y=e[U][c],g=r[y];if(!t){if(p.barWidth)s[y]=n;else if(n=this.query(g,"barWidth"),null!=n){s[y]=n,V+=n,m++,p.barWidth=!0;for(var b=0,f=c;f>b;b++){var k=e[U][b];s[k]=n}}if(p.barMaxWidth)l[y]=i;else if(i=this.query(g,"barMaxWidth"),null!=i){l[y]=i,p.barMaxWidth=!0;for(var b=0,f=c;f>b;b++){var k=e[U][b];l[k]=i}}}h[y]=this.query(g,"barMinHeight"),a=null!=a?a:this.query(g,"barGap"),o=null!=o?o:this.query(g,"barCategoryGap")}return{barWidthMap:s,barMaxWidthMap:l,barMinHeightMap:h,sBarWidth:n,sBarMaxWidth:i,sBarWidthCounter:m,sBarWidthTotal:V,barGap:a,barCategoryGap:o}},_recheckBarMaxWidth:function(e,t,n,i,a,o,r,s){for(var l=0,h=e.length;h>l;l++){var m=e[l][0];n[m]&&n[m]<o&&(a-=o-n[m])}return{barWidthMap:t,barMaxWidthMap:n,barMinHeightMap:i,gap:a,barWidth:o,barGap:r,interval:s}},_getBarItem:function(e,t,n,i,a,r,l,h){var m,V=this.series,U=V[e],d=U.data[t],p=this._sIndex2ColorMap[e],c=[d,U],u=this.deepMerge(c,"itemStyle.normal"),y=this.deepMerge(c,"itemStyle.emphasis"),g=u.barBorderWidth;m={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery(c,"clickable"),style:{x:i,y:a,width:r,height:l,brushType:"both",color:this.getItemStyleColor(this.deepQuery(c,"itemStyle.normal.color")||p,e,t,d),radius:u.barBorderRadius,lineWidth:g,strokeColor:u.barBorderColor},highlightStyle:{color:this.getItemStyleColor(this.deepQuery(c,"itemStyle.emphasis.color"),e,t,d),radius:y.barBorderRadius,lineWidth:y.barBorderWidth,strokeColor:y.barBorderColor},_orient:h};var b=m.style;m.highlightStyle.color=m.highlightStyle.color||("string"==typeof b.color?s.lift(b.color,-.3):b.color),b.x=Math.floor(b.x),b.y=Math.floor(b.y),b.height=Math.ceil(b.height),b.width=Math.ceil(b.width),g>0&&b.height>g&&b.width>g?(b.y+=g/2,b.height-=g,b.x+=g/2,b.width-=g):b.brushType="fill",m.highlightStyle.textColor=m.highlightStyle.color,m=this.addLabel(m,U,d,n,h);var f=b.textPosition;if("insideLeft"===f||"insideRight"===f||"insideTop"===f||"insideBottom"===f){var k=5;switch(f){case"insideLeft":b.textX=b.x+k,b.textY=b.y+b.height/2,b.textAlign="left",b.textBaseline="middle";break;case"insideRight":b.textX=b.x+b.width-k,b.textY=b.y+b.height/2,b.textAlign="right",b.textBaseline="middle";break;case"insideTop":b.textX=b.x+b.width/2,b.textY=b.y+k/2,b.textAlign="center",b.textBaseline="top";break;case"insideBottom":b.textX=b.x+b.width/2,b.textY=b.y+b.height-k/2,b.textAlign="center",b.textBaseline="bottom"}b.textPosition="specific",b.textColor=b.textColor||"#fff"}return this.deepQuery([d,U,this.option],"calculable")&&(this.setCalculable(m),m.draggable=!0),o.pack(m,V[e],e,V[e].data[t],t,n),m},getMarkCoord:function(e,t){var n,i,a=this.series[e],o=this.xMarkMap[e],r=this.component.xAxis.getAxis(a.xAxisIndex),s=this.component.yAxis.getAxis(a.yAxisIndex);if(!t.type||"max"!==t.type&&"min"!==t.type&&"average"!==t.type)if(o.isHorizontal){n="string"==typeof t.xAxis&&r.getIndexByName?r.getIndexByName(t.xAxis):t.xAxis||0;var l=o[n];l=null!=l?l:"string"!=typeof t.xAxis&&r.getCoordByIndex?r.getCoordByIndex(t.xAxis||0):r.getCoord(t.xAxis||0),i=[l,s.getCoord(t.yAxis||0)]}else{n="string"==typeof t.yAxis&&s.getIndexByName?s.getIndexByName(t.yAxis):t.yAxis||0;var h=o[n];h=null!=h?h:"string"!=typeof t.yAxis&&s.getCoordByIndex?s.getCoordByIndex(t.yAxis||0):s.getCoord(t.yAxis||0),i=[r.getCoord(t.xAxis||0),h]}else{var m=null!=t.valueIndex?t.valueIndex:null!=o.maxX0?"1":"";i=[o[t.type+"X"+m],o[t.type+"Y"+m],o[t.type+"Line"+m],o[t.type+m]]}return i},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,n={},i=0,a=e.length;a>i;i++)n[e[i][0]]=e[i];for(var r,s,l,h,m,V,U,i=this.shapeList.length-1;i>=0;i--)if(V=o.get(this.shapeList[i],"seriesIndex"),n[V]&&!n[V][3]&&"rectangle"===this.shapeList[i].type){if(U=o.get(this.shapeList[i],"dataIndex"),m=t[V],n[V][2]&&U===m.data.length-1){this.zr.delShape(this.shapeList[i].id);continue}if(!n[V][2]&&0===U){this.zr.delShape(this.shapeList[i].id);continue}"horizontal"===this.shapeList[i]._orient?(h=this.component.yAxis.getAxis(m.yAxisIndex||0).getGap(),l=n[V][2]?-h:h,r=0):(s=this.component.xAxis.getAxis(m.xAxisIndex||0).getGap(),r=n[V][2]?s:-s,l=0),this.shapeList[i].position=[0,0],this.zr.animate(this.shapeList[i].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[r,l]}).start()}}},r.inherits(t,n),e("../chart").define("bar",t),t}),n("echarts/chart/scatter",["require","./base","../util/shape/Symbol","../component/axis","../component/grid","../component/dataZoom","../component/dataRange","../config","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("../util/shape/Symbol");e("../component/axis"),e("../component/grid"),e("../component/dataZoom"),e("../component/dataRange");var a=e("../config");a.scatter={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbolSize:4,large:!1,largeThreshold:2e3,itemStyle:{normal:{label:{show:!1}},emphasis:{label:{show:!1}}}};var o=e("zrender/tool/util"),r=e("zrender/tool/color");return t.prototype={type:a.CHART_TYPE_SCATTER,_buildShape:function(){var e=this.series;this._sIndex2ColorMap={},this._symbol=this.option.symbolList,this._sIndex2ShapeMap={},this.selectedMap={},this.xMarkMap={};for(var t,n,i,o,s=this.component.legend,l=[],h=0,m=e.length;m>h;h++)if(t=e[h],n=t.name,t.type===a.CHART_TYPE_SCATTER){if(e[h]=this.reformOption(e[h]),this.legendHoverLink=e[h].legendHoverLink||this.legendHoverLink,this._sIndex2ShapeMap[h]=this.query(t,"symbol")||this._symbol[h%this._symbol.length],s){if(this.selectedMap[n]=s.isSelected(n),this._sIndex2ColorMap[h]=r.alpha(s.getColor(n),.5),i=s.getItemShape(n)){var o=this._sIndex2ShapeMap[h];i.style.brushType=o.match("empty")?"stroke":"both",o=o.replace("empty","").toLowerCase(),o.match("rectangle")&&(i.style.x+=Math.round((i.style.width-i.style.height)/2),i.style.width=i.style.height),o.match("star")&&(i.style.n=o.replace("star","")-0||5,o="star"),o.match("image")&&(i.style.image=o.replace(new RegExp("^image:\\/\\/"),""),i.style.x+=Math.round((i.style.width-i.style.height)/2),i.style.width=i.style.height,o="image"),i.style.iconType=o,s.setItemShape(n,i)}}else this.selectedMap[n]=!0,this._sIndex2ColorMap[h]=r.alpha(this.zr.getColor(h),.5);this.selectedMap[n]&&l.push(h)}this._buildSeries(l),this.addShapeList()},_buildSeries:function(e){if(0!==e.length){for(var t,n,i,a,o,r,s,l,h=this.series,m={},V=0,U=e.length;U>V;V++)if(t=e[V],n=h[t],0!==n.data.length){o=this.component.xAxis.getAxis(n.xAxisIndex||0),r=this.component.yAxis.getAxis(n.yAxisIndex||0),m[t]=[];for(var d=0,p=n.data.length;p>d;d++)i=n.data[d],a=this.getDataFromOption(i,"-"),"-"===a||a.length<2||(s=o.getCoord(a[0]),l=r.getCoord(a[1]),m[t].push([s,l,d,i.name||""]));this.xMarkMap[t]=this._markMap(o,r,n.data,m[t]),this.buildMark(t)}this._buildPointList(m)}},_markMap:function(e,t,n,i){for(var a,o={min0:Number.POSITIVE_INFINITY,max0:Number.NEGATIVE_INFINITY,sum0:0,counter0:0,average0:0,min1:Number.POSITIVE_INFINITY,max1:Number.NEGATIVE_INFINITY,sum1:0,counter1:0,average1:0},r=0,s=i.length;s>r;r++)a=n[i[r][2]].value||n[i[r][2]],o.min0>a[0]&&(o.min0=a[0],o.minY0=i[r][1],o.minX0=i[r][0]),o.max0<a[0]&&(o.max0=a[0],o.maxY0=i[r][1],o.maxX0=i[r][0]),o.sum0+=a[0],o.counter0++,o.min1>a[1]&&(o.min1=a[1],o.minY1=i[r][1],o.minX1=i[r][0]),o.max1<a[1]&&(o.max1=a[1],o.maxY1=i[r][1],o.maxX1=i[r][0]),o.sum1+=a[1],o.counter1++;var l=this.component.grid.getX(),h=this.component.grid.getXend(),m=this.component.grid.getY(),V=this.component.grid.getYend();o.average0=o.sum0/o.counter0;var U=e.getCoord(o.average0);o.averageLine0=[[U,V],[U,m]],o.minLine0=[[o.minX0,V],[o.minX0,m]],o.maxLine0=[[o.maxX0,V],[o.maxX0,m]],o.average1=o.sum1/o.counter1;var d=t.getCoord(o.average1);return o.averageLine1=[[l,d],[h,d]],o.minLine1=[[l,o.minY1],[h,o.minY1]],o.maxLine1=[[l,o.maxY1],[h,o.maxY1]],o},_buildPointList:function(e){var t,n,i,a,o=this.series;for(var r in e)if(t=o[r],n=e[r],t.large&&t.data.length>t.largeThreshold)this.shapeList.push(this._getLargeSymbol(n,this.getItemStyleColor(this.query(t,"itemStyle.normal.color"),r,-1)||this._sIndex2ColorMap[r]));else for(var s=0,l=n.length;l>s;s++)i=n[s],a=this._getSymbol(r,i[2],i[3],i[0],i[1]),a&&this.shapeList.push(a)},_getSymbol:function(e,t,n,i,a){var o,r=this.series,s=r[e],l=s.data[t],h=this.component.dataRange;if(h){if(o=isNaN(l[2])?this._sIndex2ColorMap[e]:h.getColor(l[2]),!o)return null}else o=this._sIndex2ColorMap[e];var m=this.getSymbolShape(s,e,l,t,n,i,a,this._sIndex2ShapeMap[e],o,"rgba(0,0,0,0)","vertical");return m.zlevel=this.getZlevelBase(),m.z=this.getZBase(),m._main=!0,m},_getLargeSymbol:function(e,t){return new i({zlevel:this.getZlevelBase(),z:this.getZBase(),_main:!0,hoverable:!1,style:{pointList:e,color:t,strokeColor:t},highlightStyle:{pointList:[]}})},getMarkCoord:function(e,t){var n,i=this.series[e],a=this.xMarkMap[e],o=this.component.xAxis.getAxis(i.xAxisIndex),r=this.component.yAxis.getAxis(i.yAxisIndex);if(!t.type||"max"!==t.type&&"min"!==t.type&&"average"!==t.type)n=["string"!=typeof t.xAxis&&o.getCoordByIndex?o.getCoordByIndex(t.xAxis||0):o.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&r.getCoordByIndex?r.getCoordByIndex(t.yAxis||0):r.getCoord(t.yAxis||0)];else{var s=null!=t.valueIndex?t.valueIndex:1;n=[a[t.type+"X"+s],a[t.type+"Y"+s],a[t.type+"Line"+s],a[t.type+s]]}return n},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},ondataRange:function(e,t){this.component.dataRange&&(this.refresh(),t.needRefresh=!0)}},o.inherits(t,n),e("../chart").define("scatter",t),t}),n("echarts/component/dataRange",["require","./base","zrender/shape/Text","zrender/shape/Rectangle","../util/shape/HandlePolygon","../config","zrender/tool/util","zrender/tool/event","zrender/tool/area","zrender/tool/color","../component"],function(e){function t(e,t,i,a,o){if("undefined"==typeof this.query(a,"dataRange.min")||"undefined"==typeof this.query(a,"dataRange.max"))return void console.error("option.dataRange.min or option.dataRange.max has not been defined.");n.call(this,e,t,i,a,o);var s=this;s._ondrift=function(e,t){return s.__ondrift(this,e,t)},s._ondragend=function(){return s.__ondragend()},s._dataRangeSelected=function(e){return s.__dataRangeSelected(e)},s._dispatchHoverLink=function(e){return s.__dispatchHoverLink(e)},s._onhoverlink=function(e){return s.__onhoverlink(e)},this._selectedMap={},this._range={},this.refresh(a),t.bind(r.EVENT.HOVER,this._onhoverlink)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Rectangle"),o=e("../util/shape/HandlePolygon"),r=e("../config");r.dataRange={zlevel:0,z:4,show:!0,orient:"vertical",x:"left",y:"bottom",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,itemWidth:20,itemHeight:14,precision:0,splitNumber:5,calculable:!1,selectedMode:!0,hoverLink:!0,realtime:!0,color:["#006edd","#e0ffff"],textStyle:{color:"#333"}};var s=e("zrender/tool/util"),l=e("zrender/tool/event"),h=e("zrender/tool/area"),m=e("zrender/tool/color");return t.prototype={type:r.COMPONENT_TYPE_DATARANGE,_textGap:10,_buildShape:function(){if(this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?this._buildGradient():this._buildItem(),this.dataRangeOption.show)for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e]);this._syncShapeFromRange()},_buildItem:function(){var e,t,n,o,r=this._valueTextList,s=r.length,l=this.getFont(this.dataRangeOption.textStyle),m=this._itemGroupLocation.x,V=this._itemGroupLocation.y,U=this.dataRangeOption.itemWidth,d=this.dataRangeOption.itemHeight,p=this.dataRangeOption.itemGap,c=h.getTextHeight("国",l);"vertical"==this.dataRangeOption.orient&&"right"==this.dataRangeOption.x&&(m=this._itemGroupLocation.x+this._itemGroupLocation.width-U);var u=!0;this.dataRangeOption.text&&(u=!1,this.dataRangeOption.text[0]&&(n=this._getTextShape(m,V,this.dataRangeOption.text[0]),"horizontal"==this.dataRangeOption.orient?m+=h.getTextWidth(this.dataRangeOption.text[0],l)+this._textGap:(V+=c+this._textGap,n.style.y+=c/2+this._textGap,n.style.textBaseline="bottom"),this.shapeList.push(new i(n))));for(var y=0;s>y;y++)e=r[y],o=this.getColorByIndex(y),t=this._getItemShape(m,V,U,d,this._selectedMap[y]?o:"#ccc"),t._idx=y,t.onmousemove=this._dispatchHoverLink,this.dataRangeOption.selectedMode&&(t.clickable=!0,t.onclick=this._dataRangeSelected),this.shapeList.push(new a(t)),u&&(n={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:m+U+5,y:V,color:this._selectedMap[y]?this.dataRangeOption.textStyle.color:"#ccc",text:r[y],textFont:l,textBaseline:"top"},highlightStyle:{brushType:"fill"}},"vertical"==this.dataRangeOption.orient&&"right"==this.dataRangeOption.x&&(n.style.x-=U+10,n.style.textAlign="right"),n._idx=y,n.onmousemove=this._dispatchHoverLink,this.dataRangeOption.selectedMode&&(n.clickable=!0,n.onclick=this._dataRangeSelected),this.shapeList.push(new i(n))),"horizontal"==this.dataRangeOption.orient?m+=U+(u?5:0)+(u?h.getTextWidth(e,l):0)+p:V+=d+p;!u&&this.dataRangeOption.text[1]&&("horizontal"==this.dataRangeOption.orient?m=m-p+this._textGap:V=V-p+this._textGap,n=this._getTextShape(m,V,this.dataRangeOption.text[1]),"horizontal"!=this.dataRangeOption.orient&&(n.style.y-=5,n.style.textBaseline="top"),this.shapeList.push(new i(n)))},_buildGradient:function(){var t,n,o=this.getFont(this.dataRangeOption.textStyle),r=this._itemGroupLocation.x,s=this._itemGroupLocation.y,l=this.dataRangeOption.itemWidth,m=this.dataRangeOption.itemHeight,V=h.getTextHeight("国",o),U=10,d=!0;this.dataRangeOption.text&&(d=!1,this.dataRangeOption.text[0]&&(n=this._getTextShape(r,s,this.dataRangeOption.text[0]),"horizontal"==this.dataRangeOption.orient?r+=h.getTextWidth(this.dataRangeOption.text[0],o)+this._textGap:(s+=V+this._textGap,n.style.y+=V/2+this._textGap,n.style.textBaseline="bottom"),this.shapeList.push(new i(n))));for(var p=e("zrender/tool/color"),c=1/(this.dataRangeOption.color.length-1),u=[],y=0,g=this.dataRangeOption.color.length;g>y;y++)u.push([y*c,this.dataRangeOption.color[y]]);"horizontal"==this.dataRangeOption.orient?(t={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:r,y:s,width:l*U,height:m,color:p.getLinearGradient(r,s,r+l*U,s,u)},hoverable:!1},r+=l*U+this._textGap):(t={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:r,y:s,width:l,height:m*U,color:p.getLinearGradient(r,s,r,s+m*U,u)},hoverable:!1},s+=m*U+this._textGap),this.shapeList.push(new a(t)),this._calculableLocation=t.style,this.dataRangeOption.calculable&&(this._buildFiller(),this._bulidMask(),this._bulidHandle()),this._buildIndicator(),!d&&this.dataRangeOption.text[1]&&(n=this._getTextShape(r,s,this.dataRangeOption.text[1]),this.shapeList.push(new i(n)))},_buildIndicator:function(){var e,t,n=this._calculableLocation.x,i=this._calculableLocation.y,a=this._calculableLocation.width,r=this._calculableLocation.height,s=5;"horizontal"==this.dataRangeOption.orient?"bottom"!=this.dataRangeOption.y?(e=[[n,i+r],[n-s,i+r+s],[n+s,i+r+s]],t="bottom"):(e=[[n,i],[n-s,i-s],[n+s,i-s]],t="top"):"right"!=this.dataRangeOption.x?(e=[[n+a,i],[n+a+s,i-s],[n+a+s,i+s]],t="right"):(e=[[n,i],[n-s,i-s],[n-s,i+s]],t="left"),this._indicatorShape={style:{pointList:e,color:"#fff",__rect:{x:Math.min(e[0][0],e[1][0]),y:Math.min(e[0][1],e[1][1]),width:s*("horizontal"==this.dataRangeOption.orient?2:1),height:s*("horizontal"==this.dataRangeOption.orient?1:2)}},highlightStyle:{brushType:"fill",textPosition:t,textColor:this.dataRangeOption.textStyle.color},hoverable:!1},this._indicatorShape=new o(this._indicatorShape)},_buildFiller:function(){this._fillerShape={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:this._calculableLocation.x,y:this._calculableLocation.y,width:this._calculableLocation.width,height:this._calculableLocation.height,color:"rgba(255,255,255,0)"},highlightStyle:{strokeColor:"rgba(255,255,255,0.5)",lineWidth:1},draggable:!0,ondrift:this._ondrift,ondragend:this._ondragend,onmousemove:this._dispatchHoverLink,_type:"filler"},this._fillerShape=new a(this._fillerShape),this.shapeList.push(this._fillerShape)},_bulidHandle:function(){var e,t,n,i,a,r,s,l,m=this._calculableLocation.x,V=this._calculableLocation.y,U=this._calculableLocation.width,d=this._calculableLocation.height,p=this.getFont(this.dataRangeOption.textStyle),c=h.getTextHeight("国",p),u=Math.max(h.getTextWidth(this._textFormat(this.dataRangeOption.max),p),h.getTextWidth(this._textFormat(this.dataRangeOption.min),p))+2;"horizontal"==this.dataRangeOption.orient?"bottom"!=this.dataRangeOption.y?(e=[[m,V],[m,V+d+c],[m-c,V+d+c],[m-1,V+d],[m-1,V]],t=m-u/2-c,n=V+d+c/2+2,i={x:m-u-c,y:V+d,width:u+c,height:c},a=[[m+U,V],[m+U,V+d+c],[m+U+c,V+d+c],[m+U+1,V+d],[m+U+1,V]],r=m+U+u/2+c,s=n,l={x:m+U,y:V+d,width:u+c,height:c}):(e=[[m,V+d],[m,V-c],[m-c,V-c],[m-1,V],[m-1,V+d]],t=m-u/2-c,n=V-c/2-2,i={x:m-u-c,y:V-c,width:u+c,height:c},a=[[m+U,V+d],[m+U,V-c],[m+U+c,V-c],[m+U+1,V],[m+U+1,V+d]],r=m+U+u/2+c,s=n,l={x:m+U,y:V-c,width:u+c,height:c}):(u+=c,"right"!=this.dataRangeOption.x?(e=[[m,V],[m+U+c,V],[m+U+c,V-c],[m+U,V-1],[m,V-1]],t=m+U+u/2+c/2,n=V-c/2,i={x:m+U,y:V-c,width:u+c,height:c},a=[[m,V+d],[m+U+c,V+d],[m+U+c,V+c+d],[m+U,V+1+d],[m,V+d+1]],r=t,s=V+d+c/2,l={x:m+U,y:V+d,width:u+c,height:c}):(e=[[m+U,V],[m-c,V],[m-c,V-c],[m,V-1],[m+U,V-1]],t=m-u/2-c/2,n=V-c/2,i={x:m-u-c,y:V-c,width:u+c,height:c},a=[[m+U,V+d],[m-c,V+d],[m-c,V+c+d],[m,V+1+d],[m+U,V+d+1]],r=t,s=V+d+c/2,l={x:m-u-c,y:V+d,width:u+c,height:c})),this._startShape={style:{pointList:e,text:this._textFormat(this.dataRangeOption.max),textX:t,textY:n,textFont:p,color:this.getColor(this.dataRangeOption.max),rect:i,x:e[0][0],y:e[0][1],_x:e[0][0],_y:e[0][1]}},this._startShape.highlightStyle={strokeColor:this._startShape.style.color,lineWidth:1},this._endShape={style:{pointList:a,text:this._textFormat(this.dataRangeOption.min),textX:r,textY:s,textFont:p,color:this.getColor(this.dataRangeOption.min),rect:l,x:a[0][0],y:a[0][1],_x:a[0][0],_y:a[0][1]}},this._endShape.highlightStyle={strokeColor:this._endShape.style.color,lineWidth:1},this._startShape.zlevel=this._endShape.zlevel=this.getZlevelBase(),this._startShape.z=this._endShape.z=this.getZBase()+1,this._startShape.draggable=this._endShape.draggable=!0,this._startShape.ondrift=this._endShape.ondrift=this._ondrift,this._startShape.ondragend=this._endShape.ondragend=this._ondragend,this._startShape.style.textColor=this._endShape.style.textColor=this.dataRangeOption.textStyle.color,this._startShape.style.textAlign=this._endShape.style.textAlign="center",this._startShape.style.textPosition=this._endShape.style.textPosition="specific",this._startShape.style.textBaseline=this._endShape.style.textBaseline="middle",this._startShape.style.width=this._endShape.style.width=0,this._startShape.style.height=this._endShape.style.height=0,this._startShape.style.textPosition=this._endShape.style.textPosition="specific",this._startShape=new o(this._startShape),this._endShape=new o(this._endShape),this.shapeList.push(this._startShape),this.shapeList.push(this._endShape)},_bulidMask:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,i=this._calculableLocation.height;this._startMask={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:e,y:t,width:"horizontal"==this.dataRangeOption.orient?0:n,height:"horizontal"==this.dataRangeOption.orient?i:0,color:"#ccc"},hoverable:!1},this._endMask={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:"horizontal"==this.dataRangeOption.orient?e+n:e,y:"horizontal"==this.dataRangeOption.orient?t:t+i,width:"horizontal"==this.dataRangeOption.orient?0:n,height:"horizontal"==this.dataRangeOption.orient?i:0,color:"#ccc"},hoverable:!1},this._startMask=new a(this._startMask),this._endMask=new a(this._endMask),this.shapeList.push(this._startMask),this.shapeList.push(this._endMask)},_buildBackground:function(){var e=this.reformCssArray(this.dataRangeOption.padding);this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-e[3],y:this._itemGroupLocation.y-e[0],width:this._itemGroupLocation.width+e[3]+e[1],height:this._itemGroupLocation.height+e[0]+e[2],brushType:0===this.dataRangeOption.borderWidth?"fill":"both",color:this.dataRangeOption.backgroundColor,strokeColor:this.dataRangeOption.borderColor,lineWidth:this.dataRangeOption.borderWidth}}))},_getItemGroupLocation:function(){var e=this._valueTextList,t=e.length,n=this.dataRangeOption.itemGap,i=this.dataRangeOption.itemWidth,a=this.dataRangeOption.itemHeight,o=0,r=0,s=this.getFont(this.dataRangeOption.textStyle),l=h.getTextHeight("国",s),m=10;if("horizontal"==this.dataRangeOption.orient){if(this.dataRangeOption.text||this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable)o=(this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?i*m+n:t*(i+n))+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[0]?h.getTextWidth(this.dataRangeOption.text[0],s)+this._textGap:0)+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[1]?h.getTextWidth(this.dataRangeOption.text[1],s)+this._textGap:0);else{i+=5;for(var V=0;t>V;V++)o+=i+h.getTextWidth(e[V],s)+n}o-=n,r=Math.max(l,a)}else{var U;if(this.dataRangeOption.text||this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable)r=(this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?a*m+n:t*(a+n))+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[0]?this._textGap+l:0)+(this.dataRangeOption.text&&"undefined"!=typeof this.dataRangeOption.text[1]?this._textGap+l:0),U=Math.max(h.getTextWidth(this.dataRangeOption.text&&this.dataRangeOption.text[0]||"",s),h.getTextWidth(this.dataRangeOption.text&&this.dataRangeOption.text[1]||"",s)),o=Math.max(i,U);else{r=(a+n)*t,i+=5,U=0;for(var V=0;t>V;V++)U=Math.max(U,h.getTextWidth(e[V],s));o=i+U}r-=n}var d,p=this.reformCssArray(this.dataRangeOption.padding),c=this.zr.getWidth();switch(this.dataRangeOption.x){case"center":d=Math.floor((c-o)/2);break;case"left":d=p[3]+this.dataRangeOption.borderWidth;break;case"right":d=c-o-p[1]-this.dataRangeOption.borderWidth;break;default:d=this.parsePercent(this.dataRangeOption.x,c),d=isNaN(d)?0:d}var u,y=this.zr.getHeight();switch(this.dataRangeOption.y){case"top":u=p[0]+this.dataRangeOption.borderWidth;break;case"bottom":u=y-r-p[2]-this.dataRangeOption.borderWidth;break;case"center":u=Math.floor((y-r)/2);break;default:u=this.parsePercent(this.dataRangeOption.y,y),u=isNaN(u)?0:u}if(this.dataRangeOption.calculable){var g=Math.max(h.getTextWidth(this.dataRangeOption.max,s),h.getTextWidth(this.dataRangeOption.min,s))+l;"horizontal"==this.dataRangeOption.orient?(g>d&&(d=g),d+o+g>c&&(d-=g)):(l>u&&(u=l),u+r+l>y&&(u-=l))}return{x:d,y:u,width:o,height:r}},_getTextShape:function(e,t,n){return{zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:"horizontal"==this.dataRangeOption.orient?e:this._itemGroupLocation.x+this._itemGroupLocation.width/2,y:"horizontal"==this.dataRangeOption.orient?this._itemGroupLocation.y+this._itemGroupLocation.height/2:t,color:this.dataRangeOption.textStyle.color,text:n,textFont:this.getFont(this.dataRangeOption.textStyle),textBaseline:"horizontal"==this.dataRangeOption.orient?"middle":"top",textAlign:"horizontal"==this.dataRangeOption.orient?"left":"center"},hoverable:!1}},_getItemShape:function(e,t,n,i,a){return{zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:e,y:t+1,width:n,height:i-2,color:a},highlightStyle:{strokeColor:a,lineWidth:1}}},__ondrift:function(e,t,n){var i=this._calculableLocation.x,a=this._calculableLocation.y,o=this._calculableLocation.width,r=this._calculableLocation.height;return"horizontal"==this.dataRangeOption.orient?e.style.x+t<=i?e.style.x=i:e.style.x+t+e.style.width>=i+o?e.style.x=i+o-e.style.width:e.style.x+=t:e.style.y+n<=a?e.style.y=a:e.style.y+n+e.style.height>=a+r?e.style.y=a+r-e.style.height:e.style.y+=n,"filler"==e._type?this._syncHandleShape():this._syncFillerShape(e),this.dataRangeOption.realtime&&this._dispatchDataRange(),!0},__ondragend:function(){this.isDragend=!0},ondragend:function(e,t){this.isDragend&&e.target&&(t.dragOut=!0,t.dragIn=!0,this.dataRangeOption.realtime||this._dispatchDataRange(),t.needRefresh=!1,this.isDragend=!1)},_syncShapeFromRange:function(){var e=this.dataRangeOption.range||{};if(this._range.end="undefined"!=typeof this._range.end?this._range.end:"undefined"!=typeof e.start?e.start:0,this._range.start="undefined"!=typeof this._range.start?this._range.start:"undefined"!=typeof e.end?e.end:100,100!=this._range.start||0!==this._range.end){if("horizontal"==this.dataRangeOption.orient){var t=this._fillerShape.style.width;this._fillerShape.style.x+=t*(100-this._range.start)/100,this._fillerShape.style.width=t*(this._range.start-this._range.end)/100}else{var n=this._fillerShape.style.height;this._fillerShape.style.y+=n*(100-this._range.start)/100,this._fillerShape.style.height=n*(this._range.start-this._range.end)/100}this.zr.modShape(this._fillerShape.id),this._syncHandleShape()}},_syncHandleShape:function(){var e=this._calculableLocation.x,t=this._calculableLocation.y,n=this._calculableLocation.width,i=this._calculableLocation.height;
-"horizontal"==this.dataRangeOption.orient?(this._startShape.style.x=this._fillerShape.style.x,this._startMask.style.width=this._startShape.style.x-e,this._endShape.style.x=this._fillerShape.style.x+this._fillerShape.style.width,this._endMask.style.x=this._endShape.style.x,this._endMask.style.width=e+n-this._endShape.style.x,this._range.start=Math.ceil(100-(this._startShape.style.x-e)/n*100),this._range.end=Math.floor(100-(this._endShape.style.x-e)/n*100)):(this._startShape.style.y=this._fillerShape.style.y,this._startMask.style.height=this._startShape.style.y-t,this._endShape.style.y=this._fillerShape.style.y+this._fillerShape.style.height,this._endMask.style.y=this._endShape.style.y,this._endMask.style.height=t+i-this._endShape.style.y,this._range.start=Math.ceil(100-(this._startShape.style.y-t)/i*100),this._range.end=Math.floor(100-(this._endShape.style.y-t)/i*100)),this._syncShape()},_syncFillerShape:function(e){var t,n,i=this._calculableLocation.x,a=this._calculableLocation.y,o=this._calculableLocation.width,r=this._calculableLocation.height;"horizontal"==this.dataRangeOption.orient?(t=this._startShape.style.x,n=this._endShape.style.x,e.id==this._startShape.id&&t>=n?(n=t,this._endShape.style.x=t):e.id==this._endShape.id&&t>=n&&(t=n,this._startShape.style.x=t),this._fillerShape.style.x=t,this._fillerShape.style.width=n-t,this._startMask.style.width=t-i,this._endMask.style.x=n,this._endMask.style.width=i+o-n,this._range.start=Math.ceil(100-(t-i)/o*100),this._range.end=Math.floor(100-(n-i)/o*100)):(t=this._startShape.style.y,n=this._endShape.style.y,e.id==this._startShape.id&&t>=n?(n=t,this._endShape.style.y=t):e.id==this._endShape.id&&t>=n&&(t=n,this._startShape.style.y=t),this._fillerShape.style.y=t,this._fillerShape.style.height=n-t,this._startMask.style.height=t-a,this._endMask.style.y=n,this._endMask.style.height=a+r-n,this._range.start=Math.ceil(100-(t-a)/r*100),this._range.end=Math.floor(100-(n-a)/r*100)),this._syncShape()},_syncShape:function(){this._startShape.position=[this._startShape.style.x-this._startShape.style._x,this._startShape.style.y-this._startShape.style._y],this._startShape.style.text=this._textFormat(this._gap*this._range.start+this.dataRangeOption.min),this._startShape.style.color=this._startShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.start+this.dataRangeOption.min),this._endShape.position=[this._endShape.style.x-this._endShape.style._x,this._endShape.style.y-this._endShape.style._y],this._endShape.style.text=this._textFormat(this._gap*this._range.end+this.dataRangeOption.min),this._endShape.style.color=this._endShape.highlightStyle.strokeColor=this.getColor(this._gap*this._range.end+this.dataRangeOption.min),this.zr.modShape(this._startShape.id),this.zr.modShape(this._endShape.id),this.zr.modShape(this._startMask.id),this.zr.modShape(this._endMask.id),this.zr.modShape(this._fillerShape.id),this.zr.refreshNextFrame()},_dispatchDataRange:function(){this.messageCenter.dispatch(r.EVENT.DATA_RANGE,null,{range:{start:this._range.end,end:this._range.start}},this.myChart)},__dataRangeSelected:function(e){if("single"===this.dataRangeOption.selectedMode)for(var t in this._selectedMap)this._selectedMap[t]=!1;var n=e.target._idx;this._selectedMap[n]=!this._selectedMap[n];var i=(this._colorList.length-n)*this._gap+this.dataRangeOption.min;this.messageCenter.dispatch(r.EVENT.DATA_RANGE_SELECTED,e.event,{selected:this._selectedMap,target:n,valueMax:i,valueMin:i-this._gap},this.myChart),this.messageCenter.dispatch(r.EVENT.REFRESH,null,null,this.myChart)},__dispatchHoverLink:function(e){var t,n;if(this.dataRangeOption.calculable){var i,a=this.dataRangeOption.max-this.dataRangeOption.min;i="horizontal"==this.dataRangeOption.orient?(1-(l.getX(e.event)-this._calculableLocation.x)/this._calculableLocation.width)*a:(1-(l.getY(e.event)-this._calculableLocation.y)/this._calculableLocation.height)*a,t=i-.05*a,n=i+.05*a}else{var o=e.target._idx;n=(this._colorList.length-o)*this._gap+this.dataRangeOption.min,t=n-this._gap}this.messageCenter.dispatch(r.EVENT.DATA_RANGE_HOVERLINK,e.event,{valueMin:t,valueMax:n},this.myChart)},__onhoverlink:function(e){if(this.dataRangeOption.show&&this.dataRangeOption.hoverLink&&this._indicatorShape&&e&&null!=e.seriesIndex&&null!=e.dataIndex){var t=e.value;if(""===t||isNaN(t))return;t<this.dataRangeOption.min?t=this.dataRangeOption.min:t>this.dataRangeOption.max&&(t=this.dataRangeOption.max),this._indicatorShape.position="horizontal"==this.dataRangeOption.orient?[(this.dataRangeOption.max-t)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._calculableLocation.width,0]:[0,(this.dataRangeOption.max-t)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._calculableLocation.height],this._indicatorShape.style.text=this._textFormat(e.value),this._indicatorShape.style.color=this.getColor(t),this.zr.addHoverShape(this._indicatorShape)}},_textFormat:function(e,t){if(e=e.toFixed(this.dataRangeOption.precision),t=null!=t?t.toFixed(this.dataRangeOption.precision):"",this.dataRangeOption.formatter){if("string"==typeof this.dataRangeOption.formatter)return this.dataRangeOption.formatter.replace("{value}",e).replace("{value2}",t);if("function"==typeof this.dataRangeOption.formatter)return this.dataRangeOption.formatter.call(this.myChart,e,t)}return""!==t?e+" - "+t:e},refresh:function(e){if(e){this.option=e,this.option.dataRange=this.reformOption(this.option.dataRange),this.dataRangeOption=this.option.dataRange,this.myChart.canvasSupported||(this.dataRangeOption.realtime=!1);var t=this.dataRangeOption.splitNumber<=0||this.dataRangeOption.calculable?100:this.dataRangeOption.splitNumber;if(this._colorList=m.getGradientColors(this.dataRangeOption.color,Math.max((t-this.dataRangeOption.color.length)/(this.dataRangeOption.color.length-1),0)+1),this._colorList.length>t){for(var n=this._colorList.length,i=[this._colorList[0]],a=n/(t-1),o=1;t-1>o;o++)i.push(this._colorList[Math.floor(o*a)]);i.push(this._colorList[n-1]),this._colorList=i}var r=this.dataRangeOption.precision;for(this._gap=(this.dataRangeOption.max-this.dataRangeOption.min)/t;this._gap.toFixed(r)-0!=this._gap&&5>r;)r++;this.dataRangeOption.precision=r,this._gap=((this.dataRangeOption.max-this.dataRangeOption.min)/t).toFixed(r)-0,this._valueTextList=[];for(var o=0;t>o;o++)this._selectedMap[o]=!0,this._valueTextList.unshift(this._textFormat(o*this._gap+this.dataRangeOption.min,(o+1)*this._gap+this.dataRangeOption.min))}this.clear(),this._buildShape()},getColor:function(e){if(isNaN(e))return null;if(this.dataRangeOption.min==this.dataRangeOption.max)return this._colorList[0];if(e<this.dataRangeOption.min?e=this.dataRangeOption.min:e>this.dataRangeOption.max&&(e=this.dataRangeOption.max),this.dataRangeOption.calculable&&(e-(this._gap*this._range.start+this.dataRangeOption.min)>5e-5||e-(this._gap*this._range.end+this.dataRangeOption.min)<-5e-5))return null;var t=this._colorList.length-Math.ceil((e-this.dataRangeOption.min)/(this.dataRangeOption.max-this.dataRangeOption.min)*this._colorList.length);return t==this._colorList.length&&t--,this._selectedMap[t]?this._colorList[t]:null},getColorByIndex:function(e){return e>=this._colorList.length?e=this._colorList.length-1:0>e&&(e=0),this._colorList[e]},onbeforDispose:function(){this.messageCenter.unbind(r.EVENT.HOVER,this._onhoverlink)}},s.inherits(t,n),e("../component").define("dataRange",t),t}),n("echarts/util/shape/HandlePolygon",["require","zrender/shape/Base","zrender/shape/Polygon","zrender/tool/util"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/shape/Polygon"),a=e("zrender/tool/util");return t.prototype={type:"handle-polygon",buildPath:function(e,t){i.prototype.buildPath(e,t)},isCover:function(e,t){var n=this.getTansform(e,t);e=n[0],t=n[1];var i=this.style.rect;return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height?!0:!1}},a.inherits(t,n),t}),n("echarts/chart/k",["require","./base","../util/shape/Candle","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","zrender/tool/util","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("../util/shape/Candle");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var a=e("../config");a.k={zlevel:0,z:2,clickable:!0,hoverable:!0,legendHoverLink:!1,xAxisIndex:0,yAxisIndex:0,itemStyle:{normal:{color:"#fff",color0:"#00aa11",lineStyle:{width:1,color:"#ff3200",color0:"#00aa11"}},emphasis:{}}};var o=e("../util/ecData"),r=e("zrender/tool/util");return t.prototype={type:a.CHART_TYPE_K,_buildShape:function(){var e=this.series;this.selectedMap={};for(var t,n={top:[],bottom:[]},i=0,o=e.length;o>i;i++)e[i].type===a.CHART_TYPE_K&&(e[i]=this.reformOption(e[i]),this.legendHoverLink=e[i].legendHoverLink||this.legendHoverLink,t=this.component.xAxis.getAxis(e[i].xAxisIndex),t.type===a.COMPONENT_TYPE_AXIS_CATEGORY&&n[t.getPosition()].push(i));for(var r in n)n[r].length>0&&this._buildSinglePosition(r,n[r]);this.addShapeList()},_buildSinglePosition:function(e,t){var n=this._mapData(t),i=n.locationMap,a=n.maxDataLength;if(0!==a&&0!==i.length){this._buildHorizontal(t,a,i);for(var o=0,r=t.length;r>o;o++)this.buildMark(t[o])}},_mapData:function(e){for(var t,n,i=this.series,a=this.component.legend,o=[],r=0,s=0,l=e.length;l>s;s++)t=i[e[s]],n=t.name,this.selectedMap[n]=a?a.isSelected(n):!0,this.selectedMap[n]&&o.push(e[s]),r=Math.max(r,t.data.length);return{locationMap:o,maxDataLength:r}},_buildHorizontal:function(e,t,n){for(var i,a,o,r,s,l,h,m,V,U,d=this.series,p={},c=0,u=n.length;u>c;c++){i=n[c],a=d[i],o=a.xAxisIndex||0,r=this.component.xAxis.getAxis(o),h=a.barWidth||Math.floor(r.getGap()/2),U=a.barMaxWidth,U&&h>U&&(h=U),s=a.yAxisIndex||0,l=this.component.yAxis.getAxis(s),p[i]=[];for(var y=0,g=t;g>y&&null!=r.getNameByIndex(y);y++)m=a.data[y],V=this.getDataFromOption(m,"-"),"-"!==V&&4==V.length&&p[i].push([r.getCoordByIndex(y),h,l.getCoord(V[0]),l.getCoord(V[1]),l.getCoord(V[2]),l.getCoord(V[3]),y,r.getNameByIndex(y)])}this._buildKLine(e,p)},_buildKLine:function(e,t){for(var n,i,o,r,s,l,h,m,V,U,d,p,c,u,y,g,b,f=this.series,k=0,x=e.length;x>k;k++)if(b=e[k],d=f[b],u=t[b],this._isLarge(u)&&(u=this._getLargePointList(u)),d.type===a.CHART_TYPE_K&&null!=u){p=d,n=this.query(p,"itemStyle.normal.lineStyle.width"),i=this.query(p,"itemStyle.normal.lineStyle.color"),o=this.query(p,"itemStyle.normal.lineStyle.color0"),r=this.query(p,"itemStyle.normal.color"),s=this.query(p,"itemStyle.normal.color0"),l=this.query(p,"itemStyle.emphasis.lineStyle.width"),h=this.query(p,"itemStyle.emphasis.lineStyle.color"),m=this.query(p,"itemStyle.emphasis.lineStyle.color0"),V=this.query(p,"itemStyle.emphasis.color"),U=this.query(p,"itemStyle.emphasis.color0");for(var _=0,L=u.length;L>_;_++)y=u[_],c=d.data[y[6]],p=c,g=y[3]<y[2],this.shapeList.push(this._getCandle(b,y[6],y[7],y[0],y[1],y[2],y[3],y[4],y[5],g?this.query(p,"itemStyle.normal.color")||r:this.query(p,"itemStyle.normal.color0")||s,this.query(p,"itemStyle.normal.lineStyle.width")||n,g?this.query(p,"itemStyle.normal.lineStyle.color")||i:this.query(p,"itemStyle.normal.lineStyle.color0")||o,g?this.query(p,"itemStyle.emphasis.color")||V||r:this.query(p,"itemStyle.emphasis.color0")||U||s,this.query(p,"itemStyle.emphasis.lineStyle.width")||l||n,g?this.query(p,"itemStyle.emphasis.lineStyle.color")||h||i:this.query(p,"itemStyle.emphasis.lineStyle.color0")||m||o))}},_isLarge:function(e){return e[0][1]<.5},_getLargePointList:function(e){for(var t=this.component.grid.getWidth(),n=e.length,i=[],a=0;t>a;a++)i[a]=e[Math.floor(n/t*a)];return i},_getCandle:function(e,t,n,a,r,s,l,h,m,V,U,d,p,c,u){var y=this.series,g={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery([y[e].data[t],y[e]],"clickable"),hoverable:this.deepQuery([y[e].data[t],y[e]],"hoverable"),style:{x:a,y:[s,l,h,m],width:r,color:V,strokeColor:d,lineWidth:U,brushType:"both"},highlightStyle:{color:p,strokeColor:u,lineWidth:c},_seriesIndex:e};return o.pack(g,y[e],e,y[e].data[t],t,n),g=new i(g)},getMarkCoord:function(e,t){var n=this.series[e],i=this.component.xAxis.getAxis(n.xAxisIndex),a=this.component.yAxis.getAxis(n.yAxisIndex);return["string"!=typeof t.xAxis&&i.getCoordByIndex?i.getCoordByIndex(t.xAxis||0):i.getCoord(t.xAxis||0),"string"!=typeof t.yAxis&&a.getCoordByIndex?a.getCoordByIndex(t.yAxis||0):a.getCoord(t.yAxis||0)]},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,n={},i=0,a=e.length;a>i;i++)n[e[i][0]]=e[i];for(var r,s,l,h,m,V,i=0,a=this.shapeList.length;a>i;i++)if(m=this.shapeList[i]._seriesIndex,n[m]&&!n[m][3]&&"candle"===this.shapeList[i].type){if(V=o.get(this.shapeList[i],"dataIndex"),h=t[m],n[m][2]&&V===h.data.length-1){this.zr.delShape(this.shapeList[i].id);continue}if(!n[m][2]&&0===V){this.zr.delShape(this.shapeList[i].id);continue}s=this.component.xAxis.getAxis(h.xAxisIndex||0).getGap(),r=n[m][2]?s:-s,l=0,this.zr.animate(this.shapeList[i].id,"").when(this.query(this.option,"animationDurationUpdate"),{position:[r,l]}).start()}}},r.inherits(t,n),e("../chart").define("k",t),t}),n("echarts/chart/pie",["require","./base","zrender/shape/Text","zrender/shape/Ring","zrender/shape/Circle","zrender/shape/Sector","zrender/shape/Polyline","../config","../util/ecData","zrender/tool/util","zrender/tool/math","zrender/tool/color","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o);var r=this;r.shapeHandler.onmouseover=function(e){var t=e.target,n=h.get(t,"seriesIndex"),i=h.get(t,"dataIndex"),a=h.get(t,"special"),o=[t.style.x,t.style.y],s=t.style.startAngle,l=t.style.endAngle,m=((l+s)/2+360)%360,V=t.highlightStyle.color,U=r.getLabel(n,i,a,o,m,V,!0);U&&r.zr.addHoverShape(U);var d=r.getLabelLine(n,i,o,t.style.r0,t.style.r,m,V,!0);d&&r.zr.addHoverShape(d)},this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Ring"),o=e("zrender/shape/Circle"),r=e("zrender/shape/Sector"),s=e("zrender/shape/Polyline"),l=e("../config");l.pie={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,center:["50%","50%"],radius:[0,"75%"],clockWise:!0,startAngle:90,minAngle:0,selectedOffset:10,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!1},labelLine:{show:!1,length:20,lineStyle:{width:1,type:"solid"}}}}};var h=e("../util/ecData"),m=e("zrender/tool/util"),V=e("zrender/tool/math"),U=e("zrender/tool/color");return t.prototype={type:l.CHART_TYPE_PIE,_buildShape:function(){var e=this.series,t=this.component.legend;this.selectedMap={},this._selected={};var n,i,r;this._selectedMode=!1;for(var s,m=0,V=e.length;V>m;m++)if(e[m].type===l.CHART_TYPE_PIE){if(e[m]=this.reformOption(e[m]),this.legendHoverLink=e[m].legendHoverLink||this.legendHoverLink,s=e[m].name||"",this.selectedMap[s]=t?t.isSelected(s):!0,!this.selectedMap[s])continue;n=this.parseCenter(this.zr,e[m].center),i=this.parseRadius(this.zr,e[m].radius),this._selectedMode=this._selectedMode||e[m].selectedMode,this._selected[m]=[],this.deepQuery([e[m],this.option],"calculable")&&(r={zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:n[0],y:n[1],r0:i[0]<=10?0:i[0]-10,r:i[1]+10,brushType:"stroke",lineWidth:1,strokeColor:e[m].calculableHolderColor||this.ecTheme.calculableHolderColor||l.calculableHolderColor}},h.pack(r,e[m],m,void 0,-1),this.setCalculable(r),r=i[0]<=10?new o(r):new a(r),this.shapeList.push(r)),this._buildSinglePie(m),this.buildMark(m)}this.addShapeList()},_buildSinglePie:function(e){for(var t,n=this.series,i=n[e],a=i.data,o=this.component.legend,r=0,s=0,l=0,h=Number.NEGATIVE_INFINITY,m=[],V=0,U=a.length;U>V;V++)t=a[V].name,this.selectedMap[t]=o?o.isSelected(t):!0,this.selectedMap[t]&&!isNaN(a[V].value)&&(0!==+a[V].value?r++:s++,l+=+a[V].value,h=Math.max(h,+a[V].value));if(0!==l){for(var d,p,c,u,y,g,b=100,f=i.clockWise,k=(i.startAngle.toFixed(2)-0+360)%360,x=i.minAngle||.01,_=360-x*r-.01*s,L=i.roseType,V=0,U=a.length;U>V;V++)if(t=a[V].name,this.selectedMap[t]&&!isNaN(a[V].value)){if(p=o?o.getColor(t):this.zr.getColor(V),b=a[V].value/l,d="area"!=L?f?k-b*_-(0!==b?x:.01):b*_+k+(0!==b?x:.01):f?k-360/U:360/U+k,d=d.toFixed(2)-0,b=(100*b).toFixed(2),c=this.parseCenter(this.zr,i.center),u=this.parseRadius(this.zr,i.radius),y=+u[0],g=+u[1],"radius"===L?g=a[V].value/h*(g-y)*.8+.2*(g-y)+y:"area"===L&&(g=Math.sqrt(a[V].value/h)*(g-y)+y),f){var W;W=k,k=d,d=W}this._buildItem(m,e,V,b,a[V].selected,c,y,g,k,d,p),f||(k=d)}this._autoLabelLayout(m,c,g);for(var V=0,U=m.length;U>V;V++)this.shapeList.push(m[V]);m=null}},_buildItem:function(e,t,n,i,a,o,r,s,l,m,V){var U=this.series,d=((m+l)/2+360)%360,p=this.getSector(t,n,i,a,o,r,s,l,m,V);h.pack(p,U[t],t,U[t].data[n],n,U[t].data[n].name,i),e.push(p);var c=this.getLabel(t,n,i,o,d,V,!1),u=this.getLabelLine(t,n,o,r,s,d,V,!1);u&&(h.pack(u,U[t],t,U[t].data[n],n,U[t].data[n].name,i),e.push(u)),c&&(h.pack(c,U[t],t,U[t].data[n],n,U[t].data[n].name,i),c._labelLine=u,e.push(c))},getSector:function(e,t,n,i,a,o,s,l,h,m){var d=this.series,p=d[e],c=p.data[t],u=[c,p],y=this.deepMerge(u,"itemStyle.normal")||{},g=this.deepMerge(u,"itemStyle.emphasis")||{},b=this.getItemStyleColor(y.color,e,t,c)||m,f=this.getItemStyleColor(g.color,e,t,c)||("string"==typeof b?U.lift(b,-.2):b),k={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery(u,"clickable"),style:{x:a[0],y:a[1],r0:o,r:s,startAngle:l,endAngle:h,brushType:"both",color:b,lineWidth:y.borderWidth,strokeColor:y.borderColor,lineJoin:"round"},highlightStyle:{color:f,lineWidth:g.borderWidth,strokeColor:g.borderColor,lineJoin:"round"},_seriesIndex:e,_dataIndex:t};if(i){var x=((k.style.startAngle+k.style.endAngle)/2).toFixed(2)-0;k.style._hasSelected=!0,k.style._x=k.style.x,k.style._y=k.style.y;var _=this.query(p,"selectedOffset");k.style.x+=V.cos(x,!0)*_,k.style.y-=V.sin(x,!0)*_,this._selected[e][t]=!0}else this._selected[e][t]=!1;return this._selectedMode&&(k.onclick=this.shapeHandler.onclick),this.deepQuery([c,p,this.option],"calculable")&&(this.setCalculable(k),k.draggable=!0),(this._needLabel(p,c,!0)||this._needLabelLine(p,c,!0))&&(k.onmouseover=this.shapeHandler.onmouseover),k=new r(k)},getLabel:function(e,t,n,a,o,r,s){var l=this.series,h=l[e],U=h.data[t];if(this._needLabel(h,U,s)){var d,p,c,u=s?"emphasis":"normal",y=m.merge(m.clone(U.itemStyle)||{},h.itemStyle),g=y[u].label,b=g.textStyle||{},f=a[0],k=a[1],x=this.parseRadius(this.zr,h.radius),_="middle";g.position=g.position||y.normal.label.position,"center"===g.position?(d=f,p=k,c="center"):"inner"===g.position||"inside"===g.position?(x=(x[0]+x[1])*(g.distance||.5),d=Math.round(f+x*V.cos(o,!0)),p=Math.round(k-x*V.sin(o,!0)),r="#fff",c="center"):(x=x[1]- -y[u].labelLine.length,d=Math.round(f+x*V.cos(o,!0)),p=Math.round(k-x*V.sin(o,!0)),c=o>=90&&270>=o?"right":"left"),"center"!=g.position&&"inner"!=g.position&&"inside"!=g.position&&(d+="left"===c?20:-20),U.__labelX=d-("left"===c?5:-5),U.__labelY=p;var L=new i({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{x:d,y:p,color:b.color||r,text:this.getLabelText(e,t,n,u),textAlign:b.align||c,textBaseline:b.baseline||_,textFont:this.getFont(b)},highlightStyle:{brushType:"fill"}});return L._radius=x,L._labelPosition=g.position||"outer",L._rect=L.getRect(L.style),L._seriesIndex=e,L._dataIndex=t,L}},getLabelText:function(e,t,n,i){var a=this.series,o=a[e],r=o.data[t],s=this.deepQuery([r,o],"itemStyle."+i+".label.formatter");return s?"function"==typeof s?s.call(this.myChart,{seriesIndex:e,seriesName:o.name||"",series:o,dataIndex:t,data:r,name:r.name,value:r.value,percent:n}):"string"==typeof s?(s=s.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{d}","{d0}"),s=s.replace("{a0}",o.name).replace("{b0}",r.name).replace("{c0}",r.value).replace("{d0}",n)):void 0:r.name},getLabelLine:function(e,t,n,i,a,o,r,l){var h=this.series,U=h[e],d=U.data[t];if(this._needLabelLine(U,d,l)){var p=l?"emphasis":"normal",c=m.merge(m.clone(d.itemStyle)||{},U.itemStyle),u=c[p].labelLine,y=u.lineStyle||{},g=n[0],b=n[1],f=a,k=this.parseRadius(this.zr,U.radius)[1]- -u.length,x=V.cos(o,!0),_=V.sin(o,!0);return new s({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{pointList:[[g+f*x,b-f*_],[g+k*x,b-k*_],[d.__labelX,d.__labelY]],strokeColor:y.color||r,lineType:y.type,lineWidth:y.width},_seriesIndex:e,_dataIndex:t})}},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},_autoLabelLayout:function(e,t,n){for(var i=[],a=[],o=0,r=e.length;r>o;o++)("outer"===e[o]._labelPosition||"outside"===e[o]._labelPosition)&&(e[o]._rect._y=e[o]._rect.y,e[o]._rect.x<t[0]?i.push(e[o]):a.push(e[o]));this._layoutCalculate(i,t,n,-1),this._layoutCalculate(a,t,n,1)},_layoutCalculate:function(e,t,n,i){function a(t,n,i){for(var a=t;n>a;a++)if(e[a]._rect.y+=i,e[a].style.y+=i,e[a]._labelLine&&(e[a]._labelLine.style.pointList[1][1]+=i,e[a]._labelLine.style.pointList[2][1]+=i),a>t&&n>a+1&&e[a+1]._rect.y>e[a]._rect.y+e[a]._rect.height)return void o(a,i/2);o(n-1,i/2)}function o(t,n){for(var i=t;i>=0&&(e[i]._rect.y-=n,e[i].style.y-=n,e[i]._labelLine&&(e[i]._labelLine.style.pointList[1][1]-=n,e[i]._labelLine.style.pointList[2][1]-=n),!(i>0&&e[i]._rect.y>e[i-1]._rect.y+e[i-1]._rect.height));i--);}function r(e,t,n,i,a){for(var o,r,s,l=n[0],h=n[1],m=a>0?t?Number.MAX_VALUE:0:t?Number.MAX_VALUE:0,V=0,U=e.length;U>V;V++)r=Math.abs(e[V]._rect.y-h),s=e[V]._radius-i,o=i+s>r?Math.sqrt((i+s+20)*(i+s+20)-Math.pow(e[V]._rect.y-h,2)):Math.abs(e[V]._rect.x+(a>0?0:e[V]._rect.width)-l),t&&o>=m&&(o=m-10),!t&&m>=o&&(o=m+10),e[V]._rect.x=e[V].style.x=l+o*a,e[V]._labelLine&&(e[V]._labelLine.style.pointList[2][0]=l+(o-5)*a,e[V]._labelLine.style.pointList[1][0]=l+(o-20)*a),m=o}e.sort(function(e,t){return e._rect.y-t._rect.y});for(var s,l=0,h=e.length,m=[],V=[],U=0;h>U;U++)s=e[U]._rect.y-l,0>s&&a(U,h,-s,i),l=e[U]._rect.y+e[U]._rect.height;this.zr.getHeight()-l<0&&o(h-1,l-this.zr.getHeight());for(var U=0;h>U;U++)e[U]._rect.y>=t[1]?V.push(e[U]):m.push(e[U]);r(V,!0,t,n,i),r(m,!1,t,n,i)},reformOption:function(e){var t=m.merge;return e=t(t(e||{},m.clone(this.ecTheme.pie||{})),m.clone(l.pie)),e.itemStyle.normal.label.textStyle=this.getTextStyle(e.itemStyle.normal.label.textStyle),e.itemStyle.emphasis.label.textStyle=this.getTextStyle(e.itemStyle.emphasis.label.textStyle),e},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()},addDataAnimation:function(e){for(var t=this.series,n={},i=0,a=e.length;a>i;i++)n[e[i][0]]=e[i];var o={},r={},s={},h=this.shapeList;this.shapeList=[];for(var m,V,U,d={},i=0,a=e.length;a>i;i++)m=e[i][0],V=e[i][2],U=e[i][3],t[m]&&t[m].type===l.CHART_TYPE_PIE&&(V?(U||(o[m+"_"+t[m].data.length]="delete"),d[m]=1):U?d[m]=0:(o[m+"_-1"]="delete",d[m]=-1),this._buildSinglePie(m));for(var p,c,i=0,a=this.shapeList.length;a>i;i++)switch(m=this.shapeList[i]._seriesIndex,p=this.shapeList[i]._dataIndex,c=m+"_"+p,this.shapeList[i].type){case"sector":o[c]=this.shapeList[i];break;case"text":r[c]=this.shapeList[i];break;case"polyline":s[c]=this.shapeList[i]}this.shapeList=[];for(var u,i=0,a=h.length;a>i;i++)if(m=h[i]._seriesIndex,n[m]){if(p=h[i]._dataIndex+d[m],c=m+"_"+p,u=o[c],!u)continue;if("sector"===h[i].type)"delete"!=u?this.zr.animate(h[i].id,"style").when(400,{startAngle:u.style.startAngle,endAngle:u.style.endAngle}).start():this.zr.animate(h[i].id,"style").when(400,d[m]<0?{startAngle:h[i].style.startAngle}:{endAngle:h[i].style.endAngle}).start();else if("text"===h[i].type||"polyline"===h[i].type)if("delete"===u)this.zr.delShape(h[i].id);else switch(h[i].type){case"text":u=r[c],this.zr.animate(h[i].id,"style").when(400,{x:u.style.x,y:u.style.y}).start();break;case"polyline":u=s[c],this.zr.animate(h[i].id,"style").when(400,{pointList:u.style.pointList}).start()}}this.shapeList=h},onclick:function(e){var t=this.series;if(this.isClick&&e.target){this.isClick=!1;for(var n,i=e.target,a=i.style,o=h.get(i,"seriesIndex"),r=h.get(i,"dataIndex"),s=0,m=this.shapeList.length;m>s;s++)if(this.shapeList[s].id===i.id){if(o=h.get(i,"seriesIndex"),r=h.get(i,"dataIndex"),a._hasSelected)i.style.x=i.style._x,i.style.y=i.style._y,i.style._hasSelected=!1,this._selected[o][r]=!1;else{var U=((a.startAngle+a.endAngle)/2).toFixed(2)-0;i.style._hasSelected=!0,this._selected[o][r]=!0,i.style._x=i.style.x,i.style._y=i.style.y,n=this.query(t[o],"selectedOffset"),i.style.x+=V.cos(U,!0)*n,i.style.y-=V.sin(U,!0)*n}this.zr.modShape(i.id,i)}else this.shapeList[s].style._hasSelected&&"single"===this._selectedMode&&(o=h.get(this.shapeList[s],"seriesIndex"),r=h.get(this.shapeList[s],"dataIndex"),this.shapeList[s].style.x=this.shapeList[s].style._x,this.shapeList[s].style.y=this.shapeList[s].style._y,this.shapeList[s].style._hasSelected=!1,this._selected[o][r]=!1,this.zr.modShape(this.shapeList[s].id,this.shapeList[s]));this.messageCenter.dispatch(l.EVENT.PIE_SELECTED,e.event,{selected:this._selected,target:h.get(i,"name")},this.myChart),this.zr.refreshNextFrame()}}},m.inherits(t,n),e("../chart").define("pie",t),t}),n("echarts/chart/radar",["require","./base","zrender/shape/Polygon","../component/polar","../config","../util/ecData","zrender/tool/util","zrender/tool/color","../util/accMath","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Polygon");e("../component/polar");var a=e("../config");a.radar={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,polarIndex:0,itemStyle:{normal:{label:{show:!1},lineStyle:{width:2,type:"solid"}},emphasis:{label:{show:!1}}},symbolSize:2};var o=e("../util/ecData"),r=e("zrender/tool/util"),s=e("zrender/tool/color");return t.prototype={type:a.CHART_TYPE_RADAR,_buildShape:function(){this.selectedMap={},this._symbol=this.option.symbolList,this._queryTarget,this._dropBoxList=[],this._radarDataCounter=0;for(var e,t=this.series,n=this.component.legend,i=0,o=t.length;o>i;i++)t[i].type===a.CHART_TYPE_RADAR&&(this.serie=this.reformOption(t[i]),this.legendHoverLink=t[i].legendHoverLink||this.legendHoverLink,e=this.serie.name||"",this.selectedMap[e]=n?n.isSelected(e):!0,this.selectedMap[e]&&(this._queryTarget=[this.serie,this.option],this.deepQuery(this._queryTarget,"calculable")&&this._addDropBox(i),this._buildSingleRadar(i),this.buildMark(i)));this.addShapeList()},_buildSingleRadar:function(e){for(var t,n,i,a,o=this.component.legend,r=this.serie.data,s=this.deepQuery(this._queryTarget,"calculable"),l=0;l<r.length;l++)i=r[l].name||"",this.selectedMap[i]=o?o.isSelected(i):!0,this.selectedMap[i]&&(o?(n=o.getColor(i),t=o.getItemShape(i),t&&(t.style.brushType=this.deepQuery([r[l],this.serie],"itemStyle.normal.areaStyle")?"both":"stroke",o.setItemShape(i,t))):n=this.zr.getColor(l),a=this._getPointList(this.serie.polarIndex,r[l]),this._addSymbol(a,n,l,e,this.serie.polarIndex),this._addDataShape(a,n,r[l],e,l,s),this._radarDataCounter++)},_getPointList:function(e,t){for(var n,i,a=[],o=this.component.polar,r=0,s=t.value.length;s>r;r++)i=this.getDataFromOption(t.value[r]),n="-"!=i?o.getVector(e,r,i):!1,n&&a.push(n);return a},_addSymbol:function(e,t,n,i,a){for(var r,s=this.series,l=this.component.polar,h=0,m=e.length;m>h;h++)r=this.getSymbolShape(this.deepMerge([s[i].data[n],s[i]]),i,s[i].data[n].value[h],h,l.getIndicatorText(a,h),e[h][0],e[h][1],this._symbol[this._radarDataCounter%this._symbol.length],t,"#fff","vertical"),r.zlevel=this.getZlevelBase(),r.z=this.getZBase()+1,o.set(r,"data",s[i].data[n]),o.set(r,"value",s[i].data[n].value),o.set(r,"dataIndex",n),o.set(r,"special",h),this.shapeList.push(r)},_addDataShape:function(e,t,n,a,r,l){var h=this.series,m=[n,this.serie],V=this.getItemStyleColor(this.deepQuery(m,"itemStyle.normal.color"),a,r,n),U=this.deepQuery(m,"itemStyle.normal.lineStyle.width"),d=this.deepQuery(m,"itemStyle.normal.lineStyle.type"),p=this.deepQuery(m,"itemStyle.normal.areaStyle.color"),c=this.deepQuery(m,"itemStyle.normal.areaStyle"),u={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:e,brushType:c?"both":"stroke",color:p||V||("string"==typeof t?s.alpha(t,.5):t),strokeColor:V||t,lineWidth:U,lineType:d},highlightStyle:{brushType:this.deepQuery(m,"itemStyle.emphasis.areaStyle")||c?"both":"stroke",color:this.deepQuery(m,"itemStyle.emphasis.areaStyle.color")||p||V||("string"==typeof t?s.alpha(t,.5):t),strokeColor:this.getItemStyleColor(this.deepQuery(m,"itemStyle.emphasis.color"),a,r,n)||V||t,lineWidth:this.deepQuery(m,"itemStyle.emphasis.lineStyle.width")||U,lineType:this.deepQuery(m,"itemStyle.emphasis.lineStyle.type")||d}};o.pack(u,h[a],a,n,r,n.name,this.component.polar.getIndicator(h[a].polarIndex)),l&&(u.draggable=!0,this.setCalculable(u)),u=new i(u),this.shapeList.push(u)},_addDropBox:function(e){var t=this.series,n=this.deepQuery(this._queryTarget,"polarIndex");if(!this._dropBoxList[n]){var i=this.component.polar.getDropBox(n);i.zlevel=this.getZlevelBase(),i.z=this.getZBase(),this.setCalculable(i),o.pack(i,t,e,void 0,-1),this.shapeList.push(i),this._dropBoxList[n]=!0}},ondragend:function(e,t){var n=this.series;if(this.isDragend&&e.target){var i=e.target,a=o.get(i,"seriesIndex"),r=o.get(i,"dataIndex");this.component.legend&&this.component.legend.del(n[a].data[r].name),n[a].data.splice(r,1),t.dragOut=!0,t.needRefresh=!0,this.isDragend=!1}},ondrop:function(t,n){var i=this.series;if(this.isDrop&&t.target){var a,r,s=t.target,l=t.dragged,h=o.get(s,"seriesIndex"),m=o.get(s,"dataIndex"),V=this.component.legend;if(-1===m)a={value:o.get(l,"value"),name:o.get(l,"name")},i[h].data.push(a),V&&V.add(a.name,l.style.color||l.style.strokeColor);else{var U=e("../util/accMath");a=i[h].data[m],V&&V.del(a.name),a.name+=this.option.nameConnector+o.get(l,"name"),r=o.get(l,"value");for(var d=0;d<r.length;d++)a.value[d]=U.accAdd(a.value[d],r[d]);V&&V.add(a.name,l.style.color||l.style.strokeColor)}n.dragIn=n.dragIn||!0,this.isDrop=!1}},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},r.inherits(t,n),e("../chart").define("radar",t),t}),n("echarts/component/polar",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Polygon","zrender/shape/Circle","zrender/shape/Ring","../config","zrender/tool/util","../util/coordinates","../util/accMath","../util/smartSteps","../component"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Polygon"),r=e("zrender/shape/Circle"),s=e("zrender/shape/Ring"),l=e("../config");l.polar={zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,boundaryGap:[0,0],splitNumber:5,name:{show:!0,textStyle:{color:"#333"}},axisLine:{show:!0,lineStyle:{color:"#ccc",width:1,type:"solid"}},axisLabel:{show:!1,textStyle:{color:"#333"}},splitArea:{show:!0,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},splitLine:{show:!0,lineStyle:{width:1,color:"#ccc"}},type:"polygon"};var h=e("zrender/tool/util"),m=e("../util/coordinates");return t.prototype={type:l.COMPONENT_TYPE_POLAR,_buildShape:function(){for(var e=0;e<this.polar.length;e++)this._index=e,this.reformOption(this.polar[e]),this._queryTarget=[this.polar[e],this.option],this._createVector(e),this._buildSpiderWeb(e),this._buildText(e),this._adjustIndicatorValue(e),this._addAxisLabel(e);for(var e=0;e<this.shapeList.length;e++)this.zr.addShape(this.shapeList[e])},_createVector:function(e){for(var t,n=this.polar[e],i=this.deepQuery(this._queryTarget,"indicator"),a=i.length,o=n.startAngle,r=2*Math.PI/a,s=this._getRadius(),l=n.__ecIndicator=[],h=0;a>h;h++)t=m.polar2cartesian(s,o*Math.PI/180+r*h),l.push({vector:[t[1],-t[0]]})},_getRadius:function(){var e=this.polar[this._index];return this.parsePercent(e.radius,Math.min(this.zr.getWidth(),this.zr.getHeight())/2)
-},_buildSpiderWeb:function(e){var t=this.polar[e],n=t.__ecIndicator,i=t.splitArea,a=t.splitLine,o=this.getCenter(e),r=t.splitNumber,s=a.lineStyle.color,l=a.lineStyle.width,h=a.show,m=this.deepQuery(this._queryTarget,"axisLine");this._addArea(n,r,o,i,s,l,h),m.show&&this._addLine(n,o,m)},_addAxisLabel:function(t){for(var n,a,o,r,a,s,l,m,V,U,d=e("../util/accMath"),p=this.polar[t],c=this.deepQuery(this._queryTarget,"indicator"),u=p.__ecIndicator,y=this.deepQuery(this._queryTarget,"splitNumber"),g=this.getCenter(t),b=0;b<c.length;b++)if(n=this.deepQuery([c[b],p,this.option],"axisLabel"),n.show){var f=this.deepQuery([n,p,this.option],"textStyle");if(o={},o.textFont=this.getFont(f),o.color=f.color,o=h.merge(o,n),o.lineWidth=o.width,a=u[b].vector,s=u[b].value,m=b/c.length*2*Math.PI,V=n.offset||10,U=n.interval||0,!s)return;for(var k=1;y>=k;k+=U+1)r=h.merge({},o),l=d.accAdd(s.min,d.accMul(s.step,k)),r.text=this.numAddCommas(l),r.x=k*a[0]/y+Math.cos(m)*V+g[0],r.y=k*a[1]/y+Math.sin(m)*V+g[1],this.shapeList.push(new i({zlevel:this.getZlevelBase(),z:this.getZBase(),style:r,draggable:!1,hoverable:!1}))}},_buildText:function(e){for(var t,n,a,o,r,s,l,h=this.polar[e],m=h.__ecIndicator,V=this.deepQuery(this._queryTarget,"indicator"),U=this.getCenter(e),d=0,p=0,c=0;c<V.length;c++)o=this.deepQuery([V[c],h,this.option],"name"),o.show&&(l=this.deepQuery([o,h,this.option],"textStyle"),n={},n.textFont=this.getFont(l),n.color=l.color,n.text="function"==typeof o.formatter?o.formatter.call(this.myChart,V[c].text,c):"string"==typeof o.formatter?o.formatter.replace("{value}",V[c].text):V[c].text,m[c].text=n.text,t=m[c].vector,a=Math.round(t[0])>0?"left":Math.round(t[0])<0?"right":"center",null==o.margin?t=this._mapVector(t,U,1.1):(s=o.margin,d=t[0]>0?s:-s,p=t[1]>0?s:-s,d=0===t[0]?0:d,p=0===t[1]?0:p,t=this._mapVector(t,U,1)),n.textAlign=a,n.x=t[0]+d,n.y=t[1]+p,r=o.rotate?[o.rotate/180*Math.PI,t[0],t[1]]:[0,0,0],this.shapeList.push(new i({zlevel:this.getZlevelBase(),z:this.getZBase(),style:n,draggable:!1,hoverable:!1,rotation:r})))},getIndicatorText:function(e,t){return this.polar[e]&&this.polar[e].__ecIndicator[t]&&this.polar[e].__ecIndicator[t].text},getDropBox:function(e){var t,n,e=e||0,i=this.polar[e],a=this.getCenter(e),o=i.__ecIndicator,r=o.length,s=[],l=i.type;if("polygon"==l){for(var h=0;r>h;h++)t=o[h].vector,s.push(this._mapVector(t,a,1.2));n=this._getShape(s,"fill","rgba(0,0,0,0)","",1)}else"circle"==l&&(n=this._getCircle("",1,1.2,a,"fill","rgba(0,0,0,0)"));return n},_addArea:function(e,t,n,i,a,o,r){for(var s,l,h,m,V=this.deepQuery(this._queryTarget,"type"),U=0;t>U;U++)l=(t-U)/t,r&&("polygon"==V?(m=this._getPointList(e,l,n),s=this._getShape(m,"stroke","",a,o)):"circle"==V&&(s=this._getCircle(a,o,l,n,"stroke")),this.shapeList.push(s)),i.show&&(h=(t-U-1)/t,this._addSplitArea(e,i,l,h,n,U))},_getCircle:function(e,t,n,i,a,o){var s=this._getRadius();return new r({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:i[0],y:i[1],r:s*n,brushType:a,strokeColor:e,lineWidth:t,color:o},hoverable:!1,draggable:!1})},_getRing:function(e,t,n,i){var a=this._getRadius();return new s({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:i[0],y:i[1],r:t*a,r0:n*a,color:e,brushType:"fill"},hoverable:!1,draggable:!1})},_getPointList:function(e,t,n){for(var i,a=[],o=e.length,r=0;o>r;r++)i=e[r].vector,a.push(this._mapVector(i,n,t));return a},_getShape:function(e,t,n,i,a){return new o({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{pointList:e,brushType:t,color:n,strokeColor:i,lineWidth:a},hoverable:!1,draggable:!1})},_addSplitArea:function(e,t,n,i,a,o){var r,s,l,h,m,V=e.length,U=t.areaStyle.color,d=[],V=e.length,p=this.deepQuery(this._queryTarget,"type");if("string"==typeof U&&(U=[U]),s=U.length,r=U[o%s],"polygon"==p)for(var c=0;V>c;c++)d=[],l=e[c].vector,h=e[(c+1)%V].vector,d.push(this._mapVector(l,a,n)),d.push(this._mapVector(l,a,i)),d.push(this._mapVector(h,a,i)),d.push(this._mapVector(h,a,n)),m=this._getShape(d,"fill",r,"",1),this.shapeList.push(m);else"circle"==p&&(m=this._getRing(r,n,i,a),this.shapeList.push(m))},_mapVector:function(e,t,n){return[e[0]*n+t[0],e[1]*n+t[1]]},getCenter:function(e){var e=e||0;return this.parseCenter(this.zr,this.polar[e].center)},_addLine:function(e,t,n){for(var i,a,o=e.length,r=n.lineStyle,s=r.color,l=r.width,h=r.type,m=0;o>m;m++)a=e[m].vector,i=this._getLine(t[0],t[1],a[0]+t[0],a[1]+t[1],s,l,h),this.shapeList.push(i)},_getLine:function(e,t,n,i,o,r,s){return new a({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{xStart:e,yStart:t,xEnd:n,yEnd:i,strokeColor:o,lineWidth:r,lineType:s},hoverable:!1})},_adjustIndicatorValue:function(t){for(var n,i,a=this.polar[t],o=this.deepQuery(this._queryTarget,"indicator"),r=o.length,s=a.__ecIndicator,l=this._getSeriesData(t),h=a.boundaryGap,m=a.splitNumber,V=a.scale,U=e("../util/smartSteps"),d=0;r>d;d++){if("number"==typeof o[d].max)n=o[d].max,i=o[d].min||0;else{var p=this._findValue(l,d,m,h);i=p.min,n=p.max}!V&&i>=0&&n>=0&&(i=0),!V&&0>=i&&0>=n&&(n=0);var c=U(i,n,m);s[d].value={min:c.min,max:c.max,step:c.step}}},_getSeriesData:function(e){for(var t,n,i,a=[],o=this.component.legend,r=0;r<this.series.length;r++)if(t=this.series[r],t.type==l.CHART_TYPE_RADAR){n=t.data||[];for(var s=0;s<n.length;s++)i=this.deepQuery([n[s],t,this.option],"polarIndex")||0,i!=e||o&&!o.isSelected(n[s].name)||a.push(n[s])}return a},_findValue:function(e,t,n,i){function a(e){(e>o||void 0===o)&&(o=e),(r>e||void 0===r)&&(r=e)}var o,r,s;if(e&&0!==e.length){if(1==e.length&&(r=0),1!=e.length)for(var l=0;l<e.length;l++)a(this.getDataFromOption(e[l].value[t]));else{s=e[0];for(var l=0;l<s.value.length;l++)a(this.getDataFromOption(s.value[l]))}var h=Math.abs(o-r);return r-=Math.abs(h*i[0]),o+=Math.abs(h*i[1]),r===o&&(0===o?o=1:o>0?r=o/n:o/=n),{max:o,min:r}}},getVector:function(e,t,n){e=e||0,t=t||0;var i=this.polar[e].__ecIndicator;if(!(t>=i.length)){var a,o=this.polar[e].__ecIndicator[t],r=this.getCenter(e),s=o.vector,l=o.value.max,h=o.value.min;if("undefined"==typeof n)return r;switch(n){case"min":n=h;break;case"max":n=l;break;case"center":n=(l+h)/2}return a=l!=h?(n-h)/(l-h):.5,this._mapVector(s,r,a)}},isInside:function(e){var t=this.getNearestIndex(e);return t?t.polarIndex:-1},getNearestIndex:function(e){for(var t,n,i,a,o,r,s,l,h,V=0;V<this.polar.length;V++){if(t=this.polar[V],n=this.getCenter(V),e[0]==n[0]&&e[1]==n[1])return{polarIndex:V,valueIndex:0};if(i=this._getRadius(),o=t.startAngle,r=t.indicator,s=r.length,l=2*Math.PI/s,a=m.cartesian2polar(e[0]-n[0],n[1]-e[1]),e[0]-n[0]<0&&(a[1]+=Math.PI),a[1]<0&&(a[1]+=2*Math.PI),h=a[1]-o/180*Math.PI+2*Math.PI,Math.abs(Math.cos(h%(l/2)))*i>a[0])return{polarIndex:V,valueIndex:Math.floor((h+l/2)/l)%s}}},getIndicator:function(e){var e=e||0;return this.polar[e].indicator},refresh:function(e){e&&(this.option=e,this.polar=this.option.polar,this.series=this.option.series),this.clear(),this._buildShape()}},h.inherits(t,n),e("../component").define("polar",t),t}),n("echarts/util/coordinates",["require","zrender/tool/math"],function(e){function t(e,t){return[e*i.sin(t),e*i.cos(t)]}function n(e,t){return[Math.sqrt(e*e+t*t),Math.atan(t/e)]}var i=e("zrender/tool/math");return{polar2cartesian:t,cartesian2polar:n}}),n("echarts/chart/chord",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Sector","../util/shape/Ribbon","../util/shape/Icon","zrender/shape/BezierCurve","../config","../util/ecData","zrender/tool/util","zrender/tool/vector","../data/Graph","../layout/Chord","../chart"],function(e){"use strict";function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.scaleLineLength=4,this.scaleUnitAngle=4,this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Sector"),r=e("../util/shape/Ribbon"),s=e("../util/shape/Icon"),l=e("zrender/shape/BezierCurve"),h=e("../config");h.chord={zlevel:0,z:2,clickable:!0,radius:["65%","75%"],center:["50%","50%"],padding:2,sort:"none",sortSub:"none",startAngle:90,clockWise:!0,ribbonType:!0,minRadius:10,maxRadius:20,symbol:"circle",showScale:!1,showScaleText:!1,itemStyle:{normal:{borderWidth:0,borderColor:"#000",label:{show:!0,rotate:!1,distance:5},chordStyle:{width:1,color:"black",borderWidth:1,borderColor:"#999",opacity:.5}},emphasis:{borderWidth:0,borderColor:"#000",chordStyle:{width:1,color:"black",borderWidth:1,borderColor:"#999"}}}};var m=e("../util/ecData"),V=e("zrender/tool/util"),U=e("zrender/tool/vector"),d=e("../data/Graph"),p=e("../layout/Chord");return t.prototype={type:h.CHART_TYPE_CHORD,_init:function(){var e=this.series;this.selectedMap={};for(var t={},n={},i=0,a=e.length;a>i;i++)if(e[i].type===this.type){var o=this.isSelected(e[i].name);this.selectedMap[e[i].name]=o,o&&this.buildMark(i),this.reformOption(e[i]),t[e[i].name]=e[i]}for(var i=0,a=e.length;a>i;i++)if(e[i].type===this.type)if(e[i].insertToSerie){var r=t[e[i].insertToSerie];e[i]._referenceSerie=r}else n[e[i].name]=[e[i]];for(var i=0,a=e.length;a>i;i++)if(e[i].type===this.type&&e[i].insertToSerie){for(var s=e[i]._referenceSerie;s&&s._referenceSerie;)s=s._referenceSerie;n[s.name]&&this.selectedMap[e[i].name]&&n[s.name].push(e[i])}for(var l in n)this._buildChords(n[l]);this.addShapeList()},_getNodeCategory:function(e,t){return e.categories&&e.categories[t.category||0]},_getNodeQueryTarget:function(e,t){var n=this._getNodeCategory(e,t);return[t,n,e]},_getEdgeQueryTarget:function(e,t,n){return n=n||"normal",[t.itemStyle&&t.itemStyle[n],e.itemStyle[n].chordStyle]},_buildChords:function(e){for(var t=[],n=e[0],i=function(e){return e.layout.size>0},a=function(e){return function(t){return e.getEdge(t.node2,t.node1)}},o=0;o<e.length;o++){var r=e[o];if(this.selectedMap[r.name]){var s;r.data&&r.matrix?s=this._getSerieGraphFromDataMatrix(r,n):r.nodes&&r.links&&(s=this._getSerieGraphFromNodeLinks(r,n)),s.filterNode(i,this),r.ribbonType&&s.filterEdge(a(s)),t.push(s),s.__serie=r}}if(t.length){var l=t[0];if(!n.ribbonType){var h=n.minRadius,m=n.maxRadius,V=1/0,U=-1/0;l.eachNode(function(e){U=Math.max(e.layout.size,U),V=Math.min(e.layout.size,V)});var d=(m-h)/(U-V);l.eachNode(function(e){var t=this._getNodeQueryTarget(n,e),i=this.query(t,"symbolSize");e.layout.size=U===V?i||V:i||(e.layout.size-V)*d+h},this)}var c=new p;c.clockWise=n.clockWise,c.startAngle=n.startAngle*Math.PI/180,c.clockWise||(c.startAngle=-c.startAngle),c.padding=n.padding*Math.PI/180,c.sort=n.sort,c.sortSub=n.sortSub,c.directed=n.ribbonType,c.run(t);var u=this.query(n,"itemStyle.normal.label.show");if(n.ribbonType){this._buildSectors(n,0,l,n,t),u&&this._buildLabels(n,0,l,n,t);for(var o=0,y=0;o<e.length;o++)this.selectedMap[e[o].name]&&this._buildRibbons(e,o,t[y++],n);n.showScale&&this._buildScales(n,0,l)}else{this._buildNodeIcons(n,0,l,n,t),u&&this._buildLabels(n,0,l,n,t);for(var o=0,y=0;o<e.length;o++)this.selectedMap[e[o].name]&&this._buildEdgeCurves(e,o,t[y++],n,l)}this._initHoverHandler(e,t)}},_getSerieGraphFromDataMatrix:function(e,t){for(var n=[],i=0,a=[],o=0;o<e.matrix.length;o++)a[o]=e.matrix[o].slice();for(var r=e.data||e.nodes,o=0;o<r.length;o++){var s={},l=r[o];l.rawIndex=o;for(var h in l)"name"===h?s.id=l.name:s[h]=l[h];var m=this._getNodeCategory(t,l),V=m?m.name:l.name;if(this.selectedMap[V]=this.isSelected(V),this.selectedMap[V])n.push(s),i++;else{a.splice(i,1);for(var U=0;U<a.length;U++)a[U].splice(i,1)}}var p=d.fromMatrix(n,a,!0);return p.eachNode(function(e){e.layout={size:e.data.outValue},e.rawIndex=e.data.rawIndex}),p.eachEdge(function(e){e.layout={weight:e.data.weight}}),p},_getSerieGraphFromNodeLinks:function(e,t){for(var n=new d(!0),i=e.data||e.nodes,a=0,o=i.length;o>a;a++){var r=i[a];if(r&&!r.ignore){var s=this._getNodeCategory(t,r),l=s?s.name:r.name;if(this.selectedMap[l]=this.isSelected(l),this.selectedMap[l]){var h=n.addNode(r.name,r);h.rawIndex=a}}}for(var a=0,o=e.links.length;o>a;a++){var m=e.links[a],V=m.source,U=m.target;"number"==typeof V&&(V=i[V],V&&(V=V.name)),"number"==typeof U&&(U=i[U],U&&(U=U.name));var p=n.addEdge(V,U,m);p&&(p.rawIndex=a)}return n.eachNode(function(e){var n=e.data.value;if(null==n)if(n=0,t.ribbonType)for(var i=0;i<e.outEdges.length;i++)n+=e.outEdges[i].data.weight||0;else for(var i=0;i<e.edges.length;i++)n+=e.edges[i].data.weight||0;e.layout={size:n}}),n.eachEdge(function(e){e.layout={weight:null==e.data.weight?1:e.data.weight}}),n},_initHoverHandler:function(e,t){var n=e[0],i=t[0],a=this;i.eachNode(function(e){e.shape.onmouseover=function(){i.eachNode(function(e){e.shape.style.opacity=.1,e.labelShape&&(e.labelShape.style.opacity=.1,e.labelShape.modSelf()),e.shape.modSelf()});for(var n=0;n<t.length;n++)for(var o=0;o<t[n].edges.length;o++){var r=t[n].edges[o],s=a._getEdgeQueryTarget(t[n].__serie,r.data);r.shape.style.opacity=.1*a.deepQuery(s,"opacity"),r.shape.modSelf()}e.shape.style.opacity=1,e.labelShape&&(e.labelShape.style.opacity=1);for(var n=0;n<t.length;n++){var l=t[n].getNodeById(e.id);if(l)for(var o=0;o<l.outEdges.length;o++){var r=l.outEdges[o],s=a._getEdgeQueryTarget(t[n].__serie,r.data);r.shape.style.opacity=a.deepQuery(s,"opacity");var h=t[0].getNodeById(r.node2.id);h&&(h.shape&&(h.shape.style.opacity=1),h.labelShape&&(h.labelShape.style.opacity=1))}}a.zr.refreshNextFrame()},e.shape.onmouseout=function(){i.eachNode(function(e){e.shape.style.opacity=1,e.labelShape&&(e.labelShape.style.opacity=1,e.labelShape.modSelf()),e.shape.modSelf()});for(var e=0;e<t.length;e++)for(var o=0;o<t[e].edges.length;o++){var r=t[e].edges[o],s=[r.data,n];r.shape.style.opacity=a.deepQuery(s,"itemStyle.normal.chordStyle.opacity"),r.shape.modSelf()}a.zr.refreshNextFrame()}})},_buildSectors:function(e,t,n,i){var a=this.parseCenter(this.zr,i.center),r=this.parseRadius(this.zr,i.radius),s=i.clockWise,l=s?1:-1;n.eachNode(function(n){var h=this._getNodeCategory(i,n.data),V=this.getColor(h?h.name:n.id),U=n.layout.startAngle/Math.PI*180*l,d=n.layout.endAngle/Math.PI*180*l,p=new o({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:a[0],y:a[1],r0:r[0],r:r[1],startAngle:U,endAngle:d,brushType:"fill",opacity:1,color:V,clockWise:s},clickable:i.clickable,highlightStyle:{brushType:"fill"}});p.style.lineWidth=this.deepQuery([n.data,i],"itemStyle.normal.borderWidth"),p.highlightStyle.lineWidth=this.deepQuery([n.data,i],"itemStyle.emphasis.borderWidth"),p.style.strokeColor=this.deepQuery([n.data,i],"itemStyle.normal.borderColor"),p.highlightStyle.strokeColor=this.deepQuery([n.data,i],"itemStyle.emphasis.borderColor"),p.style.lineWidth>0&&(p.style.brushType="both"),p.highlightStyle.lineWidth>0&&(p.highlightStyle.brushType="both"),m.pack(p,e,t,n.data,n.rawIndex,n.id,n.category),this.shapeList.push(p),n.shape=p},this)},_buildNodeIcons:function(e,t,n,i){var a=this.parseCenter(this.zr,i.center),o=this.parseRadius(this.zr,i.radius),r=o[1];n.eachNode(function(n){var o=n.layout.startAngle,l=n.layout.endAngle,h=(o+l)/2,V=r*Math.cos(h),U=r*Math.sin(h),d=this._getNodeQueryTarget(i,n.data),p=this._getNodeCategory(i,n.data),c=this.deepQuery(d,"itemStyle.normal.color");c||(c=this.getColor(p?p.name:n.id));var u=new s({zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:-n.layout.size,y:-n.layout.size,width:2*n.layout.size,height:2*n.layout.size,iconType:this.deepQuery(d,"symbol"),color:c,brushType:"both",lineWidth:this.deepQuery(d,"itemStyle.normal.borderWidth"),strokeColor:this.deepQuery(d,"itemStyle.normal.borderColor")},highlightStyle:{color:this.deepQuery(d,"itemStyle.emphasis.color"),lineWidth:this.deepQuery(d,"itemStyle.emphasis.borderWidth"),strokeColor:this.deepQuery(d,"itemStyle.emphasis.borderColor")},clickable:i.clickable,position:[V+a[0],U+a[1]]});m.pack(u,e,t,n.data,n.rawIndex,n.id,n.category),this.shapeList.push(u),n.shape=u},this)},_buildLabels:function(e,t,n,a){var o=this.query(a,"itemStyle.normal.label.color"),r=this.query(a,"itemStyle.normal.label.rotate"),s=this.query(a,"itemStyle.normal.label.distance"),l=this.parseCenter(this.zr,a.center),h=this.parseRadius(this.zr,a.radius),m=a.clockWise,V=m?1:-1;n.eachNode(function(e){var t=e.layout.startAngle/Math.PI*180*V,n=e.layout.endAngle/Math.PI*180*V,m=(t*-V+n*-V)/2;m%=360,0>m&&(m+=360);var d=90>=m||m>=270;m=m*Math.PI/180;var p=[Math.cos(m),-Math.sin(m)],c=0;c=a.ribbonType?a.showScaleText?35+s:s:s+e.layout.size;var u=U.scale([],p,h[1]+c);U.add(u,u,l);var y={zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{text:null==e.data.label?e.id:e.data.label,textAlign:d?"left":"right",color:o||"#000000"}};r?(y.rotation=d?m:Math.PI+m,y.style.x=d?h[1]+c:-h[1]-c,y.style.y=0,y.position=l.slice()):(y.style.x=u[0],y.style.y=u[1]),y.style.textColor=this.deepQuery([e.data,a],"itemStyle.normal.label.textStyle.color")||"#fff",y.style.textFont=this.getFont(this.deepQuery([e.data,a],"itemStyle.normal.label.textStyle")),y=new i(y),this.shapeList.push(y),e.labelShape=y},this)},_buildRibbons:function(e,t,n,i){var a=e[t],o=this.parseCenter(this.zr,i.center),s=this.parseRadius(this.zr,i.radius);n.eachEdge(function(l,h){var V,U=n.getEdge(l.node2,l.node1);if(U&&!l.shape){if(U.shape)return void(l.shape=U.shape);var d=l.layout.startAngle/Math.PI*180,p=l.layout.endAngle/Math.PI*180,c=U.layout.startAngle/Math.PI*180,u=U.layout.endAngle/Math.PI*180;V=this.getColor(1===e.length?l.layout.weight<=U.layout.weight?l.node1.id:l.node2.id:a.name);var y,g,b=this._getEdgeQueryTarget(a,l.data),f=this._getEdgeQueryTarget(a,l.data,"emphasis"),k=new r({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:o[0],y:o[1],r:s[0],source0:d,source1:p,target0:c,target1:u,brushType:"both",opacity:this.deepQuery(b,"opacity"),color:V,lineWidth:this.deepQuery(b,"borderWidth"),strokeColor:this.deepQuery(b,"borderColor"),clockWise:i.clockWise},clickable:i.clickable,highlightStyle:{brushType:"both",opacity:this.deepQuery(f,"opacity"),lineWidth:this.deepQuery(f,"borderWidth"),strokeColor:this.deepQuery(f,"borderColor")}});l.layout.weight<=U.layout.weight?(y=U.node1,g=U.node2):(y=l.node1,g=l.node2),m.pack(k,a,t,l.data,null==l.rawIndex?h:l.rawIndex,l.data.name||y.id+"-"+g.id,y.id,g.id),this.shapeList.push(k),l.shape=k}},this)},_buildEdgeCurves:function(e,t,n,i,a){var o=e[t],r=this.parseCenter(this.zr,i.center);n.eachEdge(function(e,n){var i=a.getNodeById(e.node1.id),s=a.getNodeById(e.node2.id),h=i.shape,V=s.shape,U=this._getEdgeQueryTarget(o,e.data),d=this._getEdgeQueryTarget(o,e.data,"emphasis"),p=new l({zlevel:this.getZlevelBase(),z:this.getZBase(),style:{xStart:h.position[0],yStart:h.position[1],xEnd:V.position[0],yEnd:V.position[1],cpX1:r[0],cpY1:r[1],lineWidth:this.deepQuery(U,"width"),strokeColor:this.deepQuery(U,"color"),opacity:this.deepQuery(U,"opacity")},highlightStyle:{lineWidth:this.deepQuery(d,"width"),strokeColor:this.deepQuery(d,"color"),opacity:this.deepQuery(d,"opacity")}});m.pack(p,o,t,e.data,null==e.rawIndex?n:e.rawIndex,e.data.name||e.node1.id+"-"+e.node2.id,e.node1.id,e.node2.id),this.shapeList.push(p),e.shape=p},this)},_buildScales:function(e,t,n){var o,r,s=e.clockWise,l=this.parseCenter(this.zr,e.center),h=this.parseRadius(this.zr,e.radius),m=s?1:-1,V=0,d=-1/0;e.showScaleText&&(n.eachNode(function(e){var t=e.data.value;t>d&&(d=t),V+=t}),d>1e10?(o="b",r=1e-9):d>1e7?(o="m",r=1e-6):d>1e4?(o="k",r=.001):(o="",r=1));var p=V/(360-e.padding);n.eachNode(function(t){for(var n=t.layout.startAngle/Math.PI*180,V=t.layout.endAngle/Math.PI*180,d=n;;){if(s&&d>V||!s&&V>d)break;var c=d/180*Math.PI,u=[Math.cos(c),Math.sin(c)],y=U.scale([],u,h[1]+1);U.add(y,y,l);var g=U.scale([],u,h[1]+this.scaleLineLength);U.add(g,g,l);var b=new a({zlevel:this.getZlevelBase(),z:this.getZBase()-1,hoverable:!1,style:{xStart:y[0],yStart:y[1],xEnd:g[0],yEnd:g[1],lineCap:"round",brushType:"stroke",strokeColor:"#666",lineWidth:1}});this.shapeList.push(b),d+=m*this.scaleUnitAngle}if(e.showScaleText)for(var f=n,k=5*p*this.scaleUnitAngle,x=0;;){if(s&&f>V||!s&&V>f)break;var c=f;c%=360,0>c&&(c+=360);var _=90>=c||c>=270,L=new i({zlevel:this.getZlevelBase(),z:this.getZBase()-1,hoverable:!1,style:{x:_?h[1]+this.scaleLineLength+4:-h[1]-this.scaleLineLength-4,y:0,text:Math.round(10*x)/10+o,textAlign:_?"left":"right"},position:l.slice(),rotation:_?[-c/180*Math.PI,0,0]:[-(c+180)/180*Math.PI,0,0]});this.shapeList.push(L),x+=k*r,f+=m*this.scaleUnitAngle*5}},this)},refresh:function(e){if(e&&(this.option=e,this.series=e.series),this.legend=this.component.legend,this.legend)this.getColor=function(e){return this.legend.getColor(e)},this.isSelected=function(e){return this.legend.isSelected(e)};else{var t={},n=0;this.getColor=function(e){return t[e]?t[e]:(t[e]||(t[e]=this.zr.getColor(n++)),t[e])},this.isSelected=function(){return!0}}this.backupShapeList(),this._init()},reformOption:function(e){var t=V.merge;e=t(t(e||{},this.ecTheme.chord),h.chord),e.itemStyle.normal.label.textStyle=this.getTextStyle(e.itemStyle.normal.label.textStyle)}},V.inherits(t,n),e("../chart").define("chord",t),t}),n("echarts/util/shape/Ribbon",["require","zrender/shape/Base","zrender/shape/util/PathProxy","zrender/tool/util","zrender/tool/area"],function(e){function t(e){n.call(this,e),this._pathProxy=new i}var n=e("zrender/shape/Base"),i=e("zrender/shape/util/PathProxy"),a=e("zrender/tool/util"),o=e("zrender/tool/area");return t.prototype={type:"ribbon",buildPath:function(e,t){var n=t.clockWise||!1,i=this._pathProxy;i.begin(e);var a=t.x,o=t.y,r=t.r,s=t.source0/180*Math.PI,l=t.source1/180*Math.PI,h=t.target0/180*Math.PI,m=t.target1/180*Math.PI,V=a+Math.cos(s)*r,U=o+Math.sin(s)*r,d=a+Math.cos(l)*r,p=o+Math.sin(l)*r,c=a+Math.cos(h)*r,u=o+Math.sin(h)*r,y=a+Math.cos(m)*r,g=o+Math.sin(m)*r;i.moveTo(V,U),i.arc(a,o,t.r,s,l,!n),i.bezierCurveTo(.7*(a-d)+d,.7*(o-p)+p,.7*(a-c)+c,.7*(o-u)+u,c,u),(t.source0!==t.target0||t.source1!==t.target1)&&(i.arc(a,o,t.r,h,m,!n),i.bezierCurveTo(.7*(a-y)+y,.7*(o-g)+g,.7*(a-V)+V,.7*(o-U)+U,V,U))},getRect:function(e){return e.__rect?e.__rect:(this._pathProxy.isEmpty()||this.buildPath(null,e),this._pathProxy.fastBoundingRect())},isCover:function(e,t){var n=this.getRect(this.style);return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height?o.isInsidePath(this._pathProxy.pathCommands,0,"fill",e,t):void 0}},a.inherits(t,n),t}),n("zrender/shape/BezierCurve",["require","./Base","../tool/util"],function(e){"use strict";var t=e("./Base"),n=function(e){this.brushTypeOnly="stroke",this.textPosition="end",t.call(this,e)};return n.prototype={type:"bezier-curve",buildPath:function(e,t){e.moveTo(t.xStart,t.yStart),"undefined"!=typeof t.cpX2&&"undefined"!=typeof t.cpY2?e.bezierCurveTo(t.cpX1,t.cpY1,t.cpX2,t.cpY2,t.xEnd,t.yEnd):e.quadraticCurveTo(t.cpX1,t.cpY1,t.xEnd,t.yEnd)},getRect:function(e){if(e.__rect)return e.__rect;var t=Math.min(e.xStart,e.xEnd,e.cpX1),n=Math.min(e.yStart,e.yEnd,e.cpY1),i=Math.max(e.xStart,e.xEnd,e.cpX1),a=Math.max(e.yStart,e.yEnd,e.cpY1),o=e.cpX2,r=e.cpY2;"undefined"!=typeof o&&"undefined"!=typeof r&&(t=Math.min(t,o),n=Math.min(n,r),i=Math.max(i,o),a=Math.max(a,r));var s=e.lineWidth||1;return e.__rect={x:t-s,y:n-s,width:i-t+s,height:a-n+s},e.__rect}},e("../tool/util").inherits(n,t),n}),n("echarts/data/Graph",["require","zrender/tool/util"],function(e){var t=e("zrender/tool/util"),n=function(e){this._directed=e||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={}};n.prototype.isDirected=function(){return this._directed},n.prototype.addNode=function(e,t){if(this._nodesMap[e])return this._nodesMap[e];var i=new n.Node(e,t);return this.nodes.push(i),this._nodesMap[e]=i,i},n.prototype.getNodeById=function(e){return this._nodesMap[e]},n.prototype.addEdge=function(e,t,i){if("string"==typeof e&&(e=this._nodesMap[e]),"string"==typeof t&&(t=this._nodesMap[t]),e&&t){var a=e.id+"-"+t.id;if(this._edgesMap[a])return this._edgesMap[a];var o=new n.Edge(e,t,i);return this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),this._edgesMap[a]=o,o}},n.prototype.removeEdge=function(e){var n=e.node1,i=e.node2,a=n.id+"-"+i.id;this._directed&&(n.outEdges.splice(t.indexOf(n.outEdges,e),1),i.inEdges.splice(t.indexOf(i.inEdges,e),1)),n.edges.splice(t.indexOf(n.edges,e),1),n!==i&&i.edges.splice(t.indexOf(i.edges,e),1),delete this._edgesMap[a],this.edges.splice(t.indexOf(this.edges,e),1)},n.prototype.getEdge=function(e,t){return"string"!=typeof e&&(e=e.id),"string"!=typeof t&&(t=t.id),this._directed?this._edgesMap[e+"-"+t]:this._edgesMap[e+"-"+t]||this._edgesMap[t+"-"+e]},n.prototype.removeNode=function(e){if("string"!=typeof e||(e=this._nodesMap[e])){delete this._nodesMap[e.id],this.nodes.splice(t.indexOf(this.nodes,e),1);for(var n=0;n<this.edges.length;){var i=this.edges[n];i.node1===e||i.node2===e?this.removeEdge(i):n++}}},n.prototype.filterNode=function(e,t){for(var n=this.nodes.length,i=0;n>i;)e.call(t,this.nodes[i],i)?i++:(this.removeNode(this.nodes[i]),n--)},n.prototype.filterEdge=function(e,t){for(var n=this.edges.length,i=0;n>i;)e.call(t,this.edges[i],i)?i++:(this.removeEdge(this.edges[i]),n--)},n.prototype.eachNode=function(e,t){for(var n=this.nodes.length,i=0;n>i;i++)this.nodes[i]&&e.call(t,this.nodes[i],i)},n.prototype.eachEdge=function(e,t){for(var n=this.edges.length,i=0;n>i;i++)this.edges[i]&&e.call(t,this.edges[i],i)},n.prototype.clear=function(){this.nodes.length=0,this.edges.length=0,this._nodesMap={},this._edgesMap={}},n.prototype.breadthFirstTraverse=function(e,t,n,i){if("string"==typeof t&&(t=this._nodesMap[t]),t){var a="edges";"out"===n?a="outEdges":"in"===n&&(a="inEdges");for(var o=0;o<this.nodes.length;o++)this.nodes[o].__visited=!1;if(!e.call(i,t,null))for(var r=[t];r.length;)for(var s=r.shift(),l=s[a],o=0;o<l.length;o++){var h=l[o],m=h.node1===s?h.node2:h.node1;if(!m.__visited){if(e.call(m,m,s))return;r.push(m),m.__visited=!0}}}},n.prototype.clone=function(){for(var e=new n(this._directed),t=0;t<this.nodes.length;t++)e.addNode(this.nodes[t].id,this.nodes[t].data);for(var t=0;t<this.edges.length;t++){var i=this.edges[t];e.addEdge(i.node1.id,i.node2.id,i.data)}return e};var i=function(e,t){this.id=e,this.data=t||null,this.inEdges=[],this.outEdges=[],this.edges=[]};i.prototype.degree=function(){return this.edges.length},i.prototype.inDegree=function(){return this.inEdges.length},i.prototype.outDegree=function(){return this.outEdges.length};var a=function(e,t,n){this.node1=e,this.node2=t,this.data=n||null};return n.Node=i,n.Edge=a,n.fromMatrix=function(e,t,i){if(t&&t.length&&t[0].length===t.length&&e.length===t.length){for(var a=t.length,o=new n(i),r=0;a>r;r++){var s=o.addNode(e[r].id,e[r]);s.data.value=0,i&&(s.data.outValue=s.data.inValue=0)}for(var r=0;a>r;r++)for(var l=0;a>l;l++){var h=t[r][l];i&&(o.nodes[r].data.outValue+=h,o.nodes[l].data.inValue+=h),o.nodes[r].data.value+=h,o.nodes[l].data.value+=h}for(var r=0;a>r;r++)for(var l=r;a>l;l++){var h=t[r][l];if(0!==h){var m=o.nodes[r],V=o.nodes[l],U=o.addEdge(m,V,{});if(U.data.weight=h,r!==l&&i&&t[l][r]){var d=o.addEdge(V,m,{});d.data.weight=t[l][r]}}}return o}},n}),n("echarts/layout/Chord",["require"],function(){var e=function(e){e=e||{},this.sort=e.sort||null,this.sortSub=e.sortSub||null,this.padding=.05,this.startAngle=e.startAngle||0,this.clockWise=null==e.clockWise?!1:e.clockWise,this.center=e.center||[0,0],this.directed=!0};e.prototype.run=function(e){e instanceof Array||(e=[e]);var i=e.length;if(i){for(var a=e[0],o=a.nodes.length,r=[],s=0,l=0;o>l;l++){var h=a.nodes[l],m={size:0,subGroups:[],node:h};r.push(m);for(var V=0,U=0;U<e.length;U++){var d=e[U],p=d.getNodeById(h.id);if(p){m.size+=p.layout.size;for(var c=this.directed?p.outEdges:p.edges,u=0;u<c.length;u++){var y=c[u],g=y.layout.weight;m.subGroups.push({weight:g,edge:y,graph:d}),V+=g}}}s+=m.size;for(var b=m.size/V,u=0;u<m.subGroups.length;u++)m.subGroups[u].weight*=b;"ascending"===this.sortSub?m.subGroups.sort(t):"descending"===this.sort&&(m.subGroups.sort(t),m.subGroups.reverse())}"ascending"===this.sort?r.sort(n):"descending"===this.sort&&(r.sort(n),r.reverse());for(var b=(2*Math.PI-this.padding*o)/s,f=this.startAngle,k=this.clockWise?1:-1,l=0;o>l;l++){var m=r[l];m.node.layout.startAngle=f,m.node.layout.endAngle=f+k*m.size*b,m.node.layout.subGroups=[];for(var u=0;u<m.subGroups.length;u++){var x=m.subGroups[u];x.edge.layout.startAngle=f,f+=k*x.weight*b,x.edge.layout.endAngle=f}f=m.node.layout.endAngle+k*this.padding}}};var t=function(e,t){return e.weight-t.weight},n=function(e,t){return e.size-t.size};return e}),n("echarts/chart/force",["require","./base","../data/Graph","../layout/Force","zrender/shape/Line","zrender/shape/BezierCurve","zrender/shape/Image","../util/shape/Icon","../config","../util/ecData","zrender/tool/util","zrender/config","zrender/tool/vector","../chart"],function(e){"use strict";function t(e,t,o,h,m){var V=this;r.call(this,e,t,o,h,m),this.__nodePositionMap={},this._graph=new s(!0),this._layout=new l,this._layout.onupdate=function(){V._step()},this._steps=1,this.ondragstart=function(){n.apply(V,arguments)},this.ondragend=function(){a.apply(V,arguments)},this.ondrop=function(){},this.shapeHandler.ondragstart=function(){V.isDragstart=!0},this.onmousemove=function(){i.apply(V,arguments)},this.refresh(h)}function n(e){if(this.isDragstart&&e.target){var t=e.target;t.fixed=!0,this.isDragstart=!1,this.zr.on(u.EVENT.MOUSEMOVE,this.onmousemove)}}function i(){this._layout.temperature=.8,this._step()}function a(e,t){if(this.isDragend&&e.target){var n=e.target;n.fixed=!1,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1,this.zr.un(u.EVENT.MOUSEMOVE,this.onmousemove)}}function o(e,t,n){var i=y.create();return i[0]=(Math.random()-.5)*n+e,i[1]=(Math.random()-.5)*n+t,i}var r=e("./base"),s=e("../data/Graph"),l=e("../layout/Force"),h=e("zrender/shape/Line"),m=e("zrender/shape/BezierCurve"),V=e("zrender/shape/Image"),U=e("../util/shape/Icon"),d=e("../config");d.force={zlevel:1,z:2,center:["50%","50%"],size:"100%",preventOverlap:!1,coolDown:.99,minRadius:10,maxRadius:20,ratioScaling:!1,large:!1,useWorker:!1,steps:1,scaling:1,gravity:1,symbol:"circle",symbolSize:0,linkSymbol:null,linkSymbolSize:[10,15],draggable:!0,clickable:!0,roam:!1,itemStyle:{normal:{label:{show:!1,position:"inside"},nodeStyle:{brushType:"both",borderColor:"#5182ab",borderWidth:1},linkStyle:{color:"#5182ab",width:1,type:"line"}},emphasis:{label:{show:!1},nodeStyle:{},linkStyle:{opacity:0}}}};var p=e("../util/ecData"),c=e("zrender/tool/util"),u=e("zrender/config"),y=e("zrender/tool/vector");return t.prototype={constructor:t,type:d.CHART_TYPE_FORCE,_init:function(){var e,t=this.component.legend,n=this.series;this.clear();for(var i=0,a=n.length;a>i;i++){var o=n[i];if(o.type===d.CHART_TYPE_FORCE){if(n[i]=this.reformOption(n[i]),e=n[i].name||"",this.selectedMap[e]=t?t.isSelected(e):!0,!this.selectedMap[e])continue;this.buildMark(i),this._initSerie(o,i);break}}this.animationEffect()},_getNodeCategory:function(e,t){return e.categories&&e.categories[t.category||0]},_getNodeQueryTarget:function(e,t,n){n=n||"normal";var i=this._getNodeCategory(e,t)||{};return[t.itemStyle&&t.itemStyle[n],i&&i.itemStyle&&i.itemStyle[n],e.itemStyle[n].nodeStyle]},_getEdgeQueryTarget:function(e,t,n){return n=n||"normal",[t.itemStyle&&t.itemStyle[n],e.itemStyle[n].linkStyle]},_initSerie:function(e,t){this._temperature=1,this._graph=e.data?this._getSerieGraphFromDataMatrix(e):this._getSerieGraphFromNodeLinks(e),this._buildLinkShapes(e,t),this._buildNodeShapes(e,t);var n=e.roam===!0||"move"===e.roam,i=e.roam===!0||"scale"===e.roam;this.zr.modLayer(this.getZlevelBase(),{panable:n,zoomable:i}),(this.query("markPoint.effect.show")||this.query("markLine.effect.show"))&&this.zr.modLayer(d.EFFECT_ZLEVEL,{panable:n,zoomable:i}),this._initLayout(e),this._step()},_getSerieGraphFromDataMatrix:function(e){for(var t=[],n=0,i=[],a=0;a<e.matrix.length;a++)i[a]=e.matrix[a].slice();for(var o=e.data||e.nodes,a=0;a<o.length;a++){var r={},l=o[a];for(var h in l)"name"===h?r.id=l.name:r[h]=l[h];var m=this._getNodeCategory(e,l),V=m?m.name:l.name;if(this.selectedMap[V]=this.isSelected(V),this.selectedMap[V])t.push(r),n++;else{i.splice(n,1);for(var U=0;U<i.length;U++)i[U].splice(n,1)}}var d=s.fromMatrix(t,i,!0);return d.eachNode(function(e,t){e.layout={size:e.data.value,mass:0},e.rawIndex=t}),d.eachEdge(function(e){e.layout={weight:e.data.weight}
-}),d},_getSerieGraphFromNodeLinks:function(e){for(var t=new s(!0),n=e.data||e.nodes,i=0,a=n.length;a>i;i++){var o=n[i];if(o&&!o.ignore){var r=this._getNodeCategory(e,o),l=r?r.name:o.name;if(this.selectedMap[l]=this.isSelected(l),this.selectedMap[l]){var h=t.addNode(o.name,o);h.rawIndex=i}}}for(var i=0,a=e.links.length;a>i;i++){var m=e.links[i],V=m.source,U=m.target;"number"==typeof V&&(V=n[V],V&&(V=V.name)),"number"==typeof U&&(U=n[U],U&&(U=U.name));var d=t.addEdge(V,U,m);d&&(d.rawIndex=i)}return t.eachNode(function(e){var t=e.data.value;if(null==t){t=0;for(var n=0;n<e.edges.length;n++)t+=e.edges[n].data.weight||0}e.layout={size:t,mass:0}}),t.eachEdge(function(e){e.layout={weight:null==e.data.weight?1:e.data.weight}}),t},_initLayout:function(e){var t=this._graph,n=t.nodes.length,i=this.query(e,"minRadius"),a=this.query(e,"maxRadius");this._steps=e.steps||1,this._layout.center=this.parseCenter(this.zr,e.center),this._layout.width=this.parsePercent(e.size,this.zr.getWidth()),this._layout.height=this.parsePercent(e.size,this.zr.getHeight()),this._layout.large=e.large,this._layout.scaling=e.scaling,this._layout.ratioScaling=e.ratioScaling,this._layout.gravity=e.gravity,this._layout.temperature=1,this._layout.coolDown=e.coolDown,this._layout.preventNodeEdgeOverlap=e.preventOverlap,this._layout.preventNodeOverlap=e.preventOverlap;for(var r=1/0,s=-1/0,l=0;n>l;l++){var h=t.nodes[l];s=Math.max(h.layout.size,s),r=Math.min(h.layout.size,r)}for(var m=s-r,l=0;n>l;l++){var h=t.nodes[l];m>0?(h.layout.size=(h.layout.size-r)*(a-i)/m+i,h.layout.mass=h.layout.size/a):(h.layout.size=(a-i)/2,h.layout.mass=.5)}for(var l=0;n>l;l++){var h=t.nodes[l];if("undefined"!=typeof this.__nodePositionMap[h.id])h.layout.position=y.create(),y.copy(h.layout.position,this.__nodePositionMap[h.id]);else if("undefined"!=typeof h.data.initial)h.layout.position=y.create(),y.copy(h.layout.position,h.data.initial);else{var V=this._layout.center,U=Math.min(this._layout.width,this._layout.height);h.layout.position=o(V[0],V[1],.8*U)}var d=h.shape.style,p=h.layout.size;d.width=d.width||2*p,d.height=d.height||2*p,d.x=-d.width/2,d.y=-d.height/2,y.copy(h.shape.position,h.layout.position)}n=t.edges.length,s=-1/0;for(var l=0;n>l;l++){var c=t.edges[l];c.layout.weight>s&&(s=c.layout.weight)}for(var l=0;n>l;l++){var c=t.edges[l];c.layout.weight/=s}this._layout.init(t,e.useWorker)},_buildNodeShapes:function(e,t){var n=this._graph,i=this.query(e,"categories");n.eachNode(function(n){var a=this._getNodeCategory(e,n.data),o=[n.data,a,e],r=this._getNodeQueryTarget(e,n.data),s=this._getNodeQueryTarget(e,n.data,"emphasis"),l=new U({style:{x:0,y:0,color:this.deepQuery(r,"color"),brushType:"both",strokeColor:this.deepQuery(r,"strokeColor")||this.deepQuery(r,"borderColor"),lineWidth:this.deepQuery(r,"lineWidth")||this.deepQuery(r,"borderWidth")},highlightStyle:{color:this.deepQuery(s,"color"),strokeColor:this.deepQuery(s,"strokeColor")||this.deepQuery(s,"borderColor"),lineWidth:this.deepQuery(s,"lineWidth")||this.deepQuery(s,"borderWidth")},clickable:e.clickable,zlevel:this.getZlevelBase(),z:this.getZBase()});l.style.color||(l.style.color=this.getColor(a?a.name:n.id)),l.style.iconType=this.deepQuery(o,"symbol"),l.style.width=l.style.height=2*(this.deepQuery(o,"symbolSize")||0),l.style.iconType.match("image")&&(l.style.image=l.style.iconType.replace(new RegExp("^image:\\/\\/"),""),l=new V({style:l.style,highlightStyle:l.highlightStyle,clickable:l.clickable,zlevel:this.getZlevelBase(),z:this.getZBase()})),this.deepQuery(o,"itemStyle.normal.label.show")&&(l.style.text=null==n.data.label?n.id:n.data.label,l.style.textPosition=this.deepQuery(o,"itemStyle.normal.label.position"),l.style.textColor=this.deepQuery(o,"itemStyle.normal.label.textStyle.color"),l.style.textFont=this.getFont(this.deepQuery(o,"itemStyle.normal.label.textStyle")||{})),this.deepQuery(o,"itemStyle.emphasis.label.show")&&(l.highlightStyle.textPosition=this.deepQuery(o,"itemStyle.emphasis.label.position"),l.highlightStyle.textColor=this.deepQuery(o,"itemStyle.emphasis.label.textStyle.color"),l.highlightStyle.textFont=this.getFont(this.deepQuery(o,"itemStyle.emphasis.label.textStyle")||{})),this.deepQuery(o,"draggable")&&(this.setCalculable(l),l.dragEnableTime=0,l.draggable=!0,l.ondragstart=this.shapeHandler.ondragstart,l.ondragover=null);var h="";if("undefined"!=typeof n.category){var a=i[n.category];h=a&&a.name||""}p.pack(l,e,t,n.data,n.rawIndex,n.data.name||"",n.category),this.shapeList.push(l),this.zr.addShape(l),n.shape=l},this)},_buildLinkShapes:function(e,t){for(var n=this._graph,i=n.edges.length,a=0;i>a;a++){var o=n.edges[a],r=o.data,s=o.node1,l=o.node2,V=this._getEdgeQueryTarget(e,r),d=this.deepQuery(V,"type");e.linkSymbol&&"none"!==e.linkSymbol&&(d="line");var u="line"===d?h:m,y=new u({style:{xStart:0,yStart:0,xEnd:0,yEnd:0},clickable:this.query(e,"clickable"),highlightStyle:{},zlevel:this.getZlevelBase(),z:this.getZBase()});if(c.merge(y.style,this.query(e,"itemStyle.normal.linkStyle"),!0),c.merge(y.highlightStyle,this.query(e,"itemStyle.emphasis.linkStyle"),!0),"undefined"!=typeof r.itemStyle&&(r.itemStyle.normal&&c.merge(y.style,r.itemStyle.normal,!0),r.itemStyle.emphasis&&c.merge(y.highlightStyle,r.itemStyle.emphasis,!0)),y.style.lineWidth=y.style.lineWidth||y.style.width,y.style.strokeColor=y.style.strokeColor||y.style.color,y.highlightStyle.lineWidth=y.highlightStyle.lineWidth||y.highlightStyle.width,y.highlightStyle.strokeColor=y.highlightStyle.strokeColor||y.highlightStyle.color,p.pack(y,e,t,o.data,null==o.rawIndex?a:o.rawIndex,o.data.name||s.id+" - "+l.id,s.id,l.id),this.shapeList.push(y),this.zr.addShape(y),o.shape=y,e.linkSymbol&&"none"!==e.linkSymbol){var g=new U({style:{x:-5,y:0,width:e.linkSymbolSize[0],height:e.linkSymbolSize[1],iconType:e.linkSymbol,brushType:"fill",color:y.style.strokeColor},highlightStyle:{brushType:"fill"},position:[0,0],rotation:0});y._symbolShape=g,this.shapeList.push(g),this.zr.addShape(g)}}},_updateLinkShapes:function(){for(var e=y.create(),t=this._graph.edges,n=0,i=t.length;i>n;n++){var a=t[n],o=a.node1.shape,r=a.node2.shape,s=o.position,l=r.position;if(a.shape.style.xStart=s[0],a.shape.style.yStart=s[1],a.shape.style.xEnd=l[0],a.shape.style.yEnd=l[1],"bezier-curve"===a.shape.type&&(a.shape.style.cpX1=(s[0]+l[0])/2-(l[1]-s[1])/4,a.shape.style.cpY1=(s[1]+l[1])/2-(s[0]-l[0])/4),a.shape.modSelf(),a.shape._symbolShape){var h=a.shape._symbolShape;y.copy(h.position,r.position),y.sub(e,o.position,r.position),y.normalize(e,e),y.scaleAndAdd(h.position,h.position,e,r.style.width/2+2);var m=Math.atan2(e[1],e[0]);h.rotation=Math.PI/2-m,h.modSelf()}}},_syncNodePositions:function(){for(var e=this._graph,t=0;t<e.nodes.length;t++){var n=e.nodes[t],i=n.layout.position,a=n.data,o=n.shape,r=o.fixed||a.fixX,s=o.fixed||a.fixY;r===!0?r=1:isNaN(r)&&(r=0),s===!0?s=1:isNaN(s)&&(s=0),o.position[0]+=(i[0]-o.position[0])*(1-r),o.position[1]+=(i[1]-o.position[1])*(1-s),y.copy(i,o.position);var l=a.name;if(l){var h=this.__nodePositionMap[l];h||(h=this.__nodePositionMap[l]=y.create()),y.copy(h,i)}o.modSelf()}},_step:function(){this._syncNodePositions(),this._updateLinkShapes(),this.zr.refreshNextFrame(),this._layout.temperature>.01?this._layout.step(this._steps):this.messageCenter.dispatch(d.EVENT.FORCE_LAYOUT_END,{},{},this.myChart)},refresh:function(e){if(e&&(this.option=e,this.series=this.option.series),this.legend=this.component.legend,this.legend)this.getColor=function(e){return this.legend.getColor(e)},this.isSelected=function(e){return this.legend.isSelected(e)};else{var t={},n=0;this.getColor=function(e){return t[e]?t[e]:(t[e]||(t[e]=this.zr.getColor(n++)),t[e])},this.isSelected=function(){return!0}}this._init()},dispose:function(){this.clear(),this.shapeList=null,this.effectList=null,this._layout.dispose(),this._layout=null,this.__nodePositionMap={}},getPosition:function(){var e=[];return this._graph.eachNode(function(t){t.layout&&e.push({name:t.data.name,position:Array.prototype.slice.call(t.layout.position)})}),e}},c.inherits(t,r),e("../chart").define("force",t),t}),n("echarts/layout/Force",["require","./forceLayoutWorker","zrender/tool/vector"],function(e){function t(){if("undefined"!=typeof Worker&&"undefined"!=typeof Blob)try{var e=new Blob([i.getWorkerCode()]);n=window.URL.createObjectURL(e)}catch(t){n=""}return n}var n,i=e("./forceLayoutWorker"),a=e("zrender/tool/vector"),o=window.requestAnimationFrame||window.msRequestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){setTimeout(e,16)},r="undefined"==typeof Float32Array?Array:Float32Array,s=function(e){"undefined"==typeof n&&t(),e=e||{},this.width=e.width||500,this.height=e.height||500,this.center=e.center||[this.width/2,this.height/2],this.ratioScaling=e.ratioScaling||!1,this.scaling=e.scaling||1,this.gravity="undefined"!=typeof e.gravity?e.gravity:1,this.large=e.large||!1,this.preventNodeOverlap=e.preventNodeOverlap||!1,this.preventNodeEdgeOverlap=e.preventNodeEdgeOverlap||!1,this.maxSpeedIncrease=e.maxSpeedIncrease||1,this.onupdate=e.onupdate||function(){},this.temperature=e.temperature||1,this.coolDown=e.coolDown||.99,this._layout=null,this._layoutWorker=null;var i=this,a=this._$onupdate;this._$onupdate=function(e){a.call(i,e)}};return s.prototype.updateConfig=function(){var e=this.width,t=this.height,n=Math.min(e,t),i={center:this.center,width:this.ratioScaling?e:n,height:this.ratioScaling?t:n,scaling:this.scaling||1,gravity:this.gravity||1,barnesHutOptimize:this.large,preventNodeOverlap:this.preventNodeOverlap,preventNodeEdgeOverlap:this.preventNodeEdgeOverlap,maxSpeedIncrease:this.maxSpeedIncrease};if(this._layoutWorker)this._layoutWorker.postMessage({cmd:"updateConfig",config:i});else for(var a in i)this._layout[a]=i[a]},s.prototype.init=function(e,t){if(n&&t)try{this._layoutWorker||(this._layoutWorker=new Worker(n),this._layoutWorker.onmessage=this._$onupdate),this._layout=null}catch(a){this._layoutWorker=null,this._layout||(this._layout=new i)}else this._layout||(this._layout=new i),this._layoutWorker&&(this._layoutWorker.terminate(),this._layoutWorker=null);this.temperature=1,this.graph=e;for(var o=e.nodes.length,s=new r(2*o),l=new r(o),h=new r(o),m=0;o>m;m++){var V=e.nodes[m];s[2*m]=V.layout.position[0],s[2*m+1]=V.layout.position[1],l[m]="undefined"==typeof V.layout.mass?1:V.layout.mass,h[m]="undefined"==typeof V.layout.size?1:V.layout.size,V.layout.__index=m}o=e.edges.length;for(var U=new r(2*o),d=new r(o),m=0;o>m;m++){var p=e.edges[m];U[2*m]=p.node1.layout.__index,U[2*m+1]=p.node2.layout.__index,d[m]=p.layout.weight||1}this._layoutWorker?this._layoutWorker.postMessage({cmd:"init",nodesPosition:s,nodesMass:l,nodesSize:h,edges:U,edgesWeight:d}):(this._layout.initNodes(s,l,h),this._layout.initEdges(U,d)),this.updateConfig()},s.prototype.step=function(e){var t=this.graph.nodes;if(this._layoutWorker){for(var n=new r(2*t.length),i=0;i<t.length;i++){var s=t[i];n[2*i]=s.layout.position[0],n[2*i+1]=s.layout.position[1]}this._layoutWorker.postMessage(n.buffer,[n.buffer]),this._layoutWorker.postMessage({cmd:"update",steps:e,temperature:this.temperature,coolDown:this.coolDown});for(var i=0;e>i;i++)this.temperature*=this.coolDown}else{o(this._$onupdate);for(var i=0;i<t.length;i++){var s=t[i];a.copy(this._layout.nodes[i].position,s.layout.position)}for(var i=0;e>i;i++)this._layout.temperature=this.temperature,this._layout.update(),this.temperature*=this.coolDown}},s.prototype._$onupdate=function(e){if(this._layoutWorker){for(var t=new Float32Array(e.data),n=0;n<this.graph.nodes.length;n++){var i=this.graph.nodes[n];i.layout.position[0]=t[2*n],i.layout.position[1]=t[2*n+1]}this.onupdate&&this.onupdate()}else if(this._layout){for(var n=0;n<this.graph.nodes.length;n++){var i=this.graph.nodes[n];a.copy(i.layout.position,this._layout.nodes[n].position)}this.onupdate&&this.onupdate()}},s.prototype.dispose=function(){this._layoutWorker&&this._layoutWorker.terminate(),this._layoutWorker=null,this._layout=null},s}),n("echarts/layout/forceLayoutWorker",["require","zrender/tool/vector"],function o(e){"use strict";function t(){this.subRegions=[],this.nSubRegions=0,this.node=null,this.mass=0,this.centerOfMass=null,this.bbox=new l(4),this.size=0}function n(){this.position=r.create(),this.force=r.create(),this.forcePrev=r.create(),this.speed=r.create(),this.speedPrev=r.create(),this.mass=1,this.inDegree=0,this.outDegree=0}function i(e,t){this.node1=e,this.node2=t,this.weight=1}function a(){this.barnesHutOptimize=!1,this.barnesHutTheta=1.5,this.repulsionByDegree=!1,this.preventNodeOverlap=!1,this.preventNodeEdgeOverlap=!1,this.strongGravity=!0,this.gravity=1,this.scaling=1,this.edgeWeightInfluence=1,this.center=[0,0],this.width=500,this.height=500,this.maxSpeedIncrease=1,this.nodes=[],this.edges=[],this.bbox=new l(4),this._rootRegion=new t,this._rootRegion.centerOfMass=r.create(),this._massArr=null,this._k=0}var r,s="undefined"==typeof window&&"undefined"==typeof e;r=s?{create:function(e,t){var n=new Float32Array(2);return n[0]=e||0,n[1]=t||0,n},dist:function(e,t){var n=t[0]-e[0],i=t[1]-e[1];return Math.sqrt(n*n+i*i)},len:function(e){var t=e[0],n=e[1];return Math.sqrt(t*t+n*n)},scaleAndAdd:function(e,t,n,i){return e[0]=t[0]+n[0]*i,e[1]=t[1]+n[1]*i,e},scale:function(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e},add:function(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e},sub:function(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e},dot:function(e,t){return e[0]*t[0]+e[1]*t[1]},normalize:function(e,t){var n=t[0],i=t[1],a=n*n+i*i;return a>0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a),e},negate:function(e,t){return e[0]=-t[0],e[1]=-t[1],e},copy:function(e,t){return e[0]=t[0],e[1]=t[1],e},set:function(e,t,n){return e[0]=t,e[1]=n,e}}:e("zrender/tool/vector");var l="undefined"==typeof Float32Array?Array:Float32Array;if(t.prototype.beforeUpdate=function(){for(var e=0;e<this.nSubRegions;e++)this.subRegions[e].beforeUpdate();this.mass=0,this.centerOfMass&&(this.centerOfMass[0]=0,this.centerOfMass[1]=0),this.nSubRegions=0,this.node=null},t.prototype.afterUpdate=function(){this.subRegions.length=this.nSubRegions;for(var e=0;e<this.nSubRegions;e++)this.subRegions[e].afterUpdate()},t.prototype.addNode=function(e){if(0===this.nSubRegions){if(null==this.node)return void(this.node=e);this._addNodeToSubRegion(this.node),this.node=null}this._addNodeToSubRegion(e),this._updateCenterOfMass(e)},t.prototype.findSubRegion=function(e,t){for(var n=0;n<this.nSubRegions;n++){var i=this.subRegions[n];if(i.contain(e,t))return i}},t.prototype.contain=function(e,t){return this.bbox[0]<=e&&this.bbox[2]>=e&&this.bbox[1]<=t&&this.bbox[3]>=t},t.prototype.setBBox=function(e,t,n,i){this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=i,this.size=(n-e+i-t)/2},t.prototype._newSubRegion=function(){var e=this.subRegions[this.nSubRegions];return e||(e=new t,this.subRegions[this.nSubRegions]=e),this.nSubRegions++,e},t.prototype._addNodeToSubRegion=function(e){var t=this.findSubRegion(e.position[0],e.position[1]),n=this.bbox;if(!t){var i=(n[0]+n[2])/2,a=(n[1]+n[3])/2,o=(n[2]-n[0])/2,r=(n[3]-n[1])/2,s=e.position[0]>=i?1:0,l=e.position[1]>=a?1:0,t=this._newSubRegion();t.setBBox(s*o+n[0],l*r+n[1],(s+1)*o+n[0],(l+1)*r+n[1])}t.addNode(e)},t.prototype._updateCenterOfMass=function(e){null==this.centerOfMass&&(this.centerOfMass=r.create());var t=this.centerOfMass[0]*this.mass,n=this.centerOfMass[1]*this.mass;t+=e.position[0]*e.mass,n+=e.position[1]*e.mass,this.mass+=e.mass,this.centerOfMass[0]=t/this.mass,this.centerOfMass[1]=n/this.mass},a.prototype.nodeToNodeRepulsionFactor=function(e,t,n){return n*n*e/t},a.prototype.edgeToNodeRepulsionFactor=function(e,t,n){return n*e/t},a.prototype.attractionFactor=function(e,t,n){return e*t/n},a.prototype.initNodes=function(e,t,i){this.temperature=1;var a=e.length/2;this.nodes.length=0;for(var o="undefined"!=typeof i,r=0;a>r;r++){var s=new n;s.position[0]=e[2*r],s.position[1]=e[2*r+1],s.mass=t[r],o&&(s.size=i[r]),this.nodes.push(s)}this._massArr=t,o&&(this._sizeArr=i)},a.prototype.initEdges=function(e,t){var n=e.length/2;this.edges.length=0;for(var a="undefined"!=typeof t,o=0;n>o;o++){var r=e[2*o],s=e[2*o+1],l=this.nodes[r],h=this.nodes[s];if(l&&h){l.outDegree++,h.inDegree++;var m=new i(l,h);a&&(m.weight=t[o]),this.edges.push(m)}}},a.prototype.update=function(){var e=this.nodes.length;if(this.updateBBox(),this._k=.4*this.scaling*Math.sqrt(this.width*this.height/e),this.barnesHutOptimize){this._rootRegion.setBBox(this.bbox[0],this.bbox[1],this.bbox[2],this.bbox[3]),this._rootRegion.beforeUpdate();for(var t=0;e>t;t++)this._rootRegion.addNode(this.nodes[t]);this._rootRegion.afterUpdate()}else{var n=0,i=this._rootRegion.centerOfMass;r.set(i,0,0);for(var t=0;e>t;t++){var a=this.nodes[t];n+=a.mass,r.scaleAndAdd(i,i,a.position,a.mass)}n>0&&r.scale(i,i,1/n)}this.updateForce(),this.updatePosition()},a.prototype.updateForce=function(){for(var e=this.nodes.length,t=0;e>t;t++){var n=this.nodes[t];r.copy(n.forcePrev,n.force),r.copy(n.speedPrev,n.speed),r.set(n.force,0,0)}this.updateNodeNodeForce(),this.gravity>0&&this.updateGravityForce(),this.updateEdgeForce(),this.preventNodeEdgeOverlap&&this.updateNodeEdgeForce()},a.prototype.updatePosition=function(){for(var e=this.nodes.length,t=r.create(),n=0;e>n;n++){var i=this.nodes[n],a=i.speed;r.scale(i.force,i.force,1/30);var o=r.len(i.force)+.1,s=Math.min(o,500)/o;r.scale(i.force,i.force,s),r.add(a,a,i.force),r.scale(a,a,this.temperature),r.sub(t,a,i.speedPrev);var l=r.len(t);if(l>0){r.scale(t,t,1/l);var h=r.len(i.speedPrev);h>0&&(l=Math.min(l/h,this.maxSpeedIncrease)*h,r.scaleAndAdd(a,i.speedPrev,t,l))}var m=r.len(a),s=Math.min(m,100)/(m+.1);r.scale(a,a,s),r.add(i.position,i.position,a)}},a.prototype.updateNodeNodeForce=function(){for(var e=this.nodes.length,t=0;e>t;t++){var n=this.nodes[t];if(this.barnesHutOptimize)this.applyRegionToNodeRepulsion(this._rootRegion,n);else for(var i=t+1;e>i;i++){var a=this.nodes[i];this.applyNodeToNodeRepulsion(n,a,!1)}}},a.prototype.updateGravityForce=function(){for(var e=0;e<this.nodes.length;e++)this.applyNodeGravity(this.nodes[e])},a.prototype.updateEdgeForce=function(){for(var e=0;e<this.edges.length;e++)this.applyEdgeAttraction(this.edges[e])},a.prototype.updateNodeEdgeForce=function(){for(var e=0;e<this.nodes.length;e++)for(var t=0;t<this.edges.length;t++)this.applyEdgeToNodeRepulsion(this.edges[t],this.nodes[e])},a.prototype.applyRegionToNodeRepulsion=function(){var e=r.create();return function(t,n){if(t.node)this.applyNodeToNodeRepulsion(t.node,n,!0);else{if(0===t.mass&&0===n.mass)return;r.sub(e,n.position,t.centerOfMass);var i=e[0]*e[0]+e[1]*e[1];if(i>this.barnesHutTheta*t.size*t.size){var a=this._k*this._k*(n.mass+t.mass)/(i+1);r.scaleAndAdd(n.force,n.force,e,2*a)}else for(var o=0;o<t.nSubRegions;o++)this.applyRegionToNodeRepulsion(t.subRegions[o],n)}}}(),a.prototype.applyNodeToNodeRepulsion=function(){var e=r.create();return function(t,n,i){if(t!==n&&(0!==t.mass||0!==n.mass)){r.sub(e,t.position,n.position);var a=e[0]*e[0]+e[1]*e[1];if(0!==a){var o,s=t.mass+n.mass,l=Math.sqrt(a);r.scale(e,e,1/l),this.preventNodeOverlap?(l=l-t.size-n.size,l>0?o=this.nodeToNodeRepulsionFactor(s,l,this._k):0>=l&&(o=this._k*this._k*10*s)):o=this.nodeToNodeRepulsionFactor(s,l,this._k),i||r.scaleAndAdd(t.force,t.force,e,2*o),r.scaleAndAdd(n.force,n.force,e,2*-o)}}}}(),a.prototype.applyEdgeAttraction=function(){var e=r.create();return function(t){var n=t.node1,i=t.node2;r.sub(e,n.position,i.position);var a,o=r.len(e);a=0===this.edgeWeightInfluence?1:1==this.edgeWeightInfluence?t.weight:Math.pow(t.weight,this.edgeWeightInfluence);var s;if(!(this.preventOverlap&&(o=o-n.size-i.size,0>=o))){var s=this.attractionFactor(a,o,this._k);r.scaleAndAdd(n.force,n.force,e,-s),r.scaleAndAdd(i.force,i.force,e,s)}}}(),a.prototype.applyNodeGravity=function(){var e=r.create();return function(t){r.sub(e,this.center,t.position),this.width>this.height?e[1]*=this.width/this.height:e[0]*=this.height/this.width;var n=r.len(e)/100;this.strongGravity?r.scaleAndAdd(t.force,t.force,e,n*this.gravity*t.mass):r.scaleAndAdd(t.force,t.force,e,this.gravity*t.mass/(n+1))}}(),a.prototype.applyEdgeToNodeRepulsion=function(){var e=r.create(),t=r.create(),n=r.create();return function(i,a){var o=i.node1,s=i.node2;if(o!==a&&s!==a){r.sub(e,s.position,o.position),r.sub(t,a.position,o.position);var l=r.len(e);r.scale(e,e,1/l);var h=r.dot(e,t);if(!(0>h||h>l)){r.scaleAndAdd(n,o.position,e,h);var m=r.dist(n,a.position)-a.size,V=this.edgeToNodeRepulsionFactor(a.mass,Math.max(m,.1),100);r.sub(e,a.position,n),r.normalize(e,e),r.scaleAndAdd(a.force,a.force,e,V),r.scaleAndAdd(o.force,o.force,e,-V),r.scaleAndAdd(s.force,s.force,e,-V)}}}}(),a.prototype.updateBBox=function(){for(var e=1/0,t=1/0,n=-1/0,i=-1/0,a=0;a<this.nodes.length;a++){var o=this.nodes[a].position;e=Math.min(e,o[0]),t=Math.min(t,o[1]),n=Math.max(n,o[0]),i=Math.max(i,o[1])}this.bbox[0]=e,this.bbox[1]=t,this.bbox[2]=n,this.bbox[3]=i},a.getWorkerCode=function(){var e=o.toString();return e.slice(e.indexOf("{")+1,e.lastIndexOf("return"))},s){var h=null;self.onmessage=function(e){if(e.data instanceof ArrayBuffer){if(!h)return;for(var t=new Float32Array(e.data),n=t.length/2,i=0;n>i;i++){var o=h.nodes[i];o.position[0]=t[2*i],o.position[1]=t[2*i+1]}}else switch(e.data.cmd){case"init":h||(h=new a),h.initNodes(e.data.nodesPosition,e.data.nodesMass,e.data.nodesSize),h.initEdges(e.data.edges,e.data.edgesWeight);break;case"updateConfig":if(h)for(var r in e.data.config)h[r]=e.data.config[r];break;case"update":var s=e.data.steps;if(h){var n=h.nodes.length,t=new Float32Array(2*n);h.temperature=e.data.temperature;for(var i=0;s>i;i++)h.update(),h.temperature*=e.data.coolDown;for(var i=0;n>i;i++){var o=h.nodes[i];t[2*i]=o.position[0],t[2*i+1]=o.position[1]}self.postMessage(t.buffer,[t.buffer])}else{var l=new Float32Array;self.postMessage(l.buffer,[l.buffer])}}}}return a}),n("echarts/chart/map",["require","./base","zrender/shape/Text","zrender/shape/Path","zrender/shape/Circle","zrender/shape/Rectangle","zrender/shape/Line","zrender/shape/Polygon","zrender/shape/Ellipse","../component/dataRange","../component/roamController","../config","../util/ecData","zrender/tool/util","zrender/config","zrender/tool/event","../util/mapData/params","../util/mapData/textFixed","../util/mapData/geoCoord","../util/projection/svg","../util/projection/normal","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o);var r=this;r._onmousewheel=function(e){return r.__onmousewheel(e)},r._onmousedown=function(e){return r.__onmousedown(e)},r._onmousemove=function(e){return r.__onmousemove(e)},r._onmouseup=function(e){return r.__onmouseup(e)},r._onroamcontroller=function(e){return r.__onroamcontroller(e)},r._ondrhoverlink=function(e){return r.__ondrhoverlink(e)},this._isAlive=!0,this._selectedMode={},this._activeMapType={},this._clickable={},this._hoverable={},this._showLegendSymbol={},this._selected={},this._mapTypeMap={},this._mapDataMap={},this._nameMap={},this._specialArea={},this._refreshDelayTicket,this._mapDataRequireCounter,this._markAnimation=!1,this._hoverLinkMap={},this._roamMap={},this._scaleLimitMap={},this._mx,this._my,this._mousedown,this._justMove,this._curMapType,this.refresh(a),this.zr.on(d.EVENT.MOUSEWHEEL,this._onmousewheel),this.zr.on(d.EVENT.MOUSEDOWN,this._onmousedown),t.bind(m.EVENT.ROAMCONTROLLER,this._onroamcontroller),t.bind(m.EVENT.DATA_RANGE_HOVERLINK,this._ondrhoverlink)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Path"),o=e("zrender/shape/Circle"),r=e("zrender/shape/Rectangle"),s=e("zrender/shape/Line"),l=e("zrender/shape/Polygon"),h=e("zrender/shape/Ellipse");e("../component/dataRange"),e("../component/roamController");var m=e("../config");m.map={zlevel:0,z:2,mapType:"china",mapValuePrecision:0,showLegendSymbol:!0,dataRangeHoverLink:!0,hoverable:!0,clickable:!0,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"#ccc"},label:{show:!1,textStyle:{color:"rgb(139,69,19)"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,areaStyle:{color:"rgba(255,215,0,0.8)"},label:{show:!1,textStyle:{color:"rgb(100,0,0)"}}}}};var V=e("../util/ecData"),U=e("zrender/tool/util"),d=e("zrender/config"),p=e("zrender/tool/event"),c=e("../util/mapData/params").params,u=e("../util/mapData/textFixed"),y=e("../util/mapData/geoCoord");return t.prototype={type:m.CHART_TYPE_MAP,_buildShape:function(){var e=this.series;this.selectedMap={},this._activeMapType={};for(var t,n,i,a,o=this.component.legend,r={},s={},l={},h={},V=0,d=e.length;d>V;V++)if(e[V].type==m.CHART_TYPE_MAP&&(e[V]=this.reformOption(e[V]),n=e[V].mapType,s[n]=s[n]||{},s[n][V]=!0,l[n]=l[n]||e[V].mapValuePrecision,this._scaleLimitMap[n]=this._scaleLimitMap[n]||{},e[V].scaleLimit&&U.merge(this._scaleLimitMap[n],e[V].scaleLimit,!0),this._roamMap[n]=e[V].roam||this._roamMap[n],this._hoverLinkMap[n]=e[V].dataRangeHoverLink||this._hoverLinkMap[n],this._nameMap[n]=this._nameMap[n]||{},e[V].nameMap&&U.merge(this._nameMap[n],e[V].nameMap,!0),this._activeMapType[n]=!0,e[V].textFixed&&U.merge(u,e[V].textFixed,!0),e[V].geoCoord&&U.merge(y,e[V].geoCoord,!0),this._selectedMode[n]=this._selectedMode[n]||e[V].selectedMode,(null==this._hoverable[n]||this._hoverable[n])&&(this._hoverable[n]=e[V].hoverable),(null==this._clickable[n]||this._clickable[n])&&(this._clickable[n]=e[V].clickable),(null==this._showLegendSymbol[n]||this._showLegendSymbol[n])&&(this._showLegendSymbol[n]=e[V].showLegendSymbol),h[n]=h[n]||e[V].mapValueCalculation,t=e[V].name,this.selectedMap[t]=o?o.isSelected(t):!0,this.selectedMap[t])){r[n]=r[n]||{},i=e[V].data;for(var p=0,g=i.length;g>p;p++){a=this._nameChange(n,i[p].name),r[n][a]=r[n][a]||{seriesIndex:[]};for(var b in i[p])"value"!=b?r[n][a][b]=i[p][b]:isNaN(i[p].value)||(null==r[n][a].value&&(r[n][a].value=0),r[n][a].value+=i[p].value);r[n][a].seriesIndex.push(V)}}this._mapDataRequireCounter=0;for(var f in r)this._mapDataRequireCounter++;this._clearSelected(),0===this._mapDataRequireCounter&&(this.clear(),this.zr&&this.zr.delShape(this.lastShapeList),this.lastShapeList=[]);for(var f in r){if(h[f]&&"average"==h[f])for(var g in r[f])r[f][g].value=(r[f][g].value/r[f][g].seriesIndex.length).toFixed(l[f])-0;this._mapDataMap[f]=this._mapDataMap[f]||{},this._mapDataMap[f].mapData?this._mapDataCallback(f,r[f],s[f])(this._mapDataMap[f].mapData):c[f.replace(/\|.*/,"")].getGeoJson&&(this._specialArea[f]=c[f.replace(/\|.*/,"")].specialArea||this._specialArea[f],c[f.replace(/\|.*/,"")].getGeoJson(this._mapDataCallback(f,r[f],s[f])))}},_mapDataCallback:function(t,n,i){var a=this;return function(o){a._isAlive&&null!=a._activeMapType[t]&&(-1!=t.indexOf("|")&&(o=a._getSubMapData(t,o)),a._mapDataMap[t].mapData=o,o.firstChild?(a._mapDataMap[t].rate=1,a._mapDataMap[t].projection=e("../util/projection/svg")):(a._mapDataMap[t].rate=.75,a._mapDataMap[t].projection=e("../util/projection/normal")),a._buildMap(t,a._getProjectionData(t,o,i),n,i),a._buildMark(t,i),--a._mapDataRequireCounter<=0&&(a.addShapeList(),a.zr.refreshNextFrame()))}},_clearSelected:function(){for(var e in this._selected)this._activeMapType[this._mapTypeMap[e]]||(delete this._selected[e],delete this._mapTypeMap[e])},_getSubMapData:function(e,t){for(var n=e.replace(/^.*\|/,""),i=t.features,a=0,o=i.length;o>a;a++)if(i[a].properties&&i[a].properties.name==n){i=i[a],"United States of America"==n&&i.geometry.coordinates.length>1&&(i={geometry:{coordinates:i.geometry.coordinates.slice(5,6),type:i.geometry.type},id:i.id,properties:i.properties,type:i.type});break}return{type:"FeatureCollection",features:[i]}},_getProjectionData:function(e,t,n){var i,a=this._mapDataMap[e].projection,o=[],r=this._mapDataMap[e].bbox||a.getBbox(t,this._specialArea[e]);i=this._mapDataMap[e].hasRoam?this._mapDataMap[e].transform:this._getTransform(r,n,this._mapDataMap[e].rate);var s,l=this._mapDataMap[e].lastTransform||{scale:{}};i.left!=l.left||i.top!=l.top||i.scale.x!=l.scale.x||i.scale.y!=l.scale.y?(s=a.geoJson2Path(t,i,this._specialArea[e]),l=U.clone(i)):(i=this._mapDataMap[e].transform,s=this._mapDataMap[e].pathArray),this._mapDataMap[e].bbox=r,this._mapDataMap[e].transform=i,this._mapDataMap[e].lastTransform=l,this._mapDataMap[e].pathArray=s;for(var h=[i.left,i.top],m=0,V=s.length;V>m;m++)o.push(this._getSingleProvince(e,s[m],h));if(this._specialArea[e])for(var d in this._specialArea[e])o.push(this._getSpecialProjectionData(e,t,d,this._specialArea[e][d],h));if("china"==e){var p=this.geo2pos(e,y["南海诸岛"]||c["南海诸岛"].textCoord),g=i.scale.x/10.5,b=[32*g+p[0],83*g+p[1]];u["南海诸岛"]&&(b[0]+=u["南海诸岛"][0],b[1]+=u["南海诸岛"][1]),o.push({name:this._nameChange(e,"南海诸岛"),path:c["南海诸岛"].getPath(p,g),position:h,textX:b[0],textY:b[1]})}return o},_getSpecialProjectionData:function(t,n,i,a,o){n=this._getSubMapData("x|"+i,n);var r=e("../util/projection/normal"),s=r.getBbox(n),l=this.geo2pos(t,[a.left,a.top]),h=this.geo2pos(t,[a.left+a.width,a.top+a.height]),m=Math.abs(h[0]-l[0]),V=Math.abs(h[1]-l[1]),U=s.width,d=s.height,p=m/.75/U,c=V/d;p>c?(p=.75*c,m=U*p):(c=p,p=.75*c,V=d*c);var u={OffsetLeft:l[0],OffsetTop:l[1],scale:{x:p,y:c}},y=r.geoJson2Path(n,u);return this._getSingleProvince(t,y[0],o)},_getSingleProvince:function(e,t,n){var i,a=t.properties.name,o=u[a]||[0,0];if(y[a])i=this.geo2pos(e,y[a]);else if(t.cp)i=[t.cp[0]+o[0],t.cp[1]+o[1]];else{var r=this._mapDataMap[e].bbox;i=this.geo2pos(e,[r.left+r.width/2,r.top+r.height/2]),i[0]+=o[0],i[1]+=o[1]}return t.name=this._nameChange(e,a),t.position=n,t.textX=i[0],t.textY=i[1],t},_getTransform:function(e,t,n){var i,a,o,r,s,l,h,m=this.series,V=this.zr.getWidth(),U=this.zr.getHeight(),d=Math.round(.02*Math.min(V,U));for(var p in t)i=m[p].mapLocation||{},o=i.x||o,s=i.y||s,l=i.width||l,h=i.height||h;a=this.parsePercent(o,V),a=isNaN(a)?d:a,r=this.parsePercent(s,U),r=isNaN(r)?d:r,l=null==l?V-a-2*d:this.parsePercent(l,V),h=null==h?U-r-2*d:this.parsePercent(h,U);var c=e.width,u=e.height,y=l/n/c,g=h/u;if(y>g?(y=g*n,l=c*y):(g=y,y=g*n,h=u*g),isNaN(o))switch(o=o||"center",o+""){case"center":a=Math.floor((V-l)/2);break;case"right":a=V-l}if(isNaN(s))switch(s=s||"center",s+""){case"center":r=Math.floor((U-h)/2);break;case"bottom":r=U-h}return{left:a,top:r,width:l,height:h,baseScale:1,scale:{x:y,y:g}}},_buildMap:function(e,t,n,d){for(var p,c,u,y,g,b,f,k,x,_,L,W=this.series,X=this.component.legend,K=this.component.dataRange,w=0,I=t.length;I>w;w++){if(k=U.clone(t[w]),x={name:k.name,path:k.path,position:U.clone(k.position)},c=k.name,u=n[c]){g=[u],p="";for(var v=0,J=u.seriesIndex.length;J>v;v++)g.push(W[u.seriesIndex[v]]),p+=W[u.seriesIndex[v]].name+" ",X&&this._showLegendSymbol[e]&&X.hasColor(W[u.seriesIndex[v]].name)&&this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase()+1,position:U.clone(k.position),_mapType:e,style:{x:k.textX+3+7*v,y:k.textY-10,r:3,color:X.getColor(W[u.seriesIndex[v]].name)},hoverable:!1}));y=u.value}else{u="-",p="",g=[];for(var C in d)g.push(W[C]);y="-"}switch(this.ecTheme.map&&g.push(this.ecTheme.map),g.push(m),b=K&&!isNaN(y)?K.getColor(y):null,k.color=k.color||b||this.getItemStyleColor(this.deepQuery(g,"itemStyle.normal.color"),u.seriesIndex,-1,u)||this.deepQuery(g,"itemStyle.normal.areaStyle.color"),k.strokeColor=k.strokeColor||this.deepQuery(g,"itemStyle.normal.borderColor"),k.lineWidth=k.lineWidth||this.deepQuery(g,"itemStyle.normal.borderWidth"),x.color=this.getItemStyleColor(this.deepQuery(g,"itemStyle.emphasis.color"),u.seriesIndex,-1,u)||this.deepQuery(g,"itemStyle.emphasis.areaStyle.color")||k.color,x.strokeColor=this.deepQuery(g,"itemStyle.emphasis.borderColor")||k.strokeColor,x.lineWidth=this.deepQuery(g,"itemStyle.emphasis.borderWidth")||k.lineWidth,k.brushType=x.brushType=k.brushType||"both",k.lineJoin=x.lineJoin="round",k._name=x._name=c,f=this.deepQuery(g,"itemStyle.normal.label.textStyle"),L={zlevel:this.getZlevelBase(),z:this.getZBase()+1,position:U.clone(k.position),_mapType:e,_geo:this.pos2geo(e,[k.textX,k.textY]),style:{brushType:"fill",x:k.textX,y:k.textY,text:this.getLabelText(c,y,g,"normal"),_name:c,textAlign:"center",color:this.deepQuery(g,"itemStyle.normal.label.show")?this.deepQuery(g,"itemStyle.normal.label.textStyle.color"):"rgba(0,0,0,0)",textFont:this.getFont(f)}},L._style=U.clone(L.style),L.highlightStyle=U.clone(L.style),this.deepQuery(g,"itemStyle.emphasis.label.show")?(L.highlightStyle.text=this.getLabelText(c,y,g,"emphasis"),L.highlightStyle.color=this.deepQuery(g,"itemStyle.emphasis.label.textStyle.color")||L.style.color,f=this.deepQuery(g,"itemStyle.emphasis.label.textStyle")||f,L.highlightStyle.textFont=this.getFont(f)):L.highlightStyle.color="rgba(0,0,0,0)",_={zlevel:this.getZlevelBase(),z:this.getZBase(),position:U.clone(k.position),style:k,highlightStyle:x,_style:U.clone(k),_mapType:e},null!=k.scale&&(_.scale=U.clone(k.scale)),L=new i(L),_.style.shapeType){case"rectangle":_=new r(_);
-break;case"line":_=new s(_);break;case"circle":_=new o(_);break;case"polygon":_=new l(_);break;case"ellipse":_=new h(_);break;default:_=new a(_),_.buildPathArray&&(_.style.pathArray=_.buildPathArray(_.style.path))}(this._selectedMode[e]&&this._selected[c]||u.selected&&this._selected[c]!==!1)&&(L.style=L.highlightStyle,_.style=_.highlightStyle),L.clickable=_.clickable=this._clickable[e]&&(null==u.clickable||u.clickable),this._selectedMode[e]&&(this._selected[c]=null!=this._selected[c]?this._selected[c]:u.selected,this._mapTypeMap[c]=e,(null==u.selectable||u.selectable)&&(_.clickable=L.clickable=!0,_.onclick=L.onclick=this.shapeHandler.onclick)),this._hoverable[e]&&(null==u.hoverable||u.hoverable)?(L.hoverable=_.hoverable=!0,_.hoverConnect=L.id,L.hoverConnect=_.id):L.hoverable=_.hoverable=!1,V.pack(L,{name:p,tooltip:this.deepQuery(g,"tooltip")},0,u,0,c),this.shapeList.push(L),V.pack(_,{name:p,tooltip:this.deepQuery(g,"tooltip")},0,u,0,c),this.shapeList.push(_)}},_buildMark:function(e,t){this._seriesIndexToMapType=this._seriesIndexToMapType||{},this.markAttachStyle=this.markAttachStyle||{};var n=[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top];"none"==e&&(n=[0,0]);for(var i in t)this._seriesIndexToMapType[i]=e,this.markAttachStyle[i]={position:n,_mapType:e},this.buildMark(i)},getMarkCoord:function(e,t){return t.geoCoord||y[t.name]?this.geo2pos(this._seriesIndexToMapType[e],t.geoCoord||y[t.name]):[0,0]},getMarkGeo:function(e){return e.geoCoord||y[e.name]},_nameChange:function(e,t){return this._nameMap[e][t]||t},getLabelText:function(e,t,n,i){var a=this.deepQuery(n,"itemStyle."+i+".label.formatter");return a?"function"==typeof a?a.call(this.myChart,e,t):"string"==typeof a?(a=a.replace("{a}","{a0}").replace("{b}","{b0}"),a=a.replace("{a0}",e).replace("{b0}",t)):void 0:e},_findMapTypeByPos:function(e,t){var n,i,a,o,r;for(var s in this._mapDataMap)if(n=this._mapDataMap[s].transform,n&&this._roamMap[s]&&this._activeMapType[s]&&(i=n.left,a=n.top,o=n.width,r=n.height,e>=i&&i+o>=e&&t>=a&&a+r>=t))return s},__onmousewheel:function(e){if(!(this.shapeList.length<=0)){var t,n,i=e.event,a=p.getX(i),o=p.getY(i),r=p.getDelta(i),s=e.mapTypeControl;s||(s={},n=this._findMapTypeByPos(a,o),n&&this._roamMap[n]&&"move"!=this._roamMap[n]&&(s[n]=!0));var l=!1;for(n in s)if(s[n]){l=!0;var h=this._mapDataMap[n].transform,V=h.left,U=h.top,d=h.width,c=h.height,u=this.pos2geo(n,[a-V,o-U]);if(r>0){if(t=1.2,null!=this._scaleLimitMap[n].max&&h.baseScale>=this._scaleLimitMap[n].max)continue}else if(t=1/1.2,null!=this._scaleLimitMap[n].min&&h.baseScale<=this._scaleLimitMap[n].min)continue;h.baseScale*=t,h.scale.x*=t,h.scale.y*=t,h.width=d*t,h.height=c*t,this._mapDataMap[n].hasRoam=!0,this._mapDataMap[n].transform=h,u=this.geo2pos(n,u),h.left-=u[0]-(a-V),h.top-=u[1]-(o-U),this._mapDataMap[n].transform=h,this.clearEffectShape(!0);for(var y=0,g=this.shapeList.length;g>y;y++)this.shapeList[y]._mapType==n&&(this.shapeList[y].position[0]=h.left,this.shapeList[y].position[1]=h.top,"path"==this.shapeList[y].type||"symbol"==this.shapeList[y].type||"circle"==this.shapeList[y].type||"rectangle"==this.shapeList[y].type||"polygon"==this.shapeList[y].type||"line"==this.shapeList[y].type||"ellipse"==this.shapeList[y].type?(this.shapeList[y].scale[0]*=t,this.shapeList[y].scale[1]*=t):"mark-line"==this.shapeList[y].type?(this.shapeList[y].style.pointListLength=void 0,this.shapeList[y].style.pointList=!1,u=this.geo2pos(n,this.shapeList[y]._geo[0]),this.shapeList[y].style.xStart=u[0],this.shapeList[y].style.yStart=u[1],u=this.geo2pos(n,this.shapeList[y]._geo[1]),this.shapeList[y]._x=this.shapeList[y].style.xEnd=u[0],this.shapeList[y]._y=this.shapeList[y].style.yEnd=u[1]):"icon"==this.shapeList[y].type||"image"==this.shapeList[y].type?(u=this.geo2pos(n,this.shapeList[y]._geo),this.shapeList[y].style.x=this.shapeList[y].style._x=u[0]-this.shapeList[y].style.width/2,this.shapeList[y].style.y=this.shapeList[y].style._y=u[1]-this.shapeList[y].style.height/2):(u=this.geo2pos(n,this.shapeList[y]._geo),this.shapeList[y].style.x=u[0],this.shapeList[y].style.y=u[1],"text"==this.shapeList[y].type&&(this.shapeList[y]._style.x=this.shapeList[y].highlightStyle.x=u[0],this.shapeList[y]._style.y=this.shapeList[y].highlightStyle.y=u[1])),this.zr.modShape(this.shapeList[y].id))}if(l){p.stop(i),this.zr.refreshNextFrame();var b=this;clearTimeout(this._refreshDelayTicket),this._refreshDelayTicket=setTimeout(function(){b&&b.shapeList&&b.animationEffect()},100),this.messageCenter.dispatch(m.EVENT.MAP_ROAM,e.event,{type:"scale"},this.myChart)}}},__onmousedown:function(e){if(!(this.shapeList.length<=0)){var t=e.target;if(!t||!t.draggable){var n=e.event,i=p.getX(n),a=p.getY(n),o=this._findMapTypeByPos(i,a);if(o&&this._roamMap[o]&&"scale"!=this._roamMap[o]){this._mousedown=!0,this._mx=i,this._my=a,this._curMapType=o,this.zr.on(d.EVENT.MOUSEUP,this._onmouseup);var r=this;setTimeout(function(){r.zr.on(d.EVENT.MOUSEMOVE,r._onmousemove)},100)}}}},__onmousemove:function(e){if(this._mousedown&&this._isAlive){var t=e.event,n=p.getX(t),i=p.getY(t),a=this._mapDataMap[this._curMapType].transform;a.hasRoam=!0,a.left-=this._mx-n,a.top-=this._my-i,this._mx=n,this._my=i,this._mapDataMap[this._curMapType].transform=a;for(var o=0,r=this.shapeList.length;r>o;o++)this.shapeList[o]._mapType==this._curMapType&&(this.shapeList[o].position[0]=a.left,this.shapeList[o].position[1]=a.top,this.zr.modShape(this.shapeList[o].id));this.messageCenter.dispatch(m.EVENT.MAP_ROAM,e.event,{type:"move"},this.myChart),this.clearEffectShape(!0),this.zr.refreshNextFrame(),this._justMove=!0,p.stop(t)}},__onmouseup:function(e){var t=e.event;this._mx=p.getX(t),this._my=p.getY(t),this._mousedown=!1;var n=this;setTimeout(function(){n._justMove&&n.animationEffect(),n._justMove=!1,n.zr.un(d.EVENT.MOUSEMOVE,n._onmousemove),n.zr.un(d.EVENT.MOUSEUP,n._onmouseup)},120)},__onroamcontroller:function(e){var t=e.event;t.zrenderX=this.zr.getWidth()/2,t.zrenderY=this.zr.getHeight()/2;var n=e.mapTypeControl,i=0,a=0,o=e.step;switch(e.roamType){case"scaleUp":return t.zrenderDelta=1,void this.__onmousewheel({event:t,mapTypeControl:n});case"scaleDown":return t.zrenderDelta=-1,void this.__onmousewheel({event:t,mapTypeControl:n});case"up":i=-o;break;case"down":i=o;break;case"left":a=-o;break;case"right":a=o}var r,s;for(s in n)this._mapDataMap[s]&&this._activeMapType[s]&&(r=this._mapDataMap[s].transform,r.hasRoam=!0,r.left-=a,r.top-=i,this._mapDataMap[s].transform=r);for(var l=0,h=this.shapeList.length;h>l;l++)s=this.shapeList[l]._mapType,n[s]&&this._activeMapType[s]&&(r=this._mapDataMap[s].transform,this.shapeList[l].position[0]=r.left,this.shapeList[l].position[1]=r.top,this.zr.modShape(this.shapeList[l].id));this.messageCenter.dispatch(m.EVENT.MAP_ROAM,e.event,{type:"move"},this.myChart),this.clearEffectShape(!0),this.zr.refreshNextFrame(),clearTimeout(this.dircetionTimer);var V=this;this.dircetionTimer=setTimeout(function(){V.animationEffect()},150)},__ondrhoverlink:function(e){for(var t,n,i=0,a=this.shapeList.length;a>i;i++)t=this.shapeList[i]._mapType,this._hoverLinkMap[t]&&this._activeMapType[t]&&(n=V.get(this.shapeList[i],"value"),null!=n&&n>=e.valueMin&&n<=e.valueMax&&this.zr.addHoverShape(this.shapeList[i]))},onclick:function(e){if(this.isClick&&e.target&&!this._justMove&&"icon"!=e.target.type){this.isClick=!1;var t=e.target,n=t.style._name,i=this.shapeList.length,a=t._mapType||"";if("single"==this._selectedMode[a])for(var o in this._selected)if(this._selected[o]&&this._mapTypeMap[o]==a){for(var r=0;i>r;r++)this.shapeList[r].style._name==o&&this.shapeList[r]._mapType==a&&(this.shapeList[r].style=this.shapeList[r]._style,this.zr.modShape(this.shapeList[r].id));o!=n&&(this._selected[o]=!1)}this._selected[n]=!this._selected[n];for(var r=0;i>r;r++)this.shapeList[r].style._name==n&&this.shapeList[r]._mapType==a&&(this.shapeList[r].style=this._selected[n]?this.shapeList[r].highlightStyle:this.shapeList[r]._style,this.zr.modShape(this.shapeList[r].id));this.messageCenter.dispatch(m.EVENT.MAP_SELECTED,e.event,{selected:this._selected,target:n},this.myChart),this.zr.refreshNextFrame();var s=this;setTimeout(function(){s.zr.trigger(d.EVENT.MOUSEMOVE,e.event)},100)}},refresh:function(e){e&&(this.option=e,this.series=e.series),this._mapDataRequireCounter>0?this.clear():this.backupShapeList(),this._buildShape(),this.zr.refreshHover()},ondataRange:function(e,t){this.component.dataRange&&(this.refresh(),t.needRefresh=!0)},pos2geo:function(e,t){return this._mapDataMap[e].transform?this._mapDataMap[e].projection.pos2geo(this._mapDataMap[e].transform,t):null},getGeoByPos:function(e,t){if(!this._mapDataMap[e].transform)return null;var n=[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top];return t instanceof Array?(t[0]-=n[0],t[1]-=n[1]):(t.x-=n[0],t.y-=n[1]),this.pos2geo(e,t)},geo2pos:function(e,t){return this._mapDataMap[e].transform?this._mapDataMap[e].projection.geo2pos(this._mapDataMap[e].transform,t):null},getPosByGeo:function(e,t){if(!this._mapDataMap[e].transform)return null;var n=this.geo2pos(e,t);return n[0]+=this._mapDataMap[e].transform.left,n[1]+=this._mapDataMap[e].transform.top,n},getMapPosition:function(e){return this._mapDataMap[e].transform?[this._mapDataMap[e].transform.left,this._mapDataMap[e].transform.top]:null},onbeforDispose:function(){this._isAlive=!1,this.zr.un(d.EVENT.MOUSEWHEEL,this._onmousewheel),this.zr.un(d.EVENT.MOUSEDOWN,this._onmousedown),this.messageCenter.unbind(m.EVENT.ROAMCONTROLLER,this._onroamcontroller),this.messageCenter.unbind(m.EVENT.DATA_RANGE_HOVERLINK,this._ondrhoverlink)}},U.inherits(t,n),e("../chart").define("map",t),t}),n("zrender/shape/Path",["require","./Base","./util/PathProxy","../tool/util"],function(e){var t=e("./Base"),n=e("./util/PathProxy"),i=n.PathSegment,a=function(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])},o=function(e,t){return(e[0]*t[0]+e[1]*t[1])/(a(e)*a(t))},r=function(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(o(e,t))},s=function(e){t.call(this,e)};return s.prototype={type:"path",buildPathArray:function(e,t,n){if(!e)return[];t=t||0,n=n||0;var a=e,o=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];a=a.replace(/-/g," -"),a=a.replace(/ /g," "),a=a.replace(/ /g,","),a=a.replace(/,,/g,",");var r;for(r=0;r<o.length;r++)a=a.replace(new RegExp(o[r],"g"),"|"+o[r]);var s=a.split("|"),l=[],h=0,m=0;for(r=1;r<s.length;r++){var V=s[r],U=V.charAt(0);V=V.slice(1),V=V.replace(new RegExp("e,-","g"),"e-");var d=V.split(",");d.length>0&&""===d[0]&&d.shift();for(var p=0;p<d.length;p++)d[p]=parseFloat(d[p]);for(;d.length>0&&!isNaN(d[0]);){var c,u,y,g,b,f,k,x,_=null,L=[],W=h,X=m;switch(U){case"l":h+=d.shift(),m+=d.shift(),_="L",L.push(h,m);break;case"L":h=d.shift(),m=d.shift(),L.push(h,m);break;case"m":h+=d.shift(),m+=d.shift(),_="M",L.push(h,m),U="l";break;case"M":h=d.shift(),m=d.shift(),_="M",L.push(h,m),U="L";break;case"h":h+=d.shift(),_="L",L.push(h,m);break;case"H":h=d.shift(),_="L",L.push(h,m);break;case"v":m+=d.shift(),_="L",L.push(h,m);break;case"V":m=d.shift(),_="L",L.push(h,m);break;case"C":L.push(d.shift(),d.shift(),d.shift(),d.shift()),h=d.shift(),m=d.shift(),L.push(h,m);break;case"c":L.push(h+d.shift(),m+d.shift(),h+d.shift(),m+d.shift()),h+=d.shift(),m+=d.shift(),_="C",L.push(h,m);break;case"S":c=h,u=m,y=l[l.length-1],"C"===y.command&&(c=h+(h-y.points[2]),u=m+(m-y.points[3])),L.push(c,u,d.shift(),d.shift()),h=d.shift(),m=d.shift(),_="C",L.push(h,m);break;case"s":c=h,u=m,y=l[l.length-1],"C"===y.command&&(c=h+(h-y.points[2]),u=m+(m-y.points[3])),L.push(c,u,h+d.shift(),m+d.shift()),h+=d.shift(),m+=d.shift(),_="C",L.push(h,m);break;case"Q":L.push(d.shift(),d.shift()),h=d.shift(),m=d.shift(),L.push(h,m);break;case"q":L.push(h+d.shift(),m+d.shift()),h+=d.shift(),m+=d.shift(),_="Q",L.push(h,m);break;case"T":c=h,u=m,y=l[l.length-1],"Q"===y.command&&(c=h+(h-y.points[0]),u=m+(m-y.points[1])),h=d.shift(),m=d.shift(),_="Q",L.push(c,u,h,m);break;case"t":c=h,u=m,y=l[l.length-1],"Q"===y.command&&(c=h+(h-y.points[0]),u=m+(m-y.points[1])),h+=d.shift(),m+=d.shift(),_="Q",L.push(c,u,h,m);break;case"A":g=d.shift(),b=d.shift(),f=d.shift(),k=d.shift(),x=d.shift(),W=h,X=m,h=d.shift(),m=d.shift(),_="A",L=this._convertPoint(W,X,h,m,k,x,g,b,f);break;case"a":g=d.shift(),b=d.shift(),f=d.shift(),k=d.shift(),x=d.shift(),W=h,X=m,h+=d.shift(),m+=d.shift(),_="A",L=this._convertPoint(W,X,h,m,k,x,g,b,f)}for(var K=0,w=L.length;w>K;K+=2)L[K]+=t,L[K+1]+=n;l.push(new i(_||U,L))}("z"===U||"Z"===U)&&l.push(new i("z",[]))}return l},_convertPoint:function(e,t,n,i,a,s,l,h,m){var V=m*(Math.PI/180),U=Math.cos(V)*(e-n)/2+Math.sin(V)*(t-i)/2,d=-1*Math.sin(V)*(e-n)/2+Math.cos(V)*(t-i)/2,p=U*U/(l*l)+d*d/(h*h);p>1&&(l*=Math.sqrt(p),h*=Math.sqrt(p));var c=Math.sqrt((l*l*h*h-l*l*d*d-h*h*U*U)/(l*l*d*d+h*h*U*U));a===s&&(c*=-1),isNaN(c)&&(c=0);var u=c*l*d/h,y=c*-h*U/l,g=(e+n)/2+Math.cos(V)*u-Math.sin(V)*y,b=(t+i)/2+Math.sin(V)*u+Math.cos(V)*y,f=r([1,0],[(U-u)/l,(d-y)/h]),k=[(U-u)/l,(d-y)/h],x=[(-1*U-u)/l,(-1*d-y)/h],_=r(k,x);return o(k,x)<=-1&&(_=Math.PI),o(k,x)>=1&&(_=0),0===s&&_>0&&(_-=2*Math.PI),1===s&&0>_&&(_+=2*Math.PI),[g,b,l,h,f,_,V,s]},buildPath:function(e,t){var n=t.path,i=t.x||0,a=t.y||0;t.pathArray=t.pathArray||this.buildPathArray(n,i,a);for(var o=t.pathArray,r=t.pointList=[],s=[],l=0,h=o.length;h>l;l++){"M"==o[l].command.toUpperCase()&&(s.length>0&&r.push(s),s=[]);for(var m=o[l].points,V=0,U=m.length;U>V;V+=2)s.push([m[V],m[V+1]])}s.length>0&&r.push(s);for(var l=0,h=o.length;h>l;l++){var d=o[l].command,m=o[l].points;switch(d){case"L":e.lineTo(m[0],m[1]);break;case"M":e.moveTo(m[0],m[1]);break;case"C":e.bezierCurveTo(m[0],m[1],m[2],m[3],m[4],m[5]);break;case"Q":e.quadraticCurveTo(m[0],m[1],m[2],m[3]);break;case"A":var p=m[0],c=m[1],u=m[2],y=m[3],g=m[4],b=m[5],f=m[6],k=m[7],x=u>y?u:y,_=u>y?1:u/y,L=u>y?y/u:1;e.translate(p,c),e.rotate(f),e.scale(_,L),e.arc(0,0,x,g,g+b,1-k),e.scale(1/_,1/L),e.rotate(-f),e.translate(-p,-c);break;case"z":e.closePath()}}},getRect:function(e){if(e.__rect)return e.__rect;var t;t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0;for(var n=Number.MAX_VALUE,i=Number.MIN_VALUE,a=Number.MAX_VALUE,o=Number.MIN_VALUE,r=e.x||0,s=e.y||0,l=e.pathArray||this.buildPathArray(e.path),h=0;h<l.length;h++)for(var m=l[h].points,V=0;V<m.length;V++)V%2===0?(m[V]+r<n&&(n=m[V]),m[V]+r>i&&(i=m[V])):(m[V]+s<a&&(a=m[V]),m[V]+s>o&&(o=m[V]));var U;return U=n===Number.MAX_VALUE||i===Number.MIN_VALUE||a===Number.MAX_VALUE||o===Number.MIN_VALUE?{x:0,y:0,width:0,height:0}:{x:Math.round(n-t/2),y:Math.round(a-t/2),width:i-n+t,height:o-a+t},e.__rect=U,U}},e("../tool/util").inherits(s,t),s}),n("zrender/shape/Ellipse",["require","./Base","../tool/util"],function(e){var t=e("./Base"),n=function(e){t.call(this,e)};return n.prototype={type:"ellipse",buildPath:function(e,t){var n=.5522848,i=t.x,a=t.y,o=t.a,r=t.b,s=o*n,l=r*n;e.moveTo(i-o,a),e.bezierCurveTo(i-o,a-l,i-s,a-r,i,a-r),e.bezierCurveTo(i+s,a-r,i+o,a-l,i+o,a),e.bezierCurveTo(i+o,a+l,i+s,a+r,i,a+r),e.bezierCurveTo(i-s,a+r,i-o,a+l,i-o,a),e.closePath()},getRect:function(e){if(e.__rect)return e.__rect;var t;return t="stroke"==e.brushType||"fill"==e.brushType?e.lineWidth||1:0,e.__rect={x:Math.round(e.x-e.a-t/2),y:Math.round(e.y-e.b-t/2),width:2*e.a+t,height:2*e.b+t},e.__rect}},e("../tool/util").inherits(n,t),n}),n("echarts/component/roamController",["require","./base","zrender/shape/Rectangle","zrender/shape/Sector","zrender/shape/Circle","../config","zrender/tool/util","zrender/tool/color","zrender/tool/event","../component"],function(e){function t(e,t,i,a,o){if(a.roamController&&a.roamController.show){if(!a.roamController.mapTypeControl)return void console.error("option.roamController.mapTypeControl has not been defined.");n.call(this,e,t,i,a,o),this.rcOption=a.roamController;var r=this;this._drictionMouseDown=function(e){return r.__drictionMouseDown(e)},this._drictionMouseUp=function(e){return r.__drictionMouseUp(e)},this._drictionMouseMove=function(e){return r.__drictionMouseMove(e)},this._drictionMouseOut=function(e){return r.__drictionMouseOut(e)},this._scaleHandler=function(e){return r.__scaleHandler(e)},this.refresh(a)}}var n=e("./base"),i=e("zrender/shape/Rectangle"),a=e("zrender/shape/Sector"),o=e("zrender/shape/Circle"),r=e("../config");r.roamController={zlevel:0,z:4,show:!0,x:"left",y:"top",width:80,height:120,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,handleColor:"#6495ed",fillerColor:"#fff",step:15,mapTypeControl:null};var s=e("zrender/tool/util"),l=e("zrender/tool/color"),h=e("zrender/tool/event");return t.prototype={type:r.COMPONENT_TYPE_ROAMCONTROLLER,_buildShape:function(){if(this.rcOption.show){this._itemGroupLocation=this._getItemGroupLocation(),this._buildBackground(),this._buildItem();for(var e=0,t=this.shapeList.length;t>e;e++)this.zr.addShape(this.shapeList[e])}},_buildItem:function(){this.shapeList.push(this._getDirectionShape("up")),this.shapeList.push(this._getDirectionShape("down")),this.shapeList.push(this._getDirectionShape("left")),this.shapeList.push(this._getDirectionShape("right")),this.shapeList.push(this._getScaleShape("scaleUp")),this.shapeList.push(this._getScaleShape("scaleDown"))},_getDirectionShape:function(e){var t=this._itemGroupLocation.r,n=this._itemGroupLocation.x+t,i=this._itemGroupLocation.y+t,o={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:n,y:i,r:t,startAngle:-45,endAngle:45,color:this.rcOption.handleColor,text:">",textX:n+t/2+4,textY:i-.5,textAlign:"center",textBaseline:"middle",textPosition:"specific",textColor:this.rcOption.fillerColor,textFont:Math.floor(t/2)+"px arial"},highlightStyle:{color:l.lift(this.rcOption.handleColor,-.2),brushType:"fill"},clickable:!0};switch(e){case"up":o.rotation=[Math.PI/2,n,i];break;case"left":o.rotation=[Math.PI,n,i];break;case"down":o.rotation=[-Math.PI/2,n,i]}return o=new a(o),o._roamType=e,o.onmousedown=this._drictionMouseDown,o.onmouseup=this._drictionMouseUp,o.onmousemove=this._drictionMouseMove,o.onmouseout=this._drictionMouseOut,o},_getScaleShape:function(e){var t=this._itemGroupLocation.width,n=this._itemGroupLocation.height-t;n=0>n?20:n;var i=Math.min(t/2-5,n)/2,a=this._itemGroupLocation.x+("scaleDown"===e?t-i:i),r=this._itemGroupLocation.y+this._itemGroupLocation.height-i,s={zlevel:this.getZlevelBase(),z:this.getZBase(),style:{x:a,y:r,r:i,color:this.rcOption.handleColor,text:"scaleDown"===e?"-":"+",textX:a,textY:r-2,textAlign:"center",textBaseline:"middle",textPosition:"specific",textColor:this.rcOption.fillerColor,textFont:Math.floor(i)+"px verdana"},highlightStyle:{color:l.lift(this.rcOption.handleColor,-.2),brushType:"fill"},clickable:!0};return s=new o(s),s._roamType=e,s.onmousedown=this._scaleHandler,s},_buildBackground:function(){var e=this.reformCssArray(this.rcOption.padding);this.shapeList.push(new i({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:this._itemGroupLocation.x-e[3],y:this._itemGroupLocation.y-e[0],width:this._itemGroupLocation.width+e[3]+e[1],height:this._itemGroupLocation.height+e[0]+e[2],brushType:0===this.rcOption.borderWidth?"fill":"both",color:this.rcOption.backgroundColor,strokeColor:this.rcOption.borderColor,lineWidth:this.rcOption.borderWidth}}))},_getItemGroupLocation:function(){var e,t=this.reformCssArray(this.rcOption.padding),n=this.rcOption.width,i=this.rcOption.height,a=this.zr.getWidth(),o=this.zr.getHeight();switch(this.rcOption.x){case"center":e=Math.floor((a-n)/2);break;case"left":e=t[3]+this.rcOption.borderWidth;break;case"right":e=a-n-t[1]-t[3]-2*this.rcOption.borderWidth;break;default:e=this.parsePercent(this.rcOption.x,a)}var r;switch(this.rcOption.y){case"top":r=t[0]+this.rcOption.borderWidth;break;case"bottom":r=o-i-t[0]-t[2]-2*this.rcOption.borderWidth;break;case"center":r=Math.floor((o-i)/2);break;default:r=this.parsePercent(this.rcOption.y,o)}return{x:e,y:r,r:n/2,width:n,height:i}},__drictionMouseDown:function(e){this.mousedown=!0,this._drictionHandlerOn(e)},__drictionMouseUp:function(e){this.mousedown=!1,this._drictionHandlerOff(e)},__drictionMouseMove:function(e){this.mousedown&&this._drictionHandlerOn(e)},__drictionMouseOut:function(e){this._drictionHandlerOff(e)},_drictionHandlerOn:function(e){this._dispatchEvent(e.event,e.target._roamType),clearInterval(this.dircetionTimer);var t=this;this.dircetionTimer=setInterval(function(){t._dispatchEvent(e.event,e.target._roamType)},100),h.stop(e.event)},_drictionHandlerOff:function(){clearInterval(this.dircetionTimer)},__scaleHandler:function(e){this._dispatchEvent(e.event,e.target._roamType),h.stop(e.event)},_dispatchEvent:function(e,t){this.messageCenter.dispatch(r.EVENT.ROAMCONTROLLER,e,{roamType:t,mapTypeControl:this.rcOption.mapTypeControl,step:this.rcOption.step},this.myChart)},refresh:function(e){e&&(this.option=e||this.option,this.option.roamController=this.reformOption(this.option.roamController),this.rcOption=this.option.roamController),this.clear(),this._buildShape()}},s.inherits(t,n),e("../component").define("roamController",t),t}),n("echarts/util/mapData/params",["require"],function(e){function t(e){if(!e.UTF8Encoding)return e;for(var t=e.features,i=0;i<t.length;i++)for(var a=t[i],o=a.geometry.coordinates,r=a.geometry.encodeOffsets,s=0;s<o.length;s++){var l=o[s];if("Polygon"===a.geometry.type)o[s]=n(l,r[s]);else if("MultiPolygon"===a.geometry.type)for(var h=0;h<l.length;h++){var m=l[h];l[h]=n(m,r[s][h])}}return e.UTF8Encoding=!1,e}function n(e,t){for(var n=[],i=t[0],a=t[1],o=0;o<e.length;o+=2){var r=e.charCodeAt(o)-64,s=e.charCodeAt(o+1)-64;r=r>>1^-(1&r),s=s>>1^-(1&s),r+=i,s+=a,i=r,a=s,n.push([r/1024,s/1024])}return n}var i={none:{getGeoJson:function(e){e({type:"FeatureCollection",features:[{type:"Feature",geometry:{coordinates:[],encodeOffsets:[],type:"Polygon"},properties:{}}]})}},world:{getGeoJson:function(n){e(["./geoJson/world_geo"],function(e){n(t(e))})}},china:{getGeoJson:function(n){e(["./geoJson/china_geo"],function(e){n(t(e))})}},"南海诸岛":{textCoord:[126,25],getPath:function(e,t){for(var n=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]],i="",a=e[0],o=e[1],r=0,s=n.length;s>r;r++){i+="M "+((n[r][0][0]*t+a).toFixed(2)-0)+" "+((n[r][0][1]*t+o).toFixed(2)-0)+" ";for(var l=1,h=n[r].length;h>l;l++)i+="L "+((n[r][l][0]*t+a).toFixed(2)-0)+" "+((n[r][l][1]*t+o).toFixed(2)-0)+" "}return i+" Z"}},"新疆":{getGeoJson:function(n){e(["./geoJson/xin_jiang_geo"],function(e){n(t(e))})}},"西藏":{getGeoJson:function(n){e(["./geoJson/xi_zang_geo"],function(e){n(t(e))})}},"内蒙古":{getGeoJson:function(n){e(["./geoJson/nei_meng_gu_geo"],function(e){n(t(e))})}},"青海":{getGeoJson:function(n){e(["./geoJson/qing_hai_geo"],function(e){n(t(e))})}},"四川":{getGeoJson:function(n){e(["./geoJson/si_chuan_geo"],function(e){n(t(e))})}},"黑龙江":{getGeoJson:function(n){e(["./geoJson/hei_long_jiang_geo"],function(e){n(t(e))})}},"甘肃":{getGeoJson:function(n){e(["./geoJson/gan_su_geo"],function(e){n(t(e))})}},"云南":{getGeoJson:function(n){e(["./geoJson/yun_nan_geo"],function(e){n(t(e))})}},"广西":{getGeoJson:function(n){e(["./geoJson/guang_xi_geo"],function(e){n(t(e))})}},"湖南":{getGeoJson:function(n){e(["./geoJson/hu_nan_geo"],function(e){n(t(e))})}},"陕西":{getGeoJson:function(n){e(["./geoJson/shan_xi_1_geo"],function(e){n(t(e))})}},"广东":{getGeoJson:function(n){e(["./geoJson/guang_dong_geo"],function(e){n(t(e))})}},"吉林":{getGeoJson:function(n){e(["./geoJson/ji_lin_geo"],function(e){n(t(e))})}},"河北":{getGeoJson:function(n){e(["./geoJson/he_bei_geo"],function(e){n(t(e))})}},"湖北":{getGeoJson:function(n){e(["./geoJson/hu_bei_geo"],function(e){n(t(e))})}},"贵州":{getGeoJson:function(n){e(["./geoJson/gui_zhou_geo"],function(e){n(t(e))})}},"山东":{getGeoJson:function(n){e(["./geoJson/shan_dong_geo"],function(e){n(t(e))})}},"江西":{getGeoJson:function(n){e(["./geoJson/jiang_xi_geo"],function(e){n(t(e))})}},"河南":{getGeoJson:function(n){e(["./geoJson/he_nan_geo"],function(e){n(t(e))})}},"辽宁":{getGeoJson:function(n){e(["./geoJson/liao_ning_geo"],function(e){n(t(e))})}},"山西":{getGeoJson:function(n){e(["./geoJson/shan_xi_2_geo"],function(e){n(t(e))})}},"安徽":{getGeoJson:function(n){e(["./geoJson/an_hui_geo"],function(e){n(t(e))})}},"福建":{getGeoJson:function(n){e(["./geoJson/fu_jian_geo"],function(e){n(t(e))})}},"浙江":{getGeoJson:function(n){e(["./geoJson/zhe_jiang_geo"],function(e){n(t(e))})}},"江苏":{getGeoJson:function(n){e(["./geoJson/jiang_su_geo"],function(e){n(t(e))})}},"重庆":{getGeoJson:function(n){e(["./geoJson/chong_qing_geo"],function(e){n(t(e))})}},"宁夏":{getGeoJson:function(n){e(["./geoJson/ning_xia_geo"],function(e){n(t(e))})}},"海南":{getGeoJson:function(n){e(["./geoJson/hai_nan_geo"],function(e){n(t(e))})}},"台湾":{getGeoJson:function(n){e(["./geoJson/tai_wan_geo"],function(e){n(t(e))})}},"北京":{getGeoJson:function(n){e(["./geoJson/bei_jing_geo"],function(e){n(t(e))})}},"天津":{getGeoJson:function(n){e(["./geoJson/tian_jin_geo"],function(e){n(t(e))})}},"上海":{getGeoJson:function(n){e(["./geoJson/shang_hai_geo"],function(e){n(t(e))})}},"香港":{getGeoJson:function(n){e(["./geoJson/xiang_gang_geo"],function(e){n(t(e))})}},"澳门":{getGeoJson:function(n){e(["./geoJson/ao_men_geo"],function(e){n(t(e))})}}};return{decode:t,params:i}}),n("echarts/util/mapData/textFixed",[],function(){return{"广东":[0,-10],"香港":[10,10],"澳门":[-10,18],"黑龙江":[0,20],"天津":[5,5],"深圳市":[-35,0],"红河哈尼族彝族自治州":[0,20],"楚雄彝族自治州":[-5,15],"石河子市":[-5,5],"五家渠市":[0,-10],"昌吉回族自治州":[10,10],"昌江黎族自治县":[0,20],"陵水黎族自治县":[0,20],"东方市":[0,20],"渭南市":[0,20]}}),n("echarts/util/mapData/geoCoord",[],function(){return{Russia:[100,60],"United States of America":[-99,38]}}),n("echarts/util/projection/svg",["require","zrender/shape/Path"],function(e){function t(e){return parseFloat(e||0)}function n(e){for(var n=e.firstChild;"svg"!=n.nodeName.toLowerCase()||1!=n.nodeType;)n=n.nextSibling;var i=t(n.getAttribute("x")),a=t(n.getAttribute("y")),o=t(n.getAttribute("width")),r=t(n.getAttribute("height"));return{left:i,top:a,width:o,height:r}}function i(e,t){function n(e){var t=e.tagName;if(m[t]){var o=m[t](e,i);o&&(o.scale=i,o.properties={name:e.getAttribute("name")||""},o.id=e.id,s(o,e),a.push(o))}for(var r=e.childNodes,l=0,h=r.length;h>l;l++)n(r[l])}var i=[t.scale.x,t.scale.y],a=[];return n(e),a}function a(e,t){var n=t instanceof Array?[1*t[0],1*t[1]]:[1*t.x,1*t.y];return[n[0]/e.scale.x,n[1]/e.scale.y]}function o(e,t){var n=t instanceof Array?[1*t[0],1*t[1]]:[1*t.x,1*t.y];return[n[0]*e.scale.x,n[1]*e.scale.y]}function r(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function s(e,t){var n=t.getAttribute("fill"),i=t.getAttribute("stroke"),a=t.getAttribute("stroke-width"),o=t.getAttribute("opacity");n&&"none"!=n?(e.color=n,i?(e.brushType="both",e.strokeColor=i):e.brushType="fill"):i&&"none"!=i&&(e.strokeColor=i,e.brushType="stroke"),a&&"none"!=a&&(e.lineWidth=parseFloat(a)),o&&"none"!=o&&(e.opacity=parseFloat(o))}function l(e){for(var t=r(e).replace(/,/g," ").split(/\s+/),n=[],i=0;i<t.length;){var a=parseFloat(t[i++]),o=parseFloat(t[i++]);n.push([a,o])}return n}var h=e("zrender/shape/Path"),m={path:function(e,t){var n=e.getAttribute("d"),i=h.prototype.getRect({path:n});return{shapeType:"path",path:n,cp:[(i.x+i.width/2)*t[0],(i.y+i.height/2)*t[1]]}},rect:function(e,n){var i=t(e.getAttribute("x")),a=t(e.getAttribute("y")),o=t(e.getAttribute("width")),r=t(e.getAttribute("height"));return{shapeType:"rectangle",x:i,y:a,width:o,height:r,cp:[(i+o/2)*n[0],(a+r/2)*n[1]]}},line:function(e,n){var i=t(e.getAttribute("x1")),a=t(e.getAttribute("y1")),o=t(e.getAttribute("x2")),r=t(e.getAttribute("y2"));return{shapeType:"line",xStart:i,yStart:a,xEnd:o,yEnd:r,cp:[.5*(i+o)*n[0],.5*(a+r)*n[1]]}},circle:function(e,n){var i=t(e.getAttribute("cx")),a=t(e.getAttribute("cy")),o=t(e.getAttribute("r"));return{shapeType:"circle",x:i,y:a,r:o,cp:[i*n[0],a*n[1]]}},ellipse:function(e,t){var n=parseFloat(e.getAttribute("cx")||0),i=parseFloat(e.getAttribute("cy")||0),a=parseFloat(e.getAttribute("rx")||0),o=parseFloat(e.getAttribute("ry")||0);return{shapeType:"ellipse",x:n,y:i,a:a,b:o,cp:[n*t[0],i*t[1]]}},polygon:function(e,t){var n=e.getAttribute("points"),i=[1/0,1/0],a=[-1/0,-1/0];if(n){n=l(n);for(var o=0;o<n.length;o++){var r=n[o];i[0]=Math.min(r[0],i[0]),i[1]=Math.min(r[1],i[1]),a[0]=Math.max(r[0],a[0]),a[1]=Math.max(r[1],a[1])}return{shapeType:"polygon",pointList:n,cp:[(i[0]+a[0])/2*t[0],(i[1]+a[1])/2*t[0]]}}},polyline:function(e,t){var n=m.polygon(e,t);return n}};return{getBbox:n,geoJson2Path:i,pos2geo:a,geo2pos:o}}),n("echarts/util/projection/normal",[],function(){function e(e,n){return n=n||{},e.srcSize||t(e,n),e.srcSize}function t(e,t){t=t||{},r.xmin=360,r.xmax=-360,r.ymin=180,r.ymax=-180;for(var n,i,a=e.features,o=0,s=a.length;s>o;o++)if(i=a[o],!i.properties.name||!t[i.properties.name])switch(i.type){case"Feature":r[i.geometry.type](i.geometry.coordinates);break;case"GeometryCollection":n=i.geometries;for(var l=0,h=n.length;h>l;l++)r[n[l].type](n[l].coordinates)}return e.srcSize={left:1*r.xmin.toFixed(4),top:1*r.ymin.toFixed(4),width:1*(r.xmax-r.xmin).toFixed(4),height:1*(r.ymax-r.ymin).toFixed(4)},e}function n(e,n,i){function a(e,t){c=e.type,u=e.coordinates,o._bbox={xmin:360,xmax:-360,ymin:180,ymax:-180},y=o[c](u),m.push({path:y,cp:o.makePoint(t.properties.cp?t.properties.cp:[(o._bbox.xmin+o._bbox.xmax)/2,(o._bbox.ymin+o._bbox.ymax)/2]),properties:t.properties,id:t.id})}i=i||{},o.scale=null,o.offset=null,e.srcSize||t(e,i),n.offset={x:e.srcSize.left,y:e.srcSize.top,left:n.OffsetLeft||0,top:n.OffsetTop||0},o.scale=n.scale,o.offset=n.offset;for(var r,s,l,h=e.features,m=[],V=0,U=h.length;U>V;V++)if(l=h[V],!l.properties.name||!i[l.properties.name])if("Feature"==l.type)a(l.geometry,l);else if("GeometryCollection"==l.type){r=l.geometries;for(var d=0,p=r.length;p>d;d++)s=r[d],a(s,s)}var c,u,y;return m}function i(e,t){var n,i;return t instanceof Array?(n=1*t[0],i=1*t[1]):(n=1*t.x,i=1*t.y),n=n/e.scale.x+e.offset.x-168.5,n=n>180?n-360:n,i=90-(i/e.scale.y+e.offset.y),[n,i]}function a(e,t){return o.offset=e.offset,o.scale=e.scale,o.makePoint(t instanceof Array?[1*t[0],1*t[1]]:[1*t.x,1*t.y])}var o={formatPoint:function(e){return[(e[0]<-168.5&&e[1]>63.8?e[0]+360:e[0])+168.5,90-e[1]]},makePoint:function(e){var t=this,n=t.formatPoint(e);t._bbox.xmin>e[0]&&(t._bbox.xmin=e[0]),t._bbox.xmax<e[0]&&(t._bbox.xmax=e[0]),t._bbox.ymin>e[1]&&(t._bbox.ymin=e[1]),t._bbox.ymax<e[1]&&(t._bbox.ymax=e[1]);var i=(n[0]-o.offset.x)*o.scale.x+o.offset.left,a=(n[1]-o.offset.y)*o.scale.y+o.offset.top;return[i,a]},Point:function(e){return e=this.makePoint(e),e.join(",")},LineString:function(e){for(var t,n="",i=0,a=e.length;a>i;i++)t=o.makePoint(e[i]),n=0===i?"M"+t.join(","):n+"L"+t.join(",");return n},Polygon:function(e){for(var t="",n=0,i=e.length;i>n;n++)t=t+o.LineString(e[n])+"z";return t},MultiPoint:function(e){for(var t=[],n=0,i=e.length;i>n;n++)t.push(o.Point(e[n]));return t},MultiLineString:function(e){for(var t="",n=0,i=e.length;i>n;n++)t+=o.LineString(e[n]);return t},MultiPolygon:function(e){for(var t="",n=0,i=e.length;i>n;n++)t+=o.Polygon(e[n]);return t}},r={formatPoint:o.formatPoint,makePoint:function(e){var t=this,n=t.formatPoint(e),i=n[0],a=n[1];t.xmin>i&&(t.xmin=i),t.xmax<i&&(t.xmax=i),t.ymin>a&&(t.ymin=a),t.ymax<a&&(t.ymax=a)},Point:function(e){this.makePoint(e)},LineString:function(e){for(var t=0,n=e.length;n>t;t++)this.makePoint(e[t])},Polygon:function(e){for(var t=0,n=e.length;n>t;t++)this.LineString(e[t])},MultiPoint:function(e){for(var t=0,n=e.length;n>t;t++)this.Point(e[t])},MultiLineString:function(e){for(var t=0,n=e.length;n>t;t++)this.LineString(e[t])
-},MultiPolygon:function(e){for(var t=0,n=e.length;n>t;t++)this.Polygon(e[t])}};return{getBbox:e,geoJson2Path:n,pos2geo:i,geo2pos:a}}),n("echarts/util/mapData/geoJson/an_hui_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3415",properties:{name:"六安市",cp:[116.3123,31.8329],childNum:6},geometry:{type:"Polygon",coordinates:["@@„„nJ‚UXUVƒ°U„ÑnU@mlLVaVln@@bn@VU@xlb@lšLnKlšƒVI„JšUVxnI@lVL@b„Ž°VX@˜b„x„nVVUnVVnU‚›@kX@VwV@„al¥UUnUWa@ƒ@wĸU„LU¥lKUa@aUI@alLVaUƒ¯anƒWkUKm@XV@VaXlW@aU_UWVUƒI¯@ma¯W¯™™I@UU@WWU@U@@UU@VkV@@WUUm@UaU@„lK@IUK„L@KWmXUWaXI@ƒ@a@a@U@U@KV¥lw„k°b²JVIVKlV@UX„la„Ul`œUVLVVVUšJ„U@Lnm@_VK@KUIW@™J@Xk@WW@U—ƒmm™XmWk@kK@aUUƒVmmkUwUmWL™@WmU@™UJmUULkKWakLWVkIƒlƒwULƒW@X°lUJ@°ULƒWV—wmJ@bmb¯Vkm@@WkWm¯wƒL@lkXƒWmXym¯UImJUbkV™@Vn¯„@V@lUbƒ@mk@maUxmlUbULWn@J—LmKUkWKkwUKƒbm„X„WxkVUKmLkVV@JUUWL@xkJUUƒV@X@VVlUbVX@xk¤šx‚¼œxWxn„‚nn@Þ¼„JVb°aVn„@šmlnXU„JlbVlkz@‚lUŽlXJmxVxXnWxXÈWlUŽ@šUxU@VX@xUL@šUÆmLnV@lWXk@@JlbXblnlJ"],encodeOffsets:[[118710,33351]]}},{type:"Feature",id:"3408",properties:{name:"安庆市",cp:[116.7517,30.5255],childNum:9},geometry:{type:"Polygon",coordinates:["@@n°‚znW„XlW@k„K°xXn‚l@Xn@l‚°Una@anI˜xXU„ŽVK@¯VIkW¯X@‚„VK„x„klJXUlKXblLVKnVVIšŽV@Xn‚@šŽXKVnVxlŽnn„UlmV@²óUkV™lW„b„lƒšƒn@VVVIn@lw@WVIXblV„@Èx‚aUaVIVVnKVLšK„ƒln@b²K@»U£ƒÑķƒġÝÅb™K™a@Im@ۍ„@kWÓkkmKÅnóJƒUÅ£›W@w„ĕ@wĉţ¯¯ƒUkK±l¯Uƒ¥UÑkÝUķ»Ý¥¯™JƒIUŽVbUl¯ÈV¼VJU¼Vb@bkLUl@„VJ@bUXǚ@lkVmXmKkLVxš‚Ž„VƒL@VkVVVlzW˜kbmLUUUbVbUV™šlÒnJlUnLllUL@bU„Vx„l‚LXVƦÈVU¦WJ"],encodeOffsets:[[118834,31759]]}},{type:"Feature",id:"3411",properties:{name:"滁州市",cp:[118.1909,32.536],childNum:7},geometry:{type:"Polygon",coordinates:["@@š„@`nnl@„xšK@X°KXV˜IXVlbXVWnX‚lL@šÈ»‚LVan@VJ„êVVn@‚X@laÞbVaƒyn@„_‚xnWVXnWl@VnUVkI@l‚nXKVLVV@V@kW@LlVô„@J@bVnnKnkVa@»lç@ƒnwšKma™UUUVњ@n™mWXalI@alVn@VwUaVU„@„nlaôJnU„VVXlJšaXXVK@UšV@VWx@nXVWšXVšUlLUbV‚ULVVnUVbUbVbš@@a„KÆnnKVK@U@UU@@a„@Vƒ°¯ÈJVIlķ@aa˜UaVKU_@mkxUI@aƒUlyU@@™wkKWmUbUnUVWbkJW_J@bƒn@Vm@@KULk@V@@bVbÅm@LW@UVVbkK@UkKWL@VULUKWIUJUbkK@_WVXU›Jka@XƒVa@kšy@aVIUUW@@m„UlLœKWÑUKVan@UkVmmIXKƒaVaUwVU@UmykU¯@±UUL@WUIVUU@KkIWaƒaU@kUUaǃUó»mKƒk¯@y@kWK@bkI¯`mn™l¯XWlkVUzUJlbUbVJl@nnm„@VULV`XnWƗbmUUn™JmUknƒJ¯km@ƒyk@kU›xL@VUbmnn¤lX@`™z@JmaULUVl@Xn@xllkXWa—aW@UVmUbƒ@mVXšWxXbWbUŽƒÒnVVnVVUL"],encodeOffsets:[[120004,33520]]}},{type:"Feature",id:"3418",properties:{name:"宣城市",cp:[118.8062,30.6244],childNum:7},geometry:{type:"Polygon",coordinates:["@@Vb@„XL˜JXxlIXxlVlV@I²¤šnlUnVšU@VULWVUJ@Lnb@lV@UnV@@VVVlLnbnJ‚UVkUUVWn@@anUVnVJVIV‚@@nUJVbUb‚„@VUbVK@bn@VbnIlxkllXVlXKWUXUlL°¤UVVb@bš„UlkXW‚ƒxXz@‚„Ila„UlƒnUlJVInVÆJ„U„LVUnV„K°@VnlVnxV@XLlK@wVL@KnUlJXU˜bnKVLX„lUw@VWlLXKm@@a„@VLnmlIVVnKn@škVašVlwk@@a@k@ƒVIUa™@maUa@wna@kmWƒ™UUmVUIVǗ@aƒKm™aƒ™kU™J@InmUUaVa„k‚lX@Vk@m@VU@wnK@alKVUkUkKƒbmUkmƒ@U£WVk@@UÝbbƒaÇx@b@WVUa¯ƒ@wVwUUV@VwnK@KWaŁ@KšIUyUI@WmXó™UbWaKm™@km@IUyƒIUaWKƒx@zUKUL@llVUnkLVVkJWX@VUKUVƒIkVWakb@VWb@n@JkXUlmL@xkL@`VxšLUÈUJ@Vm@@bmIUlUL@VUVVbknm@mKUw™KVÈ@J@LV±kkJUIƒl"],encodeOffsets:[[120803,31247]]}},{type:"Feature",id:"3412",properties:{name:"阜阳市",cp:[115.7629,32.9919],childNum:6},geometry:{type:"Polygon",coordinates:["@@V™nƒš@ša„k°aš±@‚¥@UUI@aUmlwUUx›b@¥XU@mmI@a@Kn@@_W@@W„I@mšUVVXUl@XaV@‚K@I@a„LX@aVI°K@KVL„UUw‚yXkšK@kšKÆbXnlK@k@a„JlU@w@U@»@aXKWƒn_‚JXkVKnƒ@°LlKXƒW@¯Uƒ@aUK@kmJUw™VƒIUJ™„kŽmL™K@kka@wUVm@@am@UkUbkK@nmVƒÒ¯VU„WVVmIƒƒULk@ƒƒma@kkKƒƒ@nUbUamU™`UUVUkKVkkƒW@@bkmƒnƒmUXVKXVƒL@VƒbU„m‚™bVXJ@nmKÅI@KWKUXVJUL@VUKUX@KUKWL@LUJmaXXm@kVVV@L@VUL@VlK@L@V@LUK@VUb@UUU@°@nVxU`‚Lkn@`@XVJ@X™Vm„k@UKmV¯LVVn±Wm@Ub@JlLUl„@VLk„@lmVVn@bnV@V°IV™šaVJXI°K°V@XXVlVVU„nšKVlUš„bWXnV@bV`U„„@@m@@‚ƒ@nxmn@bXVlL@¤nb„Ul¦šVVUnJVU„Vl@@bÞL"],encodeOffsets:[[118418,34392]]}},{type:"Feature",id:"3413",properties:{name:"宿州市",cp:[117.5208,33.6841],childNum:5},geometry:{type:"Polygon",coordinates:["@@@UWU@bkW@aWU@aUIkWV™lLXb„lVIUVV@‚mn@V_n@VaUK@I‚@UašanJVU„@lV„UVnnKVVlaUa„I@wnK‚Lnll@nVlk@wVKXkl@@b„bUJ@V‚U@U„UUyVk@aVUXwlWXX‚WU¹@aU™@WUI@mlUšn„J@Il@šaXbV@VKl@XxVL@W„IšJlb„@„al@„IUUm@@aVK@¥¯—@mUķ¯bWƒk£Vm@akm@VaÅ@UVWaƒ@UJWkƒJ—UƒbWbU@UlƒXk@ƒamV@K¯nk@ƒlU@Uxmz@bU`ÇbUbÅVm£U@Ww™x@akLUK@UlakwUJWVkLmaUal@n_ƒmVUnKVUUmÅXWa™@kJmx@XUJ@bVLXxl@VVUVV„UbkLWbU@@lUVV„VVX„›K@XkJ@nU@@bV@VxUVlb„U@xXLWŽn@UxVbVĊ„V@b@XV`mnkJ@kUKmbƒaU@VbnbÆx@XU@@`k@@bl„™@@bkL@WƒakXWaU@Vmkx@XWW@@wUUUbƒJ™U¯V™@¯ÞU@WxXŽlL@bkb@ŽlVlnb™JW@kkU@mbkaWJ—IVlmz¯`UnU@mb™@@„ƒ`@bkVlœnV@b@šV@„aVxn@Vx‚KXnl@nbVK„bVK@a„_V@Vƒ„w@W„LlwnK@UmIU@VWš@šUÈ@lKnal„wš@@V°@šaUmlUUw@„ƒV@@UXK"],encodeOffsets:[[119836,35061]]}},{type:"Feature",id:"3410",properties:{name:"黄山市",cp:[118.0481,29.9542],childNum:5},geometry:{type:"Polygon",coordinates:["@@lXnlWX@VUJVnUJVzXJVx„kVJlI²l‚U@K@IUǚLVxnLn@lmUaVU@UVKVknJ@an@@UVIVǙKUw@_lK@wnKVklW@I@mXa@UlaXblU„JVUVL@UXWlIUUlKVmkU@kVKVL@y„wXLVb„JVz@Jlnš@nŽ‚LXbVaôšnW@la@UVWUa@@a@mk@WIk@VwUa¯¥m@UUVK@ImK@aX£ƒkK›ÅV™a™™ƒ_@±ƒakXWW—LƒƒƒnU@@a@¯mK@L™JUWwUV™VmbXX@lWLn`mzUJUb™Lƒ„k@makVWmkX™ambkKknƒaƒ@ƒaƒb@‚U@Unm@—ƒWVƒ@VbUbUJWIk@@lmL@°UVUVm„nš™@@kmWkb@xƒ_m@@aU@b@JlŽUz™lWxXn„@‚b²@l`„IVl„UlL@VšK„nVbUl@VlIn@@b„bVWUk‚@@bX@Valb@bnb°Vn@„xVKlbVnV@V‚x„L@ln@UXVV‚L˜"],encodeOffsets:[[120747,31095]]}},{type:"Feature",id:"3414",properties:{name:"巢湖市",cp:[117.7734,31.4978],childNum:5},geometry:{type:"Polygon",coordinates:["@@VV@blL@ŽXlWnnšnŽ˜„@VXXl@@WšIX@VJ@LšxŎxlnšŽ@bXJVblX@VVbUVn@VbUVlb@LnJVbVLV‚XLšÒVL„ÒšV„bVIVylUXk°Wšknm°_lJ@aXL@l‚z°@„lnLô¼V‚È„VUUaVKU@WW@@UUa@knmVLlaV@„a@kšak±@UmwkKmk™lj™ÝUUkL@mlIVmnÝWkkUÝ@KƑĉ™a@»ƒmma@mX™¤¯Uƒw@ƒ@UU@bU±±L@akmƒ„™LUKmLUUUJVbbÇwƒ@kUWaUJ@Xkxm@UJUUm@™„k„ƒ‚ƒakXUšVl±ôU@kn"],encodeOffsets:[[119847,32007]]}},{type:"Feature",id:"3416",properties:{name:"亳州市",cp:[116.1914,33.4698],childNum:4},geometry:{type:"Polygon",coordinates:["@@lU@Un@@anUlw@KVmUwlaX_lKna@KU@@kWKUU@ankW™XK˜@@V²VVIÈU@al@VaÈamK@wU™@klaUƒV@XƒVUU»WUUbkmUkVmk@aÈw@mWU@VkIkVWKUÑķXȭºU¯lƒ@kkLWmÅa™L@l™LWlzVxƒVUK@L¯LUJ@bWƒK@b@JLU@Wbk@WVUU™V@nƒJ@XX@@`m@@L@bnJ@nWV@¦œa‚wVVkxVn@bVJ@V¦@Ž™²¯bƒl™b™@m„UšUŽƒŽ@¼ƒ¦Xb‚UV`@nnxUxWLkUkVWKkV@XV@@VVL@VX„@lVV@L@blL@`šL@xXKVL‚@„VnUš@lwnU@ml@XnV@@UVW°LnalƒUI@aUK@a‚a@U„kXW@I@mWL@UXK@UVW@U‚@@k„Wn‚@@V„@XblaVxšL@bVKXb„IlJ"],encodeOffsets:[[119183,34594]]}},{type:"Feature",id:"3417",properties:{name:"池州市",cp:[117.3889,30.2014],childNum:4},geometry:{type:"Polygon",coordinates:["@@„V°°ĊŤ@xƒĖ@xœXƤ„VôIÆmnLllXÔ@lƒÜŽn@@JšbšLÆaĢÞĸ„°VVUUKVanK@UV@VL„VVn„ln@‚xnklxXamk@WV@Xa˜@naVk„Klk™@mkUWwkJWw—IWK@ƒUaUwWIUyVIUmVI@UXWmkkW‚—KUUVWm@@kƒKw@U‚UUmkaULƒwm@¯Uma@akaUbW@@a@VlUXƒa@am@kJ@UVkUaƒm™L@UkKƒVUkƒJk_±@aƒ@WmXwÇkkaVaUa±ƒœwV@VkƒwnyUaW@UU¯amLk@m™@kmmU™™¯K@L@lUX¯ƒWlkXƒŽVb„bƒVUL@J@LVKnlJXnlb@`nXlalV@bnL@Vnb˜¼@lXbWlkL™K@zUJmIUxUVUVmX","@@llUL@VlxšL@a@UƒwXa¯@"],encodeOffsets:[[119543,30781],[120061,31152]]}},{type:"Feature",id:"3401",properties:{name:"合肥市",cp:[117.29,32.0581],childNum:4},geometry:{type:"Polygon",coordinates:["@@„L„xV‚ĊLÞkšVlVVXaWaXwW™nU„@‚anVVUX@˜bXblWkk@wWmk@VUVKnb@Išy@_kWm£nmVa@U‚KœwlVl@„zn@°l„IlmnVšIVmnV˜aXÅWmU_VK@Unƒmmk@UIVakaƒa™UƒÑUK™ÑWKUUKUamI@KkaVUUam@VUUa@UkWUaWI@a™kmōw™wUL@`mn@KƒV™IUVUUUK›Vk_ƒVkbWƒ@VkUULUJ±I¯aƒlkxU¦@L@V@V@b@b@„WJXbWVXn@LƒKVL@JkLƒŽV@Vbn@VV@XU@UlV@@VV@V@XXV@@VšJ°š°Xnb°@„JUVVXV`@bkXWŽUbU@WŽn@VLXlm„°bV„UbkK@bVJ@bVbkLV¦ƒKķV@x@„XbmVVVk¦"],encodeOffsets:[[119678,33323]]}},{type:"Feature",id:"3403",properties:{name:"蚌埠市",cp:[117.4109,33.1073],childNum:4},geometry:{type:"Polygon",coordinates:["@@VÒXLlUlJ@UXV@nÇx@bnlUVllnVaXVV¼UVW„U@V„²wVV@Vl@„VnwlIš@XbÆWVnUVmLUV„nm`k@VbnblKXUVIlxkb@VVLlK@bšwXxV@n¤ÆUVaÈaV_@anyVwV@„kl@°m@LnU„bl@„WVkV@Xa„a˜V„IXl‚IV‚„@XbVUÆ@XKWwUkmW@_UmnIlJXkWKXmV@‚w@_XV@Kl@kU@KlX@@UUUUKWLm@klJVUUmk@mXUWmXwƒ`m@„zUbÝakbW@m@UUƒéUIm@UbKǼ@™kKWXmWUkaWU—JWU¯L@W™Lƒwk@mm@_™ƒÅl™UVkmWUnV@VWLUb™bƑĬ¯l"],encodeOffsets:[[119543,33722]]}},{type:"Feature",id:"3402",properties:{name:"芜湖市",cp:[118.3557,31.0858],childNum:4},geometry:{type:"Polygon",coordinates:["@@„bVaV@XllLXU°ŽlL@V@VUnVl¯Ikš›VUVU@@b@lUXUWmb„n@¼šbƒĊ‚LÞ@lVXlmÞUnkJ@nlKVVšÞXklWVaVI@aUKn»lL@Kn@‚XXwlm@mn°@„V@Wy„wXlWVk™ƒ@aUaVU¯£kKWVXVWLUkkWlkkwmJUam@@aULVa@UƒVaUaVI@m‚@UUJUIUmmV@bm@UXVVUlVmImakKUU@UU@VmU@@kma@KVIXUVK@U™VmUkV™m±£@JkU@nlšk‚ƒLUlmb—@WbU@@XnlWb"],encodeOffsets:[[120814,31585]]}},{type:"Feature",id:"3406",properties:{name:"淮北市",cp:[116.6968,33.6896],childNum:3},geometry:{type:"MultiPolygon",coordinates:[["@@lnnK@¦n@@V‚V„@@VV@nIV„V@VW²a@b@bVnUVVV@V™z@lš@°UšV„IVaVV@x@ŽXX@WlwUnV@XblW„b@XlK@aš@kƒ@al@@_V@@WÅwmaUaV@„bnaVL@llInmU_@W@aƒUUĉUaVwm@XWK@wƒVkaVUUwU@@aV@@mlI@WœLWƒUUUƒVU@kV@XalKVaUƒVUUUk@WwUK@aVI@WƒUk@@UUU±xkb@lVš@xnLÇbUbk@@bÇVUJ±U@U—@WLXšml@bVVXL@lV@@LmbkLW`kbVxUn@LkxmV@bm@@VkV"],["@@VVVkV@¥@UV@U@VUUJƒkWakKUšlXVJ@bXV@blX@aXV@V"]],encodeOffsets:[[[119183,34594]],[[119836,35061]]]}},{type:"Feature",id:"3404",properties:{name:"淮南市",cp:[116.7847,32.7722],childNum:2},geometry:{type:"Polygon",coordinates:["@@°kƒīšaVaXK@U‚UVmnXUlšVÆkVKUUUmmU„ÑkU™UÝlĉKUƒwƒKƒbU@UxW@@lœmVUUVmUUƒmƒw—aW„kL¯K@Žm„ULWlIm`X„WL@b@¼@V@xkVƒI@b@l@lk„V°Ȯ¹ĸW"],encodeOffsets:[[119543,33722]]}},{type:"Feature",id:"3405",properties:{name:"马鞍山市",cp:[118.6304,31.5363],childNum:2},geometry:{type:"Polygon",coordinates:["@@šNJnllLnxV@laXLVKma„aXbVI„bVKVVVIVyn@n_ƒƒW@@ƒ„UnJlUVVXlLnaUWlV@VV„IXW@_W@XK@K@UVUUwVamÑXmmwƒw™KUnUK™çU@ƒJƒU¯@mŽ@nknWxWm@@LkKm¼VL@bUJUbkXWl"],encodeOffsets:[[121219,32288]]}},{type:"Feature",id:"3407",properties:{name:"铜陵市",cp:[117.9382,30.9375],childNum:3},geometry:{type:"MultiPolygon",coordinates:[["@@„ÒV¤@¼V²@aVV@Ž@„„x°Vš£nW‚@nbnaVXVW@k@aV@VUœUl™°JUkVm@U@UkK¯WVkKWkU@Ubƒakwmlwm@ƒkUmƒUUKU@@VmLUbVLUV¯U"],["@@LllUL@VlxšL@a@UƒwXamK"]],encodeOffsets:[[[120522,31529]],[[120094,31146]]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/ao_men_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"8200",properties:{name:"澳门",cp:[113.5715,22.1583],childNum:1},geometry:{type:"Polygon",coordinates:["@@HQFMDIDGBI@E@EEKEGCEIGGEKEMGSEU@CBEDAJAP@F@LBT@JCHMPOdADCFADAB@LFLDFFP@DAB@@AF@D@B@@FBD@FADHBBHAD@FAJ@JEDCJI`gFIJW"],encodeOffsets:[[116325,22699]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/bei_jing_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"110228",properties:{name:"密云县",cp:[117.0923,40.5121],childNum:1},geometry:{type:"Polygon",coordinates:["@@vIHZDZQtDLNMXIbHRCXXITbJ@H`LGPRDDJNCLHTOCWFGvGBUJMKGFO^IHWXITQCI’Y^AXGfRˆDXF`DJOLB~G\\DZIHHpErUVMhHb]\\M†BVF@FTP`@zTbD\\@~M\\K`H^EVODWICAakAQXoIcCOCIgGYNWFWNGGKKGaJEGMEIKYJUT_J_Go@_SyQaSFMEGTcYOQLIIi@EKAUPCV[EEXQCW|aMUMAaYCYNIDGGACIMGGSKDQGaF_C[GaB@GOIiOKAYL“mI@CN]F[SWWAcKKI@HMUimEKbeYQYISNUOcBKPIFBNgvDPGZYFSf]CMSIWGEUFgDIQ[MeDMJS@RR@LphFPCHaBAJKF@J]IBJO@HlO@@RKAMPJHCNDJTHFP@ZGNANBRFH@J_fM^ONJNF\\VTDJHDON@XRND\\XRCPVETCLBVKDFJINHRGPRV@\\CLJN@VbXbLVT"],encodeOffsets:[[119561,41684]]}},{type:"Feature",id:"110116",properties:{name:"怀柔区",cp:[116.6377,40.6219],childNum:1},geometry:{type:"Polygon",coordinates:["@@JHTVHXCHPfnDJGHNDJSB[JSBGVSAOH@PMPuDEHHXZN@PHF@ZLJ@LHVYJA\\OFWP]BMtMBSRGV[JeVAPQVIFENMD¡–@^NV\\JH@NNL@NM\\kTQ\\I^FNIpBHGTBFFAZQfKDIXQTLXFXNNVMVHRGpCFLlRLEVBBH`IVO\\G`RDPAXLXBXORHZEHTDLLN@VGTMrQNFPeASKG@GMOAKBYMK@GTUHUXSHMVDNMOUEOZMJML@^KRACMZEZMRQLUHE@OFENPR@DI\\ChMHIDG\\GJMDWHCKGMDCIQCHO_K@GaIJSWWQDaGWJMNCKRsCYGYuJUSaKaW@UIMDK@[QUHOGQJMEILCAUDKFSOUQD[WMC‚Q@WPMGCCIUSE[IMPMN]`e@IEGAQBMHM@YEOSGCIDMIGNOLB@QP@GkP@AI^J@ILEBIbADGEOog@KQQWSekWQQUOFKZLF@PUNmIaHIUeBCTSHENcJa@_IWSaGu`GLSBKJQFOXGDXVQVOBIHcDSJWBEFGTMH[^mLaXcHiKElTRKtFXZ`MHMPCNRDxZˆB\\ICIHK@KŽHbIVFZ@BPnGTGbDXRDJaZKRiGEFSFEJhjFNZFjn"],encodeOffsets:[[119314,41552]]}},{type:"Feature",id:"110111",properties:{name:"房山区",cp:[115.8453,39.7163],childNum:1},geometry:{type:"Polygon",coordinates:["@@h@bl@HRJDZ``TA\\VVD^H`\\pF\\JŒ`JGv@ZO\\GPSTEjPTR`FnEbDTDHEhLFMTK@ETSPULKEI@OVISKSJACEQNQbV˜IXGDIN@dMB[IIBcN]ZHNLP@XOWCFWŠCNRHTpATD@^NVNLED@Rh@jCEF}E[OOHUEW]W@QGGDIQSH_MmFmCUT_K]i@MHCMW—FCF‹E{BMHMPOHKS]CFNGBELDH_@BcAKOACESAOBELaXAROB@FODMEDWJAG[aE@UM@DImEWJMC@OeCA{aE[@{L@MINUCQXKfUJORCHqJBF@TCXWNQX]M[EAJO@@KMBQJIC]EWMCCUBEBFHKDOTMBGNGF]MWDBRDdMDQVyE@LPVHDCP@JVVMTG~HNSH[CmRUvHPHBbA\\PTNRC\\YNJ€PRARPJDDR"],encodeOffsets:[[118343,40770]]}},{type:"Feature",id:"110229",properties:{name:"延庆县",cp:[116.1543,40.5286],childNum:1},geometry:{type:"Polygon",coordinates:["@@^AXOPEB[ZIGU@KKI@YGE@OYMGWFGvCNO@OPGTBHUTA\\ITACIGMIHmCOeDGGWSUIGimYEEMgiFITEFEjHLQbYCIWQaCSHmHAOY@UEaJG@LGLDJ[J‡AwYQCDMNONGY_EWLsSQFkMO[NWAIGaIYL@HMBOKiOQDWEUDMQSF_QIUBWdg@[NaAKQ@M]OQ@WhgLUMMFYQDIRCEUZOOCIOJ[KIUMKL@HIDKVEBM`HJAJSJUdBLGNEdMBMO[BYEWJSNKNaD]PE\\SjOT_RQVEZPpƒNQXfŠNA~lNG`@PNLp¼RFLfbdKbATUh@FSNWjGFZVLFHVA~X¨PPROfFJbNJPLFbENJPrEFNPFRHDDJdENJLVEPBJTVTHGHFRFH@PXP\\ORQHW\\BjWFDERLPPBbB\\E`B\\D\\L`@F]FCnJ^AZL"],encodeOffsets:[[119262,41751]]}},{type:"Feature",id:"110109",properties:{name:"门头沟区",cp:[115.8,39.9957],childNum:1},geometry:{type:"Polygon",coordinates:["@@V@XMnGPY²‰JQNEhH\\AZMPDVTTDZCPiJkHSHCjIdFtEHITCNITQEKUAMCEIKCECABYESKFWAKBEIIHABGDCKCAIHMHALKEI\\CFIBILIJQZS]BBEECS@E@@C]COKI@CABAAEEDMGƒCH]A[M@CJWH—JaUMRFRBDTITLUJ@PFJKLOVST@FSLENgKGFSCaCmF_ESQiOSFOT[HYPu@IH‹_[IoE_[]GUC[USB__CYQI@Gakg@qZeHQNMNV\\FVLPgJAFJPRLCH[XcPELUT[JiV_EELFTADBXRTRLJC@fHXHHbPd`fR@NfT`@TLplHMpCEJHJBVLFŽ@JT‚VnG^KXDXHNVGRLRXFJVdDHSNWLGfEzA"],encodeOffsets:[[118635,41113]]}},{type:"Feature",id:"110114",properties:{name:"昌平区",cp:[116.1777,40.2134],childNum:1},geometry:{type:"Polygon",coordinates:["@@VNLJI\\JPPDYPFVQDCJZRNEVNhKXgR@^P@NLRbB\\Mh@XcVARJE`RTCNFV€XRCjPPLNA@GZKbJJHXB\\MNPjLdGbWnK\\]NGHSFEXATIdCJGPARUWUHCPWRELITAHKv_E@iYCaW_BQ\\Y@QIO@QDCIGZCEMWGFMFAFgHEDOCSqKCCFGAMKEAC@ODGCGs@WH@KQA@EE@CE@GEA@EH@GGUEEJEAYD@JM@@DAA@FHD@FTJEHUC@JUBKCKG@G[CIIQReAYhO@OXGDO@@FF@IHJFCPEBACBIAAKDOABXARHPNEHGbQAAKQFGIAM[C@WHKaGiCEGOA‹HUKCIokSCUSOCYN[BgGMFIR±ŠOZmHWNU@ShbbXDHVXXGJ^lZ@PZ\\Nb@\\FHJAD"],encodeOffsets:[[118750,41232]]}},{type:"Feature",id:"110115",properties:{name:"大兴区",cp:[116.4716,39.6352],childNum:1},geometry:{type:"Polygon",coordinates:["@@F\\E~DFN@BDFEpHFCHBBEGCDCJBHUDSBB@ELCPbF@B\\J@BJVAFJ\\ADKTCBGECFMT@BMN@@FH@DaNBEnvB@FPBATK@FHEFIAKFBFL@@PKBFJHC@FXBRAFCDMPDTOL@JIVFDHH@DDH@BGRFCDLD@N^@@CNA@KNOAEBCECFEGCFGMGFIPMOEJOLBADBBHGG@GCHIECY@INC@DMGS\\AIOZAAEYA@GT@KKMBEETCGMVINFxA@MJADB@FlA@HJA@NND@DFA@DVAZBBOFKH_JA@K^GBC@EFE„G@gAENMXKJigC@IbSJMqGOP£RGSMGE@kbQFDPEFiBSGGSBK]I{CDWCIDOic[C_G@SuSO@EWKCO@MNY@\\uZOPENQD[LKESSKGBKEG@EJGAGHoH¥CqhifeJkX_XFFGHFNEDFPENKHM^IFIVL^S`DVEnNnG`RTCJHH@R^XFXGVPP"],encodeOffsets:[[119042,40704]]}},{type:"Feature",id:"110113",properties:{name:"顺义区",cp:[116.7242,40.1619],childNum:1},geometry:{type:"Polygon",coordinates:["@@EhEBENXHFNYDJHCD@RJP@R[ZARX`DbjZF@bHXT`Jb@dIFMTGDSfAJVbGnJVM@OKELYPERVXRflXTT@NIfC\\NJRhCVEHFJXNT^DTeZEHYCOhuAMJELOdAVPTMOWBWNMNEJgl]@WGUFIC[T{EEDEHGCIGMI@SECUQI[D{A{GQESPUH]CsiMCmHUeoHENcAaDGCMDGMQCACCBaCGLMAHB@DIEQLOAAEEJ@CW@CDINGAAGKQOCgV@LG@BEGDKNeREFBNCFIDOPKD[@YRW@GFWDAFE@EHDDrLDTCPGF","@@KrJEH[\\B@FF@CHFBHUN‹AJKADGECBCMAG^E@EbI@BEGP"],encodeOffsets:[[119283,41084],[119377,41046]]}},{type:"Feature",id:"110117",properties:{name:"平谷区",cp:[117.1706,40.2052],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZJZRafFLjn€VGNJ@LLBdXX\\T^EDMJ@”nZKLBjPPJ@HbA\\H`DbERHLCFK^BZaFWXQLAGMHa\\OLO@SBIpBdCLƒVQfElO@GSAKEDQTC@GEBKG@ORIJBDAPDFA@CaOq@GGQAAEJK@KMUGAAGEAa@MGMBGCGSIIW@WSUCMDOJeWOM@IUF{WMWaDIMgIoRoCOKeEOEAG_I[cg@wLIFENQFDVTFJ@HNDJGHCFFFS|D\\EJHV@Xk^IhMFMNAXPX"],encodeOffsets:[[119748,41190]]}},{type:"Feature",id:"110112",properties:{name:"通州区",cp:[116.7297,39.8131],childNum:1},geometry:{type:"Polygon",coordinates:["@@FDAJTGDNDCTDDEDBBE@DT@@EHCDGJ@EIZ@@FDBR@ATFBBVFFE@@HNA\\VE@CLIFNJFNJBCP]A@LJFA@HJEDD\\C@DBCHLAEPF@@DH@APHAERDF\\GIxDTM@CFLBBFJ@CNUPMHECGDBF]BMFPDLRBHHBJMDCX@@DFIBFPBRKJF@CGANBHKbDDABDRDHNNCHDbCdBFMpGHiOYMefKJMC}HWAUNW\\NNBNA„kNU|]HMTMN@MZBLFFF@RIRUT‘BMFIEGaAGGAOIIUGTSFcYKS@MSLYPKRUBU]EWDOI]CKGASgW@MTWKIMCS@uMAKKADMECGAKVUTSDy@IjWLMNBF@hƒHEF@FAD]H@LIBG`ELAPYAUB@CEB@CMC@MIB@GkB@ECAIB@NwBMEUJHNSDFFNALLS@@HZBBFYBJP[BHTCND@JMZ@FDGJHDH@GHAABCKAIPPFONEJNHEHHDEFFDADBFMP@L"],encodeOffsets:[[119329,40782]]}},{type:"Feature",id:"110105",properties:{name:"朝阳区",cp:[116.4977,39.949],childNum:2},geometry:{type:"MultiPolygon",coordinates:[["@@bFGHBHFBFIVFHHG@@FFB@HDFF@@FRB@LXGt@DHCH@PBDLFBNF@BEXCHEX@ZQ\\@LCPOJCDEAMFEfQLMHCAFH@@KhUNE^AAEHCFDNGVODMI@AEKADEN@CSJw[HCEFQGBBOG@@CE@FOKBDGCAD@C[FCGIB@IE@K^BDOIAEMMIJEDKF@[UMB@GF@EEAUEABSQ@CA@EY@FJI@CHGD@FS@@CAFCACFSCCDCMSHBIECMB@D]@@MKCDCQEAHG@CCG@CGUEIJK@SPOCCNEDQBDNDB@DJCDLFCBBALJB@BVGPBKVO@KHCCCD@FE@BNA@FNCTDDJA@FGB@NBDW@CL@hT@@ZHHQDDDAFSAANBC@HG@EFS@@DE@@PCB@Ue@CADNJB@FCBWA@LI^ix@FIHrH"],["@@HUN‹AJKADGECBCMAG^E@EbI@BEGPKrJEH[\\B@FF@CHFB"]],encodeOffsets:[[[119169,40992]],[[119398,41063]]]}},{type:"Feature",id:"110108",properties:{name:"海淀区",cp:[116.2202,40.0239],childNum:1},geometry:{type:"Polygon",coordinates:["@@plDJVLŒGPBFHjDbHGL@X\\DBNHJREBLRBHaFGŽMGOBQAWPBLCBBAJBDFADOIEJGE@@EP@HCPWP@ZgfBRQJJ\\D@HLHLDVA@IVDFGSI@EGC@EBB@CN@@IZCAGHGaEqGJG@EjwJ]@K@GSA@e_I@NE@CA@Kg@KC@ENCFƒAKQAW@WIMK@V‹@I@@F@^EDFB@HcIaDYCBRRDCHD@EFLN@FE@CJUPEJOJMTBPEDIFCMIAKNOGMRFJNDVBFLSRMJSDGJsFcEiJGDGTIlOjYD"],encodeOffsets:[[118834,41050]]}},{type:"Feature",id:"110106",properties:{name:"丰台区",cp:[116.2683,39.8309],childNum:1},geometry:{type:"Polygon",coordinates:["@@hMN@NFTQCFRCBJFA@HJ@@HJ@HJ\\FTACDŒ@@UNLXJX@@MA@@IECAQlDFEHBDI~D@GXCFMVDFCH@@NF@ANJC@FnAB@AMF@@EDCDDLGP@LUOAUH@AIABKAAEDCKID@CCACMWA@EGDEILA@OK@AELEJBFEEGL@BSOA@EuAFmMACbG@@EM@ANS@ENFDAHSDCL[BEIUBAII@A[E@OaKD@FAACTGVIACDHDAFGAEDoGEFACM@i€g@@QFCMKMU@]SCoBGSMQ‰DEXXDWPO@MKYGM^AdJJA\\cNB\\G^„DNHFCBFABDBJ@PL^D@DF@T@FDAF^A"],encodeOffsets:[[118958,40846]]}},{type:"Feature",id:"110107",properties:{name:"石景山区",cp:[116.1887,39.9346],childNum:1},geometry:{type:"Polygon",coordinates:["@@NQPHLMJBDNJEFCAONSPIFIVODIF@@EKMFEC@DGQCAQZDbCdJ@GEAFC@]@EJ@DCSB[EGII@@GI@@GEBAIQDDESRMEM@gNYTIRKJAJEJ[DFJKLGBGNBJLDCDAHGBJJAFBLEXTLZFBAFDLD"],encodeOffsets:[[118940,40953]]}},{type:"Feature",id:"110102",properties:{name:"西城区",cp:[116.3631,39.9353],childNum:1},geometry:{type:"Polygon",coordinates:["@@XBDA@EIACM@IJAD]BC@SFABISAD]H@@OAEDQEW@BLE„MD@FLDh@@LDBF@@M`J@fTB@H"],encodeOffsets:[[119175,40932]]}},{type:"Feature",id:"110101",properties:{name:"东城区",cp:[116.418,39.9367],childNum:1},geometry:{type:"Polygon",coordinates:["@@DBf@@VDA@OF@@CT@FEH@@GADBMTBBECCRCGG@YS@@gDK@A‘C@PG@C^TBAJEB@TADC^IB@J"],encodeOffsets:[[119182,40921]]}},{type:"Feature",id:"110104",properties:{name:"宣武区",cp:[116.3603,39.8852],childNum:1},geometry:{type:"Polygon",coordinates:["@@RBX@RFFCŽBFU@aK@WA}CCJGAEFkCBRFD@JB@@N"],encodeOffsets:[[119118,40855]]}},{type:"Feature",id:"110103",properties:{name:"崇文区",cp:[116.4166,39.8811],childNum:1},geometry:{type:"Polygon",coordinates:["@@XBL@@bEV’D@BX@AC@MHA@EIBCCDSEMmB@EIDBME@@MG@EDUCENWD@H"],encodeOffsets:[[119175,40829]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/china_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"xin_jiang",properties:{name:"新疆",cp:[84.9023,41.748],childNum:18},geometry:{type:"Polygon",coordinates:["@@@›ρȁôƧƦóəʵסʵóƪԫʵѵͩƧͩړ›υࡓɛʵ@ȃ@óᇑѵƨɝɚôóНѺͩɜ̏ԭʵôƧɞñ@υƩ—݇ȂóƩƧ@ѵȂυœƥŌਗ—॥ɛóʵѵƧѹ˜݇̍ࢯ˜əɞυ˜ρͩ̏óਙƨƧŋôōóš̍ͩóʵן›óŋړͪƧѶ@ɜԭ—ԫƦɛȄ̍›ɝȄöςƩȂ̏œñȀ̏œƩóóŎə˜@Ő̎@ɞȀɝŎôƨóנѵȄƧ@óŏɝœóɜôŎ̍ͨςŎ@ƨóôƨɞ݈ʶóƨφó̎Ȁƨ̍ԮòѸԮמ@ѺȀ@ƪၬֆòȂñ̐òȂɜ˜óƨ̒Ŏ̑߼@φρȀ@Ő๐ς̎Ƨφ@ɝφڔ೦Ԯǿࢰ@ƦŏԮƨƨȄƧ۬ɜʶڔŐɚɚóŐôƨ߼˜ôƧƧó̐ƥóŏѺǿƦȁφƧς˜ƨƧ̒@ɜƥƦυ̐ɛƪͩƩəƪʷ̑ə@ȃƨʵנŋྸōਚԭԪ—@ɝƨŋ̒օςʵôƧ"],encodeOffsets:[[98730,43786]]}},{type:"Feature",id:"xi_zang",properties:{name:"西藏",cp:[88.7695,31.6846],childNum:7},geometry:{type:"Polygon",coordinates:["@@ôŌנœôʶ̎ͪô™óŎƨŌਚƧ̐ôςͪφ—ɚɝࢰ—݈̎Ѻ—Ѷƨôʶ०ɜਘ˜Ʀŋφ›Ѷȁ̍—ôŏɚŋ@̑ə—@ŏò̍ɜ›óƥôʷƧ̍φѹԪ̍ע@Ѹʷɜ@ôñנ@Ѷɛɞô̐ŏѶƨѸƧƥōƦœôŏô—@ƧôƩ̒ŋƨŌƦǿô̎ɜȁ̒—óʶѶôôО̒›ςƥɜНφσɛȁ̎υƨఱƧŏ@ʵƥœ@ŌóóóͩƨƧóŋ̑õóɞóɝԩͪɝρôƧ̍ƧѹͨڑŎ̑ōóƧࢭͩ̏ѵɝóఱóóԪυô@̒ƥŌ̏Ƨ̑Ȅ݇ŎƧ›ѵӏ@ɛõŏɛȄôӒƧŌѵǿɝ˜Ƨŋԫ@̏ʴƥ@óǿ̑Ȁóǿ̍ςóóυô@ʶɛñρƦƩŐó̎óœѵó̑ͪࢯОóɜן˜Ƨ̏ƥȄ߻̎̏̐ןŎɝɜöɞƩȀôöɛȀóͪ̐ƨƪ̍̎ȂƥԪυО@φɞ˜ôƪ"],encodeOffsets:[[80911,35146]]}},{type:"Feature",id:"nei_meng_gu",properties:{name:"内蒙古",cp:[117.5977,44.3408],childNum:12},geometry:{type:"Polygon",coordinates:["@@ኊȁ૊ö߼ƩɜɛנñԮɛѶóԮô@ȁѸóמ̎ගѺၬ@߼ʶԮӒ߼̎@ŐѹӒ̒Ԫƨöග̑ѶȄ̒ς।œѶɚöɞɜʴڔôôȂ̎—ѺȀς—ƨ˜ƪóԪ—ɜôɛОਕڔԭ˜ѵ̍ѹȂԫ›ɛƥ̍Ȃóɜ̎ô@ʶ݊ੲࢮʵږͪנƨôȂƧ˜̐ͪ@ŐƦƨφԬѶɜôƦ@ŐƧôôƦəŐ̏›@ŐڒѶԬô̐ʳԩНςōôŏɞ@ƨȂѶəóƧ̒ػ̎ó̐Őנóƨô̒@ƨɚɚ@עԫɛɛ@ȁυͩƥʳòևρ—̑ࡗƧͪ༃ॣԮփ̎Ʀ@ôô@ôō@š@ȁѵóƨ̍υȃóʵɛƨƥóυȂóəƪ›̐ρƧͩɜԭڔȄ̎عƧȁ̐ŏó̍ɛ›ƥƧ̑óρŐ@Ƨ̏˜ɝəɛ˜߻ͩ̍ͩɝО̍ƪƧóóӓƨóƧʳ݇@ɝςƪœ@ʴƩ—ƧƦôƨɛȄə›Ƨŋυ›óͩѵ@ɝǿóŌן̍ɛ˜óО̍œ̑̏ôȁ̍ŏòȁñóƦͩ@ǿə@ɛƧ̑˜ρȁυô̍օѹœóȃə™@ȂσʵѷƪòƩ̍—ôó߻ۯôʳƧ™óšõʵѵóѹɜ̍ȂѹôɛŌφֈƩͨρóυӑóޟఱ̑݇ͪóƪƨŌóȄڔԬƩςםñ̑ȃѵŐԭŏƨȁɛǿρôõɚɛóƧОə@ѹ̐ѵöԪͨôͪɛ̒ןŏƧƥóôƥƧɛŌôóɝó@̒݇Ӓ̒Ō@Ŏԭࢰ"],encodeOffsets:[[99540,43830]]}},{type:"Feature",id:"qing_hai",properties:{name:"青海",cp:[96.2402,35.4199],childNum:8},geometry:{type:"Polygon",coordinates:["@@ƨ@ôƪ݈ȁƪ˜@φɝòóƨԮʶɛ̐ѹͪôОəóƧɞᇒѶ@ôږô@ǿѶ›ƪȁςœɜͩφ˜ςŋɞôѶɛƨŌɞ—@ɚςŐñԪॢͩƨȂɞóƨŐ̎ŏעӏ̎óƧƦôœ̒ȁɜ›ςͩ̒œɚɛƨôƨɝφɛóȁƨŋóóɚͩƨóóƩ@ƧəŋƦƩ̍@ƧƧôǿυ̑@ȁɞǿõŏρƥסɚƧóτԫɞœôƧƦ@ñȃòñƥóυôôѹѵ—@ŏ̏Ȅɝó@ȂəŌóəѹƦ@Ő̍Ōυ݈ԩŐƧóôƧ̑›ôʵɞƧ̑ѵôƩɞƧ̑œóНѵóôʵ̑˜ɛȂó̍ƥȀƧŋ̑Ōóƪ@ƨó˜óŐƥ›ƦŎѷƨѵƧ̏Őɝóѵɜן@óòɛ@ѷʸס@ԩ̎υѺƨ̎óʸôƦɛœñ̎@Őɚ˜@̒əŌóŐ̎˜"],encodeOffsets:[[91890,36945]]}},{type:"Feature",id:"si_chuan",properties:{name:"四川",cp:[102.9199,30.1904],childNum:21},geometry:{type:"Polygon",coordinates:["@@ô˜ôŋó̑Ԯ̒ɛОמͪƨōöͫ߼ƥôȃƨóóñôƧóƧôōڔŏƨŐ@Ŏô˜òƥѺŎ@ōɜóנ˜ôǿô›ƦôԮ̍ɜôɚ›Ƨ—ñɛɚȁ̍Ƨɛևυ@óóôŋρԭɝ@Ƨʸ̍ŏυɜƧƧóƧƨȁρ̍ƨȃɚ—ôʵφóô̑̏Ȃ̑ʵɜʵɞ@ƨʳסƩóŎə—óɜƧôƩƧρ˜óôôô@ŎƧƨƨƪѹ˜ó̍̍Ʃ@̏ѹНôޟ̍Ʃóƪυɝɛ—əƨôŎɛȀ@Ȃ@ñɝʶ@Ōρנ̏—õóɛͨƨȂѵОɛʵ@̏ƩŐó߼Ƨల̍φɜȂυτɛОρƦɝƨóƪ̒Ѷɝƨóʶ̒œóƨƨôԪŏφ݇̎ŋ@ŏѺƥôɚɚŋ@ȁɞô̐ȃ@ŐѶ˜óѺφóƦôñòòȄ"],encodeOffsets:[[104220,34336]]}},{type:"Feature",id:"hei_long_jiang",properties:{name:"黑龙江",cp:[128.1445,48.5156],childNum:13},geometry:{type:"Polygon",coordinates:["@@ᇔȂਚНƨŐѶŏöƥςŏñƧƦóƨȁ@óƨ—óȁφӑóóƨ˜óǿ̎̑ôНɞ—ó̑ɜə߼›̎ǿ̒ôڒӑφ@Ƨȁ̎̏ƥƩ̎ρశ˜ôȂςƨφ@נɞ݈˜̑ƥƧɛƨʵƧȃƥ@Ƨƥ@ŏ̑ԩôɝρρóɛƧ›ƩͩƧó߻ʸ̍ʷѹƥɞڕõ̍öɝυ—̍ȂƧ̐̑ŏóƨñŋѹóóȁ̍›̏Ԭõʸ̏ŏ@ǿ̍@ƧОυ@ñƨòȀƥŎ̑ŐѵóɛŌóȂԫōƧŎѹñ̍ʶóОן@Ƨ̎Ѷô@Ȃ@™óŎó@@ó̍ƥԭք༄।ƨͩ̒ࡘς˜ñֈƦʴφͪ@ȂɜɜסԬə@Ƨə̑@Ƨóןô̏ŏ̍ô̑ؼôƨѵɚƧȁɝ@óŐρŎԪО̏ʴ"],encodeOffsets:[[124380,54630]]}},{type:"Feature",id:"gan_su",properties:{name:"甘肃",cp:[95.7129,40.166],childNum:14},geometry:{type:"Polygon",coordinates:["@@ڔôԮࢯ@ō̑ŋ݈ӑ@̑ɞôóôɜŋƦƨôóƨƦנŐɜ̑óͩԩͧѶõѺ̏ɚ@ƨНɜôöəςóɜȀƧȂԮŐѶŏ̒ȄמòƪρړԫôȃƧŋôƩ݈ͩɚ@@ǿɜ@φͩóŏɜӑƧōôǿ̎›ôƥƪóõ›ö@ô—ƨ˜ôƧƦôó̒ɜ@ɞŌõʶ̏Ő@ȀóôƨȂ@ʶע@@ƥ୾ӑó̑óŋôʵóɛړ@@ƩöóƩóρ—ɛƨ̑@óʷƥƥ̎ɛƧ›ôōƧǿôͩѵôɝȃɞȁõƧρóó—@ōƧŏړŐóŎôƨóƨôòƧôóȄ߻ƦõͬƧŎםͩɜНԭ̑ô̒óŌó—ƥ@óƨɝ›σԬƨôעəςƦöŐɝȀ@Ȃφ̒óȀƨƨ̎@ƥƪɚŌ@ƨôƪƧôəͪôôƧŌôȂυɜƧɞƧóəɜ̑›ρͪɛœ̑Ȃó›ƨƥ̍ôסӐ̍ŐƧŏɝôƧȁॡͪòԩρŏ@əɝ˜ƧŋѵɜɝóρŌυ—ɛͪρ›ƩȂѵœ@Ȁڕó@ȄɜʶφࡔڔœƨͪѶͪԬʶôƩעʶɚʶƥôóƨςȂ"],encodeOffsets:[[98730,43740]]}},{type:"Feature",id:"yun_nan",properties:{name:"云南",cp:[101.8652,25.1807],childNum:16},geometry:{type:"Polygon",coordinates:["@@ôɞôɝ̒öôŌƧƨôͪôô@ŋƦ›@ʶƨŐô߻ƪŏ@̐ɜʶѶНƧȁɜͧöô̐˜ςן@ŋɞʵ@ò@ȁɜǿóōɚƧɜ˜φɞôƩ̎ƪóޠѺО@̐̎ƪô̎Ѻ—ƧƩƨƧ@ōóóôóς—ƪƨƨóôɛó̑ԭ—ƥŌɛǿɝƨɛͩô›@ǿƨȁѺŌɚɛ̍ןѶНɛƧôóƥȁƦͩôŎɞ—ƨ̑ɜ—òôφ@ƨʵ@ɛѹōóȃəƨυǿóʵρƧƧŌƩɛ̏ȄñƧƧȀɝ̍ԩʶƧ̑υ—óŌƥʳɚӑóНƥô̑›óӒѵʵѹœƧӐןôƪφõŌƪ̒ԫŌƧؼƨƨס›ρȁƧœƨȂóʶó@@ʴƨôôφ̎Ŏ@Ȁƨ—ƪɚƨœóƨôôôςóޤƧŌƩŋƧԪ"],encodeOffsets:[[100530,28800]]}},{type:"Feature",id:"guang_xi",properties:{name:"广西",cp:[108.2813,23.6426],childNum:14},geometry:{type:"Polygon",coordinates:["@@ƦŋѺ̎ڔʵƨŐ@ƦמȄƪôóȂɜŌɚͩɜ@öóɜôôȂƦôɜȁ@ɞφ›óȄ̎›ƨʶɞŋƨʴɚǿ̐̎Ԭ@ôñ@̏ƨ›ρ۫ô›ɚƨƨНƪŐ̎›ƥóƦʵƥŋ@ȃóƥƧ@@ŏɝǿôυƧȁѵɛ@əóŏ̑@@ə̍›óƧó—@ȁƩ˜ρóòНƥô@Ӓ̑@óŎ̍ƥσŎυ@̍ƨ@Ō̑ôóͪƨ̒óŌړœ̏Ŏ@ŌôȄѺŎ@ɜƧʶυ@ñóɛ˜Ƨ̒ɝ˜óōƥͪ"],encodeOffsets:[[107011,25335]]}},{type:"Feature",id:"hu_nan",properties:{name:"湖南",cp:[111.5332,27.3779],childNum:14},geometry:{type:"Polygon",coordinates:["@@@քɜОƨ@öŐמóƪôƩɚ̒Ő߼ȁςͩɜòƪ—ɜȀò—ñɝò—Ѻͪ@ŏƨŋóɝôǿƨ™ɚȃóəƨȃѵͩó̍@ȃƨóóƥƨƧ@ʵƦ›óͩɜ—ɛóñԭɛōυȂ̍ƧƦō@ɛƥ—ɛȀ̑œóʷóō̍œƩŏƧОəƧóœς۬Ƨœ@̐óòԫ@̏̍əȀƧʳɝŌóɞƧ˜ƨɜóŐƨò@ȄƧŌρŋóôԪОóʶ@̎óȄ"],encodeOffsets:[[111870,29161]]}},{type:"Feature",id:"shan_xi_1",properties:{name:"陕西",cp:[109.5996,35.6396],childNum:10},geometry:{type:"Polygon",coordinates:["@@ςôöƨɝȂɞȄѶóóͪƨȀóŎƨœ̍ɜƦƦôʸ̒@ɜƧς˜ƪôõô@ƪڔ@ôɜóʶôŌô̒୽Ӓ@Ʀ@Ѻ̎ɜѺɛѶôöʶô™ƨšóʴ߼۰óô̎˜ñƪѸƩτʶ@ȁòŋəѹóǿ̑ʵ@ȁ̒ʷυփô݉ôН̏ط@ȁƨóô̏ƪõ@ʳ̐ʵ@ɝɛŋƩŌɛóןôƧŋ̒ó@ŏ̐ƥ@ŏυ@ƧƧôן̏@ƥȂѹɜəœɛóԭ̎ƥóóœóȀן—ɛô@ŎѹōñƦ"],encodeOffsets:[[108001,33705]]}},{type:"Feature",id:"guang_dong",properties:{name:"广东",cp:[113.4668,22.8076],childNum:21},geometry:{type:"Polygon",coordinates:["@@@Ȃô˜ôƨ̎œ@ɚ̒@ôŐ@ɚѶɜƨȂóφɞȀ@Őƨ@ôƦ@ȄƦŌƥʶƦôôŎôʸ̒›ɜǿƦ˜@ɜƥŎ̎ƨφȁɜŎòƥԮŎƨōóŏɛƧɝəɞƧ߼ɜςȃñȄƦŎ̒ōôòƨəƨ˜ɚН@əƨ̏ƪʵυŌəɛóəԭŏəœóŏѹœρʵɝƦ̏™ƥʳѶ›öō̑óóŋρȀυƧƥɛѹōƧôן—ɛŏѵ@óŋôʵɝ›ƪԩõ@Ƨō̍@Ƨ@@ƦɝԮƪО@@","@@X¯aWĀ„@l"],encodeOffsets:[[112411,21916],[116325,22697]]}},{type:"Feature",id:"ji_lin",properties:{name:"吉林",cp:[126.4746,43.5938],childNum:9},geometry:{type:"Polygon",coordinates:["@@נ@ôН̎ʵѺòƨōԬŎôȁɜŋѶô̒ŏƦōñǿòƧφ@ƨН̎@@Ȁ̐Őöʷ̐ԫ̎œôȂѺôòŌôƧ̒Őƨ̏̎ȁφ˜@ŋƩͩםȃƨ—@ȁ̑ʶ@Ōóôɛœƥѹ̑—συ݇@ɜρƧȃࢯƨôœəȂɛōƩɛ̏υρóõœƪʴυφ@ʶôŌóœρք@ɜƧ@ɝǿƧͪρȀƩó̏ŐƨȂ̍غړȃɛԮƨͪ̏ςƩœôɚφȁƦôɜƧôʶφȄ"],encodeOffsets:[[126181,47341]]}},{type:"Feature",id:"he_bei",properties:{name:"河北",cp:[115.4004,37.9688],childNum:11},geometry:{type:"MultiPolygon",coordinates:[["@@Ʃ̒̏ŌѺ̒Ʃ˜óȄƧŌƥͪòôñȂ̎ŐóȂ̒̐̎›ôНɜ—נ̎ôŋɞȀѶ@ôͪφœƨŌɚœɜȃóƧƨƥƪ˜@ʳƩ›ɞρ݈@υНφʵɜ˜ƦρƨƧ̍ɝóɛѹ̍ρŏ̑ôóƨ@œƧƦôƨɛ@ƥƨ@ȂƦ@@ôəŐƧʶƨŌυœ̍̎ɛŋôōɝ@óƧ̍›ƦʵѵʳôʵɜŏςôƪŋƨŌɚ@ôНƥƧ@ōѸɛ̐ô̎ʵѵНԭ@̍̍Ƨò@ȁɝ@əρυͩƪ̏ƩõƧŎƧōóšॡȄɛʶɜȀ@ɞςѶƧœƥςɛŐ@ɚɜɜ@Ŏôôςœƪς"],["@@õə@Ƨɛ˜@ŐóƦφô"]],encodeOffsets:[[[117271,40455]],[[120061,41040]]]}},{type:"Feature",id:"hu_bei",properties:{name:"湖北",cp:[112.2363,31.1572],childNum:17},geometry:{type:"Polygon",coordinates:["@@ñȄυƦöŐƩ˜óנƨƨφ@@Ő̏Ʀ@Ő̑ôƨŌנóɜôƪŋɜŌѶօڔə݈òɞōɜŎôӏƦóƨô̒óôȃƨó̎ŐôƧƪ@ƨȁςƧə̑̎Н@̍Ƨŏρôԭͩԫ—̍ʵƧšóȀôɞƧŌ@Őѹͩñ˜òɞñ˜ɛǿƩ˜ɛñρͪ߻Ȃ̑ŏƪəƩóםôõŏƧ@ɛНƥȄó›̑ѺƧ›ôφóƨƨƦƪóɜŐôóòôƨóφ̐ƨóƦ̎"],encodeOffsets:[[112860,31905]]}},{type:"Feature",id:"gui_zhou",properties:{name:"贵州",cp:[106.6113,26.9385],childNum:9},geometry:{type:"Polygon",coordinates:["@@ɜȀƦŋԮ˜ô̒ɚ˜ôōעƪƧʴɝ@ɛʶ̒ʶ̐ȁƦœóȂô@ôŏ@ōô—ƨʶѸô@ʶƨ˜ɞó@ōτöòυƨ@@əƨô@ɛ̒@Ʀɜôȃ@̍ôʵԩНôóςŌƨŋ@ȃƧñôŏƧɛƨ—ôɝƧʵ̍œôȃυœ@ɝɛȂƥóóȁɛóõôɛ@əͪɛŋôȁƩóםȃ@ƥƧŏړʶѹ̍ƥŌƦȂóôɜƨѵО̎נəɜѹŋƧȂ@ȀóœɜͪɞƧ"],encodeOffsets:[[106651,27901]]}},{type:"Feature",id:"shan_dong",properties:{name:"山东",cp:[118.7402,36.4307],childNum:17},geometry:{type:"Polygon",coordinates:["@@Ʃ̐φͪɚςɞ@@Ȃƨñ̎̎Ԯ@ѶОƨƧڔ@φН̑ŋ@Ʃ̒ǿ̎@ƨɜԬςôʶ̐ʶöԫƨƧנƥɜŎôō̎@ôŏóρƧŏԫôóƧԩó@ƥɜƧԭóƨʵɛƨ߻ӑɜНԩ˜óô̑óƧʳə™óɛƧ@õȀƧœ̍ȃɛŐóŏυО̍—óɝƩ—ԩ@ƧɚԫȄɚʶƨ˜ɞʶԪ̐ړɛƪ̒"],encodeOffsets:[[118261,37036]]}},{type:"Feature",id:"jiang_xi",properties:{name:"江西",cp:[116.0156,27.29],childNum:11},geometry:{type:"Polygon",coordinates:["@@ƧȄôɚəȄ̎ʶԬ˜ԮͪςóƨŐƪ›τɞƦōƥƧ@ŏςôóŐôô̒ʷѶ—ƪƩƩǿ@ō̒ɛôυ@—Ƨȁѹɛəƨѹ̑ƨ̏óƥѵʷô̍ɛȁôŏɝǿƧԫƧ›ôʳƥōòȃρȄ߻ɛɝƨɞɚɜƨôŐƧŎԭōñƦòԮɜôɛ˜ôͪƥœ@ʶƧƨôƦƧô@Ȅô̎Ѷͪ"],encodeOffsets:[[117e3,29025]]}},{type:"Feature",id:"he_nan",properties:{name:"河南",cp:[113.4668,33.8818],childNum:17},geometry:{type:"Polygon",coordinates:["@@φ˜̎ƪ̐˜ɞȄɚ@@Ȃעó̎ŌѺ̒ôֆॢȃô™ƨŎƨōƪöƩ̑ڔɜԩ̏ɝʵƧ—əʵԬȃƨəԪ@@Ƨ̒ŏô̍υȁƧɚ̍ôóŋ@ɝƧŋõ̑σ—@ŏɜŋôɝ̒ƧɚôôطρóóɛƩ@óƨ̍ŏƧôóȄ̑ôƧóƥôóӐɛōɝŎ݇ñړɚѵֆ@ɞ̏ʶ@ʴƩöó̐"],encodeOffsets:[[113040,35416]]}},{type:"Feature",id:"liao_ning",properties:{name:"辽宁",cp:[122.3438,41.0889],childNum:14},geometry:{type:"Polygon",coordinates:["@@ƨʴƧôôӔƨô̎ƩɞН̎ͪ߼ͪɜ—ɞɚ̐—@ƨςŏ̒ôƦƨɜœô̎ƪôςǿƨͩɞȀƨ@@ɛςփô›óŋ@ʵφυƩʳö›॥փρѹס@əɛ@ͩࢯ@ѹʵρ—ƩʶφȀƧ݈̒۬óʸɝŎѵ@ԭԫןɛƧƨƥςɛ—υʶφО"],encodeOffsets:[[122131,42301]]}},{type:"Feature",id:"shan_xi_2",properties:{name:"山西",cp:[112.4121,37.6611],childNum:11},geometry:{type:"Polygon",coordinates:["@@ɚѺñŌɚšôȄѺ›̎ֆφóςȂ̒—ɜƨɚ@@Ȁƨŋôȃƪ—ѹ̑̐ŋƪ̑Ʃρρ›óó@ōɛɛ@əɜŏƦρƨ›ρѵ@ɝɛǿɜʵóօѹ̑̍ŋסô@ȁə@ɝȃ̏—̍Ʃυ—Ƨô@Ȃ̐ظóОó݊φք̑ʸ@Ȃ̒ʶôȀ"],encodeOffsets:[[113581,39645]]}},{type:"Feature",id:"an_hui",properties:{name:"安徽",cp:[117.2461,32.0361],childNum:17},geometry:{type:"Polygon",coordinates:["@@ó̎̑Ő@ƨƪ˜Ѷǿɜ̑φ—Ʀʵ̐˜Ƨѵôóƪôôυς—ƨȂɞŏ@̍ԫôò̑ƥ—óȃѶͩƧƥôŏѺœôŏƦ—@›ƥͩƧ—ôȁυó@̑ƧɛѵʵƩƪѵ˜̑ʸóóôŏρó@ŐƦƨƥŎσɝƩœ@̎̍Оɚ̒ρƨƧȂôɜςôóظəó̑ƨóɞɛŌ@Őτ˜ö̒ƨŌ@ɞôŌ̎óƨəφȂ"],encodeOffsets:[[119431,34741]]}},{type:"Feature",id:"fu_jian",properties:{name:"福建",cp:[118.3008,25.9277],childNum:9},geometry:{type:"Polygon",coordinates:["@@̎›óȁƨӑ̒—̎ɚƨͩφŐƨɝ̎ŋóŏρ—@ōƨ›òʳəóƨō̏˜õɛƧ@ƨѵƧōəŏóŋƧô̑ɝɛʳƥ@@óɛõ@Ƨ̑ƧóȁəƧ̑—Ƨ̐@ɚəОƧ—Ƨɚóñ̑ŎóʴƨœƨԬɞȀóŐɜȂó̎ѶʸôƦƧ̐Ѻ̒ɚƧѺɜƨȂ"],encodeOffsets:[[121321,28981]]}},{type:"Feature",id:"zhe_jiang",properties:{name:"浙江",cp:[120.498,29.0918],childNum:11},geometry:{type:"Polygon",coordinates:["@@Ѷʶƨɜ@̒φôóȂƨ˜Ʀͪ@œ̐˜Ѹ̍τȂ̒̑נŐמôƪƧôӑ̑›@ƥρͩƨօ̏@@υɝó@ŋɛ@ôƩəóƧѵυó@ƩɜŋƧ@̍ŌƧɞυŏƧͪ̍ə̑˜ƧӒôȂ̍œ@˜óφ̑ɜ@ŎƪȀ"],encodeOffsets:[[121051,30105]]}},{type:"Feature",id:"jiang_su",properties:{name:"江苏",cp:[120.0586,32.915],childNum:13},geometry:{type:"Polygon",coordinates:["@@ôɞ̎˜φНôŐɜŏ̎Ȅƨ›öǿƨ@ôɜɚšƨʴ̒ôôó@Ƨ̎əԮȃԪૉöͩ̐ƧòʵφƧôʵ@óړɜóŏɜǿƧ›ɝρσȁѷ̎̏—ƥ˜óŐѹ›óŐƨƦѵͪôȄƦ˜ñ̒Ԭó@̎ɝŐƧȁρ˜óφƩóóôƨѶ̏—ƥʶυ˜ɛ̒ѵȀ"],encodeOffsets:[[119161,35460]]}},{type:"Feature",id:"chong_qing",properties:{name:"重庆",cp:[107.7539,30.1904],childNum:40},geometry:{type:"Polygon",coordinates:["@@əȂòɜƨ˜ѺɛƦȁ̐@ƪ—õŏφƥòȃƥ̍Ƨôυ̏ƧôñóóôɛŏƩôƧƥôƧóυƨœ̒ѹôœƦȃ@փƥɛ̑@@ɜƧó@ɚƧ@ñφσõ@ŎɝôƧ—@ʵѷóƧʵó˜@ŎóŐó@ôȁƥ›ó̒υôóʶə˜ƧȄς̎ƧȂôƨƨƨφɛ̎Őƨʷɞ@ςԮóŌôôφ@ɜֈ̎ƨ"],encodeOffsets:[[111150,32446]]}},{type:"Feature",id:"ning_xia",properties:{name:"宁夏",cp:[105.9961,37.3096],childNum:5},geometry:{type:"Polygon",coordinates:["@@ల̒ôޠφӒςôƪͧυևɜŋѺó̎ȁ̍ɛ@ѹס@@ʵƧȁôó@ǿ̐ŏöʵɝŋɛ@ô̑ƥóóƨƧ—ó˜ôœó@ƩôóƦ̍œóȀƨŎɛӒôŐυͪɛ@@Ȁə@"],encodeOffsets:[[106831,38340]]}},{type:"Feature",id:"hai_nan",properties:{name:"海南",cp:[109.9512,19.2041],childNum:18},geometry:{type:"Polygon",coordinates:["@@φɜƦʶ̐ôφô̎@ƨŎö@τʵƦ˜ԩ۫õН̏óƥȃƧ@Ʃəםƨ̑Ʀ@ޤ"],encodeOffsets:[[111240,19846]]}},{type:"Feature",id:"tai_wan",properties:{name:"台湾",cp:[121.0254,23.5986],childNum:1},geometry:{type:"Polygon",coordinates:["@@ô—ƩɝöƧɝѵəޣ̏ρƩԭóōóͪρɞƧОôԪ݈ଦѶɜ̒ɛ"],encodeOffsets:[[124831,25650]]}},{type:"Feature",id:"bei_jing",properties:{name:"北京",cp:[116.4551,40.2539],childNum:19},geometry:{type:"Polygon",coordinates:["@@óóó›υóôƥ@ŏóóə@ƧŋƩŌρóɛŐóʶѶʴƥʶ̎œôƨɞ@óŎɜŌ̎̍φ›Ƨŋƨʵ"],encodeOffsets:[[120241,41176]]}},{type:"Feature",id:"tian_jin",properties:{name:"天津",cp:[117.4219,39.4189],childNum:18},geometry:{type:"Polygon",coordinates:["@@ôôɜ—@ƨöɚôœôôɚŏ@óƥ@@ȁƦƧɜ@óƧƨƥ@›ƧóəН̏óѷɜ@ŎƦƨóО"],encodeOffsets:[[119610,40545]]}},{type:"Feature",id:"shang_hai",properties:{name:"上海",cp:[121.4648,31.2891],childNum:19},geometry:{type:"Polygon",coordinates:["@@ɞςƨœɛȀôŐڔɛóυô̍ןŏ̑̒"],encodeOffsets:[[123840,31771]]}},{type:"Feature",id:"xiang_gang",properties:{name:"香港",cp:[114.2578,22.3242],childNum:1},geometry:{type:"Polygon",coordinates:["@@óɛƩ@ρ@óœôȀɚŎƨ@ö@@ōƨ@"],encodeOffsets:[[117361,22950]]}},{type:"Feature",id:"ao_men",properties:{name:"澳门",cp:[113.5547,22.1484],childNum:1},geometry:{type:"Polygon",coordinates:["@@X¯aWĀ„@l"],encodeOffsets:[[116325,22697]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/chong_qing_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"500242",properties:{name:"酉阳土家族苗族自治县",cp:[108.8196,28.8666],childNum:1},geometry:{type:"Polygon",coordinates:["@@XJ°œlJX@lbl@XbV@VLnJlxnbšƒUU@IVK@lVIVwnJlU@n@J@L@Jn@l_nWVLVln@@blLšmV@@xœÔ‚`nœ™xV‚ÈLlx„LVxVVšƒV_U»VWn_m¥XwVmnX°ƒlmUUVwÞaVƒk@a@mmIUa@™mwk@™ƒm@@U¯a@UV@@K™@ykkmwkV@kU@ƒÑƒVkKWLÅamaUm@kyU@WkU@Ua™IUašVaUUmUUa@aVLXKWa¯UUbmJXnWnX`l@@xkzWÆ@V„LU¦‚x@b@JkIkJ@LmbUamJwm@óxƒnk@V„@x„ŽVnUVmVUVŽUbVlUbkXWŽ"],encodeOffsets:[[110914,29695]]}},{type:"Feature",id:"500236",properties:{name:"奉节县",cp:[109.3909,30.9265],childNum:1},geometry:{type:"Polygon",coordinates:["@@WVXb‚UnK@x@b‚²kxmKkl¯_ƒVV°™VU@bnKVVV@@nkŽ@n›bn‚@š°@VLČUš@°WV@V™nU@InKVl@nU„b˜KnX„WlknLlKUwnalLša„VlUXmWk@UU@UWWIUyķ¹XaWW@X™ƒKUIVm„U@W@UVU@KV@n»VkUkÇmUmVIUmULUbm@ƒwUaƒKkkm¯ÑUL@bWVnx@VmxUI@„klmkkK@aƒK@IlJ@I¯ƒk@mak@mnkJVL@bV@Ub„„W`UUUV™I@VƒU@VVbUJVLUVVbUX„VVxk¦VJUnVxnVVUšJV@Ubl@@bXV@L"],encodeOffsets:[[111781,31658]]}},{type:"Feature",id:"500238",properties:{name:"巫溪县",cp:[109.3359,31.4813],childNum:1},geometry:{type:"Polygon",coordinates:["@@nLWbX‚VLVU„V@KšIVl@b„@lbšU„VnU@JÆU@V@n°KĢUl@VbÞKšVš@„_„V‚KXU‚U@KXƒ@wlkkU@mWKUU@UôJ@XV@œaVmÞIVaVLƒƒ@»kmƒ@ƒUkL™U@aU@WWƒLUUU™™KkbƒwWa@KU@kaƒXmW—LƒamVk@UmL@JmVUšU@¯X™@ċVUK¯@ÅnWK™LkKULWK@UXK@wW@™LkV@bVLƒlXn›`¯xU„°LnŽlV@n°Lnl"],encodeOffsets:[[111488,32361]]}},{type:"Feature",id:"500234",properties:{name:"开县",cp:[108.4131,31.2561],childNum:1},geometry:{type:"Polygon",coordinates:["@@n@na‚I„wš@@VVK„LVbVxnVÆUnanKWXamKmk¯K@mkUm¯KVƒ°w@Wm@UIUUlKUU@a¯KWanwmUXamKkUWUnU@KƒkUwWKXaWLUWkImaUUUƒƒKka±k@lƒ¯w™wmbUƒ™ƒkXm@UJkIW‚XXƒbƒmƒ„UJ™XUV@°šKlšlVXV@xmbnV@blV@VšœU`UL@V™a@bULlb°VXbܚ@V@bƒL@J„xnLVb@lVb@V@@z˜bXWšX„KVLV‚š@@bUVVL@b„„lVna@ll@„zl@@J"],encodeOffsets:[[111150,32434]]}},{type:"Feature",id:"500243",properties:{name:"彭水苗族土家族自治县",cp:[108.2043,29.3994],childNum:1},geometry:{type:"Polygon",coordinates:["@@„Jlb@nVV@bXb@ÆlL„Ul`nVKU¼VxkbW„nlUxlXX‚@°°WnnJ@VUn@J„k°L@VlV@nUJ„x@bVVVz@VnLla„KnalVlIUŽ„¼@nV@@anKUwVal@UlJœƒlI@akU@UWXKVI‚¯Uak@@KmkXWÜkXWykIWwXw@laXamkVUUym_XmlkkmmakwmIUKU@Wak@kaW@kI¯›WIk¦VŽƒUUƒmaUV@XkVUV±aUb¯b¯¥m@@ImJ—@mƒmL@kUKUkkJƒbV¦"],encodeOffsets:[[110408,29729]]}},{type:"Feature",id:"500235",properties:{name:"云阳县",cp:[108.8306,31.0089],childNum:1},geometry:{type:"Polygon",coordinates:["@@lb„LV„VVnblJVXXKWbXLVx„l@LmVXVVl‚nLWbnVmxXb°L@bVVkLVVVJn@@X‚‚œ_Wm„kUK@alUšKX@@xWL@VXLVKlLšKXLÆm@™mœa@ml@mU@UUmL@aVšUU¯„U°`lknLlw±@a@wmLVWaXU@KWU@ak@VaU@™IUVmUUwVmUIl¥UwƒUVWUaVUUKVIUa@UUUUJƒUUm™kƒ„nl@„@VWV@L¯aUb™Ulxƒ@@b@VULUx@VUxVV™U@bU@mxU„U@mUVŽklkkƒ@WxknlxK@amLƒKU„K"],encodeOffsets:[[111016,31742]]}},{type:"Feature",id:"500101",properties:{name:"万州区",cp:[108.3911,30.6958],childNum:1},geometry:{type:"Polygon",coordinates:["@@ĸĊVI„ƒ„n„aWWXlJVIn@lWš„V„našx°xk„l@²Ž‚LVƒ„LnK@b‚LkwlmXw„@lllkUnVV@VƒnwV@@ašVUUVw@UVwVK@U@a„@kwšVVa°b@KXU@U@ƒmk„ƒÇсaml™kUVmn@VULU˜m@kUVkUaƒwUWm@Uw¯„mKUUmVUUULUKU„W@XbWVkaWwkUU™ƒ™k@maUbmbVlk¦ƒxUVUIWVU„kJVVkL@UmJ™UUVU@lLUVU„lx„@@VbƒJ™U™L¯¤@Vƒ„"],encodeOffsets:[[110464,31551]]}},{type:"Feature",id:"500229",properties:{name:"城口县",cp:[108.7756,31.9098],childNum:1},geometry:{type:"Polygon",coordinates:["@@VK@w¯L@m@UÅV@ImVƒU™Vkaƒ@@aUk™J@LƒUUVUKmLmbÅVmUUwUaƒKUL@U™@ƒxJmbm@nVJ@X@VkV‚n™lƒLXx™@ƒb@bUVƒLU`UnƒbU@@ŽmVVX@JX@VLVVšklV—„‚`@bUL@V„LVKn@‚U@„UJkn@lmLmK@X@Jn@mb„nÞWVXnJ‚k„KČÑÆ@VK@knaÜmXlUČW°kôÇƁ@a@yÞ_VmƒUnU@K"],encodeOffsets:[[111893,32513]]}},{type:"Feature",id:"500116",properties:{name:"江津区",cp:[106.2158,28.9874],childNum:1},geometry:{type:"Polygon",coordinates:["@@„InWUUlU@LVašlX@°²lÒXxlK@Ul@@Un@UaVJ@I@W@UƒUUVUwVIUKUa‚UUVwn@Üx@XUlnn‚bœJ@¥VklKUUlk@ynU@kVƒUUVWnI@¥V£VWVIUKU@UVƒa@n@Vm@@nlUaVkUwƒJ@blLkLW@XWmXkmmLn™@m@U@UVm@™„UVUUlakUVa„ƒVkV@@wnaWUk@VwkƒlmVIkUUxmJ@U„™@KƒIkx±V@IUm@K@IUKkbWKUbn„m„@bmVnbmb@xkxUJ@ULW`@bX@WVXL@Vƒš¯„mk¯@UJ@VmLUaWnX@WJ@nkKkxW@UIV@@KkImmkK@UW@XaWIU@U‚ƒIkbWb„xXŽlLVbnV@bWlX@VxVLnl@nÆÞVÜ"],encodeOffsets:[[108585,30032]]}},{type:"Feature",id:"500240",properties:{name:"石柱土家族自治县",cp:[108.2813,30.1025],childNum:1},geometry:{type:"Polygon",coordinates:["@@„š@kl@š¼UbmVXJ@bV@nxVIVJULVVk@@LWbnJVU@bVbUJ@blLXnWV—@mbnV‚@V„„bn@VJVLnaVanbl@„šVšlVXxlbXUWaX@VƒUUVwUUVm@I@WmI@a„mlLœ™lK@alwnUV@kóVaƒÝk@UlbVK@™VU»VUUVWUƒ@U`ULkwm@@KmU@knKƒ»VkJkUmbƒLkbmK@UUyUU@aƒwm@@XXJ@VVLVVUbVnUJVX@K„„k`WXXJWXUbmW@bkL™Um`Xnƒb@JVL@LU@™°VVXKVnUxVLUbmJ"],encodeOffsets:[[110588,30769]]}},{type:"Feature",id:"500237",properties:{name:"巫山县",cp:[109.8853,31.1188],childNum:1},geometry:{type:"Polygon",coordinates:["@@kVƒU™bkKmbVxkLmKkllbV@@LXb„xlašLVšVV„KXXV@@bšVlK„V„@ln@¼°KXa„U@Ulw°JXalIUa„ÝWXW@kVU@ƒVUVWUUUamUw@aVamwn@VUUƒlLXWm£@wÇĉkKklmLUÒ¯ƒWn™@ğ±kwmaWm¼U@@LUV@V@XƒVUnVJ„LWš@‚XXWbĸºVzXJVXV@@VXlWn"],encodeOffsets:[[112399,31917]]}},{type:"Feature",id:"500102",properties:{name:"涪陵区",cp:[107.3364,29.6796],childNum:1},geometry:{type:"Polygon",coordinates:["@@nèVblĖVVnLšŽ„@šx‚V„n@nšJ@L„UVVX@lbUJV@@nn@VVVK@z„˜V@nzVJVUlmX@@_VVVbnaVal@@knW@wnaƒVK@aVI„J@£kUVW@‚wXUVJ„amƒ@Ikƒƒƒƒ_X¥ƒ@WwkKkwmŽ™šƒkUxƒnÅmm¥™WV@Um@UlVL@JU@@Xƒ@UVkKVk™KVk™Kkb@bmJVXU„VVUbU@@`W_UV¯b"],encodeOffsets:[[109508,30207]]}},{type:"Feature",id:"500230",properties:{name:"丰都县",cp:[107.8418,29.9048],childNum:1},geometry:{type:"Polygon",coordinates:["@@Þè@XUK@LlV@blbUJ@„„V@bnV‚@VVVXU@ƒlbXal@VXnKV@maXUރ@amk@aVKXV‚anbš£°mnIVaUKVwUmWLUUš¯V@@KUK@I„aWmn_šVlK@anXVaXWWIXWl_ƒƒ@LUWVIUmVaUUUK@UWI@Wn@VI@mkU@U¯Kƒl@ImVÅLƒwU¤óbUU@wWXkmm@LU@@VUIWVUL@JUnƒaƒx@Jn„ƒbUIWVx@ŽUXlV@¤ƒIUJ@bUL„Žmb@xmX@lk@UbmbUaUU@`W@kn"],encodeOffsets:[[110048,30713]]}},{type:"Feature",id:"500232",properties:{name:"武隆县",cp:[107.655,29.35],childNum:1},geometry:{type:"Polygon",coordinates:["@@l„„w„bVm@IVKXUVJ@UV@@KnnWlX@xVVôaV£„xÆKnUVm@UmIXm¯¯@WkWVwmkXƒlaUwV»ULmk_ƒVkK@ÅWa@aUU@mkaƒIƒb@‚n¼ƒnm‚_@mmK@UƒLUVVmI@aUJ@XWJ@U`UIkm±kk@@lULmUmKUnVšnlUVmI@VkVlx™bkIƒVmLUxkKUŽ‚Xš‚n¦Æn„mVw„lš™nlxlLXx„@W¦„`„„"],encodeOffsets:[[110262,30291]]}},{type:"Feature",id:"500119",properties:{name:"南川区",cp:[107.1716,29.1302],childNum:1},geometry:{type:"Polygon",coordinates:["@@VšUbVJVUn@VLX@WVXVVI@VUVWxU@mš@ĊX@@¼V°aVUX`@_V@VaUUVƒUWnI@alašLUlšLUllLVU„@@WV@@IUKVkn@@VlLVwnK„UlJšakwlU@UnJVUmkU™VmXa@wVK@UUw™@VƒVI@akƒ@alInwlKXUmaUW@wWLk™™KVak_ÇaUƒƒV@šXbƒLVxUlWIk@UK@V™@ƒkU@VbUVUlVnƒLUV@lVXmxkV@L@V@Vk@WbUwmL@JUI@xVxkx"],encodeOffsets:[[109463,29830]]}},{type:"Feature",id:"500241",properties:{name:"秀山土家族苗族自治县",cp:[109.0173,28.5205],childNum:1},geometry:{type:"Polygon",coordinates:["@@XlV@lzn@VŽnbÆbXKlL„U„ÒV@@llUnxll@zšŽ@LU@@V°b@Vn@š„l@VÑUƒnK@UšU@aUaƒkVm@K¯wƒklmnn„Ul`nI@almkIUwmWVkUaƒkkJmUUa@K@aU@@_m@@wUyVUUa@Umƒ@awl@Wka±„UkUykIWV™b@bUVk@›aU@UXU‚UIWakUWmUxUV@nUVWbšŽ@XXVVŽmXXŽ@VƒbVLkVWx"],encodeOffsets:[[111330,29183]]}},{type:"Feature",id:"500114",properties:{name:"黔江区",cp:[108.7207,29.4708],childNum:1},geometry:{type:"Polygon",coordinates:["@@VX@V@LV@VJUL@lVnnxlb@VXV‚XV@@W„@UIVK@kUKna@£VWUaVUUalIVJVIUW„_lm@bXKV@mn@J„UUw@KnIVll@VanLVmUkVKXLVKUIVamw@UaU_lw„KlwUWV_Ua@aUa@KUšwm›_›Ó@wU@™nkK@am@UkUKmXk`m@@I@K@I@mkVmIUxUJ@kUL@JVV™„lnklWnn`VzUVnlWbkb@WxXxlJXzWŽÛlWXnl@Ll@Vb°UJWLX@VlV@bkJ"],encodeOffsets:[[111106,30420]]}},{type:"Feature",id:"500117",properties:{name:"合川区",cp:[106.3257,30.108],childNum:1},geometry:{type:"Polygon",coordinates:["@@XKVXlK„ƒVL@UnV@aValXXK„U@WVwUaVU@IV@@aVW„L@U@anVV@@bVK@UVL@bnJWL@VnUnb˜@@JnIlVl‚@@bXIWbn@UKVLVKXLlaV@VVnK@bVL„m„IVƒ@KmknUUWVI@aVJ@_„WU_VmUwƒU@K™ƒVak@am¯mJU_UJUkU@WkIV`UI@JV@LmmU@@mƒbUzś™@„VK@nUKƒ„ƒb™akb@UWK@bkVVbV„Û@@`ƒXk@WŽ@n@lXL@bmb@VVJUn@JnUlnUlmX@`XLlbkJW@kzlb@`@b@b"],encodeOffsets:[[108529,31101]]}},{type:"Feature",id:"500222",properties:{name:"綦江县",cp:[106.6553,28.8171],childNum:1},geometry:{type:"Polygon",coordinates:["@@@¦‚@X„lVX@@UVKl„VUX@lanVlUVbXWVXVƒ„VVUnKVUlwUwU@UJ@nmVkUV™lwXam@VaUUUw@W@kk»mV@UmKkwVKVUU@@LUKVI@mV@XVWxnXVKUUUK@wWU@UUWnUlLXa‚mUI„am@wI@K@amIm‚UUkI@m‚akUkKWUUanƒ@wƒamLVxk@UVmUUL@Vm@kV@I@ak@@bWVXJlLVbVL@š@bn@@`Un„@WbUKULWVXbƒ@UVmbX„WVƒb@bVmxUKUƒV@šUn@V@V@nmšnKlnnWWXX@lKkK@a„IVxUlVb‚k@mn@@U@m„bVUV@VLUJUXU¤"],encodeOffsets:[[109137,29779]]}},{type:"Feature",id:"500233",properties:{name:"忠县",cp:[107.8967,30.3223],childNum:1},geometry:{type:"Polygon",coordinates:["@@VLÞĊ„U@Wš@¼V‚„@lk@w²mlšVUœ„llšVnI@VlKUUlIVƒXUVJVU„wl¥UkUKUIm@ƒaUƒ@mUna˜@XUWmkK@aVIUa@aUVmIXa@Kl@UUVKUIUJmwU@@aWInUVa™»k@@lƒ™¯n™¤mabWUUL@bnl@b݄WVnbU@mLUWk@Wbka@„WVUU@UmUmVkUULV„lVUx„l@L@VƒbÈÒlb"],encodeOffsets:[[110239,31146]]}},{type:"Feature",id:"500228",properties:{name:"梁平县",cp:[107.7429,30.6519],childNum:1},geometry:{type:"Polygon",coordinates:["@@XLV@VV@b°°nšƒnkb@bƒšnJWVXblIUVšxWnUJnVVLVU„JlUnLVK@UnUVJš²nKVbVKla@aXlJ„k„Klb„ƒ@U°£šKšV„IUa@ƒ@kwVƒVUkKV@VUkk›ƒUVk™±n@xklƒ@U@»™‚@XƒVÝĉUJnxWb@UX›KkVUbUKWUkVmkkLU`›b"],encodeOffsets:[[109980,31247]]}},{type:"Feature",id:"500113",properties:{name:"巴南区",cp:[106.7322,29.4214],childNum:1},geometry:{type:"Polygon",coordinates:["@@nxnVlJlUXLƒ¦@x@Vl@nKVVX@V_V@@KlVXU„@lKlxXIl@ÈĊ@Vl@n_VJlŽnVlnb„²VVVJVVmUUkĕUamçU@»W@@ĉn™V@XwVU@UUJWUXUW@UKm@UVUIVaU™UVmLUVƒUU„UWWXUakVmUkbW@UVkƒUL@VW@kUWƒ@mJUXVVU„@lmV@zklVVkLUl@¦›I"],encodeOffsets:[[108990,30061]]}},{type:"Feature",id:"500223",properties:{name:"潼南县",cp:[105.7764,30.1135],childNum:1},geometry:{type:"Polygon",coordinates:["@@@a@a@_kalyX@lIkaWK@_nWVkkmmV@IVmUI@Una@aWK@k@mkbWaknmJUk@mk@@kUal@Uaš@Wa@aXLlwUKlkkƒ@KmI@VUJ@Lk@@VUUmL@amJU£kKUaWakLmU@bVVUbnbWV@xkL@bUb‚xUxVbXJVbUVWIUVU@kLWxkKWV@n¯VUbU@@VVX@VmaUL@VUK@VVbn@lVnI‚@@lnLULm@Ub@Žl@na„@lK@XVVkJ@b@zl@@VnV@bVb@J@bnXV`lXXmVI@W@InbV@@aVKUblKVLUanLlmnLlK"],encodeOffsets:[[108529,31101]]}},{type:"Feature",id:"500118",properties:{name:"永川区",cp:[105.8643,29.2566],childNum:1},geometry:{type:"Polygon",coordinates:["@@@b܄nWVLX„lxV„VxXxlVn@@bVblK@a@UnLVJV@@UnLVU@VXaVKVXš@n`WUÿ@IUKlaUUUkWyUÛÅÝ@mmkUKUwW@Xk@amUUakKWƒwXaƒK@VVLklƒXVlkxV„UL@bm@Vxn`ƒIVxUVkLVšUšl@@lkXmmƒVUn@VV@Xb"],encodeOffsets:[[108192,30038]]}},{type:"Feature",id:"500231",properties:{name:"垫江县",cp:[107.4573,30.2454],childNum:1},geometry:{type:"Polygon",coordinates:["@@šĊ°¤nҘ¼œaV_lKnllUXVVLValUœLVW‚@XamwVIUKkaÇфa@U@KƒkVwkUUƒVKlVnU@aƒU@ƒVIka@akU@KVL@WÝçUV@Vmbů@L™KƒnnJW„ƒVkxlL@VX@VxmnXVWxUb@bkn"],encodeOffsets:[[109812,30961]]}},{type:"Feature",id:"500112",properties:{name:"渝北区",cp:[106.7212,29.8499],childNum:1},geometry:{type:"Polygon",coordinates:["@@@bVVXL‚a@lnbWn@L„@XVlK@VVLUVlbkLUKVVVL@VšnX‚VL@VV@UbVb@x@¦UxVb@bUJƒL@L„VVxlK@™nk@U@W„UVLlKXV„@VblU@UUKVU@wn@VJVanLlkX@VaVK™¯@a@U@U@ƒVaUK„kUUƒ±maUkm@UUkbm@@Vk@@JƒwU@Ub@I@JmwUL@aƒ@@KkVÇLkƒWkƒ@kUU@@xUVmKUnllUb"],encodeOffsets:[[109013,30381]]}},{type:"Feature",id:"500115",properties:{name:"长寿区",cp:[107.1606,29.9762],childNum:1},geometry:{type:"Polygon",coordinates:["@@VVšU„bX‚lX„¥l@XnVmlxUx„@@blVnnôĀlm@aVaXwWUnmUwW@@UkKlw„UXƒmI„mšL@KÆ°na@UUImyU@ƒ—@yULUUm@@mU@VIkaW@UUƒV@K™I@mƒmU™wƒ@™mKUnU‚UIƒlVLUb@„@V@V@bš°ULUbW@klmKUbUIm@@xUVVL"],encodeOffsets:[[109429,30747]]}},{type:"Feature",id:"500225",properties:{name:"大足县",cp:[105.7544,29.6136],childNum:1},geometry:{type:"Polygon",coordinates:["@@XUmaVaUU@anVlKXbValU@aV@@IXKš@@bV@VxVK@UXLlUšJXa@_‚@@aVK—ÅWVkwWaƒƒwUa@am@kUWLU@kWmX@ykI@W@UV@na@LlLV@UƒkwWƒUKmXX`mIVl@bXLWVkbkkƒx@`VXm@@J@U@UUKUxk@WbUIVl@VXLW„ƒJUkUlUImxXlmb@X@VUJUnVbšW@UV@@VVX@bnW@LVxUnlJUV@n„@VxVIn@l`„UVVVL"],encodeOffsets:[[108270,30578]]}},{type:"Feature",id:"500224",properties:{name:"铜梁县",cp:[106.0291,29.8059],childNum:1},geometry:{type:"Polygon",coordinates:["@@VblLV¤nI@bnKVV@Ul@@KVI@UnJ@Ll„klVLkxWK@bXb™@Vbk@Vb@ll@@nVlnIlmXblaXl@„W@_Ü@UƒUalU@aXL@Vlašb„a„ƒVL@mUL@ƒUUƒƒÇXUW›X_WaƒƒUƒ»m_™@UWULWb@UUVmK@VU@UImK@V@bkL„x‚„XblxXU˜ÆUL@b@@`Wb™IkVWK@VULUwU@@a™@WL@JU@@bkVUb"],encodeOffsets:[[108316,30527]]}},{type:"Feature",id:"500226",properties:{name:"荣昌县",cp:[105.5127,29.4708],childNum:1},geometry:{type:"Polygon",coordinates:["@@VI@U@WnaWknwVJVkVl„IXƒWK@UUkVJXal@VwVL@V@V@In@UW@_„wlllaXUWK@aUknJW_ۃ@aWaU@@UVm„UUaUImJVnÅUmVUm`kUUVWLnVU@VVmXƒK@„nxmŽULkx™ImJ@nU`@X@Vkn@`@nlV@nVJVaX„VLnK@bVV@nV@lbXWš@"],encodeOffsets:[[108012,30392]]}},{type:"Feature",id:"500227",properties:{name:"璧山县",cp:[106.2048,29.5807],childNum:1},geometry:{type:"Polygon",coordinates:["@@XzVlVVkbVL@JVĀXŽ‚¼V„„„XbW`XœWVȎ„„VVšŽVkV@@UXa@alK@IƒƒU@UKWUyUI@wVUUWVak@VUkƒW¹@WXI@yVIUK@kWwkѯ±W@™kUb@KkVVVmXƒJ"],encodeOffsets:[[108585,30032]]}},{type:"Feature",id:"500109",properties:{name:"北碚区",cp:[106.5674,29.8883],childNum:1},geometry:{type:"Polygon",coordinates:["@@X‚VLV@„„@JkL@bWb@VU@UlƜVy„a@nV@nn@KU@IVJU_lJXV@VlVIV`nIn°@b‚lUbš„„KVI@aUaVw@¥@wUaVaU@@UUKW™m@UUKUUVLlKkaVUUK@UkLWUƒ@@KXmma@kbWKUU@aUamLnÞ@VWLk@@Wm@ULU@@U™KUVWI"],encodeOffsets:[[108855,30449]]}},{type:"Feature",id:"500110",properties:{name:"万盛区",cp:[106.908,28.9325],childNum:1},geometry:{type:"Polygon",coordinates:["@@VIV@@wVJ@InKVxXal@@U@U@KlUnwUW@kVU„KUmVkUa@I@KW@@bk@@mƒU@m@k@a@aƒIUxmJk@ƒwULƒwkKmVVX@VXV@xVLVVULmWXwWUU@@nUJVL@KV@UVULlxnL@VnUl¼@l@XVxVVUbn@WbkxUšlVnU@m"],encodeOffsets:[[109452,29779]]}},{type:"Feature",id:"500107",properties:{name:"九龙坡区",cp:[106.3586,29.4049],childNum:1},geometry:{type:"Polygon",coordinates:["@@XK‚L@Vš@XbV@lW@UV@@VXIV@U™VKlL@KnnJ@VV@VU@I„@@mVUVWUUmL@V¯LUK@UV@UU@a@U@yU@WLUK@X@KUVmL@ƒ@aXI@w@ammVk@WÛwm@UxVVVbVLUJVxVU„V@V@X@JUIVbm@@Vk@@VkL@lVLUJ@zWJ@X"],encodeOffsets:[[108799,30241]]}},{type:"Feature",id:"500106",properties:{name:"沙坪坝区",cp:[106.3696,29.6191],childNum:1},geometry:{type:"Polygon",coordinates:["@@Xºl„UVl@UbVXUV@xVJVzXJVUšL@VV@VKn@@Xl@XK@UmÝnKVbVakkVm@k„ƒUK@UmIm@LkKULVšU@WJ@UU@@VkXU@Wa™@@UKWL"],encodeOffsets:[[108799,30241]]}},{type:"Feature",id:"500108",properties:{name:"南岸区",cp:[106.6663,29.5367],childNum:1},geometry:{type:"Polygon",coordinates:["@@VV„JVL@bUVVnl`XIlwXJlw°nnl‚IXW@UÇĉk@WJkwkLƒ@WVkU@LU@U`W@UXUV@n"],encodeOffsets:[[109092,30241]]}},{type:"Feature",id:"500105",properties:{name:"江北区",cp:[106.8311,29.6191],childNum:1},geometry:{type:"Polygon",coordinates:["@@nLVU@wV@lV„@Xll„ÈKlU@L„@@bVKnx@I@JVaV@„x@Il@@Un@laVVn@mkUIm`k@WXJmk¯mkxWIkxWJk_UmVUUKƒ@UU™@ƒ„@l"],encodeOffsets:[[109013,30319]]}},{type:"Feature",id:"500104",properties:{name:"大渡口区",cp:[106.4905,29.4214],childNum:1},geometry:{type:"Polygon",coordinates:["@@k@@U@w„¥WKkVkImUmwa@b@xWJ@b@„nKVU@L@WVLXKV@@z@V@bVVU@@VVL°K@U"],encodeOffsets:[[109080,30190]]}},{type:"Feature",id:"500111",properties:{name:"双桥区",cp:[105.7874,29.4928],childNum:1},geometry:{type:"Polygon",coordinates:["@@WwUwU@kK@KmbU@@V@XlJ@znWlXV@XK"],encodeOffsets:[[108372,30235]]}},{type:"Feature",id:"500103",properties:{name:"渝中区",cp:[106.5344,29.5477],childNum:1},geometry:{type:"Polygon",coordinates:["@@VLš@VV„@VL@aUKƒIUUƒ@@JUVU@"],encodeOffsets:[[109036,30257]]}}],UTF8Encoding:!0}
-}),n("echarts/util/mapData/geoJson/fu_jian_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3507",properties:{name:"南平市",cp:[118.136,27.2845],childNum:10},geometry:{type:"Polygon",coordinates:["@@@knyƒk@ƒKU¥šwV@nkƒWƒzUmk@@lKUa@aVI@UƒKUamKUUVaUI‚@Xƒ@UV@K±IUVVlUbUbUL@KWUXmWk@KkXmmkŃKUƒ™a@amUƒbkUkKWUnwUƒÇwV™UUƒÝUKV£U™@ƒnKWwXLVKm¥@wUXkmWk@ƒ@wX@lU„@šyVImaXwVƒƒ@kŽƒnU@mbk@mlUXƒmU@mV@n@bnW@bUIWJ—ImVUKWbUK@nkKƒaU@W_VUUmWmL@UU@™bUWUL@V@bmVUz@`mUUVVbXL@V™L@lmLUxmVamXkW@xWbU„VbUxkU±@ÅUmmkLUbW@@`kLknVlV@lbXxlVUXVV™ŽU„U@UbWŽkIWVUUUJkI@llbUxVL@V™VƒUU°ULUmWXUV@VULWb@™xm@UaVLVKUa@ƒw@V›bkmVambUUm@@VkK@„@b„xlxX@‚„n¤@Xƒ@@lkLWV@Žn„V„kb@bWJXLWx@nkxmm™bXn@VWVUn@VnJ@bVXl@„™VJXnWbX`lL„UlJVI@Žœ@VXV@Vl@bn@@Æmn@VšxXU@mVIlxšVššnI„l@nVJ‚aXI@mlU@aXkVm°klmnVV_naš°@V@xܦXK„V‚nnUlVXbVK‚LXKV@naV@@VVl@@lXblXšWnLlbVK²nš@@‚VLUnlV@lƒXxô°‚V@UnaUUlKXLVUVVUbVVlUnJVX„@VW@an@lb„@nl@VU@anƒšUVW@kƒaUm@InVVKVU@kUW@Uam@km@kVa@a@™nwšU@WlI@mVI@WXaW_nƒ@™nƒlkkW@U‚¥@kV@Uw@wUƒ@@IXK‚¥VIn@nU@`@Xl@VV„LnašW‚bVaUwnU„@VIšKlV"],encodeOffsets:[[122119,28086]]}},{type:"Feature",id:"3504",properties:{name:"三明市",cp:[117.5317,26.3013],childNum:11},geometry:{type:"Polygon",coordinates:["@@lL@Un@VVna‚bnUlœa@U‚x@„VbULUKVbn@šw‚@XaVK@UVUXWVnVKV¯„VšU@UUKVwka@klJVIVVXUlJXVaV@VƒšUUVWkUWwkaU@UklmlK@_X@ValKnnÆV²@lVVwUaVƒXa@wlXnW‚bnUVwnK@kšK@UWKUaVUnV@_VynU@a@UVKVXšaV@@VnKnXVV‚UX`V@„blL@mVLXaVLnU˜JXIVJ@amX@a@mnUV@„nVWnkl@naV@„ml„@@KmKUam@UU@ƒ@UlKU™Vk™U™K@aVaUwV™U¥UIkJ@wmI@‚mbkwkVW@UXƒKULU`™IVKUa@LƒkkVmUU@WlULUWÅU@I@ƒWW™nU@@w@a@ƒUam_XyVIVWkkƒ@mwVKXUV@nw˜VXkWƒÅ™U@ƒaƒU¯KUnƒK@ƒ¯šmUƒLXŽVLnWVbVbUVm@Ub¯¼W@amƒ`kb™amLUUUƒ™aUXV`@x@XmJ@n@L@xkJUU@kU@mWm@kUUwUUVWl@VUkIƒy@kkaVUUm™IWVXbWxU@k„mVkK@nWVX¦WxU@@bkx@VU@WŽk@™kUbmJUUmkUW@_kKWKƒ@knV¤kIUKWLUbV‚@Wbk@@VWL@VkI@lUXVxUVU@@mWIƒV@a¯nUaƒaUV@„ƒJ™b@bÞ°VbUš@X™aUVmL@‚VXblŽnV„°˜n@Vnx„@VUUUlK@InJVb@„Vlnn@V™L@VWJU„x@XlJUVVVl@LUUUJ@Lƒ„@lUL°¦k˜V„VnV@„xV„„l@blLnlšLVaXll@šnVUn@‚xn@nml°‚X@lb"],encodeOffsets:[[119858,27754]]}},{type:"Feature",id:"3508",properties:{name:"龙岩市",cp:[116.8066,25.2026],childNum:7},geometry:{type:"Polygon",coordinates:["@@ša„I@ƒVU„bVb°m@b„UXJ@nV@VUUwVW@klJ@UXK@Ul@Xa‚@UVaXKVLlJU£lm„@XLlL@`VXnlVVnIVašll@XV@@Ulw@aV@XwW¥XU@mlLnUlƒV@XwWaXUšJVnUVlb@l„zlJUVk@UXVVVxlVn@nXV@@lVVlI@w@K@mnI@W@wU_VWšbV„VVnKšbla„_n‚bX@°»Van@VUUaUamXUKW„K@a@Ukƒ@wWkXƒWW@wUU™Kw@_lyƒwUkU@@Uƒ@kamVmƒXašUVUka@Wk@»UUUVƒKkbWU™VUbk@mkƒxkƒƒKnIVUmW@kUKmXUmVaU@kU@m@KUWVkIWJ@ŽU@UI@wUUUa@KW»nU@mVkUmm@XwWU@ƒUUmL@ƒw@mnƒVUU@aWak@@amxU@UxULWVXbVLU`mbUImVU„ƒbn‚V@@bVn@bnVWxLmyUbƒIUKƒ@aƒVm™akbV‚UXW„UlKWbkV@„WLUlk@@nšbƒb@lkKmU@ƒUIWJkw¯UUVVxm@@XkbWx—›XKƒlUzWJkUUL@bmKkVƒ@@VUIUlWV@X„K@VkbWx°xUb@LUbk@@VWb@LXJ@VWXU@@bUVV„VVn@VVlLn„@l„@‚xk¦Vx@bVJXbƒn@JlnXxV@@„nJ@X@V@lmx„bUn@xVL@VVKlL@l„„nLVaVL@xkl@LƒxVl°š„X„WVX„Vl„œJWnxlJ"],encodeOffsets:[[119194,26657]]}},{type:"Feature",id:"3509",properties:{name:"宁德市",cp:[119.6521,26.9824],childNum:9},geometry:{type:"Polygon",coordinates:["@@@LVKVaVaUkVU²J@LVU„@@W‚VJUbVVnLVb„L@VUJ@bVbkL@Žl@Vn„y„XmlU@™xV¦„L@Ž„lmz@lnL@bVVšbVb@l„nšKVk„Vl¤@zXV@šl@XJVLVKnXVK‚VnU@wUm@šKUƒ@UlVlw@U@U@ƒUaUKlU@kXKlmXIWKXaVIVUVK@KU@@k„JVUnLVJUL@V‚IVa@VnLšKUnl`Vb„V„V@š‚Vbn@Vzn@lKnVlI„VVKUalkXJl@XXVWVLVUUmVU@Unm„£lK@Uk@WUXK@U@WVwVkšƒĠkĢÇ°aUÅUwmaţƒɱUÇa™w„±V¹XalKôx„@„UVaÜʓͿVóbÅLƒJm„¯Vk¦ƒŽk@mamXkKUƒUL›akbk@mV@LkJWb@Vk„mXk@UVmaUV@amLUKUamI@KUaU@WbU@UUUƒUIWJUkm@šƒw™Kk„VJm@kxǁVƒUK@mUVUkmlkkVm@amwƒLVWU@UbVLkšUbƒ@VƒmK@XaVWU_VJnwV@@kUmWakxƒ@kwWakIWxnbUJ™zƒ@kVW@@x@„XllnVW@xn¦ULWKXxmL@„VšU¤VL„ÞVVUšÈxV„mxXVlLlV„anV@bšbV„„LlÆnnlW@LXlWnXV"],encodeOffsets:[[121816,27816]]}},{type:"Feature",id:"3501",properties:{name:"福州市",cp:[119.4543,25.9222],childNum:9},geometry:{type:"Polygon",coordinates:["@@lxna@nJ@xlIVJV¦UšVxUb@bšLšVUlVškL@V@„VVn@Vb‚Ln‚@LU„lJXblx„@lwXbVn@lU@mxUIV`UXWb@‚nLU„„@Val™UKVaV@UX„Knx‚bn@lUkllnUVnV‚@VLU„È‚lwn@UIlƒšL„x‚™n@VlXIVJV„VVV@XaV@Vb@LnJVbVLnK@bVUnbVUl@nWlƒ@UXalI@KnUl@laœbVKV„lLnWnbl@„l¥°Unƒ„IÆKôa΀U„a@UUwÇWǓIUWUÅVkƨm@ƒ@£@KmLU¤ULˣJ™kUƒVǟUUķ@ĉVƒKUk@Ñ°wôǚç@īšé@Åţ¥mīÛkm¼Å@ƒVķVó°ō¦U°ƒn@bVJXVVL@bUŽƒakLmx@xmxXzW`XbWnXV@bWLÛ@™aƒ@ƒaXbWVkaÝwU@mlWKkLWWkLUKULW@kVmVUU݁UamV—¤›n@xUVUzkJV¦lJU„"],encodeOffsets:[[121253,26511]]}},{type:"Feature",id:"3506",properties:{name:"漳州市",cp:[117.5757,24.3732],childNum:10},geometry:{type:"Polygon",coordinates:["@@@bl@Xb@bVVUŽm„@n„x‚@nKVV@„XVWxn@VnUl@nmVX¼@LVbVV@xVJV@@XIlJXU‚V@Ln‚@lVV@UbVnnWVL@lnXUVmJ„Ll„„wnll@VašUXVla„LVUVV@¼Xl@lbUV™VWbn„nUlb„@@VV@„aVUšmlUašUny@kU@Wkk@WaUVk@@ammk@@U@UlU@aUa@wl@šmXLllnL‚U@anVnU@L@VVV@KlXnWVnVanUšw@w@wm›nÅ@wƒaUam@Uk„mUl@@a„a@U@¥škôK‚wȯ°w@ŻkwǕaK›ÑÛk@ĕōřċ£ĵƒUKW»kÅŻLU@Ulġw@¤Vz™VUbkKUbmLmlULU¼UxmbXl@bWVƒb@bUnV‚UšVbULU@@VkbVL@`U@WX@ŽXV@b°„@b¯š@¤@Xm@@b@`U„VVUL"],encodeOffsets:[[119712,24953]]}},{type:"Feature",id:"3505",properties:{name:"泉州市",cp:[118.3228,25.1147],childNum:9},geometry:{type:"Polygon",coordinates:["@@Vl„xkz@`‚xšLVV@xXXW„Xl@xl„@V@bnV°™@„„LVm°L„V„bV@ƚX„Wl—UmxU@WVULnx„@llUXUJWzn`Vb@„@b@xV@šmXX@„@JÆVVXVKXkV@nVlU„l@KVbULšJV_VK„LVWX@lUVƒkIU¥lIVyVU@wœm˜£nUVWU@aƒm@UmWw@UX@@am™VUn@@aUUlUVanaWUXWmUnkšK@VšUlVVUUwš@XLWWX™ma@knm‚bVb„VXbVL‚@XJlInlšL„w˜mXóšw@çV»ÇçŋaķƧóƅóKġ°nÅUķƑUÇW@—¯xÇ°öÆlV„n@llšaš@„Lšbƒ`™@™„VšXVƒVx@V@bULVJUk‚Ç@ƒ¼ƒXUKk@mmULkaWbk@ƒx@UkL@a@K@U@UmKmbU@kV@UmVUbUmmXkW@LUU@U@KmVmU@bVmKkkWK™nk@@xVb@bkV@V@Vl@nn@bl@VUXbl@XlV@@lmz™VVbkŽ™nUVƒb"],encodeOffsets:[[120398,25797]]}},{type:"Feature",id:"3503",properties:{name:"莆田市",cp:[119.0918,25.3455],childNum:2},geometry:{type:"Polygon",coordinates:["@@VbނVVnUlUX@VKVLlKXXlKXL‚‚nkV@ÞxlbXUWa„b„@šbÜ@XK@aWUXmWaX_Wynw@wnwlK„bV@aUKWUUI@a„mV¯Ŏ¥ô¯ĸU„UÆ@n»¯aƿé@ţ¯nĉĬÝK™óó@™ÑU¼@è™xWô—nƒx™KmkkJWI@UKWaƒUUaamn@lnbWšXXWK™@VxUVkU™V@U™LmlnVWXXVmbUbkVVV@bm@UVnš@bW@@VXx‚n@V„n@bV‚UX"],encodeOffsets:[[121388,26264]]}},{type:"Feature",id:"3502",properties:{name:"厦门市",cp:[118.1689,24.6478],childNum:1},geometry:{type:"Polygon",coordinates:["@@@VlUV@nanL@V@V@L@blK@V„wl@XalbVKnnl@VL„W„»È@lVUIVK@a@UUw„WUU™šƒš@„_™aƒK™@™bkkm@UƒkõŁxóL™l@¦@Vƒb@bk@VŽƒnVln@Vb„b@xmÆnœ@x@x™x"],encodeOffsets:[[120747,25465]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/gan_su_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6209",properties:{name:"酒泉市",cp:[96.2622,40.4517],childNum:8},geometry:{type:"Polygon",coordinates:["@@ÇnÅaĉ@ƒU¯¥›UŹ‚ƒ£™WUýUU±JkkUw‚yÞIČxĊĕĊ¯š¥ÆUkţ™UÅÓ±¼™IUx¯UƒÒƑ‚ݐŰƒKÝnğ°ÅU@Žƒ@Vn@þš¼¯šWnŎ°XLWlnVnbWnƒVXxmbƒa—bóUƒlǕUUa™IUmlU™ƒš¥™kƒ¥ĉwkkƒÝɛa@¯™™U¯°mVƒkVnKlƒōÑÇÑU@kl™UġŽkUŻnUW™@š¯ƒk»šmWV£UKnUƒmUw‚w@ƒUIVaX™šwm»Èmmwn¯ċ™¯LĉŽUƒJUalka±Va@U‚k@ƒÛф¯WmnUaɝ¤Ûmƒn¯m±x@wóxÛLġÒUx¯VƒÈ™JUbóz݃ÇKĉ¯ōlÝUŎWl¯nťbÝ@¯ǩLġmV@ƯĢkÆm™ĊkVťLɃmÝXó°@„ĢbVŽóVݦɱ@Ƨaġ„UV„ĠÇÈV¼UVţwmbJÇwˋa™XmǯKkkmŽƒbXšm¼V¼ǬŚ²¤ôŰÆƴô̐ŤǪnɆӨ¼ɆLÆłUĊšxŎƞȘǔˎǬǪnƨŮǬö°»šġ„„ÞÜÆĸÒĊ„ǀbƾèôÈ@¼¯þŤĸƧ°VĀ¯b@lÈĊ‚šʠń̐„ȘKǀŽֲॗţÿǕý@ʊǓƨóÆÑǖŃôw@΋ʈƆÅÈVVĊV„óĊÅ@ÞƒĬV@Þīš@°Ž„V@ĸĢƒ°XτƜĠ@ÈaÜ¥Őƅ‚™nğóĕVġUůƿŋ—ĕƒa±V—UťÇğÑ"],encodeOffsets:[[101892,40821]]}},{type:"Feature",id:"6207",properties:{name:"张掖市",cp:[99.7998,38.7433],childNum:9},geometry:{type:"Polygon",coordinates:["@@ÈÒŎÒk„mLUŽlŽU„¯nV°šš@°ɜb„ÞĠaÈ»ĸl‚š„LVUÈ@Ċ@ýUm„@@ÆVĠ¯Þm„LƯޏƒ„Ñ°VVwšJ²»ÆԚVlŤÅV™¦ĉ°ĉĖċwÝJzVxll²IVVVþšX„¤źœV°¦„VĊ@ÆbÈmǔLĸĠ¯Ģaô¯ĸmÆÛUƒlÇĸk°XyĊUǔV„ǩnmV»ƒa@ýnK°n@l¥@»ż„Ċ¤m皃@£ČU@mƒmVkÞUƐ±²¹°‚ĠwÅƑŃU¯™›V¯aÈŁšƒÇ»™ġn_°xŎKlxœklx„@Þw‚„„@Æm²b‚DzLlkšWXať¯ĊaœÑšK±w@wƒUÅçV±Uk™@@„¯š¯xƒU™±±UU°ōxVxÅÔō°ó¯UÝ¦óbÝþƒ@ĉÈóUV‚Ux„„@VŽUVÝwÅÈǎóVkk¯JǐkmmL@„™KÇx@bkš™@U°ķ²ó`ƒš™šmn¯°ƒUwlÅkUƒ`™¦ɛô™Žķz@ŽÅnÇ°U¼¯KmVk²ƒJƒ¼ƏÞķôš¤ULƒ@mnğ`™šÇnUxÇ@Ûÿ™U@ƒƒkŻŽ@x@móJkŃ¥VŹĉóÒĉlċ°ķ„Uƽ܃@›x"],encodeOffsets:[[99720,40090]]}},{type:"Feature",id:"6230",properties:{name:"甘南藏族自治州",cp:[102.9199,34.6893],childNum:9},geometry:{type:"Polygon",coordinates:["@@ލš™nKlnšwX¥WÝXk˜xÞUnƒ°aĊVnUUKlÞĶWXnĠ¥ô»„™@nmVL@¤°™Vz„JšanU@aÆwna@k›ƒU¯šyX_›aĉb™ƒ„wƒéXkWwÅaš¯V¥mƒ¯UƒƒI@ƒš@„mšb°aÈçšUš¥@»‚knwɜƇ°I°ÑÈmVU™¯Xa@w‚W@wšV¯Č¥l¯Uwnm@k˜aUaóKkk@™Ça™b@ŽÒWa¯IÇxÛam¼™VUƒxÒl‚@zÝÒ¯bÝaĉVĉwDŽW›zJ™mJn²mܯUƒ¯ĉ@ġ¤Åb@²nšmlƒ@@Ž„„U„ƒLVxšV™„U¼Ålma™b@ƒ°™l@WIUƒ¯@mƒ™@™™ó„™„@U›zţyƒXÇU™ÇVUUVLkbWakVWmUbkkƒKUÆ»nƒ°Knk@aƒUVmšnk»l¯Ģ›lw@_kKVU@ƒnaƒ@lUk@¯¥mV@kmbW™b¯Åõa@mkU@kƒÇŽkU@›`@™óó—bl¼Uxƒn„¼šlVȄx@blVkVVnƒ`XÈġÈ@ǃK£ÝJmUUnUĖmlU„mKUn™VÅaUw›Uĉ`¯n¯wW¼nxVŽ™š@bĉnƒ‚kIċŘkXUŽ±Ò™xšÈ@ŽX°`l„œV˜IȯĊV„ƒšVVan@VašUVażVmšblkÈW„ƒWIXa„alL@wVb„„V„¦lL@lĠ™n҄U‚nk‚šL@ÆÞkšÞšK‚bñþW¦Û„ċVƒ„ULUºkÈlŎUxÆxÞUUxšÒ‚x„@XbšL@lÆ@„ÒlXVln@„bm¼ƒJ@„Ån„šƒx@bnšĠm„xVXmbÈè@ŽĊ£ČW˜w"],encodeOffsets:[[105210,36349]]}},{type:"Feature",id:"6206",properties:{name:"武威市",cp:[103.0188,38.1061],childNum:4},geometry:{type:"Polygon",coordinates:["@@±¯¥@klwU»ƒƒÞÝmwKm¯™™ç@™kVÇUL¯lVUKġ„ġm@a@U„@X£°l°LŎÇ@aōVÝw™ÔƒKUŽÅš„WJ¯lm@ÛVWa™@klĉUmaƒLUanaƒ™ƒk¯J„™™±KkXóÜÅxƒ²Ç‚@„„nUÒĊb°@™ÆkL™Ž™XÇÆ@xÝn—xWxţ„¯¤ƒI@Æn„ƒVV„VlU²Æè„V@x²x™L›ÒĉbŦ°Wb™Xklބš@l¤šXĊ`„wl@ĢÈŎm@bšnV‚Ubƒ„@șÆÛLƒèǚUÒŦlĸ™`°ĮʟÆǓbĉôϚĊƚĢnŤé΀ÑĸĀĊ¦„@@l°lœ¦Ȯ¦ɆÞĊKŤ™ĵĸů„»mŁyġ™ķŭ@Çɱȭ¯mƧUĊķnŁŻ»UaU™˜ƛɞÝƨů"],encodeOffsets:[[106336,38543]]}},{type:"Feature",id:"6212",properties:{name:"陇南市",cp:[105.304,33.5632],childNum:9},geometry:{type:"Polygon",coordinates:["@@šÈÞ@l`UmVƒ¼œŽ‚@nnÆwVlnVVa„LVƒÈ_‚ÿރ@n„a„xÆ@„lš_š@VxnK@llLnxmÈŎJnbUxšI°Žl@n¦‚lÈIlmX¥„k°@šk‚J„k²é˜@klaUaVaU@@ÝnIWnmnx‚k„ºÞ„„aV™°„V@nw‚KšxôbÞ£šVšU„bšþšLn»mƒVw„IšJ°Ž@„nb@°°I„ġUkÇKVƒ™™@ů»lƒ„Lnmƒ£@anK@Ñ܍n@»mL@£™yk„UUmbUÞÝ@kyÇbó»™XUxƒWVzb±mÝbXaƒwUamL¯»@wUKVwm¯ĵJ°ÅUWVk„KVk°wÈVšVуlUšƒ¥škmVamknƒUw¯¯ƒbċ¥ÅKƒk™Kk„™VċVk£kKVw‚Ñ„a@kóyÛ¯ÇVk™ów›š—Xō¥Ç¼ów™Ž¯U±‚k„ƒ@x›IĉÒÅVmÈnšÜ@n°„bUbÝV‚ŽUnnJ¯Į@‚m¦nV܃@„„L°JXb‚Ñ@šaÈb@šllôLVb—b@lmnVxk°ċ¦U°™Ž@xX@xWbš°UVÇn¯Ò¯Jɛƈmxl@¼"],encodeOffsets:[[106527,34943]]}},{type:"Feature",id:"6210",properties:{name:"庆阳市",cp:[107.5342,36.2],childNum:8},geometry:{type:"Polygon",coordinates:["@@kw‚ĉ—»VamƒƒV¯wƒIóVkl¯™Km™Vō¯ÝWkL@bÝKō¦@Ž™„@š™Lx›@b@l™a@km@@l¯nm@UaÅ@ƒ„óWUXm¥™nƒw`@UUxķôÇ°ğ¦@„VJš_n‚‚IVŽnalxkX„JWn¯šnVƒLšxl¤nnVbklVX@xnxmV@bUK@nm@@xƒV—°±aÅnƒŽkUWnUaƒx@m™n@ƒ¯LƒššmUĀlU@lV@blLUblxklkIÇx¯°‚UXbšaVŽUnšV@°‚LUlnbšX@`°nVmbnÆmV‚kLmK™¦UŽ@X„y@kl@U„°K@¼XbW„ƒš@b„WnLVa„VšƒVz@xlVČ¥lbUxލlV„U@nÆWôn²™VJlU„Ƨ„LnmÜLXa˜n@mœw@wlUlV²mšblwšVȃlLލ„±@lVnUlxnkma@mškšJ@kXV‚U@mn@š¼VXUƒVƒlLnmVbôaVnWV»ÈUl°È¯ÆIn›ÆU@kk»mKkÆġk¯@»mƒk—¯@óÇlÇ@—Vykkl™Uml¯Þ™@w"],encodeOffsets:[[111229,36383]]}},{type:"Feature",id:"6204",properties:{name:"白银市",cp:[104.8645,36.5076],childNum:6},geometry:{type:"Polygon",coordinates:["@@VKUȚl@šè°šnŽ‚LnxÝބ„V¼kx@l‚¦²°ĊóĠ„™Ċ»š@ÈxšaĊxlwÈVŤa@¯²aÇ£ƒJk£lƒnUÞ@°šô™@y„wl»lIX¥Ǫnw@ÑÞWla„ÅlL@ƒUwĉakƒl@ƒš¯mwna°J„V¯nUVÓÞÑm£²óWaUƒÇ@óÝUçV»ÈkkW@¯‚xV@XlK@wX@Vmm_@wÈݙKU¯ÇwVwÅK¯VƒkƒJ™™™XkWVaƒImŽ¯Uk„ÇlVšœĀV°mxóšk„@¼ó„WxĉÜU@Ub‚zÛJÇk@‚ÆnVlԙ@kŽ„x™ô@ĬWL¯ƒƒK@aÛImm™@ƒIUaƒ@™™UŽÇêU¤VÒÇx¯ÒV„šš™lk@Wbĉ¦UbkWV_‚y¯Lƒaó„kŽ@b@nmbkx„°"],encodeOffsets:[[106077,37885]]}},{type:"Feature",id:"6211",properties:{name:"定西市",cp:[104.5569,35.0848],childNum:7},geometry:{type:"Polygon",coordinates:["@@„a‚V²wVJV_@„LlanÅllŦçÜӚ_šlnƒWaôk„xUš„bmV@È°lèšnk°l¦„`@nnL‚@ÈlÜIyVaV@ĊÛXwôƒ@»lƒô™nwU¯›ÿU™Èklƒ°Vn„JUblXšWšš„I„l°U„ƒVƒš—@aVVVmnL@„lƒ„UUw‚mkƒš£„bV¥VUVwۂƒlaÇÝރmk£ƒLUy¯L@WlkKW_XaWƒ—mƒ„ġU@a™k™‚ƒakXkmVwmŹVƒU™b™WƒónmwnWW£„KÈnV¥ƒ¥„ƒÆ_k™lW„bU¯„V°aôbnaVwmaōInÇmwkK@kmLUw™@™`ƒkÅ@ƒwƒb@m݄ĀÇ`U„ƒKUbmUUkÅxmm@›„»nUVk_Ý@™Ç™¦™VÇè¯b™aƒn™@@„„JV„°Žn„U¦™°ÆbXxWl„êƒxš„ĊaœbW`™zV°œ„@lmbÅx@bmV™bƒI™`™¦@ÒUVUI@ƃL@bš¼@ššŽ@„šlmxnL„°ULƒŽƒÞğޛ°kLUŽƒL™°™xVŽ„n„KVƒl@šzX@"],encodeOffsets:[[106122,36794]]}},{type:"Feature",id:"6205",properties:{name:"天水市",cp:[105.6445,34.6289],childNum:6},geometry:{type:"Polygon",coordinates:["@@UyȍVƒVUnn@ƒVU„`UblzšJnk‚@Vb„KU„°l„wš„„W°„nkVŽ‚UÈlš£°V@n¥šV„kl™kU˜±U„ƒn™ƒlw¯UkwmKUlmkUmnkym@ō@U„mWÈU°l°anlJškUKlU„¯Èm@kmWV»kkÝLUWUx±b™@¯ma@ƒ¯™IƒJUxn„m¼™K™ýƒa™V™Uݤóa™wLmxU@¯ƒUšƒb݃ƒ¹lmwmnXŽmJ@ÞV@UbVbkblŽ—@±êƒlI™l¯@ƒlW¦knÇJkm¥k@¯™Jmbóa¯bƒUV°ƒakXlšÅ`ƒ„„¦U¦ÇmƒLX¤mXnxm‚„ôšXša„VźUnŽUxlnlW„bššl@bĢV„ƒ˜nX„WbX`lLXk@Ž°KVz„Kl¤„nÞ݂Èkb„‚܁"],encodeOffsets:[[108180,35984]]}},{type:"Feature",id:"6201",properties:{name:"兰州市",cp:[103.5901,36.3043],childNum:5},geometry:{type:"MultiPolygon",coordinates:[["@@lW²LššƒŽ°I„l„šmbVb„KnbĊVlkš@XbÜU@Žkn°‚XIƒÆ™V„LšÓÞxŎUlôƒ„b°KzU`lXVaĊ¥Xal@šk™™Uƒ°ÑÈwUтV£ÈéVšš„@Vb„Jš@nnÜJ@b„L°„XK@īšóƒwlš@kÓmUÅmK@mƒ_k¥l¯™mkçǯ@nUƒaV™ƒwólXbm„™k™`ÛÔťèkkmÆkbƒK@U`UI±xUƒbWlX„mbVbÅÒólkƒƒIWJkšƒ@ƒz—KŻ¼™@™xUx󎃄¯LWb@ŽÅ҄„±¦U`nbťĀUšVb„LšŽ„U"],["@@ƒ¯lwna@mōȯK¯kW¤ƒ@@V@bĢnĢƒVLU‚°k"]],encodeOffsets:[[[105188,37649]],[[106077,37885]]]}},{type:"Feature",id:"6208",properties:{name:"平凉市",cp:[107.0728,35.321],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÆLUxÈxV°šLÇÞ@xn`Ü@X@nĊŽÆwnJmwUx‚aUkšw@V@w„aVmlLXÝl@X‚VĢmV°@nl@UUUWK@w„ÿVI²Òlmš@nÝĊýVV@nšJ°„„šUłm@kV¼nK›ĢȤôK„blnKllVk²aĠ¥È¯ĸóVw@V‚_„xšmn¦VWôX„ƒÆ@Vbn@°m@kn@@lšb@k‚aœ@‚wšK@™šƒ@UlKVaƒWX™W²¹lӄw@_°›n@@_lKōķW™@ŽmLUWƒn™»Û@›l_Ç`ƒÛmm°ÅbWb@š—VWbƒUUKDŽÅaġlmkUġlƒ»—Lƒl™Um¦@Ž¯U™¤ÇkVUml¯ƒƒX™ƒƒx¯kVƒƒLUa@ml™IkyVaƒ_UV@„mmUVU„ÇŽVzUxUVU¦ƒa™¤l„nVxƒVk„@ƒmKUnUU@b™˜U„ƒ„","@@@Žż@™mlkƒġk"],encodeOffsets:[[107877,36338],[108439,36265]]}},{type:"Feature",id:"6229",properties:{name:"临夏回族自治州",cp:[103.2715,35.5737],childNum:8},geometry:{type:"Polygon",coordinates:["@@š@ż»˜L„y„@l™XI„Jl„ôkÆÑUanaWƒXkW@™yk@U„ƒLƒmUšwš¯„KVlKœ¯Ġ݄݄VKƒ¯mKnw™k@ƒ™@™™»@a„K@ÅVJVU@њ¥š_Uy¯š@£UKmn@‚ƒšó¼ğ¦WmĵXݎkŽVLmVĉU¯bm„ÝV—wWlXÞW¦™xkmmL™šÝŽœ„±U@Vގ™š@„ÅÈW°X„ܼƨyUĮnŽWŽnXÝxUx°lVXJlôV"],encodeOffsets:[[105548,37075]]}},{type:"Feature",id:"6203",properties:{name:"金昌市",cp:[102.074,38.5126],childNum:2},geometry:{type:"Polygon",coordinates:["@@šĢȼ™„Çł°bœU°šV‚ƒń‚ÆǖŰnšÆ„ōĬǔaʠůĭš_kķÆ¥VÑș„çÜKšÅ@DŽƒVaU™m@aōnġÇk@ƒxĉ_™Wk£™@݃±KÈ±aÅnƒ@ƒÝxƒ@kw›lkwōL¯wm`"],encodeOffsets:[[103849,38970]]}},{type:"Feature",id:"6202",properties:{name:"嘉峪关市",cp:[98.1738,39.8035],childNum:1},geometry:{type:"Polygon",coordinates:["@@llĊx„¦šl™¦š„kVVnšJVbǖV„kôV˜a„bnaWw„UXmmamUXkWKō¯Xm°™™»ĉÇ@UVƒK™ķkǼğb"],encodeOffsets:[[100182,40664]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/guang_dong_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4418",properties:{name:"清远市",cp:[112.9175,24.3292],childNum:8},geometry:{type:"Polygon",coordinates:["@@lǯkÿƒaV¯™VaÈU„¥ÆDŽIlxšmnb‚Uœxl™„Uôl°kš„„Wl„š@ô™VwUanUl@„xVkšaX¥‚kU»„aš¯±@kka@ƒUwmUkwƒJk™˜„±k@ƒ™™L@ÝWUwV݃—xÇU¯ŽÇX@m™Åƒ@@yĉ£VmUwȗ»ÇšUn„lUnWU¯`Ukƒ@@„™x„Ž@bÇxX¼ƒVVš¯LšĀk‚ÝLƒ„¯@VŽƒĀ¯lnĊW¦kVÇôkUDŽUK@ţ™U@a™™ó܃UU»ƒ@™¦k@Vx„KVb„n‚š@„Æ™„l„@xšƒbWšnlU„lxÈlV„È°Æ„@¼™„@x„šWxœŎ‚V„šK°„š¥ššnƒÆkŎ@ÈÑm™„K@¥šk@™ô@„nôV"],encodeOffsets:[[115707,25527]]}},{type:"Feature",id:"4402",properties:{name:"韶关市",cp:[113.7964,24.7028],childNum:8},geometry:{type:"Polygon",coordinates:["@@W™Xk±Ñ@ƒUw™mUwĉwlmn@Æwn£mkIš¥ÇÅ@¥šaƒón£nWWwš£V`Þ@šnVml@xô¼„IV¥ƒkUmkamUkVWwÛ»móƒ£UVÅKmn@x™@kbmm¯a™Xka›VĉaUb݃ƒ²—‚lš„IlxnVVx@„lb@l²™°ƒbV¼lW¦™bUlƒwk@mVVbUxóš™@kƒƒX™ƒ¯lókƒVkš›wVma™nkwƒJÅȃ¦ÇVUbšŽU°„blĀ°ŽkÈ@x™¦Æܙ°@„°„¦óa™VUôlUlbXl@nÜV„„nKlŽnIVÞ°Wš„°U@bnm@¥šIVƒ²Ulƒ°VnalzXyl_Vyƒ¦lƒœLlxš„@ŽÞbšKm„knVWanwƒÑVwČº˜@n_ÞV„aVŽÜIœl@„˜KȚ„VJ@aš£È@˜™@km™„aV¯W@_ƒa¯KmbkÇkLmwƒ@Å¥"],encodeOffsets:[[117147,25549]]}},{type:"Feature",id:"4408",properties:{name:"湛江市",cp:[110.3577,20.9894],childNum:6},geometry:{type:"Polygon",coordinates:["@@@ƒkXƒ™@a„UUċlk„Jƒk„™@wVJXUWk°W@nKnwlUlš²ƒ„blU@‚lI„l@„XbW„šxnm@lW@w„wU‚JX¯VU°`ŎóˋkÝÝkÅ@ÇmğÈřmw™aĵV›xUہ»°™ĠǷnýmóX¥ɅĵҏÇ@°²ĊUĖ±ĮU¤Ç°™Ā¯ɐnżUĊĊĬV@脎@ԃÒU¼l¤nƒĠb„êVĠ°Èy„zVaV‚nUÆL„ašbVl„wÆ@"],encodeOffsets:[[113040,22416]]}},{type:"Feature",id:"4414",properties:{name:"梅州市",cp:[116.1255,24.1534],childNum:8},geometry:{type:"Polygon",coordinates:["@@„‚nԚlW¼x‚¦@lœVl™lLkè„a@zš¤ƒĖ„¼UxlnUKUbÝlU¼lb@„Vx„V„klJÈwV¯š@ĠlÛĖšnƒbkšÆźÞƒUÈôklmšL„¥‚LœW˜„„™nKUkVa°V„x@IVV@x°bUk„a™a@mV@„@y„w‚L„ÑUwVUšV„‚„U‚bÞVVann‚@XwÇÿš¯²aVamkXaÆ»@»nw@¥›UXaƒkbWa¯KUw@¥m@kwmLU»UU™J@kmU@UUWUƒ@ƒyƒanwmçÛl¯ƒŽ¯UƒmKUmƒwVkmÝXbW@XWÝbƒk¯@±‚w@»U@W¯Å@ƒÇ¥UƒU@ƒƒ™IU™ƒakJƒĀ„ꃰšþƒXkamŽ@Žƒ_J°m‚@X"],encodeOffsets:[[118125,24419]]}},{type:"Feature",id:"4416",properties:{name:"河源市",cp:[114.917,23.9722],childNum:6},geometry:{type:"Polygon",coordinates:["@@°VlmX¹laĢÒlm„@„„šVš£‚‚@¦Ģklynn¼lW°z„W„„°VbÈV@lÆbnn‚JškX„šVÆašÅ„W@™ƒUUw@ƒkaV»ÞkVaVLkmVwƒ»„ĕ™£@yƒblçkKkš›U@k¥‚wX»™kmӃ@Wn¯‚I„`@nlb„W™ý„¯ƒé„ÿlI@™XUmWUwƒ@@UJU„Ç„mKUV@x™„ţk¯¯LWƒƒnUxK@ű»Vwa¯š@¤WX@ŽÛ¦@¤ÇIȼWxXŽƒ@Wx—w›ŽUnVbÅèmVa±²UWl@Žk„lȄ¤nôܼXxlUnVlbVn„lU¦ƒJó»@wnkmU™‚Ý@U_™¤XxmXm¤„ô™b@¦Èƙ¦lJn"],encodeOffsets:[[117057,25167]]}},{type:"Feature",id:"4412",properties:{name:"肇庆市",cp:[112.1265,23.5822],childNum:7},geometry:{type:"Polygon",coordinates:["@@l@š¥„@V¼„Vôۚš@bšV@ŤVLȃlVÈólUX¥mĉ°k„ÿU°@„ƒÞKl™ÿ°KU™„UW»Èw@aƒšw@ƒ„@nm@w›£kÓVUVn„Kš™k¥™£Vamƒ@nkKkbÆǫma—kmLU¥™UmƒÛwmVU™mUƒJ—ÇaUxÇIn`mb@Þ¯b@„nJ@nl„U‚V„lVU„L›W¯—Û`Ç_¯`mš¯I™bĉWċzx±J™xš¯ÆUƒƒ_k@™šƒJ@Umb„šXôlLš˜n¦@¼ĊxlUXŽ˜xUbL‚Ġ„UnVĊwlšUš„b@lW„X„‚m²˜@ÞWxXš‚Unb"],encodeOffsets:[[114627,24818]]}},{type:"Feature",id:"4413",properties:{name:"惠州市",cp:[114.6204,23.1647],childNum:4},geometry:{type:"Polygon",coordinates:["@@lbšW°bnnlaš@@wnmÆLVUkÇlƒ@Xk‚V²±‚bnUÆçUaVmœ˜xXw„@WXwÇ»ÈJ@£Ü¥@XW@£°™‚bUx²¼@ƂLVw„mX„°K°Ťlšƒ@wVUnLȃVƒVIky±wkƒKU¯ƒÅkƒ™XġÑۃlwUwlm@m„nKWašÅm›¯óÇmğb¯alĉUwķbmb@lÞÒVn—šmĀŹ@VŽƒbVŽUnmakLm`@xĉkklVÔVJVn—lV„UnmJmaLUbl‚™zmŽkL™a™‚ō@@zš‚V¦UŽV²kJ„nÜU@˜VXUŽL@„lJƒL@bݤUnVŽ—b@xVnlK²„Vx°V„xlI„lkVl²k¤@n"],encodeOffsets:[[116776,24492]]}},{type:"Feature",id:"4409",properties:{name:"茂名市",cp:[111.0059,22.0221],childNum:5},geometry:{type:"Polygon",coordinates:["@@‚LnÇlk„KnkÆL„ƒUm™ÈxlUœJló°n@ššanŽš„„a@ƒ˜@X_@mÝóóU@a™aU¯mL¯ƒƒkV¯™ÇVwkw@V±Ŏ£@™™@šalw±Vk@m„Åm¯™ÿŃƧIÇ`ōô¯_UVW°IV‚ƒx@xkX@Žmn™wXƒWa@ƒƒkkJ@kVƒa±„k™kVmxmL@‚¯XXlWVUI@xƒš„lƒIklVȃV@b„šlW@„@nUxVblVxkôlx™n„‚y„šnIƻư„aXwlK„bVnƒŽXb‚L„¤„k‚L—èƒVV¼ƒŽ²IlĠVX„ynz°KVx°@VlœLlblKœš"],encodeOffsets:[[113761,23237]]}},{type:"Feature",id:"4407",properties:{name:"江门市",cp:[112.6318,22.1484],childNum:5},geometry:{type:"Polygon",coordinates:["@@lUXx°JWnnƚXVš„W„X@„šºVLV¯nU‚Vnb™ô„x‚aXmW™XIšŽUb°xlK„l¯œK˜xXÞ°ŽšXÈ¥Ü@„ĉޏU™‚çš»nóƒVma—x‚¯UÅU¥Ý¯@ƒƒç@ș@çĉÅUmU籃ĉKÝxÝ_ÅJƒk¯»ó¯nmèkǀšŽWxœ¼mnUÜġ°@¦@ƒxƒLkŽÇaVnUxV„™šVlnIlbnÆÆKX¦"],encodeOffsets:[[114852,22928]]}},{type:"Feature",id:"4417",properties:{name:"阳江市",cp:[111.8298,22.0715],childNum:4},geometry:{type:"Polygon",coordinates:["@@°„nKV°šb@bôVÞô@n„VlÒôÆUnlnn@lmkmVkƒaÈkÆƄ™k¥‚ÅÞ»ÆKXkW¥ÅLmÅkamJUkš™UƒVwUmÈbl„K„w‚@@¥Ģ¯VÛnm›»Xw™lƿ™@kbW™—aʵ@óL›l¯ƽ@™ƒƒLn°ƒÆ@nUl‚²kx™b@‚š@šō¤U²@ŽlxUxšÈU°lŽ„"],encodeOffsets:[[114053,22782]]}},{type:"Feature",id:"4453",properties:{name:"云浮市",cp:[111.7859,22.8516],childNum:5},geometry:{type:"Polygon",coordinates:["@@@V„Iš™l@„`V„°Å™šw²I‚wČyĊXša°Jn™°_È`Ü_°˜œX‚KVƒkUUƒVkƒ@mmI@ƒ°a@Ýnam_ÈJVwlĉX@„šlUšómaUmVU°UK™¹@ƒƒWƒXU™™WmÅXm¯IWwkVWlÅLݼÆl¦ƒšÅÅÇl„bUllnknm@kmVmóÅkуUW`—@@„ƒb™ƒm™b@™¯mkô›IkVÇwnš„VƒÅKmlƒLklmȁKƒšVĊK°²„`n˜¤n„U„bWl„xVx™LUx@°nXm`VklVxmnnx"],encodeOffsets:[[114053,23873]]}},{type:"Feature",id:"4401",properties:{name:"广州市",cp:[113.5107,23.2196],childNum:13},geometry:{type:"Polygon",coordinates:["@@Ș¼VxUnĊ¤@z„@šÆ@nÈW°ÈV˜w„ŽUÞVxÞX@ŽšK„šl@ބVaĊbœU@ml£k±lUƒkkJƒw¯UUw±ƒkLUm@w˜aUVmÞ£@a„KkI@ƒ‚KVUW@—ÛVƒmlIU±VU¥™@yğzƧǃƒšƽĠřšÅnī±m@ƒ²¯lƒ°@nÝÆóUll@XnÝVU¦mVV°—„V¼™Jƒn„b@°mbn„ƒ‚@²¯‚¯wVwƒ@@nmxX¤¯L@ŽVLU„m@@l"],encodeOffsets:[[115673,24019]]}},{type:"Feature",id:"4415",properties:{name:"汕尾市",cp:[115.5762,23.0438],childNum:4},geometry:{type:"Polygon",coordinates:["@@@‚„@VxnXWV@š„bVššJ„„V@ÞÅU¥Ċxš£UWU‚wÅUU¥WVUkĊÇnkV`°LV™„wƒƒnU@™„ƒlbĊ¯„Vnalšš@@çkUÝ¥ġaó¯ÅaÅLŻÆUýmy¯ó@ĉÆó„ȯw™ÆXbmLƒ‚@nknVxkx܄ĢҚW„Æl„V°„Ll‚²xlz"],encodeOffsets:[[118193,23806]]}},{type:"Feature",id:"4452",properties:{name:"揭阳市",cp:[116.1255,23.313],childNum:5},geometry:{type:"Polygon",coordinates:["@@V„Ȧ„Æ@X°V@@¼‚x²°@„lÞaWXX@‚aÞWlnUŽ„xVnnL„‚°V„@k‚mĢl@„ak™@mlk°aXƒ±„nwm±™²¯JV²@ƒwW˜—_mƒa„V»ƒU@m¯ĉUф™šJl™„ašbVn„lĸLlƅÛDZwÝ@ĉxó@è™@k™mbƒUĉ°kaƒ„@šmV„„ƒxUš¯KU_mlĉÈVlXUV¦ÆVxVŽVX™¤ĉwV¦ÝÆ"],encodeOffsets:[[118384,24036]]}},{type:"Feature",id:"4404",properties:{name:"珠海市",cp:[113.7305,22.1155],childNum:1},geometry:{type:"Polygon",coordinates:["@@„è@„Þ°V¦VƁ°˜wnb„UÆ»nçƏ@nxܤ²llU°VnÈJސ°UôéšķUklƒô£VVˌKÞV°£n¥ƒ£ȗ™Ýy¯¯mÅkw¯bÇĔğ@Ýn¯ĊƒVğōŁŻƒķJ@Ț","@@X¯kmèVbnJ‚™"],encodeOffsets:[[115774,22602],[116325,22697]]}},{type:"Feature",id:"4406",properties:{name:"佛山市",cp:[112.8955,23.1097],childNum:1},geometry:{type:"Polygon",coordinates:["@@Èb˜Ž„InVVšnUÜxn„šVV¦nK˜lnbÅǬlalL@mn„Ubš¤l¦™šƒLUmUVlԜ¤@xmnVl°_XVVmƒkVmș@kn@VƒUK@°KW£nw@m„@Ux°x°@±„mƒna@¯ƒa„mšIU»˜ƒU¯nUV¥ÞUWmk@Vk¯™Ukn›ÑWݐƒĊÛ@Ǧ™W¯Wݗw›Lk°ƒkL¯wVa™WJXšWnbƒwkVƒ™W@kĊ"],encodeOffsets:[[115088,23316]]}},{type:"Feature",id:"4451",properties:{name:"潮州市",cp:[116.7847,23.8293],childNum:3},geometry:{type:"Polygon",coordinates:["@@°ŽÜknèmx„b„z„@V‚VX@VnV@lšIVVV¼nKlxn@@¦Vx°LXbla„ŽWbœV°£¯™W@nW@™‚aUñVœwWš»@¥ŤÅUÝǓÝóV@ńǎkUVmƒIUwÅVWÇX¹›—@W„¯bkl@nlšƒb@‚kġŽn@l"],encodeOffsets:[[119161,24306]]}},{type:"Feature",id:"4405",properties:{name:"汕头市",cp:[117.1692,23.3405],childNum:2},geometry:{type:"Polygon",coordinates:["@@‚@U±°Iš±n²mx²ƒ˜@œWºXÈÆUVx„JUnlVȍ@ŃôUǔÞVçn»VyĢÛVm@»kaÝUǼóšÛÈķKċ¥X„¥Wwğk™ƒ¯@ƒwķKƒkUm™aƒbkš™IƒšVÒ°Ċ@n„VU¼ƒ‚„bn˜`X—„x"],encodeOffsets:[[119251,24059]]}},{type:"Feature",id:"4403",properties:{name:"深圳市",cp:[114.5435,22.5439],childNum:1},geometry:{type:"Polygon",coordinates:["@@ÞLš„@xšbV„šVšK°™X°Kô¥Vw@anU„胐š‚lkĊl@wn_lKnbVmU„aUź@nÿ˜™UmÝѯUƒbk„@ÆkxŻ@™aÇX—wƒJƒƒ¯LķÝUĕ™ó™ĸóêWº@b²nmĬ™Æ"],encodeOffsets:[[116404,23265]]}},{type:"Feature",id:"4419",properties:{name:"东莞市",cp:[113.8953,22.901],childNum:1},geometry:{type:"Polygon",coordinates:["@@Ŏ@ššblKnšykVa‚KnbnIVmUƒ˜kUmUIUә„ƒçmV@bUxó¦¯LW‚¯š™L™UUƒ™a@w™ƒÝKğŚ™ƾ„„ƨÈĠy"],encodeOffsets:[[116573,23670]]}},{type:"Feature",id:"4420",properties:{name:"中山市",cp:[113.4229,22.478],childNum:1},geometry:{type:"Polygon",coordinates:["@@‚XœÒlmšV°ôÞÅ@m„¯°k„±‚@@aX¹¯VݏÇIUmV¯kk‚±Û£mw@‚Őmèżmô™¼èVš"],encodeOffsets:[[115887,23209]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/guang_xi_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4510",properties:{name:"百色市",cp:[106.6003,23.9227],childNum:12},geometry:{type:"Polygon",coordinates:["@@lklWXL@VšI‚l@XnJn@VUUalk@mK@kny@UlU@a°™„ƒUU@VmaU@Ua@UWw@ƒn@KmLm@alkšmnI‚m@an@VIUamWÅImwU@@a@K„X@JVL„UVmUaVkUa@m„@@Ulmkk°ƒUaVUlKXbVwVIkaVmUk@KVk@a„aW¯m@w„¥laœX@KmaškVmnUl@nxVKšInU@yVaVIV@na°KlxX@@_lmXšUV`VIV™V@„n@lšbn@@WUkValK@²yl@„„VUV@@K°L@KU@@UVaXIVVV@naVkVa@K@UUK@UUa™LWa—w@m@K@UVVƒ@mVUUVKnL„mVL„K‚bVK@UUIk›mI@mUIVK@IUK@VkLƒ@WU@mU@WmUk@ƒI@VƒJk@WwX_@amK@UUWkIƒ„ƒK@LVb@mVmakL@J@bU@Ux@xƒbmI@`ƒIwm@UbmKUaUWa¯UkJWV@XƒJUU¯LUmV@ma@kkamKwƒLUUmWVkkm@aVUUkVKnVVUmXK@UW@km@Ukkm@@W@U™kUy@I@aUUmbƒ¤U@kUmL@bmJU@Ua@wkLWWkL@Uƒ@VaU@ƒLUakKWbkUWVkKkLVLUV@JVbƒz@Vƒ„@ƒVmUU@kVmK¯@VƒU_™VWakVmIUKUaU@@bml@XU@@V@LmKUV„mVUKƒƒKƒbkaUXƒKUL@x@V@l@„mxU¦„V@ŽlL@V@Ln@@VV@„nlKUaV@nLUbmJnL@VWLkbmV„@@L„W‚„XLlx„VVIVV@x@V²blUVm„LVUœK@kWWXUlV@Xl`„LX„l@@VšŽƒn@VnbVš@lVUVUÈVbš@@`UXU`l@@XUVm@kš@xmVknUJVXUbmKULmbx@VlJ@LVbkKUbVLÇUUVƒUVmU@VaUkUKƒVUwmLkUUVVlƒbka™XmwƒKUšVVU@@V±Uk@VWUUm»XamU™bƒKk™`ƒ„™U@UnWW_kKmbUVUVmnUV@„nJVUlšUbU@UV@n@JmI@VmbnVUXlx¯ŽkKmnVV@L@V™bkV™Umm™@Ub¯LmlUƒL@VWLkmkLmmn£WmnKU_mW™š™bnbmxƒ@U¦UJU„@Xmlk¦@‚mnUUm@@Jn@lV„ÔVJnIVW„I@a„ƒÆK@I@aVK„IlŽÞnnl@nl`nbÆX²l@xV„@llbVn²ŽVVl@nn„V@IlW@Un@@kVa°KšnÈmVaVXUlaVƒÈU„VlwôUlynIVašan@lVXb‚Iš@n¥la@Kš_n‚@bÆx@XnJV„nKVz@`VXVšU`@bƒ¦UV@VšIlx„UnV‚K„XÈbšVllšbVbnVn@"],encodeOffsets:[[109126,25684]]}},{type:"Feature",id:"4512",properties:{name:"河池市",cp:[107.8638,24.5819],childNum:11},geometry:{type:"Polygon",coordinates:["@@lLVl„bVV@nXVlI@JVX„mšn„W°b„IVV@‚ln„@nalVUb„nW‚@kVkÒlbVKn²°bUŽlV²@˜X@`nb„aUI@ƒ°wlU@aXJVI@aVK@wUamIXm‚@XUV@@bV@Vm„ImnUUwVaVKXU‚nVK@akƒVwV@nL@UV`n@@X‚lnIUJl@X¦˜V@aUIVm@anƒV@UwnL@VlbVL@KVVXUWƒ„wUUVUka@UVJnUlbnalbVVn@°„„LV`Þ@šXVxV@@bVlUVVbXnWlXnmlš@XXWVXJmbUI@V„llUVkn@@VWV@Vnb„@VXUJVnn`lLVk„a„»lVšLnw@WV@lInw@WnU@U@m‚knUVó„K‚wUmUXUƒU@@wVJVIl@XKVVVbVI„J@Un@lŽVLnm„b@U@Ul@nUš°VUVJnnVJV@„@mVU@ƒ@wkUVwkKWk™yUUkU@alkÈ@lJ@x„Ilƒ@UUWVkUw@Kn@@kmaƒVUl™UUL™ÇƒUUKl@UUmL@aXU@mlUUwmKkUUVKVUƒaƒKUnK@U@Vl@XUWU„KlwX@šb@K‚@XkV@UwWJka@aUwmV@U™@@U@wUm@»kLWVkIWŽXnmV@VkbmKƒLUbk™Va@aƒa@@aVU@aVak£@ƒ±UkVU¯V™UUƒJVƒUIƒ@kxmUmWUbL›w@K@aU@@aVU@Kma@aka@_VWkk@UWVUKULWKULUš@KUnƒwVaUKƒxU@UmaƒL—m@kVmVa@UkƒmI@ƒ@KmIkxU@@K™U@mmakI@VƒLkmWkkJ™_U‚@V@L@n˜xXbšKVb@VVL@V@LUbUlmbU@UUWJUb@VV@@L¯K@LU@UVƒƒk@±z@‚kLUbVl@Xm@™akm@ƒU@UšUJU_™VWŽkn@`W@kw¯LmbU@UJUb@zmV™JULmwk@mVUn™lnb@L›Wkbƒ¦@x°nXŽƒb@bUl@LVlUnlbUJUxWakLUVVb¯„llkn@Vƒ@@nVbUlVbUnƒVUK@IƒW@L@bV@nxÆJnXVbUJm@@bnmJ™nkl@b‚nnK@L„m‚@Xx@VVbV@nb@UVVƒ„¯š@bkV@Vmz@lnLl@kŽVbUVm@mI@Wk™J@UWKkXkl"],encodeOffsets:[[109126,25684]]}},{type:"Feature",id:"4503",properties:{name:"桂林市",cp:[110.5554,25.318],childNum:13},geometry:{type:"Polygon",coordinates:["@@nU@J‚X@`XLm¦Vb`lšVXXWš@VblČnVšŽlanLnmVLšK@_Vaƒ¥@kUa„@VmVb„aV@XVVzlVVK@knKVmX£VKšLlbnš@b@llL@xĊôXaV@°È@¤„bn„V@@Wl_„V„U@W„nVamw„wVbn@„K‚VšLX@VmVUxlV@šnVV_nK@m‚I@Wn@@IšUĊ@@wVWX@@I°VVm@wmU@m@IUƒV™kƒlkUmmkÅV@@aV@@Wn_UKla@kšaV„šlVanb@k„@@KlVn@@aV@nIWW™UUaVU@™kKmwU@UImKk@UU@w@W@‚™k@™UkWƒ@mk_W@Ua@a™ƒƒ@—¯ƒmV£@mƒUUam@—kWakƒVama@UUm@nw@alaUmnUlVlIœV‚™šLVyk£Vm@k@UUJkƒK@kmKUw™KkWK@UXImyVwnI@m‚ƒkUlkUKkUVmƒw@kkJWUÈm@_k@@aƒaW@U„UJUwU@@IWKkƒmUUV@nVl@bVb@bU‚UXƒakw@ƒWUkbkKƒbm@™xUlkLm@@wmKUX@‚™UaVW™XVmU@@UUUƒxkmWXkKkUWaUaUb™L@`UL@LV`UXmK@VmakLVbkL‚xUJUIVbUVVb¯KƒV@Xnl@lVXbmÒnV@L@VWKkVUIWJkIƒŽUamUUbm@U„kU@JUbW@X„WxUam@kbVVUnUJmUUV@bƒU@UUV™@ƒVk@ƒbƒmULV¦U@V„U`VLUL@xVbn@UJ@nWJXXVŽVV@bkxVbUx‚Lšš@x„¦@šU‚lXUVVlULV@@šnŽU„ƒb@xl„nJVnlVknUlVUbmŽU@ƒbVš„x"],encodeOffsets:[[112399,26500]]}},{type:"Feature",id:"4501",properties:{name:"南宁市",cp:[108.479,23.1152],childNum:7},geometry:{type:"Polygon",coordinates:["@@lKnbnU‚@Ua@K„L„ƒlJVX@VnL@bW`Xxl@„I@U„Jl@nV@X‚V@nXV„@lK@UVL@JULVJ@nnJlœVJ@VULaƒLUKƒnmKULVVUŽ@nU„š`lIXlln„K@UlJnb@nšV@LV@lwnJ@L@„nJl„@VUbUn@l˜n„KnbVŽV@„wVLUb„xVm@LV™VKXLVKVLXU@VllUX@`lb@bnb‚L@ŽUV@bV@@b@Lœx‚KVanXVƒUUmVUUUaVUky‚UUa„ImK@mUUVUkKU_@W@UVVVIUW„UVaVU@UUKnƒ@k@al@ll@bnL@b„VUV˜X@Vœ@@b‚Knblmn@V_@aUalL@a@akK@kVKUKlwUUnV¥VmU_VWVIVaX@Va„alńK@LVJnalL@LnK„wlVUw‚mX@VXšƒlLUVnblaUmVUVwXU@Wm¯Va@ÞKnw@w™mšk„»‚UVW²a@_mW@U@I„y„LVUUKW@@™„LX@VUV@@yVU@UV@nwUUmJka@IU@ƒmƒVkaW@UwUX@`ƒ@kLWUk@mƒkUUm@k‚UUWkUƒkWxk@@VƒK@nV@UVaƒUUJmIkVƒ@UamLUbkVmamLka™@ƒ‚kmL¯WI@wJmwƒx@akU@aUKmbkaW_nW@_U@Wm@a@wkwUKmƒk@ƒbkb›w@mKUkkU@J@bW@kVWz@bVUa›VUx@„ULkJWbXVVXƒ`@œmJUVU@@Lk@WbU@UJlnXlm„Vx@Ln@‚b@K„LX„WJUUW@kƒaUVUbmV@nnV@n@lVLƒVmLX‚mXkV±@kxÅL›šUbJWIÅJ@I‚mXalkUamKkškL±aVwKƒUU@mÞnbWJX„m„@lbmKULWUUVkaƒbnn@Vl@VVV@VƒbVbnLWLXJWxXLV@@VV"],encodeOffsets:[[109958,23806]]}},{type:"Feature",id:"4502",properties:{name:"柳州市",cp:[109.3799,24.9774],childNum:7},geometry:{type:"Polygon",coordinates:["@@ƒwU™„aV@nVaUVklmkUUmmIkƒ@w„aVƒm@™U@VKUkVUkWV@™ƒ¥@w™™KVwUalw@aUUUWWXI@mVIm@Ua@wVKUKV_UƒV@U¥VK„n„al@„Uš@VU@V„V@aVUnVVIVmUUlan@VbXwWƒX@Va@IlVVƒn@VanVVb„lJXIVJlUXL@U@KmUnÑWakU@mkƒJUI@mk™@wUmmUV@JXaWIXWmaUIƒJƒkk@W„nJ@„ƒaUak@›kkJ@kUKU_ƒ@myUóWUkm¥kUmL@KUKm@k_UmVa@ƒk@@UmU@mm_—JWIUVUŽWLUlbVUJÇVUIVwƒKUVk@mU@n@lUL@Km@@l@L™VƒzJmUU¤m@UbV²U`U@@¼Vn@x@Vš@@VnUVx@blbXIVxU@Wl@@L™aW@kxƒLXVWVk@@U@VmLVŽ„L„bUVULVV‚lnLVxkV@nWV@bnKVVk@VL„VšÈVKšVVk„Unb@lm@@LVxUlVX@Vk„ƒJ@wkIÇ@kl@blVVVšzXllLUxlV@x@„UV@nƒ‚U@UImmUIUV™¯mVk@@V@VƒamnUKkm@@VƒIUJUaUUWLk@UJUI@xV@V„VWVnxƒLUômVV„@VkVVVUnV@UVkL@VVV@bVxla@bkXVJVn„`nU@bƒb@bVL@VnJ@„l@šV„aU@@_lW@UUU@Unƒlll@XLl@@UX@°bVWVanLlknVV@VVX@VVƒnUŽVLmbXJ@nllXX@`VXƒlmaXVWk@Wkƒw—J@„VL@J‚bnU@bn@@bVKUnVJVIVVVL²a@bV@@Vl@nUVakalmš„UL@VUL@V‚a@mXl@nK@UlK„L@Vl@@nkllb@š„Vnn@‚šnV„™V°l„šVInwlKXxlU°Žn@@ƒ‚I@UnVlakUJWkUK@anUWK@_ÞJ@U"],encodeOffsets:[[112399,26500]]}},{type:"Feature",id:"4514",properties:{name:"崇左市",cp:[107.3364,22.4725],childNum:7},geometry:{type:"Polygon",coordinates:["@@@JVzšl@V@Xn@ll@VlnX@@VWLnŽUVmUULVlUV@blnUlnXVV„K‚xnLlb@lnbU@Vn°KVV„I@WXUlI°VXb‚VVbnLVan@‚x„J@_nJ„a@wVwV@@a@IU@UU@WKXwWIXKmKUa„a@U‚UUUk@@Umm„albVUXVVKnL‚a@knƒWƒXImanÝV@„V‚LUx²blKl™nLVbklWbn@JÆIXJ‚IVaœ™ÆKlw²@lUnWWnK„UUK@k@mmU@mnUVaVU„b@lVXVXIWƒƒK@Lam@@KUwnƒWkkmVIV@Xal@@KV@VUnI@›„_UWWUkam@kkm@ka@mƒk@wkJWIUU@WXkW™XkWWLUUƒ@UakLƒW™XV±VIVWUU@anUWaUK@IU@Vak@@UUKWaƒ@m@ak@@wUkla@mUaUklakwVƒ¯¯@WWUkLkKmaƒ™kLUnV`UxWX@Jkn@bmlƒakkk@ƒb@l¯bm„ƒbJ›b@VXn„bVV@„ƒbƒJUkkKWVU@mœÛVUUW@UVUJWXkVkKmUL@WW@U„Vl@XXKW„XJ@XVlmbUxnnm@UlVnV@XVm¦VJb@šmLkKÇbXblVkn@l@bWnX`V@@IVV@ŽV„V°n@@_naÆVVbUVVbUJnzlVUl‚XkV@Vlx@X„VnxƒbƒKUK@b¯VVUV™L"],encodeOffsets:[[109227,23440]]}},{type:"Feature",id:"4513",properties:{name:"来宾市",cp:[109.7095,23.8403],childNum:6},geometry:{type:"Polygon",coordinates:["@@nVlw„@VJU„„IVVUšV°lU²V@„l¤Ub@bUV@b‚@„b@bUblšVa„KnLla@UnUWmXlJXUlKV@V_U±Van@V£nV‚I„yšU@K@kn@@LVK@k@mnVl@VU„LUxVJÈUVIU‚aVkXKVVUXJ˜In`@nnV@Vl@@„UbVnl`n@VL@LnKlVn¦VlôXV‚nz„@V`VL@llIœll@Vb„b@ƒmIXƒl@„l„IVJnbWXXJWb@IU‚nVVn@xlš@nVJ„I@W„U°LUaVUUaVJVIwlKUalKnb@UnLVWU_@KVK@_šKVa„@VKU¯VLVKn@la„aUkU@maVU„J@k™@Um@XmbkyVaUIUU@KV@laVn@KXKWUkUk@ƒaW™UUVw@aXKmƒVaUUkšmIƒlUU@wUa™xUmmU™¯™U@WƒLUmVIUym@UVmUa@wmw@çm@aWLU„™JUIUamKmL@™aƒx¯¥ƒkU¥U@±„k„UVmKU_mJUbkKm„ƒLÅǙ_@WWUXUmaVUkK™„UWW@nVxkUƒxmL@KkKmbUI@KƒLkƃbUbW@UbUJUXV`UnU¦mŽVVkxVLUL@llL@b@bkKVb@bU`m@knmaL@a›@@U—WVUƒU@amK@akkk@@b@lm„VL@VUVUbƒVVXUJUU@V@XV`lLUVVV@nnLƒJVbVlzUVVbVVnUVVU„"],encodeOffsets:[[111083,24599]]}},{type:"Feature",id:"4509",properties:{name:"玉林市",cp:[110.2148,22.3792],childNum:6},geometry:{type:"Polygon",coordinates:["@@VJUXVVXlWX@V™xVnX@@`ššULWŽUXÅbWK@mULUUmJ@n¯b@l@VULVx„x‚XU`VXXJVI„V@nm`@nUŽVXn@lWVn@b@Jn@nU@Lm`@Xn@WJƒ¦U@@VnL„lV@@Xl`nIlJnkVL„w@KVK@UšaVL@bVKX™lUUKVK@I„VšL„a@U@WšLUlVL@bU@@blb@VlbUxVbXUVJ@xVL„U„lV@VU„bVLnKl„XJ@L‚b@an@VanL@`VLšKV_UWl@U_„a@WVInlVUUUVm@I@W@wVakIWm@U@ƒXwlaVbnI@ƒm»Va@aXaVLšU„»@aVa@k™KkL@KmU@WƒzUK@wU@VWUUVUUKUa@mKmbUK@_nWVaUkVaUaVUVLXKVƒVUVmVI@UkKkLm`UkW@UwWW_„UaU@WakXmK@xUXƒJkƒUUWUk@Wl—mJ@km@@aUKzmyVk„a@kkWVUU¯lmU@@w‚kkmV@Vk@mÅIƒ‚Ukƒaƒ@Ub@m@UUU`mUbWaWmb™X™XKWIXUWm@љ@y@UkIUJUUWLUWƒL@UkVUxW@kaWbKWnXxW¦n„m`XLVlUbVbUx™I@JmLUKUb@VW@@bkL@b@VlU@xkš@L@lƒxXxWXX°V@VVVbUVV@UVVbULVnVJUb²b‚aUb@VVVVInlV@VnXaVUšlI„VUb"],encodeOffsets:[[112478,22872]]}},{type:"Feature",id:"4504",properties:{name:"梧州市",cp:[110.9949,23.5052],childNum:6},geometry:{type:"Polygon",coordinates:["@@VbXblVlLXWln„wVV@VV@UnšWUXVbš‚@VWXa@kVK„UaVaVkšUlyX@Vaƒ—VmUwUaVU@UÈymI@aU°@š™nWV@VaVaw@IV@VmnLVK@kmmna@™„™VbVI@aV@XbW`U„„LUVVx„@VbUV@bl@VLXblJn¦lL„°°@n™@K@UlLnK„a°LWbnJ„¦UÒV„UllLlVnKnbWnn„V`„w‚@@Xa±™n™l@XKV_„WVkVa@kVyUa@wU£UW@UIVW‚@@a—wWaX_WKkVmUULmak@UJUI@±m»™—k@m»VyUIm™nmmwnkUmVaVIUn_mW@»Vk„@VwkmmUXa@IƒaVm—mƒ@Wm_U@mIUWóLmUk@laXmmkUK@UmKULUUmWULƒ@VakU™@Ub@bƒ¼™VUKWb@bUbn¼@„mJUakbWx@„@VXnlJUb@x@X@JUnVVUVmkUJ@XƒbV`k@VXU`™LUK@_mKUbm@@b@„U`@nlV@b„UnbVbn@@`VbUbVV¯bm@@mJXb@bVnUllVXUlbUl@LU¦VVmŽkLVb@b™l@V@XlK@V@nUJUz„°mŽwmLmlXbWVU@UUUlƒIU@VVmV@@¦‚bXbWxX„WlXVWL@LUmkbU@@LVVVJUblzna@WVnš@@lƒIUVnbV@Vlƒbkbm@ULUKV°ULƒ@"],encodeOffsets:[[112973,24863]]}},{type:"Feature",id:"4511",properties:{name:"贺州市",cp:[111.3135,24.4006],childNum:4},geometry:{type:"Polygon",coordinates:["@@nL@xn@lKVkšwn@„alLlaXV@„lx„bVWV@aUa@aUk@mVUnVl„XL@JV@VxVIVƒX@„b@bl@@`ÇnXVlI@l„xUnlVVLkllV„@nmJUxnzWJ@VXLlŽšLVxnL@l„LlŽVI@V@lUnl¤Uz™Kš@„Vl@š„L‚l„Lnš‚b@VnVVU@k„a‚Knxn@VkVJ@ńUlakmWIUaVanm@_UK@UVWUa@klXam™U@Vmƒ™VIXW„@lUVknVlKVLXŽVXšW@b@VlšnnVL@KXL‚Kn@lb@UnW°@Va„X„WVb°aVa@I¯aUkUaVKVwƒaXk@a„a‚™@wkm@alanUVw@alK@Umkw@UƒaUmU@WXUaUK@UW@UaVWI@¥Xa@w@WWšVƒXwƒU@mKUXUWVU@a¯kl@akU@UULmK¯VUVW@U_m`U@@xVbUz@lUbUlƒXU`WLk@mš²šWb@Ž@ƒxU_mƒXmmamLkUkKVkUƒVу¥mIXa¯KƒbmLkK@V@Lmš¯@ƒ¯kKm¥kIWaUKk@@aVUUaƒ@UwVUƒKVƒX_WaU@@bUJUaƒš@šmbnn@lULmKUnU@@J‚xUbUbU@mX™š¯@VŽ@bnJÇz@VUVVbVxUn„˜UbW@kz™VUlUbVbƒŽUL@lWb"],encodeOffsets:[[113220,24947]]}},{type:"Feature",id:"4507",properties:{name:"钦州市",cp:[109.0283,22.0935],childNum:3},geometry:{type:"Polygon",coordinates:["@@@IlVVlnL‚@œxla„al@n„VLlx@x@bXnV@@`mXX`lbnaVL@blV@b„wnx‚I@xXJ°nK‚l„š@lbnKnblUVanKVb„@lUnJVI„VUb@V‚U@m„L@Ul@Xw„llVVXV@lVnlVn„l@XVlK„@@_VWVxX@lb„U„nV@@JlbnIlmnVV@UwVK@U@k°a@mnIVVVK@nXLÆaVWXVK™™@_W@Umšw@UXWWkUUVWUIVaƒUkJ™UVWbUmU@mkUJUU@UVab±aVaUIUmVKUaVUU@VUUaUUU@W¯XWWw„w@k@Kl™@wkV@U@alK@aX@@UmIUWUIƒ@mmkXU`U_WJUnUJmUk@@amLU@UVW@UkU@@VƒbUWVUk@@wmKkUWLUWX@JmIƒlUkkKWKkLWU@UKWa@bU@@a@_UKWƒUUUmJmw@nV_@ġğKóLmbU¼VÆ@xUXƒ@Um@wklVnUn›lkaUV@„lV²WVklWXXbWlkVkIm`UUƒLƒUU@UWƒx@XU@@lWLU@kbUbV`UXllUV@bmb@LnKVbULm‚šnVVIV`X@"],encodeOffsets:[[110881,22742]]}},{type:"Feature",id:"4508",properties:{name:"贵港市",cp:[109.9402,23.3459],childNum:3},geometry:{type:"Polygon",coordinates:["@@n@VzUJ‚nVŽ„K@XšVš°nVVnšwVb@xVV„knJl™VVUbn„WL@bUxVVXš„bl@lVXkWƒXwWaa@¥‚@nUUUV@„JVkVVV@XUWanknK‚xnƒ¯VyVI@m@UkL@W@Ušk@aUalKnUUV¥@KVkkaWVkUVkUm@aWanI@n@°aUUVaUa@_m@UamaƒV@akU@mV_@ƒa@KWIkƒmLUKƒaUVU@ƒkƒVUK@wUIWVUaVwka@Uka@aV@@aUKVk™K@X@Vƒb™KƒU@JULVLkVWšUL@aUK™b@VUL@LƒxUKmlkImJk_@WU@ƒkmK@UV@„¥XIm@@Wn_@KmVm@@I@aUmkXm@UWV@mn_@mƒUUJWIUWV_WƒwU@mUknVVmxU@@VUV@zU@UVW@ƒK@šX@VLUVƒKƒz@J@VnX@`±bUXVƒ¼™lšn@xmxÝL@‚Ubn°@XWVUxUVVnkbWVXV@Xš`ÆȄKnƒlLVanIV`nLVUlƒ²ƒV@V¦„l°¦„w‚b@šnKnLVbVJšIVƒXK@b‚n@ènx@xVbUnV‚"],encodeOffsets:[[112568,24255]]}},{type:"Feature",id:"4506",properties:{name:"防城港市",cp:[108.0505,21.9287],childNum:3},geometry:{type:"Polygon",coordinates:["@@XV@X°°U„lxkbVlVb@nkbVl@xl@@b@n„‚XbVL@Vl@UbV@@JVLXbmV@bVVUXUJU²šW„XlKVb„@VVXKlXšWlXXWV@VXJlI@x„l@nlbn@lln@lbXalIVK@ƒVwœUVb‚U@aXylUX@@aW@U_UJmU™nVKUamL@Kna@aVUkkVWU_ValaV@XK@kV@@W„wVXV@„V„KVVn_lJlUXkWaXWlkXU‚±kU@ƒVUlbœkVmUmlk™¯Ý™™W@mb@¦VxULm™kJUU@ma¯wƒmkX@VóJ±bUVUXÝWk™lWXXlƒxUaƒbƒIğ™Ç@U@mVUKkkm@UJm@XnWV@x"],encodeOffsets:[[110070,22174]]}},{type:"Feature",id:"4505",properties:{name:"北海市",cp:[109.314,21.6211],childNum:2},geometry:{type:"Polygon",coordinates:["@@VaVLnK@IšJVwUaVaUkWKn_mƒX¥WwXm‚LXalbU£UyV„Å@ݙwm@™°l›LÅUƒmk™mwÛaƑLÝUUm@ȣƃV_„Ó@£UƒƒUVƒ„™¼U°W̄™ÞVbXbôx@b@bmV@ǃ™UÝ@@ĢU`m@ŽnxnIVV‚VX„VL@`@bV@@aXbVL‚@XVlKXLlLVl„knJ@I‚WVXXKlVnL@xl@UVVX„a@UV@VlX@VUV@nK@bl@nVVIVmXIV`V_lWnn„@VJVXnJ"],encodeOffsets:[[112242,22444]]}}],UTF8Encoding:!0}
-}),n("echarts/util/mapData/geoJson/gui_zhou_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5203",properties:{name:"遵义市",cp:[106.908,28.1744],childNum:14},geometry:{type:"MultiPolygon",coordinates:[["@@@UnUlJn„w‚JU°VL@bnVšU„wlJ@XƒŽXVlU@klVUJknl„UllL@bUJ@xULUlƒ„UblVkblbnw‚UXmla@„wV@VK@L@UXaVKVLXWƒUVa@U@Im@@W@£UKUakKWIXU@al@@llUnL@W@Un@@VlUV@VIUanKl@Xb@lmxVb@b°bb@nlJVVnnJ@b@L‚V@ln„@LmV@Vx@blnVK„nlJXIlw„J@҄b@nlK@Un@UL@VVVVUUUVK„l„@VUVL„J@UVUUw„@Wm@™„UV„ÈVlbUb@JšLlŽX@@x„„ƒLmŽk@@nlx@bUJUzVJ„@@LVxUV@bWxnLnVVK@_‚K²xVbV@n¥@aVI@b„@l@Va„Knb@n‚`n„mmý„W@ƒU_šwV@VlVV@Vn@n„˜@nI@Jn@°¦VaUU@™„mVVWVaUńU@aVKnƒVbVUmmU@a@kUw™m@aUUmUUJ¯lakU‚aXaWUUaVƒkk„amkmUnVlULƒVlJ@XU@UJWUUw„k@aU@WbkWƒL@U@WU@@XUKmV@aUVwUĕUJUamUUVUÑm™nIVJ@kl@XalJVn@KVLœ¥@UWIXWmU@mVUKnUWLUKUaWUUKVU@U@anUny@UlUkK@w@a@aVUƒ»UkVw@Wmk—JƒÅmUUVmwXalLXWWUnam@XkƒJ@UVU@U@W„@@U@I@Wl@Ènlw@KXLWb„lVUkalKUU„VVaV@@wnIlaUmkUƒKWU@KkUkLWaƒKUUWUn@VƒK@LnnWJUIƒVkUWVnV@V™@@XƒK@VUIUJ@IWJkX@VVJ™IƒVkK@I@UVaUWk@m„@wnUWKk@mxk@@„lV@b„xmb@x@VUmLkUƒJ@nVV@b@VkLVbU`¯I›l@™U_UW@UU@™™ƒK¯wm@™xƒL¯¥kIƒ™ƒ‚@bkbƒ@Ua@ƒm@kkW@XVbmV@ŽkV@bWbUbV@„¦ƒxXlmVk@ƒ¦™bkaWL@KUImK@wUK@VUI™b@bmK@LÅy@akXW@kbWlXblL@ŽULUbƒ`@U™kUymX¯@mšUJUUJƒL@Lm@@WX@lU„VlšXll„@l@Èk°V°Ž„X@VU@UVll@XUJVXUVm@@VXLWlnV@Xƒšk@mVULnxV@@bm‚kL@VWLUbU@UVm@ƒb@ķ¥UnmJ@UUVƒkkJUšlÔU`UIW@ƒ°kLUlUI@WVI™U@mWKkXk@ƒ‚WU@bXšW„@J@xX@l@LVl@xšLVxXX@x‚KnxVknb‚KVV@U„L„WlXU`@nUlšX@llVXšVU„KlkUKlI@anKVLXKVaUIVWV_VK@VnLlU„»VKVL„m"],["@@@KlKkUUVVX"]],encodeOffsets:[[[108799,29239]],[[110532,27822]]]}},{type:"Feature",id:"5226",properties:{name:"黔东南苗族侗族自治州",cp:[108.4241,26.4166],childNum:17},geometry:{type:"MultiPolygon",coordinates:[["@@VV@XkV@bUbWJU¼Vb@Vnb@bš„@J@bƒL@LV@UVƒlUI@a™KULVb@bkJmx„šlLVxknVJk„‚xnKmnnL@bn`WIXlWLU@UxVbUVmKV„XI@JVIVJ@U„L@Wš@@UmUXUlV„UVJXImm@K„L@UVmVXV‚„LXblKlV@LXV„LlVVnkbmJ@xnXl@šbXa‚@Vana„ÒšL„m‚VnIl‚Þ¦°k@b„@@lV„nJlUnš‚VX_„@lVlK„šV„UUxVLVWVIXJšUlnnWlI@KUaUUVKn@VaVXV@na@ƒmw¯@mUkJUamI@lk@@am@@I„ƒUmVImUUw˜™@anUVaUU@LU@WaWUXWW„wV@VwnU@L@ynbl@@X@a„J@nW@@Vn@„lVLlxnI„lš@@UWKUƒnIlJXIVllIVVš¼XK@aVI„V‚@@bn@VKXLVKVVVInw„J@UWI@mX@WKnI@KmU„UVJUL@V„KW@@k„@aU@@W@InJWUXwWI@Wƒ@¯wkaVaUIl@nŽValIXWWI@UUm@anwWkXWWIUbk@UJmIUamKVUUUVVama¯VkIVVUlKnXVwX@@WVaUUVa@IlƒaVmƒkna›wk™UU@ƒU@mUVƒšUVwœl°LVbnJVU™¯la@mX@@UWKXU@aV_V@@JlkUƒ¯@V™nK@km¯k„U@ƒWUW@mmƒU@™kmlU@wkL@WƒUkL@VmLƒJ@b@V@bknUUVK@UVKUK@Uk@Wa@LUVVnUbmVk@@UU@@aƒV¯K@U@UU@WmUL@aU@WV—w@ƒ˜I„xXll@UX‚K@KXXVJna@wWaƒ£naUKV„m@UU@mUmalm@@XkVm@U@VƒLmWU@kkWxU@@bVV@VkXVlƒVƒ@UUk@@ƒmI@KUw„m@UmVƒUUwU@lwkV@IUa@mUaVIVKVa@w@U@™UJkb@n@bmJ@XmlVUxWXkJmUkUUVW™xUlU@ƒaULUšmbU@@‚WXkmƒL@xUV@nUxÇm@„XLWbnlƒnV‚nnUV˜U‚nVVz„@lbUVVlULVb@V@nUJkwm@Ux@bWbUK@UULka›JbƒU™U@U@lUK@XUJmn™J@bU@UwWa™x@zkJWnUJUUVšVV@bXn@xVb@J™L™m@X™w@`@bkb@VmXUV¯L@mW@@n@V@‚ƒL@K—IW@@aƒaUx¯@U„m@XbW@@L„V@bnVWVkKUzlV@bÆa@lnI@VV@@LnVVKUaV_VJVbnU@bn@‚‚nX@yVIVxXKVLlUVaXU°J","@@@KlKkUUVVX"],["@@UUVUkUmV@ln@VXVK@K"]],encodeOffsets:[[[110318,27214],[110532,27822]],[[112219,27394]]]}},{type:"Feature",id:"5224",properties:{name:"毕节地区",cp:[105.1611,27.0648],childNum:8},geometry:{type:"Polygon",coordinates:["@@UkVƒ@k‚W@Xn@@K„KVIVVIn™°@nWVzšl@V„_VaVK@kKWaXklaX@lW@bÆz@KnL@ašaVJ@UVL@xnLVJ@LXKlbša„¥l@nUWk„wƒ¥U@VaXa@amLkUƒKmƒ¯kƒmkIUaƒKUIWƒkKm@anw@mlwXIƒmƒUk¯@a@amUƒ`kkKWVkxmUUak_mJmw@w„mXUW¯X›_@WnI@aVwkWWýŃU@WLkU™aUbVV@lUVVnm@kUmV¯™kK™LƒwmVUUaWV™aaWw¯wƒÈ@VULUVUUƒK@nWJkI™l@Umxnbm@kbUJƒa¯bUbVxmLUV™aU@VUUWxkVVV@bUV@XWbnlUbƒbUJlbUV¯b@z„`WbXnmbƒaƒwUwVWUƒbUxmbU@Uam™@Vƒk™VaƒwVaUƒWI@mUKóz@lUlÅ@WIƒb@xXxml@XklULWKUmwUa¯KUXWJkaULmKkLWbkKUVƒImƒƒWa@kUaULƒW¯LƒK¯@kbƒL@b™x@J@bmnnlUšlzU`U@@Uƒb@„m‚n¦°bU„Vx@bkVm¼mx@mk™mVV@bkxVn„aVV@bU@mL@b²`lIVV@lXLlš„bVxn@@bl@XllIVšnbVšn°°wlbXw@mVa°lVnU@mš™VLVbn@@b„@@WVnUV@Xlxn`VznJVb@L@bV`V@šUnwšU„@WUXKV@UUlmUUlaXalLšm„bšIVbnJVIlVVaUUnWVXn‚VL‚k@ƒnWnblnlb²x„xVKVXlVXLVW„LlUVJna@wVL„¼@JVX@`@nnx@nWJU@Vx@XXKšŽUblxUš°„LVKVVlL@KnbVUnJ„IlUšƒnKl£VW„x„IlJ@nšVÞUVVnb‚VX@V_°lnK","@@@UmWUwkU@Um@@VkL@V@„„‚V„VkV@nbVa@ƒ"],encodeOffsets:[[108552,28412],[107213,27445]]}},{type:"Feature",id:"5227",properties:{name:"黔南布依族苗族自治州",cp:[107.2485,25.8398],childNum:12},geometry:{type:"Polygon",coordinates:["@@‚V@IöalK@UV@@KUaVIVVœLlaVbVWnX@‚@LnUlxl@naVLXVVaVU„J@lUUanWWI„@VlV@Xbƒb@V„n@VmVVbk@kU@V›V@X„J@zn`ULW@kK@_WVUK@LUb@Jlxn@nnWlU@@b„x@XVVU@UbVb‚@n`VI@VVLUlUIUV@KmL@VV@XIV@@lVLVmXV„@WLXLW@U`šnkb@Vl@UL@VVV„L„llX@`lIXb„J˜IXW„L‚aVL@ŽXXW‚Ģ™b@bmK@L@°@Vnxmxšn„K@xVn@VkL@V™Lƒakbl`VnnxVnUlššV@@VVXV`@šœk°JV_UalK@U@aUU@m„IlVnK‚V@U@wnaƒw@akU@ƒl@nwl@XLmV@xnƒl@VXUb@V@JlL„UšJUI@UlWUƒnLVUUaVwV@XKWkXJm_@amKnmmLwlƒUIlmUwkKƒ™nwlI@aUaVKšL@bVJ„kVUU@@K„K@a@I™ƒ@ama@UUaV»XIVa@alU@WUU¯IWVUbkVUKWLUwUJ@zmWm@@amVUaUIU`VbULmU@KU@@UmJ@kÅb@akUVylLXUmU@aƒU@KX@Wan@Vƒ°@Vw„b@bX@˜J@L„K@@U@mX@@n°KVUnW@Ula@a@_šx@WšnšK@IUa@wWm@aUUU™VVVIXmlI@yšwXbVxV@@ašInmVI@WVL@k@VšV„V‚aœIlbVK@VVLXa@aVwn@lxVI@m@UUaVKUkVUkaƒ@UymUV—VUmmU„mmkXaWK@ƒÈnVw@mVU@w„KlnXW@V@naV™VKUk@KVIUWƒ@mk@KXU@Um@@lVƒk@UVJna@UWaƒL@a@ƒXa@kmmVUUk@mkkƒamJ—ImJUUmIm±aUUkambkamVUU@VlbUbVVƒxX„WVUU@VUakU@UmUV‚U@mnUVVnUbVJ@b—UW¥kLVamVkUaWJU_UVWKk@@nl„UVVJUXm@Vm@UnVlmbnmJUbULU@@UUKWVIWxnJVb@xUL@bUJWIkxƒbkb@xVJƒbmU@kW±LkKUkVa@a¯am¥ULkalÑlKXUWƒXƒaVakImVƒ@ka@UUƒJ¯aƒX™mmb—KWU@wUUƒaUa™KmU@UXlWb—¼WLUKUb°„UlVbkbVL@VƒšƒJ@nVlUbUXmJ@VX@lbUbU@@bWb@VnLVJ@bVVUz„ŽVL@lnL@b™VVVULmKUk™Jkbm@ƒxVb@V—kƒKVnnV@b@ŽWXU‚„nV„l‚VVXVJUXlVXbWV@VU@Ubk@@KWbUUmL@JnXV°XJ@_‚`UbkXVVlÆkbƒ@VLXVV@‚V@k„KXX@`V@@n"],encodeOffsets:[[108912,26905]]}},{type:"Feature",id:"5222",properties:{name:"铜仁地区",cp:[108.6218,28.0096],childNum:10},geometry:{type:"Polygon",coordinates:["@@°a@aÈbVUlU@aVKnVV„VUlyX¹lWVa@U™VƒnUVU@m™@mUl@„mÞw„@‚xnIVbna@KVI‚J@kwV¥ƒUXÇVkVW@kkKWU@aXUWmnIVa°VXbmL@VVbnVVVUb™VbšJVbVKXkVKVanU@aWnWUWa@U™nk@mVIVK@wXxlLXbVJVlKœbl@VI@mšaXalVV„VbX@@ašalnkx@b@V‚b@Vnx@bVVUXn¤WXn@Vl@Vlzn@š`@I@KUU@ƒV£namVkXa@aVK‚nnU@anVlKƒa@UUU@amk@»kƒU¯@aš„VWnkWmkImU@akaVm@»VUV@UKnkW¯XWlkUKnIWaš@nmlIXmWUnwUwWm@wULmaUJkIUaƒaWa—klwkwmJmU@bkJ@XUJ¯W@XbWbUKUkWJUUVKnn@UmmXUWa@mU@@UI@WmXVykwm@kaULWwU@¯ƒlKUUVU@mU@UkmaUbmV@b—š‚xVnVUJVnƒ„@Jn@@bl@@knJVblInV°@nx@„mbU@UWUbm@ULVVVb@LkJmXkm™VWIUJUXUKVwƒV™UƒŽkLkUƒ@W`Um™kVmIUƒ@kƒ@@a¯lÝ¥kmJUƒn™KƒÑmbUb@Wb™ak@mWU@UbƒUVVkLlbUVƒkXaWK@LkxÇmk@@X@J@Vƒ@@X@VUV@V„IWln@mbXVWXkKWbnxVUnV„ƘInl@XUxVl„¼UV@b@b@xlLkV@VmzmV@b@VUVVLXVVbVLXKmVVLU‚@nnVWXXJ@V›¦UK@LUmkIWbk@@lUImJnšVÒVUnVVbVIVĖUxV‚@bnUVL@WV@@X@V„KlXXaV@@bƒlVxXVVIV@@WkI„UVKUkVmlnnŽƒbllU„VbXVWbblVkb°ŽVInVVV@bšnVx@l@bnVVnUŽUam„UL@bƒVVÆUbUXU‚ƒn@šVVUb"],encodeOffsets:[[110667,29785]]}},{type:"Feature",id:"5223",properties:{name:"黔西南布依族苗族自治州",cp:[105.5347,25.3949],childNum:8},geometry:{type:"Polygon",coordinates:["@@VL@Vl@@IXW@kVUVbnW@XlKVVnU„VlL@b„aVbƒb@xX‚°ÔUxV@kbm@VxkxWJœ„V¦ƒŽ@ÈnšVKšxWXJmV@n„Ò@xVbn@@blLk`VX@bššla²JVUlnn@U±lw@wnw@mlwVIX@@m@klKnk‚a„KnwmmXkƍVm„Uš¥l@nb°n@„aVwVmVIVnI@a„¯@mšU°ƒl@@VnI@JV@UV@b@IUbVJmXöºƒzllUbVa@aXUl@„U@llLnKVaUa@UmK@UšwV„bnKV@VwVK@UXƒV@Vbn@‚w@U„WnX‚@„a@m„I„™@UUKlaUaVk¯ƒVaVLXK˜»XaWk¯mƒkğwmW@mIƒVkwƒJUIšÇVwU™UkVKkƒm@UkmU@WÅwm£Vƒ„m¤¯IkJWa™_™lUbmJzÝJk„ƒUÇVU„ƒ‚@bU„Ýn™m¯LUb@`mL@VkL@VƒUmmk@UU±Umka@kUƒ@ķymUkk@mmkÝmUaUakImV@V@VÅLƒ¦ƒJUXmJXšWb@n°Æœx‚¼nV@LlbUŽUbmL¯@ÞbV¤nbVx@bUVlblIœ™@KVVUnVJUn@VlLUlmLUUUxmK@I@@VW@@bU@UJmUkLVVUl@b@V"],encodeOffsets:[[107157,25965]]}},{type:"Feature",id:"5202",properties:{name:"六盘水市",cp:[104.7546,26.0925],childNum:5},geometry:{type:"MultiPolygon",coordinates:[["@@ôyVL@nXJV„Ub„x‚bUŽlšU„@ŽšnŽVbV@naVw„a‚VUXVx„x„bnaWmXaƒ_@y°aVUkaVI„aVamkXa@WVU@aUUlUXwVV@UVšbVUnKUwVa°a„bVIlan@manw@VšklJXI@m„LVVVUVK@U„ǃk@KUa@UkaVU@UVWV_XWVXVWlLXKlLXaÆKšwVL@akKm@Uwƒ@@XUVk@VUI@wWK@aUV™I@UkK@ƒmL™Wƒ@kImJƒUÅVmkXUW@UJkx@nmx@xkxV²m@kmUV±Ikb™™@aUWl_kK@am@Ua@wƒÑ@mnUWIX™wULm™@DŽU¥›ƒXIlwUwn@laU@Vw¯ÓW@w„aUaƒb@akKƒUmVUUkL@WmXUaUV@lWX@Jk@@UUKULmLUJmzkKmVX°VšUnWKUL™ƒƒL@mU@UnVJ@b@„UV@Xƒ`m_@l@@bmbXJmnnš@°˜wnn@ŽVLX@V‚@nVl@nk@@b‚l@nn°WlXzW`XXVKnUlxVbUb@‚V„Xb@Ž‚VxÈbVlnbmn@ŽkVUL@„ƒŽmLUVVL"],["@@@ƒ@UmWUwkU@Um@@VkL@V@„„‚@„V@VkV@nbVa"]],encodeOffsets:[[[107089,27181]],[[107213,27479]]]}},{type:"Feature",id:"5204",properties:{name:"安顺市",cp:[105.9082,25.9882],childNum:6},geometry:{type:"Polygon",coordinates:["@@lL@bUK™xÅLWbkKWLkKUXUWWXU`UX@VUVlb@VVb@L„l°xXx‚bšbXUVb‚VnU„xšKlL°šnUlVn@UmVU@kUUVašblVXKV@ƄXþlXUxnU@mVK@_@ml@UU„@šblU@KnLVyUw„@@UmkšWVw@UVK@VXzVK@n„VVUUW@kVJnlaš@nKW™kaWL@U—™õb@JU@mU@@_WWƒL@lUU@WUUK„@lakÅUUlWVa_@`WIU¯mW@InKVVXa@Ll@VaV@@UXUWakUVWUIUW‚UkUƒƒmVXW@@amUUm„L˜l@UUa„wn@lašIVlnLVKUUšU@amK@kUKƒVyUU@aUImK@UXa@aV@VakaW@@UnIVWVaUkƒb@mWƒX@Vxm@UaU@W„@VULUxU@mLƒaUŽ™x@VnL@VVbUbmLkK@kƒVk@WV@bUbVakk„yõ¹nWUIVa@J@aVUU@@ImJ@Uk@¯„™V@nƒ°@bmJUUJUnUxƒbm@¯Žmak@™¦ƒVUnŎWlnnmxƒLbmlkL@l@nWVnlÆU„VnIlJ„@šXnK@„lL@VšJVU@bXL@xVJUl@VU@W„@Vxn@"],encodeOffsets:[[108237,26792]]}},{type:"Feature",id:"5201",properties:{name:"贵阳市",cp:[106.6992,26.7682],childNum:5},geometry:{type:"Polygon",coordinates:["@@nŽlLX„VJ„LVblJ„n°ln„„LlVnKlU@nUUa@WlX@l„n@‚Vb„@la@a„„šlJ°¦„Kšwn@°x„LVkUmmwUmk_la„bšK@UlK@UUm@wƒL™mnwmw@U@¯@KnL@aša‚ġXWW@UKbƒKWX—JƒIWakJ@_kWƒkƒKUU@UVKk@@Ula™mV_X@WKXKƒ@WUUnUK@kU@WJU@@UnK@LVUVJVkUK@UUJm_@UaVaV@UU@Wƒw@aV@Xkmmm@kw@IVa@KVLXU@`lLX@VKm_@yƒI@WœU@UlVl@UanU@Uƒm@U„aWaU@Ukƒ@XJmXVbkV@ŽƒIUVUbWUUKmbk@kwmV@K@mWUXUakb›KUUUJVb@LU@@VkL˜š@VXKlbXšmL™@kbm‚UI@lVXUVƒU@mULWy@UUL@VUx™Xnl@Vƒ@VxUzmK@LkV™aƒ@VVk@@n@`UL@nmV@bmJ@Xœ`WX°WVƒn@xnxnIl`VbnVlwXUlLl‚„_nV@b@bl°„V„nWJkx@nmx@b"],encodeOffsets:[[108945,27760]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/hai_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"469003",properties:{name:"儋州市",cp:[109.3291,19.5653],childNum:1},geometry:{type:"Polygon",coordinates:["@@஼jpnr’``ŽpRVHʘ̤žZt^JÖA˜[†CâlTébQhRPOhMBcRSQiROE[FYdGNOEIH]MgEAMLLIAG_WMCSL@ED]PCLYC[ZIHgjSxJTMbHNEFCMEE_HSDFHSLECRNSFDRICHNADGPI\\RZGIJTIAHLDQOHG`GTNCOIC@eIGDWHIS[kiE[FMbECZS@KKS[FDWsCeRuU_DUQNOE[LKGUBM¨EDQP@HWHGDImXƒCog_~‹I_fGDG|QDUWKBC\\ore|}[KLsISBHVXHCN`lNdQLOnFJSXcUEJMCKSHOUMDIm_‹DI`kNDIGEYFM\\YPEEIPMSGLIKOVAU_EBGQ@CIk`WGGDUM_XcIOLCJphHT_NCISG_R@V]\\OjSGAQSAKF]@q^mGFKSW^cQUC[]T}SGD@^_ˆaRUTO@OHATŸ”"],encodeOffsets:[[111506,20018]]}},{type:"Feature",id:"469005",properties:{name:"文昌市",cp:[110.8905,19.7823],childNum:1},geometry:{type:"Polygon",coordinates:["@@€hIJ¤Ī¯LQDaFßL[VQìw€G‚F~Z^Ab[€¹ZYöpFº lN®D´INQQk]U‘[GSU©S_­c‹}aoSiA£cŁ¡©EiQeU­qWoESKSSOmwŸćõWkàmJMAAMMCWHGoM]gA[FGZLZCTURFNBncVOXCdGB@TSbk\\gDOKMNKWQHIvXDJ\\VDTXPERHJMFNj@OwX@LOTGzL^GHN^@RPHPE^KTDhhtBjZL[Pg@MNGLEdHV[HbRb@JHEV_NKLBRTPZhERHJcH^HDRlZJOPGdDJPOpXTETaV[GOZXTARQTRLBLWDa^QAF`ENUPBP…\\Eji`yºEvåà"],encodeOffsets:[[113115,20665]]}},{type:"Feature",id:"469033",properties:{name:"乐东黎族自治县",cp:[109.0283,18.6301],childNum:1},geometry:{type:"Polygon",coordinates:["@@ªVLP`@PEdNRAHOPEAKHEVL`GZBJfvdTAXNNTZJFPrHHNpKTD\\ILHbEVd^J‚OHLh@NNBnHP`\\xH@NBRLJTlŽNv_^CTLd@bNDVFbxdFV€UPBTKOGEOUO@OEBXQP[H_EI\\EbeYa@UO_J‹MEJ_IEDKJUGMDcNUd_FMTEJSGoZ]EIYGO[YW‘gEQ]a@WHEDQKUSDUGAbYBUpSCYNiWqOSQEoF[UcQISWWNMSDe_cLQ_UBiKQOOASQAWgS­ā]ZaŽSPÝZ]XMXSŒ[^oVËNgNKlE RôEø"],encodeOffsets:[[111263,19164]]}},{type:"Feature",id:"4602",properties:{name:"三亚市",cp:[109.3716,18.3698],childNum:1},geometry:{type:"Polygon",coordinates:["@@®ĂhTBXTRPBRPjLVAR`dKf`TC‚NXMTXRJVdE\\FpTRrPjXZMTDVoZABaVHTCLVCRGF@X^bFR’hZXP\\ZHHMA[^wBWXJlW¤EJ[bCTOF‹WWMm@ILMGWQ@DQ^QNWFSHEbF`OXNbO„VNKTEPDTLTCCVTREfvfEHNbRAENH^RJXCFHNFRpVGHWISDOTMVCZeGamaLoLÛD¹¹ėgsia{OųE—Tt‰lɂwr}jŸR±E{L}j]HąKÃT[P"],encodeOffsets:[[111547,18737]]}},{type:"Feature",id:"469036",properties:{name:"琼中黎族苗族自治县",cp:[109.8413,19.0736],childNum:1},geometry:{type:"Polygon",coordinates:["@@bRFnHNbHŒgN@NPEnbXP@bND`NT\\@\\QZb@`@J]V@XhžDpW„nCJGHGXO@CR§FANHVKLF\\MPVR`CvVfQtDPKpGHG@S`WJP~^dSTHWX\\RHTFACQTIAUPOU@MG__IaYSFQK‘NSbORHXCZeTFJg„B`YBMNMFi~IVDV[tGJWXGDQRGF]ˆJrALgESLSAYDGIaFeXQLS\\MKSLSQYJY}eKO[EHiGSaK[Yw[bmdURgEK^_kcSGEOHKIAS]aFSU@Y]IWFUTYlkP_CUOUEkmYbSQK@EMWUuAU\\M@EpK^_ZMDQ^OXwC_ZODBrERURGVVZ\\DTXcFWNIAWJWAYUUFYEWLQQaCIZeDM`cLKRGpanJZQd"],encodeOffsets:[[112153,19488]]}},{type:"Feature",id:"469007",properties:{name:"东方市",cp:[108.8498,19.0414],childNum:1},geometry:{type:"Polygon",coordinates:["@@ºŸx‹JYZQ”IŠYXLl@dR\\WZEn]bA\\S~F`KXaDeTiNO^EEKWEDQXITBXaWaDQMUJOIaTWf@NJV@dSxGZ‰Fu_@WMKAUˆ}AQ@MwG_[GOAmMMg@GKP]IUcaFKG[JSCoLGMqGEOYIMSWMSBucIeYA_HUKGFBLOFGPQBcMOF_@KO©UAtERadwZQ\\@ÊJÒgòUĪRlR°KĮVŽLJ"],encodeOffsets:[[111208,19833]]}},{type:"Feature",id:"4601",properties:{name:"海口市",cp:[110.3893,19.8516],childNum:1},geometry:{type:"Polygon",coordinates:["@@ńZƂtĢ¬æßFuz¹j_Fi†[AOVOFME_RBb]XCAKQKRSBQWSPY\\HbUFSWSPoIOcCOHIPkYCQ]GdGGIFQYgSOAQLK`MFUIGa@aQ\\GGUFcHKNMh@\\OYKAigsCgLSF]GOQO]@GM]HyKSHKPW@Pxi@EMINYREXWRQ@MQcFGWIAwXGRH\\yDI`KJIdOCGRNPNtd\\UTMbQYi@]JeYOWaL[EcICMUJqWGDNZEXGJWFEXNbZRELFV]XQbAZFrYVUBCLNFCHmJaMIDDHXHEhQNXZ_TARFHVB@DTQIRR@YHAJVnAbKFUEMLd\\c^ÍÞ"],encodeOffsets:[[112711,20572]]}},{type:"Feature",id:"469006",properties:{name:"万宁市",cp:[110.3137,18.8388],childNum:1},geometry:{type:"Polygon",coordinates:["@@^J@ZTVbET^JBGLFPTHld]`FLQhcVanx\\\\ZbLHTGj\\FLP~fIZRZPVTQFSVAFJE^NDLEE[~LjsxVTG\\NZZNGlLRRGLJTV@hPZANN^@T\\NEPPbDZXO`d^HSvcJDIV\\XZAJUFCLNP@PQ¤@[ïKLÑIÏ]ÇE±I{uƒ­YśUćFcYUmsVeBSVgB[RO@aYYPO^]@UVaNeDShMLG\\EfFVE\\F`"],encodeOffsets:[[112657,19182]]}},{type:"Feature",id:"469027",properties:{name:"澄迈县",cp:[109.9937,19.7314],childNum:1},geometry:{type:"Polygon",coordinates:["@@T\\GJCXJH@fJDDPNCNJENN^NLHBNSx@DDYbBLLDRbjZTj@`XXTlG^Xr@PJLW\\WLTlWR@HDJTD@X_PO@STMDNTMVV@NLDM`M\\XM\\JNBH[PYZ‡úYzŸ`Ċ\\ÎÝd]c[NKVFLEBaUmBIZGQ@JQSR@CUAEGBQ`SWYRMFgWGCGJCbNnIDGMEDKVAZUEqBYRa^WEUFKYQMaFWXEHIFWMYHCrXVIIiaK@aMCUYNSIISTwXALKH@XWXIEIJQCG[IEQDE_XSBaa[AIPW@]RS[FWS[CD]PEBYNGFSaSyJG]@ugEUDQlGHiBKHUIoNSKqHFaPMICK]UUHIPDJMuCA[SCPIDIOILGAEmU[POPBVSJDREBGS[QXWSGcT}]IO_X@TGHoHOLCX\\ELT@LYTD‚aFENF\\lj"],encodeOffsets:[[112385,19987]]}},{type:"Feature",id:"469030",properties:{name:"白沙黎族自治县",cp:[109.3703,19.211],childNum:1},geometry:{type:"Polygon",coordinates:["@@D\\RV]dTXELnHr]^@LETBBRTHPi^[@U`QTHDJ`MGSogDIPKdJ`WVNHCXHl_DJR@AH`FBVPUJLHKNTJOFFZON[ZEHFCJlMJ_ŒCn`CJVNGPLTNDFIdVTWEIPmRKMc_kDMWGGUTAtJLK~\\f{pqD[LAVXRCH{HC`eŒJ`}@W^U@I@_Ya[R[@MSC_aMO@aWFmMOM@‹haGGMEmaQ[@MESHaIQJQ……MckBIw[AOSKKAMPSDSLOAV_@@`KJRbKRDfMdHZERgAWVsDMTUHqOUr@VQXTT@Tƒfg‚L^NH\\@heTCZaESNObHPƒHeZF\\X^ElM^F^"],encodeOffsets:[[111665,19890]]}},{type:"Feature",id:"469002",properties:{name:"琼海市",cp:[110.4208,19.224],childNum:1},geometry:{type:"Polygon",coordinates:["@@TP\\pATHTGlZDJGAQjE\\Rb@jVBDCN`JZ[NCNHNXbULPrP\\KNbMTLjJJRFP`“pNLZz^FLRHjVPZ@hxVKbHBHMNNJFRlLzGPnNHhIrHHADcPWdUAmEMVQDSKYHY\\EhBN^HpXGNDBNNBnIß‹Å_g{³So]ã@ORO@KMEDIVYB[WJUICudGTc]P_YWaCOOMFS[]@MMYBgOU@ISHKQQkKMHYY[MSHwUit}KF\\KFMCF]EIUBETSROUKTLT[NKTWREfJbCHBZKTFTKh"],encodeOffsets:[[112763,19595]]}},{type:"Feature",id:"469031",properties:{name:"昌江黎族自治县",cp:[109.0407,19.2137],childNum:1},geometry:{type:"Polygon",coordinates:["@@`ZĤd–`òüˆ˜ “BSPGP@VSbQ`‡@]HC~T^SE]N]FkW]E[fY„GGOPaTMbFDYfS@g[MGK]h„e@SSSRW@UVqrPVGNStCXUhBFQGYNcCeLQQaLI@_`@EUwcEaCUaMc@SK]Du`MSkKI‡~BVNL@X`‚EvYŠwHcTU@MIe@SXJbIPNVCRXbWbSAWJCRXFFL]FMPSjCfWb_L}E[TaBm^YF[XcQk@WK‰Z“JYRIZwŒ¹ "],encodeOffsets:[[111208,19833]]}},{type:"Feature",id:"469028",properties:{name:"临高县",cp:[109.6957,19.8063],childNum:1},geometry:{type:"Polygon",coordinates:["@@jD`hNd\\^dZädĒH´Op@ˆùZY\\OAGIMN[[W_NCNMKU@NUMSNCTSP@`O@WSCCI@GXQSkXKX[IK@OWqH]SkWW@_SiiYQaKCAKZaCCw@MTGAMKM]FMMIMDSM_HGHRPKCBGSJJIYH[QOJCHMBDGQJECMTDQKFGTCEGTF`NFEDMFaGSNwIiTGhYJD\\KZODC^@FTKND`XBHKJNKFBNhG^FJMPcHEZF\\QPRjQTAdgNOPgQaRSê"],encodeOffsets:[[112122,20431]]}},{type:"Feature",id:"469034",properties:{name:"陵水黎族自治县",cp:[109.9924,18.5415],childNum:1},geometry:{type:"Polygon",coordinates:["@@R]NC`YL]FoN@V[vBXVFNL@TRZalnVFVP`DlOZkVSXEE_F[EUFeH[NKTgfCbMVU^@P]ZObZP@\\QhATUfAtUasñiāEoI]eYǯ@aKmaeƒWuCºKÜKpnbHbYfUDSNCPJTRAHJTDJSfDNLHXC``VBNGTYCQDIXMDSP@xLNEFRNXBIpVNLXah@RgF@`qOML@LJNSPLbaHAh@Jdj"],encodeOffsets:[[112409,19261]]}},{type:"Feature",id:"469026",properties:{name:"屯昌县",cp:[110.0377,19.362],childNum:1},geometry:{type:"Polygon",coordinates:["@@\\OnVBFKHPJCJOJTDB\\vDINOCGJVVL^JDONEbrGTLpMVJLGjAHGRkVChF@vH^zIbTETMHAZOFC^\\DXT\\EffAP\\PdAV@UIYfS|S@YPICMeM@sC[_A]VQEwyHSMuNcAUlQJMVGMS@mVBZPFO\\CSFQK[LqDMACiUa@[QiFBRIHYCHkGSBS[oSOqB‡IE^QHCRWHIXsHU\\UC}JEjMNAN_ZƒAIhSEYfWDQGaPMTL’ERZTJb``NHV@"],encodeOffsets:[[112513,19852]]}},{type:"Feature",id:"469025",properties:{name:"定安县",cp:[110.3384,19.4698],childNum:1},geometry:{type:"Polygon",coordinates:["@@JjDNdJ\\FbKPXfZ^Ij@RZNaVSc[MsMOHQPDJcLIJ_zCG[HQxWJBHXdENRR@XQFWZQQGOFSWUCI[WCJuRGLXNMPLhCl[Ta@SqGgJMGOmyHkKEQMINMAGaGULgwY@UOGiKQ]EYyMK”oO_QEIIKiNSMa[LqOKOaVMWMGMDY\\_IKrL\\ERT[DEPYOUA@nNTUHINkRBVMdNvGTxzRF^U`BD\\@tfNDNOJ@Z{TeTJZ@VU€cB[OBOeeQT@^OXBJb\\AbWTF`RCJFH\\RDJIJFXW@WLGBKxWTSJJMTVZND@bbL"],encodeOffsets:[[112903,20139]]}},{type:"Feature",id:"469035",properties:{name:"保亭黎族苗族自治县",cp:[109.6284,18.6108],childNum:1},geometry:{type:"Polygon",coordinates:["@@FJp@fxpQ\\ApN\\GNPNBM`HLMrXLXj\\PEHnI@WUCEM\\GTc\\GZYHTPBHRCPTd€H\\K\\@HXi–BJILJJAVNTOZJNtFPC`YxDPWci@IBgbGKaTOIM@KNKrP@_hE@QbgKWUMJoWAQMFEKM@wTONCJWRCZDHSAM_UD_GWMKeCITSCGIQBGXUHQoMEEGWDQIG]FMQBMaFGueFeSQDUSDSKOCSFMLƒUaPWM_PaEGFETMX]RCRR@HXKN@JNnXXEŒSPaDI\\£FkXWIAX]xB\\GN"],encodeOffsets:[[112031,19071]]}},{type:"Feature",id:"469001",properties:{name:"五指山市",cp:[109.5282,18.8299],childNum:1},geometry:{type:"Polygon",coordinates:["@@TCNOLBTLBPx\\AJdl†NR†RIbJTGNF\\@RcIYbmHoLQdKN_fCJYbDRRXKZFVEZVXBXIJBXMdESW[CUYHUVQFQAqsEIMPYMSBUIIJKAIj•GW[@[LGScDOGQOAGSYZ[HSd[HFNVD@XmJFG[OWiWKNqGKN_MAMO[HoM[BoRewo@Y^HpITSFENc`MVCdHNIVCLJFI`NFIŒP`@VZbaf[FFJG`O\\WRFA@PVPFPPH"],encodeOffsets:[[111973,19401]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/hei_long_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2311",properties:{name:"黑河市",cp:[127.1448,49.2957],childNum:6},geometry:{type:"Polygon",coordinates:["@@VÈÞ@Žkx˜nXŽ°VÈa°V@kôw„b‚š„JVškXlVUx„„@ŽlL@xkVV°ƒ„VbxlVUnVxk@ƒ„ƒKkŽVb„Il„@°kVl„@„™lÆnkll@@V„VXƒŽš@V„²bUlƒVlV„U„VÇn@nkJšŽlkVbœ@›x²V@n°VUnlKU„n`@n°bWLnVUblVUVVbknV`°kkŽl@@V°@nz„J@XšxlWXb°n@bƒĠlbXb™bVbƒJ@Všb„a@„„@lbUbšVmnœ@lšVmnIW‚œ@WbÞ@„n@x°@š„ĢaƐéϚnœ„‚lČ¯ĠŻÈwm@ôçU™mm£Xy°UV™›@wÈ£Ǫ¯kõÝçUњ™Uķ‚ƒĢkVфÆšÞU°nŎ¥ČUĊx°m°¦żVƐœx°ƒÇ£@y„UônރÆ@Èĉ°Kô¦šW„kWU—bÇ»@™ÈĕWÇÈ£ŤU@›n£ÆUUKVamanwŃmÝJ¯k@JƒIkaVaUUÇbkaÆÑkWmÝUۙ™Ý@™ƒwnU±ƒ@kkV¯KUkƒJƒ¼U¦ƒšÅ@ówķaķůV¥Uaó@Åwmƒƒ_kVƒwĉ‚ĉmmn_V»™a@U™ƒVwķóƒ‚U¦LǫéóXÇmōLǓÇķxÝkƒƒĉ™kmakbUĶ°@W¼„@bƒšÈÆ@Ė™L„l@„°J¯„mkl¯L݃±L—amJ@¼ƒ„™VƧUó„™UX˜ċb¯ńVbkÆÝI@llx„k°V²šV@Uxގ˜L@b„@b™`ƒšÇzkókݤ@ğ¯Wƒ™LĉǙLmmnċVkbUaƒL@Ž¯„‚bU°ğL݂Ý@"],encodeOffsets:[[127744,50102]]}},{type:"Feature",id:"2327",properties:{name:"大兴安岭地区",cp:[124.1016,52.2345],childNum:3},geometry:{type:"Polygon",coordinates:["@@k›ƒϙmƏêġb™ƒ¯@@wƒmÝ@XV@IlŽl@bUxl¯VlV™bV@ULVlUV™_kx™VVV™ÈÝJ@„¯šU„™lm¯x@xóÒĉ¼m„¯Wƒxţ@Uz¯ƒWwnUwťƒ@knƒWƒ£óVƒUUwğyó¦WI—Vmm™I@±kwÇ@@bƒ@ĉ¼ó@¯wó@¯aó¼›KՃaUwmWUwÅI@aƒKó@Ua™LƒaƒVÅwō¼UUÝl±I—¤VxÇx@zkJmnn‚mbnz™xlŽƒl¯ČkJl™°@„kb„Žmx@x™@kêmVnŽWxôXšxU°„bWLóJnÇWĵ„V¦™ŽƒUUb™b™ÆġK™šk¯™VU±aXmċÑUwĉKġ„k„™ŽVxk„ÇKkbƒIƒ‚ÛXWl¯bƒŽ™X¯K™bĊš„„ÞVƚnŽĸ²lxUŽ°n°òÈb‚¦—xVbƒŽƒ@¯„Vx@¯VķÞČlĊ°KĸŽȘI°¤ČIôŽò»ƨnȰKǬ¦ôWŎÈƨwlƒnKVXmbX`lbšwkVW‚XXŽ„L°a„ƾaĊ£nƒ°@°¥ŎzÞ¥‚»œalwôkƒJ„a@ĶK„£„bU°ĊxźVÈUĠ¥ƨ™VI@XU°x°Ln¥šw°UmwXm݁V¥ĢŽ°@nU@mÆ£š¯lKœšÜw@aÅU‚¥UaÝIkmV²‚nn@Ķ»@Uk¥VKÞ@ÞÛ@ƒkVmĢa@_ƒJómƒǖ¯Æw—óÇa@alƒUwšwĢřšk@wÆWXUWXƒWa™m@_ƒ»ÇéXaĸwVa@ÝKkUWkX‚kšKXxƒn@lĊV@¯m¯nřÆwš¥"],encodeOffsets:[[130084,52206]]}},{type:"Feature",id:"2301",properties:{name:"哈尔滨市",cp:[127.9688,45.368],childNum:11},geometry:{type:"Polygon",coordinates:["@@°`„_šJlUšŽ@„„@V¦°JUšŽnLôlnŤ@@šÈaUÒVbkbl¤ƒzk°ÇVÛô°IlVUVôU„xÆU„Ž@bźĀ„º@¦šb@l²‚UVlœ@°ÒĠxšnXxÆVô¼Þ@Üx²KލlƒVÑ°UȰôlwô@²ƒĸ°„lanV@„šVŎUll@bÈnÜm„wĢ@la@ÝÞb°UXb˜lŎ²ÆškšV‚I@ŽnJnĠŽ°knƒÜbĢwna@a˜kÞKƒĀ„a‚™œ‚‚IVbU¥wĠwkô˜xnLƒċVçkaUƒ±IUmnġW„°WôĉšalƒÞÅĵ¯@W¹XÝaƒb¯a±X¯ºLƒaVƒmkLóƒƒbkaƒVUKVkkKV_@aÝykk±L@ƒÅU@yV_™aU¥ówÇx™@UkVƒn@lƒkÅlwšWVwUkĉmkklW@šašbVwnWWƒ—wWL™™@Ušƒ™UƒÇLšÇmƒ„@wƒJĉƒL¥@ƒÝ_@a¯y„UWw¯ƒ¯Uġx¯aÝXVmaU£ó±›¯nwƒa¯óÅVƒXman™„Uƒ›lUXkWa@mkI„›ğaƒm™IklÇU™„kĊƒƒzkKƒš„lU„ōĬlš™„@ŽnX°@llUxŹ²mKĉVWwk@UbUK@bmVmI—ƒVmwaWxXlWȁšmºšÞÆbUxV@ĵńWÆĉLkWUbƒaWzkbĉ`U„±LklōwUVÝ£™UW`Uwk@mk¯VkaõVX@WbL™K@XƧºWzxƒK@lmX@bkVVÆk¼Vbk@Vn"],encodeOffsets:[[128712,46604]]}},{type:"Feature",id:"2302",properties:{name:"齐齐哈尔市",cp:[124.541,47.5818],childNum:11},geometry:{type:"Polygon",coordinates:["@@Þ@ށĠKV¯a°ƒ@„KVblaČU‚mnnšKĊȚKX„°ŽĠ@Þ£ôllÈy„™š_@a‚ƒ@a—KݍVwU@±™¯Uƒlkw@kÞJlÅUa°ŃČaW—šVôƒƨVšU„ƒ@»nI˜b²Kބ°Klkn°ƒ¯I@ƒƒkšK@ĕÇń™@aƒX»¯@VĵlaÿVamI@aÅÝउýƒĊȗJƒôȁÅkmƑۃ@kxġ@@l™aVk¯»ƒīŹaƒkƒ¥Å¯™JUaWU@@w™aƒ»„KUkÆkUm„UmwÛ±±UUbUŽUXƒwWwÆÝk™lkUanaWwnKl™kal¯ka™ƽa›kÅx™a¯@™amb¯V™lÇwÛĀ™V@x™šmêVƜVV‚aôV„wÈx@šˌx„¦VÞ¯VšlmX@‚ƒL@¯Ua¯LmV@„„°X„ċK™V™ƒ@UƒÈ@‚¥@w—ƒġIU™km¥Źwƒ¦¯lmn@°kxVV@¦óam„n¦l@nx™lĉVóšmx™n™ÒĉĀĊ¼„þ„šǔêÞ°ˌĠÞÒ°ĀɲĀƨźˤȤƨĊ°w@£nymwnkUUV¥ôÑVmkÆmUUVa™mVIkmô„lxkXÞþƒbl„ƒl@kV„ƆƒV„xV@š¼VÒ@šŽUŽšnnނJ"],encodeOffsets:[[127744,50102]]}},{type:"Feature",id:"2310",properties:{name:"牡丹江市",cp:[129.7815,44.7089],childNum:7},geometry:{type:"Polygon",coordinates:["@@U`lLUlVL„Ulb„aô„lKnŽU„„b‚K°¹²W°b„aÞb˜knyUlUkamř²L@m°@lšmš²n`ôÅlK„x„ÜKnxV@„l@œƒ›ÅXyW_k@™wm™ŹĕmƒX™»‚ƒÛ™l°ƒôšÈ„»š—ô˜ô_WW@Uœal»šwU@@wšUVƒš@VƒXI@w‚Ģ͑ÞȻ›aU_@mUkly@¯óV»XmWUXUWmnm¥nUUaWLk»Æ²IÇa™wÅaÝ°¯nUa±a™ƒ™@¦õÆğ„@„™@Åb›xU܁nÇłlb¯¦„ôó»mƒ—@±ƒUk@Wwƒa¯xU„V°ƒxXbǎŁUV™™ƒK@¹ƒKUaȯ@ōݙXƒal™ƒlÛkalÇUǫÇńÇakbÝƆ¯nlš¯Ž@¼™VUx@x¯W¼™Æ¯šmĖ„Ĭ¯ČƒVk‚ķÅmxœ°ô²V¤‚bUnÞW°bĢw°V°„XxƒV°z@bÞ`@„‚¦„KĊŽ„I@xƒŽn„™ÈÈK‚„šV™„@VššXK˜xX„mXUx™a™b@‚kXllĊnVlUx™XkxlÆk„m@U„Vlš@ÈwôxV¦šbU`@zÆV@„²KllÞz@b"],encodeOffsets:[[132672,46936]]}},{type:"Feature",id:"2312",properties:{name:"绥化市",cp:[126.7163,46.8018],childNum:10},geometry:{type:"Polygon",coordinates:["@@ऊþÆÞ@bnJUb‚ĀnblŽĊš„„ÞlĸwǔÈŎKÈnôWǬê‚KV¥„ĸôUxš„@VšbU¼m`nnĊŽĊ„xlUšmkaVÿšLšwš@°»UmbKmݙUšwUmVknKUUl¯ƒKU™ƒUȃ‚™nK@ĠkX±lX„°„L@¯¥@wV_m›ĵ¯Ww™L¯ƒUkōƒÇVU™l›w—V󁱃¯aƒVka°wVk°mÞ¯Ŧřƙl™²™Ŏk™U@ƒmUkb¯ƒķŽ±„ó@kxȯó¯VUÒk„ÝŽ±LÛwÝ@ó»ÅUWw™mğw¯Ñ›@UkV±@k™a@¥ƒ¹Źÿ@aƒÅVƒwóVVUkU¯JÜóÈUl¯„yk£laUaVÑÇb@™ţ@kmómK™V¯IU¥ƒ@@ƒ™kV™Iƒ`@ô™¼„blU„lƒ™bÈb@xÇKkĢɳaÅɆō@ƒŽVƒK@z™@@¥ÆKnÜ@@aۏUw›wnU‚ķ@ƒ_ƒV°Ž@„klVššnULVVÞbVl@°™@nx™n°LŚÆlV„ȃmU²@VmĠLƒx„n¯xkWƒzšJ‚wnLmbXbW°šÆ‚™²™@™Žšx@JVx„L‚Ā²Æ°I¯º‚È@ÒnÈ"],encodeOffsets:[[128352,48421]]}},{type:"Feature",id:"2307",properties:{name:"伊春市",cp:[129.1992,47.9608],childNum:3},geometry:{type:"Polygon",coordinates:["@@ƒKƒ¯kWW²ğl@ŽmLšÇ„„VVš„Lk°VVmLUlVn™xšVnނLnaVŽ¯¼™@™x™KUĀlb™n„`n„Æxô@VbU¦ĸŰĸbôxÆ@„™V¥„»„IVl°LUŽll@²„mV„x@ššÞܚÞVnŽlXÅÒlbÈaVVUblb„J@I°lÞIn‚Æ„mxnbUbVLÅVm¤@œţVǤXÈÇĖ@šÈ¼˜aXVÜaXbWŽnzŎašř„KôbšUlw@¯naÆKnUU¯Üa@mkkVUĊm„™żÝ‚ǖŽ‚K„™°L²lÆI@ƒ¯¥ĉƛVaÞk@ÝVaĠlnUVwƒœómaƒ@™wĉ@™a™VƒxamX@aƒ@UaÅLƒaVWƒ_nWm£nWm_ÅV¯ƒm@m„󤁚ݦƒ¯ÅalmX£ƒ™VWUŚw™mÇ@@IV™„WUw@ašI@„k@wŎ»Wƒ„ƒ™ÅVaœK›Ika@¥lUkUlwÅwVyÈwWU@a¯U°m—Ç@UçƒaVa¯mV»ÅwÝUlƒUk™V@k„mUk‚X£šw°@@ǃaÝIƒƒam™Ûam„¯lğmmI@J™U™l±ÅōŽ—kWa¯VÝa@Þkbġ@ƒxÛnÇm@akkōVōl±škšÅšťŚÝ°¯nUl¯xlb„U°b²„ô‚˜Uœxšk‚VÈUŎ„Vl°„šKXxĶ°nœU`@x°¦@"],encodeOffsets:[[131637,48556]]}},{type:"Feature",id:"2308",properties:{name:"佳木斯市",cp:[133.0005,47.5763],childNum:7},geometry:{type:"Polygon",coordinates:["@@nš„b‚„ÞJ„b@ȯ@™xW¤Vlƒn@lšUVlk„ÞVÆxU¼°nUb„bVèÈ@˜ŽnIn‚@šĢmlUw°™żƒ‚VUn@lnL@VôbšwĊ‚lœ„JķĸĢl„wôwƨxVVUƒŦšxšLź™Èš°`nnĠwŎJސĶwôJ„@¤Xn܄ĸlšn°¼È°lŽ„„Uš‚b„xš@„l@ÞÞÈm°„lôwšL°¼ĸ‚°Þ²nĠ@ôwÞ`ŤI„V„ÒĠU„„@„VJĸbƄ²@°ŽĊKšœ„JĶaĢȰ@ô¥°nš¤‚bČUš@Vx„mUw@a݁ţƒÇ™ķƒ@ĕķīU¯²@ÆmVÑô¯X¥ċç@™ĉ»U¥ÝţKWVÅkUVÝŎUmǍÝx¯aķxÛUóL¯a±óōb¯™ƒÑŃVÿƒ_Åķ„a@UƒK@wm@Van@UmmLVa—@VImmXUWƒÝUřƒKUwÝUUƒkVƒk@l¯X›‚Å_ƒJ¯k™Jm„ÅLƒa@¥U@¯Vƒz¯@ƒ`@¼šmxƥšŏKÛk@±laÛ@@Xm@™ƒ@xƽ@WŎnšˣĕÅ@@aÅ@@nÝbǏ¯@ƒ_U›kUWƒkb™wÝU@ç„Wlw@anIƒ¯lyœX°m°VšašÛšm@„mVwÞK°ƒšXlaXmm_ƒ@UƒkwÝK@ƒVI™ƒXmV»ƒI@aƒ¯ğW™bġaU_¯JU¯ġŽƒ„ĉ„k„ō`±nÝÆk„™bóĊ¯Xƒ‚ĢX‚mVn²JV„lbUè„ČmK—wlóğx‚xV¦UaJ›šƒbƑÿÝL—l@bmbġx"],encodeOffsets:[[132615,47740]]}},{type:"Feature",id:"2303",properties:{name:"鸡西市",cp:[132.7917,45.7361],childNum:4},geometry:{type:"Polygon",coordinates:["@@‚LšKVVnkšbVšÈb‚²U°VnklVlaÈL@anU°ÜmXV`œnôLƒèšxlŽšLX„˜L²ašVVmÈX@ķ˜lnU„Èl`ȹš@ŤŽ°U@x„KnnV„mlnnUl‚lVnnaŎwlVÞ҄@n¦šLVŽ°lšwVk„Lšaގl„n҄š@xmLÞ¤Wnœ¼‚WÈLVVUxlÈô„„WVaU_VKšKXUÆbn™‚nôK„bÞw°bÆWXamVwœK˜™Uw¯WUk„UlJUwVUa™@@kmyzm›ĉw@kVwškƒW¯ÅKU_Vmƒƒ™xU@aW@@kK@w„a@Kƒ@@kVUƒaky°_Vm™kna¯K@™ƒL™wġk@@IÇóX™ƒwVakmV@mwXUWanƒlĉ@ǙUw™KƒƒóšܛNJۄm°@›w—Å@ƒ±b¯Wƒ¹„WVwŹĕ¯kVmōb¯w@aƒwmV™UUb™V™IkaVwķ™xk¼›b@VXXó`󗙘ƒ¼Çó™¯„kŽÜš„š¼WŽn„źĖnššxl@X`WzœÆ"],encodeOffsets:[[133921,46716]]}},{type:"Feature",id:"2305",properties:{name:"双鸭山市",cp:[133.5938,46.7523],childNum:5},geometry:{type:"Polygon",coordinates:["@@™UƒƒUwó™mÑÞÑUÝÝUkmmŃyV¯ī„¥ƒUÿĉ¯mÇkaWbÅX¯aÝxƒaóLmmšÅaWV™LULV`UbƒXóƒkÇVwUUÇKX›»XmÝ£nK@wƒ™mÑkƒÝ™bƒKUl™x¯kU™Km¥ƒ@ÝÑkUōxmbUmkVkmmnkUƒmmƒL@w¯Vţ™@Ǻk_ƒÇmV—k@ĸVx‚VÈ°lLkllšUbōwƒnVW¼nlUx¯XmWUnÝ@™xÝUó¼¯J@LVbkJWnkb™W¯„ÝLUxƒn@‚™n™Ü™b¯U¯n›Wkz„°mJ@bkxƒX@èÞVšxlaX„lVVœ„`°@ȐÞa@mÆ@@bÆ@ˤĖm™Xōƾ@@wš„n@@WÜ@kb@²ÜlŐLƦ™nw™@»„_°@„y°UV@@¦„bÆKnƒšI°l„IÆ`œ°W@k„llUV„ÞVVx„LƚÞVX„WVnnUJ˜@UbnKVnm@Ubn@@x„L@VƒbÆĸ„`UĀƄ„Ò°šŎa²ô°bôKÜVĸw°bÞwȎVnÞōVUÆlXU"],encodeOffsets:[[137577,48578]]}},{type:"Feature",id:"2306",properties:{name:"大庆市",cp:[124.7717,46.4282],childNum:5},geometry:{type:"Polygon",coordinates:["@@mÇ@сǰ¹¯J±ÅÿƒKUw‚I@™wšš@š±Å‚™X¯WanamKx™I„ylX°wƒm„wğKUn±@nVDŽUƒÅkƙ¯Kšmmwš@@¯UkÝaUUVK™mU™lk@ƒ¯„U„`ĸ@V‚mœxVxܐ@bÛ@m‚ÅL@¦š@@y„L‚U„Ŏ@ÆɅɴblġÈL@wÇaša„ƒkkVƒaš»@ó¯_ÝJ™wÇaÅXny›U¯¥Å„@w™bÝa™Lmm@@ƒVUŽlbğVmš™¯Xƒm_ƒ`¯_Ux™m™L™a¯b@mƒaó¦Çk™¤V„@bóJknVx™VXx±aƒLUbVxkLVlLWlƒ@nX@VÅbWlÈnƒx„bWšÅbmŽ@xœbml°b™„XbW„XVmnn`ƒLmšnbmb@šk@mwU@@š¯Jlbk°lbkšmLXxmbVbkllšÅނxX„xVWVVa²VܲnxƒVVnÅlVlƒL„¼šb@xV@XŽVbšIÆ°„¦„lźb„Ĭ°¼Ulšb@kĢ@lw„@ƒÜlnȂƄóȘI„ĉ"],encodeOffsets:[[128352,48421]]}},{type:"Feature",id:"2304",properties:{name:"鹤岗市",cp:[130.4407,47.7081],childNum:3},geometry:{type:"Polygon",coordinates:["@@Þ¥‚™ô£nƒn@°„ÆUn`mXn¤mX„`UX„bÆKVb„@@bnW‚b„wšUšbĊ@šx„@nbšWVmƒ_mm@ó»Um„ŘWXkĠ»²¯‚¯nķšwŎ@ĊšŎK°bĸUnјKȦĠÈbÆknJššÆUĢV°IšŽšVƾƒwaV™ƒƒkÇ¯¯»™mķkۃWm@£ƒóIĵxݏōIğxmm¯_ǙŹš™K™wťŽ„UVUŽƧwóxƒxġkĸķƒIk›ĉ™xóa@UmK@kVmUŻ„¯šVxkŽġn™‚@mmJ¯n°V@bXVÇxUzÆxkxlVkV@¦lbœJ›LUbšÆƒ„X„ō¼@xƒl@™J@bVxƒXUš@JÈ@šn™xVÆUXš‚„W¤knÆb„°"],encodeOffsets:[[132998,49478]]}},{type:"Feature",id:"2309",properties:{name:"七台河市",cp:[131.2756,45.9558],childNum:2},geometry:{type:"Polygon",coordinates:["@@²mŎ_lƒĊƒ„ƒĢV°°IV`ĢbšaĠX„°@b„JU¼Wnš„UJ@„ÞLlxV„„@n`lIUa@K°Iô»ÞVšwÞ@VmnX°WVwmkX»‚U„mŎxVak™lkkKǯUUwÇWUn™U±b—KWƒ™Kk™w„çóK›mU_nW¯ÛmV@bÇKkbkUml¯U±VÇaU™™amlUU™LK›„k@ƒU@mwÛLƒŽƒwkLóÆm_™±™nkŽ¯@@n±KnŚlbkVV‚mz—lWXº@Ķ°"],encodeOffsets:[[133369,47228]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/he_bei_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1308",properties:{name:"承德市",cp:[117.5757,41.4075],childNum:11},geometry:{type:"Polygon",coordinates:["@@lLnlmxn„„IVVlUnb@VVxXJWL@LގVnnV„J˜_@wkmšK„b‚x„wXk˜WXXšKlb²K@nVVVb„L@WlU²„lKVnUJVz@VVb@lżmVUVnbôaVX@°Ub@lWbXš@b@bVb°x„@VxÈLVlšaÆ@Þb²k°@lVUŽ@Xn@VW‚LXb@¤VXšKVVVLnm°_ƨ¤@aUIVa„alkX›°k„™V@„alwUVy„U@k󙰃na°UVUUmUÆw@mkLVUƒWVI„WšLnn@xlVnK„myU@ƒU°UXaV@U¥ƒU@Uƙ@aVUkWU¯ƒaU@WLUV@bkbmKULmKkUVUkmVIUwlWV²™Uml°U@W„LUwVm@UUK@_ƒKUUÜaXw@ƒVKUU@mVIUUlmnIVVVbÈVlKnbVKš@nI˜@nVnwVLVK„K„„˜Vnb@aUIVW@In™°@lVnIš@lWĢ@°UVL@b„@VyUUƒa@w@WUnU@Wǯ™K@UkkJWaÛbmk@mVaÞU@amkWƒ@mXUKkÿƒ£@a„kl@Um°UXwla„al@nmlXnW°znW@aƒwV™@ƒakbĉ¥VmU@ƒIƒVƒUƒJkUmWU™KbmkUaƒKkUVU@KV@@klw—™WaU@kmƒXVènbmlUUƒKƒX¯JkbƒI@JmIUWU@ƒLml@XkJ@U™kƒK@aVKwWa—IWwƒmUƒ@mU@J@UaċU™aUUƒVkI±ƒk@UUƒ@UbVVm@UVKƒLƒlkIWaULUWƒXUJU„ƒ@WbUb@lkXUxm@@JVn@J@b„nƒb@Vkx@bšLU‚Æn„JšaVXnKVVmzX‚°V@_lJXxWXƒK¯bÅamUƒ@lUI›bñJ@LÇKkIÇ`kxWL@„ƒ@@bUVUb¯xWKk„Å„VlULW@ƒŽn¦Ul@I™lmUUUVm@kWƒnkKma¯XUKWmnwVwÝL„mŽ™VUbUVWb@Lnxm„xVŽmbXx›¦@„nb@`™„ƒVƒ@kbƒLU„mVUlkbVXkºmnm@@xk¦šbĢÜlš"],encodeOffsets:[[118868,42784]]}},{type:"Feature",id:"1307",properties:{name:"张家口市",cp:[115.1477,40.8527],childNum:15},geometry:{type:"Polygon",coordinates:["@@k™ġۙal¥@wn@nml¹UWlaVknUVƒ„Kla„@„Ušƒ@_ma@ƒœ¥WwnaU‚wnƒmw@KXaVUVašUnmWUk°™lƒnUVUXWVw™IWVóKUI@WXƒxUU@mma@kUKWLkw@yk@ƒaVkUUċaUU@Wk@Unm@UVmLm±IUƒkJ™kWƒ@a„I@m@U„ƒVƒ„Ula„@VXVƒXmVwnkWKƒKU_k@m¥ƒmX_™JmnU@km@U@KmU™VƒU@U™@Umk@@LƒmW@Û£Wƒka@wk™@aƒI@mmk@mUa@UmUƒIƒwW@aWUƒbU@kbÇ@kwƒ@makVUk™U@aƒm@aU@mxkUƒbƒKUXUƒ±KXVWLUK@wkU@V™@WXUa@WbUxƒJIƒŽ@¦VèVVX@±ê¯KUIƒ`¯UULVx@Vƒ@UKƒIƒVkLmVkKmš@nUJÝbkIUJVXšVVxVbU„VJ„Un™°bV„mlU°„XnK@Ul@lVÈVUXšx@W„@VXšV‚KÞb„n@VnbV„m`ƒUx™kW@UVkL™Km¼@lUnUJVnV„XV@Vm@@LV„klƒIkl@VƒWlŽULWKUL@mJ„@blbUVUlmzUJUxm@UUbċÜk@Ub@VšLVV„¦ôbVŽmšUKUkU@m„„@VlVn¼WbUJ¯@@„°šnIllÈl˜@nXšWlLœk‚J@bkxlxkxlXUlklJƒšXL@bW„n`@nƎXxlL@xl@Xb‚LœKlVlIXblVUbUJW@lX@VL@VVŽšXšJšw„n@WnL°K„bVbl@VI@K„@U@nmVmV@XUWI@aXm@™VUUkWmn@lmUUk@mUmK@UnwVĉ@ƒƒmU_V@XJôVVUšLVUn@šllUnJl_n@šml@XŽlLlw²LVJUL@VmbVblVXmVnlš@Ť¦„nn@܎@bšl„@@XV`„Unb@VlLVb²J‚Xn¥ÆÑ@¥Þ@"],encodeOffsets:[[118868,42784]]}},{type:"Feature",id:"1306",properties:{name:"保定市",cp:[115.0488,39.0948],childNum:23},geometry:{type:"Polygon",coordinates:["@@VbXWš@@UlV@xVLXKWU²LV„VW„L„alVnwV@@b„n@bšVVllUnb„@lxÈ@laV@„aXV@b‚X„x„J‚nV@VVb@nnl@n„J@blšl@„ašƒU_VWUwVUškUm™Ukb±mVwœU@VIUW@UWk„@VU@ynL„m@IV@‚bnK„LVaVmnIlaXwV@@WVL°@@xnX„@V`V@VbUVVLVKnwnL@ll@@_V@VVnaÆ@œKVXÆ@nƒ@wƒKmU—™Wm@km@kÜKXU@ÑW±nIUwVƒ„Kla@I°wU±kškmm¯mƒ_ƒJnƒaƒwW@IVaUama@wƒUƒmU@mVw@aXk@mWa@£km@aƒ_kVmUnWW@¯bƒkUmk@ƒVÇm@@kUU™KUU™@UVUamVUaWIkb@xU@@amUkKƒVkam@@kVUkUWmKmUkLUb@xmJƒ™U@UImVÛVmnUwƒJƒU@VƒX@UWm@Ub°¦UšmxklmX@`ULU@@UW@@xkn¯@makV™UmxUb™°ƒlUšƒbUbƒnUJƒUUVƒa™LkbUU›JUU@mUUUƒJkaƒ@™xUIWJƒUnƒJ@V™zƒ@kb@`@bln@l™bƒŽ@X@š@š„@Xl‚bnbVb„@„„VJlInlšbVw@U„K„l@lbnan@Vb‚JôLn‚UzlV@lÈLVbVK@LVx—VWXX`WxXz‚bV`UXV¤nx@„bVlVnVlUL"],encodeOffsets:[[117304,40512]]}},{type:"Feature",id:"1302",properties:{name:"唐山市",cp:[118.4766,39.6826],childNum:11},geometry:{type:"Polygon",coordinates:["@@„@VVl@²„lJ„UVVšbČVVb‚@@InV„@‚V„nXx˜JXb‚xUL@b„Lšl@VlI@Wnk„KV@VXnJ@I„Jla°I„W„LVVnkmaUç„WVkôaܯ„@nV°wnJlaV@VUnUUaW¯wXWWwna@£UaWKU¯ƒ¯@aVUkKUamUUƒn»‚an™„IVwUWlkš@„LlWVakU@K„_lƒšbÞU°@šy°n„@„KÈkWW™ţ¥ĉōƒkġWUw¯£¯ƒÇwţwƒ@kK@kƒ¥ÝwÅbǤېťV™lW°@ĸ™x@VVVULVLkl@V@Xƒ`Ub@Xm@UWbƒk@ÆVbnLWV@lnXUbl‚@X¯lmU™VkKWLkK@_UK@U@UmmUxmVXLWVULkU@`W@ULUK@XlJXzV@@xml@VU@UX@Kk@WbUK@Xn`ƒXmJnšmškxUVbUVlVVxUbV@nKlL„kVKÞbVKXI°KVšmVUIUKULVxVJVLkV@Vƒ@UbU@WUU@UbUK@b@nƒV@VkLmb@b"],encodeOffsets:[[120398,41159]]}},{type:"Feature",id:"1309",properties:{name:"沧州市",cp:[116.8286,38.2104],childNum:15},geometry:{type:"Polygon",coordinates:["@@@ln@UȄŽl@Vn„l°aX@mXnVlU„`@bln@¤Xb@nWl@bUx@nnV‚„„V@xnbVbUb@J‚X„x„b‚mXa@k„UVwlW„k„KôVm@w™kkK@kl»Èƒm™VKXkla°@XVV@VI@ml@@Vn@VX@V@J„@VxUzVVšš²blVk¦@šĠ@@»š@VK@VÈLlK@XnJ@alIUl„a„VVbš@„n@a„U@WUIV@mUn@mKXml@lL@LnWšb@XV@@a„VVb„V„@VV„IVWÈb˜IÈ»ƒǟlWšaVUÅUƒƒ™Um@kVU™WVkaUwmaóUƒJUU¯ÑU¥mk™¯UaƒKÅnÇyóXmWÛX¯aċbÛa›J—W™ÝU¯»ƒaóóUm@IƒšVVl@bƒLUJWLX@@xšXUxl¤V@V„nVUV„XVbVš@Ž„@@VVn„°VŽ@ţU¯VƒUmƒUWV@mUXƒaƒbUKUwUaÇKn„ƒVk¦Wb@VnLmV@bkV@n„xW`Å_UVƒV@bƒUklVX@VmlUƒx@VVL@x—VWVL@VW@UUm@"],encodeOffsets:[[118485,39280]]}},{type:"Feature",id:"1301",properties:{name:"石家庄市",cp:[114.4995,38.1006],childNum:19},geometry:{type:"Polygon",coordinates:["@@la„@šy@U„I‚m„VXIVJšw„@lb„IVVnV‚@VVœIVVlašK„bVU„VVI„mVa„aV™„kš¯VanwšVlUnb°@lm@wX@@VV@VK@_nWlknwV™¯¥Van@VX‚@„W@U„V„IVxnmÜUnUVJV@„šnI@wValKnV@k‚mU£na@mVk°K„LVa@UU@UƒmknWWkXU@aWW@@km@UaU@@klK@UkaWaUnamm@U„a¯wWU@UkƒL@ŽUn@x™V™lUXVJUb™LmU@aUWUkmKkLUUm@mW—XƒaƒmmkkWUm@@U¯JUUm™kU¯@mKĉxÝwÝ¥LƒUóŽmwkUUUWVkKm™kKmLX„lxVLVxXJ@nVJnz@VWL@`nX@šƒxƒ@kVUUmJmIXx„JV„ƒnUVƒ@UVV„@LUšƒ`UXVVƒ„ƒlXL@l@b@VmX@b™xn°™UƒbkKWLXlW@@bƒK„mKULmakLUlmb@šXb@xmXU`V„b@`lLx@nWVXL@‚°WlXnlb„KVK„XVb@˜X@l_lJ@V@XnŽ„I"],encodeOffsets:[[116562,39691]]}},{type:"Feature",id:"1305",properties:{name:"邢台市",cp:[114.8071,37.2821],childNum:18},geometry:{type:"Polygon",coordinates:["@@nKlLnšlLXUVVlVnxô„V‚KÞ¦ÞxĊwnL°@lVnšVV°I@Vn@V‚lXnl„n„b˜WnXn@VVlKnLVlVX@bnVšKVaUIVWškšU@wVm@¯@U¥VmU_°lšK„k‚w@LX‚Va„U@wšUƒUUKlUóW@UVUœUlƒ°K„wlKU_na„KVnlKkkšWWa@IœJVa@IlJnU@„KVUUmVlaXUl@lm@kXWÝÑnkƒ™±™k@wğ›@@U@mKĉLmVJ@zmlnŽWLUÝJU_ƒ@@šmJkXUVlbklÝ@Ýa™b¯@¯±JÅwġaUU@ƒkU™@mVI±bUKƒL™WUXƒJkaƒLóKULWbUVkKmnk@@bmLUŽƒl@b@mnmJkUULƒaƒbnŽmn@lVV@¦n@„l@b‚znx@`Vz@b„xnV@xl„lbnKVx"],encodeOffsets:[[116764,38346]]}},{type:"Feature",id:"1304",properties:{name:"邯郸市",cp:[114.4775,36.535],childNum:18},geometry:{type:"Polygon",coordinates:["@@„bVKlVnInm‚@@a„kVnK@al@nmlLVUXaVKôL„Klb„IVWšX„KVL²a‚JnUš@lV@„VVĢbÆx²I°Ž°@šaÞbÞ@lkkaVUlWnI@™„@V`ÞI‚VXKmnk@y‚InUĊKƒÇkUUamUUkƒƒ@aU@U™ƒk@WUwVkVJVkkw°a@„mK@UX@VV„LVW@wšwVa@¯Xm@@lUIWaU@UWkXWmU@UwmUkKmn@lkVƒ²™VƒaULUVmJUUUwƒLma@™UmkIUm›L—mVšmx@b™LUamKÅL@VmbkU¯KÝamzkJUb±Vkb™L@lU@WIkJƒzkKmKƒnUalWkkKW@@nkbk@WW¯XUVUJ@XlJ@Xƒ@XlWLkUƒ`VUnaWa„UV@UVIƒaUxUUmVƒK@I@W@DŽU@@U@bƒ‚@nmKXmx™@UxkVWUX„@`VLlL@`™zX‚Ýb@b‚„@VUVkIUJVz°KVlnLlKnL„xlLVVUVlXUJ@nn‚„I@mVUlbn@@Žm„@bV„nV"],encodeOffsets:[[116528,37885]]}},{type:"Feature",id:"1303",properties:{name:"秦皇岛市",cp:[119.2126,40.0232],childNum:5},geometry:{type:"Polygon",coordinates:["@@lnV@Xb˜škx@lU@@LUVlV„LVbnl‚ašLXVVn‚l„I„V„U„JV@UnĊ¦la„bš@nJ°UmƒV@„wn@VU„JVI°bnWlXnWVLVK²b‚akk„lI@aUaVƒUwVUUalaVwnUVak¥šX@W‚kœLVÓm„mUK@_lWš@n_UK@alÅ@ğÅƑŃݍmƒ@їţÇlƒLƒ@¯m™z¯@ÝV™ak„ƒ`@LlVUbkXƒK™@klVXUxƒJmšbm¼V„nVVblLUV@b„°V°XLVb@¤mbXxWX°xXŽVbmVUVU@kbmI¯xmUƒ@Û°óbUl"],encodeOffsets:[[121411,41254]]}},{type:"Feature",id:"1311",properties:{name:"衡水市",cp:[115.8838,37.7161],childNum:11},geometry:{type:"Polygon",coordinates:["@@„KVlV@X°xƒb@VnnmbVŽXblb@VkL@lV@Vbn@@l‚@XX@bWVXlmXnlV„V@@VUbƒK¯LUl@nmbV¤n@l‚LXnlVUV@ln@lb„UlLnV@bV@@wlaXJVbnUVbVUš@VVšLVVn@VVX@@U‚KXU˜U@wUK@U„wVnk@UUWlk„V@a„UVUÆ`X_ƒw@mlU@anUmK@UXal¥„UmƒÈLVbVxVL„a„bVW@nXU‚Vn„„V°UŤV@Uƒ¯Um@Uƒ@@U™UaƒWVUmUUƒU@k£Vw™W@wW@XKƒIUa@wU@@al@UK@_mKXKƒbUU@aVKmš@Xmƒƒ±@kbÇakLğVaUw@a@ƒmkUJƒk@ykw@£ƒWX@lknk@WVkbUŽVnUVƒL@‚mVkI@JUb›I@JXb™XllkLUmƒLmbV`kLƒx¯Lk„›VUV@VôXkVVL„V™V@xƒVUbW@Kxƒl™L¯kV`UnV¦°@"],encodeOffsets:[[118024,38549]]}},{type:"Feature",id:"1310",properties:{name:"廊坊市",cp:[116.521,39.0509],childNum:9},geometry:{type:"MultiPolygon",coordinates:[["@@la„Ušš@šUnL@VWbklWxnIVV„V@X„JlbUlšXVbn@@K„mV@@X°WVInJmn²@lmVbnL@amKV_kwlmX@@LVamaXaƒaVU@UnJVanLlUkaW@UaVakK@IlKUU@an@ln@alKUƒkIVa@a@klaUKUV@UkUV¯šKVƒV@kUmƒU@@a¯ImJUU@VV@UL@Uƒ@@WXUWa@Ukwm™@ƒX@@w@al@@aVIUmVUUUVWUknK@I@™l¥kU±a™™UUVyUwƒ@@I@UUWm@@Uk@@nUJU@WU¯@kbWlULnšÇ„k¼@llLšl@xUnóŽƒLƒlkXUxƒV@lWb„I„`°nnn™llŽV²¯x@JkbƒLU„VxmJX²@ÒWVÛL@lln@‚Xn˜šnV„L"],["@@@kX@Valaa@KWI@UXW@WanaUIW@UaUKķŽk_W@UVUKUš@bƒ@UamxVXnJUbWVXLVbn@W°kb@U@Wó¼mIU¼k`V„@bVbl@„lX@lUôVlUœIV`lX„Vn@lUlVn@„l@UVaƒIUWl£Um™VWU@@UUKlUUUnƒVL@KšUnLVWUa›@™U"]],encodeOffsets:[[[119037,40467]],[[119970,40776]]]}}],UTF8Encoding:!0}
-}),n("echarts/util/mapData/geoJson/he_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4113",properties:{name:"南阳市",cp:[112.4011,33.0359],childNum:12},geometry:{type:"Polygon",coordinates:["@@lKl@nVV@„bn„@VVnm‚nL‚LXx@š„‚VLlKVU„IXWÜ@șlbl@XUĊUlwnW„LÞw‚m@ÞUVmnVl@nX‚JXLm@VnnJla„I@VkxVb„@VŽln„J@knKVn„@°aVanal@XK°b„‚@š¯VJXIš„VK@al@nV„k‚@nK„a‚b„@XL@blVVKVLXK„@VaVI°mVaX@V_@a@yUkVw„VšIVašJ°™@anIlaV@nKnXÆm@wUUV±UUWUKnaWwXUWmŁ¯Vƒam@kakImƒUKƒ»lan@VXXa˜W@@UlUUa@a@UlwUƒV@Xal@@anIVaUK@V™XmwVmUmV„LXl‚@nalLnal@„šnKlkV@@UnJ‚UXnl@nVl¦V@@VnJ@nUVVVVIn@Va„JƗn@@K@m„kƒa@kmWVaUI@a@™k@@aUL@mmaVIUKUVƒ@@IU@mƒUmmL@K@UUUU@mW@@nU@ğ»mVmbk@klW@UXnV@LƒJm„™lUnUJ™UUUWƒƒ@UnkKƒxmLa@ƒ@@lUU™bmUVWk@@nkUmam@UakJU_ƒVm@ÅlÇLUVmVUwULƒKU@ƒk@UƒVUlU@@Uƒ@UaUUWaŎƒzJƒaWLkl™b@bmL@„kKƒabWŽUVƒ_@mV@b¯JmXUbUK™¤ÇLUU@b@JkLWmkUWIkJ@VmX@JUbVXU`¯VV¯blK@LXKl„UV@Um@@Uk@kxWŽkbƒL@KkbmL@‚UXmaU@@l@x@blX@xUJ@bULUlULÇ@@VšnU`W@@nÛ¼U@@VmKUkm@VVX@@xǚ@bUbVb@VX@@x‚LUb@lƒ¼XLlbUlVVU„Ub@n"],encodeOffsets:[[113671,34364]]}},{type:"Feature",id:"4115",properties:{name:"信阳市",cp:[114.8291,32.0197],childNum:9},geometry:{type:"Polygon",coordinates:["@@VllInJlknJVkVU@mXlUÞ`VnV™VU@U@y„@nXlKV„nJVkXKWaXI‚b@yVk„VUkVwn@‚K@nW@k„KlUXVVUlbnUV`n@V_V@llX@@V„b@bV@@nlVUb¯‚WLnbmb@ŽnLnK˜b„U„bVWnLlaX@VVUX@Vln@`kL@ll@VXVJÈIVl@XÞJ°Una„LlylU@UXKlnn@lanLWWnbVI@KXKVL@LVWVL@UVKUIVWX@@XÆJ@In`@lJVI@a„WšÛnK@UlK@UU@VK„nlm„nXal„UllLUbVVšknJ@nV@Vm@a„l@@xnV„„lJVUU@™w@aƒk„@XW@_mWnUlŁUmVKV@VXwW»XƒWaUwnkWUkVUƒU@@@WlaUkkaƒIWVkm¯xmIUmƒLUVƒaUIó»m@mmwXk@a›mk¯¯l™@wƒmkLmmU@UbkUWJ@XUbƒJ@b@l@znÆmK@Xk@Ub@lm@ƒI@akmVKUUVUkU@U±JUbkƒ@IWmkxƒa@UUV™UWVkIUaW@UlLWn@VkJƒI@VkK@L@bmKƒkJmUUaUKWXk¼VxnJ@„V@@VULV¼ƒ@@UkaUlWL@U@W@IkKmL@KULUWULWKUXUJmIƒb—KƒŽƒ²UW™nWKUUkLUƒmUUam@UU™@ƒmUL@xkV@„VV@bmV@Vk@mwkUƒVUx@mbX‚ÇnVb„‚UL¯šWŽnUVLVb@xnlWnU@UVUVVUbVVlVkn@llVUXUWUXVbUJ@bmLUJnb@nVK@bl@@š@bVJUbnX@l„b"],encodeOffsets:[[116551,33385]]}},{type:"Feature",id:"4103",properties:{name:"洛阳市",cp:[112.0605,34.3158],childNum:11},geometry:{type:"Polygon",coordinates:["@@VVUllLXl@LWn@J„@bƒKUVmnL@`VblLnbV@„b@JmL@LnV@VV@¯„VJVnXL˜@nm@aÞ@‚a„k@m„IšmVbXL‚ynLšk°@°aVJnUV@UVVXk@WJ@VXLlUnJVnnƒ°U@»°U„wl@šb„WmUXƒÆ@VLXU@m@U„a@I›mkb™a@naWW@_@WXUV@@U‚ƒ²@„K@I±U@¥kKWLóLlƒa@£Um@kWKXU@mlLXUVKUU±J¯_@`UL¯Wmk@Wa„kkƒlUnƒVUVaU@KUU@mmK@_ƒa@KX@VaUIm±™k„aVKVUkw™@kaƒƒW@kbkL±UUaƒK@UUKVak£ƒ@UmmL@lƒIkmUƒ@Ualw@UƒJkbmIUmn@WKImWk@mUUnÝV@ŽnÝxƒKmXkxĉVWVk@kaċšÛ@WXƒJUV@zŽm„VWnbUbVbšLlUnŽ‚lUÒnWV—VWnk@@Vm@kxm@Un™l@Ll@@V@šXnƒškJV„šV@nlVXx˜U@l„n@aš@VLnWĊ¦nxš@lbVKXLl@ރVLƒ„XJl@XXl`lIXVl@Xl‚XUVšK„wV@lanx„zUbVJ@VVX@b"],encodeOffsets:[[114683,35551]]}},{type:"Feature",id:"4117",properties:{name:"驻马店市",cp:[114.1589,32.9041],childNum:10},geometry:{type:"Polygon",coordinates:["@@n@„b°UƂXnVlnLÜ@VLœm@n˜@na@J„„m@k„@lVšVxXX@„V`lLV„XVV@VVÞLVV°„²@lašbnxV@@b„Lšmlm„_VWnIWUna@lšLšbnV°ƒVL@KšV„LVUVaVLXK@mÆXna@wVm„a‚@Xw@KlL@a„@Va@wUkaWnIVƒla@Kn@Vn@VUl@nKVn„J@LnK@aVkVUUWƒ@VakUVanI‚²X‚W@UUU°KnUVLl@XaVK@ašU@KUI@W@_lm@KkLUKV_Uƒ@»@UVJ@XV@@mVL@K@U@Kk@VwUUm@kmWL@VkVkzƒKmb¯VÝI@WUkÇJUIUWk@@klK@_km@UVWUUW@kbmKUXƒaƒV—amLmK@namaXK°VakU@mU@@aƒa@UW@kkU@U`m@U_mVkaUVWUkVƒL@lmX@ŽLm@UxVlƒUUl@zaWJXbWLUlmIUƒkLmWƒ@@z@VUVUšUmÝ_kVWŽ@nUVUlmIklmIkJUkƒl@n@Lm@؃IUbm@UJUUVU@mmI@UU@k¥mUk@WmVmI@VU@klmLƒ™k@mbkKmb@WkƒKUŽVnUnnxšW@UVLUbmJ@bk@WbU@V„kx@V@bVbkV@V‚@‚—XWbUWm@kb„¼VLn„lJlb"],encodeOffsets:[[115920,33863]]}},{type:"Feature",id:"4116",properties:{name:"周口市",cp:[114.873,33.6951],childNum:10},geometry:{type:"Polygon",coordinates:["@@lšnb@xlJ@UnLlKXUlJl_„KnV@xVL@bkbVVUè@šWb@„Ubmš„ŽkšVšmbX„VJnUl@„a°@@b„LVbƒlXx˜InmnLVw‚anJÆw²IlmnXVl°VVbÈaVb„@lkn@VWnLlUVmÞUUklƒkƒVkUaVaVaUw™K@kkaVWmw„_„‚l@nU„VVb@b„aV@VV@zXJl@@kl@šlœk°WVnÆbnbUšVJ„Iš@VKVm@k™K@_kK@a@aU@@wW@@k@aUW@IUWVUnLlUlVXKVwmk@W@—VWa„¥@k@lnƒUIÇKUaU@ƒUUVmIUV™Uk¥ƒVma@¯k@Wanwmƒ„@@n@@m@UIVƒkUVamUXWƒaV™U_™@ƒmUVUImW@aUIĉK@VmI™b@lU@@n™JƒkU™@KƒIUmmLk@UVm@UŽm@@LkbU„mJXlbV‚@xUbƒ@@bkK@LWx@ƒbUn@xmbÅW@nWLUKUbUVƒK™U@LUK¯„mU@šVV@xULUŽVL@bU`WšUz¯aUamKUaƒ@@xkX@x"],encodeOffsets:[[116832,34527]]}},{type:"Feature",id:"4114",properties:{name:"商丘市",cp:[115.741,34.2828],childNum:8},geometry:{type:"Polygon",coordinates:["@@XVl@lLȃ„@VkV@V»UanƒWX@VaÆÇô@ÈaVX@xVJXUÞU‚aVLĸbXKl„V@šm°Vn_ny˜XX»mUk¥lK@a„_@yšInaVKVa°_@WXI@ƒ@K‚VnIlbnaV@„l„@‚a@_w@ƒlwUKm™Xa@UV@š»Vƒšw@kUKVUUm@w±VUXUKUwmJUUƒ@km@@±mXkmUI™@mm™KUwkbWakLWaUIkJmŽƒX@l@@VUX@JWbX@VbULWbƒlUVULknlV@bVJk„mb¯KknWmk@@nmVkx™@ƒVmU¯KUnUL™@ƒJUIV™maÅaUm¯X›l™kk@@lk@WI@yUUU@ƒb@aUaƒUmVk@ƒƒ`nxUXlb@lšLVxUbUbVbUll„k„VlÝVUnkVmKUXm@klƒ@ƒnUx@xnxƒn@`VX@V²x@V@b@„Wl@zU`VUVVb„L@Vƒb™W@bkXllkLWV@V„@VVÈwlVœ@@X˜K²Llb„WnnÆL@VnJWn"],encodeOffsets:[[118024,35680]]}},{type:"Feature",id:"4112",properties:{name:"三门峡市",cp:[110.8301,34.3158],childNum:6},geometry:{type:"Polygon",coordinates:["@@WKUmUI°ƒU@@UmU@KnK@IƒaU@makKUa@_‚KnmVU„L@a‚ƒ@IXm@KWkkKVkUU@aUW@UUIVaƒymwkbU@ƒx™LVUWWkk@WUkJk_WWk@WI„ƒUK݄k@WKULka™@mwĉ¥mXUK™@@bƒm@k—VWwkU@m™UUƒlI„™Wm@™@Uk@@KškVmn@lwn@@Ul@Xm˜UXUmVсkmkV™KUaVamaUXnƒ‚@ykLUKƒ@™WwKmKnUm@UmƒƒaU@mUk@kL@lƒxċxUnkVmnXxWb@`kzWJ@V—LmVUn™lmUL@lW@Ub@VšXUbš`VLUbUJ@nmnUlUUm@@bUJlnU„š‚U@lxkbƒ@@XƒJUnƒ@kb¯VVVmlXXlJlzn@VlkVW@bkK™bmškŽUbVb„lƒXVxšKÈnšwÞlĊKlšVnKlwX@lL@xlUnVn„@šl@lmX@ƄÈb°¼ÈwVJlx„_°xšašlšUÈxlUnbVxnL@lllšbm„n@nb‚@@V„L@V„@@„VLšJnIVVlKnV„_"],encodeOffsets:[[114661,35911]]}},{type:"Feature",id:"4107",properties:{name:"新乡市",cp:[114.2029,35.3595],childNum:9},geometry:{type:"Polygon",coordinates:["@@XVlL„K°bUblbUbšl@nX@W„XVVKVkš@@Žmb@„Ubn„W`kL„LƒV@VVLnKlVXIlVš@@a„@l£nWlƒkVa„@°bnUlLVlna‚bnUVUXKlU@ƒ@lk@a„I°y„@ôkUU@wšmôšnkWakml™UkVmkUlmUUm@nkUKWanamU„LXW@U‚VnUln„`l„œblL°KXV@ĠJ@L°„šJšUVw„anK@UUImmƒkK@¯±Um@IVmUmmÅnWaUK¯aUk„w@W±kVƒx™U™VƒwƒnÅJUIWaÝJóI—bm`ÝbÅImJUI¯¥¯@mU¯UƒJmnUVóUkl±V@zXl„bWVXL@bm„mº@@XmJUXU°llk„@nWJk@U„@¦U`m¯ŽWx"],encodeOffsets:[[116100,36349]]}},{type:"Feature",id:"4104",properties:{name:"平顶山市",cp:[112.9724,33.739],childNum:8},geometry:{type:"Polygon",coordinates:["@@l¤UbVL@V„LVb²VlKlaX@„„lbš@lxUVULƒbšln²VJUbW@@L„b@`nL@nVV@LVŽUbUVm„kVl„ƒlXbl@Xn°ŽVK@_°`²IVVV@VUVJnInaWK@Uš@„K„LÆ@nmlXXWVUUw@klKVa@knyVkVanI‚JXUl@XbVUl@@aša@mXk‚bnK@UlK@UUUVaXaWmkUm¥n—WmXaWaœkl@VmÞb„KVL@aVI@mUwVm„@KōméUL™KVaUk@kUK@U˜WXI@VlKXU‚@VVnInVV@VLlK@UUƒkKU_@ƒWWUwU™@klƒn@ƒƒ@Imb—@@m›nUKÛ@mKUkWVXxmbVLXŽVVU²VV@xÅnmWmLU@kbmJ@b¯š™IUb™JƒUUxVl@z@bU`W@Ub¯nUJUbƒ@WLUKULkU@aWKƒ@aƒbmL@ƒlmUk@@bUL™ƒWJUI™°@ƒŽ¯aWLk@mbUb¯b"],encodeOffsets:[[114942,34527]]}},{type:"Feature",id:"4101",properties:{name:"郑州市",cp:[113.4668,34.6234],childNum:8},geometry:{type:"Polygon",coordinates:["@@@nWVUKÅ@W„nVnI‚ŽV@œkƂšwV@šnn@lxÞlnôJ˜zXJl@nalUČVlƒl@²UlkôVVUnm„I°VnV°@°¦VJnIÆJÞan_VmU@ama™@kU˜¥kaUklw@UIV¥kVUI@ƒmmUÅmUlƒwVU@amU—JWbUakVƒ—Vé¯Im`ƒk—@ƒwVWmLkU¯ŽƒXkWmLmx@UUƒbm@@x™J@LbW@UUVWUkVKƒ@ka™IUamKUkkmmLƒUkJUVWXkWmnÅ@ƒKƒL™@@VXLmbmJUIUVU@ULWVkK@nWVXL@lVn@¤„b‚kôKXKlL@¦²V@JƒL±@„@VU@WV@X@`XXmb@Žšblaœn@Jƒb@V"],encodeOffsets:[[115617,35584]]}},{type:"Feature",id:"4105",properties:{name:"安阳市",cp:[114.5325,36.0022],childNum:6},geometry:{type:"Polygon",coordinates:["@@°kVaV¥kVmUkWkWVkVKUwkkmKUU@a„wWWXWakKWkXmlašIVmX¥ƒU@a„@WnK@kƒƒ™V™I¯ƒ@KğI@WU¯LkK›akƒƒ_kmmVU@VWXƒKnVmbXbVLmln@VVknlVUnVlkšlnXbmlmlXblnÈlWbn@@nšK@V„L„bVV°VVzšlnš@V™xƒI™b™ŽU@WLUa¯V™UkWõ@¯kkmxk¼l‚„XUlVbVLnlULmU@lƒLkVUlƒX@xW@¯mUƒ@UmIUW™L@aXa˜kU™¯anƒWk°@k™kKmmUIWaambUkkKmV¯aƒ@UblŽk„mXk¤ƒ@@b™@UbULWVnb@lUVVnmšnVVU„J@bWXX@WJkL@blVU°UV@XlWnXUbW@UVkVšVWbnLUJWLUK@Lnn@blVU‚„nUblxVUVJXU„a˜@Ub„LnUVV@mVIVVn@UbV@‚XbmbUV„_lVXUWanJVI@WkI@WVIVU°WXXl@la@mX@lLXl‚kVbœm‚X„ylIXJV@@kšKla²UVa„IVyÞb°LlVna@UÆKnLVbšK@anwU™"],encodeOffsets:[[117676,36917]]}},{type:"Feature",id:"4102",properties:{name:"开封市",cp:[114.5764,34.6124],childNum:6},geometry:{type:"Polygon",coordinates:["@@lUVbXa˜InV@bUV„x‚knVVÆnn@„VJlUU¦VJ@kxVllb—¦lVš@nb@bVŽUn˜aôJÞIXbVJÆI„m„xšUšV„w‚U²l@XƒxVl°bVLXb‚`XklUnmVblLœ@lmšx°LVK@UXIVašWlL@Ukƒ°KkVaVUXmmI@UÅKmmƒXka±K—L@W›@kUÇxUUƒ@@UXUlKkklW@ašX„a@UƒKUaVUUV_@yXk@ƒ@a@U±w@UUW@_„mmw@wVw„mUaÇbUa¯UUkmWkn±JÅxmIbUxmKmn—JWw„kUaƒK@a¯@ƒbk@mVUIWƒ—Lmwm@Ua@WJUb@LUl™@UUmLUbWJ@VL@VmXWWzUJUꄘ"],encodeOffsets:[[116641,35280]]}},{type:"Feature",id:"4108",properties:{name:"焦作市",cp:[112.8406,35.1508],childNum:8},geometry:{type:"Polygon",coordinates:["@@V@VL@x@bXŽWV@XkššlUŽWX@J„@nI@KlL„KšUVaV@œJlL@KUk@KÞL‚l²_‚@nWlL„UVVš@nLWVUJVn@anV@a„wÞUVLVx„b„@lW„@lbXn‚Vn@@¼šL°mšKVn@bnl@nVK@blb„L„W„U@VWLXV@nlKn@lVVbXw°nV_@¥Vƒl@XI@mlƒkkV¯VWnI@W‚@n¹nƒ@aWKXUƒaWk@yk@k„ċUkVmbk@WI—yóImÝkkwm@™mU@™xŁ›lU@mJƒX™ak@ƒx¯V@¼¯Vm„UmmIkVWK@UXIl@UWVUU@mVUI¯b¯@™lmKzWKUa™nƒJ@nƒlbÝ@@b"],encodeOffsets:[[114728,35888]]}},{type:"Feature",id:"4110",properties:{name:"许昌市",cp:[113.6975,34.0466],childNum:6},geometry:{type:"Polygon",coordinates:["@@lI„VnKlnVlnLVbšJlb„@ULVlUXVVX@‚a@KšI@wn@„aVV‚@nwnKlX„W°lVnKUX„x˜@„ln_°JVIXy‚XnW@U‚K@UXIVanKVVš@Vk@KVaXI‚@Vbn@nx˜KnaU™l™ƒn™Va@ƒXa@™VçUUla@aUK@wmUƒLk`kIWVkLmK@V@XUlƒn@JXV@nm„™bU‚óIƒmUa±@@ÑóVUUk@UlKVU@akWVUUlUUaUK@UUKWbUkÅJ@XWaƒ@XbmJ@nUJ@bUKƒLÝaUnk@›lXbWbXnm˜n¦lVXnWbUbVV@VkL@VmLaWl@n™b@bk@UVWak@WVImJUbUlmz@lUbkL@lVx"],encodeOffsets:[[115797,35089]]}},{type:"Feature",id:"4109",properties:{name:"濮阳市",cp:[115.1917,35.799],childNum:6},geometry:{type:"Polygon",coordinates:["@@lLXbW‚XXƒx@bVVnLllVxULUl‚XXlVlUnlŽU¦Ub¯l˜nœK@V‚bVb@šXbVL„KVxVVnIlašb„a„¥lU@wnalLnVVlVLXnlWVXn@@lVI@WnU@mƒÅW¥—aW_k@WwXy@kmƒ@wU„mš„š¦šlUxVLV@UwšJ°xš@VX„@Vb„@š`VX@VX@llšIVbnJlI„bšV„l„˜J@ƒmѯLóa@ƒƒKUa„k™ƒ™Xƒ@UK@wU@ƒlWUUݯImW¯aƒLUKU@ƒkƒ»k@mƒwƒa@UnKWI@ƒUU@akVWK—k@a±ƒbóUWKXUmk™KUmLƒbUx„„@lmLXŽƒ@@b„VW¦Un™JkbWnXl"],encodeOffsets:[[117642,36501]]}},{type:"Feature",id:"4111",properties:{name:"漯河市",cp:[113.8733,33.6951],childNum:3},geometry:{type:"Polygon",coordinates:["@@@Lƒ‚UnVxnIWa„@Xb@WÆIVlXaVL@VVLVbkVVŽUVlX@bUVkLV‚l@VVôU@Ò²@Vb„nôJVšanƒ@mWU@I„mVk@WkI@wmak™@wlW@w„@VbnLVb°bVyX™V_@aUKVVK@wUU@™™a™K@kmbXVmJUXƒ`kn™nƒK@aU@mw™akb±@¯ƒUUÝKUUU@WU@VkLUKU@mUmJUU@WVkL@UWJ—X@VVL@lVlUbšLVKnêƎ"],encodeOffsets:[[116348,34431]]}},{type:"Feature",id:"4106",properties:{name:"鹤壁市",cp:[114.3787,35.744],childNum:3},geometry:{type:"Polygon",coordinates:["@@ó™™n@xVVólƒ@¯zƒJ@bkl@@„kVWLUVmVXbVJnnlLlš¯@Xlm„°bVš—lWb@bšKVXnJ@VV„°nX@@w„WVklU„K@knVVKmkUKUaVkƒWkl»nwlŽ°lö@lXšV°UVbXKV@šša„Jšw@Um™™kUy¯UUUƒaƒK@U™L@mm@XaÇkkmWank"],encodeOffsets:[[117158,36338]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/hu_bei_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4228",properties:{name:"恩施土家族苗族自治州",cp:[109.5007,30.2563],childNum:8},geometry:{type:"Polygon",coordinates:["@@VK‚bX@lbUVnL°„@VlVnUl@VUX@„aVƒmaXƒlašUUU@wmaVUn@Vƒnmmk@m™U@kna™aU¥Vam™X_@WƒU™mW@_kƒVaVKnL‚lœ@VVal@k¥@kUW@kUKVUlUVсW@kÇaU»ValmkUVUVak™@aƒV¯_@W‚UkmVUlU@aœƒƒalI@akkVWUaWXUWwœWVbÆ@„„l„alIVK@U™m@UU„W@al²a‚¯UağÇm@ƒbkk@wƒ@@W™aULmxƒIU‚™ƒb¯@U`UX™JmL¯aƒKX›WUL@aknmK™@aWUXaWm@I@UÅmVU@™™aUV@b™VƒI@WkU›bXkm@VakwUKULWKXmJ@XUK@ƒmL@KUwVaUI@KU@mmn™mXka@»V@@UUaƒw¯yVk@ƒUUVmmkÛÈU@mWUnmx„šmlUbV¦UlbWVUL@UUƒ™IUmÇKV„VbUVVxkn™LUxV`VX@š„„kJVVUXWaUVVlUnmKUbkI@WULmK@L@LVlƒLnmUIWV@aknƒ`VXUJIVlUVVbUX@¤mbnLm‚m@UXk@mm@Ukaƒ¥@kV@@KkU@aUKWbkLWVkIVŽk@UbVlmX@bU@@mmL@bn`@Ln@llVLVk„@XVVU@`VXUš‚¼k`VULka@VllVIn¤VU@@bl܃bkx@bkL›škKƒn@bn@@b@JUnV`UnVbVKlVXUlbn@°ƒVx„@@b„nVbUllVn@V—VK@UnW@UVUšlnk‚VÈޚxVb„VVI„xVaÆ@@aka@UVaU@@a„k@Wl@nbVIƎ@Jk@„L@VlXnlla@VJnw@UmwXU@aVK°ÒnllnLlb„xnKVaV@l¦²nVl@llL„x@XVVœ‚Ķš@našx@U@al™XUVa‚LÈþV°XxWXkK@šmLnlUb@b‚xnLVlVVkb@UJ@xWXXš"],encodeOffsets:[[112816,32052]]}},{type:"Feature",id:"4203",properties:{name:"十堰市",cp:[110.5115,32.3877],childNum:9},geometry:{type:"MultiPolygon",coordinates:[["@@@a@w@kV@nbVK@ƒnUla„@la„Ål@nlVakwWX@WkLšaVmšwV@anK@UlIXmWkk@@mmLkWlwk@U_mKXwWK@U¯K@UU@ƒVUa™kmƒkI™yUUVUmanU@mlwkƒ@_mWXaƒUWU@ǃ@U@aUaVwUKUIƒVkK@UWIXƒmaV@k@Vm@UnwlƒUamk@V@„ULUamxUJkU@Iƒ`WkkK¯XWak@@W@IUV™LWJkXkaÇVUKƒ@kUmbmUUƒUKƒbkKWUkI@ƒkKÝ@@aƒUm»nI@mƒU@UnWV_@aUmWbkLUl¯b@a›kkk@WkkJm_k@UV±@J@b›nU@@WÝIUJVbXL@nlJkx@„Wn@VkJmb—LmUƒ`VbUL@xVn„@XVƒŽ@„mVVnnJVbU„ƒx@„V„nVUbVVƒx@šn„™bUK@bƒ„@bƒJ„šm²„VU‚lbXzVJV„„JVbn@@Xmb@V@bVJÈ@‚Vnkn@°aVVV@šX„KnalLVmšUnnVKVlnLWlXX„Klk°š™šXŽWškLUVVV@nU@ml¯nmbk@W`Å@mb—LWm¯UƒxnêVèk@mbƒVƒnUK™@kKmXk@@JUI›lÛLllnbVnlJ@LULnlÆaVLnŽV@nkVJ„@lkô@²bÆm°w„L„WV@VXšKšVXI@W°ÆVšK„b°U„JVIVV„¦XKVL@l‚InaVÝnUl@@bX@‚™nmVL@lVL„lVLVUnbVW@xXn˜bœU°¤V@š™„a@kWKUUn@VlnL@UV@Ü»@mX@V_ƒakaÞ@VK‚¯@kkW"],["@@mUkUUm@nllVKXXVK"]],encodeOffsets:[[[113918,33739]],[[113817,32811]]]}},{type:"Feature",id:"4205",properties:{name:"宜昌市",cp:[111.1707,30.7617],childNum:9},geometry:{type:"Polygon",coordinates:["@@°`„U@blšUbUVlVkn‚ŽUbV¼Èb@l‚XUÒkVUVVL@lVX@ll¦k@UbU‚›@kmKULUbl„@`nXšŽ„V@XW`nšUbV¦šbmb@lšV@nnlmnU„m@UVnb@xVV™VkbW„nb‚VnVa@an@UaVU‚JXnWlXX@l„¦@ŽlKÆX„bX‚V@VV„@°¯°xXx‚XV@nV°UVWU_VWXkmaVnWVkn@lln@lb@UVLXWlnX@˜aXUmaVK@UXU„U@WVI‚W„XXV‚U@¥VKœ@‚Uގ„„‚a²LlV@kV@UanKma@UVUnK@UVLXyVL‚knJ@UV@@UXKWUXaV@Vb@mVLnKW„m@aUUm@@UkK@Ula„LXKWaXI@alKlmUk@wVKXL@m@WWn@UVa@K@wna@aW_XWWkXbVW@k@U¯WWwka@UUaVIVƒkU@m±@U@@wVKkaš_@VV@XUVwU¥‚šyUkm@V±ÈUKk»ÇL„m˜mLk@ó£kmWwƒm@U„IkWKXwWU@ƒkLƒwkbmaƒbkK@VƒLkmWIUKkUUƒÇIǫJ™XÅJULVŽÇLUVƒ@UK™@kI@WVI@UaƒWmXVVUL`±kÅLmKkƒƒkƒÅ@Ua›XXxWVXŽVbUXll@bkJ„b›„@bkVUVlnV@X"],encodeOffsets:[[112906,30961]]}},{type:"Feature",id:"4206",properties:{name:"襄樊市",cp:[111.9397,31.9263],childNum:7},geometry:{type:"Polygon",coordinates:["@@@Xl@Xb°WlLXl„_@JlVVInwVbVK@ƒ@UnlVbk„mx@VUnl@U@nbW„XJ@VlL„UVJVLUxVb@b@VȄ‚@XV„VWbnX@`l„kx@nmVnbUVVVšzlJn„šlVb„UV@@V°L@VXLWxnLV`l@kxlXnK@nl@XlWn„`Xnl@@UVa@VÈKš£VLVanW°U@UVU„@„`VIn‚mV@„nV@Xa@aVW@UšalkXKšblI„yƍXnlJXbl@@VV@nklU@`„nVK„LVKVb@V„U@UÈK„UVKšIlUX@V`lIVbn@nblVVmV@@XXJšUVV@knKVn@`@X‚VnK„wlLVmUUU@ƒU@aXL@WlU@UUW@UmU@KkLWaXkWmXUWm@U@ƒnk@UmK@U@UaUVUUKV_@al@namWUI@KUƒK@aV@WUIƒbƒ¥ULUJkIm™ƒK@U@K™V@U@a@UkU@K@wVaUwlU@mUƒULmKUkV@@anIWmUK@I¯„mKkl@LUb±lUakLmk@WwUKÝVUIm`¯n@Uk@makJU_@ƒƒJma¯ImwUVkKƒb™aUÅ@wWaU@VU@mXIVmmUkJkwm@mIlUKWzUK@VmLUV@VnbmLVbU@@lkU±KbƒƒÝV›@UL@¦VWUƒWXUJ@XƒVWV@VULnbWV—bW@kmWXUK@Vkam@kkm@UlmXUŽnbWlUXV`UX¯VmUU@Ul@Lll@nnJ@LƒnWmbmš@b™`ƒš","@@kUUm@nllVKXXVKmU"],encodeOffsets:[[113423,32597],[113794,32800]]}},{type:"Feature",id:"4211",properties:{name:"黄冈市",cp:[115.2686,30.6628],childNum:10},geometry:{type:"Polygon",coordinates:["@@VVUnWVXnVJ@„‚U@V@VXŽV@@IVJUnŽ@V@L@KlIVlVanLVbnVlI„ƒn@@a@Kl@@I„JlI@aXU@KlK„kVblJXU„VlU@V„bVkVKXn@VlxVa²I@VlVUxln@bšJXklaVWnLmÅ@y@k@ašI@W@aXIlVVaV@nnlKnLVW@IUa@a@K„UVVlI@wXKVV@IUƒla„@lUXwWƒnƒnalLlxXLll°@XwVKVaXIl™nb˜@nln@Va@U@k°ƒUmÆUVaXI„JV¯ÇUmmkU@WaKmakVm@U@aVKkkmKkVmIkÇ°£@aUUVaVVnKlkX‚mkƒ@ƒlUVaX@@Um@‚™UmlUXV„UVU@w‚K²¥Ua@I@UV™l@U™V±UIUÇ°»VkUmVI@a@U™m™ĉ™¯V±bŹĖğaÇL¯lmŽkX@‚óĀ@ŽmšÝêb±WkLƒn@xXx@Ž@b@V@LW@UbƒlţXƒ`kxWnXô¯¦ÆV@L@JVLƒxkK@V@bkz°l‚lXz@J„UlVla@XUV„bVKXnW`XXV@laVV@V„X@V¯xƒx@xULVbUJ@n@LU@VmmakbUK@b™IWWUUVkUmkLm@VJkb@nUJƒ@`V@kX™aUaVmmLkUmJ@Uk@U„±lkzmJUb@b„VUxVXU¤ƒL@JƒX@VlL@JkLUVU@mnUl„¦@V"],encodeOffsets:[[117181,32063]]}},{type:"Feature",id:"4210",properties:{name:"荆州市",cp:[113.291,30.0092],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÈJV„lVVLXJln„K@UlL„anbla„xlK@„XVWxXLlƒJ@V„nXxlnô¤l@nKn—‚ƒÈKl¼VL²Ç‚Un@Vl™zŽV¦UxWVU@@U™`lbUL@xV@²@@nlVU„UJVb@VlbXx°XVWX_VKUwVKVa@UVKUUVk@KnblaUU@wnWl@UX@lÆ@@a„IVmUk„™šxVJ„U„bܙ@Uk@WWnk@Vƒ„™Vm@I@m@Un@m™XUlVlUnJ@knJVU°@@aÆLX@ƒllL@¦nJV@XblLVa²U@UlWš@VX@`@LV@@bXJlIXml_lJœU°b„KÆLnVVl‚@ö—Vƒ‚mXaVIĢllUlVnLVlX@@b‚ašnnxšV„L‚bn@°ÆXmmkĉƒ¯w±™™™Uċ@KÝÅƧŃÝ癙Uw¯ƒm™¯k@W‚kV@¯UIUJW¼kb™Uƒwk@W`@¦Uônb@VƚlÈ@VU@ƒƒ£UWWnUÆUnmJkUÇ£VWUI@aUU@WkI@Uƒa@JW@k£kaWVUKmnkKƒb™kkVWb—VmUUmwU@kk›@UakUUa@V@nlx@lUb±lUbnnWLUyk@UamœUK™@mlk@Wb@VXL@x@xWI@a¯Ž¯V@bVn@LkKmL@`XmKmVU@@bkL@V±bk@Uaƒa™L™KUVƒIƒ„™W™XamVVbUK@b@Lm@UWkxULWVUnm@UlUX"],encodeOffsets:[[113918,30764]]}},{type:"Feature",id:"4208",properties:{name:"荆门市",cp:[112.6758,30.9979],childNum:4},geometry:{type:"Polygon",coordinates:["@@n@lxlInVUnWJ@nUVV@Xb@xVƚb„alLVUnx°Jnb„I@„V`lInbl@@V°mn_VJÞUVLXx‚@nllKVb²kVa@KlknL°ƒ@JVLXnmJ@bU@VlnLVKV„@nX@lUšKVaXal@VKn@¥°L@Unw˜bnašV@KV@VUX@lVXI@KW@@IXWV@laVL„„KlaXUVVnkVWV@lwXblIXWVkVmšaU£VaUmVIkU@y@WakKUamU@UUK@kmK@w@@mK@LƒV¯™U@WwkmULƒamVVUU@ƒƒIƒbUKUa™kmƒm@UakLmxU@UÒWlULţÿmwkIUm@a‚kÈblW@UVƒUUk@JW@XkWWUkUKUIlw@aUWknWUUmnIWƒ™aUwVaۚƒaƒVUI™wƒšVlUnƒJ@bÅ@@kVWk@mX@xVVkbma@LUlVVUL@VUbULVxULW`UX@V@lUXWaXlWXX`@bmb@x@LUb@VmŽXX@‚@nWKUL@xVlknkL@bWJXbWLƒKkb@VlL@Vn@VV@bƒnX‚mLUK@nUaU@WbXVWL@VU@@V"],encodeOffsets:[[114548,31984]]}},{type:"Feature",id:"4212",properties:{name:"咸宁市",cp:[114.2578,29.6631],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÞƂLČ@šV‚š²š°xĊ„nlWnŎ¯m@aƒK@„„°‚n„Jšwn™VIUaÆJšÅ@wšwV™XW@aV_l@²V°lĊwlaXLšwlUkalVVaX@lVXI@a˜UXJ@U°UU¥VIVKVklanLVa@VÈIVV@nk@aVa@mV_@a„K@klKUa@UnKWk@@lU@@UW@@nUWUwmaVIXƒ„lV@mLXblJ@kV@kk@KU@WƒkUWVÅwkLmW@UmL@lUL™KULƒak@maUUÝwUJƒIb›KUUƒ@š™aWK@kUWVkUwVw@™mÝ@™I@wkW@a›ww@LU¥™kƒJ@nVJƒIkVVnkV›UkyUIUl@xWUkaW@@°kz„ŽWxkLUWmzk@@bVVVš„b@‚@XlVœ@Vl@bVbUn™`Wn—@Wb„VVI@`„LVbXLV`mnU@@lƒL@LUŽƒak@ƒLk@WbUJn¦@lVb@xVb@n"],encodeOffsets:[[116303,30567]]}},{type:"Feature",id:"4213",properties:{name:"随州市",cp:[113.4338,31.8768],childNum:2},geometry:{type:"Polygon",coordinates:["@@„@nš`lw„k„ƒ„UmUVWX@lk„@VanUĠ¼V@@mX@@nVV‚VXLmJVLnK@b„V@@J„@VUn@VaVUUUVWVLV@@Kk_@almaVkUU@WVƒVUVLXmmk@wUaUKUV@°™@kmaUaÈmW„mUƒVklaX@lVnxl@@UnaUk@ƒVUVwVK„nš@VVn@VbVJUknUmmVmk_Vw„KUUm™Vak¥@UVKVIkW@UmIVWkIVƒkmmLkwmVUƒ@LƒUU@VVXL@JmLUbmK@UUKmkKUUmVUaUnÇlk¯™mJUnmLUaUJUaWL@UkJ™ƒUƒ@ƒaklkU@¯@KWLUmUUWVkbƒLƒŽUKkbU@WX@JX@@LWJkUW@UVU@@L™Umb—amx@V¯K@¦mŽULk@WbUb™LkVW@kVVxUb@x@LlV@V@b@VšU@L@V„LnšlJVIVK„¦„aVJ@XUŽ@b„LV‚@LVJnXmbk@@bU`VLUVV‚b@V@VnL@Vml@„@VXnWVXnWlXblK@LnV@VVX@VkV@XWK@b„VV@VV"],encodeOffsets:[[115830,33154]]}},{type:"Feature",id:"4209",properties:{name:"孝感市",cp:[113.9502,31.1188],childNum:7},geometry:{type:"Polygon",coordinates:["@@VnXK@L@°lVlk„b„@„VšlI@VXKVbVIVbnKVmnI°šlŽÈkVmVbnUVVlLnVL@VnLVanK@IWKUUV@„V@KV„nUlxnKlnU„lJUXnJ@VlXUJUL@Vl¦UbnšVVƒLUxl`UnnnmVVlnVK„bšmVX@a°Ý°LšaXJV@VUnKVXVK@LnKlLUbVVX@VwVJVn„@@UU¥V@@UUK@ƒmaUVUkkJ@L@K@UmVUI@JU@W@U@UV@ƒUIWmXUVmUUÇ@UVmIlmnmakK@akaW@UwVUkKVnUlKVwk™ƒVU_WKUkVW@UXaWkUa@w@VU@XaW±@IkbƒKƒb¯L@WƒXkWƒ@UakL@UV@UmVUmL@UXWVL@ašUƒVUUUVU@yUUƒIUa@wUKWVU@kƒ™™Wk¯UkwVKƒLUx™K@nVxUlUUWVUmw@wƒUUyXWlX¦WbUV@„U‚@blbUVVbXXƒl@lVL@bk@lxkVVnVx™¦ƒ`UnkL@V@L@Ž‚@@xnL@lVL@VnVVblLXb@‚@zlVUJVnUbV¤™bUnUlWXkJWakxU@UXml"],encodeOffsets:[[116033,32091]]}},{type:"Feature",id:"4201",properties:{name:"武汉市",cp:[114.3896,30.6628],childNum:1},geometry:{type:"Polygon",coordinates:["@@nbnm‚knJVUÈ@@Uƒ¥VknmV@VUlK@IkK@U„W@I„KV£UWVwƒU@aVanIly²kVƒl@@VnIlVnKUnVbšblWU@@_„‚VI@mlaUIn@lKVnUlVVXXšJ@aVLlanbUnV@@K@mVIUaVK@w„w°w@UƒW@UUUkbU@WWX_WmULƒaVU@WkbkUƒV@IWyk¯kly@a@UlL„wUK@I@KÅUW@ѱUm@wl¥kaƒ@@_Vw@ķƒa@akw@ƒkKW£XVUVwVwUaU@VUU™™xWKkbĉx¯k±Uk@U`@bWXUš™x@x™ÆÅIVbUJmš™xƒImƒ¯@ƒ™Umx™nUVVbnJV„@Lƒ@@ŽkV@bVnƒ@UVULlx°VXlššl„V@XUVL@xVb„JVV@zUVVVUV„™V@bUKWX@VnKUVVnU@@VlKVb„@lX„W@X°K„a„Lla@JX²Wb@ŽUV@@xVbXlWb@VUXVlXLV`Uš„lŽUxkLmVUŽlLUVVxX@lb@blL"],encodeOffsets:[[117e3,32097]]}},{type:"Feature",id:"4202",properties:{name:"黄石市",cp:[115.0159,29.9213],childNum:3},geometry:{type:"Polygon",coordinates:["@@VšUVV@VbUx„aWUœblUVmnKlX@bXJVIlVUxVVVIU‚zlx¯š@‚VbnL@x‚x@UVaXK„b˜@Xk‚WU_Vm²klW„XVK„Žl@nXV@@w„mlK²X‚aÞén™@ôÿ@lWn°kUKmmUљUmm@ƒwkImWU@UakL@bVLUVċ@™bUK@alIXKWK@™nXnKmkUVwƒ@¯b@L„lUL±W™n@KULUaW@kL@lƒL@bU`@nUb@bmlU@UÇJ@UUbmKkblŽUULUJV¦¯V@VWI—V@bWJkUW@UbkUlbkV"],encodeOffsets:[[117282,30685]]}},{type:"Feature",id:"429021",properties:{name:"神农架林区",cp:[110.4565,31.5802],childNum:1},geometry:{type:"Polygon",coordinates:["@@n`lIXll@lœl@b°aVklKXaVn@bU`mX@V„V@nmJn¼„V@bÞ@lL@„lJXVlL„aVLV„nVnalV„@VLÈUlblWXIšKVU@J„™š_‚@an™na‚X„m@KmI@mkk@KVkWWw¯w¯°ƒ@UUU@WƒaÅWkL@ƒ¥@kWWXkWmIUVVbm@@bUbmUU„ƒbW@UVk@mVkU@U¯ƒmKVUkaW@aULƒÆVbƒb@VÅ@Un@VƒLWl¯Lš„"],encodeOffsets:[[112624,32266]]}},{type:"Feature",id:"429006",properties:{name:"天门市",cp:[113.0273,30.6409],childNum:1},geometry:{type:"Polygon",coordinates:["@@@K@UlKVm„_š¥UwUmlUkwl@@aUK@k„kWWUaVUka@aV@ƒVUXaW¥Xk@WWIklm@ÅxmI™VÝUkxkaƒ„@bWJaUL@„W@™l¯UULU‚ƒbƒkV™Ua¯bm¤UnÇUkmUšUx˜b@VkXÇal@bVnlJnxŤĀVKXkVÑV@nwlKVbn@n„šlVbVL„a„J@„VV‚UnU„bVKlnXxV@°š„U@KnL"],encodeOffsets:[[116056,31636]]}},{type:"Feature",id:"429004",properties:{name:"仙桃市",cp:[113.3789,30.3003],childNum:1},geometry:{type:"Polygon",coordinates:["@@VK°VškX@@ƒVK‚bXI@a„ƒlblwÞVšUnJÆwn@lkXJ@X‚WVz„V@xnx‚VXUVVVkUw@mšLVw„KVU„@Um@alU@„@@KUƒmIUaVUšmnwmw™mb@aW@UkmKkUkVġkUJWbnU„õ˜@UkmUÅKƒL¯a›VkIk`WnkJƒ@xVLUVVbUbk@WlXbm„VxnxUblbUV™@@VUV@nVL"],encodeOffsets:[[115662,31259]]}},{type:"Feature",id:"429005",properties:{name:"潜江市",cp:[112.7637,30.3607],childNum:1},geometry:{type:"Polygon",coordinates:["@@UbVxšbX„mJVnXVlmVX@bkxVJVLVlXXWlX@@IVl„V‚U—aVwV™lnÈVVmn£°aVbUš„l„aVUK@mVU@Uš@VUkaVamwUwnƒWaXkl@VaUaVUUK@w„WI@aU@@K@_UW™@kX@V±VUbkKWaU@mI@¥kK„kW@ÅK@b¯@UVmI@lmIkVkUWVnšm@@V@n@JUnƒšU„@ŽmlXXl@@V"],encodeOffsets:[[115234,31118]]}},{type:"Feature",id:"4207",properties:{name:"鄂州市",cp:[114.7302,30.4102],childNum:1},geometry:{type:"Polygon",coordinates:["@@°¥WóXmlw„_ŤW„kVaX@@K@U@a@WwU@mWk@ƒULƒWkX±lUnV`XWl—@ƒaWLUb@Vw@wmKUa@°™kw‚yVUJUUVwkUUJWI@akWmLUnkV›aXVƒbUxUVWX¤lL@„lx@b„b@ĸUx@`„@lbk¦@x‚n²VƄX@"],encodeOffsets:[[117541,31349]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/hu_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"4312",properties:{name:"怀化市",cp:[109.9512,27.4438],childNum:12},geometry:{type:"Polygon",coordinates:["@@@n„‚@b@XnJ@k°x@aVUnl‚UXnV@@VnJWUJV„nIVV°ŽUbVVVL@Ž²LUVa°V@aV@nm‚UXblLXWVXVmVLVK@an_„`@X@l°„VlXXW`nX@Jmn@b„@nV@Lm`„bUb‚n@VUVl@nIVbUlƒV@LkJUnVV@xVblVUbU@ƒzUKU@mx@xUnn@@WV@lbUb@šnVWXX‚V@VIV@VUnJ@VUz@JWbXllI@VXVVL@ŽVn@„„Wlb@„Žl„XVlL„aV@VJ@XX`„kVwVl@bk„‚bUŽlVXIlƒnLVa„mVwV@@nV@XaVJVbX@lwV@n„@nV@VWnIVVUŽÆ@Xx‚a@I„UUKmk@mVƒ„IXmWUš™VJnUVU@anaVwk™›U@UXa@W™@m_@a¯@@K@UVƒ„bnK@blIlbXa@WW_n@VƒU@¯bmyƒUkUJÇÅ@WU@kWKÅwƒnm°KVkmankVWnXVWV@UƒƒwXkV@mƒ„UlLnaƒVaX@VUn@VnVK@xlnXWšU@a™@@klak™Vw™mUaV@™wmIÛ`m—@mVUXmlIXƒV‚I@K@aU@UaV_UK@wkUmmUKWXŽmVkUƒL@mƒƒU_nK‚™@aVU@Ukak»@U™™@ymUƒ„¯™ƒUUƒVKkam@™nka@ƒmwkLWb¯mkaƒ_VaVKUƒ™IUw@kKmU@WK@UnƒmaULkU@wUalWV¹U@@WUI@WU@‚_@W@U@mƒU@WbbUK@Um@@UmbUwWWkk@WU„a@anUUwlWUwUU@wlJVUnnV@@mnI@m‚K@U@w„a@wUm@_mƒVUUaVUkƒƒƒ_kċUk™VWLƒ@mlU@kn¥W@UwUWV@VÝU@lXLWVUbVLXlVIl‚knmU@VUJk@@„ƒ@™kVmwmVkxU@@XmVUb@xnKVLl@VxUxkIU`@bWVXX@JWL@bkb„¤@bmUUU¯Kƒkmb@V™VU„VVn@@„Vb@`lnœxmb„lUn‚bk„@xU„mV@bmWbUV@VJ„Il@nVUb‚K@nn@VbnJVIlJVkXJ@X@lmx@bnnWVXJWXU@UlU@mk@@llb°x„IUbnJ@VWbXVmI@JVX@bk‚@bWL@JUXUK@U@Uƒ`n@@Xm@XVW@@nX@@`ƒImxU@@JUI@KƒLmK@UÅUUV@VW@™¯kUU@UamVUUmJ@n„xmLKƒkmJkwkKm_mKXU@aƒU@b@Wk@ma@zUJVUmbUlU@™xnXlWlXXblK„¤V@@nUVVLkVš„l@Xb@VVK‚nXKVx@znW@X‚@@lVK@X@JXbWbnn@JUamLVVXIVxnK@aWUX@˜x@VnI@WlI@anV„IVxk‚l@lbXXšxVVVJVInbV@@ln¦ml@XXVWbkJWb","@@XLVKVXVKUa@UUUmV@l"],encodeOffsets:[[112050,28384],[112174,27394]]}},{type:"Feature",id:"4311",properties:{name:"永州市",cp:[111.709,25.752],childNum:10},geometry:{type:"Polygon",coordinates:["@@lxUXV‚lXUVnlVĢ„JVbUXVJV@XUW¯„VIUK@klW@Un@„nl@V`XUVL@l@šVx@„XXW`UnUbšxUlVnUšV„lb@VnJšUVVVInJlUšVnwVklKnw„LVJVšV@nIV@nbVa@KVVVUUa„KV_nVVJ@_VW„nV@n¥lI@anƒl¥X_VKlwVlULUVVVš@šU@VXL˜ƒ@IUmn@VU@wmKXUWU@m²šl@VIXWWkWUkWlkIVamUXamUnmWUU@@Un™lK@XJl@kVUk@mWKXkl@@aVU@UVWUUVa„In`VUVLnw@U@K@Uƒƒ@w@UVmUUƒ™°K@UnV@bV@Xk@KVm@amk„aU£VWUUmUUwm`UbULka›KXU@kVmU™@aV_UWVIn@˜y„XXK@klmV„V_kWVUn@WUU@UƒmaU@™wnwWanUmmXkƒam@UakLmK@b™xUUUU@Km¥Vaƒ¯@ƒkUaVUlm„UU@mUUÇmUk™Uyƒb™bUa™XUWWbÅLmL@V™aL@WWXUKmmk@a@UUK™XW¥kU@VƒUkxmVkUWbUJnVJ@nVJXzWxkŽ@lVbUX@VVL@`mbUnšŽUn™VV¼k@Ulm@mwLƒb@lmLUK@UamƒWkƒK@£Ua@ƒ›UkJkUmbVlkX@bWbUŽVŽnnUVl„@bšbVK@VX@lb„V@nU¤šx‚²„Knblb@x„V„ô@šlŽ@b@l@XWxnVl@„VV@XLVl‚LUŽUXV`šbXXmJU@@bm@UUkLW@UlUKWUUb™wUm™L@nklVVmVXXm@@bUKlÆn„‚XkllVUVVL@nUbV‚@V@nnV@xUn¯U@JW@UX@xĉ@™`m@@LV@b"],encodeOffsets:[[113671,26989]]}},{type:"Feature",id:"4305",properties:{name:"邵阳市",cp:[110.9619,26.8121],childNum:10},geometry:{type:"Polygon",coordinates:["@@XIlJšI„VVK@n@VVVKnLVwVmnLVK@U„@šw„J@wVIƚ°X@ÜȄUÈxll@kn@VwVaXJWXn@@WVL@UUKVKV_U@@aVK„x@U„aV@lk„@XylbUaV_šVnal@W„U@a„I@aV@@aVUl@Xm‚UXWaXml@@kk@ma@V_UnUV™UUWJUa@kkaWLUmk@@LUVWUkJWkK@¼UnWJƒIkV@b@JUIm@Ul™V™m@Uw@a@kWƒXWKUknW@ƒWUU@k™mx™UkVmIUJUU™VmI@UkaUƒV™UmVk™wVaVmX_WW@ƒUw@™@kUKWVU_k@ƒmm@@VkX@lVLUJƒX°WVU@UIVWUaƒIUġmkVUkWUVWkwWXk`mI@¥kUVƒUƒUn±@m›XkWknV„UVmmU@@XƒVƒUk`@Xƒƒƒk@¥¯»mbĉó@mkU@kU™ƒƒ™KmX@˜UnmL@lULkKUƒWUU@ƒbUaUnƒ@Vb@l„¦Ub@l™@UKmnƒKUnl„UVVbUVn„@`Vn@xƒb@x@VL@nmJ@nU@mmUVkI@xVVVxkXVxmV@bƒbXVl@Xl‚XVxna@Vn@@VVL‚aXaV@n„‚@@V@X`V@@XVJ@XV@UºkXVb@xlVVKnbm„@VXLV@n‚lL@VxšJV„ULUb„`lb°nXalKnx@„lbšmn@lbULV„„V°š„ƒnV@zšš@Vl¼lb@VUV@bšmLV`„„@n„KlVnU‚XWVLnnlV@xVLU`VbV@"],encodeOffsets:[[113535,28322]]}},{type:"Feature",id:"4310",properties:{name:"郴州市",cp:[113.2361,25.8673],childNum:10},geometry:{type:"Polygon",coordinates:["@@²zVaVlnVl@nšVk„Jl_XJlIVmnL@mV@VXn@lV@‚XzV@lyV¯²U@UlJ@XVKnVVIXl@UVLV`@n@J„I@mlI„KVLnUlVUVVLXašKVLl@nb@ŽW„XV°KUnVV„L@xVJ„L@b@LUVVVU„˜VXbmbVbn@@lUbm@x@XVVVŽ@@˜@bkImx@Vm@Xbƒb@l°XU¤„a‚L„mnL@bl@@™VUX@VxnV˜anLnƒWƒ¥XKVwnUWXmVIUWÆLVx„L„w@wVmlU@¥XƒWUkwlÇn_Uw„WV@VU°wnU—ƒy@aVškVlnL@lVn„w@VlJ@b„X„x@bVKnb@U@WVUl@@Vnbl@XLlK@aVLVKnxÞn@a„LlmUaVU™ƒm@ÅknUmaUKmVk@m™kk@UlWUkVm@w@kUU@W™U¯™¥@w„Ç@aVIlUV@kUWU@UUm»@k@mKVkUKUwƒaUaUa›@k„kUWJkImaU@UK™@maUzk`@zƒy@XmJkL@UUJmUkV@z›@kŽkVmK@¦UbWL@a@UbmKmwUK™Xk›VUUkmVkw@UUKmL@WUIWa—JW_k@@WmI@mk@WkWULUUVKUUVm@šU„bš@‚nUǃ@U@w„™V@Ua@aƒL@ak„›l@k™UƒJƒwó@@L@V@„™`@œƒJ@xnn™šmV@bkJmUó@ƒn—JW„UUmƒU@UV@Lk„WlnnmVXbmxšxV@nbV„V@XVm@UVlXU`ƒUŽkn@lWLƒW—zm@UJVXU`@bVšUn@lWVœLlbVKVan_VxnVVVUXV¤ƒbnl@bUn@LWlU@@amU@V¯L„šVVUn@V@x„„@V@L@VmxUKUVm_ƒJUbVV"],encodeOffsets:[[114930,26747]]}},{type:"Feature",id:"4307",properties:{name:"常德市",cp:[111.4014,29.2676],childNum:8},geometry:{type:"Polygon",coordinates:["@@l™U™mkUwUyV™@VW@¯Va—VmUU@KVUVUVLnaWƒnkUÓV_@mVU@݄w@ƒka@kVmƒUmK@IkaUamKkXWaUW@WUk„™@@KVU@aU@™L@J@XÇVUKVak_mWkLWakVUbmLUUmlUVKUU@kUWW@UImJ@xkLkKm@@Xƒ@ó݃@UUk@UKƒV™ƒULƒKƒXkWWbkaƒIUƒWU@mUk@WLaUJġ™ƒ@@XÈÆVIl‚„Vnz°aV@U„m@X`@XWbkakJ@amLƒaU„@V@L°@@bn`š@@XWb@VœVlšUxmb@bUVmVUI™šXVWnƒJU„@nnlVLƒV@JbWzk`m@UVK²V‚x„k„LVl„@Vn@V„„°xVKVkœVVlUblx@bU„‚Æœ@@nVnUll„kx@VW@@VkLWxUL@bÝ@kKkVõV@bkXVVUVƒ@ƒVkUkV›LkV™a™@@™ƒ¯xUxmX@JVb°WXkK@Vm@k„Vb™bn¤‚xUXkJƒblxnXÆK²l‚_@Wnašn@ŽUL@b‚JnIlV„@lUœ@@¯ô@lWȂIVKVm„U@aXaV@lwVXn@@K@UVKUUnU‚bn@lWšX„ƒlJnUšLšKV@„„l@²a@UlK@aV@naVX„WV_nKlL@KUm@a°U°@VXL@a@wWmXal@„k„@VLn›V@@bl@VnX@mwVa²aVU@mk@"],encodeOffsets:[[114976,30201]]}},{type:"Feature",id:"4331",properties:{name:"湘西土家族苗族自治州",cp:[109.7864,28.6743],childNum:8},geometry:{type:"Polygon",coordinates:["@@@KšL@wnK±nƒnm‚—@WUk„ƒÜÈn@n»@mVamk„mšU„„l@V™nmmU@wUan¯VKšLn„VWlInyWUœI@WWk@KXU˜n@mnUmU@WœƒmkV@ƒkXašaVaUm‚Ikƒƒ@kaƒX@ƒUm@UKWU@UkJWkXa@IVy@UmIUVU@UJU@WXWmU@™VakaU@@Xm@Vm@wnwV@VL„yV@VakUUa@wUUVmlI@K„UVkUamJk@VU@UmVaƒan_@KmUƒ@@anm@ImWX_WWUk¯ƒ@k@Wƒ_m`@bULUKUnUWWXkKWaVmnU@@b¯UUbVŽ±K@UKUUVa¯UUmJUƒVIXmI@UU@WmVmkUV@b¯w@lmI@W@aƒ@m¯LXbmJVLklWL@V@XXŽmbVVU@@VU²Ul@VlX@bš`Xx›zUmkUVÒlŽ@bXLWxXVlš@V„bkLma@nmVmULVbmVUb@lnzmbUÒVl@°nLV„lJkn@bmJk_ƒVmmkblxÈx@LUb„xVb@V™n@JmLVŽUš@„nV@¦VbnJ@lVVbkx™bm@UxVLV@n`UnVVV„kl°z„xVb@VU@@ÆlXnWm¦nbVK@XVVUVVl@X„KUV@nVL@WnIWŽXLVKVLlxUbVKXVWbn@@UnKVLVb„JšU@aVU°b"],encodeOffsets:[[112354,30325]]}},{type:"Feature",id:"4304",properties:{name:"衡阳市",cp:[112.4121,26.7902],childNum:9},geometry:{type:"Polygon",coordinates:["@@lšV@XV@„mXVlXL„W‚X@l@bVxn@šŽšUVkn@VJ@I@alU„JXIVm@»‚LXllIXVVU@Kl@VnXKlb@lVbXIVVUšmVVU`@nbl@@lXLVVVKVbnXWJ@VXbWxXb„Ul™VK„¦nLVVUVVbšb„K@U˜LnK@Un@VxlUV`UnnL@VVL@JV@VUnxnKVbV@@VšIVUnJUVUl@nW„XllIUa„KVbÞLV¼²`V@VIUwlaVmXa@IWanK@U@m„kVƒVUVaX@lšnaVLÈ@‚¥@kkJUWJUaƒXkaUm‚wVXJ@_lWUU@¥n_‚KkamUK„™@amKƒnKƒbV£¯W@k„aWan@@UnwlJ@a@—@UUU@W‚wn@Va@km@UanaWa—UVƒUUVU@K@aƒKUI@wƒKUUVm¯LWUXƒ@mak@UK™LWbUKVUkUmVUKƒLkJ@nƒJ@I@mU_UK@VWkUJmUUL@WkI@V±VU°kzU@Wy@kUm@UWU@@nmKUnkJWIk`ƒIUlm™k@mUUkUb±yUX@VUV@bk@WlXL@nVlUl‚k@WI@ŽkLmš@VV@XVmnnVWbnVUblJXkVl‚XXlWXUJk@±™@nXVWVnL@xUVm@Vn@J—„WK@U™V™@UUVUVKUkkxULW`k¦m„@bkJm¦U@ƒmUX@`UImUU`ƒLVbUVUU@LUbmaU@mJU@U™UIƒKmxkLUl"],encodeOffsets:[[114222,27484]]}},{type:"Feature",id:"4306",properties:{name:"岳阳市",cp:[113.2361,29.1357],childNum:7},geometry:{type:"Polygon",coordinates:["@@@wUklmUUmU@@UVm@wUaV_mmUKmwkIkJmUUnm@™™@UUƒbUKUƒmÛamm¯xVLkbÇƃUƒVUzkVUlƒUUKWLX¦W@ƒVUUUaƒKUbmLKm„@akU@aƒmVaUUVIVWkk@wkƒƒ@@xmLlmÅwmbVlXlÝIWVkK@kkVƒL@VWKU@Ublnaƒƒm@b@bšnW`@XUJk@UUWKƒk@UKƒnn‚@xmLUVm@kbVbV„nV@V„b‚@KnV„LWšXŽÆVĢ¦VblŽš„n„UJWz@ƙVóUVbkV™aÅx@¦lVUbVVknWKƒ„k@ƒwƒK™VU„Å„ƒl@zkb@`m_mJ@xX„mbVbœ@llV@n„@llbXL˜UXalUšl„alVnwnLVKlšVbX@@I„V@blJ@bVL@VVVUXȤ‚VnkVÑXmlbnš‚„VKkÑř@UmaVç@±XUlI„xlV„@VaX¯lUVVUšVJn—V@°°nŽ°„Vxĸł°¦šb²¦lJ@U@aUK@kUm@_m±VIXal@„Kl@„bV@K„K@k„m@UmUUaƒK@_UJƒaXU˜@Xmš_VmUk@WUk›@kU@a@m@UƒaUUU@al@ny‚XXWWwkly@¯n@@bnV@k@mVI‚„œVlUUmlU„JUw„I‚bXƒVaUal@K„b@ƒVKVkXVl@VkUU@ylUœVVaVL"],encodeOffsets:[[116888,29526]]}},{type:"Feature",id:"4309",properties:{name:"益阳市",cp:[111.731,28.3832],childNum:5},geometry:{type:"Polygon",coordinates:["@@„ŽÆxXL@l‚V„@ĢšVI‚bXKl@nVV@„XVŽ„JlbXalX„W„LVKš„„UVLl@VV„@ôބ@@Wn@lLlK@wnIVJX@VX@lVVUL‚VnkVVnKValUXblKnXl`UbVLÈU@W@IšKV@@bUV@Lš@lƒXV‚@VXXblWnLVblb@JnL„VUn@llb@„ƒx@ÞUV@nU`VÔmlX„mbUKUVUV@LVVUn˜ŽUb@°UXš@U‚VzVxnlVškšVnlVnaWƒ@wnIn`@_la@y„kƃVƒšU„L„xl@„ƒXLlmUUVakU@¥ÆwšblUUaôVšU@ÅXyVImƒ™ƒkUaġ¥ÅUWX™ƒKmU@Lƒa@UmUUƒUalan@VUnK@wm„m‚L@V„lXLVVl@VI@WX_™m@a™¯mKUkwW¥UK@_UWWLUVkUWL@WUIkVƒU@JƒwkLUUmJVI@WkXm@VmkKUIU@mmm_@VUV™@™„kJċwUU@KUWkkW@IWW@km@klwkWVkkU™V¯m@kWLU`mIkmkXm@@`@L@xUKWkU@VL@JUU@mbUKVa¯WVnL@`lXUVkU@xW@UbUWVU@UJ@„lnU@m‚nÈmVƒa@bUL™wUb™@@VkxmUUƒ™UV›K@IƒUƒmk@akm@wmIƒŽkK@b™VWXkm@wULUmm@UVW@Ub„mbkKƒVn„U@Wl„xV„U@UXmWUXmlnbUl¯Lmn"],encodeOffsets:[[113378,28981]]}},{type:"Feature",id:"4301",properties:{name:"长沙市",cp:[113.0823,28.2568],childNum:5},geometry:{type:"Polygon",coordinates:["@@lVUllXkx@lln@‚XX@JlXXl‚V@LVVČxlIšƒš@VU@Un`nnV@VJlLUnn@lW@XUJnIVVlK„x@I„VlUVJ@XXKlVVUXKVX@`VLX¦lxVŽnLš°‚an@„„‚bkmVaV@XL@U„KlU@llLXUÞJWkUknaÆxnŽ‚knK@w„@l„@xllUXUJVVUb„n@blV@bnƒ‚LnKVa„LVbVV„UX@W¥XKVL„VVklUVy„U„VÈÅlaUK°wnnÜbn‚V„VL„aVVš@šn@VmnVlIlJna„@Valkn@na@amwm@„UXw˜K@aUUVUUaVa—wWK@kU@UaW@kKUUƒƒ@k™W¯XWan@k„™mmÅ@@I@U@KmLkaVUƒKkLWVUƒk@UVmU@am@kkk¥ƒUƒVUK™„maUb@ŽUb™I@aƒKkkWm@W¯K¯b@VmaULVxUXlVk@UxVJVbUb@xULƒ@ULWW—LƒĕmxVVL@šVb™KUwƒaŲWwX@@WƒUWLU@VbkV@aU@@VUnmJ@VUn@VƒLUK@U‚mUIk@UÇmU@@UW@J@LƒbUmVI@aUmW@@bkXUx@lmLUbm@UbkJ@V@XmlUbkKm@ma@kUaVU@aUK@mImJUIkVƒUƒVUakbWwka@UWKkLUamKUXm`Å_U˜ƒULmaU@@lUV@X"],encodeOffsets:[[114582,28694]]}},{type:"Feature",id:"4302",properties:{name:"株洲市",cp:[113.5327,27.0319],childNum:6},geometry:{type:"Polygon",coordinates:["@@X‚‚Unw„Ė˜KXXVK„@VK@wVaUaUIVwl@kUVWUwVKnb@U°a°LXŽ‚@Xnll„L@bšJVa@VanbšƒVL„U„V@al@@UV¯ÅÇ@Ummk™w@¯ƒyVwnUVVVUkmWV—nKVUƒa@WXkVKn@lUVU„VVVXIlV°VnI@VlKnV@mwVm@LXKWkU¥wWwƒƒ@k@m„X@KX¯V@VUVa@VnKWkœƒV@VUkm@aWa@wkUWwkmV£VÿXUVL@mVIXaò@nW@ašUš@@am™@aUU„UmXmWUk@ƒƒnUW@_maVm™wUkamaUL@aƒwƒW@akI@UƒxUm@kmKUk™lUŽ@b„zV˜m¯xUVU@ƒXVxm`kÈlxXVW„@¦kVUn@xƒxƒKUwÅKVXUJWnXŽmVUxWL„¦XŽm„mK—bmUUwW@UV@šk@ƒšVLnŽlbLm`@¦VVkX@`WIUŽxVnlb„WVbXIV‚lI@l¦Ç@UKmbk™W@UbUVU„ƒl@n@VmLXb@JWbUnkbVxUJUxWXXlWL@V@V@XXJWx„zUVVVVKnXW`@bkIUl‚„nLVJUbUIWVXlWV@XklVbnn@xlš"],encodeOffsets:[[115774,28587]]}},{type:"Feature",id:"4308",properties:{name:"张家界市",cp:[110.5115,29.328],childNum:3},geometry:{type:"Polygon",coordinates:["@@@InWVw°wš„@š@šblUœKlUlV„U„@VUUUlW@aöUlUlLÞ@@aVKXwlK@UX@@UlwkƒVkUm@m›@ÅVƒ@akwVaUk›UUlUL¯wƒƒ@UUmƒ@UkƒKƒlw±UULVn@l_XyWwÅ@VUUmJUXU@@mmƒU@kxW@UaUIWbU@@mU@UxƒnUbmKk„WJkUValƒ@aUkUxƒlW_@WUIU@ƒbkKWUJVnUb™bWb„lU@nl›„@XnVmV@n—mWV@LXl@X›JXVmzkJUXmƒ™KULm°Vb@xnVmnUšk@ƒƒ™VƒnnlUb@nm¼m@Ûǃ„Vl@X˜mnm„²ŽmL@x™K@LUl@nULÆx@V@VXVWbXX˜l„@nLlm@bVKœX‚W„L°bnUš@VaVUš@šmšVw„JnwVK°zn@V‚Vb„a„@Ċ¼"],encodeOffsets:[[113288,30471]]}},{type:"Feature",id:"4313",properties:{name:"娄底市",cp:[111.6431,27.7185],childNum:5},geometry:{type:"Polygon",coordinates:["@@lL„nJ@xln@bnlV„‚„@JœLVUšŽV„nVlw@Uš@VašxVK@a„bnUmÇnV@km@ƒ‚I@VUVVXVaX@@wlVVUkW@_mKXU°‚UbVLnaV@‚V@IUKV@XlVL@w@K@_n@lWlnnJV_XK@l°nšU@WVU@kV@nbVK„V—lƒ@nLlƒ„LXU@ƒlmkw@nW@UKVa¯IVn@@aVUUKl@nXVKVn²a˜ŽXblKnLlmVI@KUU@akLUaVa‚UXm@aƒ@wVUVKnLnWlXl‚n@@U@anUVm@U‚Inm@IUK@UmKVmU_kVUwm@@VmL—K@VƒL™aUaVUUUmKƒ¥ULkšƒVWaXwWa@UXImWUaULUUWKk@WnXbWŽVWnk@UV@bU@@bƒJ@bƒV@XkŽmb™UU`VbkaWzƒ@klU@ƒb@VƒwUL@bV@U`ULVL@VUK@Xm@XWWIUbUxm@@lkkÇwƒVÛÇW@¯Å™UJ@xƒI™xƒ@@VULmKUnUxmKULUUm@@‚ULƒU™JkIWJ@b@LJUW„kJWnUV@nn˜Ü_nJšxU@VbšnUxlškb@lš@"],encodeOffsets:[[113682,28699]]}},{type:"Feature",id:"4303",properties:{name:"湘潭市",cp:[112.5439,27.7075],childNum:4},geometry:{type:"Polygon",coordinates:["@@Æ`n_VWnLVblKXL@VlbXxlaVb„U„VlUVJnInJ‚@VL@bUVVb@lnbn@lLVank@W@UlIVan@VanK@kVwlW@aX@Vn@bUJVn„a@K‚IX@@VV@nŽVÈl@VJn@VVL„K@UVm@UnIVm@UV@@blUUaV@XK„V@XW@XxƱ„bVxšLUa@™UKWk™@wmmUalk@WXUWkXUVJVaUImKƒVklJ@aX_mWULUUVUƒyXwWI@W@U@UXKWkXWVwU@±_U»ÝKUaƒLVbkJkƒWmXk@UVVŽmIUV™J@UU@UamLmwUVU@mnJ@VUnmV@b@Vm@kkWmXmKULUV@x„Ž@bWnVUbVblK@bVV@LUJknmKkLWa—±bUmULmWk@VLUV@bm@U°JUbVLX@@mlxkn@„WVƒKk„mK@k„"],encodeOffsets:[[114683,28576]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/jiang_su_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3209",properties:{name:"盐城市",cp:[120.2234,33.5577],childNum:8},geometry:{type:"Polygon",coordinates:["@@„n@‚°ĀÞ°@¦ULWKkx@bkLWb@lUlVXXJVbƒnUKmxXV@bm@@Xš‚„LޚܦXlVnš‚mzVJ@n@‚²ÞôkƃÞaȰĉ‚wnljÜó„éVÛnĊīČlj‚ĉ@ō@KÞUlU@ƒkklÇÈњÑlġXɛ@UġƒƒaU@U_ƒW@n™@kaUL@VW@kKmkUV@bkbWW@bkzma@ƒJWI@KUKULƒ@U¦™`@XUJ™U@KmXƒw¯KXkmy@aUIWJXXmV@K¯UU@@bVL@¤VLXbV@@JVXVK@„„JVn@bkKmakVVXUVVVlI@`U@nzVVƒb@¤n@@UlKXLVVšI@V@nV@V‚@ÈUx@šóVōšƒkÅWó@mU@bk@Ýwk@WbXxm@@J@zV@kVƒbV‚nLWVUX™WUXUŽWLUŽ@Wl°z@VkxU@UVWIxWJkbƒĬ„nW@@bUl"],encodeOffsets:[[122344,34504]]}},{type:"Feature",id:"3203",properties:{name:"徐州市",cp:[117.5208,34.3268],childNum:7},geometry:{type:"Polygon",coordinates:["@@XKVX@WnIVx@K°Lnll@@I°K„nVašU°x²mlxš@VanU@aƒk@akmV@@w™@Ua@aUwVwUw@w›@UK@£kaĉlóIÇVkŽ±@@kUKmVkIkxW@Ua¯UUm@UVI@WVI„JV@ƒ@Um@Uana„U@m‚I@J@XV@XaVlkXƒVaUUWLUyVIXmWak@ƒXkJókƒJUL@KWkk@ULU@Wa™lUIkJmI™mk„VbVš@lV°kXUKWKULU„mb@VUlVnƒb@VV@IVKUUmU@ak@@bmV@xklƒUƒU@UKmV@nƒJVbkXƒKUamLUJ¯UUVmI™bVV—Ll`@LƒLU`m@kXUVU@V„lxUK@xkIWbUKƒx@V‚kVVn™b¯@@U™@ƒxk‚mbkLÇK™b™@@XnJ@LmVklƒ@@XƒlUƒVkxƒakVVb@bVnUbU@@x˜VUšVb@š„ŽnIĊ`šXVVôJš_„K@xlU²Klk„U„@VaVVÈm@kVUVmnamUUaVƒXIVJ„@‚ç@¥nkVLn›„@@XVK@VUX@JVUV@UnVJVLUJVLUVlšnI„b‚KnU@m°™VanI@anV‚KVL„an„lK„blš„KÞk@¦@¤@„VKnLVK„L„KVzlWšLX@VmV@VbnU°@Ualk™˜WXLVU„KWkUUWšƒ@£Wa"],encodeOffsets:[[121005,35213]]}},{type:"Feature",id:"3206",properties:{name:"南通市",cp:[121.1023,32.1625],childNum:7},geometry:{type:"Polygon",coordinates:["@@VJ@bnzWl°L„xnW@LšVVI@Wš_V¥„@VKVL@LXJ„I‚@nbly@aXXla@aVUnllLX@@UVKlbš@@m„XV`V@„bĢ„lkČÇƃȘ¯šwnĕVĉVÿšUƒUĠƒŦğlXÑVǵ@±ōLʵĖ¯lÇbÝÞ¯xk@Çkķé™n¯@ğŽġƴǫ@kVVlUbƒL@xULǂóLUl¤@nkVV°VLkxVb@l™aUXUKWĖklVX@¤UšƒUkb"],encodeOffsets:[[123087,33385]]}},{type:"Feature",id:"3208",properties:{name:"淮安市",cp:[118.927,33.4039],childNum:5},geometry:{type:"Polygon",coordinates:["@@šnźUôÒɴ胚l¦nĖV‚kbmš„X@xVlVL@xUb@bUJVnUx‚šœ„lKVLÈx‚m„zXV@lW@XV‚b@bȚVxnb‚ƒVIXa°L„aÆVVaXUlK@aXIƄVlXKVUlIXalK@alwXLVK@¥Ý¯¯ÿ@ƒmVk@aX@ƒm„īlaXI‚wXJVUV@lw@U¯yb›UaƒUġUÅaUKVknaġm@kUm@wÆIV±nLÆw„ÇnUUkƒ@ƅÝU¯JÝI¯¦Ul@bƒ@@VVL@l@LƒLÅmƒL@b™@UaVaUWmLUKV¹KƒLWKX¥WI@mXk@UmaUVUU@VmL@W™bkIUWƒUmVóIkbmm™@UbVLUxmJkU@bkJWbnXU`Wz™KUÞÈlVb™Lmx@„kè@Æ"],encodeOffsets:[[121062,33975]]}},{type:"Feature",id:"3205",properties:{name:"苏州市",cp:[120.6519,31.3989],childNum:6},geometry:{type:"Polygon",coordinates:["@@ôèĊVnX°¤²„lxƒÈÜ@²x@J@b@X‚`nIUƙUUV@bl@VVnL@L@xƒJ@X@blJXnW@@`XbW„kVƒ@UbVxƒXUxkV@LóxVbUVWš²šVJĸklUǬ@ĢƳĠ°@šmƒī°»ÈÇ¥ULUU±a@bU@¯ƒU@KnImUVWUk™mXUVU@lIVaUUVWKUbUkWKU¥n£WakJUkUL›K¯L™KkƒVIn@VaUƒVUUƒ›UkVk@ƒU@amUkJƒ@UUlwX¥W@@UkVmk@JUakL›@kk¯ÝmJUn@nmVXlmbVVkn@„UJ@±WUxV¯a¯KōbżÇxUxƒšUUlWL"],encodeOffsets:[[122794,31917]]}},{type:"Feature",id:"3213",properties:{name:"宿迁市",cp:[118.5535,33.7775],childNum:4},geometry:{type:"Polygon",coordinates:["@@XbWnUJVzXKVVUbW„klUWbU@@W@IJ@nƒVmbVbn@@V@„UŽƒIUJ@XUJ@VVn°VVbX@lwlJnUVL@l²@lÈUôJĊklb@¤VLœ@@xVxUxVx@bVbš@@xU@ln„mnX˜mXLVmV@X@lxVnVJôL„LXa‚x@b„@@KVL@bn@@m@™@alLUUVaU¥nIV±‚I@mXI@aWWXU@LlUXWW_XWmaUwǙ@aaWUX@@kWUƒynÇwUKkL›ƒ™VwUmVI@aVa@wUKUk@wƒWn™laUmĕk¥„™ɳçóÑŹV™mmzkVmm@a@Ióƒk@@LWU@`—„WbXLWlkImJVn@`nXVbXŽmL@Vn@‚l@nUVl°Xx°U@LVĠ@z°˜@¦UV@Xn@VJmV"],encodeOffsets:[[121005,34560]]}},{type:"Feature",id:"3207",properties:{name:"连云港市",cp:[119.1248,34.552],childNum:5},geometry:{type:"Polygon",coordinates:["@@@‚lzXxmÆV„„@@¦„@l`XnlKšXXm‚KnLla„b„@„xmbm@kL@V@Vl@@VUXšJX„mbš@@„°Æ@èÈzlW°XĢJlÈ`lInbšWV_@mš™@UUķnƒôw°ÆmnaVƒVÛVmĸ»Ģw±Ý@@mUIny™UmWkۥݙƒK™@Wn@@aWUnwVL„mUaWIUWVk@kkJUVWLUkŃWJ@bkLWVUbÅUƒb¯KWbUJ„WXX`WXkV@KWVXX@bWJ@nJU²mJV¦UbVVkK@b@š@nm@@aUK@Lƒ@@awWbƒKóKUIUmkwW@U@UnWK—nmWƒn@b„l@bmVUb™@kw±n¯w™VUb"],encodeOffsets:[[121253,35264]]}},{type:"Feature",id:"3210",properties:{name:"扬州市",cp:[119.4653,32.8162],childNum:5},geometry:{type:"Polygon",coordinates:["@@VUXblVVV„b@xV@kz„V@l‚wVLUbVV@VU@VbUbl‚b@nkĶ°IÞV@Ɔ„VlmVƒÈÅxmKU²ÅJ@xVn@lĢnmbUlVLÆbĢV„V‚bœV‚aXk‚@VXKVVWšXVWXUmKU„aWaU@™¥@£XW‚UUV@@ynam_VWkUVUna@ÆV@mnkWmXkWU„W@k„@@akklƒlWUI@UnKl¥™I@VVma@a@I@U@a@anK@UmK@ÅVUnJl™kI@aVwka@mVIUW@UWL@WÅbmIƒƒULka™UWƒUxkLUKWlXL@VƒImƒÅVƒU™mĉL™Uól¯I±l@ÒUbVbUVVXUJUnVV@lnbl@"],encodeOffsets:[[121928,33244]]}},{type:"Feature",id:"3201",properties:{name:"南京市",cp:[118.8062,31.9208],childNum:3},geometry:{type:"Polygon",coordinates:["@@k@ma@kUUVmVIUWVUUaVa@Ѳk°Jôk@Wmk¯KmX¯aUakKƒƒWU„@XU‚LXaV@@mUaVUUl@VmkaUXm@ƒWUUna°IlmV™m™IUW‚@Uk@@aV@VVX@„V‚I°»nm„U@VKVan@m»UaU@U_@WlIUa™aVaUala@¯n@‚ƒkaUkUUWKU@mwkUUmmL@K@ƒLmUUVƒKƒVÅImU—JƒƒVkVVLšèVLVU@W„L„V„š@nVÜULVŽUL@bW@XbWbkJƒUUVUxVXmVk@WUUkVmIƒV@„nbnVWbƒJU„kUULƒa@Jma@XkK@VVL@L@JƒLUVU@V¼ƒnXlƒbm@kbUKmn@lVb@VXXV‚UV@b@LVbÆxXbl@@lV@U„VV@XVK²VlIš`„UbVbUlVVn@WXn@@VUV@„@KmbVLXқLkKƒV@nX@VVUV@b™nVllbšmnb„IWVXU@`lLlknVnmlLlbUmVInK°nUƒU@l@VU@Vn@„ƒ@alI„`VIXaVaVa"],encodeOffsets:[[121928,33244]]}},{type:"Feature",id:"3212",properties:{name:"泰州市",cp:[120.0586,32.5525],childNum:5},geometry:{type:"Polygon",coordinates:["@@lUU@@y@In@WwXal@Þxl@@anVô@ÆX„lŎ™ôU@™Vw@ÇUU@@m@U™JUUWKkL@Vm@@£„aUUmyV@@_kJUUVUUWlUnblL@aUmƒI@ƒULUW@IU@WaUK@£UK@aV@°V@LnUWWXIla„VV™@£UWlkXĕVLVWšb@kUalwUKU¯lU@mk£VôKȁVK@w„KVaUkķlUI±™ğ¥ÝUŹš™Ž¯ôm¦ƒĸ™‚@XXK@VVXUJ@nlbUx@blJkšmIUV@ÆnL@VmL@b@b@V@J@bnb‚U@UšJk¦mL@VVJkXk„ll@bƒ@@lƒXXVWlXnml@nÅU@ŽmbUVlVUXn`mb@zU@V‚VWX@¤š¦V@Xb"],encodeOffsets:[[122592,34015]]}},{type:"Feature",id:"3202",properties:{name:"无锡市",cp:[120.3442,31.5527],childNum:3},geometry:{type:"Polygon",coordinates:["@@nLƒÒlxUVkL™am@™ƒkVWUULUxVVVbUV@bVLU‚nnź™ÞVĠ¦X™VUUaôw@KlUVw„WUwVa„@lUXƒWa@_X@WmkI@a@W„I@w@KmKUUk@@aVUšVVÅmJ_@W@a@I±wÛ@ƑÇkw±ƒ¯£mWĉUóçƒK¯VkUWK@XkV¯UWabƒmUa™UUb™lln@b@xƒbXŽWX`@„VxUblL@bn@Vb@`m@XbWnn@l¤„n@xnVlU„™VLÆWœkV@VbÞJ‚_nƒl@nKVU@aU™U@mVk°WVLUV¯bVXŽ˜bXlVn@VmL@x—V@bl„š‚@œnW@X@VVJ@²VJVU"],encodeOffsets:[[123064,32513]]}},{type:"Feature",id:"3204",properties:{name:"常州市",cp:[119.4543,31.5582],childNum:3},geometry:{type:"Polygon",coordinates:["@@„L˜ŽnxUbVVƒL@xnnW‚nn@VVXn@‚yœImx„„°ƒšL„a‚¥n@VkšKVw„W@nX„VJ@b‚@UVn„ƒ@UnUV@L‚b@`VLklVÞn„Æ@VaXLl™ÈJšmmVUK@aVUUaUUVwVKXVlUš„n@šblKVUkw„ÑmKUVUI@±UI@U@WmX@›™kƒ@a˜U@wnK@UUmWk—aWU°aVUUK¯XUl@nVŽVš@bUVmLk@m„`ÝIUaU@›lÅXUKƒškVmU@wƒmk£m@XmWan@@_Uam@@akKVaUw@ƒW_XW„a@w@akmm@mL@UJmnUKƒ@@XnJWLkKUb@„Vxk„WƒL—aWVUImVULUK@L@lkLVVVllb„m@@°kbVbUbšbVbkJ@XV`V@Vbn¼"],encodeOffsets:[[122097,32389]]}},{type:"Feature",id:"3211",properties:{name:"镇江市",cp:[119.4763,31.9702],childNum:4},geometry:{type:"Polygon",coordinates:["@@šVĊKšn„VÆUn„„J@UWKXkVLlKVwX„šVlbVK„„nJÆaš„ķn¥°óÇIkšWKUbÅ@mƒUÝlkUK@_a@KVUVm„@mƒVU@@aUIWƒ@mƒXUx™LUlm@¦ƒb™K¯„ƒƒnw›Jzm@UW@UmmXmm@w„KUUVamw—ƒKm@UbUL@ŽƒVmn¯¼JƒUW@UUU@@bl@@VŽVXšJšnnU‚‚k¯JmbVV„Xn@VWlbUnk@VVUŽVb@nU@WbKWVƒ@XV„„lLVb°bnW°Lnl@X"],encodeOffsets:[[122097,32997]]}}],UTF8Encoding:!0}
-}),n("echarts/util/mapData/geoJson/jiang_xi_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3607",properties:{name:"赣州市",cp:[115.2795,25.8124],childNum:18},geometry:{type:"Polygon",coordinates:["@@„`l@Èbln„@„KVLl@„V@bȎlnšKXkVlVL@„lJnb„¦VKVVnX„W@w°@VU„mln„UV`šU„bVUV@„xnKVI°KXKVkVL@al@Xa„LVlULWV™VVL@b„x@VXVmb@x@V™VV@nn¤„šlb°b°KXXWbX`lbXx‚z@x„`VIVUnK„L‚x„WXLVKVbVLVU@wnW°b„@nalX„‚mXVJn@U²mKkVl„U@@xlnœaVmlKnœ@JVLlŽnVššl@XXÆèVlUX@xVLXVšb°W@wnUWmXk@K‚LVwUmUkUKUw@wVaVK@kƒ@WnkUKWkwlmXL@KVUlLVKXmWU„L@ašL@malaVk@aa‚ašƒnXš@VVUblb„Jn˜ƒXa„V‚wn£„K@UWmUk@ƒUaWIV@b™JW@KmmU@aUUUkmKkVKlUU™nKVU„lVaV£Å¥WUUK@UkUUw@m@mIkƒƒUUWƒLƒK¯Uw°¯@wUKUbƒKmƒ@kkKUL@UUKV¥U@manw@k@U@Wm@@U@Wwkm„wWaUU@UUmV¯kwƒ@@kmƒkKkUW@UK@ÅV@XWWkXa@Ul@Va@KVaUUU@ƒaXwla@UkVWaXk@K@lmkUmV@Vmbk@ƒ»XIƒ¥VUkƒVUVU@anKVUƒKUalU@wX@˜™@a@K—@ÝwƒL@ŽUnÇlUIkJmn@ŽƒbVVb@VmnkLƒV¯U@ƒ±l—IWmƒ@kaUI@aÇU@K@KUIkbWbƒJUIUyƒX¯ƒUbU@méUUmUk„WK—xWIkJm@V¥U_UJUwmVkšƒUU@ƒƒƒ@knƒwm@UmkWJkL@n@VW@@‚U@knm@kUml@xÅxƒ@@XUJlb„@VX„JVxn@lbV„@lULnV@VlnV@bWV@bXL@lVLVb„V@blLn@Vl„K@xln@bX@lašLVbnKUVVb„KlXVVkxƒV@nnVUb‚lV@@z—°WWkbƒIk‚WL@LUJ@bUI@b™`@UmI@mkK¯XW™™mUV¯@UUVUUam@@VULWUJƒIm`IUJ›KUkW@Uxn‚WbnnmlXbmIUVmV@Vnb@V™LUKWLnÒVVV@V„UL@„kJUV@bƒÈ@ŽšV°šŽ@XVV@l@xUz"],encodeOffsets:[[116753,26596]]}},{type:"Feature",id:"3608",properties:{name:"吉安市",cp:[114.884,26.9659],childNum:12},geometry:{type:"Polygon",coordinates:["@@lxnb@V@bV@ln@‚n„‚lInš@blVXK‚nk¼@VUKWL@b™L@`UXU`ƒ@V¦XLĠ@lJ„¦@„nV@l°nn@‚mVXnaš@nb‚K„n@l„IVƒš@VanJ@_lKVVnš„L@L‚K@Vn@VbšUVanKlLnbnJVbšnWVnVVanI@‚Vb@L„bVKVanXVbVJVU@aXLll„bôlƼXxVLVK@Xn@ƒxnVVVmb@LnVVKVXV@@mnaVXUVnV˜K@_UaUmšwnKV_‚anKVLš»„K@¯ÝU@›™U@kWlUn™lknK‚VnaUkma@ƒUIUwl»Åw@ƒVwV@n™‚n@ÈXlKVmna@kVw@anm‚@n_WWk@™™mUkUK@Im›kLUn›bkm@wV@kƒlUnLV±m@UInWƒkWmbƒ@¯amX@xUVUKUaULWKƒXwƒKmLUVUJƒ_@wyWwkaW_XaWW¯L¯akaƒ™m£@mUUš@U@wnaWU@Uƒw@aUKšUXUVKUkƒKWbk@@bUKUlWL¯LUJmLƒwU@UVƒa™VU_ƒVkmƒnUV¯@@xƒXmWUUULƒ¥makI@ƒUKUkWl™LkmǍ@aƒUk@UKƒLƒ@kmÇak@ƒ_VlkL@`lbnšlLVanLnbmVÆln@škJlbknmKUbÝmmwULUK@bkLWKULUUma@Kk@UV@L@llbVzšxUxnl@bVLmŽšŽ@IVJXœVlƒLV`@bn²@J™@™V@Xmbñ@WbUJ@bm@@LUĬU‚„¦lV@xXb@blnUV"],encodeOffsets:[[116652,27608]]}},{type:"Feature",id:"3611",properties:{name:"上饶市",cp:[117.8613,28.7292],childNum:12},geometry:{type:"Polygon",coordinates:["@@„„@„V‚š„„I°`nm¤²@bVJUVVXUl@Vmb@xV@XbmVVœ@lkLmbn`VbnU‚@Va„UnbVllUXV„a@w°VW@_VWšLššnVlbšLVbnl„KšnVK@IUW@_@am@™‚ÑUólK@U@WU@VwU@UI@aUU‚aXƒƒ@kwmJV@yX@k‚anƒƒ@mkwVmmI@aUU@aUUW@kVkV@@anKš»„XVWnIVUl`@_„W@wlUœV@UWKnU‚bnŽ°InJl„UV@VnI‚b„Wn@VklL@l@Vn²m@U`kI@bWJƒnV@°VXnJm„XVmx@VVL@bkLmWULUmU@ƒbWXb@llnX@‚xkxVV„nVV@¤nL‚nVxnJVXX@˜ššbn`VI„b„@„blmlLnaV@„blWXnlUnbl@„ƒšKVanUVmm_XK@kWWnašU@UnaWUXa›ƒXamUkKmXUWƒLX¯WakKm™nUWwXa@KW_„aXWW_@WnIVl@XU‚LnWVknK@ImyUUÆbXK„Û@W@IÆUnƒVÝlkVK@mUIVwkUVaUm@aVIVyXIƒaÈwmmk@UnanVUmÅaó»lwšW@kkUVmUK@WKLƒUmWULkamK™Lk@Wa@wk@UU@U@mbUIWVKUXWmkUmVm›U@LkakKƒw@w@U™¯ƒ‚ƒUUn¯l@bmn@xkJWxkL@VkI@mƒkmJUI@V@b@VVxnbWlkÈkVƒLƒbkKmVƒL@V@²nxW‚kLUL@xlKVx„bXmVnšWJ@ޙ°@n™xUKUw±`UImVmnU@kalm@akwƒU@UUJmxU@@Uƒ@kU@Um@@Kn™ƒVm@k™KmkU@@WUnkLWxkVUwmKmLkU™bmKUbVŽ@xUnkJ@n±ŽšUxVXUšWJ@LUb™lUnm@ƒW@nknUJUVm@kXllknVbÆK„VVbš¼V„@šUl"],encodeOffsets:[[119194,29751]]}},{type:"Feature",id:"3604",properties:{name:"九江市",cp:[115.4224,29.3774],childNum:12},geometry:{type:"Polygon",coordinates:["@@WUkVUkmaƒVUb@mVUam_nalK@kU›nUWaU@@wna@UVkUWVUUI@a‚±n£m¯_ƒJ™ƒU@ƒƒƒĉ¦Ul@UV™Km™mLlm@ğ¹m`Uk¯@@UVK¯™@UUK@amkmKkVVUa@UkUƒKƒŽUa™L@VVXUJ™@ƒnƒ@™š™WUbƒnVb¯V@LÅlÝIƒJÅkݙm@Ua™WUU@UmUXmmwVUUKWUX±mUam@kWƒzUaVmÇw@aÅLmKXƒ‚UWKkL@W¯IƒwVw™lkUƒJ@Um@ÛÈWŽKUxWkƒaUU@KkLVl@„UKUX±KUb@nVVUbUVmaUlUL@„ƒaUL@‚@nUlWzX`@„V@lx²„@Vlb@bšVÞ@°nl@UxVL@lUbVV@n²xVUVmnUÞb‚a„J@IšV°xnbl@nbÆ@VwnK@VnXlK°xnUlVX„V@Vl@L@lk@W_XK@KƒkWxUL@J„nVx@aX@VVUa˜IXlmL@bVVX@VbnK‚a²XVWƒk°a„@UnV¤nbmLmW@XbmJUbVL„aÞK„L@K@U@aVKlbV@nXlJœxV@VnšŽVȚ„ÞKôbźĕČmV@ĊšŽ²xÆIšV@Þ¦ĸ¼ÞVlŽVÞnxln°Jœk‚LXWVUVUVwnJVI@yn@lXlaXmWI@w—»ma@UmK@akKkXmW@_kaWakKWk@@K@IšWƒkUa„ƒ"],encodeOffsets:[[119487,30319]]}},{type:"Feature",id:"3610",properties:{name:"抚州市",cp:[116.4441,27.4933],childNum:11},geometry:{type:"Polygon",coordinates:["@@°V°UnÜ@n@lnLlV@bšV°L„lnLllVzVVXlV„V@@L@xX@WlX„m@UVƒL@V@n„°škVmVUnKlaXxVbšnlU@lVVnaVI@aX@V„šJš@V„@b„b@šVbš‚@X@lUL@Ž@VlIVm@wUVanLšalVnKnLVxlUXwlKVm@k@Una@mWIXKWUÛVƒk@a@UVWn@@kl@@W„XlW@_Um@UVK@a„LnalInWV@@xnI@¥‚K„—šm@kKmƒnk@mlI„¤laXbVblknV@U‚KXVlUXa‚@@Unw@±mU@ak_±a@ƒUJUIƒVKW_Xa@aWU™šK@mmUVa@IXa@UWmšannlmX¯WKXwVUVwƒ@XUlK@klJXa@kƒkmm@Uwƒw@¯ƒW¯kw@WmbULƒaUUU@mVUU™WmkUb™KmkkK@aƒkUƒ¯¥Uƒl—ƒm@akU@mš@KVIVV@KUkUVUkaƒUWb—„mƒIkaVaUU™@mW™„b‚b@bUlkb‚b@n™K@bƒKXVWnULkKUV@LWKknlxXŽVLml@X„Ž@lULUb@xVxVLVlVnUxK@LWlXnmV@x¯X™aWUUK@wVWUkÅçm`@mn@bUx@lmbUnkLÇWm@mšU@Ux@„Æxk¼VxVJ@„nbVlmbUmLklmškVlX@‚VœšV@°Þ"],encodeOffsets:[[118508,28396]]}},{type:"Feature",id:"3609",properties:{name:"宜春市",cp:[115.0159,28.3228],childNum:10},geometry:{type:"Polygon",coordinates:["@@@VlbnK@b@JšLlUnx±ĀXxÆW„X@lš@V„@@blJ@nX@˜xUbVVUbVV@b—VmnmJœ„@bmbm@klUbƒLmbœš@lVb@xUX@bVVVbV¤@LVV„bXlVw‚LXÜÇn@@V„IlVškUx„x°J@XlKXLV„‚WnLÆK@bÈxUnVb„ylXn@Vbn‚W²XV‚LVVUŽnxWnnV@VVVšXVbn@ޚÆl„IÞJÆk@K°UUa„mVa@UUUš»@wV@VƒkkUKUVW£U@UmW@@aXkVUnVlKVV„UUkVmU™@kWaUanU„VVamIX¥W@@aUaUVW@_mW@UnIVVn@VbVm@bVL@anKVUkƒWK„UXV‚Ikx‚@na„bVK„b@nVJ„_V›@Vw„‚VUVVXUlUUaV@X@VblašbnKlkVaXaƒ¯@m@U„KVUn@WƒXkW@@w@KU@UƒWkUUUykkmKƒk¯K™U@akUmK@k@mmÛ¯V¯U@‚ƒL™¼UKmLbU`mL™xVnVb@`—LmUVUUWmb@nU@UWULmU@KnaUUmU„wmJ¯IUJWIkVkaWVUIUlWaUIUVkKmbUIƒÒlVUnnŽ@VlLUJ@bUX¯@ƒaWVUKUXƒKUbm@UwKWa@a@VkUWn™@Uak@mbX„WJXbm@mL—aWVk@™wƒL@WmanU@knwWmkaWL—KWUXaƒU@¥l„UVVVbnwƒ¥nKV™»@aUk@a@UƒJ@kƒmLma™@mbUWnm@ULǺ@LXnmxUŽm@UbkbW@@akLmWk@UXmJmUkV@VUXVlULmKUxkL@lmXnJ@X‚l°Vnb@bU@WbKUX@VmKUX"],encodeOffsets:[[116652,28666]]}},{type:"Feature",id:"3601",properties:{name:"南昌市",cp:[116.0046,28.6633],childNum:6},geometry:{type:"Polygon",coordinates:["@@šXš™„@„mš@VIUW@UšKVb„„LlV@VVbUŽlUnLnl@bVL@V°šUL@V°@Vln_Ġºn@‚knKnššLVU@VkĊ¥Vk@™Uƒ™»UaƒUÅLUalmkklWn@VUVIlm@m„Xn@VmškVa@KXIV™UWVw‚™²@m@U@VK@k@W™Ua@™ƒa@aUƒ™@™IUƒW@@bUJmbUU@kkV™mUaWwkbmLUVUn™lWbUbklmL™akbUaW@U@VbkVWVUUUVƒUx@‚Uœƒ`UI@mƒaULƒamb@lwJWUƒVXLl„UVmL@bUK@aUnUam@UUmJ@VnX@`UXVŽVb@bX@W¦nJUbƒUmVVbXb@lVšUnVlƒVUUkLmUUVWl@bX@VnV@X¤VUVLllU„U@@x™¼VV@V"],encodeOffsets:[[118249,29700]]}},{type:"Feature",id:"3602",properties:{name:"景德镇市",cp:[117.334,29.3225],childNum:3},geometry:{type:"Polygon",coordinates:["@@VVX@Vbmz„xUlU@mbmL@V²xVbUVVblbX@šVškVykValKVI@bn@n`lVWnX@l„L@™WKnƒVIVa@¯nK@alIXJVIVWUw‚ƒn@nU˜„nK@alI@a@anKm_™a—™W@UWmIUwmmK@£UUƒmUUlwwW@km@kWaX„aV@VnVKnXlK@aUK@UnwWUnƒmIUW@¯mU„XI@alJV_n@m±@U@kkKUlm@ƒXamJ@UVUkƒmI¯JmamVXL@V›UkV@xƒX@`k_UVmJUXƒW™¼mL@bU@UllX@VV@bVV@bnJUnlx@n„Žm„b@lWŽ@zU‚nIlx„@W„bVV@bVJV@UxV@@X@VkLVôÒ‚šn@@b@`VX@J"],encodeOffsets:[[119903,30409]]}},{type:"Feature",id:"3603",properties:{name:"萍乡市",cp:[113.9282,27.4823],childNum:4},geometry:{type:"Polygon",coordinates:["@@VWnL@UVW‚LXaV@@ama¯Uk@WmInW@klKVwnLVKUkVW@UlUnVnIVWl@nXlK@bX@laVan@VnwWm@KȹVK¯m@kmU@ƒƒ¥kIğ@WKU¥„@V_VW@_šK@aXKVL@Ul»mWLkU@am™kJƒm@kmU@@a@UmakwU@›„Xlƒ@VXk`UIW¼kWWX@‚œ@l‚xV¦XlW@Ubn„@ŽmUkL@UmJ¯UkUWVUaƒUlm@UXWl„nUJ@LmLU˜nXll@bUVUUmVUn„Ž@¦šxlŽnn@VÆÈU°kbV„VxllnL@VnVVUl@V„„anL"],encodeOffsets:[[116652,28666]]}},{type:"Feature",id:"3606",properties:{name:"鹰潭市",cp:[117.0813,28.2349],childNum:3},geometry:{type:"Polygon",coordinates:["@@@XV@nlšL@lUnš„mŽ@Ln@@VlV„@@VV@nwVI@V„Vlx@bknlbV@nmnUVJ‚_²‚VxVLšw@mš¯@ÝXIm™nUWƒaUwkL@wVKlKXmw@±@U„KnUlL„a„KlUlÇXkmaUw@U@a@Uƒ™UkwUJ@zWJ™w@WbkVWUL@VmUklUaWakbƒ£kJ@nmln„lL@Ž™nƒ˜L@¦mJ@wU@mXkJmbƒK@bUL@VVn@`kXƒW@Xk@@lm@UX@V@b„lÜUXVWLXJ@nmb@V@l"],encodeOffsets:[[119599,29025]]}},{type:"Feature",id:"3605",properties:{name:"新余市",cp:[114.95,27.8174],childNum:2},geometry:{type:"Polygon",coordinates:["@@m@@WULUKWwÅ»ókƒakkWK@bUVUIUamWUbULƒa@KUa@mJUbmUXU™mUamImakKmLUb™VUam@@UL@KƒKm™UUkL@`mIUb™@U„@V@bVl@bš¼UŽmL„¦mxUaUUƒVkŽ@¦„VWbXV˜LXKlbXnmx@lmVnb@X„Kšxl@XU˜bnKn@WaXIWƒnal@Vbš@XmlV@U@bXb‚LVxn@Va„LVWVLXU„b°@VW@aVIkK@UmVmkU„ÑVJnalLVUVJXbVkVJXUlblUXJVI°JnI"],encodeOffsets:[[118182,28542]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/ji_lin_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2224",properties:{name:"延边朝鲜族自治州",cp:[129.397,43.2587],childNum:8},geometry:{type:"Polygon",coordinates:["@@Wxĵ„mš@„ó¤VX@@xܼƨš²xWxƒV„V@„XVƒ„„„ƒbWšXllaÞU°Ċ„@ô¼„LôÝWanV¥ƒÑnĉ°¥šÅX¥°¯@w°w@»°k£°mÈŹ‚mÈbƃŎ¦„K°z@Žkxl¦UbU¤šššklV„KŤÞȰ@@bšV@nVVUlÞ¦lUllœVlU°ÑU¯Vƒ°w„bXxl@VŽ²„˜@n„ô¼ƒó°™kmVk²ĕ‚w@wV™ÞÞ@@Ġƒö»˜¯œ@‚„šbnb°mÞ¯°V°„ÈJmX¥mam™UřƒUƒlaU¯™ƒ@w™Kk—l±n@@wƒkÝVUUl±¯I¯b™a™lƒ@™kLmakbƒ@ġƒŹé°™Þb°šékƒƒLm™„wX™‚aÅb@bVlƒbVb—ÒVbUb›UUanwƒakbVŽUV›ak„¯„UŽƒLmxV°UxnôŻX@J„Xkl‚bkbĉaƒbƒWU„ƒ@ƒk„WUU¯@@klmƒ@@™Å@aƒwWXlKkI@WbUaVIUanUƒƒ@ĕƒ¯K™„mUnWUwm@£ċèkUmbUmm@@nkJUalwk@@nmWUan_óaWmnw±KœIƒwl@UmƒI@an@@mlUÅmV_™KUkƒ@U`@_ƒKUmU™@U¯™mmb¯@kb™ImV¯ƒƒLkbƒKƒƒÛ@ÇnɱJóaÝĢkb@„›x—ÒÇllœ@‚Ž²V‚„ÆUVV„UÇ°X„óxlV¯„lV@bƒV@n—x›@—¤@„șŎnxV¼knšJ‚nšKX°˜¦UlnVbUbÆVnÞWVX¦llšb@l°œVJôÒnLVbšbXŽ"],encodeOffsets:[[131086,44798]]}},{type:"Feature",id:"2202",properties:{name:"吉林市",cp:[126.8372,43.6047],childNum:6},geometry:{type:"Polygon",coordinates:["@@ôl‚zšaÈV°„šK@„mŽ—LWl™nšVxUV‚È@ŽÝĬUÈn‚ôLša‚„²VmĀkV@„ĠĊnU@b„V@b˜@nl°UVnÞaôJ@bš™V„¦mlkššbmVXx¯@Vxm„nbƒ„šbÈK‚V@bÈL„wĠyônšmnbÜ@nn„V˜x@n²K‚„„J@k„al@nxÞU„Lź±Vwkw¯LWWUš™kŎīVwƒw„°y„Vĕ°wÈVlkÛ»@wW@Uô£@ƒn™ĶƒXwW™aUamKóÑUI¯›@k™akkW¥XUmÝÅUVaUa‚mVk—¥W¯™Lm™IlmU»mwȚō@ƒ˜£kJUÇk@am¯y¯UVwƒa@wġx¦ƒKƒƒ¯X°Ċ¯¦U°ċWULÅa±b¯@UkÅWmVƒ™ƒkIUlóŽċ¹™`óIƒlX„WŽXxmbUƒLݏƒbƧ@ƒx¯bƒÈ—l@xƒš¯zƒaݤ@nšm„VWb²bmn¯J¯Ò@n„š"],encodeOffsets:[[128701,44303]]}},{type:"Feature",id:"2208",properties:{name:"白城市",cp:[123.0029,45.2637],childNum:5},geometry:{type:"Polygon",coordinates:["@@ó™ǩŁ@WlwUaƑwÛÅÇéĉamKƒōÇ@Iƒ™ôġVƒȁÑŹçƒ™ÝUƧċĉwóóÝ@Ƒ»ğL¯ll²@ƆÅV@¦m‚Åb@nmlU²VxšlUn™@VbnW„bÇbk҃š„n@èlnlšU҄Ž°Lšx@¼ĉb@҄šUŽċxՃènLVxƒÒƒbÅJ±a@_ÅJÅnƒŽVb„Kl„nUÜĊ@„Uš™xXVÆn„mšVššJÞ¯V™ĠwšƒXw°xWL„x„KV¦ôU„wVÝǬóÞޙ¼‚‚„ÞkŽVôȘxބU„lVn¦ÞšĊa°w„b°@šbÆw„lŤL²`„z°@V@@™nJVnl@@¥nUmmn„@mwnmmUnk@mlwUaƒLnƒ›wn¯°anƒWakI„ƒÇmXwÆamUXUlJXa‚UUklKUknmÞV@‚K@VWÞ@VkUwVƒ"],encodeOffsets:[[127350,46553]]}},{type:"Feature",id:"2207",properties:{name:"松原市",cp:[124.0906,44.7198],childNum:5},geometry:{type:"Polygon",coordinates:["@@„šźèȂÒU„óĢ„š@JŎȄ‚‚LnŽĊbÈêÜƃxVbkx@XǪłôš„kÞ`„šW„b@n°ašbšKšnVw°`š_X`W„š¦„ĊIkmVšakw‚K„x°UÞb„U@lšƒl@°¦œVW„šaÞbšxÞI@mVI@ƒVkŚUWK„¥nL‚a@ƒ„@ȍ„@°ƒÆ@nU@KÞalkUwVékUWw„™kU›VkkƒJk¯@»ókƒV¯ÆÇI@bĉô¯@™ķw¯nmmÅL¯wƒVƒUÞy@UówÇLkmm@@UóxkkĉmL¯wVwkWWX™mLõm@kűV_ƒƒô»ÛƒÆ¯@™Va™VšaĠVlmğwķUóÝƽ£ÇJkbǫaƽLW@nxݤkzƒy¯XɅm@VšôÇX¯Ė¯ºÝnUŽnLVlUÔmV"],encodeOffsets:[[126068,45580]]}},{type:"Feature",id:"2201",properties:{name:"长春市",cp:[125.8154,44.2584],childNum:5},geometry:{type:"Polygon",coordinates:["@@„U°xÆKnn°mĸxš°@Ċó@aÈJ°Å„Uôl@¼l°„IllœUlVƒšXxlVUêVxkllnÈUVll@Vx²IÞ¤VUlVnIôlރlwô_„›„bVaĶLXÅÞÇ@K˜¯@wÛaƒçn¥š¯WXyW¯XwƒUmmÛ@ma™nómğzƒxÇK@aUÇL™a„ƒmanƒUw°@WwnU™al™nkƒ¥šU™@aóIÝbUm¯Vmk—@@aƒU@amVğĉ@ƒlUnÿ±Uƒ™bóKmVÇÞī@ÇVUUw‚™šmXk˜Kn@ƒ™L¯ƒÇU™byókōè@b‚n@lÝX@x¯ô@ƙUV_maXm@aóƒJWxnX@ŽVVnĖVnUJ@nōÆǼV¼kxƒLklÝw@xƒx@zV`ÅbmxU±xU„nnm‚kn‚ŽğU™bUŽ‚šUb@šÅ°Ü„󼄄U`Ʋ@lön‚KšnXWlXUx°xnKĊllôw@Vn@lnÈKôx@VÝz„V"],encodeOffsets:[[128262,45940]]}},{type:"Feature",id:"2206",properties:{name:"白山市",cp:[127.2217,42.0941],childNum:5},geometry:{type:"Polygon",coordinates:["@@Ušl¦kÒÆ°„IlÒU¤ôz„¼lJš„U„n‚ÆXVl°@²aÆbVKČXV¯°¥¯ĉ°W„„„L‚¥Ģw@x„bUx°V°zn‚‚b@ÈlVŽlIœ@˜w@m„U@akU°ƒkUôwWƒÈ¯VUƒVUƒÅ±U›@kÈk˜Ñœw@ƒlaÞġƒUÞ£@ƅ‚KnÑĢ¯@W‚aUaVUVkkw@a¯@¯™Ý™ƒVXnW@@WkXmK@xkKUb@bW@Uw¯„mmb@WKUbmUbUaWbƒJĉIVW@I—l±LkšmU™bUm™@ƒnkKWa¯n™@„`Ubma™„ĉL@bƚ—@W`ƒL@n¯‚Xb‚@kb@x™Lƒ„™@V‚kL±™™mlUIU¥mL@lÅx@_laƒƒ@U—aƒV@kmmƒK„£ƒƒLƒƒmKUnÅKVbmXVlèĉUUbml„ĢŤƒIlŽ¯bǦœl‚@ô¼Ģ„@x°„l¤„n„a„l@x™b"],encodeOffsets:[[129567,43262]]}},{type:"Feature",id:"2205",properties:{name:"通化市",cp:[125.9583,41.8579],childNum:7},geometry:{type:"Polygon",coordinates:["@@ÆlXnĠxĢ°lÈ°š„K„°kXm‚@¦Vbk„ŤJšnݤk„VÞVVkȄb°y„™@w˜k„Ç°a„wƨ@„aސ„K‚VnaWwXWƒ„kôJš_ČºôVkƒ»óyV£kуJůlÑk¥V™ša@wƒkƒbƒmk£¯ƒ@wġƒó»@›kÈ¥°ak„JÆ£ƒġnkVaĊVkçWUnUaÆLVmnL„„‚KU™±@—„m@a¯U„bmV¯m@_ƒK™™U™ƒaƒÅ™Wó¹ƒ@UanmWak@@wmI@y™@mk„JVa™@UaƒIkJ@n™@Um±kkxƒm™Ik„ƒbÇm@Ž°bXn„V@Ž°ÈmlÞ¼¯XVº¯Lm„kWWXLmVVlknƒ@@lnWƙ„Vxbmšnšm„¯lÝaVȁè@¼V„„b™„ÆŽ°ÞUVšJ„„kx›I—xƒƒƒIV¤™ÒXxmn"],encodeOffsets:[[128273,43330]]}},{type:"Feature",id:"2203",properties:{name:"四平市",cp:[124.541,43.4894],childNum:5},geometry:{type:"Polygon",coordinates:["@@Ɇn°W„zlyÞ£mwX@ƾKǬblaÈIƾ¤ôÞĸVĠxnmmVƒ²w‚VnwÆaU_@y„w@wÞxlk„KlwU»È»ŎÅ@mVIUmmĕUU@mWXw„Iô‚@bWnnbU`‚šV@Å°ó@wÞW@km@aŎ烙@m°Ñ°Inm±aXaƒU™n@mƑšU¦@šÇŽ¯aU£šaU™ġ¦ÅҙJōUŻókUÇ@™¥¯ak¯mUVak@@aċçÅaUƒm¦Ý`XbƄ@n`ƒI™xĊÞōÞml@šUb@Wl™_¯JkšÇUÝÆÅb@n™„llUb¯„±a@ƒ—ƒWĉJġĀ¯™Unóšm¤œxôaVnƒxôI@x„V@bmƙ„@lnLmޯޙxVb¯þ"],encodeOffsets:[[126293,45124]]}},{type:"Feature",id:"2204",properties:{name:"辽源市",cp:[125.343,42.7643],childNum:3},geometry:{type:"Polygon",coordinates:["@@żôŎVšIÆÑĢ¥Vš™bV¤°bȍ@™V¥ƒ™Þ£lÇUUUÝlƒÞ£™mţIlƒUa@¥nlWƒ¯ƒL¯™kÇġ¯ğwWmÅk¯UƒVU„„bWlXlmnƒbUx¯xVVknlŽUbV„ÇKUb@„™VnbmlnzUº±bmJUbWÈnèm҄š@X`WL"],encodeOffsets:[[127879,44168]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/liao_ning_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"2102",properties:{name:"大连市",cp:[122.2229,39.4409],childNum:5},geometry:{type:"Polygon",coordinates:["@@‚IÞmVk@wXWÜbnwlLnU„@‚nLlbXW@a‚wnbl@XL‚aš@Ċ¥@LULnJ@xVnmV@VXXV@VJkn@VÜKXXôJlb„xl@„IVbnJVLUbn‚lnVw„JVU@ƒXU‚aUUlwn@°ƒn„VKnV°_VJšwl@nwlV„IXWlIVVnK@IWmkIVaVU@WÈUlmU@U„WUalkXġŻ@kIƒ»mm™akUm›ĉUŁV»²ġVĕ@aUU؍IɃ`ȃ@kƒw@ƒUƒmwĉ™@ƒWķсIĉÇbÝLkymbIƒwÇmÛbmbU„¯ÜõÈkÆVbŎxnXVÆnšǪ¦„bš¤Uš™xÝnĉÒmĊVȄ¤Èš„bƼ„Ā„„ÆÆބźb„VVbX„‚°²¤"],encodeOffsets:[[124786,41102]]}},{type:"Feature",id:"2113",properties:{name:"朝阳市",cp:[120.0696,41.4899],childNum:6},geometry:{type:"Polygon",coordinates:["@@na@UVI@m„ÑW™kaV¥UI@wl@„aÈbšm@wVašk„@@K@kƒ™@a@UUmƒUUalmU@KÇUű¯@±kUKVkUaƒaU@¥m@@¯k@WLUmkn@mmIkm@amU@wVmkU@Klk@U—m˜aXIWWUL™aULVbƒmk@UUmUk±™_Uym@mbkImaX¯WW™xWKzU@WƒkJWwkV™@Um@UbVVVVXb@VWX—@WŽ@Vkb@V™nUK±aUUlwX™ÇWKknU@mmUkƒLUVƒVUUVƒUaƒw™bkKmwnIƒ™kJ@nmbƒ`kmVkLWwUm@UUU™K@UmaUa@UUaWK@mUƒ¯Wkk¯VmUUŽ„xVXUVmL¯ymXkWUbmXUKƒVknWx¯JVnkLƒl@VVxnxlĀVL²WlX„l@bÝVUn@bnlÜaXblIVl@šš@Ȧ@VmbXV‚@@x„VVnUn@`°@VnXU@K@„VV@VmbnVn@ln@b„xƒ°Ub@bšLV`Ånƒ„W@@lUšnnWVU@Vbkl@Xl`XxV„UblŽkX@Ž°¦V„UVVbUlkV›@UbVbkLUxmJkXšš@b‚bœxVKÆlXX˜bnŽnala@ƒUk@U„VVklKVUXKVU°KVan@VUnLšKVL„WVaU_@mmUXa@m˜wXwVkVWXk‚k@›„k@klm@wXKl@U@KVUUUVaUƒV@„alL„xUx@b°°VnnVšxlIXJmx„LUVlV@bnX@Všb„aVx‚@XJ@b‚n@VŽVXȄl@llX@lU„Vô°°@ބVbn@‚V„k„@VW"],encodeOffsets:[[123919,43262]]}},{type:"Feature",id:"2106",properties:{name:"丹东市",cp:[124.541,40.4242],childNum:4},geometry:{type:"Polygon",coordinates:["@@lzXJ‚U@š²x‚@@Vš„@bUVmKUn„°n@lnVK„„nV@n@VlV„°WbXn@‚VzƒJ@¦@bkb‚bUl@bkbƒJ¯zƒWULWbklV„nb™¦VJ@„„K°U„kl@@W„bVn°@„Všm²U˜nX`„UÜLXmVXlKVbUVVnUbn˜ƒX@VUL@lUbWxš@²kl`n@Vlb„@nUVWVLVU@aV@²bl@ÈmšxWX„VÈU„JV„l@„„la„WnX‚KÈkÈ@Va°bÆm„@XV°IVV°UnalƒVUn@UwVU„@@VVJ„I@bl@XK@wWmXU‚UVbkJVXnJVI@mƒknwlKXL@`l@VI@UUaVKÞn„aVm@aÇ£XW„U@aÇUU@mbkKm£™@WW™ƒL@@Kk@kl›U—bWKUkUU¯UõÛƒmUUaVU„U@WU_W@kVkJƒ_WKkV@bUL™¯¯ƒ±mk¯ġƒğÑ@UmwƒKUakƒ™ƒa@a„m¥ÝƒIUWmk@w™mţ—L›KʝbȗKWĢklVbƒX@VV‚knÇV@XUVUblJXn@J"],encodeOffsets:[[126372,40967]]}},{type:"Feature",id:"2112",properties:{name:"铁岭市",cp:[124.2773,42.7423],childNum:7},geometry:{type:"Polygon",coordinates:["@@XJm@¯šmXUlnVbUJƒU@bV@UJWL@VXLmJVbkXlJXxVL@b@V@n@b@`Vbk@lxknV@VV™V@bUL@bV@@bVK@VXLWLXJ@LV@nbWJ@IUV„x@LVJUXVxVx@VV@@LXJWL@VU@@L@VnL@bVVmVX@@VVInJmbnLWVnVULVVU@VVmX@@JVz‚l@„nVVKVXރ@mk_lm„UUWV_nJlUÞÑÞVVUVƒVL„UVJ@I„Vna‚@@KV@XwWknwnKlalU„w„aĉݚwšJl_@aUaƒKUUU@WU@WXUÆ@@UVK@n@UnVVšblK@bœllb@b„bW@Xbl@UlnLl°°bš¦nKlVnI„V@UWU@WXkƒw@am@nm@aVw@I@KUaVIm±XÑlknJVnVJšaX_VaUaVKmwnkmmn@lU@U@mnašXlKUmUIVmklaUK@UlUVUW@U™kVm™a@UUU@JmUU@@bmb—KWV¯XUKm@ka@UVKVk@aUKmLkKUUÝUmbXbÇJ@k@WU_@m™™@klm@UXKVaUI@KWUXaƒÇWk™aWUkWUL±U@lUU@ƒUJƒI@V¯JmIm@@aU@Uwƒa™@UV@VkI›V¯aUkƒWkb@bVL„@@VVVUXW@Uaƒ@@b—‚ÝbUV݄@ŽƒLmUkVUbVllLUV@LššXŽWbUXm@U`@„kxlnnJlbnIllšLX„lVlUXmVK„n‚V@L"],encodeOffsets:[[126720,43572]]}},{type:"Feature",id:"2101",properties:{name:"沈阳市",cp:[123.1238,42.1216],childNum:5},geometry:{type:"Polygon",coordinates:["@@ȚĊÜ°„b„L‚lÞxUbUn±‚@ÈnVÆL@xnLšlUVƒbƒxkImJkn@V±LUxkV@bšbšKVKnzVl@L°@Va„xÞUlbôxVVœ@@V±bnŽ@llXL˜ŽöXĶŽnal@nkVJVI@aU@@aVK@ašUUUU@lmkwl@Ua@_@a@m@U@aUKWwkIlWUanIWK@UXKVIU@@a„VVIUa‚mVknW°™n@WI@KUƒmULWnkVkUWƒ™KkkmJkamIkmlw@ƒV_n@VWXaW™™@KVUkKUkValUnV„K@ÞƒVUÞa˜@a„@VbX@VWUU@Uƒ@UK@ala@IkKmUUa@U@ƒVƒkk™WVwU_@KÜUXbl@V¥XUVmƒƒƒXa‚kŃlUUkIm`UIUJW@UIKmkm@UUJƒImmU@ƒVUXU`mIUbUK@LƒJUU™l@Xƒ@UbƒJ™kU@ƒŽn„m@Uam@@ƒ™aUmLKƒwƒ™mWXUK@kUaÇa@JUIUa@aƒKVUƒUXmƒUy™_@lmbkLUKWLX`‚n@bVL@JXL„‚WX@Vnb@Vm@UbnVmL@V@x@LUbVV@V@LƒUVl@mb¯U@xU@UVVV@X@VVblJ@bn„VKUn„x@llnL±¤™b@k`VXÆK@„kV@¼kl@bWIUl@VmLnbm@@JXXmb"],encodeOffsets:[[125359,43139]]}},{type:"Feature",id:"2104",properties:{name:"抚顺市",cp:[124.585,41.8579],childNum:4},geometry:{type:"Polygon",coordinates:["@@„XVl°bœUlJ@UVUš@„bVxV@@bn@nJ°I@U„J‚I„VV@V@k²VVKlXXVšb‚lÈX„ŽWbXV@LVJUbWL@Vkn@lšš@nV`@X@lÈIWanaÞVVVlLnKVL@bUlUL@Vlbn@VL°WXU˜Lna@aV@nV@IVV@VšbUnšl@V‚XnKVa@U„UnyWkXaƒaVk@ašašbnm@_WKXmWanU@alaU—l@XJVLVxX@˜wnKnVlwƒƒ™@V_@a¯¥@UkKWUaUU‚anK@IƒaU@WUaVw@klUVyUUVUUÇ@Iôbša@mnUma@kXa@UWak@Wa—l@a›@WUƒLmU@U`mIUU™`mUk@@UUK±nkJƒbUam@kwm@@a@UU@Ua@@K@ƒVK@kmKU_UKƒUUaĉWmkkL@`™LƒnmlkLkbmK@k™@Ulmb@b™„@Ž„xUVƒIUlmVXXƒxm@™JUUk@WUk@ƒakx±@¯x¯Umb™KUUVmUU¯UmVVn™WkÆ„lWb„„„ŽUnWVU¦k@WaÛV@LV`UxšXllU„@„@VVbnVlL@J"],encodeOffsets:[[126754,42992]]}},{type:"Feature",id:"2114",properties:{name:"葫芦岛市",cp:[120.1575,40.578],childNum:4},geometry:{type:"Polygon",coordinates:["@@ll°X„ŽnV‚@XLVb@VVbnb@VšLVV@VVnXxlKnU‚l„_na@mlI„šmJnxlLša„xVbU„VV„UVU„KVlnnV@lmXLšÈWŽkxVV²bVLšm@Ula@UX˜@XW@UWaUUUUVan@V‚š@lUXxlIX„V@‚yXLšw‚ŽXXW°nblJnan@Vzš`l²nVVVl@„nUaVKšbVKnXVaUaVUšyšnXK@kVK‚@X@m@m‚LXa„LWƒU¯„w@™ƒa@UVw„¥°™ó¯¯y¯ƒUǯ»›w¯Iƒm—¯Ç™UUl™¯»ţKċÑţķm¯w@mU_ómk¼VnU`±IkbVlƒnnŽU¼±Lk`@X™Wl¦UbmVUxkXVlkbllU„Vb@bkVmx@XVV@Jb±aULkKWXkWmX¯aUJmIkVm@ƒxU@n„"],encodeOffsets:[[122097,41575]]}},{type:"Feature",id:"2109",properties:{name:"阜新市",cp:[122.0032,42.2699],childNum:4},geometry:{type:"Polygon",coordinates:["@@šXnb°lš„VlnXVJ„LlVnl@zÆxnK@b„blKVLn@@V„aVLVK@L@Vl@XVVInVVKVwlUXwlKšL„ššVVb@aV@X„lUXbVW@n„lWnXKV@@V@XUVVLUVV@@bVVV@@ln@VbVUXV‚I„xVanJ@UšIVWšL@UV@@¤V@nInw˜W„k„lnIVx‚lnzUVÇJ¦VVÜLĸUnW@aV_šWĊXXa‚Knkl@nm™L™a@alUVw²K@UlmnIlJ„w„aVU™kmK@wÅKmU@DzVmVaÝwkƒKƒaÛ¯șĉķ¥ğ¥ƒ@kUWkƏī݃ƒ@@akU„K@KWIUm¯nƒU¯JmwUVmIkJÇLm@™UImJUU@aW@U@@nUb™JƒaƒbXVWn@UVmX@V@b„š@l@Lƒ@™lUb@x™nÇaƒbk@@xVJU¦lbXšƒÒ@nUJ@Vmb"],encodeOffsets:[[123919,43262]]}},{type:"Feature",id:"2107",properties:{name:"锦州市",cp:[121.6626,41.4294],childNum:5},geometry:{type:"Polygon",coordinates:["@@nJ@nlmVnXKl@@°n@@¦‚V„bVbUlVL²l°@ƲÈV@LV‚knVb„VVnnWVU‚@XmWU„a„bšIVa@mV@X@@bVVnIVJ@š‚nÈKlInJVUnx°I„V°mVnXJ@LƒLlV@b„@ބƐĬXllV„@Ġ¦ĸ¦naWW@In@manK@UVkXJ@alk@»lU@ƒÅLUWl_@ša²£‚Kkm@kƒwVmULmƒ@akIUa@U@WUUVU™aÝ@ğ›wkƒƒmĉ£UWƒ@@bÇL@m—a@_mKƒlƒXUwKƒLţÓ@UWw@K@U„I@m™U@UV¥„@°UnJ°@@_™KUwƒW@UnaWUmmI@m™ķwUaÇLóVĵwݙUUW™¯šƒ¦Ux@V„b@šƒxV°X„ƒKWbK@n@nW‚@UL@lWL™m™zUVVbUbmWXXWJ—b˜n@Vkl@LlVUn@xnV@bln"],encodeOffsets:[[123694,42391]]}},{type:"Feature",id:"2103",properties:{name:"鞍山市",cp:[123.0798,40.6055],childNum:4},geometry:{type:"Polygon",coordinates:["@@l„œxĠŽÞ@šbV@@w°Vna‚@Uk„V@K@UUUVa@K@w@UnKmUVan@@Uma@UXWƒWK@IUK@amW_XKVLlKna@kmKVak@VU„@VmšU@anIÆan@‚a„šUVnb@blLV`ÞLlU„bna‚Kn@naVU@¥°IVK@anUUKVaƒUVak™@mJƒkXƒ™UVwkƒVUUa°U@Wƒ@WlkXWlIXUlJlaœx‚IVVXLšll@nLV@lLXl„KĊzš¥maUƒlkXaVK„X°y„Ila@aVkala@a@¥„IUy@WmXaƒ¯kU@U@mmUƒƒULkmm@ƒ¯VmnLVU@a™ƒ@U@±w@™VWIkymLUUkJWXƒJkUmxk@™xUI¯`mUULmƒ¯„m@kxVVbWV@„UVƒIUx@bkšVšVVšxUbVV@V@zšJVXU‚lnk@@lkLƒlƒLUU±Jkšm@UIUVƒLUVU@™K@UƒnnV@l@Ll„ƒaUJ@zn`@nWlƒIUVUUUV±Ln‚@nmL@VUVkLVlUxVLVlÅXma™@@akLmWUX@JUnVJVkXJ@X@`WX„VUVUIlb„W@bVUVL@`Un@¦U`@bUV@z@Jm@@XV`„LUL¯J@IVKmKÅI@J™nWVnLnšVxV¤™z@bmV@VUV@bUL"],encodeOffsets:[[125123,42447]]}},{type:"Feature",id:"2105",properties:{name:"本溪市",cp:[124.1455,41.1987],childNum:3},geometry:{type:"Polygon",coordinates:["@@lb@Vn„lnVVUb@šVJ@nnJ@bmXUx@xVbkbkŽWLUxnl@Ul@„xWx@nUV@¼Ull„knkK@bmbnl‚LVJX@VIVJn_lJVVšXUmnU°VVVUnVVšLna°V°w²@lw„bl@XVl@VVšIn@„wWWnUVk„JVUƒw@šƒ@anaVkš@@lnLlalKnk„mšK@_lKnlĊXVb„VVLV`nL@lUL@„@L@‚VbV@@V@bn@lxn@Vb„alI²mVL@Vl@nVš_VVnJV_‚@nV„K‚V@Xœ‚@b˜kXbl@XblylUUkš™@Xa@UVIlK@UUWVU„Llm@UUUnKWU@K@UXm„XVa@U°KVUUWUk@ašUVKkaWkƒKUknaWa@U—@m@mk@ƒaUJk@@_WKkLmx„l@nUJmIUWlIUaVWVXn@xWLk@@aƒJUI@Uƒ@UVVxm@UVk„mb¯VUU¯JWUƒ@Ån¯aUbÇ@ÇlLmWƒXkbƒƒk@UƒƒIÇVƒUXW™wÇnk@±aU@@bUVUKUXmVƒ@kaUm@k_±l™@XwVa@kVK@U„Wm—VaUmVUUakLUWWnÛKƒVW_—m±V™nƒU¯@Umƒa@Xk@ƒl¯V"],encodeOffsets:[[126552,41839]]}},{type:"Feature",id:"2108",properties:{name:"营口市",cp:[122.4316,40.4297],childNum:4},geometry:{type:"Polygon",coordinates:["@@ĊĖƐn¤„„°Ċ¯ŎWšô„@xXb‚wnKl@nX@VUVƒKmL@VU@Ux݄@Vlb„x„U@VUb@b‚kœ`‚IUlVUn„V@@UV@@JnXlK@bš@nbÆWUkUKVwUklKVU@UnK@mm²KVUVVVU„JXk@mm_@yVI„bkƒ@K@kmU„m@VšLV@VU„KVUVJn@l™²IVV„K„klK@kl@kmVUW™I@y@UUUVa™wUUU™l™@akmmVaUKmIUaƒJk@ƒwkaóIWWÛL@UlmUIU@WW@UnUUm@wmIVK@Kĉ¦™@bWKk@max@bWXkamKƒ@mVkKmxÛaWX@xUlÝnJ"],encodeOffsets:[[124786,41102]]}},{type:"Feature",id:"2110",properties:{name:"辽阳市",cp:[123.4094,41.1383],childNum:5},geometry:{type:"Polygon",coordinates:["@@š`Vz„‚Wn„VUV„L@bVbVJ@IÈbVb@lVLXW‚n„š„x‚LnKVŽšb@„n@Vbn@mƒ„V@šl„IVa„@@WškVV„I@KVLVanJV_VW„UV@nn„JVI‚Vn@na@alLlmkƒVk@»VU@mXwƒwk@@VmkVwXKllaUa@wVwnW@amI@mUI@™VaUUkmmƒ@UkaƒL@ƒUIĉyƒLWkkKU@mKk@™kWKUUJ›wkbkIWVkJWXkl@X„‚@X¯VVbUVl„UxšVW„„lnIš@l‚Ub„VUbVLmV@bUL¯J@¦UVmbm@LmbƒakVÝKU_kK@amaVUƒ™bm@ÅbmJ@b™VUnƒ@UVl@UbnL"],encodeOffsets:[[125562,42194]]}},{type:"Feature",id:"2111",properties:{name:"盘锦市",cp:[121.9482,41.0449],childNum:3},geometry:{type:"Polygon",coordinates:["@@Vbĸx‚š@nnJVnXŽmb@V„XVxšL@`¯@mI¯Vƒ@U¦@VšV@nƒJ@V@LXx@VŤÔ„K‚LVx„W„knL@`˜b@nÈK@a„@VXĊ¤„nVK@aVU@UnU@ašyU£Uwm™mKXUšm@IÆJnLUL@J°IVKƒKU_@Wn@@I@yVU@aV_@¥Vm@_UKUV@aƒXkaVJVUƒUXW@_@WWIUlUIVm@IVW@IU@@VU@mƒUVVkJ›_l@aVa@UƒVƒwka@UރVwV@@UnK„LVU@UmWk@mLxWa@wóƒUVUIÇÆĉ¦¯¦¯xʟJ"],encodeOffsets:[[124392,41822]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/nei_meng_gu_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1507",properties:{name:"呼伦贝尔市",cp:[120.8057,50.2185],childNum:13},geometry:{type:"Polygon",coordinates:["@@„m@Łkƒ™Žƒklƒôƒ@£kJ°ý™ɅķÑó¤ğLĉÅlÇğŁW¯¯›™ƥóÿlwkţÈéÝƛó™°ÞÅxV¤ĉĖWƒ¯lȭţυ̃ɱÿķƅˋğɱřÝţϙȍƧĊţ@¯kWKUKm¹Å@ķJU@ƧÑƧ„ō¥˹Ɔ@L@„Þ‚VLnš@VōČWJX¦@JŻbU@ţÞmVU@ȁýóbkWWLƒƒÅ™¯UWġkmóƒ±UŹôV¼ƽ¼ƒł̥ĖƽǬʉxĉŽŻȗKΕ̛ʵƨʟÞ˹»Ƨţ»Ǖō˷Ȍ±ȚʊĠUɾɜɨmÜ֞߼˸ƅȂ¯ǖKˢğÈÒǔnƾŎՂ@šĊbôô̐¼ƒ@ĊôĊŽÞĀ™xšĖƧL±ŽœŽ‚Uš°U„°ĬƒČ°ÜƒêɴȂVł°@ƒ„nxŎèƒbȄÞȌ΀ǸlŽ²IlxĊl²ÒmšôĖ™Èl„ĵºm„ÈêVþ„xɛČʉÇĵVmš„ÒƒÈɆôƐŰǀĊ°ÆǬĮƾb„yĊ@ĠšƒXǀċm»ôw°Ûk¥Çm¯ç™kkÇǫţǕéX_ĶWǖīŎaÆĵĸĊ@ȚȘ‚™ĊLĢĉ„VÆĉʊÇĕóaU¥šĉ°mkÅ°ġUĠřk°mƒÑČÿ˜ÛƒWĸ£ʠšÆxÈÞŎÞ»ʈ²ĊÇČalÒ°Ť±ĸz„ŽĊKȲm¤Ŏ@Ò°¼nyȂUźīǖƳÈē°@šÝĶƒ@ƒÈkl¥Ççkxk™›JXÇƒUÅ@˜£k»„óƿīÛ@lÅJl¥óý@¯ƽġƍÅan™ċ™°é¯¹"],encodeOffsets:[[128194,51014]]}},{type:"Feature",id:"1529",properties:{name:"阿拉善盟",cp:[102.019,40.1001],childNum:3},geometry:{type:"Polygon",coordinates:["@@™ƏnǟƨʫšŹɆÿ°¯ÆV²ˢ™żÿ@ÝÆŁȰ¯ȀƳĉó™™@ğkyš¹@īš›ƒwl£Źƒƒ¯Ŧé@™ÇÇxŋĉƩUUŃōL™Ç™ĵóÝnƒóç@™™ó@ġƒƱ„¥ƒç™WUçÆōƒ@é—çťK™çȭVһƽ̻aW¥ȁ£ʵNJǓƲɳޗǔlżÞmĠóĬȂɲȮ@ÈĢŮźÔnĶŻǠšŎȭœгŃċóȭţΗÆƑÞƧÅΫóȘǫɱȁġlÛkÇ°ȁÈnšõl¯ô„ÞɛÝkĢóWĊ„zÇɼʝ@ÇÈķlUČÅÜķnέƒǓKȮŎŎb°ĢǀŌ@ȼôĬmĠğŰōĖƧbЇƧōx@ķó£Ål±ĀƧīXÝġƃêĉK°Ýʇƅ@ΌʉżÅÒϱʈ@˺ƾ֛।࡬ţશóЈèʞUš¤Ґ_޸Ƒʠɽ̦ÝɜL׈ɛϜóȂJϚÈ@ǟͪaÞ»Ȯź"],encodeOffsets:[[107764,42750]]}},{type:"Feature",id:"1525",properties:{name:"锡林郭勒盟",cp:[115.6421,44.176],childNum:12},geometry:{type:"Polygon",coordinates:["@@ʶĬĊIȘƨƨŽ@ĬÛĢșŤĉĬƒĀóšU‚ÈŚÜènŦƐȤȄłϰUƨťƾÑ܆ğɲƜǔÈèʈƲĊƞƒšɆ¯̼V˺Ò˺ȂŤVĢêU܃x„Āˌ˘ƨ„Æ°ѢmÞżU¼ÆlŎ@ĊçŎnÈÒͪŎźƒĸU°lżwUb°°°Vš£ÞlĠĉĊLޏɆnźÞ„n¦ĊaȂīġŃ¯Iĉůl»kƒ„™Çý„¥Ŏ¯ƒén£ġљÝȭxƒÇ™@Åçķ»óƱŎ¥™çWÿmlóa£Çb™yVÅČÇV»ÝU¯™KĉýǕċţnġ¯»ÇōUm»ğƒÑ™wƏbċÇŎċwˋÈÛÿʉÑ°Łkw@óÇ»ĉw™¥VÑŹU™mW»ğğljVÿŤÅźī@ř¯ğnõƐ@ÞÅnŁVljóJƒwĊÑkĕÝw¯nk¥ŏaó¦ĉƒV¦Å`ğуÑÝ@mwn¯m±@óƒÛKˍƏǓ±UšÝ™a¯lƒōšșk„èƒĬގn@ŤġŰk°ċx@œĉ`Ƨĕ°@ţÒĉwmĉ@ƒƒnƒƒa„™¥ķnƒÞĉVóÆókĉŽķ@ÝkƧƧÛaƒ°Ç@ÝÈU˜óbݼ@„ÛÒV°™@V¼ˋL™ÞɅŤŹǠVÞȗŤÇĖŚōbȁƜ"],encodeOffsets:[[113817,44421]]}},{type:"Feature",id:"1506",properties:{name:"鄂尔多斯市",cp:[108.9734,39.2487],childNum:8},geometry:{type:"Polygon",coordinates:["@@ĶL²ĬVłƑkkl@Ȏ™ŘWńÈĬȗ¯™ºlz@ĠššĊôŦô„ÒĠ°kÞܚ™n@¤„UĸèĸbŌÈXŽĸLlÒĢxɲÆ¤ÈÛƾJÈÝ°UšÅĶ»²VW¯ĸJôšbk‚V@ôlbnĊyÈzVôašb@ĸ‚ÞUl°yǬ²Ǭm°ššk„±lbn°@È»˜JX„VŎÑÆJ@k„LšƒÆl²™Ġ²ʊůĊġ‚řóƛÞÅ@m„ƒmLUÿóĉƧ@™»L@„›`ČĸmšȗÑţů±ĉğl¯Ā™wǎƒçƧŤÛI@±ÜĉǓçō°Uwô™ǫůķƳř±bÅ£™ÓÇwnÑó@ȁƽ@™ƒÇƧĢón»ŏĕóĊ¯b„Å™™VȯÅImƒōKU„™LǓ±Ýxċ—ŋ˜V±Āȗ°™„Źl±šÛ@WÒȁŚŹНŚÅèŌô„¼°ȰɞȂVĊ"],encodeOffsets:[[109542,39983]]}},{type:"Feature",id:"1504",properties:{name:"赤峰市",cp:[118.6743,43.2642],childNum:10},geometry:{type:"Polygon",coordinates:["@@ɲŁĢljĊwƾōÞĭ°_ŎŃźȹƒUČÿl»¯ôķVÿǬƽ™ɅġÅÑǫ»̐ʟȣU™¯wVWݍÈġW»Þ¹m݃ɛŎÿŎōͩůV¹›ō™éċ™óŹÅVVĢǩʈ@Ėċ@ķšÛšV°¯xÇÅţ¥™»°Ûô™ĉʟ„¥WýČ¥™w‚灻±mnÅķ¥ˋVƒbUÒġ»ÅxğLƧ™ƒbWĖÅxš¦U°ÝVóŰlô²@š¥ÜÞÛô„V@²±`š¦™„™¯Ý@„ŽÅ„VÒō¼ôš™¤V²ŹĬÇĊƑƒţxƒç¯Lk»ʟlƽýmłÝÆƏ@mö°Ġ@ŚŹĬţÆUĀĠNJĠŽX¼šnźVUҚ¦Ċxȼ@ôlx¯łʊÒÜĀˌÇČxƍČÈƐašx„ÒĠŽn¼ŎVȐ‚¼Ģ°ŤmǖČĊþšLV°ÞŽU¼ċÈUƚzÈa‚¤ôbkŽ‚nXĀšè"],encodeOffsets:[[122232,46328]]}},{type:"Feature",id:"1508",properties:{name:"巴彦淖尔市",cp:[107.5562,41.3196],childNum:7},geometry:{type:"Polygon",coordinates:["@@²@Ζǀݴʶհĸ„˜ƒ¦Ķ™̒Uˌ¼ӾÇƾ¼̨UÞĉ˜Ƨ—éÝ»ƒĕĉ—ƐȍœōǪakó‚ó¯a@™ôţ™aV¯Þ¯°@²él¥ĵğťwōxó¯k±š—Vó@™aóbUÇyĉzmŽkaóŽU@l™aó‚ķIX°±Uĵ¼™Æ¯VÇÞƽIÇÜÅ£ɱŽġwkÑķKWŋÇķaķçƒV@£šmۙlÝğ¯ƒÑťóǿƴȯ°Åł@ÞŻĀˡš±ŽÅU¯°ɅĀ™źƧʬmǠšƐ"],encodeOffsets:[[107764,42750]]}},{type:"Feature",id:"1505",properties:{name:"通辽市",cp:[121.4758,43.9673],childNum:8},geometry:{type:"Polygon",coordinates:["@@ôƲĸ¼Æèš@„ÈȮwƾ»ʠĢ¥VÆ@²¥@»Ŏњ¯ĊJŤ£k»ÆÇX¯̼ōšī°aX£ôƒƾȁź¥„ƒ™aôŤ™ĢL°ƒĸ@Ȯ¼ÈÒʈŚôVXůÆaĠƛÈKƒķšĉôÿ@ğÈĉ™»ÇVn™ĉV›wXĠÝ°šČÿĸwVƒ™¯¯ǵ±™ĉ‚ǫ™ÅÅm»²Ż±ƽIm¥ţÈķ@¯šƧJV»ÞUÝç¯UġºU£ţŽóaÅÅlƒƒ™Ƨī¯K¯Þ݃ğL̑ȍƽ@ōŎōĀƑɜnÞݺX¼ÇĢގUX°xVšʠȤ̏Ǭ¼ÆÒɆĢšŽǫƾUĀóĸ°‚k¼ċĀƑVŹȺōń¯`ÝĮƽŎĉxġNJɱłō¦"],encodeOffsets:[[122097,46379]]}},{type:"Feature",id:"1509",properties:{name:"乌兰察布市",cp:[112.5769,41.77],childNum:11},geometry:{type:"Polygon",coordinates:["@@ʠǠÞĸɲȺƒÒȂƛŎaƙÈĕȘţUÝźǟɆţšÝˌKU»š@U¯ÜÑ@ƒÞ»ôaV—ÞÇÈ@„¯ÜbƨƨÞlĸ@ĊôlôÅĊU„Ýĸmš¦ƒŽ„bm„„„Ċ@n‚ĊxŤÑ@¯‚ƨĖĊ_@›Čwl¯™ƒȭL›Ý„»ƽ¯ķů„Ǔ@ÇǓbċ™ÅÅÆwÿĠÇU£óaƒ¥¯aŎğĠţkw°»¯ůlÝĵkǻݰɱƧǫaóôɱ»Çk¯ŃóƒʇŐŻ›ĉNJŻĢ„Ž¯ÒÈUl°ƒx°n„Ò™Ĭón™Ċğ°ÇŚĉ¦ʵVƒ°°ĬÛżÇJȁńʇʹó˂ƽŎ›Æţ¦"],encodeOffsets:[[112984,43763]]}},{type:"Feature",id:"1522",properties:{name:"兴安盟",cp:[121.3879,46.1426],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÆXnlŎ°@LVLĠþœxĊUȮĊnU„ĠV@żaW¯XIŎġƒ¥Ý@K@w@K@I˺ŻŎ¦ƨƒƨÒŎIÆ@X@VºnX°lŎ@ƾĉˤƒȘǷȘÑÝݚÞbVţĸÿŤxÈĖƐŽêÇKnĸ¥ô@›ķÞUnÒl@UŚaƒīˋƒ¯ÑƧx@±kXřƐƏÛéV™ˋ»lō¯ĉ„ÅÇÓǫޗĖġV@ğ»›°ĵ„ÇÞǓ¼¯m˜ÛÅŃĉĠÇƾb²çƒ™šéż¯VƒƒğÞml»ōÑV痻V¯™¯šĕÆU¯y°k¯¯V»ôDŽѰa@Źk™ġKţšóŽšbƒ„Ź¦ƽȂó„W¤¯b™Ĭ̻ŎW°ÅÈl¼ţ¤ĉI™°ōÒ@¼±¦Å@UŽġ¦ʟŽƽ¼šÞĢÒm¤„êō°ƒ¦Èþƒšl„k¼ĊŰ°JĢńȁĬ„°ƒżn‚ÇbV„ݼ@¼óĸţ¤@°Ånšl"],encodeOffsets:[[122412,48482]]}},{type:"Feature",id:"1502",properties:{name:"包头市",cp:[110.3467,41.4899],childNum:5},geometry:{type:"Polygon",coordinates:["@@źxżĀǔÆǬVȘĀŤ¥œÅƾōôˁʈͳȂŃÈIÜŻ¯ī„¯ōm™¯ɱĖ¯ƒķÒÝIÝ»ÅV™ƒlÅôфġ™ğVmÞnnƒWçkW܁XƝÆwU»Șĕš£ĉÑ𱱚Åk™„ƒK@lÅIō҃UW‚—IǼ¯@m‚kaƒ²™l¯™ǫnǫ±¯zkŽÝVķUô™˜l²ô°ŎwŦxĶĠk¦±ê¯@Ý°U°šbóŤ@š°bôlôǩb›ŎƏȎĊ˜„ĖÞ¼˜ê—ƨÝĊ"],encodeOffsets:[[112017,43465]]}},{type:"Feature",id:"1501",properties:{name:"呼和浩特市",cp:[111.4124,40.4901],childNum:6},geometry:{type:"Polygon",coordinates:["@@ʶUĊ¥ÈřĠ¯šĉômšīƒÑ¯m„wk¯ÇV°ÑƒżġĊljǓɱţǓ›ƝóX¯ƒɛÒóa@nÝÆôƜŚĉĢʉŰĊҙ¤ȗĖV¼ÅxWƞۂlXXèm„ÝmUnšĠƒĢóÒkƚ„ÆUÞ¼ÞJĸÑ°„ɲĕš°Ŏn"],encodeOffsets:[[114098,42312]]}},{type:"Feature",id:"1503",properties:{name:"乌海市",cp:[106.886,39.4739],childNum:1},geometry:{type:"Polygon",coordinates:["@@Ș°ÇīXњŗ@ȍlkƒlUŁ±īĵKō¼VŽÇôXĸ¯Ž@šťê„°ź„k¤„x™œ@Ĭ"],encodeOffsets:[[109317,40799]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/ning_xia_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6403",properties:{name:"吴忠市",cp:[106.853,37.3755],childNum:4},geometry:{type:"Polygon",coordinates:["@@nLV‚@šVLšaÞbn@@l˜š@bUVlUV„zVx™¤kÞVèšXnš‚@nm°a@UƒÑ„@VŽXnV@Va„UšŽVKUUU@@U‚@@KVa@U²@‚wXkWnk„±lLnU@UmmVKnIVWnI@UK›@UK@@UVKXkmWLWUXmlkVwUyVa@w„w@aVI„K@aVÈw„KlLVV@LnV„VVnU‚ܲ°WÈIUÆ@nÞ¼‚‚@¦™@UÞUVW@UxUxVn„b„K‚b¯ÞU`VbǬ™V@XXÆVVl°InmnUôƒ°¯‚anam£œWVX‚KXmškôaVU@ƒVak@@wmaƒn@K@UÛUWKXUƒÇƒ@UI™b@alW@akLUKV@@Ukw±Iš›nL@kmwkWmk@JUIƒůVmnnU@m@UƒK„VKlkUwkƒƒnVUKmbkI±š—KƒkmVkKƒb@U@aƒVkUmn™`kIlaUK@UUKmbUIݚUa@mUa@aƒ„m@UUULUK@bmKkbWI@WXwlkXƒWa@k@kKƒLVkkK@L@JUVmzUKlwUUnW˜£XVlKUwVU@aXI@aWaUw@W@_nam@¯‚UkWVkUWaU@nwmJkUVkWVUmUkJ@ImbUaƒ@@WÅ_mJknmak@@mƒXƒaUV@„ƒxUšƒ„@‚ƒ„@VUnkVƒ@Vn@`ULUbWLXVW@kbUJ@XW`@ƒnÅĖWJƒ@—m°@xƒxšbnUa‚w²lƒÞ°xŤIVVULۂWbšbkVVXÆ`UbVL„@kx°LlV@Vœ„WbƒJn@bl¤ULV„°@lmL@ƒƒ£U@@aUwmKULVxUVVx@„™@kU™@mK¯LÇa¯@"],encodeOffsets:[[108124,38605]]}},{type:"Feature",id:"6405",properties:{name:"中卫市",cp:[105.4028,36.9525],childNum:3},geometry:{type:"Polygon",coordinates:["@@°@Èb°KnLš@lVš@@ƒUwVUUwVKnLVx@bV@„¤@„nK@k‚¯UƒVKk£@a‚m„IXa›ƒ@UkU¯Klwƒ@UKVaÅ_UWlU™aXa܁VKUUţJ¯w„ݱkxVbmŽ™a„w@wn¯˜„@XIÆĕ„m‚@X_@WVIlaX@WUXKVaVK@_Um„@lUVm@U„ƒ@„ƒV™„w@ƒVUÛwm@@W@ImKUkU@Ua‚aXƒ@wWaUKkw@UVaUamLU™nk@»±`¯@k—W@Ua™ykbƒI„„@VWJkLWUkJƒwU@ƒn¤mL¯wm@Umƒ²XVWbnV@bmxƒVkxUblLUV@kVWKU¼ƒŽkUƒ@mn@JnV@bUnmJUn@„k‚@XlxšLVVnKlLVV@š@LkKULVbk`WL@lkXW@kVƒ@UÞUlÇX™lkaUbmV¯@@L@šƒV@bkb@xƒlW„—bƒbW@—±@UJ@IU@mVk„VxV@@l„Illœn@Vm@ƒVUbl„@JLmKÛXmVkU›KULU`@LĉwƒKUX„lVUl@Vb„JX¦̼bÞxŎxɜĖĠ„Ŏaô@"],encodeOffsets:[[108124,38605]]}},{type:"Feature",id:"6404",properties:{name:"固原市",cp:[106.1389,35.9363],childNum:6},geometry:{type:"MultiPolygon",coordinates:[["@@Vnn@°xnK‚£„mV@„xlIXVlKXI@Uƒƒ„JlašzVbX@l˜°@²_@¼mlVšnKVbUb@VlxVLXb@xW„bVbV@VlnL@J@Xn@Üx„b„W@nl@nblmnIÆ`@X„@Vbna@aVUUWVkƒ@kbWakbU@VwšW@_l@nmn@@alVlk@UkmVak@@a‚UXaƒL@¯@KVa@axWI@KnkVaVJn_lJ@„X@‚m@nVanUVb@mXLlJ„VWnLla„VVaVX@KXVVkVKlknKVa@aVU@KXb@klJUknUmƒ@K@_UW@alIUamaU¯kJma@IUK@U„@@UW@@aXLVƒVJVaXIƒKlaUkUV@ambUUJkIWJ@wUI™V@JU@UwV@@Um@™nU`@UkUmVUxWUUV@aÅb@aWXkKUUƒUUaWK@wnm@IVU@aXwm@UmVaUalk@anKUwlƒUwlkK@wmaƒUkmmIk@VmkUUbW@UVUnW@kV@xkVmbVnU‚™@UbUV@a›k@kkW@„kLW¤@„nV@VU@W_UV™UU`VLUV@IUVõVULU@UUUJ@wmkUJ@šWI@l@bkKkbVVƒbVbUL@UUJ@Vm@@L@xbVVVLVlVwX@Vb@bmUkbk@@JWIUVÅw@Km@UkWKXxWLÅ@UVUnWK@xkVW„@KULwWVXVWzXVVKVXkV›V@VUbV@U„VV@š@LXxVL@V„b‚Ž„LnKVLVxXVmb@l"],["@@@J@aƒU@LWK¯UUxVVn@Ġ„„LUW@UbUUUa@KUX"]],encodeOffsets:[[[108023,37052]],[[108541,36299]]]}},{type:"Feature",id:"6401",properties:{name:"银川市",cp:[106.3586,38.1775],childNum:4},geometry:{type:"Polygon",coordinates:["@@šUšwVK@UVWÞUšbšw„V@knV˜@@KU_VK@K„ƒn@W_XWlL@Vn@Ċw@Ulaœ@Wanamī@aƒ»ŋó@aÆÅɲÿUaV_°ÝaƒLƒaUmVwVwX@VUVݚ@@¥Ý»@mVÅÇJ¯XÛ±VUmƒUmU@KUUkKƒLÇxUŽ@bƒLUJ@bƒx@xUbVzUxklWnXV‚KnXWlUL@V@ŽVLœ@VL@ŽmJUXmJULnn@VmVkKƒ²mlXWlx±@@VUb@L@@VV@VVUL™ƒVUbU@WmUƒ@„Ò@V¯bmn@VŽƒ„@lVnUšnVWŽXVl@¦VVUn@x‚š@‚XL@¦‚lXxš„Vb"],encodeOffsets:[[108563,39803]]}},{type:"Feature",id:"6402",properties:{name:"石嘴山市",cp:[106.4795,39.0015],childNum:2},geometry:{type:"Polygon",coordinates:["@@U¯ķó±ÇÛ¯™ķmbXb›@kb@Vĉxm@@UkKWXX`m@ƒ„@LULV`@L—@mU@lƒU™x™aÝVUX@VUL™x™VkLWVšš@J„nVLXVlŽUV@zl‚VL@V@b„„n@lU²WVLlLVbUŽVxUx@xǀL˜xôҜk‚K²ŽVa‚U@wXa@W™ÈĉUa@‚bÈk„m@¯"],encodeOffsets:[[109542,39938]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/qing_hai_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6328",properties:{name:"海西蒙古族藏族自治州",cp:[94.9768,37.1118],childNum:7},geometry:{type:"MultiPolygon",coordinates:[["@@„V£°š@laœXô±źwš™ô@„Ulƒża܍n™Kƒw@U„aƒ™ša²L‚mÈLƚÈxlaUa„wÞmÜbÞUšnJ°a„kôƒ‚ÑkwÝVğwÇ@ÝkkV¯¥@ò„»„nŤ¥XImw@mVwša@Åw™mLkaW—wƒ¥l»kçƒó„»@ƒWÑĉŽğ@ĉ„™‚Ń„UwóřVómĵ»™™Ý@VǕ¯kšÝĊÅk™°ÓUklkU±šI„ÇÞkƒ±@šƽJƒ™@UġIk@W¦™VÑșÓÅnťKULnŽ¯X›ƒ@¯mUÛ@WřmóKknōbƒxÝ@ƒŽU@kw@ÿÇLţšÝUkšmwƒŽk™lċVŚU¦™ŽƒLkUWlÅÑ@aƒ@ÅѱUóġŹ¼ƒÈĉmŻ@@wkw™Kl¯U™ġ@—„lÇU™Ó¯_ƒ‚Waĉ²Åló¼VbknƒKǎÅ@ƧĢō°Ý@ğ„W™ÅxUUm@™‚ÝXۂW„ULUè¯@mbUaƒLƒbUWġxIUJWz™a¯b™y™@ōÈóLU`ÇXUl™UĉV¯n›mÛbǕLklƒUĉVƒšóaġ„ƏbġKţnkbÝmmnÝWȭȃŽÝXţWókUÇl¯U¯‚ġUɅĀ@°¯„„š¯„VÆnmJ@ĊķnóJUbÝXUlVškL@lVxnnmb@¤Vzš`ÞÞŤ@„VnÆJV„°b„UôJkzlŽkl@²óš@ÆÇ°kĖƒšÇbÛU@lmb™XV˜kzƒV™ŽɅĀXˢlń„ĬŹ@›éÅ@ĉńÆ°ğbUšlŽɜ_°‚@xŦ˜škbVbƒKĢ„ŤVŎŽ°@żÈźlĊ„ôKôb@nôxŦ„Æ@ôŽŎL@þÆb@šnnšWˌbÈx‚InaŎxlU@Ѳ±ƒğVUĢƒƨbɲ@Þ¥ôUUķWVô¯ĊWʶnôaŤˁ@£nmnIôŽǪK°xUXô@Ŧa°m‚kXÆÞVŎkĊ°ÞLȄôyVašIlwX°UVwĢÑÜKôw@nV@œm°nmŽn„Ü‚ɞ£VbmŽXnƒ°ÜÒ@xx@V‚b²UlbkxVnšJUnVVĊ°KȚm°nxÇnn¤±¦@ŽUXVV@„lV„„bmVVȁŽVxšÒ™°šIšbźaȃšbVwš@šƒVL„™ƾÑ@ƒŦô¯ĊkôÑ"],["@@„@šƒ„@n„òVœa‚w²bVxšxÜaČVô_ĊJšIVmšL„a°@Ŏ¥XlK@ƒšk„l„KVbUb˜@nUĢn‚aÈ@lmǬ»Ġ¯œn‚mnƒƨVy™Ñǖ™Ġ»ɲInŽ‚@@ÅĢƳ@¯°™ôV„KÈbVIÇ¥¯@Ýó„™@ÑnīWKšƒk™‚k@¥š™¯™Åa™Xƒ±VÅw@±Ġ¯@»™š™n™Wmw@ƒ™@¯ƒVƒUUWçƒKĉ„a±VkkƒV¯w™x@šUJ‚x@bknÇb™mÅ@Uw±U¯¦UŽ™Kmš¯I¯Žť¼ğĊ™@ǃŹÈ¯@Ý»ÇnˡJƒbÛèÇnƒ„ÅK¯„ġĠŹW¼Ålm„@¤n²ƒŽÝb@b„š¯lƒ¯@ƒšÅ¤W„™¼nV@x„„°@Vx„@lbUblbX¼W‚œšÇ²lšUŽ@¼ŽV¦@bÇlVxUbVxÞbVšœbm¦ƒVV„"]],encodeOffsets:[[[100452,39719]],[[91980,35742]]]}},{type:"Feature",id:"6327",properties:{name:"玉树藏族自治州",cp:[93.5925,33.9368],childNum:6},geometry:{type:"Polygon",coordinates:["@@ɆÿĢV°°VÈklVôŤXÞW„ȮÇÞXnmÞnlaŤmĢLƐaĢƒôb„™ĊU„VlkǖKÜaœn°mĊUšVVkÈWV_ôKŎǚ@šz°ašbXyVI‚JĢwVX„a„KVbna°@VçVKXƒÜÞWšn@VVÆwXšĠƒÞ@Ŏ¯ƨġÆ@ȍ„LlmUaô»ÆkĊ±Xb„°`šÔV‚kȘƒĢ@Všk°šLlx@xż@Ċn„Çź»ôĢ²VÆ҄@@bÆÒXklV„KšV¥Æ™ČUšk‚l„nxl™çƒ¥ċç@±m¥ƒwÅJƒ@™™™Vƒ„mÈIléÈa°U¥™™@kÞV‚K²ÑWƒ°w²Ñ‚K²ñšyƐ„ÝšVmw„»kkWĉ—JWUƒVÅwƒL™mÅ@@ƒmw„kn¥Vу»°™°@@»„¯„Lla„JônV‚UůƒU@W¯Umѯ¯k@WykU@¯„wV¥ƒkVwţƒk»šwWǜĉĶçšK„ƒÞ™ÇaĉbƒI™lUƒ@kwƒWƒXUƒ°w™±@UšKn£Wĉ—KWxƒkĕVƒšamwXw™@™„Wmnk@aƒVkƒ™bĉLƒl™Imm„wUÇ‚Wx™nÝJn@¥Æ™kwƒaXƒÜĉ™¯ÅV¯¤mkƒx¯kķܙ²VWôŹVUƒƒ@V£™¥@ƒ°wn@™m@¯@UbUôķŽmn@ÆÛ@ÇýVaUÇĊVƒ@Çlğ—¯xÝŤ™lVÈÈVƒx„ƒ¤Vx™„kK@™@ƒx@„kVƒĖġ¥kIWbXŽŎx@nƒxÅUW`ƒ_—@±ŽUa™LUxƒK¯„WbkVlb—bmŽƒLÛÆWIUwƒWkwÝV@kI›ŽéUb›UUk™V¯Km¯k@Umݐ¯m¯›m—L›Þĉ‚ÛUm™ġ£UxkKm°™Lw›šk@kšƒVm„ƒKVUk›@¯a¯Ģ™móKUU™x™ImlÅn™™ÇbXèVVU„°„@ŽšŽ@„‚xXnmš™ššŽ@¼ğ°@²ÆxU‚„²šWÆb°š™š@¦llš™„XLmĬ@҃šÞô°@ȦUJÇaƒLóU¯š@°ġƴ@Ɓ@mɱJğ¼ǕššÒUzƧ‚m„n›mğ°ǫ¼knÇ@bġmmV—@VaUaƒLƒk™l@„kLW‚ō¦¯@ƒb™KUn™JĉIó`ċUÛb™wUw±ax›bñUmƒƒ@™„ƒ@—bƒaƒbǏÅXm˜„ƒÝ„ÅôVbގ™bl„UšÞVޚ„U‚°„VUxƒ@U„V„@l`™¼nL@Ċ„LW„„¤kXķWġXUVVVķ„UbVb@°kVVxÈa‚@ȦĊbšaźJ„U@Ț„„˜Vœƒlš@XkôaWƒĢ™Þ@laĸUÆb²mÞLĠ™ÞÑôbšÒĊa„JVbm¦"],encodeOffsets:[[93285,37030]]}},{type:"Feature",id:"6326",properties:{name:"果洛藏族自治州",cp:[99.3823,34.0466],childNum:6},geometry:{type:"Polygon",coordinates:["@@ÞVŤ™ÈK@ĀlxV@„Þ@„wŎalmôLšnXÆÜ@nV‚°@œ„°WmVKŦLÆmȚԂҚUX¥l@ĢJVš@„ŽƾI@w™W°™™Ån¥›kÅÝVwôƒÈç„@lÑĊĕša„JnaÆLVw°kny°UnkÆVȍĊll¦„Vƾ@@™nUźƒÈǂIn°X„wÞKô¦VWV£„@£°ókċ±I™™am¯Va™»ČĉV¥°™@m„k„¥l@„Ċm@ašU™mwXƒ@wÆxšmĢ_„`VnÆbšKVw„@@ƒnUVğVmVVöIlŽl@@çÛmƒ£UDŽw°@VUƒ¯»m¯ƒJōĖÅLƒa@»ĉĢ±`U_k`ÇçšóƒkX™lK@ƒakÝރš£WċkÝ™kxƒJݯÅw™xķxmIÅx„@k±J@ýŋš›¤UœkŽmV™°ÅÝxkwmġƒnÝVU„š¦ƒŤlmšóXk¤™UKƒç™@mVkK@klīƒ£mš¯VUbƒW¯¼ċb¯ĵam¼mVX„m@k¤ÇX‚ÇbƒUƒ„¯J¯„¯È@˜™bVXVҙ¤V¼kxݚV„@l‚V—„WxÛ¦Wš¯šmKnlŽkŽ‚šU‚@nƑUĉ„Ý@ǺۄċUĉ¥™UƒÞŏ™z±òL±Ò¯xX„±ÒLÝU@lššV¦¯‚ÇbkêÇJƒnU„šš@š„‚ÆI„xn¦‚‚@²Č脦‚è"],encodeOffsets:[[99709,36130]]}},{type:"Feature",id:"6325",properties:{name:"海南藏族自治州",cp:[100.3711,35.9418],childNum:5},geometry:{type:"Polygon",coordinates:["@@VxƒŽńƒš@ĊĠŽĊXÒ°UƾĕÞm°£nb@‚@LUUW„Ûº@nlÆǬšĠ£ÞV°UXb‚VȂǵ„éƒ@kWanm°@™x„z„K°¯ĠVšƒVƒkw™Lnm°kÞxÆa„¥@‚wnĉƏ@™œ_l›š_VwšmĸèŤÅČU@™˜Wn@ÑmKU™nğƒK@ƒ°¯UÿV£nmšLl™„UƒUÛé±óókkmƒnƒakV@Ç°óÝXƒWəÞťIţxmm™VÛUVȂÓnWyȁĉkƒVš°WnkĊa„¥‚_œK°ÿWna@ƒmU¯wƒlÝIU¤UXó¥ÝLƒx¯WmJÇÈŹ„mV@šƽ@ƒUk¥ĉkċŽÅUml¯Vmz¯lUxÅKmbƒI™bĉĖk҃@Çèó„UxÆޜlm¦šÆ¯ššX@x™Ž@Ž„²ÝlƒÈ™JV²klVl¯ÔlšĉƙްlUǖÞ@ššĶ¼nŽUôôŚ"],encodeOffsets:[[101712,37632]]}},{type:"Feature",id:"6322",properties:{name:"海北藏族自治州",cp:[100.3711,37.9138],childNum:4},geometry:{type:"Polygon",coordinates:["@@ōmġxƽUm±Lǿþġԙ@kxmWƒb¯I¯‚mIUx@bƒbŹVǎƒkĵbƒlĉI¯¥ƒUšm@ƒÆ¯È@šašóšUlƒČ»@w›œ»›wXaƒƒó°ţç݄kUƒaV¥ÅbÝw¯lmnšKlxU„™„ğU¯°ƒLƒyšw¯@mnXb‚l„@ƒêȁǶUWa¯VÝUğ¤ǫ™kÅ@mܹXƒVV@K@ma¯¤ÝnƽĖ¯V@„ƒ¼„ôlèk¼„¦˜xXŽlbnKšÆx@Ž™bUx@nnxWJţ¦ƒmƒ¼ñ@Ž°¦lUÞlÈ@ĠxÞUlxÒó„ƒl¯bmI™ŽÝVÛaÝnƒxVbkbÇwřÇKn±K™b„šƒb@V„xšLmŽÛŽŻbk„ƒVó@™šŹxó²›Wkb™@¯U¤ƒźĊ@lUX„°lÆôU„ƒlLX‚aœV°wšxUb°xÜôÈKVkÈmlwškÈKšwšK™™VUŤĉŎ»„»„Il¥na°LV»²¯Üy@wĢƒ°ĸwlwĢw°±„_lVkš@°ƒbƒÆ¯zƒ‚„š„@l_„@Ģ±lŚVlUaރ„LVƒnKlnȏ°IllČa˜wÞÑ°x„UU™@wƒVkmĠLô»„KÞýôaÞ¥ôĀÞmƁ„™‚mUƒŎV¥Èl°²°a²¥V„@@w„amm@Ñn@Æ£żƒVƒĠ£@W„¯Þƒšl@š»@Uk@"],encodeOffsets:[[105087,37992]]}},{type:"Feature",id:"6323",properties:{name:"黄南藏族自治州",cp:[101.5686,35.1178],childNum:4},geometry:{type:"Polygon",coordinates:["@@ôl²ôÜê„VƒVkš™KmnU¤VĀ¯°@„„LmĠVšnLÈL@alb@al@n°Vš_XmWUÈamaVIn@n‚aV£œóVWƒ™U£°ašxÈ¥@™‚aĊwȹ@óša™ƒğbm@k„w@mƒaÆw@ƒ„In¯mmƒ@UkkWƒÑÅ@@kċÅçVkÝJÅkVykŹl¥@¯š™ĢU܃X¥òý—mmX™ÝÅlmU@£™Wly™XW»Åbƒl@aI›»k@klm@UxUUƒVƒ¼¯Xƒl™aUnķ‚ƒI@x™@¯„ƒK™„ĉUU`óšlČ¯ô@¤ƒÞJ„k°xVŽ„n@ŽmbXŽ¯Ā›L`ƒ¦ĉbml¯X™ŽUŽl„ȂĊXzm‚ȁÔU‚ÜVšUnnŤwŦJɚ݄XÞW¯ô@ÈlU„b„mln"],encodeOffsets:[[103984,36344]]}},{type:"Feature",id:"6321",properties:{name:"海东地区",cp:[102.3706,36.2988],childNum:6},geometry:{type:"Polygon",coordinates:["@@@҄bš¤ÆI°ôU¼š°UŽnnWx™š@b¯L@lUUWbXxWl„ƨnxVUllš„XVŽUŽnL@lȀý²KVnƾ‚ĢwV»ƒ@mÞ£nÆƒÞÑmL™ƒKUaVżĕƒWVk²ƒƒÆÝ@ƒXw°@„ô™@a°wóUUmIk™™aVmÞwmknyƒ¹VÿƧnŏm£X»˜™naV±„Ýw@ašb@aƒm¯„ĉVó¦kÝWKUU@WanU™b@ôǺĉxb@šÇ¦™w¯bV¤„šUX›ôU¤bmm@UJnbÇbXVWn™`¯Umk@@bka@bÇK"],encodeOffsets:[[104108,37030]]}},{type:"Feature",id:"6301",properties:{name:"西宁市",cp:[101.4038,36.8207],childNum:4},geometry:{type:"Polygon",coordinates:["@@@kmKVUƒWk™VkUmwƒƧXkWwXaVV@k°K@aš™XwmmV™¯V»¯óÅJ™£ƒamŽ—X@šċVţÆķç™nUx™`kœ›`@šÅmĊx@Žƒ¦U¦„blVރŤèô¯„„Wbœx›¼œŽ@xċ¼k„™V™ô™bÇ@Å°@„™n„V°¦ĊJ„kĶa„lȍźU„a@aVwnJ°°J„anXlwš@ĢÓ"],encodeOffsets:[[104356,38042]]}}],UTF8Encoding:!0}
-}),n("echarts/util/mapData/geoJson/shang_hai_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"310230",properties:{name:"崇明县",cp:[121.5637,31.5383],childNum:1},geometry:{type:"Polygon",coordinates:["@@uŏu»GPIV±ÐɃŜ{\\qJmC[W\\t„¾ÕjÕp‡nα|ěÔe`²„ †nZzZ~V|B^IpUbU†{bs\\a\\OvQ’Kªs†Mň£RAhQĤ‹lA`GĂA@ĥWĝO“"],encodeOffsets:[[124908,32105]]}},{type:"Feature",id:"310119",properties:{name:"南汇区",cp:[121.8755,30.954],childNum:1},geometry:{type:"Polygon",coordinates:["@@`y”ĉNǕDwǏ»ƒÖLxCdJ`HB@LBTD@CPFXANC@@PGBKNECCBB@EBFHEDDDSNKAUNBDMNqf[HcDCCcF…@EFGLEBa@ACoCCDDD@LGHD@DJFBBJED@BGAEGGFKIGDBDLBAD@FHBEF@RFDMLE@SGANFFJBANPH@@E@FJjRIACDMDOEKLFD@DbDAJI@AP@BGHFBCBGDCC@DCA@CECGH@FKCEHFJGBFDIHACEDNJDCVFBDCRKRLDLITB@CjNJI^DBCfNVDHDFKHAFGDIICDWBIF@@CFAjFJNJBBHD@CJ@AEFJ@@DH@BFBCPDBMFEQGDIFCNDHIP@HDABFACBJFHEBSZC@DP@@JDBƤ~"],encodeOffsets:[[124854,31907]]}},{type:"Feature",id:"310120",properties:{name:"奉贤区",cp:[121.5747,30.8475],childNum:1},geometry:{type:"Polygon",coordinates:["@@~T~JjZdDbLXDLCB_J@@FHFZJJIAGH@HGR@BENBLID@@LFCDF\\FpDBDb@FAHKFE†@dEDDdC\\GreNMACVMLBTMCCFCEGFAA@DAFDLMHA@OD@BMEWDOC@AS@KGAI_DcKw„ÕísƝ‘åĆctKbMBQ@EGEBEJ@@MBKL@BJB@FIBGKE@ABG@@FMFCPL@AjCD@ZOFCJIDICIlKJHNGJALH@@FPDCTJDGDBNCn"],encodeOffsets:[[124274,31722]]}},{type:"Feature",id:"310115",properties:{name:"浦东新区",cp:[121.6928,31.2561],childNum:1},geometry:{type:"Polygon",coordinates:["@@EN@JJLNHjLJNR^GRYVBNZJRBV@PDvbLNDN@LGNER@nCNQNuT_TIVFV\\Z\\XnDrI|[Ʉś²ÏJUHOƣ}CA@IO@@CYDATGFIEDAEBBAGCO@GJMCEDCJRHEFANOCADAEG@@CI@FE@BDIC@AGIAIMiEEB@DE@AJCXJDCJEHGBELGCUCeMAD]CIJiM@DSAKJKCLQDQACUECDMIFCBDJGECHAEIWCK@GLMCCGEACNKCEJG@MMBMC@@CIJUINT@JAJSTEPZZCP"],encodeOffsets:[[124383,31915]]}},{type:"Feature",id:"310116",properties:{name:"金山区",cp:[121.2657,30.8112],childNum:1},geometry:{type:"Polygon",coordinates:["@@L@BIHFN@@EE@@EFBDGDAADVDD@@EF@CA@IIsRE@GDAF@BF@CV@|FBCHBLCNHAFCADBMDCFZXHILBVEEQA@MWFARJJ@DCX@@TEFBLHAAERE@AJABRPBNK\\BrJ\\VHGND@CNADKDADQjGAGNC@GJ@FCFFHC@JF@@dLBDSFADHVG\\DTEPDDHJALIJkJDJCDIPE@YDCBiK@DONE@EH@BAF@HLJA@EIA@ALKNA@@FIFAFHR@NALadsæąyQY@ƒA±DʼnXUVI^BF@FFF@HBJEDFFGFEBSRkVEXGHFBMFIVW@GAEEFOIAIPKABGWEKFSCQLQBSEIBC\\FdBLRR@JGACFDDEF@AWB@LJJYNABBA@CUEGPaO_AIE@MYMFIGAEFECHSAAKAO\\[JEDB@E@MMA@@AGBKMGDFFCDDFEDFJF@NPBAFLHFH@EDDHBADDC@DDCDHHCDDFDABDAD@FEFOBCJ[D@HEDDNJBDDHABJIBBvGLBJAH"],encodeOffsets:[[123901,31695]]}},{type:"Feature",id:"310118",properties:{name:"青浦区",cp:[121.1751,31.1909],childNum:1},geometry:{type:"Polygon",coordinates:["@@RUNKdOFDJCbRFMLAHPLDN@JGL@@APBWYCKN@TU@SHGCEJIDIJKVIZVNM`iNY@CIE@CA@KBOEGEUFCCSADEIEFCDDDIDDHC@CKIeDCG@IG@DHWFEEGCH@@GO@@O]CNpeEQDBFME[JC]DGF@CKOA@QSB@GB@@GW@@ED@AQIJIAAFE@@DO@CFI@KNG@CDACAFEGKGBEGBDCCAIFCCLIECFI@MBCLDHGNAHSF@DMB@EEKBA@@C]DEICFG@ADBHGFKCDAKKHKD@@FHGAANGEEFCHKCECBCKG@ADKCNE\\[A[I@@mGBDQQEO@BCE@AI[AML@JGACLOAFKEMM@EQKC@CUCBCCBCHEA@FF@@FM@GEAJK@GNF@EXPH@FD@M^@HIADJCFDBER@DK@@DE@CAKFOCCBDHIBCNSB@GFC@GQEEOWFICGDUAEJIDBTAHJHEB@DIF@NE@H|HBDBEH@DKBAHEF@HEEUB@FGFGCCCE@AHOB@NH@PRLVNNFBX@RC€PbAvMtBfH@DJF@ELBFA@EH@HNED@FFB@HLC@CJ@@DJ@PIRf@HE@CFF@GPHD@DKE@FFBEFFD@DEFCA@DD@IjCRFBAHFDKD@HF@@PM@H@BlbDJDBFEF@DLXB@HCD@@IFCBIFEJD@FDC@FBALLF@PAACJERACAJCBD@EL@JD"],encodeOffsets:[[124061,32028]]}},{type:"Feature",id:"310117",properties:{name:"松江区",cp:[121.1984,31.0268],childNum:1},geometry:{type:"Polygon",coordinates:["@@@DLDFRN@FNELPBDKHB@INK\\BBJF@ADP@RFCRHA@nJ@B\\[\\MFLDBCH@DLDADFGLEDFFMHBBGH@EC@GLLLCBLDHEAGBCH@DEFJ^C@DB@LAFFA@CNE@GTMBGHKCAD@NEJFDKJDDJEDBCDHAAFLHFHBEBDDCH@LMJ@DEP@@CF@BEJBJIBRC@@FX@@HA@@HTA@RPBDLE@CHD^\\INFAERCfFMo^D@PP@@HG@HDFFXECGH@@JDHfCLJ@DGDCCCJCCEDJFCFTBDDVEHFPFLAB@NBFCFKFC@CHIACNOHWHCAAFIDD@CDAGEI@ACFMF@R@R_@GQED@EGFEQEDE_IAHKAEXCQUOQCUDEN@ZI\\DDmAMHCICDSOC@EG@BKHIGMIBCGOCSF[CUHCGEBCTKA@cE@@IGDEEEDI@@HMDBHiHCRCBCLMB@DMCGH[UqI[AMLOAAQIB@BQFBFGBAKFE@SW@CDI@QIEBNXB@FRUFKAGJYWDENCCADBBEMGKDGAAD{EU@@DAEE@CB@HQFJt@JDBE@@FC@"],encodeOffsets:[[123933,31687]]}},{type:"Feature",id:"310114",properties:{name:"嘉定区",cp:[121.2437,31.3625],childNum:1},geometry:{type:"Polygon",coordinates:["@@F@LI@IDKJADKIEJICADGACFECCJ@HKCAFOHAJI@aCBEE@ICAEB[GFGCKL@FGEIFADMLCAEJM@ELQECEIG@BE^QKKLQCA@EHBIGQ[GEHOMGGDHKH@JOECFCjCBEFDNCACMBCILGTABDLEEOEIG@GFIMM@CGKFBFCDE@@GEAGEEACIcGaHMFITIHDN[AKF@FS@OA@BK@IHM@KCGOKBENaQIDECcPMLQVFHFB@BFBKLGD@FAJOVGIACQ@A`LPCB@JEF@RU@ANS@@RCL\\HIFpRBFRBBDKLLDADJDGBFDABHBEDNF@DGBBBADKDAHC@\\JJFBDEH[DEFDH\\LX@XLBLbT@DNJLDCEL@VJABJNDHB@HBHYFBAA@GNFB@@AFB@AFABFLFBHFCL@HJBAFBLC@DN@HN"],encodeOffsets:[[124213,32254]]}},{type:"Feature",id:"310113",properties:{name:"宝山区",cp:[121.4346,31.4051],childNum:1},geometry:{type:"Polygon",coordinates:["@@ˆmÖoÖiƒ½[s[YEUJU`SCIEBCCWJY_LIICDWU@@FaBCJIB[ICH[@@CDKEE@MK@@IMCAEBCH@AMFI@SMGEFGB@FK@BHCAIFJNQD@FEBDFMBKGACG@ECWH@@CDDTOEEBGEK@GC@EE@GPHFR\\JHGA@FDBKRLL]RAFH@FJFDKR@FINBFKDCNEBFJEHK@DLEH\\HFADB@JFFDA@bIJGBEPDBGLI@DDEFBDCHDBIJJFCLIBCL@JKJE@ADHDBHJ@HIBBDFHBBAEIJ@BJFAVL¢ˆ"],encodeOffsets:[[124300,32302]]}},{type:"Feature",id:"310112",properties:{name:"闵行区",cp:[121.4992,31.0838],childNum:1},geometry:{type:"Polygon",coordinates:["@@T@@ELE\\BCMJGJSNEbGdHDJFBJAFIEIFCEWG@@gMENSFCVJFAxR~B@IH@AIiI@GE@FGEAFQPDRiV[\\DFSGMHAXHDOMCJCDETBBNVJJI@DD@ANNNH@FILDDMFBDHNDHKL@XDFGLD@EHGFD@DDB@CDDHCDAEAHG@ABOJ@BIaC@CECLKPFNCDCJBiQEIF@@@OGBMIAEEBMTHF@NKEC@QFEGA@EBCKAACHCLJHEFHHB@AFCAIEACIC@HG@KCCDC[ECEED@KC@KJMAAFQ@GHG@BHIJYIGE@EI@A`KDWCaKcCiY}I}S[CYJM@CFDVPRRVWDFžLBBG`JCFRFEFFHC@RF@HQ`Q@E@ENBDJ@HFCB@DCCEJBBGDGXMPBDGJ@DEDELEDMA@DJF@DMZ_jMNYUUJILCJIJDFGH@TSVM@DLXZ"],encodeOffsets:[[124165,32010]]}},{type:"Feature",id:"310110",properties:{name:"杨浦区",cp:[121.528,31.2966],childNum:1},geometry:{type:"Polygon",coordinates:["@@V@CXJDKJZ`XIDDFADJvSRMDM@mFQHM@KCMKMuaOCU@BDAJSX@HKJGD@PNJCJWAGT@R"],encodeOffsets:[[124402,32064]]}},{type:"Feature",id:"310107",properties:{name:"普陀区",cp:[121.3879,31.2602],childNum:1},geometry:{type:"Polygon",coordinates:["@@F@@FHDL@HFFAPFCSDC@@XGFDH@BDLHNACEFA@ERCIMJEDBAGL@@EHAFENHHJ\\ONQBQCIBC[MKACKI@GGGH@I_G@CW@[DMHCDIBMTDHN@JNHEH@FJFPKFACSBKHDJNABDMDECAFiDEDFDIPG@GLHCNH"],encodeOffsets:[[124248,32045]]}},{type:"Feature",id:"310104",properties:{name:"徐汇区",cp:[121.4333,31.1607],childNum:1},geometry:{type:"Polygon",coordinates:["@@RADL\\NCPHFfLJaJ@FWLGMGIK@IFMDOYYFOTSBI@IMSAMSACFIDNDCPWGGBHNET[CU\\QjOCERFBEHF@@HjJBJG@@J"],encodeOffsets:[[124327,31941]]}},{type:"Feature",id:"310105",properties:{name:"长宁区",cp:[121.3852,31.2115],childNum:1},geometry:{type:"Polygon",coordinates:["@@HFFB@HF@DCAELENSJADCNG\\CX@@D`H@JHGHHJ@BINBFUGEDO[MCKQB}AwQEBUIEDMTNF@hH@FXEDFJEJIB"],encodeOffsets:[[124250,31987]]}},{type:"Feature",id:"310108",properties:{name:"闸北区",cp:[121.4511,31.2794],childNum:1},geometry:{type:"Polygon",coordinates:["@@CSG@BQGODUPWTOBQAAFMECKBGEMFKEOHADDJARMR[PGI@TEJBNG@ADBFND@JL@@NFFCL@D\\@DG\\JJADI"],encodeOffsets:[[124385,32068]]}},{type:"Feature",id:"310109",properties:{name:"虹口区",cp:[121.4882,31.2788],childNum:1},geometry:{type:"Polygon",coordinates:["@@bA@E@QHSXBDIMI@OHCLI@GTWBIACQAYIOFGCENBBARSPOXCVHPARH@DT"],encodeOffsets:[[124385,32068]]}},{type:"Feature",id:"310101",properties:{name:"黄浦区",cp:[121.4868,31.219],childNum:1},geometry:{type:"Polygon",coordinates:["@@NEHFLAFDHDPEAMZUHQQ]IMKJG@EPERABHBGRUCCNGV"],encodeOffsets:[[124379,31992]]}},{type:"Feature",id:"310103",properties:{name:"卢湾区",cp:[121.4758,31.2074],childNum:1},geometry:{type:"Polygon",coordinates:["@@VDHQGABAFQFOH@LIiKKHEXI@IbAFZB"],encodeOffsets:[[124385,31974]]}},{type:"Feature",id:"310106",properties:{name:"静安区",cp:[121.4484,31.2286],childNum:1},geometry:{type:"Polygon",coordinates:["@@DLLB\\NPGLFHUDMYABEeKEVMAAJ"],encodeOffsets:[[124343,31979]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/shan_dong_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3706",properties:{name:"烟台市",cp:[120.7397,37.5128],childNum:9},geometry:{type:"Polygon",coordinates:["@@ŤLšLllVń²è°xżĢĠÆl҄šŤbœ„V¤ĊXnŽlĢVĊ„Òš„È°ĊŰÞè˜L„±@џn»VUźċ²»ÆkôVɆkĊŃ²kŤVVwUUVmUaƒ@KkU@ƒmUmmk@UwUkmW@UVIXa@ƒmw@a™KULƒaƒx@Uk@UbWU@yULmK¯@kXƒVUwm@@JUUknWKUVƒLUbU@™wWykIƒa@w@mUI@ašUVynIWa„k„@@W„bl@@knmƒK@wnIl™°Kna@V¥ğ@ġUķ»™¥@UōJƒX¯¤k@™wmI¯‚k@mwƒak@@šlX@bUJ@VƒbknWxkLkxlŽšLVlkLmŽšb@bU@ƒbU@VbU`Vb@n„L@Žmb—U@˜VnUVmnU@mm™@kIUWVIUK›VkkUJUnmL@VmLUaVWaXamU@™™U@KUUmVƒU—JƒU™VÇwğn™mƒ@mXĉV@l¯xnô"],encodeOffsets:[[122446,38042]]}},{type:"Feature",id:"3713",properties:{name:"临沂市",cp:[118.3118,35.2936],childNum:10},geometry:{type:"Polygon",coordinates:["@@˜bXlƒl@zlV@lXXmŽkbVVlš„U@Vn@@Vmb@XšKšVX„WJ@XXl@„‚ŽÈbVLšUl`„@XXV@VVUxVbUxVbš¦„@‚WnXVJ@bnVUzl@„°Æx„U„KlU@mUUnUlUVWVUnVV@XX°V@Všll@Vk„aXVl@Ux@bmbXLlKlb@b@bUJn@@„„b@n°x°K@an@@UlLVKVbXb@bVVnK°LVa@UVa@™Xw‚KVxnLšU°@naV@UWUkWƒULmV—wÝKUUla@aó_@mƒK@aUU@ƒWUkwVm@aVI°W„@@IUw@a±¯@¥kUVUm@a‚wkw™@ƒK@kVKk@maXalI@alL„WXblaVLVU„V@LnKš@„l@w˜aXašLlnUl„LšmV@n°J@_VmnIVym£UKmI@WnIVm@anUVmÇ_kġIÅWUXÇm@U@ݯÅ@ƒ™@naWƒ™IVW@IkK@klKn@naWIƒmk@ƒaƒbkKkLWn™WkLWmk_ƒ@UaVƒUKmLUw@mn£WwUmU™ƒaóV@UkUm@UKULUwmJUX@WW@XҙzVblJXŽWXk@UVWK—X‚¤UL@xU@ƒ@ƒVUaU@@XmVkLmWkXUyÝLmKXnVŽ@n@l™x@bWLnVVn™`knULmxUl„„WLXŽVb@VƒK@z¯x¯¼Wx™KUn@bk@ƒlƒVVVz"],encodeOffsets:[[120241,36119]]}},{type:"Feature",id:"3707",properties:{name:"潍坊市",cp:[119.0918,36.524],childNum:9},geometry:{type:"Polygon",coordinates:["@@l@@UšK@Ž@L@bX@@VlL@JƒLUVnX@`ÜXn`V²mJ@bU@@n„b@l°xnnĸVƚ°@„ƒĊ£Þ@lWnÑnkʶJmó°w@kk»V@»ƒ¥k@V@kw@wVm„a˜Å„mšaô£ŎƒXI@mln„Kla@mV_UKƒ@kUkw@alW™IU»™mƒ—@WUIl±UUÅU›bkJƒ@a@wUKUaVIÆmXIWaka@m@Ul£XKVw@ƒUIƒJUkmJ™ƒVkU@a„ƒWK—ImVƒ@UxmL@bX`WXU@U`ÇkUak@@°UblXk‚mLUKmL@VULóƒƒVk@@Vlbn@Ub@ċaUJUbƒIUlVLUVVbVKX„VlVXU@mb¯@™VmKUwLWx@šUb@VUb¯KmLUU@aWaUaULkK@Vm@@b¯L¯w@mƒa@ƒm@UUU@U¦lJUXƒVƒmkb@nm„XVWŽkb™IVxUV@VUbWLXVƒLW`Ux@nk@Vn@x@VkJ@œV`mXkŽ@V„xV@lVššI@VULš˜VU„IV`°bVXXx„V@VWVnL@xV„Ub"],encodeOffsets:[[121332,37840]]}},{type:"Feature",id:"3702",properties:{name:"青岛市",cp:[120.4651,36.3373],childNum:6},geometry:{type:"Polygon",coordinates:["@@„@nU˜JXLƒ„@blVU‚š„nIVl„IVJ@„UxWLk¤@V@nlbXbWJÅnUJVbVL@x@b„ŽlIœaÆVVVk²VJ@X„˜šnV¼šJkX@blxlV„@VLU`@nkbƒLkm@nWJō„ó¤™bƒn—ƃbUn@xlxU@l@„¦@¼UŽl¼ĊUnW„@šnĠmÈxšU„V˜I„VnUVV@LšV@šnVWbXb‚UVbnK@UnKVmVIllœUVLUJVXlJš@nnV@nmVUUm@—˜Vna@ƒK@mUaV_UaV@„aV@@a™anlKUk™KklwlKXwlm„a@UVI@akW@™l@„bnxl@°nJšxl@°£„WŎIUÑn»lašmô¹Ŏ¥VaUUkƒmkġWɱIUUŹ`›@kk@ĉƨřV¥_Ç@™Ĭƒ¤ÝL¯m¯£ƽóķwUW±ī¯kōaĉĕ™kğmó°ƒbW@UKkLUaƒVmz@V@ŽUxVn"],encodeOffsets:[[122389,36580]]}},{type:"Feature",id:"3717",properties:{name:"菏泽市",cp:[115.6201,35.2057],childNum:9},geometry:{type:"Polygon",coordinates:["@@@¥šIVUÈmÞ»@UlU@Un@VW@UVmkk@aVUUKVÝ@UVknK@UV@VVnIVƒ@wnƒmwmKXaWaXI@UV@Vy²blkVKkam™U@kb@Um@VmUkmƒKmkXKWwkU@Ulƒ@UnK@UVUUm‚KXwšUVL„w‚K„U„@@Wl@@wUkV¥—@@I@W@_V@VWUw@UUa@aƒaWa—@@_mKUw™l¯amzmV—@WK™nU@kƒWLķaUKbÝVmV@UWÇbÛ@ƒX™°UbW@XŽm„Vlk²UJUbmLÇxÅWUzl‚¯Ll„@VkK™XUbWJ@bU@¯@™ƒkbƒLmKka™„@l™_WšXºVbUz@J‚n²V@¤lX„Ž„nV°šLn`WbXLôVlKVUšxXn˜lXLlU@bVV@„XJWLUVnVV@„„@n‚l„°nn‚V„KÈbVXÆJU°VnXV„kV@@xVL„@šWlb"],encodeOffsets:[[118654,36726]]}},{type:"Feature",id:"3708",properties:{name:"济宁市",cp:[116.8286,35.3375],childNum:11},geometry:{type:"Polygon",coordinates:["@@nam_nKlVLXa„Il`š_@KVVXI@m@w‚ƒ„@@k@Kšnô@n`VbV@@L„L@KVVn@VX@‚VL„Jl„š@VUUƒU@Uam@Uk„wšKWaXamkJmIUVUÈblašUnV@kVKl@@lXL°kVJ@VÈnVJUX@V‚LXl@xVLnU‚@VK„V@a„IUaV@„bĊU„x„K‚kVJXUlV„ƒ„UVašI@WUI@KlUnw„mWk@WXIWƒ™U™L@Wna@Um@@UƒVk™UUlanWW@kkU@y„kWk—aWVUlÝbUU@kƒJUIU@@ƒ™JmaókƒLKǃUUkKWLk@WbkUUaƒbmKn¯°¥V@XwV@VanaVaU_@Wlk@WÈ@VUÈVVۂm„aklKȯlLVUX@lK@aX@@kV@VmV@VwnJV_UWUwƒX™am@kW@wVUkKVIUUVmU@UV@IVK@aUL@aƒV@Lm„UKmx@ŽômLkUWJ@šnXmlUxUL@Vkn›VUšU„@V™L™`Ub±LkV@kUKÇbÛ@ƒU™Wó_mJƒ@Wk@@Xƒ@ƒVLƒxUK™VWxLVnUV@VmL@Vk„@VlVXxWLnl‚Ln„VlUnn@@VlaV@nšlbULkl±aUzU@@VWJXbWbnLnxm„@xU„mJUUU@@VmLUl@VUÞVLUV@bllUn@VUXm@@VkV@VݼÇnUV™J@¦nnƒlnVlL@„Þb°KVV"],encodeOffsets:[[118834,36844]]}},{type:"Feature",id:"3714",properties:{name:"德州市",cp:[116.6858,37.2107],childNum:11},geometry:{type:"Polygon",coordinates:["@@„¤@VmbVXnVVbVJššX@Žll@z„lVInl@„@bVxUbĠ‚l@Èbla„IšxXVWb@L™@n‚ULWVXXšWWLnL@`@LUVVL@lVn„JšU@UUk‚a„™nš‚Vôô„b°¼V‚ސXš˜‚œIÜbČa˜bôW„XÞWÈzÆmnLVJ°ÈnlV²lbnW@™@UƒUV™šmnwmkkKWƒkla@mVIUKUa™aUwmn™JU@@amIk@@bVlkX@mmUklUUƒƒa@_UaUUƒV@wƒw™WkXmW@I@WUaÝU@UXaWUU@UUVW@UUUWUn¥nUVa@m@k@alU@wk™LWa@UUm@@wnmU™wla@anKn_@alK@ݙ_ƒ@@WUUUmlkaƒIƒyU@UwU_Wa¯yU_mWUwkImm@InWWUk@@UVWV—kW¯U@VƒL@b¯b@l±¦@šVV@lUbV„@škxVnUšl¼XV@b@lV@nIWxnbƒ‚™@UU™LƒxÅxm¯ƒaUƒ™wU@mUÅVÝKULm@bmKUXó@"],encodeOffsets:[[118542,37801]]}},{type:"Feature",id:"3716",properties:{name:"滨州市",cp:[117.8174,37.4963],childNum:7},geometry:{type:"Polygon",coordinates:["@@Vb@`„bV„kVlnV@nlWUk@al@nJ@bV@šInmVxšbVbVLUJ@nkb‚lX„lLnlmx™nUš„V@V@šmXn˜lbĸ@nnVx‚b@lnXV@UJ@nVxšxnxVbÆVn¯ƒĕ‚@@wÈçUÇlķVIœb‚@„Çmk@¥k@UkUK@aWakUóJW_UW@wkkWK@U@Kš@XUƒƒUkmUUalKXala@U@kkWlkÈl@kšV„mVIVmU_‚a„ƒƒwnwVW@wƒwUƒ@wU£ƒwkJWIyUI±bk‚VUJ@nmV™Ukl„Xmx@lnbW„kVƒUkLWŽƒxkKUUmUkb™J±—LÇxUKmkUmkkW™™a„mUaVkšJÆ_²KĠ@U„W@w„U‚¥nUWwK@aÝUkÅVaVK@akLWƒƒƒ¯I@bnbVx¯JW„ñšWbUL@šƒŽnV@VmbkUUV@IÇak@@bWak@WJUœJWL@bXV@„‚@„V„Jlb@zUlUŽUImšnbV‚mz@°UV@V™bV@@V@L@xLmKUnmJVX„J@VkLW@UVUL@b"],encodeOffsets:[[120083,38442]]}},{type:"Feature",id:"3715",properties:{name:"聊城市",cp:[115.9167,36.4032],childNum:8},geometry:{type:"Polygon",coordinates:["@@ô@VWnL‚an@VKÞLÆUnVV@šxV„„bn°Æw„wšKVVš@„maXwmJU@@k@aWUk»V™Umlw@™UƒVa@kUU@™²¥@k°a@a„K@U›ƒU@mmm@ów—ѱ¥¯@@w™Kmw—I›¥kU¯UmakJmIUaƒVkKUkm@VUUa™Uƒ@UaƒKUK¯@™w™UVŽUIUKVw™k™¥™wƒbVŽ@xn„@lWnXxlL@`„XlJX¦l°XxW¦@¦Ul™n@Ž™@@Um@@VXVmx@¯bllUnUJ@VULVn@b„xV‚VL@b„„VlnVVblV„ÈnVlIVJœLô„lJ@xl²„"],encodeOffsets:[[118542,37801]]}},{type:"Feature",id:"3705",properties:{name:"东营市",cp:[118.7073,37.5513],childNum:5},geometry:{type:"Polygon",coordinates:["@@ͬUǪlô@°Uœw°ōĠ¯š»Ģ炻XÇ@w™wƑa™ÇƒkwVƑ¯@řķUmm¯w@kƒa@mV@@anIU±m_ÛW@_mWVU„K@IkK@UW@@a@K@™L@Vk@±U@UV@lm@mUU@kLm„„xV¤@xV„„x@xUXmx„xƒ„bV`UnUJƒn™U@lÇkkllX@l@VkbWbkLVbnVVl„„WV™@@L@VXLll@xVXX`ôIlVXb@bVLVll@@¦nlƒÈ@›aUJkĸVÈÇè@x"],encodeOffsets:[[121005,39066]]}},{type:"Feature",id:"3701",properties:{name:"济南市",cp:[117.1582,36.8701],childNum:5},geometry:{type:"Polygon",coordinates:["@@²¦˜Òôxn@nn‚@V‚œ„°VlXU˜UX@Vl@XVmX@JnnlJVxnXV`°zXbV`VxV@„z„JlbkŽVnVV@X„@š`@ÞkL@bm`mL@bkbšxnVm@xn@VV‚@XbšKl@xkV@b@l@nUbmVm¦XVVV@VUXVVV@XVWb@VÞVVb@X@JnXlWšX„x@x„UVV@aVKVUX@lK@UƒIUWnIVmnL‚K@w@K@UU@ša@UVU@¯nyUman™VJVVk@ykaƒIƒU@@ƒWU@aXK‚IV›XIl@Xb@al@Èb@JVUlVna@UmU„@™VKXaò™Xƒ°IUwma@aU@UU@wVW@фw@a™I±`kbƒUkw™UmJ@UkmÇUUkmKknUVƒ@mJUkaWkƒa@KmKkUƒLmyXa¯_@WmImmbƒLmUkVUbUVƒJ™bƒUkkWJkUƒl™IUm™k™Lƒ›„lK@knaVmkI@mWaƒLUK™UU@@VmLUVLWK@UUUƒWUkkVmx@„Vl™¦"],encodeOffsets:[[119014,37041]]}},{type:"Feature",id:"3709",properties:{name:"泰安市",cp:[117.0264,36.0516],childNum:5},geometry:{type:"Polygon",coordinates:["@@n¼šŽW„nxšL@x°@š¥Uk@ƒnwlUVl„XVV@VXL‚KVUnK@UV@šVVL„KXb@nlJUnmb@lkLƒ‚„œšKšlVnšJ„klVXIll„Vša„IVUValUnV„K‚annnJ@X°`Wbnz„KlVnL‚Ž@L„bXl‚bVlnI„@VUU@UmVƒ@U@Uš¥@VmV@@_Ua@m°@@ƒ„kmUUm@UVmn@nX‚@@a„anJVUVL„mlIVJn@nkVLVa@KVmVLXVVLš@@U°bn@VaV@@K@aVkœbWaXUVymU@aUImWXƒ@™¥UaVwUaVwUUU@WWƒ@k_™VUKÇa@ƒƒnmxkV@LVJ@X™JUbƒVƒ„kUWVUIlƒLƒwĉVƒaU@VbƒJ@bƒUUL@mVUK@wWkK@UVWUIÇm@UUI¯lWK@kk@UL@lmU™VkbÇaUVVnJlIn‚WbXb™LƒxVln@VbV@V„UV™@kƒƒIUK@UWm@UU@LƒK@KU@Uam_ó@™m@L@lƒ@„@x@nWJUU@L™`k_ƒJWbUKkmLn`mb"],encodeOffsets:[[118834,36844]]}},{type:"Feature",id:"3710",properties:{name:"威海市",cp:[121.9482,37.1393],childNum:4},geometry:{type:"Polygon",coordinates:["@@VbUnVVUxĊ¼š¼ô@Þф¯‚WǬLŎUÆW„¹Uǃō¯ÑƒÝkţ™™ţóġ™óL™ł̥U™wm¥kÝmkkKóbÝ@U¦@‚mb¯LkšmJ@x„Lmn@lk@ƒa@Xƒ@ƒlXbmJUz™V@bVJ@n@x„blJXzšxV@Va„KVUXLlmVV@In@Vx„UlW°@nLVK@zXVVal@@V„w„bVKšL@bnx@„WbUJ@VnXVlVxl@nnnV@„lV@L„‚"],encodeOffsets:[[124842,38312]]}},{type:"Feature",id:"3711",properties:{name:"日照市",cp:[119.2786,35.5023],childNum:3},geometry:{type:"Polygon",coordinates:["@@UaVUUKVk„JVaVIČb@Vam@ka@Ul@„Uô„VK@UnKVLnKlkWVa@¯l@VbÈlV_V@XWW_@anKVwUmVw@@Uny„UVblKVLX@„aô¯ó¥mÛĊÿÈ¥š™Þ¹lUīƒ¯Kĉ¼ʟbÇV™U™ŽUŽ™XmakJUnmV@bUnmJ@XnJVLn¤UzmJUn@`¯ImŽU@™nƒKVkkm™KWb—b@xƒk™@mL@KƒUUVUKkbWaƒXkK@bkJWbnbl@UL@l„Lš@lxx@b‚nUVlV@¦²°@bVx@Jƒ@¯XUJ@bUnlxVŽ„X@‚VV@b„L@nô`@bkbVVÞL˜xnU"],encodeOffsets:[[121883,36895]]}},{type:"Feature",id:"3703",properties:{name:"淄博市",cp:[118.0371,36.6064],childNum:4},geometry:{type:"Polygon",coordinates:["@@nƒlKV@nVn@@kVU‚@²VVaUƒ@wmKXU@UƒUWwUW¯aU_ƒJUV™—VK@U™JU™@kUƒw@UlnWU_@›lI@U@wUml@@mVwX_„KWUXKVa@UVUUwšJlaXWUnƒ@mla„n„UVWkIV¥V@VVVI@a@akakLWKna@aVwk@WUƒbUlk@™k@U¯UWWU@mUUVUXkVmVVV@nkVƒLƒVÅwƒ¯k@WVXb›aUl@bV@@b@xkVVXVxkJ@nk@@ŽVLUlVb‚VXUVVUzV‚™LVbUbV„VWVkLmškJ@n±@UxU„VVkV@bƒx@ÒUX@xVVV@°J„„X„lK@bULUblÆÞV@b‚LXxmV¦ƒV@xƒXVŽğ@±LÅ`™IUlVbƒnšbXšllVnnlVLÈw˜K²ŽšIlanVVVlL„wXlK„VlUXƒma@knwƒWlkšVnU@mVIUl²aVJ‚zXJlI"],encodeOffsets:[[121129,37891]]}},{type:"Feature",id:"3704",properties:{name:"枣庄市",cp:[117.323,34.8926],childNum:2},geometry:{type:"Polygon",coordinates:["@@‚yUU„U„kl@@aVmšLXw°»°w@y„L@UUaWXKƒƒVknwVKlmš_UmmUXK@ašw@k@mUWmUL@ƒ@™@£@KƒbÝV@akw™aULmƒƒbUK™LUU@lm@—°mL@nUJVxVXU`mIUxU@UnU@@lW@@bkLW@UVkKÇ°kLlŽƒbnUÜÇUUVÇ@@Xkl@XV`UbmbUbU@WxU@¯¦m°nL„aVblVXal@XKlLVVȄ‚L„KôlnbšI@„V@VJ„I@lVVÞaVkXU"],encodeOffsets:[[120241,36119]]}},{type:"Feature",id:"3712",properties:{name:"莱芜市",cp:[117.6526,36.2714],childNum:1},geometry:{type:"Polygon",coordinates:["@@lmnLVlÈVln@VnIšVlx„Vla²_šJlUUUVƒVw²@@mlIn™lKXU‚UUƒVaUašKUVyUUWVUUaVkUK@l@@mlIUwUWlU@w@aU@@LU@Ubm@¯a@V™@UKWUUKUn@LUbUKmlm@UIkJƒnUKUVmIƒb@b@mWm@Un@VVnnVƒl@„¯@@nVb@`U@Un@Ž™¦@V@VU„VnV@"],encodeOffsets:[[120173,37334]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/shan_xi_1_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6108",properties:{name:"榆林市",cp:[109.8743,38.205],childNum:12},geometry:{type:"Polygon",coordinates:["@@™ýVƒnIW»ƒW@»kUÇL—݃U¯¥ÇIUWWїUWwX¯mƒ@»n@ÜÈķô™@a±kȱƒw„ÑmwçċmU»ÆkkVyIm™ĉÿ@ƒÝ¹ƒWnwÇVš™Åaƒzmmĉ¦ó™kVmx™xU¼VškVm_UlVlk„°IV‚kmJa›¦k™™LmmV@XmKnšlUô›VXbƒbƒ@UaÇLğܙ™Åwƒ£mKnmċwÅ@UkƒbmaVƒƒƒn@m¯aU™Jm_k˜@kWXyl@@kÅamw™LU™Þ™ƒ™mWÅzUKƒš™Uk±@™b@nnK‚bX¤mzVšŽVxÇn„‚¯„@ÒknWƒƒVUbkķÈÑWkk@Va™™U@„mUkbƒÝÅ@Ý¥ÇbkĬ™XV`kLǍVmalUUa™nV±nwmkƒJ@Inƒ°KVw¯UnÅ@¥™ƒ™U±bUU˜±œmWbÛKWnUm`UƒVK@bmnœm‚Èż@V„L@xƒxmš„Ť°nŽ@VmK™²VlšlKk„ô@„êÜV@VXLlmš¦UššV°Ș¯²ÿ@¥š@ƁĊ˜²IšmĶnnb°b„KVƒĸLl„Þ@UȮš™Ü°IVƒÞÝސlŽœx@ŽķĀWŽ„Ux„èƐ@š°ŽXnšlĊĖ°m„nƒšV„²V°ÒƦ„aބ„˜@zll@bÞĀšlš¼nKĊ¼óȂb²±šIǪÒ¯ĖV@„lxnVlk„JlaXwŌĉ„„@VnŽššlÆĕ„UÆLœèŌŤôxȚlUœ@šxlaUċĕXm„IWmnkšVVƒ„VW_@aÈWUUmk@ƒ¯çVm»™±W¯n¥V™mkXw±ÇVwƒ"],encodeOffsets:[[113592,39645]]}},{type:"Feature",id:"6106",properties:{name:"延安市",cp:[109.1052,36.4252],childNum:13},geometry:{type:"Polygon",coordinates:["@@@kkÇmIšmUwVkUƒƒU²WmšVkm@m`mIĢĕUƒVa@™mXƒƒÿVVkyUýšĕ@l_UmnƒW„KVkţ™™¥™aƒwğ@™@aôƒ„ƒWa„kUmƒa¯¯™a±£kx™mmxUwÝ@xmU™b¯K™wó„Ý@kmm¹Ub@lklVbmnnVUV@x›UknƧJUX@ŽƒLÇWkw™LķƧÅwWJk„ƒLkþĉxWz™JUnǚkš@Ɛk¼ÜÔÈKšè@°lșÆk¦l„n@l¼@l¯L™°UU™VÇ°ƒ¹—`m¼mXk‚™bUaƒV@U¯x@¦™Ç™„UUmlmUVm„nnmlkw™@@šƒ¦Å‚ÇLmx¯Iklš„@¦mÆ°VUx¯Lm„@J„InlmxU²šmVbkV‚bUnȎlKU_šWlīÈaÞ¦Æ@„ÞlanV@ƒšVšUbl@XlÇÒĸlŽVa„UX„lm@Ñ°ƒƒÈmUw‚U™nyW£amL@mša²@lšV„™VLÆynX„šÝšVššKnxÆb@lk@WzXŽ@ll—n`šIV‚°b@n„m„„‚Unb„aVlÆ@ČxmnnL„¤ÆxššĠÛÈKVb„@„aWaœU‚ókVm™nL@W‚UnnšKlšœ¥‚bnIlU¯JlƒUkVkn`lUU™V»šwnwlUôšĊ¥nn„yÆb"],encodeOffsets:[[113074,37862]]}},{type:"Feature",id:"6107",properties:{name:"汉中市",cp:[106.886,33.0139],childNum:11},geometry:{type:"Polygon",coordinates:["@@lKnb@n„lWb°bkxĸwVb@ł„nlŽ„ƒĊ¥šL@XŽl™ÈƒVblÈK‚b„akVwôml²`‚nœ@‚nVKœl˜k²xŎƒ°¦VU„JĊw@çnWçރVkUóÛ@¥kwš™šUmƒX¯WšÑkƒ@UymIUwlUn¥‚mUk²a°¯V»@™ÝVș„ÝċÅÅVl»@l@a°±@_kammÅb™a@ƒƒm@ż™KknõĠ—@mšƒ„¯LÅw›‚—LVxmb@¼kV™@mw¯wVakKW»X±¼¯Vkxƒb„¼WŽ@nx@x±bóakbƒ@ÝmU™@ķÓÛL™kƒVUm™k¯¤ÝLUlÝ@Ýz™š„x@x™°™™™bƒmƒX¯aUJW¯—k@bÇWƒwÛwWxƒ@XWlb@Žƒ„VŽÈUlwšLnl°VlUô¦œU°¤VšUxVXUxlbkVVlƒI„°„ÅVlU°m@k„ÇU¯xUlƒLUlVL@b™°ĠInĠ°ÈnK‚„@xÞa²n‚aUyšXUKVkšWô¼Èa‚z°JXUVÇV_„JVƒšz@Žnb"],encodeOffsets:[[109137,34392]]}},{type:"Feature",id:"6109",properties:{name:"安康市",cp:[109.1162,32.7722],childNum:10},geometry:{type:"Polygon",coordinates:["@@„bĊaƨèšwôô„¼šb°ašXVƒÞVUÞ@‚aXƒm¥kImx¯¯ƒV@anU@UÇéğL@ƒ¯¥V£mƒ@ÝÈb„K‚™„X°wČÿ˜ƒ„b@xÈblxȯĊ„„mÆUVƒ„nÈ@ƨÜLĢ¥ƒŹnƒ°Vnn˜K„aô_ȃšwU‚aXmnW‚¯kl›LXƒÇ™ō¦ÝaÅVmbğUn¥±wÅéVƒan¥ƒ„U„»°am¥„£ƒÝ@ƒ„wVw™¥nU„уUmmVwmķIÅaóVWxkblb@ból@œğÒĉ¤ċXƒ˜¯X™xk„Ç@óÆÅx@š™xķ_kmݎǣkblb@`¯²@bk‚‚@k¼ÆUČƃÞǚÞU@šU¼¯°±bVlnm¦kVVxnJVz@‚l„™ÒXW°n„™V™šlx@¦ôÜVUl݄Xèm@è"],encodeOffsets:[[110644,34521]]}},{type:"Feature",id:"6110",properties:{name:"商洛市",cp:[109.8083,33.761],childNum:7},geometry:{type:"Polygon",coordinates:["@@²nl‚ôbš„°aVwnKÞIš`°wšXôw°VĊ°@ŽÅš„ÞÆV„zÞK@xšŽ@a‚LŚ@b@ŽnLlƒ@šln„mnLVw„a„bVƒ‚VnbU¼„Vƒ°„bl„šbÈ@ĶŦb˜@nÇ@amIyUI@ĠVmôƒU™ƒVwkwlanJ„¯lwó¥@an°Jš_„‚@š™nóƒó@£l¥UwmašÑ@ƒUm±V_ƒJ—£›J—UW¥¯@ƒ_k¯¼mUƒVUè¯b@wmL™»ğVmağI¯¤ċIUW™XƒKĵ¦ķaƒJUb™IƒlUóVmk@WÅÅÇ@ƒmU„ÅVƒnĉƒÇ°kwÇa@wƒa—„ċĀ¯xƒWšƒLÇa@Þn„U¤°¦@„ĠKÈê@VmV@b„U°°nwlJn¦W„bÝ@VŽ"],encodeOffsets:[[111454,34628]]}},{type:"Feature",id:"6103",properties:{name:"宝鸡市",cp:[107.1826,34.3433],childNum:10},geometry:{type:"Polygon",coordinates:["@@@ƒ„£@›°Išb@¯°ynŹƒaUƒlƒU£„Umšĵĉ@@ylUÞ@@£kWU¯WaU£¯ÇV¥ƒ@kb¯wƒn™¥ÇkUÇnUƒ@¯±›kULm›@m±_kŽónUxlŽƒbaÇLkŽUaDŽkšW@™Kĉ¦ƒ„kƒm@ŁUaķxlw¯aXaƒk@mmakL@šmšÛŽ@¼m„@l„XV`ƒn™KUš°°@²š¤UÈ@VxmôƒxKl„VV²aVw„Xla„Vlx@UVnŽÇnk°ƒVVL™lkI™šƒJÇk¯V@šknƘn@lznmlVkzVŽ„VVxš@Ux„z@x±¼VxxU„l‚kb˜@„¼Čk˜VXlĠkôV²w‚LUKlwœJ@a‚IV¥Þƒn¯Ün„‚„@nk˜l²kÆ@š°„aVbnI@™š‚Ťn"],encodeOffsets:[[110408,35815]]}},{type:"Feature",id:"6105",properties:{name:"渭南市",cp:[109.7864,35.0299],childNum:11},geometry:{type:"Polygon",coordinates:["@@@ÈôL„xUŽ°„Þ@mŽÈnl¤nUôL‚wX`@ÞÝL™ŽUšmLô„„ŽôbVbnºlnÞ@ôƒšx°LšanV‚wÞ@Vxnwšnlw²¤šb°°„bVnƒlXbƒ„ó„@bš‚Ġ@„xšbš¦ŤšV™Xġ„£W¥ƽɽƒó@ýóƝÝ»„£X™mƅšĊkUƒ„@™™šó„kťaĵŽÇ@™akƒƒa„¯ƒUV»maUU„ƒaƒbUxmKƒnkm@™k„mK@ƒxó@¯n¯KǦ@ôÅèlxkx°nƒƾ¯KU¯WķL@VÝIUb™yWbX¼Ç°"],encodeOffsets:[[111589,35657]]}},{type:"Feature",id:"6104",properties:{name:"咸阳市",cp:[108.4131,34.8706],childNum:14},geometry:{type:"Polygon",coordinates:["@@šIXyĊwlý„KlƒXIVaķƒ™»a›£„¯aVU@a™‚wÈō‚ašL²»‚VœUln°WȯW»XašzVaÞJ@Uƒ»@¯Ýbğwly@£kÑţ±Wу@ka™IUƒƒnƒ@¯ƒómţU™b™U¯lÇIÝb@¤Ý@kV@zĊ@™ĶnƒVV¤k„V„„bmź¯z@°™a¯J@œƒ¤@„„bUx™bƒ„@`™xUÔ±ºVXœW‚„UnUJ‚LĢ¯ÈKlblmÈXŎ°šU„°LšŽlkÞKš@Èxl_°ĶUÒkblš"],encodeOffsets:[[111229,36394]]}},{type:"Feature",id:"6101",properties:{name:"西安市",cp:[109.1162,34.2004],childNum:5},geometry:{type:"Polygon",coordinates:["@@°²@‚„mVVÈÈlš¦„m°xla„@U¦°ÈV¤XbV°lXÞaÈJ°kšVšaŤVôn°„„@„mV„šJlb„@XÒŤ²lÒ@¤kzĠxÞa@°„¼ĸK°XV‚°L„ƽ¯mlwkwÆç@óÈ¥°L°mô@„w@aƙK@b™@wÝLƒyÅUƒÝƙ@ĉ¯¯Uóx™W¯x™_ÝJmLUx¯b™ƒóak±mÝUU„™W¯b™aƒ»óó™xƧçĉbƒaĉxƒIUV¯¥ō„±w—l"],encodeOffsets:[[110206,34532]]}},{type:"Feature",id:"6102",properties:{name:"铜川市",cp:[109.0393,35.1947],childNum:2},geometry:{type:"Polygon",coordinates:["@@ÆxĸƨšKlxÈX„K@VWƨIlmœV@wVUmUnmUalk@kVaUaóaƒóƒnKV™šÞK@ÝW_xóKmVk£ÇmnÝ@¯ƒVƒwóK@ǯXkm›VU±¼™KbÇŎx‚š@bUV°bƒœ¤‚bš¼ĸ„Ub"],encodeOffsets:[[111477,36192]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/shan_xi_2_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"1409",properties:{name:"忻州市",cp:[112.4561,38.8971],childNum:14},geometry:{type:"Polygon",coordinates:["@@Vx@lnbn¦WlnnUšmš°š²VšV‚VVVnUn„ºlz@l„„@Jƒ@kXWVXl@Lƒa@„ƒKUL„ŽlbnKlLnK‚LnKÆXn°šbVV@bUVl°Un@LnaVJUbW@UX²l‚@ČwlVVIšWnkÆa°„„anV‚Kn°™UW¯@™aVUVk@Un@„aV@ValwUanmWU„k@WVUUanaVwnLVl°@nk@mVU@UVK@w„LVKVU@ƒ„K@UUKVUV@@bnL„a‚V„aôšlIXmlKX_°KVV@bVV„@šzV`kblI„V„Ul‚šL@bnV@V„Ċll„„VlIXW@k„a‚U²blKšVnIlJ„albXXlWVn°JnšnL@l@XlJlaX@„X˜W²@l_VmnKšU„blU@mnkVK„¯@U@ƒma@kX¥VƒmakkƒLƒa@aƒ@WIUUVXWWnk@a°a@kkm@kUUmJm@WUUUIk`m@V—kaWWkX™KmƒXk¯ƒ@WKƒLkak@±bƒw@ƒaƒa@akaƒ@ma¯@ƒL—KÇÅkKWbkmġ™±ÅUƒLUK™VVkƒm¯LUVVbƒ„UwUW¯bm„ƒULƒxWJ—@ƒklmkUm@@KnwVkVK@akwƒ@@a¯bƒKkn›VUI™b¯mmbk@UbmKUL@xUUƒ@klmLUŽlVXI‚VVVUVUœU`mLXVWbXnW`Ų°xmŽxU@mĉƒƒwU@mbU@UƒmbkVW¦kJ™@ƒX@`¯Im@UlUVVnb@bWJXnmbƒJUU™UUaƒ@UamIkaƒxƒ@@x@b"],encodeOffsets:[[113614,39657]]}},{type:"Feature",id:"1411",properties:{name:"吕梁市",cp:[111.3574,37.7325],childNum:13},geometry:{type:"Polygon",coordinates:["@@@a@w„@„wlbnJVb„@VbšVVV„InaWmXI@a‚aUmVUVkn@°J@_„Wš@lIX¥lUnaV„V@naV@„xĊ„n‚V@‚wn¯wƱX_WmXaWUnKV_V›VUUUUWJkUVnKlk¯™@@kmKUaŁ±KkU@WmI@WUIlUUmVwXƒ‚w@ƒUlUVwœV‚@„Lnb‚W@anU@UšaVkô@l»n@na˜JnUÈLVaƃUUVm„VKVƒ²L@mU_lK@UVWkU‚a@a@U¯aUaƒÑóÑUb™„ƒKk@@aƒk¯mVaUwVƒÑkWUmK@UUKmXUWÝwUa™LUU@aWJUUU@Ua݄U@WL@VKVaVI@WnU@alIVKƒƒ@kIƒmIkJ@™m@ƒ™@@_™K@xƒ@kaW@U„@Vmn@ŽUK@mIƒJUXV¤XXWlkKƒkkK@XmJVakImJU@ó™¯LWKUV@nUVƒLkxmKkLma@kXKmmƒLƒab™LmK@V@mXVÆUxƒX@`nL„aV@@VmLUVnLlLš˜„b@„šŽ°²nx@b‚VUxlb@V¯bUV@zV‚XVĊXVx@lVn@VnnmŽUš@LlJXVƒz¯VWVXbšV@bmn™VUVk„Çþń@XVxmbUlV„Uln„W„@„Xl‚@VLXÒ@bÞJ°¦„L˜ò„@nU‚b@°„X@ŽXbmVU„V„nb@x‚x"],encodeOffsets:[[113614,39657]]}},{type:"Feature",id:"1410",properties:{name:"临汾市",cp:[111.4783,36.1615],childNum:17},geometry:{type:"Polygon",coordinates:["@@nW‚@@UnLšK‚a„b„KnnWL@lnblKnLlw„KVU@mVUXL°KôšV@nIlJUbnI@WlL„llLXkWWU£VW„InJ‚@VL@nm@UVƒX@lb„@@wšL@`‚@„šn@V@lw„@n„VmVX„WmwnUlƒœa@_lK„wVlUn°xVKVXXWlUšVVI@K@K„n°KœwlVlU@kna@V_„Wn‚m„UVm@kXml_@m„LlKXw°m@_ôJVUV@X™l@UaV@Va°I„lk»VwUkVmwUmmVn@V¯@KƒU—wmK@U¯wUVÝ@mJƒU—nWK™@@UnKVa„_lykUmKÛnm@™x@ƒUUlwVk™ƒXW@ƒa@Uƒ@@K@ƒkIV™nammVakUlƒ@wX@@kƒ™¯@ƒVVbml@„„°UbULmlVbnbÅK±VƒKVXUJWa@ULWaUU@@U@aWK@UkxUKƒLUUUJ±UkL@V±kk@kam@UV@l@LWl@n@VVUx„LlUUx@VUV™U@aƒIUl™L@°mLU‚ƒbkUUaWUUaUU@aWK—LWJ@bUL@VUVVbU@m@a@kmKmnĉlUK™XƒWUblb—xmIkƒƒU@xWb@lkšVx™LXŽmzVV@bklVVUzm˜@bk„@Vx@xlŽU„@lUbVnl@„Wxnl@n@ŽUbV„mL‚mƒb@`X@lUX@@xlnkLWaUJnnWV™Vn@l„@bULVV@l™V@XnJVX"],encodeOffsets:[[113063,37784]]}},{type:"Feature",id:"1407",properties:{name:"晋中市",cp:[112.7747,37.37],childNum:11},geometry:{type:"Polygon",coordinates:["@@@šlInJ„lJ„@‚„ULkJ@bmV@XUJUb‚L@UXKV@ރVbV@VVXI@bVVšKVbÞxVXnWVL@VnLV‚lX„ÒUŽVxUb°n„l@bl@„LšƒVaô҄ÒVb°b@VnLnnV@lmn@lb„U„V@„‚JœUVV‚Xkl@lUzmJ@xšXkl‚bUn„JVšUb„nU‚lb„V@nlLX@lakšV`Ub°š@XVJnU‚L²KlxnI@KV@lbUbVV„KnVl@„zlm@Uš@nŽšI@WUaVl@@mVU„@XkW@ƒnkVKVƒ„_Vw„y@knwVa‚@XalU„@šVnml@„X@V„L‚KVaÞbnnlJšI„mVKn„VVVInVlU„@„m@™mXK@UmyUI@mWUUakamw@wUwmLkakwVƒmK™w@wUam£y@am_ƒW@™UU@knmm„amU@WUa@knw@ƒUUUUV@nƒJm@mVUkKVUUUkKmwƒKULƒKUImV@lUn™nŽm@mbUK@°™bUnmbUmkkƒWUb@am@UXkK@a±@™V™@ĉř„V‚UXVxUVkLWl¯@@bULUlm@@nm`—XƒlWakIkm›VUbUL@Vm@kIƒ@@Kšm@—VaX‚I@W@aU@kUƒVU_™KƒbƒJkkǎ™b@nkKmL™wÅW@kVUUƒVU@WUIƒJmIXmma@_kyVaUUlkUm@ƒkU›x¯Lƒm@L@LUJ™UkVWXUWUL¯wVmUkƒxkL@`›bk„mVnxƒXUWUnmƒƒ@kxU@"],encodeOffsets:[[114087,37682]]}},{type:"Feature",id:"1408",properties:{name:"运城市",cp:[111.1487,35.2002],childNum:13},geometry:{type:"Polygon",coordinates:["@@„Vl„nJ˜wkaVa„XšWVLĊknmnL‚l@@bn‚V@UaVU@UVK@aXI˜KXL@bVVVbXVVblV„aVnK@¯šKVk„J@bšVVU@UVwkVƒKVwUUm@@Xk@K@kVUn@lbl@²l@UlK²VVIVV„KVLlw@VXL@b@VV@VŽXbVK‚@XbVIUW„L‚U²ÆLmaUankVKVaƒ¯@ƒnkUa„U°@„š‚n@@kWa„UVaXUW@IXKVw@U™ƒ„™WU@W@@UUƒU@mn@ƒ`m@UUULkUmJ™IUƒ@@UƒK@U@›anƒ™ak_@wmKUwmakV™kmK™V™k¯b™wƒ`kwUIÇx¯»ÇaŃmn@@™mƒmUkV@wkKW@kxmL™UkĉLÝk™xÝw¯lóVU„mV@ĀVVX¦W¤kz@`Vx°„²ĸ‚š@„Ul@x„êĸNJ°¤V„VlXLWnXxmV@nUl@„"],encodeOffsets:[[113232,36597]]}},{type:"Feature",id:"1402",properties:{name:"大同市",cp:[113.7854,39.8035],childNum:8},geometry:{type:"Polygon",coordinates:["@@²£šyl@Ȑ˜Ė@bĸŽĢbĸ„˜X„a‚KŤnn@ŎôllÈx„nVnÞDŽV@b‚nXllL°KšbVb@J@b—„‚„@ŽU„„xlKXLlKlXk„@Ulk„JlkUƒVKXUƒÇVIVm@_nǚLšašl‚w„VnU@UUwma@aƒaÝaLmUk@@Wƒ@U@@X™wVWÝUUUk@@VmLƒKV»nwUw™aUL@`mzƒJUIVƒUaUw™KUaVIlJôanÑlLVUn@ša„@VV„@@UUwVK°Vn_lJÆLœéW@UUUÅ@»lm@aÞIVwXW˜UUkkm@U@aƒU@mwU£VWU_kWmƒXwW_°yUkkK@UÇK@kkUVymóK—U@KWIƒbUak@mJ@bkbmLkŽ™UmƒkVU„W¦@lnb@„@Vƒ°ULml@nkVƒa™VmLUnk`±@—XƒWW@kbǦXŽ¯„WxI@xmbmxXlWV„„@bŎUz@J‚b@bÞb™ŽU@Wbk@ƒxk@WX¯VۙƒWÝbÝUkVUU@alI@a@akLWa™m@U¯UUmÇL@K@aU@¯VUkƒKmX@`@œkJ@nV‚Ub@lbVÆXVW„ULU`VbkLUV@XWl@bXJ˜@VbV@Vl"],encodeOffsets:[[115335,41209]]}},{type:"Feature",id:"1404",properties:{name:"长治市",cp:[112.8625,36.4746],childNum:12},geometry:{type:"Polygon",coordinates:["@@Uk™Lky@I‚JVa@mÞaWšy@_W@_WƒXVlUVwš@nw°K@m„UƒVaƒmVkU@mmmnLVUmKXa™U@IlKVUnK@UmWkX@WV_Vƒ@akU@a„KWIXyƒIUVmUn™Ua@WaXUVKVmkUWVkUƒLU@@VƒbƒKbƒIUmƒ@mbVL—x›WUUkn±V¯wƒbÅJUbmLkbmKÅKƒbVnUbƒV™KUb™KUbmLKmƒb™aƒKkUm@UŽnn‚VnxUVlUxl¼ƒk¯JUbU@Vbk@WšU@UVóI@`¯nWxkLƒK@nk`Wn@lUnƒVnm‚ƒXU`@mb@lkV@„VnklVVUblz@`nbWnnJ„IVJ@XUVV„UV@lÆXšxnKlL@mšaȍll„I„ašLV`„UlVV@@b@XJWUb@˜™n@L„@lJn@@UVKVaœUlnlJXb„k˜Wn_@mn@VkVK@a°@XklKVUUwVWUšƒĊƚ@šU²@@blLVWn@@bVa„XllVnnaVmša@¯VLnan@‚šmVm@knUVJ"],encodeOffsets:[[116269,37637]]}},{type:"Feature",id:"1406",properties:{name:"朔州市",cp:[113.0713,39.6991],childNum:5},geometry:{type:"Polygon",coordinates:["@@XXWVXVWnnlnn@èƼ@„„xlš„ŽV„nblšššVŽÈUVl‚š@„blnœL܃ĊmUkU@Ua‚—@WI@aXk@WVUlKUaV_VKXƒWUUÅka@VaU@mlI@›@_nW„LVl°UV@@b@LÈKVn°V@VšnXblK@b@bkJ@bVVlUÞVÞa„Xܚ°UXWl@„wl@XaV@šÝa@aa@IVyƍ@aƒƒXUWknwna@w‚JXw°ƒWÈ¥kI@W@kmKm™¯IUmkXWWkaƒbkImJ™UkL±aVƒb@lWXkJƒUkƒĉkƒ@UmU@a™KkƒVƒUkJlaU_™yƒ@UU@aUU¯LW`kLWnkJó™ƒbUƒbmK@aU@UVVL@VƒL@„UVULƒK@xUL@VUV@nml¯@UkmKUxmbVbUV@XƒlXVmnVbkxUbU@ƒbm@@VUlUVšb°@VX¯šm‚"],encodeOffsets:[[114615,40562]]}},{type:"Feature",id:"1405",properties:{name:"晋城市",cp:[112.7856,35.6342],childNum:6},geometry:{type:"Polygon",coordinates:["@@lV„Lšb„an‚LnKVašLVašL„UVaUm„aÆLnLlanKVaÆI„a°x²UlmVVœX˜wUKna„@Vn„J‚a„L„a@UV@@alUkKVKnkmmVwUk„w@ƒ™@kxWUXƒW@@mƒk@aUa@a¯aƒLkKmwkUm@kL@K@aWIXmƒVƒXƒWkUVakL@UVKƒw@aUK@UUKmLU@¯n™KUwVƒUIWJUWmka™@UXƒJƒk@UkmW@kLWKVƒx@bmI@VUaVU@a¯@UUmVKmX@±`kÝKVxUL±akL@V™bƒLkKmVƒ@XWVUbƒVXb@lm@@lW@@xk„lVUbnnmbUšlJ@„@L„@@V„b@‚WXš„UlkxVV@„šwn@ÜmnLlVkzƒ`UbmL@Vš@XL˜m„VnIÞ@VU°x@VnL˜x„V@LU°"],encodeOffsets:[[115223,36895]]}},{type:"Feature",id:"1401",properties:{name:"太原市",cp:[112.3352,37.9413],childNum:5},geometry:{type:"Polygon",coordinates:["@@„@VV@wVKnLVal@na°nšaVJœUlm„L°a@b„@lx@bULUlmx@Ln@lVkn„l˜@XI„w‚K„Vnƒ°aVXVx„ƒUaVU°K„nUlšUVL„KÆVš²Ģ‚lnXalLÈƘL„KUaVkUanmWU™a@WwkUWU¯y¯Ñ@anIl@@aVU„m„I„ymUƒLUUVakaU@@LmJkw±LKmVUI@W¯™VaU_l™kbW@kK@mƒUkaVƒmVaU™ƒIVmalk™W@wnIVy@klkWUU›VI@ƒƒUƒVkam@knU@mmmK@bblVUX@VkLV`@n±KU„ULƒ‚UnVVńUbÇKmV—Imbm@k¼ó@Ul™b@VmV@bXmaƒK@›UUxkV‚V@„xW„UxVnkVVJ@XnJ@XlV²LƂVbnL@lš@°"],encodeOffsets:[[114503,39134]]}},{type:"Feature",id:"1403",properties:{name:"阳泉市",cp:[113.4778,38.0951],childNum:3},geometry:{type:"Polygon",coordinates:["@@°@nb„@lb@b„b„b‚@„x²al@lb„KXU@m‚kUWkkmUUƒVwV@XUW@™naVklKXblKnL‚ƒnLVanImaXKlL„ašV@U@KUKW„alƒXK@£WKXUV@VU„ƒUUVW„_V™@W@@K„@šƒUƒƒIWmXUmƒULƒn™JkImmÝaUbLƒK@UƒWk@mn™Uƒ@kVWb@Ubmx@lƒzUxƒ`U„ULml@„XWlƒ@UV@nk@U‚Vb@X™Jm™@@Vknƒyk@ƒzƒJƒnUV@bk@mJ@b°Ò°zXVlVXx‚@šbXVmnVbUlVb"],encodeOffsets:[[115864,39336]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/si_chuan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5133",properties:{name:"甘孜藏族自治州",cp:[99.9207,31.0803],childNum:18},geometry:{type:"Polygon",coordinates:["@@ƒaXamƒ¯wm@±°wUwV@UaVw²Kš™„U@UƒU„¥‚a„ƒ@£Þ™ôx‚Knkm™X¥™IUƒÝUwlk°V„@ƒÈ™‚KUwlkUyV¹„mšx²Xll„ÑW»š„l„w°UŎ„nƒ„„˜Jœƒl¯°V@wôIVÇn™nUllšLšVǚLô¼XW£@±„@¥k_ÇJƒkUéƒkšƒƒwXa@ƒšLlw²™Vx„b‚mš¼ÈxlLȃ„VWÞn¯mǙÑUÝlÛkwlĉmƒULmwUJ™ç@wkm@ÑlUX™ƒÑôġƒVa™ƒUф¯@wķÓkbV„mnU@@y¯IķKƒV@¹šaƒé@k„mÞU°¥@a¯@anKlblU„¥@óğç@Çw@wkla„çݱk¯±@ğÝUÛmݯwƒ@kb±¯akXWÜkXUÆÇUš¤X_Ɛw„V@¤ƒXU‚ƒbUƒŽƒIUlÇUkŽġ@™aXČmlUlèUV@„mVk¦Vxš@¦±š¯ƒƒ¯¯anlWš¯nƒƒÅw@w°KVak£m@klƒKknÇU™»óKšīlaUaV£@™™¯@ƙU™VƒÛÝÇXƒÇl—ÓlŹ„»WUğJ¯£mx™Lĵô›ºX„VlUll²bl„„lŽƒxónn°ÝšU¼mJUš¯nƒƒƒV@êĉ°Uĸ™w™@mƒ@¯kmXamѯaUwÝKU¥„mÅn¥Wmn™ƒ¹n±ƑƆÇôXê±NJnšƒ‚UôlĖkȂVÒ¯¼VnƒȮ¯ĀnƆ˜Ģ@Žk°V°¯ĢVlkšVxm¼X²™Ŏ@ŽVxknWÜ°U‚¯n™Æݜ@`„ôݲÒƒ‚Çzn‚mX@x„è°K°Å„UČĬóĖ݄ƒ˜ó¼ÅêƒÒƒbmšk@V„Ž˜„@ҁl@nĉܛê—x@Ėml՛J¯¦óxȭ°ÝmŽ¯Lĵè›Ā@Ɓ„l°żƒ‚šX@xmŽkV@z@‚„°blŽnÞ°J@bn@ƼUVƒUóŽóLƒ°X°ÝLƒxUn„°ƒĬƒn@lnL@ŽÆ@šn„KÆxnUnV˜InĬmÆnxŎ¼ĊIĢóÞ@ĊƒƨbUƒ‚mV¥lkƒ‚wnL„mšÅÆ¥Xƒ˜wU@w‚wUÞ™@alUUŚU™Vkkm°aU—°Ó°w°U„ƒ„b°aš²K˜¯œĕ˜@ÈbޏĊaš»„XVm°In„‚Ĭk¼Vb„ašJšôš£VĊan™‚k„ů™™nƒÜU@anKnĮ‚bÈmƎš»nI‚霣Ġ™"],encodeOffsets:[[103073,33295]]}},{type:"Feature",id:"5132",properties:{name:"阿坝藏族羌族自治州",cp:[102.4805,32.4536],childNum:13},geometry:{type:"Polygon",coordinates:["@@l@@þ²I@lƒ„VL°wnJ°Uĸ™Ŏè„Ilw„V°¤nĮ™¤Ý„lè„L@„ƒ„@x„l™è²ôĊ_ĊġVÈôJżīlbXšÆÈVŽkxÇVƒ„n°„¦Üb@è@nn@@°šUÈ¥WDŽ_Uala¯¯UǙkƒ»„mVwk»˜k²°VxlL@¤œ_@x‚`ȍ‚Ėöb˜š@l²alX„a@bnK°¦VK@nnWmx@nUnl@@lƒlĉk°l°UXkmW@Unš`k„ÇL„ŽW„ÛÈVxšVVlVk@l„IXb@ylXÈW˜Į„WŤzœy@šmIƒŽ²šJ‚š@nŽ°@V„„J°a„Å@ƒŎkVǚk™aUw„KVw™™Vƒ„@nkm™@±ôkô™ĊJš¼šInÑm±nIššÞ‚XȃĊxĊUÈbÜyÈ£Vkw@kVUV™„m@ša„»ÜbÈmƒUXwÝxƒUn¥@°ġ™Å‚aœJVk™aW¯Û@W¥—UŏĶ™@¯kUƒŃ@ašI@mmanwސ‚W@œ™mw°»Uřk¹±W„xVx¯¦U°ƒzţW™w@°ÇVÑk¯@„y°aš£š@šmšnl¼„ašÝÝakwUƒ±aĉImlĵn@ƒm@kkVƒ¯Ñm™ĸ™°x„l™œ@˜ƒXVÞmlÛݙĉUÅ¥mwÅ¥VaUw›™XġċaVůÛŹlwU¯U™ó±™xÛV±¯¯n¯mċƒLmnĊm‚™@™_kJWaXmwUƒĉK™»™@mwX݃UDŽkKÇw™»nƒaUw±škx™K@„Wb„x™„„lVê„lÈIl`@¦ƒŽ@²X¤Wó»™KUșŽ™KkkmVmšUÈóJ@x¯Uk°›„—Iƒƒm„ōƒ¯Vƒxƒk™ŽX¼ƒÒkk±W™wƒnUºVzklVxLǚ@„ƒŽ¯UklVxސV„šJW¦nšmlLówݚ@¤ƒ„bƒ¦„V@VƒV™š±LUxVbU@Vx¯x@²n‚°xn„Wb„b"],encodeOffsets:[[103073,33295]]}},{type:"Feature",id:"5134",properties:{name:"凉山彝族自治州",cp:[101.9641,27.6746],childNum:17},geometry:{type:"Polygon",coordinates:["@@ĶóšKnw°¤ĠIXVƒ¼kź˜Ôk‚„ÈWŽÞȄÜUVšÅš°@šš‚@U¤Vbkb™ĬôLš¼ÈVlm„Llkn@l¤Ub¯L@xÆx„„°mX™mk°b„°°„²™@¥‚™Uwl¥nU@ƒVUkçVnkWċšbĢ@lÈVVk„J„‚V„aV„W@£ƒUƏxW`™£ÈVVÅlWXÛlW°b²la„@°xnÞVÜĠÞ²@l°Þ²ƒèkblŽ@xÈx@Ġènal£nU‚Dz@‚ÞK„nn¤@¼˜°U¼„nV‚šXU‚šbn™ĠUVbUlVš°LX„@lV„èÜUnK@_ƒyXVyUwmIU»Vƒ„kÇ¥šÿkkV¯m±n@ƒn¯ÜanVVƄz@Ž‚bœwÜb„m@wša@kƒmk»@™a@VUUó„w˜@nb°mš„XŽmnVbގVôanwšJ‚ak£lw„˜šLšÅnÝ@wl¥IÇӃ@U™™Lƒ¼kVǃÅó¯kVmmw@ƒn_‚Vn»°LÅ»@éÇçŹīVÇÝ@ÝğU™ƒaVݙ™š¯ķlŭġlƒ@óÞۂċ@¯nkUӄ—m±™IVġUwóKUn±¯—K›w»ƒKݐV„nl@„óxUwţ›£ĉƒUmŗÇ݃K™„ÝUlmKƒ£UVŽ@ÞȎW¦„Ò@Ĭšnny‚@nÒmœVŽ—¼@°Vbl@VlnUUwl™°a@„œ„@llnk°lbnKWĀnŽU„VxUŽ‚²Å‚m¦Û›ÇŚƒaU„Vbš@¦m`móX™Umm™xÅ@±Þn虲™U¯»m™ƒV—m@wƒU@wݚÝmLƒa@„™VÇUk„l°¯„VlkVƒ¦UšmxƒaULUèVx@„kIUxmWV¼¯VmȯšU„nl›È—@m»Å™ƒVWxÅbÅğW@kƒm@kVV¦mlnn@‚ō„l¦Åƙxkœ"],encodeOffsets:[[102466,28756]]}},{type:"Feature",id:"5107",properties:{name:"绵阳市",cp:[104.7327,31.8713],childNum:8},geometry:{type:"Polygon",coordinates:["@@„ńlV°š@Őĵ˜VX»ÆUĊќJ‚w„@È»m»š£°Kšk@ÇnÑƍš@„w°JUwnw@wšbVbš@VlźLUw„aƒ»„aUklyUUVakwWXwWƒUxkLƒmn¥mšwk™˜UX™lJ„w@aƒIk°X„¥Wƒ²l¥šaU™„IlmkklƒÈL@m°nlWU™aW—š@Vƒ„@UaV¥@ašk@Çk¹ƒK@a™K@kƒKkšÇX@VU@kx±V™èkIWwUVUkkKÇ@ƒa@wkml¯@kUWn£Wa„aVwnaV݃w¯@UaWx—n›JńUxUšma@L@„mbUŽU±VVnkxUƙ„VŽm@kkKW°„X@¤ÇUkÆÇnU¦¯ŽkƒmLVwÅK@UóbÇƁVƒ¦™L@‚±êX¦mVޚkÜÝnWU—„›@kšƒŽ¯wķšnš°ÒU„lln@@„ĶmnkĊJ²bV„lxÞb™Þƒbk»™m™n™@™¤¯bƒz@Žl°UÒ¯È@ŽšxŤX„yV¯°¥Uwƒw²XlºVŚ¯¼nx›š@ŽXݏmxnb@n™J@b"],encodeOffsets:[[106448,33694]]}},{type:"Feature",id:"5117",properties:{name:"达州市",cp:[107.6111,31.333],childNum:7},geometry:{type:"Polygon",coordinates:["@@Uxn°‚bnŽlUnÒƃnn@n‚¤„LnxlU„ššV@„Æl„x°XXxl`XœƒVW‚œL˜è—„±nÈbƒŽ°b@š²x°Kܼ°ĉ„V¦lJnU@¦šÞ‚JÞğ„mšLÞ»šxU„lb„VÆann„alŽ„VƍX@lnŎV„mU™maÅXƒa@aWmœ@‚£@wĉJVƒkk‚kkmƒnk@ƒmna@šal„Kš™‚J@Þwm‚ÅŃ@ambkUƒƒ@™™KUġKU@m‚ak¯±ƒ„a@aĉÑÅaVwšXlwƒ±—V¥l@@a™kƒ›@@£šmƒĉÝónWV@ŽnÝÇÇx—UmbƒaVkkk@m„@m°ƒÝýXm›akÅīƒ@@ƒmb@@xmšnbƒ@mxšŽkWL@ƒ¯b@WUXmWœWKkbm@kx™Xmm@LUl„xlêóK™nUš„all™LƒlLó°m¯JVšU„K„„@x˜K²Āô¦l°"],encodeOffsets:[[109519,31917]]}},{type:"Feature",id:"5108",properties:{name:"广元市",cp:[105.6885,32.2284],childNum:5},geometry:{type:"Polygon",coordinates:["@@ÆL„Ċx°»Ŧ¦˜W„™šLȄ@xÞKÜ°ÞnVxÅĀlÒnJ°a@w„V¯l@XWknKnw˜VȚ°XXa˜lX°VI°b„W„nšaššš¥@ƒw°™n@šyÆ@nkÞ@°¯lJn„°IÈl‚UšlXÅ@ķlUV¥VUUÝޙUUƒ@UwƒJUkĉm@ýƒƒlk™WUwVwWJk@VUK™lUkaVƒUƒmLk„m@ƒƒ@Uƒ›Ik`@„™UmlUkV¯ÇXKÝ_mm¯@Uƒ`kwmƒl¼±KV¯—¯Vk±Vk±kzma™KUnDZ™bk¦±ŽX„ƒ¦¯Wl„J@bƒxkIWš—Vlš™xnŽm¦„nlKVwX„WxXŽlxUbVVkzVlƒb„¼ƒbVxŹKUk™@Ua™a@xmxVx¯Iƒx™@ŎmÒ@șl¯L™¤n¼"],encodeOffsets:[[107146,33452]]}},{type:"Feature",id:"5118",properties:{name:"雅安市",cp:[102.6672,29.8938],childNum:8},geometry:{type:"Polygon",coordinates:["@@ln@xšèVInxVKn„‚ĊklxkÜVޚÒnÈm°nxš@š¼ĊLV„nx‚WXblIš`š@nmĉn‚KȄôÅlUÑmU„K²¹@ÇÅVÓůVýÞW„‚UVmX„ÆbnwšKUÿ‚™@UmmIUb¯¥Uwƒ™¯™Çmš™„çmanUm»UUƒl—kƒ¤ƒa¯bV™U_WĕmÇŚ±ĢUlƒUl™ÛVƒçkUƒ@WŽ¯KU™VkUağVmš™aV™WUƒmV»—¯@»m£ƒmÝLŽ±@ÈmVk¤mb@ôƒ¦kVkamL@b°‚@b¯¦ÝVƒn@l„ê™b@º„UĸL°J@zV@nmUƒlaĸÔ@xƒ°VҚ„Ub„‚óĢ„ÒWškV@Ò"],encodeOffsets:[[104727,30797]]}},{type:"Feature",id:"5115",properties:{name:"宜宾市",cp:[104.6558,28.548],childNum:10},geometry:{type:"Polygon",coordinates:["@@VlÈnl‚XnWLX`m„²nV‚@b°xĢçlnšVm‚nn„@@„°‚UzšlV°nޘÒkxl„w„`UnVb„mšL@albÞKÈۚmܼ°@Xǚ@wmW@ńKĊL„lV„šLVŎçÞL²±‚ğkw@Uƒy@¹lKX™lKVa@w™™Č@‚w@a˜ÇU¯n™@@wġak—™aō‚ƒƒK@Å»VakUWmķwkbğ¥mL™akš™@ġރ°¯xVVÞ@VšxVš—VWx„XlxU‚™@k²WVŃULmèULVĊklĠ„VœJVx±nŃ¯¦mwğ@mƒƒlğkkl±@kšUk@¯±Ç™Kƒ—kxl¤b™Imx"],encodeOffsets:[[106099,29279]]}},{type:"Feature",id:"5111",properties:{name:"乐山市",cp:[103.5791,29.1742],childNum:9},geometry:{type:"Polygon",coordinates:["@@kšVŽk„ššÆkšV²UlºÈIlxƒLXèÜlU„„XU‚mkƒbVè„x°@„@¼°Knnn@m˜ÆIUbnJ@bVI°b°±@nK@mVakkƒKl¯nbšmĸ„èl@VnÈl‚UUw„wmwnm°¥„L„™lLnU@Va™ImbkƒmK„ƒƒnk@mƒb™ƒƒLV„JVUUƒ„VnkVmb@a¯JUaÆkk¥„IW¥„Klw—ÑmÝU¯™kVy¯@ƒƒ@mmn™Ukmġè¯w@aU±mnƒW_XKWmkÇmUkóbUÝUanmW™ƒ¯nma—@ƒxVôUV@šb@‚l¼„n@l™b@xƒnÛa›xa@ƒyUÅmUÛbm°@„m‚n²U°ll™ĀȦƒlU„V¼nJVxUz‚W„z@`mL"],encodeOffsets:[[105480,29993]]}},{type:"Feature",id:"5113",properties:{name:"南充市",cp:[106.2048,31.1517],childNum:7},geometry:{type:"Polygon",coordinates:["@@ȲVmšLnblyl²²UUl˜°U°²L‚»„knlx„_VŽ°@nnÞ`WL°ÈUŽVlnkšV@ƒl_œJV„‚@„„n@lƒnKV£™Çšƒ„UV¯šm„@laX˜U„‚UbVx„@VkôJU°Jn™@™‚wUk°wnUƒV_nJmknmm¯Vwk¯ó¥±ÿ—L@wƒƒƒLVU™kU›bX¯mykI@a±Kk¦ULmaXƒƒVm¯ƒK—z±ƒklUIVbÇJšƒkL¯™l™ƒU™ÿ™UƒlUkJƒUmŽUUkVVklKk@@a™U@„™J„²ƒxƒ¦kĬ@¼±ºXnWb—xƒU@xƒx@lšL@b„Llº@șl@bU¦Vbƒ@U„™@X˜‚bVškX¯m@nÇKk„llknƒJVš"],encodeOffsets:[[107989,32282]]}},{type:"Feature",id:"5119",properties:{name:"巴中市",cp:[107.0618,31.9977],childNum:4},geometry:{type:"Polygon",coordinates:["@@V„U„lbkVšŽVLUŽl@XI‚ŽUxVxšXkl„„@þĊnVl„IVx„@VVݚVÞUVU¦kV@ĸWÆô²š@VÞnš@Vaôb²W@‚K@XUmÑUW°¯°Ina@y„_lWn¼lLUbô¼„Kla@™nkUyô—Æx°@šn£™Ý@¥mVkIU¥Ċƒ‚¯Û»¯L±w@™¯a„Ça²m˜ƒ—ç›KX„UW›k_Ww¯WƒwÅk@ƒ™Uƒ™kVmwƒK£@mmmńmÑkVmamnnlmIU`V„m¯xVlx@šmš¯IV‚óIUlƒ@UwVaƒ—VW‚kbƒ@™nU°ƒV™„šÈU¤"],encodeOffsets:[[108957,32569]]}},{type:"Feature",id:"5105",properties:{name:"泸州市",cp:[105.4578,28.493],childNum:5},geometry:{type:"Polygon",coordinates:["@@VVXwVKn„˜wnVƒn„l@b¯xmKUbVn°°X°@blLšènV„@Vn‚l@U„LnmmUna„VV_ĶV@wnJ„„l@@kkKVólaUwnJm„wUlm@ašUaôKVnJWbޚ@VšwVLX¥VVš_Þ`šw„WƒÞŹmmnIn¥Wƒ@k„WV¯@ƒ°kI™ŽƒLk¼Ç@k¤±Xk˜™nmݯUlÅÛKWV¯kƒlUwkLƒÓ™@U—@ƒ‚w@ġXV„˜WX„š@UbVbšV›š_kÇV™lU°lnwŎ¦ÞaƯnmm¯šU„™m¥nkVmkƒl_ó¥¯UÇl¯@™ƒ™L™kƒ`¯ķLUy¯@mw—¼ķ°ġ_řU°mlšnÇVUޚ„@‚ƒš_ƒJUnV‚UXšbl˜Ģb@x@mšV°—È‚b@‚xċ@šš@xUbkLWškL@º„zV‚@lxĠ±²"],encodeOffsets:[[107674,29639]]}},{type:"Feature",id:"5101",properties:{name:"成都市",cp:[103.9526,30.7617],childNum:11},geometry:{type:"Polygon",coordinates:["@@°n°m²°ÜUšw²ŽôVš°ŽVkxÜźUŰČb‚ŽĢlaÈL„»ƒ@k„wVǂ@„ƒnÛƻșUÝ°Kl_„V°Uš`Vbn@VbÈLšaVU@ƨ»V™nIl™šUUa„±lIk±š@VnKmÅ@WaƒK¦™lVōškK™Ý@maXÇmw¯IU‚@kƒVƒwUmVIƒƒƒç—ÿƒU±ŽÅ@¯È@xƒK@wƒLUbÇKō@mÝ£@yóUóóUxkI@WlIUaƒbƒaŽVĀ™LmxÅaWƒUnVƒÝXUþÆ°UÔÈÆ@±ºƒLnVVÒkóÆ"],encodeOffsets:[[105492,31534]]}},{type:"Feature",id:"5120",properties:{name:"资阳市",cp:[104.9744,30.1575],childNum:4},geometry:{type:"Polygon",coordinates:["@@„è„„UJVn„x„U@lV°JnxWÈnbÞ@šŽlLŎ™Ušk‚¥„LXbÆ@nŽmLU‚@zlbXmlnVynL„çšJVb‚UnómUnamU„an¥lKV_²aValWô„n@nƒ‚bVœK°¯VblW@kkƒlUnlV£°W@w„UXk°KVwƒmVkwVyVI@wkmƒVÅ_Umm@Uÿmbk£™xUaVw±V¼V¤kLWxU@Uk™bƒyƒXšómƒ°V@@zÝÒkKƒn™±U@@_VVkƒÇaVwnLWalm@@kkVVl™¦kIV`±n@w„Kƒƒk²™aƒVUUV¤™nkxmUkVWVnLUbVbƒ`kUU„mLU‚mX@`ÅbǚXbWLXŽ›n"],encodeOffsets:[[106695,31062]]}},{type:"Feature",id:"5104",properties:{name:"攀枝花市",cp:[101.6895,26.7133],childNum:3},geometry:{type:"Polygon",coordinates:["@@„b‚KÞnޙ@x„V@x˜n„Unš°¼šVš±mç²ÝÆ@šwnnšVWŽnôn_@¥‚™UaVƒ„bƙœÈ܎n¥Æ±VUwVƒmXÿmLkal¯km@k›ƒ@ƒ¯bkšVxmVUkk@Ua@¯˜»Un›mс@mz™m@īƒÑX¥Ç@ݙxU¦ƒšÅŽÇUkx@šlb„UWVX„mV@xĵĖ±@@Ž¯xUšÆLnÆm„šx@nXL±lUUVwKWak@WxkbšÞƒŽĉbUn@‚ƒ@@xó¦„Ŏ"],encodeOffsets:[[103602,27816]]}},{type:"Feature",id:"5114",properties:{name:"眉山市",cp:[103.8098,30.0146],childNum:6},geometry:{type:"Polygon",coordinates:["@@„šVx°¦VanJVnš@„b„aVbkJ@XlJVwôôôV@zÞ¤@nƎÈLVa„K@x„L@w°ÇÆ@²„V˜ĀœmWXKWașÆa@_nWVnKVƒlV„_UaVamKXUWwnmmwœÑm£@ynUƒkWƒĉUkWVkkV±çkJmkKƒšƒK¯¦mnnxƒxVxVÇkUmk@ƒçķ™nmak°„LllUb@nmL@‚¯²¯aUJ@amIVaÅJn—m@mm¯L@»ƒŽ¯@ƒwUç„anlVƒWVƒÛkWç„KkwÇJk¹±V™UÅl™™ġV™²ÈƂnXĖV`Uš°a„b„£˜l„kVVn¼mVnbƒè™šÈn°š"],encodeOffsets:[[105683,30685]]}},{type:"Feature",id:"5116",properties:{name:"广安市",cp:[106.6333,30.4376],childNum:5},geometry:{type:"Polygon",coordinates:["@@„VlIV‚„kšVšĀ„Vkš°šlK™„ÈIUaVJlk²„˜y„Ln°„UW„nbVKl¥²L@blJnzW°œalV°Inô¯‚K„kšKkkƒbV™šmôLkéƒwVk@KnnšWlwn@laXL›ŽnXVW@X°a@„XKl™nw„@man™@w‚@na@„„@ƒw™ĕġġ™wUkUWb@mk@™¦ƒ¥mUÛb±yÅn@bml@kV@„ƒlknVbmVnlmš—bÇk¯bWyk@V_UamJ@I—@WaƒVXamIVWkUkbVaƒUUxƒ@VnkVU¼›bkKUxmK™„@WšƒxnV@n"],encodeOffsets:[[108518,31208]]}},{type:"Feature",id:"5106",properties:{name:"德阳市",cp:[104.48,31.1133],childNum:6},geometry:{type:"Polygon",coordinates:["@@nUW¥²é@šK„¥‚UÈÅôa@VÆLUxnKl„°V¥ÈmlÅÈV@£ƒWX¯lLln@UšƒVÅlwUm²U‚VVna@ƒ@KnbV™VwƃœI˜mXwWƒkIVwÝĕVUa™IƒèmKUzkmWnka@y™@l²kJƒ²Vb™VkšmJUšƧ¼@UV™bÇKUam@Ua™_¯VƒUk`¯LVÞǚżm܃„@Uȃx@l„ƒ¼ÇKkbWŽœšVxUbƦnxƦĊV"],encodeOffsets:[[106594,32457]]}},{type:"Feature",id:"5110",properties:{name:"内江市",cp:[104.8535,29.6136],childNum:4},geometry:{type:"Polygon",coordinates:["@@²èlUUllXĊVX„„lmV@zn¤›ÒnxmnXxlUnVlwšmU£VV„Ušbl±„„ƒL@x²mU_lJš¥UklU@ln@‚kXbmKUxÈbl„UU@`V@š²„mlLÞÑ@yU@„¯ôn‚™„W„zšaVlV@XwlKU£‚»—aVaUwm@mwUVUwkƒlVDzLlƒ„KV™m_@ykUmƒ@mU™çkKmxkIU‚Ý„@LUJ@n±„kº‚LXb™¼@mmIXa™@mamnkW™ƒKUƒƒxƒ_U`UklwUw™mUbƒV™²ƒakbƒmkn@`„UmҙšVxUb™I™`UƒaÝÈ"],encodeOffsets:[[106774,30342]]}},{type:"Feature",id:"5109",properties:{name:"遂宁市",cp:[105.5347,30.6683],childNum:4},geometry:{type:"Polygon",coordinates:["@@ÞĖUxlJX„Vb°@„xUÞmbUxƒbXbm¤VX@lk°ln@x„bÈ@lLVlVUXxlJšç²UlwV@@UÈWl™„L„w@w„V˜wXaWm²¹@»lī„¥„wƒ±šI@ƒšV@bl@kLUllUVVn@mmU„wX™ċbVb@VUkbmamšW@kƒa@™™k@ƒlaUa™@¯b@šmmwó@@lkXUa¯°›LU‚am„m@óƒkXUb±bU`kLm¦ƒbnVmbnVmô"],encodeOffsets:[[107595,31270]]}},{type:"Feature",id:"5103",properties:{name:"自贡市",cp:[104.6667,29.2786],childNum:3},geometry:{type:"Polygon",coordinates:["@@lIÞDŽbVŽš_šJVaUwš™nуV@_lm„nla„bš±„UVašnVxkxVlV_„`„wV„„LšlXnmnbš@WbnJ@nš»WaKl¹²ƒ@mVI@KރVlJnw@aW¯¯¯UmVanL°w@aƒk„mmU—xmƒULWxUUÝKōèU™KUƒƒkĉKƒL@ÆnX@x™‚Wȯ@Û»™nÇÜÝLka@b™KƒnUaVmƒ_ƒxkƒLX¦ƒJl¦ÅlVb°I@bnaUŽmlƒUV„UVƒIUŽ„Kš„„a@nml„„ƒŽnLl„našJUbV@"],encodeOffsets:[[106752,30347]]}}],UTF8Encoding:!0}
-}),n("echarts/util/mapData/geoJson/tai_wan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"7100",properties:{name:"台湾",cp:[121.0295,23.6082],childNum:1},geometry:{type:"Polygon",coordinates:["@@\\sŽ@pS}aekgKSu™SsMß`¡CqZ·be@Q^o@‹gieMp‹‰]}•}Ľc_Kk…{™ù“A¡r‰[uom@эĥJiq©mʼnq¯Bq]ÙYgSåk_gwU­isTE…“‘ĕiqiUEkue_‰OSsZ‹aWKo¡­q“ycY£w}‹ĩ™ĕS§Z©S™N¥SyLÑ¡±Ks^IY‰PdƒY[Uo†Fp}´\\¬\\j]ˆe܍ò‹¤¡–ā a\\bn™U㺹Ìs¼j®[cíȈEŽĝĆ`ļf¶Š®K|VØDdKGpVnU‚FjpH—F`†B’[pMºxÖjbpÎxp€¬‚|ΟÜÒCŠ²®‚ÜAp„ZG~€Šd˜ÞàV¨|¸€`|Œ²tx~\\~|dFf^zG€ĄŚhœdL\\hĸž¼†ŠOªP®lV`p\\]Xpll˜æ¤œCpQ|oF}fMRi†NSon_²qämœM„NM‹\\•"],encodeOffsets:[[124853,25650]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/tian_jin_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"120225",properties:{name:"蓟县",cp:[117.4672,40.004],childNum:1},geometry:{type:"Polygon",coordinates:["@@EUDAEI@WNMNCBFAHFFNACDJDPBD@@GD@DIFFHEFGDBDEQOFG@EI_KG@OcJQM]RMEKBGPG@[LaCIICBWKCEEG@WBQHCDFD@HSLEJI@IHWECFGAAEKCGDBFCBSBIDCKKHEADMJMFABKOKEQAA@IEEG@GIQAEK@OZEESMOL“lu@SLUTYFQCMG@@SQUAYKAACA@IB@BDB@B@DC@@BGAEFAA@BEGKJCC@AGAIHA@@JC@QEIP@@A@EGIDC@O@C@@@@CJCWKABFLBBEBSQGBAAMIEM@AKBcJEN@BEBCFMAEFEF@J@BG@BFABECKFG@AFQ@@F@BEB@@A@@AAAKAE@GFGDECEFEECBKIKDELDFEDYH@EIACDCHKBEB@BAAC@ADBHABKJIAIJICEDGDCD@@A@A@DHCHJHDFEFGBKRKBGIK@GIMHSBCH_BOJECCJCFKKMD@DNJEDEGC@OJCJHRUL@HRJ@H[DCNKDZHCTFDHCFFKR`TANVDFZRDLFARB@HPAPG`ILAR@TERNDFNHDLCLDDCXDYbHF@FEB@LDDVE@JPNfXPINCVDJJD@NJPAJHLXHDNANHhB@DPNLRMTBFRBHHr@`NBFEBOCCBIAQJDHCHLHFA@HSDCRLFTB@HEFLNF@PELBDJALFLTC@EPFLLP@tUHQJDfIHGTB^JTCPDLKAIBATFPADIEGECEMJ@JIAIHGECFEAGDI\\SPOXAFCL@BQTQBBTMZECYGAHA@GJAE@HCAEME@IECFKJADDBABLTHHG@ILEAMNDJCDHEBF@@JNFJELDFKTOT@JETBFFHBHEHKI@@IJEJ@XKEOUMS@AF@CEB"],encodeOffsets:[[120575,41009]]}},{type:"Feature",id:"120114",properties:{name:"武清区",cp:[117.0621,39.4121],childNum:1},geometry:{type:"Polygon",coordinates:["@@FWôµ@IFCLIB@EHNBp]AGEAKAEDMGZKFGBGME@ILGP@HEFB@BXMEAHUGC@IHCLOD@X[NWHWPKAEF[@EKIOL@EKGBNMJ@EIEHKBIC@BAKMIACCFQZCF]DB@ERAKADIHGEIBCGIIECFaGLZO@EFCNGAGDGAKL@BMG@IE@ADSDEH[JGC@CGA@BMDeK@EIACFE@@GG@FIAMM@CCGC@EM@ADE@CFMAAGHBDKIEAJG@DOGCDEKAGIS@KFCHKAEHIE]BeKNO[IFIOELC@A]GMBKVYCDDgGAICARc@MW@AQE@DGI@@AQ@@BKBAIQQYEFW@CEADIGGBCEIiMEMF_LGEKMBBDWEBGRC@E_CHYGCH_IAED@FFBQh@FGJaJ}AHRAREF@bE\\C@CT`FHC@\\BBF@BID@HGDDJ@@FAHKBARECKDAZBJIVNHCTA@EREAMLHDAFFBVFFC@RNRETHD@FOJMACH@CAB@P@DF@@FGDWE@FFSIEMKQDYCCHKb^JADOCIDGNDBdBCFJB@EC\\A@BJEA@JAAAD@HHD@LFBCFF@BERDHNhZQHMBGHOACCEBWEGD@PSJKCGEUD@CINLFGHE@AJK@HDABBHTB@F`DBFLBBHEDARCFG@ABJBAPVFE^FBGLGCFG_BMLEXGAAFE@@JNRVJHFALFBEHQJCTbNDHCF@PlFLJSXCHFHfVBTNJ\\BPJXC^FAVNFCHFB@FFH@JF@\\ABCFD\\BDMCAAJKQBGAILOEGHILECQLWFENJHADC@QxNHFJNLDFA@CBA@D˜UÂmR@FBL@BD"],encodeOffsets:[[119959,40574]]}},{type:"Feature",id:"120115",properties:{name:"宝坻区",cp:[117.4274,39.5913],childNum:1},geometry:{type:"Polygon",coordinates:["@@TZbB@JHD@DODCLM@AP@LL@BNH@ETFN@`E@DNG@CHLBCJA@AICFKDDBKA@\\N@AFNAGRBFjFFFL@DHLBLFQPcXAZMJ]GAVHAIZJFNE@JpDRRDCLFDGXA@EFF@CFFPDfEBDB@DCHCFCJDJIJBLI@I@CB@@ADBB@FALADGDC@@H@BB@FZGFCCE@@FMLALJDAFFFEFDFCB@@AHCF@L@@BBB@BB@FC@E@@R@BEL@HEFD@G@AH@AIB@@@FEFEBALDDEFAFO^IF@JCBBFPNJJ@D@PRDCEKBAXL@BIFD@T@JE@BHHJORFDI@@B@JGH@@B@BDDLIFFHCD@D@DEE@BAAAB@DAF@B@H@NGLJLMRDNMfGIEPMI@GDAKK@KIDIJ@GE@CFDN@FE@GFEPGV@TCDFKHBBF@RW@DD@@ID@TJFKIKLI@EP@IGBCLAEKLEN@KSHIGYACSD@SEAMBBMGEBMQBCMIGKFB[D@HDLPHDBC@IFITDLG@IIIFGVBNJDLN@VIRI@YIAIHIC@CLKZCBEE@JECEIHEAKGDGECBGEEM@@DA@CCCBBEGA[GEDBBoNAAH]MKiIAWKQoIIPMFQAEEDMH@FMSUYIeF@EK@BIOEKJEBICFKaKPFAFSE@LWCCFMHDDEKESBOGBKIEIODLG@CCDEQCEDWEMDIEIB@EHGEEDAEAa@@HqDEJGF[AECCFa@WCEIKAAEQB@FCAE^YDERDDJBLNABD@AJGLJF@FNIAMLH@FPKLJ@FE\\BFOLGXMXW\\C@KPGD@JHDGVFBWN@AEAGFO@KH@JNFAHEHYLNHFCLBFBBHo^MAFGA@KJED@Jó¶EX"],encodeOffsets:[[119959,40574]]}},{type:"Feature",id:"120223",properties:{name:"静海县",cp:[116.9824,38.8312],childNum:1},geometry:{type:"Polygon",coordinates:["@@NGFMDATCNDR@CCbINEHNJA@C\\EEGVE@IhE–[˜w”epc¢·²›^QEKIEKIgiQDkehY£uSDBMkUDOJDHC@GF@CAFBFEN@C‹Q@BeP@@G@HD@@MHQKi@[IGCOCESE@GMA_OcCGDu`aˆ@VZzKDkJBLNXGDqKEWE@cFEFA@ƒISIi@@KMABJGBcMuFEzGVH\\ATSEUBeALCEMG@CEBUHUCGXaBPtUBBFIBFTDFF@DDKBFNGBJPHXDDMDCLJ^mBIHIL@LR\\@LCR[@@z@NFD@LLBNb@RHDBNTPT\\F@BJF@BXCFBHHBDLFB@HODADE@@JHVXCPDHCFTLBBFNCDCCCU@@GAABEHHZHBCAEdEjFDD@GfD@DXFCHF@ERFDLBH@"],encodeOffsets:[[119688,40010]]}},{type:"Feature",id:"120221",properties:{name:"宁河县",cp:[117.6801,39.3853],childNum:1},geometry:{type:"Polygon",coordinates:["@@BFLBFJXDb@DEFD\\BHEFIrC@Gb@FBCBFFGH@FJAJFNCXFFCRDCFDDH@CKJPJFALPHTALFCFGCENDDKXF@ETEBO‚bLELJDFALIPFAJL@@FfEZJTVENG@CNFFRBNEJOpJLRBXjJNLG^BBpMAAFC\\HHBAFDADDB@@CN@FFAHFDCHLHFBJGFCFUNKJJTD\\XUXF\\^F@DDDQXXBRLRCBDFEVCDLVDpUl@LEDJHAPRFGL@CETGPBTCDDVI@CFF@GFDCCVGLKEK[Y@MECISG@BKNSCGCKWEAaEBEKNGFSECO@GGM@GYI@DÅCMLHPTF@DJHAVVNKEGDETJ^[TJNNd@NOAMFYJ@@GFANDPEJB^aOadSTQSI@MHBDIEOKCG@EEFCKCqXO@@DMFENCDDHCCGJ]AKFoDaGGHYFDHKJiCMFGC@EQ@AEHGAC@IEAATKOHGIC@IXIFEoƒGE[JCFCDHNmRADFZMF[EEBMO{GU@AOW@@]ZeHBDEHBKEfQkuIWBs‡@EC@d[@[^EDMTKCEEcI@cDAB@FCBCACmOCG{PYHeBgPwPFDDALFFFCHQGSD@BHFAR[TaFYXMASUiGFL@DQNCJI@@D@PLDN`ETEFIGMCGBCE‘~CAIFDPEHGEQPHJADFJGHCJLB"],encodeOffsets:[[120145,40295]]}},{type:"Feature",id:"120109",properties:{name:"大港区",cp:[117.3875,38.757],childNum:1},geometry:{type:"Polygon",coordinates:["@@JFFL°_`ONJKDDFIFZN xlb~yFVNRŒrdJGzDPVFBCTNND\\UR@E`F@@Ip@IWGUoawOEE@ÏDgK{İEEMFëC—b…™@—KwOCDHHKBDJCDEEEAGHOABFABMCgDLSQ@CFEB‰MgYIDQINE@AUSwSAdYEHQMEyK[KI@GRMLE@@OqOoBOnpJ@BmEAFHL^FDB[C@BBDVFAHFJENB@sNEjQAMYsUgCSBGDJH@\\LjGR@NC@@G@HO@AfR@DŒM@EFEADBE@@HGDICCPlVANTC¤vgZlfRChjLJ"],encodeOffsets:[[120065,39771]]}},{type:"Feature",id:"120107",properties:{name:"塘沽区",cp:[117.6801,38.9987],childNum:1},geometry:{type:"Polygon",coordinates:["@@|ODHnPBDADEDA@CB@ddJFFLDNSFC\\]\\@@cFDˆ@nACOMW@M@ITURBRZNHNWRQšoO•j½f‡cqŸAqeiDÿÍyÓįFL|Ch@ÐFFxPpbHVJXo@@JCTR^BPABQA]^MB@bE@@FQBFVJRH@FXtPNZSBAja@@NƒDTŽLJrQTHFXZFB`"],encodeOffsets:[[120391,40118]]}},{type:"Feature",id:"120111",properties:{name:"西青区",cp:[117.1829,39.0022],childNum:1},geometry:{type:"Polygon",coordinates:["@@@LHAHRHATh`LHNHDG`HDGZ`D@FQDAHXFACNAFLVRTBFOfHDCVBFQH@HSXHEPFB@LDBF[bDbLFKJBFLADBDjLvCPEI]FGEIGCBEUSjcFiBIVWfaHCjN^HtwBBFGPBJGjFBEGECGDONMFAP]TDHQOWCMGAMHKIJEIGQ]aDlUG]VGEGDC„{PEbBZmE@@GH@BCA@FMQCFMYMJECELCMI_P¯`]R±œ¡¸od“f—x•\\gF@JUFFH[F@DIBGMMFaJDDQ@MCSDCBENMH"],encodeOffsets:[[119688,40010]]}},{type:"Feature",id:"120113",properties:{name:"北辰区",cp:[117.1761,39.2548],childNum:1},geometry:{type:"Polygon",coordinates:["@@ROHFFGCOJEDB’}DFHANDJHFEFSM_KC@O@CJ@DIRM@CEKKA…L…FKACHoLSJSIBETDJaEIIE]E]K[MYUYQILC@GF[MGNKEK@A@BCWECAIFEFYAGFOMI[OFuDiKACBCEKIAELaKaCE\\CA@KEAFOWGGTG@ERUACDeGEPSAUQKHE`FNjNFJADHHCJFB@DEXZFRRBJLA@AR@@BJ@CHF@BRX@@NQdDBBJhHCCZDLUNA^H@BKDPFEJ\\JMPfL^AJFFGLBDGLET@HJLBCFHDCPH@BIJFCLGABHNBDEF@BCN@@FHDDDN@BNEJH@@HF@DEJB@FfLNC@AHB@DHD\\IFGTCBCF@@JNH@ALKHBHCHBDMFEP@KYbHDEJF"],encodeOffsets:[[120139,40273]]}},{type:"Feature",id:"120110",properties:{name:"东丽区",cp:[117.4013,39.1223],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZV\\N^L^FJFFJIbSCAFTJTIpKDGLB†E†KLBjHTVNBZWbE\\SBQGE@ATCRHDGEEKECBECxOhOfAZGA_YEEWSGqRKIS„C@Mb@BiTAMYsOEWG@IQEURA@EF@@acUOXQRYCUDCHDTEF[SUEgAYDcVGJM`iAWDWLQRMHUHgDsDBLHJFCFDFGHBFFVEAGHCJN@RJF‡PIhBD\\FENCPWA@LFBAFHBEJUEARCDIAEDQBRNa^"],encodeOffsets:[[120048,40134]]}},{type:"Feature",id:"120108",properties:{name:"汉沽区",cp:[117.8888,39.2191],childNum:1},geometry:{type:"Polygon",coordinates:["@@LMEI\\MTABKN@FCDMH@COAcH[AoēA™M¡Wa[Meq™pQRMXMGQYQASV@J@NNXDPmBAtJXlveRLFGACFGAYf@^X@BPV@|HNPFA\\FNEEYBCnQGMDCDE\\IHFp„EFWJ@JJDGHLPBSFB@JBDGHBFR@@FHDNEjDLICGZEHGbHpCLE^BHIDDCGDCFMNE@CP@rWLDEDFFH@"],encodeOffsets:[[120859,40235]]}},{type:"Feature",id:"120112",properties:{name:"津南区",cp:[117.3958,38.9603],childNum:1},geometry:{type:"Polygon",coordinates:["@@TLv@CNHFFBHGZFETNPhCVGNGRQXKXCjBN_HIdUZChBVF\\TFECSDGVCZDRQPWdVNA^]RBBAAOQ]DSE@F_Q@[VMCSMADUECOHycI‹qMQEU}zkaŸwENRDENB@ADG@@HF@YnaAOFƒ|CDFHUHH^kVbCR^JHIFLJNGHBDNPXGRSCO^EBMNCPDHHFAFiEIHOAEH"],encodeOffsets:[[120045,39982]]}},{type:"Feature",id:"120103",properties:{name:"河西区",cp:[117.2365,39.0804],childNum:1},geometry:{type:"Polygon",coordinates:["@@d@hZNFdcLYXKRCtCMOFSYEGHEAGEDMu@SKAAsx]GMTGt"],encodeOffsets:[[119992,40041]]}},{type:"Feature",id:"120102",properties:{name:"河东区",cp:[117.2571,39.1209],childNum:1},geometry:{type:"Polygon",coordinates:["@@ZBVFFIGABEEA@KXBDOFM[EACJgˆOIE@QIMGDBHUFEEGAEHECEDGIAKQDWLKZcdQPEP@FOFBJTJ@HNORJf@DBCN"],encodeOffsets:[[120063,40098]]}},{type:"Feature",id:"120104",properties:{name:"南开区",cp:[117.1527,39.1065],childNum:1},geometry:{type:"Polygon",coordinates:["@@NMVDCG\\E^B@HlB@YEDS@C…HsNSiMGDebUXAJEjidVTAFHDFJ"],encodeOffsets:[[119940,40093]]}},{type:"Feature",id:"120105",properties:{name:"河北区",cp:[117.2145,39.1615],childNum:1},geometry:{type:"Polygon",coordinates:["@@DBXFADB@L@LFHM\\NHED@JKZRb]QMRAFCJBDCBQYADMCAe@QIMP@GSIAIPE@E[EGH@ZEF]^HJAXK@KF"],encodeOffsets:[[119980,40125]]}},{type:"Feature",id:"120106",properties:{name:"红桥区",cp:[117.1596,39.1663],childNum:1},geometry:{type:"Polygon",coordinates:["@@J\\PNHEZBFEJELEL@BWGI^]FEkA@G]A[FDHUCMNEHJ^"],encodeOffsets:[[119942,40112]]}},{type:"Feature",id:"120101",properties:{name:"和平区",cp:[117.2008,39.1189],childNum:1},geometry:{type:"Polygon",coordinates:["@@D†T@FCHG\\FFOROMEgYc@"],encodeOffsets:[[119992,40041]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/world_geo",[],function(){return{type:"FeatureCollection",offset:{x:170,y:90},features:[{type:"Feature",id:"AFG",properties:{name:"Afghanistan"},geometry:{type:"Polygon",coordinates:["@@ࡪ͇وŐǬϠڐŶӂʮǚڦ۾njƀ̚ІɣʪҴMوǯʲĹ،˒˰Nj˖ϪԈiżŬĘͺβ̈Ҕȏĝʱʪ¡ý۷ͪ˟̊ǰώĊԼϖׂ×ࢀAƬʋӧĥяƹ७ĭࣗǭӫλȤΣĪллΛ–͑ɳ̡ߛ€ͦ։՗ɅΥԕ²ԋ͡ɿ̳þٝŋğɻسDҵӇ‡܍થΓבôǝȁԇņ࠿űටіހހåզُƚßՔ˟ڢάҢιŮɲؒ΂ਸ"],encodeOffsets:[[62680,36506]]}},{type:"Feature",id:"AGO",properties:{name:"Angola"},geometry:{type:"MultiPolygon",coordinates:[["@@ȸصʌԋȘ˕͐ѯ֊æˤŠҬşŲɀɂӨԶ®ƤіHñ̡৴RfՉǞ͕ūԑÖԫ˪̷­ৃȼüκsԴŴϦ¹ĘʹĩСƨϿů̿î́ყZᦵ֤ۋպԽ໳΁᎝Š׋Ж₭—ŵÏԃϞկ~ԉƝЙDžÿՈŜ݊̂ޒªΰ˚ݶȨΆӘռːϐĘج«ӊʣ̜ɡԚȵԎ®Ǩʶͬʭ߼ǣ֚сՐĄǎΌŔʒg̎ĸៜ["],["@@ɉėɣلͼδʪƘ̀˽̩ǯƍɍλ"]],encodeOffsets:[[[16719,-6018]],[[12736,-5820]]]}},{type:"Feature",id:"ALB",properties:{name:"Albania"},geometry:{type:"Polygon",coordinates:["@@Ń˷ŢέΒȳiə˗ŧ»˙ϷСƛÐgȂү˰ñАîֶŖʼƗƂÉˌθаÂƿɨôǴɥȪďȨ̂"],encodeOffsets:[[21085,42860]]}},{type:"Feature",id:"ARE",properties:{name:"United Arab Emirates"},geometry:{type:"Polygon",coordinates:["@@Ƭ¤ŒɱڂƂ۞uԖ{ֺ֪ظՠՎԮdž˹ŖڑѕGçճƪŝϝǑE΅ʓΏuͷǝDZᡋъ͏࡚Ț"],encodeOffsets:[[52818,24828]]}},{type:"Feature",id:"ARG",properties:{name:"Argentina"},geometry:{type:"MultiPolygon",coordinates:[["@@ߗ§ѓ̔ԑx࣑@Aሞ͒ϵрؿનԋ୲ȿϙп"],["@@Ӵ؇͠ڰॠ“ƊǷ໶ോۊŷਆاࡾ͡Ŧχࠡ౧ࡒɭ़ŷڔƈނ٢ƎݐжLjфӝiڣۻҩ֟΁ॅࠃ૭ଧȽڥɣࡹT࠷ǽȇÝիËѫ੨ܙŗ׃Հν§Ч߯ઁఛ҉။ǩउĎǰԅǣػƺщԋ̏ࡱř̪͕߱ɗŜ࠳֨ʧҠˆʢѧޛʻڭԹūࡋȣ҇ߏEڃљʋؿؙࠞߦǝ˿ݭ঳Ӄձটލͧ΅Ͽ˔ࢍ֔ӡΟ¨ީƀ᎓ŒΑӪhؾ֓Ą̃̏óࢺ٤φˈՒĭьѾܔ̬૘ěӲξDŽę̈́ϵǚˢΜϛ͈ȝॺ͸Ǣƙ਀ȠࡲɤݢԊ̨ʭࠐEޚَոo۰ӒࠎDޜɓƶϭฐԬࡺÿࠀ̜ބռ߂צԺʥ͢Ǭ˔ඔࣶд̀ࢎĹɂ۬ݺશȱ"]],encodeOffsets:[[[-67072,-56524]],[[-66524,-22605]]]}},{type:"Feature",id:"ARM",properties:{name:"Armenia"},geometry:{type:"Polygon",coordinates:["@@୞ƀǨə͌ƣǛɁ҄˽ʁˋΦɫϘƏl׋̣}΃ӢHżχCʝɤǩuͧʖرȼĄФƛ̒"],encodeOffsets:[[44629,42079]]}},{type:"Feature",id:"ATF",properties:{name:"French Southern and Antarctic Lands"},geometry:{type:"Polygon",coordinates:["@@ը˃ߐĿˆDžɽϣಇÃq҂ŮΎÊǢ"],encodeOffsets:[[70590,-49792]]}},{type:"Feature",id:"AUS",properties:{name:"Australia"},geometry:{type:"MultiPolygon",coordinates:[["@@ߺ́ҜŘپNJԎÉÐঽ˽́ēگ̉ɰ׍בǧ®ԫ€ԭܘŗֈӝܸtϬռõ"],["@@̢ڇբ̈́˦ΡЖ͟đϋǴܛŸнɄĹɬܕąѥ˖֭࣬ѭצЋ֞λŋȯӔՃࣧ͜ͲȂ;ηȴźƢࢹ׬ԩϸ͋ڀڹʀڭtӏËԳА܋µݓơϵɩݡjӕǕ׻χއثЭ̫ٱ˫гʝܧ͕нɅػʼnׁªˇӕ̇व‰ޡ·ϫ͙ԕέ۟ψԥƪżѬҝǃ݁؉ܩɪӉƄӑÔ߿ʐիԮƻْțьЭ;߱ĸˢРȯزЧ׉ݝƷѮҬŶӞ͘ЬãجہܑԿ˽͏ڛٽΊ~ҀԿ،ѹ̀ǂȘઃԚןz߯Цຓāછ̝ख़˫ߡÈࢻљܯȗljѱ̳Ϳ܉qՅõݑƶ׿ğֽԁ҃ʕœуʁЗˋؕ֛Bࢽ՜ҋDŽlӖкŘƚȒ‡̠ĺאģӼѻࡖƏӒ˜ӎͭնsʚϋͰĽڄӓڔřΪτε˳ެиʑʞ͗aјеڎă˄țʦĠӠǢȸŘрęӮΎ؀Úٕ΢׀ۀˬЦΪٜ̰ϤàɴĻڎ̺ԚĤŶȀɞüҬoࢨʖҚώɊ҆ӲѐœͲvҘט܎ΠܩΦǚ̗Ј˂ТψǻĸٖҠаȮͨцƜ`ɼτĭdɂτŦОŔبϫҲӽՂMՖÿDZҦДڪϜɘſȾκӒԘ̒јıۺǂeі؛ˢ҂Ū֎ȻҀ·ۼɋʈĐԶʵӬʊ͂ñȠNJϬеɡ͉҇ͻ˿ƒĮͱʙп̗ЭÔʁڜҫ٨ˏѠ́؈ӻʂBѰɍŶʷߤ˵ֈ˼ǐҊǠόľҤʰڞŝОÔʔīӔŌنLjǠŽˬȮѾdžҦtʈ̸̾ʂЩÎՃȾķ˜Λ̨ёÚӇ‡̥"]],encodeOffsets:[[[148888,-41771]],[[147008,-14093]]]}},{type:"Feature",id:"AUT",properties:{name:"Austria"},geometry:{type:"Polygon",coordinates:["@@Û΃ӁCǎǻ˧էLJƗܽsщȏۛÞயɐȉ̊ࠧƣĭDžԗŢѕxϝƶźȴƬʪ²ьɹŤɜݎ•׸ƮЖ}ˀǣþƜšո̠ń̒ϰز˓ӀΆ̐ÚٶʱЂªϰǁãŃČ̅"],encodeOffsets:[[17388,49279]]}},{type:"Feature",id:"AZE",properties:{name:"Azerbaijan"},geometry:{type:"MultiPolygon",coordinates:[["@@ʞɣψDGŻ΄ӡֽŒщϰƃ͆Ǫv"],["@@ϊËƞɈԈͺѴѵђ׭ϺŸʸɧۗãƣٵƟ̭̍ȝvзȽ¥ԻѲ̂дʝʚ̿×যإk׌ϗƐΥɬʂˌ҃˾ǜɂ͋ƤǧɚȶƎضʍҐ¹ŘIJбҔɔŚʀ…׀ԙ"]],encodeOffsets:[[[46083,40694]],[[48511,42210]]]}},{type:"Feature",id:"BDI",properties:{name:"Burundi"},geometry:{type:"Polygon",coordinates:["@@Á০ɃϢԜßʲӎҀŸͧǸȏT˗ȹǭ͛ѫ̧̥΍Ÿ"],encodeOffsets:[[30045,-4607]]}},{type:"Feature",id:"BEL",properties:{name:"Belgium"},geometry:{type:"Polygon",coordinates:["@@؜áުǪՐοҦȝħ֧ɕĝһܿϦћßדІϷͶϷ`ũ̒ڪǔ"],encodeOffsets:[[3395,52579]]}},{type:"Feature",id:"BEN",properties:{name:"Benin"},geometry:{type:"Polygon",coordinates:["@@ۛįȹ׆žኞǛǦЮ̇̌ʱʞņѶ̀ĨǠξЪĀȀʤˮʘ̠F٘ә˩ȎӽǓͷĘɧСԳʵʳǁՉt՗µണ"],encodeOffsets:[[2757,6410]]}},{type:"Feature",id:"BFA",properties:{name:"Burkina Faso"},geometry:{type:"Polygon",coordinates:["@@ֹɐϽ‹̍Ƀϗǰƥ˦ϙǾÅӦɮΤo˴ښۢŬּɲȴОœΚǢŘɎٴϖdžˀ޼ΒҦŢɀLJՠJáСŔϣӀչ€НॺȏmֻǿʣЩÿǟν˿ħ݁lϳâ˓ƉωÖร¡qӉŘم"],encodeOffsets:[[-2895,9874]]}},{type:"Feature",id:"BGD",properties:{name:"Bangladesh"},geometry:{type:"Polygon",coordinates:["@@i׽̉ŶÆگʉѬµєDžКΕӨޟ’ü΋˃ҳΧǠũƵʃĠ͗øŽۖ̅لƜԒԫɤȆ̪Հ̼؅Ѽ֮̔ږεВ£ô׏ߞřު^Ӟƛϯ܅ϕµʷӍҢѥƎ՞ɶFѶ೯"],encodeOffsets:[[94897,22571]]}},{type:"Feature",id:"BGR",properties:{name:"Bulgaria"},geometry:{type:"Polygon",coordinates:["@@ʎΉ͚Ö٦ſ௾«иɌবȜ̩ؒӴĕѥΏ̫׹˔ӏܣŒࡥ˃Uлޅÿס̊ڧɱة|Ñ֊сːƒŢĝĴƘˌ͌ˀСδ÷̬ȸȐ"],encodeOffsets:[[23201,45297]]}},{type:"Feature",id:"BHS",properties:{name:"The Bahamas"},geometry:{type:"MultiPolygon",coordinates:[["@@ȵ£ɇӜ̿ʐǾՔʨ‘ۣ̎Jӥ"],["@@ࣷƅÏ̴Ђäֈ{~ɕ"],["@@ƟׯƷņ`ѮϓͪCĪڐϗ"]],encodeOffsets:[[[-79395,24330]],[[-79687,27218]],[[-78848,27229]]]}},{type:"Feature",id:"BIH",properties:{name:"Bosnia and Herzegovina"},geometry:{type:"Polygon",coordinates:["@@̦FȿσМ͓ūЃȡ™ƽû˙țūҥݓ͈ͅΘ͋Ȅϭ̾ǻʺЩϾǬΒ̞ȕǼǨϾnܠƓ׈\\Ϟȅ"],encodeOffsets:[[19462,45937]]}},{type:"Feature",id:"BLR",properties:{name:"Belarus"},geometry:{type:"Polygon",coordinates:["@@߼Mࣰ̈́ȚӄېːÿϔԜƚ͖ࣘࢮɁŢȻѲĴࠒȧĊЁǷɧՄս΂Ƴ»Ʊ֦Ʃʎɡ͝ǿڳˆljÿȠ˧ȸ՝ܝ¹ʵȁÃхͭĆݷ¡əȞ̿ƥ́ŨڍjफȬࡕàٱmҡɩГeϐʷϴԌǢLͰɷ͌™ϊ"],encodeOffsets:[[24048,55207]]}},{type:"Feature",id:"BLZ",properties:{name:"Belize"},geometry:{type:"Polygon",coordinates:["@@OŮĸžƴı̞ԔDŽZHūDŽGaɭƋεôŻĕ̝ÀăīщǓɟƱǓ̅ʣ@àॆPژ"],encodeOffsets:[[-91282,18236]]}},{type:"Feature",id:"BMU",properties:{name:"Bermuda"},geometry:{type:"Polygon",coordinates:["@@OEMA]NOGNG\\Q^McMOI_OK@CQSGa@WNLVWHFLJXVFGJ`ZRTDLeeWKIHGIK@@[MQNi`]VDTBHCJAPBJLVFjT^LV\\RJZRn^RH`TfJjZHHOTTFJP_NOX[EYQQKMEJOLANJH@HQHAARF@ZEPS[U_IcRQXE@EEKKOCGGCQCOGISKYGUC"],encodeOffsets:[[-66334,33083]]}},{type:"Feature",id:"BOL",properties:{name:"Bolivia"},geometry:{type:"Polygon",coordinates:["@@य़”͟گӳ؈વȲ۫ݹ؅ŗ͡୆ҋऺˆ߾ѳ΢ŏ؆ЫֲՌ࣢αۺȖ˰ƭ̶͠рh܎¤נǸ˶ܩഠزíѠnȈʪ݀;Ѷ͂સƚęؽļ͓ãࣰ֛ݫऴƑ̻ͦ֨ǕΐʑՈTӦʟšӟǐʕZγʓa͒এྖ“ūӟĜͧҞɽȤԹƫڋɯρĄӏʿǥaʶ޳јޭ^ัʓЕ݋sҋͥ৕ƉǸ"],encodeOffsets:[[-64354,-22563]]}},{type:"Feature",id:"BRA",properties:{name:"Brazil"},geometry:{type:"Polygon",coordinates:["@@૮ନॆࠄ֠΂ۼҪjڤуӞеLJǒӜŖӼBҦ̡ƴ̿Ƌ̻œį͔ýޔƿʤ֥ɪ΃ǏࢱLjÈଜʝҴˀǦăӐɰςƬڌȣԺҝɾěͨŬӠྕ”͑ঐʔbYδǏʖ™ӠӥʠՇSΏʒ֧ǖ̼ͥळƒ࣯ݬä֜Ļ͔Ěؾષƙѵ́ܿͽȇʩџmرîӃƟϡĪÈ౨ۏӷݏv҄ͅ֏¶DzΰұԞΓݴɜƶA΢ԖʎċҔɊ̈Ôϼ०ֲێNJŔŴݴŸϚᘰpθſӔύ̬LؐӀƒǚē†͐ӯĔYՀ࿖k˦̂ɸˉǐӷǂļҨѻٸÆnjʲشȞΊƐĮΤ׸ʆ¯Ǯ܅ðśՊ’֞ϓɒǀþجŅڜȿʐȤ؀žल̮͎̾ŏʂѪšȜȗʼnσ̀ŵȖϷɷ̏ƅ܏ɌыÔϳԬϿЮ¥Ģǒˆ˜ϠƦ˚ɢҬíȲŠҚçøǢƗǘĎʐͺõЈĒӔDZξǥʺɪȊ•ŘɿДÒ͒͊ʴؤӼޒ˺¢ȺҫҼ฽҈Ƒxׅمەʾʩ๤ƁŠࡃٔր੐̟ඊԡШӱƏҫ঎ʶ࿐ѹఴŽఔ۝੸व٪ʏܖ‘̦˅˸੭Ɣԗͯ൹ёշஅୡՙोثܯȿgɻءÒ༽ɹಓęօˇͧƫ૱࡛઱ƛࢁڹηȟԋ࣯Fೕ͓סύवʗ঩ڝ܅࠯ũطƔҫƽࡓȏЧחҥट๕݉ڗ֯Ͻϥߛ։ӑɷӈψЊӟֲڇҬࡹՠ̹{ࡅٰձę"],encodeOffsets:[[-59008,-30941]]}},{type:"Feature",id:"BRN",properties:{name:"Brunei"},geometry:{type:"Polygon",coordinates:["@@ͬ̾܎Ң›Я·՛Б€ǭ˹ϥѦ"],encodeOffsets:[[116945,4635]]}},{type:"Feature",id:"BTN",properties:{name:"Bhutan"},geometry:{type:"Polygon",coordinates:["@@΂ˍÏԩۇ{ۿÈՇſޅ͊kǚ֌زҒɈ׸șѺqπɥ"],encodeOffsets:[[93898,28439]]}},{type:"Feature",id:"BWA",properties:{name:"Botswana"},geometry:{type:"Polygon",coordinates:["@@ǜƭ˄ӡॎइήĝD̑ʚՑٰŹ՚ϝ஑أݭع˩֓ʧ́ҙãƧГďʽ՝țہ¤БɾΟĸХșȵГЉʧпϑ׻đȇ̐üԠӽߚɧŲAរࠤˆ|Ჾش„ಖ͎̎΍՜ͤʮDӂȎưÙ͔ڣ"],encodeOffsets:[[26265,-18980]]}},{type:"Feature",id:"CAF",properties:{name:"Central African Republic"},geometry:{type:"Polygon",coordinates:["@@ۜÚƺɎƔgȾȏ੔͐Τ͠Ѭ̌ĉ̐ʂüߺ½߆ϴ؊ࣺю;ՐƜĪΫӜԿF΃ƋΓÄʻ̆ʍٖοҢͻT˗֠ѫΖεɆԋغͩƊˉˣęաpكĘ̹ïųȱ˕}ͧDzधнϥĎŗÝʥԕطǐؙĊ՗̴ۓ˸҉˓͛яùדգ²֩Ƙԅѻѯޱėʐ›Ϧϧ˔̳Ѡï̠ЇѮæʢċΞÞٴȬƴц࡜"],encodeOffsets:[[15647,7601]]}},{type:"Feature",id:"CAN",properties:{name:"Canada"},geometry:{type:"MultiPolygon",coordinates:[["@@؎œުxЯ΅̵Å੥Φȿˬ͆ʸ̎С"],["@@Хcઝ˂ޯІ̄î૆Ɂ࡮Η|Ʒ"],["@@хŝൡϢʥ̘ݩ̌Ưʈࡻư͕ҜðȚࢨǿԨŵ߄ė˺̃дЋ࠼΍Όҩ"],["@@։ܿո˴֠ǵ̏̉ݚɱϰȴ࠼ʵʹ؛טƞņѿʼԷΝ݉ϝ‹փǂǾیɻńইܯԅ†צЂ߫Ȳࣙ¹࿅~ŹʠԼ̐λɬ۸Ԓࢄ೾Զӎܲ̂϶™Njɫ҅Չ"],["@@@@@@@@߰äʥ॓ܶگͯDԑϪ̵ϮчʾƻτºˎЂŋ"],["@@͡ѳχîəʢ Î͖ʦΆkɈǣ"],["@@ঝҧץnǿɪزϲ଼SiǍ"],["@@ƼυјżӨɗं˽४ʽöЍؤÞ׶˥ݙ˃ಳȬҽϚ࠭ҁ஡ѣ˿Ӯଗăܴдņڌ˺ޔ؈å"],["@@ष¥ȿЪΦҼޖŜپɷXέħřձʛ"],["@@Է̍ଉʬۃğଫϘ݊ʼטζࢼʃԎƯʦDžԠ͍"],["@@G࡭૰ڄ৐եʡح߾֥࢚؈ؖܨ°ईஞÝఔūૼй¼зس҃פ҇ŃУ࿩חୡŻࢃʨʣуߵ۽ʓοই֩ளÇڏΡÇձ঍Ŀਉڻ࣭ु͙ڏ±উంƕϜ޻ϼّ୲ǔ༞εࡀ͋׺Ѕ੆ɳࢸΟ൶µࣴąƍܫʼࡋ،ळనߗ٨˚ҔࡺѭೢףѶഎЀ॒לҮהç֭֘܌৷لলࢤνݾ˫ಾגȘ෸ɫࡸć۠ɚ޴˵ਚӣʮ͙ຄÛ}۷˪ਜ਼ގſ،ӵ௖Ұߦऔ֌ϸٺݣબੳघ৙͵Յ૤Ӂݰӓംɏբˍͬ܃ټŏͶͅÖऻ؍́׽̏൯̗੏ۑ෇ƋᅛǮుPࢇÍ۱׽ੳω௉૗ॵޡ܌Ɛഘૄᄈ۪సČݔЫߍ֟ˊࣟ˜هતп൸ŨࡆीÎ؍ժ̥ਣսᇷԁ࠯ͽय؁ٓ֍܆ฤ۞഍ƒणĹջӆBନύʐ֛ƛ˧ɚٙىʱٹ̕ϡΥŽˏ¥čȹ໽A౥MϛƷࢵ؃Ŀßˍ͝ޗBࠛGϛƅƊǑøʯeďષлࡽſউ҅Ɂ@˷ƂĥŦnĔȂ̎ЂҦʘӺǙܴǵނ࢕ЂľƬūĺɳ@ǛƆ¥ȤǍēɥ€¾ĊȡĊćɚٵːڹ˪ࠑ͘߁̨ݧʃ˝Sਕɔڻʼnࠁʺ࡫Ɔו¾ʻƜƫҤ˳IE͓჏BᮝA᭯@ᡃ@ᠿ@៙@ᢡ@ࠛ@᠁@ᛷ@őF྽ࠜ׵δຽΐҳݖŤԨ੻ΨƧڴ৭؎iѠҲКwՌෙ՘࡭ॠՁ׾ޑϚ֣ΈѿѢࡇ˕ࠇҹݛւדπࠋɸࠟ|JⷎNᷲ༬ȭ೘Й࢘û݆ΖৰˀఢĹ఼τ൘Ⱦ־ΑظȠȊЄ׈ęෆݫ૦֬ŖّਔƐ͆ʖৰ·౼Λዸ̭ୄƛࠖÄଊэ஁зຶǷᗘIJܒƦࣆԋࣴьࡩΦժ˼৾žڦĎڴȩࡊҗरä๢ϛಬƄ௬oĭԺݞƦದ˵KߑՖڠڰuϞࡊ࣑԰কͺäघশ؎ૌƇࡘχଞॅݗЭ༠ǝ"],["@@нϿሎʬୠщॊіސ˟یࠛфΒ׭ࡰ݊Ŭ࠲Ƈश͹ՆࠉʼץථеະЉĝσൡã՚͓˱ູ̯Ƃฃɪঋ»ཅ˷ᒃű๻āҕІଫɮݙģਛږ֔ĚಘƜஈ›રƦྷȞᅗã஗jѷ̴ዎͲಗ[ืɚ۶ـגͮᖬԠ࡬Nj"],["@@݉ևಹך˸Ş૸’ٔȁ"],["@@öɵࢿ|ࣟjࣿőʑ¼ऍѾ˜̠ИÈነěชң"],["@@ڎԽޤڴᒆΈ෺ࢅůջဒʒߒͮሀыୄЏŊν༚Ȑ࢘՗᎐ܸͩ͹ߐ޻໯ϹጘչೲȁீޙೖÇʽכ้ঋਗά೓߲ઙĿŁӕࢪӥଜϯΌɟմࠩ́׿੕ɪᑏڨஎܣ࢔ԕƎ̉ᗱͲᅩӤ৳Ц̌ʂయќ௥Т`ʑᝡƅ܃˾ֆؤ཈dႸņ˫̜̊оચࠊɳϊ͕˾౿Рၳ˺՞ɆࢷԺ݋´ڏ˸҇ʛ຿ŅᵝȈᄫʚഹŴۥ̐࢞Ϧ஝Hˉ࡚٦ݨࡺ΄ᓪɢأի"],["@@৊ǯຄńɖʑ޷Е౜αƱݳ൝͗߳ê׉͎ᐡٮjˎ႖ĽएռসР"],["@@࣓عय़ŒԽ݆`кѮΨ࠰ɮც‡ྈȱళݟ৉Ǎ"],["@@ᕍЙѷςኹѺήΤ׌ؘܰւࠑԦᭊƀ஬ǧᒰ±ࠄʑࣖΝ੍ɃᏝןਫי@ν"],["@@ҙ͙௝Øৱɖ҂Ϛீɨܼ̬̍ˇ"],["@@ٞϵ€љϣس൱đࣗƈjӬ൝ÝÁٮࣜౌ˺ஂµÜŎ"],["@@̙͢ݠƘࢢ™ƪЩԝЋ᭗Žᑯη౩mŅ˜პϊ④ij୯Ʈପࠐ߈ɾᛄ˳๶ӻฺÛறߨޔ̪ࢄĭ˲Џ"],["@@ढ˓ကFܨˡȑ́८ȍՔȧଊ™௬ë೸ǼႊðീÏ࣒ͅȊ΍ԽɟభǷ੽ĸᜱŻႫcഫļᖁ˔̃ҦĹжࡇξ჋ĺঅʼ͂ΈႾÁ"],["@@ŗ٣٩̇޹£༝Ϋ഍ŹଗǼ@@ුؼႮծಆ[ସŬ"],["@@ϣy༽Âɡɼၜ]מƻĵĩ"],["@@༩ʋఝ˔ڼˎ௮Đஈſ˩ʥ"],["@@৽ǏඉBbŤࡴʦҌદǝ"],["@@కǥۃȚέ͂áΎજ‘ӪÅ৐̇ɫ̣"],["@@͜Ε൏Ĥ൩˘ሏŒߺʠ৫ȮÕ͐࿶ŕᗢ̫ٞЍ"],["@@০˕ଽʟ༇ك๥Óდņࣗ΄^̦ڔɢ໡Oए˨ՑϠ׌ώ׊ʲࡴÎοȖዜ¨੶҅මǵ൞ǃڒև"],["@@ᖢßᅮŅ໤ɫ™ɡᏅη᎙ǟݻȉᆬJጡԙേʃ෯ۇႿƓՙǡᡷěୈĿׇƭ۞бߙ˽ಛʃЋ͡୫ʣŞȏ෬lȳᖟԋᔧɴឿŻధĸཟªĿЖ༊Ȑб؆ԢÐᖤγ଩բഹLjڼ͘๰Ȩʄ̊஋͠ΥѠᘞ—ڒĝ಼̪ቃĬ᰽Á๣˸۩ͼগʘȁ˺దLjঘ‚࿲ƌం̺ਬ©ࣤɽٔҒૐƈບĢᢲ–Ҁĝ᝚ƚᆔÁᆒÁ"]],encodeOffsets:[[[-65192,47668]],[[-63289,50284]],[[-126474,49675]],[[-57481,51904]],[[-135895,55337]],[[-81168,63651]],[[-83863,64216]],[[-87205,67234]],[[-77686,68761]],[[-97943,70767]],[[-92720,71166]],[[-116907,74877]],[[-107008,75183]],[[-78172,74858]],[[-88639,74914]],[[-102764,75617]],[[-95433,74519]],[[-123351,73097]],[[-95859,76780]],[[-100864,78562]],[[-110808,78031]],[[-96956,78949]],[[-118987,79509]],[[-96092,79381]],[[-112831,79562]],[[-112295,80489]],[[-98130,79931]],[[-102461,80205]],[[-89108,81572]],[[-70144,85101]]]}},{type:"Feature",id:"CHE",properties:{name:"Switzerland"},geometry:{type:"Polygon",coordinates:["@@ƫŹȳϞƵіwá΅χƙةŀǻ͹ЏơƄһ˵Л¡αǶ˽ςБſ^ϠؚҾɈϤûɲƞ܎MǦǼ࣒ʱ"],encodeOffsets:[[9825,48666]]}},{type:"Feature",id:"CHL",properties:{name:"Chile"},geometry:{type:"MultiPolygon",coordinates:[["@@Bም࣒@Ԓw˧ͻܛʻЭ‚ӻä؏ʨ࢟ŨੑҸ࡫Ҏୃशۘǭ୼֗૜̟ѢϬ˘ֺޠΎװı"],["@@͢୅؆ŘĺɁ˿ࢍࣵг€ඓǫ˓ʦ͡ץԹջ߁̛ރĀ߿ԫࡹϮฏɔƵCޛӑࠍpۯٍշFޙʮࠏԉ̧ɣݡȟࡱƚ৿ͷǡȞॹϜ͇ˡΛ϶ǙĚ̓νǃĜӱ̫૗ѽܓĮыˇՑ٣υôࢹ̧̐֔ÄgؽΒө᎔őުſݝPЙȷݷ̣Ɖ޹Σoॅ˚१ג@@ਲ਼ӔˁՒʄӰх֒Ņ෤Φ߰ࢴٰౣʔߞݒ˸ඊत̏Ѯგ֝ɠʿ਻ՉŠ˂ல˺༒ϮָʍࠎéूΠ„Ԩപ׈എΤబȗ఼ʤۚĵਞӮਆưྺ˒ნˀሤÕ൘ǩ஄ќɌɦњЬֱŐ؅ѴΡ˅߽Ҍह"]],encodeOffsets:[[[-70281,-53899]],[[-69857,-22010]]]}},{type:"Feature",id:"CHN",properties:{name:"China"},geometry:{type:"MultiPolygon",coordinates:[["@@ԑഓΫۏѷ܂ĩخӶࠜڦَϨʡƣԓ","@@ܩЗۏʺyܢаϠࣾɾӚoȊ͍σσșӟ"],["@@ฬˍ঺ׯͼ߃౨Cܰͨ൸ʜѳݱ͙̭˽ः֡ࠇ৵ƪܝ̑ɜܙť঳ѕwLяթӺͯһಙαƀѹܩŒЍ˂ֽ׭ऑҋۃա୭ʑأϽࣝɭ҂ϴǭ͞ږ֠ѹѲܷ̓ॉ׏ԫթ࠙¡ѓϻѸ֩یƏ„ϕڔʕस׶ݚ͝լuƌѱஓɻϻҏࠇућיࣜҥͦࠝԞޓ֮٥_دՅɯȪ҃ӶʻŻۃɇڗҷ÷ؗࣧڹિޭোିޡୟۻृĩԣύ̃˘Ӈй୭сࢵŹ˻ࢱҭ·ə؎Ȧ͘ૻːЇƍࡍɔЏ΀ƄӜޏƶЙܑ̀҃ࠇīڡJ҉ȳѥūŶ॥҃x÷Ȣ}Ύ؝ʓεƸر͂ʔۤՏǎȧޜࢱƓĴাߔۮ”ۚ{٠νȨ˭ӶӭÙࣟŲ˴ΜϿԺ׳Ν۵ȸॷ՗އسڳĿοɦѹr׷Țґɇ֋رëڌԟǭওĈोȖڿτٵǔ˯ЖҽŦࡓոکʴΑȩଢ଼טࠛՒɽऐ׾ő‚іͭјĐۆࣙঠ൧ͼʝ٦ةϼƫʌųӎˆ͜ԛȔ˟ďɇިʈȔśȠߤЈ׈ǐࢸő͆՜ંIJͮ̚೜ҔŠȐãӐּɔݱฦဘͲјȈ؆ຒဠˡҲϞ¢ࡆۦĀٖ֔͢èɚו۸ѽப̿׆ڱ͕ঙ̢ηূƝଆŝ৪ԻԲġϤޟӲӿऒnჄȉ૤Ŝࠦůఔԛ৮BόʽঐҌബ̈ాŒঘ̒׾҈ך˰Ƌˤˍ͔ѴըӀùࡺǝ࠸Ѿ౲͚؞֊נʆ௠ŐڐĥĠ̘ݿזګː٥̳ࠣžӇŃɏΆר࠾Цو৚̓ஆՎQτݸࢾҲːWҪңȦۜмਰƲ૜vసʡ݈̱԰ࡏ̀α̊ԩ̶ࠕ"]],encodeOffsets:[[[124701,24980],[112988,19127]],[[130722,50955]]]}},{type:"Feature",id:"CIV",properties:{name:"Ivory Coast"},geometry:{type:"Polygon",coordinates:["@@ϣUוǒ՟Wহƥ׍ʍ̯ࠫNjvÞۖĄŀ}ͨΣΚˉÈʕɲǾώčО ʔƄB¸ξÝnjĄŜ̸ĶȹڨȗΎæ˸ǘÞŊúɸųٮOƸʖƢgʎĦžΫȞłΌŰϚǽƦ˥Ϙǯ̎ɄϾŒֺɏɠ஡Ο۷ɕेθܣ›ͧ"],encodeOffsets:[[-2924,5115]]}},{type:"Feature",id:"CMR",properties:{name:"Cameroon"},geometry:{type:"Polygon",coordinates:["@@Ľ°ӻŇԝŒЋÅ൅nŬڒ͟֊ϧƚǟϖɋŦXɶɎתЎ߸ʒRԄӮ͈bҾΉ־˲ĀΔȌͺžь҆ΊǞךDzȊŢѨɜ՚۾ٲ¬˨ĠƲͫͰ‚ˌʂ¶ͮ՟Ê֏‹֏ҜޅҷTʁÏϥČǻЅӸөμƛŠΏˆ׃ſɩх࡛ȫƳÝٳČΝåʡЈѭð̴̟џϨ˓œϥĘʏÓґڛȤڷɜ੗"],encodeOffsets:[[13390,2322]]}},{type:"Feature",id:"COD",properties:{name:"Democratic Republic of the Congo"},geometry:{type:"Polygon",coordinates:["@@»ঙͶŕˑ̗͓ɟ͍ѫǯϷ±ګț͍Oهʍɹ‹ԃŗÝýҟɄϡÂ৥ưޝċѧǘӣӤҹҒ੕ͥĒ૿ƙɣĵʇՙȊχƫষĻࡇɨƫט͝ɲƴìٟࣟR·Ҧ̳ΨٟŠȋѰԣ˅ڧŞ˫ϢՕüϽqµʾ́rϥºԳųιtȻû®ৄ˩̸ÕԬŬԒǝ͖eՊ৳Qò̢ѕG­ƣԵɁӧűȿҫŠˣş։å͏Ѱȗ˖ʋԌȷض៛\\̍ķʑh΋œşʼɊʀμƎɎ̪ǰɚđ˼͐ҜSÄʃ̼ƩӶՄӨШɆːƒ۔θࠆϬўքМĪˌt̰Ǝ̆«ӊŀݖǐԾʦ҈¸Ԕúה͜ѐҊ˔۔˷՘ؚ̳ĉظǏʦԖŘÞϦčनоͨDZ˖~ŴȲ̺ðلėբoˤĚԘۙϘķɤƖϲÅҶDzȦΫ݊֏"],encodeOffsets:[[31574,3594]]}},{type:"Feature",id:"COG",properties:{name:"Republic of the Congo"},geometry:{type:"Polygon",coordinates:["@@̿˾ʩƗͻγۏࢸٖҪ̓֌˾ɂ֦ĺäό҆Зݐ•ʴЈł֒ĝڀЉӺζ঄ȽǘسçɻѢÔξ੘ڸɛڜȣÔҒѰ޲ԆѼ֪Ɨդ±·ԓʥ҇ǏԽĿݕ¬Ӊƍ̅s̯ĩˋփЛϫѝηࠅ„ۓɅˏӧЧӵՃ̻ƪÃʄқT˻͏əĒ"],encodeOffsets:[[13308,-4895]]}},{type:"Feature",id:"COL",properties:{name:"Colombia"},geometry:{type:"Polygon",coordinates:["@@ΫȤЭ˨ʅƅ܉Ŝȱΰƽ_࠿Ӓŕʺ̼ڛтȢ̦иÊΞՆ͐Ѵ̳ȦDŽӦȏސǸɚƃ܄ͻ҄ņТ˔ÑǂʠțӶĺŬѢـהΌĚT˦ƺ܂ӖϸՊfäǪڂéڌъ͞ȊОК̖»ɚɛǍ˱գƕɇп͗ʋʓ̷Ĺ׵ɷӭѢÇņϭȄȁâ͹ij̵ˆǫȸéȨ̉ઊĄӦŃעܡͼĚ؂­ӐĪ̔ƟƱҍȇ˯ß׻ǜ֑ʆʟ†ȉэл̨ȃɠ̋ʰ࠹ǁĻǏӸɷˊ˥́࿕lZԿӰē…͏ǙĔҿƑK؏ώ̫ƀӓoηϙᘯп҂ʣpժࡤٟϾԍị̈ƤҧɝصŀӵࢤϳɐˍІ֑Њɡā"],encodeOffsets:[[-77182,-155]]}},{type:"Feature",id:"CRI",properties:{name:"Costa Rica"},geometry:{type:"Polygon",coordinates:["@@җȆǟǮĬƤ‰ȄɷȪͥǔ́ņÅʖəƮÄʑǗȩȓɸˑĊŗǞLʮŎˆʁŠȖnjŴňֆɝȖŊˊéƔǥʜÇȪDzɈҙ͖ͷЂΩ͗õLͷǪűűıƱëǟ©Ǖ"],encodeOffsets:[[-84956,8423]]}},{type:"Feature",id:"CUB",properties:{name:"Cuba"},geometry:{type:"Polygon",coordinates:["@@ܨÑڊW߄˹̭ͮ޺Ĩ̔ȡ܈ԳԺϛˢ\\ԆǟÕʁئ“ٌ΅ıȟ֑Ń֡¥׃âளą֜Ҷ΁ɔէÈ̃ʐȥӎӃ޵ɦʥǬભž̋ǐ̀ɀࠗ¨׿ѧΏ[ťȳеğΫĂѺʸǼ̤ϞȈіǎَĄȰĢ"],encodeOffsets:[[-84242,23746]]}},{type:"Feature",id:"-99",properties:{name:"Northern Cyprus"},geometry:{type:"Polygon",coordinates:["@@ÐJŨȮ؄Yކʢ֧ΧÔƿęˆLJÙűj¥iĎѾNjVɫïƿ¬"],encodeOffsets:[[33518,35984]]}},{type:"Feature",id:"CYP",properties:{name:"Cyprus"},geometry:{type:"Polygon",coordinates:["@@€ãࡱͿЩŊȟͶЎŒǀ«ɬðnjUÒ½j覎ŲiLjÚ̇"],encodeOffsets:[[34789,35900]]}},{type:"Feature",id:"CZE",properties:{name:"Czech Republic"},geometry:{type:"Polygon",coordinates:["@@ϯǂЁ©ٵʲ̏Ùҿ΅ر˔ӃΰѕȬėΠƧʠؒǾ̸Ⱦ׾ǎɂdžɜīϒĖЊ˓ؼñ¿ɳҘǧŲɒּĥĄʿز»ϮЯʡCŽƯȕ—ÅȑLJ¡wý˹ēϋbšȁ"],encodeOffsets:[[17368,49764]]}},{type:"Feature",id:"DEU",properties:{name:"Germany"},geometry:{type:"Polygon",coordinates:["@@d͗ࡔțS̗ࡢǂҾɰॊͧІˋȞёɹɣ̨̙Ⱥ҅ß́Έ՛ϑĕɛĬɁDž׽Ǎ̷ȽؑǽƨʟĘΟіȫӄί̑ϯ̟ŃŢշýƛʿǤЕ~׷ƭݍ–ţɛыɺʩ±࣑ʲǥǻ܍Nń״ьֺ௅ƸЇɘ´ςǗȐĨ֨ƗࢢԎ@Ɉ͂Ⱦޔƿ˴ǐDz۰°Ƽȃ֮вȓ̀ӈٌōՠŸ"],encodeOffsets:[[10161,56303]]}},{type:"Feature",id:"DJI",properties:{name:"Djibouti"},geometry:{type:"Polygon",coordinates:["@@ȤʹΑӏȩήɯ̱҇ȅƬȭÏҷb_ʮßɶ˴Ѐ̐ϊήñʪȴ"],encodeOffsets:[[44116,13005]]}},{type:"Feature",id:"DNK",properties:{name:"Denmark"},geometry:{type:"MultiPolygon",coordinates:[["@@ԋڹ࢟ӄŝΒ௼˨ˎу"],["@@ȵ̓ʡĞ؁؁ɮХ՟ŷًŎͽҲ}࡬Ɣɪʌʦ݌À̐ɴڮʂƒѝʟ˙ĶɽҘŵ"]],encodeOffsets:[[[12995,56945]],[[11175,57814]]]}},{type:"Feature",id:"DOM",properties:{name:"Dominican Republic"},geometry:{type:"Polygon",coordinates:["@@ŀƞپIӾɏɜtƴ̕Ҡhʡϐ‰Ю̷̯ͿЍǼϫ•ˡ¢ƱƵ͑½ŷȲˣťͳֻɏƆ§ʎjɬɍʦȲƚÞ͒óҜ"],encodeOffsets:[[-73433,20188]]}},{type:"Feature",id:"DZA",properties:{name:"Algeria"},geometry:{type:"Polygon",coordinates:["@@ᮩཽᝩ࿷இϑटćU՘ϵƌԹʊȧЀᬻᆴᬻᆴṕᎠfnj@ÊQ঺ബب࠼Ÿێɦ͎тচͪ˜جӢòϞ̶સƚƸ͜ɛDz̃ࢲ¹Ԟ́ՠ߰ҠࣦƢՌΎ߶ʰ෎Ƭർæшůߊͨ࣌P΀ȝֺ¾ǟћƄߟȡۙԭҵôمۊԃRȯԮ͹Ϊຝ˖ݏ°ϵƧۇÔϥŃҟòՇͫΗӺؓŽέ̘ҵϼƸڒϷςՃ"],encodeOffsets:[[12288,24035]]}},{type:"Feature",id:"ECU",properties:{name:"Ecuador"},geometry:{type:"Polygon",coordinates:["@@҂غǻξ͍ϵԉςǞʀƙބ̎ŴƺԼ͆զÍ΄ҢǸ׀Ͱࡀӑƾ`Ȳί܊śʆƆЮ˧άȣŞٓʽճࣷ࢟য়ͧԥܵǃ֣Ӆ΋ΙъͻĞ΍áw̮ʈȨıΔ"],encodeOffsets:[[-82229,-3486]]}},{type:"Feature",id:"EGY",properties:{name:"Egypt"},geometry:{type:"Polygon",coordinates:["@@ɽͷǹىɫѩȝƥ˩˔ϛϒ׵ஸđùΐࢯԪࡋٌವ̴ҙ˒ӃݮछǗƣ‚ճ঒ݭƨǣΏ@Ὁ@⁩@@ᶶ@Ჴʥڲɐ԰Żά̤Ж૦b߲ɝ࠲ʛϴſ٨ˊΌʊݎêװŃɮеȜ˜ڨȣټ³аɄւ෽"],encodeOffsets:[[35761,30210]]}},{type:"Feature",id:"ERI",properties:{name:"Eritrea"},geometry:{type:"Polygon",coordinates:["@@˻˖ΉӰϋ˒ɏܷ̄ͶֻXȭǬӯȡԛϢʽط঑ǬęʹβఀĊ֒ˆʴؤƐьӒӦঃɴޗҢУବߏҲӍҖӝˀ˿аʧʩȳέò"],encodeOffsets:[[43368,12844]]}},{type:"Feature",id:"ESP",properties:{name:"Spain"},geometry:{type:"Polygon",coordinates:["@@¦״΃θஒ؆ਊƱ૾NࣂƝۦªമƒͰ͛໺ϡ̨ǺीϝআŊ®ӥߓ֓ઁǯõ˱ԩү͕ہ͞ӑӟϑǹճىǗש٥੧_ߟhՃ͍̓ͅЩê̵˴ʃӚ޷žé˦̶̀Śɬ̃ʢɶրͳԌδè’ЈƎŬZپϲɪɻфөˆƝŁӹCɁЬ΃ū̥ɇ"],encodeOffsets:[[-9251,42886]]}},{type:"Feature",id:"EST",properties:{name:"Estonia"},geometry:{type:"Polygon",coordinates:["@@ĮӸ̱ŁՓ̘ñӘਫ਼ɼ੔Ũ࣮Ƒࢂ|Ŵƣׯӝʞ޵ΫˉۙDܡ̸ρļ܏Ʃ"],encodeOffsets:[[24897,59181]]}},{type:"Feature",id:"ETH",properties:{name:"Ethiopia"},geometry:{type:"Polygon",coordinates:["@@ԜϡӰȢȮǫּWܸ͵ɐ̃όˑΊӯ˼˕̏ω˳Ͽàɵ`ʭҸaȮÐȆƫǽ̴̕ҧ̴Й̛͎ᩨঽۺNᛛᡃફ™ݟףաeɯ˅ַB͹˴ލΙʝΓ֕àȃĬȟwˇT੟܌ב@˹ˢ@ҾѧƘӻࣴϥȚƧʹэЦԧÒ˸ӐҀrŲʰ[ݲʞࢠЊɾĎ΄ήٜԔи΀ࠠƆܠ঒ǫʾظ"],encodeOffsets:[[38816,15319]]}},{type:"Feature",id:"FIN",properties:{name:"Finland"},geometry:{type:"Polygon",coordinates:["@@ūיಀ֓ޡى঎ख़֡ܛݴس΅յఘֻ́ѓޭӟᅡੵໃá๑̯ൃǯӡҞ߿ˠȈࠢСݶАӪނՆ኎࣮֖Ǭē΢ୟЈ˳͜uಒ಻ֲ૩ЪԊɞतѻલ¦ࣘȭߠϊЬ؞ಬ˶઄ͯΡכ"],encodeOffsets:[[29279,70723]]}},{type:"Feature",id:"FJI",properties:{name:"Fiji"},geometry:{type:"MultiPolygon",coordinates:[["@@̂ʍƓѭԳŗҩļąτ͖̀ϤĻȼƐ"],["@@՛ǯŅ̼оǤˊ°Ӱˀ@ЧՕȷ"],["@@é­@ШǨžĽЗ"]],encodeOffsets:[[[182655,-17756]],[[183669,-17204]],[[-184235,-16897]]]}},{type:"Feature",id:"FLK",properties:{name:"Falkland Islands"},geometry:{type:"Polygon",coordinates:["@@৘Ԍ܎ȿԌʹڦϙʥ̋ଋʥϙ̌܋ϙпϚ"],encodeOffsets:[[-62668,-53094]]}},{type:"Feature",id:"FRA",properties:{name:"France"},geometry:{type:"MultiPolygon",coordinates:[["@@ˣ٭ϡǠș֢ǜ̺ը͎Ɯܛ"],["@@הЅќà݀ϥȊñʎjЈɗெƷыֹŃ׳ɱƝϣü‚ɇؙҽ]ϟВƀ˾ρ“ʁʚ̿̅ʯɐٱҖŃĩηݿӅစɬ௧˗ĩԑঅʼnिϞ̧ǹ໹Ϣͯ͜ѢԎdžူࢁࢤإю౹͒čؖઠǾථɏˇॎߌέዠپʨێܾǞŪ̑ϸ_ϸ͵"]],encodeOffsets:[[[9790,43165]],[[3675,51589]]]}},{type:"Feature",id:"GAB",properties:{name:"Gabon"},geometry:{type:"Polygon",coordinates:["@@ࡹࡔ։ۚԙࢄ‚˨ǾˎȲؔǜخ˴¶௢SOৠЌÆԞőӼňľ¯ÓνɼѡشèȾǗεঃЊӹĞٿŁ֑ʳЇݏ–҅Иãϋ֥Ĺ˽Ɂ̈́֋ٕҩ"],encodeOffsets:[[11361,-4074]]}},{type:"Feature",id:"GBR",properties:{name:"United Kingdom"},geometry:{type:"MultiPolygon",coordinates:[["@@҉ֽًǦԱ[ǦҊǥ҈۴–ࣔԳ"],["@@࣋ࣧࡦŘऄIɕۅݯݩࢄÃäĕݠ঱ֺƇԬढ़ʈͧৰDžķ՝ѓʗͲѣݱѯ૳Rෝɱϻǒ։ϿޥĪם͍ҁǘ௼ࢨݪǺOBಽƔʃͰ࢜ʺҡҐdžռఢ÷D@ŮӤ֛Ԯ_\\৵ƨȧɬ̨ϒˡɴҍЇ·߶щє̨ࢆٶھڤá০ì"]],encodeOffsets:[[[-5797,55864]],[[-3077,60043]]]}},{type:"Feature",id:"GEO",properties:{name:"Georgia"},geometry:{type:"Polygon",coordinates:["@@Ųάȿִӟ̲ҭĬ̯ʴĺIJ܄ƝఆƋଦЕƦƻԚƂ޶ǭʴ·Նșɓřвғŗıҏºصʎȵƍଢ଼ſ߳Юࣅ¡"],encodeOffsets:[[42552,42533]]}},{type:"Feature",id:"GHA",properties:{name:"Ghana"},geometry:{type:"Polygon",coordinates:["@@೉ӯҳ˽ݳʑݡʆœͨηܤɖैΠ۸ɟ஢ŗنrӊฤ¢ϊÕ˔ƊϴáÕʿΖџC؍Ąڍɂ̫ȅݳäйɢՓȈ̍"],encodeOffsets:[[1086,6072]]}},{type:"Feature",id:"GIN",properties:{name:"Guinea"},geometry:{type:"Polygon",coordinates:["@@ʃtǡͷʁJǏǴÈͶΗԨɕħǵmɳ³V̮Ƈɘ‚ʔǻΜɹ̜ڥDțǁɵoƝǷīɹ҅σρӼ͛͢ɋŊȿǖħϊūȂʓƐώЦʮeɖƘȄDƄŎï˨ĢĖd˶МU؀ȱȄlÚĤҜáŨ´¶̭ƆBɖŒƔƒɸɇάãɲǺ˖ŒȬŠǚuȈȁĴɳΆΙǣɏ˙ǴĊŀį«ʡʲʍǗÝå˷Ș΍Ⱥڧ̷ĵăśÞNj·νƃA"],encodeOffsets:[[-8641,7871]]}},{type:"Feature",id:"GMB",properties:{name:"Gambia"},geometry:{type:"Polygon",coordinates:["@@ņόࣶzȎȦˊ`ͨȷʼIˢƚǞʏεȋιdέǰ̷ȗƭQȫŝއl"],encodeOffsets:[[-17245,13468]]}},{type:"Feature",id:"GNB",properties:{name:"Guinea Bissau"},geometry:{type:"Polygon",coordinates:["@@҅ΘΝÈȕʀLŸʯǴÁǶѼƌ˦ɦĨ༈•c˵ġĕð˧ƃōȃCɕƗʭfύХ"],encodeOffsets:[[-15493,11306]]}},{type:"Feature",id:"GNQ",properties:{name:"Equatorial Guinea"},geometry:{type:"Polygon",coordinates:["@@ƿŴ़̀െmPয়௡T˳µ"],encodeOffsets:[[9721,1035]]}},{type:"Feature",id:"GRC",properties:{name:"Greece"},geometry:{type:"MultiPolygon",coordinates:[["@@Ҡ˱ٺ¶شÑqƣҜĶĿʛ௃íTƒਁǎƺΦ"],["@@ʹՁȥĥԟ|ѫĀৱɓ׌ҿяƋҳAѻўƿȁȊԅрЁ̓ǿҴϯжʑ^ӅޥɠʜѕՓĕ͈ݏ֏Yۍμ̿ڦƧ֒͝ϮљӐÉʆϸТ¼˚˘Ũjɚռö͌ȀҖgƒƦdž„ت{ڨɲע̉ކĀVмЦɝ"]],encodeOffsets:[[[24269,36562]],[[27243,42560]]]}},{type:"Feature",id:"GRL",properties:{name:"Greenland"},geometry:{type:"Polygon",coordinates:["@@ᬜԆ᱒›ੴ̴ᲈĄ䀦Ŀ㉊ڗ༅͕ộ™⭏ćшƫᲐĠᡚ́࿈ʴۦ̝इӧᒞ̺✘͚ᠼNjҾΫ⃝ױӃȕ᧑ơወ¡ছؕگկ€ध৚շಽ“൧ˇ༂ѽȢ܋࣍ýઞܡህÑঈ΁˟̑இŽ୥E੆֩\\Ϗပΐћɣଌȿ઼ԣ͈ڱກlj٫͖ਣӘ˼֭উѵᕖ•୆¯ᖯܵᗿڏឧ́ओIࢅ͓ୟࢱᅵכׅ“૧ȷ஽ȝܛԱ[כыտോڧͺٿϗ۝љࠍஅ½఍ۈဿLࠁҢ֕ࠐฝਲэոŗݮ୓ޢ̢ئ֗̒ࠪচొ̺ͨΘǬڀॡ̕қůݯţਏ˜Éְ͢҂ެ\\႔ɟ෿Քݩ˾࠷ş۫ȼम޴ԝ̺ڗ׈ৡࢼ੯͚XΚᖷӮᄻÖᖟ‘Ꮕ×ইˌวՈᕂ˄ၚ¬≹ɖ቉΄Ś͜ẊИᶎИ̪͘ᗗ̠ܺͰ᯲ז௢ĚΓϘጲɜᣚƂᣖRࣺʽᕺҨፘ̽୺áპ˙ፅҐŘή"],encodeOffsets:[[-47886,84612]]}},{type:"Feature",id:"GTM",properties:{name:"Guatemala"},geometry:{type:"Polygon",coordinates:["@@ћƦԻfϩǖҍΌrʖĮȠšƾКۆ઄Ft˸Ƌ¾ġǺ̵Ț̹ˬϜDBӂ޸BަUOڗßॅʤ@˚ƱòŰʘŃϥ͍ЉɻÏljâǑǧɇȟ½¬ıƿġ˽Ƀ}ŭ"],encodeOffsets:[[-92257,14065]]}},{type:"Feature",id:"GUF",properties:{name:"French Guiana"},geometry:{type:"Polygon",coordinates:["@@͉͑ГÑŗʀȉ–ʹɩνǦɈΪòϤƢή͛ӸáֺѪܠ˸ğؤȥࢸۿƔ·ӻޑʳأ"],encodeOffsets:[[-53817,2565]]}},{type:"Feature",id:"GUY",properties:{name:"Guyana"},geometry:{type:"Polygon",coordinates:["@@ր̯Դյzџ̈́o҈Чͪ̇Ƈݱԛɕ°ȣƹџϊ؏ːAŎӃԢܳȱ‰ҫî˙ɡϟƥ˅—ġǑЭ¦ԫЀÓϴɋьƆܐɸ̐ȕϸ˿ŶŊτțȘѩ™ْ֩ɬɲiϲԬƊȾƾ˽̸ô̬ږӲ"],encodeOffsets:[[-61192,8568]]}},{type:"Feature",id:"HND",properties:{name:"Honduras"},geometry:{type:"Polygon",coordinates:["@@ơˀʭòÐʹŗĞǣÒσij‹ŔʩƈǷǚʛìǨɈáǒÐNJЊɼϦ͎ĔȂƨʊ\\þ垦ϸùϲv˒ĢİĦˎ©ȪÉɘnǖòϨśƄkʲƿʐį̏Źɜɳ˽jśŕ̇ŋɃAȅŃǙœƛźĕ{ŇȩăRaǥ̉ɳƹıđĽʛǞǹɣǫPȟqlЭūQĿȓʽ“"],encodeOffsets:[[-89412,13297]]}},{type:"Feature",id:"HRV",properties:{name:"Croatia"},geometry:{type:"Polygon",coordinates:["@@Ȳ͗ˊʇ͓̓ϝȆׇ[ܟƔϽmǻǧ̝ȖǫΑЪϽǼʹϮ̽͌ȃ͆Ηݔ͇ġƛ߃̶ӣ̢ޑʠ۹ؤǞØϥΞe˲եƄʱγʝˮn̆Šbג…Ƹƚ˸ƍͤgGɼ̈ĒĈͺڞɠˊĻؼέۜlj̼Ų"],encodeOffsets:[[19282,47011]]}},{type:"Feature",id:"HTI",properties:{name:"Haiti"},geometry:{type:"Polygon",coordinates:["@@Ԣ™ܰƁôқÝ͑ȱƙɎʥiɫ֏ƜЅÍԡÔϽƿ҉ʾö˔ޜśيã̢ȈϧθP͎ՋžȌɶ"],encodeOffsets:[[-74946,20394]]}},{type:"Feature",id:"HUN",properties:{name:"Hungary"},geometry:{type:"Polygon",coordinates:["@@˨ըǍǼӂDÜ΄ђɋ̲ğ۸ļäǚͮ~ЦžĜÃЂŀȠȢˠ¼࣒ʭǴĒҲɭÎɣԡǭЉ֫ԕ֭کǁԽš١ə̻űۛNJػήˉļǍ˴ƗV"],encodeOffsets:[[16592,47977]]}},{type:"Feature",id:"IDN",properties:{name:"Indonesia"},geometry:{type:"MultiPolygon",coordinates:[["@@Λe૝ך޴ǒѴʭ̎ʭ»ɩ"],["@@ܙȁijĶø˸ΰԢࠨͬĐǓfʫշع"],["@@̢ɣԲèȼΥॿǛ׉őҍP̀ӚҤPɤ̖"],["@@ūұ౅ʅૣľE̬ښǪՂʥ֔Üݬ̮"],["@@ྔċȂΌ༘З̪կీƵਐӿय़͋ऍ͸ݻwࢍØ޻ưঅ͎؝ČΓŁ໕ΌƣΰޑØּߤ৶·ڴ͡ΒÛŘ̗"],["@@ѝֱćنƬ̠Ǭ˴ȒʗCЏ"],["@@̿˥ׅƸǏΰࡘ¢Ⱦˣ"],["@@̨ٝۿΌۯìӃÅׇˆȦҦਠ”ऎʕ"],["@@ɼയ࢈ԉ۰ࢼ८ԔݜBܘ̉خ̛ࣘLJbᩑbᩑݟې࡟ǜȷʇ੡}ΦۂՈɺɕࣲЕ۸࿃܆ۗêృަʛУ͑óȏ̮GκٛЮ̢ࣞ״gëɠ௵DͩԄݥƺΡдଈȰњ˜ഘ·Ƃ̹"],["@@ڭ࠭كlj߱ǐඓ¥ܽŧţٍݪݛҒϠ༪˸çϯλŪιӯ͙݉ߒ੿Ƶ˿ݲॻQտ҅ʙ̐͡Мی࠙͗ȻɶŊ͖؅ӲØࠌ֕ʭîও”றՓũίʚʌޜŽ߸ΛPʻֺΎվŤښф౎ǮΎ܎ذپʛ੖śॴ–ࠨ؎Ʀȉ"],["@@©ܽџĈŷԝΌѷɽĵ͹Ւʟ੺ǚڤ˨̨ÔҝӸóĀ΃"],["@@सާহį˫ֵšݿַ߱u࠷͕౻ŭ̚ॕϙͫԤ׳´лːৃ̟̩Оս¯ۗĬŹૺнɺЕܘŝ݀ĮުԂ֐Ɩָ֗ӅըǠ՜ÑӪъЖôߒɽۆǶњୠ͔̈̆क़ॲ@ܰƙӍݷآߓơϭ"],["@@छkۻ۰અۊέԚٍۄзؾٕ୴۪݅ʙܠ̳ڀݵՊѭܘمҺࢗऒóђզ‘ಢNjݔࠓٮ֫ҪΓߔࣙࡢ_ۺֹӠ۳٘ϥͳۉӖ̞̅sƜו̊ҵؠõФՏɁ਱‘ಟ"]],encodeOffsets:[[[123613,-10485]],[[127423,-10383]],[[120730,-8289]],[[125854,-8288]],[[111231,-6940]],[[137959,-6363]],[[130304,-3542]],[[133603,-3168]],[[137363,-1179]],[[128247,1454]],[[131777,1160]],[[120705,1872]],[[108358,-5992]]]}},{type:"Feature",id:"IND",properties:{name:"India"},geometry:{type:"Polygon",coordinates:["@@ࣚটďۅͮїѕ׽ŒɾएࠜՑ୞חՑϟ͛޻ࠀͅߊЭરһସʼnӜёٮāৠȝ۪bĪͪŋՖÞβԠǮìڋlǙކ͉Ոƀ܀Çۈ|ÐԪ΁ˎڴŀވشॸ՘۶ȷ״ΞЀԹ˳Λ࣠űÜ͇̍Ʒèԫ׷Ʋછׅ~ӓҩ۵§ХϏۗځȒࢇȏ˹ĚΣгȥѵ೰ɵEƍ՝ҡѦʸӎϖ¶ϰ܆ӝƜީ]ߝŚóאБ¤ڕζ֭̓؆ѻԿ̻ȅ̩Ԭɣƛԑ̆كžەţֱ̫Zਛǩ´ك҃ӻ௃֡ळ঩كՋ࠷ջCϭлȹݳ̝Ͻ«ʥٙǪધ®ۡΣߙI෗ѣ¡ϣٙʰˣދʃ˱֯͵ʍߑ޸ϳ୴͑ࡒ̍Јѿ߰ȻੂơՀޅ଼Α࿀ʣ੾HৰǍ޾௣ԉףĶ઱৲И̤ʝͤড܊֖֔ᇜCǗܞҽюĩ٨ջϘऒࢢঊÙ࢞ࢢՄ࡞ࠄࡈ_״ܒӠڳд֪݂̇̕Ьβ౤ȱपŰߺ۸"],encodeOffsets:[[79706,36346]]}},{type:"Feature",id:"IRL",properties:{name:"Ireland"},geometry:{type:"Polygon",coordinates:["@@ƒ׷ًݣ๯ӹ஑Ŷڼ࢚ѭࡢତڄٌϼǦ҇ǥ҉Բ\\ٌǥ"],encodeOffsets:[[-6346,55161]]}},{type:"Feature",id:"IRN",properties:{name:"Iran"},geometry:{type:"Polygon",coordinates:["@@݈njװӔ֚{τƾװýघэڤğ।ݓظ‰òۻ΁਷ɱؑκŭΫҡˠڡàՓِƙæեݿݿжѵ͸ԓߦυx݉ДƋêϯ௉ѡ̓উཌྷʪࣷȖेŊΧਐЕƪ٣ƭࡑНਇ˦ࡑ٦߳ʈ֗ߘا૪ҍƋՕ˦̻͝ҭѴS҂ˍ@Ɛ،ѝٔ਍Ң׉ߜȜپц̂ÙӬտʨխ৊ҟڨǐʼʿ६ּʈƄͅъϯ־ő̤~রئ̀Øʞʙ́гԼѱȾ¦ˈإߖǩ׎у஠ƟಾɞĄȞ"],encodeOffsets:[[55216,38092]]}},{type:"Feature",id:"IRQ",properties:{name:"Iraq"},geometry:{type:"Polygon",coordinates:["@@րʧÚӫх́țٽ׊ߛ਎ҡўٓƏ؋ˎ@TҁҮѳӿ¤֟ê؝߭༟äᛍၖఫךৡɪ͹৾ᇶ࢔͆৬āؘҢȺјԾΰž঎Ň̐ɉЖƚծ৉"],encodeOffsets:[[46511,36842]]}},{type:"Feature",id:"ISL",properties:{name:"Iceland"},geometry:{type:"Polygon",coordinates:["@@șիॊֵથٙᝓֹܣƵૉŮᚑˈࠠψᆧЪ๪ǎ—ʘᄋȜ֨նౠŰಸ֭౨Ҝ੒ʃൌ҄ආÑ"],encodeOffsets:[[-14856,68051]]}},{type:"Feature",id:"ISR",properties:{name:"Israel"},geometry:{type:"Polygon",coordinates:["@@ƥ˅̣Ŝǫ֓ɂĥɋř—ɛЄŖp͛нഉց෾ʔˢ˶ɞϼǠيŤɆzVˬCþƦɤ\\`·ŕŵhM"],encodeOffsets:[[36578,33495]]}},{type:"Feature",id:"ITA",properties:{name:"Italy"},geometry:{type:"MultiPolygon",coordinates:[["@@̟ڋŲʹǭѝٝ̈́ёĞ୩ѐŞќজûࡪĠْò"],["@@Ԍ׭ş૕ϣÂ΁˫͇ɞ‘২ȓӒҨ¥рʼ"],["@@ரɏĝЯȬΧڝŪہ̗²зĻʇˠё߀чцۛदڱچLȲȃɽǗݪ̥ؠʩܜѫĔƿƽ̛үϼܳƐΝի؈̷ıѫΗ¹҅ܛΕÝHʲǢҊǼǶ͝ӤʱшΑŀʛδգƴεͶثÆٿϜޑմ֯ӜʿࠪйĮہˤϯŕӝϵΓÕĪθҕńɏٲ̆ʰʙ̀”ʂβǵМ¢Ҽ˶ƢƃА€ǼͺتĿψƚâΆԘšĮdžࠨƤȊ̉"]],encodeOffsets:[[[15893,39149]],[[9432,42200]],[[12674,47890]]]}},{type:"Feature",id:"JAM",properties:{name:"Jamaica"},geometry:{type:"Polygon",coordinates:["@@֢÷ҀȫƔɯןeʭƗҹƊӑ̪ĶȔΜÎȒƒ"],encodeOffsets:[[-79431,18935]]}},{type:"Feature",id:"JOR",properties:{name:"Jordan"},geometry:{type:"Polygon",coordinates:["@@Ʀˆपͫ࿪ࣆͺ৽Džų၅у࠸࠿ˣƛƑ˭ٙřȩ̡εʵधƆƒŨоഊo͜Ůʚ@Ԥ"],encodeOffsets:[[36399,33172]]}},{type:"Feature",id:"JPN",properties:{name:"Japan"},geometry:{type:"MultiPolygon",coordinates:[["@@ņ˽ҿԕΉːљțɝӭշʈRЊҬԆӌīΊΜؠǹ"],["@@́ڡƤсѩף੹Ѓ๏½ணॡ͔֡“غษȃষЃঝe࡞أ֗෗իΝН͜ȶݶՏʒͿ־ߐʶѲՈࡌѢ؞ָာʤ࣎ǣࢠ๺֔Б௾ࡀӌ͜ՈਈƟा΢ՎࣀƸҞୗ}ڻޥࡍbࢁ"],["@@נǵרΤȈहఝɯ݁࠱೓ָқँण]ř࠴д٨࣌²ʖ୐ʜټন࢓٤˯"]],encodeOffsets:[[[137870,34969]],[[144360,38034]],[[147365,45235]]]}},{type:"Feature",id:"KAZ",properties:{name:"Kazakhstan"},geometry:{type:"Polygon",coordinates:["@@ӕƹ્דο׹̹KɱЊ੫‚ǡێХNÚࡆ৓ؘ෷ßডũߣݶۋ͆ಥ׼ƽðᓗӹᶽљ£יچ֧ɼॕǩχ˧±ȲȶΖDž̊অ˺ϛݮҩɆ…˜ࠊāŽؘ܎ƎܼűƲࠎƭԲ࠿£܍ȴঃσ޵ǭяƌĐўՙ֘دw܉֬ӞِʕǢڢऊࡺӣŀؘჄࣴಾtᇢ׉঺ͻࢼΠ೰j੺ѥʔʠ୼—ɂЊഷ׀߮Цƿɮ߮ɔ؅ֺϬ˼Ḯ̈ШȺᑆ̴ݰΒຢǹ˄ࢉ࢚Ȳઆ˹éҝ߮´ᑌߎ̭ˁ੶٭ሠᒑ҄ѰୄӛீɎҪƯКӟטNjΨΥ઎ŒѾԣٕ֓ۥÿ¡ࡅұϝဟˢ؅ຑїȇဗͱݲลֻɓäӏԭŬу̠ఝĖඃx̧ġ஥ΞӉǧŽӹ൩̂փşȉρ"],encodeOffsets:[[72666,43281]]}},{type:"Feature",id:"KEN",properties:{name:"Kenya"},geometry:{type:"Polygon",coordinates:["@@ӾۙיͱȹΕ̿Õšףˑ͹Ǐ֑ͷ˥஻ࡀËӤᵁႌƙĢSࢺʊ;а֌̨ؔσ॰įтЉ׎ԬԈ֬ֆѨƗ@ҽ˺ˡג@੠܋ˈSȠxȄī֖ßʞΔގΚͺ˳ָAܽ॑Xᵣ"],encodeOffsets:[[41977,-878]]}},{type:"Feature",id:"KGZ",properties:{name:"Kyrgyzstan"},geometry:{type:"Polygon",coordinates:["@@ȊςքŠ൪́žӺӊǨ஦Ν̨Ģ඄wఞĕф̟Ԯūşȏ೛ғ̙ͭઁıͅ՛ࢷŒׇǏߣЇŜȟʇȓཟŵਡ˘࣫ÝĂӜࣴƕ̮ʸٖĉ੾؂঻ѸױȽإ͂۶ծʟĊ"],encodeOffsets:[[72666,43281]]}},{type:"Feature",id:"KHM",properties:{name:"Cambodia"},geometry:{type:"Polygon",coordinates:["@@΁Ѭыࢄȣ২ՠۨઘdž߀ťۚ͡Ϟׄݖ̱Ȝ֕Ļ৕ඳ٧τԙࢥÓܫͷ۱Ū"],encodeOffsets:[[105982,10888]]}},{type:"Feature",id:"KOR",properties:{name:"South Korea"},geometry:{type:"Polygon",coordinates:["@@ܨযȺխPॷ̓ҥݽljڥΏݳïĥҚƼـχ࢔ذƚֻܘÂúϒ‡͞Ϝצ¢ΨÈŨȮ"],encodeOffsets:[[131431,39539]]}},{type:"Feature",id:"CS-KM",properties:{name:"Kosovo"},geometry:{type:"Polygon",coordinates:["@@›ǣŃPĘ́ȩĐdzɦƾȌȪÒŜ˨ư²Ţşƾ¿ŌƅƒŸǎƻŢLĥȳijij„×ȉӹŻ"],encodeOffsets:[[21261,43062]]}},{type:"Feature",id:"KWT",properties:{name:"Kuwait"},geometry:{type:"Polygon",coordinates:["@@Ǭχõȓ˔هשuȽАݟĆ؞߮֠é"],encodeOffsets:[[49126,30696]]}},{type:"Feature",id:"LAO",properties:{name:"Laos"},geometry:{type:"Polygon",coordinates:["@@˚Ϝœ܆ڹܸ¿ٕࠦھٍÎǛ̉ӯyʣƨࢯԅoݬȸࢮ֧ž³ԎηʸǴ̲ܐնøȡ҄wŵ०ѦŬӮڏϖޅਚO͚ܹ՝ɗʉ̟৔ԉۦ঳Ռ݋َ׏ɄץƵ࠿ݕ̲ϝ׃ۙ͢"],encodeOffsets:[[107745,14616]]}},{type:"Feature",id:"LBN",properties:{name:"Lebanon"},geometry:{type:"Polygon",coordinates:["@@ɣ[ýƥ˫D̘ۄмעfˆϘ§Ɛͣқ̓ȷҟ"],encodeOffsets:[[36681,34077]]}},{type:"Feature",id:"LBR",properties:{name:"Liberia"},geometry:{type:"Polygon",coordinates:["@@ɗQࡽАޅٖ܏Ң֣ըȪː¬ʔϜҘϺϺǶnɖĨΘԧÇ͵ǐdzʂIǢ͸ʄsŸʓĎНǽύʖɱˊÇΤΙ~ͧăĿÝە"],encodeOffsets:[[-7897,4470]]}},{type:"Feature",id:"LBY",properties:{name:"Libya"},geometry:{type:"Polygon",coordinates:["@@ק̷ҿҤ೧βρՄڑϸϻƷ̗ҶήӹؔͬΘñՈńҠÓϦƨۈ¯϶˕ݐШȜðΠėΒ־͔ʶːЦʌ´٦দ́ΜðۮƓ૞ϓЀݛݮǍஆΙࣆйЦɔЖϮț٠˂Ф؄ЀׂŘ଒ǣ˺ϑ̺Iˌƛ࠴ıȲˣ̣ЕżΫɏԯʦڱ@Ჳ@ᶵ@့ॱGYΙ‧ྐ‧ྒࡓҟ"],encodeOffsets:[[15208,23412]]}},{type:"Feature",id:"LKA",properties:{name:"Sri Lanka"},geometry:{type:"Polygon",coordinates:["@@ų࢓ΙʇܵȓЍڜƫீϠ഼׆ұϺסО࢓"],encodeOffsets:[[83751,7704]]}},{type:"Feature",id:"LSO",properties:{name:"Lesotho"},geometry:{type:"Polygon",coordinates:["@@̆ʩʳУƛ˛ҳſƹˍ̛ċؿ٨҄ՐҖ͢ϼǠξʵ"],encodeOffsets:[[29674,-29650]]}},{type:"Feature",id:"LTU",properties:{name:"Lithuania"},geometry:{type:"Polygon",coordinates:["@@ãɊĚɲχƄࢡƨDZ۸२ʴඬÁࠜĊŞǩ҂Ã߲СĀϓۏˏșӃ࣯̓߻NȫʶљĜ"],encodeOffsets:[[23277,55632]]}},{type:"Feature",id:"LUX",properties:{name:"Luxembourg"},geometry:{type:"Polygon",coordinates:["@@ǘȏ³ρʍiȉòĞҼɖŽ"],encodeOffsets:[[6189,51332]]}},{type:"Feature",id:"LVA",properties:{name:"Latvia"},geometry:{type:"Polygon",coordinates:["@@†نЮՆߊ˼ڜعڪhNJ٤ܐƪςĻܢ̷ۚCКȕîС˒ӷ͕ࣗԛƙ߱ТҁÄŝǪࠛĉණÂ१ʳ"],encodeOffsets:[[21562,57376]]}},{type:"Feature",id:"MAR",properties:{name:"Morocco"},geometry:{type:"Polygon",coordinates:["@@ԒΥߜÎࢊȃκU͂՟ºԝ̄ࢱɜDZƷ͛ષƙϝ̵ӡñ—ثঙ͍ͩсۍɥ࠻ŷഫاRহŷ@@@p҉Ա˓ȑϡ@̥Ŋ۹ě˛ٻʿÕЁ੕ୟ࣡ˣୋ΅ϗĵ̡ቅãaD ϶͒ɮ˞ѪÃ˶̀פҴՖ˲ƊɞӬp҂̤Բ̪֔Ւ࡬f\\ц͔ްĢڎָтɠۮۮȿਸ਼͊ܢŔѶդ֨ࡈϦخΐ֘࢈˄ԪؤI"],encodeOffsets:[[-5318,36614]]}},{type:"Feature",id:"MDA",properties:{name:"Moldova"},geometry:{type:"Polygon",coordinates:["@@ȨŮ֒ĊؤʽΊϞɥÑ˵̪ƏŨΗ̊ɇÏűƾčɝ×ӷ|ĉŜǫãÒƭɱˍƥ˽ɁĝƯϦĘΪςӝԂˉΠʹʠʯĈ"],encodeOffsets:[[27259,49379]]}},{type:"Feature",id:"MDG",properties:{name:"Madagascar"},geometry:{type:"Polygon",coordinates:["@@ɠΥȺ։Ɗঢ়ɒϽĉЗƩʙ˷ӰǁʝLjثõΥɵȗ¿܅ͧওб୅ԯཧ͑ୟϛইہȣܻΡӛɊڙ̜ɳѺÇݘ̑ڠù؂Ʈ؄ϰƢD˪Дِø՚șЈǃՌãޠ̊ҺŔՒмŒҶǤ̶Ʋτ\\ӐӎۖԮʦцŗάΦĵҪ׎fԐ˦ϔ̊ί"],encodeOffsets:[[50733,-12769]]}},{type:"Feature",id:"MEX",properties:{name:"Mexico"},geometry:{type:"Polygon",coordinates:["@@͙݅ƥ؁Õ૷ąЧƤқʺЧǚٳ֎سȞӏ͢бࢾɝΐΙ݄ɾٚĎؼưՊƠՖ΂ȨӬè۸Ƣʖ֬ɚࢶȚݔ‡ԚîȬDZ…ЙҋԁȥԝƸƥűγɁٽɅɎǭcǃY̝ԓƳIJķPŭޥV޷AAӁϛC̺˫̶șĢǹƌ½s˷ઃEЙۅŢƽĭȟqʕ्ࣞџ˘ۇɖҷÓګ́чĉץɜؿDŽ޹ϬؿŠ्ϸ۱ВɃɤҹº࡯ˈΓϦࣗӊсՌȧЦ˪ĈđʈȖɔJ̄˱Ϙùͮ˭ъ݋࠴ࡋڀУԼܝ΄ƷȴŸԲѓȞӹФȽהҍæӣѸϿФ™ˀҍو̓٠^͔؇ͬ˫™ӑɴƇͿƔЕĆف̀΋خׁƒȡŸÓŎ˽Ƭ\\ǜթʮɇǴ̕Նё˨ޯʠρɸϿ²ѷКƒͶϡ̨ϑqƭΝ̱ƫJɛԞջӎ؃РїɈ„ؚŵҖЏʺֿϒŏŇɃɖԭȰӷӦÖÚΊ³̸̼ŽϜ٩׶ӱɶ̱Հ̷վϳڦͿݲॖÞ੪ĞÿǑ౔СኀףဪPژ@DΌผ@̪̕јˇԀσ˨ѭȾҥѢʩۤʥՊڒۊhפͱфֹ̄ӯӸӏȂחɾЃپʹ׮ȁ͞|"],encodeOffsets:[[-99471,26491]]}},{type:"Feature",id:"MKD",properties:{name:"Macedonia"},geometry:{type:"Polygon",coordinates:["@@ńOœǤӺżȊ˺¶ϴbтˏÒ։DžƒƑƥҕh͋ǿջõΑȴšήń˸"],encodeOffsets:[[21085,42860]]}},{type:"Feature",id:"MLI",properties:{name:"Mali"},geometry:{type:"Polygon",coordinates:["@@˰ƶƘӶˊpזɻӄǖ͖ÇŴȈ⁚^ȈךƣļЛ⋈Л⋆౾dᬼᆳᬼᆳȨϿԺʉ϶ƋV՗ठĈFካҟ֗íԭݛƃ଩ï̳̗ա՟IȿLjҥš޻ΑDžʿٳϕŗɍΙǡНŔɱȳūֻڙۡp˳ɭΣÆӥ΋ůȝŁŽάʍĥơhƷʕ٭PɷŴʼnùʱʎ¬ʢĿİdzĉ˚Ǥɐ΅ΚijɴȇȂǙvȫş˕őɱǹΫäɷɈƓ„ɕőƅAµ̮žʾí̽͘ʀǓӔԺ"],encodeOffsets:[[-12462,14968]]}},{type:"Feature",id:"MMR",properties:{name:"Myanmar"},geometry:{type:"Polygon",coordinates:["@@ӫηץ›ϥࣥΟƳО݅ՔؗΈօ̭ܵ̃ƹȪу֖ڙĪҷ_ϵ͠ދң޵Сࡷăذʴ٠˯ӼæࣸͽѤ˛৔Ʊਗ਼εۢօуॕ׳ҽöԳȠ̂ਪǫ޾څॺļ̢ӭņ׭ۆÅڰ̊ŵj׾дȦęΤȐ˺Ž࢈ڂȑϐۘ¨ЦҪ۶}Ӕજ׆׸ƱçԬ̎ƸÛ͈ӮÚˮӵξȧ|ٟ“ۙߓۭijঽࢲƔȨޛՐǍʓۣز́ζƷ؞ʔ~΍܏յdẕӓȗ"],encodeOffsets:[[101933,20672]]}},{type:"Feature",id:"MNE",properties:{name:"Montenegro"},geometry:{type:"Polygon",coordinates:["@@ÁǀηЯÊˋǫÞɽ˞εǖĢƜŬҦ˚ȜƾüɠƟŬśˠě͌ǧçïƽȋɧó"],encodeOffsets:[[20277,43521]]}},{type:"Feature",id:"MNG",properties:{name:"Mongolia"},geometry:{type:"Polygon",coordinates:["@@ࢮƢ྄ܤ౬Єܴʳ࢚]֘Ͻ࠼‰ௐɁࠈגͿӶࢊࢊश΍ނįনɍLjؿஜΛߐƺਫ਼ŌࡆōࠖЗԚѕެT੒Ƌޜȼૈƒ௸פԌĝѰ˭ৌêХهק࠽ɐ΅ӈńࠤŽ٦̴ڬˏހוğ̗ڏĦ௟ŏןʅ؝։౱͙࠷ѽࡹǞҿúѳէˎ͓ƌˣי˯׽҇গ̑ఽ‹ഫ̇এҋϋʾ৭AఓԜࠥŰૣśჃȊऑmӱԀϣޠԱĢ৩ԼଅŞুƞ̡θ͖চׅڲன̀۷Ѿəז"],encodeOffsets:[[89858,50481]]}},{type:"Feature",id:"MOZ",properties:{name:"Mozambique"},geometry:{type:"Polygon",coordinates:["@@لæ৞ʁɖńגt̚ʦԌaऀ͜ڞӤƊϕ“࠷ľ݅ಿƨЫʣ׷͙׍՗Եޏ͉ृСॉ͓ࣕƵוׯ΋ȗí׳ЌُǔӱZʣƪ¦{ࠗƋϷȤƝűΓΗ̗ۗ˳য়ҕρ̳ðΟɊÉíѵّRïϊůϖí̠ƬपɓװГஂࢬ॔ɜ؆ŶúĨӶƉʞ˜غǐ׌E੠ѥ˒ЏÔǹȼϳǰ۫gÅ̼āװᢈۘӚЕɴüͨɅ¸͵ǯϷØסոԱʲ׌ζǰíઊΙ؈̣˖̅]ɽદɾٔ"],encodeOffsets:[[35390,-11796]]}},{type:"Feature",id:"MRT",properties:{name:"Mauritania"},geometry:{type:"Polygon",coordinates:["@@և־ԗؤ֍ɞГʚҵUЧǽйð˽ˏïҐɺаŀߊģࠨĵкČмɑЎѵδǾˬᾔMǃ௎ȴќ߀øᒸ᪂©F౞Ṗ᎟౽cМ⋅М⋇ƤĻȇי⁙]ųȇ͕ÈӃǕוɼˉoƗӵ˯Ƶ"],encodeOffsets:[[-12462,14968]]}},{type:"Feature",id:"MWI",properties:{name:"Malawi"},geometry:{type:"Polygon",coordinates:["@@ɽٓɾથ̆^̤˕Κ؇îઉεǯʱ׋շԲ×עǰϸ·ͶͧɆɳûәЖѵɔʮޮ˄̈LJۢǚڼƞɪɉ܌Ѕϐ࠘ƽǜɵ˶Ϲɾଡ"],encodeOffsets:[[35390,-11796]]}},{type:"Feature",id:"MYS",properties:{name:"Malaysia"},geometry:{type:"MultiPolygon",coordinates:[["@@àћֈĶ˞ΈȘýӸԓΜ֛¶֣ęϡĆ˿Öӻ̒ɵͤݑe˳׫Éߑخ঵ښįђӟ֚ś̡۠ҜĠؔȃΤƤƮۈρ"],["@@أ˹ܯƚॱ@̅ॗ͓̇љୟۅǵߑɾЕóөщ՛Òէǟַӆƕ֘؜˽ٮǀǜ܆άǂ৖Ǻ׾ڔЬՐϦѥǮ˺В¸՜œа٪אшڀͼHќыžιֆɻ۬ʧÑ֝͡¥ƮЧ"]],encodeOffsets:[[[103502,6354]],[[121466,4586]]]}},{type:"Feature",id:"NAM",properties:{name:"Namibia"},geometry:{type:"Polygon",coordinates:["@@رٌؖ͡ȃࠊȷ،˯ಒm৒ŅҞ͛Όѡۜѳ৘ǽՆۃࠐ»٢КdžԊƞհ}ԄϝŶÐ₮˜׌Е᎞ş໴΂یȒհµͨȍPéӁȍʭC՛͍ͣΎಕ̍سƒ{Ჽࠣ‡BយA᷋ݣѕҋÕՇDŽϗÔƗάͩɰГг"],encodeOffsets:[[16738,-29262]]}},{type:"Feature",id:"NCL",properties:{name:"New Caledonia"},geometry:{type:"Polygon",coordinates:["@@ېԵѨϭ͉ȫҥɪ׹ϚէѼ։פś˶β[Һ˹φ˷ˎɻ"],encodeOffsets:[[169759,-21585]]}},{type:"Feature",id:"NER",properties:{name:"Niger"},geometry:{type:"Polygon",coordinates:["@@nּॹȐОҿպœϤâТբ̴̘ପðݜƄîԮҠ֘Eኬஈϒᝪ࿸᮪ཾ೨αӀңר̸ȸಯ̾ɓ`ˋΔ˽ǻί͕ၻ«ધੳߋγૉΔ̵CեբmčЃʁµˋƻm֩ंȟ’ځҷٱʔҍ¸ʏşӯ~ӷΧѓq৯ѢЉȵѓb̿͆ࡅ̼ࣗıɕǻşӗʋ͹ÍݣٗӚ̟E˭ʗ"],encodeOffsets:[[2207,12227]]}},{type:"Feature",id:"NGA",properties:{name:"Nigeria"},geometry:{type:"Polygon",coordinates:["@@ࢍ̡͉¬͓ȉڥl҇Ղˡ؊שֆكYݍB¶തs՘ǂՊʶʴТԴėɨǔ͸ȍӾ˪ÎݤʌͺŠӘɖǼࣘIJࡆ̻̀ͅєaЊȶৰѡєrӸΨӰ}ʐŠҎ·ٲʓڂҸȠ‘֪ँƼnͬͯğƱ«˧۽ٱɛՙšѧDZȉǝי҅ΉŽыȋ͹ÿΓֽ˱ҽΊ͇aԃӭʑQЍ߷ɍש"],encodeOffsets:[[8705,4887]]}},{type:"Feature",id:"NIC",properties:{name:"Nicaragua"},geometry:{type:"Polygon",coordinates:["@@̃ˆϽͺȁ˲Ο˄сϜĤžƒŵÚÒʾ”ŀȔŬRkЮȠrǬOǺɤʜǝĒľƺIJ̊ɴbǦĄQňȪĖ|ƜŹǚ›ȆńɄB̈ŌŜŖ˾iïă§ȉĐ̫ȗ˹ěͷυ®ɏtϙŹĉýΫÌɛǣɋ ɩźƏȩDZʛÈƓǦˉêȕʼnօɞųŇ"],encodeOffsets:[[-87769,11355]]}},{type:"Feature",id:"NLD",properties:{name:"Netherlands"},geometry:{type:"Polygon",coordinates:["@@ۦyǀ˳Ƚޓɇ́ԍ@ƘࢡҥȞՏπީǩ؛âѠɲ݀ఆଲΘ"],encodeOffsets:[[6220,54795]]}},{type:"Feature",id:"NOR",properties:{name:"Norway"},geometry:{type:"MultiPolygon",coordinates:[["@@᥆ؙઍɣऄՅෛ͵ڵû΢לઃͰಫ˵Ы؝ߟωࣗȮ઱¥णѼԉɝԷ“ūփནƊɝҵ߭Hևױ࠿झಫ஁̨˹̇ͫ࠯bձ޿¾૟՞э˥ধֻۧυӛ֝Ԫဋঁ૫ȟ୏є̛ࣚˇ኶ޞզᕠ۶ဌࢂ໤୦፺ྴඦلᘼ੊ᇎπ൪­౮ۢ໖›ພǘ"],["@@ም΅๝Ȝ׆ɐԕˎეǚͮ̿ொȍ"],["@@᪖صᑟͥұأ݅ǁЍۡৣᅵԢނ̘ఽʐ࿕܂ٷڄᘎ̜Ң̋஦\\͊˼௾ˆ੖̋"],["@@࿮̏ఝҍ᝱ı៙ƖƫɴஹdँϬᣴɼ௞ȫࡘʤᑺȽ"]],encodeOffsets:[[[28842,72894]],[[25318,79723]],[[18690,81615]],[[26059,82338]]]}},{type:"Feature",id:"NPL",properties:{name:"Nepal"},geometry:{type:"Polygon",coordinates:["@@ÝαŌՕĩͩ۩aয়Ȟ٭ĂӛђଷŊયҼ߉Ю߿͆͜޼ՒϠΒȪڪʳࡔշҾť˰ЕٶǓۀσौȕঔć"],encodeOffsets:[[90236,28546]]}},{type:"Feature",id:"NZL",properties:{name:"New Zealand"},geometry:{type:"MultiPolygon",coordinates:[["@@Ȓ΋װ;ʐΡBΝ̹ϳչإїͷ̴З٭Yܗ̓ɣջӋࡗڇϓнʇޝlխˢࣱÐƗ̰Ҍذ੐ࠦժǀ׾͌ܜѰԎѦώظ͈ɆŰҶלϴȆΧ"],["@@،ࢫlָϜɯŲًڰ˛֨ãӒ͎юĭȯݗʯӫٛjɡʭþαūƻͅҏзֹ٭ͯƟɘΕŨӞ۔˟ҨࣛͲz̦؈̌ƚ٨Ÿլͻ֜vƪБΎڋݔΗת̸àҚұٺɑʂݡ"]],encodeOffsets:[[[177173,-41901]],[[178803,-37024]]]}},{type:"Feature",id:"OMN",properties:{name:"Oman"},geometry:{type:"MultiPolygon",coordinates:[["@@ֹ̻ϟªǩȧƉэļ֗ÿĻϯFԽ̻ćХȓǯԹP͡ɃJͻПɷҩĂ֗˳ϱ³˝טٿ൴ᠾ࠾֖၂ϩתv͸ʔΐFΆϞǒƩŞèմіHϖֵҸ̧؞ŋӼƳϜӕɨ˧̞ŃCȉ̩ԃƅɽΟˏ"],["@@ʼnƳDž˺ʔ˺ľñā΍"]],encodeOffsets:[[[60274,21621]],[[57745,26518]]]}},{type:"Feature",id:"PAK",properties:{name:"Pakistan"},geometry:{type:"Polygon",coordinates:["@@تϻʞ٥൨ͻ߹۷ऩůౣȲЫα̖݁̈֩ڴгܑӟ`׳ࠃࡇՃ࡝࢝ࢡউÚऑࢡռϗĪ٧ҾэǘܝᇛD֓֕؛Ɇʣ؀٭٘໻ǁിeஃŝ̈́ঊொѢéϰГƌw݊ߥφͷԔеѶඨѕࡀŲԈŅǞȂגóદĈ܎ҶӈشCĠɼٞŌ̴ý͢ʀ±ԌΦԖ՘Ɇͥ֊ߜɴ̢•͒мΜĩмȣΤӬμࣘǮ८ĮѐƺӨĦ"],encodeOffsets:[[76962,38025]]}},{type:"Feature",id:"PAN",properties:{name:"Panama"},geometry:{type:"Polygon",coordinates:["@@˫ʎǵҒȺɢɅÎƿˤлɸοÁǝ̇ͻɁǽ‡ĉǩВҗɯŅŧŭϷ©ơԈŋƛˡ¸ǝ͸·ÈɓİέCǻĩŶªǖìǠƲŲIJǩŲK͸͘ö̠̝iDZͲ›ĀæɴȵЮÔΨɄԜǞ˺ʤҬ·‹ĉҶ…ώơ˜ʧ̈́ɵĹūȜӵǁʟ˓ÒŅС"],encodeOffsets:[[-79750,7398]]}},{type:"Feature",id:"PER",properties:{name:"Peru"},geometry:{type:"Polygon",coordinates:["@@ɥљћɋࡅӘñΈရࡊທࣾ٫԰ΏۜƐʎ܅ાࠣ༄ߍီ΅Ϥ˃ؤٷպױͼ˖ϒПߢʼךڢՎIJΓʇȧx̭ΎâͼĝΚщӆΌDŽ֤ԦܶৠͨࣸࢠʾմŝٔɢĂ֒ЉˎЅϴɏӶࢣضĿҨɞ̤ƣԎð٠Ͻթࡣʤoрҁݳ œųۍlj॥ֱÓϻɉ̇ČғԕʍBΡɛƵΔݳҲԝDZί֐µ͆҃ݐuېӸÇ౧ϢĩӄƠܪടǷ˵£ןg܍͟пƮ̵ȕ˯β۹Ջ࣡"],encodeOffsets:[[-71260,-18001]]}},{type:"Feature",id:"PHL",properties:{name:"Philippines"},geometry:{type:"MultiPolygon",coordinates:[["@@Đ֏ºҽ˹ޑ̫ࡨϽэˎإʉϿ঩Ӧɿ؊ʰЎՑЈˁΑЃثҵƑʖ͢۾ՌʀҜ̈́̔ϝٔɰƎϒרv·ٰڼЋêхÐ̱"],["@@̟ˡˁՍ˃ʝԫ׈ǦɤɂɾĢԸҨ¸Ɖ֣جߺāߡ"],["@@ૣߕЬט؈԰Ԏ׊Ѱ࠲Ʈۅևҧѳֿ"],["@@Ԏʹ՘BgΗϳΣՕʧ‡ϸÒєŽА"],["@@ʀभ٫ɞj˭ȶԯЍȋ•עʧªƁԘӶãY͈ԣٜ߮mɴ̻"],["@@ɟܩέоѓ٘ܚ‰̡̈"],["@@ԮʉʶɖüɇƍΑ˼׻ɛۥӷ˥ƁڳȊڝѾġϊIJਾүăҙ˜ȫēϯٻЮ̵Ѵɍ̯՗ԊރůлȆ¨ΎˀɊʣȘŇ̡бӚűμߨͺˡĔೄ˜ހԘA"]],encodeOffsets:[[[129410,8617]],[[126959,10526]],[[121349,9540]],[[124809,12178]],[[128515,12455]],[[124445,13384]],[[124234,18949]]]}},{type:"Feature",id:"PNG",properties:{name:"Papua New Guinea"},geometry:{type:"MultiPolygon",coordinates:[["@@ɽčε͔ρՔǷ٘ŜĆĜʡʬȏРՑЈ˵ŝɽ"],["@@ѯçƃɽҟȱћȟѽBۏʔӑɺêʺݬũҠàŶЖŦrĆѽӐÜʂ˼Ҹ̚ġӸԌfǜƏgү˯ԡ"],["@@ݤտղࢻӖ„‘ω٬ƛʥǁࣀΝġʏ֋ÏȷɔܟĦࡕŴٷ՚ӉҦѧ݀ભπ܇ʇԡˣńإڇ˿һƖࢅ–aᩒaᩒภ׃༊ӓׄїҴхŸӵඔԱȲѽޛěȄ֕"],["@@ʿɡǁӸȝ͘ϝ˞ӍΪ؇ʚɺȮҒɻ˸ȁΜȫʹΛ͊ˏĶѧ"]],encodeOffsets:[[[159622,-6983]],[[155631,-5609]],[[150725,-7565]],[[156816,-4607]]]}},{type:"Feature",id:"POL",properties:{name:"Poland"},geometry:{type:"Polygon",coordinates:["@@·՜à̂ȹ̧҆̚ɺɤȝђָʘ಼ϴ੒˴࠼ƙÚȱ߸Yਚħ໶^њěȬʵšωɸ͋KͯԋǡʸϳfϏцܻěɽзįރۥɒϗǿ¶ߙ͔؁šЇĒӹǵч̖Ήŕ³¼ϭаر¼ăˀֻĦűɑҗǨÀɴػòЉ˔"],encodeOffsets:[[15378,52334]]}},{type:"Feature",id:"PRI",properties:{name:"Puerto Rico"},geometry:{type:"Polygon",coordinates:["@@јõưǕɋɃمLӫ‡·άŢŬیK"],encodeOffsets:[[-67873,18960]]}},{type:"Feature",id:"PRK",properties:{name:"North Korea"},geometry:{type:"Polygon",coordinates:["@@Şƥ͉ºη˵ʣ˷Ž׽ѣȅƫƧ̓ʝ֓ƏηɥηįġͰƋӈσŧȭΧÇץ¡͝ϛϑˆÁùСdžĵƿʙé‡ǀɑüɥƆɰφȤİõƶɆҒÅƎөĠЇɤۄբऒҌ־׮Ўˁܪ‹ſѺಚβͰҼժӹ"],encodeOffsets:[[133776,43413]]}},{type:"Feature",id:"PRT",properties:{name:"Portugal"},geometry:{type:"Polygon",coordinates:["@@̦Ɉ΄ŬɂЫӺDƞłӪ‡ɼуϱɩYٽƍū‘Їγçʹԋɵտ̄ʡřɫ̵̿ê˥ͷɓѷŠџġŸڂÿԬϓþȩ͈äռͰ̨ÒͼǪԎkΤǙ̠™˲"],encodeOffsets:[[-9251,42886]]}},{type:"Feature",id:"PRY",properties:{name:"Paraguay"},geometry:{type:"Polygon",coordinates:["@@ͦ৖tҌЖ݌าʔޮ]޴їbʵʞҳÇଛࢲLJ΄ǐ֦ɩǀʣþޓİ͓̼›̀ƌ̢ƳAҥŕӻǑӛƍݏށ١ړƇऻŸࡑɮࠢ౨ťψࡽ͢ਅبۉŸ໵ൌ"],encodeOffsets:[[-64189,-22783]]}},{type:"Feature",id:"QAT",properties:{name:"Qatar"},geometry:{type:"Polygon",coordinates:["@@ÇؔɨѲɰĜʬˁdӯǽӳɵÑʫǖ"],encodeOffsets:[[52030,25349]]}},{type:"Feature",id:"ROU",properties:{name:"Romania"},geometry:{type:"Polygon",coordinates:["@@δǶԴġՠGϸȳ˺źبĄɄȠΠ@ʰćʺʟˊΟӞԁ€ρėΩưϥϒƹЂƊϠƟpɏПǹʯĀɻ৥ӳĖ̪ؑফțзɋ௽¬٥ƀ͙ÕʍΊƵƦȚƘȷŀ˃ȋөʔßΌԟȢĥˌҕͤڪǂԖ֮Њ֬ԢǮ"],encodeOffsets:[[23256,49032]]}},{type:"Feature",id:"RUS",properties:{name:"Russia"},geometry:{type:"MultiPolygon",coordinates:[["@@ࡌ๫కˤԫ்ࠌࡳyוُԒսٱƻ۸Ĥࠊħ࣢Țٌš૴ӯࠜôରަϮͭϴϐŠɔ։̆ߵuࠟΎࡑ"],["@@໵]ਙĨȒτ୊˚ࢢƧψƃęɱäɉ"],["@@֦Ƚțؐᗸű࿨޻࠭λ൛ēsࠑͳǩ޽~ٗ̊ૣʖȉθ࡟Ǝॗʼnҗ̎Ǽ̸৓ȥϚЃӉΣ@„Ꮪٛᔺ࠳ïԷ"],["@@ः©ƭˌੲΖ@ַ"],["@@ળ»@ָň–܈E௒ʉïŗࡽȩ"],["@@ౡMႣĤƧ¬ߘͪੀþஞ͏ĸə"],["@@ॿͩഉø༛ͨȪ˖༨ųᑔɗ"],["@@ډرᶽzඃȣမղҎ׀૎ǂᕞ™ᴬѽ"],["@@ӹóᩣŊɟώູɦūҒ࡮Ƕ…Ҟသܒޙĺ፨݆ɩϢሤѺ᪪բ᫠ǀ෴̸࿐Ŋאͩ֟ʻᲗз᢭Џᤙߝఫࠍ೉߱Ǡۥྎۏ"],["@@ɨгސȲឤYቈЧڬ̿ȽѧङʝᕅүفʟਬşఖɃݴDŽєաτɔഊƂ᧪ƑȴϽ↲ů´ٜᄼƥഄLബѷϮ՝ӹΙੌڋ೔Ϳ߸ࢦഖϙ෢ɦྼʵؤʀൖş؅ޮૐζ䢀ձܐӿᔲٛ₎DŽာƑ۪΍Ĺؙਜʇ૴Ǥ๰vཚǑཪĢะݛਪˎڷ՞ϐώᧆɻფºᝂБ୲ν@”MKઇσઝÖݶҁԄەϲɧĮΏɑɝ༧Ǿ᚝مݛĭ౽ן௛ԧ̱ϣய׊ᔗڇϣ̸ߵΫ૱Ř˓ց৙߽Šͻड़ȋő௣ޭ‹Ϋ۱Δα฽ѕ̅ॡభȳʥ࡟ே޳ׂ̳έ௬ҵለИ୘܀ԆªϾರȊຊ੒คࡺຢڢڮஆ৷ëԍۗᒉइۍਖᓧ˷ᑃටۚԧሙɕಝēÔ؊ಯŶ਩ЭᢵƠ᪏ʟᨩ࿛ủጝ೚ŁаՃࠄȅ՞оईÃௌऍ†܍ځ࠽ë্ϛഉ్௓˯ׇଙ঑ଇॻթӹ૩ӱՉYՇФૻؙſ˩ŝƦKѐіxŦ঴ɛܚܞ̒৶Ʃ֢ࠈ˾ऄ͚̮Ѵݲ൷ʛܯͧ౧Dͻ߄হװหˎ̵ࠖ̉Ԫ̿βԯࡐ̲݇షʢ૛uਯƱۛлҤȥXҩұˑݷࢻRσஅՍ৙̈́োéѯˮԋĞ௷ףેƑޛȻੑƌޫSԙіࠕИࡅŎ੝ŋߏƹ஛ΜLJـধɎށİवΎࢉࢉ΀ӵࠇב௏ɂ࠻Š֗Ͼ࢙^ܳʴ౫Ѓྃܣࢭơ͡çѽԤઍőΧΦחnjЙӠҩưிɍୃӜ҃ѯሟᒒੵٮ̮˂ᑋߍ߭³êҞઅ˺࢙ȱ˃ࢊມǺݯΑᑅ̳Чȹḭ̇ϫ˻؆ֹ߭ɓǀɭ߭ХസֿɁЉ୻˜ʓʟ੹Ѧ೯iࢻΟহͼᇡ׊ಽsჃࣳĿؗࡹӤڡउʖǡӝُ܊֫ذx՚֗ďѝѐƋϥӽ߿Ƒ࠳ࢁކߕĉ֣ࣼফԇ͹ƝɇωÌֿԚɿ†ՅȚʳΈ޵ǮԙƁƥƼଥЖఅƌ܃ƞĹıੱ܂य़̈́ܩӴؒƈۤ۰ҹͪఌ΄uȀݯƉ‚ώѠɼ߼ÖƄ˪ȅҪ΀ѰWʚఉ˚ӭUԯЀ١ƃ੩̐lǒ̗θڟ¤éʼɀǞ՝ӈࢋąʭ¦Ƀȑ̽”ȷ՞ȟ˨NJĀڴ‡͞Ȁʍɢ֥ƪ¼Ʋ΁ƴՃվǸɨĉЂࠑȨѱijšȼࢭɂˑӸíТЙȖάˊʝ޶װӞųƤक़ҬࢡЎᅢ੶ޮӠ͂єగּΆնݳش֢ܜ঍ग़ޢي౿֔ŬךڶüොͶࢀ̈൦ԕᘨȧṺो٤ЋÆ֓टѳ൏ɡ⏷ٔ؟Ńൌ؛ÂϵÆ࡫ઌʯڂɓňРԑΰ՘͈᎖Թ۾Ȳ֣؜ዦࠖޢµ޸̋Ӫ׀۫ԄЪԊءԶᚠˑӔҹ੡ĻNҳڌ˽ಜǼȶ՚ჶАᰪܞي£ࠣԙਬĕ׼˼༾xఢΐफ़ԏॖ֌ࢡӢѪˤ២ʫ୒ʿᴾॣ֚ѰࡡѺ{ǴৣĈˢЌ҅ټ}ː༄ݾրކزǒᕮɛǬұߕڽԺˋ˒חȏଵऒԧέ֕࿫஝०ŭ̢ͮऎɎɞжܮЎөӌϼֈࣿêȫҲڢࡈણۆຒ֦șװмnѴүͧ߷࣐Ƶϥ؄ඤͦლ¬༈ӏݛ۪ċࣆศǞ፾™ᆘŌہѮংւॲx࿎иᕠŐ˪ɲᕂþیȋሴҀ໲aɶδߤΨጤΈ෸˗ଥȷበŹ"],["@@ⵙ͕ໞીےĦقÃᒈӋʟͿ"],["@@૽ōݱÛśƏঙƑ࣫ȦӐʾል~࿞ƶ౨XǢɧӘȬߊƐఞǿ͗ŷ"],["@@ᆳĿᚉʎඅ͎٣׾଩ǔᔆָᆎȎ࿌чኬ߻ȹݯ"]],encodeOffsets:[[[147096,51966]],[[23277,55632]],[[-179214,68183]],[[184320,72533]],[[-182982,72595]],[[147051,74970]],[[154350,76887]],[[148569,77377]],[[58917,72418]],[[109538,78822]],[[107598,80187]],[[52364,82481]],[[102339,80775]]]}},{type:"Feature",id:"RWA",properties:{name:"Rwanda"},geometry:{type:"Polygon",coordinates:["@@ͬӃµӵʏŁѿÆʱӍԛàþҠŘތԄʎɺȰďԈʸ"],encodeOffsets:[[31150,-1161]]}},{type:"Feature",id:"ESH",properties:{name:"Western Sahara"},geometry:{type:"Polygon",coordinates:["@@oҊŸ@@ÉeNjEౝ᪁ª‚ᒷ޿÷ȳћDŽ்ᾓNǽ˫˜΢bCቆäĶ̢ΆϘˤୌୠ࣢Ђ੖ˀÖ˜ټۺĜ̦ʼnϢ@˔ȒԲ‚"],encodeOffsets:[[-9005,27772]]}},{type:"Feature",id:"SAU",properties:{name:"Saudi Arabia"},geometry:{type:"Polygon",coordinates:["@@ʼnΪʩʨÝͲѡ̞҃۴ʁۆׇ׀ϑƐ֋ߠīא–ӾӕञϿ͠ґǨˡӖ°ȎɹѦʕȊ͝زԟڴѓ־лIžҦœ̌ļͲनƅζʶȪ̢ٚŚƒˮˤƜ࠷ࡀ၆фdžŴৢɩబיᛎၕ༠ãݠąȾЏתv͠ܥаȓƠִ̏Λ¼΍ċ˩ł˯ʎɽŐ˟ŲȵʬǕɶÒdž͍Žș࡙͐ᡌщǞDzϪש֕၁ᠽ࠽ᝑ͑޷ϙ׻ࢥϹƕɁˬ͏§߻ĎƷČॹmɫùΉɔɝЭĒΟρˋ"],encodeOffsets:[[43807,16741]]}},{type:"Feature",id:"SDN",properties:{name:"Sudan"},geometry:{type:"Polygon",coordinates:["@@śhdмĵ̀џͨĵ؄ĶبϳÌÍȇԍ©Ȭʕðԍңңл؅џđ۹Ӫͅǥđʓџǃ…ǥ࠵@řǦ؃†̡ƝɳîѝӬƟɲ؃ŗɱϵɏݣ˿ǁʳğå ̅ʎÃʼƌΔE΄ӛՀĩάZȰ̱ʜUӦǭ͖̍µĎ̰ɒΖħΐˢʴǫȞɞ԰ϨئܦÏ¥ ZΚॲH@း@Ὂ@ῼ@˔ࠗȁƳŪࡻ্̰͌ȷҠ̳ыӑأƏ˅ʳĉ֑α௿ĚͳƅܟͿࠟԓзέٛč΃Љɽʝ࢟Dij"],encodeOffsets:[[34779,9692]]}},{type:"Feature",id:"SDS",properties:{name:"South Sudan"},geometry:{type:"Polygon",coordinates:["@@Xٽűʯѿq˷ӏԨÑюХƨͳϦșӼࣳ֫օԫԇԫϭסFگȟՕȊ΋ɭ݉֐ȥάҵDZϱÆɣƕϗĸԗۚƉˊعͪɅԌΕζ֟ѬS˘ҡͼ֯͠ʴĠ̀ǂɐݤɲ϶؄ŘƠɱўӫɴí̢ƞ؄…Śǥ࠶@†ǦѠDŽĒʔ͆ǦۺөѠĒм؆ҤҤïԎȫʖԎªÎȈϴËĵاĶ؃ѠͧĶ˿cлŜg"],encodeOffsets:[[34779,9692]]}},{type:"Feature",id:"SEN",properties:{name:"Senegal"},geometry:{type:"Polygon",coordinates:["@@΍ٺн̚φDŽРמȦќ˾ːкïШǾҶVДʙ֎ɝԘأֈֽžԹǔӓ̾ɿî͗ʽŧ³қâÙģȃk׿ȲЛV༇–ɥħ˥‚ѻƋƏ٢ވkȬŞƮR̸ȘήǯκcζȌǝʐˡƙʻJͧȸˉ_ȍȥࣵy"],encodeOffsets:[[-17114,13922]]}},{type:"Feature",id:"SLB",properties:{name:"Solomon Islands"},geometry:{type:"MultiPolygon",coordinates:[["@@ɾ˿חN͉ԬԈȯǜ‰"],["@@͝mԧĎǫżÀͮֈƁ˜ǭƎə"],["@@ųƹحܰǫԈ˺@̠ڥʹЗ"],["@@–ǛڅΦҟ̠̿˪ŰĐϮȫېϭȢˉ"],["@@Ǘ³οȒ·Ί¨ƖԈΡͰ˛"]],encodeOffsets:[[[166010,-10734]],[[164713,-10109]],[[165561,-9830]],[[163713,-8537]],[[161320,-7524]]]}},{type:"Feature",id:"SLE",properties:{name:"Sierra Leone"},geometry:{type:"Polygon",coordinates:["@@ɧØ؁ͺѩ҈Ƨ̬Ĺت҆τĬɺƞǸɶpȜǂڦCɺ̛ǼˁʓƈɗṶɴ´ϹϹϛҗ«ʓȩˏ"],encodeOffsets:[[-11713,6949]]}},{type:"Feature",id:"SLV",properties:{name:"El Salvador"},geometry:{type:"Polygon",coordinates:["@@ġȡӡ^̡Ą΍ǘұÀʃǶ~Ů˾ɄǀĢ«IJȠ¾ʜëǸǙʪƇŒœτĴǤÑŘĝÏͳ"],encodeOffsets:[[-89900,13706]]}},{type:"Feature",id:"-99",properties:{name:"Somaliland"},geometry:{type:"Polygon",coordinates:["@@ϛԩד۫۹Mᩧা͍̜̳К̳ҨǾ̖̲҈˚ƹǒΏϜΗкGߊɌࣴĴ݌ʼиÆ̚ƶӎˆKaE΋Aࡑ@ѫ"],encodeOffsets:[[50113,9679]]}},{type:"Feature",id:"SOM",properties:{name:"Somalia"},geometry:{type:"Polygon",coordinates:["@@ѼĎЊ˾͈FpɵýӧHѳǯ̣ʁࣥЙयԱ੷ܝ௷ܓवধ଩ࡁڹష࠯޳ٕँৱȗѷȍȣӽۚWᵤܾ॒ɰˆբfݠפબšᛜᡄה۬ϜԪ@ѬBࡒFΌLbːhϰŰ"],encodeOffsets:[[50923,11857]]}},{type:"Feature",id:"SRB",properties:{name:"Republic of Serbia"},geometry:{type:"Polygon",coordinates:["@@Ԡȡà΋Ӫʓ˄ȌȸĿșƗƶƥȷȏø̫Тγ͋ʿƗˋĞijƑšϳa˹µƒØĴĴĦȴšKǍƼƑ ŋƆƽÀšŠƯ±ś˧ȩÑèð͋Ǩ˟ĜūŜɟƠȢšŬЄЛ͔ɀτ̥Ë͔́ˉʈȱ͘٢ɚԾ™ҖͣĦˋ"],encodeOffsets:[[21376,46507]]}},{type:"Feature",id:"SUR",properties:{name:"Suriname"},geometry:{type:"Polygon",coordinates:["@@৔ǙĞưڶÔࣚɥѩܟâֹͤӽƥίóϩɉΛӓDzЇđ͹öčʏƘǗ÷ǡҙèԡܴōӄˏBωؐƺѠ¯ȤԜɖƈݲ"],encodeOffsets:[[-58518,6117]]}},{type:"Feature",id:"SVK",properties:{name:"Slovakia"},geometry:{type:"Polygon",coordinates:["@@´»ΊŖш̕ӺǶЈđ؂Ţߚ͓ɷɓǏ͹dzđ࣑ʮ˟»ȟȡЁĿěÄХŽͭ}ãǙ۷Ļ̱ĠёɌċ̆äńŢȂόa˺ĔxþLj¢ÆȒȖ˜žưʢD"],encodeOffsets:[[19306,50685]]}},{type:"Feature",id:"SVN",properties:{name:"Slovenia"},geometry:{type:"Polygon",coordinates:["@@ۜÝъȐܾtLjƘƘUǎ˳ڝɟć͹̇đHɻͣh˷ƎƷƙב†ȈúȫΨĞа"],encodeOffsets:[[14138,47626]]}},{type:"Feature",id:"SWE",properties:{name:"Sweden"},geometry:{type:"Polygon",coordinates:["@@ࠁוƀԥ೹ڭྱܡؓஃײףߦүޗॅ࢑ȝ͍තӋ޿৳ĆӅڗঃˉߐ۳॔ٓஐφӜּۨ˦ন՝ю½ૠղ߀࠰ä̧ͬ˺ಬஂࡀञֈײ߮GɞҶཔƉŬքԸ”૪Щ಼ֱv಑˴͛ฃʃ"],encodeOffsets:[[22716,67302]]}},{type:"Feature",id:"SWZ",properties:{name:"Swaziland"},geometry:{type:"Polygon",coordinates:["@@ǡύӭěԅҖS̄ɰ̀ĂʔʐÒшƵŰϕðω"],encodeOffsets:[[32842,-27375]]}},{type:"Feature",id:"SYR",properties:{name:"Syria"},geometry:{type:"Polygon",coordinates:["@@࿩ࣅऩͬgNŖŶ_ΈȸҠҜ̈́Əͤϗ¨ÿٞȶΌɤȀɤȀ°Ҹ˞Ǐऎɺ҂ƿۖFॴ̀Ґaक़žїԽҡȹĂؗͅ৫ᇵ࢓"],encodeOffsets:[[39724,34180]]}},{type:"Feature",id:"TCD",properties:{name:"Chad"},geometry:{type:"Polygon",coordinates:["@@ĎЄաnDզΓ̶δ૊ੴߌ¬ન͖ၼǼΰΓ˾_ˌ̽ɔȷರࡔҠ…ྑ…ྏ¦ ܥÐϧإɝԯǬȝˡʳĨΏɑΕč̯̎¶Ǯ͕Vӥ̲ʛYȯՏƛэͽ؉ࣹ߅ϳ߹¾ʁûĊ̏ѫ̋Σ͟੓͏ȽȐƓhƹɍۛÙƀɪ˅ׄşΐλƜӷӪǼІϦċʂÐҸSқކŒ֐É֐ͭՠ"],encodeOffsets:[[14844,13169]]}},{type:"Feature",id:"TGO",properties:{name:"Togo"},geometry:{type:"Polygon",coordinates:["@@ڱdzȇ̎ɡՔãкȆݴɁ̬ăڎD؎ΕѠÖˀ݂kŅѵʲʝ̈̋ŽЭǜǥኝȺׅ"],encodeOffsets:[[1911,6290]]}},{type:"Feature",id:"THA",properties:{name:"Thailand"},geometry:{type:"Polygon",coordinates:["@@ݭϬܗeŬڈ݉Káऋґ௯˙ݏÌ؋ն΀ދưܭҶӓԚĭѤѧ˝·ևĵßќۇςƣƭͧ͒ƝжҁӄПЌƏӳǃҲĠԾʚ߬ТࡸҤ޶͟ތ`϶ĩҸ֕ښȩф̄ƺ̮ܶ·ֆՓؘН݆ΠƴϦࣦצœӬθӔȘθʷ´ԍ֨ȷࢭpݫࢰԆʤƧӰzǜَ̊ÍٖڽÀࠥںܷ›܅˙ϛ޿ŦગDž՟ۧȤ১"],encodeOffsets:[[105047,12480]]}},{type:"Feature",id:"TJK",properties:{name:"Tajikistan"},geometry:{type:"Polygon",coordinates:["@@̭ʷࣳƖāӛ࣬Þਢ˗འŶɈާˠĐԜȓ‡͛ŴӍࡿBׁØԻϕύĉ̉ǯͩˠþ۸ʩ¢ĞʲғȐα̇ė͹Żūԇj˕ϩ˯nj؋ˑʱĺӀࡘǹض؟ȨɔφۮŸЌҬˌբ૲ȜǩϵŤɹΎv"],encodeOffsets:[[72719,41211]]}},{type:"Feature",id:"TKM",properties:{name:"Turkmenistan"},geometry:{type:"Polygon",coordinates:["@@ñۼطŠॣݔڣĠगюׯþσƽ֙|ׯӓ݇NjƻרŪ࢞ٽ˶Ɏֺ֏¸Ȇ۾ߊȵ݈ˎؓԎʉӔڱɋď؛ʿհψ˨ॖǪ֨ɻךڅњ¤ॆ\\Əцܖ̂۾ӦଆѹĜڡ͐ǣࣦžˮƳаࡽ०ׇոЃ࢞Щ૤Ϋwԥʩ€Ѕɤſ̙۽NjǙڥӁʭڏŵǫϟهŏࡩ͈"],encodeOffsets:[[62680,36506]]}},{type:"Feature",id:"TLS",properties:{name:"East Timor"},geometry:{type:"Polygon",coordinates:["@@IJȤܢȌז†ˀŀ͆Ľ̯ɫ࢕ο۳ʋeʬďǔ"],encodeOffsets:[[127968,-9106]]}},{type:"Feature",id:"TTO",properties:{name:"Trinidad and Tobago"},geometry:{type:"Polygon",coordinates:["@@ӚŊǮ‡‘صۭġƯúʒɲiͪ"],encodeOffsets:[[-63160,11019]]}},{type:"Feature",id:"TUN",properties:{name:"Tunisia"},geometry:{type:"Polygon",coordinates:["@@ΩພԭͺQȰۉԄóنԮҶȢۚƃߠǠќࣶͺךĵ}ы܊̲ÒljпЫMϱ̆ȽōܫփхDŽқѤaɄЍ͊ſ³٥Хʋʵˏֽ͓ĘΑïΟЧț"],encodeOffsets:[[9710,31035]]}},{type:"Feature",id:"TUR",properties:{name:"Turkey"},geometry:{type:"MultiPolygon",coordinates:[["@@஺͗ঐżܤõলѬࣆ¢ߴЭƜ̑ăУزȻͨʕֻʇˀ५ǏʻҠڧЕƙ̏Ɋ঍ňίŽॗŽҏbॳ̿ەEҁǀऍɹ˝ǐ¯ҷɣǿɣǿ̱Ϡ͈͂ԟí۱ȖֿәౣĥڹҊࣟ†ȗΑׇij߻҄ࣻeӽ࠶ؗҰЦٸՓВठߨಒ’Μྀٔŏ৞հ঒ʄർlุף"],["@@۫ҏ˃Ϻ\\ǦȦĦʺՂХɞࡦ˄ܤőĴ͓ܼ˓Ƶȵি±Ωʷ"]],encodeOffsets:[[[37800,42328]],[[27845,41668]]]}},{type:"Feature",id:"TZA",properties:{name:"United Republic of Tanzania"},geometry:{type:"Polygon",coordinates:["@@ƚġᵂႋÌӣ஼࠿ϱਙ¸Ӊՠ̩~ɓɳԓ¶ʭÇГ̌Ճΐ̰ࠡǿڝӣࣿ͛ԋb̙ʥבsɕŃঢ়ʂكåɽଢ˵ϺǛɶࠗƾӉʨՕƘͯƘΗɈґ੖ӣҺǗӤČѨƯޞΎ ̨̦͜ѬȺǮS˘ǷȐ·ͨʐł¶Ӷͫӄ̎Ķऄ[ႎà"],encodeOffsets:[[34718,-972]]}},{type:"Feature",id:"UGA",properties:{name:"Uganda"},geometry:{type:"Polygon",coordinates:["@@ः\\̍ĵԇʷȯĐPوȜ͎²ڬǰϸ͎Ѭ͔ɠ˒̘͵Ŗ¼চΌɮՖȉڰȠעEԬϮЊ׍İсτ९̧ؓЯ֋ʉͽTࢹႍß"],encodeOffsets:[[32631,-1052]]}},{type:"Feature",id:"UKR",properties:{name:"Ukraine"},geometry:{type:"Polygon",coordinates:["@@̾“ɄȒʮ¥ࢌĆ՞Ӈȿǝêʻڠ£̘ηkǑ੪̏٢Ƅ԰ϿӮVఊ˙XʙͿѯȆҩƃ˩߻Õџɻύڡã֑˕޽«ܣ̻¸ԹЪȭࡨ¼Ǐ̛ँơଛӟұǠȄЂࣽʘƨLjߪ˪ʑȔಯɆË̼ީĻ̷ҧٱةϟƠЁƉϑƺɂĞƦ˾ɲˎÑƮǬäĊśӸ{ɞØƽĎÐŲ̉ɈŧΘ̩ƐÒ˶ϝɦΉŽأʾ֑ĉȧŭΟ@Ƀȟاă˹ŹϷȴ՟HԳĢγǵÍɤұɮǐͺɸɔȀµɑϘބۦиİĜɾхܼДҢɪٲnࡖßबȫڎi͂ŧ̀Ʀɚȝݸ¢ͮąÄцʶȂܞº"],encodeOffsets:[[32549,53353]]}},{type:"Feature",id:"URY",properties:{name:"Uruguay"},geometry:{type:"Polygon",coordinates:["@@ղĚࡆٯ̺|ࡺ՟ڈҫӠֱχЉɸӇεՇॉұاǚғěޥΰ֫ԟҬÞլǾȈS࠸ɤࡺȾڦ"],encodeOffsets:[[-59008,-30941]]}},{type:"Feature",id:"USA",properties:{name:"United States of America"},geometry:{type:"MultiPolygon",coordinates:[["@@ũƕȽŤ|ɾƓ̨¦ĤƤƎÍǔ¸þÜe͐ƙƬñƌőɊ̍q¯͟ǵˏſ"],["@@˭ÑƟǮīèQÀĈî̘āɘŹëĵ"],["@@ĝ҉|Úĸа•"],["@@­µÓŻˆŃȒ’ɤŚêÃʐ˥"],["@@ıĉ˱ƴªÖŸĈȘijȝ"],["@@Ƭңʼƛז½࡬ƅࠂʹڼŊਖɓ˞Tݨʄ߂̧ࠒ͗ں˩ٶˏĈəȢĉ½ĉɦǎĔ¦ȣǜƅɴ@ŬĹĽƫ࢖ЁǶށǚܳʗӹЁҥȁ̍mēĦť˸Ɓɂ@ঊ҆ࡾƀસмfĐ÷ʰƉǒϜƆࠜHޘAˎ͞ŀàࢶ؄ϜƸ౦N໾BĎȺː¦Φž̖Ϣʲٺٚي˨ə֜ƜώʏAଧռӅƢ˝࣋Пࡷ̃ࢱʝѻӿƛȋSѽˤѽΒsė̬ʦȇãʇ֥ƋЗhةƥλ¥ӥ¥۫ʏఀǂʠǃ୳ʥ՗C|ĺʭɷʚǹ׽ؑ٧×Ɏȁª˟ɀǪҍȼƭ^ͅˏ͛ҿڡûʺֲѕ͎įۦljεǴՑևƀׂ˓˜ߛʊÍĖ̃ŠࡁՕدࢇʝցӱнÁэ̱ţ˭इձӁЍЅӽŻׯƪ׍ˬܗώשLεЊঅ֥—͛ȿԡʣŃЯĺƁς͋ȖѻܢϹٞű͢Ǥ֐ɽҦٻ۲͟źࡑϡƭ¦СϼՃȺोŁݗĤٙÍΏſƲɟaͽǴǓLJō̵Ů́ǃ؍€طѺܻĿ؏ȚԹÏۻȝއح࠳γҝБȕϗUׅ¨ЕDŽ˹͝{׭ȂٽʺɽЄȁטӷӐ̃ӰуֺףͲۉgՉڑۣʦѡʪȽҦ˧Ѯӿτїˈ̩̖ป@C΋ڗ@ဩOቿפ౓ТĀǒ੩ĝॕÝƙіխӚϻĴğʌһ¦̝ɪޭĊɉƌĹҢࠁࡊ۩ୠˆȚχˤٯ۴řۆ҃ҞȀۢ…ܜˍ٢͠ߊĸނĺނƱૼˇܘʓ϶ĸǐ௒˷҂ߋȺɜƇې˷ێᛸ@᠂@ࠜ@ᢢ@៚@ᡀ@ᡄ@᭰@ᮞBაAF͔˴J"],["@@࠽͋ѕɐŽЀބ̘҆Ÿ֐ÉΤʻܫЍ"],["@@ԧŽսƾԛɮࠦƞښùĂ͑"],["@@԰DžԾĒڸɛ࠲őéĝُDZٕǾ͋Ʋݍµȧôº̈́"],["@@؊ϛώnjහ»¹ȕ౾ƛࡨČᄚ˅ྤā٨ʼn૦Ǝౢʧࣲŝ@@MᷱIⷍࠠ{ࠌɵהρݜցࠈҺࡈ˖Ҁѡ֤·ޒϙՂ׽࡮य़ේ՗xՋұЙҥ͂ݍˌʃܺએںҍߎ߯Ä೷rটʌ჉ࢎߩDŽ฽̜୑í࿻ϬৃΨटǯǦ׏ҫÁঁǫ݉˱झdzťӶϚࠚࣀʶɱɂੱҵֵ֑௅ױؚСߏ׿ࣗΗࡁʱȻωಽѡ˅ϿছΫֽÞ޷ɻ࡝˹ۧ˫෹ʉſƘऀϾࠔʸࣆҠਬĨвΈ୘ԊȈǚب̒ƢْђӸॹʫ˓Ơҕ̧շюɧ̝̽м࠿ͳԩBïԄƲ̮ե̚થLJ܁ЀַȬIӈ٩Ϊ͘ӘۆҸ̚њںÖ־ƇڴМ؎ï٘ʼƻϨҹưج͖ԩWࢻǽʯȃڏȄஏĥ௷ȬΛ͸੟Ӧ୾ΘመШ۔@ŕнᄢŽڽԶਕ͌ױр߫ΨଽˈҺѲ๰‚ਗ਼ϦȨФ࡬ЎࠊĪཪώޜÉಐ҄ౚǭ"]],encodeOffsets:[[[-159275,19542]],[[-159825,21140]],[[-160520,21686]],[[-161436,21834]],[[-163169,22510]],[[-97093,50575]],[[-156678,58487]],[[-169553,61348]],[[-175853,65314]],[[-158789,72856]]]}},{type:"Feature",id:"UZB",properties:{name:"Uzbekistan"},geometry:{type:"Polygon",coordinates:["@@xԦૣά࢝ЪշЄ॥׈Яࡾ˭ƴࣥ͏ǤěڢଅѺ۽ӥܕ́Ɛхॅ[ᶾᓘӺƾïದ׻یͅߤݵঢŪ෸à৔ؗÙࡅЦMǢۍ੬ɲЉ̺Lπ׺૎הӖƺʠĉ۵խئ́ײȾ়ѷ੽؁ٕĊ΍uţɺǪ϶૱țˋաЋҫۭ ɓυؠȧǺصҿࡗهǰҳN"],encodeOffsets:[[68116,38260]]}},{type:"Feature",id:"VEN",properties:{name:"Venezuela"},geometry:{type:"Polygon",coordinates:["@@yȣӱĭ˜ϡYѭυӥ͆ڙδÆȌ؈ʻ̒§َਸ਼΀řІ̎ˆ̞ןל_մҵ˧ݮQ࣌ĔӖϕٞĻҼʾXɄਨ¼৖\\܉ʛ˼Їڦ×ِЯƆڧѬn͢ȣڕӱó̫˾̷ȽƽԫƉjϱɫɱّ֪Őʁ̭͍ऱ̽׿Žʏȣڛɀثņƿýϔɑ‘֝ŜՉ܆ï°ǭ׷ʅĭΣΉƏسȝNjʱٷÅҧѼʯ࠺ɟ̧̌Ȅюм…ȊʅʠǛ֒à׼Ȉ˰ƲҎ̓Ơӏĩ؁®ͻęסܢӥńઉăȧ̊ȷê‡ǬĴ̶áͺȃȂŅϮѡÈɸӮĺ׶ʔ̸͘ʌɈрդƖ"],encodeOffsets:[[-73043,12059]]}},{type:"Feature",id:"VNM",properties:{name:"Vietnam"},geometry:{type:"Polygon",coordinates:["@@૭ܗ۫ߍȁ׍٠ࢭ޺ળނԱԞګϪ།ŕ๓۫փ१եۇ۫਷ޱ̧ՠʀ֬دӌܬ͸ࢦÔσԚප٨ļ৖ț֖ƶࡀɃצٍאՋ݌ۥ঴৓Ԋʊ̠՞ɘ͙ܺਙPϕކӭڐҊȴڢIࠈĬܒ҄К̿ސƵƃӛАͿࡎɓ"],encodeOffsets:[[110644,22070]]}},{type:"Feature",id:"VUT",properties:{name:"Vanuatu"},geometry:{type:"MultiPolygon",coordinates:[["@@ˣō˭ςŒɤՆӗ"],["@@ƌڱɥŀǩ­ťɴi٢Дʵ"]],encodeOffsets:[[[171874,-16861]],[[171119,-15292]]]}},{type:"Feature",id:"PSE",properties:{name:"West Bank"},geometry:{type:"Polygon",coordinates:["@@@ԣŭʙЃŕ˜ɜɌŚɁĦǬ̤֔ś"],encodeOffsets:[[36399,33172]]}},{type:"Feature",id:"YEM",properties:{name:"Yemen"},geometry:{type:"Polygon",coordinates:["@@؉ɥNjύo˹࠷Οഇϻݩףυ±ʥºӭΑ՗lj۷©ɃµǿɛəÕŻɇеlˍœ׉¨ɓӬzҠƍʜǑتʋΊǚ¤đϨĸNJ™ξςˌđΠɞЮΊɓɬúॺnƸċ߼č͐¨ɂ˫ϺƖ׼ࢦ޸Ϛᝒ͒ڀ൳˞ח"],encodeOffsets:[[54384,17051]]}},{type:"Feature",id:"ZAF",properties:{name:"South Africa"},geometry:{type:"Polygon",coordinates:["@@ǏŧΣяɻћӇ׻ोࢁףԋًϣ࢛͙ѓ«ŇɷԛŰеDž࣫NJԙĹΏ¬ࡿͩܓƃԱͅϡoΣ̚˳fαϒŸśŏɦLӰ˙֞˔ƴs٤ս޼х܈AF׽તДдͪɯƘΫϘÓՈǃҌÖݤіB᷌ɨűӾߙûԟȈ̏׼ĒрϒЊʨȶДЦȚΠķВɽۂ£՞ȜĐʾƨДҚäʨ͂˪֔ݮغஒؤ΂UОƛ˲Ķ҂ċД஁ɔׯƫऩî̟чƶʏÑāʓɯ̿T̃ԆҕӮĜǢώْQȿؑıۥɑϛֵщ","@@νʶϻǟҕ҃͡Տـ٧̜ČƺˎҴƀƜ˜ʴФ̅ʪ"],encodeOffsets:[[32278,-29959],[29674,-29650]]}},{type:"Feature",id:"ZMB",properties:{name:"Zambia"},geometry:{type:"Polygon",coordinates:["@@ІϏɊ܋ƝɩǙڻLjۡ˃̇ʭޭѶɓᢇۗĂׯٍřӍͯĹ̛̅ßܵۓҭխ˳o˗ĬऱĠƯÚOêͧȎկ¶ۋȑչԾ֣یžᦶშYí̂Ű̀ƧЀĪТėʺ̂q¶ʽϾrՖûˬϡڨŝԤˆȌѯ٠ş̴ΧΈҥ٠Që࣠ɱƳח͞ɧƬļࡈƬসȉψʈ՚ɤĶ଀ƚͦđΘɇͰƗՖƗӊʧ"],encodeOffsets:[[33546,-9452]]}},{type:"Feature",id:"ZWE",properties:{name:"Zimbabwe"},geometry:{type:"Polygon",coordinates:["@@ҁČ˱ĵНƜ΁VՙϞٯźʙՒC̒έĞ्ई˃ӢǛƮ͓ڤलğ˘ī˴pҮծܶ۔̜àĺ̆ӎͰَŚÆ̻۬hϴǯǺȻАÓѦˑF੟Ǐ׋—عƊʝħӵŵùɛ؅ࢫ॓"],encodeOffsets:[[31941,-22785]]}}],UTF8Encoding:!0}
-}),n("echarts/util/mapData/geoJson/xiang_gang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"8100",properties:{name:"香港",cp:[114.2784,22.3057],childNum:1},geometry:{type:"Polygon",coordinates:["@@™@}ScTʟ@cWuJÁ–]„l¦RLj¼BĄà˜ ŽH@TOHCTDDDHDNAT@PEHDDNJLX@BABALHFF@DKHADBBLDHHFBLEJB@GDBBFBADDB@@KFAFBBJJA@BB@@FFDDADFF@FADDDBJC@AFBD@@DDD@DAA@D@DB@DHHBFJBBFEHDFAN@DGDC@DLCBDDCFDlAFBFCBEF@BC@GDAB@FD@DZJ‚X´HĐMja@Ý`p_PCZ@lLnRGSDMFK|a\\Y}­ƒ§™Mën"],encodeOffsets:[[117078,22678]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/xin_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"6528",properties:{name:"巴音郭楞蒙古自治州",cp:[88.1653,39.6002],childNum:9},geometry:{type:"Polygon",coordinates:["@@˜@ÈÒĊanwŎV„™Ȯ¦ͪŃĢ„ÜōȂçČéƐżLɆóĊ‚ĊaʊŁ±¯²Um»ˌmÈ»V™ʠţWÑůǓ郙ôƑƒğÆīŎī@Ƿ™wô™˺LÞ¯ƨVǪуšĢ™ȘV°wĢŽôk°¯ƒ»΀@Ȃ»ĸŽǔ@΀ƒ͔ôôLɆó̐ÝɜLɲōͪƒƨóŤK@ī@IU܃ÛmȻţǩÝ˹ÛljťǓǫō@Ɲ²¯VçōKͿŁΗÇţ»ƽ™ɅƑLÓŏÅÅɱV@ÝĊU¯ÑĊĭÞLšÞŎJ±̃XȣˌōlƒUÈ¯ŎKÆƅ°™XÑܱnŗġV¯™óaUƒƧUōŁ„Ñ™±„çɲ¥lĉkğ°ƒk¥˜ƒnğţL¯ÝÝUƽĬ΁lķ°@„ō„XÿݯV»ŹLʉÞɱŤĉó°ÝJ™¦ÝKÝ£ţܙÈĉ@ƒxǩUċƑ@ky͓¹™`U²ĉVġ»ğa¯¥ť@ĉ™‚ó@ŻÛÛJƒw¯nó¯ġWƽʩķÝɛwĉĕݼȭÞķō@ó£Å΀ƑŽ¯ôȯÞ¯Ȱ™ÆōèĉXǼó@ݚnºƒĸ„ÞVƜĸȚUʶõˀĵĖɱŎÝĖVࢰӒѢ°˘nϚVˌ™ÈmɼĵŦW¤öʊõʔ@°ÈXVŽ™ènŎȁb¯ǫĉ„±Èğ`ġwōÔğ»mVVŽ„Ý¥ó@™ĸķô@ššbX„ĶmV²²`Þ_˜˜ɴbͪÈ°„ÞWĸÈŌmބškɲŽÈUÆ»n¼ǬVķĸźô¯°n¦ɄǜÈ"],encodeOffsets:[[86986,44534]]}},{type:"Feature",id:"6532",properties:{name:"和田地区",cp:[81.167,36.9855],childNum:8},geometry:{type:"Polygon",coordinates:["@@ƨ¥šèź٨ΘƑᩄbUࢯÞĕɲōĶĕöʿVʵķșUƛƒÝ„ķm¹Þ™ô@È»ĊWŎçšÅ°ȯȰÝ°óƒÆͿĉ»̽çnƒmɱĵƧºóU™™ƽ@±wóL¯°̻L±Æ¯Vƴķb¯VÇ¥ğ²Ǖbk¥ÇKlÅɱġ@у™óK@™ÇaÝXğţxĉČǫķê¯K@уaŹ„ƑKƒ¼¯Vóaónġw™óÞéU™ġbóĉğÇl¹™aUóğKW„Vůn›ÇŋƑ›ķnʇ»óxĉw™çÇ°Åw™°ċ„XŽ™„ób±ƒkÈÇJ—ƒm²ţx@ÒݎšŦǺn„ó¼n°ÇbUÒ±¼XĸĠłƽXmwĉºƒzÈÜmnxmx²ĖmҚbnŽƧêUºĊêÆVóĖóUĉ¼ÅĬƑ°ɆƆŻŚlłÞLš¼nĠƒ¼@ޙšÞź@ŎÞ°VšɄɴжϼِ͈Ŏ„"],encodeOffsets:[[81293,39764]]}},{type:"Feature",id:"6522",properties:{name:"哈密地区",cp:[93.7793,42.9236],childNum:3},geometry:{type:"Polygon",coordinates:["@@WnŐÆĶLĢ¦ţºź„lxÅĸƽŚ‚Ʉ—Į˜è@ô²ÞUĔƐńV°¯ĸX¦Ɛm̐bƒ»Ɇa΀šĢ™ƐLˤ™ȘÑnƒІljĸÿn¯ĶaŎ¯ĢĕȘ¯°΂œla¯¥™ǕǔwˤӱlťО̻nŻmɃĕċţUw°WUóƨÅţķ°ýV±óÅǓéʉ¯ƽŁƒéōǖȁÝƏůǕw˹ǫȗǓƧǕVý™é@ĬţLƧôͩ„ɱŎɛK̏ÞɅôóK@²@°ōؚ¼lŦ¯ŰóƜÛlV¼ķ¼ƒ°kȰ™Ű„ĠƒǬ™ŚÝŎmĖ`@ÇÜn„"],encodeOffsets:[[93387,44539]]}},{type:"Feature",id:"6529",properties:{name:"阿克苏地区",cp:[82.9797,41.0229],childNum:10},geometry:{type:"Polygon",coordinates:["@@VƚxˌŎÞŎƒ°n„ȂÒ°²VĊ¯VğƾˍǬƨÞÞKÈÞĊVźôɆÞĢèŌôWČ²ŤVÞĸʶbl‚¯ôn_VÆĸlmÞnVź_ĸ¼Ȯmǖ„šéĸW°°„ĸJ„kʠ¼Æw°¤ÈƒlxɆzČºĶI²ÆǔUš°ô@Þ¦‚ƒUnUĠ¼ŎÓĢxĠ_²ÇĊƒǬ°ŽȂamōšçUÇW@¯öʓõʉX£ĶťnɻšÇUˋmϙ¯˗ӑѡᩃaΗƒœɜ°xWƴUxɃÒˣ¤Ʌwğ„ʉōóÝŹ±°ȗ@¯„ƃ²¼","@@ō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘnIÇŃÛÝĊÑĠƏ"],encodeOffsets:[[80022,41294],[83914,41474]]}},{type:"Feature",id:"6543",properties:{name:"阿勒泰地区",cp:[88.2971,47.0929],childNum:7},geometry:{type:"Polygon",coordinates:["@@ɲˣĊIÈ¥‚ÅU±Ċýkō°ƒĉƽó»ĶƽXóʵʵ™ȯƑÅȁɅ¯ĉ@ÇሗK֛@@ˤV֜ʵрƒǬVĸƑŎ@ƆϯÑóŽķ@ʇ»ķ¦έmlÈĸĊX¼WźÛÞÝѸ‚ĢČþ„ĀĊôάVö¼ĊUƨ°°èŎČUÜƐóôVôôŽ²êȘlˌç°`n²ǬŽĊaš™ƒÛ°±kğmm»š@°ÝɆÛÅÇVaݍVm͔ğôÝÈb‚„@„ƒ™n¯š™ÜUĢÑĊ@źīżWŤÈǖWôŁÆI²ÓƨL@ŽĊX„mmÑÆ»ȰÑkƒĶō@ý°m—¯"],encodeOffsets:[[92656,48460]]}},{type:"Feature",id:"6531",properties:{name:"喀什地区",cp:[77.168,37.8534],childNum:13},geometry:{type:"Polygon",coordinates:["@@Č@°ƒĠ„ôÓô@Ŏĉ@Ƴĸ@Ť£ĢlVôWVóřXĉŤêÞ@ƐÒĢÑlèÈV@šĠIk°ÆŘ@ÈÈĀ@ǶťÒğ@š„@ÒĉlŻ_@šƧĖÅĬōÆ@bźÞnƒƒlVœÝĬšWƼʇ„ƒÝÅ@ÇÅÈwWóĉ±ğz‚ĬČƨƂÝIĉݯbÇÑĉƒ¯ʈV°xUŰĊ¤ƪ_ôÓɚI@lȚXȮ™ŎlɴȘ՘š„¦ɲÆʈ_ɴŽźŽôÞʊŎĠƒɆxˤ£ɄÑVwXƳ¯w›ɛŹ٧™çƧ¦ōƒُ͇еϻɃɳU™Ý¯@ōÝŹš™@݄»mğ™»ÝKkŁżřɅƅƒ¯ÆīĊ»ôVôĕÅUĉéV¹ƨém™anѱĕnwmwnÇۄyĉ¹ŹlŏkĵèķmōÞġKñÔċKÅèĉzƒŽ„ômxȗÿƿI@þÅČÝKÝ°@¼ÈVºš@ÅĢšÆUċłn„ÝÆǕČĵJm£ÝJ¦@ĊƒxV°ƏLċ¼ǩ™@™m@ÅĢómÇÆğ¹Çš™ÆšĖÞKšx„wô¦ÆÑÆL²ÆƾŽU„Ž±ŚÅŻĖ@ĬŤÈñ„@ǔÇx„Èǃ","@@VÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁVé"],encodeOffsets:[[76624,39196],[81507,40877]]}},{type:"Feature",id:"6542",properties:{name:"塔城地区",cp:[86.6272,45.8514],childNum:7},geometry:{type:"Polygon",coordinates:["@@ήnĸ¥ʈ¼ĸ@ôϰÒ@ƅƒōUķƑǫʶпU֛܃LګK@΋ĸ@Æ£ÞġÅĠċšLV݄»™@Å»Ýnm¯š»nŻĊ@nķŃ@¯ómóÛÝǟ¯aÝóȭ¥ƒšōUmxĉbÇї@›bUº¯X¯ÆƧbVÒĉnǕw¯°ƑŽV„—ŽÇ@kx±Uƒšɱn™ŽÅKƒ„¯ƒĠǠU°ɜL@°ƒxnĬ‚ĀŋŎÇLƒŽğšϱÞέƜkôÅĀǕłƒĸĊŤUŰĢ°„¦ȂϰÜɨ°x@°żǠÆƈČVĠ»ČL°ÇšbĊÑ̐óÞlĶwބɆVÞwǬxǪţȼÜLŐĶˢ@","@@óKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°ɜÞʊĠğŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒašƒċƨbš™Vğ—w›ġ¯@Uōa™ĉÝJğÑÆŎkŎÞĀlźƒ¦"],encodeOffsets:[[87593,48184],[86884,45760]]}},{type:"Feature",id:"6523",properties:{name:"昌吉回族自治州",cp:[89.6814,44.4507],childNum:7},geometry:{type:"MultiPolygon",coordinates:[["@@መL@È°ĊȂɆƒÆĊ£„ťôWÓɆbĢÅŎƒÆ¦ČÑW¥°ķU¯ƏŃVē±Ý@ó—ç˜ĭɃƾřÆķkwŹƒŤ¹ġ¥ĵKŏÅXmˍщwǓ¤Ƒ@wóōVķ£ɱšġôÛa±Òȁ„óèţIVŽƽ¼k¤ó¹ġJmx—»ÝUƒ²™@ÅƃĸǫŎ„ĊmŎǬ՘"],["@@Þô°bÞǠôÜôn@°ĸń˜Ƕkłƒ¼UޙKğȂÆÝĢŤķ@@ΌڬL܄K@ˣȂ˭lĉńW¥ĵVÆý@ŃÞēUŃȗƅ@ŹƩǕĉ»k»Ç™VğóřX™ŻKƏŽċêȁèÛŎġƒͩń"]],encodeOffsets:[[[90113,46080]],[[87638,44579]]]}},{type:"Feature",id:"6530",properties:{name:"克孜勒苏柯尔克孜自治州",cp:[74.6301,39.5233],childNum:4},geometry:{type:"Polygon",coordinates:["@@ˎǫĠƽ°UUĉ¯±ȁÑmƒ„¯Ýōˋō™wUű»ÅƑ°ƒȘ@²¯ɳʇ`ɱŃ¥՗™ɳȗōkȭšșW@kəJóÔƩ`ĉ£Vů¯wU°ʇĊ„ÈÒ°aĊÞÞJŁċƧīĠyĊ²XôÇxÈÆÆ@„ÞʈƒÅ»™XÞīU›Ƒkm„ŹÝ@aŎÅÆīƨĕ@™ż`Ċk@љƒĠ@ŦÑ@ǵÇÿ@ÇÅŗl¯ğJ@™ÇUkçġÒƏÑÝ@ţéWĊôŚUŽóXUġkţ¤ķ@@ƴōĊó@óÔğƒ¯„ċ@@Қ¤kôˣŰ͓„k»ƒKX¯ċwƧôğɐšÒôIVƙš¯UķǬķšnŽ™¼ôb°ÒȰVVÈÞ°ƒĸó¤V¼°„V°²êƒlĢ҂Uƨ¦ôȰƴĊVV¼ǖIċĊ„ÞɜéšnČW˸Ǹša„řÈw±īšçĸ¤ĊšôšwšŽĸUĢ¦˜éǖĬ„Āô¼lÞkÒ°x°ƆÞx„šÆV²ǔ»„b°wގȘ¥°n„šŎV@°„„ʠè‚ŰȂb"],encodeOffsets:[[80269,42396]]}},{type:"Feature",id:"6521",properties:{name:"吐鲁番地区",cp:[89.6375,42.4127],childNum:3},geometry:{type:"Polygon",coordinates:["@@ôK„ĉǪa²¼lÜô@ʠê°Ĭ™ôȂƒ²ÑÜbĢóɲ™ĸ¤ŎUô@xƒŽǔ£ъxˎmƒÈÛ@‚_nĕÞōšř„ǫƒğšůlȯ„¯ĸ»U»Ükôƛ°ůkť™»Ŏŗ@¯@±͓óͿ„Ǔ@ķȁ¼Ϳ@Ƒ¼¯°ólġ¯xȗUġšƑ™ǩÒƧUÝ°˹Kóššx@ǸōĬÅĬƑĠ󃄚ǔêÆ°XÒʟŤUšÇ¼ˋnn¼±V²°ȂUŌݜbʟǔɅô@żǬaҎÈ"],encodeOffsets:[[90248,44371]]}},{type:"Feature",id:"6540",properties:{name:"伊犁哈萨克自治州",cp:[82.5513,43.5498],childNum:10},geometry:{type:"MultiPolygon",coordinates:[["@@ĉ„ÆŘȁ̐mÞ¯ĀX°±¼@ƾ¯ƴ°ŎÝþŋ¦WÜÞbȂĉźUœÇmwVUȂóô@ȰÝ΀nÆJn™ƾ™ʠ™ŌLČóǪ¯œ¥ǔaǖšŌaôÝĢLšx„ƒÆLšɲm„™²VlwÈ@˜Uƒƒ°¯ǖxĊmUÑƨa°Å°WV¹œa›ÇɃÈm¥°¯ŹóĸķǫUm»Å¼ÇVɱ™l݃ŋnķÇÝX¯ƒͩÇɳa——Ý`±_U±ĵnWƒ™a@™ĸóšķ™¯ǓV±ÅĵJċ¹ɅykwDŽ¯£Åxʟ»ƒlķI¯ƒX¯ķ‚™êǕƒȭnķ»Ź`±„kÞ@Žš„Ýô@Þ°xšŤŎIƨÆUxōš¯²ǔĬǬlUŚ"],["@@ÞĀlźƒ¦¯ĸŤKޙšƒċƨbš™Vğ—w›ġ¯@ţƽJ"]],encodeOffsets:[[[82722,44337]],[[86817,45456]]]}},{type:"Feature",id:"6527",properties:{name:"博尔塔拉蒙古自治州",cp:[81.8481,44.6979],childNum:3},geometry:{type:"Polygon",coordinates:["@@ήƛϲÝĠ™„ÈKŌōÿmī„w@¯ɛKV¯ğǟ°Ƒ™wġKóÞŋbǕ™Ǔb›¦ǩ°ċôŋKʟšƽšmšÅImŽͿŽȯÞó@ȁôUVnx›ÈŹVȁĊÝabŻ£¯°l„óxȂŤĸkĊšÞyĊêĊmĢxV„ƨÈŽĠX„ŽΘÆĠÔź‚Ɇţ°LXƾŤŤb"],encodeOffsets:[[84555,46311]]}},{type:"Feature",id:"6501",properties:{name:"乌鲁木齐市",cp:[87.9236,43.5883],childNum:4},geometry:{type:"Polygon",coordinates:["@@šŽWŽôŚUĠȚl¼Ċ¼ƪǖ@źȘƆ@ýlܚXVŘޙš¦V¼kĖó҃èkĊȁˮ֜@ǫ՗nōƒĉǬō„ķÆŚ@„±ÞV˜¼nwĢIôºl£ƾ»UŤJôçšó¯īʟéó@kÛ±»ǩbƒĊóLҍÇǫb@ŻɆóʠǓ›aŋÞȁVʉłĉbĉɅô"],encodeOffsets:[[88887,44146]]}},{type:"Feature",id:"6502",properties:{name:"克拉玛依市",cp:[85.2869,45.5054],childNum:2},geometry:{type:"MultiPolygon",coordinates:[["@@ɜÞʊĊýVaŃm»ʵƳƑʝȗīV¥¯ĉ°Ñ@ŃÅI™»ĉmğn™ƒaݚţL°ķóKĵĀV͈ĉłƾNJÆŤƒzXl°ƒÆL²¼źŽôÈĢǔ™¦l„ô°"],["@@ƾIŤ@UUwōa™ĉÝJğÑÆŎkŎ"]],encodeOffsets:[[[87424,47245]],[[86817,45456]]]}},{type:"Feature",id:"659002",properties:{name:"阿拉尔市",cp:[81.2769,40.6549],childNum:1},geometry:{type:"Polygon",coordinates:["@@nIÇŃÛÝĊÑĠƏō™гwȁ¥Ƨ°ŹÑķV™¼ÞêĊ»‚lĵšm¦ÅW@ĀôÈźaɜxÈbÞÆĶIОŘ"],encodeOffsets:[[83824,41929]]}},{type:"Feature",id:"659003",properties:{name:"图木舒克市",cp:[79.1345,39.8749],childNum:1},geometry:{type:"Polygon",coordinates:["@@VéVÇ™ţ°ğUĠ¯mk¯ó¥ķIġÿƏbƒ„ĉa±ÒĸĀlKU„_m»nwšŽ„m@ÈŤ¦ĉbÞ°±Þżł̦°ĢŁ"],encodeOffsets:[[81496,40962]]}},{type:"Feature",id:"659004",properties:{name:"五家渠市",cp:[87.5391,44.3024],childNum:1},geometry:{type:"Polygon",coordinates:["@@„çôÑlĕU»™¥ÝšUŗ™WkÛ@þVńÝĔ@ńÅþĶUX¦Æƒ"],encodeOffsets:[[89674,45636]]}},{type:"Feature",id:"659001",properties:{name:"石河子市",cp:[86.0229,44.2914],childNum:1},geometry:{type:"Polygon",coordinates:["@@lŁ—ǵm‚ĉ@mż™¼n°ÞmƼš@"],encodeOffsets:[[88178,45529]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/xi_zang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5424",properties:{name:"那曲地区",cp:[88.1982,33.3215],childNum:10},geometry:{type:"Polygon",coordinates:["@@ƨʔĸbܺÞwnxźbÞ°ô@„ĶŽĸIȼĊJŎÈôUšÝƒ¤ǔLސŎ@ĢŽȘblƒôL„ÇźçȤôLš¥ÞIÞ¯Ķxʊťƨ™ƿÑĉXVķŦ¯ȂKÇǕšÑ¯IUš£¯Óƿ£VĕōÞÿÆwƒƑ„£ǖxÞĕ±ÇÝaUÑȃU¯‚UōÈ݃wWŁĵ™±Ý„óĢÿ°IÞ±mÅĢ¯mÿ„¥°UnÑŤĢĕĶwǬŻͪwŎ¼źÇĢ„ĠĕˎŁ°óƨ¼Èa‚m@¥°wǔ„ǖ°ŽƨÇŤœšġƨ„ŎŃôbÈÛŎĊ°@Ġw²ÑÞJƃÆb²ƒ°êĊUނlȲƒV„ÈKĊÒĸĉ›»ÅôťUÅǃk¯@ǂÑklǁÅl™Ģ™VÑóƒ@°@„ÛĸƒV¯ƒÇĊ™n¯Uĕšƽ¯m›¯b™È@Ò°Ĭƒbĵ›¼„‚kxķýÇJk£ÝaUÑÅóĶǟkÓʉnĉƒÝ¼Ƒ„ó»Þmn£m™Č¯@ƒȮÿV¯ĸƒ™k@Ýówƒ»ğ„ġ±ǓLō„ƒšV¼Əèķĉ™è±b@Òţ„UÑóakƒl£™Ó@¯L@™ÇlUóȁš¯aġÈÅĕÝLķ¯Ė¯@WĬ—x‚ÒÈnW°ţôU²ǓÓġ²V°¯ôƒǔÝL—ċšk™š»Ý»Ýš¯ÞƒVƒwۄÝÇōͩÈĉċ»ĉm¯£W¥ţKkóġƏW@¯±kōŽÈ›b@җšÇaƒÆ¯a™„ƒkóŽÛƒÇ¦Ýa¯šÝ™ĉ@ǻۄmƒǓxķƛ¯lVĀÅÞġb™™ÇJUÅV™ĖƑW™zō»ōšƒW™n@è¯ÞóVkwƩnkźÇބҙޯƒƒýğÇUxÆÈnè±bĉÝ»ÈуwšwÞ@m»ÈV@ýÇ°ķ™xƒa„ݯXċ¥ƒÈóW@ôkxlnxVÈóĊkŤġ¼@°¯ŰƑL̻۱ŎÝV—Þ›VƒÇÞŎÇakƞ‚š@èğŎĸżšƾ°ÒšLÞôĠKȰĖźVÈÒĠ„¤™VôšŽU„ÈþťL@ôǬÞlÜÈnÇÒUŚ™@šĊƨW°™°Xƒ‚@ČÇþ„ƴĉÒķ¦@ŽĢôWĀôłUÞĢǬ™ź°¼š@ƒôV°„bUÆnzm¤ƽĸƒÈ"],encodeOffsets:[[88133,36721]]}},{type:"Feature",id:"5425",properties:{name:"阿里地区",cp:[82.3645,32.7667],childNum:7},geometry:{type:"Polygon",coordinates:["@@„Çƾķn£myVŃaU¯„ó™@¯»šŹġǫVÝóŁXÿġó@ĸ¥ĊуƳÈý@ċ„Wš¯X¯ĉƧ‚™š@VřÈÑÇmkÛǫÝ@óŦKÇýVƒ™U󚏃£ğÇÑŹUȯĕğLÝó™K¯Ñ™ƽķŻĠō@灙lƝÈbƍÈ݂„œU˜ÝÞU²ō̼ůƒK°ů@¯UK±—ĊƧbōÇmçÈġƒóšÅób™™źóš¥kīƯól™ç™KôĵUƒÅ„VŃķ¥nÅŏm¯¹Å‚™»@ÑǍóxÝkʇȤU¤ķb@ƒ¯ĊÇx¯ĸĉKm°šĀk¦l„„KnĬȀƾÛ¦WÆŐmNJĉ°ōUţ¤UšŎ°šŎKÞłÆ„Ǔ¦ƒÞ™‚™„ř¯bmUÝl¯Um™ğl¯£șwŎǫaÝnĉĶƒk@¯™K™šō»ĉn™aÞ»ťnkml™ĸ¥UŚŻkÑťƒĉV™ôó°LôīĠU„ÿĉǕÅz±Kƒ¤„²ō¤¯Ė¯UÝ¥Vĵ™óÈťÝwķșÑk¤ó„™ƒWýĵĕ™„VĠƒV󍃎Ǔ„ķ°k±VU±ţ¦UǟÝřJVљ¥XUċUŎlÛƆǕÆȗƆ¯wŏÞÅ@™šĉl݁óŽƒÒ™nUôńlxólÝôێ±™™LÛôÝL@‚ġ¯X¯ÇUżóa󤛼XÒġŎóLk¦‚ôżĸĠ™¼™KġƆô¦„ÆƑÔĉĶ¯ImÒ°¦n°¯Þl˜ÝČn„ƒÒšKĠޚĕkƒlýƾťœšôI‚ĖŤÒnƜm¼¯lnżóÞ@Ůó¦™ôƽĖċŚn°Ý°ôÈUƜƒblÞóŽ@Žǖô°UÈƆ°X„þôŽô‚lѢšŽ²Ėm¦°š@¤™XŽĊblܚzkºƒĖmX„šŎWVšóÞn°lĠxȚa°»żLźƒ„b@Æ°XĠÝȚxĊĕŤaȚ‚°È@„„@èŤ¦Ü¼œW˜ÞkŽÈ@V°lŤkŎ±²¦ƐUšlj°aÈÑŎbĢƒŎbÆ¥ÞIȘlššôVÈU‚™šb„kɲĶn„mnXb̼òƾĖŎ@ĢȂÑôÓĠĖʊšĊÔ"],encodeOffsets:[[88133,36721]]}},{type:"Feature",id:"5423",properties:{name:"日喀则地区",cp:[86.2427,29.5093],childNum:18},geometry:{type:"Polygon",coordinates:["@@ĶĖXþš„ôƒl£šÒĸÇÞxÇŦšôUĶÞ¦°V°ĕŎ£ƒ±„£²LÆyĊǖƒĀğVóĬ¯KóôUš‚ĊŦ„lҙżVÆķ¦kšlnŦmݼšbĊmŎ¼š™šL@°„lĊĵÞmǬbƍȚx°¤Ġknš°VÞkVn°aƒŚš‚š„Ýǔ¥ÅƒÝŁōL¯™ōV™Ť£ŎVĊ¯nljƏXÅÜ¥ǿƽmīƒLkƒl¥™ÿn¯ĊL°ķÈw°ĉ@ƑĸaV£ʈȣÞlôwȎ@Қ¼Æ°ºŐnmÆĸ¦UńƃV„óĶšLšèôkÅ°lĬ™¦Źôššôa™Æ„ôÇĢnèŎÈƨa˜ĉ²‚VLĢ»lţôĉUǂwkmlw@óôX„ÇȦ°WƒÞ„b‚wĸšÈ¯@þÇUn¼Ý@™x„xÇńÞ¼ĊŽ²amçÅÇVwĠȄþ°„šÝƒÑÈÝlŹƪmlxôU°Ý@çšm„XŎ™Ŏ¼šyƒXšĕÆUVÈIššĢaÆÝUÿ°kĸƜǔwn„܃ȼĊ@ޚ°™Þbȥ܄ô„lšƒ°b„ÅÈb˜™@ќa‚ǯUU¯Vġš»ƒ™¯aV¯Ç°Å™mnÑŤçǬVǬ™±ĉ¯¥Vĕ¯Ýk£˜ō—w@±ġÛ°ÇVїƒ@ۘa@ČL™Ƴ™„ƒÇa¯¤ÝIĵ¼U¥ƿōķÅţŻókÝóĕ‚¥¯™U»Æ£X¯ġŃÛkÝ°V°ó¼¯èWôÞĖ„ȎƒŽkĀƧĀówm¥¯JŹÝJݙōVVŁaݐƑ@ƒ˜ğŭǂ¯_ƒ˜ĵ—›VnxŃón›ƒĵxÇĖĉVÝÈğV™Ò󃯐±Żĉ£ķÆÅL™Ljĉý˜ţۃ¯VƒnV¤ÝÈ@°ÅÞݤ™ŰğŁm¦ÝxóKƒ¥ɱÈUĠôêVôÛ¼ÇWÝçĵaō¦óĖƧlÇĢƑŽnŎDŽV¼¼‚ºÛ@m¦ƽ„ĉmm¯ÝKÛç¯bŏłĬ™bƒ¼ÅLmŽ„xť°ÅU™šÝXkŽÝmĉ¦W„¯K„ÒknÝaV„Ýè¯KɅńÝKnÞ¯¼"],encodeOffsets:[[84117,30927]]}},{type:"Feature",id:"5426",properties:{name:"林芝地区",cp:[95.4602,29.1138],childNum:7},geometry:{type:"Polygon",coordinates:["@@‚VÈłVôÈk@š°K@ŽšÔk¤l„ôbVÒŤƒ@ѲašçĸĊƐçU»„™ŎƒǔKĢ²Ġƒ„¼ôx@ޚlƨĬ„Ul¯ÈLV‚šÞJ„°Ünʊ„wÜbXê‚VÞ¯°ššanaU°wƼɴÑWÑ°mÈýÈam¥Þ£Ť@„¥ôblÞĢ„ź¥ôxÈÅmݚ™ƒĕŃV»ĉōŤōnóƒ»ÈīķIUƒĠÑ°ġĸLÞ¯VÒƂ@Ābš¼WôÈ@V¼ôóŤKÈÑU»šwVǫżnWÒÈx™¼‚lŦ£ĊōŤx²¯@ƒÆƒU¯šçÆ@„¤°£„é°k°lšůÈó@¯ŤÇÈĉƒkkÿó¥ÝXķљÜ@ÒóŚÝ¯°ĉówÇ±¦ÅJUÒĉĀķw¯°mĖ¯„±akxÝÅnƒ™»lуK@¯lU™¯UVѯóĊ¯mōğVǓƅƒÞƒWÝÈÛ@ƿô¯ÜġzÅþ¯ólmôʇġĊÅUͿřŏȁˋŁóÇˡōƧƒÇb™w°Ķôk¦šÒƒnUþġҙÔkǔķèó@ƒ²@ŘōńĵyƒzġaݤÅIƒ¤Ƀť¦ğѯ¤ķbóš¯ó±ŽU²°¤ČÜVnÈƂ„ŚŎ°ôĢ„þÆzèVĀǎĀǘƒXŹÑ¯¤ówċķk¦šłUÒġzÇ@ƒ™ÆÝx@²Þ@Ƥ„Uô¦Uš°x„U"],encodeOffsets:[[94737,30809]]}},{type:"Feature",id:"5421",properties:{name:"昌都地区",cp:[97.0203,30.7068],childNum:11},geometry:{type:"Polygon",coordinates:["@@™ŽVĖm°ĉš„ÈU°ķ„ƒÜ¯@@ô„UÒġškš‚ÆkÈlŽÒ@Èl°È„VÆóŦƂœ¼‚a„ÅĢ™Ʉwnōw@¥Ŏ¦°ŹÞmVš°wnÿƒw„wÝw@¯šmÞŗ°wĠ˜ĸkÞğlĔ²¦°@„ĕĸwVóšal@nĢÇĊn°@¦šŽźUXçǔůĸVš™ÆK„ÈÝĠš²ÅĔô@lšŽÈ_m˜„zǖl„šaU¼ôwV°¯¦‚ĬÈa„l@Čǎ„¼™„nŽ˜I„xô»ɜ@ƨ¥ɆŁ„ŃǪȁkƛƨȍʊȡóĭ›@—ÈÇVƒůރĸƅmēƨť™ÅÈʉVǵ°ġVŭÅɧ°ÿnɛš£mƒķ²ŃóÑUĉ°mÇ»¯@mxUĀ¯èţ°ȁÝç„ġU¯ÆÇţÈ@°Çô™Ű¯k¯lƒê¯¤ƒ£Å@™èV°Å„@„±°ţwĉŎť¤kš»ÇwXÑŻmUǬ™xV¼ÇÒţLóôU»Ç@X󙻂a@ÿŁUÑÝ°ķK¯ĢğÒV„ĸJÇĬ„¼môţŎĊŎU¼Æ„„Ė™šnÞÇÆówŹ¦ġƒkÝóaƒ¦ţ@ݤn¦ÇbÇþ¯nXÒɳÒÅ»¯xVmb™b¯™Ý°UWéÛaƒxʉÛmƒ¯ÝI™‚UÇKk°ƒVƧīķ„U°ȭĀ@„ċ°nšm¤Ýnô¼ƒƒÞ»Ċ„ʊmlÔĵǠÆôVÒÞbl¤ÈIĸþlwƒœ»ĶŽ„a¯ī@њǰanœƾ°"],encodeOffsets:[[97302,31917]]}},{type:"Feature",id:"5422",properties:{name:"山南地区",cp:[92.2083,28.3392],childNum:12},geometry:{type:"Polygon",coordinates:["@@°ÞUĖ°¦²ĊôÇÜLǖĀɜŽȘŰÞLĸźêÞ@UÜUŤ°ɞ¯Ü„°WŦĀmŎ„¦ĢyVљŁl¥Čĸôx°£źÒ„Wȗ‚ÿȍUÿ‚çÅyƒýóġō¯ƒřŁmÇÛUċŽ¯£V±²°ôô™ĸa°£ĠÒŦ¥ɄŽ„£ÆJÞ£Ģb„yĶzŎŃ@ŗ„±ô@ĸçlǓšÓĢÑVý„m™Ñl¥ĵó‚¯̻̥™ƛǫÝһÇƧĉyţ¼ҍēVĶĉŎ°ĸmšÞVÝĸ™ÒÛaċ„ó™ŹĖƒèÈÈl¼k¤ÝX@`ސŏ¼Æō¼ÇçĉKUÝÝ£ğ¤@¦ġl¯Òġĉ¯óš™móxÝÞğVšƴċK@—b@ܘ„UÒ¯ÈĢÜ@²˜x—Ŏl¤"],encodeOffsets:[[92363,29672]]}},{type:"Feature",id:"5401",properties:{name:"拉萨市",cp:[91.1865,30.1465],childNum:8},geometry:{type:"Polygon",coordinates:["@@Ŏ²l@°‚XĢƐlôŤLX¦°¤ĊnČ¼ÇĊŎͪÞÈ܃„x„U°Ýޙ޼™¼lšČ™˜ŽÞK„Ǔ°óU¯Ģ±ǔÔV±ŤóX¯ÇmÑ˜wXī°@°ĕĸÞKÆĖĢÇ°bȂ™ÇŁUƒV¯wV™ó¥ƒVÅ£Ý@@±ÞwšÅ‚„È@ƒ¥nōťÿ¯Xۃɝ°ţ¯ÛVVÝ@ŹéķÝKȗůɛǕÿÛKóÈǫšǫUţèmҚn¯Æ°ÈU‚°b„š™¼UĢV°°V"],encodeOffsets:[[92059,30696]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/yun_nan_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"5308",properties:{name:"普洱市",cp:[100.7446,23.4229],childNum:10},geometry:{type:"Polygon",coordinates:["@@U‚ô²‚a@Ž²²Ķ¥œV°šĶ²bl¤kVxl‚@œ°‚Ś²@˜„„y„@ô¦¯„@xƒxVxU„VššbVšÜm¼Ŏ„„ĢmºXXWÆ@ĀœšmŽmXU°ÅÒm¼Þx°w„@°‚XêĠ°»nV°U„l@k„@V±ôī@£‚ƒČŃÆ£„KÞý@¥‚k@y„a@—nWV„UVƒšwƒmƒ£Jƒknm@wmkn‚X„˜šX„¥mUUlUnbš¯°ŽnkƒVInlIUw°n™mk@@mlanXlanmšk@wVWUw™_@éĠašnmUaÜ£ƒmXƒ¥¯@@„óUmݯ¯ÞÝlKnxô£š»„»Ġ„J°aV„UÝÿV¥ÛbƒI@wmŽón¯yÛL@ƒWkŎmș`IWa¯K@¯mUnmaXm™bmak„¯ŽƒĢ™ÒÝm¯mV¯KÇb¯KۜWW™X@a™V™knċLUWV™kXóW@k™a@ƒób¯Uƒwmb¥UUlaU¥U£maķšƒKXkƒmÝ@kwmѯk±ċbUUVakaġ¦ƒƒkL@`ƒœ™a¯xƒm™Åƒ™LUWƒ@ċnŎUV°LkL@b°°@¤š²ƒ‚šnôôk„l°kè›ÒÈzV¤È„WôôƒnV@„ƒ¦@¼Ux"],encodeOffsets:[[101903,23637]]}},{type:"Feature",id:"5325",properties:{name:"红河哈尼族彝族自治州",cp:[103.0408,23.6041],childNum:13},geometry:{type:"Polygon",coordinates:["@@°°nÞôV@ƒ°@„¦WŽ„nÛ¤Vbmn™ğb@êš`VxUX@xš„ƏÞUnn˜WÞĸĢƒšÈ@ŽÇè@zÛÜWšÅêlš²„˜KnV¯ĖĊx@bk@@„°JÆ£Èbl„nnm°nlUkVUUwVm„Kn„‚nVŽÞxVLX¥laX@@xl@VzȎVmšk@b°šÈĸmŽV¦`W„XšƒbUb‚bX¼°x@ašVVkn@lþnXUlVxŤÅ„y‚IUƒka‚IŎĊ@lXx@b„z@‚ô„ƒ¥„_V@l‚n@„ôy@al_l`nmƒÈ»@kƒmXwWK™U¯»™a™Å@wƒmUÝKUa™UUƒ™wWƒ@w²»@kƃV£—mm£VKkÑV@@»nwƒ¥™ƒ@kƙnllIVlnLVakalknJšWmnaUaVÑVVލn¥m@ƒ„¯Uÿl™@™™™VçƒaXaV¯UyVLVkš@nJlšXLlŽkxlbla²Òl@nVJVkšx„KlkUaVķÝÑU@Åm¯@±™Uó°ğńķĠmU™Ñ@ǯ¯Å¼@nml@°¯¯`@w™£@¯Çƒk@ƒ»nmċ¯U»™I™Ž¯LÇĶÛn@bó°™U›šwmŽ¯„™Umǯa„™ƒ™ƒI@ykIƒVUŽ¯bƒIğŽƒ¼™¼ó¤mwkLÝÞ"],encodeOffsets:[[104243,23429]]}},{type:"Feature",id:"5326",properties:{name:"文山壮族苗族自治州",cp:[104.8865,23.5712],childNum:8},geometry:{type:"Polygon",coordinates:["@@šwô„š@²¯maUmôUÆxš@Xš˜bÞInlVUVw„JVaU„K°¥„xmÞXnlKlnna°@ĊČ„ÆwUmnkl@°ƒƒ£nyn@VV@Vak™ƒ@@kÞ݄bmx°Vnw°klÞInĖÞVlKl™@Xa°„„KlV„U@šJnx‚U@ÈĢbUKlm@ak_‚wšanWUk°ƒl»„k@Wk@lwU_ƒ@UalóU¥ƒÇnƒ™kJWƒ@mVXx±bƒK@nV±a@™Åa™£ÝK²ƒWknamKknǏk¯ƒaV™™V¯ĀƒU™„™Ò¥ƒI@mm¯¯xōW@@`k@ó»ƒUU¯lm£ÅWlĵ„w@mmwÅmWU@y±U—xmwU„¯Uƒ¥Ý¥¯£m@kŽÇVUV°VbklƒL™wUlUIm‚k@±ÑkbkalwkWKk™mI™@UlUKVzU°Wb„bU蚚@škšVĀƒ°@„n‚m¦ÝŽUUUÒVbmbXn™‚mIkllbUbmKUkkJmkŚ@lš„„¦mx@¼U@lÒULn¤˜nU¤Å„@l±¼@xX„šxV„šVVbÞLVŽ„n@xšÆšb°¼šV"],encodeOffsets:[[106504,25037]]}},{type:"Feature",id:"5303",properties:{name:"曲靖市",cp:[103.9417,25.7025],childNum:9},geometry:{type:"Polygon",coordinates:["@@ȦlKÞĕUV¯Um¯„ÇVUnVVUƒĉn™ĊÇƾLn°°È„JÆw„@lbÞa„¦V„XJ°¯W¯„aÞJVkUša„ƒ@lKnÅmWUk¯a¯»@m±@уkkbWWX_WÓU»_l™kÑm@U»m@l@IWċn¯l@VanV„UV™UVwVx„KȄVmUē‚@„ƒn@VÝÆL„w„VVwnVlmkUVÑÇ°ka@k™ÿÝaÞUl£™›—ċĕX±±ĉƒa@UnVnalónk@wl™UVmkÝJ—aW™™@ÅwóVVnnb±°™@óƒ™xXLWx„n@lǼn„m‚k_k`@bózƒ‚m@kU@ƒ`„¦óƒ@nWš@ÜÅXWw@ƒyƒb¦@ÒlnUb@x™lܐk‚@²Ç@Uƒ¯bmy@kV@bƒb„¦U`lLVx@b—Ll¼Þ¤@„°VVބU@WސUb›J@nnš@lnnm„šxUŽƒUUbƒK@šÇwklkUƒVWakn@ŽlbU@@„ULVxkKUn‚°¯Ò@¼™„kmƒ¦m@kl™Ȱ@lU„l¦„@Vl°wšnnþĊUÆbUx™b„ŽV„šĖU°„a‚nnašV„al@@b"],encodeOffsets:[[106099,27653]]}},{type:"Feature",id:"5323",properties:{name:"楚雄彝族自治州",cp:[101.6016,25.3619],childNum:10},geometry:{type:"Polygon",coordinates:["@@mҁXU`Wnšš™@Xl±¦š„Uxnbl°knmKUx„„ƒxVôUx°¼ôÒȄ°JlnÞKĠœW°¦ƒ„Vx²JVwš_°¥@UV@@wnymknK¯I@‚™²b°ƒš£V¥šwU‚V„¤nLškÆJÈwôô°„l»Č¯ƒġVƒUU@@ƒ°ƒƒÝXl@U»°Å„@U„¯@w±¯VmUUlm@m™„ÑnIVyUwmak£Vwm±—@Çw@nƒ@UxkwlÇnL‚mkř@±Žk™ka@kóJV¯Ç»U£lw¯™Xalbl¥¯UXƒ@a˜™UaÈL@ÇVIVƒkaU¯mm™akLWkUJ¯Umxnšƒ@ƒkUx¯xƒ„mWÅīÝkkbƒŤƒbkxWmXwWk¯wƒKkƒƒLŤċń„@¤óĬU²ƒ@@lƒk¯VmU¯¼@xV@k°l°kbUš°nm‚VnUš@°„š„UVèރÆbUÒÞnU¦›V—¼lô„@Vl"],encodeOffsets:[[103433,26196]]}},{type:"Feature",id:"5329",properties:{name:"大理白族自治州",cp:[99.9536,25.6805],childNum:12},geometry:{type:"Polygon",coordinates:["@@lbœKVIUa˜@²m@b™xôÒÜxXLmbnšl@š„„K°šš¼k„Uô‚xôlV¦nJ„Uš™Ænšm„@šx„ÆwšbXšÆôô„LUVwôK@wlmšaVwœ@WknmƒIUmlnJla@_™@kÝmKUašÑm¯Xw°aUaVl»²JV„bÆJkôĶĀ²VVk„mšbVwUó„wƒƒVwnLlmk¯maVw™ƒ²¥Wkš@™™XmV_‚WnÑUkƒ@k󘻜UV¥ÝmVÑÅa݄UçƒVƒ™@¯V™Umn¯mV™lak¯l¯U@@wğŽW鯁ƒ@¯xÝw¯š¯Jċa¯U¥mLU¤„bÞȤƒbÇLWUwmIUVW¼kbš`U„Vb¯L±ĊÛkƒÿÝKkwƒKţê™UĉþƒÈƒV¯ÞVbUŽ°KVšk²Ý‚mI—ƒmV@kƒm™UkšVxm„¯KXÈķJU¦V°ULWxšL@môƒšb@bkx±LnVUŽVLnkÜWnwlLŃmW@kkJU_ƒV„šWĊ„Þ"],encodeOffsets:[[101408,26770]]}},{type:"Feature",id:"5309",properties:{name:"临沧市",cp:[99.613,24.0546],childNum:8},geometry:{type:"Polygon",coordinates:["@@‚xĢ„l`²X°ŽV„šx@x°Þ°KXašğUњW‚bnIl`X²°b„xl°„„šV@xVxk¦mb„l@xšXV‚ÆzX¤™Æ˜k°„kx@lźêlaX»VUnJVx‚XÈK„aÝȣƒaV£nKV¦°‚Čb°I°™n»ÆÑV¯nWn›™@ÿXÅWWn¹ƒġōƒn»‚ÛU™™aU™VƒUw„w@w°ƒó¥ƒ@ƒz—ƒ±@ř›¯@kUwlk£±aĵŽ¯™›Uĵ¦±±@bó±VÝ@ó¤ƒw¯I@mńóm±XŽ¯IólƒK@š°Ullb™zkKlln@@ԙºƒUmVk²ôҙx™ŎUVóLƒb„ŽmÈnŽmbnl‚a„x@z„@Ǝ„¦kš"],encodeOffsets:[[101251,24734]]}},{type:"Feature",id:"5334",properties:{name:"迪庆藏族自治州",cp:[99.4592,27.9327],childNum:3},geometry:{type:"Polygon",coordinates:["@@W™Xwƒ™@akk@y›—k°īX¥›Uóķ¯w@n»UaVaUۃ¯ƒmV¼k‚™Þċô@n¯xÛÒm„V‚¯Ô@xƒ‚@šk™wm™Åa@ƒUa‚݁¯VŃyV„a@ÿšn»ÝVmank™mmÞÅôƒ@n£±›ğzÇmU¦™Vm„nÜmbn@°nV@xmzÅ@mºV¦k°ln¤š¼õô„n@xkƃIUxUš@Ťƒ¦VšmVkmkXW¤XzVx@ƚx™¼ƒÞ¯b@lVš™ĸގV„m¼XŽm¦V„ŽÞ@Ǝš¹Vón¥ÆKn„‚KX¯x@èĊȱłXšaÆxnlV@UÛlȻkğV¥„m²ljmÅÞĕƒƛm°„ÆmX¤mznƃŽV¦ÞVVb°bnÞWbnŽ°l@V„È@„‚VĵĊ±@ó„InxÆw„¥@£Þ›W¯ĸ£UƒUK‚ƒk±akkkbmWmÈķ„aÆÇU—ȃÆW@wmknmU¯"],encodeOffsets:[[102702,28401]]}},{type:"Feature",id:"5306",properties:{name:"昭通市",cp:[104.0955,27.6031],childNum:11},geometry:{type:"Polygon",coordinates:["@@mƒnK@wmƒUř¥mšóXǓŏmX@Ž—VƒmL@xţ™nk@mlUšŻÒğŋ@ƒL@mmLkm™š@b™XŎW¼ka¯lÇŹ¯aÇ»™ÝÝ_@m„@@a™@UklwUm@ak@ƒb™UmbmƒbV¯™ĕUƒƒšaVwÅaĉVmý™m¯xUkƒ@k¥VƒUXƒ¤VÈm`@„—ńÇÜ@Ākn‚ĔkƞÆĠ„™Þš‚U„VôƆÞI@ŽUxƦn„l@ĊĊnxUÒ°¦Vb¯WUnWŽIml@xn„Ubô¤‚¼ÈxlI„»šKVš„@ÈԂJkšUĖ±ÆVb@nœ„VÜVUVƒšL„wĠl„kn„Ġ@nx°¥Æ„²mUwƒ@m™mÅUl¯UњÑUm„Lll„Il±š@VkwƒW@w°@U»™kUóI°ƒ„»ĢтL„™š`nUĠ²lm„bôV@n„JUxƦX¦l@š‚ŎUƒV„@lV„KVřV£UaÞU™ƒnW@¯VU@ó™"],encodeOffsets:[[107787,28244]]}},{type:"Feature",id:"5301",properties:{name:"昆明市",cp:[102.9199,25.4663],childNum:11},geometry:{type:"Polygon",coordinates:["@@n@Vk‚VUn²°@xƒ°Vƒ@¯ÆV¼k@WŽ„Þ¯„@„@‚VVU„„Ģċ°k¼V„Ċxœ¤Ōœx°mVkƒÑȏšL‚°„x°Xœ°VmĊLVxUĖ°bX¦VW@kšȯlkn@„¥lnšƒ@»°Ñ¯VmlLUwVK@ƒV@ka@lmXb„UlVlkÈx@™„LVa„VV™wnƒmm@km™@mœIVaݏ@XƒVUݯU@ƒÝ£k»˜K@aUwkKV_ƒ¥„a@alU@nz°aV„È@@±lÛšk@wVakm@т¥„a„z‚@XxÆW@ÛX™@m@ƒy@aWw@kōĉJlbV„JƒzţÆUwVkmWkým@Ul™U@b¯wVºƒU™VUêšĠƒXUaUbVĊUŽWXUmkK™™WnUUU™V™ƒƒVV™Ý@kk±‚™¯ƒƒLkƒš±WkXlVklƒ@ƒwXbmLƒ›VUIVmk@Ubma@kkaVKUƒ™kmlXLWn™J¯ÒĊ°@zkºlLUŤn@@n›ô@lƁnmKkÈlxVw„@@mÈx˜@n²Uxl¤nbVxUzmJƒÒnš"],encodeOffsets:[[104828,25999]]}},{type:"Feature",id:"5307",properties:{name:"丽江市",cp:[100.448,26.955],childNum:5},geometry:{type:"Polygon",coordinates:["@@l@™„@w°ÓUnƒÜÑ°w@mČóšÝlU»n°„„VÜUbVbm¼@Ž°xôĸœVW¦¯Ĭlœ˜@zll@b„šWxXš‚a„X@ÆĠÆaXwl@XaƦn¼˜Jn@mnKW¯È»V¯°ak™VanXVwl@VyUĕVU„bÈīlaUk°ƒk¯lƒ²V˜Ukƛô@ƒ„I@mVwĊa„™ƒVaka„™ÆbUŽVLšaXIWKUw™ƒ„aWÑÅKUaVk°ƒ@Uw„ƒ¯¥›XğÝLkm¯Iǃóѯ»™aƒnUl±UĵÿlóÅIƒaU‚±Ik¼UŽVb¯bWxn°™ÒVbnLlޚ@@`kbmIkŽVn„JmnXl›@Ux™bkn@xóLUxVŽƒKóóŐW™™aÅxƒŽ™wƒ@™nÅm™šƒV™„ƒôX„ƒLlVU¤ƒb¦m¼™Ž@ĀƒbU‚„zUƂ°ÞVb@„Æbnššx"],encodeOffsets:[[101937,28227]]}},{type:"Feature",id:"5328",properties:{name:"西双版纳傣族自治州",cp:[100.8984,21.8628],childNum:3},geometry:{type:"Polygon",coordinates:["@@l²°ŽnÒlxÞ@„nWl„Lĸ™nbV¤V¦kbVV‚¦na„x°Vôa@„šb@lôXlWUšVXČKlmššU@bšWXXܛ°LÈa°LnU°‚ÞnšÑ„ġ°lƒnbšaƒ¯¯KWƒœó@kmK@UšĉV@k°„VV¹„a@y‚_ċl_nÓlL@anI@ƒóWl£VU—ƒl™kĕl™šKVw„U@™kVƒam¯ÅL@bƒ‚Ýk@Vn„UbÇbÝwÅ@ċ¥¯lk‚¼ÅŽ™Ò°b@¦nlUn@ŽÇV„mƁbWôU@ÝÅōm™¯ƒaU™™mk™WWw—@±ƒ™n¯U™è™a™Lƒ¯mƒL™škwƒl@°mnÈÒ¯šów@V™xƒĀU¤°Įƒ°Xl"],encodeOffsets:[[102376,22579]]}},{type:"Feature",id:"5305",properties:{name:"保山市",cp:[99.0637,24.9884],childNum:5},geometry:{type:"Polygon",coordinates:["@@X°„Il‚@¦ƒŽÈ¼m¼ÞaÞÅl„ÈxV¼šlVôÈÆlLޣȺlkUƒ‚ƒUw„¯UĕVwĊ@n¦mlnVĸIWÇ°LnƒUwl™šV„n@lnU˜„nJށl±U™¯LVUa°Ý„U„ÇĊýšVŤé„LlxÞL„ĀÜl²ĉ°KUaVƒ™_Źé@klw¯ƒlÅ—šW£ÅyU™W@wƒknal¥Uw@w™Uƒƒk¯ƒw¯aW±k_mJa™XVҙĠWb¯L¯Ý@w™wUƒ¯±Wk_ġƒwƒwōKmb@¤„bk°lĖƒô„UJƒšVnÅlťUš¯°VbnbWxX„m„ÞššWUĀ™L™yWzÛKmbUxVKkn݃kŽVšĀċ¤Ux„@Ž¯Žm@ƒ¦"],encodeOffsets:[[100440,25943]]}},{type:"Feature",id:"5304",properties:{name:"玉溪市",cp:[101.9312,23.8898],childNum:9},geometry:{type:"Polygon",coordinates:["@@l„„L°xXlWxXnlw„a„ţlaÞlÆĬnX„ƒ°wVw„l„@m™nw°VVIXllKšbnnV°lbU„UJ@ÈÇKVb—š@bW„°Vk¦kaWb°škxV¤È¼U°ôI@llblš²š@‚@œó@mm@VţkKl¹@yĉ¯°ÑšIXmWKnkšlV„ULlb@lnbVal@UnVJœU‚„nKWa„x„@lkkUlW²X„™‚l„K°„šl²@lšÞUŽ„U‚„UšVšVVXmššlLVnXWVUĉVaVb„W™ğVéšU„VU¹W»aVa„aW™Xƒ‚_U¥nÇķ¯™@a™lUnǍUyk@@wW@kbW¦UKÝwUmmƒƒLUnVxUVVlk¯mmnƒmkÇaŤ¯I@ƒl@@aĉw°ĕmU—L±ƒk™ÆéX™ÜÛ@yÈç@™Çġ„Ýķ—XmmÝVՙƒ™lmnkbmWkb@nl@nŽmš¯VxkJmUJ„ml¯™°makVVnVƒ¦™Wƒ—Wmnl@xmn„l‚I„¤„n™xU„ƒVUŽmX@˜ƒb@zl@¦Ýþ"],encodeOffsets:[[103703,24874]]}},{type:"Feature",id:"5333",properties:{name:"怒江傈僳族自治州",cp:[99.1516,26.5594],childNum:4},geometry:{type:"Polygon",coordinates:["@@WyX£lWlnnUU™„¥@ţV™Vw„JlÅ@wƒmö󙻂£kml¯U¥n¹Æ@ny@wmU@¯mnamÛnƒšUV¥ÈnĠy²œm¤„@ÆónݚnmlnbÞU‚¥„aV£kU„KWƒ„óšƒmIU¥ókwVólƒ™»¯™ƒL™ƒk@m™naWKÛwóњw@a±n—@VbUJ›LkaƒÝXĉƒ™„UV`lI@lnXÆƑkKmxÛXmlUKVmU²Klw@a™aó„@n™KXwVKU¯V¥mUnkm¥ĉ@UxVĖƒ°Vx„V„klmޙkKWĀkVWšnl°Lnm@°ŽUxlV@nk¦™JVÈ°ŽVÒ@nX°@ÆlUômlnôƒ²nxmłnVV„¯x@Èm°XblVUšl°@xkXU¤WXX‚W„Xƃ„mkÅJmށw±bƒxUīkKmÅVUĖÝèV„kx@š›lX„lnk¤ƒLkŽ‚Ėk¦‚xUššL°‚¯Ė@LnK@b°xVI„¥Ua°Ñ@»nm@¹‚KŎÞÈWln²n"],encodeOffsets:[[101071,28891]]}},{type:"Feature",id:"5331",properties:{name:"德宏傣族景颇族自治州",cp:[98.1299,24.5874],childNum:5},geometry:{type:"Polygon",coordinates:["@@„¥n@°@ƒVwČ£™ÿUlÞ„lmULVwnaÜLXyšzšKVÿ™XݙnƒWƒXwmaUa°¯V™ŦŽÆkUm„™VIƒ„ókĕl¯ƒa@£nama™@¯m¯œó@óyţbġkÅm±ÛammVkƒLwU`Wk@VƒkUmŃlUUKmbkkUVUwƒ¦óŽ°¼šbn°ô¦lºƒz@xšŽ¯„™@UŽ°nƒšU¤ţU„°VƆ@ÈmlnzÞl°¦Æa„xUxƒLkxWƒn@‚š²ŰšW„™‚@°ÈXl°Llx"],encodeOffsets:[[100440,25943]]}}],UTF8Encoding:!0}}),n("echarts/util/mapData/geoJson/zhe_jiang_geo",[],function(){return{type:"FeatureCollection",features:[{type:"Feature",id:"3311",properties:{name:"丽水市",cp:[119.5642,28.1854],childNum:9},geometry:{type:"Polygon",coordinates:["@@@V‚bVl@Xn‚UXƒKVŽ@¦nxlUXV‚n„KVmnL‚UV@bn¤lLXK˜²„`nnlJXIVJ‚I„Vnn°KnnVll@VLXWV@UkVaVK„zV@„ƒšVVaUK@U»VUl@@WnUUƒ@wVLn@Vwl@XW°LVbn@VU‚@X„l`@XnKVbkl@XVJlUnlV„„xlL@lnXl„@VšUnV°°„@a„UVLXblWVXn@VVUV@Lš¤VLV„U‚VbnalLUUVX_laVa„WVzXKV@@a@KUmImmXama@kU@yVIUK‚aVa@kXK@aWU@VIUmW@kkVm„Uš@VwUa@K@k@Uƒ`@kUKVk@UV@VaUm²Vy@klUUWUkVmUa@_ƒKVaXa›XmƒU@mUlWkaUXƒ@mmkL@w™JƒnVVÅbWKXa™@@I@aƒJUUÇ@V„UL™W@akLmb@K@a™XXw@mƒVmUVkUy@£@aU@@VkUWm@kUKƒXUWU_mW@wkkmJUUkLWWUXƒW@IkJ@k@mW_kӃ_Ul™Lƒm@I@aUa¯m@kƒa¯LUJƒ@mVVxUb™a@LUKkXƒbm@Uak@@a@Um`ƒIUbUJ@nUVW@@LnVV@lšUbVlUX@`š@blXklW„Ušm„Xlm¦U@@V¯bml@š@nUb@llnn@VbX@lV@ŽUVULmU@JVn„bVbkb™VWxU@@nUVk@"],encodeOffsets:[[121546,28992]]}},{type:"Feature",id:"3301",properties:{name:"杭州市",cp:[119.5313,29.8773],childNum:6},geometry:{type:"Polygon",coordinates:["@@X@l„°KXXlW„b@²„`šššb‚I„šX`l@„@bWl@n@VnLUV@V„@°¦@šl@XVlU@š@xVbUb@Vkb@‚@XVJVz™J@Lޚ@VmLUxUJ@LU„Vx‚b„xXUl@VaÈw„b‚aÞa@Vl@XUVx@V@V„LlbnV„al@lb„Vnn‚LnKnL@VlbVJXalIšb@KUU@mVInJ˜„U„Vl@xUšVLnUš@UÞaV@lkV@UanK„L@UlKVUnbÆmn@@nUlVnVJl@@UXU„L@WVIVJVxVLXV@IÜKnbn@V¥V@@I@ƒƒ„y°b@UUwnk°ÆƨVlUšçXm›£aƒÇ™IkVƒ@WV@@aWIUWUIkb@WW@UnƒK@UU@kaWVkƒVIVVnU@UWVUV@VmVkKkWIkVWaULU`UImJUImm—U@ƒƒwmwUV™IUWVkUamaU@mV—kƒb@KVU@aVU@anKULVJ‚U@kÛU™JUV›kkƒVakU@ƒaVwkW@UWkXmWaULUaUK@XƒJUUmƒVU@UVƒUkJ@ImwmKU@k„@lU„W@@akKm„kamIkWl_UwVm@UkaVUUaƒ@UamakbWlkL@aUalU@mkL@U@U™lmK@XkKm@Ýakb@xƒnXbƒ`ƒnUUU@›™U@™wU@@ƒmKkkƒV¯U@lULUbVbUb@V‚a@L™ºÝb@bLmK™x@VUL@bk@mxULWl"],encodeOffsets:[[121185,30184]]}},{type:"Feature",id:"3303",properties:{name:"温州市",cp:[120.498,27.8119],childNum:9},geometry:{type:"Polygon",coordinates:["@@ll@xnXV`VX„WVL@lXnlV@UV@@b@¤VzUlnV„U@nWxšW@b@LnalK@bšXVKUƒÈ@VV„I@b@Jš@WbXLÆaUU„mšI@xlKnn„@VWlbkXV‚@n„VWnœ‚WbUb„L@`VbUnVlVXkV@lUz±‚VnUbU@@VUlVL@l„_@V@l@LVbV@XLV`VÈlxn@lU@aœaVV‚k„@XJ@nl@@LU`°LVb„L°a@a„UVy@anI@a„a‚nV@²wÜJX@VšVV°k„na@WVk„aWwU@m@™ƒkƒaUĕ™ÝšÝŤnÈa„aóI›»@±X™WkUķ@kV±kw™ƒUkWw„™UƒÝ»ÛkɳlImaUaWóXÿǬk‚UnWVmmk™KţnŏÞğl™„UlUx@XWb„V@JkXƒ°mb@VULVxUVk@@LWWk@WIkšƒUkJmUkVmI@yƒ@Ua™kLm‚U@mUUUkaVk™@mK@UlUU@UmKmbUUUJ@n@KVLUL@VkJWXX`mnULWlkL@JVLVb@°kxkU@LVŽ™V@„VLV`UL@VUX"],encodeOffsets:[[122502,28334]]}},{type:"Feature",id:"3302",properties:{name:"宁波市",cp:[121.5967,29.6466],childNum:6},geometry:{type:"Polygon",coordinates:["@@Ċ¦ĸĀ°‚nXÞVšKškƨƑźÿ°»n„@wô¥ÜbœU°ÆXÞWóçĉݱIUƒÈ¥@U°wÆ»²mm_@aXƒVKÞVlk@akk›̅@£X»VwƏXWa¯aȗb™KƽۃĊ™xƒLóŽk@ƒƒƒ@¯nƒKUL@xkL›ÑkWULUUmJUXVŽU@mŽUX¯@V`mbXbV@@nn¤WXšx@škJ@nVVUVl²UbÝVUVk@Wx@V@„ƒVXzmlaƒL@VlLU`„XUVVVUnl@VbnJlnUVVnƒlUKkbmnn„VxlJnxmbU@UL@KUV™X@xmb@lk@mnVVUš™è"],encodeOffsets:[[123784,30977]]}},{type:"Feature",id:"3309",properties:{name:"舟山市",cp:[122.2559,30.2234],childNum:3},geometry:{type:"Polygon",coordinates:["@@l΢ƒʠþÆVĢLĊƒǬXĊ܄XôV„ÑÆw„ƒlšƏÈóVĭVǓ@ƒĉwɛkmK@ĉXīWaĉUĵÝmƒ¯ĉƒwĉ±±nż¯x@VǦV„²JĊÞôèÝXÅW¯›VÛaó¦@xƒŽmŽ¯¼ŹĀ"],encodeOffsets:[[124437,30983]]}},{type:"Feature",id:"3310",properties:{name:"台州市",cp:[121.1353,28.6688],childNum:7},geometry:{type:"Polygon",coordinates:["@@lV„IVWVz@bXJl@Xal@°„nLll@nVxnV„K@UJVbƒ¦°„k`UIWJXnƚ@bUJ„Xl@lb„Wn@UzVV@bVVšmVnnJVXna‚bšKUKnUVVUnVLlKVLXa„Jm£@mU@WanaU_°@VWnV@UVWnIVVVKlXœÒlK@wVK„L°m„@„„l@ô„Kšw„ĉƾůUƒl£@»UƒVk„m@ƅUƒƒaÛIŏmUk@m„w@a™£ƒWk@ţšƒIm±@ankôUlaU™Uw¯ƒōaƒbÇbţm™ÞšÞVĖ„b„l@š@n‚VXxƒbUl@XmbƒŽ¯lUUU™W@ÛI±xU@mƒb@bmJ@bUzƒV@b¯bƒKUa¯KV_@Kk@@mWIƒ@lUU›b@bkVm@kwUÇU_WKU@Ux™@ƒVUnllX@Vn‚J@UXV@bWL@lUbbVLUJ@z‚V@lnbWbnnnJVŽ@L"],encodeOffsets:[[123312,29526]]}},{type:"Feature",id:"3307",properties:{name:"金华市",cp:[120.0037,29.1028],childNum:8},geometry:{type:"Polygon",coordinates:["@@nbVb„@VbUVlb@VUnVxk`lXnJlbnƒlL@bX@Vƒ@klƒV@nLnx@JlI„V‚U@VUVn„VV„I@WVLVbVKXbWnXl@VlXUx„b@ŽlVUbl„œlVUšIÜVnalKX@@bV@@aUUlUƒwUw„@naWW„UVaUUšaVb„LlxXJVk°ƒUƒlkU¥@k„a@LVlXLVlšVWznVn@lxšJl_@WX_@mVa„a@alU@kVVna„KVLlK„b@UUaVašbnUWmXU@k@yVI@ařWmXIVJl_¯ƒ„¥UaVI@ƒLmUUw@mkkmK¯ƒk@Wbk@WI@aUyUXƒJkU@bU@WLUyƒXUbkbW`UVVkKmbUaVUƒUK™£@KVUUUm@UWkXWaUKƒV@b¯ƒ¯mU™V@UkƒmW@kkKƒwUƒmkkVUI@WlkUamL@Wk_Wƒ@UVm@Ua¯KWXk@Uxm@UK@xV„mV@Xk@UVV¼@‚VLUb™Uƒ„U@ƒyULUbVlU@@XlVUVVbƒU@lXXVW@XUVl@@VUVƒÈn@VVU„@lVa@„U„mL@`X@`WL@VUX@lUL@xlx"],encodeOffsets:[[122119,29948]]}},{type:"Feature",id:"3308",properties:{name:"衢州市",cp:[118.6853,28.8666],childNum:5},geometry:{type:"Polygon",coordinates:["@@XkVKnwl@@aVK@UšwnL‚K@aÞaš¹@Kb@UVaUaVaVK@k°V„UllnL@„V@šxV@œšV@VV„m„_Wa„m@wlaÞbn@lL@WnLšk@V@VlK@nkVVb@blKXklakw@wVK@kVW@UXK@_‚W@_nKVƒ@ƒUb@kVƒUUm@„ÇVU@Uk@VU@WUXWW@k„VUaVUkU@WWXUKk@Ukmm¯LmmƒUJUIWJkImmƒ_—±WLkKm£@aVUmKUnƒLmWUkVmw@¥U„LVWm@WUka@UmmLmm@@bUX™@@WUIm@UVUK@UVUUU™VVJmb@b„Xn‚mVƒ¼nnn¦mJUVƒL„V@VW@UzUlVnUbl`UnVl@XU@kl@bmÈUx™Vk@@J@„ƒ¼W@ÅaVVnzmVƒ„@WJk@kWJ@ƒlXbWbXxmVnšlLXb@°lKVXnWšbWV„„X„mbV@Xl‚bšI@Kn@@x@šVLlm"],encodeOffsets:[[121185,30184]]}},{type:"Feature",id:"3306",properties:{name:"绍兴市",cp:[120.564,29.7565],childNum:6},geometry:{type:"Polygon",coordinates:["@@„x@„˜VnnVJnIVJV_VKXblUXJlŽlLUŽUnU@UVVX@ŽmVUUUJl„XUlbV@@V„LVmX@@XlaVJVXXJ@b‚@XU„@lUšJ„È‚bœ¤Ō„JšçV™UUnml@@kna@wšWVU@LVKV@namwkIUwmƒnmlaVL„kUmVUkmmIUak@VmUUVUƒWV_kK@U„K‚bnkWy„U@ƒ@UXwl@VUÞUVak±VUUU@mlI@™™wXWƒIWbUKkLUKVmUUmVVL™LambUWmIUm™nUU@aUUVym@ƒXkak@ƒW@z@lWVXnmV™aUbVb@VƒakLUKƒLmbUU@lkV@bƒbUb@nW`@Xk`™Ikwm@mUXy™UUkWKUk@Kƒb@lV¦klV„¯„UlWIkwƒKUa™bVVUbƒVXXmbƒ@Vx„xkVVV@bU@@aW@kLmb@lVUIVKmL@bUV@bUV@L„a˜lnUV@nbVbUlVXšJVUnx"],encodeOffsets:[[122997,30561]]}},{type:"Feature",id:"3304",properties:{name:"嘉兴市",cp:[120.9155,30.6354],childNum:6},geometry:{type:"Polygon",coordinates:["@@@blIX@@VÜVUnn@l‚k„lKnI°Þl`²LVKVbnbVaVLUVn@W¦@VkVVb„@VI„`@blLnL‚aX@„VVb@U‚@XlVa„@@kVaUKV»U_lWXUƒƒ@alb„k@VllnLVKn@@UVIUw@y°IVVXU@VV@lw„m@wVkƾaœJ‚LkΡƧƒ™l™LÝUmW¯ķÿĉ¥ƒIŋŽWn™èkVƧU¯ÅmlVx@V¯aƒz„Ž@„@JU@U¦m@@šnVmn@V„LV‚"],encodeOffsets:[[123233,31382]]}},{type:"Feature",id:"3305",properties:{name:"湖州市",cp:[119.8608,30.7782],childNum:4},geometry:{type:"Polygon",coordinates:["@@kLlƒkm@VmÛU@UW@kJ@aUƒK@UnmmU@™maÛL@JWUUKUwUIUJ@XƒKWV@Vk@UIUmVk@mm@ÅnmaUVkL@VƒKmLVbU@klU@ÝbV™@mVUKV™@wUkVƒ—ƒmIUJ@nVV@L™akJWbUIka@UmKmLKmmƒUUVk@@nmLX`WXUV@Ž@nUl™kmlU@Ub„„ƒxVVšIlV„Žšnn„@@n˜„UҚ@„°n@@xmb@„VbnV@šš„@b@`@L@L@x@blVklVbnnV@‚aXb°VlU@W„b°U„LXWVUV™„™VwÈwÜ»ĸaĠnUVw²X@V@lVU@wlaUUVm@knUV›"],encodeOffsets:[[123379,31500]]}}],UTF8Encoding:!0}}),n("echarts/chart/gauge",["require","./base","../util/shape/GaugePointer","zrender/shape/Text","zrender/shape/Line","zrender/shape/Rectangle","zrender/shape/Circle","zrender/shape/Sector","../config","../util/ecData","../util/accMath","zrender/tool/util","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("../util/shape/GaugePointer"),a=e("zrender/shape/Text"),o=e("zrender/shape/Line"),r=e("zrender/shape/Rectangle"),s=e("zrender/shape/Circle"),l=e("zrender/shape/Sector"),h=e("../config");h.gauge={zlevel:0,z:2,center:["50%","50%"],clickable:!0,legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,min:0,max:100,precision:0,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#228b22"],[.8,"#48b"],[1,"#ff4500"]],width:30}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,textStyle:{color:"auto"}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},pointer:{show:!0,length:"80%",width:8,color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],textStyle:{color:"#333",fontSize:15}},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:40,offsetCenter:[0,"40%"],textStyle:{color:"auto",fontSize:30}}};var m=e("../util/ecData"),V=e("../util/accMath"),U=e("zrender/tool/util");return t.prototype={type:h.CHART_TYPE_GAUGE,_buildShape:function(){var e=this.series;this._paramsMap={};for(var t=0,n=e.length;n>t;t++)e[t].type===h.CHART_TYPE_GAUGE&&(e[t]=this.reformOption(e[t]),this.legendHoverLink=e[t].legendHoverLink||this.legendHoverLink,this._buildSingleGauge(t),this.buildMark(t));this.addShapeList()},_buildSingleGauge:function(e){var t=this.series[e];this._paramsMap[e]={center:this.parseCenter(this.zr,t.center),radius:this.parseRadius(this.zr,t.radius),startAngle:t.startAngle.toFixed(2)-0,endAngle:t.endAngle.toFixed(2)-0},this._paramsMap[e].totalAngle=this._paramsMap[e].startAngle-this._paramsMap[e].endAngle,this._colorMap(e),this._buildAxisLine(e),this._buildSplitLine(e),this._buildAxisTick(e),this._buildAxisLabel(e),this._buildPointer(e),this._buildTitle(e),this._buildDetail(e)},_buildAxisLine:function(e){var t=this.series[e];if(t.axisLine.show)for(var n,i,a=t.min,o=t.max-a,r=this._paramsMap[e],s=r.center,l=r.startAngle,h=r.totalAngle,V=r.colorArray,U=t.axisLine.lineStyle,d=this.parsePercent(U.width,r.radius[1]),p=r.radius[1],c=p-d,u=l,y=0,g=V.length;g>y;y++)i=l-h*(V[y][0]-a)/o,n=this._getSector(s,c,p,i,u,V[y][1],U),u=i,n._animationAdd="r",m.set(n,"seriesIndex",e),m.set(n,"dataIndex",y),this.shapeList.push(n)},_buildSplitLine:function(e){var t=this.series[e];if(t.splitLine.show)for(var n,i,a,r=this._paramsMap[e],s=t.splitNumber,l=t.min,h=t.max-l,m=t.splitLine,V=this.parsePercent(m.length,r.radius[1]),U=m.lineStyle,d=U.color,p=r.center,c=r.startAngle*Math.PI/180,u=r.totalAngle*Math.PI/180,y=r.radius[1],g=y-V,b=0;s>=b;b++)n=c-u/s*b,i=Math.sin(n),a=Math.cos(n),this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{xStart:p[0]+a*y,yStart:p[1]-i*y,xEnd:p[0]+a*g,yEnd:p[1]-i*g,strokeColor:"auto"===d?this._getColor(e,l+h/s*b):d,lineType:U.type,lineWidth:U.width,shadowColor:U.shadowColor,shadowBlur:U.shadowBlur,shadowOffsetX:U.shadowOffsetX,shadowOffsetY:U.shadowOffsetY}}))},_buildAxisTick:function(e){var t=this.series[e];if(t.axisTick.show)for(var n,i,a,r=this._paramsMap[e],s=t.splitNumber,l=t.min,h=t.max-l,m=t.axisTick,V=m.splitNumber,U=this.parsePercent(m.length,r.radius[1]),d=m.lineStyle,p=d.color,c=r.center,u=r.startAngle*Math.PI/180,y=r.totalAngle*Math.PI/180,g=r.radius[1],b=g-U,f=0,k=s*V;k>=f;f++)f%V!==0&&(n=u-y/k*f,i=Math.sin(n),a=Math.cos(n),this.shapeList.push(new o({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{xStart:c[0]+a*g,yStart:c[1]-i*g,xEnd:c[0]+a*b,yEnd:c[1]-i*b,strokeColor:"auto"===p?this._getColor(e,l+h/k*f):p,lineType:d.type,lineWidth:d.width,shadowColor:d.shadowColor,shadowBlur:d.shadowBlur,shadowOffsetX:d.shadowOffsetX,shadowOffsetY:d.shadowOffsetY}})))},_buildAxisLabel:function(e){var t=this.series[e];if(t.axisLabel.show)for(var n,i,o,r,s=t.splitNumber,l=t.min,h=t.max-l,m=t.axisLabel.textStyle,U=this.getFont(m),d=m.color,p=this._paramsMap[e],c=p.center,u=p.startAngle,y=p.totalAngle,g=p.radius[1]-this.parsePercent(t.splitLine.length,p.radius[1])-5,b=0;s>=b;b++)r=V.accAdd(l,V.accMul(V.accDiv(h,s),b)),n=u-y/s*b,i=Math.sin(n*Math.PI/180),o=Math.cos(n*Math.PI/180),n=(n+360)%360,this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{x:c[0]+o*g,y:c[1]-i*g,color:"auto"===d?this._getColor(e,r):d,text:this._getLabelText(t.axisLabel.formatter,r),textAlign:n>=110&&250>=n?"left":70>=n||n>=290?"right":"center",textBaseline:n>=10&&170>=n?"top":n>=190&&350>=n?"bottom":"middle",textFont:U,shadowColor:m.shadowColor,shadowBlur:m.shadowBlur,shadowOffsetX:m.shadowOffsetX,shadowOffsetY:m.shadowOffsetY}}))
-},_buildPointer:function(e){var t=this.series[e];if(t.pointer.show){var n=t.max-t.min,a=t.pointer,o=this._paramsMap[e],r=this.parsePercent(a.length,o.radius[1]),l=this.parsePercent(a.width,o.radius[1]),h=o.center,V=this._getValue(e);V=V<t.max?V:t.max;var U=(o.startAngle-o.totalAngle/n*(V-t.min))*Math.PI/180,d="auto"===a.color?this._getColor(e,V):a.color,p=new i({zlevel:this.getZlevelBase(),z:this.getZBase()+1,clickable:this.query(t,"clickable"),style:{x:h[0],y:h[1],r:r,startAngle:o.startAngle*Math.PI/180,angle:U,color:d,width:l,shadowColor:a.shadowColor,shadowBlur:a.shadowBlur,shadowOffsetX:a.shadowOffsetX,shadowOffsetY:a.shadowOffsetY},highlightStyle:{brushType:"fill",width:l>2?2:l/2,color:"#fff"}});m.pack(p,this.series[e],e,this.series[e].data[0],0,this.series[e].data[0].name,V),this.shapeList.push(p),this.shapeList.push(new s({zlevel:this.getZlevelBase(),z:this.getZBase()+2,hoverable:!1,style:{x:h[0],y:h[1],r:a.width/2.5,color:"#fff"}}))}},_buildTitle:function(e){var t=this.series[e];if(t.title.show){var n=t.data[0],i=null!=n.name?n.name:"";if(""!==i){var o=t.title,r=o.offsetCenter,s=o.textStyle,l=s.color,h=this._paramsMap[e],m=h.center[0]+this.parsePercent(r[0],h.radius[1]),V=h.center[1]+this.parsePercent(r[1],h.radius[1]);this.shapeList.push(new a({zlevel:this.getZlevelBase(),z:this.getZBase()+(Math.abs(m-h.center[0])+Math.abs(V-h.center[1])<2*s.fontSize?2:1),hoverable:!1,style:{x:m,y:V,color:"auto"===l?this._getColor(e):l,text:i,textAlign:"center",textFont:this.getFont(s),shadowColor:s.shadowColor,shadowBlur:s.shadowBlur,shadowOffsetX:s.shadowOffsetX,shadowOffsetY:s.shadowOffsetY}}))}}},_buildDetail:function(e){var t=this.series[e];if(t.detail.show){var n=t.detail,i=n.offsetCenter,a=n.backgroundColor,o=n.textStyle,s=o.color,l=this._paramsMap[e],h=this._getValue(e),m=l.center[0]-n.width/2+this.parsePercent(i[0],l.radius[1]),V=l.center[1]+this.parsePercent(i[1],l.radius[1]);this.shapeList.push(new r({zlevel:this.getZlevelBase(),z:this.getZBase()+(Math.abs(m+n.width/2-l.center[0])+Math.abs(V+n.height/2-l.center[1])<o.fontSize?2:1),hoverable:!1,style:{x:m,y:V,width:n.width,height:n.height,brushType:"both",color:"auto"===a?this._getColor(e,h):a,lineWidth:n.borderWidth,strokeColor:n.borderColor,shadowColor:n.shadowColor,shadowBlur:n.shadowBlur,shadowOffsetX:n.shadowOffsetX,shadowOffsetY:n.shadowOffsetY,text:this._getLabelText(n.formatter,h),textFont:this.getFont(o),textPosition:"inside",textColor:"auto"===s?this._getColor(e,h):s}}))}},_getValue:function(e){return this.getDataFromOption(this.series[e].data[0])},_colorMap:function(e){var t=this.series[e],n=t.min,i=t.max-n,a=t.axisLine.lineStyle.color;a instanceof Array||(a=[[1,a]]);for(var o=[],r=0,s=a.length;s>r;r++)o.push([a[r][0]*i+n,a[r][1]]);this._paramsMap[e].colorArray=o},_getColor:function(e,t){null==t&&(t=this._getValue(e));for(var n=this._paramsMap[e].colorArray,i=0,a=n.length;a>i;i++)if(n[i][0]>=t)return n[i][1];return n[n.length-1][1]},_getSector:function(e,t,n,i,a,o,r){return new l({zlevel:this.getZlevelBase(),z:this.getZBase(),hoverable:!1,style:{x:e[0],y:e[1],r0:t,r:n,startAngle:i,endAngle:a,brushType:"fill",color:o,shadowColor:r.shadowColor,shadowBlur:r.shadowBlur,shadowOffsetX:r.shadowOffsetX,shadowOffsetY:r.shadowOffsetY}})},_getLabelText:function(e,t){if(e){if("function"==typeof e)return e.call(this.myChart,t);if("string"==typeof e)return e.replace("{value}",t)}return t},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},U.inherits(t,n),e("../chart").define("gauge",t),t}),n("echarts/util/shape/GaugePointer",["require","zrender/shape/Base","zrender/tool/util","./normalIsCover"],function(e){function t(e){n.call(this,e)}var n=e("zrender/shape/Base"),i=e("zrender/tool/util");return t.prototype={type:"gauge-pointer",buildPath:function(e,t){var n=t.r,i=t.width,a=t.angle,o=t.x-Math.cos(a)*i*(i>=n/3?1:2),r=t.y+Math.sin(a)*i*(i>=n/3?1:2);a=t.angle-Math.PI/2,e.moveTo(o,r),e.lineTo(t.x+Math.cos(a)*i,t.y-Math.sin(a)*i),e.lineTo(t.x+Math.cos(t.angle)*n,t.y-Math.sin(t.angle)*n),e.lineTo(t.x-Math.cos(a)*i,t.y+Math.sin(a)*i),e.lineTo(o,r)},getRect:function(e){if(e.__rect)return e.__rect;var t=2*e.width,n=e.x,i=e.y,a=n+Math.cos(e.angle)*e.r,o=i-Math.sin(e.angle)*e.r;return e.__rect={x:Math.min(n,a)-t,y:Math.min(i,o)-t,width:Math.abs(n-a)+t,height:Math.abs(i-o)+t},e.__rect},isCover:e("./normalIsCover")},i.inherits(t,n),t}),n("echarts/chart/funnel",["require","./base","zrender/shape/Text","zrender/shape/Line","zrender/shape/Polygon","../config","../util/ecData","../util/number","zrender/tool/util","zrender/tool/color","zrender/tool/area","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o),this.refresh(a)}var n=e("./base"),i=e("zrender/shape/Text"),a=e("zrender/shape/Line"),o=e("zrender/shape/Polygon"),r=e("../config");r.funnel={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,x:80,y:60,x2:80,y2:60,min:0,max:100,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",itemStyle:{normal:{borderColor:"#fff",borderWidth:1,label:{show:!0,position:"outer"},labelLine:{show:!0,length:10,lineStyle:{width:1,type:"solid"}}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0},labelLine:{show:!0}}}};var s=e("../util/ecData"),l=e("../util/number"),h=e("zrender/tool/util"),m=e("zrender/tool/color"),V=e("zrender/tool/area");return t.prototype={type:r.CHART_TYPE_FUNNEL,_buildShape:function(){var e=this.series,t=this.component.legend;this._paramsMap={},this._selected={},this.selectedMap={};for(var n,i=0,a=e.length;a>i;i++)if(e[i].type===r.CHART_TYPE_FUNNEL){if(e[i]=this.reformOption(e[i]),this.legendHoverLink=e[i].legendHoverLink||this.legendHoverLink,n=e[i].name||"",this.selectedMap[n]=t?t.isSelected(n):!0,!this.selectedMap[n])continue;this._buildSingleFunnel(i),this.buildMark(i)}this.addShapeList()},_buildSingleFunnel:function(e){var t=this.component.legend,n=this.series[e],i=this._mapData(e),a=this._getLocation(e);this._paramsMap[e]={location:a,data:i};for(var o,r=0,s=[],h=0,m=i.length;m>h;h++)o=i[h].name,this.selectedMap[o]=t?t.isSelected(o):!0,this.selectedMap[o]&&!isNaN(i[h].value)&&(s.push(i[h]),r++);if(0!==r){for(var V,U,d,p,c=this._buildFunnelCase(e),u=n.funnelAlign,y=n.gap,g=r>1?(a.height-(r-1)*y)/r:a.height,b=a.y,f="descending"===n.sort?this._getItemWidth(e,s[0].value):l.parsePercent(n.minSize,a.width),k="descending"===n.sort?1:0,x=a.centerX,_=[],h=0,m=s.length;m>h;h++)if(o=s[h].name,this.selectedMap[o]&&!isNaN(s[h].value)){switch(V=m-2>=h?this._getItemWidth(e,s[h+k].value):"descending"===n.sort?l.parsePercent(n.minSize,a.width):l.parsePercent(n.maxSize,a.width),u){case"left":U=a.x;break;case"right":U=a.x+a.width-f;break;default:U=x-f/2}d=this._buildItem(e,s[h]._index,t?t.getColor(o):this.zr.getColor(s[h]._index),U,b,f,V,g,u),b+=g+y,p=d.style.pointList,_.unshift([p[0][0]-10,p[0][1]]),_.push([p[1][0]+10,p[1][1]]),0===h&&(0===f?(p=_.pop(),"center"==u&&(_[0][0]+=10),"right"==u&&(_[0][0]=p[0]),_[0][1]-="center"==u?10:15,1==m&&(p=d.style.pointList)):(_[_.length-1][1]-=5,_[0][1]-=5)),f=V}c&&(_.unshift([p[3][0]-10,p[3][1]]),_.push([p[2][0]+10,p[2][1]]),0===f?(p=_.pop(),"center"==u&&(_[0][0]+=10),"right"==u&&(_[0][0]=p[0]),_[0][1]+="center"==u?10:15):(_[_.length-1][1]+=5,_[0][1]+=5),c.style.pointList=_)}},_buildFunnelCase:function(e){var t=this.series[e];if(this.deepQuery([t,this.option],"calculable")){var n=this._paramsMap[e].location,i=10,a={hoverable:!1,style:{pointListd:[[n.x-i,n.y-i],[n.x+n.width+i,n.y-i],[n.x+n.width+i,n.y+n.height+i],[n.x-i,n.y+n.height+i]],brushType:"stroke",lineWidth:1,strokeColor:t.calculableHolderColor||this.ecTheme.calculableHolderColor||r.calculableHolderColor}};return s.pack(a,t,e,void 0,-1),this.setCalculable(a),a=new o(a),this.shapeList.push(a),a}},_getLocation:function(e){var t=this.series[e],n=this.zr.getWidth(),i=this.zr.getHeight(),a=this.parsePercent(t.x,n),o=this.parsePercent(t.y,i),r=null==t.width?n-a-this.parsePercent(t.x2,n):this.parsePercent(t.width,n);return{x:a,y:o,width:r,height:null==t.height?i-o-this.parsePercent(t.y2,i):this.parsePercent(t.height,i),centerX:a+r/2}},_mapData:function(e){function t(e,t){return"-"===e.value?1:"-"===t.value?-1:t.value-e.value}function n(e,n){return-t(e,n)}for(var i=this.series[e],a=h.clone(i.data),o=0,r=a.length;r>o;o++)a[o]._index=o;return"none"!=i.sort&&a.sort("descending"===i.sort?t:n),a},_buildItem:function(e,t,n,i,a,o,r,l,h){var m=this.series,V=m[e],U=V.data[t],d=this.getPolygon(e,t,n,i,a,o,r,l,h);s.pack(d,m[e],e,m[e].data[t],t,m[e].data[t].name),this.shapeList.push(d);var p=this.getLabel(e,t,n,i,a,o,r,l,h);s.pack(p,m[e],e,m[e].data[t],t,m[e].data[t].name),this.shapeList.push(p),this._needLabel(V,U,!1)||(p.invisible=!0);var c=this.getLabelLine(e,t,n,i,a,o,r,l,h);this.shapeList.push(c),this._needLabelLine(V,U,!1)||(c.invisible=!0);var u=[],y=[];return this._needLabelLine(V,U,!0)&&(u.push(c.id),y.push(c.id)),this._needLabel(V,U,!0)&&(u.push(p.id),y.push(d.id)),d.hoverConnect=u,p.hoverConnect=y,d},_getItemWidth:function(e,t){var n=this.series[e],i=this._paramsMap[e].location,a=n.min,o=n.max,r=l.parsePercent(n.minSize,i.width),s=l.parsePercent(n.maxSize,i.width);return t*(s-r)/(o-a)},getPolygon:function(e,t,n,i,a,r,s,l,h){var V,U=this.series[e],d=U.data[t],p=[d,U],c=this.deepMerge(p,"itemStyle.normal")||{},u=this.deepMerge(p,"itemStyle.emphasis")||{},y=this.getItemStyleColor(c.color,e,t,d)||n,g=this.getItemStyleColor(u.color,e,t,d)||("string"==typeof y?m.lift(y,-.2):y);switch(h){case"left":V=i;break;case"right":V=i+(r-s);break;default:V=i+(r-s)/2}var b={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery(p,"clickable"),style:{pointList:[[i,a],[i+r,a],[V+s,a+l],[V,a+l]],brushType:"both",color:y,lineWidth:c.borderWidth,strokeColor:c.borderColor},highlightStyle:{color:g,lineWidth:u.borderWidth,strokeColor:u.borderColor}};return this.deepQuery([d,U,this.option],"calculable")&&(this.setCalculable(b),b.draggable=!0),new o(b)},getLabel:function(e,t,n,a,o,r,s,l,U){var d,p=this.series[e],c=p.data[t],u=this._paramsMap[e].location,y=h.merge(h.clone(c.itemStyle)||{},p.itemStyle),g="normal",b=y[g].label,f=b.textStyle||{},k=y[g].labelLine.length,x=this.getLabelText(e,t,g),_=this.getFont(f),L=n;b.position=b.position||y.normal.label.position,"inner"===b.position||"inside"===b.position||"center"===b.position?(d=U,L=Math.max(r,s)/2>V.getTextWidth(x,_)?"#fff":m.reverse(n)):d="left"===b.position?"right":"left";var W={zlevel:this.getZlevelBase(),z:this.getZBase()+1,style:{x:this._getLabelPoint(b.position,a,u,r,s,k,U),y:o+l/2,color:f.color||L,text:x,textAlign:f.align||d,textBaseline:f.baseline||"middle",textFont:_}};return g="emphasis",b=y[g].label||b,f=b.textStyle||f,k=y[g].labelLine.length||k,b.position=b.position||y.normal.label.position,x=this.getLabelText(e,t,g),_=this.getFont(f),L=n,"inner"===b.position||"inside"===b.position||"center"===b.position?(d=U,L=Math.max(r,s)/2>V.getTextWidth(x,_)?"#fff":m.reverse(n)):d="left"===b.position?"right":"left",W.highlightStyle={x:this._getLabelPoint(b.position,a,u,r,s,k,U),color:f.color||L,text:x,textAlign:f.align||d,textFont:_,brushType:"fill"},new i(W)},getLabelText:function(e,t,n){var i=this.series,a=i[e],o=a.data[t],r=this.deepQuery([o,a],"itemStyle."+n+".label.formatter");return r?"function"==typeof r?r.call(this.myChart,{seriesIndex:e,seriesName:a.name||"",series:a,dataIndex:t,data:o,name:o.name,value:o.value}):"string"==typeof r?r=r.replace("{a}","{a0}").replace("{b}","{b0}").replace("{c}","{c0}").replace("{a0}",a.name).replace("{b0}",o.name).replace("{c0}",o.value):void 0:o.name},getLabelLine:function(e,t,n,i,o,r,s,l,m){var V=this.series[e],U=V.data[t],d=this._paramsMap[e].location,p=h.merge(h.clone(U.itemStyle)||{},V.itemStyle),c="normal",u=p[c].labelLine,y=p[c].labelLine.length,g=u.lineStyle||{},b=p[c].label;b.position=b.position||p.normal.label.position;var f={zlevel:this.getZlevelBase(),z:this.getZBase()+1,hoverable:!1,style:{xStart:this._getLabelLineStartPoint(i,d,r,s,m),yStart:o+l/2,xEnd:this._getLabelPoint(b.position,i,d,r,s,y,m),yEnd:o+l/2,strokeColor:g.color||n,lineType:g.type,lineWidth:g.width}};return c="emphasis",u=p[c].labelLine||u,y=p[c].labelLine.length||y,g=u.lineStyle||g,b=p[c].label||b,b.position=b.position,f.highlightStyle={xEnd:this._getLabelPoint(b.position,i,d,r,s,y,m),strokeColor:g.color||n,lineType:g.type,lineWidth:g.width},new a(f)},_getLabelPoint:function(e,t,n,i,a,o,r){switch(e="inner"===e||"inside"===e?"center":e){case"center":return"center"==r?t+i/2:"left"==r?t+10:t+i-10;case"left":return"auto"===o?n.x-10:"center"==r?n.centerX-Math.max(i,a)/2-o:"right"==r?t-(a>i?a-i:0)-o:n.x-o;default:return"auto"===o?n.x+n.width+10:"center"==r?n.centerX+Math.max(i,a)/2+o:"right"==r?n.x+n.width+o:t+Math.max(i,a)+o}},_getLabelLineStartPoint:function(e,t,n,i,a){return"center"==a?t.centerX:i>n?e+Math.min(n,i)/2:e+Math.max(n,i)/2},_needLabel:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".label.show")},_needLabelLine:function(e,t,n){return this.deepQuery([t,e],"itemStyle."+(n?"emphasis":"normal")+".labelLine.show")},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},h.inherits(t,n),e("../chart").define("funnel",t),t}),n("echarts/chart/eventRiver",["require","./base","../layout/eventRiver","zrender/shape/Polygon","../component/axis","../component/grid","../component/dataZoom","../config","../util/ecData","../util/date","zrender/tool/util","zrender/tool/color","../chart"],function(e){function t(e,t,i,a,o){n.call(this,e,t,i,a,o);var r=this;r._ondragend=function(){r.isDragend=!0},this.refresh(a)}var n=e("./base"),i=e("../layout/eventRiver"),a=e("zrender/shape/Polygon");e("../component/axis"),e("../component/grid"),e("../component/dataZoom");var o=e("../config");o.eventRiver={zlevel:0,z:2,clickable:!0,legendHoverLink:!0,itemStyle:{normal:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0,position:"inside",formatter:"{b}"}},emphasis:{borderColor:"rgba(0,0,0,0)",borderWidth:1,label:{show:!0}}}};var r=e("../util/ecData"),s=e("../util/date"),l=e("zrender/tool/util"),h=e("zrender/tool/color");return t.prototype={type:o.CHART_TYPE_EVENTRIVER,_buildShape:function(){var e=this.series;this.selectedMap={},this._dataPreprocessing();for(var t=this.component.legend,n=[],a=0;a<e.length;a++)if(e[a].type===this.type){e[a]=this.reformOption(e[a]),this.legendHoverLink=e[a].legendHoverLink||this.legendHoverLink;var o=e[a].name||"";if(this.selectedMap[o]=t?t.isSelected(o):!0,!this.selectedMap[o])continue;this.buildMark(a),n.push(this.series[a])}i(n,this._intervalX,this.component.grid.getArea()),this._drawEventRiver(),this.addShapeList()},_dataPreprocessing:function(){for(var e,t,n=this.series,i=0,a=n.length;a>i;i++)if(n[i].type===this.type){e=this.component.xAxis.getAxis(n[i].xAxisIndex||0);for(var o=0,r=n[i].eventList.length;r>o;o++){t=n[i].eventList[o].evolution;for(var l=0,h=t.length;h>l;l++)t[l].timeScale=e.getCoord(s.getNewDate(t[l].time)-0),t[l].valueScale=Math.pow(t[l].value,.8)}}this._intervalX=Math.round(this.component.grid.getWidth()/40)},_drawEventRiver:function(){for(var e=this.series,t=0;t<e.length;t++){var n=e[t].name||"";if(e[t].type===this.type&&this.selectedMap[n])for(var i=0;i<e[t].eventList.length;i++)this._drawEventBubble(e[t].eventList[i],t,i)}},_drawEventBubble:function(e,t,n){var i=this.series,o=i[t],s=o.name||"",l=o.eventList[n],m=[l,o],V=this.component.legend,U=V?V.getColor(s):this.zr.getColor(t),d=this.deepMerge(m,"itemStyle.normal")||{},p=this.deepMerge(m,"itemStyle.emphasis")||{},c=this.getItemStyleColor(d.color,t,n,l)||U,u=this.getItemStyleColor(p.color,t,n,l)||("string"==typeof c?h.lift(c,-.2):c),y=this._calculateControlPoints(e),g={zlevel:this.getZlevelBase(),z:this.getZBase(),clickable:this.deepQuery(m,"clickable"),style:{pointList:y,smooth:"spline",brushType:"both",lineJoin:"round",color:c,lineWidth:d.borderWidth,strokeColor:d.borderColor},highlightStyle:{color:u,lineWidth:p.borderWidth,strokeColor:p.borderColor},draggable:"vertical",ondragend:this._ondragend};g=new a(g),this.addLabel(g,o,l,e.name),r.pack(g,i[t],t,i[t].eventList[n],n,i[t].eventList[n].name),this.shapeList.push(g)},_calculateControlPoints:function(e){var t=this._intervalX,n=e.y,i=e.evolution,a=i.length;if(!(1>a)){for(var o=[],r=[],s=0;a>s;s++)o.push(i[s].timeScale),r.push(i[s].valueScale);var l=[];l.push([o[0],n]);var s=0;for(s=0;a-1>s;s++)l.push([(o[s]+o[s+1])/2,r[s]/-2+n]);for(l.push([(o[s]+(o[s]+t))/2,r[s]/-2+n]),l.push([o[s]+t,n]),l.push([(o[s]+(o[s]+t))/2,r[s]/2+n]),s=a-1;s>0;s--)l.push([(o[s]+o[s-1])/2,r[s-1]/2+n]);return l}},ondragend:function(e,t){this.isDragend&&e.target&&(t.dragOut=!0,t.dragIn=!0,t.needRefresh=!1,this.isDragend=!1)},refresh:function(e){e&&(this.option=e,this.series=e.series),this.backupShapeList(),this._buildShape()}},l.inherits(t,n),e("../chart").define("eventRiver",t),t}),n("echarts/layout/eventRiver",["require"],function(){function e(e,o,r){function s(e,t){var n=e.importance,i=t.importance;return n>i?-1:i>n?1:0}function l(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;i>n;n++)if(e[n]===t)return n;return-1}for(var h=5,m=o,V=0;V<e.length;V++){for(var U=0;U<e[V].eventList.length;U++){null==e[V].eventList[U].weight&&(e[V].eventList[U].weight=1);for(var d=0,p=0;p<e[V].eventList[U].evolution.length;p++)d+=e[V].eventList[U].evolution[p].valueScale;e[V].eventList[U].importance=d*e[V].eventList[U].weight}e[V].eventList.sort(s)}for(var V=0;V<e.length;V++){null==e[V].weight&&(e[V].weight=1);for(var d=0,U=0;U<e[V].eventList.length;U++)d+=e[V].eventList[U].weight;e[V].importance=d*e[V].weight}e.sort(s);for(var c=Number.MAX_VALUE,u=0,V=0;V<e.length;V++)for(var U=0;U<e[V].eventList.length;U++)for(var p=0;p<e[V].eventList[U].evolution.length;p++){var y=e[V].eventList[U].evolution[p].timeScale;c=Math.min(c,y),u=Math.max(u,y)}for(var g=n(Math.floor(c),Math.ceil(u)),b=0,V=0;V<e.length;V++)for(var U=0;U<e[V].eventList.length;U++){var f=e[V].eventList[U];f.time=[],f.value=[];for(var p=0;p<e[V].eventList[U].evolution.length;p++)f.time.push(e[V].eventList[U].evolution[p].timeScale),f.value.push(e[V].eventList[U].evolution[p].valueScale);var k=l(f.value,Math.max.apply(Math,f.value)),x=i(g,f.time[k],f.time[k+1]),p=0;for(f.y=x+f.value[k]/2+h,p=0;p<f.time.length-1;p++){var _=i(g,f.time[p],f.time[p+1]);f.y-f.value[p]/2-h<_&&(f.y=_+f.value[p]/2+h)}var _=i(g,f.time[p],f.time[p]+m);for(f.y-f.value[p]/2-h<_&&(f.y=_+f.value[p]/2+h),e[V].y=f.y,b=Math.max(b,f.y+f.value[k]/2),p=0;p<f.time.length-1;p++)a(g,f.time[p],f.time[p+1],f.y+f.value[p]/2);a(g,f.time[p],f.time[p]+m,f.y+f.value[p]/2)}t(e,r,b,h)}function t(e,t,n,i){for(var a=t.y,o=(t.height-i)/n,r=0;r<e.length;r++){e[r].y=e[r].y*o+a;for(var s=e[r].eventList,l=0;l<s.length;l++){s[l].y=s[l].y*o+a;for(var h=s[l].evolution,m=0;m<h.length;m++)h[m].valueScale*=1*o}}}function n(e,t){var i={left:e,right:t,leftChild:null,rightChild:null,maxValue:0};if(t>e+1){var a=Math.round((e+t)/2);i.leftChild=n(e,a),i.rightChild=n(a,t)}return i}function i(e,t,n){if(1>n-t)return 0;var a=Math.round((e.left+e.right)/2),o=0;if(t==e.left&&n==e.right)o=e.maxValue;else if(a>=n&&null!=e.leftChild)o=i(e.leftChild,t,n);else if(t>=a&&null!=e.rightChild)o=i(e.rightChild,t,n);else{var r=0,s=0;null!=e.leftChild&&(r=i(e.leftChild,t,a)),null!=e.rightChild&&(s=i(e.rightChild,a,n)),o=r>s?r:s}return o}function a(e,t,n,i){if(null!=e){var o=Math.round((e.left+e.right)/2);e.maxValue=e.maxValue>i?e.maxValue:i,(Math.floor(10*t)!=Math.floor(10*e.left)||Math.floor(10*n)!=Math.floor(10*e.right))&&(o>=n?a(e.leftChild,t,n,i):t>=o?a(e.rightChild,t,n,i):(a(e.leftChild,t,o,i),a(e.rightChild,o,n,i)))}}return e});var i=t("zrender");i.tool={color:t("zrender/tool/color"),math:t("zrender/tool/math"),util:t("zrender/tool/util"),vector:t("zrender/tool/vector"),area:t("zrender/tool/area"),event:t("zrender/tool/event")},i.animation={Animation:t("zrender/animation/Animation"),Cip:t("zrender/animation/Clip"),easing:t("zrender/animation/easing")};var a=t("echarts");a.config=t("echarts/config"),a.util={mapData:{params:t("echarts/util/mapData/params")}},t("echarts/chart/line"),t("echarts/chart/bar"),t("echarts/chart/scatter"),t("echarts/chart/k"),t("echarts/chart/pie"),t("echarts/chart/radar"),t("echarts/chart/chord"),t("echarts/chart/force"),t("echarts/chart/map"),t("echarts/chart/gauge"),t("echarts/chart/funnel"),t("echarts/chart/eventRiver"),e.echarts=a,e.zrender=i}(window); \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/js/jquery-1.10.2.min.js b/umc-iui/src/main/resources/webroot/umc-drill/js/jquery-1.10.2.min.js
deleted file mode 100644
index b5a5e546..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/js/jquery-1.10.2.min.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/*! jQuery v1.11.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
-!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m="1.11.0",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(n.isPlainObject(c)||(b=n.isArray(c)))?(b?(b=!1,f=a&&n.isArray(a)?a:[]):f=a&&n.isPlainObject(a)?a:{},g[d]=n.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray||function(a){return"array"===n.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==n.type(a)||a.nodeType||n.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(l.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&n.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:k&&!k.call("\ufeff\xa0")?function(a){return null==a?"":k.call(a)}:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),n.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||n.guid++,e):void 0},now:function(){return+new Date},support:l}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s="sizzle"+-new Date,t=a.document,u=0,v=0,w=eb(),x=eb(),y=eb(),z=function(a,b){return a===b&&(j=!0),0},A="undefined",B=1<<31,C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=D.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},J="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",K="[\\x20\\t\\r\\n\\f]",L="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=L.replace("w","w#"),N="\\["+K+"*("+L+")"+K+"*(?:([*^$|!~]?=)"+K+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+K+"*\\]",O=":("+L+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+N.replace(3,8)+")*)|.*)\\)|)",P=new RegExp("^"+K+"+|((?:^|[^\\\\])(?:\\\\.)*)"+K+"+$","g"),Q=new RegExp("^"+K+"*,"+K+"*"),R=new RegExp("^"+K+"*([>+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(O),U=new RegExp("^"+M+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L.replace("w","w*")+")"),ATTR:new RegExp("^"+N),PSEUDO:new RegExp("^"+O),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=/'|\\/g,ab=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),bb=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{G.apply(D=H.call(t.childNodes),t.childNodes),D[t.childNodes.length].nodeType}catch(cb){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function db(a,b,d,e){var f,g,h,i,j,m,p,q,u,v;if((b?b.ownerDocument||b:t)!==l&&k(b),b=b||l,d=d||[],!a||"string"!=typeof a)return d;if(1!==(i=b.nodeType)&&9!==i)return[];if(n&&!e){if(f=Z.exec(a))if(h=f[1]){if(9===i){if(g=b.getElementById(h),!g||!g.parentNode)return d;if(g.id===h)return d.push(g),d}else if(b.ownerDocument&&(g=b.ownerDocument.getElementById(h))&&r(b,g)&&g.id===h)return d.push(g),d}else{if(f[2])return G.apply(d,b.getElementsByTagName(a)),d;if((h=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(h)),d}if(c.qsa&&(!o||!o.test(a))){if(q=p=s,u=b,v=9===i&&a,1===i&&"object"!==b.nodeName.toLowerCase()){m=ob(a),(p=b.getAttribute("id"))?q=p.replace(_,"\\$&"):b.setAttribute("id",q),q="[id='"+q+"'] ",j=m.length;while(j--)m[j]=q+pb(m[j]);u=$.test(a)&&mb(b.parentNode)||b,v=m.join(",")}if(v)try{return G.apply(d,u.querySelectorAll(v)),d}catch(w){}finally{p||b.removeAttribute("id")}}}return xb(a.replace(P,"$1"),b,d,e)}function eb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function fb(a){return a[s]=!0,a}function gb(a){var b=l.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function hb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function ib(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||B)-(~a.sourceIndex||B);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function jb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function kb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function lb(a){return fb(function(b){return b=+b,fb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function mb(a){return a&&typeof a.getElementsByTagName!==A&&a}c=db.support={},f=db.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},k=db.setDocument=function(a){var b,e=a?a.ownerDocument||a:t,g=e.defaultView;return e!==l&&9===e.nodeType&&e.documentElement?(l=e,m=e.documentElement,n=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){k()},!1):g.attachEvent&&g.attachEvent("onunload",function(){k()})),c.attributes=gb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=gb(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(e.getElementsByClassName)&&gb(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=gb(function(a){return m.appendChild(a).id=s,!e.getElementsByName||!e.getElementsByName(s).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==A&&n){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ab,bb);return function(a){var c=typeof a.getAttributeNode!==A&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==A?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==A&&n?b.getElementsByClassName(a):void 0},p=[],o=[],(c.qsa=Y.test(e.querySelectorAll))&&(gb(function(a){a.innerHTML="<select t=''><option selected=''></option></select>",a.querySelectorAll("[t^='']").length&&o.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||o.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll(":checked").length||o.push(":checked")}),gb(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&o.push("name"+K+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||o.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),o.push(",.*:")})),(c.matchesSelector=Y.test(q=m.webkitMatchesSelector||m.mozMatchesSelector||m.oMatchesSelector||m.msMatchesSelector))&&gb(function(a){c.disconnectedMatch=q.call(a,"div"),q.call(a,"[s!='']:x"),p.push("!=",O)}),o=o.length&&new RegExp(o.join("|")),p=p.length&&new RegExp(p.join("|")),b=Y.test(m.compareDocumentPosition),r=b||Y.test(m.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},z=b?function(a,b){if(a===b)return j=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===t&&r(t,a)?-1:b===e||b.ownerDocument===t&&r(t,b)?1:i?I.call(i,a)-I.call(i,b):0:4&d?-1:1)}:function(a,b){if(a===b)return j=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],k=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:i?I.call(i,a)-I.call(i,b):0;if(f===g)return ib(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)k.unshift(c);while(h[d]===k[d])d++;return d?ib(h[d],k[d]):h[d]===t?-1:k[d]===t?1:0},e):l},db.matches=function(a,b){return db(a,null,null,b)},db.matchesSelector=function(a,b){if((a.ownerDocument||a)!==l&&k(a),b=b.replace(S,"='$1']"),!(!c.matchesSelector||!n||p&&p.test(b)||o&&o.test(b)))try{var d=q.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return db(b,l,null,[a]).length>0},db.contains=function(a,b){return(a.ownerDocument||a)!==l&&k(a),r(a,b)},db.attr=function(a,b){(a.ownerDocument||a)!==l&&k(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!n):void 0;return void 0!==f?f:c.attributes||!n?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},db.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},db.uniqueSort=function(a){var b,d=[],e=0,f=0;if(j=!c.detectDuplicates,i=!c.sortStable&&a.slice(0),a.sort(z),j){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return i=null,a},e=db.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=db.selectors={cacheLength:50,createPseudo:fb,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ab,bb),a[3]=(a[4]||a[5]||"").replace(ab,bb),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||db.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&db.error(a[0]),a},PSEUDO:function(a){var b,c=!a[5]&&a[2];return V.CHILD.test(a[0])?null:(a[3]&&void 0!==a[4]?a[2]=a[4]:c&&T.test(c)&&(b=ob(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ab,bb).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=w[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&w(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==A&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=db.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),t=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&t){k=q[s]||(q[s]={}),j=k[a]||[],n=j[0]===u&&j[1],m=j[0]===u&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[u,n,m];break}}else if(t&&(j=(b[s]||(b[s]={}))[a])&&j[0]===u)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(t&&((l[s]||(l[s]={}))[a]=[u,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||db.error("unsupported pseudo: "+a);return e[s]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?fb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:fb(function(a){var b=[],c=[],d=g(a.replace(P,"$1"));return d[s]?fb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:fb(function(a){return function(b){return db(a,b).length>0}}),contains:fb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:fb(function(a){return U.test(a||"")||db.error("unsupported lang: "+a),a=a.replace(ab,bb).toLowerCase(),function(b){var c;do if(c=n?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===m},focus:function(a){return a===l.activeElement&&(!l.hasFocus||l.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:lb(function(){return[0]}),last:lb(function(a,b){return[b-1]}),eq:lb(function(a,b,c){return[0>c?c+b:c]}),even:lb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:lb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:lb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:lb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=jb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=kb(b);function nb(){}nb.prototype=d.filters=d.pseudos,d.setFilters=new nb;function ob(a,b){var c,e,f,g,h,i,j,k=x[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=Q.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=R.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(P," ")}),h=h.slice(c.length));for(g in d.filter)!(e=V[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?db.error(a):x(a,i).slice(0)}function pb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function qb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=v++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[u,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[s]||(b[s]={}),(h=i[d])&&h[0]===u&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function rb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function sb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function tb(a,b,c,d,e,f){return d&&!d[s]&&(d=tb(d)),e&&!e[s]&&(e=tb(e,f)),fb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||wb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:sb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=sb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?I.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=sb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ub(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],i=g||d.relative[" "],j=g?1:0,k=qb(function(a){return a===b},i,!0),l=qb(function(a){return I.call(b,a)>-1},i,!0),m=[function(a,c,d){return!g&&(d||c!==h)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>j;j++)if(c=d.relative[a[j].type])m=[qb(rb(m),c)];else{if(c=d.filter[a[j].type].apply(null,a[j].matches),c[s]){for(e=++j;f>e;e++)if(d.relative[a[e].type])break;return tb(j>1&&rb(m),j>1&&pb(a.slice(0,j-1).concat({value:" "===a[j-2].type?"*":""})).replace(P,"$1"),c,e>j&&ub(a.slice(j,e)),f>e&&ub(a=a.slice(e)),f>e&&pb(a))}m.push(c)}return rb(m)}function vb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,i,j,k){var m,n,o,p=0,q="0",r=f&&[],s=[],t=h,v=f||e&&d.find.TAG("*",k),w=u+=null==t?1:Math.random()||.1,x=v.length;for(k&&(h=g!==l&&g);q!==x&&null!=(m=v[q]);q++){if(e&&m){n=0;while(o=a[n++])if(o(m,g,i)){j.push(m);break}k&&(u=w)}c&&((m=!o&&m)&&p--,f&&r.push(m))}if(p+=q,c&&q!==p){n=0;while(o=b[n++])o(r,s,g,i);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=E.call(j));s=sb(s)}G.apply(j,s),k&&!f&&s.length>0&&p+b.length>1&&db.uniqueSort(j)}return k&&(u=w,h=t),r};return c?fb(f):f}g=db.compile=function(a,b){var c,d=[],e=[],f=y[a+" "];if(!f){b||(b=ob(a)),c=b.length;while(c--)f=ub(b[c]),f[s]?d.push(f):e.push(f);f=y(a,vb(e,d))}return f};function wb(a,b,c){for(var d=0,e=b.length;e>d;d++)db(a,b[d],c);return c}function xb(a,b,e,f){var h,i,j,k,l,m=ob(a);if(!f&&1===m.length){if(i=m[0]=m[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&c.getById&&9===b.nodeType&&n&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(ab,bb),b)||[])[0],!b)return e;a=a.slice(i.shift().value.length)}h=V.needsContext.test(a)?0:i.length;while(h--){if(j=i[h],d.relative[k=j.type])break;if((l=d.find[k])&&(f=l(j.matches[0].replace(ab,bb),$.test(i[0].type)&&mb(b.parentNode)||b))){if(i.splice(h,1),a=f.length&&pb(i),!a)return G.apply(e,f),e;break}}}return g(a,m)(f,b,!n,e,$.test(a)&&mb(b.parentNode)||b),e}return c.sortStable=s.split("").sort(z).join("")===s,c.detectDuplicates=!!j,k(),c.sortDetached=gb(function(a){return 1&a.compareDocumentPosition(l.createElement("div"))}),gb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||hb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&gb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||hb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),gb(function(a){return null==a.getAttribute("disabled")})||hb(J,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),db}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return n.inArray(a,b)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;e>b;b++)if(n.contains(d[b],this))return!0}));for(b=0;e>b;b++)n.find(a,d[b],c);return c=this.pushStack(e>1?n.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=a.document,A=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,B=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:A.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:z,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=z.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return y.find(a);this.length=1,this[0]=d}return this.context=z,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};B.prototype=n.fn,y=n(z);var C=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!n(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b,c=n(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(n.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?n.inArray(this[0],n(a)):n.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function E(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return E(a,"nextSibling")},prev:function(a){return E(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return n.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(D[a]||(e=n.unique(e)),C.test(a)&&(e=e.reverse())),this.pushStack(e)}});var F=/\S+/g,G={};function H(a){var b=G[a]={};return n.each(a.match(F)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?G[a]||H(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&n.each(arguments,function(a,c){var d;while((d=n.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var I;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){if(a===!0?!--n.readyWait:!n.isReady){if(!z.body)return setTimeout(n.ready);n.isReady=!0,a!==!0&&--n.readyWait>0||(I.resolveWith(z,[n]),n.fn.trigger&&n(z).trigger("ready").off("ready"))}}});function J(){z.addEventListener?(z.removeEventListener("DOMContentLoaded",K,!1),a.removeEventListener("load",K,!1)):(z.detachEvent("onreadystatechange",K),a.detachEvent("onload",K))}function K(){(z.addEventListener||"load"===event.type||"complete"===z.readyState)&&(J(),n.ready())}n.ready.promise=function(b){if(!I)if(I=n.Deferred(),"complete"===z.readyState)setTimeout(n.ready);else if(z.addEventListener)z.addEventListener("DOMContentLoaded",K,!1),a.addEventListener("load",K,!1);else{z.attachEvent("onreadystatechange",K),a.attachEvent("onload",K);var c=!1;try{c=null==a.frameElement&&z.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!n.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}J(),n.ready()}}()}return I.promise(b)};var L="undefined",M;for(M in n(l))break;l.ownLast="0"!==M,l.inlineBlockNeedsLayout=!1,n(function(){var a,b,c=z.getElementsByTagName("body")[0];c&&(a=z.createElement("div"),a.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",b=z.createElement("div"),c.appendChild(a).appendChild(b),typeof b.style.zoom!==L&&(b.style.cssText="border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1",(l.inlineBlockNeedsLayout=3===b.offsetWidth)&&(c.style.zoom=1)),c.removeChild(a),a=b=null)}),function(){var a=z.createElement("div");if(null==l.deleteExpando){l.deleteExpando=!0;try{delete a.test}catch(b){l.deleteExpando=!1}}a=null}(),n.acceptData=function(a){var b=n.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(O,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}n.data(a,b,c)}else c=void 0}return c}function Q(a){var b;for(b in a)if(("data"!==b||!n.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function R(a,b,d,e){if(n.acceptData(a)){var f,g,h=n.expando,i=a.nodeType,j=i?n.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||n.guid++:h),j[k]||(j[k]=i?{}:{toJSON:n.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=n.extend(j[k],b):j[k].data=n.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[n.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[n.camelCase(b)])):f=g,f
-}}function S(a,b,c){if(n.acceptData(a)){var d,e,f=a.nodeType,g=f?n.cache:a,h=f?a[n.expando]:n.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){n.isArray(b)?b=b.concat(n.map(b,n.camelCase)):b in d?b=[b]:(b=n.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!Q(d):!n.isEmptyObject(d))return}(c||(delete g[h].data,Q(g[h])))&&(f?n.cleanData([a],!0):l.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}n.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?n.cache[a[n.expando]]:a[n.expando],!!a&&!Q(a)},data:function(a,b,c){return R(a,b,c)},removeData:function(a,b){return S(a,b)},_data:function(a,b,c){return R(a,b,c,!0)},_removeData:function(a,b){return S(a,b,!0)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=n.data(f),1===f.nodeType&&!n._data(f,"parsedAttrs"))){c=g.length;while(c--)d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d]));n._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){n.data(this,a)}):arguments.length>1?this.each(function(){n.data(this,a,b)}):f?P(f,a,n.data(f,a)):void 0},removeData:function(a){return this.each(function(){n.removeData(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=n._data(a,b),c&&(!d||n.isArray(c)?d=n._data(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return n._data(a,c)||n._data(a,c,{empty:n.Callbacks("once memory").add(function(){n._removeData(a,b+"queue"),n._removeData(a,c)})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=n._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var T=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,U=["Top","Right","Bottom","Left"],V=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},W=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},X=/^(?:checkbox|radio)$/i;!function(){var a=z.createDocumentFragment(),b=z.createElement("div"),c=z.createElement("input");if(b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a>",l.leadingWhitespace=3===b.firstChild.nodeType,l.tbody=!b.getElementsByTagName("tbody").length,l.htmlSerialize=!!b.getElementsByTagName("link").length,l.html5Clone="<:nav></:nav>"!==z.createElement("nav").cloneNode(!0).outerHTML,c.type="checkbox",c.checked=!0,a.appendChild(c),l.appendChecked=c.checked,b.innerHTML="<textarea>x</textarea>",l.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,a.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",l.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,l.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){l.noCloneEvent=!1}),b.cloneNode(!0).click()),null==l.deleteExpando){l.deleteExpando=!0;try{delete b.test}catch(d){l.deleteExpando=!1}}a=b=c=null}(),function(){var b,c,d=z.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(l[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),l[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var Y=/^(?:input|select|textarea)$/i,Z=/^key/,$=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,ab=/^([^.]*)(?:\.(.+)|)$/;function bb(){return!0}function cb(){return!1}function db(){try{return z.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=n.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof n===L||a&&n.event.triggered===a.type?void 0:n.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(F)||[""],h=b.length;while(h--)f=ab.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=n.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=n.event.special[o]||{},l=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},i),(m=g[o])||(m=g[o]=[],m.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,l):m.push(l),n.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=n.hasData(a)&&n._data(a);if(r&&(k=r.events)){b=(b||"").match(F)||[""],j=b.length;while(j--)if(h=ab.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=m.length;while(f--)g=m[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(m.splice(f,1),g.selector&&m.delegateCount--,l.remove&&l.remove.call(a,g));i&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(k)&&(delete r.handle,n._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,m,o=[d||z],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||z,3!==d.nodeType&&8!==d.nodeType&&!_.test(p+n.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[n.expando]?b:new n.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),k=n.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!n.isWindow(d)){for(i=k.delegateType||p,_.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||z)&&o.push(l.defaultView||l.parentWindow||a)}m=0;while((h=o[m++])&&!b.isPropagationStopped())b.type=m>1?i:k.bindType||p,f=(n._data(h,"events")||{})[b.type]&&n._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&n.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&n.acceptData(d)&&g&&d[p]&&!n.isWindow(d)){l=d[g],l&&(d[g]=null),n.event.triggered=p;try{d[p]()}catch(r){}n.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(n._data(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((n.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?n(c,this).index(i)>=0:n.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=$.test(e)?this.mouseHooks:Z.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||z),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||z,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==db()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===db()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return n.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=z.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===L&&(a[d]=null),a.detachEvent(d,c))},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&(a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault())?bb:cb):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:cb,isPropagationStopped:cb,isImmediatePropagationStopped:cb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=bb,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=bb,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=bb,this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),l.submitBubbles||(n.event.special.submit={setup:function(){return n.nodeName(this,"form")?!1:void n.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=n.nodeName(b,"input")||n.nodeName(b,"button")?b.form:void 0;c&&!n._data(c,"submitBubbles")&&(n.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),n._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&n.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return n.nodeName(this,"form")?!1:void n.event.remove(this,"._submit")}}),l.changeBubbles||(n.event.special.change={setup:function(){return Y.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(n.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),n.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),n.event.simulate("change",this,a,!0)})),!1):void n.event.add(this,"beforeactivate._change",function(a){var b=a.target;Y.test(b.nodeName)&&!n._data(b,"changeBubbles")&&(n.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||n.event.simulate("change",this.parentNode,a,!0)}),n._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return n.event.remove(this,"._change"),!Y.test(this.nodeName)}}),l.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=n._data(d,b);e||d.addEventListener(a,c,!0),n._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=n._data(d,b)-1;e?n._data(d,b,e):(d.removeEventListener(a,c,!0),n._removeData(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=cb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return n().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=cb),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});function eb(a){var b=fb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var fb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gb=/ jQuery\d+="(?:null|\d+)"/g,hb=new RegExp("<(?:"+fb+")[\\s/>]","i"),ib=/^\s+/,jb=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,kb=/<([\w:]+)/,lb=/<tbody/i,mb=/<|&#?\w+;/,nb=/<(?:script|style|link)/i,ob=/checked\s*(?:[^=]|=\s*.checked.)/i,pb=/^$|\/(?:java|ecma)script/i,qb=/^true\/(.*)/,rb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,sb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:l.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},tb=eb(z),ub=tb.appendChild(z.createElement("div"));sb.optgroup=sb.option,sb.tbody=sb.tfoot=sb.colgroup=sb.caption=sb.thead,sb.th=sb.td;function vb(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==L?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==L?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||n.nodeName(d,b)?f.push(d):n.merge(f,vb(d,b));return void 0===b||b&&n.nodeName(a,b)?n.merge([a],f):f}function wb(a){X.test(a.type)&&(a.defaultChecked=a.checked)}function xb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function yb(a){return a.type=(null!==n.find.attr(a,"type"))+"/"+a.type,a}function zb(a){var b=qb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ab(a,b){for(var c,d=0;null!=(c=a[d]);d++)n._data(c,"globalEval",!b||n._data(b[d],"globalEval"))}function Bb(a,b){if(1===b.nodeType&&n.hasData(a)){var c,d,e,f=n._data(a),g=n._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)n.event.add(b,c,h[c][d])}g.data&&(g.data=n.extend({},g.data))}}function Cb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!l.noCloneEvent&&b[n.expando]){e=n._data(b);for(d in e.events)n.removeEvent(b,d,e.handle);b.removeAttribute(n.expando)}"script"===c&&b.text!==a.text?(yb(b).text=a.text,zb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),l.html5Clone&&a.innerHTML&&!n.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&X.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}n.extend({clone:function(a,b,c){var d,e,f,g,h,i=n.contains(a.ownerDocument,a);if(l.html5Clone||n.isXMLDoc(a)||!hb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ub.innerHTML=a.outerHTML,ub.removeChild(f=ub.firstChild)),!(l.noCloneEvent&&l.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(d=vb(f),h=vb(a),g=0;null!=(e=h[g]);++g)d[g]&&Cb(e,d[g]);if(b)if(c)for(h=h||vb(a),d=d||vb(f),g=0;null!=(e=h[g]);g++)Bb(e,d[g]);else Bb(a,f);return d=vb(f,"script"),d.length>0&&Ab(d,!i&&vb(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k,m=a.length,o=eb(b),p=[],q=0;m>q;q++)if(f=a[q],f||0===f)if("object"===n.type(f))n.merge(p,f.nodeType?[f]:f);else if(mb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(kb.exec(f)||["",""])[1].toLowerCase(),k=sb[i]||sb._default,h.innerHTML=k[1]+f.replace(jb,"<$1></$2>")+k[2],e=k[0];while(e--)h=h.lastChild;if(!l.leadingWhitespace&&ib.test(f)&&p.push(b.createTextNode(ib.exec(f)[0])),!l.tbody){f="table"!==i||lb.test(f)?"<table>"!==k[1]||lb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)n.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}n.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),l.appendChecked||n.grep(vb(p,"input"),wb),q=0;while(f=p[q++])if((!d||-1===n.inArray(f,d))&&(g=n.contains(f.ownerDocument,f),h=vb(o.appendChild(f),"script"),g&&Ab(h),c)){e=0;while(f=h[e++])pb.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=n.expando,j=n.cache,k=l.deleteExpando,m=n.event.special;null!=(d=a[h]);h++)if((b||n.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)m[e]?n.event.remove(d,e):n.removeEvent(d,e,g.handle);j[f]&&(delete j[f],k?delete d[i]:typeof d.removeAttribute!==L?d.removeAttribute(i):d[i]=null,c.push(f))}}}),n.fn.extend({text:function(a){return W(this,function(a){return void 0===a?n.text(this):this.empty().append((this[0]&&this[0].ownerDocument||z).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=xb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(vb(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&Ab(vb(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&n.cleanData(vb(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&n.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return W(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(gb,""):void 0;if(!("string"!=typeof a||nb.test(a)||!l.htmlSerialize&&hb.test(a)||!l.leadingWhitespace&&ib.test(a)||sb[(kb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(jb,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(vb(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(vb(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,k=this.length,m=this,o=k-1,p=a[0],q=n.isFunction(p);if(q||k>1&&"string"==typeof p&&!l.checkClone&&ob.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(k&&(i=n.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=n.map(vb(i,"script"),yb),f=g.length;k>j;j++)d=i,j!==o&&(d=n.clone(d,!0,!0),f&&n.merge(g,vb(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,n.map(g,zb),j=0;f>j;j++)d=g[j],pb.test(d.type||"")&&!n._data(d,"globalEval")&&n.contains(h,d)&&(d.src?n._evalUrl&&n._evalUrl(d.src):n.globalEval((d.text||d.textContent||d.innerHTML||"").replace(rb,"")));i=c=null}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=0,e=[],g=n(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),n(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Db,Eb={};function Fb(b,c){var d=n(c.createElement(b)).appendTo(c.body),e=a.getDefaultComputedStyle?a.getDefaultComputedStyle(d[0]).display:n.css(d[0],"display");return d.detach(),e}function Gb(a){var b=z,c=Eb[a];return c||(c=Fb(a,b),"none"!==c&&c||(Db=(Db||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Db[0].contentWindow||Db[0].contentDocument).document,b.write(),b.close(),c=Fb(a,b),Db.detach()),Eb[a]=c),c}!function(){var a,b,c=z.createElement("div"),d="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";c.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=c.getElementsByTagName("a")[0],a.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(a.style.opacity),l.cssFloat=!!a.style.cssFloat,c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===c.style.backgroundClip,a=c=null,l.shrinkWrapBlocks=function(){var a,c,e,f;if(null==b){if(a=z.getElementsByTagName("body")[0],!a)return;f="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",c=z.createElement("div"),e=z.createElement("div"),a.appendChild(c).appendChild(e),b=!1,typeof e.style.zoom!==L&&(e.style.cssText=d+";width:1px;padding:1px;zoom:1",e.innerHTML="<div></div>",e.firstChild.style.width="5px",b=3!==e.offsetWidth),a.removeChild(c),a=c=e=null}return b}}();var Hb=/^margin/,Ib=new RegExp("^("+T+")(?!px)[a-z%]+$","i"),Jb,Kb,Lb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Jb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),Ib.test(g)&&Hb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):z.documentElement.currentStyle&&(Jb=function(a){return a.currentStyle},Kb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Jb(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ib.test(g)&&!Lb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Mb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h=z.createElement("div"),i="border:0;width:0;height:0;position:absolute;top:0;left:-9999px",j="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;padding:0;margin:0;border:0";h.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",b=h.getElementsByTagName("a")[0],b.style.cssText="float:left;opacity:.5",l.opacity=/^0.5/.test(b.style.opacity),l.cssFloat=!!b.style.cssFloat,h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",l.clearCloneStyle="content-box"===h.style.backgroundClip,b=h=null,n.extend(l,{reliableHiddenOffsets:function(){if(null!=c)return c;var a,b,d,e=z.createElement("div"),f=z.getElementsByTagName("body")[0];if(f)return e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=z.createElement("div"),a.style.cssText=i,f.appendChild(a).appendChild(e),e.innerHTML="<table><tr><td></td><td>t</td></tr></table>",b=e.getElementsByTagName("td"),b[0].style.cssText="padding:0;margin:0;border:0;display:none",d=0===b[0].offsetHeight,b[0].style.display="",b[1].style.display="none",c=d&&0===b[0].offsetHeight,f.removeChild(a),e=f=null,c},boxSizing:function(){return null==d&&k(),d},boxSizingReliable:function(){return null==e&&k(),e},pixelPosition:function(){return null==f&&k(),f},reliableMarginRight:function(){var b,c,d,e;if(null==g&&a.getComputedStyle){if(b=z.getElementsByTagName("body")[0],!b)return;c=z.createElement("div"),d=z.createElement("div"),c.style.cssText=i,b.appendChild(c).appendChild(d),e=d.appendChild(z.createElement("div")),e.style.cssText=d.style.cssText=j,e.style.marginRight=e.style.width="0",d.style.width="1px",g=!parseFloat((a.getComputedStyle(e,null)||{}).marginRight),b.removeChild(c)}return g}});function k(){var b,c,h=z.getElementsByTagName("body")[0];h&&(b=z.createElement("div"),c=z.createElement("div"),b.style.cssText=i,h.appendChild(b).appendChild(c),c.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;display:block;padding:1px;border:1px;width:4px;margin-top:1%;top:1%",n.swap(h,null!=h.style.zoom?{zoom:1}:{},function(){d=4===c.offsetWidth}),e=!0,f=!1,g=!0,a.getComputedStyle&&(f="1%"!==(a.getComputedStyle(c,null)||{}).top,e="4px"===(a.getComputedStyle(c,null)||{width:"4px"}).width),h.removeChild(b),c=h=null)}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Nb=/alpha\([^)]*\)/i,Ob=/opacity\s*=\s*([^)]*)/,Pb=/^(none|table(?!-c[ea]).+)/,Qb=new RegExp("^("+T+")(.*)$","i"),Rb=new RegExp("^([+-])=("+T+")","i"),Sb={position:"absolute",visibility:"hidden",display:"block"},Tb={letterSpacing:0,fontWeight:400},Ub=["Webkit","O","Moz","ms"];function Vb(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ub.length;while(e--)if(b=Ub[e]+c,b in a)return b;return d}function Wb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=n._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&V(d)&&(f[g]=n._data(d,"olddisplay",Gb(d.nodeName)))):f[g]||(e=V(d),(c&&"none"!==c||!e)&&n._data(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Xb(a,b,c){var d=Qb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Yb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+U[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+U[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+U[f]+"Width",!0,e))):(g+=n.css(a,"padding"+U[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+U[f]+"Width",!0,e)));return g}function Zb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Jb(a),g=l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Kb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ib.test(e))return e;d=g&&(l.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Yb(a,b,c||(g?"border":"content"),d,f)+"px"}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Kb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":l.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;if(b=n.cssProps[h]||(n.cssProps[h]=Vb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Rb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),l.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]="",i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Vb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Kb(a,b,d)),"normal"===f&&b in Tb&&(f=Tb[b]),""===c||c?(e=parseFloat(f),c===!0||n.isNumeric(e)?e||0:f):f}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?0===a.offsetWidth&&Pb.test(n.css(a,"display"))?n.swap(a,Sb,function(){return Zb(a,b,d)}):Zb(a,b,d):void 0},set:function(a,c,d){var e=d&&Jb(a);return Xb(a,c,d?Yb(a,b,d,l.boxSizing()&&"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),l.opacity||(n.cssHooks.opacity={get:function(a,b){return Ob.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=n.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===n.trim(f.replace(Nb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Nb.test(f)?f.replace(Nb,e):f+" "+e)}}),n.cssHooks.marginRight=Mb(l.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},Kb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+U[d]+b]=f[d]||f[d-2]||f[0];return e}},Hb.test(a)||(n.cssHooks[a+b].set=Xb)}),n.fn.extend({css:function(a,b){return W(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=Jb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)
-},a,b,arguments.length>1)},show:function(){return Wb(this,!0)},hide:function(){return Wb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){V(this)?n(this).show():n(this).hide()})}});function $b(a,b,c,d,e){return new $b.prototype.init(a,b,c,d,e)}n.Tween=$b,$b.prototype={constructor:$b,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=$b.propHooks[this.prop];return a&&a.get?a.get(this):$b.propHooks._default.get(this)},run:function(a){var b,c=$b.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):$b.propHooks._default.set(this),this}},$b.prototype.init.prototype=$b.prototype,$b.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},$b.propHooks.scrollTop=$b.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=$b.prototype.init,n.fx.step={};var _b,ac,bc=/^(?:toggle|show|hide)$/,cc=new RegExp("^(?:([+-])=|)("+T+")([a-z%]*)$","i"),dc=/queueHooks$/,ec=[jc],fc={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=cc.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&cc.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function gc(){return setTimeout(function(){_b=void 0}),_b=n.now()}function hc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=U[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function ic(a,b,c){for(var d,e=(fc[b]||[]).concat(fc["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function jc(a,b,c){var d,e,f,g,h,i,j,k,m=this,o={},p=a.style,q=a.nodeType&&V(a),r=n._data(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,m.always(function(){m.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=n.css(a,"display"),k=Gb(a.nodeName),"none"===j&&(j=k),"inline"===j&&"none"===n.css(a,"float")&&(l.inlineBlockNeedsLayout&&"inline"!==k?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",l.shrinkWrapBlocks()||m.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],bc.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||n.style(a,d)}if(!n.isEmptyObject(o)){r?"hidden"in r&&(q=r.hidden):r=n._data(a,"fxshow",{}),f&&(r.hidden=!q),q?n(a).show():m.done(function(){n(a).hide()}),m.done(function(){var b;n._removeData(a,"fxshow");for(b in o)n.style(a,b,o[b])});for(d in o)g=ic(q?r[d]:0,d,m),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function kc(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function lc(a,b,c){var d,e,f=0,g=ec.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=_b||gc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:_b||gc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(kc(k,j.opts.specialEasing);g>f;f++)if(d=ec[f].call(j,a,k,j.opts))return d;return n.map(k,ic,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(lc,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],fc[c]=fc[c]||[],fc[c].unshift(b)},prefilter:function(a,b){b?ec.unshift(a):ec.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(V).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=lc(this,n.extend({},a),f);(e||n._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=n._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&dc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=n._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(hc(b,!0),a,d,e)}}),n.each({slideDown:hc("show"),slideUp:hc("hide"),slideToggle:hc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=n.timers,c=0;for(_b=n.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||n.fx.stop(),_b=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){ac||(ac=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(ac),ac=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e=z.createElement("div");e.setAttribute("className","t"),e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",a=e.getElementsByTagName("a")[0],c=z.createElement("select"),d=c.appendChild(z.createElement("option")),b=e.getElementsByTagName("input")[0],a.style.cssText="top:1px",l.getSetAttribute="t"!==e.className,l.style=/top/.test(a.getAttribute("style")),l.hrefNormalized="/a"===a.getAttribute("href"),l.checkOn=!!b.value,l.optSelected=d.selected,l.enctype=!!z.createElement("form").enctype,c.disabled=!0,l.optDisabled=!d.disabled,b=z.createElement("input"),b.setAttribute("value",""),l.input=""===b.getAttribute("value"),b.value="t",b.setAttribute("type","radio"),l.radioValue="t"===b.value,a=b=c=d=e=null}();var mc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(mc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.text(a)}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(l.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)if(d=e[g],n.inArray(n.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},l.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var nc,oc,pc=n.expr.attrHandle,qc=/^(?:checked|selected)$/i,rc=l.getSetAttribute,sc=l.input;n.fn.extend({attr:function(a,b){return W(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===L?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?oc:nc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(F);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)?sc&&rc||!qc.test(c)?a[d]=!1:a[n.camelCase("default-"+c)]=a[d]=!1:n.attr(a,c,""),a.removeAttribute(rc?c:d)},attrHooks:{type:{set:function(a,b){if(!l.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),oc={set:function(a,b,c){return b===!1?n.removeAttr(a,c):sc&&rc||!qc.test(c)?a.setAttribute(!rc&&n.propFix[c]||c,c):a[n.camelCase("default-"+c)]=a[c]=!0,c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=pc[b]||n.find.attr;pc[b]=sc&&rc||!qc.test(b)?function(a,b,d){var e,f;return d||(f=pc[b],pc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,pc[b]=f),e}:function(a,b,c){return c?void 0:a[n.camelCase("default-"+b)]?b.toLowerCase():null}}),sc&&rc||(n.attrHooks.value={set:function(a,b,c){return n.nodeName(a,"input")?void(a.defaultValue=b):nc&&nc.set(a,b,c)}}),rc||(nc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},pc.id=pc.name=pc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},n.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:nc.set},n.attrHooks.contenteditable={set:function(a,b,c){nc.set(a,""===b?!1:b,c)}},n.each(["width","height"],function(a,b){n.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),l.style||(n.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var tc=/^(?:input|select|textarea|button|object)$/i,uc=/^(?:a|area)$/i;n.fn.extend({prop:function(a,b){return W(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return a=n.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=n.find.attr(a,"tabindex");return b?parseInt(b,10):tc.test(a.nodeName)||uc.test(a.nodeName)&&a.href?0:-1}}}}),l.hrefNormalized||n.each(["href","src"],function(a,b){n.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),l.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this}),l.enctype||(n.propFix.enctype="encoding");var vc=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(F)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(vc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(F)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===L||"boolean"===c)&&(this.className&&n._data(this,"__className__",this.className),this.className=this.className||a===!1?"":n._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(vc," ").indexOf(b)>=0)return!0;return!1}}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var wc=n.now(),xc=/\?/,yc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;n.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=n.trim(b+"");return e&&!n.trim(e.replace(yc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():n.error("Invalid JSON: "+b)},n.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||n.error("Invalid XML: "+b),c};var zc,Ac,Bc=/#.*$/,Cc=/([?&])_=[^&]*/,Dc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Ec=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Fc=/^(?:GET|HEAD)$/,Gc=/^\/\//,Hc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ic={},Jc={},Kc="*/".concat("*");try{Ac=location.href}catch(Lc){Ac=z.createElement("a"),Ac.href="",Ac=Ac.href}zc=Hc.exec(Ac.toLowerCase())||[];function Mc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(F)||[];if(n.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nc(a,b,c,d){var e={},f=a===Jc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Oc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&n.extend(!0,a,c),a}function Pc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Qc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ac,type:"GET",isLocal:Ec.test(zc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Oc(Oc(a,n.ajaxSettings),b):Oc(n.ajaxSettings,a)},ajaxPrefilter:Mc(Ic),ajaxTransport:Mc(Jc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Dc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||Ac)+"").replace(Bc,"").replace(Gc,zc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(F)||[""],null==k.crossDomain&&(c=Hc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===zc[1]&&c[2]===zc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(zc[3]||("http:"===zc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),Nc(Ic,k,b,v),2===t)return v;h=k.global,h&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Fc.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(xc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Cc.test(e)?e.replace(Cc,"$1_="+wc++):e+(xc.test(e)?"&":"?")+"_="+wc++)),k.ifModified&&(n.lastModified[e]&&v.setRequestHeader("If-Modified-Since",n.lastModified[e]),n.etag[e]&&v.setRequestHeader("If-None-Match",n.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Kc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Nc(Jc,k,b,v)){v.readyState=1,h&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Pc(k,v,c)),u=Qc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(n.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){if(n.isFunction(a))return this.each(function(b){n(this).wrapAll(a.call(this,b))});if(this[0]){var b=n(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!l.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||n.css(a,"display"))},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var Rc=/%20/g,Sc=/\[\]$/,Tc=/\r?\n/g,Uc=/^(?:submit|button|image|reset|file)$/i,Vc=/^(?:input|select|textarea|keygen)/i;function Wc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||Sc.test(a)?d(a,e):Wc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Wc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Wc(c,a[c],b,e);return d.join("&").replace(Rc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Vc.test(this.nodeName)&&!Uc.test(a)&&(this.checked||!X.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(Tc,"\r\n")}}):{name:b.name,value:c.replace(Tc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&$c()||_c()}:$c;var Xc=0,Yc={},Zc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Yc)Yc[a](void 0,!0)}),l.cors=!!Zc&&"withCredentials"in Zc,Zc=l.ajax=!!Zc,Zc&&n.ajaxTransport(function(a){if(!a.crossDomain||l.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Xc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Yc[g],b=void 0,f.onreadystatechange=n.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Yc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function $c(){try{return new a.XMLHttpRequest}catch(b){}}function _c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=z.head||n("head")[0]||z.documentElement;return{send:function(d,e){b=z.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var ad=[],bd=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ad.pop()||n.expando+"_"+wc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(bd.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&bd.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(bd,"$1"+e):b.jsonp!==!1&&(b.url+=(xc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,ad.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||z;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var cd=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&cd)return cd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=a.slice(h,a.length),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&n.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var dd=a.document.documentElement;function ed(a){return n.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&n.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,n.contains(b,e)?(typeof e.getBoundingClientRect!==L&&(d=e.getBoundingClientRect()),c=ed(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===n.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(c=a.offset()),c.top+=n.css(a[0],"borderTopWidth",!0),c.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-n.css(d,"marginTop",!0),left:b.left-c.left-n.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||dd;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||dd})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);n.fn[a]=function(d){return W(this,function(a,d,e){var f=ed(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?n(f).scrollLeft():e,c?e:n(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Mb(l.pixelPosition,function(a,c){return c?(c=Kb(a,b),Ib.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return W(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var fd=a.jQuery,gd=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=gd),b&&a.jQuery===n&&(a.jQuery=fd),n},typeof b===L&&(a.jQuery=a.$=n),n});
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/js/mockdataController.js b/umc-iui/src/main/resources/webroot/umc-drill/js/mockdataController.js
deleted file mode 100644
index 2bba21b9..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/js/mockdataController.js
+++ /dev/null
@@ -1,587 +0,0 @@
-/*
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var vm = avalon.define({
- $id: "mockdataController",
- $addHOSTtitleName:"增加HOST",
- $addVNFtitleName:"增加VNF实例",
- $addVDUtitleName:"增加VDU实例",
- $addVNFCtitleName:"增加VNFC实例",
- $addNStitleName:"编排NS实例",
- $mockAlarmTooltip:"点我就能模拟5条告警,告警码随机选取,祝你好运!",
- $mockAlarmRemark:"关于模拟告警说明:<br/>1.创建资源后才能模拟告警; <br/>2.创建资源后要等会儿告警模块才能查询到资源信息,所以创建后等6秒再模拟告警吧!",
- alarmbtnvalue:"模拟告警",
- alarmbtndisabled:true,
-
- server_rtn:{
- info_block:false,
- warning_block:false,
- info_text:"",
- warning_text:""
- },
-
- HOSTInfo : {
- oid:"",
- name:"wangyg test host001",
- moc:"nfv.host.linux",
- ipAddress:"10.74.151.88",
- vendor:"",
- version:"",
- type:"",
- user:"test",
- password:"123456",
- protocol:"ssh",
- port:"21",
- vimId:"-1",
- customPara:"",
- alarmbtndisabled:true,
- alarmbtnvalue:"模拟告警"
- },
-
- VNFInfo : {
- oid:"",
- name:"wangyg test vnf001",
- moc:"nfv.vnf.bn.vbras",
- ipAddress:"",
- vendor:"",
- version:"",
- type:"",
- vnfd:"vnfd-1",
- autoScalePolicy:"",
- localization:"zh",
- monitoringParameter:"",
- status:"active",
- createTime:commonUtil.parseDate(new Date(),"yyyy-MM-dd hh:mm:ss"),
- customPara:"",
- flavourId:"flavour-No-001",
- vnfmid:"-1",
- vimId:"-1",
- alarmbtndisabled:true,
- alarmbtnvalue:"模拟告警"
- },
-
- VDUInfo : {
- oid:"",
- name:"wangyg test vdu001",
- moc:"nfv.vdu.linux",
- ipAddress:"10.74.75.8",
- vendor:"",
- version:"",
- type:"",
- vduImage:"ubuntu12.0",
- parentOid:"",
- vnfId:"-1",
- createTime:commonUtil.parseDate(new Date(),"yyyy-MM-dd hh:mm:ss"),
- customPara:"",
- flavourId:"flavour-No-001",
- vimId:"-1",
- hostId:"-1",
- alarmbtndisabled:true,
- alarmbtnvalue:"模拟告警"
- },
- VNFCInfo : {
- oid:"",
- name:"wangyg test VNFC",
- moc:"nfv.vnfc.bn.vbras.protocol",
- ipAddress:"",
- vendor:"",
- version:"",
- type:"",
- vnfId:"-1",
- vduId:"-1",
- createTime:commonUtil.parseDate(new Date(),"yyyy-MM-dd hh:mm:ss"),
- alarmbtndisabled:true,
- alarmbtnvalue:"模拟告警"
- },
- NSInfo : {
- oid:"",
- name:"wangyg编排服务测试1",
- moc:"nfv.ns.raisecom.nanocellgw",
- vendor:"zte",
- version:"ns1.0",
- type:"CN",
- nsd:"nsd1",
- autoScalePolicy:"",
- monitoringParameter:"",
- flavour:"e2d65cc9",
- status:"active",
- customPara:"",
- vnfIds:[],
- alarmbtndisabled:true,
- alarmbtnvalue:"模拟告警"
- },
- $operationResult:{
- success:"SUCCESS",
- fail:"FAIL"
- },
- $queryVimInfoUrl : '/api/roc/v1/resource/vims',
- $queryHostInfoUrl : '/api/roc/v1/resource/hosts',
- $queryVnfInfoUrl : '/api/roc/v1/resource/vnfs',
- $queryVduInfoUrl : '/api/roc/v1/resource/vdus',
- $queryVnfmInfoUrl : '/api/roc/v1/resource/vnfms',
-
- $addVduInfoUrl: '/api/roc/v1/resource/vdus',
- $addVnfcInfoUrl: '/api/roc/v1/resource/vnfcs',
- $addVnfInfoUrl: '/api/roc/v1/resource/vnfs',
- $addHostInfoUrl: '/api/roc/v1/resource/hosts',
- $addNSInfoUrl: '/api/roc/v1/resource/nsrs',
- $raiseAlarmUrl:'/api/umc/v1/monitor/alarm',
- vimList:[],
- hostList:[],
- vnfList:[],
- vduList:[],
- vnfmList:[],
-
-$raiseAlarm : function(oid,name) {
- if(oid=='' || oid==undefined || oid==null){
- vm.server_rtn.info_block=false;
- vm.server_rtn.warning_block=true;
- vm.server_rtn.warning_text="oid为空,无法发送告警!请先创建资源吧~";
- return;
- }
- vm.server_rtn.info_text="模拟了如下资源的告警 资源ID:"+oid+" 名称:"+name;
- $.ajax({
- type: "POST",
- url: vm.$raiseAlarmUrl,
- data: oid,
- contentType:"text/plain; charset=utf-8", //发送信息至服务器时内容编码类型
- success: function (data) {
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=true;
- vm.server_rtn.info_text=vm.server_rtn.info_text+"<br/>服务器返回信息:"+data;
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- vm.server_rtn.info_block=false;
- vm.server_rtn.warning_block=true;
- vm.server_rtn.warning_text=+"服务器返回错误:"+textStatus+":"+errorThrown;
- }
- });
-},
-
-$addNS : function() {
- if (vm.NSInfo.vnfIds.length==0) {
- alert("请选择包含的VNF");
- return false;
- }
-
- $.ajax({
- type: "POST",
- url: vm.$addNSInfoUrl,
- contentType:"application/json",
- data: JSON.stringify({
- name:vm.NSInfo.name,
- moc:vm.NSInfo.moc,
- vendor:vm.NSInfo.vendor,
- version:vm.NSInfo.version,
- type:vm.NSInfo.type,
- customPara:vm.NSInfo.customPara,
- nsd:vm.NSInfo.nsd,
- autoScalePolicy:vm.NSInfo.autoScalePolicy,
- monitoringParameter:vm.NSInfo.monitoringParameter,
- flavour:vm.NSInfo.flavour,
- status:vm.NSInfo.status,
- vnfIds:vm.NSInfo.vnfIds
- }),
- dataType: "json",
- success: function (data) {
- if (data.operationResult == vm.$operationResult.success) {
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=true;
- vm.server_rtn.info_text="保存成功!新建NS的id为:"+data.oid;
- updateAlarmBtnState(vm.NSInfo);
- vm.NSInfo.oid=data.oid;
- }
- else{
- vm.server_rtn.info_block=false;
- vm.server_rtn.warning_block=true;
- vm.server_rtn.warning_text="保存NS失败!接口返回错误信息:"+data.exception;
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- vm.server_rtn.info_block=false;
- vm.server_rtn.warning_block=true;
- vm.server_rtn.warning_text=textStatus+":"+errorThrown;
-
- }
- });
-},
-
-
-
-$addHost : function() {
- if (vm.HOSTInfo.vimId=="-1") {
- alert("请选择所属VIM");
- return false;
- }
-
- $.ajax({
- type: "POST",
- url: vm.$addHostInfoUrl,
- contentType:"application/json",
- data: JSON.stringify({
- name:vm.HOSTInfo.name,
- moc:vm.HOSTInfo.moc,
- ipAddress:vm.HOSTInfo.ipAddress,
- vendor:vm.HOSTInfo.vendor,
- version:vm.HOSTInfo.version,
- type:vm.HOSTInfo.type,
- customPara:vm.HOSTInfo.customPara,
- user:vm.HOSTInfo.user,
- password:vm.HOSTInfo.password,
- port:vm.HOSTInfo.port,
- protocol:vm.HOSTInfo.protocol,
- vimId:vm.HOSTInfo.vimId
- }),
- dataType: "json",
- success: function (data) {
- if (data.operationResult == vm.$operationResult.success) {
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=true;
- vm.server_rtn.info_text="保存成功!新建Host的id为:"+data.oid;
- updateAlarmBtnState(vm.HOSTInfo);
- vm.HOSTInfo.oid=data.oid;
- }
- else{
- vm.server_rtn.info_block=false;
- vm.server_rtn.warning_block=true;
- vm.server_rtn.warning_text="保存Host失败!接口返回错误信息:"+data.exception;
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- vm.server_rtn.info_block=false;
- vm.server_rtn.warning_block=true;
- vm.server_rtn.warning_text=textStatus+":"+errorThrown;
-
- }
- });
-},
-
-
-$addVNF : function() {
- if (vm.VNFInfo.vnfmid == "-1"||vm.VNFInfo.vimId=="-1") {
- alert("请选择所属的VNFM和VIM");
- return false;
- }
-
- $.ajax({
- type: "POST",
- url: vm.$addVnfInfoUrl,
- contentType:"application/json",
- data: JSON.stringify({
- name:vm.VNFInfo.name,
- moc:vm.VNFInfo.moc,
- ipAddress:vm.VNFInfo.ipAddress,
- vendor:vm.VNFInfo.vendor,
- version:vm.VNFInfo.version,
- type:vm.VNFInfo.type,
- vnfd:vm.VNFInfo.vnfd,
- autoScalePolicy:vm.VNFInfo.autoScalePolicy,
- localization:vm.VNFInfo.localization,
- monitoringParameter:vm.VNFInfo.monitoringParameter,
- status:vm.VNFInfo.status,
- customPara:vm.VNFInfo.customPara,
- flavourId:vm.VNFInfo.flavourId,
- vnfmid:vm.VNFInfo.vnfmid,
- vimId:vm.VNFInfo.vimId,
- createTime:vm.VNFInfo.createTime
- }),
- dataType: "json",
- success: function (data) {
- if (data.operationResult == vm.$operationResult.success) {
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=true;
- vm.server_rtn.info_text="保存成功!新建VNF的id为:"+data.oid;
- updateAlarmBtnState(vm.VNFInfo);
- vm.VNFInfo.oid=data.oid;
- }
- else{
- vm.server_rtn.info_block=false;
- vm.server_rtn.warning_block=true;
- vm.server_rtn.warning_text="保存VNF失败!接口返回错误信息:"+data.exception;
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- vm.server_rtn.info_block=false;
- vm.server_rtn.warning_block=true;
- vm.server_rtn.warning_text=textStatus+":"+errorThrown;
-
- }
- });
-},
-$addVNFC : function() {
-
- if (vm.VNFCInfo.vnfId == "-1" ||vm.VNFCInfo.vduId =="-1") {
- alert("请选择所属的VNF和部署到的VDU");
- return false;
- }
-
- $.ajax({
- type: "POST",
- url: vm.$addVnfcInfoUrl,
- contentType:"application/json",
- data: JSON.stringify({
- name:vm.VNFCInfo.name,
- moc:vm.VNFCInfo.moc,
- ipAddress:vm.VNFCInfo.ipAddress,
- vendor:vm.VNFCInfo.vendor,
- version:vm.VNFCInfo.version,
- type:vm.VNFCInfo.type,
- vnfId:vm.VNFCInfo.vnfId,
- vduId:vm.VNFCInfo.vduId,
- createTime:vm.VNFCInfo.createTime
- }),
- dataType: "json",
- success: function (data) {
- if (data.operationResult == vm.$operationResult.success) {
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=true;
- vm.server_rtn.info_text="保存成功!新建VNFC的id为:"+data.oid;
- updateAlarmBtnState(vm.VNFCInfo);
- vm.VNFCInfo.oid=data.oid;
- }
- else{
- vm.server_rtn.info_block=false;
- vm.server_rtn.warning_block=true;
- vm.server_rtn.warning_text="保存VNFC失败!接口返回错误信息:"+data.exception;
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- vm.server_rtn.info_block=false;
- vm.server_rtn.warning_block=true;
- vm.server_rtn.warning_text=textStatus+":"+errorThrown;
-
- }
- });
-},
-$addVDU : function() {
- if (vm.VDUInfo.vnfId=="-1"||vm.VDUInfo.vimId=="-1"||vm.VDUInfo.hostId=="-1") {
- alert("请选择vim、host和vnf信息");
- return false;
- }
-
- $.ajax({
- type: "POST",
- url: vm.$addVduInfoUrl,
- //contentType:"application/json;charset=utf-8", //发送信息至服务器时内容编码类型。
- contentType:"application/json",
- data: JSON.stringify({
- name:vm.VDUInfo.name,
- moc:vm.VDUInfo.moc,
- ipAddress:vm.VDUInfo.ipAddress,
- vendor:vm.VDUInfo.vendor,
- version:vm.VDUInfo.version,
- type:vm.VDUInfo.type,
- vduImage:vm.VDUInfo.vduImage,
- parentOid:vm.VDUInfo.parentOid,
- vnfId:vm.VDUInfo.vnfId,
- createTime:vm.VDUInfo.createTime,
- customPara:vm.VDUInfo.customPara,
- flavourId:vm.VDUInfo.flavourId,
- vimId:vm.VDUInfo.vimId,
- hostId:vm.VDUInfo.hostId
- }),
- dataType: "json",
- success: function (data) {
- if (data.operationResult == vm.$operationResult.success) {
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=true;
- vm.server_rtn.info_text="保存成功!新建VDU的id为:"+data.oid;
- updateAlarmBtnState(vm.VDUInfo);
- vm.VDUInfo.oid=data.oid;
- }
- else{
- vm.server_rtn.info_block=false;
- vm.server_rtn.warning_block=true;
- vm.server_rtn.warning_text="保存VDU失败!接口返回错误信息:"+data.exception;
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- vm.server_rtn.info_block=false;
- vm.server_rtn.warning_block=true;
- vm.server_rtn.warning_text=textStatus+":"+errorThrown;
-
- }
- });
-}
-});
-avalon.scan();
-
-//公共方法,在点击了保存并保存成功后将模拟告警按钮置灰6秒钟
-var updateAlarmBtnState=function(node){
- var waitsecs = 6;
- var i=1;
- node.alarmbtndisabled=true;
- node.alarmbtnvalue="喝杯茶,稍等"+ waitsecs +"秒";
- var id = setInterval(function(){
- if(i<waitsecs){
- printnr = waitsecs-i;
- node.alarmbtnvalue="喝杯茶,稍等"+ printnr +"秒";
- i++;
- }else{
- node.alarmbtnvalue="模拟告警";
- node.alarmbtndisabled=false;
- window.clearInterval(id);
- }
- },1000);
-}
-
-//以下函数为点击导航菜单时组合刷新对应的下拉菜单
-var updateSelectForAddHOST=function(){
- updateVimList();
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=false;
-}
-var updateSelectForAddVNF=function(){
- updateVimList();
- updateVnfmList();
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=false;
-}
-var updateSelectForAddVDU=function(){
- updateVimList();
- updateVnfList();
- updateHostList();
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=false;
-}
-var updateSelectForAddVNFC=function(){
- updateVnfList();
- updateVduList();
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=false;
-}
-var updateSelectForAddNS=function(){
- updateVnfList();
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=false;
-}
-//以下函数为刷新下拉菜单对应的实现类
-var updateVnfList=function(){
- //ajax查询vnf列表
- $.ajax({
- "type": 'get',
- "url": vm.$queryVnfInfoUrl,
- "dataType": "json",
- "success": function (resp) {
- if(resp.operationResult==vm.$operationResult.success)
- {
- vm.vnfList = (resp==null)?[]:resp.data;
- }
- else{
- alert("查询vnf列表失败");
- vm.vnfList=[];
- return;
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- alert("查询vnf列表失败:"+textStatus+":"+errorThrown);
- return;
- }
- });
-}
-
-var updateVimList=function(){
- //ajax查询vim列表
- $.ajax({
- "type": 'get',
- "url": vm.$queryVimInfoUrl,
- "dataType": "json",
- "success": function (resp) {
- if(resp.operationResult==vm.$operationResult.success)
- {
- vm.vimList = (resp==null)?[]:resp.data;
- }
- else{
- vm.vimList=[];
- alert("查询vim列表失败");
- return;
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- alert("查询vim列表失败:"+textStatus+":"+errorThrown);
- return;
- }
- });
-}
-
-var updateHostList=function(){
- //ajax查询host列表
- $.ajax({
- "type": 'get',
- "url": vm.$queryHostInfoUrl,
- "dataType": "json",
- "success": function (resp) {
- if(resp.operationResult==vm.$operationResult.success)
- {
- vm.hostList = (resp==null)?[]:resp.data;
- }
- else{
- vm.hostList=[];
- alert("查询host列表失败");
- return;
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- alert("查询host列表失败:"+textStatus+":"+errorThrown);
- return;
- }
- });
-}
-var updateVduList=function(){
- //ajax查询vdu列表
- $.ajax({
- "type": 'get',
- "url": vm.$queryVduInfoUrl,
- "dataType": "json",
- "success": function (resp) {
- if(resp.operationResult==vm.$operationResult.success)
- {
- vm.vduList = (resp==null)?[]:resp.data;
- }
- else{
- vm.vduList=[];
- alert("查询vdu列表失败");
- return;
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- alert("查询vdu列表失败:"+textStatus+":"+errorThrown);
- return;
- }
- });
-}
-var updateVnfmList=function(){
- //ajax查询vnfm列表
- $.ajax({
- "type": 'get',
- "url": vm.$queryVnfmInfoUrl,
- "dataType": "json",
- "success": function (resp) {
- if(resp.operationResult==vm.$operationResult.success)
- {
- vm.vnfmList = (resp==null)?[]:resp.data;
- }
- else{
- vm.vnfmList=[];
- alert("查询vnfm列表失败");
- return;
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- alert("查询vnfm列表失败:"+textStatus+":"+errorThrown);
- return;
- }
- });
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/js/monitorHeadChart.js b/umc-iui/src/main/resources/webroot/umc-drill/js/monitorHeadChart.js
deleted file mode 100644
index 67b9c15a..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/js/monitorHeadChart.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-/**
- * Created by 10184303 on 15-4-30.
- * */
-/*define("headchart",["require"],function(require){
- var $ = require("/ngict/iui/component/thirdparty/jquery/jquery-1.11.2.min");
- var d3 = require("/ngict/iui/component/ict/ict-dashboard/assets/js/d3.min");
- return {
- width: function(){
- return $("#ItDeviceSvg").innerWidth();
- },
- SYBASEIQ: "M3.492,1C2.106,1,1,2.162,1,3.599V13.4C1,14.838,2.106,16,3.492,16h10.015 C14.895,16,16,14.838,16,13.4V3.599C16,2.162,14.895,1,13.507,1H3.492z M8.5,2.364c3.319,0,6.024,1.141,6.115,2.579 c0.001,0.009,0,0.034,0,0.042c0.001,0.015,0,0.026,0,0.042c0,1.472-2.74,2.663-6.115,2.663S2.384,6.498,2.384,5.027 S5.125,2.364,8.5,2.364z M2.363,5.091c0.015,0.164,0.043,0.446,0.043,0.533c0,1.469,2.74,2.662,6.116,2.662 c3.375,0,6.114-1.193,6.114-2.662v1.769c0,1.469-2.739,2.663-6.114,2.663c-3.376,0-6.116-1.194-6.116-2.663 c0-0.117-0.021-0.39-0.043-0.64V5.091z M2.363,7.691c0.015,0.164,0.043,0.424,0.043,0.51c0,1.471,2.74,2.664,6.116,2.664 c3.375,0,6.114-1.193,6.114-2.664v1.684c0,1.471-2.739,2.664-6.114,2.664c-3.376,0-6.116-1.193-6.116-2.664 c0-0.117-0.021-0.389-0.043-0.641V7.691z M2.363,10.184c0.015,0.162,0.043,0.424,0.043,0.51c0,1.471,2.74,2.664,6.116,2.664 c3.375,0,6.114-1.193,6.114-2.664v1.129c-0.008,0.043-0.021,0.123-0.021,0.15c0,1.471-2.741,2.662-6.116,2.662 s-6.115-1.191-6.115-2.662c0-0.031-0.016-0.107-0.021-0.15V10.184L2.363,10.184z",
- HOST: "M 0.8125,0 C 0.37159462,0 0,0.43557111 0,0.96875 l 0,14.0625 C 0,15.564429 0.37159462,16 0.8125,16 L 4.46875,16 4.5,16 9,16 c 0.4409055,0 0.78125,-0.435571 0.78125,-0.96875 l 0,-4.65625 0,-0.8125 0,-8.59375 C 9.78125,0.43557111 9.4721555,0 9.03125,0 L 0.8125,0 z m 9.71875,0.09375 c 0.296864,0.15740697 0.5,0.49280982 0.5,0.875 l 0,8.59375 0,0.8125 0,4.65625 c 0,0.314576 -0.153955,0.57279 -0.375,0.75 L 14.75,14.5625 C 15.409952,14.366037 16,14.078578 16,13.46875 L 16,2.4375 C 16,1.8276721 15.409912,1.540316 14.75,1.34375 l -4.21875,-1.25 z M 1.875,2.1875 l 6.0625,0 c 0.2970226,0 0.53125,0.2970662 0.53125,0.65625 l 0,3.28125 c 0,0.3591838 -0.2342274,0.625 -0.53125,0.625 l -6.0625,0 C 1.5779777,6.75 1.3125,6.4841838 1.3125,6.125 l 0,-3.28125 C 1.3125,2.4845662 1.5779777,2.1875 1.875,2.1875 z m 0.25,0.9375 c -0.133115,0 -0.25,0.1993258 -0.25,0.46875 0,0.2694242 0.116885,0.5 0.25,0.5 l 5.5625,0 c 0.1331154,0 0.21875,-0.2305758 0.21875,-0.5 C 7.90625,3.3243258 7.8206154,3.125 7.6875,3.125 l -5.5625,0 z m 0,1.75 c -0.133115,0 -0.25,0.1993258 -0.25,0.46875 0,0.2694242 0.116885,0.5 0.25,0.5 l 5.5625,0 c 0.1331154,0 0.21875,-0.2305758 0.21875,-0.5 C 7.90625,5.0743258 7.8206154,4.875 7.6875,4.875 l -5.5625,0 z M 4.90625,10.5 c 0.5522847,0 1,0.447715 1,1 0,0.552285 -0.4477153,1 -1,1 -0.5522847,0 -1,-0.447715 -1,-1 0,-0.552285 0.4477153,-1 1,-1 z",
- getChart: function(chartName){
- switch (chartName){
- case Constants.MOC_SYBASEIQ: return this.SYBASEIQ;
- case Constants.MOC_SUSE: return this.HOST;
- }
- },
- monitorHeadChartDraw: function(chartName){
- var chart = this.getChart(chartName);
- var svg = d3.select("#ItDeviceSvg")
- .append("svg")
- .attr("width", width);
- var root = svg.append("g")
- .attr("class", "gNode")
- .attr("id", "root")
- .attr("transform", "translate(100, 90)");
- root.append("circle")
- .attr("type", "wrapper")
- .attr("r", 70)
- .attr("style", "fill: rgb(144, 198, 192);");
- var img = root.append("g")
- .attr("transform", "translate(-50,-50)");
- img.append("g")
- .attr("transform", "scale(6, 6)")
- .append("path")
- .attr("d" , chart)
- .attr("style", "fill:#fff;fill-opacity:1;stroke:none");
- root.append("text")
- .attr("fill", "#ffffff")
- .attr("dx", -25)
- .attr("dy", 35);
- }
- }
-});*/
-var width = $("#ItDeviceSvg").innerWidth();
-var SYBASEIQ = "M3.492,1C2.106,1,1,2.162,1,3.599V13.4C1,14.838,2.106,16,3.492,16h10.015 C14.895,16,16,14.838,16,13.4V3.599C16,2.162,14.895,1,13.507,1H3.492z M8.5,2.364c3.319,0,6.024,1.141,6.115,2.579 c0.001,0.009,0,0.034,0,0.042c0.001,0.015,0,0.026,0,0.042c0,1.472-2.74,2.663-6.115,2.663S2.384,6.498,2.384,5.027 S5.125,2.364,8.5,2.364z M2.363,5.091c0.015,0.164,0.043,0.446,0.043,0.533c0,1.469,2.74,2.662,6.116,2.662 c3.375,0,6.114-1.193,6.114-2.662v1.769c0,1.469-2.739,2.663-6.114,2.663c-3.376,0-6.116-1.194-6.116-2.663 c0-0.117-0.021-0.39-0.043-0.64V5.091z M2.363,7.691c0.015,0.164,0.043,0.424,0.043,0.51c0,1.471,2.74,2.664,6.116,2.664 c3.375,0,6.114-1.193,6.114-2.664v1.684c0,1.471-2.739,2.664-6.114,2.664c-3.376,0-6.116-1.193-6.116-2.664 c0-0.117-0.021-0.389-0.043-0.641V7.691z M2.363,10.184c0.015,0.162,0.043,0.424,0.043,0.51c0,1.471,2.74,2.664,6.116,2.664 c3.375,0,6.114-1.193,6.114-2.664v1.129c-0.008,0.043-0.021,0.123-0.021,0.15c0,1.471-2.741,2.662-6.116,2.662 s-6.115-1.191-6.115-2.662c0-0.031-0.016-0.107-0.021-0.15V10.184L2.363,10.184z";
-var HOST = "M 0.8125,0 C 0.37159462,0 0,0.43557111 0,0.96875 l 0,14.0625 C 0,15.564429 0.37159462,16 0.8125,16 L 4.46875,16 4.5,16 9,16 c 0.4409055,0 0.78125,-0.435571 0.78125,-0.96875 l 0,-4.65625 0,-0.8125 0,-8.59375 C 9.78125,0.43557111 9.4721555,0 9.03125,0 L 0.8125,0 z m 9.71875,0.09375 c 0.296864,0.15740697 0.5,0.49280982 0.5,0.875 l 0,8.59375 0,0.8125 0,4.65625 c 0,0.314576 -0.153955,0.57279 -0.375,0.75 L 14.75,14.5625 C 15.409952,14.366037 16,14.078578 16,13.46875 L 16,2.4375 C 16,1.8276721 15.409912,1.540316 14.75,1.34375 l -4.21875,-1.25 z M 1.875,2.1875 l 6.0625,0 c 0.2970226,0 0.53125,0.2970662 0.53125,0.65625 l 0,3.28125 c 0,0.3591838 -0.2342274,0.625 -0.53125,0.625 l -6.0625,0 C 1.5779777,6.75 1.3125,6.4841838 1.3125,6.125 l 0,-3.28125 C 1.3125,2.4845662 1.5779777,2.1875 1.875,2.1875 z m 0.25,0.9375 c -0.133115,0 -0.25,0.1993258 -0.25,0.46875 0,0.2694242 0.116885,0.5 0.25,0.5 l 5.5625,0 c 0.1331154,0 0.21875,-0.2305758 0.21875,-0.5 C 7.90625,3.3243258 7.8206154,3.125 7.6875,3.125 l -5.5625,0 z m 0,1.75 c -0.133115,0 -0.25,0.1993258 -0.25,0.46875 0,0.2694242 0.116885,0.5 0.25,0.5 l 5.5625,0 c 0.1331154,0 0.21875,-0.2305758 0.21875,-0.5 C 7.90625,5.0743258 7.8206154,4.875 7.6875,4.875 l -5.5625,0 z M 4.90625,10.5 c 0.5522847,0 1,0.447715 1,1 0,0.552285 -0.4477153,1 -1,1 -0.5522847,0 -1,-0.447715 -1,-1 0,-0.552285 0.4477153,-1 1,-1 z";
-var getChart = function(chartName){
- switch (chartName){
- case Constants.MOC_SYBASEIQ: return SYBASEIQ;
- case Constants.MOC_SUSE: return HOST;
- }
-}
-var monitorHeadChartDraw = function(chartName){
- var chart = getChart(chartName);
- var svg = d3.select("#ItDeviceSvg")
- .append("svg")
- .attr("style", "width: 100%; height: 100%;");
- var root = svg.append("g")
- .attr("class", "gNode")
- .attr("id", "root")
- .attr("transform", "translate(95, 95)");
- root.append("circle")
- .attr("type", "wrapper")
- .attr("r", 70)
- .attr("style", "fill: rgb(144, 198, 192);");
- var img = root.append("g")
- .attr("transform", "translate(-45,-45)");
- img.append("g")
- .attr("transform", "scale(5.5, 5.5)")
- .append("path")
- .attr("d" , chart)
- .attr("style", "fill:#fff;fill-opacity:1;stroke:none");
- root.append("text")
- .attr("fill", "#ffffff")
- .attr("dx", -25)
- .attr("dy", 35);
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/js/monitors.js b/umc-iui/src/main/resources/webroot/umc-drill/js/monitors.js
deleted file mode 100644
index 3e263c72..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/js/monitors.js
+++ /dev/null
@@ -1,494 +0,0 @@
-/*
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var cpuLine = function(){
- var chartCPU = echarts.init(document.getElementById('cpuUsage'));
- var optionCpu = {
- title : {
- text: 'CPU使用率',
- subtext: ''
- },
- tooltip : {
- trigger: 'axis'
- },
- legend: {
- data:['CPU']
- },
- toolbox: {
- show : true,
- feature : {
- mark : {show: true},
- dataView : {show: true, readOnly: false},
- magicType : {show: true, type: ['line', 'bar']},
- restore : {show: true},
- saveAsImage : {show: true}
- }
- },
- calculable : true,
- xAxis : [
- {
- type : 'category',
- boundaryGap : false,
- /* data : ['周一','周二','周三','周四','周五','周六','周日'] */
- data:[(new Date()).toLocaleTimeString()]
- }
- ],
- yAxis : [
- {
- type : 'value',
- axisLabel : {
- formatter: '{value} %'
- }
- }
- ],
- series : [
- {
- name:'CPU',
- type:'line',
- //data:[11, 31, 45, 13, 22, 13, 60],
- data:[],
- /* markPoint : {
- data : [
- {type : 'max', name: '最大值'},
- {type : 'min', name: '最小值'}
- ]
- }, */
- markLine : {
- data : [
- {type : 'average', name: '平均值'}
- ]
- }
- }
- ]
- };
-
- chartCPU.setOption(optionCpu);
-
- var timeTicket;
- clearInterval(timeTicket);
- timeTicket = setInterval(function (){
- optionCpu.xAxis[0].data.push((new Date()).toLocaleTimeString());
- if(optionCpu.xAxis[0].data.length>7){
- optionCpu.xAxis[0].data.shift();
- }
- optionCpu.series[0].data.push(Math.random()*100);
- if(optionCpu.series[0].data.length>7){
- optionCpu.series[0].data.shift();
- }
- chartCPU.setOption(optionCpu, true);
- }, 2000);
-
-}();
-
-var memLine = function(){
- var chartMem = echarts.init(document.getElementById('memUsage'));
- var optionMem = {
- title : {
- text: '内存使用率',
- subtext: ''
- },
- tooltip : {
- trigger: 'axis'
- },
- legend: {
- data:['内存']
- },
- toolbox: {
- show : true,
- feature : {
- mark : {show: true},
- dataView : {show: true, readOnly: false},
- magicType : {show: true, type: ['line', 'bar']},
- restore : {show: true},
- saveAsImage : {show: true}
- }
- },
- calculable : true,
- xAxis : [
- {
- type : 'category',
- boundaryGap : false,
- /* data : ['周一','周二','周三','周四','周五','周六','周日'] */
- data:[(new Date()).toLocaleTimeString()]
- }
- ],
- yAxis : [
- {
- type : 'value',
- axisLabel : {
- formatter: '{value} %'
- }
- }
- ],
- series : [
- {
- name:'内存',
- type:'line',
- //data:[11, 31, 45, 13, 22, 13, 60],
- data:[],
- /* markPoint : {
- data : [
- {type : 'max', name: '最大值'},
- {type : 'min', name: '最小值'}
- ]
- }, */
- itemStyle: {
- normal: {
- /* lineStyle: {
- color: '#79D6CE'
- } */
- color: '#79D6CE'
- }
- },
- markLine : {
- data : [
- {type : 'average', name: '平均值'}
- ]
- }
- }
- ]
- };
-
- chartMem.setOption(optionMem);
-
- var timeTicket;
- clearInterval(timeTicket);
- timeTicket = setInterval(function (){
- optionMem.xAxis[0].data.push((new Date()).toLocaleTimeString());
- if(optionMem.xAxis[0].data.length>7){
- optionMem.xAxis[0].data.shift();
- }
- optionMem.series[0].data.push(Math.random()*100);
- if(optionMem.series[0].data.length>7){
- optionMem.series[0].data.shift();
- }
- chartMem.setOption(optionMem, true);
- }, 3000);
-
-}();
-
-/* var networkFlow = function(){
- var chartNetFlow = echarts.init(document.getElementById('networkFlow'));
- var optionNetFlow = {
- title : {
- text: '网络信息',
- subtext: ''
- },
- tooltip : {
- trigger: 'axis'
- },
- legend: {
- data:['eht-0','eht-1','eht-2','eht-3','eht-4']
- },
- toolbox: {
- show : true,
- orient: 'vertical',
- feature : {
- mark : {show: true},
- dataView : {show: true, readOnly: false},
- magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
- restore : {show: true},
- saveAsImage : {show: true}
- }
- },
- calculable : true,
- xAxis : [
- {
- type : 'category',
- boundaryGap : false,
- data:[(new Date()).toLocaleTimeString()]
- }
- ],
- yAxis : [
- {
- type : 'value',
- axisLabel : {
- formatter: '{value} MB'
- }
- }
- ],
- series : [
- {
- name:'eht-0',
- type:'line',
- stack: '总量',
- data:[0]
- },
- {
- name:'eht-1',
- type:'line',
- stack: '总量',
- data:[0]
- },
- {
- name:'eht-2',
- type:'line',
- stack: '总量',
- data:[0]
- },
- {
- name:'eht-3',
- type:'line',
- stack: '总量',
- data:[0]
- },
- {
- name:'eht-4',
- type:'line',
- stack: '总量',
- data:[0]
- }
- ]
- };
-
- chartNetFlow.setOption(optionNetFlow);
-
- var timeTicket;
- clearInterval(timeTicket);
- timeTicket = setInterval(function (){
- optionNetFlow.xAxis[0].data.push((new Date()).toLocaleTimeString());
- if(optionNetFlow.xAxis[0].data.length>7){
- optionNetFlow.xAxis[0].data.shift();
- }
- for(var i=0;i<optionNetFlow.series.length;i++){
- optionNetFlow.series[i].data.push(Math.random()*100);
- if(optionNetFlow.series[i].data.length>7){
- optionNetFlow.series[i].data.shift();
- }
- }
- chartNetFlow.setOption(optionNetFlow, true);
- }, 3000);
-
-}(); */
-
-var networkFlow = function(){
- var chartNetFlow = echarts.init(document.getElementById('networkFlow'));
-
- var placeHoledStyle = {
- normal:{
- barBorderColor:'rgba(0,0,0,0)',
- color:'rgba(0,0,0,0)'
- },
- emphasis:{
- barBorderColor:'rgba(0,0,0,0)',
- color:'rgba(0,0,0,0)'
- }
- };
- var dataStyle = {
- normal: {
- label : {
- show: true,
- position: 'insideLeft',
- formatter: '{c}%'
- }
- }
- };
-
- var optionNetFlow = {
- title: {
- text: '网络信息',
- subtext: '',
- /* sublink: 'http://e.weibo.com/1341556070/AiEscco0H' */
- },
- tooltip : {
- trigger: 'axis',
- axisPointer : { // 坐标轴指示器,坐标轴触发有效
- type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- },
- formatter : '{b}<br/>{a0}:{c0}%<br/>{a2}:{c2}%<br/>{a4}:{c4}%<br/>{a6}:{c6}%'
- },
- legend: {
- y: 55,
- itemGap : document.getElementById('networkFlow').offsetWidth / 8,
- data:['流入带宽使用率', '流出带宽使用率','收到的错误包率', '发送的错误包率']
- },
- toolbox: {
- show : true,
- feature : {
- mark : {show: true},
- dataView : {show: true, readOnly: false},
- restore : {show: true},
- saveAsImage : {show: true}
- }
- },
- grid: {
- y: 80,
- y2: 30
- },
- xAxis : [
- {
- type : 'value',
- position: 'top',
- splitLine: {show: false},
- axisLabel: {show: false}
- }
- ],
- yAxis : [
- {
- type : 'category',
- splitLine: {show: false},
- data : ['eht-0', 'eht-1', 'eht-2', 'eht-3']
- }
- ],
- series : [
- {
- name:'流入带宽使用率',
- type:'bar',
- stack: '总量',
- itemStyle : dataStyle,
- data:[38, 50, 33, 72]
- },
- {
- name:'流入带宽使用率',
- type:'bar',
- stack: '总量',
- itemStyle: placeHoledStyle,
- data:[62, 50, 67, 28]
- },
- {
- name:'流出带宽使用率',
- type:'bar',
- stack: '总量',
- itemStyle : dataStyle,
- data:[61, 41, 42, 30]
- },
- {
- name:'流出带宽使用率',
- type:'bar',
- stack: '总量',
- itemStyle: placeHoledStyle,
- data:[39, 59, 58, 70]
- },
- {
- name:'收到的错误包率',
- type:'bar',
- stack: '总量',
- itemStyle : dataStyle,
- data:[37, 35, 44, 60]
- },
- {
- name:'收到的错误包率',
- type:'bar',
- stack: '总量',
- itemStyle: placeHoledStyle,
- data:[63, 65, 56, 40]
- },
- {
- name:'发送的错误包率',
- type:'bar',
- stack: '总量',
- itemStyle : dataStyle,
- data:[71, 50, 31, 39]
- },
- {
- name:'发送的错误包率',
- type:'bar',
- stack: '总量',
- itemStyle: placeHoledStyle,
- data:[29, 50, 69, 61]
- }
- ]
- };
-
- chartNetFlow.setOption(optionNetFlow);
-
- var timeTicket;
- clearInterval(timeTicket);
- timeTicket = setInterval(function (){
- /* optionNetFlow.xAxis[0].data.push((new Date()).toLocaleTimeString());
- if(optionNetFlow.xAxis[0].data.length>7){
- optionNetFlow.xAxis[0].data.shift();
- } */
- for(var i=0;i<optionNetFlow.series.length;i++){
- if (i%2 == 0) {
- optionNetFlow.series[i].data.push(Math.floor(Math.random()*100));
- }else{
- for(var j=0;j<4;j++){
- optionNetFlow.series[i].data[j]=100-optionNetFlow.series[i-1].data[j];
- }
- }
- if(optionNetFlow.series[i].data.length>4){
- optionNetFlow.series[i].data.shift();
- }
- }
- chartNetFlow.setOption(optionNetFlow, true);
- }, 3000);
-
-}();
-
-var diskUsage = function(){
- var chartDiskUsage = echarts.init(document.getElementById('diskUsage'));
- var optionDiskUsage = {
- title : {
- text: '磁盘使用情况',
- subtext: ''
- },
- tooltip : {
- trigger: 'axis',
- axisPointer : { // 坐标轴指示器,坐标轴触发有效
- type : 'shadow' // 默认为直线,可选为:'line' | 'shadow'
- }
- },
- legend: {
- data:['已使用', '未使用']
- },
- toolbox: {
- show : true,
- orient: 'vertical',
- feature : {
- mark : {show: true},
- dataView : {show: true, readOnly: false},
- magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
- restore : {show: true},
- saveAsImage : {show: true}
- }
- },
- calculable : true,
- xAxis : [
- {
- type : 'value',
- axisLabel : {
- formatter: '{value} GB'
- }
- }
- ],
- yAxis : [
- {
- type : 'category',
- data : ['C:','D:','E:','F:','G:']
- }
- ],
- series : [
- {
- name:'已使用',
- type:'bar',
- stack: '总量',
- itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
- data:[320, 302, 301, 334, 390]
- },
- {
- name:'未使用',
- type:'bar',
- stack: '总量',
- itemStyle : { normal: {label : {show: true, position: 'insideRight'}}},
- data:[820, 832, 901, 934, 1290]
- }
- ]
- };
-
- chartDiskUsage.setOption(optionDiskUsage);
-
-}();
-
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/js/vnfController.js b/umc-iui/src/main/resources/webroot/umc-drill/js/vnfController.js
deleted file mode 100644
index e715d8d6..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/js/vnfController.js
+++ /dev/null
@@ -1,607 +0,0 @@
-/*
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var breadcrumbEle;
-
-if(window.parent.ZteFrameWork) {
- breadcrumbEle = window.parent.ZteFrameWork.getBreadcrumbEle();
-}
-
-/* var vnfnodeDetail = [
- {
- name:"名称",
- value:"moc_name"
- },
- {
- name:"状态",
- value:"status"
- },
- {
- name:"网络服务提供商",
- value:"vendor"
- },
- {
- name:"归属VNFM",
- value:"vnfm_name"
- }
-]; */
-var i18nTages = function(){
- var i18nItems = $("span[name_i18n=com_zte_umc_monitor]");
- for(var i=0;i<i18nItems.length;i++){
- var $item = $(i18nItems.eq(i));
- var itemId = $item.attr('id');
- if(typeof($item.attr("title"))!="undefined"){
- $item.attr("title", $.i18n.prop(itemId));
- }else{
- $item.text($.i18n.prop(itemId));
- }
- }
-}
-
-var nodeDetailMap = {
- //name:"标题",
- name: $.i18n.prop("com_zte_umc_monitor_title"),
- moc: $.i18n.prop("com_zte_umc_monitor_detail_moc_id"),
- moc_name: $.i18n.prop("com_zte_umc_monitor_detail_moc"),
- //status:"状态",
- status: $.i18n.prop("com_zte_umc_monitor_status"),
- //vendor:"网络服务提供商",
- vendor: $.i18n.prop("com_zte_umc_monitor_service_provider"),
- //version:"版本号",
- version: $.i18n.prop("com_zte_umc_monitor_version_no"),
- //vnfm_name:"归属VNFM",
- vnfm_name: $.i18n.prop("com_zte_umc_monitor_vnfm_blongs_to"),
- //vim_name:"归属VIM",
- vim_name: $.i18n.prop("com_zte_umc_monitor_vim_blongs_to"),
- /* vnf_address:"IP地址", */
- //ip_addresses:"IP地址",
- ip_addresses: $.i18n.prop("com_zte_umc_monitor_ip_address"),
- /* vdu_image:"镜像文件", */
- //createtime:"创建时间",
- createtime: $.i18n.prop("com_zte_umc_monitor_create_time"),
- //protocol:"协议",
- protocol: $.i18n.prop("com_zte_umc_monitor_protocol"),
- //port:"端口",
- port: $.i18n.prop("com_zte_umc_monitor_port"),
- //user:"用户名"
- port: $.i18n.prop("com_zte_umc_monitor_user_name"),
- //user:"用户名"
- type: $.i18n.prop("com_zte_umc_monitor_type")
-};
-
-var transformQueryViewData = function(queryViewData, pageSize){
- var newData = [];
- var pageNo = Math.floor(queryViewData.length / pageSize) + 1;
- for(var i=0;i<pageNo;i++){
- newData.push({array:[]});
- }
- for(var j=0;j<queryViewData.length;j++){
- newData[Math.floor(j/pageSize)].array.push(queryViewData[j]);
- }
- return newData;
-}
-
-var transformDataByType = function(childs){
- var newData = [];
- newData.push({array:[]});
- newData.push({array:[]});
- for(var i=0;i<childs.length;i++){
- if(childs[i].rendertype == "ns"){
- newData[0].array.push(childs[i]);
- }else{
- newData[1].array.push(childs[i]);
- }
- }
- return newData;
-}
-
-var drillURL = {
-
- /* 钻取vnf
- http://10.74.44.30:21180/nfv/rest/umc/monitor/topology/vnf/e4fe8c5f-7136-463c-9297-f90ee184baf2
- 钻取vnfc
- http://10.74.44.30:21180/nfv/rest/umc/monitor/topology/vnfc/139e7944-2429-432b-9ac9-e2d1fabdcd40
- 钻取vdu
- http://10.74.44.30:21180/nfv/rest/umc/monitor/topology/vdu/8f193d66-5b07-47e2-8bd2-78664390a7c2
- 钻取host
- http://10.74.44.30:21180/nfv/rest/umc/monitor/topology/host/b2230479-590e-4e3a-a3e6-b5b36d39769f */
-
- ns: "/api/umcdrill/v1/topology/ns/",
- vnf: "/api/umcdrill/v1/topology/vnf/",
- vnfc: "/api/umcdrill/v1/topology/vnfc/",
- vdu: "/api/umcdrill/v1/topology/vdu/",
- host: "/api/umcdrill/v1/topology/host/"
-}
-
-var getVNFData = function(url, id){
- var resJson;
- var getData = [];
- /* getData.push({
- name:"data",
- value:JSON.stringify({"ruleType":1,"ruleSort":1})
- }); */
- $.ajax( {
- async:false,
- "dataType": 'json',
- "type": "GET",
- "url": url + id,
- "data": getData,
- "contentType": 'application/json; charset=utf-8',
- "success": function(res, textStatus, jqXHR) {
- resJson = res;
- },
- "error": function() {
- alert("Communication Error!");
- }
- } );
- return resJson;
-}
-
-var generateDetailInfo = function(obj){
- vmVNF.selfDetail = [];
- for(var p in obj){
- if(typeof(obj[p])!="function" && nodeDetailMap[p]){
- if(p=="name"){
- vmVNF.detailTitle = obj[p];
- }else{
- vmVNF.selfDetail.push({
- name:nodeDetailMap[p],
- value:obj[p]
- });
- }
- }
- }
-}
-
-var setModelData = function(modelItem){
- var resJson = getVNFData(drillURL[modelItem.rendertype], modelItem.id);
- if(resJson.parents && resJson.parents.length>0){
- vmVNF.parent = resJson.parents;
- if(vmVNF.parent.length==1 && vmVNF.parent[0].id=="root"){
- $(".row-fluid.parents").hide();
- $("#arrowParent").show();
- $(".parentWrapper").show();
- }else{
- $(".row-fluid.parents").show();
- $("#arrowParent").show();
- $(".parentWrapper").show();
- }
- }else{
- vmVNF.parent = [];
- $(".row-fluid.parents").hide();
- $("#arrowParent").hide();
- $(".parentWrapper").hide();
- }
- vmVNF.self = resJson.self;
- if(vmVNF.self.id=="root"){
- vmVNF.rootNodeVisable = true;
- }else{
- vmVNF.rootNodeVisable = false;
- }
- if(resJson.childs && resJson.childs.length>0){
- vmVNF.sun = transformQueryViewData(resJson.childs, 6);
- $(".row-fluid.suns").show();
- $("#arrowSun").show();
- }else{
- vmVNF.sun = [];
- $(".row-fluid.suns").hide();
- $("#arrowSun").hide();
- }
- vmVNF.selfdetail = resJson.self;
- //生成详细信息
- /* vmVNF.selfDetail = [];
- var obj = resJson.self;
- for(var p in obj){
- if(typeof(obj[p])!="function" && nodeDetailMap[p]){
- if(p=="name"){
- vmVNF.detailTitle = obj[p];
- }else{
- vmVNF.selfDetail.push({
- name:nodeDetailMap[p],
- value:obj[p]
- });
- }
- }
- } */
- generateDetailInfo(resJson.self);
-}
-
-var vmVNF = avalon.define({
- $id: "vnfController",
- currentNodeType: 'VNF',
- tableTitle:'拓扑结构',
- parentVisable:true,
- sunVisable:true,
- boxVisible:true,
- rootNodeVisable:true,
- parent:[
- /* {id: 'deyang', name: "网络监控服务", rendertype:"ns", alarmCount:123},
- {id: 'chengdu', name: "网络监控服务", rendertype:"ns", alarmCount:112},
- {id: 'mianyang', name: "网络监控服务", rendertype:"ns", alarmCount:23} */
- ],
- self:{
- /* id: 'e4fe8c5f-7136-463c-9297-f90ee184baf2', name: "2G 语音交换", rendertype:"vnf", alarmCount:112 */
- },
- selfdetail:{
- /* "id":"e4fe8c5f-7136-463c-9297-f90ee184baf2",
- "name" : "VNF 2G 语音交换",
- "status" : "acitve",
- "vendor" : "ZTE Corp",
- "alarm" : "5",
- "vnfm_info":"VNFM no.1",
- "version":"1.0.0.1",
- "vnf_address":"10.5.25.96" */
- },
- selfDetail:[],
- detailTitle:"",
- sun:[
- /* {
- array:[
- {id: '139e7944-2429-432b-9ac9-e2d1fabdcd40', name: "控制进程", rendertype:"vnfc", alarmCount:23},
- {id: 'chengdu', name: "控制进程", rendertype:"vnfc", alarmCount:23},
- {id: 'mianyang', name: "控制进程", rendertype:"vnfc", alarmCount:23},
- {id: 'wenchuan', name: "控制进程", rendertype:"vnfc", alarmCount:23},
- {id: 'leshan', name: "控制进程", rendertype:"vnfc", alarmCount:23},
- {id: 'emei', name: "控制进程", rendertype:"vnfc", alarmCount:23}
- ]
- },
- {
- array:[
- {id: 'wuhan', name: "VDU映像", rendertype:"vdu", alarmCount:23},
- {id: 'xian', name: "VDU映像", rendertype:"vdu", alarmCount:23}
- ]
- } */
- ],
- parentExpandClicked: function (modelItem, item) {
- vmVNF.parentVisable=true;
- },
- sunExpandClicked: function (modelItem, item) {
- vmVNF.sunVisable=true;
- },
- parentsRended: function(a,b,c){
- if(vmVNF.parent.length < 3){
- $($(".parentWrapper .col-xs-4")[0]).addClass("col-xs-offset-4");
- }
- //root的情况隐藏边框
- if(vmVNF.parent.length == 1 && vmVNF.parent[0].id == "root"){
- $(".parentWrapper").css("border-width", "0px");
- $(".parentWrapper").css("margin-bottom", "0px");
- $("#arrowParent").css("padding-top", "0px");
- }else{
- $(".parentWrapper").css("border-width", "2px");
- $(".parentWrapper").css("margin-bottom", "10px");
- $("#arrowParent").css("padding-top", "15px");
- }
- },
- childrenRended: function (a, b, c, d, e) {
- for(var i=0;i<vmVNF.sun.length;i++){
- if(vmVNF.sun[i].array.length < 3){
- //$($(".sunWrapper .col-xs-12 .col-xs-4")[i]).addClass("col-xs-offset-4");
- $($(".col-xs-4", $(".sunWrapper .col-xs-12.sunRow")[i])[0]).addClass("col-xs-offset-4");
- }
- }
- if(vmVNF.sun.length == 0){
- $(".sunWrapper").css("border-width", "0px");
- }else{
- $(".sunWrapper").css("border-width", "2px");
- }
- },
- boxDetailClicked: function(modelItem, item){
- $(".titleArea").removeClass("titleAreaHover");
- $(".portletIcon").removeClass("portletIconHover");
- $(".portletLabel").removeClass("portletLabelHover");
- $(".titleArea", $(item).parent()).addClass("titleAreaHover");
- $(".portletIcon", $(item).parent()).addClass("portletIconHover");
- $(".portletLabel", $(item).parent()).addClass("portletLabelHover");
- //var id = modelItem.id;
- /* vmVNF.selfdetail.id = modelItem.id;
- vmVNF.selfdetail.name = modelItem.name;
- vmVNF.selfdetail.vendor = modelItem.vendor; */
- //生成详细信息
- /* vmVNF.selfDetail = [];
- var obj = modelItem;
- for(var p in obj){
- if(typeof(obj[p])!="function" && nodeDetailMap[p]){
- if(p=="name"){
- vmVNF.detailTitle = obj[p];
- }else{
- vmVNF.selfDetail.push({
- name:nodeDetailMap[p],
- value:obj[p]
- });
- }
- }
- } */
- generateDetailInfo(modelItem);
- },
- nodeClicked: function(modelItem, item){
-
- if($(item).parents(".vnfBox").hasClass("self")){
- return;
- }
-
- $(item).parents(".vnfBox").addClass("vnfBoxShrink");
- setTimeout(function(){
- $("#mainContent").addClass("mainContentShrink");
- setTimeout(function(){
- setModelData(modelItem);
- $("#mainContent").addClass("mainContentExpand");
- $("#mainContent").removeClass("mainContentShrink").removeClass("mainContentExpand");
- $(".self .boxMainArea").click();
- setTimeout(function(){
- i18nTages();
- }, 100);
- }, 500);
- /* $("#mainContent").animate({ height: "toggle"}, 1000, function(){
- setModelData(modelItem);
- $("#mainContent").animate({ height: "toggle"}, 1000);
- }); */
- }, 500);
-
- //面包屑相关
- if($(item).parents(".parentWrapper").length >0){
- var currentNodeALink = $("a#" + vmVNF.self.id, breadcrumbEle);
- var rightArrow = currentNodeALink.next();
- $(rightArrow).remove();
- $(currentNodeALink).remove();
- }else{
- $(breadcrumbEle).append("<a id='" + modelItem.id + "'>" + modelItem.name + "</a><i class='fa fa-angle-right'></i>");
- var currentNode = $("#" + modelItem.id, breadcrumbEle);
- $(currentNode).click(function(e){
- e.preventDefault();
- $("#mainContent").animate({ height: "toggle"}, 1000, function(){
- setModelData(modelItem);
- $("#mainContent").animate({ height: "toggle"}, 1000);
- });
- $(currentNode).nextAll().remove();
- $(breadcrumbEle).append("<i class='fa fa-angle-right'></i>");
- });
- }
- /* $(item).parent(".vnfBox").fadeOut(1000, function(){
- //$(".vnfBox").fadeOut(1000, function(){
- setModelData(modelItem);
- setTimeout(function(){
- $("div.vnfBox").fadeIn(0, function(){
- // setTimeout(function(){
- // $("div.vnfBox").unbind().hover(
- // function(){
- // $(".titleArea", this).addClass("titleAreaHover");
- // },
- // function(){
- // $(".titleArea", this).removeClass("titleAreaHover");
- // }
- // );
- // }, 100);
- });
- }, 100);
- }); */
- },
- clickDisplayGraphAlink: function () {
- vmVNF.boxVisible = !vmVNF.boxVisible;
- /* if(!vmVNF.boxVisible){
- parentHeight = $(".parentWrapper").height();
- //$(".parentWrapper").animate({ opacity: 'hide'}, 1000, "swing");
- $(".parentWrapper").animate({ height: '0px'}, 1000);
- }else{
- //$(".parentWrapper").animate({ opacity: 'show'}, 1000, "swing");
- $(".parentWrapper").animate({ height: parentHeight + 'px'}, 1000);
- } */
- $(".parentWrapper").animate({ height: "toggle"}, 1000);
- //$(".parentWrapper").toggleClass("parentClose", 1000, "linear");
-
- if(vmVNF.boxVisible){
- //$("#contianArea").css("margin-top", "0px");
- $("#contianArea").animate({"margin-top":"0px"}, 1000);
-
- }else{
- //$("#contianArea").css("margin-top", "30px");
- $("#contianArea").animate({"margin-top":"30px"}, 1000);
- }
- //$("#contianArea").css("margin-top", "30px");
- },
- clickSunDisplayGraphAlink: function () {
- vmVNF.sunVisable = !vmVNF.sunVisable;
- /* if(!vmVNF.sunVisable){
- //$(".sunWrapper").hide('slide', {direction: 'right'}, 1000);
- $(".sunWrapper").animate({ opacity: 'hide'}, 500, "swing");
- //$(".sunWrapper").animate( { height: "0px"}, 1000 );
- }else{
- //$(".sunWrapper").show(1000);
- $(".sunWrapper").animate({ opacity: 'show'}, 500, "swing");
- //$(".sunWrapper").animate( { height: "100px"}, 1000 );
- } */
- $(".sunWrapper").animate({ height: "toggle"}, 1000);
- if(vmVNF.sunVisable){
- //$("#arrowSun").css("padding-bottom", "0px");
- $("#contianAreaSun").animate({"margin-bottom":"-10px"}, 1000);
- }else{
- //$("#arrowSun").css("padding-bottom", "10px");
- $("#contianAreaSun").animate({"margin-bottom":"0px"}, 1000);
- }
- }
-});
-
-/* avalon.config({
- interpolate: ["<!--","-->"]
-}) */
-avalon.scan();
-
-var rootData = function(){
- var resJson;
- var getData = [];
- $.ajax( {
- async:false,
- "dataType": 'json',
- "type": "GET",
- "url": "/api/umcdrill/v1/layer/ns",
- "data": getData,
- "contentType": 'application/json; charset=utf-8',
- "success": function(res, textStatus, jqXHR) {
- resJson = res;
- if(resJson.operationresult=="FAIL"){
- alert(resJson.errorinfo);
- return;
- }
- if(resJson.parents && resJson.parents.length>0){
- vmVNF.parent = resJson.parents;
- $(".row-fluid.parents").show();
- $("#arrowParent").show();
- $(".parentWrapper").show();
- }else{
- vmVNF.parent = [];
- $(".row-fluid.parents").hide();
- $("#arrowParent").hide();
- $(".parentWrapper").hide();
- }
- vmVNF.self = resJson.self;
- if(resJson.childs && resJson.childs.length>0){
- vmVNF.sun = transformDataByType(resJson.childs);
- $(".row-fluid.suns").show();
- $("#arrowSun").show();
- }else{
- vmVNF.sun = [];
- $(".row-fluid.suns").hide();
- $("#arrowSun").hide();
- }
- vmVNF.selfdetail = resJson.self;
- $(breadcrumbEle).append("<a>" + vmVNF.self.name + "</a><i class='fa fa-angle-right'></i>");
- //生成详细信息
- /* vmVNF.selfDetail = [];
- var obj = resJson.self;
- for(var p in obj){
- if(typeof(obj[p])!="function" && nodeDetailMap[p]){
- if(p=="name"){
- vmVNF.detailTitle = obj[p];
- }else{
- vmVNF.selfDetail.push({
- name:nodeDetailMap[p],
- value:obj[p]
- });
- }
- }
- } */
- generateDetailInfo(resJson.self);
- },
- "error": function() {
- alert("Communication Error!");
- }
- } );
- return resJson;
-}();
-
-//侧栏跟随浏览器
-$(function () {
- setTimeout(function(){
- if ($(".fixed_side").length > 0) {
- var offset = $(".fixed_side").offset();
- var width = $(".fixed_side").width();
- var height = $("#mainContent").height();
- $(".fixed_side").height(height + 20);
- $(window).scroll(function () {
- var scrollTop = $(window).scrollTop();
- //如果距离顶部的距离小于浏览器滚动的距离,则添加fixed属性。
- if (offset.top < scrollTop) {
- $(".fixed_side").addClass("fixed");
- $(".fixed_side").width(width);
- $(".fixed_side").height(height + 40);
- } else { //否则清除fixed属性
- $(".fixed_side").removeClass("fixed");
- }
- });
- }
- }, 100);
-});
-
-$(".monitorJumpLabel").click(function(e){
- e.preventDefault();
- $("#monitorInfo").show();
- $('ul[role=tablist] a[href="#fmpm"]').tab('show');
- $("ul[role=tablist] > li:nth-child(2)").click();
-});
-
-$("body").show();
-
-/* setTimeout(function(){
- $("div.vnfBox").unbind().hover(
- function(){
- $(".titleArea", this).addClass("titleAreaHover");
- },
- function(){
- $(".titleArea", this).removeClass("titleAreaHover");
- }
- );
-}, 100); */
-
-/* $("span.ict-computer").click(function(){
- vmVNF.parent = [
- {id: 'deyang', name: "网络监控服务", rendertype:"NS", alarmCount:123},
- {id: 'chengdu', name: "网络监控服务", rendertype:"NS", alarmCount:112},
- {id: 'mianyang', name: "网络监控服务", rendertype:"NS", alarmCount:23},
- {id: 'zzz', name: "网络监控服务", rendertype:"NS", alarmCount:333}
- ];
- vmVNF.sun = [
- {
- array:[
- {id: 'deyang', name: "控制进程", rendertype:"vnfc", alarmCount:23},
- {id: 'chengdu', name: "控制进程", rendertype:"vnfc", alarmCount:23},
- {id: 'mianyang', name: "控制进程", rendertype:"vnfc", alarmCount:23},
- {id: 'wenchuan', name: "控制进程", rendertype:"vnfc", alarmCount:23},
- {id: 'leshan', name: "控制进程", rendertype:"vnfc", alarmCount:23}
- ]
- },
- {
- array:[
- {id: 'wuhan', name: "VDU映像", rendertype:"vdu", alarmCount:23},
- {id: 'xian', name: "VDU映像", rendertype:"vdu", alarmCount:23},
- {id: 'emei', name: "控制进程", rendertype:"vnfc", alarmCount:23}
- ]
- }
- ];
-}); */
-
-/* var resJson = {
- "parents" : [{
- "id":"02000026",
- "name" : "VNF 2G 语音交换",
- "status" : "acitve",
- "vendor" : "ZTE Corp",
- "vnfm_info":"VNFM no.1",
- "rendertype":"vnf"
- }],
- "self" : {
- "id":"03000042",
- "name" : "VNFC实例",
- "vdu_info" : "04000112",
- "rendertype":"vnfc"
- },
-"selfdetail" : {
- "id":"03000026",
- "name" : "VNFC实例",
- "vdu_info" : "04000112",
- "type":"type1"
- },
- "childs" : [
- {
- "id":"044000058",
- "vdu_image" : " vdu映像1",
- "vim_info" : "vim 1号",
- "ip_addresses" : "10.84.12.85",
- "rendertype":"vdu"
- }
- ],
-"operationresult" : " SUCCESS "
-}; */
-
diff --git a/umc-iui/src/main/resources/webroot/umc-drill/monitorns.html b/umc-iui/src/main/resources/webroot/umc-drill/monitorns.html
deleted file mode 100644
index 0550ae45..00000000
--- a/umc-iui/src/main/resources/webroot/umc-drill/monitorns.html
+++ /dev/null
@@ -1,613 +0,0 @@
-<!DOCTYPE html>
-<!--
-
- Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<html>
-<head>
- <meta charset="UTF-8">
- <link rel="stylesheet" type="text/css" href="../component/thirdparty/font-awesome/css/font-awesome.min.css" id="font_awesome"/>
- <link rel="stylesheet" type="text/css" href="../component/thirdparty/bootstrap/css/bootstrap.min.css" />
- <link rel="stylesheet" type="text/css" href="../component/thirdparty/uniform/css/uniform.default.css" />
- <link rel="stylesheet" type="text/css" href="../framework/css/plugins.css" rel="stylesheet" />
- <link rel="stylesheet" type="text/css" href="../component/css/ZteIctIcons/style.css" />
- <link rel="stylesheet" type="text/css" href="../vendor/zTree/css/zTreeStyle/zTreeStyle.css" />
- <link rel="stylesheet" type="text/css" href="../vendor/icheck/skins/all.css" />
- <!-- <link href="/ngict/iui/framework/css/style.css" rel="stylesheet" type="text/css">-->
- <link rel="stylesheet" type="text/css" href="../framework/css/ngict-component.css" rel="stylesheet" />
- <!-- <link href="css/sm.css" rel="stylesheet" type="text/css" /> -->
- <link rel="stylesheet" type="text/css" href="css/vnf.css" />
- <link rel="stylesheet" type="text/css" href="css/itm.css" />
- <style type="text/css">
- .modal.fade.in {
- top: 20%;
- }
- </style>
- <style>
- /* .ms-controller {
- visibility: hidden
- } */
- .queryLink {
- font-size: 20px;
- margin-top: 0px !important;
- }
- .activateLabel{
- text-align: center;
- margin-left: 15px;
- color: white;
- background: #49A950;
- border-radius: .25em;
- display: inline-block;
- padding:.1em .6em ;
- }
- .alamrCountLabel{
- text-align: center;
- margin-top: 10px;
- color: white;
- background-color: #E37D2C;
- border-radius: .25em;
- text-align:center;
- padding:.1em .6em ;
- }
- .contain{
- width: 80px;
- height: 30px;
- background: #fff;
- position:relative;
- border: 2px solid #7AB4E5;
- border-radius: 15px;
- text-align: center;
- color: #89BEDF;
- line-height:24px !important;
- }
- .containSun{
- width: 80px;
- height: 30px;
- background: #fff;
- position: absolute;
- left: 46%;
- top: 15px;
- border: 2px solid #BAD3E3;
- border-radius: 15px;
- text-align: center;
- color: #89BEDF;
- line-height:24px !important;
- }
- .separator-line {
- height: 1px;
- background: #7AB4E5;
- overflow: hidden;
- }
- .rightRow{
- padding-bottom: 10px;
- padding-left: 20px;
- }
- .rightContent{
- text-align: left;
- border-left: 1px solid #D1D0D0;
- height: 95px;
- }
- .hiddenBlock{
- display:none;
- }
- .detailTittle{
- color: #333;
- padding: 20px 10px 10px 0;
- font:16px Microsoft yahei;
- }
- .detailItem{
- padding: 5px;
- padding-left: 15px;
- font:15px Microsoft yahei;
- margin-bottom: 10px;
- }
- .boxMainArea{
- margin-top: 15px;
- padding: 10px;
- padding-top: 0px;
- }
- .parentClose{
- height:0px !important;
- /*opacity:0;*/
- /*display:none !important;*/
- }
- .monitorChart{
- display: inline-block;
- width:620px;
- height:350px;
- border:1px solid #ccc;
- padding:5px;
- margin:15px;
- }
- </style>
- <script>
- var icheckInit = 0;
- </script>
-</head>
-<body style="background:#fff;display:none;">
-
- <ul class="nav nav-tabs" role="tablist">
- <li role="presentation" class="active"><a href="#monitor" aria-controls="home" role="tab" data-toggle="tab"><span id="com_zte_umc_monitor_default_tip" name_i18n="com_zte_umc_monitor"></span></a></li>
- <li role="presentation" id="monitorInfo" style="display:none;"><a href="#fmpm" aria-controls="profile" role="tab" data-toggle="tab"><span id="com_zte_umc_monitor_information_tip" name_i18n="com_zte_umc_monitor"></span></a></li>
- </ul>
- <div class="tab-content">
- <div role="tabpanel" class="tab-pane active" id="monitor">
- <div ms-controller="vnfController" class="ms-controller">
- <div class="row row1">
- <div id="mainContent" class="col-xs-9 col-md-9 col-sm-9 col-lg-9">
- <!-- <a href="#">
- <div class="row rootIcon" ms-if="elem.id=='root'">
- <div class="col-xs-12">
- <span class="ict-computer" style="font-size: 68px;color: #7AB4E5;"></span>
- </div>
- </div>
- </a> -->
- <div class="parentWrapper container-fluid">
- <div class="row" style="">
- <div class="container-fluid" style="padding-right: 20px; padding-top: 10px;">
- <div class="col-xs-offset-3 col-md-offset-4 col-xs-6 col-sm-6 col-md-4 col-lg-4 boxPadding" ms-repeat-elem="parent" data-repeat-rendered="parentsRended">
- <div class="nodeWrapper">
- <div class="row rootIcon" ms-if="elem.id=='root'" style="margin-bottom:-20px">
-
- <span class="ict-computer" style="font-size: 60px;color: #7AB4E5;margin-bottom:5px"></span>
-
- </div>
- <div class="vnfBox" ms-if="elem.id!='root'">
- <div class="row titleArea" ms-click="nodeClicked(elem ,this)">
- <div class="col-xs-3 portletIcon">{{elem.rendertype}}</div>
- <div class="col-xs-9 portletLabel">{{elem.name}}</div>
- </div>
- <div class="row boxMainArea" ms-click="boxDetailClicked(elem ,this)">
- <div class="col-xs-5 icon-alarm">
- <!-- <div class="queryLink" ms-if="elem.type!='current'">图标</div> -->
-
- <div class="ict-cloud" style="font-size: 60px;color: #7AB4E5;margin-bottom:10px;"></div>
-
-
- <!-- <div class="alamrCountLabel" ms-if="elem.alarmCount>0">{{elem.alarmCount}}</div> -->
- <div class="alamrCountLabel label">{{elem.alarmCount}}</div>
-
- </div>
- <div class="col-xs-7 rightContent">
-
- <!-- <div class="row rightRow">
- <i class="fa fa-warning"></i> 个VNF
- </div> -->
-
- <div class="row rightRow">
- <span id="com_zte_umc_monitor_moc" name_i18n="com_zte_umc_monitor"></span>:{{elem.moc_name}}
- </div>
- <div class="row rightRow" ms-if="elem.rendertype!='vdu' && elem.rendertype!='host'">
- <span id="com_zte_umc_monitor_provider" name_i18n="com_zte_umc_monitor"></span>:{{elem.vendor}}
- </div>
- <!-- <div class="row rightRow">
- Name: detail
- </div> -->
- <div class="row rightRow" ms-if="elem.rendertype=='vnf'">
- <span id="com_zte_umc_monitor_vnfm_blongs_to" name_i18n="com_zte_umc_monitor"></span>: {{elem.vnfm_name}}
- </div>
-
- <div class="row rightRow" ms-if="elem.rendertype=='ns' || elem.rendertype=='vnf'">
- <label><span id="com_zte_umc_monitor_status" name_i18n="com_zte_umc_monitor"></span>:<div class="activateLabel">{{elem.status}}</div></label>
- </div>
-
- <div class="row rightRow" ms-if="elem.rendertype=='vdu' || elem.rendertype=='host'">
- <span id="com_zte_umc_monitor_ip_address" name_i18n="com_zte_umc_monitor"></span>: {{elem.ip_addresses}}
- </div>
-
- <div class="row rightRow" ms-if="elem.rendertype=='vdu'">
- <label><span id="com_zte_umc_monitor_vim_blongs_to" name_i18n="com_zte_umc_monitor"></span>: {{elem.vim_name}}</label>
- </div>
-
-
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- <div class="row-fluid parents">
- <div ms-visible="boxVisible" class="col-xs-12">
- <a href="#" ms-click="clickDisplayGraphAlink()">
- <div class="contain">包含</div>
- </a>
- </div>
- </div> -->
- <div class="row-fluid parents container-fluid" id="contianArea">
- <a href="#" ms-click="clickDisplayGraphAlink()">
- <div class="contain"><span id="com_zte_umc_monitor_contains" name_i18n="com_zte_umc_monitor"></span></div>
- <!-- <div class = "separator-line seperateLine" ></div> -->
- </a>
- </div>
- <div class="container-fluid" id="arrowParent" >
- <div class="arrow ">
- <img src="images/arrow.png">
- </div>
- </div>
- <div class="container-fluid midWrapper" style="">
-
- <div class="col-xs-offset-3 col-md-offset-4 col-xs-6 col-sm-6 col-md-4 col-lg-4 boxPadding">
- <div class="nodeWrapper">
- <div class="row rootIcon" ms-if="self.id=='root'" style="margin-bottom:5px">
- <span class="ict-computer" style="font-size: 60px;color: #7AB4E5"></span>
- </div>
- <div class="vnfBox self" ms-if="self.id!='root'">
- <div class="row titleArea" ms-click="nodeClicked(self ,this)">
- <div class="col-xs-3 portletIcon">{{self.rendertype}}</div>
- <div class="col-xs-9 portletLabel">{{self.name}}</div>
- </div>
- <div class="row boxMainArea" ms-click="boxDetailClicked(self ,this)">
- <div class="col-xs-5 icon-alarm">
-
- <div class="ict-computer" style="font-size: 60px;color: #7AB4E5;text-align: center ;margin-bottom:10px;"></div>
-
-
-
-
- <!-- <div class="alamrCountLabel" ms-if="self.alarmCount>0">{{self.alarmCount}}</div> -->
- <div class="alamrCountLabel label">{{self.alarmCount}}</div>
-
-
- </div>
- <div class="col-xs-7 rightContent">
-
- <!-- <div class="row rightRow">
- <i class="fa fa-warning"></i> 个VNF
- </div> -->
-
- <div class="row rightRow"><span id="com_zte_umc_monitor_moc" name_i18n="com_zte_umc_monitor"></span>:{{self.moc_name}}</div>
- <div class="row rightRow" ms-if="self.rendertype!='vdu' && self.rendertype!='host'"><span id="com_zte_umc_monitor_provider" name_i18n="com_zte_umc_monitor"></span>:{{self.vendor}}</div>
-
- <div class="row rightRow" ms-if="self.rendertype=='vnf'">
- <span id="com_zte_umc_monitor_vnfm_blongs_to" name_i18n="com_zte_umc_monitor"></span>: {{self.vnfm_name}}
- </div>
-
- <!-- <div class="row rightRow">
- 归属于:<a href="#">A管理系统</a>
- </div> -->
-
- <div class="row rightRow" ms-if="self.rendertype=='ns' || self.rendertype=='vnf'">
- <label><span id="com_zte_umc_monitor_status" name_i18n="com_zte_umc_monitor"></span>:<div class="activateLabel">{{self.status}}</div></label>
- </div>
-
- <div class="row rightRow" ms-if="self.rendertype=='vdu' || self.rendertype=='host'">
- <span id="com_zte_umc_monitor_ip_address" name_i18n="com_zte_umc_monitor"></span>: {{self.ip_addresses}}
- </div>
-
- <div class="row rightRow" ms-if="self.rendertype=='vdu'">
- <label><span id="com_zte_umc_monitor_vim_blongs_to" name_i18n="com_zte_umc_monitor"></span>: {{self.vim_name}}</label>
- </div>
-
- </div>
- </div>
- </div>
- </div>
- </div>
-
- </div>
- <div class="container-fluid" id="arrowSun">
- <div class="arrow" >
- <img src="images/arrow.png">
- </div>
- </div>
- <!-- <div class = "separator-line" ></div> -->
- <!-- <div class="row-fluid suns">
- <div ms-visible="sunVisable" class="col-xs-12">
- <a href="#" ms-click="clickSunDisplayGraphAlink()">
- <div class="containSun">包含</div>
- </a>
- </div>
- </div> -->
- <div class="row-fluid suns container-fluid" id="contianAreaSun">
-
- <!-- <a href="#"> -->
- <div class="contain" ms-click="clickSunDisplayGraphAlink()"><span id="com_zte_umc_monitor_contains" name_i18n="com_zte_umc_monitor"></span></div>
- <!-- <div class = "separator-line seperateLine" ></div> -->
- <!-- </a> -->
-
- </div>
- <!-- <div class="sunWrapper" ms-visible="sunVisable" ms-repeat-el="sun"> -->
- <div class="sunWrapper container-fluid">
- <!-- <div ms-repeat-el="sun"> -->
- <div ms-repeat-el="sun" data-repeat-rendered="childrenRended">
- <div class = "separator-line" ms-if="$index>0"></div>
- <div class="sunRow">
- <div class="col-xs-6 col-sm-6 col-md-4 col-lg-4 boxPadding " ms-repeat-elem="el.array">
- <!-- <a href="#">
- <div class="removeflot"></div>
- <div class="box " ms-class="box{{$index+1}}" ms-click="queryTabClicked(elem ,this)">
- <div class="namediv">
- <div class="nam">{{elem.name}}</div>
- <div class="num" ms-if="elem.type=='current'">{{elem.alarmCount}}</div>
- <div class="queryLink" ms-if="elem.type!='current'">详情</div>
- </div>
- </div>
- </a> -->
- <div class="nodeWrapper">
- <div class="removeflot"></div>
- <div class="vnfBox">
- <div class="row titleArea" ms-click="nodeClicked(elem ,this)">
- <div class="col-xs-3 portletIcon">{{elem.rendertype}}</div>
- <div class="col-xs-9 portletLabel">{{elem.name}}</div>
- </div>
- <div class="row boxMainArea" ms-click="boxDetailClicked(elem ,this)">
- <div class="col-xs-5 icon-alarm">
-
-
- <div class="ict-process" style="font-size: 60px;color: #7AB4E5;text-align: center ;margin-bottom:10px;"></div>
-
-
- <!-- <div class="alamrCountLabel" ms-if="elem.alarmCount>0">{{elem.alarmCount}}</div> -->
-
- <div class="alamrCountLabel label ">{{elem.alarmCount}}</div>
-
- </div>
- <div class="col-xs-7 rightContent">
-
- <!-- <div class="row rightRow">
- <i class="fa fa-warning"></i> 个VNF
- </div> -->
-
- <div class="row rightRow"><span id="com_zte_umc_monitor_moc" name_i18n="com_zte_umc_monitor"></span>:{{elem.moc_name}}
- </div>
- <div class="row rightRow" ms-if="elem.rendertype!='vdu' && elem.rendertype!='host'"><span id="com_zte_umc_monitor_provider" name_i18n="com_zte_umc_monitor"></span>:{{elem.vendor}}</div>
- <!-- <div class="row rightRow">
- Name: detail
- </div> -->
- <div class="row rightRow" ms-if="elem.rendertype=='vnf'">
- <span id="com_zte_umc_monitor_vnfm_blongs_to" name_i18n="com_zte_umc_monitor"></span>: {{elem.vnfm_name}}
- </div>
-
- <div class="row rightRow" ms-if="elem.rendertype=='ns' || elem.rendertype=='vnf'">
- <label><span id="com_zte_umc_monitor_status" name_i18n="com_zte_umc_monitor"></span>:<div class="activateLabel">{{elem.status}}</div></label>
- </div>
- <!-- <div class="alamrCountLabel">5</div> -->
- <div class="row rightRow" ms-if="elem.rendertype=='vdu' || elem.rendertype=='host'">
- <span id="com_zte_umc_monitor_ip_address" name_i18n="com_zte_umc_monitor"></span>: {{elem.ip_addresses}}
- </div>
- <div class="row rightRow" ms-if="elem.rendertype=='vdu'">
- <label><span id="com_zte_umc_monitor_vim_blongs_to" name_i18n="com_zte_umc_monitor"></span>: {{elem.vim_name}}</label>
- </div>
-
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- <div class = "separator-line" ></div> -->
- </div>
- <!-- </div> -->
- </div>
- </div>
- <div class="col-xs-3 col-md-3 col-sm-3 col-lg-3">
- <div class="col-xs-12 fixed_side">
- <ul class="nav nav-tabs" role="tablist">
- <!-- <li role="presentation" class="active"><a href="#basicInfo" aria-controls="home" role="tab" data-toggle="tab">{{selfdetail.name}}</a></li> -->
- <!-- <li role="presentation"><a href="#monitorInfo" aria-controls="profile" role="tab" data-toggle="tab">监控信息</a></li> -->
- </ul>
- <div class="tab-content">
- <div role="tabpanel" class="tab-pane active" id="basicInfo">
- <!-- <div class="detailTittle">网络监控服务</div> -->
- <!-- <div class="detailTittle">{{selfdetail.name}}</div> -->
- <div class="detailTittle">{{detailTitle}}</div>
- <table class="table table-striped table-bordered table-hover" cellpadding="0" cellspacing="0" border="0"id="basic_info">
- <thead>
- <th role="row" class="heading"><span id="com_zte_umc_monitor_detail_info" name_i18n="com_zte_umc_monitor"></span></th>
- <th role="row" class="heading"></th>
- </thead>
- <tbody>
- <tr ms-repeat-elem="selfDetail">
- <td>{{elem.name}}</td><td>{{elem.value}}</td>
- <tr>
- </tbody>
- </table>
- <!-- <div>
- <a href="#" class="monitorJumpLabel">
- <span id="com_zte_umc_monitor_information_tip" name_i18n="com_zte_umc_monitor"></span>
- </a>
- </div> -->
- </div>
- <!-- <div role="tabpanel" class="tab-pane" id="monitorInfo">
- <div class="detailTittle">&nbsp;</div>
- <table class="table table-striped table-bordered table-hover" cellpadding="0" cellspacing="0" border="0"id="monitor_info">
- <thead>
- <th role="row" class="heading">监控信息</th>
- <th role="row" class="heading"></th>
- </thead>
- <tbody>
- <tr>
- <td>状态:</td><td>{{selfdetail.status}}</td>
- </tr>
- <tr>
- <td>告警统计:</td><td>55</td>
- </tr>
- </tbody>
- </table>
- <div>
- <a href="#">
- <div class="box">
- <div class="fmPmJumpLabel">告警性能统计</div>
- </div>
- </a>
- </div>
- </div> -->
- </div>
- </div>
- </div>
- </div>
- </div>
-
- </div>
- <div role="tabpanel" class="tab-pane" id="fmpm" style="overflow-x:hidden;margin-left:25px;">
- <div class="row">
- <div class="col-md-6 ms-controller" ms-controller="monitorHeadLeftController">
- <div class="row itm-monitor-top-panel-content-left">
- <div class="col-md-4 itm-monitor-top-panel-content" id="ItDeviceSvg"></div>
- <div class="col-md-8 itm-monitor-top-panel-content" id="ItDeviceInfo">
- <ul>
- <li><span name_i18n="com_zte_ums_ngict_itm" id="com_zte_ums_ngict_itm_device_ipaddress">IP地址</span>: 10.74.44.8</li>
- <li><span name_i18n="com_zte_ums_ngict_itm" id="com_zte_ums_ngict_itm_device_name">主机名</span>: NFVServer</li>
- <li><span name_i18n="com_zte_ums_ngict_itm" id="com_zte_ums_ngict_itm_device_port">端口号</span>: 21180</li>
- <li><span name_i18n="com_zte_ums_ngict_itm" id="com_zte_ums_ngict_itm_device_control_date">使用日期</span>: 2015.09</li>
- </ul>
- </div>
- </div>
- </div>
- <div class="col-md-6 ms-controller" ms-controller="monitorHeadRightController">
- <div class="row itm-monitor-top-panel-content-right">
- <div class="col-md-12 itm-monitor-top-panel-content">
- <div class="row itm-monitor-top-panel-content-right-head">
- <div class="col-md-2 headText"><span name_i18n="com_zte_ums_ngict_itm" id="com_zte_ums_ngict_itm_device_alarm">告警:</span></div>
- <div class="col-md-10 headImgs">
- <div class="row">
- <div class="col-md-3">
- <div class="row">
- <div class="col-xs-6" style="color:#E82222;">严重</div>
- <div class="col-xs-6 headImg a1 text-center" name_i18n="com_zte_ums_ngict_itm" title="com_zte_ums_ngict_itm_device_alarm_critical">1</div>
- </div>
- </div>
- <div class="col-md-3">
- <div class="row">
- <div class="col-xs-6" style="color:#FF7F0E;">主要</div>
- <div class="col-xs-6 headImg a2 text-center" name_i18n="com_zte_ums_ngict_itm" title="com_zte_ums_ngict_itm_device_alarm_major">3</div>
- </div>
- </div>
- <div class="col-md-3">
- <div class="row">
- <div class="col-xs-6" style="color:#FAD592;">次要</div>
- <div class="col-xs-6 headImg a3 text-center" name_i18n="com_zte_ums_ngict_itm" title="com_zte_ums_ngict_itm_device_alarm_minor">0</div>
- </div>
- </div>
- <div class="col-md-3">
- <div class="row">
- <div class="col-xs-6" style="color:#43B8F5;">警告</div>
- <div class="col-xs-6 headImg a4 text-center" name_i18n="com_zte_ums_ngict_itm" title="com_zte_ums_ngict_itm_device_alarm_warning">13</div>
- </div>
- </div>
- <!-- <div class="col-md-2 headImg a2 text-center" name_i18n="com_zte_ums_ngict_itm" title="com_zte_ums_ngict_itm_device_alarm_major">3</div>
- <div class="col-md-2 headImg a3 text-center" name_i18n="com_zte_ums_ngict_itm" title="com_zte_ums_ngict_itm_device_alarm_minor">0</div>
- <div class="col-md-2 headImg a4 text-center" name_i18n="com_zte_ums_ngict_itm" title="com_zte_ums_ngict_itm_device_alarm_warning">24</div> -->
- </div>
- </div>
- </div>
- <div class="row itm-monitor-top-panel-content-right-body">
- <div class="col-md-4 bodyblock">
- <div class="row devicePMbody text-center">
- <div class="row">
- <div class="col-md-12 DeviceDetailTitle">处理器</div>
- </div>
- <div class="row">
- <div class="col-md-12 DeviceDetail">2C Quard Core</div>
- </div>
- </div>
- </div>
- <div class="col-md-4 bodyblock">
- <div class="row devicePMbody text-center">
- <div class="row">
- <div class="col-md-12 DeviceDetailTitle">安装内存</div>
- </div>
- <div class="row">
- <div class="col-md-12 DeviceDetail">12.0 GB</div>
- </div>
- </div>
- </div>
- <div class="col-md-4 bodyblockLast">
- <div class="row devicePMbody text-center">
- <div class="row">
- <div class="col-md-12 DeviceDetailTitle">磁盘空间</div>
- </div>
- <div class="row">
- <div class="col-md-12 DeviceDetail">500 GB</div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="col-md-10">
- <button ms-repeat-el="metric" name_i18n="com_zte_ums_ngict_itm" ms-attr-id="el" type="button" class="btn itmBtnGroup" style="margin-right: 10px;" ms-class-selected="$index==currentSelected" ms-click="clickSelectedCommonCond($index)">最近一小时</button>
- <button ms-repeat-el="metric" name_i18n="com_zte_ums_ngict_itm" ms-attr-id="el" type="button" class="btn itmBtnGroup" style="margin-right: 10px;" ms-class-selected="$index==currentSelected" ms-click="clickSelectedCommonCond($index)">最近六小时</button>
- <button ms-repeat-el="metric" name_i18n="com_zte_ums_ngict_itm" ms-attr-id="el" type="button" class="btn itmBtnGroup" style="margin-right: 10px;" ms-class-selected="$index==currentSelected" ms-click="clickSelectedCommonCond($index)">最近十二小时</button>
- </div>
- </div>
- <div class="row">
- <div id="cpuUsage" class="monitorChart"></div>
- <div id="memUsage" class="monitorChart"></div>
- </div>
- <div class="row">
- <div id="networkFlow" class="monitorChart"></div>
- <div id="diskUsage" class="monitorChart"></div>
- </div>
- </div>
- </div>
- <script type="text/javascript" src="js/d3.js"></script>
- <script type="text/javascript" src="../component/thirdparty/jquery/jquery-1.10.2.min.js"></script>
- <script type="text/javascript" src="../vendor/icheck/icheck.min.js"></script>
- <script type="text/javascript" src="../component/thirdparty/jquery.i18n/jquery.i18n.properties-1.0.9.js"></script>
- <script type="text/javascript" src="../component/thirdparty/data-tables/jquery.dataTables.min.js"></script>
- <script type="text/javascript" src="../component/thirdparty/bootbox/bootbox.min.js"></script>
- <script type="text/javascript" src="../component/thirdparty/bootstrap/js/bootstrap.min.js"></script>
- <script type="text/javascript" src="../component/thirdparty/jquery-validation/js/jquery.validate.js"></script>
- <script type="text/javascript" src="../component/thirdparty/jquery-validation/js/additional-methods.min.js"></script>
- <script type="text/javascript" src="../vendor/bootstrap-wizard/jquery.bootstrap.wizard.min.js"></script>
- <script type="text/javascript" src="../component/thirdparty/uniform/jquery.uniform.min.js"></script>
- <script type="text/javascript" src="../vendor/zTree/js/jquery.ztree.all.js"></script>
- <script type="text/javascript" src="../framework/js/security/aes.js"></script>
- <script type="text/javascript" src="../framework/js/security/framework-util.js"></script>
- <script type="text/javascript" src="js/echarts-all.js"></script>
- <script type="text/javascript" src="../framework/js/json2.js"></script>
- <script type="text/javascript" src="js/avalon.modern.js"></script>
- <script type="text/javascript" src="../framework/js/tools.js"></script>
- <script>
- var lang = getLanguage();
- jQuery.i18n.properties({
- language:lang,
- name:'ngict-umc-monitor-i18n',
- path:'i18n/',
- mode:'map',
- callback: function() {
- setTimeout(function(){
- var i18nItems = $("span[name_i18n=com_zte_umc_monitor]");
- for(var i=0;i<i18nItems.length;i++){
- var $item = $(i18nItems.eq(i));
- var itemId = $item.attr('id');
- if(typeof($item.attr("title"))!="undefined"){
- $item.attr("title", $.i18n.prop(itemId));
- }else{
- $item.text($.i18n.prop(itemId));
- }
- }
- }, 200);
- }
- });
- </script>
- <script type="text/javascript" src="js/vnfController.js"></script>
- <script type="text/javascript" src="js/Constants.js"></script>
- <script type="text/javascript" src="js/monitorHeadChart.js"></script>
- <script type="text/javascript" src="js/monitors.js"></script> <script type="text/javascript">
- $(function(){
- monitorHeadChartDraw("itm.server.suse");
- });
-</script>
-
-</body>
-</html> \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/css/alarmsQuery.css b/umc-iui/src/main/resources/webroot/umc-fm/css/alarmsQuery.css
deleted file mode 100644
index a074fdca..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/css/alarmsQuery.css
+++ /dev/null
@@ -1,735 +0,0 @@
-body {
- overflow: auto !important;
- /*overflow-y: auto !important;
- overflow-x: auto !important;*/
- background-color: #fff;
-}
-
-.container-fluid{
- background-color: #fff;
-}
-
-.page-content-body {
- margin-top: 10px;
-}
-.page-content-body .row{
- margin-left:0;
-}
-#ict_fm_alarmCount_div_left{
- margin-bottom:10px;
-}
-.page-content-body .separator-line{
- height:1px;
- border-bottom:1px dashed #ccc;
- background:transparent;
-}
-.circleBtn:first-child {
- border-top-left-radius: 3px !important;
- border-bottom-left-radius: 3px !important;
-}
-
-.circleBtn:last-child {
-
- border-top-right-radius: 3px !important;
- border-bottom-right-radius: 3px !important;
-}
-
-.sideBtn:first-child {
- border-top-left-radius: 20px !important;
- border-bottom-left-radius: 20px !important;
- min-width: 50px;
-}
-
-.sideBtn:last-child {
- border-top-right-radius: 20px !important;
- border-bottom-right-radius: 20px !important;
- min-width: 50px;
-}
-
-.btnRiusCircle {
- border-radius: 20px !important;
-}
-
-button:last-child {
- margin-left: 15px;
-}
-.btn-groupBlue {
- padding-left: 20px;
-}
-
-.btn-groupBlue .btn:hover {
- color: #333;
- background-color: #ebebeb ;
-
-}
-.btnWhite {
- font-size: 14px;
- font-family: "微软雅黑";
- line-height: 20px;
- /*background-image: linear-gradient(to bottom, #ffffff, #ffffff);*/
- background-color: #ffffff;
-
- border: 1px solid #cccccc;
-}
-.btnWhite:hover{
-background-color:#ebebeb;
-color:#333;
-}
-.btn_group1 .btn:hover {
- color: #ffffff;
- background-color:#ebebeb;
- background-position: 0 0px;
- -webkit-transition: background-position 0.1s linear;
- -moz-transition: background-position 0.1s linear;
- -o-transition: background-position 0.1s linear;
- transition: background-position 0.1s linear;
-}
-
-.blueactive {
- color: #ffffff !important;
- background-color: #5b9bd1;
-}
-
-.blueactive:hover {
- color: #ffffff !important;
- background-color: #4d85b4 !important;
-}
-
-.cond_zone {
- background-color: #fff;
- padding-left: 20px;
- padding-right: 50px;
-}
-
-.cond_zone_time {
- background-color: #fff;
- margin-top: 20px;
- margin-bottom: 10px;
-}
-
-.condSelect {
- /* width: 100%; */
- border: 1px solid #CCC;
- height: 34px !important;
-}
-
-.cond_selected{
- padding-left: 10px;
-}
-
-button.btn.btn-default {
- color: #aaa;
-}
-
-.filtergroup button.btn {
- min-width: 68px;
-}
-.adCondition button.btn {
- min-width: 80px;
-}
-.btn-default {
- color: #5b9bd1;
- background-color: #fff;
- border-color: #ccc;
-}
-
-.daySelect {
- width: 42px;
- height: 26px !important;
- font-size: 14px;
- margin-bottom: 0px;
- border-width: 1px;
- padding: 0px 0px;
- border-radius: 4px;
-}
-
-.calendar-date {
- color: #5b9bd1;
-}
-
-.daterangepicker .ranges {
- width: 205px;
-}
-
-.daterangepicker .ranges input {
- width: 95px !important;
-}
-
-/* .daterangepicker {
- left: 20% !important;
-} */
-.daterangepicker .ranges input[type="text"] {
- width: 85px !important;
-}
-
-.dataRange {
- width: 195px;
- line-height: 0;
- height: 26px;
- vertical-align: top;
- margin-left: 5px;
- padding: 0px 0px;
-}
-
-div.dataTables_paginate {
- display: inline;
- float: right !important;
-}
-
-div.dataTables_length, div.dataTables_info {
- display: inline;
-}
-
-div.pagination-panel {
- margin-right: 10px;
-}
-
-input.pagination-panel-input {
- width: 50px;
-}
-
-.input-sm {
- padding: 4px 10px;
-}
-
-td.details-control {
- text-align: center;
- cursor: pointer;
-}
-
-
-.details table td {
- word-wrap: break-word;
- word-break: normal;
- border-top: 1px solid #dddddd;
-}
-
-td.title {
- width: 10%;
-}
-
-.detailTitleStyle{
- background-color: #EEE !important;
-}
-
-.close-statistic{
- float:right;
- margin-top:5px;
- margin-right:25px;
- vertical-align:bottom;
- padding:3px;
- border:2px solid #fff ;
- border-radius:20px;
- color:#9b9b9b;
-}
-.close-statistic:hover{
-border:2px solid #e74c3c ;
-color:#e74c3c;
-text-decoration:none;
-}
-.detailCellStyle{
- background-color: #FFF !important;
-}
-
-table.dataTable tbody th, table.dataTable tbody td {
- padding: 8px 10px;
- vertical-align:middle;
-}
-
-.echart_height{
- height: 400px;
-}
-
-
-
-button.serveractive {
- color: #ffffff !important;
- background-position: 0 0px;
- -webkit-transition: background-position 0.1s linear;
- -moz-transition: background-position 0.1s linear;
- -o-transition: background-position 0.1s linear;
- transition: background-position 0.1s linear;
- background-image: linear-gradient(to bottom, #E6971A, #E6971A) !important;
-}
-
-.rule_title {
- padding: 8px;
- margin-bottom: 25px;
- border-left: 2px solid #5b9bd1;
- color: #1A78CA;
- font-size: 16px;
-}
-
-.iconPosition > div {
- margin: 20px 0px 0px 0px;
-}
-.iconPosition{
- margin-top: 90px;
-}
-.iconPosition div {
- color: #757575;
- cursor: pointer;
-}
-
-.iconPosition div:hover {
- color: #333;
-}
-
-#defaulInfo, #selectAralmCodes {
- border: 1px solid #e0e0e0;
-}
-
-.right_assign_box {
- height: 370px;
- overflow-y: auto;
- overflow-x: auto;
- border: 1px solid #e0e0e0;
-}
-
-.right-assign-checked-box{
- /*height: 312px;*/
- height: 370px;
- overflow-y: auto;
- overflow-x: auto;
- border: 1px solid #e0e0e0;
-}
-
-.fmZtree {
- z-index: 3000;
- position: absolute;
- background: #fff;
- outline: none;
-}
-
-.filtergroup {
- text-align: center;
- margin-top: 15px;
-}
-
-.fliterline {
- margin-top: 20px;
- height:1px;
- border-bottom:1px dashed #c4cde8;
- margin-bottom:15px;
- overflow:hidden;
- width:100%;
-}
-
-.adCondition {
- float: right;
-}
-
-.btn .caret {
- margin-right: 5px;
-}
-
-.tablebtn {
- float: right;
-}
-
-#ict_alarms_table_div {
- padding-right: 0;
- margin-top: 10px;
-}
-
-div.alarmsTree {
- width: 580px;
-}
-
-div.alarmsTree-small{
- width: 280px;
-}
-.alarm-serious {
- background-color: #de4040;
- color: #ffffff !important;
-}
-.alarm-serious:hover {
- background-color: #c23737 !important;
-}
-.alarm-important {
- background-color: #e37c29;
- color: #ffffff !important;
-}
-.alarm-important:hover {
- background-color: #c86e25 !important;
-}
-.alarm-secondary {
- background-color: #e9d426;
- color: #ffffff !important;
-}
-.alarm-secondary:hover {
- background-color: #d3c023 !important;
-}
-.alarm-slightly {
- background-color: #86bcdb;
- color: #ffffff !important;
-}
-.alarm-slightly:hover {
- background-color: #77a7c2 !important;
-}
-.flRight {
- float: right;
- margin-right: 1px;
-}
-
-/* #alLocation {
- margin-top: 40px;
-} */
-
-.borderBottom {
- border-bottom: 4px solid !important;
- border-top: 0px solid !important;
-}
-
-.borderTop {
- border-top: 4px solid !important;
- border-bottom: 0px solid !important;
-}
-
-.spinnerSmall {
- width: 34px !important;
- margin-right: 24px;
-}
-
-.icheckbox_square-aero{
- margin-right: 5px;
-}
-.alarmsSave {
- font-size: 16px;
- color: #555;
- vertical-align: middle;
- cursor: pointer;
-}
-
-.alarmsSave:hover {
- color: #5b9bd1;
-}
-.margin-space{
- margin-bottom: 15px;
- margin-top: 5px;
-}
-
-.defaultHideTopLink{
- display: none;
- position: absolute;
- display: none;
- background: #000;
- opacity: 0.8;
- border: 1px solid #ddd !important;
- font-size: 0.8em;
- box-shadow: 2px 3px 5px #C8C8C8;
- border-radius: 8px;
- padding: 0px 10px;
- z-index: 999;
- height: 30px;
- color: #fff;
- line-height: 25px;
-}
-
-.defaultHideTopLink:after {
- position: absolute;
- top: -6px;
- left: 10px;
- display: inline-block;
- border-right: 6px solid transparent;
- border-bottom: 6px solid #000;
- border-left: 6px solid transparent;
- content: '';
-}
-
-.tooltip-inner {
- max-width: 300px !important;
-}
-
-.calendar-time select {
- color: #555 !important;
-}
-
-#affirmTrip{
- margin-top: 3%;
- margin-left: 1%;
-}
-
-
-#unAffirmTrip{
- margin-top: 3%;
- margin-left: 4%;
-}
-
-#alLocationTree,#alCodeTree,#alTypeTree{
- border: 1px solid rgba(0,0,0,.2);
- margin-top: 5px;
- background-clip: padding-box;
- border-radius: 6px;
- outline: 0;
- margin-left: -5px;
- box-shadow: 0 5px 15px rgba(0,0,0,.5);
-}
-
-#right-menu {
- position: fixed;
- top: 0;
- right: 0;
- width: 400px;
- height: 100%;
- border-left: 4px solid rgb(58,174,218);
- background-color: rgba(255,255,255,.95);
- padding-left: 19px;
- padding-right: 13px;
- padding-top: 20px;
- z-index: 9999;
- overflow-y: auto;
-}
-
-.btn-right-detail {
- color: #5b9bd1;
- background-color: #fff;
- border-color: #ccc;
-}
-
-
-.right {
- float: right;
-}
-
-
-.default-display-none{
- display: none;
-}
-
-.nodesDetail {
- margin-top: 15px;
-}
-
-#ict_table_general_div td{
- min-width: 115px;
-}
-
-
-#moreCond label{
- margin-bottom: 0px;
-}
-
-.alarm-date-form-control{
- padding: 0px 4px;
-}
-
-.titlefont {
- font-size: 16px;
-}
-
-.subtitlefont {
- font-size: 14px;
-}
-
-
-.ackState a:hover{
- color: #fff;
- text-decoration:none;
-}
-
-
-.label-danger:hover{
- background-color: #C9302C;
-}
-
-.right-button-pointer {
- display: inline-block;
- cursor: pointer;
-}
-
-.tree-right-table td{
- white-space: nowrap;
- cursor: pointer;
-}
-
-.tree-right-table td:hover{
- background: #FFEDE4;
- border-bottom: 1px solid #f8dddd;
- border-top: 1px solid #f8dddd;
-}
-
-.tallCellSelected{
- background: #f8dddd;
- border-bottom: 1px solid #f8dddd;
- border-top: 1px solid #f8dddd;
-}
-
-.tallCellSelected:hover{
- background: #f8dddd !important;
-}
-
-
-.margin-top-space{
- margin-top: 15px;
-}
-
-
-.tree-left-table td{
- white-space: nowrap;
- cursor: pointer;
-}
-
-.tree-left-table td:hover{
- background: #FFEDE4;
- border-bottom: 1px solid #f8dddd;
- border-top: 1px solid #f8dddd;
-}
-
-#saveModalCancle{
- color:#333;
-}
-
-.radioLabel{
- margin-left: -10px;
- margin-right: 10px;
-}
-
-.alarmbtn, #ict_alarms_table_div{
-padding-left:0;
-}
-
-.advanced-selection{
- margin-top:40px;
-}
-
-#moreCond{
- border: 1px dashed rgb(196, 205, 232);
- margin-top: 10px;
- margin-bottom: 10px;
- margin-left: 0px;
- margin-right: 0px;
- padding-left: 15px;
- padding-right: 15px;
-}
-
-.bodyTop{
- margin-top: 10px;
-}
-
-.confirmTime{
- margin-left: 5px;
-}
-
-.condSaveTip{
- margin-top: 15px;
-}
-
-/*修改树组件默认样式*/
-.ztree li a {
- border: 0px;
-}
-
-.ict-Magnifier:hover{
- color:#555555
-}
-
-.ict-save:hover{
- color:#555555
-}
-
-.dataTables_scrollHeadInner table.dataTable tbody td {
- padding-top: 0px !important;
- padding-bottom: 0px !important;
-}
-
-.dataTables_scrollHeadInner table.dataTable {
- margin-bottom: 0px !important;
- border-bottom: 0px !important;
-}
-
-.dataTables_scrollBody table {
- border-top: 0px !important;
- border-bottom: 1px solid #ddd !important;
- /* margin-top: -5px; */
-}
-
-.dataTables_scrollBody {
- margin-top: -2px;
-}
-
-#ict_alarms_table_wrapper .bottom{
- margin-top: 10px;
-}
-
-table .DataTables_sort_wrapper {
- padding-left: 2px !important;
-}
-
-.detailTable {
- border-collapse:collapse;border-spacing:0;border-left:1px solid #888;border-top:1px solid #888;
-}
-
-.detailTable td{border:1px solid #ddd !important;}
-
-.detailTitleStyle .label{
- color:#333333;
- background-color: rgba(66, 139, 202, 0);
- float:right;
-}
-
-.label{
- font-size: 100%;
- font-weight: 100;
-}
-
-input[name="daterange"] {
- width: 220px;
- line-height: 0;
- height: 31px;
- /* vertical-align: top; */
- margin-top: 2px;
-}
-.acknow-purple{
-background-color:#bf74d5;
-color:#fff;
-}
-.acknow-purple:hover{
-background-color:#b36bc8;
-}
-.ict-table{
- color:#549bb6;
-}
-.dataTables_length select[size]{
- height:28px;
-}
-/*1024下展开左边菜单*/
-@media screen and (max-width: 770px) and (min-width: 750px) {
- .btn-groupBlue {
- padding-left: 5px;
- }
-}
-
-/*1024下,左边菜单收起来*/
-
-@media screen and (max-width: 1000px) and (min-width: 810px) {
- .tree-padd {
- padding-left: 7%;
- }
-
- .daterange-cond-padd {
- padding-left: 10%;
- }
-}
-
-@media screen and (max-width: 1100px) and (min-width: 1000px) {
-
- .tree-padd {
- padding-left: 10%;
- }
-
- .tree-daterange-cond-padd {
- padding-left: 10%;
- }
-}
-
-@media screen and (min-width: 1100px) {
- .tree-padd {
- padding-left: 12%;
- }
-
- .daterange-cond-padd {
- padding-left: 10%;
- }
-}
-
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/css/delete.me b/umc-iui/src/main/resources/webroot/umc-fm/css/delete.me
deleted file mode 100644
index e69de29b..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/css/delete.me
+++ /dev/null
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/html/fm_currentAlarm_view.html b/umc-iui/src/main/resources/webroot/umc-fm/html/fm_currentAlarm_view.html
deleted file mode 100644
index ec78557a..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/html/fm_currentAlarm_view.html
+++ /dev/null
@@ -1,364 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head lang="en">
- <meta charset="UTF-8">
- <link href="../../component/thirdparty/font-awesome/css/font-awesome.min.css" rel="stylesheet" id="font_awesome"/>
- <link href="../../component/thirdparty/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
- <link href="../../component/thirdparty/uniform/css/uniform.default.css" rel="stylesheet"/>
- <link href="../../framework/css/plugins.css" rel="stylesheet" type="text/css">
- <link href="../../component/css/ZteIctIcons/style.css" rel="stylesheet" type="text/css"/>
- <link href="../../vendor/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css" rel="stylesheet">
- <link href="../../vendor/icheck/skins/all.css" type="text/css" rel="stylesheet">
- <link href="../../framework/css/ngict-component.css" rel="stylesheet" type="text/css">
- <link href="../../vendor/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet">
- <link href="../css/alarmsQuery.css" rel="stylesheet" type="text/css">
- <style>
- .ms-controller{
- visibility: hidden
- }
- </style>
- </head>
-<body>
-<div id="alarmsDiv" class="container-fluid ms-controller" ms-controller="curAlarmsController">
- <div class="row" style=" margin-top: 15px;">
- <div class="col-xs-6 col-md-6 col-sm-6 col-lg-6 titlefont searchTitle">
- <span id="ngict_fm_iui_curalarm_currentAlarm" name_i18n="ngict_fm_iui_curalarm"></span>
- </div>
- </div>
- <div class="separator-line"></div>
- <div class="row-fluid filtergroup">
- <div>
- <div class="btn-group">
- <button class="btn btnWhite circleBtn" ms-repeat-el="severityTypes"
- ms-class="<!--el.class-->:severityTypes[$index].value" ms-click="tabClicked(el ,this)">
- <!--el.name--></button>
- </div>
-
- <div class="btn-group btn-groupBlue ">
- <button class="btn btnWhite circleBtn" ms-repeat-el="ackStateTypes" ms-class-blueActive="el.value"
- ms-click="tabClicked(el ,this)"><!--el.name--></button>
- </div>
- <div class="btn-group btn-groupBlue circleBtn ">
- <button class="btn btnWhite circleBtn" ms-repeat-el="filterStateTypes" ms-class-blueActive="el.value"
- ms-click="tabClicked(el ,this)"><!--el.name--></button>
- </div>
- <div class="btn-group flRight">
- <span class=" adCondition">
- <button id="moreCondBtn" type="button" class="btn radius_l white "
- ms-click="moreCondClicked()" ms-class-blueActive="vm.moreCondBtn"
- ><span class="caret"></span><span id="ngict_fm_iui_curalarm_advance" name_i18n="ngict_fm_iui_curalarm"></span>
- </button>
- </span>
- </div>
- </div>
- </div>
- <div class="row" id="moreCond" style="display: none;">
- <div class="row" style="margin-top: 20px;">
- <span id="alLocation" class="cond_zone">
- <button class="condSelect btn white radius_l">
- <span id="ngict_fm_iui_curalarm_alarmPosition" name_i18n="ngict_fm_iui_curalarm"></span>
- </button>
- <span class="cond_selected">
- <span id="ngict_fm_iui_curalarm_locationSelected" name_i18n="ngict_fm_iui_curalarm"></span>
- </span>
- </span>
- <span id="alType" class="cond_zone">
- <button class="condSelect btn white radius_l">
- <span id="ngict_fm_iui_curalarm_alarmType" name_i18n="ngict_fm_iui_curalarm"></span>
- </button>
- <span class="cond_selected">
- <span id="ngict_fm_iui_curalarm_alarmTypeSelected" name_i18n="ngict_fm_iui_curalarm"></span>
- </span>
- </span>
- <span id="alCode" class="cond_zone">
- <button class="condSelect btn white radius_l">
- <span id="ngict_fm_iui_curalarm_probableCause" name_i18n="ngict_fm_iui_curalarm"></span>
- </button>
- <span class="cond_selected">
- <span id="ngict_fm_iui_curalarm_probableCauseSelected" name_i18n="ngict_fm_iui_curalarm"></span>
- </span>
- </span>
- </div>
- <div class="row cond_zone_time">
- <div class="col-xs-12 confirmTime">
- <label>
- <span id="ngict_fm_iui_curalarm_ackTimeTitle" name_i18n="ngict_fm_iui_curalarm"></span>&nbsp;&nbsp;
- </label>
- <input id="today_confirm" type = "radio" name="timeConfirm" cond_value="1" cond_id="time" class="btn blue"></input>
- <label for="today_confirm" class="radioLabel">
- <span id="ngict_fm_iui_curalarm_recentOneDay" name_i18n="ngict_fm_iui_curalarm"></span>
- </label>
- <input id="one_week_confirm" type = "radio" name="timeConfirm" cond_value="2" cond_id="time" class="btn blue"></input>
- <label for="one_week_confirm" class="radioLabel">
- <span id="ngict_fm_iui_curalarm_recenttwoDays" name_i18n="ngict_fm_iui_curalarm"></span>
- </label>
- <input id="one_month_confirm" type = "radio" name="timeConfirm" cond_value="7" cond_id="time" class="btn blue"></input>
- <label for="one_month_confirm" class="radioLabel">
- <span id="ngict_fm_iui_curalarm_recentOneWeek" name_i18n="ngict_fm_iui_curalarm"></span>
- </label>
- <input id="customAckTime" type = "radio" name="timeConfirm" class="btn blue"></input>
- <input dtitle="ackTime" id = 'daterangeConfirm' name="daterange" type='select' data-toggle="tooltip" data-placement="top" title ms-attr-disabled="<!--dataRangeLocationDisabled-->" class='btn btn-default dropdown-toggle' data-toggle='dropdown' />
- </div>
- </div>
-
- <div class="row cond_zone_time">
- <div class="col-xs-12 confirmTime">
- <label>
- <span id="ngict_fm_iui_curalarm_raisedTime" name_i18n="ngict_fm_iui_curalarm"></span>&nbsp;&nbsp;
- </label>
- <input id="today_occur" type = "radio" name="timeOccur" cond_value="1" cond_id="time" class="btn blue"></input>
- <label for="today_occur" class="radioLabel">
- <span id="ngict_fm_iui_curalarm_recentOneDay" name_i18n="ngict_fm_iui_curalarm"></span>
- </label>
- <input id="one_week_occur" type = "radio" name="timeOccur" cond_value="2" cond_id="time" class="btn blue"></input>
- <label for="one_week_occur" class="radioLabel">
- <span id="ngict_fm_iui_curalarm_recenttwoDays" name_i18n="ngict_fm_iui_curalarm"></span>
- </label>
- <input id="one_month_occur" type = "radio" name="timeOccur" cond_value="7" cond_id="time" class="btn blue"></input>
- <label for="one_month_occur" class="radioLabel">
- <span id="ngict_fm_iui_curalarm_recentOneWeek" name_i18n="ngict_fm_iui_curalarm"></span>
- </label>
- <input id="customRaisedTime" type = "radio" name="timeOccur" class="btn blue"></input>
- <input dtitle="raisedTime" id = 'daterangeOccur' name="daterange" type='select' data-toggle="tooltip" data-placement="top" title ms-attr-disabled="<!--dataRangeTypeDisabled-->" class='btn btn-default dropdown-toggle' data-toggle='dropdown' />
- </div>
- </div>
- <div class="row margin-space flRight">
- <button ms-click="searchModal()" class="btn white radius_l"><span class="ict-Magnifier alarmsSave "></span>
- <span id="ngict_fm_iui_curalarm_query" name_i18n="ngict_fm_iui_curalarm"></span>
- </button>&nbsp;&nbsp;
- <button ms-click="saveModal()" ms-visible="tempHide" class="btn white radius_l"><span class="ict-save alarmsSave "></span>
- <span id="ngict_fm_iui_curalarm_save" name_i18n="ngict_fm_iui_curalarm"></span>
- </button>
- </div>
- </div>
- <div class="fliterline"></div>
- <div class="row-fluid bodyTop">
- <div class="col-xs-4 alarmbtn">
- <div class="btn-group ">
- <button id="affirm" onclick="alarmsUtil.loopAffirm(1);" class="btn white sideBtn"
- ms-class="btnRiusCircle:!showClear"><span class="ict-acknownledge"></span></button>
- <button id="unAffirm" class="btn white sideBtn" ms-visible="showClear"
- onclick="alarmsUtil.loopAffirm(2);"
- ><span class="ict-unacknownledge"></span></button>
- </div>
- <button class="btn radius_l white" onclick="alarmsUtil.loopDelAralms();"><span
- class="ict-delete"></span>
- <span id="ngict_fm_iui_curalarm_clean" name_i18n="ngict_fm_iui_curalarm"></span>
- </button>
- </div>
- <div class="tablebtn">
- <button class="btn radius_l white" onclick="alarmsUtil.refresh();"><span class="ict-refresh"></span>
- <span id="ngict_fm_iui_curalarm_refreash" name_i18n="ngict_fm_iui_curalarm"></span>
- </button>
- <button class="btn radius_l white" ms-visible="tempHide"><span class="ict-export"></span>
- <span id="ngict_fm_iui_curalarm_exportAll" name_i18n="ngict_fm_iui_curalarm"></span>
- </button>
- </div>
- </div>
- <div class="row-fluid" data-name="table_zone">
- <div class="col-xs-12" id='ict_alarms_table_div'></div>
- </div>
- <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h4 class="modal-title" id="myModalLabel">
- <span id="ngict_fm_iui_curalarm_save" name_i18n="ngict_fm_iui_curalarm"></span>
- </h4>
- </div>
- <div class="modal-body">
- <span>
- <span id="ngict_fm_iui_curalarm_name" name_i18n="ngict_fm_iui_curalarm">
- </span>&nbsp;&nbsp;</span><input type="text" id="saveCondId"/>
- <div class="condSaveTip">
- <span id="ngict_fm_iui_curalarm_condSaveTip" name_i18n="ngict_fm_iui_curalarm"></span>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" id="saveModalCancle" data-dismiss="modal">
- <span id="ngict_fm_iui_curalarm_cancel" name_i18n="ngict_fm_iui_curalarm"></span>
- </button>
- <button type="button" class="btn btn-primary" ms-click="alarmsCondSave()">
- <span id="ngict_fm_iui_curalarm_ok" name_i18n="ngict_fm_iui_curalarm"></span>
- </button>
- </div>
- </div>
- </div>
- </div>
- <div hidefocus="true" class="modal fade group" id="alCodeTree" tabindex="-1" role="dialog" aria-labelledby="myModalLabelCode" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h4 class="modal-title" id="myModalLabelCode">
- <span id="ngict_fm_iui_curalarm_probableCause" name_i18n="ngict_fm_iui_curalarm"></span>
- </h4>
- </div>
- <div class="modal-body">
- <div class="row">
- <div class="form-group col-xs-12 margin-top-space">
- <div class="col-xs-6">
- <div class=" right_assign_box">
- <ul id="probableCausesTree" class="ztree"></ul>
- </div>
- </div>
- <div class="col-xs-1 iconPosition">
- <div ms-repeat-el="treeIcons">
- <i treeType="probableCausesTree" ms-class="<!--el-->" ms-click="moveTreeNode($(this))"></i>
- </div>
- </div>
- <div class="col-xs-5 ">
- <div tabindex="11" class="right-assign-checked-box tree-right-table">
- <table id="selectedProbableCausesTreeTable" class="table table-bordered">
- </table>
- </div>
- </div>
- <div class="col-xs-4 nodesDetail right">
- <button id="moreCondBtn" type="button" class="btn white blueactive right" ms-click="probableCausesTreeAffirm()">
- <span id="ngict_fm_iui_curalarm_ok" name_i18n="ngict_fm_iui_curalarm"></span>
- </button>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div hidefocus="true" class="modal fade group" id="alTypeTree" tabindex="-1" role="dialog" aria-labelledby="myModalLabelType" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h4 class="modal-title" id="myModalLabelType">
- <span id="ngict_fm_iui_curalarm_alarmType" name_i18n="ngict_fm_iui_curalarm"></span>
- </h4>
- </div>
- <div class="modal-body">
- <div class="row">
- <div class="form-group col-xs-12 margin-top-space">
- <div class="col-xs-12">
- <div class=" right-assign-checked-box">
- <table id="selectedAlTypeTable" class="table table-bordered tree-left-table">
- </table>
- </div>
- </div>
- <div class="col-xs-4 nodesDetail right"><button id="moreCondBtn" type="button" class="btn white blueactive right" ms-click="alTypeTreeAffirm()">
- <span id="ngict_fm_iui_curalarm_ok" name_i18n="ngict_fm_iui_curalarm"></span>
- </button>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div hidefocus="true" class="modal fade group" id="alLocationTree" tabindex="-1" role="dialog" aria-labelledby="myModalLabelLocation" aria-hidden="true">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h4 class="modal-title" id="myModalLabelLocation">
- <span id="ngict_fm_iui_curalarm_alarmPosition" name_i18n="ngict_fm_iui_curalarm"></span>
- </h4>
- </div>
- <div class="modal-body">
- <div class="row">
- <div class="form-group col-xs-12 margin-top-space">
- <div class="col-xs-6">
- <div class="right_assign_box">
- <ul id="deptTree" class="ztree"></ul>
- </div>
- </div>
- <div class="col-xs-1 iconPosition">
- <div ms-repeat-el="treeIcons">
- <i treeType="deptTree" ms-class="<!--el-->" ms-click="moveTreeNode($(this))"></i>
- </div>
- </div>
- <div class="col-xs-5">
- <div id="selectedDeptTree" tabindex="11" class="right-assign-checked-box tree-right-table">
- <table id="selectedDeptTreeTable" class="table table-bordered">
- </table>
- </div>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="form-group col-xs-12">
- <div class="col-xs-4 right">
- <button id="moreCondBtn" type="button" class="btn white blueactive right" ms-click="deptTreeAffirm()">
- <span id="ngict_fm_iui_curalarm_ok" name_i18n="ngict_fm_iui_curalarm"></span>
- </button>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div id="affirmTrip" class="defaultHideTopLink">
- <span id="ngict_fm_iui_curalarm_affirm" name_i18n="ngict_fm_iui_curalarm"></span>
- </div>
- <div id="unAffirmTrip" class="defaultHideTopLink">
- <span id="ngict_fm_iui_curalarm_unaffirm" name_i18n="ngict_fm_iui_curalarm"></span>
- </div>
-</div>
-<script src="../../component/thirdparty/jquery/jquery-1.10.2.min.js"></script>
-<script src="../../component/thirdparty/jquery-cokie/jquery.cokie.min.js" type="text/javascript" ></script>
-<script src="../../component/thirdparty/jquery.i18n/jquery.i18n.properties-1.0.9.js"></script>
-<script src="../../component/thirdparty/bootbox/bootbox.min.js" type="text/javascript"></script>
-<script src="../../component/thirdparty/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
-<script src="../../vendor/bootstrap-daterangepicker/moment.js"></script>
-<script src="../../component/thirdparty/data-tables/jquery.dataTables.js"></script>
-<script src="../../vendor/bootstrap-daterangepicker/daterangepicker.js"></script>
-<script src="../../framework/js/json2.js"></script>
-<script src="../../vendor/avalon/avalon.modern.js"></script>
-<script src="../../framework/js/tools.js"></script>
-<script src="../../vendor/icheck/icheck.min.js" type="text/javascript"></script>
-<script src="../../vendor/zTree/js/jquery.ztree.all.js"></script>
-<script>
- var lang = getLanguage();
- jQuery.i18n.properties({
- language: lang,
- name: 'ngict-curalarms-iui-i18n',
- path: '../i18n/',
- mode: 'map',
- callback: function () {
- var i18nItems = $("[name_i18n=ngict_fm_iui_curalarm]");
- for(var i=0;i<i18nItems.length;i++){
- var $item = $(i18nItems.eq(i));
- var itemId = $item.attr('id');
- if(typeof($item.attr("placeholder"))=="undefined"){
- $item.text($.i18n.prop(itemId));
- }else{
- $item.attr("placeholder", $.i18n.prop(itemId));
- }
- }
- $('#daterangeConfirm').attr('value',$.i18n.prop('ngict_fm_iui_curalarm_custom'));
- $('#daterangeOccur').attr('value',$.i18n.prop('ngict_fm_iui_curalarm_custom'));
- }
- });
- //获取QueryId
- var getUrlParam=function(name){
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
- var search =decodeURIComponent(location.search.substring(1)); //decodeURIComponent() 函数可对 encodeURIComponent() 函数编码的 URI 进行解码。
- var r =search.match(reg); //匹配目标参数
- if (r != null) return unescape(r[2]); //unescape() 函数可对通过 escape() 编码的字符串进行解码。
- return null; //返回参数值
- }
- $(function(){
- var queryName = getUrlParam("queryId");
- if(queryName){
- $(".searchTitle").text(queryName);
- $("#saveCondId").val(queryName);
- }
- $('[data-toggle="tooltip"]').tooltip();
- });
-</script>
-<script type="text/javascript" src="../js/alarmsServerPageTable.js"></script>
-<script type="text/javascript" src="../js/alarmsUtil.js"></script>
-<script type="text/javascript" src="../js/alarmConds.js"></script>
-<script type="text/javascript" src="../js/CommonUtil.js"></script>
-<script type="text/javascript" src="../js/curAlarmsController.js"></script>
-</body>
-</html> \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/i18n/delete.me b/umc-iui/src/main/resources/webroot/umc-fm/i18n/delete.me
deleted file mode 100644
index e69de29b..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/i18n/delete.me
+++ /dev/null
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/i18n/ngict-curalarms-iui-i18n-en-US.properties b/umc-iui/src/main/resources/webroot/umc-fm/i18n/ngict-curalarms-iui-i18n-en-US.properties
deleted file mode 100644
index 560aff3c..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/i18n/ngict-curalarms-iui-i18n-en-US.properties
+++ /dev/null
@@ -1,108 +0,0 @@
-//表格相关
-ngict-fm-iui-table-sLengthMenu=View _MENU_ records
-ngict-fm-iui-table-sZeroRecords=No matching records found
-ngict-fm-iui-table-sInfo= | Found total _TOTAL_ records
-ngict-fm-iui-table-sInfoEmpty=No records found to show
-ngict-fm-iui-table-sGroupActions=_TOTAL_ records selected:
-ngict-fm-iui-table-sAjaxRequestGeneralError=Could not complete request. Please check your internet connection.
-ngict-fm-iui-table-sEmptyTable=No data available in table
-ngict-fm-iui-table-sPrevious=Prev
-ngict-fm-iui-table-sNext=Next
-ngict-fm-iui-table-sPage=Page
-ngict-fm-iui-table-sPageOf=of
-
-//告警界面
-ngict_fm_iui_curalarm_currentAlarm=Active Alarms
-ngict_fm_iui_curalarm_advance=Advance
-ngict_fm_iui_curalarm_alarmPosition=Location
-ngict_fm_iui_curalarm_choosed=Selected
-ngict_fm_iui_curalarm_locationSelected=Selected <!--alarmLocationSelectedCount-->
-ngict_fm_iui_curalarm_alarmTypeSelected=Selected <!--alarmTypeSelectedCount-->
-ngict_fm_iui_curalarm_probableCauseSelected=Selected <!--alarmCodeSelectedCount-->
-ngict_fm_iui_curalarm_alarmType=Alarm Type
-ngict_fm_iui_curalarm_probableCause=Alarm Code
-ngict_fm_iui_curalarm_ackTimeTitle=ACK Time:
-ngict_fm_iui_curalarm_recentOneDay=Last One Day
-ngict_fm_iui_curalarm_recenttwoDays=Last Two Days
-ngict_fm_iui_curalarm_recentOneWeek=Last One Week
-ngict_fm_iui_curalarm_raisedTime=Raised Time:
-ngict_fm_iui_curalarm_query=Query
-ngict_fm_iui_curalarm_save=Save
-ngict_fm_iui_curalarm_clean=Clear
-ngict_fm_iui_curalarm_refreash=Refreash
-ngict_fm_iui_curalarm_exportAll=Export All
-ngict_fm_iui_curalarm_name=Name
-ngict_fm_iui_curalarm_condSaveTip=Update conditions when conditions exist,otherwise create a new condition.
-ngict_fm_iui_curalarm_cancel=Cancel
-ngict_fm_iui_curalarm_ok=OK
-ngict_fm_iui_curalarm_affirm=Acknowledge
-ngict_fm_iui_curalarm_unaffirm=Unacknowledge
-ngict_fm_iui_curalarm_custom=Custom
-
-ngict_fm_iui_curalarm_critical=Critical
-ngict_fm_iui_curalarm_major=Major
-ngict_fm_iui_curalarm_minor=Minor
-ngict_fm_iui_curalarm_warning=Warning
-ngict_fm_iui_curalarm_ackAlarm=Acknowledge
-ngict_fm_iui_curalarm_unackAlarm=Unacknowledge
-ngict_fm_iui_curalarm_visible=Visible
-ngict_fm_iui_curalarm_invisible=Invisible
-
-ngict_fm_iui_curalarm_order=No.
-ngict_fm_iui_curalarm_id=id
-ngict_fm_iui_curalarm_ne=NE
-ngict_fm_iui_curalarm_moc=NE Type
-ngict_fm_iui_curalarm_probableCauseCode=Alarm Code
-ngict_fm_iui_curalarm_alarmRaisedTime=Raised Time
-ngict_fm_iui_curalarm_perceivedSeverity=Severity
-ngict_fm_iui_curalarm_ackState=ACK State
-ngict_fm_iui_curalarm_ackTime=(UN)ACK Time
-ngict_fm_iui_curalarm_position1=Position1
-ngict_fm_iui_curalarm_alarmChangedTime=Changed Time
-ngict_fm_iui_curalarm_ackUserId=(UN)ACK User ID
-ngict_fm_iui_curalarm_ackSystemId=(UN)ACK System ID
-ngict_fm_iui_curalarm_alarmClearedTime=Cleared Time
-ngict_fm_iui_curalarm_additionalText=Additional Information
-ngict_fm_iui_curalarm_ackSystem=(UN)ACK System
-ngict_fm_iui_curalarm_clearUserId=Clear User ID
-ngict_fm_iui_curalarm_clearSystemId=Clear System ID
-ngict_fm_iui_curalarm_clearType=Clear Type
-ngict_fm_iui_curalarm_specificProblem=Specific Problem
-ngict_fm_iui_curalarm_neIp=NE IP
-
-//调用datarangepicker组件
-ngict_fm_iui_curalarm_from=from
-ngict_fm_iui_curalarm_to=to
-ngict_fm_iui_curalarm_Mon=Mon
-ngict_fm_iui_curalarm_Tues=Tues
-ngict_fm_iui_curalarm_Wed=Wed
-ngict_fm_iui_curalarm_Thurs=Thurs
-ngict_fm_iui_curalarm_Fri=Fri
-ngict_fm_iui_curalarm_Sat=Sat
-ngict_fm_iui_curalarm_Sun=Sun
-ngict_fm_iui_curalarm_January=January
-ngict_fm_iui_curalarm_February=February
-ngict_fm_iui_curalarm_March=March
-ngict_fm_iui_curalarm_April=April
-ngict_fm_iui_curalarm_May=May
-ngict_fm_iui_curalarm_June=June
-ngict_fm_iui_curalarm_July=July
-ngict_fm_iui_curalarm_August=August
-ngict_fm_iui_curalarm_September=September
-ngict_fm_iui_curalarm_October=October
-ngict_fm_iui_curalarm_November=November
-ngict_fm_iui_curalarm_December=December
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/i18n/ngict-curalarms-iui-i18n-zh-CN.properties b/umc-iui/src/main/resources/webroot/umc-fm/i18n/ngict-curalarms-iui-i18n-zh-CN.properties
deleted file mode 100644
index 1e4074a7..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/i18n/ngict-curalarms-iui-i18n-zh-CN.properties
+++ /dev/null
@@ -1,98 +0,0 @@
-//表格相关
-ngict-fm-iui-table-sLengthMenu=每页 _MENU_ 条结果
-ngict-fm-iui-table-sZeroRecords=没有匹配结果
-ngict-fm-iui-table-sInfo=总共找到 _TOTAL_ 条结果
-ngict-fm-iui-table-sInfoEmpty=共 0 项
-ngict-fm-iui-table-sGroupActions=_TOTAL_ 条结果被选择:
-ngict-fm-iui-table-sAjaxRequestGeneralError=不能完成请求,请检查您的网络连接情况。
-ngict-fm-iui-table-sEmptyTable=表中数据为空
-ngict-fm-iui-table-sPrevious=前页
-ngict-fm-iui-table-sNext=下页
-ngict-fm-iui-table-sPage=第
-ngict-fm-iui-table-sPageOf=页,总页数:
-
-//告警界面
-ngict_fm_iui_curalarm_currentAlarm=当前告警
-ngict_fm_iui_curalarm_advance=高级
-ngict_fm_iui_curalarm_alarmPosition=告警位置
-ngict_fm_iui_curalarm_choosed=已选择
-ngict_fm_iui_curalarm_locationSelected=已选择<!--alarmLocationSelectedCount-->个
-ngict_fm_iui_curalarm_alarmTypeSelected=已选择<!--alarmTypeSelectedCount-->个
-ngict_fm_iui_curalarm_probableCauseSelected=已选择<!--alarmCodeSelectedCount-->个
-ngict_fm_iui_curalarm_alarmType=告警类型
-ngict_fm_iui_curalarm_probableCause=告警码
-ngict_fm_iui_curalarm_ackTimeTitle=确认时间:
-ngict_fm_iui_curalarm_recentOneDay=最近一天
-ngict_fm_iui_curalarm_recenttwoDays=最近两天
-ngict_fm_iui_curalarm_recentOneWeek=最近一周
-ngict_fm_iui_curalarm_raisedTime=发生时间:
-ngict_fm_iui_curalarm_query=查询
-ngict_fm_iui_curalarm_save=保存
-ngict_fm_iui_curalarm_clean=清除
-ngict_fm_iui_curalarm_refreash=刷新
-ngict_fm_iui_curalarm_exportAll=导出全部
-ngict_fm_iui_curalarm_name=名称
-ngict_fm_iui_curalarm_condSaveTip=当查询条件名称为已有查询条件时为修改,否则为新建。
-ngict_fm_iui_curalarm_cancel=取消
-ngict_fm_iui_curalarm_ok=确定
-ngict_fm_iui_curalarm_affirm=确认
-ngict_fm_iui_curalarm_unaffirm=反确认
-ngict_fm_iui_curalarm_custom=自定义
-
-ngict_fm_iui_curalarm_critical=严重
-ngict_fm_iui_curalarm_major=主要
-ngict_fm_iui_curalarm_minor=普通
-ngict_fm_iui_curalarm_warning=轻微
-ngict_fm_iui_curalarm_ackAlarm=已确认
-ngict_fm_iui_curalarm_unackAlarm=未确认
-ngict_fm_iui_curalarm_visible=可见
-ngict_fm_iui_curalarm_invisible=不可见
-
-ngict_fm_iui_curalarm_order=序号
-ngict_fm_iui_curalarm_id=id
-ngict_fm_iui_curalarm_ne=网元
-ngict_fm_iui_curalarm_moc=网元类型
-ngict_fm_iui_curalarm_probableCauseCode=告警码
-ngict_fm_iui_curalarm_alarmRaisedTime=发生时间
-ngict_fm_iui_curalarm_perceivedSeverity=级别
-ngict_fm_iui_curalarm_alarmType=告警类型
-ngict_fm_iui_curalarm_ackState=确认状态
-ngict_fm_iui_curalarm_ackTime=确认时间
-ngict_fm_iui_curalarm_position1=告警主位置
-ngict_fm_iui_curalarm_alarmChangedTime=改变时间
-ngict_fm_iui_curalarm_ackUserId=告警确认用户ID
-ngict_fm_iui_curalarm_ackSystemId=告警确认系统ID
-ngict_fm_iui_curalarm_alarmClearedTime=恢复时间
-ngict_fm_iui_curalarm_additionalText=附加信息
-ngict_fm_iui_curalarm_ackSystem=确认系统
-ngict_fm_iui_curalarm_clearUserId=清除用户ID
-ngict_fm_iui_curalarm_clearSystemId=清除系统ID
-ngict_fm_iui_curalarm_clearType=告警清除方式
-ngict_fm_iui_curalarm_specificProblem=告警原因描述
-ngict_fm_iui_curalarm_neIp=网元IP
-ngict_fm_iui_curalarm_pathIds=关联路径ID
-ngict_fm_iui_curalarm_pathName=路径名称
-
-//调用datarangepicker组件
-ngict_fm_iui_curalarm_from=从
-ngict_fm_iui_curalarm_to=到
-ngict_fm_iui_curalarm_Mon=一
-ngict_fm_iui_curalarm_Tues=二
-ngict_fm_iui_curalarm_Wed=三
-ngict_fm_iui_curalarm_Thurs=四
-ngict_fm_iui_curalarm_Fri=五
-ngict_fm_iui_curalarm_Sat=六
-ngict_fm_iui_curalarm_Sun=日
-ngict_fm_iui_curalarm_January=1月
-ngict_fm_iui_curalarm_February=2月
-ngict_fm_iui_curalarm_March=3月
-ngict_fm_iui_curalarm_April=4月
-ngict_fm_iui_curalarm_May=5月
-ngict_fm_iui_curalarm_June=6月
-ngict_fm_iui_curalarm_July=7月
-ngict_fm_iui_curalarm_August=8月
-ngict_fm_iui_curalarm_September=9月
-ngict_fm_iui_curalarm_October=10月
-ngict_fm_iui_curalarm_November=11月
-ngict_fm_iui_curalarm_December=12月
-
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/images/Thumbs.db b/umc-iui/src/main/resources/webroot/umc-fm/images/Thumbs.db
deleted file mode 100644
index 9f3fa188..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/images/Thumbs.db
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/images/aos_view-fm.gif b/umc-iui/src/main/resources/webroot/umc-fm/images/aos_view-fm.gif
deleted file mode 100644
index 7914b55a..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/images/aos_view-fm.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/images/arrow.png b/umc-iui/src/main/resources/webroot/umc-fm/images/arrow.png
deleted file mode 100644
index 5c66dd78..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/images/arrow.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/images/details_close.png b/umc-iui/src/main/resources/webroot/umc-fm/images/details_close.png
deleted file mode 100644
index e6281bae..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/images/details_close.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/images/details_open.png b/umc-iui/src/main/resources/webroot/umc-fm/images/details_open.png
deleted file mode 100644
index 5bf4389c..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/images/details_open.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/images/down.png b/umc-iui/src/main/resources/webroot/umc-fm/images/down.png
deleted file mode 100644
index f7732ba8..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/images/down.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/images/filter.png b/umc-iui/src/main/resources/webroot/umc-fm/images/filter.png
deleted file mode 100644
index d7600c8b..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/images/filter.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/images/statistics.png b/umc-iui/src/main/resources/webroot/umc-fm/images/statistics.png
deleted file mode 100644
index 8be1db19..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/images/statistics.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/images/up.png b/umc-iui/src/main/resources/webroot/umc-fm/images/up.png
deleted file mode 100644
index 8bd53741..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/images/up.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/js/CommonUtil.js b/umc-iui/src/main/resources/webroot/umc-fm/js/CommonUtil.js
deleted file mode 100644
index 1d6144dd..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/js/CommonUtil.js
+++ /dev/null
@@ -1,42 +0,0 @@
-var commonUtil = {};
-commonUtil.arrayRemove = function (aryInstance, index) {
- if (aryInstance == undefined || aryInstance == null) {
- return;
- }
- for (var i = 0, n = 0; i < aryInstance.length; i++) {
- if (aryInstance[i] != aryInstance[dx]) {
- aryInstance[n++] = aryInstance[i];
- }
- }
- aryInstance.length -= 1;
-};
-
-//对Date的扩展,将 Date 转化为指定格式的String
-// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
-// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
-// 例子:
-// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
-// (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
-commonUtil.parseDate = function (dateObj, format) {
- var o = {
- "M+": dateObj.getMonth() + 1, //month
- "d+": dateObj.getDate(), //day
- "h+": dateObj.getHours(), //hour
- "m+": dateObj.getMinutes(), //minute
- "s+": dateObj.getSeconds(), //second
- "q+": Math.floor((dateObj.getMonth() + 3) / 3), //quarter
- "S": dateObj.getMilliseconds() //millisecond
- }
- if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
- (dateObj.getFullYear() + "").substr(4 - RegExp.$1.length));
- for (var k in o)
- if (new RegExp("(" + k + ")").test(format))
- format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] :
- ("00" + o[k]).substr(("" + o[k]).length));
- return format;
-};
-
-commonUtil.strToJson = function (str) {
- var json = eval('(' + str + ')');
- return json;
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/js/alarmConds.js b/umc-iui/src/main/resources/webroot/umc-fm/js/alarmConds.js
deleted file mode 100644
index 77f4d4ab..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/js/alarmConds.js
+++ /dev/null
@@ -1,261 +0,0 @@
-var AlarmConds = function () {
-
- return {
-
- parseActiveConds2JSon: function (conds) {
- return this.parseConds2JSon(conds, 1);
- },
- parseHistoryConds2JSon: function (conds) {
- return this.parseConds2JSon(conds, 2);
- },
-
- /**
- * 传入的条件数组说明:
- * 每个条件都是一个对象,包含2个属性:type和data。type表示条件的类型,data是一个数组,每项都表示一个条件。
- * 下面是支持的所有条件的说明:
- * 1)网元
- * {
- * type : 'Position',
- * data : [{ //支持多个
- * locationId : 'lId1',
- * oid : 'oid1',
- * isSelf : true //是否分组,true表示只包含自己,false表示分组
- * }
- * ]
- * }
- * 2)级别
- * {
- * type : 'Severity',
- * data : [{ //支持多个
- * severity : 1 //1表示严重,2表示主要,3表示次要,4表示警告
- * }
- * ]
- * }
- * 3)确认状态
- * {
- * type : 'AckState',
- * data : [{ //支持多个
- * ackState : 1 //1表示已确认,2表示未确认
- * }
- * ]
- * }
- * 4)可见性
- * {
- * type : 'FilterState',
- * data : [{ //支持多个
- * filterState : 1 //1表示可见,0表示不可见
- * }
- * ]
- * }
- * 5)告警类型
- * {
- * type : 'AlarmType',
- * data : [{ //支持多个
- * alarmType : 1 //0表示通信告警,1表示处理错误告警,2表示服务质量告警,3表示设备告警,4表示环境告警,5表示网管系统告警,6表示完整性告警,7表示可用性告警,8表示物理攻击告警,9表示安全攻击告警,10表示时限告警
- * }
- * ]
- * }
- * 6)告警码
- * {
- * type : 'ProbableCause',
- * data : [{ //支持多个
- * systemType : 6,
- * code : 1001
- * }
- * ]
- * }
- * 7)发生时间
- * {
- * type : 'RaisedTime',
- * data : [{ //支持一个
- * mode : 0, //0表示区间,1表示最近
- * start : 1399429229000, //mode为0时,表示开始时间,mode为1时,表示时间的毫秒值
- * end : 1399515601000 //mode为0时,表示结束时间,mode为1时,表示时间的毫秒值
- * }
- * ]
- * }
- * 8)确认时间
- * {
- * type : 'AckTime',
- * data : [{ //支持一个
- * mode : 0, //0表示区间,1表示最近
- * start : 1399429229000, //mode为0时,表示开始时间,mode为1时,表示时间的毫秒值
- * end : 1399515601000 //mode为0时,表示结束时间,mode为1时,表示时间的毫秒值
- * }
- * ]
- * }
- * 9)清除时间
- * {
- * type : 'ClearedTime',
- * data : [{ //支持一个
- * mode : 0, //0表示区间,1表示最近
- * start : 1399429229000, //mode为0时,表示开始时间,mode为1时,表示时间的毫秒值
- * end : 1399515601000 //mode为0时,表示结束时间,mode为1时,表示时间的毫秒值
- * }
- * ]
- * }
- * 10)告警ID
- * {
- * type : 'AlarmId',
- * data : [{ //支持一个
- * id : 1412923648983
- * }
- * ]
- * }
- * 11)MOC
- * {
- * type : 'Moc',
- * data : [{ //支持一个
- * moc : 'moc' //支持前缀匹配,如:'moc%'
- * }
- * ]
- * }
- * 12)ip地址
- * {
- * type : 'NeIp',
- * data : [{ //支持一个
- * neIp : '10.74.165.57'
- * }
- * ]
- * }
- */
- parseConds2JSon: function (conds, ruleType) {
- var parser = {
- Position: function (cond) {
- var condStr = "";
- if (cond.type === "Position" && cond.data.length > 0) {
- condStr = "<NewPositionCond OwnerType='Position' value='" + cond.data[0].locationId + "#" + cond.data[0].oid + "#" + cond.data[0].isSelf;
- for (var i = 1; i < cond.data.length; i++) {
- condStr += "∷" + cond.data[i].locationId + "#" + cond.data[i].oid + "#" + cond.data[i].isSelf;
- }
- condStr += "' />";
- }
- return condStr;
- },
- Severity: function (cond) {
- var condStr = "";
- if (cond.type === "Severity" && cond.data.length > 0) {
- condStr = "<PerceivedSeverity value='" + cond.data[0].severity;
- for (var i = 1; i < cond.data.length; i++) {
- condStr += "," + cond.data[i].severity;
- }
- condStr += "' />";
- }
- return condStr;
- },
- AckState: function (cond) {
- var condStr = "";
- if (cond.type === "AckState" && cond.data.length > 0) {
- condStr = "<AckState value='" + cond.data[0].ackState;
- for (var i = 1; i < cond.data.length; i++) {
- condStr += "," + cond.data[i].ackState;
- }
- condStr += "' />";
- }
- return condStr;
- },
- FilterState: function (cond) {
- var condStr = "";
- if (cond.type === "FilterState" && cond.data.length > 0) {
- condStr = "<FilterState value='" + cond.data[0].filterState;
- for (var i = 1; i < cond.data.length; i++) {
- condStr += "," + cond.data[i].filterState;
- }
- condStr += "' />";
- }
- return condStr;
- },
- AlarmType: function (cond) {
- var condStr = "";
- if (cond.type === "AlarmType" && cond.data.length > 0) {
- condStr = "<AlarmType value='" + cond.data[0].alarmType;
- for (var i = 1; i < cond.data.length; i++) {
- condStr += "," + cond.data[i].alarmType;
- }
- condStr += "' />";
- }
- return condStr;
- },
- ProbableCause: function (cond) {
- var condStr = "";
- if (cond.type === "ProbableCause" && cond.data.length > 0) {
- condStr = "<ProbableCause value='" + cond.data[0].systemType + "#" + cond.data[0].code;
- for (var i = 1; i < cond.data.length; i++) {
- condStr += "," + cond.data[i].systemType + "#" + cond.data[i].code;
- }
- condStr += "' />";
- }
- return condStr;
- },
- RaisedTime: function (cond) {
- var condStr = "";
- if (cond.type === "RaisedTime" && cond.data.length === 1) {
- condStr = "<RaisedTime model='" + cond.data[0].mode + "' start='" + cond.data[0].start + "' end= '" + cond.data[0].end + "' queryTimeZone='' condTimeZone='' />";
- }
- return condStr;
- },
- AckTime: function (cond) {
- var condStr = "";
- if (cond.type === "AckTime" && cond.data.length === 1) {
- condStr = "<AckTime model='" + cond.data[0].mode + "' start='" + cond.data[0].start + "' end= '" + cond.data[0].end + "' queryTimeZone='' condTimeZone='' />";
- }
- return condStr;
- },
- ClearedTime: function (cond) {
- var condStr = "";
- if (cond.type === "ClearedTime" && cond.data.length === 1) {
- condStr = "<ClearedTime model='" + cond.data[0].mode + "' start='" + cond.data[0].start + "' end= '" + cond.data[0].end + "' queryTimeZone='' condTimeZone='' />";
- }
- return condStr;
- },
- AlarmId: function (cond) {
- var condStr = "";
- if (cond.type === "AlarmId" && cond.data.length === 1) {
- condStr = "<IDString value='" + cond.data[0].id + "'/>";
- }
- return condStr;
- },
- Moc: function (cond) {
- var condStr = "";
- if (cond.type === "Moc" && cond.data.length === 1) {
- condStr = "<Moc Moc='" + cond.data[0].moc + "' SELECT_MODEL='false' MocSelf='true' />";
- }
- return condStr;
- },
- NeIp: function (cond) {
- var condStr = "";
- if (cond.type === "NeIp" && cond.data.length === 1) {
- condStr = "<NeIp value='" + cond.data[0].neIp + "' />";
- }
- return condStr;
- }
- };
-
- var d = new Date();
- var JSonObj = {
- rule: {
- ruleId: -1,
- name: "Alarm",
- creator: "admin",
- createTime: d.getTime(),
- modifier: "",
- modifyTime: 0,
- description: "",
- state: true,
- ruleType: ruleType,
- ruleSort: 1,
- owner: "",
- attrs: "<Attrs/>"
- }
- };
- var condStr = "<CompoundCond>";
- for (var i = 0; i < conds.length; i++) {
- condStr += parser[conds[i].type](conds[i]);
- }
- JSonObj.rule.ruleData = condStr + "</CompoundCond>";
- //return JSON.stringify(JSonObj);
- return JSonObj;
- }
-
- };
-}(); \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/js/alarmsServerPageTable.js b/umc-iui/src/main/resources/webroot/umc-fm/js/alarmsServerPageTable.js
deleted file mode 100644
index c00c6664..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/js/alarmsServerPageTable.js
+++ /dev/null
@@ -1,514 +0,0 @@
-var serverPageTable = {};
-var queryCacheId = null;
-var alarmCount;
-/* Bootstrap style full number pagination control */
-$.fn.dataTableExt.oApi.fnPagingInfo = function (oSettings) {
- return {
- "iEnd": oSettings.fnDisplayEnd(),
- "iLength": oSettings._iDisplayLength,
- "iTotal": oSettings.fnRecordsTotal(),
- "iFilteredTotal": oSettings.fnRecordsDisplay(),
- "iPage": Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength),
- "iTotalPages": Math.ceil(oSettings.fnRecordsDisplay() / oSettings._iDisplayLength)
- };
-};
-
-$.extend($.fn.dataTableExt.oPagination, {
- "bootstrap_extended": {
- "fnInit": function (oSettings, nPaging, fnDraw) {
- var oLang = oSettings.oLanguage.oPaginate;
- var oPaging = oSettings.oInstance.fnPagingInfo();
-
- var fnClickHandler = function (e) {
- e.preventDefault();
- if (oSettings.oApi._fnPageChange(oSettings, e.data.action)) {
- fnDraw(oSettings);
- }
- };
-
- $(nPaging).append(
- '<div class="pagination-panel"> ' + oLang.sPage + ' ' +
- '<a href="#" class="btn btn-sm default prev disabled" title="' + oLang.sPrevious + '"><i class="fa fa-angle-left"></i></a>' +
- '<input type="text" class="pagination-panel-input input-mini input-inline input-sm" maxlenght="5" style="text-align:center; margin: 0 4px; border: 1px solid rgb(169, 169, 169);height: 28px;">' +
- '<a href="#" class="btn btn-sm default next disabled" title="' + oLang.sNext + '"><i class="fa fa-angle-right"></i></a> ' +
- oLang.sPageOf + ' <span class="pagination-panel-total"></span>' +
- '</div>'
- );
-
- var els = $('a', nPaging);
-
- $(els[0]).bind('click.DT', {action: "previous"}, fnClickHandler);
- $(els[1]).bind('click.DT', {action: "next"}, fnClickHandler);
-
- $('.pagination-panel-input', nPaging).bind('change.DT', function (e) {
- var oPaging = oSettings.oInstance.fnPagingInfo();
- e.preventDefault();
- var page = parseInt($(this).val());
- if (page > 0 && page < oPaging.iTotalPages) {
- if (oSettings.oApi._fnPageChange(oSettings, page - 1)) {
- fnDraw(oSettings);
- }
- } else {
- $(this).val(oPaging.iPage + 1);
- }
- });
-
- $('.pagination-panel-input', nPaging).bind('keypress.DT', function (e) {
- var oPaging = oSettings.oInstance.fnPagingInfo();
- if (e.which == 13) {
- var page = parseInt($(this).val());
- if (page > 0 && page < oSettings.oInstance.fnPagingInfo().iTotalPages) {
- if (oSettings.oApi._fnPageChange(oSettings, page - 1)) {
- fnDraw(oSettings);
- }
- } else {
- $(this).val(oPaging.iPage + 1);
- }
- e.preventDefault();
- }
- });
- },
-
- "fnUpdate": function (oSettings, fnDraw) {
- var iListLength = 5;
- var oPaging = oSettings.oInstance.fnPagingInfo();
- var an = oSettings.aanFeatures.p;
- var i, j, sClass, iStart, iEnd, iHalf = Math.floor(iListLength / 2);
-
- if (oPaging.iTotalPages < iListLength) {
- iStart = 1;
- iEnd = oPaging.iTotalPages;
- }
- else if (oPaging.iPage <= iHalf) {
- iStart = 1;
- iEnd = iListLength;
- } else if (oPaging.iPage >= (oPaging.iTotalPages - iHalf)) {
- iStart = oPaging.iTotalPages - iListLength + 1;
- iEnd = oPaging.iTotalPages;
- } else {
- iStart = oPaging.iPage - iHalf + 1;
- iEnd = iStart + iListLength - 1;
- }
-
-
- for (i = 0, iLen = an.length; i < iLen; i++) {
- var wrapper = $(an[i]).parents(".dataTables_wrapper");
-
- if (oPaging.iTotalPages <= 0) {
- $('.pagination-panel, .dataTables_length', wrapper).hide();
- } else {
- $('.pagination-panel, .dataTables_length', wrapper).show();
- }
-
- $('.pagination-panel-total', an[i]).html(oPaging.iTotalPages);
- $('.pagination-panel-input', an[i]).val(oPaging.iPage + 1);
-
- // Remove the middle elements
- $('li:gt(1)', an[i]).filter(':not(.next)').remove();
-
- // Add the new list items and their event handlers
- for (j = iStart; j <= iEnd; j++) {
- sClass = (j == oPaging.iPage + 1) ? 'class="active"' : '';
- $('<li ' + sClass + '><a href="#">' + j + '</a></li>')
- .insertBefore($('li.next:first', an[i])[0])
- .bind('click', function (e) {
- e.preventDefault();
- oSettings._iDisplayStart = (parseInt($('a', this).text(), 10) - 1) * oPaging.iLength;
- fnDraw(oSettings);
- });
- }
-
- // Add / remove disabled classes from the static elements
- if (oPaging.iPage === 0) {
- $('a.prev', an[i]).addClass('disabled');
- } else {
- $('a.prev', an[i]).removeClass('disabled');
- }
-
- if (oPaging.iPage === oPaging.iTotalPages - 1 || oPaging.iTotalPages === 0) {
- $('a.next', an[i]).addClass('disabled');
- } else {
- $('a.next', an[i]).removeClass('disabled');
- }
- }
- }
- }
-});
-
-//构造查询条件
-serverPageTable.getRestPara = function (cond, tableSetting) {
-
- var conditions = {};
- //告警级别
- if (cond.severity != null && cond.severity != "undefined" && cond.severity.length > 0) {
- var severity = '['+cond.severity+']';
- var severityObj = window.JSON.parse(severity);
- conditions.severities=severityObj;
- }
-
- //确认状态
- if (cond.ackState != null && cond.ackState != "undefined" && cond.ackState.length > 0) {
- var ackState = '[' + cond.ackState + ']';
- var ackStateObj = window.JSON.parse(ackState)
- conditions.ackStates=ackStateObj;
- }
-
- //可见性
- if (cond.filterState != null && cond.filterState != "undefined" && cond.filterState.length > 0) {
- var filterState = '[' + cond.filterState + ']';
- var filterStateObj = window.JSON.parse(filterState);
- conditions.isVisibles=filterStateObj;
- }
-
- //告警确认时间
- if (cond.ackTimeMode != null && cond.ackTimeMode != "undefined") {
- var ackTime;
- if(cond.ackTimeMode === 1){
- ackTime = '{"timeMode": '+cond.ackTimeMode+',"relativeTime": '+cond.ackRelativeTime+'}';
- }else{
- ackTime = '{"beginTime": '+cond.ackTimeStarTime+',"endTime": '+cond.ackTimeEndTime+',"timeMode": '+cond.ackTimeMode+'}';
- }
- var ackTimeObj = window.JSON.parse(ackTime);
- conditions.ackTime = ackTimeObj;
- }
-
- //告警发生时间
- if (cond.alarmRaisedTimeMode != null && cond.alarmRaisedTimeMode != "undefined") {
- var alarmRaisedTime;
- if(cond.alarmRaisedTimeMode === 1){
- alarmRaisedTime = '{"timeMode": '+cond.alarmRaisedTimeMode+',"relativeTime": '+cond.alarmRaisedRelativeTime+'}';
- }else{
- alarmRaisedTime = '{"beginTime": '+cond.alarmRaisedStartTime+',"endTime": '+cond.alarmRaisedEndTime+',"timeMode": '+cond.alarmRaisedTimeMode+'}';
- }
- var alarmRaisedTimeObj = window.JSON.parse(alarmRaisedTime);
- conditions.alarmRaisedTime = alarmRaisedTimeObj;
- }
-
- //告警清除时间
- if (cond.clearedTimeMode != null && cond.clearedTimeMode != "undefined") {
- var clearedTime;
- if(cond.clearedTimeMode === 1){
- clearedTime = '{"timeMode": '+cond.clearedTimeMode+',"relativeTime": '+cond.clearedTimeRelativeTime+'}';
- }else{
- clearedTime = '{"beginTime": '+cond.clearedTimeStartTime+',"endTime": '+cond.clearedTimeEndTime+',"timeMode": '+cond.clearedTimeMode+'}';
- }
- var clearedTimeTimeObj = window.JSON.parse(clearedTime);
- conditions.alarmClearedTime = clearedTimeTimeObj;
- }
-
- //告警码
- if (cond.probableCause != null && cond.probableCause != "undefined") {
- //var probableCauseArr = cond.probableCause.split(',');
- var str = "";
- var arr="[";
- for (var i = 0; i < cond.probableCause.length; i++) {
- if(i === 0){
- if(cond.probableCause[i].type === "1"){
- arr+='{"systemType":'+cond.probableCause[i].codeid+',"codes":[]}';
- }else{
- arr+='{"systemType":'+cond.probableCause[i].parentid+',"codes":['+cond.probableCause[i].codeid+']}';
- }
- }else{
- if(cond.probableCause[i].type === "1"){
- arr+=',{"systemType":'+cond.probableCause[i].codeid+',"codes":[]}';
- }else{
- arr+=',{"systemType":'+cond.probableCause[i].parentid+',"codes":['+cond.probableCause[i].codeid+']}';
- }
- }
- }
- arr+="]";
- var probableCausesObj = window.JSON.parse(arr);
- conditions.probableCauses = probableCausesObj;
- }
-
- var requests={};
- requests.condition=conditions;
- requests.pageSize=tableSetting._iDisplayLength;
- requests.pageNumber=tableSetting._iDisplayStart / tableSetting._iDisplayLength + 1;
- if(cond.alarmType===2 && requests.pageNumber === 1){
- requests.queryCacheId="";
- }else if(cond.alarmType===2 && requests.pageNumber != 1){
- requests.queryCacheId=queryCacheId;
- }
-
- var resStr = window.JSON.stringify(requests);
- result={
- request:resStr
- };
- return result;
-};
-
-
-serverPageTable.initDataTable = function (setting, cond, divId) {
- //转换colomn
- var column = setting.columns;
- var setting;
- //先把原来的表格清空
- $('#' + divId).children().remove();
- var tableId = setting.tableId;
- var tableEleStr = '<table class="table table-striped table-bordered table-hover" id= ' + tableId + '>'
- + '<thead>'
- + '<tr role="row" class="heading" >'
- + '</tr>'
- + '</thead>'
- + '<tbody>'
- + '</tbody>'
- + '</table>';
- $('#' + divId).append(tableEleStr);
- //$('#'+ tableId).append(' <thead><tr role="row" class="heading" ></tr></thead><tbody></tbody>');
- var trEle = $('#' + tableId + ' > thead >tr');
- //var dataTableColumn = [];
- for (var one in column) {
- if (one != "contains") {
- var th = '<th>' + column[one].name + '</th>';
- trEle.append(th);
- }
- }
-
- var table = $("#" + tableId).dataTable({
- //"sDom" : "tr<'row'<'col-md-6 col-sm-12'><'col-md-6 col-sm-12'pli>>", // datatable layout
- // "sDom" : "<'row'<'col-md-12 col-sm-12'lip>r><'table-scrollable't>>",
- "oLanguage": setting.language,//汉化
- "bJQueryUI": true,
- "bPaginate": true,// 分页按钮
- "bFilter": false,// 搜索栏
- "bAutoWidth": true,//自动设置列宽
- "bLengthChange": true,// 每行显示记录数
- "iDisplayLength": 10,// 每页显示行数
- "bSort": false,// 排序
- "bInfo": true,// Showing 1 to 10 of 23 entries 总记录数没也显示多少等信息
- "bWidth": true,
- "bScrollCollapse": false,
- "sScrollY": "400px",
- "sScrollX": "100%",
- "sPaginationType": "bootstrap_extended", // 分页, bootstrap_extended 一共两种样式 另一种为two_button // 是datatables默认
- "bProcessing": true,
- "bServerSide": true,
- "bDestroy": true,
- "bSortCellsTop": true,
- "sDom": '<"top"rt><"bottom"lip>',
- "sAjaxSource": setting.restUrl,// ./js/testJson.json setting.restUrl
- "aoColumns": setting.columns,
- "bRetrieve": true,
- "fnServerData": function (sSource, aoData, fnCallback, oSettings) {
- oSettings.jqXHR = $.ajax({
- "type": 'get',
- "url": sSource,
- "dataType": "json",
- "data": serverPageTable.getRestPara(cond, oSettings),
- "success": function (resp) {
- oSettings.iDraw = oSettings.iDraw + 1;
-
- var data = {};
- if(cond.ruleType===1){
- var logList = resp.alarms;
- data.iTotalRecords = resp.totalCount;
- data.iTotalDisplayRecords = resp.totalCount;
-
- }else if(cond.ruleType===2){
- var logList = resp.alarms;
- if(resp.queryCacheId === ""){
- data.iTotalRecords = alarmCount;
- data.iTotalDisplayRecords = alarmCount;
- }else{
- alarmCount = resp.totalCount;
- data.iTotalRecords = resp.totalCount;
- data.iTotalDisplayRecords = resp.totalCount;
- queryCacheId = resp.queryCacheId;
- }
-
- }
-
- var pageInfo = null;
- setting=oSettings;
- if (pageInfo != null) {
- vm.logInfo[vm.logType].pageInfo = pageInfo;
- }
-
- //添加序号
- for(var i=0;i<logList.length;i++){
- logList[i].order="<a>"+(i+1)+"</a>";
- }
- //组合告警码
- for(var i=0;i<logList.length;i++){
- logList[i].probableCauseCodeNameAndCode=logList[i].probableCauseCodeName+"("+logList[i].probableCauseCode+")";
- }
-
- data.aaData = logList;
- data.sEcho = oSettings;
- fnCallback(data);
-
- $('#dataTableCheckBox').click(function () {
- var checkArr = $('#' + divId + ' .details-check input[type="checkbox"]');//
- for (var i = 0; i < checkArr.length; i++) {
- if ($(checkArr).eq(i).attr('id') != 'dataTableCheckBox') {
- if ($('#dataTableCheckBox').prop("checked")) {
- $(checkArr).eq(i).removeClass('checked');
- $(checkArr).eq(i).prop('checked',true);
- } else {
- $(checkArr).eq(i).addClass('checked');
- $(checkArr).eq(i).prop('checked',false);
- }
- }
- }
- });
- }
-
- });
- },
- "fnDrawCallback": function( oSettings ) { // run some code on table redraw
-
- var tableWrapper = $('div.dataTables_wrapper');
- //自适应对齐表头
- var $tableHead = $('div.dataTables_scrollHeadInner > table.dataTable', tableWrapper);
- var tbodyHead = $('tbody', $tableHead);
- if(tbodyHead && tbodyHead.length >0){
- $(tbodyHead).remove();
- }
-
- var $tableBody = $('table#' + tableId, tableWrapper);
- var trIn = $('thead > tr:nth-child(1)', $tableHead);
- var trBodyHead = $('thead > tr:nth-child(1)', $tableBody);
- var tds = $(trIn).children();
- var ths = $(trBodyHead).children();
- for(var k=0;k<tds.length;k++){
- $(ths.eq(k)).html('<div style="height: 0;overflow: hidden;">' + tds.eq(k).html() + '</div>');
- }
- var bodyRows = $('tbody > tr', $tableBody);
- for(var i=0;i<bodyRows.length;i++){
- var rowClone = $(bodyRows.eq(i)).clone();
- var tds = $(rowClone).children();
- for(var j=0;j<tds.length;j++){
- $(tds.eq(j)).html('<div style="height: 0;overflow: hidden;">' + tds.eq(j).html() + '</div>');
- $(tds.eq(j)).height('0px');
- $(tds.eq(j)).css('padding-top','0px');
- $(tds.eq(j)).css('padding-bottom','0px');
- $(tds.eq(j)).css('border-top-width','0px');
- $(tds.eq(j)).css('border-bottom-width','0px');
- }
- $(rowClone).height('0px');
- $tableHead.append($(rowClone).prop("outerHTML"));
- }
-
- $('div.dataTables_scrollBody', tableWrapper).css('width','100%');
- //$('div.dataTables_scrollHead', tableWrapper).css('width','98.5%');
- $('div.dataTables_scrollHeadInner', tableWrapper).css('padding-right', 0);
-
- //$("table.dataTable > thead > tr > th:nth-child(2)", $(".dataTables_scrollHeadInner")).click();
-
- //设置表格本体高度
- //$('div.dataTables_scrollBody', tableWrapper).css('height', "280px");
- //填充表头右边界
- /* $('div.dataTables_scrollHead', tableWrapper).css('display','inline-block');
- $("div.dataTables_scrollHead", tableWrapper).after("<div id='divRightPadding' style='overflow: hidden; background:#eee; position: relative; float:right; border: 1px solid #ddd; height:" + 42 + "px; width: 1.4%;'></div>"); */
- /* if($.browser.mozilla){
- $('div#divRightPadding', tableWrapper).css('height', '40');
- } */
- }
- });
-
- $(window).bind('resize', function () {
- //oTable.DataTable.models.oSettings.bAjaxDataGet = false;
- table.fnAdjustColumnSizing(setting);
- } );
-
- function format_Detail(oTable, nTr) {
- var aData = oTable.fnGetData(nTr);
-
- var sOut = '<table class = "detailTable" width="100%">';
- sOut += '<tr><td class = "detailTitleStyle" width = 160><span class = "label label-primary">' + column[3].name + '</span></td><td class = "detailCellStyle" width = 320>' + null2space(aData[column[3].mData]) + '</td>';
- sOut += '<td class = "detailTitleStyle" width = 160><span class = "label label-primary">' + column[8].name + '</span></td><td class = "detailCellStyle" width = 320>' + null2space(vm.alTypes[aData[column[8].mData]]) + '</td></tr>';
-
- sOut += '<tr><td class = "detailTitleStyle" width = 80><span class = "label label-primary">' + column[9].name + '</span></td><td class = "detailCellStyle" width = 160>' + null2space(aData[column[9].mData]) + '</td>';
- sOut += '<td class = "detailTitleStyle" width = 80><span class = "label label-primary">' + column[7].name + '</span></td><td class = "detailCellStyle" width = 160>' + null2space(aData[column[7].mData]) + '</td></tr>';
-
- sOut += '<tr><td class = "detailTitleStyle"><span class = "label label-primary">' + column[6].name + '</span></td><td class = "detailCellStyle">' + null2space(aData[column[6].mData]) + '</td>';
- sOut += '<td class = "detailTitleStyle"><span class = "label label-primary">' + column[11].name + '</span></td><td class = "detailCellStyle">' + null2space(aData[column[11].mData]) + '</td></tr>';
-
- sOut += '<tr><td class = "detailTitleStyle"><span class = "label label-primary">' + column[10].name + '</span></td><td class = "detailCellStyle">' + null2space(aData[column[10].mData]) + '</td>';
- sOut += '<td class = "detailTitleStyle"><span class = "label label-primary">' + column[13].name + '</span></td><td class = "detailCellStyle">' + null2space(aData[column[13].mData]) + '</td></tr>';
-
- sOut += '<tr><td class = "detailTitleStyle"><span class = "label label-primary">' + column[12].name + '</span></td><td class = "detailCellStyle">' + null2space(aData[column[12].mData]) + '</td>';
- sOut += '<td class = "detailTitleStyle"><span class = "label label-primary">' + column[5].name + '</span></td><td class = "detailCellStyle">' + null2space(aData[column[5].mData]) + '</td></tr>';
-
- sOut += '<tr><td class = "detailTitleStyle"><span class = "label label-primary">' + column[23].name + '</span></td><td class = "detailCellStyle">' + null2space(aData[column[23].mData]) + '</td>';
- sOut += '<td class = "detailTitleStyle"><span class = "label label-primary">' + column[4].name + '</span></td><td class = "detailCellStyle">' + null2space(aData[column[4].mData]) + '</td></tr>';
- // sOut += '<td class = "detailTitleStyle"><span class = "label label-primary">' + column[5].name + '</span></td><td class = "detailCellStyle">' + aData[column[5].mData] + '</td></tr>';
-
- // sOut += '<tr><td class = "detailTitleStyle"><span class = "label label-primary">' + column[4].name + '</span></td><td class = "detailCellStyle">' + aData[column[4].mData] + '</td>';
- // sOut += '<tr><td class = "detailTitleStyle"><span class = "label label-primary">' + column[22].name + '</span></td><td class = "detailCellStyle">' + aData[column[22].mData] + '</td></tr>';
- // sOut += '<td class = "detailTitleStyle"><span class = "label label-primary">' + column[22].name + '</span></td><td class = "detailCellStyle">' + aData[column[22].mData] + '</td></tr>';
-
- // sOut += '<tr><td class = "detailTitleStyle"><span class = "label label-primary">' + column[12].name + '</span></td><td class = "detailCellStyle">' + aData[column[12].mData] + '</td>';
- // sOut += '<td class = "detailTitleStyle"><span class = "label label-primary">' + column[17].name + '</span></td><td class = "detailCellStyle">' + aData[column[17].mData] + '</td></tr>';
-
- sOut += '<td class = "detailTitleStyle"><span class = "label label-primary">' + column[16].name + '</span></td><td class = "detailCellStyle" colspan = 3>' + null2space(aData.additionalText) + '</td></tr>';
-
- return sOut;
- }
- function null2space(nullStr){
- if(nullStr == null){
- return "";
- } else {
- return nullStr;
- }
- }
- $('#' + tableId + '>tbody').on('click', 'td.details-control', function () {
- var tr = $(this).closest('tr');
- //var nTr = $(this).parents('tr')[0];
- //var row = table.row( tr );
- if (table.fnIsOpen(tr[0])) {
- table.fnClose(tr[0]);
- //if ( row.child.isShown() ) {
- // This row is already open - close it
- //row.child.hide();
- tr.removeClass('shown');
- }
- else {
- // Open this row
- table.fnOpen(tr[0], format_Detail(table, tr[0]), 'details');
- //row.child( format_Detail(row.data()) ).show();
- tr.addClass('shown');
- }
- });
-
- // mod by chenhao 2015-10-26 注释掉
- // // 所有td注册一个点击事件用来展示出详情。
- // $('#ict_alarms_table >tbody').on('click', 'td', function () {
-
- // var className= $(this).eq(0).attr('class');
- // //当点击的是如下的table页的时候
- // if(className &&(className.indexOf('relInfo')>-1 || className.indexOf('details-check')>-1 || className.indexOf('ackState')>-1 || className.indexOf('details-control')>-1)){
- // $('#right-menu').fadeOut();
- // }else{
- // //填充table的数据
- // var tbody=$('#ict_table_general >tbody');
- // tbody.children().remove();
- // var trHtml="";
- // var tr = $(this).closest('tr');
- // var aData = table.fnGetData(tr[0]);
- // for (var i = 0; i < column.length; i++) {
- // if( column[i].bVisible == false ){//如果列可见就继续遍历下一个
- // trHtml += '<tr role="row"><td>'+column[i].name+':</td><td>' + aData[column[i].mData] + '</td></tr>';
- // }
- // }
- // tbody.append(trHtml);
- // if(!vm.alarmId ||vm.alarmId==aData.alarmId){
- // $('#right-menu').fadeToggle();
- // }else{
- // $('#right-menu').fadeIn();
- // }
- // vm.alarmId=aData.alarmId;
- // }
- // });
- //重新调节列宽以适应window resize
- $(window).bind('resize', function () {
- //oTable.fnAdjustColumnSizing();
- $("table.dataTable > thead > tr > th:nth-child(2)", $(".dataTables_scrollHeadInner")).click();
- } );
-
-};
-
-
-
-
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/js/alarmsUtil.js b/umc-iui/src/main/resources/webroot/umc-fm/js/alarmsUtil.js
deleted file mode 100644
index bd8231d2..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/js/alarmsUtil.js
+++ /dev/null
@@ -1,1154 +0,0 @@
-var alarmsUtil = {};
-var alarmTemp=[];
-
-alarmsUtil.timeRender = function (obj) {
- if (obj.aData[obj.mDataProp] == -1 || obj.aData[obj.mDataProp] == 0) {
- return "";
- } else {
- var date = new Date(obj.aData[obj.mDataProp]);
- return commonUtil.parseDate(date, 'yyyy-MM-dd hh:mm:ss');
- }
-};
-
-alarmsUtil.LinkRender = function (obj) {
- return '<a href="">' + obj.aData[obj.mDataProp] + '</a>';
-};
-
-alarmsUtil.ackState = function (obj) {
-
- var innerHtml = "";
- var ackState = obj.aData.ackState;
- var alarmId = obj.aData.id;
- var alarmIdArr = [alarmId];
- var tableId="\'" + obj.oSettings.sTableId + "\'";
- var divId="\'" + obj.oSettings.nTableWrapper.parentElement.id + "\'";
- if (ackState == "1" && vm.ruleType == 1) {
- innerHtml = "<a class=\"label label-sm label-info\" onclick=\" alarmsUtil.unaffirm([" + alarmIdArr + "]," + tableId + "," + divId + ","+obj.iDataRow+") \">Acknowledge</a>";
- } else if(ackState == "1" && vm.ruleType == 2){
- innerHtml = "<div class=\"label label-sm label-info\">Acknowledge</div>";
- } else if(ackState == "2" ){
- innerHtml = "<a class=\"label label-sm acknow-purple\" onclick=\" alarmsUtil.affirm([" + alarmIdArr + "]," + tableId + "," + divId + ","+obj.iDataRow+")\">Unacknowledge</a>";
- }
- return innerHtml;
-};
-
-alarmsUtil.Severity = function (obj) {
-
- var innerHtml = "";
- var Severity = obj.aData.perceivedSeverity;
- if (Severity == "1") {
- innerHtml = "<span style=\"color:#E24949 \" class=\"ict-alarm \" ></span><sapn \">Critical</sapn>";
- } else if (Severity == "2") {
- innerHtml = "<span style=\"color:#E59313 \" class=\"ict-alarm\" ></span><sapn \">Major</sapn>";
- } else if (Severity == "3") {
- innerHtml = "<span style=\"color:#F7E51B \" class=\"ict-alarm\" ></span><sapn \">Minor</sapn>";
- } else if (Severity == "4") {
- innerHtml = "<span style=\"color:#61C2DE \" class=\"ict-alarm\" ></span><sapn \">Warning</sapn>";
- }
- return innerHtml;
-
-};
-
-alarmsUtil.operate = function (obj) {
-
- var alarmId = obj.aData.alarmId;
- return "<div class='row col-xs-12'><div><a href='#' class=\"btn-xs grey btn-editable\" onclick=\" alarmsUtil.congfirms('" + alarmId + "')\"><i class=\"ict-delete\"></i>清除</a></div></div>";
-
-};
-
-alarmsUtil.congfirms = function (alarmId) {
-
- bootbox.confirm('你确定要删除该告警吗?', function (result) { //你确定要删除该用户吗?
-
- if (result) {
- var sSource = "/web/rest/web/fm/curalarms?data={\"alarmId\":" + alarmId + "}&_dataSource=isc_PageRestDataSource_0&isc_metaDataPrefix=_&isc_dataFormat=json&_operationType=remove&_componentId=isc_com_zte_ums_aos_fm_view_eventview_table_AlarmTable_0";
- $.ajax({
- dataType : "json",
- type : "DELETE",
- //数据格式:[tab标签id,tabItem的名字,图片路径,tabItem的描述,更多的LInk地址]
- contentType : 'application/json; charset=utf-8',
- url : sSource,
- data : null,
- async : false,
- success : function (msg) {
- setTimeout(function () {
- refreshByCond();
- }, 500);
- }
- });
- }
-
- });
-
-};
-
-alarmsUtil.allOperate = function (obj) {
-
- var record = obj.aData;
- var hasModify = commonUtil.hasRigth('uep.pfl.sm.updateuser');
- var hasDel = commonUtil.hasRigth('uep.pfl.sm.deluser');
- var selectUsername = new String(record.userName);
- var innerHtml = "";
-
- // 如果有权限,显示操作列
- if (hasModify) {
- if (hasDel && selectUsername != "admin") {
- innerHtml = "<div class='row col-xs-12'><div class='col-xs-6 modify_user'><a class=\"btn-xs grey btn-editable\" href='#' onclick=\"vm.modifyUser('" + selectUsername + "')\"><i class=\"ict-modify\"></i>修改</a></div><div class='col-xs-6'><a href='#' class=\"btn-xs grey btn-editable\" onclick=\"smUtil.congfirms('" + selectUsername + "')\"><i class=\"ict-delete\"></i>删除</a></div></div>";
- } else {
- innerHtml = "<div class='row col-xs-12'><div class='col-xs-6 modify_user'><a class=\"btn-xs grey btn-editable\" href='#' onclick=\"vm.modifyUser('" + selectUsername + "')\"><i class=\"ict-modify\"></i>修改</a></div>";
- }
- }
-
- return innerHtml;
-
-};
-
-alarmsUtil.refresh = function () {
-
- refreshByCond();
-
-}
-
-/*
-
-1.确认
-
-2.反确认
-
- */
-
-alarmsUtil.loopAffirm = function (type) {
-
- var checkArr = $('#ict_alarms_table_div .details-check input[type="checkbox"]');
- var aidArr = [];
- for (var i = 0; i < checkArr.length; i++) {
- if($(checkArr[i]).prop("checked")){
- if ($(checkArr[i]).attr('alarmId') != 'undefined' && $(checkArr[i]).attr('alarmId') != null) {
- aidArr.push($(checkArr[i]).attr('alarmId'));
- }
- }
- }
-
- if (type == "1" && aidArr.length > 0) {
- alarmsUtil.affirm(aidArr);
- } else if (type == "2" && aidArr.length > 0) {
- alarmsUtil.unaffirm(aidArr);
- }
-
-}
-
-/*
-
-
-
- */
-
-alarmsUtil.loopDelAralms = function () {
-
- var checkArr = $('#ict_alarms_table_div .details-check input[type="checkbox"]');
- var aidArr = [];
- for (var i = 0; i < checkArr.length; i++) {
- if($(checkArr[i]).prop("checked")){
- if ($(checkArr[i]).attr('alarmId') != 'undefined' && $(checkArr[i]).attr('alarmId') != null) {
- aidArr.push($(checkArr[i]).attr('alarmId'));
- }
- }
- }
-
- if (aidArr.length > 0) {
- bootbox.confirm('Are you sure to delete alarm(s)', function (result) {
- if (result) {
- var sSource = "/api/umcfm/v1/curalarms?request={\"ids\":["+ aidArr +"]}";
- $.ajax({
- type : "DELETE",
- dataType : "json",
- contentType : 'application/json; charset=utf-8',
- url : sSource,
- data : null,
- async : false,
- success : function (msg) {
- setTimeout(function () {
- refreshByCond()
- }, 500);
- }
- });
- }
- });
- }
-}
-
-alarmsUtil.affirm = function (alarmIdArr,tableId,divId) {
-
- var getData = {};
- var request = {};
- request.ids=[];
- for(i=0;i<alarmIdArr.length;i++){
- request.ids.push(alarmIdArr[i]);
- }
- var url = "";
- if (vm.ruleType == 1) { //当前告警
- request.ackState=1;
- getData.request = JSON.stringify(request);
- url = "/api/umcfm/v1/curalarms";
- } else { //历史告警
- url = "/ngict/rest/fm/hisalarms"
- }
-
- $.ajax({
- type : "PUT",
- contentType : 'application/json; charset=utf-8',
- url : url + "?" + "request=" + JSON.stringify(request),
- async : false,
- success : function (msg) {
- setTimeout(function () {
- refreshByCond(tableId,divId);
- }, 100);
- },
- error : function(msg){
- setTimeout(function () {
- refreshByCond(tableId,divId);
- }, 100);
- }
- });
-
-}
-
-alarmsUtil.unaffirm = function (alarmIdArr,tableId,divId) {
-
- var getData = {};
- var request = {};
- request.ids=[];
- for(i=0;i<alarmIdArr.length;i++){
- request.ids.push(alarmIdArr[i]);
- }
- request.ackState=2;
- getData.request = JSON.stringify(request);
- var url = "";
- if (vm.ruleType == 1) { //当前告警
- url = "/api/umcfm/v1/curalarms";
- $.ajax({
- "type" : "PUT",
- "contentType" : 'application/json; charset=utf-8',
- "url" : url + "?request=" + JSON.stringify(request),
- async : false,
- success : function (msg) {
- setTimeout(function () {
- refreshByCond(tableId,divId);
- }, 100);
- },
- error : function(msg){
- setTimeout(function () {
- refreshByCond(tableId,divId);
- }, 100);
- }
- });
- }
-
-
-
-}
-
-alarmsUtil.checkBox = function (obj) {
-
- var alarmId = obj.aData.id;
- var innerHtml = '<input type="checkbox" alarmId="' + alarmId + '"/> ';
- return innerHtml;
-}
-
-//初始化告警码树
-alarmsUtil.initProbableCausesTree = function () {
- //zTree设置
- var setting = {
- view : {
- selectedMulti : false, //设置是否可以同时选中多个借点。
- showIcon : true, //不显示图标
- showLine : false, //是否显示节点之间的连线
- },
- data : {
- simpleData : {
- enable : true //如果设置为 true,请务必设置 setting.data.simpleData 内的其他参数: idKey / pIdKey / rootPId,并且让数据满足父子关系。
- }
- },
- callback : {
- onExpand : zTreeOnExpand, //每次节点展开后触发的事件。
- onCollapse : zTreeOnCollapse,
- //onClick: zTreeOnClick
- }
- };
- var probableCausesNodes;
-
- //获取告警码树数据
- getProbableCausesTreeNodes("");
- //创建告警码树
- $.fn.zTree.init($("#probableCausesTree"), setting, probableCausesNodes);
- //获取所有现有的tree节点
- var treeObj = $.fn.zTree.getZTreeObj("probableCausesTree");
- initDataAtTree();
- function initDataAtTree(){
- getAllNodesWithoutTypeEqual2("")
- };
-
- function getAllNodesWithoutTypeEqual2(parentId){
- var treeNodes=treeObj.getNodesByParam("parentId", parentId, null);
- for(var i=0;i<treeNodes.length;i++){
- if(treeNodes[i].type===0){
- getProbableCausesTreeNodes(treeNodes[i].id);
- addNodesToTree(treeNodes[i],"probableCausesTree");
- getAllNodesWithoutTypeEqual2(treeNodes[i].id);
- }
- }
- }
-
- function zTreeOnExpand(event, treeId, treeNode) {
- var childrenNodes = treeNode.children;
- if (!childrenNodes) { //当没有子节点的时候才加载,否则会重复加载。
- getProbableCausesTreeNodes(treeNode.id);
- addNodesToTree(treeNode,treeId);
- }
- };
-
- function addNodesToTree(treeNode, treeId) {
- var obj = $.fn.zTree.getZTreeObj(treeId);
- var node=obj.getNodeByParam("id", treeNode.id, null)
- obj.addNodes(node, probableCausesNodes);
- };
-
- function zTreeOnCollapse(event, treeId, treeNode) {};
-
- //告警信息中的type为0、1是父节点,2为子节点
- function isParentNode(type) {
- if (type != 2)
- return true;
- else
- return false;
- };
-
- function constructProblemCauseName(node){
- if(node.type===0){
- return node.desc;
- }else{
- return node.desc + "(" + node.value + ")";
- }
- }
-
- function getProbableCausesTreeNodes(alarmCodeParentId) {
- probableCausesNodes = new Array();
- var getData = {};
- var request = {};
- request.parentId = alarmCodeParentId;
- getData.request = JSON.stringify(request);
- $.ajax({
- async : false,
- "dataType" : 'json',
- "type" : "GET",
- "url" : "/api/umcfm/v1/probablecausestree",
- "data" : getData,
- "contentType" : 'application/json; charset=utf-8',
- "success" : function (res, textStatus, jqXHR) {
- var nodes = res;
- chkDisabled = false;
- if (nodes) {
- for (var i = 0; i < nodes.length; i++) {
- probableCausesNodes.push({
- id : nodes[i].id,
- pId : nodes[i].parentId,
- name : constructProblemCauseName(nodes[i]),
- chkDisabled : false,
- isParent : isParentNode(nodes[i].type),
- parentId : alarmCodeParentId,//treenode节点
- codeId : nodes[i].value,
- type : nodes[i].type
- });
- }
- }
- },
- "error" : function () {}
- });
- }
-}
-
-//初始化位置树
-alarmsUtil.initDeptTree = function () {
- //zTree设置
- var setting = {
- view : {
- selectedMulti : false, //设置是否可以同时选中多个借点。
- showIcon : true, //不显示图标
- showLine : false, //是否显示节点之间的连线
- },
- data : {
- simpleData : {
- enable : true //如果设置为 true,请务必设置 setting.data.simpleData 内的其他参数: idKey / pIdKey / rootPId,并且让数据满足父子关系。
- }
- },
- callback : {
- onExpand : zTreeOnExpand, //每次节点展开后触发的事件。
- onCollapse : zTreeOnCollapse,
- //onClick: zTreeOnClick
- }
- };
- var zNodes = [];
- initDeptTree();
- function initDeptTree() {
- zNodes.push({
- id:"VDU",
- name:"VDU",
- isParent:true
- },
- {
- id:"HOST",
- name:"HOST",
- isParent:true
- });
- $.fn.zTree.init($("#deptTree"), setting, zNodes);
- zNodes=[];
- }
- function getDeptTreeNode(alarmCodeParentId) {
- if(alarmCodeParentId === "VDU"){
- url="/api/roc/v1/resource/vdus";
- }else if(alarmCodeParentId === "HOST"){
- url="/api/roc/v1/resource/hosts";
- }
- $.ajax({
- async : false,
- "dataType" : 'json',
- "type" : "GET",
- "url" : url,
- "contentType" : 'application/json; charset=utf-8',
- "success" : function (res, textStatus, jqXHR) {
- var nodes = res.data;
- if (nodes) {
- for (var i = 0; i < nodes.length; i++) {
- zNodes.push({
- id : nodes[i].oid,
- parentId : alarmCodeParentId,//treenode节点
- name : nodes[i].name,
- isParent : false,
- oid:nodes[i].oid
- });
- }
- }
- },
- "error" : function () {}
- });
- }
- function zTreeOnExpand(event, treeId, treeNode) {
- getDeptTreeNode(treeNode.id);
- addNodesToTree(treeNode,treeId);
- zNodes=[];
- };
- function addNodesToTree(treeNode, treeId) {
- var obj = $.fn.zTree.getZTreeObj(treeId);
- var node=obj.getNodeByParam("id", treeNode.id, null)
- obj.addNodes(node, zNodes);
- };
- function zTreeOnCollapse(event, treeId, treeNode) {};
-}
-
-//初始化所有的树
-alarmsUtil.initTree = function () {
- //初始化告警码树和告警位置树
- alarmsUtil.initProbableCausesTree();
- alarmsUtil.initDeptTree();
-
- function initFormData(ruleType) {
-
- $("#confirmAction").hide();
- $("#filterType").hide();
- $("#action").hide();
- if (ruleType == "alarmFilter") {
- $("#filterType").show();
- } else if (ruleType == "ack") {
- $("#confirmAction").show();
- } else if (ruleType == "forward") {
- $("#action").show();
- }
-
- }
-
- function getNumbers(rule) {
-
- for (var i = 0; i < textValues.length; i++) {
- rule[textValues[i]] = $("input[name='" + textValues[i] + "']").val();
- }
-
- }
-
- function getCheckboxs(rule) {
-
- for (var i = 0; i < else_checkboxNames.length; i++) {
- rule[else_checkboxNames[i]] = $("input[name='" + else_checkboxNames[i] + "']").parent().hasClass('checked');
- }
- for (var item in checkboxNames_pair_spinnerIds) {
- rule[item] = $('#' + checkboxNames_pair_spinnerIds[item]).val();
- }
- }
-
- function setCheckboxs(rule) {
-
- for (var item in checkboxNames_pair_spinnerIds) {
- var value = 0;
- if (rule != "") {
- value = rule[item];
- }
- $('#' + item).val(value);
- setSpinnerIsEnable(item, value);
- }
- for (var i = 0; i < else_checkboxNames.length; i++) {
- $("input[name='" + else_checkboxNames[i] + "']").parent().iCheck(rule[else_checkboxNames[i]] ? 'check' : 'uncheck');
- }
- }
-}
-
-alarmsUtil.moveNode = function (item) {
- if (item.hasClass("ict-arrowRight")) {
- alarmsUtil.rightNode(item);
- } else if (item.hasClass("ict-arrowLeft")) {
- alarmsUtil.leftNode(item);
- } else {
- alarmsUtil.removeAll(item);
- }
-}
-
-/*树添加信息到右侧的功能*/
-
-alarmsUtil.rightNode = function (item) {
-
- var selecedNodeIds = [];
- var treeType = item.attr('treeType');
- var obj = $.fn.zTree.getZTreeObj(treeType);
- var treeNodes = obj.getSelectedNodes();
- var $table;
-
- if (treeType == "deptTree") {
- var $tds = $("#selectedDeptTreeTable td");
- $table = $("#selectedDeptTreeTable");
- for (var i = 0; i < $tds.length; i++) {
- selecedNodeIds.push($tds.eq(i).attr('nodeid'));
- }
- } else if (treeType == "probableCausesTree") {
- var $tds = $("#selectedProbableCausesTreeTable td");
- $table = $("#selectedProbableCausesTreeTable");
- for (var i = 0; i < $tds.length; i++) {
- var systemTypeAndProbableCause={};
- systemTypeAndProbableCause.codeId=$tds.eq(i).attr('codeId');
- systemTypeAndProbableCause.parentid=$tds.eq(i).attr('parentid');
- systemTypeAndProbableCause.type=$tds.eq(i).attr('type');
- selecedNodeIds.push(systemTypeAndProbableCause);
- }
- }
-
- //树上被选中的元素
- for (var i = 0; i < treeNodes.length; i++) {
-
- var htmlStr = "";
- var text = treeNodes[i].name;
- var id = treeNodes[i].id;
- var codeId = treeNodes[i].codeId;
- var type;
- var parentId;
- if (treeType == "deptTree") {
- var oid = treeNodes[i].oid;
- htmlStr = "<tr><td nodeId=" + id + " oid=" + oid + " >" + text + "</td></tr>";
- } else if (treeType == "probableCausesTree") {
-
- parentId = treeNodes[i].parentId;
- type = treeNodes[i].type;
- htmlStr = "<tr><td codeId=" + codeId + " parentId=" + parentId + " type=" + type + " >" + text + "</td></tr>";
- }
-
- if(treeType == "probableCausesTree"){
- if(treeNodes[i].type === 2){
- for(i=0;i<selecedNodeIds.length;i++){
- if(selecedNodeIds[i].codeId === codeId || selecedNodeIds[i].codeId === parentId){
- bootbox.alert("此节点(子树)或其父子树已经被添加!", function () {});
- return;
- }
- }
- }else if(treeNodes[i].type === 1){
- $('#selectedProbableCausesTreeTable [parentid='+codeId+']').remove();
- for(i=0;i<selecedNodeIds.length;i++){
- if(selecedNodeIds[i].codeId === codeId ){
- bootbox.alert("此节点(子树)或其父子树已经被添加!", function () {});
- return;
- }
- }
- }else if(treeNodes[i].type === 0){
- bootbox.alert("不支持添加MOC", function () {});
- break;
- }
- }
-
- $table.append(htmlStr);
-
- }
-
- $('#selectedDeptTreeTable td').on("click", function () {
-
- //获得所有选择的td
- var $tds = $('#selectedDeptTree td');
- //遍历改变样式
- for (var i = 0; i < $tds.length; i++) {
- $tds.eq(i).removeClass('tallCellSelected');
- $tds.eq(i).parent().removeClass('checked');
- }
- //当前td设为选中
- $(this).addClass('tallCellSelected');
- $(this).parent().addClass("checked"); //tr 添加一个 checked 样式。
- });
-
- $('#selectedProbableCausesTreeTable td').on("click", function () {
-
- //获得所有选择的td
- var $tds = $('#selectedProbableCausesTreeTable td');
- //遍历改变样式
- for (var i = 0; i < $tds.length; i++) {
- $tds.eq(i).removeClass('tallCellSelected');
- $tds.eq(i).parent().removeClass('checked');
- }
- //当前td设为选中
- $(this).addClass('tallCellSelected');
- $(this).parent().addClass("checked"); //tr 添加一个 checked 样式。
- });
-
-}
-
-
-
-alarmsUtil.leftNode = function (item) {
-
- var treeType = item.attr('treeType');
- if (treeType == "deptTree") {
- $('#selectedDeptTreeTable').children().children(".checked").remove();
- } else if (treeType == "probableCausesTree") {
- $('#selectedProbableCausesTreeTable').children().children(".checked").remove();
- }
-
-}
-
-alarmsUtil.removeAll = function (item) {
-
- var treeType = item.attr('treeType');
- if (treeType == "deptTree") { //如果是资源树
- $('#selectedDeptTreeTable').children().remove();
- } else if (treeType == "probableCausesTree") {
- $('#selectedProbableCausesTreeTable').children().remove();
- }
-}
-
-
-
-
-
-//调用datarangepicker组件 datarange 初始化
-
-alarmsUtil.setDateRange = function (dataRangeId, vm) {
-
- var open = 'right';
- var optionSet1 = {
- startDate : "2015-08-02",
- endDate : "2015-08-03",
- format : 'YYYY-MM-DD h:mm A',
- dateLimit : {
- days : 180
- },
- showWeekNumbers : false,
- timePicker : true,
- timePickerIncrement : 5,
- opens : open,
- separator : ' - ',
- locale : {
- applyLabel : $.i18n.prop('ngict_fm_iui_curalarm_ok'),
- cancelLabel : $.i18n.prop('ngict_fm_iui_curalarm_cancel'),
- fromLabel : $.i18n.prop('ngict_fm_iui_curalarm_from'),
- toLabel : $.i18n.prop('ngict_fm_iui_curalarm_to'),
- daysOfWeek : [
- $.i18n.prop('ngict_fm_iui_curalarm_Sun'),
- $.i18n.prop('ngict_fm_iui_curalarm_Mon'),
- $.i18n.prop('ngict_fm_iui_curalarm_Tues'),
- $.i18n.prop('ngict_fm_iui_curalarm_Wed'),
- $.i18n.prop('ngict_fm_iui_curalarm_Thurs'),
- $.i18n.prop('ngict_fm_iui_curalarm_Fri'),
- $.i18n.prop('ngict_fm_iui_curalarm_Sat')
- ],
- monthNames : [$.i18n.prop('ngict_fm_iui_curalarm_January'), $.i18n.prop('ngict_fm_iui_curalarm_February'), $.i18n.prop('ngict_fm_iui_curalarm_March'), $.i18n.prop('ngict_fm_iui_curalarm_April'), $.i18n.prop('ngict_fm_iui_curalarm_May'), $.i18n.prop('ngict_fm_iui_curalarm_June'), $.i18n.prop('ngict_fm_iui_curalarm_July'), $.i18n.prop('ngict_fm_iui_curalarm_August'), $.i18n.prop('ngict_fm_iui_curalarm_September'), $.i18n.prop('ngict_fm_iui_curalarm_October'), $.i18n.prop('ngict_fm_iui_curalarm_November'), $.i18n.prop('ngict_fm_iui_curalarm_December')],
- firstDay : 1
- }
- };
-
- //datarangepicker确认
- $('input[id="' + dataRangeId + '"]').bind('apply.daterangepicker', function () {
- //获取时间范围,查询
- // 都设置为0点
- setTime($(this));
- // 更新tooltip内容
- $(this).attr("data-original-title", $(this).val());
- });
-
- $('input[id="' + dataRangeId + '"]').daterangepicker(optionSet1);
-
-};
-
-//关闭打开datarangepicker选择器
-alarmsUtil.dateRangeEnableDisable = function (customDateRangeId) {
-
- $('#' + customDateRangeId).on('ifChecked', function () {
-
- if (customDateRangeId == "customAckTime") {
- vm.dataRangeLocationDisabled = false;
- if(vm.fmConds.ackTimeStarTime!=null && vm.fmConds.ackTimeEndTime!=null){
- vm.fmConds.ackTimeMode=0;
- }
- } else if (customDateRangeId == "customRaisedTime") {
- vm.dataRangeTypeDisabled = false;
- if(vm.fmConds.alarmRaisedStartTime!=null && vm.fmConds.alarmRaisedEndTime!=null){
- vm.fmConds.alarmRaisedTimeMode=0;
- }
- } else if (customDateRangeId == "customClearTime"){
- vm.dataRangeCodeDisabled = false;
- if(vm.fmConds.clearedTimeStartTime!=null && vm.fmConds.clearedTimeEndTime!=null){
- vm.fmConds.clearedTimeMode=0;
- }
- }
- });
- //setTime($('#' + dataRangeId));
-
- $('#' + customDateRangeId).on('ifUnchecked', function () {
-
- if (customDateRangeId == "customAckTime") {
-
- vm.dataRangeLocationDisabled = true;
- vm.fmConds.ackTimeMode=null;
-
- } else if (customDateRangeId == "customRaisedTime") {
-
- vm.dataRangeTypeDisabled = true;
- vm.fmConds.alarmRaisedTimeMode=null;
-
- } else if (customDateRangeId == "customClearTime"){
-
- vm.dataRangeCodeDisabled = true;
- vm.fmConds.clearedTimeMode=null;
-
- }
- });
-
-}
-
-//checkbox时间选择
-alarmsUtil.dateRangeCustom = function (vm) {
-
- $("input[name=timeConfirm]").on("ifClicked", function () {
- if ($(this).parent().hasClass("checked")) {
- $(this).iCheck('uncheck');
- }
- });
-
- $("input[name=timeOccur]").on("ifClicked", function () {
- if ($(this).parent().hasClass("checked")) {
- $(this).iCheck('uncheck');
- }
- });
-
- $("input[name=timeClear]").on("ifClicked", function () {
- if ($(this).parent().hasClass("checked")) {
- $(this).iCheck('uncheck');
- }
- });
-
- $("input[cond_id=time]").on('ifChecked', function () {
-
- var nowTime = (new Date()).toLocaleDateString();
- var condDate = $(this).attr("cond_value");
-
- if ($(this).attr("name") == "timeConfirm") {
- if (condDate == "1") {
- vm.fmConds.ackRelativeTime = 1 * 24 * 60 * 60 * 1000;
- vm.fmConds.ackTimeMode = 1;
- } else if (condDate == "2") {
- vm.fmConds.ackRelativeTime = 2 * 24 * 60 * 60 * 1000;
- vm.fmConds.ackTimeMode = 1;
- } else if (condDate == "7") {
- vm.fmConds.ackRelativeTime = 7 * 24 * 60 * 60 * 1000;
- vm.fmConds.ackTimeMode = 1;
- }
- }
-
- if ($(this).attr("name") == "timeOccur") {
- if (condDate == "1") {
- vm.fmConds.alarmRaisedRelativeTime = 1 * 24 * 60 * 60 * 1000;
- vm.fmConds.alarmRaisedTimeMode = 1;
- } else if (condDate == "2") {
- vm.fmConds.alarmRaisedRelativeTime = 2 * 24 * 60 * 60 * 1000;
- vm.fmConds.alarmRaisedTimeMode = 1;
- } else if (condDate == "7") {
- vm.fmConds.alarmRaisedRelativeTime = 7 * 24 * 60 * 60 * 1000;
- vm.fmConds.alarmRaisedTimeMode = 1;
- }
- }
-
- if ($(this).attr("name") == "timeClear") {
- if (condDate == "1") {
- vm.fmConds.clearedTimeRelativeTime =1 * 24 * 60 * 60 * 1000;
- vm.fmConds.clearedTimeMode = 1;
- } else if (condDate == "2") {
- vm.fmConds.clearedTimeRelativeTime =2 * 24 * 60 * 60 * 1000;
- vm.fmConds.clearedTimeMode = 1;
- } else if (condDate == "7") {
- vm.fmConds.clearedTimeRelativeTime =7 * 24 * 60 * 60 * 1000;
- vm.fmConds.clearedTimeMode = 1;
- }
- }
-
- //refreshByCond();
- });
-
- $("input[cond_id=time]").on('ifUnchecked', function () {
- if ($(this).attr("name") == "timeConfirm") {
- vm.fmConds.ackRelativeTime = null;
- vm.fmConds.ackTimeMode = null;
- }else if ($(this).attr("name") == "timeOccur") {
- vm.fmConds.alarmRaisedRelativeTime = null;
- vm.fmConds.alarmRaisedTimeMode = null;
- }else if ($(this).attr("name") == "timeClear") {
- vm.fmConds.clearedTimeRelativeTime = null;
- vm.fmConds.clearedTimeMode = null;
- }
- });
-
-}
-
-
-/*格式化日期*/
-Date.prototype.format = function (format) {
-
- /*
-
- * format="yyyy-MM-dd hh:mm:ss";
-
- */
- var o = {
- "M+" : this.getMonth() + 1,
- "d+" : this.getDate(),
- "h+" : this.getHours(),
- "m+" : this.getMinutes(),
- "s+" : this.getSeconds(),
- "q+" : Math.floor((this.getMonth() + 3) / 3),
- "S" : this.getMilliseconds()
- }
- if (/(y+)/.test(format)) {
- format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4
- - RegExp.$1.length));
- }
- for (var k in o) {
- if (new RegExp("(" + k + ")").test(format)) {
- format = format.replace(RegExp.$1, RegExp.$1.length == 1
- ? o[k]
- : ("00" + o[k]).substr(("" + o[k]).length));
- }
- }
- return format;
-
-}
-
-//daterangepicker设置时间
-function setTime($obj) {
-
- var title = $obj.attr('dtitle');
- var arr = $obj.val().split(' - ');
- //排除日历组件空字符串的情况。
- if (arr[0] != '') {
- var starTime = new Date(arr[0].replace(/-/g, "/")).getTime();
- var endTime = new Date(arr[1].replace(/-/g, "/")).getTime();
- if (title == "ackTime") {
- vm.fmConds.ackTimeStarTime = starTime;
- vm.fmConds.ackTimeEndTime = endTime;
- vm.fmConds.ackTimeMode=0;
- } else if (title == "raisedTime") {
- vm.fmConds.alarmRaisedStartTime = starTime;
- vm.fmConds.alarmRaisedEndTime = endTime;
- vm.fmConds.alarmRaisedTimeMode=0;
- } else if (title == "clearTime") {
- vm.fmConds.clearedTimeStartTime = starTime;
- vm.fmConds.clearedTimeEndTime = endTime;
- vm.fmConds.clearedTimeMode=0;
- }
- }
-}
-
-/*
-@param type 1 day 2 week 3 month 4 year
- */
-function reduceDate(date, val, type) {
-
- var d = new Date(date);
- if (type == 'day') {
- d.setDate(d.getDate() - val);
- } else if (type == 'week') {
- d.setDate(d.getDate() - val * 7);
- } else if (type == 'month') {
- d.setMonth(d.getMonth() - val);
- } else if (type == 'year') {
- d.setFullYear(d.getFullYear() - val);
- }
- var month = d.getMonth() + 1;
- var day = d.getDate();
- if (month < 10) {
- month = "0" + month;
- }
- if (day < 10) {
- day = "0" + day;
- }
- var val = d.getFullYear() + "-" + month + "-" + day;
- return val;
-}
-
-alarmsUtil.condSave = function (cond, saveUrl, name) {
-
- var conds = [];
- if (cond.severity != null && cond.severity != "undefined" && cond.severity.length > 0) {
- var severity = '{ "type": "Severity", "data": [{"severity": "' + cond.severity + '"}]}'; //级别
- var severityObj = window.JSON.parse(severity)
- conds.push(severityObj);
- }
- if (cond.ackState != null && cond.ackState != "undefined") {
- var ackState = '{ "type": "AckState", "data": [{"ackState": "' + cond.ackState + '"}]}'; //级别
- var ackStateObj = window.JSON.parse(ackState)
- conds.push(ackStateObj);
- }
- if (cond.filterState != null && cond.filterState != "undefined") {
- var filterState = '{ "type": "FilterState", "data": [{"filterState": "' + cond.filterState + '"}]}'; //级别
- var filterStateObj = window.JSON.parse(filterState)
- conds.push(filterStateObj);
- }
-
- if (cond.ackTimeStarTime != null && cond.ackTimeStarTime != "undefined") {
- var ackTime = '{ "type": "AckTime", "data": [{"mode":"0","start":"' + cond.ackTimeStarTime + '","end":"' + cond.ackTimeEndTime + '" }]}'; //级别
- var ackTimeObj = window.JSON.parse(ackTime)
- conds.push(ackTimeObj);
- }
- if (cond.alarmRaisedStartTime != null && cond.alarmRaisedStartTime != "undefined") {
- var alarmRaisedTime = '{ "type": "RaisedTime", "data": [{"mode":"0","start":"' + cond.alarmRaisedStartTime + '","end":"' + cond.alarmRaisedEndTime + '" }]}'; //级别
- var alarmRaisedTimeObj = window.JSON.parse(alarmRaisedTime)
- conds.push(alarmRaisedTimeObj);
- }
-
- if (cond.clearedTimeStarTime != null && cond.clearedTimeStarTime != "undefined") {
- var clearedTime = '{ "type": "ClearedTime", "data": [{"mode":"0","start":"' + cond.clearedTimeStarTime + '","end":"' + cond.clearedTimeEndime + '" }]}'; //级别
- var severityObj = window.JSON.parse(clearedTime)
- conds.push(severityObj);
- }
- var resJsonObj = AlarmConds.parseActiveConds2JSon(conds);
- resJsonObj.rule.name = name;
- resJsonObj.rule.ruleType = vm.ruleType;
- var resStr = window.JSON.stringify(resJsonObj);
- var dataSource = "isc_AosRestDataSource_1";
- var operationType = "add";
- var data1 = {
- dataSource : dataSource,
- operationType : operationType,
- data : resJsonObj,
- oldValues : null
- };
- $.ajax({
- dataType : "json",
- type : "POST",
- contentType : 'application/json; charset=utf-8',
- url : saveUrl,
- data : JSON.stringify(data1),
- async : false,
- success : function (msg) {
- $('#saveModalCancle').trigger("click");
- }
- });
-
-}
-
-Array.prototype.contains = function (item) {
- return RegExp("(^|,)" + item.toString() + "($|,)").test(this);
-};
-
-/*
-@param alarmsType 1当前告警 2历史告警
-@param condRuleId 查询条件的RuleId
- */
-alarmsUtil.queryByParma = function (alarmsType, condRuleId) {
-
- //1.判断是当前告警还是历史告警。
-
- var sourceUrl;
- if (alarmsType == 1) { //当前告警
- sourceUrl = '/web/rest/web/fm/curqueryview?' + 'data={"ruleType":1,"ruleSort":1}&isc_flag=smartClient&_operationType=fetch&_startRow=0&_endRow=75&_textMatchStyle=exact&_componentId=condList&_dataSource=isc_RestDataSource_7&isc_metaDataPrefix=_&isc_dataFormat=json';
- vm.ruleType = 1;
- vm.$queryAlarmsInfoUrl = "/ngict/rest/fm/curalarms";
- vm.curalarmsType = "curalarms";
- vm.showClear = true; //清除按钮
-
- } else if(alarmsType == 2){ //历史告警
-
- sourceUrl = '/web/rest/web/fm/curqueryview?' + 'data={"ruleType":2,"ruleSort":1}&isc_flag=smartClient&_operationType=fetch&_startRow=0&_endRow=75&_textMatchStyle=exact&_componentId=condList&_dataSource=isc_RestDataSource_7&isc_metaDataPrefix=_&isc_dataFormat=json';
- vm.ruleType = 2;
- vm.$queryAlarmsInfoUrl = "/ngict/rest/fm/hisalarms";
- vm.hisalarmsType = "hisalarms";
- vm.showClear = false; //清除按钮
- }else if(alarmsType == 3){ //通知
- sourceUrl = '/web/rest/web/fm/curqueryview?' + 'data={"ruleType":2,"ruleSort":1}&isc_flag=smartClient&_operationType=fetch&_startRow=0&_endRow=75&_textMatchStyle=exact&_componentId=condList&_dataSource=isc_RestDataSource_7&isc_metaDataPrefix=_&isc_dataFormat=json';
- vm.ruleType = 3;
- vm.$queryAlarmsInfoUrl = "/ngict/rest/fm/notify";
- vm.notificationType = "notification";
- vm.showClear = false; //清除按钮
- }
-
- //如果没传condRuleId 直接返回
- if (condRuleId == null || condRuleId == "undefined") {
- return;
- }
-
- //2.取出告警规则的数据。
-
- $.ajax({
- type : "get",
- data : null,
- url : sourceUrl,
- async : false,
- success : function (msg) {
- //1.遍历返回的条件数组确定是哪一个rule规则。
- var ruleCondArr = msg.response.data;
- var xmlData = "";
- for (var i = 0; i < ruleCondArr.length; i++) {
- if (ruleCondArr[i].ruleId == condRuleId) { //condRuleId
- xmlData = "<xml>" + ruleCondArr[i].ruleData + "</xml>" //在jQuery裡,如果要直接将字串转成XML物件,记得前后方要加上<xml>及</xml>,才会被当成XML处理;
- break;
- }
- };
-
- //3.解析数据的xml联动页面的组件。
- $(xmlData).find("CompoundCond").each(function () {
- //1.级别
- for (var i = 0; i < vm.severityTypes.length; i++) {
- vm.severityTypes[i].value = false;
- }
- if ($(this).find("PerceivedSeverity").attr('value') != null && $(this).find("PerceivedSeverity ").attr('value') != 'undefined') {
- var perceivedSeverityArr = $(this).find("PerceivedSeverity ").attr('value').split(',');
- for (var i = 0; i < perceivedSeverityArr.length; i++) {
- if (perceivedSeverityArr.contains(vm.severityTypes[i].id)) {
- vm.severityTypes[i].value = true;
- }
- };
- }
-
- //2.确认状态
- for (var i = 0; i < vm.ackStateTypes.length; i++) {
- vm.ackStateTypes[i].value = false;
- };
- var ackStateV = $(this).find("AckState").attr('value');
- if (ackStateV != null && ackStateV != "undefined") {
- var ackStateArr = ackStateV.split(',');
- for (var i = 0; i < vm.ackStateTypes.length; i++) {
- if (ackStateArr.contains(vm.ackStateTypes[i].id)) {
- vm.ackStateTypes[i].value = true;
- }
- };
- }
-
- //3.可见性
- if(vm.ruleType === 1){
- for (var i = 0; i < vm.filterStateTypes.length; i++) {
- vm.filterStateTypes[i].value = false;
- };
- var filterStateV = $(this).find("FilterState").attr('value')
- if (filterStateV != null && filterStateV != "undefined") {
- var filterStateArr = filterStateV.split(',');
- for (var i = 0; i < vm.filterStateTypes.length; i++) {
- if (filterStateArr.contains(vm.filterStateTypes[i].id)) {
- vm.filterStateTypes[i].value = true;
- }
- };
- }
- }
- //4.确认时间
-
- var dataRangeAck = $('input[dtitle="ackTime"]'); //日历组件
- vm.fmConds.ackTimeStarTime = null;
- vm.fmConds.ackTimeEndTime = null;
- dataRangeAck.val('');
- var ackTimeStartMs = $(this).find("AckTime").attr('start');
- var ackTimeEndMs = $(this).find("AckTime").attr('end');
- if (ackTimeStartMs != null && ackTimeStartMs != "undefined" && ackTimeEndMs != null && ackTimeEndMs != "undefined") {
- vm.fmConds.ackTimeStarTime = ackTimeStartMs; //确认时间
- vm.fmConds.ackTimeEndTime = ackTimeEndMs;
- var ackTimeStarTime = new Date(parseInt(ackTimeStartMs)).format('yyyy-MM-dd');
- var ackTimeEndTime = new Date(parseInt(ackTimeEndMs)).format('yyyy-MM-dd');
- dataRangeAck.val(ackTimeStarTime + ' - ' + ackTimeEndTime);
- }
-
- //5.发生时间
- vm.fmConds.alarmRaisedStartTime = null;
- vm.fmConds.alarmRaisedEndTime = null;
- var dataRangeRaised = $('input[dtitle="raisedTime"]'); //日历组件
- dataRangeRaised.val('');
- var raisedTimeStartMs = $(this).find("RaisedTime").attr('start');
- var raisedTimeEndMs = $(this).find("RaisedTime").attr('end');
- if (raisedTimeStartMs != null && raisedTimeStartMs != "undefined" && raisedTimeEndMs != null && raisedTimeEndMs != "undefined") {
- vm.fmConds.alarmRaisedStartTime = raisedTimeStartMs; //发生时间
- vm.fmConds.alarmRaisedEndTime = raisedTimeEndMs;
- var raisedTimeStart = new Date(parseInt(raisedTimeStartMs)).format('yyyy-MM-dd');
- var raisedTimeEnd = new Date(parseInt(raisedTimeEndMs)).format('yyyy-MM-dd');
- dataRangeRaised.val(raisedTimeStart + ' - ' + raisedTimeEnd);
- }
-
- //6.清除时间
-
-
- //7.告警码
-
- vm.fmConds.probableCause = null;
- var probableCauseArr = $(this).find("ProbableCause").attr('value');
- if (probableCauseArr != null && probableCauseArr != "undefined") {
- for (var i = 0; i < probableCauseArr.length; i++) {
- vm.fmConds.probableCause = probableCauseArr;
- // 联动
- };
- }
-
- //8.告警位置
- vm.fmConds.probableCause = null;
- var newPositionCondArr = $(this).find("NewPositionCond").attr('value');
- if (newPositionCondArr != null && newPositionCondArr != "undefined")
- for (var i = 0; i < newPositionCondArr.length; i++) {
- // 联动
- };
-
- //9.告警类型
- vm.fmConds.alarmType = null;
- var alarmTypeArr = $(this).find("AlarmType").attr('value');
- if (alarmTypeArr != null && alarmTypeArr != "undefined") {
- for (var i = 0; i < alarmTypeArr.length; i++) {
- vm.fmConds.alarmType = alarmTypeArr;
- };
- }
- });
- }
- });
-}
-
-
-/*
- 获取系统类型中的告警码数量
-*/
-alarmsUtil.getProbableCauseCountBySystemType=function(systemType){
-
- //"/ngict/rest/fm/probableCause?request={"systemTypes":[6,12]}"
- var getData={};
- var request={};
- request.systemTypes=systemType;
- getData.request = JSON.stringify(request);
- $.ajax({
- type : "get",
- data : getData,
- url : "/ngict/rest/fm/probableCause",
- async : true,
- success : function (msg) {
- vm.alarmCodeSelectedCount+=msg.length;
- }});
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/js/avalon.modern.js b/umc-iui/src/main/resources/webroot/umc-fm/js/avalon.modern.js
deleted file mode 100644
index 7c37393f..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/js/avalon.modern.js
+++ /dev/null
@@ -1,4935 +0,0 @@
-/*==================================================
- Copyright (c) 2013-2015 司徒正美 and other contributors
- http://www.cnblogs.com/rubylouvre/
- https://github.com/RubyLouvre
- http://weibo.com/jslouvre/
-
- Released under the MIT license
- avalon.modern.js 1.43 built in 2015.5.21
- support IE10+ and other browsers
- ==================================================*/
-(function (global, factory) {
-
- if (typeof module === "object" && typeof module.exports === "object") {
- // For CommonJS and CommonJS-like environments where a proper `window`
- // is present, execute the factory and get avalon.
- // For environments that do not have a `window` with a `document`
- // (such as Node.js), expose a factory as module.exports.
- // This accentuates the need for the creation of a real `window`.
- // e.g. var avalon = require("avalon")(window);
- module.exports = global.document ? factory(global, true) : function (w) {
- if (!w.document) {
- throw new Error("Avalon requires a window with a document")
- }
- return factory(w)
- }
- } else {
- factory(global)
- }
-
-// Pass this if window is not defined yet
-}(typeof window !== "undefined" ? window : this, function (window, noGlobal) {
-
- /*********************************************************************
- * 全局变量及方法 *
- **********************************************************************/
- var expose = Date.now()
-//http://stackoverflow.com/questions/7290086/javascript-use-strict-and-nicks-find-global-function
- var DOC = window.document
- var head = DOC.head //HEAD元素
- head.insertAdjacentHTML("afterBegin", '<avalon ms-skip class="avalonHide"><style id="avalonStyle">.avalonHide{ display: none!important }</style></avalon>')
- var ifGroup = head.firstChild
-
- function log() {
- if (avalon.config.debug) {
-// http://stackoverflow.com/questions/8785624/how-to-safely-wrap-console-log
- console.log.apply(console, arguments)
- }
- }
-
- /**
- * Creates a new object without a prototype. This object is useful for lookup without having to
- * guard against prototypically inherited properties via hasOwnProperty.
- *
- * Related micro-benchmarks:
- * - http://jsperf.com/object-create2
- * - http://jsperf.com/proto-map-lookup/2
- * - http://jsperf.com/for-in-vs-object-keys2
- */
- function createMap() {
- return Object.create(null)
- }
-
- var subscribers = "$" + expose
- var otherRequire = window.require
- var otherDefine = window.define
- var innerRequire
- var stopRepeatAssign = false
- var rword = /[^, ]+/g //切割字符串为一个个小块,以空格或豆号分开它们,结合replace实现字符串的forEach
- var rcomplexType = /^(?:object|array)$/
- var rsvg = /^\[object SVG\w*Element\]$/
- var rwindow = /^\[object (?:Window|DOMWindow|global)\]$/
- var oproto = Object.prototype
- var ohasOwn = oproto.hasOwnProperty
- var serialize = oproto.toString
- var ap = Array.prototype
- var aslice = ap.slice
- var Registry = {} //将函数曝光到此对象上,方便访问器收集依赖
- var W3C = window.dispatchEvent
- var root = DOC.documentElement
- var hyperspace = DOC.createDocumentFragment()
- var cinerator = DOC.createElement("div")
- var class2type = {}
- "Boolean Number String Function Array Date RegExp Object Error".replace(rword, function (name) {
- class2type["[object " + name + "]"] = name.toLowerCase()
- })
-
-
- function noop() {
- }
-
-
- function oneObject(array, val) {
- if (typeof array === "string") {
- array = array.match(rword) || []
- }
- var result = {},
- value = val !== void 0 ? val : 1
- for (var i = 0, n = array.length; i < n; i++) {
- result[array[i]] = value
- }
- return result
- }
-
-//生成UUID http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
- var generateID = function (prefix) {
- prefix = prefix || "avalon"
- return String(Math.random() + Math.random()).replace(/\d\.\d{4}/, prefix)
- }
-
- function IE() {
- if (window.VBArray) {
- var mode = document.documentMode
- return mode ? mode : window.XMLHttpRequest ? 7 : 6
- } else {
- return 0
- }
- }
-
- var IEVersion = IE()
-
- avalon = function (el) { //创建jQuery式的无new 实例化结构
- return new avalon.init(el)
- }
-
- /*视浏览器情况采用最快的异步回调*/
- avalon.nextTick = new function () {// jshint ignore:line
- var tickImmediate = window.setImmediate
- var tickObserver = window.MutationObserver
- var tickPost = W3C && window.postMessage
- if (tickImmediate) {
- return tickImmediate.bind(window)
- }
-
- var queue = []
-
- function callback() {
- var n = queue.length
- for (var i = 0; i < n; i++) {
- queue[i]()
- }
- queue = queue.slice(n)
- }
-
- if (tickObserver) {
- var node = document.createTextNode("avalon")
- new tickObserver(callback).observe(node, {characterData: true})// jshint ignore:line
- return function (fn) {
- queue.push(fn)
- node.data = Math.random()
- }
- }
-
- if (tickPost) {
- window.addEventListener("message", function (e) {
- var source = e.source
- if ((source === window || source === null) && e.data === "process-tick") {
- e.stopPropagation()
- callback()
- }
- })
-
- return function (fn) {
- queue.push(fn)
- window.postMessage('process-tick', '*')
- }
- }
-
- return function (fn) {
- setTimeout(fn, 0)
- }
- }// jshint ignore:line
- /*********************************************************************
- * avalon的静态方法定义区 *
- **********************************************************************/
- avalon.init = function (el) {
- this[0] = this.element = el
- }
- avalon.fn = avalon.prototype = avalon.init.prototype
-
- avalon.type = function (obj) { //取得目标的类型
- if (obj == null) {
- return String(obj)
- }
- // 早期的webkit内核浏览器实现了已废弃的ecma262v4标准,可以将正则字面量当作函数使用,因此typeof在判定正则时会返回function
- return typeof obj === "object" || typeof obj === "function" ?
- class2type[serialize.call(obj)] || "object" :
- typeof obj
- }
-
- var isFunction = function (fn) {
- return serialize.call(fn) === "[object Function]"
- }
-
- avalon.isFunction = isFunction
-
- avalon.isWindow = function (obj) {
- return rwindow.test(serialize.call(obj))
- }
-
- /*判定是否是一个朴素的javascript对象(Object),不是DOM对象,不是BOM对象,不是自定义类的实例*/
-
- avalon.isPlainObject = function (obj) {
- // 简单的 typeof obj === "object"检测,会致使用isPlainObject(window)在opera下通不过
- return serialize.call(obj) === "[object Object]" && Object.getPrototypeOf(obj) === oproto
- }
-
-//与jQuery.extend方法,可用于浅拷贝,深拷贝
- avalon.mix = avalon.fn.mix = function () {
- var options, name, src, copy, copyIsArray, clone,
- target = arguments[0] || {},
- i = 1,
- length = arguments.length,
- deep = false
-
- // 如果第一个参数为布尔,判定是否深拷贝
- if (typeof target === "boolean") {
- deep = target
- target = arguments[1] || {}
- i++
- }
-
- //确保接受方为一个复杂的数据类型
- if (typeof target !== "object" && !isFunction(target)) {
- target = {}
- }
-
- //如果只有一个参数,那么新成员添加于mix所在的对象上
- if (i === length) {
- target = this
- i--
- }
-
- for (; i < length; i++) {
- //只处理非空参数
- if ((options = arguments[i]) != null) {
- for (name in options) {
- src = target[name]
- copy = options[name]
- // 防止环引用
- if (target === copy) {
- continue
- }
- if (deep && copy && (avalon.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) {
-
- if (copyIsArray) {
- copyIsArray = false
- clone = src && Array.isArray(src) ? src : []
-
- } else {
- clone = src && avalon.isPlainObject(src) ? src : {}
- }
-
- target[name] = avalon.mix(deep, clone, copy)
- } else if (copy !== void 0) {
- target[name] = copy
- }
- }
- }
- }
- return target
- }
-
- function _number(a, len) { //用于模拟slice, splice的效果
- a = Math.floor(a) || 0
- return a < 0 ? Math.max(len + a, 0) : Math.min(a, len);
- }
-
- avalon.mix({
- rword: rword,
- subscribers: subscribers,
- version: 1.43,
- ui: {},
- log: log,
- slice: function (nodes, start, end) {
- return aslice.call(nodes, start, end)
- },
- noop: noop,
- /*如果不用Error对象封装一下,str在控制台下可能会乱码*/
- error: function (str, e) {
- throw new (e || Error)(str)// jshint ignore:line
- },
- /*将一个以空格或逗号隔开的字符串或数组,转换成一个键值都为1的对象*/
- oneObject: oneObject,
- /* avalon.range(10)
- => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
- avalon.range(1, 11)
- => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
- avalon.range(0, 30, 5)
- => [0, 5, 10, 15, 20, 25]
- avalon.range(0, -10, -1)
- => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
- avalon.range(0)
- => []*/
- range: function (start, end, step) { // 用于生成整数数组
- step || (step = 1)
- if (end == null) {
- end = start || 0
- start = 0
- }
- var index = -1,
- length = Math.max(0, Math.ceil((end - start) / step)),
- result = new Array(length)
- while (++index < length) {
- result[index] = start
- start += step
- }
- return result
- },
- eventHooks: {},
- /*绑定事件*/
- bind: function (el, type, fn, phase) {
- var hooks = avalon.eventHooks
- var hook = hooks[type]
- if (typeof hook === "object") {
- type = hook.type
- if (hook.deel) {
- fn = hook.deel(el, type, fn, phase)
- }
- }
- if (!fn.unbind)
- el.addEventListener(type, fn, !!phase)
- return fn
- },
- /*卸载事件*/
- unbind: function (el, type, fn, phase) {
- var hooks = avalon.eventHooks
- var hook = hooks[type]
- var callback = fn || noop
- if (typeof hook === "object") {
- type = hook.type
- if (hook.deel) {
- fn = hook.deel(el, type, fn, false)
- }
- }
- el.removeEventListener(type, callback, !!phase)
- },
- /*读写删除元素节点的样式*/
- css: function (node, name, value) {
- if (node instanceof avalon) {
- node = node[0]
- }
- var prop = /[_-]/.test(name) ? camelize(name) : name, fn
- name = avalon.cssName(prop) || prop
- if (value === void 0 || typeof value === "boolean") { //获取样式
- fn = cssHooks[prop + ":get"] || cssHooks["@:get"]
- if (name === "background") {
- name = "backgroundColor"
- }
- var val = fn(node, name)
- return value === true ? parseFloat(val) || 0 : val
- } else if (value === "") { //请除样式
- node.style[name] = ""
- } else { //设置样式
- if (value == null || value !== value) {
- return
- }
- if (isFinite(value) && !avalon.cssNumber[prop]) {
- value += "px"
- }
- fn = cssHooks[prop + ":set"] || cssHooks["@:set"]
- fn(node, name, value)
- }
- },
- /*遍历数组与对象,回调的第一个参数为索引或键名,第二个或元素或键值*/
- each: function (obj, fn) {
- if (obj) { //排除null, undefined
- var i = 0
- if (isArrayLike(obj)) {
- for (var n = obj.length; i < n; i++) {
- if (fn(i, obj[i]) === false)
- break
- }
- } else {
- for (i in obj) {
- if (obj.hasOwnProperty(i) && fn(i, obj[i]) === false) {
- break
- }
- }
- }
- }
- },
- //收集元素的data-{{prefix}}-*属性,并转换为对象
- getWidgetData: function (elem, prefix) {
- var raw = avalon(elem).data()
- var result = {}
- for (var i in raw) {
- if (i.indexOf(prefix) === 0) {
- result[i.replace(prefix, "").replace(/\w/, function (a) {
- return a.toLowerCase()
- })] = raw[i]
- }
- }
- return result
- },
- Array: {
- /*只有当前数组不存在此元素时只添加它*/
- ensure: function (target, item) {
- if (target.indexOf(item) === -1) {
- return target.push(item)
- }
- },
- /*移除数组中指定位置的元素,返回布尔表示成功与否*/
- removeAt: function (target, index) {
- return !!target.splice(index, 1).length
- },
- /*移除数组中第一个匹配传参的那个元素,返回布尔表示成功与否*/
- remove: function (target, item) {
- var index = target.indexOf(item)
- if (~index)
- return avalon.Array.removeAt(target, index)
- return false
- }
- }
- })
-
- var bindingHandlers = avalon.bindingHandlers = {}
- var bindingExecutors = avalon.bindingExecutors = {}
-
- /*判定是否类数组,如节点集合,纯数组,arguments与拥有非负整数的length属性的纯JS对象*/
- function isArrayLike(obj) {
- if (obj && typeof obj === "object") {
- var n = obj.length,
- str = serialize.call(obj)
- if (/(Array|List|Collection|Map|Arguments)\]$/.test(str)) {
- return true
- } else if (str === "[object Object]" && n === (n >>> 0)) {
- return true //由于ecma262v5能修改对象属性的enumerable,因此不能用propertyIsEnumerable来判定了
- }
- }
- return false
- }
-
-
-// https://github.com/rsms/js-lru
- var Cache = new function () {// jshint ignore:line
- function LRU(maxLength) {
- this.size = 0
- this.limit = maxLength
- this.head = this.tail = void 0
- this._keymap = {}
- }
-
- var p = LRU.prototype
-
- p.put = function (key, value) {
- var entry = {
- key: key,
- value: value
- }
- this._keymap[key] = entry
- if (this.tail) {
- this.tail.newer = entry
- entry.older = this.tail
- } else {
- this.head = entry
- }
- this.tail = entry
- if (this.size === this.limit) {
- this.shift()
- } else {
- this.size++
- }
- return value
- }
-
- p.shift = function () {
- var entry = this.head
- if (entry) {
- this.head = this.head.newer
- this.head.older =
- entry.newer =
- entry.older =
- this._keymap[entry.key] = void 0
- }
- }
- p.get = function (key) {
- var entry = this._keymap[key]
- if (entry === void 0)
- return
- if (entry === this.tail) {
- return entry.value
- }
- // HEAD--------------TAIL
- // <.older .newer>
- // <--- add direction --
- // A B C <D> E
- if (entry.newer) {
- if (entry === this.head) {
- this.head = entry.newer
- }
- entry.newer.older = entry.older // C <-- E.
- }
- if (entry.older) {
- entry.older.newer = entry.newer // C. --> E
- }
- entry.newer = void 0 // D --x
- entry.older = this.tail // D. --> E
- if (this.tail) {
- this.tail.newer = entry // E. <-- D
- }
- this.tail = entry
- return entry.value
- }
- return LRU
- }// jshint ignore:line
-
- /*********************************************************************
- * DOM 底层补丁 *
- **********************************************************************/
-//safari5+是把contains方法放在Element.prototype上而不是Node.prototype
- if (!DOC.contains) {
- Node.prototype.contains = function (arg) {
- return !!(this.compareDocumentPosition(arg) & 16)
- }
- }
- avalon.contains = function (root, el) {
- try {
- while ((el = el.parentNode))
- if (el === root)
- return true
- return false
- } catch (e) {
- return false
- }
- }
-
- if (window.SVGElement) {
- var svgns = "http://www.w3.org/2000/svg"
- var svg = DOC.createElementNS(svgns, "svg")
- svg.innerHTML = '<circle cx="50" cy="50" r="40" fill="red" />'
- if (!rsvg.test(svg.firstChild)) {// #409
- /* jshint ignore:start */
- function enumerateNode(node, targetNode) {
- if (node && node.childNodes) {
- var nodes = node.childNodes
- for (var i = 0, el; el = nodes[i++];) {
- if (el.tagName) {
- var svg = DOC.createElementNS(svgns,
- el.tagName.toLowerCase())
- // copy attrs
- ap.forEach.call(el.attributes, function (attr) {
- svg.setAttribute(attr.name, attr.value)
- })
- // 递归处理子节点
- enumerateNode(el, svg)
- targetNode.appendChild(svg)
- }
- }
- }
- }
-
- /* jshint ignore:end */
- Object.defineProperties(SVGElement.prototype, {
- "outerHTML": {//IE9-11,firefox不支持SVG元素的innerHTML,outerHTML属性
- enumerable: true,
- configurable: true,
- get: function () {
- return new XMLSerializer().serializeToString(this)
- },
- set: function (html) {
- var tagName = this.tagName.toLowerCase(),
- par = this.parentNode,
- frag = avalon.parseHTML(html)
- // 操作的svg,直接插入
- if (tagName === "svg") {
- par.insertBefore(frag, this)
- // svg节点的子节点类似
- } else {
- var newFrag = DOC.createDocumentFragment()
- enumerateNode(frag, newFrag)
- par.insertBefore(newFrag, this)
- }
- par.removeChild(this)
- }
- },
- "innerHTML": {
- enumerable: true,
- configurable: true,
- get: function () {
- var s = this.outerHTML
- var ropen = new RegExp("<" + this.nodeName + '\\b(?:(["\'])[^"]*?(\\1)|[^>])*>', "i")
- var rclose = new RegExp("<\/" + this.nodeName + ">$", "i")
- return s.replace(ropen, "").replace(rclose, "")
- },
- set: function (html) {
- if (avalon.clearHTML) {
- avalon.clearHTML(this)
- var frag = avalon.parseHTML(html)
- enumerateNode(frag, this)
- }
- }
- }
- })
- }
- }
-//========================= event binding ====================
- var eventHooks = avalon.eventHooks
-//针对firefox, chrome修正mouseenter, mouseleave(chrome30+)
- if (!("onmouseenter" in root)) {
- avalon.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout"
- }, function (origType, fixType) {
- eventHooks[origType] = {
- type: fixType,
- deel: function (elem, _, fn) {
- return function (e) {
- var t = e.relatedTarget
- if (!t || (t !== elem && !(elem.compareDocumentPosition(t) & 16))) {
- delete e.type
- e.type = origType
- return fn.call(elem, e)
- }
- }
- }
- }
- })
- }
-//针对IE9+, w3c修正animationend
- avalon.each({
- AnimationEvent: "animationend",
- WebKitAnimationEvent: "webkitAnimationEnd"
- }, function (construct, fixType) {
- if (window[construct] && !eventHooks.animationend) {
- eventHooks.animationend = {
- type: fixType
- }
- }
- })
-
- if (DOC.onmousewheel === void 0) {
- /* IE6-11 chrome mousewheel wheelDetla 下 -120 上 120
- firefox DOMMouseScroll detail 下3 上-3
- firefox wheel detlaY 下3 上-3
- IE9-11 wheel deltaY 下40 上-40
- chrome wheel deltaY 下100 上-100 */
- eventHooks.mousewheel = {
- type: "wheel",
- deel: function (elem, _, fn) {
- return function (e) {
- e.wheelDeltaY = e.wheelDelta = e.deltaY > 0 ? -120 : 120
- e.wheelDeltaX = 0
- Object.defineProperty(e, "type", {
- value: "mousewheel"
- })
- fn.call(elem, e)
- }
- }
- }
- }
-
- /*********************************************************************
- * 配置系统 *
- **********************************************************************/
-
- function kernel(settings) {
- for (var p in settings) {
- if (!ohasOwn.call(settings, p))
- continue
- var val = settings[p]
- if (typeof kernel.plugins[p] === "function") {
- kernel.plugins[p](val)
- } else if (typeof kernel[p] === "object") {
- avalon.mix(kernel[p], val)
- } else {
- kernel[p] = val
- }
- }
- return this
- }
-
- var openTag, closeTag, rexpr, rexprg, rbind, rregexp = /[-.*+?^${}()|[\]\/\\]/g
-
- function escapeRegExp(target) {
- //http://stevenlevithan.com/regex/xregexp/
- //将字符串安全格式化为正则表达式的源码
- return (target + "").replace(rregexp, "\\$&")
- }
-
- var plugins = {
- loader: function (builtin) {
- var flag = innerRequire && builtin
- window.require = flag ? innerRequire : otherRequire
- window.define = flag ? innerRequire.define : otherDefine
- },
- interpolate: function (array) {
- openTag = array[0]
- closeTag = array[1]
- if (openTag === closeTag) {
- throw new SyntaxError("openTag!==closeTag")
- } else if (array + "" === "<!--,-->") {
- kernel.commentInterpolate = true
- } else {
- var test = openTag + "test" + closeTag
- cinerator.innerHTML = test
- if (cinerator.innerHTML !== test && cinerator.innerHTML.indexOf("&lt;") > -1) {
- throw new SyntaxError("此定界符不合法")
- }
- cinerator.innerHTML = ""
- }
- var o = escapeRegExp(openTag),
- c = escapeRegExp(closeTag)
- rexpr = new RegExp(o + "(.*?)" + c)
- rexprg = new RegExp(o + "(.*?)" + c, "g")
- rbind = new RegExp(o + ".*?" + c + "|\\sms-")
- }
- }
-
- kernel.debug = true
- kernel.plugins = plugins
- kernel.plugins['interpolate'](["{{", "}}"])
- kernel.paths = {}
- kernel.shim = {}
- kernel.maxRepeatSize = 100
- avalon.config = kernel
- var ravalon = /(\w+)\[(avalonctrl)="(\S+)"\]/
- var findNodes = function (str) {
- return DOC.querySelectorAll(str)
- }
- /*********************************************************************
- * 事件总线 *
- **********************************************************************/
- var EventBus = {
- $watch: function (type, callback) {
- if (typeof callback === "function") {
- var callbacks = this.$events[type]
- if (callbacks) {
- callbacks.push(callback)
- } else {
- this.$events[type] = [callback]
- }
- } else { //重新开始监听此VM的第一重简单属性的变动
- this.$events = this.$watch.backup
- }
- return this
- },
- $unwatch: function (type, callback) {
- var n = arguments.length
- if (n === 0) { //让此VM的所有$watch回调无效化
- this.$watch.backup = this.$events
- this.$events = {}
- } else if (n === 1) {
- this.$events[type] = []
- } else {
- var callbacks = this.$events[type] || []
- var i = callbacks.length
- while (~--i < 0) {
- if (callbacks[i] === callback) {
- return callbacks.splice(i, 1)
- }
- }
- }
- return this
- },
- $fire: function (type) {
- var special, i, v, callback
- if (/^(\w+)!(\S+)$/.test(type)) {
- special = RegExp.$1
- type = RegExp.$2
- }
- var events = this.$events
- if (!events)
- return
- var args = aslice.call(arguments, 1)
- var detail = [type].concat(args)
- if (special === "all") {
- for (i in avalon.vmodels) {
- v = avalon.vmodels[i]
- if (v !== this) {
- v.$fire.apply(v, detail)
- }
- }
- } else if (special === "up" || special === "down") {
- var elements = events.expr ? findNodes(events.expr) : []
- if (elements.length === 0)
- return
- for (i in avalon.vmodels) {
- v = avalon.vmodels[i]
- if (v !== this) {
- if (v.$events.expr) {
- var eventNodes = findNodes(v.$events.expr)
- if (eventNodes.length === 0) {
- continue
- }
- //循环两个vmodel中的节点,查找匹配(向上匹配或者向下匹配)的节点并设置标识
- /* jshint ignore:start */
- Array.prototype.forEach.call(eventNodes, function (node) {
- Array.prototype.forEach.call(elements, function (element) {
- var ok = special === "down" ? element.contains(node) : //向下捕获
- node.contains(element) //向上冒泡
- if (ok) {
- node._avalon = v //符合条件的加一个标识
- }
- });
- })
- /* jshint ignore:end */
- }
- }
- }
- var nodes = DOC.getElementsByTagName("*") //实现节点排序
- var alls = []
- Array.prototype.forEach.call(nodes, function (el) {
- if (el._avalon) {
- alls.push(el._avalon)
- el._avalon = ""
- el.removeAttribute("_avalon")
- }
- })
- if (special === "up") {
- alls.reverse()
- }
- for (i = 0; callback = alls[i++];) {
- if (callback.$fire.apply(callback, detail) === false) {
- break
- }
- }
- } else {
- var callbacks = events[type] || []
- var all = events.$all || []
- for (i = 0; callback = callbacks[i++];) {
- if (isFunction(callback))
- callback.apply(this, args)
- }
- for (i = 0; callback = all[i++];) {
- if (isFunction(callback))
- callback.apply(this, arguments)
- }
- }
- }
- }
-
- /*********************************************************************
- * modelFactory *
- **********************************************************************/
-//avalon最核心的方法的两个方法之一(另一个是avalon.scan),返回一个ViewModel(VM)
- var VMODELS = avalon.vmodels = createMap() //所有vmodel都储存在这里
- avalon.define = function (id, factory) {
- var $id = id.$id || id
- if (!$id) {
- log("warning: vm必须指定$id")
- }
- if (VMODELS[$id]) {
- log("warning: " + $id + " 已经存在于avalon.vmodels中")
- }
- if (typeof id === "object") {
- var model = modelFactory(id)
- } else {
- var scope = {
- $watch: noop
- }
- factory(scope) //得到所有定义
- model = modelFactory(scope) //偷天换日,将scope换为model
- stopRepeatAssign = true
- factory(model)
- stopRepeatAssign = false
- }
- model.$id = $id
- return VMODELS[$id] = model
- }
-
-//一些不需要被监听的属性
- var $$skipArray = String("$id,$watch,$unwatch,$fire,$events,$model,$skipArray").match(rword)
-
- function isObservable(name, value, $skipArray) {
- if (isFunction(value) || value && value.nodeType) {
- return false
- }
- if ($skipArray.indexOf(name) !== -1) {
- return false
- }
- if ($$skipArray.indexOf(name) !== -1) {
- return false
- }
- var $special = $skipArray.$special
- if (name && name.charAt(0) === "$" && !$special[name]) {
- return false
- }
- return true
- }
-
-//ms-with,ms-each, ms-repeat绑定生成的代理对象储存池
- var midway = createMap()
-
- function getNewValue(accessor, name, value, $vmodel) {
- switch (accessor.type) {
- case 0://计算属性
- var getter = accessor.get
- var setter = accessor.set
- if (isFunction(setter)) {
- var $events = $vmodel.$events
- var lock = $events[name]
- $events[name] = [] //清空回调,防止内部冒泡而触发多次$fire
- setter.call($vmodel, value)
- $events[name] = lock
- }
- return getter.call($vmodel) //同步$model
- case 1://监控属性
- return value
- case 2://对象属性(包括数组与哈希)
- if (value !== $vmodel.$model[name]) {
- var svmodel = accessor.svmodel = objectFactory($vmodel, name, value, accessor.valueType)
- value = svmodel.$model //同步$model
- var fn = midway[svmodel.$id]
- fn && fn() //同步视图
- }
- return value
- }
- }
-
- function modelFactory(source, $special, $model) {
- if (Array.isArray(source)) {
- var arr = source.concat()
- source.length = 0
- var collection = Collection(source)// jshint ignore:line
- collection.pushArray(arr)
- return collection
- }
- //0 null undefined || Node || VModel
- if (!source || source.nodeType > 0 || (source.$id && source.$events)) {
- return source
- }
- if (!Array.isArray(source.$skipArray)) {
- source.$skipArray = []
- }
- source.$skipArray.$special = $special || createMap() //强制要监听的属性
- var $vmodel = {} //要返回的对象, 它在IE6-8下可能被偷龙转凤
- $model = $model || {} //vmodels.$model属性
- var $events = createMap() //vmodel.$events属性
- var watchedProperties = createMap() //监控属性
- var initCallbacks = [] //初始化才执行的函数
- for (var i in source) {
- (function (name, val) {
- $model[name] = val
- if (!isObservable(name, val, source.$skipArray)) {
- return //过滤所有非监控属性
- }
- //总共产生三种accessor
- $events[name] = []
- var valueType = avalon.type(val)
- var accessor = function (newValue) {
- var name = accessor._name
- var $vmodel = this
- var $model = $vmodel.$model
- var oldValue = $model[name]
- var $events = $vmodel.$events
-
- if (arguments.length) {
- if (stopRepeatAssign) {
- return
- }
- //计算属性与对象属性需要重新计算newValue
- if (accessor.type !== 1) {
- newValue = getNewValue(accessor, name, newValue, $vmodel)
- if (!accessor.type)
- return
- }
- if (!isEqual(oldValue, newValue)) {
- $model[name] = newValue
- notifySubscribers($events[name]) //同步视图
- safeFire($vmodel, name, newValue, oldValue) //触发$watch回调
- }
- } else {
- if (accessor.type === 0) { //type 0 计算属性 1 监控属性 2 对象属性
- //计算属性不需要收集视图刷新函数,都是由其他监控属性代劳
- newValue = accessor.get.call($vmodel)
- if (oldValue !== newValue) {
- $model[name] = newValue
- //这里不用同步视图
- safeFire($vmodel, name, newValue, oldValue) //触发$watch回调
- }
- return newValue
- } else {
- collectSubscribers($events[name]) //收集视图函数
- return accessor.svmodel || oldValue
- }
- }
- }
- //总共产生三种accessor
- if (valueType === "object" && isFunction(val.get) && Object.keys(val).length <= 2) {
- //第1种为计算属性, 因变量,通过其他监控属性触发其改变
- accessor.set = val.set
- accessor.get = val.get
- accessor.type = 0
- initCallbacks.push(function () {
- var data = {
- evaluator: function () {
- data.type = Math.random(),
- data.element = null
- $model[name] = accessor.get.call($vmodel)
- },
- element: head,
- type: Math.random(),
- handler: noop,
- args: []
- }
- Registry[expose] = data
- accessor.call($vmodel)
- delete Registry[expose]
- })
- } else if (rcomplexType.test(valueType)) {
- //第2种为对象属性,产生子VM与监控数组
- accessor.type = 2
- accessor.valueType = valueType
- initCallbacks.push(function () {
- var svmodel = modelFactory(val, 0, $model[name])
- accessor.svmodel = svmodel
- svmodel.$events[subscribers] = $events[name]
- })
- } else {
- accessor.type = 1
- //第3种为监控属性,对应简单的数据类型,自变量
- }
- accessor._name = name
- watchedProperties[name] = accessor
- })(i, source[i])// jshint ignore:line
- }
-
- $$skipArray.forEach(function (name) {
- delete source[name]
- delete $model[name] //这些特殊属性不应该在$model中出现
- })
-
- $vmodel = Object.defineProperties($vmodel, descriptorFactory(watchedProperties), source) //生成一个空的ViewModel
- for (var name in source) {
- if (!watchedProperties[name]) {
- $vmodel[name] = source[name]
- }
- }
- //添加$id, $model, $events, $watch, $unwatch, $fire
- $vmodel.$id = generateID()
- $vmodel.$model = $model
- $vmodel.$events = $events
- for (i in EventBus) {
- $vmodel[i] = EventBus[i]
- }
-
- Object.defineProperty($vmodel, "hasOwnProperty", {
- value: function (name) {
- return name in this.$model
- },
- writable: false,
- enumerable: false,
- configurable: true
- })
-
- initCallbacks.forEach(function (cb) { //收集依赖
- cb()
- })
- return $vmodel
- }
-
-//比较两个值是否相等
- var isEqual = Object.is || function (v1, v2) {
- if (v1 === 0 && v2 === 0) {
- return 1 / v1 === 1 / v2
- } else if (v1 !== v1) {
- return v2 !== v2
- } else {
- return v1 === v2
- }
- }
-
- function safeFire(a, b, c, d) {
- if (a.$events) {
- EventBus.$fire.call(a, b, c, d)
- }
- }
-
- var descriptorFactory = function (obj) {
- var descriptors = createMap()
- for (var i in obj) {
- descriptors[i] = {
- get: obj[i],
- set: obj[i],
- enumerable: true,
- configurable: true
- }
- }
- return descriptors
- }
-
-//应用于第2种accessor
- function objectFactory(parent, name, value, valueType) {
- //a为原来的VM, b为新数组或新对象
- var son = parent[name]
- if (valueType === "array") {
- if (!Array.isArray(value) || son === value) {
- return son //fix https://github.com/RubyLouvre/avalon/issues/261
- }
- son._.$unwatch()
- son.clear()
- son._.$watch()
- son.pushArray(value.concat())
- return son
- } else {
- var iterators = parent.$events[name]
- var ret = modelFactory(value)
- ret.$events[subscribers] = iterators
- midway[ret.$id] = function (data) {
- while (data = iterators.shift()) {
- (function (el) {
- avalon.nextTick(function () {
- var type = el.type
- if (type && bindingHandlers[type]) { //#753
- el.rollback && el.rollback() //还原 ms-with ms-on
- bindingHandlers[type](el, el.vmodels)
- }
- })
- })(data)// jshint ignore:line
- }
- delete midway[ret.$id]
- }
- return ret
- }
- }
-
- /*********************************************************************
- * 监控数组(与ms-each, ms-repeat配合使用) *
- **********************************************************************/
-
- function Collection(model) {
- var array = []
- array.$id = generateID()
- array.$model = model //数据模型
- array.$events = {}
- array.$events[subscribers] = []
- array._ = modelFactory({
- length: model.length
- })
- array._.$watch("length", function (a, b) {
- array.$fire("length", a, b)
- })
- for (var i in EventBus) {
- array[i] = EventBus[i]
- }
- array.$map = {
- el: 1
- }
- array.$proxy = []
- avalon.mix(array, CollectionPrototype)
- return array
- }
-
- function mutateArray(method, pos, n, index, method2, pos2, n2) {
- var oldLen = this.length, loop = 2
- while (--loop) {
- switch (method) {
- case "add":
- /* jshint ignore:start */
- var m = pos + n
- var array = this.$model.slice(pos, m).map(function (el) {
- if (rcomplexType.test(avalon.type(el))) {//转换为VM
- return el.$id ? el : modelFactory(el, 0, el)
- } else {
- return el
- }
- })
- /* jshint ignore:end */
- for (var i = pos; i < m; i++) {//生成代理VM
- var proxy = eachProxyAgent(i, this)
- this.$proxy.splice(i, 0, proxy)
- }
- _splice.apply(this, [pos, 0].concat(array))
- this._fire("add", pos, n)
- break
- case "del":
- var ret = this._splice(pos, n)
- var removed = this.$proxy.splice(pos, n) //回收代理VM
- recycleProxies(removed, "each")
- this._fire("del", pos, n)
- break
- }
- if (method2) {
- method = method2
- pos = pos2
- n = n2
- loop = 2
- method2 = 0
- }
- }
- resetIndex(this.$proxy, index)
- if (this.length !== oldLen) {
- this._.length = this.length
- }
- return ret
- }
-
- var _splice = ap.splice
- var CollectionPrototype = {
- _splice: _splice,
- _fire: function (method, a, b) {
- notifySubscribers(this.$events[subscribers], method, a, b)
- },
- size: function () { //取得数组长度,这个函数可以同步视图,length不能
- return this._.length
- },
- pushArray: function (array) {
- var m = array.length, n = this.length
- if (m) {
- ap.push.apply(this.$model, array)
- mutateArray.call(this, "add", n, m, Math.max(0, n - 1))
- }
- return m + n
- },
- push: function () {
- //http://jsperf.com/closure-with-arguments
- var array = []
- var i, n = arguments.length
- for (i = 0; i < n; i++) {
- array[i] = arguments[i]
- }
- return this.pushArray(array)
- },
- unshift: function () {
- var m = arguments.length, n = this.length
- if (m) {
- ap.unshift.apply(this.$model, arguments)
- mutateArray.call(this, "add", 0, m, 0)
- }
- return m + n //IE67的unshift不会返回长度
- },
- shift: function () {
- if (this.length) {
- var el = this.$model.shift()
- mutateArray.call(this, "del", 0, 1, 0)
- return el //返回被移除的元素
- }
- },
- pop: function () {
- var n = this.length
- if (n) {
- var el = this.$model.pop()
- mutateArray.call(this, "del", n - 1, 1, Math.max(0, n - 2))
- return el //返回被移除的元素
- }
- },
- splice: function (start) {
- var m = arguments.length, args = [], change
- var removed = _splice.apply(this.$model, arguments)
- if (removed.length) { //如果用户删掉了元素
- args.push("del", start, removed.length, 0)
- change = true
- }
- if (m > 2) { //如果用户添加了元素
- if (change) {
- args.splice(3, 1, 0, "add", start, m - 2)
- } else {
- args.push("add", start, m - 2, 0)
- }
- change = true
- }
- if (change) { //返回被移除的元素
- return mutateArray.apply(this, args)
- } else {
- return []
- }
- },
- contains: function (el) { //判定是否包含
- return this.indexOf(el) !== -1
- },
- remove: function (el) { //移除第一个等于给定值的元素
- return this.removeAt(this.indexOf(el))
- },
- removeAt: function (index) { //移除指定索引上的元素
- if (index >= 0) {
- this.$model.splice(index, 1)
- return mutateArray.call(this, "del", index, 1, 0)
- }
- return []
- },
- clear: function () {
- recycleProxies(this.$proxy, "each")
- this.$model.length = this.$proxy.length = this.length = this._.length = 0 //清空数组
- this._fire("clear", 0)
- return this
- },
- removeAll: function (all) { //移除N个元素
- if (Array.isArray(all)) {
- all.forEach(function (el) {
- this.remove(el)
- }, this)
- } else if (typeof all === "function") {
- for (var i = this.length - 1; i >= 0; i--) {
- var el = this[i]
- if (all(el, i)) {
- this.removeAt(i)
- }
- }
- } else {
- this.clear()
- }
- },
- ensure: function (el) {
- if (!this.contains(el)) { //只有不存在才push
- this.push(el)
- }
- return this
- },
- set: function (index, val) {
- if (index >= 0) {
- var valueType = avalon.type(val)
- if (val && val.$model) {
- val = val.$model
- }
- var target = this[index]
- if (valueType === "object") {
- for (var i in val) {
- if (target.hasOwnProperty(i)) {
- target[i] = val[i]
- }
- }
- } else if (valueType === "array") {
- target.clear().push.apply(target, val)
- } else if (target !== val) {
- this[index] = val
- this.$model[index] = val
- var proxy = this.$proxy[index]
- if (proxy) {
- notifySubscribers(proxy.$events.el)
- }
- // this._fire("set", index, val)
- }
- }
- return this
- }
- }
-//相当于原来bindingExecutors.repeat 的index分支
- function resetIndex(array, pos) {
- var last = array.length - 1
- for (var el; el = array[pos]; pos++) {
- el.$index = pos
- el.$first = pos === 0
- el.$last = pos === last
- }
- }
-
- function sortByIndex(array, indexes) {
- var map = {};
- for (var i = 0, n = indexes.length; i < n; i++) {
- map[i] = array[i] // preserve
- var j = indexes[i]
- if (j in map) {
- array[i] = map[j]
- delete map[j]
- } else {
- array[i] = array[j]
- }
- }
- }
-
- "sort,reverse".replace(rword, function (method) {
- CollectionPrototype[method] = function () {
- var newArray = this.$model//这是要排序的新数组
- var oldArray = newArray.concat() //保持原来状态的旧数组
- var mask = Math.random()
- var indexes = []
- var hasSort
- ap[method].apply(newArray, arguments) //排序
- for (var i = 0, n = oldArray.length; i < n; i++) {
- var neo = newArray[i]
- var old = oldArray[i]
- if (isEqual(neo, old)) {
- indexes.push(i)
- } else {
- var index = oldArray.indexOf(neo)
- indexes.push(index)//得到新数组的每个元素在旧数组对应的位置
- oldArray[index] = mask //屏蔽已经找过的元素
- hasSort = true
- }
- }
- if (hasSort) {
- sortByIndex(this, indexes)
- sortByIndex(this.$proxy, indexes)
- this._fire("move", indexes)
- resetIndex(this.$proxy, 0)
- }
- return this
- }
- })
-
- /*********************************************************************
- * 依赖调度系统 *
- **********************************************************************/
- var ronduplex = /^(duplex|on)$/
-
- avalon.injectBinding = function (data) {
- Registry[expose] = data //暴光此函数,方便collectSubscribers收集
- avalon.openComputedCollect = true
- var fn = data.evaluator
- if (fn) { //如果是求值函数
- try {
- var c = ronduplex.test(data.type) ? data : fn.apply(0, data.args)
- if (!data.noRefresh)
- data.handler(c, data.element, data)
- } catch (e) {
- //log("warning:exception throwed in [avalon.injectBinding] " + e)
- delete data.evaluator
- var node = data.element
- if (node.nodeType === 3) {
- var parent = node.parentNode
- if (kernel.commentInterpolate) {
- parent.replaceChild(DOC.createComment(data.value), node)
- } else {
- node.data = openTag + data.value + closeTag
- }
- }
- }
- }
- avalon.openComputedCollect = false
- delete Registry[expose]
- }
-
- function collectSubscribers(list) { //收集依赖于这个访问器的订阅者
- var data = Registry[expose]
- if (list && data && avalon.Array.ensure(list, data) && data.element) { //只有数组不存在此元素才push进去
- addSubscribers(data, list)
- }
- }
-
-
- function addSubscribers(data, list) {
- data.$uuid = data.$uuid || generateID()
- list.$uuid = list.$uuid || generateID()
- var obj = {
- data: data,
- list: list,
- $$uuid: data.$uuid + list.$uuid
- }
- if (!$$subscribers[obj.$$uuid]) {
- $$subscribers[obj.$$uuid] = 1
- $$subscribers.push(obj)
- }
- }
-
- function disposeData(data) {
- data.element = null
- data.rollback && data.rollback()
- for (var key in data) {
- data[key] = null
- }
- }
-
- function isRemove(el) {
- try {//IE下,如果文本节点脱离DOM树,访问parentNode会报错
- if (!el.parentNode) {
- return true
- }
- } catch (e) {
- return true
- }
- return el.msRetain ? 0 : (el.nodeType === 1 ? typeof el.sourceIndex === "number" ?
- el.sourceIndex === 0 : !root.contains(el) : !avalon.contains(root, el))
- }
-
- var $$subscribers = avalon.$$subscribers = []
- var beginTime = new Date()
- var oldInfo = {}
-
- function removeSubscribers() {
- var i = $$subscribers.length
- var n = i
- var k = 0
- var obj
- var types = []
- var newInfo = {}
- var needTest = {}
- while (obj = $$subscribers[--i]) {
- var data = obj.data
- var type = data.type
- if (newInfo[type]) {
- newInfo[type]++
- } else {
- newInfo[type] = 1
- types.push(type)
- }
- }
- var diff = false
- types.forEach(function (type) {
- if (oldInfo[type] !== newInfo[type]) {
- needTest[type] = 1
- diff = true
- }
- })
- i = n
- //avalon.log("需要检测的个数 " + i)
- if (diff) {
- //avalon.log("有需要移除的元素")
- while (obj = $$subscribers[--i]) {
- data = obj.data
- if (data.element === void 0)
- continue
- if (needTest[data.type] && isRemove(data.element)) { //如果它没有在DOM树
- k++
- $$subscribers.splice(i, 1)
- delete $$subscribers[obj.$$uuid]
- avalon.Array.remove(obj.list, data)
- //log("debug: remove " + data.type)
- disposeData(data)
- obj.data = obj.list = null
- }
- }
- }
- oldInfo = newInfo
- // avalon.log("已经移除的个数 " + k)
- beginTime = new Date()
- }
-
- function notifySubscribers(list) { //通知依赖于这个访问器的订阅者更新自身
- if (list && list.length) {
- if (new Date() - beginTime > 444 && typeof list[0] === "object") {
- removeSubscribers()
- }
- var args = aslice.call(arguments, 1)
- for (var i = list.length, fn; fn = list[--i];) {
- var el = fn.element
- if (el && el.parentNode) {
- if (fn.$repeat) {
- fn.handler.apply(fn, args) //处理监控数组的方法
- } else if (fn.type !== "on") { //事件绑定只能由用户触发,不能由程序触发
- var fun = fn.evaluator || noop
- fn.handler(fun.apply(0, fn.args || []), el, fn)
- }
- }
- }
- }
- }
-
- /************************************************************************
- * HTML处理(parseHTML, innerHTML, clearHTML) *
- **************************************************************************/
-//parseHTML的辅助变量
- var tagHooks = new function () {// jshint ignore:line
- avalon.mix(this, {
- option: DOC.createElement("select"),
- thead: DOC.createElement("table"),
- td: DOC.createElement("tr"),
- area: DOC.createElement("map"),
- tr: DOC.createElement("tbody"),
- col: DOC.createElement("colgroup"),
- legend: DOC.createElement("fieldset"),
- _default: DOC.createElement("div"),
- "g": DOC.createElementNS("http://www.w3.org/2000/svg", "svg")
- })
- this.optgroup = this.option
- this.tbody = this.tfoot = this.colgroup = this.caption = this.thead
- this.th = this.td
- }// jshint ignore:line
-
- String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(rword, function (tag) {
- tagHooks[tag] = tagHooks.g //处理SVG
- })
- var rtagName = /<([\w:]+)/
- var rxhtml = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig
- var scriptTypes = oneObject(["", "text/javascript", "text/ecmascript", "application/ecmascript", "application/javascript"])
- var script = DOC.createElement("script")
- var rhtml = /<|&#?\w+;/
- avalon.parseHTML = function (html) {
- var fragment = hyperspace.cloneNode(false)
- if (typeof html !== "string") {
- return fragment
- }
- if (!rhtml.test(html)) {
- fragment.appendChild(DOC.createTextNode(html))
- return fragment
- }
- html = html.replace(rxhtml, "<$1></$2>").trim()
- var tag = (rtagName.exec(html) || ["", ""])[1].toLowerCase(),
- //取得其标签名
- wrapper = tagHooks[tag] || tagHooks._default,
- firstChild
- wrapper.innerHTML = html
- var els = wrapper.getElementsByTagName("script")
- if (els.length) { //使用innerHTML生成的script节点不会发出请求与执行text属性
- for (var i = 0, el; el = els[i++];) {
- if (scriptTypes[el.type]) {
- var neo = script.cloneNode(false) //FF不能省略参数
- ap.forEach.call(el.attributes, function (attr) {
- neo.setAttribute(attr.name, attr.value)
- })// jshint ignore:line
- neo.text = el.text
- el.parentNode.replaceChild(neo, el)
- }
- }
- }
-
- while (firstChild = wrapper.firstChild) { // 将wrapper上的节点转移到文档碎片上!
- fragment.appendChild(firstChild)
- }
- return fragment
- }
-
- avalon.innerHTML = function (node, html) {
- var a = this.parseHTML(html)
- this.clearHTML(node).appendChild(a)
- }
-
- avalon.clearHTML = function (node) {
- node.textContent = ""
- while (node.firstChild) {
- node.removeChild(node.firstChild)
- }
- return node
- }
-
- /*********************************************************************
- * 扫描系统 *
- **********************************************************************/
-
- avalon.scan = function (elem, vmodel) {
- elem = elem || root
- var vmodels = vmodel ? [].concat(vmodel) : []
- scanTag(elem, vmodels)
- }
-
-//http://www.w3.org/TR/html5/syntax.html#void-elements
- var stopScan = oneObject("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase())
-
- function checkScan(elem, callback, innerHTML) {
- var id = setTimeout(function () {
- var currHTML = elem.innerHTML
- clearTimeout(id)
- if (currHTML === innerHTML) {
- callback()
- } else {
- checkScan(elem, callback, currHTML)
- }
- })
- }
-
-
- function createSignalTower(elem, vmodel) {
- var id = elem.getAttribute("avalonctrl") || vmodel.$id
- elem.setAttribute("avalonctrl", id)
- vmodel.$events.expr = elem.tagName + '[avalonctrl="' + id + '"]'
- }
-
- var getBindingCallback = function (elem, name, vmodels) {
- var callback = elem.getAttribute(name)
- if (callback) {
- for (var i = 0, vm; vm = vmodels[i++];) {
- if (vm.hasOwnProperty(callback) && typeof vm[callback] === "function") {
- return vm[callback]
- }
- }
- }
- }
-
- function executeBindings(bindings, vmodels) {
- for (var i = 0, data; data = bindings[i++];) {
- data.vmodels = vmodels
- bindingHandlers[data.type](data, vmodels)
- if (data.evaluator && data.element && data.element.nodeType === 1) { //移除数据绑定,防止被二次解析
- //chrome使用removeAttributeNode移除不存在的特性节点时会报错 https://github.com/RubyLouvre/avalon/issues/99
- data.element.removeAttribute(data.name)
- }
- }
- bindings.length = 0
- }
-
-//https://github.com/RubyLouvre/avalon/issues/636
- var mergeTextNodes = IEVersion && window.MutationObserver ? function (elem) {
- var node = elem.firstChild, text
- while (node) {
- var aaa = node.nextSibling
- if (node.nodeType === 3) {
- if (text) {
- text.nodeValue += node.nodeValue
- elem.removeChild(node)
- } else {
- text = node
- }
- } else {
- text = null
- }
- node = aaa
- }
- } : 0
-
- var rmsAttr = /ms-(\w+)-?(.*)/
- var priorityMap = {
- "if": 10,
- "repeat": 90,
- "data": 100,
- "widget": 110,
- "each": 1400,
- "with": 1500,
- "duplex": 2000,
- "on": 3000
- }
-
- var events = oneObject("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit")
- var obsoleteAttrs = oneObject("value,title,alt,checked,selected,disabled,readonly,enabled")
-
- function bindingSorter(a, b) {
- return a.priority - b.priority
- }
-
- function scanAttr(elem, vmodels) {
- //防止setAttribute, removeAttribute时 attributes自动被同步,导致for循环出错
- var attributes = elem.hasAttributes() ? avalon.slice(elem.attributes) : []
- var bindings = [],
- msData = createMap(),
- match
- for (var i = 0, attr; attr = attributes[i++];) {
- if (attr.specified) {
- if (match = attr.name.match(rmsAttr)) {
- //如果是以指定前缀命名的
- var type = match[1]
- var param = match[2] || ""
- var value = attr.value
- var name = attr.name
- msData[name] = value
- if (events[type]) {
- param = type
- type = "on"
- } else if (obsoleteAttrs[type]) {
- log("warning!请改用ms-attr-" + type + "代替ms-" + type + "!")
- if (type === "enabled") {//吃掉ms-enabled绑定,用ms-disabled代替
- log("warning!ms-enabled或ms-attr-enabled已经被废弃")
- type = "disabled"
- value = "!(" + value + ")"
- }
- param = type
- type = "attr"
- elem.removeAttribute(name)
- name = "ms-attr-" + param
- elem.setAttribute(name, value)
- match = [name]
- msData[name] = value
- }
- if (typeof bindingHandlers[type] === "function") {
- var binding = {
- type: type,
- param: param,
- element: elem,
- name: match[0],
- value: value,
- priority: type in priorityMap ? priorityMap[type] : type.charCodeAt(0) * 10 + (Number(param) || 0)
- }
- if (type === "html" || type === "text") {
- var token = getToken(value)
- avalon.mix(binding, token)
- binding.filters = binding.filters.replace(rhasHtml, function () {
- binding.type = "html"
- binding.group = 1
- return ""
- })// jshint ignore:line
- }
- if (name === "ms-if-loop") {
- binding.priority += 100
- }
- if (vmodels.length) {
- bindings.push(binding)
- if (type === "widget") {
- elem.msData = elem.msData || msData
- }
- }
- }
- }
- }
- }
- var control = elem.type
- if (control && msData["ms-duplex"]) {
- if (msData["ms-attr-checked"] && /radio|checkbox/.test(control)) {
- log("warning!" + control + "控件不能同时定义ms-attr-checked与ms-duplex")
- }
- if (msData["ms-attr-value"] && /text|password/.test(control)) {
- log("warning!" + control + "控件不能同时定义ms-attr-value与ms-duplex")
- }
- }
- bindings.sort(bindingSorter)
- var scanNode = true
- for (i = 0; binding = bindings[i]; i++) {
- type = binding.type
- if (rnoscanAttrBinding.test(type)) {
- return executeBindings(bindings.slice(0, i + 1), vmodels)
- } else if (scanNode) {
- scanNode = !rnoscanNodeBinding.test(type)
- }
- }
- executeBindings(bindings, vmodels)
- if (scanNode && !stopScan[elem.tagName] && rbind.test(elem.innerHTML + elem.textContent)) {
- mergeTextNodes && mergeTextNodes(elem)
- scanNodeList(elem, vmodels) //扫描子孙元素
- }
- }
-
- var rnoscanAttrBinding = /^if|widget|repeat$/
- var rnoscanNodeBinding = /^each|with|html|include$/
-
- function scanNodeList(parent, vmodels) {
- var node = parent.firstChild
- while (node) {
- var nextNode = node.nextSibling
- scanNode(node, node.nodeType, vmodels)
- node = nextNode
- }
- }
-
- function scanNodeArray(nodes, vmodels) {
- for (var i = 0, node; node = nodes[i++];) {
- scanNode(node, node.nodeType, vmodels)
- }
- }
-
- function scanNode(node, nodeType, vmodels) {
- if (nodeType === 1) {
- scanTag(node, vmodels) //扫描元素节点
- if (node.msCallback) {
- node.msCallback()
- node.msCallback = void 0
- }
- } else if (nodeType === 3 && rexpr.test(node.data)) {
- scanText(node, vmodels) //扫描文本节点
- } else if (kernel.commentInterpolate && nodeType === 8 && !rexpr.test(node.nodeValue)) {
- scanText(node, vmodels) //扫描注释节点
- }
- }
-
- function scanTag(elem, vmodels, node) {
- //扫描顺序 ms-skip(0) --> ms-important(1) --> ms-controller(2) --> ms-if(10) --> ms-repeat(100)
- //--> ms-if-loop(110) --> ms-attr(970) ...--> ms-each(1400)-->ms-with(1500)--〉ms-duplex(2000)垫后
- var a = elem.getAttribute("ms-skip")
- var b = elem.getAttributeNode("ms-important")
- var c = elem.getAttributeNode("ms-controller")
- if (typeof a === "string") {
- return
- } else if (node = b || c) {
- var newVmodel = avalon.vmodels[node.value]
- if (!newVmodel) {
- return
- }
- //ms-important不包含父VM,ms-controller相反
- vmodels = node === b ? [newVmodel] : [newVmodel].concat(vmodels)
- elem.removeAttribute(node.name) //removeAttributeNode不会刷新[ms-controller]样式规则
- elem.classList.remove(node.name)
- createSignalTower(elem, newVmodel)
- }
- scanAttr(elem, vmodels) //扫描特性节点
- }
-
- var rhasHtml = /\|\s*html\s*/,
- r11a = /\|\|/g,
- rlt = /&lt;/g,
- rgt = /&gt;/g,
- rstringLiteral = /(['"])(\\\1|.)+?\1/g
-
- function getToken(value) {
- if (value.indexOf("|") > 0) {
- var scapegoat = value.replace(rstringLiteral, function (_) {
- return Array(_.length + 1).join("1")// jshint ignore:line
- })
- var index = scapegoat.replace(r11a, "\u1122\u3344").indexOf("|") //干掉所有短路或
- if (index > -1) {
- return {
- filters: value.slice(index),
- value: value.slice(0, index),
- expr: true
- }
- }
- }
- return {
- value: value,
- filters: "",
- expr: true
- }
- }
-
- function scanExpr(str) {
- var tokens = [],
- value, start = 0,
- stop
- do {
- stop = str.indexOf(openTag, start)
- if (stop === -1) {
- break
- }
- value = str.slice(start, stop)
- if (value) { // {{ 左边的文本
- tokens.push({
- value: value,
- filters: "",
- expr: false
- })
- }
- start = stop + openTag.length
- stop = str.indexOf(closeTag, start)
- if (stop === -1) {
- break
- }
- value = str.slice(start, stop)
- if (value) { //处理{{ }}插值表达式
- tokens.push(getToken(value))
- }
- start = stop + closeTag.length
- } while (1)
- value = str.slice(start)
- if (value) { //}} 右边的文本
- tokens.push({
- value: value,
- expr: false,
- filters: ""
- })
- }
- return tokens
- }
-
- function scanText(textNode, vmodels) {
- var bindings = []
- if (textNode.nodeType === 8) {
- var token = getToken(textNode.nodeValue)
- var tokens = [token]
- } else {
- tokens = scanExpr(textNode.data)
- }
- if (tokens.length) {
- for (var i = 0; token = tokens[i++];) {
- var node = DOC.createTextNode(token.value) //将文本转换为文本节点,并替换原来的文本节点
- if (token.expr) {
- token.type = "text"
- token.element = node
- token.filters = token.filters.replace(rhasHtml, function () {
- token.type = "html"
- token.group = 1
- return ""
- })// jshint ignore:line
- bindings.push(token) //收集带有插值表达式的文本
- }
- hyperspace.appendChild(node)
- }
- textNode.parentNode.replaceChild(hyperspace, textNode)
- if (bindings.length)
- executeBindings(bindings, vmodels)
- }
- }
-
- /*********************************************************************
- * avalon的原型方法定义区 *
- **********************************************************************/
-
- function hyphen(target) {
- //转换为连字符线风格
- return target.replace(/([a-z\d])([A-Z]+)/g, "$1-$2").toLowerCase()
- }
-
- function camelize(target) {
- //转换为驼峰风格
- if (target.indexOf("-") < 0 && target.indexOf("_") < 0) {
- return target //提前判断,提高getStyle等的效率
- }
- return target.replace(/[-_][^-_]/g, function (match) {
- return match.charAt(1).toUpperCase()
- })
- }
-
- "add,remove".replace(rword, function (method) {
- avalon.fn[method + "Class"] = function (cls) {
- var el = this[0]
- //https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/26
- if (cls && typeof cls === "string" && el && el.nodeType === 1) {
- cls.replace(/\S+/g, function (c) {
- el.classList[method](c)
- })
- }
- return this
- }
- })
-
- avalon.fn.mix({
- hasClass: function (cls) {
- var el = this[0] || {} //IE10+, chrome8+, firefox3.6+, safari5.1+,opera11.5+支持classList,chrome24+,firefox26+支持classList2.0
- return el.nodeType === 1 && el.classList.contains(cls)
- },
- toggleClass: function (value, stateVal) {
- var className, i = 0
- var classNames = String(value).split(/\s+/)
- var isBool = typeof stateVal === "boolean"
- while ((className = classNames[i++])) {
- var state = isBool ? stateVal : !this.hasClass(className)
- this[state ? "addClass" : "removeClass"](className)
- }
- return this
- },
- attr: function (name, value) {
- if (arguments.length === 2) {
- this[0].setAttribute(name, value)
- return this
- } else {
- return this[0].getAttribute(name)
- }
- },
- data: function (name, value) {
- name = "data-" + hyphen(name || "")
- switch (arguments.length) {
- case 2:
- this.attr(name, value)
- return this
- case 1:
- var val = this.attr(name)
- return parseData(val)
- case 0:
- var ret = {}
- ap.forEach.call(this[0].attributes, function (attr) {
- if (attr) {
- name = attr.name
- if (!name.indexOf("data-")) {
- name = camelize(name.slice(5))
- ret[name] = parseData(attr.value)
- }
- }
- })
- return ret
- }
- },
- removeData: function (name) {
- name = "data-" + hyphen(name)
- this[0].removeAttribute(name)
- return this
- },
- css: function (name, value) {
- if (avalon.isPlainObject(name)) {
- for (var i in name) {
- avalon.css(this, i, name[i])
- }
- } else {
- var ret = avalon.css(this, name, value)
- }
- return ret !== void 0 ? ret : this
- },
- position: function () {
- var offsetParent, offset,
- elem = this[0],
- parentOffset = {
- top: 0,
- left: 0
- };
- if (!elem) {
- return
- }
- if (this.css("position") === "fixed") {
- offset = elem.getBoundingClientRect()
- } else {
- offsetParent = this.offsetParent() //得到真正的offsetParent
- offset = this.offset() // 得到正确的offsetParent
- if (offsetParent[0].tagName !== "HTML") {
- parentOffset = offsetParent.offset()
- }
- parentOffset.top += avalon.css(offsetParent[0], "borderTopWidth", true)
- parentOffset.left += avalon.css(offsetParent[0], "borderLeftWidth", true)
- // Subtract offsetParent scroll positions
- parentOffset.top -= offsetParent.scrollTop()
- parentOffset.left -= offsetParent.scrollLeft()
- }
- return {
- top: offset.top - parentOffset.top - avalon.css(elem, "marginTop", true),
- left: offset.left - parentOffset.left - avalon.css(elem, "marginLeft", true)
- }
- },
- offsetParent: function () {
- var offsetParent = this[0].offsetParent
- while (offsetParent && avalon.css(offsetParent, "position") === "static") {
- offsetParent = offsetParent.offsetParent;
- }
- return avalon(offsetParent || root)
- },
- bind: function (type, fn, phase) {
- if (this[0]) { //此方法不会链
- return avalon.bind(this[0], type, fn, phase)
- }
- },
- unbind: function (type, fn, phase) {
- if (this[0]) {
- avalon.unbind(this[0], type, fn, phase)
- }
- return this
- },
- val: function (value) {
- var node = this[0]
- if (node && node.nodeType === 1) {
- var get = arguments.length === 0
- var access = get ? ":get" : ":set"
- var fn = valHooks[getValType(node) + access]
- if (fn) {
- var val = fn(node, value)
- } else if (get) {
- return (node.value || "").replace(/\r/g, "")
- } else {
- node.value = value
- }
- }
- return get ? val : this
- }
- })
-
- if (root.dataset) {
- avalon.fn.data = function (name, val) {
- name = name && camelize(name)
- var dataset = this[0].dataset
- switch (arguments.length) {
- case 2:
- dataset[name] = val
- return this
- case 1:
- val = dataset[name]
- return parseData(val)
- case 0:
- var ret = createMap()
- for (name in dataset) {
- ret[name] = parseData(dataset[name])
- }
- return ret
- }
- }
- }
- var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/
- avalon.parseJSON = JSON.parse
-
- function parseData(data) {
- try {
- if (typeof data === "object")
- return data
- data = data === "true" ? true :
- data === "false" ? false :
- data === "null" ? null : +data + "" === data ? +data : rbrace.test(data) ? JSON.parse(data) : data
- } catch (e) {
- }
- return data
- }
-
- avalon.each({
- scrollLeft: "pageXOffset",
- scrollTop: "pageYOffset"
- }, function (method, prop) {
- avalon.fn[method] = function (val) {
- var node = this[0] || {}, win = getWindow(node),
- top = method === "scrollTop"
- if (!arguments.length) {
- return win ? win[prop] : node[method]
- } else {
- if (win) {
- win.scrollTo(!top ? val : win[prop], top ? val : win[prop])
- } else {
- node[method] = val
- }
- }
- }
- })
-
- function getWindow(node) {
- return node.window && node.document ? node : node.nodeType === 9 ? node.defaultView : false
- }
-
-//=============================css相关==================================
- var cssHooks = avalon.cssHooks = createMap()
- var prefixes = ["", "-webkit-", "-moz-", "-ms-"] //去掉opera-15的支持
- var cssMap = {
- "float": "cssFloat"
- }
- avalon.cssNumber = oneObject("columnCount,order,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom")
-
- avalon.cssName = function (name, host, camelCase) {
- if (cssMap[name]) {
- return cssMap[name]
- }
- host = host || root.style
- for (var i = 0, n = prefixes.length; i < n; i++) {
- camelCase = camelize(prefixes[i] + name)
- if (camelCase in host) {
- return (cssMap[name] = camelCase)
- }
- }
- return null
- }
- cssHooks["@:set"] = function (node, name, value) {
- node.style[name] = value
- }
-
- cssHooks["@:get"] = function (node, name) {
- if (!node || !node.style) {
- throw new Error("getComputedStyle要求传入一个节点 " + node)
- }
- var ret, computed = getComputedStyle(node)
- if (computed) {
- ret = name === "filter" ? computed.getPropertyValue(name) : computed[name]
- if (ret === "") {
- ret = node.style[name] //其他浏览器需要我们手动取内联样式
- }
- }
- return ret
- }
- cssHooks["opacity:get"] = function (node) {
- var ret = cssHooks["@:get"](node, "opacity")
- return ret === "" ? "1" : ret
- }
-
- "top,left".replace(rword, function (name) {
- cssHooks[name + ":get"] = function (node) {
- var computed = cssHooks["@:get"](node, name)
- return /px$/.test(computed) ? computed :
- avalon(node).position()[name] + "px"
- }
- })
- var cssShow = {
- position: "absolute",
- visibility: "hidden",
- display: "block"
- }
- var rdisplayswap = /^(none|table(?!-c[ea]).+)/
-
- function showHidden(node, array) {
- //http://www.cnblogs.com/rubylouvre/archive/2012/10/27/2742529.html
- if (node.offsetWidth <= 0) { //opera.offsetWidth可能小于0
- var styles = getComputedStyle(node, null)
- if (rdisplayswap.test(styles["display"])) {
- var obj = {
- node: node
- }
- for (var name in cssShow) {
- obj[name] = styles[name]
- node.style[name] = cssShow[name]
- }
- array.push(obj)
- }
- var parent = node.parentNode
- if (parent && parent.nodeType === 1) {
- showHidden(parent, array)
- }
- }
- }
-
- "Width,Height".replace(rword, function (name) { //fix 481
- var method = name.toLowerCase(),
- clientProp = "client" + name,
- scrollProp = "scroll" + name,
- offsetProp = "offset" + name
- cssHooks[method + ":get"] = function (node, which, override) {
- var boxSizing = -4
- if (typeof override === "number") {
- boxSizing = override
- }
- which = name === "Width" ? ["Left", "Right"] : ["Top", "Bottom"]
- var ret = node[offsetProp] // border-box 0
- if (boxSizing === 2) { // margin-box 2
- return ret + avalon.css(node, "margin" + which[0], true) + avalon.css(node, "margin" + which[1], true)
- }
- if (boxSizing < 0) { // padding-box -2
- ret = ret - avalon.css(node, "border" + which[0] + "Width", true) - avalon.css(node, "border" + which[1] + "Width", true)
- }
- if (boxSizing === -4) { // content-box -4
- ret = ret - avalon.css(node, "padding" + which[0], true) - avalon.css(node, "padding" + which[1], true)
- }
- return ret
- }
- cssHooks[method + "&get"] = function (node) {
- var hidden = [];
- showHidden(node, hidden);
- var val = cssHooks[method + ":get"](node)
- for (var i = 0, obj; obj = hidden[i++];) {
- node = obj.node
- for (var n in obj) {
- if (typeof obj[n] === "string") {
- node.style[n] = obj[n]
- }
- }
- }
- return val;
- }
- avalon.fn[method] = function (value) { //会忽视其display
- var node = this[0]
- if (arguments.length === 0) {
- if (node.setTimeout) { //取得窗口尺寸,IE9后可以用node.innerWidth /innerHeight代替
- return node["inner" + name]
- }
- if (node.nodeType === 9) { //取得页面尺寸
- var doc = node.documentElement
- //FF chrome html.scrollHeight< body.scrollHeight
- //IE 标准模式 : html.scrollHeight> body.scrollHeight
- //IE 怪异模式 : html.scrollHeight 最大等于可视窗口多一点?
- return Math.max(node.body[scrollProp], doc[scrollProp], node.body[offsetProp], doc[offsetProp], doc[clientProp])
- }
- return cssHooks[method + "&get"](node)
- } else {
- return this.css(method, value)
- }
- }
- avalon.fn["inner" + name] = function () {
- return cssHooks[method + ":get"](this[0], void 0, -2)
- }
- avalon.fn["outer" + name] = function (includeMargin) {
- return cssHooks[method + ":get"](this[0], void 0, includeMargin === true ? 2 : 0)
- }
- })
- avalon.fn.offset = function () { //取得距离页面左右角的坐标
- var node = this[0]
- try {
- var rect = node.getBoundingClientRect()
- // Make sure element is not hidden (display: none) or disconnected
- // https://github.com/jquery/jquery/pull/2043/files#r23981494
- if (rect.width || rect.height || node.getClientRects().length) {
- var doc = node.ownerDocument
- var root = doc.documentElement
- var win = doc.defaultView
- return {
- top: rect.top + win.pageYOffset - root.clientTop,
- left: rect.left + win.pageXOffset - root.clientLeft
- }
- }
- } catch (e) {
- return {
- left: 0,
- top: 0
- }
- }
- }
- //=============================val相关=======================
-
- function getValType(elem) {
- var ret = elem.tagName.toLowerCase()
- return ret === "input" && /checkbox|radio/.test(elem.type) ? "checked" : ret
- }
-
- var valHooks = {
- "select:get": function (node, value) {
- var option, options = node.options,
- index = node.selectedIndex,
- one = node.type === "select-one" || index < 0,
- values = one ? null : [],
- max = one ? index + 1 : options.length,
- i = index < 0 ? max : one ? index : 0
- for (; i < max; i++) {
- option = options[i]
- //旧式IE在reset后不会改变selected,需要改用i === index判定
- //我们过滤所有disabled的option元素,但在safari5下,如果设置select为disable,那么其所有孩子都disable
- //因此当一个元素为disable,需要检测其是否显式设置了disable及其父节点的disable情况
- if ((option.selected || i === index) && !option.disabled) {
- value = option.value
- if (one) {
- return value
- }
- //收集所有selected值组成数组返回
- values.push(value)
- }
- }
- return values
- },
- "select:set": function (node, values, optionSet) {
- values = [].concat(values) //强制转换为数组
- for (var i = 0, el; el = node.options[i++];) {
- if ((el.selected = values.indexOf(el.value) > -1)) {
- optionSet = true
- }
- }
- if (!optionSet) {
- node.selectedIndex = -1
- }
- }
- }
- /*********************************************************************
- * 编译系统 *
- **********************************************************************/
- var quote = JSON.stringify
-
- var keywords = [
- "break,case,catch,continue,debugger,default,delete,do,else,false",
- "finally,for,function,if,in,instanceof,new,null,return,switch,this",
- "throw,true,try,typeof,var,void,while,with", /* 关键字*/
- "abstract,boolean,byte,char,class,const,double,enum,export,extends",
- "final,float,goto,implements,import,int,interface,long,native",
- "package,private,protected,public,short,static,super,synchronized",
- "throws,transient,volatile", /*保留字*/
- "arguments,let,yield,undefined" /* ECMA 5 - use strict*/].join(",")
- var rrexpstr = /\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g
- var rsplit = /[^\w$]+/g
- var rkeywords = new RegExp(["\\b" + keywords.replace(/,/g, '\\b|\\b') + "\\b"].join('|'), 'g')
- var rnumber = /\b\d[^,]*/g
- var rcomma = /^,+|,+$/g
- var cacheVars = new Cache(512)
- var getVariables = function (code) {
- var key = "," + code.trim()
- var ret = cacheVars.get(key)
- if (ret) {
- return ret
- }
- var match = code
- .replace(rrexpstr, "")
- .replace(rsplit, ",")
- .replace(rkeywords, "")
- .replace(rnumber, "")
- .replace(rcomma, "")
- .split(/^$|,+/)
- return cacheVars.put(key, uniqSet(match))
- }
- /*添加赋值语句*/
-
- function addAssign(vars, scope, name, data) {
- var ret = [],
- prefix = " = " + name + "."
- var isProxy = /\$proxy\$each/.test(scope.$id)
- for (var i = vars.length, prop; prop = vars[--i];) {
- var el = isProxy && scope.$map[prop] ? "el" : prop
- if (scope.hasOwnProperty(el)) {
- ret.push(prop + prefix + el)
- data.vars.push(prop)
- if (data.type === "duplex") {
- vars.get = name + "." + el
- }
- vars.splice(i, 1)
- }
- }
- return ret
- }
-
- function uniqSet(array) {
- var ret = [],
- unique = {}
- for (var i = 0; i < array.length; i++) {
- var el = array[i]
- var id = el && typeof el.$id === "string" ? el.$id : el
- if (!unique[id]) {
- unique[id] = ret.push(el)
- }
- }
- return ret
- }
-
-//缓存求值函数,以便多次利用
- var cacheExprs = new Cache(128)
-//取得求值函数及其传参
- var rduplex = /\w\[.*\]|\w\.\w/
- var rproxy = /(\$proxy\$[a-z]+)\d+$/
- var rthimRightParentheses = /\)\s*$/
- var rthimOtherParentheses = /\)\s*\|/g
- var rquoteFilterName = /\|\s*([$\w]+)/g
- var rpatchBracket = /"\s*\["/g
- var rthimLeftParentheses = /"\s*\(/g
-
- function parseFilter(val, filters) {
- filters = filters
- .replace(rthimRightParentheses, "")//处理最后的小括号
- .replace(rthimOtherParentheses, function () {//处理其他小括号
- return "],|"
- })
- .replace(rquoteFilterName, function (a, b) { //处理|及它后面的过滤器的名字
- return "[" + quote(b)
- })
- .replace(rpatchBracket, function () {
- return '"],["'
- })
- .replace(rthimLeftParentheses, function () {
- return '",'
- }) + "]"
- return "return avalon.filters.$filter(" + val + ", " + filters + ")"
- }
-
- function parseExpr(code, scopes, data) {
- var dataType = data.type
- var filters = data.filters || ""
- var exprId = scopes.map(function (el) {
- return String(el.$id).replace(rproxy, "$1")
- }) + code + dataType + filters
- var vars = getVariables(code).concat(),
- assigns = [],
- names = [],
- args = [],
- prefix = ""
- //args 是一个对象数组, names 是将要生成的求值函数的参数
- scopes = uniqSet(scopes)
- data.vars = []
- for (var i = 0, sn = scopes.length; i < sn; i++) {
- if (vars.length) {
- var name = "vm" + expose + "_" + i
- names.push(name)
- args.push(scopes[i])
- assigns.push.apply(assigns, addAssign(vars, scopes[i], name, data))
- }
- }
- if (!assigns.length && dataType === "duplex") {
- return
- }
- if (dataType !== "duplex" && (code.indexOf("||") > -1 || code.indexOf("&&") > -1)) {
- //https://github.com/RubyLouvre/avalon/issues/583
- data.vars.forEach(function (v) {
- var reg = new RegExp("\\b" + v + "(?:\\.\\w+|\\[\\w+\\])+", "ig")
- code = code.replace(reg, function (_) {
- var c = _.charAt(v.length)
- var r = IEVersion ? code.slice(arguments[1] + _.length) : RegExp.rightContext
- var method = /^\s*\(/.test(r)
- if (c === "." || c === "[" || method) {//比如v为aa,我们只匹配aa.bb,aa[cc],不匹配aaa.xxx
- var name = "var" + String(Math.random()).replace(/^0\./, "")
- if (method) {//array.size()
- var array = _.split(".")
- if (array.length > 2) {
- var last = array.pop()
- assigns.push(name + " = " + array.join("."))
- return name + "." + last
- } else {
- return _
- }
- }
- assigns.push(name + " = " + _)
- return name
- } else {
- return _
- }
- })
- })
- }
- //---------------args----------------
- data.args = args
- //---------------cache----------------
- var fn = cacheExprs.get(exprId) //直接从缓存,免得重复生成
- if (fn) {
- data.evaluator = fn
- return
- }
- prefix = assigns.join(", ")
- if (prefix) {
- prefix = "var " + prefix
- }
- if (/\S/.test(filters)) { //文本绑定,双工绑定才有过滤器
- if (!/text|html/.test(data.type)) {
- throw Error("ms-" + data.type + "不支持过滤器")
- }
- code = "\nvar ret" + expose + " = " + code + ";\r\n"
- code += parseFilter("ret" + expose, filters)
- } else if (dataType === "duplex") { //双工绑定
- var _body = "'use strict';\nreturn function(vvv){\n\t" +
- prefix +
- ";\n\tif(!arguments.length){\n\t\treturn " +
- code +
- "\n\t}\n\t" + (!rduplex.test(code) ? vars.get : code) +
- "= vvv;\n} "
- try {
- fn = Function.apply(noop, names.concat(_body))
- data.evaluator = cacheExprs.put(exprId, fn)
- } catch (e) {
- log("debug: parse error," + e.message)
- }
- return
- } else if (dataType === "on") { //事件绑定
- if (code.indexOf("(") === -1) {
- code += ".call(this, $event)"
- } else {
- code = code.replace("(", ".call(this,")
- }
- names.push("$event")
- code = "\nreturn " + code + ";" //IE全家 Function("return ")出错,需要Function("return ;")
- var lastIndex = code.lastIndexOf("\nreturn")
- var header = code.slice(0, lastIndex)
- var footer = code.slice(lastIndex)
- code = header + "\n" + footer
- } else { //其他绑定
- code = "\nreturn " + code + ";" //IE全家 Function("return ")出错,需要Function("return ;")
- }
- try {
- fn = Function.apply(noop, names.concat("'use strict';\n" + prefix + code))
- data.evaluator = cacheExprs.put(exprId, fn)
- } catch (e) {
- log("debug: parse error," + e.message)
- } finally {
- vars = assigns = names = null //释放内存
- }
- }
-
-
-//parseExpr的智能引用代理
-
- function parseExprProxy(code, scopes, data, tokens, noRegister) {
- if (Array.isArray(tokens)) {
- code = tokens.map(function (el) {
- return el.expr ? "(" + el.value + ")" : quote(el.value)
- }).join(" + ")
- }
- parseExpr(code, scopes, data)
- if (data.evaluator && !noRegister) {
- data.handler = bindingExecutors[data.handlerName || data.type]
- //方便调试
- //这里非常重要,我们通过判定视图刷新函数的element是否在DOM树决定
- //将它移出订阅者列表
- avalon.injectBinding(data)
- }
- }
-
- avalon.parseExprProxy = parseExprProxy
- var bools = ["autofocus,autoplay,async,allowTransparency,checked,controls",
- "declare,disabled,defer,defaultChecked,defaultSelected",
- "contentEditable,isMap,loop,multiple,noHref,noResize,noShade",
- "open,readOnly,selected"
- ].join(",")
- var boolMap = {}
- bools.replace(rword, function (name) {
- boolMap[name.toLowerCase()] = name
- })
-
- var propMap = { //属性名映射
- "accept-charset": "acceptCharset",
- "char": "ch",
- "charoff": "chOff",
- "class": "className",
- "for": "htmlFor",
- "http-equiv": "httpEquiv"
- }
-
- var anomaly = ["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan",
- "dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight",
- "rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"
- ].join(",")
- anomaly.replace(rword, function (name) {
- propMap[name.toLowerCase()] = name
- })
-
- var rnoscripts = /<noscript.*?>(?:[\s\S]+?)<\/noscript>/img
- var rnoscriptText = /<noscript.*?>([\s\S]+?)<\/noscript>/im
-
- var getXHR = function () {
- return new (window.XMLHttpRequest || ActiveXObject)("Microsoft.XMLHTTP") // jshint ignore:line
- }
-
- var cacheTmpls = avalon.templateCache = {}
-
- bindingHandlers.attr = function (data, vmodels) {
- var text = data.value.trim(),
- simple = true
- if (text.indexOf(openTag) > -1 && text.indexOf(closeTag) > 2) {
- simple = false
- if (rexpr.test(text) && RegExp.rightContext === "" && RegExp.leftContext === "") {
- simple = true
- text = RegExp.$1
- }
- }
- if (data.type === "include") {
- var elem = data.element
- data.includeRendered = getBindingCallback(elem, "data-include-rendered", vmodels)
- data.includeLoaded = getBindingCallback(elem, "data-include-loaded", vmodels)
- var outer = data.includeReplace = !!avalon(elem).data("includeReplace")
- if (avalon(elem).data("includeCache")) {
- data.templateCache = {}
- }
- data.startInclude = DOC.createComment("ms-include")
- data.endInclude = DOC.createComment("ms-include-end")
- if (outer) {
- data.element = data.startInclude
- elem.parentNode.insertBefore(data.startInclude, elem)
- elem.parentNode.insertBefore(data.endInclude, elem.nextSibling)
- } else {
- elem.insertBefore(data.startInclude, elem.firstChild)
- elem.appendChild(data.endInclude)
- }
- }
- data.handlerName = "attr" //handleName用于处理多种绑定共用同一种bindingExecutor的情况
- parseExprProxy(text, vmodels, data, (simple ? 0 : scanExpr(data.value)))
- }
-
- bindingExecutors.attr = function (val, elem, data) {
- var method = data.type,
- attrName = data.param
- if (method === "css") {
- avalon(elem).css(attrName, val)
- } else if (method === "attr") {
- // ms-attr-class="xxx" vm.xxx="aaa bbb ccc"将元素的className设置为aaa bbb ccc
- // ms-attr-class="xxx" vm.xxx=false 清空元素的所有类名
- // ms-attr-name="yyy" vm.yyy="ooo" 为元素设置name属性
- var toRemove = (val === false) || (val === null) || (val === void 0)
-
- if (!W3C && propMap[attrName]) { //旧式IE下需要进行名字映射
- attrName = propMap[attrName]
- }
- var bool = boolMap[attrName]
- if (typeof elem[bool] === "boolean") {
- elem[bool] = !!val //布尔属性必须使用el.xxx = true|false方式设值
- if (!val) { //如果为false, IE全系列下相当于setAttribute(xxx,''),会影响到样式,需要进一步处理
- toRemove = true
- }
- }
- if (toRemove) {
- return elem.removeAttribute(attrName)
- }
-
- //SVG只能使用setAttribute(xxx, yyy), VML只能使用elem.xxx = yyy ,HTML的固有属性必须elem.xxx = yyy
- var isInnate = rsvg.test(elem) ? false : (DOC.namespaces && isVML(elem)) ? true : attrName in elem.cloneNode(false)
- if (isInnate) {
- elem[attrName] = val
- } else {
- elem.setAttribute(attrName, val)
- }
- } else if (method === "include" && val) {
- var vmodels = data.vmodels
- var rendered = data.includeRendered
- var loaded = data.includeLoaded
- var replace = data.includeReplace
- var target = replace ? elem.parentNode : elem
- var scanTemplate = function (text) {
- if (loaded) {
- var newText = loaded.apply(target, [text].concat(vmodels))
- if (typeof newText === "string")
- text = newText
- }
- if (rendered) {
- checkScan(target, function () {
- rendered.call(target)
- }, NaN)
- }
- var lastID = data.includeLastID
- if (data.templateCache && lastID && lastID !== val) {
- var lastTemplate = data.templateCache[lastID]
- if (!lastTemplate) {
- lastTemplate = data.templateCache[lastID] = DOC.createElement("div")
- ifGroup.appendChild(lastTemplate)
- }
- }
- data.includeLastID = val
- while (true) {
- var node = data.startInclude.nextSibling
- if (node && node !== data.endInclude) {
- target.removeChild(node)
- if (lastTemplate)
- lastTemplate.appendChild(node)
- } else {
- break
- }
- }
- var dom = getTemplateNodes(data, val, text)
- var nodes = avalon.slice(dom.childNodes)
- target.insertBefore(dom, data.endInclude)
- scanNodeArray(nodes, vmodels)
- }
-
- if (data.param === "src") {
- if (typeof cacheTmpls[val] === "string") {
- avalon.nextTick(function () {
- scanTemplate(cacheTmpls[val])
- })
- } else if (Array.isArray(cacheTmpls[val])) { //#805 防止在循环绑定中发出许多相同的请求
- cacheTmpls[val].push(scanTemplate)
- } else {
- var xhr = getXHR()
- xhr.onreadystatechange = function () {
- if (xhr.readyState === 4) {
- var s = xhr.status
- if (s >= 200 && s < 300 || s === 304 || s === 1223) {
- var text = xhr.responseText
- for (var f = 0, fn; fn = cacheTmpls[val][f++];) {
- fn(text)
- }
- cacheTmpls[val] = text
- }
- }
- }
- cacheTmpls[val] = [scanTemplate]
- xhr.open("GET", val, true)
- if ("withCredentials" in xhr) {
- xhr.withCredentials = true
- }
- xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest")
- xhr.send(null)
- }
- } else {
- //IE系列与够新的标准浏览器支持通过ID取得元素(firefox14+)
- //http://tjvantoll.com/2012/07/19/dom-element-references-as-global-variables/
- var el = val && val.nodeType === 1 ? val : DOC.getElementById(val)
- if (el) {
- if (el.tagName === "NOSCRIPT" && !(el.innerHTML || el.fixIE78)) { //IE7-8 innerText,innerHTML都无法取得其内容,IE6能取得其innerHTML
- xhr = getXHR() //IE9-11与chrome的innerHTML会得到转义的内容,它们的innerText可以
- xhr.open("GET", location, false) //谢谢Nodejs 乱炖群 深圳-纯属虚构
- xhr.send(null)
- //http://bbs.csdn.net/topics/390349046?page=1#post-393492653
- var noscripts = DOC.getElementsByTagName("noscript")
- var array = (xhr.responseText || "").match(rnoscripts) || []
- var n = array.length
- for (var i = 0; i < n; i++) {
- var tag = noscripts[i]
- if (tag) { //IE6-8中noscript标签的innerHTML,innerText是只读的
- tag.style.display = "none" //http://haslayout.net/css/noscript-Ghost-Bug
- tag.fixIE78 = (array[i].match(rnoscriptText) || ["", "&nbsp;"])[1]
- }
- }
- }
- avalon.nextTick(function () {
- scanTemplate(el.fixIE78 || el.value || el.innerText || el.innerHTML)
- })
- }
- }
- } else {
- if (!root.hasAttribute && typeof val === "string" && (method === "src" || method === "href")) {
- val = val.replace(/&amp;/g, "&") //处理IE67自动转义的问题
- }
- elem[method] = val
- if (window.chrome && elem.tagName === "EMBED") {
- var parent = elem.parentNode //#525 chrome1-37下embed标签动态设置src不能发生请求
- var comment = document.createComment("ms-src")
- parent.replaceChild(comment, elem)
- parent.replaceChild(elem, comment)
- }
- }
- }
-
- function getTemplateNodes(data, id, text) {
- var div = data.templateCache && data.templateCache[id]
- if (div) {
- var dom = DOC.createDocumentFragment(),
- firstChild
- while (firstChild = div.firstChild) {
- dom.appendChild(firstChild)
- }
- return dom
- }
- return avalon.parseHTML(text)
- }
-
-//这几个指令都可以使用插值表达式,如ms-src="aaa/{{b}}/{{c}}.html"
- "title,alt,src,value,css,include,href".replace(rword, function (name) {
- bindingHandlers[name] = bindingHandlers.attr
- })
-//根据VM的属性值或表达式的值切换类名,ms-class="xxx yyy zzz:flag"
-//http://www.cnblogs.com/rubylouvre/archive/2012/12/17/2818540.html
- bindingHandlers["class"] = function (data, vmodels) {
- var oldStyle = data.param,
- text = data.value,
- rightExpr
- data.handlerName = "class"
- if (!oldStyle || isFinite(oldStyle)) {
- data.param = "" //去掉数字
- var noExpr = text.replace(rexprg, function (a) {
- return a.replace(/./g, "0")
- //return Math.pow(10, a.length - 1) //将插值表达式插入10的N-1次方来占位
- })
- var colonIndex = noExpr.indexOf(":") //取得第一个冒号的位置
- if (colonIndex === -1) { // 比如 ms-class="aaa bbb ccc" 的情况
- var className = text
- } else { // 比如 ms-class-1="ui-state-active:checked" 的情况
- className = text.slice(0, colonIndex)
- rightExpr = text.slice(colonIndex + 1)
- parseExpr(rightExpr, vmodels, data) //决定是添加还是删除
- if (!data.evaluator) {
- log("debug: ms-class '" + (rightExpr || "").trim() + "' 不存在于VM中")
- return false
- } else {
- data._evaluator = data.evaluator
- data._args = data.args
- }
- }
- var hasExpr = rexpr.test(className) //比如ms-class="width{{w}}"的情况
- if (!hasExpr) {
- data.immobileClass = className
- }
- parseExprProxy("", vmodels, data, (hasExpr ? scanExpr(className) : 0))
- } else {
- data.immobileClass = data.oldStyle = data.param
- parseExprProxy(text, vmodels, data)
- }
- }
-
- bindingExecutors["class"] = function (val, elem, data) {
- var $elem = avalon(elem),
- method = data.type
- if (method === "class" && data.oldStyle) { //如果是旧风格
- $elem.toggleClass(data.oldStyle, !!val)
- } else {
- //如果存在冒号就有求值函数
- data.toggleClass = data._evaluator ? !!data._evaluator.apply(elem, data._args) : true
- data.newClass = data.immobileClass || val
- if (data.oldClass && data.newClass !== data.oldClass) {
- $elem.removeClass(data.oldClass)
- }
- data.oldClass = data.newClass
- switch (method) {
- case "class":
- $elem.toggleClass(data.newClass, data.toggleClass)
- break
- case "hover":
- case "active":
- if (!data.hasBindEvent) { //确保只绑定一次
- var activate = "mouseenter" //在移出移入时切换类名
- var abandon = "mouseleave"
- if (method === "active") { //在聚焦失焦中切换类名
- elem.tabIndex = elem.tabIndex || -1
- activate = "mousedown"
- abandon = "mouseup"
- var fn0 = $elem.bind("mouseleave", function () {
- data.toggleClass && $elem.removeClass(data.newClass)
- })
- }
- var fn1 = $elem.bind(activate, function () {
- data.toggleClass && $elem.addClass(data.newClass)
- })
- var fn2 = $elem.bind(abandon, function () {
- data.toggleClass && $elem.removeClass(data.newClass)
- })
- data.rollback = function () {
- $elem.unbind("mouseleave", fn0)
- $elem.unbind(activate, fn1)
- $elem.unbind(abandon, fn2)
- }
- data.hasBindEvent = true
- }
- break;
- }
- }
- }
-
- "hover,active".replace(rword, function (method) {
- bindingHandlers[method] = bindingHandlers["class"]
- })
-//ms-controller绑定已经在scanTag 方法中实现
-//ms-css绑定已由ms-attr绑定实现
-
-
-// bindingHandlers.data 定义在if.js
- bindingExecutors.data = function (val, elem, data) {
- var key = "data-" + data.param
- if (val && typeof val === "object") {
- elem[key] = val
- } else {
- elem.setAttribute(key, String(val))
- }
- }
-//双工绑定
- var duplexBinding = bindingHandlers.duplex = function (data, vmodels) {
- var elem = data.element,
- hasCast
- parseExprProxy(data.value, vmodels, data, 0, 1)
-
- data.changed = getBindingCallback(elem, "data-duplex-changed", vmodels) || noop
- if (data.evaluator && data.args) {
- var params = []
- var casting = oneObject("string,number,boolean,checked")
- if (elem.type === "radio" && data.param === "") {
- data.param = "checked"
- }
- if (elem.msData) {
- elem.msData["ms-duplex"] = data.value
- }
- data.param.replace(/\w+/g, function (name) {
- if (/^(checkbox|radio)$/.test(elem.type) && /^(radio|checked)$/.test(name)) {
- if (name === "radio")
- log("ms-duplex-radio已经更名为ms-duplex-checked")
- name = "checked"
- data.isChecked = true
- }
- if (name === "bool") {
- name = "boolean"
- log("ms-duplex-bool已经更名为ms-duplex-boolean")
- } else if (name === "text") {
- name = "string"
- log("ms-duplex-text已经更名为ms-duplex-string")
- }
- if (casting[name]) {
- hasCast = true
- }
- avalon.Array.ensure(params, name)
- })
- if (!hasCast) {
- params.push("string")
- }
- data.param = params.join("-")
- data.bound = function (type, callback) {
- if (elem.addEventListener) {
- elem.addEventListener(type, callback, false)
- } else {
- elem.attachEvent("on" + type, callback)
- }
- var old = data.rollback
- data.rollback = function () {
- elem.avalonSetter = null
- avalon.unbind(elem, type, callback)
- old && old()
- }
- }
- for (var i in avalon.vmodels) {
- var v = avalon.vmodels[i]
- v.$fire("avalon-ms-duplex-init", data)
- }
- var cpipe = data.pipe || (data.pipe = pipe)
- cpipe(null, data, "init")
- var tagName = elem.tagName
- duplexBinding[tagName] && duplexBinding[tagName](elem, data.evaluator.apply(null, data.args), data)
- }
- }
-//不存在 bindingExecutors.duplex
-
- function fixNull(val) {
- return val == null ? "" : val
- }
-
- avalon.duplexHooks = {
- checked: {
- get: function (val, data) {
- return !data.element.oldValue
- }
- },
- string: {
- get: function (val) { //同步到VM
- return val
- },
- set: fixNull
- },
- "boolean": {
- get: function (val) {
- return val === "true"
- },
- set: fixNull
- },
- number: {
- get: function (val, data) {
- var number = parseFloat(val)
- if (-val === -number) {
- return number
- }
- var arr = /strong|medium|weak/.exec(data.element.getAttribute("data-duplex-number")) || ["medium"]
- switch (arr[0]) {
- case "strong":
- return 0
- case "medium":
- return val === "" ? "" : 0
- case "weak":
- return val
- }
- },
- set: fixNull
- }
- }
-
- function pipe(val, data, action, e) {
- data.param.replace(/\w+/g, function (name) {
- var hook = avalon.duplexHooks[name]
- if (hook && typeof hook[action] === "function") {
- val = hook[action](val, data)
- }
- })
- return val
- }
-
- var TimerID, ribbon = []
-
- avalon.tick = function (fn) {
- if (ribbon.push(fn) === 1) {
- TimerID = setInterval(ticker, 60)
- }
- }
-
- function ticker() {
- for (var n = ribbon.length - 1; n >= 0; n--) {
- var el = ribbon[n]
- if (el() === false) {
- ribbon.splice(n, 1)
- }
- }
- if (!ribbon.length) {
- clearInterval(TimerID)
- }
- }
-
- var watchValueInTimer = noop
- var rmsinput = /text|password|hidden/
- new function () { // jshint ignore:line
- try { //#272 IE9-IE11, firefox
- var setters = {}
- var aproto = HTMLInputElement.prototype
- var bproto = HTMLTextAreaElement.prototype
-
- function newSetter(value) { // jshint ignore:line
- if (avalon.contains(root, this)) {
- setters[this.tagName].call(this, value)
- if (!rmsinput.test(this.type))
- return
- if (!this.msFocus && this.avalonSetter) {
- this.avalonSetter()
- }
- }
- }
-
- var inputProto = HTMLInputElement.prototype
- Object.getOwnPropertyNames(inputProto) //故意引发IE6-8等浏览器报错
- setters["INPUT"] = Object.getOwnPropertyDescriptor(aproto, "value").set
- Object.defineProperty(aproto, "value", {
- set: newSetter
- })
- setters["TEXTAREA"] = Object.getOwnPropertyDescriptor(bproto, "value").set
- Object.defineProperty(bproto, "value", {
- set: newSetter
- })
- } catch (e) {
- //在chrome 43中 ms-duplex终于不需要使用定时器实现双向绑定了
- // http://updates.html5rocks.com/2015/04/DOM-attributes-now-on-the-prototype
- // https://docs.google.com/document/d/1jwA8mtClwxI-QJuHT7872Z0pxpZz8PBkf2bGAbsUtqs/edit?pli=1
- watchValueInTimer = avalon.tick
- }
- } // jshint ignore:line
-//处理radio, checkbox, text, textarea, password
- duplexBinding.INPUT = function (element, evaluator, data) {
- var $type = element.type,
- bound = data.bound,
- $elem = avalon(element),
- composing = false
-
- function callback(value) {
- data.changed.call(this, value, data)
- }
-
- function compositionStart() {
- composing = true
- }
-
- function compositionEnd() {
- composing = false
- }
-
- //当value变化时改变model的值
-
- var updateVModel = function () {
- if (composing) //处理中文输入法在minlengh下引发的BUG
- return
- var val = element.oldValue = element.value //防止递归调用形成死循环
- var lastValue = data.pipe(val, data, "get")
- if ($elem.data("duplexObserve") !== false) {
- evaluator(lastValue)
- callback.call(element, lastValue)
- if ($elem.data("duplex-focus")) {
- avalon.nextTick(function () {
- element.focus()
- })
- }
- }
- }
- //当model变化时,它就会改变value的值
- data.handler = function () {
- var val = data.pipe(evaluator(), data, "set") + ""
- if (val !== element.oldValue) {
- element.value = val
- }
- }
- if (data.isChecked || $type === "radio") {
- updateVModel = function () {
- if ($elem.data("duplexObserve") !== false) {
- var lastValue = data.pipe(element.value, data, "get")
- evaluator(lastValue)
- callback.call(element, lastValue)
- }
- }
- data.handler = function () {
- var val = evaluator()
- var checked = data.isChecked ? !!val : val + "" === element.value
- element.checked = element.oldValue = checked
- }
- bound("click", updateVModel)
- } else if ($type === "checkbox") {
- updateVModel = function () {
- if ($elem.data("duplexObserve") !== false) {
- var method = element.checked ? "ensure" : "remove"
- var array = evaluator()
- if (!Array.isArray(array)) {
- log("ms-duplex应用于checkbox上要对应一个数组")
- array = [array]
- }
- avalon.Array[method](array, data.pipe(element.value, data, "get"))
- callback.call(element, array)
- }
- }
- data.handler = function () {
- var array = [].concat(evaluator()) //强制转换为数组
- element.checked = array.indexOf(data.pipe(element.value, data, "get")) > -1
- }
- bound("change", updateVModel)
- } else {
- var events = element.getAttribute("data-duplex-event") || "input"
- if (element.attributes["data-event"]) {
- log("data-event指令已经废弃,请改用data-duplex-event")
- }
- events.replace(rword, function (name) {
- switch (name) {
- case "input":
- bound("input", updateVModel)
- bound("DOMAutoComplete", updateVModel)
- if (!IEVersion) {
- bound("compositionstart", compositionStart)
- bound("compositionend", compositionEnd)
- }
- break
- default:
- bound(name, updateVModel)
- break
- }
- })
- bound("focus", function () {
- element.msFocus = true
- })
- bound("blur", function () {
- element.msFocus = false
- })
- if (rmsinput.test($type)) {
- watchValueInTimer(function () {
- if (root.contains(element)) {
- if (!element.msFocus && element.oldValue !== element.value) {
- updateVModel()
- }
- } else if (!element.msRetain) {
- return false
- }
- })
- }
-
- element.avalonSetter = updateVModel
- }
-
- element.oldValue = element.value
- avalon.injectBinding(data)
- callback.call(element, element.value)
- }
- duplexBinding.TEXTAREA = duplexBinding.INPUT
- duplexBinding.SELECT = function (element, evaluator, data) {
- var $elem = avalon(element)
-
- function updateVModel() {
- if ($elem.data("duplexObserve") !== false) {
- var val = $elem.val() //字符串或字符串数组
- if (Array.isArray(val)) {
- val = val.map(function (v) {
- return data.pipe(v, data, "get")
- })
- } else {
- val = data.pipe(val, data, "get")
- }
- if (val + "" !== element.oldValue) {
- evaluator(val)
- }
- data.changed.call(element, val, data)
- }
- }
-
- data.handler = function () {
- var val = evaluator()
- val = val && val.$model || val
- if (Array.isArray(val)) {
- if (!element.multiple) {
- log("ms-duplex在<select multiple=true>上要求对应一个数组")
- }
- } else {
- if (element.multiple) {
- log("ms-duplex在<select multiple=false>不能对应一个数组")
- }
- }
- //必须变成字符串后才能比较
- val = Array.isArray(val) ? val.map(String) : val + ""
- if (val + "" !== element.oldValue) {
- $elem.val(val)
- element.oldValue = val + ""
- }
- }
- data.bound("change", updateVModel)
- element.msCallback = function () {
- avalon.injectBinding(data)
- data.changed.call(element, evaluator(), data)
- }
- }
-// bindingHandlers.html 定义在if.js
- bindingExecutors.html = function (val, elem, data) {
- val = val == null ? "" : val
- var isHtmlFilter = "group" in data
- var parent = isHtmlFilter ? elem.parentNode : elem
- if (!parent)
- return
- if (typeof val === "string") {
- var fragment = avalon.parseHTML(val)
- } else if (val.nodeType === 11) { //将val转换为文档碎片
- fragment = val
- } else if (val.nodeType === 1 || val.item) {
- var nodes = val.nodeType === 1 ? val.childNodes : val.item
- fragment = hyperspace.cloneNode(true)
- while (nodes[0]) {
- fragment.appendChild(nodes[0])
- }
- }
- if (!fragment.firstChild) {
- fragment.appendChild(DOC.createComment("ms-html"))
- }
- nodes = avalon.slice(fragment.childNodes)
- //插入占位符, 如果是过滤器,需要有节制地移除指定的数量,如果是html指令,直接清空
- if (isHtmlFilter) {
- var n = data.group,
- i = 1
-
- data.group = nodes.length
- data.element = nodes[0]
-
- while (i < n) {
- var node = elem.nextSibling
- if (node) {
- parent.removeChild(node)
- i++
- }
- }
- parent.replaceChild(fragment, elem)
- } else {
- avalon.clearHTML(parent).appendChild(fragment)
- }
- scanNodeArray(nodes, data.vmodels)
- }
- bindingHandlers["if"] =
- bindingHandlers.data =
- bindingHandlers.text =
- bindingHandlers.html =
- function (data, vmodels) {
- parseExprProxy(data.value, vmodels, data)
- }
-
- bindingExecutors["if"] = function (val, elem, data) {
- if (val) { //插回DOM树
- if (elem.nodeType === 8) {
- elem.parentNode.replaceChild(data.template, elem)
- elem = data.element = data.template //这时可能为null
- }
- if (elem.getAttribute(data.name)) {
- elem.removeAttribute(data.name)
- scanAttr(elem, data.vmodels)
- }
- data.rollback = null
- } else { //移出DOM树,并用注释节点占据原位置
- if (elem.nodeType === 1) {
- var node = data.element = DOC.createComment("ms-if")
- elem.parentNode.replaceChild(node, elem)
- data.template = elem //元素节点
- ifGroup.appendChild(elem)
- data.rollback = function () {
- if (elem.parentNode === ifGroup) {
- ifGroup.removeChild(elem)
- }
- }
- }
- }
- }
-//ms-important绑定已经在scanTag 方法中实现
-//ms-include绑定已由ms-attr绑定实现
-
- var rdash = /\(([^)]*)\)/
- bindingHandlers.on = function (data, vmodels) {
- var value = data.value
- data.type = "on"
- var eventType = data.param.replace(/-\d+$/, "") // ms-on-mousemove-10
- if (typeof bindingHandlers.on[eventType + "Hook"] === "function") {
- bindingHandlers.on[eventType + "Hook"](data)
- }
- if (value.indexOf("(") > 0 && value.indexOf(")") > -1) {
- var matched = (value.match(rdash) || ["", ""])[1].trim()
- if (matched === "" || matched === "$event") { // aaa() aaa($event)当成aaa处理
- value = value.replace(rdash, "")
- }
- }
- parseExprProxy(value, vmodels, data)
- }
-
- bindingExecutors.on = function (callback, elem, data) {
- callback = function (e) {
- var fn = data.evaluator || noop
- return fn.apply(this, data.args.concat(e))
- }
- var eventType = data.param.replace(/-\d+$/, "") // ms-on-mousemove-10
- if (eventType === "scan") {
- callback.call(elem, {
- type: eventType
- })
- } else if (typeof data.specialBind === "function") {
- data.specialBind(elem, callback)
- } else {
- var removeFn = avalon.bind(elem, eventType, callback)
- }
- data.rollback = function () {
- if (typeof data.specialUnbind === "function") {
- data.specialUnbind()
- } else {
- avalon.unbind(elem, eventType, removeFn)
- }
- }
- }
- bindingHandlers.repeat = function (data, vmodels) {
- var type = data.type
- parseExprProxy(data.value, vmodels, data, 0, 1)
- var freturn = false
- try {
- var $repeat = data.$repeat = data.evaluator.apply(0, data.args || [])
- var xtype = avalon.type($repeat)
- if (xtype !== "object" && xtype !== "array") {
- freturn = true
- avalon.log("warning:" + data.value + "只能是对象或数组")
- }
- } catch (e) {
- freturn = true
- }
-
- var arr = data.value.split(".") || []
- if (arr.length > 1) {
- arr.pop()
- var n = arr[0]
- for (var i = 0, v; v = vmodels[i++];) {
- if (v && v.hasOwnProperty(n)) {
- var events = v[n].$events || {}
- events[subscribers] = events[subscribers] || []
- events[subscribers].push(data)
- break
- }
- }
- }
- var elem = data.element
- elem.removeAttribute(data.name)
-
- data.sortedCallback = getBindingCallback(elem, "data-with-sorted", vmodels)
- data.renderedCallback = getBindingCallback(elem, "data-" + type + "-rendered", vmodels)
- var signature = generateID(type)
- var comment = data.element = DOC.createComment(signature + ":end")
- data.clone = DOC.createComment(signature)
- hyperspace.appendChild(comment)
-
- if (type === "each" || type === "with") {
- data.template = elem.innerHTML.trim()
- avalon.clearHTML(elem).appendChild(comment)
- } else {
- data.template = elem.outerHTML.trim()
- elem.parentNode.replaceChild(comment, elem)
- }
- data.template = avalon.parseHTML(data.template)
- data.rollback = function () {
- var elem = data.element
- if (!elem)
- return
- bindingExecutors.repeat.call(data, "clear")
- var parentNode = elem.parentNode
- var content = data.template
- var target = content.firstChild
- parentNode.replaceChild(content, elem)
- var start = data.$with
- start && start.parentNode && start.parentNode.removeChild(start)
- target = data.element = data.type === "repeat" ? target : parentNode
- }
- if (freturn) {
- return
- }
- data.handler = bindingExecutors.repeat
- data.$outer = {}
- var check0 = "$key"
- var check1 = "$val"
- if (Array.isArray($repeat)) {
- $repeat.$map[data.param || "el"] = 1
- check0 = "$first"
- check1 = "$last"
- }
- for (i = 0; v = vmodels[i++];) {
- if (v.hasOwnProperty(check0) && v.hasOwnProperty(check1)) {
- data.$outer = v
- break
- }
- }
- var $events = $repeat.$events
- var $list = ($events || {})[subscribers]
- if ($list && avalon.Array.ensure($list, data)) {
- addSubscribers(data, $list)
- }
- if (xtype === "object") {
- data.$with = true
- var pool = !$events ? {} : $events.$withProxyPool || ($events.$withProxyPool = {})
- data.handler("append", $repeat, pool)
- } else if ($repeat.length) {
- data.handler("add", 0, $repeat.length)
- }
- }
-
- bindingExecutors.repeat = function (method, pos, el) {
- if (method) {
- var data = this, start, fragment
- var end = data.element
- var comments = getComments(data)
- var parent = end.parentNode
- var transation = hyperspace.cloneNode(false)
- switch (method) {
- case "add": //在pos位置后添加el数组(pos为插入位置,el为要插入的个数)
- var n = pos + el
- var fragments = []
- var array = data.$repeat
- for (var i = pos; i < n; i++) {
- var proxy = array.$proxy[i]
- proxy.$outer = data.$outer
- shimController(data, transation, proxy, fragments)
- }
- parent.insertBefore(transation, comments[pos] || end)
- for (i = 0; fragment = fragments[i++];) {
- scanNodeArray(fragment.nodes, fragment.vmodels)
- fragment.nodes = fragment.vmodels = null
- }
- break
- case "del": //将pos后的el个元素删掉(pos, el都是数字)
- sweepNodes(comments[pos], comments[pos + el] || end)
- break
- case "clear":
- start = comments[0]
- if (start) {
- sweepNodes(start, end)
- }
- break
- case "move":
- start = comments[0]
- if (start) {
- var signature = start.nodeValue
- var rooms = []
- var room = [],
- node
- sweepNodes(start, end, function () {
- room.unshift(this)
- if (this.nodeValue === signature) {
- rooms.unshift(room)
- room = []
- }
- })
- sortByIndex(rooms, pos)
- while (room = rooms.shift()) {
- while (node = room.shift()) {
- transation.appendChild(node)
- }
- }
- parent.insertBefore(transation, end)
- }
- break
- case "append": //将pos的键值对从el中取出(pos为一个普通对象,el为预先生成好的代理VM对象池)
- var pool = el
- var keys = []
- fragments = []
- for (var key in pos) { //得到所有键名
- if (pos.hasOwnProperty(key) && key !== "hasOwnProperty") {
- keys.push(key)
- }
- }
- if (data.sortedCallback) { //如果有回调,则让它们排序
- var keys2 = data.sortedCallback.call(parent, keys)
- if (keys2 && Array.isArray(keys2) && keys2.length) {
- keys = keys2
- }
- }
- for (i = 0; key = keys[i++];) {
- if (key !== "hasOwnProperty") {
- if (!pool[key]) {
- pool[key] = withProxyAgent(key, data)
- }
- shimController(data, transation, pool[key], fragments)
- }
- }
- var comment = data.$with = data.clone
- parent.insertBefore(comment, end)
- parent.insertBefore(transation, end)
- for (i = 0; fragment = fragments[i++];) {
- scanNodeArray(fragment.nodes, fragment.vmodels)
- fragment.nodes = fragment.vmodels = null
- }
- break
- }
- if (method === "clear")
- method = "del"
- var callback = data.renderedCallback || noop,
- args = arguments
- checkScan(parent, function () {
- callback.apply(parent, args)
- if (parent.oldValue && parent.tagName === "SELECT") { //fix #503
- avalon(parent).val(parent.oldValue.split(","))
- }
- }, NaN)
- }
- }
-
- "with,each".replace(rword, function (name) {
- bindingHandlers[name] = bindingHandlers.repeat
- })
-
- function shimController(data, transation, proxy, fragments) {
- var content = data.template.cloneNode(true)
- var nodes = avalon.slice(content.childNodes)
- if (!data.$with) {
- content.insertBefore(data.clone.cloneNode(false), content.firstChild)
- }
- transation.appendChild(content)
- var nv = [proxy].concat(data.vmodels)
- var fragment = {
- nodes: nodes,
- vmodels: nv
- }
- fragments.push(fragment)
- }
-
- function getComments(data) {
- var end = data.element
- var signature = end.nodeValue.replace(":end", "")
- var node = end.previousSibling
- var array = []
- while (node) {
- if (node.nodeValue === signature) {
- array.unshift(node)
- }
- node = node.previousSibling
- }
- return array
- }
-
-
-//移除掉start与end之间的节点(保留end)
- function sweepNodes(start, end, callback) {
- while (true) {
- var node = end.previousSibling
- if (!node)
- break
- node.parentNode.removeChild(node)
- callback && callback.call(node)
- if (node === start) {
- break
- }
- }
- }
-
-// 为ms-each,ms-with, ms-repeat会创建一个代理VM,
-// 通过它们保持一个下上文,让用户能调用$index,$first,$last,$remove,$key,$val,$outer等属性与方法
-// 所有代理VM的产生,消费,收集,存放通过xxxProxyFactory,xxxProxyAgent, recycleProxies,xxxProxyPool实现
- var eachProxyPool = []
- var withProxyPool = []
-
- function eachProxyFactory() {
- var source = {
- $index: 0,
- $first: false,
- $last: false,
- $map: {},
- $host: [],
- $outer: {},
- $remove: avalon.noop,
- el: {
- get: function () {
- var e = this.$events
- var array = e.$index
- e.$index = e.el //#817 通过$index为el收集依赖
- try {
- return this.$host[this.$index]
- } finally {
- e.$index = array
- }
- },
- set: function (val) {
- this.$host.set(this.$index, val)
- }
- }
- }
-
- var second = {
- $last: 1,
- $first: 1,
- $index: 1
- }
- var proxy = modelFactory(source, second)
- proxy.$id = generateID("$proxy$each")
- return proxy
- }
-
- function eachProxyAgent(index, host) {
- var proxy = eachProxyPool.shift()
- if (!proxy) {
- proxy = eachProxyFactory()
- }
- var last = host.length - 1
- proxy.$index = index
- proxy.$first = index === 0
- proxy.$last = index === last
- proxy.$map = host.$map
- proxy.$host = host
- proxy.$remove = function () {
- return host.removeAt(proxy.$index)
- }
- return proxy
- }
-
- function withProxyFactory() {
- var proxy = modelFactory({
- $key: "",
- $outer: {},
- $host: {},
- $val: {
- get: function () {
- return this.$host[this.$key]
- },
- set: function (val) {
- this.$host[this.$key] = val
- }
- }
- }, {
- $val: 1
- })
- proxy.$id = generateID("$proxy$with")
- return proxy
- }
-
- function withProxyAgent(key, data) {
- var proxy = withProxyPool.pop()
- if (!proxy) {
- proxy = withProxyFactory()
- }
- var host = data.$repeat
- proxy.$key = key
- proxy.$host = host
- proxy.$outer = data.$outer
- if (host.$events) {
- proxy.$events.$val = host.$events[key]
- } else {
- proxy.$events = {}
- }
- return proxy
- }
-
- function recycleProxies(proxies, type) {
- var proxyPool = type === "each" ? eachProxyPool : withProxyPool
- avalon.each(proxies, function (key, proxy) {
- if (proxy.$events) {
- for (var i in proxy.$events) {
- if (Array.isArray(proxy.$events[i])) {
- proxy.$events[i].forEach(function (data) {
- if (typeof data === "object")
- disposeData(data)
- }) // jshint ignore:line
- proxy.$events[i].length = 0
- }
- }
- proxy.$host = proxy.$outer = {}
- if (proxyPool.unshift(proxy) > kernel.maxRepeatSize) {
- proxyPool.pop()
- }
- }
- })
- if (type === "each")
- proxies.length = 0
- }
-
- /*********************************************************************
- * 各种指令 *
- **********************************************************************/
-//ms-skip绑定已经在scanTag 方法中实现
-// bindingHandlers.text 定义在if.js
- bindingExecutors.text = function (val, elem) {
- val = val == null ? "" : val //不在页面上显示undefined null
- if (elem.nodeType === 3) { //绑定在文本节点上
- try { //IE对游离于DOM树外的节点赋值会报错
- elem.data = val
- } catch (e) {
- }
- } else { //绑定在特性节点上
- elem.textContent = val
- }
- }
- function parseDisplay(nodeName, val) {
- //用于取得此类标签的默认display值
- var key = "_" + nodeName
- if (!parseDisplay[key]) {
- var node = DOC.createElement(nodeName)
- root.appendChild(node)
- if (W3C) {
- val = getComputedStyle(node, null).display
- } else {
- val = node.currentStyle.display
- }
- root.removeChild(node)
- parseDisplay[key] = val
- }
- return parseDisplay[key]
- }
-
- avalon.parseDisplay = parseDisplay
-
- bindingHandlers.visible = function (data, vmodels) {
- var elem = avalon(data.element)
- var display = elem.css("display")
- if (display === "none") {
- var style = elem[0].style
- var has = /visibility/i.test(style.cssText)
- var visible = elem.css("visibility")
- style.display = ""
- style.visibility = "hidden"
- display = elem.css("display")
- if (display === "none") {
- display = parseDisplay(elem[0].nodeName)
- }
- style.visibility = has ? visible : ""
- }
- data.display = display
- parseExprProxy(data.value, vmodels, data)
- }
-
- bindingExecutors.visible = function (val, elem, data) {
- elem.style.display = val ? data.display : "none"
- }
- bindingHandlers.widget = function (data, vmodels) {
- var args = data.value.match(rword)
- var elem = data.element
- var widget = args[0]
- var id = args[1]
- if (!id || id === "$") { //没有定义或为$时,取组件名+随机数
- id = generateID(widget)
- }
- var optName = args[2] || widget //没有定义,取组件名
- var constructor = avalon.ui[widget]
- if (typeof constructor === "function") { //ms-widget="tabs,tabsAAA,optname"
- vmodels = elem.vmodels || vmodels
- for (var i = 0, v; v = vmodels[i++];) {
- if (v.hasOwnProperty(optName) && typeof v[optName] === "object") {
- var vmOptions = v[optName]
- vmOptions = vmOptions.$model || vmOptions
- break
- }
- }
- if (vmOptions) {
- var wid = vmOptions[widget + "Id"]
- if (typeof wid === "string") {
- log("warning!不再支持" + widget + "Id")
- id = wid
- }
- }
- //抽取data-tooltip-text、data-tooltip-attr属性,组成一个配置对象
- var widgetData = avalon.getWidgetData(elem, widget)
- data.value = [widget, id, optName].join(",")
- data[widget + "Id"] = id
- data.evaluator = noop
- elem.msData["ms-widget-id"] = id
- var options = data[widget + "Options"] = avalon.mix({}, constructor.defaults, vmOptions || {}, widgetData)
- elem.removeAttribute("ms-widget")
- var vmodel = constructor(elem, data, vmodels) || {} //防止组件不返回VM
- if (vmodel.$id) {
- avalon.vmodels[id] = vmodel
- createSignalTower(elem, vmodel)
- try {
- vmodel.$init(function () {
- avalon.scan(elem, [vmodel].concat(vmodels))
- if (typeof options.onInit === "function") {
- options.onInit.call(elem, vmodel, options, vmodels)
- }
- })
- } catch (e) {
- }
- data.rollback = function () {
- try {
- vmodel.widgetElement = null
- vmodel.$remove()
- } catch (e) {
- }
- elem.msData = {}
- delete avalon.vmodels[vmodel.$id]
- }
- addSubscribers(data, widgetList)
- if (window.chrome) {
- elem.addEventListener("DOMNodeRemovedFromDocument", function () {
- setTimeout(removeSubscribers)
- })
- }
- } else {
- avalon.scan(elem, vmodels)
- }
- } else if (vmodels.length) { //如果该组件还没有加载,那么保存当前的vmodels
- elem.vmodels = vmodels
- }
- }
- var widgetList = []
-//不存在 bindingExecutors.widget
- /*********************************************************************
- * 自带过滤器 *
- **********************************************************************/
- var rscripts = /<script[^>]*>([\S\s]*?)<\/script\s*>/gim
- var ron = /\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g
- var ropen = /<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/ig
- var rsanitize = {
- a: /\b(href)\=("javascript[^"]*"|'javascript[^']*')/ig,
- img: /\b(src)\=("javascript[^"]*"|'javascript[^']*')/ig,
- form: /\b(action)\=("javascript[^"]*"|'javascript[^']*')/ig
- }
- var rsurrogate = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g
- var rnoalphanumeric = /([^\#-~| |!])/g;
-
- function numberFormat(number, decimals, point, thousands) {
- //form http://phpjs.org/functions/number_format/
- //number 必需,要格式化的数字
- //decimals 可选,规定多少个小数位。
- //point 可选,规定用作小数点的字符串(默认为 . )。
- //thousands 可选,规定用作千位分隔符的字符串(默认为 , ),如果设置了该参数,那么所有其他参数都是必需的。
- number = (number + '')
- .replace(/[^0-9+\-Ee.]/g, '')
- var n = !isFinite(+number) ? 0 : +number,
- prec = !isFinite(+decimals) ? 3 : Math.abs(decimals),
- sep = thousands || ",",
- dec = point || ".",
- s = '',
- toFixedFix = function (n, prec) {
- var k = Math.pow(10, prec)
- return '' + (Math.round(n * k) / k)
- .toFixed(prec)
- }
- // Fix for IE parseFloat(0.55).toFixed(0) = 0;
- s = (prec ? toFixedFix(n, prec) : '' + Math.round(n))
- .split('.')
- if (s[0].length > 3) {
- s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep)
- }
- if ((s[1] || '')
- .length < prec) {
- s[1] = s[1] || ''
- s[1] += new Array(prec - s[1].length + 1)
- .join('0')
- }
- return s.join(dec)
- }
-
-
- var filters = avalon.filters = {
- uppercase: function (str) {
- return str.toUpperCase()
- },
- lowercase: function (str) {
- return str.toLowerCase()
- },
- truncate: function (str, length, truncation) {
- //length,新字符串长度,truncation,新字符串的结尾的字段,返回新字符串
- length = length || 30
- truncation = truncation === void(0) ? "..." : truncation
- return str.length > length ? str.slice(0, length - truncation.length) + truncation : String(str)
- },
- $filter: function (val) {
- for (var i = 1, n = arguments.length; i < n; i++) {
- var array = arguments[i]
- var fn = avalon.filters[array.shift()]
- if (typeof fn === "function") {
- var arr = [val].concat(array)
- val = fn.apply(null, arr)
- }
- }
- return val
- },
- camelize: camelize,
- //https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
- // <a href="javasc&NewLine;ript&colon;alert('XSS')">chrome</a>
- // <a href="data:text/html;base64, PGltZyBzcmM9eCBvbmVycm9yPWFsZXJ0KDEpPg==">chrome</a>
- // <a href="jav ascript:alert('XSS');">IE67chrome</a>
- // <a href="jav&#x09;ascript:alert('XSS');">IE67chrome</a>
- // <a href="jav&#x0A;ascript:alert('XSS');">IE67chrome</a>
- sanitize: function (str) {
- return str.replace(rscripts, "").replace(ropen, function (a, b) {
- var match = a.toLowerCase().match(/<(\w+)\s/)
- if (match) { //处理a标签的href属性,img标签的src属性,form标签的action属性
- var reg = rsanitize[match[1]]
- if (reg) {
- a = a.replace(reg, function (s, name, value) {
- var quote = value.charAt(0)
- return name + "=" + quote + "javascript:void(0)" + quote// jshint ignore:line
- })
- }
- }
- return a.replace(ron, " ").replace(/\s+/g, " ") //移除onXXX事件
- })
- },
- escape: function (str) {
- //将字符串经过 str 转义得到适合在页面中显示的内容, 例如替换 < 为 &lt
- return String(str).
- replace(/&/g, '&amp;').
- replace(rsurrogate, function (value) {
- var hi = value.charCodeAt(0)
- var low = value.charCodeAt(1)
- return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';'
- }).
- replace(rnoalphanumeric, function (value) {
- return '&#' + value.charCodeAt(0) + ';'
- }).
- replace(/</g, '&lt;').
- replace(/>/g, '&gt;')
- },
- currency: function (amount, symbol, fractionSize) {
- return (symbol || "\uFFE5") + numberFormat(amount, isFinite(fractionSize) ? fractionSize : 2)
- },
- number: numberFormat
- }
- /*
- 'yyyy': 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010)
- 'yy': 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)
- 'y': 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)
- 'MMMM': Month in year (January-December)
- 'MMM': Month in year (Jan-Dec)
- 'MM': Month in year, padded (01-12)
- 'M': Month in year (1-12)
- 'dd': Day in month, padded (01-31)
- 'd': Day in month (1-31)
- 'EEEE': Day in Week,(Sunday-Saturday)
- 'EEE': Day in Week, (Sun-Sat)
- 'HH': Hour in day, padded (00-23)
- 'H': Hour in day (0-23)
- 'hh': Hour in am/pm, padded (01-12)
- 'h': Hour in am/pm, (1-12)
- 'mm': Minute in hour, padded (00-59)
- 'm': Minute in hour (0-59)
- 'ss': Second in minute, padded (00-59)
- 's': Second in minute (0-59)
- 'a': am/pm marker
- 'Z': 4 digit (+sign) representation of the timezone offset (-1200-+1200)
- format string can also be one of the following predefined localizable formats:
-
- 'medium': equivalent to 'MMM d, y h:mm:ss a' for en_US locale (e.g. Sep 3, 2010 12:05:08 pm)
- 'short': equivalent to 'M/d/yy h:mm a' for en_US locale (e.g. 9/3/10 12:05 pm)
- 'fullDate': equivalent to 'EEEE, MMMM d,y' for en_US locale (e.g. Friday, September 3, 2010)
- 'longDate': equivalent to 'MMMM d, y' for en_US locale (e.g. September 3, 2010
- 'mediumDate': equivalent to 'MMM d, y' for en_US locale (e.g. Sep 3, 2010)
- 'shortDate': equivalent to 'M/d/yy' for en_US locale (e.g. 9/3/10)
- 'mediumTime': equivalent to 'h:mm:ss a' for en_US locale (e.g. 12:05:08 pm)
- 'shortTime': equivalent to 'h:mm a' for en_US locale (e.g. 12:05 pm)
- */
- new function () {// jshint ignore:line
- function toInt(str) {
- return parseInt(str, 10) || 0
- }
-
- function padNumber(num, digits, trim) {
- var neg = ""
- if (num < 0) {
- neg = '-'
- num = -num
- }
- num = "" + num
- while (num.length < digits)
- num = "0" + num
- if (trim)
- num = num.substr(num.length - digits)
- return neg + num
- }
-
- function dateGetter(name, size, offset, trim) {
- return function (date) {
- var value = date["get" + name]()
- if (offset > 0 || value > -offset)
- value += offset
- if (value === 0 && offset === -12) {
- value = 12
- }
- return padNumber(value, size, trim)
- }
- }
-
- function dateStrGetter(name, shortForm) {
- return function (date, formats) {
- var value = date["get" + name]()
- var get = (shortForm ? ("SHORT" + name) : name).toUpperCase()
- return formats[get][value]
- }
- }
-
- function timeZoneGetter(date) {
- var zone = -1 * date.getTimezoneOffset()
- var paddedZone = (zone >= 0) ? "+" : ""
- paddedZone += padNumber(Math[zone > 0 ? "floor" : "ceil"](zone / 60), 2) + padNumber(Math.abs(zone % 60), 2)
- return paddedZone
- }
-
- //取得上午下午
-
- function ampmGetter(date, formats) {
- return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1]
- }
-
- var DATE_FORMATS = {
- yyyy: dateGetter("FullYear", 4),
- yy: dateGetter("FullYear", 2, 0, true),
- y: dateGetter("FullYear", 1),
- MMMM: dateStrGetter("Month"),
- MMM: dateStrGetter("Month", true),
- MM: dateGetter("Month", 2, 1),
- M: dateGetter("Month", 1, 1),
- dd: dateGetter("Date", 2),
- d: dateGetter("Date", 1),
- HH: dateGetter("Hours", 2),
- H: dateGetter("Hours", 1),
- hh: dateGetter("Hours", 2, -12),
- h: dateGetter("Hours", 1, -12),
- mm: dateGetter("Minutes", 2),
- m: dateGetter("Minutes", 1),
- ss: dateGetter("Seconds", 2),
- s: dateGetter("Seconds", 1),
- sss: dateGetter("Milliseconds", 3),
- EEEE: dateStrGetter("Day"),
- EEE: dateStrGetter("Day", true),
- a: ampmGetter,
- Z: timeZoneGetter
- }
- var rdateFormat = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/
- var raspnetjson = /^\/Date\((\d+)\)\/$/
- filters.date = function (date, format) {
- var locate = filters.date.locate,
- text = "",
- parts = [],
- fn, match
- format = format || "mediumDate"
- format = locate[format] || format
- if (typeof date === "string") {
- if (/^\d+$/.test(date)) {
- date = toInt(date)
- } else if (raspnetjson.test(date)) {
- date = +RegExp.$1
- } else {
- var trimDate = date.trim()
- var dateArray = [0, 0, 0, 0, 0, 0, 0]
- var oDate = new Date(0)
- //取得年月日
- trimDate = trimDate.replace(/^(\d+)\D(\d+)\D(\d+)/, function (_, a, b, c) {
- var array = c.length === 4 ? [c, a, b] : [a, b, c]
- dateArray[0] = toInt(array[0]) //年
- dateArray[1] = toInt(array[1]) - 1 //月
- dateArray[2] = toInt(array[2]) //日
- return ""
- })
- var dateSetter = oDate.setFullYear
- var timeSetter = oDate.setHours
- trimDate = trimDate.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/, function (_, a, b, c, d) {
- dateArray[3] = toInt(a) //小时
- dateArray[4] = toInt(b) //分钟
- dateArray[5] = toInt(c) //秒
- if (d) { //毫秒
- dateArray[6] = Math.round(parseFloat("0." + d) * 1000)
- }
- return ""
- })
- var tzHour = 0
- var tzMin = 0
- trimDate = trimDate.replace(/Z|([+-])(\d\d):?(\d\d)/, function (z, symbol, c, d) {
- dateSetter = oDate.setUTCFullYear
- timeSetter = oDate.setUTCHours
- if (symbol) {
- tzHour = toInt(symbol + c)
- tzMin = toInt(symbol + d)
- }
- return ""
- })
-
- dateArray[3] -= tzHour
- dateArray[4] -= tzMin
- dateSetter.apply(oDate, dateArray.slice(0, 3))
- timeSetter.apply(oDate, dateArray.slice(3))
- date = oDate
- }
- }
- if (typeof date === "number") {
- date = new Date(date)
- }
- if (avalon.type(date) !== "date") {
- return
- }
- while (format) {
- match = rdateFormat.exec(format)
- if (match) {
- parts = parts.concat(match.slice(1))
- format = parts.pop()
- } else {
- parts.push(format)
- format = null
- }
- }
- parts.forEach(function (value) {
- fn = DATE_FORMATS[value]
- text += fn ? fn(date, locate) : value.replace(/(^'|'$)/g, "").replace(/''/g, "'")
- })
- return text
- }
- var locate = {
- AMPMS: {
- 0: "上午",
- 1: "下午"
- },
- DAY: {
- 0: "星期日",
- 1: "星期一",
- 2: "星期二",
- 3: "星期三",
- 4: "星期四",
- 5: "星期五",
- 6: "星期六"
- },
- MONTH: {
- 0: "1月",
- 1: "2月",
- 2: "3月",
- 3: "4月",
- 4: "5月",
- 5: "6月",
- 6: "7月",
- 7: "8月",
- 8: "9月",
- 9: "10月",
- 10: "11月",
- 11: "12月"
- },
- SHORTDAY: {
- "0": "周日",
- "1": "周一",
- "2": "周二",
- "3": "周三",
- "4": "周四",
- "5": "周五",
- "6": "周六"
- },
- fullDate: "y年M月d日EEEE",
- longDate: "y年M月d日",
- medium: "yyyy-M-d H:mm:ss",
- mediumDate: "yyyy-M-d",
- mediumTime: "H:mm:ss",
- "short": "yy-M-d ah:mm",
- shortDate: "yy-M-d",
- shortTime: "ah:mm"
- }
- locate.SHORTMONTH = locate.MONTH
- filters.date.locate = locate
- }// jshint ignore:line
- /*********************************************************************
- * AMD加载器 *
- **********************************************************************/
-//https://www.devbridge.com/articles/understanding-amd-requirejs/
-//http://maxogden.com/nested-dependencies.html
- var modules = avalon.modules = {
- "domReady!": {
- exports: avalon,
- state: 3
- },
- "avalon": {
- exports: avalon,
- state: 4
- }
- }
-//Object(modules[id]).state拥有如下值
-// undefined 没有定义
-// 1(send) 已经发出请求
-// 2(loading) 已经被执行但还没有执行完成,在这个阶段define方法会被执行
-// 3(loaded) 执行完毕,通过onload/onreadystatechange回调判定,在这个阶段checkDeps方法会执行
-// 4(execute) 其依赖也执行完毕, 值放到exports对象上,在这个阶段fireFactory方法会执行
- modules.exports = modules.avalon
-
- new function () {// jshint ignore:line
- var loadings = [] //正在加载中的模块列表
- var factorys = [] //放置define方法的factory函数
- var rjsext = /\.js$/i
-
- function makeRequest(name, config) {
-//1. 去掉资源前缀
- var res = "js"
- name = name.replace(/^(\w+)\!/, function (a, b) {
- res = b
- return ""
- })
- if (res === "ready") {
- log("debug: ready!已经被废弃,请使用domReady!")
- res = "domReady"
- }
-//2. 去掉querystring, hash
- var query = ""
- name = name.replace(rquery, function (a) {
- query = a
- return ""
- })
- //3. 去掉扩展名
- var suffix = "." + res
- var ext = /js|css/.test(suffix) ? suffix : ""
- name = name.replace(/\.[a-z0-9]+$/g, function (a) {
- if (a === suffix) {
- ext = a
- return ""
- } else {
- return a
- }
- })
- var req = avalon.mix({
- query: query,
- ext: ext,
- res: res,
- name: name,
- toUrl: toUrl
- }, config)
- req.toUrl(name)
- return req
- }
-
- function fireRequest(req) {
- var name = req.name
- var res = req.res
- //1. 如果该模块已经发出请求,直接返回
- var module = modules[name]
- var urlNoQuery = name && req.urlNoQuery
- if (module && module.state >= 1) {
- return name
- }
- module = modules[urlNoQuery]
- if (module && module.state >= 3) {
- innerRequire(module.deps || [], module.factory, urlNoQuery)
- return urlNoQuery
- }
- if (name && !module) {
- module = modules[urlNoQuery] = {
- id: urlNoQuery,
- state: 1 //send
- }
- var wrap = function (obj) {
- resources[res] = obj
- obj.load(name, req, function (a) {
- if (arguments.length && a !== void 0) {
- module.exports = a
- }
- module.state = 4
- checkDeps()
- })
- }
-
- if (!resources[res]) {
- innerRequire([res], wrap)
- } else {
- wrap(resources[res])
- }
- }
- return name ? urlNoQuery : res + "!"
- }
-
-//核心API之一 require
- var requireQueue = []
- var isUserFirstRequire = false
- innerRequire = avalon.require = function (array, factory, parentUrl, defineConfig) {
- if (!isUserFirstRequire) {
- requireQueue.push(avalon.slice(arguments))
- if (arguments.length <= 2) {
- isUserFirstRequire = true
- var queue = requireQueue.splice(0, requireQueue.length), args
- while (args = queue.shift()) {
- innerRequire.apply(null, args)
- }
- }
- return
- }
-
- if (!Array.isArray(array)) {
- avalon.error("require方法的第一个参数应为数组 " + array)
- }
- var deps = [] // 放置所有依赖项的完整路径
- var uniq = createMap()
- var id = parentUrl || "callback" + setTimeout("1")// jshint ignore:line
- defineConfig = defineConfig || createMap()
- defineConfig.baseUrl = kernel.baseUrl
- var isBuilt = !!defineConfig.built
- if (parentUrl) {
- defineConfig.parentUrl = parentUrl.substr(0, parentUrl.lastIndexOf("/"))
- defineConfig.mapUrl = parentUrl.replace(rjsext, "")
- }
- if (isBuilt) {
- var req = makeRequest(defineConfig.defineName, defineConfig)
- id = req.urlNoQuery
- } else {
- array.forEach(function (name) {
- var req = makeRequest(name, defineConfig)
- var url = fireRequest(req) //加载资源,并返回该资源的完整地址
- if (url) {
- if (!uniq[url]) {
- deps.push(url)
- uniq[url] = "司徒正美" //去重
- }
- }
- })
- }
-
- var module = modules[id]
- if (!module || module.state !== 4) {
- modules[id] = {
- id: id,
- deps: isBuilt ? array.concat() : deps,
- factory: factory || noop,
- state: 3
- }
- }
- if (!module) {
- //如果此模块是定义在另一个JS文件中, 那必须等该文件加载完毕, 才能放到检测列队中
- loadings.push(id)
- }
- checkDeps()
- }
-
-//核心API之二 require
- innerRequire.define = function (name, deps, factory) { //模块名,依赖列表,模块本身
- if (typeof name !== "string") {
- factory = deps
- deps = name
- name = "anonymous"
- }
- if (!Array.isArray(deps)) {
- factory = deps
- deps = []
- }
- var config = {
- built: !isUserFirstRequire, //用r.js打包后,所有define会放到requirejs之前
- defineName: name
- }
- var args = [deps, factory, config]
- factory.require = function (url) {
- args.splice(2, 0, url)
- if (modules[url]) {
- modules[url].state = 3 //loaded
- var isCycle = false
- try {
- isCycle = checkCycle(modules[url].deps, url)
- } catch (e) {
- }
- if (isCycle) {
- avalon.error(url + "模块与之前的模块存在循环依赖,请不要直接用script标签引入" + url + "模块")
- }
- }
- delete factory.require //释放内存
- innerRequire.apply(null, args) //0,1,2 --> 1,2,0
- }
-//根据标准,所有遵循W3C标准的浏览器,script标签会按标签的出现顺序执行。
-//老的浏览器中,加载也是按顺序的:一个文件下载完成后,才开始下载下一个文件。
-//较新的浏览器中(IE8+ 、FireFox3.5+ 、Chrome4+ 、Safari4+),为了减小请求时间以优化体验,
-//下载可以是并行的,但是执行顺序还是按照标签出现的顺序。
-//但如果script标签是动态插入的, 就未必按照先请求先执行的原则了,目测只有firefox遵守
-//唯一比较一致的是,IE10+及其他标准浏览器,一旦开始解析脚本, 就会一直堵在那里,直接脚本解析完毕
-//亦即,先进入loading阶段的script标签(模块)必然会先进入loaded阶段
- var url = config.built ? "unknown" : getCurrentScript()
- if (url) {
- var module = modules[url]
- if (module) {
- module.state = 2
- }
- factory.require(url)
- } else {//合并前后的safari,合并后的IE6-9走此分支
- factorys.push(factory)
- }
- }
-//核心API之三 require.config(settings)
- innerRequire.config = kernel
- //核心API之四 define.amd 标识其符合AMD规范
- innerRequire.define.amd = modules
-
- //==========================对用户配置项进行再加工==========================
- var allpaths = kernel["orig.paths"] = createMap()
- var allmaps = kernel["orig.map"] = createMap()
- var allpackages = kernel["packages"] = []
- var allargs = kernel["orig.args"] = createMap()
- avalon.mix(plugins, {
- paths: function (hash) {
- avalon.mix(allpaths, hash)
- kernel.paths = makeIndexArray(allpaths)
- },
- map: function (hash) {
- avalon.mix(allmaps, hash)
- var list = makeIndexArray(allmaps, 1, 1)
- avalon.each(list, function (_, item) {
- item.val = makeIndexArray(item.val)
- })
- kernel.map = list
- },
- packages: function (array) {
- array = array.concat(allpackages)
- var uniq = createMap()
- var ret = []
- for (var i = 0, pkg; pkg = array[i++];) {
- pkg = typeof pkg === "string" ? {name: pkg} : pkg
- var name = pkg.name
- if (!uniq[name]) {
- var url = joinPath(pkg.location || name, pkg.main || "main")
- url = url.replace(rjsext, "")
- ret.push(pkg)
- uniq[name] = pkg.location = url
- pkg.reg = makeMatcher(name)
- }
- }
- kernel.packages = ret.sort()
- },
- urlArgs: function (hash) {
- if (typeof hash === "string") {
- hash = {"*": hash}
- }
- avalon.mix(allargs, hash)
- kernel.urlArgs = makeIndexArray(allargs, 1)
- },
- baseUrl: function (url) {
- if (!isAbsUrl(url)) {
- var baseElement = head.getElementsByTagName("base")[0]
- if (baseElement) {
- head.removeChild(baseElement)
- }
- var node = DOC.createElement("a")
- node.href = url
- url = node.href
- if (baseElement) {
- head.insertBefore(baseElement, head.firstChild)
- }
- }
- if (url.length > 3)
- kernel.baseUrl = url
- },
- shim: function (obj) {
- for (var i in obj) {
- var value = obj[i]
- if (Array.isArray(value)) {
- value = obj[i] = {
- deps: value
- }
- }
- if (!value.exportsFn && (value.exports || value.init)) {
- value.exportsFn = makeExports(value)
- }
- }
- kernel.shim = obj
- }
-
- })
-
-
- //==============================内部方法=================================
- function checkCycle(deps, nick) {
- //检测是否存在循环依赖
- for (var i = 0, id; id = deps[i++];) {
- if (modules[id].state !== 4 &&
- (id === nick || checkCycle(modules[id].deps, nick))) {
- return true
- }
- }
- }
-
- function checkFail(node, onError) {
- var id = trimQuery(node.src) //检测是否死链
- node.onload = node.onerror = null
- if (onError) {
- setTimeout(function () {
- head.removeChild(node)
- node = null // 处理旧式IE下的循环引用问题
- })
- log("debug: 加载 " + id + " 失败" + onError + " " + (!modules[id].state))
- } else {
- return true
- }
- }
-
- function checkDeps() {
- //检测此JS模块的依赖是否都已安装完毕,是则安装自身
- loop: for (var i = loadings.length, id; id = loadings[--i];) {
- var obj = modules[id],
- deps = obj.deps
- if (!deps)
- continue
- for (var j = 0, key; key = deps[j]; j++) {
- if (Object(modules[key]).state !== 4) {
- continue loop
- }
- }
- //如果deps是空对象或者其依赖的模块的状态都是2
- if (obj.state !== 4) {
- loadings.splice(i, 1) //必须先移除再安装,防止在IE下DOM树建完后手动刷新页面,会多次执行它
- fireFactory(obj.id, obj.deps, obj.factory)
- checkDeps() //如果成功,则再执行一次,以防有些模块就差本模块没有安装好
- }
- }
- }
-
- function loadJS(url, id, callback) {
- //通过script节点加载目标模块
- var node = DOC.createElement("script")
- node.className = subscribers //让getCurrentScript只处理类名为subscribers的script节点
- node.onload = function () {
- var factory = factorys.pop()
- factory && factory.require(id)
- if (callback) {
- callback()
- }
- log("debug: 已成功加载 " + url)
- id && loadings.push(id)
- checkDeps()
- }
- node.onerror = function () {
- checkFail(node, true)
- }
-
- head.insertBefore(node, head.firstChild) //chrome下第二个参数不能为null
- node.src = url //插入到head的第一个节点前,防止IE6下head标签没闭合前使用appendChild抛错
- log("debug: 正准备加载 " + url) //更重要的是IE6下可以收窄getCurrentScript的寻找范围
- }
-
- var resources = innerRequire.plugins = {
- //三大常用资源插件 js!, css!, text!, ready!
- ready: {
- load: noop
- },
- js: {
- load: function (name, req, onLoad) {
- var url = req.url
- var id = req.urlNoQuery
- var shim = kernel.shim[name.replace(rjsext, "")]
- if (shim) { //shim机制
- innerRequire(shim.deps || [], function () {
- var args = avalon.slice(arguments)
- loadJS(url, id, function () {
- onLoad(shim.exportsFn ? shim.exportsFn.apply(0, args) : void 0)
- })
- })
- } else {
- loadJS(url, id)
- }
- }
- },
- css: {
- load: function (name, req, onLoad) {
- var url = req.url
- head.insertAdjacentHTML("afterBegin", '<link rel="stylesheet" href="' + url + '">')
- log("debug: 已成功加载 " + url)
- onLoad()
- }
- },
- text: {
- load: function (name, req, onLoad) {
- var url = req.url
- var xhr = getXHR()
- xhr.onload = function () {
- var status = xhr.status;
- if (status > 399 && status < 600) {
- avalon.error(url + " 对应资源不存在或没有开启 CORS")
- } else {
- log("debug: 已成功加载 " + url)
- onLoad(xhr.responseText)
- }
- }
- xhr.open("GET", url, true)
- if ("withCredentials" in xhr) {//这是处理跨域
- xhr.withCredentials = true
- }
- xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest")//告诉后端这是AJAX请求
- xhr.send()
- log("debug: 正准备加载 " + url)
- }
- }
- }
- innerRequire.checkDeps = checkDeps
-
- var rquery = /(\?[^#]*)$/
-
- function trimQuery(url) {
- return (url || "").replace(rquery, "")
- }
-
- function isAbsUrl(path) {
- //http://stackoverflow.com/questions/10687099/how-to-test-if-a-url-string-is-absolute-or-relative
- return /^(?:[a-z]+:)?\/\//i.test(String(path))
- }
-
-
- function getCurrentScript() {
- // inspireb by https://github.com/samyk/jiagra/blob/master/jiagra.js
- var stack
- try {
- a.b.c() //强制报错,以便捕获e.stack
- } catch (e) { //safari5的sourceURL,firefox的fileName,它们的效果与e.stack不一样
- stack = e.stack
- }
- if (stack) {
- /**e.stack最后一行在所有支持的浏览器大致如下:
- *chrome23:
- * at http://113.93.50.63/data.js:4:1
- *firefox17:
- *@http://113.93.50.63/query.js:4
- *opera12:http://www.oldapps.com/opera.php?system=Windows_XP
- *@http://113.93.50.63/data.js:4
- *IE10:
- * at Global code (http://113.93.50.63/data.js:4:1)
- * //firefox4+ 可以用document.currentScript
- */
- stack = stack.split(/[@ ]/g).pop() //取得最后一行,最后一个空格或@之后的部分
- stack = stack[0] === "(" ? stack.slice(1, -1) : stack.replace(/\s/, "") //去掉换行符
- return trimQuery(stack.replace(/(:\d+)?:\d+$/i, "")) //去掉行号与或许存在的出错字符起始位置
- }
- var nodes = head.getElementsByTagName("script") //只在head标签中寻找
- for (var i = nodes.length, node; node = nodes[--i];) {
- if (node.className === subscribers && node.readyState === "interactive") {
- var url = node.src
- return node.className = trimQuery(url)
- }
- }
- }
-
- var rcallback = /^callback\d+$/
-
- function fireFactory(id, deps, factory) {
- var module = Object(modules[id])
- module.state = 4
- for (var i = 0, array = [], d; d = deps[i++];) {
- if (d === "exports") {
- var obj = module.exports || (module.exports = createMap())
- array.push(obj)
- } else {
- array.push(modules[d].exports)
- }
- }
- try {
- var ret = factory.apply(window, array)
- } catch (e) {
- log("执行[" + id + "]模块的factory抛错: " + e)
- }
- if (ret !== void 0) {
- module.exports = ret
- }
- if (rcallback.test(id)) {
- delete modules[id]
- }
- delete module.factory
- return ret
- }
-
- function toUrl(id) {
- if (id.indexOf(this.res + "!") === 0) {
- id = id.slice(this.res.length + 1) //处理define("css!style",[], function(){})的情况
- }
- var url = id
- //1. 是否命中paths配置项
- var usePath = 0
- var baseUrl = this.baseUrl
- var rootUrl = this.parentUrl || baseUrl
- eachIndexArray(id, kernel.paths, function (value, key) {
- url = url.replace(key, value)
- usePath = 1
- })
- //2. 是否命中packages配置项
- if (!usePath) {
- eachIndexArray(id, kernel.packages, function (value, key, item) {
- url = url.replace(item.name, item.location)
- })
- }
- //3. 是否命中map配置项
- if (this.mapUrl) {
- eachIndexArray(this.mapUrl, kernel.map, function (array) {
- eachIndexArray(url, array, function (mdValue, mdKey) {
- url = url.replace(mdKey, mdValue)
- rootUrl = baseUrl
- })
- })
- }
- var ext = this.ext
- if (ext && usePath && url.slice(-ext.length) === ext) {
- url = url.slice(0, -ext.length)
- }
- //4. 转换为绝对路径
- if (!isAbsUrl(url)) {
- rootUrl = this.built || /^\w/.test(url) ? baseUrl : rootUrl
- url = joinPath(rootUrl, url)
- }
- //5. 还原扩展名,query
- var urlNoQuery = url + ext
- url = urlNoQuery + this.query
- //6. 处理urlArgs
- eachIndexArray(id, kernel.urlArgs, function (value) {
- url += (url.indexOf("?") === -1 ? "?" : "&") + value;
- })
- this.url = url
- return this.urlNoQuery = urlNoQuery
- }
-
- function makeIndexArray(hash, useStar, part) {
- //创建一个经过特殊算法排好序的数组
- var index = hash2array(hash, useStar, part)
- index.sort(descSorterByName)
- return index
- }
-
- function makeMatcher(prefix) {
- return new RegExp('^' + prefix + '(/|$)')
- }
-
- function makeExports(value) {
- return function () {
- var ret
- if (value.init) {
- ret = value.init.apply(window, arguments)
- }
- return ret || (value.exports && getGlobal(value.exports))
- }
- }
-
-
- function hash2array(hash, useStar, part) {
- var array = [];
- for (var key in hash) {
- // if (hash.hasOwnProperty(key)) {//hash是由createMap创建没有hasOwnProperty
- var item = {
- name: key,
- val: hash[key]
- }
- array.push(item)
- item.reg = key === "*" && useStar ? /^/ : makeMatcher(key)
- if (part && key !== "*") {
- item.reg = new RegExp('\/' + key.replace(/^\//, "") + '(/|$)')
- }
- // }
- }
- return array
- }
-
- function eachIndexArray(moduleID, array, matcher) {
- array = array || []
- for (var i = 0, el; el = array[i++];) {
- if (el.reg.test(moduleID)) {
- matcher(el.val, el.name, el)
- return false
- }
- }
- }
-
- // 根据元素的name项进行数组字符数逆序的排序函数
- function descSorterByName(a, b) {
- var aaa = a.name
- var bbb = b.name
- if (bbb === "*") {
- return -1
- }
- if (aaa === "*") {
- return 1
- }
- return bbb.length - aaa.length
- }
-
- var rdeuce = /\/\w+\/\.\./
-
- function joinPath(a, b) {
- if (a.charAt(a.length - 1) !== "/") {
- a += "/"
- }
- if (b.slice(0, 2) === "./") { //相对于兄弟路径
- return a + b.slice(2)
- }
- if (b.slice(0, 2) === "..") { //相对于父路径
- a += b
- while (rdeuce.test(a)) {
- a = a.replace(rdeuce, "")
- }
- return a
- }
- if (b.slice(0, 1) === "/") {
- return a + b.slice(1)
- }
- return a + b
- }
-
- function getGlobal(value) {
- if (!value) {
- return value
- }
- var g = window
- value.split(".").forEach(function (part) {
- g = g[part]
- })
- return g
- }
-
- var mainNode = DOC.scripts[DOC.scripts.length - 1]
- var dataMain = mainNode.getAttribute("data-main")
- if (dataMain) {
- plugins.baseUrl(dataMain)
- var href = kernel.baseUrl
- kernel.baseUrl = href.slice(0, href.lastIndexOf("/") + 1)
- loadJS(href.replace(rjsext, "") + ".js")
- } else {
- var loaderUrl = trimQuery(mainNode.src)
- kernel.baseUrl = loaderUrl.slice(0, loaderUrl.lastIndexOf("/") + 1)
- }
- }// jshint ignore:line
-
- /*********************************************************************
- * DOMReady *
- **********************************************************************/
- var readyList = [], isReady
- var fireReady = function (fn) {
- isReady = true
- if (innerRequire) {
- modules["domReady!"].state = 4
- innerRequire.checkDeps()
- }
- while (fn = readyList.shift()) {
- fn(avalon)
- }
- }
-
-
- if (DOC.readyState === "complete") {
- setTimeout(fireReady) //如果在domReady之外加载
- } else {
- DOC.addEventListener("DOMContentLoaded", fireReady)
- }
- window.addEventListener("load", fireReady)
- avalon.ready = function (fn) {
- if (!isReady) {
- readyList.push(fn)
- } else {
- fn(avalon)
- }
- }
- avalon.config({
- loader: true
- })
- avalon.ready(function () {
- avalon.scan(DOC.body)
- })
-
-// Register as a named AMD module, since avalon can be concatenated with other
-// files that may use define, but not via a proper concatenation script that
-// understands anonymous AMD modules. A named AMD is safest and most robust
-// way to register. Lowercase avalon is used because AMD module names are
-// derived from file names, and Avalon is normally delivered in a lowercase
-// file name. Do this after creating the global so that if an AMD module wants
-// to call noConflict to hide this version of avalon, it will work.
-
-// Note that for maximum portability, libraries that are not avalon should
-// declare themselves as anonymous modules, and avoid setting a global if an
-// AMD loader is present. avalon is a special case. For more information, see
-// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
- if (typeof define === "function" && define.amd) {
- define("avalon", [], function () {
- return avalon
- })
- }
-// Map over avalon in case of overwrite
- var _avalon = window.avalon
- avalon.noConflict = function (deep) {
- if (deep && window.avalon === avalon) {
- window.avalon = _avalon
- }
- return avalon
- }
-// Expose avalon identifiers, even in AMD
-// and CommonJS for browser emulators
- if (noGlobal === void 0) {
- window.avalon = avalon
- }
-
- window._injectTer = function (code) {
- return eval(code)
- }
-
- return avalon
-
-})); \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/js/curAlarmsController.js b/umc-iui/src/main/resources/webroot/umc-fm/js/curAlarmsController.js
deleted file mode 100644
index 06cd201f..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/js/curAlarmsController.js
+++ /dev/null
@@ -1,475 +0,0 @@
-var refreshByCond;
-
-
-
-avalon.config({
-
- interpolate: ["<!--", "-->"]
-
-})
-
-
-
-refreshByCond = function () {
-
- vm.$initTable();
-
-};
-
-
-
-var vm = avalon.define({
-
- $id: "curAlarmsController",
- logType: 'secLog',
- severity: '',
- ackState: '',
- filterState: '',
- ruleType: 1,
- curalarmsType: 'curalarms',
- moreCondBtn: false,
- showClear: true,
- dataRangeLocationDisabled:true,
- dataRangeTypeDisabled:true,
- dataRangeCodeDisabled:true,
- alCodeTree_affirm:false,
- alLocationTree_affirm:false,
- alarmCodeSelectedCount: 0,
- alarmLocationSelectedCount: 0,
- alarmTypeSelectedCount: 0,
- tempHide:false,
- treeIcons: [
- "ict-arrowRight",
- "ict-arrowLeft",
- "ict-selectLeft"
- ],
- severityTypes: [//级别
- {id: '1', name: $.i18n.prop("ngict_fm_iui_curalarm_critical"), value: true, type: "severityTypes", class: "alarm-serious"},
- {id: '2', name: $.i18n.prop("ngict_fm_iui_curalarm_major"), value: true, type: "severityTypes", class: "alarm-important"},
- {id: '3', name: $.i18n.prop("ngict_fm_iui_curalarm_minor"), value: true, type: "severityTypes", class: "alarm-secondary"},
- {id: '4', name: $.i18n.prop("ngict_fm_iui_curalarm_warning"), value: true, type: "severityTypes", class: "alarm-slightly"}
- ],
- ackStateTypes: [ //确认状态
- {id: '1', name: $.i18n.prop("ngict_fm_iui_curalarm_ackAlarm"), value: false, type: "ackStateTypes"},
- {id: '2', name: $.i18n.prop("ngict_fm_iui_curalarm_unackAlarm"), value: true, type: "ackStateTypes"}
- ],
- filterStateTypes: [//可见性
- {id: '1', name: $.i18n.prop("ngict_fm_iui_curalarm_visible"), value: true, type: "filterStateTypes"},
- {id: '0', name: $.i18n.prop("ngict_fm_iui_curalarm_invisible"), value: false, type: "filterStateTypes"}
- ],
- alTypes:[
- /*"通信告警",
- "处理错误告警",
- "服务质量告警",
- "设备告警",
- "环境告警",
- "网管系统告警",
- "完整性告警",
- "可用性告警",
- "物理攻击告警",
- "安全攻击告警",
- "时限告警" */
- "Communications Alarm",
- "Processing Error Alarm",
- "Quality of Service Alarm",
- "Equipment Alarm",
- "Environmental Alarm",
- "OMC Alarm",
- "Integrity Violation",
- "Operational Violation",
- "Physical Violation",
- "Security Violation",
- "Time Domain Violation"
- ],
- $alarmsTableFields: {
- curalarms: [
- {"mData": null,name: "<input id='dataTableCheckBox' type='checkBox'/>","sClass": 'details-check',"sWidth": '5%',"fnRender": alarmsUtil.checkBox},
- {"mData": "order", name: $.i18n.prop("ngict_fm_iui_curalarm_order"),"sClass": 'details-control', "sWidth": '6%'},
- {"mData": "id", sWidth : "10%",name: $.i18n.prop("ngict_fm_iui_curalarm_id"),"bVisible": true},
- {"mData": "position1DisplayName", sWidth : "10%",name:$.i18n.prop("ngict_fm_iui_curalarm_ne")},
- {"mData": "mocName",sWidth : "14%", name: $.i18n.prop("ngict_fm_iui_curalarm_moc")},
- {"mData": "probableCauseCodeNameAndCode", sWidth : "14%",name: $.i18n.prop("ngict_fm_iui_curalarm_probableCauseCode")},
- {"mData": "alarmRaisedTime", sWidth : "15%",name: $.i18n.prop("ngict_fm_iui_curalarm_alarmRaisedTime"),"fnRender": alarmsUtil.timeRender},
- {"mData": "perceivedSeverity",sWidth : "10%", name: $.i18n.prop("ngict_fm_iui_curalarm_perceivedSeverity"),fnRender:alarmsUtil.Severity},
- {"mData": "alarmType",sWidth : "10%", name: $.i18n.prop("ngict_fm_iui_curalarm_alarmType"),"bVisible": false},
- {"mData": "ackState",sClass:"ackState",sWidth : "10%", name: $.i18n.prop("ngict_fm_iui_curalarm_ackState"),"fnRender":alarmsUtil.ackState},
- {"mData": "ackTime", sWidth : "13%",name: $.i18n.prop("ngict_fm_iui_curalarm_ackTime"),"fnRender": alarmsUtil.timeRender,"bVisible": false},
- {"mData": "position1", name: $.i18n.prop("ngict_fm_iui_curalarm_position1"),"bVisible": false},
- {"mData": "alarmChangedTime", name: $.i18n.prop("ngict_fm_iui_curalarm_alarmChangedTime"),"bVisible": false,"fnRender": alarmsUtil.timeRender},
- {"mData": "ackUserId", name: $.i18n.prop("ngict_fm_iui_curalarm_ackUserId"),"bVisible": false},
- {"mData": "ackSystemId", name: $.i18n.prop("ngict_fm_iui_curalarm_ackSystemId"),"bVisible": false},
- {"mData": "alarmClearedTime", name: $.i18n.prop("ngict_fm_iui_curalarm_alarmClearedTime"),"bVisible": false,"fnRender": alarmsUtil.timeRender},
- {"mData": "additionalText", name: $.i18n.prop("ngict_fm_iui_curalarm_additionalText"),"bVisible": false},
- {"mData": "ackSystemId", name: $.i18n.prop("ngict_fm_iui_curalarm_ackSystem"),"bVisible": false},
- {"mData": "clearUserId", name: $.i18n.prop("ngict_fm_iui_curalarm_clearUserId"),"bVisible": false},
- {"mData": "clearSystemId", name: $.i18n.prop("ngict_fm_iui_curalarm_clearSystemId"),"bVisible": false},
- {"mData": "clearType", name: $.i18n.prop("ngict_fm_iui_curalarm_clearType"),"bVisible": false},
- {"mData": "probableCauseCode", name: $.i18n.prop("ngict_fm_iui_curalarm_probableCauseCode"),"bVisible": false},
- {"mData": "specificProblem", name: $.i18n.prop("ngict_fm_iui_curalarm_specificProblem"),"bVisible": false},
- {"mData": "neIp", name: $.i18n.prop("ngict_fm_iui_curalarm_neIp"),"bVisible": false},
- {"mData": "pathIds", name: $.i18n.prop("ngict_fm_iui_curalarm_pathIds"),"bVisible": false},
- {"mData": "pathName", name: $.i18n.prop("ngict_fm_iui_curalarm_pathName"),"bVisible": false}
- ],
- },
-
- $language: {
- "sProcessing": "<img src='../../component/thirdparty/data-tables/images/loading-spinner-grey.gif'/><span>&nbsp;&nbsp;处理中...</span>",
- "sLengthMenu": $.i18n.prop("ngict-fm-iui-table-sLengthMenu"),
- "sZeroRecords": $.i18n.prop("ngict-fm-iui-table-sZeroRecords"),
- "sInfo": "<span class='seperator'> </span>" + $.i18n.prop("ngict-fm-iui-table-sInfo"),
- "sInfoEmpty": $.i18n.prop("ngict-fm-iui-table-sInfoEmpty"),
- "sGroupActions": $.i18n.prop("ngict-fm-iui-table-sGroupActions"),
- "sAjaxRequestGeneralError": $.i18n.prop("ngict-fm-iui-table-sAjaxRequestGeneralError"),
- "sEmptyTable": $.i18n.prop("ngict-fm-iui-table-sEmptyTable"),
- "oPaginate": {
- "sPrevious": $.i18n.prop("ngict-fm-iui-table-sPrevious"),
- "sNext": $.i18n.prop("ngict-fm-iui-table-sNext"),
- "sPage": $.i18n.prop("ngict-fm-iui-table-sPage"),
- "sPageOf": $.i18n.prop("ngict-fm-iui-table-sPageOf")
- }
- },
- $queryAlarmsInfoUrl: '/api/umcfm/v1/curalarms',//curalarms hisalarms
- $saveCondUrl: '/web/rest/web/fm/rules?isc_dataFormat=json',
- fmConds: {},
- $sunburstSetting: {width: 450, height: 400},
- //构造查询条件
- $getLogCond: function () {
- var cond = {};
- var severitys = [];
- var ackState = [];
- var filterState = [];
- for (var i = 0; i < vm.severityTypes.length; i++) {
- vm.severityTypes[i].value ? severitys.push(vm.severityTypes[i].id) : null;
- };
- for (var i = 0; i < vm.ackStateTypes.length; i++) {
- vm.ackStateTypes[i].value ? cond.ackState = ackState.push(vm.ackStateTypes[i].id) : null;
- };
- for (var i = 0; i < vm.filterStateTypes.length; i++) {
- vm.filterStateTypes[i].value ? cond.filterState = filterState.push(vm.filterStateTypes[i].id) : null;
- };
- cond.severity = severitys;
- cond.ackState = ackState;
- cond.filterState = filterState;
- cond.location=vm.fmConds.location;
- cond.ackTimeStarTime = vm.fmConds.ackTimeStarTime;
- cond.ackTimeEndTime = vm.fmConds.ackTimeEndTime;
- cond.ackRelativeTime = vm.fmConds.ackRelativeTime;
- cond.ackTimeMode = vm.fmConds.ackTimeMode;
- cond.alarmRaisedStartTime = vm.fmConds.alarmRaisedStartTime;
- cond.alarmRaisedEndTime = vm.fmConds.alarmRaisedEndTime;
- cond.alarmRaisedRelativeTime = vm.fmConds.alarmRaisedRelativeTime;
- cond.alarmRaisedTimeMode = vm.fmConds.alarmRaisedTimeMode;
- cond.clearedTimeStarTime = vm.fmConds.clearedTimeStarTime;
- cond.clearedTimeEndTime = vm.fmConds.clearedTimeEndTime;
- cond.clearedTimeMode = vm.fmConds.clearedTimeMode;
- cond.probableCause = vm.fmConds.probableCause;
- cond.alarmType = vm.fmConds.alarmType;
- cond.ruleType = vm.ruleType;
- return cond;
- },
-
- //注册事件
- $initRegister: function () {
- $('#alCode .condSelect').click(function () {
- $('#alCodeTree').modal('show');
- });
- $('#alCodeTree').on('hide.bs.modal', function () {
- $table = $("#selectedProbableCausesTreeTable");
- if(vm.alCodeTree_affirm===false){
- $('#selectedProbableCausesTreeTable tbody').children().remove();
- for(i=0;i<alarmTemp.length;i++){
- $table.append(alarmTemp[i]);
- }
- }
- vm.alCodeTree_affirm=false;
- });
- $('#alCodeTree').on('show.bs.modal', function () {
- vm.alCodeTree_affirm=false;
- alarmTemp=[];
- var $trs=$("#selectedProbableCausesTreeTable tr");
- if($trs.length!=0){
- for(var i=0;i<$trs.length;i++){
- alarmTemp.push($trs.eq(i)[0].outerHTML);
- }
- $('#selectedProbableCausesTreeTable td').on("click", function () {
- var $tds = $('#selectedProbableCausesTreeTable td');
- for (var i = 0; i < $tds.length; i++) {
- $tds.eq(i).removeClass('tallCellSelected');
- $tds.eq(i).parent().removeClass('checked');
- }
- $(this).addClass('tallCellSelected');
- $(this).parent().addClass("checked");
- });
- }
- })
-
- $('#alType .condSelect').click(function () {
- $('#alTypeTree').modal('show');
- });
- $('#alTypeTree').on('hide.bs.modal', function () {
-
- });
- $('#alTypeTree').on('show.bs.modal', function () {
-
- })
-
- //告警位置初始化
- $('#alLocation .condSelect').click(function () {
- $('#alLocationTree').modal('show');
- });
- $('#alLocationTree').on('hide.bs.modal', function () {
- $table = $("#selectedDeptTreeTable");
- if(vm.alLocationTree_affirm===false){
- $('#selectedDeptTreeTable tbody').children().remove();
- for(i=0;i<alarmTemp.length;i++){
- $table.append(alarmTemp[i]);
- }
- }
- vm.alLocationTree_affirm=false;
- });
- $('#alLocationTree').on('show.bs.modal', function () {
- vm.alLocationTree_affirm=false;
- alarmTemp=[];
- var $trs=$("#selectedDeptTreeTable tr");
- if($trs.length!=0){
- for(var i=0;i<$trs.length;i++){
- alarmTemp.push($trs.eq(i)[0].outerHTML);
- }
- }
- $('#selectedDeptTreeTable td').on("click", function () {
- var $tds = $('#selectedDeptTreeTable td');
- for (var i = 0; i < $tds.length; i++) {
- $tds.eq(i).removeClass('tallCellSelected');
- $tds.eq(i).parent().removeClass('checked');
- }
- $(this).addClass('tallCellSelected');
- $(this).parent().addClass("checked");
- });
- })
-
- $(document).on("click",function(e){
-
- var target = $(e.target);
- if(target.closest("#alLocationTree").length == 0 && target.closest("#alLocation .condSelect").length==0){
- $("#alLocationTree").fadeOut();
- }
- if(target.closest("#alCodeTree").length == 0 && target.closest("#alCode .condSelect").length==0){
- $('#alCodeTree').fadeOut();
- }
- if(target.closest("#alTypeTree").length == 0 && target.closest("#alType .condSelect").length==0){
- $('#alTypeTree').fadeOut();
- }
- });
-
- //主表格确认
- $('#affirm').hover(function(){
- $('#affirmTrip').show();
- },function(){
- $('#affirmTrip').hide();
- });
-
- //主表格反确认
- $('#unAffirm').hover(function(){
- $('#unAffirmTrip').show();
- },function(){
- $('#unAffirmTrip').hide();
- });
-
- //初始化 checkBox
- $('.confirmTime input[type="radio"]').iCheck({
- radioClass: 'iradio_square-aero',
- increaseArea: '20%'
- });
-
- //告警类型树的选项被选中时
- $('#selectedAlTypeTable input[type="checkBox"]').on("ifChecked",function(){
- $(this).parent().parent().addClass('tallCellSelected');
- });
-
- //告警类型未被选中时
- $('#selectedAlTypeTable input[type="checkBox"]').on("ifUnchecked",function(){
- $(this).parent().parent().removeClass('tallCellSelected');
- });
- },
-
- $initTable: function () {
- var setting = {};
- setting.language = vm.$language;
- setting.columns = vm.$alarmsTableFields[vm.curalarmsType];
- setting.restUrl = vm.$queryAlarmsInfoUrl;
- setting.tableId = "ict_alarms_table";
- serverPageTable.initDataTable(setting, vm.$getLogCond(), 'ict_alarms_table_div');
- },
-
- condChange: function () {
- refreshByCond();
- },
-
- moreCondClicked: function () {
-
- $('#moreCond').fadeToggle();
- var icon = $(this).children('span').eq(0);
- if ($(this).hasClass('blueactive')) {
- vm.moreCondBtn = false;
- icon.removeClass('borderBottom');
- icon.addClass('borderBotTop');
- $("div.fliterline").show();
- } else {
- vm.moreCondBtn = true;
- icon.removeClass('borderTop');
- icon.addClass('borderBottom');
- $("div.fliterline").hide();
- }
-
- },
-
- alarmsCondSave: function () {
-
- if ($('#saveCondId').val() != null && $.trim($('#saveCondId').val()) != '') {
- var name = $('#saveCondId').val();
- alarmsUtil.condSave(vm.$getLogCond(), vm.$saveCondUrl, name);
- }
- },
-
- saveModal: function () {
-
- $('#myModal').modal('show');
- },
-
- searchModal: function () {
-
- refreshByCond();
- },
-
- tabClicked: function (modelItem, item) {
-
- if (!modelItem.value) {
- modelItem.value = true;
- } else {
- modelItem.value = false;
- }
- refreshByCond();
- },
-
- moveTreeNode:function(item){
-
- alarmsUtil.moveNode(item);
- },
-
- //告警位置——确认
- deptTreeAffirm:function(){
-
- var selectName="";
- var locationObj=[];
- var $tds= $("#selectedDeptTreeTable td");
- for (var i = 0; i < $tds.length; i++) {
- var obj={};
- obj.id=$tds.eq(i).attr('nodeid');
- obj.oid=$tds.eq(i).attr('oid');
- locationObj.push(obj);
- if(i==0){
- selectName+=$tds.eq(i).text();
- }else{
- selectName+=","+$tds.eq(i).text();
- }
- };
- vm.fmConds.location=locationObj;
- vm.alarmLocationSelectedCount=locationObj.length;
- vm.alLocationTree_affirm=true;
- $('#alLocationTree').modal('hide')
- },
-
- //告警码树 确认
- probableCausesTreeAffirm:function(){
-
- var selectName="";
- var probableCause=[];
- var $tds= $("#selectedProbableCausesTreeTable td");
- var systemType=[];
- for (var i = 0; i < $tds.length; i++) {
- var obj={};
- obj.codeid=$tds.eq(i).attr('codeid');
- obj.parentid=$tds.eq(i).attr('parentid');
- obj.type=$tds.eq(i).attr('type');
- probableCause.push(obj);
- };
-
- vm.fmConds.probableCause=probableCause;
- vm.alarmCodeSelectedCount = probableCause.length;
- vm.alCodeTree_affirm=true;
- $('#alCodeTree').modal('hide');
- },
-
- //告警类型 确认
- alTypeTreeAffirm:function(){
-
- var selectName="";
- var alType=[];
- var $tds=$("#selectedAlTypeTable td.tallCellSelected");
- for (var i = 0; i < $tds.length; i++) {
- var obj={};
- alType.push(obj);
- if(i==0){
- selectName+=$tds.eq(i).text();
- }else{
- selectName+=","+$tds.eq(i).text();
- }
- };
- vm.fmConds.alType=alType;
- if(selectName!=""){
- $('#alType .condSelect :selected').text(selectName);
- }else{
- $('#alType .condSelect :selected').text("请选择告警类型");
- }
- vm.alarmTypeSelectedCount = alType.length;
- //$('#alTypeTree').fadeOut();
- $('#alTypeTree').modal('hide')
- }
-
-});
-
-
-//初始化 告警类型
-initAlTypeTable=function(){
-
- var html="";
- for (var i = 0; i < vm.alTypes.length; i++) {
- html+="<tr><td><input type='checkbox'>"+vm.alTypes[i]+"</td></tr>"
- };
- $('#selectedAlTypeTable').append(html);
-}
-
-initPage=function(){
-
- var lang = getLanguage();
- bootbox.setDefaults({
- locale: lang.replace("-", "_")
- });
- //自定义确认时间组件
- alarmsUtil.setDateRange("daterangeConfirm", vm);
- alarmsUtil.dateRangeEnableDisable("customAckTime");
- //自定义发生时间组件
- alarmsUtil.setDateRange("daterangeOccur", vm);
- alarmsUtil.dateRangeEnableDisable("customRaisedTime");
- //高级菜单界面中,对告警发生时间、确认时间、清除时间初始化
- alarmsUtil.dateRangeCustom(vm);
- //告警码树初始化
- alarmsUtil.initTree();
- //告警类型初始化
- initAlTypeTable();
- vm.$initRegister();
- /*if(localStorage.getItem("curRuleDataId") && localStorage.getItem("curRuleDataId")!=0){
- alarmsUtil.queryByParma(1,localStorage.getItem("curRuleDataId"));
- }else{
- alarmsUtil.queryByParma(1,0);
- }*/
- refreshByCond();
- localStorage.setItem("curRuleDataId",0);
-}
-
-//avalon scan()
-
-initPage();
-
-
-
diff --git a/umc-iui/src/main/resources/webroot/umc-fm/js/delete.me b/umc-iui/src/main/resources/webroot/umc-fm/js/delete.me
deleted file mode 100644
index e69de29b..00000000
--- a/umc-iui/src/main/resources/webroot/umc-fm/js/delete.me
+++ /dev/null
diff --git a/umc-iui/src/main/resources/webroot/umc-monitor/css/dac.css b/umc-iui/src/main/resources/webroot/umc-monitor/css/dac.css
deleted file mode 100644
index fefea2ae..00000000
--- a/umc-iui/src/main/resources/webroot/umc-monitor/css/dac.css
+++ /dev/null
@@ -1,220 +0,0 @@
-/**
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-body {
- color: #333;
- font-size: 14px;
- font-family: "Microsoft yahei", arial;
- background-color: #ffffff !important;
-}
-
-
-a {
-
- text-decoration: none !important;
-}
-
-
-
-.titlefont {
- font-size: 16px;
-}
-
-
-
-.container-fluid {
- background-color: #fff;
-}
-
-
-div.separator div {
- text-align: center;
- line-height: 0;
-}
-
-.row{
- margin-left: 0px;
- margin-right: 0px;
- margin-bottom: 10px;
- margin-top: 10px;
-}
-
-
-p[tooltip], div[tooltip], td[tooltip], span[tooltip]{
- overflow: hidden;
- text-overflow: ellipsis;
- white-space:nowrap;
-}
-
-.control-label .required {
- color: #e02222;
- font-size: 12px;
- padding-left: 2px;
-}
-
-.stats_box {
- display: inline-block;
- list-style: none outside none;
- margin-left: 0;
- margin-top: 10px;
- padding: 0;
- float: left;
-}
-
-
-
-.stats_box .policyDiv{
- background: #eee;
- box-shadow: 0 0 0 1px #f8f8f8 inset,0 0 0 1px #ccc;
- display: inline-block;
- line-height: 18px;
- margin: 0 10px 10px;
- padding: 0 10px;
- float: left;
- height: 105px;
-}
-
-
-
-.sparkline {
- min-width: 60px;
- /* border-right: 1px solid #dcdcdc; */
- /* box-shadow: 1px 0 0 0 #fff; */
- float: left;
- /* margin-right: 9pt; */
- padding: 0px 24px 0 34px;
- height: 90px;
-}
-
-.sparkline i{
-color:#5bc0de;
-}
-
-
-
-
-
-
-
-.animated-panel {
- -webkit-animation-duration: .5s;
- animation-duration: .5s;
- -webkit-animation-fill-mode: both;
- animation-fill-mode: both;
-}
-
-/*
-.panel-footer {
- padding: 6px 15px;
-}*/
-
-
-/*卡片面板样式*/
-.animated-panel {
- -webkit-animation-duration: .5s;
- animation-duration: .5s;
- -webkit-animation-fill-mode: both;
- animation-fill-mode: both;
-}
-
-.hpanel {
- background-color: none;
- border: none;
- box-shadow: none;
- margin-bottom: 35px;
-
-}
-
-.hpanel .panel-body {
- border: 1px solid #e4e5e7;
- border-radius: 2px;
- padding: 20px;
- position: relative;
-}
-.h-200 {
- min-height: 220px;
-}
-.m-t-xl {
- margin-top: 20px;
-}
-.text-success {
- color: #0d638f;
-}
-
-.hpanel_div_list{
- height:30px;
-}
-
-.hpanel > .panel-footer {
- color: inherit;
- border: 1px solid #e4e5e7;
- border-top: none;
- font-size: 90%;
- background: #f7f9fa;
- height:40px;
- padding: 5px 15px;
-}
-
-.color_cloud{
- color:#BAB9B9;
-}
-.stats-title{
-
-}
-
-h3{
- margin-top: 10px;
- margin-bottom: 40px;
- font-weight: 200;
- color: #357ebd
-}
-
-.blue-font{
- color:#428bca;
-}
-
-.hpanel > .panel-footer .pull-right a{
- margin-left: 5px;
-}
-
-.font-bold {
- font-weight: 600;
- margin-bottom: 15px;
-}
-
-.hpanel_show{
- cursor: pointer;
- background-color: #f7f9fa;
-}
-
-.hpanel > .panel-footer .pull-right .btn {
- min-width: 30px !important;
-}
-
-
-div[data-name="cond_zone"] div {
- background-color: #fff;
- margin-bottom: 15px;
-}
-
-span.response_throbber {
- background-image: url('../images/throbber.gif');
- width: 128px;
- height: 16px;
- display: block;
- clear: none;
- float: left;
- margin-top: 50px;
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-monitor/css/dataTables.bootstrap.css b/umc-iui/src/main/resources/webroot/umc-monitor/css/dataTables.bootstrap.css
deleted file mode 100644
index a5a05475..00000000
--- a/umc-iui/src/main/resources/webroot/umc-monitor/css/dataTables.bootstrap.css
+++ /dev/null
@@ -1,331 +0,0 @@
-div.dataTables_length label {
- font-weight: normal;
- text-align: left;
- white-space: nowrap;
-}
-
-div.dataTables_length select {
- height: 28px;
- display: inline-block;
-}
-
-div.dataTables_filter {
- text-align: right;
-}
-
-div.dataTables_filter label {
- font-weight: normal;
- white-space: nowrap;
- text-align: left;
-}
-
-div.dataTables_filter input {
- margin-left: 0.5em;
- display: inline-block;
-}
-
-div.dataTables_info {
- padding-top: 8px;
- white-space: nowrap;
-}
-
-div.dataTables_paginate {
- margin: 0;
- white-space: nowrap;
- text-align: right;
-}
-
-div.dataTables_paginate ul.pagination {
- margin: 2px 0;
- white-space: nowrap;
-}
-
-@media screen and (max-width: 767px) {
- div.dataTables_length,
- div.dataTables_filter,
- div.dataTables_info,
- div.dataTables_paginate {
- text-align: center;
- }
-}
-
-
-table.dataTable td,
-table.dataTable th {
- -webkit-box-sizing: content-box;
- -moz-box-sizing: content-box;
- box-sizing: content-box;
-}
-
-
-table.dataTable {
- clear: both;
- margin-top: 6px !important;
- margin-bottom: 6px !important;
- max-width: none !important;
-}
-
-table.dataTable thead .sorting,
-table.dataTable thead .sorting_asc,
-table.dataTable thead .sorting_desc,
-table.dataTable thead .sorting_asc_disabled,
-table.dataTable thead .sorting_desc_disabled {
- cursor: pointer;
-}
-
-table.dataTable thead .sorting { background: url('../images/sort_both.png') no-repeat center right; }
-table.dataTable thead .sorting_asc { background: url('../images/sort_asc.png') no-repeat center right; }
-table.dataTable thead .sorting_desc { background: url('../images/sort_desc.png') no-repeat center right; }
-
-table.dataTable thead .sorting_asc_disabled { background: url('../images/sort_asc_disabled.png') no-repeat center right; }
-table.dataTable thead .sorting_desc_disabled { background: url('../images/sort_desc_disabled.png') no-repeat center right; }
-
-table.dataTable thead > tr > th {
- padding-left: 18px;
- padding-right: 18px;
-}
-
-table.dataTable th:active {
- outline: none;
-}
-
-/* Scrolling */
-div.dataTables_scrollHead table {
- margin-bottom: 0 !important;
- border-bottom-left-radius: 0;
- border-bottom-right-radius: 0;
-}
-
-div.dataTables_scrollHead table thead tr:last-child th:first-child,
-div.dataTables_scrollHead table thead tr:last-child td:first-child {
- border-bottom-left-radius: 0 !important;
- border-bottom-right-radius: 0 !important;
-}
-
-div.dataTables_scrollBody table {
- border-top: none;
- margin-top: 0 !important;
- margin-bottom: 0 !important;
-}
-
-div.dataTables_scrollBody tbody tr:first-child th,
-div.dataTables_scrollBody tbody tr:first-child td {
- border-top: none;
-}
-
-div.dataTables_scrollFoot table {
- margin-top: 0 !important;
- border-top: none;
-}
-
-/* Frustratingly the border-collapse:collapse used by Bootstrap makes the column
- width calculations when using scrolling impossible to align columns. We have
- to use separate
- */
-table.table-bordered.dataTable {
- border-collapse: separate !important;
-}
-table.table-bordered thead th,
-table.table-bordered thead td {
- border-left-width: 0;
- border-top-width: 0;
-}
-table.table-bordered tbody th,
-table.table-bordered tbody td {
- border-left-width: 0;
- border-bottom-width: 0;
-}
-table.table-bordered th:last-child,
-table.table-bordered td:last-child {
- border-right-width: 0;
-}
-div.dataTables_scrollHead table.table-bordered {
- border-bottom-width: 0;
-}
-
-
-
-
-/*
- * TableTools styles
- */
-.table.dataTable tbody tr.active td,
-.table.dataTable tbody tr.active th {
- background-color: #08C;
- color: white;
-}
-
-.table.dataTable tbody tr.active:hover td,
-.table.dataTable tbody tr.active:hover th {
- background-color: #0075b0 !important;
-}
-
-.table.dataTable tbody tr.active th > a,
-.table.dataTable tbody tr.active td > a {
- color: white;
-}
-
-.table-striped.dataTable tbody tr.active:nth-child(odd) td,
-.table-striped.dataTable tbody tr.active:nth-child(odd) th {
- background-color: #017ebc;
-}
-
-table.DTTT_selectable tbody tr {
- cursor: pointer;
-}
-
-div.DTTT .btn:hover {
- text-decoration: none !important;
-}
-
-ul.DTTT_dropdown.dropdown-menu {
- z-index: 2003;
-}
-
-ul.DTTT_dropdown.dropdown-menu a {
- color: #333 !important; /* needed only when demo_page.css is included */
-}
-
-ul.DTTT_dropdown.dropdown-menu li {
- position: relative;
-}
-
-ul.DTTT_dropdown.dropdown-menu li:hover a {
- background-color: #0088cc;
- color: white !important;
-}
-
-div.DTTT_collection_background {
- z-index: 2002;
-}
-
-/* TableTools information display */
-div.DTTT_print_info {
- position: fixed;
- top: 50%;
- left: 50%;
- width: 400px;
- height: 150px;
- margin-left: -200px;
- margin-top: -75px;
- text-align: center;
- color: #333;
- padding: 10px 30px;
- opacity: 0.95;
-
- background-color: white;
- border: 1px solid rgba(0, 0, 0, 0.2);
- border-radius: 6px;
-
- -webkit-box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5);
- box-shadow: 0 3px 7px rgba(0, 0, 0, 0.5);
-}
-
-div.DTTT_print_info h6 {
- font-weight: normal;
- font-size: 28px;
- line-height: 28px;
- margin: 1em;
-}
-
-div.DTTT_print_info p {
- font-size: 14px;
- line-height: 20px;
-}
-
-div.dataTables_processing {
- position: absolute;
- top: 50%;
- left: 50%;
- width: 100%;
- height: 60px;
- margin-left: -50%;
- margin-top: -25px;
- padding-top: 20px;
- padding-bottom: 20px;
- text-align: center;
- font-size: 1.2em;
- background-color: white;
- background: -webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255,255,255,0)), color-stop(25%, rgba(255,255,255,0.9)), color-stop(75%, rgba(255,255,255,0.9)), color-stop(100%, rgba(255,255,255,0)));
- background: -webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);
- background: -moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);
- background: -ms-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);
- background: -o-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);
- background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 25%, rgba(255,255,255,0.9) 75%, rgba(255,255,255,0) 100%);
-}
-
-
-
-/*
- * FixedColumns styles
- */
-div.DTFC_LeftHeadWrapper table,
-div.DTFC_LeftFootWrapper table,
-div.DTFC_RightHeadWrapper table,
-div.DTFC_RightFootWrapper table,
-table.DTFC_Cloned tr.even {
- background-color: white;
- margin-bottom: 0;
-}
-
-div.DTFC_RightHeadWrapper table ,
-div.DTFC_LeftHeadWrapper table {
- border-bottom: none !important;
- margin-bottom: 0 !important;
- border-top-right-radius: 0 !important;
- border-bottom-left-radius: 0 !important;
- border-bottom-right-radius: 0 !important;
-}
-
-div.DTFC_RightHeadWrapper table thead tr:last-child th:first-child,
-div.DTFC_RightHeadWrapper table thead tr:last-child td:first-child,
-div.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child,
-div.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child {
- border-bottom-left-radius: 0 !important;
- border-bottom-right-radius: 0 !important;
-}
-
-div.DTFC_RightBodyWrapper table,
-div.DTFC_LeftBodyWrapper table {
- border-top: none;
- margin: 0 !important;
-}
-
-div.DTFC_RightBodyWrapper tbody tr:first-child th,
-div.DTFC_RightBodyWrapper tbody tr:first-child td,
-div.DTFC_LeftBodyWrapper tbody tr:first-child th,
-div.DTFC_LeftBodyWrapper tbody tr:first-child td {
- border-top: none;
-}
-
-div.DTFC_RightFootWrapper table,
-div.DTFC_LeftFootWrapper table {
- border-top: none;
- margin-top: 0 !important;
-}
-
-
-/*
- * FixedHeader styles
- */
-div.FixedHeader_Cloned table {
- margin: 0 !important
-}
-
-
-
-
-div.dataTables_length, div.dataTables_info {
- display: inline;
-}
-
-div.dataTables_paginate {
- display: inline;
- float: right !important;
-}
-
-input.pagination-panel-input {
- width: 50px;
-}
-
-
diff --git a/umc-iui/src/main/resources/webroot/umc-monitor/css/monitorSetting.css b/umc-iui/src/main/resources/webroot/umc-monitor/css/monitorSetting.css
deleted file mode 100644
index 97b98418..00000000
--- a/umc-iui/src/main/resources/webroot/umc-monitor/css/monitorSetting.css
+++ /dev/null
@@ -1,167 +0,0 @@
-/**
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-body {
- color: #333;
- font-family: "Microsoft yahei", Verdana, Arial, Helvetica, sans-serif !important;
- padding: 0px !important;
- margin: 0px !important;
- direction: ltr;
- background-color: #ffffff !important;
-}
-
-a {
- text-decoration: none !important;
- cursor: pointer;
-}
-
-.label{
- font-size: 80%;
-}
-
-.row{
- margin-left: 0px;
- margin-right: 0px;
- padding-left: 0px;
- padding-right: 0px;
-}
-
-.chart_row{
-
- padding-left:5px;
- padding-right: 5px;
-}
-
-.titlefont {
- font-size: 16px;
-}
-
-.container-fluid {
- background-color: #fff;
-}
-
-.blue-font {
- color: #428bca;
-}
-
-
-
-.separator-line {
- height: 1px;
- width: 100%;
- background: #ddd;
- overflow: hidden;
- margin-bottom: 15px;
- margin-top: 6px;
- opacity: 0.6;
-}
-
-
-
-
-
-.main {
-
- overflow: hidden;
- margin-bottom: 10px;
- border: 1px solid #e3e3e3;
- -webkit-border-radius: 4px;
- -moz-border-radius: 4px;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
- -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
- box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05);
- padding-top: 10px;
- padding-right: 10px;
-}
-
-.panel-tools {
- display: inline-block;
- float: right;
- margin-top: 0;
- padding: 0;
- position: relative;
-}
-
-.panel-tools a {
- margin-left: 5px;
- color: #9d9fa2;
- cursor: pointer;
-}
-
-.panel-tools a:hover{
- color: #34495e;
- text-decoration: none;
-}
-
-
-.timeline-badge {
- width: 100px;
- height: 100px;
- border-radius: 50% 50% 50% 50%;
- text-align: center;
- font-size: 50px;
- line-height: 100px;
- color: #fff;
- background-color: #999999;
-}
-.timeline-badge.info {
- background-color: #378AE8 !important;
-}
-
-.collapseContent ul {
- padding-left: 0;
- list-style: none;
-}
-
-.collapseContent ul li{
- height:40px;
- font-size: 15px;
-}
-
-#MonitorContent{
- padding-top: 30px;
- padding-bottom: 20px;
-}
-
-.border-right {
- border-right: 1px solid #e4e5e7;
-}
-
-.tipArea {
- border-bottom: 1px solid #d4d4d4;
- width: 85%;
- text-align: center;
- margin-bottom: 15px;
- margin-left: 30px;
- font-weight: bold;
-}
-.monitor-icon{
-
- width:180px;
- float:left;
- padding-left:40px
-
-}
-
-.proxy_div{
- float:left;
- padding-left:20px
-
-}
-
-#MonitorContent b{
- margin-right: 5px;
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-monitor/dacList.html b/umc-iui/src/main/resources/webroot/umc-monitor/dacList.html
deleted file mode 100644
index 43f2c2ba..00000000
--- a/umc-iui/src/main/resources/webroot/umc-monitor/dacList.html
+++ /dev/null
@@ -1,253 +0,0 @@
-
-<!--
-
- Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<!DOCTYPE html>
-<html>
-<head lang="en">
- <meta charset="UTF-8">
- <title></title>
- <link href="../component/thirdparty/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
- <link href="../component/thirdparty/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
- <link href="../framework/css/ngict-component.css" rel="stylesheet" type="text/css">
- <link rel="stylesheet" type="text/css" href="../component/css/ZteIctIcons/style.css">
- <link href="../vendor/animate/animate.min.css" rel="stylesheet" type="text/css" />
- <link href="./css/dac.css" rel="stylesheet" type="text/css" />
- <style>
- .ms-controller {
- visibility: hidden
- }
- </style>
-</head>
-<body>
-<div class="ms-controller container-fluid" ms-controller="dacController">
-
-<div class="row" style=" margin-top: 15px;">
- <div class="col-xs-6 col-sm-12 col-md-6 col-lg-6">
- <span class=" titlefont" id="com_zte_openo_umc_monitor_monitorList_dac_manage" name_i18n="com_zte_openo_umc_monitor_ui_i18n">DAC Manage </span>
- </div>
- <div class="pull-right">
- <a href="#" ms-click="gotoMonitorPage()" ><i class="fa fa-reply "></i>
- <span id="com_zte_openo_umc_monitor_return" name_i18n="com_zte_openo_umc_monitor_ui_i18n">return</span></a>
-
- </div>
-
- </div>
- <div class="separator-line"></div>
-
-
- <div id="dacDlg" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h4 id="myModalLabel" ms-text="dacDlgInfo.titleName"></h4>
- </div>
- <div class="modal-body">
- <div class="alert alert-info" ms-visible="server_rtn.info_block" ms-html="server_rtn.rtn_info"></div>
- <div class="alert alert-danger " ms-visible="server_rtn.warning_block" ms-text="server_rtn.rtn_info"></div>
- <form class="form-horizontal" id="dac_form" role="form">
- <div class="form-group">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_dac_label" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Node Label</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" ms-duplex="dacInfo.nodeLabel" name="nodeLabel" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_dac_ipaddress" name_i18n="com_zte_openo_umc_monitor_ui_i18n">IP Address</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" name="ipAddress" ms-duplex="dacInfo.ipAddress" class="form-control" ms-attr-disabled="dacDlgInfo.saveType=='update'"/>
- <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_dac_note" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Note</span>
-
- </label>
- <div class="col-sm-7">
- <textarea class="form-control" name="note" ms-duplex="dacInfo.note" rows="3"></textarea>
-
- </div>
- </div>
-
- </form>
- </div>
- <div class="modal-footer">
- <!--button class="btn btn-success" type="submit" ms-click="testDAC()">Access Test</button-->
- <button class="btn btn-primary" type="submit" ms-click="saveDAC()" id="com_zte_openo_umc_monitor_btn_save" name_i18n="com_zte_openo_umc_monitor_ui_i18n" ms-attr-disabled="vm.dacChecking==true">Save</button>
- <button class="btn" data-dismiss="modal" aria-hidden="true" id="com_zte_openo_umc_monitor_btn_cancel" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Cancel</button>
- </div>
- </div>
-
- </div>
- </div>
- </div>
-
- <div class="row-fluid" data-name="cond_zone">
- <div class="col-sm-12">
- <button class="btn white radius_l" id="app-new-btn" ms-click="addDAC()" >
- <i class=" ict-new"></i> <span id="com_zte_openo_umc_monitor_dac_register" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Register DAC</span>
- </button>
- </div>
- </div>
-
- <span class="response_throbber" ms-visible="vm.dacLoading"></span>
-
- <div ms-visible="!vm.dacLoading">
- <div class="row" ms-each-dac="dacInfoArray">
- <div class="col-sm-4 col-md-4 animated-panel zoomIn" style="-webkit-animation-delay: 0.1s;" >
- <div class="hpanel stats" >
-
- <div class="panel-body h-200" >
- <div class="stats-icon pull-right">
- <i class="ict-it-net fa-5x color_cloud"></i>
- </div>
- <div class="m-t-xl">
- <h3>{{dac.nodeLabel}}</h3>
- <div class="hpanel_div_list"><span class="font-bold" id="com_zte_openo_umc_monitor_dac_panel_ipaddress" name_i18n="com_zte_openo_umc_monitor_ui_i18n">IP Address:</span><span>{{dac.ipAddress}}</span></div>
- <div class="hpanel_div_list"><span class="font-bold" id="com_zte_openo_umc_monitor_dac_panel_note" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Note:</span><span>{{dac.note}}</span> </div>
- </div>
- </div>
-
- <div class="panel-footer">
- <div class="pull-right">
- <a class="btn btn-default btn-sm" ms-click="updateDAC(dac)"><i class="fa fa-pencil-square-o fa-lg"></i></a>
- <a class="btn btn-default btn-sm" ms-click="delDAC(dac.oid)"><i class="fa fa-trash-o fa-lg"> </i></a>
- </div>
- </div>
- </div>
- </div>
-
-
-
- </div>
-
-
- <div class="row-fluid">
- <div class="col-md-12" style="padding-left:0px;">
- <div class="pull-left">
- <small><span id="com_zte_openo_umc_monitor_monitorList_total" name_i18n="com_zte_openo_umc_monitor_ui_i18n">total</span>
- <span ms-text="dacInfoArray.size()"></span>
- <span id="com_zte_openo_umc_monitor_monitorList_records" name_i18n="com_zte_openo_umc_monitor_ui_i18n">records</span>
- </small>
- </div>
- </div>
- </div>
- </div>
-
-</div>
-
-<script type="text/javascript" src="../component/thirdparty/jquery/jquery-1.10.2.min.js"></script>
-<script type="text/javascript" src="../component/thirdparty/bootstrap/js/bootstrap.min.js"></script>
-<script type="text/javascript" src="../component/thirdparty/jquery.i18n/jquery.i18n.properties-1.0.9.js"></script>
-<script src="../component/thirdparty/jquery-validation/js/jquery.validate.js"></script>
-<script type="text/javascript" src="../component/thirdparty/bootbox/bootbox.min.js"></script>
-<script src="../vendor/bootstrap-growl/bootstrap-growl.min.js"></script>
-<script src="../vendor/avalon/avalon.js"></script>
- <script type="text/javascript" src="../framework/js/tools.js"></script>
- <script type="text/javascript" src="../framework/js/core/hk.min.js" ></script>
-<script src="./js/monitorSettingUtil.js"></script>
-<script src="./js/dacController.js"></script>
-<script src="./i18n/loadi18nApp_ngict-umc-monitor.js"></script>
-<script>
- var lang= getLanguage();
- loadPropertiesSideMenu(lang, 'umc-monitor-iui-i18n', 'i18n/');
-
- jQuery.validator.addMethod("ip", function(value, element) {
- return this.optional(element) || /^(([-9]|([1-9]\d)|(1\d\d)|(2([0-4]\d|5[0-5])))\.)(([0-9]|([1-9]\d)|(1\d\d)|(2([0-4]\d|5[0-5])))\.){2}([1-9]|([1-9]\d)|(1\d\d)|(2([0-4]\d|5[0-5])))$/.test(value);
- }, $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_ipaddress_format_errInfo'));
-
- var form = $('#dac_form');
- var error = $('.alert-danger', form);
- var success = $('.alert-success', form);
-
- form.validate({
- doNotHideMessage: true, //this option enables to show the error/success messages on tab switch.
- errorElement: 'span', //default input error message container
- errorClass: 'help-block', // default input error message class
- focusInvalid: false, // do not focus the last invalid input
- rules: {
-
- nodeLabel:{
- required: true,
- maxlength:50
- },
- ipAddress:{
- required: true,
- ip:true,
- maxlength:20
- }
- },
- messages: {
- nodeLabel:{
- required: $.i18n.prop('com_zte_openo_umc_monitor_dac_label_empty_errInfo')
- },
- ipAddress:{
- required: $.i18n.prop('com_zte_openo_umc_monitor_dac_ipaddress_empty_errInfo')
-
- },
-
- },
- errorPlacement: function (error, element) { // render error placement for each input type
- error.insertAfter(element); // for other inputs, just perform default behavior
- },
-
- invalidHandler: function (event, validator) { //display error alert on form submit
- success.hide();
- error.show();
- //ZteFrameWork.scrollTo(error, -200);
- },
-
- highlight: function (element) { // hightlight error inputs
- $(element)
- .closest('.form-group').removeClass('has-success').addClass('has-error'); // set error class to the control group
- },
-
- unhighlight: function (element) { // revert the change done by hightlight
- $(element)
- .closest('.form-group').removeClass('has-error'); // set error class to the control group
- },
-
- success: function (label) {
- label
- .addClass('valid') // mark the current input as valid and display OK icon
- .closest('.form-group').removeClass('has-error'); // set success class to the control group
- },
- submitHandler: function (form) {
- success.show();
- error.hide();
- //add here some ajax code to submit your form or just call form.submit() if you want to submit the form without ajax
- }
-
- });
-
-
-</script>
-
-</body>
-</html> \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-monitor/i18n/loadi18nApp_ngict-umc-monitor.js b/umc-iui/src/main/resources/webroot/umc-monitor/i18n/loadi18nApp_ngict-umc-monitor.js
deleted file mode 100644
index ed95a39e..00000000
--- a/umc-iui/src/main/resources/webroot/umc-monitor/i18n/loadi18nApp_ngict-umc-monitor.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-function loadPropertiesSideMenu(lang, propertiesFileNamePrefix, propertiesFilePath){
- jQuery.i18n.properties({
- language:lang,
- name:propertiesFileNamePrefix,
- path:propertiesFilePath, // 资源文件路径
- mode:'map', // 用 Map 的方式使用资源文件中的值
- callback: function() {// 加载成功后设置显示内容
- var i18nItems = $('[name_i18n=com_zte_openo_umc_monitor_ui_i18n]');
- for(var i=0;i<i18nItems.length;i++){
- var $item = $(i18nItems.eq(i));
- var itemId = $item.attr('id');
- var itemTitle = $item.attr('title');
- /** id存在时元素内容需要国际化,title存在时元素title需要国际化 */
- if(typeof($item.attr("title")) == "string"){
- $item.attr("title", ($.i18n.prop(itemTitle)));
- }
- if(undefined != itemId && typeof($item.attr("placeholder"))=="undefined"){
- $item.text($.i18n.prop(itemId));
- }else if(undefined != itemId && typeof($item.attr("placeholder"))!="undefined"){
- $item.attr("placeholder", $.i18n.prop(itemId));
- }
- }
- }
- });
-}
-
-
diff --git a/umc-iui/src/main/resources/webroot/umc-monitor/i18n/umc-monitor-iui-i18n-en-US.properties b/umc-iui/src/main/resources/webroot/umc-monitor/i18n/umc-monitor-iui-i18n-en-US.properties
deleted file mode 100644
index c07f91d9..00000000
--- a/umc-iui/src/main/resources/webroot/umc-monitor/i18n/umc-monitor-iui-i18n-en-US.properties
+++ /dev/null
@@ -1,103 +0,0 @@
-#
-# Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-com_zte_openo_umc_monitor_monitorList_titeName=Monitor Para List
-com_zte_openo_umc_monitor_monitorList_dac_manage= DAC Manage
-com_zte_openo_umc_monitor_monitorList_monitor_sn=SN
-com_zte_openo_umc_monitor_monitorList_monitor_name=Display Name
-com_zte_openo_umc_monitor_monitorList_monitor_ipaddress=IP Address
-com_zte_openo_umc_monitor_monitorList_monitor_type=Type
-com_zte_openo_umc_monitor_monitorList_total=total
-com_zte_openo_umc_monitor_monitorList_records=records
-com_zte_openo_umc_monitor_monitorList_monitor_dacip=DAC
-com_zte_openo_umc_monitor_monitorList_monitor_opr=Operation
-
-
-com_zte_openo_umc_monitor_return=return
-com_zte_openo_umc_monitor_dac_label=Node Label
-com_zte_openo_umc_monitor_dac_ipaddress=IP Address
-com_zte_openo_umc_monitor_dac_note=Note
-com_zte_openo_umc_monitor_btn_save=Save
-com_zte_openo_umc_monitor_btn_cancel=Cancel
-com_zte_openo_umc_monitor_dac_register=Register DAC
-com_zte_openo_umc_monitor_dac_edit=Edit DAC
-com_zte_openo_umc_monitor_dac_panel_ipaddress=IP Address:
-com_zte_openo_umc_monitor_dac_panel_note=Note:
-
-com_zte_openo_umc_monitor_dac_register_repeat_errInfo=DAC IP: {0} has been registerd
-com_zte_openo_umc_monitor_dac_register_check_Info=check IPAddress and save DAC ,please wait
-com_zte_openo_umc_monitor_dac_register_successInfo=DAC save success
-com_zte_openo_umc_monitor_dac_update_successInfo=DAC update success
-com_zte_openo_umc_monitor_dac_delete_sureInfo=Are you sure delete this DAC?
-com_zte_openo_umc_monitor_dac_delete_successInfo=DAC delete success
-com_zte_openo_umc_monitor_dac_query_failInfo=query DAC Info fail:
-com_zte_openo_umc_monitor_dac_save_failInfo=DAC save fail:
-com_zte_openo_umc_monitor_dac_delete_failInfo=DAC delete fail:
-com_zte_openo_umc_monitor_tip=Tip:
-com_zte_openo_umc_monitor_dac_label_empty_errInfo=please input Node Label
-com_zte_openo_umc_monitor_dac_ipaddress_empty_errInfo=please input IP address
-
-com_zte_openo_umc_monitor_monitorsetting_delete=Delete
-com_zte_openo_umc_monitor_monitorsetting_ipaddress=IP Address
-com_zte_openo_umc_monitor_monitorsetting_dac=DAC
-com_zte_openo_umc_monitor_monitorsetting_user=User
-com_zte_openo_umc_monitor_monitorsetting_password=Password
-com_zte_openo_umc_monitor_monitorsetting_protocol=Protocol
-com_zte_openo_umc_monitor_monitorsetting_port=Port
-com_zte_openo_umc_monitor_monitorsetting_version=Version
-com_zte_openo_umc_monitor_monitorsetting_snmpport=SNMP Port
-com_zte_openo_umc_monitor_monitorsetting_snmpversion=SNMP Version
-com_zte_openo_umc_monitor_monitorsetting_snmpcommunity=SNMP Community
-
-com_zte_openo_umc_monitor_monitorsetting_titlename=Monitor Para Setting
-com_zte_openo_umc_monitor_btn_monitorset=Monitor Set
-com_zte_openo_umc_monitor_monitorsetting_ipaddress_format_errInfo=Please input the correct IP address
-com_zte_openo_umc_monitor_monitorsetting_user_empty_errInfo=please input Login User
-com_zte_openo_umc_monitor_monitorsetting_password_empty_errInfo=please input Login Password
-com_zte_openo_umc_monitor_monitorsetting_dac_empty_errInfo=please select DAC IP
-com_zte_openo_umc_monitor_monitorsetting_protocol_empty_errInfo=please select Login Protocol
-com_zte_openo_umc_monitor_monitorsetting_ipaddress_empty_errInfo=please input IP address
-com_zte_openo_umc_monitor_monitorsetting_port_empty_errInfo=please input Login Port
-com_zte_openo_umc_monitor_monitorsetting_name_empty_errInfo=please input Node Label
-
-com_zte_openo_umc_monitor_monitorsetting_query_list_errInfo=query monitor List fail
-com_zte_openo_umc_monitor_monitorsetting_query_monitor_errInfo=query monitor Instance fail
-com_zte_openo_umc_monitor_monitorsetting_monitor_checkInfo=Monitor Set saveing...,please wait
-com_zte_openo_umc_monitor_monitorsetting_monitor_save_failInfo=Monitor Set save fail
-com_zte_openo_umc_monitor_monitorsetting_monitor_save_successInfo=Monitor Set save success
-com_zte_openo_umc_monitor_monitorsetting_dac_query_failInfo=query DAC Info fail:
-com_zte_openo_umc_monitor_monitorsetting_task_checkInfo=Monitor Task updating...,please wait
-com_zte_openo_umc_monitor_monitorsetting_monitor_task_failInfo=Monitor Task update fail:
-
-
-openo-umc-monitor-iui-table-sLengthMenu=View _MENU_ records
-openo-umc-monitor-iui-table-sZeroRecords=No matching records found
-openo-umc-monitor-iui-table-sInfo= | Found total _TOTAL_ records
-openo-umc-monitor-iui-table-sInfoEmpty=No records found to show
-openo-umc-monitor-iui-table-sGroupActions=_TOTAL_ records selected:
-openo-umc-monitor-iui-table-sAjaxRequestGeneralError=Could not complete request. Please check your internet connection.
-openo-umc-monitor-iui-table-sEmptyTable=No data available in table
-openo-umc-monitor-iui-table-sPrevious=Prev
-openo-umc-monitor-iui-table-sNext=Next
-openo-umc-monitor-iui-table-sPage=Page
-openo-umc-monitor-iui-table-sPageOf=of
-com_zte_openo_umc_monitor_monitorsetting_agentIP=Agent Ip
-com_zte_openo_umc_monitor_monitorsetting_agentUsername=Agent Username
-com_zte_openo_umc_monitor_monitorsetting_agentPassword=Agent Password
-com_zte_openo_umc_monitor_monitorsetting_agentProtocol=Agent Protocol
-com_zte_openo_umc_monitor_monitorsetting_agentPort=Agent Port
-com_zte_openo_umc_monitor_monitorsetting_ppMaxCount=PP MaxCount
-
diff --git a/umc-iui/src/main/resources/webroot/umc-monitor/i18n/umc-monitor-iui-i18n-zh-CN.properties b/umc-iui/src/main/resources/webroot/umc-monitor/i18n/umc-monitor-iui-i18n-zh-CN.properties
deleted file mode 100644
index a5d674db..00000000
--- a/umc-iui/src/main/resources/webroot/umc-monitor/i18n/umc-monitor-iui-i18n-zh-CN.properties
+++ /dev/null
@@ -1,103 +0,0 @@
-#
-# Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-com_zte_openo_umc_monitor_monitorList_titeName=监控节点列表
-com_zte_openo_umc_monitor_monitorList_dac_manage= DAC管理
-com_zte_openo_umc_monitor_monitorList_monitor_sn=序号
-com_zte_openo_umc_monitor_monitorList_monitor_name=节点名称
-com_zte_openo_umc_monitor_monitorList_monitor_ipaddress=IP地址
-com_zte_openo_umc_monitor_monitorList_monitor_type=类型
-com_zte_openo_umc_monitor_monitorList_monitor_dacip=DAC
-com_zte_openo_umc_monitor_monitorList_monitor_opr=操作
-com_zte_openo_umc_monitor_monitorList_total=共
-com_zte_openo_umc_monitor_monitorList_records=条记录
-
-com_zte_openo_umc_monitor_return=返回
-com_zte_openo_umc_monitor_dac_label=节点名称
-com_zte_openo_umc_monitor_dac_ipaddress=IP地址
-com_zte_openo_umc_monitor_dac_note=Note
-com_zte_openo_umc_monitor_btn_save=保存
-com_zte_openo_umc_monitor_btn_cancel=取消
-com_zte_openo_umc_monitor_dac_register=注册DAC
-com_zte_openo_umc_monitor_dac_edit=修改DAC
-com_zte_openo_umc_monitor_dac_panel_ipaddress=IP地址:
-com_zte_openo_umc_monitor_dac_panel_note=Note:
-com_zte_openo_umc_monitor_dac_label_empty_errInfo=请输入节点名称
-com_zte_openo_umc_monitor_dac_ipaddress_empty_errInfo=请输入IP地址
-
-com_zte_openo_umc_monitor_dac_register_repeat_errInfo=IP地址: {0} 已被注册
-com_zte_openo_umc_monitor_dac_register_check_Info=检查IP地址,并保存DAC信息,请等待
-com_zte_openo_umc_monitor_dac_register_successInfo=DAC保存成功
-com_zte_openo_umc_monitor_dac_update_successInfo=DAC修改成功
-com_zte_openo_umc_monitor_dac_delete_sureInfo=确定删除所选DAC?
-com_zte_openo_umc_monitor_dac_delete_successInfo=DAC删除成功
-com_zte_openo_umc_monitor_dac_query_failInfo=查询DAC信息出错:
-com_zte_openo_umc_monitor_dac_save_failInfo=DAC保存出错:
-com_zte_openo_umc_monitor_dac_delete_failInfo=DAC删除出错:
-com_zte_openo_umc_monitor_tip=提示:
-com_zte_openo_umc_monitor_monitorsetting_delete=删除
-com_zte_openo_umc_monitor_monitorsetting_ipaddress=IP地址
-com_zte_openo_umc_monitor_monitorsetting_dac=DAC
-com_zte_openo_umc_monitor_monitorsetting_user=用户
-com_zte_openo_umc_monitor_monitorsetting_password=密码
-com_zte_openo_umc_monitor_monitorsetting_protocol=协议
-com_zte_openo_umc_monitor_monitorsetting_port=端口
-com_zte_openo_umc_monitor_monitorsetting_version=软件版本
-com_zte_openo_umc_monitor_monitorsetting_snmpport=SNMP端口
-com_zte_openo_umc_monitor_monitorsetting_snmpversion=SNMP版本
-com_zte_openo_umc_monitor_monitorsetting_snmpcommunity=SNMP团体串
-com_zte_openo_umc_monitor_monitorsetting_titlename=监控参数设置
-com_zte_openo_umc_monitor_btn_monitorset=监控设置
-com_zte_openo_umc_monitor_monitorsetting_ipaddress_format_errInfo=请输入正确的IP地址
-com_zte_openo_umc_monitor_monitorsetting_user_empty_errInfo=请输入登录用户
-com_zte_openo_umc_monitor_monitorsetting_password_empty_errInfo=请输入登录密码
-com_zte_openo_umc_monitor_monitorsetting_dac_empty_errInfo=请选择DAC的IP地址
-com_zte_openo_umc_monitor_monitorsetting_protocol_empty_errInfo=请选择登录协议
-com_zte_openo_umc_monitor_monitorsetting_ipaddress_empty_errInfo=请输入IP地址
-com_zte_openo_umc_monitor_monitorsetting_port_empty_errInfo=请输入登录端口
-com_zte_openo_umc_monitor_monitorsetting_name_empty_errInfo=请输入节点名称
-
-com_zte_openo_umc_monitor_monitorsetting_query_list_errInfo=查询监控节点列表出错
-com_zte_openo_umc_monitor_monitorsetting_query_monitor_errInfo=查询监控设置信息出错
-com_zte_openo_umc_monitor_monitorsetting_monitor_checkInfo=监控设置信息保存中...,请等待
-com_zte_openo_umc_monitor_monitorsetting_monitor_save_failInfo=监控设置信息保存出错
-com_zte_openo_umc_monitor_monitorsetting_monitor_save_successInfo=监控设置信息保存成功
-com_zte_openo_umc_monitor_monitorsetting_dac_query_failInfo=查询DAC信息失败:
-com_zte_openo_umc_monitor_monitorsetting_task_checkInfo=监控任务更新中...,请等待
-com_zte_openo_umc_monitor_monitorsetting_monitor_task_failInfo=监控任务更新失败:
-
-
-//表格相关
-openo-umc-monitor-iui-table-sLengthMenu=每页 _MENU_ 条结果
-openo-umc-monitor-iui-table-sZeroRecords=没有匹配结果
-openo-umc-monitor-iui-table-sInfo=总共找到 _TOTAL_ 条结果
-openo-umc-monitor-iui-table-sInfoEmpty=共 0 项
-openo-umc-monitor-iui-table-sGroupActions=_TOTAL_ 条结果被选择:
-openo-umc-monitor-iui-table-sAjaxRequestGeneralError=不能完成请求,请检查您的网络连接情况。
-openo-umc-monitor-iui-table-sEmptyTable=表中数据为空
-openo-umc-monitor-iui-table-sPrevious=前页
-openo-umc-monitor-iui-table-sNext=下页
-openo-umc-monitor-iui-table-sPage=第
-openo-umc-monitor-iui-table-sPageOf=页,总页数:
-
-
-com_zte_openo_umc_monitor_monitorsetting_agentIP=代理机IP
-com_zte_openo_umc_monitor_monitorsetting_agentUsername=代理机用户名
-com_zte_openo_umc_monitor_monitorsetting_agentPassword=代理机密码
-com_zte_openo_umc_monitor_monitorsetting_agentProtocol=代理机协议
-com_zte_openo_umc_monitor_monitorsetting_agentPort=代理机端口
-com_zte_openo_umc_monitor_monitorsetting_ppMaxCount=PP最大数
-
diff --git a/umc-iui/src/main/resources/webroot/umc-monitor/images/throbber.gif b/umc-iui/src/main/resources/webroot/umc-monitor/images/throbber.gif
deleted file mode 100644
index 06393889..00000000
--- a/umc-iui/src/main/resources/webroot/umc-monitor/images/throbber.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-monitor/js/dacController.js b/umc-iui/src/main/resources/webroot/umc-monitor/js/dacController.js
deleted file mode 100644
index fb968e44..00000000
--- a/umc-iui/src/main/resources/webroot/umc-monitor/js/dacController.js
+++ /dev/null
@@ -1,275 +0,0 @@
-/*
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var vm = avalon
- .define({
- $id : "dacController",
- $queryDACsRestUrl : '../../api/umcmonitor/v1/dacs',
- server_rtn:{
- info_block:false,
- warning_block:false,
- rtn_info:""
- },
- dacLoading:false,
- dacChecking:false,
- dacInfoArray : [],
- dacInfo:{
- oid:"",
- moc:"",
- nodeLabel : '',
- ipAddress : '',
- note : ''
- },
- dacDlgInfo:{
- titleName:"",
- saveType:""
- },
- initDAC:function(){
- vm.dacLoading=true;
-
- $.ajax({
- "type": 'get',
- "url": vm.$queryDACsRestUrl,
- "dataType": "json",
- success: function (resp) {
- vm.dacInfoArray = (resp==null)?[]:resp;
- vm.dacInfoArray.sort(function(a,b){return a.nodeLabel>b.nodeLabel?1:-1});
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- // bootbox.alert("query DAC Info fail:"+":"+errorThrown);
- monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_dac_query_failInfo')+errorThrown,"danger");
- return;
- },
- complete:function(){
- vm.dacLoading=false;
- }
- });
- },
- testDAC:function(){
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=true;
- vm.server_rtn.rtn_info="DAC Access Test Pass";
- },
- addDAC:function(){
-
- vm.dacInfo.oid="";
- vm.dacInfo.moc="it.dac";
- vm.dacInfo.nodeLabel="";
- vm.dacInfo.ipAddress="";
- vm.dacInfo.note="";
-
- vm.dacDlgInfo.saveType = "add";
- vm.dacDlgInfo.titleName=$.i18n.prop('com_zte_openo_umc_monitor_dac_register');
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=false;
-
-
- $(".form-group").each(function () {
- $(this).removeClass('has-success');
- $(this).removeClass('has-error');
- $(this).find(".help-block[id]").remove();
- });
- $("#dacDlg").modal("show");
- },
- saveDAC : function() {
- success.hide();
- error.hide();
- if (form.valid() == false) {
- return false;
- }
-
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=true;
- vm.server_rtn.rtn_info='<i class="fa fa-spinner fa-spin fa-lg"></i> '+$.i18n.prop('com_zte_openo_umc_monitor_dac_register_check_Info');
-
-
- var data= JSON.stringify({
- "oid":vm.dacInfo.oid,
- "moc": vm.dacInfo.moc,
- "nodeLabel":vm.dacInfo.nodeLabel,
- "ipAddress":vm.dacInfo.ipAddress,
- "note":vm.dacInfo.note
- });
-
- if(vm.dacDlgInfo.saveType=="add")
- {
- vm.dacChecking=true;
- for(var i=0;i<vm.dacInfoArray.length;i++){
-
- if(vm.dacInfoArray[i].ipAddress==vm.dacInfo.ipAddress)
- {
- vm.server_rtn.warning_block=true;
- vm.server_rtn.info_block=false;
- vm.server_rtn.rtn_info= $.i18n.prop('com_zte_openo_umc_monitor_dac_register_repeat_errInfo',[vm.dacInfo.ipAddress]);
- vm.dacChecking=false;
- return;
- }
-
- }
-
- $.ajax({
- "type": 'POST',
- "url": vm.$queryDACsRestUrl,
- "data" : data,
- "dataType": "json",
- "contentType":"application/json",
- success: function (resp) {
- if(resp.result=="SUCCESS"){
- var newDac=JSON.parse(data);
- newDac.oid=resp.info;
-
- vm.dacInfoArray.push(newDac);
- // vm.dacInfoArray.sort(function(a,b){return a.nodeLabel>b.nodeLabel?1:-1});
- $('#dacDlg').modal('hide');
- monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_dac_register_successInfo'),"success");
- vm.dacChecking=false;
- }
- else{
- vm.server_rtn.warning_block=true;
- vm.server_rtn.info_block=false;
- vm.server_rtn.rtn_info= resp.info;
- vm.dacChecking=false;
- }
-
-
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
-
- vm.server_rtn.warning_block=true;
- vm.server_rtn.info_block=false;
- vm.server_rtn.rtn_info= $.i18n.prop('com_zte_openo_umc_monitor_dac_save_failInfo')+errorThrown;
- vm.dacChecking=false;
-
- }
- });
- }
- else{
-
- $.ajax({
- "type": 'PUT',
- "url": vm.$queryDACsRestUrl,
- "data" :data,
- "dataType": "json",
- "contentType":"application/json",
- success: function (resp) {
- if(resp.result=="SUCCESS"){
- for(var i=0;i<vm.dacInfoArray.length;i++){
- if(vm.dacInfoArray[i].oid == vm.dacInfo.oid)
- {
- vm.dacInfoArray[i].nodeLabel=vm.dacInfo.nodeLabel;
- vm.dacInfoArray[i].ipAddress=vm.dacInfo.ipAddress;
- vm.dacInfoArray[i].note=vm.dacInfo.note;
-
-
- break;
- }
- }
-
-
-
- $('#dacDlg').modal('hide');
-
- monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_dac_update_successInfo'),"success");
-
- }
- else{
-
- vm.server_rtn.warning_block=true;
- vm.server_rtn.info_block=false;
- vm.server_rtn.rtn_info= resp.info;
- }
-
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
-
- vm.server_rtn.warning_block=true;
- vm.server_rtn.info_block=false;
- vm.server_rtn.rtn_info= $.i18n.prop('com_zte_openo_umc_monitor_dac_save_failInfo')+errorThrown;
-
- }
- });
-
-
- }
-
-
- },
- updateDAC:function(dacInfo){
-
- vm.dacInfo.oid=dacInfo.oid;
- vm.dacInfo.moc=dacInfo.moc;
- vm.dacInfo.nodeLabel=dacInfo.nodeLabel;
- vm.dacInfo.ipAddress=dacInfo.ipAddress;
- vm.dacInfo.note=dacInfo.note;
-
-
- vm.dacDlgInfo.saveType = "update";
- vm.dacDlgInfo.titleName=$.i18n.prop('com_zte_openo_umc_monitor_dac_edit');
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=false;
-
-
- $(".form-group").each(function () {
- $(this).removeClass('has-success');
- $(this).removeClass('has-error');
- $(this).find(".help-block[id]").remove();
- });
-
- $("#dacDlg").modal("show");
- },
- delDAC:function(oid){
- bootbox.confirm($.i18n.prop('com_zte_openo_umc_monitor_dac_delete_sureInfo'),function(result){
- if(result){
- $.ajax({
- "type": 'DELETE',
- "url": vm.$queryDACsRestUrl+"/"+oid,
- "dataType": "json",
- success: function (resp) {
-
- if(resp.result=="SUCCESS"){
- for(var i=0;i<vm.dacInfoArray.length;i++){
- if(vm.dacInfoArray[i].oid == oid){
- vm.dacInfoArray.splice(i, 1);
- break;
- }
- }
-
- monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_dac_delete_successInfo'),"success");
- }
- else{
- monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_dac_delete_failInfo')+resp.info,"danger");
- }
-
-
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_dac_delete_failInfo')+errorThrown,"danger");
-
- }
- });
- }
-
-
- });
-
- },
- gotoMonitorPage:function(){
- window.location.href="./monitorSettingList.html";
- }
-
-
- });
-avalon.scan();
-vm.initDAC();
diff --git a/umc-iui/src/main/resources/webroot/umc-monitor/js/monitorSettingController.js b/umc-iui/src/main/resources/webroot/umc-monitor/js/monitorSettingController.js
deleted file mode 100644
index ece67c1d..00000000
--- a/umc-iui/src/main/resources/webroot/umc-monitor/js/monitorSettingController.js
+++ /dev/null
@@ -1,435 +0,0 @@
-/*
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var vm = avalon
- .define({
- $id : "monitorController",
- server_rtn:{
- info_block:false,
- warning_block:false,
- rtn_info:""
- },
- resource:{
- monitorList:[]
- },
- ifPROXYIPChange:"",
- monitorUrl:"",
- oldmonitorInfo:{
- ipAddress:"",
- label:"",
- customPara:{
-
- }
- },
- monitorInfo:{
- oid:"",
- origin:"",
- neTypeId:"",
- label:"",
- ipAddress:"",
- extendPara:"",
- customPara:{
-
- }
- },
- dataTableLanguage: {
- "sProcessing": "<img src='../../component/thirdparty/data-tables/images/loading-spinner-grey.gif'/><span>&nbsp;&nbsp;Loadding...</span>",
- "sLengthMenu": $.i18n.prop("openo-umc-monitor-iui-table-sLengthMenu"),
- "sZeroRecords": $.i18n.prop("openo-umc-monitor-iui-table-sZeroRecords"),
- "sInfo": "<span class='seperator'> </span>" + $.i18n.prop("openo-umc-monitor-iui-table-sInfo"),
- "sInfoEmpty": $.i18n.prop("openo-umc-monitor-iui-table-sInfoEmpty"),
- "sGroupActions": $.i18n.prop("openo-umc-monitor-iui-table-sGroupActions"),
- "sAjaxRequestGeneralError": $.i18n.prop("openo-umc-monitor-iui-table-sAjaxRequestGeneralError"),
- "sEmptyTable": $.i18n.prop("openo-umc-monitor-iui-table-sEmptyTable"),
- "oPaginate": {
- "sPrevious": $.i18n.prop("openo-umc-monitor-iui-table-sPrevious"),
- "sNext": $.i18n.prop("openo-umc-monitor-iui-table-sNext"),
- "sPage": $.i18n.prop("openo-umc-monitor-iui-table-sPage"),
- "sPageOf": $.i18n.prop("openo-umc-monitor-iui-table-sPageOf")
- }
- },
-
- $monitorListRestUrl :'../../api/umcmonitor/v1/monitorinfos', //all ne
- $monitorInstanceRestUrl :'../../api/umcmonitor/v1/monitorinfo/',
- $queryDacsRestUrl : '../../api/umcmonitor/v1/dacs',
- $updateMonitorTaskRestUrl : '../../api/umcmonitor/v1/monitortask/',
- $loginProtocol: {
- selectItems : [
- {
- cond_value : 'SSH',
- name :"SSH"
- },
- {
- cond_value : 'TELNET',
- name : "TELNET"
- }
-
- ]
- },
- dac: {
- selectItems : []
- },
-
- monitorSettingDlgInfo:{
- titleName:"",
- saveType:""
- },
- queryMonitorList : function() {
-
- $.ajax({
- "type": 'get',
- "url": vm.$monitorListRestUrl,
- "dataType": "json",
- "success": function (resp) {
- for(index in resp)
- {
- var monitorInfo=resp[index]
- var customPara={};
- if(monitorInfo.customPara!=""){
- customPara=JSON.parse(monitorInfo.customPara);
- if(typeof(customPara.PROXYIP) == "undefined")
- {
- customPara.PROXYIP="127.0.0.1";
- }
- }
- else{
- customPara={PROXYIP:"127.0.0.1"};
- }
- monitorInfo.customPara=customPara;
- }
-
- vm.resource.monitorList = resp;
-
- $('#monitorManagerTable').DataTable({
- "oLanguage": vm.dataTableLanguage,
- "sDom": '<"top"rt><"bottom"lip>',
- "sPaginationType": "bootstrap_extended",
- "bSort": false
- });
-
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_query_list_errInfo')+errorThrown,"danger");
- }
-
- });
-
-
- },
- queryMonitorInstance : function(oid){
-
- vm.monitorInfo.oid=oid;
- vm.monitorUrl=vm.$monitorInstanceRestUrl+oid;
-
- $.ajax({
- "type": 'GET',
- "url": vm.monitorUrl,
- "dataType": "json",
- "success": function (resp) {
-
- var monitorInfo=resp;
- var customPara={};
- if(monitorInfo.customPara!=""){
- customPara=JSON.parse(monitorInfo.customPara);
- if(typeof(customPara.PROXYIP) == "undefined")
- {
- customPara.PROXYIP="127.0.0.1";
- }
- }
- else{
- customPara={PROXYIP:"127.0.0.1"};
- }
- monitorInfo.customPara=customPara;
- vm.monitorInfo=monitorInfo;
-
- vm.oldmonitorInfo.ipAddress=monitorInfo.ipAddress;
- vm.oldmonitorInfo.label=monitorInfo.label;
- vm.oldmonitorInfo.customPara=customPara;
-
-
-
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_query_monitor_errInfo')+errorThrown,"danger");
- }
-
-
- });
-
- },
-
- deleteMonitorInfo : function(oid){
- vm.monitorInfo.oid=oid;
- vm.monitorUrl=vm.$monitorInstanceRestUrl+oid;
-
- $.ajax({
- "type": 'DELETE',
- "url": vm.monitorUrl,
- "dataType": "json",
- "success": function (resp) {
- vm.gotoMonitorListPage();
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_query_monitor_errInfo')+errorThrown,"danger");
- }
-
-
- });
-
- },
- updateMonitorSet:function(){
-
-
- vm.monitorSettingDlgInfo.titleName=$.i18n.prop('com_zte_openo_umc_monitor_btn_monitorset');
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=false;
-
- $(".form-group").each(function () {
- $(this).removeClass('has-success');
- $(this).removeClass('has-error');
- $(this).find(".help-block[id]").remove();
- });
-
- if(vm.monitorInfo.customPara.PROXYIP=="" && vm.dac.selectItems.length>0){
- vm.monitorInfo.customPara.PROXYIP=vm.dac.selectItems[0].ipAddress;
- }
-
- if(vm.monitorInfo.customPara.PROTOCOL==""){
- vm.monitorInfo.customPara.PROTOCOL="SSH";
- vm.monitorInfo.customPara.PORT="22";
- }
-
- $("#monitorSettingDlg").modal("show");
- },
- testMonitorSet:function(){
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=true;
- vm.server_rtn.rtn_info="Monitor Set Access Test Pass";
- },
- saveMonitorSet : function() {
- success.hide();
- error.hide();
- if (form.valid() == false) {
- return false;
- }
- var propertyNames=vm.monitorInfo.customPara.$propertyNames.split("&shy;");
- var isPropertyUnEqual=false;
- for(index in propertyNames)
- {
- var name=propertyNames[index]
- if(vm.oldmonitorInfo.customPara[name]!=vm.monitorInfo.customPara[name])
- {
- isPropertyUnEqual=true;
- break;
- }
- }
- // judge monitorInfo whether change
- if( vm.oldmonitorInfo.ipAddress!=vm.monitorInfo.ipAddress ||
- isPropertyUnEqual){
-
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=true;
- vm.server_rtn.rtn_info=$.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_checkInfo');
- var customPara=JSON.stringify(vm.monitorInfo.customPara.$model);
- $.ajax({
- "type": 'POST',
- "url": vm.monitorUrl,
- "data": JSON.stringify({
- "ipAddress": vm.monitorInfo.ipAddress,
- "oid": vm.monitorInfo.oid,
- "neTypeId": vm.monitorInfo.neTypeId,
- "label": vm.monitorInfo.label,
- "origin": vm.monitorInfo.origin,
- "extendPara": vm.monitorInfo.extendPara,
- "customPara": customPara
- }),
- "dataType": "json",
- "contentType" : "application/json",
- success: function (resp) {
- // judge PROXYIP whether change
-
- if(vm.oldmonitorInfo.customPara.PROXYIP!=vm.monitorInfo.customPara.PROXYIP){
- vm.ifPROXYIPChange=1;
- }
- else{
- vm.ifPROXYIPChange=0;
- }
-
- vm.updateMonitorTask();
-
- vm.oldmonitorInfo.ipAddress=vm.monitorInfo.ipAddress;
- vm.oldmonitorInfo.label=vm.monitorInfo.label;
- var customPara=vm.monitorInfo.customPara.$model;
- vm.oldmonitorInfo.customPara=customPara;
-
-
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
-
- vm.server_rtn.warning_block=true;
- vm.server_rtn.info_block=false;
- vm.server_rtn.rtn_info= $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_save_failInfo')+errorThrown;
- }
- });
-
- }
- else if(vm.oldmonitorInfo.label!=vm.monitorInfo.label){
- //only change label label
-
- //save new monitorInfo
-
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=true;
- vm.server_rtn.rtn_info=$.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_checkInfo');
- var customPara=JSON.stringify(vm.monitorInfo.customPara.$model);
-
- $.ajax({
- "type": 'POST',
- "url": vm.monitorUrl,
- "data": JSON.stringify({
- "ipAddress": vm.monitorInfo.ipAddress,
- "oid": vm.monitorInfo.oid,
- "neTypeId": vm.monitorInfo.neTypeId,
- "label": vm.monitorInfo.label,
- "origin": vm.monitorInfo.origin,
- "extendPara": vm.monitorInfo.extendPara,
- "customPara": customPara
- }),
- "dataType": "json",
- "contentType" : "application/json",
- success: function (resp) {
- if(resp.result=="SUCCESS"){
-
- vm.oldmonitorInfo.label=vm.monitorInfo.label;
- $('#monitorSettingDlg').modal('hide');
- monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_save_successInfo'),"success");
-
-
- }
- else{
- vm.server_rtn.warning_block=true;
- vm.server_rtn.info_block=false;
- vm.server_rtn.rtn_info= $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_save_failInfo');
- }
-
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
-
- vm.server_rtn.warning_block=true;
- vm.server_rtn.info_block=false;
- vm.server_rtn.rtn_info= $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_save_failInfo')+errorThrown;
- }
- });
-
- }
- else{
- //no change
- $('#monitorSettingDlg').modal('hide');
- monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_save_successInfo'),"success");
- }
-
-
-
-
-
- },
- cancelMonitorSet: function() {
-
- vm.monitorInfo.ipAddress=vm.oldmonitorInfo.ipAddress;
- vm.monitorInfo.name=vm.oldmonitorInfo.name;
- vm.monitorInfo.customPara=vm.oldmonitorInfo.customPara;
- $('#monitorSettingDlg').modal('hide');
-
- },
- queryDACs:function(){
-
-
- $.ajax({
- "type": 'get',
- "url": vm.$queryDacsRestUrl,
- "dataType": "json",
- success: function (resp) {
- vm.dac.selectItems = (resp==null)?[]:resp;
- // vm.proxy.selectItems.sort(function(a,b){return a.ipAddress>b.ipAddress?1:-1});
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_dac_query_failInfo')+errorThrown,"danger");
- }
- });
- },
- updateMonitorTask:function(){
- vm.server_rtn.warning_block=false;
- vm.server_rtn.info_block=true;
- vm.server_rtn.rtn_info=$.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_task_checkInfo');
-
-
- var data= JSON.stringify({
- oid:vm.monitorInfo.oid,
- moc:vm.monitorInfo.neTypeId,
- proxyIp:vm.monitorInfo.customPara.PROXYIP
- });
-
- $.ajax({
- "type": 'PUT',
- "url": vm.$updateMonitorTaskRestUrl+vm.ifPROXYIPChange,
- "data" :data,
- "dataType": "json",
- "contentType":"application/json",
- success: function (resp) {
- if(resp.result=="SUCCESS"){
-
- $('#monitorSettingDlg').modal('hide');
- monitorUtil.growl($.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_save_successInfo'),"success");
-
- }
- else
- {
- vm.server_rtn.warning_block=true;
- vm.server_rtn.info_block=false;
- vm.server_rtn.rtn_info= $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_task_failInfo')+resp.info;
- }
-
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
-
- vm.server_rtn.warning_block=true;
- vm.server_rtn.info_block=false;
- vm.server_rtn.rtn_info= $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_monitor_task_failInfo')+errorThrown;
-
- }
- });
-
- },
-
-
- gotoDACPage:function(){
- // window.parent.ZteFrameWork.goToURLByIDAndNewAction('sdn-manager-gwList');
- window.location.href="./dacList.html";
- },
- gotoMonitorSettingPage:function(oid){
- // window.parent.ZteFrameWork.goToURLByIDAndNewAction('sdn-manager-gwList');
- window.location.href="./monitorSetting.html?"+oid;
- },
- gotoMonitorListPage:function(){
- // window.parent.ZteFrameWork.goToURLByIDAndNewAction('sdn-manager-gwList');
- window.location.href="./monitorSettingList.html";
- }
-
-
- });
-
-avalon.scan();
-
-
diff --git a/umc-iui/src/main/resources/webroot/umc-monitor/js/monitorSettingUtil.js b/umc-iui/src/main/resources/webroot/umc-monitor/js/monitorSettingUtil.js
deleted file mode 100644
index 1b073849..00000000
--- a/umc-iui/src/main/resources/webroot/umc-monitor/js/monitorSettingUtil.js
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-var monitorUtil = {};
-
-monitorUtil.growl=function(message,type){
- var delay;
- if(type=="success"){
- delay=3000;
- }
- else{
- delay=0;
- }
-
- $.growl({
- icon: "fa fa-envelope-o fa-lg",
- title: "&nbsp;&nbsp;"+$.i18n.prop('com_zte_openo_umc_monitor_tip')+"&nbsp;&nbsp;",
- message: message+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
- },{
- type: type,
- delay:delay
- });
-}
-
-
-$.fn.dataTableExt.oApi.fnPagingInfo = function (oSettings) {
- return {
- "iEnd": oSettings.fnDisplayEnd(),
- "iLength": oSettings._iDisplayLength,
- "iTotal": oSettings.fnRecordsTotal(),
- "iFilteredTotal": oSettings.fnRecordsDisplay(),
- "iPage": Math.ceil(oSettings._iDisplayStart / oSettings._iDisplayLength),
- "iTotalPages": Math.ceil(oSettings.fnRecordsDisplay() / oSettings._iDisplayLength)
- };
-};
-
-$.extend($.fn.dataTableExt.oPagination, {
- "bootstrap_extended": {
- "fnInit": function (oSettings, nPaging, fnDraw) {
- var oLang = oSettings.oLanguage.oPaginate;
- var oPaging = oSettings.oInstance.fnPagingInfo();
-
- var fnClickHandler = function (e) {
- e.preventDefault();
- if (oSettings.oApi._fnPageChange(oSettings, e.data.action)) {
- fnDraw(oSettings);
- }
- };
-
- $(nPaging).append(
- '<div class="pagination-panel"> ' + oLang.sPage + ' ' +
- '<a href="#" class="btn btn-sm default prev disabled" title="' + oLang.sPrevious + '"><i class="fa fa-angle-left"></i></a>' +
- '<input type="text" class="pagination-panel-input input-mini input-inline input-sm" maxlenght="5" style="text-align:center; margin: 0 4px; border: 1px solid rgb(169, 169, 169);height: 28px;">' +
- '<a href="#" class="btn btn-sm default next disabled" title="' + oLang.sNext + '"><i class="fa fa-angle-right"></i></a> ' +
- oLang.sPageOf + ' <span class="pagination-panel-total"></span>' +
- '</div>'
- );
-
- var els = $('a', nPaging);
-
- $(els[0]).bind('click.DT', {action: "previous"}, fnClickHandler);
- $(els[1]).bind('click.DT', {action: "next"}, fnClickHandler);
-
- $('.pagination-panel-input', nPaging).bind('change.DT', function (e) {
- var oPaging = oSettings.oInstance.fnPagingInfo();
- e.preventDefault();
- var page = parseInt($(this).val());
- if (page > 0 && page < oPaging.iTotalPages) {
- if (oSettings.oApi._fnPageChange(oSettings, page - 1)) {
- fnDraw(oSettings);
- }
- } else {
- $(this).val(oPaging.iPage + 1);
- }
- });
-
- $('.pagination-panel-input', nPaging).bind('keypress.DT', function (e) {
- var oPaging = oSettings.oInstance.fnPagingInfo();
- if (e.which == 13) {
- var page = parseInt($(this).val());
- if (page > 0 && page < oSettings.oInstance.fnPagingInfo().iTotalPages) {
- if (oSettings.oApi._fnPageChange(oSettings, page - 1)) {
- fnDraw(oSettings);
- }
- } else {
- $(this).val(oPaging.iPage + 1);
- }
- e.preventDefault();
- }
- });
- },
-
- "fnUpdate": function (oSettings, fnDraw) {
- var iListLength = 5;
- var oPaging = oSettings.oInstance.fnPagingInfo();
- var an = oSettings.aanFeatures.p;
- var i, j, sClass, iStart, iEnd, iHalf = Math.floor(iListLength / 2);
-
- if (oPaging.iTotalPages < iListLength) {
- iStart = 1;
- iEnd = oPaging.iTotalPages;
- }
- else if (oPaging.iPage <= iHalf) {
- iStart = 1;
- iEnd = iListLength;
- } else if (oPaging.iPage >= (oPaging.iTotalPages - iHalf)) {
- iStart = oPaging.iTotalPages - iListLength + 1;
- iEnd = oPaging.iTotalPages;
- } else {
- iStart = oPaging.iPage - iHalf + 1;
- iEnd = iStart + iListLength - 1;
- }
-
-
- for (i = 0, iLen = an.length; i < iLen; i++) {
- var wrapper = $(an[i]).parents(".dataTables_wrapper");
-
- if (oPaging.iTotalPages <= 0) {
- $('.pagination-panel, .dataTables_length', wrapper).hide();
- } else {
- $('.pagination-panel, .dataTables_length', wrapper).show();
- }
-
- $('.pagination-panel-total', an[i]).html(oPaging.iTotalPages);
- $('.pagination-panel-input', an[i]).val(oPaging.iPage + 1);
-
- // Remove the middle elements
- $('li:gt(1)', an[i]).filter(':not(.next)').remove();
-
- // Add the new list items and their event handlers
- for (j = iStart; j <= iEnd; j++) {
- sClass = (j == oPaging.iPage + 1) ? 'class="active"' : '';
- $('<li ' + sClass + '><a href="#">' + j + '</a></li>')
- .insertBefore($('li.next:first', an[i])[0])
- .bind('click', function (e) {
- e.preventDefault();
- oSettings._iDisplayStart = (parseInt($('a', this).text(), 10) - 1) * oPaging.iLength;
- fnDraw(oSettings);
- });
- }
-
- // Add / remove disabled classes from the static elements
- if (oPaging.iPage === 0) {
- $('a.prev', an[i]).addClass('disabled');
- } else {
- $('a.prev', an[i]).removeClass('disabled');
- }
-
- if (oPaging.iPage === oPaging.iTotalPages - 1 || oPaging.iTotalPages === 0) {
- $('a.next', an[i]).addClass('disabled');
- } else {
- $('a.next', an[i]).removeClass('disabled');
- }
- }
- }
- }
-});
diff --git a/umc-iui/src/main/resources/webroot/umc-monitor/monitorSetting.html b/umc-iui/src/main/resources/webroot/umc-monitor/monitorSetting.html
deleted file mode 100644
index 7073acbb..00000000
--- a/umc-iui/src/main/resources/webroot/umc-monitor/monitorSetting.html
+++ /dev/null
@@ -1,487 +0,0 @@
-<!--
-
- Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<!DOCTYPE html>
-<html>
-<head lang="en">
-<meta charset="UTF-8">
- <link href="../component/thirdparty/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
- <link href="../component/thirdparty/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
- <link href="../framework/css/ngict-component.css" rel="stylesheet" type="text/css">
- <link rel="stylesheet" type="text/css" href="../component/css/ZteIctIcons/style.css">
- <link href="../vendor/animate/animate.min.css" rel="stylesheet" type="text/css" />
- <link href="./css/monitorSetting.css" rel="stylesheet" />
-
-
-
-<style>
-.ms-controller {
- visibility: hidden
-}
-</style>
-</head>
-<body>
-<div>
- <div class="container-fluid" class="ms-controller" ms-controller="monitorController">
-
- <div id="monitorSettingDlg" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="content">
- <div class="modal-header">
- <button type="button" class="close" ms-click="cancelMonitorSet()">×</button>
- <h4 id="myModalLabel" ms-text="monitorSettingDlgInfo.titleName"></h4>
- </div>
- <div class="modal-body">
- <div class="alert alert-info" ms-visible="server_rtn.info_block" ms-text="server_rtn.rtn_info"></div>
- <div class="alert alert-danger " ms-visible="server_rtn.warning_block" ms-text="server_rtn.rtn_info"></div>
- <form class="form-horizontal" id="monitorSetting_form" role="form">
- <div class="form-group">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_dac_label" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" name="name" ms-duplex="monitorInfo.label" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_ipaddress" name_i18n="com_zte_openo_umc_monitor_ui_i18n">IP Address</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" name="ipAddress" ms-duplex="monitorInfo.ipAddress" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_dac" name_i18n="com_zte_openo_umc_monitor_ui_i18n">DAC</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <select ms-each="dac.selectItems" name="PROXYIP" ms-duplex="monitorInfo.customPara.PROXYIP" class="form-control" style="width:150px">
- <option ms-attr-value='el.ipAddress'>{{el.ipAddress}}</option>
- </select>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group" ms-if="monitorInfo.customPara.VERSION!=null">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_version" name_i18n="com_zte_openo_umc_monitor_ui_i18n">version</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" name="VERSION" ms-duplex="monitorInfo.customPara.VERSION" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group" ms-if="monitorInfo.customPara.USERNAME!=null">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_user" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Login User</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" name="USERNAME" ms-duplex="monitorInfo.customPara.USERNAME" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group" ms-if="monitorInfo.customPara.PASSWORD!=null">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_password" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Login Password</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="password" name="PASSWORD" ms-duplex="monitorInfo.customPara.PASSWORD" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group" ms-if="monitorInfo.customPara.PROTOCOL!=null">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_protocol" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Login Protocol</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <select ms-each="$loginProtocol.selectItems" ms-duplex="monitorInfo.customPara.PROTOCOL" class="form-control" style="width:150px" name="ROTOCOL" id="select_protocol">
- <option ms-attr-value='el.cond_value'>{{el.name}}</option>
- </select>
- <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group" ms-if="monitorInfo.customPara.PORT!=null">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_port" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Login Port</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" name="PORT" ms-duplex="monitorInfo.customPara.PORT" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group" ms-if="monitorInfo.customPara.DBPORT!=null">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_port" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Login Port</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" name="DBPORT" ms-duplex="monitorInfo.customPara.DBPORT" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
-
- <div class="form-group" ms-if="monitorInfo.customPara.SNMPPORT!=null">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_snmpport" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Snmp Port</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" name="SNMPPORT" ms-duplex="monitorInfo.customPara.SNMPPORT" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group" ms-if="monitorInfo.customPara.SNMPVERSION!=null">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_snmpversion" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Snmp Version</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" name="SNMPVERSION" ms-duplex="monitorInfo.customPara.SNMPVERSION" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group" ms-if="monitorInfo.customPara.SNMPCOMMUNITY!=null">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_snmpcommunity" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Snmp Community</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" name="SNMPCOMMUNITY" ms-duplex="monitorInfo.customPara.SNMPCOMMUNITY" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group" ms-if="monitorInfo.customPara.IPADDRESS2!=null">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_agentIP" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Agent IP</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" name="IPADDRESS2" ms-duplex="monitorInfo.customPara.IPADDRESS2" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group" ms-if="monitorInfo.customPara.USERNAME2!=null">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_agentUsername" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Agent Username</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" name="USERNAME2" ms-duplex="monitorInfo.customPara.USERNAME2" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group" ms-if="monitorInfo.customPara.PASSWORD2!=null">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_agentPassword" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Agent Password</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" name="PASSWORD2" ms-duplex="monitorInfo.customPara.PASSWORD2" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group" ms-if="monitorInfo.customPara.PROTOCOL2!=null">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_agentProtocol" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Agent Protocol</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" name="PROTOCOL2" ms-duplex="monitorInfo.customPara.PROTOCOL2" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group" ms-if="monitorInfo.customPara.PORT2!=null">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_agentPort" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Agent port</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" name="PORT2" ms-duplex="monitorInfo.customPara.PORT2" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
- <div class="form-group" ms-if="monitorInfo.customPara.PPMAXCOUNT!=null">
- <label class="control-label col-sm-3">
- <span id="com_zte_openo_umc_monitor_monitorsetting_ppMaxCount" name_i18n="com_zte_openo_umc_monitor_ui_i18n">PP Max Count</span>
- <span class="required" aria-required="true">*</span>
- </label>
- <div class="col-sm-7">
- <input type="text" name="PPMAXCOUNT" ms-duplex="monitorInfo.customPara.PPMAXCOUNT" class="form-control"/>
- <span class="help-block"></span>
- </div>
- </div>
- </form>
- </div>
- <div class="modal-footer">
- <!--button class="btn btn-success" type="submit" ms-click="testMonitorSet()">Access Test</button-->
- <button class="btn btn-primary" type="submit" ms-click="saveMonitorSet()" id="com_zte_openo_umc_monitor_btn_save" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Save</button>
- <button class="btn" ms-click="cancelMonitorSet()" id="com_zte_openo_umc_monitor_btn_cancel" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Cancel</button>
- </div>
- </div>
-
- </div>
- </div>
- </div>
-
- <div class="row" style=" margin-top: 15px;">
- <div class="col-xs-6 col-sm-12 col-md-6 col-lg-6">
- <span class=" titlefont" id="com_zte_openo_umc_monitor_monitorsetting_titlename" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Monitor Para Setting </span>
-
- </div>
- <div class="pull-right">
- <a href="#" ms-click="gotoMonitorListPage()" ><i class="fa fa-reply "></i> <span id="com_zte_openo_umc_monitor_return" name_i18n="com_zte_openo_umc_monitor_ui_i18n">return</span></a>
-
- </div>
-
- </div>
- <div class="separator-line"></div>
-
- <div class="row row-fluid">
-
- <button class="btn white radius_l" id="app-new-btn" style=" margin-bottom: 10px;"
- ms-click="updateMonitorSet()">
- <i class="ict-gear"></i> <span id="com_zte_openo_umc_monitor_btn_monitorset" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Monitor Set</span>
- </button>
-
-
- <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 row" >
-
- <div class="form-body">
-
- <div style="width:100%;" id="MonitorContent" class="collapse in main collapseContent">
- <div class="col-xs-6 col-md-6 col-sm-6 col-lg-6 border-right" >
- <div class="monitor-icon">
- <div class="timeline-badge info">
- <i class="ict-VDU"></i>
- </div>
- </div>
- <div style="float:left">
- <ul>
- <li><b><span id="com_zte_openo_umc_monitor_dac_label" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.label"></span></li>
- <li><b><span id="com_zte_openo_umc_monitor_monitorsetting_ipaddress" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.ipAddress"></span></li>
- <li><b><span id="com_zte_openo_umc_monitor_monitorsetting_dac" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.PROXYIP"></span></li>
-
- </ul>
- </div>
- </div>
-
- <div class="col-xs-6 col-md-6 col-sm-6 col-lg-6" >
-
- <div class="proxy_div">
- <ul>
- <li ms-if="monitorInfo.customPara.VERSION!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_version" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.VERSION"></span></li>
- <li ms-if="monitorInfo.customPara.USERNAME!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_user" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.USERNAME"></span></li>
- <li ms-if="monitorInfo.customPara.PROTOCOL!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_protocol" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.PROTOCOL"></span></li>
- <li ms-if="monitorInfo.customPara.PORT!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_port" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.PORT"></span></li>
- <li ms-if="monitorInfo.customPara.DBPORT!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_port" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.DBPORT"></span></li>
- <li ms-if="monitorInfo.customPara.SNMPPORT!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_snmpport" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.SNMPPORT"></span></li>
- <li ms-if="monitorInfo.customPara.SNMPVERSION!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_snmpversion" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.SNMPVERSION"></span></li>
- <li ms-if="monitorInfo.customPara.SNMPCOMMUNITY!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_snmpcommunity" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.SNMPCOMMUNITY"></span></li>
- <li ms-if="monitorInfo.customPara.IPADDRESS2!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_agentIP" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.IPADDRESS2"></span></li>
- <li ms-if="monitorInfo.customPara.USERNAME2!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_agentUsername" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.USERNAME2"></span></li>
- <li ms-if="monitorInfo.customPara.PASSWORD2!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_agentPassword" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.PASSWORD2"></span></li>
- <li ms-if="monitorInfo.customPara.PROTOCOL2!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_agentProtocol" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.PROTOCOL2"></span></li>
- <li ms-if="monitorInfo.customPara.PORT2!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_agentPort" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.PORT2"></span></li>
- <li ms-if="monitorInfo.customPara.PPMAXCOUNT!=null"><b><span id="com_zte_openo_umc_monitor_monitorsetting_ppMaxCount" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>: </b> <span ms-text="monitorInfo.customPara.PPMAXCOUNT"></span></li>
- </ul>
- </div>
- </div>
-
- </div>
- </div>
- </div>
-
-
-
- </div>
-
-
-</div>
-
-<script type="text/javascript" src="../component/thirdparty/jquery/jquery-1.10.2.min.js"></script>
-<script type="text/javascript" src="../component/thirdparty/bootstrap/js/bootstrap.min.js"></script>
-<script src="../component/thirdparty/jquery-validation/js/jquery.validate.js"></script>
-<script type="text/javascript" src="../component/thirdparty/jquery.i18n/jquery.i18n.properties-1.0.9.js"></script>
-<script src="../vendor/bootstrap-growl/bootstrap-growl.min.js"></script>
-<script src="../vendor/avalon/avalon.js"></script>
- <script type="text/javascript" src="../framework/js/tools.js"></script>
- <script type="text/javascript" src="../framework/js/core/hk.min.js" ></script>
-<script src="./js/monitorSettingUtil.js"></script>
-<script src="./js/monitorSettingController.js"></script>
-<script src="./i18n/loadi18nApp_ngict-umc-monitor.js"></script>
-
-<script>
-
-
-
- var lang= getLanguage();
- loadPropertiesSideMenu(lang, 'umc-monitor-iui-i18n', 'i18n/');
-
-
- var monitorUrlParm = window.location.search.split(":");
- if (monitorUrlParm && monitorUrlParm.length > 0) {
- var oid = decodeURIComponent(monitorUrlParm[0]).replace("?","");
-
- }
-
- vm.queryMonitorInstance(oid);
- vm.queryDACs();
-
-
-
-
- jQuery.validator.addMethod("ip", function(value, element) {
- return this.optional(element) || /^(([-9]|([1-9]\d)|(1\d\d)|(2([0-4]\d|5[0-5])))\.)(([0-9]|([1-9]\d)|(1\d\d)|(2([0-4]\d|5[0-5])))\.){2}([1-9]|([1-9]\d)|(1\d\d)|(2([0-4]\d|5[0-5])))$/.test(value);
- }, $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_ipaddress_format_errInfo'));
-
- var form = $('#monitorSetting_form');
- var error = $('.alert-danger', form);
- var success = $('.alert-success', form);
-
- form.validate({
- doNotHideMessage: true, //this option enables to show the error/success messages on tab switch.
- errorElement: 'span', //default input error message container
- errorClass: 'help-block', // default input error message class
- focusInvalid: false, // do not focus the last invalid input
- rules: {
-
- USERNAME:{
- required: true,
- maxlength:30
- },
- PASSWORD:{
- required: true,
- maxlength:30
- },
- PORT:{
- required: true,
- digits:true,
- maxlength:5
- },
- DBPORT:{
- required: true,
- digits:true,
- maxlength:5
- },
- PROXYIP:{
- required: true,
- },
- PROTOCOL:{
- required: true
- },
- ipAddress:{
- required: true,
- ip:true,
- maxlength:20
- },
- name:{
- required: true,
- maxlength:30
- }
- },
- messages: {
- USERNAME:{
- required: $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_user_empty_errInfo')
-
- },
- PASSWORD:{
- required: $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_password_empty_errInfo')
- },
- PORT:{
- required: $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_port_empty_errInfo')
- },
- DBPORT:{
- required: $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_port_empty_errInfo')
- },
- PROXYIP:{
- required: $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_dac_empty_errInfo')
- },
- PROTOCOL:{
- required: $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_protocol_empty_errInfo')
- },
- ipAddress:{
- required: $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_ipaddress_empty_errInfo')
- },
- name:{
- required: $.i18n.prop('com_zte_openo_umc_monitor_monitorsetting_name_empty_errInfo')
- }
-
- },
- errorPlacement: function (error, element) { // render error placement for each input type
- error.insertAfter(element); // for other inputs, just perform default behavior
- },
-
- invalidHandler: function (event, validator) { //display error alert on form submit
- success.hide();
- error.show();
- //ZteFrameWork.scrollTo(error, -200);
- },
-
- highlight: function (element) { // hightlight error inputs
- $(element)
- .closest('.form-group').removeClass('has-success').addClass('has-error'); // set error class to the control group
- },
-
- unhighlight: function (element) { // revert the change done by hightlight
- $(element)
- .closest('.form-group').removeClass('has-error'); // set error class to the control group
- },
-
- success: function (label) {
- label
- .addClass('valid') // mark the current input as valid and display OK icon
- .closest('.form-group').removeClass('has-error'); // set success class to the control group
- },
- submitHandler: function (form) {
- success.show();
- error.hide();
- //add here some ajax code to submit your form or just call form.submit() if you want to submit the form without ajax
- }
-
- });
-
- $("#select_protocol").change(function(){
- var checkValue=$("#select_protocol").val();
- if(checkValue=="SSH"){
- vm.monitorInfo.customPara.LOGINPORT="22";
- }
- else if(checkValue=="TELNET"){
- vm.monitorInfo.customPara.LOGINPORT="23";
- }
- });
-
-</script>
-
-</body>
-</html> \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-monitor/monitorSettingList.html b/umc-iui/src/main/resources/webroot/umc-monitor/monitorSettingList.html
deleted file mode 100644
index bdd3955f..00000000
--- a/umc-iui/src/main/resources/webroot/umc-monitor/monitorSettingList.html
+++ /dev/null
@@ -1,126 +0,0 @@
-<!--
-
- Copyright (C) 2015 ZTE, Inc. and others. All rights reserved. (ZTE)
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<!DOCTYPE html>
-<html>
-<head lang="en">
-<meta charset="UTF-8">
-<link href="../component/thirdparty/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
- <link href="../component/thirdparty/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
- <link href="../vendor/animate/animate.min.css" rel="stylesheet" type="text/css" />
- <link href="../framework/css/ngict-component.css" rel="stylesheet" type="text/css">
-<link rel="stylesheet" type="text/css" href="../component/css/ZteIctIcons/style.css">
-<link href="./css/monitorSetting.css" rel="stylesheet" />
-<link href="./css/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
-
-
-
-<style>
-.ms-controller {
- visibility: hidden
-}
-</style>
-</head>
-<body>
-
- <div class="container-fluid" class="ms-controller" ms-controller="monitorController">
-
-
-
- <div class="row" style=" margin-top: 15px;">
- <div class="col-xs-6 col-sm-12 col-md-6 col-lg-6">
- <span class=" titlefont" id="com_zte_openo_umc_monitor_monitorList_titeName" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Monitor Para List </span>
- </div>
-
- </div>
- <div class="separator-line"></div>
- <button class="btn white radius_l" id="app-new-btn" style=" margin-bottom: 10px;" ms-click="gotoDACPage()">
- <i class="ict-it-net"></i>
- <span id="com_zte_openo_umc_monitor_monitorList_dac_manage" name_i18n="com_zte_openo_umc_monitor_ui_i18n"></span>
- </button>
-
-
- <div class="row row-fluid">
- <table class="table table-striped table-bordered table-hover dataTable " id="monitorManagerTable">
- <thead>
- <tr class="heading">
- <th style="width: 80px;" id="com_zte_openo_umc_monitor_monitorList_monitor_sn" name_i18n="com_zte_openo_umc_monitor_ui_i18n">SN</th>
- <th id="com_zte_openo_umc_monitor_monitorList_monitor_name" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Display Name</th>
- <th id="com_zte_openo_umc_monitor_monitorList_monitor_ipaddress" name_i18n="com_zte_openo_umc_monitor_ui_i18n">IP Address</th>
- <th id="com_zte_openo_umc_monitor_monitorList_monitor_dacip" name_i18n="com_zte_openo_umc_monitor_ui_i18n">DAC IP Address</th>
- <th id="com_zte_openo_umc_monitor_monitorList_monitor_type" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Type</th>
- <th id="com_zte_openo_umc_monitor_monitorList_monitor_opr" name_i18n="com_zte_openo_umc_monitor_ui_i18n">Opr</th>
-
- </tr>
- </thead>
- <tbody ms-each-monitor="resource.monitorList">
- <tr>
- <td>{{$index+1}}</td>
- <td><a href="#" ms-click="gotoMonitorSettingPage(monitor.oid)">{{monitor.label}}</a></td>
- <td ms-text="monitor.ipAddress"></td>
- <td ms-text="monitor.customPara.PROXYIP"></td>
- <td>{{monitor.neTypeId}}</td>
- <td><a href="#" ms-click="deleteMonitorInfo(monitor.oid)">
- <span id="com_zte_openo_umc_monitor_monitorsetting_delete" name_i18n="com_zte_openo_umc_monitor_ui_i18n">delete</span>
- </a></td>
- </tr>
-
-
- </tbody>
- </table>
-
- </div>
-
-
-
- </div>
-
-
-
-
-<script type="text/javascript" src="../component/thirdparty/jquery/jquery-1.10.2.min.js"></script>
-<script type="text/javascript" src="../component/thirdparty/bootstrap/js/bootstrap.min.js"></script>
-<script type="text/javascript" src="../component/thirdparty/jquery.i18n/jquery.i18n.properties-1.0.9.js"></script>
- <script src="./i18n/loadi18nApp_ngict-umc-monitor.js"></script>
- <script type="text/javascript" src="../framework/js/tools.js"></script>
- <script type="text/javascript" src="../framework/js/core/hk.min.js" ></script>
-<script type="text/javascript">
-
-
- var lang= getLanguage();
- loadPropertiesSideMenu(lang, 'umc-monitor-iui-i18n', 'i18n/');
-
-</script>
-<script type="text/javascript" src="../vendor/data-tables/jquery.dataTables.min.js"></script>
-<script src="../vendor/bootstrap-growl/bootstrap-growl.min.js"></script>
-<script src="../vendor/avalon/avalon.js"></script>
-<script src="./js/monitorSettingUtil.js"></script>
-<script src="./js/monitorSettingController.js"></script>
-
-
-<script>
-$(function(){
-
- vm.queryMonitorList();
-
-});
-
-</script>
-
-
-</body>
-</html> \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/css/delete.me b/umc-iui/src/main/resources/webroot/umc-pm/css/delete.me
deleted file mode 100644
index e69de29b..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/css/delete.me
+++ /dev/null
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/css/meataskQuery.css b/umc-iui/src/main/resources/webroot/umc-pm/css/meataskQuery.css
deleted file mode 100644
index 36110391..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/css/meataskQuery.css
+++ /dev/null
@@ -1,872 +0,0 @@
-body{
- font-family: microsoft yahei !important;
-}
-body {
- font-family: 'Open Sans', sans-serif;
- background-color: #f1f3fa;
- width: '100%';
- height: '100%';
- margin-top: 5px;
-}
-
-/* blue pill (inspired by iTunes)
-*******************************************************************************/
-/*.previous, .green {
- border-radius: 20px;
- padding: 8px 0;
- text-align: center;
- width: 100px;
- margin-right: 20px;
-}
-.blue {
- background-color: #fff;
- border-radius: 20px;
- color:#5b9bd1;
- font-weight:bold;
- padding: 8px 0;
- text-align: center;
- width: 100px;
- margin-right: 20px;
-}
-.blue:hover {
- background-color: #e8f3fd;
- color:#5b9bd1;
- }
-.blue.selected{
-border:0;
-background-color: #5b9bd1;
-color:#fff;
-}
-.blue.selected:hover{
-border:0;
-background-color: #5b9bd1;
-color:#fff;
-}*/
-
-a {
- /* font-weight: bold;*/
- text-decoration: none !important; }
-
-p {
- color: #444;
- font-size: 14px;
- font-weight: normal;
- line-height: 21px;
- margin: 0 0 12px 0; }
-
-p.credit {
- border-top: 1px solid #ccc;
- font-size: 14px;
- line-height: 140%;
- margin: 36px 0 12px 0;
- padding: 8px 0 0 0;
- text-align: center; }
-
-
-ul.column {
- float: left;
- list-style: none;
- width: 675px; }
-ul.column li {
- background: #eee;
- -webkit-border-radius: 5px;
- border-radius: 5px;
- -webkit-box-shadow: inset 0 1px 1px 0 #c7c7c7;
- box-shadow: inset 0 1px 1px 0 #c7c7c7;
- float: left;
- margin: 10px 0 0 10px;
- display: block;
- height: 150px;
- text-align: center;
- width: 215px; }
-
-
-/* Clear Floated Elements
-------------------------------------------------------------------------------*/
-.column:after,
-.button-collection:after,
-.clearfix:after,
-div.project-info:after {
- clear: both;
- content: ' ';
- display: block;
- font-size: 0;
- line-height: 0;
- visibility: hidden;
- width: 0;
- height: 0; }
-
-.nav-tabs{
-border:0;
-}
-.nav-tabs>li.active>a, .nav-tabs>li.active>a:hover, .nav-tabs>li.active>a:focus{
-border:0;
-border-top:3px solid #F3565D;
-}
-.nav-tabs>li>a{
-border-radius:0;
-}
-.nav-tabs>li>a:hover{
-background-color:#f1f3fa;
-border:1Px solid #f1f3fa;
-}
-.c3{
-margin-top:120px;
-}
-.skills-chart-breadcrumb{
-
-}
-
-.blue:selected{
-border:0;
-background-color: #5b9bd1;
-}
-.btn {
- /* border-width: 0; */
- /* padding: 7px 14px; */
- /* font-size: 14px; */
- /* outline: none !important; */
- /* background-image: none !important; */
- /* filter: none; */
- /* -webkit-box-shadow: none; */
- -moz-box-shadow: none;
- /* box-shadow: none; */
- /* text-shadow: none; */
-}
-
-.btn-default, select {
-border-width: 1px;
-padding: 4px 1px;
-border-radius: 4px;
-}
-
-.input-sm {
- padding: 4px 10px;
-}
-
-.btn-block {
- display: block;
- width: 100%;
- padding-left: 0;
- padding-right: 0;
-}
-
-/* Bootstrap buttons */
-.btn-default {
- color: #5b9bd1;
- background-color: #fff;
- border-color: #ccc;
-
-}
-.btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default.active {
- color: #333;
- background-color: #ededed;
- border-color: #b3b3b3;
-}
-.open .btn-default.dropdown-toggle {
- color: #333;
- background-color: #ededed;
- border-color: #b3b3b3;
-}
-.btn-default:active, .btn-default.active {
- background-image: none;
- background-color: #e0e0e0;
- font-weight: bold;
-}
-.btn-default:active:hover, .btn-default.active:hover {
- background-color: #e6e6e6;
-}
-.open .btn-default.dropdown-toggle {
- background-image: none;
-}
-.btn-default.disabled, .btn-default.disabled:hover, .btn-default.disabled:focus, .btn-default.disabled:active, .btn-default.disabled.active, .btn-default[disabled], .btn-default[disabled]:hover, .btn-default[disabled]:focus, .btn-default[disabled]:active, .btn-default[disabled].active, fieldset[disabled] .btn-default, fieldset[disabled] .btn-default:hover, fieldset[disabled] .btn-default:focus, fieldset[disabled] .btn-default:active, fieldset[disabled] .btn-default.active {
- background-color: #fff;
- border-color: #ccc;
-}
-.btn-default .badge {
- color: #fff;
- background-color: #333;
-}
-.btn-default > i {
- color: #aaa;
-}
-.btn-default > i[class^="icon-"],
-.btn-default > i[class*="icon-"] {
- color: #8c8c8c;
-}
-
-div[data-name="tab_zone"] div{
- background-color:#f1f3fa;
- padding:0px;
-}
-
-
-div[data-name="cond_zone"] div{
- background-color: #fff;
- margin-top:15px;
- margin-bottom:15px;
-}
-
-div[data-name="log-otherConds-zone"]{
- display:inline;
-}
-
-div[data-name="log-otherConds-zone"] select ,div[data-name="log-otherConds-zone"] span{
- /**height:33px;*/
- margin-left:15px;
- color:#5b9bd1;
- border-color:#ccc;
- font-weight: bold;
-}
-
-div.separator div{
- text-align: center;
- line-height:0;
-}
-div.separator-sline{
- height:28px ;
- width:3px;
-}
-
-.dropdown-toggle{
-color:#5b9bd1;
-}
-.calendar-date{
-color:#5b9bd1;
-}
-.range_inputs{
-color:#5b9bd1;
-}
-.btn.dropdown-toggle, .btn-group .btn.dropdown-toggle, .btn:hover, .btn:disabled, .btn[disabled], .btn:focus, .btn:active, .btn.active {
- outline: none !important;
- background-image: none !important;
- filter: none;
- -webkit-box-shadow: none;
- -moz-box-shadow: none;
- box-shadow: none;
- text-shadow: none;
-}
-
-#skills-chart-breadcrumb{
-margin-bottom:10px
-}
-
-
-/*增加daterangepicker的css*/
-input[name="daterange"]{
- width: 220px;
- line-height:0;
- height: 31px;
- vertical-align: top;
- margin-top: 2px;
-
-}
-
-.daterangepicker .ranges{
- width: 205px;
-}
-.daterangepicker .ranges input{
- width:95px !important;
-}
-
-td.details-control {
- background: url('../images/details_open.png') no-repeat center center;
- cursor: pointer;
-}
-tr.shown td.details-control {
- background: url('../images/details_close.png') no-repeat center center;
-}
-
-
-.details table td{
- word-wrap: break-word;
- word-break: normal;
- border-top: 1px solid #dddddd;
-}
-
-.details table tr:first-child td {
- border-top: none;
-}
-
-.details table{
- table-layout:fixed;
- width:100%;
-}
-
-td.title{
- width:10%;
-}
-
-table.dataTable tbody th, table.dataTable tbody td {
-padding: 8px 10px;
-}
-
-div.dataTables_length ,div.dataTables_info{
- display: inline;
-}
-
-div.dataTables_paginate{
- display: inline;
- float: right;
-}
-
-div.pagination-panel{
- margin-right:10px;
-}
-
-input.pagination-panel-input{
- width:50px;
-}
-
-#ict_log_table_div{
- margin-top:15px;
-}
-
-
-#ict_sm_table_div label{
- font-weight:100;
-}
-
-.daterangepicker .daterangepicker_start_input label, .daterangepicker .daterangepicker_end_input label{
-color:#5b9bd1;
-
-}
-.daterangepicker .ranges .input-mini{
- color:#5b9bd1;
- }
-.cancelBtn {
- padding:5px 10px 5px 10px;
-}
-.btn:focus, .btn:active:focus, .btn.active:focus{
- outline:0;
-}
-
-#ict_log_table_div table{
-
-}
-/*
-.box{
-height:115px ;
-color:white;
-text-align:right;
-border-radius:8px;
-padding-right:10%;
-padding-top:30px;
-padding-bottom:100px;
-font-size:14px;
-margin: 5px;
-}
-*/
-.box0{
-display:none !important
-
-}
-.box1{
-background-image:url(../images/userGroup.png);
-background-repeat:no-repeat;
-background-color:#578ebe !important;
-height:3px !important;
-background-position-y:100%;
-}
-.box2{
-background-image:url(../images/loginUser.png);
-background-repeat:no-repeat;
-background-color:#44b6ae !important;
-height:3px !important;
-background-position-y:100%;
-}
-.box3{
-background-image:url(../images/blackList.png);
-background-repeat:no-repeat;
-background-color:#c0af69 !important;
-height:3px !important;
-background-position-y:100%;
-}
-.box4{
-background-image:url(../images/lockUser.png);
-background-repeat:no-repeat;
-background-color:#e35b5a !important;
-height:3px !important;
-background-position-y:100%;
-}
-.box5{
-background-image:url(../images/userGroup.png);
-background-repeat:no-repeat;
-background-color:#578ebe !important;
-height:3px !important;
-background-position-y:100%;
-}
-.box6{
-background-image:url(../images/loginUser.png);
-background-repeat:no-repeat;
-background-color:#44b6ae !important;
-height:3px !important;
-background-position-y:100%;
-}
-.box7{
-background-image:url(../images/lockUser.png);
-background-repeat:no-repeat;
-background-color:#e35b5a !important;
-height:3px !important;
-background-position-y:100%;
-}
-.box8{
-background-image:url(../images/userGroup.png);
-background-repeat:no-repeat;
-background-color:#578ebe !important;
-height:3px !important;
-background-position-y:100%;
-}
-.box9{
-background-image:url(../images/loginUser.png);
-background-repeat:no-repeat;
-background-color:#44b6ae !important;
-height:3px !important;
-background-position-y:100%;
-}
-.boxPadding{
-padding-left:15px;
-padding-right:0px;
-}
-.row1 .separator-line{
-margin-bottom:5px;
-}
-.row a{
-/*color:white;*/
-font-weight:normal;
-font-size:14px;
-
-}
-.btnBlue {
- background-color: #5b9bd1;
- border-radius: 20px;
- color: white;
- font-weight: normal;
- text-align: center;
- min-width: 80px;
-}
-.btnBlue:hover{
- background-color: #487ca9 !important;
- color:#fff !important;
-}
-.btnBlue1 {
- background-color: #5b9bd1;
- border-radius: 20px;
- color: white;
- font-weight: normal;
- text-align: center;
- min-width: 80px;
-}
-.btnGrey {
- background-color: #d3d1d1;
- border-radius: 20px;
- color: black !important;
- font-weight: normal;
- padding: 8px 0;
- text-align: center;
- width: 70px;
-}
-.smLianJie {
-color:#5b9bd1 !important;
-font-weight:normal;
-display:inline-block;
-margin-top:25px;
-font-size:14px
-}
-
-.smLianJie span{
-padding:2px;
-}
-.rightDiv{
-float:right;
-color:#5b9bd1 !important;
-}
-.num{
-font-size:30px;
-font-family:arial;
-font-weight:bold;
-}
-.numdiv{
-margin-bottom:20px;
-}
-.ruleDiv{
-text-align:center;
-}
-
-.ruleDiv1{
-padding-top:20px;
-text-align:center;
-}
-.fmTypeDiv{
- padding: 20px;
- text-align: center;
- font-size: 16px;
- background: white;
- margin-top: 5px;
- margin-left: 30px;
- margin-right: 10px;
- height: 105px;
-}
-.container-fluid{
-background-color:white !important;
-/*margin-top:25px;*/
-min-height:500px;
-}
-.titlefont{
- font-size:16px;
-}
-.label{
- font-weight: 400;
- /*font-size: 14px; */
-}
-.v5h5{
- font-size: 16px;
- color:#5b9bd1 !important;
- font-weight:bold !important;
-}
-.v5label{
- padding-top: 5px !important;
- font-size: 13px;
- text-align:right;
-}
-.v5lineColor1{
- background-color:#578ebe !important;
-}
-.box1:hover{
- background-color:#487ca9 !important;
-}
-
-.box2:hover{
- background-color: #329d96 !important;
-}
-.box3:hover{
- background-color:#ad9a4d !important;
-}
-.box4:hover{
- background-color:#d45150 !important;
-}
-.v5spinner{
- width:50px;
- margin-left:10px;
- margin-right:10px;
-}
-.ff{
- float:left;/*左漂浮*/
- width: 1px;
- height: 25px;/*竖线高度*/
- background: #000;/*填充颜色*/
-}
-.radio-list{
- padding-top:0px;
-}
-.row1{
- margin-right: 0px !important;
-}
-
-#ict_sm_tableloginUser_wrapper .ict-legendshow,
-#ict_sm_tablelockUser .ict-unlock
-{
- margin-right:6px;
-}
-#ict_sm_tableallUser > thead > tr > th,#ict_sm_tableloginUser > thead > tr > th,#ict_sm_tablelockUser > thead > tr > th{
- background:white;
- background-color:white !important;
-}
-#weakregularity{color:#468ECE;border-bottom: 1px #468ECE dotted;margin:0px !important;}
-#weakregularity_tip{
- position:absolute;
- display:none;
- background:#000;
- opacity:0.8;
- border:1px solid #ddd !important;
- font-size:0.8em;
- margin-top:-1%;
- margin-left:15%;
- box-shadow:2px 3px 5px #C8C8C8;
- border-radius:8px;
- padding:20px 5px;
- z-index:999;
- width:530px;
- height:270px;
- color:#fff;
- line-height:25px;
-}
-#weakregularity_tip > ul > li{margin-top:4px;list-style-type:disc;}
-#weakregularity_tip > ul > li:first-child{margin-top:0px;}
-#com_zte_ums_ict_sm_new_user_isPasswordChanged > span,
-#com_zte_ums_ict_sm_new_user_passwordvaliddays > span
-{
- margin:0px 6px;
-}
-#forceExit{
- /**padding:3px 18px 3px 10px;
- cursor:pointer;
- border:1px solid #ddd;
- border-radius:12px;
- text-shadow:0 1px 0 hsla(0,0%,100%,0.75);
- //background-image:url("../images/forceOut.png");
- //background-repeat:no-repeat;
- //background-size:20% 70%;
- background-position:left 10% top 45%;**/
- margin-bottom:10px;
-}
-
-/*#forceExit:hover{
- background-color:#F9F9F9;
-}*/
-.smLianJie:hover{
- cursor:pointer;
-}
-div.checker,div.checker span{
- width:22px;
- height:22px;
- background:#fff;
-}
-.row1 .col-xs-10, .row1 .col-md-10, .row1 .col-sm-10, .row1 .col-lg-10{
-width:87% !important;
-}
-.row1 .col-xs-2, .row1 .col-md-2, .row1 .col-sm-2, .row1 .col-lg-2{
-width:13% !important;
-}
-.modify_user{
-padding-left:0px;
-}
-.btn-xs{
-color:#333;
-font-size:14px;
-}
-.btn-xs:hover{
-color:#333
-}
-ul.ztree {margin-top: 10px;border: 1px solid #E0E0E0;/*background: #f0f6e4;width:220px;height:360px;*/overflow-y:auto;overflow-x:auto;/*ict*/padding: 25px;}
-#new_rule_body{
-padding-left:25px;
-}
-.rule_title{
-padding:8px;
-margin-bottom:25px;
-border-left: 2px solid #5b9bd1;
-color:#1A78CA;
-font-size:16px;
-}
-.group{
-margin-top:25px;
-}
-
-h5.form-section, .checkbox-list, .panel-title{
- font-family: microsoft yahei !important;
- color: #333;
- <!-- padding-bottom: 15px !important; -->
-}
-.right_assign_box{
-height:400px;
-overflow-y:auto;
-overflow-x:hidden;
-border:1px solid #e0e0e0;
-}
-.right_assign_box ul.ztree{
-border:0;
-}
-.right_assign_box .table-bordered{
- border:0;
- }
-.right_assign_box .table-bordered>thead>tr>th, .right_assign_box .table-bordered>tbody>tr>th, .right_assign_box .table-bordered>tfoot>tr>th, .right_assign_box .table-bordered>thead>tr>td, .right_assign_box .table-bordered>tbody>tr>td, .right_assign_box .table-bordered>tfoot>tr>td{
- border-left:0;
- padding:8px 18px;
-}
-.right_assign_box .table>thead>tr>th{
- border:0;
-}
-#com_zte_ums_ict_sm_new_user_maxlogin .form-control{
-width:30%;
-display:inline;
-margin-left:10px;
-}
-
-.div_padding{
- padding-left:75px;
-}
-#lockThreshold{width:80%;}
-#lockThreshold_select{width:100%;height:20px;font-size:0.8em;color:black;margin-top:10px;}
-#lockThreshold_1{position:absolute;cursor:pointer;width:auto;}
-#lockThreshold_2{position:absolute;cursor:pointer;width:auto;}
-#lockThreshold_3{position:absolute;cursor:pointer;width:auto;}
-
-.delete-icon {
- float: right;
- /* padding: 5px; */
- cursor: pointer;
- position: relative;
- display: inline-block;
- margin-right: 2%;
-}
-.delete-icon img {
- position: absolute;
- right: 0px;
-}
-.removeIcon {
- width: 22px;
- height: 22px;
- float: right;
- margin-right: -8px;
- margin-top: -8px;
- background: url(/ngict/iui/component/ict/ict-dashboard/images/delete.png) no-repeat 0px 0px;
- cursor: pointer;
-}
-.deleteIconHidden{
- opacity:0;
-}
-.nam{
- font-size: 15px;
-}
-.queryLink{
- font-size: 15px;
- margin-top: 10px;
-}
-.carousel-control {
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- width: 3% !important;
- opacity: .5;
- filter: alpha(opacity=50);
- font-size: 20px;
- color: #fff;
- text-align: center;
- text-shadow: 0 1px 2px rgba(0,0,0,.6);
-}
-.carousel-control .glyphicon-chevron-right {
- right: 10%;
-}
-.item {
- overflow: hidden;
- display: block;
- margin-bottom: 0px !important;
-}
-.page-info-bottom{
-margin-top:10px;
-}
-
-.deleteIcon {
- font-size:16px;
- cursor: pointer;
- margin-bottom: 10px;
- float: left;
- color:#a9c2d6;
- border:1px solid #eef5fb;
- border-radius:20px;
- padding:3px;
-}
-.deleteIcon:hover {
-border:1px solid #e74c3c;
-color:#e74c3c;
-}
-.resourceObj {
- margin-left: 30px;
- margin-top:3px;
-}
-
-.resourceList th {
- background-color: #D3E7F8 !important;
- border: 1px solid #CEE5F9 !important;
-}
-.resourceList td {
- background-color: #EEF5FB !important;
- padding-top: 20px !important;
- border: 1px solid #CEE5F9 !important;
-}
-.filterDiv {
- margin-bottom:0;
-
-}
-.filterDiv input{
- border: 1px solid #ddd;
- //border-radius:3px;
- height:30px;
- width:100%;
- border-bottom:0;
-}
-.boxLabel {
- background-color: #D3E7F8;
- margin-left: 26%;
- border: 1px solid #E2EFFA;
- padding: 8px;
-}
-.blueactive {
- color: #ffffff !important;
- background-color: #5b9bd1;
-}
-.btnWhite {
- font-size: 14px;
- line-height: 15px;
- border: 1px solid #cccccc;
-}
-#taskTimeDiv {
- margin-top: 8px;
-}
-.daterangepicker .ranges input[type="text"] {
- width: 76px !important;
- font-size: 11px;
- vertical-align: middle;
-}
-#queryTimeRange {
- width: 275px;
- padding: 6px;
- border: 1px solid #ddd;
-}
-.selector-class{
- width: 200px;
-}
-.table{
- margin-bottom: 0px;
-}
-.ict-modify{
- font-size:16px;
- float: right;
- margin-bottom:-10px;
- position:absolute;
- right:5px;
- bottom:30px;
-}
-.subbox{
- text-align:center;
-}
-.subbox .ict-modify{
- border:1px #fff solid;
- padding:3px;
- border-radius:5px;
-}
-.subbox .ict-modify:hover{
- background-color:#fff;
- color:#709bce;
-}
-.subbox .textImageStyle span{
- padding:10px;
- border-radius:30px;
- background-color:#fff;
- text-align:center;
- margin:0 auto;
- color:#b3c9e2;
- font-size:16px;
-}
-.textImageStyle{
- margin-bottom:4px;
-}
-.carousel-control .glyphicon-chevron-left{
- margin-left:-30px;
-}
-.carousel-control .glyphicon-chevron-right{
- margin-right:-10px;
-}
-.carousel-control.left, .carousel-control.right {
- background-image: none;
-}
-.carousel-control .glyphicon-chevron-left, .carousel-control .glyphicon-chevron-right, .carousel-control .icon-prev, .carousel-control .icon-next {
- /* margin-left: 0; */
- font-size: 25px;
- margin-top: -20px;
-}
-.resourceList .heading{
- font:12px normal "microsoft yahei";
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/css/performanceChart.css b/umc-iui/src/main/resources/webroot/umc-pm/css/performanceChart.css
deleted file mode 100644
index f9dee02d..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/css/performanceChart.css
+++ /dev/null
@@ -1,45 +0,0 @@
-.reveal-modal-bg {
- position: fixed;
- height: 100%;
- width: 100%;
- background: #000;
- background: rgba(0,0,0,.8);
- z-index: 100;
- display: none;
- top: 0;
- left: 0;
-}
-
-.reveal-modal {
- visibility: hidden;
- top: 100px;
- left: 200px;
- width: 1200px;
- background: #eee url(modal-gloss.png) no-repeat -200px -80px;
- position: fixed;
- z-index: 101;
- padding: 30px 40px 34px;
- -moz-border-radius: 5px;
- -webkit-border-radius: 5px;
- border-radius: 5px;
- -moz-box-shadow: 0 0 10px rgba(0,0,0,.4);
- -webkit-box-shadow: 0 0 10px rgba(0,0,0,.4);
- -box-shadow: 0 0 10px rgba(0,0,0,.4);
-}
-
-.reveal-modal.small {width: 200px; margin-left: -140px;}
-.reveal-modal.medium {width: 400px; margin-left: -240px;}
-.reveal-modal.large {width: 600px; margin-left: -340px;}
-.reveal-modal.xlarge {width: 800px; margin-left: -440px;}
-
-.reveal-modal .close-reveal-modal {
- font-size: 22px;
- line-height: .5;
- position: absolute;
- top: 8px;
- right: 11px;
- color: #aaa;
- text-shadow: 0 -1px 1px rbga(0,0,0,.6);
- font-weight: bold;
- cursor: pointer;
-}
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/css/pmQueryBox.css b/umc-iui/src/main/resources/webroot/umc-pm/css/pmQueryBox.css
deleted file mode 100644
index 7eb3dc8c..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/css/pmQueryBox.css
+++ /dev/null
@@ -1,299 +0,0 @@
-/*.row a {
- font-size: 14px;
-}*/
-
-#addRule {
- margin-bottom: 10px;
-}
-.btn.dropdown-toggle,
-.btn-group .btn.dropdown-toggle,
-.btn:hover,
-.btn:disabled,
-.btn[disabled],
-.btn:focus,
-.btn:active,
-.btn.active {
- outline: none !important;
- background-image: none !important;
- filter: none;
- -webkit-box-shadow: none;
- -moz-box-shadow: none;
- box-shadow: none;
- text-shadow: none;
-}
-.btn-rank {
- border-color: #ccc;
-}
-.alarm-serious {
- background-color: #de4040;
- color: #ffffff !important;
-}
-.alarm-serious:hover {
- background-color: #c23737 !important;
-}
-.alarm-important {
- background-color: #e37c29;
- color: #ffffff !important;
-}
-.alarm-important:hover {
- background-color: #c86e25 !important;
-}
-.alarm-secondary {
- background-color: #e9d426;
- color: #ffffff !important;
-}
-.alarm-secondary:hover {
- background-color: #d3c023 !important;
-}
-.alarm-slightly {
- background-color: #86bcdb;
- color: #ffffff !important;
-}
-.alarm-slightly:hover {
- background-color: #77a7c2 !important;
-}
-.btn-group.btn-group-circle > .btn:first-child {
- border-radius: 3px 0px 0px 3px;
-}
-.btn-group.btn-group-circle > .btn:last-child {
- border-radius: 0 3px 3px 0 !important;
-}
-.btn-group-circle {
- padding-bottom: 5px;
-}
-.open .btn-default.dropdown-toggle {
- color: #333;
- background-color: #ededed;
- border-color: #b3b3b3;
-}
-.btn-group .btn-default:active,
-.btn-group .btn-default.active {
- background-image: none;
- background-color: #5b9bd1;
- color: #fff;
-}
-.ruleBox {
- height: 175px;
-}
-.filterRule {
- background-image: url(../images/filter.png);
- background-repeat: no-repeat;
- background-position: center;
- text-align: center;
-}
-/*.boxPadding {
- padding-top: 60px;
-}*/
-.ruleRow {
- padding-left: 20px;
- padding-right: 30px;
- font-size: 15px;
-}
-.filterRuleRow {
- padding-left: 30px;
- padding-right: 20px;
- font-size: 15px;
-}
-.fRule {
- padding-left: 12%;
- padding-right: 12%;
-}
-.ruleNav .ruleBox .rule {
- margin-top: 5px;
- padding-left: 0px;
-}
-.bigText {
- height: 400px;
-}
-.bigText1 {
- margin-bottom: 20px;
- height: 320px;
-}
-.right_assign_box {
- height: 412px;
- overflow-y: auto;
- overflow-x: hidden;
- border: 1px solid #ccc;
- border-radius: 4px;
-}
-.boxHeight {
- height: 723px;
-}
-.right_assign_box1 {
- height: 800px;
- overflow-y: auto;
- overflow-x: hidden;
- border: 1px solid #e0e0e0;
-}
-.right_assign_box ul.ztree {
- border: 0;
-}
-.right_assign_box .table-bordered {
- border: 0;
-}
-.right_assign_box .table-bordered > thead > tr > th,
-.right_assign_box .table-bordered > tbody > tr > th,
-.right_assign_box .table-bordered > tfoot > tr > th,
-.right_assign_box .table-bordered > thead > tr > td,
-.right_assign_box .table-bordered > tbody > tr > td,
-.right_assign_box .table-bordered > tfoot > tr > td {
- border-left: 0;
- padding: 8px 18px;
-}
-.right_assign_box .table > thead > tr > th {
- border: 0;
-}
-ul.ztree {
- border: 1px solid #E0E0E0;
- /*background: #f0f6e4;width:220px;height:360px;*/
-
- overflow-y: auto;
- overflow-x: auto;
-}
-.rule_title {
- padding-left: 5px;
- margin-bottom: 15px;
- border-left: 2px solid #5b9bd1;
- color: #1A78CA;
- font-size: 16px;
-}
-.row1 .separator-line {
- margin-bottom: 5px;
-}
-.group {
- margin-top: 25px;
-}
-.ztree li span.button.diy1_icon {
- background: url("");
-}
-.titlefont {
- font-size: 16px;
-}
-#new_rule_body {
- padding-left: 25px;
-}
-#defaulInfo,
-#selectAralmCodes {
- border: 1px solid #e0e0e0;
-}
-.iconPosition div {
- color: #757575;
- cursor: pointer;
-}
-.iconPosition div:hover {
- color: #333;
-}
-#dataRange {
- margin-left: 15px;
-}
-.dataRow {
- margin-left: 15px;
-}
-.alarmLevel {
- margin-left: 15px;
-}
-.ruleList {
- background-color: #fff;
- min-height: 460px;
-}
-.ruleNav {
- // margin-bottom: 15px;
- margin-left: 15px;
- margin-right: 15px;
-}
-.right-assign-checked-box {
- height: 412px;
- overflow-y: auto;
- overflow-x: auto;
- border: 1px solid #e0e0e0;
-}
-.box {
- color: white;
- text-align: center;
- height: 80px !important;
- font-size: 14px;
-}
-.boxStyle1,
-.ProcessingSuggestion {
- background-repeat: no-repeat;
- background-color: #48C79C !important;
- background-position-y: 100%;
-}
-.boxStyle1:hover,
-.ProcessingSuggestion:hover {
- background-color: #64e2b8 !important;
-}
-.boxStyle2,
-.notifyFilter {
- background-repeat: no-repeat;
- background-color: #709BCE !important;
- background-position-y: 100%;
-}
-.boxStyle2:hover,
-.notifyFilter:hover {
- background-color: #87b2e4 !important;
-}
-.boxStyle3,
-.alarmBox {
- background-repeat: no-repeat;
- background-color: #9699E0 !important;
- background-position-y: 100%;
-}
-.boxStyle3:hover,
-.alarmBox:hover {
- background-color: #acaff1 !important;
-}
-.boxStyle4,
-.codesetting {
- background-repeat: no-repeat;
- background-color: #5BC0DE !important;
- background-position-y: 100%;
-}
-.boxStyle4:hover,
-.codesetting:hover {
- background-color: #8dd4eb !important;
-}
-.ruleNav .separator-line {
- margin-bottom: 5px;
- height: 3px;
-}
-.ruleNav .separator-line-visibilty {
- visibility: hidden;
-}
-a {
- text-decoration: none !important;
-}
-.subbox {
- padding-left: 5px;
- padding-right: 5px;
-}
-.textImageStyle {
- font-size: 24px;
- margin-right: 5px;
- vertical-align: middle;
- padding-left: 0;
- padding-bottom: 1px;
- padding-top: 14px;
-}
-#test1>div {
- margin-bottom: 15px;
-}
-.rule-submit {
- padding-left: 45px;
-}
-.sugg-box .form-control {
- margin-bottom: 15px;
-}
-/*.dataTables_info{
- float:right;
-}*/
-
-@media screen and (max-width: 900px) and (min-width: 600px) {
- .rule-pic {
- display: none;
- }
- .ruleNav .col-xs-10 {
- width: 100%;
- }
-}
-
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/html/index/indexManage.html b/umc-iui/src/main/resources/webroot/umc-pm/html/index/indexManage.html
deleted file mode 100644
index b45a47be..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/html/index/indexManage.html
+++ /dev/null
@@ -1,163 +0,0 @@
-<div class="container-fluid form-horizontal" id="new_index_body"
- style="height:100%;background-color:#FFF;overflow-x:hidden;overflow-y:auto">
- <div class="row creat-index">
- <div class="col-xs-6 left-form">
- <div id="action" class="group ">
-
-
- <div class="form-group checkbox-list" id="email">
- <label class="control-label col-xs-3">
-
- <span id="com_zte_ums_ict_pm_index_resourceType"
- name_i18n="com_zte_ums_ngict_pm_index">
- </span>
- </label>
-
- <div class="col-xs-9">
- <select id="resourceTypes" ms-duplex-String="selectedResourceType" class="selector-class"
- ms-change="resTypeSelectAction()">
- <option ms-repeat-el="resTypeArray">{{el.name}}</option>
- </select>
- </div>
- </div>
- <div class="form-group" id="message">
- <label class="control-label col-xs-3">
-
- <span id="com_zte_ums_ict_pm_index_moType"
- name_i18n="com_zte_ums_ngict_pm_index">
-
- </span>
- </label>
-
- <div class="col-xs-9">
- <div class="box">
- <div class="type-list" ms-repeat-el="moTypeArray">
- <input type="radio"
- ms-click="moTypeSelectAction(this)" ms-attr-value={{el.id}}
- name="moType"/><span> {{el.name}}<span>
- </div>
- </div>
- </div>
- </div>
- <div class="form-group" id="counterDiv">
- <label class="control-label col-xs-3">
-
- <span id="com_zte_ums_ict_pm_index_counter"
- name_i18n="com_zte_ums_ngict_pm_index">
-
- </span>
- </label>
-
- <div class="col-xs-9 ">
- <div class="box">
- <div ms-if="counterArray.length==0"><span class="tip" id="com_zte_ums_ict_pm_index_selectCounter"
- name_i18n="com_zte_ums_ngict_pm_index" ><span></div>
- <div class="type-list" ms-repeat-el="counterArray">
- <input type="radio" ms-attr-value={{el.id}} ms-click="counterSelectAction(this)" name="counter"/><span> {{el.name}}<span>
- </div>
- </div>
- </div>
- </div>
-
-
-
-
- </div>
- </div>
- <div class="col-xs-6">
- <div class="fixed_side">
-
- <div class="form-group " id="indexName">
- <label class="control-label col-xs-3 col-md-3 col-lg-2">
- <span id="com_zte_ums_ict_pm_index_indexName"
- name_i18n="com_zte_ums_ngict_pm_index">
-
- </span>
- <span class="required">
- *
- </span>
- </label>
-
- <div class="col-xs-9 col-md-8 col-lg-8">
- <input type="text" ms-duplex-string="indexName" class="form-control" name="name"
- id="ruleId"/>
- </div>
- </div>
- <div class="form-group" id="usernameDiv">
- <label class="control-label col-xs-3 col-md-3 col-lg-2">
- <span id="com_zte_ums_ict_pm_index_dataType"
- name_i18n="com_zte_ums_ngict_pm_index">
-
- </span>
- </label>
-
- <div class="col-xs-9 col-md-8 col-lg-8">
- <select class="selector-class" ms-duplex-String="selectedDataType">
- <option ms-repeat-el="dataTypeArray"><!--{{el.id}}-->{{el.name}}</option>
- </select>
-
- </div>
- </div>
- <div class="form-group" id="status">
- <label class="control-label col-xs-3 col-md-3 col-lg-2">
- <span id="com_zte_ums_ict_pm_index_indexDes"
- name_i18n="com_zte_ums_ngict_pm_index">
-
- </span>
- </label>
-
- <div id="state" class="col-xs-9 col-md-8 col-lg-8 btn-group btn-group-circle"
- data-toggle="buttons">
- <input type="text" ms-duplex-string="indexDescription" class="form-control" name="name"
- id="ruleId"/>
- </div>
- </div>
- <div class="form-group" id="ipInfos">
- <label class="control-label col-xs-3 col-md-3 col-lg-2">
- <span id="com_zte_ums_ict_pm_index_strExpresstion"
- name_i18n="com_zte_ums_ngict_pm_index">
-
- </span>
-
- </label>
-
- <div class="col-xs-9 col-md-8 col-lg-8">
- <textarea rows="5" ms-duplex-string="strExpresstion" class="form-control" name="name"
- id="ruleId"></textarea>
-
- </div>
- </div>
- <div class="countTable form-group">
-
- <div class="col-xs-offset-3 col-md-offset-3 col-lg-offset-2 col-xs-9 col-md-8 col-lg-8 calculator">
- <table class="table table-bordered " cellpadding="0"
- cellspacing="0" border="0">
- <tbody>
- <tr ms-repeat-el="countArray">
- <td ms-repeat-elem="el.count" width="20%"><button ms-attr-value={{elem}} ms-click="countClick(this)">{{elem}}</button></td>
- <td ms-if="$index==0" rowspan=4><button ms-click="countDel(this)">Del</button></td>
- </tr>
- </tbody>
- </table>
-
- </div>
- </div>
-
- <div class="col-xs-offset-3 col-md-offset-3 col-lg-offset-2 col-xs-9 col-md-8 col-lg-8 btnGroup submBtn">
-
- <span class="indexConfirm inlineBlock" ms-click="submit()" ms-visible="!rtnVisible"><a
- class="btn blue1 radius_l" id="opsetChange">提交</a></span>
- <span class="indexConfirm inlineBlock" ms-click="returnListPage()"><a
- id="opsetBack">返回</a></span>
- </div>
- </div>
-
-
- </div>
-
-
- </div>
-
-
-
-
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/html/index/indexView.html b/umc-iui/src/main/resources/webroot/umc-pm/html/index/indexView.html
deleted file mode 100644
index 607dbe44..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/html/index/indexView.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head lang="en">
- <meta charset="UTF-8">
- <title></title>
- <link href="/ngict/iui/component/thirdparty/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
- <link href="/ngict/iui/component/thirdparty/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
- <link href="/ngict/iui/component/thirdparty/uniform/css/uniform.default.css" rel="stylesheet"/>
- <link href="/ngict/iui/component/thirdparty/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet"/>
- <link href="/ngict/iui/component/thirdparty/c3/c3.css" rel="stylesheet" type="text/css" />
- <link href="/ngict/iui/component/ict/ict-serverpagetable/css/serverPageTable.css" rel="stylesheet" type="text/css" />
- <link href="/ngict/iui/framework/css/ngict-component.css" rel="stylesheet" type="text/css">
- <link rel="stylesheet" type="text/css" href="/ngict/iui/component/css/ZteIctIcons/style.css"/>
- <link href="../../css/index.css" rel="stylesheet" type="text/css" />
- <style>
- .ms-controller{
- visibility: hidden,
- background-color:#fff !important;
- }
- </style>
-</head>
-<body>
- <div class="container-fluid" ms-controller="indexController" class="ms-controller">
- <div class="titlefont">{{title}}</div>
- <div class="separator-line"></div>
- <div class="row-fluid" data-name="table_zone">
- <div id ='ict_index_table_div' ms-visible="viewVisible"></div>
- <div id="indexManage" ms-visible="indexVisible" ms-include-src="'indexManage.html'"></div>
- </div>
- </div>
-
- <script type="text/javascript" src="/ngict/iui/component/thirdparty/jquery/jquery-1.10.2.min.js"></script>
- <script src="/ngict/iui/framework/js/tools.js"></script>
- <script src="/ngict/iui/component/thirdparty/bootbox/bootbox.min.js" type="text/javascript"></script>
- <script src="/ngict/iui/component/thirdparty/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
- <script src="/ngict/iui/component/thirdparty/jquery.i18n/jquery.i18n.properties-1.0.9.js"></script>
- <script src="/ngict/iui/component/thirdparty/data-tables/jquery.dataTables.js"></script>
- <script src="/ngict/iui/framework/js/json2.js"></script>
- <script src="/ngict/iui/component/thirdparty/bootstrap-daterangepicker/moment.js"></script>
- <script src="/ngict/iui/component/ict/ict-serverpagetable/serverPageTable.js"></script>
- <script src="/ngict/iui/component/thirdparty/avalon/avalon.js"></script>
-
- <script>
- var lang = getLanguage();
- jQuery.i18n.properties({
- language:lang,
- name:'ngict-pm-iui-i18n',
- path:'../../i18n/',
- mode:'map',
- callback: function() {
- setTimeout(function(){
- var i18nItems = $("[name_i18n=com_zte_ums_ngict_pm_index]");
- for(var i=0;i<i18nItems.length;i++){
- var $item = $(i18nItems.eq(i));
- var itemId = $item.attr('id');
- if(typeof($item.attr("title"))!="undefined"){
- $item.attr("title", $.i18n.prop(itemId));
- }else{
- $item.text($.i18n.prop(itemId));
- }
- }
- }, 200);
-
-
- }
- });
- </script>
- <script src="../../js/commonUtil.js"></script>
- <script src="../../js/pmUtil.js"></script>
- <script src="../../js/index/indexController.js"></script>
- <script src="../../js/index/indexManage.js"></script>
-
-</body>
-</html> \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/html/meatask/meataskQueryRule.html b/umc-iui/src/main/resources/webroot/umc-pm/html/meatask/meataskQueryRule.html
deleted file mode 100644
index 4b509275..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/html/meatask/meataskQueryRule.html
+++ /dev/null
@@ -1,184 +0,0 @@
-
- <div class="container-fluid" id="meatask_queryRule_body" style="height:650px;background-color:#FFF;overflow-x:hidden;overflow-y:auto">
- <form action="#" class="form-horizontal" id="meatask_queryRule_submit">
- <div>
- <div>
- <div>
- <div class="form-title">
- <span id="com_zte_ums_ict_pm_query_time" name_i18n="com_zte_ums_ict_pm_query"></span>
- </div>
- <div class="row">
-
- <div class="form-group" id="">
- <label class="control-label col-xs-3">
- <span id="com_zte_ums_ict_pm_query_time" name_i18n="com_zte_ums_ict_pm_query"></span>
- </label>
- <div id="taskTimeDiv" class="col-xs-4">
- <input id="queryTimeRange"></input>
- </div>
- </div>
-
- <div class="form-group col-xs-12" id="">
- <label class="control-label col-xs-3">
- <span id="com_zte_ums_ict_pm_query_granularity" name_i18n="com_zte_ums_ict_pm_query"></span>
- </label>
-
- <!-- <div id="chosenGranularity" class="btn-group btn-group-circle col-xs-8" data-toggle="buttons">
- <label class="btn btn-default"><input value="300" type="radio" class="toggle" />5分钟</label>
- <label class="btn btn-default"><input value="900" type="radio" class="toggle" />15分钟</label>
- <label class="btn btn-default active"><input value="3600" type="radio" class="toggle" />1小时</label>
- </div> -->
-
- <div class="btn-group circleBtn col-xs-4">
- <div class="btn btnWhite circleBtn" ms-attr-id="el.id" ms-repeat-el="granularities" ms-class-blueActive="el.value"
- ms-click="granularityClicked(el ,this)">{{el.name}}</div>
- </div>
- </div>
- </div>
- </div>
-
- <!-- <div class="form-body"> -->
- <div class="form-title">
- <span id="com_zte_ums_ict_pm_query_resource_type" name_i18n="com_zte_ums_ict_pm_query"></span>
- </div>
- <div class="row">
- <div class="form-group" id="">
- <label class="control-label col-xs-3">
- <span id="com_zte_ums_ict_pm_query_resource_type" name_i18n="com_zte_ums_ict_pm_query"></span>
- </label>
- <div class="col-xs-4">
- <select id="resourceTypes" ms-duplex-String="selectedResourceType" class="selector-class"
- ms-change="resTypeSelectAction()">
- <option ms-repeat-el="resTypeArray">{{el.name}}</option>
- </select>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="form-group">
- <label class="control-label col-xs-3">
- <span id="com_zte_ums_ict_pm_query_moType" name_i18n="com_zte_ums_ict_pm_query"></span>
- </label>
- <div class="col-xs-4">
- <!-- <div class="type-list" ms-repeat-el="moTypeArray">
- <input type="radio"
- ms-click="moTypeSelectAction(this)" ms-attr-value={{el.id}}
- name="moType"/><span> {{el.name}}<span>
- </div> -->
- <select id="moTypes" ms-duplex-String="selectedMoType" class="selector-class"
- ms-change="moTypeSelectAction()">
- <option ms-repeat-el="moTypeArray">{{el.name}}</option>
- </select>
- </div>
- </div>
- </div>
- <div class="row">
- <div class="form-group">
- <label class="control-label col-xs-3"><span id="com_zte_ums_ict_pm_query_index" name_i18n="com_zte_ums_ict_pm_query"></span></label>
- <div class="col-xs-6">
- <table class="table table-striped table-bordered table-hover" cellpadding="0" cellspacing="0" border="0" id="indexes">
- <thead>
- <th role="row" width="3%" class="heading"><input type="checkbox" class="indexesAll"/></th>
- <th role="row" class="heading"><span id="com_zte_ums_ict_pm_query_index" name_i18n="com_zte_ums_ict_pm_query"></span></th>
- </thead>
- <tbody>
- <tr ms-repeat-elem="counterArray">
- <td class="checkBoxInFirstCol"><input ms-duplex-string="selectedCounter" type="checkbox" ms-attr-value="elem.id"/></td>
- <td>{{elem.name}}</td>
- <tr>
- </tbody>
- </table>
- <!-- <label class="test">{{selectedCounter}}</label> -->
- </div>
- </div>
- </div>
- <!-- </div> -->
-
- <div class="form-title">
- <span id="com_zte_ums_ict_pm_query_target_resource" name_i18n="com_zte_ums_ict_pm_query"></span>
- </div>
- <div class="row">
- <div class="form-group">
- <!-- <div class="col-xs-offset-3 col-xs-6 boxLabel">已选择对象</div> -->
- <label class="control-label col-xs-3"><span id="com_zte_ums_ict_pm_query_resource" name_i18n="com_zte_ums_ict_pm_query"></span></label>
- <div class="col-xs-6 resourceList">
-
- <table class="table table-striped table-bordered table-hover" cellpadding="0" cellspacing="0" border="0">
- <thead>
- <th role="row" class="heading"><span id="com_zte_ums_ict_pm_query_selected_resource" name_i18n="com_zte_ums_ict_pm_query"></span></th>
- </thead>
- <tbody>
- <tr>
- <td class="row">
- <div class="col-xs-6 col-sm-4 col-md-4 col-lg-4"
- ms-repeat-elem="resourceSlectedObjs" data-repeat-rendered="clickSelectedCommonCond">
- <div class="deleteIcon ict-close" ms-click="rmSelectedResource(elem ,this)">
- <!-- <span class="resourceObj">{{elem}}</span> -->
- </div><div class="resourceObj">{{elem.name}}</div>
- <!-- <div class="box">
- <div class="namediv">
- <div class="nam"><span>{{elem}}</span></div>
- </div>
- </div> -->
- </div>
- </td>
- </tr>
- </tbody>
- </table>
-
- </div>
- </div>
- </div>
-
- <div class="row">
- <div class="form-group col-xs-12 filterDiv">
- <div class="col-xs-offset-3 col-xs-6">
- <input id="resourcesToFilter" name="resourcesToFilter" placeholder="" name_i18n="com_zte_ums_ict_pm_query"/>
- </div>
- </div>
- </div>
-
- <div class="row">
- <div class="form-group">
-
- <div class="col-xs-offset-3 col-xs-6">
- <table class="table table-striped table-bordered table-hover" cellpadding="0" cellspacing="0" border="0" id="resources">
- <thead>
- <th role="row" width="3%" class="heading"><input type="checkbox" class="resourceAll"/></th>
- <th role="row" class="heading"><span id="com_zte_ums_ict_pm_threshold_resource_name" name_i18n="com_zte_ums_ict_pm_query"></span></th>
- <!-- <th role="row" class="heading">对象值</th> -->
- </thead>
- <tbody>
- <tr ms-repeat-elem="resources">
- <td><input ms-duplex-string="resourceSlected" type="checkbox" ms-attr-value="elem.id" ms-attr-taskId="elem.id"/></td>
- <td>{{elem.name}}</td>
- <!-- <td>{{elem.resType}}</td> -->
- <tr>
- </tbody>
- </table>
- <!-- <label>{{resourceSlected}}</label> -->
- </div>
- </div>
- </div>
-
- <div class="row">
- <div class="form-group " id="">
- <div class=" col-xs-offset-3 col-xs-4 form-actions btnGroup">
- <a id="submit_in_queryRuleChanged" href="javascript:;" class="btn blue1 radius_l button-submit" ms-click="queryRuleChanged()">
- <span id="com_zte_ums_ict_pm_action_query" name_i18n="com_zte_ums_ict_pm_query"></span>
- </a>
- <!--<a id="submit_in_modifyMeatask" href="javascript:;" class="btn blue1 radius_l button-submit" ms-click="modifyMeatask(this)">
- <span id="" name_i18n="">提交</span>
- </a>-->
- <a href="javascript:;" ms-click="returnQueryPage()">
- <span id="com_zte_ums_ict_pm_back" name_i18n="com_zte_ums_ict_pm_query"></span>
- </a>
- </div>
- </div>
- </div>
-
- </div>
- </div>
- </form>
-
- </div>
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/html/meatask/meataskQueryView.html b/umc-iui/src/main/resources/webroot/umc-pm/html/meatask/meataskQueryView.html
deleted file mode 100644
index 33bd97d2..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/html/meatask/meataskQueryView.html
+++ /dev/null
@@ -1,151 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head lang="en">
- <meta charset="UTF-8">
- <link href="../../../component/thirdparty/font-awesome/css/font-awesome.min.css" rel="stylesheet" id="font_awesome"/>
- <link href="../../../component/thirdparty/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
- <link href="../../../component/thirdparty/uniform/css/uniform.default.css" rel="stylesheet"/>
- <link href="../../../framework/css/plugins.css" rel="stylesheet" type="text/css">
- <link rel="stylesheet" type="text/css" href="../../../component/css/ZteIctIcons/style.css" />
- <link rel="stylesheet" href="../../../vendor/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css">
- <!-- <link rel="stylesheet" href="../../../component/thirdparty/icheck/skins/all.css" type="text/css"> -->
- <!--<link href="../../../framework/css/style.css" rel="stylesheet" type="text/css">-->
- <link href="../../../framework/css/ngict-component.css" rel="stylesheet" type="text/css">
- <link href="../../css/pmQueryBox.css" rel="stylesheet" type="text/css">
- <link href="../../css/meataskQuery.css" rel="stylesheet" type="text/css" />
- <link href="../../css/performanceChart.css" rel="stylesheet" type="text/css" />
- <link href="../../../vendor/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet">
- <style>
- .ms-controller {
- visibility: hidden
- }
- </style>
-</head>
-<body>
- <div ms-controller="pmQueryController" class="ms-controller">
- <div class="row" ms-visible="boxVisible">
-
- <!-- <div class="row"> -->
- <div class="row" style="margin-left: 15px;">
- <div class="col-xs-6 col-md-6 col-sm-6 col-lg-6 titlefont"><span id="com_zte_ums_ict_pm_query_data" name_i18n="com_zte_ums_ict_pm_query"></span></div><!-- <a ms-click="queryRuleView()">修改查询条件</a> -->
- </div>
- <div class = "separator-line" ></div>
- <div class="row ruleNav" style="margin-left: 50px;width: 93%;">
- <div id="carousel-example-generic" class="carousel slide" data-ride="carousel" data-interval="false">
- <div class="carousel-inner" role="listbox">
- <div class="item " ms-repeat-el="pmQueries">
- <div class="col-xs-12" style=" padding-right: 20px; padding-top: 10px; ">
- <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 boxPadding" ms-repeat-elem="el.array" data-repeat-rendered="clickSelectedCommonCond" ms-click="queryTabClicked(elem ,this)">
- <a href="#">
- <div class="box" ms-class="boxStyle{{$index % 4 + 1}}">
- <div class="subbox">
- <div class="textImageStyle " ms-class="{{elem.textImage}}">
- <!-- <span class="ict-acknownledge"></span> -->
- <span class="ict-cpu"></span>
- </div>
- <div class="set-title">{{elem.name}}</div>
- <span class="ict-modify" ms-click="queryRuleView(event, elem)"></span>
- </div>
- </div>
- <div class="col-md-12 separator-line separator-line-visibilty" ms-class="boxStyle{{$index % 4 + 1}}"></div>
- </a>
- </div>
- </div>
- </div>
- </div>
- <!-- Controls -->
- <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
- <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
- <span class="sr-only">Previous</span>
- </a>
- <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next" style="margin-right: -10px;">
- <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
- <span class="sr-only">Next</span>
- </a>
- </div>
- </div>
- <!-- </div> -->
-
- <div class="row-fluid separator">
- <div ms-visible="boxVisible" class="col-xs-12" style="margin-top: 10px;">
- <a href="#" id="upArrow" ms-click="clickDisplayGraphAlink()"><img src="../../images/up.png"/></a>
- </div>
- </div>
- </div>
- <div class="row-fluid separator">
- <div ms-visible="!boxVisible" class="col-xs-12">
- <a href="#" ms-click="clickDisplayGraphAlink()" ><img src="../../images/down.png"/></a>
- </div>
- </div>
- <div class="container-fluid">
- <div class="row" style=" margin-top: 15px;">
- <div class="col-xs-6 col-md-6 col-sm-6 col-lg-6 titlefont">
- <span id="tableTitleText">{{tableTitle}}</span>
- <a href="#" ms-visible="tableIconVisable">
- <img id="tableImg" src="../../images/table.png" ms-click="showPerformanceTable()">
- </a>
- <a href="#" ms-visible="chartIconVisable">
- <img id="chartImg" src="../../images/chart.png" ms-click="showPerformanceChart()">
- </a>
- </div>
- </div>
- <div class = "separator-line" ></div>
- <div class="row-fluid " data-name="table_zone">
- <div ms-visible="pmChartVisable" id="chartCanvasDiv" style="width:1000px; height:600px;"></div>
- <div ms-visible="pmDataVisable" id = 'ict_pm_data_div'></div>
- <div ms-visible="queryRuleVisable" ms-include-src="'meataskQueryRule.html'" ></div>
- </div>
- </div>
- </div>
- <script src="../../../component/thirdparty/jquery/jquery-1.10.2.min.js"></script>
- <script src="../../../component/thirdparty/jquery.i18n/jquery.i18n.properties-1.0.9.js"></script>
- <script src="../../../framework/js/tools.js"></script>
- <script>
- //国际化
- var lang = getLanguage();
- //lang="en-US";
- jQuery.i18n.properties({
- language:lang,
- name:'ngict-pm-iui-i18n',
- path:'../../i18n/',
- mode:'map',
- callback: function() {
- //setTimeout(function () {
- var i18nItems = $("[name_i18n=com_zte_ums_ict_pm_query]");
- for(var i=0;i<i18nItems.length;i++){
- var $item = $(i18nItems.eq(i));
- var itemId = $item.attr('id');
- var itemValue = $.i18n.prop(itemId);
- if(typeof($item.attr("title"))!="undefined"){
- $item.attr("title", itemValue);
- }else if(typeof($item.attr("placeholder"))!="undefined"){
- $item.attr("placeholder", itemValue);
- }else{
- $item.text(itemValue);
- }
- }
- //}, 100);
- }
- });
- </script>
- <script src="../../../vendor/data-tables/jquery.dataTables.js"></script>
- <script src="../../../component/thirdparty/bootbox/bootbox.min.js"type="text/javascript"></script>
- <script src="../../../component/thirdparty/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
- <script src="../../../component/thirdparty/jquery-validation/js/jquery.validate.js"></script>
- <script src="../../../component/thirdparty/jquery-validation/js/additional-methods.min.js"></script>
- <SCRIPT type="text/javascript" SRC="../../../framework/js/security/aes.js"></SCRIPT>
- <SCRIPT type="text/javascript" SRC="../../../framework/js/security/framework-util.js"></SCRIPT>
- <script type="text/javascript" src="../../js/meatask/echarts.js"></script>
- <script src="../../../framework/js/json2.js"></script>
- <script src="../../../vendor/ict/ict-serverpagetable/serverPageTable.js"></script>
- <!-- <script src="../../../component/thirdparty/avalon/avalon.modern.js"></script> -->
- <script src="../../../vendor/bootstrap-daterangepicker/moment.js"></script>
- <script src="../../../vendor/bootstrap-daterangepicker/daterangepicker.js"></script>
- <script src="../../js/avalon.js"></script>
- <script src="../../js/pmUtil.js"></script>
- <script src="../../js/commonUtil.js"></script>
- <script src="../../js/meatask/meataskQueryController.js"></script>
- <script src="../../js/meatask/performanceChart.js"></script>
-
-</body>
-</html> \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/html/meataskQueryView.html b/umc-iui/src/main/resources/webroot/umc-pm/html/meataskQueryView.html
deleted file mode 100644
index 9c2d8196..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/html/meataskQueryView.html
+++ /dev/null
@@ -1,149 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head lang="en">
- <meta charset="UTF-8">
- <link href="../../../component/thirdparty/font-awesome/css/font-awesome.min.css" rel="stylesheet" id="font_awesome"/>
- <link href="../../../component/thirdparty/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
- <link href="../../../component/thirdparty/uniform/css/uniform.default.css" rel="stylesheet"/>
- <link href="../../../framework/css/plugins.css" rel="stylesheet" type="text/css">
- <link rel="stylesheet" type="text/css" href="../../../component/css/ZteIctIcons/style.css" />
- <link rel="stylesheet" href="../../../vendor/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css">
- <!-- <link rel="stylesheet" href="../../../component/thirdparty/icheck/skins/all.css" type="text/css"> -->
- <!--<link href="../../../framework/css/style.css" rel="stylesheet" type="text/css">-->
- <link href="../../../framework/css/ngict-component.css" rel="stylesheet" type="text/css">
- <link href="../../css/pmQueryBox.css" rel="stylesheet" type="text/css">
- <link href="../../css/meataskQuery.css" rel="stylesheet" type="text/css" />
- <link href="../../../vendor/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet">
- <style>
- .ms-controller {
- visibility: hidden
- }
- </style>
-</head>
-<body>
- <div ms-controller="pmQueryController" class="ms-controller">
- <div class="row" ms-visible="boxVisible">
-
- <!-- <div class="row"> -->
- <div class="row" style="margin-left: 15px;">
- <div class="col-xs-6 col-md-6 col-sm-6 col-lg-6 titlefont"><span id="com_zte_ums_ict_pm_query_data" name_i18n="com_zte_ums_ict_pm_query"></span></div><!-- <a ms-click="queryRuleView()">修改查询条件</a> -->
- </div>
- <div class = "separator-line" ></div>
- <div class="row ruleNav" style="margin-left: 50px;width: 93%;">
- <div id="carousel-example-generic" class="carousel slide" data-ride="carousel" data-interval="false">
- <div class="carousel-inner" role="listbox">
- <div class="item " ms-repeat-el="pmQueries">
- <div class="col-xs-12" style=" padding-right: 20px; padding-top: 10px; ">
- <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3 boxPadding" ms-repeat-elem="el.array" data-repeat-rendered="clickSelectedCommonCond" ms-click="queryTabClicked(elem ,this)">
- <a href="#">
- <div class="box" ms-class="boxStyle{{$index % 4 + 1}}">
- <div class="subbox">
- <div class="textImageStyle " ms-class="{{elem.textImage}}">
- <!-- <span class="ict-acknownledge"></span> -->
- <span class="ict-cpu"></span>
- </div>
- <div class="set-title">{{elem.name}}</div>
- <span class="ict-modify" ms-click="queryRuleView(event, elem)"></span>
- </div>
- </div>
- <div class="col-md-12 separator-line separator-line-visibilty" ms-class="boxStyle{{$index % 4 + 1}}"></div>
- </a>
- </div>
- </div>
- </div>
- </div>
- <!-- Controls -->
- <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
- <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
- <span class="sr-only">Previous</span>
- </a>
- <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next" style="margin-right: -10px;">
- <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
- <span class="sr-only">Next</span>
- </a>
- </div>
- </div>
- <!-- </div> -->
-
- <div class="row-fluid separator">
- <div ms-visible="boxVisible" class="col-xs-12" style="margin-top: 10px;">
- <a href="#" id="upArrow" ms-click="clickDisplayGraphAlink()"><img src="../../images/up.png"/></a>
- </div>
- </div>
- </div>
- <div class="row-fluid separator">
- <div ms-visible="!boxVisible" class="col-xs-12">
- <a href="#" ms-click="clickDisplayGraphAlink()" ><img src="../../images/down.png"/></a>
- </div>
- </div>
- <div class="container-fluid">
- <div class="row" style=" margin-top: 15px;">
- <div class="col-xs-6 col-md-6 col-sm-6 col-lg-6 titlefont">
- <!-- <span id="com_zte_ums_ict_pm_query_edit" name_i18n="com_zte_ums_ict_pm_query"></span> -->
- {{tableTitle}} <!-- <span id="com_zte_ums_ict_pm_query_result" name_i18n="com_zte_ums_ict_pm_query"></span> -->
- </div>
- </div>
- <div class = "separator-line" ></div>
- <div class="row-fluid " data-name="table_zone">
- <div ms-visible="pmDataVisable" id = 'ict_pm_data_div'></div>
- <div ms-visible="queryRuleVisable" ms-include-src="'meataskQueryRule.html'" ></div>
- </div>
- </div>
- </div>
- <script src="../../../component/thirdparty/jquery/jquery-1.10.2.min.js"></script>
- <script src="../../../component/thirdparty/jquery.i18n/jquery.i18n.properties-1.0.9.js"></script>
- <script src="../../../framework/js/tools.js"></script>
- <script type="text/javascript" src="../../../framework/js/core/hk.min.js" ></script>
- <script>
- //国际化
- var lang = getLanguage();
- //lang="en-US";
- jQuery.i18n.properties({
- language:lang,
- name:'ngict-pm-iui-i18n',
- path:'../../i18n/',
- mode:'map',
- callback: function() {
- //setTimeout(function () {
- var i18nItems = $("[name_i18n=com_zte_ums_ict_pm_query]");
- for(var i=0;i<i18nItems.length;i++){
- var $item = $(i18nItems.eq(i));
- var itemId = $item.attr('id');
- var itemValue = $.i18n.prop(itemId);
- if(typeof($item.attr("title"))!="undefined"){
- $item.attr("title", itemValue);
- }else if(typeof($item.attr("placeholder"))!="undefined"){
- $item.attr("placeholder", itemValue);
- }else{
- $item.text(itemValue);
- }
- }
- //}, 100);
- }
- });
- </script>
- <script src="../../../vendor/data-tables/jquery.dataTables.js"></script>
- <script src="../../../component/thirdparty/bootbox/bootbox.min.js"type="text/javascript"></script>
- <script src="../../../component/thirdparty/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
- <script src="../../../component/thirdparty/jquery-validation/js/jquery.validate.js"></script>
- <script src="../../../component/thirdparty/jquery-validation/js/additional-methods.min.js"></script>
- <SCRIPT type="text/javascript" SRC="../../../framework/js/security/aes.js"></SCRIPT>
- <SCRIPT type="text/javascript" SRC="../../../framework/js/security/framework-util.js"></SCRIPT>
- <script src="../../../framework/js/json2.js"></script>
- <script src="../../../vendor/ict/ict-serverpagetable/serverPageTable.js"></script>
- <!-- <script src="../../../component/thirdparty/avalon/avalon.modern.js"></script> -->
- <script src="../../../vendor/bootstrap-daterangepicker/moment.js"></script>
- <script src="../../../vendor/bootstrap-daterangepicker/daterangepicker.js"></script>
- <script src="../../js/avalon.js"></script>
- <script src="../../js/pmUtil.js"></script>
- <script src="../../js/commonUtil.js"></script>
- <script src="../../js/meatask/meataskQueryController.js"></script>
- <script>
- $(function(){
- var queryViewData = pm.query.vmPmQuery.queryTaskList();
- pm.query.vmPmQuery.pmQueries = transformQueryViewData(queryViewData, 8);
- });
- </script>
-
-</body>
-</html> \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/i18n/delete.me b/umc-iui/src/main/resources/webroot/umc-pm/i18n/delete.me
deleted file mode 100644
index e69de29b..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/i18n/delete.me
+++ /dev/null
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/i18n/ngict-pm-iui-i18n-en-US.properties b/umc-iui/src/main/resources/webroot/umc-pm/i18n/ngict-pm-iui-i18n-en-US.properties
deleted file mode 100644
index a0f9399c..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/i18n/ngict-pm-iui-i18n-en-US.properties
+++ /dev/null
@@ -1,130 +0,0 @@
-com_zte_ums_ict_pm_index_indexManagement=Index Management
-com_zte_ums_ict_pm_index_indexName=Name
-com_zte_ums_ict_pm_index_dataType=Data Type
-com_zte_ums_ict_pm_index_moType=Mo Type
-com_zte_ums_ict_pm_index_counter=Counter
-com_zte_ums_ict_pm_index_resourceType=NE Type
-com_zte_ums_ict_pm_index_strExpression=Formula
-com_zte_ums_ict_pm_index_indexDes=Formula Expression
-com_zte_ums_ict_pm_index_operate=Operate
-com_zte_ums_ict_pm_index_selectCounter=Please select the Mo Type first
-com_zte_ums_ict_sm_confirmToDeleteIndex=Are you sure to delete this index?
-STRING=String
-INT=Int
-FLOAT=Float
-LONG=Long
-DATA=Date
-PERCENT=Percent
-
-com_zte_ums_ict_pm_threshold=Threshold
-com_zte_ums_ict_pm_threshold_title=Threshold Management
-com_zte_ums_ict_pm_threshold_index=门限标示
-com_zte_ums_ict_pm_threshold_taskName=Task Name
-com_zte_ums_ict_pm_index_direction=Direction
-com_zte_ums_ict_pm_threshold_warning=Warning Threshold
-com_zte_ums_ict_pm_threshold_minor=Minor Threshold
-com_zte_ums_ict_pm_threshold_major=Major Threshold
-com_zte_ums_ict_pm_threshold_critical=Critical Threshold
-com_zte_ums_ict_pm_threshold_resource=Resource
-com_zte_ums_ict_pm_threshold_resource_name=Resource Name
-com_zte_ums_ict_pm_threshold_resource_value=Resource Value
-com_zte_ums_ict_pm_threshold_resource_turbulence=Turbulence Value
-com_zte_ums_ict_pm_threshold_up=Up
-com_zte_ums_ict_pm_threshold_down=Down
-
-
-com_zte_ums_ict_pm_index_dataType=数据类型
-com_zte_ums_ict_pm_index_activeStatus=状态
-com_zte_ums_ict_pm_index_activeStatus_true=激活
-com_zte_ums_ict_pm_index_activeStatus_false=挂起
-com_zte_ums_ict_pm_index_granularity=粒度
-com_zte_ums_ict_pm_index_beginTime=开始时间
-com_zte_ums_ict_pm_index_endTime=结束时间
-
-
-com_zte_ums_ict_pm_action_add=Create
-com_zte_ums_ict_pm_action_modify=Modify
-com_zte_ums_ict_pm_action_delete=Delete
-com_zte_ums_ict_pm_action_query=Query
-
-com_zte_ums_ict_pm_submit=Submit
-com_zte_ums_ict_pm_back=Back
-com_zte_ums_ict_sm_confirmToDeleteThreshold=Are you sure to remove this task?
-
-com_zte_ums_ict_pm_query_data=PM Data Query
-com_zte_ums_ict_pm_query_edit=Edit Query Condition
-com_zte_ums_ict_pm_query_result=Query Data Result
-com_zte_ums_ict_pm_query_start_time=Start Time
-com_zte_ums_ict_pm_query_end_time=End Time
-com_zte_ums_ict_pm_query_granularity=Granularity
-com_zte_ums_ict_pm_query_resource_type=Resource Type
-com_zte_ums_ict_pm_query_resource_name=Resource Name
-com_zte_ums_ict_pm_query_time=Query Time
-com_zte_ums_ict_pm_query_granularity=Query Granularity
-com_zte_ums_ict_pm_query_pmIndex=PM Index
-com_zte_ums_ict_pm_query_moType=Mo Type
-com_zte_ums_ict_pm_query_index=Counters
-com_zte_ums_ict_pm_query_resource=Resource
-com_zte_ums_ict_pm_query_target_resource=Query Resource
-com_zte_ums_ict_pm_query_selected_resource=Selected Resources
-com_zte_ums_ict_pm_query_selected_search=Search
-com_zte_ums_ict_pm_query_5=5 Minutes
-com_zte_ums_ict_pm_query_15=15 Minutes
-com_zte_ums_ict_pm_query_60=One Hour
-resourcesToFilter=Search
-
-//表格相关
-ngict-log-iui-table-sLengthMenu=View _MENU_ records
-ngict-log-iui-table-sZeroRecords=No matching records found
-ngict-log-iui-table-sInfo=Found total _TOTAL_ records
-ngict-log-iui-table-sInfoEmpty=No records found to show
-ngict-log-iui-table-sGroupActions=_TOTAL_ records selected:
-ngict-log-iui-table-sAjaxRequestGeneralError=Could not complete request. Please check your internet connection.
-ngict-log-iui-table-sEmptyTable=No data available in table
-ngict-log-iui-table-sPrevious=Prev
-ngict-log-iui-table-sNext=Next
-ngict-log-iui-table-sPage=Page
-ngict-log-iui-table-sPageOf=of
-
-//日期组件
-ngict-iui-dateRange-month=Month
-ngict-iui-dateRange-Jan=Jan
-ngict-iui-dateRange-Feb=Feb
-ngict-iui-dateRange-Mar=Mar
-ngict-iui-dateRange-Apr=Apr
-ngict-iui-dateRange-May=May
-ngict-iui-dateRange-Jun=Jun
-ngict-iui-dateRange-Jul=Jul
-ngict-iui-dateRange-Aug=Aug
-ngict-iui-dateRange-Sep=Sep
-ngict-iui-dateRange-Oct=Oct
-ngict-iui-dateRange-Nov=Nov
-ngict-iui-dateRange-Dec=Dec
-ngict-iui-dateRange-applyLabel=Confirm
-ngict-iui-dateRange-cancelLabel=Cancel
-ngict-iui-dateRange-fromLabel=From
-ngict-iui-dateRange-toLabel=To
-ngict-iui-dateRange-customRangeLabel=Custom
-ngict-iui-dateRange-Sunday=Su
-ngict-iui-dateRange-Monday=Mo
-ngict-iui-dateRange-Tuesday=Tu
-ngict-iui-dateRange-Wednesday=We
-ngict-iui-dateRange-Thursday=Th
-ngict-iui-dateRange-Friday=Fr
-ngict-iui-dateRange-Saturday=Sa
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/i18n/ngict-pm-iui-i18n-zh-CN.properties b/umc-iui/src/main/resources/webroot/umc-pm/i18n/ngict-pm-iui-i18n-zh-CN.properties
deleted file mode 100644
index 7674a700..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/i18n/ngict-pm-iui-i18n-zh-CN.properties
+++ /dev/null
@@ -1,131 +0,0 @@
-com_zte_ums_ict_pm_index_indexManagement=指标管理
-com_zte_ums_ict_pm_index_indexName=名称
-com_zte_ums_ict_pm_index_dataType=数据类型
-com_zte_ums_ict_pm_index_moType=测量类型
-com_zte_ums_ict_pm_index_counter=计数器
-com_zte_ums_ict_pm_index_resourceType=资源类型
-com_zte_ums_ict_pm_index_strExpression=公式
-com_zte_ums_ict_pm_index_operate=操作
-com_zte_ums_ict_pm_index_indexDes=公式描述
-com_zte_ums_ict_pm_index_selectCounter=请先选择"测量类型"
-com_zte_ums_ict_sm_confirmToDeleteIndex=确定要删除此指标?
-STRING=字符型
-INT=整型
-FLOAT=浮点型
-LONG=长整型
-DATA=时间类型
-PERCENT=百分型
-
-com_zte_ums_ict_pm_threshold=门限
-com_zte_ums_ict_pm_threshold_title=门限管理
-com_zte_ums_ict_pm_threshold_index=门限标示
-com_zte_ums_ict_pm_threshold_taskName=任务名称
-com_zte_ums_ict_pm_index_direction=方向
-com_zte_ums_ict_pm_threshold_warning=警告告警阈值
-com_zte_ums_ict_pm_threshold_minor=次要告警阈值
-com_zte_ums_ict_pm_threshold_major=主要告警阈值
-com_zte_ums_ict_pm_threshold_critical=严重告警阈值
-com_zte_ums_ict_pm_threshold_resource=对象
-com_zte_ums_ict_pm_threshold_resource_name=对象名称
-com_zte_ums_ict_pm_threshold_resource_value=对象值
-com_zte_ums_ict_pm_threshold_resource_turbulence=震荡值
-com_zte_ums_ict_pm_threshold_up=向上
-com_zte_ums_ict_pm_threshold_down=向下
-
-com_zte_ums_ict_pm_index_dataType=数据类型
-com_zte_ums_ict_pm_index_moType=测量类型
-com_zte_ums_ict_pm_index_activeStatus=状态
-com_zte_ums_ict_pm_index_activeStatus_true=激活
-com_zte_ums_ict_pm_index_activeStatus_false=挂起
-com_zte_ums_ict_pm_index_granularity=粒度
-com_zte_ums_ict_pm_index_beginTime=开始时间
-com_zte_ums_ict_pm_index_endTime=结束时间
-com_zte_ums_ict_pm_index_resourceType=资源类型
-com_zte_ums_ict_pm_index_strExpression=公式描述
-com_zte_ums_ict_pm_index_operate=操作
-com_zte_ums_ict_pm_action_add=新建
-com_zte_ums_ict_pm_action_modify=修改
-com_zte_ums_ict_pm_action_delete=删除
-com_zte_ums_ict_pm_action_query=查询
-
-com_zte_ums_ict_pm_submit=提交
-com_zte_ums_ict_pm_back=返回
-com_zte_ums_ict_sm_confirmToDeleteThreshold=你确定要删除该门限任务吗?
-
-com_zte_ums_ict_pm_query_data=性能数据查询
-com_zte_ums_ict_pm_query_edit=编辑查询条件
-com_zte_ums_ict_pm_query_result=查询数据结果
-com_zte_ums_ict_pm_query_start_time=开始时间
-com_zte_ums_ict_pm_query_end_time=结束时间
-com_zte_ums_ict_pm_query_granularity=粒度
-com_zte_ums_ict_pm_query_resource_type=资源类型
-com_zte_ums_ict_pm_query_resource_name=资源名称
-com_zte_ums_ict_pm_query_time=查询时间
-com_zte_ums_ict_pm_query_granularity=查询粒度
-com_zte_ums_ict_pm_query_pmIndex=性能指标
-com_zte_ums_ict_pm_query_moType=测量对象类型
-com_zte_ums_ict_pm_query_index=指标
-com_zte_ums_ict_pm_query_resource=对象
-com_zte_ums_ict_pm_query_target_resource=查询对象
-com_zte_ums_ict_pm_query_selected_resource=已选择对象
-com_zte_ums_ict_pm_query_selected_search=搜索
-com_zte_ums_ict_pm_query_5=5分钟
-com_zte_ums_ict_pm_query_15=15分钟
-com_zte_ums_ict_pm_query_60=一小时
-resourcesToFilter=搜索
-
-//表格相关
-ngict-log-iui-table-sLengthMenu=每页 _MENU_ 条结果
-ngict-log-iui-table-sZeroRecords=没有匹配结果
-ngict-log-iui-table-sInfo=总共找到 _TOTAL_ 条结果
-ngict-log-iui-table-sInfoEmpty=共 0 项
-ngict-log-iui-table-sGroupActions=_TOTAL_ 条结果被选择:
-ngict-log-iui-table-sAjaxRequestGeneralError=不能完成请求,请检查您的网络连接情况。
-ngict-log-iui-table-sEmptyTable=表中数据为空
-ngict-log-iui-table-sPrevious=前页
-ngict-log-iui-table-sNext=下页
-ngict-log-iui-table-sPage=第
-ngict-log-iui-table-sPageOf=页,总页数:
-
-//日期组件
-ngict-iui-dateRange-month=月
-ngict-iui-dateRange-Jan=1月
-ngict-iui-dateRange-Feb=2月
-ngict-iui-dateRange-Mar=3月
-ngict-iui-dateRange-Apr=4月
-ngict-iui-dateRange-May=5月
-ngict-iui-dateRange-Jun=6月
-ngict-iui-dateRange-Jul=7月
-ngict-iui-dateRange-Aug=8月
-ngict-iui-dateRange-Sep=9月
-ngict-iui-dateRange-Oct=10月
-ngict-iui-dateRange-Nov=11月
-ngict-iui-dateRange-Dec=12月
-ngict-iui-dateRange-applyLabel=确定
-ngict-iui-dateRange-cancelLabel=取消
-ngict-iui-dateRange-fromLabel=从
-ngict-iui-dateRange-toLabel=到
-ngict-iui-dateRange-customRangeLabel=自定义
-ngict-iui-dateRange-Sunday=日
-ngict-iui-dateRange-Monday=一
-ngict-iui-dateRange-Tuesday=二
-ngict-iui-dateRange-Wednesday=三
-ngict-iui-dateRange-Thursday=四
-ngict-iui-dateRange-Friday=五
-ngict-iui-dateRange-Saturday=六
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/images/aos_view-fm.gif b/umc-iui/src/main/resources/webroot/umc-pm/images/aos_view-fm.gif
deleted file mode 100644
index 7914b55a..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/images/aos_view-fm.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/images/arrow.png b/umc-iui/src/main/resources/webroot/umc-pm/images/arrow.png
deleted file mode 100644
index 5c66dd78..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/images/arrow.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/images/chart.png b/umc-iui/src/main/resources/webroot/umc-pm/images/chart.png
deleted file mode 100644
index f4fbc311..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/images/chart.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/images/delete.png b/umc-iui/src/main/resources/webroot/umc-pm/images/delete.png
deleted file mode 100644
index 5947c7c9..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/images/delete.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/images/details_close.png b/umc-iui/src/main/resources/webroot/umc-pm/images/details_close.png
deleted file mode 100644
index e6281bae..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/images/details_close.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/images/details_open.png b/umc-iui/src/main/resources/webroot/umc-pm/images/details_open.png
deleted file mode 100644
index 5bf4389c..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/images/details_open.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/images/down.png b/umc-iui/src/main/resources/webroot/umc-pm/images/down.png
deleted file mode 100644
index f7732ba8..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/images/down.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/images/filter.png b/umc-iui/src/main/resources/webroot/umc-pm/images/filter.png
deleted file mode 100644
index d7600c8b..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/images/filter.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/images/statistics.png b/umc-iui/src/main/resources/webroot/umc-pm/images/statistics.png
deleted file mode 100644
index 8be1db19..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/images/statistics.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/images/table.png b/umc-iui/src/main/resources/webroot/umc-pm/images/table.png
deleted file mode 100644
index 4a7be176..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/images/table.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/images/up.png b/umc-iui/src/main/resources/webroot/umc-pm/images/up.png
deleted file mode 100644
index 8bd53741..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/images/up.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/js/avalon.js b/umc-iui/src/main/resources/webroot/umc-pm/js/avalon.js
deleted file mode 100644
index 2c2dbdc2..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/js/avalon.js
+++ /dev/null
@@ -1,5875 +0,0 @@
-/*==================================================
- Copyright (c) 2013-2015 司徒正美 and other contributors
- http://www.cnblogs.com/rubylouvre/
- https://github.com/RubyLouvre
- http://weibo.com/jslouvre/
-
- Released under the MIT license
- avalon.js 1.4.7.1 built in 2015.10.30
- support IE6+ and other browsers
- ==================================================*/
-(function(global, factory) {
-
- if (typeof module === "object" && typeof module.exports === "object") {
- // For CommonJS and CommonJS-like environments where a proper `window`
- // is present, execute the factory and get avalon.
- // For environments that do not have a `window` with a `document`
- // (such as Node.js), expose a factory as module.exports.
- // This accentuates the need for the creation of a real `window`.
- // e.g. var avalon = require("avalon")(window);
- module.exports = global.document ? factory(global, true) : function(w) {
- if (!w.document) {
- throw new Error("Avalon requires a window with a document")
- }
- return factory(w)
- }
- } else {
- factory(global)
- }
-
-// Pass this if window is not defined yet
-}(typeof window !== "undefined" ? window : this, function(window, noGlobal){
-
-/*********************************************************************
- * 全局变量及方法 *
- **********************************************************************/
-var expose = new Date() - 0
-//http://stackoverflow.com/questions/7290086/javascript-use-strict-and-nicks-find-global-function
-var DOC = window.document
-var head = DOC.getElementsByTagName("head")[0] //HEAD元素
-var ifGroup = head.insertBefore(document.createElement("avalon"), head.firstChild) //避免IE6 base标签BUG
-ifGroup.innerHTML = "X<style id='avalonStyle'>.avalonHide{ display: none!important }</style>"
-ifGroup.setAttribute("ms-skip", "1")
-ifGroup.className = "avalonHide"
-var rnative = /\[native code\]/ //判定是否原生函数
-function log() {
- if (window.console && avalon.config.debug) {
- // http://stackoverflow.com/questions/8785624/how-to-safely-wrap-console-log
- Function.apply.call(console.log, console, arguments)
- }
-}
-
-
-var subscribers = "$" + expose
-var stopRepeatAssign = false
-var rword = /[^, ]+/g //切割字符串为一个个小块,以空格或豆号分开它们,结合replace实现字符串的forEach
-var rcomplexType = /^(?:object|array)$/
-var rsvg = /^\[object SVG\w*Element\]$/
-var rwindow = /^\[object (?:Window|DOMWindow|global)\]$/
-var oproto = Object.prototype
-var ohasOwn = oproto.hasOwnProperty
-var serialize = oproto.toString
-var ap = Array.prototype
-var aslice = ap.slice
-var Registry = {} //将函数曝光到此对象上,方便访问器收集依赖
-var W3C = window.dispatchEvent
-var root = DOC.documentElement
-var avalonFragment = DOC.createDocumentFragment()
-var cinerator = DOC.createElement("div")
-var class2type = {}
-"Boolean Number String Function Array Date RegExp Object Error".replace(rword, function (name) {
- class2type["[object " + name + "]"] = name.toLowerCase()
-})
-
-
-function noop() {
-}
-
-
-function oneObject(array, val) {
- if (typeof array === "string") {
- array = array.match(rword) || []
- }
- var result = {},
- value = val !== void 0 ? val : 1
- for (var i = 0, n = array.length; i < n; i++) {
- result[array[i]] = value
- }
- return result
-}
-
-//生成UUID http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
-var generateID = function (prefix) {
- prefix = prefix || "avalon"
- return String(Math.random() + Math.random()).replace(/\d\.\d{4}/, prefix)
-}
-function IE() {
- if (window.VBArray) {
- var mode = document.documentMode
- return mode ? mode : window.XMLHttpRequest ? 7 : 6
- } else {
- return NaN
- }
-}
-var IEVersion = IE()
-
-avalon = function (el) { //创建jQuery式的无new 实例化结构
- return new avalon.init(el)
-}
-
-avalon.profile = function () {
- if (window.console && avalon.config.profile) {
- Function.apply.call(console.log, console, arguments)
- }
-}
-
-/*视浏览器情况采用最快的异步回调*/
-avalon.nextTick = new function () {// jshint ignore:line
- var tickImmediate = window.setImmediate
- var tickObserver = window.MutationObserver
- if (tickImmediate) {//IE10 \11 edage
- return tickImmediate.bind(window)
- }
-
- var queue = []
- function callback() {
- var n = queue.length
- for (var i = 0; i < n; i++) {
- queue[i]()
- }
- queue = queue.slice(n)
- }
-
- if (tickObserver) {// 支持MutationObserver
- var node = document.createTextNode("avalon")
- new tickObserver(callback).observe(node, {characterData: true})// jshint ignore:line
- return function (fn) {
- queue.push(fn)
- node.data = Math.random()
- }
- }
-
- if (window.VBArray) {
- return function (fn) {
- queue.push(fn)
- var node = DOC.createElement("script")
- node.onreadystatechange = function () {
- callback() //在interactive阶段就触发
- node.onreadystatechange = null
- head.removeChild(node)
- node = null
- }
- head.appendChild(node)
- }
- }
-
-
- return function (fn) {
- setTimeout(fn, 4)
- }
-}// jshint ignore:line
-/*********************************************************************
- * avalon的静态方法定义区 *
- **********************************************************************/
-avalon.init = function (el) {
- this[0] = this.element = el
-}
-avalon.fn = avalon.prototype = avalon.init.prototype
-
-avalon.type = function (obj) { //取得目标的类型
- if (obj == null) {
- return String(obj)
- }
- // 早期的webkit内核浏览器实现了已废弃的ecma262v4标准,可以将正则字面量当作函数使用,因此typeof在判定正则时会返回function
- return typeof obj === "object" || typeof obj === "function" ?
- class2type[serialize.call(obj)] || "object" :
- typeof obj
-}
-
-var isFunction = typeof alert === "object" ? function (fn) {
- try {
- return /^\s*\bfunction\b/.test(fn + "")
- } catch (e) {
- return false
- }
-} : function (fn) {
- return serialize.call(fn) === "[object Function]"
-}
-avalon.isFunction = isFunction
-
-avalon.isWindow = function (obj) {
- if (!obj)
- return false
- // 利用IE678 window == document为true,document == window竟然为false的神奇特性
- // 标准浏览器及IE9,IE10等使用 正则检测
- return obj == obj.document && obj.document != obj //jshint ignore:line
-}
-
-function isWindow(obj) {
- return rwindow.test(serialize.call(obj))
-}
-if (isWindow(window)) {
- avalon.isWindow = isWindow
-}
-var enu
-for (enu in avalon({})) {
- break
-}
-var enumerateBUG = enu !== "0" //IE6下为true, 其他为false
-/*判定是否是一个朴素的javascript对象(Object),不是DOM对象,不是BOM对象,不是自定义类的实例*/
-avalon.isPlainObject = function (obj, key) {
- if (!obj || avalon.type(obj) !== "object" || obj.nodeType || avalon.isWindow(obj)) {
- return false;
- }
- try { //IE内置对象没有constructor
- if (obj.constructor && !ohasOwn.call(obj, "constructor") && !ohasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
- return false;
- }
- } catch (e) { //IE8 9会在这里抛错
- return false;
- }
- if (enumerateBUG) {
- for (key in obj) {
- return ohasOwn.call(obj, key)
- }
- }
- for (key in obj) {
- }
- return key === void 0 || ohasOwn.call(obj, key)
-}
-if (rnative.test(Object.getPrototypeOf)) {
- avalon.isPlainObject = function (obj) {
- // 简单的 typeof obj === "object"检测,会致使用isPlainObject(window)在opera下通不过
- return serialize.call(obj) === "[object Object]" && Object.getPrototypeOf(obj) === oproto
- }
-}
-//与jQuery.extend方法,可用于浅拷贝,深拷贝
-avalon.mix = avalon.fn.mix = function () {
- var options, name, src, copy, copyIsArray, clone,
- target = arguments[0] || {},
- i = 1,
- length = arguments.length,
- deep = false
-
- // 如果第一个参数为布尔,判定是否深拷贝
- if (typeof target === "boolean") {
- deep = target
- target = arguments[1] || {}
- i++
- }
-
- //确保接受方为一个复杂的数据类型
- if (typeof target !== "object" && !isFunction(target)) {
- target = {}
- }
-
- //如果只有一个参数,那么新成员添加于mix所在的对象上
- if (i === length) {
- target = this
- i--
- }
-
- for (; i < length; i++) {
- //只处理非空参数
- if ((options = arguments[i]) != null) {
- for (name in options) {
- src = target[name]
- try {
- copy = options[name] //当options为VBS对象时报错
- } catch (e) {
- continue
- }
-
- // 防止环引用
- if (target === copy) {
- continue
- }
- if (deep && copy && (avalon.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) {
-
- if (copyIsArray) {
- copyIsArray = false
- clone = src && Array.isArray(src) ? src : []
-
- } else {
- clone = src && avalon.isPlainObject(src) ? src : {}
- }
-
- target[name] = avalon.mix(deep, clone, copy)
- } else if (copy !== void 0) {
- target[name] = copy
- }
- }
- }
- }
- return target
-}
-
-function _number(a, len) { //用于模拟slice, splice的效果
- a = Math.floor(a) || 0
- return a < 0 ? Math.max(len + a, 0) : Math.min(a, len);
-}
-
-avalon.mix({
- rword: rword,
- subscribers: subscribers,
- version: 1.471,
- ui: {},
- log: log,
- slice: W3C ? function (nodes, start, end) {
- return aslice.call(nodes, start, end)
- } : function (nodes, start, end) {
- var ret = []
- var len = nodes.length
- if (end === void 0)
- end = len
- if (typeof end === "number" && isFinite(end)) {
- start = _number(start, len)
- end = _number(end, len)
- for (var i = start; i < end; ++i) {
- ret[i - start] = nodes[i]
- }
- }
- return ret
- },
- noop: noop,
- /*如果不用Error对象封装一下,str在控制台下可能会乱码*/
- error: function (str, e) {
- throw (e || Error)(str)
- },
- /*将一个以空格或逗号隔开的字符串或数组,转换成一个键值都为1的对象*/
- oneObject: oneObject,
- /* avalon.range(10)
- => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
- avalon.range(1, 11)
- => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
- avalon.range(0, 30, 5)
- => [0, 5, 10, 15, 20, 25]
- avalon.range(0, -10, -1)
- => [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
- avalon.range(0)
- => []*/
- range: function (start, end, step) { // 用于生成整数数组
- step || (step = 1)
- if (end == null) {
- end = start || 0
- start = 0
- }
- var index = -1,
- length = Math.max(0, Math.ceil((end - start) / step)),
- result = new Array(length)
- while (++index < length) {
- result[index] = start
- start += step
- }
- return result
- },
- eventHooks: [],
- /*绑定事件*/
- bind: function (el, type, fn, phase) {
- var hooks = avalon.eventHooks
- var hook = hooks[type]
- if (typeof hook === "object") {
- type = hook.type || type
- phase = hook.phase || !!phase
- fn = hook.fn ? hook.fn(el,fn): fn
- }
- var callback = W3C ? fn : function (e) {
- fn.call(el, fixEvent(e));
- }
- if (W3C) {
- el.addEventListener(type, callback, phase)
- } else {
- el.attachEvent("on" + type, callback)
- }
- return callback
- },
- /*卸载事件*/
- unbind: function (el, type, fn, phase) {
- var hooks = avalon.eventHooks
- var hook = hooks[type]
- var callback = fn || noop
- if (typeof hook === "object") {
- type = hook.type || type
- phase = hook.phase || !!phase
- }
- if (W3C) {
- el.removeEventListener(type, callback, phase)
- } else {
- el.detachEvent("on" + type, callback)
- }
- },
- /*读写删除元素节点的样式*/
- css: function (node, name, value) {
- if (node instanceof avalon) {
- node = node[0]
- }
- var prop = /[_-]/.test(name) ? camelize(name) : name, fn
- name = avalon.cssName(prop) || prop
- if (value === void 0 || typeof value === "boolean") { //获取样式
- fn = cssHooks[prop + ":get"] || cssHooks["@:get"]
- if (name === "background") {
- name = "backgroundColor"
- }
- var val = fn(node, name)
- return value === true ? parseFloat(val) || 0 : val
- } else if (value === "") { //请除样式
- node.style[name] = ""
- } else { //设置样式
- if (value == null || value !== value) {
- return
- }
- if (isFinite(value) && !avalon.cssNumber[prop]) {
- value += "px"
- }
- fn = cssHooks[prop + ":set"] || cssHooks["@:set"]
- fn(node, name, value)
- }
- },
- /*遍历数组与对象,回调的第一个参数为索引或键名,第二个或元素或键值*/
- each: function (obj, fn) {
- if (obj) { //排除null, undefined
- var i = 0
- if (isArrayLike(obj)) {
- for (var n = obj.length; i < n; i++) {
- if (fn(i, obj[i]) === false)
- break
- }
- } else {
- for (i in obj) {
- if (obj.hasOwnProperty(i) && fn(i, obj[i]) === false) {
- break
- }
- }
- }
- }
- },
- //收集元素的data-{{prefix}}-*属性,并转换为对象
- getWidgetData: function (elem, prefix) {
- var raw = avalon(elem).data()
- var result = {}
- for (var i in raw) {
- if (i.indexOf(prefix) === 0) {
- result[i.replace(prefix, "").replace(/\w/, function (a) {
- return a.toLowerCase()
- })] = raw[i]
- }
- }
- return result
- },
- Array: {
- /*只有当前数组不存在此元素时只添加它*/
- ensure: function (target, item) {
- if (target.indexOf(item) === -1) {
- return target.push(item)
- }
- },
- /*移除数组中指定位置的元素,返回布尔表示成功与否*/
- removeAt: function (target, index) {
- return !!target.splice(index, 1).length
- },
- /*移除数组中第一个匹配传参的那个元素,返回布尔表示成功与否*/
- remove: function (target, item) {
- var index = target.indexOf(item)
- if (~index)
- return avalon.Array.removeAt(target, index)
- return false
- }
- }
-})
-
-var bindingHandlers = avalon.bindingHandlers = {}
-var bindingExecutors = avalon.bindingExecutors = {}
-
-/*判定是否类数组,如节点集合,纯数组,arguments与拥有非负整数的length属性的纯JS对象*/
-function isArrayLike(obj) {
- if (!obj)
- return false
- var n = obj.length
- if (n === (n >>> 0)) { //检测length属性是否为非负整数
- var type = serialize.call(obj).slice(8, -1)
- if (/(?:regexp|string|function|window|global)$/i.test(type))
- return false
- if (type === "Array")
- return true
- try {
- if ({}.propertyIsEnumerable.call(obj, "length") === false) { //如果是原生对象
- return /^\s?function/.test(obj.item || obj.callee)
- }
- return true
- } catch (e) { //IE的NodeList直接抛错
- return !obj.window //IE6-8 window
- }
- }
- return false
-}
-
-
-// https://github.com/rsms/js-lru
-var Cache = new function() {// jshint ignore:line
- function LRU(maxLength) {
- this.size = 0
- this.limit = maxLength
- this.head = this.tail = void 0
- this._keymap = {}
- }
-
- var p = LRU.prototype
-
- p.put = function(key, value) {
- var entry = {
- key: key,
- value: value
- }
- this._keymap[key] = entry
- if (this.tail) {
- this.tail.newer = entry
- entry.older = this.tail
- } else {
- this.head = entry
- }
- this.tail = entry
- if (this.size === this.limit) {
- this.shift()
- } else {
- this.size++
- }
- return value
- }
-
- p.shift = function() {
- var entry = this.head
- if (entry) {
- this.head = this.head.newer
- this.head.older =
- entry.newer =
- entry.older =
- this._keymap[entry.key] = void 0
- delete this._keymap[entry.key] //#1029
- }
- }
- p.get = function(key) {
- var entry = this._keymap[key]
- if (entry === void 0)
- return
- if (entry === this.tail) {
- return entry.value
- }
- // HEAD--------------TAIL
- // <.older .newer>
- // <--- add direction --
- // A B C <D> E
- if (entry.newer) {
- if (entry === this.head) {
- this.head = entry.newer
- }
- entry.newer.older = entry.older // C <-- E.
- }
- if (entry.older) {
- entry.older.newer = entry.newer // C. --> E
- }
- entry.newer = void 0 // D --x
- entry.older = this.tail // D. --> E
- if (this.tail) {
- this.tail.newer = entry // E. <-- D
- }
- this.tail = entry
- return entry.value
- }
- return LRU
-}// jshint ignore:line
-
-/*********************************************************************
- * javascript 底层补丁 *
- **********************************************************************/
-if (!"司徒正美".trim) {
- var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g
- String.prototype.trim = function () {
- return this.replace(rtrim, "")
- }
-}
-var hasDontEnumBug = !({
- 'toString': null
-}).propertyIsEnumerable('toString'),
- hasProtoEnumBug = (function () {
- }).propertyIsEnumerable('prototype'),
- dontEnums = [
- "toString",
- "toLocaleString",
- "valueOf",
- "hasOwnProperty",
- "isPrototypeOf",
- "propertyIsEnumerable",
- "constructor"
- ],
- dontEnumsLength = dontEnums.length;
-if (!Object.keys) {
- Object.keys = function (object) { //ecma262v5 15.2.3.14
- var theKeys = []
- var skipProto = hasProtoEnumBug && typeof object === "function"
- if (typeof object === "string" || (object && object.callee)) {
- for (var i = 0; i < object.length; ++i) {
- theKeys.push(String(i))
- }
- } else {
- for (var name in object) {
- if (!(skipProto && name === "prototype") && ohasOwn.call(object, name)) {
- theKeys.push(String(name))
- }
- }
- }
-
- if (hasDontEnumBug) {
- var ctor = object.constructor,
- skipConstructor = ctor && ctor.prototype === object
- for (var j = 0; j < dontEnumsLength; j++) {
- var dontEnum = dontEnums[j]
- if (!(skipConstructor && dontEnum === "constructor") && ohasOwn.call(object, dontEnum)) {
- theKeys.push(dontEnum)
- }
- }
- }
- return theKeys
- }
-}
-if (!Array.isArray) {
- Array.isArray = function (a) {
- return serialize.call(a) === "[object Array]"
- }
-}
-
-if (!noop.bind) {
- Function.prototype.bind = function (scope) {
- if (arguments.length < 2 && scope === void 0)
- return this
- var fn = this,
- argv = arguments
- return function () {
- var args = [],
- i
- for (i = 1; i < argv.length; i++)
- args.push(argv[i])
- for (i = 0; i < arguments.length; i++)
- args.push(arguments[i])
- return fn.apply(scope, args)
- }
- }
-}
-
-function iterator(vars, body, ret) {
- var fun = 'for(var ' + vars + 'i=0,n = this.length; i < n; i++){' + body.replace('_', '((i in this) && fn.call(scope,this[i],i,this))') + '}' + ret
- /* jshint ignore:start */
- return Function("fn,scope", fun)
- /* jshint ignore:end */
-}
-if (!rnative.test([].map)) {
- avalon.mix(ap, {
- //定位操作,返回数组中第一个等于给定参数的元素的索引值。
- indexOf: function (item, index) {
- var n = this.length,
- i = ~~index
- if (i < 0)
- i += n
- for (; i < n; i++)
- if (this[i] === item)
- return i
- return -1
- },
- //定位操作,同上,不过是从后遍历。
- lastIndexOf: function (item, index) {
- var n = this.length,
- i = index == null ? n - 1 : index
- if (i < 0)
- i = Math.max(0, n + i)
- for (; i >= 0; i--)
- if (this[i] === item)
- return i
- return -1
- },
- //迭代操作,将数组的元素挨个儿传入一个函数中执行。Prototype.js的对应名字为each。
- forEach: iterator("", '_', ""),
- //迭代类 在数组中的每个项上运行一个函数,如果此函数的值为真,则此元素作为新数组的元素收集起来,并返回新数组
- filter: iterator('r=[],j=0,', 'if(_)r[j++]=this[i]', 'return r'),
- //收集操作,将数组的元素挨个儿传入一个函数中执行,然后把它们的返回值组成一个新数组返回。Prototype.js的对应名字为collect。
- map: iterator('r=[],', 'r[i]=_', 'return r'),
- //只要数组中有一个元素满足条件(放进给定函数返回true),那么它就返回true。Prototype.js的对应名字为any。
- some: iterator("", 'if(_)return true', 'return false'),
- //只有数组中的元素都满足条件(放进给定函数返回true),它才返回true。Prototype.js的对应名字为all。
- every: iterator("", 'if(!_)return false', 'return true')
- })
-}
-/*********************************************************************
- * DOM 底层补丁 *
- **********************************************************************/
-
-function fixContains(root, el) {
- try { //IE6-8,游离于DOM树外的文本节点,访问parentNode有时会抛错
- while ((el = el.parentNode))
- if (el === root)
- return true
- return false
- } catch (e) {
- return false
- }
-}
-avalon.contains = fixContains
-//IE6-11的文档对象没有contains
-if (!DOC.contains) {
- DOC.contains = function (b) {
- return fixContains(DOC, b)
- }
-}
-
-function outerHTML() {
- return new XMLSerializer().serializeToString(this)
-}
-
-if (window.SVGElement) {
- //safari5+是把contains方法放在Element.prototype上而不是Node.prototype
- if (!DOC.createTextNode("x").contains) {
- Node.prototype.contains = function (arg) {//IE6-8没有Node对象
- return !!(this.compareDocumentPosition(arg) & 16)
- }
- }
- var svgns = "http://www.w3.org/2000/svg"
- var svg = DOC.createElementNS(svgns, "svg")
- svg.innerHTML = '<circle cx="50" cy="50" r="40" fill="red" />'
- if (!rsvg.test(svg.firstChild)) { // #409
- function enumerateNode(node, targetNode) {// jshint ignore:line
- if (node && node.childNodes) {
- var nodes = node.childNodes
- for (var i = 0, el; el = nodes[i++]; ) {
- if (el.tagName) {
- var svg = DOC.createElementNS(svgns,
- el.tagName.toLowerCase())
- ap.forEach.call(el.attributes, function (attr) {
- svg.setAttribute(attr.name, attr.value) //复制属性
- })// jshint ignore:line
- // 递归处理子节点
- enumerateNode(el, svg)
- targetNode.appendChild(svg)
- }
- }
- }
- }
- Object.defineProperties(SVGElement.prototype, {
- "outerHTML": {//IE9-11,firefox不支持SVG元素的innerHTML,outerHTML属性
- enumerable: true,
- configurable: true,
- get: outerHTML,
- set: function (html) {
- var tagName = this.tagName.toLowerCase(),
- par = this.parentNode,
- frag = avalon.parseHTML(html)
- // 操作的svg,直接插入
- if (tagName === "svg") {
- par.insertBefore(frag, this)
- // svg节点的子节点类似
- } else {
- var newFrag = DOC.createDocumentFragment()
- enumerateNode(frag, newFrag)
- par.insertBefore(newFrag, this)
- }
- par.removeChild(this)
- }
- },
- "innerHTML": {
- enumerable: true,
- configurable: true,
- get: function () {
- var s = this.outerHTML
- var ropen = new RegExp("<" + this.nodeName + '\\b(?:(["\'])[^"]*?(\\1)|[^>])*>', "i")
- var rclose = new RegExp("<\/" + this.nodeName + ">$", "i")
- return s.replace(ropen, "").replace(rclose, "")
- },
- set: function (html) {
- if (avalon.clearHTML) {
- avalon.clearHTML(this)
- var frag = avalon.parseHTML(html)
- enumerateNode(frag, this)
- }
- }
- }
- })
- }
-}
-if (!root.outerHTML && window.HTMLElement) { //firefox 到11时才有outerHTML
- HTMLElement.prototype.__defineGetter__("outerHTML", outerHTML);
-}
-
-
-//============================= event binding =======================
-var rmouseEvent = /^(?:mouse|contextmenu|drag)|click/
-function fixEvent(event) {
- var ret = {}
- for (var i in event) {
- ret[i] = event[i]
- }
- var target = ret.target = event.srcElement
- if (event.type.indexOf("key") === 0) {
- ret.which = event.charCode != null ? event.charCode : event.keyCode
- } else if (rmouseEvent.test(event.type)) {
- var doc = target.ownerDocument || DOC
- var box = doc.compatMode === "BackCompat" ? doc.body : doc.documentElement
- ret.pageX = event.clientX + (box.scrollLeft >> 0) - (box.clientLeft >> 0)
- ret.pageY = event.clientY + (box.scrollTop >> 0) - (box.clientTop >> 0)
- ret.wheelDeltaY = ret.wheelDelta
- ret.wheelDeltaX = 0
- }
- ret.timeStamp = new Date() - 0
- ret.originalEvent = event
- ret.preventDefault = function () { //阻止默认行为
- event.returnValue = false
- }
- ret.stopPropagation = function () { //阻止事件在DOM树中的传播
- event.cancelBubble = true
- }
- return ret
-}
-
-var eventHooks = avalon.eventHooks
-//针对firefox, chrome修正mouseenter, mouseleave
-if (!("onmouseenter" in root)) {
- avalon.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout"
- }, function (origType, fixType) {
- eventHooks[origType] = {
- type: fixType,
- fn: function (elem, fn) {
- return function (e) {
- var t = e.relatedTarget
- if (!t || (t !== elem && !(elem.compareDocumentPosition(t) & 16))) {
- delete e.type
- e.type = origType
- return fn.call(elem, e)
- }
- }
- }
- }
- })
-}
-//针对IE9+, w3c修正animationend
-avalon.each({
- AnimationEvent: "animationend",
- WebKitAnimationEvent: "webkitAnimationEnd"
-}, function (construct, fixType) {
- if (window[construct] && !eventHooks.animationend) {
- eventHooks.animationend = {
- type: fixType
- }
- }
-})
-//针对IE6-8修正input
-if (!("oninput" in DOC.createElement("input"))) {
- eventHooks.input = {
- type: "propertychange",
- fn: function (elem, fn) {
- return function (e) {
- if (e.propertyName === "value") {
- e.type = "input"
- return fn.call(elem, e)
- }
- }
- }
- }
-}
-if (DOC.onmousewheel === void 0) {
- /* IE6-11 chrome mousewheel wheelDetla 下 -120 上 120
- firefox DOMMouseScroll detail 下3 上-3
- firefox wheel detlaY 下3 上-3
- IE9-11 wheel deltaY 下40 上-40
- chrome wheel deltaY 下100 上-100 */
- var fixWheelType = DOC.onwheel !== void 0 ? "wheel" : "DOMMouseScroll"
- var fixWheelDelta = fixWheelType === "wheel" ? "deltaY" : "detail"
- eventHooks.mousewheel = {
- type: fixWheelType,
- fn: function (elem, fn) {
- return function (e) {
- e.wheelDeltaY = e.wheelDelta = e[fixWheelDelta] > 0 ? -120 : 120
- e.wheelDeltaX = 0
- if (Object.defineProperty) {
- Object.defineProperty(e, "type", {
- value: "mousewheel"
- })
- }
- fn.call(elem, e)
- }
- }
- }
-}
-
-
-
-/*********************************************************************
- * 配置系统 *
- **********************************************************************/
-
-function kernel(settings) {
- for (var p in settings) {
- if (!ohasOwn.call(settings, p))
- continue
- var val = settings[p]
- if (typeof kernel.plugins[p] === "function") {
- kernel.plugins[p](val)
- } else if (typeof kernel[p] === "object") {
- avalon.mix(kernel[p], val)
- } else {
- kernel[p] = val
- }
- }
- return this
-}
-var openTag, closeTag, rexpr, rexprg, rbind, rregexp = /[-.*+?^${}()|[\]\/\\]/g
-
-function escapeRegExp(target) {
- //http://stevenlevithan.com/regex/xregexp/
- //将字符串安全格式化为正则表达式的源码
- return (target + "").replace(rregexp, "\\$&")
-}
-
-var plugins = {
-
- interpolate: function (array) {
- openTag = array[0]
- closeTag = array[1]
- if (openTag === closeTag) {
- throw new SyntaxError("openTag===closeTag")
- } else {
- var test = openTag + "test" + closeTag
- cinerator.innerHTML = test
- if (cinerator.innerHTML !== test && cinerator.innerHTML.indexOf("&lt;") > -1) {
- throw new SyntaxError("此定界符不合法")
- }
- kernel.openTag = openTag
- kernel.closeTag = closeTag
- cinerator.innerHTML = ""
- }
- var o = escapeRegExp(openTag),
- c = escapeRegExp(closeTag)
- rexpr = new RegExp(o + "(.*?)" + c)
- rexprg = new RegExp(o + "(.*?)" + c, "g")
- rbind = new RegExp(o + ".*?" + c + "|\\sms-")
- }
-}
-
-kernel.debug = true
-kernel.plugins = plugins
-kernel.plugins['interpolate'](["{{", "}}"])
-kernel.paths = {}
-kernel.shim = {}
-kernel.maxRepeatSize = 100
-avalon.config = kernel
-var ravalon = /(\w+)\[(avalonctrl)="(\S+)"\]/
-var findNodes = DOC.querySelectorAll ? function(str) {
- return DOC.querySelectorAll(str)
-} : function(str) {
- var match = str.match(ravalon)
- var all = DOC.getElementsByTagName(match[1])
- var nodes = []
- for (var i = 0, el; el = all[i++]; ) {
- if (el.getAttribute(match[2]) === match[3]) {
- nodes.push(el)
- }
- }
- return nodes
-}
-/*********************************************************************
- * 事件总线 *
- **********************************************************************/
-var EventBus = {
- $watch: function (type, callback) {
- if (typeof callback === "function") {
- var callbacks = this.$events[type]
- if (callbacks) {
- callbacks.push(callback)
- } else {
- this.$events[type] = [callback]
- }
- } else { //重新开始监听此VM的第一重简单属性的变动
- this.$events = this.$watch.backup
- }
- return this
- },
- $unwatch: function (type, callback) {
- var n = arguments.length
- if (n === 0) { //让此VM的所有$watch回调无效化
- this.$watch.backup = this.$events
- this.$events = {}
- } else if (n === 1) {
- this.$events[type] = []
- } else {
- var callbacks = this.$events[type] || []
- var i = callbacks.length
- while (~--i < 0) {
- if (callbacks[i] === callback) {
- return callbacks.splice(i, 1)
- }
- }
- }
- return this
- },
- $fire: function (type) {
- var special, i, v, callback
- if (/^(\w+)!(\S+)$/.test(type)) {
- special = RegExp.$1
- type = RegExp.$2
- }
- var events = this.$events
- if (!events)
- return
- var args = aslice.call(arguments, 1)
- var detail = [type].concat(args)
- if (special === "all") {
- for (i in avalon.vmodels) {
- v = avalon.vmodels[i]
- if (v !== this) {
- v.$fire.apply(v, detail)
- }
- }
- } else if (special === "up" || special === "down") {
- var elements = events.expr ? findNodes(events.expr) : []
- if (elements.length === 0)
- return
- for (i in avalon.vmodels) {
- v = avalon.vmodels[i]
- if (v !== this) {
- if (v.$events.expr) {
- var eventNodes = findNodes(v.$events.expr)
- if (eventNodes.length === 0) {
- continue
- }
- //循环两个vmodel中的节点,查找匹配(向上匹配或者向下匹配)的节点并设置标识
- /* jshint ignore:start */
- ap.forEach.call(eventNodes, function (node) {
- ap.forEach.call(elements, function (element) {
- var ok = special === "down" ? element.contains(node) : //向下捕获
- node.contains(element) //向上冒泡
- if (ok) {
- node._avalon = v //符合条件的加一个标识
- }
- });
- })
- /* jshint ignore:end */
- }
- }
- }
- var nodes = DOC.getElementsByTagName("*") //实现节点排序
- var alls = []
- ap.forEach.call(nodes, function (el) {
- if (el._avalon) {
- alls.push(el._avalon)
- el._avalon = ""
- el.removeAttribute("_avalon")
- }
- })
- if (special === "up") {
- alls.reverse()
- }
- for (i = 0; callback = alls[i++]; ) {
- if (callback.$fire.apply(callback, detail) === false) {
- break
- }
- }
- } else {
- var callbacks = events[type] || []
- var all = events.$all || []
- for (i = 0; callback = callbacks[i++]; ) {
- if (isFunction(callback))
- callback.apply(this, args)
- }
- for (i = 0; callback = all[i++]; ) {
- if (isFunction(callback))
- callback.apply(this, arguments)
- }
- }
- }
-}
-/*********************************************************************
- * modelFactory *
- **********************************************************************/
-//avalon最核心的方法的两个方法之一(另一个是avalon.scan),返回一个ViewModel(VM)
-var VMODELS = avalon.vmodels = {} //所有vmodel都储存在这里
-avalon.define = function (id, factory) {
- var $id = id.$id || id
- if (!$id) {
- log("warning: vm必须指定$id")
- }
- if (VMODELS[$id]) {
- log("warning: " + $id + " 已经存在于avalon.vmodels中")
- }
- if (typeof id === "object") {
- var model = modelFactory(id)
- } else {
- var scope = {
- $watch: noop
- }
- factory(scope) //得到所有定义
-
- model = modelFactory(scope) //偷天换日,将scope换为model
- stopRepeatAssign = true
- factory(model)
- stopRepeatAssign = false
- }
- model.$id = $id
- return VMODELS[$id] = model
-}
-
-//一些不需要被监听的属性
-var $$skipArray = String("$id,$watch,$unwatch,$fire,$events,$model,$skipArray,$reinitialize").match(rword)
-var defineProperty = Object.defineProperty
-var canHideOwn = true
-//如果浏览器不支持ecma262v5的Object.defineProperties或者存在BUG,比如IE8
-//标准浏览器使用__defineGetter__, __defineSetter__实现
-try {
- defineProperty({}, "_", {
- value: "x"
- })
- var defineProperties = Object.defineProperties
-} catch (e) {
- canHideOwn = false
-}
-
-function modelFactory(source, $special, $model) {
- if (Array.isArray(source)) {
- var arr = source.concat()
- source.length = 0
- var collection = arrayFactory(source)
- collection.pushArray(arr)
- return collection
- }
- //0 null undefined || Node || VModel(fix IE6-8 createWithProxy $val: val引发的BUG)
- if (!source || (source.$id && source.$events) || (source.nodeType > 0 && source.nodeName) ) {
- return source
- }
- var $skipArray = Array.isArray(source.$skipArray) ? source.$skipArray : []
- $skipArray.$special = $special || {} //强制要监听的属性
- var $vmodel = {} //要返回的对象, 它在IE6-8下可能被偷龙转凤
- $model = $model || {} //vmodels.$model属性
- var $events = {} //vmodel.$events属性
- var accessors = {} //监控属性
- var computed = []
- $$skipArray.forEach(function (name) {
- delete source[name]
- })
- var names = Object.keys(source)
- /* jshint ignore:start */
- names.forEach(function (name, accessor) {
- var val = source[name]
- $model[name] = val
- if (isObservable(name, val, $skipArray)) {
- //总共产生三种accessor
- $events[name] = []
- var valueType = avalon.type(val)
- //总共产生三种accessor
- if (valueType === "object" && isFunction(val.get) && Object.keys(val).length <= 2) {
- accessor = makeComputedAccessor(name, val)
- computed.push(accessor)
- } else if (rcomplexType.test(valueType)) {
- // issue #940 解决$model层次依赖丢失 https://github.com/RubyLouvre/avalon/issues/940
- // $model[name] = {}
- accessor = makeComplexAccessor(name, val, valueType, $events[name], $model)
- } else {
- accessor = makeSimpleAccessor(name, val)
- }
- accessors[name] = accessor
- }
- })
- /* jshint ignore:end */
- $vmodel = defineProperties($vmodel, descriptorFactory(accessors), source) //生成一个空的ViewModel
- for (var i = 0; i < names.length; i++) {
- var name = names[i]
- if (!accessors[name]) {
- $vmodel[name] = source[name]
- }
- }
- //添加$id, $model, $events, $watch, $unwatch, $fire
- hideProperty($vmodel, "$id", generateID())
- hideProperty($vmodel, "$model", $model)
- hideProperty($vmodel, "$events", $events)
- /* jshint ignore:start */
- if (canHideOwn) {
- hideProperty($vmodel, "hasOwnProperty", function (name) {
- return name in $vmodel.$model
- })
- } else {
- $vmodel.hasOwnProperty = function (name) {
- return (name in $vmodel.$model) && (name !== "hasOwnProperty")
- }
- }
- /* jshint ignore:end */
- for ( i in EventBus) {
- hideProperty($vmodel, i, EventBus[i].bind($vmodel))
- }
-
- $vmodel.$reinitialize = function () {
- computed.forEach(function (accessor) {
- delete accessor._value
- delete accessor.oldArgs
- accessor.digest = function () {
- accessor.call($vmodel)
- }
- dependencyDetection.begin({
- callback: function (vm, dependency) {//dependency为一个accessor
- var name = dependency._name
- if (dependency !== accessor) {
- var list = vm.$events[name]
- injectDependency(list, accessor.digest)
- }
- }
- })
- try {
- accessor.get.call($vmodel)
- } finally {
- dependencyDetection.end()
- }
- })
- }
- $vmodel.$reinitialize()
- return $vmodel
-}
-
-
-function hideProperty(host, name, value) {
- if (canHideOwn) {
- Object.defineProperty(host, name, {
- value: value,
- writable: true,
- enumerable: false,
- configurable: true
- })
- } else {
- host[name] = value
- }
-}
-//创建一个简单访问器
-function makeSimpleAccessor(name, value) {
- function accessor(value) {
- var oldValue = accessor._value
- if (arguments.length > 0) {
- if (!stopRepeatAssign && !isEqual(value, oldValue)) {
- accessor.updateValue(this, value)
- accessor.notify(this, value, oldValue)
- }
- return this
- } else {
- dependencyDetection.collectDependency(this, accessor)
- return oldValue
- }
- }
- accessorFactory(accessor, name)
- accessor._value = value
- return accessor;
-}
-
-//创建一个计算访问器
-function makeComputedAccessor(name, options) {
- function accessor(value) {//计算属性
- var oldValue = accessor._value
- var init = ("_value" in accessor)
- if (arguments.length > 0) {
- if (stopRepeatAssign) {
- return this
- }
- if (typeof accessor.set === "function") {
- if (accessor.oldArgs !== value) {
- accessor.oldArgs = value
- var $events = this.$events
- var lock = $events[name]
- $events[name] = [] //清空回调,防止内部冒泡而触发多次$fire
- accessor.set.call(this, value)
- $events[name] = lock
- value = accessor.get.call(this)
- if (value !== oldValue) {
- accessor.updateValue(this, value)
- accessor.notify(this, value, oldValue) //触发$watch回调
- }
- }
- }
- return this
- } else {
- //将依赖于自己的高层访问器或视图刷新函数(以绑定对象形式)放到自己的订阅数组中
- //将自己注入到低层访问器的订阅数组中
- value = accessor.get.call(this)
- accessor.updateValue(this, value)
- if (init && oldValue !== value) {
- accessor.notify(this, value, oldValue) //触发$watch回调
- }
- return value
- }
- }
- accessor.set = options.set
- accessor.get = options.get
- accessorFactory(accessor, name)
- return accessor
-}
-
-//创建一个复杂访问器
-function makeComplexAccessor(name, initValue, valueType, list, parentModel) {
-
- function accessor(value) {
- var oldValue = accessor._value
-
- var son = accessor._vmodel
- if (arguments.length > 0) {
- if (stopRepeatAssign) {
- return this
- }
- if (valueType === "array") {
- var a = son, b = value,
- an = a.length,
- bn = b.length
- a.$lock = true
- if (an > bn) {
- a.splice(bn, an - bn)
- } else if (bn > an) {
- a.push.apply(a, b.slice(an))
- }
- var n = Math.min(an, bn)
- for (var i = 0; i < n; i++) {
- a.set(i, b[i])
- }
- delete a.$lock
- a._fire("set")
- } else if (valueType === "object") {
- value = value.$model ? value.$model : value
- var observes = this.$events[name] || []
- var newObject = avalon.mix(true, {}, value)
- for(i in son ){
- if(son.hasOwnProperty(i) && ohasOwn.call(newObject,i)){
- son[i] = newObject[i]
- }
- }
- son = accessor._vmodel = modelFactory(value)
- son.$events[subscribers] = observes
- if (observes.length) {
- observes.forEach(function (data) {
- if (!data.type) {
- return //数据未准备好时忽略更新
- }
- if (data.rollback) {
- data.rollback() //还原 ms-with ms-on
- }
- bindingHandlers[data.type](data, data.vmodels)
- })
- }
- }
- accessor.updateValue(this, son.$model)
- accessor.notify(this, this._value, oldValue)
- return this
- } else {
- dependencyDetection.collectDependency(this, accessor)
- return son
- }
- }
- accessorFactory(accessor, name)
- if (Array.isArray(initValue)) {
- parentModel[name] = initValue
- } else {
- parentModel[name] = parentModel[name] || {}
- }
- var son = accessor._vmodel = modelFactory(initValue, 0, parentModel[name])
- son.$events[subscribers] = list
- return accessor
-}
-
-function globalUpdateValue(vmodel, value) {
- vmodel.$model[this._name] = this._value = value
-}
-
-function globalNotify(vmodel, value, oldValue) {
- var name = this._name
- var array = vmodel.$events[name] //刷新值
- if (array) {
- fireDependencies(array) //同步视图
- EventBus.$fire.call(vmodel, name, value, oldValue) //触发$watch回调
- }
-}
-
-function accessorFactory(accessor, name) {
- accessor._name = name
- //同时更新_value与model
- accessor.updateValue = globalUpdateValue
- accessor.notify = globalNotify
-}
-
-//比较两个值是否相等
-var isEqual = Object.is || function (v1, v2) {
- if (v1 === 0 && v2 === 0) {
- return 1 / v1 === 1 / v2
- } else if (v1 !== v1) {
- return v2 !== v2
- } else {
- return v1 === v2
- }
-}
-
-function isObservable(name, value, $skipArray) {
- if (isFunction(value) || value && value.nodeName && (value.nodeType > 0) ) {
- return false
- }
- if ($skipArray.indexOf(name) !== -1) {
- return false
- }
- var $special = $skipArray.$special
- if (name && name.charAt(0) === "$" && !$special[name]) {
- return false
- }
- return true
-}
-function keysVM(obj) {
- var arr = Object.keys(obj.$model ? obj.$model: obj)
- for (var i = 0; i < $$skipArray.length; i++) {
- var index = arr.indexOf($$skipArray[i])
- if (index !== -1) {
- arr.splice(index, 1)
- }
- }
- return arr
-}
-var descriptorFactory = W3C ? function (obj) {
- var descriptors = {}
- for (var i in obj) {
- descriptors[i] = {
- get: obj[i],
- set: obj[i],
- enumerable: true,
- configurable: true
- }
- }
- return descriptors
-} : function (a) {
- return a
-}
-
-//===================修复浏览器对Object.defineProperties的支持=================
-if (!canHideOwn) {
- if ("__defineGetter__" in avalon) {
- defineProperty = function (obj, prop, desc) {
- if ('value' in desc) {
- obj[prop] = desc.value
- }
- if ("get" in desc) {
- obj.__defineGetter__(prop, desc.get)
- }
- if ('set' in desc) {
- obj.__defineSetter__(prop, desc.set)
- }
- return obj
- }
- defineProperties = function (obj, descs) {
- for (var prop in descs) {
- if (descs.hasOwnProperty(prop)) {
- defineProperty(obj, prop, descs[prop])
- }
- }
- return obj
- }
- }
- if (IEVersion) {
- var VBClassPool = {}
- window.execScript([// jshint ignore:line
- "Function parseVB(code)",
- "\tExecuteGlobal(code)",
- "End Function" //转换一段文本为VB代码
- ].join("\n"), "VBScript")
- function VBMediator(instance, accessors, name, value) {// jshint ignore:line
- var accessor = accessors[name]
- if (arguments.length === 4) {
- accessor.call(instance, value)
- } else {
- return accessor.call(instance)
- }
- }
- defineProperties = function (name, accessors, properties) {
- // jshint ignore:line
- var buffer = []
- buffer.push(
- "\r\n\tPrivate [__data__], [__proxy__]",
- "\tPublic Default Function [__const__](d"+expose+", p"+expose+")",
- "\t\tSet [__data__] = d"+expose+": set [__proxy__] = p"+expose,
- "\t\tSet [__const__] = Me", //链式调用
- "\tEnd Function")
- //添加普通属性,因为VBScript对象不能像JS那样随意增删属性,必须在这里预先定义好
- for (name in properties) {
- if (!accessors.hasOwnProperty(name)) {
- buffer.push("\tPublic [" + name + "]")
- }
- }
- $$skipArray.forEach(function (name) {
- if (!accessors.hasOwnProperty(name)) {
- buffer.push("\tPublic [" + name + "]")
- }
- })
- buffer.push("\tPublic [" + 'hasOwnProperty' + "]")
- //添加访问器属性
- for (name in accessors) {
- buffer.push(
- //由于不知对方会传入什么,因此set, let都用上
- "\tPublic Property Let [" + name + "](val" + expose + ")", //setter
- "\t\tCall [__proxy__](Me,[__data__], \"" + name + "\", val" + expose + ")",
- "\tEnd Property",
- "\tPublic Property Set [" + name + "](val" + expose + ")", //setter
- "\t\tCall [__proxy__](Me,[__data__], \"" + name + "\", val" + expose + ")",
- "\tEnd Property",
- "\tPublic Property Get [" + name + "]", //getter
- "\tOn Error Resume Next", //必须优先使用set语句,否则它会误将数组当字符串返回
- "\t\tSet[" + name + "] = [__proxy__](Me,[__data__],\"" + name + "\")",
- "\tIf Err.Number <> 0 Then",
- "\t\t[" + name + "] = [__proxy__](Me,[__data__],\"" + name + "\")",
- "\tEnd If",
- "\tOn Error Goto 0",
- "\tEnd Property")
-
- }
-
- buffer.push("End Class")
- var body = buffer.join("\r\n")
- var className =VBClassPool[body]
- if (!className) {
- className = generateID("VBClass")
- window.parseVB("Class " + className + body)
- window.parseVB([
- "Function " + className + "Factory(a, b)", //创建实例并传入两个关键的参数
- "\tDim o",
- "\tSet o = (New " + className + ")(a, b)",
- "\tSet " + className + "Factory = o",
- "End Function"
- ].join("\r\n"))
- VBClassPool[body] = className
- }
- var ret = window[className + "Factory"](accessors, VBMediator) //得到其产品
- return ret //得到其产品
- }
- }
-}
-
-/*********************************************************************
- * 监控数组(与ms-each, ms-repeat配合使用) *
- **********************************************************************/
-
-function arrayFactory(model) {
- var array = []
- array.$id = generateID()
- array.$model = model //数据模型
- array.$events = {}
- array.$events[subscribers] = []
- array._ = modelFactory({
- length: model.length
- })
- array._.$watch("length", function (a, b) {
- array.$fire("length", a, b)
- })
- for (var i in EventBus) {
- array[i] = EventBus[i]
- }
- avalon.mix(array, arrayPrototype)
- return array
-}
-
-function mutateArray(method, pos, n, index, method2, pos2, n2) {
- var oldLen = this.length, loop = 2
- while (--loop) {
- switch (method) {
- case "add":
- /* jshint ignore:start */
- var array = this.$model.slice(pos, pos + n).map(function (el) {
- if (rcomplexType.test(avalon.type(el))) {
- return el.$id ? el : modelFactory(el, 0, el)
- } else {
- return el
- }
- })
- /* jshint ignore:end */
- _splice.apply(this, [pos, 0].concat(array))
- this._fire("add", pos, n)
- break
- case "del":
- var ret = this._splice(pos, n)
- this._fire("del", pos, n)
- break
- }
- if (method2) {
- method = method2
- pos = pos2
- n = n2
- loop = 2
- method2 = 0
- }
- }
- this._fire("index", index)
- if (this.length !== oldLen) {
- this._.length = this.length
- }
- return ret
-}
-
-var _splice = ap.splice
-var arrayPrototype = {
- _splice: _splice,
- _fire: function (method, a, b) {
- fireDependencies(this.$events[subscribers], method, a, b)
- },
- size: function () { //取得数组长度,这个函数可以同步视图,length不能
- return this._.length
- },
- pushArray: function (array) {
- var m = array.length, n = this.length
- if (m) {
- ap.push.apply(this.$model, array)
- mutateArray.call(this, "add", n, m, Math.max(0, n - 1))
- }
- return m + n
- },
- push: function () {
- //http://jsperf.com/closure-with-arguments
- var array = []
- var i, n = arguments.length
- for (i = 0; i < n; i++) {
- array[i] = arguments[i]
- }
- return this.pushArray(array)
- },
- unshift: function () {
- var m = arguments.length, n = this.length
- if (m) {
- ap.unshift.apply(this.$model, arguments)
- mutateArray.call(this, "add", 0, m, 0)
- }
- return m + n //IE67的unshift不会返回长度
- },
- shift: function () {
- if (this.length) {
- var el = this.$model.shift()
- mutateArray.call(this, "del", 0, 1, 0)
- return el //返回被移除的元素
- }
- },
- pop: function () {
- var n = this.length
- if (n) {
- var el = this.$model.pop()
- mutateArray.call(this, "del", n - 1, 1, Math.max(0, n - 2))
- return el //返回被移除的元素
- }
- },
- splice: function (start) {
- var m = arguments.length, args = [], change
- var removed = _splice.apply(this.$model, arguments)
- if (removed.length) { //如果用户删掉了元素
- args.push("del", start, removed.length, 0)
- change = true
- }
- if (m > 2) { //如果用户添加了元素
- if (change) {
- args.splice(3, 1, 0, "add", start, m - 2)
- } else {
- args.push("add", start, m - 2, 0)
- }
- change = true
- }
- if (change) { //返回被移除的元素
- return mutateArray.apply(this, args)
- } else {
- return []
- }
- },
- contains: function (el) { //判定是否包含
- return this.indexOf(el) !== -1
- },
- remove: function (el) { //移除第一个等于给定值的元素
- return this.removeAt(this.indexOf(el))
- },
- removeAt: function (index) { //移除指定索引上的元素
- if (index >= 0) {
- this.$model.splice(index, 1)
- return mutateArray.call(this, "del", index, 1, 0)
- }
- return []
- },
- clear: function () {
- this.$model.length = this.length = this._.length = 0 //清空数组
- this._fire("clear", 0)
- return this
- },
- removeAll: function (all) { //移除N个元素
- if (Array.isArray(all)) {
- for (var i = this.length - 1; i >= 0; i--) {
- if (all.indexOf(this[i]) !== -1) {
- this.removeAt(i)
- }
- }
- } else if (typeof all === "function") {
- for ( i = this.length - 1; i >= 0; i--) {
- var el = this[i]
- if (all(el, i)) {
- this.removeAt(i)
- }
- }
- } else {
- this.clear()
- }
- },
- ensure: function (el) {
- if (!this.contains(el)) { //只有不存在才push
- this.push(el)
- }
- return this
- },
- set: function (index, val) {
- if (index < this.length && index > -1) {
- var valueType = avalon.type(val)
- if (val && val.$model) {
- val = val.$model
- }
- var target = this[index]
- if (valueType === "object") {
- for (var i in val) {
- if (target.hasOwnProperty(i)) {
- target[i] = val[i]
- }
- }
- } else if (valueType === "array") {
- target.clear().push.apply(target, val)
- } else if (target !== val) {
- this[index] = val
- this.$model[index] = val
- this._fire("set", index, val)
- }
- }
- return this
- }
-}
-//相当于原来bindingExecutors.repeat 的index分支
-function resetIndex(array, pos) {
- var last = array.length - 1
- for (var el; el = array[pos]; pos++) {
- el.$index = pos
- el.$first = pos === 0
- el.$last = pos === last
- }
-}
-
-function sortByIndex(array, indexes) {
- var map = {};
- for (var i = 0, n = indexes.length; i < n; i++) {
- map[i] = array[i] // preserve
- var j = indexes[i]
- if (j in map) {
- array[i] = map[j]
- delete map[j]
- } else {
- array[i] = array[j]
- }
- }
-}
-
-"sort,reverse".replace(rword, function (method) {
- arrayPrototype[method] = function () {
- var newArray = this.$model//这是要排序的新数组
- var oldArray = newArray.concat() //保持原来状态的旧数组
- var mask = Math.random()
- var indexes = []
- var hasSort
- ap[method].apply(newArray, arguments) //排序
- for (var i = 0, n = oldArray.length; i < n; i++) {
- var neo = newArray[i]
- var old = oldArray[i]
- if (isEqual(neo, old)) {
- indexes.push(i)
- } else {
- var index = oldArray.indexOf(neo)
- indexes.push(index)//得到新数组的每个元素在旧数组对应的位置
- oldArray[index] = mask //屏蔽已经找过的元素
- hasSort = true
- }
- }
- if (hasSort) {
- sortByIndex(this, indexes)
- // sortByIndex(this.$proxy, indexes)
- this._fire("move", indexes)
- this._fire("index", 0)
- }
- return this
- }
-})
-
-
-/*********************************************************************
- * 依赖调度系统 *
- **********************************************************************/
-//检测两个对象间的依赖关系
-var dependencyDetection = (function () {
- var outerFrames = []
- var currentFrame
- return {
- begin: function (accessorObject) {
- //accessorObject为一个拥有callback的对象
- outerFrames.push(currentFrame)
- currentFrame = accessorObject
- },
- end: function () {
- currentFrame = outerFrames.pop()
- },
- collectDependency: function (vmodel, accessor) {
- if (currentFrame) {
- //被dependencyDetection.begin调用
- currentFrame.callback(vmodel, accessor);
- }
- }
- };
-})()
-//将绑定对象注入到其依赖项的订阅数组中
-var ronduplex = /^(duplex|on)$/
-avalon.injectBinding = function (data) {
- var valueFn = data.evaluator
- if (valueFn) { //如果是求值函数
- dependencyDetection.begin({
- callback: function (vmodel, dependency) {
- injectDependency(vmodel.$events[dependency._name], data)
- }
- })
- try {
- var value = ronduplex.test(data.type) ? data : valueFn.apply(0, data.args)
- if(value === void 0){
- delete data.evaluator
- }
- if (data.handler) {
- data.handler(value, data.element, data)
- }
- } catch (e) {
- log("warning:exception throwed in [avalon.injectBinding] " , e)
- delete data.evaluator
- var node = data.element
- if (node && node.nodeType === 3) {
- var parent = node.parentNode
- if (kernel.commentInterpolate) {
- parent.replaceChild(DOC.createComment(data.value), node)
- } else {
- node.data = openTag + (data.oneTime ? "::" : "") + data.value + closeTag
- }
- }
- } finally {
- dependencyDetection.end()
- }
- }
-}
-
-//将依赖项(比它高层的访问器或构建视图刷新函数的绑定对象)注入到订阅者数组
-function injectDependency(list, data) {
- if (data.oneTime)
- return
- if (list && avalon.Array.ensure(list, data) && data.element) {
- injectDisposeQueue(data, list)
- if (new Date() - beginTime > 444 ) {
- rejectDisposeQueue()
- }
- }
-}
-
-//通知依赖于这个访问器的订阅者更新自身
-function fireDependencies(list) {
- if (list && list.length) {
- if (new Date() - beginTime > 444 && typeof list[0] === "object") {
- rejectDisposeQueue()
- }
- var args = aslice.call(arguments, 1)
- for (var i = list.length, fn; fn = list[--i]; ) {
- var el = fn.element
- if (el && el.parentNode) {
- try {
- var valueFn = fn.evaluator
- if (fn.$repeat) {
- fn.handler.apply(fn, args) //处理监控数组的方法
- }else if("$repeat" in fn || !valueFn ){//如果没有eval,先eval
- bindingHandlers[fn.type](fn, fn.vmodels)
- } else if (fn.type !== "on") { //事件绑定只能由用户触发,不能由程序触发
- var value = valueFn.apply(0, fn.args || [])
- fn.handler(value, el, fn)
- }
- } catch (e) {
- console.log(e)
- }
- }
- }
- }
-}
-/*********************************************************************
- * 定时GC回收机制 *
- **********************************************************************/
-var disposeCount = 0
-var disposeQueue = avalon.$$subscribers = []
-var beginTime = new Date()
-var oldInfo = {}
-//var uuid2Node = {}
-function getUid(elem, makeID) { //IE9+,标准浏览器
- if (!elem.uuid && !makeID) {
- elem.uuid = ++disposeCount
- }
- return elem.uuid
-}
-
-//添加到回收列队中
-function injectDisposeQueue(data, list) {
- var elem = data.element
- if (!data.uuid) {
- if (elem.nodeType !== 1) {
- data.uuid = data.type + getUid(elem.parentNode)+ "-"+ (++disposeCount)
- } else {
- data.uuid = data.name + "-" + getUid(elem)
- }
- }
- var lists = data.lists || (data.lists = [])
- avalon.Array.ensure(lists, list)
- list.$uuid = list.$uuid || generateID()
- if (!disposeQueue[data.uuid]) {
- disposeQueue[data.uuid] = 1
- disposeQueue.push(data)
- }
-}
-
-function rejectDisposeQueue(data) {
- if (avalon.optimize)
- return
- var i = disposeQueue.length
- var n = i
- var allTypes = []
- var iffishTypes = {}
- var newInfo = {}
- //对页面上所有绑定对象进行分门别类, 只检测个数发生变化的类型
- while (data = disposeQueue[--i]) {
- var type = data.type
- if (newInfo[type]) {
- newInfo[type]++
- } else {
- newInfo[type] = 1
- allTypes.push(type)
- }
- }
- var diff = false
- allTypes.forEach(function (type) {
- if (oldInfo[type] !== newInfo[type]) {
- iffishTypes[type] = 1
- diff = true
- }
- })
- i = n
- if (diff) {
- while (data = disposeQueue[--i]) {
- if (data.element === null) {
- disposeQueue.splice(i, 1)
- continue
- }
- if (iffishTypes[data.type] && shouldDispose(data.element)) { //如果它没有在DOM树
- disposeQueue.splice(i, 1)
- delete disposeQueue[data.uuid]
- //delete uuid2Node[data.element.uuid]
- var lists = data.lists
- for (var k = 0, list; list = lists[k++]; ) {
- avalon.Array.remove(lists, list)
- avalon.Array.remove(list, data)
- }
- disposeData(data)
- }
- }
- }
- oldInfo = newInfo
- beginTime = new Date()
-}
-
-function disposeData(data) {
- delete disposeQueue[data.uuid] // 先清除,不然无法回收了
- data.element = null
- data.rollback && data.rollback()
- for (var key in data) {
- data[key] = null
- }
-}
-
-function shouldDispose(el) {
- try {//IE下,如果文本节点脱离DOM树,访问parentNode会报错
- var fireError = el.parentNode.nodeType
- } catch (e) {
- return true
- }
- if (el.ifRemove) {
- // 如果节点被放到ifGroup,才移除
- if (!root.contains(el.ifRemove) && (ifGroup === el.parentNode)) {
- el.parentNode && el.parentNode.removeChild(el)
- return true
- }
- }
- return el.msRetain ? 0 : (el.nodeType === 1 ? !root.contains(el) : !avalon.contains(root, el))
-}
-
-/************************************************************************
- * HTML处理(parseHTML, innerHTML, clearHTML) *
- ************************************************************************/
-// We have to close these tags to support XHTML
-var tagHooks = {
- area: [1, "<map>", "</map>"],
- param: [1, "<object>", "</object>"],
- col: [2, "<table><colgroup>", "</colgroup></table>"],
- legend: [1, "<fieldset>", "</fieldset>"],
- option: [1, "<select multiple='multiple'>", "</select>"],
- thead: [1, "<table>", "</table>"],
- tr: [2, "<table>", "</table>"],
- td: [3, "<table><tr>", "</tr></table>"],
- g: [1, '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1">', '</svg>'],
- //IE6-8在用innerHTML生成节点时,不能直接创建no-scope元素与HTML5的新标签
- _default: W3C ? [0, "", ""] : [1, "X<div>", "</div>"] //div可以不用闭合
-}
-tagHooks.th = tagHooks.td
-tagHooks.optgroup = tagHooks.option
-tagHooks.tbody = tagHooks.tfoot = tagHooks.colgroup = tagHooks.caption = tagHooks.thead
-String("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use").replace(rword, function (tag) {
- tagHooks[tag] = tagHooks.g //处理SVG
-})
-var rtagName = /<([\w:]+)/ //取得其tagName
-var rxhtml = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig
-var rcreate = W3C ? /[^\d\D]/ : /(<(?:script|link|style|meta|noscript))/ig
-var scriptTypes = oneObject(["", "text/javascript", "text/ecmascript", "application/ecmascript", "application/javascript"])
-var rnest = /<(?:tb|td|tf|th|tr|col|opt|leg|cap|area)/ //需要处理套嵌关系的标签
-var script = DOC.createElement("script")
-var rhtml = /<|&#?\w+;/
-avalon.parseHTML = function (html) {
- var fragment = avalonFragment.cloneNode(false)
- if (typeof html !== "string") {
- return fragment
- }
- if (!rhtml.test(html)) {
- fragment.appendChild(DOC.createTextNode(html))
- return fragment
- }
- html = html.replace(rxhtml, "<$1></$2>").trim()
- var tag = (rtagName.exec(html) || ["", ""])[1].toLowerCase(),
- //取得其标签名
- wrap = tagHooks[tag] || tagHooks._default,
- wrapper = cinerator,
- firstChild, neo
- if (!W3C) { //fix IE
- html = html.replace(rcreate, "<br class=msNoScope>$1") //在link style script等标签之前添加一个补丁
- }
- wrapper.innerHTML = wrap[1] + html + wrap[2]
- var els = wrapper.getElementsByTagName("script")
- if (els.length) { //使用innerHTML生成的script节点不会发出请求与执行text属性
- for (var i = 0, el; el = els[i++]; ) {
- if (scriptTypes[el.type]) {
- //以偷龙转凤方式恢复执行脚本功能
- neo = script.cloneNode(false) //FF不能省略参数
- ap.forEach.call(el.attributes, function (attr) {
- if (attr && attr.specified) {
- neo[attr.name] = attr.value //复制其属性
- neo.setAttribute(attr.name, attr.value)
- }
- }) // jshint ignore:line
- neo.text = el.text
- el.parentNode.replaceChild(neo, el) //替换节点
- }
- }
- }
- if (!W3C) { //fix IE
- var target = wrap[1] === "X<div>" ? wrapper.lastChild.firstChild : wrapper.lastChild
- if (target && target.tagName === "TABLE" && tag !== "tbody") {
- //IE6-7处理 <thead> --> <thead>,<tbody>
- //<tfoot> --> <tfoot>,<tbody>
- //<table> --> <table><tbody></table>
- for (els = target.childNodes, i = 0; el = els[i++]; ) {
- if (el.tagName === "TBODY" && !el.innerHTML) {
- target.removeChild(el)
- break
- }
- }
- }
- els = wrapper.getElementsByTagName("br")
- var n = els.length
- while (el = els[--n]) {
- if (el.className === "msNoScope") {
- el.parentNode.removeChild(el)
- }
- }
- for (els = wrapper.all, i = 0; el = els[i++]; ) { //fix VML
- if (isVML(el)) {
- fixVML(el)
- }
- }
- }
- //移除我们为了符合套嵌关系而添加的标签
- for (i = wrap[0]; i--; wrapper = wrapper.lastChild) {
- }
- while (firstChild = wrapper.firstChild) { // 将wrapper上的节点转移到文档碎片上!
- fragment.appendChild(firstChild)
- }
- return fragment
-}
-
-function isVML(src) {
- var nodeName = src.nodeName
- return nodeName.toLowerCase() === nodeName && src.scopeName && src.outerText === ""
-}
-
-function fixVML(node) {
- if (node.currentStyle.behavior !== "url(#default#VML)") {
- node.style.behavior = "url(#default#VML)"
- node.style.display = "inline-block"
- node.style.zoom = 1 //hasLayout
- }
-}
-avalon.innerHTML = function (node, html) {
- if (!W3C && (!rcreate.test(html) && !rnest.test(html))) {
- try {
- node.innerHTML = html
- return
- } catch (e) {
- }
- }
- var a = this.parseHTML(html)
- this.clearHTML(node).appendChild(a)
-}
-avalon.clearHTML = function (node) {
- node.textContent = ""
- while (node.firstChild) {
- node.removeChild(node.firstChild)
- }
- return node
-}
-
-/*********************************************************************
- * avalon的原型方法定义区 *
- **********************************************************************/
-
-function hyphen(target) {
- //转换为连字符线风格
- return target.replace(/([a-z\d])([A-Z]+)/g, "$1-$2").toLowerCase()
-}
-
-function camelize(target) {
- //提前判断,提高getStyle等的效率
- if (!target || target.indexOf("-") < 0 && target.indexOf("_") < 0) {
- return target
- }
- //转换为驼峰风格
- return target.replace(/[-_][^-_]/g, function(match) {
- return match.charAt(1).toUpperCase()
- })
-}
-
-var fakeClassListMethods = {
- _toString: function() {
- var node = this.node
- var cls = node.className
- var str = typeof cls === "string" ? cls : cls.baseVal
- return str.split(/\s+/).join(" ")
- },
- _contains: function(cls) {
- return (" " + this + " ").indexOf(" " + cls + " ") > -1
- },
- _add: function(cls) {
- if (!this.contains(cls)) {
- this._set(this + " " + cls)
- }
- },
- _remove: function(cls) {
- this._set((" " + this + " ").replace(" " + cls + " ", " "))
- },
- __set: function(cls) {
- cls = cls.trim()
- var node = this.node
- if (rsvg.test(node)) {
- //SVG元素的className是一个对象 SVGAnimatedString { baseVal="", animVal=""},只能通过set/getAttribute操作
- node.setAttribute("class", cls)
- } else {
- node.className = cls
- }
- } //toggle存在版本差异,因此不使用它
-}
-
- function fakeClassList(node) {
- if (!("classList" in node)) {
- node.classList = {
- node: node
- }
- for (var k in fakeClassListMethods) {
- node.classList[k.slice(1)] = fakeClassListMethods[k]
- }
- }
- return node.classList
- }
-
-
- "add,remove".replace(rword, function(method) {
- avalon.fn[method + "Class"] = function(cls) {
- var el = this[0]
- //https://developer.mozilla.org/zh-CN/docs/Mozilla/Firefox/Releases/26
- if (cls && typeof cls === "string" && el && el.nodeType === 1) {
- cls.replace(/\S+/g, function(c) {
- fakeClassList(el)[method](c)
- })
- }
- return this
- }
- })
- avalon.fn.mix({
- hasClass: function(cls) {
- var el = this[0] || {}
- return el.nodeType === 1 && fakeClassList(el).contains(cls)
- },
- toggleClass: function(value, stateVal) {
- var className, i = 0
- var classNames = String(value).split(/\s+/)
- var isBool = typeof stateVal === "boolean"
- while ((className = classNames[i++])) {
- var state = isBool ? stateVal : !this.hasClass(className)
- this[state ? "addClass" : "removeClass"](className)
- }
- return this
- },
- attr: function(name, value) {
- if (arguments.length === 2) {
- this[0].setAttribute(name, value)
- return this
- } else {
- return this[0].getAttribute(name)
- }
- },
- data: function(name, value) {
- name = "data-" + hyphen(name || "")
- switch (arguments.length) {
- case 2:
- this.attr(name, value)
- return this
- case 1:
- var val = this.attr(name)
- return parseData(val)
- case 0:
- var ret = {}
- ap.forEach.call(this[0].attributes, function(attr) {
- if (attr) {
- name = attr.name
- if (!name.indexOf("data-")) {
- name = camelize(name.slice(5))
- ret[name] = parseData(attr.value)
- }
- }
- })
- return ret
- }
- },
- removeData: function(name) {
- name = "data-" + hyphen(name)
- this[0].removeAttribute(name)
- return this
- },
- css: function(name, value) {
- if (avalon.isPlainObject(name)) {
- for (var i in name) {
- avalon.css(this, i, name[i])
- }
- } else {
- var ret = avalon.css(this, name, value)
- }
- return ret !== void 0 ? ret : this
- },
- position: function() {
- var offsetParent, offset,
- elem = this[0],
- parentOffset = {
- top: 0,
- left: 0
- }
- if (!elem) {
- return
- }
- if (this.css("position") === "fixed") {
- offset = elem.getBoundingClientRect()
- } else {
- offsetParent = this.offsetParent() //得到真正的offsetParent
- offset = this.offset() // 得到正确的offsetParent
- if (offsetParent[0].tagName !== "HTML") {
- parentOffset = offsetParent.offset()
- }
- parentOffset.top += avalon.css(offsetParent[0], "borderTopWidth", true)
- parentOffset.left += avalon.css(offsetParent[0], "borderLeftWidth", true)
-
- // Subtract offsetParent scroll positions
- parentOffset.top -= offsetParent.scrollTop()
- parentOffset.left -= offsetParent.scrollLeft()
- }
- return {
- top: offset.top - parentOffset.top - avalon.css(elem, "marginTop", true),
- left: offset.left - parentOffset.left - avalon.css(elem, "marginLeft", true)
- }
- },
- offsetParent: function() {
- var offsetParent = this[0].offsetParent
- while (offsetParent && avalon.css(offsetParent, "position") === "static") {
- offsetParent = offsetParent.offsetParent;
- }
- return avalon(offsetParent || root)
- },
- bind: function(type, fn, phase) {
- if (this[0]) { //此方法不会链
- return avalon.bind(this[0], type, fn, phase)
- }
- },
- unbind: function(type, fn, phase) {
- if (this[0]) {
- avalon.unbind(this[0], type, fn, phase)
- }
- return this
- },
- val: function(value) {
- var node = this[0]
- if (node && node.nodeType === 1) {
- var get = arguments.length === 0
- var access = get ? ":get" : ":set"
- var fn = valHooks[getValType(node) + access]
- if (fn) {
- var val = fn(node, value)
- } else if (get) {
- return (node.value || "").replace(/\r/g, "")
- } else {
- node.value = value
- }
- }
- return get ? val : this
- }
- })
-
- function parseData(data) {
- try {
- if (typeof data === "object")
- return data
- data = data === "true" ? true :
- data === "false" ? false :
- data === "null" ? null : +data + "" === data ? +data : rbrace.test(data) ? avalon.parseJSON(data) : data
- } catch (e) {}
- return data
- }
-var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
- rvalidchars = /^[\],:{}\s]*$/,
- rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
- rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
- rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g
-avalon.parseJSON = window.JSON ? JSON.parse : function(data) {
- if (typeof data === "string") {
- data = data.trim();
- if (data) {
- if (rvalidchars.test(data.replace(rvalidescape, "@")
- .replace(rvalidtokens, "]")
- .replace(rvalidbraces, ""))) {
- return (new Function("return " + data))() // jshint ignore:line
- }
- }
- avalon.error("Invalid JSON: " + data)
- }
- return data
-}
-
-//生成avalon.fn.scrollLeft, avalon.fn.scrollTop方法
-avalon.each({
- scrollLeft: "pageXOffset",
- scrollTop: "pageYOffset"
-}, function(method, prop) {
- avalon.fn[method] = function(val) {
- var node = this[0] || {}, win = getWindow(node),
- top = method === "scrollTop"
- if (!arguments.length) {
- return win ? (prop in win) ? win[prop] : root[method] : node[method]
- } else {
- if (win) {
- win.scrollTo(!top ? val : avalon(win).scrollLeft(), top ? val : avalon(win).scrollTop())
- } else {
- node[method] = val
- }
- }
- }
-})
-
-function getWindow(node) {
- return node.window && node.document ? node : node.nodeType === 9 ? node.defaultView || node.parentWindow : false;
-}
-//=============================css相关=======================
-var cssHooks = avalon.cssHooks = {}
-var prefixes = ["", "-webkit-", "-o-", "-moz-", "-ms-"]
-var cssMap = {
- "float": W3C ? "cssFloat" : "styleFloat"
-}
-avalon.cssNumber = oneObject("animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom")
-
-avalon.cssName = function(name, host, camelCase) {
- if (cssMap[name]) {
- return cssMap[name]
- }
- host = host || root.style
- for (var i = 0, n = prefixes.length; i < n; i++) {
- camelCase = camelize(prefixes[i] + name)
- if (camelCase in host) {
- return (cssMap[name] = camelCase)
- }
- }
- return null
-}
-cssHooks["@:set"] = function(node, name, value) {
- try { //node.style.width = NaN;node.style.width = "xxxxxxx";node.style.width = undefine 在旧式IE下会抛异常
- node.style[name] = value
- } catch (e) {}
-}
-if (window.getComputedStyle) {
- cssHooks["@:get"] = function(node, name) {
- if (!node || !node.style) {
- throw new Error("getComputedStyle要求传入一个节点 " + node)
- }
- var ret, styles = getComputedStyle(node, null)
- if (styles) {
- ret = name === "filter" ? styles.getPropertyValue(name) : styles[name]
- if (ret === "") {
- ret = node.style[name] //其他浏览器需要我们手动取内联样式
- }
- }
- return ret
- }
- cssHooks["opacity:get"] = function(node) {
- var ret = cssHooks["@:get"](node, "opacity")
- return ret === "" ? "1" : ret
- }
-} else {
- var rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i
- var rposition = /^(top|right|bottom|left)$/
- var ralpha = /alpha\([^)]*\)/i
- var ie8 = !! window.XDomainRequest
- var salpha = "DXImageTransform.Microsoft.Alpha"
- var border = {
- thin: ie8 ? '1px' : '2px',
- medium: ie8 ? '3px' : '4px',
- thick: ie8 ? '5px' : '6px'
- }
- cssHooks["@:get"] = function(node, name) {
- //取得精确值,不过它有可能是带em,pc,mm,pt,%等单位
- var currentStyle = node.currentStyle
- var ret = currentStyle[name]
- if ((rnumnonpx.test(ret) && !rposition.test(ret))) {
- //①,保存原有的style.left, runtimeStyle.left,
- var style = node.style,
- left = style.left,
- rsLeft = node.runtimeStyle.left
- //②由于③处的style.left = xxx会影响到currentStyle.left,
- //因此把它currentStyle.left放到runtimeStyle.left,
- //runtimeStyle.left拥有最高优先级,不会style.left影响
- node.runtimeStyle.left = currentStyle.left
- //③将精确值赋给到style.left,然后通过IE的另一个私有属性 style.pixelLeft
- //得到单位为px的结果;fontSize的分支见http://bugs.jquery.com/ticket/760
- style.left = name === 'fontSize' ? '1em' : (ret || 0)
- ret = style.pixelLeft + "px"
- //④还原 style.left,runtimeStyle.left
- style.left = left
- node.runtimeStyle.left = rsLeft
- }
- if (ret === "medium") {
- name = name.replace("Width", "Style")
- //border width 默认值为medium,即使其为0"
- if (currentStyle[name] === "none") {
- ret = "0px"
- }
- }
- return ret === "" ? "auto" : border[ret] || ret
- }
- cssHooks["opacity:set"] = function(node, name, value) {
- var style = node.style
- var opacity = isFinite(value) && value <= 1 ? "alpha(opacity=" + value * 100 + ")" : ""
- var filter = style.filter || "";
- style.zoom = 1
- //不能使用以下方式设置透明度
- //node.filters.alpha.opacity = value * 100
- style.filter = (ralpha.test(filter) ?
- filter.replace(ralpha, opacity) :
- filter + " " + opacity).trim()
- if (!style.filter) {
- style.removeAttribute("filter")
- }
- }
- cssHooks["opacity:get"] = function(node) {
- //这是最快的获取IE透明值的方式,不需要动用正则了!
- var alpha = node.filters.alpha || node.filters[salpha],
- op = alpha && alpha.enabled ? alpha.opacity : 100
- return (op / 100) + "" //确保返回的是字符串
- }
-}
-
-"top,left".replace(rword, function(name) {
- cssHooks[name + ":get"] = function(node) {
- var computed = cssHooks["@:get"](node, name)
- return /px$/.test(computed) ? computed :
- avalon(node).position()[name] + "px"
- }
-})
-
-var cssShow = {
- position: "absolute",
- visibility: "hidden",
- display: "block"
-}
-
-var rdisplayswap = /^(none|table(?!-c[ea]).+)/
-
- function showHidden(node, array) {
- //http://www.cnblogs.com/rubylouvre/archive/2012/10/27/2742529.html
- if (node.offsetWidth <= 0) { //opera.offsetWidth可能小于0
- if (rdisplayswap.test(cssHooks["@:get"](node, "display"))) {
- var obj = {
- node: node
- }
- for (var name in cssShow) {
- obj[name] = node.style[name]
- node.style[name] = cssShow[name]
- }
- array.push(obj)
- }
- var parent = node.parentNode
- if (parent && parent.nodeType === 1) {
- showHidden(parent, array)
- }
- }
- }
- "Width,Height".replace(rword, function(name) { //fix 481
- var method = name.toLowerCase(),
- clientProp = "client" + name,
- scrollProp = "scroll" + name,
- offsetProp = "offset" + name
- cssHooks[method + ":get"] = function(node, which, override) {
- var boxSizing = -4
- if (typeof override === "number") {
- boxSizing = override
- }
- which = name === "Width" ? ["Left", "Right"] : ["Top", "Bottom"]
- var ret = node[offsetProp] // border-box 0
- if (boxSizing === 2) { // margin-box 2
- return ret + avalon.css(node, "margin" + which[0], true) + avalon.css(node, "margin" + which[1], true)
- }
- if (boxSizing < 0) { // padding-box -2
- ret = ret - avalon.css(node, "border" + which[0] + "Width", true) - avalon.css(node, "border" + which[1] + "Width", true)
- }
- if (boxSizing === -4) { // content-box -4
- ret = ret - avalon.css(node, "padding" + which[0], true) - avalon.css(node, "padding" + which[1], true)
- }
- return ret
- }
- cssHooks[method + "&get"] = function(node) {
- var hidden = [];
- showHidden(node, hidden);
- var val = cssHooks[method + ":get"](node)
- for (var i = 0, obj; obj = hidden[i++];) {
- node = obj.node
- for (var n in obj) {
- if (typeof obj[n] === "string") {
- node.style[n] = obj[n]
- }
- }
- }
- return val;
- }
- avalon.fn[method] = function(value) { //会忽视其display
- var node = this[0]
- if (arguments.length === 0) {
- if (node.setTimeout) { //取得窗口尺寸,IE9后可以用node.innerWidth /innerHeight代替
- return node["inner" + name] || node.document.documentElement[clientProp] ||
- node.document.body[clientProp]//IE6下前两个分别为undefine,0
- }
- if (node.nodeType === 9) { //取得页面尺寸
- var doc = node.documentElement
- //FF chrome html.scrollHeight< body.scrollHeight
- //IE 标准模式 : html.scrollHeight> body.scrollHeight
- //IE 怪异模式 : html.scrollHeight 最大等于可视窗口多一点?
- return Math.max(node.body[scrollProp], doc[scrollProp], node.body[offsetProp], doc[offsetProp], doc[clientProp])
- }
- return cssHooks[method + "&get"](node)
- } else {
- return this.css(method, value)
- }
- }
- avalon.fn["inner" + name] = function() {
- return cssHooks[method + ":get"](this[0], void 0, -2)
- }
- avalon.fn["outer" + name] = function(includeMargin) {
- return cssHooks[method + ":get"](this[0], void 0, includeMargin === true ? 2 : 0)
- }
- })
- avalon.fn.offset = function() { //取得距离页面左右角的坐标
- var node = this[0],
- box = {
- left: 0,
- top: 0
- }
- if (!node || !node.tagName || !node.ownerDocument) {
- return box
- }
- var doc = node.ownerDocument,
- body = doc.body,
- root = doc.documentElement,
- win = doc.defaultView || doc.parentWindow
- if (!avalon.contains(root, node)) {
- return box
- }
- //http://hkom.blog1.fc2.com/?mode=m&no=750 body的偏移量是不包含margin的
- //我们可以通过getBoundingClientRect来获得元素相对于client的rect.
- //http://msdn.microsoft.com/en-us/library/ms536433.aspx
- if (node.getBoundingClientRect) {
- box = node.getBoundingClientRect() // BlackBerry 5, iOS 3 (original iPhone)
- }
- //chrome/IE6: body.scrollTop, firefox/other: root.scrollTop
- var clientTop = root.clientTop || body.clientTop,
- clientLeft = root.clientLeft || body.clientLeft,
- scrollTop = Math.max(win.pageYOffset || 0, root.scrollTop, body.scrollTop),
- scrollLeft = Math.max(win.pageXOffset || 0, root.scrollLeft, body.scrollLeft)
- // 把滚动距离加到left,top中去。
- // IE一些版本中会自动为HTML元素加上2px的border,我们需要去掉它
- // http://msdn.microsoft.com/en-us/library/ms533564(VS.85).aspx
- return {
- top: box.top + scrollTop - clientTop,
- left: box.left + scrollLeft - clientLeft
- }
- }
-
- //==================================val相关============================
-
- function getValType(elem) {
- var ret = elem.tagName.toLowerCase()
- return ret === "input" && /checkbox|radio/.test(elem.type) ? "checked" : ret
- }
-var roption = /^<option(?:\s+\w+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s+value[\s=]/i
-var valHooks = {
- "option:get": IEVersion ? function(node) {
- //在IE11及W3C,如果没有指定value,那么node.value默认为node.text(存在trim作),但IE9-10则是取innerHTML(没trim操作)
- //specified并不可靠,因此通过分析outerHTML判定用户有没有显示定义value
- return roption.test(node.outerHTML) ? node.value : node.text.trim()
- } : function(node) {
- return node.value
- },
- "select:get": function(node, value) {
- var option, options = node.options,
- index = node.selectedIndex,
- getter = valHooks["option:get"],
- one = node.type === "select-one" || index < 0,
- values = one ? null : [],
- max = one ? index + 1 : options.length,
- i = index < 0 ? max : one ? index : 0
- for (; i < max; i++) {
- option = options[i]
- //旧式IE在reset后不会改变selected,需要改用i === index判定
- //我们过滤所有disabled的option元素,但在safari5下,如果设置select为disable,那么其所有孩子都disable
- //因此当一个元素为disable,需要检测其是否显式设置了disable及其父节点的disable情况
- if ((option.selected || i === index) && !option.disabled) {
- value = getter(option)
- if (one) {
- return value
- }
- //收集所有selected值组成数组返回
- values.push(value)
- }
- }
- return values
- },
- "select:set": function(node, values, optionSet) {
- values = [].concat(values) //强制转换为数组
- var getter = valHooks["option:get"]
- for (var i = 0, el; el = node.options[i++];) {
- if ((el.selected = values.indexOf(getter(el)) > -1)) {
- optionSet = true
- }
- }
- if (!optionSet) {
- node.selectedIndex = -1
- }
- }
-}
-
-/*********************************************************************
- * 编译系统 *
- **********************************************************************/
-var meta = {
- '\b': '\\b',
- '\t': '\\t',
- '\n': '\\n',
- '\f': '\\f',
- '\r': '\\r',
- '"': '\\"',
- '\\': '\\\\'
-}
-var quote = window.JSON && JSON.stringify || function(str) {
- return '"' + str.replace(/[\\\"\x00-\x1f]/g, function(a) {
- var c = meta[a];
- return typeof c === 'string' ? c :
- '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
- }) + '"'
-}
-
-var keywords = [
- "break,case,catch,continue,debugger,default,delete,do,else,false",
- "finally,for,function,if,in,instanceof,new,null,return,switch,this",
- "throw,true,try,typeof,var,void,while,with", /* 关键字*/
- "abstract,boolean,byte,char,class,const,double,enum,export,extends",
- "final,float,goto,implements,import,int,interface,long,native",
- "package,private,protected,public,short,static,super,synchronized",
- "throws,transient,volatile", /*保留字*/
- "arguments,let,yield,undefined" /* ECMA 5 - use strict*/].join(",")
-var rrexpstr = /\/\*[\w\W]*?\*\/|\/\/[^\n]*\n|\/\/[^\n]*$|"(?:[^"\\]|\\[\w\W])*"|'(?:[^'\\]|\\[\w\W])*'|[\s\t\n]*\.[\s\t\n]*[$\w\.]+/g
-var rsplit = /[^\w$]+/g
-var rkeywords = new RegExp(["\\b" + keywords.replace(/,/g, '\\b|\\b') + "\\b"].join('|'), 'g')
-var rnumber = /\b\d[^,]*/g
-var rcomma = /^,+|,+$/g
-var variablePool = new Cache(512)
-var getVariables = function (code) {
- var key = "," + code.trim()
- var ret = variablePool.get(key)
- if (ret) {
- return ret
- }
- var match = code
- .replace(rrexpstr, "")
- .replace(rsplit, ",")
- .replace(rkeywords, "")
- .replace(rnumber, "")
- .replace(rcomma, "")
- .split(/^$|,+/)
- return variablePool.put(key, uniqSet(match))
-}
-/*添加赋值语句*/
-
-function addAssign(vars, scope, name, data) {
- var ret = [],
- prefix = " = " + name + "."
- for (var i = vars.length, prop; prop = vars[--i]; ) {
- if (scope.hasOwnProperty(prop)) {
- ret.push(prop + prefix + prop)
- data.vars.push(prop)
- if (data.type === "duplex") {
- vars.get = name + "." + prop
- }
- vars.splice(i, 1)
- }
- }
- return ret
-}
-
-function uniqSet(array) {
- var ret = [],
- unique = {}
- for (var i = 0; i < array.length; i++) {
- var el = array[i]
- var id = el && typeof el.$id === "string" ? el.$id : el
- if (!unique[id]) {
- unique[id] = ret.push(el)
- }
- }
- return ret
-}
-//缓存求值函数,以便多次利用
-var evaluatorPool = new Cache(128)
-//取得求值函数及其传参
-var rduplex = /\w\[.*\]|\w\.\w/
-var rproxy = /(\$proxy\$[a-z]+)\d+$/
-var rthimRightParentheses = /\)\s*$/
-var rthimOtherParentheses = /\)\s*\|/g
-var rquoteFilterName = /\|\s*([$\w]+)/g
-var rpatchBracket = /"\s*\["/g
-var rthimLeftParentheses = /"\s*\(/g
-function parseFilter(val, filters) {
- filters = filters
- .replace(rthimRightParentheses, "")//处理最后的小括号
- .replace(rthimOtherParentheses, function () {//处理其他小括号
- return "],|"
- })
- .replace(rquoteFilterName, function (a, b) { //处理|及它后面的过滤器的名字
- return "[" + quote(b)
- })
- .replace(rpatchBracket, function () {
- return '"],["'
- })
- .replace(rthimLeftParentheses, function () {
- return '",'
- }) + "]"
- return "return this.filters.$filter(" + val + ", " + filters + ")"
-}
-
-function parseExpr(code, scopes, data) {
- var dataType = data.type
- var filters = data.filters || ""
- var exprId = scopes.map(function (el) {
- return String(el.$id).replace(rproxy, "$1")
- }) + code + dataType + filters
- var vars = getVariables(code).concat(),
- assigns = [],
- names = [],
- args = [],
- prefix = ""
- //args 是一个对象数组, names 是将要生成的求值函数的参数
- scopes = uniqSet(scopes)
- data.vars = []
- for (var i = 0, sn = scopes.length; i < sn; i++) {
- if (vars.length) {
- var name = "vm" + expose + "_" + i
- names.push(name)
- args.push(scopes[i])
- assigns.push.apply(assigns, addAssign(vars, scopes[i], name, data))
- }
- }
- if (!assigns.length && dataType === "duplex") {
- return
- }
- if (dataType !== "duplex" && (code.indexOf("||") > -1 || code.indexOf("&&") > -1)) {
- //https://github.com/RubyLouvre/avalon/issues/583
- data.vars.forEach(function (v) {
- var reg = new RegExp("\\b" + v + "(?:\\.\\w+|\\[\\w+\\])+", "ig")
- code = code.replace(reg, function (_, cap) {
- var c = _.charAt(v.length)
- //var r = IEVersion ? code.slice(arguments[1] + _.length) : RegExp.rightContext
- //https://github.com/RubyLouvre/avalon/issues/966
- var r = code.slice(cap + _.length)
- var method = /^\s*\(/.test(r)
- if (c === "." || c === "[" || method) {//比如v为aa,我们只匹配aa.bb,aa[cc],不匹配aaa.xxx
- var name = "var" + String(Math.random()).replace(/^0\./, "")
- if (method) {//array.size()
- var array = _.split(".")
- if (array.length > 2) {
- var last = array.pop()
- assigns.push(name + " = " + array.join("."))
- return name + "." + last
- } else {
- return _
- }
- }
- assigns.push(name + " = " + _)
- return name
- } else {
- return _
- }
- })
- })
- }
- //---------------args----------------
- data.args = args
- //---------------cache----------------
- delete data.vars
- var fn = evaluatorPool.get(exprId) //直接从缓存,免得重复生成
- if (fn) {
- data.evaluator = fn
- return
- }
- prefix = assigns.join(", ")
- if (prefix) {
- prefix = "var " + prefix
- }
- if (/\S/.test(filters)) { //文本绑定,双工绑定才有过滤器
- if (!/text|html/.test(data.type)) {
- throw Error("ms-" + data.type + "不支持过滤器")
- }
- code = "\nvar ret" + expose + " = " + code + ";\r\n"
- code += parseFilter("ret" + expose, filters)
- try {
- fn = Function.apply(noop, names.concat("'use strict';\n" + prefix + code))
- data.evaluator = evaluatorPool.put(exprId, function() {
- return fn.apply(avalon, arguments)//确保可以在编译代码中使用this获取avalon对象
- })
- } catch (e) {
- log("debug: parse error," + e.message)
- }
- vars = assigns = names = null //释放内存
- return
- } else if (dataType === "duplex") { //双工绑定
- var _body = "'use strict';\nreturn function(vvv){\n\t" +
- prefix +
- ";\n\tif(!arguments.length){\n\t\treturn " +
- code +
- "\n\t}\n\t" + (!rduplex.test(code) ? vars.get : code) +
- "= vvv;\n} "
- try {
- fn = Function.apply(noop, names.concat(_body))
- data.evaluator = evaluatorPool.put(exprId, fn)
- } catch (e) {
- log("debug: parse error," + e.message)
- }
- vars = assigns = names = null //释放内存
- return
- } else if (dataType === "on") { //事件绑定
- if (code.indexOf("(") === -1) {
- code += ".call(this, $event)"
- } else {
- code = code.replace("(", ".call(this,")
- }
- names.push("$event")
- code = "\nreturn " + code + ";" //IE全家 Function("return ")出错,需要Function("return ;")
- var lastIndex = code.lastIndexOf("\nreturn")
- var header = code.slice(0, lastIndex)
- var footer = code.slice(lastIndex)
- code = header + "\n" + footer
- } else { //其他绑定
- code = "\nreturn " + code + ";" //IE全家 Function("return ")出错,需要Function("return ;")
- }
- try {
- fn = Function.apply(noop, names.concat("'use strict';\n" + prefix + code))
- data.evaluator = evaluatorPool.put(exprId, fn)
- } catch (e) {
- log("debug: parse error," + e.message)
- }
- vars = assigns = names = null //释放内存
-}
-function stringifyExpr(code) {
- var hasExpr = rexpr.test(code) //比如ms-class="width{{w}}"的情况
- if (hasExpr) {
- var array = scanExpr(code)
- if (array.length === 1) {
- return array[0].value
- }
- return array.map(function (el) {
- return el.expr ? "(" + el.value + ")" : quote(el.value)
- }).join(" + ")
- } else {
- return code
- }
-}
-//parseExpr的智能引用代理
-
-function parseExprProxy(code, scopes, data, noRegister) {
- code = code || "" //code 可能未定义
- parseExpr(code, scopes, data)
- if (data.evaluator && !noRegister) {
- data.handler = bindingExecutors[data.handlerName || data.type]
- //方便调试
- //这里非常重要,我们通过判定视图刷新函数的element是否在DOM树决定
- //将它移出订阅者列表
- avalon.injectBinding(data)
- }
-}
-avalon.parseExprProxy = parseExprProxy
-/*********************************************************************
- * 扫描系统 *
- **********************************************************************/
-
-avalon.scan = function(elem, vmodel) {
- elem = elem || root
- var vmodels = vmodel ? [].concat(vmodel) : []
- scanTag(elem, vmodels)
-}
-
-//http://www.w3.org/TR/html5/syntax.html#void-elements
-var stopScan = oneObject("area,base,basefont,br,col,command,embed,hr,img,input,link,meta,param,source,track,wbr,noscript,script,style,textarea".toUpperCase())
-
-function checkScan(elem, callback, innerHTML) {
- var id = setTimeout(function() {
- var currHTML = elem.innerHTML
- clearTimeout(id)
- if (currHTML === innerHTML) {
- callback()
- } else {
- checkScan(elem, callback, currHTML)
- }
- })
-}
-
-
-function createSignalTower(elem, vmodel) {
- var id = elem.getAttribute("avalonctrl") || vmodel.$id
- elem.setAttribute("avalonctrl", id)
- vmodel.$events.expr = elem.tagName + '[avalonctrl="' + id + '"]'
-}
-
-var getBindingCallback = function(elem, name, vmodels) {
- var callback = elem.getAttribute(name)
- if (callback) {
- for (var i = 0, vm; vm = vmodels[i++]; ) {
- if (vm.hasOwnProperty(callback) && typeof vm[callback] === "function") {
- return vm[callback]
- }
- }
- }
-}
-
-function executeBindings(bindings, vmodels) {
- for (var i = 0, data; data = bindings[i++]; ) {
- data.vmodels = vmodels
- bindingHandlers[data.type](data, vmodels)
- if (data.evaluator && data.element && data.element.nodeType === 1) { //移除数据绑定,防止被二次解析
- //chrome使用removeAttributeNode移除不存在的特性节点时会报错 https://github.com/RubyLouvre/avalon/issues/99
- data.element.removeAttribute(data.name)
- }
- }
- bindings.length = 0
-}
-
-//https://github.com/RubyLouvre/avalon/issues/636
-var mergeTextNodes = IEVersion && window.MutationObserver ? function (elem) {
- var node = elem.firstChild, text
- while (node) {
- var aaa = node.nextSibling
- if (node.nodeType === 3) {
- if (text) {
- text.nodeValue += node.nodeValue
- elem.removeChild(node)
- } else {
- text = node
- }
- } else {
- text = null
- }
- node = aaa
- }
-} : 0
-var roneTime = /^\s*::/
-var rmsAttr = /ms-(\w+)-?(.*)/
-var priorityMap = {
- "if": 10,
- "repeat": 90,
- "data": 100,
- "widget": 110,
- "each": 1400,
- "with": 1500,
- "duplex": 2000,
- "on": 3000
-}
-
-var events = oneObject("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit")
-var obsoleteAttrs = oneObject("value,title,alt,checked,selected,disabled,readonly,enabled")
-function bindingSorter(a, b) {
- return a.priority - b.priority
-}
-
-function scanAttr(elem, vmodels, match) {
- var scanNode = true
- if (vmodels.length) {
- var attributes = getAttributes ? getAttributes(elem) : elem.attributes
- var bindings = []
- var fixAttrs = []
- var msData = {}
- var uniq = {}
- for (var i = 0, attr; attr = attributes[i++]; ) {
- if (attr.specified) {
- if (match = attr.name.match(rmsAttr)) {
- //如果是以指定前缀命名的
- var type = match[1]
- var param = match[2] || ""
- var value = attr.value
- var name = attr.name
- if (uniq[name]) {//IE8下ms-repeat,ms-with BUG
- continue
- }
- uniq[name] = 1
- if (events[type]) {
- param = type
- type = "on"
- } else if (obsoleteAttrs[type]) {
- if (type === "enabled") {//吃掉ms-enabled绑定,用ms-disabled代替
- log("warning!ms-enabled或ms-attr-enabled已经被废弃")
- type = "disabled"
- value = "!(" + value + ")"
- }
- param = type
- type = "attr"
- name = "ms-" + type + "-" + param
- fixAttrs.push([attr.name, name, value])
- }
- msData[name] = value
- if (typeof bindingHandlers[type] === "function") {
- var newValue = value.replace(roneTime, "")
- var oneTime = value !== newValue
- var binding = {
- type: type,
- param: param,
- element: elem,
- name: name,
- value: newValue,
- oneTime: oneTime,
- uuid: name + "-" + getUid(elem),
- //chrome与firefox下Number(param)得到的值不一样 #855
- priority: (priorityMap[type] || type.charCodeAt(0) * 10) + (Number(param.replace(/\D/g, "")) || 0)
- }
- if (type === "html" || type === "text") {
- var token = getToken(value)
- avalon.mix(binding, token)
- binding.filters = binding.filters.replace(rhasHtml, function () {
- binding.type = "html"
- binding.group = 1
- return ""
- })// jshint ignore:line
- } else if (type === "duplex") {
- var hasDuplex = name
- } else if (name === "ms-if-loop") {
- binding.priority += 100
- }
- bindings.push(binding)
- if (type === "widget") {
- elem.msData = elem.msData || msData
- }
- }
- }
- }
- }
- if (bindings.length) {
- bindings.sort(bindingSorter)
- fixAttrs.forEach(function (arr) {
- log("warning!请改用" + arr[1] + "代替" + arr[0] + "!")
- elem.removeAttribute(arr[0])
- elem.setAttribute(arr[1], arr[2])
- })
- //http://bugs.jquery.com/ticket/7071
- //在IE下对VML读取type属性,会让此元素所有属性都变成<Failed>
- if (hasDuplex && msData["ms-attr-value"] && !elem.scopeName && elem.type === "text") {
- log("warning!一个控件不能同时定义ms-attr-value与" + hasDuplex)
- }
- for (i = 0; binding = bindings[i]; i++) {
- type = binding.type
- if (rnoscanAttrBinding.test(type)) {
- return executeBindings(bindings.slice(0, i + 1), vmodels)
- } else if (scanNode) {
- scanNode = !rnoscanNodeBinding.test(type)
- }
- }
- executeBindings(bindings, vmodels)
- }
- }
- if (scanNode && !stopScan[elem.tagName] && rbind.test(elem.innerHTML.replace(rlt, "<").replace(rgt, ">"))) {
- mergeTextNodes && mergeTextNodes(elem)
- scanNodeList(elem, vmodels) //扫描子孙元素
- }
-}
-var rnoscanAttrBinding = /^if|widget|repeat$/
-var rnoscanNodeBinding = /^each|with|html|include$/
-//IE67下,在循环绑定中,一个节点如果是通过cloneNode得到,自定义属性的specified为false,无法进入里面的分支,
-//但如果我们去掉scanAttr中的attr.specified检测,一个元素会有80+个特性节点(因为它不区分固有属性与自定义属性),很容易卡死页面
-if (!W3C) {
- var attrPool = new Cache(512)
- var rattrs = /\s+(ms-[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,
- rquote = /^['"]/,
- rtag = /<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/i,
- ramp = /&amp;/g
- //IE6-8解析HTML5新标签,会将它分解两个元素节点与一个文本节点
- //<body><section>ddd</section></body>
- // window.onload = function() {
- // var body = document.body
- // for (var i = 0, el; el = body.children[i++]; ) {
- // avalon.log(el.outerHTML)
- // }
- // }
- //依次输出<SECTION>, </SECTION>
- var getAttributes = function (elem) {
- var html = elem.outerHTML
- //处理IE6-8解析HTML5新标签的情况,及<br>等半闭合标签outerHTML为空的情况
- if (html.slice(0, 2) === "</" || !html.trim()) {
- return []
- }
- var str = html.match(rtag)[0]
- var attributes = [],
- match,
- k, v
- var ret = attrPool.get(str)
- if (ret) {
- return ret
- }
- while (k = rattrs.exec(str)) {
- v = k[2]
- if (v) {
- v = (rquote.test(v) ? v.slice(1, -1) : v).replace(ramp, "&")
- }
- var name = k[1].toLowerCase()
- match = name.match(rmsAttr)
- var binding = {
- name: name,
- specified: true,
- value: v || ""
- }
- attributes.push(binding)
- }
- return attrPool.put(str, attributes)
- }
-}
-
-function scanNodeList(parent, vmodels) {
- var nodes = avalon.slice(parent.childNodes)
- scanNodeArray(nodes, vmodels)
-}
-
-function scanNodeArray(nodes, vmodels) {
- for (var i = 0, node; node = nodes[i++];) {
- switch (node.nodeType) {
- case 1:
- scanTag(node, vmodels) //扫描元素节点
- if (node.msCallback) {
- node.msCallback()
- node.msCallback = void 0
- }
- break
- case 3:
- if(rexpr.test(node.nodeValue)){
- scanText(node, vmodels, i) //扫描文本节点
- }
- break
- }
- }
-}
-
-
-function scanTag(elem, vmodels, node) {
- //扫描顺序 ms-skip(0) --> ms-important(1) --> ms-controller(2) --> ms-if(10) --> ms-repeat(100)
- //--> ms-if-loop(110) --> ms-attr(970) ...--> ms-each(1400)-->ms-with(1500)--〉ms-duplex(2000)垫后
- var a = elem.getAttribute("ms-skip")
- //#360 在旧式IE中 Object标签在引入Flash等资源时,可能出现没有getAttributeNode,innerHTML的情形
- if (!elem.getAttributeNode) {
- return log("warning " + elem.tagName + " no getAttributeNode method")
- }
- var b = elem.getAttributeNode("ms-important")
- var c = elem.getAttributeNode("ms-controller")
- if (typeof a === "string") {
- return
- } else if (node = b || c) {
- var newVmodel = avalon.vmodels[node.value]
- if (!newVmodel) {
- return
- }
- //ms-important不包含父VM,ms-controller相反
- vmodels = node === b ? [newVmodel] : [newVmodel].concat(vmodels)
- var name = node.name
- elem.removeAttribute(name) //removeAttributeNode不会刷新[ms-controller]样式规则
- avalon(elem).removeClass(name)
- createSignalTower(elem, newVmodel)
- }
- scanAttr(elem, vmodels) //扫描特性节点
-}
-var rhasHtml = /\|\s*html(?:\b|$)/,
- r11a = /\|\|/g,
- rlt = /&lt;/g,
- rgt = /&gt;/g,
- rstringLiteral = /(['"])(\\\1|.)+?\1/g
-function getToken(value) {
- if (value.indexOf("|") > 0) {
- var scapegoat = value.replace(rstringLiteral, function (_) {
- return Array(_.length + 1).join("1")// jshint ignore:line
- })
- var index = scapegoat.replace(r11a, "\u1122\u3344").indexOf("|") //干掉所有短路或
- if (index > -1) {
- return {
- filters: value.slice(index),
- value: value.slice(0, index),
- expr: true
- }
- }
- }
- return {
- value: value,
- filters: "",
- expr: true
- }
-}
-
-function scanExpr(str) {
- var tokens = [],
- value, start = 0,
- stop
- do {
- stop = str.indexOf(openTag, start)
- if (stop === -1) {
- break
- }
- value = str.slice(start, stop)
- if (value) { // {{ 左边的文本
- tokens.push({
- value: value,
- filters: "",
- expr: false
- })
- }
- start = stop + openTag.length
- stop = str.indexOf(closeTag, start)
- if (stop === -1) {
- break
- }
- value = str.slice(start, stop)
- if (value) { //处理{{ }}插值表达式
- tokens.push(getToken(value))
- }
- start = stop + closeTag.length
- } while (1)
- value = str.slice(start)
- if (value) { //}} 右边的文本
- tokens.push({
- value: value,
- expr: false,
- filters: ""
- })
- }
- return tokens
-}
-
-function scanText(textNode, vmodels) {
- var bindings = [], tokens = scanExpr(textNode.data)
- if (tokens.length) {
- for (var i = 0, token; token = tokens[i++]; ) {
- var node = DOC.createTextNode(token.value) //将文本转换为文本节点,并替换原来的文本节点
- if (token.expr) {
- token.value = token.value.replace(roneTime, function () {
- token.oneTime = true
- return ""
- })// jshint ignore:line
- token.type = "text"
- token.element = node
- token.filters = token.filters.replace(rhasHtml, function (a, b,c) {
- token.type = "html"
- return ""
- })// jshint ignore:line
- bindings.push(token) //收集带有插值表达式的文本
- }
- avalonFragment.appendChild(node)
- }
- textNode.parentNode.replaceChild(avalonFragment, textNode)
- if (bindings.length)
- executeBindings(bindings, vmodels)
- }
-}
-
-var bools = ["autofocus,autoplay,async,allowTransparency,checked,controls",
- "declare,disabled,defer,defaultChecked,defaultSelected",
- "contentEditable,isMap,loop,multiple,noHref,noResize,noShade",
- "open,readOnly,selected"
-].join(",")
-var boolMap = {}
-bools.replace(rword, function (name) {
- boolMap[name.toLowerCase()] = name
-})
-
-var propMap = {//属性名映射
- "accept-charset": "acceptCharset",
- "char": "ch",
- "charoff": "chOff",
- "class": "className",
- "for": "htmlFor",
- "http-equiv": "httpEquiv"
-}
-
-var anomaly = ["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan",
- "dateTime,defaultValue,frameBorder,longDesc,maxLength,marginWidth,marginHeight",
- "rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"
-].join(",")
-anomaly.replace(rword, function (name) {
- propMap[name.toLowerCase()] = name
-})
-
-var rnoscripts = /<noscript.*?>(?:[\s\S]+?)<\/noscript>/img
-var rnoscriptText = /<noscript.*?>([\s\S]+?)<\/noscript>/im
-
-var getXHR = function () {
- return new (window.XMLHttpRequest || ActiveXObject)("Microsoft.XMLHTTP") // jshint ignore:line
-}
-
-var templatePool = avalon.templateCache = {}
-
-bindingHandlers.attr = function (data, vmodels) {
- var value = stringifyExpr(data.value.trim())
- if (data.type === "include") {
- var elem = data.element
- data.includeRendered = getBindingCallback(elem, "data-include-rendered", vmodels)
- data.includeLoaded = getBindingCallback(elem, "data-include-loaded", vmodels)
- var outer = data.includeReplace = !!avalon(elem).data("includeReplace")
- if (avalon(elem).data("includeCache")) {
- data.templateCache = {}
- }
- data.startInclude = DOC.createComment("ms-include")
- data.endInclude = DOC.createComment("ms-include-end")
- if (outer) {
- data.element = data.startInclude
- elem.parentNode.insertBefore(data.startInclude, elem)
- elem.parentNode.insertBefore(data.endInclude, elem.nextSibling)
- } else {
- elem.insertBefore(data.startInclude, elem.firstChild)
- elem.appendChild(data.endInclude)
- }
- }
- data.handlerName = "attr" //handleName用于处理多种绑定共用同一种bindingExecutor的情况
- parseExprProxy(value, vmodels, data)
-}
-
-bindingExecutors.attr = function (val, elem, data) {
- var method = data.type,
- attrName = data.param
- if (method === "css") {
- avalon(elem).css(attrName, val)
- } else if (method === "attr") {
-
- // ms-attr-class="xxx" vm.xxx="aaa bbb ccc"将元素的className设置为aaa bbb ccc
- // ms-attr-class="xxx" vm.xxx=false 清空元素的所有类名
- // ms-attr-name="yyy" vm.yyy="ooo" 为元素设置name属性
- var toRemove = (val === false) || (val === null) || (val === void 0)
-
- if (!W3C && propMap[attrName]) { //旧式IE下需要进行名字映射
- attrName = propMap[attrName]
- }
- var bool = boolMap[attrName]
- if (typeof elem[bool] === "boolean") {
- elem[bool] = !!val //布尔属性必须使用el.xxx = true|false方式设值
- if (!val) { //如果为false, IE全系列下相当于setAttribute(xxx,''),会影响到样式,需要进一步处理
- toRemove = true
- }
- }
- if (toRemove) {
- return elem.removeAttribute(attrName)
- }
- //SVG只能使用setAttribute(xxx, yyy), VML只能使用elem.xxx = yyy ,HTML的固有属性必须elem.xxx = yyy
- var isInnate = rsvg.test(elem) ? false : (DOC.namespaces && isVML(elem)) ? true : attrName in elem.cloneNode(false)
- if (isInnate) {
- elem[attrName] = val + ""
- } else {
- elem.setAttribute(attrName, val)
- }
- } else if (method === "include" && val) {
- var vmodels = data.vmodels
- var rendered = data.includeRendered
- var loaded = data.includeLoaded
- var replace = data.includeReplace
- var target = replace ? elem.parentNode : elem
- var scanTemplate = function (text) {
- if (data.vmodels === null) {
- return
- }
-
- if (loaded) {
- var newText = loaded.apply(target, [text].concat(vmodels))
- if (typeof newText === "string")
- text = newText
- }
- if (rendered) {
- checkScan(target, function () {
- rendered.call(target)
- }, NaN)
- }
- var lastID = data.includeLastID
- if (data.templateCache && lastID && lastID !== val) {
- var lastTemplate = data.templateCache[lastID]
- if (!lastTemplate) {
- lastTemplate = data.templateCache[lastID] = DOC.createElement("div")
- ifGroup.appendChild(lastTemplate)
- }
- }
- data.includeLastID = val
- while (data.startInclude) {
- var node = data.startInclude.nextSibling
- if (node && node !== data.endInclude) {
- target.removeChild(node)
- if (lastTemplate)
- lastTemplate.appendChild(node)
- } else {
- break
- }
- }
- var dom = getTemplateNodes(data, val, text)
- var nodes = avalon.slice(dom.childNodes)
- target.insertBefore(dom, data.endInclude)
- scanNodeArray(nodes, vmodels)
- }
-
- if (data.param === "src") {
- if (typeof templatePool[val] === "string") {
- avalon.nextTick(function () {
- scanTemplate(templatePool[val])
- })
- } else if (Array.isArray(templatePool[val])) { //#805 防止在循环绑定中发出许多相同的请求
- templatePool[val].push(scanTemplate)
- } else {
- var xhr = getXHR()
- xhr.onreadystatechange = function () {
- if (xhr.readyState === 4) {
- var s = xhr.status
- if (s >= 200 && s < 300 || s === 304 || s === 1223) {
- var text = xhr.responseText
- for (var f = 0, fn; fn = templatePool[val][f++]; ) {
- fn(text)
- }
- templatePool[val] = text
- }
- }
- }
- templatePool[val] = [scanTemplate]
- xhr.open("GET", val, true)
- if ("withCredentials" in xhr) {
- xhr.withCredentials = true
- }
- xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest")
- xhr.send(null)
- }
- } else {
- //IE系列与够新的标准浏览器支持通过ID取得元素(firefox14+)
- //http://tjvantoll.com/2012/07/19/dom-element-references-as-global-variables/
- var el = val && val.nodeType === 1 ? val : DOC.getElementById(val)
- if (el) {
- if (el.tagName === "NOSCRIPT" && !(el.innerHTML || el.fixIE78)) { //IE7-8 innerText,innerHTML都无法取得其内容,IE6能取得其innerHTML
- xhr = getXHR() //IE9-11与chrome的innerHTML会得到转义的内容,它们的innerText可以
- xhr.open("GET", location, false) //谢谢Nodejs 乱炖群 深圳-纯属虚构
- xhr.send(null)
- //http://bbs.csdn.net/topics/390349046?page=1#post-393492653
- var noscripts = DOC.getElementsByTagName("noscript")
- var array = (xhr.responseText || "").match(rnoscripts) || []
- var n = array.length
- for (var i = 0; i < n; i++) {
- var tag = noscripts[i]
- if (tag) { //IE6-8中noscript标签的innerHTML,innerText是只读的
- tag.style.display = "none" //http://haslayout.net/css/noscript-Ghost-Bug
- tag.fixIE78 = (array[i].match(rnoscriptText) || ["", "&nbsp;"])[1]
- }
- }
- }
- avalon.nextTick(function () {
- scanTemplate(el.fixIE78 || el.value || el.innerText || el.innerHTML)
- })
- }
- }
- } else {
- if (!root.hasAttribute && typeof val === "string" && (method === "src" || method === "href")) {
- val = val.replace(/&amp;/g, "&") //处理IE67自动转义的问题
- }
- elem[method] = val
- if (window.chrome && elem.tagName === "EMBED") {
- var parent = elem.parentNode //#525 chrome1-37下embed标签动态设置src不能发生请求
- var comment = document.createComment("ms-src")
- parent.replaceChild(comment, elem)
- parent.replaceChild(elem, comment)
- }
- }
-}
-
-function getTemplateNodes(data, id, text) {
- var div = data.templateCache && data.templateCache[id]
- if (div) {
- var dom = DOC.createDocumentFragment(),
- firstChild
- while (firstChild = div.firstChild) {
- dom.appendChild(firstChild)
- }
- return dom
- }
- return avalon.parseHTML(text)
-}
-
-//这几个指令都可以使用插值表达式,如ms-src="aaa/{{b}}/{{c}}.html"
-"title,alt,src,value,css,include,href".replace(rword, function (name) {
- bindingHandlers[name] = bindingHandlers.attr
-})
-//根据VM的属性值或表达式的值切换类名,ms-class="xxx yyy zzz:flag"
-//http://www.cnblogs.com/rubylouvre/archive/2012/12/17/2818540.html
-bindingHandlers["class"] = function (binding, vmodels) {
- var oldStyle = binding.param,
- text = binding.value,
- rightExpr
- binding.handlerName = "class"
- if (!oldStyle || isFinite(oldStyle)) {
- binding.param = "" //去掉数字
- var colonIndex = text.replace(rexprg, function (a) {
- return a.replace(/./g, "0")
- }).indexOf(":") //取得第一个冒号的位置
- if (colonIndex === -1) { // 比如 ms-class="aaa bbb ccc" 的情况
- var className = text
- rightExpr = true
- } else { // 比如 ms-class-1="ui-state-active:checked" 的情况
- className = text.slice(0, colonIndex)
- rightExpr = text.slice(colonIndex + 1)
- }
- if (!rexpr.test(text)) {
- className = quote(className)
- } else {
- className = stringifyExpr(className)
- }
- binding.expr = "[" + className + "," + rightExpr + "]"
- } else {
- binding.expr = '[' + quote(oldStyle) + "," + text + "]"
- binding.oldStyle = oldStyle
- }
- var method = binding.type
- if (method === "hover" || method === "active") { //确保只绑定一次
- if (!binding.hasBindEvent) {
- var elem = binding.element
- var $elem = avalon(elem)
- var activate = "mouseenter" //在移出移入时切换类名
- var abandon = "mouseleave"
- if (method === "active") { //在聚焦失焦中切换类名
- elem.tabIndex = elem.tabIndex || -1
- activate = "mousedown"
- abandon = "mouseup"
- var fn0 = $elem.bind("mouseleave", function () {
- binding.toggleClass && $elem.removeClass(binding.newClass)
- })
- }
- }
-
- var fn1 = $elem.bind(activate, function () {
- binding.toggleClass && $elem.addClass(binding.newClass)
- })
- var fn2 = $elem.bind(abandon, function () {
- binding.toggleClass && $elem.removeClass(binding.newClass)
- })
- binding.rollback = function () {
- $elem.unbind("mouseleave", fn0)
- $elem.unbind(activate, fn1)
- $elem.unbind(abandon, fn2)
- }
- binding.hasBindEvent = true
- }
- parseExprProxy(binding.expr, vmodels, binding)
-}
-
-bindingExecutors["class"] = function (arr, elem, binding) {
- var $elem = avalon(elem)
- binding.newClass = arr[0]
- binding.toggleClass = !!arr[1]
- if (binding.oldClass && binding.newClass !== binding.oldClass) {
- $elem.removeClass(binding.oldClass)
- }
- binding.oldClass = binding.newClass
- if (binding.type === "class") {
- if (binding.oldStyle) {
- $elem.toggleClass(binding.oldStyle, !!arr[1])
- } else {
- $elem.toggleClass(binding.newClass, binding.toggleClass)
- }
- }
-
-}
-
-"hover,active".replace(rword, function (method) {
- bindingHandlers[method] = bindingHandlers["class"]
-})
-//ms-controller绑定已经在scanTag 方法中实现
-//ms-css绑定已由ms-attr绑定实现
-
-
-// bindingHandlers.data 定义在if.js
-bindingExecutors.data = function(val, elem, data) {
- var key = "data-" + data.param
- if (val && typeof val === "object") {
- elem[key] = val
- } else {
- elem.setAttribute(key, String(val))
- }
-}
-//双工绑定
-var duplexBinding = bindingHandlers.duplex = function(data, vmodels) {
- var elem = data.element,
- hasCast
- parseExprProxy(data.value, vmodels, data, 1)
-
- data.changed = getBindingCallback(elem, "data-duplex-changed", vmodels) || noop
- if (data.evaluator && data.args) {
- var params = []
- var casting = oneObject("string,number,boolean,checked")
- if (elem.type === "radio" && data.param === "") {
- data.param = "checked"
- }
- if (elem.msData) {
- elem.msData["ms-duplex"] = data.value
- }
- data.param.replace(/\w+/g, function(name) {
- if (/^(checkbox|radio)$/.test(elem.type) && /^(radio|checked)$/.test(name)) {
- if (name === "radio")
- log("ms-duplex-radio已经更名为ms-duplex-checked")
- name = "checked"
- data.isChecked = true
- }
- if (name === "bool") {
- name = "boolean"
- log("ms-duplex-bool已经更名为ms-duplex-boolean")
- } else if (name === "text") {
- name = "string"
- log("ms-duplex-text已经更名为ms-duplex-string")
- }
- if (casting[name]) {
- hasCast = true
- }
- avalon.Array.ensure(params, name)
- })
- if (!hasCast) {
- params.push("string")
- }
- data.param = params.join("-")
- data.bound = function(type, callback) {
- if (elem.addEventListener) {
- elem.addEventListener(type, callback, false)
- } else {
- elem.attachEvent("on" + type, callback)
- }
- var old = data.rollback
- data.rollback = function() {
- elem.avalonSetter = null
- avalon.unbind(elem, type, callback)
- old && old()
- }
- }
- for (var i in avalon.vmodels) {
- var v = avalon.vmodels[i]
- v.$fire("avalon-ms-duplex-init", data)
- }
- var cpipe = data.pipe || (data.pipe = pipe)
- cpipe(null, data, "init")
- var tagName = elem.tagName
- duplexBinding[tagName] && duplexBinding[tagName](elem, data.evaluator.apply(null, data.args), data)
- }
-}
-//不存在 bindingExecutors.duplex
-
- function fixNull(val) {
- return val == null ? "" : val
- }
-avalon.duplexHooks = {
- checked: {
- get: function(val, data) {
- return !data.element.oldValue
- }
- },
- string: {
- get: function(val) { //同步到VM
- return val
- },
- set: fixNull
- },
- "boolean": {
- get: function(val) {
- return val === "true"
- },
- set: fixNull
- },
- number: {
- get: function(val, data) {
- var number = parseFloat(val)
- if (-val === -number) {
- return number
- }
- var arr = /strong|medium|weak/.exec(data.element.getAttribute("data-duplex-number")) || ["medium"]
- switch (arr[0]) {
- case "strong":
- return 0
- case "medium":
- return val === "" ? "" : 0
- case "weak":
- return val
- }
- },
- set: fixNull
- }
-}
-
-function pipe(val, data, action, e) {
- data.param.replace(/\w+/g, function(name) {
- var hook = avalon.duplexHooks[name]
- if (hook && typeof hook[action] === "function") {
- val = hook[action](val, data)
- }
- })
- return val
-}
-
-var TimerID, ribbon = []
-
- avalon.tick = function(fn) {
- if (ribbon.push(fn) === 1) {
- TimerID = setInterval(ticker, 60)
- }
- }
-
- function ticker() {
- for (var n = ribbon.length - 1; n >= 0; n--) {
- var el = ribbon[n]
- if (el() === false) {
- ribbon.splice(n, 1)
- }
- }
- if (!ribbon.length) {
- clearInterval(TimerID)
- }
- }
-
-var watchValueInTimer = noop
-new function() { // jshint ignore:line
- try { //#272 IE9-IE11, firefox
- var setters = {}
- var aproto = HTMLInputElement.prototype
- var bproto = HTMLTextAreaElement.prototype
- function newSetter(value) { // jshint ignore:line
- setters[this.tagName].call(this, value)
- if (!this.msFocus && this.avalonSetter && this.oldValue !== value) {
- this.avalonSetter()
- }
- }
- var inputProto = HTMLInputElement.prototype
- Object.getOwnPropertyNames(inputProto) //故意引发IE6-8等浏览器报错
- setters["INPUT"] = Object.getOwnPropertyDescriptor(aproto, "value").set
-
- Object.defineProperty(aproto, "value", {
- set: newSetter
- })
- setters["TEXTAREA"] = Object.getOwnPropertyDescriptor(bproto, "value").set
- Object.defineProperty(bproto, "value", {
- set: newSetter
- })
- } catch (e) {
- //在chrome 43中 ms-duplex终于不需要使用定时器实现双向绑定了
- // http://updates.html5rocks.com/2015/04/DOM-attributes-now-on-the-prototype
- // https://docs.google.com/document/d/1jwA8mtClwxI-QJuHT7872Z0pxpZz8PBkf2bGAbsUtqs/edit?pli=1
- watchValueInTimer = avalon.tick
- }
-} // jshint ignore:line
-if (IEVersion) {
- avalon.bind(DOC, "selectionchange", function (e) {
- var el = DOC.activeElement
- if (el && typeof el.avalonSetter === "function") {
- el.avalonSetter()
- }
- })
-}
-var rnoduplex = /^(file|button|reset|submit|checkbox|radio|range)$/
-//处理radio, checkbox, text, textarea, password
-duplexBinding.INPUT = function (element, evaluator, data) {
- var $type = element.type,
- bound = data.bound,
- $elem = avalon(element),
- composing = false
-
- function callback(value) {
- data.changed.call(this, value, data)
- }
-
- function compositionStart() {
- composing = true
- }
-
- function compositionEnd() {
- composing = false
- }
- //当value变化时改变model的值
- var updateVModel = function () {
- var val = element.value //防止递归调用形成死循环
- if (composing || val === element.oldValue) //处理中文输入法在minlengh下引发的BUG
- return
- var lastValue = data.pipe(val, data, "get")
- if ($elem.data("duplexObserve") !== false) {
- evaluator(lastValue)
- callback.call(element, lastValue)
- }
- }
- //当model变化时,它就会改变value的值
- data.handler = function () {
- var val = data.pipe(evaluator(), data, "set") //fix #673 #1106
- if (val !== element.oldValue) {
- var fixCaret = false
- if (element.msFocus) {
- try {
- var pos = getCaret(element)
- if (pos.start === pos.end) {
- pos = pos.start
- fixCaret = true
- }
- } catch (e) {
- }
- }
- element.value = element.oldValue = val
- if (fixCaret) {
- setCaret(element, pos, pos)
- }
- }
- }
- if (data.isChecked || $type === "radio") {
- var IE6 = IEVersion === 6
- updateVModel = function () {
- if ($elem.data("duplexObserve") !== false) {
- var lastValue = data.pipe(element.value, data, "get")
- evaluator(lastValue)
- callback.call(element, lastValue)
- }
- }
- data.handler = function () {
- var val = evaluator()
- var checked = data.isChecked ? !!val : val + "" === element.value
- element.oldValue = checked
- if (IE6) {
- setTimeout(function () {
- //IE8 checkbox, radio是使用defaultChecked控制选中状态,
- //并且要先设置defaultChecked后设置checked
- //并且必须设置延迟
- element.defaultChecked = checked
- element.checked = checked
- }, 31)
- } else {
- element.checked = checked
- }
- }
- bound("click", updateVModel)
- } else if ($type === "checkbox") {
- updateVModel = function () {
- if ($elem.data("duplexObserve") !== false) {
- var method = element.checked ? "ensure" : "remove"
- var array = evaluator()
- if (!Array.isArray(array)) {
- log("ms-duplex应用于checkbox上要对应一个数组")
- array = [array]
- }
- var val = data.pipe(element.value, data, "get")
- avalon.Array[method](array, val)
- callback.call(element, array)
- }
- }
-
- data.handler = function () {
- var array = [].concat(evaluator()) //强制转换为数组
- var val = data.pipe(element.value, data, "get")
- element.checked = array.indexOf(val) > -1
- }
- bound(W3C ? "change" : "click", updateVModel)
- } else {
- var events = element.getAttribute("data-duplex-event") || "input"
- if (element.attributes["data-event"]) {
- log("data-event指令已经废弃,请改用data-duplex-event")
- }
-
- function delay(e) { // jshint ignore:line
- setTimeout(function () {
- updateVModel(e)
- })
- }
- events.replace(rword, function (name) {
- switch (name) {
- case "input":
- if (!IEVersion) { // W3C
- bound("input", updateVModel)
- //非IE浏览器才用这个
- bound("compositionstart", compositionStart)
- bound("compositionend", compositionEnd)
- bound("DOMAutoComplete", updateVModel)
- } else { //onpropertychange事件无法区分是程序触发还是用户触发
- // IE下通过selectionchange事件监听IE9+点击input右边的X的清空行为,及粘贴,剪切,删除行为
- if (IEVersion > 8) {
- bound("input", updateVModel) //IE9使用propertychange无法监听中文输入改动
- } else {
- bound("propertychange", function (e) { //IE6-8下第一次修改时不会触发,需要使用keydown或selectionchange修正
- if (e.propertyName === "value") {
- updateVModel()
- }
- })
- }
- bound("dragend", delay)
- //http://www.cnblogs.com/rubylouvre/archive/2013/02/17/2914604.html
- //http://www.matts411.com/post/internet-explorer-9-oninput/
- }
- break
- default:
- bound(name, updateVModel)
- break
- }
- })
-
-
- if (!rnoduplex.test(element.type)) {
- if (element.type !== "hidden") {
- bound("focus", function () {
- element.msFocus = true
- })
- bound("blur", function () {
- element.msFocus = false
- })
- }
-
- element.avalonSetter = updateVModel //#765
- watchValueInTimer(function () {
- if (root.contains(element)) {
- if (!element.msFocus && element.oldValue !== element.value) {
- updateVModel()
- }
- } else if (!element.msRetain) {
- return false
- }
- })
- }
-
- }
-
- avalon.injectBinding(data)
- callback.call(element, element.value)
-}
-duplexBinding.TEXTAREA = duplexBinding.INPUT
-function getCaret(ctrl, start, end) {
- if (ctrl.setSelectionRange) {
- start = ctrl.selectionStart
- end = ctrl.selectionEnd
- } else if (document.selection && document.selection.createRange) {
- var range = document.selection.createRange()
- start = 0 - range.duplicate().moveStart('character', -100000)
- end = start + range.text.length
- }
- return {
- start: start,
- end: end
- }
-}
-function setCaret(ctrl, begin, end) {
- if (!ctrl.value || ctrl.readOnly)
- return
- if (ctrl.createTextRange) {//IE6-9
- setTimeout(function () {
- var range = ctrl.createTextRange()
- range.collapse(true);
- range.moveStart("character", begin)
- range.select()
- }, 17)
- } else {
- ctrl.selectionStart = begin
- ctrl.selectionEnd = end
- }
-}
-duplexBinding.SELECT = function(element, evaluator, data) {
- var $elem = avalon(element)
-
- function updateVModel() {
- if ($elem.data("duplexObserve") !== false) {
- var val = $elem.val() //字符串或字符串数组
- if (Array.isArray(val)) {
- val = val.map(function(v) {
- return data.pipe(v, data, "get")
- })
- } else {
- val = data.pipe(val, data, "get")
- }
- if (val + "" !== element.oldValue) {
- evaluator(val)
- }
- data.changed.call(element, val, data)
- }
- }
- data.handler = function() {
- var val = evaluator()
- val = val && val.$model || val
- if (Array.isArray(val)) {
- if (!element.multiple) {
- log("ms-duplex在<select multiple=true>上要求对应一个数组")
- }
- } else {
- if (element.multiple) {
- log("ms-duplex在<select multiple=false>不能对应一个数组")
- }
- }
- //必须变成字符串后才能比较
- val = Array.isArray(val) ? val.map(String) : val + ""
- if (val + "" !== element.oldValue) {
- $elem.val(val)
- element.oldValue = val + ""
- }
- }
- data.bound("change", updateVModel)
- element.msCallback = function() {
- avalon.injectBinding(data)
- data.changed.call(element, evaluator(), data)
- }
-}
-// bindingHandlers.html 定义在if.js
-bindingExecutors.html = function (val, elem, data) {
- var isHtmlFilter = elem.nodeType !== 1
- var parent = isHtmlFilter ? elem.parentNode : elem
- if (!parent)
- return
- val = val == null ? "" : val
- if (data.oldText !== val) {
- data.oldText = val
- } else {
- return
- }
- if (elem.nodeType === 3) {
- var signature = generateID("html")
- parent.insertBefore(DOC.createComment(signature), elem)
- data.element = DOC.createComment(signature + ":end")
- parent.replaceChild(data.element, elem)
- elem = data.element
- }
- if (typeof val !== "object") {//string, number, boolean
- var fragment = avalon.parseHTML(String(val))
- } else if (val.nodeType === 11) { //将val转换为文档碎片
- fragment = val
- } else if (val.nodeType === 1 || val.item) {
- var nodes = val.nodeType === 1 ? val.childNodes : val.item
- fragment = avalonFragment.cloneNode(true)
- while (nodes[0]) {
- fragment.appendChild(nodes[0])
- }
- }
-
- nodes = avalon.slice(fragment.childNodes)
- //插入占位符, 如果是过滤器,需要有节制地移除指定的数量,如果是html指令,直接清空
- if (isHtmlFilter) {
- var endValue = elem.nodeValue.slice(0, -4)
- while (true) {
- var node = elem.previousSibling
- if (!node || node.nodeType === 8 && node.nodeValue === endValue) {
- break
- } else {
- parent.removeChild(node)
- }
- }
- parent.insertBefore(fragment, elem)
- } else {
- avalon.clearHTML(elem).appendChild(fragment)
- }
- scanNodeArray(nodes, data.vmodels)
-}
-bindingHandlers["if"] =
- bindingHandlers.data =
- bindingHandlers.text =
- bindingHandlers.html =
- function(data, vmodels) {
- parseExprProxy(data.value, vmodels, data)
-}
-
-bindingExecutors["if"] = function(val, elem, data) {
- try {
- if(!elem.parentNode) return
- } catch(e) {return}
- if (val) { //插回DOM树
- if (elem.nodeType === 8) {
- elem.parentNode.replaceChild(data.template, elem)
- elem.ifRemove = null
- // animate.enter(data.template, elem.parentNode)
- elem = data.element = data.template //这时可能为null
- }
- if (elem.getAttribute(data.name)) {
- elem.removeAttribute(data.name)
- scanAttr(elem, data.vmodels)
- }
- data.rollback = null
- } else { //移出DOM树,并用注释节点占据原位置
- if (elem.nodeType === 1) {
- var node = data.element = DOC.createComment("ms-if")
- elem.parentNode.replaceChild(node, elem)
- elem.ifRemove = node
- // animate.leave(elem, node.parentNode, node)
- data.template = elem //元素节点
- ifGroup.appendChild(elem)
- data.rollback = function() {
- if (elem.parentNode === ifGroup) {
- ifGroup.removeChild(elem)
- }
- }
- }
- }
-}
-//ms-important绑定已经在scanTag 方法中实现
-//ms-include绑定已由ms-attr绑定实现
-
-var rdash = /\(([^)]*)\)/
-bindingHandlers.on = function(data, vmodels) {
- var value = data.value
- data.type = "on"
- var eventType = data.param.replace(/-\d+$/, "") // ms-on-mousemove-10
- if (typeof bindingHandlers.on[eventType + "Hook"] === "function") {
- bindingHandlers.on[eventType + "Hook"](data)
- }
- if (value.indexOf("(") > 0 && value.indexOf(")") > -1) {
- var matched = (value.match(rdash) || ["", ""])[1].trim()
- if (matched === "" || matched === "$event") { // aaa() aaa($event)当成aaa处理
- value = value.replace(rdash, "")
- }
- }
- parseExprProxy(value, vmodels, data)
-}
-
-bindingExecutors.on = function(callback, elem, data) {
- callback = function(e) {
- var fn = data.evaluator || noop
- return fn.apply(this, data.args.concat(e))
- }
- var eventType = data.param.replace(/-\d+$/, "") // ms-on-mousemove-10
- if (eventType === "scan") {
- callback.call(elem, {
- type: eventType
- })
- } else if (typeof data.specialBind === "function") {
- data.specialBind(elem, callback)
- } else {
- var removeFn = avalon.bind(elem, eventType, callback)
- }
- data.rollback = function() {
- if (typeof data.specialUnbind === "function") {
- data.specialUnbind()
- } else {
- avalon.unbind(elem, eventType, removeFn)
- }
- }
-}
-bindingHandlers.repeat = function (data, vmodels) {
- var type = data.type
- parseExprProxy(data.value, vmodels, data, 1)
- data.proxies = []
- var freturn = false
- try {
- var $repeat = data.$repeat = data.evaluator.apply(0, data.args || [])
- var xtype = avalon.type($repeat)
- if (xtype !== "object" && xtype !== "array") {
- freturn = true
- avalon.log("warning:" + data.value + "只能是对象或数组")
- } else {
- data.xtype = xtype
- }
- } catch (e) {
- freturn = true
- }
- var arr = data.value.split(".") || []
- if (arr.length > 1) {
- arr.pop()
- var n = arr[0]
- for (var i = 0, v; v = vmodels[i++]; ) {
- if (v && v.hasOwnProperty(n)) {
- var events = v[n].$events || {}
- events[subscribers] = events[subscribers] || []
- events[subscribers].push(data)
- break
- }
- }
- }
-
- var oldHandler = data.handler
- data.handler = noop
- avalon.injectBinding(data)
- data.handler = oldHandler
-
- var elem = data.element
- if (elem.nodeType === 1) {
- elem.removeAttribute(data.name)
- data.sortedCallback = getBindingCallback(elem, "data-with-sorted", vmodels)
- data.renderedCallback = getBindingCallback(elem, "data-" + type + "-rendered", vmodels)
- var signature = generateID(type)
- var start = DOC.createComment(signature)
- var end = DOC.createComment(signature + ":end")
- data.signature = signature
- data.template = avalonFragment.cloneNode(false)
- if (type === "repeat") {
- var parent = elem.parentNode
- parent.replaceChild(end, elem)
- parent.insertBefore(start, end)
- data.template.appendChild(elem)
- } else {
- while (elem.firstChild) {
- data.template.appendChild(elem.firstChild)
- }
- elem.appendChild(start)
- elem.appendChild(end)
- }
- data.element = end
- data.handler = bindingExecutors.repeat
- data.rollback = function () {
- var elem = data.element
- if (!elem)
- return
- data.handler("clear")
- }
- }
-
- if (freturn) {
- return
- }
-
- data.$outer = {}
- var check0 = "$key"
- var check1 = "$val"
- if (Array.isArray($repeat)) {
- check0 = "$first"
- check1 = "$last"
- }
-
- for (i = 0; v = vmodels[i++]; ) {
- if (v.hasOwnProperty(check0) && v.hasOwnProperty(check1)) {
- data.$outer = v
- break
- }
- }
- var $events = $repeat.$events
- var $list = ($events || {})[subscribers]
- injectDependency($list, data)
- if (xtype === "object") {
- data.handler("append")
- } else if ($repeat.length) {
- data.handler("add", 0, $repeat.length)
- }
-}
-
-bindingExecutors.repeat = function (method, pos, el) {
- var data = this
- if (!method && data.xtype) {
- var old = data.$repeat
- var neo = data.evaluator.apply(0, data.args || [])
-
- if (data.xtype === "array") {
- if (old.length === neo.length) {
- if (old !== neo && old.length > 0) {
- bindingExecutors.repeat.call(this, 'clear', pos, el)
- }
- else {
- return
- }
- }
- method = "add"
- pos = 0
- data.$repeat = neo
- el = neo.length
- } else {
- if (keysVM(old).join(";;") === keysVM(neo).join(";;")) {
- return
- }
- method = "append"
- data.$repeat = neo
- }
- }
- if (method) {
- var start, fragment
- var end = data.element
- var comments = getComments(data)
- var parent = end.parentNode
- var proxies = data.proxies
- var transation = avalonFragment.cloneNode(false)
- switch (method) {
- case "add": //在pos位置后添加el数组(pos为插入位置,el为要插入的个数)
- var n = pos + el
- var fragments = []
- for (var i = pos; i < n; i++) {
- var proxy = eachProxyAgent(i, data)
- proxies.splice(i, 0, proxy)
- shimController(data, transation, proxy, fragments)
- }
- parent.insertBefore(transation, comments[pos] || end)
- for (i = 0; fragment = fragments[i++]; ) {
- scanNodeArray(fragment.nodes, fragment.vmodels)
- fragment.nodes = fragment.vmodels = null
- }
-
- break
- case "del": //将pos后的el个元素删掉(pos, el都是数字)
- sweepNodes(comments[pos], comments[pos + el] || end)
- var removed = proxies.splice(pos, el)
- recycleProxies(removed, "each")
- break
- case "clear":
- start = comments[0]
- if (start) {
- sweepNodes(start, end)
- if (data.xtype === "object") {
- parent.insertBefore(start, end)
- }else{
- recycleProxies(proxies, "each")
- }
- }
- break
- case "move":
- start = comments[0]
- if (start) {
- var signature = start.nodeValue
- var rooms = []
- var room = [],
- node
- sweepNodes(start, end, function () {
- room.unshift(this)
- if (this.nodeValue === signature) {
- rooms.unshift(room)
- room = []
- }
- })
- sortByIndex(rooms, pos)
- sortByIndex(proxies, pos)
- while (room = rooms.shift()) {
- while (node = room.shift()) {
- transation.appendChild(node)
- }
- }
- parent.insertBefore(transation, end)
- }
- break
- case "index": //将proxies中的第pos个起的所有元素重新索引
- var last = proxies.length - 1
- for (; el = proxies[pos]; pos++) {
- el.$index = pos
- el.$first = pos === 0
- el.$last = pos === last
- }
- return
- case "set": //将proxies中的第pos个元素的VM设置为el(pos为数字,el任意)
- proxy = proxies[pos]
- if (proxy) {
- fireDependencies(proxy.$events[data.param || "el"])
- }
- break
- case "append":
- var object = data.$repeat //原来第2参数, 被循环对象
- var pool = Array.isArray(proxies) ||!proxies ? {}: proxies //代理对象组成的hash
- data.proxies = pool
- var keys = []
- fragments = []
- for (var key in pool) {
- if (!object.hasOwnProperty(key)) {
- proxyRecycler(pool[key], withProxyPool) //去掉之前的代理VM
- delete(pool[key])
- }
- }
- for (key in object) { //得到所有键名
- if (object.hasOwnProperty(key) && key !== "hasOwnProperty") {
- keys.push(key)
- }
- }
- if (data.sortedCallback) { //如果有回调,则让它们排序
- var keys2 = data.sortedCallback.call(parent, keys)
- if (keys2 && Array.isArray(keys2) && keys2.length) {
- keys = keys2
- }
- }
- for (i = 0; key = keys[i++]; ) {
- if (key !== "hasOwnProperty") {
- pool[key] = withProxyAgent(pool[key], key, data)
- shimController(data, transation, pool[key], fragments)
- }
- }
-
- parent.insertBefore(transation, end)
- for (i = 0; fragment = fragments[i++]; ) {
- scanNodeArray(fragment.nodes, fragment.vmodels)
- fragment.nodes = fragment.vmodels = null
- }
- break
- }
- if (!data.$repeat || data.$repeat.hasOwnProperty("$lock")) //IE6-8 VBScript对象会报错, 有时候data.$repeat不存在
- return
- if (method === "clear")
- method = "del"
- var callback = data.renderedCallback || noop,
- args = arguments
- if (parent.oldValue && parent.tagName === "SELECT") { //fix #503
- avalon(parent).val(parent.oldValue.split(","))
- }
- callback.apply(parent, args)
- }
-}
-"with,each".replace(rword, function (name) {
- bindingHandlers[name] = bindingHandlers.repeat
-})
-
-function shimController(data, transation, proxy, fragments) {
- var content = data.template.cloneNode(true)
- var nodes = avalon.slice(content.childNodes)
- content.insertBefore(DOC.createComment(data.signature), content.firstChild)
- transation.appendChild(content)
- var nv = [proxy].concat(data.vmodels)
- var fragment = {
- nodes: nodes,
- vmodels: nv
- }
- fragments.push(fragment)
-}
-
-function getComments(data) {
- var ret = []
- var nodes = data.element.parentNode.childNodes
- for (var i = 0, node; node = nodes[i++]; ) {
- if (node.nodeValue === data.signature) {
- ret.push(node)
- } else if (node.nodeValue === data.signature + ":end") {
- break
- }
- }
- return ret
-}
-
-
-//移除掉start与end之间的节点(保留end)
-function sweepNodes(start, end, callback) {
- while (true) {
- var node = end.previousSibling
- if (!node)
- break
- node.parentNode.removeChild(node)
- callback && callback.call(node)
- if (node === start) {
- break
- }
- }
-}
-
-// 为ms-each,ms-with, ms-repeat会创建一个代理VM,
-// 通过它们保持一个下上文,让用户能调用$index,$first,$last,$remove,$key,$val,$outer等属性与方法
-// 所有代理VM的产生,消费,收集,存放通过xxxProxyFactory,xxxProxyAgent, recycleProxies,xxxProxyPool实现
-var withProxyPool = []
-function withProxyFactory() {
- var proxy = modelFactory({
- $key: "",
- $outer: {},
- $host: {},
- $val: {
- get: function () {
- return this.$host[this.$key]
- },
- set: function (val) {
- this.$host[this.$key] = val
- }
- }
- }, {
- $val: 1
- })
- proxy.$id = generateID("$proxy$with")
- return proxy
-}
-
-function withProxyAgent(proxy, key, data) {
- proxy = proxy || withProxyPool.pop()
- if (!proxy) {
- proxy = withProxyFactory()
- } else {
- proxy.$reinitialize()
- }
- var host = data.$repeat
- proxy.$key = key
-
- proxy.$host = host
- proxy.$outer = data.$outer
- if (host.$events) {
- proxy.$events.$val = host.$events[key]
- } else {
- proxy.$events = {}
- }
- return proxy
-}
-
-
-function recycleProxies(proxies) {
- eachProxyRecycler(proxies)
-}
-function eachProxyRecycler(proxies) {
- proxies.forEach(function (proxy) {
- proxyRecycler(proxy, eachProxyPool)
- })
- proxies.length = 0
-}
-
-
-var eachProxyPool = []
-function eachProxyFactory(name) {
- var source = {
- $host: [],
- $outer: {},
- $index: 0,
- $first: false,
- $last: false,
- $remove: avalon.noop
- }
- source[name] = {
- get: function () {
- var e = this.$events
- var array = e.$index
- e.$index = e[name] //#817 通过$index为el收集依赖
- try {
- return this.$host[this.$index]
- } finally {
- e.$index = array
- }
- },
- set: function (val) {
- try {
- var e = this.$events
- var array = e.$index
- e.$index = []
- this.$host.set(this.$index, val)
- } finally {
- e.$index = array
- }
- }
- }
- var second = {
- $last: 1,
- $first: 1,
- $index: 1
- }
- var proxy = modelFactory(source, second)
- proxy.$id = generateID("$proxy$each")
- return proxy
-}
-
-function eachProxyAgent(index, data) {
- var param = data.param || "el",
- proxy
- for (var i = 0, n = eachProxyPool.length; i < n; i++) {
- var candidate = eachProxyPool[i]
- if (candidate && candidate.hasOwnProperty(param)) {
- proxy = candidate
- eachProxyPool.splice(i, 1)
- }
- }
- if (!proxy) {
- proxy = eachProxyFactory(param)
- }
- var host = data.$repeat
- var last = host.length - 1
- proxy.$index = index
- proxy.$first = index === 0
- proxy.$last = index === last
- proxy.$host = host
- proxy.$outer = data.$outer
- proxy.$remove = function () {
- return host.removeAt(proxy.$index)
- }
- return proxy
-}
-
-
-function proxyRecycler(proxy, proxyPool) {
- for (var i in proxy.$events) {
- var arr = proxy.$events[i]
- if (Array.isArray(arr)) {
- arr.forEach(function (data) {
- if (typeof data === "object")
- disposeData(data)
- })// jshint ignore:line
- arr.length = 0
- }
- }
- proxy.$host = proxy.$outer = {}
- if (proxyPool.unshift(proxy) > kernel.maxRepeatSize) {
- proxyPool.pop()
- }
-}
-
-/*********************************************************************
- * 各种指令 *
- **********************************************************************/
-//ms-skip绑定已经在scanTag 方法中实现
-// bindingHandlers.text 定义在if.js
-bindingExecutors.text = function(val, elem) {
- val = val == null ? "" : val //不在页面上显示undefined null
- if (elem.nodeType === 3) { //绑定在文本节点上
- try { //IE对游离于DOM树外的节点赋值会报错
- elem.data = val
- } catch (e) {}
- } else { //绑定在特性节点上
- if ("textContent" in elem) {
- elem.textContent = val
- } else {
- elem.innerText = val
- }
- }
-}
-function parseDisplay(nodeName, val) {
- //用于取得此类标签的默认display值
- var key = "_" + nodeName
- if (!parseDisplay[key]) {
- var node = DOC.createElement(nodeName)
- root.appendChild(node)
- if (W3C) {
- val = getComputedStyle(node, null).display
- } else {
- val = node.currentStyle.display
- }
- root.removeChild(node)
- parseDisplay[key] = val
- }
- return parseDisplay[key]
-}
-
-avalon.parseDisplay = parseDisplay
-
-bindingHandlers.visible = function (data, vmodels) {
- parseExprProxy(data.value, vmodels, data)
-}
-
-bindingExecutors.visible = function (val, elem, binding) {
- if (val) {
- elem.style.display = binding.display || ""
- if (avalon(elem).css("display") === "none") {
- elem.style.display = binding.display = parseDisplay(elem.nodeName)
- }
- } else {
- elem.style.display = "none"
- }
-}
-bindingHandlers.widget = function(data, vmodels) {
- var args = data.value.match(rword)
- var elem = data.element
- var widget = args[0]
- var id = args[1]
- if (!id || id === "$") { //没有定义或为$时,取组件名+随机数
- id = generateID(widget)
- }
- var optName = args[2] || widget //没有定义,取组件名
- var constructor = avalon.ui[widget]
- if (typeof constructor === "function") { //ms-widget="tabs,tabsAAA,optname"
- vmodels = elem.vmodels || vmodels
- for (var i = 0, v; v = vmodels[i++];) {
- if (v.hasOwnProperty(optName) && typeof v[optName] === "object") {
- var vmOptions = v[optName]
- vmOptions = vmOptions.$model || vmOptions
- break
- }
- }
- if (vmOptions) {
- var wid = vmOptions[widget + "Id"]
- if (typeof wid === "string") {
- log("warning!不再支持" + widget + "Id")
- id = wid
- }
- }
- //抽取data-tooltip-text、data-tooltip-attr属性,组成一个配置对象
- var widgetData = avalon.getWidgetData(elem, widget)
- data.value = [widget, id, optName].join(",")
- data[widget + "Id"] = id
- data.evaluator = noop
- elem.msData["ms-widget-id"] = id
- var options = data[widget + "Options"] = avalon.mix({}, constructor.defaults, vmOptions || {}, widgetData)
- elem.removeAttribute("ms-widget")
- var vmodel = constructor(elem, data, vmodels) || {} //防止组件不返回VM
- if (vmodel.$id) {
- avalon.vmodels[id] = vmodel
- createSignalTower(elem, vmodel)
- try {
- vmodel.$init(function() {
- avalon.scan(elem, [vmodel].concat(vmodels))
- if (typeof options.onInit === "function") {
- options.onInit.call(elem, vmodel, options, vmodels)
- }
- })
- } catch (e) {log(e)}
- data.rollback = function() {
- try {
- vmodel.$remove()
- vmodel.widgetElement = null // 放到$remove后边
- } catch (e) {}
- elem.msData = {}
- delete avalon.vmodels[vmodel.$id]
- }
- injectDisposeQueue(data, widgetList)
- if (window.chrome) {
- elem.addEventListener("DOMNodeRemovedFromDocument", function() {
- setTimeout(rejectDisposeQueue)
- })
- }
- } else {
- avalon.scan(elem, vmodels)
- }
- } else if (vmodels.length) { //如果该组件还没有加载,那么保存当前的vmodels
- elem.vmodels = vmodels
- }
-}
-var widgetList = []
-//不存在 bindingExecutors.widget
-/*********************************************************************
- * 自带过滤器 *
- **********************************************************************/
-var rscripts = /<script[^>]*>([\S\s]*?)<\/script\s*>/gim
-var ron = /\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g
-var ropen = /<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/ig
-var rsanitize = {
- a: /\b(href)\=("javascript[^"]*"|'javascript[^']*')/ig,
- img: /\b(src)\=("javascript[^"]*"|'javascript[^']*')/ig,
- form: /\b(action)\=("javascript[^"]*"|'javascript[^']*')/ig
-}
-var rsurrogate = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g
-var rnoalphanumeric = /([^\#-~| |!])/g;
-
-function numberFormat(number, decimals, point, thousands) {
- //form http://phpjs.org/functions/number_format/
- //number 必需,要格式化的数字
- //decimals 可选,规定多少个小数位。
- //point 可选,规定用作小数点的字符串(默认为 . )。
- //thousands 可选,规定用作千位分隔符的字符串(默认为 , ),如果设置了该参数,那么所有其他参数都是必需的。
- number = (number + '')
- .replace(/[^0-9+\-Ee.]/g, '')
- var n = !isFinite(+number) ? 0 : +number,
- prec = !isFinite(+decimals) ? 3 : Math.abs(decimals),
- sep = thousands || ",",
- dec = point || ".",
- s = '',
- toFixedFix = function(n, prec) {
- var k = Math.pow(10, prec)
- return '' + (Math.round(n * k) / k)
- .toFixed(prec)
- }
- // Fix for IE parseFloat(0.55).toFixed(0) = 0;
- s = (prec ? toFixedFix(n, prec) : '' + Math.round(n))
- .split('.')
- if (s[0].length > 3) {
- s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep)
- }
- if ((s[1] || '')
- .length < prec) {
- s[1] = s[1] || ''
- s[1] += new Array(prec - s[1].length + 1)
- .join('0')
- }
- return s.join(dec)
-}
-
-
-var filters = avalon.filters = {
- uppercase: function(str) {
- return str.toUpperCase()
- },
- lowercase: function(str) {
- return str.toLowerCase()
- },
- truncate: function(str, length, truncation) {
- //length,新字符串长度,truncation,新字符串的结尾的字段,返回新字符串
- length = length || 30
- truncation = typeof truncation === "string" ? truncation : "..."
- return str.length > length ? str.slice(0, length - truncation.length) + truncation : String(str)
- },
- $filter: function(val) {
- for (var i = 1, n = arguments.length; i < n; i++) {
- var array = arguments[i]
- var fn = avalon.filters[array[0]]
- if (typeof fn === "function") {
- var arr = [val].concat(array.slice(1))
- val = fn.apply(null, arr)
- }
- }
- return val
- },
- camelize: camelize,
- //https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
- // <a href="javasc&NewLine;ript&colon;alert('XSS')">chrome</a>
- // <a href="data:text/html;base64, PGltZyBzcmM9eCBvbmVycm9yPWFsZXJ0KDEpPg==">chrome</a>
- // <a href="jav ascript:alert('XSS');">IE67chrome</a>
- // <a href="jav&#x09;ascript:alert('XSS');">IE67chrome</a>
- // <a href="jav&#x0A;ascript:alert('XSS');">IE67chrome</a>
- sanitize: function(str) {
- return str.replace(rscripts, "").replace(ropen, function(a, b) {
- var match = a.toLowerCase().match(/<(\w+)\s/)
- if (match) { //处理a标签的href属性,img标签的src属性,form标签的action属性
- var reg = rsanitize[match[1]]
- if (reg) {
- a = a.replace(reg, function(s, name, value) {
- var quote = value.charAt(0)
- return name + "=" + quote + "javascript:void(0)" + quote// jshint ignore:line
- })
- }
- }
- return a.replace(ron, " ").replace(/\s+/g, " ") //移除onXXX事件
- })
- },
- escape: function(str) {
- //将字符串经过 str 转义得到适合在页面中显示的内容, 例如替换 < 为 &lt
- return String(str).
- replace(/&/g, '&amp;').
- replace(rsurrogate, function(value) {
- var hi = value.charCodeAt(0)
- var low = value.charCodeAt(1)
- return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';'
- }).
- replace(rnoalphanumeric, function(value) {
- return '&#' + value.charCodeAt(0) + ';'
- }).
- replace(/</g, '&lt;').
- replace(/>/g, '&gt;')
- },
- currency: function(amount, symbol, fractionSize) {
- return (symbol || "\uFFE5") + numberFormat(amount, isFinite(fractionSize) ? fractionSize : 2)
- },
- number: numberFormat
-}
-/*
- 'yyyy': 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010)
- 'yy': 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)
- 'y': 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)
- 'MMMM': Month in year (January-December)
- 'MMM': Month in year (Jan-Dec)
- 'MM': Month in year, padded (01-12)
- 'M': Month in year (1-12)
- 'dd': Day in month, padded (01-31)
- 'd': Day in month (1-31)
- 'EEEE': Day in Week,(Sunday-Saturday)
- 'EEE': Day in Week, (Sun-Sat)
- 'HH': Hour in day, padded (00-23)
- 'H': Hour in day (0-23)
- 'hh': Hour in am/pm, padded (01-12)
- 'h': Hour in am/pm, (1-12)
- 'mm': Minute in hour, padded (00-59)
- 'm': Minute in hour (0-59)
- 'ss': Second in minute, padded (00-59)
- 's': Second in minute (0-59)
- 'a': am/pm marker
- 'Z': 4 digit (+sign) representation of the timezone offset (-1200-+1200)
- format string can also be one of the following predefined localizable formats:
-
- 'medium': equivalent to 'MMM d, y h:mm:ss a' for en_US locale (e.g. Sep 3, 2010 12:05:08 pm)
- 'short': equivalent to 'M/d/yy h:mm a' for en_US locale (e.g. 9/3/10 12:05 pm)
- 'fullDate': equivalent to 'EEEE, MMMM d,y' for en_US locale (e.g. Friday, September 3, 2010)
- 'longDate': equivalent to 'MMMM d, y' for en_US locale (e.g. September 3, 2010
- 'mediumDate': equivalent to 'MMM d, y' for en_US locale (e.g. Sep 3, 2010)
- 'shortDate': equivalent to 'M/d/yy' for en_US locale (e.g. 9/3/10)
- 'mediumTime': equivalent to 'h:mm:ss a' for en_US locale (e.g. 12:05:08 pm)
- 'shortTime': equivalent to 'h:mm a' for en_US locale (e.g. 12:05 pm)
- */
-new function() {// jshint ignore:line
- function toInt(str) {
- return parseInt(str, 10) || 0
- }
-
- function padNumber(num, digits, trim) {
- var neg = ""
- if (num < 0) {
- neg = '-'
- num = -num
- }
- num = "" + num
- while (num.length < digits)
- num = "0" + num
- if (trim)
- num = num.substr(num.length - digits)
- return neg + num
- }
-
- function dateGetter(name, size, offset, trim) {
- return function(date) {
- var value = date["get" + name]()
- if (offset > 0 || value > -offset)
- value += offset
- if (value === 0 && offset === -12) {
- value = 12
- }
- return padNumber(value, size, trim)
- }
- }
-
- function dateStrGetter(name, shortForm) {
- return function(date, formats) {
- var value = date["get" + name]()
- var get = (shortForm ? ("SHORT" + name) : name).toUpperCase()
- return formats[get][value]
- }
- }
-
- function timeZoneGetter(date) {
- var zone = -1 * date.getTimezoneOffset()
- var paddedZone = (zone >= 0) ? "+" : ""
- paddedZone += padNumber(Math[zone > 0 ? "floor" : "ceil"](zone / 60), 2) + padNumber(Math.abs(zone % 60), 2)
- return paddedZone
- }
- //取得上午下午
-
- function ampmGetter(date, formats) {
- return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1]
- }
- var DATE_FORMATS = {
- yyyy: dateGetter("FullYear", 4),
- yy: dateGetter("FullYear", 2, 0, true),
- y: dateGetter("FullYear", 1),
- MMMM: dateStrGetter("Month"),
- MMM: dateStrGetter("Month", true),
- MM: dateGetter("Month", 2, 1),
- M: dateGetter("Month", 1, 1),
- dd: dateGetter("Date", 2),
- d: dateGetter("Date", 1),
- HH: dateGetter("Hours", 2),
- H: dateGetter("Hours", 1),
- hh: dateGetter("Hours", 2, -12),
- h: dateGetter("Hours", 1, -12),
- mm: dateGetter("Minutes", 2),
- m: dateGetter("Minutes", 1),
- ss: dateGetter("Seconds", 2),
- s: dateGetter("Seconds", 1),
- sss: dateGetter("Milliseconds", 3),
- EEEE: dateStrGetter("Day"),
- EEE: dateStrGetter("Day", true),
- a: ampmGetter,
- Z: timeZoneGetter
- }
- var rdateFormat = /((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/
- var raspnetjson = /^\/Date\((\d+)\)\/$/
- filters.date = function(date, format) {
- var locate = filters.date.locate,
- text = "",
- parts = [],
- fn, match
- format = format || "mediumDate"
- format = locate[format] || format
- if (typeof date === "string") {
- if (/^\d+$/.test(date)) {
- date = toInt(date)
- } else if (raspnetjson.test(date)) {
- date = +RegExp.$1
- } else {
- var trimDate = date.trim()
- var dateArray = [0, 0, 0, 0, 0, 0, 0]
- var oDate = new Date(0)
- //取得年月日
- trimDate = trimDate.replace(/^(\d+)\D(\d+)\D(\d+)/, function(_, a, b, c) {
- var array = c.length === 4 ? [c, a, b] : [a, b, c]
- dateArray[0] = toInt(array[0]) //年
- dateArray[1] = toInt(array[1]) - 1 //月
- dateArray[2] = toInt(array[2]) //日
- return ""
- })
- var dateSetter = oDate.setFullYear
- var timeSetter = oDate.setHours
- trimDate = trimDate.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/, function(_, a, b, c, d) {
- dateArray[3] = toInt(a) //小时
- dateArray[4] = toInt(b) //分钟
- dateArray[5] = toInt(c) //秒
- if (d) { //毫秒
- dateArray[6] = Math.round(parseFloat("0." + d) * 1000)
- }
- return ""
- })
- var tzHour = 0
- var tzMin = 0
- trimDate = trimDate.replace(/Z|([+-])(\d\d):?(\d\d)/, function(z, symbol, c, d) {
- dateSetter = oDate.setUTCFullYear
- timeSetter = oDate.setUTCHours
- if (symbol) {
- tzHour = toInt(symbol + c)
- tzMin = toInt(symbol + d)
- }
- return ""
- })
-
- dateArray[3] -= tzHour
- dateArray[4] -= tzMin
- dateSetter.apply(oDate, dateArray.slice(0, 3))
- timeSetter.apply(oDate, dateArray.slice(3))
- date = oDate
- }
- }
- if (typeof date === "number") {
- date = new Date(date)
- }
- if (avalon.type(date) !== "date") {
- return
- }
- while (format) {
- match = rdateFormat.exec(format)
- if (match) {
- parts = parts.concat(match.slice(1))
- format = parts.pop()
- } else {
- parts.push(format)
- format = null
- }
- }
- parts.forEach(function(value) {
- fn = DATE_FORMATS[value]
- text += fn ? fn(date, locate) : value.replace(/(^'|'$)/g, "").replace(/''/g, "'")
- })
- return text
- }
- var locate = {
- AMPMS: {
- 0: "上午",
- 1: "下午"
- },
- DAY: {
- 0: "星期日",
- 1: "星期一",
- 2: "星期二",
- 3: "星期三",
- 4: "星期四",
- 5: "星期五",
- 6: "星期六"
- },
- MONTH: {
- 0: "1月",
- 1: "2月",
- 2: "3月",
- 3: "4月",
- 4: "5月",
- 5: "6月",
- 6: "7月",
- 7: "8月",
- 8: "9月",
- 9: "10月",
- 10: "11月",
- 11: "12月"
- },
- SHORTDAY: {
- "0": "周日",
- "1": "周一",
- "2": "周二",
- "3": "周三",
- "4": "周四",
- "5": "周五",
- "6": "周六"
- },
- fullDate: "y年M月d日EEEE",
- longDate: "y年M月d日",
- medium: "yyyy-M-d H:mm:ss",
- mediumDate: "yyyy-M-d",
- mediumTime: "H:mm:ss",
- "short": "yy-M-d ah:mm",
- shortDate: "yy-M-d",
- shortTime: "ah:mm"
- }
- locate.SHORTMONTH = locate.MONTH
- filters.date.locate = locate
-}// jshint ignore:line
-/*********************************************************************
- * AMD加载器 *
- **********************************************************************/
-//https://www.devbridge.com/articles/understanding-amd-requirejs/
-//http://maxogden.com/nested-dependencies.html
-var modules = avalon.modules = {
- "domReady!": {
- exports: avalon,
- state: 3
- },
- "avalon": {
- exports: avalon,
- state: 4
- }
-}
-
-var otherRequire = window.require
-var otherDefine = window.define
-var innerRequire
-
-plugins.loader = function (builtin) {
- var flag = innerRequire && builtin
- window.require = flag ? innerRequire : otherRequire
- window.define = flag ? innerRequire.define : otherDefine
-}
-//Object(modules[id]).state拥有如下值
-// undefined 没有定义
-// 1(send) 已经发出请求
-// 2(loading) 已经被执行但还没有执行完成,在这个阶段define方法会被执行
-// 3(loaded) 执行完毕,通过onload/onreadystatechange回调判定,在这个阶段checkDeps方法会执行
-// 4(execute) 其依赖也执行完毕, 值放到exports对象上,在这个阶段fireFactory方法会执行
-modules.exports = modules.avalon
-
-new function () {// jshint ignore:line
- var loadings = [] //正在加载中的模块列表
- var factorys = [] //放置define方法的factory函数
- var rjsext = /\.js$/i
- function makeRequest(name, config) {
-//1. 去掉资源前缀
- var res = "js"
- name = name.replace(/^(\w+)\!/, function (a, b) {
- res = b
- return ""
- })
- if (res === "ready") {
- log("debug: ready!已经被废弃,请使用domReady!")
- res = "domReady"
- }
-//2. 去掉querystring, hash
- var query = ""
- name = name.replace(rquery, function (a) {
- query = a
- return ""
- })
- //3. 去掉扩展名
- var suffix = "." + res
- var ext = /js|css/.test(suffix) ? suffix : ""
- name = name.replace(/\.[a-z0-9]+$/g, function (a) {
- if (a === suffix) {
- ext = a
- return ""
- } else {
- return a
- }
- })
- var req = avalon.mix({
- query: query,
- ext: ext,
- res: res,
- name: name,
- toUrl: toUrl
- }, config)
- req.toUrl(name)
- return req
- }
-
- function fireRequest(req) {
- var name = req.name
- var res = req.res
- //1. 如果该模块已经发出请求,直接返回
- var module = modules[name]
- var urlNoQuery = name && req.urlNoQuery
- if (module && module.state >= 1) {
- return name
- }
- module = modules[urlNoQuery]
- if (module && module.state >= 3) {
- innerRequire(module.deps || [], module.factory, urlNoQuery)
- return urlNoQuery
- }
- if (name && !module) {
- module = modules[urlNoQuery] = {
- id: urlNoQuery,
- state: 1 //send
- }
- var wrap = function (obj) {
- resources[res] = obj
- obj.load(name, req, function (a) {
- if (arguments.length && a !== void 0) {
- module.exports = a
- }
- module.state = 4
- checkDeps()
- })
- }
-
- if (!resources[res]) {
- innerRequire([res], wrap)
- } else {
- wrap(resources[res])
- }
- }
- return name ? urlNoQuery : res + "!"
- }
-
-//核心API之一 require
- var requireQueue = []
- var isUserFirstRequire = false
- innerRequire = avalon.require = function (array, factory, parentUrl, defineConfig) {
- if (!isUserFirstRequire) {
- requireQueue.push(avalon.slice(arguments))
- if (arguments.length <= 2) {
- isUserFirstRequire = true
- var queue = requireQueue.splice(0, requireQueue.length), args
- while (args = queue.shift()) {
- innerRequire.apply(null, args)
- }
- }
- return
- }
-
- if (!Array.isArray(array)) {
- avalon.error("require方法的第一个参数应为数组 " + array)
- }
- var deps = [] // 放置所有依赖项的完整路径
- var uniq = {}
- var id = parentUrl || "callback" + setTimeout("1")// jshint ignore:line
- defineConfig = defineConfig || {}
- defineConfig.baseUrl = kernel.baseUrl
- var isBuilt = !!defineConfig.built
- if (parentUrl) {
- defineConfig.parentUrl = parentUrl.substr(0, parentUrl.lastIndexOf("/"))
- defineConfig.mapUrl = parentUrl.replace(rjsext, "")
- }
- if (isBuilt) {
- var req = makeRequest(defineConfig.defineName, defineConfig)
- id = req.urlNoQuery
- } else {
- array.forEach(function (name) {
- var req = makeRequest(name, defineConfig)
- var url = fireRequest(req) //加载资源,并返回该资源的完整地址
- if (url) {
- if (!uniq[url]) {
- deps.push(url)
- uniq[url] = "司徒正美" //去重
- }
- }
- })
- }
-
- var module = modules[id]
- if (!module || module.state !== 4) {
- modules[id] = {
- id: id,
- deps: isBuilt ? array.concat() : deps,
- factory: factory || noop,
- state: 3
- }
- }
- if (!module) {
- //如果此模块是定义在另一个JS文件中, 那必须等该文件加载完毕, 才能放到检测列队中
- loadings.push(id)
- }
- checkDeps()
- }
-
-//核心API之二 require
- innerRequire.define = function (name, deps, factory) { //模块名,依赖列表,模块本身
- if (typeof name !== "string") {
- factory = deps
- deps = name
- name = "anonymous"
- }
- if (!Array.isArray(deps)) {
- factory = deps
- deps = []
- }
- var config = {
- built: !isUserFirstRequire, //用r.js打包后,所有define会放到requirejs之前
- defineName: name
- }
- var args = [deps, factory, config]
- factory.require = function (url) {
- args.splice(2, 0, url)
- if (modules[url]) {
- modules[url].state = 3 //loaded
- var isCycle = false
- try {
- isCycle = checkCycle(modules[url].deps, url)
- } catch (e) {
- }
- if (isCycle) {
- avalon.error(url + "模块与之前的模块存在循环依赖,请不要直接用script标签引入" + url + "模块")
- }
- }
- delete factory.require //释放内存
- innerRequire.apply(null, args) //0,1,2 --> 1,2,0
- }
-//根据标准,所有遵循W3C标准的浏览器,script标签会按标签的出现顺序执行。
-//老的浏览器中,加载也是按顺序的:一个文件下载完成后,才开始下载下一个文件。
-//较新的浏览器中(IE8+ 、FireFox3.5+ 、Chrome4+ 、Safari4+),为了减小请求时间以优化体验,
-//下载可以是并行的,但是执行顺序还是按照标签出现的顺序。
-//但如果script标签是动态插入的, 就未必按照先请求先执行的原则了,目测只有firefox遵守
-//唯一比较一致的是,IE10+及其他标准浏览器,一旦开始解析脚本, 就会一直堵在那里,直接脚本解析完毕
-//亦即,先进入loading阶段的script标签(模块)必然会先进入loaded阶段
- var url = config.built ? "unknown" : getCurrentScript()
- if (url) {
- var module = modules[url]
- if (module) {
- module.state = 2
- }
- factory.require(url)
- } else {//合并前后的safari,合并后的IE6-9走此分支
- factorys.push(factory)
- }
- }
-//核心API之三 require.config(settings)
- innerRequire.config = kernel
- //核心API之四 define.amd 标识其符合AMD规范
- innerRequire.define.amd = modules
-
- //==========================对用户配置项进行再加工==========================
- var allpaths = kernel["orig.paths"] = {}
- var allmaps = kernel["orig.map"] = {}
- var allpackages = kernel["packages"] = []
- var allargs = kernel["orig.args"] = {}
- avalon.mix(plugins, {
- paths: function (hash) {
- avalon.mix(allpaths, hash)
- kernel.paths = makeIndexArray(allpaths)
- },
- map: function (hash) {
- avalon.mix(allmaps, hash)
- var list = makeIndexArray(allmaps, 1, 1)
- avalon.each(list, function (_, item) {
- item.val = makeIndexArray(item.val)
- })
- kernel.map = list
- },
- packages: function (array) {
- array = array.concat(allpackages)
- var uniq = {}
- var ret = []
- for (var i = 0, pkg; pkg = array[i++]; ) {
- pkg = typeof pkg === "string" ? {name: pkg} : pkg
- var name = pkg.name
- if (!uniq[name]) {
- var url = joinPath(pkg.location || name, pkg.main || "main")
- url = url.replace(rjsext, "")
- ret.push(pkg)
- uniq[name] = pkg.location = url
- pkg.reg = makeMatcher(name)
- }
- }
- kernel.packages = ret.sort()
- },
- urlArgs: function (hash) {
- if (typeof hash === "string") {
- hash = {"*": hash}
- }
- avalon.mix(allargs, hash)
- kernel.urlArgs = makeIndexArray(allargs, 1)
- },
- baseUrl: function (url) {
- if (!isAbsUrl(url)) {
- var baseElement = head.getElementsByTagName("base")[0]
- if (baseElement) {
- head.removeChild(baseElement)
- }
- var node = DOC.createElement("a")
- node.href = url
- url = getFullUrl(node, "href")
- if (baseElement) {
- head.insertBefore(baseElement, head.firstChild)
- }
- }
- if (url.length > 3)
- kernel.baseUrl = url
- },
- shim: function (obj) {
- for (var i in obj) {
- var value = obj[i]
- if (Array.isArray(value)) {
- value = obj[i] = {
- deps: value
- }
- }
- if (!value.exportsFn && (value.exports || value.init)) {
- value.exportsFn = makeExports(value)
- }
- }
- kernel.shim = obj
- }
-
- })
-
-
- //==============================内部方法=================================
- function checkCycle(deps, nick) {
- //检测是否存在循环依赖
- for (var i = 0, id; id = deps[i++]; ) {
- if (modules[id].state !== 4 &&
- (id === nick || checkCycle(modules[id].deps, nick))) {
- return true
- }
- }
- }
-
- function checkFail(node, onError, fuckIE) {
- var id = trimQuery(node.src) //检测是否死链
- node.onload = node.onreadystatechange = node.onerror = null
- if (onError || (fuckIE && modules[id] && !modules[id].state)) {
- setTimeout(function () {
- head.removeChild(node)
- node = null // 处理旧式IE下的循环引用问题
- })
- log("debug: 加载 " + id + " 失败" + onError + " " + (!modules[id].state))
- } else {
- return true
- }
- }
-
- function checkDeps() {
- //检测此JS模块的依赖是否都已安装完毕,是则安装自身
- loop: for (var i = loadings.length, id; id = loadings[--i]; ) {
- var obj = modules[id],
- deps = obj.deps
- if (!deps)
- continue
- for (var j = 0, key; key = deps[j]; j++) {
- if (Object(modules[key]).state !== 4) {
- continue loop
- }
- }
- //如果deps是空对象或者其依赖的模块的状态都是2
- if (obj.state !== 4) {
- loadings.splice(i, 1) //必须先移除再安装,防止在IE下DOM树建完后手动刷新页面,会多次执行它
- fireFactory(obj.id, obj.deps, obj.factory)
- checkDeps() //如果成功,则再执行一次,以防有些模块就差本模块没有安装好
- }
- }
- }
-
- var rreadyState = /complete|loaded/
- function loadJS(url, id, callback) {
- //通过script节点加载目标模块
- var node = DOC.createElement("script")
- node.className = subscribers //让getCurrentScript只处理类名为subscribers的script节点
- var supportLoad = "onload" in node
- var onEvent = supportLoad ? "onload" : "onreadystatechange"
- function onload() {
- var factory = factorys.pop()
- factory && factory.require(id)
- if (callback) {
- callback()
- }
- if (checkFail(node, false, !supportLoad)) {
- log("debug: 已成功加载 " + url)
- id && loadings.push(id)
- checkDeps()
- }
- }
- var index = 0, loadID
- node[onEvent] = supportLoad ? onload : function () {
- if (rreadyState.test(node.readyState)) {
- ++index
- if (index === 1) {
- loadID = setTimeout(onload, 500)
- } else {
- clearTimeout(loadID)
- onload()
- }
- }
- }
- node.onerror = function () {
- checkFail(node, true)
- }
-
- head.insertBefore(node, head.firstChild) //chrome下第二个参数不能为null
- node.src = url //插入到head的第一个节点前,防止IE6下head标签没闭合前使用appendChild抛错
- log("debug: 正准备加载 " + url) //更重要的是IE6下可以收窄getCurrentScript的寻找范围
- }
-
- var resources = innerRequire.plugins = {
- //三大常用资源插件 js!, css!, text!, ready!
- ready: {
- load: noop
- },
- js: {
- load: function (name, req, onLoad) {
- var url = req.url
- var id = req.urlNoQuery
- var shim = kernel.shim[name.replace(rjsext, "")]
- if (shim) { //shim机制
- innerRequire(shim.deps || [], function () {
- var args = avalon.slice(arguments)
- loadJS(url, id, function () {
- onLoad(shim.exportsFn ? shim.exportsFn.apply(0, args) : void 0)
- })
- })
- } else {
- loadJS(url, id)
- }
- }
- },
- css: {
- load: function (name, req, onLoad) {
- var url = req.url
- var node = DOC.createElement("link")
- node.rel = "stylesheet"
- node.href = url
- head.insertBefore(node, head.firstChild)
- log("debug: 已成功加载 " + url)
- onLoad()
- }
- },
- text: {
- load: function (name, req, onLoad) {
- var url = req.url
- var xhr = getXHR()
- xhr.onreadystatechange = function () {
- if (xhr.readyState === 4) {
- var status = xhr.status;
- if (status > 399 && status < 600) {
- avalon.error(url + " 对应资源不存在或没有开启 CORS")
- } else {
- log("debug: 已成功加载 " + url)
- onLoad(xhr.responseText)
- }
- }
- }
- var time = "_=" + (new Date() - 0)
- var _url = url.indexOf("?") === -1 ? url + "?" + time : url + "&" + time
- xhr.open("GET", _url, true)
- if ("withCredentials" in xhr) {//这是处理跨域
- xhr.withCredentials = true
- }
- xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest")//告诉后端这是AJAX请求
- xhr.send()
- log("debug: 正准备加载 " + url)
- }
- }
- }
- innerRequire.checkDeps = checkDeps
-
- var rquery = /(\?[^#]*)$/
- function trimQuery(url) {
- return (url || "").replace(rquery, "")
- }
-
- function isAbsUrl(path) {
- //http://stackoverflow.com/questions/10687099/how-to-test-if-a-url-string-is-absolute-or-relative
- return /^(?:[a-z]+:)?\/\//i.test(String(path))
- }
-
- function getFullUrl(node, src) {
- return"1"[0] ? node[src] : node.getAttribute(src, 4)
- }
-
- function getCurrentScript() {
- // inspireb by https://github.com/samyk/jiagra/blob/master/jiagra.js
- var stack
- try {
- a.b.c() //强制报错,以便捕获e.stack
- } catch (e) { //safari5的sourceURL,firefox的fileName,它们的效果与e.stack不一样
- stack = e.stack
- if (!stack && window.opera) {
- //opera 9没有e.stack,但有e.Backtrace,但不能直接取得,需要对e对象转字符串进行抽取
- stack = (String(e).match(/of linked script \S+/g) || []).join(" ")
- }
- }
- if (stack) {
- /**e.stack最后一行在所有支持的浏览器大致如下:
- *chrome23:
- * at http://113.93.50.63/data.js:4:1
- *firefox17:
- *@http://113.93.50.63/query.js:4
- *opera12:http://www.oldapps.com/opera.php?system=Windows_XP
- *@http://113.93.50.63/data.js:4
- *IE10:
- * at Global code (http://113.93.50.63/data.js:4:1)
- * //firefox4+ 可以用document.currentScript
- */
- stack = stack.split(/[@ ]/g).pop() //取得最后一行,最后一个空格或@之后的部分
- stack = stack[0] === "(" ? stack.slice(1, -1) : stack.replace(/\s/, "") //去掉换行符
- return trimQuery(stack.replace(/(:\d+)?:\d+$/i, "")) //去掉行号与或许存在的出错字符起始位置
- }
- var nodes = head.getElementsByTagName("script") //只在head标签中寻找
- for (var i = nodes.length, node; node = nodes[--i]; ) {
- if (node.className === subscribers && node.readyState === "interactive") {
- var url = getFullUrl(node, "src")
- return node.className = trimQuery(url)
- }
- }
- }
-
- var rcallback = /^callback\d+$/
- function fireFactory(id, deps, factory) {
- var module = Object(modules[id])
- module.state = 4
- for (var i = 0, array = [], d; d = deps[i++]; ) {
- if (d === "exports") {
- var obj = module.exports || (module.exports = {})
- array.push(obj)
- } else {
- array.push(modules[d].exports)
- }
- }
- try {
- var ret = factory.apply(window, array)
- } catch (e) {
- log("执行[" + id + "]模块的factory抛错: ", e)
- }
- if (ret !== void 0) {
- module.exports = ret
- }
- if (rcallback.test(id)) {
- delete modules[id]
- }
- delete module.factory
- return ret
- }
- function toUrl(id) {
- if (id.indexOf(this.res + "!") === 0) {
- id = id.slice(this.res.length + 1) //处理define("css!style",[], function(){})的情况
- }
- var url = id
- //1. 是否命中paths配置项
- var usePath = 0
- var baseUrl = this.baseUrl
- var rootUrl = this.parentUrl || baseUrl
- eachIndexArray(id, kernel.paths, function (value, key) {
- url = url.replace(key, value)
- usePath = 1
- })
- //2. 是否命中packages配置项
- if (!usePath) {
- eachIndexArray(id, kernel.packages, function (value, key, item) {
- url = url.replace(item.name, item.location)
- })
- }
- //3. 是否命中map配置项
- if (this.mapUrl) {
- eachIndexArray(this.mapUrl, kernel.map, function (array) {
- eachIndexArray(url, array, function (mdValue, mdKey) {
- url = url.replace(mdKey, mdValue)
- rootUrl = baseUrl
- })
- })
- }
- var ext = this.ext
- if (ext && usePath && url.slice(-ext.length) === ext) {
- url = url.slice(0, -ext.length)
- }
- //4. 转换为绝对路径
- if (!isAbsUrl(url)) {
- rootUrl = this.built || /^\w/.test(url) ? baseUrl : rootUrl
- url = joinPath(rootUrl, url)
- }
- //5. 还原扩展名,query
- var urlNoQuery = url + ext
- url = urlNoQuery + this.query
- urlNoQuery = url.replace(rquery, function (a) {
- this.query = a
- return ""
- })
- //6. 处理urlArgs
- eachIndexArray(id, kernel.urlArgs, function (value) {
- url += (url.indexOf("?") === -1 ? "?" : "&") + value;
- })
- this.url = url
- return this.urlNoQuery = urlNoQuery
- }
-
- function makeIndexArray(hash, useStar, part) {
- //创建一个经过特殊算法排好序的数组
- var index = hash2array(hash, useStar, part)
- index.sort(descSorterByName)
- return index
- }
-
- function makeMatcher(prefix) {
- return new RegExp('^' + prefix + '(/|$)')
- }
-
- function makeExports(value) {
- return function () {
- var ret
- if (value.init) {
- ret = value.init.apply(window, arguments)
- }
- return ret || (value.exports && getGlobal(value.exports))
- }
- }
-
-
- function hash2array(hash, useStar, part) {
- var array = [];
- for (var key in hash) {
- if (ohasOwn.call(hash, key)) {
- var item = {
- name: key,
- val: hash[key]
- }
- array.push(item)
- item.reg = key === "*" && useStar ? /^/ : makeMatcher(key)
- if (part && key !== "*") {
- item.reg = new RegExp('\/' + key.replace(/^\//, "") + '(/|$)')
- }
- }
- }
- return array
- }
-
- function eachIndexArray(moduleID, array, matcher) {
- array = array || []
- for (var i = 0, el; el = array[i++]; ) {
- if (el.reg.test(moduleID)) {
- matcher(el.val, el.name, el)
- return false
- }
- }
- }
- // 根据元素的name项进行数组字符数逆序的排序函数
- function descSorterByName(a, b) {
- var aaa = a.name
- var bbb = b.name
- if (bbb === "*") {
- return -1
- }
- if (aaa === "*") {
- return 1
- }
- return bbb.length - aaa.length
- }
-
- var rdeuce = /\/\w+\/\.\./
- function joinPath(a, b) {
- if (a.charAt(a.length - 1) !== "/") {
- a += "/"
- }
- if (b.slice(0, 2) === "./") { //相对于兄弟路径
- return a + b.slice(2)
- }
- if (b.slice(0, 2) === "..") { //相对于父路径
- a += b
- while (rdeuce.test(a)) {
- a = a.replace(rdeuce, "")
- }
- return a
- }
- if (b.slice(0, 1) === "/") {
- return a + b.slice(1)
- }
- return a + b
- }
-
- function getGlobal(value) {
- if (!value) {
- return value
- }
- var g = window
- value.split(".").forEach(function (part) {
- g = g[part]
- })
- return g
- }
-
- var mainNode = DOC.scripts[DOC.scripts.length - 1]
- var dataMain = mainNode.getAttribute("data-main")
- if (dataMain) {
- plugins.baseUrl(dataMain)
- var href = kernel.baseUrl
- kernel.baseUrl = href.slice(0, href.lastIndexOf("/") + 1)
- loadJS(href.replace(rjsext, "") + ".js")
- } else {
- var loaderUrl = trimQuery(getFullUrl(mainNode, "src"))
- kernel.baseUrl = loaderUrl.slice(0, loaderUrl.lastIndexOf("/") + 1)
- }
-}// jshint ignore:line
-
-/*********************************************************************
- * DOMReady *
- **********************************************************************/
-
-var readyList = [], isReady
-var fireReady = function(fn) {
- isReady = true
- var require = avalon.require
- if (require && require.checkDeps) {
- modules["domReady!"].state = 4
- require.checkDeps()
- }
- while(fn = readyList.shift()){
- fn(avalon)
- }
-}
-
-function doScrollCheck() {
- try { //IE下通过doScrollCheck检测DOM树是否建完
- root.doScroll("left")
- fireReady()
- } catch (e) {
- setTimeout(doScrollCheck)
- }
-}
-
-if (DOC.readyState === "complete") {
- setTimeout(fireReady) //如果在domReady之外加载
-} else if (W3C) {
- DOC.addEventListener("DOMContentLoaded", fireReady)
-} else {
- DOC.attachEvent("onreadystatechange", function() {
- if (DOC.readyState === "complete") {
- fireReady()
- }
- })
- try {
- var isTop = window.frameElement === null
- } catch (e) {
- }
- if (root.doScroll && isTop && window.external) {//fix IE iframe BUG
- doScrollCheck()
- }
-}
-avalon.bind(window, "load", fireReady)
-
-avalon.ready = function(fn) {
- if (!isReady) {
- readyList.push(fn)
- } else {
- fn(avalon)
- }
-}
-
-avalon.config({
- loader: true
-})
-
-avalon.ready(function() {
- avalon.scan(DOC.body)
-})
-
-// Register as a named AMD module, since avalon can be concatenated with other
-// files that may use define, but not via a proper concatenation script that
-// understands anonymous AMD modules. A named AMD is safest and most robust
-// way to register. Lowercase avalon is used because AMD module names are
-// derived from file names, and Avalon is normally delivered in a lowercase
-// file name. Do this after creating the global so that if an AMD module wants
-// to call noConflict to hide this version of avalon, it will work.
-
-// Note that for maximum portability, libraries that are not avalon should
-// declare themselves as anonymous modules, and avoid setting a global if an
-// AMD loader is present. avalon is a special case. For more information, see
-// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
- if (typeof define === "function" && define.amd) {
- define("avalon", [], function() {
- return avalon
- })
- }
-// Map over avalon in case of overwrite
- var _avalon = window.avalon
- avalon.noConflict = function(deep) {
- if (deep && window.avalon === avalon) {
- window.avalon = _avalon
- }
- return avalon
- }
-// Expose avalon identifiers, even in AMD
-// and CommonJS for browser emulators
- if (noGlobal === void 0) {
- window.avalon = avalon
- }
-
- return avalon
-
-})); \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/js/commonUtil.js b/umc-iui/src/main/resources/webroot/umc-pm/js/commonUtil.js
deleted file mode 100644
index 0de17e19..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/js/commonUtil.js
+++ /dev/null
@@ -1,69 +0,0 @@
-var commonUtil = {};
-commonUtil.sendSynRequest=function(url) {
- var response;
-
- $.ajax({
- "type": 'get',
- "url": url,
- "dataType": "json",
- "async": false,
-
- success: function (resp) {
- response = resp;
- return response;
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- //commonUtil.growl("", "发送同步消息失败. url=" + url + ". " + textStatus + ":" + errorThrown, "warning");
- }
- });
-}
-commonUtil.strToJson = function (str) {
- var json = eval('(' + str + ')');
- return json;
-}
-/**commonUtil.growl=function(title, message, type){
- $.growl({
- icon: "fa fa-envelope-o fa-lg",
- title: "&nbsp;&nbsp;提示: "+title,
- message: message+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
- },{
- type: type
- });
-}**/
-
-commonUtil.arrayRemove = function (aryInstance, index) {
- if (aryInstance == undefined || aryInstance == null) {
- return;
- }
- for (var i = 0, n = 0; i < aryInstance.length; i++) {
- if (aryInstance[i] != aryInstance[dx]) {
- aryInstance[n++] = aryInstance[i];
- }
- }
- aryInstance.length -= 1;
-};
-
-//对Date的扩展,将 Date 转化为指定格式的String
-// 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
-// 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1 个占位符(是 1-3 位的数字)
-// 例子:
-// (new Date()).Format("yyyy-MM-dd hh:mm:ss.S") ==> 2006-07-02 08:09:04.423
-// (new Date()).Format("yyyy-M-d h:m:s.S") ==> 2006-7-2 8:9:4.18
-commonUtil.parseDate = function (dateObj, format) {
- var o = {
- "M+": dateObj.getMonth() + 1, //month
- "d+": dateObj.getDate(), //day
- "h+": dateObj.getHours(), //hour
- "m+": dateObj.getMinutes(), //minute
- "s+": dateObj.getSeconds(), //second
- "q+": Math.floor((dateObj.getMonth() + 3) / 3), //quarter
- "S": dateObj.getMilliseconds() //millisecond
- }
- if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
- (dateObj.getFullYear() + "").substr(4 - RegExp.$1.length));
- for (var k in o)
- if (new RegExp("(" + k + ")").test(format))
- format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] :
- ("00" + o[k]).substr(("" + o[k]).length));
- return format;
-};
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/js/dataRangeUtil.js b/umc-iui/src/main/resources/webroot/umc-pm/js/dataRangeUtil.js
deleted file mode 100644
index 96964fa3..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/js/dataRangeUtil.js
+++ /dev/null
@@ -1,354 +0,0 @@
-var dataRangeUtil={};
-/*
-
- 初始化组件
-
- @param parentId 父组件的ID。
-
- @param dataRangeId 插入的日历组件的ID
-
- */
-
-dataRangeUtil.initDataRang = function (parentId, dataRangeId, title, vm) {
- //拼接插入的html
- var htmlStr = jointDataRange(dataRangeId, title);
- $('#' + parentId).append(htmlStr);
-
- //调用datarangepicker组件生成 datarange
- setDateRange(dataRangeId, vm);
-
- //增加日期文本框数值按钮点击事件
- $('button[upname=' + dataRangeId + ']').click(function () {
- //当复选框选中时
- if($('#'+dataRangeId+'Check').parent().hasClass('checked')){
- var num = $(this).parent().prev('input[type="text"]').eq(0).val();
- var type = $(this).parent().parent().next().val();
- $(this).parent().prev('input[type="text"]').val(parseInt(num) + 1);
- $('#' + dataRangeId).val(reduceDate(new Date(), (parseInt(num) + 1), type) + ' - ' + new Date().format('yyyy-MM-dd'));
- setTime($('#' + dataRangeId));
- }
- })
-
- //减少日期文本框数值按钮点击事件
- $('button[downname=' + dataRangeId + ']').click(function () {
- //当复选框选中时
- if($('#'+dataRangeId+'Check').parent().hasClass('checked')){
- var num = $(this).parent().prev('input[type="text"]').eq(0).val();
- var type = $(this).parent().parent().next().val();
- if (parseInt(num) > 0) {
- $(this).parent().prev('input[type="text"]').val(parseInt(num) - 1);
- $('#' + dataRangeId).val(reduceDate(new Date(), (parseInt(num) - 1), type) + ' - ' + new Date().format('yyyy-MM-dd'));
- setTime($('#' + dataRangeId));
- }
- }
- });
-
- $('input[tname=' + dataRangeId + ']').keyup(function () {
- //如果输入非数字,则替换为'',如果输入数字,则在每4位之后添加一个空格分隔
- this.value = this.value.replace(/[^\d]/g, '');
- })
- //文本框输入数字失去焦点后的事件
- $('input[tname=' + dataRangeId + ']').blur(function () {
- //当复选框选中时
- if($('#'+dataRangeId+'Check').parent().hasClass('checked')){
- var type = $(this).parent().next().val();
- var num = $(this).val();
- $('#' + dataRangeId).val(reduceDate(new Date(), (parseInt(num)), type) + ' - ' + new Date().format('yyyy-MM-dd'));
- setTime($('#' + dataRangeId));
- }
- })
- //文本框按下键盘的事件
- $('input[tname=' + dataRangeId + ']').keydown(function (e) {
- //当复选框选中时
- if($('#'+dataRangeId+'Check').parent().hasClass('checked')){
- if (e.keyCode == 13) {
- var type = $(this).parent().next().val();
- var num = $(this).val();
- $('#' + dataRangeId).val(reduceDate(new Date(), (parseInt(num)), type) + ' - ' + new Date().format('yyyy-MM-dd'));
- setTime($('#' + dataRangeId));
- }
- }
- });
-
- //天、周、月、年下拉框内容改变事件。
- $('select[sname=' + dataRangeId + ']').change(function () {
- //当复选框选中时
- if($('#'+dataRangeId+'Check').parent().hasClass('checked')){
- var num = $('input[tname=' + dataRangeId + ']').val();
- var type = $(this).val();
- $('#' + dataRangeId).val(reduceDate(new Date(), (parseInt(num)), type) + ' - ' + new Date().format('yyyy-MM-dd'));
- var a=$('input[ckeckItemId='+dataRangeId+']');
- setTime($('#' + dataRangeId));
- }
- })
-
-
- $('#'+dataRangeId+'Check').on('ifClicked',function(){
- var flag=$(this).parent().hasClass('checked');
- if(!flag){//被选中
- var relId=$(this).attr('ckeckitemid');
- if(relId=="dataRangeLocation"){
- vm.dataRangeLocationDisabled=false;
- }else if(relId=="dataRangeType"){
- vm.dataRangeTypeDisabled=false;
- }else{
- vm.dataRangeDisabled=false;
- }
- setTime($('#' + dataRangeId));
- }else{//未选中
- var relId=$(this).attr('ckeckitemid');
- if(relId=="dataRangeLocation"){
- vm.dataRangeLocationDisabled=true;
- }else if(relId=="dataRangeType"){
- vm.dataRangeTypeDisabled=true;
- }else{
- vm.dataRangeDisabled=true;
- }
- $('#' + dataRangeId).val('');//清空日历text里的信息。
- $('select[sname=' + dataRangeId + '] option').eq(0).attr('selected', 'true');//设置初始化下拉框
- $('input[tname=' + dataRangeId + ']').val('1'); //初始化text里的内容
- }
- })
-}
-
-/*根据ID拼接 datarange的html*/
-function jointDataRange(dataRangeId, title) {
- var htmlStr = '<input value="请选择时间" dtitle="' + title + '" id="' + dataRangeId + '"type="select" class="btn btn-default dropdown-toggle dataRange" data-toggle="dropdown"></label></div>';
- return htmlStr;
-}
-
-/*
- 设置dataRang组件的开始时间,结束时间。
- @param dataRangeId 组件ID
- @param startTime 开始时间 String 类型 yyyy-MM-dd
- @param endTime 结束时间 String 类型 yyyy-MM-dd
- */
-
-dataRangeUtil.setDataRangeValue = function (dataRangeId, startTime, endTime) {
- $('input[id="' + dataRangeId + '"]').val(startTime + " - " + endTime);
- if(!$('#'+dataRangeId+'Check').parent().hasClass("checked")){ //如果未被选中
- vm.dataRangeDisabled=false;
- $('#'+dataRangeId+'Check').iCheck('check');
- }
-
-}
-
-
-
-/*
-
- 获取dataRange组件的开始时间结束时间。
-
- @param dataRangeId 组件ID
-
-
-
- */
-
-dataRangeUtil.getDataRangeValue = function (dataRangeId) {
-
-
-
- var value = $('#' + dataRangeId).val();
-
- var arr = value.split(" - ");//空格必须有
-
- return arr;
-
-}
-
-
-
-
-
-//调用datarangepicker组件生成 datarange
-
-setDateRange = function (dataRangeId, vm) {
- var open = 'right';
- var month = "月";
- var optionSet1 = {
- //startDate: moment().subtract(179, 'days'),
- //endDate: moment(),
- startDate: "2015-08-02",
- endDate: "2015-08-03",
- format: 'YYYY-MM-DD',
- dateLimit: {days: 180},
- showWeekNumbers: false,
- opens: open,
- separator: ' - ',
- locale: {
- applyLabel: "确定",
- cancelLabel: "取消",
- fromLabel: "从",
- toLabel: "到",
- customRangeLabel: "自定义",
- daysOfWeek: [
- "日",
- "一",
- "二",
- "三",
- "四",
- "五",
- "六"],
- monthNames: ['1' + month, '2' + month, '3' + month, '4' + month, '5' + month, '6' + month, '7' + month, '8' + month, '9' + month, '10' + month, '11' + month, '12' + month],
- firstDay: 1
-
- }
-
- };
-
- $('input[id="' + dataRangeId + '"]').bind('apply.daterangepicker', function () {
- //获取时间范围,查询
- // 都设置为0点
- setTime($(this));
- });
- $('input[id="' + dataRangeId + '"]').daterangepicker(optionSet1);
-};
-
-
-
-
-
-/*格式化日期*/
-
-Date.prototype.format = function (format) {
-
- /*
-
- * format="yyyy-MM-dd hh:mm:ss";
-
- */
-
- var o = {
-
- "M+": this.getMonth() + 1,
-
- "d+": this.getDate(),
-
- "h+": this.getHours(),
-
- "m+": this.getMinutes(),
-
- "s+": this.getSeconds(),
-
- "q+": Math.floor((this.getMonth() + 3) / 3),
-
- "S": this.getMilliseconds()
-
- }
-
-
-
- if (/(y+)/.test(format)) {
-
- format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4
-
- - RegExp.$1.length));
-
- }
-
-
-
- for (var k in o) {
-
- if (new RegExp("(" + k + ")").test(format)) {
-
- format = format.replace(RegExp.$1, RegExp.$1.length == 1
-
- ? o[k]
-
- : ("00" + o[k]).substr(("" + o[k]).length));
-
- }
-
- }
-
- return format;
-
-}
-
-function setTime($obj) {
- var title = $obj.attr('dtitle');
- var arr = $obj.val().split(' - ');
- //排除日历组件空字符串的情况。
-
- if(arr[0]!=''){
-
- var starTime = new Date(arr[0].replace(/-/g, "/")).getTime();
-
- var endTime = new Date(arr[1].replace(/-/g, "/")).getTime();
-
-
-
- if (title == "确认时间") {
-
- vm.fmConds.ackTimeStarTime = starTime;
-
- vm.fmConds.ackTimeEndTime = endTime;
-
- } else if (title == "发生时间") {
-
- vm.fmConds.alarmRaisedStartTime = starTime;
-
- vm.fmConds.alarmRaisedEndTime = endTime;
-
- } else if (title == "清除时间") {
-
- vm.fmConds.clearedTimeStarTime = starTime;
-
- vm.fmConds.clearedTimeEndTime = endTime;
-
- }
-
- refreshByCond();
-
- }
-
-}
-
-/*
- @param type 1 day 2 week 3 month 4 year
- */
-function reduceDate(date, val, type) {
-
- var d = new Date(date);
-
- if (type == 'day') {
-
- d.setDate(d.getDate() - val);
-
- } else if (type == 'week') {
-
- d.setDate(d.getDate() - val * 7);
-
- } else if (type == 'month') {
-
- d.setMonth(d.getMonth() - val);
-
- } else if (type == 'year') {
-
- d.setFullYear(d.getFullYear() - val);
-
- }
-
- var month = d.getMonth() + 1;
-
- var day = d.getDate();
-
- if (month < 10) {
-
- month = "0" + month;
-
- }
-
- if (day < 10) {
-
- day = "0" + day;
-
- }
-
- var val = d.getFullYear() + "-" + month + "-" + day;
-
- return val;
-
-}
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/js/delete.me b/umc-iui/src/main/resources/webroot/umc-pm/js/delete.me
deleted file mode 100644
index e69de29b..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/js/delete.me
+++ /dev/null
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/js/i18n/loadi18n.js b/umc-iui/src/main/resources/webroot/umc-pm/js/i18n/loadi18n.js
deleted file mode 100644
index 5a97de8d..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/js/i18n/loadi18n.js
+++ /dev/null
@@ -1,23 +0,0 @@
-var lang = getLanguage();
-function loadProperties(lang){
- jQuery.i18n.properties({
- language:lang,
- name:'ngict-pm-iui-i18n',
- path:'i18n/',
- mode:'map',
- callback: function() {
- var i18nItems = $("[name_i18n=com_zte_ums_ngict_pm]");
- for(var i=0;i<i18nItems.length;i++){
- var $item = $(i18nItems.eq(i));
- var itemId = $item.attr('id');
- if(typeof($item.attr("title"))!="undefined"){
- $item.attr("title", $.i18n.prop(itemId));
- }else{
- $item.text($.i18n.prop(itemId));
- }
- }
- }
- });
-}
-
-
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/js/index/indexController.js b/umc-iui/src/main/resources/webroot/umc-pm/js/index/indexController.js
deleted file mode 100644
index 4e9117fb..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/js/index/indexController.js
+++ /dev/null
@@ -1,228 +0,0 @@
-var pm = {};
-pm.index = {};
-pm.index.vm = avalon.define({
- $id: "indexController",
- viewVisible: true,
- indexVisible: false,
- rtnVisible: false,
- title:$.i18n.prop('com_zte_ums_ict_pm_index_indexManagement'),
- resTypeArray : [],
- selectedResourceType : "",
-
- moTypeArray:[],
- selectedMoType:"",
-
- counterArray:[],
- selectedCounter:"",
-
- indexName:"",
-
- dataTypeArray:[
- {id:"STRING",name:"字符串"},
- {id:"INT",name:"整型"},
- {id:"FLOAT",name:"浮点数"},
- {id:"LONG",name:"长整型"},
- {id:"DATE",name:"时间类型"},
- {id:"PERSENT",name:"百分比"}
- ],
- selectedDataType:"",
-
- strExpresstion:"",
- indexDescription:"",
-
- countArray:[
- {count:[7,8,9,"+"]},
- {count:[4,5,6,"-"]},
- {count:[1,2,3,"*"]},
- {count:[0,"00",".","/"]},
- ],
-
- $indexTableFields: [
- {"mData": "id", name: "ID", "bVisible": false},
- {"mData": "name", sWidth: "15%", name: $.i18n.prop('com_zte_ums_ict_pm_index_indexName'),"fnRender": pmUtil.indexNameLink},
- {
- "mData": "dataType",
- sWidth: "10%",
- name: $.i18n.prop('com_zte_ums_ict_pm_index_dataType'),
- "fnRender":pmUtil.dataTypeRender
- },
- {
- "mData": "moType.name",
- sWidth: "20%",
- name: $.i18n.prop('com_zte_ums_ict_pm_index_moType')
- },
- {
- "mData": "resourceType.name",
- sWidth: "17%",
- name: $.i18n.prop('com_zte_ums_ict_pm_index_resourceType')
- },
-
- {
- "mData": "strExpression",
- sWidth: "17%",
- name: $.i18n.prop('com_zte_ums_ict_pm_index_strExpresstion')
- },
- {
- "mData": "operate",
- sWidth: "17%",
- name: $.i18n.prop('com_zte_ums_ict_pm_index_operate'),
- "fnRender": pmUtil.indexOperate
- }
- ] ,
- $language: {
- "sProcessing": "<img src='/web/newict/framework/thirdparty/data-tables/images/loading-spinner-grey.gif'/><span>&nbsp;&nbsp;处理中...</span>",
- "sLengthMenu": $.i18n.prop("ngict-log-iui-table-sLengthMenu"),
- "sZeroRecords": $.i18n.prop("ngict-log-iui-table-sZeroRecords"),
- "sInfo": "<span class='seperator'> </span>" + $.i18n.prop("ngict-log-iui-table-sInfo"),
- "sInfoEmpty": $.i18n.prop("ngict-log-iui-table-sInfoEmpty"),
- "sGroupActions": $.i18n.prop("ngict-log-iui-table-sGroupActions"),
- "sAjaxRequestGeneralError":$.i18n.prop("ngict-log-iui-table-sAjaxRequestGeneralError"),
- "sEmptyTable": $.i18n.prop("ngict-log-iui-table-sEmptyTable"),
- "oPaginate": {
- "sPrevious": $.i18n.prop("ngict-log-iui-table-sPrevious"),
- "sNext": $.i18n.prop("ngict-log-iui-table-sNext"),
- "sPage": $.i18n.prop("ngict-log-iui-table-sPage"),
- "sPageOf": $.i18n.prop("ngict-log-iui-table-sPageOf")
- }
- },
- $initTable: function () {
- viewVisible=true;
- indexVisible=false;
- var setting = {};
- setting.language = pm.index.vm.$language;
- setting.columns = pm.index.vm.$indexTableFields;
- setting.pageHtml="<<'col-md-6 col-sm-6 addBtn'><r><'table-scrollable't><'row page-info-bottom'<'col-md-12 col-sm-12'lip>>>";
- setting.restUrl ="/api/umcpm/v1/motype/indexes";
- setting.tableId = "ict_index_table";
- serverPageTable.initDataTable(setting, 'ict_index_table_div' );
- $addBtn = $("<button id='addIndex' class='btn white radius_l' onclick=\"pmUtil.addIndex()\"><i class=\"ict-new \"></i>"+$.i18n.prop("com_zte_ums_ict_pm_action_add")+"</button>");
- $('.addBtn').append($addBtn);
- },
- resTypeSelectAction:function(){
- getMoTypeArray(getIdFromName(pm.index.vm.selectedResourceType,pm.index.vm.resTypeArray));
- pm.index.vm.counterArray=[];
- },
- moTypeSelectAction:function(obj){
- var resourceTypeId=getIdFromName(pm.index.vm.selectedResourceType,pm.index.vm.resTypeArray);
- var moTypeId=$(obj).val();
- pm.index.vm.selectedMoType=moTypeId;
- getCounterArray(resourceTypeId,moTypeId);
- },
- counterSelectAction:function(obj){
- var counterId=$(obj).val();
- pm.index.vm.selectedCounter=counterId;
- pm.index.vm.indexDescription+=pm.index.vm.selectedCounter;
- },
- countClick:function(obj){
- pm.index.vm.indexDescription+=obj.value;
- },
- countDel:function(){
- pm.index.vm.indexDescription=pm.index.vm.indexDescription.substring(0,(pm.index.vm.indexDescription.length-1));
- },
- returnListPage : function(){
- window.location.href="./indexView.html";
- },
- submit:function(){
- submitIndex();
- }
- });
- //avalon.scan();
-
-
-
-
- pm.index.vm.$watch("indexDescription", function(newValue, oldValue){
- var bitArray=["+","-","*","/"];
- var intArray=["0","1","2","3","4","5","6","7","8","9","00"];
- //第一个输入参数若非计数器,就给出提示
- if(!oldValue){
- if(newValue.substring(0,1)!='C'){
- pm.index.vm.strExpresstion="公式解析错:公式中必须包含符合如下格式的计数器:计数器以'C'开头,'C'后面为取值范围在[1,4294967294]之间且为整数的计数器标识。";
- }
- else{
- pm.index.vm.strExpresstion=newValue;
- }
- }
- //如果公式text为空,那也清空“公式描述”列
- if(!newValue){
- pm.index.vm.strExpresstion="";
- }
- if(oldValue&&newValue){
- var newLength=newValue.length;
- var oldLength=oldValue.length;
- //若长度相差大于一,说明添加的是计数器id
- if(newLength-oldLength>1){
- if(bitArray.indexOf(oldValue.substring(oldLength-1,oldLength))<0){
- pm.index.vm.strExpresstion="公式解析错:字符'C'后面必须为取值范围在[1,999999999]之间且为整数的计数器标识";
- }
- else{
- pm.index.vm.strExpresstion=newValue;
- }
- }
- else{
- var oldValueArray=oldValue.split(/[+-/*]/);
- //若最后两个字符均为运算符
- if(bitArray.indexOf(newValue.substring(newLength-1,newLength))>=0
- &&bitArray.indexOf(newValue.substring(newLength-2,newLength-1))>=0){
- pm.index.vm.strExpresstion="公式解析错:两个运算符不能相连。";
- }
- //若最后一个字符为数字,且前面是计数器的情况
- else if(intArray.indexOf(newValue.substring(newLength-1,newLength))>=0){
- if(getObjFromId(oldValueArray[oldValueArray.length-1],pm.index.vm.counterArray)){
- pm.index.vm.strExpresstion="公式解析错:该测量类型下不存在此ID的计数器。";
- }
- }
- else{
- pm.index.vm.strExpresstion=newValue;
- }
- }
- }
-
-
- })
-
-
- //初始化table
- pm.index.vm.$initTable();
-
-
-
- function fnServerData(sSource, aoData, fnCallback, oSettings) {
- oSettings.jqXHR = $.ajax({
- "type": 'get',
- "url": sSource,
- "dataType": "json",
- "success": function (resp) {
- oSettings.iDraw = oSettings.iDraw + 1;
- var data = {};
- data.aaData = resp.content;
- data.iTotalRecords = resp.content.length;
- data.iTotalDisplayRecords = resp.content.length;
- data.sEcho = oSettings;
- for(var i=0;i<data.aaData.length;i++){
- //data.aaData[i].indexName=data.aaData[i].name;
- }
- fnCallback(data);
-
- },
- "error":function(resp){
- var data = {};
- fnCallback(data);
- }
- });
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/js/index/indexManage.js b/umc-iui/src/main/resources/webroot/umc-pm/js/index/indexManage.js
deleted file mode 100644
index 10f1eb92..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/js/index/indexManage.js
+++ /dev/null
@@ -1,187 +0,0 @@
-var index={};
-newIndexWizard = function (idx,action) {
- //ȡԴ
- getResTypeArray();
- var resourceTypeId;
- var moTypeId;
- if(idx){
- index=idx;
- pm.index.vm.selectedResourceType=index.resourceType.name;
- resourceTypeId=index.resourceType.id;
-
- pm.index.vm.selectedMoType=index.moType.name;
- moTypeId=index.moType.id;
-
- pm.index.vm.indexName=index.name;
- pm.index.vm.indexDescription=index.indexDes;
- pm.index.vm.strExpresstion=index.strExpression;
- pm.index.vm.selectedDataType=getNameFromId(index.dataType,pm.index.vm.dataTypeArray);
- }else{
- //ĬȡԴһIJ
- pm.index.vm.selectedResourceType=pm.index.vm.resTypeArray[0].name;
- resourceTypeId=pm.index.vm.resTypeArray[0].id;
- pm.index.vm.selectedDataType=pm.index.vm.dataTypeArray[0].name;
- }
- getMoTypeArray( pm.index.vm.resTypeArray[0].id);
- getCounterArray(resourceTypeId,moTypeId);
-
- $(function () {
- setTimeout(function(){
- var height = $(".creat-index").height();
- $(".fixed_side").height(height);
- $('input[name=moType]').attr("checked", moTypeId);
- if(action=="query"){
- $("input").attr("disabled", true);
- $("select").attr("disabled", true);
- $('input[name=moType]').attr("disabled", true);
- $('#counterDiv').hide();
- $('.countTable').hide();
- }
- //
- if ($(".fixed_side").length > 0) {
- var offset = $(".fixed_side").offset();
- var width = $(".fixed_side").width();
- $(window).scroll(function () {
- var scrollTop = $(window).scrollTop();
- //붥ľСľ룬fixedԡ
- if (offset.top < scrollTop) {
- $(".fixed_side").addClass("fixed");
- $(".fixed_side").width(width);
- } else { //fixed
- $(".fixed_side").removeClass("fixed");
- }
- });
- }
- }, 100);
-
-});
-
-
-}
- function getResTypeArray(){
- var url="/api/umcpm/v1/resourcetypes";
- $.ajax({
- "type": 'get',
- "url": url,
- "dataType": "json",
- "async": false,
- "success": function (resp) {
- pm.index.vm.resTypeArray= resp.content;
- },
- "error":function(resp){
- // pm.index.vm.ResTypeArray=resp;
- }
- });
- }
- function getMoTypeArray(resourceTypeId){
- if(resourceTypeId){
- //ȡ
- var url="/api/umcpm/v1/moTypes";
- var data={};
- data.resourceTypeId=resourceTypeId;
- $.ajax({
- "type": 'get',
- "url": url,
- data:data,
- "dataType": "json",
- "async": false,
- "success": function (resp) {
- pm.index.vm.moTypeArray= resp.content;
- },
- "error":function(resp){
- // pm.index.vm.ResTypeArray=resp;
- }
- });
- }
- }
- function getCounterArray(resourceTypeId,MoTypeId){
- if(resourceTypeId&&MoTypeId){
- var url="/api/umcpm/v1/motype/"+MoTypeId+"/counters";
- var data={};
- data.resourceTypeId=resourceTypeId;
- data.moTypeId=MoTypeId;
- $.ajax({
- "type": 'get',
- "url": url,
- "dataType": "json",
- data:data,
- "async": false,
- "success": function (resp) {
- pm.index.vm.counterArray= resp.content;
- },
- "error":function(resp){
- // pm.index.vm.ResTypeArray=resp;
- }
- });
- }
- }
- function getIdFromName(name,array){
- for(var i=0;i<array.length;i++){
- if(array[i].name==name){
- return array[i].id;
- }
- }
- }
- function getNameFromId(id,array){
- for(var i=0;i<array.length;i++){
- if(array[i].id==id){
- return array[i].name;
- }
- }
- }
- function getObjFromId(id,array){
- for(var i=0;i<array.length;i++){
- if(array[i].id==id){
- return array[i];
- }
- }
- return "";
- }
- function getObjFromName(name,array){
- for(var i=0;i<array.length;i++){
- if(array[i].name==name){
- return array[i];
- }
- }
- }
- function submitIndex(){
- //ȡ
- var selectedResourceType=getObjFromName(pm.index.vm.selectedResourceType,pm.index.vm.resTypeArray);
- var resourceType={};
- resourceType.id=selectedResourceType.id;
- resourceType.name=selectedResourceType.name;
- var selectedMoType=getObjFromId(pm.index.vm.selectedMoType,pm.index.vm.moTypeArray);
- var moType={};
- moType.id=selectedMoType.id;
- moType.name=selectedMoType.name;
- var id;
- var type="post";
- if(index){
- id=index.id;
- type="put";
- }
- var data = {
- id:id,
- name: pm.index.vm.indexName,
- indexDes: pm.index.vm.indexDescription,
- strExpresstion: pm.index.vm.strExpresstion,
- dataType: getIdFromName(pm.index.vm.selectedDataType,pm.index.vm.dataTypeArray),
- resourceType: resourceType,
- moTypes: moType
- }
-
- $.ajax({
- "dataType": 'json',
- "type": type,
- "url": "/api/umcpm/v1/motype/"+moType.id+"/indexes",
- "data": JSON.stringify(data),
- "contentType": 'application/json; charset=utf-8',
- "success": function (result, textStatus, jqXHR) {
-
- },
- "error": function () {
-
- }
- });
- }
- \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/js/meatask/echarts.js b/umc-iui/src/main/resources/webroot/umc-pm/js/meatask/echarts.js
deleted file mode 100644
index 19bb00d1..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/js/meatask/echarts.js
+++ /dev/null
@@ -1,54502 +0,0 @@
-(function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory();
- else if(typeof define === 'function' && define.amd)
- define([], factory);
- else if(typeof exports === 'object')
- exports["echarts"] = factory();
- else
- root["echarts"] = factory();
-})(this, function() {
-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 = "";
-
-/******/ // Load entry module and return exports
-/******/ return __webpack_require__(0);
-/******/ })
-/************************************************************************/
-/******/ ([
-/* 0 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Export echarts as CommonJS module
- */
- module.exports = __webpack_require__(1);
-
- // Import all charts and components
- __webpack_require__(91);
- __webpack_require__(127);
- __webpack_require__(132);
- __webpack_require__(141);
- __webpack_require__(145);
-
- __webpack_require__(155);
- __webpack_require__(177);
- __webpack_require__(189);
- __webpack_require__(207);
- __webpack_require__(211);
- __webpack_require__(215);
- __webpack_require__(230);
- __webpack_require__(236);
- __webpack_require__(243);
- __webpack_require__(249);
- __webpack_require__(253);
- __webpack_require__(258);
-
- __webpack_require__(106);
- __webpack_require__(262);
- __webpack_require__(268);
- __webpack_require__(272);
- __webpack_require__(283);
- __webpack_require__(216);
-
- __webpack_require__(285);
-
- __webpack_require__(286);
- __webpack_require__(300);
-
- __webpack_require__(315);
- __webpack_require__(319);
-
- __webpack_require__(322);
- __webpack_require__(331);
-
- __webpack_require__(345);
-
-
-/***/ },
-/* 1 */
-/***/ function(module, exports, __webpack_require__) {
-
- /*!
- * ECharts, a javascript interactive chart library.
- *
- * Copyright (c) 2015, Baidu Inc.
- * All rights reserved.
- *
- * LICENSE
- * https://github.com/ecomfe/echarts/blob/master/LICENSE.txt
- */
-
- /**
- * @module echarts
- */
-
-
- var GlobalModel = __webpack_require__(2);
- var ExtensionAPI = __webpack_require__(24);
- var CoordinateSystemManager = __webpack_require__(25);
- var OptionManager = __webpack_require__(26);
-
- var ComponentModel = __webpack_require__(19);
- var SeriesModel = __webpack_require__(27);
-
- var ComponentView = __webpack_require__(28);
- var ChartView = __webpack_require__(41);
- var graphic = __webpack_require__(42);
-
- var zrender = __webpack_require__(77);
- var zrUtil = __webpack_require__(3);
- var colorTool = __webpack_require__(38);
- var env = __webpack_require__(78);
- var Eventful = __webpack_require__(32);
-
- var each = zrUtil.each;
-
- var VISUAL_CODING_STAGES = ['echarts', 'chart', 'component'];
-
- // TODO Transform first or filter first
- var PROCESSOR_STAGES = ['transform', 'filter', 'statistic'];
-
- function createRegisterEventWithLowercaseName(method) {
- return function (eventName, handler, context) {
- // Event name is all lowercase
- eventName = eventName && eventName.toLowerCase();
- Eventful.prototype[method].call(this, eventName, handler, context);
- };
- }
- /**
- * @module echarts~MessageCenter
- */
- function MessageCenter() {
- Eventful.call(this);
- }
- MessageCenter.prototype.on = createRegisterEventWithLowercaseName('on');
- MessageCenter.prototype.off = createRegisterEventWithLowercaseName('off');
- MessageCenter.prototype.one = createRegisterEventWithLowercaseName('one');
- zrUtil.mixin(MessageCenter, Eventful);
- /**
- * @module echarts~ECharts
- */
- function ECharts (dom, theme, opts) {
- opts = opts || {};
-
- // Get theme by name
- if (typeof theme === 'string') {
- theme = themeStorage[theme];
- }
-
- if (theme) {
- each(optionPreprocessorFuncs, function (preProcess) {
- preProcess(theme);
- });
- }
- /**
- * @type {string}
- */
- this.id;
- /**
- * Group id
- * @type {string}
- */
- this.group;
- /**
- * @type {HTMLDomElement}
- * @private
- */
- this._dom = dom;
- /**
- * @type {module:zrender/ZRender}
- * @private
- */
- this._zr = zrender.init(dom, {
- renderer: opts.renderer || 'canvas',
- devicePixelRatio: opts.devicePixelRatio
- });
-
- /**
- * @type {Object}
- * @private
- */
- this._theme = zrUtil.clone(theme);
-
- /**
- * @type {Array.<module:echarts/view/Chart>}
- * @private
- */
- this._chartsViews = [];
-
- /**
- * @type {Object.<string, module:echarts/view/Chart>}
- * @private
- */
- this._chartsMap = {};
-
- /**
- * @type {Array.<module:echarts/view/Component>}
- * @private
- */
- this._componentsViews = [];
-
- /**
- * @type {Object.<string, module:echarts/view/Component>}
- * @private
- */
- this._componentsMap = {};
-
- /**
- * @type {module:echarts/ExtensionAPI}
- * @private
- */
- this._api = new ExtensionAPI(this);
-
- /**
- * @type {module:echarts/CoordinateSystem}
- * @private
- */
- this._coordSysMgr = new CoordinateSystemManager();
-
- Eventful.call(this);
-
- /**
- * @type {module:echarts~MessageCenter}
- * @private
- */
- this._messageCenter = new MessageCenter();
-
- // Init mouse events
- this._initEvents();
-
- // In case some people write `window.onresize = chart.resize`
- this.resize = zrUtil.bind(this.resize, this);
- }
-
- var echartsProto = ECharts.prototype;
-
- /**
- * @return {HTMLDomElement}
- */
- echartsProto.getDom = function () {
- return this._dom;
- };
-
- /**
- * @return {module:zrender~ZRender}
- */
- echartsProto.getZr = function () {
- return this._zr;
- };
-
- /**
- * @param {Object} option
- * @param {boolean} notMerge
- * @param {boolean} [notRefreshImmediately=false] Useful when setOption frequently.
- */
- echartsProto.setOption = function (option, notMerge, notRefreshImmediately) {
- if (!this._model || notMerge) {
- this._model = new GlobalModel(
- null, null, this._theme, new OptionManager(this._api)
- );
- }
-
- this._model.setOption(option, optionPreprocessorFuncs);
-
- updateMethods.prepareAndUpdate.call(this);
-
- !notRefreshImmediately && this._zr.refreshImmediately();
- };
-
- /**
- * @DEPRECATED
- */
- echartsProto.setTheme = function () {
- console.log('ECharts#setTheme() is DEPRECATED in ECharts 3.0');
- };
-
- /**
- * @return {module:echarts/model/Global}
- */
- echartsProto.getModel = function () {
- return this._model;
- };
-
- /**
- * @return {Object}
- */
- echartsProto.getOption = function () {
- return this._model.getOption();
- };
-
- /**
- * @return {number}
- */
- echartsProto.getWidth = function () {
- return this._zr.getWidth();
- };
-
- /**
- * @return {number}
- */
- echartsProto.getHeight = function () {
- return this._zr.getHeight();
- };
-
- /**
- * Get canvas which has all thing rendered
- * @param {Object} opts
- * @param {string} [opts.backgroundColor]
- */
- echartsProto.getRenderedCanvas = function (opts) {
- if (!env.canvasSupported) {
- return;
- }
- opts = opts || {};
- opts.pixelRatio = opts.pixelRatio || 1;
- opts.backgroundColor = opts.backgroundColor
- || this._model.get('backgroundColor');
- var zr = this._zr;
- var list = zr.storage.getDisplayList();
- // Stop animations
- zrUtil.each(list, function (el) {
- el.stopAnimation(true);
- });
- return zr.painter.getRenderedCanvas(opts);
- };
- /**
- * @return {string}
- * @param {Object} opts
- * @param {string} [opts.type='png']
- * @param {string} [opts.pixelRatio=1]
- * @param {string} [opts.backgroundColor]
- */
- echartsProto.getDataURL = function (opts) {
- opts = opts || {};
- var excludeComponents = opts.excludeComponents;
- var ecModel = this._model;
- var excludesComponentViews = [];
- var self = this;
-
- each(excludeComponents, function (componentType) {
- ecModel.eachComponent({
- mainType: componentType
- }, function (component) {
- var view = self._componentsMap[component.__viewId];
- if (!view.group.ignore) {
- excludesComponentViews.push(view);
- view.group.ignore = true;
- }
- });
- });
-
- var url = this.getRenderedCanvas(opts).toDataURL(
- 'image/' + (opts && opts.type || 'png')
- );
-
- each(excludesComponentViews, function (view) {
- view.group.ignore = false;
- });
- return url;
- };
-
-
- /**
- * @return {string}
- * @param {Object} opts
- * @param {string} [opts.type='png']
- * @param {string} [opts.pixelRatio=1]
- * @param {string} [opts.backgroundColor]
- */
- echartsProto.getConnectedDataURL = function (opts) {
- if (!env.canvasSupported) {
- return;
- }
- var groupId = this.group;
- var mathMin = Math.min;
- var mathMax = Math.max;
- var MAX_NUMBER = Infinity;
- if (connectedGroups[groupId]) {
- var left = MAX_NUMBER;
- var top = MAX_NUMBER;
- var right = -MAX_NUMBER;
- var bottom = -MAX_NUMBER;
- var canvasList = [];
- var dpr = (opts && opts.pixelRatio) || 1;
- for (var id in instances) {
- var chart = instances[id];
- if (chart.group === groupId) {
- var canvas = chart.getRenderedCanvas(
- zrUtil.clone(opts)
- );
- var boundingRect = chart.getDom().getBoundingClientRect();
- left = mathMin(boundingRect.left, left);
- top = mathMin(boundingRect.top, top);
- right = mathMax(boundingRect.right, right);
- bottom = mathMax(boundingRect.bottom, bottom);
- canvasList.push({
- dom: canvas,
- left: boundingRect.left,
- top: boundingRect.top
- });
- }
- }
-
- left *= dpr;
- top *= dpr;
- right *= dpr;
- bottom *= dpr;
- var width = right - left;
- var height = bottom - top;
- var targetCanvas = zrUtil.createCanvas();
- targetCanvas.width = width;
- targetCanvas.height = height;
- var zr = zrender.init(targetCanvas);
-
- each(canvasList, function (item) {
- var img = new graphic.Image({
- style: {
- x: item.left * dpr - left,
- y: item.top * dpr - top,
- image: item.dom
- }
- });
- zr.add(img);
- });
- zr.refreshImmediately();
-
- return targetCanvas.toDataURL('image/' + (opts && opts.type || 'png'));
- }
- else {
- return this.getDataURL(opts);
- }
- };
-
- var updateMethods = {
-
- /**
- * @param {Object} payload
- * @private
- */
- update: function (payload) {
- // console.time && console.time('update');
-
- var ecModel = this._model;
- var api = this._api;
- var coordSysMgr = this._coordSysMgr;
- // update before setOption
- if (!ecModel) {
- return;
- }
-
- ecModel.restoreData();
-
- // TODO
- // Save total ecModel here for undo/redo (after restoring data and before processing data).
- // Undo (restoration of total ecModel) can be carried out in 'action' or outside API call.
-
- // Create new coordinate system each update
- // In LineView may save the old coordinate system and use it to get the orignal point
- coordSysMgr.create(this._model, this._api);
-
- processData.call(this, ecModel, api);
-
- stackSeriesData.call(this, ecModel);
-
- coordSysMgr.update(ecModel, api);
-
- doLayout.call(this, ecModel, payload);
-
- doVisualCoding.call(this, ecModel, payload);
-
- doRender.call(this, ecModel, payload);
-
- // Set background
- var backgroundColor = ecModel.get('backgroundColor') || 'transparent';
-
- var painter = this._zr.painter;
- // TODO all use clearColor ?
- if (painter.isSingleCanvas && painter.isSingleCanvas()) {
- this._zr.configLayer(0, {
- clearColor: backgroundColor
- });
- }
- else {
- // In IE8
- if (!env.canvasSupported) {
- var colorArr = colorTool.parse(backgroundColor);
- backgroundColor = colorTool.stringify(colorArr, 'rgb');
- if (colorArr[3] === 0) {
- backgroundColor = 'transparent';
- }
- }
- backgroundColor = backgroundColor;
- this._dom.style.backgroundColor = backgroundColor;
- }
-
- // console.time && console.timeEnd('update');
- },
-
- // PENDING
- /**
- * @param {Object} payload
- * @private
- */
- updateView: function (payload) {
- var ecModel = this._model;
-
- // update before setOption
- if (!ecModel) {
- return;
- }
-
- doLayout.call(this, ecModel, payload);
-
- doVisualCoding.call(this, ecModel, payload);
-
- invokeUpdateMethod.call(this, 'updateView', ecModel, payload);
- },
-
- /**
- * @param {Object} payload
- * @private
- */
- updateVisual: function (payload) {
- var ecModel = this._model;
-
- // update before setOption
- if (!ecModel) {
- return;
- }
-
- doVisualCoding.call(this, ecModel, payload);
-
- invokeUpdateMethod.call(this, 'updateVisual', ecModel, payload);
- },
-
- /**
- * @param {Object} payload
- * @private
- */
- updateLayout: function (payload) {
- var ecModel = this._model;
-
- // update before setOption
- if (!ecModel) {
- return;
- }
-
- doLayout.call(this, ecModel, payload);
-
- invokeUpdateMethod.call(this, 'updateLayout', ecModel, payload);
- },
-
- /**
- * @param {Object} payload
- * @private
- */
- highlight: function (payload) {
- toggleHighlight.call(this, 'highlight', payload);
- },
-
- /**
- * @param {Object} payload
- * @private
- */
- downplay: function (payload) {
- toggleHighlight.call(this, 'downplay', payload);
- },
-
- /**
- * @param {Object} payload
- * @private
- */
- prepareAndUpdate: function (payload) {
- var ecModel = this._model;
-
- prepareView.call(this, 'component', ecModel);
-
- prepareView.call(this, 'chart', ecModel);
-
- updateMethods.update.call(this, payload);
- }
- };
-
- /**
- * @param {Object} payload
- * @private
- */
- function toggleHighlight(method, payload) {
- var ecModel = this._model;
-
- // dispatchAction before setOption
- if (!ecModel) {
- return;
- }
-
- ecModel.eachComponent(
- {mainType: 'series', query: payload},
- function (seriesModel, index) {
- var chartView = this._chartsMap[seriesModel.__viewId];
- if (chartView && chartView.__alive) {
- chartView[method](
- seriesModel, ecModel, this._api, payload
- );
- }
- },
- this
- );
- }
-
- /**
- * Resize the chart
- */
- echartsProto.resize = function () {
- this._zr.resize();
-
- var optionChanged = this._model && this._model.resetOption('media');
- updateMethods[optionChanged ? 'prepareAndUpdate' : 'update'].call(this);
-
- // Resize loading effect
- this._loadingFX && this._loadingFX.resize();
- };
-
- var defaultLoadingEffect = __webpack_require__(87);
- /**
- * Show loading effect
- * @param {string} [name='default']
- * @param {Object} [cfg]
- */
- echartsProto.showLoading = function (name, cfg) {
- if (zrUtil.isObject(name)) {
- cfg = name;
- name = 'default';
- }
- this.hideLoading();
- var el = defaultLoadingEffect(this._api, cfg);
- var zr = this._zr;
- this._loadingFX = el;
-
- zr.add(el);
- };
-
- /**
- * Hide loading effect
- */
- echartsProto.hideLoading = function () {
- this._loadingFX && this._zr.remove(this._loadingFX);
- this._loadingFX = null;
- };
-
- /**
- * @param {Object} eventObj
- * @return {Object}
- */
- echartsProto.makeActionFromEvent = function (eventObj) {
- var payload = zrUtil.extend({}, eventObj);
- payload.type = eventActionMap[eventObj.type];
- return payload;
- };
-
- /**
- * @pubilc
- * @param {Object} payload
- * @param {string} [payload.type] Action type
- * @param {boolean} [silent=false] Whether trigger event.
- */
- echartsProto.dispatchAction = function (payload, silent) {
- var actionWrap = actions[payload.type];
- if (actionWrap) {
- var actionInfo = actionWrap.actionInfo;
- var updateMethod = actionInfo.update || 'update';
-
- var payloads = [payload];
- var batched = false;
- // Batch action
- if (payload.batch) {
- batched = true;
- payloads = zrUtil.map(payload.batch, function (item) {
- item = zrUtil.defaults(zrUtil.extend({}, item), payload);
- item.batch = null;
- return item;
- });
- }
-
- var eventObjBatch = [];
- var eventObj;
- var isHighlightOrDownplay = payload.type === 'highlight' || payload.type === 'downplay';
- for (var i = 0; i < payloads.length; i++) {
- var batchItem = payloads[i];
- // Action can specify the event by return it.
- eventObj = actionWrap.action(batchItem, this._model);
- // Emit event outside
- eventObj = eventObj || zrUtil.extend({}, batchItem);
- // Convert type to eventType
- eventObj.type = actionInfo.event || eventObj.type;
- eventObjBatch.push(eventObj);
-
- // Highlight and downplay are special.
- isHighlightOrDownplay && updateMethods[updateMethod].call(this, batchItem);
- }
-
- (updateMethod !== 'none' && !isHighlightOrDownplay)
- && updateMethods[updateMethod].call(this, payload);
-
- if (!silent) {
- // Follow the rule of action batch
- if (batched) {
- eventObj = {
- type: actionInfo.event || payload.type,
- batch: eventObjBatch
- };
- }
- else {
- eventObj = eventObjBatch[0];
- }
- this._messageCenter.trigger(eventObj.type, eventObj);
- }
- }
- };
-
- /**
- * Register event
- * @method
- */
- echartsProto.on = createRegisterEventWithLowercaseName('on');
- echartsProto.off = createRegisterEventWithLowercaseName('off');
- echartsProto.one = createRegisterEventWithLowercaseName('one');
-
- /**
- * @param {string} methodName
- * @private
- */
- function invokeUpdateMethod(methodName, ecModel, payload) {
- var api = this._api;
-
- // Update all components
- each(this._componentsViews, function (component) {
- var componentModel = component.__model;
- component[methodName](componentModel, ecModel, api, payload);
-
- updateZ(componentModel, component);
- }, this);
-
- // Upate all charts
- ecModel.eachSeries(function (seriesModel, idx) {
- var chart = this._chartsMap[seriesModel.__viewId];
- chart[methodName](seriesModel, ecModel, api, payload);
-
- updateZ(seriesModel, chart);
- }, this);
-
- }
-
- /**
- * Prepare view instances of charts and components
- * @param {module:echarts/model/Global} ecModel
- * @private
- */
- function prepareView(type, ecModel) {
- var isComponent = type === 'component';
- var viewList = isComponent ? this._componentsViews : this._chartsViews;
- var viewMap = isComponent ? this._componentsMap : this._chartsMap;
- var zr = this._zr;
-
- for (var i = 0; i < viewList.length; i++) {
- viewList[i].__alive = false;
- }
-
- ecModel[isComponent ? 'eachComponent' : 'eachSeries'](function (componentType, model) {
- if (isComponent) {
- if (componentType === 'series') {
- return;
- }
- }
- else {
- model = componentType;
- }
-
- // Consider: id same and type changed.
- var viewId = model.id + '_' + model.type;
- var view = viewMap[viewId];
- if (!view) {
- var classType = ComponentModel.parseClassType(model.type);
- var Clazz = isComponent
- ? ComponentView.getClass(classType.main, classType.sub)
- : ChartView.getClass(classType.sub);
- if (Clazz) {
- view = new Clazz();
- view.init(ecModel, this._api);
- viewMap[viewId] = view;
- viewList.push(view);
- zr.add(view.group);
- }
- else {
- // Error
- return;
- }
- }
-
- model.__viewId = viewId;
- view.__alive = true;
- view.__id = viewId;
- view.__model = model;
- }, this);
-
- for (var i = 0; i < viewList.length;) {
- var view = viewList[i];
- if (!view.__alive) {
- zr.remove(view.group);
- view.dispose(ecModel, this._api);
- viewList.splice(i, 1);
- delete viewMap[view.__id];
- }
- else {
- i++;
- }
- }
- }
-
- /**
- * Processor data in each series
- *
- * @param {module:echarts/model/Global} ecModel
- * @private
- */
- function processData(ecModel, api) {
- each(PROCESSOR_STAGES, function (stage) {
- each(dataProcessorFuncs[stage] || [], function (process) {
- process(ecModel, api);
- });
- });
- }
-
- /**
- * @private
- */
- function stackSeriesData(ecModel) {
- var stackedDataMap = {};
- ecModel.eachSeries(function (series) {
- var stack = series.get('stack');
- var data = series.getData();
- if (stack && data.type === 'list') {
- var previousStack = stackedDataMap[stack];
- if (previousStack) {
- data.stackedOn = previousStack;
- }
- stackedDataMap[stack] = data;
- }
- });
- }
-
- /**
- * Layout before each chart render there series, after visual coding and data processing
- *
- * @param {module:echarts/model/Global} ecModel
- * @private
- */
- function doLayout(ecModel, payload) {
- var api = this._api;
- each(layoutFuncs, function (layout) {
- layout(ecModel, api, payload);
- });
- }
-
- /**
- * Code visual infomation from data after data processing
- *
- * @param {module:echarts/model/Global} ecModel
- * @private
- */
- function doVisualCoding(ecModel, payload) {
- each(VISUAL_CODING_STAGES, function (stage) {
- each(visualCodingFuncs[stage] || [], function (visualCoding) {
- visualCoding(ecModel, payload);
- });
- });
- }
-
- /**
- * Render each chart and component
- * @private
- */
- function doRender(ecModel, payload) {
- var api = this._api;
- // Render all components
- each(this._componentsViews, function (componentView) {
- var componentModel = componentView.__model;
- componentView.render(componentModel, ecModel, api, payload);
-
- updateZ(componentModel, componentView);
- }, this);
-
- each(this._chartsViews, function (chart) {
- chart.__alive = false;
- }, this);
-
- // Render all charts
- ecModel.eachSeries(function (seriesModel, idx) {
- var chartView = this._chartsMap[seriesModel.__viewId];
- chartView.__alive = true;
- chartView.render(seriesModel, ecModel, api, payload);
-
- updateZ(seriesModel, chartView);
- }, this);
-
- // Remove groups of unrendered charts
- each(this._chartsViews, function (chart) {
- if (!chart.__alive) {
- chart.remove(ecModel, api);
- }
- }, this);
- }
-
- var MOUSE_EVENT_NAMES = [
- 'click', 'dblclick', 'mouseover', 'mouseout', 'mousedown', 'mouseup', 'globalout'
- ];
- /**
- * @private
- */
- echartsProto._initEvents = function () {
- var zr = this._zr;
- each(MOUSE_EVENT_NAMES, function (eveName) {
- zr.on(eveName, function (e) {
- var ecModel = this.getModel();
- var el = e.target;
- if (el && el.dataIndex != null) {
- var dataModel = el.dataModel || ecModel.getSeriesByIndex(el.seriesIndex);
- var params = dataModel && dataModel.getDataParams(el.dataIndex) || {};
- params.event = e;
- params.type = eveName;
- this.trigger(eveName, params);
- }
- }, this);
- }, this);
-
- each(eventActionMap, function (actionType, eventType) {
- this._messageCenter.on(eventType, function (event) {
- this.trigger(eventType, event);
- }, this);
- }, this);
- };
-
- /**
- * @return {boolean}
- */
- echartsProto.isDisposed = function () {
- return this._disposed;
- };
-
- /**
- * Clear
- */
- echartsProto.clear = function () {
- this.setOption({}, true);
- };
- /**
- * Dispose instance
- */
- echartsProto.dispose = function () {
- this._disposed = true;
- var api = this._api;
- var ecModel = this._model;
-
- each(this._componentsViews, function (component) {
- component.dispose(ecModel, api);
- });
- each(this._chartsViews, function (chart) {
- chart.dispose(ecModel, api);
- });
-
- this._zr.dispose();
-
- delete instances[this.id];
- };
-
- zrUtil.mixin(ECharts, Eventful);
-
- /**
- * @param {module:echarts/model/Series|module:echarts/model/Component} model
- * @param {module:echarts/view/Component|module:echarts/view/Chart} view
- * @return {string}
- */
- function updateZ(model, view) {
- var z = model.get('z');
- var zlevel = model.get('zlevel');
- // Set z and zlevel
- view.group.traverse(function (el) {
- z != null && (el.z = z);
- zlevel != null && (el.zlevel = zlevel);
- });
- }
- /**
- * @type {Array.<Function>}
- * @inner
- */
- var actions = [];
-
- /**
- * Map eventType to actionType
- * @type {Object}
- */
- var eventActionMap = {};
-
- /**
- * @type {Array.<Function>}
- * @inner
- */
- var layoutFuncs = [];
-
- /**
- * Data processor functions of each stage
- * @type {Array.<Object.<string, Function>>}
- * @inner
- */
- var dataProcessorFuncs = {};
-
- /**
- * @type {Array.<Function>}
- * @inner
- */
- var optionPreprocessorFuncs = [];
-
- /**
- * Visual coding functions of each stage
- * @type {Array.<Object.<string, Function>>}
- * @inner
- */
- var visualCodingFuncs = {};
- /**
- * Theme storage
- * @type {Object.<key, Object>}
- */
- var themeStorage = {};
-
-
- var instances = {};
- var connectedGroups = {};
-
- var idBase = new Date() - 0;
- var groupIdBase = new Date() - 0;
- var DOM_ATTRIBUTE_KEY = '_echarts_instance_';
- /**
- * @alias module:echarts
- */
- var echarts = {
- /**
- * @type {number}
- */
- version: '3.1.5',
- dependencies: {
- zrender: '3.0.6'
- }
- };
-
- function enableConnect(chart) {
-
- var STATUS_PENDING = 0;
- var STATUS_UPDATING = 1;
- var STATUS_UPDATED = 2;
- var STATUS_KEY = '__connectUpdateStatus';
- function updateConnectedChartsStatus(charts, status) {
- for (var i = 0; i < charts.length; i++) {
- var otherChart = charts[i];
- otherChart[STATUS_KEY] = status;
- }
- }
- zrUtil.each(eventActionMap, function (actionType, eventType) {
- chart._messageCenter.on(eventType, function (event) {
- if (connectedGroups[chart.group] && chart[STATUS_KEY] !== STATUS_PENDING) {
- var action = chart.makeActionFromEvent(event);
- var otherCharts = [];
- for (var id in instances) {
- var otherChart = instances[id];
- if (otherChart !== chart && otherChart.group === chart.group) {
- otherCharts.push(otherChart);
- }
- }
- updateConnectedChartsStatus(otherCharts, STATUS_PENDING);
- each(otherCharts, function (otherChart) {
- if (otherChart[STATUS_KEY] !== STATUS_UPDATING) {
- otherChart.dispatchAction(action);
- }
- });
- updateConnectedChartsStatus(otherCharts, STATUS_UPDATED);
- }
- });
- });
-
- }
- /**
- * @param {HTMLDomElement} dom
- * @param {Object} [theme]
- * @param {Object} opts
- */
- echarts.init = function (dom, theme, opts) {
- // Check version
- if ((zrender.version.replace('.', '') - 0) < (echarts.dependencies.zrender.replace('.', '') - 0)) {
- throw new Error(
- 'ZRender ' + zrender.version
- + ' is too old for ECharts ' + echarts.version
- + '. Current version need ZRender '
- + echarts.dependencies.zrender + '+'
- );
- }
- if (!dom) {
- throw new Error('Initialize failed: invalid dom.');
- }
-
- var chart = new ECharts(dom, theme, opts);
- chart.id = 'ec_' + idBase++;
- instances[chart.id] = chart;
-
- dom.setAttribute &&
- dom.setAttribute(DOM_ATTRIBUTE_KEY, chart.id);
-
- enableConnect(chart);
-
- return chart;
- };
-
- /**
- * @return {string|Array.<module:echarts~ECharts>} groupId
- */
- echarts.connect = function (groupId) {
- // Is array of charts
- if (zrUtil.isArray(groupId)) {
- var charts = groupId;
- groupId = null;
- // If any chart has group
- zrUtil.each(charts, function (chart) {
- if (chart.group != null) {
- groupId = chart.group;
- }
- });
- groupId = groupId || ('g_' + groupIdBase++);
- zrUtil.each(charts, function (chart) {
- chart.group = groupId;
- });
- }
- connectedGroups[groupId] = true;
- return groupId;
- };
-
- /**
- * @return {string} groupId
- */
- echarts.disConnect = function (groupId) {
- connectedGroups[groupId] = false;
- };
-
- /**
- * Dispose a chart instance
- * @param {module:echarts~ECharts|HTMLDomElement|string} chart
- */
- echarts.dispose = function (chart) {
- if (zrUtil.isDom(chart)) {
- chart = echarts.getInstanceByDom(chart);
- }
- else if (typeof chart === 'string') {
- chart = instances[chart];
- }
- if ((chart instanceof ECharts) && !chart.isDisposed()) {
- chart.dispose();
- }
- };
-
- /**
- * @param {HTMLDomElement} dom
- * @return {echarts~ECharts}
- */
- echarts.getInstanceByDom = function (dom) {
- var key = dom.getAttribute(DOM_ATTRIBUTE_KEY);
- return instances[key];
- };
- /**
- * @param {string} key
- * @return {echarts~ECharts}
- */
- echarts.getInstanceById = function (key) {
- return instances[key];
- };
-
- /**
- * Register theme
- */
- echarts.registerTheme = function (name, theme) {
- themeStorage[name] = theme;
- };
-
- /**
- * Register option preprocessor
- * @param {Function} preprocessorFunc
- */
- echarts.registerPreprocessor = function (preprocessorFunc) {
- optionPreprocessorFuncs.push(preprocessorFunc);
- };
-
- /**
- * @param {string} stage
- * @param {Function} processorFunc
- */
- echarts.registerProcessor = function (stage, processorFunc) {
- if (zrUtil.indexOf(PROCESSOR_STAGES, stage) < 0) {
- throw new Error('stage should be one of ' + PROCESSOR_STAGES);
- }
- var funcs = dataProcessorFuncs[stage] || (dataProcessorFuncs[stage] = []);
- funcs.push(processorFunc);
- };
-
- /**
- * Usage:
- * registerAction('someAction', 'someEvent', function () { ... });
- * registerAction('someAction', function () { ... });
- * registerAction(
- * {type: 'someAction', event: 'someEvent', update: 'updateView'},
- * function () { ... }
- * );
- *
- * @param {(string|Object)} actionInfo
- * @param {string} actionInfo.type
- * @param {string} [actionInfo.event]
- * @param {string} [actionInfo.update]
- * @param {string} [eventName]
- * @param {Function} action
- */
- echarts.registerAction = function (actionInfo, eventName, action) {
- if (typeof eventName === 'function') {
- action = eventName;
- eventName = '';
- }
- var actionType = zrUtil.isObject(actionInfo)
- ? actionInfo.type
- : ([actionInfo, actionInfo = {
- event: eventName
- }][0]);
-
- // Event name is all lowercase
- actionInfo.event = (actionInfo.event || actionType).toLowerCase();
- eventName = actionInfo.event;
-
- if (!actions[actionType]) {
- actions[actionType] = {action: action, actionInfo: actionInfo};
- }
- eventActionMap[eventName] = actionType;
- };
-
- /**
- * @param {string} type
- * @param {*} CoordinateSystem
- */
- echarts.registerCoordinateSystem = function (type, CoordinateSystem) {
- CoordinateSystemManager.register(type, CoordinateSystem);
- };
-
- /**
- * @param {*} layout
- */
- echarts.registerLayout = function (layout) {
- // PENDING All functions ?
- if (zrUtil.indexOf(layoutFuncs, layout) < 0) {
- layoutFuncs.push(layout);
- }
- };
-
- /**
- * @param {string} stage
- * @param {Function} visualCodingFunc
- */
- echarts.registerVisualCoding = function (stage, visualCodingFunc) {
- if (zrUtil.indexOf(VISUAL_CODING_STAGES, stage) < 0) {
- throw new Error('stage should be one of ' + VISUAL_CODING_STAGES);
- }
- var funcs = visualCodingFuncs[stage] || (visualCodingFuncs[stage] = []);
- funcs.push(visualCodingFunc);
- };
-
- /**
- * @param {Object} opts
- */
- echarts.extendChartView = function (opts) {
- return ChartView.extend(opts);
- };
-
- /**
- * @param {Object} opts
- */
- echarts.extendComponentModel = function (opts) {
- return ComponentModel.extend(opts);
- };
-
- /**
- * @param {Object} opts
- */
- echarts.extendSeriesModel = function (opts) {
- return SeriesModel.extend(opts);
- };
-
- /**
- * @param {Object} opts
- */
- echarts.extendComponentView = function (opts) {
- return ComponentView.extend(opts);
- };
-
- /**
- * ZRender need a canvas context to do measureText.
- * But in node environment canvas may be created by node-canvas.
- * So we need to specify how to create a canvas instead of using document.createElement('canvas')
- *
- * Be careful of using it in the browser.
- *
- * @param {Function} creator
- * @example
- * var Canvas = require('canvas');
- * var echarts = require('echarts');
- * echarts.setCanvasCreator(function () {
- * // Small size is enough.
- * return new Canvas(32, 32);
- * });
- */
- echarts.setCanvasCreator = function (creator) {
- zrUtil.createCanvas = creator;
- };
-
- echarts.registerVisualCoding('echarts', zrUtil.curry(
- __webpack_require__(88), '', 'itemStyle'
- ));
- echarts.registerPreprocessor(__webpack_require__(89));
-
- // Default action
- echarts.registerAction({
- type: 'highlight',
- event: 'highlight',
- update: 'highlight'
- }, zrUtil.noop);
- echarts.registerAction({
- type: 'downplay',
- event: 'downplay',
- update: 'downplay'
- }, zrUtil.noop);
-
-
- // --------
- // Exports
- // --------
-
- echarts.graphic = __webpack_require__(42);
- echarts.number = __webpack_require__(7);
- echarts.format = __webpack_require__(6);
- echarts.matrix = __webpack_require__(17);
- echarts.vector = __webpack_require__(16);
-
- echarts.util = {};
- each([
- 'map', 'each', 'filter', 'indexOf', 'inherits',
- 'reduce', 'filter', 'bind', 'curry', 'isArray',
- 'isString', 'isObject', 'isFunction', 'extend'
- ],
- function (name) {
- echarts.util[name] = zrUtil[name];
- }
- );
-
- module.exports = echarts;
-
-
-/***/ },
-/* 2 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * ECharts global model
- *
- * @module {echarts/model/Global}
- *
- */
-
-
-
- var zrUtil = __webpack_require__(3);
- var modelUtil = __webpack_require__(5);
- var Model = __webpack_require__(8);
- var each = zrUtil.each;
- var filter = zrUtil.filter;
- var map = zrUtil.map;
- var isArray = zrUtil.isArray;
- var indexOf = zrUtil.indexOf;
- var isObject = zrUtil.isObject;
-
- var ComponentModel = __webpack_require__(19);
-
- var globalDefault = __webpack_require__(23);
-
- var OPTION_INNER_KEY = '\0_ec_inner';
-
- /**
- * @alias module:echarts/model/Global
- *
- * @param {Object} option
- * @param {module:echarts/model/Model} parentModel
- * @param {Object} theme
- */
- var GlobalModel = Model.extend({
-
- constructor: GlobalModel,
-
- init: function (option, parentModel, theme, optionManager) {
- theme = theme || {};
-
- this.option = null; // Mark as not initialized.
-
- /**
- * @type {module:echarts/model/Model}
- * @private
- */
- this._theme = new Model(theme);
-
- /**
- * @type {module:echarts/model/OptionManager}
- */
- this._optionManager = optionManager;
- },
-
- setOption: function (option, optionPreprocessorFuncs) {
- zrUtil.assert(
- !(OPTION_INNER_KEY in option),
- 'please use chart.getOption()'
- );
-
- this._optionManager.setOption(option, optionPreprocessorFuncs);
-
- this.resetOption();
- },
-
- /**
- * @param {string} type null/undefined: reset all.
- * 'recreate': force recreate all.
- * 'timeline': only reset timeline option
- * 'media': only reset media query option
- * @return {boolean} Whether option changed.
- */
- resetOption: function (type) {
- var optionChanged = false;
- var optionManager = this._optionManager;
-
- if (!type || type === 'recreate') {
- var baseOption = optionManager.mountOption(type === 'recreate');
-
- if (!this.option || type === 'recreate') {
- initBase.call(this, baseOption);
- }
- else {
- this.restoreData();
- this.mergeOption(baseOption);
- }
- optionChanged = true;
- }
-
- if (type === 'timeline' || type === 'media') {
- this.restoreData();
- }
-
- if (!type || type === 'recreate' || type === 'timeline') {
- var timelineOption = optionManager.getTimelineOption(this);
- timelineOption && (this.mergeOption(timelineOption), optionChanged = true);
- }
-
- if (!type || type === 'recreate' || type === 'media') {
- var mediaOptions = optionManager.getMediaOption(this, this._api);
- if (mediaOptions.length) {
- each(mediaOptions, function (mediaOption) {
- this.mergeOption(mediaOption, optionChanged = true);
- }, this);
- }
- }
-
- return optionChanged;
- },
-
- /**
- * @protected
- */
- mergeOption: function (newOption) {
- var option = this.option;
- var componentsMap = this._componentsMap;
- var newCptTypes = [];
-
- // 如果不存在对应的 component model 则直接 merge
- each(newOption, function (componentOption, mainType) {
- if (componentOption == null) {
- return;
- }
-
- if (!ComponentModel.hasClass(mainType)) {
- option[mainType] = option[mainType] == null
- ? zrUtil.clone(componentOption)
- : zrUtil.merge(option[mainType], componentOption, true);
- }
- else {
- newCptTypes.push(mainType);
- }
- });
-
- // FIXME OPTION 同步是否要改回原来的
- ComponentModel.topologicalTravel(
- newCptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this
- );
-
- function visitComponent(mainType, dependencies) {
- var newCptOptionList = modelUtil.normalizeToArray(newOption[mainType]);
-
- var mapResult = modelUtil.mappingToExists(
- componentsMap[mainType], newCptOptionList
- );
-
- makeKeyInfo(mainType, mapResult);
-
- var dependentModels = getComponentsByTypes(
- componentsMap, dependencies
- );
-
- option[mainType] = [];
- componentsMap[mainType] = [];
-
- each(mapResult, function (resultItem, index) {
- var componentModel = resultItem.exist;
- var newCptOption = resultItem.option;
-
- zrUtil.assert(
- isObject(newCptOption) || componentModel,
- 'Empty component definition'
- );
-
- // Consider where is no new option and should be merged using {},
- // see removeEdgeAndAdd in topologicalTravel and
- // ComponentModel.getAllClassMainTypes.
- if (!newCptOption) {
- componentModel.mergeOption({}, this);
- componentModel.optionUpdated(this);
- }
- else {
- var ComponentModelClass = ComponentModel.getClass(
- mainType, resultItem.keyInfo.subType, true
- );
-
- if (componentModel && componentModel instanceof ComponentModelClass) {
- componentModel.mergeOption(newCptOption, this);
- componentModel.optionUpdated(this);
- }
- else {
- // PENDING Global as parent ?
- componentModel = new ComponentModelClass(
- newCptOption, this, this,
- zrUtil.extend(
- {
- dependentModels: dependentModels,
- componentIndex: index
- },
- resultItem.keyInfo
- )
- );
- // Call optionUpdated after init
- componentModel.optionUpdated(this);
- }
- }
-
- componentsMap[mainType][index] = componentModel;
- option[mainType][index] = componentModel.option;
- }, this);
-
- // Backup series for filtering.
- if (mainType === 'series') {
- this._seriesIndices = createSeriesIndices(componentsMap.series);
- }
- }
- },
-
- /**
- * Get option for output (cloned option and inner info removed)
- * @public
- * @return {Object}
- */
- getOption: function () {
- var option = zrUtil.clone(this.option);
-
- each(option, function (opts, mainType) {
- if (ComponentModel.hasClass(mainType)) {
- var opts = modelUtil.normalizeToArray(opts);
- for (var i = opts.length - 1; i >= 0; i--) {
- // Remove options with inner id.
- if (modelUtil.isIdInner(opts[i])) {
- opts.splice(i, 1);
- }
- }
- option[mainType] = opts;
- }
- });
-
- delete option[OPTION_INNER_KEY];
-
- return option;
- },
-
- /**
- * @return {module:echarts/model/Model}
- */
- getTheme: function () {
- return this._theme;
- },
-
- /**
- * @param {string} mainType
- * @param {number} [idx=0]
- * @return {module:echarts/model/Component}
- */
- getComponent: function (mainType, idx) {
- var list = this._componentsMap[mainType];
- if (list) {
- return list[idx || 0];
- }
- },
-
- /**
- * @param {Object} condition
- * @param {string} condition.mainType
- * @param {string} [condition.subType] If ignore, only query by mainType
- * @param {number} [condition.index] Either input index or id or name.
- * @param {string} [condition.id] Either input index or id or name.
- * @param {string} [condition.name] Either input index or id or name.
- * @return {Array.<module:echarts/model/Component>}
- */
- queryComponents: function (condition) {
- var mainType = condition.mainType;
- if (!mainType) {
- return [];
- }
-
- var index = condition.index;
- var id = condition.id;
- var name = condition.name;
-
- var cpts = this._componentsMap[mainType];
-
- if (!cpts || !cpts.length) {
- return [];
- }
-
- var result;
-
- if (index != null) {
- if (!isArray(index)) {
- index = [index];
- }
- result = filter(map(index, function (idx) {
- return cpts[idx];
- }), function (val) {
- return !!val;
- });
- }
- else if (id != null) {
- var isIdArray = isArray(id);
- result = filter(cpts, function (cpt) {
- return (isIdArray && indexOf(id, cpt.id) >= 0)
- || (!isIdArray && cpt.id === id);
- });
- }
- else if (name != null) {
- var isNameArray = isArray(name);
- result = filter(cpts, function (cpt) {
- return (isNameArray && indexOf(name, cpt.name) >= 0)
- || (!isNameArray && cpt.name === name);
- });
- }
-
- return filterBySubType(result, condition);
- },
-
- /**
- * The interface is different from queryComponents,
- * which is convenient for inner usage.
- *
- * @usage
- * findComponents(
- * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}},
- * function (model, index) {...}
- * );
- *
- * findComponents(
- * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}},
- * function (model, index) {...}
- * );
- *
- * var result = findComponents(
- * {mainType: 'series'},
- * function (model, index) {...}
- * );
- * // result like [component0, componnet1, ...]
- *
- * @param {Object} condition
- * @param {string} condition.mainType Mandatory.
- * @param {string} [condition.subType] Optional.
- * @param {Object} [condition.query] like {xxxIndex, xxxId, xxxName},
- * where xxx is mainType.
- * If query attribute is null/undefined or has no index/id/name,
- * do not filtering by query conditions, which is convenient for
- * no-payload situations or when target of action is global.
- * @param {Function} [condition.filter] parameter: component, return boolean.
- * @return {Array.<module:echarts/model/Component>}
- */
- findComponents: function (condition) {
- var query = condition.query;
- var mainType = condition.mainType;
-
- var queryCond = getQueryCond(query);
- var result = queryCond
- ? this.queryComponents(queryCond)
- : this._componentsMap[mainType];
-
- return doFilter(filterBySubType(result, condition));
-
- function getQueryCond(q) {
- var indexAttr = mainType + 'Index';
- var idAttr = mainType + 'Id';
- var nameAttr = mainType + 'Name';
- return q && (
- q.hasOwnProperty(indexAttr)
- || q.hasOwnProperty(idAttr)
- || q.hasOwnProperty(nameAttr)
- )
- ? {
- mainType: mainType,
- // subType will be filtered finally.
- index: q[indexAttr],
- id: q[idAttr],
- name: q[nameAttr]
- }
- : null;
- }
-
- function doFilter(res) {
- return condition.filter
- ? filter(res, condition.filter)
- : res;
- }
- },
-
- /**
- * @usage
- * eachComponent('legend', function (legendModel, index) {
- * ...
- * });
- * eachComponent(function (componentType, model, index) {
- * // componentType does not include subType
- * // (componentType is 'xxx' but not 'xxx.aa')
- * });
- * eachComponent(
- * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}},
- * function (model, index) {...}
- * );
- * eachComponent(
- * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}},
- * function (model, index) {...}
- * );
- *
- * @param {string|Object=} mainType When mainType is object, the definition
- * is the same as the method 'findComponents'.
- * @param {Function} cb
- * @param {*} context
- */
- eachComponent: function (mainType, cb, context) {
- var componentsMap = this._componentsMap;
-
- if (typeof mainType === 'function') {
- context = cb;
- cb = mainType;
- each(componentsMap, function (components, componentType) {
- each(components, function (component, index) {
- cb.call(context, componentType, component, index);
- });
- });
- }
- else if (zrUtil.isString(mainType)) {
- each(componentsMap[mainType], cb, context);
- }
- else if (isObject(mainType)) {
- var queryResult = this.findComponents(mainType);
- each(queryResult, cb, context);
- }
- },
-
- /**
- * @param {string} name
- * @return {Array.<module:echarts/model/Series>}
- */
- getSeriesByName: function (name) {
- var series = this._componentsMap.series;
- return filter(series, function (oneSeries) {
- return oneSeries.name === name;
- });
- },
-
- /**
- * @param {number} seriesIndex
- * @return {module:echarts/model/Series}
- */
- getSeriesByIndex: function (seriesIndex) {
- return this._componentsMap.series[seriesIndex];
- },
-
- /**
- * @param {string} subType
- * @return {Array.<module:echarts/model/Series>}
- */
- getSeriesByType: function (subType) {
- var series = this._componentsMap.series;
- return filter(series, function (oneSeries) {
- return oneSeries.subType === subType;
- });
- },
-
- /**
- * @return {Array.<module:echarts/model/Series>}
- */
- getSeries: function () {
- return this._componentsMap.series.slice();
- },
-
- /**
- * After filtering, series may be different
- * frome raw series.
- *
- * @param {Function} cb
- * @param {*} context
- */
- eachSeries: function (cb, context) {
- assertSeriesInitialized(this);
- each(this._seriesIndices, function (rawSeriesIndex) {
- var series = this._componentsMap.series[rawSeriesIndex];
- cb.call(context, series, rawSeriesIndex);
- }, this);
- },
-
- /**
- * Iterate raw series before filtered.
- *
- * @param {Function} cb
- * @param {*} context
- */
- eachRawSeries: function (cb, context) {
- each(this._componentsMap.series, cb, context);
- },
-
- /**
- * After filtering, series may be different.
- * frome raw series.
- *
- * @parma {string} subType
- * @param {Function} cb
- * @param {*} context
- */
- eachSeriesByType: function (subType, cb, context) {
- assertSeriesInitialized(this);
- each(this._seriesIndices, function (rawSeriesIndex) {
- var series = this._componentsMap.series[rawSeriesIndex];
- if (series.subType === subType) {
- cb.call(context, series, rawSeriesIndex);
- }
- }, this);
- },
-
- /**
- * Iterate raw series before filtered of given type.
- *
- * @parma {string} subType
- * @param {Function} cb
- * @param {*} context
- */
- eachRawSeriesByType: function (subType, cb, context) {
- return each(this.getSeriesByType(subType), cb, context);
- },
-
- /**
- * @param {module:echarts/model/Series} seriesModel
- */
- isSeriesFiltered: function (seriesModel) {
- assertSeriesInitialized(this);
- return zrUtil.indexOf(this._seriesIndices, seriesModel.componentIndex) < 0;
- },
-
- /**
- * @param {Function} cb
- * @param {*} context
- */
- filterSeries: function (cb, context) {
- assertSeriesInitialized(this);
- var filteredSeries = filter(
- this._componentsMap.series, cb, context
- );
- this._seriesIndices = createSeriesIndices(filteredSeries);
- },
-
- restoreData: function () {
- var componentsMap = this._componentsMap;
-
- this._seriesIndices = createSeriesIndices(componentsMap.series);
-
- var componentTypes = [];
- each(componentsMap, function (components, componentType) {
- componentTypes.push(componentType);
- });
-
- ComponentModel.topologicalTravel(
- componentTypes,
- ComponentModel.getAllClassMainTypes(),
- function (componentType, dependencies) {
- each(componentsMap[componentType], function (component) {
- component.restoreData();
- });
- }
- );
- }
-
- });
-
- /**
- * @inner
- */
- function mergeTheme(option, theme) {
- for (var name in theme) {
- // 如果有 component model 则把具体的 merge 逻辑交给该 model 处理
- if (!ComponentModel.hasClass(name)) {
- if (typeof theme[name] === 'object') {
- option[name] = !option[name]
- ? zrUtil.clone(theme[name])
- : zrUtil.merge(option[name], theme[name], false);
- }
- else {
- if (option[name] == null) {
- option[name] = theme[name];
- }
- }
- }
- }
- }
-
- function initBase(baseOption) {
- baseOption = baseOption;
-
- // Using OPTION_INNER_KEY to mark that this option can not be used outside,
- // i.e. `chart.setOption(chart.getModel().option);` is forbiden.
- this.option = {};
- this.option[OPTION_INNER_KEY] = 1;
-
- /**
- * @type {Object.<string, Array.<module:echarts/model/Model>>}
- * @private
- */
- this._componentsMap = {};
-
- /**
- * Mapping between filtered series list and raw series list.
- * key: filtered series indices, value: raw series indices.
- * @type {Array.<nubmer>}
- * @private
- */
- this._seriesIndices = null;
-
- mergeTheme(baseOption, this._theme.option);
-
- // TODO Needs clone when merging to the unexisted property
- zrUtil.merge(baseOption, globalDefault, false);
-
- this.mergeOption(baseOption);
- }
-
- /**
- * @inner
- * @param {Array.<string>|string} types model types
- * @return {Object} key: {string} type, value: {Array.<Object>} models
- */
- function getComponentsByTypes(componentsMap, types) {
- if (!zrUtil.isArray(types)) {
- types = types ? [types] : [];
- }
-
- var ret = {};
- each(types, function (type) {
- ret[type] = (componentsMap[type] || []).slice();
- });
-
- return ret;
- }
-
- /**
- * @inner
- */
- function makeKeyInfo(mainType, mapResult) {
- // We use this id to hash component models and view instances
- // in echarts. id can be specified by user, or auto generated.
-
- // The id generation rule ensures new view instance are able
- // to mapped to old instance when setOption are called in
- // no-merge mode. So we generate model id by name and plus
- // type in view id.
-
- // name can be duplicated among components, which is convenient
- // to specify multi components (like series) by one name.
-
- // Ensure that each id is distinct.
- var idMap = {};
-
- each(mapResult, function (item, index) {
- var existCpt = item.exist;
- existCpt && (idMap[existCpt.id] = item);
- });
-
- each(mapResult, function (item, index) {
- var opt = item.option;
-
- zrUtil.assert(
- !opt || opt.id == null || !idMap[opt.id] || idMap[opt.id] === item,
- 'id duplicates: ' + (opt && opt.id)
- );
-
- opt && opt.id != null && (idMap[opt.id] = item);
-
- // Complete subType
- if (isObject(opt)) {
- var subType = determineSubType(mainType, opt, item.exist);
- item.keyInfo = {mainType: mainType, subType: subType};
- }
- });
-
- // Make name and id.
- each(mapResult, function (item, index) {
- var existCpt = item.exist;
- var opt = item.option;
- var keyInfo = item.keyInfo;
-
- if (!isObject(opt)) {
- return;
- }
-
- // name can be overwitten. Consider case: axis.name = '20km'.
- // But id generated by name will not be changed, which affect
- // only in that case: setOption with 'not merge mode' and view
- // instance will be recreated, which can be accepted.
- keyInfo.name = opt.name != null
- ? opt.name + ''
- : existCpt
- ? existCpt.name
- : '\0-';
-
- if (existCpt) {
- keyInfo.id = existCpt.id;
- }
- else if (opt.id != null) {
- keyInfo.id = opt.id + '';
- }
- else {
- // Consider this situatoin:
- // optionA: [{name: 'a'}, {name: 'a'}, {..}]
- // optionB [{..}, {name: 'a'}, {name: 'a'}]
- // Series with the same name between optionA and optionB
- // should be mapped.
- var idNum = 0;
- do {
- keyInfo.id = '\0' + keyInfo.name + '\0' + idNum++;
- }
- while (idMap[keyInfo.id]);
- }
-
- idMap[keyInfo.id] = item;
- });
- }
-
- /**
- * @inner
- */
- function determineSubType(mainType, newCptOption, existComponent) {
- var subType = newCptOption.type
- ? newCptOption.type
- : existComponent
- ? existComponent.subType
- // Use determineSubType only when there is no existComponent.
- : ComponentModel.determineSubType(mainType, newCptOption);
-
- // tooltip, markline, markpoint may always has no subType
- return subType;
- }
-
- /**
- * @inner
- */
- function createSeriesIndices(seriesModels) {
- return map(seriesModels, function (series) {
- return series.componentIndex;
- }) || [];
- }
-
- /**
- * @inner
- */
- function filterBySubType(components, condition) {
- // Using hasOwnProperty for restrict. Consider
- // subType is undefined in user payload.
- return condition.hasOwnProperty('subType')
- ? filter(components, function (cpt) {
- return cpt.subType === condition.subType;
- })
- : components;
- }
-
- /**
- * @inner
- */
- function assertSeriesInitialized(ecModel) {
- // Components that use _seriesIndices should depends on series component,
- // which make sure that their initialization is after series.
- if (!ecModel._seriesIndices) {
- throw new Error('Series has not been initialized yet.');
- }
- }
-
- module.exports = GlobalModel;
-
-
-/***/ },
-/* 3 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- */
-
- var Gradient = __webpack_require__(4);
- // 用于处理merge时无法遍历Date等对象的问题
- var BUILTIN_OBJECT = {
- '[object Function]': 1,
- '[object RegExp]': 1,
- '[object Date]': 1,
- '[object Error]': 1,
- '[object CanvasGradient]': 1
- };
-
- var objToString = Object.prototype.toString;
-
- var arrayProto = Array.prototype;
- var nativeForEach = arrayProto.forEach;
- var nativeFilter = arrayProto.filter;
- var nativeSlice = arrayProto.slice;
- var nativeMap = arrayProto.map;
- var nativeReduce = arrayProto.reduce;
-
- /**
- * @param {*} source
- * @return {*} 拷贝后的新对象
- */
- function clone(source) {
- if (typeof source == 'object' && source !== null) {
- var result = source;
- if (source instanceof Array) {
- result = [];
- for (var i = 0, len = source.length; i < len; i++) {
- result[i] = clone(source[i]);
- }
- }
- else if (
- !isBuildInObject(source)
- // 是否为 dom 对象
- && !isDom(source)
- ) {
- result = {};
- for (var key in source) {
- if (source.hasOwnProperty(key)) {
- result[key] = clone(source[key]);
- }
- }
- }
-
- return result;
- }
-
- return source;
- }
-
- /**
- * @param {*} target
- * @param {*} source
- * @param {boolean} [overwrite=false]
- */
- function merge(target, source, overwrite) {
- // We should escapse that source is string
- // and enter for ... in ...
- if (!isObject(source) || !isObject(target)) {
- return overwrite ? clone(source) : target;
- }
-
- for (var key in source) {
- if (source.hasOwnProperty(key)) {
- var targetProp = target[key];
- var sourceProp = source[key];
-
- if (isObject(sourceProp)
- && isObject(targetProp)
- && !isArray(sourceProp)
- && !isArray(targetProp)
- && !isDom(sourceProp)
- && !isDom(targetProp)
- && !isBuildInObject(sourceProp)
- && !isBuildInObject(targetProp)
- ) {
- // 如果需要递归覆盖,就递归调用merge
- merge(targetProp, sourceProp, overwrite);
- }
- else if (overwrite || !(key in target)) {
- // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况
- // NOTE,在 target[key] 不存在的时候也是直接覆盖
- target[key] = clone(source[key], true);
- }
- }
- }
-
- return target;
- }
-
- /**
- * @param {Array} targetAndSources The first item is target, and the rests are source.
- * @param {boolean} [overwrite=false]
- * @return {*} target
- */
- function mergeAll(targetAndSources, overwrite) {
- var result = targetAndSources[0];
- for (var i = 1, len = targetAndSources.length; i < len; i++) {
- result = merge(result, targetAndSources[i], overwrite);
- }
- return result;
- }
-
- /**
- * @param {*} target
- * @param {*} source
- */
- function extend(target, source) {
- for (var key in source) {
- if (source.hasOwnProperty(key)) {
- target[key] = source[key];
- }
- }
- return target;
- }
-
- /**
- * @param {*} target
- * @param {*} source
- * @param {boolen} [overlay=false]
- */
- function defaults(target, source, overlay) {
- for (var key in source) {
- if (source.hasOwnProperty(key)
- && (overlay ? source[key] != null : target[key] == null)
- ) {
- target[key] = source[key];
- }
- }
- return target;
- }
-
- function createCanvas() {
- return document.createElement('canvas');
- }
- // FIXME
- var _ctx;
- function getContext() {
- if (!_ctx) {
- // Use util.createCanvas instead of createCanvas
- // because createCanvas may be overwritten in different environment
- _ctx = util.createCanvas().getContext('2d');
- }
- return _ctx;
- }
-
- /**
- * 查询数组中元素的index
- */
- function indexOf(array, value) {
- if (array) {
- if (array.indexOf) {
- return array.indexOf(value);
- }
- for (var i = 0, len = array.length; i < len; i++) {
- if (array[i] === value) {
- return i;
- }
- }
- }
- return -1;
- }
-
- /**
- * 构造类继承关系
- *
- * @param {Function} clazz 源类
- * @param {Function} baseClazz 基类
- */
- function inherits(clazz, baseClazz) {
- var clazzPrototype = clazz.prototype;
- function F() {}
- F.prototype = baseClazz.prototype;
- clazz.prototype = new F();
-
- for (var prop in clazzPrototype) {
- clazz.prototype[prop] = clazzPrototype[prop];
- }
- clazz.prototype.constructor = clazz;
- clazz.superClass = baseClazz;
- }
-
- /**
- * @param {Object|Function} target
- * @param {Object|Function} sorce
- * @param {boolean} overlay
- */
- function mixin(target, source, overlay) {
- target = 'prototype' in target ? target.prototype : target;
- source = 'prototype' in source ? source.prototype : source;
-
- defaults(target, source, overlay);
- }
-
- /**
- * @param {Array|TypedArray} data
- */
- function isArrayLike(data) {
- if (! data) {
- return;
- }
- if (typeof data == 'string') {
- return false;
- }
- return typeof data.length == 'number';
- }
-
- /**
- * 数组或对象遍历
- * @memberOf module:zrender/tool/util
- * @param {Object|Array} obj
- * @param {Function} cb
- * @param {*} [context]
- */
- function each(obj, cb, context) {
- if (!(obj && cb)) {
- return;
- }
- if (obj.forEach && obj.forEach === nativeForEach) {
- obj.forEach(cb, context);
- }
- else if (obj.length === +obj.length) {
- for (var i = 0, len = obj.length; i < len; i++) {
- cb.call(context, obj[i], i, obj);
- }
- }
- else {
- for (var key in obj) {
- if (obj.hasOwnProperty(key)) {
- cb.call(context, obj[key], key, obj);
- }
- }
- }
- }
-
- /**
- * 数组映射
- * @memberOf module:zrender/tool/util
- * @param {Array} obj
- * @param {Function} cb
- * @param {*} [context]
- * @return {Array}
- */
- function map(obj, cb, context) {
- if (!(obj && cb)) {
- return;
- }
- if (obj.map && obj.map === nativeMap) {
- return obj.map(cb, context);
- }
- else {
- var result = [];
- for (var i = 0, len = obj.length; i < len; i++) {
- result.push(cb.call(context, obj[i], i, obj));
- }
- return result;
- }
- }
-
- /**
- * @memberOf module:zrender/tool/util
- * @param {Array} obj
- * @param {Function} cb
- * @param {Object} [memo]
- * @param {*} [context]
- * @return {Array}
- */
- function reduce(obj, cb, memo, context) {
- if (!(obj && cb)) {
- return;
- }
- if (obj.reduce && obj.reduce === nativeReduce) {
- return obj.reduce(cb, memo, context);
- }
- else {
- for (var i = 0, len = obj.length; i < len; i++) {
- memo = cb.call(context, memo, obj[i], i, obj);
- }
- return memo;
- }
- }
-
- /**
- * 数组过滤
- * @memberOf module:zrender/tool/util
- * @param {Array} obj
- * @param {Function} cb
- * @param {*} [context]
- * @return {Array}
- */
- function filter(obj, cb, context) {
- if (!(obj && cb)) {
- return;
- }
- if (obj.filter && obj.filter === nativeFilter) {
- return obj.filter(cb, context);
- }
- else {
- var result = [];
- for (var i = 0, len = obj.length; i < len; i++) {
- if (cb.call(context, obj[i], i, obj)) {
- result.push(obj[i]);
- }
- }
- return result;
- }
- }
-
- /**
- * 数组项查找
- * @memberOf module:zrender/tool/util
- * @param {Array} obj
- * @param {Function} cb
- * @param {*} [context]
- * @return {Array}
- */
- function find(obj, cb, context) {
- if (!(obj && cb)) {
- return;
- }
- for (var i = 0, len = obj.length; i < len; i++) {
- if (cb.call(context, obj[i], i, obj)) {
- return obj[i];
- }
- }
- }
-
- /**
- * @memberOf module:zrender/tool/util
- * @param {Function} func
- * @param {*} context
- * @return {Function}
- */
- function bind(func, context) {
- var args = nativeSlice.call(arguments, 2);
- return function () {
- return func.apply(context, args.concat(nativeSlice.call(arguments)));
- };
- }
-
- /**
- * @memberOf module:zrender/tool/util
- * @param {Function} func
- * @param {...}
- * @return {Function}
- */
- function curry(func) {
- var args = nativeSlice.call(arguments, 1);
- return function () {
- return func.apply(this, args.concat(nativeSlice.call(arguments)));
- };
- }
-
- /**
- * @memberOf module:zrender/tool/util
- * @param {*} value
- * @return {boolean}
- */
- function isArray(value) {
- return objToString.call(value) === '[object Array]';
- }
-
- /**
- * @memberOf module:zrender/tool/util
- * @param {*} value
- * @return {boolean}
- */
- function isFunction(value) {
- return typeof value === 'function';
- }
-
- /**
- * @memberOf module:zrender/tool/util
- * @param {*} value
- * @return {boolean}
- */
- function isString(value) {
- return objToString.call(value) === '[object String]';
- }
-
- /**
- * @memberOf module:zrender/tool/util
- * @param {*} value
- * @return {boolean}
- */
- function isObject(value) {
- // Avoid a V8 JIT bug in Chrome 19-20.
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
- var type = typeof value;
- return type === 'function' || (!!value && type == 'object');
- }
-
- /**
- * @memberOf module:zrender/tool/util
- * @param {*} value
- * @return {boolean}
- */
- function isBuildInObject(value) {
- return !!BUILTIN_OBJECT[objToString.call(value)]
- || (value instanceof Gradient);
- }
-
- /**
- * @memberOf module:zrender/tool/util
- * @param {*} value
- * @return {boolean}
- */
- function isDom(value) {
- return value && value.nodeType === 1
- && typeof(value.nodeName) == 'string';
- }
-
- /**
- * If value1 is not null, then return value1, otherwise judget rest of values.
- * @param {*...} values
- * @return {*} Final value
- */
- function retrieve(values) {
- for (var i = 0, len = arguments.length; i < len; i++) {
- if (arguments[i] != null) {
- return arguments[i];
- }
- }
- }
-
- /**
- * @memberOf module:zrender/tool/util
- * @param {Array} arr
- * @param {number} startIndex
- * @param {number} endIndex
- * @return {Array}
- */
- function slice() {
- return Function.call.apply(nativeSlice, arguments);
- }
-
- /**
- * @param {boolean} condition
- * @param {string} message
- */
- function assert(condition, message) {
- if (!condition) {
- throw new Error(message);
- }
- }
-
- var util = {
- inherits: inherits,
- mixin: mixin,
- clone: clone,
- merge: merge,
- mergeAll: mergeAll,
- extend: extend,
- defaults: defaults,
- getContext: getContext,
- createCanvas: createCanvas,
- indexOf: indexOf,
- slice: slice,
- find: find,
- isArrayLike: isArrayLike,
- each: each,
- map: map,
- reduce: reduce,
- filter: filter,
- bind: bind,
- curry: curry,
- isArray: isArray,
- isString: isString,
- isObject: isObject,
- isFunction: isFunction,
- isBuildInObject: isBuildInObject,
- isDom: isDom,
- retrieve: retrieve,
- assert: assert,
- noop: function () {}
- };
- module.exports = util;
-
-
-
-/***/ },
-/* 4 */
-/***/ function(module, exports) {
-
-
-
- /**
- * @param {Array.<Object>} colorStops
- */
- var Gradient = function (colorStops) {
-
- this.colorStops = colorStops || [];
- };
-
- Gradient.prototype = {
-
- constructor: Gradient,
-
- addColorStop: function (offset, color) {
- this.colorStops.push({
-
- offset: offset,
-
- color: color
- });
- }
- };
-
- module.exports = Gradient;
-
-
-/***/ },
-/* 5 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var formatUtil = __webpack_require__(6);
- var nubmerUtil = __webpack_require__(7);
- var zrUtil = __webpack_require__(3);
-
- var Model = __webpack_require__(8);
-
- var AXIS_DIMS = ['x', 'y', 'z', 'radius', 'angle'];
-
- var modelUtil = {};
-
- /**
- * Create "each" method to iterate names.
- *
- * @pubilc
- * @param {Array.<string>} names
- * @param {Array.<string>=} attrs
- * @return {Function}
- */
- modelUtil.createNameEach = function (names, attrs) {
- names = names.slice();
- var capitalNames = zrUtil.map(names, modelUtil.capitalFirst);
- attrs = (attrs || []).slice();
- var capitalAttrs = zrUtil.map(attrs, modelUtil.capitalFirst);
-
- return function (callback, context) {
- zrUtil.each(names, function (name, index) {
- var nameObj = {name: name, capital: capitalNames[index]};
-
- for (var j = 0; j < attrs.length; j++) {
- nameObj[attrs[j]] = name + capitalAttrs[j];
- }
-
- callback.call(context, nameObj);
- });
- };
- };
-
- /**
- * @public
- */
- modelUtil.capitalFirst = function (str) {
- return str ? str.charAt(0).toUpperCase() + str.substr(1) : str;
- };
-
- /**
- * Iterate each dimension name.
- *
- * @public
- * @param {Function} callback The parameter is like:
- * {
- * name: 'angle',
- * capital: 'Angle',
- * axis: 'angleAxis',
- * axisIndex: 'angleAixs',
- * index: 'angleIndex'
- * }
- * @param {Object} context
- */
- modelUtil.eachAxisDim = modelUtil.createNameEach(AXIS_DIMS, ['axisIndex', 'axis', 'index']);
-
- /**
- * If value is not array, then translate it to array.
- * @param {*} value
- * @return {Array} [value] or value
- */
- modelUtil.normalizeToArray = function (value) {
- return zrUtil.isArray(value)
- ? value
- : value == null
- ? []
- : [value];
- };
-
- /**
- * If tow dataZoomModels has the same axis controlled, we say that they are 'linked'.
- * dataZoomModels and 'links' make up one or more graphics.
- * This function finds the graphic where the source dataZoomModel is in.
- *
- * @public
- * @param {Function} forEachNode Node iterator.
- * @param {Function} forEachEdgeType edgeType iterator
- * @param {Function} edgeIdGetter Giving node and edgeType, return an array of edge id.
- * @return {Function} Input: sourceNode, Output: Like {nodes: [], dims: {}}
- */
- modelUtil.createLinkedNodesFinder = function (forEachNode, forEachEdgeType, edgeIdGetter) {
-
- return function (sourceNode) {
- var result = {
- nodes: [],
- records: {} // key: edgeType.name, value: Object (key: edge id, value: boolean).
- };
-
- forEachEdgeType(function (edgeType) {
- result.records[edgeType.name] = {};
- });
-
- if (!sourceNode) {
- return result;
- }
-
- absorb(sourceNode, result);
-
- var existsLink;
- do {
- existsLink = false;
- forEachNode(processSingleNode);
- }
- while (existsLink);
-
- function processSingleNode(node) {
- if (!isNodeAbsorded(node, result) && isLinked(node, result)) {
- absorb(node, result);
- existsLink = true;
- }
- }
-
- return result;
- };
-
- function isNodeAbsorded(node, result) {
- return zrUtil.indexOf(result.nodes, node) >= 0;
- }
-
- function isLinked(node, result) {
- var hasLink = false;
- forEachEdgeType(function (edgeType) {
- zrUtil.each(edgeIdGetter(node, edgeType) || [], function (edgeId) {
- result.records[edgeType.name][edgeId] && (hasLink = true);
- });
- });
- return hasLink;
- }
-
- function absorb(node, result) {
- result.nodes.push(node);
- forEachEdgeType(function (edgeType) {
- zrUtil.each(edgeIdGetter(node, edgeType) || [], function (edgeId) {
- result.records[edgeType.name][edgeId] = true;
- });
- });
- }
- };
-
- /**
- * Sync default option between normal and emphasis like `position` and `show`
- * In case some one will write code like
- * label: {
- * normal: {
- * show: false,
- * position: 'outside',
- * textStyle: {
- * fontSize: 18
- * }
- * },
- * emphasis: {
- * show: true
- * }
- * }
- * @param {Object} opt
- * @param {Array.<string>} subOpts
- */
- modelUtil.defaultEmphasis = function (opt, subOpts) {
- if (opt) {
- var emphasisOpt = opt.emphasis = opt.emphasis || {};
- var normalOpt = opt.normal = opt.normal || {};
-
- // Default emphasis option from normal
- zrUtil.each(subOpts, function (subOptName) {
- var val = zrUtil.retrieve(emphasisOpt[subOptName], normalOpt[subOptName]);
- if (val != null) {
- emphasisOpt[subOptName] = val;
- }
- });
- }
- };
-
- /**
- * Create a model proxy to be used in tooltip for edge data, markLine data, markPoint data.
- * @param {Object} opt
- * @param {string} [opt.seriesIndex]
- * @param {Object} [opt.name]
- * @param {module:echarts/data/List} data
- * @param {Array.<Object>} rawData
- */
- modelUtil.createDataFormatModel = function (opt, data, rawData) {
- var model = new Model();
- zrUtil.mixin(model, modelUtil.dataFormatMixin);
- model.seriesIndex = opt.seriesIndex;
- model.name = opt.name || '';
-
- model.getData = function () {
- return data;
- };
- model.getRawDataArray = function () {
- return rawData;
- };
- return model;
- };
-
- /**
- * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]
- * This helper method retieves value from data.
- * @param {string|number|Date|Array|Object} dataItem
- * @return {number|string|Date|Array.<number|string|Date>}
- */
- modelUtil.getDataItemValue = function (dataItem) {
- // Performance sensitive.
- return dataItem && (dataItem.value == null ? dataItem : dataItem.value);
- };
-
- /**
- * This helper method convert value in data.
- * @param {string|number|Date} value
- * @param {Object|string} [dimInfo] If string (like 'x'), dimType defaults 'number'.
- */
- modelUtil.converDataValue = function (value, dimInfo) {
- // Performance sensitive.
- var dimType = dimInfo && dimInfo.type;
- if (dimType === 'ordinal') {
- return value;
- }
-
- if (dimType === 'time' && !isFinite(value) && value != null && value !== '-') {
- value = +nubmerUtil.parseDate(value);
- }
-
- // dimType defaults 'number'.
- // If dimType is not ordinal and value is null or undefined or NaN or '-',
- // parse to NaN.
- return (value == null || value === '')
- ? NaN : +value; // If string (like '-'), using '+' parse to NaN
- };
-
- modelUtil.dataFormatMixin = {
- /**
- * Get params for formatter
- * @param {number} dataIndex
- * @return {Object}
- */
- getDataParams: function (dataIndex) {
- var data = this.getData();
-
- var seriesIndex = this.seriesIndex;
- var seriesName = this.name;
-
- var rawValue = this.getRawValue(dataIndex);
- var rawDataIndex = data.getRawIndex(dataIndex);
- var name = data.getName(dataIndex, true);
-
- // Data may not exists in the option given by user
- var rawDataArray = this.getRawDataArray();
- var itemOpt = rawDataArray && rawDataArray[rawDataIndex];
-
- return {
- seriesIndex: seriesIndex,
- seriesName: seriesName,
- name: name,
- dataIndex: rawDataIndex,
- data: itemOpt,
- value: rawValue,
- color: data.getItemVisual(dataIndex, 'color'),
-
- // Param name list for mapping `a`, `b`, `c`, `d`, `e`
- $vars: ['seriesName', 'name', 'value']
- };
- },
-
- /**
- * Format label
- * @param {number} dataIndex
- * @param {string} [status='normal'] 'normal' or 'emphasis'
- * @param {Function|string} [formatter] Default use the `itemStyle[status].label.formatter`
- * @return {string}
- */
- getFormattedLabel: function (dataIndex, status, formatter) {
- status = status || 'normal';
- var data = this.getData();
- var itemModel = data.getItemModel(dataIndex);
-
- var params = this.getDataParams(dataIndex);
- if (formatter == null) {
- formatter = itemModel.get(['label', status, 'formatter']);
- }
-
- if (typeof formatter === 'function') {
- params.status = status;
- return formatter(params);
- }
- else if (typeof formatter === 'string') {
- return formatUtil.formatTpl(formatter, params);
- }
- },
-
- /**
- * Get raw value in option
- * @param {number} idx
- * @return {Object}
- */
- getRawValue: function (idx) {
- var itemModel = this.getData().getItemModel(idx);
- if (itemModel && itemModel.option != null) {
- var dataItem = itemModel.option;
- return (zrUtil.isObject(dataItem) && !zrUtil.isArray(dataItem))
- ? dataItem.value : dataItem;
- }
- }
- };
-
- /**
- * Mapping to exists for merge.
- *
- * @public
- * @param {Array.<Object>|Array.<module:echarts/model/Component>} exists
- * @param {Object|Array.<Object>} newCptOptions
- * @return {Array.<Object>} Result, like [{exist: ..., option: ...}, {}],
- * which order is the same as exists.
- */
- modelUtil.mappingToExists = function (exists, newCptOptions) {
- // Mapping by the order by original option (but not order of
- // new option) in merge mode. Because we should ensure
- // some specified index (like xAxisIndex) is consistent with
- // original option, which is easy to understand, espatially in
- // media query. And in most case, merge option is used to
- // update partial option but not be expected to change order.
- newCptOptions = (newCptOptions || []).slice();
-
- var result = zrUtil.map(exists || [], function (obj, index) {
- return {exist: obj};
- });
-
- // Mapping by id or name if specified.
- zrUtil.each(newCptOptions, function (cptOption, index) {
- if (!zrUtil.isObject(cptOption)) {
- return;
- }
-
- for (var i = 0; i < result.length; i++) {
- var exist = result[i].exist;
- if (!result[i].option // Consider name: two map to one.
- && (
- // id has highest priority.
- (cptOption.id != null && exist.id === cptOption.id + '')
- || (cptOption.name != null
- && !modelUtil.isIdInner(cptOption)
- && !modelUtil.isIdInner(exist)
- && exist.name === cptOption.name + ''
- )
- )
- ) {
- result[i].option = cptOption;
- newCptOptions[index] = null;
- break;
- }
- }
- });
-
- // Otherwise mapping by index.
- zrUtil.each(newCptOptions, function (cptOption, index) {
- if (!zrUtil.isObject(cptOption)) {
- return;
- }
-
- var i = 0;
- for (; i < result.length; i++) {
- var exist = result[i].exist;
- if (!result[i].option
- && !modelUtil.isIdInner(exist)
- // Caution:
- // Do not overwrite id. But name can be overwritten,
- // because axis use name as 'show label text'.
- // 'exist' always has id and name and we dont
- // need to check it.
- && cptOption.id == null
- ) {
- result[i].option = cptOption;
- break;
- }
- }
-
- if (i >= result.length) {
- result.push({option: cptOption});
- }
- });
-
- return result;
- };
-
- /**
- * @public
- * @param {Object} cptOption
- * @return {boolean}
- */
- modelUtil.isIdInner = function (cptOption) {
- return zrUtil.isObject(cptOption)
- && cptOption.id
- && (cptOption.id + '').indexOf('\0_ec_\0') === 0;
- };
-
- module.exports = modelUtil;
-
-
-/***/ },
-/* 6 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var numberUtil = __webpack_require__(7);
-
- /**
- * 每三位默认加,格式化
- * @type {string|number} x
- */
- function addCommas(x) {
- if (isNaN(x)) {
- return '-';
- }
- x = (x + '').split('.');
- return x[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,'$1,')
- + (x.length > 1 ? ('.' + x[1]) : '');
- }
-
- /**
- * @param {string} str
- * @return {string} str
- */
- function toCamelCase(str) {
- return str.toLowerCase().replace(/-(.)/g, function(match, group1) {
- return group1.toUpperCase();
- });
- }
-
- /**
- * Normalize css liked array configuration
- * e.g.
- * 3 => [3, 3, 3, 3]
- * [4, 2] => [4, 2, 4, 2]
- * [4, 3, 2] => [4, 3, 2, 3]
- * @param {number|Array.<number>} val
- */
- function normalizeCssArray(val) {
- var len = val.length;
- if (typeof (val) === 'number') {
- return [val, val, val, val];
- }
- else if (len === 2) {
- // vertical | horizontal
- return [val[0], val[1], val[0], val[1]];
- }
- else if (len === 3) {
- // top | horizontal | bottom
- return [val[0], val[1], val[2], val[1]];
- }
- return val;
- }
-
- function encodeHTML(source) {
- return String(source)
- .replace(/&/g, '&amp;')
- .replace(/</g, '&lt;')
- .replace(/>/g, '&gt;')
- .replace(/"/g, '&quot;')
- .replace(/'/g, '&#39;');
- }
-
- var TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];
-
- function wrapVar(varName, seriesIdx) {
- return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}';
- }
- /**
- * Template formatter
- * @param {string} tpl
- * @param {Array.<Object>|Object} paramsList
- * @return {string}
- */
- function formatTpl(tpl, paramsList) {
- if (!zrUtil.isArray(paramsList)) {
- paramsList = [paramsList];
- }
- var seriesLen = paramsList.length;
- if (!seriesLen) {
- return '';
- }
-
- var $vars = paramsList[0].$vars;
- for (var i = 0; i < $vars.length; i++) {
- var alias = TPL_VAR_ALIAS[i];
- tpl = tpl.replace(wrapVar(alias), wrapVar(alias, 0));
- }
- for (var seriesIdx = 0; seriesIdx < seriesLen; seriesIdx++) {
- for (var k = 0; k < $vars.length; k++) {
- tpl = tpl.replace(
- wrapVar(TPL_VAR_ALIAS[k], seriesIdx),
- paramsList[seriesIdx][$vars[k]]
- );
- }
- }
-
- return tpl;
- }
-
- /**
- * ISO Date format
- * @param {string} tpl
- * @param {number} value
- * @inner
- */
- function formatTime(tpl, value) {
- if (tpl === 'week'
- || tpl === 'month'
- || tpl === 'quarter'
- || tpl === 'half-year'
- || tpl === 'year'
- ) {
- tpl = 'MM-dd\nyyyy';
- }
-
- var date = numberUtil.parseDate(value);
- var y = date.getFullYear();
- var M = date.getMonth() + 1;
- var d = date.getDate();
- var h = date.getHours();
- var m = date.getMinutes();
- var s = date.getSeconds();
-
- tpl = tpl.replace('MM', s2d(M))
- .toLowerCase()
- .replace('yyyy', y)
- .replace('yy', y % 100)
- .replace('dd', s2d(d))
- .replace('d', d)
- .replace('hh', s2d(h))
- .replace('h', h)
- .replace('mm', s2d(m))
- .replace('m', m)
- .replace('ss', s2d(s))
- .replace('s', s);
-
- return tpl;
- }
-
- /**
- * @param {string} str
- * @return {string}
- * @inner
- */
- function s2d(str) {
- return str < 10 ? ('0' + str) : str;
- }
-
- module.exports = {
-
- normalizeCssArray: normalizeCssArray,
-
- addCommas: addCommas,
-
- toCamelCase: toCamelCase,
-
- encodeHTML: encodeHTML,
-
- formatTpl: formatTpl,
-
- formatTime: formatTime
- };
-
-
-/***/ },
-/* 7 */
-/***/ function(module, exports) {
-
- /**
- * 数值处理模块
- * @module echarts/util/number
- */
-
-
-
- var number = {};
-
- var RADIAN_EPSILON = 1e-4;
-
- function _trim(str) {
- return str.replace(/^\s+/, '').replace(/\s+$/, '');
- }
-
- /**
- * Linear mapping a value from domain to range
- * @memberOf module:echarts/util/number
- * @param {(number|Array.<number>)} val
- * @param {Array.<number>} domain Domain extent domain[0] can be bigger than domain[1]
- * @param {Array.<number>} range Range extent range[0] can be bigger than range[1]
- * @param {boolean} clamp
- * @return {(number|Array.<number>}
- */
- number.linearMap = function (val, domain, range, clamp) {
-
- var sub = domain[1] - domain[0];
-
- if (sub === 0) {
- return (range[0] + range[1]) / 2;
- }
- var t = (val - domain[0]) / sub;
-
- if (clamp) {
- t = Math.min(Math.max(t, 0), 1);
- }
-
- return t * (range[1] - range[0]) + range[0];
- };
-
- /**
- * Convert a percent string to absolute number.
- * Returns NaN if percent is not a valid string or number
- * @memberOf module:echarts/util/number
- * @param {string|number} percent
- * @param {number} all
- * @return {number}
- */
- number.parsePercent = function(percent, all) {
- switch (percent) {
- case 'center':
- case 'middle':
- percent = '50%';
- break;
- case 'left':
- case 'top':
- percent = '0%';
- break;
- case 'right':
- case 'bottom':
- percent = '100%';
- break;
- }
- if (typeof percent === 'string') {
- if (_trim(percent).match(/%$/)) {
- return parseFloat(percent) / 100 * all;
- }
-
- return parseFloat(percent);
- }
-
- return percent == null ? NaN : +percent;
- };
-
- /**
- * Fix rounding error of float numbers
- * @param {number} x
- * @return {number}
- */
- number.round = function (x) {
- // PENDING
- return +(+x).toFixed(12);
- };
-
- number.asc = function (arr) {
- arr.sort(function (a, b) {
- return a - b;
- });
- return arr;
- };
-
- /**
- * Get precision
- * @param {number} val
- */
- number.getPrecision = function (val) {
- if (isNaN(val)) {
- return 0;
- }
- // It is much faster than methods converting number to string as follows
- // var tmp = val.toString();
- // return tmp.length - 1 - tmp.indexOf('.');
- // especially when precision is low
- var e = 1;
- var count = 0;
- while (Math.round(val * e) / e !== val) {
- e *= 10;
- count++;
- }
- return count;
- };
-
- /**
- * @param {Array.<number>} dataExtent
- * @param {Array.<number>} pixelExtent
- * @return {number} precision
- */
- number.getPixelPrecision = function (dataExtent, pixelExtent) {
- var log = Math.log;
- var LN10 = Math.LN10;
- var dataQuantity = Math.floor(log(dataExtent[1] - dataExtent[0]) / LN10);
- var sizeQuantity = Math.round(log(Math.abs(pixelExtent[1] - pixelExtent[0])) / LN10);
- return Math.max(
- -dataQuantity + sizeQuantity,
- 0
- );
- };
-
- // Number.MAX_SAFE_INTEGER, ie do not support.
- number.MAX_SAFE_INTEGER = 9007199254740991;
-
- /**
- * To 0 - 2 * PI, considering negative radian.
- * @param {number} radian
- * @return {number}
- */
- number.remRadian = function (radian) {
- var pi2 = Math.PI * 2;
- return (radian % pi2 + pi2) % pi2;
- };
-
- /**
- * @param {type} radian
- * @return {boolean}
- */
- number.isRadianAroundZero = function (val) {
- return val > -RADIAN_EPSILON && val < RADIAN_EPSILON;
- };
-
- /**
- * @param {string|Date|number} value
- * @return {number} timestamp
- */
- number.parseDate = function (value) {
- return value instanceof Date
- ? value
- : new Date(
- typeof value === 'string'
- ? value.replace(/-/g, '/')
- : Math.round(value)
- );
- };
-
- // "Nice Numbers for Graph Labels" of Graphic Gems
- /**
- * find a “nice” number approximately equal to x. Round the number if round = true, take ceiling if round = false
- * The primary observation is that the “nicest” numbers in decimal are 1, 2, and 5, and all power-of-ten multiples of these numbers.
- * @param {number} val
- * @param {boolean} round
- * @return {number}
- */
- number.nice = function (val, round) {
- var exp = Math.floor(Math.log(val) / Math.LN10);
- var exp10 = Math.pow(10, exp);
- var f = val / exp10; // between 1 and 10
- var nf;
- if (round) {
- if (f < 1.5) { nf = 1; }
- else if (f < 2.5) { nf = 2; }
- else if (f < 4) { nf = 3; }
- else if (f < 7) { nf = 5; }
- else { nf = 10; }
- }
- else {
- if (f < 1) { nf = 1; }
- else if (f < 2) { nf = 2; }
- else if (f < 3) { nf = 3; }
- else if (f < 5) { nf = 5; }
- else { nf = 10; }
- }
- return nf * exp10;
- };
-
- module.exports = number;
-
-
-/***/ },
-/* 8 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @module echarts/model/Model
- */
-
-
- var zrUtil = __webpack_require__(3);
- var clazzUtil = __webpack_require__(9);
-
- /**
- * @alias module:echarts/model/Model
- * @constructor
- * @param {Object} option
- * @param {module:echarts/model/Model} parentModel
- * @param {module:echarts/model/Global} ecModel
- * @param {Object} extraOpt
- */
- function Model(option, parentModel, ecModel, extraOpt) {
- /**
- * @type {module:echarts/model/Model}
- * @readOnly
- */
- this.parentModel = parentModel;
-
- /**
- * @type {module:echarts/model/Global}
- * @readOnly
- */
- this.ecModel = ecModel;
-
- /**
- * @type {Object}
- * @protected
- */
- this.option = option;
-
- // Simple optimization
- if (this.init) {
- if (arguments.length <= 4) {
- this.init(option, parentModel, ecModel, extraOpt);
- }
- else {
- this.init.apply(this, arguments);
- }
- }
- }
-
- Model.prototype = {
-
- constructor: Model,
-
- /**
- * Model 的初始化函数
- * @param {Object} option
- */
- init: null,
-
- /**
- * 从新的 Option merge
- */
- mergeOption: function (option) {
- zrUtil.merge(this.option, option, true);
- },
-
- /**
- * @param {string} path
- * @param {boolean} [ignoreParent=false]
- * @return {*}
- */
- get: function (path, ignoreParent) {
- if (!path) {
- return this.option;
- }
-
- if (typeof path === 'string') {
- path = path.split('.');
- }
-
- var obj = this.option;
- var parentModel = this.parentModel;
- for (var i = 0; i < path.length; i++) {
- // obj could be number/string/... (like 0)
- obj = (obj && typeof obj === 'object') ? obj[path[i]] : null;
- if (obj == null) {
- break;
- }
- }
- if (obj == null && parentModel && !ignoreParent) {
- obj = parentModel.get(path);
- }
- return obj;
- },
-
- /**
- * @param {string} key
- * @param {boolean} [ignoreParent=false]
- * @return {*}
- */
- getShallow: function (key, ignoreParent) {
- var option = this.option;
- var val = option && option[key];
- var parentModel = this.parentModel;
- if (val == null && parentModel && !ignoreParent) {
- val = parentModel.getShallow(key);
- }
- return val;
- },
-
- /**
- * @param {string} path
- * @param {module:echarts/model/Model} [parentModel]
- * @return {module:echarts/model/Model}
- */
- getModel: function (path, parentModel) {
- var obj = this.get(path, true);
- var thisParentModel = this.parentModel;
- var model = new Model(
- obj, parentModel || (thisParentModel && thisParentModel.getModel(path)),
- this.ecModel
- );
- return model;
- },
-
- /**
- * If model has option
- */
- isEmpty: function () {
- return this.option == null;
- },
-
- restoreData: function () {},
-
- // Pending
- clone: function () {
- var Ctor = this.constructor;
- return new Ctor(zrUtil.clone(this.option));
- },
-
- setReadOnly: function (properties) {
- clazzUtil.setReadOnly(this, properties);
- }
- };
-
- // Enable Model.extend.
- clazzUtil.enableClassExtend(Model);
-
- var mixin = zrUtil.mixin;
- mixin(Model, __webpack_require__(10));
- mixin(Model, __webpack_require__(12));
- mixin(Model, __webpack_require__(13));
- mixin(Model, __webpack_require__(18));
-
- module.exports = Model;
-
-
-/***/ },
-/* 9 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
-
- var clazz = {};
-
- var TYPE_DELIMITER = '.';
- var IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';
- /**
- * @public
- */
- var parseClassType = clazz.parseClassType = function (componentType) {
- var ret = {main: '', sub: ''};
- if (componentType) {
- componentType = componentType.split(TYPE_DELIMITER);
- ret.main = componentType[0] || '';
- ret.sub = componentType[1] || '';
- }
- return ret;
- };
- /**
- * @public
- */
- clazz.enableClassExtend = function (RootClass, preConstruct) {
- RootClass.extend = function (proto) {
- var ExtendedClass = function () {
- preConstruct && preConstruct.apply(this, arguments);
- RootClass.apply(this, arguments);
- };
-
- zrUtil.extend(ExtendedClass.prototype, proto);
-
- ExtendedClass.extend = this.extend;
- ExtendedClass.superCall = superCall;
- ExtendedClass.superApply = superApply;
- zrUtil.inherits(ExtendedClass, this);
- ExtendedClass.superClass = this;
-
- return ExtendedClass;
- };
- };
-
- // superCall should have class info, which can not be fetch from 'this'.
- // Consider this case:
- // class A has method f,
- // class B inherits class A, overrides method f, f call superApply('f'),
- // class C inherits class B, do not overrides method f,
- // then when method of class C is called, dead loop occured.
- function superCall(context, methodName) {
- var args = zrUtil.slice(arguments, 2);
- return this.superClass.prototype[methodName].apply(context, args);
- }
-
- function superApply(context, methodName, args) {
- return this.superClass.prototype[methodName].apply(context, args);
- }
-
- /**
- * @param {Object} entity
- * @param {Object} options
- * @param {boolean} [options.registerWhenExtend]
- * @public
- */
- clazz.enableClassManagement = function (entity, options) {
- options = options || {};
-
- /**
- * Component model classes
- * key: componentType,
- * value:
- * componentClass, when componentType is 'xxx'
- * or Object.<subKey, componentClass>, when componentType is 'xxx.yy'
- * @type {Object}
- */
- var storage = {};
-
- entity.registerClass = function (Clazz, componentType) {
- if (componentType) {
- componentType = parseClassType(componentType);
-
- if (!componentType.sub) {
- if (storage[componentType.main]) {
- throw new Error(componentType.main + 'exists.');
- }
- storage[componentType.main] = Clazz;
- }
- else if (componentType.sub !== IS_CONTAINER) {
- var container = makeContainer(componentType);
- container[componentType.sub] = Clazz;
- }
- }
- return Clazz;
- };
-
- entity.getClass = function (componentTypeMain, subType, throwWhenNotFound) {
- var Clazz = storage[componentTypeMain];
-
- if (Clazz && Clazz[IS_CONTAINER]) {
- Clazz = subType ? Clazz[subType] : null;
- }
-
- if (throwWhenNotFound && !Clazz) {
- throw new Error(
- 'Component ' + componentTypeMain + '.' + (subType || '') + ' not exists. Load it first.'
- );
- }
-
- return Clazz;
- };
-
- entity.getClassesByMainType = function (componentType) {
- componentType = parseClassType(componentType);
-
- var result = [];
- var obj = storage[componentType.main];
-
- if (obj && obj[IS_CONTAINER]) {
- zrUtil.each(obj, function (o, type) {
- type !== IS_CONTAINER && result.push(o);
- });
- }
- else {
- result.push(obj);
- }
-
- return result;
- };
-
- entity.hasClass = function (componentType) {
- // Just consider componentType.main.
- componentType = parseClassType(componentType);
- return !!storage[componentType.main];
- };
-
- /**
- * @return {Array.<string>} Like ['aa', 'bb'], but can not be ['aa.xx']
- */
- entity.getAllClassMainTypes = function () {
- var types = [];
- zrUtil.each(storage, function (obj, type) {
- types.push(type);
- });
- return types;
- };
-
- /**
- * If a main type is container and has sub types
- * @param {string} mainType
- * @return {boolean}
- */
- entity.hasSubTypes = function (componentType) {
- componentType = parseClassType(componentType);
- var obj = storage[componentType.main];
- return obj && obj[IS_CONTAINER];
- };
-
- entity.parseClassType = parseClassType;
-
- function makeContainer(componentType) {
- var container = storage[componentType.main];
- if (!container || !container[IS_CONTAINER]) {
- container = storage[componentType.main] = {};
- container[IS_CONTAINER] = true;
- }
- return container;
- }
-
- if (options.registerWhenExtend) {
- var originalExtend = entity.extend;
- if (originalExtend) {
- entity.extend = function (proto) {
- var ExtendedClass = originalExtend.call(this, proto);
- return entity.registerClass(ExtendedClass, proto.type);
- };
- }
- }
-
- return entity;
- };
-
- /**
- * @param {string|Array.<string>} properties
- */
- clazz.setReadOnly = function (obj, properties) {
- // FIXME It seems broken in IE8 simulation of IE11
- // if (!zrUtil.isArray(properties)) {
- // properties = properties != null ? [properties] : [];
- // }
- // zrUtil.each(properties, function (prop) {
- // var value = obj[prop];
-
- // Object.defineProperty
- // && Object.defineProperty(obj, prop, {
- // value: value, writable: false
- // });
- // zrUtil.isArray(obj[prop])
- // && Object.freeze
- // && Object.freeze(obj[prop]);
- // });
- };
-
- module.exports = clazz;
-
-
-/***/ },
-/* 10 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- var getLineStyle = __webpack_require__(11)(
- [
- ['lineWidth', 'width'],
- ['stroke', 'color'],
- ['opacity'],
- ['shadowBlur'],
- ['shadowOffsetX'],
- ['shadowOffsetY'],
- ['shadowColor']
- ]
- );
- module.exports = {
- getLineStyle: function (excludes) {
- var style = getLineStyle.call(this, excludes);
- var lineDash = this.getLineDash();
- lineDash && (style.lineDash = lineDash);
- return style;
- },
-
- getLineDash: function () {
- var lineType = this.get('type');
- return (lineType === 'solid' || lineType == null) ? null
- : (lineType === 'dashed' ? [5, 5] : [1, 1]);
- }
- };
-
-
-/***/ },
-/* 11 */
-/***/ function(module, exports, __webpack_require__) {
-
- // TODO Parse shadow style
- // TODO Only shallow path support
-
- var zrUtil = __webpack_require__(3);
-
- module.exports = function (properties) {
- // Normalize
- for (var i = 0; i < properties.length; i++) {
- if (!properties[i][1]) {
- properties[i][1] = properties[i][0];
- }
- }
- return function (excludes) {
- var style = {};
- for (var i = 0; i < properties.length; i++) {
- var propName = properties[i][1];
- if (excludes && zrUtil.indexOf(excludes, propName) >= 0) {
- continue;
- }
- var val = this.getShallow(propName);
- if (val != null) {
- style[properties[i][0]] = val;
- }
- }
- return style;
- };
- };
-
-
-/***/ },
-/* 12 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- module.exports = {
- getAreaStyle: __webpack_require__(11)(
- [
- ['fill', 'color'],
- ['shadowBlur'],
- ['shadowOffsetX'],
- ['shadowOffsetY'],
- ['opacity'],
- ['shadowColor']
- ]
- )
- };
-
-
-/***/ },
-/* 13 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var textContain = __webpack_require__(14);
-
- function getShallow(model, path) {
- return model && model.getShallow(path);
- }
-
- module.exports = {
- /**
- * Get color property or get color from option.textStyle.color
- * @return {string}
- */
- getTextColor: function () {
- var ecModel = this.ecModel;
- return this.getShallow('color')
- || (ecModel && ecModel.get('textStyle.color'));
- },
-
- /**
- * Create font string from fontStyle, fontWeight, fontSize, fontFamily
- * @return {string}
- */
- getFont: function () {
- var ecModel = this.ecModel;
- var gTextStyleModel = ecModel && ecModel.getModel('textStyle');
- return [
- // FIXME in node-canvas fontWeight is before fontStyle
- this.getShallow('fontStyle') || getShallow(gTextStyleModel, 'fontStyle'),
- this.getShallow('fontWeight') || getShallow(gTextStyleModel, 'fontWeight'),
- (this.getShallow('fontSize') || getShallow(gTextStyleModel, 'fontSize') || 12) + 'px',
- this.getShallow('fontFamily') || getShallow(gTextStyleModel, 'fontFamily') || 'sans-serif'
- ].join(' ');
- },
-
- getTextRect: function (text) {
- var textStyle = this.get('textStyle') || {};
- return textContain.getBoundingRect(
- text,
- this.getFont(),
- textStyle.align,
- textStyle.baseline
- );
- },
-
- ellipsis: function (text, containerWidth, options) {
- return textContain.ellipsis(
- text, this.getFont(), containerWidth, options
- );
- }
- };
-
-
-/***/ },
-/* 14 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var textWidthCache = {};
- var textWidthCacheCounter = 0;
- var TEXT_CACHE_MAX = 5000;
-
- var util = __webpack_require__(3);
- var BoundingRect = __webpack_require__(15);
-
- function getTextWidth(text, textFont) {
- var key = text + ':' + textFont;
- if (textWidthCache[key]) {
- return textWidthCache[key];
- }
-
- var textLines = (text + '').split('\n');
- var width = 0;
-
- for (var i = 0, l = textLines.length; i < l; i++) {
- // measureText 可以被覆盖以兼容不支持 Canvas 的环境
- width = Math.max(textContain.measureText(textLines[i], textFont).width, width);
- }
-
- if (textWidthCacheCounter > TEXT_CACHE_MAX) {
- textWidthCacheCounter = 0;
- textWidthCache = {};
- }
- textWidthCacheCounter++;
- textWidthCache[key] = width;
-
- return width;
- }
-
- function getTextRect(text, textFont, textAlign, textBaseline) {
- var textLineLen = ((text || '') + '').split('\n').length;
-
- var width = getTextWidth(text, textFont);
- // FIXME 高度计算比较粗暴
- var lineHeight = getTextWidth('国', textFont);
- var height = textLineLen * lineHeight;
-
- var rect = new BoundingRect(0, 0, width, height);
- // Text has a special line height property
- rect.lineHeight = lineHeight;
-
- switch (textBaseline) {
- case 'bottom':
- case 'alphabetic':
- rect.y -= lineHeight;
- break;
- case 'middle':
- rect.y -= lineHeight / 2;
- break;
- // case 'hanging':
- // case 'top':
- }
-
- // FIXME Right to left language
- switch (textAlign) {
- case 'end':
- case 'right':
- rect.x -= rect.width;
- break;
- case 'center':
- rect.x -= rect.width / 2;
- break;
- // case 'start':
- // case 'left':
- }
-
- return rect;
- }
-
- function adjustTextPositionOnRect(textPosition, rect, textRect, distance) {
-
- var x = rect.x;
- var y = rect.y;
-
- var height = rect.height;
- var width = rect.width;
-
- var textHeight = textRect.height;
-
- var halfHeight = height / 2 - textHeight / 2;
-
- var textAlign = 'left';
-
- switch (textPosition) {
- case 'left':
- x -= distance;
- y += halfHeight;
- textAlign = 'right';
- break;
- case 'right':
- x += distance + width;
- y += halfHeight;
- textAlign = 'left';
- break;
- case 'top':
- x += width / 2;
- y -= distance + textHeight;
- textAlign = 'center';
- break;
- case 'bottom':
- x += width / 2;
- y += height + distance;
- textAlign = 'center';
- break;
- case 'inside':
- x += width / 2;
- y += halfHeight;
- textAlign = 'center';
- break;
- case 'insideLeft':
- x += distance;
- y += halfHeight;
- textAlign = 'left';
- break;
- case 'insideRight':
- x += width - distance;
- y += halfHeight;
- textAlign = 'right';
- break;
- case 'insideTop':
- x += width / 2;
- y += distance;
- textAlign = 'center';
- break;
- case 'insideBottom':
- x += width / 2;
- y += height - textHeight - distance;
- textAlign = 'center';
- break;
- case 'insideTopLeft':
- x += distance;
- y += distance;
- textAlign = 'left';
- break;
- case 'insideTopRight':
- x += width - distance;
- y += distance;
- textAlign = 'right';
- break;
- case 'insideBottomLeft':
- x += distance;
- y += height - textHeight - distance;
- break;
- case 'insideBottomRight':
- x += width - distance;
- y += height - textHeight - distance;
- textAlign = 'right';
- break;
- }
-
- return {
- x: x,
- y: y,
- textAlign: textAlign,
- textBaseline: 'top'
- };
- }
-
- /**
- * Show ellipsis if overflow.
- *
- * @param {string} text
- * @param {string} textFont
- * @param {string} containerWidth
- * @param {Object} [options]
- * @param {number} [options.ellipsis='...']
- * @param {number} [options.maxIterations=3]
- * @param {number} [options.minCharacters=3]
- * @return {string}
- */
- function textEllipsis(text, textFont, containerWidth, options) {
- if (!containerWidth) {
- return '';
- }
-
- options = util.defaults({
- ellipsis: '...',
- minCharacters: 3,
- maxIterations: 3,
- cnCharWidth: getTextWidth('国', textFont),
- // FIXME
- // 未考虑非等宽字体
- ascCharWidth: getTextWidth('a', textFont)
- }, options, true);
-
- containerWidth -= getTextWidth(options.ellipsis);
-
- var textLines = (text + '').split('\n');
-
- for (var i = 0, len = textLines.length; i < len; i++) {
- textLines[i] = textLineTruncate(
- textLines[i], textFont, containerWidth, options
- );
- }
-
- return textLines.join('\n');
- }
-
- function textLineTruncate(text, textFont, containerWidth, options) {
- // FIXME
- // 粗糙得写的,尚未考虑性能和各种语言、字体的效果。
- for (var i = 0;; i++) {
- var lineWidth = getTextWidth(text, textFont);
-
- if (lineWidth < containerWidth || i >= options.maxIterations) {
- text += options.ellipsis;
- break;
- }
-
- var subLength = i === 0
- ? estimateLength(text, containerWidth, options)
- : Math.floor(text.length * containerWidth / lineWidth);
-
- if (subLength < options.minCharacters) {
- text = '';
- break;
- }
-
- text = text.substr(0, subLength);
- }
-
- return text;
- }
-
- function estimateLength(text, containerWidth, options) {
- var width = 0;
- var i = 0;
- for (var len = text.length; i < len && width < containerWidth; i++) {
- var charCode = text.charCodeAt(i);
- width += (0 <= charCode && charCode <= 127)
- ? options.ascCharWidth : options.cnCharWidth;
- }
- return i;
- }
-
- var textContain = {
-
- getWidth: getTextWidth,
-
- getBoundingRect: getTextRect,
-
- adjustTextPositionOnRect: adjustTextPositionOnRect,
-
- ellipsis: textEllipsis,
-
- measureText: function (text, textFont) {
- var ctx = util.getContext();
- ctx.font = textFont;
- return ctx.measureText(text);
- }
- };
-
- module.exports = textContain;
-
-
-/***/ },
-/* 15 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * @module echarts/core/BoundingRect
- */
-
-
- var vec2 = __webpack_require__(16);
- var matrix = __webpack_require__(17);
-
- var v2ApplyTransform = vec2.applyTransform;
- var mathMin = Math.min;
- var mathAbs = Math.abs;
- var mathMax = Math.max;
- /**
- * @alias module:echarts/core/BoundingRect
- */
- function BoundingRect(x, y, width, height) {
- /**
- * @type {number}
- */
- this.x = x;
- /**
- * @type {number}
- */
- this.y = y;
- /**
- * @type {number}
- */
- this.width = width;
- /**
- * @type {number}
- */
- this.height = height;
- }
-
- BoundingRect.prototype = {
-
- constructor: BoundingRect,
-
- /**
- * @param {module:echarts/core/BoundingRect} other
- */
- union: function (other) {
- var x = mathMin(other.x, this.x);
- var y = mathMin(other.y, this.y);
-
- this.width = mathMax(
- other.x + other.width,
- this.x + this.width
- ) - x;
- this.height = mathMax(
- other.y + other.height,
- this.y + this.height
- ) - y;
- this.x = x;
- this.y = y;
- },
-
- /**
- * @param {Array.<number>} m
- * @methods
- */
- applyTransform: (function () {
- var min = [];
- var max = [];
- return function (m) {
- // In case usage like this
- // el.getBoundingRect().applyTransform(el.transform)
- // And element has no transform
- if (!m) {
- return;
- }
- min[0] = this.x;
- min[1] = this.y;
- max[0] = this.x + this.width;
- max[1] = this.y + this.height;
-
- v2ApplyTransform(min, min, m);
- v2ApplyTransform(max, max, m);
-
- this.x = mathMin(min[0], max[0]);
- this.y = mathMin(min[1], max[1]);
- this.width = mathAbs(max[0] - min[0]);
- this.height = mathAbs(max[1] - min[1]);
- };
- })(),
-
- /**
- * Calculate matrix of transforming from self to target rect
- * @param {module:zrender/core/BoundingRect} b
- * @return {Array.<number>}
- */
- calculateTransform: function (b) {
- var a = this;
- var sx = b.width / a.width;
- var sy = b.height / a.height;
-
- var m = matrix.create();
-
- // 矩阵右乘
- matrix.translate(m, m, [-a.x, -a.y]);
- matrix.scale(m, m, [sx, sy]);
- matrix.translate(m, m, [b.x, b.y]);
-
- return m;
- },
-
- /**
- * @param {(module:echarts/core/BoundingRect|Object)} b
- * @return {boolean}
- */
- intersect: function (b) {
- var a = this;
- var ax0 = a.x;
- var ax1 = a.x + a.width;
- var ay0 = a.y;
- var ay1 = a.y + a.height;
-
- var bx0 = b.x;
- var bx1 = b.x + b.width;
- var by0 = b.y;
- var by1 = b.y + b.height;
-
- return ! (ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);
- },
-
- contain: function (x, y) {
- var rect = this;
- return x >= rect.x
- && x <= (rect.x + rect.width)
- && y >= rect.y
- && y <= (rect.y + rect.height);
- },
-
- /**
- * @return {module:echarts/core/BoundingRect}
- */
- clone: function () {
- return new BoundingRect(this.x, this.y, this.width, this.height);
- },
-
- /**
- * Copy from another rect
- */
- copy: function (other) {
- this.x = other.x;
- this.y = other.y;
- this.width = other.width;
- this.height = other.height;
- }
- };
-
- module.exports = BoundingRect;
-
-
-/***/ },
-/* 16 */
-/***/ function(module, exports) {
-
-
- var ArrayCtor = typeof Float32Array === 'undefined'
- ? Array
- : Float32Array;
-
- /**
- * @typedef {Float32Array|Array.<number>} Vector2
- */
- /**
- * 二维向量类
- * @exports zrender/tool/vector
- */
- var vector = {
- /**
- * 创建一个向量
- * @param {number} [x=0]
- * @param {number} [y=0]
- * @return {Vector2}
- */
- create: function (x, y) {
- var out = new ArrayCtor(2);
- out[0] = x || 0;
- out[1] = y || 0;
- return out;
- },
-
- /**
- * 复制向量数据
- * @param {Vector2} out
- * @param {Vector2} v
- * @return {Vector2}
- */
- copy: function (out, v) {
- out[0] = v[0];
- out[1] = v[1];
- return out;
- },
-
- /**
- * 克隆一个向量
- * @param {Vector2} v
- * @return {Vector2}
- */
- clone: function (v) {
- var out = new ArrayCtor(2);
- out[0] = v[0];
- out[1] = v[1];
- return out;
- },
-
- /**
- * 设置向量的两个项
- * @param {Vector2} out
- * @param {number} a
- * @param {number} b
- * @return {Vector2} 结果
- */
- set: function (out, a, b) {
- out[0] = a;
- out[1] = b;
- return out;
- },
-
- /**
- * 向量相加
- * @param {Vector2} out
- * @param {Vector2} v1
- * @param {Vector2} v2
- */
- add: function (out, v1, v2) {
- out[0] = v1[0] + v2[0];
- out[1] = v1[1] + v2[1];
- return out;
- },
-
- /**
- * 向量缩放后相加
- * @param {Vector2} out
- * @param {Vector2} v1
- * @param {Vector2} v2
- * @param {number} a
- */
- scaleAndAdd: function (out, v1, v2, a) {
- out[0] = v1[0] + v2[0] * a;
- out[1] = v1[1] + v2[1] * a;
- return out;
- },
-
- /**
- * 向量相减
- * @param {Vector2} out
- * @param {Vector2} v1
- * @param {Vector2} v2
- */
- sub: function (out, v1, v2) {
- out[0] = v1[0] - v2[0];
- out[1] = v1[1] - v2[1];
- return out;
- },
-
- /**
- * 向量长度
- * @param {Vector2} v
- * @return {number}
- */
- len: function (v) {
- return Math.sqrt(this.lenSquare(v));
- },
-
- /**
- * 向量长度平方
- * @param {Vector2} v
- * @return {number}
- */
- lenSquare: function (v) {
- return v[0] * v[0] + v[1] * v[1];
- },
-
- /**
- * 向量乘法
- * @param {Vector2} out
- * @param {Vector2} v1
- * @param {Vector2} v2
- */
- mul: function (out, v1, v2) {
- out[0] = v1[0] * v2[0];
- out[1] = v1[1] * v2[1];
- return out;
- },
-
- /**
- * 向量除法
- * @param {Vector2} out
- * @param {Vector2} v1
- * @param {Vector2} v2
- */
- div: function (out, v1, v2) {
- out[0] = v1[0] / v2[0];
- out[1] = v1[1] / v2[1];
- return out;
- },
-
- /**
- * 向量点乘
- * @param {Vector2} v1
- * @param {Vector2} v2
- * @return {number}
- */
- dot: function (v1, v2) {
- return v1[0] * v2[0] + v1[1] * v2[1];
- },
-
- /**
- * 向量缩放
- * @param {Vector2} out
- * @param {Vector2} v
- * @param {number} s
- */
- scale: function (out, v, s) {
- out[0] = v[0] * s;
- out[1] = v[1] * s;
- return out;
- },
-
- /**
- * 向量归一化
- * @param {Vector2} out
- * @param {Vector2} v
- */
- normalize: function (out, v) {
- var d = vector.len(v);
- if (d === 0) {
- out[0] = 0;
- out[1] = 0;
- }
- else {
- out[0] = v[0] / d;
- out[1] = v[1] / d;
- }
- return out;
- },
-
- /**
- * 计算向量间距离
- * @param {Vector2} v1
- * @param {Vector2} v2
- * @return {number}
- */
- distance: function (v1, v2) {
- return Math.sqrt(
- (v1[0] - v2[0]) * (v1[0] - v2[0])
- + (v1[1] - v2[1]) * (v1[1] - v2[1])
- );
- },
-
- /**
- * 向量距离平方
- * @param {Vector2} v1
- * @param {Vector2} v2
- * @return {number}
- */
- distanceSquare: function (v1, v2) {
- return (v1[0] - v2[0]) * (v1[0] - v2[0])
- + (v1[1] - v2[1]) * (v1[1] - v2[1]);
- },
-
- /**
- * 求负向量
- * @param {Vector2} out
- * @param {Vector2} v
- */
- negate: function (out, v) {
- out[0] = -v[0];
- out[1] = -v[1];
- return out;
- },
-
- /**
- * 插值两个点
- * @param {Vector2} out
- * @param {Vector2} v1
- * @param {Vector2} v2
- * @param {number} t
- */
- lerp: function (out, v1, v2, t) {
- out[0] = v1[0] + t * (v2[0] - v1[0]);
- out[1] = v1[1] + t * (v2[1] - v1[1]);
- return out;
- },
-
- /**
- * 矩阵左乘向量
- * @param {Vector2} out
- * @param {Vector2} v
- * @param {Vector2} m
- */
- applyTransform: function (out, v, m) {
- var x = v[0];
- var y = v[1];
- out[0] = m[0] * x + m[2] * y + m[4];
- out[1] = m[1] * x + m[3] * y + m[5];
- return out;
- },
- /**
- * 求两个向量最小值
- * @param {Vector2} out
- * @param {Vector2} v1
- * @param {Vector2} v2
- */
- min: function (out, v1, v2) {
- out[0] = Math.min(v1[0], v2[0]);
- out[1] = Math.min(v1[1], v2[1]);
- return out;
- },
- /**
- * 求两个向量最大值
- * @param {Vector2} out
- * @param {Vector2} v1
- * @param {Vector2} v2
- */
- max: function (out, v1, v2) {
- out[0] = Math.max(v1[0], v2[0]);
- out[1] = Math.max(v1[1], v2[1]);
- return out;
- }
- };
-
- vector.length = vector.len;
- vector.lengthSquare = vector.lenSquare;
- vector.dist = vector.distance;
- vector.distSquare = vector.distanceSquare;
-
- module.exports = vector;
-
-
-
-/***/ },
-/* 17 */
-/***/ function(module, exports) {
-
-
- var ArrayCtor = typeof Float32Array === 'undefined'
- ? Array
- : Float32Array;
- /**
- * 3x2矩阵操作类
- * @exports zrender/tool/matrix
- */
- var matrix = {
- /**
- * 创建一个单位矩阵
- * @return {Float32Array|Array.<number>}
- */
- create : function() {
- var out = new ArrayCtor(6);
- matrix.identity(out);
-
- return out;
- },
- /**
- * 设置矩阵为单位矩阵
- * @param {Float32Array|Array.<number>} out
- */
- identity : function(out) {
- out[0] = 1;
- out[1] = 0;
- out[2] = 0;
- out[3] = 1;
- out[4] = 0;
- out[5] = 0;
- return out;
- },
- /**
- * 复制矩阵
- * @param {Float32Array|Array.<number>} out
- * @param {Float32Array|Array.<number>} m
- */
- copy: function(out, m) {
- out[0] = m[0];
- out[1] = m[1];
- out[2] = m[2];
- out[3] = m[3];
- out[4] = m[4];
- out[5] = m[5];
- return out;
- },
- /**
- * 矩阵相乘
- * @param {Float32Array|Array.<number>} out
- * @param {Float32Array|Array.<number>} m1
- * @param {Float32Array|Array.<number>} m2
- */
- mul : function (out, m1, m2) {
- // Consider matrix.mul(m, m2, m);
- // where out is the same as m2.
- // So use temp variable to escape error.
- var out0 = m1[0] * m2[0] + m1[2] * m2[1];
- var out1 = m1[1] * m2[0] + m1[3] * m2[1];
- var out2 = m1[0] * m2[2] + m1[2] * m2[3];
- var out3 = m1[1] * m2[2] + m1[3] * m2[3];
- var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];
- var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];
- out[0] = out0;
- out[1] = out1;
- out[2] = out2;
- out[3] = out3;
- out[4] = out4;
- out[5] = out5;
- return out;
- },
- /**
- * 平移变换
- * @param {Float32Array|Array.<number>} out
- * @param {Float32Array|Array.<number>} a
- * @param {Float32Array|Array.<number>} v
- */
- translate : function(out, a, v) {
- out[0] = a[0];
- out[1] = a[1];
- out[2] = a[2];
- out[3] = a[3];
- out[4] = a[4] + v[0];
- out[5] = a[5] + v[1];
- return out;
- },
- /**
- * 旋转变换
- * @param {Float32Array|Array.<number>} out
- * @param {Float32Array|Array.<number>} a
- * @param {number} rad
- */
- rotate : function(out, a, rad) {
- var aa = a[0];
- var ac = a[2];
- var atx = a[4];
- var ab = a[1];
- var ad = a[3];
- var aty = a[5];
- var st = Math.sin(rad);
- var ct = Math.cos(rad);
-
- out[0] = aa * ct + ab * st;
- out[1] = -aa * st + ab * ct;
- out[2] = ac * ct + ad * st;
- out[3] = -ac * st + ct * ad;
- out[4] = ct * atx + st * aty;
- out[5] = ct * aty - st * atx;
- return out;
- },
- /**
- * 缩放变换
- * @param {Float32Array|Array.<number>} out
- * @param {Float32Array|Array.<number>} a
- * @param {Float32Array|Array.<number>} v
- */
- scale : function(out, a, v) {
- var vx = v[0];
- var vy = v[1];
- out[0] = a[0] * vx;
- out[1] = a[1] * vy;
- out[2] = a[2] * vx;
- out[3] = a[3] * vy;
- out[4] = a[4] * vx;
- out[5] = a[5] * vy;
- return out;
- },
- /**
- * 求逆矩阵
- * @param {Float32Array|Array.<number>} out
- * @param {Float32Array|Array.<number>} a
- */
- invert : function(out, a) {
-
- var aa = a[0];
- var ac = a[2];
- var atx = a[4];
- var ab = a[1];
- var ad = a[3];
- var aty = a[5];
-
- var det = aa * ad - ab * ac;
- if (!det) {
- return null;
- }
- det = 1.0 / det;
-
- out[0] = ad * det;
- out[1] = -ab * det;
- out[2] = -ac * det;
- out[3] = aa * det;
- out[4] = (ac * aty - ad * atx) * det;
- out[5] = (ab * atx - aa * aty) * det;
- return out;
- }
- };
-
- module.exports = matrix;
-
-
-
-/***/ },
-/* 18 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- module.exports = {
- getItemStyle: __webpack_require__(11)(
- [
- ['fill', 'color'],
- ['stroke', 'borderColor'],
- ['lineWidth', 'borderWidth'],
- ['opacity'],
- ['shadowBlur'],
- ['shadowOffsetX'],
- ['shadowOffsetY'],
- ['shadowColor']
- ]
- )
- };
-
-
-/***/ },
-/* 19 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Component model
- *
- * @module echarts/model/Component
- */
-
-
- var Model = __webpack_require__(8);
- var zrUtil = __webpack_require__(3);
- var arrayPush = Array.prototype.push;
- var componentUtil = __webpack_require__(20);
- var clazzUtil = __webpack_require__(9);
- var layout = __webpack_require__(21);
-
- /**
- * @alias module:echarts/model/Component
- * @constructor
- * @param {Object} option
- * @param {module:echarts/model/Model} parentModel
- * @param {module:echarts/model/Model} ecModel
- */
- var ComponentModel = Model.extend({
-
- type: 'component',
-
- /**
- * @readOnly
- * @type {string}
- */
- id: '',
-
- /**
- * @readOnly
- */
- name: '',
-
- /**
- * @readOnly
- * @type {string}
- */
- mainType: '',
-
- /**
- * @readOnly
- * @type {string}
- */
- subType: '',
-
- /**
- * @readOnly
- * @type {number}
- */
- componentIndex: 0,
-
- /**
- * @type {Object}
- * @protected
- */
- defaultOption: null,
-
- /**
- * @type {module:echarts/model/Global}
- * @readOnly
- */
- ecModel: null,
-
- /**
- * key: componentType
- * value: Component model list, can not be null.
- * @type {Object.<string, Array.<module:echarts/model/Model>>}
- * @readOnly
- */
- dependentModels: [],
-
- /**
- * @type {string}
- * @readOnly
- */
- uid: null,
-
- /**
- * Support merge layout params.
- * Only support 'box' now (left/right/top/bottom/width/height).
- * @type {string|Object} Object can be {ignoreSize: true}
- * @readOnly
- */
- layoutMode: null,
-
-
- init: function (option, parentModel, ecModel, extraOpt) {
- this.mergeDefaultAndTheme(this.option, this.ecModel);
- },
-
- mergeDefaultAndTheme: function (option, ecModel) {
- var layoutMode = this.layoutMode;
- var inputPositionParams = layoutMode
- ? layout.getLayoutParams(option) : {};
-
- var themeModel = ecModel.getTheme();
- zrUtil.merge(option, themeModel.get(this.mainType));
- zrUtil.merge(option, this.getDefaultOption());
-
- if (layoutMode) {
- layout.mergeLayoutParam(option, inputPositionParams, layoutMode);
- }
- },
-
- mergeOption: function (option) {
- zrUtil.merge(this.option, option, true);
-
- var layoutMode = this.layoutMode;
- if (layoutMode) {
- layout.mergeLayoutParam(this.option, option, layoutMode);
- }
- },
-
- // Hooker after init or mergeOption
- optionUpdated: function (ecModel) {},
-
- getDefaultOption: function () {
- if (!this.hasOwnProperty('__defaultOption')) {
- var optList = [];
- var Class = this.constructor;
- while (Class) {
- var opt = Class.prototype.defaultOption;
- opt && optList.push(opt);
- Class = Class.superClass;
- }
-
- var defaultOption = {};
- for (var i = optList.length - 1; i >= 0; i--) {
- defaultOption = zrUtil.merge(defaultOption, optList[i], true);
- }
- this.__defaultOption = defaultOption;
- }
- return this.__defaultOption;
- }
-
- });
-
- // Reset ComponentModel.extend, add preConstruct.
- clazzUtil.enableClassExtend(
- ComponentModel,
- function (option, parentModel, ecModel, extraOpt) {
- // Set dependentModels, componentIndex, name, id, mainType, subType.
- zrUtil.extend(this, extraOpt);
-
- this.uid = componentUtil.getUID('componentModel');
-
- // this.setReadOnly([
- // 'type', 'id', 'uid', 'name', 'mainType', 'subType',
- // 'dependentModels', 'componentIndex'
- // ]);
- }
- );
-
- // Add capability of registerClass, getClass, hasClass, registerSubTypeDefaulter and so on.
- clazzUtil.enableClassManagement(
- ComponentModel, {registerWhenExtend: true}
- );
- componentUtil.enableSubTypeDefaulter(ComponentModel);
-
- // Add capability of ComponentModel.topologicalTravel.
- componentUtil.enableTopologicalTravel(ComponentModel, getDependencies);
-
- function getDependencies(componentType) {
- var deps = [];
- zrUtil.each(ComponentModel.getClassesByMainType(componentType), function (Clazz) {
- arrayPush.apply(deps, Clazz.prototype.dependencies || []);
- });
- // Ensure main type
- return zrUtil.map(deps, function (type) {
- return clazzUtil.parseClassType(type).main;
- });
- }
-
- zrUtil.mixin(ComponentModel, __webpack_require__(22));
-
- module.exports = ComponentModel;
-
-
-/***/ },
-/* 20 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var clazz = __webpack_require__(9);
-
- var parseClassType = clazz.parseClassType;
-
- var base = 0;
-
- var componentUtil = {};
-
- var DELIMITER = '_';
-
- /**
- * @public
- * @param {string} type
- * @return {string}
- */
- componentUtil.getUID = function (type) {
- // Considering the case of crossing js context,
- // use Math.random to make id as unique as possible.
- return [(type || ''), base++, Math.random()].join(DELIMITER);
- };
-
- /**
- * @inner
- */
- componentUtil.enableSubTypeDefaulter = function (entity) {
-
- var subTypeDefaulters = {};
-
- entity.registerSubTypeDefaulter = function (componentType, defaulter) {
- componentType = parseClassType(componentType);
- subTypeDefaulters[componentType.main] = defaulter;
- };
-
- entity.determineSubType = function (componentType, option) {
- var type = option.type;
- if (!type) {
- var componentTypeMain = parseClassType(componentType).main;
- if (entity.hasSubTypes(componentType) && subTypeDefaulters[componentTypeMain]) {
- type = subTypeDefaulters[componentTypeMain](option);
- }
- }
- return type;
- };
-
- return entity;
- };
-
- /**
- * Topological travel on Activity Network (Activity On Vertices).
- * Dependencies is defined in Model.prototype.dependencies, like ['xAxis', 'yAxis'].
- *
- * If 'xAxis' or 'yAxis' is absent in componentTypeList, just ignore it in topology.
- *
- * If there is circle dependencey, Error will be thrown.
- *
- */
- componentUtil.enableTopologicalTravel = function (entity, dependencyGetter) {
-
- /**
- * @public
- * @param {Array.<string>} targetNameList Target Component type list.
- * Can be ['aa', 'bb', 'aa.xx']
- * @param {Array.<string>} fullNameList By which we can build dependency graph.
- * @param {Function} callback Params: componentType, dependencies.
- * @param {Object} context Scope of callback.
- */
- entity.topologicalTravel = function (targetNameList, fullNameList, callback, context) {
- if (!targetNameList.length) {
- return;
- }
-
- var result = makeDepndencyGraph(fullNameList);
- var graph = result.graph;
- var stack = result.noEntryList;
-
- var targetNameSet = {};
- zrUtil.each(targetNameList, function (name) {
- targetNameSet[name] = true;
- });
-
- while (stack.length) {
- var currComponentType = stack.pop();
- var currVertex = graph[currComponentType];
- var isInTargetNameSet = !!targetNameSet[currComponentType];
- if (isInTargetNameSet) {
- callback.call(context, currComponentType, currVertex.originalDeps.slice());
- delete targetNameSet[currComponentType];
- }
- zrUtil.each(
- currVertex.successor,
- isInTargetNameSet ? removeEdgeAndAdd : removeEdge
- );
- }
-
- zrUtil.each(targetNameSet, function () {
- throw new Error('Circle dependency may exists');
- });
-
- function removeEdge(succComponentType) {
- graph[succComponentType].entryCount--;
- if (graph[succComponentType].entryCount === 0) {
- stack.push(succComponentType);
- }
- }
-
- // Consider this case: legend depends on series, and we call
- // chart.setOption({series: [...]}), where only series is in option.
- // If we do not have 'removeEdgeAndAdd', legendModel.mergeOption will
- // not be called, but only sereis.mergeOption is called. Thus legend
- // have no chance to update its local record about series (like which
- // name of series is available in legend).
- function removeEdgeAndAdd(succComponentType) {
- targetNameSet[succComponentType] = true;
- removeEdge(succComponentType);
- }
- };
-
- /**
- * DepndencyGraph: {Object}
- * key: conponentType,
- * value: {
- * successor: [conponentTypes...],
- * originalDeps: [conponentTypes...],
- * entryCount: {number}
- * }
- */
- function makeDepndencyGraph(fullNameList) {
- var graph = {};
- var noEntryList = [];
-
- zrUtil.each(fullNameList, function (name) {
-
- var thisItem = createDependencyGraphItem(graph, name);
- var originalDeps = thisItem.originalDeps = dependencyGetter(name);
-
- var availableDeps = getAvailableDependencies(originalDeps, fullNameList);
- thisItem.entryCount = availableDeps.length;
- if (thisItem.entryCount === 0) {
- noEntryList.push(name);
- }
-
- zrUtil.each(availableDeps, function (dependentName) {
- if (zrUtil.indexOf(thisItem.predecessor, dependentName) < 0) {
- thisItem.predecessor.push(dependentName);
- }
- var thatItem = createDependencyGraphItem(graph, dependentName);
- if (zrUtil.indexOf(thatItem.successor, dependentName) < 0) {
- thatItem.successor.push(name);
- }
- });
- });
-
- return {graph: graph, noEntryList: noEntryList};
- }
-
- function createDependencyGraphItem(graph, name) {
- if (!graph[name]) {
- graph[name] = {predecessor: [], successor: []};
- }
- return graph[name];
- }
-
- function getAvailableDependencies(originalDeps, fullNameList) {
- var availableDeps = [];
- zrUtil.each(originalDeps, function (dep) {
- zrUtil.indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep);
- });
- return availableDeps;
- }
- };
-
- module.exports = componentUtil;
-
-
-/***/ },
-/* 21 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- // Layout helpers for each component positioning
-
-
- var zrUtil = __webpack_require__(3);
- var BoundingRect = __webpack_require__(15);
- var numberUtil = __webpack_require__(7);
- var formatUtil = __webpack_require__(6);
- var parsePercent = numberUtil.parsePercent;
- var each = zrUtil.each;
-
- var layout = {};
-
- var LOCATION_PARAMS = ['left', 'right', 'top', 'bottom', 'width', 'height'];
-
- function boxLayout(orient, group, gap, maxWidth, maxHeight) {
- var x = 0;
- var y = 0;
- if (maxWidth == null) {
- maxWidth = Infinity;
- }
- if (maxHeight == null) {
- maxHeight = Infinity;
- }
- var currentLineMaxSize = 0;
- group.eachChild(function (child, idx) {
- var position = child.position;
- var rect = child.getBoundingRect();
- var nextChild = group.childAt(idx + 1);
- var nextChildRect = nextChild && nextChild.getBoundingRect();
- var nextX;
- var nextY;
- if (orient === 'horizontal') {
- var moveX = rect.width + (nextChildRect ? (-nextChildRect.x + rect.x) : 0);
- nextX = x + moveX;
- // Wrap when width exceeds maxWidth or meet a `newline` group
- if (nextX > maxWidth || child.newline) {
- x = 0;
- nextX = moveX;
- y += currentLineMaxSize + gap;
- currentLineMaxSize = rect.height;
- }
- else {
- currentLineMaxSize = Math.max(currentLineMaxSize, rect.height);
- }
- }
- else {
- var moveY = rect.height + (nextChildRect ? (-nextChildRect.y + rect.y) : 0);
- nextY = y + moveY;
- // Wrap when width exceeds maxHeight or meet a `newline` group
- if (nextY > maxHeight || child.newline) {
- x += currentLineMaxSize + gap;
- y = 0;
- nextY = moveY;
- currentLineMaxSize = rect.width;
- }
- else {
- currentLineMaxSize = Math.max(currentLineMaxSize, rect.width);
- }
- }
-
- if (child.newline) {
- return;
- }
-
- position[0] = x;
- position[1] = y;
-
- orient === 'horizontal'
- ? (x = nextX + gap)
- : (y = nextY + gap);
- });
- }
-
- /**
- * VBox or HBox layouting
- * @param {string} orient
- * @param {module:zrender/container/Group} group
- * @param {number} gap
- * @param {number} [width=Infinity]
- * @param {number} [height=Infinity]
- */
- layout.box = boxLayout;
-
- /**
- * VBox layouting
- * @param {module:zrender/container/Group} group
- * @param {number} gap
- * @param {number} [width=Infinity]
- * @param {number} [height=Infinity]
- */
- layout.vbox = zrUtil.curry(boxLayout, 'vertical');
-
- /**
- * HBox layouting
- * @param {module:zrender/container/Group} group
- * @param {number} gap
- * @param {number} [width=Infinity]
- * @param {number} [height=Infinity]
- */
- layout.hbox = zrUtil.curry(boxLayout, 'horizontal');
-
- /**
- * If x or x2 is not specified or 'center' 'left' 'right',
- * the width would be as long as possible.
- * If y or y2 is not specified or 'middle' 'top' 'bottom',
- * the height would be as long as possible.
- *
- * @param {Object} positionInfo
- * @param {number|string} [positionInfo.x]
- * @param {number|string} [positionInfo.y]
- * @param {number|string} [positionInfo.x2]
- * @param {number|string} [positionInfo.y2]
- * @param {Object} containerRect
- * @param {string|number} margin
- * @return {Object} {width, height}
- */
- layout.getAvailableSize = function (positionInfo, containerRect, margin) {
- var containerWidth = containerRect.width;
- var containerHeight = containerRect.height;
-
- var x = parsePercent(positionInfo.x, containerWidth);
- var y = parsePercent(positionInfo.y, containerHeight);
- var x2 = parsePercent(positionInfo.x2, containerWidth);
- var y2 = parsePercent(positionInfo.y2, containerHeight);
-
- (isNaN(x) || isNaN(parseFloat(positionInfo.x))) && (x = 0);
- (isNaN(x2) || isNaN(parseFloat(positionInfo.x2))) && (x2 = containerWidth);
- (isNaN(y) || isNaN(parseFloat(positionInfo.y))) && (y = 0);
- (isNaN(y2) || isNaN(parseFloat(positionInfo.y2))) && (y2 = containerHeight);
-
- margin = formatUtil.normalizeCssArray(margin || 0);
-
- return {
- width: Math.max(x2 - x - margin[1] - margin[3], 0),
- height: Math.max(y2 - y - margin[0] - margin[2], 0)
- };
- };
-
- /**
- * Parse position info.
- *
- * @param {Object} positionInfo
- * @param {number|string} [positionInfo.left]
- * @param {number|string} [positionInfo.top]
- * @param {number|string} [positionInfo.right]
- * @param {number|string} [positionInfo.bottom]
- * @param {number|string} [positionInfo.width]
- * @param {number|string} [positionInfo.height]
- * @param {number|string} [positionInfo.aspect] Aspect is width / height
- * @param {Object} containerRect
- * @param {string|number} [margin]
- *
- * @return {module:zrender/core/BoundingRect}
- */
- layout.getLayoutRect = function (
- positionInfo, containerRect, margin
- ) {
- margin = formatUtil.normalizeCssArray(margin || 0);
-
- var containerWidth = containerRect.width;
- var containerHeight = containerRect.height;
-
- var left = parsePercent(positionInfo.left, containerWidth);
- var top = parsePercent(positionInfo.top, containerHeight);
- var right = parsePercent(positionInfo.right, containerWidth);
- var bottom = parsePercent(positionInfo.bottom, containerHeight);
- var width = parsePercent(positionInfo.width, containerWidth);
- var height = parsePercent(positionInfo.height, containerHeight);
-
- var verticalMargin = margin[2] + margin[0];
- var horizontalMargin = margin[1] + margin[3];
- var aspect = positionInfo.aspect;
-
- // If width is not specified, calculate width from left and right
- if (isNaN(width)) {
- width = containerWidth - right - horizontalMargin - left;
- }
- if (isNaN(height)) {
- height = containerHeight - bottom - verticalMargin - top;
- }
-
- // If width and height are not given
- // 1. Graph should not exceeds the container
- // 2. Aspect must be keeped
- // 3. Graph should take the space as more as possible
- if (isNaN(width) && isNaN(height)) {
- if (aspect > containerWidth / containerHeight) {
- width = containerWidth * 0.8;
- }
- else {
- height = containerHeight * 0.8;
- }
- }
-
- if (aspect != null) {
- // Calculate width or height with given aspect
- if (isNaN(width)) {
- width = aspect * height;
- }
- if (isNaN(height)) {
- height = width / aspect;
- }
- }
-
- // If left is not specified, calculate left from right and width
- if (isNaN(left)) {
- left = containerWidth - right - width - horizontalMargin;
- }
- if (isNaN(top)) {
- top = containerHeight - bottom - height - verticalMargin;
- }
-
- // Align left and top
- switch (positionInfo.left || positionInfo.right) {
- case 'center':
- left = containerWidth / 2 - width / 2 - margin[3];
- break;
- case 'right':
- left = containerWidth - width - horizontalMargin;
- break;
- }
- switch (positionInfo.top || positionInfo.bottom) {
- case 'middle':
- case 'center':
- top = containerHeight / 2 - height / 2 - margin[0];
- break;
- case 'bottom':
- top = containerHeight - height - verticalMargin;
- break;
- }
- // If something is wrong and left, top, width, height are calculated as NaN
- left = left || 0;
- top = top || 0;
- if (isNaN(width)) {
- // Width may be NaN if only one value is given except width
- width = containerWidth - left - (right || 0);
- }
- if (isNaN(height)) {
- // Height may be NaN if only one value is given except height
- height = containerHeight - top - (bottom || 0);
- }
-
- var rect = new BoundingRect(left + margin[3], top + margin[0], width, height);
- rect.margin = margin;
- return rect;
- };
-
- /**
- * Position group of component in viewport
- * Group position is specified by either
- * {left, top}, {right, bottom}
- * If all properties exists, right and bottom will be igonred.
- *
- * @param {module:zrender/container/Group} group
- * @param {Object} positionInfo
- * @param {number|string} [positionInfo.left]
- * @param {number|string} [positionInfo.top]
- * @param {number|string} [positionInfo.right]
- * @param {number|string} [positionInfo.bottom]
- * @param {Object} containerRect
- * @param {string|number} margin
- */
- layout.positionGroup = function (
- group, positionInfo, containerRect, margin
- ) {
- var groupRect = group.getBoundingRect();
-
- positionInfo = zrUtil.extend(zrUtil.clone(positionInfo), {
- width: groupRect.width,
- height: groupRect.height
- });
-
- positionInfo = layout.getLayoutRect(
- positionInfo, containerRect, margin
- );
-
- group.position = [
- positionInfo.x - groupRect.x,
- positionInfo.y - groupRect.y
- ];
- };
-
- /**
- * Consider Case:
- * When defulat option has {left: 0, width: 100}, and we set {right: 0}
- * through setOption or media query, using normal zrUtil.merge will cause
- * {right: 0} does not take effect.
- *
- * @example
- * ComponentModel.extend({
- * init: function () {
- * ...
- * var inputPositionParams = layout.getLayoutParams(option);
- * this.mergeOption(inputPositionParams);
- * },
- * mergeOption: function (newOption) {
- * newOption && zrUtil.merge(thisOption, newOption, true);
- * layout.mergeLayoutParam(thisOption, newOption);
- * }
- * });
- *
- * @param {Object} targetOption
- * @param {Object} newOption
- * @param {Object|string} [opt]
- * @param {boolean} [opt.ignoreSize=false] Some component must has width and height.
- */
- layout.mergeLayoutParam = function (targetOption, newOption, opt) {
- !zrUtil.isObject(opt) && (opt = {});
- var hNames = ['width', 'left', 'right']; // Order by priority.
- var vNames = ['height', 'top', 'bottom']; // Order by priority.
- var hResult = merge(hNames);
- var vResult = merge(vNames);
-
- copy(hNames, targetOption, hResult);
- copy(vNames, targetOption, vResult);
-
- function merge(names) {
- var newParams = {};
- var newValueCount = 0;
- var merged = {};
- var mergedValueCount = 0;
- var enoughParamNumber = opt.ignoreSize ? 1 : 2;
-
- each(names, function (name) {
- merged[name] = targetOption[name];
- });
- each(names, function (name) {
- // Consider case: newOption.width is null, which is
- // set by user for removing width setting.
- hasProp(newOption, name) && (newParams[name] = merged[name] = newOption[name]);
- hasValue(newParams, name) && newValueCount++;
- hasValue(merged, name) && mergedValueCount++;
- });
-
- // Case: newOption: {width: ..., right: ...},
- // or targetOption: {right: ...} and newOption: {width: ...},
- // There is no conflict when merged only has params count
- // little than enoughParamNumber.
- if (mergedValueCount === enoughParamNumber || !newValueCount) {
- return merged;
- }
- // Case: newOption: {width: ..., right: ...},
- // Than we can make sure user only want those two, and ignore
- // all origin params in targetOption.
- else if (newValueCount >= enoughParamNumber) {
- return newParams;
- }
- else {
- // Chose another param from targetOption by priority.
- // When 'ignoreSize', enoughParamNumber is 1 and those will not happen.
- for (var i = 0; i < names.length; i++) {
- var name = names[i];
- if (!hasProp(newParams, name) && hasProp(targetOption, name)) {
- newParams[name] = targetOption[name];
- break;
- }
- }
- return newParams;
- }
- }
-
- function hasProp(obj, name) {
- return obj.hasOwnProperty(name);
- }
-
- function hasValue(obj, name) {
- return obj[name] != null && obj[name] !== 'auto';
- }
-
- function copy(names, target, source) {
- each(names, function (name) {
- target[name] = source[name];
- });
- }
- };
-
- /**
- * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.
- * @param {Object} source
- * @return {Object} Result contains those props.
- */
- layout.getLayoutParams = function (source) {
- return layout.copyLayoutParams({}, source);
- };
-
- /**
- * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object.
- * @param {Object} source
- * @return {Object} Result contains those props.
- */
- layout.copyLayoutParams = function (target, source) {
- source && target && each(LOCATION_PARAMS, function (name) {
- source.hasOwnProperty(name) && (target[name] = source[name]);
- });
- return target;
- };
-
- module.exports = layout;
-
-
-/***/ },
-/* 22 */
-/***/ function(module, exports) {
-
-
-
- module.exports = {
- getBoxLayoutParams: function () {
- return {
- left: this.get('left'),
- top: this.get('top'),
- right: this.get('right'),
- bottom: this.get('bottom'),
- width: this.get('width'),
- height: this.get('height')
- };
- }
- };
-
-
-/***/ },
-/* 23 */
-/***/ function(module, exports) {
-
-
- var platform = '';
- // Navigator not exists in node
- if (typeof navigator !== 'undefined') {
- platform = navigator.platform || '';
- }
- module.exports = {
- // 全图默认背景
- // backgroundColor: 'rgba(0,0,0,0)',
-
- // https://dribbble.com/shots/1065960-Infographic-Pie-chart-visualization
- // color: ['#5793f3', '#d14a61', '#fd9c35', '#675bba', '#fec42c', '#dd4444', '#d4df5a', '#cd4870'],
- // 浅色
- // color: ['#bcd3bb', '#e88f70', '#edc1a5', '#9dc5c8', '#e1e8c8', '#7b7c68', '#e5b5b5', '#f0b489', '#928ea8', '#bda29a'],
- // color: ['#cc5664', '#9bd6ec', '#ea946e', '#8acaaa', '#f1ec64', '#ee8686', '#a48dc1', '#5da6bc', '#b9dcae'],
- // 深色
- color: ['#c23531','#2f4554', '#61a0a8', '#d48265', '#91c7ae','#749f83', '#ca8622', '#bda29a','#6e7074', '#546570', '#c4ccd3'],
-
- // 默认需要 Grid 配置项
- grid: {},
- // 主题,主题
- textStyle: {
- // color: '#000',
- // decoration: 'none',
- // PENDING
- fontFamily: platform.match(/^Win/) ? 'Microsoft YaHei' : 'sans-serif',
- // fontFamily: 'Arial, Verdana, sans-serif',
- fontSize: 12,
- fontStyle: 'normal',
- fontWeight: 'normal'
- },
- // 主题,默认标志图形类型列表
- // symbolList: [
- // 'circle', 'rectangle', 'triangle', 'diamond',
- // 'emptyCircle', 'emptyRectangle', 'emptyTriangle', 'emptyDiamond'
- // ],
- animation: true, // 过渡动画是否开启
- animationThreshold: 2000, // 动画元素阀值,产生的图形原素超过2000不出动画
- animationDuration: 1000, // 过渡动画参数:进入
- animationDurationUpdate: 300, // 过渡动画参数:更新
- animationEasing: 'exponentialOut', //BounceOut
- animationEasingUpdate: 'cubicOut'
- };
-
-
-/***/ },
-/* 24 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
-
- var echartsAPIList = [
- 'getDom', 'getZr', 'getWidth', 'getHeight', 'dispatchAction',
- 'on', 'off', 'getDataURL', 'getConnectedDataURL', 'getModel', 'getOption'
- ];
-
- function ExtensionAPI(chartInstance) {
- zrUtil.each(echartsAPIList, function (name) {
- this[name] = zrUtil.bind(chartInstance[name], chartInstance);
- }, this);
- }
-
- module.exports = ExtensionAPI;
-
-
-/***/ },
-/* 25 */
-/***/ function(module, exports) {
-
- 'use strict';
-
-
- // var zrUtil = require('zrender/lib/core/util');
- var coordinateSystemCreators = {};
-
- function CoordinateSystemManager() {
-
- this._coordinateSystems = [];
- }
-
- CoordinateSystemManager.prototype = {
-
- constructor: CoordinateSystemManager,
-
- create: function (ecModel, api) {
- var coordinateSystems = [];
- for (var type in coordinateSystemCreators) {
- var list = coordinateSystemCreators[type].create(ecModel, api);
- list && (coordinateSystems = coordinateSystems.concat(list));
- }
-
- this._coordinateSystems = coordinateSystems;
- },
-
- update: function (ecModel, api) {
- var coordinateSystems = this._coordinateSystems;
- for (var i = 0; i < coordinateSystems.length; i++) {
- // FIXME MUST have
- coordinateSystems[i].update && coordinateSystems[i].update(ecModel, api);
- }
- }
- };
-
- CoordinateSystemManager.register = function (type, coordinateSystemCreator) {
- coordinateSystemCreators[type] = coordinateSystemCreator;
- };
-
- CoordinateSystemManager.get = function (type) {
- return coordinateSystemCreators[type];
- };
-
- module.exports = CoordinateSystemManager;
-
-
-/***/ },
-/* 26 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * ECharts option manager
- *
- * @module {echarts/model/OptionManager}
- */
-
-
-
- var zrUtil = __webpack_require__(3);
- var modelUtil = __webpack_require__(5);
- var ComponentModel = __webpack_require__(19);
- var each = zrUtil.each;
- var clone = zrUtil.clone;
- var map = zrUtil.map;
- var merge = zrUtil.merge;
-
- var QUERY_REG = /^(min|max)?(.+)$/;
-
- /**
- * TERM EXPLANATIONS:
- *
- * [option]:
- *
- * An object that contains definitions of components. For example:
- * var option = {
- * title: {...},
- * legend: {...},
- * visualMap: {...},
- * series: [
- * {data: [...]},
- * {data: [...]},
- * ...
- * ]
- * };
- *
- * [rawOption]:
- *
- * An object input to echarts.setOption. 'rawOption' may be an
- * 'option', or may be an object contains multi-options. For example:
- * var option = {
- * baseOption: {
- * title: {...},
- * legend: {...},
- * series: [
- * {data: [...]},
- * {data: [...]},
- * ...
- * ]
- * },
- * timeline: {...},
- * options: [
- * {title: {...}, series: {data: [...]}},
- * {title: {...}, series: {data: [...]}},
- * ...
- * ],
- * media: [
- * {
- * query: {maxWidth: 320},
- * option: {series: {x: 20}, visualMap: {show: false}}
- * },
- * {
- * query: {minWidth: 320, maxWidth: 720},
- * option: {series: {x: 500}, visualMap: {show: true}}
- * },
- * {
- * option: {series: {x: 1200}, visualMap: {show: true}}
- * }
- * ]
- * };
- *
- * @alias module:echarts/model/OptionManager
- * @param {module:echarts/ExtensionAPI} api
- */
- function OptionManager(api) {
-
- /**
- * @private
- * @type {module:echarts/ExtensionAPI}
- */
- this._api = api;
-
- /**
- * @private
- * @type {Array.<number>}
- */
- this._timelineOptions = [];
-
- /**
- * @private
- * @type {Array.<Object>}
- */
- this._mediaList = [];
-
- /**
- * @private
- * @type {Object}
- */
- this._mediaDefault;
-
- /**
- * -1, means default.
- * empty means no media.
- * @private
- * @type {Array.<number>}
- */
- this._currentMediaIndices = [];
-
- /**
- * @private
- * @type {Object}
- */
- this._optionBackup;
-
- /**
- * @private
- * @type {Object}
- */
- this._newOptionBackup;
- }
-
- // timeline.notMerge is not supported in ec3. Firstly there is rearly
- // case that notMerge is needed. Secondly supporting 'notMerge' requires
- // rawOption cloned and backuped when timeline changed, which does no
- // good to performance. What's more, that both timeline and setOption
- // method supply 'notMerge' brings complex and some problems.
- // Consider this case:
- // (step1) chart.setOption({timeline: {notMerge: false}, ...}, false);
- // (step2) chart.setOption({timeline: {notMerge: true}, ...}, false);
-
- OptionManager.prototype = {
-
- constructor: OptionManager,
-
- /**
- * @public
- * @param {Object} rawOption Raw option.
- * @param {module:echarts/model/Global} ecModel
- * @param {Array.<Function>} optionPreprocessorFuncs
- * @return {Object} Init option
- */
- setOption: function (rawOption, optionPreprocessorFuncs) {
- rawOption = clone(rawOption, true);
-
- // FIXME
- // 如果 timeline options 或者 media 中设置了某个属性,而baseOption中没有设置,则进行警告。
-
- var oldOptionBackup = this._optionBackup;
- var newOptionBackup = this._newOptionBackup = parseRawOption.call(
- this, rawOption, optionPreprocessorFuncs
- );
-
- // For setOption at second time (using merge mode);
- if (oldOptionBackup) {
- // Only baseOption can be merged.
- mergeOption(oldOptionBackup.baseOption, newOptionBackup.baseOption);
-
- if (newOptionBackup.timelineOptions.length) {
- oldOptionBackup.timelineOptions = newOptionBackup.timelineOptions;
- }
- if (newOptionBackup.mediaList.length) {
- oldOptionBackup.mediaList = newOptionBackup.mediaList;
- }
- if (newOptionBackup.mediaDefault) {
- oldOptionBackup.mediaDefault = newOptionBackup.mediaDefault;
- }
- }
- else {
- this._optionBackup = newOptionBackup;
- }
- },
-
- /**
- * @param {boolean} isRecreate
- * @return {Object}
- */
- mountOption: function (isRecreate) {
- var optionBackup = isRecreate
- // this._optionBackup can be only used when recreate.
- // In other cases we use model.mergeOption to handle merge.
- ? this._optionBackup : this._newOptionBackup;
-
- // FIXME
- // 如果没有reset功能则不clone。
-
- this._timelineOptions = map(optionBackup.timelineOptions, clone);
- this._mediaList = map(optionBackup.mediaList, clone);
- this._mediaDefault = clone(optionBackup.mediaDefault);
- this._currentMediaIndices = [];
-
- return clone(optionBackup.baseOption);
- },
-
- /**
- * @param {module:echarts/model/Global} ecModel
- * @return {Object}
- */
- getTimelineOption: function (ecModel) {
- var option;
- var timelineOptions = this._timelineOptions;
-
- if (timelineOptions.length) {
- // getTimelineOption can only be called after ecModel inited,
- // so we can get currentIndex from timelineModel.
- var timelineModel = ecModel.getComponent('timeline');
- if (timelineModel) {
- option = clone(
- timelineOptions[timelineModel.getCurrentIndex()],
- true
- );
- }
- }
-
- return option;
- },
-
- /**
- * @param {module:echarts/model/Global} ecModel
- * @return {Array.<Object>}
- */
- getMediaOption: function (ecModel) {
- var ecWidth = this._api.getWidth();
- var ecHeight = this._api.getHeight();
- var mediaList = this._mediaList;
- var mediaDefault = this._mediaDefault;
- var indices = [];
- var result = [];
-
- // No media defined.
- if (!mediaList.length && !mediaDefault) {
- return result;
- }
-
- // Multi media may be applied, the latter defined media has higher priority.
- for (var i = 0, len = mediaList.length; i < len; i++) {
- if (applyMediaQuery(mediaList[i].query, ecWidth, ecHeight)) {
- indices.push(i);
- }
- }
-
- // FIXME
- // 是否mediaDefault应该强制用户设置,否则可能修改不能回归。
- if (!indices.length && mediaDefault) {
- indices = [-1];
- }
-
- if (indices.length && !indicesEquals(indices, this._currentMediaIndices)) {
- result = map(indices, function (index) {
- return clone(
- index === -1 ? mediaDefault.option : mediaList[index].option
- );
- });
- }
- // Otherwise return nothing.
-
- this._currentMediaIndices = indices;
-
- return result;
- }
- };
-
- function parseRawOption(rawOption, optionPreprocessorFuncs) {
- var timelineOptions = [];
- var mediaList = [];
- var mediaDefault;
- var baseOption;
-
- // Compatible with ec2.
- var timelineOpt = rawOption.timeline;
-
- if (rawOption.baseOption) {
- baseOption = rawOption.baseOption;
- }
-
- // For timeline
- if (timelineOpt || rawOption.options) {
- baseOption = baseOption || {};
- timelineOptions = (rawOption.options || []).slice();
- }
- // For media query
- if (rawOption.media) {
- baseOption = baseOption || {};
- var media = rawOption.media;
- each(media, function (singleMedia) {
- if (singleMedia && singleMedia.option) {
- if (singleMedia.query) {
- mediaList.push(singleMedia);
- }
- else if (!mediaDefault) {
- // Use the first media default.
- mediaDefault = singleMedia;
- }
- }
- });
- }
-
- // For normal option
- if (!baseOption) {
- baseOption = rawOption;
- }
-
- // Set timelineOpt to baseOption in ec3,
- // which is convenient for merge option.
- if (!baseOption.timeline) {
- baseOption.timeline = timelineOpt;
- }
-
- // Preprocess.
- each([baseOption].concat(timelineOptions)
- .concat(zrUtil.map(mediaList, function (media) {
- return media.option;
- })),
- function (option) {
- each(optionPreprocessorFuncs, function (preProcess) {
- preProcess(option);
- });
- }
- );
-
- return {
- baseOption: baseOption,
- timelineOptions: timelineOptions,
- mediaDefault: mediaDefault,
- mediaList: mediaList
- };
- }
-
- /**
- * @see <http://www.w3.org/TR/css3-mediaqueries/#media1>
- * Support: width, height, aspectRatio
- * Can use max or min as prefix.
- */
- function applyMediaQuery(query, ecWidth, ecHeight) {
- var realMap = {
- width: ecWidth,
- height: ecHeight,
- aspectratio: ecWidth / ecHeight // lowser case for convenientce.
- };
-
- var applicatable = true;
-
- zrUtil.each(query, function (value, attr) {
- var matched = attr.match(QUERY_REG);
-
- if (!matched || !matched[1] || !matched[2]) {
- return;
- }
-
- var operator = matched[1];
- var realAttr = matched[2].toLowerCase();
-
- if (!compare(realMap[realAttr], value, operator)) {
- applicatable = false;
- }
- });
-
- return applicatable;
- }
-
- function compare(real, expect, operator) {
- if (operator === 'min') {
- return real >= expect;
- }
- else if (operator === 'max') {
- return real <= expect;
- }
- else { // Equals
- return real === expect;
- }
- }
-
- function indicesEquals(indices1, indices2) {
- // indices is always order by asc and has only finite number.
- return indices1.join(',') === indices2.join(',');
- }
-
- /**
- * Consider case:
- * `chart.setOption(opt1);`
- * Then user do some interaction like dataZoom, dataView changing.
- * `chart.setOption(opt2);`
- * Then user press 'reset button' in toolbox.
- *
- * After doing that all of the interaction effects should be reset, the
- * chart should be the same as the result of invoke
- * `chart.setOption(opt1); chart.setOption(opt2);`.
- *
- * Although it is not able ensure that
- * `chart.setOption(opt1); chart.setOption(opt2);` is equivalents to
- * `chart.setOption(merge(opt1, opt2));` exactly,
- * this might be the only simple way to implement that feature.
- *
- * MEMO: We've considered some other approaches:
- * 1. Each model handle its self restoration but not uniform treatment.
- * (Too complex in logic and error-prone)
- * 2. Use a shadow ecModel. (Performace expensive)
- */
- function mergeOption(oldOption, newOption) {
- newOption = newOption || {};
-
- each(newOption, function (newCptOpt, mainType) {
- if (newCptOpt == null) {
- return;
- }
-
- var oldCptOpt = oldOption[mainType];
-
- if (!ComponentModel.hasClass(mainType)) {
- oldOption[mainType] = merge(oldCptOpt, newCptOpt, true);
- }
- else {
- newCptOpt = modelUtil.normalizeToArray(newCptOpt);
- oldCptOpt = modelUtil.normalizeToArray(oldCptOpt);
-
- var mapResult = modelUtil.mappingToExists(oldCptOpt, newCptOpt);
-
- oldOption[mainType] = map(mapResult, function (item) {
- return (item.option && item.exist)
- ? merge(item.exist, item.option, true)
- : (item.exist || item.option);
- });
- }
- });
- }
-
- module.exports = OptionManager;
-
-
-/***/ },
-/* 27 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
- var formatUtil = __webpack_require__(6);
- var modelUtil = __webpack_require__(5);
- var ComponentModel = __webpack_require__(19);
-
- var encodeHTML = formatUtil.encodeHTML;
- var addCommas = formatUtil.addCommas;
-
- var SeriesModel = ComponentModel.extend({
-
- type: 'series.__base__',
-
- /**
- * @readOnly
- */
- seriesIndex: 0,
-
- // coodinateSystem will be injected in the echarts/CoordinateSystem
- coordinateSystem: null,
-
- /**
- * @type {Object}
- * @protected
- */
- defaultOption: null,
-
- /**
- * Data provided for legend
- * @type {Function}
- */
- // PENDING
- legendDataProvider: null,
-
- init: function (option, parentModel, ecModel, extraOpt) {
-
- /**
- * @type {number}
- * @readOnly
- */
- this.seriesIndex = this.componentIndex;
-
- this.mergeDefaultAndTheme(option, ecModel);
-
- /**
- * @type {module:echarts/data/List|module:echarts/data/Tree|module:echarts/data/Graph}
- * @private
- */
- this._dataBeforeProcessed = this.getInitialData(option, ecModel);
-
- // When using module:echarts/data/Tree or module:echarts/data/Graph,
- // cloneShallow will cause this._data.graph.data pointing to new data list.
- // Wo we make this._dataBeforeProcessed first, and then make this._data.
- this._data = this._dataBeforeProcessed.cloneShallow();
- },
-
- /**
- * Util for merge default and theme to option
- * @param {Object} option
- * @param {module:echarts/model/Global} ecModel
- */
- mergeDefaultAndTheme: function (option, ecModel) {
- zrUtil.merge(
- option,
- ecModel.getTheme().get(this.subType)
- );
- zrUtil.merge(option, this.getDefaultOption());
-
- // Default label emphasis `position` and `show`
- modelUtil.defaultEmphasis(
- option.label, ['position', 'show', 'textStyle', 'distance', 'formatter']
- );
-
- // Default data label emphasis `position` and `show`
- // FIXME Tree structure data ?
- var data = option.data || [];
- for (var i = 0; i < data.length; i++) {
- if (data[i] && data[i].label) {
- modelUtil.defaultEmphasis(
- data[i].label, ['position', 'show', 'textStyle', 'distance', 'formatter']
- );
- }
- }
- },
-
- mergeOption: function (newSeriesOption, ecModel) {
- newSeriesOption = zrUtil.merge(this.option, newSeriesOption, true);
-
- var data = this.getInitialData(newSeriesOption, ecModel);
- // TODO Merge data?
- if (data) {
- this._data = data;
- this._dataBeforeProcessed = data.cloneShallow();
- }
- },
-
- /**
- * Init a data structure from data related option in series
- * Must be overwritten
- */
- getInitialData: function () {},
-
- /**
- * @return {module:echarts/data/List}
- */
- getData: function () {
- return this._data;
- },
-
- /**
- * @param {module:echarts/data/List} data
- */
- setData: function (data) {
- this._data = data;
- },
-
- /**
- * Get data before processed
- * @return {module:echarts/data/List}
- */
- getRawData: function () {
- return this._dataBeforeProcessed;
- },
-
- /**
- * Get raw data array given by user
- * @return {Array.<Object>}
- */
- getRawDataArray: function () {
- return this.option.data;
- },
-
- /**
- * Coord dimension to data dimension.
- *
- * By default the result is the same as dimensions of series data.
- * But some series dimensions are different from coord dimensions (i.e.
- * candlestick and boxplot). Override this method to handle those cases.
- *
- * Coord dimension to data dimension can be one-to-many
- *
- * @param {string} coordDim
- * @return {Array.<string>} dimensions on the axis.
- */
- coordDimToDataDim: function (coordDim) {
- return [coordDim];
- },
-
- /**
- * Convert data dimension to coord dimension.
- *
- * @param {string|number} dataDim
- * @return {string}
- */
- dataDimToCoordDim: function (dataDim) {
- return dataDim;
- },
-
- /**
- * Get base axis if has coordinate system and has axis.
- * By default use coordSys.getBaseAxis();
- * Can be overrided for some chart.
- * @return {type} description
- */
- getBaseAxis: function () {
- var coordSys = this.coordinateSystem;
- return coordSys && coordSys.getBaseAxis && coordSys.getBaseAxis();
- },
-
- // FIXME
- /**
- * Default tooltip formatter
- *
- * @param {number} dataIndex
- * @param {boolean} [multipleSeries=false]
- */
- formatTooltip: function (dataIndex, multipleSeries) {
- var data = this._data;
- var value = this.getRawValue(dataIndex);
- var formattedValue = zrUtil.isArray(value)
- ? zrUtil.map(value, addCommas).join(', ') : addCommas(value);
- var name = data.getName(dataIndex);
- var color = data.getItemVisual(dataIndex, 'color');
- var colorEl = '<span style="display:inline-block;margin-right:5px;'
- + 'border-radius:10px;width:9px;height:9px;background-color:' + color + '"></span>';
-
- return !multipleSeries
- ? (encodeHTML(this.name) + '<br />' + colorEl
- + (name
- ? encodeHTML(name) + ' : ' + formattedValue
- : formattedValue)
- )
- : (colorEl + encodeHTML(this.name) + ' : ' + formattedValue);
- },
-
- restoreData: function () {
- this._data = this._dataBeforeProcessed.cloneShallow();
- }
- });
-
- zrUtil.mixin(SeriesModel, modelUtil.dataFormatMixin);
-
- module.exports = SeriesModel;
-
-
-/***/ },
-/* 28 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var Group = __webpack_require__(29);
- var componentUtil = __webpack_require__(20);
- var clazzUtil = __webpack_require__(9);
-
- var Component = function () {
- /**
- * @type {module:zrender/container/Group}
- * @readOnly
- */
- this.group = new Group();
-
- /**
- * @type {string}
- * @readOnly
- */
- this.uid = componentUtil.getUID('viewComponent');
- };
-
- Component.prototype = {
-
- constructor: Component,
-
- init: function (ecModel, api) {},
-
- render: function (componentModel, ecModel, api, payload) {},
-
- dispose: function () {}
- };
-
- var componentProto = Component.prototype;
- componentProto.updateView
- = componentProto.updateLayout
- = componentProto.updateVisual
- = function (seriesModel, ecModel, api, payload) {
- // Do nothing;
- };
- // Enable Component.extend.
- clazzUtil.enableClassExtend(Component);
-
- // Enable capability of registerClass, getClass, hasClass, registerSubTypeDefaulter and so on.
- clazzUtil.enableClassManagement(Component, {registerWhenExtend: true});
-
- module.exports = Component;
-
-
-/***/ },
-/* 29 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Group是一个容器,可以插入子节点,Group的变换也会被应用到子节点上
- * @module zrender/graphic/Group
- * @example
- * var Group = require('zrender/lib/container/Group');
- * var Circle = require('zrender/lib/graphic/shape/Circle');
- * var g = new Group();
- * g.position[0] = 100;
- * g.position[1] = 100;
- * g.add(new Circle({
- * style: {
- * x: 100,
- * y: 100,
- * r: 20,
- * }
- * }));
- * zr.add(g);
- */
-
-
- var zrUtil = __webpack_require__(3);
- var Element = __webpack_require__(30);
- var BoundingRect = __webpack_require__(15);
-
- /**
- * @alias module:zrender/graphic/Group
- * @constructor
- * @extends module:zrender/mixin/Transformable
- * @extends module:zrender/mixin/Eventful
- */
- var Group = function (opts) {
-
- opts = opts || {};
-
- Element.call(this, opts);
-
- for (var key in opts) {
- this[key] = opts[key];
- }
-
- this._children = [];
-
- this.__storage = null;
-
- this.__dirty = true;
- };
-
- Group.prototype = {
-
- constructor: Group,
-
- /**
- * @type {string}
- */
- type: 'group',
-
- /**
- * @return {Array.<module:zrender/Element>}
- */
- children: function () {
- return this._children.slice();
- },
-
- /**
- * 获取指定 index 的儿子节点
- * @param {number} idx
- * @return {module:zrender/Element}
- */
- childAt: function (idx) {
- return this._children[idx];
- },
-
- /**
- * 获取指定名字的儿子节点
- * @param {string} name
- * @return {module:zrender/Element}
- */
- childOfName: function (name) {
- var children = this._children;
- for (var i = 0; i < children.length; i++) {
- if (children[i].name === name) {
- return children[i];
- }
- }
- },
-
- /**
- * @return {number}
- */
- childCount: function () {
- return this._children.length;
- },
-
- /**
- * 添加子节点到最后
- * @param {module:zrender/Element} child
- */
- add: function (child) {
- if (child && child !== this && child.parent !== this) {
-
- this._children.push(child);
-
- this._doAdd(child);
- }
-
- return this;
- },
-
- /**
- * 添加子节点在 nextSibling 之前
- * @param {module:zrender/Element} child
- * @param {module:zrender/Element} nextSibling
- */
- addBefore: function (child, nextSibling) {
- if (child && child !== this && child.parent !== this
- && nextSibling && nextSibling.parent === this) {
-
- var children = this._children;
- var idx = children.indexOf(nextSibling);
-
- if (idx >= 0) {
- children.splice(idx, 0, child);
- this._doAdd(child);
- }
- }
-
- return this;
- },
-
- _doAdd: function (child) {
- if (child.parent) {
- child.parent.remove(child);
- }
-
- child.parent = this;
-
- var storage = this.__storage;
- var zr = this.__zr;
- if (storage && storage !== child.__storage) {
-
- storage.addToMap(child);
-
- if (child instanceof Group) {
- child.addChildrenToStorage(storage);
- }
- }
-
- zr && zr.refresh();
- },
-
- /**
- * 移除子节点
- * @param {module:zrender/Element} child
- */
- remove: function (child) {
- var zr = this.__zr;
- var storage = this.__storage;
- var children = this._children;
-
- var idx = zrUtil.indexOf(children, child);
- if (idx < 0) {
- return this;
- }
- children.splice(idx, 1);
-
- child.parent = null;
-
- if (storage) {
-
- storage.delFromMap(child.id);
-
- if (child instanceof Group) {
- child.delChildrenFromStorage(storage);
- }
- }
-
- zr && zr.refresh();
-
- return this;
- },
-
- /**
- * 移除所有子节点
- */
- removeAll: function () {
- var children = this._children;
- var storage = this.__storage;
- var child;
- var i;
- for (i = 0; i < children.length; i++) {
- child = children[i];
- if (storage) {
- storage.delFromMap(child.id);
- if (child instanceof Group) {
- child.delChildrenFromStorage(storage);
- }
- }
- child.parent = null;
- }
- children.length = 0;
-
- return this;
- },
-
- /**
- * 遍历所有子节点
- * @param {Function} cb
- * @param {} context
- */
- eachChild: function (cb, context) {
- var children = this._children;
- for (var i = 0; i < children.length; i++) {
- var child = children[i];
- cb.call(context, child, i);
- }
- return this;
- },
-
- /**
- * 深度优先遍历所有子孙节点
- * @param {Function} cb
- * @param {} context
- */
- traverse: function (cb, context) {
- for (var i = 0; i < this._children.length; i++) {
- var child = this._children[i];
- cb.call(context, child);
-
- if (child.type === 'group') {
- child.traverse(cb, context);
- }
- }
- return this;
- },
-
- addChildrenToStorage: function (storage) {
- for (var i = 0; i < this._children.length; i++) {
- var child = this._children[i];
- storage.addToMap(child);
- if (child instanceof Group) {
- child.addChildrenToStorage(storage);
- }
- }
- },
-
- delChildrenFromStorage: function (storage) {
- for (var i = 0; i < this._children.length; i++) {
- var child = this._children[i];
- storage.delFromMap(child.id);
- if (child instanceof Group) {
- child.delChildrenFromStorage(storage);
- }
- }
- },
-
- dirty: function () {
- this.__dirty = true;
- this.__zr && this.__zr.refresh();
- return this;
- },
-
- /**
- * @return {module:zrender/core/BoundingRect}
- */
- getBoundingRect: function (includeChildren) {
- // TODO Caching
- // TODO Transform
- var rect = null;
- var tmpRect = new BoundingRect(0, 0, 0, 0);
- var children = includeChildren || this._children;
- var tmpMat = [];
-
- for (var i = 0; i < children.length; i++) {
- var child = children[i];
- if (child.ignore || child.invisible) {
- continue;
- }
-
- var childRect = child.getBoundingRect();
- var transform = child.getLocalTransform(tmpMat);
- if (transform) {
- tmpRect.copy(childRect);
- tmpRect.applyTransform(transform);
- rect = rect || tmpRect.clone();
- rect.union(tmpRect);
- }
- else {
- rect = rect || childRect.clone();
- rect.union(childRect);
- }
- }
- return rect || tmpRect;
- }
- };
-
- zrUtil.inherits(Group, Element);
-
- module.exports = Group;
-
-
-/***/ },
-/* 30 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * @module zrender/Element
- */
-
-
- var guid = __webpack_require__(31);
- var Eventful = __webpack_require__(32);
- var Transformable = __webpack_require__(33);
- var Animatable = __webpack_require__(34);
- var zrUtil = __webpack_require__(3);
-
- /**
- * @alias module:zrender/Element
- * @constructor
- * @extends {module:zrender/mixin/Animatable}
- * @extends {module:zrender/mixin/Transformable}
- * @extends {module:zrender/mixin/Eventful}
- */
- var Element = function (opts) {
-
- Transformable.call(this, opts);
- Eventful.call(this, opts);
- Animatable.call(this, opts);
-
- /**
- * 画布元素ID
- * @type {string}
- */
- this.id = opts.id || guid();
- };
-
- Element.prototype = {
-
- /**
- * 元素类型
- * Element type
- * @type {string}
- */
- type: 'element',
-
- /**
- * 元素名字
- * Element name
- * @type {string}
- */
- name: '',
-
- /**
- * ZRender 实例对象,会在 element 添加到 zrender 实例中后自动赋值
- * ZRender instance will be assigned when element is associated with zrender
- * @name module:/zrender/Element#__zr
- * @type {module:zrender/ZRender}
- */
- __zr: null,
-
- /**
- * 图形是否忽略,为true时忽略图形的绘制以及事件触发
- * If ignore drawing and events of the element object
- * @name module:/zrender/Element#ignore
- * @type {boolean}
- * @default false
- */
- ignore: false,
-
- /**
- * 用于裁剪的路径(shape),所有 Group 内的路径在绘制时都会被这个路径裁剪
- * 该路径会继承被裁减对象的变换
- * @type {module:zrender/graphic/Path}
- * @see http://www.w3.org/TR/2dcontext/#clipping-region
- * @readOnly
- */
- clipPath: null,
-
- /**
- * Drift element
- * @param {number} dx dx on the global space
- * @param {number} dy dy on the global space
- */
- drift: function (dx, dy) {
- switch (this.draggable) {
- case 'horizontal':
- dy = 0;
- break;
- case 'vertical':
- dx = 0;
- break;
- }
-
- var m = this.transform;
- if (!m) {
- m = this.transform = [1, 0, 0, 1, 0, 0];
- }
- m[4] += dx;
- m[5] += dy;
-
- this.decomposeTransform();
- this.dirty();
- },
-
- /**
- * Hook before update
- */
- beforeUpdate: function () {},
- /**
- * Hook after update
- */
- afterUpdate: function () {},
- /**
- * Update each frame
- */
- update: function () {
- this.updateTransform();
- },
-
- /**
- * @param {Function} cb
- * @param {} context
- */
- traverse: function (cb, context) {},
-
- /**
- * @protected
- */
- attrKV: function (key, value) {
- if (key === 'position' || key === 'scale' || key === 'origin') {
- // Copy the array
- if (value) {
- var target = this[key];
- if (!target) {
- target = this[key] = [];
- }
- target[0] = value[0];
- target[1] = value[1];
- }
- }
- else {
- this[key] = value;
- }
- },
-
- /**
- * Hide the element
- */
- hide: function () {
- this.ignore = true;
- this.__zr && this.__zr.refresh();
- },
-
- /**
- * Show the element
- */
- show: function () {
- this.ignore = false;
- this.__zr && this.__zr.refresh();
- },
-
- /**
- * @param {string|Object} key
- * @param {*} value
- */
- attr: function (key, value) {
- if (typeof key === 'string') {
- this.attrKV(key, value);
- }
- else if (zrUtil.isObject(key)) {
- for (var name in key) {
- if (key.hasOwnProperty(name)) {
- this.attrKV(name, key[name]);
- }
- }
- }
- this.dirty();
-
- return this;
- },
-
- /**
- * @param {module:zrender/graphic/Path} clipPath
- */
- setClipPath: function (clipPath) {
- var zr = this.__zr;
- if (zr) {
- clipPath.addSelfToZr(zr);
- }
-
- // Remove previous clip path
- if (this.clipPath && this.clipPath !== clipPath) {
- this.removeClipPath();
- }
-
- this.clipPath = clipPath;
- clipPath.__zr = zr;
- clipPath.__clipTarget = this;
-
- this.dirty();
- },
-
- /**
- */
- removeClipPath: function () {
- var clipPath = this.clipPath;
- if (clipPath) {
- if (clipPath.__zr) {
- clipPath.removeSelfFromZr(clipPath.__zr);
- }
-
- clipPath.__zr = null;
- clipPath.__clipTarget = null;
- this.clipPath = null;
-
- this.dirty();
- }
- },
-
- /**
- * Add self from zrender instance.
- * Not recursively because it will be invoked when element added to storage.
- * @param {module:zrender/ZRender} zr
- */
- addSelfToZr: function (zr) {
- this.__zr = zr;
- // 添加动画
- var animators = this.animators;
- if (animators) {
- for (var i = 0; i < animators.length; i++) {
- zr.animation.addAnimator(animators[i]);
- }
- }
-
- if (this.clipPath) {
- this.clipPath.addSelfToZr(zr);
- }
- },
-
- /**
- * Remove self from zrender instance.
- * Not recursively because it will be invoked when element added to storage.
- * @param {module:zrender/ZRender} zr
- */
- removeSelfFromZr: function (zr) {
- this.__zr = null;
- // 移除动画
- var animators = this.animators;
- if (animators) {
- for (var i = 0; i < animators.length; i++) {
- zr.animation.removeAnimator(animators[i]);
- }
- }
-
- if (this.clipPath) {
- this.clipPath.removeSelfFromZr(zr);
- }
- }
- };
-
- zrUtil.mixin(Element, Animatable);
- zrUtil.mixin(Element, Transformable);
- zrUtil.mixin(Element, Eventful);
-
- module.exports = Element;
-
-
-/***/ },
-/* 31 */
-/***/ function(module, exports) {
-
- /**
- * zrender: 生成唯一id
- *
- * @author errorrik (errorrik@gmail.com)
- */
-
-
- var idStart = 0x0907;
-
- module.exports = function () {
- return 'zr_' + (idStart++);
- };
-
-
-
-/***/ },
-/* 32 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * 事件扩展
- * @module zrender/mixin/Eventful
- * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
- * pissang (https://www.github.com/pissang)
- */
-
-
- var arrySlice = Array.prototype.slice;
- var zrUtil = __webpack_require__(3);
- var indexOf = zrUtil.indexOf;
-
- /**
- * 事件分发器
- * @alias module:zrender/mixin/Eventful
- * @constructor
- */
- var Eventful = function () {
- this._$handlers = {};
- };
-
- Eventful.prototype = {
-
- constructor: Eventful,
-
- /**
- * 单次触发绑定,trigger后销毁
- *
- * @param {string} event 事件名
- * @param {Function} handler 响应函数
- * @param {Object} context
- */
- one: function (event, handler, context) {
- var _h = this._$handlers;
-
- if (!handler || !event) {
- return this;
- }
-
- if (!_h[event]) {
- _h[event] = [];
- }
-
- if (indexOf(_h[event], event) >= 0) {
- return this;
- }
-
- _h[event].push({
- h: handler,
- one: true,
- ctx: context || this
- });
-
- return this;
- },
-
- /**
- * 绑定事件
- * @param {string} event 事件名
- * @param {Function} handler 事件处理函数
- * @param {Object} [context]
- */
- on: function (event, handler, context) {
- var _h = this._$handlers;
-
- if (!handler || !event) {
- return this;
- }
-
- if (!_h[event]) {
- _h[event] = [];
- }
-
- _h[event].push({
- h: handler,
- one: false,
- ctx: context || this
- });
-
- return this;
- },
-
- /**
- * 是否绑定了事件
- * @param {string} event
- * @return {boolean}
- */
- isSilent: function (event) {
- var _h = this._$handlers;
- return _h[event] && _h[event].length;
- },
-
- /**
- * 解绑事件
- * @param {string} event 事件名
- * @param {Function} [handler] 事件处理函数
- */
- off: function (event, handler) {
- var _h = this._$handlers;
-
- if (!event) {
- this._$handlers = {};
- return this;
- }
-
- if (handler) {
- if (_h[event]) {
- var newList = [];
- for (var i = 0, l = _h[event].length; i < l; i++) {
- if (_h[event][i]['h'] != handler) {
- newList.push(_h[event][i]);
- }
- }
- _h[event] = newList;
- }
-
- if (_h[event] && _h[event].length === 0) {
- delete _h[event];
- }
- }
- else {
- delete _h[event];
- }
-
- return this;
- },
-
- /**
- * 事件分发
- *
- * @param {string} type 事件类型
- */
- trigger: function (type) {
- if (this._$handlers[type]) {
- var args = arguments;
- var argLen = args.length;
-
- if (argLen > 3) {
- args = arrySlice.call(args, 1);
- }
-
- var _h = this._$handlers[type];
- var len = _h.length;
- for (var i = 0; i < len;) {
- // Optimize advise from backbone
- switch (argLen) {
- case 1:
- _h[i]['h'].call(_h[i]['ctx']);
- break;
- case 2:
- _h[i]['h'].call(_h[i]['ctx'], args[1]);
- break;
- case 3:
- _h[i]['h'].call(_h[i]['ctx'], args[1], args[2]);
- break;
- default:
- // have more than 2 given arguments
- _h[i]['h'].apply(_h[i]['ctx'], args);
- break;
- }
-
- if (_h[i]['one']) {
- _h.splice(i, 1);
- len--;
- }
- else {
- i++;
- }
- }
- }
-
- return this;
- },
-
- /**
- * 带有context的事件分发, 最后一个参数是事件回调的context
- * @param {string} type 事件类型
- */
- triggerWithContext: function (type) {
- if (this._$handlers[type]) {
- var args = arguments;
- var argLen = args.length;
-
- if (argLen > 4) {
- args = arrySlice.call(args, 1, args.length - 1);
- }
- var ctx = args[args.length - 1];
-
- var _h = this._$handlers[type];
- var len = _h.length;
- for (var i = 0; i < len;) {
- // Optimize advise from backbone
- switch (argLen) {
- case 1:
- _h[i]['h'].call(ctx);
- break;
- case 2:
- _h[i]['h'].call(ctx, args[1]);
- break;
- case 3:
- _h[i]['h'].call(ctx, args[1], args[2]);
- break;
- default:
- // have more than 2 given arguments
- _h[i]['h'].apply(ctx, args);
- break;
- }
-
- if (_h[i]['one']) {
- _h.splice(i, 1);
- len--;
- }
- else {
- i++;
- }
- }
- }
-
- return this;
- }
- };
-
- // 对象可以通过 onxxxx 绑定事件
- /**
- * @event module:zrender/mixin/Eventful#onclick
- * @type {Function}
- * @default null
- */
- /**
- * @event module:zrender/mixin/Eventful#onmouseover
- * @type {Function}
- * @default null
- */
- /**
- * @event module:zrender/mixin/Eventful#onmouseout
- * @type {Function}
- * @default null
- */
- /**
- * @event module:zrender/mixin/Eventful#onmousemove
- * @type {Function}
- * @default null
- */
- /**
- * @event module:zrender/mixin/Eventful#onmousewheel
- * @type {Function}
- * @default null
- */
- /**
- * @event module:zrender/mixin/Eventful#onmousedown
- * @type {Function}
- * @default null
- */
- /**
- * @event module:zrender/mixin/Eventful#onmouseup
- * @type {Function}
- * @default null
- */
- /**
- * @event module:zrender/mixin/Eventful#ondragstart
- * @type {Function}
- * @default null
- */
- /**
- * @event module:zrender/mixin/Eventful#ondragend
- * @type {Function}
- * @default null
- */
- /**
- * @event module:zrender/mixin/Eventful#ondragenter
- * @type {Function}
- * @default null
- */
- /**
- * @event module:zrender/mixin/Eventful#ondragleave
- * @type {Function}
- * @default null
- */
- /**
- * @event module:zrender/mixin/Eventful#ondragover
- * @type {Function}
- * @default null
- */
- /**
- * @event module:zrender/mixin/Eventful#ondrop
- * @type {Function}
- * @default null
- */
-
- module.exports = Eventful;
-
-
-
-/***/ },
-/* 33 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * 提供变换扩展
- * @module zrender/mixin/Transformable
- * @author pissang (https://www.github.com/pissang)
- */
-
-
- var matrix = __webpack_require__(17);
- var vector = __webpack_require__(16);
- var mIdentity = matrix.identity;
-
- var EPSILON = 5e-5;
-
- function isNotAroundZero(val) {
- return val > EPSILON || val < -EPSILON;
- }
-
- /**
- * @alias module:zrender/mixin/Transformable
- * @constructor
- */
- var Transformable = function (opts) {
- opts = opts || {};
- // If there are no given position, rotation, scale
- if (!opts.position) {
- /**
- * 平移
- * @type {Array.<number>}
- * @default [0, 0]
- */
- this.position = [0, 0];
- }
- if (opts.rotation == null) {
- /**
- * 旋转
- * @type {Array.<number>}
- * @default 0
- */
- this.rotation = 0;
- }
- if (!opts.scale) {
- /**
- * 缩放
- * @type {Array.<number>}
- * @default [1, 1]
- */
- this.scale = [1, 1];
- }
- /**
- * 旋转和缩放的原点
- * @type {Array.<number>}
- * @default null
- */
- this.origin = this.origin || null;
- };
-
- var transformableProto = Transformable.prototype;
- transformableProto.transform = null;
-
- /**
- * 判断是否需要有坐标变换
- * 如果有坐标变换, 则从position, rotation, scale以及父节点的transform计算出自身的transform矩阵
- */
- transformableProto.needLocalTransform = function () {
- return isNotAroundZero(this.rotation)
- || isNotAroundZero(this.position[0])
- || isNotAroundZero(this.position[1])
- || isNotAroundZero(this.scale[0] - 1)
- || isNotAroundZero(this.scale[1] - 1);
- };
-
- transformableProto.updateTransform = function () {
- var parent = this.parent;
- var parentHasTransform = parent && parent.transform;
- var needLocalTransform = this.needLocalTransform();
-
- var m = this.transform;
- if (!(needLocalTransform || parentHasTransform)) {
- m && mIdentity(m);
- return;
- }
-
- m = m || matrix.create();
-
- if (needLocalTransform) {
- this.getLocalTransform(m);
- }
- else {
- mIdentity(m);
- }
-
- // 应用父节点变换
- if (parentHasTransform) {
- if (needLocalTransform) {
- matrix.mul(m, parent.transform, m);
- }
- else {
- matrix.copy(m, parent.transform);
- }
- }
- // 保存这个变换矩阵
- this.transform = m;
-
- this.invTransform = this.invTransform || matrix.create();
- matrix.invert(this.invTransform, m);
- };
-
- transformableProto.getLocalTransform = function (m) {
- m = m || [];
- mIdentity(m);
-
- var origin = this.origin;
-
- var scale = this.scale;
- var rotation = this.rotation;
- var position = this.position;
- if (origin) {
- // Translate to origin
- m[4] -= origin[0];
- m[5] -= origin[1];
- }
- matrix.scale(m, m, scale);
- if (rotation) {
- matrix.rotate(m, m, rotation);
- }
- if (origin) {
- // Translate back from origin
- m[4] += origin[0];
- m[5] += origin[1];
- }
-
- m[4] += position[0];
- m[5] += position[1];
-
- return m;
- };
- /**
- * 将自己的transform应用到context上
- * @param {Context2D} ctx
- */
- transformableProto.setTransform = function (ctx) {
- var m = this.transform;
- if (m) {
- ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
- }
- };
-
- var tmpTransform = [];
-
- /**
- * 分解`transform`矩阵到`position`, `rotation`, `scale`
- */
- transformableProto.decomposeTransform = function () {
- if (!this.transform) {
- return;
- }
- var parent = this.parent;
- var m = this.transform;
- if (parent && parent.transform) {
- // Get local transform and decompose them to position, scale, rotation
- matrix.mul(tmpTransform, parent.invTransform, m);
- m = tmpTransform;
- }
- var sx = m[0] * m[0] + m[1] * m[1];
- var sy = m[2] * m[2] + m[3] * m[3];
- var position = this.position;
- var scale = this.scale;
- if (isNotAroundZero(sx - 1)) {
- sx = Math.sqrt(sx);
- }
- if (isNotAroundZero(sy - 1)) {
- sy = Math.sqrt(sy);
- }
- if (m[0] < 0) {
- sx = -sx;
- }
- if (m[3] < 0) {
- sy = -sy;
- }
- position[0] = m[4];
- position[1] = m[5];
- scale[0] = sx;
- scale[1] = sy;
- this.rotation = Math.atan2(-m[1] / sy, m[0] / sx);
- };
-
- /**
- * 变换坐标位置到 shape 的局部坐标空间
- * @method
- * @param {number} x
- * @param {number} y
- * @return {Array.<number>}
- */
- transformableProto.transformCoordToLocal = function (x, y) {
- var v2 = [x, y];
- var invTransform = this.invTransform;
- if (invTransform) {
- vector.applyTransform(v2, v2, invTransform);
- }
- return v2;
- };
-
- /**
- * 变换局部坐标位置到全局坐标空间
- * @method
- * @param {number} x
- * @param {number} y
- * @return {Array.<number>}
- */
- transformableProto.transformCoordToGlobal = function (x, y) {
- var v2 = [x, y];
- var transform = this.transform;
- if (transform) {
- vector.applyTransform(v2, v2, transform);
- }
- return v2;
- };
-
- module.exports = Transformable;
-
-
-
-/***/ },
-/* 34 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * @module zrender/mixin/Animatable
- */
-
-
- var Animator = __webpack_require__(35);
- var util = __webpack_require__(3);
- var isString = util.isString;
- var isFunction = util.isFunction;
- var isObject = util.isObject;
- var log = __webpack_require__(39);
-
- /**
- * @alias modue:zrender/mixin/Animatable
- * @constructor
- */
- var Animatable = function () {
-
- /**
- * @type {Array.<module:zrender/animation/Animator>}
- * @readOnly
- */
- this.animators = [];
- };
-
- Animatable.prototype = {
-
- constructor: Animatable,
-
- /**
- * 动画
- *
- * @param {string} path 需要添加动画的属性获取路径,可以通过a.b.c来获取深层的属性
- * @param {boolean} [loop] 动画是否循环
- * @return {module:zrender/animation/Animator}
- * @example:
- * el.animate('style', false)
- * .when(1000, {x: 10} )
- * .done(function(){ // Animation done })
- * .start()
- */
- animate: function (path, loop) {
- var target;
- var animatingShape = false;
- var el = this;
- var zr = this.__zr;
- if (path) {
- var pathSplitted = path.split('.');
- var prop = el;
- // If animating shape
- animatingShape = pathSplitted[0] === 'shape';
- for (var i = 0, l = pathSplitted.length; i < l; i++) {
- if (!prop) {
- continue;
- }
- prop = prop[pathSplitted[i]];
- }
- if (prop) {
- target = prop;
- }
- }
- else {
- target = el;
- }
-
- if (!target) {
- log(
- 'Property "'
- + path
- + '" is not existed in element '
- + el.id
- );
- return;
- }
-
- var animators = el.animators;
-
- var animator = new Animator(target, loop);
-
- animator.during(function (target) {
- el.dirty(animatingShape);
- })
- .done(function () {
- // FIXME Animator will not be removed if use `Animator#stop` to stop animation
- animators.splice(util.indexOf(animators, animator), 1);
- });
-
- animators.push(animator);
-
- // If animate after added to the zrender
- if (zr) {
- zr.animation.addAnimator(animator);
- }
-
- return animator;
- },
-
- /**
- * 停止动画
- * @param {boolean} forwardToLast If move to last frame before stop
- */
- stopAnimation: function (forwardToLast) {
- var animators = this.animators;
- var len = animators.length;
- for (var i = 0; i < len; i++) {
- animators[i].stop(forwardToLast);
- }
- animators.length = 0;
-
- return this;
- },
-
- /**
- * @param {Object} target
- * @param {number} [time=500] Time in ms
- * @param {string} [easing='linear']
- * @param {number} [delay=0]
- * @param {Function} [callback]
- *
- * @example
- * // Animate position
- * el.animateTo({
- * position: [10, 10]
- * }, function () { // done })
- *
- * // Animate shape, style and position in 100ms, delayed 100ms, with cubicOut easing
- * el.animateTo({
- * shape: {
- * width: 500
- * },
- * style: {
- * fill: 'red'
- * }
- * position: [10, 10]
- * }, 100, 100, 'cubicOut', function () { // done })
- */
- // TODO Return animation key
- animateTo: function (target, time, delay, easing, callback) {
- // animateTo(target, time, easing, callback);
- if (isString(delay)) {
- callback = easing;
- easing = delay;
- delay = 0;
- }
- // animateTo(target, time, delay, callback);
- else if (isFunction(easing)) {
- callback = easing;
- easing = 'linear';
- delay = 0;
- }
- // animateTo(target, time, callback);
- else if (isFunction(delay)) {
- callback = delay;
- delay = 0;
- }
- // animateTo(target, callback)
- else if (isFunction(time)) {
- callback = time;
- time = 500;
- }
- // animateTo(target)
- else if (!time) {
- time = 500;
- }
- // Stop all previous animations
- this.stopAnimation();
- this._animateToShallow('', this, target, time, delay, easing, callback);
-
- // Animators may be removed immediately after start
- // if there is nothing to animate
- var animators = this.animators.slice();
- var count = animators.length;
- function done() {
- count--;
- if (!count) {
- callback && callback();
- }
- }
-
- // No animators. This should be checked before animators[i].start(),
- // because 'done' may be executed immediately if no need to animate.
- if (!count) {
- callback && callback();
- }
- // Start after all animators created
- // Incase any animator is done immediately when all animation properties are not changed
- for (var i = 0; i < animators.length; i++) {
- animators[i]
- .done(done)
- .start(easing);
- }
- },
-
- /**
- * @private
- * @param {string} path=''
- * @param {Object} source=this
- * @param {Object} target
- * @param {number} [time=500]
- * @param {number} [delay=0]
- *
- * @example
- * // Animate position
- * el._animateToShallow({
- * position: [10, 10]
- * })
- *
- * // Animate shape, style and position in 100ms, delayed 100ms
- * el._animateToShallow({
- * shape: {
- * width: 500
- * },
- * style: {
- * fill: 'red'
- * }
- * position: [10, 10]
- * }, 100, 100)
- */
- _animateToShallow: function (path, source, target, time, delay) {
- var objShallow = {};
- var propertyCount = 0;
- for (var name in target) {
- if (source[name] != null) {
- if (isObject(target[name]) && !util.isArrayLike(target[name])) {
- this._animateToShallow(
- path ? path + '.' + name : name,
- source[name],
- target[name],
- time,
- delay
- );
- }
- else {
- objShallow[name] = target[name];
- propertyCount++;
- }
- }
- else if (target[name] != null) {
- // Attr directly if not has property
- // FIXME, if some property not needed for element ?
- if (!path) {
- this.attr(name, target[name]);
- }
- else { // Shape or style
- var props = {};
- props[path] = {};
- props[path][name] = target[name];
- this.attr(props);
- }
- }
- }
-
- if (propertyCount > 0) {
- this.animate(path, false)
- .when(time == null ? 500 : time, objShallow)
- .delay(delay || 0);
- }
-
- return this;
- }
- };
-
- module.exports = Animatable;
-
-
-/***/ },
-/* 35 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @module echarts/animation/Animator
- */
-
-
- var Clip = __webpack_require__(36);
- var color = __webpack_require__(38);
- var util = __webpack_require__(3);
- var isArrayLike = util.isArrayLike;
-
- var arraySlice = Array.prototype.slice;
-
- function defaultGetter(target, key) {
- return target[key];
- }
-
- function defaultSetter(target, key, value) {
- target[key] = value;
- }
-
- /**
- * @param {number} p0
- * @param {number} p1
- * @param {number} percent
- * @return {number}
- */
- function interpolateNumber(p0, p1, percent) {
- return (p1 - p0) * percent + p0;
- }
-
- /**
- * @param {string} p0
- * @param {string} p1
- * @param {number} percent
- * @return {string}
- */
- function interpolateString(p0, p1, percent) {
- return percent > 0.5 ? p1 : p0;
- }
-
- /**
- * @param {Array} p0
- * @param {Array} p1
- * @param {number} percent
- * @param {Array} out
- * @param {number} arrDim
- */
- function interpolateArray(p0, p1, percent, out, arrDim) {
- var len = p0.length;
- if (arrDim == 1) {
- for (var i = 0; i < len; i++) {
- out[i] = interpolateNumber(p0[i], p1[i], percent);
- }
- }
- else {
- var len2 = p0[0].length;
- for (var i = 0; i < len; i++) {
- for (var j = 0; j < len2; j++) {
- out[i][j] = interpolateNumber(
- p0[i][j], p1[i][j], percent
- );
- }
- }
- }
- }
-
- function fillArr(arr0, arr1, arrDim) {
- var arr0Len = arr0.length;
- var arr1Len = arr1.length;
- if (arr0Len === arr1Len) {
- return;
- }
- // FIXME Not work for TypedArray
- var isPreviousLarger = arr0Len > arr1Len;
- if (isPreviousLarger) {
- // Cut the previous
- arr0.length = arr1Len;
- }
- else {
- // Fill the previous
- for (var i = arr0Len; i < arr1Len; i++) {
- arr0.push(
- arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i])
- );
- }
- }
- }
-
- /**
- * @param {Array} arr0
- * @param {Array} arr1
- * @param {number} arrDim
- * @return {boolean}
- */
- function isArraySame(arr0, arr1, arrDim) {
- if (arr0 === arr1) {
- return true;
- }
- var len = arr0.length;
- if (len !== arr1.length) {
- return false;
- }
- if (arrDim === 1) {
- for (var i = 0; i < len; i++) {
- if (arr0[i] !== arr1[i]) {
- return false;
- }
- }
- }
- else {
- var len2 = arr0[0].length;
- for (var i = 0; i < len; i++) {
- for (var j = 0; j < len2; j++) {
- if (arr0[i][j] !== arr1[i][j]) {
- return false;
- }
- }
- }
- }
- return true;
- }
-
- /**
- * Catmull Rom interpolate array
- * @param {Array} p0
- * @param {Array} p1
- * @param {Array} p2
- * @param {Array} p3
- * @param {number} t
- * @param {number} t2
- * @param {number} t3
- * @param {Array} out
- * @param {number} arrDim
- */
- function catmullRomInterpolateArray(
- p0, p1, p2, p3, t, t2, t3, out, arrDim
- ) {
- var len = p0.length;
- if (arrDim == 1) {
- for (var i = 0; i < len; i++) {
- out[i] = catmullRomInterpolate(
- p0[i], p1[i], p2[i], p3[i], t, t2, t3
- );
- }
- }
- else {
- var len2 = p0[0].length;
- for (var i = 0; i < len; i++) {
- for (var j = 0; j < len2; j++) {
- out[i][j] = catmullRomInterpolate(
- p0[i][j], p1[i][j], p2[i][j], p3[i][j],
- t, t2, t3
- );
- }
- }
- }
- }
-
- /**
- * Catmull Rom interpolate number
- * @param {number} p0
- * @param {number} p1
- * @param {number} p2
- * @param {number} p3
- * @param {number} t
- * @param {number} t2
- * @param {number} t3
- * @return {number}
- */
- function catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {
- var v0 = (p2 - p0) * 0.5;
- var v1 = (p3 - p1) * 0.5;
- return (2 * (p1 - p2) + v0 + v1) * t3
- + (-3 * (p1 - p2) - 2 * v0 - v1) * t2
- + v0 * t + p1;
- }
-
- function cloneValue(value) {
- if (isArrayLike(value)) {
- var len = value.length;
- if (isArrayLike(value[0])) {
- var ret = [];
- for (var i = 0; i < len; i++) {
- ret.push(arraySlice.call(value[i]));
- }
- return ret;
- }
-
- return arraySlice.call(value);
- }
-
- return value;
- }
-
- function rgba2String(rgba) {
- rgba[0] = Math.floor(rgba[0]);
- rgba[1] = Math.floor(rgba[1]);
- rgba[2] = Math.floor(rgba[2]);
-
- return 'rgba(' + rgba.join(',') + ')';
- }
-
- function createTrackClip (animator, easing, oneTrackDone, keyframes, propName) {
- var getter = animator._getter;
- var setter = animator._setter;
- var useSpline = easing === 'spline';
-
- var trackLen = keyframes.length;
- if (!trackLen) {
- return;
- }
- // Guess data type
- var firstVal = keyframes[0].value;
- var isValueArray = isArrayLike(firstVal);
- var isValueColor = false;
- var isValueString = false;
-
- // For vertices morphing
- var arrDim = (
- isValueArray
- && isArrayLike(firstVal[0])
- )
- ? 2 : 1;
- var trackMaxTime;
- // Sort keyframe as ascending
- keyframes.sort(function(a, b) {
- return a.time - b.time;
- });
-
- trackMaxTime = keyframes[trackLen - 1].time;
- // Percents of each keyframe
- var kfPercents = [];
- // Value of each keyframe
- var kfValues = [];
- var prevValue = keyframes[0].value;
- var isAllValueEqual = true;
- for (var i = 0; i < trackLen; i++) {
- kfPercents.push(keyframes[i].time / trackMaxTime);
- // Assume value is a color when it is a string
- var value = keyframes[i].value;
-
- // Check if value is equal, deep check if value is array
- if (!((isValueArray && isArraySame(value, prevValue, arrDim))
- || (!isValueArray && value === prevValue))) {
- isAllValueEqual = false;
- }
- prevValue = value;
-
- // Try converting a string to a color array
- if (typeof value == 'string') {
- var colorArray = color.parse(value);
- if (colorArray) {
- value = colorArray;
- isValueColor = true;
- }
- else {
- isValueString = true;
- }
- }
- kfValues.push(value);
- }
- if (isAllValueEqual) {
- return;
- }
-
- if (isValueArray) {
- var lastValue = kfValues[trackLen - 1];
- // Polyfill array
- for (var i = 0; i < trackLen - 1; i++) {
- fillArr(kfValues[i], lastValue, arrDim);
- }
- fillArr(getter(animator._target, propName), lastValue, arrDim);
- }
-
- // Cache the key of last frame to speed up when
- // animation playback is sequency
- var lastFrame = 0;
- var lastFramePercent = 0;
- var start;
- var w;
- var p0;
- var p1;
- var p2;
- var p3;
-
- if (isValueColor) {
- var rgba = [0, 0, 0, 0];
- }
-
- var onframe = function (target, percent) {
- // Find the range keyframes
- // kf1-----kf2---------current--------kf3
- // find kf2 and kf3 and do interpolation
- var frame;
- if (percent < lastFramePercent) {
- // Start from next key
- start = Math.min(lastFrame + 1, trackLen - 1);
- for (frame = start; frame >= 0; frame--) {
- if (kfPercents[frame] <= percent) {
- break;
- }
- }
- frame = Math.min(frame, trackLen - 2);
- }
- else {
- for (frame = lastFrame; frame < trackLen; frame++) {
- if (kfPercents[frame] > percent) {
- break;
- }
- }
- frame = Math.min(frame - 1, trackLen - 2);
- }
- lastFrame = frame;
- lastFramePercent = percent;
-
- var range = (kfPercents[frame + 1] - kfPercents[frame]);
- if (range === 0) {
- return;
- }
- else {
- w = (percent - kfPercents[frame]) / range;
- }
- if (useSpline) {
- p1 = kfValues[frame];
- p0 = kfValues[frame === 0 ? frame : frame - 1];
- p2 = kfValues[frame > trackLen - 2 ? trackLen - 1 : frame + 1];
- p3 = kfValues[frame > trackLen - 3 ? trackLen - 1 : frame + 2];
- if (isValueArray) {
- catmullRomInterpolateArray(
- p0, p1, p2, p3, w, w * w, w * w * w,
- getter(target, propName),
- arrDim
- );
- }
- else {
- var value;
- if (isValueColor) {
- value = catmullRomInterpolateArray(
- p0, p1, p2, p3, w, w * w, w * w * w,
- rgba, 1
- );
- value = rgba2String(rgba);
- }
- else if (isValueString) {
- // String is step(0.5)
- return interpolateString(p1, p2, w);
- }
- else {
- value = catmullRomInterpolate(
- p0, p1, p2, p3, w, w * w, w * w * w
- );
- }
- setter(
- target,
- propName,
- value
- );
- }
- }
- else {
- if (isValueArray) {
- interpolateArray(
- kfValues[frame], kfValues[frame + 1], w,
- getter(target, propName),
- arrDim
- );
- }
- else {
- var value;
- if (isValueColor) {
- interpolateArray(
- kfValues[frame], kfValues[frame + 1], w,
- rgba, 1
- );
- value = rgba2String(rgba);
- }
- else if (isValueString) {
- // String is step(0.5)
- return interpolateString(kfValues[frame], kfValues[frame + 1], w);
- }
- else {
- value = interpolateNumber(kfValues[frame], kfValues[frame + 1], w);
- }
- setter(
- target,
- propName,
- value
- );
- }
- }
- };
-
- var clip = new Clip({
- target: animator._target,
- life: trackMaxTime,
- loop: animator._loop,
- delay: animator._delay,
- onframe: onframe,
- ondestroy: oneTrackDone
- });
-
- if (easing && easing !== 'spline') {
- clip.easing = easing;
- }
-
- return clip;
- }
-
- /**
- * @alias module:zrender/animation/Animator
- * @constructor
- * @param {Object} target
- * @param {boolean} loop
- * @param {Function} getter
- * @param {Function} setter
- */
- var Animator = function(target, loop, getter, setter) {
- this._tracks = {};
- this._target = target;
-
- this._loop = loop || false;
-
- this._getter = getter || defaultGetter;
- this._setter = setter || defaultSetter;
-
- this._clipCount = 0;
-
- this._delay = 0;
-
- this._doneList = [];
-
- this._onframeList = [];
-
- this._clipList = [];
- };
-
- Animator.prototype = {
- /**
- * 设置动画关键帧
- * @param {number} time 关键帧时间,单位是ms
- * @param {Object} props 关键帧的属性值,key-value表示
- * @return {module:zrender/animation/Animator}
- */
- when: function(time /* ms */, props) {
- var tracks = this._tracks;
- for (var propName in props) {
- if (!tracks[propName]) {
- tracks[propName] = [];
- // Invalid value
- var value = this._getter(this._target, propName);
- if (value == null) {
- // zrLog('Invalid property ' + propName);
- continue;
- }
- // If time is 0
- // Then props is given initialize value
- // Else
- // Initialize value from current prop value
- if (time !== 0) {
- tracks[propName].push({
- time: 0,
- value: cloneValue(value)
- });
- }
- }
- tracks[propName].push({
- time: time,
- value: props[propName]
- });
- }
- return this;
- },
- /**
- * 添加动画每一帧的回调函数
- * @param {Function} callback
- * @return {module:zrender/animation/Animator}
- */
- during: function (callback) {
- this._onframeList.push(callback);
- return this;
- },
-
- _doneCallback: function () {
- // Clear all tracks
- this._tracks = {};
- // Clear all clips
- this._clipList.length = 0;
-
- var doneList = this._doneList;
- var len = doneList.length;
- for (var i = 0; i < len; i++) {
- doneList[i].call(this);
- }
- },
- /**
- * 开始执行动画
- * @param {string|Function} easing
- * 动画缓动函数,详见{@link module:zrender/animation/easing}
- * @return {module:zrender/animation/Animator}
- */
- start: function (easing) {
-
- var self = this;
- var clipCount = 0;
-
- var oneTrackDone = function() {
- clipCount--;
- if (!clipCount) {
- self._doneCallback();
- }
- };
-
- var lastClip;
- for (var propName in this._tracks) {
- var clip = createTrackClip(
- this, easing, oneTrackDone,
- this._tracks[propName], propName
- );
- if (clip) {
- this._clipList.push(clip);
- clipCount++;
-
- // If start after added to animation
- if (this.animation) {
- this.animation.addClip(clip);
- }
-
- lastClip = clip;
- }
- }
-
- // Add during callback on the last clip
- if (lastClip) {
- var oldOnFrame = lastClip.onframe;
- lastClip.onframe = function (target, percent) {
- oldOnFrame(target, percent);
-
- for (var i = 0; i < self._onframeList.length; i++) {
- self._onframeList[i](target, percent);
- }
- };
- }
-
- if (!clipCount) {
- this._doneCallback();
- }
- return this;
- },
- /**
- * 停止动画
- * @param {boolean} forwardToLast If move to last frame before stop
- */
- stop: function (forwardToLast) {
- var clipList = this._clipList;
- var animation = this.animation;
- for (var i = 0; i < clipList.length; i++) {
- var clip = clipList[i];
- if (forwardToLast) {
- // Move to last frame before stop
- clip.onframe(this._target, 1);
- }
- animation && animation.removeClip(clip);
- }
- clipList.length = 0;
- },
- /**
- * 设置动画延迟开始的时间
- * @param {number} time 单位ms
- * @return {module:zrender/animation/Animator}
- */
- delay: function (time) {
- this._delay = time;
- return this;
- },
- /**
- * 添加动画结束的回调
- * @param {Function} cb
- * @return {module:zrender/animation/Animator}
- */
- done: function(cb) {
- if (cb) {
- this._doneList.push(cb);
- }
- return this;
- },
-
- /**
- * @return {Array.<module:zrender/animation/Clip>}
- */
- getClips: function () {
- return this._clipList;
- }
- };
-
- module.exports = Animator;
-
-
-/***/ },
-/* 36 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * 动画主控制器
- * @config target 动画对象,可以是数组,如果是数组的话会批量分发onframe等事件
- * @config life(1000) 动画时长
- * @config delay(0) 动画延迟时间
- * @config loop(true)
- * @config gap(0) 循环的间隔时间
- * @config onframe
- * @config easing(optional)
- * @config ondestroy(optional)
- * @config onrestart(optional)
- *
- * TODO pause
- */
-
-
- var easingFuncs = __webpack_require__(37);
-
- function Clip(options) {
-
- this._target = options.target;
-
- // 生命周期
- this._life = options.life || 1000;
- // 延时
- this._delay = options.delay || 0;
- // 开始时间
- // this._startTime = new Date().getTime() + this._delay;// 单位毫秒
- this._initialized = false;
-
- // 是否循环
- this.loop = options.loop == null ? false : options.loop;
-
- this.gap = options.gap || 0;
-
- this.easing = options.easing || 'Linear';
-
- this.onframe = options.onframe;
- this.ondestroy = options.ondestroy;
- this.onrestart = options.onrestart;
- }
-
- Clip.prototype = {
-
- constructor: Clip,
-
- step: function (time) {
- // Set startTime on first step, or _startTime may has milleseconds different between clips
- // PENDING
- if (!this._initialized) {
- this._startTime = new Date().getTime() + this._delay;
- this._initialized = true;
- }
-
- var percent = (time - this._startTime) / this._life;
-
- // 还没开始
- if (percent < 0) {
- return;
- }
-
- percent = Math.min(percent, 1);
-
- var easing = this.easing;
- var easingFunc = typeof easing == 'string' ? easingFuncs[easing] : easing;
- var schedule = typeof easingFunc === 'function'
- ? easingFunc(percent)
- : percent;
-
- this.fire('frame', schedule);
-
- // 结束
- if (percent == 1) {
- if (this.loop) {
- this.restart();
- // 重新开始周期
- // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件
- return 'restart';
- }
-
- // 动画完成将这个控制器标识为待删除
- // 在Animation.update中进行批量删除
- this._needsRemove = true;
- return 'destroy';
- }
-
- return null;
- },
-
- restart: function() {
- var time = new Date().getTime();
- var remainder = (time - this._startTime) % this._life;
- this._startTime = new Date().getTime() - remainder + this.gap;
-
- this._needsRemove = false;
- },
-
- fire: function(eventType, arg) {
- eventType = 'on' + eventType;
- if (this[eventType]) {
- this[eventType](this._target, arg);
- }
- }
- };
-
- module.exports = Clip;
-
-
-
-/***/ },
-/* 37 */
-/***/ function(module, exports) {
-
- /**
- * 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js
- * @see http://sole.github.io/tween.js/examples/03_graphs.html
- * @exports zrender/animation/easing
- */
-
- var easing = {
- /**
- * @param {number} k
- * @return {number}
- */
- linear: function (k) {
- return k;
- },
-
- /**
- * @param {number} k
- * @return {number}
- */
- quadraticIn: function (k) {
- return k * k;
- },
- /**
- * @param {number} k
- * @return {number}
- */
- quadraticOut: function (k) {
- return k * (2 - k);
- },
- /**
- * @param {number} k
- * @return {number}
- */
- quadraticInOut: function (k) {
- if ((k *= 2) < 1) {
- return 0.5 * k * k;
- }
- return -0.5 * (--k * (k - 2) - 1);
- },
-
- // 三次方的缓动(t^3)
- /**
- * @param {number} k
- * @return {number}
- */
- cubicIn: function (k) {
- return k * k * k;
- },
- /**
- * @param {number} k
- * @return {number}
- */
- cubicOut: function (k) {
- return --k * k * k + 1;
- },
- /**
- * @param {number} k
- * @return {number}
- */
- cubicInOut: function (k) {
- if ((k *= 2) < 1) {
- return 0.5 * k * k * k;
- }
- return 0.5 * ((k -= 2) * k * k + 2);
- },
-
- // 四次方的缓动(t^4)
- /**
- * @param {number} k
- * @return {number}
- */
- quarticIn: function (k) {
- return k * k * k * k;
- },
- /**
- * @param {number} k
- * @return {number}
- */
- quarticOut: function (k) {
- return 1 - (--k * k * k * k);
- },
- /**
- * @param {number} k
- * @return {number}
- */
- quarticInOut: function (k) {
- if ((k *= 2) < 1) {
- return 0.5 * k * k * k * k;
- }
- return -0.5 * ((k -= 2) * k * k * k - 2);
- },
-
- // 五次方的缓动(t^5)
- /**
- * @param {number} k
- * @return {number}
- */
- quinticIn: function (k) {
- return k * k * k * k * k;
- },
- /**
- * @param {number} k
- * @return {number}
- */
- quinticOut: function (k) {
- return --k * k * k * k * k + 1;
- },
- /**
- * @param {number} k
- * @return {number}
- */
- quinticInOut: function (k) {
- if ((k *= 2) < 1) {
- return 0.5 * k * k * k * k * k;
- }
- return 0.5 * ((k -= 2) * k * k * k * k + 2);
- },
-
- // 正弦曲线的缓动(sin(t))
- /**
- * @param {number} k
- * @return {number}
- */
- sinusoidalIn: function (k) {
- return 1 - Math.cos(k * Math.PI / 2);
- },
- /**
- * @param {number} k
- * @return {number}
- */
- sinusoidalOut: function (k) {
- return Math.sin(k * Math.PI / 2);
- },
- /**
- * @param {number} k
- * @return {number}
- */
- sinusoidalInOut: function (k) {
- return 0.5 * (1 - Math.cos(Math.PI * k));
- },
-
- // 指数曲线的缓动(2^t)
- /**
- * @param {number} k
- * @return {number}
- */
- exponentialIn: function (k) {
- return k === 0 ? 0 : Math.pow(1024, k - 1);
- },
- /**
- * @param {number} k
- * @return {number}
- */
- exponentialOut: function (k) {
- return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);
- },
- /**
- * @param {number} k
- * @return {number}
- */
- exponentialInOut: function (k) {
- if (k === 0) {
- return 0;
- }
- if (k === 1) {
- return 1;
- }
- if ((k *= 2) < 1) {
- return 0.5 * Math.pow(1024, k - 1);
- }
- return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);
- },
-
- // 圆形曲线的缓动(sqrt(1-t^2))
- /**
- * @param {number} k
- * @return {number}
- */
- circularIn: function (k) {
- return 1 - Math.sqrt(1 - k * k);
- },
- /**
- * @param {number} k
- * @return {number}
- */
- circularOut: function (k) {
- return Math.sqrt(1 - (--k * k));
- },
- /**
- * @param {number} k
- * @return {number}
- */
- circularInOut: function (k) {
- if ((k *= 2) < 1) {
- return -0.5 * (Math.sqrt(1 - k * k) - 1);
- }
- return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);
- },
-
- // 创建类似于弹簧在停止前来回振荡的动画
- /**
- * @param {number} k
- * @return {number}
- */
- elasticIn: function (k) {
- var s;
- var a = 0.1;
- var p = 0.4;
- if (k === 0) {
- return 0;
- }
- if (k === 1) {
- return 1;
- }
- if (!a || a < 1) {
- a = 1; s = p / 4;
- }
- else {
- s = p * Math.asin(1 / a) / (2 * Math.PI);
- }
- return -(a * Math.pow(2, 10 * (k -= 1)) *
- Math.sin((k - s) * (2 * Math.PI) / p));
- },
- /**
- * @param {number} k
- * @return {number}
- */
- elasticOut: function (k) {
- var s;
- var a = 0.1;
- var p = 0.4;
- if (k === 0) {
- return 0;
- }
- if (k === 1) {
- return 1;
- }
- if (!a || a < 1) {
- a = 1; s = p / 4;
- }
- else {
- s = p * Math.asin(1 / a) / (2 * Math.PI);
- }
- return (a * Math.pow(2, -10 * k) *
- Math.sin((k - s) * (2 * Math.PI) / p) + 1);
- },
- /**
- * @param {number} k
- * @return {number}
- */
- elasticInOut: function (k) {
- var s;
- var a = 0.1;
- var p = 0.4;
- if (k === 0) {
- return 0;
- }
- if (k === 1) {
- return 1;
- }
- if (!a || a < 1) {
- a = 1; s = p / 4;
- }
- else {
- s = p * Math.asin(1 / a) / (2 * Math.PI);
- }
- if ((k *= 2) < 1) {
- return -0.5 * (a * Math.pow(2, 10 * (k -= 1))
- * Math.sin((k - s) * (2 * Math.PI) / p));
- }
- return a * Math.pow(2, -10 * (k -= 1))
- * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;
-
- },
-
- // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动
- /**
- * @param {number} k
- * @return {number}
- */
- backIn: function (k) {
- var s = 1.70158;
- return k * k * ((s + 1) * k - s);
- },
- /**
- * @param {number} k
- * @return {number}
- */
- backOut: function (k) {
- var s = 1.70158;
- return --k * k * ((s + 1) * k + s) + 1;
- },
- /**
- * @param {number} k
- * @return {number}
- */
- backInOut: function (k) {
- var s = 1.70158 * 1.525;
- if ((k *= 2) < 1) {
- return 0.5 * (k * k * ((s + 1) * k - s));
- }
- return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);
- },
-
- // 创建弹跳效果
- /**
- * @param {number} k
- * @return {number}
- */
- bounceIn: function (k) {
- return 1 - easing.bounceOut(1 - k);
- },
- /**
- * @param {number} k
- * @return {number}
- */
- bounceOut: function (k) {
- if (k < (1 / 2.75)) {
- return 7.5625 * k * k;
- }
- else if (k < (2 / 2.75)) {
- return 7.5625 * (k -= (1.5 / 2.75)) * k + 0.75;
- }
- else if (k < (2.5 / 2.75)) {
- return 7.5625 * (k -= (2.25 / 2.75)) * k + 0.9375;
- }
- else {
- return 7.5625 * (k -= (2.625 / 2.75)) * k + 0.984375;
- }
- },
- /**
- * @param {number} k
- * @return {number}
- */
- bounceInOut: function (k) {
- if (k < 0.5) {
- return easing.bounceIn(k * 2) * 0.5;
- }
- return easing.bounceOut(k * 2 - 1) * 0.5 + 0.5;
- }
- };
-
- module.exports = easing;
-
-
-
-
-/***/ },
-/* 38 */
-/***/ function(module, exports) {
-
- /**
- * @module zrender/tool/color
- */
-
-
- var kCSSColorTable = {
- 'transparent': [0,0,0,0], 'aliceblue': [240,248,255,1],
- 'antiquewhite': [250,235,215,1], 'aqua': [0,255,255,1],
- 'aquamarine': [127,255,212,1], 'azure': [240,255,255,1],
- 'beige': [245,245,220,1], 'bisque': [255,228,196,1],
- 'black': [0,0,0,1], 'blanchedalmond': [255,235,205,1],
- 'blue': [0,0,255,1], 'blueviolet': [138,43,226,1],
- 'brown': [165,42,42,1], 'burlywood': [222,184,135,1],
- 'cadetblue': [95,158,160,1], 'chartreuse': [127,255,0,1],
- 'chocolate': [210,105,30,1], 'coral': [255,127,80,1],
- 'cornflowerblue': [100,149,237,1], 'cornsilk': [255,248,220,1],
- 'crimson': [220,20,60,1], 'cyan': [0,255,255,1],
- 'darkblue': [0,0,139,1], 'darkcyan': [0,139,139,1],
- 'darkgoldenrod': [184,134,11,1], 'darkgray': [169,169,169,1],
- 'darkgreen': [0,100,0,1], 'darkgrey': [169,169,169,1],
- 'darkkhaki': [189,183,107,1], 'darkmagenta': [139,0,139,1],
- 'darkolivegreen': [85,107,47,1], 'darkorange': [255,140,0,1],
- 'darkorchid': [153,50,204,1], 'darkred': [139,0,0,1],
- 'darksalmon': [233,150,122,1], 'darkseagreen': [143,188,143,1],
- 'darkslateblue': [72,61,139,1], 'darkslategray': [47,79,79,1],
- 'darkslategrey': [47,79,79,1], 'darkturquoise': [0,206,209,1],
- 'darkviolet': [148,0,211,1], 'deeppink': [255,20,147,1],
- 'deepskyblue': [0,191,255,1], 'dimgray': [105,105,105,1],
- 'dimgrey': [105,105,105,1], 'dodgerblue': [30,144,255,1],
- 'firebrick': [178,34,34,1], 'floralwhite': [255,250,240,1],
- 'forestgreen': [34,139,34,1], 'fuchsia': [255,0,255,1],
- 'gainsboro': [220,220,220,1], 'ghostwhite': [248,248,255,1],
- 'gold': [255,215,0,1], 'goldenrod': [218,165,32,1],
- 'gray': [128,128,128,1], 'green': [0,128,0,1],
- 'greenyellow': [173,255,47,1], 'grey': [128,128,128,1],
- 'honeydew': [240,255,240,1], 'hotpink': [255,105,180,1],
- 'indianred': [205,92,92,1], 'indigo': [75,0,130,1],
- 'ivory': [255,255,240,1], 'khaki': [240,230,140,1],
- 'lavender': [230,230,250,1], 'lavenderblush': [255,240,245,1],
- 'lawngreen': [124,252,0,1], 'lemonchiffon': [255,250,205,1],
- 'lightblue': [173,216,230,1], 'lightcoral': [240,128,128,1],
- 'lightcyan': [224,255,255,1], 'lightgoldenrodyellow': [250,250,210,1],
- 'lightgray': [211,211,211,1], 'lightgreen': [144,238,144,1],
- 'lightgrey': [211,211,211,1], 'lightpink': [255,182,193,1],
- 'lightsalmon': [255,160,122,1], 'lightseagreen': [32,178,170,1],
- 'lightskyblue': [135,206,250,1], 'lightslategray': [119,136,153,1],
- 'lightslategrey': [119,136,153,1], 'lightsteelblue': [176,196,222,1],
- 'lightyellow': [255,255,224,1], 'lime': [0,255,0,1],
- 'limegreen': [50,205,50,1], 'linen': [250,240,230,1],
- 'magenta': [255,0,255,1], 'maroon': [128,0,0,1],
- 'mediumaquamarine': [102,205,170,1], 'mediumblue': [0,0,205,1],
- 'mediumorchid': [186,85,211,1], 'mediumpurple': [147,112,219,1],
- 'mediumseagreen': [60,179,113,1], 'mediumslateblue': [123,104,238,1],
- 'mediumspringgreen': [0,250,154,1], 'mediumturquoise': [72,209,204,1],
- 'mediumvioletred': [199,21,133,1], 'midnightblue': [25,25,112,1],
- 'mintcream': [245,255,250,1], 'mistyrose': [255,228,225,1],
- 'moccasin': [255,228,181,1], 'navajowhite': [255,222,173,1],
- 'navy': [0,0,128,1], 'oldlace': [253,245,230,1],
- 'olive': [128,128,0,1], 'olivedrab': [107,142,35,1],
- 'orange': [255,165,0,1], 'orangered': [255,69,0,1],
- 'orchid': [218,112,214,1], 'palegoldenrod': [238,232,170,1],
- 'palegreen': [152,251,152,1], 'paleturquoise': [175,238,238,1],
- 'palevioletred': [219,112,147,1], 'papayawhip': [255,239,213,1],
- 'peachpuff': [255,218,185,1], 'peru': [205,133,63,1],
- 'pink': [255,192,203,1], 'plum': [221,160,221,1],
- 'powderblue': [176,224,230,1], 'purple': [128,0,128,1],
- 'red': [255,0,0,1], 'rosybrown': [188,143,143,1],
- 'royalblue': [65,105,225,1], 'saddlebrown': [139,69,19,1],
- 'salmon': [250,128,114,1], 'sandybrown': [244,164,96,1],
- 'seagreen': [46,139,87,1], 'seashell': [255,245,238,1],
- 'sienna': [160,82,45,1], 'silver': [192,192,192,1],
- 'skyblue': [135,206,235,1], 'slateblue': [106,90,205,1],
- 'slategray': [112,128,144,1], 'slategrey': [112,128,144,1],
- 'snow': [255,250,250,1], 'springgreen': [0,255,127,1],
- 'steelblue': [70,130,180,1], 'tan': [210,180,140,1],
- 'teal': [0,128,128,1], 'thistle': [216,191,216,1],
- 'tomato': [255,99,71,1], 'turquoise': [64,224,208,1],
- 'violet': [238,130,238,1], 'wheat': [245,222,179,1],
- 'white': [255,255,255,1], 'whitesmoke': [245,245,245,1],
- 'yellow': [255,255,0,1], 'yellowgreen': [154,205,50,1]
- };
-
- function clampCssByte(i) { // Clamp to integer 0 .. 255.
- i = Math.round(i); // Seems to be what Chrome does (vs truncation).
- return i < 0 ? 0 : i > 255 ? 255 : i;
- }
-
- function clampCssAngle(i) { // Clamp to integer 0 .. 360.
- i = Math.round(i); // Seems to be what Chrome does (vs truncation).
- return i < 0 ? 0 : i > 360 ? 360 : i;
- }
-
- function clampCssFloat(f) { // Clamp to float 0.0 .. 1.0.
- return f < 0 ? 0 : f > 1 ? 1 : f;
- }
-
- function parseCssInt(str) { // int or percentage.
- if (str.length && str.charAt(str.length - 1) === '%') {
- return clampCssByte(parseFloat(str) / 100 * 255);
- }
- return clampCssByte(parseInt(str, 10));
- }
-
- function parseCssFloat(str) { // float or percentage.
- if (str.length && str.charAt(str.length - 1) === '%') {
- return clampCssFloat(parseFloat(str) / 100);
- }
- return clampCssFloat(parseFloat(str));
- }
-
- function cssHueToRgb(m1, m2, h) {
- if (h < 0) {
- h += 1;
- }
- else if (h > 1) {
- h -= 1;
- }
-
- if (h * 6 < 1) {
- return m1 + (m2 - m1) * h * 6;
- }
- if (h * 2 < 1) {
- return m2;
- }
- if (h * 3 < 2) {
- return m1 + (m2 - m1) * (2/3 - h) * 6;
- }
- return m1;
- }
-
- function lerp(a, b, p) {
- return a + (b - a) * p;
- }
-
- /**
- * @param {string} colorStr
- * @return {Array.<number>}
- * @memberOf module:zrender/util/color
- */
- function parse(colorStr) {
- if (!colorStr) {
- return;
- }
- // colorStr may be not string
- colorStr = colorStr + '';
- // Remove all whitespace, not compliant, but should just be more accepting.
- var str = colorStr.replace(/ /g, '').toLowerCase();
-
- // Color keywords (and transparent) lookup.
- if (str in kCSSColorTable) {
- return kCSSColorTable[str].slice(); // dup.
- }
-
- // #abc and #abc123 syntax.
- if (str.charAt(0) === '#') {
- if (str.length === 4) {
- var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.
- if (!(iv >= 0 && iv <= 0xfff)) {
- return; // Covers NaN.
- }
- return [
- ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8),
- (iv & 0xf0) | ((iv & 0xf0) >> 4),
- (iv & 0xf) | ((iv & 0xf) << 4),
- 1
- ];
- }
- else if (str.length === 7) {
- var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.
- if (!(iv >= 0 && iv <= 0xffffff)) {
- return; // Covers NaN.
- }
- return [
- (iv & 0xff0000) >> 16,
- (iv & 0xff00) >> 8,
- iv & 0xff,
- 1
- ];
- }
-
- return;
- }
- var op = str.indexOf('('), ep = str.indexOf(')');
- if (op !== -1 && ep + 1 === str.length) {
- var fname = str.substr(0, op);
- var params = str.substr(op + 1, ep - (op + 1)).split(',');
- var alpha = 1; // To allow case fallthrough.
- switch (fname) {
- case 'rgba':
- if (params.length !== 4) {
- return;
- }
- alpha = parseCssFloat(params.pop()); // jshint ignore:line
- // Fall through.
- case 'rgb':
- if (params.length !== 3) {
- return;
- }
- return [
- parseCssInt(params[0]),
- parseCssInt(params[1]),
- parseCssInt(params[2]),
- alpha
- ];
- case 'hsla':
- if (params.length !== 4) {
- return;
- }
- params[3] = parseCssFloat(params[3]);
- return hsla2rgba(params);
- case 'hsl':
- if (params.length !== 3) {
- return;
- }
- return hsla2rgba(params);
- default:
- return;
- }
- }
-
- return;
- }
-
- /**
- * @param {Array.<number>} hsla
- * @return {Array.<number>} rgba
- */
- function hsla2rgba(hsla) {
- var h = (((parseFloat(hsla[0]) % 360) + 360) % 360) / 360; // 0 .. 1
- // NOTE(deanm): According to the CSS spec s/l should only be
- // percentages, but we don't bother and let float or percentage.
- var s = parseCssFloat(hsla[1]);
- var l = parseCssFloat(hsla[2]);
- var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
- var m1 = l * 2 - m2;
-
- var rgba = [
- clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255),
- clampCssByte(cssHueToRgb(m1, m2, h) * 255),
- clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255)
- ];
-
- if (hsla.length === 4) {
- rgba[3] = hsla[3];
- }
-
- return rgba;
- }
-
- /**
- * @param {Array.<number>} rgba
- * @return {Array.<number>} hsla
- */
- function rgba2hsla(rgba) {
- if (!rgba) {
- return;
- }
-
- // RGB from 0 to 255
- var R = rgba[0] / 255;
- var G = rgba[1] / 255;
- var B = rgba[2] / 255;
-
- var vMin = Math.min(R, G, B); // Min. value of RGB
- var vMax = Math.max(R, G, B); // Max. value of RGB
- var delta = vMax - vMin; // Delta RGB value
-
- var L = (vMax + vMin) / 2;
- var H;
- var S;
- // HSL results from 0 to 1
- if (delta === 0) {
- H = 0;
- S = 0;
- }
- else {
- if (L < 0.5) {
- S = delta / (vMax + vMin);
- }
- else {
- S = delta / (2 - vMax - vMin);
- }
-
- var deltaR = (((vMax - R) / 6) + (delta / 2)) / delta;
- var deltaG = (((vMax - G) / 6) + (delta / 2)) / delta;
- var deltaB = (((vMax - B) / 6) + (delta / 2)) / delta;
-
- if (R === vMax) {
- H = deltaB - deltaG;
- }
- else if (G === vMax) {
- H = (1 / 3) + deltaR - deltaB;
- }
- else if (B === vMax) {
- H = (2 / 3) + deltaG - deltaR;
- }
-
- if (H < 0) {
- H += 1;
- }
-
- if (H > 1) {
- H -= 1;
- }
- }
-
- var hsla = [H * 360, S, L];
-
- if (rgba[3] != null) {
- hsla.push(rgba[3]);
- }
-
- return hsla;
- }
-
- /**
- * @param {string} color
- * @param {number} level
- * @return {string}
- * @memberOf module:zrender/util/color
- */
- function lift(color, level) {
- var colorArr = parse(color);
- if (colorArr) {
- for (var i = 0; i < 3; i++) {
- if (level < 0) {
- colorArr[i] = colorArr[i] * (1 - level) | 0;
- }
- else {
- colorArr[i] = ((255 - colorArr[i]) * level + colorArr[i]) | 0;
- }
- }
- return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');
- }
- }
-
- /**
- * @param {string} color
- * @return {string}
- * @memberOf module:zrender/util/color
- */
- function toHex(color, level) {
- var colorArr = parse(color);
- if (colorArr) {
- return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + (+colorArr[2])).toString(16).slice(1);
- }
- }
-
- /**
- * Map value to color. Faster than mapToColor methods because color is represented by rgba array
- * @param {number} normalizedValue A float between 0 and 1.
- * @param {Array.<Array.<number>>} colors List of rgba color array
- * @param {Array.<number>} [out] Mapped gba color array
- * @return {Array.<number>}
- */
- function fastMapToColor(normalizedValue, colors, out) {
- if (!(colors && colors.length)
- || !(normalizedValue >= 0 && normalizedValue <= 1)
- ) {
- return;
- }
- out = out || [0, 0, 0, 0];
- var value = normalizedValue * (colors.length - 1);
- var leftIndex = Math.floor(value);
- var rightIndex = Math.ceil(value);
- var leftColor = colors[leftIndex];
- var rightColor = colors[rightIndex];
- var dv = value - leftIndex;
- out[0] = clampCssByte(lerp(leftColor[0], rightColor[0], dv));
- out[1] = clampCssByte(lerp(leftColor[1], rightColor[1], dv));
- out[2] = clampCssByte(lerp(leftColor[2], rightColor[2], dv));
- out[3] = clampCssByte(lerp(leftColor[3], rightColor[3], dv));
- return out;
- }
- /**
- * @param {number} normalizedValue A float between 0 and 1.
- * @param {Array.<string>} colors Color list.
- * @param {boolean=} fullOutput Default false.
- * @return {(string|Object)} Result color. If fullOutput,
- * return {color: ..., leftIndex: ..., rightIndex: ..., value: ...},
- * @memberOf module:zrender/util/color
- */
- function mapToColor(normalizedValue, colors, fullOutput) {
- if (!(colors && colors.length)
- || !(normalizedValue >= 0 && normalizedValue <= 1)
- ) {
- return;
- }
-
- var value = normalizedValue * (colors.length - 1);
- var leftIndex = Math.floor(value);
- var rightIndex = Math.ceil(value);
- var leftColor = parse(colors[leftIndex]);
- var rightColor = parse(colors[rightIndex]);
- var dv = value - leftIndex;
-
- var color = stringify(
- [
- clampCssByte(lerp(leftColor[0], rightColor[0], dv)),
- clampCssByte(lerp(leftColor[1], rightColor[1], dv)),
- clampCssByte(lerp(leftColor[2], rightColor[2], dv)),
- clampCssFloat(lerp(leftColor[3], rightColor[3], dv))
- ],
- 'rgba'
- );
-
- return fullOutput
- ? {
- color: color,
- leftIndex: leftIndex,
- rightIndex: rightIndex,
- value: value
- }
- : color;
- }
-
- /**
- * @param {Array<number>} interval Array length === 2,
- * each item is normalized value ([0, 1]).
- * @param {Array.<string>} colors Color list.
- * @return {Array.<Object>} colors corresponding to the interval,
- * each item is {color: 'xxx', offset: ...}
- * where offset is between 0 and 1.
- * @memberOf module:zrender/util/color
- */
- function mapIntervalToColor(interval, colors) {
- if (interval.length !== 2 || interval[1] < interval[0]) {
- return;
- }
-
- var info0 = mapToColor(interval[0], colors, true);
- var info1 = mapToColor(interval[1], colors, true);
-
- var result = [{color: info0.color, offset: 0}];
-
- var during = info1.value - info0.value;
- var start = Math.max(info0.value, info0.rightIndex);
- var end = Math.min(info1.value, info1.leftIndex);
-
- for (var i = start; during > 0 && i <= end; i++) {
- result.push({
- color: colors[i],
- offset: (i - info0.value) / during
- });
- }
- result.push({color: info1.color, offset: 1});
-
- return result;
- }
-
- /**
- * @param {string} color
- * @param {number=} h 0 ~ 360, ignore when null.
- * @param {number=} s 0 ~ 1, ignore when null.
- * @param {number=} l 0 ~ 1, ignore when null.
- * @return {string} Color string in rgba format.
- * @memberOf module:zrender/util/color
- */
- function modifyHSL(color, h, s, l) {
- color = parse(color);
-
- if (color) {
- color = rgba2hsla(color);
- h != null && (color[0] = clampCssAngle(h));
- s != null && (color[1] = parseCssFloat(s));
- l != null && (color[2] = parseCssFloat(l));
-
- return stringify(hsla2rgba(color), 'rgba');
- }
- }
-
- /**
- * @param {string} color
- * @param {number=} alpha 0 ~ 1
- * @return {string} Color string in rgba format.
- * @memberOf module:zrender/util/color
- */
- function modifyAlpha(color, alpha) {
- color = parse(color);
-
- if (color && alpha != null) {
- color[3] = clampCssFloat(alpha);
- return stringify(color, 'rgba');
- }
- }
-
- /**
- * @param {Array.<string>} colors Color list.
- * @param {string} type 'rgba', 'hsva', ...
- * @return {string} Result color.
- */
- function stringify(arrColor, type) {
- if (type === 'rgb' || type === 'hsv' || type === 'hsl') {
- arrColor = arrColor.slice(0, 3);
- }
- return type + '(' + arrColor.join(',') + ')';
- }
-
- module.exports = {
- parse: parse,
- lift: lift,
- toHex: toHex,
- fastMapToColor: fastMapToColor,
- mapToColor: mapToColor,
- mapIntervalToColor: mapIntervalToColor,
- modifyHSL: modifyHSL,
- modifyAlpha: modifyAlpha,
- stringify: stringify
- };
-
-
-
-
-/***/ },
-/* 39 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- var config = __webpack_require__(40);
-
- /**
- * @exports zrender/tool/log
- * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
- */
- module.exports = function() {
- if (config.debugMode === 0) {
- return;
- }
- else if (config.debugMode == 1) {
- for (var k in arguments) {
- throw new Error(arguments[k]);
- }
- }
- else if (config.debugMode > 1) {
- for (var k in arguments) {
- console.log(arguments[k]);
- }
- }
- };
-
- /* for debug
- return function(mes) {
- document.getElementById('wrong-message').innerHTML =
- mes + ' ' + (new Date() - 0)
- + '<br/>'
- + document.getElementById('wrong-message').innerHTML;
- };
- */
-
-
-
-/***/ },
-/* 40 */
-/***/ function(module, exports) {
-
-
- var dpr = 1;
- // If in browser environment
- if (typeof window !== 'undefined') {
- dpr = Math.max(window.devicePixelRatio || 1, 1);
- }
- /**
- * config默认配置项
- * @exports zrender/config
- * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
- */
- var config = {
- /**
- * debug日志选项:catchBrushException为true下有效
- * 0 : 不生成debug数据,发布用
- * 1 : 异常抛出,调试用
- * 2 : 控制台输出,调试用
- */
- debugMode: 0,
-
- // retina 屏幕优化
- devicePixelRatio: dpr
- };
- module.exports = config;
-
-
-
-
-/***/ },
-/* 41 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var Group = __webpack_require__(29);
- var componentUtil = __webpack_require__(20);
- var clazzUtil = __webpack_require__(9);
-
- function Chart() {
-
- /**
- * @type {module:zrender/container/Group}
- * @readOnly
- */
- this.group = new Group();
-
- /**
- * @type {string}
- * @readOnly
- */
- this.uid = componentUtil.getUID('viewChart');
- }
-
- Chart.prototype = {
-
- type: 'chart',
-
- /**
- * Init the chart
- * @param {module:echarts/model/Global} ecModel
- * @param {module:echarts/ExtensionAPI} api
- */
- init: function (ecModel, api) {},
-
- /**
- * Render the chart
- * @param {module:echarts/model/Series} seriesModel
- * @param {module:echarts/model/Global} ecModel
- * @param {module:echarts/ExtensionAPI} api
- * @param {Object} payload
- */
- render: function (seriesModel, ecModel, api, payload) {},
-
- /**
- * Highlight series or specified data item
- * @param {module:echarts/model/Series} seriesModel
- * @param {module:echarts/model/Global} ecModel
- * @param {module:echarts/ExtensionAPI} api
- * @param {Object} payload
- */
- highlight: function (seriesModel, ecModel, api, payload) {
- toggleHighlight(seriesModel.getData(), payload, 'emphasis');
- },
-
- /**
- * Downplay series or specified data item
- * @param {module:echarts/model/Series} seriesModel
- * @param {module:echarts/model/Global} ecModel
- * @param {module:echarts/ExtensionAPI} api
- * @param {Object} payload
- */
- downplay: function (seriesModel, ecModel, api, payload) {
- toggleHighlight(seriesModel.getData(), payload, 'normal');
- },
-
- /**
- * Remove self
- * @param {module:echarts/model/Global} ecModel
- * @param {module:echarts/ExtensionAPI} api
- */
- remove: function (ecModel, api) {
- this.group.removeAll();
- },
-
- /**
- * Dispose self
- * @param {module:echarts/model/Global} ecModel
- * @param {module:echarts/ExtensionAPI} api
- */
- dispose: function () {}
- };
-
- var chartProto = Chart.prototype;
- chartProto.updateView
- = chartProto.updateLayout
- = chartProto.updateVisual
- = function (seriesModel, ecModel, api, payload) {
- this.render(seriesModel, ecModel, api, payload);
- };
-
- /**
- * Set state of single element
- * @param {module:zrender/Element} el
- * @param {string} state
- */
- function elSetState(el, state) {
- if (el) {
- el.trigger(state);
- if (el.type === 'group') {
- for (var i = 0; i < el.childCount(); i++) {
- elSetState(el.childAt(i), state);
- }
- }
- }
- }
- /**
- * @param {module:echarts/data/List} data
- * @param {Object} payload
- * @param {string} state 'normal'|'emphasis'
- * @inner
- */
- function toggleHighlight(data, payload, state) {
- if (payload.dataIndex != null) {
- var el = data.getItemGraphicEl(payload.dataIndex);
- elSetState(el, state);
- }
- else if (payload.name) {
- var dataIndex = data.indexOfName(payload.name);
- var el = data.getItemGraphicEl(dataIndex);
- elSetState(el, state);
- }
- else {
- data.eachItemGraphicEl(function (el) {
- elSetState(el, state);
- });
- }
- }
-
- // Enable Chart.extend.
- clazzUtil.enableClassExtend(Chart);
-
- // Add capability of registerClass, getClass, hasClass, registerSubTypeDefaulter and so on.
- clazzUtil.enableClassManagement(Chart, {registerWhenExtend: true});
-
- module.exports = Chart;
-
-
-/***/ },
-/* 42 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
-
- var pathTool = __webpack_require__(43);
- var round = Math.round;
- var Path = __webpack_require__(44);
- var colorTool = __webpack_require__(38);
- var matrix = __webpack_require__(17);
- var vector = __webpack_require__(16);
- var Gradient = __webpack_require__(4);
-
- var graphic = {};
-
- graphic.Group = __webpack_require__(29);
-
- graphic.Image = __webpack_require__(59);
-
- graphic.Text = __webpack_require__(62);
-
- graphic.Circle = __webpack_require__(63);
-
- graphic.Sector = __webpack_require__(64);
-
- graphic.Ring = __webpack_require__(65);
-
- graphic.Polygon = __webpack_require__(66);
-
- graphic.Polyline = __webpack_require__(70);
-
- graphic.Rect = __webpack_require__(71);
-
- graphic.Line = __webpack_require__(72);
-
- graphic.BezierCurve = __webpack_require__(73);
-
- graphic.Arc = __webpack_require__(74);
-
- graphic.LinearGradient = __webpack_require__(75);
-
- graphic.RadialGradient = __webpack_require__(76);
-
- graphic.BoundingRect = __webpack_require__(15);
-
- /**
- * Extend shape with parameters
- */
- graphic.extendShape = function (opts) {
- return Path.extend(opts);
- };
-
- /**
- * Extend path
- */
- graphic.extendPath = function (pathData, opts) {
- return pathTool.extendFromString(pathData, opts);
- };
-
- /**
- * Create a path element from path data string
- * @param {string} pathData
- * @param {Object} opts
- * @param {module:zrender/core/BoundingRect} rect
- * @param {string} [layout=cover] 'center' or 'cover'
- */
- graphic.makePath = function (pathData, opts, rect, layout) {
- var path = pathTool.createFromString(pathData, opts);
- var boundingRect = path.getBoundingRect();
- if (rect) {
- var aspect = boundingRect.width / boundingRect.height;
-
- if (layout === 'center') {
- // Set rect to center, keep width / height ratio.
- var width = rect.height * aspect;
- var height;
- if (width <= rect.width) {
- height = rect.height;
- }
- else {
- width = rect.width;
- height = width / aspect;
- }
- var cx = rect.x + rect.width / 2;
- var cy = rect.y + rect.height / 2;
-
- rect.x = cx - width / 2;
- rect.y = cy - height / 2;
- rect.width = width;
- rect.height = height;
- }
-
- this.resizePath(path, rect);
- }
- return path;
- };
-
- graphic.mergePath = pathTool.mergePath,
-
- /**
- * Resize a path to fit the rect
- * @param {module:zrender/graphic/Path} path
- * @param {Object} rect
- */
- graphic.resizePath = function (path, rect) {
- if (!path.applyTransform) {
- return;
- }
-
- var pathRect = path.getBoundingRect();
-
- var m = pathRect.calculateTransform(rect);
-
- path.applyTransform(m);
- };
-
- /**
- * Sub pixel optimize line for canvas
- *
- * @param {Object} param
- * @param {Object} [param.shape]
- * @param {number} [param.shape.x1]
- * @param {number} [param.shape.y1]
- * @param {number} [param.shape.x2]
- * @param {number} [param.shape.y2]
- * @param {Object} [param.style]
- * @param {number} [param.style.lineWidth]
- * @return {Object} Modified param
- */
- graphic.subPixelOptimizeLine = function (param) {
- var subPixelOptimize = graphic.subPixelOptimize;
- var shape = param.shape;
- var lineWidth = param.style.lineWidth;
-
- if (round(shape.x1 * 2) === round(shape.x2 * 2)) {
- shape.x1 = shape.x2 = subPixelOptimize(shape.x1, lineWidth, true);
- }
- if (round(shape.y1 * 2) === round(shape.y2 * 2)) {
- shape.y1 = shape.y2 = subPixelOptimize(shape.y1, lineWidth, true);
- }
- return param;
- };
-
- /**
- * Sub pixel optimize rect for canvas
- *
- * @param {Object} param
- * @param {Object} [param.shape]
- * @param {number} [param.shape.x]
- * @param {number} [param.shape.y]
- * @param {number} [param.shape.width]
- * @param {number} [param.shape.height]
- * @param {Object} [param.style]
- * @param {number} [param.style.lineWidth]
- * @return {Object} Modified param
- */
- graphic.subPixelOptimizeRect = function (param) {
- var subPixelOptimize = graphic.subPixelOptimize;
- var shape = param.shape;
- var lineWidth = param.style.lineWidth;
- var originX = shape.x;
- var originY = shape.y;
- var originWidth = shape.width;
- var originHeight = shape.height;
- shape.x = subPixelOptimize(shape.x, lineWidth, true);
- shape.y = subPixelOptimize(shape.y, lineWidth, true);
- shape.width = Math.max(
- subPixelOptimize(originX + originWidth, lineWidth, false) - shape.x,
- originWidth === 0 ? 0 : 1
- );
- shape.height = Math.max(
- subPixelOptimize(originY + originHeight, lineWidth, false) - shape.y,
- originHeight === 0 ? 0 : 1
- );
- return param;
- };
-
- /**
- * Sub pixel optimize for canvas
- *
- * @param {number} position Coordinate, such as x, y
- * @param {number} lineWidth Should be nonnegative integer.
- * @param {boolean=} positiveOrNegative Default false (negative).
- * @return {number} Optimized position.
- */
- graphic.subPixelOptimize = function (position, lineWidth, positiveOrNegative) {
- // Assure that (position + lineWidth / 2) is near integer edge,
- // otherwise line will be fuzzy in canvas.
- var doubledPosition = round(position * 2);
- return (doubledPosition + round(lineWidth)) % 2 === 0
- ? doubledPosition / 2
- : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;
- };
-
- /**
- * @private
- */
- function doSingleEnterHover(el) {
- if (el.__isHover) {
- return;
- }
- if (el.__hoverStlDirty) {
- var stroke = el.style.stroke;
- var fill = el.style.fill;
-
- // Create hoverStyle on mouseover
- var hoverStyle = el.__hoverStl;
- var lift = colorTool.lift;
- hoverStyle.fill = hoverStyle.fill
- || (fill && (fill instanceof Gradient ? fill : lift(fill, -0.1)));
- hoverStyle.stroke = hoverStyle.stroke
- || (stroke && (stroke instanceof Gradient ? stroke : lift(stroke, -0.1)));
-
- var normalStyle = {};
- for (var name in hoverStyle) {
- if (hoverStyle.hasOwnProperty(name)) {
- normalStyle[name] = el.style[name];
- }
- }
-
- el.__normalStl = normalStyle;
-
- el.__hoverStlDirty = false;
- }
- el.setStyle(el.__hoverStl);
- el.z2 += 1;
-
- el.__isHover = true;
- }
-
- /**
- * @inner
- */
- function doSingleLeaveHover(el) {
- if (!el.__isHover) {
- return;
- }
-
- var normalStl = el.__normalStl;
- normalStl && el.setStyle(normalStl);
- el.z2 -= 1;
-
- el.__isHover = false;
- }
-
- /**
- * @inner
- */
- function doEnterHover(el) {
- el.type === 'group'
- ? el.traverse(function (child) {
- if (child.type !== 'group') {
- doSingleEnterHover(child);
- }
- })
- : doSingleEnterHover(el);
- }
-
- function doLeaveHover(el) {
- el.type === 'group'
- ? el.traverse(function (child) {
- if (child.type !== 'group') {
- doSingleLeaveHover(child);
- }
- })
- : doSingleLeaveHover(el);
- }
-
- /**
- * @inner
- */
- function setElementHoverStl(el, hoverStl) {
- // If element has sepcified hoverStyle, then use it instead of given hoverStyle
- // Often used when item group has a label element and it's hoverStyle is different
- el.__hoverStl = el.hoverStyle || hoverStl || {};
- el.__hoverStlDirty = true;
- }
-
- /**
- * @inner
- */
- function onElementMouseOver() {
- // Only if element is not in emphasis status
- !this.__isEmphasis && doEnterHover(this);
- }
-
- /**
- * @inner
- */
- function onElementMouseOut() {
- // Only if element is not in emphasis status
- !this.__isEmphasis && doLeaveHover(this);
- }
-
- /**
- * @inner
- */
- function enterEmphasis() {
- this.__isEmphasis = true;
- doEnterHover(this);
- }
-
- /**
- * @inner
- */
- function leaveEmphasis() {
- this.__isEmphasis = false;
- doLeaveHover(this);
- }
-
- /**
- * Set hover style of element
- * @param {module:zrender/Element} el
- * @param {Object} [hoverStyle]
- */
- graphic.setHoverStyle = function (el, hoverStyle) {
- el.type === 'group'
- ? el.traverse(function (child) {
- if (child.type !== 'group') {
- setElementHoverStl(child, hoverStyle);
- }
- })
- : setElementHoverStl(el, hoverStyle);
- // Remove previous bound handlers
- el.on('mouseover', onElementMouseOver)
- .on('mouseout', onElementMouseOut);
-
- // Emphasis, normal can be triggered manually
- el.on('emphasis', enterEmphasis)
- .on('normal', leaveEmphasis);
- };
-
- /**
- * Set text option in the style
- * @param {Object} textStyle
- * @param {module:echarts/model/Model} labelModel
- * @param {string} color
- */
- graphic.setText = function (textStyle, labelModel, color) {
- var labelPosition = labelModel.getShallow('position') || 'inside';
- var labelColor = labelPosition.indexOf('inside') >= 0 ? 'white' : color;
- var textStyleModel = labelModel.getModel('textStyle');
- zrUtil.extend(textStyle, {
- textDistance: labelModel.getShallow('distance') || 5,
- textFont: textStyleModel.getFont(),
- textPosition: labelPosition,
- textFill: textStyleModel.getTextColor() || labelColor
- });
- };
-
- function animateOrSetProps(isUpdate, el, props, animatableModel, cb) {
- var postfix = isUpdate ? 'Update' : '';
- var duration = animatableModel
- && animatableModel.getShallow('animationDuration' + postfix);
- var animationEasing = animatableModel
- && animatableModel.getShallow('animationEasing' + postfix);
-
- animatableModel && animatableModel.getShallow('animation')
- ? el.animateTo(props, duration, animationEasing, cb)
- : (el.attr(props), cb && cb());
- }
- /**
- * Update graphic element properties with or without animation according to the configuration in series
- * @param {module:zrender/Element} el
- * @param {Object} props
- * @param {module:echarts/model/Model} [animatableModel]
- * @param {Function} cb
- */
- graphic.updateProps = zrUtil.curry(animateOrSetProps, true);
-
- /**
- * Init graphic element properties with or without animation according to the configuration in series
- * @param {module:zrender/Element} el
- * @param {Object} props
- * @param {module:echarts/model/Model} [animatableModel]
- * @param {Function} cb
- */
- graphic.initProps = zrUtil.curry(animateOrSetProps, false);
-
- /**
- * Get transform matrix of target (param target),
- * in coordinate of its ancestor (param ancestor)
- *
- * @param {module:zrender/mixin/Transformable} target
- * @param {module:zrender/mixin/Transformable} ancestor
- */
- graphic.getTransform = function (target, ancestor) {
- var mat = matrix.identity([]);
-
- while (target && target !== ancestor) {
- matrix.mul(mat, target.getLocalTransform(), mat);
- target = target.parent;
- }
-
- return mat;
- };
-
- /**
- * Apply transform to an vertex.
- * @param {Array.<number>} vertex [x, y]
- * @param {Array.<number>} transform Transform matrix: like [1, 0, 0, 1, 0, 0]
- * @param {boolean=} invert Whether use invert matrix.
- * @return {Array.<number>} [x, y]
- */
- graphic.applyTransform = function (vertex, transform, invert) {
- if (invert) {
- transform = matrix.invert([], transform);
- }
- return vector.applyTransform([], vertex, transform);
- };
-
- /**
- * @param {string} direction 'left' 'right' 'top' 'bottom'
- * @param {Array.<number>} transform Transform matrix: like [1, 0, 0, 1, 0, 0]
- * @param {boolean=} invert Whether use invert matrix.
- * @return {string} Transformed direction. 'left' 'right' 'top' 'bottom'
- */
- graphic.transformDirection = function (direction, transform, invert) {
-
- // Pick a base, ensure that transform result will not be (0, 0).
- var hBase = (transform[4] === 0 || transform[5] === 0 || transform[0] === 0)
- ? 1 : Math.abs(2 * transform[4] / transform[0]);
- var vBase = (transform[4] === 0 || transform[5] === 0 || transform[2] === 0)
- ? 1 : Math.abs(2 * transform[4] / transform[2]);
-
- var vertex = [
- direction === 'left' ? -hBase : direction === 'right' ? hBase : 0,
- direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0
- ];
-
- vertex = graphic.applyTransform(vertex, transform, invert);
-
- return Math.abs(vertex[0]) > Math.abs(vertex[1])
- ? (vertex[0] > 0 ? 'right' : 'left')
- : (vertex[1] > 0 ? 'bottom' : 'top');
- };
-
- module.exports = graphic;
-
-
-/***/ },
-/* 43 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var Path = __webpack_require__(44);
- var PathProxy = __webpack_require__(48);
- var transformPath = __webpack_require__(58);
- var matrix = __webpack_require__(17);
-
- // command chars
- var cc = [
- 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z',
- 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A'
- ];
-
- var mathSqrt = Math.sqrt;
- var mathSin = Math.sin;
- var mathCos = Math.cos;
- var PI = Math.PI;
-
- var vMag = function(v) {
- return Math.sqrt(v[0] * v[0] + v[1] * v[1]);
- };
- var vRatio = function(u, v) {
- return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));
- };
- var vAngle = function(u, v) {
- return (u[0] * v[1] < u[1] * v[0] ? -1 : 1)
- * Math.acos(vRatio(u, v));
- };
-
- function processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {
- var psi = psiDeg * (PI / 180.0);
- var xp = mathCos(psi) * (x1 - x2) / 2.0
- + mathSin(psi) * (y1 - y2) / 2.0;
- var yp = -1 * mathSin(psi) * (x1 - x2) / 2.0
- + mathCos(psi) * (y1 - y2) / 2.0;
-
- var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);
-
- if (lambda > 1) {
- rx *= mathSqrt(lambda);
- ry *= mathSqrt(lambda);
- }
-
- var f = (fa === fs ? -1 : 1)
- * mathSqrt((((rx * rx) * (ry * ry))
- - ((rx * rx) * (yp * yp))
- - ((ry * ry) * (xp * xp))) / ((rx * rx) * (yp * yp)
- + (ry * ry) * (xp * xp))
- ) || 0;
-
- var cxp = f * rx * yp / ry;
- var cyp = f * -ry * xp / rx;
-
- var cx = (x1 + x2) / 2.0
- + mathCos(psi) * cxp
- - mathSin(psi) * cyp;
- var cy = (y1 + y2) / 2.0
- + mathSin(psi) * cxp
- + mathCos(psi) * cyp;
-
- var theta = vAngle([ 1, 0 ], [ (xp - cxp) / rx, (yp - cyp) / ry ]);
- var u = [ (xp - cxp) / rx, (yp - cyp) / ry ];
- var v = [ (-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry ];
- var dTheta = vAngle(u, v);
-
- if (vRatio(u, v) <= -1) {
- dTheta = PI;
- }
- if (vRatio(u, v) >= 1) {
- dTheta = 0;
- }
- if (fs === 0 && dTheta > 0) {
- dTheta = dTheta - 2 * PI;
- }
- if (fs === 1 && dTheta < 0) {
- dTheta = dTheta + 2 * PI;
- }
-
- path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);
- }
-
- function createPathProxyFromString(data) {
- if (!data) {
- return [];
- }
-
- // command string
- var cs = data.replace(/-/g, ' -')
- .replace(/ /g, ' ')
- .replace(/ /g, ',')
- .replace(/,,/g, ',');
-
- var n;
- // create pipes so that we can split the data
- for (n = 0; n < cc.length; n++) {
- cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);
- }
-
- // create array
- var arr = cs.split('|');
- // init context point
- var cpx = 0;
- var cpy = 0;
-
- var path = new PathProxy();
- var CMD = PathProxy.CMD;
-
- var prevCmd;
- for (n = 1; n < arr.length; n++) {
- var str = arr[n];
- var c = str.charAt(0);
- var off = 0;
- var p = str.slice(1).replace(/e,-/g, 'e-').split(',');
- var cmd;
-
- if (p.length > 0 && p[0] === '') {
- p.shift();
- }
-
- for (var i = 0; i < p.length; i++) {
- p[i] = parseFloat(p[i]);
- }
- while (off < p.length && !isNaN(p[off])) {
- if (isNaN(p[0])) {
- break;
- }
- var ctlPtx;
- var ctlPty;
-
- var rx;
- var ry;
- var psi;
- var fa;
- var fs;
-
- var x1 = cpx;
- var y1 = cpy;
-
- // convert l, H, h, V, and v to L
- switch (c) {
- case 'l':
- cpx += p[off++];
- cpy += p[off++];
- cmd = CMD.L;
- path.addData(cmd, cpx, cpy);
- break;
- case 'L':
- cpx = p[off++];
- cpy = p[off++];
- cmd = CMD.L;
- path.addData(cmd, cpx, cpy);
- break;
- case 'm':
- cpx += p[off++];
- cpy += p[off++];
- cmd = CMD.M;
- path.addData(cmd, cpx, cpy);
- c = 'l';
- break;
- case 'M':
- cpx = p[off++];
- cpy = p[off++];
- cmd = CMD.M;
- path.addData(cmd, cpx, cpy);
- c = 'L';
- break;
- case 'h':
- cpx += p[off++];
- cmd = CMD.L;
- path.addData(cmd, cpx, cpy);
- break;
- case 'H':
- cpx = p[off++];
- cmd = CMD.L;
- path.addData(cmd, cpx, cpy);
- break;
- case 'v':
- cpy += p[off++];
- cmd = CMD.L;
- path.addData(cmd, cpx, cpy);
- break;
- case 'V':
- cpy = p[off++];
- cmd = CMD.L;
- path.addData(cmd, cpx, cpy);
- break;
- case 'C':
- cmd = CMD.C;
- path.addData(
- cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]
- );
- cpx = p[off - 2];
- cpy = p[off - 1];
- break;
- case 'c':
- cmd = CMD.C;
- path.addData(
- cmd,
- p[off++] + cpx, p[off++] + cpy,
- p[off++] + cpx, p[off++] + cpy,
- p[off++] + cpx, p[off++] + cpy
- );
- cpx += p[off - 2];
- cpy += p[off - 1];
- break;
- case 'S':
- ctlPtx = cpx;
- ctlPty = cpy;
- var len = path.len();
- var pathData = path.data;
- if (prevCmd === CMD.C) {
- ctlPtx += cpx - pathData[len - 4];
- ctlPty += cpy - pathData[len - 3];
- }
- cmd = CMD.C;
- x1 = p[off++];
- y1 = p[off++];
- cpx = p[off++];
- cpy = p[off++];
- path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);
- break;
- case 's':
- ctlPtx = cpx;
- ctlPty = cpy;
- var len = path.len();
- var pathData = path.data;
- if (prevCmd === CMD.C) {
- ctlPtx += cpx - pathData[len - 4];
- ctlPty += cpy - pathData[len - 3];
- }
- cmd = CMD.C;
- x1 = cpx + p[off++];
- y1 = cpy + p[off++];
- cpx += p[off++];
- cpy += p[off++];
- path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);
- break;
- case 'Q':
- x1 = p[off++];
- y1 = p[off++];
- cpx = p[off++];
- cpy = p[off++];
- cmd = CMD.Q;
- path.addData(cmd, x1, y1, cpx, cpy);
- break;
- case 'q':
- x1 = p[off++] + cpx;
- y1 = p[off++] + cpy;
- cpx += p[off++];
- cpy += p[off++];
- cmd = CMD.Q;
- path.addData(cmd, x1, y1, cpx, cpy);
- break;
- case 'T':
- ctlPtx = cpx;
- ctlPty = cpy;
- var len = path.len();
- var pathData = path.data;
- if (prevCmd === CMD.Q) {
- ctlPtx += cpx - pathData[len - 4];
- ctlPty += cpy - pathData[len - 3];
- }
- cpx = p[off++];
- cpy = p[off++];
- cmd = CMD.Q;
- path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);
- break;
- case 't':
- ctlPtx = cpx;
- ctlPty = cpy;
- var len = path.len();
- var pathData = path.data;
- if (prevCmd === CMD.Q) {
- ctlPtx += cpx - pathData[len - 4];
- ctlPty += cpy - pathData[len - 3];
- }
- cpx += p[off++];
- cpy += p[off++];
- cmd = CMD.Q;
- path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);
- break;
- case 'A':
- rx = p[off++];
- ry = p[off++];
- psi = p[off++];
- fa = p[off++];
- fs = p[off++];
-
- x1 = cpx, y1 = cpy;
- cpx = p[off++];
- cpy = p[off++];
- cmd = CMD.A;
- processArc(
- x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path
- );
- break;
- case 'a':
- rx = p[off++];
- ry = p[off++];
- psi = p[off++];
- fa = p[off++];
- fs = p[off++];
-
- x1 = cpx, y1 = cpy;
- cpx += p[off++];
- cpy += p[off++];
- cmd = CMD.A;
- processArc(
- x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path
- );
- break;
- }
- }
-
- if (c === 'z' || c === 'Z') {
- cmd = CMD.Z;
- path.addData(cmd);
- }
-
- prevCmd = cmd;
- }
-
- path.toStatic();
-
- return path;
- }
-
- // TODO Optimize double memory cost problem
- function createPathOptions(str, opts) {
- var pathProxy = createPathProxyFromString(str);
- var transform;
- opts = opts || {};
- opts.buildPath = function (path) {
- path.setData(pathProxy.data);
- transform && transformPath(path, transform);
- // Svg and vml renderer don't have context
- var ctx = path.getContext();
- if (ctx) {
- path.rebuildPath(ctx);
- }
- };
-
- opts.applyTransform = function (m) {
- if (!transform) {
- transform = matrix.create();
- }
- matrix.mul(transform, m, transform);
- };
-
- return opts;
- }
-
- module.exports = {
- /**
- * Create a Path object from path string data
- * http://www.w3.org/TR/SVG/paths.html#PathData
- * @param {Object} opts Other options
- */
- createFromString: function (str, opts) {
- return new Path(createPathOptions(str, opts));
- },
-
- /**
- * Create a Path class from path string data
- * @param {string} str
- * @param {Object} opts Other options
- */
- extendFromString: function (str, opts) {
- return Path.extend(createPathOptions(str, opts));
- },
-
- /**
- * Merge multiple paths
- */
- // TODO Apply transform
- // TODO stroke dash
- // TODO Optimize double memory cost problem
- mergePath: function (pathEls, opts) {
- var pathList = [];
- var len = pathEls.length;
- var pathEl;
- var i;
- for (i = 0; i < len; i++) {
- pathEl = pathEls[i];
- if (pathEl.__dirty) {
- pathEl.buildPath(pathEl.path, pathEl.shape);
- }
- pathList.push(pathEl.path);
- }
-
- var pathBundle = new Path(opts);
- pathBundle.buildPath = function (path) {
- path.appendPath(pathList);
- // Svg and vml renderer don't have context
- var ctx = path.getContext();
- if (ctx) {
- path.rebuildPath(ctx);
- }
- };
-
- return pathBundle;
- }
- };
-
-
-/***/ },
-/* 44 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Path element
- * @module zrender/graphic/Path
- */
-
-
-
- var Displayable = __webpack_require__(45);
- var zrUtil = __webpack_require__(3);
- var PathProxy = __webpack_require__(48);
- var pathContain = __webpack_require__(51);
-
- var Gradient = __webpack_require__(4);
-
- function pathHasFill(style) {
- var fill = style.fill;
- return fill != null && fill !== 'none';
- }
-
- function pathHasStroke(style) {
- var stroke = style.stroke;
- return stroke != null && stroke !== 'none' && style.lineWidth > 0;
- }
-
- var abs = Math.abs;
-
- /**
- * @alias module:zrender/graphic/Path
- * @extends module:zrender/graphic/Displayable
- * @constructor
- * @param {Object} opts
- */
- function Path(opts) {
- Displayable.call(this, opts);
-
- /**
- * @type {module:zrender/core/PathProxy}
- * @readOnly
- */
- this.path = new PathProxy();
- }
-
- Path.prototype = {
-
- constructor: Path,
-
- type: 'path',
-
- __dirtyPath: true,
-
- strokeContainThreshold: 5,
-
- brush: function (ctx) {
- ctx.save();
-
- var style = this.style;
- var path = this.path;
- var hasStroke = pathHasStroke(style);
- var hasFill = pathHasFill(style);
-
- if (this.__dirtyPath) {
- // Update gradient because bounding rect may changed
- if (hasFill && (style.fill instanceof Gradient)) {
- style.fill.updateCanvasGradient(this, ctx);
- }
- if (hasStroke && (style.stroke instanceof Gradient)) {
- style.stroke.updateCanvasGradient(this, ctx);
- }
- }
-
- style.bind(ctx, this);
- this.setTransform(ctx);
-
- var lineDash = style.lineDash;
- var lineDashOffset = style.lineDashOffset;
-
- var ctxLineDash = !!ctx.setLineDash;
-
- // Proxy context
- // Rebuild path in following 2 cases
- // 1. Path is dirty
- // 2. Path needs javascript implemented lineDash stroking.
- // In this case, lineDash information will not be saved in PathProxy
- if (this.__dirtyPath || (
- lineDash && !ctxLineDash && hasStroke
- )) {
- path = this.path.beginPath(ctx);
-
- // Setting line dash before build path
- if (lineDash && !ctxLineDash) {
- path.setLineDash(lineDash);
- path.setLineDashOffset(lineDashOffset);
- }
-
- this.buildPath(path, this.shape);
-
- // Clear path dirty flag
- this.__dirtyPath = false;
- }
- else {
- // Replay path building
- ctx.beginPath();
- this.path.rebuildPath(ctx);
- }
-
- hasFill && path.fill(ctx);
-
- if (lineDash && ctxLineDash) {
- ctx.setLineDash(lineDash);
- ctx.lineDashOffset = lineDashOffset;
- }
-
- hasStroke && path.stroke(ctx);
-
- // Draw rect text
- if (style.text != null) {
- // var rect = this.getBoundingRect();
- this.drawRectText(ctx, this.getBoundingRect());
- }
-
- ctx.restore();
- },
-
- buildPath: function (ctx, shapeCfg) {},
-
- getBoundingRect: function () {
- var rect = this._rect;
- var style = this.style;
- var needsUpdateRect = !rect;
- if (needsUpdateRect) {
- var path = this.path;
- if (this.__dirtyPath) {
- path.beginPath();
- this.buildPath(path, this.shape);
- }
- rect = path.getBoundingRect();
- }
- this._rect = rect;
-
- if (pathHasStroke(style)) {
- // Needs update rect with stroke lineWidth when
- // 1. Element changes scale or lineWidth
- // 2. Shape is changed
- var rectWithStroke = this._rectWithStroke;
- if (this.__dirty || needsUpdateRect) {
- var rectWithStroke = this._rectWithStroke
- || (this._rectWithStroke = rect.clone());
- rectWithStroke.copy(rect);
- // FIXME Must after updateTransform
- var w = style.lineWidth;
- // PENDING, Min line width is needed when line is horizontal or vertical
- var lineScale = style.strokeNoScale ? this.getLineScale() : 1;
-
- // Only add extra hover lineWidth when there are no fill
- if (!pathHasFill(style)) {
- w = Math.max(w, this.strokeContainThreshold);
- }
- // Consider line width
- // Line scale can't be 0;
- if (lineScale > 1e-10) {
- rectWithStroke.width += w / lineScale;
- rectWithStroke.height += w / lineScale;
- rectWithStroke.x -= w / lineScale / 2;
- rectWithStroke.y -= w / lineScale / 2;
- }
- }
-
- // Return rect with stroke
- return rectWithStroke;
- }
-
- return rect;
- },
-
- contain: function (x, y) {
- var localPos = this.transformCoordToLocal(x, y);
- var rect = this.getBoundingRect();
- var style = this.style;
- x = localPos[0];
- y = localPos[1];
-
- if (rect.contain(x, y)) {
- var pathData = this.path.data;
- if (pathHasStroke(style)) {
- var lineWidth = style.lineWidth;
- var lineScale = style.strokeNoScale ? this.getLineScale() : 1;
- // Line scale can't be 0;
- if (lineScale > 1e-10) {
- // Only add extra hover lineWidth when there are no fill
- if (!pathHasFill(style)) {
- lineWidth = Math.max(lineWidth, this.strokeContainThreshold);
- }
- if (pathContain.containStroke(
- pathData, lineWidth / lineScale, x, y
- )) {
- return true;
- }
- }
- }
- if (pathHasFill(style)) {
- return pathContain.contain(pathData, x, y);
- }
- }
- return false;
- },
-
- /**
- * @param {boolean} dirtyPath
- */
- dirty: function (dirtyPath) {
- if (arguments.length ===0) {
- dirtyPath = true;
- }
- // Only mark dirty, not mark clean
- if (dirtyPath) {
- this.__dirtyPath = dirtyPath;
- this._rect = null;
- }
-
- this.__dirty = true;
-
- this.__zr && this.__zr.refresh();
-
- // Used as a clipping path
- if (this.__clipTarget) {
- this.__clipTarget.dirty();
- }
- },
-
- /**
- * Alias for animate('shape')
- * @param {boolean} loop
- */
- animateShape: function (loop) {
- return this.animate('shape', loop);
- },
-
- // Overwrite attrKV
- attrKV: function (key, value) {
- // FIXME
- if (key === 'shape') {
- this.setShape(value);
- }
- else {
- Displayable.prototype.attrKV.call(this, key, value);
- }
- },
-
- /**
- * @param {Object|string} key
- * @param {*} value
- */
- setShape: function (key, value) {
- var shape = this.shape;
- // Path from string may not have shape
- if (shape) {
- if (zrUtil.isObject(key)) {
- for (var name in key) {
- shape[name] = key[name];
- }
- }
- else {
- shape[key] = value;
- }
- this.dirty(true);
- }
- return this;
- },
-
- getLineScale: function () {
- var m = this.transform;
- // Get the line scale.
- // Determinant of `m` means how much the area is enlarged by the
- // transformation. So its square root can be used as a scale factor
- // for width.
- return m && abs(m[0] - 1) > 1e-10 && abs(m[3] - 1) > 1e-10
- ? Math.sqrt(abs(m[0] * m[3] - m[2] * m[1]))
- : 1;
- }
- };
-
- /**
- * 扩展一个 Path element, 比如星形,圆等。
- * Extend a path element
- * @param {Object} props
- * @param {string} props.type Path type
- * @param {Function} props.init Initialize
- * @param {Function} props.buildPath Overwrite buildPath method
- * @param {Object} [props.style] Extended default style config
- * @param {Object} [props.shape] Extended default shape config
- */
- Path.extend = function (defaults) {
- var Sub = function (opts) {
- Path.call(this, opts);
-
- if (defaults.style) {
- // Extend default style
- this.style.extendFrom(defaults.style, false);
- }
-
- // Extend default shape
- var defaultShape = defaults.shape;
- if (defaultShape) {
- this.shape = this.shape || {};
- var thisShape = this.shape;
- for (var name in defaultShape) {
- if (
- ! thisShape.hasOwnProperty(name)
- && defaultShape.hasOwnProperty(name)
- ) {
- thisShape[name] = defaultShape[name];
- }
- }
- }
-
- defaults.init && defaults.init.call(this, opts);
- };
-
- zrUtil.inherits(Sub, Path);
-
- // FIXME 不能 extend position, rotation 等引用对象
- for (var name in defaults) {
- // Extending prototype values and methods
- if (name !== 'style' && name !== 'shape') {
- Sub.prototype[name] = defaults[name];
- }
- }
-
- return Sub;
- };
-
- zrUtil.inherits(Path, Displayable);
-
- module.exports = Path;
-
-
-/***/ },
-/* 45 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * 可绘制的图形基类
- * Base class of all displayable graphic objects
- * @module zrender/graphic/Displayable
- */
-
-
-
- var zrUtil = __webpack_require__(3);
-
- var Style = __webpack_require__(46);
-
- var Element = __webpack_require__(30);
- var RectText = __webpack_require__(47);
- // var Stateful = require('./mixin/Stateful');
-
- /**
- * @alias module:zrender/graphic/Displayable
- * @extends module:zrender/Element
- * @extends module:zrender/graphic/mixin/RectText
- */
- function Displayable(opts) {
-
- opts = opts || {};
-
- Element.call(this, opts);
-
- // Extend properties
- for (var name in opts) {
- if (
- opts.hasOwnProperty(name) &&
- name !== 'style'
- ) {
- this[name] = opts[name];
- }
- }
-
- /**
- * @type {module:zrender/graphic/Style}
- */
- this.style = new Style(opts.style);
-
- this._rect = null;
- // Shapes for cascade clipping.
- this.__clipPaths = [];
-
- // FIXME Stateful must be mixined after style is setted
- // Stateful.call(this, opts);
- }
-
- Displayable.prototype = {
-
- constructor: Displayable,
-
- type: 'displayable',
-
- /**
- * Displayable 是否为脏,Painter 中会根据该标记判断是否需要是否需要重新绘制
- * Dirty flag. From which painter will determine if this displayable object needs brush
- * @name module:zrender/graphic/Displayable#__dirty
- * @type {boolean}
- */
- __dirty: true,
-
- /**
- * 图形是否可见,为true时不绘制图形,但是仍能触发鼠标事件
- * If ignore drawing of the displayable object. Mouse event will still be triggered
- * @name module:/zrender/graphic/Displayable#invisible
- * @type {boolean}
- * @default false
- */
- invisible: false,
-
- /**
- * @name module:/zrender/graphic/Displayable#z
- * @type {number}
- * @default 0
- */
- z: 0,
-
- /**
- * @name module:/zrender/graphic/Displayable#z
- * @type {number}
- * @default 0
- */
- z2: 0,
-
- /**
- * z层level,决定绘画在哪层canvas中
- * @name module:/zrender/graphic/Displayable#zlevel
- * @type {number}
- * @default 0
- */
- zlevel: 0,
-
- /**
- * 是否可拖拽
- * @name module:/zrender/graphic/Displayable#draggable
- * @type {boolean}
- * @default false
- */
- draggable: false,
-
- /**
- * 是否正在拖拽
- * @name module:/zrender/graphic/Displayable#draggable
- * @type {boolean}
- * @default false
- */
- dragging: false,
-
- /**
- * 是否相应鼠标事件
- * @name module:/zrender/graphic/Displayable#silent
- * @type {boolean}
- * @default false
- */
- silent: false,
-
- /**
- * If enable culling
- * @type {boolean}
- * @default false
- */
- culling: false,
-
- /**
- * Mouse cursor when hovered
- * @name module:/zrender/graphic/Displayable#cursor
- * @type {string}
- */
- cursor: 'pointer',
-
- /**
- * If hover area is bounding rect
- * @name module:/zrender/graphic/Displayable#rectHover
- * @type {string}
- */
- rectHover: false,
-
- beforeBrush: function (ctx) {},
-
- afterBrush: function (ctx) {},
-
- /**
- * 图形绘制方法
- * @param {Canvas2DRenderingContext} ctx
- */
- // Interface
- brush: function (ctx) {},
-
- /**
- * 获取最小包围盒
- * @return {module:zrender/core/BoundingRect}
- */
- // Interface
- getBoundingRect: function () {},
-
- /**
- * 判断坐标 x, y 是否在图形上
- * If displayable element contain coord x, y
- * @param {number} x
- * @param {number} y
- * @return {boolean}
- */
- contain: function (x, y) {
- return this.rectContain(x, y);
- },
-
- /**
- * @param {Function} cb
- * @param {} context
- */
- traverse: function (cb, context) {
- cb.call(context, this);
- },
-
- /**
- * 判断坐标 x, y 是否在图形的包围盒上
- * If bounding rect of element contain coord x, y
- * @param {number} x
- * @param {number} y
- * @return {boolean}
- */
- rectContain: function (x, y) {
- var coord = this.transformCoordToLocal(x, y);
- var rect = this.getBoundingRect();
- return rect.contain(coord[0], coord[1]);
- },
-
- /**
- * 标记图形元素为脏,并且在下一帧重绘
- * Mark displayable element dirty and refresh next frame
- */
- dirty: function () {
- this.__dirty = true;
-
- this._rect = null;
-
- this.__zr && this.__zr.refresh();
- },
-
- /**
- * 图形是否会触发事件
- * If displayable object binded any event
- * @return {boolean}
- */
- // TODO, 通过 bind 绑定的事件
- // isSilent: function () {
- // return !(
- // this.hoverable || this.draggable
- // || this.onmousemove || this.onmouseover || this.onmouseout
- // || this.onmousedown || this.onmouseup || this.onclick
- // || this.ondragenter || this.ondragover || this.ondragleave
- // || this.ondrop
- // );
- // },
- /**
- * Alias for animate('style')
- * @param {boolean} loop
- */
- animateStyle: function (loop) {
- return this.animate('style', loop);
- },
-
- attrKV: function (key, value) {
- if (key !== 'style') {
- Element.prototype.attrKV.call(this, key, value);
- }
- else {
- this.style.set(value);
- }
- },
-
- /**
- * @param {Object|string} key
- * @param {*} value
- */
- setStyle: function (key, value) {
- this.style.set(key, value);
- this.dirty(false);
- return this;
- }
- };
-
- zrUtil.inherits(Displayable, Element);
-
- zrUtil.mixin(Displayable, RectText);
- // zrUtil.mixin(Displayable, Stateful);
-
- module.exports = Displayable;
-
-
-/***/ },
-/* 46 */
-/***/ function(module, exports) {
-
- /**
- * @module zrender/graphic/Style
- */
-
-
-
- var STYLE_LIST_COMMON = [
- 'lineCap', 'lineJoin', 'miterLimit',
- 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY', 'shadowColor'
- ];
-
- var Style = function (opts) {
- this.extendFrom(opts);
- };
-
- Style.prototype = {
-
- constructor: Style,
-
- /**
- * @type {string}
- */
- fill: '#000000',
-
- /**
- * @type {string}
- */
- stroke: null,
-
- /**
- * @type {number}
- */
- opacity: 1,
-
- /**
- * @type {Array.<number>}
- */
- lineDash: null,
-
- /**
- * @type {number}
- */
- lineDashOffset: 0,
-
- /**
- * @type {number}
- */
- shadowBlur: 0,
-
- /**
- * @type {number}
- */
- shadowOffsetX: 0,
-
- /**
- * @type {number}
- */
- shadowOffsetY: 0,
-
- /**
- * @type {number}
- */
- lineWidth: 1,
-
- /**
- * If stroke ignore scale
- * @type {Boolean}
- */
- strokeNoScale: false,
-
- // Bounding rect text configuration
- // Not affected by element transform
- /**
- * @type {string}
- */
- text: null,
-
- /**
- * @type {string}
- */
- textFill: '#000',
-
- /**
- * @type {string}
- */
- textStroke: null,
-
- /**
- * 'inside', 'left', 'right', 'top', 'bottom'
- * [x, y]
- * @type {string|Array.<number>}
- * @default 'inside'
- */
- textPosition: 'inside',
-
- /**
- * @type {string}
- */
- textBaseline: null,
-
- /**
- * @type {string}
- */
- textAlign: null,
-
- /**
- * @type {string}
- */
- textVerticalAlign: null,
-
- /**
- * @type {number}
- */
- textDistance: 5,
-
- /**
- * @type {number}
- */
- textShadowBlur: 0,
-
- /**
- * @type {number}
- */
- textShadowOffsetX: 0,
-
- /**
- * @type {number}
- */
- textShadowOffsetY: 0,
-
- /**
- * @param {CanvasRenderingContext2D} ctx
- */
- bind: function (ctx, el) {
- var fill = this.fill;
- var stroke = this.stroke;
- for (var i = 0; i < STYLE_LIST_COMMON.length; i++) {
- var styleName = STYLE_LIST_COMMON[i];
-
- if (this[styleName] != null) {
- ctx[styleName] = this[styleName];
- }
- }
- if (stroke != null) {
- var lineWidth = this.lineWidth;
- ctx.lineWidth = lineWidth / (
- (this.strokeNoScale && el && el.getLineScale) ? el.getLineScale() : 1
- );
- }
- if (fill != null) {
- // Use canvas gradient if has
- ctx.fillStyle = fill.canvasGradient ? fill.canvasGradient : fill;
- }
- if (stroke != null) {
- // Use canvas gradient if has
- ctx.strokeStyle = stroke.canvasGradient ? stroke.canvasGradient : stroke;
- }
- this.opacity != null && (ctx.globalAlpha = this.opacity);
- },
-
- /**
- * Extend from other style
- * @param {zrender/graphic/Style} otherStyle
- * @param {boolean} overwrite
- */
- extendFrom: function (otherStyle, overwrite) {
- if (otherStyle) {
- var target = this;
- for (var name in otherStyle) {
- if (otherStyle.hasOwnProperty(name)
- && (overwrite || ! target.hasOwnProperty(name))
- ) {
- target[name] = otherStyle[name];
- }
- }
- }
- },
-
- /**
- * Batch setting style with a given object
- * @param {Object|string} obj
- * @param {*} [obj]
- */
- set: function (obj, value) {
- if (typeof obj === 'string') {
- this[obj] = value;
- }
- else {
- this.extendFrom(obj, true);
- }
- },
-
- /**
- * Clone
- * @return {zrender/graphic/Style} [description]
- */
- clone: function () {
- var newStyle = new this.constructor();
- newStyle.extendFrom(this, true);
- return newStyle;
- }
- };
-
- var styleProto = Style.prototype;
- var name;
- var i;
- for (i = 0; i < STYLE_LIST_COMMON.length; i++) {
- name = STYLE_LIST_COMMON[i];
- if (!(name in styleProto)) {
- styleProto[name] = null;
- }
- }
-
- module.exports = Style;
-
-
-/***/ },
-/* 47 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Mixin for drawing text in a element bounding rect
- * @module zrender/mixin/RectText
- */
-
-
-
- var textContain = __webpack_require__(14);
- var BoundingRect = __webpack_require__(15);
-
- var tmpRect = new BoundingRect();
-
- var RectText = function () {};
-
- function parsePercent(value, maxValue) {
- if (typeof value === 'string') {
- if (value.lastIndexOf('%') >= 0) {
- return parseFloat(value) / 100 * maxValue;
- }
- return parseFloat(value);
- }
- return value;
- }
-
- function setTransform(ctx, m) {
- ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
- }
-
- RectText.prototype = {
-
- constructor: RectText,
-
- /**
- * Draw text in a rect with specified position.
- * @param {CanvasRenderingContext} ctx
- * @param {Object} rect Displayable rect
- * @return {Object} textRect Alternative precalculated text bounding rect
- */
- drawRectText: function (ctx, rect, textRect) {
- var style = this.style;
- var text = style.text;
- // Convert to string
- text != null && (text += '');
- if (!text) {
- return;
- }
- var x;
- var y;
- var textPosition = style.textPosition;
- var distance = style.textDistance;
- var align = style.textAlign;
- var font = style.textFont || style.font;
- var baseline = style.textBaseline;
- var verticalAlign = style.textVerticalAlign;
-
- textRect = textRect || textContain.getBoundingRect(text, font, align, baseline);
-
- // Transform rect to view space
- var transform = this.transform;
- var invTransform = this.invTransform;
- if (transform) {
- tmpRect.copy(rect);
- tmpRect.applyTransform(transform);
- rect = tmpRect;
- // Transform back
- setTransform(ctx, invTransform);
- }
-
- // Text position represented by coord
- if (textPosition instanceof Array) {
- // Percent
- x = rect.x + parsePercent(textPosition[0], rect.width);
- y = rect.y + parsePercent(textPosition[1], rect.height);
- align = align || 'left';
- baseline = baseline || 'top';
- }
- else {
- var res = textContain.adjustTextPositionOnRect(
- textPosition, rect, textRect, distance
- );
- x = res.x;
- y = res.y;
- // Default align and baseline when has textPosition
- align = align || res.textAlign;
- baseline = baseline || res.textBaseline;
- }
-
- ctx.textAlign = align;
- if (verticalAlign) {
- switch (verticalAlign) {
- case 'middle':
- y -= textRect.height / 2;
- break;
- case 'bottom':
- y -= textRect.height;
- break;
- // 'top'
- }
- // Ignore baseline
- ctx.textBaseline = 'top';
- }
- else {
- ctx.textBaseline = baseline;
- }
-
- var textFill = style.textFill;
- var textStroke = style.textStroke;
- textFill && (ctx.fillStyle = textFill);
- textStroke && (ctx.strokeStyle = textStroke);
- ctx.font = font;
-
- // Text shadow
- ctx.shadowColor = style.textShadowColor;
- ctx.shadowBlur = style.textShadowBlur;
- ctx.shadowOffsetX = style.textShadowOffsetX;
- ctx.shadowOffsetY = style.textShadowOffsetY;
-
- var textLines = text.split('\n');
- for (var i = 0; i < textLines.length; i++) {
- textFill && ctx.fillText(textLines[i], x, y);
- textStroke && ctx.strokeText(textLines[i], x, y);
- y += textRect.lineHeight;
- }
-
- // Transform again
- transform && setTransform(ctx, transform);
- }
- };
-
- module.exports = RectText;
-
-
-/***/ },
-/* 48 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * Path 代理,可以在`buildPath`中用于替代`ctx`, 会保存每个path操作的命令到pathCommands属性中
- * 可以用于 isInsidePath 判断以及获取boundingRect
- *
- * @module zrender/core/PathProxy
- * @author Yi Shen (http://www.github.com/pissang)
- */
-
- // TODO getTotalLength, getPointAtLength
-
-
- var curve = __webpack_require__(49);
- var vec2 = __webpack_require__(16);
- var bbox = __webpack_require__(50);
- var BoundingRect = __webpack_require__(15);
-
- var CMD = {
- M: 1,
- L: 2,
- C: 3,
- Q: 4,
- A: 5,
- Z: 6,
- // Rect
- R: 7
- };
-
- var min = [];
- var max = [];
- var min2 = [];
- var max2 = [];
- var mathMin = Math.min;
- var mathMax = Math.max;
- var mathCos = Math.cos;
- var mathSin = Math.sin;
- var mathSqrt = Math.sqrt;
-
- var hasTypedArray = typeof Float32Array != 'undefined';
-
- /**
- * @alias module:zrender/core/PathProxy
- * @constructor
- */
- var PathProxy = function () {
-
- /**
- * Path data. Stored as flat array
- * @type {Array.<Object>}
- */
- this.data = [];
-
- this._len = 0;
-
- this._ctx = null;
-
- this._xi = 0;
- this._yi = 0;
-
- this._x0 = 0;
- this._y0 = 0;
- };
-
- /**
- * 快速计算Path包围盒(并不是最小包围盒)
- * @return {Object}
- */
- PathProxy.prototype = {
-
- constructor: PathProxy,
-
- _lineDash: null,
-
- _dashOffset: 0,
-
- _dashIdx: 0,
-
- _dashSum: 0,
-
- getContext: function () {
- return this._ctx;
- },
-
- /**
- * @param {CanvasRenderingContext2D} ctx
- * @return {module:zrender/core/PathProxy}
- */
- beginPath: function (ctx) {
- this._ctx = ctx;
-
- ctx && ctx.beginPath();
-
- // Reset
- this._len = 0;
-
- if (this._lineDash) {
- this._lineDash = null;
-
- this._dashOffset = 0;
- }
-
- return this;
- },
-
- /**
- * @param {number} x
- * @param {number} y
- * @return {module:zrender/core/PathProxy}
- */
- moveTo: function (x, y) {
- this.addData(CMD.M, x, y);
- this._ctx && this._ctx.moveTo(x, y);
-
- // x0, y0, xi, yi 是记录在 _dashedXXXXTo 方法中使用
- // xi, yi 记录当前点, x0, y0 在 closePath 的时候回到起始点。
- // 有可能在 beginPath 之后直接调用 lineTo,这时候 x0, y0 需要
- // 在 lineTo 方法中记录,这里先不考虑这种情况,dashed line 也只在 IE10- 中不支持
- this._x0 = x;
- this._y0 = y;
-
- this._xi = x;
- this._yi = y;
-
- return this;
- },
-
- /**
- * @param {number} x
- * @param {number} y
- * @return {module:zrender/core/PathProxy}
- */
- lineTo: function (x, y) {
- this.addData(CMD.L, x, y);
- if (this._ctx) {
- this._needsDash() ? this._dashedLineTo(x, y)
- : this._ctx.lineTo(x, y);
- }
- this._xi = x;
- this._yi = y;
- return this;
- },
-
- /**
- * @param {number} x1
- * @param {number} y1
- * @param {number} x2
- * @param {number} y2
- * @param {number} x3
- * @param {number} y3
- * @return {module:zrender/core/PathProxy}
- */
- bezierCurveTo: function (x1, y1, x2, y2, x3, y3) {
- this.addData(CMD.C, x1, y1, x2, y2, x3, y3);
- if (this._ctx) {
- this._needsDash() ? this._dashedBezierTo(x1, y1, x2, y2, x3, y3)
- : this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);
- }
- this._xi = x3;
- this._yi = y3;
- return this;
- },
-
- /**
- * @param {number} x1
- * @param {number} y1
- * @param {number} x2
- * @param {number} y2
- * @return {module:zrender/core/PathProxy}
- */
- quadraticCurveTo: function (x1, y1, x2, y2) {
- this.addData(CMD.Q, x1, y1, x2, y2);
- if (this._ctx) {
- this._needsDash() ? this._dashedQuadraticTo(x1, y1, x2, y2)
- : this._ctx.quadraticCurveTo(x1, y1, x2, y2);
- }
- this._xi = x2;
- this._yi = y2;
- return this;
- },
-
- /**
- * @param {number} cx
- * @param {number} cy
- * @param {number} r
- * @param {number} startAngle
- * @param {number} endAngle
- * @param {boolean} anticlockwise
- * @return {module:zrender/core/PathProxy}
- */
- arc: function (cx, cy, r, startAngle, endAngle, anticlockwise) {
- this.addData(
- CMD.A, cx, cy, r, r, startAngle, endAngle - startAngle, 0, anticlockwise ? 0 : 1
- );
- this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);
-
- this._xi = mathCos(endAngle) * r + cx;
- this._xi = mathSin(endAngle) * r + cx;
- return this;
- },
-
- // TODO
- arcTo: function (x1, y1, x2, y2, radius) {
- if (this._ctx) {
- this._ctx.arcTo(x1, y1, x2, y2, radius);
- }
- return this;
- },
-
- // TODO
- rect: function (x, y, w, h) {
- this._ctx && this._ctx.rect(x, y, w, h);
- this.addData(CMD.R, x, y, w, h);
- return this;
- },
-
- /**
- * @return {module:zrender/core/PathProxy}
- */
- closePath: function () {
- this.addData(CMD.Z);
-
- var ctx = this._ctx;
- var x0 = this._x0;
- var y0 = this._y0;
- if (ctx) {
- this._needsDash() && this._dashedLineTo(x0, y0);
- ctx.closePath();
- }
-
- this._xi = x0;
- this._yi = y0;
- return this;
- },
-
- /**
- * Context 从外部传入,因为有可能是 rebuildPath 完之后再 fill。
- * stroke 同样
- * @param {CanvasRenderingContext2D} ctx
- * @return {module:zrender/core/PathProxy}
- */
- fill: function (ctx) {
- ctx && ctx.fill();
- this.toStatic();
- },
-
- /**
- * @param {CanvasRenderingContext2D} ctx
- * @return {module:zrender/core/PathProxy}
- */
- stroke: function (ctx) {
- ctx && ctx.stroke();
- this.toStatic();
- },
-
- /**
- * 必须在其它绘制命令前调用
- * Must be invoked before all other path drawing methods
- * @return {module:zrender/core/PathProxy}
- */
- setLineDash: function (lineDash) {
- if (lineDash instanceof Array) {
- this._lineDash = lineDash;
-
- this._dashIdx = 0;
-
- var lineDashSum = 0;
- for (var i = 0; i < lineDash.length; i++) {
- lineDashSum += lineDash[i];
- }
- this._dashSum = lineDashSum;
- }
- return this;
- },
-
- /**
- * 必须在其它绘制命令前调用
- * Must be invoked before all other path drawing methods
- * @return {module:zrender/core/PathProxy}
- */
- setLineDashOffset: function (offset) {
- this._dashOffset = offset;
- return this;
- },
-
- /**
- *
- * @return {boolean}
- */
- len: function () {
- return this._len;
- },
-
- /**
- * 直接设置 Path 数据
- */
- setData: function (data) {
-
- var len = data.length;
-
- if (! (this.data && this.data.length == len) && hasTypedArray) {
- this.data = new Float32Array(len);
- }
-
- for (var i = 0; i < len; i++) {
- this.data[i] = data[i];
- }
-
- this._len = len;
- },
-
- /**
- * 添加子路径
- * @param {module:zrender/core/PathProxy|Array.<module:zrender/core/PathProxy>} path
- */
- appendPath: function (path) {
- if (!(path instanceof Array)) {
- path = [path];
- }
- var len = path.length;
- var appendSize = 0;
- var offset = this._len;
- for (var i = 0; i < len; i++) {
- appendSize += path[i].len();
- }
- if (hasTypedArray && (this.data instanceof Float32Array)) {
- this.data = new Float32Array(offset + appendSize);
- }
- for (var i = 0; i < len; i++) {
- var appendPathData = path[i].data;
- for (var k = 0; k < appendPathData.length; k++) {
- this.data[offset++] = appendPathData[k];
- }
- }
- this._len = offset;
- },
-
- /**
- * 填充 Path 数据。
- * 尽量复用而不申明新的数组。大部分图形重绘的指令数据长度都是不变的。
- */
- addData: function (cmd) {
- var data = this.data;
- if (this._len + arguments.length > data.length) {
- // 因为之前的数组已经转换成静态的 Float32Array
- // 所以不够用时需要扩展一个新的动态数组
- this._expandData();
- data = this.data;
- }
- for (var i = 0; i < arguments.length; i++) {
- data[this._len++] = arguments[i];
- }
-
- this._prevCmd = cmd;
- },
-
- _expandData: function () {
- // Only if data is Float32Array
- if (!(this.data instanceof Array)) {
- var newData = [];
- for (var i = 0; i < this._len; i++) {
- newData[i] = this.data[i];
- }
- this.data = newData;
- }
- },
-
- /**
- * If needs js implemented dashed line
- * @return {boolean}
- * @private
- */
- _needsDash: function () {
- return this._lineDash;
- },
-
- _dashedLineTo: function (x1, y1) {
- var dashSum = this._dashSum;
- var offset = this._dashOffset;
- var lineDash = this._lineDash;
- var ctx = this._ctx;
-
- var x0 = this._xi;
- var y0 = this._yi;
- var dx = x1 - x0;
- var dy = y1 - y0;
- var dist = mathSqrt(dx * dx + dy * dy);
- var x = x0;
- var y = y0;
- var dash;
- var nDash = lineDash.length;
- var idx;
- dx /= dist;
- dy /= dist;
-
- if (offset < 0) {
- // Convert to positive offset
- offset = dashSum + offset;
- }
- offset %= dashSum;
- x -= offset * dx;
- y -= offset * dy;
-
- while ((dx >= 0 && x <= x1) || (dx < 0 && x > x1)) {
- idx = this._dashIdx;
- dash = lineDash[idx];
- x += dx * dash;
- y += dy * dash;
- this._dashIdx = (idx + 1) % nDash;
- // Skip positive offset
- if ((dx > 0 && x < x0) || (dx < 0 && x > x0)) {
- continue;
- }
- ctx[idx % 2 ? 'moveTo' : 'lineTo'](
- dx >= 0 ? mathMin(x, x1) : mathMax(x, x1),
- dy >= 0 ? mathMin(y, y1) : mathMax(y, y1)
- );
- }
- // Offset for next lineTo
- dx = x - x1;
- dy = y - y1;
- this._dashOffset = -mathSqrt(dx * dx + dy * dy);
- },
-
- // Not accurate dashed line to
- _dashedBezierTo: function (x1, y1, x2, y2, x3, y3) {
- var dashSum = this._dashSum;
- var offset = this._dashOffset;
- var lineDash = this._lineDash;
- var ctx = this._ctx;
-
- var x0 = this._xi;
- var y0 = this._yi;
- var t;
- var dx;
- var dy;
- var cubicAt = curve.cubicAt;
- var bezierLen = 0;
- var idx = this._dashIdx;
- var nDash = lineDash.length;
-
- var x;
- var y;
-
- var tmpLen = 0;
-
- if (offset < 0) {
- // Convert to positive offset
- offset = dashSum + offset;
- }
- offset %= dashSum;
- // Bezier approx length
- for (t = 0; t < 1; t += 0.1) {
- dx = cubicAt(x0, x1, x2, x3, t + 0.1)
- - cubicAt(x0, x1, x2, x3, t);
- dy = cubicAt(y0, y1, y2, y3, t + 0.1)
- - cubicAt(y0, y1, y2, y3, t);
- bezierLen += mathSqrt(dx * dx + dy * dy);
- }
-
- // Find idx after add offset
- for (; idx < nDash; idx++) {
- tmpLen += lineDash[idx];
- if (tmpLen > offset) {
- break;
- }
- }
- t = (tmpLen - offset) / bezierLen;
-
- while (t <= 1) {
-
- x = cubicAt(x0, x1, x2, x3, t);
- y = cubicAt(y0, y1, y2, y3, t);
-
- // Use line to approximate dashed bezier
- // Bad result if dash is long
- idx % 2 ? ctx.moveTo(x, y)
- : ctx.lineTo(x, y);
-
- t += lineDash[idx] / bezierLen;
-
- idx = (idx + 1) % nDash;
- }
-
- // Finish the last segment and calculate the new offset
- (idx % 2 !== 0) && ctx.lineTo(x3, y3);
- dx = x3 - x;
- dy = y3 - y;
- this._dashOffset = -mathSqrt(dx * dx + dy * dy);
- },
-
- _dashedQuadraticTo: function (x1, y1, x2, y2) {
- // Convert quadratic to cubic using degree elevation
- var x3 = x2;
- var y3 = y2;
- x2 = (x2 + 2 * x1) / 3;
- y2 = (y2 + 2 * y1) / 3;
- x1 = (this._xi + 2 * x1) / 3;
- y1 = (this._yi + 2 * y1) / 3;
-
- this._dashedBezierTo(x1, y1, x2, y2, x3, y3);
- },
-
- /**
- * 转成静态的 Float32Array 减少堆内存占用
- * Convert dynamic array to static Float32Array
- */
- toStatic: function () {
- var data = this.data;
- if (data instanceof Array) {
- data.length = this._len;
- if (hasTypedArray) {
- this.data = new Float32Array(data);
- }
- }
- },
-
- /**
- * @return {module:zrender/core/BoundingRect}
- */
- getBoundingRect: function () {
- min[0] = min[1] = min2[0] = min2[1] = Number.MAX_VALUE;
- max[0] = max[1] = max2[0] = max2[1] = -Number.MAX_VALUE;
-
- var data = this.data;
- var xi = 0;
- var yi = 0;
- var x0 = 0;
- var y0 = 0;
-
- for (var i = 0; i < data.length;) {
- var cmd = data[i++];
-
- if (i == 1) {
- // 如果第一个命令是 L, C, Q
- // 则 previous point 同绘制命令的第一个 point
- //
- // 第一个命令为 Arc 的情况下会在后面特殊处理
- xi = data[i];
- yi = data[i + 1];
-
- x0 = xi;
- y0 = yi;
- }
-
- switch (cmd) {
- case CMD.M:
- // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点
- // 在 closePath 的时候使用
- x0 = data[i++];
- y0 = data[i++];
- xi = x0;
- yi = y0;
- min2[0] = x0;
- min2[1] = y0;
- max2[0] = x0;
- max2[1] = y0;
- break;
- case CMD.L:
- bbox.fromLine(xi, yi, data[i], data[i + 1], min2, max2);
- xi = data[i++];
- yi = data[i++];
- break;
- case CMD.C:
- bbox.fromCubic(
- xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1],
- min2, max2
- );
- xi = data[i++];
- yi = data[i++];
- break;
- case CMD.Q:
- bbox.fromQuadratic(
- xi, yi, data[i++], data[i++], data[i], data[i + 1],
- min2, max2
- );
- xi = data[i++];
- yi = data[i++];
- break;
- case CMD.A:
- // TODO Arc 判断的开销比较大
- var cx = data[i++];
- var cy = data[i++];
- var rx = data[i++];
- var ry = data[i++];
- var startAngle = data[i++];
- var endAngle = data[i++] + startAngle;
- // TODO Arc 旋转
- var psi = data[i++];
- var anticlockwise = 1 - data[i++];
-
- if (i == 1) {
- // 直接使用 arc 命令
- // 第一个命令起点还未定义
- x0 = mathCos(startAngle) * rx + cx;
- y0 = mathSin(startAngle) * ry + cy;
- }
-
- bbox.fromArc(
- cx, cy, rx, ry, startAngle, endAngle,
- anticlockwise, min2, max2
- );
-
- xi = mathCos(endAngle) * rx + cx;
- yi = mathSin(endAngle) * ry + cy;
- break;
- case CMD.R:
- x0 = xi = data[i++];
- y0 = yi = data[i++];
- var width = data[i++];
- var height = data[i++];
- // Use fromLine
- bbox.fromLine(x0, y0, x0 + width, y0 + height, min2, max2);
- break;
- case CMD.Z:
- xi = x0;
- yi = y0;
- break;
- }
-
- // Union
- vec2.min(min, min, min2);
- vec2.max(max, max, max2);
- }
-
- // No data
- if (i === 0) {
- min[0] = min[1] = max[0] = max[1] = 0;
- }
-
- return new BoundingRect(
- min[0], min[1], max[0] - min[0], max[1] - min[1]
- );
- },
-
- /**
- * Rebuild path from current data
- * Rebuild path will not consider javascript implemented line dash.
- * @param {CanvasRenderingContext} ctx
- */
- rebuildPath: function (ctx) {
- var d = this.data;
- for (var i = 0; i < this._len;) {
- var cmd = d[i++];
- switch (cmd) {
- case CMD.M:
- ctx.moveTo(d[i++], d[i++]);
- break;
- case CMD.L:
- ctx.lineTo(d[i++], d[i++]);
- break;
- case CMD.C:
- ctx.bezierCurveTo(
- d[i++], d[i++], d[i++], d[i++], d[i++], d[i++]
- );
- break;
- case CMD.Q:
- ctx.quadraticCurveTo(d[i++], d[i++], d[i++], d[i++]);
- break;
- case CMD.A:
- var cx = d[i++];
- var cy = d[i++];
- var rx = d[i++];
- var ry = d[i++];
- var theta = d[i++];
- var dTheta = d[i++];
- var psi = d[i++];
- var fs = d[i++];
- var r = (rx > ry) ? rx : ry;
- var scaleX = (rx > ry) ? 1 : rx / ry;
- var scaleY = (rx > ry) ? ry / rx : 1;
- var isEllipse = Math.abs(rx - ry) > 1e-3;
- if (isEllipse) {
- ctx.translate(cx, cy);
- ctx.rotate(psi);
- ctx.scale(scaleX, scaleY);
- ctx.arc(0, 0, r, theta, theta + dTheta, 1 - fs);
- ctx.scale(1 / scaleX, 1 / scaleY);
- ctx.rotate(-psi);
- ctx.translate(-cx, -cy);
- }
- else {
- ctx.arc(cx, cy, r, theta, theta + dTheta, 1 - fs);
- }
- break;
- case CMD.R:
- ctx.rect(d[i++], d[i++], d[i++], d[i++]);
- break;
- case CMD.Z:
- ctx.closePath();
- }
- }
- }
- };
-
- PathProxy.CMD = CMD;
-
- module.exports = PathProxy;
-
-
-/***/ },
-/* 49 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * 曲线辅助模块
- * @module zrender/core/curve
- * @author pissang(https://www.github.com/pissang)
- */
-
-
- var vec2 = __webpack_require__(16);
- var v2Create = vec2.create;
- var v2DistSquare = vec2.distSquare;
- var mathPow = Math.pow;
- var mathSqrt = Math.sqrt;
-
- var EPSILON = 1e-8;
- var EPSILON_NUMERIC = 1e-4;
-
- var THREE_SQRT = mathSqrt(3);
- var ONE_THIRD = 1 / 3;
-
- // 临时变量
- var _v0 = v2Create();
- var _v1 = v2Create();
- var _v2 = v2Create();
- // var _v3 = vec2.create();
-
- function isAroundZero(val) {
- return val > -EPSILON && val < EPSILON;
- }
- function isNotAroundZero(val) {
- return val > EPSILON || val < -EPSILON;
- }
- /**
- * 计算三次贝塞尔值
- * @memberOf module:zrender/core/curve
- * @param {number} p0
- * @param {number} p1
- * @param {number} p2
- * @param {number} p3
- * @param {number} t
- * @return {number}
- */
- function cubicAt(p0, p1, p2, p3, t) {
- var onet = 1 - t;
- return onet * onet * (onet * p0 + 3 * t * p1)
- + t * t * (t * p3 + 3 * onet * p2);
- }
-
- /**
- * 计算三次贝塞尔导数值
- * @memberOf module:zrender/core/curve
- * @param {number} p0
- * @param {number} p1
- * @param {number} p2
- * @param {number} p3
- * @param {number} t
- * @return {number}
- */
- function cubicDerivativeAt(p0, p1, p2, p3, t) {
- var onet = 1 - t;
- return 3 * (
- ((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet
- + (p3 - p2) * t * t
- );
- }
-
- /**
- * 计算三次贝塞尔方程根,使用盛金公式
- * @memberOf module:zrender/core/curve
- * @param {number} p0
- * @param {number} p1
- * @param {number} p2
- * @param {number} p3
- * @param {number} val
- * @param {Array.<number>} roots
- * @return {number} 有效根数目
- */
- function cubicRootAt(p0, p1, p2, p3, val, roots) {
- // Evaluate roots of cubic functions
- var a = p3 + 3 * (p1 - p2) - p0;
- var b = 3 * (p2 - p1 * 2 + p0);
- var c = 3 * (p1 - p0);
- var d = p0 - val;
-
- var A = b * b - 3 * a * c;
- var B = b * c - 9 * a * d;
- var C = c * c - 3 * b * d;
-
- var n = 0;
-
- if (isAroundZero(A) && isAroundZero(B)) {
- if (isAroundZero(b)) {
- roots[0] = 0;
- }
- else {
- var t1 = -c / b; //t1, t2, t3, b is not zero
- if (t1 >= 0 && t1 <= 1) {
- roots[n++] = t1;
- }
- }
- }
- else {
- var disc = B * B - 4 * A * C;
-
- if (isAroundZero(disc)) {
- var K = B / A;
- var t1 = -b / a + K; // t1, a is not zero
- var t2 = -K / 2; // t2, t3
- if (t1 >= 0 && t1 <= 1) {
- roots[n++] = t1;
- }
- if (t2 >= 0 && t2 <= 1) {
- roots[n++] = t2;
- }
- }
- else if (disc > 0) {
- var discSqrt = mathSqrt(disc);
- var Y1 = A * b + 1.5 * a * (-B + discSqrt);
- var Y2 = A * b + 1.5 * a * (-B - discSqrt);
- if (Y1 < 0) {
- Y1 = -mathPow(-Y1, ONE_THIRD);
- }
- else {
- Y1 = mathPow(Y1, ONE_THIRD);
- }
- if (Y2 < 0) {
- Y2 = -mathPow(-Y2, ONE_THIRD);
- }
- else {
- Y2 = mathPow(Y2, ONE_THIRD);
- }
- var t1 = (-b - (Y1 + Y2)) / (3 * a);
- if (t1 >= 0 && t1 <= 1) {
- roots[n++] = t1;
- }
- }
- else {
- var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A));
- var theta = Math.acos(T) / 3;
- var ASqrt = mathSqrt(A);
- var tmp = Math.cos(theta);
-
- var t1 = (-b - 2 * ASqrt * tmp) / (3 * a);
- var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a);
- var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a);
- if (t1 >= 0 && t1 <= 1) {
- roots[n++] = t1;
- }
- if (t2 >= 0 && t2 <= 1) {
- roots[n++] = t2;
- }
- if (t3 >= 0 && t3 <= 1) {
- roots[n++] = t3;
- }
- }
- }
- return n;
- }
-
- /**
- * 计算三次贝塞尔方程极限值的位置
- * @memberOf module:zrender/core/curve
- * @param {number} p0
- * @param {number} p1
- * @param {number} p2
- * @param {number} p3
- * @param {Array.<number>} extrema
- * @return {number} 有效数目
- */
- function cubicExtrema(p0, p1, p2, p3, extrema) {
- var b = 6 * p2 - 12 * p1 + 6 * p0;
- var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;
- var c = 3 * p1 - 3 * p0;
-
- var n = 0;
- if (isAroundZero(a)) {
- if (isNotAroundZero(b)) {
- var t1 = -c / b;
- if (t1 >= 0 && t1 <=1) {
- extrema[n++] = t1;
- }
- }
- }
- else {
- var disc = b * b - 4 * a * c;
- if (isAroundZero(disc)) {
- extrema[0] = -b / (2 * a);
- }
- else if (disc > 0) {
- var discSqrt = mathSqrt(disc);
- var t1 = (-b + discSqrt) / (2 * a);
- var t2 = (-b - discSqrt) / (2 * a);
- if (t1 >= 0 && t1 <= 1) {
- extrema[n++] = t1;
- }
- if (t2 >= 0 && t2 <= 1) {
- extrema[n++] = t2;
- }
- }
- }
- return n;
- }
-
- /**
- * 细分三次贝塞尔曲线
- * @memberOf module:zrender/core/curve
- * @param {number} p0
- * @param {number} p1
- * @param {number} p2
- * @param {number} p3
- * @param {number} t
- * @param {Array.<number>} out
- */
- function cubicSubdivide(p0, p1, p2, p3, t, out) {
- var p01 = (p1 - p0) * t + p0;
- var p12 = (p2 - p1) * t + p1;
- var p23 = (p3 - p2) * t + p2;
-
- var p012 = (p12 - p01) * t + p01;
- var p123 = (p23 - p12) * t + p12;
-
- var p0123 = (p123 - p012) * t + p012;
- // Seg0
- out[0] = p0;
- out[1] = p01;
- out[2] = p012;
- out[3] = p0123;
- // Seg1
- out[4] = p0123;
- out[5] = p123;
- out[6] = p23;
- out[7] = p3;
- }
-
- /**
- * 投射点到三次贝塞尔曲线上,返回投射距离。
- * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。
- * @param {number} x0
- * @param {number} y0
- * @param {number} x1
- * @param {number} y1
- * @param {number} x2
- * @param {number} y2
- * @param {number} x3
- * @param {number} y3
- * @param {number} x
- * @param {number} y
- * @param {Array.<number>} [out] 投射点
- * @return {number}
- */
- function cubicProjectPoint(
- x0, y0, x1, y1, x2, y2, x3, y3,
- x, y, out
- ) {
- // http://pomax.github.io/bezierinfo/#projections
- var t;
- var interval = 0.005;
- var d = Infinity;
- var prev;
- var next;
- var d1;
- var d2;
-
- _v0[0] = x;
- _v0[1] = y;
-
- // 先粗略估计一下可能的最小距离的 t 值
- // PENDING
- for (var _t = 0; _t < 1; _t += 0.05) {
- _v1[0] = cubicAt(x0, x1, x2, x3, _t);
- _v1[1] = cubicAt(y0, y1, y2, y3, _t);
- d1 = v2DistSquare(_v0, _v1);
- if (d1 < d) {
- t = _t;
- d = d1;
- }
- }
- d = Infinity;
-
- // At most 32 iteration
- for (var i = 0; i < 32; i++) {
- if (interval < EPSILON_NUMERIC) {
- break;
- }
- prev = t - interval;
- next = t + interval;
- // t - interval
- _v1[0] = cubicAt(x0, x1, x2, x3, prev);
- _v1[1] = cubicAt(y0, y1, y2, y3, prev);
-
- d1 = v2DistSquare(_v1, _v0);
-
- if (prev >= 0 && d1 < d) {
- t = prev;
- d = d1;
- }
- else {
- // t + interval
- _v2[0] = cubicAt(x0, x1, x2, x3, next);
- _v2[1] = cubicAt(y0, y1, y2, y3, next);
- d2 = v2DistSquare(_v2, _v0);
-
- if (next <= 1 && d2 < d) {
- t = next;
- d = d2;
- }
- else {
- interval *= 0.5;
- }
- }
- }
- // t
- if (out) {
- out[0] = cubicAt(x0, x1, x2, x3, t);
- out[1] = cubicAt(y0, y1, y2, y3, t);
- }
- // console.log(interval, i);
- return mathSqrt(d);
- }
-
- /**
- * 计算二次方贝塞尔值
- * @param {number} p0
- * @param {number} p1
- * @param {number} p2
- * @param {number} t
- * @return {number}
- */
- function quadraticAt(p0, p1, p2, t) {
- var onet = 1 - t;
- return onet * (onet * p0 + 2 * t * p1) + t * t * p2;
- }
-
- /**
- * 计算二次方贝塞尔导数值
- * @param {number} p0
- * @param {number} p1
- * @param {number} p2
- * @param {number} t
- * @return {number}
- */
- function quadraticDerivativeAt(p0, p1, p2, t) {
- return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));
- }
-
- /**
- * 计算二次方贝塞尔方程根
- * @param {number} p0
- * @param {number} p1
- * @param {number} p2
- * @param {number} t
- * @param {Array.<number>} roots
- * @return {number} 有效根数目
- */
- function quadraticRootAt(p0, p1, p2, val, roots) {
- var a = p0 - 2 * p1 + p2;
- var b = 2 * (p1 - p0);
- var c = p0 - val;
-
- var n = 0;
- if (isAroundZero(a)) {
- if (isNotAroundZero(b)) {
- var t1 = -c / b;
- if (t1 >= 0 && t1 <= 1) {
- roots[n++] = t1;
- }
- }
- }
- else {
- var disc = b * b - 4 * a * c;
- if (isAroundZero(disc)) {
- var t1 = -b / (2 * a);
- if (t1 >= 0 && t1 <= 1) {
- roots[n++] = t1;
- }
- }
- else if (disc > 0) {
- var discSqrt = mathSqrt(disc);
- var t1 = (-b + discSqrt) / (2 * a);
- var t2 = (-b - discSqrt) / (2 * a);
- if (t1 >= 0 && t1 <= 1) {
- roots[n++] = t1;
- }
- if (t2 >= 0 && t2 <= 1) {
- roots[n++] = t2;
- }
- }
- }
- return n;
- }
-
- /**
- * 计算二次贝塞尔方程极限值
- * @memberOf module:zrender/core/curve
- * @param {number} p0
- * @param {number} p1
- * @param {number} p2
- * @return {number}
- */
- function quadraticExtremum(p0, p1, p2) {
- var divider = p0 + p2 - 2 * p1;
- if (divider === 0) {
- // p1 is center of p0 and p2
- return 0.5;
- }
- else {
- return (p0 - p1) / divider;
- }
- }
-
- /**
- * 细分二次贝塞尔曲线
- * @memberOf module:zrender/core/curve
- * @param {number} p0
- * @param {number} p1
- * @param {number} p2
- * @param {number} t
- * @param {Array.<number>} out
- */
- function quadraticSubdivide(p0, p1, p2, t, out) {
- var p01 = (p1 - p0) * t + p0;
- var p12 = (p2 - p1) * t + p1;
- var p012 = (p12 - p01) * t + p01;
-
- // Seg0
- out[0] = p0;
- out[1] = p01;
- out[2] = p012;
-
- // Seg1
- out[3] = p012;
- out[4] = p12;
- out[5] = p2;
- }
-
- /**
- * 投射点到二次贝塞尔曲线上,返回投射距离。
- * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。
- * @param {number} x0
- * @param {number} y0
- * @param {number} x1
- * @param {number} y1
- * @param {number} x2
- * @param {number} y2
- * @param {number} x
- * @param {number} y
- * @param {Array.<number>} out 投射点
- * @return {number}
- */
- function quadraticProjectPoint(
- x0, y0, x1, y1, x2, y2,
- x, y, out
- ) {
- // http://pomax.github.io/bezierinfo/#projections
- var t;
- var interval = 0.005;
- var d = Infinity;
-
- _v0[0] = x;
- _v0[1] = y;
-
- // 先粗略估计一下可能的最小距离的 t 值
- // PENDING
- for (var _t = 0; _t < 1; _t += 0.05) {
- _v1[0] = quadraticAt(x0, x1, x2, _t);
- _v1[1] = quadraticAt(y0, y1, y2, _t);
- var d1 = v2DistSquare(_v0, _v1);
- if (d1 < d) {
- t = _t;
- d = d1;
- }
- }
- d = Infinity;
-
- // At most 32 iteration
- for (var i = 0; i < 32; i++) {
- if (interval < EPSILON_NUMERIC) {
- break;
- }
- var prev = t - interval;
- var next = t + interval;
- // t - interval
- _v1[0] = quadraticAt(x0, x1, x2, prev);
- _v1[1] = quadraticAt(y0, y1, y2, prev);
-
- var d1 = v2DistSquare(_v1, _v0);
-
- if (prev >= 0 && d1 < d) {
- t = prev;
- d = d1;
- }
- else {
- // t + interval
- _v2[0] = quadraticAt(x0, x1, x2, next);
- _v2[1] = quadraticAt(y0, y1, y2, next);
- var d2 = v2DistSquare(_v2, _v0);
- if (next <= 1 && d2 < d) {
- t = next;
- d = d2;
- }
- else {
- interval *= 0.5;
- }
- }
- }
- // t
- if (out) {
- out[0] = quadraticAt(x0, x1, x2, t);
- out[1] = quadraticAt(y0, y1, y2, t);
- }
- // console.log(interval, i);
- return mathSqrt(d);
- }
-
- module.exports = {
-
- cubicAt: cubicAt,
-
- cubicDerivativeAt: cubicDerivativeAt,
-
- cubicRootAt: cubicRootAt,
-
- cubicExtrema: cubicExtrema,
-
- cubicSubdivide: cubicSubdivide,
-
- cubicProjectPoint: cubicProjectPoint,
-
- quadraticAt: quadraticAt,
-
- quadraticDerivativeAt: quadraticDerivativeAt,
-
- quadraticRootAt: quadraticRootAt,
-
- quadraticExtremum: quadraticExtremum,
-
- quadraticSubdivide: quadraticSubdivide,
-
- quadraticProjectPoint: quadraticProjectPoint
- };
-
-
-/***/ },
-/* 50 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @author Yi Shen(https://github.com/pissang)
- */
-
-
- var vec2 = __webpack_require__(16);
- var curve = __webpack_require__(49);
-
- var bbox = {};
- var mathMin = Math.min;
- var mathMax = Math.max;
- var mathSin = Math.sin;
- var mathCos = Math.cos;
-
- var start = vec2.create();
- var end = vec2.create();
- var extremity = vec2.create();
-
- var PI2 = Math.PI * 2;
- /**
- * 从顶点数组中计算出最小包围盒,写入`min`和`max`中
- * @module zrender/core/bbox
- * @param {Array<Object>} points 顶点数组
- * @param {number} min
- * @param {number} max
- */
- bbox.fromPoints = function(points, min, max) {
- if (points.length === 0) {
- return;
- }
- var p = points[0];
- var left = p[0];
- var right = p[0];
- var top = p[1];
- var bottom = p[1];
- var i;
-
- for (i = 1; i < points.length; i++) {
- p = points[i];
- left = mathMin(left, p[0]);
- right = mathMax(right, p[0]);
- top = mathMin(top, p[1]);
- bottom = mathMax(bottom, p[1]);
- }
-
- min[0] = left;
- min[1] = top;
- max[0] = right;
- max[1] = bottom;
- };
-
- /**
- * @memberOf module:zrender/core/bbox
- * @param {number} x0
- * @param {number} y0
- * @param {number} x1
- * @param {number} y1
- * @param {Array.<number>} min
- * @param {Array.<number>} max
- */
- bbox.fromLine = function (x0, y0, x1, y1, min, max) {
- min[0] = mathMin(x0, x1);
- min[1] = mathMin(y0, y1);
- max[0] = mathMax(x0, x1);
- max[1] = mathMax(y0, y1);
- };
-
- var xDim = [];
- var yDim = [];
- /**
- * 从三阶贝塞尔曲线(p0, p1, p2, p3)中计算出最小包围盒,写入`min`和`max`中
- * @memberOf module:zrender/core/bbox
- * @param {number} x0
- * @param {number} y0
- * @param {number} x1
- * @param {number} y1
- * @param {number} x2
- * @param {number} y2
- * @param {number} x3
- * @param {number} y3
- * @param {Array.<number>} min
- * @param {Array.<number>} max
- */
- bbox.fromCubic = function(
- x0, y0, x1, y1, x2, y2, x3, y3, min, max
- ) {
- var cubicExtrema = curve.cubicExtrema;
- var cubicAt = curve.cubicAt;
- var i;
- var n = cubicExtrema(x0, x1, x2, x3, xDim);
- min[0] = Infinity;
- min[1] = Infinity;
- max[0] = -Infinity;
- max[1] = -Infinity;
-
- for (i = 0; i < n; i++) {
- var x = cubicAt(x0, x1, x2, x3, xDim[i]);
- min[0] = mathMin(x, min[0]);
- max[0] = mathMax(x, max[0]);
- }
- n = cubicExtrema(y0, y1, y2, y3, yDim);
- for (i = 0; i < n; i++) {
- var y = cubicAt(y0, y1, y2, y3, yDim[i]);
- min[1] = mathMin(y, min[1]);
- max[1] = mathMax(y, max[1]);
- }
-
- min[0] = mathMin(x0, min[0]);
- max[0] = mathMax(x0, max[0]);
- min[0] = mathMin(x3, min[0]);
- max[0] = mathMax(x3, max[0]);
-
- min[1] = mathMin(y0, min[1]);
- max[1] = mathMax(y0, max[1]);
- min[1] = mathMin(y3, min[1]);
- max[1] = mathMax(y3, max[1]);
- };
-
- /**
- * 从二阶贝塞尔曲线(p0, p1, p2)中计算出最小包围盒,写入`min`和`max`中
- * @memberOf module:zrender/core/bbox
- * @param {number} x0
- * @param {number} y0
- * @param {number} x1
- * @param {number} y1
- * @param {number} x2
- * @param {number} y2
- * @param {Array.<number>} min
- * @param {Array.<number>} max
- */
- bbox.fromQuadratic = function(x0, y0, x1, y1, x2, y2, min, max) {
- var quadraticExtremum = curve.quadraticExtremum;
- var quadraticAt = curve.quadraticAt;
- // Find extremities, where derivative in x dim or y dim is zero
- var tx =
- mathMax(
- mathMin(quadraticExtremum(x0, x1, x2), 1), 0
- );
- var ty =
- mathMax(
- mathMin(quadraticExtremum(y0, y1, y2), 1), 0
- );
-
- var x = quadraticAt(x0, x1, x2, tx);
- var y = quadraticAt(y0, y1, y2, ty);
-
- min[0] = mathMin(x0, x2, x);
- min[1] = mathMin(y0, y2, y);
- max[0] = mathMax(x0, x2, x);
- max[1] = mathMax(y0, y2, y);
- };
-
- /**
- * 从圆弧中计算出最小包围盒,写入`min`和`max`中
- * @method
- * @memberOf module:zrender/core/bbox
- * @param {number} x
- * @param {number} y
- * @param {number} rx
- * @param {number} ry
- * @param {number} startAngle
- * @param {number} endAngle
- * @param {number} anticlockwise
- * @param {Array.<number>} min
- * @param {Array.<number>} max
- */
- bbox.fromArc = function (
- x, y, rx, ry, startAngle, endAngle, anticlockwise, min, max
- ) {
- var vec2Min = vec2.min;
- var vec2Max = vec2.max;
-
- var diff = Math.abs(startAngle - endAngle);
-
-
- if (diff % PI2 < 1e-4 && diff > 1e-4) {
- // Is a circle
- min[0] = x - rx;
- min[1] = y - ry;
- max[0] = x + rx;
- max[1] = y + ry;
- return;
- }
-
- start[0] = mathCos(startAngle) * rx + x;
- start[1] = mathSin(startAngle) * ry + y;
-
- end[0] = mathCos(endAngle) * rx + x;
- end[1] = mathSin(endAngle) * ry + y;
-
- vec2Min(min, start, end);
- vec2Max(max, start, end);
-
- // Thresh to [0, Math.PI * 2]
- startAngle = startAngle % (PI2);
- if (startAngle < 0) {
- startAngle = startAngle + PI2;
- }
- endAngle = endAngle % (PI2);
- if (endAngle < 0) {
- endAngle = endAngle + PI2;
- }
-
- if (startAngle > endAngle && !anticlockwise) {
- endAngle += PI2;
- }
- else if (startAngle < endAngle && anticlockwise) {
- startAngle += PI2;
- }
- if (anticlockwise) {
- var tmp = endAngle;
- endAngle = startAngle;
- startAngle = tmp;
- }
-
- // var number = 0;
- // var step = (anticlockwise ? -Math.PI : Math.PI) / 2;
- for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {
- if (angle > startAngle) {
- extremity[0] = mathCos(angle) * rx + x;
- extremity[1] = mathSin(angle) * ry + y;
-
- vec2Min(min, extremity, min);
- vec2Max(max, extremity, max);
- }
- }
- };
-
- module.exports = bbox;
-
-
-
-/***/ },
-/* 51 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var CMD = __webpack_require__(48).CMD;
- var line = __webpack_require__(52);
- var cubic = __webpack_require__(53);
- var quadratic = __webpack_require__(54);
- var arc = __webpack_require__(55);
- var normalizeRadian = __webpack_require__(56).normalizeRadian;
- var curve = __webpack_require__(49);
-
- var windingLine = __webpack_require__(57);
-
- var containStroke = line.containStroke;
-
- var PI2 = Math.PI * 2;
-
- var EPSILON = 1e-4;
-
- function isAroundEqual(a, b) {
- return Math.abs(a - b) < EPSILON;
- }
-
- // 临时数组
- var roots = [-1, -1, -1];
- var extrema = [-1, -1];
-
- function swapExtrema() {
- var tmp = extrema[0];
- extrema[0] = extrema[1];
- extrema[1] = tmp;
- }
-
- function windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {
- // Quick reject
- if (
- (y > y0 && y > y1 && y > y2 && y > y3)
- || (y < y0 && y < y1 && y < y2 && y < y3)
- ) {
- return 0;
- }
- var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);
- if (nRoots === 0) {
- return 0;
- }
- else {
- var w = 0;
- var nExtrema = -1;
- var y0_, y1_;
- for (var i = 0; i < nRoots; i++) {
- var t = roots[i];
- var x_ = curve.cubicAt(x0, x1, x2, x3, t);
- if (x_ < x) { // Quick reject
- continue;
- }
- if (nExtrema < 0) {
- nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);
- if (extrema[1] < extrema[0] && nExtrema > 1) {
- swapExtrema();
- }
- y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);
- if (nExtrema > 1) {
- y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);
- }
- }
- if (nExtrema == 2) {
- // 分成三段单调函数
- if (t < extrema[0]) {
- w += y0_ < y0 ? 1 : -1;
- }
- else if (t < extrema[1]) {
- w += y1_ < y0_ ? 1 : -1;
- }
- else {
- w += y3 < y1_ ? 1 : -1;
- }
- }
- else {
- // 分成两段单调函数
- if (t < extrema[0]) {
- w += y0_ < y0 ? 1 : -1;
- }
- else {
- w += y3 < y0_ ? 1 : -1;
- }
- }
- }
- return w;
- }
- }
-
- function windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {
- // Quick reject
- if (
- (y > y0 && y > y1 && y > y2)
- || (y < y0 && y < y1 && y < y2)
- ) {
- return 0;
- }
- var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);
- if (nRoots === 0) {
- return 0;
- }
- else {
- var t = curve.quadraticExtremum(y0, y1, y2);
- if (t >= 0 && t <= 1) {
- var w = 0;
- var y_ = curve.quadraticAt(y0, y1, y2, t);
- for (var i = 0; i < nRoots; i++) {
- var x_ = curve.quadraticAt(x0, x1, x2, roots[i]);
- if (x_ < x) { // Quick reject
- continue;
- }
- if (roots[i] < t) {
- w += y_ < y0 ? 1 : -1;
- }
- else {
- w += y2 < y_ ? 1 : -1;
- }
- }
- return w;
- }
- else {
- var x_ = curve.quadraticAt(x0, x1, x2, roots[0]);
- if (x_ < x) { // Quick reject
- return 0;
- }
- return y2 < y0 ? 1 : -1;
- }
- }
- }
-
- // TODO
- // Arc 旋转
- function windingArc(
- cx, cy, r, startAngle, endAngle, anticlockwise, x, y
- ) {
- y -= cy;
- if (y > r || y < -r) {
- return 0;
- }
- var tmp = Math.sqrt(r * r - y * y);
- roots[0] = -tmp;
- roots[1] = tmp;
-
- var diff = Math.abs(startAngle - endAngle);
- if (diff < 1e-4) {
- return 0;
- }
- if (diff % PI2 < 1e-4) {
- // Is a circle
- startAngle = 0;
- endAngle = PI2;
- var dir = anticlockwise ? 1 : -1;
- if (x >= roots[0] + cx && x <= roots[1] + cx) {
- return dir;
- } else {
- return 0;
- }
- }
-
- if (anticlockwise) {
- var tmp = startAngle;
- startAngle = normalizeRadian(endAngle);
- endAngle = normalizeRadian(tmp);
- }
- else {
- startAngle = normalizeRadian(startAngle);
- endAngle = normalizeRadian(endAngle);
- }
- if (startAngle > endAngle) {
- endAngle += PI2;
- }
-
- var w = 0;
- for (var i = 0; i < 2; i++) {
- var x_ = roots[i];
- if (x_ + cx > x) {
- var angle = Math.atan2(y, x_);
- var dir = anticlockwise ? 1 : -1;
- if (angle < 0) {
- angle = PI2 + angle;
- }
- if (
- (angle >= startAngle && angle <= endAngle)
- || (angle + PI2 >= startAngle && angle + PI2 <= endAngle)
- ) {
- if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {
- dir = -dir;
- }
- w += dir;
- }
- }
- }
- return w;
- }
-
- function containPath(data, lineWidth, isStroke, x, y) {
- var w = 0;
- var xi = 0;
- var yi = 0;
- var x0 = 0;
- var y0 = 0;
-
- for (var i = 0; i < data.length;) {
- var cmd = data[i++];
- // Begin a new subpath
- if (cmd === CMD.M && i > 1) {
- // Close previous subpath
- if (!isStroke) {
- w += windingLine(xi, yi, x0, y0, x, y);
- }
- // 如果被任何一个 subpath 包含
- if (w !== 0) {
- return true;
- }
- }
-
- if (i == 1) {
- // 如果第一个命令是 L, C, Q
- // 则 previous point 同绘制命令的第一个 point
- //
- // 第一个命令为 Arc 的情况下会在后面特殊处理
- xi = data[i];
- yi = data[i + 1];
-
- x0 = xi;
- y0 = yi;
- }
-
- switch (cmd) {
- case CMD.M:
- // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点
- // 在 closePath 的时候使用
- x0 = data[i++];
- y0 = data[i++];
- xi = x0;
- yi = y0;
- break;
- case CMD.L:
- if (isStroke) {
- if (containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) {
- return true;
- }
- }
- else {
- // NOTE 在第一个命令为 L, C, Q 的时候会计算出 NaN
- w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;
- }
- xi = data[i++];
- yi = data[i++];
- break;
- case CMD.C:
- if (isStroke) {
- if (cubic.containStroke(xi, yi,
- data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1],
- lineWidth, x, y
- )) {
- return true;
- }
- }
- else {
- w += windingCubic(
- xi, yi,
- data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1],
- x, y
- ) || 0;
- }
- xi = data[i++];
- yi = data[i++];
- break;
- case CMD.Q:
- if (isStroke) {
- if (quadratic.containStroke(xi, yi,
- data[i++], data[i++], data[i], data[i + 1],
- lineWidth, x, y
- )) {
- return true;
- }
- }
- else {
- w += windingQuadratic(
- xi, yi,
- data[i++], data[i++], data[i], data[i + 1],
- x, y
- ) || 0;
- }
- xi = data[i++];
- yi = data[i++];
- break;
- case CMD.A:
- // TODO Arc 判断的开销比较大
- var cx = data[i++];
- var cy = data[i++];
- var rx = data[i++];
- var ry = data[i++];
- var theta = data[i++];
- var dTheta = data[i++];
- // TODO Arc 旋转
- var psi = data[i++];
- var anticlockwise = 1 - data[i++];
- var x1 = Math.cos(theta) * rx + cx;
- var y1 = Math.sin(theta) * ry + cy;
- // 不是直接使用 arc 命令
- if (i > 1) {
- w += windingLine(xi, yi, x1, y1, x, y);
- }
- else {
- // 第一个命令起点还未定义
- x0 = x1;
- y0 = y1;
- }
- // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放
- var _x = (x - cx) * ry / rx + cx;
- if (isStroke) {
- if (arc.containStroke(
- cx, cy, ry, theta, theta + dTheta, anticlockwise,
- lineWidth, _x, y
- )) {
- return true;
- }
- }
- else {
- w += windingArc(
- cx, cy, ry, theta, theta + dTheta, anticlockwise,
- _x, y
- );
- }
- xi = Math.cos(theta + dTheta) * rx + cx;
- yi = Math.sin(theta + dTheta) * ry + cy;
- break;
- case CMD.R:
- x0 = xi = data[i++];
- y0 = yi = data[i++];
- var width = data[i++];
- var height = data[i++];
- var x1 = x0 + width;
- var y1 = y0 + height;
- if (isStroke) {
- if (containStroke(x0, y0, x1, y0, lineWidth, x, y)
- || containStroke(x1, y0, x1, y1, lineWidth, x, y)
- || containStroke(x1, y1, x0, y1, lineWidth, x, y)
- || containStroke(x0, y1, x1, y1, lineWidth, x, y)
- ) {
- return true;
- }
- }
- else {
- // FIXME Clockwise ?
- w += windingLine(x1, y0, x1, y1, x, y);
- w += windingLine(x0, y1, x0, y0, x, y);
- }
- break;
- case CMD.Z:
- if (isStroke) {
- if (containStroke(
- xi, yi, x0, y0, lineWidth, x, y
- )) {
- return true;
- }
- }
- else {
- // Close a subpath
- w += windingLine(xi, yi, x0, y0, x, y);
- // 如果被任何一个 subpath 包含
- if (w !== 0) {
- return true;
- }
- }
- xi = x0;
- yi = y0;
- break;
- }
- }
- if (!isStroke && !isAroundEqual(yi, y0)) {
- w += windingLine(xi, yi, x0, y0, x, y) || 0;
- }
- return w !== 0;
- }
-
- module.exports = {
- contain: function (pathData, x, y) {
- return containPath(pathData, 0, false, x, y);
- },
-
- containStroke: function (pathData, lineWidth, x, y) {
- return containPath(pathData, lineWidth, true, x, y);
- }
- };
-
-
-/***/ },
-/* 52 */
-/***/ function(module, exports) {
-
-
- module.exports = {
- /**
- * 线段包含判断
- * @param {number} x0
- * @param {number} y0
- * @param {number} x1
- * @param {number} y1
- * @param {number} lineWidth
- * @param {number} x
- * @param {number} y
- * @return {boolean}
- */
- containStroke: function (x0, y0, x1, y1, lineWidth, x, y) {
- if (lineWidth === 0) {
- return false;
- }
- var _l = lineWidth;
- var _a = 0;
- var _b = x0;
- // Quick reject
- if (
- (y > y0 + _l && y > y1 + _l)
- || (y < y0 - _l && y < y1 - _l)
- || (x > x0 + _l && x > x1 + _l)
- || (x < x0 - _l && x < x1 - _l)
- ) {
- return false;
- }
-
- if (x0 !== x1) {
- _a = (y0 - y1) / (x0 - x1);
- _b = (x0 * y1 - x1 * y0) / (x0 - x1) ;
- }
- else {
- return Math.abs(x - x0) <= _l / 2;
- }
- var tmp = _a * x - y + _b;
- var _s = tmp * tmp / (_a * _a + 1);
- return _s <= _l / 2 * _l / 2;
- }
- };
-
-
-/***/ },
-/* 53 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var curve = __webpack_require__(49);
-
- module.exports = {
- /**
- * 三次贝塞尔曲线描边包含判断
- * @param {number} x0
- * @param {number} y0
- * @param {number} x1
- * @param {number} y1
- * @param {number} x2
- * @param {number} y2
- * @param {number} x3
- * @param {number} y3
- * @param {number} lineWidth
- * @param {number} x
- * @param {number} y
- * @return {boolean}
- */
- containStroke: function(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {
- if (lineWidth === 0) {
- return false;
- }
- var _l = lineWidth;
- // Quick reject
- if (
- (y > y0 + _l && y > y1 + _l && y > y2 + _l && y > y3 + _l)
- || (y < y0 - _l && y < y1 - _l && y < y2 - _l && y < y3 - _l)
- || (x > x0 + _l && x > x1 + _l && x > x2 + _l && x > x3 + _l)
- || (x < x0 - _l && x < x1 - _l && x < x2 - _l && x < x3 - _l)
- ) {
- return false;
- }
- var d = curve.cubicProjectPoint(
- x0, y0, x1, y1, x2, y2, x3, y3,
- x, y, null
- );
- return d <= _l / 2;
- }
- };
-
-
-/***/ },
-/* 54 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var curve = __webpack_require__(49);
-
- module.exports = {
- /**
- * 二次贝塞尔曲线描边包含判断
- * @param {number} x0
- * @param {number} y0
- * @param {number} x1
- * @param {number} y1
- * @param {number} x2
- * @param {number} y2
- * @param {number} lineWidth
- * @param {number} x
- * @param {number} y
- * @return {boolean}
- */
- containStroke: function (x0, y0, x1, y1, x2, y2, lineWidth, x, y) {
- if (lineWidth === 0) {
- return false;
- }
- var _l = lineWidth;
- // Quick reject
- if (
- (y > y0 + _l && y > y1 + _l && y > y2 + _l)
- || (y < y0 - _l && y < y1 - _l && y < y2 - _l)
- || (x > x0 + _l && x > x1 + _l && x > x2 + _l)
- || (x < x0 - _l && x < x1 - _l && x < x2 - _l)
- ) {
- return false;
- }
- var d = curve.quadraticProjectPoint(
- x0, y0, x1, y1, x2, y2,
- x, y, null
- );
- return d <= _l / 2;
- }
- };
-
-
-/***/ },
-/* 55 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var normalizeRadian = __webpack_require__(56).normalizeRadian;
- var PI2 = Math.PI * 2;
-
- module.exports = {
- /**
- * 圆弧描边包含判断
- * @param {number} cx
- * @param {number} cy
- * @param {number} r
- * @param {number} startAngle
- * @param {number} endAngle
- * @param {boolean} anticlockwise
- * @param {number} lineWidth
- * @param {number} x
- * @param {number} y
- * @return {Boolean}
- */
- containStroke: function (
- cx, cy, r, startAngle, endAngle, anticlockwise,
- lineWidth, x, y
- ) {
-
- if (lineWidth === 0) {
- return false;
- }
- var _l = lineWidth;
-
- x -= cx;
- y -= cy;
- var d = Math.sqrt(x * x + y * y);
-
- if ((d - _l > r) || (d + _l < r)) {
- return false;
- }
- if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {
- // Is a circle
- return true;
- }
- if (anticlockwise) {
- var tmp = startAngle;
- startAngle = normalizeRadian(endAngle);
- endAngle = normalizeRadian(tmp);
- } else {
- startAngle = normalizeRadian(startAngle);
- endAngle = normalizeRadian(endAngle);
- }
- if (startAngle > endAngle) {
- endAngle += PI2;
- }
-
- var angle = Math.atan2(y, x);
- if (angle < 0) {
- angle += PI2;
- }
- return (angle >= startAngle && angle <= endAngle)
- || (angle + PI2 >= startAngle && angle + PI2 <= endAngle);
- }
- };
-
-
-/***/ },
-/* 56 */
-/***/ function(module, exports) {
-
-
-
- var PI2 = Math.PI * 2;
- module.exports = {
- normalizeRadian: function(angle) {
- angle %= PI2;
- if (angle < 0) {
- angle += PI2;
- }
- return angle;
- }
- };
-
-
-/***/ },
-/* 57 */
-/***/ function(module, exports) {
-
-
- module.exports = function windingLine(x0, y0, x1, y1, x, y) {
- if ((y > y0 && y > y1) || (y < y0 && y < y1)) {
- return 0;
- }
- if (y1 === y0) {
- return 0;
- }
- var dir = y1 < y0 ? 1 : -1;
- var t = (y - y0) / (y1 - y0);
- var x_ = t * (x1 - x0) + x0;
-
- return x_ > x ? dir : 0;
- };
-
-
-/***/ },
-/* 58 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var CMD = __webpack_require__(48).CMD;
- var vec2 = __webpack_require__(16);
- var v2ApplyTransform = vec2.applyTransform;
-
- var points = [[], [], []];
- var mathSqrt = Math.sqrt;
- var mathAtan2 = Math.atan2;
- function transformPath(path, m) {
- var data = path.data;
- var cmd;
- var nPoint;
- var i;
- var j;
- var k;
- var p;
-
- var M = CMD.M;
- var C = CMD.C;
- var L = CMD.L;
- var R = CMD.R;
- var A = CMD.A;
- var Q = CMD.Q;
-
- for (i = 0, j = 0; i < data.length;) {
- cmd = data[i++];
- j = i;
- nPoint = 0;
-
- switch (cmd) {
- case M:
- nPoint = 1;
- break;
- case L:
- nPoint = 1;
- break;
- case C:
- nPoint = 3;
- break;
- case Q:
- nPoint = 2;
- break;
- case A:
- var x = m[4];
- var y = m[5];
- var sx = mathSqrt(m[0] * m[0] + m[1] * m[1]);
- var sy = mathSqrt(m[2] * m[2] + m[3] * m[3]);
- var angle = mathAtan2(-m[1] / sy, m[0] / sx);
- // cx
- data[i++] += x;
- // cy
- data[i++] += y;
- // Scale rx and ry
- // FIXME Assume psi is 0 here
- data[i++] *= sx;
- data[i++] *= sy;
-
- // Start angle
- data[i++] += angle;
- // end angle
- data[i++] += angle;
- // FIXME psi
- i += 2;
- j = i;
- break;
- case R:
- // x0, y0
- p[0] = data[i++];
- p[1] = data[i++];
- v2ApplyTransform(p, p, m);
- data[j++] = p[0];
- data[j++] = p[1];
- // x1, y1
- p[0] += data[i++];
- p[1] += data[i++];
- v2ApplyTransform(p, p, m);
- data[j++] = p[0];
- data[j++] = p[1];
- }
-
- for (k = 0; k < nPoint; k++) {
- var p = points[k];
- p[0] = data[i++];
- p[1] = data[i++];
-
- v2ApplyTransform(p, p, m);
- // Write back
- data[j++] = p[0];
- data[j++] = p[1];
- }
- }
- }
-
- module.exports = transformPath;
-
-
-/***/ },
-/* 59 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Image element
- * @module zrender/graphic/Image
- */
-
-
-
- var Displayable = __webpack_require__(45);
- var BoundingRect = __webpack_require__(15);
- var zrUtil = __webpack_require__(3);
- var roundRectHelper = __webpack_require__(60);
-
- var LRU = __webpack_require__(61);
- var globalImageCache = new LRU(50);
- /**
- * @alias zrender/graphic/Image
- * @extends module:zrender/graphic/Displayable
- * @constructor
- * @param {Object} opts
- */
- function ZImage(opts) {
- Displayable.call(this, opts);
- }
-
- ZImage.prototype = {
-
- constructor: ZImage,
-
- type: 'image',
-
- brush: function (ctx) {
- var style = this.style;
- var src = style.image;
- var image;
- // style.image is a url string
- if (typeof src === 'string') {
- image = this._image;
- }
- // style.image is an HTMLImageElement or HTMLCanvasElement or Canvas
- else {
- image = src;
- }
- // FIXME Case create many images with src
- if (!image && src) {
- // Try get from global image cache
- var cachedImgObj = globalImageCache.get(src);
- if (!cachedImgObj) {
- // Create a new image
- image = new Image();
- image.onload = function () {
- image.onload = null;
- for (var i = 0; i < cachedImgObj.pending.length; i++) {
- cachedImgObj.pending[i].dirty();
- }
- };
- cachedImgObj = {
- image: image,
- pending: [this]
- };
- image.src = src;
- globalImageCache.put(src, cachedImgObj);
- this._image = image;
- return;
- }
- else {
- image = cachedImgObj.image;
- this._image = image;
- // Image is not complete finish, add to pending list
- if (!image.width || !image.height) {
- cachedImgObj.pending.push(this);
- return;
- }
- }
- }
-
- if (image) {
- // 图片已经加载完成
- // if (image.nodeName.toUpperCase() == 'IMG') {
- // if (!image.complete) {
- // return;
- // }
- // }
- // Else is canvas
-
- var width = style.width || image.width;
- var height = style.height || image.height;
- var x = style.x || 0;
- var y = style.y || 0;
- // 图片加载失败
- if (!image.width || !image.height) {
- return;
- }
-
- ctx.save();
-
- style.bind(ctx);
-
- // 设置transform
- this.setTransform(ctx);
-
- if (style.r) {
- // Border radius clipping
- // FIXME
- ctx.beginPath();
- roundRectHelper.buildPath(ctx, style);
- ctx.clip();
- }
-
- if (style.sWidth && style.sHeight) {
- var sx = style.sx || 0;
- var sy = style.sy || 0;
- ctx.drawImage(
- image,
- sx, sy, style.sWidth, style.sHeight,
- x, y, width, height
- );
- }
- else if (style.sx && style.sy) {
- var sx = style.sx;
- var sy = style.sy;
- var sWidth = width - sx;
- var sHeight = height - sy;
- ctx.drawImage(
- image,
- sx, sy, sWidth, sHeight,
- x, y, width, height
- );
- }
- else {
- ctx.drawImage(image, x, y, width, height);
- }
-
- // 如果没设置宽和高的话自动根据图片宽高设置
- if (style.width == null) {
- style.width = width;
- }
- if (style.height == null) {
- style.height = height;
- }
-
- // Draw rect text
- if (style.text != null) {
- this.drawRectText(ctx, this.getBoundingRect());
- }
-
- ctx.restore();
- }
- },
-
- getBoundingRect: function () {
- var style = this.style;
- if (! this._rect) {
- this._rect = new BoundingRect(
- style.x || 0, style.y || 0, style.width || 0, style.height || 0
- );
- }
- return this._rect;
- }
- };
-
- zrUtil.inherits(ZImage, Displayable);
-
- module.exports = ZImage;
-
-
-/***/ },
-/* 60 */
-/***/ function(module, exports) {
-
-
-
- module.exports = {
- buildPath: function (ctx, shape) {
- var x = shape.x;
- var y = shape.y;
- var width = shape.width;
- var height = shape.height;
- var r = shape.r;
- var r1;
- var r2;
- var r3;
- var r4;
-
- // Convert width and height to positive for better borderRadius
- if (width < 0) {
- x = x + width;
- width = -width;
- }
- if (height < 0) {
- y = y + height;
- height = -height;
- }
-
- if (typeof r === 'number') {
- r1 = r2 = r3 = r4 = r;
- }
- else if (r instanceof Array) {
- if (r.length === 1) {
- r1 = r2 = r3 = r4 = r[0];
- }
- else if (r.length === 2) {
- r1 = r3 = r[0];
- r2 = r4 = r[1];
- }
- else if (r.length === 3) {
- r1 = r[0];
- r2 = r4 = r[1];
- r3 = r[2];
- }
- else {
- r1 = r[0];
- r2 = r[1];
- r3 = r[2];
- r4 = r[3];
- }
- }
- else {
- r1 = r2 = r3 = r4 = 0;
- }
-
- var total;
- if (r1 + r2 > width) {
- total = r1 + r2;
- r1 *= width / total;
- r2 *= width / total;
- }
- if (r3 + r4 > width) {
- total = r3 + r4;
- r3 *= width / total;
- r4 *= width / total;
- }
- if (r2 + r3 > height) {
- total = r2 + r3;
- r2 *= height / total;
- r3 *= height / total;
- }
- if (r1 + r4 > height) {
- total = r1 + r4;
- r1 *= height / total;
- r4 *= height / total;
- }
- ctx.moveTo(x + r1, y);
- ctx.lineTo(x + width - r2, y);
- r2 !== 0 && ctx.quadraticCurveTo(
- x + width, y, x + width, y + r2
- );
- ctx.lineTo(x + width, y + height - r3);
- r3 !== 0 && ctx.quadraticCurveTo(
- x + width, y + height, x + width - r3, y + height
- );
- ctx.lineTo(x + r4, y + height);
- r4 !== 0 && ctx.quadraticCurveTo(
- x, y + height, x, y + height - r4
- );
- ctx.lineTo(x, y + r1);
- r1 !== 0 && ctx.quadraticCurveTo(x, y, x + r1, y);
- }
- };
-
-
-/***/ },
-/* 61 */
-/***/ function(module, exports) {
-
- // Simple LRU cache use doubly linked list
- // @module zrender/core/LRU
-
-
- /**
- * Simple double linked list. Compared with array, it has O(1) remove operation.
- * @constructor
- */
- var LinkedList = function() {
-
- /**
- * @type {module:zrender/core/LRU~Entry}
- */
- this.head = null;
-
- /**
- * @type {module:zrender/core/LRU~Entry}
- */
- this.tail = null;
-
- this._len = 0;
- };
-
- var linkedListProto = LinkedList.prototype;
- /**
- * Insert a new value at the tail
- * @param {} val
- * @return {module:zrender/core/LRU~Entry}
- */
- linkedListProto.insert = function(val) {
- var entry = new Entry(val);
- this.insertEntry(entry);
- return entry;
- };
-
- /**
- * Insert an entry at the tail
- * @param {module:zrender/core/LRU~Entry} entry
- */
- linkedListProto.insertEntry = function(entry) {
- if (!this.head) {
- this.head = this.tail = entry;
- }
- else {
- this.tail.next = entry;
- entry.prev = this.tail;
- this.tail = entry;
- }
- this._len++;
- };
-
- /**
- * Remove entry.
- * @param {module:zrender/core/LRU~Entry} entry
- */
- linkedListProto.remove = function(entry) {
- var prev = entry.prev;
- var next = entry.next;
- if (prev) {
- prev.next = next;
- }
- else {
- // Is head
- this.head = next;
- }
- if (next) {
- next.prev = prev;
- }
- else {
- // Is tail
- this.tail = prev;
- }
- entry.next = entry.prev = null;
- this._len--;
- };
-
- /**
- * @return {number}
- */
- linkedListProto.len = function() {
- return this._len;
- };
-
- /**
- * @constructor
- * @param {} val
- */
- var Entry = function(val) {
- /**
- * @type {}
- */
- this.value = val;
-
- /**
- * @type {module:zrender/core/LRU~Entry}
- */
- this.next;
-
- /**
- * @type {module:zrender/core/LRU~Entry}
- */
- this.prev;
- };
-
- /**
- * LRU Cache
- * @constructor
- * @alias module:zrender/core/LRU
- */
- var LRU = function(maxSize) {
-
- this._list = new LinkedList();
-
- this._map = {};
-
- this._maxSize = maxSize || 10;
- };
-
- var LRUProto = LRU.prototype;
-
- /**
- * @param {string} key
- * @param {} value
- */
- LRUProto.put = function(key, value) {
- var list = this._list;
- var map = this._map;
- if (map[key] == null) {
- var len = list.len();
- if (len >= this._maxSize && len > 0) {
- // Remove the least recently used
- var leastUsedEntry = list.head;
- list.remove(leastUsedEntry);
- delete map[leastUsedEntry.key];
- }
-
- var entry = list.insert(value);
- entry.key = key;
- map[key] = entry;
- }
- };
-
- /**
- * @param {string} key
- * @return {}
- */
- LRUProto.get = function(key) {
- var entry = this._map[key];
- var list = this._list;
- if (entry != null) {
- // Put the latest used entry in the tail
- if (entry !== list.tail) {
- list.remove(entry);
- list.insertEntry(entry);
- }
-
- return entry.value;
- }
- };
-
- /**
- * Clear the cache
- */
- LRUProto.clear = function() {
- this._list.clear();
- this._map = {};
- };
-
- module.exports = LRU;
-
-
-/***/ },
-/* 62 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Text element
- * @module zrender/graphic/Text
- *
- * TODO Wrapping
- */
-
-
-
- var Displayable = __webpack_require__(45);
- var zrUtil = __webpack_require__(3);
- var textContain = __webpack_require__(14);
-
- /**
- * @alias zrender/graphic/Text
- * @extends module:zrender/graphic/Displayable
- * @constructor
- * @param {Object} opts
- */
- var Text = function (opts) {
- Displayable.call(this, opts);
- };
-
- Text.prototype = {
-
- constructor: Text,
-
- type: 'text',
-
- brush: function (ctx) {
- var style = this.style;
- var x = style.x || 0;
- var y = style.y || 0;
- // Convert to string
- var text = style.text;
- var textFill = style.fill;
- var textStroke = style.stroke;
-
- // Convert to string
- text != null && (text += '');
-
- if (text) {
- ctx.save();
-
- this.style.bind(ctx);
- this.setTransform(ctx);
-
- textFill && (ctx.fillStyle = textFill);
- textStroke && (ctx.strokeStyle = textStroke);
-
- ctx.font = style.textFont || style.font;
- ctx.textAlign = style.textAlign;
-
- if (style.textVerticalAlign) {
- var rect = textContain.getBoundingRect(
- text, ctx.font, style.textAlign, 'top'
- );
- // Ignore textBaseline
- ctx.textBaseline = 'top';
- switch (style.textVerticalAlign) {
- case 'middle':
- y -= rect.height / 2;
- break;
- case 'bottom':
- y -= rect.height;
- break;
- // 'top'
- }
- }
- else {
- ctx.textBaseline = style.textBaseline;
- }
- var lineHeight = textContain.measureText('国', ctx.font).width;
-
- var textLines = text.split('\n');
- for (var i = 0; i < textLines.length; i++) {
- textFill && ctx.fillText(textLines[i], x, y);
- textStroke && ctx.strokeText(textLines[i], x, y);
- y += lineHeight;
- }
-
- ctx.restore();
- }
- },
-
- getBoundingRect: function () {
- if (!this._rect) {
- var style = this.style;
- var textVerticalAlign = style.textVerticalAlign;
- var rect = textContain.getBoundingRect(
- style.text + '', style.textFont || style.font, style.textAlign,
- textVerticalAlign ? 'top' : style.textBaseline
- );
- switch (textVerticalAlign) {
- case 'middle':
- rect.y -= rect.height / 2;
- break;
- case 'bottom':
- rect.y -= rect.height;
- break;
- }
- rect.x += style.x || 0;
- rect.y += style.y || 0;
- this._rect = rect;
- }
- return this._rect;
- }
- };
-
- zrUtil.inherits(Text, Displayable);
-
- module.exports = Text;
-
-
-/***/ },
-/* 63 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * 圆形
- * @module zrender/shape/Circle
- */
-
-
-
- module.exports = __webpack_require__(44).extend({
-
- type: 'circle',
-
- shape: {
- cx: 0,
- cy: 0,
- r: 0
- },
-
- buildPath : function (ctx, shape) {
- // Better stroking in ShapeBundle
- ctx.moveTo(shape.cx + shape.r, shape.cy);
- ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2, true);
- return;
- }
- });
-
-
-
-/***/ },
-/* 64 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * 扇形
- * @module zrender/graphic/shape/Sector
- */
-
- // FIXME clockwise seems wrong
-
-
- module.exports = __webpack_require__(44).extend({
-
- type: 'sector',
-
- shape: {
-
- cx: 0,
-
- cy: 0,
-
- r0: 0,
-
- r: 0,
-
- startAngle: 0,
-
- endAngle: Math.PI * 2,
-
- clockwise: true
- },
-
- buildPath: function (ctx, shape) {
-
- var x = shape.cx;
- var y = shape.cy;
- var r0 = Math.max(shape.r0 || 0, 0);
- var r = Math.max(shape.r, 0);
- var startAngle = shape.startAngle;
- var endAngle = shape.endAngle;
- var clockwise = shape.clockwise;
-
- var unitX = Math.cos(startAngle);
- var unitY = Math.sin(startAngle);
-
- ctx.moveTo(unitX * r0 + x, unitY * r0 + y);
-
- ctx.lineTo(unitX * r + x, unitY * r + y);
-
- ctx.arc(x, y, r, startAngle, endAngle, !clockwise);
-
- ctx.lineTo(
- Math.cos(endAngle) * r0 + x,
- Math.sin(endAngle) * r0 + y
- );
-
- if (r0 !== 0) {
- ctx.arc(x, y, r0, endAngle, startAngle, clockwise);
- }
-
- ctx.closePath();
- }
- });
-
-
-
-/***/ },
-/* 65 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * 圆环
- * @module zrender/graphic/shape/Ring
- */
-
-
- module.exports = __webpack_require__(44).extend({
-
- type: 'ring',
-
- shape: {
- cx: 0,
- cy: 0,
- r: 0,
- r0: 0
- },
-
- buildPath: function (ctx, shape) {
- var x = shape.cx;
- var y = shape.cy;
- var PI2 = Math.PI * 2;
- ctx.moveTo(x + shape.r, y);
- ctx.arc(x, y, shape.r, 0, PI2, false);
- ctx.moveTo(x + shape.r0, y);
- ctx.arc(x, y, shape.r0, 0, PI2, true);
- }
- });
-
-
-
-/***/ },
-/* 66 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * 多边形
- * @module zrender/shape/Polygon
- */
-
-
- var polyHelper = __webpack_require__(67);
-
- module.exports = __webpack_require__(44).extend({
-
- type: 'polygon',
-
- shape: {
- points: null,
-
- smooth: false,
-
- smoothConstraint: null
- },
-
- buildPath: function (ctx, shape) {
- polyHelper.buildPath(ctx, shape, true);
- }
- });
-
-
-/***/ },
-/* 67 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var smoothSpline = __webpack_require__(68);
- var smoothBezier = __webpack_require__(69);
-
- module.exports = {
- buildPath: function (ctx, shape, closePath) {
- var points = shape.points;
- var smooth = shape.smooth;
- if (points && points.length >= 2) {
- if (smooth && smooth !== 'spline') {
- var controlPoints = smoothBezier(
- points, smooth, closePath, shape.smoothConstraint
- );
-
- ctx.moveTo(points[0][0], points[0][1]);
- var len = points.length;
- for (var i = 0; i < (closePath ? len : len - 1); i++) {
- var cp1 = controlPoints[i * 2];
- var cp2 = controlPoints[i * 2 + 1];
- var p = points[(i + 1) % len];
- ctx.bezierCurveTo(
- cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]
- );
- }
- }
- else {
- if (smooth === 'spline') {
- points = smoothSpline(points, closePath);
- }
-
- ctx.moveTo(points[0][0], points[0][1]);
- for (var i = 1, l = points.length; i < l; i++) {
- ctx.lineTo(points[i][0], points[i][1]);
- }
- }
-
- closePath && ctx.closePath();
- }
- }
- };
-
-
-/***/ },
-/* 68 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Catmull-Rom spline 插值折线
- * @module zrender/shape/util/smoothSpline
- * @author pissang (https://www.github.com/pissang)
- * Kener (@Kener-林峰, kener.linfeng@gmail.com)
- * errorrik (errorrik@gmail.com)
- */
-
- var vec2 = __webpack_require__(16);
-
- /**
- * @inner
- */
- function interpolate(p0, p1, p2, p3, t, t2, t3) {
- var v0 = (p2 - p0) * 0.5;
- var v1 = (p3 - p1) * 0.5;
- return (2 * (p1 - p2) + v0 + v1) * t3
- + (-3 * (p1 - p2) - 2 * v0 - v1) * t2
- + v0 * t + p1;
- }
-
- /**
- * @alias module:zrender/shape/util/smoothSpline
- * @param {Array} points 线段顶点数组
- * @param {boolean} isLoop
- * @return {Array}
- */
- module.exports = function (points, isLoop) {
- var len = points.length;
- var ret = [];
-
- var distance = 0;
- for (var i = 1; i < len; i++) {
- distance += vec2.distance(points[i - 1], points[i]);
- }
-
- var segs = distance / 2;
- segs = segs < len ? len : segs;
- for (var i = 0; i < segs; i++) {
- var pos = i / (segs - 1) * (isLoop ? len : len - 1);
- var idx = Math.floor(pos);
-
- var w = pos - idx;
-
- var p0;
- var p1 = points[idx % len];
- var p2;
- var p3;
- if (!isLoop) {
- p0 = points[idx === 0 ? idx : idx - 1];
- p2 = points[idx > len - 2 ? len - 1 : idx + 1];
- p3 = points[idx > len - 3 ? len - 1 : idx + 2];
- }
- else {
- p0 = points[(idx - 1 + len) % len];
- p2 = points[(idx + 1) % len];
- p3 = points[(idx + 2) % len];
- }
-
- var w2 = w * w;
- var w3 = w * w2;
-
- ret.push([
- interpolate(p0[0], p1[0], p2[0], p3[0], w, w2, w3),
- interpolate(p0[1], p1[1], p2[1], p3[1], w, w2, w3)
- ]);
- }
- return ret;
- };
-
-
-
-/***/ },
-/* 69 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * 贝塞尔平滑曲线
- * @module zrender/shape/util/smoothBezier
- * @author pissang (https://www.github.com/pissang)
- * Kener (@Kener-林峰, kener.linfeng@gmail.com)
- * errorrik (errorrik@gmail.com)
- */
-
-
- var vec2 = __webpack_require__(16);
- var v2Min = vec2.min;
- var v2Max = vec2.max;
- var v2Scale = vec2.scale;
- var v2Distance = vec2.distance;
- var v2Add = vec2.add;
-
- /**
- * 贝塞尔平滑曲线
- * @alias module:zrender/shape/util/smoothBezier
- * @param {Array} points 线段顶点数组
- * @param {number} smooth 平滑等级, 0-1
- * @param {boolean} isLoop
- * @param {Array} constraint 将计算出来的控制点约束在一个包围盒内
- * 比如 [[0, 0], [100, 100]], 这个包围盒会与
- * 整个折线的包围盒做一个并集用来约束控制点。
- * @param {Array} 计算出来的控制点数组
- */
- module.exports = function (points, smooth, isLoop, constraint) {
- var cps = [];
-
- var v = [];
- var v1 = [];
- var v2 = [];
- var prevPoint;
- var nextPoint;
-
- var min, max;
- if (constraint) {
- min = [Infinity, Infinity];
- max = [-Infinity, -Infinity];
- for (var i = 0, len = points.length; i < len; i++) {
- v2Min(min, min, points[i]);
- v2Max(max, max, points[i]);
- }
- // 与指定的包围盒做并集
- v2Min(min, min, constraint[0]);
- v2Max(max, max, constraint[1]);
- }
-
- for (var i = 0, len = points.length; i < len; i++) {
- var point = points[i];
-
- if (isLoop) {
- prevPoint = points[i ? i - 1 : len - 1];
- nextPoint = points[(i + 1) % len];
- }
- else {
- if (i === 0 || i === len - 1) {
- cps.push(vec2.clone(points[i]));
- continue;
- }
- else {
- prevPoint = points[i - 1];
- nextPoint = points[i + 1];
- }
- }
-
- vec2.sub(v, nextPoint, prevPoint);
-
- // use degree to scale the handle length
- v2Scale(v, v, smooth);
-
- var d0 = v2Distance(point, prevPoint);
- var d1 = v2Distance(point, nextPoint);
- var sum = d0 + d1;
- if (sum !== 0) {
- d0 /= sum;
- d1 /= sum;
- }
-
- v2Scale(v1, v, -d0);
- v2Scale(v2, v, d1);
- var cp0 = v2Add([], point, v1);
- var cp1 = v2Add([], point, v2);
- if (constraint) {
- v2Max(cp0, cp0, min);
- v2Min(cp0, cp0, max);
- v2Max(cp1, cp1, min);
- v2Min(cp1, cp1, max);
- }
- cps.push(cp0);
- cps.push(cp1);
- }
-
- if (isLoop) {
- cps.push(cps.shift());
- }
-
- return cps;
- };
-
-
-
-/***/ },
-/* 70 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @module zrender/graphic/shape/Polyline
- */
-
-
- var polyHelper = __webpack_require__(67);
-
- module.exports = __webpack_require__(44).extend({
-
- type: 'polyline',
-
- shape: {
- points: null,
-
- smooth: false,
-
- smoothConstraint: null
- },
-
- style: {
- stroke: '#000',
-
- fill: null
- },
-
- buildPath: function (ctx, shape) {
- polyHelper.buildPath(ctx, shape, false);
- }
- });
-
-
-/***/ },
-/* 71 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * 矩形
- * @module zrender/graphic/shape/Rect
- */
-
-
- var roundRectHelper = __webpack_require__(60);
-
- module.exports = __webpack_require__(44).extend({
-
- type: 'rect',
-
- shape: {
- // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4
- // r缩写为1 相当于 [1, 1, 1, 1]
- // r缩写为[1] 相当于 [1, 1, 1, 1]
- // r缩写为[1, 2] 相当于 [1, 2, 1, 2]
- // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2]
- r: 0,
-
- x: 0,
- y: 0,
- width: 0,
- height: 0
- },
-
- buildPath: function (ctx, shape) {
- var x = shape.x;
- var y = shape.y;
- var width = shape.width;
- var height = shape.height;
- if (!shape.r) {
- ctx.rect(x, y, width, height);
- }
- else {
- roundRectHelper.buildPath(ctx, shape);
- }
- ctx.closePath();
- return;
- }
- });
-
-
-
-/***/ },
-/* 72 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * 直线
- * @module zrender/graphic/shape/Line
- */
-
- module.exports = __webpack_require__(44).extend({
-
- type: 'line',
-
- shape: {
- // Start point
- x1: 0,
- y1: 0,
- // End point
- x2: 0,
- y2: 0,
-
- percent: 1
- },
-
- style: {
- stroke: '#000',
- fill: null
- },
-
- buildPath: function (ctx, shape) {
- var x1 = shape.x1;
- var y1 = shape.y1;
- var x2 = shape.x2;
- var y2 = shape.y2;
- var percent = shape.percent;
-
- if (percent === 0) {
- return;
- }
-
- ctx.moveTo(x1, y1);
-
- if (percent < 1) {
- x2 = x1 * (1 - percent) + x2 * percent;
- y2 = y1 * (1 - percent) + y2 * percent;
- }
- ctx.lineTo(x2, y2);
- },
-
- /**
- * Get point at percent
- * @param {number} percent
- * @return {Array.<number>}
- */
- pointAt: function (p) {
- var shape = this.shape;
- return [
- shape.x1 * (1 - p) + shape.x2 * p,
- shape.y1 * (1 - p) + shape.y2 * p
- ];
- }
- });
-
-
-
-/***/ },
-/* 73 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * 贝塞尔曲线
- * @module zrender/shape/BezierCurve
- */
-
-
- var curveTool = __webpack_require__(49);
- var quadraticSubdivide = curveTool.quadraticSubdivide;
- var cubicSubdivide = curveTool.cubicSubdivide;
- var quadraticAt = curveTool.quadraticAt;
- var cubicAt = curveTool.cubicAt;
-
- var out = [];
- module.exports = __webpack_require__(44).extend({
-
- type: 'bezier-curve',
-
- shape: {
- x1: 0,
- y1: 0,
- x2: 0,
- y2: 0,
- cpx1: 0,
- cpy1: 0,
- // cpx2: 0,
- // cpy2: 0
-
- // Curve show percent, for animating
- percent: 1
- },
-
- style: {
- stroke: '#000',
- fill: null
- },
-
- buildPath: function (ctx, shape) {
- var x1 = shape.x1;
- var y1 = shape.y1;
- var x2 = shape.x2;
- var y2 = shape.y2;
- var cpx1 = shape.cpx1;
- var cpy1 = shape.cpy1;
- var cpx2 = shape.cpx2;
- var cpy2 = shape.cpy2;
- var percent = shape.percent;
- if (percent === 0) {
- return;
- }
-
- ctx.moveTo(x1, y1);
-
- if (cpx2 == null || cpy2 == null) {
- if (percent < 1) {
- quadraticSubdivide(
- x1, cpx1, x2, percent, out
- );
- cpx1 = out[1];
- x2 = out[2];
- quadraticSubdivide(
- y1, cpy1, y2, percent, out
- );
- cpy1 = out[1];
- y2 = out[2];
- }
-
- ctx.quadraticCurveTo(
- cpx1, cpy1,
- x2, y2
- );
- }
- else {
- if (percent < 1) {
- cubicSubdivide(
- x1, cpx1, cpx2, x2, percent, out
- );
- cpx1 = out[1];
- cpx2 = out[2];
- x2 = out[3];
- cubicSubdivide(
- y1, cpy1, cpy2, y2, percent, out
- );
- cpy1 = out[1];
- cpy2 = out[2];
- y2 = out[3];
- }
- ctx.bezierCurveTo(
- cpx1, cpy1,
- cpx2, cpy2,
- x2, y2
- );
- }
- },
-
- /**
- * Get point at percent
- * @param {number} percent
- * @return {Array.<number>}
- */
- pointAt: function (p) {
- var shape = this.shape;
- var cpx2 = shape.cpx2;
- var cpy2 = shape.cpy2;
- if (cpx2 === null || cpy2 === null) {
- return [
- quadraticAt(shape.x1, shape.cpx1, shape.x2, p),
- quadraticAt(shape.y1, shape.cpy1, shape.y2, p)
- ];
- }
- else {
- return [
- cubicAt(shape.x1, shape.cpx1, shape.cpx1, shape.x2, p),
- cubicAt(shape.y1, shape.cpy1, shape.cpy1, shape.y2, p)
- ];
- }
- }
- });
-
-
-
-/***/ },
-/* 74 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * 圆弧
- * @module zrender/graphic/shape/Arc
- */
-
-
- module.exports = __webpack_require__(44).extend({
-
- type: 'arc',
-
- shape: {
-
- cx: 0,
-
- cy: 0,
-
- r: 0,
-
- startAngle: 0,
-
- endAngle: Math.PI * 2,
-
- clockwise: true
- },
-
- style: {
-
- stroke: '#000',
-
- fill: null
- },
-
- buildPath: function (ctx, shape) {
-
- var x = shape.cx;
- var y = shape.cy;
- var r = Math.max(shape.r, 0);
- var startAngle = shape.startAngle;
- var endAngle = shape.endAngle;
- var clockwise = shape.clockwise;
-
- var unitX = Math.cos(startAngle);
- var unitY = Math.sin(startAngle);
-
- ctx.moveTo(unitX * r + x, unitY * r + y);
- ctx.arc(x, y, r, startAngle, endAngle, !clockwise);
- }
- });
-
-
-/***/ },
-/* 75 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
-
- var Gradient = __webpack_require__(4);
-
- /**
- * x, y, x2, y2 are all percent from 0 to 1
- * @param {number} [x=0]
- * @param {number} [y=0]
- * @param {number} [x2=1]
- * @param {number} [y2=0]
- * @param {Array.<Object>} colorStops
- */
- var LinearGradient = function (x, y, x2, y2, colorStops) {
- this.x = x == null ? 0 : x;
-
- this.y = y == null ? 0 : y;
-
- this.x2 = x2 == null ? 1 : x2;
-
- this.y2 = y2 == null ? 0 : y2;
-
- Gradient.call(this, colorStops);
- };
-
- LinearGradient.prototype = {
-
- constructor: LinearGradient,
-
- type: 'linear',
-
- updateCanvasGradient: function (shape, ctx) {
- var rect = shape.getBoundingRect();
- // var size =
- var x = this.x * rect.width + rect.x;
- var x2 = this.x2 * rect.width + rect.x;
- var y = this.y * rect.height + rect.y;
- var y2 = this.y2 * rect.height + rect.y;
-
- var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);
-
- var colorStops = this.colorStops;
- for (var i = 0; i < colorStops.length; i++) {
- canvasGradient.addColorStop(
- colorStops[i].offset, colorStops[i].color
- );
- }
-
- this.canvasGradient = canvasGradient;
- }
-
- };
-
- zrUtil.inherits(LinearGradient, Gradient);
-
- module.exports = LinearGradient;
-
-
-/***/ },
-/* 76 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
-
- var Gradient = __webpack_require__(4);
-
- /**
- * x, y, r are all percent from 0 to 1
- * @param {number} [x=0.5]
- * @param {number} [y=0.5]
- * @param {number} [r=0.5]
- * @param {Array.<Object>} [colorStops]
- */
- var RadialGradient = function (x, y, r, colorStops) {
- this.x = x == null ? 0.5 : x;
-
- this.y = y == null ? 0.5 : y;
-
- this.r = r == null ? 0.5 : r;
-
- Gradient.call(this, colorStops);
- };
-
- RadialGradient.prototype = {
-
- constructor: RadialGradient,
-
- type: 'radial',
-
- updateCanvasGradient: function (shape, ctx) {
- var rect = shape.getBoundingRect();
-
- var width = rect.width;
- var height = rect.height;
- var min = Math.min(width, height);
- // var max = Math.max(width, height);
-
- var x = this.x * width + rect.x;
- var y = this.y * height + rect.y;
- var r = this.r * min;
-
- var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);
-
- var colorStops = this.colorStops;
- for (var i = 0; i < colorStops.length; i++) {
- canvasGradient.addColorStop(
- colorStops[i].offset, colorStops[i].color
- );
- }
-
- this.canvasGradient = canvasGradient;
- }
- };
-
- zrUtil.inherits(RadialGradient, Gradient);
-
- module.exports = RadialGradient;
-
-
-/***/ },
-/* 77 */
-/***/ function(module, exports, __webpack_require__) {
-
- /*!
- * ZRender, a high performance 2d drawing library.
- *
- * Copyright (c) 2013, Baidu Inc.
- * All rights reserved.
- *
- * LICENSE
- * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt
- */
- // Global defines
-
- var guid = __webpack_require__(31);
- var env = __webpack_require__(78);
-
- var Handler = __webpack_require__(79);
- var Storage = __webpack_require__(83);
- var Animation = __webpack_require__(84);
-
- var useVML = !env.canvasSupported;
-
- var painterCtors = {
- canvas: __webpack_require__(85)
- };
-
- var instances = {}; // ZRender实例map索引
-
- var zrender = {};
- /**
- * @type {string}
- */
- zrender.version = '3.0.6';
-
- /**
- * @param {HTMLElement} dom
- * @param {Object} opts
- * @param {string} [opts.renderer='canvas'] 'canvas' or 'svg'
- * @param {number} [opts.devicePixelRatio]
- * @return {module:zrender/ZRender}
- */
- zrender.init = function(dom, opts) {
- var zr = new ZRender(guid(), dom, opts);
- instances[zr.id] = zr;
- return zr;
- };
-
- /**
- * Dispose zrender instance
- * @param {module:zrender/ZRender} zr
- */
- zrender.dispose = function (zr) {
- if (zr) {
- zr.dispose();
- }
- else {
- for (var key in instances) {
- instances[key].dispose();
- }
- instances = {};
- }
-
- return zrender;
- };
-
- /**
- * 获取zrender实例
- * @param {string} id ZRender对象索引
- * @return {module:zrender/ZRender}
- */
- zrender.getInstance = function (id) {
- return instances[id];
- };
-
- zrender.registerPainter = function (name, Ctor) {
- painterCtors[name] = Ctor;
- };
-
- function delInstance(id) {
- delete instances[id];
- }
-
- /**
- * @module zrender/ZRender
- */
- /**
- * @constructor
- * @alias module:zrender/ZRender
- * @param {string} id
- * @param {HTMLDomElement} dom
- * @param {Object} opts
- * @param {string} [opts.renderer='canvas'] 'canvas' or 'svg'
- * @param {number} [opts.devicePixelRatio]
- */
- var ZRender = function(id, dom, opts) {
-
- opts = opts || {};
-
- /**
- * @type {HTMLDomElement}
- */
- this.dom = dom;
-
- /**
- * @type {string}
- */
- this.id = id;
-
- var self = this;
- var storage = new Storage();
-
- var rendererType = opts.renderer;
- if (useVML) {
- if (!painterCtors.vml) {
- throw new Error('You need to require \'zrender/vml/vml\' to support IE8');
- }
- rendererType = 'vml';
- }
- else if (!rendererType || !painterCtors[rendererType]) {
- rendererType = 'canvas';
- }
- var painter = new painterCtors[rendererType](dom, storage, opts);
-
- this.storage = storage;
- this.painter = painter;
- if (!env.node) {
- this.handler = new Handler(painter.getViewportRoot(), storage, painter);
- }
-
- /**
- * @type {module:zrender/animation/Animation}
- */
- this.animation = new Animation({
- stage: {
- update: function () {
- if (self._needsRefresh) {
- self.refreshImmediately();
- }
- }
- }
- });
- this.animation.start();
-
- /**
- * @type {boolean}
- * @private
- */
- this._needsRefresh;
-
- // 修改 storage.delFromMap, 每次删除元素之前删除动画
- // FIXME 有点ugly
- var oldDelFromMap = storage.delFromMap;
- var oldAddToMap = storage.addToMap;
-
- storage.delFromMap = function (elId) {
- var el = storage.get(elId);
-
- oldDelFromMap.call(storage, elId);
-
- el && el.removeSelfFromZr(self);
- };
-
- storage.addToMap = function (el) {
- oldAddToMap.call(storage, el);
-
- el.addSelfToZr(self);
- };
- };
-
- ZRender.prototype = {
-
- constructor: ZRender,
- /**
- * 获取实例唯一标识
- * @return {string}
- */
- getId: function () {
- return this.id;
- },
-
- /**
- * 添加元素
- * @param {string|module:zrender/Element} el
- */
- add: function (el) {
- this.storage.addRoot(el);
- this._needsRefresh = true;
- },
-
- /**
- * 删除元素
- * @param {string|module:zrender/Element} el
- */
- remove: function (el) {
- this.storage.delRoot(el);
- this._needsRefresh = true;
- },
-
- /**
- * 修改指定zlevel的绘制配置项
- *
- * @param {string} zLevel
- * @param {Object} config 配置对象
- * @param {string} [config.clearColor=0] 每次清空画布的颜色
- * @param {string} [config.motionBlur=false] 是否开启动态模糊
- * @param {number} [config.lastFrameAlpha=0.7]
- * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显
- */
- configLayer: function (zLevel, config) {
- this.painter.configLayer(zLevel, config);
- this._needsRefresh = true;
- },
-
- /**
- * 视图更新
- */
- refreshImmediately: function () {
- // Clear needsRefresh ahead to avoid something wrong happens in refresh
- // Or it will cause zrender refreshes again and again.
- this._needsRefresh = false;
- this.painter.refresh();
- /**
- * Avoid trigger zr.refresh in Element#beforeUpdate hook
- */
- this._needsRefresh = false;
- },
-
- /**
- * 标记视图在浏览器下一帧需要绘制
- */
- refresh: function() {
- this._needsRefresh = true;
- },
-
- /**
- * 调整视图大小
- */
- resize: function() {
- this.painter.resize();
- this.handler && this.handler.resize();
- },
-
- /**
- * 停止所有动画
- */
- clearAnimation: function () {
- this.animation.clear();
- },
-
- /**
- * 获取视图宽度
- */
- getWidth: function() {
- return this.painter.getWidth();
- },
-
- /**
- * 获取视图高度
- */
- getHeight: function() {
- return this.painter.getHeight();
- },
-
- /**
- * 图像导出
- * @param {string} type
- * @param {string} [backgroundColor='#fff'] 背景色
- * @return {string} 图片的Base64 url
- */
- toDataURL: function(type, backgroundColor, args) {
- return this.painter.toDataURL(type, backgroundColor, args);
- },
-
- /**
- * 将常规shape转成image shape
- * @param {module:zrender/graphic/Path} e
- * @param {number} width
- * @param {number} height
- */
- pathToImage: function(e, width, height) {
- var id = guid();
- return this.painter.pathToImage(id, e, width, height);
- },
-
- /**
- * 设置默认的cursor style
- * @param {string} cursorStyle 例如 crosshair
- */
- setDefaultCursorStyle: function (cursorStyle) {
- this.handler.setDefaultCursorStyle(cursorStyle);
- },
-
- /**
- * 事件绑定
- *
- * @param {string} eventName 事件名称
- * @param {Function} eventHandler 响应函数
- * @param {Object} [context] 响应函数
- */
- on: function(eventName, eventHandler, context) {
- this.handler && this.handler.on(eventName, eventHandler, context);
- },
-
- /**
- * 事件解绑定,参数为空则解绑所有自定义事件
- *
- * @param {string} eventName 事件名称
- * @param {Function} eventHandler 响应函数
- */
- off: function(eventName, eventHandler) {
- this.handler && this.handler.off(eventName, eventHandler);
- },
-
- /**
- * 事件触发
- *
- * @param {string} eventName 事件名称,resize,hover,drag,etc
- * @param {event=} event event dom事件对象
- */
- trigger: function (eventName, event) {
- this.handler && this.handler.trigger(eventName, event);
- },
-
-
- /**
- * 清除当前ZRender下所有类图的数据和显示,clear后MVC和已绑定事件均还存在在,ZRender可用
- */
- clear: function () {
- this.storage.delRoot();
- this.painter.clear();
- },
-
- /**
- * 释放当前ZR实例(删除包括dom,数据、显示和事件绑定),dispose后ZR不可用
- */
- dispose: function () {
- this.animation.stop();
-
- this.clear();
- this.storage.dispose();
- this.painter.dispose();
- this.handler && this.handler.dispose();
-
- this.animation =
- this.storage =
- this.painter =
- this.handler = null;
-
- delInstance(this.id);
- }
- };
-
- module.exports = zrender;
-
-
-
-/***/ },
-/* 78 */
-/***/ function(module, exports) {
-
- /**
- * echarts设备环境识别
- *
- * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。
- * @author firede[firede@firede.us]
- * @desc thanks zepto.
- */
-
- var env = {};
- if (typeof navigator === 'undefined') {
- // In node
- env = {
- browser: {},
- os: {},
- node: true,
- // Assume canvas is supported
- canvasSupported: true
- };
- }
- else {
- env = detect(navigator.userAgent);
- }
-
- module.exports = env;
-
- // Zepto.js
- // (c) 2010-2013 Thomas Fuchs
- // Zepto.js may be freely distributed under the MIT license.
-
- function detect(ua) {
- var os = {};
- var browser = {};
- var webkit = ua.match(/Web[kK]it[\/]{0,1}([\d.]+)/);
- var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
- var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
- var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
- var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
- var webos = ua.match(/(webOS|hpwOS)[\s\/]([\d.]+)/);
- var touchpad = webos && ua.match(/TouchPad/);
- var kindle = ua.match(/Kindle\/([\d.]+)/);
- var silk = ua.match(/Silk\/([\d._]+)/);
- var blackberry = ua.match(/(BlackBerry).*Version\/([\d.]+)/);
- var bb10 = ua.match(/(BB10).*Version\/([\d.]+)/);
- var rimtabletos = ua.match(/(RIM\sTablet\sOS)\s([\d.]+)/);
- var playbook = ua.match(/PlayBook/);
- var chrome = ua.match(/Chrome\/([\d.]+)/) || ua.match(/CriOS\/([\d.]+)/);
- var firefox = ua.match(/Firefox\/([\d.]+)/);
- var safari = webkit && ua.match(/Mobile\//) && !chrome;
- var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;
- var ie = ua.match(/MSIE\s([\d.]+)/)
- // IE 11 Trident/7.0; rv:11.0
- || ua.match(/Trident\/.+?rv:(([\d.]+))/);
- var edge = ua.match(/Edge\/([\d.]+)/); // IE 12 and 12+
-
- // Todo: clean this up with a better OS/browser seperation:
- // - discern (more) between multiple browsers on android
- // - decide if kindle fire in silk mode is android or not
- // - Firefox on Android doesn't specify the Android version
- // - possibly devide in os, device and browser hashes
-
- if (browser.webkit = !!webkit) browser.version = webkit[1];
-
- if (android) os.android = true, os.version = android[2];
- if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.');
- if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.');
- if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;
- if (webos) os.webos = true, os.version = webos[2];
- if (touchpad) os.touchpad = true;
- if (blackberry) os.blackberry = true, os.version = blackberry[2];
- if (bb10) os.bb10 = true, os.version = bb10[2];
- if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2];
- if (playbook) browser.playbook = true;
- if (kindle) os.kindle = true, os.version = kindle[1];
- if (silk) browser.silk = true, browser.version = silk[1];
- if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true;
- if (chrome) browser.chrome = true, browser.version = chrome[1];
- if (firefox) browser.firefox = true, browser.version = firefox[1];
- if (ie) browser.ie = true, browser.version = ie[1];
- if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true;
- if (webview) browser.webview = true;
- if (ie) browser.ie = true, browser.version = ie[1];
- if (edge) browser.edge = true, browser.version = edge[1];
-
- os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) ||
- (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/)));
- os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos || blackberry || bb10 ||
- (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\/([\d.]+)/)) ||
- (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/))));
-
- return {
- browser: browser,
- os: os,
- node: false,
- // 原生canvas支持,改极端点了
- // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9)
- canvasSupported : document.createElement('canvas').getContext ? true : false,
- // @see <http://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript>
- // works on most browsers
- // IE10/11 does not support touch event, and MS Edge supports them but not by
- // default, so we dont check navigator.maxTouchPoints for them here.
- touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge,
- // <http://caniuse.com/#search=pointer%20event>.
- pointerEventsSupported: 'onpointerdown' in window
- // Firefox supports pointer but not by default,
- // only MS browsers are reliable on pointer events currently.
- && (browser.edge || (browser.ie && browser.version >= 10))
- };
- }
-
-
-/***/ },
-/* 79 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * Handler控制模块
- * @module zrender/Handler
- * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
- * errorrik (errorrik@gmail.com)
- * pissang (shenyi.914@gmail.com)
- */
-
-
- var env = __webpack_require__(78);
- var eventTool = __webpack_require__(80);
- var util = __webpack_require__(3);
- var Draggable = __webpack_require__(81);
- var GestureMgr = __webpack_require__(82);
-
- var Eventful = __webpack_require__(32);
-
- var mouseHandlerNames = [
- 'click', 'dblclick', 'mousewheel', 'mouseout'
- ];
- !usePointerEvent() && mouseHandlerNames.push(
- 'mouseup', 'mousedown', 'mousemove'
- );
-
- var touchHandlerNames = [
- 'touchstart', 'touchend', 'touchmove'
- ];
-
- var pointerHandlerNames = [
- 'pointerdown', 'pointerup', 'pointermove'
- ];
-
- var TOUCH_CLICK_DELAY = 300;
-
- // touch指尖错觉的尝试偏移量配置
- // var MOBILE_TOUCH_OFFSETS = [
- // { x: 10 },
- // { x: -20 },
- // { x: 10, y: 10 },
- // { y: -20 }
- // ];
-
- var addEventListener = eventTool.addEventListener;
- var removeEventListener = eventTool.removeEventListener;
- var normalizeEvent = eventTool.normalizeEvent;
-
- function makeEventPacket(eveType, target, event) {
- return {
- type: eveType,
- event: event,
- target: target,
- cancelBubble: false,
- offsetX: event.zrX,
- offsetY: event.zrY,
- gestureEvent: event.gestureEvent,
- pinchX: event.pinchX,
- pinchY: event.pinchY,
- pinchScale: event.pinchScale,
- wheelDelta: event.zrDelta
- };
- }
-
- var domHandlers = {
- /**
- * Mouse move handler
- * @inner
- * @param {Event} event
- */
- mousemove: function (event) {
- event = normalizeEvent(this.root, event);
-
- var x = event.zrX;
- var y = event.zrY;
-
- var hovered = this.findHover(x, y, null);
- var lastHovered = this._hovered;
-
- this._hovered = hovered;
-
- this.root.style.cursor = hovered ? hovered.cursor : this._defaultCursorStyle;
- // Mouse out on previous hovered element
- if (lastHovered && hovered !== lastHovered && lastHovered.__zr) {
- this._dispatchProxy(lastHovered, 'mouseout', event);
- }
-
- // Mouse moving on one element
- this._dispatchProxy(hovered, 'mousemove', event);
-
- // Mouse over on a new element
- if (hovered && hovered !== lastHovered) {
- this._dispatchProxy(hovered, 'mouseover', event);
- }
- },
-
- /**
- * Mouse out handler
- * @inner
- * @param {Event} event
- */
- mouseout: function (event) {
- event = normalizeEvent(this.root, event);
-
- var element = event.toElement || event.relatedTarget;
- if (element != this.root) {
- while (element && element.nodeType != 9) {
- // 忽略包含在root中的dom引起的mouseOut
- if (element === this.root) {
- return;
- }
-
- element = element.parentNode;
- }
- }
-
- this._dispatchProxy(this._hovered, 'mouseout', event);
-
- this.trigger('globalout', {
- event: event
- });
- },
-
- /**
- * Touch开始响应函数
- * @inner
- * @param {Event} event
- */
- touchstart: function (event) {
- // FIXME
- // 移动端可能需要default行为,例如静态图表时。
- // eventTool.stop(event);// 阻止浏览器默认事件,重要
- event = normalizeEvent(this.root, event);
-
- this._lastTouchMoment = new Date();
-
- processGesture(this, event, 'start');
-
- // 平板补充一次findHover
- // this._mobileFindFixed(event);
- // Trigger mousemove and mousedown
- domHandlers.mousemove.call(this, event);
-
- domHandlers.mousedown.call(this, event);
-
- setTouchTimer(this);
- },
-
- /**
- * Touch移动响应函数
- * @inner
- * @param {Event} event
- */
- touchmove: function (event) {
- // eventTool.stop(event);// 阻止浏览器默认事件,重要
- event = normalizeEvent(this.root, event);
-
- processGesture(this, event, 'change');
-
- // Mouse move should always be triggered no matter whether
- // there is gestrue event, because mouse move and pinch may
- // be used at the same time.
- domHandlers.mousemove.call(this, event);
-
- setTouchTimer(this);
- },
-
- /**
- * Touch结束响应函数
- * @inner
- * @param {Event} event
- */
- touchend: function (event) {
- // eventTool.stop(event);// 阻止浏览器默认事件,重要
- event = normalizeEvent(this.root, event);
-
- processGesture(this, event, 'end');
-
- domHandlers.mouseup.call(this, event);
-
- // click event should always be triggered no matter whether
- // there is gestrue event. System click can not be prevented.
- if (+new Date() - this._lastTouchMoment < TOUCH_CLICK_DELAY) {
- // this._mobileFindFixed(event);
- domHandlers.click.call(this, event);
- }
-
- setTouchTimer(this);
- }
- };
-
- // Common handlers
- util.each(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick'], function (name) {
- domHandlers[name] = function (event) {
- event = normalizeEvent(this.root, event);
- // Find hover again to avoid click event is dispatched manually. Or click is triggered without mouseover
- var hovered = this.findHover(event.zrX, event.zrY, null);
- this._dispatchProxy(hovered, name, event);
- };
- });
-
- // Pointer event handlers
- // util.each(['pointerdown', 'pointermove', 'pointerup'], function (name) {
- // domHandlers[name] = function (event) {
- // var mouseName = name.replace('pointer', 'mouse');
- // domHandlers[mouseName].call(this, event);
- // };
- // });
-
- function processGesture(zrHandler, event, stage) {
- var gestureMgr = zrHandler._gestureMgr;
-
- stage === 'start' && gestureMgr.clear();
-
- var gestureInfo = gestureMgr.recognize(
- event,
- zrHandler.findHover(event.zrX, event.zrY, null)
- );
-
- stage === 'end' && gestureMgr.clear();
-
- if (gestureInfo) {
- // eventTool.stop(event);
- var type = gestureInfo.type;
- event.gestureEvent = type;
-
- zrHandler._dispatchProxy(gestureInfo.target, type, gestureInfo.event);
- }
- }
-
- /**
- * 为控制类实例初始化dom 事件处理函数
- *
- * @inner
- * @param {module:zrender/Handler} instance 控制类实例
- */
- function initDomHandler(instance) {
- var handlerNames = touchHandlerNames.concat(pointerHandlerNames);
- for (var i = 0; i < handlerNames.length; i++) {
- var name = handlerNames[i];
- instance._handlers[name] = util.bind(domHandlers[name], instance);
- }
-
- for (var i = 0; i < mouseHandlerNames.length; i++) {
- var name = mouseHandlerNames[i];
- instance._handlers[name] = makeMouseHandler(domHandlers[name], instance);
- }
-
- function makeMouseHandler(fn, instance) {
- return function () {
- if (instance._touching) {
- return;
- }
- return fn.apply(instance, arguments);
- };
- }
- }
-
- /**
- * @alias module:zrender/Handler
- * @constructor
- * @extends module:zrender/mixin/Eventful
- * @param {HTMLElement} root Main HTML element for painting.
- * @param {module:zrender/Storage} storage Storage instance.
- * @param {module:zrender/Painter} painter Painter instance.
- */
- var Handler = function(root, storage, painter) {
- Eventful.call(this);
-
- this.root = root;
- this.storage = storage;
- this.painter = painter;
-
- /**
- * @private
- * @type {boolean}
- */
- this._hovered;
-
- /**
- * @private
- * @type {Date}
- */
- this._lastTouchMoment;
-
- /**
- * @private
- * @type {number}
- */
- this._lastX;
-
- /**
- * @private
- * @type {number}
- */
- this._lastY;
-
- /**
- * @private
- * @type {string}
- */
- this._defaultCursorStyle = 'default';
-
- /**
- * @private
- * @type {module:zrender/core/GestureMgr}
- */
- this._gestureMgr = new GestureMgr();
-
- /**
- * @private
- * @type {Array.<Function>}
- */
- this._handlers = [];
-
- /**
- * @private
- * @type {boolean}
- */
- this._touching = false;
-
- /**
- * @private
- * @type {number}
- */
- this._touchTimer;
-
- initDomHandler(this);
-
- if (usePointerEvent()) {
- mountHandlers(pointerHandlerNames, this);
- }
- else if (useTouchEvent()) {
- mountHandlers(touchHandlerNames, this);
-
- // Handler of 'mouseout' event is needed in touch mode, which will be mounted below.
- // addEventListener(root, 'mouseout', this._mouseoutHandler);
- }
-
- // Considering some devices that both enable touch and mouse event (like MS Surface
- // and lenovo X240, @see #2350), we make mouse event be always listened, otherwise
- // mouse event can not be handle in those devices.
- mountHandlers(mouseHandlerNames, this);
-
- Draggable.call(this);
-
- function mountHandlers(handlerNames, instance) {
- util.each(handlerNames, function (name) {
- addEventListener(root, eventNameFix(name), instance._handlers[name]);
- }, instance);
- }
- };
-
- Handler.prototype = {
-
- constructor: Handler,
-
- /**
- * Resize
- */
- resize: function (event) {
- this._hovered = null;
- },
-
- /**
- * Dispatch event
- * @param {string} eventName
- * @param {event=} eventArgs
- */
- dispatch: function (eventName, eventArgs) {
- var handler = this._handlers[eventName];
- handler && handler.call(this, eventArgs);
- },
-
- /**
- * Dispose
- */
- dispose: function () {
- var root = this.root;
-
- var handlerNames = mouseHandlerNames.concat(touchHandlerNames);
-
- for (var i = 0; i < handlerNames.length; i++) {
- var name = handlerNames[i];
- removeEventListener(root, eventNameFix(name), this._handlers[name]);
- }
-
- this.root =
- this.storage =
- this.painter = null;
- },
-
- /**
- * 设置默认的cursor style
- * @param {string} cursorStyle 例如 crosshair
- */
- setDefaultCursorStyle: function (cursorStyle) {
- this._defaultCursorStyle = cursorStyle;
- },
-
- /**
- * 事件分发代理
- *
- * @private
- * @param {Object} targetEl 目标图形元素
- * @param {string} eventName 事件名称
- * @param {Object} event 事件对象
- */
- _dispatchProxy: function (targetEl, eventName, event) {
- var eventHandler = 'on' + eventName;
- var eventPacket = makeEventPacket(eventName, targetEl, event);
-
- var el = targetEl;
-
- while (el) {
- el[eventHandler]
- && (eventPacket.cancelBubble = el[eventHandler].call(el, eventPacket));
-
- el.trigger(eventName, eventPacket);
-
- el = el.parent;
-
- if (eventPacket.cancelBubble) {
- break;
- }
- }
-
- if (!eventPacket.cancelBubble) {
- // 冒泡到顶级 zrender 对象
- this.trigger(eventName, eventPacket);
- // 分发事件到用户自定义层
- // 用户有可能在全局 click 事件中 dispose,所以需要判断下 painter 是否存在
- this.painter && this.painter.eachOtherLayer(function (layer) {
- if (typeof(layer[eventHandler]) == 'function') {
- layer[eventHandler].call(layer, eventPacket);
- }
- if (layer.trigger) {
- layer.trigger(eventName, eventPacket);
- }
- });
- }
- },
-
- /**
- * @private
- * @param {number} x
- * @param {number} y
- * @param {module:zrender/graphic/Displayable} exclude
- * @method
- */
- findHover: function(x, y, exclude) {
- var list = this.storage.getDisplayList();
- for (var i = list.length - 1; i >= 0 ; i--) {
- if (!list[i].silent
- && list[i] !== exclude
- // getDisplayList may include ignored item in VML mode
- && !list[i].ignore
- && isHover(list[i], x, y)) {
- return list[i];
- }
- }
- }
- };
-
- function isHover(displayable, x, y) {
- if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) {
- var p = displayable.parent;
- while (p) {
- if (p.clipPath && !p.clipPath.contain(x, y)) {
- // Clipped by parents
- return false;
- }
- p = p.parent;
- }
- return true;
- }
-
- return false;
- }
-
- /**
- * Prevent mouse event from being dispatched after Touch Events action
- * @see <https://github.com/deltakosh/handjs/blob/master/src/hand.base.js>
- * 1. Mobile browsers dispatch mouse events 300ms after touchend.
- * 2. Chrome for Android dispatch mousedown for long-touch about 650ms
- * Result: Blocking Mouse Events for 700ms.
- */
- function setTouchTimer(instance) {
- instance._touching = true;
- clearTimeout(instance._touchTimer);
- instance._touchTimer = setTimeout(function () {
- instance._touching = false;
- }, 700);
- }
-
- /**
- * Althought MS Surface support screen touch, IE10/11 do not support
- * touch event and MS Edge supported them but not by default (but chrome
- * and firefox do). Thus we use Pointer event on MS browsers to handle touch.
- */
- function usePointerEvent() {
- // TODO
- // pointermove event dont trigger when using finger.
- // We may figger it out latter.
- return false;
- // return env.pointerEventsSupported
- // In no-touch device we dont use pointer evnets but just
- // use mouse event for avoiding problems.
- // && window.navigator.maxTouchPoints;
- }
-
- function useTouchEvent() {
- return env.touchEventsSupported;
- }
-
- function eventNameFix(name) {
- return (name === 'mousewheel' && env.browser.firefox) ? 'DOMMouseScroll' : name;
- }
-
- util.mixin(Handler, Eventful);
- util.mixin(Handler, Draggable);
-
- module.exports = Handler;
-
-
-/***/ },
-/* 80 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * 事件辅助类
- * @module zrender/core/event
- * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
- */
-
-
- var Eventful = __webpack_require__(32);
-
- var isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener;
-
- function getBoundingClientRect(el) {
- // BlackBerry 5, iOS 3 (original iPhone) don't have getBoundingRect
- return el.getBoundingClientRect ? el.getBoundingClientRect() : { left: 0, top: 0};
- }
- /**
- * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标
- */
- function normalizeEvent(el, e) {
-
- e = e || window.event;
-
- if (e.zrX != null) {
- return e;
- }
-
- var eventType = e.type;
- var isTouch = eventType && eventType.indexOf('touch') >= 0;
-
- if (!isTouch) {
- var box = getBoundingClientRect(el);
- e.zrX = e.clientX - box.left;
- e.zrY = e.clientY - box.top;
- e.zrDelta = (e.wheelDelta) ? e.wheelDelta / 120 : -(e.detail || 0) / 3;
- }
- else {
- var touch = eventType != 'touchend'
- ? e.targetTouches[0]
- : e.changedTouches[0];
- if (touch) {
- var rBounding = getBoundingClientRect(el);
- // touch事件坐标是全屏的~
- e.zrX = touch.clientX - rBounding.left;
- e.zrY = touch.clientY - rBounding.top;
- }
- }
-
- return e;
- }
-
- function addEventListener(el, name, handler) {
- if (isDomLevel2) {
- el.addEventListener(name, handler);
- }
- else {
- el.attachEvent('on' + name, handler);
- }
- }
-
- function removeEventListener(el, name, handler) {
- if (isDomLevel2) {
- el.removeEventListener(name, handler);
- }
- else {
- el.detachEvent('on' + name, handler);
- }
- }
-
- /**
- * 停止冒泡和阻止默认行为
- * @memberOf module:zrender/core/event
- * @method
- * @param {Event} e : event对象
- */
- var stop = isDomLevel2
- ? function (e) {
- e.preventDefault();
- e.stopPropagation();
- e.cancelBubble = true;
- }
- : function (e) {
- e.returnValue = false;
- e.cancelBubble = true;
- };
-
- module.exports = {
- normalizeEvent: normalizeEvent,
- addEventListener: addEventListener,
- removeEventListener: removeEventListener,
-
- stop: stop,
- // 做向上兼容
- Dispatcher: Eventful
- };
-
-
-
-/***/ },
-/* 81 */
-/***/ function(module, exports) {
-
- // TODO Draggable for group
- // FIXME Draggable on element which has parent rotation or scale
-
- function Draggable() {
-
- this.on('mousedown', this._dragStart, this);
- this.on('mousemove', this._drag, this);
- this.on('mouseup', this._dragEnd, this);
- this.on('globalout', this._dragEnd, this);
- // this._dropTarget = null;
- // this._draggingTarget = null;
-
- // this._x = 0;
- // this._y = 0;
- }
-
- Draggable.prototype = {
-
- constructor: Draggable,
-
- _dragStart: function (e) {
- var draggingTarget = e.target;
- if (draggingTarget && draggingTarget.draggable) {
- this._draggingTarget = draggingTarget;
- draggingTarget.dragging = true;
- this._x = e.offsetX;
- this._y = e.offsetY;
-
- this._dispatchProxy(draggingTarget, 'dragstart', e.event);
- }
- },
-
- _drag: function (e) {
- var draggingTarget = this._draggingTarget;
- if (draggingTarget) {
-
- var x = e.offsetX;
- var y = e.offsetY;
-
- var dx = x - this._x;
- var dy = y - this._y;
- this._x = x;
- this._y = y;
-
- draggingTarget.drift(dx, dy, e);
- this._dispatchProxy(draggingTarget, 'drag', e.event);
-
- var dropTarget = this.findHover(x, y, draggingTarget);
- var lastDropTarget = this._dropTarget;
- this._dropTarget = dropTarget;
-
- if (draggingTarget !== dropTarget) {
- if (lastDropTarget && dropTarget !== lastDropTarget) {
- this._dispatchProxy(lastDropTarget, 'dragleave', e.event);
- }
- if (dropTarget && dropTarget !== lastDropTarget) {
- this._dispatchProxy(dropTarget, 'dragenter', e.event);
- }
- }
- }
- },
-
- _dragEnd: function (e) {
- var draggingTarget = this._draggingTarget;
-
- if (draggingTarget) {
- draggingTarget.dragging = false;
- }
-
- this._dispatchProxy(draggingTarget, 'dragend', e.event);
-
- if (this._dropTarget) {
- this._dispatchProxy(this._dropTarget, 'drop', e.event);
- }
-
- this._draggingTarget = null;
- this._dropTarget = null;
- }
-
- };
-
- module.exports = Draggable;
-
-
-/***/ },
-/* 82 */
-/***/ function(module, exports) {
-
- 'use strict';
- /**
- * Only implements needed gestures for mobile.
- */
-
-
- var GestureMgr = function () {
-
- /**
- * @private
- * @type {Array.<Object>}
- */
- this._track = [];
- };
-
- GestureMgr.prototype = {
-
- constructor: GestureMgr,
-
- recognize: function (event, target) {
- this._doTrack(event, target);
- return this._recognize(event);
- },
-
- clear: function () {
- this._track.length = 0;
- return this;
- },
-
- _doTrack: function (event, target) {
- var touches = event.touches;
-
- if (!touches) {
- return;
- }
-
- var trackItem = {
- points: [],
- touches: [],
- target: target,
- event: event
- };
-
- for (var i = 0, len = touches.length; i < len; i++) {
- var touch = touches[i];
- trackItem.points.push([touch.clientX, touch.clientY]);
- trackItem.touches.push(touch);
- }
-
- this._track.push(trackItem);
- },
-
- _recognize: function (event) {
- for (var eventName in recognizers) {
- if (recognizers.hasOwnProperty(eventName)) {
- var gestureInfo = recognizers[eventName](this._track, event);
- if (gestureInfo) {
- return gestureInfo;
- }
- }
- }
- }
- };
-
- function dist(pointPair) {
- var dx = pointPair[1][0] - pointPair[0][0];
- var dy = pointPair[1][1] - pointPair[0][1];
-
- return Math.sqrt(dx * dx + dy * dy);
- }
-
- function center(pointPair) {
- return [
- (pointPair[0][0] + pointPair[1][0]) / 2,
- (pointPair[0][1] + pointPair[1][1]) / 2
- ];
- }
-
- var recognizers = {
-
- pinch: function (track, event) {
- var trackLen = track.length;
-
- if (!trackLen) {
- return;
- }
-
- var pinchEnd = (track[trackLen - 1] || {}).points;
- var pinchPre = (track[trackLen - 2] || {}).points || pinchEnd;
-
- if (pinchPre
- && pinchPre.length > 1
- && pinchEnd
- && pinchEnd.length > 1
- ) {
- var pinchScale = dist(pinchEnd) / dist(pinchPre);
- !isFinite(pinchScale) && (pinchScale = 1);
-
- event.pinchScale = pinchScale;
-
- var pinchCenter = center(pinchEnd);
- event.pinchX = pinchCenter[0];
- event.pinchY = pinchCenter[1];
-
- return {
- type: 'pinch',
- target: track[0].target,
- event: event
- };
- }
- }
-
- // Only pinch currently.
- };
-
- module.exports = GestureMgr;
-
-
-
-/***/ },
-/* 83 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * Storage内容仓库模块
- * @module zrender/Storage
- * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
- * @author errorrik (errorrik@gmail.com)
- * @author pissang (https://github.com/pissang/)
- */
-
-
- var util = __webpack_require__(3);
-
- var Group = __webpack_require__(29);
-
- function shapeCompareFunc(a, b) {
- if (a.zlevel === b.zlevel) {
- if (a.z === b.z) {
- if (a.z2 === b.z2) {
- return a.__renderidx - b.__renderidx;
- }
- return a.z2 - b.z2;
- }
- return a.z - b.z;
- }
- return a.zlevel - b.zlevel;
- }
- /**
- * 内容仓库 (M)
- * @alias module:zrender/Storage
- * @constructor
- */
- var Storage = function () {
- // 所有常规形状,id索引的map
- this._elements = {};
-
- this._roots = [];
-
- this._displayList = [];
-
- this._displayListLen = 0;
- };
-
- Storage.prototype = {
-
- constructor: Storage,
-
- /**
- * 返回所有图形的绘制队列
- * @param {boolean} [update=false] 是否在返回前更新该数组
- * @param {boolean} [includeIgnore=false] 是否包含 ignore 的数组, 在 update 为 true 的时候有效
- *
- * 详见{@link module:zrender/graphic/Displayable.prototype.updateDisplayList}
- * @return {Array.<module:zrender/graphic/Displayable>}
- */
- getDisplayList: function (update, includeIgnore) {
- includeIgnore = includeIgnore || false;
- if (update) {
- this.updateDisplayList(includeIgnore);
- }
- return this._displayList;
- },
-
- /**
- * 更新图形的绘制队列。
- * 每次绘制前都会调用,该方法会先深度优先遍历整个树,更新所有Group和Shape的变换并且把所有可见的Shape保存到数组中,
- * 最后根据绘制的优先级(zlevel > z > 插入顺序)排序得到绘制队列
- * @param {boolean} [includeIgnore=false] 是否包含 ignore 的数组
- */
- updateDisplayList: function (includeIgnore) {
- this._displayListLen = 0;
- var roots = this._roots;
- var displayList = this._displayList;
- for (var i = 0, len = roots.length; i < len; i++) {
- this._updateAndAddDisplayable(roots[i], null, includeIgnore);
- }
- displayList.length = this._displayListLen;
-
- for (var i = 0, len = displayList.length; i < len; i++) {
- displayList[i].__renderidx = i;
- }
-
- displayList.sort(shapeCompareFunc);
- },
-
- _updateAndAddDisplayable: function (el, clipPaths, includeIgnore) {
-
- if (el.ignore && !includeIgnore) {
- return;
- }
-
- el.beforeUpdate();
-
- el.update();
-
- el.afterUpdate();
-
- var clipPath = el.clipPath;
- if (clipPath) {
- // clipPath 的变换是基于 group 的变换
- clipPath.parent = el;
- clipPath.updateTransform();
-
- // FIXME 效率影响
- if (clipPaths) {
- clipPaths = clipPaths.slice();
- clipPaths.push(clipPath);
- }
- else {
- clipPaths = [clipPath];
- }
- }
-
- if (el.type == 'group') {
- var children = el._children;
-
- for (var i = 0; i < children.length; i++) {
- var child = children[i];
-
- // Force to mark as dirty if group is dirty
- // FIXME __dirtyPath ?
- child.__dirty = el.__dirty || child.__dirty;
-
- this._updateAndAddDisplayable(child, clipPaths, includeIgnore);
- }
-
- // Mark group clean here
- el.__dirty = false;
-
- }
- else {
- el.__clipPaths = clipPaths;
-
- this._displayList[this._displayListLen++] = el;
- }
- },
-
- /**
- * 添加图形(Shape)或者组(Group)到根节点
- * @param {module:zrender/Element} el
- */
- addRoot: function (el) {
- // Element has been added
- if (this._elements[el.id]) {
- return;
- }
-
- if (el instanceof Group) {
- el.addChildrenToStorage(this);
- }
-
- this.addToMap(el);
- this._roots.push(el);
- },
-
- /**
- * 删除指定的图形(Shape)或者组(Group)
- * @param {string|Array.<string>} [elId] 如果为空清空整个Storage
- */
- delRoot: function (elId) {
- if (elId == null) {
- // 不指定elId清空
- for (var i = 0; i < this._roots.length; i++) {
- var root = this._roots[i];
- if (root instanceof Group) {
- root.delChildrenFromStorage(this);
- }
- }
-
- this._elements = {};
- this._roots = [];
- this._displayList = [];
- this._displayListLen = 0;
-
- return;
- }
-
- if (elId instanceof Array) {
- for (var i = 0, l = elId.length; i < l; i++) {
- this.delRoot(elId[i]);
- }
- return;
- }
-
- var el;
- if (typeof(elId) == 'string') {
- el = this._elements[elId];
- }
- else {
- el = elId;
- }
-
- var idx = util.indexOf(this._roots, el);
- if (idx >= 0) {
- this.delFromMap(el.id);
- this._roots.splice(idx, 1);
- if (el instanceof Group) {
- el.delChildrenFromStorage(this);
- }
- }
- },
-
- addToMap: function (el) {
- if (el instanceof Group) {
- el.__storage = this;
- }
- el.dirty();
-
- this._elements[el.id] = el;
-
- return this;
- },
-
- get: function (elId) {
- return this._elements[elId];
- },
-
- delFromMap: function (elId) {
- var elements = this._elements;
- var el = elements[elId];
- if (el) {
- delete elements[elId];
- if (el instanceof Group) {
- el.__storage = null;
- }
- }
-
- return this;
- },
-
- /**
- * 清空并且释放Storage
- */
- dispose: function () {
- this._elements =
- this._renderList =
- this._roots = null;
- }
- };
-
- module.exports = Storage;
-
-
-
-/***/ },
-/* 84 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * 动画主类, 调度和管理所有动画控制器
- *
- * @module zrender/animation/Animation
- * @author pissang(https://github.com/pissang)
- */
- // TODO Additive animation
- // http://iosoteric.com/additive-animations-animatewithduration-in-ios-8/
- // https://developer.apple.com/videos/wwdc2014/#236
-
-
- var util = __webpack_require__(3);
- var Dispatcher = __webpack_require__(80).Dispatcher;
-
- var requestAnimationFrame = (typeof window !== 'undefined' &&
- (window.requestAnimationFrame
- || window.msRequestAnimationFrame
- || window.mozRequestAnimationFrame
- || window.webkitRequestAnimationFrame))
- || function (func) {
- setTimeout(func, 16);
- };
-
- var Animator = __webpack_require__(35);
- /**
- * @typedef {Object} IZRenderStage
- * @property {Function} update
- */
-
- /**
- * @alias module:zrender/animation/Animation
- * @constructor
- * @param {Object} [options]
- * @param {Function} [options.onframe]
- * @param {IZRenderStage} [options.stage]
- * @example
- * var animation = new Animation();
- * var obj = {
- * x: 100,
- * y: 100
- * };
- * animation.animate(node.position)
- * .when(1000, {
- * x: 500,
- * y: 500
- * })
- * .when(2000, {
- * x: 100,
- * y: 100
- * })
- * .start('spline');
- */
- var Animation = function (options) {
-
- options = options || {};
-
- this.stage = options.stage || {};
-
- this.onframe = options.onframe || function() {};
-
- // private properties
- this._clips = [];
-
- this._running = false;
-
- this._time = 0;
-
- Dispatcher.call(this);
- };
-
- Animation.prototype = {
-
- constructor: Animation,
- /**
- * 添加 clip
- * @param {module:zrender/animation/Clip} clip
- */
- addClip: function (clip) {
- this._clips.push(clip);
- },
- /**
- * 添加 animator
- * @param {module:zrender/animation/Animator} animator
- */
- addAnimator: function (animator) {
- animator.animation = this;
- var clips = animator.getClips();
- for (var i = 0; i < clips.length; i++) {
- this.addClip(clips[i]);
- }
- },
- /**
- * 删除动画片段
- * @param {module:zrender/animation/Clip} clip
- */
- removeClip: function(clip) {
- var idx = util.indexOf(this._clips, clip);
- if (idx >= 0) {
- this._clips.splice(idx, 1);
- }
- },
-
- /**
- * 删除动画片段
- * @param {module:zrender/animation/Animator} animator
- */
- removeAnimator: function (animator) {
- var clips = animator.getClips();
- for (var i = 0; i < clips.length; i++) {
- this.removeClip(clips[i]);
- }
- animator.animation = null;
- },
-
- _update: function() {
-
- var time = new Date().getTime();
- var delta = time - this._time;
- var clips = this._clips;
- var len = clips.length;
-
- var deferredEvents = [];
- var deferredClips = [];
- for (var i = 0; i < len; i++) {
- var clip = clips[i];
- var e = clip.step(time);
- // Throw out the events need to be called after
- // stage.update, like destroy
- if (e) {
- deferredEvents.push(e);
- deferredClips.push(clip);
- }
- }
-
- // Remove the finished clip
- for (var i = 0; i < len;) {
- if (clips[i]._needsRemove) {
- clips[i] = clips[len - 1];
- clips.pop();
- len--;
- }
- else {
- i++;
- }
- }
-
- len = deferredEvents.length;
- for (var i = 0; i < len; i++) {
- deferredClips[i].fire(deferredEvents[i]);
- }
-
- this._time = time;
-
- this.onframe(delta);
-
- this.trigger('frame', delta);
-
- if (this.stage.update) {
- this.stage.update();
- }
- },
- /**
- * 开始运行动画
- */
- start: function () {
- var self = this;
-
- this._running = true;
-
- function step() {
- if (self._running) {
-
- requestAnimationFrame(step);
-
- self._update();
- }
- }
-
- this._time = new Date().getTime();
- requestAnimationFrame(step);
- },
- /**
- * 停止运行动画
- */
- stop: function () {
- this._running = false;
- },
- /**
- * 清除所有动画片段
- */
- clear: function () {
- this._clips = [];
- },
- /**
- * 对一个目标创建一个animator对象,可以指定目标中的属性使用动画
- * @param {Object} target
- * @param {Object} options
- * @param {boolean} [options.loop=false] 是否循环播放动画
- * @param {Function} [options.getter=null]
- * 如果指定getter函数,会通过getter函数取属性值
- * @param {Function} [options.setter=null]
- * 如果指定setter函数,会通过setter函数设置属性值
- * @return {module:zrender/animation/Animation~Animator}
- */
- animate: function (target, options) {
- options = options || {};
- var animator = new Animator(
- target,
- options.loop,
- options.getter,
- options.setter
- );
-
- return animator;
- }
- };
-
- util.mixin(Animation, Dispatcher);
-
- module.exports = Animation;
-
-
-
-/***/ },
-/* 85 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * Default canvas painter
- * @module zrender/Painter
- * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)
- * errorrik (errorrik@gmail.com)
- * pissang (https://www.github.com/pissang)
- */
-
-
- var config = __webpack_require__(40);
- var util = __webpack_require__(3);
- var log = __webpack_require__(39);
- var BoundingRect = __webpack_require__(15);
-
- var Layer = __webpack_require__(86);
-
- function parseInt10(val) {
- return parseInt(val, 10);
- }
-
- function isLayerValid(layer) {
- if (!layer) {
- return false;
- }
-
- if (layer.isBuildin) {
- return true;
- }
-
- if (typeof(layer.resize) !== 'function'
- || typeof(layer.refresh) !== 'function'
- ) {
- return false;
- }
-
- return true;
- }
-
- function preProcessLayer(layer) {
- layer.__unusedCount++;
- }
-
- function postProcessLayer(layer) {
- layer.__dirty = false;
- if (layer.__unusedCount == 1) {
- layer.clear();
- }
- }
-
- var tmpRect = new BoundingRect(0, 0, 0, 0);
- var viewRect = new BoundingRect(0, 0, 0, 0);
- function isDisplayableCulled(el, width, height) {
- tmpRect.copy(el.getBoundingRect());
- if (el.transform) {
- tmpRect.applyTransform(el.transform);
- }
- viewRect.width = width;
- viewRect.height = height;
- return !tmpRect.intersect(viewRect);
- }
-
- function isClipPathChanged(clipPaths, prevClipPaths) {
- if (!clipPaths || !prevClipPaths || (clipPaths.length !== prevClipPaths.length)) {
- return true;
- }
- for (var i = 0; i < clipPaths.length; i++) {
- if (clipPaths[i] !== prevClipPaths[i]) {
- return true;
- }
- }
- }
-
- function doClip(clipPaths, ctx) {
- for (var i = 0; i < clipPaths.length; i++) {
- var clipPath = clipPaths[i];
- var m;
- if (clipPath.transform) {
- m = clipPath.transform;
- ctx.transform(
- m[0], m[1],
- m[2], m[3],
- m[4], m[5]
- );
- }
- var path = clipPath.path;
- path.beginPath(ctx);
- clipPath.buildPath(path, clipPath.shape);
- ctx.clip();
- // Transform back
- if (clipPath.transform) {
- m = clipPath.invTransform;
- ctx.transform(
- m[0], m[1],
- m[2], m[3],
- m[4], m[5]
- );
- }
- }
- }
-
- /**
- * @alias module:zrender/Painter
- * @constructor
- * @param {HTMLElement} root 绘图容器
- * @param {module:zrender/Storage} storage
- * @param {Ojbect} opts
- */
- var Painter = function (root, storage, opts) {
- var singleCanvas = !root.nodeName // In node ?
- || root.nodeName.toUpperCase() === 'CANVAS';
-
- opts = opts || {};
-
- /**
- * @type {number}
- */
- this.dpr = opts.devicePixelRatio || config.devicePixelRatio;
- /**
- * @type {boolean}
- * @private
- */
- this._singleCanvas = singleCanvas;
- /**
- * 绘图容器
- * @type {HTMLElement}
- */
- this.root = root;
-
- var rootStyle = root.style;
-
- // In node environment using node-canvas
- if (rootStyle) {
- rootStyle['-webkit-tap-highlight-color'] = 'transparent';
- rootStyle['-webkit-user-select'] = 'none';
- rootStyle['user-select'] = 'none';
- rootStyle['-webkit-touch-callout'] = 'none';
-
- root.innerHTML = '';
- }
-
- /**
- * @type {module:zrender/Storage}
- */
- this.storage = storage;
-
- if (!singleCanvas) {
- var width = this._getWidth();
- var height = this._getHeight();
- this._width = width;
- this._height = height;
-
- var domRoot = document.createElement('div');
- this._domRoot = domRoot;
- var domRootStyle = domRoot.style;
-
- // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬
- domRootStyle.position = 'relative';
- domRootStyle.overflow = 'hidden';
- domRootStyle.width = this._width + 'px';
- domRootStyle.height = this._height + 'px';
- root.appendChild(domRoot);
-
- /**
- * @type {Object.<key, module:zrender/Layer>}
- * @private
- */
- this._layers = {};
- /**
- * @type {Array.<number>}
- * @private
- */
- this._zlevelList = [];
- }
- else {
- // Use canvas width and height directly
- var width = root.width;
- var height = root.height;
- this._width = width;
- this._height = height;
-
- // Create layer if only one given canvas
- // Device pixel ratio is fixed to 1 because given canvas has its specified width and height
- var mainLayer = new Layer(root, this, 1);
- mainLayer.initContext();
- // FIXME Use canvas width and height
- // mainLayer.resize(width, height);
- this._layers = {
- 0: mainLayer
- };
- this._zlevelList = [0];
- }
-
- this._layerConfig = {};
-
- this.pathToImage = this._createPathToImage();
- };
-
- Painter.prototype = {
-
- constructor: Painter,
-
- /**
- * If painter use a single canvas
- * @return {boolean}
- */
- isSingleCanvas: function () {
- return this._singleCanvas;
- },
- /**
- * @return {HTMLDivElement}
- */
- getViewportRoot: function () {
- return this._singleCanvas ? this._layers[0].dom : this._domRoot;
- },
-
- /**
- * 刷新
- * @param {boolean} [paintAll=false] 强制绘制所有displayable
- */
- refresh: function (paintAll) {
- var list = this.storage.getDisplayList(true);
- var zlevelList = this._zlevelList;
-
- this._paintList(list, paintAll);
-
- // Paint custum layers
- for (var i = 0; i < zlevelList.length; i++) {
- var z = zlevelList[i];
- var layer = this._layers[z];
- if (!layer.isBuildin && layer.refresh) {
- layer.refresh();
- }
- }
-
- return this;
- },
-
- _paintList: function (list, paintAll) {
-
- if (paintAll == null) {
- paintAll = false;
- }
-
- this._updateLayerStatus(list);
-
- var currentLayer;
- var currentZLevel;
- var ctx;
-
- var viewWidth = this._width;
- var viewHeight = this._height;
-
- this.eachBuildinLayer(preProcessLayer);
-
- // var invTransform = [];
- var prevElClipPaths = null;
-
- for (var i = 0, l = list.length; i < l; i++) {
- var el = list[i];
- var elZLevel = this._singleCanvas ? 0 : el.zlevel;
- // Change draw layer
- if (currentZLevel !== elZLevel) {
- // Only 0 zlevel if only has one canvas
- currentZLevel = elZLevel;
- currentLayer = this.getLayer(currentZLevel);
-
- if (!currentLayer.isBuildin) {
- log(
- 'ZLevel ' + currentZLevel
- + ' has been used by unkown layer ' + currentLayer.id
- );
- }
-
- ctx = currentLayer.ctx;
-
- // Reset the count
- currentLayer.__unusedCount = 0;
-
- if (currentLayer.__dirty || paintAll) {
- currentLayer.clear();
- }
- }
-
- if (
- (currentLayer.__dirty || paintAll)
- // Ignore invisible element
- && !el.invisible
- // Ignore transparent element
- && el.style.opacity !== 0
- // Ignore scale 0 element, in some environment like node-canvas
- // Draw a scale 0 element can cause all following draw wrong
- && el.scale[0] && el.scale[1]
- // Ignore culled element
- && !(el.culling && isDisplayableCulled(el, viewWidth, viewHeight))
- ) {
- var clipPaths = el.__clipPaths;
-
- // Optimize when clipping on group with several elements
- if (isClipPathChanged(clipPaths, prevElClipPaths)) {
- // If has previous clipping state, restore from it
- if (prevElClipPaths) {
- ctx.restore();
- }
- // New clipping state
- if (clipPaths) {
- ctx.save();
- doClip(clipPaths, ctx);
- }
- prevElClipPaths = clipPaths;
- }
- el.beforeBrush && el.beforeBrush(ctx);
- el.brush(ctx, false);
- el.afterBrush && el.afterBrush(ctx);
- }
-
- el.__dirty = false;
- }
-
- // If still has clipping state
- if (prevElClipPaths) {
- ctx.restore();
- }
-
- this.eachBuildinLayer(postProcessLayer);
- },
-
- /**
- * 获取 zlevel 所在层,如果不存在则会创建一个新的层
- * @param {number} zlevel
- * @return {module:zrender/Layer}
- */
- getLayer: function (zlevel) {
- if (this._singleCanvas) {
- return this._layers[0];
- }
-
- var layer = this._layers[zlevel];
- if (!layer) {
- // Create a new layer
- layer = new Layer('zr_' + zlevel, this, this.dpr);
- layer.isBuildin = true;
-
- if (this._layerConfig[zlevel]) {
- util.merge(layer, this._layerConfig[zlevel], true);
- }
-
- this.insertLayer(zlevel, layer);
-
- // Context is created after dom inserted to document
- // Or excanvas will get 0px clientWidth and clientHeight
- layer.initContext();
- }
-
- return layer;
- },
-
- insertLayer: function (zlevel, layer) {
-
- var layersMap = this._layers;
- var zlevelList = this._zlevelList;
- var len = zlevelList.length;
- var prevLayer = null;
- var i = -1;
- var domRoot = this._domRoot;
-
- if (layersMap[zlevel]) {
- log('ZLevel ' + zlevel + ' has been used already');
- return;
- }
- // Check if is a valid layer
- if (!isLayerValid(layer)) {
- log('Layer of zlevel ' + zlevel + ' is not valid');
- return;
- }
-
- if (len > 0 && zlevel > zlevelList[0]) {
- for (i = 0; i < len - 1; i++) {
- if (
- zlevelList[i] < zlevel
- && zlevelList[i + 1] > zlevel
- ) {
- break;
- }
- }
- prevLayer = layersMap[zlevelList[i]];
- }
- zlevelList.splice(i + 1, 0, zlevel);
-
- if (prevLayer) {
- var prevDom = prevLayer.dom;
- if (prevDom.nextSibling) {
- domRoot.insertBefore(
- layer.dom,
- prevDom.nextSibling
- );
- }
- else {
- domRoot.appendChild(layer.dom);
- }
- }
- else {
- if (domRoot.firstChild) {
- domRoot.insertBefore(layer.dom, domRoot.firstChild);
- }
- else {
- domRoot.appendChild(layer.dom);
- }
- }
-
- layersMap[zlevel] = layer;
- },
-
- // Iterate each layer
- eachLayer: function (cb, context) {
- var zlevelList = this._zlevelList;
- var z;
- var i;
- for (i = 0; i < zlevelList.length; i++) {
- z = zlevelList[i];
- cb.call(context, this._layers[z], z);
- }
- },
-
- // Iterate each buildin layer
- eachBuildinLayer: function (cb, context) {
- var zlevelList = this._zlevelList;
- var layer;
- var z;
- var i;
- for (i = 0; i < zlevelList.length; i++) {
- z = zlevelList[i];
- layer = this._layers[z];
- if (layer.isBuildin) {
- cb.call(context, layer, z);
- }
- }
- },
-
- // Iterate each other layer except buildin layer
- eachOtherLayer: function (cb, context) {
- var zlevelList = this._zlevelList;
- var layer;
- var z;
- var i;
- for (i = 0; i < zlevelList.length; i++) {
- z = zlevelList[i];
- layer = this._layers[z];
- if (! layer.isBuildin) {
- cb.call(context, layer, z);
- }
- }
- },
-
- /**
- * 获取所有已创建的层
- * @param {Array.<module:zrender/Layer>} [prevLayer]
- */
- getLayers: function () {
- return this._layers;
- },
-
- _updateLayerStatus: function (list) {
-
- var layers = this._layers;
-
- var elCounts = {};
-
- this.eachBuildinLayer(function (layer, z) {
- elCounts[z] = layer.elCount;
- layer.elCount = 0;
- });
-
- for (var i = 0, l = list.length; i < l; i++) {
- var el = list[i];
- var zlevel = this._singleCanvas ? 0 : el.zlevel;
- var layer = layers[zlevel];
- if (layer) {
- layer.elCount++;
- // 已经被标记为需要刷新
- if (layer.__dirty) {
- continue;
- }
- layer.__dirty = el.__dirty;
- }
- }
-
- // 层中的元素数量有发生变化
- this.eachBuildinLayer(function (layer, z) {
- if (elCounts[z] !== layer.elCount) {
- layer.__dirty = true;
- }
- });
- },
-
- /**
- * 清除hover层外所有内容
- */
- clear: function () {
- this.eachBuildinLayer(this._clearLayer);
- return this;
- },
-
- _clearLayer: function (layer) {
- layer.clear();
- },
-
- /**
- * 修改指定zlevel的绘制参数
- *
- * @param {string} zlevel
- * @param {Object} config 配置对象
- * @param {string} [config.clearColor=0] 每次清空画布的颜色
- * @param {string} [config.motionBlur=false] 是否开启动态模糊
- * @param {number} [config.lastFrameAlpha=0.7]
- * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显
- */
- configLayer: function (zlevel, config) {
- if (config) {
- var layerConfig = this._layerConfig;
- if (!layerConfig[zlevel]) {
- layerConfig[zlevel] = config;
- }
- else {
- util.merge(layerConfig[zlevel], config, true);
- }
-
- var layer = this._layers[zlevel];
-
- if (layer) {
- util.merge(layer, layerConfig[zlevel], true);
- }
- }
- },
-
- /**
- * 删除指定层
- * @param {number} zlevel 层所在的zlevel
- */
- delLayer: function (zlevel) {
- var layers = this._layers;
- var zlevelList = this._zlevelList;
- var layer = layers[zlevel];
- if (!layer) {
- return;
- }
- layer.dom.parentNode.removeChild(layer.dom);
- delete layers[zlevel];
-
- zlevelList.splice(util.indexOf(zlevelList, zlevel), 1);
- },
-
- /**
- * 区域大小变化后重绘
- */
- resize: function (width, height) {
- var domRoot = this._domRoot;
- // FIXME Why ?
- domRoot.style.display = 'none';
-
- width = width || this._getWidth();
- height = height || this._getHeight();
-
- domRoot.style.display = '';
-
- // 优化没有实际改变的resize
- if (this._width != width || height != this._height) {
- domRoot.style.width = width + 'px';
- domRoot.style.height = height + 'px';
-
- for (var id in this._layers) {
- this._layers[id].resize(width, height);
- }
-
- this.refresh(true);
- }
-
- this._width = width;
- this._height = height;
-
- return this;
- },
-
- /**
- * 清除单独的一个层
- * @param {number} zlevel
- */
- clearLayer: function (zlevel) {
- var layer = this._layers[zlevel];
- if (layer) {
- layer.clear();
- }
- },
-
- /**
- * 释放
- */
- dispose: function () {
- this.root.innerHTML = '';
-
- this.root =
- this.storage =
-
- this._domRoot =
- this._layers = null;
- },
-
- /**
- * Get canvas which has all thing rendered
- * @param {Object} opts
- * @param {string} [opts.backgroundColor]
- */
- getRenderedCanvas: function (opts) {
- opts = opts || {};
- if (this._singleCanvas) {
- return this._layers[0].dom;
- }
-
- var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);
- imageLayer.initContext();
-
- var ctx = imageLayer.ctx;
- imageLayer.clearColor = opts.backgroundColor;
- imageLayer.clear();
-
- var displayList = this.storage.getDisplayList(true);
-
- for (var i = 0; i < displayList.length; i++) {
- var el = displayList[i];
- if (!el.invisible) {
- el.beforeBrush && el.beforeBrush(ctx);
- // TODO Check image cross origin
- el.brush(ctx, false);
- el.afterBrush && el.afterBrush(ctx);
- }
- }
-
- return imageLayer.dom;
- },
- /**
- * 获取绘图区域宽度
- */
- getWidth: function () {
- return this._width;
- },
-
- /**
- * 获取绘图区域高度
- */
- getHeight: function () {
- return this._height;
- },
-
- _getWidth: function () {
- var root = this.root;
- var stl = document.defaultView.getComputedStyle(root);
-
- // FIXME Better way to get the width and height when element has not been append to the document
- return ((root.clientWidth || parseInt10(stl.width) || parseInt10(root.style.width))
- - (parseInt10(stl.paddingLeft) || 0)
- - (parseInt10(stl.paddingRight) || 0)) | 0;
- },
-
- _getHeight: function () {
- var root = this.root;
- var stl = document.defaultView.getComputedStyle(root);
-
- return ((root.clientHeight || parseInt10(stl.height) || parseInt10(root.style.height))
- - (parseInt10(stl.paddingTop) || 0)
- - (parseInt10(stl.paddingBottom) || 0)) | 0;
- },
-
- _pathToImage: function (id, path, width, height, dpr) {
- var canvas = document.createElement('canvas');
- var ctx = canvas.getContext('2d');
-
- canvas.width = width * dpr;
- canvas.height = height * dpr;
-
- ctx.clearRect(0, 0, width * dpr, height * dpr);
-
- var pathTransform = {
- position: path.position,
- rotation: path.rotation,
- scale: path.scale
- };
- path.position = [0, 0, 0];
- path.rotation = 0;
- path.scale = [1, 1];
- if (path) {
- path.brush(ctx);
- }
-
- var ImageShape = __webpack_require__(59);
- var imgShape = new ImageShape({
- id: id,
- style: {
- x: 0,
- y: 0,
- image: canvas
- }
- });
-
- if (pathTransform.position != null) {
- imgShape.position = path.position = pathTransform.position;
- }
-
- if (pathTransform.rotation != null) {
- imgShape.rotation = path.rotation = pathTransform.rotation;
- }
-
- if (pathTransform.scale != null) {
- imgShape.scale = path.scale = pathTransform.scale;
- }
-
- return imgShape;
- },
-
- _createPathToImage: function () {
- var me = this;
-
- return function (id, e, width, height) {
- return me._pathToImage(
- id, e, width, height, me.dpr
- );
- };
- }
- };
-
- module.exports = Painter;
-
-
-
-/***/ },
-/* 86 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @module zrender/Layer
- * @author pissang(https://www.github.com/pissang)
- */
-
-
- var util = __webpack_require__(3);
- var config = __webpack_require__(40);
-
- function returnFalse() {
- return false;
- }
-
- /**
- * 创建dom
- *
- * @inner
- * @param {string} id dom id 待用
- * @param {string} type dom type,such as canvas, div etc.
- * @param {Painter} painter painter instance
- * @param {number} number
- */
- function createDom(id, type, painter, dpr) {
- var newDom = document.createElement(type);
- var width = painter.getWidth();
- var height = painter.getHeight();
-
- var newDomStyle = newDom.style;
- // 没append呢,请原谅我这样写,清晰~
- newDomStyle.position = 'absolute';
- newDomStyle.left = 0;
- newDomStyle.top = 0;
- newDomStyle.width = width + 'px';
- newDomStyle.height = height + 'px';
- newDom.width = width * dpr;
- newDom.height = height * dpr;
-
- // id不作为索引用,避免可能造成的重名,定义为私有属性
- newDom.setAttribute('data-zr-dom-id', id);
- return newDom;
- }
-
- /**
- * @alias module:zrender/Layer
- * @constructor
- * @extends module:zrender/mixin/Transformable
- * @param {string} id
- * @param {module:zrender/Painter} painter
- * @param {number} [dpr]
- */
- var Layer = function(id, painter, dpr) {
- var dom;
- dpr = dpr || config.devicePixelRatio;
- if (typeof id === 'string') {
- dom = createDom(id, 'canvas', painter, dpr);
- }
- // Not using isDom because in node it will return false
- else if (util.isObject(id)) {
- dom = id;
- id = dom.id;
- }
- this.id = id;
- this.dom = dom;
-
- var domStyle = dom.style;
- if (domStyle) { // Not in node
- dom.onselectstart = returnFalse; // 避免页面选中的尴尬
- domStyle['-webkit-user-select'] = 'none';
- domStyle['user-select'] = 'none';
- domStyle['-webkit-touch-callout'] = 'none';
- domStyle['-webkit-tap-highlight-color'] = 'rgba(0,0,0,0)';
- }
-
- this.domBack = null;
- this.ctxBack = null;
-
- this.painter = painter;
-
- this.config = null;
-
- // Configs
- /**
- * 每次清空画布的颜色
- * @type {string}
- * @default 0
- */
- this.clearColor = 0;
- /**
- * 是否开启动态模糊
- * @type {boolean}
- * @default false
- */
- this.motionBlur = false;
- /**
- * 在开启动态模糊的时候使用,与上一帧混合的alpha值,值越大尾迹越明显
- * @type {number}
- * @default 0.7
- */
- this.lastFrameAlpha = 0.7;
-
- /**
- * Layer dpr
- * @type {number}
- */
- this.dpr = dpr;
- };
-
- Layer.prototype = {
-
- constructor: Layer,
-
- elCount: 0,
-
- __dirty: true,
-
- initContext: function () {
- this.ctx = this.dom.getContext('2d');
-
- var dpr = this.dpr;
- if (dpr != 1) {
- this.ctx.scale(dpr, dpr);
- }
- },
-
- createBackBuffer: function () {
- var dpr = this.dpr;
-
- this.domBack = createDom('back-' + this.id, 'canvas', this.painter, dpr);
- this.ctxBack = this.domBack.getContext('2d');
-
- if (dpr != 1) {
- this.ctxBack.scale(dpr, dpr);
- }
- },
-
- /**
- * @param {number} width
- * @param {number} height
- */
- resize: function (width, height) {
- var dpr = this.dpr;
-
- var dom = this.dom;
- var domStyle = dom.style;
- var domBack = this.domBack;
-
- domStyle.width = width + 'px';
- domStyle.height = height + 'px';
-
- dom.width = width * dpr;
- dom.height = height * dpr;
-
- if (dpr != 1) {
- this.ctx.scale(dpr, dpr);
- }
-
- if (domBack) {
- domBack.width = width * dpr;
- domBack.height = height * dpr;
-
- if (dpr != 1) {
- this.ctxBack.scale(dpr, dpr);
- }
- }
- },
-
- /**
- * 清空该层画布
- * @param {boolean} clearAll Clear all with out motion blur
- */
- clear: function (clearAll) {
- var dom = this.dom;
- var ctx = this.ctx;
- var width = dom.width;
- var height = dom.height;
-
- var haveClearColor = this.clearColor;
- var haveMotionBLur = this.motionBlur && !clearAll;
- var lastFrameAlpha = this.lastFrameAlpha;
-
- var dpr = this.dpr;
-
- if (haveMotionBLur) {
- if (!this.domBack) {
- this.createBackBuffer();
- }
-
- this.ctxBack.globalCompositeOperation = 'copy';
- this.ctxBack.drawImage(
- dom, 0, 0,
- width / dpr,
- height / dpr
- );
- }
-
- ctx.clearRect(0, 0, width / dpr, height / dpr);
- if (haveClearColor) {
- ctx.save();
- ctx.fillStyle = this.clearColor;
- ctx.fillRect(0, 0, width / dpr, height / dpr);
- ctx.restore();
- }
-
- if (haveMotionBLur) {
- var domBack = this.domBack;
- ctx.save();
- ctx.globalAlpha = lastFrameAlpha;
- ctx.drawImage(domBack, 0, 0, width / dpr, height / dpr);
- ctx.restore();
- }
- }
- };
-
- module.exports = Layer;
-
-
-/***/ },
-/* 87 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var graphic = __webpack_require__(42);
- var zrUtil = __webpack_require__(3);
- var PI = Math.PI;
- /**
- * @param {module:echarts/ExtensionAPI} api
- * @param {Object} [opts]
- * @param {string} [opts.text]
- * @param {string} [opts.color]
- * @param {string} [opts.textColor]
- * @return {module:zrender/Element}
- */
- module.exports = function (api, opts) {
- opts = opts || {};
- zrUtil.defaults(opts, {
- text: 'loading',
- color: '#c23531',
- textColor: '#000',
- maskColor: 'rgba(255, 255, 255, 0.8)',
- zlevel: 0
- });
- var mask = new graphic.Rect({
- style: {
- fill: opts.maskColor
- },
- zlevel: opts.zlevel,
- z: 10000
- });
- var arc = new graphic.Arc({
- shape: {
- startAngle: -PI / 2,
- endAngle: -PI / 2 + 0.1,
- r: 10
- },
- style: {
- stroke: opts.color,
- lineCap: 'round',
- lineWidth: 5
- },
- zlevel: opts.zlevel,
- z: 10001
- });
- var labelRect = new graphic.Rect({
- style: {
- fill: 'none',
- text: opts.text,
- textPosition: 'right',
- textDistance: 10,
- textFill: opts.textColor
- },
- zlevel: opts.zlevel,
- z: 10001
- });
-
- arc.animateShape(true)
- .when(1000, {
- endAngle: PI * 3 / 2
- })
- .start('circularInOut');
- arc.animateShape(true)
- .when(1000, {
- startAngle: PI * 3 / 2
- })
- .delay(300)
- .start('circularInOut');
-
- var group = new graphic.Group();
- group.add(arc);
- group.add(labelRect);
- group.add(mask);
- // Inject resize
- group.resize = function () {
- var cx = api.getWidth() / 2;
- var cy = api.getHeight() / 2;
- arc.setShape({
- cx: cx,
- cy: cy
- });
- var r = arc.shape.r;
- labelRect.setShape({
- x: cx - r,
- y: cy - r,
- width: r * 2,
- height: r * 2
- });
-
- mask.setShape({
- x: 0,
- y: 0,
- width: api.getWidth(),
- height: api.getHeight()
- });
- };
- group.resize();
- return group;
- };
-
-
-/***/ },
-/* 88 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- var Gradient = __webpack_require__(4);
- module.exports = function (seriesType, styleType, ecModel) {
- function encodeColor(seriesModel) {
- var colorAccessPath = [styleType, 'normal', 'color'];
- var colorList = ecModel.get('color');
- var data = seriesModel.getData();
- var color = seriesModel.get(colorAccessPath) // Set in itemStyle
- || colorList[seriesModel.seriesIndex % colorList.length]; // Default color
-
- // FIXME Set color function or use the platte color
- data.setVisual('color', color);
-
- // Only visible series has each data be visual encoded
- if (!ecModel.isSeriesFiltered(seriesModel)) {
- if (typeof color === 'function' && !(color instanceof Gradient)) {
- data.each(function (idx) {
- data.setItemVisual(
- idx, 'color', color(seriesModel.getDataParams(idx))
- );
- });
- }
-
- data.each(function (idx) {
- var itemModel = data.getItemModel(idx);
- var color = itemModel.get(colorAccessPath, true);
- if (color != null) {
- data.setItemVisual(idx, 'color', color);
- }
- });
- }
- }
- seriesType ? ecModel.eachSeriesByType(seriesType, encodeColor)
- : ecModel.eachSeries(encodeColor);
- };
-
-
-/***/ },
-/* 89 */
-/***/ function(module, exports, __webpack_require__) {
-
- // Compatitable with 2.0
-
-
- var zrUtil = __webpack_require__(3);
- var compatStyle = __webpack_require__(90);
-
- function get(opt, path) {
- path = path.split(',');
- var obj = opt;
- for (var i = 0; i < path.length; i++) {
- obj = obj && obj[path[i]];
- if (obj == null) {
- break;
- }
- }
- return obj;
- }
-
- function set(opt, path, val, overwrite) {
- path = path.split(',');
- var obj = opt;
- var key;
- for (var i = 0; i < path.length - 1; i++) {
- key = path[i];
- if (obj[key] == null) {
- obj[key] = {};
- }
- obj = obj[key];
- }
- if (overwrite || obj[path[i]] == null) {
- obj[path[i]] = val;
- }
- }
-
- function compatLayoutProperties(option) {
- each(LAYOUT_PROPERTIES, function (prop) {
- if (prop[0] in option && !(prop[1] in option)) {
- option[prop[1]] = option[prop[0]];
- }
- });
- }
-
- var LAYOUT_PROPERTIES = [
- ['x', 'left'], ['y', 'top'], ['x2', 'right'], ['y2', 'bottom']
- ];
-
- var COMPATITABLE_COMPONENTS = [
- 'grid', 'geo', 'parallel', 'legend', 'toolbox', 'title', 'visualMap', 'dataZoom', 'timeline'
- ];
-
- var COMPATITABLE_SERIES = [
- 'bar', 'boxplot', 'candlestick', 'chord', 'effectScatter',
- 'funnel', 'gauge', 'lines', 'graph', 'heatmap', 'line', 'map', 'parallel',
- 'pie', 'radar', 'sankey', 'scatter', 'treemap'
- ];
-
- var each = zrUtil.each;
-
- module.exports = function (option) {
- each(option.series, function (seriesOpt) {
- if (!zrUtil.isObject(seriesOpt)) {
- return;
- }
-
- var seriesType = seriesOpt.type;
-
- compatStyle(seriesOpt);
-
- if (seriesType === 'pie' || seriesType === 'gauge') {
- if (seriesOpt.clockWise != null) {
- seriesOpt.clockwise = seriesOpt.clockWise;
- }
- }
- if (seriesType === 'gauge') {
- var pointerColor = get(seriesOpt, 'pointer.color');
- pointerColor != null
- && set(seriesOpt, 'itemStyle.normal.color', pointerColor);
- }
-
- for (var i = 0; i < COMPATITABLE_SERIES.length; i++) {
- if (COMPATITABLE_SERIES[i] === seriesOpt.type) {
- compatLayoutProperties(seriesOpt);
- break;
- }
- }
- });
-
- // dataRange has changed to visualMap
- if (option.dataRange) {
- option.visualMap = option.dataRange;
- }
-
- each(COMPATITABLE_COMPONENTS, function (componentName) {
- var options = option[componentName];
- if (options) {
- if (!zrUtil.isArray(options)) {
- options = [options];
- }
- each(options, function (option) {
- compatLayoutProperties(option);
- });
- }
- });
- };
-
-
-/***/ },
-/* 90 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
-
- var POSSIBLE_STYLES = [
- 'areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle',
- 'chordStyle', 'label', 'labelLine'
- ];
-
- function compatItemStyle(opt) {
- var itemStyleOpt = opt && opt.itemStyle;
- if (itemStyleOpt) {
- zrUtil.each(POSSIBLE_STYLES, function (styleName) {
- var normalItemStyleOpt = itemStyleOpt.normal;
- var emphasisItemStyleOpt = itemStyleOpt.emphasis;
- if (normalItemStyleOpt && normalItemStyleOpt[styleName]) {
- opt[styleName] = opt[styleName] || {};
- if (!opt[styleName].normal) {
- opt[styleName].normal = normalItemStyleOpt[styleName];
- }
- else {
- zrUtil.merge(opt[styleName].normal, normalItemStyleOpt[styleName]);
- }
- normalItemStyleOpt[styleName] = null;
- }
- if (emphasisItemStyleOpt && emphasisItemStyleOpt[styleName]) {
- opt[styleName] = opt[styleName] || {};
- if (!opt[styleName].emphasis) {
- opt[styleName].emphasis = emphasisItemStyleOpt[styleName];
- }
- else {
- zrUtil.merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]);
- }
- emphasisItemStyleOpt[styleName] = null;
- }
- });
- }
- }
-
- module.exports = function (seriesOpt) {
- if (!seriesOpt) {
- return;
- }
- compatItemStyle(seriesOpt);
- compatItemStyle(seriesOpt.markPoint);
- compatItemStyle(seriesOpt.markLine);
- var data = seriesOpt.data;
- if (data) {
- for (var i = 0; i < data.length; i++) {
- compatItemStyle(data[i]);
- }
- // mark point data
- var markPoint = seriesOpt.markPoint;
- if (markPoint && markPoint.data) {
- var mpData = markPoint.data;
- for (var i = 0; i < mpData.length; i++) {
- compatItemStyle(mpData[i]);
- }
- }
- // mark line data
- var markLine = seriesOpt.markLine;
- if (markLine && markLine.data) {
- var mlData = markLine.data;
- for (var i = 0; i < mlData.length; i++) {
- if (zrUtil.isArray(mlData[i])) {
- compatItemStyle(mlData[i][0]);
- compatItemStyle(mlData[i][1]);
- }
- else {
- compatItemStyle(mlData[i]);
- }
- }
- }
- }
- };
-
-
-/***/ },
-/* 91 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var echarts = __webpack_require__(1);
-
- __webpack_require__(92);
- __webpack_require__(97);
-
- echarts.registerVisualCoding('chart', zrUtil.curry(
- __webpack_require__(103), 'line', 'circle', 'line'
- ));
- echarts.registerLayout(zrUtil.curry(
- __webpack_require__(104), 'line'
- ));
-
- // Down sample after filter
- echarts.registerProcessor('statistic', zrUtil.curry(
- __webpack_require__(105), 'line'
- ));
-
- // In case developer forget to include grid component
- __webpack_require__(106);
-
-
-/***/ },
-/* 92 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var createListFromArray = __webpack_require__(93);
- var SeriesModel = __webpack_require__(27);
-
- module.exports = SeriesModel.extend({
-
- type: 'series.line',
-
- dependencies: ['grid', 'polar'],
-
- getInitialData: function (option, ecModel) {
- return createListFromArray(option.data, this, ecModel);
- },
-
- defaultOption: {
- zlevel: 0, // 一级层叠
- z: 2, // 二级层叠
- coordinateSystem: 'cartesian2d',
- legendHoverLink: true,
-
- hoverAnimation: true,
- // stack: null
- xAxisIndex: 0,
- yAxisIndex: 0,
-
- polarIndex: 0,
-
- // If clip the overflow value
- clipOverflow: true,
-
- label: {
- normal: {
- // show: false,
- position: 'top'
- // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
- // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
- // 'inside'|'left'|'right'|'top'|'bottom'
- // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
- }
- // emphasis: {
- // show: false,
- // position: 'top'
- // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
- // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
- // 'inside'|'left'|'right'|'top'|'bottom'
- // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
- // }
- },
- // itemStyle: {
- // normal: {
- // // color: 各异
- // },
- // emphasis: {
- // // color: 各异,
- // }
- // },
- lineStyle: {
- normal: {
- width: 2,
- type: 'solid'
- }
- },
- // areaStyle: {
- // },
- // smooth: false,
- // smoothMonotone: null,
- // 拐点图形类型
- symbol: 'emptyCircle',
- // 拐点图形大小
- symbolSize: 4,
- // 拐点图形旋转控制
- // symbolRotate: null,
-
- // 是否显示 symbol, 只有在 tooltip hover 的时候显示
- showSymbol: true,
- // 标志图形默认只有主轴显示(随主轴标签间隔隐藏策略)
- // showAllSymbol: false
- //
- // 大数据过滤,'average', 'max', 'min', 'sum'
- // sampling: 'none'
-
- animationEasing: 'linear'
- }
- });
-
-
-/***/ },
-/* 93 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var List = __webpack_require__(94);
- var completeDimensions = __webpack_require__(96);
- var zrUtil = __webpack_require__(3);
- var modelUtil = __webpack_require__(5);
- var CoordinateSystem = __webpack_require__(25);
- var getDataItemValue = modelUtil.getDataItemValue;
- var converDataValue = modelUtil.converDataValue;
-
- function firstDataNotNull(data) {
- var i = 0;
- while (i < data.length && data[i] == null) {
- i++;
- }
- return data[i];
- }
- function ifNeedCompleteOrdinalData(data) {
- var sampleItem = firstDataNotNull(data);
- return sampleItem != null
- && !zrUtil.isArray(getDataItemValue(sampleItem));
- }
-
- /**
- * Helper function to create a list from option data
- */
- function createListFromArray(data, seriesModel, ecModel) {
- // If data is undefined
- data = data || [];
-
- var coordSysName = seriesModel.get('coordinateSystem');
- var creator = creators[coordSysName];
- var registeredCoordSys = CoordinateSystem.get(coordSysName);
- // FIXME
- var result = creator && creator(data, seriesModel, ecModel);
- var dimensions = result && result.dimensions;
- if (!dimensions) {
- // Get dimensions from registered coordinate system
- dimensions = (registeredCoordSys && registeredCoordSys.dimensions) || ['x', 'y'];
- dimensions = completeDimensions(dimensions, data, dimensions.concat(['value']));
- }
- var categoryAxisModel = result && result.categoryAxisModel;
-
- var categoryDimIndex = dimensions[0].type === 'ordinal'
- ? 0 : (dimensions[1].type === 'ordinal' ? 1 : -1);
-
- var list = new List(dimensions, seriesModel);
-
- var nameList = createNameList(result, data);
-
- var dimValueGetter = (categoryAxisModel && ifNeedCompleteOrdinalData(data))
- ? function (itemOpt, dimName, dataIndex, dimIndex) {
- // Use dataIndex as ordinal value in categoryAxis
- return dimIndex === categoryDimIndex
- ? dataIndex
- : converDataValue(getDataItemValue(itemOpt), dimensions[dimIndex]);
- }
- : function (itemOpt, dimName, dataIndex, dimIndex) {
- var val = getDataItemValue(itemOpt);
- return converDataValue(val && val[dimIndex], dimensions[dimIndex]);
- };
-
- list.initData(data, nameList, dimValueGetter);
-
- return list;
- }
-
- function isStackable(axisType) {
- return axisType !== 'category' && axisType !== 'time';
- }
-
- function getDimTypeByAxis(axisType) {
- return axisType === 'category'
- ? 'ordinal'
- : axisType === 'time'
- ? 'time'
- : 'float';
- }
-
- /**
- * Creaters for each coord system.
- * @return {Object} {dimensions, categoryAxisModel};
- */
- var creators = {
-
- cartesian2d: function (data, seriesModel, ecModel) {
- var xAxisModel = ecModel.getComponent('xAxis', seriesModel.get('xAxisIndex'));
- var yAxisModel = ecModel.getComponent('yAxis', seriesModel.get('yAxisIndex'));
- var xAxisType = xAxisModel.get('type');
- var yAxisType = yAxisModel.get('type');
-
- var dimensions = [
- {
- name: 'x',
- type: getDimTypeByAxis(xAxisType),
- stackable: isStackable(xAxisType)
- },
- {
- name: 'y',
- // If two category axes
- type: getDimTypeByAxis(yAxisType),
- stackable: isStackable(yAxisType)
- }
- ];
-
- var isXAxisCateogry = xAxisType === 'category';
-
- completeDimensions(dimensions, data, ['x', 'y', 'z']);
-
- return {
- dimensions: dimensions,
- categoryIndex: isXAxisCateogry ? 0 : 1,
- categoryAxisModel: isXAxisCateogry
- ? xAxisModel
- : (yAxisType === 'category' ? yAxisModel : null)
- };
- },
-
- polar: function (data, seriesModel, ecModel) {
- var polarIndex = seriesModel.get('polarIndex') || 0;
-
- var axisFinder = function (axisModel) {
- return axisModel.get('polarIndex') === polarIndex;
- };
-
- var angleAxisModel = ecModel.findComponents({
- mainType: 'angleAxis', filter: axisFinder
- })[0];
- var radiusAxisModel = ecModel.findComponents({
- mainType: 'radiusAxis', filter: axisFinder
- })[0];
-
- var radiusAxisType = radiusAxisModel.get('type');
- var angleAxisType = angleAxisModel.get('type');
-
- var dimensions = [
- {
- name: 'radius',
- type: getDimTypeByAxis(radiusAxisType),
- stackable: isStackable(radiusAxisType)
- },
- {
- name: 'angle',
- type: getDimTypeByAxis(angleAxisType),
- stackable: isStackable(angleAxisType)
- }
- ];
- var isAngleAxisCateogry = angleAxisType === 'category';
-
- completeDimensions(dimensions, data, ['radius', 'angle', 'value']);
-
- return {
- dimensions: dimensions,
- categoryIndex: isAngleAxisCateogry ? 1 : 0,
- categoryAxisModel: isAngleAxisCateogry
- ? angleAxisModel
- : (radiusAxisType === 'category' ? radiusAxisModel : null)
- };
- },
-
- geo: function (data, seriesModel, ecModel) {
- // TODO Region
- // 多个散点图系列在同一个地区的时候
- return {
- dimensions: completeDimensions([
- {name: 'lng'},
- {name: 'lat'}
- ], data, ['lng', 'lat', 'value'])
- };
- }
- };
-
- function createNameList(result, data) {
- var nameList = [];
-
- if (result && result.categoryAxisModel) {
- // FIXME Two category axis
- var categories = result.categoryAxisModel.getCategories();
- if (categories) {
- var dataLen = data.length;
- // Ordered data is given explicitly like
- // [[3, 0.2], [1, 0.3], [2, 0.15]]
- // or given scatter data,
- // pick the category
- if (zrUtil.isArray(data[0]) && data[0].length > 1) {
- nameList = [];
- for (var i = 0; i < dataLen; i++) {
- nameList[i] = categories[data[i][result.categoryIndex || 0]];
- }
- }
- else {
- nameList = categories.slice(0);
- }
- }
- }
-
- return nameList;
- }
-
- module.exports = createListFromArray;
-
-
-
-/***/ },
-/* 94 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(global) {/**
- * List for data storage
- * @module echarts/data/List
- */
-
-
- var UNDEFINED = 'undefined';
- var globalObj = typeof window === 'undefined' ? global : window;
- var Float64Array = typeof globalObj.Float64Array === UNDEFINED
- ? Array : globalObj.Float64Array;
- var Int32Array = typeof globalObj.Int32Array === UNDEFINED
- ? Array : globalObj.Int32Array;
-
- var dataCtors = {
- 'float': Float64Array,
- 'int': Int32Array,
- // Ordinal data type can be string or int
- 'ordinal': Array,
- 'number': Array,
- 'time': Array
- };
-
- var Model = __webpack_require__(8);
- var DataDiffer = __webpack_require__(95);
-
- var zrUtil = __webpack_require__(3);
- var modelUtil = __webpack_require__(5);
- var isObject = zrUtil.isObject;
-
- var IMMUTABLE_PROPERTIES = [
- 'stackedOn', '_nameList', '_idList', '_rawData'
- ];
-
- var transferImmuProperties = function (a, b, wrappedMethod) {
- zrUtil.each(IMMUTABLE_PROPERTIES.concat(wrappedMethod || []), function (propName) {
- if (b.hasOwnProperty(propName)) {
- a[propName] = b[propName];
- }
- });
- };
-
- /**
- * @constructor
- * @alias module:echarts/data/List
- *
- * @param {Array.<string>} dimensions
- * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius
- * @param {module:echarts/model/Model} hostModel
- */
- var List = function (dimensions, hostModel) {
-
- dimensions = dimensions || ['x', 'y'];
-
- var dimensionInfos = {};
- var dimensionNames = [];
- for (var i = 0; i < dimensions.length; i++) {
- var dimensionName;
- var dimensionInfo = {};
- if (typeof dimensions[i] === 'string') {
- dimensionName = dimensions[i];
- dimensionInfo = {
- name: dimensionName,
- stackable: false,
- // Type can be 'float', 'int', 'number'
- // Default is number, Precision of float may not enough
- type: 'number'
- };
- }
- else {
- dimensionInfo = dimensions[i];
- dimensionName = dimensionInfo.name;
- dimensionInfo.type = dimensionInfo.type || 'number';
- }
- dimensionNames.push(dimensionName);
- dimensionInfos[dimensionName] = dimensionInfo;
- }
- /**
- * @readOnly
- * @type {Array.<string>}
- */
- this.dimensions = dimensionNames;
-
- /**
- * Infomation of each data dimension, like data type.
- * @type {Object}
- */
- this._dimensionInfos = dimensionInfos;
-
- /**
- * @type {module:echarts/model/Model}
- */
- this.hostModel = hostModel;
-
- /**
- * Indices stores the indices of data subset after filtered.
- * This data subset will be used in chart.
- * @type {Array.<number>}
- * @readOnly
- */
- this.indices = [];
-
- /**
- * Data storage
- * @type {Object.<key, TypedArray|Array>}
- * @private
- */
- this._storage = {};
-
- /**
- * @type {Array.<string>}
- */
- this._nameList = [];
- /**
- * @type {Array.<string>}
- */
- this._idList = [];
- /**
- * Models of data option is stored sparse for optimizing memory cost
- * @type {Array.<module:echarts/model/Model>}
- * @private
- */
- this._optionModels = [];
-
- /**
- * @param {module:echarts/data/List}
- */
- this.stackedOn = null;
-
- /**
- * Global visual properties after visual coding
- * @type {Object}
- * @private
- */
- this._visual = {};
-
- /**
- * Globel layout properties.
- * @type {Object}
- * @private
- */
- this._layout = {};
-
- /**
- * Item visual properties after visual coding
- * @type {Array.<Object>}
- * @private
- */
- this._itemVisuals = [];
-
- /**
- * Item layout properties after layout
- * @type {Array.<Object>}
- * @private
- */
- this._itemLayouts = [];
-
- /**
- * Graphic elemnents
- * @type {Array.<module:zrender/Element>}
- * @private
- */
- this._graphicEls = [];
-
- /**
- * @type {Array.<Array|Object>}
- * @private
- */
- this._rawData;
-
- /**
- * @type {Object}
- * @private
- */
- this._extent;
- };
-
- var listProto = List.prototype;
-
- listProto.type = 'list';
-
- /**
- * Get dimension name
- * @param {string|number} dim
- * Dimension can be concrete names like x, y, z, lng, lat, angle, radius
- * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'
- */
- listProto.getDimension = function (dim) {
- if (!isNaN(dim)) {
- dim = this.dimensions[dim] || dim;
- }
- return dim;
- };
- /**
- * Get type and stackable info of particular dimension
- * @param {string|number} dim
- * Dimension can be concrete names like x, y, z, lng, lat, angle, radius
- * Or a ordinal number. For example getDimensionInfo(0) will return 'x' or 'lng' or 'radius'
- */
- listProto.getDimensionInfo = function (dim) {
- return zrUtil.clone(this._dimensionInfos[this.getDimension(dim)]);
- };
-
- /**
- * Initialize from data
- * @param {Array.<Object|number|Array>} data
- * @param {Array.<string>} [nameList]
- * @param {Function} [dimValueGetter] (dataItem, dimName, dataIndex, dimIndex) => number
- */
- listProto.initData = function (data, nameList, dimValueGetter) {
- data = data || [];
-
- this._rawData = data;
-
- // Clear
- var storage = this._storage = {};
- var indices = this.indices = [];
-
- var dimensions = this.dimensions;
- var size = data.length;
- var dimensionInfoMap = this._dimensionInfos;
-
- var idList = [];
- var nameRepeatCount = {};
-
- nameList = nameList || [];
-
- // Init storage
- for (var i = 0; i < dimensions.length; i++) {
- var dimInfo = dimensionInfoMap[dimensions[i]];
- var DataCtor = dataCtors[dimInfo.type];
- storage[dimensions[i]] = new DataCtor(size);
- }
-
- // Default dim value getter
- dimValueGetter = dimValueGetter || function (dataItem, dimName, dataIndex, dimIndex) {
- var value = modelUtil.getDataItemValue(dataItem);
- return modelUtil.converDataValue(
- zrUtil.isArray(value)
- ? value[dimIndex]
- // If value is a single number or something else not array.
- : value,
- dimensionInfoMap[dimName]
- );
- };
-
- for (var idx = 0; idx < data.length; idx++) {
- var dataItem = data[idx];
- // Each data item is value
- // [1, 2]
- // 2
- // Bar chart, line chart which uses category axis
- // only gives the 'y' value. 'x' value is the indices of cateogry
- // Use a tempValue to normalize the value to be a (x, y) value
-
- // Store the data by dimensions
- for (var k = 0; k < dimensions.length; k++) {
- var dim = dimensions[k];
- var dimStorage = storage[dim];
- // PENDING NULL is empty or zero
- dimStorage[idx] = dimValueGetter(dataItem, dim, idx, k);
- }
-
- indices.push(idx);
- }
-
- // Use the name in option and create id
- for (var i = 0; i < data.length; i++) {
- var id = '';
- if (!nameList[i]) {
- nameList[i] = data[i].name;
- // Try using the id in option
- id = data[i].id;
- }
- var name = nameList[i] || '';
- if (!id && name) {
- // Use name as id and add counter to avoid same name
- nameRepeatCount[name] = nameRepeatCount[name] || 0;
- id = name;
- if (nameRepeatCount[name] > 0) {
- id += '__ec__' + nameRepeatCount[name];
- }
- nameRepeatCount[name]++;
- }
- id && (idList[i] = id);
- }
-
- this._nameList = nameList;
- this._idList = idList;
- };
-
- /**
- * @return {number}
- */
- listProto.count = function () {
- return this.indices.length;
- };
-
- /**
- * Get value. Return NaN if idx is out of range.
- * @param {string} dim Dim must be concrete name.
- * @param {number} idx
- * @param {boolean} stack
- * @return {number}
- */
- listProto.get = function (dim, idx, stack) {
- var storage = this._storage;
- var dataIndex = this.indices[idx];
-
- // If value not exists
- if (dataIndex == null) {
- return NaN;
- }
-
- var value = storage[dim] && storage[dim][dataIndex];
- // FIXME ordinal data type is not stackable
- if (stack) {
- var dimensionInfo = this._dimensionInfos[dim];
- if (dimensionInfo && dimensionInfo.stackable) {
- var stackedOn = this.stackedOn;
- while (stackedOn) {
- // Get no stacked data of stacked on
- var stackedValue = stackedOn.get(dim, idx);
- // Considering positive stack, negative stack and empty data
- if ((value >= 0 && stackedValue > 0) // Positive stack
- || (value <= 0 && stackedValue < 0) // Negative stack
- ) {
- value += stackedValue;
- }
- stackedOn = stackedOn.stackedOn;
- }
- }
- }
- return value;
- };
-
- /**
- * Get value for multi dimensions.
- * @param {Array.<string>} [dimensions] If ignored, using all dimensions.
- * @param {number} idx
- * @param {boolean} stack
- * @return {number}
- */
- listProto.getValues = function (dimensions, idx, stack) {
- var values = [];
-
- if (!zrUtil.isArray(dimensions)) {
- stack = idx;
- idx = dimensions;
- dimensions = this.dimensions;
- }
-
- for (var i = 0, len = dimensions.length; i < len; i++) {
- values.push(this.get(dimensions[i], idx, stack));
- }
-
- return values;
- };
-
- /**
- * If value is NaN. Inlcuding '-'
- * @param {string} dim
- * @param {number} idx
- * @return {number}
- */
- listProto.hasValue = function (idx) {
- var dimensions = this.dimensions;
- var dimensionInfos = this._dimensionInfos;
- for (var i = 0, len = dimensions.length; i < len; i++) {
- if (
- // Ordinal type can be string or number
- dimensionInfos[dimensions[i]].type !== 'ordinal'
- && isNaN(this.get(dimensions[i], idx))
- ) {
- return false;
- }
- }
- return true;
- };
-
- /**
- * Get extent of data in one dimension
- * @param {string} dim
- * @param {boolean} stack
- */
- listProto.getDataExtent = function (dim, stack) {
- var dimData = this._storage[dim];
- var dimInfo = this.getDimensionInfo(dim);
- stack = (dimInfo && dimInfo.stackable) && stack;
- var dimExtent = (this._extent || (this._extent = {}))[dim + (!!stack)];
- var value;
- if (dimExtent) {
- return dimExtent;
- }
- // var dimInfo = this._dimensionInfos[dim];
- if (dimData) {
- var min = Infinity;
- var max = -Infinity;
- // var isOrdinal = dimInfo.type === 'ordinal';
- for (var i = 0, len = this.count(); i < len; i++) {
- value = this.get(dim, i, stack);
- // FIXME
- // if (isOrdinal && typeof value === 'string') {
- // value = zrUtil.indexOf(dimData, value);
- // console.log(value);
- // }
- value < min && (min = value);
- value > max && (max = value);
- }
- return (this._extent[dim + stack] = [min, max]);
- }
- else {
- return [Infinity, -Infinity];
- }
- };
-
- /**
- * Get sum of data in one dimension
- * @param {string} dim
- * @param {boolean} stack
- */
- listProto.getSum = function (dim, stack) {
- var dimData = this._storage[dim];
- var sum = 0;
- if (dimData) {
- for (var i = 0, len = this.count(); i < len; i++) {
- var value = this.get(dim, i, stack);
- if (!isNaN(value)) {
- sum += value;
- }
- }
- }
- return sum;
- };
-
- /**
- * Retreive the index with given value
- * @param {number} idx
- * @param {number} value
- * @return {number}
- */
- // FIXME Precision of float value
- listProto.indexOf = function (dim, value) {
- var storage = this._storage;
- var dimData = storage[dim];
- var indices = this.indices;
-
- if (dimData) {
- for (var i = 0, len = indices.length; i < len; i++) {
- var rawIndex = indices[i];
- if (dimData[rawIndex] === value) {
- return i;
- }
- }
- }
- return -1;
- };
-
- /**
- * Retreive the index with given name
- * @param {number} idx
- * @param {number} name
- * @return {number}
- */
- listProto.indexOfName = function (name) {
- var indices = this.indices;
- var nameList = this._nameList;
-
- for (var i = 0, len = indices.length; i < len; i++) {
- var rawIndex = indices[i];
- if (nameList[rawIndex] === name) {
- return i;
- }
- }
-
- return -1;
- };
-
- /**
- * Retreive the index of nearest value
- * @param {string>} dim
- * @param {number} value
- * @param {boolean} stack If given value is after stacked
- * @return {number}
- */
- listProto.indexOfNearest = function (dim, value, stack) {
- var storage = this._storage;
- var dimData = storage[dim];
-
- if (dimData) {
- var minDist = Number.MAX_VALUE;
- var nearestIdx = -1;
- for (var i = 0, len = this.count(); i < len; i++) {
- var diff = value - this.get(dim, i, stack);
- var dist = Math.abs(diff);
- if (dist < minDist
- // For the case of two data are same on xAxis, which has sequence data.
- // Show the nearest index
- // https://github.com/ecomfe/echarts/issues/2869
- || (dist === minDist && diff > 0)
- ) {
- minDist = dist;
- nearestIdx = i;
- }
- }
- return nearestIdx;
- }
- return -1;
- };
-
- /**
- * Get raw data index
- * @param {number} idx
- * @return {number}
- */
- listProto.getRawIndex = function (idx) {
- var rawIdx = this.indices[idx];
- return rawIdx == null ? -1 : rawIdx;
- };
-
- /**
- * @param {number} idx
- * @param {boolean} [notDefaultIdx=false]
- * @return {string}
- */
- listProto.getName = function (idx) {
- return this._nameList[this.indices[idx]] || '';
- };
-
- /**
- * @param {number} idx
- * @param {boolean} [notDefaultIdx=false]
- * @return {string}
- */
- listProto.getId = function (idx) {
- return this._idList[this.indices[idx]] || (this.getRawIndex(idx) + '');
- };
-
-
- function normalizeDimensions(dimensions) {
- if (!zrUtil.isArray(dimensions)) {
- dimensions = [dimensions];
- }
- return dimensions;
- }
-
- /**
- * Data iteration
- * @param {string|Array.<string>}
- * @param {Function} cb
- * @param {boolean} [stack=false]
- * @param {*} [context=this]
- *
- * @example
- * list.each('x', function (x, idx) {});
- * list.each(['x', 'y'], function (x, y, idx) {});
- * list.each(function (idx) {})
- */
- listProto.each = function (dimensions, cb, stack, context) {
- if (typeof dimensions === 'function') {
- context = stack;
- stack = cb;
- cb = dimensions;
- dimensions = [];
- }
-
- dimensions = zrUtil.map(
- normalizeDimensions(dimensions), this.getDimension, this
- );
-
- var value = [];
- var dimSize = dimensions.length;
- var indices = this.indices;
-
- context = context || this;
-
- for (var i = 0; i < indices.length; i++) {
- if (dimSize === 0) {
- cb.call(context, i);
- }
- // Simple optimization
- else if (dimSize === 1) {
- cb.call(context, this.get(dimensions[0], i, stack), i);
- }
- else {
- for (var k = 0; k < dimSize; k++) {
- value[k] = this.get(dimensions[k], i, stack);
- }
- // Index
- value[k] = i;
- cb.apply(context, value);
- }
- }
- };
-
- /**
- * Data filter
- * @param {string|Array.<string>}
- * @param {Function} cb
- * @param {boolean} [stack=false]
- * @param {*} [context=this]
- */
- listProto.filterSelf = function (dimensions, cb, stack, context) {
- if (typeof dimensions === 'function') {
- context = stack;
- stack = cb;
- cb = dimensions;
- dimensions = [];
- }
-
- dimensions = zrUtil.map(
- normalizeDimensions(dimensions), this.getDimension, this
- );
-
- var newIndices = [];
- var value = [];
- var dimSize = dimensions.length;
- var indices = this.indices;
-
- context = context || this;
-
- for (var i = 0; i < indices.length; i++) {
- var keep;
- // Simple optimization
- if (dimSize === 1) {
- keep = cb.call(
- context, this.get(dimensions[0], i, stack), i
- );
- }
- else {
- for (var k = 0; k < dimSize; k++) {
- value[k] = this.get(dimensions[k], i, stack);
- }
- value[k] = i;
- keep = cb.apply(context, value);
- }
- if (keep) {
- newIndices.push(indices[i]);
- }
- }
-
- this.indices = newIndices;
-
- // Reset data extent
- this._extent = {};
-
- return this;
- };
-
- /**
- * Data mapping to a plain array
- * @param {string|Array.<string>} [dimensions]
- * @param {Function} cb
- * @param {boolean} [stack=false]
- * @param {*} [context=this]
- * @return {Array}
- */
- listProto.mapArray = function (dimensions, cb, stack, context) {
- if (typeof dimensions === 'function') {
- context = stack;
- stack = cb;
- cb = dimensions;
- dimensions = [];
- }
-
- var result = [];
- this.each(dimensions, function () {
- result.push(cb && cb.apply(this, arguments));
- }, stack, context);
- return result;
- };
-
- function cloneListForMapAndSample(original, excludeDimensions) {
- var allDimensions = original.dimensions;
- var list = new List(
- zrUtil.map(allDimensions, original.getDimensionInfo, original),
- original.hostModel
- );
- // FIXME If needs stackedOn, value may already been stacked
- transferImmuProperties(list, original, original._wrappedMethods);
-
- var storage = list._storage = {};
- var originalStorage = original._storage;
- // Init storage
- for (var i = 0; i < allDimensions.length; i++) {
- var dim = allDimensions[i];
- var dimStore = originalStorage[dim];
- if (zrUtil.indexOf(excludeDimensions, dim) >= 0) {
- storage[dim] = new dimStore.constructor(
- originalStorage[dim].length
- );
- }
- else {
- // Direct reference for other dimensions
- storage[dim] = originalStorage[dim];
- }
- }
- return list;
- }
-
- /**
- * Data mapping to a new List with given dimensions
- * @param {string|Array.<string>} dimensions
- * @param {Function} cb
- * @param {boolean} [stack=false]
- * @param {*} [context=this]
- * @return {Array}
- */
- listProto.map = function (dimensions, cb, stack, context) {
- dimensions = zrUtil.map(
- normalizeDimensions(dimensions), this.getDimension, this
- );
-
- var list = cloneListForMapAndSample(this, dimensions);
- // Following properties are all immutable.
- // So we can reference to the same value
- var indices = list.indices = this.indices;
-
- var storage = list._storage;
-
- var tmpRetValue = [];
- this.each(dimensions, function () {
- var idx = arguments[arguments.length - 1];
- var retValue = cb && cb.apply(this, arguments);
- if (retValue != null) {
- // a number
- if (typeof retValue === 'number') {
- tmpRetValue[0] = retValue;
- retValue = tmpRetValue;
- }
- for (var i = 0; i < retValue.length; i++) {
- var dim = dimensions[i];
- var dimStore = storage[dim];
- var rawIdx = indices[idx];
- if (dimStore) {
- dimStore[rawIdx] = retValue[i];
- }
- }
- }
- }, stack, context);
-
- return list;
- };
-
- /**
- * Large data down sampling on given dimension
- * @param {string} dimension
- * @param {number} rate
- * @param {Function} sampleValue
- * @param {Function} sampleIndex Sample index for name and id
- */
- listProto.downSample = function (dimension, rate, sampleValue, sampleIndex) {
- var list = cloneListForMapAndSample(this, [dimension]);
- var storage = this._storage;
- var targetStorage = list._storage;
-
- var originalIndices = this.indices;
- var indices = list.indices = [];
-
- var frameValues = [];
- var frameIndices = [];
- var frameSize = Math.floor(1 / rate);
-
- var dimStore = targetStorage[dimension];
- var len = this.count();
- // Copy data from original data
- for (var i = 0; i < storage[dimension].length; i++) {
- targetStorage[dimension][i] = storage[dimension][i];
- }
- for (var i = 0; i < len; i += frameSize) {
- // Last frame
- if (frameSize > len - i) {
- frameSize = len - i;
- frameValues.length = frameSize;
- }
- for (var k = 0; k < frameSize; k++) {
- var idx = originalIndices[i + k];
- frameValues[k] = dimStore[idx];
- frameIndices[k] = idx;
- }
- var value = sampleValue(frameValues);
- var idx = frameIndices[sampleIndex(frameValues, value) || 0];
- // Only write value on the filtered data
- dimStore[idx] = value;
- indices.push(idx);
- }
- return list;
- };
-
- /**
- * Get model of one data item.
- *
- * @param {number} idx
- */
- // FIXME Model proxy ?
- listProto.getItemModel = function (idx) {
- var hostModel = this.hostModel;
- idx = this.indices[idx];
- return new Model(this._rawData[idx], hostModel, hostModel.ecModel);
- };
-
- /**
- * Create a data differ
- * @param {module:echarts/data/List} otherList
- * @return {module:echarts/data/DataDiffer}
- */
- listProto.diff = function (otherList) {
- var idList = this._idList;
- var otherIdList = otherList && otherList._idList;
- return new DataDiffer(
- otherList ? otherList.indices : [], this.indices, function (idx) {
- return otherIdList[idx] || (idx + '');
- }, function (idx) {
- return idList[idx] || (idx + '');
- }
- );
- };
- /**
- * Get visual property.
- * @param {string} key
- */
- listProto.getVisual = function (key) {
- var visual = this._visual;
- return visual && visual[key];
- };
-
- /**
- * Set visual property
- * @param {string|Object} key
- * @param {*} [value]
- *
- * @example
- * setVisual('color', color);
- * setVisual({
- * 'color': color
- * });
- */
- listProto.setVisual = function (key, val) {
- if (isObject(key)) {
- for (var name in key) {
- if (key.hasOwnProperty(name)) {
- this.setVisual(name, key[name]);
- }
- }
- return;
- }
- this._visual = this._visual || {};
- this._visual[key] = val;
- };
-
- /**
- * Set layout property.
- * @param {string} key
- * @param {*} [val]
- */
- listProto.setLayout = function (key, val) {
- if (isObject(key)) {
- for (var name in key) {
- if (key.hasOwnProperty(name)) {
- this.setLayout(name, key[name]);
- }
- }
- return;
- }
- this._layout[key] = val;
- };
-
- /**
- * Get layout property.
- * @param {string} key.
- * @return {*}
- */
- listProto.getLayout = function (key) {
- return this._layout[key];
- };
-
- /**
- * Get layout of single data item
- * @param {number} idx
- */
- listProto.getItemLayout = function (idx) {
- return this._itemLayouts[idx];
- },
-
- /**
- * Set layout of single data item
- * @param {number} idx
- * @param {Object} layout
- * @param {boolean=} [merge=false]
- */
- listProto.setItemLayout = function (idx, layout, merge) {
- this._itemLayouts[idx] = merge
- ? zrUtil.extend(this._itemLayouts[idx] || {}, layout)
- : layout;
- },
-
- /**
- * Get visual property of single data item
- * @param {number} idx
- * @param {string} key
- * @param {boolean} ignoreParent
- */
- listProto.getItemVisual = function (idx, key, ignoreParent) {
- var itemVisual = this._itemVisuals[idx];
- var val = itemVisual && itemVisual[key];
- if (val == null && !ignoreParent) {
- // Use global visual property
- return this.getVisual(key);
- }
- return val;
- },
-
- /**
- * Set visual property of single data item
- *
- * @param {number} idx
- * @param {string|Object} key
- * @param {*} [value]
- *
- * @example
- * setItemVisual(0, 'color', color);
- * setItemVisual(0, {
- * 'color': color
- * });
- */
- listProto.setItemVisual = function (idx, key, value) {
- var itemVisual = this._itemVisuals[idx] || {};
- this._itemVisuals[idx] = itemVisual;
-
- if (isObject(key)) {
- for (var name in key) {
- if (key.hasOwnProperty(name)) {
- itemVisual[name] = key[name];
- }
- }
- return;
- }
- itemVisual[key] = value;
- };
-
- var setItemDataAndSeriesIndex = function (child) {
- child.seriesIndex = this.seriesIndex;
- child.dataIndex = this.dataIndex;
- };
- /**
- * Set graphic element relative to data. It can be set as null
- * @param {number} idx
- * @param {module:zrender/Element} [el]
- */
- listProto.setItemGraphicEl = function (idx, el) {
- var hostModel = this.hostModel;
-
- if (el) {
- // Add data index and series index for indexing the data by element
- // Useful in tooltip
- el.dataIndex = idx;
- el.seriesIndex = hostModel && hostModel.seriesIndex;
- if (el.type === 'group') {
- el.traverse(setItemDataAndSeriesIndex, el);
- }
- }
-
- this._graphicEls[idx] = el;
- };
-
- /**
- * @param {number} idx
- * @return {module:zrender/Element}
- */
- listProto.getItemGraphicEl = function (idx) {
- return this._graphicEls[idx];
- };
-
- /**
- * @param {Function} cb
- * @param {*} context
- */
- listProto.eachItemGraphicEl = function (cb, context) {
- zrUtil.each(this._graphicEls, function (el, idx) {
- if (el) {
- cb && cb.call(context, el, idx);
- }
- });
- };
-
- /**
- * Shallow clone a new list except visual and layout properties, and graph elements.
- * New list only change the indices.
- */
- listProto.cloneShallow = function () {
- var dimensionInfoList = zrUtil.map(this.dimensions, this.getDimensionInfo, this);
- var list = new List(dimensionInfoList, this.hostModel);
-
- // FIXME
- list._storage = this._storage;
-
- transferImmuProperties(list, this, this._wrappedMethods);
-
- list.indices = this.indices.slice();
-
- return list;
- };
-
- /**
- * Wrap some method to add more feature
- * @param {string} methodName
- * @param {Function} injectFunction
- */
- listProto.wrapMethod = function (methodName, injectFunction) {
- var originalMethod = this[methodName];
- if (typeof originalMethod !== 'function') {
- return;
- }
- this._wrappedMethods = this._wrappedMethods || [];
- this._wrappedMethods.push(methodName);
- this[methodName] = function () {
- var res = originalMethod.apply(this, arguments);
- return injectFunction.call(this, res);
- };
- };
-
- module.exports = List;
-
- /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
-
-/***/ },
-/* 95 */
-/***/ function(module, exports) {
-
- 'use strict';
-
-
- function defaultKeyGetter(item) {
- return item;
- }
-
- function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter) {
- this._old = oldArr;
- this._new = newArr;
-
- this._oldKeyGetter = oldKeyGetter || defaultKeyGetter;
- this._newKeyGetter = newKeyGetter || defaultKeyGetter;
- }
-
- DataDiffer.prototype = {
-
- constructor: DataDiffer,
-
- /**
- * Callback function when add a data
- */
- add: function (func) {
- this._add = func;
- return this;
- },
-
- /**
- * Callback function when update a data
- */
- update: function (func) {
- this._update = func;
- return this;
- },
-
- /**
- * Callback function when remove a data
- */
- remove: function (func) {
- this._remove = func;
- return this;
- },
-
- execute: function () {
- var oldArr = this._old;
- var newArr = this._new;
- var oldKeyGetter = this._oldKeyGetter;
- var newKeyGetter = this._newKeyGetter;
-
- var oldDataIndexMap = {};
- var newDataIndexMap = {};
- var i;
-
- initIndexMap(oldArr, oldDataIndexMap, oldKeyGetter);
- initIndexMap(newArr, newDataIndexMap, newKeyGetter);
-
- // Travel by inverted order to make sure order consistency
- // when duplicate keys exists (consider newDataIndex.pop() below).
- // For performance consideration, these code below do not look neat.
- for (i = 0; i < oldArr.length; i++) {
- var key = oldKeyGetter(oldArr[i]);
- var idx = newDataIndexMap[key];
-
- // idx can never be empty array here. see 'set null' logic below.
- if (idx != null) {
- // Consider there is duplicate key (for example, use dataItem.name as key).
- // We should make sure every item in newArr and oldArr can be visited.
- var len = idx.length;
- if (len) {
- len === 1 && (newDataIndexMap[key] = null);
- idx = idx.unshift();
- }
- else {
- newDataIndexMap[key] = null;
- }
- this._update && this._update(idx, i);
- }
- else {
- this._remove && this._remove(i);
- }
- }
-
- for (var key in newDataIndexMap) {
- if (newDataIndexMap.hasOwnProperty(key)) {
- var idx = newDataIndexMap[key];
- if (idx == null) {
- continue;
- }
- // idx can never be empty array here. see 'set null' logic above.
- if (!idx.length) {
- this._add && this._add(idx);
- }
- else {
- for (var i = 0, len = idx.length; i < len; i++) {
- this._add && this._add(idx[i]);
- }
- }
- }
- }
- }
- };
-
- function initIndexMap(arr, map, keyGetter) {
- for (var i = 0; i < arr.length; i++) {
- var key = keyGetter(arr[i]);
- var existence = map[key];
- if (existence == null) {
- map[key] = i;
- }
- else {
- if (!existence.length) {
- map[key] = existence = [existence];
- }
- existence.push(i);
- }
- }
- }
-
- module.exports = DataDiffer;
-
-
-/***/ },
-/* 96 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Complete dimensions by data (guess dimension).
- */
-
-
- var zrUtil = __webpack_require__(3);
-
- /**
- * Complete the dimensions array guessed from the data structure.
- * @param {Array.<string>} dimensions Necessary dimensions, like ['x', 'y']
- * @param {Array} data Data list. [[1, 2, 3], [2, 3, 4]]
- * @param {Array.<string>} defaultNames Default names to fill not necessary dimensions, like ['value']
- * @param {string} extraPrefix Prefix of name when filling the left dimensions.
- * @return {Array.<string>}
- */
- function completeDimensions(dimensions, data, defaultNames, extraPrefix) {
- if (!data) {
- return dimensions;
- }
-
- var value0 = retrieveValue(data[0]);
- var dimSize = zrUtil.isArray(value0) && value0.length || 1;
-
- defaultNames = defaultNames || [];
- extraPrefix = extraPrefix || 'extra';
- for (var i = 0; i < dimSize; i++) {
- if (!dimensions[i]) {
- var name = defaultNames[i] || (extraPrefix + (i - defaultNames.length));
- dimensions[i] = guessOrdinal(data, i)
- ? {type: 'ordinal', name: name}
- : name;
- }
- }
-
- return dimensions;
- }
-
- // The rule should not be complex, otherwise user might not
- // be able to known where the data is wrong.
- function guessOrdinal(data, dimIndex) {
- for (var i = 0, len = data.length; i < len; i++) {
- var value = retrieveValue(data[i]);
-
- if (!zrUtil.isArray(value)) {
- return false;
- }
-
- var value = value[dimIndex];
- if (value != null && isFinite(value)) {
- return false;
- }
- else if (zrUtil.isString(value) && value !== '-') {
- return true;
- }
- }
- return false;
- }
-
- function retrieveValue(o) {
- return zrUtil.isArray(o) ? o : zrUtil.isObject(o) ? o.value: o;
- }
-
- module.exports = completeDimensions;
-
-
-
-/***/ },
-/* 97 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
- var SymbolDraw = __webpack_require__(98);
- var Symbol = __webpack_require__(99);
- var lineAnimationDiff = __webpack_require__(101);
- var graphic = __webpack_require__(42);
-
- var polyHelper = __webpack_require__(102);
-
- var ChartView = __webpack_require__(41);
-
- function isPointsSame(points1, points2) {
- if (points1.length !== points2.length) {
- return;
- }
- for (var i = 0; i < points1.length; i++) {
- var p1 = points1[i];
- var p2 = points2[i];
- if (p1[0] !== p2[0] || p1[1] !== p2[1]) {
- return;
- }
- }
- return true;
- }
-
- function getSmooth(smooth) {
- return typeof (smooth) === 'number' ? smooth : (smooth ? 0.3 : 0);
- }
-
- function getAxisExtentWithGap(axis) {
- var extent = axis.getGlobalExtent();
- if (axis.onBand) {
- // Remove extra 1px to avoid line miter in clipped edge
- var halfBandWidth = axis.getBandWidth() / 2 - 1;
- var dir = extent[1] > extent[0] ? 1 : -1;
- extent[0] += dir * halfBandWidth;
- extent[1] -= dir * halfBandWidth;
- }
- return extent;
- }
-
- function sign(val) {
- return val >= 0 ? 1 : -1;
- }
- /**
- * @param {module:echarts/coord/cartesian/Cartesian2D|module:echarts/coord/polar/Polar} coordSys
- * @param {module:echarts/data/List} data
- * @param {Array.<Array.<number>>} points
- * @private
- */
- function getStackedOnPoints(coordSys, data) {
- var baseAxis = coordSys.getBaseAxis();
- var valueAxis = coordSys.getOtherAxis(baseAxis);
- var valueStart = baseAxis.onZero
- ? 0 : valueAxis.scale.getExtent()[0];
-
- var valueDim = valueAxis.dim;
-
- var baseDataOffset = valueDim === 'x' || valueDim === 'radius' ? 1 : 0;
-
- return data.mapArray([valueDim], function (val, idx) {
- var stackedOnSameSign;
- var stackedOn = data.stackedOn;
- // Find first stacked value with same sign
- while (stackedOn &&
- sign(stackedOn.get(valueDim, idx)) === sign(val)
- ) {
- stackedOnSameSign = stackedOn;
- break;
- }
- var stackedData = [];
- stackedData[baseDataOffset] = data.get(baseAxis.dim, idx);
- stackedData[1 - baseDataOffset] = stackedOnSameSign
- ? stackedOnSameSign.get(valueDim, idx, true) : valueStart;
-
- return coordSys.dataToPoint(stackedData);
- }, true);
- }
-
- function queryDataIndex(data, payload) {
- if (payload.dataIndex != null) {
- return payload.dataIndex;
- }
- else if (payload.name != null) {
- return data.indexOfName(payload.name);
- }
- }
-
- function createGridClipShape(cartesian, hasAnimation, seriesModel) {
- var xExtent = getAxisExtentWithGap(cartesian.getAxis('x'));
- var yExtent = getAxisExtentWithGap(cartesian.getAxis('y'));
- var isHorizontal = cartesian.getBaseAxis().isHorizontal();
-
- var x = xExtent[0];
- var y = yExtent[0];
- var width = xExtent[1] - x;
- var height = yExtent[1] - y;
- // Expand clip shape to avoid line value exceeds axis
- if (!seriesModel.get('clipOverflow')) {
- if (isHorizontal) {
- y -= height;
- height *= 3;
- }
- else {
- x -= width;
- width *= 3;
- }
- }
- var clipPath = new graphic.Rect({
- shape: {
- x: x,
- y: y,
- width: width,
- height: height
- }
- });
-
- if (hasAnimation) {
- clipPath.shape[isHorizontal ? 'width' : 'height'] = 0;
- graphic.initProps(clipPath, {
- shape: {
- width: width,
- height: height
- }
- }, seriesModel);
- }
-
- return clipPath;
- }
-
- function createPolarClipShape(polar, hasAnimation, seriesModel) {
- var angleAxis = polar.getAngleAxis();
- var radiusAxis = polar.getRadiusAxis();
-
- var radiusExtent = radiusAxis.getExtent();
- var angleExtent = angleAxis.getExtent();
-
- var RADIAN = Math.PI / 180;
-
- var clipPath = new graphic.Sector({
- shape: {
- cx: polar.cx,
- cy: polar.cy,
- r0: radiusExtent[0],
- r: radiusExtent[1],
- startAngle: -angleExtent[0] * RADIAN,
- endAngle: -angleExtent[1] * RADIAN,
- clockwise: angleAxis.inverse
- }
- });
-
- if (hasAnimation) {
- clipPath.shape.endAngle = -angleExtent[0] * RADIAN;
- graphic.initProps(clipPath, {
- shape: {
- endAngle: -angleExtent[1] * RADIAN
- }
- }, seriesModel);
- }
-
- return clipPath;
- }
-
- function createClipShape(coordSys, hasAnimation, seriesModel) {
- return coordSys.type === 'polar'
- ? createPolarClipShape(coordSys, hasAnimation, seriesModel)
- : createGridClipShape(coordSys, hasAnimation, seriesModel);
- }
-
- module.exports = ChartView.extend({
-
- type: 'line',
-
- init: function () {
- var lineGroup = new graphic.Group();
-
- var symbolDraw = new SymbolDraw();
- this.group.add(symbolDraw.group);
-
- this._symbolDraw = symbolDraw;
- this._lineGroup = lineGroup;
- },
-
- render: function (seriesModel, ecModel, api) {
- var coordSys = seriesModel.coordinateSystem;
- var group = this.group;
- var data = seriesModel.getData();
- var lineStyleModel = seriesModel.getModel('lineStyle.normal');
- var areaStyleModel = seriesModel.getModel('areaStyle.normal');
-
- var points = data.mapArray(data.getItemLayout, true);
-
- var isCoordSysPolar = coordSys.type === 'polar';
- var prevCoordSys = this._coordSys;
-
- var symbolDraw = this._symbolDraw;
- var polyline = this._polyline;
- var polygon = this._polygon;
-
- var lineGroup = this._lineGroup;
-
- var hasAnimation = seriesModel.get('animation');
-
- var isAreaChart = !areaStyleModel.isEmpty();
- var stackedOnPoints = getStackedOnPoints(coordSys, data);
-
- var showSymbol = seriesModel.get('showSymbol');
-
- var isSymbolIgnore = showSymbol && !isCoordSysPolar && !seriesModel.get('showAllSymbol')
- && this._getSymbolIgnoreFunc(data, coordSys);
-
- // Remove temporary symbols
- var oldData = this._data;
- oldData && oldData.eachItemGraphicEl(function (el, idx) {
- if (el.__temp) {
- group.remove(el);
- oldData.setItemGraphicEl(idx, null);
- }
- });
-
- // Remove previous created symbols if showSymbol changed to false
- if (!showSymbol) {
- symbolDraw.remove();
- }
-
- group.add(lineGroup);
-
- // Initialization animation or coordinate system changed
- if (
- !(polyline && prevCoordSys.type === coordSys.type)
- ) {
- showSymbol && symbolDraw.updateData(data, isSymbolIgnore);
-
- polyline = this._newPolyline(points, coordSys, hasAnimation);
- if (isAreaChart) {
- polygon = this._newPolygon(
- points, stackedOnPoints,
- coordSys, hasAnimation
- );
- }
- lineGroup.setClipPath(createClipShape(coordSys, true, seriesModel));
- }
- else {
- if (isAreaChart && !polygon) {
- // If areaStyle is added
- polygon = this._newPolygon(
- points, stackedOnPoints,
- coordSys, hasAnimation
- );
- }
- else if (polygon && !isAreaChart) {
- // If areaStyle is removed
- lineGroup.remove(polygon);
- polygon = this._polygon = null;
- }
-
- // Update clipPath
- lineGroup.setClipPath(createClipShape(coordSys, false, seriesModel));
-
- // Always update, or it is wrong in the case turning on legend
- // because points are not changed
- showSymbol && symbolDraw.updateData(data, isSymbolIgnore);
-
- // Stop symbol animation and sync with line points
- // FIXME performance?
- data.eachItemGraphicEl(function (el) {
- el.stopAnimation(true);
- });
-
- // In the case data zoom triggerred refreshing frequently
- // Data may not change if line has a category axis. So it should animate nothing
- if (!isPointsSame(this._stackedOnPoints, stackedOnPoints)
- || !isPointsSame(this._points, points)
- ) {
- if (hasAnimation) {
- this._updateAnimation(
- data, stackedOnPoints, coordSys, api
- );
- }
- else {
- polyline.setShape({
- points: points
- });
- polygon && polygon.setShape({
- points: points,
- stackedOnPoints: stackedOnPoints
- });
- }
- }
- }
-
- polyline.setStyle(zrUtil.defaults(
- // Use color in lineStyle first
- lineStyleModel.getLineStyle(),
- {
- stroke: data.getVisual('color'),
- lineJoin: 'bevel'
- }
- ));
-
- var smooth = seriesModel.get('smooth');
- smooth = getSmooth(seriesModel.get('smooth'));
- polyline.setShape({
- smooth: smooth,
- smoothMonotone: seriesModel.get('smoothMonotone')
- });
-
- if (polygon) {
- var stackedOn = data.stackedOn;
- var stackedOnSmooth = 0;
-
- polygon.style.opacity = 0.7;
- polygon.setStyle(zrUtil.defaults(
- areaStyleModel.getAreaStyle(),
- {
- fill: data.getVisual('color'),
- lineJoin: 'bevel'
- }
- ));
-
- if (stackedOn) {
- var stackedOnSeries = stackedOn.hostModel;
- stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth'));
- }
-
- polygon.setShape({
- smooth: smooth,
- stackedOnSmooth: stackedOnSmooth,
- smoothMonotone: seriesModel.get('smoothMonotone')
- });
- }
-
- this._data = data;
- // Save the coordinate system for transition animation when data changed
- this._coordSys = coordSys;
- this._stackedOnPoints = stackedOnPoints;
- this._points = points;
- },
-
- highlight: function (seriesModel, ecModel, api, payload) {
- var data = seriesModel.getData();
- var dataIndex = queryDataIndex(data, payload);
-
- if (dataIndex != null && dataIndex >= 0) {
- var symbol = data.getItemGraphicEl(dataIndex);
- if (!symbol) {
- // Create a temporary symbol if it is not exists
- var pt = data.getItemLayout(dataIndex);
- symbol = new Symbol(data, dataIndex, api);
- symbol.position = pt;
- symbol.setZ(
- seriesModel.get('zlevel'),
- seriesModel.get('z')
- );
- symbol.ignore = isNaN(pt[0]) || isNaN(pt[1]);
- symbol.__temp = true;
- data.setItemGraphicEl(dataIndex, symbol);
-
- // Stop scale animation
- symbol.stopSymbolAnimation(true);
-
- this.group.add(symbol);
- }
- symbol.highlight();
- }
- else {
- // Highlight whole series
- ChartView.prototype.highlight.call(
- this, seriesModel, ecModel, api, payload
- );
- }
- },
-
- downplay: function (seriesModel, ecModel, api, payload) {
- var data = seriesModel.getData();
- var dataIndex = queryDataIndex(data, payload);
- if (dataIndex != null && dataIndex >= 0) {
- var symbol = data.getItemGraphicEl(dataIndex);
- if (symbol) {
- if (symbol.__temp) {
- data.setItemGraphicEl(dataIndex, null);
- this.group.remove(symbol);
- }
- else {
- symbol.downplay();
- }
- }
- }
- else {
- // Downplay whole series
- ChartView.prototype.downplay.call(
- this, seriesModel, ecModel, api, payload
- );
- }
- },
-
- /**
- * @param {module:zrender/container/Group} group
- * @param {Array.<Array.<number>>} points
- * @private
- */
- _newPolyline: function (points) {
- var polyline = this._polyline;
- // Remove previous created polyline
- if (polyline) {
- this._lineGroup.remove(polyline);
- }
-
- polyline = new polyHelper.Polyline({
- shape: {
- points: points
- },
- silent: true,
- z2: 10
- });
-
- this._lineGroup.add(polyline);
-
- this._polyline = polyline;
-
- return polyline;
- },
-
- /**
- * @param {module:zrender/container/Group} group
- * @param {Array.<Array.<number>>} stackedOnPoints
- * @param {Array.<Array.<number>>} points
- * @private
- */
- _newPolygon: function (points, stackedOnPoints) {
- var polygon = this._polygon;
- // Remove previous created polygon
- if (polygon) {
- this._lineGroup.remove(polygon);
- }
-
- polygon = new polyHelper.Polygon({
- shape: {
- points: points,
- stackedOnPoints: stackedOnPoints
- },
- silent: true
- });
-
- this._lineGroup.add(polygon);
-
- this._polygon = polygon;
- return polygon;
- },
- /**
- * @private
- */
- _getSymbolIgnoreFunc: function (data, coordSys) {
- var categoryAxis = coordSys.getAxesByScale('ordinal')[0];
- // `getLabelInterval` is provided by echarts/component/axis
- if (categoryAxis && categoryAxis.isLabelIgnored) {
- return zrUtil.bind(categoryAxis.isLabelIgnored, categoryAxis);
- }
- },
-
- /**
- * @private
- */
- // FIXME Two value axis
- _updateAnimation: function (data, stackedOnPoints, coordSys, api) {
- var polyline = this._polyline;
- var polygon = this._polygon;
- var seriesModel = data.hostModel;
-
- var diff = lineAnimationDiff(
- this._data, data,
- this._stackedOnPoints, stackedOnPoints,
- this._coordSys, coordSys
- );
- polyline.shape.points = diff.current;
-
- graphic.updateProps(polyline, {
- shape: {
- points: diff.next
- }
- }, seriesModel);
-
- if (polygon) {
- polygon.setShape({
- points: diff.current,
- stackedOnPoints: diff.stackedOnCurrent
- });
- graphic.updateProps(polygon, {
- shape: {
- points: diff.next,
- stackedOnPoints: diff.stackedOnNext
- }
- }, seriesModel);
- }
-
- var updatedDataInfo = [];
- var diffStatus = diff.status;
-
- for (var i = 0; i < diffStatus.length; i++) {
- var cmd = diffStatus[i].cmd;
- if (cmd === '=') {
- var el = data.getItemGraphicEl(diffStatus[i].idx1);
- if (el) {
- updatedDataInfo.push({
- el: el,
- ptIdx: i // Index of points
- });
- }
- }
- }
-
- if (polyline.animators && polyline.animators.length) {
- polyline.animators[0].during(function () {
- for (var i = 0; i < updatedDataInfo.length; i++) {
- var el = updatedDataInfo[i].el;
- el.attr('position', polyline.shape.points[updatedDataInfo[i].ptIdx]);
- }
- });
- }
- },
-
- remove: function (ecModel) {
- var group = this.group;
- var oldData = this._data;
- this._lineGroup.removeAll();
- this._symbolDraw.remove(true);
- // Remove temporary created elements when highlighting
- oldData && oldData.eachItemGraphicEl(function (el, idx) {
- if (el.__temp) {
- group.remove(el);
- oldData.setItemGraphicEl(idx, null);
- }
- });
-
- this._polyline =
- this._polygon =
- this._coordSys =
- this._points =
- this._stackedOnPoints =
- this._data = null;
- }
- });
-
-
-/***/ },
-/* 98 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @module echarts/chart/helper/SymbolDraw
- */
-
-
- var graphic = __webpack_require__(42);
- var Symbol = __webpack_require__(99);
-
- /**
- * @constructor
- * @alias module:echarts/chart/helper/SymbolDraw
- * @param {module:zrender/graphic/Group} [symbolCtor]
- */
- function SymbolDraw(symbolCtor) {
- this.group = new graphic.Group();
-
- this._symbolCtor = symbolCtor || Symbol;
- }
-
- var symbolDrawProto = SymbolDraw.prototype;
-
- function symbolNeedsDraw(data, idx, isIgnore) {
- var point = data.getItemLayout(idx);
- return point && !isNaN(point[0]) && !isNaN(point[1]) && !(isIgnore && isIgnore(idx))
- && data.getItemVisual(idx, 'symbol') !== 'none';
- }
- /**
- * Update symbols draw by new data
- * @param {module:echarts/data/List} data
- * @param {Array.<boolean>} [isIgnore]
- */
- symbolDrawProto.updateData = function (data, isIgnore) {
- var group = this.group;
- var seriesModel = data.hostModel;
- var oldData = this._data;
-
- var SymbolCtor = this._symbolCtor;
-
- data.diff(oldData)
- .add(function (newIdx) {
- var point = data.getItemLayout(newIdx);
- if (symbolNeedsDraw(data, newIdx, isIgnore)) {
- var symbolEl = new SymbolCtor(data, newIdx);
- symbolEl.attr('position', point);
- data.setItemGraphicEl(newIdx, symbolEl);
- group.add(symbolEl);
- }
- })
- .update(function (newIdx, oldIdx) {
- var symbolEl = oldData.getItemGraphicEl(oldIdx);
- var point = data.getItemLayout(newIdx);
- if (!symbolNeedsDraw(data, newIdx, isIgnore)) {
- group.remove(symbolEl);
- return;
- }
- if (!symbolEl) {
- symbolEl = new SymbolCtor(data, newIdx);
- symbolEl.attr('position', point);
- }
- else {
- symbolEl.updateData(data, newIdx);
- graphic.updateProps(symbolEl, {
- position: point
- }, seriesModel);
- }
-
- // Add back
- group.add(symbolEl);
-
- data.setItemGraphicEl(newIdx, symbolEl);
- })
- .remove(function (oldIdx) {
- var el = oldData.getItemGraphicEl(oldIdx);
- el && el.fadeOut(function () {
- group.remove(el);
- });
- })
- .execute();
-
- this._data = data;
- };
-
- symbolDrawProto.updateLayout = function () {
- var data = this._data;
- if (data) {
- // Not use animation
- data.eachItemGraphicEl(function (el, idx) {
- el.attr('position', data.getItemLayout(idx));
- });
- }
- };
-
- symbolDrawProto.remove = function (enableAnimation) {
- var group = this.group;
- var data = this._data;
- if (data) {
- if (enableAnimation) {
- data.eachItemGraphicEl(function (el) {
- el.fadeOut(function () {
- group.remove(el);
- });
- });
- }
- else {
- group.removeAll();
- }
- }
- };
-
- module.exports = SymbolDraw;
-
-
-/***/ },
-/* 99 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @module echarts/chart/helper/Symbol
- */
-
-
- var zrUtil = __webpack_require__(3);
- var symbolUtil = __webpack_require__(100);
- var graphic = __webpack_require__(42);
- var numberUtil = __webpack_require__(7);
-
- function normalizeSymbolSize(symbolSize) {
- if (!zrUtil.isArray(symbolSize)) {
- symbolSize = [+symbolSize, +symbolSize];
- }
- return symbolSize;
- }
-
- /**
- * @constructor
- * @alias {module:echarts/chart/helper/Symbol}
- * @param {module:echarts/data/List} data
- * @param {number} idx
- * @extends {module:zrender/graphic/Group}
- */
- function Symbol(data, idx) {
- graphic.Group.call(this);
-
- this.updateData(data, idx);
- }
-
- var symbolProto = Symbol.prototype;
-
- function driftSymbol(dx, dy) {
- this.parent.drift(dx, dy);
- }
-
- symbolProto._createSymbol = function (symbolType, data, idx) {
- // Remove paths created before
- this.removeAll();
-
- var seriesModel = data.hostModel;
- var color = data.getItemVisual(idx, 'color');
-
- var symbolPath = symbolUtil.createSymbol(
- symbolType, -0.5, -0.5, 1, 1, color
- );
-
- symbolPath.attr({
- style: {
- strokeNoScale: true
- },
- z2: 100,
- culling: true,
- scale: [0, 0]
- });
- // Rewrite drift method
- symbolPath.drift = driftSymbol;
-
- var size = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));
-
- graphic.initProps(symbolPath, {
- scale: size
- }, seriesModel);
-
- this._symbolType = symbolType;
-
- this.add(symbolPath);
- };
-
- /**
- * Stop animation
- * @param {boolean} toLastFrame
- */
- symbolProto.stopSymbolAnimation = function (toLastFrame) {
- this.childAt(0).stopAnimation(toLastFrame);
- };
-
- /**
- * Get scale(aka, current symbol size).
- * Including the change caused by animation
- * @param {Array.<number>} toLastFrame
- */
- symbolProto.getScale = function () {
- return this.childAt(0).scale;
- };
-
- /**
- * Highlight symbol
- */
- symbolProto.highlight = function () {
- this.childAt(0).trigger('emphasis');
- };
-
- /**
- * Downplay symbol
- */
- symbolProto.downplay = function () {
- this.childAt(0).trigger('normal');
- };
-
- /**
- * @param {number} zlevel
- * @param {number} z
- */
- symbolProto.setZ = function (zlevel, z) {
- var symbolPath = this.childAt(0);
- symbolPath.zlevel = zlevel;
- symbolPath.z = z;
- };
-
- symbolProto.setDraggable = function (draggable) {
- var symbolPath = this.childAt(0);
- symbolPath.draggable = draggable;
- symbolPath.cursor = draggable ? 'move' : 'pointer';
- };
- /**
- * Update symbol properties
- * @param {module:echarts/data/List} data
- * @param {number} idx
- */
- symbolProto.updateData = function (data, idx) {
- var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';
- var seriesModel = data.hostModel;
- var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));
- if (symbolType !== this._symbolType) {
- this._createSymbol(symbolType, data, idx);
- }
- else {
- var symbolPath = this.childAt(0);
- graphic.updateProps(symbolPath, {
- scale: symbolSize
- }, seriesModel);
- }
- this._updateCommon(data, idx, symbolSize);
-
- this._seriesModel = seriesModel;
- };
-
- // Update common properties
- var normalStyleAccessPath = ['itemStyle', 'normal'];
- var emphasisStyleAccessPath = ['itemStyle', 'emphasis'];
- var normalLabelAccessPath = ['label', 'normal'];
- var emphasisLabelAccessPath = ['label', 'emphasis'];
-
- symbolProto._updateCommon = function (data, idx, symbolSize) {
- var symbolPath = this.childAt(0);
- var seriesModel = data.hostModel;
- var itemModel = data.getItemModel(idx);
- var normalItemStyleModel = itemModel.getModel(normalStyleAccessPath);
- var color = data.getItemVisual(idx, 'color');
-
- var hoverStyle = itemModel.getModel(emphasisStyleAccessPath).getItemStyle();
-
- symbolPath.rotation = itemModel.getShallow('symbolRotate') * Math.PI / 180 || 0;
-
- var symbolOffset = itemModel.getShallow('symbolOffset');
- if (symbolOffset) {
- var pos = symbolPath.position;
- pos[0] = numberUtil.parsePercent(symbolOffset[0], symbolSize[0]);
- pos[1] = numberUtil.parsePercent(symbolOffset[1], symbolSize[1]);
- }
-
- symbolPath.setColor(color);
-
- zrUtil.extend(
- symbolPath.style,
- // Color must be excluded.
- // Because symbol provide setColor individually to set fill and stroke
- normalItemStyleModel.getItemStyle(['color'])
- );
-
- var labelModel = itemModel.getModel(normalLabelAccessPath);
- var hoverLabelModel = itemModel.getModel(emphasisLabelAccessPath);
-
- var elStyle = symbolPath.style;
-
- // Get last value dim
- var dimensions = data.dimensions.slice();
- var valueDim = dimensions.pop();
- var dataType;
- while (
- ((dataType = data.getDimensionInfo(valueDim).type) === 'ordinal')
- || (dataType === 'time')
- ) {
- valueDim = dimensions.pop();
- }
-
- if (labelModel.get('show')) {
- graphic.setText(elStyle, labelModel, color);
- elStyle.text = zrUtil.retrieve(
- seriesModel.getFormattedLabel(idx, 'normal'),
- data.get(valueDim, idx)
- );
- }
- else {
- elStyle.text = '';
- }
-
- if (hoverLabelModel.getShallow('show')) {
- graphic.setText(hoverStyle, hoverLabelModel, color);
- hoverStyle.text = zrUtil.retrieve(
- seriesModel.getFormattedLabel(idx, 'emphasis'),
- data.get(valueDim, idx)
- );
- }
- else {
- hoverStyle.text = '';
- }
-
- var size = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));
-
- symbolPath.off('mouseover')
- .off('mouseout')
- .off('emphasis')
- .off('normal');
-
- graphic.setHoverStyle(symbolPath, hoverStyle);
-
- if (itemModel.getShallow('hoverAnimation')) {
- var onEmphasis = function() {
- var ratio = size[1] / size[0];
- this.animateTo({
- scale: [
- Math.max(size[0] * 1.1, size[0] + 3),
- Math.max(size[1] * 1.1, size[1] + 3 * ratio)
- ]
- }, 400, 'elasticOut');
- };
- var onNormal = function() {
- this.animateTo({
- scale: size
- }, 400, 'elasticOut');
- };
- symbolPath.on('mouseover', onEmphasis)
- .on('mouseout', onNormal)
- .on('emphasis', onEmphasis)
- .on('normal', onNormal);
- }
- };
-
- symbolProto.fadeOut = function (cb) {
- var symbolPath = this.childAt(0);
- // Not show text when animating
- symbolPath.style.text = '';
- graphic.updateProps(symbolPath, {
- scale: [0, 0]
- }, this._seriesModel, cb);
- };
-
- zrUtil.inherits(Symbol, graphic.Group);
-
- module.exports = Symbol;
-
-
-/***/ },
-/* 100 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- // Symbol factory
-
-
- var graphic = __webpack_require__(42);
- var BoundingRect = __webpack_require__(15);
-
- /**
- * Triangle shape
- * @inner
- */
- var Triangle = graphic.extendShape({
- type: 'triangle',
- shape: {
- cx: 0,
- cy: 0,
- width: 0,
- height: 0
- },
- buildPath: function (path, shape) {
- var cx = shape.cx;
- var cy = shape.cy;
- var width = shape.width / 2;
- var height = shape.height / 2;
- path.moveTo(cx, cy - height);
- path.lineTo(cx + width, cy + height);
- path.lineTo(cx - width, cy + height);
- path.closePath();
- }
- });
- /**
- * Diamond shape
- * @inner
- */
- var Diamond = graphic.extendShape({
- type: 'diamond',
- shape: {
- cx: 0,
- cy: 0,
- width: 0,
- height: 0
- },
- buildPath: function (path, shape) {
- var cx = shape.cx;
- var cy = shape.cy;
- var width = shape.width / 2;
- var height = shape.height / 2;
- path.moveTo(cx, cy - height);
- path.lineTo(cx + width, cy);
- path.lineTo(cx, cy + height);
- path.lineTo(cx - width, cy);
- path.closePath();
- }
- });
-
- /**
- * Pin shape
- * @inner
- */
- var Pin = graphic.extendShape({
- type: 'pin',
- shape: {
- // x, y on the cusp
- x: 0,
- y: 0,
- width: 0,
- height: 0
- },
-
- buildPath: function (path, shape) {
- var x = shape.x;
- var y = shape.y;
- var w = shape.width / 5 * 3;
- // Height must be larger than width
- var h = Math.max(w, shape.height);
- var r = w / 2;
-
- // Dist on y with tangent point and circle center
- var dy = r * r / (h - r);
- var cy = y - h + r + dy;
- var angle = Math.asin(dy / r);
- // Dist on x with tangent point and circle center
- var dx = Math.cos(angle) * r;
-
- var tanX = Math.sin(angle);
- var tanY = Math.cos(angle);
-
- path.arc(
- x, cy, r,
- Math.PI - angle,
- Math.PI * 2 + angle
- );
-
- var cpLen = r * 0.6;
- var cpLen2 = r * 0.7;
- path.bezierCurveTo(
- x + dx - tanX * cpLen, cy + dy + tanY * cpLen,
- x, y - cpLen2,
- x, y
- );
- path.bezierCurveTo(
- x, y - cpLen2,
- x - dx + tanX * cpLen, cy + dy + tanY * cpLen,
- x - dx, cy + dy
- );
- path.closePath();
- }
- });
-
- /**
- * Arrow shape
- * @inner
- */
- var Arrow = graphic.extendShape({
-
- type: 'arrow',
-
- shape: {
- x: 0,
- y: 0,
- width: 0,
- height: 0
- },
-
- buildPath: function (ctx, shape) {
- var height = shape.height;
- var width = shape.width;
- var x = shape.x;
- var y = shape.y;
- var dx = width / 3 * 2;
- ctx.moveTo(x, y);
- ctx.lineTo(x + dx, y + height);
- ctx.lineTo(x, y + height / 4 * 3);
- ctx.lineTo(x - dx, y + height);
- ctx.lineTo(x, y);
- ctx.closePath();
- }
- });
-
- /**
- * Map of path contructors
- * @type {Object.<string, module:zrender/graphic/Path>}
- */
- var symbolCtors = {
- line: graphic.Line,
-
- rect: graphic.Rect,
-
- roundRect: graphic.Rect,
-
- square: graphic.Rect,
-
- circle: graphic.Circle,
-
- diamond: Diamond,
-
- pin: Pin,
-
- arrow: Arrow,
-
- triangle: Triangle
- };
-
- var symbolShapeMakers = {
-
- line: function (x, y, w, h, shape) {
- // FIXME
- shape.x1 = x;
- shape.y1 = y + h / 2;
- shape.x2 = x + w;
- shape.y2 = y + h / 2;
- },
-
- rect: function (x, y, w, h, shape) {
- shape.x = x;
- shape.y = y;
- shape.width = w;
- shape.height = h;
- },
-
- roundRect: function (x, y, w, h, shape) {
- shape.x = x;
- shape.y = y;
- shape.width = w;
- shape.height = h;
- shape.r = Math.min(w, h) / 4;
- },
-
- square: function (x, y, w, h, shape) {
- var size = Math.min(w, h);
- shape.x = x;
- shape.y = y;
- shape.width = size;
- shape.height = size;
- },
-
- circle: function (x, y, w, h, shape) {
- // Put circle in the center of square
- shape.cx = x + w / 2;
- shape.cy = y + h / 2;
- shape.r = Math.min(w, h) / 2;
- },
-
- diamond: function (x, y, w, h, shape) {
- shape.cx = x + w / 2;
- shape.cy = y + h / 2;
- shape.width = w;
- shape.height = h;
- },
-
- pin: function (x, y, w, h, shape) {
- shape.x = x + w / 2;
- shape.y = y + h / 2;
- shape.width = w;
- shape.height = h;
- },
-
- arrow: function (x, y, w, h, shape) {
- shape.x = x + w / 2;
- shape.y = y + h / 2;
- shape.width = w;
- shape.height = h;
- },
-
- triangle: function (x, y, w, h, shape) {
- shape.cx = x + w / 2;
- shape.cy = y + h / 2;
- shape.width = w;
- shape.height = h;
- }
- };
-
- var symbolBuildProxies = {};
- for (var name in symbolCtors) {
- symbolBuildProxies[name] = new symbolCtors[name]();
- }
-
- var Symbol = graphic.extendShape({
-
- type: 'symbol',
-
- shape: {
- symbolType: '',
- x: 0,
- y: 0,
- width: 0,
- height: 0
- },
-
- beforeBrush: function () {
- var style = this.style;
- var shape = this.shape;
- // FIXME
- if (shape.symbolType === 'pin' && style.textPosition === 'inside') {
- style.textPosition = ['50%', '40%'];
- style.textAlign = 'center';
- style.textVerticalAlign = 'middle';
- }
- },
-
- buildPath: function (ctx, shape) {
- var symbolType = shape.symbolType;
- var proxySymbol = symbolBuildProxies[symbolType];
- if (shape.symbolType !== 'none') {
- if (!proxySymbol) {
- // Default rect
- symbolType = 'rect';
- proxySymbol = symbolBuildProxies[symbolType];
- }
- symbolShapeMakers[symbolType](
- shape.x, shape.y, shape.width, shape.height, proxySymbol.shape
- );
- proxySymbol.buildPath(ctx, proxySymbol.shape);
- }
- }
- });
-
- // Provide setColor helper method to avoid determine if set the fill or stroke outside
- var symbolPathSetColor = function (color) {
- if (this.type !== 'image') {
- var symbolStyle = this.style;
- var symbolShape = this.shape;
- if (symbolShape && symbolShape.symbolType === 'line') {
- symbolStyle.stroke = color;
- }
- else if (this.__isEmptyBrush) {
- symbolStyle.stroke = color;
- symbolStyle.fill = '#fff';
- }
- else {
- // FIXME 判断图形默认是填充还是描边,使用 onlyStroke ?
- symbolStyle.fill && (symbolStyle.fill = color);
- symbolStyle.stroke && (symbolStyle.stroke = color);
- }
- this.dirty();
- }
- };
-
- var symbolUtil = {
- /**
- * Create a symbol element with given symbol configuration: shape, x, y, width, height, color
- * @param {string} symbolType
- * @param {number} x
- * @param {number} y
- * @param {number} w
- * @param {number} h
- * @param {string} color
- */
- createSymbol: function (symbolType, x, y, w, h, color) {
- var isEmpty = symbolType.indexOf('empty') === 0;
- if (isEmpty) {
- symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);
- }
- var symbolPath;
-
- if (symbolType.indexOf('image://') === 0) {
- symbolPath = new graphic.Image({
- style: {
- image: symbolType.slice(8),
- x: x,
- y: y,
- width: w,
- height: h
- }
- });
- }
- else if (symbolType.indexOf('path://') === 0) {
- symbolPath = graphic.makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h));
- }
- else {
- symbolPath = new Symbol({
- shape: {
- symbolType: symbolType,
- x: x,
- y: y,
- width: w,
- height: h
- }
- });
- }
-
- symbolPath.__isEmptyBrush = isEmpty;
-
- symbolPath.setColor = symbolPathSetColor;
-
- symbolPath.setColor(color);
-
- return symbolPath;
- }
- };
-
- module.exports = symbolUtil;
-
-
-/***/ },
-/* 101 */
-/***/ function(module, exports) {
-
-
-
- // var arrayDiff = require('zrender/lib/core/arrayDiff');
- // 'zrender/core/arrayDiff' has been used before, but it did
- // not do well in performance when roam with fixed dataZoom window.
-
- function sign(val) {
- return val >= 0 ? 1 : -1;
- }
-
- function getStackedOnPoint(coordSys, data, idx) {
- var baseAxis = coordSys.getBaseAxis();
- var valueAxis = coordSys.getOtherAxis(baseAxis);
- var valueStart = baseAxis.onZero
- ? 0 : valueAxis.scale.getExtent()[0];
-
- var valueDim = valueAxis.dim;
- var baseDataOffset = valueDim === 'x' || valueDim === 'radius' ? 1 : 0;
-
- var stackedOnSameSign;
- var stackedOn = data.stackedOn;
- var val = data.get(valueDim, idx);
- // Find first stacked value with same sign
- while (stackedOn &&
- sign(stackedOn.get(valueDim, idx)) === sign(val)
- ) {
- stackedOnSameSign = stackedOn;
- break;
- }
- var stackedData = [];
- stackedData[baseDataOffset] = data.get(baseAxis.dim, idx);
- stackedData[1 - baseDataOffset] = stackedOnSameSign
- ? stackedOnSameSign.get(valueDim, idx, true) : valueStart;
-
- return coordSys.dataToPoint(stackedData);
- }
-
- // function convertToIntId(newIdList, oldIdList) {
- // // Generate int id instead of string id.
- // // Compare string maybe slow in score function of arrDiff
-
- // // Assume id in idList are all unique
- // var idIndicesMap = {};
- // var idx = 0;
- // for (var i = 0; i < newIdList.length; i++) {
- // idIndicesMap[newIdList[i]] = idx;
- // newIdList[i] = idx++;
- // }
- // for (var i = 0; i < oldIdList.length; i++) {
- // var oldId = oldIdList[i];
- // // Same with newIdList
- // if (idIndicesMap[oldId]) {
- // oldIdList[i] = idIndicesMap[oldId];
- // }
- // else {
- // oldIdList[i] = idx++;
- // }
- // }
- // }
-
- function diffData(oldData, newData) {
- var diffResult = [];
-
- newData.diff(oldData)
- .add(function (idx) {
- diffResult.push({cmd: '+', idx: idx});
- })
- .update(function (newIdx, oldIdx) {
- diffResult.push({cmd: '=', idx: oldIdx, idx1: newIdx});
- })
- .remove(function (idx) {
- diffResult.push({cmd: '-', idx: idx});
- })
- .execute();
-
- return diffResult;
- }
-
- module.exports = function (
- oldData, newData,
- oldStackedOnPoints, newStackedOnPoints,
- oldCoordSys, newCoordSys
- ) {
- var diff = diffData(oldData, newData);
-
- // var newIdList = newData.mapArray(newData.getId);
- // var oldIdList = oldData.mapArray(oldData.getId);
-
- // convertToIntId(newIdList, oldIdList);
-
- // // FIXME One data ?
- // diff = arrayDiff(oldIdList, newIdList);
-
- var currPoints = [];
- var nextPoints = [];
- // Points for stacking base line
- var currStackedPoints = [];
- var nextStackedPoints = [];
-
- var status = [];
- var sortedIndices = [];
- var rawIndices = [];
- var dims = newCoordSys.dimensions;
- for (var i = 0; i < diff.length; i++) {
- var diffItem = diff[i];
- var pointAdded = true;
-
- // FIXME, animation is not so perfect when dataZoom window moves fast
- // Which is in case remvoing or add more than one data in the tail or head
- switch (diffItem.cmd) {
- case '=':
- var currentPt = oldData.getItemLayout(diffItem.idx);
- var nextPt = newData.getItemLayout(diffItem.idx1);
- // If previous data is NaN, use next point directly
- if (isNaN(currentPt[0]) || isNaN(currentPt[1])) {
- currentPt = nextPt.slice();
- }
- currPoints.push(currentPt);
- nextPoints.push(nextPt);
-
- currStackedPoints.push(oldStackedOnPoints[diffItem.idx]);
- nextStackedPoints.push(newStackedOnPoints[diffItem.idx1]);
-
- rawIndices.push(newData.getRawIndex(diffItem.idx1));
- break;
- case '+':
- var idx = diffItem.idx;
- currPoints.push(
- oldCoordSys.dataToPoint([
- newData.get(dims[0], idx, true), newData.get(dims[1], idx, true)
- ])
- );
-
- nextPoints.push(newData.getItemLayout(idx).slice());
-
- currStackedPoints.push(
- getStackedOnPoint(oldCoordSys, newData, idx)
- );
- nextStackedPoints.push(newStackedOnPoints[idx]);
-
- rawIndices.push(newData.getRawIndex(idx));
- break;
- case '-':
- var idx = diffItem.idx;
- var rawIndex = oldData.getRawIndex(idx);
- // Data is replaced. In the case of dynamic data queue
- // FIXME FIXME FIXME
- if (rawIndex !== idx) {
- currPoints.push(oldData.getItemLayout(idx));
- nextPoints.push(newCoordSys.dataToPoint([
- oldData.get(dims[0], idx, true), oldData.get(dims[1], idx, true)
- ]));
-
- currStackedPoints.push(oldStackedOnPoints[idx]);
- nextStackedPoints.push(
- getStackedOnPoint(
- newCoordSys, oldData, idx
- )
- );
-
- rawIndices.push(rawIndex);
- }
- else {
- pointAdded = false;
- }
- }
-
- // Original indices
- if (pointAdded) {
- status.push(diffItem);
- sortedIndices.push(sortedIndices.length);
- }
- }
-
- // Diff result may be crossed if all items are changed
- // Sort by data index
- sortedIndices.sort(function (a, b) {
- return rawIndices[a] - rawIndices[b];
- });
-
- var sortedCurrPoints = [];
- var sortedNextPoints = [];
-
- var sortedCurrStackedPoints = [];
- var sortedNextStackedPoints = [];
-
- var sortedStatus = [];
- for (var i = 0; i < sortedIndices.length; i++) {
- var idx = sortedIndices[i];
- sortedCurrPoints[i] = currPoints[idx];
- sortedNextPoints[i] = nextPoints[idx];
-
- sortedCurrStackedPoints[i] = currStackedPoints[idx];
- sortedNextStackedPoints[i] = nextStackedPoints[idx];
-
- sortedStatus[i] = status[idx];
- }
-
- return {
- current: sortedCurrPoints,
- next: sortedNextPoints,
-
- stackedOnCurrent: sortedCurrStackedPoints,
- stackedOnNext: sortedNextStackedPoints,
-
- status: sortedStatus
- };
- };
-
-
-/***/ },
-/* 102 */
-/***/ function(module, exports, __webpack_require__) {
-
- // Poly path support NaN point
-
-
- var Path = __webpack_require__(44);
- var vec2 = __webpack_require__(16);
-
- var vec2Min = vec2.min;
- var vec2Max = vec2.max;
-
- var scaleAndAdd = vec2.scaleAndAdd;
- var v2Copy = vec2.copy;
-
- // Temporary variable
- var v = [];
- var cp0 = [];
- var cp1 = [];
-
- function drawSegment(
- ctx, points, start, stop, len,
- dir, smoothMin, smoothMax, smooth, smoothMonotone
- ) {
- var idx = start;
- for (var k = 0; k < len; k++) {
- var p = points[idx];
- if (idx >= stop || idx < 0 || isNaN(p[0]) || isNaN(p[1])) {
- break;
- }
-
- if (idx === start) {
- ctx[dir > 0 ? 'moveTo' : 'lineTo'](p[0], p[1]);
- v2Copy(cp0, p);
- }
- else {
- if (smooth > 0) {
- var prevIdx = idx - dir;
- var nextIdx = idx + dir;
-
- var ratioNextSeg = 0.5;
- var prevP = points[prevIdx];
- var nextP = points[nextIdx];
- // Last point
- if ((dir > 0 && (idx === len - 1 || isNaN(nextP[0]) || isNaN(nextP[1])))
- || (dir <= 0 && (idx === 0 || isNaN(nextP[0]) || isNaN(nextP[1])))
- ) {
- v2Copy(cp1, p);
- }
- else {
- // If next data is null
- if (isNaN(nextP[0]) || isNaN(nextP[1])) {
- nextP = p;
- }
-
- vec2.sub(v, nextP, prevP);
-
- var lenPrevSeg;
- var lenNextSeg;
- if (smoothMonotone === 'x' || smoothMonotone === 'y') {
- var dim = smoothMonotone === 'x' ? 0 : 1;
- lenPrevSeg = Math.abs(p[dim] - prevP[dim]);
- lenNextSeg = Math.abs(p[dim] - nextP[dim]);
- }
- else {
- lenPrevSeg = vec2.dist(p, prevP);
- lenNextSeg = vec2.dist(p, nextP);
- }
-
- // Use ratio of seg length
- ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);
-
- scaleAndAdd(cp1, p, v, -smooth * (1 - ratioNextSeg));
- }
- // Smooth constraint
- vec2Min(cp0, cp0, smoothMax);
- vec2Max(cp0, cp0, smoothMin);
- vec2Min(cp1, cp1, smoothMax);
- vec2Max(cp1, cp1, smoothMin);
-
- ctx.bezierCurveTo(
- cp0[0], cp0[1],
- cp1[0], cp1[1],
- p[0], p[1]
- );
- // cp0 of next segment
- scaleAndAdd(cp0, p, v, smooth * ratioNextSeg);
- }
- else {
- ctx.lineTo(p[0], p[1]);
- }
- }
-
- idx += dir;
- }
-
- return k;
- }
-
- function getBoundingBox(points, smoothConstraint) {
- var ptMin = [Infinity, Infinity];
- var ptMax = [-Infinity, -Infinity];
- if (smoothConstraint) {
- for (var i = 0; i < points.length; i++) {
- var pt = points[i];
- if (pt[0] < ptMin[0]) { ptMin[0] = pt[0]; }
- if (pt[1] < ptMin[1]) { ptMin[1] = pt[1]; }
- if (pt[0] > ptMax[0]) { ptMax[0] = pt[0]; }
- if (pt[1] > ptMax[1]) { ptMax[1] = pt[1]; }
- }
- }
- return {
- min: smoothConstraint ? ptMin : ptMax,
- max: smoothConstraint ? ptMax : ptMin
- };
- }
-
- module.exports = {
-
- Polyline: Path.extend({
-
- type: 'ec-polyline',
-
- shape: {
- points: [],
-
- smooth: 0,
-
- smoothConstraint: true,
-
- smoothMonotone: null
- },
-
- style: {
- fill: null,
-
- stroke: '#000'
- },
-
- buildPath: function (ctx, shape) {
- var points = shape.points;
-
- var i = 0;
- var len = points.length;
-
- var result = getBoundingBox(points, shape.smoothConstraint);
-
- while (i < len) {
- i += drawSegment(
- ctx, points, i, len, len,
- 1, result.min, result.max, shape.smooth,
- shape.smoothMonotone
- ) + 1;
- }
- }
- }),
-
- Polygon: Path.extend({
-
- type: 'ec-polygon',
-
- shape: {
- points: [],
-
- // Offset between stacked base points and points
- stackedOnPoints: [],
-
- smooth: 0,
-
- stackedOnSmooth: 0,
-
- smoothConstraint: true,
-
- smoothMonotone: null
- },
-
- buildPath: function (ctx, shape) {
- var points = shape.points;
- var stackedOnPoints = shape.stackedOnPoints;
-
- var i = 0;
- var len = points.length;
- var smoothMonotone = shape.smoothMonotone;
- var bbox = getBoundingBox(points, shape.smoothConstraint);
- var stackedOnBBox = getBoundingBox(stackedOnPoints, shape.smoothConstraint);
- while (i < len) {
- var k = drawSegment(
- ctx, points, i, len, len,
- 1, bbox.min, bbox.max, shape.smooth,
- smoothMonotone
- );
- drawSegment(
- ctx, stackedOnPoints, i + k - 1, len, k,
- -1, stackedOnBBox.min, stackedOnBBox.max, shape.stackedOnSmooth,
- smoothMonotone
- );
- i += k + 1;
-
- ctx.closePath();
- }
- }
- })
- };
-
-
-/***/ },
-/* 103 */
-/***/ function(module, exports) {
-
-
-
- module.exports = function (seriesType, defaultSymbolType, legendSymbol, ecModel, api) {
-
- // Encoding visual for all series include which is filtered for legend drawing
- ecModel.eachRawSeriesByType(seriesType, function (seriesModel) {
- var data = seriesModel.getData();
-
- var symbolType = seriesModel.get('symbol') || defaultSymbolType;
- var symbolSize = seriesModel.get('symbolSize');
-
- data.setVisual({
- legendSymbol: legendSymbol || symbolType,
- symbol: symbolType,
- symbolSize: symbolSize
- });
-
- // Only visible series has each data be visual encoded
- if (!ecModel.isSeriesFiltered(seriesModel)) {
- if (typeof symbolSize === 'function') {
- data.each(function (idx) {
- var rawValue = seriesModel.getRawValue(idx);
- // FIXME
- var params = seriesModel.getDataParams(idx);
- data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params));
- });
- }
- data.each(function (idx) {
- var itemModel = data.getItemModel(idx);
- var itemSymbolType = itemModel.get('symbol', true);
- var itemSymbolSize = itemModel.get('symbolSize', true);
- // If has item symbol
- if (itemSymbolType != null) {
- data.setItemVisual(idx, 'symbol', itemSymbolType);
- }
- if (itemSymbolSize != null) {
- // PENDING Transform symbolSize ?
- data.setItemVisual(idx, 'symbolSize', itemSymbolSize);
- }
- });
- }
- });
- };
-
-
-/***/ },
-/* 104 */
-/***/ function(module, exports) {
-
-
-
- module.exports = function (seriesType, ecModel, api) {
- ecModel.eachSeriesByType(seriesType, function (seriesModel) {
- var data = seriesModel.getData();
- var coordSys = seriesModel.coordinateSystem;
-
- var dims = coordSys.dimensions;
- data.each(dims, function (x, y, idx) {
- var point;
- if (!isNaN(x) && !isNaN(y)) {
- point = coordSys.dataToPoint([x, y]);
- }
- else {
- // Also {Array.<number>}, not undefined to avoid if...else... statement
- point = [NaN, NaN];
- }
-
- data.setItemLayout(idx, point);
- }, true);
- });
- };
-
-
-/***/ },
-/* 105 */
-/***/ function(module, exports) {
-
-
- var samplers = {
- average: function (frame) {
- var sum = 0;
- var count = 0;
- for (var i = 0; i < frame.length; i++) {
- if (!isNaN(frame[i])) {
- sum += frame[i];
- count++;
- }
- }
- // Return NaN if count is 0
- return count === 0 ? NaN : sum / count;
- },
- sum: function (frame) {
- var sum = 0;
- for (var i = 0; i < frame.length; i++) {
- // Ignore NaN
- sum += frame[i] || 0;
- }
- return sum;
- },
- max: function (frame) {
- var max = -Infinity;
- for (var i = 0; i < frame.length; i++) {
- frame[i] > max && (max = frame[i]);
- }
- return max;
- },
- min: function (frame) {
- var min = Infinity;
- for (var i = 0; i < frame.length; i++) {
- frame[i] < min && (min = frame[i]);
- }
- return min;
- }
- };
-
- var indexSampler = function (frame, value) {
- return Math.round(frame.length / 2);
- };
- module.exports = function (seriesType, ecModel, api) {
- ecModel.eachSeriesByType(seriesType, function (seriesModel) {
- var data = seriesModel.getData();
- var sampling = seriesModel.get('sampling');
- var coordSys = seriesModel.coordinateSystem;
- // Only cartesian2d support down sampling
- if (coordSys.type === 'cartesian2d' && sampling) {
- var baseAxis = coordSys.getBaseAxis();
- var valueAxis = coordSys.getOtherAxis(baseAxis);
- var extent = baseAxis.getExtent();
- // Coordinste system has been resized
- var size = extent[1] - extent[0];
- var rate = Math.round(data.count() / size);
- if (rate > 1) {
- var sampler;
- if (typeof sampling === 'string') {
- sampler = samplers[sampling];
- }
- else if (typeof sampling === 'function') {
- sampler = sampling;
- }
- if (sampler) {
- data = data.downSample(
- valueAxis.dim, 1 / rate, sampler, indexSampler
- );
- seriesModel.setData(data);
- }
- }
- }
- }, this);
- };
-
-
-/***/ },
-/* 106 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var graphic = __webpack_require__(42);
- var zrUtil = __webpack_require__(3);
-
- __webpack_require__(107);
-
- __webpack_require__(124);
-
- // Grid view
- __webpack_require__(1).extendComponentView({
-
- type: 'grid',
-
- render: function (gridModel, ecModel) {
- this.group.removeAll();
- if (gridModel.get('show')) {
- this.group.add(new graphic.Rect({
- shape:gridModel.coordinateSystem.getRect(),
- style: zrUtil.defaults({
- fill: gridModel.get('backgroundColor')
- }, gridModel.getItemStyle()),
- silent: true
- }));
- }
- }
- });
-
-
-/***/ },
-/* 107 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Grid is a region which contains at most 4 cartesian systems
- *
- * TODO Default cartesian
- */
- var factory = exports;
-
- var layout = __webpack_require__(21);
- var axisHelper = __webpack_require__(108);
-
- var zrUtil = __webpack_require__(3);
- var Cartesian2D = __webpack_require__(114);
- var Axis2D = __webpack_require__(116);
-
- var each = zrUtil.each;
-
- var ifAxisCrossZero = axisHelper.ifAxisCrossZero;
- var niceScaleExtent = axisHelper.niceScaleExtent;
-
- // 依赖 GridModel, AxisModel 做预处理
- __webpack_require__(119);
-
- /**
- * Check if the axis is used in the specified grid
- * @inner
- */
- function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) {
- return ecModel.getComponent('grid', axisModel.get('gridIndex')) === gridModel;
- }
-
- function getLabelUnionRect(axis) {
- var axisModel = axis.model;
- var labels = axisModel.getFormattedLabels();
- var rect;
- var step = 1;
- var labelCount = labels.length;
- if (labelCount > 40) {
- // Simple optimization for large amount of labels
- step = Math.ceil(labelCount / 40);
- }
- for (var i = 0; i < labelCount; i += step) {
- if (!axis.isLabelIgnored(i)) {
- var singleRect = axisModel.getTextRect(labels[i]);
- // FIXME consider label rotate
- rect ? rect.union(singleRect) : (rect = singleRect);
- }
- }
- return rect;
- }
-
- function Grid(gridModel, ecModel, api) {
- /**
- * @type {Object.<string, module:echarts/coord/cartesian/Cartesian2D>}
- * @private
- */
- this._coordsMap = {};
-
- /**
- * @type {Array.<module:echarts/coord/cartesian/Cartesian>}
- * @private
- */
- this._coordsList = [];
-
- /**
- * @type {Object.<string, module:echarts/coord/cartesian/Axis2D>}
- * @private
- */
- this._axesMap = {};
-
- /**
- * @type {Array.<module:echarts/coord/cartesian/Axis2D>}
- * @private
- */
- this._axesList = [];
-
- this._initCartesian(gridModel, ecModel, api);
-
- this._model = gridModel;
- }
-
- var gridProto = Grid.prototype;
-
- gridProto.type = 'grid';
-
- gridProto.getRect = function () {
- return this._rect;
- };
-
- gridProto.update = function (ecModel, api) {
-
- var axesMap = this._axesMap;
-
- this._updateScale(ecModel, this._model);
-
- function ifAxisCanNotOnZero(otherAxisDim) {
- var axes = axesMap[otherAxisDim];
- for (var idx in axes) {
- var axis = axes[idx];
- if (axis && (axis.type === 'category' || !ifAxisCrossZero(axis))) {
- return true;
- }
- }
- return false;
- }
-
- each(axesMap.x, function (xAxis) {
- niceScaleExtent(xAxis, xAxis.model);
- });
- each(axesMap.y, function (yAxis) {
- niceScaleExtent(yAxis, yAxis.model);
- });
- // Fix configuration
- each(axesMap.x, function (xAxis) {
- // onZero can not be enabled in these two situations
- // 1. When any other axis is a category axis
- // 2. When any other axis not across 0 point
- if (ifAxisCanNotOnZero('y')) {
- xAxis.onZero = false;
- }
- });
- each(axesMap.y, function (yAxis) {
- if (ifAxisCanNotOnZero('x')) {
- yAxis.onZero = false;
- }
- });
-
- // Resize again if containLabel is enabled
- // FIXME It may cause getting wrong grid size in data processing stage
- this.resize(this._model, api);
- };
-
- /**
- * Resize the grid
- * @param {module:echarts/coord/cartesian/GridModel} gridModel
- * @param {module:echarts/ExtensionAPI} api
- */
- gridProto.resize = function (gridModel, api) {
-
- var gridRect = layout.getLayoutRect(
- gridModel.getBoxLayoutParams(), {
- width: api.getWidth(),
- height: api.getHeight()
- });
-
- this._rect = gridRect;
-
- var axesList = this._axesList;
-
- adjustAxes();
-
- // Minus label size
- if (gridModel.get('containLabel')) {
- each(axesList, function (axis) {
- if (!axis.model.get('axisLabel.inside')) {
- var labelUnionRect = getLabelUnionRect(axis);
- if (labelUnionRect) {
- var dim = axis.isHorizontal() ? 'height' : 'width';
- var margin = axis.model.get('axisLabel.margin');
- gridRect[dim] -= labelUnionRect[dim] + margin;
- if (axis.position === 'top') {
- gridRect.y += labelUnionRect.height + margin;
- }
- else if (axis.position === 'left') {
- gridRect.x += labelUnionRect.width + margin;
- }
- }
- }
- });
-
- adjustAxes();
- }
-
- function adjustAxes() {
- each(axesList, function (axis) {
- var isHorizontal = axis.isHorizontal();
- var extent = isHorizontal ? [0, gridRect.width] : [0, gridRect.height];
- var idx = axis.inverse ? 1 : 0;
- axis.setExtent(extent[idx], extent[1 - idx]);
- updateAxisTransfrom(axis, isHorizontal ? gridRect.x : gridRect.y);
- });
- }
- };
-
- /**
- * @param {string} axisType
- * @param {ndumber} [axisIndex]
- */
- gridProto.getAxis = function (axisType, axisIndex) {
- var axesMapOnDim = this._axesMap[axisType];
- if (axesMapOnDim != null) {
- if (axisIndex == null) {
- // Find first axis
- for (var name in axesMapOnDim) {
- return axesMapOnDim[name];
- }
- }
- return axesMapOnDim[axisIndex];
- }
- };
-
- gridProto.getCartesian = function (xAxisIndex, yAxisIndex) {
- var key = 'x' + xAxisIndex + 'y' + yAxisIndex;
- return this._coordsMap[key];
- };
-
- /**
- * Initialize cartesian coordinate systems
- * @private
- */
- gridProto._initCartesian = function (gridModel, ecModel, api) {
- var axisPositionUsed = {
- left: false,
- right: false,
- top: false,
- bottom: false
- };
-
- var axesMap = {
- x: {},
- y: {}
- };
- var axesCount = {
- x: 0,
- y: 0
- };
-
- /// Create axis
- ecModel.eachComponent('xAxis', createAxisCreator('x'), this);
- ecModel.eachComponent('yAxis', createAxisCreator('y'), this);
-
- if (!axesCount.x || !axesCount.y) {
- // Roll back when there no either x or y axis
- this._axesMap = {};
- this._axesList = [];
- return;
- }
-
- this._axesMap = axesMap;
-
- /// Create cartesian2d
- each(axesMap.x, function (xAxis, xAxisIndex) {
- each(axesMap.y, function (yAxis, yAxisIndex) {
- var key = 'x' + xAxisIndex + 'y' + yAxisIndex;
- var cartesian = new Cartesian2D(key);
-
- cartesian.grid = this;
-
- this._coordsMap[key] = cartesian;
- this._coordsList.push(cartesian);
-
- cartesian.addAxis(xAxis);
- cartesian.addAxis(yAxis);
- }, this);
- }, this);
-
- function createAxisCreator(axisType) {
- return function (axisModel, idx) {
- if (!isAxisUsedInTheGrid(axisModel, gridModel, ecModel)) {
- return;
- }
-
- var axisPosition = axisModel.get('position');
- if (axisType === 'x') {
- // Fix position
- if (axisPosition !== 'top' && axisPosition !== 'bottom') {
- // Default bottom of X
- axisPosition = 'bottom';
- }
- if (axisPositionUsed[axisPosition]) {
- axisPosition = axisPosition === 'top' ? 'bottom' : 'top';
- }
- }
- else {
- // Fix position
- if (axisPosition !== 'left' && axisPosition !== 'right') {
- // Default left of Y
- axisPosition = 'left';
- }
- if (axisPositionUsed[axisPosition]) {
- axisPosition = axisPosition === 'left' ? 'right' : 'left';
- }
- }
- axisPositionUsed[axisPosition] = true;
-
- var axis = new Axis2D(
- axisType, axisHelper.createScaleByModel(axisModel),
- [0, 0],
- axisModel.get('type'),
- axisPosition
- );
-
- var isCategory = axis.type === 'category';
- axis.onBand = isCategory && axisModel.get('boundaryGap');
- axis.inverse = axisModel.get('inverse');
-
- axis.onZero = axisModel.get('axisLine.onZero');
-
- // Inject axis into axisModel
- axisModel.axis = axis;
-
- // Inject axisModel into axis
- axis.model = axisModel;
-
- // Index of axis, can be used as key
- axis.index = idx;
-
- this._axesList.push(axis);
-
- axesMap[axisType][idx] = axis;
- axesCount[axisType]++;
- };
- }
- };
-
- /**
- * Update cartesian properties from series
- * @param {module:echarts/model/Option} option
- * @private
- */
- gridProto._updateScale = function (ecModel, gridModel) {
- // Reset scale
- zrUtil.each(this._axesList, function (axis) {
- axis.scale.setExtent(Infinity, -Infinity);
- });
- ecModel.eachSeries(function (seriesModel) {
- if (seriesModel.get('coordinateSystem') === 'cartesian2d') {
- var xAxisIndex = seriesModel.get('xAxisIndex');
- var yAxisIndex = seriesModel.get('yAxisIndex');
-
- var xAxisModel = ecModel.getComponent('xAxis', xAxisIndex);
- var yAxisModel = ecModel.getComponent('yAxis', yAxisIndex);
-
- if (!isAxisUsedInTheGrid(xAxisModel, gridModel, ecModel)
- || !isAxisUsedInTheGrid(yAxisModel, gridModel, ecModel)
- ) {
- return;
- }
-
- var cartesian = this.getCartesian(xAxisIndex, yAxisIndex);
- var data = seriesModel.getData();
- var xAxis = cartesian.getAxis('x');
- var yAxis = cartesian.getAxis('y');
-
- if (data.type === 'list') {
- unionExtent(data, xAxis, seriesModel);
- unionExtent(data, yAxis, seriesModel);
- }
- }
- }, this);
-
- function unionExtent(data, axis, seriesModel) {
- each(seriesModel.coordDimToDataDim(axis.dim), function (dim) {
- axis.scale.unionExtent(data.getDataExtent(
- dim, axis.scale.type !== 'ordinal'
- ));
- });
- }
- };
-
- /**
- * @inner
- */
- function updateAxisTransfrom(axis, coordBase) {
- var axisExtent = axis.getExtent();
- var axisExtentSum = axisExtent[0] + axisExtent[1];
-
- // Fast transform
- axis.toGlobalCoord = axis.dim === 'x'
- ? function (coord) {
- return coord + coordBase;
- }
- : function (coord) {
- return axisExtentSum - coord + coordBase;
- };
- axis.toLocalCoord = axis.dim === 'x'
- ? function (coord) {
- return coord - coordBase;
- }
- : function (coord) {
- return axisExtentSum - coord + coordBase;
- };
- }
-
- Grid.create = function (ecModel, api) {
- var grids = [];
- ecModel.eachComponent('grid', function (gridModel, idx) {
- var grid = new Grid(gridModel, ecModel, api);
- grid.name = 'grid_' + idx;
- grid.resize(gridModel, api);
-
- gridModel.coordinateSystem = grid;
-
- grids.push(grid);
- });
-
- // Inject the coordinateSystems into seriesModel
- ecModel.eachSeries(function (seriesModel) {
- if (seriesModel.get('coordinateSystem') !== 'cartesian2d') {
- return;
- }
- var xAxisIndex = seriesModel.get('xAxisIndex');
- // TODO Validate
- var xAxisModel = ecModel.getComponent('xAxis', xAxisIndex);
- var grid = grids[xAxisModel.get('gridIndex')];
- seriesModel.coordinateSystem = grid.getCartesian(
- xAxisIndex, seriesModel.get('yAxisIndex')
- );
- });
-
- return grids;
- };
-
- // For deciding which dimensions to use when creating list data
- Grid.dimensions = Cartesian2D.prototype.dimensions;
-
- __webpack_require__(25).register('cartesian2d', Grid);
-
- module.exports = Grid;
-
-
-/***/ },
-/* 108 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var OrdinalScale = __webpack_require__(109);
- var IntervalScale = __webpack_require__(111);
- __webpack_require__(112);
- __webpack_require__(113);
- var Scale = __webpack_require__(110);
-
- var numberUtil = __webpack_require__(7);
- var zrUtil = __webpack_require__(3);
- var textContain = __webpack_require__(14);
- var axisHelper = {};
-
- /**
- * Get axis scale extent before niced.
- */
- axisHelper.getScaleExtent = function (axis, model) {
- var scale = axis.scale;
- var originalExtent = scale.getExtent();
- var span = originalExtent[1] - originalExtent[0];
- if (scale.type === 'ordinal') {
- // If series has no data, scale extent may be wrong
- if (!isFinite(span)) {
- return [0, 0];
- }
- else {
- return originalExtent;
- }
- }
- var min = model.getMin ? model.getMin() : model.get('min');
- var max = model.getMax ? model.getMax() : model.get('max');
- var crossZero = model.getNeedCrossZero
- ? model.getNeedCrossZero() : !model.get('scale');
- var boundaryGap = model.get('boundaryGap');
- if (!zrUtil.isArray(boundaryGap)) {
- boundaryGap = [boundaryGap || 0, boundaryGap || 0];
- }
- boundaryGap[0] = numberUtil.parsePercent(boundaryGap[0], 1);
- boundaryGap[1] = numberUtil.parsePercent(boundaryGap[1], 1);
- var fixMin = true;
- var fixMax = true;
- // Add boundary gap
- if (min == null) {
- min = originalExtent[0] - boundaryGap[0] * span;
- fixMin = false;
- }
- if (max == null) {
- max = originalExtent[1] + boundaryGap[1] * span;
- fixMax = false;
- }
- // TODO Only one data
- if (min === 'dataMin') {
- min = originalExtent[0];
- }
- if (max === 'dataMax') {
- max = originalExtent[1];
- }
- // Evaluate if axis needs cross zero
- if (crossZero) {
- // Axis is over zero and min is not set
- if (min > 0 && max > 0 && !fixMin) {
- min = 0;
- }
- // Axis is under zero and max is not set
- if (min < 0 && max < 0 && !fixMax) {
- max = 0;
- }
- }
- return [min, max];
- };
-
- axisHelper.niceScaleExtent = function (axis, model) {
- var scale = axis.scale;
- var extent = axisHelper.getScaleExtent(axis, model);
- var fixMin = (model.getMin ? model.getMin() : model.get('min')) != null;
- var fixMax = (model.getMax ? model.getMax() : model.get('max')) != null;
- scale.setExtent(extent[0], extent[1]);
- scale.niceExtent(model.get('splitNumber'), fixMin, fixMax);
-
- // If some one specified the min, max. And the default calculated interval
- // is not good enough. He can specify the interval. It is often appeared
- // in angle axis with angle 0 - 360. Interval calculated in interval scale is hard
- // to be 60.
- // FIXME
- var interval = model.get('interval');
- if (interval != null) {
- scale.setInterval && scale.setInterval(interval);
- }
- };
-
- /**
- * @param {module:echarts/model/Model} model
- * @param {string} [axisType] Default retrieve from model.type
- * @return {module:echarts/scale/*}
- */
- axisHelper.createScaleByModel = function(model, axisType) {
- axisType = axisType || model.get('type');
- if (axisType) {
- switch (axisType) {
- // Buildin scale
- case 'category':
- return new OrdinalScale(
- model.getCategories(), [Infinity, -Infinity]
- );
- case 'value':
- return new IntervalScale();
- // Extended scale, like time and log
- default:
- return (Scale.getClass(axisType) || IntervalScale).create(model);
- }
- }
- };
-
- /**
- * Check if the axis corss 0
- */
- axisHelper.ifAxisCrossZero = function (axis) {
- var dataExtent = axis.scale.getExtent();
- var min = dataExtent[0];
- var max = dataExtent[1];
- return !((min > 0 && max > 0) || (min < 0 && max < 0));
- };
-
- /**
- * @param {Array.<number>} tickCoords In axis self coordinate.
- * @param {Array.<string>} labels
- * @param {string} font
- * @param {boolean} isAxisHorizontal
- * @return {number}
- */
- axisHelper.getAxisLabelInterval = function (tickCoords, labels, font, isAxisHorizontal) {
- // FIXME
- // 不同角的axis和label,不只是horizontal和vertical.
-
- var textSpaceTakenRect;
- var autoLabelInterval = 0;
- var accumulatedLabelInterval = 0;
-
- var step = 1;
- if (labels.length > 40) {
- // Simple optimization for large amount of labels
- step = Math.round(labels.length / 40);
- }
- for (var i = 0; i < tickCoords.length; i += step) {
- var tickCoord = tickCoords[i];
- var rect = textContain.getBoundingRect(
- labels[i], font, 'center', 'top'
- );
- rect[isAxisHorizontal ? 'x' : 'y'] += tickCoord;
- rect[isAxisHorizontal ? 'width' : 'height'] *= 1.5;
- if (!textSpaceTakenRect) {
- textSpaceTakenRect = rect.clone();
- }
- // There is no space for current label;
- else if (textSpaceTakenRect.intersect(rect)) {
- accumulatedLabelInterval++;
- autoLabelInterval = Math.max(autoLabelInterval, accumulatedLabelInterval);
- }
- else {
- textSpaceTakenRect.union(rect);
- // Reset
- accumulatedLabelInterval = 0;
- }
- }
- if (autoLabelInterval === 0 && step > 1) {
- return step;
- }
- return autoLabelInterval * step;
- };
-
- /**
- * @param {Object} axis
- * @param {Function} labelFormatter
- * @return {Array.<string>}
- */
- axisHelper.getFormattedLabels = function (axis, labelFormatter) {
- var scale = axis.scale;
- var labels = scale.getTicksLabels();
- var ticks = scale.getTicks();
- if (typeof labelFormatter === 'string') {
- labelFormatter = (function (tpl) {
- return function (val) {
- return tpl.replace('{value}', val);
- };
- })(labelFormatter);
- return zrUtil.map(labels, labelFormatter);
- }
- else if (typeof labelFormatter === 'function') {
- return zrUtil.map(ticks, function (tick, idx) {
- return labelFormatter(
- axis.type === 'category' ? scale.getLabel(tick) : tick,
- idx
- );
- }, this);
- }
- else {
- return labels;
- }
- };
-
- module.exports = axisHelper;
-
-
-/***/ },
-/* 109 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Linear continuous scale
- * @module echarts/coord/scale/Ordinal
- *
- * http://en.wikipedia.org/wiki/Level_of_measurement
- */
-
- // FIXME only one data
-
-
- var zrUtil = __webpack_require__(3);
- var Scale = __webpack_require__(110);
-
- var scaleProto = Scale.prototype;
-
- var OrdinalScale = Scale.extend({
-
- type: 'ordinal',
-
- init: function (data, extent) {
- this._data = data;
- this._extent = extent || [0, data.length - 1];
- },
-
- parse: function (val) {
- return typeof val === 'string'
- ? zrUtil.indexOf(this._data, val)
- // val might be float.
- : Math.round(val);
- },
-
- contain: function (rank) {
- rank = this.parse(rank);
- return scaleProto.contain.call(this, rank)
- && this._data[rank] != null;
- },
-
- /**
- * Normalize given rank or name to linear [0, 1]
- * @param {number|string} [val]
- * @return {number}
- */
- normalize: function (val) {
- return scaleProto.normalize.call(this, this.parse(val));
- },
-
- scale: function (val) {
- return Math.round(scaleProto.scale.call(this, val));
- },
-
- /**
- * @return {Array}
- */
- getTicks: function () {
- var ticks = [];
- var extent = this._extent;
- var rank = extent[0];
-
- while (rank <= extent[1]) {
- ticks.push(rank);
- rank++;
- }
-
- return ticks;
- },
-
- /**
- * Get item on rank n
- * @param {number} n
- * @return {string}
- */
- getLabel: function (n) {
- return this._data[n];
- },
-
- /**
- * @return {number}
- */
- count: function () {
- return this._extent[1] - this._extent[0] + 1;
- },
-
- niceTicks: zrUtil.noop,
- niceExtent: zrUtil.noop
- });
-
- /**
- * @return {module:echarts/scale/Time}
- */
- OrdinalScale.create = function () {
- return new OrdinalScale();
- };
-
- module.exports = OrdinalScale;
-
-
-/***/ },
-/* 110 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * // Scale class management
- * @module echarts/scale/Scale
- */
-
-
- var clazzUtil = __webpack_require__(9);
-
- function Scale() {
- /**
- * Extent
- * @type {Array.<number>}
- * @protected
- */
- this._extent = [Infinity, -Infinity];
-
- /**
- * Step is calculated in adjustExtent
- * @type {Array.<number>}
- * @protected
- */
- this._interval = 0;
-
- this.init && this.init.apply(this, arguments);
- }
-
- var scaleProto = Scale.prototype;
-
- /**
- * Parse input val to valid inner number.
- * @param {*} val
- * @return {number}
- */
- scaleProto.parse = function (val) {
- // Notice: This would be a trap here, If the implementation
- // of this method depends on extent, and this method is used
- // before extent set (like in dataZoom), it would be wrong.
- // Nevertheless, parse does not depend on extent generally.
- return val;
- };
-
- scaleProto.contain = function (val) {
- var extent = this._extent;
- return val >= extent[0] && val <= extent[1];
- };
-
- /**
- * Normalize value to linear [0, 1], return 0.5 if extent span is 0
- * @param {number} val
- * @return {number}
- */
- scaleProto.normalize = function (val) {
- var extent = this._extent;
- if (extent[1] === extent[0]) {
- return 0.5;
- }
- return (val - extent[0]) / (extent[1] - extent[0]);
- };
-
- /**
- * Scale normalized value
- * @param {number} val
- * @return {number}
- */
- scaleProto.scale = function (val) {
- var extent = this._extent;
- return val * (extent[1] - extent[0]) + extent[0];
- };
-
- /**
- * Set extent from data
- * @param {Array.<number>} other
- */
- scaleProto.unionExtent = function (other) {
- var extent = this._extent;
- other[0] < extent[0] && (extent[0] = other[0]);
- other[1] > extent[1] && (extent[1] = other[1]);
- // not setExtent because in log axis it may transformed to power
- // this.setExtent(extent[0], extent[1]);
- };
-
- /**
- * Get extent
- * @return {Array.<number>}
- */
- scaleProto.getExtent = function () {
- return this._extent.slice();
- };
-
- /**
- * Set extent
- * @param {number} start
- * @param {number} end
- */
- scaleProto.setExtent = function (start, end) {
- var thisExtent = this._extent;
- if (!isNaN(start)) {
- thisExtent[0] = start;
- }
- if (!isNaN(end)) {
- thisExtent[1] = end;
- }
- };
-
- /**
- * @return {Array.<string>}
- */
- scaleProto.getTicksLabels = function () {
- var labels = [];
- var ticks = this.getTicks();
- for (var i = 0; i < ticks.length; i++) {
- labels.push(this.getLabel(ticks[i]));
- }
- return labels;
- };
-
- clazzUtil.enableClassExtend(Scale);
- clazzUtil.enableClassManagement(Scale, {
- registerWhenExtend: true
- });
-
- module.exports = Scale;
-
-
-/***/ },
-/* 111 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Interval scale
- * @module echarts/scale/Interval
- */
-
-
-
- var numberUtil = __webpack_require__(7);
- var formatUtil = __webpack_require__(6);
- var Scale = __webpack_require__(110);
-
- var mathFloor = Math.floor;
- var mathCeil = Math.ceil;
- /**
- * @alias module:echarts/coord/scale/Interval
- * @constructor
- */
- var IntervalScale = Scale.extend({
-
- type: 'interval',
-
- _interval: 0,
-
- setExtent: function (start, end) {
- var thisExtent = this._extent;
- //start,end may be a Number like '25',so...
- if (!isNaN(start)) {
- thisExtent[0] = parseFloat(start);
- }
- if (!isNaN(end)) {
- thisExtent[1] = parseFloat(end);
- }
- },
-
- unionExtent: function (other) {
- var extent = this._extent;
- other[0] < extent[0] && (extent[0] = other[0]);
- other[1] > extent[1] && (extent[1] = other[1]);
-
- // unionExtent may called by it's sub classes
- IntervalScale.prototype.setExtent.call(this, extent[0], extent[1]);
- },
- /**
- * Get interval
- */
- getInterval: function () {
- if (!this._interval) {
- this.niceTicks();
- }
- return this._interval;
- },
-
- /**
- * Set interval
- */
- setInterval: function (interval) {
- this._interval = interval;
- // Dropped auto calculated niceExtent and use user setted extent
- // We assume user wan't to set both interval, min, max to get a better result
- this._niceExtent = this._extent.slice();
- },
-
- /**
- * @return {Array.<number>}
- */
- getTicks: function () {
- if (!this._interval) {
- this.niceTicks();
- }
- var interval = this._interval;
- var extent = this._extent;
- var ticks = [];
-
- // Consider this case: using dataZoom toolbox, zoom and zoom.
- var safeLimit = 10000;
-
- if (interval) {
- var niceExtent = this._niceExtent;
- if (extent[0] < niceExtent[0]) {
- ticks.push(extent[0]);
- }
- var tick = niceExtent[0];
- while (tick <= niceExtent[1]) {
- ticks.push(tick);
- // Avoid rounding error
- tick = numberUtil.round(tick + interval);
- if (ticks.length > safeLimit) {
- return [];
- }
- }
- if (extent[1] > niceExtent[1]) {
- ticks.push(extent[1]);
- }
- }
-
- return ticks;
- },
-
- /**
- * @return {Array.<string>}
- */
- getTicksLabels: function () {
- var labels = [];
- var ticks = this.getTicks();
- for (var i = 0; i < ticks.length; i++) {
- labels.push(this.getLabel(ticks[i]));
- }
- return labels;
- },
-
- /**
- * @param {number} n
- * @return {number}
- */
- getLabel: function (data) {
- return formatUtil.addCommas(data);
- },
-
- /**
- * Update interval and extent of intervals for nice ticks
- *
- * @param {number} [splitNumber = 5] Desired number of ticks
- */
- niceTicks: function (splitNumber) {
- splitNumber = splitNumber || 5;
- var extent = this._extent;
- var span = extent[1] - extent[0];
- if (!isFinite(span)) {
- return;
- }
- // User may set axis min 0 and data are all negative
- // FIXME If it needs to reverse ?
- if (span < 0) {
- span = -span;
- extent.reverse();
- }
-
- // From "Nice Numbers for Graph Labels" of Graphic Gems
- // var niceSpan = numberUtil.nice(span, false);
- var step = numberUtil.nice(span / splitNumber, true);
-
- // Niced extent inside original extent
- var niceExtent = [
- numberUtil.round(mathCeil(extent[0] / step) * step),
- numberUtil.round(mathFloor(extent[1] / step) * step)
- ];
-
- this._interval = step;
- this._niceExtent = niceExtent;
- },
-
- /**
- * Nice extent.
- * @param {number} [splitNumber = 5] Given approx tick number
- * @param {boolean} [fixMin=false]
- * @param {boolean} [fixMax=false]
- */
- niceExtent: function (splitNumber, fixMin, fixMax) {
- var extent = this._extent;
- // If extent start and end are same, expand them
- if (extent[0] === extent[1]) {
- if (extent[0] !== 0) {
- // Expand extent
- var expandSize = extent[0] / 2;
- extent[0] -= expandSize;
- extent[1] += expandSize;
- }
- else {
- extent[1] = 1;
- }
- }
- var span = extent[1] - extent[0];
- // If there are no data and extent are [Infinity, -Infinity]
- if (!isFinite(span)) {
- extent[0] = 0;
- extent[1] = 1;
- }
-
- this.niceTicks(splitNumber);
-
- // var extent = this._extent;
- var interval = this._interval;
-
- if (!fixMin) {
- extent[0] = numberUtil.round(mathFloor(extent[0] / interval) * interval);
- }
- if (!fixMax) {
- extent[1] = numberUtil.round(mathCeil(extent[1] / interval) * interval);
- }
- }
- });
-
- /**
- * @return {module:echarts/scale/Time}
- */
- IntervalScale.create = function () {
- return new IntervalScale();
- };
-
- module.exports = IntervalScale;
-
-
-
-/***/ },
-/* 112 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Interval scale
- * @module echarts/coord/scale/Time
- */
-
-
-
- var zrUtil = __webpack_require__(3);
- var numberUtil = __webpack_require__(7);
- var formatUtil = __webpack_require__(6);
-
- var IntervalScale = __webpack_require__(111);
-
- var intervalScaleProto = IntervalScale.prototype;
-
- var mathCeil = Math.ceil;
- var mathFloor = Math.floor;
- var ONE_DAY = 3600000 * 24;
-
- // FIXME 公用?
- var bisect = function (a, x, lo, hi) {
- while (lo < hi) {
- var mid = lo + hi >>> 1;
- if (a[mid][2] < x) {
- lo = mid + 1;
- }
- else {
- hi = mid;
- }
- }
- return lo;
- };
-
- /**
- * @alias module:echarts/coord/scale/Time
- * @constructor
- */
- var TimeScale = IntervalScale.extend({
- type: 'time',
-
- // Overwrite
- getLabel: function (val) {
- var stepLvl = this._stepLvl;
-
- var date = new Date(val);
-
- return formatUtil.formatTime(stepLvl[0], date);
- },
-
- // Overwrite
- niceExtent: function (approxTickNum, fixMin, fixMax) {
- var extent = this._extent;
- // If extent start and end are same, expand them
- if (extent[0] === extent[1]) {
- // Expand extent
- extent[0] -= ONE_DAY;
- extent[1] += ONE_DAY;
- }
- // If there are no data and extent are [Infinity, -Infinity]
- if (extent[1] === -Infinity && extent[0] === Infinity) {
- var d = new Date();
- extent[1] = new Date(d.getFullYear(), d.getMonth(), d.getDate());
- extent[0] = extent[1] - ONE_DAY;
- }
-
- this.niceTicks(approxTickNum, fixMin, fixMax);
-
- // var extent = this._extent;
- var interval = this._interval;
-
- if (!fixMin) {
- extent[0] = numberUtil.round(mathFloor(extent[0] / interval) * interval);
- }
- if (!fixMax) {
- extent[1] = numberUtil.round(mathCeil(extent[1] / interval) * interval);
- }
- },
-
- // Overwrite
- niceTicks: function (approxTickNum) {
- approxTickNum = approxTickNum || 10;
-
- var extent = this._extent;
- var span = extent[1] - extent[0];
- var approxInterval = span / approxTickNum;
- var scaleLevelsLen = scaleLevels.length;
- var idx = bisect(scaleLevels, approxInterval, 0, scaleLevelsLen);
-
- var level = scaleLevels[Math.min(idx, scaleLevelsLen - 1)];
- var interval = level[2];
- // Same with interval scale if span is much larger than 1 year
- if (level[0] === 'year') {
- var yearSpan = span / interval;
-
- // From "Nice Numbers for Graph Labels" of Graphic Gems
- // var niceYearSpan = numberUtil.nice(yearSpan, false);
- var yearStep = numberUtil.nice(yearSpan / approxTickNum, true);
-
- interval *= yearStep;
- }
-
- var niceExtent = [
- mathCeil(extent[0] / interval) * interval,
- mathFloor(extent[1] / interval) * interval
- ];
-
- this._stepLvl = level;
- // Interval will be used in getTicks
- this._interval = interval;
- this._niceExtent = niceExtent;
- },
-
- parse: function (val) {
- // val might be float.
- return +numberUtil.parseDate(val);
- }
- });
-
- zrUtil.each(['contain', 'normalize'], function (methodName) {
- TimeScale.prototype[methodName] = function (val) {
- return intervalScaleProto[methodName].call(this, this.parse(val));
- };
- });
-
- // Steps from d3
- var scaleLevels = [
- // Format step interval
- ['hh:mm:ss', 1, 1000], // 1s
- ['hh:mm:ss', 5, 1000 * 5], // 5s
- ['hh:mm:ss', 10, 1000 * 10], // 10s
- ['hh:mm:ss', 15, 1000 * 15], // 15s
- ['hh:mm:ss', 30, 1000 * 30], // 30s
- ['hh:mm\nMM-dd',1, 60000], // 1m
- ['hh:mm\nMM-dd',5, 60000 * 5], // 5m
- ['hh:mm\nMM-dd',10, 60000 * 10], // 10m
- ['hh:mm\nMM-dd',15, 60000 * 15], // 15m
- ['hh:mm\nMM-dd',30, 60000 * 30], // 30m
- ['hh:mm\nMM-dd',1, 3600000], // 1h
- ['hh:mm\nMM-dd',2, 3600000 * 2], // 2h
- ['hh:mm\nMM-dd',6, 3600000 * 6], // 6h
- ['hh:mm\nMM-dd',12, 3600000 * 12], // 12h
- ['MM-dd\nyyyy', 1, ONE_DAY], // 1d
- ['week', 7, ONE_DAY * 7], // 7d
- ['month', 1, ONE_DAY * 31], // 1M
- ['quarter', 3, ONE_DAY * 380 / 4], // 3M
- ['half-year', 6, ONE_DAY * 380 / 2], // 6M
- ['year', 1, ONE_DAY * 380] // 1Y
- ];
-
- /**
- * @return {module:echarts/scale/Time}
- */
- TimeScale.create = function () {
- return new TimeScale();
- };
-
- module.exports = TimeScale;
-
-
-/***/ },
-/* 113 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Log scale
- * @module echarts/scale/Log
- */
-
-
- var zrUtil = __webpack_require__(3);
- var Scale = __webpack_require__(110);
- var numberUtil = __webpack_require__(7);
-
- // Use some method of IntervalScale
- var IntervalScale = __webpack_require__(111);
-
- var scaleProto = Scale.prototype;
- var intervalScaleProto = IntervalScale.prototype;
-
- var mathFloor = Math.floor;
- var mathCeil = Math.ceil;
- var mathPow = Math.pow;
-
- var LOG_BASE = 10;
- var mathLog = Math.log;
-
- var LogScale = Scale.extend({
-
- type: 'log',
-
- /**
- * @return {Array.<number>}
- */
- getTicks: function () {
- return zrUtil.map(intervalScaleProto.getTicks.call(this), function (val) {
- return numberUtil.round(mathPow(LOG_BASE, val));
- });
- },
-
- /**
- * @param {number} val
- * @return {string}
- */
- getLabel: intervalScaleProto.getLabel,
-
- /**
- * @param {number} val
- * @return {number}
- */
- scale: function (val) {
- val = scaleProto.scale.call(this, val);
- return mathPow(LOG_BASE, val);
- },
-
- /**
- * @param {number} start
- * @param {number} end
- */
- setExtent: function (start, end) {
- start = mathLog(start) / mathLog(LOG_BASE);
- end = mathLog(end) / mathLog(LOG_BASE);
- intervalScaleProto.setExtent.call(this, start, end);
- },
-
- /**
- * @return {number} end
- */
- getExtent: function () {
- var extent = scaleProto.getExtent.call(this);
- extent[0] = mathPow(LOG_BASE, extent[0]);
- extent[1] = mathPow(LOG_BASE, extent[1]);
- return extent;
- },
-
- /**
- * @param {Array.<number>} extent
- */
- unionExtent: function (extent) {
- extent[0] = mathLog(extent[0]) / mathLog(LOG_BASE);
- extent[1] = mathLog(extent[1]) / mathLog(LOG_BASE);
- scaleProto.unionExtent.call(this, extent);
- },
-
- /**
- * Update interval and extent of intervals for nice ticks
- * @param {number} [approxTickNum = 10] Given approx tick number
- */
- niceTicks: function (approxTickNum) {
- approxTickNum = approxTickNum || 10;
- var extent = this._extent;
- var span = extent[1] - extent[0];
- if (span === Infinity || span <= 0) {
- return;
- }
-
- var interval = mathPow(10, mathFloor(mathLog(span / approxTickNum) / Math.LN10));
- var err = approxTickNum / span * interval;
-
- // Filter ticks to get closer to the desired count.
- if (err <= 0.5) {
- interval *= 10;
- }
- var niceExtent = [
- numberUtil.round(mathCeil(extent[0] / interval) * interval),
- numberUtil.round(mathFloor(extent[1] / interval) * interval)
- ];
-
- this._interval = interval;
- this._niceExtent = niceExtent;
- },
-
- /**
- * Nice extent.
- * @param {number} [approxTickNum = 10] Given approx tick number
- * @param {boolean} [fixMin=false]
- * @param {boolean} [fixMax=false]
- */
- niceExtent: intervalScaleProto.niceExtent
- });
-
- zrUtil.each(['contain', 'normalize'], function (methodName) {
- LogScale.prototype[methodName] = function (val) {
- val = mathLog(val) / mathLog(LOG_BASE);
- return scaleProto[methodName].call(this, val);
- };
- });
-
- LogScale.create = function () {
- return new LogScale();
- };
-
- module.exports = LogScale;
-
-
-/***/ },
-/* 114 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
- var Cartesian = __webpack_require__(115);
-
- function Cartesian2D(name) {
-
- Cartesian.call(this, name);
- }
-
- Cartesian2D.prototype = {
-
- constructor: Cartesian2D,
-
- type: 'cartesian2d',
-
- /**
- * @type {Array.<string>}
- * @readOnly
- */
- dimensions: ['x', 'y'],
-
- /**
- * Base axis will be used on stacking.
- *
- * @return {module:echarts/coord/cartesian/Axis2D}
- */
- getBaseAxis: function () {
- return this.getAxesByScale('ordinal')[0]
- || this.getAxesByScale('time')[0]
- || this.getAxis('x');
- },
-
- /**
- * If contain point
- * @param {Array.<number>} point
- * @return {boolean}
- */
- containPoint: function (point) {
- var axisX = this.getAxis('x');
- var axisY = this.getAxis('y');
- return axisX.contain(axisX.toLocalCoord(point[0]))
- && axisY.contain(axisY.toLocalCoord(point[1]));
- },
-
- /**
- * If contain data
- * @param {Array.<number>} data
- * @return {boolean}
- */
- containData: function (data) {
- return this.getAxis('x').containData(data[0])
- && this.getAxis('y').containData(data[1]);
- },
-
- /**
- * Convert series data to an array of points
- * @param {module:echarts/data/List} data
- * @param {boolean} stack
- * @return {Array}
- * Return array of points. For example:
- * `[[10, 10], [20, 20], [30, 30]]`
- */
- dataToPoints: function (data, stack) {
- return data.mapArray(['x', 'y'], function (x, y) {
- return this.dataToPoint([x, y]);
- }, stack, this);
- },
-
- /**
- * @param {Array.<number>} data
- * @param {boolean} [clamp=false]
- * @return {Array.<number>}
- */
- dataToPoint: function (data, clamp) {
- var xAxis = this.getAxis('x');
- var yAxis = this.getAxis('y');
- return [
- xAxis.toGlobalCoord(xAxis.dataToCoord(data[0], clamp)),
- yAxis.toGlobalCoord(yAxis.dataToCoord(data[1], clamp))
- ];
- },
-
- /**
- * @param {Array.<number>} point
- * @param {boolean} [clamp=false]
- * @return {Array.<number>}
- */
- pointToData: function (point, clamp) {
- var xAxis = this.getAxis('x');
- var yAxis = this.getAxis('y');
- return [
- xAxis.coordToData(xAxis.toLocalCoord(point[0]), clamp),
- yAxis.coordToData(yAxis.toLocalCoord(point[1]), clamp)
- ];
- },
-
- /**
- * Get other axis
- * @param {module:echarts/coord/cartesian/Axis2D} axis
- */
- getOtherAxis: function (axis) {
- return this.getAxis(axis.dim === 'x' ? 'y' : 'x');
- }
- };
-
- zrUtil.inherits(Cartesian2D, Cartesian);
-
- module.exports = Cartesian2D;
-
-
-/***/ },
-/* 115 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * Cartesian coordinate system
- * @module echarts/coord/Cartesian
- *
- */
-
-
- var zrUtil = __webpack_require__(3);
-
- function dimAxisMapper(dim) {
- return this._axes[dim];
- }
-
- /**
- * @alias module:echarts/coord/Cartesian
- * @constructor
- */
- var Cartesian = function (name) {
- this._axes = {};
-
- this._dimList = [];
-
- /**
- * @type {string}
- */
- this.name = name || '';
- };
-
- Cartesian.prototype = {
-
- constructor: Cartesian,
-
- type: 'cartesian',
-
- /**
- * Get axis
- * @param {number|string} dim
- * @return {module:echarts/coord/Cartesian~Axis}
- */
- getAxis: function (dim) {
- return this._axes[dim];
- },
-
- /**
- * Get axes list
- * @return {Array.<module:echarts/coord/Cartesian~Axis>}
- */
- getAxes: function () {
- return zrUtil.map(this._dimList, dimAxisMapper, this);
- },
-
- /**
- * Get axes list by given scale type
- */
- getAxesByScale: function (scaleType) {
- scaleType = scaleType.toLowerCase();
- return zrUtil.filter(
- this.getAxes(),
- function (axis) {
- return axis.scale.type === scaleType;
- }
- );
- },
-
- /**
- * Add axis
- * @param {module:echarts/coord/Cartesian.Axis}
- */
- addAxis: function (axis) {
- var dim = axis.dim;
-
- this._axes[dim] = axis;
-
- this._dimList.push(dim);
- },
-
- /**
- * Convert data to coord in nd space
- * @param {Array.<number>|Object.<string, number>} val
- * @return {Array.<number>|Object.<string, number>}
- */
- dataToCoord: function (val) {
- return this._dataCoordConvert(val, 'dataToCoord');
- },
-
- /**
- * Convert coord in nd space to data
- * @param {Array.<number>|Object.<string, number>} val
- * @return {Array.<number>|Object.<string, number>}
- */
- coordToData: function (val) {
- return this._dataCoordConvert(val, 'coordToData');
- },
-
- _dataCoordConvert: function (input, method) {
- var dimList = this._dimList;
-
- var output = input instanceof Array ? [] : {};
-
- for (var i = 0; i < dimList.length; i++) {
- var dim = dimList[i];
- var axis = this._axes[dim];
-
- output[dim] = axis[method](input[dim]);
- }
-
- return output;
- }
- };
-
- module.exports = Cartesian;
-
-
-/***/ },
-/* 116 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var Axis = __webpack_require__(117);
- var axisLabelInterval = __webpack_require__(118);
-
- /**
- * Extend axis 2d
- * @constructor module:echarts/coord/cartesian/Axis2D
- * @extends {module:echarts/coord/cartesian/Axis}
- * @param {string} dim
- * @param {*} scale
- * @param {Array.<number>} coordExtent
- * @param {string} axisType
- * @param {string} position
- */
- var Axis2D = function (dim, scale, coordExtent, axisType, position) {
- Axis.call(this, dim, scale, coordExtent);
- /**
- * Axis type
- * - 'category'
- * - 'value'
- * - 'time'
- * - 'log'
- * @type {string}
- */
- this.type = axisType || 'value';
-
- /**
- * Axis position
- * - 'top'
- * - 'bottom'
- * - 'left'
- * - 'right'
- */
- this.position = position || 'bottom';
- };
-
- Axis2D.prototype = {
-
- constructor: Axis2D,
-
- /**
- * Index of axis, can be used as key
- */
- index: 0,
- /**
- * If axis is on the zero position of the other axis
- * @type {boolean}
- */
- onZero: false,
-
- /**
- * Axis model
- * @param {module:echarts/coord/cartesian/AxisModel}
- */
- model: null,
-
- isHorizontal: function () {
- var position = this.position;
- return position === 'top' || position === 'bottom';
- },
-
- getGlobalExtent: function () {
- var ret = this.getExtent();
- ret[0] = this.toGlobalCoord(ret[0]);
- ret[1] = this.toGlobalCoord(ret[1]);
- return ret;
- },
-
- /**
- * @return {number}
- */
- getLabelInterval: function () {
- var labelInterval = this._labelInterval;
- if (!labelInterval) {
- labelInterval = this._labelInterval = axisLabelInterval(this);
- }
- return labelInterval;
- },
-
- /**
- * If label is ignored.
- * Automatically used when axis is category and label can not be all shown
- * @param {number} idx
- * @return {boolean}
- */
- isLabelIgnored: function (idx) {
- if (this.type === 'category') {
- var labelInterval = this.getLabelInterval();
- return ((typeof labelInterval === 'function')
- && !labelInterval(idx, this.scale.getLabel(idx)))
- || idx % (labelInterval + 1);
- }
- },
-
- /**
- * Transform global coord to local coord,
- * i.e. var localCoord = axis.toLocalCoord(80);
- * designate by module:echarts/coord/cartesian/Grid.
- * @type {Function}
- */
- toLocalCoord: null,
-
- /**
- * Transform global coord to local coord,
- * i.e. var globalCoord = axis.toLocalCoord(40);
- * designate by module:echarts/coord/cartesian/Grid.
- * @type {Function}
- */
- toGlobalCoord: null
-
- };
- zrUtil.inherits(Axis2D, Axis);
-
- module.exports = Axis2D;
-
-
-/***/ },
-/* 117 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var numberUtil = __webpack_require__(7);
- var linearMap = numberUtil.linearMap;
- var zrUtil = __webpack_require__(3);
-
- function fixExtentWithBands(extent, nTick) {
- var size = extent[1] - extent[0];
- var len = nTick;
- var margin = size / len / 2;
- extent[0] += margin;
- extent[1] -= margin;
- }
-
- var normalizedExtent = [0, 1];
- /**
- * @name module:echarts/coord/CartesianAxis
- * @constructor
- */
- var Axis = function (dim, scale, extent) {
-
- /**
- * Axis dimension. Such as 'x', 'y', 'z', 'angle', 'radius'
- * @type {string}
- */
- this.dim = dim;
-
- /**
- * Axis scale
- * @type {module:echarts/coord/scale/*}
- */
- this.scale = scale;
-
- /**
- * @type {Array.<number>}
- * @private
- */
- this._extent = extent || [0, 0];
-
- /**
- * @type {boolean}
- */
- this.inverse = false;
-
- /**
- * Usually true when axis has a ordinal scale
- * @type {boolean}
- */
- this.onBand = false;
- };
-
- Axis.prototype = {
-
- constructor: Axis,
-
- /**
- * If axis extent contain given coord
- * @param {number} coord
- * @return {boolean}
- */
- contain: function (coord) {
- var extent = this._extent;
- var min = Math.min(extent[0], extent[1]);
- var max = Math.max(extent[0], extent[1]);
- return coord >= min && coord <= max;
- },
-
- /**
- * If axis extent contain given data
- * @param {number} data
- * @return {boolean}
- */
- containData: function (data) {
- return this.contain(this.dataToCoord(data));
- },
-
- /**
- * Get coord extent.
- * @return {Array.<number>}
- */
- getExtent: function () {
- var ret = this._extent.slice();
- return ret;
- },
-
- /**
- * Get precision used for formatting
- * @param {Array.<number>} [dataExtent]
- * @return {number}
- */
- getPixelPrecision: function (dataExtent) {
- return numberUtil.getPixelPrecision(
- dataExtent || this.scale.getExtent(),
- this._extent
- );
- },
-
- /**
- * Set coord extent
- * @param {number} start
- * @param {number} end
- */
- setExtent: function (start, end) {
- var extent = this._extent;
- extent[0] = start;
- extent[1] = end;
- },
-
- /**
- * Convert data to coord. Data is the rank if it has a ordinal scale
- * @param {number} data
- * @param {boolean} clamp
- * @return {number}
- */
- dataToCoord: function (data, clamp) {
- var extent = this._extent;
- var scale = this.scale;
- data = scale.normalize(data);
-
- if (this.onBand && scale.type === 'ordinal') {
- extent = extent.slice();
- fixExtentWithBands(extent, scale.count());
- }
-
- return linearMap(data, normalizedExtent, extent, clamp);
- },
-
- /**
- * Convert coord to data. Data is the rank if it has a ordinal scale
- * @param {number} coord
- * @param {boolean} clamp
- * @return {number}
- */
- coordToData: function (coord, clamp) {
- var extent = this._extent;
- var scale = this.scale;
-
- if (this.onBand && scale.type === 'ordinal') {
- extent = extent.slice();
- fixExtentWithBands(extent, scale.count());
- }
-
- var t = linearMap(coord, extent, normalizedExtent, clamp);
-
- return this.scale.scale(t);
- },
- /**
- * @return {Array.<number>}
- */
- getTicksCoords: function () {
- if (this.onBand) {
- var bands = this.getBands();
- var coords = [];
- for (var i = 0; i < bands.length; i++) {
- coords.push(bands[i][0]);
- }
- if (bands[i - 1]) {
- coords.push(bands[i - 1][1]);
- }
- return coords;
- }
- else {
- return zrUtil.map(this.scale.getTicks(), this.dataToCoord, this);
- }
- },
-
- /**
- * Coords of labels are on the ticks or on the middle of bands
- * @return {Array.<number>}
- */
- getLabelsCoords: function () {
- if (this.onBand) {
- var bands = this.getBands();
- var coords = [];
- var band;
- for (var i = 0; i < bands.length; i++) {
- band = bands[i];
- coords.push((band[0] + band[1]) / 2);
- }
- return coords;
- }
- else {
- return zrUtil.map(this.scale.getTicks(), this.dataToCoord, this);
- }
- },
-
- /**
- * Get bands.
- *
- * If axis has labels [1, 2, 3, 4]. Bands on the axis are
- * |---1---|---2---|---3---|---4---|.
- *
- * @return {Array}
- */
- // FIXME Situation when labels is on ticks
- getBands: function () {
- var extent = this.getExtent();
- var bands = [];
- var len = this.scale.count();
- var start = extent[0];
- var end = extent[1];
- var span = end - start;
-
- for (var i = 0; i < len; i++) {
- bands.push([
- span * i / len + start,
- span * (i + 1) / len + start
- ]);
- }
- return bands;
- },
-
- /**
- * Get width of band
- * @return {number}
- */
- getBandWidth: function () {
- var axisExtent = this._extent;
- var dataExtent = this.scale.getExtent();
-
- var len = dataExtent[1] - dataExtent[0] + (this.onBand ? 1 : 0);
- // Fix #2728, avoid NaN when only one data.
- len === 0 && (len = 1);
-
- var size = Math.abs(axisExtent[1] - axisExtent[0]);
-
- return Math.abs(size) / len;
- }
- };
-
- module.exports = Axis;
-
-
-/***/ },
-/* 118 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * Helper function for axisLabelInterval calculation
- */
-
-
-
- var zrUtil = __webpack_require__(3);
- var axisHelper = __webpack_require__(108);
-
- module.exports = function (axis) {
- var axisModel = axis.model;
- var labelModel = axisModel.getModel('axisLabel');
- var labelInterval = labelModel.get('interval');
- if (!(axis.type === 'category' && labelInterval === 'auto')) {
- return labelInterval === 'auto' ? 0 : labelInterval;
- }
-
- return axisHelper.getAxisLabelInterval(
- zrUtil.map(axis.scale.getTicks(), axis.dataToCoord, axis),
- axisModel.getFormattedLabels(),
- labelModel.getModel('textStyle').getFont(),
- axis.isHorizontal()
- );
- };
-
-
-/***/ },
-/* 119 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- // Grid 是在有直角坐标系的时候必须要存在的
- // 所以这里也要被 Cartesian2D 依赖
-
-
- __webpack_require__(120);
- var ComponentModel = __webpack_require__(19);
-
- module.exports = ComponentModel.extend({
-
- type: 'grid',
-
- dependencies: ['xAxis', 'yAxis'],
-
- layoutMode: 'box',
-
- /**
- * @type {module:echarts/coord/cartesian/Grid}
- */
- coordinateSystem: null,
-
- defaultOption: {
- show: false,
- zlevel: 0,
- z: 0,
- left: '10%',
- top: 60,
- right: '10%',
- bottom: 60,
- // If grid size contain label
- containLabel: false,
- // width: {totalWidth} - left - right,
- // height: {totalHeight} - top - bottom,
- backgroundColor: 'rgba(0,0,0,0)',
- borderWidth: 1,
- borderColor: '#ccc'
- }
- });
-
-
-/***/ },
-/* 120 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var ComponentModel = __webpack_require__(19);
- var zrUtil = __webpack_require__(3);
- var axisModelCreator = __webpack_require__(121);
-
- var AxisModel = ComponentModel.extend({
-
- type: 'cartesian2dAxis',
-
- /**
- * @type {module:echarts/coord/cartesian/Axis2D}
- */
- axis: null,
-
- /**
- * @override
- */
- init: function () {
- AxisModel.superApply(this, 'init', arguments);
- this._resetRange();
- },
-
- /**
- * @override
- */
- mergeOption: function () {
- AxisModel.superApply(this, 'mergeOption', arguments);
- this._resetRange();
- },
-
- /**
- * @override
- */
- restoreData: function () {
- AxisModel.superApply(this, 'restoreData', arguments);
- this._resetRange();
- },
-
- /**
- * @public
- * @param {number} rangeStart
- * @param {number} rangeEnd
- */
- setRange: function (rangeStart, rangeEnd) {
- this.option.rangeStart = rangeStart;
- this.option.rangeEnd = rangeEnd;
- },
-
- /**
- * @public
- * @return {Array.<number|string|Date>}
- */
- getMin: function () {
- var option = this.option;
- return option.rangeStart != null ? option.rangeStart : option.min;
- },
-
- /**
- * @public
- * @return {Array.<number|string|Date>}
- */
- getMax: function () {
- var option = this.option;
- return option.rangeEnd != null ? option.rangeEnd : option.max;
- },
-
- /**
- * @public
- * @return {boolean}
- */
- getNeedCrossZero: function () {
- var option = this.option;
- return (option.rangeStart != null || option.rangeEnd != null)
- ? false : !option.scale;
- },
-
- /**
- * @private
- */
- _resetRange: function () {
- // rangeStart and rangeEnd is readonly.
- this.option.rangeStart = this.option.rangeEnd = null;
- }
-
- });
-
- function getAxisType(axisDim, option) {
- // Default axis with data is category axis
- return option.type || (option.data ? 'category' : 'value');
- }
-
- zrUtil.merge(AxisModel.prototype, __webpack_require__(123));
-
- var extraOption = {
- gridIndex: 0
- };
-
- axisModelCreator('x', AxisModel, getAxisType, extraOption);
- axisModelCreator('y', AxisModel, getAxisType, extraOption);
-
- module.exports = AxisModel;
-
-
-/***/ },
-/* 121 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var axisDefault = __webpack_require__(122);
- var zrUtil = __webpack_require__(3);
- var ComponentModel = __webpack_require__(19);
- var layout = __webpack_require__(21);
-
- // FIXME axisType is fixed ?
- var AXIS_TYPES = ['value', 'category', 'time', 'log'];
-
- /**
- * Generate sub axis model class
- * @param {string} axisName 'x' 'y' 'radius' 'angle' 'parallel'
- * @param {module:echarts/model/Component} BaseAxisModelClass
- * @param {Function} axisTypeDefaulter
- * @param {Object} [extraDefaultOption]
- */
- module.exports = function (axisName, BaseAxisModelClass, axisTypeDefaulter, extraDefaultOption) {
-
- zrUtil.each(AXIS_TYPES, function (axisType) {
-
- BaseAxisModelClass.extend({
-
- type: axisName + 'Axis.' + axisType,
-
- mergeDefaultAndTheme: function (option, ecModel) {
- var layoutMode = this.layoutMode;
- var inputPositionParams = layoutMode
- ? layout.getLayoutParams(option) : {};
-
- var themeModel = ecModel.getTheme();
- zrUtil.merge(option, themeModel.get(axisType + 'Axis'));
- zrUtil.merge(option, this.getDefaultOption());
-
- option.type = axisTypeDefaulter(axisName, option);
-
- if (layoutMode) {
- layout.mergeLayoutParam(option, inputPositionParams, layoutMode);
- }
- },
-
- defaultOption: zrUtil.mergeAll(
- [
- {},
- axisDefault[axisType + 'Axis'],
- extraDefaultOption
- ],
- true
- )
- });
- });
-
- ComponentModel.registerSubTypeDefaulter(
- axisName + 'Axis',
- zrUtil.curry(axisTypeDefaulter, axisName)
- );
- };
-
-
-/***/ },
-/* 122 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
-
- var defaultOption = {
- show: true,
- zlevel: 0, // 一级层叠
- z: 0, // 二级层叠
- // 反向坐标轴
- inverse: false,
- // 坐标轴名字,默认为空
- name: '',
- // 坐标轴名字位置,支持'start' | 'middle' | 'end'
- nameLocation: 'end',
- // 坐标轴文字样式,默认取全局样式
- nameTextStyle: {},
- // 文字与轴线距离
- nameGap: 15,
- // 坐标轴线
- axisLine: {
- // 默认显示,属性show控制显示与否
- show: true,
- onZero: true,
- // 属性lineStyle控制线条样式
- lineStyle: {
- color: '#333',
- width: 1,
- type: 'solid'
- }
- },
- // 坐标轴小标记
- axisTick: {
- // 属性show控制显示与否,默认显示
- show: true,
- // 控制小标记是否在grid里
- inside: false,
- // 属性length控制线长
- length: 5,
- // 属性lineStyle控制线条样式
- lineStyle: {
- color: '#333',
- width: 1
- }
- },
- // 坐标轴文本标签,详见axis.axisLabel
- axisLabel: {
- show: true,
- // 控制文本标签是否在grid里
- inside: false,
- rotate: 0,
- margin: 8,
- // formatter: null,
- // 其余属性默认使用全局文本样式,详见TEXTSTYLE
- textStyle: {
- color: '#333',
- fontSize: 12
- }
- },
- // 分隔线
- splitLine: {
- // 默认显示,属性show控制显示与否
- show: true,
- // 属性lineStyle(详见lineStyle)控制线条样式
- lineStyle: {
- color: ['#ccc'],
- width: 1,
- type: 'solid'
- }
- },
- // 分隔区域
- splitArea: {
- // 默认不显示,属性show控制显示与否
- show: false,
- // 属性areaStyle(详见areaStyle)控制区域样式
- areaStyle: {
- color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)']
- }
- }
- };
-
- var categoryAxis = zrUtil.merge({
- // 类目起始和结束两端空白策略
- boundaryGap: true,
- // 坐标轴小标记
- axisTick: {
- interval: 'auto'
- },
- // 坐标轴文本标签,详见axis.axisLabel
- axisLabel: {
- interval: 'auto'
- }
- }, defaultOption);
-
- var valueAxis = zrUtil.defaults({
- // 数值起始和结束两端空白策略
- boundaryGap: [0, 0],
- // 最小值, 设置成 'dataMin' 则从数据中计算最小值
- // min: null,
- // 最大值,设置成 'dataMax' 则从数据中计算最大值
- // max: null,
- // Readonly prop, specifies start value of the range when using data zoom.
- // rangeStart: null
- // Readonly prop, specifies end value of the range when using data zoom.
- // rangeEnd: null
- // 脱离0值比例,放大聚焦到最终_min,_max区间
- // scale: false,
- // 分割段数,默认为5
- splitNumber: 5
- }, defaultOption);
-
- // FIXME
- var timeAxis = zrUtil.defaults({
- scale: true,
- min: 'dataMin',
- max: 'dataMax'
- }, valueAxis);
- var logAxis = zrUtil.defaults({}, valueAxis);
- logAxis.scale = true;
-
- module.exports = {
- categoryAxis: categoryAxis,
- valueAxis: valueAxis,
- timeAxis: timeAxis,
- logAxis: logAxis
- };
-
-
-/***/ },
-/* 123 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var axisHelper = __webpack_require__(108);
-
- function getName(obj) {
- if (zrUtil.isObject(obj) && obj.value != null) {
- return obj.value;
- }
- else {
- return obj;
- }
- }
- /**
- * Get categories
- */
- function getCategories() {
- return this.get('type') === 'category'
- && zrUtil.map(this.get('data'), getName);
- }
-
- /**
- * Format labels
- * @return {Array.<string>}
- */
- function getFormattedLabels() {
- return axisHelper.getFormattedLabels(
- this.axis,
- this.get('axisLabel.formatter')
- );
- }
-
- module.exports = {
-
- getFormattedLabels: getFormattedLabels,
-
- getCategories: getCategories
- };
-
-
-/***/ },
-/* 124 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- // TODO boundaryGap
-
-
- __webpack_require__(120);
-
- __webpack_require__(125);
-
-
-/***/ },
-/* 125 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var graphic = __webpack_require__(42);
- var AxisBuilder = __webpack_require__(126);
- var ifIgnoreOnTick = AxisBuilder.ifIgnoreOnTick;
- var getInterval = AxisBuilder.getInterval;
-
- var axisBuilderAttrs = [
- 'axisLine', 'axisLabel', 'axisTick', 'axisName'
- ];
- var selfBuilderAttrs = [
- 'splitLine', 'splitArea'
- ];
-
- var AxisView = __webpack_require__(1).extendComponentView({
-
- type: 'axis',
-
- render: function (axisModel, ecModel) {
-
- this.group.removeAll();
-
- if (!axisModel.get('show')) {
- return;
- }
-
- var gridModel = ecModel.getComponent('grid', axisModel.get('gridIndex'));
-
- var layout = layoutAxis(gridModel, axisModel);
-
- var axisBuilder = new AxisBuilder(axisModel, layout);
-
- zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);
-
- this.group.add(axisBuilder.getGroup());
-
- zrUtil.each(selfBuilderAttrs, function (name) {
- if (axisModel.get(name +'.show')) {
- this['_' + name](axisModel, gridModel, layout.labelInterval);
- }
- }, this);
- },
-
- /**
- * @param {module:echarts/coord/cartesian/AxisModel} axisModel
- * @param {module:echarts/coord/cartesian/GridModel} gridModel
- * @param {number|Function} labelInterval
- * @private
- */
- _splitLine: function (axisModel, gridModel, labelInterval) {
- var axis = axisModel.axis;
-
- var splitLineModel = axisModel.getModel('splitLine');
- var lineStyleModel = splitLineModel.getModel('lineStyle');
- var lineWidth = lineStyleModel.get('width');
- var lineColors = lineStyleModel.get('color');
-
- var lineInterval = getInterval(splitLineModel, labelInterval);
-
- lineColors = zrUtil.isArray(lineColors) ? lineColors : [lineColors];
-
- var gridRect = gridModel.coordinateSystem.getRect();
- var isHorizontal = axis.isHorizontal();
-
- var splitLines = [];
- var lineCount = 0;
-
- var ticksCoords = axis.getTicksCoords();
-
- var p1 = [];
- var p2 = [];
- for (var i = 0; i < ticksCoords.length; i++) {
- if (ifIgnoreOnTick(axis, i, lineInterval)) {
- continue;
- }
-
- var tickCoord = axis.toGlobalCoord(ticksCoords[i]);
-
- if (isHorizontal) {
- p1[0] = tickCoord;
- p1[1] = gridRect.y;
- p2[0] = tickCoord;
- p2[1] = gridRect.y + gridRect.height;
- }
- else {
- p1[0] = gridRect.x;
- p1[1] = tickCoord;
- p2[0] = gridRect.x + gridRect.width;
- p2[1] = tickCoord;
- }
-
- var colorIndex = (lineCount++) % lineColors.length;
- splitLines[colorIndex] = splitLines[colorIndex] || [];
- splitLines[colorIndex].push(new graphic.Line(graphic.subPixelOptimizeLine({
- shape: {
- x1: p1[0],
- y1: p1[1],
- x2: p2[0],
- y2: p2[1]
- },
- style: {
- lineWidth: lineWidth
- },
- silent: true
- })));
- }
-
- // Simple optimization
- // Batching the lines if color are the same
- var lineStyle = lineStyleModel.getLineStyle();
- for (var i = 0; i < splitLines.length; i++) {
- this.group.add(graphic.mergePath(splitLines[i], {
- style: zrUtil.defaults({
- stroke: lineColors[i % lineColors.length]
- }, lineStyle),
- silent: true
- }));
- }
- },
-
- /**
- * @param {module:echarts/coord/cartesian/AxisModel} axisModel
- * @param {module:echarts/coord/cartesian/GridModel} gridModel
- * @param {number|Function} labelInterval
- * @private
- */
- _splitArea: function (axisModel, gridModel, labelInterval) {
- var axis = axisModel.axis;
-
- var splitAreaModel = axisModel.getModel('splitArea');
- var areaStyleModel = splitAreaModel.getModel('areaStyle');
- var areaColors = areaStyleModel.get('color');
-
- var gridRect = gridModel.coordinateSystem.getRect();
- var ticksCoords = axis.getTicksCoords();
-
- var prevX = axis.toGlobalCoord(ticksCoords[0]);
- var prevY = axis.toGlobalCoord(ticksCoords[0]);
-
- var splitAreaRects = [];
- var count = 0;
-
- var areaInterval = getInterval(splitAreaModel, labelInterval);
-
- areaColors = zrUtil.isArray(areaColors) ? areaColors : [areaColors];
-
- for (var i = 1; i < ticksCoords.length; i++) {
- if (ifIgnoreOnTick(axis, i, areaInterval)) {
- continue;
- }
-
- var tickCoord = axis.toGlobalCoord(ticksCoords[i]);
-
- var x;
- var y;
- var width;
- var height;
- if (axis.isHorizontal()) {
- x = prevX;
- y = gridRect.y;
- width = tickCoord - x;
- height = gridRect.height;
- }
- else {
- x = gridRect.x;
- y = prevY;
- width = gridRect.width;
- height = tickCoord - y;
- }
-
- var colorIndex = (count++) % areaColors.length;
- splitAreaRects[colorIndex] = splitAreaRects[colorIndex] || [];
- splitAreaRects[colorIndex].push(new graphic.Rect({
- shape: {
- x: x,
- y: y,
- width: width,
- height: height
- },
- silent: true
- }));
-
- prevX = x + width;
- prevY = y + height;
- }
-
- // Simple optimization
- // Batching the rects if color are the same
- var areaStyle = areaStyleModel.getAreaStyle();
- for (var i = 0; i < splitAreaRects.length; i++) {
- this.group.add(graphic.mergePath(splitAreaRects[i], {
- style: zrUtil.defaults({
- fill: areaColors[i % areaColors.length]
- }, areaStyle),
- silent: true
- }));
- }
- }
- });
-
- AxisView.extend({
- type: 'xAxis'
- });
- AxisView.extend({
- type: 'yAxis'
- });
-
- /**
- * @inner
- */
- function layoutAxis(gridModel, axisModel) {
- var grid = gridModel.coordinateSystem;
- var axis = axisModel.axis;
- var layout = {};
-
- var rawAxisPosition = axis.position;
- var axisPosition = axis.onZero ? 'onZero' : rawAxisPosition;
- var axisDim = axis.dim;
-
- // [left, right, top, bottom]
- var rect = grid.getRect();
- var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height];
-
- var posMap = {
- x: {top: rectBound[2], bottom: rectBound[3]},
- y: {left: rectBound[0], right: rectBound[1]}
- };
- posMap.x.onZero = Math.max(Math.min(getZero('y'), posMap.x.bottom), posMap.x.top);
- posMap.y.onZero = Math.max(Math.min(getZero('x'), posMap.y.right), posMap.y.left);
-
- function getZero(dim, val) {
- var theAxis = grid.getAxis(dim);
- return theAxis.toGlobalCoord(theAxis.dataToCoord(0));
- }
-
- // Axis position
- layout.position = [
- axisDim === 'y' ? posMap.y[axisPosition] : rectBound[0],
- axisDim === 'x' ? posMap.x[axisPosition] : rectBound[3]
- ];
-
- // Axis rotation
- var r = {x: 0, y: 1};
- layout.rotation = Math.PI / 2 * r[axisDim];
-
- // Tick and label direction, x y is axisDim
- var dirMap = {top: -1, bottom: 1, left: -1, right: 1};
-
- layout.labelDirection = layout.tickDirection = layout.nameDirection = dirMap[rawAxisPosition];
- if (axis.onZero) {
- layout.labelOffset = posMap[axisDim][rawAxisPosition] - posMap[axisDim].onZero;
- }
-
- if (axisModel.getModel('axisTick').get('inside')) {
- layout.tickDirection = -layout.tickDirection;
- }
- if (axisModel.getModel('axisLabel').get('inside')) {
- layout.labelDirection = -layout.labelDirection;
- }
-
- // Special label rotation
- var labelRotation = axisModel.getModel('axisLabel').get('rotate');
- layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation;
-
- // label interval when auto mode.
- layout.labelInterval = axis.getLabelInterval();
-
- // Over splitLine and splitArea
- layout.z2 = 1;
-
- return layout;
- }
-
-
-/***/ },
-/* 126 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var graphic = __webpack_require__(42);
- var Model = __webpack_require__(8);
- var numberUtil = __webpack_require__(7);
- var remRadian = numberUtil.remRadian;
- var isRadianAroundZero = numberUtil.isRadianAroundZero;
-
- var PI = Math.PI;
-
- /**
- * A final axis is translated and rotated from a "standard axis".
- * So opt.position and opt.rotation is required.
- *
- * A standard axis is and axis from [0, 0] to [0, axisExtent[1]],
- * for example: (0, 0) ------------> (0, 50)
- *
- * nameDirection or tickDirection or labelDirection is 1 means tick
- * or label is below the standard axis, whereas is -1 means above
- * the standard axis. labelOffset means offset between label and axis,
- * which is useful when 'onZero', where axisLabel is in the grid and
- * label in outside grid.
- *
- * Tips: like always,
- * positive rotation represents anticlockwise, and negative rotation
- * represents clockwise.
- * The direction of position coordinate is the same as the direction
- * of screen coordinate.
- *
- * Do not need to consider axis 'inverse', which is auto processed by
- * axis extent.
- *
- * @param {module:zrender/container/Group} group
- * @param {Object} axisModel
- * @param {Object} opt Standard axis parameters.
- * @param {Array.<number>} opt.position [x, y]
- * @param {number} opt.rotation by radian
- * @param {number} [opt.nameDirection=1] 1 or -1 Used when nameLocation is 'middle'.
- * @param {number} [opt.tickDirection=1] 1 or -1
- * @param {number} [opt.labelDirection=1] 1 or -1
- * @param {number} [opt.labelOffset=0] Usefull when onZero.
- * @param {string} [opt.axisName] default get from axisModel.
- * @param {number} [opt.labelRotation] by degree, default get from axisModel.
- * @param {number} [opt.labelInterval] Default label interval when label
- * interval from model is null or 'auto'.
- * @param {number} [opt.strokeContainThreshold] Default label interval when label
- * @param {number} [opt.silent=true]
- */
- var AxisBuilder = function (axisModel, opt) {
-
- /**
- * @readOnly
- */
- this.opt = opt;
-
- /**
- * @readOnly
- */
- this.axisModel = axisModel;
-
- // Default value
- zrUtil.defaults(
- opt,
- {
- labelOffset: 0,
- nameDirection: 1,
- tickDirection: 1,
- labelDirection: 1,
- silent: true
- }
- );
-
- /**
- * @readOnly
- */
- this.group = new graphic.Group({
- position: opt.position.slice(),
- rotation: opt.rotation
- });
- };
-
- AxisBuilder.prototype = {
-
- constructor: AxisBuilder,
-
- hasBuilder: function (name) {
- return !!builders[name];
- },
-
- add: function (name) {
- builders[name].call(this);
- },
-
- getGroup: function () {
- return this.group;
- }
-
- };
-
- var builders = {
-
- /**
- * @private
- */
- axisLine: function () {
- var opt = this.opt;
- var axisModel = this.axisModel;
-
- if (!axisModel.get('axisLine.show')) {
- return;
- }
-
- var extent = this.axisModel.axis.getExtent();
-
- this.group.add(new graphic.Line({
- shape: {
- x1: extent[0],
- y1: 0,
- x2: extent[1],
- y2: 0
- },
- style: zrUtil.extend(
- {lineCap: 'round'},
- axisModel.getModel('axisLine.lineStyle').getLineStyle()
- ),
- strokeContainThreshold: opt.strokeContainThreshold,
- silent: !!opt.silent,
- z2: 1
- }));
- },
-
- /**
- * @private
- */
- axisTick: function () {
- var axisModel = this.axisModel;
-
- if (!axisModel.get('axisTick.show')) {
- return;
- }
-
- var axis = axisModel.axis;
- var tickModel = axisModel.getModel('axisTick');
- var opt = this.opt;
-
- var lineStyleModel = tickModel.getModel('lineStyle');
- var tickLen = tickModel.get('length');
- var tickInterval = getInterval(tickModel, opt.labelInterval);
- var ticksCoords = axis.getTicksCoords();
- var tickLines = [];
-
- for (var i = 0; i < ticksCoords.length; i++) {
- // Only ordinal scale support tick interval
- if (ifIgnoreOnTick(axis, i, tickInterval)) {
- continue;
- }
-
- var tickCoord = ticksCoords[i];
-
- // Tick line
- tickLines.push(new graphic.Line(graphic.subPixelOptimizeLine({
- shape: {
- x1: tickCoord,
- y1: 0,
- x2: tickCoord,
- y2: opt.tickDirection * tickLen
- },
- style: {
- lineWidth: lineStyleModel.get('width')
- },
- silent: true
- })));
- }
-
- this.group.add(graphic.mergePath(tickLines, {
- style: lineStyleModel.getLineStyle(),
- z2: 2,
- silent: true
- }));
- },
-
- /**
- * @param {module:echarts/coord/cartesian/AxisModel} axisModel
- * @param {module:echarts/coord/cartesian/GridModel} gridModel
- * @private
- */
- axisLabel: function () {
- var axisModel = this.axisModel;
-
- if (!axisModel.get('axisLabel.show')) {
- return;
- }
-
- var opt = this.opt;
- var axis = axisModel.axis;
- var labelModel = axisModel.getModel('axisLabel');
- var textStyleModel = labelModel.getModel('textStyle');
- var labelMargin = labelModel.get('margin');
- var ticks = axis.scale.getTicks();
- var labels = axisModel.getFormattedLabels();
-
- // Special label rotate.
- var labelRotation = opt.labelRotation;
- if (labelRotation == null) {
- labelRotation = labelModel.get('rotate') || 0;
- }
- // To radian.
- labelRotation = labelRotation * PI / 180;
-
- var labelLayout = innerTextLayout(opt, labelRotation, opt.labelDirection);
- var categoryData = axisModel.get('data');
-
- var textEls = [];
- for (var i = 0; i < ticks.length; i++) {
- if (ifIgnoreOnTick(axis, i, opt.labelInterval)) {
- continue;
- }
-
- var itemTextStyleModel = textStyleModel;
- if (categoryData && categoryData[i] && categoryData[i].textStyle) {
- itemTextStyleModel = new Model(
- categoryData[i].textStyle, textStyleModel, axisModel.ecModel
- );
- }
-
- var tickCoord = axis.dataToCoord(ticks[i]);
- var pos = [
- tickCoord,
- opt.labelOffset + opt.labelDirection * labelMargin
- ];
-
- var textEl = new graphic.Text({
- style: {
- text: labels[i],
- textAlign: itemTextStyleModel.get('align', true) || labelLayout.textAlign,
- textVerticalAlign: itemTextStyleModel.get('baseline', true) || labelLayout.verticalAlign,
- textFont: itemTextStyleModel.getFont(),
- fill: itemTextStyleModel.getTextColor()
- },
- position: pos,
- rotation: labelLayout.rotation,
- silent: true,
- z2: 10
- });
- textEls.push(textEl);
- this.group.add(textEl);
- }
-
- function isTwoLabelOverlapped(current, next) {
- var firstRect = current && current.getBoundingRect().clone();
- var nextRect = next && next.getBoundingRect().clone();
- if (firstRect && nextRect) {
- firstRect.applyTransform(current.getLocalTransform());
- nextRect.applyTransform(next.getLocalTransform());
- return firstRect.intersect(nextRect);
- }
- }
- if (axis.type !== 'category') {
- // If min or max are user set, we need to check
- // If the tick on min(max) are overlap on their neighbour tick
- // If they are overlapped, we need to hide the min(max) tick label
- if (axisModel.getMin ? axisModel.getMin() : axisModel.get('min')) {
- var firstLabel = textEls[0];
- var nextLabel = textEls[1];
- if (isTwoLabelOverlapped(firstLabel, nextLabel)) {
- firstLabel.ignore = true;
- }
- }
- if (axisModel.getMax ? axisModel.getMax() : axisModel.get('max')) {
- var lastLabel = textEls[textEls.length - 1];
- var prevLabel = textEls[textEls.length - 2];
- if (isTwoLabelOverlapped(prevLabel, lastLabel)) {
- lastLabel.ignore = true;
- }
- }
- }
- },
-
- /**
- * @private
- */
- axisName: function () {
- var opt = this.opt;
- var axisModel = this.axisModel;
-
- var name = this.opt.axisName;
- // If name is '', do not get name from axisMode.
- if (name == null) {
- name = axisModel.get('name');
- }
-
- if (!name) {
- return;
- }
-
- var nameLocation = axisModel.get('nameLocation');
- var nameDirection = opt.nameDirection;
- var textStyleModel = axisModel.getModel('nameTextStyle');
- var gap = axisModel.get('nameGap') || 0;
-
- var extent = this.axisModel.axis.getExtent();
- var gapSignal = extent[0] > extent[1] ? -1 : 1;
- var pos = [
- nameLocation === 'start'
- ? extent[0] - gapSignal * gap
- : nameLocation === 'end'
- ? extent[1] + gapSignal * gap
- : (extent[0] + extent[1]) / 2, // 'middle'
- // Reuse labelOffset.
- nameLocation === 'middle' ? opt.labelOffset + nameDirection * gap : 0
- ];
-
- var labelLayout;
-
- if (nameLocation === 'middle') {
- labelLayout = innerTextLayout(opt, opt.rotation, nameDirection);
- }
- else {
- labelLayout = endTextLayout(opt, nameLocation, extent);
- }
-
- this.group.add(new graphic.Text({
- style: {
- text: name,
- textFont: textStyleModel.getFont(),
- fill: textStyleModel.getTextColor()
- || axisModel.get('axisLine.lineStyle.color'),
- textAlign: labelLayout.textAlign,
- textVerticalAlign: labelLayout.verticalAlign
- },
- position: pos,
- rotation: labelLayout.rotation,
- silent: true,
- z2: 1
- }));
- }
-
- };
-
- /**
- * @inner
- */
- function innerTextLayout(opt, textRotation, direction) {
- var rotationDiff = remRadian(textRotation - opt.rotation);
- var textAlign;
- var verticalAlign;
-
- if (isRadianAroundZero(rotationDiff)) { // Label is parallel with axis line.
- verticalAlign = direction > 0 ? 'top' : 'bottom';
- textAlign = 'center';
- }
- else if (isRadianAroundZero(rotationDiff - PI)) { // Label is inverse parallel with axis line.
- verticalAlign = direction > 0 ? 'bottom' : 'top';
- textAlign = 'center';
- }
- else {
- verticalAlign = 'middle';
-
- if (rotationDiff > 0 && rotationDiff < PI) {
- textAlign = direction > 0 ? 'right' : 'left';
- }
- else {
- textAlign = direction > 0 ? 'left' : 'right';
- }
- }
-
- return {
- rotation: rotationDiff,
- textAlign: textAlign,
- verticalAlign: verticalAlign
- };
- }
-
- /**
- * @inner
- */
- function endTextLayout(opt, textPosition, extent) {
- var rotationDiff = remRadian(-opt.rotation);
- var textAlign;
- var verticalAlign;
- var inverse = extent[0] > extent[1];
- var onLeft = (textPosition === 'start' && !inverse)
- || (textPosition !== 'start' && inverse);
-
- if (isRadianAroundZero(rotationDiff - PI / 2)) {
- verticalAlign = onLeft ? 'bottom' : 'top';
- textAlign = 'center';
- }
- else if (isRadianAroundZero(rotationDiff - PI * 1.5)) {
- verticalAlign = onLeft ? 'top' : 'bottom';
- textAlign = 'center';
- }
- else {
- verticalAlign = 'middle';
- if (rotationDiff < PI * 1.5 && rotationDiff > PI / 2) {
- textAlign = onLeft ? 'left' : 'right';
- }
- else {
- textAlign = onLeft ? 'right' : 'left';
- }
- }
-
- return {
- rotation: rotationDiff,
- textAlign: textAlign,
- verticalAlign: verticalAlign
- };
- }
-
- /**
- * @static
- */
- var ifIgnoreOnTick = AxisBuilder.ifIgnoreOnTick = function (axis, i, interval) {
- var rawTick;
- var scale = axis.scale;
- return scale.type === 'ordinal'
- && (
- typeof interval === 'function'
- ? (
- rawTick = scale.getTicks()[i],
- !interval(rawTick, scale.getLabel(rawTick))
- )
- : i % (interval + 1)
- );
- };
-
- /**
- * @static
- */
- var getInterval = AxisBuilder.getInterval = function (model, labelInterval) {
- var interval = model.get('interval');
- if (interval == null || interval == 'auto') {
- interval = labelInterval;
- }
- return interval;
- };
-
- module.exports = AxisBuilder;
-
-
-
-/***/ },
-/* 127 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
-
- __webpack_require__(107);
-
- __webpack_require__(128);
- __webpack_require__(129);
-
- var barLayoutGrid = __webpack_require__(131);
- var echarts = __webpack_require__(1);
-
- echarts.registerLayout(zrUtil.curry(barLayoutGrid, 'bar'));
- // Visual coding for legend
- echarts.registerVisualCoding('chart', function (ecModel) {
- ecModel.eachSeriesByType('bar', function (seriesModel) {
- var data = seriesModel.getData();
- data.setVisual('legendSymbol', 'roundRect');
- });
- });
-
- // In case developer forget to include grid component
- __webpack_require__(106);
-
-
-/***/ },
-/* 128 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var SeriesModel = __webpack_require__(27);
- var createListFromArray = __webpack_require__(93);
-
- module.exports = SeriesModel.extend({
-
- type: 'series.bar',
-
- dependencies: ['grid', 'polar'],
-
- getInitialData: function (option, ecModel) {
- return createListFromArray(option.data, this, ecModel);
- },
-
- getMarkerPosition: function (value) {
- var coordSys = this.coordinateSystem;
- if (coordSys) {
- var pt = coordSys.dataToPoint(value);
- var data = this.getData();
- var offset = data.getLayout('offset');
- var size = data.getLayout('size');
- var offsetIndex = coordSys.getBaseAxis().isHorizontal() ? 0 : 1;
- pt[offsetIndex] += offset + size / 2;
- return pt;
- }
- return [NaN, NaN];
- },
-
- defaultOption: {
- zlevel: 0, // 一级层叠
- z: 2, // 二级层叠
- coordinateSystem: 'cartesian2d',
- legendHoverLink: true,
- // stack: null
-
- // Cartesian coordinate system
- xAxisIndex: 0,
- yAxisIndex: 0,
-
- // 最小高度改为0
- barMinHeight: 0,
-
- // barMaxWidth: null,
- // 默认自适应
- // barWidth: null,
- // 柱间距离,默认为柱形宽度的30%,可设固定值
- // barGap: '30%',
- // 类目间柱形距离,默认为类目间距的20%,可设固定值
- // barCategoryGap: '20%',
- // label: {
- // normal: {
- // show: false
- // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
-
- // // 默认自适应,水平布局为'top',垂直布局为'right',可选为
- // // 'inside' | 'insideleft' | 'insideTop' | 'insideRight' | 'insideBottom' |
- // // 'outside' |'left' | 'right'|'top'|'bottom'
- // position:
-
- // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
- // }
- // },
- itemStyle: {
- normal: {
- // color: '各异',
- // 柱条边线
- barBorderColor: '#fff',
- // 柱条边线线宽,单位px,默认为1
- barBorderWidth: 0
- },
- emphasis: {
- // color: '各异',
- // 柱条边线
- barBorderColor: '#fff',
- // 柱条边线线宽,单位px,默认为1
- barBorderWidth: 0
- }
- }
- }
- });
-
-
-/***/ },
-/* 129 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
- var graphic = __webpack_require__(42);
-
- zrUtil.extend(__webpack_require__(8).prototype, __webpack_require__(130));
-
- function fixLayoutWithLineWidth(layout, lineWidth) {
- var signX = layout.width > 0 ? 1 : -1;
- var signY = layout.height > 0 ? 1 : -1;
- // In case width or height are too small.
- lineWidth = Math.min(lineWidth, Math.abs(layout.width), Math.abs(layout.height));
- layout.x += signX * lineWidth / 2;
- layout.y += signY * lineWidth / 2;
- layout.width -= signX * lineWidth;
- layout.height -= signY * lineWidth;
- }
-
- module.exports = __webpack_require__(1).extendChartView({
-
- type: 'bar',
-
- render: function (seriesModel, ecModel, api) {
- var coordinateSystemType = seriesModel.get('coordinateSystem');
-
- if (coordinateSystemType === 'cartesian2d') {
- this._renderOnCartesian(seriesModel, ecModel, api);
- }
-
- return this.group;
- },
-
- _renderOnCartesian: function (seriesModel, ecModel, api) {
- var group = this.group;
- var data = seriesModel.getData();
- var oldData = this._data;
-
- var cartesian = seriesModel.coordinateSystem;
- var baseAxis = cartesian.getBaseAxis();
- var isHorizontal = baseAxis.isHorizontal();
-
- var enableAnimation = seriesModel.get('animation');
-
- var barBorderWidthQuery = ['itemStyle', 'normal', 'barBorderWidth'];
-
- function createRect(dataIndex, isUpdate) {
- var layout = data.getItemLayout(dataIndex);
- var lineWidth = data.getItemModel(dataIndex).get(barBorderWidthQuery) || 0;
- fixLayoutWithLineWidth(layout, lineWidth);
-
- var rect = new graphic.Rect({
- shape: zrUtil.extend({}, layout)
- });
- // Animation
- if (enableAnimation) {
- var rectShape = rect.shape;
- var animateProperty = isHorizontal ? 'height' : 'width';
- var animateTarget = {};
- rectShape[animateProperty] = 0;
- animateTarget[animateProperty] = layout[animateProperty];
- graphic[isUpdate? 'updateProps' : 'initProps'](rect, {
- shape: animateTarget
- }, seriesModel);
- }
- return rect;
- }
- data.diff(oldData)
- .add(function (dataIndex) {
- // 空数据
- if (!data.hasValue(dataIndex)) {
- return;
- }
-
- var rect = createRect(dataIndex);
-
- data.setItemGraphicEl(dataIndex, rect);
-
- group.add(rect);
-
- })
- .update(function (newIndex, oldIndex) {
- var rect = oldData.getItemGraphicEl(oldIndex);
- // 空数据
- if (!data.hasValue(newIndex)) {
- group.remove(rect);
- return;
- }
- if (!rect) {
- rect = createRect(newIndex, true);
- }
-
- var layout = data.getItemLayout(newIndex);
- var lineWidth = data.getItemModel(newIndex).get(barBorderWidthQuery) || 0;
- fixLayoutWithLineWidth(layout, lineWidth);
-
- graphic.updateProps(rect, {
- shape: layout
- }, seriesModel);
-
- data.setItemGraphicEl(newIndex, rect);
-
- // Add back
- group.add(rect);
- })
- .remove(function (idx) {
- var rect = oldData.getItemGraphicEl(idx);
- if (rect) {
- // Not show text when animating
- rect.style.text = '';
- graphic.updateProps(rect, {
- shape: {
- width: 0
- }
- }, seriesModel, function () {
- group.remove(rect);
- });
- }
- })
- .execute();
-
- this._updateStyle(seriesModel, data, isHorizontal);
-
- this._data = data;
- },
-
- _updateStyle: function (seriesModel, data, isHorizontal) {
- function setLabel(style, model, color, labelText, labelPositionOutside) {
- graphic.setText(style, model, color);
- style.text = labelText;
- if (style.textPosition === 'outside') {
- style.textPosition = labelPositionOutside;
- }
- }
-
- data.eachItemGraphicEl(function (rect, idx) {
- var itemModel = data.getItemModel(idx);
- var color = data.getItemVisual(idx, 'color');
- var layout = data.getItemLayout(idx);
- var itemStyleModel = itemModel.getModel('itemStyle.normal');
-
- var hoverStyle = itemModel.getModel('itemStyle.emphasis').getItemStyle();
-
- rect.setShape('r', itemStyleModel.get('barBorderRadius') || 0);
-
- rect.setStyle(zrUtil.defaults(
- {
- fill: color
- },
- itemStyleModel.getBarItemStyle()
- ));
-
- var labelPositionOutside = isHorizontal
- ? (layout.height > 0 ? 'bottom' : 'top')
- : (layout.width > 0 ? 'left' : 'right');
-
- var labelModel = itemModel.getModel('label.normal');
- var hoverLabelModel = itemModel.getModel('label.emphasis');
- var rectStyle = rect.style;
- if (labelModel.get('show')) {
- setLabel(
- rectStyle, labelModel, color,
- zrUtil.retrieve(
- seriesModel.getFormattedLabel(idx, 'normal'),
- seriesModel.getRawValue(idx)
- ),
- labelPositionOutside
- );
- }
- else {
- rectStyle.text = '';
- }
- if (hoverLabelModel.get('show')) {
- setLabel(
- hoverStyle, hoverLabelModel, color,
- zrUtil.retrieve(
- seriesModel.getFormattedLabel(idx, 'emphasis'),
- seriesModel.getRawValue(idx)
- ),
- labelPositionOutside
- );
- }
- else {
- hoverStyle.text = '';
- }
- graphic.setHoverStyle(rect, hoverStyle);
- });
- },
-
- remove: function (ecModel, api) {
- var group = this.group;
- if (ecModel.get('animation')) {
- if (this._data) {
- this._data.eachItemGraphicEl(function (el) {
- // Not show text when animating
- el.style.text = '';
- graphic.updateProps(el, {
- shape: {
- width: 0
- }
- }, ecModel, function () {
- group.remove(el);
- });
- });
- }
- }
- else {
- group.removeAll();
- }
- }
- });
-
-
-/***/ },
-/* 130 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- module.exports = {
- getBarItemStyle: __webpack_require__(11)(
- [
- ['fill', 'color'],
- ['stroke', 'barBorderColor'],
- ['lineWidth', 'barBorderWidth'],
- ['opacity'],
- ['shadowBlur'],
- ['shadowOffsetX'],
- ['shadowOffsetY'],
- ['shadowColor']
- ]
- )
- };
-
-
-/***/ },
-/* 131 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
- var numberUtil = __webpack_require__(7);
- var parsePercent = numberUtil.parsePercent;
-
- function getSeriesStackId(seriesModel) {
- return seriesModel.get('stack') || '__ec_stack_' + seriesModel.seriesIndex;
- }
-
- function calBarWidthAndOffset(barSeries, api) {
- // Columns info on each category axis. Key is cartesian name
- var columnsMap = {};
-
- zrUtil.each(barSeries, function (seriesModel, idx) {
- var cartesian = seriesModel.coordinateSystem;
-
- var baseAxis = cartesian.getBaseAxis();
-
- var columnsOnAxis = columnsMap[baseAxis.index] || {
- remainedWidth: baseAxis.getBandWidth(),
- autoWidthCount: 0,
- categoryGap: '20%',
- gap: '30%',
- axis: baseAxis,
- stacks: {}
- };
- var stacks = columnsOnAxis.stacks;
- columnsMap[baseAxis.index] = columnsOnAxis;
-
- var stackId = getSeriesStackId(seriesModel);
-
- if (!stacks[stackId]) {
- columnsOnAxis.autoWidthCount++;
- }
- stacks[stackId] = stacks[stackId] || {
- width: 0,
- maxWidth: 0
- };
-
- var barWidth = seriesModel.get('barWidth');
- var barMaxWidth = seriesModel.get('barMaxWidth');
- var barGap = seriesModel.get('barGap');
- var barCategoryGap = seriesModel.get('barCategoryGap');
- // TODO
- if (barWidth && ! stacks[stackId].width) {
- barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth);
- stacks[stackId].width = barWidth;
- columnsOnAxis.remainedWidth -= barWidth;
- }
-
- barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth);
- (barGap != null) && (columnsOnAxis.gap = barGap);
- (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap);
- });
-
- var result = {};
-
- zrUtil.each(columnsMap, function (columnsOnAxis, coordSysName) {
-
- result[coordSysName] = {};
-
- var stacks = columnsOnAxis.stacks;
- var baseAxis = columnsOnAxis.axis;
- var bandWidth = baseAxis.getBandWidth();
- var categoryGap = parsePercent(columnsOnAxis.categoryGap, bandWidth);
- var barGapPercent = parsePercent(columnsOnAxis.gap, 1);
-
- var remainedWidth = columnsOnAxis.remainedWidth;
- var autoWidthCount = columnsOnAxis.autoWidthCount;
- var autoWidth = (remainedWidth - categoryGap)
- / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);
- autoWidth = Math.max(autoWidth, 0);
-
- // Find if any auto calculated bar exceeded maxBarWidth
- zrUtil.each(stacks, function (column, stack) {
- var maxWidth = column.maxWidth;
- if (!column.width && maxWidth && maxWidth < autoWidth) {
- maxWidth = Math.min(maxWidth, remainedWidth);
- remainedWidth -= maxWidth;
- column.width = maxWidth;
- autoWidthCount--;
- }
- });
-
- // Recalculate width again
- autoWidth = (remainedWidth - categoryGap)
- / (autoWidthCount + (autoWidthCount - 1) * barGapPercent);
- autoWidth = Math.max(autoWidth, 0);
-
- var widthSum = 0;
- var lastColumn;
- zrUtil.each(stacks, function (column, idx) {
- if (!column.width) {
- column.width = autoWidth;
- }
- lastColumn = column;
- widthSum += column.width * (1 + barGapPercent);
- });
- if (lastColumn) {
- widthSum -= lastColumn.width * barGapPercent;
- }
-
- var offset = -widthSum / 2;
- zrUtil.each(stacks, function (column, stackId) {
- result[coordSysName][stackId] = result[coordSysName][stackId] || {
- offset: offset,
- width: column.width
- };
-
- offset += column.width * (1 + barGapPercent);
- });
- });
-
- return result;
- }
-
- /**
- * @param {string} seriesType
- * @param {module:echarts/model/Global} ecModel
- * @param {module:echarts/ExtensionAPI} api
- */
- function barLayoutGrid(seriesType, ecModel, api) {
-
- var barWidthAndOffset = calBarWidthAndOffset(
- zrUtil.filter(
- ecModel.getSeriesByType(seriesType),
- function (seriesModel) {
- return !ecModel.isSeriesFiltered(seriesModel)
- && seriesModel.coordinateSystem
- && seriesModel.coordinateSystem.type === 'cartesian2d';
- }
- )
- );
-
- var lastStackCoords = {};
-
- ecModel.eachSeriesByType(seriesType, function (seriesModel) {
-
- var data = seriesModel.getData();
- var cartesian = seriesModel.coordinateSystem;
- var baseAxis = cartesian.getBaseAxis();
-
- var stackId = getSeriesStackId(seriesModel);
- var columnLayoutInfo = barWidthAndOffset[baseAxis.index][stackId];
- var columnOffset = columnLayoutInfo.offset;
- var columnWidth = columnLayoutInfo.width;
- var valueAxis = cartesian.getOtherAxis(baseAxis);
-
- var barMinHeight = seriesModel.get('barMinHeight') || 0;
-
- var valueAxisStart = baseAxis.onZero
- ? valueAxis.toGlobalCoord(valueAxis.dataToCoord(0))
- : valueAxis.getGlobalExtent()[0];
-
- var coords = cartesian.dataToPoints(data, true);
- lastStackCoords[stackId] = lastStackCoords[stackId] || [];
-
- data.setLayout({
- offset: columnOffset,
- size: columnWidth
- });
- data.each(valueAxis.dim, function (value, idx) {
- // 空数据
- if (isNaN(value)) {
- return;
- }
- if (!lastStackCoords[stackId][idx]) {
- lastStackCoords[stackId][idx] = {
- // Positive stack
- p: valueAxisStart,
- // Negative stack
- n: valueAxisStart
- };
- }
- var sign = value >= 0 ? 'p' : 'n';
- var coord = coords[idx];
- var lastCoord = lastStackCoords[stackId][idx][sign];
- var x, y, width, height;
- if (valueAxis.isHorizontal()) {
- x = lastCoord;
- y = coord[1] + columnOffset;
- width = coord[0] - lastCoord;
- height = columnWidth;
-
- if (Math.abs(width) < barMinHeight) {
- width = (width < 0 ? -1 : 1) * barMinHeight;
- }
- lastStackCoords[stackId][idx][sign] += width;
- }
- else {
- x = coord[0] + columnOffset;
- y = lastCoord;
- width = columnWidth;
- height = coord[1] - lastCoord;
- if (Math.abs(height) < barMinHeight) {
- // Include zero to has a positive bar
- height = (height <= 0 ? -1 : 1) * barMinHeight;
- }
- lastStackCoords[stackId][idx][sign] += height;
- }
-
- data.setItemLayout(idx, {
- x: x,
- y: y,
- width: width,
- height: height
- });
- }, true);
-
- }, this);
- }
-
- module.exports = barLayoutGrid;
-
-
-/***/ },
-/* 132 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var echarts = __webpack_require__(1);
-
- __webpack_require__(133);
- __webpack_require__(135);
-
- __webpack_require__(136)('pie', [{
- type: 'pieToggleSelect',
- event: 'pieselectchanged',
- method: 'toggleSelected'
- }, {
- type: 'pieSelect',
- event: 'pieselected',
- method: 'select'
- }, {
- type: 'pieUnSelect',
- event: 'pieunselected',
- method: 'unSelect'
- }]);
-
- echarts.registerVisualCoding(
- 'chart', zrUtil.curry(__webpack_require__(137), 'pie')
- );
-
- echarts.registerLayout(zrUtil.curry(
- __webpack_require__(138), 'pie'
- ));
-
- echarts.registerProcessor(
- 'filter', zrUtil.curry(__webpack_require__(140), 'pie')
- );
-
-
-/***/ },
-/* 133 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var List = __webpack_require__(94);
- var zrUtil = __webpack_require__(3);
- var modelUtil = __webpack_require__(5);
- var completeDimensions = __webpack_require__(96);
-
- var dataSelectableMixin = __webpack_require__(134);
-
- var PieSeries = __webpack_require__(1).extendSeriesModel({
-
- type: 'series.pie',
-
- // Overwrite
- init: function (option) {
- PieSeries.superApply(this, 'init', arguments);
-
- // Enable legend selection for each data item
- // Use a function instead of direct access because data reference may changed
- this.legendDataProvider = function () {
- return this._dataBeforeProcessed;
- };
-
- this.updateSelectedMap();
-
- this._defaultLabelLine(option);
- },
-
- // Overwrite
- mergeOption: function (newOption) {
- PieSeries.superCall(this, 'mergeOption', newOption);
- this.updateSelectedMap();
- },
-
- getInitialData: function (option, ecModel) {
- var dimensions = completeDimensions(['value'], option.data);
- var list = new List(dimensions, this);
- list.initData(option.data);
- return list;
- },
-
- // Overwrite
- getDataParams: function (dataIndex) {
- var data = this._data;
- var params = PieSeries.superCall(this, 'getDataParams', dataIndex);
- var sum = data.getSum('value');
- // FIXME toFixed?
- //
- // Percent is 0 if sum is 0
- params.percent = !sum ? 0 : +(data.get('value', dataIndex) / sum * 100).toFixed(2);
-
- params.$vars.push('percent');
- return params;
- },
-
- _defaultLabelLine: function (option) {
- // Extend labelLine emphasis
- modelUtil.defaultEmphasis(option.labelLine, ['show']);
-
- var labelLineNormalOpt = option.labelLine.normal;
- var labelLineEmphasisOpt = option.labelLine.emphasis;
- // Not show label line if `label.normal.show = false`
- labelLineNormalOpt.show = labelLineNormalOpt.show
- && option.label.normal.show;
- labelLineEmphasisOpt.show = labelLineEmphasisOpt.show
- && option.label.emphasis.show;
- },
-
- defaultOption: {
- zlevel: 0,
- z: 2,
- legendHoverLink: true,
-
- hoverAnimation: true,
- // 默认全局居中
- center: ['50%', '50%'],
- radius: [0, '75%'],
- // 默认顺时针
- clockwise: true,
- startAngle: 90,
- // 最小角度改为0
- minAngle: 0,
- // 选中是扇区偏移量
- selectedOffset: 10,
-
- // If use strategy to avoid label overlapping
- avoidLabelOverlap: true,
- // 选择模式,默认关闭,可选single,multiple
- // selectedMode: false,
- // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积)
- // roseType: null,
-
- label: {
- normal: {
- // If rotate around circle
- rotate: false,
- show: true,
- // 'outer', 'inside', 'center'
- position: 'outer'
- // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
- // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
- // distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数
- },
- emphasis: {}
- },
- // Enabled when label.normal.position is 'outer'
- labelLine: {
- normal: {
- show: true,
- // 引导线两段中的第一段长度
- length: 15,
- // 引导线两段中的第二段长度
- length2: 15,
- smooth: false,
- lineStyle: {
- // color: 各异,
- width: 1,
- type: 'solid'
- }
- }
- },
- itemStyle: {
- normal: {
- // color: 各异,
- borderColor: 'rgba(0,0,0,0)',
- borderWidth: 1
- },
- emphasis: {
- // color: 各异,
- borderColor: 'rgba(0,0,0,0)',
- borderWidth: 1
- }
- },
-
- animationEasing: 'cubicOut',
-
- data: []
- }
- });
-
- zrUtil.mixin(PieSeries, dataSelectableMixin);
-
- module.exports = PieSeries;
-
-
-/***/ },
-/* 134 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Data selectable mixin for chart series.
- * To eanble data select, option of series must have `selectedMode`.
- * And each data item will use `selected` to toggle itself selected status
- *
- * @module echarts/chart/helper/DataSelectable
- */
-
-
- var zrUtil = __webpack_require__(3);
-
- module.exports = {
-
- updateSelectedMap: function () {
- var option = this.option;
- this._dataOptMap = zrUtil.reduce(option.data, function (dataOptMap, dataOpt) {
- dataOptMap[dataOpt.name] = dataOpt;
- return dataOptMap;
- }, {});
- },
- /**
- * @param {string} name
- */
- // PENGING If selectedMode is null ?
- select: function (name) {
- var dataOptMap = this._dataOptMap;
- var dataOpt = dataOptMap[name];
- var selectedMode = this.get('selectedMode');
- if (selectedMode === 'single') {
- zrUtil.each(dataOptMap, function (dataOpt) {
- dataOpt.selected = false;
- });
- }
- dataOpt && (dataOpt.selected = true);
- },
-
- /**
- * @param {string} name
- */
- unSelect: function (name) {
- var dataOpt = this._dataOptMap[name];
- // var selectedMode = this.get('selectedMode');
- // selectedMode !== 'single' && dataOpt && (dataOpt.selected = false);
- dataOpt && (dataOpt.selected = false);
- },
-
- /**
- * @param {string} name
- */
- toggleSelected: function (name) {
- var dataOpt = this._dataOptMap[name];
- if (dataOpt != null) {
- this[dataOpt.selected ? 'unSelect' : 'select'](name);
- return dataOpt.selected;
- }
- },
-
- /**
- * @param {string} name
- */
- isSelected: function (name) {
- var dataOpt = this._dataOptMap[name];
- return dataOpt && dataOpt.selected;
- }
- };
-
-
-/***/ },
-/* 135 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var graphic = __webpack_require__(42);
- var zrUtil = __webpack_require__(3);
-
- /**
- * @param {module:echarts/model/Series} seriesModel
- * @param {boolean} hasAnimation
- * @inner
- */
- function updateDataSelected(uid, seriesModel, hasAnimation, api) {
- var data = seriesModel.getData();
- var dataIndex = this.dataIndex;
- var name = data.getName(dataIndex);
- var selectedOffset = seriesModel.get('selectedOffset');
-
- api.dispatchAction({
- type: 'pieToggleSelect',
- from: uid,
- name: name,
- seriesId: seriesModel.id
- });
-
- data.each(function (idx) {
- toggleItemSelected(
- data.getItemGraphicEl(idx),
- data.getItemLayout(idx),
- seriesModel.isSelected(data.getName(idx)),
- selectedOffset,
- hasAnimation
- );
- });
- }
-
- /**
- * @param {module:zrender/graphic/Sector} el
- * @param {Object} layout
- * @param {boolean} isSelected
- * @param {number} selectedOffset
- * @param {boolean} hasAnimation
- * @inner
- */
- function toggleItemSelected(el, layout, isSelected, selectedOffset, hasAnimation) {
- var midAngle = (layout.startAngle + layout.endAngle) / 2;
-
- var dx = Math.cos(midAngle);
- var dy = Math.sin(midAngle);
-
- var offset = isSelected ? selectedOffset : 0;
- var position = [dx * offset, dy * offset];
-
- hasAnimation
- // animateTo will stop revious animation like update transition
- ? el.animate()
- .when(200, {
- position: position
- })
- .start('bounceOut')
- : el.attr('position', position);
- }
-
- /**
- * Piece of pie including Sector, Label, LabelLine
- * @constructor
- * @extends {module:zrender/graphic/Group}
- */
- function PiePiece(data, idx) {
-
- graphic.Group.call(this);
-
- var sector = new graphic.Sector({
- z2: 2
- });
- var polyline = new graphic.Polyline();
- var text = new graphic.Text();
- this.add(sector);
- this.add(polyline);
- this.add(text);
-
- this.updateData(data, idx, true);
-
- // Hover to change label and labelLine
- function onEmphasis() {
- polyline.ignore = polyline.hoverIgnore;
- text.ignore = text.hoverIgnore;
- }
- function onNormal() {
- polyline.ignore = polyline.normalIgnore;
- text.ignore = text.normalIgnore;
- }
- this.on('emphasis', onEmphasis)
- .on('normal', onNormal)
- .on('mouseover', onEmphasis)
- .on('mouseout', onNormal);
- }
-
- var piePieceProto = PiePiece.prototype;
-
- function getLabelStyle(data, idx, state, labelModel, labelPosition) {
- var textStyleModel = labelModel.getModel('textStyle');
- var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';
- return {
- fill: textStyleModel.getTextColor()
- || (isLabelInside ? '#fff' : data.getItemVisual(idx, 'color')),
- textFont: textStyleModel.getFont(),
- text: zrUtil.retrieve(
- data.hostModel.getFormattedLabel(idx, state), data.getName(idx)
- )
- };
- }
-
- piePieceProto.updateData = function (data, idx, firstCreate) {
-
- var sector = this.childAt(0);
-
- var seriesModel = data.hostModel;
- var itemModel = data.getItemModel(idx);
- var layout = data.getItemLayout(idx);
- var sectorShape = zrUtil.extend({}, layout);
- sectorShape.label = null;
- if (firstCreate) {
- sector.setShape(sectorShape);
- sector.shape.endAngle = layout.startAngle;
- graphic.updateProps(sector, {
- shape: {
- endAngle: layout.endAngle
- }
- }, seriesModel);
- }
- else {
- graphic.updateProps(sector, {
- shape: sectorShape
- }, seriesModel);
- }
-
- // Update common style
- var itemStyleModel = itemModel.getModel('itemStyle');
- var visualColor = data.getItemVisual(idx, 'color');
-
- sector.setStyle(
- zrUtil.defaults(
- {
- fill: visualColor
- },
- itemStyleModel.getModel('normal').getItemStyle()
- )
- );
- sector.hoverStyle = itemStyleModel.getModel('emphasis').getItemStyle();
-
- // Toggle selected
- toggleItemSelected(
- this,
- data.getItemLayout(idx),
- itemModel.get('selected'),
- seriesModel.get('selectedOffset'),
- seriesModel.get('animation')
- );
-
- function onEmphasis() {
- // Sector may has animation of updating data. Force to move to the last frame
- // Or it may stopped on the wrong shape
- sector.stopAnimation(true);
- sector.animateTo({
- shape: {
- r: layout.r + 10
- }
- }, 300, 'elasticOut');
- }
- function onNormal() {
- sector.stopAnimation(true);
- sector.animateTo({
- shape: {
- r: layout.r
- }
- }, 300, 'elasticOut');
- }
- sector.off('mouseover').off('mouseout').off('emphasis').off('normal');
- if (itemModel.get('hoverAnimation')) {
- sector
- .on('mouseover', onEmphasis)
- .on('mouseout', onNormal)
- .on('emphasis', onEmphasis)
- .on('normal', onNormal);
- }
-
- this._updateLabel(data, idx);
-
- graphic.setHoverStyle(this);
- };
-
- piePieceProto._updateLabel = function (data, idx) {
-
- var labelLine = this.childAt(1);
- var labelText = this.childAt(2);
-
- var seriesModel = data.hostModel;
- var itemModel = data.getItemModel(idx);
- var layout = data.getItemLayout(idx);
- var labelLayout = layout.label;
- var visualColor = data.getItemVisual(idx, 'color');
-
- graphic.updateProps(labelLine, {
- shape: {
- points: labelLayout.linePoints || [
- [labelLayout.x, labelLayout.y], [labelLayout.x, labelLayout.y], [labelLayout.x, labelLayout.y]
- ]
- }
- }, seriesModel);
-
- graphic.updateProps(labelText, {
- style: {
- x: labelLayout.x,
- y: labelLayout.y
- }
- }, seriesModel);
- labelText.attr({
- style: {
- textVerticalAlign: labelLayout.verticalAlign,
- textAlign: labelLayout.textAlign,
- textFont: labelLayout.font
- },
- rotation: labelLayout.rotation,
- origin: [labelLayout.x, labelLayout.y],
- z2: 10
- });
-
- var labelModel = itemModel.getModel('label.normal');
- var labelHoverModel = itemModel.getModel('label.emphasis');
- var labelLineModel = itemModel.getModel('labelLine.normal');
- var labelLineHoverModel = itemModel.getModel('labelLine.emphasis');
- var labelPosition = labelModel.get('position') || labelHoverModel.get('position');
-
- labelText.setStyle(getLabelStyle(data, idx, 'normal', labelModel, labelPosition));
-
- labelText.ignore = labelText.normalIgnore = !labelModel.get('show');
- labelText.hoverIgnore = !labelHoverModel.get('show');
-
- labelLine.ignore = labelLine.normalIgnore = !labelLineModel.get('show');
- labelLine.hoverIgnore = !labelLineHoverModel.get('show');
-
- // Default use item visual color
- labelLine.setStyle({
- stroke: visualColor
- });
- labelLine.setStyle(labelLineModel.getModel('lineStyle').getLineStyle());
-
- labelText.hoverStyle = getLabelStyle(data, idx, 'emphasis', labelHoverModel, labelPosition);
- labelLine.hoverStyle = labelLineHoverModel.getModel('lineStyle').getLineStyle();
-
- var smooth = labelLineModel.get('smooth');
- if (smooth && smooth === true) {
- smooth = 0.4;
- }
- labelLine.setShape({
- smooth: smooth
- });
- };
-
- zrUtil.inherits(PiePiece, graphic.Group);
-
-
- // Pie view
- var Pie = __webpack_require__(41).extend({
-
- type: 'pie',
-
- init: function () {
- var sectorGroup = new graphic.Group();
- this._sectorGroup = sectorGroup;
- },
-
- render: function (seriesModel, ecModel, api, payload) {
- if (payload && (payload.from === this.uid)) {
- return;
- }
-
- var data = seriesModel.getData();
- var oldData = this._data;
- var group = this.group;
-
- var hasAnimation = ecModel.get('animation');
- var isFirstRender = !oldData;
-
- var onSectorClick = zrUtil.curry(
- updateDataSelected, this.uid, seriesModel, hasAnimation, api
- );
-
- var selectedMode = seriesModel.get('selectedMode');
-
- data.diff(oldData)
- .add(function (idx) {
- var piePiece = new PiePiece(data, idx);
- if (isFirstRender) {
- piePiece.eachChild(function (child) {
- child.stopAnimation(true);
- });
- }
-
- selectedMode && piePiece.on('click', onSectorClick);
-
- data.setItemGraphicEl(idx, piePiece);
-
- group.add(piePiece);
- })
- .update(function (newIdx, oldIdx) {
- var piePiece = oldData.getItemGraphicEl(oldIdx);
-
- piePiece.updateData(data, newIdx);
-
- piePiece.off('click');
- selectedMode && piePiece.on('click', onSectorClick);
- group.add(piePiece);
- data.setItemGraphicEl(newIdx, piePiece);
- })
- .remove(function (idx) {
- var piePiece = oldData.getItemGraphicEl(idx);
- group.remove(piePiece);
- })
- .execute();
-
- if (hasAnimation && isFirstRender && data.count() > 0) {
- var shape = data.getItemLayout(0);
- var r = Math.max(api.getWidth(), api.getHeight()) / 2;
-
- var removeClipPath = zrUtil.bind(group.removeClipPath, group);
- group.setClipPath(this._createClipPath(
- shape.cx, shape.cy, r, shape.startAngle, shape.clockwise, removeClipPath, seriesModel
- ));
- }
-
- this._data = data;
- },
-
- _createClipPath: function (
- cx, cy, r, startAngle, clockwise, cb, seriesModel
- ) {
- var clipPath = new graphic.Sector({
- shape: {
- cx: cx,
- cy: cy,
- r0: 0,
- r: r,
- startAngle: startAngle,
- endAngle: startAngle,
- clockwise: clockwise
- }
- });
-
- graphic.initProps(clipPath, {
- shape: {
- endAngle: startAngle + (clockwise ? 1 : -1) * Math.PI * 2
- }
- }, seriesModel, cb);
-
- return clipPath;
- }
- });
-
- module.exports = Pie;
-
-
-/***/ },
-/* 136 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- var echarts = __webpack_require__(1);
- var zrUtil = __webpack_require__(3);
- module.exports = function (seriesType, actionInfos) {
- zrUtil.each(actionInfos, function (actionInfo) {
- actionInfo.update = 'updateView';
- /**
- * @payload
- * @property {string} seriesName
- * @property {string} name
- */
- echarts.registerAction(actionInfo, function (payload, ecModel) {
- var selected = {};
- ecModel.eachComponent(
- {mainType: 'series', subType: seriesType, query: payload},
- function (seriesModel) {
- if (seriesModel[actionInfo.method]) {
- seriesModel[actionInfo.method](payload.name);
- }
- var data = seriesModel.getData();
- // Create selected map
- data.each(function (idx) {
- var name = data.getName(idx);
- selected[name] = seriesModel.isSelected(name) || false;
- });
- }
- );
- return {
- name: payload.name,
- selected: selected
- };
- });
- });
- };
-
-
-/***/ },
-/* 137 */
-/***/ function(module, exports) {
-
- // Pick color from palette for each data item
-
-
- module.exports = function (seriesType, ecModel) {
- var globalColorList = ecModel.get('color');
- var offset = 0;
- ecModel.eachRawSeriesByType(seriesType, function (seriesModel) {
- var colorList = seriesModel.get('color', true);
- var dataAll = seriesModel.getRawData();
- if (!ecModel.isSeriesFiltered(seriesModel)) {
- var data = seriesModel.getData();
- data.each(function (idx) {
- var itemModel = data.getItemModel(idx);
- var rawIdx = data.getRawIndex(idx);
- // If series.itemStyle.normal.color is a function. itemVisual may be encoded
- var singleDataColor = data.getItemVisual(idx, 'color', true);
- if (!singleDataColor) {
- var paletteColor = colorList ? colorList[rawIdx % colorList.length]
- : globalColorList[(rawIdx + offset) % globalColorList.length];
- var color = itemModel.get('itemStyle.normal.color') || paletteColor;
- // Legend may use the visual info in data before processed
- dataAll.setItemVisual(rawIdx, 'color', color);
- data.setItemVisual(idx, 'color', color);
- }
- else {
- // Set data all color for legend
- dataAll.setItemVisual(rawIdx, 'color', singleDataColor);
- }
- });
- }
- offset += dataAll.count();
- });
- };
-
-
-/***/ },
-/* 138 */
-/***/ function(module, exports, __webpack_require__) {
-
- // TODO minAngle
-
-
-
- var numberUtil = __webpack_require__(7);
- var parsePercent = numberUtil.parsePercent;
- var labelLayout = __webpack_require__(139);
- var zrUtil = __webpack_require__(3);
-
- var PI2 = Math.PI * 2;
- var RADIAN = Math.PI / 180;
-
- module.exports = function (seriesType, ecModel, api) {
- ecModel.eachSeriesByType(seriesType, function (seriesModel) {
- var center = seriesModel.get('center');
- var radius = seriesModel.get('radius');
-
- if (!zrUtil.isArray(radius)) {
- radius = [0, radius];
- }
- if (!zrUtil.isArray(center)) {
- center = [center, center];
- }
-
- var width = api.getWidth();
- var height = api.getHeight();
- var size = Math.min(width, height);
- var cx = parsePercent(center[0], width);
- var cy = parsePercent(center[1], height);
- var r0 = parsePercent(radius[0], size / 2);
- var r = parsePercent(radius[1], size / 2);
-
- var data = seriesModel.getData();
-
- var startAngle = -seriesModel.get('startAngle') * RADIAN;
-
- var minAngle = seriesModel.get('minAngle') * RADIAN;
-
- var sum = data.getSum('value');
- // Sum may be 0
- var unitRadian = Math.PI / (sum || data.count()) * 2;
-
- var clockwise = seriesModel.get('clockwise');
-
- var roseType = seriesModel.get('roseType');
-
- // [0...max]
- var extent = data.getDataExtent('value');
- extent[0] = 0;
-
- // In the case some sector angle is smaller than minAngle
- var restAngle = PI2;
- var valueSumLargerThanMinAngle = 0;
-
- var currentAngle = startAngle;
-
- var dir = clockwise ? 1 : -1;
- data.each('value', function (value, idx) {
- var angle;
- // FIXME 兼容 2.0 但是 roseType 是 area 的时候才是这样?
- if (roseType !== 'area') {
- angle = sum === 0 ? unitRadian : (value * unitRadian);
- }
- else {
- angle = PI2 / (data.count() || 1);
- }
-
- if (angle < minAngle) {
- angle = minAngle;
- restAngle -= minAngle;
- }
- else {
- valueSumLargerThanMinAngle += value;
- }
-
- var endAngle = currentAngle + dir * angle;
- data.setItemLayout(idx, {
- angle: angle,
- startAngle: currentAngle,
- endAngle: endAngle,
- clockwise: clockwise,
- cx: cx,
- cy: cy,
- r0: r0,
- r: roseType
- ? numberUtil.linearMap(value, extent, [r0, r])
- : r
- });
-
- currentAngle = endAngle;
- }, true);
-
- // Some sector is constrained by minAngle
- // Rest sectors needs recalculate angle
- if (restAngle < PI2) {
- // Average the angle if rest angle is not enough after all angles is
- // Constrained by minAngle
- if (restAngle <= 1e-3) {
- var angle = PI2 / data.count();
- data.each(function (idx) {
- var layout = data.getItemLayout(idx);
- layout.startAngle = startAngle + dir * idx * angle;
- layout.endAngle = startAngle + dir * (idx + 1) * angle;
- });
- }
- else {
- unitRadian = restAngle / valueSumLargerThanMinAngle;
- currentAngle = startAngle;
- data.each('value', function (value, idx) {
- var layout = data.getItemLayout(idx);
- var angle = layout.angle === minAngle
- ? minAngle : value * unitRadian;
- layout.startAngle = currentAngle;
- layout.endAngle = currentAngle + dir * angle;
- currentAngle += angle;
- });
- }
- }
-
- labelLayout(seriesModel, r, width, height);
- });
- };
-
-
-/***/ },
-/* 139 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- // FIXME emphasis label position is not same with normal label position
-
-
- var textContain = __webpack_require__(14);
-
- function adjustSingleSide(list, cx, cy, r, dir, viewWidth, viewHeight) {
- list.sort(function (a, b) {
- return a.y - b.y;
- });
-
- // 压
- function shiftDown(start, end, delta, dir) {
- for (var j = start; j < end; j++) {
- list[j].y += delta;
- if (j > start
- && j + 1 < end
- && list[j + 1].y > list[j].y + list[j].height
- ) {
- shiftUp(j, delta / 2);
- return;
- }
- }
-
- shiftUp(end - 1, delta / 2);
- }
-
- // 弹
- function shiftUp(end, delta) {
- for (var j = end; j >= 0; j--) {
- list[j].y -= delta;
- if (j > 0
- && list[j].y > list[j - 1].y + list[j - 1].height
- ) {
- break;
- }
- }
- }
-
- function changeX(list, isDownList, cx, cy, r, dir) {
- var lastDeltaX = dir > 0
- ? isDownList // 右侧
- ? Number.MAX_VALUE // 下
- : 0 // 上
- : isDownList // 左侧
- ? Number.MAX_VALUE // 下
- : 0; // 上
-
- for (var i = 0, l = list.length; i < l; i++) {
- // Not change x for center label
- if (list[i].position === 'center') {
- continue;
- }
- var deltaY = Math.abs(list[i].y - cy);
- var length = list[i].len;
- var length2 = list[i].len2;
- var deltaX = (deltaY < r + length)
- ? Math.sqrt(
- (r + length + length2) * (r + length + length2)
- - deltaY * deltaY
- )
- : Math.abs(list[i].x - cx);
- if (isDownList && deltaX >= lastDeltaX) {
- // 右下,左下
- deltaX = lastDeltaX - 10;
- }
- if (!isDownList && deltaX <= lastDeltaX) {
- // 右上,左上
- deltaX = lastDeltaX + 10;
- }
-
- list[i].x = cx + deltaX * dir;
- lastDeltaX = deltaX;
- }
- }
-
- var lastY = 0;
- var delta;
- var len = list.length;
- var upList = [];
- var downList = [];
- for (var i = 0; i < len; i++) {
- delta = list[i].y - lastY;
- if (delta < 0) {
- shiftDown(i, len, -delta, dir);
- }
- lastY = list[i].y + list[i].height;
- }
- if (viewHeight - lastY < 0) {
- shiftUp(len - 1, lastY - viewHeight);
- }
- for (var i = 0; i < len; i++) {
- if (list[i].y >= cy) {
- downList.push(list[i]);
- }
- else {
- upList.push(list[i]);
- }
- }
- changeX(upList, false, cx, cy, r, dir);
- changeX(downList, true, cx, cy, r, dir);
- }
-
- function avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight) {
- var leftList = [];
- var rightList = [];
- for (var i = 0; i < labelLayoutList.length; i++) {
- if (labelLayoutList[i].x < cx) {
- leftList.push(labelLayoutList[i]);
- }
- else {
- rightList.push(labelLayoutList[i]);
- }
- }
-
- adjustSingleSide(rightList, cx, cy, r, 1, viewWidth, viewHeight);
- adjustSingleSide(leftList, cx, cy, r, -1, viewWidth, viewHeight);
-
- for (var i = 0; i < labelLayoutList.length; i++) {
- var linePoints = labelLayoutList[i].linePoints;
- if (linePoints) {
- var dist = linePoints[1][0] - linePoints[2][0];
- if (labelLayoutList[i].x < cx) {
- linePoints[2][0] = labelLayoutList[i].x + 3;
- }
- else {
- linePoints[2][0] = labelLayoutList[i].x - 3;
- }
- linePoints[1][1] = linePoints[2][1] = labelLayoutList[i].y;
- linePoints[1][0] = linePoints[2][0] + dist;
- }
- }
- }
-
- module.exports = function (seriesModel, r, viewWidth, viewHeight) {
- var data = seriesModel.getData();
- var labelLayoutList = [];
- var cx;
- var cy;
- var hasLabelRotate = false;
-
- data.each(function (idx) {
- var layout = data.getItemLayout(idx);
-
- var itemModel = data.getItemModel(idx);
- var labelModel = itemModel.getModel('label.normal');
- // Use position in normal or emphasis
- var labelPosition = labelModel.get('position') || itemModel.get('label.emphasis.position');
-
- var labelLineModel = itemModel.getModel('labelLine.normal');
- var labelLineLen = labelLineModel.get('length');
- var labelLineLen2 = labelLineModel.get('length2');
-
- var midAngle = (layout.startAngle + layout.endAngle) / 2;
- var dx = Math.cos(midAngle);
- var dy = Math.sin(midAngle);
-
- var textX;
- var textY;
- var linePoints;
- var textAlign;
-
- cx = layout.cx;
- cy = layout.cy;
-
- var isLabelInside = labelPosition === 'inside' || labelPosition === 'inner';
- if (labelPosition === 'center') {
- textX = layout.cx;
- textY = layout.cy;
- textAlign = 'center';
- }
- else {
- var x1 = (isLabelInside ? layout.r / 2 * dx : layout.r * dx) + cx;
- var y1 = (isLabelInside ? layout.r / 2 * dy : layout.r * dy) + cy;
-
- textX = x1 + dx * 3;
- textY = y1 + dy * 3;
-
- if (!isLabelInside) {
- // For roseType
- var x2 = x1 + dx * (labelLineLen + r - layout.r);
- var y2 = y1 + dy * (labelLineLen + r - layout.r);
- var x3 = x2 + ((dx < 0 ? -1 : 1) * labelLineLen2);
- var y3 = y2;
-
- textX = x3 + (dx < 0 ? -5 : 5);
- textY = y3;
- linePoints = [[x1, y1], [x2, y2], [x3, y3]];
- }
-
- textAlign = isLabelInside ? 'center' : (dx > 0 ? 'left' : 'right');
- }
- var font = labelModel.getModel('textStyle').getFont();
-
- var labelRotate = labelModel.get('rotate')
- ? (dx < 0 ? -midAngle + Math.PI : -midAngle) : 0;
- var text = seriesModel.getFormattedLabel(idx, 'normal')
- || data.getName(idx);
- var textRect = textContain.getBoundingRect(
- text, font, textAlign, 'top'
- );
- hasLabelRotate = !!labelRotate;
- layout.label = {
- x: textX,
- y: textY,
- position: labelPosition,
- height: textRect.height,
- len: labelLineLen,
- len2: labelLineLen2,
- linePoints: linePoints,
- textAlign: textAlign,
- verticalAlign: 'middle',
- font: font,
- rotation: labelRotate
- };
-
- // Not layout the inside label
- if (!isLabelInside) {
- labelLayoutList.push(layout.label);
- }
- });
- if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) {
- avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight);
- }
- };
-
-
-/***/ },
-/* 140 */
-/***/ function(module, exports) {
-
-
- module.exports = function (seriesType, ecModel) {
- var legendModels = ecModel.findComponents({
- mainType: 'legend'
- });
- if (!legendModels || !legendModels.length) {
- return;
- }
- ecModel.eachSeriesByType(seriesType, function (series) {
- var data = series.getData();
- data.filterSelf(function (idx) {
- var name = data.getName(idx);
- // If in any legend component the status is not selected.
- for (var i = 0; i < legendModels.length; i++) {
- if (!legendModels[i].isSelected(name)) {
- return false;
- }
- }
- return true;
- }, this);
- }, this);
- };
-
-
-/***/ },
-/* 141 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var echarts = __webpack_require__(1);
-
- __webpack_require__(142);
- __webpack_require__(143);
-
- echarts.registerVisualCoding('chart', zrUtil.curry(
- __webpack_require__(103), 'scatter', 'circle', null
- ));
- echarts.registerLayout(zrUtil.curry(
- __webpack_require__(104), 'scatter'
- ));
-
- // In case developer forget to include grid component
- __webpack_require__(106);
-
-
-/***/ },
-/* 142 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var createListFromArray = __webpack_require__(93);
- var SeriesModel = __webpack_require__(27);
-
- module.exports = SeriesModel.extend({
-
- type: 'series.scatter',
-
- dependencies: ['grid', 'polar'],
-
- getInitialData: function (option, ecModel) {
- var list = createListFromArray(option.data, this, ecModel);
- return list;
- },
-
- defaultOption: {
- coordinateSystem: 'cartesian2d',
- zlevel: 0,
- z: 2,
- legendHoverLink: true,
-
- hoverAnimation: true,
- // Cartesian coordinate system
- xAxisIndex: 0,
- yAxisIndex: 0,
-
- // Polar coordinate system
- polarIndex: 0,
-
- // Geo coordinate system
- geoIndex: 0,
-
- // symbol: null, // 图形类型
- symbolSize: 10, // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2
- // symbolRotate: null, // 图形旋转控制
-
- large: false,
- // Available when large is true
- largeThreshold: 2000,
-
- // label: {
- // normal: {
- // show: false
- // distance: 5,
- // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
- // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
- // 'inside'|'left'|'right'|'top'|'bottom'
- // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
- // }
- // },
- itemStyle: {
- normal: {
- opacity: 0.8
- // color: 各异
- }
- }
- }
- });
-
-
-/***/ },
-/* 143 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var SymbolDraw = __webpack_require__(98);
- var LargeSymbolDraw = __webpack_require__(144);
-
- __webpack_require__(1).extendChartView({
-
- type: 'scatter',
-
- init: function () {
- this._normalSymbolDraw = new SymbolDraw();
- this._largeSymbolDraw = new LargeSymbolDraw();
- },
-
- render: function (seriesModel, ecModel, api) {
- var data = seriesModel.getData();
- var largeSymbolDraw = this._largeSymbolDraw;
- var normalSymbolDraw = this._normalSymbolDraw;
- var group = this.group;
-
- var symbolDraw = seriesModel.get('large') && data.count() > seriesModel.get('largeThreshold')
- ? largeSymbolDraw : normalSymbolDraw;
-
- this._symbolDraw = symbolDraw;
- symbolDraw.updateData(data);
- group.add(symbolDraw.group);
-
- group.remove(
- symbolDraw === largeSymbolDraw
- ? normalSymbolDraw.group : largeSymbolDraw.group
- );
- },
-
- updateLayout: function (seriesModel) {
- this._symbolDraw.updateLayout(seriesModel);
- },
-
- remove: function (ecModel, api) {
- this._symbolDraw && this._symbolDraw.remove(api, true);
- }
- });
-
-
-/***/ },
-/* 144 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var graphic = __webpack_require__(42);
- var symbolUtil = __webpack_require__(100);
- var zrUtil = __webpack_require__(3);
-
- var LargeSymbolPath = graphic.extendShape({
- shape: {
- points: null,
- sizes: null
- },
-
- symbolProxy: null,
-
- buildPath: function (path, shape) {
- var points = shape.points;
- var sizes = shape.sizes;
-
- var symbolProxy = this.symbolProxy;
- var symbolProxyShape = symbolProxy.shape;
- for (var i = 0; i < points.length; i++) {
- var pt = points[i];
- var size = sizes[i];
- if (size[0] < 4) {
- // Optimize for small symbol
- path.rect(
- pt[0] - size[0] / 2, pt[1] - size[1] / 2,
- size[0], size[1]
- );
- }
- else {
- symbolProxyShape.x = pt[0] - size[0] / 2;
- symbolProxyShape.y = pt[1] - size[1] / 2;
- symbolProxyShape.width = size[0];
- symbolProxyShape.height = size[1];
-
- symbolProxy.buildPath(path, symbolProxyShape);
- }
- }
- }
- });
-
- function LargeSymbolDraw() {
- this.group = new graphic.Group();
-
- this._symbolEl = new LargeSymbolPath({
- silent: true
- });
- }
-
- var largeSymbolProto = LargeSymbolDraw.prototype;
-
- /**
- * Update symbols draw by new data
- * @param {module:echarts/data/List} data
- */
- largeSymbolProto.updateData = function (data) {
- this.group.removeAll();
-
- var symbolEl = this._symbolEl;
-
- var seriesModel = data.hostModel;
-
- symbolEl.setShape({
- points: data.mapArray(data.getItemLayout),
- sizes: data.mapArray(
- function (idx) {
- var size = data.getItemVisual(idx, 'symbolSize');
- if (!zrUtil.isArray(size)) {
- size = [size, size];
- }
- return size;
- }
- )
- });
-
- // Create symbolProxy to build path for each data
- symbolEl.symbolProxy = symbolUtil.createSymbol(
- data.getVisual('symbol'), 0, 0, 0, 0
- );
- // Use symbolProxy setColor method
- symbolEl.setColor = symbolEl.symbolProxy.setColor;
-
- symbolEl.setStyle(
- seriesModel.getModel('itemStyle.normal').getItemStyle(['color'])
- );
-
- var visualColor = data.getVisual('color');
- if (visualColor) {
- symbolEl.setColor(visualColor);
- }
-
- // Add back
- this.group.add(this._symbolEl);
- };
-
- largeSymbolProto.updateLayout = function (seriesModel) {
- var data = seriesModel.getData();
- this._symbolEl.setShape({
- points: data.mapArray(data.getItemLayout)
- });
- };
-
- largeSymbolProto.remove = function () {
- this.group.removeAll();
- };
-
- module.exports = LargeSymbolDraw;
-
-
-/***/ },
-/* 145 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var echarts = __webpack_require__(1);
-
- // Must use radar component
- __webpack_require__(146);
-
- __webpack_require__(151);
- __webpack_require__(152);
-
- echarts.registerVisualCoding(
- 'chart', zrUtil.curry(__webpack_require__(137), 'radar')
- );
- echarts.registerVisualCoding('chart', zrUtil.curry(
- __webpack_require__(103), 'radar', 'circle', null
- ));
- echarts.registerLayout(__webpack_require__(153));
-
- echarts.registerProcessor(
- 'filter', zrUtil.curry(__webpack_require__(140), 'radar')
- );
-
- echarts.registerPreprocessor(__webpack_require__(154));
-
-
-/***/ },
-/* 146 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- __webpack_require__(147);
- __webpack_require__(149);
-
- __webpack_require__(150);
-
-
-/***/ },
-/* 147 */
-/***/ function(module, exports, __webpack_require__) {
-
- // TODO clockwise
-
-
- var zrUtil = __webpack_require__(3);
- var IndicatorAxis = __webpack_require__(148);
- var IntervalScale = __webpack_require__(111);
- var numberUtil = __webpack_require__(7);
- var axisHelper = __webpack_require__(108);
-
- function Radar(radarModel, ecModel, api) {
-
- this._model = radarModel;
- /**
- * Radar dimensions
- * @type {Array.<string>}
- */
- this.dimensions = [];
-
- this._indicatorAxes = zrUtil.map(radarModel.getIndicatorModels(), function (indicatorModel, idx) {
- var dim = 'indicator_' + idx;
- var indicatorAxis = new IndicatorAxis(dim, new IntervalScale());
- indicatorAxis.name = indicatorModel.get('name');
- // Inject model and axis
- indicatorAxis.model = indicatorModel;
- indicatorModel.axis = indicatorAxis;
- this.dimensions.push(dim);
- return indicatorAxis;
- }, this);
-
- this.resize(radarModel, api);
-
- /**
- * @type {number}
- * @readOnly
- */
- this.cx;
- /**
- * @type {number}
- * @readOnly
- */
- this.cy;
- /**
- * @type {number}
- * @readOnly
- */
- this.r;
- /**
- * @type {number}
- * @readOnly
- */
- this.startAngle;
- }
-
- Radar.prototype.getIndicatorAxes = function () {
- return this._indicatorAxes;
- };
-
- Radar.prototype.dataToPoint = function (value, indicatorIndex) {
- var indicatorAxis = this._indicatorAxes[indicatorIndex];
-
- return this.coordToPoint(indicatorAxis.dataToCoord(value), indicatorIndex);
- };
-
- Radar.prototype.coordToPoint = function (coord, indicatorIndex) {
- var indicatorAxis = this._indicatorAxes[indicatorIndex];
- var angle = indicatorAxis.angle;
- var x = this.cx + coord * Math.cos(angle);
- var y = this.cy - coord * Math.sin(angle);
- return [x, y];
- };
-
- Radar.prototype.pointToData = function (pt) {
- var dx = pt[0] - this.cx;
- var dy = pt[1] - this.cy;
- var radius = Math.sqrt(dx * dx + dy * dy);
- dx /= radius;
- dy /= radius;
-
- var radian = Math.atan2(-dy, dx);
-
- // Find the closest angle
- // FIXME index can calculated directly
- var minRadianDiff = Infinity;
- var closestAxis;
- var closestAxisIdx = -1;
- for (var i = 0; i < this._indicatorAxes.length; i++) {
- var indicatorAxis = this._indicatorAxes[i];
- var diff = Math.abs(radian - indicatorAxis.angle);
- if (diff < minRadianDiff) {
- closestAxis = indicatorAxis;
- closestAxisIdx = i;
- minRadianDiff = diff;
- }
- }
-
- return [closestAxisIdx, +(closestAxis && closestAxis.coodToData(radius))];
- };
-
- Radar.prototype.resize = function (radarModel, api) {
- var center = radarModel.get('center');
- var viewWidth = api.getWidth();
- var viewHeight = api.getHeight();
- var viewSize = Math.min(viewWidth, viewHeight) / 2;
- this.cx = numberUtil.parsePercent(center[0], viewWidth);
- this.cy = numberUtil.parsePercent(center[1], viewHeight);
-
- this.startAngle = radarModel.get('startAngle') * Math.PI / 180;
-
- this.r = numberUtil.parsePercent(radarModel.get('radius'), viewSize);
-
- zrUtil.each(this._indicatorAxes, function (indicatorAxis, idx) {
- indicatorAxis.setExtent(0, this.r);
- var angle = (this.startAngle + idx * Math.PI * 2 / this._indicatorAxes.length);
- // Normalize to [-PI, PI]
- angle = Math.atan2(Math.sin(angle), Math.cos(angle));
- indicatorAxis.angle = angle;
- }, this);
- };
-
- Radar.prototype.update = function (ecModel, api) {
- var indicatorAxes = this._indicatorAxes;
- var radarModel = this._model;
- zrUtil.each(indicatorAxes, function (indicatorAxis) {
- indicatorAxis.scale.setExtent(Infinity, -Infinity);
- });
- ecModel.eachSeriesByType('radar', function (radarSeries, idx) {
- if (radarSeries.get('coordinateSystem') !== 'radar'
- || ecModel.getComponent('radar', radarSeries.get('radarIndex')) !== radarModel
- ) {
- return;
- }
- var data = radarSeries.getData();
- zrUtil.each(indicatorAxes, function (indicatorAxis) {
- indicatorAxis.scale.unionExtent(data.getDataExtent(indicatorAxis.dim));
- });
- }, this);
-
- var splitNumber = radarModel.get('splitNumber');
-
- function increaseInterval(interval) {
- var exp10 = Math.pow(10, Math.floor(Math.log(interval) / Math.LN10));
- // Increase interval
- var f = interval / exp10;
- if (f === 2) {
- f = 5;
- }
- else { // f is 2 or 5
- f *= 2;
- }
- return f * exp10;
- }
- // Force all the axis fixing the maxSplitNumber.
- zrUtil.each(indicatorAxes, function (indicatorAxis, idx) {
- var rawExtent = axisHelper.getScaleExtent(indicatorAxis, indicatorAxis.model);
- axisHelper.niceScaleExtent(indicatorAxis, indicatorAxis.model);
-
- var axisModel = indicatorAxis.model;
- var scale = indicatorAxis.scale;
- var fixedMin = axisModel.get('min');
- var fixedMax = axisModel.get('max');
- var interval = scale.getInterval();
-
- if (fixedMin != null && fixedMax != null) {
- // User set min, max, divide to get new interval
- // FIXME precision
- scale.setInterval(
- (fixedMax - fixedMin) / splitNumber
- );
- }
- else if (fixedMin != null) {
- var max;
- // User set min, expand extent on the other side
- do {
- max = fixedMin + interval * splitNumber;
- scale.setExtent(+fixedMin, max);
- // Interval must been set after extent
- // FIXME
- scale.setInterval(interval);
-
- interval = increaseInterval(interval);
- } while (max < rawExtent[1] && isFinite(max) && isFinite(rawExtent[1]));
- }
- else if (fixedMax != null) {
- var min;
- // User set min, expand extent on the other side
- do {
- min = fixedMax - interval * splitNumber;
- scale.setExtent(min, +fixedMax);
- scale.setInterval(interval);
- interval = increaseInterval(interval);
- } while (min > rawExtent[0] && isFinite(min) && isFinite(rawExtent[0]));
- }
- else {
- var nicedSplitNumber = scale.getTicks().length - 1;
- if (nicedSplitNumber > splitNumber) {
- interval = increaseInterval(interval);
- }
- // PENDING
- var center = Math.round((rawExtent[0] + rawExtent[1]) / 2 / interval) * interval;
- var halfSplitNumber = Math.round(splitNumber / 2);
- scale.setExtent(
- numberUtil.round(center - halfSplitNumber * interval),
- numberUtil.round(center + (splitNumber - halfSplitNumber) * interval)
- );
- scale.setInterval(interval);
- }
- });
- };
-
- /**
- * Radar dimensions is based on the data
- * @type {Array}
- */
- Radar.dimensions = [];
-
- Radar.create = function (ecModel, api) {
- var radarList = [];
- ecModel.eachComponent('radar', function (radarModel) {
- var radar = new Radar(radarModel, ecModel, api);
- radarList.push(radar);
- radarModel.coordinateSystem = radar;
- });
- ecModel.eachSeriesByType('radar', function (radarSeries) {
- if (radarSeries.get('coordinateSystem') === 'radar') {
- // Inject coordinate system
- radarSeries.coordinateSystem = radarList[radarSeries.get('radarIndex') || 0];
- }
- });
- return radarList;
- };
-
- __webpack_require__(25).register('radar', Radar);
- module.exports = Radar;
-
-
-/***/ },
-/* 148 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var Axis = __webpack_require__(117);
-
- function IndicatorAxis(dim, scale, radiusExtent) {
- Axis.call(this, dim, scale, radiusExtent);
-
- /**
- * Axis type
- * - 'category'
- * - 'value'
- * - 'time'
- * - 'log'
- * @type {string}
- */
- this.type = 'value';
-
- this.angle = 0;
-
- /**
- * Indicator name
- * @type {string}
- */
- this.name = '';
- /**
- * @type {module:echarts/model/Model}
- */
- this.model;
- }
-
- zrUtil.inherits(IndicatorAxis, Axis);
-
- module.exports = IndicatorAxis;
-
-
-/***/ },
-/* 149 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
-
- var axisDefault = __webpack_require__(122);
- var valueAxisDefault = axisDefault.valueAxis;
- var Model = __webpack_require__(8);
- var zrUtil = __webpack_require__(3);
-
- var axisModelCommonMixin = __webpack_require__(123);
-
- function defaultsShow(opt, show) {
- return zrUtil.defaults({
- show: show
- }, opt);
- }
-
- var RadarModel = __webpack_require__(1).extendComponentModel({
-
- type: 'radar',
-
- optionUpdated: function () {
- var boundaryGap = this.get('boundaryGap');
- var splitNumber = this.get('splitNumber');
- var scale = this.get('scale');
- var axisLine = this.get('axisLine');
- var axisTick = this.get('axisTick');
- var axisLabel = this.get('axisLabel');
- var nameTextStyle = this.get('name.textStyle');
- var showName = this.get('name.show');
- var nameFormatter = this.get('name.formatter');
- var nameGap = this.get('nameGap');
- var indicatorModels = zrUtil.map(this.get('indicator') || [], function (indicatorOpt) {
- // PENDING
- if (indicatorOpt.max != null && indicatorOpt.max > 0) {
- indicatorOpt.min = 0;
- }
- else if (indicatorOpt.min != null && indicatorOpt.min < 0) {
- indicatorOpt.max = 0;
- }
- // Use same configuration
- indicatorOpt = zrUtil.merge(zrUtil.clone(indicatorOpt), {
- boundaryGap: boundaryGap,
- splitNumber: splitNumber,
- scale: scale,
- axisLine: axisLine,
- axisTick: axisTick,
- axisLabel: axisLabel,
- // Competitable with 2 and use text
- name: indicatorOpt.text,
- nameLocation: 'end',
- nameGap: nameGap,
- // min: 0,
- nameTextStyle: nameTextStyle
- }, false);
- if (!showName) {
- indicatorOpt.name = '';
- }
- if (typeof nameFormatter === 'string') {
- indicatorOpt.name = nameFormatter.replace('{value}', indicatorOpt.name);
- }
- else if (typeof nameFormatter === 'function') {
- indicatorOpt.name = nameFormatter(
- indicatorOpt.name, indicatorOpt
- );
- }
- return zrUtil.extend(
- new Model(indicatorOpt, null, this.ecModel),
- axisModelCommonMixin
- );
- }, this);
- this.getIndicatorModels = function () {
- return indicatorModels;
- };
- },
-
- defaultOption: {
-
- zlevel: 0,
-
- z: 0,
-
- center: ['50%', '50%'],
-
- radius: '75%',
-
- startAngle: 90,
-
- name: {
- show: true
- // formatter: null
- // textStyle: {}
- },
-
- boundaryGap: [0, 0],
-
- splitNumber: 5,
-
- nameGap: 15,
-
- scale: false,
-
- // Polygon or circle
- shape: 'polygon',
-
- axisLine: zrUtil.merge(
- {
- lineStyle: {
- color: '#bbb'
- }
- },
- valueAxisDefault.axisLine
- ),
- axisLabel: defaultsShow(valueAxisDefault.axisLabel, false),
- axisTick: defaultsShow(valueAxisDefault.axisTick, false),
- splitLine: defaultsShow(valueAxisDefault.splitLine, true),
- splitArea: defaultsShow(valueAxisDefault.splitArea, true),
-
- // {text, min, max}
- indicator: []
- }
- });
-
- module.exports = RadarModel;
-
-
-/***/ },
-/* 150 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var AxisBuilder = __webpack_require__(126);
- var zrUtil = __webpack_require__(3);
- var graphic = __webpack_require__(42);
-
- var axisBuilderAttrs = [
- 'axisLine', 'axisLabel', 'axisTick', 'axisName'
- ];
-
- module.exports = __webpack_require__(1).extendComponentView({
-
- type: 'radar',
-
- render: function (radarModel, ecModel, api) {
- var group = this.group;
- group.removeAll();
-
- this._buildAxes(radarModel);
- this._buildSplitLineAndArea(radarModel);
- },
-
- _buildAxes: function (radarModel) {
- var radar = radarModel.coordinateSystem;
- var indicatorAxes = radar.getIndicatorAxes();
- var axisBuilders = zrUtil.map(indicatorAxes, function (indicatorAxis) {
- var axisBuilder = new AxisBuilder(indicatorAxis.model, {
- position: [radar.cx, radar.cy],
- rotation: indicatorAxis.angle,
- labelDirection: -1,
- tickDirection: -1,
- nameDirection: 1
- });
- return axisBuilder;
- });
-
- zrUtil.each(axisBuilders, function (axisBuilder) {
- zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);
- this.group.add(axisBuilder.getGroup());
- }, this);
- },
-
- _buildSplitLineAndArea: function (radarModel) {
- var radar = radarModel.coordinateSystem;
- var splitNumber = radarModel.get('splitNumber');
- var indicatorAxes = radar.getIndicatorAxes();
- if (!indicatorAxes.length) {
- return;
- }
- var shape = radarModel.get('shape');
- var splitLineModel = radarModel.getModel('splitLine');
- var splitAreaModel = radarModel.getModel('splitArea');
- var lineStyleModel = splitLineModel.getModel('lineStyle');
- var areaStyleModel = splitAreaModel.getModel('areaStyle');
-
- var showSplitLine = splitLineModel.get('show');
- var showSplitArea = splitAreaModel.get('show');
- var splitLineColors = lineStyleModel.get('color');
- var splitAreaColors = areaStyleModel.get('color');
-
- splitLineColors = zrUtil.isArray(splitLineColors) ? splitLineColors : [splitLineColors];
- splitAreaColors = zrUtil.isArray(splitAreaColors) ? splitAreaColors : [splitAreaColors];
-
- var splitLines = [];
- var splitAreas = [];
-
- function getColorIndex(areaOrLine, areaOrLineColorList, idx) {
- var colorIndex = idx % areaOrLineColorList.length;
- areaOrLine[colorIndex] = areaOrLine[colorIndex] || [];
- return colorIndex;
- }
-
- if (shape === 'circle') {
- var ticksRadius = indicatorAxes[0].getTicksCoords();
- var cx = radar.cx;
- var cy = radar.cy;
- for (var i = 0; i < ticksRadius.length; i++) {
- if (showSplitLine) {
- var colorIndex = getColorIndex(splitLines, splitLineColors, i);
- splitLines[colorIndex].push(new graphic.Circle({
- shape: {
- cx: cx,
- cy: cy,
- r: ticksRadius[i]
- }
- }));
- }
- if (showSplitArea && i < ticksRadius.length - 1) {
- var colorIndex = getColorIndex(splitAreas, splitAreaColors, i);
- splitAreas[colorIndex].push(new graphic.Ring({
- shape: {
- cx: cx,
- cy: cy,
- r0: ticksRadius[i],
- r: ticksRadius[i + 1]
- }
- }));
- }
- }
- }
- // Polyyon
- else {
- var axesTicksPoints = zrUtil.map(indicatorAxes, function (indicatorAxis, idx) {
- var ticksCoords = indicatorAxis.getTicksCoords();
- return zrUtil.map(ticksCoords, function (tickCoord) {
- return radar.coordToPoint(tickCoord, idx);
- });
- });
-
- var prevPoints = [];
- for (var i = 0; i <= splitNumber; i++) {
- var points = [];
- for (var j = 0; j < indicatorAxes.length; j++) {
- points.push(axesTicksPoints[j][i]);
- }
- // Close
- points.push(points[0].slice());
- if (showSplitLine) {
- var colorIndex = getColorIndex(splitLines, splitLineColors, i);
- splitLines[colorIndex].push(new graphic.Polyline({
- shape: {
- points: points
- }
- }));
- }
- if (showSplitArea && prevPoints) {
- var colorIndex = getColorIndex(splitAreas, splitAreaColors, i - 1);
- splitAreas[colorIndex].push(new graphic.Polygon({
- shape: {
- points: points.concat(prevPoints)
- }
- }));
- }
- prevPoints = points.slice().reverse();
- }
- }
-
- var lineStyle = lineStyleModel.getLineStyle();
- var areaStyle = areaStyleModel.getAreaStyle();
- // Add splitArea before splitLine
- zrUtil.each(splitAreas, function (splitAreas, idx) {
- this.group.add(graphic.mergePath(
- splitAreas, {
- style: zrUtil.defaults({
- stroke: 'none',
- fill: splitAreaColors[idx % splitAreaColors.length]
- }, areaStyle),
- silent: true
- }
- ));
- }, this);
-
- zrUtil.each(splitLines, function (splitLines, idx) {
- this.group.add(graphic.mergePath(
- splitLines, {
- style: zrUtil.defaults({
- fill: 'none',
- stroke: splitLineColors[idx % splitLineColors.length]
- }, lineStyle),
- silent: true
- }
- ));
- }, this);
-
- }
- });
-
-
-/***/ },
-/* 151 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var SeriesModel = __webpack_require__(27);
- var List = __webpack_require__(94);
- var completeDimensions = __webpack_require__(96);
- var zrUtil = __webpack_require__(3);
- var formatUtil = __webpack_require__(6);
-
- var RadarSeries = SeriesModel.extend({
-
- type: 'series.radar',
-
- dependencies: ['radar'],
-
-
- // Overwrite
- init: function (option) {
- RadarSeries.superApply(this, 'init', arguments);
-
- // Enable legend selection for each data item
- // Use a function instead of direct access because data reference may changed
- this.legendDataProvider = function () {
- return this._dataBeforeProcessed;
- };
- },
-
- getInitialData: function (option, ecModel) {
- var data = option.data || [];
- var dimensions = completeDimensions(
- [], data, [], 'indicator_'
- );
- var list = new List(dimensions, this);
- list.initData(data);
- return list;
- },
-
- formatTooltip: function (dataIndex) {
- var value = this.getRawValue(dataIndex);
- var coordSys = this.coordinateSystem;
- var indicatorAxes = coordSys.getIndicatorAxes();
- return this._data.getName(dataIndex) + '<br />'
- + zrUtil.map(indicatorAxes, function (axis, idx) {
- return axis.name + ' : ' + value[idx];
- }).join('<br />');
- },
-
- getFormattedLabel: function (dataIndex, status, formatter, indicatorIndex) {
- status = status || 'normal';
- var data = this.getData();
- var itemModel = data.getItemModel(dataIndex);
-
- var params = this.getDataParams(dataIndex);
- if (formatter == null) {
- formatter = itemModel.get(['label', status, 'formatter']);
- }
- // Get value of specified indicator
- params.value = params.value[indicatorIndex || 0];
- if (typeof formatter === 'function') {
- params.status = status;
- return formatter(params);
- }
- else if (typeof formatter === 'string') {
- return formatUtil.formatTpl(formatter, params);
- }
- },
-
- defaultOption: {
- zlevel: 0,
- z: 2,
- coordinateSystem: 'radar',
- legendHoverLink: true,
- radarIndex: 0,
- lineStyle: {
- normal: {
- width: 2,
- type: 'solid'
- }
- },
- label: {
- normal: {
- position: 'top'
- }
- },
- // areaStyle: {
- // },
- // itemStyle: {}
- symbol: 'emptyCircle',
- symbolSize: 4
- // symbolRotate: null
- }
- });
-
- module.exports = RadarSeries;
-
-
-/***/ },
-/* 152 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var graphic = __webpack_require__(42);
- var zrUtil = __webpack_require__(3);
- var symbolUtil = __webpack_require__(100);
-
- function normalizeSymbolSize(symbolSize) {
- if (!zrUtil.isArray(symbolSize)) {
- symbolSize = [+symbolSize, +symbolSize];
- }
- return symbolSize;
- }
- module.exports = __webpack_require__(1).extendChartView({
- type: 'radar',
-
- render: function (seriesModel, ecModel, api) {
- var polar = seriesModel.coordinateSystem;
- var group = this.group;
-
- var data = seriesModel.getData();
- var oldData = this._data;
-
- function createSymbol(data, idx) {
- var symbolType = data.getItemVisual(idx, 'symbol') || 'circle';
- var color = data.getItemVisual(idx, 'color');
- if (symbolType === 'none') {
- return;
- }
- var symbolPath = symbolUtil.createSymbol(
- symbolType, -0.5, -0.5, 1, 1, color
- );
- symbolPath.attr({
- style: {
- strokeNoScale: true
- },
- z2: 100,
- scale: normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'))
- });
- return symbolPath;
- }
-
- function updateSymbols(oldPoints, newPoints, symbolGroup, data, idx, isInit) {
- // Simply rerender all
- symbolGroup.removeAll();
- for (var i = 0; i < newPoints.length - 1; i++) {
- var symbolPath = createSymbol(data, idx);
- if (symbolPath) {
- symbolPath.__dimIdx = i;
- if (oldPoints[i]) {
- symbolPath.attr('position', oldPoints[i]);
- graphic[isInit ? 'initProps' : 'updateProps'](
- symbolPath, {
- position: newPoints[i]
- }, seriesModel
- );
- }
- else {
- symbolPath.attr('position', newPoints[i]);
- }
- symbolGroup.add(symbolPath);
- }
- }
- }
-
- function getInitialPoints(points) {
- return zrUtil.map(points, function (pt) {
- return [polar.cx, polar.cy];
- });
- }
- data.diff(oldData)
- .add(function (idx) {
- var points = data.getItemLayout(idx);
- if (!points) {
- return;
- }
- var polygon = new graphic.Polygon();
- var polyline = new graphic.Polyline();
- var target = {
- shape: {
- points: points
- }
- };
- polygon.shape.points = getInitialPoints(points);
- polyline.shape.points = getInitialPoints(points);
- graphic.initProps(polygon, target, seriesModel);
- graphic.initProps(polyline, target, seriesModel);
-
- var itemGroup = new graphic.Group();
- var symbolGroup = new graphic.Group();
- itemGroup.add(polyline);
- itemGroup.add(polygon);
- itemGroup.add(symbolGroup);
-
- updateSymbols(
- polyline.shape.points, points, symbolGroup, data, idx, true
- );
-
- data.setItemGraphicEl(idx, itemGroup);
- })
- .update(function (newIdx, oldIdx) {
- var itemGroup = oldData.getItemGraphicEl(oldIdx);
- var polyline = itemGroup.childAt(0);
- var polygon = itemGroup.childAt(1);
- var symbolGroup = itemGroup.childAt(2);
- var target = {
- shape: {
- points: data.getItemLayout(newIdx)
- }
- };
- if (!target.shape.points) {
- return;
- }
- updateSymbols(
- polyline.shape.points, target.shape.points, symbolGroup, data, newIdx, false
- );
-
- graphic.updateProps(polyline, target, seriesModel);
- graphic.updateProps(polygon, target, seriesModel);
-
- data.setItemGraphicEl(newIdx, itemGroup);
- })
- .remove(function (idx) {
- group.remove(oldData.getItemGraphicEl(idx));
- })
- .execute();
-
- data.eachItemGraphicEl(function (itemGroup, idx) {
- var itemModel = data.getItemModel(idx);
- var polyline = itemGroup.childAt(0);
- var polygon = itemGroup.childAt(1);
- var symbolGroup = itemGroup.childAt(2);
- var color = data.getItemVisual(idx, 'color');
-
- group.add(itemGroup);
-
- polyline.setStyle(
- zrUtil.extend(
- itemModel.getModel('lineStyle.normal').getLineStyle(),
- {
- stroke: color
- }
- )
- );
- polyline.hoverStyle = itemModel.getModel('lineStyle.emphasis').getLineStyle();
-
- var areaStyleModel = itemModel.getModel('areaStyle.normal');
- var hoverAreaStyleModel = itemModel.getModel('areaStyle.emphasis');
- var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty();
- var hoverPolygonIgnore = hoverAreaStyleModel.isEmpty() && hoverAreaStyleModel.parentModel.isEmpty();
-
- hoverPolygonIgnore = hoverPolygonIgnore && polygonIgnore;
- polygon.ignore = polygonIgnore;
-
- polygon.setStyle(
- zrUtil.defaults(
- areaStyleModel.getAreaStyle(),
- {
- fill: color,
- opacity: 0.7
- }
- )
- );
- polygon.hoverStyle = hoverAreaStyleModel.getAreaStyle();
-
- var itemStyle = itemModel.getModel('itemStyle.normal').getItemStyle(['color']);
- var itemHoverStyle = itemModel.getModel('itemStyle.emphasis').getItemStyle();
- var labelModel = itemModel.getModel('label.normal');
- var labelHoverModel = itemModel.getModel('label.emphasis');
- symbolGroup.eachChild(function (symbolPath) {
- symbolPath.setStyle(itemStyle);
- symbolPath.hoverStyle = zrUtil.clone(itemHoverStyle);
-
- var defaultText = data.get(data.dimensions[symbolPath.__dimIdx], idx);
- graphic.setText(symbolPath.style, labelModel, color);
- symbolPath.setStyle({
- text: labelModel.get('show') ? zrUtil.retrieve(
- seriesModel.getFormattedLabel(
- idx, 'normal', null, symbolPath.__dimIdx
- ),
- defaultText
- ) : ''
- });
-
- graphic.setText(symbolPath.hoverStyle, labelHoverModel, color);
- symbolPath.hoverStyle.text = labelHoverModel.get('show') ? zrUtil.retrieve(
- seriesModel.getFormattedLabel(
- idx, 'emphasis', null, symbolPath.__dimIdx
- ),
- defaultText
- ) : '';
- });
-
- function onEmphasis() {
- polygon.attr('ignore', hoverPolygonIgnore);
- }
-
- function onNormal() {
- polygon.attr('ignore', polygonIgnore);
- }
-
- itemGroup.off('mouseover').off('mouseout').off('normal').off('emphasis');
- itemGroup.on('emphasis', onEmphasis)
- .on('mouseover', onEmphasis)
- .on('normal', onNormal)
- .on('mouseout', onNormal);
-
- graphic.setHoverStyle(itemGroup);
- });
-
- this._data = data;
- },
-
- remove: function () {
- this.group.removeAll();
- this._data = null;
- }
- });
-
-
-/***/ },
-/* 153 */
-/***/ function(module, exports) {
-
-
-
- module.exports = function (ecModel, api) {
- ecModel.eachSeriesByType('radar', function (seriesModel) {
- var data = seriesModel.getData();
- var points = [];
- var coordSys = seriesModel.coordinateSystem;
- if (!coordSys) {
- return;
- }
-
- function pointsConverter(val, idx) {
- points[idx] = points[idx] || [];
- points[idx][i] = coordSys.dataToPoint(val, i);
- }
- for (var i = 0; i < coordSys.getIndicatorAxes().length; i++) {
- var dim = data.dimensions[i];
- data.each(dim, pointsConverter);
- }
-
- data.each(function (idx) {
- // Close polygon
- points[idx][0] && points[idx].push(points[idx][0].slice());
- data.setItemLayout(idx, points[idx]);
- });
- });
- };
-
-
-/***/ },
-/* 154 */
-/***/ function(module, exports, __webpack_require__) {
-
- // Backward compat for radar chart in 2
-
-
- var zrUtil = __webpack_require__(3);
-
- module.exports = function (option) {
- var polarOptArr = option.polar;
- if (polarOptArr) {
- if (!zrUtil.isArray(polarOptArr)) {
- polarOptArr = [polarOptArr];
- }
- var polarNotRadar = [];
- zrUtil.each(polarOptArr, function (polarOpt, idx) {
- if (polarOpt.indicator) {
- if (polarOpt.type && !polarOpt.shape) {
- polarOpt.shape = polarOpt.type;
- }
- option.radar = option.radar || [];
- if (!zrUtil.isArray(option.radar)) {
- option.radar = [option.radar];
- }
- option.radar.push(polarOpt);
- }
- else {
- polarNotRadar.push(polarOpt);
- }
- });
- option.polar = polarNotRadar;
- }
- zrUtil.each(option.series, function (seriesOpt) {
- if (seriesOpt.type === 'radar' && seriesOpt.polarIndex) {
- seriesOpt.radarIndex = seriesOpt.polarIndex;
- }
- });
- };
-
-
-/***/ },
-/* 155 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var echarts = __webpack_require__(1);
-
- __webpack_require__(156);
-
- __webpack_require__(157);
-
- __webpack_require__(161);
-
- __webpack_require__(163);
-
- echarts.registerLayout(__webpack_require__(173));
-
- echarts.registerVisualCoding('chart', __webpack_require__(174));
-
- echarts.registerProcessor('statistic', __webpack_require__(175));
-
- echarts.registerPreprocessor(__webpack_require__(176));
-
- __webpack_require__(136)('map', [{
- type: 'mapToggleSelect',
- event: 'mapselectchanged',
- method: 'toggleSelected'
- }, {
- type: 'mapSelect',
- event: 'mapselected',
- method: 'select'
- }, {
- type: 'mapUnSelect',
- event: 'mapunselected',
- method: 'unSelect'
- }]);
-
-
-/***/ },
-/* 156 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var List = __webpack_require__(94);
- var echarts = __webpack_require__(1);
- var SeriesModel = __webpack_require__(27);
- var zrUtil = __webpack_require__(3);
- var completeDimensions = __webpack_require__(96);
-
- var formatUtil = __webpack_require__(6);
- var encodeHTML = formatUtil.encodeHTML;
- var addCommas = formatUtil.addCommas;
-
- var dataSelectableMixin = __webpack_require__(134);
-
- function fillData(dataOpt, geoJson) {
- var dataNameMap = {};
- var features = geoJson.features;
- for (var i = 0; i < dataOpt.length; i++) {
- dataNameMap[dataOpt[i].name] = dataOpt[i];
- }
-
- for (var i = 0; i < features.length; i++) {
- var name = features[i].properties.name;
- if (!dataNameMap[name]) {
- dataOpt.push({
- value: NaN,
- name: name
- });
- }
- }
- return dataOpt;
- }
-
- var MapSeries = SeriesModel.extend({
-
- type: 'series.map',
-
- /**
- * Only first map series of same mapType will drawMap
- * @type {boolean}
- */
- needsDrawMap: false,
-
- /**
- * Group of all map series with same mapType
- * @type {boolean}
- */
- seriesGroup: [],
-
- init: function (option) {
-
- option = this._fillOption(option);
- this.option = option;
-
- MapSeries.superApply(this, 'init', arguments);
-
- this.updateSelectedMap();
- },
-
- getInitialData: function (option) {
- var dimensions = completeDimensions(['value'], option.data || []);
-
- var list = new List(dimensions, this);
-
- list.initData(option.data);
-
- return list;
- },
-
- mergeOption: function (newOption) {
- newOption = this._fillOption(newOption);
-
- MapSeries.superCall(this, 'mergeOption', newOption);
-
- this.updateSelectedMap();
- },
-
- _fillOption: function (option) {
- // Shallow clone
- option = zrUtil.extend({}, option);
-
- var map = echarts.getMap(option.mapType);
- var geoJson = map && map.geoJson;
- geoJson && option.data
- && (option.data = fillData(option.data, geoJson));
-
- return option;
- },
-
- /**
- * @param {number} zoom
- */
- setRoamZoom: function (zoom) {
- var roamDetail = this.option.roamDetail;
- roamDetail && (roamDetail.zoom = zoom);
- },
-
- /**
- * @param {number} x
- * @param {number} y
- */
- setRoamPan: function (x, y) {
- var roamDetail = this.option.roamDetail;
- if (roamDetail) {
- roamDetail.x = x;
- roamDetail.y = y;
- }
- },
-
- getRawValue: function (dataIndex) {
- // Use value stored in data instead because it is calculated from multiple series
- // FIXME Provide all value of multiple series ?
- return this._data.get('value', dataIndex);
- },
-
- /**
- * Map tooltip formatter
- *
- * @param {number} dataIndex
- */
- formatTooltip: function (dataIndex) {
- var data = this._data;
- var formattedValue = addCommas(this.getRawValue(dataIndex));
- var name = data.getName(dataIndex);
-
- var seriesGroup = this.seriesGroup;
- var seriesNames = [];
- for (var i = 0; i < seriesGroup.length; i++) {
- if (!isNaN(seriesGroup[i].getRawValue(dataIndex))) {
- seriesNames.push(
- encodeHTML(seriesGroup[i].name)
- );
- }
- }
-
- return seriesNames.join(', ') + '<br />'
- + name + ' : ' + formattedValue;
- },
-
- defaultOption: {
- // 一级层叠
- zlevel: 0,
- // 二级层叠
- z: 2,
- coordinateSystem: 'geo',
- // 各省的 map 暂时都用中文
- map: 'china',
-
- // 'center' | 'left' | 'right' | 'x%' | {number}
- left: 'center',
- // 'center' | 'top' | 'bottom' | 'x%' | {number}
- top: 'center',
- // right
- // bottom
- // width:
- // height // 自适应
-
- // 数值合并方式,默认加和,可选为:
- // 'sum' | 'average' | 'max' | 'min'
- // mapValueCalculation: 'sum',
- // 地图数值计算结果小数精度
- // mapValuePrecision: 0,
- // 显示图例颜色标识(系列标识的小圆点),图例开启时有效
- showLegendSymbol: true,
- // 选择模式,默认关闭,可选single,multiple
- // selectedMode: false,
- dataRangeHoverLink: true,
- // 是否开启缩放及漫游模式
- // roam: false,
-
- // 在 roam 开启的时候使用
- roamDetail: {
- x: 0,
- y: 0,
- zoom: 1
- },
-
- scaleLimit: null,
-
- label: {
- normal: {
- show: false,
- textStyle: {
- color: '#000'
- }
- },
- emphasis: {
- show: false,
- textStyle: {
- color: '#000'
- }
- }
- },
- // scaleLimit: null,
- itemStyle: {
- normal: {
- // color: 各异,
- borderWidth: 0.5,
- borderColor: '#444',
- areaColor: '#eee'
- },
- // 也是选中样式
- emphasis: {
- areaColor: 'rgba(255,215, 0, 0.8)'
- }
- }
- }
- });
-
- zrUtil.mixin(MapSeries, dataSelectableMixin);
-
- module.exports = MapSeries;
-
-
-/***/ },
-/* 157 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- // var zrUtil = require('zrender/lib/core/util');
- var graphic = __webpack_require__(42);
-
- var MapDraw = __webpack_require__(158);
-
- __webpack_require__(1).extendChartView({
-
- type: 'map',
-
- render: function (mapModel, ecModel, api, payload) {
- // Not render if it is an toggleSelect action from self
- if (payload && payload.type === 'mapToggleSelect'
- && payload.from === this.uid
- ) {
- return;
- }
-
- var group = this.group;
- group.removeAll();
- // Not update map if it is an roam action from self
- if (!(payload && payload.type === 'geoRoam'
- && payload.component === 'series'
- && payload.name === mapModel.name)) {
-
- if (mapModel.needsDrawMap) {
- var mapDraw = this._mapDraw || new MapDraw(api, true);
- group.add(mapDraw.group);
-
- mapDraw.draw(mapModel, ecModel, api, this);
-
- this._mapDraw = mapDraw;
- }
- else {
- // Remove drawed map
- this._mapDraw && this._mapDraw.remove();
- this._mapDraw = null;
- }
- }
- else {
- var mapDraw = this._mapDraw;
- mapDraw && group.add(mapDraw.group);
- }
-
- mapModel.get('showLegendSymbol') && ecModel.getComponent('legend')
- && this._renderSymbols(mapModel, ecModel, api);
- },
-
- remove: function () {
- this._mapDraw && this._mapDraw.remove();
- this._mapDraw = null;
- this.group.removeAll();
- },
-
- _renderSymbols: function (mapModel, ecModel, api) {
- var data = mapModel.getData();
- var group = this.group;
-
- data.each('value', function (value, idx) {
- if (isNaN(value)) {
- return;
- }
-
- var layout = data.getItemLayout(idx);
-
- if (!layout || !layout.point) {
- // Not exists in map
- return;
- }
-
- var point = layout.point;
- var offset = layout.offset;
-
- var circle = new graphic.Circle({
- style: {
- fill: data.getVisual('color')
- },
- shape: {
- cx: point[0] + offset * 9,
- cy: point[1],
- r: 3
- },
- silent: true,
- z2: 10
- });
-
- // First data on the same region
- if (!offset) {
- var labelText = data.getName(idx);
-
- var itemModel = data.getItemModel(idx);
- var labelModel = itemModel.getModel('label.normal');
- var hoverLabelModel = itemModel.getModel('label.emphasis');
-
- var textStyleModel = labelModel.getModel('textStyle');
- var hoverTextStyleModel = hoverLabelModel.getModel('textStyle');
-
- var polygonGroups = data.getItemGraphicEl(idx);
- circle.setStyle({
- textPosition: 'bottom'
- });
-
- var onEmphasis = function () {
- circle.setStyle({
- text: hoverLabelModel.get('show') ? labelText : '',
- textFill: hoverTextStyleModel.getTextColor(),
- textFont: hoverTextStyleModel.getFont()
- });
- };
-
- var onNormal = function () {
- circle.setStyle({
- text: labelModel.get('show') ? labelText : '',
- textFill: textStyleModel.getTextColor(),
- textFont: textStyleModel.getFont()
- });
- };
-
- polygonGroups.on('mouseover', onEmphasis)
- .on('mouseout', onNormal)
- .on('emphasis', onEmphasis)
- .on('normal', onNormal);
-
- onNormal();
- }
-
- group.add(circle);
- });
- }
- });
-
-
-/***/ },
-/* 158 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @module echarts/component/helper/MapDraw
- */
-
-
- var RoamController = __webpack_require__(159);
- var graphic = __webpack_require__(42);
- var zrUtil = __webpack_require__(3);
-
- function getFixedItemStyle(model, scale) {
- var itemStyle = model.getItemStyle();
- var areaColor = model.get('areaColor');
- if (areaColor) {
- itemStyle.fill = areaColor;
- }
-
- return itemStyle;
- }
-
- function updateMapSelectHandler(mapOrGeoModel, data, group, api, fromView) {
- group.off('click');
- mapOrGeoModel.get('selectedMode')
- && group.on('click', function (e) {
- var dataIndex = e.target.dataIndex;
- if (dataIndex != null) {
- var name = data.getName(dataIndex);
-
- api.dispatchAction({
- type: 'mapToggleSelect',
- seriesIndex: mapOrGeoModel.seriesIndex,
- name: name,
- from: fromView.uid
- });
-
- updateMapSelected(mapOrGeoModel, data, api);
- }
- });
- }
-
- function updateMapSelected(mapOrGeoModel, data) {
- data.eachItemGraphicEl(function (el, idx) {
- var name = data.getName(idx);
- el.trigger(mapOrGeoModel.isSelected(name) ? 'emphasis' : 'normal');
- });
- }
-
- /**
- * @alias module:echarts/component/helper/MapDraw
- * @param {module:echarts/ExtensionAPI} api
- * @param {boolean} updateGroup
- */
- function MapDraw(api, updateGroup) {
-
- var group = new graphic.Group();
-
- /**
- * @type {module:echarts/component/helper/RoamController}
- * @private
- */
- this._controller = new RoamController(
- api.getZr(), updateGroup ? group : null, null
- );
-
- /**
- * @type {module:zrender/container/Group}
- * @readOnly
- */
- this.group = group;
-
- /**
- * @type {boolean}
- * @private
- */
- this._updateGroup = updateGroup;
- }
-
- MapDraw.prototype = {
-
- constructor: MapDraw,
-
- draw: function (mapOrGeoModel, ecModel, api, fromView) {
-
- // geoModel has no data
- var data = mapOrGeoModel.getData && mapOrGeoModel.getData();
-
- var geo = mapOrGeoModel.coordinateSystem;
-
- var group = this.group;
- group.removeAll();
-
- var scale = geo.scale;
- group.position = geo.position.slice();
- group.scale = scale.slice();
-
- var itemStyleModel;
- var hoverItemStyleModel;
- var itemStyle;
- var hoverItemStyle;
-
- var labelModel;
- var hoverLabelModel;
-
- var itemStyleAccessPath = ['itemStyle', 'normal'];
- var hoverItemStyleAccessPath = ['itemStyle', 'emphasis'];
- var labelAccessPath = ['label', 'normal'];
- var hoverLabelAccessPath = ['label', 'emphasis'];
- if (!data) {
- itemStyleModel = mapOrGeoModel.getModel(itemStyleAccessPath);
- hoverItemStyleModel = mapOrGeoModel.getModel(hoverItemStyleAccessPath);
-
- itemStyle = getFixedItemStyle(itemStyleModel, scale);
- hoverItemStyle = getFixedItemStyle(hoverItemStyleModel, scale);
-
- labelModel = mapOrGeoModel.getModel(labelAccessPath);
- hoverLabelModel = mapOrGeoModel.getModel(hoverLabelAccessPath);
- }
-
- zrUtil.each(geo.regions, function (region) {
-
- var regionGroup = new graphic.Group();
- var dataIdx;
- // Use the itemStyle in data if has data
- if (data) {
- // FIXME If dataIdx < 0
- dataIdx = data.indexOfName(region.name);
- var itemModel = data.getItemModel(dataIdx);
-
- // Only visual color of each item will be used. It can be encoded by dataRange
- // But visual color of series is used in symbol drawing
- //
- // Visual color for each series is for the symbol draw
- var visualColor = data.getItemVisual(dataIdx, 'color', true);
-
- itemStyleModel = itemModel.getModel(itemStyleAccessPath);
- hoverItemStyleModel = itemModel.getModel(hoverItemStyleAccessPath);
-
- itemStyle = getFixedItemStyle(itemStyleModel, scale);
- hoverItemStyle = getFixedItemStyle(hoverItemStyleModel, scale);
-
- labelModel = itemModel.getModel(labelAccessPath);
- hoverLabelModel = itemModel.getModel(hoverLabelAccessPath);
-
- if (visualColor) {
- itemStyle.fill = visualColor;
- }
- }
- var textStyleModel = labelModel.getModel('textStyle');
- var hoverTextStyleModel = hoverLabelModel.getModel('textStyle');
-
- zrUtil.each(region.contours, function (contour) {
-
- var polygon = new graphic.Polygon({
- shape: {
- points: contour
- },
- style: {
- strokeNoScale: true
- },
- culling: true
- });
-
- polygon.setStyle(itemStyle);
-
- regionGroup.add(polygon);
- });
-
- // Label
- var showLabel = labelModel.get('show');
- var hoverShowLabel = hoverLabelModel.get('show');
-
- var isDataNaN = data && isNaN(data.get('value', dataIdx));
- var itemLayout = data && data.getItemLayout(dataIdx);
- // In the following cases label will be drawn
- // 1. In map series and data value is NaN
- // 2. In geo component
- // 4. Region has no series legendSymbol, which will be add a showLabel flag in mapSymbolLayout
- if (
- (!data || isDataNaN && (showLabel || hoverShowLabel))
- || (itemLayout && itemLayout.showLabel)
- ) {
- var query = data ? dataIdx : region.name;
- var formattedStr = mapOrGeoModel.getFormattedLabel(query, 'normal');
- var hoverFormattedStr = mapOrGeoModel.getFormattedLabel(query, 'emphasis');
- var text = new graphic.Text({
- style: {
- text: showLabel ? (formattedStr || region.name) : '',
- fill: textStyleModel.getTextColor(),
- textFont: textStyleModel.getFont(),
- textAlign: 'center',
- textVerticalAlign: 'middle'
- },
- hoverStyle: {
- text: hoverShowLabel ? (hoverFormattedStr || region.name) : '',
- fill: hoverTextStyleModel.getTextColor(),
- textFont: hoverTextStyleModel.getFont()
- },
- position: region.center.slice(),
- scale: [1 / scale[0], 1 / scale[1]],
- z2: 10,
- silent: true
- });
-
- regionGroup.add(text);
- }
-
- // setItemGraphicEl, setHoverStyle after all polygons and labels
- // are added to the rigionGroup
- data && data.setItemGraphicEl(dataIdx, regionGroup);
-
- graphic.setHoverStyle(regionGroup, hoverItemStyle);
-
- group.add(regionGroup);
- });
-
- this._updateController(mapOrGeoModel, ecModel, api);
-
- data && updateMapSelectHandler(mapOrGeoModel, data, group, api, fromView);
-
- data && updateMapSelected(mapOrGeoModel, data);
- },
-
- remove: function () {
- this.group.removeAll();
- this._controller.dispose();
- },
-
- _updateController: function (mapOrGeoModel, ecModel, api) {
- var geo = mapOrGeoModel.coordinateSystem;
- var controller = this._controller;
- controller.zoomLimit = mapOrGeoModel.get('scaleLimit');
- // Update zoom from model
- controller.zoom = mapOrGeoModel.get('roamDetail.zoom');
- // roamType is will be set default true if it is null
- controller.enable(mapOrGeoModel.get('roam') || false);
- // FIXME mainType, subType 作为 component 的属性?
- var mainType = mapOrGeoModel.type.split('.')[0];
- controller.off('pan')
- .on('pan', function (dx, dy) {
- api.dispatchAction({
- type: 'geoRoam',
- component: mainType,
- name: mapOrGeoModel.name,
- dx: dx,
- dy: dy
- });
- });
- controller.off('zoom')
- .on('zoom', function (zoom, mouseX, mouseY) {
- api.dispatchAction({
- type: 'geoRoam',
- component: mainType,
- name: mapOrGeoModel.name,
- zoom: zoom,
- originX: mouseX,
- originY: mouseY
- });
-
- if (this._updateGroup) {
- var group = this.group;
- var scale = group.scale;
- group.traverse(function (el) {
- if (el.type === 'text') {
- el.attr('scale', [1 / scale[0], 1 / scale[1]]);
- }
- });
- }
- }, this);
-
- controller.rect = geo.getViewRect();
- }
- };
-
- module.exports = MapDraw;
-
-
-/***/ },
-/* 159 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @module echarts/component/helper/RoamController
- */
-
-
-
- var Eventful = __webpack_require__(32);
- var zrUtil = __webpack_require__(3);
- var eventTool = __webpack_require__(80);
- var interactionMutex = __webpack_require__(160);
-
- function mousedown(e) {
- if (e.target && e.target.draggable) {
- return;
- }
-
- var x = e.offsetX;
- var y = e.offsetY;
- var rect = this.rect;
- if (rect && rect.contain(x, y)) {
- this._x = x;
- this._y = y;
- this._dragging = true;
- }
- }
-
- function mousemove(e) {
- if (!this._dragging) {
- return;
- }
-
- eventTool.stop(e.event);
-
- if (e.gestureEvent !== 'pinch') {
-
- if (interactionMutex.isTaken('globalPan', this._zr)) {
- return;
- }
-
- var x = e.offsetX;
- var y = e.offsetY;
-
- var dx = x - this._x;
- var dy = y - this._y;
-
- this._x = x;
- this._y = y;
-
- var target = this.target;
-
- if (target) {
- var pos = target.position;
- pos[0] += dx;
- pos[1] += dy;
- target.dirty();
- }
-
- eventTool.stop(e.event);
- this.trigger('pan', dx, dy);
- }
- }
-
- function mouseup(e) {
- this._dragging = false;
- }
-
- function mousewheel(e) {
- eventTool.stop(e.event);
- // Convenience:
- // Mac and VM Windows on Mac: scroll up: zoom out.
- // Windows: scroll up: zoom in.
- var zoomDelta = e.wheelDelta > 0 ? 1.1 : 1 / 1.1;
- zoom.call(this, e, zoomDelta, e.offsetX, e.offsetY);
- }
-
- function pinch(e) {
- if (interactionMutex.isTaken('globalPan', this._zr)) {
- return;
- }
-
- eventTool.stop(e.event);
- var zoomDelta = e.pinchScale > 1 ? 1.1 : 1 / 1.1;
- zoom.call(this, e, zoomDelta, e.pinchX, e.pinchY);
- }
-
- function zoom(e, zoomDelta, zoomX, zoomY) {
- var rect = this.rect;
-
- if (rect && rect.contain(zoomX, zoomY)) {
-
- var target = this.target;
- var zoomLimit = this.zoomLimit;
-
- if (target) {
- var pos = target.position;
- var scale = target.scale;
-
- var newZoom = this.zoom = this.zoom || 1;
- newZoom *= zoomDelta;
- if (zoomLimit) {
- newZoom = Math.max(
- Math.min(zoomLimit.max, newZoom),
- zoomLimit.min
- );
- }
- var zoomScale = newZoom / this.zoom;
- this.zoom = newZoom;
- // Keep the mouse center when scaling
- pos[0] -= (zoomX - pos[0]) * (zoomScale - 1);
- pos[1] -= (zoomY - pos[1]) * (zoomScale - 1);
- scale[0] *= zoomScale;
- scale[1] *= zoomScale;
-
- target.dirty();
- }
-
- this.trigger('zoom', zoomDelta, zoomX, zoomY);
- }
- }
-
- /**
- * @alias module:echarts/component/helper/RoamController
- * @constructor
- * @mixin {module:zrender/mixin/Eventful}
- *
- * @param {module:zrender/zrender~ZRender} zr
- * @param {module:zrender/Element} target
- * @param {module:zrender/core/BoundingRect} rect
- */
- function RoamController(zr, target, rect) {
-
- /**
- * @type {module:zrender/Element}
- */
- this.target = target;
-
- /**
- * @type {module:zrender/core/BoundingRect}
- */
- this.rect = rect;
-
- /**
- * { min: 1, max: 2 }
- * @type {Object}
- */
- this.zoomLimit;
-
- /**
- * @type {number}
- */
- this.zoom;
- /**
- * @type {module:zrender}
- */
- this._zr = zr;
-
- // Avoid two roamController bind the same handler
- var bind = zrUtil.bind;
- var mousedownHandler = bind(mousedown, this);
- var mousemoveHandler = bind(mousemove, this);
- var mouseupHandler = bind(mouseup, this);
- var mousewheelHandler = bind(mousewheel, this);
- var pinchHandler = bind(pinch, this);
-
- Eventful.call(this);
-
- /**
- * Notice: only enable needed types. For example, if 'zoom'
- * is not needed, 'zoom' should not be enabled, otherwise
- * default mousewheel behaviour (scroll page) will be disabled.
- *
- * @param {boolean|string} [controlType=true] Specify the control type,
- * which can be null/undefined or true/false
- * or 'pan/move' or 'zoom'/'scale'
- */
- this.enable = function (controlType) {
- // Disable previous first
- this.disable();
-
- if (controlType == null) {
- controlType = true;
- }
-
- if (controlType === true || (controlType === 'move' || controlType === 'pan')) {
- zr.on('mousedown', mousedownHandler);
- zr.on('mousemove', mousemoveHandler);
- zr.on('mouseup', mouseupHandler);
- }
- if (controlType === true || (controlType === 'scale' || controlType === 'zoom')) {
- zr.on('mousewheel', mousewheelHandler);
- zr.on('pinch', pinchHandler);
- }
- };
-
- this.disable = function () {
- zr.off('mousedown', mousedownHandler);
- zr.off('mousemove', mousemoveHandler);
- zr.off('mouseup', mouseupHandler);
- zr.off('mousewheel', mousewheelHandler);
- zr.off('pinch', pinchHandler);
- };
-
- this.dispose = this.disable;
-
- this.isDragging = function () {
- return this._dragging;
- };
-
- this.isPinching = function () {
- return this._pinching;
- };
- }
-
- zrUtil.mixin(RoamController, Eventful);
-
- module.exports = RoamController;
-
-
-/***/ },
-/* 160 */
-/***/ function(module, exports) {
-
-
-
- var ATTR = '\0_ec_interaction_mutex';
-
- var interactionMutex = {
-
- take: function (key, zr) {
- getStore(zr)[key] = true;
- },
-
- release: function (key, zr) {
- getStore(zr)[key] = false;
- },
-
- isTaken: function (key, zr) {
- return !!getStore(zr)[key];
- }
- };
-
- function getStore(zr) {
- return zr[ATTR] || (zr[ATTR] = {});
- }
-
- module.exports = interactionMutex;
-
-
-/***/ },
-/* 161 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var roamHelper = __webpack_require__(162);
-
- var echarts = __webpack_require__(1);
- var actionInfo = {
- type: 'geoRoam',
- event: 'geoRoam',
- update: 'updateLayout'
- };
-
- /**
- * @payload
- * @property {string} [component=series]
- * @property {string} name Component name
- * @property {number} [dx]
- * @property {number} [dy]
- * @property {number} [zoom]
- * @property {number} [originX]
- * @property {number} [originY]
- */
- echarts.registerAction(actionInfo, function (payload, ecModel) {
- var componentType = payload.component || 'series';
-
- ecModel.eachComponent(componentType, function (componentModel) {
- if (componentModel.name === payload.name) {
- var geo = componentModel.coordinateSystem;
- if (geo.type !== 'geo') {
- return;
- }
-
- var roamDetailModel = componentModel.getModel('roamDetail');
- var res = roamHelper.calcPanAndZoom(
- roamDetailModel, payload, componentModel.get('scaleLimit')
- );
-
- componentModel.setRoamPan
- && componentModel.setRoamPan(res.x, res.y);
-
- componentModel.setRoamZoom
- && componentModel.setRoamZoom(res.zoom);
-
- geo && geo.setPan(res.x, res.y);
- geo && geo.setZoom(res.zoom);
-
- // All map series with same `map` use the same geo coordinate system
- // So the roamDetail must be in sync. Include the series not selected by legend
- if (componentType === 'series') {
- zrUtil.each(componentModel.seriesGroup, function (seriesModel) {
- seriesModel.setRoamPan(res.x, res.y);
- seriesModel.setRoamZoom(res.zoom);
- });
- }
- }
- });
- });
-
-
-/***/ },
-/* 162 */
-/***/ function(module, exports) {
-
-
-
- var roamHelper = {};
-
- /**
- * Calculate pan and zoom which from roamDetail model
- * @param {module:echarts/model/Model} roamDetailModel
- * @param {Object} payload
- * @param {Object} [zoomLimit]
- */
- roamHelper.calcPanAndZoom = function (
- roamDetailModel, payload, zoomLimit
- ) {
- var dx = payload.dx;
- var dy = payload.dy;
- var zoom = payload.zoom;
-
- var panX = roamDetailModel.get('x') || 0;
- var panY = roamDetailModel.get('y') || 0;
-
- var previousZoom = roamDetailModel.get('zoom') || 1;
-
- if (dx != null && dy != null) {
- panX += dx;
- panY += dy;
- }
- if (zoom != null) {
- if (zoomLimit) {
- zoom = Math.max(
- Math.min(previousZoom * zoom, zoomLimit.max),
- zoomLimit.min
- ) / previousZoom;
- }
- var fixX = (payload.originX - panX) * (zoom - 1);
- var fixY = (payload.originY - panY) * (zoom - 1);
-
- panX -= fixX;
- panY -= fixY;
- }
-
- return {
- x: panX,
- y: panY,
- zoom: (zoom || 1) * previousZoom
- };
- };
-
- module.exports = roamHelper;
-
-
-/***/ },
-/* 163 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- __webpack_require__(164);
-
- var Geo = __webpack_require__(165);
-
- var layout = __webpack_require__(21);
- var zrUtil = __webpack_require__(3);
-
- var mapDataStores = {};
-
- /**
- * Resize method bound to the geo
- * @param {module:echarts/coord/geo/GeoModel|module:echarts/chart/map/MapModel} geoModel
- * @param {module:echarts/ExtensionAPI} api
- */
- function resizeGeo (geoModel, api) {
- var rect = this.getBoundingRect();
-
- var boxLayoutOption = geoModel.getBoxLayoutParams();
- // 0.75 rate
- boxLayoutOption.aspect = rect.width / rect.height * 0.75;
-
- var viewRect = layout.getLayoutRect(boxLayoutOption, {
- width: api.getWidth(),
- height: api.getHeight()
- });
-
- this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height);
-
- var roamDetailModel = geoModel.getModel('roamDetail');
-
- var panX = roamDetailModel.get('x') || 0;
- var panY = roamDetailModel.get('y') || 0;
- var zoom = roamDetailModel.get('zoom') || 1;
-
- this.setPan(panX, panY);
- this.setZoom(zoom);
- }
-
- /**
- * @param {module:echarts/coord/Geo} geo
- * @param {module:echarts/model/Model} model
- * @inner
- */
- function setGeoCoords(geo, model) {
- zrUtil.each(model.get('geoCoord'), function (geoCoord, name) {
- geo.addGeoCoord(name, geoCoord);
- });
- }
-
- function mapNotExistsError(name) {
- console.error('Map ' + name + ' not exists');
- }
-
- var geoCreator = {
-
- // For deciding which dimensions to use when creating list data
- dimensions: Geo.prototype.dimensions,
-
- create: function (ecModel, api) {
- var geoList = [];
-
- // FIXME Create each time may be slow
- ecModel.eachComponent('geo', function (geoModel, idx) {
- var name = geoModel.get('map');
- var mapData = mapDataStores[name];
- if (!mapData) {
- mapNotExistsError(name);
- }
- var geo = new Geo(
- name + idx, name,
- mapData && mapData.geoJson, mapData && mapData.specialAreas,
- geoModel.get('nameMap')
- );
- geo.zoomLimit = geoModel.get('scaleLimit');
- geoList.push(geo);
-
- setGeoCoords(geo, geoModel);
-
- geoModel.coordinateSystem = geo;
- geo.model = geoModel;
-
- // Inject resize method
- geo.resize = resizeGeo;
-
- geo.resize(geoModel, api);
- });
-
- ecModel.eachSeries(function (seriesModel) {
- var coordSys = seriesModel.get('coordinateSystem');
- if (coordSys === 'geo') {
- var geoIndex = seriesModel.get('geoIndex') || 0;
- seriesModel.coordinateSystem = geoList[geoIndex];
- }
- });
-
- // If has map series
- var mapModelGroupBySeries = {};
-
- ecModel.eachSeriesByType('map', function (seriesModel) {
- var mapType = seriesModel.get('map');
-
- mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || [];
-
- mapModelGroupBySeries[mapType].push(seriesModel);
- });
-
- zrUtil.each(mapModelGroupBySeries, function (mapSeries, mapType) {
- var mapData = mapDataStores[mapType];
- if (!mapData) {
- mapNotExistsError(name);
- }
-
- var nameMapList = zrUtil.map(mapSeries, function (singleMapSeries) {
- return singleMapSeries.get('nameMap');
- });
- var geo = new Geo(
- mapType, mapType,
- mapData && mapData.geoJson, mapData && mapData.specialAreas,
- zrUtil.mergeAll(nameMapList)
- );
- geo.zoomLimit = zrUtil.retrieve.apply(null, zrUtil.map(mapSeries, function (singleMapSeries) {
- return singleMapSeries.get('scaleLimit');
- }));
- geoList.push(geo);
-
- // Inject resize method
- geo.resize = resizeGeo;
-
- geo.resize(mapSeries[0], api);
-
- zrUtil.each(mapSeries, function (singleMapSeries) {
- singleMapSeries.coordinateSystem = geo;
-
- setGeoCoords(geo, singleMapSeries);
- });
- });
-
- return geoList;
- },
-
- /**
- * @param {string} mapName
- * @param {Object|string} geoJson
- * @param {Object} [specialAreas]
- *
- * @example
- * $.get('USA.json', function (geoJson) {
- * echarts.registerMap('USA', geoJson);
- * // Or
- * echarts.registerMap('USA', {
- * geoJson: geoJson,
- * specialAreas: {}
- * })
- * });
- */
- registerMap: function (mapName, geoJson, specialAreas) {
- if (geoJson.geoJson && !geoJson.features) {
- specialAreas = geoJson.specialAreas;
- geoJson = geoJson.geoJson;
- }
- if (typeof geoJson === 'string') {
- geoJson = (typeof JSON !== 'undefined' && JSON.parse)
- ? JSON.parse(geoJson) : (new Function('return (' + geoJson + ');'))();
- }
- mapDataStores[mapName] = {
- geoJson: geoJson,
- specialAreas: specialAreas
- };
- },
-
- /**
- * @param {string} mapName
- * @return {Object}
- */
- getMap: function (mapName) {
- return mapDataStores[mapName];
- }
- };
-
- // Inject methods into echarts
- var echarts = __webpack_require__(1);
-
- echarts.registerMap = geoCreator.registerMap;
-
- echarts.getMap = geoCreator.getMap;
-
- // TODO
- echarts.loadMap = function () {};
-
- echarts.registerCoordinateSystem('geo', geoCreator);
-
-
-/***/ },
-/* 164 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var modelUtil = __webpack_require__(5);
- var ComponentModel = __webpack_require__(19);
-
- ComponentModel.extend({
-
- type: 'geo',
-
- /**
- * @type {module:echarts/coord/geo/Geo}
- */
- coordinateSystem: null,
-
- init: function (option) {
- ComponentModel.prototype.init.apply(this, arguments);
-
- // Default label emphasis `position` and `show`
- modelUtil.defaultEmphasis(
- option.label, ['position', 'show', 'textStyle', 'distance', 'formatter']
- );
- },
-
- defaultOption: {
-
- zlevel: 0,
-
- z: 0,
-
- show: true,
-
- left: 'center',
-
- top: 'center',
-
- // 自适应
- // width:,
- // height:,
- // right
- // bottom
-
- // Map type
- map: '',
-
- // 在 roam 开启的时候使用
- roamDetail: {
- x: 0,
- y: 0,
- zoom: 1
- },
-
- scaleLimit: null,
-
- label: {
- normal: {
- show: false,
- textStyle: {
- color: '#000'
- }
- },
- emphasis: {
- show: true,
- textStyle: {
- color: 'rgb(100,0,0)'
- }
- }
- },
-
- itemStyle: {
- normal: {
- // color: 各异,
- borderWidth: 0.5,
- borderColor: '#444',
- color: '#eee'
- },
- emphasis: { // 也是选中样式
- color: 'rgba(255,215,0,0.8)'
- }
- }
- },
-
- /**
- * Format label
- * @param {string} name Region name
- * @param {string} [status='normal'] 'normal' or 'emphasis'
- * @return {string}
- */
- getFormattedLabel: function (name, status) {
- var formatter = this.get('label.' + status + '.formatter');
- var params = {
- name: name
- };
- if (typeof formatter === 'function') {
- params.status = status;
- return formatter(params);
- }
- else if (typeof formatter === 'string') {
- return formatter.replace('{a}', params.seriesName);
- }
- },
-
- setRoamZoom: function (zoom) {
- var roamDetail = this.option.roamDetail;
- roamDetail && (roamDetail.zoom = zoom);
- },
-
- setRoamPan: function (x, y) {
- var roamDetail = this.option.roamDetail;
- if (roamDetail) {
- roamDetail.x = x;
- roamDetail.y = y;
- }
- }
- });
-
-
-/***/ },
-/* 165 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var parseGeoJson = __webpack_require__(166);
-
- var zrUtil = __webpack_require__(3);
-
- var BoundingRect = __webpack_require__(15);
-
- var View = __webpack_require__(169);
-
-
- // Geo fix functions
- var geoFixFuncs = [
- __webpack_require__(170),
- __webpack_require__(171),
- __webpack_require__(172)
- ];
-
- /**
- * [Geo description]
- * @param {string} name Geo name
- * @param {string} map Map type
- * @param {Object} geoJson
- * @param {Object} [specialAreas]
- * Specify the positioned areas by left, top, width, height
- * @param {Object.<string, string>} [nameMap]
- * Specify name alias
- */
- function Geo(name, map, geoJson, specialAreas, nameMap) {
-
- View.call(this, name);
-
- /**
- * Map type
- * @type {string}
- */
- this.map = map;
-
- this._nameCoordMap = {};
-
- this.loadGeoJson(geoJson, specialAreas, nameMap);
- }
-
- Geo.prototype = {
-
- constructor: Geo,
-
- type: 'geo',
-
- /**
- * @param {Array.<string>}
- * @readOnly
- */
- dimensions: ['lng', 'lat'],
-
- /**
- * @param {Object} geoJson
- * @param {Object} [specialAreas]
- * Specify the positioned areas by left, top, width, height
- * @param {Object.<string, string>} [nameMap]
- * Specify name alias
- */
- loadGeoJson: function (geoJson, specialAreas, nameMap) {
- // https://jsperf.com/try-catch-performance-overhead
- try {
- this.regions = geoJson ? parseGeoJson(geoJson) : [];
- }
- catch (e) {
- throw 'Invalid geoJson format\n' + e;
- }
- specialAreas = specialAreas || {};
- nameMap = nameMap || {};
- var regions = this.regions;
- var regionsMap = {};
- for (var i = 0; i < regions.length; i++) {
- var regionName = regions[i].name;
- // Try use the alias in nameMap
- regionName = nameMap[regionName] || regionName;
- regions[i].name = regionName;
-
- regionsMap[regionName] = regions[i];
- // Add geoJson
- this.addGeoCoord(regionName, regions[i].center);
-
- // Some area like Alaska in USA map needs to be tansformed
- // to look better
- var specialArea = specialAreas[regionName];
- if (specialArea) {
- regions[i].transformTo(
- specialArea.left, specialArea.top, specialArea.width, specialArea.height
- );
- }
- }
-
- this._regionsMap = regionsMap;
-
- this._rect = null;
-
- zrUtil.each(geoFixFuncs, function (fixFunc) {
- fixFunc(this);
- }, this);
- },
-
- // Overwrite
- transformTo: function (x, y, width, height) {
- var rect = this.getBoundingRect();
-
- rect = rect.clone();
- // Longitute is inverted
- rect.y = -rect.y - rect.height;
-
- var viewTransform = this._viewTransform;
-
- viewTransform.transform = rect.calculateTransform(
- new BoundingRect(x, y, width, height)
- );
-
- viewTransform.decomposeTransform();
-
- var scale = viewTransform.scale;
- scale[1] = -scale[1];
-
- viewTransform.updateTransform();
-
- this._updateTransform();
- },
-
- /**
- * @param {string} name
- * @return {module:echarts/coord/geo/Region}
- */
- getRegion: function (name) {
- return this._regionsMap[name];
- },
-
- /**
- * Add geoCoord for indexing by name
- * @param {string} name
- * @param {Array.<number>} geoCoord
- */
- addGeoCoord: function (name, geoCoord) {
- this._nameCoordMap[name] = geoCoord;
- },
-
- /**
- * Get geoCoord by name
- * @param {string} name
- * @return {Array.<number>}
- */
- getGeoCoord: function (name) {
- return this._nameCoordMap[name];
- },
-
- // Overwrite
- getBoundingRect: function () {
- if (this._rect) {
- return this._rect;
- }
- var rect;
-
- var regions = this.regions;
- for (var i = 0; i < regions.length; i++) {
- var regionRect = regions[i].getBoundingRect();
- rect = rect || regionRect.clone();
- rect.union(regionRect);
- }
- // FIXME Always return new ?
- return (this._rect = rect || new BoundingRect(0, 0, 0, 0));
- },
-
- /**
- * Convert series data to a list of points
- * @param {module:echarts/data/List} data
- * @param {boolean} stack
- * @return {Array}
- * Return list of points. For example:
- * `[[10, 10], [20, 20], [30, 30]]`
- */
- dataToPoints: function (data) {
- var item = [];
- return data.mapArray(['lng', 'lat'], function (lon, lat) {
- item[0] = lon;
- item[1] = lat;
- return this.dataToPoint(item);
- }, this);
- },
-
- // Overwrite
- /**
- * @param {string|Array.<number>} data
- * @return {Array.<number>}
- */
- dataToPoint: function (data) {
- if (typeof data === 'string') {
- // Map area name to geoCoord
- data = this.getGeoCoord(data);
- }
- if (data) {
- return View.prototype.dataToPoint.call(this, data);
- }
- }
- };
-
- zrUtil.mixin(Geo, View);
-
- module.exports = Geo;
-
-
-/***/ },
-/* 166 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Parse and decode geo json
- * @module echarts/coord/geo/parseGeoJson
- */
-
-
- var zrUtil = __webpack_require__(3);
-
- var Region = __webpack_require__(167);
-
- function decode(json) {
- if (!json.UTF8Encoding) {
- return json;
- }
- var features = json.features;
-
- for (var f = 0; f < features.length; f++) {
- var feature = features[f];
- var geometry = feature.geometry;
- var coordinates = geometry.coordinates;
- var encodeOffsets = geometry.encodeOffsets;
-
- for (var c = 0; c < coordinates.length; c++) {
- var coordinate = coordinates[c];
-
- if (geometry.type === 'Polygon') {
- coordinates[c] = decodePolygon(
- coordinate,
- encodeOffsets[c]
- );
- }
- else if (geometry.type === 'MultiPolygon') {
- for (var c2 = 0; c2 < coordinate.length; c2++) {
- var polygon = coordinate[c2];
- coordinate[c2] = decodePolygon(
- polygon,
- encodeOffsets[c][c2]
- );
- }
- }
- }
- }
- // Has been decoded
- json.UTF8Encoding = false;
- return json;
- }
-
- function decodePolygon(coordinate, encodeOffsets) {
- var result = [];
- var prevX = encodeOffsets[0];
- var prevY = encodeOffsets[1];
-
- for (var i = 0; i < coordinate.length; i += 2) {
- var x = coordinate.charCodeAt(i) - 64;
- var y = coordinate.charCodeAt(i + 1) - 64;
- // ZigZag decoding
- x = (x >> 1) ^ (-(x & 1));
- y = (y >> 1) ^ (-(y & 1));
- // Delta deocding
- x += prevX;
- y += prevY;
-
- prevX = x;
- prevY = y;
- // Dequantize
- result.push([x / 1024, y / 1024]);
- }
-
- return result;
- }
-
- /**
- * @inner
- */
- function flattern2D(array) {
- var ret = [];
- for (var i = 0; i < array.length; i++) {
- for (var k = 0; k < array[i].length; k++) {
- ret.push(array[i][k]);
- }
- }
- return ret;
- }
-
- /**
- * @alias module:echarts/coord/geo/parseGeoJson
- * @param {Object} geoJson
- * @return {module:zrender/container/Group}
- */
- module.exports = function (geoJson) {
-
- decode(geoJson);
-
- return zrUtil.map(zrUtil.filter(geoJson.features, function (featureObj) {
- // Output of mapshaper may have geometry null
- return featureObj.geometry && featureObj.properties;
- }), function (featureObj) {
- var properties = featureObj.properties;
- var geometry = featureObj.geometry;
-
- var coordinates = geometry.coordinates;
-
- if (geometry.type === 'MultiPolygon') {
- coordinates = flattern2D(coordinates);
- }
-
- return new Region(
- properties.name,
- coordinates,
- properties.cp
- );
- });
- };
-
-
-/***/ },
-/* 167 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @module echarts/coord/geo/Region
- */
-
-
- var polygonContain = __webpack_require__(168);
-
- var BoundingRect = __webpack_require__(15);
-
- var bbox = __webpack_require__(50);
- var vec2 = __webpack_require__(16);
-
- /**
- * @param {string} name
- * @param {Array} contours
- * @param {Array.<number>} cp
- */
- function Region(name, contours, cp) {
-
- /**
- * @type {string}
- * @readOnly
- */
- this.name = name;
-
- /**
- * @type {Array.<Array>}
- * @readOnly
- */
- this.contours = contours;
-
- if (!cp) {
- var rect = this.getBoundingRect();
- cp = [
- rect.x + rect.width / 2,
- rect.y + rect.height / 2
- ];
- }
- else {
- cp = [cp[0], cp[1]];
- }
- /**
- * @type {Array.<number>}
- */
- this.center = cp;
- }
-
- Region.prototype = {
-
- constructor: Region,
-
- /**
- * @return {module:zrender/core/BoundingRect}
- */
- getBoundingRect: function () {
- var rect = this._rect;
- if (rect) {
- return rect;
- }
-
- var MAX_NUMBER = Number.MAX_VALUE;
- var min = [MAX_NUMBER, MAX_NUMBER];
- var max = [-MAX_NUMBER, -MAX_NUMBER];
- var min2 = [];
- var max2 = [];
- var contours = this.contours;
- for (var i = 0; i < contours.length; i++) {
- bbox.fromPoints(contours[i], min2, max2);
- vec2.min(min, min, min2);
- vec2.max(max, max, max2);
- }
- // No data
- if (i === 0) {
- min[0] = min[1] = max[0] = max[1] = 0;
- }
-
- return (this._rect = new BoundingRect(
- min[0], min[1], max[0] - min[0], max[1] - min[1]
- ));
- },
-
- /**
- * @param {<Array.<number>} coord
- * @return {boolean}
- */
- contain: function (coord) {
- var rect = this.getBoundingRect();
- var contours = this.contours;
- if (rect.contain(coord[0], coord[1])) {
- for (var i = 0, len = contours.length; i < len; i++) {
- if (polygonContain.contain(contours[i], coord[0], coord[1])) {
- return true;
- }
- }
- }
- return false;
- },
-
- transformTo: function (x, y, width, height) {
- var rect = this.getBoundingRect();
- var aspect = rect.width / rect.height;
- if (!width) {
- width = aspect * height;
- }
- else if (!height) {
- height = width / aspect ;
- }
- var target = new BoundingRect(x, y, width, height);
- var transform = rect.calculateTransform(target);
- var contours = this.contours;
- for (var i = 0; i < contours.length; i++) {
- for (var p = 0; p < contours[i].length; p++) {
- vec2.applyTransform(contours[i][p], contours[i][p], transform);
- }
- }
- rect = this._rect;
- rect.copy(target);
- // Update center
- this.center = [
- rect.x + rect.width / 2,
- rect.y + rect.height / 2
- ];
- }
- };
-
- module.exports = Region;
-
-
-/***/ },
-/* 168 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var windingLine = __webpack_require__(57);
-
- var EPSILON = 1e-8;
-
- function isAroundEqual(a, b) {
- return Math.abs(a - b) < EPSILON;
- }
-
- function contain(points, x, y) {
- var w = 0;
- var p = points[0];
-
- if (!p) {
- return false;
- }
-
- for (var i = 1; i < points.length; i++) {
- var p2 = points[i];
- w += windingLine(p[0], p[1], p2[0], p2[1], x, y);
- p = p2;
- }
-
- // Close polygon
- var p0 = points[0];
- if (!isAroundEqual(p[0], p0[0]) || !isAroundEqual(p[1], p0[1])) {
- w += windingLine(p[0], p[1], p0[0], p0[1], x, y);
- }
-
- return w !== 0;
- }
-
-
- module.exports = {
- contain: contain
- };
-
-
-/***/ },
-/* 169 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Simple view coordinate system
- * Mapping given x, y to transformd view x, y
- */
-
-
- var vector = __webpack_require__(16);
- var matrix = __webpack_require__(17);
-
- var Transformable = __webpack_require__(33);
- var zrUtil = __webpack_require__(3);
-
- var BoundingRect = __webpack_require__(15);
-
- var v2ApplyTransform = vector.applyTransform;
-
- // Dummy transform node
- function TransformDummy() {
- Transformable.call(this);
- }
- zrUtil.mixin(TransformDummy, Transformable);
-
- function View(name) {
- /**
- * @type {string}
- */
- this.name = name;
-
- /**
- * @type {Array.<number>}
- */
- this.zoomLimit;
-
- Transformable.call(this);
-
- this._roamTransform = new TransformDummy();
-
- this._viewTransform = new TransformDummy();
- }
-
- View.prototype = {
-
- constructor: View,
-
- type: 'view',
-
- /**
- * @param {Array.<string>}
- * @readOnly
- */
- dimensions: ['x', 'y'],
-
- /**
- * Set bounding rect
- * @param {number} x
- * @param {number} y
- * @param {number} width
- * @param {number} height
- */
-
- // PENDING to getRect
- setBoundingRect: function (x, y, width, height) {
- this._rect = new BoundingRect(x, y, width, height);
- return this._rect;
- },
-
- /**
- * @return {module:zrender/core/BoundingRect}
- */
- // PENDING to getRect
- getBoundingRect: function () {
- return this._rect;
- },
-
- /**
- * @param {number} x
- * @param {number} y
- * @param {number} width
- * @param {number} height
- */
- setViewRect: function (x, y, width, height) {
- this.transformTo(x, y, width, height);
- this._viewRect = new BoundingRect(x, y, width, height);
- },
-
- /**
- * Transformed to particular position and size
- * @param {number} x
- * @param {number} y
- * @param {number} width
- * @param {number} height
- */
- transformTo: function (x, y, width, height) {
- var rect = this.getBoundingRect();
- var viewTransform = this._viewTransform;
-
- viewTransform.transform = rect.calculateTransform(
- new BoundingRect(x, y, width, height)
- );
-
- viewTransform.decomposeTransform();
-
- this._updateTransform();
- },
-
- /**
- * @param {number} x
- * @param {number} y
- */
- setPan: function (x, y) {
-
- this._roamTransform.position = [x, y];
-
- this._updateTransform();
- },
-
- /**
- * @param {number} zoom
- */
- setZoom: function (zoom) {
- var zoomLimit = this.zoomLimit;
- if (zoomLimit) {
- zoom = Math.max(
- Math.min(zoom, zoomLimit.max), zoomLimit.min
- );
- }
-
- this._roamTransform.scale = [zoom, zoom];
-
- this._updateTransform();
- },
-
- /**
- * @return {Array.<number}
- */
- getRoamTransform: function () {
- return this._roamTransform.transform;
- },
-
- /**
- * Update transform from roam and mapLocation
- * @private
- */
- _updateTransform: function () {
- var roamTransform = this._roamTransform;
- var viewTransform = this._viewTransform;
- // var scale = this.scale;
-
- viewTransform.parent = roamTransform;
- roamTransform.updateTransform();
- viewTransform.updateTransform();
-
- viewTransform.transform
- && matrix.copy(this.transform || (this.transform = []), viewTransform.transform);
-
- this.decomposeTransform();
- },
-
- /**
- * @return {module:zrender/core/BoundingRect}
- */
- getViewRect: function () {
- return this._viewRect;
- },
-
- /**
- * Convert a single (lon, lat) data item to (x, y) point.
- * @param {Array.<number>} data
- * @return {Array.<number>}
- */
- dataToPoint: function (data) {
- var transform = this.transform;
- return transform
- ? v2ApplyTransform([], data, transform)
- : [data[0], data[1]];
- },
-
- /**
- * Convert a (x, y) point to (lon, lat) data
- * @param {Array.<number>} point
- * @return {Array.<number>}
- */
- pointToData: function (point) {
- var invTransform = this.invTransform;
- return invTransform
- ? v2ApplyTransform([], point, invTransform)
- : [point[0], point[1]];
- }
-
- /**
- * @return {number}
- */
- // getScalarScale: function () {
- // // Use determinant square root of transform to mutiply scalar
- // var m = this.transform;
- // var det = Math.sqrt(Math.abs(m[0] * m[3] - m[2] * m[1]));
- // return det;
- // }
- };
-
- zrUtil.mixin(View, Transformable);
-
- module.exports = View;
-
-
-/***/ },
-/* 170 */
-/***/ function(module, exports, __webpack_require__) {
-
- // Fix for 南海诸岛
-
-
- var Region = __webpack_require__(167);
-
- var geoCoord = [126, 25];
-
- var points = [
- [[0,3.5],[7,11.2],[15,11.9],[30,7],[42,0.7],[52,0.7],
- [56,7.7],[59,0.7],[64,0.7],[64,0],[5,0],[0,3.5]],
- [[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],
- [[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],
- [[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],
- [[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],
- [[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],
- [[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],
- [[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],
- [[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],
- [[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],
- [[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],
- [[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],
- [1,92.4],[1,3.5],[0,3.5]]
- ];
- for (var i = 0; i < points.length; i++) {
- for (var k = 0; k < points[i].length; k++) {
- points[i][k][0] /= 10.5;
- points[i][k][1] /= -10.5 / 0.75;
-
- points[i][k][0] += geoCoord[0];
- points[i][k][1] += geoCoord[1];
- }
- }
- module.exports = function (geo) {
- if (geo.map === 'china') {
- geo.regions.push(new Region(
- '南海诸岛', points, geoCoord
- ));
- }
- };
-
-
-/***/ },
-/* 171 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
-
- var coordsOffsetMap = {
- '南海诸岛' : [32, 80],
- // 全国
- '广东': [0, -10],
- '香港': [10, 5],
- '澳门': [-10, 10],
- //'北京': [-10, 0],
- '天津': [5, 5]
- };
-
- module.exports = function (geo) {
- zrUtil.each(geo.regions, function (region) {
- var coordFix = coordsOffsetMap[region.name];
- if (coordFix) {
- var cp = region.center;
- cp[0] += coordFix[0] / 10.5;
- cp[1] += -coordFix[1] / (10.5 / 0.75);
- }
- });
- };
-
-
-/***/ },
-/* 172 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
-
- var geoCoordMap = {
- 'Russia': [100, 60],
- 'United States of America': [-99, 38]
- };
-
- module.exports = function (geo) {
- zrUtil.each(geo.regions, function (region) {
- var geoCoord = geoCoordMap[region.name];
- if (geoCoord) {
- var cp = region.center;
- cp[0] = geoCoord[0];
- cp[1] = geoCoord[1];
- }
- });
- };
-
-
-/***/ },
-/* 173 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
-
- module.exports = function (ecModel) {
-
- var processedMapType = {};
-
- ecModel.eachSeriesByType('map', function (mapSeries) {
- var mapType = mapSeries.get('mapType');
- if (processedMapType[mapType]) {
- return;
- }
-
- var mapSymbolOffsets = {};
-
- zrUtil.each(mapSeries.seriesGroup, function (subMapSeries) {
- var geo = subMapSeries.coordinateSystem;
- var data = subMapSeries.getData();
- if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) {
- data.each('value', function (value, idx) {
- var name = data.getName(idx);
- var region = geo.getRegion(name);
-
- // No region or no value
- // In MapSeries data regions will be filled with NaN
- // If they are not in the series.data array.
- // So here must validate if value is NaN
- if (!region || isNaN(value)) {
- return;
- }
-
- var offset = mapSymbolOffsets[name] || 0;
-
- var point = geo.dataToPoint(region.center);
-
- mapSymbolOffsets[name] = offset + 1;
-
- data.setItemLayout(idx, {
- point: point,
- offset: offset
- });
- });
- }
- });
-
- // Show label of those region not has legendSymbol(which is offset 0)
- var data = mapSeries.getData();
- data.each(function (idx) {
- var name = data.getName(idx);
- var layout = data.getItemLayout(idx) || {};
- layout.showLabel = !mapSymbolOffsets[name];
- data.setItemLayout(idx, layout);
- });
-
- processedMapType[mapType] = true;
- });
- };
-
-
-/***/ },
-/* 174 */
-/***/ function(module, exports) {
-
-
- module.exports = function (ecModel) {
- ecModel.eachSeriesByType('map', function (seriesModel) {
- var colorList = seriesModel.get('color');
- var itemStyleModel = seriesModel.getModel('itemStyle.normal');
-
- var areaColor = itemStyleModel.get('areaColor');
- var color = itemStyleModel.get('color')
- || colorList[seriesModel.seriesIndex % colorList.length];
-
- seriesModel.getData().setVisual({
- 'areaColor': areaColor,
- 'color': color
- });
- });
- };
-
-
-/***/ },
-/* 175 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
-
- // FIXME 公用?
- /**
- * @param {Array.<module:echarts/data/List>} datas
- * @param {string} statisticsType 'average' 'sum'
- * @inner
- */
- function dataStatistics(datas, statisticsType) {
- var dataNameMap = {};
- var dims = ['value'];
-
- for (var i = 0; i < datas.length; i++) {
- datas[i].each(dims, function (value, idx) {
- var name = datas[i].getName(idx);
- dataNameMap[name] = dataNameMap[name] || [];
- if (!isNaN(value)) {
- dataNameMap[name].push(value);
- }
- });
- }
-
- return datas[0].map(dims, function (value, idx) {
- var name = datas[0].getName(idx);
- var sum = 0;
- var min = Infinity;
- var max = -Infinity;
- var len = dataNameMap[name].length;
- for (var i = 0; i < len; i++) {
- min = Math.min(min, dataNameMap[name][i]);
- max = Math.max(max, dataNameMap[name][i]);
- sum += dataNameMap[name][i];
- }
- var result;
- if (statisticsType === 'min') {
- result = min;
- }
- else if (statisticsType === 'max') {
- result = max;
- }
- else if (statisticsType === 'average') {
- result = sum / len;
- }
- else {
- result = sum;
- }
- return len === 0 ? NaN : result;
- });
- }
-
- module.exports = function (ecModel) {
- var seriesGroupByMapType = {};
- ecModel.eachSeriesByType('map', function (seriesModel) {
- var mapType = seriesModel.get('map');
- seriesGroupByMapType[mapType] = seriesGroupByMapType[mapType] || [];
- seriesGroupByMapType[mapType].push(seriesModel);
- });
-
- zrUtil.each(seriesGroupByMapType, function (seriesList, mapType) {
- var data = dataStatistics(
- zrUtil.map(seriesList, function (seriesModel) {
- return seriesModel.getData();
- }),
- seriesList[0].get('mapValueCalculation')
- );
-
- seriesList[0].seriesGroup = [];
-
- seriesList[0].setData(data);
-
- // FIXME Put where?
- for (var i = 0; i < seriesList.length; i++) {
- seriesList[i].seriesGroup = seriesList;
- seriesList[i].needsDrawMap = i === 0;
- }
- });
- };
-
-
-/***/ },
-/* 176 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var geoProps = [
- 'x', 'y', 'x2', 'y2', 'width', 'height', 'map', 'roam', 'roamDetail', 'label', 'itemStyle'
- ];
-
- var geoCoordsMap = {};
-
- function createGeoFromMap(mapSeriesOpt) {
- var geoOpt = {};
- zrUtil.each(geoProps, function (propName) {
- if (mapSeriesOpt[propName] != null) {
- geoOpt[propName] = mapSeriesOpt[propName];
- }
- });
- return geoOpt;
- }
- module.exports = function (option) {
- // Save geoCoord
- var mapSeries = [];
- zrUtil.each(option.series, function (seriesOpt) {
- if (seriesOpt.type === 'map') {
- mapSeries.push(seriesOpt);
- }
- zrUtil.extend(geoCoordsMap, seriesOpt.geoCoord);
- });
-
- var newCreatedGeoOptMap = {};
- zrUtil.each(mapSeries, function (seriesOpt) {
- seriesOpt.map = seriesOpt.map || seriesOpt.mapType;
- // Put x, y, width, height, x2, y2 in the top level
- zrUtil.defaults(seriesOpt, seriesOpt.mapLocation);
- if (seriesOpt.markPoint) {
- var markPoint = seriesOpt.markPoint;
- // Convert name or geoCoord in markPoint to lng and lat
- // For example
- // { name: 'xxx', value: 10} Or
- // { geoCoord: [lng, lat], value: 10} to
- // { name: 'xxx', value: [lng, lat, 10]}
- markPoint.data = zrUtil.map(markPoint.data, function (dataOpt) {
- if (!zrUtil.isArray(dataOpt.value)) {
- var geoCoord;
- if (dataOpt.geoCoord) {
- geoCoord = dataOpt.geoCoord;
- }
- else if (dataOpt.name) {
- geoCoord = geoCoordsMap[dataOpt.name];
- }
- var newValue = geoCoord ? [geoCoord[0], geoCoord[1]] : [NaN, NaN];
- if (dataOpt.value != null) {
- newValue.push(dataOpt.value);
- }
- dataOpt.value = newValue;
- }
- return dataOpt;
- });
- // Convert map series which only has markPoint without data to scatter series
- // FIXME
- if (!(seriesOpt.data && seriesOpt.data.length)) {
- if (!option.geo) {
- option.geo = [];
- }
-
- // Use same geo if multiple map series has same map type
- var geoOpt = newCreatedGeoOptMap[seriesOpt.map];
- if (!geoOpt) {
- geoOpt = newCreatedGeoOptMap[seriesOpt.map] = createGeoFromMap(seriesOpt);
- option.geo.push(geoOpt);
- }
-
- var scatterSeries = seriesOpt.markPoint;
- scatterSeries.type = option.effect && option.effect.show ? 'effectScatter' : 'scatter';
- scatterSeries.coordinateSystem = 'geo';
- scatterSeries.geoIndex = zrUtil.indexOf(option.geo, geoOpt);
- scatterSeries.name = seriesOpt.name;
-
- option.series.splice(zrUtil.indexOf(option.series, seriesOpt), 1, scatterSeries);
- }
- }
- });
- };
-
-
-/***/ },
-/* 177 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var echarts = __webpack_require__(1);
-
- __webpack_require__(178);
- __webpack_require__(182);
- __webpack_require__(185);
-
- echarts.registerVisualCoding('chart', __webpack_require__(186));
-
- echarts.registerLayout(__webpack_require__(188));
-
-
-/***/ },
-/* 178 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var SeriesModel = __webpack_require__(27);
- var Tree = __webpack_require__(179);
- var zrUtil = __webpack_require__(3);
- var Model = __webpack_require__(8);
- var formatUtil = __webpack_require__(6);
- var helper = __webpack_require__(181);
- var encodeHTML = formatUtil.encodeHTML;
- var addCommas = formatUtil.addCommas;
-
-
- module.exports = SeriesModel.extend({
-
- type: 'series.treemap',
-
- dependencies: ['grid', 'polar'],
-
- /**
- * @type {module:echarts/data/Tree~Node}
- */
- _viewRoot: null,
-
- defaultOption: {
- // center: ['50%', '50%'], // not supported in ec3.
- // size: ['80%', '80%'], // deprecated, compatible with ec2.
- left: 'center',
- top: 'middle',
- right: null,
- bottom: null,
- width: '80%',
- height: '80%',
- sort: true, // Can be null or false or true
- // (order by desc default, asc not supported yet (strange effect))
- clipWindow: 'origin', // Size of clipped window when zooming. 'origin' or 'fullscreen'
- squareRatio: 0.5 * (1 + Math.sqrt(5)), // golden ratio
- leafDepth: null, // Nodes on depth from root are regarded as leaves.
- // Count from zero (zero represents only view root).
- visualDimension: 0, // Can be 0, 1, 2, 3.
- zoomToNodeRatio: 0.32 * 0.32, // Be effective when using zoomToNode. Specify the proportion of the
- // target node area in the view area.
- roam: true, // true, false, 'scale' or 'zoom', 'move'.
- nodeClick: 'zoomToNode', // Leaf node click behaviour: 'zoomToNode', 'link', false.
- // If leafDepth is set and clicking a node which has children but
- // be on left depth, the behaviour would be changing root. Otherwise
- // use behavious defined above.
- animation: true,
- animationDurationUpdate: 900,
- animationEasing: 'quinticInOut',
- breadcrumb: {
- show: true,
- height: 22,
- left: 'center',
- top: 'bottom',
- // right
- // bottom
- emptyItemWidth: 25, // Width of empty node.
- itemStyle: {
- normal: {
- color: 'rgba(0,0,0,0.7)', //'#5793f3',
- borderColor: 'rgba(255,255,255,0.7)',
- borderWidth: 1,
- shadowColor: 'rgba(150,150,150,1)',
- shadowBlur: 3,
- shadowOffsetX: 0,
- shadowOffsetY: 0,
- textStyle: {
- color: '#fff'
- }
- },
- emphasis: {
- textStyle: {}
- }
- }
- },
- label: {
- normal: {
- show: true,
- position: ['50%', '50%'], // Can be 5, '5%' or position stirng like 'insideTopLeft', ...
- textStyle: {
- align: 'center',
- baseline: 'middle',
- color: '#fff',
- ellipsis: true
- }
- }
- },
- itemStyle: {
- normal: {
- color: null, // Can be 'none' if not necessary.
- colorAlpha: null, // Can be 'none' if not necessary.
- colorSaturation: null, // Can be 'none' if not necessary.
- borderWidth: 0,
- gapWidth: 0,
- borderColor: '#fff',
- borderColorSaturation: null // If specified, borderColor will be ineffective, and the
- // border color is evaluated by color of current node and
- // borderColorSaturation.
- },
- emphasis: {
-
- }
- },
- color: 'none', // Array. Specify color list of each level.
- // level[0].color would be global color list.
- colorAlpha: null, // Array. Specify color alpha range of each level, like [0.2, 0.8]
- colorSaturation: null, // Array. Specify color saturation of each level, like [0.2, 0.5]
- colorMappingBy: 'index', // 'value' or 'index' or 'id'.
- visibleMin: 10, // If area less than this threshold (unit: pixel^2), node will not
- // be rendered. Only works when sort is 'asc' or 'desc'.
- childrenVisibleMin: null, // If area of a node less than this threshold (unit: pixel^2),
- // grandchildren will not show.
- // Why grandchildren? If not grandchildren but children,
- // some siblings show children and some not,
- // the appearance may be mess and not consistent,
- levels: [] // Each item: {
- // visibleMin, itemStyle, visualDimension, label
- // }
- // data: {
- // value: [],
- // children: [],
- // link: 'http://xxx.xxx.xxx',
- // target: 'blank' or 'self'
- // }
- },
-
- /**
- * @override
- */
- getInitialData: function (option, ecModel) {
- var data = option.data || [];
- var rootName = option.name;
- rootName == null && (rootName = option.name);
-
- // Create a virtual root.
- var root = {name: rootName, children: option.data};
- var value0 = (data[0] || {}).value;
-
- completeTreeValue(root, zrUtil.isArray(value0) ? value0.length : -1);
-
- // FIXME
- // sereis.mergeOption 的 getInitData是否放在merge后,从而能直接获取merege后的结果而非手动判断。
- var levels = option.levels || [];
-
- levels = option.levels = setDefault(levels, ecModel);
-
- // Make sure always a new tree is created when setOption,
- // in TreemapView, we check whether oldTree === newTree
- // to choose mappings approach among old shapes and new shapes.
- return Tree.createTree(root, this, levels).data;
- },
-
- optionUpdated: function () {
- this.resetViewRoot();
- },
-
- /**
- * @override
- * @param {number} dataIndex
- * @param {boolean} [mutipleSeries=false]
- */
- formatTooltip: function (dataIndex) {
- var data = this.getData();
- var value = this.getRawValue(dataIndex);
- var formattedValue = zrUtil.isArray(value)
- ? addCommas(value[0]) : addCommas(value);
- var name = data.getName(dataIndex);
-
- return encodeHTML(name) + ': ' + formattedValue;
- },
-
- /**
- * Add tree path to tooltip param
- *
- * @override
- * @param {number} dataIndex
- * @return {Object}
- */
- getDataParams: function (dataIndex) {
- var params = SeriesModel.prototype.getDataParams.apply(this, arguments);
-
- var data = this.getData();
- var node = data.tree.getNodeByDataIndex(dataIndex);
- var treePathInfo = params.treePathInfo = [];
-
- while (node) {
- var nodeDataIndex = node.dataIndex;
- treePathInfo.push({
- name: node.name,
- dataIndex: nodeDataIndex,
- value: this.getRawValue(nodeDataIndex)
- });
- node = node.parentNode;
- }
-
- treePathInfo.reverse();
-
- return params;
- },
-
- /**
- * @public
- * @param {Object} layoutInfo {
- * x: containerGroup x
- * y: containerGroup y
- * width: containerGroup width
- * height: containerGroup height
- * }
- */
- setLayoutInfo: function (layoutInfo) {
- /**
- * @readOnly
- * @type {Object}
- */
- this.layoutInfo = this.layoutInfo || {};
- zrUtil.extend(this.layoutInfo, layoutInfo);
- },
-
- /**
- * @param {string} id
- * @return {number} index
- */
- mapIdToIndex: function (id) {
- // A feature is implemented:
- // index is monotone increasing with the sequence of
- // input id at the first time.
- // This feature can make sure that each data item and its
- // mapped color have the same index between data list and
- // color list at the beginning, which is useful for user
- // to adjust data-color mapping.
-
- /**
- * @private
- * @type {Object}
- */
- var idIndexMap = this._idIndexMap;
-
- if (!idIndexMap) {
- idIndexMap = this._idIndexMap = {};
- /**
- * @private
- * @type {number}
- */
- this._idIndexMapCount = 0;
- }
-
- var index = idIndexMap[id];
- if (index == null) {
- idIndexMap[id] = index = this._idIndexMapCount++;
- }
-
- return index;
- },
-
- getViewRoot: function () {
- return this._viewRoot;
- },
-
- /**
- * @param {module:echarts/data/Tree~Node} [viewRoot]
- * @return {string} direction 'drilldown' or 'rollup'
- */
- resetViewRoot: function (viewRoot) {
- viewRoot
- ? (this._viewRoot = viewRoot)
- : (viewRoot = this._viewRoot);
-
- var root = this.getData().tree.root;
-
- if (!viewRoot
- || (viewRoot !== root && !root.contains(viewRoot))
- ) {
- this._viewRoot = root;
- }
- }
- });
-
- /**
- * @param {Object} dataNode
- */
- function completeTreeValue(dataNode, arrValueLength) {
- // Postorder travel tree.
- // If value of none-leaf node is not set,
- // calculate it by suming up the value of all children.
- var sum = 0;
-
- zrUtil.each(dataNode.children, function (child) {
-
- completeTreeValue(child, arrValueLength);
-
- var childValue = child.value;
- zrUtil.isArray(childValue) && (childValue = childValue[0]);
-
- sum += childValue;
- });
-
- var thisValue = dataNode.value;
-
- if (arrValueLength >= 0) {
- if (!zrUtil.isArray(thisValue)) {
- dataNode.value = new Array(arrValueLength);
- }
- else {
- thisValue = thisValue[0];
- }
- }
-
- if (thisValue == null || isNaN(thisValue)) {
- thisValue = sum;
- }
- // Value should not less than 0.
- if (thisValue < 0) {
- thisValue = 0;
- }
-
- arrValueLength >= 0
- ? (dataNode.value[0] = thisValue)
- : (dataNode.value = thisValue);
- }
-
- /**
- * set default to level configuration
- */
- function setDefault(levels, ecModel) {
- var globalColorList = ecModel.get('color');
-
- if (!globalColorList) {
- return;
- }
-
- levels = levels || [];
- var hasColorDefine;
- zrUtil.each(levels, function (levelDefine) {
- var model = new Model(levelDefine);
- var modelColor = model.get('color');
- if (model.get('itemStyle.normal.color')
- || (modelColor && modelColor !== 'none')
- ) {
- hasColorDefine = true;
- }
- });
-
- if (!hasColorDefine) {
- var level0 = levels[0] || (levels[0] = {});
- level0.color = globalColorList.slice();
- }
-
- return levels;
- }
-
-
-
-/***/ },
-/* 179 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Tree data structure
- *
- * @module echarts/data/Tree
- */
-
-
- var zrUtil = __webpack_require__(3);
- var Model = __webpack_require__(8);
- var List = __webpack_require__(94);
- var linkListHelper = __webpack_require__(180);
- var completeDimensions = __webpack_require__(96);
-
- /**
- * @constructor module:echarts/data/Tree~TreeNode
- * @param {string} name
- * @param {number} [dataIndex=-1]
- * @param {module:echarts/data/Tree} hostTree
- */
- var TreeNode = function (name, dataIndex, hostTree) {
- /**
- * @type {string}
- */
- this.name = name || '';
-
- /**
- * Depth of node
- *
- * @type {number}
- * @readOnly
- */
- this.depth = 0;
-
- /**
- * Height of the subtree rooted at this node.
- * @type {number}
- * @readOnly
- */
- this.height = 0;
-
- /**
- * @type {module:echarts/data/Tree~TreeNode}
- * @readOnly
- */
- this.parentNode = null;
-
- /**
- * Reference to list item.
- * Do not persistent dataIndex outside,
- * besause it may be changed by list.
- * If dataIndex -1,
- * this node is logical deleted (filtered) in list.
- *
- * @type {Object}
- * @readOnly
- */
- this.dataIndex = dataIndex == null ? -1 : dataIndex;
-
- /**
- * @type {Array.<module:echarts/data/Tree~TreeNode>}
- * @readOnly
- */
- this.children = [];
-
- /**
- * @type {Array.<module:echarts/data/Tree~TreeNode>}
- * @pubilc
- */
- this.viewChildren = [];
-
- /**
- * @type {moduel:echarts/data/Tree}
- * @readOnly
- */
- this.hostTree = hostTree;
- };
-
- TreeNode.prototype = {
-
- constructor: TreeNode,
-
- /**
- * The node is removed.
- * @return {boolean} is removed.
- */
- isRemoved: function () {
- return this.dataIndex < 0;
- },
-
- /**
- * Travel this subtree (include this node).
- * Usage:
- * node.eachNode(function () { ... }); // preorder
- * node.eachNode('preorder', function () { ... }); // preorder
- * node.eachNode('postorder', function () { ... }); // postorder
- * node.eachNode(
- * {order: 'postorder', attr: 'viewChildren'},
- * function () { ... }
- * ); // postorder
- *
- * @param {(Object|string)} options If string, means order.
- * @param {string=} options.order 'preorder' or 'postorder'
- * @param {string=} options.attr 'children' or 'viewChildren'
- * @param {Function} cb If in preorder and return false,
- * its subtree will not be visited.
- * @param {Object} [context]
- */
- eachNode: function (options, cb, context) {
- if (typeof options === 'function') {
- context = cb;
- cb = options;
- options = null;
- }
-
- options = options || {};
- if (zrUtil.isString(options)) {
- options = {order: options};
- }
-
- var order = options.order || 'preorder';
- var children = this[options.attr || 'children'];
-
- var suppressVisitSub;
- order === 'preorder' && (suppressVisitSub = cb.call(context, this));
-
- for (var i = 0; !suppressVisitSub && i < children.length; i++) {
- children[i].eachNode(options, cb, context);
- }
-
- order === 'postorder' && cb.call(context, this);
- },
-
- /**
- * Update depth and height of this subtree.
- *
- * @param {number} depth
- */
- updateDepthAndHeight: function (depth) {
- var height = 0;
- this.depth = depth;
- for (var i = 0; i < this.children.length; i++) {
- var child = this.children[i];
- child.updateDepthAndHeight(depth + 1);
- if (child.height > height) {
- height = child.height;
- }
- }
- this.height = height + 1;
- },
-
- /**
- * @param {string} id
- * @return {module:echarts/data/Tree~TreeNode}
- */
- getNodeById: function (id) {
- if (this.getId() === id) {
- return this;
- }
- for (var i = 0, children = this.children, len = children.length; i < len; i++) {
- var res = children[i].getNodeById(id);
- if (res) {
- return res;
- }
- }
- },
-
- /**
- * @param {module:echarts/data/Tree~TreeNode} node
- * @return {boolean}
- */
- contains: function (node) {
- if (node === this) {
- return true;
- }
- for (var i = 0, children = this.children, len = children.length; i < len; i++) {
- var res = children[i].contains(node);
- if (res) {
- return res;
- }
- }
- },
-
- /**
- * @param {boolean} includeSelf Default false.
- * @return {Array.<module:echarts/data/Tree~TreeNode>} order: [root, child, grandchild, ...]
- */
- getAncestors: function (includeSelf) {
- var ancestors = [];
- var node = includeSelf ? this : this.parentNode;
- while (node) {
- ancestors.push(node);
- node = node.parentNode;
- }
- ancestors.reverse();
- return ancestors;
- },
-
- /**
- * @param {string|Array=} [dimension='value'] Default 'value'. can be 0, 1, 2, 3
- * @return {number} Value.
- */
- getValue: function (dimension) {
- var data = this.hostTree.data;
- return data.get(data.getDimension(dimension || 'value'), this.dataIndex);
- },
-
- /**
- * @param {Object} layout
- * @param {boolean=} [merge=false]
- */
- setLayout: function (layout, merge) {
- this.dataIndex >= 0
- && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge);
- },
-
- /**
- * @return {Object} layout
- */
- getLayout: function () {
- return this.hostTree.data.getItemLayout(this.dataIndex);
- },
-
- /**
- * @param {string} path
- * @return {module:echarts/model/Model}
- */
- getModel: function (path) {
- if (this.dataIndex < 0) {
- return;
- }
- var hostTree = this.hostTree;
- var itemModel = hostTree.data.getItemModel(this.dataIndex);
- var levelModel = this.getLevelModel();
-
- return itemModel.getModel(path, (levelModel || hostTree.hostModel).getModel(path));
- },
-
- /**
- * @return {module:echarts/model/Model}
- */
- getLevelModel: function () {
- return (this.hostTree.levelModels || [])[this.depth];
- },
-
- /**
- * @example
- * setItemVisual('color', color);
- * setItemVisual({
- * 'color': color
- * });
- */
- setVisual: function (key, value) {
- this.dataIndex >= 0
- && this.hostTree.data.setItemVisual(this.dataIndex, key, value);
- },
-
- /**
- * @public
- */
- getVisual: function (key, ignoreParent) {
- return this.hostTree.data.getItemVisual(this.dataIndex, key, ignoreParent);
- },
-
- /**
- * @public
- * @return {number}
- */
- getRawIndex: function () {
- return this.hostTree.data.getRawIndex(this.dataIndex);
- },
-
- /**
- * @public
- * @return {string}
- */
- getId: function () {
- return this.hostTree.data.getId(this.dataIndex);
- }
- };
-
- /**
- * @constructor
- * @alias module:echarts/data/Tree
- * @param {module:echarts/model/Model} hostModel
- * @param {Array.<Object>} levelOptions
- */
- function Tree(hostModel, levelOptions) {
- /**
- * @type {module:echarts/data/Tree~TreeNode}
- * @readOnly
- */
- this.root;
-
- /**
- * @type {module:echarts/data/List}
- * @readOnly
- */
- this.data;
-
- /**
- * Index of each item is the same as the raw index of coresponding list item.
- * @private
- * @type {Array.<module:echarts/data/Tree~TreeNode}
- */
- this._nodes = [];
-
- /**
- * @private
- * @readOnly
- * @type {module:echarts/model/Model}
- */
- this.hostModel = hostModel;
-
- /**
- * @private
- * @readOnly
- * @type {Array.<module:echarts/model/Model}
- */
- this.levelModels = zrUtil.map(levelOptions || [], function (levelDefine) {
- return new Model(levelDefine, hostModel, hostModel.ecModel);
- });
- }
-
- Tree.prototype = {
-
- constructor: Tree,
-
- type: 'tree',
-
- /**
- * Travel this subtree (include this node).
- * Usage:
- * node.eachNode(function () { ... }); // preorder
- * node.eachNode('preorder', function () { ... }); // preorder
- * node.eachNode('postorder', function () { ... }); // postorder
- * node.eachNode(
- * {order: 'postorder', attr: 'viewChildren'},
- * function () { ... }
- * ); // postorder
- *
- * @param {(Object|string)} options If string, means order.
- * @param {string=} options.order 'preorder' or 'postorder'
- * @param {string=} options.attr 'children' or 'viewChildren'
- * @param {Function} cb
- * @param {Object} [context]
- */
- eachNode: function(options, cb, context) {
- this.root.eachNode(options, cb, context);
- },
-
- /**
- * @param {number} dataIndex
- * @return {module:echarts/data/Tree~TreeNode}
- */
- getNodeByDataIndex: function (dataIndex) {
- var rawIndex = this.data.getRawIndex(dataIndex);
- return this._nodes[rawIndex];
- },
-
- /**
- * @param {string} name
- * @return {module:echarts/data/Tree~TreeNode}
- */
- getNodeByName: function (name) {
- return this.root.getNodeByName(name);
- },
-
- /**
- * Update item available by list,
- * when list has been performed options like 'filterSelf' or 'map'.
- */
- update: function () {
- var data = this.data;
- var nodes = this._nodes;
-
- for (var i = 0, len = nodes.length; i < len; i++) {
- nodes[i].dataIndex = -1;
- }
-
- for (var i = 0, len = data.count(); i < len; i++) {
- nodes[data.getRawIndex(i)].dataIndex = i;
- }
- }
- };
-
- /**
- * data node format:
- * {
- * name: ...
- * value: ...
- * children: [
- * {
- * name: ...
- * value: ...
- * children: ...
- * },
- * ...
- * ]
- * }
- *
- * @static
- * @param {Objec} dataRoot Root node.
- * @param {module:echarts/model/Model} hostModel
- * @param {Array.<Object>} levelOptions
- * @return module:echarts/data/Tree
- */
- Tree.createTree = function (dataRoot, hostModel, levelOptions) {
-
- var tree = new Tree(hostModel, levelOptions);
- var listData = [];
-
- buildHierarchy(dataRoot);
-
- function buildHierarchy(dataNode, parentNode) {
- listData.push(dataNode);
-
- var node = new TreeNode(dataNode.name, listData.length - 1, tree);
- parentNode
- ? addChild(node, parentNode)
- : (tree.root = node);
-
- var children = dataNode.children;
- if (children) {
- for (var i = 0; i < children.length; i++) {
- buildHierarchy(children[i], node);
- }
- }
- }
-
- tree.root.updateDepthAndHeight(0);
-
- var dimensions = completeDimensions([{name: 'value'}], listData);
- var list = new List(dimensions, hostModel);
- list.initData(listData);
-
- linkListHelper.linkToTree(list, tree);
-
- return tree;
- };
-
- /**
- * It is needed to consider the mess of 'list', 'hostModel' when creating a TreeNote,
- * so this function is not ready and not necessary to be public.
- *
- * @param {(module:echarts/data/Tree~TreeNode|Object)} child
- */
- function addChild(child, node) {
- var children = node.children;
- if (child.parentNode === node) {
- return;
- }
-
- children.push(child);
- child.parentNode = node;
-
- node.hostTree._nodes.push(child);
- }
-
- module.exports = Tree;
-
-
-/***/ },
-/* 180 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Link list to graph or tree
- */
-
-
- var zrUtil = __webpack_require__(3);
- var arraySlice = Array.prototype.slice;
-
- // Caution:
- // In most case, only one of the list and its shallow clones (see list.cloneShallow)
- // can be active in echarts process. Considering heap memory consumption,
- // we do not clone tree or graph, but share them among list and its shallow clones.
- // But in some rare case, we have to keep old list (like do animation in chart). So
- // please take care that both the old list and the new list share the same tree/graph.
-
- function linkList(list, target, targetType) {
- zrUtil.each(listProxyMethods, function (method, methodName) {
- var originMethod = list[methodName];
- list[methodName] = zrUtil.curry(method, originMethod, target, targetType);
- });
-
- list[targetType] = target;
- target.data = list;
-
- return list;
- }
-
- var listProxyMethods = {
- cloneShallow: function (originMethod, target, targetType) {
- var newList = originMethod.apply(this, arraySlice.call(arguments, 3));
- return linkList(newList, target, targetType);
- },
- map: function (originMethod, target, targetType) {
- var newList = originMethod.apply(this, arraySlice.call(arguments, 3));
- return linkList(newList, target, targetType);
- },
- filterSelf: function (originMethod, target, targetType) {
- var result = originMethod.apply(this, arraySlice.call(arguments, 3));
- target.update();
- return result;
- }
- };
-
- module.exports = {
- linkToGraph: function (list, graph) {
- linkList(list, graph, 'graph');
- },
-
- linkToTree: function (list, tree) {
- linkList(list, tree, 'tree');
- }
- };
-
-
-/***/ },
-/* 181 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
-
- var helper = {
-
- retrieveTargetInfo: function (payload, seriesModel) {
- if (payload
- && (
- payload.type === 'treemapZoomToNode'
- || payload.type === 'treemapRootToNode'
- )
- ) {
- var root = seriesModel.getData().tree.root;
- var targetNode = payload.targetNode;
- if (targetNode && root.contains(targetNode)) {
- return {node: targetNode};
- }
-
- var targetNodeId = payload.targetNodeId;
- if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) {
- return {node: targetNode};
- }
- }
- },
-
- getPathToRoot: function (node) {
- var path = [];
- while (node) {
- path.push(node);
- node = node.parentNode;
- }
- return path.reverse();
- },
-
- aboveViewRoot: function (viewRoot, node) {
- var viewPath = helper.getPathToRoot(viewRoot);
- return helper.aboveViewRootByViewPath(viewPath, node);
- },
-
- // viewPath should obtained from getPathToRoot(viewRoot)
- aboveViewRootByViewPath: function (viewPath, node) {
- var index = zrUtil.indexOf(viewPath, node);
- // The last one is viewRoot
- return index >= 0 && index !== viewPath.length - 1;
- }
-
- };
-
- module.exports = helper;
-
-
-/***/ },
-/* 182 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var graphic = __webpack_require__(42);
- var DataDiffer = __webpack_require__(95);
- var helper = __webpack_require__(181);
- var Breadcrumb = __webpack_require__(183);
- var RoamController = __webpack_require__(159);
- var BoundingRect = __webpack_require__(15);
- var matrix = __webpack_require__(17);
- var animationUtil = __webpack_require__(184);
- var bind = zrUtil.bind;
- var Group = graphic.Group;
- var Rect = graphic.Rect;
- var each = zrUtil.each;
-
- var DRAG_THRESHOLD = 3;
-
- module.exports = __webpack_require__(1).extendChartView({
-
- type: 'treemap',
-
- /**
- * @override
- */
- init: function (o, api) {
-
- /**
- * @private
- * @type {module:zrender/container/Group}
- */
- this._containerGroup;
-
- /**
- * @private
- * @type {Object.<string, Array.<module:zrender/container/Group>>}
- */
- this._storage = createStorage();
-
- /**
- * @private
- * @type {module:echarts/data/Tree}
- */
- this._oldTree;
-
- /**
- * @private
- * @type {module:echarts/chart/treemap/Breadcrumb}
- */
- this._breadcrumb;
-
- /**
- * @private
- * @type {module:echarts/component/helper/RoamController}
- */
- this._controller;
-
- /**
- * 'ready', 'animating'
- * @private
- */
- this._state = 'ready';
-
- /**
- * @private
- * @type {boolean}
- */
- this._mayClick;
- },
-
- /**
- * @override
- */
- render: function (seriesModel, ecModel, api, payload) {
-
- var models = ecModel.findComponents({
- mainType: 'series', subType: 'treemap', query: payload
- });
- if (zrUtil.indexOf(models, seriesModel) < 0) {
- return;
- }
-
- this.seriesModel = seriesModel;
- this.api = api;
- this.ecModel = ecModel;
-
- var targetInfo = helper.retrieveTargetInfo(payload, seriesModel);
- var payloadType = payload && payload.type;
- var layoutInfo = seriesModel.layoutInfo;
- var isInit = !this._oldTree;
- var thisStorage = this._storage;
-
- // Mark new root when action is treemapRootToNode.
- var reRoot = (payloadType === 'treemapRootToNode' && targetInfo && thisStorage)
- ? {
- rootNodeGroup: thisStorage.nodeGroup[targetInfo.node.getRawIndex()],
- direction: payload.direction
- }
- : null;
-
- var containerGroup = this._giveContainerGroup(layoutInfo);
-
- var renderResult = this._doRender(containerGroup, seriesModel, reRoot);
-
- (
- !isInit && (
- !payloadType
- || payloadType === 'treemapZoomToNode'
- || payloadType === 'treemapRootToNode'
- )
- )
- ? this._doAnimation(containerGroup, renderResult, seriesModel, reRoot)
- : renderResult.renderFinally();
-
- this._resetController(api);
-
- this._renderBreadcrumb(seriesModel, api, targetInfo);
- },
-
- /**
- * @private
- */
- _giveContainerGroup: function (layoutInfo) {
- var containerGroup = this._containerGroup;
- if (!containerGroup) {
- // FIXME
- // 加一层containerGroup是为了clip,但是现在clip功能并没有实现。
- containerGroup = this._containerGroup = new Group();
- this._initEvents(containerGroup);
- this.group.add(containerGroup);
- }
- containerGroup.position = [layoutInfo.x, layoutInfo.y];
-
- return containerGroup;
- },
-
- /**
- * @private
- */
- _doRender: function (containerGroup, seriesModel, reRoot) {
- var thisTree = seriesModel.getData().tree;
- var oldTree = this._oldTree;
-
- // Clear last shape records.
- var lastsForAnimation = createStorage();
- var thisStorage = createStorage();
- var oldStorage = this._storage;
- var willInvisibleEls = [];
- var willVisibleEls = [];
- var willDeleteEls = [];
- var renderNode = bind(
- this._renderNode, this,
- thisStorage, oldStorage, reRoot,
- lastsForAnimation, willInvisibleEls, willVisibleEls
- );
- var viewRoot = seriesModel.getViewRoot();
- var viewPath = helper.getPathToRoot(viewRoot);
-
- // Notice: when thisTree and oldTree are the same tree (see list.cloneShadow),
- // the oldTree is actually losted, so we can not find all of the old graphic
- // elements from tree. So we use this stragegy: make element storage, move
- // from old storage to new storage, clear old storage.
-
- dualTravel(
- thisTree.root ? [thisTree.root] : [],
- (oldTree && oldTree.root) ? [oldTree.root] : [],
- containerGroup,
- thisTree === oldTree || !oldTree,
- 0
- );
-
- // Process all removing.
- var willDeleteEls = clearStorage(oldStorage);
-
- this._oldTree = thisTree;
- this._storage = thisStorage;
-
- return {
- lastsForAnimation: lastsForAnimation,
- willDeleteEls: willDeleteEls,
- renderFinally: renderFinally
- };
-
- function dualTravel(thisViewChildren, oldViewChildren, parentGroup, sameTree, viewPathIndex) {
- // When 'render' is triggered by action,
- // 'this' and 'old' may be the same tree,
- // we use rawIndex in that case.
- if (sameTree) {
- oldViewChildren = thisViewChildren;
- each(thisViewChildren, function (child, index) {
- !child.isRemoved() && processNode(index, index);
- });
- }
- // Diff hierarchically (diff only in each subtree, but not whole).
- // because, consistency of view is important.
- else {
- (new DataDiffer(oldViewChildren, thisViewChildren, getKey, getKey))
- .add(processNode)
- .update(processNode)
- .remove(zrUtil.curry(processNode, null))
- .execute();
- }
-
- function getKey(node) {
- // Identify by name or raw index.
- return node.getId();
- }
-
- function processNode(newIndex, oldIndex) {
- var thisNode = newIndex != null ? thisViewChildren[newIndex] : null;
- var oldNode = oldIndex != null ? oldViewChildren[oldIndex] : null;
-
- // Whether under viewRoot.
- if (!thisNode
- || isNaN(viewPathIndex)
- || (viewPathIndex < viewPath.length && viewPath[viewPathIndex] !== thisNode)
- ) {
- // Deleting nodes will be performed finally. This method just find
- // element from old storage, or create new element, set them to new
- // storage, and set styles.
- return;
- }
-
- var group = renderNode(thisNode, oldNode, parentGroup);
-
- group && dualTravel(
- thisNode && thisNode.viewChildren || [],
- oldNode && oldNode.viewChildren || [],
- group,
- sameTree,
- viewPathIndex + 1
- );
- }
- }
-
- function clearStorage(storage) {
- var willDeleteEls = createStorage();
- storage && each(storage, function (store, storageName) {
- var delEls = willDeleteEls[storageName];
- each(store, function (el) {
- el && (delEls.push(el), el.__tmWillDelete = storageName);
- });
- });
- return willDeleteEls;
- }
-
- function renderFinally() {
- each(willDeleteEls, function (els) {
- each(els, function (el) {
- el.parent && el.parent.remove(el);
- });
- });
- // Theoritically there is no intersection between willInvisibleEls
- // and willVisibleEls have, but we set visible after for robustness.
- each(willInvisibleEls, function (el) {
- el.invisible = true;
- // Setting invisible is for optimizing, so no need to set dirty,
- // just mark as invisible.
- el.dirty();
- });
- each(willVisibleEls, function (el) {
- el.invisible = false;
- el.__tmWillVisible = false;
- el.dirty();
- });
- }
- },
-
- /**
- * @private
- */
- _renderNode: function (
- thisStorage, oldStorage, reRoot,
- lastsForAnimation, willInvisibleEls, willVisibleEls,
- thisNode, oldNode, parentGroup
- ) {
- var thisRawIndex = thisNode && thisNode.getRawIndex();
- var oldRawIndex = oldNode && oldNode.getRawIndex();
-
- var layout = thisNode.getLayout();
- var thisWidth = layout.width;
- var thisHeight = layout.height;
- var invisible = layout.invisible;
-
- // Node group
- var group = giveGraphic('nodeGroup', Group);
- if (!group) {
- return;
- }
- parentGroup.add(group);
- group.position = [layout.x, layout.y];
- group.__tmNodeWidth = thisWidth;
- group.__tmNodeHeight = thisHeight;
-
- // Background
- var bg = giveGraphic('background', Rect, 0);
- if (bg) {
- bg.setShape({x: 0, y: 0, width: thisWidth, height: thisHeight});
- updateStyle(bg, {fill: thisNode.getVisual('borderColor', true)});
- group.add(bg);
- }
-
- var thisViewChildren = thisNode.viewChildren;
-
- // No children, render content.
- if (!thisViewChildren || !thisViewChildren.length) {
- var borderWidth = layout.borderWidth;
- var content = giveGraphic('content', Rect, 3);
- if (content) {
- var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0);
- var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0);
- var labelModel = thisNode.getModel('label.normal');
- var textStyleModel = thisNode.getModel('label.normal.textStyle');
- var hoverStyle = thisNode.getModel('itemStyle.emphasis').getItemStyle();
- var text = thisNode.getModel().get('name');
- var textRect = textStyleModel.getTextRect(text);
- var showLabel = labelModel.get('show');
-
- if (!showLabel || textRect.height > contentHeight) {
- text = '';
- }
- else if (textRect.width > contentWidth) {
- text = textStyleModel.get('ellipsis')
- ? textStyleModel.ellipsis(text, contentWidth) : '';
- }
-
- graphic.setHoverStyle(content, hoverStyle);
-
- // For tooltip.
- content.dataIndex = thisNode.dataIndex;
- content.seriesIndex = this.seriesModel.seriesIndex;
-
- content.culling = true;
- content.setShape({
- x: borderWidth,
- y: borderWidth,
- width: contentWidth,
- height: contentHeight
- });
-
- updateStyle(content, {
- fill: thisNode.getVisual('color', true),
- text: text,
- textPosition: labelModel.get('position'),
- textFill: textStyleModel.getTextColor(),
- textAlign: textStyleModel.get('align'),
- textVerticalAlign: textStyleModel.get('baseline'),
- textFont: textStyleModel.getFont()
- });
- group.add(content);
- }
- }
-
- return group;
-
- function giveGraphic(storageName, Ctor, z) {
- var element = oldRawIndex != null && oldStorage[storageName][oldRawIndex];
- var lasts = lastsForAnimation[storageName];
-
- if (element) {
- // Remove from oldStorage
- oldStorage[storageName][oldRawIndex] = null;
- prepareAnimationWhenHasOld(lasts, element, storageName);
- }
- // If invisible and no old element, do not create new element (for optimizing).
- else if (!invisible) {
- element = new Ctor({z: z});
- prepareAnimationWhenNoOld(lasts, element, storageName);
- }
-
- // Set to thisStorage
- return (thisStorage[storageName][thisRawIndex] = element);
- }
-
- function prepareAnimationWhenHasOld(lasts, element, storageName) {
- var lastCfg = lasts[thisRawIndex] = {};
- lastCfg.old = storageName === 'nodeGroup'
- ? element.position.slice()
- : zrUtil.extend({}, element.shape);
- }
-
- // If a element is new, we need to find the animation start point carefully,
- // otherwise it will looks strange when 'zoomToNode'.
- function prepareAnimationWhenNoOld(lasts, element, storageName) {
- // New background do not animate but delay show.
- if (storageName === 'background') {
- element.invisible = true;
- element.__tmWillVisible = true;
- willVisibleEls.push(element);
- }
- else {
- var lastCfg = lasts[thisRawIndex] = {};
- var parentNode = thisNode.parentNode;
-
- if (parentNode && (!reRoot || reRoot.direction === 'drilldown')) {
- var parentOldX = 0;
- var parentOldY = 0;
- // For convenience, get old bounding rect from background.
- var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()];
-
- if (parentOldBg && parentOldBg.old) {
- parentOldX = parentOldBg.old.width / 2; // Devided by 2 for reRoot effect.
- parentOldY = parentOldBg.old.height / 2;
- }
- // When no parent old shape found, its parent is new too,
- // so we can just use {x:0, y:0}.
- lastCfg.old = storageName === 'nodeGroup'
- ? [parentOldX, parentOldY]
- : {x: parentOldX, y: parentOldY, width: 0, height: 0};
- }
-
- // Fade in, user can be aware that these nodes are new.
- lastCfg.fadein = storageName !== 'nodeGroup';
- }
- }
-
- function updateStyle(element, style) {
- if (!invisible) {
- // If invisible, do not set visual, otherwise the element will
- // change immediately before animation. We think it is OK to
- // remain its origin color when moving out of the view window.
- element.setStyle(style);
- if (!element.__tmWillVisible) {
- element.invisible = false;
- }
- }
- else {
- // Delay invisible setting utill animation finished,
- // avoid element vanish suddenly before animation.
- !element.invisible && willInvisibleEls.push(element);
- }
- }
- },
-
- /**
- * @private
- */
- _doAnimation: function (containerGroup, renderResult, seriesModel, reRoot) {
- if (!seriesModel.get('animation')) {
- return;
- }
-
- var duration = seriesModel.get('animationDurationUpdate');
- var easing = seriesModel.get('animationEasing');
- var animationWrap = animationUtil.createWrap();
-
- // Make delete animations.
- each(renderResult.willDeleteEls, function (store, storageName) {
- each(store, function (el, rawIndex) {
- var storageName;
-
- if (el.invisible || !(storageName = el.__tmWillDelete)) {
- return;
- }
-
- var parent = el.parent; // Always has parent, and parent is nodeGroup.
- var target;
-
- if (reRoot && reRoot.direction === 'drilldown') {
- if (parent === reRoot.rootNodeGroup) {
- // Only 'content' will enter this branch, but not nodeGroup.
- target = {
- shape: {
- x: 0, y: 0,
- width: parent.__tmNodeWidth, height: parent.__tmNodeHeight
- }
- };
- el.z = 2;
- }
- else {
- target = {style: {opacity: 0}};
- el.z = 1;
- }
- }
- else {
- var targetX = 0;
- var targetY = 0;
-
- if (!parent.__tmWillDelete) {
- // Let node animate to right-bottom corner, cooperating with fadeout,
- // which is appropriate for user understanding.
- // Divided by 2 for reRoot rollup effect.
- targetX = parent.__tmNodeWidth / 2;
- targetY = parent.__tmNodeHeight / 2;
- }
- target = storageName === 'nodeGroup'
- ? {position: [targetX, targetY], style: {opacity: 0}}
- : {
- shape: {x: targetX, y: targetY, width: 0, height: 0},
- style: {opacity: 0}
- };
- }
-
- target && animationWrap.add(el, target, duration, easing);
- });
- });
-
- // Make other animations
- each(this._storage, function (store, storageName) {
- each(store, function (el, rawIndex) {
- var last = renderResult.lastsForAnimation[storageName][rawIndex];
- var target = {};
-
- if (!last) {
- return;
- }
-
- if (storageName === 'nodeGroup') {
- if (last.old) {
- target.position = el.position.slice();
- el.position = last.old;
- }
- }
- else {
- if (last.old) {
- target.shape = zrUtil.extend({}, el.shape);
- el.setShape(last.old);
- }
-
- if (last.fadein) {
- el.setStyle('opacity', 0);
- target.style = {opacity: 1};
- }
- // When animation is stopped for succedent animation starting,
- // el.style.opacity might not be 1
- else if (el.style.opacity !== 1) {
- target.style = {opacity: 1};
- }
- }
- animationWrap.add(el, target, duration, easing);
- });
- }, this);
-
- this._state = 'animating';
-
- animationWrap
- .done(bind(function () {
- this._state = 'ready';
- renderResult.renderFinally();
- }, this))
- .start();
- },
-
- /**
- * @private
- */
- _resetController: function (api) {
- var controller = this._controller;
-
- // Init controller.
- if (!controller) {
- controller = this._controller = new RoamController(api.getZr());
- controller.enable(this.seriesModel.get('roam'));
- controller.on('pan', bind(this._onPan, this));
- controller.on('zoom', bind(this._onZoom, this));
- }
-
- controller.rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight());
- },
-
- /**
- * @private
- */
- _clearController: function () {
- var controller = this._controller;
- if (controller) {
- controller.off('pan').off('zoom');
- controller = null;
- }
- },
-
- /**
- * @private
- */
- _onPan: function (dx, dy) {
- this._mayClick = false;
-
- if (this._state !== 'animating'
- && (Math.abs(dx) > DRAG_THRESHOLD || Math.abs(dy) > DRAG_THRESHOLD)
- ) {
- // These param must not be cached.
- var viewRoot = this.seriesModel.getViewRoot();
-
- if (!viewRoot) {
- return;
- }
-
- var rootLayout = viewRoot.getLayout();
-
- if (!rootLayout) {
- return;
- }
-
- this.api.dispatchAction({
- type: 'treemapMove',
- from: this.uid,
- seriesId: this.seriesModel.id,
- rootRect: {
- x: rootLayout.x + dx, y: rootLayout.y + dy,
- width: rootLayout.width, height: rootLayout.height
- }
- });
- }
- },
-
- /**
- * @private
- */
- _onZoom: function (scale, mouseX, mouseY) {
- this._mayClick = false;
-
- if (this._state !== 'animating') {
- // These param must not be cached.
- var viewRoot = this.seriesModel.getViewRoot();
-
- if (!viewRoot) {
- return;
- }
-
- var rootLayout = viewRoot.getLayout();
-
- if (!rootLayout) {
- return;
- }
-
- var rect = new BoundingRect(
- rootLayout.x, rootLayout.y, rootLayout.width, rootLayout.height
- );
- var layoutInfo = this.seriesModel.layoutInfo;
-
- // Transform mouse coord from global to containerGroup.
- mouseX -= layoutInfo.x;
- mouseY -= layoutInfo.y;
-
- // Scale root bounding rect.
- var m = matrix.create();
- matrix.translate(m, m, [-mouseX, -mouseY]);
- matrix.scale(m, m, [scale, scale]);
- matrix.translate(m, m, [mouseX, mouseY]);
-
- rect.applyTransform(m);
-
- this.api.dispatchAction({
- type: 'treemapRender',
- from: this.uid,
- seriesId: this.seriesModel.id,
- rootRect: {
- x: rect.x, y: rect.y,
- width: rect.width, height: rect.height
- }
- });
- }
- },
-
- /**
- * @private
- */
- _initEvents: function (containerGroup) {
- // FIXME
- // 不用click以及silent的原因是,animate时视图设置silent true来避免click生效,
- // 但是animate中,按下鼠标,animate结束后(silent设回为false)松开鼠标,
- // 还是会触发click,期望是不触发。
-
- // Mousedown occurs when drag start, and mouseup occurs when drag end,
- // click event should not be triggered in that case.
-
- containerGroup.on('mousedown', function (e) {
- this._state === 'ready' && (this._mayClick = true);
- }, this);
- containerGroup.on('mouseup', function (e) {
- if (this._mayClick) {
- this._mayClick = false;
- this._state === 'ready' && onClick.call(this, e);
- }
- }, this);
-
- function onClick(e) {
- var nodeClick = this.seriesModel.get('nodeClick', true);
-
- if (!nodeClick) {
- return;
- }
-
- var targetInfo = this.findTarget(e.offsetX, e.offsetY);
-
- if (!targetInfo) {
- return;
- }
-
- var node = targetInfo.node;
- if (node.getLayout().isLeafRoot) {
- this._rootToNode(targetInfo);
- }
- else {
- if (nodeClick === 'zoomToNode') {
- this._zoomToNode(targetInfo);
- }
- else if (nodeClick === 'link') {
- var itemModel = node.hostTree.data.getItemModel(node.dataIndex);
- var link = itemModel.get('link', true);
- var linkTarget = itemModel.get('target', true) || 'blank';
- link && window.open(link, linkTarget);
- }
- }
- }
- },
-
- /**
- * @private
- */
- _renderBreadcrumb: function (seriesModel, api, targetInfo) {
- if (!targetInfo) {
- // Find breadcrumb tail on center of containerGroup.
- targetInfo = this.findTarget(api.getWidth() / 2, api.getHeight() / 2);
-
- if (!targetInfo) {
- targetInfo = {node: seriesModel.getData().tree.root};
- }
- }
-
- (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group, bind(onSelect, this))))
- .render(seriesModel, api, targetInfo.node);
-
- function onSelect(node) {
- if (this._state !== 'animating') {
- helper.aboveViewRoot(seriesModel.getViewRoot(), node)
- ? this._rootToNode({node: node})
- : this._zoomToNode({node: node});
- }
- }
- },
-
- /**
- * @override
- */
- remove: function () {
- this._clearController();
- this._containerGroup && this._containerGroup.removeAll();
- this._storage = createStorage();
- this._state = 'ready';
- this._breadcrumb && this._breadcrumb.remove();
- },
-
- dispose: function () {
- this._clearController();
- },
-
- /**
- * @private
- */
- _zoomToNode: function (targetInfo) {
- this.api.dispatchAction({
- type: 'treemapZoomToNode',
- from: this.uid,
- seriesId: this.seriesModel.id,
- targetNode: targetInfo.node
- });
- },
-
- /**
- * @private
- */
- _rootToNode: function (targetInfo) {
- this.api.dispatchAction({
- type: 'treemapRootToNode',
- from: this.uid,
- seriesId: this.seriesModel.id,
- targetNode: targetInfo.node
- });
- },
-
- /**
- * @public
- * @param {number} x Global coord x.
- * @param {number} y Global coord y.
- * @return {Object} info If not found, return undefined;
- * @return {number} info.node Target node.
- * @return {number} info.offsetX x refer to target node.
- * @return {number} info.offsetY y refer to target node.
- */
- findTarget: function (x, y) {
- var targetInfo;
- var viewRoot = this.seriesModel.getViewRoot();
-
- viewRoot.eachNode({attr: 'viewChildren', order: 'preorder'}, function (node) {
- var bgEl = this._storage.background[node.getRawIndex()];
- // If invisible, there might be no element.
- if (bgEl) {
- var point = bgEl.transformCoordToLocal(x, y);
- var shape = bgEl.shape;
-
- // For performance consideration, dont use 'getBoundingRect'.
- if (shape.x <= point[0]
- && point[0] <= shape.x + shape.width
- && shape.y <= point[1]
- && point[1] <= shape.y + shape.height
- ) {
- targetInfo = {node: node, offsetX: point[0], offsetY: point[1]};
- }
- else {
- return false; // Suppress visit subtree.
- }
- }
- }, this);
-
- return targetInfo;
- }
-
- });
-
- function createStorage() {
- return {nodeGroup: [], background: [], content: []};
- }
-
-
-
-/***/ },
-/* 183 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var graphic = __webpack_require__(42);
- var layout = __webpack_require__(21);
- var zrUtil = __webpack_require__(3);
-
- var TEXT_PADDING = 8;
- var ITEM_GAP = 8;
- var ARRAY_LENGTH = 5;
-
- function Breadcrumb(containerGroup, onSelect) {
- /**
- * @private
- * @type {module:zrender/container/Group}
- */
- this.group = new graphic.Group();
-
- containerGroup.add(this.group);
-
- /**
- * @private
- * @type {Function}
- */
- this._onSelect = onSelect || zrUtil.noop;
- }
-
- Breadcrumb.prototype = {
-
- constructor: Breadcrumb,
-
- render: function (seriesModel, api, targetNode) {
- var model = seriesModel.getModel('breadcrumb');
- var thisGroup = this.group;
-
- thisGroup.removeAll();
-
- if (!model.get('show') || !targetNode) {
- return;
- }
-
- var normalStyleModel = model.getModel('itemStyle.normal');
- // var emphasisStyleModel = model.getModel('itemStyle.emphasis');
- var textStyleModel = normalStyleModel.getModel('textStyle');
-
- var layoutParam = {
- pos: {
- left: model.get('left'),
- right: model.get('right'),
- top: model.get('top'),
- bottom: model.get('bottom')
- },
- box: {
- width: api.getWidth(),
- height: api.getHeight()
- },
- emptyItemWidth: model.get('emptyItemWidth'),
- totalWidth: 0,
- renderList: []
- };
-
- this._prepare(
- model, targetNode, layoutParam, textStyleModel
- );
- this._renderContent(
- model, targetNode, layoutParam, normalStyleModel, textStyleModel
- );
-
- layout.positionGroup(thisGroup, layoutParam.pos, layoutParam.box);
- },
-
- /**
- * Prepare render list and total width
- * @private
- */
- _prepare: function (model, targetNode, layoutParam, textStyleModel) {
- for (var node = targetNode; node; node = node.parentNode) {
- var text = node.getModel().get('name');
- var textRect = textStyleModel.getTextRect(text);
- var itemWidth = Math.max(
- textRect.width + TEXT_PADDING * 2,
- layoutParam.emptyItemWidth
- );
- layoutParam.totalWidth += itemWidth + ITEM_GAP;
- layoutParam.renderList.push({node: node, text: text, width: itemWidth});
- }
- },
-
- /**
- * @private
- */
- _renderContent: function (
- model, targetNode, layoutParam, normalStyleModel, textStyleModel
- ) {
- // Start rendering.
- var lastX = 0;
- var emptyItemWidth = layoutParam.emptyItemWidth;
- var height = model.get('height');
- var availableSize = layout.getAvailableSize(layoutParam.pos, layoutParam.box);
- var totalWidth = layoutParam.totalWidth;
- var renderList = layoutParam.renderList;
-
- for (var i = renderList.length - 1; i >= 0; i--) {
- var item = renderList[i];
- var itemWidth = item.width;
- var text = item.text;
-
- // Hdie text and shorten width if necessary.
- if (totalWidth > availableSize.width) {
- totalWidth -= itemWidth - emptyItemWidth;
- itemWidth = emptyItemWidth;
- text = '';
- }
-
- this.group.add(new graphic.Polygon({
- shape: {
- points: makeItemPoints(
- lastX, 0, itemWidth, height,
- i === renderList.length - 1, i === 0
- )
- },
- style: zrUtil.defaults(
- normalStyleModel.getItemStyle(),
- {
- lineJoin: 'bevel',
- text: text,
- textFill: textStyleModel.getTextColor(),
- textFont: textStyleModel.getFont()
- }
- ),
- z: 10,
- onclick: zrUtil.bind(this._onSelect, this, item.node)
- }));
-
- lastX += itemWidth + ITEM_GAP;
- }
- },
-
- /**
- * @override
- */
- remove: function () {
- this.group.removeAll();
- }
- };
-
- function makeItemPoints(x, y, itemWidth, itemHeight, head, tail) {
- var points = [
- [head ? x : x - ARRAY_LENGTH, y],
- [x + itemWidth, y],
- [x + itemWidth, y + itemHeight],
- [head ? x : x - ARRAY_LENGTH, y + itemHeight]
- ];
- !tail && points.splice(2, 0, [x + itemWidth + ARRAY_LENGTH, y + itemHeight / 2]);
- !head && points.push([x, y + itemHeight / 2]);
- return points;
- }
-
- module.exports = Breadcrumb;
-
-
-/***/ },
-/* 184 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
-
- /**
- * @param {number} [time=500] Time in ms
- * @param {string} [easing='linear']
- * @param {number} [delay=0]
- * @param {Function} [callback]
- *
- * @example
- * // Animate position
- * animation
- * .createWrap()
- * .add(el1, {position: [10, 10]})
- * .add(el2, {shape: {width: 500}, style: {fill: 'red'}}, 400)
- * .done(function () { // done })
- * .start('cubicOut');
- */
- function createWrap() {
-
- var storage = [];
- var elExistsMap = {};
- var doneCallback;
-
- return {
-
- /**
- * Caution: a el can only be added once, otherwise 'done'
- * might not be called. This method checks this (by el.id),
- * suppresses adding and returns false when existing el found.
- *
- * @param {modele:zrender/Element} el
- * @param {Object} target
- * @param {number} [time=500]
- * @param {number} [delay=0]
- * @param {string} [easing='linear']
- * @return {boolean} Whether adding succeeded.
- *
- * @example
- * add(el, target, time, delay, easing);
- * add(el, target, time, easing);
- * add(el, target, time);
- * add(el, target);
- */
- add: function (el, target, time, delay, easing) {
- if (zrUtil.isString(delay)) {
- easing = delay;
- delay = 0;
- }
-
- if (elExistsMap[el.id]) {
- return false;
- }
- elExistsMap[el.id] = 1;
-
- storage.push(
- {el: el, target: target, time: time, delay: delay, easing: easing}
- );
-
- return true;
- },
-
- /**
- * Only execute when animation finished. Will not execute when any
- * of 'stop' or 'stopAnimation' called.
- *
- * @param {Function} callback
- */
- done: function (callback) {
- doneCallback = callback;
- return this;
- },
-
- /**
- * Will stop exist animation firstly.
- */
- start: function () {
- var count = storage.length;
-
- for (var i = 0, len = storage.length; i < len; i++) {
- var item = storage[i];
- item.el.animateTo(item.target, item.time, item.delay, item.easing, done);
- }
-
- return this;
-
- function done() {
- count--;
- if (!count) {
- storage.length = 0;
- elExistsMap = {};
- doneCallback && doneCallback();
- }
- }
- }
- };
- }
-
- module.exports = {createWrap: createWrap};
-
-
-/***/ },
-/* 185 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Treemap action
- */
-
-
- var echarts = __webpack_require__(1);
- var helper = __webpack_require__(181);
-
- var noop = function () {};
-
- var actionTypes = [
- 'treemapZoomToNode',
- 'treemapRender',
- 'treemapMove'
- ];
-
- for (var i = 0; i < actionTypes.length; i++) {
- echarts.registerAction({type: actionTypes[i], update: 'updateView'}, noop);
- }
-
- echarts.registerAction(
- {type: 'treemapRootToNode', update: 'updateView'},
- function (payload, ecModel) {
- ecModel.eachComponent(
- {mainType: 'series', subType: 'treemap', query: payload},
- function (model, index) {
- var targetInfo = helper.retrieveTargetInfo(payload, model);
-
- if (targetInfo) {
- var originViewRoot = model.getViewRoot();
- if (originViewRoot) {
- payload.direction = helper.aboveViewRoot(originViewRoot, targetInfo.node)
- ? 'rollup' : 'drilldown';
- }
- model.resetViewRoot(targetInfo.node);
- }
- }
- );
- }
- );
-
-
-
-/***/ },
-/* 186 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var VisualMapping = __webpack_require__(187);
- var zrColor = __webpack_require__(38);
- var zrUtil = __webpack_require__(3);
- var isArray = zrUtil.isArray;
-
- var ITEM_STYLE_NORMAL = 'itemStyle.normal';
-
- module.exports = function (ecModel, payload) {
-
- var condition = {mainType: 'series', subType: 'treemap', query: payload};
- ecModel.eachComponent(condition, function (seriesModel) {
-
- var tree = seriesModel.getData().tree;
- var root = tree.root;
- var seriesItemStyleModel = seriesModel.getModel(ITEM_STYLE_NORMAL);
-
- if (root.isRemoved()) {
- return;
- }
-
- var levelItemStyles = zrUtil.map(tree.levelModels, function (levelModel) {
- return levelModel ? levelModel.get(ITEM_STYLE_NORMAL) : null;
- });
-
- travelTree(
- root,
- {},
- levelItemStyles,
- seriesItemStyleModel,
- seriesModel.getViewRoot().getAncestors(),
- seriesModel
- );
- });
- };
-
- function travelTree(
- node, designatedVisual, levelItemStyles, seriesItemStyleModel,
- viewRootAncestors, seriesModel
- ) {
- var nodeModel = node.getModel();
- var nodeLayout = node.getLayout();
-
- // Optimize
- if (nodeLayout.invisible) {
- return;
- }
-
- var nodeItemStyleModel = node.getModel(ITEM_STYLE_NORMAL);
- var levelItemStyle = levelItemStyles[node.depth];
- var visuals = buildVisuals(
- nodeItemStyleModel, designatedVisual, levelItemStyle, seriesItemStyleModel
- );
-
- // calculate border color
- var borderColor = nodeItemStyleModel.get('borderColor');
- var borderColorSaturation = nodeItemStyleModel.get('borderColorSaturation');
- var thisNodeColor;
- if (borderColorSaturation != null) {
- // For performance, do not always execute 'calculateColor'.
- thisNodeColor = calculateColor(visuals, node);
- borderColor = calculateBorderColor(borderColorSaturation, thisNodeColor);
- }
- node.setVisual('borderColor', borderColor);
-
- var viewChildren = node.viewChildren;
- if (!viewChildren || !viewChildren.length) {
- thisNodeColor = calculateColor(visuals, node);
- // Apply visual to this node.
- node.setVisual('color', thisNodeColor);
- }
- else {
- var mapping = buildVisualMapping(
- node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren
- );
- // Designate visual to children.
- zrUtil.each(viewChildren, function (child, index) {
- // If higher than viewRoot, only ancestors of viewRoot is needed to visit.
- if (child.depth >= viewRootAncestors.length
- || child === viewRootAncestors[child.depth]
- ) {
- var childVisual = mapVisual(
- nodeModel, visuals, child, index, mapping, seriesModel
- );
- travelTree(
- child, childVisual, levelItemStyles, seriesItemStyleModel,
- viewRootAncestors, seriesModel
- );
- }
- });
- }
- }
-
- function buildVisuals(
- nodeItemStyleModel, designatedVisual, levelItemStyle, seriesItemStyleModel
- ) {
- var visuals = zrUtil.extend({}, designatedVisual);
-
- zrUtil.each(['color', 'colorAlpha', 'colorSaturation'], function (visualName) {
- // Priority: thisNode > thisLevel > parentNodeDesignated > seriesModel
- var val = nodeItemStyleModel.get(visualName, true); // Ignore parent
- val == null && levelItemStyle && (val = levelItemStyle[visualName]);
- val == null && (val = designatedVisual[visualName]);
- val == null && (val = seriesItemStyleModel.get(visualName));
-
- val != null && (visuals[visualName] = val);
- });
-
- return visuals;
- }
-
- function calculateColor(visuals) {
- var color = getValueVisualDefine(visuals, 'color');
-
- if (color) {
- var colorAlpha = getValueVisualDefine(visuals, 'colorAlpha');
- var colorSaturation = getValueVisualDefine(visuals, 'colorSaturation');
- if (colorSaturation) {
- color = zrColor.modifyHSL(color, null, null, colorSaturation);
- }
- if (colorAlpha) {
- color = zrColor.modifyAlpha(color, colorAlpha);
- }
-
- return color;
- }
- }
-
- function calculateBorderColor(borderColorSaturation, thisNodeColor) {
- return thisNodeColor != null
- ? zrColor.modifyHSL(thisNodeColor, null, null, borderColorSaturation)
- : null;
- }
-
- function getValueVisualDefine(visuals, name) {
- var value = visuals[name];
- if (value != null && value !== 'none') {
- return value;
- }
- }
-
- function buildVisualMapping(
- node, nodeModel, nodeLayout, nodeItemStyleModel, visuals, viewChildren
- ) {
- if (!viewChildren || !viewChildren.length) {
- return;
- }
-
- var rangeVisual = getRangeVisual(nodeModel, 'color')
- || (
- visuals.color != null
- && visuals.color !== 'none'
- && (
- getRangeVisual(nodeModel, 'colorAlpha')
- || getRangeVisual(nodeModel, 'colorSaturation')
- )
- );
-
- if (!rangeVisual) {
- return;
- }
-
- var colorMappingBy = nodeModel.get('colorMappingBy');
- var opt = {
- type: rangeVisual.name,
- dataExtent: nodeLayout.dataExtent,
- visual: rangeVisual.range
- };
- if (opt.type === 'color'
- && (colorMappingBy === 'index' || colorMappingBy === 'id')
- ) {
- opt.mappingMethod = 'category';
- opt.loop = true;
- // categories is ordinal, so do not set opt.categories.
- }
- else {
- opt.mappingMethod = 'linear';
- }
-
- var mapping = new VisualMapping(opt);
- mapping.__drColorMappingBy = colorMappingBy;
-
- return mapping;
- }
-
- // Notice: If we dont have the attribute 'colorRange', but only use
- // attribute 'color' to represent both concepts of 'colorRange' and 'color',
- // (It means 'colorRange' when 'color' is Array, means 'color' when not array),
- // this problem will be encountered:
- // If a level-1 node dont have children, and its siblings has children,
- // and colorRange is set on level-1, then the node can not be colored.
- // So we separate 'colorRange' and 'color' to different attributes.
- function getRangeVisual(nodeModel, name) {
- // 'colorRange', 'colorARange', 'colorSRange'.
- // If not exsits on this node, fetch from levels and series.
- var range = nodeModel.get(name);
- return (isArray(range) && range.length) ? {name: name, range: range} : null;
- }
-
- function mapVisual(nodeModel, visuals, child, index, mapping, seriesModel) {
- var childVisuals = zrUtil.extend({}, visuals);
-
- if (mapping) {
- var mappingType = mapping.type;
- var colorMappingBy = mappingType === 'color' && mapping.__drColorMappingBy;
- var value =
- colorMappingBy === 'index'
- ? index
- : colorMappingBy === 'id'
- ? seriesModel.mapIdToIndex(child.getId())
- : child.getValue(nodeModel.get('visualDimension'));
-
- childVisuals[mappingType] = mapping.mapValueToVisual(value);
- }
-
- return childVisuals;
- }
-
-
-
-/***/ },
-/* 187 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Visual mapping.
- */
-
-
- var zrUtil = __webpack_require__(3);
- var zrColor = __webpack_require__(38);
- var linearMap = __webpack_require__(7).linearMap;
- var each = zrUtil.each;
- var isObject = zrUtil.isObject;
-
- var CATEGORY_DEFAULT_VISUAL_INDEX = -1;
-
- function linearMapArray(val, domain, range, clamp) {
- if (zrUtil.isArray(val)) {
- return zrUtil.map(val, function (v) {
- return linearMap(v, domain, range, clamp);
- });
- }
- return linearMap(val, domain, range, clamp);
- }
- /**
- * @param {Object} option
- * @param {string} [option.type] See visualHandlers.
- * @param {string} [option.mappingMethod] 'linear' or 'piecewise' or 'category'
- * @param {Array.<number>=} [option.dataExtent] [minExtent, maxExtent],
- * required when mappingMethod is 'linear'
- * @param {Array.<Object>=} [option.pieceList] [
- * {value: someValue},
- * {interval: [min1, max1], visual: {...}},
- * {interval: [min2, max2]}
- * ],
- * required when mappingMethod is 'piecewise'.
- * Visual for only each piece can be specified.
- * @param {Array.<string|Object>=} [option.categories] ['cate1', 'cate2']
- * required when mappingMethod is 'category'.
- * If no option.categories, it represents
- * categories is [0, 1, 2, ...].
- * @param {boolean} [option.loop=false] Whether loop mapping when mappingMethod is 'category'.
- * @param {(Array|Object|*)} [option.visual] Visual data.
- * when mappingMethod is 'category',
- * visual data can be array or object
- * (like: {cate1: '#222', none: '#fff'})
- * or primary types (which represents
- * defualt category visual), otherwise visual
- * can only be array.
- *
- */
- var VisualMapping = function (option) {
- var mappingMethod = option.mappingMethod;
- var visualType = option.type;
-
- /**
- * @readOnly
- * @type {string}
- */
- this.type = visualType;
-
- /**
- * @readOnly
- * @type {string}
- */
- this.mappingMethod = mappingMethod;
-
- /**
- * @readOnly
- * @type {Object}
- */
- var thisOption = this.option = zrUtil.clone(option);
-
- /**
- * @private
- * @type {Function}
- */
- this._normalizeData = normalizers[mappingMethod];
-
- /**
- * @private
- * @type {Function}
- */
- this._getSpecifiedVisual = zrUtil.bind(
- specifiedVisualGetters[mappingMethod], this, visualType
- );
-
- zrUtil.extend(this, visualHandlers[visualType]);
-
- if (mappingMethod === 'piecewise') {
- preprocessForPiecewise(thisOption);
- }
- if (mappingMethod === 'category') {
- preprocessForCategory(thisOption);
- }
- };
-
- VisualMapping.prototype = {
-
- constructor: VisualMapping,
-
- applyVisual: null,
-
- isValueActive: null,
-
- mapValueToVisual: null,
-
- getNormalizer: function () {
- return zrUtil.bind(this._normalizeData, this);
- }
- };
-
- var visualHandlers = VisualMapping.visualHandlers = {
-
- color: {
-
- applyVisual: defaultApplyColor,
-
- /**
- * Create a mapper function
- * @return {Function}
- */
- getColorMapper: function () {
- var visual = isCategory(this)
- ? this.option.visual
- : zrUtil.map(this.option.visual, zrColor.parse);
- return zrUtil.bind(
- isCategory(this)
- ? function (value, isNormalized) {
- !isNormalized && (value = this._normalizeData(value));
- return getVisualForCategory(this, visual, value);
- }
- : function (value, isNormalized, out) {
- // If output rgb array
- // which will be much faster and useful in pixel manipulation
- var returnRGBArray = !!out;
- !isNormalized && (value = this._normalizeData(value));
- out = zrColor.fastMapToColor(value, visual, out);
- return returnRGBArray ? out : zrUtil.stringify(out, 'rgba');
- }, this);
- },
-
- // value:
- // (1) {number}
- // (2) {Array.<number>} Represents a interval, for colorStops.
- // Return type:
- // (1) {string} color value like '#444'
- // (2) {Array.<Object>} colorStops,
- // like [{color: '#fff', offset: 0}, {color: '#444', offset: 1}]
- // where offset is between 0 and 1.
- mapValueToVisual: function (value) {
- var visual = this.option.visual;
-
- if (zrUtil.isArray(value)) {
- value = [
- this._normalizeData(value[0]),
- this._normalizeData(value[1])
- ];
-
- // For creating gradient color list.
- return zrColor.mapIntervalToColor(value, visual);
- }
- else {
- var normalized = this._normalizeData(value);
- var result = this._getSpecifiedVisual(value);
-
- if (result == null) {
- result = isCategory(this)
- ? getVisualForCategory(this, visual, normalized)
- : zrColor.mapToColor(normalized, visual);
- }
-
- return result;
- }
- }
- },
-
- colorHue: makePartialColorVisualHandler(function (color, value) {
- return zrColor.modifyHSL(color, value);
- }),
-
- colorSaturation: makePartialColorVisualHandler(function (color, value) {
- return zrColor.modifyHSL(color, null, value);
- }),
-
- colorLightness: makePartialColorVisualHandler(function (color, value) {
- return zrColor.modifyHSL(color, null, null, value);
- }),
-
- colorAlpha: makePartialColorVisualHandler(function (color, value) {
- return zrColor.modifyAlpha(color, value);
- }),
-
- symbol: {
- applyVisual: function (value, getter, setter) {
- var symbolCfg = this.mapValueToVisual(value);
- if (zrUtil.isString(symbolCfg)) {
- setter('symbol', symbolCfg);
- }
- else if (isObject(symbolCfg)) {
- for (var name in symbolCfg) {
- if (symbolCfg.hasOwnProperty(name)) {
- setter(name, symbolCfg[name]);
- }
- }
- }
- },
-
- mapValueToVisual: function (value) {
- var normalized = this._normalizeData(value);
- var result = this._getSpecifiedVisual(value);
- var visual = this.option.visual;
-
- if (result == null) {
- result = isCategory(this)
- ? getVisualForCategory(this, visual, normalized)
- : (arrayGetByNormalizedValue(visual, normalized) || {});
- }
-
- return result;
- }
- },
-
- symbolSize: {
- applyVisual: function (value, getter, setter) {
- setter('symbolSize', this.mapValueToVisual(value));
- },
-
- mapValueToVisual: function (value) {
- var normalized = this._normalizeData(value);
- var result = this._getSpecifiedVisual(value);
- var visual = this.option.visual;
-
- if (result == null) {
- result = isCategory(this)
- ? getVisualForCategory(this, visual, normalized)
- : linearMapArray(normalized, [0, 1], visual, true);
- }
- return result;
- }
- }
- };
-
- function preprocessForPiecewise(thisOption) {
- var pieceList = thisOption.pieceList;
- thisOption.hasSpecialVisual = false;
-
- zrUtil.each(pieceList, function (piece, index) {
- piece.originIndex = index;
- if (piece.visual) {
- thisOption.hasSpecialVisual = true;
- }
- });
- }
-
- function preprocessForCategory(thisOption) {
- // Hash categories.
- var categories = thisOption.categories;
- var visual = thisOption.visual;
- var isVisualArray = zrUtil.isArray(visual);
-
- if (!categories) {
- if (!isVisualArray) {
- // visual should be array when no categories.
- throw new Error();
- }
- else {
- return;
- }
- }
-
- var categoryMap = thisOption.categoryMap = {};
- each(categories, function (cate, index) {
- categoryMap[cate] = index;
- });
-
- // Process visual map input.
- if (!isVisualArray) {
- var visualArr = [];
-
- if (zrUtil.isObject(visual)) {
- each(visual, function (v, cate) {
- var index = categoryMap[cate];
- visualArr[index != null ? index : CATEGORY_DEFAULT_VISUAL_INDEX] = v;
- });
- }
- else { // Is primary type, represents default visual.
- visualArr[CATEGORY_DEFAULT_VISUAL_INDEX] = visual;
- }
-
- visual = thisOption.visual = visualArr;
- }
-
- // Remove categories that has no visual,
- // then we can mapping them to CATEGORY_DEFAULT_VISUAL_INDEX.
- for (var i = categories.length - 1; i >= 0; i--) {
- if (visual[i] == null) {
- delete categoryMap[categories[i]];
- categories.pop();
- }
- }
- }
-
- function makePartialColorVisualHandler(applyValue) {
- return {
-
- applyVisual: function (value, getter, setter) {
- // color can be {string} or {Array.<Object>} (for gradient color stops)
- var color = getter('color');
- var isArrayValue = zrUtil.isArray(value);
- value = isArrayValue
- ? [this.mapValueToVisual(value[0]), this.mapValueToVisual(value[1])]
- : this.mapValueToVisual(value);
-
- if (zrUtil.isArray(color)) {
- for (var i = 0, len = color.length; i < len; i++) {
- color[i].color = applyValue(
- color[i].color, isArrayValue ? value[i] : value
- );
- }
- }
- else {
- // Must not be array value
- setter('color', applyValue(color, value));
- }
- },
-
- mapValueToVisual: function (value) {
- var normalized = this._normalizeData(value);
- var result = this._getSpecifiedVisual(value);
- var visual = this.option.visual;
-
- if (result == null) {
- result = isCategory(this)
- ? getVisualForCategory(this, visual, normalized)
- : linearMapArray(normalized, [0, 1], visual, true);
- }
- return result;
- }
- };
- }
-
- function arrayGetByNormalizedValue(arr, normalized) {
- return arr[
- Math.round(linearMapArray(normalized, [0, 1], [0, arr.length - 1], true))
- ];
- }
-
- function defaultApplyColor(value, getter, setter) {
- setter('color', this.mapValueToVisual(value));
- }
-
- function getVisualForCategory(me, visual, normalized) {
- return visual[
- (me.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX)
- ? normalized % visual.length
- : normalized
- ];
- }
-
- function isCategory(me) {
- return me.option.mappingMethod === 'category';
- }
-
-
- var normalizers = {
-
- linear: function (value) {
- return linearMapArray(value, this.option.dataExtent, [0, 1], true);
- },
-
- piecewise: function (value) {
- var pieceList = this.option.pieceList;
- var pieceIndex = VisualMapping.findPieceIndex(value, pieceList);
- if (pieceIndex != null) {
- return linearMapArray(pieceIndex, [0, pieceList.length - 1], [0, 1], true);
- }
- },
-
- category: function (value) {
- var index = this.option.categories
- ? this.option.categoryMap[value]
- : value; // ordinal
- return index == null ? CATEGORY_DEFAULT_VISUAL_INDEX : index;
- }
- };
-
-
- // FIXME
- // refactor
- var specifiedVisualGetters = {
-
- // Linear do not support this feature.
- linear: zrUtil.noop,
-
- piecewise: function (visualType, value) {
- var thisOption = this.option;
- var pieceList = thisOption.pieceList;
- if (thisOption.hasSpecialVisual) {
- var pieceIndex = VisualMapping.findPieceIndex(value, pieceList);
- var piece = pieceList[pieceIndex];
- if (piece && piece.visual) {
- return piece.visual[visualType];
- }
- }
- },
-
- // Category do not need to support this feature.
- // Visual can be set in visualMap.inRange or
- // visualMap.outOfRange directly.
- category: zrUtil.noop
- };
-
- /**
- * @public
- */
- VisualMapping.addVisualHandler = function (name, handler) {
- visualHandlers[name] = handler;
- };
-
- /**
- * @public
- */
- VisualMapping.isValidType = function (visualType) {
- return visualHandlers.hasOwnProperty(visualType);
- };
-
- /**
- * Convinent method.
- * Visual can be Object or Array or primary type.
- *
- * @public
- */
- VisualMapping.eachVisual = function (visual, callback, context) {
- if (zrUtil.isObject(visual)) {
- zrUtil.each(visual, callback, context);
- }
- else {
- callback.call(context, visual);
- }
- };
-
- VisualMapping.mapVisual = function (visual, callback, context) {
- var isPrimary;
- var newVisual = zrUtil.isArray(visual)
- ? []
- : zrUtil.isObject(visual)
- ? {}
- : (isPrimary = true, null);
-
- VisualMapping.eachVisual(visual, function (v, key) {
- var newVal = callback.call(context, v, key);
- isPrimary ? (newVisual = newVal) : (newVisual[key] = newVal);
- });
- return newVisual;
- };
-
- /**
- * 'color', 'colorSaturation', 'colorAlpha', ... are in the same visualCluster named 'color'.
- * Other visuals are in the cluster named as the same as theirselves.
- *
- * @public
- * @param {string} visualType
- * @param {string} visualCluster
- * @return {boolean}
- */
- VisualMapping.isInVisualCluster = function (visualType, visualCluster) {
- return visualCluster === 'color'
- ? !!(visualType && visualType.indexOf(visualCluster) === 0)
- : visualType === visualCluster;
- };
-
- /**
- * @public
- * @param {Object} obj
- * @return {Oject} new object containers visual values.
- * If no visuals, return null.
- */
- VisualMapping.retrieveVisuals = function (obj) {
- var ret = {};
- var hasVisual;
-
- obj && each(visualHandlers, function (h, visualType) {
- if (obj.hasOwnProperty(visualType)) {
- ret[visualType] = obj[visualType];
- hasVisual = true;
- }
- });
-
- return hasVisual ? ret : null;
- };
-
- /**
- * Give order to visual types, considering colorSaturation, colorAlpha depends on color.
- *
- * @public
- * @param {(Object|Array)} visualTypes If Object, like: {color: ..., colorSaturation: ...}
- * IF Array, like: ['color', 'symbol', 'colorSaturation']
- * @return {Array.<string>} Sorted visual types.
- */
- VisualMapping.prepareVisualTypes = function (visualTypes) {
- if (isObject(visualTypes)) {
- var types = [];
- each(visualTypes, function (item, type) {
- types.push(type);
- });
- visualTypes = types;
- }
- else if (zrUtil.isArray(visualTypes)) {
- visualTypes = visualTypes.slice();
- }
- else {
- return [];
- }
-
- visualTypes.sort(function (type1, type2) {
- // color should be front of colorSaturation, colorAlpha, ...
- // symbol and symbolSize do not matter.
- return (type2 === 'color' && type1 !== 'color' && type1.indexOf('color') === 0)
- ? 1 : -1;
- });
-
- return visualTypes;
- };
-
- /**
- * @public {Array.<Object>} [{value: ..., interval: [min, max]}, ...]
- * @return {number} index
- */
- VisualMapping.findPieceIndex = function (value, pieceList) {
- // value has high priority.
- for (var i = 0, len = pieceList.length; i < len; i++) {
- var piece = pieceList[i];
- if (piece.value != null && piece.value === value) {
- return i;
- }
- }
-
- for (var i = 0, len = pieceList.length; i < len; i++) {
- var piece = pieceList[i];
- var interval = piece.interval;
- if (interval) {
- if (interval[0] === -Infinity) {
- if (value < interval[1]) {
- return i;
- }
- }
- else if (interval[1] === Infinity) {
- if (interval[0] < value) {
- return i;
- }
- }
- else if (
- piece.interval[0] <= value
- && value <= piece.interval[1]
- ) {
- return i;
- }
- }
- }
- };
-
- module.exports = VisualMapping;
-
-
-
-
-/***/ },
-/* 188 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var mathMax = Math.max;
- var mathMin = Math.min;
- var zrUtil = __webpack_require__(3);
- var numberUtil = __webpack_require__(7);
- var layout = __webpack_require__(21);
- var helper = __webpack_require__(181);
- var parsePercent = numberUtil.parsePercent;
- var retrieveValue = zrUtil.retrieve;
- var BoundingRect = __webpack_require__(15);
- var helper = __webpack_require__(181);
-
- /**
- * @public
- */
- function update(ecModel, api, payload) {
- // Layout result in each node:
- // {x, y, width, height, area, borderWidth}
- var condition = {mainType: 'series', subType: 'treemap', query: payload};
- ecModel.eachComponent(condition, function (seriesModel) {
-
- var ecWidth = api.getWidth();
- var ecHeight = api.getHeight();
- var seriesOption = seriesModel.option;
-
- var size = seriesOption.size || []; // Compatible with ec2.
- var containerWidth = parsePercent(
- retrieveValue(seriesOption.width, size[0]),
- ecWidth
- );
- var containerHeight = parsePercent(
- retrieveValue(seriesOption.height, size[1]),
- ecHeight
- );
-
- var layoutInfo = layout.getLayoutRect(
- seriesModel.getBoxLayoutParams(),
- {
- width: api.getWidth(),
- height: api.getHeight()
- }
- );
-
- // Fetch payload info.
- var payloadType = payload && payload.type;
- var targetInfo = helper.retrieveTargetInfo(payload, seriesModel);
- var rootRect = (payloadType === 'treemapRender' || payloadType === 'treemapMove')
- ? payload.rootRect : null;
- var viewRoot = seriesModel.getViewRoot();
-
- if (payloadType !== 'treemapMove') {
- var rootSize = payloadType === 'treemapZoomToNode'
- ? estimateRootSize(
- seriesModel, targetInfo, viewRoot, containerWidth, containerHeight
- )
- : rootRect
- ? [rootRect.width, rootRect.height]
- : [containerWidth, containerHeight];
-
- var sort = seriesOption.sort;
- if (sort && sort !== 'asc' && sort !== 'desc') {
- sort = 'desc';
- }
- var options = {
- squareRatio: seriesOption.squareRatio,
- sort: sort,
- leafDepth: seriesOption.leafDepth
- };
-
- viewRoot.setLayout({
- x: 0, y: 0,
- width: rootSize[0], height: rootSize[1],
- area: rootSize[0] * rootSize[1]
- });
-
- squarify(viewRoot, options, false, 0);
- }
-
- // Set root position
- viewRoot.setLayout(
- calculateRootPosition(layoutInfo, rootRect, targetInfo),
- true
- );
-
- seriesModel.setLayoutInfo(layoutInfo);
-
- // Optimize
- // FIXME
- // 现在没有clip功能,暂时取ec高宽。
- prunning(
- seriesModel.getData().tree.root,
- // Transform to base element coordinate system.
- new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight),
- helper.getPathToRoot(viewRoot)
- );
-
- });
- }
-
- /**
- * Layout treemap with squarify algorithm.
- * @see https://graphics.ethz.ch/teaching/scivis_common/Literature/squarifiedTreeMaps.pdf
- * @see https://github.com/mbostock/d3/blob/master/src/layout/treemap.js
- *
- * @protected
- * @param {module:echarts/data/Tree~TreeNode} node
- * @param {Object} options
- * @param {string} options.sort 'asc' or 'desc'
- * @param {number} options.squareRatio
- * @param {boolean} hideChildren
- * @param {number} depth
- */
- function squarify(node, options, hideChildren, depth) {
- var width;
- var height;
-
- if (node.isRemoved()) {
- return;
- }
-
- var thisLayout = node.getLayout();
- width = thisLayout.width;
- height = thisLayout.height;
-
- // Considering border and gap
- var itemStyleModel = node.getModel('itemStyle.normal');
- var borderWidth = itemStyleModel.get('borderWidth');
- var halfGapWidth = itemStyleModel.get('gapWidth') / 2;
- var layoutOffset = borderWidth - halfGapWidth;
- var nodeModel = node.getModel();
-
- node.setLayout({borderWidth: borderWidth}, true);
-
- width = mathMax(width - 2 * layoutOffset, 0);
- height = mathMax(height - 2 * layoutOffset, 0);
-
- var totalArea = width * height;
- var viewChildren = initChildren(
- node, nodeModel, totalArea, options, hideChildren, depth
- );
-
- if (!viewChildren.length) {
- return;
- }
-
- var rect = {x: layoutOffset, y: layoutOffset, width: width, height: height};
- var rowFixedLength = mathMin(width, height);
- var best = Infinity; // the best row score so far
- var row = [];
- row.area = 0;
-
- for (var i = 0, len = viewChildren.length; i < len;) {
- var child = viewChildren[i];
-
- row.push(child);
- row.area += child.getLayout().area;
- var score = worst(row, rowFixedLength, options.squareRatio);
-
- // continue with this orientation
- if (score <= best) {
- i++;
- best = score;
- }
- // abort, and try a different orientation
- else {
- row.area -= row.pop().getLayout().area;
- position(row, rowFixedLength, rect, halfGapWidth, false);
- rowFixedLength = mathMin(rect.width, rect.height);
- row.length = row.area = 0;
- best = Infinity;
- }
- }
-
- if (row.length) {
- position(row, rowFixedLength, rect, halfGapWidth, true);
- }
-
- if (!hideChildren) {
- var childrenVisibleMin = nodeModel.get('childrenVisibleMin');
- if (childrenVisibleMin != null && totalArea < childrenVisibleMin) {
- hideChildren = true;
- }
- }
-
- for (var i = 0, len = viewChildren.length; i < len; i++) {
- squarify(viewChildren[i], options, hideChildren, depth + 1);
- }
- }
-
- /**
- * Set area to each child, and calculate data extent for visual coding.
- */
- function initChildren(node, nodeModel, totalArea, options, hideChildren, depth) {
- var viewChildren = node.children || [];
- var orderBy = options.sort;
- orderBy !== 'asc' && orderBy !== 'desc' && (orderBy = null);
-
- var overLeafDepth = options.leafDepth != null && options.leafDepth <= depth;
-
- // leafDepth has higher priority.
- if (hideChildren && !overLeafDepth) {
- return (node.viewChildren = []);
- }
-
- // Sort children, order by desc.
- viewChildren = zrUtil.filter(viewChildren, function (child) {
- return !child.isRemoved();
- });
-
- sort(viewChildren, orderBy);
-
- var info = statistic(nodeModel, viewChildren, orderBy);
-
- if (info.sum === 0) {
- return (node.viewChildren = []);
- }
-
- info.sum = filterByThreshold(nodeModel, totalArea, info.sum, orderBy, viewChildren);
-
- if (info.sum === 0) {
- return (node.viewChildren = []);
- }
-
- // Set area to each child.
- for (var i = 0, len = viewChildren.length; i < len; i++) {
- var area = viewChildren[i].getValue() / info.sum * totalArea;
- // Do not use setLayout({...}, true), because it is needed to clear last layout.
- viewChildren[i].setLayout({area: area});
- }
-
- if (overLeafDepth) {
- viewChildren.length && node.setLayout({isLeafRoot: true}, true);
- viewChildren.length = 0;
- }
-
- node.viewChildren = viewChildren;
- node.setLayout({dataExtent: info.dataExtent}, true);
-
- return viewChildren;
- }
-
- /**
- * Consider 'visibleMin'. Modify viewChildren and get new sum.
- */
- function filterByThreshold(nodeModel, totalArea, sum, orderBy, orderedChildren) {
-
- // visibleMin is not supported yet when no option.sort.
- if (!orderBy) {
- return sum;
- }
-
- var visibleMin = nodeModel.get('visibleMin');
- var len = orderedChildren.length;
- var deletePoint = len;
-
- // Always travel from little value to big value.
- for (var i = len - 1; i >= 0; i--) {
- var value = orderedChildren[
- orderBy === 'asc' ? len - i - 1 : i
- ].getValue();
-
- if (value / sum * totalArea < visibleMin) {
- deletePoint = i;
- sum -= value;
- }
- }
-
- orderBy === 'asc'
- ? orderedChildren.splice(0, len - deletePoint)
- : orderedChildren.splice(deletePoint, len - deletePoint);
-
- return sum;
- }
-
- /**
- * Sort
- */
- function sort(viewChildren, orderBy) {
- if (orderBy) {
- viewChildren.sort(function (a, b) {
- return orderBy === 'asc'
- ? a.getValue() - b.getValue() : b.getValue() - a.getValue();
- });
- }
- return viewChildren;
- }
-
- /**
- * Statistic
- */
- function statistic(nodeModel, children, orderBy) {
- // Calculate sum.
- var sum = 0;
- for (var i = 0, len = children.length; i < len; i++) {
- sum += children[i].getValue();
- }
-
- // Statistic data extent for latter visual coding.
- // Notice: data extent should be calculate based on raw children
- // but not filtered view children, otherwise visual mapping will not
- // be stable when zoom (where children is filtered by visibleMin).
-
- var dimension = nodeModel.get('visualDimension');
- var dataExtent;
-
- // The same as area dimension.
- if (!children || !children.length) {
- dataExtent = [NaN, NaN];
- }
- else if (dimension === 'value' && orderBy) {
- dataExtent = [
- children[children.length - 1].getValue(),
- children[0].getValue()
- ];
- orderBy === 'asc' && dataExtent.reverse();
- }
- // Other dimension.
- else {
- var dataExtent = [Infinity, -Infinity];
- zrUtil.each(children, function (child) {
- var value = child.getValue(dimension);
- value < dataExtent[0] && (dataExtent[0] = value);
- value > dataExtent[1] && (dataExtent[1] = value);
- });
- }
-
- return {sum: sum, dataExtent: dataExtent};
- }
-
- /**
- * Computes the score for the specified row,
- * as the worst aspect ratio.
- */
- function worst(row, rowFixedLength, ratio) {
- var areaMax = 0;
- var areaMin = Infinity;
-
- for (var i = 0, area, len = row.length; i < len; i++) {
- area = row[i].getLayout().area;
- if (area) {
- area < areaMin && (areaMin = area);
- area > areaMax && (areaMax = area);
- }
- }
-
- var squareArea = row.area * row.area;
- var f = rowFixedLength * rowFixedLength * ratio;
-
- return squareArea
- ? mathMax(
- (f * areaMax) / squareArea,
- squareArea / (f * areaMin)
- )
- : Infinity;
- }
-
- /**
- * Positions the specified row of nodes. Modifies `rect`.
- */
- function position(row, rowFixedLength, rect, halfGapWidth, flush) {
- // When rowFixedLength === rect.width,
- // it is horizontal subdivision,
- // rowFixedLength is the width of the subdivision,
- // rowOtherLength is the height of the subdivision,
- // and nodes will be positioned from left to right.
-
- // wh[idx0WhenH] means: when horizontal,
- // wh[idx0WhenH] => wh[0] => 'width'.
- // xy[idx1WhenH] => xy[1] => 'y'.
- var idx0WhenH = rowFixedLength === rect.width ? 0 : 1;
- var idx1WhenH = 1 - idx0WhenH;
- var xy = ['x', 'y'];
- var wh = ['width', 'height'];
-
- var last = rect[xy[idx0WhenH]];
- var rowOtherLength = rowFixedLength
- ? row.area / rowFixedLength : 0;
-
- if (flush || rowOtherLength > rect[wh[idx1WhenH]]) {
- rowOtherLength = rect[wh[idx1WhenH]]; // over+underflow
- }
- for (var i = 0, rowLen = row.length; i < rowLen; i++) {
- var node = row[i];
- var nodeLayout = {};
- var step = rowOtherLength
- ? node.getLayout().area / rowOtherLength : 0;
-
- var wh1 = nodeLayout[wh[idx1WhenH]] = mathMax(rowOtherLength - 2 * halfGapWidth, 0);
-
- // We use Math.max/min to avoid negative width/height when considering gap width.
- var remain = rect[xy[idx0WhenH]] + rect[wh[idx0WhenH]] - last;
- var modWH = (i === rowLen - 1 || remain < step) ? remain : step;
- var wh0 = nodeLayout[wh[idx0WhenH]] = mathMax(modWH - 2 * halfGapWidth, 0);
-
- nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin(halfGapWidth, wh1 / 2);
- nodeLayout[xy[idx0WhenH]] = last + mathMin(halfGapWidth, wh0 / 2);
-
- last += modWH;
- node.setLayout(nodeLayout, true);
- }
-
- rect[xy[idx1WhenH]] += rowOtherLength;
- rect[wh[idx1WhenH]] -= rowOtherLength;
- }
-
- // Return [containerWidth, containerHeight] as defualt.
- function estimateRootSize(seriesModel, targetInfo, viewRoot, containerWidth, containerHeight) {
- // If targetInfo.node exists, we zoom to the node,
- // so estimate whold width and heigth by target node.
- var currNode = (targetInfo || {}).node;
- var defaultSize = [containerWidth, containerHeight];
-
- if (!currNode || currNode === viewRoot) {
- return defaultSize;
- }
-
- var parent;
- var viewArea = containerWidth * containerHeight;
- var area = viewArea * seriesModel.option.zoomToNodeRatio;
-
- while (parent = currNode.parentNode) { // jshint ignore:line
- var sum = 0;
- var siblings = parent.children;
-
- for (var i = 0, len = siblings.length; i < len; i++) {
- sum += siblings[i].getValue();
- }
- var currNodeValue = currNode.getValue();
- if (currNodeValue === 0) {
- return defaultSize;
- }
- area *= sum / currNodeValue;
-
- var borderWidth = parent.getModel('itemStyle.normal').get('borderWidth');
-
- if (isFinite(borderWidth)) {
- // Considering border, suppose aspect ratio is 1.
- area += 4 * borderWidth * borderWidth + 4 * borderWidth * Math.pow(area, 0.5);
- }
-
- area > numberUtil.MAX_SAFE_INTEGER && (area = numberUtil.MAX_SAFE_INTEGER);
-
- currNode = parent;
- }
-
- area < viewArea && (area = viewArea);
- var scale = Math.pow(area / viewArea, 0.5);
-
- return [containerWidth * scale, containerHeight * scale];
- }
-
- // Root postion base on coord of containerGroup
- function calculateRootPosition(layoutInfo, rootRect, targetInfo) {
- if (rootRect) {
- return {x: rootRect.x, y: rootRect.y};
- }
-
- var defaultPosition = {x: 0, y: 0};
- if (!targetInfo) {
- return defaultPosition;
- }
-
- // If targetInfo is fetched by 'retrieveTargetInfo',
- // old tree and new tree are the same tree,
- // so the node still exists and we can visit it.
-
- var targetNode = targetInfo.node;
- var layout = targetNode.getLayout();
-
- if (!layout) {
- return defaultPosition;
- }
-
- // Transform coord from local to container.
- var targetCenter = [layout.width / 2, layout.height / 2];
- var node = targetNode;
- while (node) {
- var nodeLayout = node.getLayout();
- targetCenter[0] += nodeLayout.x;
- targetCenter[1] += nodeLayout.y;
- node = node.parentNode;
- }
-
- return {
- x: layoutInfo.width / 2 - targetCenter[0],
- y: layoutInfo.height / 2 - targetCenter[1]
- };
- }
-
- // Mark invisible nodes for prunning when visual coding and rendering.
- // Prunning depends on layout and root position, so we have to do it after them.
- function prunning(node, clipRect, viewPath) {
- var nodeLayout = node.getLayout();
-
- node.setLayout({
- invisible: nodeLayout
- ? !clipRect.intersect(nodeLayout)
- : !helper.aboveViewRootByViewPath(viewPath, node)
- }, true);
-
- var viewChildren = node.viewChildren || [];
- for (var i = 0, len = viewChildren.length; i < len; i++) {
- // Transform to child coordinate.
- var childClipRect = new BoundingRect(
- clipRect.x - nodeLayout.x,
- clipRect.y - nodeLayout.y,
- clipRect.width,
- clipRect.height
- );
- prunning(viewChildren[i], childClipRect, viewPath);
- }
- }
-
- module.exports = update;
-
-
-/***/ },
-/* 189 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var echarts = __webpack_require__(1);
- var zrUtil = __webpack_require__(3);
-
- __webpack_require__(190);
- __webpack_require__(193);
-
- __webpack_require__(197);
-
- echarts.registerProcessor('filter', __webpack_require__(198));
-
- echarts.registerVisualCoding('chart', zrUtil.curry(
- __webpack_require__(103), 'graph', 'circle', null
- ));
- echarts.registerVisualCoding('chart', __webpack_require__(199));
-
- echarts.registerLayout(__webpack_require__(200));
- echarts.registerLayout(__webpack_require__(202));
- echarts.registerLayout(__webpack_require__(204));
-
- // Graph view coordinate system
- echarts.registerCoordinateSystem('graphView', {
- create: __webpack_require__(206)
- });
-
-
-/***/ },
-/* 190 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var List = __webpack_require__(94);
- var zrUtil = __webpack_require__(3);
-
- var createGraphFromNodeEdge = __webpack_require__(191);
-
- var GraphSeries = __webpack_require__(1).extendSeriesModel({
-
- type: 'series.graph',
-
- init: function (option) {
- GraphSeries.superApply(this, 'init', arguments);
-
- // Provide data for legend select
- this.legendDataProvider = function () {
- return this._categoriesData;
- };
-
- this._updateCategoriesData();
- },
-
- mergeOption: function (option) {
- GraphSeries.superApply(this, 'mergeOption', arguments);
-
- this._updateCategoriesData();
- },
-
- getInitialData: function (option, ecModel) {
- var edges = option.edges || option.links;
- var nodes = option.data || option.nodes;
- if (nodes && edges) {
- var graph = createGraphFromNodeEdge(nodes, edges, this, true);
- var list = graph.data;
- var self = this;
- // Overwrite list.getItemModel to
- list.wrapMethod('getItemModel', function (model) {
- var categoriesModels = self._categoriesModels;
- var categoryIdx = model.getShallow('category');
- var categoryModel = categoriesModels[categoryIdx];
- if (categoryModel) {
- categoryModel.parentModel = model.parentModel;
- model.parentModel = categoryModel;
- }
- return model;
- });
- return list;
- }
- },
-
- restoreData: function () {
- GraphSeries.superApply(this, 'restoreData', arguments);
- this.getGraph().restoreData();
- },
-
- /**
- * @return {module:echarts/data/Graph}
- */
- getGraph: function () {
- return this.getData().graph;
- },
-
- /**
- * @return {module:echarts/data/List}
- */
- getEdgeData: function () {
- return this.getGraph().edgeData;
- },
-
- /**
- * @return {module:echarts/data/List}
- */
- getCategoriesData: function () {
- return this._categoriesData;
- },
-
- _updateCategoriesData: function () {
- var categories = zrUtil.map(this.option.categories || [], function (category) {
- // Data must has value
- return category.value != null ? category : zrUtil.extend({
- value: 0
- }, category);
- });
- var categoriesData = new List(['value'], this);
- categoriesData.initData(categories);
-
- this._categoriesData = categoriesData;
-
- this._categoriesModels = categoriesData.mapArray(function (idx) {
- return categoriesData.getItemModel(idx, true);
- });
- },
-
- /**
- * @param {number} zoom
- */
- setRoamZoom: function (zoom) {
- var roamDetail = this.option.roamDetail;
- roamDetail && (roamDetail.zoom = zoom);
- },
-
- /**
- * @param {number} x
- * @param {number} y
- */
- setRoamPan: function (x, y) {
- var roamDetail = this.option.roamDetail;
- if (roamDetail) {
- roamDetail.x = x;
- roamDetail.y = y;
- }
- },
-
- defaultOption: {
- zlevel: 0,
- z: 2,
-
- color: ['#61a0a8', '#d14a61', '#fd9c35', '#675bba', '#fec42c',
- '#dd4444', '#fd9c35', '#cd4870'],
-
- coordinateSystem: 'view',
-
- legendHoverLink: true,
-
- hoverAnimation: true,
-
- layout: null,
-
- // Configuration of force
- force: {
- initLayout: null,
- repulsion: 50,
- gravity: 0.1,
- edgeLength: 30,
-
- layoutAnimation: true
- },
-
- left: 'center',
- top: 'center',
- // right: null,
- // bottom: null,
- // width: '80%',
- // height: '80%',
-
- symbol: 'circle',
- symbolSize: 10,
-
- draggable: false,
-
- roam: false,
- roamDetail: {
- x: 0,
- y: 0,
- zoom: 1
- },
-
- // Symbol size scale ratio in roam
- nodeScaleRatio: 0.6,
-
- // Line width scale ratio in roam
- // edgeScaleRatio: 0.1,
-
- // categories: [],
-
- // data: []
- // Or
- // nodes: []
- //
- // links: []
- // Or
- // edges: []
-
- label: {
- normal: {
- show: false
- },
- emphasis: {
- show: true
- }
- },
-
- itemStyle: {
- normal: {},
- emphasis: {}
- },
-
- lineStyle: {
- normal: {
- color: '#aaa',
- width: 1,
- curveness: 0,
- opacity: 0.5
- },
- emphasis: {}
- }
- }
- });
-
- module.exports = GraphSeries;
-
-
-/***/ },
-/* 191 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var List = __webpack_require__(94);
- var Graph = __webpack_require__(192);
- var linkList = __webpack_require__(180);
- var completeDimensions = __webpack_require__(96);
- var zrUtil = __webpack_require__(3);
-
- module.exports = function (nodes, edges, hostModel, directed) {
- var graph = new Graph(directed);
- for (var i = 0; i < nodes.length; i++) {
- graph.addNode(zrUtil.retrieve(
- // Id, name, dataIndex
- nodes[i].id, nodes[i].name, i
- ), i);
- }
-
- var linkNameList = [];
- var validEdges = [];
- for (var i = 0; i < edges.length; i++) {
- var link = edges[i];
- // addEdge may fail when source or target not exists
- if (graph.addEdge(link.source, link.target, i)) {
- validEdges.push(link);
- linkNameList.push(zrUtil.retrieve(link.id, link.source + ' - ' + link.target));
- }
- }
-
- // FIXME
- var dimensionNames = completeDimensions(['value'], nodes);
-
- var nodeData = new List(dimensionNames, hostModel);
- var edgeData = new List(['value'], hostModel);
-
- nodeData.initData(nodes);
- edgeData.initData(validEdges, linkNameList);
-
- graph.setEdgeData(edgeData);
-
- linkList.linkToGraph(nodeData, graph);
- // Update dataIndex of nodes and edges because invalid edge may be removed
- graph.update();
-
- return graph;
- };
-
-
-/***/ },
-/* 192 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * Graph data structure
- *
- * @module echarts/data/Graph
- * @author Yi Shen(https://www.github.com/pissang)
- */
-
-
- var zrUtil = __webpack_require__(3);
-
- /**
- * @alias module:echarts/data/Graph
- * @constructor
- * @param {boolean} directed
- */
- var Graph = function(directed) {
- /**
- * 是否是有向图
- * @type {boolean}
- * @private
- */
- this._directed = directed || false;
-
- /**
- * @type {Array.<module:echarts/data/Graph.Node>}
- * @readOnly
- */
- this.nodes = [];
-
- /**
- * @type {Array.<module:echarts/data/Graph.Edge>}
- * @readOnly
- */
- this.edges = [];
-
- /**
- * @type {Object.<string, module:echarts/data/Graph.Node>}
- * @private
- */
- this._nodesMap = {};
- /**
- * @type {Object.<string, module:echarts/data/Graph.Edge>}
- * @private
- */
- this._edgesMap = {};
-
- /**
- * @type {module:echarts/data/List}
- * @readOnly
- */
- this.data;
-
- /**
- * @type {module:echarts/data/List}
- * @readOnly
- */
- this.edgeData;
- };
-
- var graphProto = Graph.prototype;
- /**
- * @type {string}
- */
- graphProto.type = 'graph';
-
- /**
- * If is directed graph
- * @return {boolean}
- */
- graphProto.isDirected = function () {
- return this._directed;
- };
-
- /**
- * Add a new node
- * @param {string} id
- * @param {number} [dataIndex]
- */
- graphProto.addNode = function (id, dataIndex) {
- var nodesMap = this._nodesMap;
-
- if (nodesMap[id]) {
- return;
- }
-
- var node = new Node(id, dataIndex);
- node.hostGraph = this;
-
- this.nodes.push(node);
-
- nodesMap[id] = node;
- return node;
- };
-
- /**
- * Get node by data index
- * @param {number} dataIndex
- * @return {module:echarts/data/Graph~Node}
- */
- graphProto.getNodeByIndex = function (dataIndex) {
- var rawIdx = this.data.getRawIndex(dataIndex);
- return this.nodes[rawIdx];
- };
- /**
- * Get node by id
- * @param {string} id
- * @return {module:echarts/data/Graph.Node}
- */
- graphProto.getNodeById = function (id) {
- return this._nodesMap[id];
- };
-
- /**
- * Add a new edge
- * @param {string|module:echarts/data/Graph.Node} n1
- * @param {string|module:echarts/data/Graph.Node} n2
- * @param {number} [dataIndex=-1]
- * @return {module:echarts/data/Graph.Edge}
- */
- graphProto.addEdge = function (n1, n2, dataIndex) {
- var nodesMap = this._nodesMap;
- var edgesMap = this._edgesMap;
-
- if (!(n1 instanceof Node)) {
- n1 = nodesMap[n1];
- }
- if (!(n2 instanceof Node)) {
- n2 = nodesMap[n2];
- }
- if (!n1 || !n2) {
- return;
- }
-
- var key = n1.id + '-' + n2.id;
- // PENDING
- if (edgesMap[key]) {
- return;
- }
-
- var edge = new Edge(n1, n2, dataIndex);
- edge.hostGraph = this;
-
- if (this._directed) {
- n1.outEdges.push(edge);
- n2.inEdges.push(edge);
- }
- n1.edges.push(edge);
- if (n1 !== n2) {
- n2.edges.push(edge);
- }
-
- this.edges.push(edge);
- edgesMap[key] = edge;
-
- return edge;
- };
-
- /**
- * Get edge by data index
- * @param {number} dataIndex
- * @return {module:echarts/data/Graph~Node}
- */
- graphProto.getEdgeByIndex = function (dataIndex) {
- var rawIdx = this.edgeData.getRawIndex(dataIndex);
- return this.edges[rawIdx];
- };
- /**
- * Get edge by two linked nodes
- * @param {module:echarts/data/Graph.Node|string} n1
- * @param {module:echarts/data/Graph.Node|string} n2
- * @return {module:echarts/data/Graph.Edge}
- */
- graphProto.getEdge = function (n1, n2) {
- if (n1 instanceof Node) {
- n1 = n1.id;
- }
- if (n2 instanceof Node) {
- n2 = n2.id;
- }
-
- var edgesMap = this._edgesMap;
-
- if (this._directed) {
- return edgesMap[n1 + '-' + n2];
- } else {
- return edgesMap[n1 + '-' + n2]
- || edgesMap[n2 + '-' + n1];
- }
- };
-
- /**
- * Iterate all nodes
- * @param {Function} cb
- * @param {*} [context]
- */
- graphProto.eachNode = function (cb, context) {
- var nodes = this.nodes;
- var len = nodes.length;
- for (var i = 0; i < len; i++) {
- if (nodes[i].dataIndex >= 0) {
- cb.call(context, nodes[i], i);
- }
- }
- };
-
- /**
- * Iterate all edges
- * @param {Function} cb
- * @param {*} [context]
- */
- graphProto.eachEdge = function (cb, context) {
- var edges = this.edges;
- var len = edges.length;
- for (var i = 0; i < len; i++) {
- if (edges[i].dataIndex >= 0
- && edges[i].node1.dataIndex >= 0
- && edges[i].node2.dataIndex >= 0
- ) {
- cb.call(context, edges[i], i);
- }
- }
- };
-
- /**
- * Breadth first traverse
- * @param {Function} cb
- * @param {module:echarts/data/Graph.Node} startNode
- * @param {string} [direction='none'] 'none'|'in'|'out'
- * @param {*} [context]
- */
- graphProto.breadthFirstTraverse = function (
- cb, startNode, direction, context
- ) {
- if (!(startNode instanceof Node)) {
- startNode = this._nodesMap[startNode];
- }
- if (!startNode) {
- return;
- }
-
- var edgeType = direction === 'out'
- ? 'outEdges' : (direction === 'in' ? 'inEdges' : 'edges');
-
- for (var i = 0; i < this.nodes.length; i++) {
- this.nodes[i].__visited = false;
- }
-
- if (cb.call(context, startNode, null)) {
- return;
- }
-
- var queue = [startNode];
- while (queue.length) {
- var currentNode = queue.shift();
- var edges = currentNode[edgeType];
-
- for (var i = 0; i < edges.length; i++) {
- var e = edges[i];
- var otherNode = e.node1 === currentNode
- ? e.node2 : e.node1;
- if (!otherNode.__visited) {
- if (cb.call(otherNode, otherNode, currentNode)) {
- // Stop traversing
- return;
- }
- queue.push(otherNode);
- otherNode.__visited = true;
- }
- }
- }
- };
-
- // TODO
- // graphProto.depthFirstTraverse = function (
- // cb, startNode, direction, context
- // ) {
-
- // };
-
- // Filter update
- graphProto.update = function () {
- var data = this.data;
- var edgeData = this.edgeData;
- var nodes = this.nodes;
- var edges = this.edges;
-
- for (var i = 0, len = nodes.length; i < len; i++) {
- nodes[i].dataIndex = -1;
- }
- for (var i = 0, len = data.count(); i < len; i++) {
- nodes[data.getRawIndex(i)].dataIndex = i;
- }
-
- edgeData.filterSelf(function (idx) {
- var edge = edges[edgeData.getRawIndex(idx)];
- return edge.node1.dataIndex >= 0 && edge.node2.dataIndex >= 0;
- });
-
- // Update edge
- for (var i = 0, len = edges.length; i < len; i++) {
- edges[i].dataIndex = -1;
- }
- for (var i = 0, len = edgeData.count(); i < len; i++) {
- edges[edgeData.getRawIndex(i)].dataIndex = i;
- }
- };
-
- /**
- * Set edge data
- * @param {module:echarts/data/List} edgeData
- */
- graphProto.setEdgeData = function (edgeData) {
- this.edgeData = edgeData;
- this._edgeDataSaved = edgeData.cloneShallow();
- };
-
- graphProto.restoreData = function () {
- this.edgeData = this._edgeDataSaved.cloneShallow();
- };
-
- /**
- * @return {module:echarts/data/Graph}
- */
- graphProto.clone = function () {
- var graph = new Graph(this._directed);
- var nodes = this.nodes;
- var edges = this.edges;
- for (var i = 0; i < nodes.length; i++) {
- graph.addNode(nodes[i].id, nodes[i].dataIndex);
- }
- for (var i = 0; i < edges.length; i++) {
- var e = edges[i];
- graph.addEdge(e.node1.id, e.node2.id, e.dataIndex);
- }
- return graph;
- };
-
-
- /**
- * @alias module:echarts/data/Graph.Node
- */
- function Node(id, dataIndex) {
- /**
- * @type {string}
- */
- this.id = id == null ? '' : id;
-
- /**
- * @type {Array.<module:echarts/data/Graph.Edge>}
- */
- this.inEdges = [];
- /**
- * @type {Array.<module:echarts/data/Graph.Edge>}
- */
- this.outEdges = [];
- /**
- * @type {Array.<module:echarts/data/Graph.Edge>}
- */
- this.edges = [];
- /**
- * @type {module:echarts/data/Graph}
- */
- this.hostGraph;
-
- /**
- * @type {number}
- */
- this.dataIndex = dataIndex == null ? -1 : dataIndex;
- }
-
- Node.prototype = {
-
- constructor: Node,
-
- /**
- * @return {number}
- */
- degree: function () {
- return this.edges.length;
- },
-
- /**
- * @return {number}
- */
- inDegree: function () {
- return this.inEdges.length;
- },
-
- /**
- * @return {number}
- */
- outDegree: function () {
- return this.outEdges.length;
- },
-
- /**
- * @param {string} [path]
- * @return {module:echarts/model/Model}
- */
- getModel: function (path) {
- if (this.dataIndex < 0) {
- return;
- }
- var graph = this.hostGraph;
- var itemModel = graph.data.getItemModel(this.dataIndex);
-
- return itemModel.getModel(path);
- }
- };
-
- /**
- * 图边
- * @alias module:echarts/data/Graph.Edge
- * @param {module:echarts/data/Graph.Node} n1
- * @param {module:echarts/data/Graph.Node} n2
- * @param {number} [dataIndex=-1]
- */
- function Edge(n1, n2, dataIndex) {
-
- /**
- * 节点1,如果是有向图则为源节点
- * @type {module:echarts/data/Graph.Node}
- */
- this.node1 = n1;
-
- /**
- * 节点2,如果是有向图则为目标节点
- * @type {module:echarts/data/Graph.Node}
- */
- this.node2 = n2;
-
- this.dataIndex = dataIndex == null ? -1 : dataIndex;
- }
-
- /**
- * @param {string} [path]
- * @return {module:echarts/model/Model}
- */
- Edge.prototype.getModel = function (path) {
- if (this.dataIndex < 0) {
- return;
- }
- var graph = this.hostGraph;
- var itemModel = graph.edgeData.getItemModel(this.dataIndex);
-
- return itemModel.getModel(path);
- };
-
- var createGraphDataProxyMixin = function (hostName, dataName) {
- return {
- /**
- * @param {string=} [dimension='value'] Default 'value'. can be 'a', 'b', 'c', 'd', 'e'.
- * @return {number}
- */
- getValue: function (dimension) {
- var data = this[hostName][dataName];
- return data.get(data.getDimension(dimension || 'value'), this.dataIndex);
- },
-
- /**
- * @param {Object|string} key
- * @param {*} [value]
- */
- setVisual: function (key, value) {
- this.dataIndex >= 0
- && this[hostName][dataName].setItemVisual(this.dataIndex, key, value);
- },
-
- /**
- * @param {string} key
- * @return {boolean}
- */
- getVisual: function (key, ignoreParent) {
- return this[hostName][dataName].getItemVisual(this.dataIndex, key, ignoreParent);
- },
-
- /**
- * @param {Object} layout
- * @return {boolean} [merge=false]
- */
- setLayout: function (layout, merge) {
- this.dataIndex >= 0
- && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge);
- },
-
- /**
- * @return {Object}
- */
- getLayout: function () {
- return this[hostName][dataName].getItemLayout(this.dataIndex);
- },
-
- /**
- * @return {module:zrender/Element}
- */
- getGraphicEl: function () {
- return this[hostName][dataName].getItemGraphicEl(this.dataIndex);
- },
-
- /**
- * @return {number}
- */
- getRawIndex: function () {
- return this[hostName][dataName].getRawIndex(this.dataIndex);
- }
- };
- };
-
- zrUtil.mixin(Node, createGraphDataProxyMixin('hostGraph', 'data'));
- zrUtil.mixin(Edge, createGraphDataProxyMixin('hostGraph', 'edgeData'));
-
- Graph.Node = Node;
- Graph.Edge = Edge;
-
- module.exports = Graph;
-
-
-/***/ },
-/* 193 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
-
- var SymbolDraw = __webpack_require__(98);
- var LineDraw = __webpack_require__(194);
- var RoamController = __webpack_require__(159);
-
- var modelUtil = __webpack_require__(5);
- var graphic = __webpack_require__(42);
-
- __webpack_require__(1).extendChartView({
-
- type: 'graph',
-
- init: function (ecModel, api) {
- var symbolDraw = new SymbolDraw();
- var lineDraw = new LineDraw();
- var group = this.group;
-
- var controller = new RoamController(api.getZr(), group);
-
- group.add(symbolDraw.group);
- group.add(lineDraw.group);
-
- this._symbolDraw = symbolDraw;
- this._lineDraw = lineDraw;
- this._controller = controller;
-
- this._firstRender = true;
- },
-
- render: function (seriesModel, ecModel, api) {
- var coordSys = seriesModel.coordinateSystem;
- // Only support view and geo coordinate system
- if (coordSys.type !== 'geo' && coordSys.type !== 'view') {
- return;
- }
-
- var data = seriesModel.getData();
- this._model = seriesModel;
-
- var symbolDraw = this._symbolDraw;
- var lineDraw = this._lineDraw;
-
- symbolDraw.updateData(data);
-
- var edgeData = data.graph.edgeData;
- var rawOption = seriesModel.option;
- var formatModel = modelUtil.createDataFormatModel(
- seriesModel, edgeData, rawOption.edges || rawOption.links
- );
- formatModel.formatTooltip = function (dataIndex) {
- var params = this.getDataParams(dataIndex);
- var edge = data.graph.getEdgeByIndex(dataIndex);
- var sourceName = data.getName(edge.node1.dataIndex);
- var targetName = data.getName(edge.node2.dataIndex);
- var html = sourceName + ' > ' + targetName;
- if (params.value) {
- html += ' : ' + params.value;
- }
- return html;
- };
-
- lineDraw.updateData(edgeData, null, null);
- edgeData.eachItemGraphicEl(function (el) {
- el.traverse(function (child) {
- child.dataModel = formatModel;
- });
- });
-
- // Save the original lineWidth
- // data.graph.eachEdge(function (edge) {
- // edge.__lineWidth = edge.getModel('lineStyle.normal').get('width');
- // });
-
- var group = this.group;
- var groupNewProp = {
- position: coordSys.position,
- scale: coordSys.scale
- };
- if (this._firstRender) {
- group.attr(groupNewProp);
- }
- else {
- graphic.updateProps(group, groupNewProp, seriesModel);
- }
-
- this._nodeScaleRatio = seriesModel.get('nodeScaleRatio');
- // this._edgeScaleRatio = seriesModel.get('edgeScaleRatio');
-
- this._updateNodeAndLinkScale();
-
- this._updateController(seriesModel, coordSys, api);
-
- clearTimeout(this._layoutTimeout);
- var forceLayout = seriesModel.forceLayout;
- var layoutAnimation = seriesModel.get('force.layoutAnimation');
- if (forceLayout) {
- this._startForceLayoutIteration(forceLayout, layoutAnimation);
- }
- // Update draggable
- data.eachItemGraphicEl(function (el, idx) {
- var draggable = data.getItemModel(idx).get('draggable');
- if (draggable && forceLayout) {
- el.on('drag', function () {
- forceLayout.warmUp();
- !this._layouting
- && this._startForceLayoutIteration(forceLayout, layoutAnimation);
- forceLayout.setFixed(idx);
- // Write position back to layout
- data.setItemLayout(idx, el.position);
- }, this).on('dragend', function () {
- forceLayout.setUnfixed(idx);
- }, this);
- }
- else {
- el.off('drag');
- }
- el.setDraggable(draggable);
- }, this);
-
- this._firstRender = false;
- },
-
- _startForceLayoutIteration: function (forceLayout, layoutAnimation) {
- var self = this;
- (function step() {
- forceLayout.step(function (stopped) {
- self.updateLayout();
- (self._layouting = !stopped) && (
- layoutAnimation
- ? (self._layoutTimeout = setTimeout(step, 16))
- : step()
- );
- });
- })();
- },
-
- _updateController: function (seriesModel, coordSys, api) {
- var controller = this._controller;
- controller.rect = coordSys.getViewRect();
-
- controller.enable(seriesModel.get('roam'));
-
- controller
- .off('pan')
- .off('zoom')
- .on('pan', function (dx, dy) {
- api.dispatchAction({
- seriesId: seriesModel.id,
- type: 'graphRoam',
- dx: dx,
- dy: dy
- });
- })
- .on('zoom', function (zoom, mouseX, mouseY) {
- api.dispatchAction({
- seriesId: seriesModel.id,
- type: 'graphRoam',
- zoom: zoom,
- originX: mouseX,
- originY: mouseY
- });
- })
- .on('zoom', this._updateNodeAndLinkScale, this);
- },
-
- _updateNodeAndLinkScale: function () {
- var seriesModel = this._model;
- var data = seriesModel.getData();
-
- var group = this.group;
- var nodeScaleRatio = this._nodeScaleRatio;
- // var edgeScaleRatio = this._edgeScaleRatio;
-
- // Assume scale aspect is 1
- var groupScale = group.scale[0];
-
- var nodeScale = (groupScale - 1) * nodeScaleRatio + 1;
- // var edgeScale = (groupScale - 1) * edgeScaleRatio + 1;
- var invScale = [
- nodeScale / groupScale,
- nodeScale / groupScale
- ];
-
- data.eachItemGraphicEl(function (el, idx) {
- el.attr('scale', invScale);
- });
- // data.graph.eachEdge(function (edge) {
- // var lineGroup = edge.getGraphicEl();
- // // FIXME
- // lineGroup.childOfName('line').setStyle(
- // 'lineWidth',
- // edge.__lineWidth * edgeScale / groupScale
- // );
- // });
- },
-
- updateLayout: function (seriesModel, ecModel) {
- this._symbolDraw.updateLayout();
- this._lineDraw.updateLayout();
- },
-
- remove: function (ecModel, api) {
- this._symbolDraw && this._symbolDraw.remove();
- this._lineDraw && this._lineDraw.remove();
- }
- });
-
-
-/***/ },
-/* 194 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @module echarts/chart/helper/LineDraw
- */
-
-
- var graphic = __webpack_require__(42);
- var LineGroup = __webpack_require__(195);
-
- /**
- * @alias module:echarts/component/marker/LineDraw
- * @constructor
- */
- function LineDraw(ctor) {
- this._ctor = ctor || LineGroup;
- this.group = new graphic.Group();
- }
-
- var lineDrawProto = LineDraw.prototype;
-
- /**
- * @param {module:echarts/data/List} lineData
- * @param {module:echarts/data/List} [fromData]
- * @param {module:echarts/data/List} [toData]
- */
- lineDrawProto.updateData = function (lineData, fromData, toData) {
-
- var oldLineData = this._lineData;
- var group = this.group;
- var LineCtor = this._ctor;
-
- lineData.diff(oldLineData)
- .add(function (idx) {
- var lineGroup = new LineCtor(lineData, fromData, toData, idx);
-
- lineData.setItemGraphicEl(idx, lineGroup);
-
- group.add(lineGroup);
- })
- .update(function (newIdx, oldIdx) {
- var lineGroup = oldLineData.getItemGraphicEl(oldIdx);
- lineGroup.updateData(lineData, fromData, toData, newIdx);
-
- lineData.setItemGraphicEl(newIdx, lineGroup);
-
- group.add(lineGroup);
- })
- .remove(function (idx) {
- group.remove(oldLineData.getItemGraphicEl(idx));
- })
- .execute();
-
- this._lineData = lineData;
- this._fromData = fromData;
- this._toData = toData;
- };
-
- lineDrawProto.updateLayout = function () {
- var lineData = this._lineData;
- lineData.eachItemGraphicEl(function (el, idx) {
- el.updateLayout(lineData, this._fromData, this._toData, idx);
- }, this);
- };
-
- lineDrawProto.remove = function () {
- this.group.removeAll();
- };
-
- module.exports = LineDraw;
-
-
-/***/ },
-/* 195 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @module echarts/chart/helper/Line
- */
-
-
- var symbolUtil = __webpack_require__(100);
- var vector = __webpack_require__(16);
- var LinePath = __webpack_require__(196);
- var graphic = __webpack_require__(42);
- var zrUtil = __webpack_require__(3);
- var numberUtil = __webpack_require__(7);
-
- /**
- * @inner
- */
- function createSymbol(name, data, idx) {
- var color = data.getItemVisual(idx, 'color');
- var symbolType = data.getItemVisual(idx, 'symbol');
- var symbolSize = data.getItemVisual(idx, 'symbolSize');
-
- if (symbolType === 'none') {
- return;
- }
-
- if (!zrUtil.isArray(symbolSize)) {
- symbolSize = [symbolSize, symbolSize];
- }
- var symbolPath = symbolUtil.createSymbol(
- symbolType, -symbolSize[0] / 2, -symbolSize[1] / 2,
- symbolSize[0], symbolSize[1], color
- );
- symbolPath.name = name;
-
- return symbolPath;
- }
-
- function createLine(points) {
- var line = new LinePath({
- name: 'line',
- style: {
- strokeNoScale: true
- }
- });
- setLinePoints(line.shape, points);
- return line;
- }
-
- function setLinePoints(targetShape, points) {
- var p1 = points[0];
- var p2 = points[1];
- var cp1 = points[2];
- targetShape.x1 = p1[0];
- targetShape.y1 = p1[1];
- targetShape.x2 = p2[0];
- targetShape.y2 = p2[1];
- targetShape.percent = 1;
-
- if (cp1) {
- targetShape.cpx1 = cp1[0];
- targetShape.cpy1 = cp1[1];
- }
- }
-
- function isSymbolArrow(symbol) {
- return symbol.type === 'symbol' && symbol.shape.symbolType === 'arrow';
- }
-
- function updateSymbolBeforeLineUpdate () {
- var lineGroup = this;
- var line = lineGroup.childOfName('line');
- // If line not changed
- if (!this.__dirty && !line.__dirty) {
- return;
- }
- var symbolFrom = lineGroup.childOfName('fromSymbol');
- var symbolTo = lineGroup.childOfName('toSymbol');
- var label = lineGroup.childOfName('label');
- var fromPos = line.pointAt(0);
- var toPos = line.pointAt(line.shape.percent);
-
- var d = vector.sub([], toPos, fromPos);
- vector.normalize(d, d);
-
- if (symbolFrom) {
- symbolFrom.attr('position', fromPos);
- // Rotate the arrow
- // FIXME Hard coded ?
- if (isSymbolArrow(symbolFrom)) {
- symbolFrom.attr('rotation', tangentRotation(toPos, fromPos));
- }
- }
- if (symbolTo) {
- symbolTo.attr('position', toPos);
- if (isSymbolArrow(symbolTo)) {
- symbolTo.attr('rotation', tangentRotation(fromPos, toPos));
- }
- }
-
- label.attr('position', toPos);
-
- var textPosition;
- var textAlign;
- var textVerticalAlign;
- // End
- if (label.__position === 'end') {
- textPosition = [d[0] * 5 + toPos[0], d[1] * 5 + toPos[1]];
- textAlign = d[0] > 0.8 ? 'left' : (d[0] < -0.8 ? 'right' : 'center');
- textVerticalAlign = d[1] > 0.8 ? 'top' : (d[1] < -0.8 ? 'bottom' : 'middle');
- }
- // Start
- else {
- textPosition = [-d[0] * 5 + fromPos[0], -d[1] * 5 + fromPos[1]];
- textAlign = d[0] > 0.8 ? 'right' : (d[0] < -0.8 ? 'left' : 'center');
- textVerticalAlign = d[1] > 0.8 ? 'bottom' : (d[1] < -0.8 ? 'top' : 'middle');
- }
- label.attr({
- style: {
- // Use the user specified text align and baseline first
- textVerticalAlign: label.__verticalAlign || textVerticalAlign,
- textAlign: label.__textAlign || textAlign
- },
- position: textPosition
- });
- }
-
- function tangentRotation(p1, p2) {
- return -Math.PI / 2 - Math.atan2(
- p2[1] - p1[1], p2[0] - p1[0]
- );
- }
-
- /**
- * @constructor
- * @extends {module:zrender/graphic/Group}
- * @alias {module:echarts/chart/helper/Line}
- */
- function Line(lineData, fromData, toData, idx) {
- graphic.Group.call(this);
-
- this._createLine(lineData, fromData, toData, idx);
- }
-
- var lineProto = Line.prototype;
-
- // Update symbol position and rotation
- lineProto.beforeUpdate = updateSymbolBeforeLineUpdate;
-
- lineProto._createLine = function (lineData, fromData, toData, idx) {
- var seriesModel = lineData.hostModel;
- var linePoints = lineData.getItemLayout(idx);
-
- var line = createLine(linePoints);
- line.shape.percent = 0;
- graphic.initProps(line, {
- shape: {
- percent: 1
- }
- }, seriesModel);
-
- this.add(line);
-
- var label = new graphic.Text({
- name: 'label'
- });
- this.add(label);
-
- if (fromData) {
- var symbolFrom = createSymbol('fromSymbol', fromData, idx);
- // symbols must added after line to make sure
- // it will be updated after line#update.
- // Or symbol position and rotation update in line#beforeUpdate will be one frame slow
- this.add(symbolFrom);
-
- this._fromSymbolType = fromData.getItemVisual(idx, 'symbol');
- }
- if (toData) {
- var symbolTo = createSymbol('toSymbol', toData, idx);
- this.add(symbolTo);
-
- this._toSymbolType = toData.getItemVisual(idx, 'symbol');
- }
-
- this._updateCommonStl(lineData, fromData, toData, idx);
- };
-
- lineProto.updateData = function (lineData, fromData, toData, idx) {
- var seriesModel = lineData.hostModel;
-
- var line = this.childOfName('line');
- var linePoints = lineData.getItemLayout(idx);
- var target = {
- shape: {}
- };
- setLinePoints(target.shape, linePoints);
- graphic.updateProps(line, target, seriesModel);
-
- // Symbol changed
- if (fromData) {
- var fromSymbolType = fromData.getItemVisual(idx, 'symbol');
- if (this._fromSymbolType !== fromSymbolType) {
- var symbolFrom = createSymbol('fromSymbol', fromData, idx);
- this.remove(this.childOfName('fromSymbol'));
- this.add(symbolFrom);
- }
- this._fromSymbolType = fromSymbolType;
- }
- if (toData) {
- var toSymbolType = toData.getItemVisual(idx, 'symbol');
- // Symbol changed
- if (toSymbolType !== this._toSymbolType) {
- var symbolTo = createSymbol('toSymbol', toData, idx);
- this.remove(this.childOfName('toSymbol'));
- this.add(symbolTo);
- }
- this._toSymbolType = toSymbolType;
- }
-
- this._updateCommonStl(lineData, fromData, toData, idx);
- };
-
- lineProto._updateCommonStl = function (lineData, fromData, toData, idx) {
- var seriesModel = lineData.hostModel;
-
- var line = this.childOfName('line');
- var itemModel = lineData.getItemModel(idx);
-
- var labelModel = itemModel.getModel('label.normal');
- var textStyleModel = labelModel.getModel('textStyle');
- var labelHoverModel = itemModel.getModel('label.emphasis');
- var textStyleHoverModel = labelHoverModel.getModel('textStyle');
-
- var defaultText = numberUtil.round(seriesModel.getRawValue(idx));
- if (isNaN(defaultText)) {
- // Use name
- defaultText = lineData.getName(idx);
- }
- line.setStyle(zrUtil.extend(
- {
- stroke: lineData.getItemVisual(idx, 'color')
- },
- itemModel.getModel('lineStyle.normal').getLineStyle()
- ));
-
- var label = this.childOfName('label');
- label.setStyle({
- text: labelModel.get('show')
- ? zrUtil.retrieve(
- seriesModel.getFormattedLabel(idx, 'normal'),
- defaultText
- )
- : '',
- textFont: textStyleModel.getFont(),
- fill: textStyleModel.getTextColor() || lineData.getItemVisual(idx, 'color')
- });
- label.hoverStyle = {
- text: labelHoverModel.get('show')
- ? zrUtil.retrieve(
- seriesModel.getFormattedLabel(idx, 'emphasis'),
- defaultText
- )
- : '',
- textFont: textStyleHoverModel.getFont(),
- fill: textStyleHoverModel.getTextColor()
- };
- label.__textAlign = textStyleModel.get('align');
- label.__verticalAlign = textStyleModel.get('baseline');
- label.__position = labelModel.get('position');
-
- graphic.setHoverStyle(
- this, itemModel.getModel('lineStyle.emphasis').getLineStyle()
- );
- };
-
- lineProto.updateLayout = function (lineData, fromData, toData, idx) {
- var points = lineData.getItemLayout(idx);
- var linePath = this.childOfName('line');
- setLinePoints(linePath.shape, points);
- linePath.dirty(true);
- // var fromEl = fromData && fromData.getItemGraphicEl(idx);
- // var toEl = toData && toData.getItemGraphicEl(idx);
- // fromEl && fromEl.attr('position', points[0]);
- // toEl && toEl.attr('position', points[1]);
- };
-
- zrUtil.inherits(Line, graphic.Group);
-
- module.exports = Line;
-
-
-/***/ },
-/* 196 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Line path for bezier and straight line draw
- */
-
- var graphic = __webpack_require__(42);
-
- var straightLineProto = graphic.Line.prototype;
- var bezierCurveProto = graphic.BezierCurve.prototype;
-
- module.exports = graphic.extendShape({
-
- type: 'ec-line',
-
- style: {
- stroke: '#000',
- fill: null
- },
-
- shape: {
- x1: 0,
- y1: 0,
- x2: 0,
- y2: 0,
- percent: 1,
- cpx1: null,
- cpy1: null
- },
-
- buildPath: function (ctx, shape) {
- (shape.cpx1 == null || shape.cpy1 == null
- ? straightLineProto : bezierCurveProto).buildPath(ctx, shape);
- },
-
- pointAt: function (t) {
- var shape = this.shape;
- return shape.cpx1 == null || shape.cpy1 == null
- ? straightLineProto.pointAt.call(this, t)
- : bezierCurveProto.pointAt.call(this, t);
- }
- });
-
-
-/***/ },
-/* 197 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var echarts = __webpack_require__(1);
- var roamHelper = __webpack_require__(162);
-
- var actionInfo = {
- type: 'graphRoam',
- event: 'graphRoam',
- update: 'none'
- };
-
- /**
- * @payload
- * @property {string} name Series name
- * @property {number} [dx]
- * @property {number} [dy]
- * @property {number} [zoom]
- * @property {number} [originX]
- * @property {number} [originY]
- */
-
- echarts.registerAction(actionInfo, function (payload, ecModel) {
- ecModel.eachComponent({mainType: 'series', query: payload}, function (seriesModel) {
- var coordSys = seriesModel.coordinateSystem;
-
- var roamDetailModel = seriesModel.getModel('roamDetail');
- var res = roamHelper.calcPanAndZoom(roamDetailModel, payload);
-
- seriesModel.setRoamPan
- && seriesModel.setRoamPan(res.x, res.y);
-
- seriesModel.setRoamZoom
- && seriesModel.setRoamZoom(res.zoom);
-
- coordSys && coordSys.setPan(res.x, res.y);
- coordSys && coordSys.setZoom(res.zoom);
- });
- });
-
-
-/***/ },
-/* 198 */
-/***/ function(module, exports) {
-
-
-
- module.exports = function (ecModel) {
- var legendModels = ecModel.findComponents({
- mainType: 'legend'
- });
- if (!legendModels || !legendModels.length) {
- return;
- }
- ecModel.eachSeriesByType('graph', function (graphSeries) {
- var categoriesData = graphSeries.getCategoriesData();
- var graph = graphSeries.getGraph();
- var data = graph.data;
-
- var categoryNames = categoriesData.mapArray(categoriesData.getName);
-
- data.filterSelf(function (idx) {
- var model = data.getItemModel(idx);
- var category = model.getShallow('category');
- if (category != null) {
- if (typeof category === 'number') {
- category = categoryNames[category];
- }
- // If in any legend component the status is not selected.
- for (var i = 0; i < legendModels.length; i++) {
- if (!legendModels[i].isSelected(category)) {
- return false;
- }
- }
- }
- return true;
- });
- }, this);
- };
-
-
-/***/ },
-/* 199 */
-/***/ function(module, exports) {
-
-
-
- module.exports = function (ecModel) {
- ecModel.eachSeriesByType('graph', function (seriesModel) {
- var colorList = seriesModel.get('color');
- var categoriesData = seriesModel.getCategoriesData();
- var data = seriesModel.getData();
-
- var categoryNameIdxMap = {};
-
- categoriesData.each(function (idx) {
- categoryNameIdxMap[categoriesData.getName(idx)] = idx;
-
- var itemModel = categoriesData.getItemModel(idx);
- var rawIdx = categoriesData.getRawIndex(idx);
- var color = itemModel.get('itemStyle.normal.color')
- || colorList[rawIdx % colorList.length];
- categoriesData.setItemVisual(idx, 'color', color);
- });
-
- // Assign category color to visual
- if (categoriesData.count()) {
- data.each(function (idx) {
- var model = data.getItemModel(idx);
- var category = model.getShallow('category');
- if (category != null) {
- if (typeof category === 'string') {
- category = categoryNameIdxMap[category];
- }
- data.setItemVisual(
- idx, 'color',
- categoriesData.getItemVisual(category, 'color')
- );
- }
- });
- }
- });
- };
-
-
-/***/ },
-/* 200 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var simpleLayoutHelper = __webpack_require__(201);
- module.exports = function (ecModel, api) {
- ecModel.eachSeriesByType('graph', function (seriesModel) {
- var layout = seriesModel.get('layout');
- if (!layout || layout === 'none') {
- simpleLayoutHelper(seriesModel);
- }
- });
- };
-
-
-/***/ },
-/* 201 */
-/***/ function(module, exports) {
-
-
- module.exports = function (seriesModel) {
- var coordSys = seriesModel.coordinateSystem;
- if (coordSys && coordSys.type !== 'view') {
- return;
- }
- var graph = seriesModel.getGraph();
-
- graph.eachNode(function (node) {
- var model = node.getModel();
- node.setLayout([+model.get('x'), +model.get('y')]);
- });
-
- graph.eachEdge(function (edge) {
- var curveness = edge.getModel().get('lineStyle.normal.curveness') || 0;
- var p1 = edge.node1.getLayout();
- var p2 = edge.node2.getLayout();
- var cp1;
- if (curveness > 0) {
- cp1 = [
- (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness,
- (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness
- ];
- }
- edge.setLayout([p1, p2, cp1]);
- });
- };
-
-
-/***/ },
-/* 202 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- var circularLayoutHelper = __webpack_require__(203);
- module.exports = function (ecModel, api) {
- ecModel.eachSeriesByType('graph', function (seriesModel) {
- if (seriesModel.get('layout') === 'circular') {
- circularLayoutHelper(seriesModel);
- }
- });
- };
-
-
-/***/ },
-/* 203 */
-/***/ function(module, exports) {
-
-
- module.exports = function (seriesModel) {
- var coordSys = seriesModel.coordinateSystem;
- if (coordSys && coordSys.type !== 'view') {
- return;
- }
-
- var rect = coordSys.getBoundingRect();
-
- var nodeData = seriesModel.getData();
- var graph = nodeData.graph;
-
- var angle = 0;
- var sum = nodeData.getSum('value');
- var unitAngle = Math.PI * 2 / (sum || nodeData.count());
-
- var cx = rect.width / 2 + rect.x;
- var cy = rect.height / 2 + rect.y;
-
- var r = Math.min(rect.width, rect.height) / 2;
-
- graph.eachNode(function (node) {
- var value = node.getValue('value');
-
- angle += unitAngle * (sum ? value : 2) / 2;
-
- node.setLayout([
- r * Math.cos(angle) + cx,
- r * Math.sin(angle) + cy
- ]);
-
- angle += unitAngle * (sum ? value : 2) / 2;
- });
-
- graph.eachEdge(function (edge) {
- var curveness = edge.getModel().get('lineStyle.normal.curveness') || 0;
- var p1 = edge.node1.getLayout();
- var p2 = edge.node2.getLayout();
- var cp1;
- if (curveness > 0) {
- cp1 = [cx, cy];
- }
- edge.setLayout([p1, p2, cp1]);
- });
- };
-
-
-/***/ },
-/* 204 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var forceHelper = __webpack_require__(205);
- var numberUtil = __webpack_require__(7);
- var simpleLayoutHelper = __webpack_require__(201);
- var circularLayoutHelper = __webpack_require__(203);
- var vec2 = __webpack_require__(16);
-
- module.exports = function (ecModel, api) {
- ecModel.eachSeriesByType('graph', function (graphSeries) {
- if (graphSeries.get('layout') === 'force') {
- var preservedPoints = graphSeries.preservedPoints || {};
- var graph = graphSeries.getGraph();
- var nodeData = graph.data;
- var edgeData = graph.edgeData;
- var forceModel = graphSeries.getModel('force');
- var initLayout = forceModel.get('initLayout');
- if (graphSeries.preservedPoints) {
- nodeData.each(function (idx) {
- var id = nodeData.getId(idx);
- nodeData.setItemLayout(idx, preservedPoints[id] || [NaN, NaN]);
- });
- }
- else if (!initLayout || initLayout === 'none') {
- simpleLayoutHelper(graphSeries);
- }
- else if (initLayout === 'circular') {
- circularLayoutHelper(graphSeries);
- }
-
- var nodeDataExtent = nodeData.getDataExtent('value');
- // var edgeDataExtent = edgeData.getDataExtent('value');
- var repulsion = forceModel.get('repulsion');
- var edgeLength = forceModel.get('edgeLength');
- var nodes = nodeData.mapArray('value', function (value, idx) {
- var point = nodeData.getItemLayout(idx);
- // var w = numberUtil.linearMap(value, nodeDataExtent, [0, 50]);
- var rep = numberUtil.linearMap(value, nodeDataExtent, [0, repulsion]) || (repulsion / 2);
- return {
- w: rep,
- rep: rep,
- p: (!point || isNaN(point[0]) || isNaN(point[1])) ? null : point
- };
- });
- var edges = edgeData.mapArray('value', function (value, idx) {
- var edge = graph.getEdgeByIndex(idx);
- // var w = numberUtil.linearMap(value, edgeDataExtent, [0, 100]);
- return {
- n1: nodes[edge.node1.dataIndex],
- n2: nodes[edge.node2.dataIndex],
- d: edgeLength,
- curveness: edge.getModel().get('lineStyle.normal.curveness') || 0
- };
- });
-
- var coordSys = graphSeries.coordinateSystem;
- var rect = coordSys.getBoundingRect();
- var forceInstance = forceHelper(nodes, edges, {
- rect: rect,
- gravity: forceModel.get('gravity')
- });
- var oldStep = forceInstance.step;
- forceInstance.step = function (cb) {
- for (var i = 0, l = nodes.length; i < l; i++) {
- if (nodes[i].fixed) {
- // Write back to layout instance
- vec2.copy(nodes[i].p, graph.getNodeByIndex(i).getLayout());
- }
- }
- oldStep(function (nodes, edges, stopped) {
- for (var i = 0, l = nodes.length; i < l; i++) {
- if (!nodes[i].fixed) {
- graph.getNodeByIndex(i).setLayout(nodes[i].p);
- }
- preservedPoints[nodeData.getId(i)] = nodes[i].p;
- }
- for (var i = 0, l = edges.length; i < l; i++) {
- var e = edges[i];
- var p1 = e.n1.p;
- var p2 = e.n2.p;
- var points = [p1, p2];
- if (e.curveness > 0) {
- points.push([
- (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness,
- (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness
- ]);
- }
- graph.getEdgeByIndex(i).setLayout(points);
- }
- // Update layout
-
- cb && cb(stopped);
- });
- };
- graphSeries.forceLayout = forceInstance;
- graphSeries.preservedPoints = preservedPoints;
-
- // Step to get the layout
- forceInstance.step();
- }
- else {
- // Remove prev injected forceLayout instance
- graphSeries.forceLayout = null;
- }
- });
- };
-
-
-/***/ },
-/* 205 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var vec2 = __webpack_require__(16);
- var scaleAndAdd = vec2.scaleAndAdd;
-
- // function adjacentNode(n, e) {
- // return e.n1 === n ? e.n2 : e.n1;
- // }
-
- module.exports = function (nodes, edges, opts) {
- var rect = opts.rect;
- var width = rect.width;
- var height = rect.height;
- var center = [rect.x + width / 2, rect.y + height / 2];
- // var scale = opts.scale || 1;
- var gravity = opts.gravity == null ? 0.1 : opts.gravity;
-
- // for (var i = 0; i < edges.length; i++) {
- // var e = edges[i];
- // var n1 = e.n1;
- // var n2 = e.n2;
- // n1.edges = n1.edges || [];
- // n2.edges = n2.edges || [];
- // n1.edges.push(e);
- // n2.edges.push(e);
- // }
- // Init position
- for (var i = 0; i < nodes.length; i++) {
- var n = nodes[i];
- if (!n.p) {
- // Use the position from first adjecent node with defined position
- // Or use a random position
- // From d3
- // if (n.edges) {
- // var j = -1;
- // while (++j < n.edges.length) {
- // var e = n.edges[j];
- // var other = adjacentNode(n, e);
- // if (other.p) {
- // n.p = vec2.clone(other.p);
- // break;
- // }
- // }
- // }
- // if (!n.p) {
- n.p = vec2.create(
- width * (Math.random() - 0.5) + center[0],
- height * (Math.random() - 0.5) + center[1]
- );
- // }
- }
- n.pp = vec2.clone(n.p);
- n.edges = null;
- }
-
- // Formula in 'Graph Drawing by Force-directed Placement'
- // var k = scale * Math.sqrt(width * height / nodes.length);
- // var k2 = k * k;
-
- var friction = 0.6;
-
- return {
- warmUp: function () {
- friction = 0.5;
- },
-
- setFixed: function (idx) {
- nodes[idx].fixed = true;
- },
-
- setUnfixed: function (idx) {
- nodes[idx].fixed = false;
- },
-
- step: function (cb) {
- var v12 = [];
- var nLen = nodes.length;
- for (var i = 0; i < edges.length; i++) {
- var e = edges[i];
- var n1 = e.n1;
- var n2 = e.n2;
-
- vec2.sub(v12, n2.p, n1.p);
- var d = vec2.len(v12) - e.d;
- var w = n2.w / (n1.w + n2.w);
- vec2.normalize(v12, v12);
-
- !n1.fixed && scaleAndAdd(n1.p, n1.p, v12, w * d * friction);
- !n2.fixed && scaleAndAdd(n2.p, n2.p, v12, -(1 - w) * d * friction);
- }
- // Gravity
- for (var i = 0; i < nLen; i++) {
- var n = nodes[i];
- if (!n.fixed) {
- vec2.sub(v12, center, n.p);
- // var d = vec2.len(v12);
- // vec2.scale(v12, v12, 1 / d);
- // var gravityFactor = gravity;
- vec2.scaleAndAdd(n.p, n.p, v12, gravity * friction);
- }
- }
-
- // Repulsive
- // PENDING
- for (var i = 0; i < nLen; i++) {
- var n1 = nodes[i];
- for (var j = i + 1; j < nLen; j++) {
- var n2 = nodes[j];
- vec2.sub(v12, n2.p, n1.p);
- var d = vec2.len(v12);
- if (d === 0) {
- // Random repulse
- vec2.set(v12, Math.random() - 0.5, Math.random() - 0.5);
- d = 1;
- }
- var repFact = (n1.rep + n2.rep) / d / d;
- !n1.fixed && scaleAndAdd(n1.pp, n1.pp, v12, repFact);
- !n2.fixed && scaleAndAdd(n2.pp, n2.pp, v12, -repFact);
- }
- }
- var v = [];
- for (var i = 0; i < nLen; i++) {
- var n = nodes[i];
- if (!n.fixed) {
- vec2.sub(v, n.p, n.pp);
- vec2.scaleAndAdd(n.p, n.p, v, friction);
- vec2.copy(n.pp, n.p);
- }
- }
-
- friction = friction * 0.992;
-
- cb && cb(nodes, edges, friction < 0.01);
- }
- };
- };
-
-
-/***/ },
-/* 206 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- // FIXME Where to create the simple view coordinate system
- var View = __webpack_require__(169);
- var layout = __webpack_require__(21);
- var bbox = __webpack_require__(50);
-
- function getViewRect(seriesModel, api, aspect) {
- var option = seriesModel.getBoxLayoutParams();
- option.aspect = aspect;
- return layout.getLayoutRect(option, {
- width: api.getWidth(),
- height: api.getHeight()
- });
- }
-
- module.exports = function (ecModel, api) {
- var viewList = [];
- ecModel.eachSeriesByType('graph', function (seriesModel) {
- var coordSysType = seriesModel.get('coordinateSystem');
- if (!coordSysType || coordSysType === 'view') {
- var viewCoordSys = new View();
- viewList.push(viewCoordSys);
-
- var data = seriesModel.getData();
- var positions = data.mapArray(function (idx) {
- var itemModel = data.getItemModel(idx);
- return [+itemModel.get('x'), +itemModel.get('y')];
- });
-
- var min = [];
- var max = [];
-
- bbox.fromPoints(positions, min, max);
-
- // FIXME If get view rect after data processed?
- var viewRect = getViewRect(
- seriesModel, api, (max[0] - min[0]) / (max[1] - min[1]) || 1
- );
- // Position may be NaN, use view rect instead
- if (isNaN(min[0]) || isNaN(min[1])) {
- min = [viewRect.x, viewRect.y];
- max = [viewRect.x + viewRect.width, viewRect.y + viewRect.height];
- }
-
- var bbWidth = max[0] - min[0];
- var bbHeight = max[1] - min[1];
-
- var viewWidth = viewRect.width;
- var viewHeight = viewRect.height;
-
- viewCoordSys = seriesModel.coordinateSystem = new View();
-
- viewCoordSys.setBoundingRect(
- min[0], min[1], bbWidth, bbHeight
- );
- viewCoordSys.setViewRect(
- viewRect.x, viewRect.y, viewWidth, viewHeight
- );
-
- // Update roam info
- var roamDetailModel = seriesModel.getModel('roamDetail');
- viewCoordSys.setPan(roamDetailModel.get('x') || 0, roamDetailModel.get('y') || 0);
- viewCoordSys.setZoom(roamDetailModel.get('zoom') || 1);
- }
- });
- return viewList;
- };
-
-
-/***/ },
-/* 207 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- __webpack_require__(208);
- __webpack_require__(209);
-
-
-/***/ },
-/* 208 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var List = __webpack_require__(94);
- var SeriesModel = __webpack_require__(27);
- var zrUtil = __webpack_require__(3);
-
- var GaugeSeries = SeriesModel.extend({
-
- type: 'series.gauge',
-
- getInitialData: function (option, ecModel) {
- var list = new List(['value'], this);
- var dataOpt = option.data || [];
- if (!zrUtil.isArray(dataOpt)) {
- dataOpt = [dataOpt];
- }
- // Only use the first data item
- list.initData(dataOpt);
- return list;
- },
-
- defaultOption: {
- zlevel: 0,
- z: 2,
- // 默认全局居中
- center: ['50%', '50%'],
- legendHoverLink: true,
- radius: '75%',
- startAngle: 225,
- endAngle: -45,
- clockwise: true,
- // 最小值
- min: 0,
- // 最大值
- max: 100,
- // 分割段数,默认为10
- splitNumber: 10,
- // 坐标轴线
- axisLine: {
- // 默认显示,属性show控制显示与否
- show: true,
- lineStyle: { // 属性lineStyle控制线条样式
- color: [[0.2, '#91c7ae'], [0.8, '#63869e'], [1, '#c23531']],
- width: 30
- }
- },
- // 分隔线
- splitLine: {
- // 默认显示,属性show控制显示与否
- show: true,
- // 属性length控制线长
- length: 30,
- // 属性lineStyle(详见lineStyle)控制线条样式
- lineStyle: {
- color: '#eee',
- width: 2,
- type: 'solid'
- }
- },
- // 坐标轴小标记
- axisTick: {
- // 属性show控制显示与否,默认不显示
- show: true,
- // 每份split细分多少段
- splitNumber: 5,
- // 属性length控制线长
- length: 8,
- // 属性lineStyle控制线条样式
- lineStyle: {
- color: '#eee',
- width: 1,
- type: 'solid'
- }
- },
- axisLabel: {
- show: true,
- // formatter: null,
- textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
- color: 'auto'
- }
- },
- pointer: {
- show: true,
- length: '80%',
- width: 8
- },
- itemStyle: {
- normal: {
- color: 'auto'
- }
- },
- title: {
- show: true,
- // x, y,单位px
- offsetCenter: [0, '-40%'],
- // 其余属性默认使用全局文本样式,详见TEXTSTYLE
- textStyle: {
- color: '#333',
- fontSize: 15
- }
- },
- detail: {
- show: true,
- backgroundColor: 'rgba(0,0,0,0)',
- borderWidth: 0,
- borderColor: '#ccc',
- width: 100,
- height: 40,
- // x, y,单位px
- offsetCenter: [0, '40%'],
- // formatter: null,
- // 其余属性默认使用全局文本样式,详见TEXTSTYLE
- textStyle: {
- color: 'auto',
- fontSize: 30
- }
- }
- }
- });
-
- module.exports = GaugeSeries;
-
-
-/***/ },
-/* 209 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var PointerPath = __webpack_require__(210);
-
- var graphic = __webpack_require__(42);
- var numberUtil = __webpack_require__(7);
- var parsePercent = numberUtil.parsePercent;
-
- function parsePosition(seriesModel, api) {
- var center = seriesModel.get('center');
- var width = api.getWidth();
- var height = api.getHeight();
- var size = Math.min(width, height);
- var cx = parsePercent(center[0], api.getWidth());
- var cy = parsePercent(center[1], api.getHeight());
- var r = parsePercent(seriesModel.get('radius'), size / 2);
-
- return {
- cx: cx,
- cy: cy,
- r: r
- };
- }
-
- function formatLabel(label, labelFormatter) {
- if (labelFormatter) {
- if (typeof labelFormatter === 'string') {
- label = labelFormatter.replace('{value}', label);
- }
- else if (typeof labelFormatter === 'function') {
- label = labelFormatter(label);
- }
- }
-
- return label;
- }
-
- var PI2 = Math.PI * 2;
-
- var GaugeView = __webpack_require__(41).extend({
-
- type: 'gauge',
-
- render: function (seriesModel, ecModel, api) {
-
- this.group.removeAll();
-
- var colorList = seriesModel.get('axisLine.lineStyle.color');
- var posInfo = parsePosition(seriesModel, api);
-
- this._renderMain(
- seriesModel, ecModel, api, colorList, posInfo
- );
- },
-
- _renderMain: function (seriesModel, ecModel, api, colorList, posInfo) {
- var group = this.group;
-
- var axisLineModel = seriesModel.getModel('axisLine');
- var lineStyleModel = axisLineModel.getModel('lineStyle');
-
- var clockwise = seriesModel.get('clockwise');
- var startAngle = -seriesModel.get('startAngle') / 180 * Math.PI;
- var endAngle = -seriesModel.get('endAngle') / 180 * Math.PI;
-
- var angleRangeSpan = (endAngle - startAngle) % PI2;
-
- var prevEndAngle = startAngle;
- var axisLineWidth = lineStyleModel.get('width');
-
- for (var i = 0; i < colorList.length; i++) {
- var endAngle = startAngle + angleRangeSpan * colorList[i][0];
- var sector = new graphic.Sector({
- shape: {
- startAngle: prevEndAngle,
- endAngle: endAngle,
- cx: posInfo.cx,
- cy: posInfo.cy,
- clockwise: clockwise,
- r0: posInfo.r - axisLineWidth,
- r: posInfo.r
- },
- silent: true
- });
-
- sector.setStyle({
- fill: colorList[i][1]
- });
-
- sector.setStyle(lineStyleModel.getLineStyle(
- // Because we use sector to simulate arc
- // so the properties for stroking are useless
- ['color', 'borderWidth', 'borderColor']
- ));
-
- group.add(sector);
-
- prevEndAngle = endAngle;
- }
-
- var getColor = function (percent) {
- // Less than 0
- if (percent <= 0) {
- return colorList[0][1];
- }
- for (var i = 0; i < colorList.length; i++) {
- if (colorList[i][0] >= percent
- && (i === 0 ? 0 : colorList[i - 1][0]) < percent
- ) {
- return colorList[i][1];
- }
- }
- // More than 1
- return colorList[i - 1][1];
- };
-
- if (!clockwise) {
- var tmp = startAngle;
- startAngle = endAngle;
- endAngle = tmp;
- }
-
- this._renderTicks(
- seriesModel, ecModel, api, getColor, posInfo,
- startAngle, endAngle, clockwise
- );
-
- this._renderPointer(
- seriesModel, ecModel, api, getColor, posInfo,
- startAngle, endAngle, clockwise
- );
-
- this._renderTitle(
- seriesModel, ecModel, api, getColor, posInfo
- );
- this._renderDetail(
- seriesModel, ecModel, api, getColor, posInfo
- );
- },
-
- _renderTicks: function (
- seriesModel, ecModel, api, getColor, posInfo,
- startAngle, endAngle, clockwise
- ) {
- var group = this.group;
- var cx = posInfo.cx;
- var cy = posInfo.cy;
- var r = posInfo.r;
-
- var minVal = seriesModel.get('min');
- var maxVal = seriesModel.get('max');
-
- var splitLineModel = seriesModel.getModel('splitLine');
- var tickModel = seriesModel.getModel('axisTick');
- var labelModel = seriesModel.getModel('axisLabel');
-
- var splitNumber = seriesModel.get('splitNumber');
- var subSplitNumber = tickModel.get('splitNumber');
-
- var splitLineLen = parsePercent(
- splitLineModel.get('length'), r
- );
- var tickLen = parsePercent(
- tickModel.get('length'), r
- );
-
- var angle = startAngle;
- var step = (endAngle - startAngle) / splitNumber;
- var subStep = step / subSplitNumber;
-
- var splitLineStyle = splitLineModel.getModel('lineStyle').getLineStyle();
- var tickLineStyle = tickModel.getModel('lineStyle').getLineStyle();
- var textStyleModel = labelModel.getModel('textStyle');
-
- for (var i = 0; i <= splitNumber; i++) {
- var unitX = Math.cos(angle);
- var unitY = Math.sin(angle);
- // Split line
- if (splitLineModel.get('show')) {
- var splitLine = new graphic.Line({
- shape: {
- x1: unitX * r + cx,
- y1: unitY * r + cy,
- x2: unitX * (r - splitLineLen) + cx,
- y2: unitY * (r - splitLineLen) + cy
- },
- style: splitLineStyle,
- silent: true
- });
- if (splitLineStyle.stroke === 'auto') {
- splitLine.setStyle({
- stroke: getColor(i / splitNumber)
- });
- }
-
- group.add(splitLine);
- }
-
- // Label
- if (labelModel.get('show')) {
- var label = formatLabel(
- numberUtil.round(i / splitNumber * (maxVal - minVal) + minVal),
- labelModel.get('formatter')
- );
-
- var text = new graphic.Text({
- style: {
- text: label,
- x: unitX * (r - splitLineLen - 5) + cx,
- y: unitY * (r - splitLineLen - 5) + cy,
- fill: textStyleModel.getTextColor(),
- textFont: textStyleModel.getFont(),
- textVerticalAlign: unitY < -0.4 ? 'top' : (unitY > 0.4 ? 'bottom' : 'middle'),
- textAlign: unitX < -0.4 ? 'left' : (unitX > 0.4 ? 'right' : 'center')
- },
- silent: true
- });
- if (text.style.fill === 'auto') {
- text.setStyle({
- fill: getColor(i / splitNumber)
- });
- }
-
- group.add(text);
- }
-
- // Axis tick
- if (tickModel.get('show') && i !== splitNumber) {
- for (var j = 0; j <= subSplitNumber; j++) {
- var unitX = Math.cos(angle);
- var unitY = Math.sin(angle);
- var tickLine = new graphic.Line({
- shape: {
- x1: unitX * r + cx,
- y1: unitY * r + cy,
- x2: unitX * (r - tickLen) + cx,
- y2: unitY * (r - tickLen) + cy
- },
- silent: true,
- style: tickLineStyle
- });
-
- if (tickLineStyle.stroke === 'auto') {
- tickLine.setStyle({
- stroke: getColor((i + j / subSplitNumber) / splitNumber)
- });
- }
-
- group.add(tickLine);
- angle += subStep;
- }
- angle -= subStep;
- }
- else {
- angle += step;
- }
- }
- },
-
- _renderPointer: function (
- seriesModel, ecModel, api, getColor, posInfo,
- startAngle, endAngle, clockwise
- ) {
- var linearMap = numberUtil.linearMap;
- var valueExtent = [+seriesModel.get('min'), +seriesModel.get('max')];
- var angleExtent = [startAngle, endAngle];
-
- if (!clockwise) {
- angleExtent = angleExtent.reverse();
- }
-
- var data = seriesModel.getData();
- var oldData = this._data;
-
- var group = this.group;
-
- data.diff(oldData)
- .add(function (idx) {
- var pointer = new PointerPath({
- shape: {
- angle: startAngle
- }
- });
-
- graphic.updateProps(pointer, {
- shape: {
- angle: linearMap(data.get('value', idx), valueExtent, angleExtent)
- }
- }, seriesModel);
-
- group.add(pointer);
- data.setItemGraphicEl(idx, pointer);
- })
- .update(function (newIdx, oldIdx) {
- var pointer = oldData.getItemGraphicEl(oldIdx);
-
- graphic.updateProps(pointer, {
- shape: {
- angle: linearMap(data.get('value', newIdx), valueExtent, angleExtent)
- }
- }, seriesModel);
-
- group.add(pointer);
- data.setItemGraphicEl(newIdx, pointer);
- })
- .remove(function (idx) {
- var pointer = oldData.getItemGraphicEl(idx);
- group.remove(pointer);
- })
- .execute();
-
- data.eachItemGraphicEl(function (pointer, idx) {
- var itemModel = data.getItemModel(idx);
- var pointerModel = itemModel.getModel('pointer');
-
- pointer.attr({
- shape: {
- x: posInfo.cx,
- y: posInfo.cy,
- width: parsePercent(
- pointerModel.get('width'), posInfo.r
- ),
- r: parsePercent(pointerModel.get('length'), posInfo.r)
- },
- style: itemModel.getModel('itemStyle.normal').getItemStyle()
- });
-
- if (pointer.style.fill === 'auto') {
- pointer.setStyle('fill', getColor(
- (data.get('value', idx) - valueExtent[0]) / (valueExtent[1] - valueExtent[0])
- ));
- }
-
- graphic.setHoverStyle(
- pointer, itemModel.getModel('itemStyle.emphasis').getItemStyle()
- );
- });
-
- this._data = data;
- },
-
- _renderTitle: function (
- seriesModel, ecModel, api, getColor, posInfo
- ) {
- var titleModel = seriesModel.getModel('title');
- if (titleModel.get('show')) {
- var textStyleModel = titleModel.getModel('textStyle');
- var offsetCenter = titleModel.get('offsetCenter');
- var x = posInfo.cx + parsePercent(offsetCenter[0], posInfo.r);
- var y = posInfo.cy + parsePercent(offsetCenter[1], posInfo.r);
- var text = new graphic.Text({
- style: {
- x: x,
- y: y,
- // FIXME First data name ?
- text: seriesModel.getData().getName(0),
- fill: textStyleModel.getTextColor(),
- textFont: textStyleModel.getFont(),
- textAlign: 'center',
- textVerticalAlign: 'middle'
- }
- });
- this.group.add(text);
- }
- },
-
- _renderDetail: function (
- seriesModel, ecModel, api, getColor, posInfo
- ) {
- var detailModel = seriesModel.getModel('detail');
- var minVal = seriesModel.get('min');
- var maxVal = seriesModel.get('max');
- if (detailModel.get('show')) {
- var textStyleModel = detailModel.getModel('textStyle');
- var offsetCenter = detailModel.get('offsetCenter');
- var x = posInfo.cx + parsePercent(offsetCenter[0], posInfo.r);
- var y = posInfo.cy + parsePercent(offsetCenter[1], posInfo.r);
- var width = parsePercent(detailModel.get('width'), posInfo.r);
- var height = parsePercent(detailModel.get('height'), posInfo.r);
- var value = seriesModel.getData().get('value', 0);
- var rect = new graphic.Rect({
- shape: {
- x: x - width / 2,
- y: y - height / 2,
- width: width,
- height: height
- },
- style: {
- text: formatLabel(
- // FIXME First data name ?
- value, detailModel.get('formatter')
- ),
- fill: detailModel.get('backgroundColor'),
- textFill: textStyleModel.getTextColor(),
- textFont: textStyleModel.getFont()
- }
- });
- if (rect.style.textFill === 'auto') {
- rect.setStyle('textFill', getColor((value - minVal) / (maxVal - minVal)));
- }
- rect.setStyle(detailModel.getItemStyle(['color']));
- this.group.add(rect);
- }
- }
- });
-
- module.exports = GaugeView;
-
-
-/***/ },
-/* 210 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- module.exports = __webpack_require__(44).extend({
-
- type: 'echartsGaugePointer',
-
- shape: {
- angle: 0,
-
- width: 10,
-
- r: 10,
-
- x: 0,
-
- y: 0
- },
-
- buildPath: function (ctx, shape) {
- var mathCos = Math.cos;
- var mathSin = Math.sin;
-
- var r = shape.r;
- var width = shape.width;
- var angle = shape.angle;
- var x = shape.x - mathCos(angle) * width * (width >= r / 3 ? 1 : 2);
- var y = shape.y - mathSin(angle) * width * (width >= r / 3 ? 1 : 2);
-
- angle = shape.angle - Math.PI / 2;
- ctx.moveTo(x, y);
- ctx.lineTo(
- shape.x + mathCos(angle) * width,
- shape.y + mathSin(angle) * width
- );
- ctx.lineTo(
- shape.x + mathCos(shape.angle) * r,
- shape.y + mathSin(shape.angle) * r
- );
- ctx.lineTo(
- shape.x - mathCos(angle) * width,
- shape.y - mathSin(angle) * width
- );
- ctx.lineTo(x, y);
- return;
- }
- });
-
-
-/***/ },
-/* 211 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var echarts = __webpack_require__(1);
-
- __webpack_require__(212);
- __webpack_require__(213);
-
- echarts.registerVisualCoding(
- 'chart', zrUtil.curry(__webpack_require__(137), 'funnel')
- );
- echarts.registerLayout(__webpack_require__(214));
-
- echarts.registerProcessor(
- 'filter', zrUtil.curry(__webpack_require__(140), 'funnel')
- );
-
-
-/***/ },
-/* 212 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var List = __webpack_require__(94);
- var modelUtil = __webpack_require__(5);
- var completeDimensions = __webpack_require__(96);
-
- var FunnelSeries = __webpack_require__(1).extendSeriesModel({
-
- type: 'series.funnel',
-
- init: function (option) {
- FunnelSeries.superApply(this, 'init', arguments);
-
- // Enable legend selection for each data item
- // Use a function instead of direct access because data reference may changed
- this.legendDataProvider = function () {
- return this._dataBeforeProcessed;
- };
- // Extend labelLine emphasis
- this._defaultLabelLine(option);
- },
-
- getInitialData: function (option, ecModel) {
- var dimensions = completeDimensions(['value'], option.data);
- var list = new List(dimensions, this);
- list.initData(option.data);
- return list;
- },
-
- _defaultLabelLine: function (option) {
- // Extend labelLine emphasis
- modelUtil.defaultEmphasis(option.labelLine, ['show']);
-
- var labelLineNormalOpt = option.labelLine.normal;
- var labelLineEmphasisOpt = option.labelLine.emphasis;
- // Not show label line if `label.normal.show = false`
- labelLineNormalOpt.show = labelLineNormalOpt.show
- && option.label.normal.show;
- labelLineEmphasisOpt.show = labelLineEmphasisOpt.show
- && option.label.emphasis.show;
- },
-
- defaultOption: {
- zlevel: 0, // 一级层叠
- z: 2, // 二级层叠
- legendHoverLink: true,
- left: 80,
- top: 60,
- right: 80,
- bottom: 60,
- // width: {totalWidth} - left - right,
- // height: {totalHeight} - top - bottom,
-
- // 默认取数据最小最大值
- // min: 0,
- // max: 100,
- minSize: '0%',
- maxSize: '100%',
- sort: 'descending', // 'ascending', 'descending'
- gap: 0,
- funnelAlign: 'center',
- label: {
- normal: {
- show: true,
- position: 'outer'
- // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
- // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
- },
- emphasis: {
- show: true
- }
- },
- labelLine: {
- normal: {
- show: true,
- length: 20,
- lineStyle: {
- // color: 各异,
- width: 1,
- type: 'solid'
- }
- },
- emphasis: {}
- },
- itemStyle: {
- normal: {
- // color: 各异,
- borderColor: '#fff',
- borderWidth: 1
- },
- emphasis: {
- // color: 各异,
- }
- }
- }
- });
-
- module.exports = FunnelSeries;
-
-
-/***/ },
-/* 213 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var graphic = __webpack_require__(42);
- var zrUtil = __webpack_require__(3);
-
- /**
- * Piece of pie including Sector, Label, LabelLine
- * @constructor
- * @extends {module:zrender/graphic/Group}
- */
- function FunnelPiece(data, idx) {
-
- graphic.Group.call(this);
-
- var polygon = new graphic.Polygon();
- var labelLine = new graphic.Polyline();
- var text = new graphic.Text();
- this.add(polygon);
- this.add(labelLine);
- this.add(text);
-
- this.updateData(data, idx, true);
-
- // Hover to change label and labelLine
- function onEmphasis() {
- labelLine.ignore = labelLine.hoverIgnore;
- text.ignore = text.hoverIgnore;
- }
- function onNormal() {
- labelLine.ignore = labelLine.normalIgnore;
- text.ignore = text.normalIgnore;
- }
- this.on('emphasis', onEmphasis)
- .on('normal', onNormal)
- .on('mouseover', onEmphasis)
- .on('mouseout', onNormal);
- }
-
- var funnelPieceProto = FunnelPiece.prototype;
-
- function getLabelStyle(data, idx, state, labelModel) {
- var textStyleModel = labelModel.getModel('textStyle');
- var position = labelModel.get('position');
- var isLabelInside = position === 'inside' || position === 'inner' || position === 'center';
- return {
- fill: textStyleModel.getTextColor()
- || (isLabelInside ? '#fff' : data.getItemVisual(idx, 'color')),
- textFont: textStyleModel.getFont(),
- text: zrUtil.retrieve(
- data.hostModel.getFormattedLabel(idx, state),
- data.getName(idx)
- )
- };
- }
-
- var opacityAccessPath = ['itemStyle', 'normal', 'opacity'];
- funnelPieceProto.updateData = function (data, idx, firstCreate) {
-
- var polygon = this.childAt(0);
-
- var seriesModel = data.hostModel;
- var itemModel = data.getItemModel(idx);
- var layout = data.getItemLayout(idx);
- var opacity = data.getItemModel(idx).get(opacityAccessPath);
- opacity = opacity == null ? 1 : opacity;
- if (firstCreate) {
- polygon.setShape({
- points: layout.points
- });
- polygon.setStyle({ opacity : 0 });
- graphic.updateProps(polygon, {
- style: {
- opacity: opacity
- }
- }, seriesModel);
- }
- else {
- graphic.initProps(polygon, {
- shape: {
- points: layout.points
- }
- }, seriesModel);
- }
-
- // Update common style
- var itemStyleModel = itemModel.getModel('itemStyle');
- var visualColor = data.getItemVisual(idx, 'color');
-
- polygon.setStyle(
- zrUtil.defaults(
- {
- fill: visualColor
- },
- itemStyleModel.getModel('normal').getItemStyle()
- )
- );
- polygon.hoverStyle = itemStyleModel.getModel('emphasis').getItemStyle();
-
- this._updateLabel(data, idx);
-
- graphic.setHoverStyle(this);
- };
-
- funnelPieceProto._updateLabel = function (data, idx) {
-
- var labelLine = this.childAt(1);
- var labelText = this.childAt(2);
-
- var seriesModel = data.hostModel;
- var itemModel = data.getItemModel(idx);
- var layout = data.getItemLayout(idx);
- var labelLayout = layout.label;
- var visualColor = data.getItemVisual(idx, 'color');
-
- graphic.updateProps(labelLine, {
- shape: {
- points: labelLayout.linePoints || labelLayout.linePoints
- }
- }, seriesModel);
-
- graphic.updateProps(labelText, {
- style: {
- x: labelLayout.x,
- y: labelLayout.y
- }
- }, seriesModel);
- labelText.attr({
- style: {
- textAlign: labelLayout.textAlign,
- textVerticalAlign: labelLayout.verticalAlign,
- textFont: labelLayout.font
- },
- rotation: labelLayout.rotation,
- origin: [labelLayout.x, labelLayout.y],
- z2: 10
- });
-
- var labelModel = itemModel.getModel('label.normal');
- var labelHoverModel = itemModel.getModel('label.emphasis');
- var labelLineModel = itemModel.getModel('labelLine.normal');
- var labelLineHoverModel = itemModel.getModel('labelLine.emphasis');
-
- labelText.setStyle(getLabelStyle(data, idx, 'normal', labelModel));
-
- labelText.ignore = labelText.normalIgnore = !labelModel.get('show');
- labelText.hoverIgnore = !labelHoverModel.get('show');
-
- labelLine.ignore = labelLine.normalIgnore = !labelLineModel.get('show');
- labelLine.hoverIgnore = !labelLineHoverModel.get('show');
-
- // Default use item visual color
- labelLine.setStyle({
- stroke: visualColor
- });
- labelLine.setStyle(labelLineModel.getModel('lineStyle').getLineStyle());
-
- labelText.hoverStyle = getLabelStyle(data, idx, 'emphasis', labelHoverModel);
- labelLine.hoverStyle = labelLineHoverModel.getModel('lineStyle').getLineStyle();
- };
-
- zrUtil.inherits(FunnelPiece, graphic.Group);
-
-
- var Funnel = __webpack_require__(41).extend({
-
- type: 'funnel',
-
- render: function (seriesModel, ecModel, api) {
- var data = seriesModel.getData();
- var oldData = this._data;
-
- var group = this.group;
-
- data.diff(oldData)
- .add(function (idx) {
- var funnelPiece = new FunnelPiece(data, idx);
-
- data.setItemGraphicEl(idx, funnelPiece);
-
- group.add(funnelPiece);
- })
- .update(function (newIdx, oldIdx) {
- var piePiece = oldData.getItemGraphicEl(oldIdx);
-
- piePiece.updateData(data, newIdx);
-
- group.add(piePiece);
- data.setItemGraphicEl(newIdx, piePiece);
- })
- .remove(function (idx) {
- var piePiece = oldData.getItemGraphicEl(idx);
- group.remove(piePiece);
- })
- .execute();
-
- this._data = data;
- },
-
- remove: function () {
- this.group.removeAll();
- this._data = null;
- }
- });
-
- module.exports = Funnel;
-
-
-/***/ },
-/* 214 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var layout = __webpack_require__(21);
- var number = __webpack_require__(7);
-
- var parsePercent = number.parsePercent;
-
- function getViewRect(seriesModel, api) {
- return layout.getLayoutRect(
- seriesModel.getBoxLayoutParams(), {
- width: api.getWidth(),
- height: api.getHeight()
- }
- );
- }
-
- function getSortedIndices(data, sort) {
- var valueArr = data.mapArray('value', function (val) {
- return val;
- });
- var indices = [];
- var isAscending = sort === 'ascending';
- for (var i = 0, len = data.count(); i < len; i++) {
- indices[i] = i;
- }
- indices.sort(function (a, b) {
- return isAscending ? valueArr[a] - valueArr[b] : valueArr[b] - valueArr[a];
- });
- return indices;
- }
-
- function labelLayout (data) {
- data.each(function (idx) {
- var itemModel = data.getItemModel(idx);
- var labelModel = itemModel.getModel('label.normal');
- var labelPosition = labelModel.get('position');
-
- var labelLineModel = itemModel.getModel('labelLine.normal');
-
- var layout = data.getItemLayout(idx);
- var points = layout.points;
-
- var isLabelInside = labelPosition === 'inner'
- || labelPosition === 'inside' || labelPosition === 'center';
-
- var textAlign;
- var textX;
- var textY;
- var linePoints;
-
- if (isLabelInside) {
- textX = (points[0][0] + points[1][0] + points[2][0] + points[3][0]) / 4;
- textY = (points[0][1] + points[1][1] + points[2][1] + points[3][1]) / 4;
- textAlign = 'center';
- linePoints = [
- [textX, textY], [textX, textY]
- ];
- }
- else {
- var x1;
- var y1;
- var x2;
- var labelLineLen = labelLineModel.get('length');
- if (labelPosition === 'left') {
- // Left side
- x1 = (points[3][0] + points[0][0]) / 2;
- y1 = (points[3][1] + points[0][1]) / 2;
- x2 = x1 - labelLineLen;
- textX = x2 - 5;
- textAlign = 'right';
- }
- else {
- // Right side
- x1 = (points[1][0] + points[2][0]) / 2;
- y1 = (points[1][1] + points[2][1]) / 2;
- x2 = x1 + labelLineLen;
- textX = x2 + 5;
- textAlign = 'left';
- }
- var y2 = y1;
-
- linePoints = [[x1, y1], [x2, y2]];
- textY = y2;
- }
-
- layout.label = {
- linePoints: linePoints,
- x: textX,
- y: textY,
- verticalAlign: 'middle',
- textAlign: textAlign,
- inside: isLabelInside
- };
- });
- }
-
- module.exports = function (ecModel, api) {
- ecModel.eachSeriesByType('funnel', function (seriesModel) {
- var data = seriesModel.getData();
- var sort = seriesModel.get('sort');
- var viewRect = getViewRect(seriesModel, api);
- var indices = getSortedIndices(data, sort);
-
- var sizeExtent = [
- parsePercent(seriesModel.get('minSize'), viewRect.width),
- parsePercent(seriesModel.get('maxSize'), viewRect.width)
- ];
- var dataExtent = data.getDataExtent('value');
- var min = seriesModel.get('min');
- var max = seriesModel.get('max');
- if (min == null) {
- min = Math.min(dataExtent[0], 0);
- }
- if (max == null) {
- max = dataExtent[1];
- }
-
- var funnelAlign = seriesModel.get('funnelAlign');
- var gap = seriesModel.get('gap');
- var itemHeight = (viewRect.height - gap * (data.count() - 1)) / data.count();
-
- var y = viewRect.y;
-
- var getLinePoints = function (idx, offY) {
- // End point index is data.count() and we assign it 0
- var val = data.get('value', idx) || 0;
- var itemWidth = number.linearMap(val, [min, max], sizeExtent, true);
- var x0;
- switch (funnelAlign) {
- case 'left':
- x0 = viewRect.x;
- break;
- case 'center':
- x0 = viewRect.x + (viewRect.width - itemWidth) / 2;
- break;
- case 'right':
- x0 = viewRect.x + viewRect.width - itemWidth;
- break;
- }
- return [
- [x0, offY],
- [x0 + itemWidth, offY]
- ];
- };
-
- if (sort === 'ascending') {
- // From bottom to top
- itemHeight = -itemHeight;
- gap = -gap;
- y += viewRect.height;
- indices = indices.reverse();
- }
-
- for (var i = 0; i < indices.length; i++) {
- var idx = indices[i];
- var nextIdx = indices[i + 1];
- var start = getLinePoints(idx, y);
- var end = getLinePoints(nextIdx, y + itemHeight);
-
- y += itemHeight + gap;
-
- data.setItemLayout(idx, {
- points: start.concat(end.slice().reverse())
- });
- }
-
- labelLayout(data);
- });
- };
-
-
-/***/ },
-/* 215 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var echarts = __webpack_require__(1);
-
- __webpack_require__(216);
-
- __webpack_require__(227);
- __webpack_require__(228);
-
- echarts.registerVisualCoding('chart', __webpack_require__(229));
-
-
-
-/***/ },
-/* 216 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- __webpack_require__(217);
- __webpack_require__(220);
- __webpack_require__(222);
-
- var echarts = __webpack_require__(1);
-
- // Parallel view
- echarts.extendComponentView({
- type: 'parallel'
- });
-
- echarts.registerPreprocessor(
- __webpack_require__(226)
- );
-
-
-
-/***/ },
-/* 217 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Parallel coordinate system creater.
- */
-
-
- var Parallel = __webpack_require__(218);
-
- function create(ecModel, api) {
- var coordSysList = [];
-
- ecModel.eachComponent('parallel', function (parallelModel, idx) {
- var coordSys = new Parallel(parallelModel, ecModel, api);
-
- coordSys.name = 'parallel_' + idx;
- coordSys.resize(parallelModel, api);
-
- parallelModel.coordinateSystem = coordSys;
- coordSys.model = parallelModel;
-
- coordSysList.push(coordSys);
- });
-
- // Inject the coordinateSystems into seriesModel
- ecModel.eachSeries(function (seriesModel) {
- if (seriesModel.get('coordinateSystem') === 'parallel') {
- var parallelIndex = seriesModel.get('parallelIndex');
- seriesModel.coordinateSystem = coordSysList[parallelIndex];
- }
- });
-
- return coordSysList;
- }
-
- __webpack_require__(25).register('parallel', {create: create});
-
-
-
-/***/ },
-/* 218 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Parallel Coordinates
- * <https://en.wikipedia.org/wiki/Parallel_coordinates>
- */
-
-
- var layout = __webpack_require__(21);
- var axisHelper = __webpack_require__(108);
- var zrUtil = __webpack_require__(3);
- var ParallelAxis = __webpack_require__(219);
- var matrix = __webpack_require__(17);
- var vector = __webpack_require__(16);
-
- var each = zrUtil.each;
-
- var PI = Math.PI;
-
- function Parallel(parallelModel, ecModel, api) {
-
- /**
- * key: dimension
- * @type {Object.<string, module:echarts/coord/parallel/Axis>}
- * @private
- */
- this._axesMap = {};
-
- /**
- * key: dimension
- * value: {position: [], rotation, }
- * @type {Object.<string, Object>}
- * @private
- */
- this._axesLayout = {};
-
- /**
- * Always follow axis order.
- * @type {Array.<string>}
- * @readOnly
- */
- this.dimensions = parallelModel.dimensions;
-
- /**
- * @type {module:zrender/core/BoundingRect}
- */
- this._rect;
-
- /**
- * @type {module:echarts/coord/parallel/ParallelModel}
- */
- this._model = parallelModel;
-
- this._init(parallelModel, ecModel, api);
- }
-
- Parallel.prototype = {
-
- type: 'parallel',
-
- constructor: Parallel,
-
- /**
- * Initialize cartesian coordinate systems
- * @private
- */
- _init: function (parallelModel, ecModel, api) {
-
- var dimensions = parallelModel.dimensions;
- var parallelAxisIndex = parallelModel.parallelAxisIndex;
-
- each(dimensions, function (dim, idx) {
-
- var axisIndex = parallelAxisIndex[idx];
- var axisModel = ecModel.getComponent('parallelAxis', axisIndex);
-
- var axis = this._axesMap[dim] = new ParallelAxis(
- dim,
- axisHelper.createScaleByModel(axisModel),
- [0, 0],
- axisModel.get('type'),
- axisIndex
- );
-
- var isCategory = axis.type === 'category';
- axis.onBand = isCategory && axisModel.get('boundaryGap');
- axis.inverse = axisModel.get('inverse');
-
- // Inject axis into axisModel
- axisModel.axis = axis;
-
- // Inject axisModel into axis
- axis.model = axisModel;
- }, this);
- },
-
- /**
- * Update axis scale after data processed
- * @param {module:echarts/model/Global} ecModel
- * @param {module:echarts/ExtensionAPI} api
- */
- update: function (ecModel, api) {
- this._updateAxesFromSeries(this._model, ecModel);
- },
-
- /**
- * Update properties from series
- * @private
- */
- _updateAxesFromSeries: function (parallelModel, ecModel) {
- ecModel.eachSeries(function (seriesModel) {
-
- if (!parallelModel.contains(seriesModel, ecModel)) {
- return;
- }
-
- var data = seriesModel.getData();
-
- each(this.dimensions, function (dim) {
- var axis = this._axesMap[dim];
- axis.scale.unionExtent(data.getDataExtent(dim));
- axisHelper.niceScaleExtent(axis, axis.model);
- }, this);
- }, this);
- },
-
- /**
- * Resize the parallel coordinate system.
- * @param {module:echarts/coord/parallel/ParallelModel} parallelModel
- * @param {module:echarts/ExtensionAPI} api
- */
- resize: function (parallelModel, api) {
- this._rect = layout.getLayoutRect(
- parallelModel.getBoxLayoutParams(),
- {
- width: api.getWidth(),
- height: api.getHeight()
- }
- );
-
- this._layoutAxes(parallelModel);
- },
-
- /**
- * @return {module:zrender/core/BoundingRect}
- */
- getRect: function () {
- return this._rect;
- },
-
- /**
- * @private
- */
- _layoutAxes: function (parallelModel) {
- var rect = this._rect;
- var layout = parallelModel.get('layout');
- var axes = this._axesMap;
- var dimensions = this.dimensions;
-
- var size = [rect.width, rect.height];
- var sizeIdx = layout === 'horizontal' ? 0 : 1;
- var layoutLength = size[sizeIdx];
- var axisLength = size[1 - sizeIdx];
- var axisExtent = [0, axisLength];
-
- each(axes, function (axis) {
- var idx = axis.inverse ? 1 : 0;
- axis.setExtent(axisExtent[idx], axisExtent[1 - idx]);
- });
-
- each(dimensions, function (dim, idx) {
- var pos = layoutLength * idx / (dimensions.length - 1);
-
- var positionTable = {
- horizontal: {
- x: pos,
- y: axisLength
- },
- vertical: {
- x: 0,
- y: pos
- }
- };
- var rotationTable = {
- horizontal: PI / 2,
- vertical: 0
- };
-
- var position = [
- positionTable[layout].x + rect.x,
- positionTable[layout].y + rect.y
- ];
-
- var rotation = rotationTable[layout];
- var transform = matrix.create();
- matrix.rotate(transform, transform, rotation);
- matrix.translate(transform, transform, position);
-
- // TODO
- // tick等排布信息。
-
- // TODO
- // 根据axis order 更新 dimensions顺序。
-
- this._axesLayout[dim] = {
- position: position,
- rotation: rotation,
- transform: transform,
- tickDirection: 1,
- labelDirection: 1
- };
- }, this);
- },
-
- /**
- * Get axis by dim.
- * @param {string} dim
- * @return {module:echarts/coord/parallel/ParallelAxis} [description]
- */
- getAxis: function (dim) {
- return this._axesMap[dim];
- },
-
- /**
- * Convert a dim value of a single item of series data to Point.
- * @param {*} value
- * @param {string} dim
- * @return {Array}
- */
- dataToPoint: function (value, dim) {
- return this.axisCoordToPoint(
- this._axesMap[dim].dataToCoord(value),
- dim
- );
- },
-
- /**
- * @param {module:echarts/data/List} data
- * @param {Functio} cb param: {string} activeState 'active' or 'inactive' or 'normal'
- * {number} dataIndex
- * @param {Object} context
- */
- eachActiveState: function (data, callback, context) {
- var dimensions = this.dimensions;
- var axesMap = this._axesMap;
- var hasActiveSet = false;
-
- for (var j = 0, lenj = dimensions.length; j < lenj; j++) {
- if (axesMap[dimensions[j]].model.getActiveState() !== 'normal') {
- hasActiveSet = true;
- }
- }
-
- for (var i = 0, len = data.count(); i < len; i++) {
- var values = data.getValues(dimensions, i);
- var activeState;
-
- if (!hasActiveSet) {
- activeState = 'normal';
- }
- else {
- activeState = 'active';
- for (var j = 0, lenj = dimensions.length; j < lenj; j++) {
- var dimName = dimensions[j];
- var state = axesMap[dimName].model.getActiveState(values[j], j);
-
- if (state === 'inactive') {
- activeState = 'inactive';
- break;
- }
- }
- }
-
- callback.call(context, activeState, i);
- }
- },
-
- /**
- * Convert coords of each axis to Point.
- * Return point. For example: [10, 20]
- * @param {Array.<number>} coords
- * @param {string} dim
- * @return {Array.<number>}
- */
- axisCoordToPoint: function (coord, dim) {
- var axisLayout = this._axesLayout[dim];
- var point = [coord, 0];
- vector.applyTransform(point, point, axisLayout.transform);
- return point;
- },
-
- /**
- * Get axis layout.
- */
- getAxisLayout: function (dim) {
- return zrUtil.clone(this._axesLayout[dim]);
- }
-
- };
-
- module.exports = Parallel;
-
-
-/***/ },
-/* 219 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var Axis = __webpack_require__(117);
-
- /**
- * @constructor module:echarts/coord/parallel/ParallelAxis
- * @extends {module:echarts/coord/Axis}
- * @param {string} dim
- * @param {*} scale
- * @param {Array.<number>} coordExtent
- * @param {string} axisType
- */
- var ParallelAxis = function (dim, scale, coordExtent, axisType, axisIndex) {
-
- Axis.call(this, dim, scale, coordExtent);
-
- /**
- * Axis type
- * - 'category'
- * - 'value'
- * - 'time'
- * - 'log'
- * @type {string}
- */
- this.type = axisType || 'value';
-
- /**
- * @type {number}
- * @readOnly
- */
- this.axisIndex = axisIndex;
- };
-
- ParallelAxis.prototype = {
-
- constructor: ParallelAxis,
-
- /**
- * Axis model
- * @param {module:echarts/coord/parallel/AxisModel}
- */
- model: null
-
- };
-
- zrUtil.inherits(ParallelAxis, Axis);
-
- module.exports = ParallelAxis;
-
-
-/***/ },
-/* 220 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var Component = __webpack_require__(19);
-
- __webpack_require__(221);
-
- Component.extend({
-
- type: 'parallel',
-
- dependencies: ['parallelAxis'],
-
- /**
- * @type {module:echarts/coord/parallel/Parallel}
- */
- coordinateSystem: null,
-
- /**
- * Each item like: 'dim0', 'dim1', 'dim2', ...
- * @type {Array.<string>}
- * @readOnly
- */
- dimensions: null,
-
- /**
- * Coresponding to dimensions.
- * @type {Array.<number>}
- * @readOnly
- */
- parallelAxisIndex: null,
-
- defaultOption: {
- zlevel: 0, // 一级层叠
- z: 0, // 二级层叠
- left: 80,
- top: 60,
- right: 80,
- bottom: 60,
- // width: {totalWidth} - left - right,
- // height: {totalHeight} - top - bottom,
-
- layout: 'horizontal', // 'horizontal' or 'vertical'
-
- parallelAxisDefault: null
- },
-
- /**
- * @override
- */
- init: function () {
- Component.prototype.init.apply(this, arguments);
-
- this.mergeOption({});
- },
-
- /**
- * @override
- */
- mergeOption: function (newOption) {
- var thisOption = this.option;
-
- newOption && zrUtil.merge(thisOption, newOption, true);
-
- this._initDimensions();
- },
-
- /**
- * Whether series or axis is in this coordinate system.
- * @param {module:echarts/model/Series|module:echarts/coord/parallel/AxisModel} model
- * @param {module:echarts/model/Global} ecModel
- */
- contains: function (model, ecModel) {
- var parallelIndex = model.get('parallelIndex');
- return parallelIndex != null
- && ecModel.getComponent('parallel', parallelIndex) === this;
- },
-
- /**
- * @private
- */
- _initDimensions: function () {
- var dimensions = this.dimensions = [];
- var parallelAxisIndex = this.parallelAxisIndex = [];
-
- var axisModels = zrUtil.filter(this.dependentModels.parallelAxis, function (axisModel) {
- // Can not use this.contains here, because
- // initialization has not been completed yet.
- return axisModel.get('parallelIndex') === this.componentIndex;
- });
-
- zrUtil.each(axisModels, function (axisModel) {
- dimensions.push('dim' + axisModel.get('dim'));
- parallelAxisIndex.push(axisModel.componentIndex);
- });
- }
-
- });
-
-
-
-/***/ },
-/* 221 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var ComponentModel = __webpack_require__(19);
- var zrUtil = __webpack_require__(3);
- var makeStyleMapper = __webpack_require__(11);
- var axisModelCreator = __webpack_require__(121);
- var numberUtil = __webpack_require__(7);
-
- var AxisModel = ComponentModel.extend({
-
- type: 'baseParallelAxis',
-
- /**
- * @type {module:echarts/coord/parallel/Axis}
- */
- axis: null,
-
- /**
- * @type {Array.<Array.<number>}
- * @readOnly
- */
- activeIntervals: [],
-
- /**
- * @return {Object}
- */
- getAreaSelectStyle: function () {
- return makeStyleMapper(
- [
- ['fill', 'color'],
- ['lineWidth', 'borderWidth'],
- ['stroke', 'borderColor'],
- ['width', 'width'],
- ['opacity', 'opacity']
- ]
- ).call(this.getModel('areaSelectStyle'));
- },
-
- /**
- * The code of this feature is put on AxisModel but not ParallelAxis,
- * because axisModel can be alive after echarts updating but instance of
- * ParallelAxis having been disposed. this._activeInterval should be kept
- * when action dispatched (i.e. legend click).
- *
- * @param {Array.<Array<number>>} intervals interval.length === 0
- * means set all active.
- * @public
- */
- setActiveIntervals: function (intervals) {
- var activeIntervals = this.activeIntervals = zrUtil.clone(intervals);
-
- // Normalize
- if (activeIntervals) {
- for (var i = activeIntervals.length - 1; i >= 0; i--) {
- numberUtil.asc(activeIntervals[i]);
- }
- }
- },
-
- /**
- * @param {number|string} [value] When attempting to detect 'no activeIntervals set',
- * value can not be input.
- * @return {string} 'normal': no activeIntervals set,
- * 'active',
- * 'inactive'.
- * @public
- */
- getActiveState: function (value) {
- var activeIntervals = this.activeIntervals;
-
- if (!activeIntervals.length) {
- return 'normal';
- }
-
- if (value == null) {
- return 'inactive';
- }
-
- for (var i = 0, len = activeIntervals.length; i < len; i++) {
- if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) {
- return 'active';
- }
- }
- return 'inactive';
- }
-
- });
-
- var defaultOption = {
-
- type: 'value',
-
- /**
- * @type {Array.<number>}
- */
- dim: null, // 0, 1, 2, ...
-
- parallelIndex: null,
-
- areaSelectStyle: {
- width: 20,
- borderWidth: 1,
- borderColor: 'rgba(160,197,232)',
- color: 'rgba(160,197,232)',
- opacity: 0.3
- },
-
- z: 10
- };
-
- zrUtil.merge(AxisModel.prototype, __webpack_require__(123));
-
- function getAxisType(axisName, option) {
- return option.type || (option.data ? 'category' : 'value');
- }
-
- axisModelCreator('parallel', AxisModel, getAxisType, defaultOption);
-
- module.exports = AxisModel;
-
-
-/***/ },
-/* 222 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- __webpack_require__(217);
- __webpack_require__(223);
- __webpack_require__(224);
-
-
-
-/***/ },
-/* 223 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var echarts = __webpack_require__(1);
-
- var actionInfo = {
- type: 'axisAreaSelect',
- event: 'axisAreaSelected',
- update: 'updateVisual'
- };
-
- /**
- * @payload
- * @property {string} parallelAxisId
- * @property {Array.<Array.<number>>} intervals
- */
- echarts.registerAction(actionInfo, function (payload, ecModel) {
- ecModel.eachComponent(
- {mainType: 'parallelAxis', query: payload},
- function (parallelAxisModel) {
- parallelAxisModel.axis.model.setActiveIntervals(payload.intervals);
- }
- );
-
- });
-
-
-/***/ },
-/* 224 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var AxisBuilder = __webpack_require__(126);
- var SelectController = __webpack_require__(225);
-
- var elementList = ['axisLine', 'axisLabel', 'axisTick', 'axisName'];
-
- var AxisView = __webpack_require__(1).extendComponentView({
-
- type: 'parallelAxis',
-
- /**
- * @type {module:echarts/component/helper/SelectController}
- */
- _selectController: null,
-
- /**
- * @override
- */
- render: function (axisModel, ecModel, api, payload) {
- if (fromAxisAreaSelect(axisModel, ecModel, payload)) {
- return;
- }
-
- this.axisModel = axisModel;
- this.api = api;
-
- this.group.removeAll();
-
- if (!axisModel.get('show')) {
- return;
- }
-
- var coordSys = ecModel.getComponent(
- 'parallel', axisModel.get('parallelIndex')
- ).coordinateSystem;
-
- var areaSelectStyle = axisModel.getAreaSelectStyle();
- var areaWidth = areaSelectStyle.width;
-
- var axisLayout = coordSys.getAxisLayout(axisModel.axis.dim);
- var builderOpt = zrUtil.extend(
- {
- strokeContainThreshold: areaWidth,
- // lineWidth === 0 or no value.
- silent: !(areaWidth > 0) // jshint ignore:line
- },
- axisLayout
- );
-
- var axisBuilder = new AxisBuilder(axisModel, builderOpt);
-
- zrUtil.each(elementList, axisBuilder.add, axisBuilder);
-
- var axisGroup = axisBuilder.getGroup();
-
- this.group.add(axisGroup);
-
- this._buildSelectController(
- axisGroup, areaSelectStyle, axisModel, api
- );
- },
-
- _buildSelectController: function (axisGroup, areaSelectStyle, axisModel, api) {
-
- var axis = axisModel.axis;
- var selectController = this._selectController;
-
- if (!selectController) {
- selectController = this._selectController = new SelectController(
- 'line',
- api.getZr(),
- areaSelectStyle
- );
-
- selectController.on('selected', zrUtil.bind(this._onSelected, this));
- }
-
- selectController.enable(axisGroup);
-
- // After filtering, axis may change, select area needs to be update.
- var ranges = zrUtil.map(axisModel.activeIntervals, function (interval) {
- return [
- axis.dataToCoord(interval[0], true),
- axis.dataToCoord(interval[1], true)
- ];
- });
- selectController.update(ranges);
- },
-
- _onSelected: function (ranges) {
- // Do not cache these object, because the mey be changed.
- var axisModel = this.axisModel;
- var axis = axisModel.axis;
-
- var intervals = zrUtil.map(ranges, function (range) {
- return [
- axis.coordToData(range[0], true),
- axis.coordToData(range[1], true)
- ];
- });
- this.api.dispatchAction({
- type: 'axisAreaSelect',
- parallelAxisId: axisModel.id,
- intervals: intervals
- });
- },
-
- /**
- * @override
- */
- remove: function () {
- this._selectController && this._selectController.disable();
- },
-
- /**
- * @override
- */
- dispose: function () {
- if (this._selectController) {
- this._selectController.dispose();
- this._selectController = null;
- }
- }
- });
-
- function fromAxisAreaSelect(axisModel, ecModel, payload) {
- return payload
- && payload.type === 'axisAreaSelect'
- && ecModel.findComponents(
- {mainType: 'parallelAxis', query: payload}
- )[0] === axisModel;
- }
-
- module.exports = AxisView;
-
-
-/***/ },
-/* 225 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Box selection tool.
- *
- * @module echarts/component/helper/SelectController
- */
-
-
-
- var Eventful = __webpack_require__(32);
- var zrUtil = __webpack_require__(3);
- var graphic = __webpack_require__(42);
- var bind = zrUtil.bind;
- var each = zrUtil.each;
- var mathMin = Math.min;
- var mathMax = Math.max;
- var mathPow = Math.pow;
-
- var COVER_Z = 10000;
- var UNSELECT_THRESHOLD = 2;
- var EVENTS = ['mousedown', 'mousemove', 'mouseup'];
-
- /**
- * @alias module:echarts/component/helper/SelectController
- * @constructor
- * @mixin {module:zrender/mixin/Eventful}
- *
- * @param {string} type 'line', 'rect'
- * @param {module:zrender/zrender~ZRender} zr
- * @param {Object} [opt]
- * @param {number} [opt.width]
- * @param {number} [opt.lineWidth]
- * @param {string} [opt.stroke]
- * @param {string} [opt.fill]
- */
- function SelectController(type, zr, opt) {
-
- Eventful.call(this);
-
- /**
- * @type {string}
- * @readOnly
- */
- this.type = type;
-
- /**
- * @type {module:zrender/zrender~ZRender}
- */
- this.zr = zr;
-
- /**
- * @type {Object}
- * @readOnly
- */
- this.opt = zrUtil.clone(opt);
-
- /**
- * @type {module:zrender/container/Group}
- * @readOnly
- */
- this.group = new graphic.Group();
-
- /**
- * @type {module:zrender/core/BoundingRect}
- */
- this._containerRect = null;
-
- /**
- * @type {Array.<nubmer>}
- * @private
- */
- this._track = [];
-
- /**
- * @type {boolean}
- */
- this._dragging;
-
- /**
- * @type {module:zrender/Element}
- * @private
- */
- this._cover;
-
- /**
- * @type {boolean}
- * @private
- */
- this._disabled = true;
-
- /**
- * @type {Object}
- * @private
- */
- this._handlers = {
- mousedown: bind(mousedown, this),
- mousemove: bind(mousemove, this),
- mouseup: bind(mouseup, this)
- };
-
- each(EVENTS, function (eventName) {
- this.zr.on(eventName, this._handlers[eventName]);
- }, this);
- }
-
- SelectController.prototype = {
-
- constructor: SelectController,
-
- /**
- * @param {module:zrender/mixin/Transformable} container
- * @param {module:zrender/core/BoundingRect|boolean} [rect] If not specified,
- * use container.getBoundingRect().
- * If false, do not use containerRect.
- */
- enable: function (container, rect) {
-
- this._disabled = false;
-
- // Remove from old container.
- removeGroup.call(this);
-
- // boundingRect will change when dragging, so we have
- // to keep initial boundingRect.
- this._containerRect = rect !== false
- ? (rect || container.getBoundingRect()) : null;
-
- // Add to new container.
- container.add(this.group);
- },
-
- /**
- * Update cover location.
- * @param {Array.<number>|Object} ranges If null/undefined, remove cover.
- */
- update: function (ranges) {
- // TODO
- // Only support one interval yet.
- renderCover.call(this, ranges && zrUtil.clone(ranges));
- },
-
- disable: function () {
- this._disabled = true;
-
- removeGroup.call(this);
- },
-
- dispose: function () {
- this.disable();
-
- each(EVENTS, function (eventName) {
- this.zr.off(eventName, this._handlers[eventName]);
- }, this);
- }
- };
-
-
- zrUtil.mixin(SelectController, Eventful);
-
- function updateZ(group) {
- group.traverse(function (el) {
- el.z = COVER_Z;
- });
- }
-
- function isInContainer(x, y) {
- var localPos = this.group.transformCoordToLocal(x, y);
- return !this._containerRect
- || this._containerRect.contain(localPos[0], localPos[1]);
- }
-
- function preventDefault(e) {
- var rawE = e.event;
- rawE.preventDefault && rawE.preventDefault();
- }
-
- function mousedown(e) {
- if (this._disabled || (e.target && e.target.draggable)) {
- return;
- }
-
- preventDefault(e);
-
- var x = e.offsetX;
- var y = e.offsetY;
-
- if (isInContainer.call(this, x, y)) {
- this._dragging = true;
- this._track = [[x, y]];
- }
- }
-
- function mousemove(e) {
- if (!this._dragging || this._disabled) {
- return;
- }
-
- preventDefault(e);
-
- updateViewByCursor.call(this, e);
- }
-
- function mouseup(e) {
- if (!this._dragging || this._disabled) {
- return;
- }
-
- preventDefault(e);
-
- updateViewByCursor.call(this, e, true);
-
- this._dragging = false;
- this._track = [];
- }
-
- function updateViewByCursor(e, isEnd) {
- var x = e.offsetX;
- var y = e.offsetY;
-
- if (isInContainer.call(this, x, y)) {
- this._track.push([x, y]);
-
- // Create or update cover.
- var ranges = shouldShowCover.call(this)
- ? coverRenderers[this.type].getRanges.call(this)
- // Remove cover.
- : [];
-
- renderCover.call(this, ranges);
-
- this.trigger('selected', zrUtil.clone(ranges));
-
- if (isEnd) {
- this.trigger('selectEnd', zrUtil.clone(ranges));
- }
- }
- }
-
- function shouldShowCover() {
- var track = this._track;
-
- if (!track.length) {
- return false;
- }
-
- var p2 = track[track.length - 1];
- var p1 = track[0];
- var dx = p2[0] - p1[0];
- var dy = p2[1] - p1[1];
- var dist = mathPow(dx * dx + dy * dy, 0.5);
-
- return dist > UNSELECT_THRESHOLD;
- }
-
- function renderCover(ranges) {
- var coverRenderer = coverRenderers[this.type];
-
- if (ranges && ranges.length) {
- if (!this._cover) {
- this._cover = coverRenderer.create.call(this);
- this.group.add(this._cover);
- }
- coverRenderer.update.call(this, ranges);
- }
- else {
- this.group.remove(this._cover);
- this._cover = null;
- }
-
- updateZ(this.group);
- }
-
- function removeGroup() {
- // container may 'removeAll' outside.
- var group = this.group;
- var container = group.parent;
- if (container) {
- container.remove(group);
- }
- }
-
- function createRectCover() {
- var opt = this.opt;
- return new graphic.Rect({
- // FIXME
- // customize style.
- style: {
- stroke: opt.stroke,
- fill: opt.fill,
- lineWidth: opt.lineWidth,
- opacity: opt.opacity
- }
- });
- }
-
- function getLocalTrack() {
- return zrUtil.map(this._track, function (point) {
- return this.group.transformCoordToLocal(point[0], point[1]);
- }, this);
- }
-
- function getLocalTrackEnds() {
- var localTrack = getLocalTrack.call(this);
- var tail = localTrack.length - 1;
- tail < 0 && (tail = 0);
- return [localTrack[0], localTrack[tail]];
- }
-
- /**
- * key: this.type
- * @type {Object}
- */
- var coverRenderers = {
-
- line: {
-
- create: createRectCover,
-
- getRanges: function () {
- var ends = getLocalTrackEnds.call(this);
- var min = mathMin(ends[0][0], ends[1][0]);
- var max = mathMax(ends[0][0], ends[1][0]);
-
- return [[min, max]];
- },
-
- update: function (ranges) {
- var range = ranges[0];
- var width = this.opt.width;
- this._cover.setShape({
- x: range[0],
- y: -width / 2,
- width: range[1] - range[0],
- height: width
- });
- }
- },
-
- rect: {
-
- create: createRectCover,
-
- getRanges: function () {
- var ends = getLocalTrackEnds.call(this);
-
- var min = [
- mathMin(ends[1][0], ends[0][0]),
- mathMin(ends[1][1], ends[0][1])
- ];
- var max = [
- mathMax(ends[1][0], ends[0][0]),
- mathMax(ends[1][1], ends[0][1])
- ];
-
- return [[
- [min[0], max[0]], // x range
- [min[1], max[1]] // y range
- ]];
- },
-
- update: function (ranges) {
- var range = ranges[0];
- this._cover.setShape({
- x: range[0][0],
- y: range[1][0],
- width: range[0][1] - range[0][0],
- height: range[1][1] - range[1][0]
- });
- }
- }
- };
-
- module.exports = SelectController;
-
-
-/***/ },
-/* 226 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var modelUtil = __webpack_require__(5);
-
- module.exports = function (option) {
- createParallelIfNeeded(option);
- mergeAxisOptionFromParallel(option);
- };
-
- /**
- * Create a parallel coordinate if not exists.
- * @inner
- */
- function createParallelIfNeeded(option) {
- if (option.parallel) {
- return;
- }
-
- var hasParallelSeries = false;
-
- zrUtil.each(option.series, function (seriesOpt) {
- if (seriesOpt && seriesOpt.type === 'parallel') {
- hasParallelSeries = true;
- }
- });
-
- if (hasParallelSeries) {
- option.parallel = [{}];
- }
- }
-
- /**
- * Merge aixs definition from parallel option (if exists) to axis option.
- * @inner
- */
- function mergeAxisOptionFromParallel(option) {
- var axes = modelUtil.normalizeToArray(option.parallelAxis);
-
- zrUtil.each(axes, function (axisOption) {
- if (!zrUtil.isObject(axisOption)) {
- return;
- }
-
- var parallelIndex = axisOption.parallelIndex || 0;
- var parallelOption = modelUtil.normalizeToArray(option.parallel)[parallelIndex];
-
- if (parallelOption && parallelOption.parallelAxisDefault) {
- zrUtil.merge(axisOption, parallelOption.parallelAxisDefault, false);
- }
- });
- }
-
-
-
-/***/ },
-/* 227 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var List = __webpack_require__(94);
- var zrUtil = __webpack_require__(3);
- var SeriesModel = __webpack_require__(27);
-
- module.exports = SeriesModel.extend({
-
- type: 'series.parallel',
-
- dependencies: ['parallel'],
-
- getInitialData: function (option, ecModel) {
- var parallelModel = ecModel.getComponent(
- 'parallel', this.get('parallelIndex')
- );
- var dimensions = parallelModel.dimensions;
- var parallelAxisIndices = parallelModel.parallelAxisIndex;
-
- var rawData = option.data;
-
- var dimensionsInfo = zrUtil.map(dimensions, function (dim, index) {
- var axisModel = ecModel.getComponent(
- 'parallelAxis', parallelAxisIndices[index]
- );
- if (axisModel.get('type') === 'category') {
- translateCategoryValue(axisModel, dim, rawData);
- return {name: dim, type: 'ordinal'};
- }
- else {
- return dim;
- }
- });
-
- var list = new List(dimensionsInfo, this);
- list.initData(rawData);
-
- return list;
- },
-
- defaultOption: {
- zlevel: 0, // 一级层叠
- z: 2, // 二级层叠
-
- coordinateSystem: 'parallel',
- parallelIndex: 0,
-
- // FIXME 尚无用
- label: {
- normal: {
- show: false
- // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
- // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
- // 'inside'|'left'|'right'|'top'|'bottom'
- // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
- },
- emphasis: {
- show: false
- // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
- // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为
- // 'inside'|'left'|'right'|'top'|'bottom'
- // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
- }
- },
-
- inactiveOpacity: 0.05,
- activeOpacity: 1,
-
- lineStyle: {
- normal: {
- width: 2,
- opacity: 0.45,
- type: 'solid'
- }
- },
- // smooth: false
-
- animationEasing: 'linear'
- }
- });
-
- function translateCategoryValue(axisModel, dim, rawData) {
- var axisData = axisModel.get('data');
- var numberDim = +dim.replace('dim', '');
-
- if (axisData && axisData.length) {
- zrUtil.each(rawData, function (dataItem) {
- if (!dataItem) {
- return;
- }
- var index = zrUtil.indexOf(axisData, dataItem[numberDim]);
- dataItem[numberDim] = index >= 0 ? index : NaN;
- });
- }
- // FIXME
- // 如果没有设置axis data, 应自动算出,或者提示。
- }
-
-
-/***/ },
-/* 228 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var graphic = __webpack_require__(42);
- var zrUtil = __webpack_require__(3);
-
- var ParallelView = __webpack_require__(41).extend({
-
- type: 'parallel',
-
- init: function () {
-
- /**
- * @type {module:zrender/container/Group}
- * @private
- */
- this._dataGroup = new graphic.Group();
-
- this.group.add(this._dataGroup);
- /**
- * @type {module:echarts/data/List}
- */
- this._data;
- },
-
- /**
- * @override
- */
- render: function (seriesModel, ecModel, api, payload) {
-
- var dataGroup = this._dataGroup;
- var data = seriesModel.getData();
- var oldData = this._data;
- var coordSys = seriesModel.coordinateSystem;
- var dimensions = coordSys.dimensions;
-
- data.diff(oldData)
- .add(add)
- .update(update)
- .remove(remove)
- .execute();
-
- // Update style
- data.eachItemGraphicEl(function (elGroup, idx) {
- var itemModel = data.getItemModel(idx);
- var lineStyleModel = itemModel.getModel('lineStyle.normal');
- elGroup.eachChild(function (child) {
- child.setStyle(zrUtil.extend(
- lineStyleModel.getLineStyle(),
- {
- stroke: data.getItemVisual(idx, 'color'),
- opacity: data.getItemVisual(idx, 'opacity')
- }
- ));
- });
- });
-
- // First create
- if (!this._data) {
- dataGroup.setClipPath(createGridClipShape(
- coordSys, seriesModel, function () {
- dataGroup.removeClipPath();
- }
- ));
- }
-
- this._data = data;
-
- function add(newDataIndex) {
- var values = data.getValues(dimensions, newDataIndex);
- var elGroup = new graphic.Group();
- dataGroup.add(elGroup);
-
- eachAxisPair(
- values, dimensions, coordSys,
- function (pointPair, pairIndex) {
- // FIXME
- // init animation
- if (pointPair) {
- elGroup.add(createEl(pointPair));
- }
- }
- );
-
- data.setItemGraphicEl(newDataIndex, elGroup);
- }
-
- function update(newDataIndex, oldDataIndex) {
- var values = data.getValues(dimensions, newDataIndex);
- var elGroup = oldData.getItemGraphicEl(oldDataIndex);
- var newEls = [];
- var elGroupIndex = 0;
-
- eachAxisPair(
- values, dimensions, coordSys,
- function (pointPair, pairIndex) {
- var el = elGroup.childAt(elGroupIndex++);
-
- if (pointPair && !el) {
- newEls.push(createEl(pointPair));
- }
- else if (pointPair) {
- graphic.updateProps(el, {
- shape: {
- points: pointPair
- }
- }, seriesModel);
- }
- }
- );
-
- // Remove redundent els
- for (var i = elGroup.childCount() - 1; i >= elGroupIndex; i--) {
- elGroup.remove(elGroup.childAt(i));
- }
-
- // Add new els
- for (var i = 0, len = newEls.length; i < len; i++) {
- elGroup.add(newEls[i]);
- }
-
- data.setItemGraphicEl(newDataIndex, elGroup);
- }
-
- function remove(oldDataIndex) {
- var elGroup = oldData.getItemGraphicEl(oldDataIndex);
- dataGroup.remove(elGroup);
- }
- },
-
- /**
- * @override
- */
- remove: function () {
- this._dataGroup && this._dataGroup.removeAll();
- this._data = null;
- }
- });
-
- function createGridClipShape(coordSys, seriesModel, cb) {
- var parallelModel = coordSys.model;
- var rect = coordSys.getRect();
- var rectEl = new graphic.Rect({
- shape: {
- x: rect.x,
- y: rect.y,
- width: rect.width,
- height: rect.height
- }
- });
- var dim = parallelModel.get('layout') === 'horizontal' ? 'width' : 'height';
- rectEl.setShape(dim, 0);
- graphic.initProps(rectEl, {
- shape: {
- width: rect.width,
- height: rect.height
- }
- }, seriesModel, cb);
- return rectEl;
- }
-
- function eachAxisPair(values, dimensions, coordSys, cb) {
- for (var i = 0, len = dimensions.length - 1; i < len; i++) {
- var dimA = dimensions[i];
- var dimB = dimensions[i + 1];
- var valueA = values[i];
- var valueB = values[i + 1];
-
- cb(
- (isEmptyValue(valueA, coordSys.getAxis(dimA).type)
- || isEmptyValue(valueB, coordSys.getAxis(dimB).type)
- )
- ? null
- : [
- coordSys.dataToPoint(valueA, dimA),
- coordSys.dataToPoint(valueB, dimB)
- ],
- i
- );
- }
- }
-
- function createEl(pointPair) {
- return new graphic.Polyline({
- shape: {points: pointPair},
- silent: true
- });
- }
-
-
- // FIXME
- // 公用方法?
- function isEmptyValue(val, axisType) {
- return axisType === 'category'
- ? val == null
- : (val == null || isNaN(val)); // axisType === 'value'
- }
-
- module.exports = ParallelView;
-
-
-/***/ },
-/* 229 */
-/***/ function(module, exports) {
-
-
-
- /**
- * @payload
- * @property {string} parallelAxisId
- * @property {Array.<number>} extent
- */
- module.exports = function (ecModel, payload) {
-
- ecModel.eachSeriesByType('parallel', function (seriesModel) {
-
- var itemStyleModel = seriesModel.getModel('itemStyle.normal');
- var globalColors = ecModel.get('color');
-
- var color = itemStyleModel.get('color')
- || globalColors[seriesModel.seriesIndex % globalColors.length];
- var inactiveOpacity = seriesModel.get('inactiveOpacity');
- var activeOpacity = seriesModel.get('activeOpacity');
- var lineStyle = seriesModel.getModel('lineStyle.normal').getLineStyle();
-
- var coordSys = seriesModel.coordinateSystem;
- var data = seriesModel.getData();
-
- var opacityMap = {
- normal: lineStyle.opacity,
- active: activeOpacity,
- inactive: inactiveOpacity
- };
-
- coordSys.eachActiveState(data, function (activeState, dataIndex) {
- data.setItemVisual(dataIndex, 'opacity', opacityMap[activeState]);
- });
-
- data.setVisual('color', color);
- });
- };
-
-
-/***/ },
-/* 230 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var echarts = __webpack_require__(1);
-
- __webpack_require__(231);
- __webpack_require__(232);
- echarts.registerLayout(__webpack_require__(233));
- echarts.registerVisualCoding('chart', __webpack_require__(235));
-
-
-/***/ },
-/* 231 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var SeriesModel = __webpack_require__(27);
- var createGraphFromNodeEdge = __webpack_require__(191);
-
- module.exports = SeriesModel.extend({
-
- type: 'series.sankey',
-
- layoutInfo: null,
-
- getInitialData: function (option, ecModel) {
- var links = option.edges || option.links;
- var nodes = option.data || option.nodes;
- if (nodes && links) {
- var graph = createGraphFromNodeEdge(nodes, links, this, true);
- return graph.data;
- }
- },
-
- /**
- * @return {module:echarts/data/Graph}
- */
- getGraph: function () {
- return this.getData().graph;
- },
-
- /**
- * return {module:echarts/data/List}
- */
- getEdgeData: function() {
- return this.getGraph().edgeData;
- },
-
- defaultOption: {
- zlevel: 0,
- z: 2,
-
- coordinateSystem: 'view',
-
- layout : null,
-
- // the position of the whole view
- left: '5%',
- top: '5%',
- right: '20%',
- bottom: '5%',
-
- // the dx of the node
- nodeWidth: 20,
-
- // the distance between two nodes
- nodeGap: 8,
-
- // the number of iterations to change the position of the node
- layoutIterations: 32,
-
- label: {
- normal: {
- show: true,
- position: 'right',
- textStyle: {
- color: '#000',
- fontSize: 12
- }
- },
- emphasis: {
- show: true
- }
- },
-
- itemStyle: {
- normal: {
- borderWidth: 1,
- borderColor: '#aaa'
- }
- },
-
- lineStyle: {
- normal: {
- color: '#314656',
- opacity: 0.2,
- curveness: 0.5
- },
- emphasis: {
- opacity: 0.6
- }
- },
-
-
- // colorEncoded node
-
- color: ['#9e0142', '#d53e4f', '#f46d43', '#fdae61', '#fee08b','#ffffbf',
- '#e6f598', '#abdda4', '#66c2a5', '#3288bd', '#5e4fa2'],
-
- animationEasing: 'linear',
-
- animationDuration: 1000
- }
-
- });
-
-
-
-/***/ },
-/* 232 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var graphic = __webpack_require__(42);
- var modelUtil = __webpack_require__(5);
- var zrUtil = __webpack_require__(3);
-
- var SankeyShape = graphic.extendShape({
- shape: {
- x1: 0, y1: 0,
- x2: 0, y2: 0,
- cpx1: 0, cpy1: 0,
- cpx2: 0, cpy2: 0,
-
- extent: 0
- },
-
- buildPath: function (ctx, shape) {
- var halfExtent = shape.extent / 2;
- ctx.moveTo(shape.x1, shape.y1 - halfExtent);
- ctx.bezierCurveTo(
- shape.cpx1, shape.cpy1 - halfExtent,
- shape.cpx2, shape.cpy2 - halfExtent,
- shape.x2, shape.y2 - halfExtent
- );
- ctx.lineTo(shape.x2, shape.y2 + halfExtent);
- ctx.bezierCurveTo(
- shape.cpx2, shape.cpy2 + halfExtent,
- shape.cpx1, shape.cpy1 + halfExtent,
- shape.x1, shape.y1 + halfExtent
- );
- ctx.closePath();
- }
- });
-
- module.exports = __webpack_require__(1).extendChartView({
-
- type: 'sankey',
-
- /**
- * @private
- * @type {module:echarts/chart/sankey/SankeySeries}
- */
- _model: null,
-
- render: function(seriesModel, ecModel, api) {
- var graph = seriesModel.getGraph();
- var group = this.group;
- var layoutInfo = seriesModel.layoutInfo;
-
- this._model = seriesModel;
-
- group.removeAll();
-
- group.position = [layoutInfo.x, layoutInfo.y];
-
- var edgeData = graph.edgeData;
- var rawOption = seriesModel.option;
- var formatModel = modelUtil.createDataFormatModel(
- seriesModel, edgeData, rawOption.edges || rawOption.links
- );
-
- formatModel.formatTooltip = function (dataIndex) {
- var params = this.getDataParams(dataIndex);
- var rawDataOpt = params.data;
- var html = rawDataOpt.source + ' -- ' + rawDataOpt.target;
- if (params.value) {
- html += ':' + params.value;
- }
- return html;
- };
-
- // generate a rect for each node
- graph.eachNode(function (node) {
- var layout = node.getLayout();
- var itemModel = node.getModel();
- var labelModel = itemModel.getModel('label.normal');
- var textStyleModel = labelModel.getModel('textStyle');
- var labelHoverModel = itemModel.getModel('label.emphasis');
- var textStyleHoverModel = labelHoverModel.getModel('textStyle');
-
- var rect = new graphic.Rect({
- shape: {
- x: layout.x,
- y: layout.y,
- width: node.getLayout().dx,
- height: node.getLayout().dy
- },
- style: {
- // Get formatted label in label.normal option. Use node id if it is not specified
- text: labelModel.get('show')
- ? seriesModel.getFormattedLabel(node.dataIndex, 'normal') || node.id
- // Use empty string to hide the label
- : '',
- textFont: textStyleModel.getFont(),
- textFill: textStyleModel.getTextColor(),
- textPosition: labelModel.get('position')
- }
- });
-
- rect.setStyle(zrUtil.defaults(
- {
- fill: node.getVisual('color')
- },
- itemModel.getModel('itemStyle.normal').getItemStyle()
- ));
-
- graphic.setHoverStyle(rect, zrUtil.extend(
- node.getModel('itemStyle.emphasis'),
- {
- text: labelHoverModel.get('show')
- ? seriesModel.getFormattedLabel(node.dataIndex, 'emphasis') || node.id
- : '',
- textFont: textStyleHoverModel.getFont(),
- textFill: textStyleHoverModel.getTextColor(),
- textPosition: labelHoverModel.get('position')
- }
- ));
-
- group.add(rect);
- });
-
- // generate a bezire Curve for each edge
- graph.eachEdge(function (edge) {
- var curve = new SankeyShape();
-
- curve.dataIndex = edge.dataIndex;
- curve.dataModel = formatModel;
-
- var lineStyleModel = edge.getModel('lineStyle.normal');
- var curvature = lineStyleModel.get('curveness');
- var n1Layout = edge.node1.getLayout();
- var n2Layout = edge.node2.getLayout();
- var edgeLayout = edge.getLayout();
-
- curve.shape.extent = Math.max(1, edgeLayout.dy);
-
- var x1 = n1Layout.x + n1Layout.dx;
- var y1 = n1Layout.y + edgeLayout.sy + edgeLayout.dy / 2;
- var x2 = n2Layout.x;
- var y2 = n2Layout.y + edgeLayout.ty + edgeLayout.dy /2;
- var cpx1 = x1 * (1 - curvature) + x2 * curvature;
- var cpy1 = y1;
- var cpx2 = x1 * curvature + x2 * (1 - curvature);
- var cpy2 = y2;
-
- curve.setShape({
- x1: x1,
- y1: y1,
- x2: x2,
- y2: y2,
- cpx1: cpx1,
- cpy1: cpy1,
- cpx2: cpx2,
- cpy2: cpy2
- });
-
- curve.setStyle(lineStyleModel.getItemStyle());
- graphic.setHoverStyle(curve, edge.getModel('lineStyle.emphasis').getItemStyle());
-
- group.add(curve);
-
- });
- if (!this._data) {
- group.setClipPath(createGridClipShape(group.getBoundingRect(), seriesModel, function () {
- group.removeClipPath();
- }));
- }
- this._data = seriesModel.getData();
- }
- });
-
- //add animation to the view
- function createGridClipShape(rect, seriesModel, cb) {
- var rectEl = new graphic.Rect({
- shape: {
- x: rect.x - 10,
- y: rect.y - 10,
- width: 0,
- height: rect.height + 20
- }
- });
- graphic.initProps(rectEl, {
- shape: {
- width: rect.width + 20,
- height: rect.height + 20
- }
- }, seriesModel, cb);
-
- return rectEl;
- }
-
-
-/***/ },
-/* 233 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var layout = __webpack_require__(21);
- var nest = __webpack_require__(234);
- var zrUtil = __webpack_require__(3);
-
- module.exports = function (ecModel, api) {
-
- ecModel.eachSeriesByType('sankey', function (seriesModel) {
-
- var nodeWidth = seriesModel.get('nodeWidth');
- var nodeGap = seriesModel.get('nodeGap');
-
- var layoutInfo = getViewRect(seriesModel, api);
-
- seriesModel.layoutInfo = layoutInfo;
-
- var width = layoutInfo.width;
- var height = layoutInfo.height;
-
- var graph = seriesModel.getGraph();
-
- var nodes = graph.nodes;
- var edges = graph.edges;
-
- computeNodeValues(nodes);
-
- var filteredNodes = nodes.filter(function (node) {
- return node.getLayout().value === 0;
- });
-
- var iterations = filteredNodes.length !== 0
- ? 0 : seriesModel.get('layoutIterations');
-
- layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations);
- });
- };
-
- /**
- * get the layout position of the whole view.
- */
- function getViewRect(seriesModel, api) {
- return layout.getLayoutRect(
- seriesModel.getBoxLayoutParams(), {
- width: api.getWidth(),
- height: api.getHeight()
- }
- );
- }
-
- function layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations) {
- computeNodeBreadths(nodes, nodeWidth, width);
- computeNodeDepths(nodes, edges, height, nodeGap, iterations);
- computeEdgeDepths(nodes);
- }
-
- /**
- * compute the value of each node by summing the associated edge's value.
- * @param {module:echarts/data/Graph~Node} nodes
- */
- function computeNodeValues(nodes) {
- zrUtil.each(nodes, function (node) {
- var value1 = sum(node.outEdges, getEdgeValue);
- var value2 = sum(node.inEdges, getEdgeValue);
- var value = Math.max(value1, value2);
- node.setLayout({value: value}, true);
- });
- }
-
- /**
- * compute the x-position for each node.
- * @param {module:echarts/data/Graph~Node} nodes
- * @param {number} nodeWidth
- * @param {number} width
- */
- function computeNodeBreadths(nodes, nodeWidth, width) {
- var remainNodes = nodes;
- var nextNode = null;
- var x = 0;
- var kx = 0;
-
- while (remainNodes.length) {
- nextNode = [];
-
- for (var i = 0, len = remainNodes.length; i < len; i++) {
- var node = remainNodes[i];
- node.setLayout({x: x}, true);
- node.setLayout({dx: nodeWidth}, true);
-
- for (var j = 0, lenj = node.outEdges.length; j < lenj; j++) {
- nextNode.push(node.outEdges[j].node2);
- }
- }
- remainNodes = nextNode;
- ++x;
- }
-
- moveSinksRight(nodes, x);
- kx = (width - nodeWidth) / (x - 1);
-
- scaleNodeBreadths(nodes, kx);
- }
-
- /**
- * all the node without outEgdes are assigned maximum breadth and
- * be aligned in the last column.
- * @param {module:echarts/data/Graph~Node} nodes
- * @param {number} x
- */
- function moveSinksRight(nodes, x) {
- zrUtil.each(nodes, function (node) {
- if(!node.outEdges.length) {
- node.setLayout({x: x-1}, true);
- }
- });
- }
-
- /**
- * scale node x-position to the width.
- * @param {module:echarts/data/Graph~Node} nodes
- * @param {number} kx
- */
- function scaleNodeBreadths(nodes, kx) {
- zrUtil.each(nodes, function(node) {
- var nodeX = node.getLayout().x * kx;
- node.setLayout({x: nodeX}, true);
- });
- }
-
- /**
- * using Gauss-Seidel iterations method to compute the node depth(y-position).
- * @param {module:echarts/data/Graph~Node} nodes
- * @param {module:echarts/data/Graph~Edge} edges
- * @param {number} height
- * @param {numbber} nodeGap
- * @param {number} iterations
- */
- function computeNodeDepths(nodes, edges, height, nodeGap, iterations) {
- var nodesByBreadth = nest()
- .key(function (d) {
- return d.getLayout().x;
- })
- .sortKeys(ascending)
- .entries(nodes)
- .map(function (d) {
- return d.values;
- });
-
- initializeNodeDepth(nodes, nodesByBreadth, edges, height, nodeGap);
- resolveCollisions(nodesByBreadth, nodeGap, height);
-
- for (var alpha = 1; iterations > 0; iterations--) {
- alpha *= 0.99;
- relaxRightToLeft(nodesByBreadth, alpha);
- resolveCollisions(nodesByBreadth, nodeGap, height);
- relaxLeftToRight(nodesByBreadth, alpha);
- resolveCollisions(nodesByBreadth, nodeGap, height);
- }
- }
-
- /**
- * compute the original y-position for each node.
- * @param {module:echarts/data/Graph~Node} nodes
- * @param {Array.<Array.<module:echarts/data/Graph~Node>>} nodesByBreadth
- * @param {module:echarts/data/Graph~Edge} edges
- * @param {number} height
- * @param {number} nodeGap
- */
- function initializeNodeDepth(nodes, nodesByBreadth, edges, height, nodeGap) {
- var kyArray = [];
- zrUtil.each(nodesByBreadth, function (nodes) {
- var n = nodes.length;
- var sum = 0;
- zrUtil.each(nodes, function (node) {
- sum += node.getLayout().value;
- });
- var ky = (height - (n-1) * nodeGap) / sum;
- kyArray.push(ky);
- });
- kyArray.sort(function (a, b) {
- return a - b;
- });
- var ky0 = kyArray[0];
-
- zrUtil.each(nodesByBreadth, function (nodes) {
- zrUtil.each(nodes, function (node, i) {
- node.setLayout({y: i}, true);
- var nodeDy = node.getLayout().value * ky0;
- node.setLayout({dy: nodeDy}, true);
- });
- });
-
- zrUtil.each(edges, function (edge) {
- var edgeDy = +edge.getValue() * ky0;
- edge.setLayout({dy: edgeDy}, true);
- });
- }
-
- /**
- * resolve the collision of initialized depth.
- * @param {Array.<Array.<module:echarts/data/Graph~Node>>} nodesByBreadth
- * @param {number} nodeGap
- * @param {number} height
- */
- function resolveCollisions(nodesByBreadth, nodeGap, height) {
- zrUtil.each(nodesByBreadth, function (nodes) {
- var node;
- var dy;
- var y0 = 0;
- var n = nodes.length;
- var i;
-
- nodes.sort(ascendingDepth);
-
- for (i = 0; i < n; i++) {
- node = nodes[i];
- dy = y0 - node.getLayout().y;
- if(dy > 0) {
- var nodeY = node.getLayout().y + dy;
- node.setLayout({y: nodeY}, true);
- }
- y0 = node.getLayout().y + node.getLayout().dy + nodeGap;
- }
-
- // if the bottommost node goes outside the biunds, push it back up
- dy = y0 - nodeGap - height;
- if (dy > 0) {
- var nodeY = node.getLayout().y -dy;
- node.setLayout({y: nodeY}, true);
- y0 = node.getLayout().y;
- for (i = n - 2; i >= 0; --i) {
- node = nodes[i];
- dy = node.getLayout().y + node.getLayout().dy + nodeGap - y0;
- if (dy > 0) {
- nodeY = node.getLayout().y - dy;
- node.setLayout({y: nodeY}, true);
- }
- y0 = node.getLayout().y;
- }
- }
- });
- }
-
- /**
- * change the y-position of the nodes, except most the right side nodes.
- * @param {Array.<Array.<module:echarts/data/Graph~Node>>} nodesByBreadth
- * @param {number} alpha
- */
- function relaxRightToLeft(nodesByBreadth, alpha) {
- zrUtil.each(nodesByBreadth.slice().reverse(), function (nodes) {
- zrUtil.each(nodes, function (node) {
- if (node.outEdges.length) {
- var y = sum(node.outEdges, weightedTarget) / sum(node.outEdges, getEdgeValue);
- var nodeY = node.getLayout().y + (y - center(node)) * alpha;
- node.setLayout({y: nodeY}, true);
- }
- });
- });
- }
-
- function weightedTarget(edge) {
- return center(edge.node2) * edge.getValue();
- }
-
- /**
- * change the y-position of the nodes, except most the left side nodes.
- * @param {Array.<Array.<module:echarts/data/Graph~Node>>} nodesByBreadth
- * @param {number} alpha
- */
- function relaxLeftToRight(nodesByBreadth, alpha) {
- zrUtil.each(nodesByBreadth, function (nodes) {
- zrUtil.each(nodes, function (node) {
- if (node.inEdges.length) {
- var y = sum(node.inEdges, weightedSource) / sum(node.inEdges, getEdgeValue);
- var nodeY = node.getLayout().y + (y - center(node)) * alpha;
- node.setLayout({y: nodeY}, true);
- }
- });
- });
- }
-
- function weightedSource(edge) {
- return center(edge.node1) * edge.getValue();
- }
-
- /**
- * compute the depth(y-position) of each edge.
- * @param {module:echarts/data/Graph~Node} nodes
- */
- function computeEdgeDepths(nodes) {
- zrUtil.each(nodes, function (node) {
- node.outEdges.sort(ascendingTargetDepth);
- node.inEdges.sort(ascendingSourceDepth);
- });
- zrUtil.each(nodes, function (node) {
- var sy = 0;
- var ty = 0;
- zrUtil.each(node.outEdges, function (edge) {
- edge.setLayout({sy: sy}, true);
- sy += edge.getLayout().dy;
- });
- zrUtil.each(node.inEdges, function (edge) {
- edge.setLayout({ty: ty}, true);
- ty += edge.getLayout().dy;
- });
- });
- }
-
- function ascendingTargetDepth(a, b) {
- return a.node2.getLayout().y - b.node2.getLayout().y;
- }
-
- function ascendingSourceDepth(a, b) {
- return a.node1.getLayout().y - b.node1.getLayout().y;
- }
-
- function sum(array, f) {
- var s = 0;
- var n = array.length;
- var a;
- var i = -1;
- if (arguments.length === 1) {
- while (++i < n) {
- a = +array[i];
- if (!isNaN(a)) {
- s += a;
- }
- }
- }
- else {
- while (++i < n) {
- a = +f.call(array, array[i], i);
- if(!isNaN(a)) {
- s += a;
- }
- }
- }
- return s;
- }
-
- function center(node) {
- return node.getLayout().y + node.getLayout().dy / 2;
- }
-
- function ascendingDepth(a, b) {
- return a.getLayout().y - b.getLayout().y;
- }
-
- function ascending(a, b) {
- return a < b ? -1 : a > b ? 1 : a == b ? 0 : NaN;
- }
-
- function getEdgeValue(edge) {
- return edge.getValue();
- }
-
-
-
-/***/ },
-/* 234 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
-
- /**
- * nest helper used to group by the array.
- * can specified the keys and sort the keys.
- */
- function nest() {
-
- var keysFunction = [];
- var sortKeysFunction = [];
-
- /**
- * map an Array into the mapObject.
- * @param {Array} array
- * @param {number} depth
- */
- function map(array, depth) {
- if (depth >= keysFunction.length) {
- return array;
- }
- var i = -1;
- var n = array.length;
- var keyFunction = keysFunction[depth++];
- var mapObject = {};
- var valuesByKey = {};
-
- while (++i < n) {
- var keyValue = keyFunction(array[i]);
- var values = valuesByKey[keyValue];
-
- if (values) {
- values.push(array[i]);
- }
- else {
- valuesByKey[keyValue] = [array[i]];
- }
- }
-
- zrUtil.each(valuesByKey, function (value, key) {
- mapObject[key] = map(value, depth);
- });
-
- return mapObject;
- }
-
- /**
- * transform the Map Object to multidimensional Array
- * @param {Object} map
- * @param {number} depth
- */
- function entriesMap(mapObject, depth) {
- if (depth >= keysFunction.length) {
- return mapObject;
- }
- var array = [];
- var sortKeyFunction = sortKeysFunction[depth++];
-
- zrUtil.each(mapObject, function (value, key) {
- array.push({
- key: key, values: entriesMap(value, depth)
- });
- });
-
- if (sortKeyFunction) {
- return array.sort(function (a, b) {
- return sortKeyFunction(a.key, b.key);
- });
- }
- else {
- return array;
- }
- }
-
- return {
- /**
- * specified the key to groupby the arrays.
- * users can specified one more keys.
- * @param {Function} d
- */
- key: function (d) {
- keysFunction.push(d);
- return this;
- },
-
- /**
- * specified the comparator to sort the keys
- * @param {Function} order
- */
- sortKeys: function (order) {
- sortKeysFunction[keysFunction.length - 1] = order;
- return this;
- },
-
- /**
- * the array to be grouped by.
- * @param {Array} array
- */
- entries: function (array) {
- return entriesMap(map(array, 0), 0);
- }
- };
- }
- module.exports = nest;
-
-
-/***/ },
-/* 235 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var VisualMapping = __webpack_require__(187);
-
- module.exports = function (ecModel, payload) {
- ecModel.eachSeriesByType('sankey', function (seriesModel) {
- var graph = seriesModel.getGraph();
- var nodes = graph.nodes;
-
- nodes.sort(function (a, b) {
- return a.getLayout().value - b.getLayout().value;
- });
-
- var minValue = nodes[0].getLayout().value;
- var maxValue = nodes[nodes.length - 1].getLayout().value;
-
- nodes.forEach(function (node) {
- var mapping = new VisualMapping({
- type: 'color',
- mappingMethod: 'linear',
- dataExtent: [minValue, maxValue],
- visual: seriesModel.get('color')
- });
-
- var mapValueToColor = mapping.mapValueToVisual(node.getLayout().value);
- node.setVisual('color', mapValueToColor);
- });
-
- }) ;
- };
-
-
-/***/ },
-/* 236 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var echarts = __webpack_require__(1);
-
- __webpack_require__(237);
- __webpack_require__(240);
-
- echarts.registerVisualCoding('chart', __webpack_require__(241));
- echarts.registerLayout(__webpack_require__(242));
-
-
-
-/***/ },
-/* 237 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
- var SeriesModel = __webpack_require__(27);
- var whiskerBoxCommon = __webpack_require__(238);
-
- var BoxplotSeries = SeriesModel.extend({
-
- type: 'series.boxplot',
-
- dependencies: ['xAxis', 'yAxis', 'grid'],
-
- // TODO
- // box width represents group size, so dimension should have 'size'.
-
- /**
- * @see <https://en.wikipedia.org/wiki/Box_plot>
- * The meanings of 'min' and 'max' depend on user,
- * and echarts do not need to know it.
- * @readOnly
- */
- valueDimensions: ['min', 'Q1', 'median', 'Q3', 'max'],
-
- /**
- * @type {Array.<string>}
- * @readOnly
- */
- dimensions: null,
-
- /**
- * @override
- */
- defaultOption: {
- zlevel: 0, // 一级层叠
- z: 2, // 二级层叠
- coordinateSystem: 'cartesian2d',
- legendHoverLink: true,
-
- hoverAnimation: true,
-
- xAxisIndex: 0,
- yAxisIndex: 0,
-
- layout: null, // 'horizontal' or 'vertical'
- boxWidth: [7, 50], // [min, max] can be percent of band width.
-
- itemStyle: {
- normal: {
- color: '#fff',
- borderWidth: 1
- },
- emphasis: {
- borderWidth: 2,
- shadowBlur: 5,
- shadowOffsetX: 2,
- shadowOffsetY: 2,
- shadowColor: 'rgba(0,0,0,0.4)'
- }
- },
-
- animationEasing: 'elasticOut',
- animationDuration: 800
- }
- });
-
- zrUtil.mixin(BoxplotSeries, whiskerBoxCommon.seriesModelMixin, true);
-
- module.exports = BoxplotSeries;
-
-
-
-/***/ },
-/* 238 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var List = __webpack_require__(94);
- var completeDimensions = __webpack_require__(96);
- var WhiskerBoxDraw = __webpack_require__(239);
- var zrUtil = __webpack_require__(3);
-
- function getItemValue(item) {
- return item.value == null ? item : item.value;
- }
-
- var seriesModelMixin = {
-
- /**
- * @private
- * @type {string}
- */
- _baseAxisDim: null,
-
- /**
- * @override
- */
- getInitialData: function (option, ecModel) {
- // When both types of xAxis and yAxis are 'value', layout is
- // needed to be specified by user. Otherwise, layout can be
- // judged by which axis is category.
-
- var categories;
-
- var xAxisModel = ecModel.getComponent('xAxis', this.get('xAxisIndex'));
- var yAxisModel = ecModel.getComponent('yAxis', this.get('yAxisIndex'));
- var xAxisType = xAxisModel.get('type');
- var yAxisType = yAxisModel.get('type');
- var addOrdinal;
-
- // FIXME
- // 考虑时间轴
-
- if (xAxisType === 'category') {
- option.layout = 'horizontal';
- categories = xAxisModel.getCategories();
- addOrdinal = true;
- }
- else if (yAxisType === 'category') {
- option.layout = 'vertical';
- categories = yAxisModel.getCategories();
- addOrdinal = true;
- }
- else {
- option.layout = option.layout || 'horizontal';
- }
-
- this._baseAxisDim = option.layout === 'horizontal' ? 'x' : 'y';
-
- var data = option.data;
- var dimensions = this.dimensions = ['base'].concat(this.valueDimensions);
- completeDimensions(dimensions, data);
-
- var list = new List(dimensions, this);
- list.initData(data, categories ? categories.slice() : null, function (dataItem, dimName, idx, dimIdx) {
- var value = getItemValue(dataItem);
- return addOrdinal ? (dimName === 'base' ? idx : value[dimIdx - 1]) : value[dimIdx];
- });
-
- return list;
- },
-
- /**
- * Used by Gird.
- * @param {string} axisDim 'x' or 'y'
- * @return {Array.<string>} dimensions on the axis.
- */
- coordDimToDataDim: function (axisDim) {
- var dims = this.valueDimensions.slice();
- var baseDim = ['base'];
- var map = {
- horizontal: {x: baseDim, y: dims},
- vertical: {x: dims, y: baseDim}
- };
- return map[this.get('layout')][axisDim];
- },
-
- /**
- * @override
- * @param {string|number} dataDim
- * @return {string} coord dimension
- */
- dataDimToCoordDim: function (dataDim) {
- var dim;
-
- zrUtil.each(['x', 'y'], function (coordDim, index) {
- var dataDims = this.coordDimToDataDim(coordDim);
- if (zrUtil.indexOf(dataDims, dataDim) >= 0) {
- dim = coordDim;
- }
- }, this);
-
- return dim;
- },
-
- /**
- * If horizontal, base axis is x, otherwise y.
- * @override
- */
- getBaseAxis: function () {
- var dim = this._baseAxisDim;
- return this.ecModel.getComponent(dim + 'Axis', this.get(dim + 'AxisIndex')).axis;
- }
- };
-
- var viewMixin = {
-
- init: function () {
- /**
- * Old data.
- * @private
- * @type {module:echarts/chart/helper/WhiskerBoxDraw}
- */
- var whiskerBoxDraw = this._whiskerBoxDraw = new WhiskerBoxDraw(
- this.getStyleUpdater()
- );
- this.group.add(whiskerBoxDraw.group);
- },
-
- render: function (seriesModel, ecModel, api) {
- this._whiskerBoxDraw.updateData(seriesModel.getData());
- },
-
- remove: function (ecModel) {
- this._whiskerBoxDraw.remove();
- }
- };
-
- module.exports = {
- seriesModelMixin: seriesModelMixin,
- viewMixin: viewMixin
- };
-
-
-/***/ },
-/* 239 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @module echarts/chart/helper/Symbol
- */
-
-
- var zrUtil = __webpack_require__(3);
- var graphic = __webpack_require__(42);
- var Path = __webpack_require__(44);
-
- var WhiskerPath = Path.extend({
-
- type: 'whiskerInBox',
-
- shape: {},
-
- buildPath: function (ctx, shape) {
- for (var i in shape) {
- if (i.indexOf('ends') === 0) {
- var pts = shape[i];
- ctx.moveTo(pts[0][0], pts[0][1]);
- ctx.lineTo(pts[1][0], pts[1][1]);
- }
- }
- }
- });
-
- /**
- * @constructor
- * @alias {module:echarts/chart/helper/WhiskerBox}
- * @param {module:echarts/data/List} data
- * @param {number} idx
- * @param {Function} styleUpdater
- * @param {boolean} isInit
- * @extends {module:zrender/graphic/Group}
- */
- function WhiskerBox(data, idx, styleUpdater, isInit) {
- graphic.Group.call(this);
-
- /**
- * @type {number}
- * @readOnly
- */
- this.bodyIndex;
-
- /**
- * @type {number}
- * @readOnly
- */
- this.whiskerIndex;
-
- /**
- * @type {Function}
- */
- this.styleUpdater = styleUpdater;
-
- this._createContent(data, idx, isInit);
-
- this.updateData(data, idx, isInit);
-
- /**
- * Last series model.
- * @type {module:echarts/model/Series}
- */
- this._seriesModel;
- }
-
- var whiskerBoxProto = WhiskerBox.prototype;
-
- whiskerBoxProto._createContent = function (data, idx, isInit) {
- var itemLayout = data.getItemLayout(idx);
- var constDim = itemLayout.chartLayout === 'horizontal' ? 1 : 0;
- var count = 0;
-
- // Whisker element.
- this.add(new graphic.Polygon({
- shape: {
- points: isInit
- ? transInit(itemLayout.bodyEnds, constDim, itemLayout)
- : itemLayout.bodyEnds
- },
- style: {strokeNoScale: true},
- z2: 100
- }));
- this.bodyIndex = count++;
-
- // Box element.
- var whiskerEnds = zrUtil.map(itemLayout.whiskerEnds, function (ends) {
- return isInit ? transInit(ends, constDim, itemLayout) : ends;
- });
- this.add(new WhiskerPath({
- shape: makeWhiskerEndsShape(whiskerEnds),
- style: {strokeNoScale: true},
- z2: 100
- }));
- this.whiskerIndex = count++;
- };
-
- function transInit(points, dim, itemLayout) {
- return zrUtil.map(points, function (point) {
- point = point.slice();
- point[dim] = itemLayout.initBaseline;
- return point;
- });
- }
-
- function makeWhiskerEndsShape(whiskerEnds) {
- // zr animation only support 2-dim array.
- var shape = {};
- zrUtil.each(whiskerEnds, function (ends, i) {
- shape['ends' + i] = ends;
- });
- return shape;
- }
-
- /**
- * Update symbol properties
- * @param {module:echarts/data/List} data
- * @param {number} idx
- */
- whiskerBoxProto.updateData = function (data, idx, isInit) {
- var seriesModel = this._seriesModel = data.hostModel;
- var itemLayout = data.getItemLayout(idx);
- var updateMethod = graphic[isInit ? 'initProps' : 'updateProps'];
- // this.childAt(this.bodyIndex).stopAnimation(true);
- // this.childAt(this.whiskerIndex).stopAnimation(true);
- updateMethod(
- this.childAt(this.bodyIndex),
- {shape: {points: itemLayout.bodyEnds}},
- seriesModel
- );
- updateMethod(
- this.childAt(this.whiskerIndex),
- {shape: makeWhiskerEndsShape(itemLayout.whiskerEnds)},
- seriesModel
- );
-
- this.styleUpdater.call(null, this, data, idx);
- };
-
- zrUtil.inherits(WhiskerBox, graphic.Group);
-
-
- /**
- * @constructor
- * @alias module:echarts/chart/helper/WhiskerBoxDraw
- */
- function WhiskerBoxDraw(styleUpdater) {
- this.group = new graphic.Group();
- this.styleUpdater = styleUpdater;
- }
-
- var whiskerBoxDrawProto = WhiskerBoxDraw.prototype;
-
- /**
- * Update symbols draw by new data
- * @param {module:echarts/data/List} data
- */
- whiskerBoxDrawProto.updateData = function (data) {
- var group = this.group;
- var oldData = this._data;
- var styleUpdater = this.styleUpdater;
-
- data.diff(oldData)
- .add(function (newIdx) {
- if (data.hasValue(newIdx)) {
- var symbolEl = new WhiskerBox(data, newIdx, styleUpdater, true);
- data.setItemGraphicEl(newIdx, symbolEl);
- group.add(symbolEl);
- }
- })
- .update(function (newIdx, oldIdx) {
- var symbolEl = oldData.getItemGraphicEl(oldIdx);
-
- // Empty data
- if (!data.hasValue(newIdx)) {
- group.remove(symbolEl);
- return;
- }
-
- if (!symbolEl) {
- symbolEl = new WhiskerBox(data, newIdx, styleUpdater);
- }
- else {
- symbolEl.updateData(data, newIdx);
- }
-
- // Add back
- group.add(symbolEl);
-
- data.setItemGraphicEl(newIdx, symbolEl);
- })
- .remove(function (oldIdx) {
- var el = oldData.getItemGraphicEl(oldIdx);
- el && group.remove(el);
- })
- .execute();
-
- this._data = data;
- };
-
- /**
- * Remove symbols.
- * @param {module:echarts/data/List} data
- */
- whiskerBoxDrawProto.remove = function () {
- var group = this.group;
- var data = this._data;
- this._data = null;
- data && data.eachItemGraphicEl(function (el) {
- el && group.remove(el);
- });
- };
-
- module.exports = WhiskerBoxDraw;
-
-
-/***/ },
-/* 240 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
- var ChartView = __webpack_require__(41);
- var graphic = __webpack_require__(42);
- var whiskerBoxCommon = __webpack_require__(238);
-
- var BoxplotView = ChartView.extend({
-
- type: 'boxplot',
-
- getStyleUpdater: function () {
- return updateStyle;
- }
- });
-
- zrUtil.mixin(BoxplotView, whiskerBoxCommon.viewMixin, true);
-
- // Update common properties
- var normalStyleAccessPath = ['itemStyle', 'normal'];
- var emphasisStyleAccessPath = ['itemStyle', 'emphasis'];
-
- function updateStyle(itemGroup, data, idx) {
- var itemModel = data.getItemModel(idx);
- var normalItemStyleModel = itemModel.getModel(normalStyleAccessPath);
- var borderColor = data.getItemVisual(idx, 'color');
-
- // Exclude borderColor.
- var itemStyle = normalItemStyleModel.getItemStyle(['borderColor']);
-
- var whiskerEl = itemGroup.childAt(itemGroup.whiskerIndex);
- whiskerEl.style.set(itemStyle);
- whiskerEl.style.stroke = borderColor;
- whiskerEl.dirty();
-
- var bodyEl = itemGroup.childAt(itemGroup.bodyIndex);
- bodyEl.style.set(itemStyle);
- bodyEl.style.stroke = borderColor;
- bodyEl.dirty();
-
- var hoverStyle = itemModel.getModel(emphasisStyleAccessPath).getItemStyle();
- graphic.setHoverStyle(itemGroup, hoverStyle);
- }
-
- module.exports = BoxplotView;
-
-
-
-/***/ },
-/* 241 */
-/***/ function(module, exports) {
-
-
-
- var borderColorQuery = ['itemStyle', 'normal', 'borderColor'];
-
- module.exports = function (ecModel, api) {
-
- var globalColors = ecModel.get('color');
-
- ecModel.eachRawSeriesByType('boxplot', function (seriesModel) {
-
- var defaulColor = globalColors[seriesModel.seriesIndex % globalColors.length];
- var data = seriesModel.getData();
-
- data.setVisual({
- legendSymbol: 'roundRect',
- // Use name 'color' but not 'borderColor' for legend usage and
- // visual coding from other component like dataRange.
- color: seriesModel.get(borderColorQuery) || defaulColor
- });
-
- // Only visible series has each data be visual encoded
- if (!ecModel.isSeriesFiltered(seriesModel)) {
- data.each(function (idx) {
- var itemModel = data.getItemModel(idx);
- data.setItemVisual(
- idx,
- {color: itemModel.get(borderColorQuery, true)}
- );
- });
- }
- });
-
- };
-
-
-/***/ },
-/* 242 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var numberUtil = __webpack_require__(7);
- var parsePercent = numberUtil.parsePercent;
- var each = zrUtil.each;
-
- module.exports = function (ecModel, api) {
-
- var groupResult = groupSeriesByAxis(ecModel);
-
- each(groupResult, function (groupItem) {
- var seriesModels = groupItem.seriesModels;
-
- if (!seriesModels.length) {
- return;
- }
-
- calculateBase(groupItem);
-
- each(seriesModels, function (seriesModel, idx) {
- layoutSingleSeries(
- seriesModel,
- groupItem.boxOffsetList[idx],
- groupItem.boxWidthList[idx]
- );
- });
- });
- };
-
- /**
- * Group series by axis.
- */
- function groupSeriesByAxis(ecModel) {
- var result = [];
- var axisList = [];
-
- ecModel.eachSeriesByType('boxplot', function (seriesModel) {
- var baseAxis = seriesModel.getBaseAxis();
- var idx = zrUtil.indexOf(axisList, baseAxis);
-
- if (idx < 0) {
- idx = axisList.length;
- axisList[idx] = baseAxis;
- result[idx] = {axis: baseAxis, seriesModels: []};
- }
-
- result[idx].seriesModels.push(seriesModel);
- });
-
- return result;
- }
-
- /**
- * Calculate offset and box width for each series.
- */
- function calculateBase(groupItem) {
- var extent;
- var baseAxis = groupItem.axis;
- var seriesModels = groupItem.seriesModels;
- var seriesCount = seriesModels.length;
-
- var boxWidthList = groupItem.boxWidthList = [];
- var boxOffsetList = groupItem.boxOffsetList = [];
- var boundList = [];
-
- var bandWidth;
- if (baseAxis.type === 'category') {
- bandWidth = baseAxis.getBandWidth();
- }
- else {
- var maxDataCount = 0;
- each(seriesModels, function (seriesModel) {
- maxDataCount = Math.max(maxDataCount, seriesModel.getData().count());
- });
- extent = baseAxis.getExtent(),
- Math.abs(extent[1] - extent[0]) / maxDataCount;
- }
-
- each(seriesModels, function (seriesModel) {
- var boxWidthBound = seriesModel.get('boxWidth');
- if (!zrUtil.isArray(boxWidthBound)) {
- boxWidthBound = [boxWidthBound, boxWidthBound];
- }
- boundList.push([
- parsePercent(boxWidthBound[0], bandWidth) || 0,
- parsePercent(boxWidthBound[1], bandWidth) || 0
- ]);
- });
-
- var availableWidth = bandWidth * 0.8 - 2;
- var boxGap = availableWidth / seriesCount * 0.3;
- var boxWidth = (availableWidth - boxGap * (seriesCount - 1)) / seriesCount;
- var base = boxWidth / 2 - availableWidth / 2;
-
- each(seriesModels, function (seriesModel, idx) {
- boxOffsetList.push(base);
- base += boxGap + boxWidth;
-
- boxWidthList.push(
- Math.min(Math.max(boxWidth, boundList[idx][0]), boundList[idx][1])
- );
- });
- }
-
- /**
- * Calculate points location for each series.
- */
- function layoutSingleSeries(seriesModel, offset, boxWidth) {
- var coordSys = seriesModel.coordinateSystem;
- var data = seriesModel.getData();
- var dimensions = seriesModel.dimensions;
- var chartLayout = seriesModel.get('layout');
- var halfWidth = boxWidth / 2;
-
- data.each(dimensions, function () {
- var args = arguments;
- var dimLen = dimensions.length;
- var axisDimVal = args[0];
- var idx = args[dimLen];
- var variableDim = chartLayout === 'horizontal' ? 0 : 1;
- var constDim = 1 - variableDim;
-
- var median = getPoint(args[3]);
- var end1 = getPoint(args[1]);
- var end5 = getPoint(args[5]);
- var whiskerEnds = [
- [end1, getPoint(args[2])],
- [end5, getPoint(args[4])]
- ];
- layEndLine(end1);
- layEndLine(end5);
- layEndLine(median);
-
- var bodyEnds = [];
- addBodyEnd(whiskerEnds[0][1], 0);
- addBodyEnd(whiskerEnds[1][1], 1);
-
- data.setItemLayout(idx, {
- chartLayout: chartLayout,
- initBaseline: median[constDim],
- median: median,
- bodyEnds: bodyEnds,
- whiskerEnds: whiskerEnds
- });
-
- function getPoint(val) {
- var p = [];
- p[variableDim] = axisDimVal;
- p[constDim] = val;
- var point;
- if (isNaN(axisDimVal) || isNaN(val)) {
- point = [NaN, NaN];
- }
- else {
- point = coordSys.dataToPoint(p);
- point[variableDim] += offset;
- }
- return point;
- }
-
- function addBodyEnd(point, start) {
- var point1 = point.slice();
- var point2 = point.slice();
- point1[variableDim] += halfWidth;
- point2[variableDim] -= halfWidth;
- start
- ? bodyEnds.push(point1, point2)
- : bodyEnds.push(point2, point1);
- }
-
- function layEndLine(endCenter) {
- var line = [endCenter.slice(), endCenter.slice()];
- line[0][variableDim] -= halfWidth;
- line[1][variableDim] += halfWidth;
- whiskerEnds.push(line);
- }
- });
- }
-
-
-
-/***/ },
-/* 243 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var echarts = __webpack_require__(1);
-
- __webpack_require__(244);
- __webpack_require__(245);
-
- echarts.registerPreprocessor(
- __webpack_require__(246)
- );
-
- echarts.registerVisualCoding('chart', __webpack_require__(247));
- echarts.registerLayout(__webpack_require__(248));
-
-
-
-/***/ },
-/* 244 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
- var SeriesModel = __webpack_require__(27);
- var whiskerBoxCommon = __webpack_require__(238);
- var formatUtil = __webpack_require__(6);
- var encodeHTML = formatUtil.encodeHTML;
- var addCommas = formatUtil.addCommas;
-
- var CandlestickSeries = SeriesModel.extend({
-
- type: 'series.candlestick',
-
- dependencies: ['xAxis', 'yAxis', 'grid'],
-
- /**
- * @readOnly
- */
- valueDimensions: ['open', 'close', 'lowest', 'highest'],
-
- /**
- * @type {Array.<string>}
- * @readOnly
- */
- dimensions: null,
-
- /**
- * @override
- */
- defaultOption: {
- zlevel: 0, // 一级层叠
- z: 2, // 二级层叠
- coordinateSystem: 'cartesian2d',
- legendHoverLink: true,
-
- hoverAnimation: true,
-
- xAxisIndex: 0,
- yAxisIndex: 0,
-
- layout: null, // 'horizontal' or 'vertical'
-
- itemStyle: {
- normal: {
- color: '#c23531', // 阳线 positive
- color0: '#314656', // 阴线 negative '#c23531', '#314656'
- borderWidth: 1,
- // FIXME
- // ec2中使用的是lineStyle.color 和 lineStyle.color0
- borderColor: '#c23531',
- borderColor0: '#314656'
- },
- emphasis: {
- borderWidth: 2
- }
- },
-
- animationUpdate: false,
- animationEasing: 'linear',
- animationDuration: 300
- },
-
- /**
- * Get dimension for shadow in dataZoom
- * @return {string} dimension name
- */
- getShadowDim: function () {
- return 'open';
- },
-
- /**
- * @override
- */
- formatTooltip: function (dataIndex, mutipleSeries) {
- // It rearly use mutiple candlestick series in one cartesian,
- // so only consider one series in this default tooltip.
- var valueHTMLArr = zrUtil.map(this.valueDimensions, function (dim) {
- return dim + ': ' + addCommas(this._data.get(dim, dataIndex));
- }, this);
-
- return encodeHTML(this.name) + '<br />' + valueHTMLArr.join('<br />');
- }
-
- });
-
- zrUtil.mixin(CandlestickSeries, whiskerBoxCommon.seriesModelMixin, true);
-
- module.exports = CandlestickSeries;
-
-
-
-/***/ },
-/* 245 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
- var ChartView = __webpack_require__(41);
- var graphic = __webpack_require__(42);
- var whiskerBoxCommon = __webpack_require__(238);
-
- var CandlestickView = ChartView.extend({
-
- type: 'candlestick',
-
- getStyleUpdater: function () {
- return updateStyle;
- }
-
- });
-
- zrUtil.mixin(CandlestickView, whiskerBoxCommon.viewMixin, true);
-
- // Update common properties
- var normalStyleAccessPath = ['itemStyle', 'normal'];
- var emphasisStyleAccessPath = ['itemStyle', 'emphasis'];
-
- function updateStyle(itemGroup, data, idx) {
- var itemModel = data.getItemModel(idx);
- var normalItemStyleModel = itemModel.getModel(normalStyleAccessPath);
- var color = data.getItemVisual(idx, 'color');
- var borderColor = data.getItemVisual(idx, 'borderColor');
-
- // Color must be excluded.
- // Because symbol provide setColor individually to set fill and stroke
- var itemStyle = normalItemStyleModel.getItemStyle(
- ['color', 'color0', 'borderColor', 'borderColor0']
- );
-
- var whiskerEl = itemGroup.childAt(itemGroup.whiskerIndex);
- whiskerEl.style.set(itemStyle);
- whiskerEl.style.stroke = borderColor;
- whiskerEl.dirty();
-
- var bodyEl = itemGroup.childAt(itemGroup.bodyIndex);
- bodyEl.style.set(itemStyle);
- bodyEl.style.fill = color;
- bodyEl.style.stroke = borderColor;
- bodyEl.dirty();
-
- var hoverStyle = itemModel.getModel(emphasisStyleAccessPath).getItemStyle();
- graphic.setHoverStyle(itemGroup, hoverStyle);
- }
-
-
- module.exports = CandlestickView;
-
-
-
-/***/ },
-/* 246 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
-
- module.exports = function (option) {
- if (!option || !zrUtil.isArray(option.series)) {
- return;
- }
-
- // Translate 'k' to 'candlestick'.
- zrUtil.each(option.series, function (seriesItem) {
- if (zrUtil.isObject(seriesItem) && seriesItem.type === 'k') {
- seriesItem.type = 'candlestick';
- }
- });
- };
-
-
-
-/***/ },
-/* 247 */
-/***/ function(module, exports) {
-
-
-
- var positiveBorderColorQuery = ['itemStyle', 'normal', 'borderColor'];
- var negativeBorderColorQuery = ['itemStyle', 'normal', 'borderColor0'];
- var positiveColorQuery = ['itemStyle', 'normal', 'color'];
- var negativeColorQuery = ['itemStyle', 'normal', 'color0'];
-
- module.exports = function (ecModel, api) {
-
- ecModel.eachRawSeriesByType('candlestick', function (seriesModel) {
-
- var data = seriesModel.getData();
-
- data.setVisual({
- legendSymbol: 'roundRect'
- });
-
- // Only visible series has each data be visual encoded
- if (!ecModel.isSeriesFiltered(seriesModel)) {
- data.each(function (idx) {
- var itemModel = data.getItemModel(idx);
- var sign = data.getItemLayout(idx).sign;
-
- data.setItemVisual(
- idx,
- {
- color: itemModel.get(
- sign > 0 ? positiveColorQuery : negativeColorQuery
- ),
- borderColor: itemModel.get(
- sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery
- )
- }
- );
- });
- }
- });
-
- };
-
-
-/***/ },
-/* 248 */
-/***/ function(module, exports) {
-
-
-
- var CANDLE_MIN_WIDTH = 2;
- var CANDLE_MIN_NICE_WIDTH = 5;
- var GPA_MIN = 4;
-
- module.exports = function (ecModel, api) {
-
- ecModel.eachSeriesByType('candlestick', function (seriesModel) {
-
- var coordSys = seriesModel.coordinateSystem;
- var data = seriesModel.getData();
- var dimensions = seriesModel.dimensions;
- var chartLayout = seriesModel.get('layout');
-
- var candleWidth = calculateCandleWidth(seriesModel, data);
-
- data.each(dimensions, function () {
- var args = arguments;
- var dimLen = dimensions.length;
- var axisDimVal = args[0];
- var idx = args[dimLen];
- var variableDim = chartLayout === 'horizontal' ? 0 : 1;
- var constDim = 1 - variableDim;
-
- var openVal = args[1];
- var closeVal = args[2];
- var lowestVal = args[3];
- var highestVal = args[4];
-
- var ocLow = Math.min(openVal, closeVal);
- var ocHigh = Math.max(openVal, closeVal);
-
- var ocLowPoint = getPoint(ocLow);
- var ocHighPoint = getPoint(ocHigh);
- var lowestPoint = getPoint(lowestVal);
- var highestPoint = getPoint(highestVal);
-
- var whiskerEnds = [
- [highestPoint, ocHighPoint],
- [lowestPoint, ocLowPoint]
- ];
-
- var bodyEnds = [];
- addBodyEnd(ocHighPoint, 0);
- addBodyEnd(ocLowPoint, 1);
-
- data.setItemLayout(idx, {
- chartLayout: chartLayout,
- sign: openVal > closeVal ? -1 : openVal < closeVal ? 1 : 0,
- initBaseline: openVal > closeVal
- ? ocHighPoint[constDim] : ocLowPoint[constDim], // open point.
- bodyEnds: bodyEnds,
- whiskerEnds: whiskerEnds
- });
-
- function getPoint(val) {
- var p = [];
- p[variableDim] = axisDimVal;
- p[constDim] = val;
- return (isNaN(axisDimVal) || isNaN(val))
- ? [NaN, NaN]
- : coordSys.dataToPoint(p);
- }
-
- function addBodyEnd(point, start) {
- var point1 = point.slice();
- var point2 = point.slice();
- point1[variableDim] += candleWidth / 2;
- point2[variableDim] -= candleWidth / 2;
- start
- ? bodyEnds.push(point1, point2)
- : bodyEnds.push(point2, point1);
- }
-
- }, true);
- });
- };
-
- function calculateCandleWidth(seriesModel, data) {
- var baseAxis = seriesModel.getBaseAxis();
- var extent;
-
- var bandWidth = baseAxis.type === 'category'
- ? baseAxis.getBandWidth()
- : (
- extent = baseAxis.getExtent(),
- Math.abs(extent[1] - extent[0]) / data.count()
- );
-
- // Half band width is perfect when space is enouph, otherwise
- // try not to be smaller than CANDLE_MIN_NICE_WIDTH (and only
- // gap is compressed), otherwise ensure not to be smaller than
- // CANDLE_MIN_WIDTH in spite of overlap.
-
- return bandWidth / 2 - 2 > CANDLE_MIN_NICE_WIDTH // "- 2" is minus border width
- ? bandWidth / 2 - 2
- : bandWidth - CANDLE_MIN_NICE_WIDTH > GPA_MIN
- ? CANDLE_MIN_NICE_WIDTH
- : Math.max(bandWidth - GPA_MIN, CANDLE_MIN_WIDTH);
- }
-
-
-
-/***/ },
-/* 249 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var echarts = __webpack_require__(1);
-
- __webpack_require__(250);
- __webpack_require__(251);
-
- echarts.registerVisualCoding('chart', zrUtil.curry(
- __webpack_require__(103), 'effectScatter', 'circle', null
- ));
- echarts.registerLayout(zrUtil.curry(
- __webpack_require__(104), 'effectScatter'
- ));
-
-
-/***/ },
-/* 250 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var createListFromArray = __webpack_require__(93);
- var SeriesModel = __webpack_require__(27);
-
- module.exports = SeriesModel.extend({
-
- type: 'series.effectScatter',
-
- dependencies: ['grid', 'polar'],
-
- getInitialData: function (option, ecModel) {
- var list = createListFromArray(option.data, this, ecModel);
- return list;
- },
-
- defaultOption: {
- coordinateSystem: 'cartesian2d',
- zlevel: 0,
- z: 2,
- legendHoverLink: true,
-
- effectType: 'ripple',
-
- // When to show the effect, option: 'render'|'emphasis'
- showEffectOn: 'render',
-
- // Ripple effect config
- rippleEffect: {
- period: 4,
- // Scale of ripple
- scale: 2.5,
- // Brush type can be fill or stroke
- brushType: 'fill'
- },
-
- // Cartesian coordinate system
- xAxisIndex: 0,
- yAxisIndex: 0,
-
- // Polar coordinate system
- polarIndex: 0,
-
- // Geo coordinate system
- geoIndex: 0,
-
- // symbol: null, // 图形类型
- symbolSize: 10 // 图形大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2
- // symbolRotate: null, // 图形旋转控制
-
- // large: false,
- // Available when large is true
- // largeThreshold: 2000,
-
- // itemStyle: {
- // normal: {
- // opacity: 1
- // }
- // }
- }
- });
-
-
-/***/ },
-/* 251 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var SymbolDraw = __webpack_require__(98);
- var EffectSymbol = __webpack_require__(252);
-
- __webpack_require__(1).extendChartView({
-
- type: 'effectScatter',
-
- init: function () {
- this._symbolDraw = new SymbolDraw(EffectSymbol);
- },
-
- render: function (seriesModel, ecModel, api) {
- var data = seriesModel.getData();
- var effectSymbolDraw = this._symbolDraw;
- effectSymbolDraw.updateData(data);
- this.group.add(effectSymbolDraw.group);
- },
-
- updateLayout: function () {
- this._symbolDraw.updateLayout();
- },
-
- remove: function (ecModel, api) {
- this._symbolDraw && this._symbolDraw.remove(api);
- }
- });
-
-
-/***/ },
-/* 252 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Symbol with ripple effect
- * @module echarts/chart/helper/EffectSymbol
- */
-
-
- var zrUtil = __webpack_require__(3);
- var symbolUtil = __webpack_require__(100);
- var graphic = __webpack_require__(42);
- var numberUtil = __webpack_require__(7);
- var Symbol = __webpack_require__(99);
- var Group = graphic.Group;
-
- var EFFECT_RIPPLE_NUMBER = 3;
-
- function normalizeSymbolSize(symbolSize) {
- if (!zrUtil.isArray(symbolSize)) {
- symbolSize = [+symbolSize, +symbolSize];
- }
- return symbolSize;
- }
- /**
- * @constructor
- * @param {module:echarts/data/List} data
- * @param {number} idx
- * @extends {module:zrender/graphic/Group}
- */
- function EffectSymbol(data, idx) {
- Group.call(this);
-
- var symbol = new Symbol(data, idx);
- var rippleGroup = new Group();
- this.add(symbol);
- this.add(rippleGroup);
-
- rippleGroup.beforeUpdate = function () {
- this.attr(symbol.getScale());
- };
- this.updateData(data, idx);
- }
-
- var effectSymbolProto = EffectSymbol.prototype;
-
- effectSymbolProto.stopEffectAnimation = function () {
- this.childAt(1).removeAll();
- };
-
- effectSymbolProto.startEffectAnimation = function (
- period, brushType, rippleScale, effectOffset, z, zlevel
- ) {
- var symbolType = this._symbolType;
- var color = this._color;
-
- var rippleGroup = this.childAt(1);
-
- for (var i = 0; i < EFFECT_RIPPLE_NUMBER; i++) {
- var ripplePath = symbolUtil.createSymbol(
- symbolType, -0.5, -0.5, 1, 1, color
- );
- ripplePath.attr({
- style: {
- stroke: brushType === 'stroke' ? color : null,
- fill: brushType === 'fill' ? color : null,
- strokeNoScale: true
- },
- z2: 99,
- silent: true,
- scale: [1, 1],
- z: z,
- zlevel: zlevel
- });
-
- var delay = -i / EFFECT_RIPPLE_NUMBER * period + effectOffset;
- // TODO Configurable period
- ripplePath.animate('', true)
- .when(period, {
- scale: [rippleScale, rippleScale]
- })
- .delay(delay)
- .start();
- ripplePath.animateStyle(true)
- .when(period, {
- opacity: 0
- })
- .delay(delay)
- .start();
-
- rippleGroup.add(ripplePath);
- }
- };
-
- /**
- * Highlight symbol
- */
- effectSymbolProto.highlight = function () {
- this.trigger('emphasis');
- };
-
- /**
- * Downplay symbol
- */
- effectSymbolProto.downplay = function () {
- this.trigger('normal');
- };
-
- /**
- * Update symbol properties
- * @param {module:echarts/data/List} data
- * @param {number} idx
- */
- effectSymbolProto.updateData = function (data, idx) {
- var seriesModel = data.hostModel;
-
- this.childAt(0).updateData(data, idx);
-
- var rippleGroup = this.childAt(1);
- var itemModel = data.getItemModel(idx);
- var symbolType = data.getItemVisual(idx, 'symbol');
- var symbolSize = normalizeSymbolSize(data.getItemVisual(idx, 'symbolSize'));
- var color = data.getItemVisual(idx, 'color');
-
- rippleGroup.attr('scale', symbolSize);
-
- rippleGroup.traverse(function (ripplePath) {
- ripplePath.attr({
- fill: color
- });
- });
-
- var symbolOffset = itemModel.getShallow('symbolOffset');
- if (symbolOffset) {
- var pos = rippleGroup.position;
- pos[0] = numberUtil.parsePercent(symbolOffset[0], symbolSize[0]);
- pos[1] = numberUtil.parsePercent(symbolOffset[1], symbolSize[1]);
- }
-
- this._symbolType = symbolType;
- this._color = color;
-
- var showEffectOn = seriesModel.get('showEffectOn');
- var rippleScale = itemModel.get('rippleEffect.scale');
- var brushType = itemModel.get('rippleEffect.brushType');
- var effectPeriod = itemModel.get('rippleEffect.period') * 1000;
- var effectOffset = idx / data.count();
- var z = itemModel.getShallow('z') || 0;
- var zlevel = itemModel.getShallow('zlevel') || 0;
-
- this.stopEffectAnimation();
- if (showEffectOn === 'render') {
- this.startEffectAnimation(
- effectPeriod, brushType, rippleScale, effectOffset, z, zlevel
- );
- }
- var symbol = this.childAt(0);
- function onEmphasis() {
- symbol.trigger('emphasis');
- if (showEffectOn !== 'render') {
- this.startEffectAnimation(
- effectPeriod, brushType, rippleScale, effectOffset, z, zlevel
- );
- }
- }
- function onNormal() {
- symbol.trigger('normal');
- if (showEffectOn !== 'render') {
- this.stopEffectAnimation();
- }
- }
- this.on('mouseover', onEmphasis, this)
- .on('mouseout', onNormal, this)
- .on('emphasis', onEmphasis, this)
- .on('normal', onNormal, this);
- };
-
- effectSymbolProto.fadeOut = function (cb) {
- cb && cb();
- };
-
- zrUtil.inherits(EffectSymbol, Group);
-
- module.exports = EffectSymbol;
-
-
-/***/ },
-/* 253 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- __webpack_require__(254);
- __webpack_require__(255);
-
- var zrUtil = __webpack_require__(3);
- var echarts = __webpack_require__(1);
- echarts.registerLayout(
- __webpack_require__(257)
- );
-
- echarts.registerVisualCoding(
- 'chart', zrUtil.curry(__webpack_require__(88), 'lines', 'lineStyle')
- );
-
-
-/***/ },
-/* 254 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var SeriesModel = __webpack_require__(27);
- var List = __webpack_require__(94);
- var zrUtil = __webpack_require__(3);
- var CoordinateSystem = __webpack_require__(25);
-
- module.exports = SeriesModel.extend({
-
- type: 'series.lines',
-
- dependencies: ['grid', 'polar'],
-
- getInitialData: function (option, ecModel) {
- var fromDataArr = [];
- var toDataArr = [];
- var lineDataArr = [];
- zrUtil.each(option.data, function (opt) {
- fromDataArr.push(opt[0]);
- toDataArr.push(opt[1]);
- lineDataArr.push(zrUtil.extend(
- zrUtil.extend({}, zrUtil.isArray(opt[0]) ? null : opt[0]),
- zrUtil.isArray(opt[1]) ? null : opt[1]
- ));
- });
-
- // var coordSys = option.coordinateSystem;
- // if (coordSys !== 'cartesian2d' && coordSys !== 'geo') {
- // throw new Error('Coordinate system can only be cartesian2d or geo in lines');
- // }
-
- // var dimensions = coordSys === 'geo' ? ['lng', 'lat'] : ['x', 'y'];
- var coordSys = CoordinateSystem.get(option.coordinateSystem);
- if (!coordSys) {
- throw new Error('Invalid coordinate system');
- }
- var dimensions = coordSys.dimensions;
-
- var fromData = new List(dimensions, this);
- var toData = new List(dimensions, this);
- var lineData = new List(['value'], this);
-
- function geoCoordGetter(item, dim, dataIndex, dimIndex) {
- return item.coord && item.coord[dimIndex];
- }
-
- fromData.initData(fromDataArr, null, geoCoordGetter);
- toData.initData(toDataArr, null, geoCoordGetter);
- lineData.initData(lineDataArr);
-
- this.fromData = fromData;
- this.toData = toData;
-
- return lineData;
- },
-
- formatTooltip: function (dataIndex) {
- var fromName = this.fromData.getName(dataIndex);
- var toName = this.toData.getName(dataIndex);
- return fromName + ' > ' + toName;
- },
-
- defaultOption: {
- coordinateSystem: 'geo',
- zlevel: 0,
- z: 2,
- legendHoverLink: true,
-
- hoverAnimation: true,
- // Cartesian coordinate system
- xAxisIndex: 0,
- yAxisIndex: 0,
-
- // Geo coordinate system
- geoIndex: 0,
-
- // symbol: null,
- // symbolSize: 10,
- // symbolRotate: null,
-
- effect: {
- show: false,
- period: 4,
- symbol: 'circle',
- symbolSize: 3,
- // Length of trail, 0 - 1
- trailLength: 0.2
- // Same with lineStyle.normal.color
- // color
- },
-
- large: false,
- // Available when large is true
- largeThreshold: 2000,
-
- label: {
- normal: {
- show: false,
- position: 'end'
- // distance: 5,
- // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调
- }
- },
- // itemStyle: {
- // normal: {
- // }
- // },
- lineStyle: {
- normal: {
- opacity: 0.5
- }
- }
- }
- });
-
-
-/***/ },
-/* 255 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var LineDraw = __webpack_require__(194);
- var EffectLine = __webpack_require__(256);
- var Line = __webpack_require__(195);
-
- __webpack_require__(1).extendChartView({
-
- type: 'lines',
-
- init: function () {},
-
- render: function (seriesModel, ecModel, api) {
- var data = seriesModel.getData();
- var lineDraw = this._lineDraw;
-
- var hasEffect = seriesModel.get('effect.show');
- if (hasEffect !== this._hasEffet) {
- if (lineDraw) {
- lineDraw.remove();
- }
- lineDraw = this._lineDraw = new LineDraw(
- hasEffect ? EffectLine : Line
- );
- this._hasEffet = hasEffect;
- }
-
- var zlevel = seriesModel.get('zlevel');
- var trailLength = seriesModel.get('effect.trailLength');
-
- var zr = api.getZr();
- // Avoid the drag cause ghost shadow
- // FIXME Better way ?
- zr.painter.getLayer(zlevel).clear(true);
- // Config layer with motion blur
- if (this._lastZlevel != null) {
- zr.configLayer(this._lastZlevel, {
- motionBlur: false
- });
- }
- if (hasEffect && trailLength) {
- zr.configLayer(zlevel, {
- motionBlur: true,
- lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)
- });
- }
-
- this.group.add(lineDraw.group);
-
- lineDraw.updateData(data);
-
- this._lastZlevel = zlevel;
- },
-
- updateLayout: function (seriesModel, ecModel, api) {
- this._lineDraw.updateLayout();
- // Not use motion when dragging or zooming
- var zr = api.getZr();
- zr.painter.getLayer(this._lastZlevel).clear(true);
- },
-
- remove: function (ecModel, api) {
- this._lineDraw && this._lineDraw.remove(api, true);
- }
- });
-
-
-/***/ },
-/* 256 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @module echarts/chart/helper/EffectLine
- */
-
-
- var graphic = __webpack_require__(42);
- var Line = __webpack_require__(195);
- var zrUtil = __webpack_require__(3);
- var symbolUtil = __webpack_require__(100);
-
- var curveUtil = __webpack_require__(49);
-
- /**
- * @constructor
- * @extends {module:zrender/graphic/Group}
- * @alias {module:echarts/chart/helper/Line}
- */
- function EffectLine(lineData, fromData, toData, idx) {
- graphic.Group.call(this);
-
- var line = new Line(lineData, fromData, toData, idx);
- this.add(line);
-
- this._updateEffectSymbol(lineData, idx);
- }
-
- var effectLineProto = EffectLine.prototype;
-
- function setAnimationPoints(symbol, points) {
- symbol.__p1 = points[0];
- symbol.__p2 = points[1];
- symbol.__cp1 = points[2] || [
- (points[0][0] + points[1][0]) / 2,
- (points[0][1] + points[1][1]) / 2
- ];
- }
-
- function updateSymbolPosition() {
- var p1 = this.__p1;
- var p2 = this.__p2;
- var cp1 = this.__cp1;
- var t = this.__t;
- var pos = this.position;
- var quadraticAt = curveUtil.quadraticAt;
- var quadraticDerivativeAt = curveUtil.quadraticDerivativeAt;
- pos[0] = quadraticAt(p1[0], cp1[0], p2[0], t);
- pos[1] = quadraticAt(p1[1], cp1[1], p2[1], t);
-
- // Tangent
- var tx = quadraticDerivativeAt(p1[0], cp1[0], p2[0], t);
- var ty = quadraticDerivativeAt(p1[1], cp1[1], p2[1], t);
-
- this.rotation = -Math.atan2(ty, tx) - Math.PI / 2;
-
- this.ignore = false;
- }
-
- effectLineProto._updateEffectSymbol = function (lineData, idx) {
- var itemModel = lineData.getItemModel(idx);
- var effectModel = itemModel.getModel('effect');
- var size = effectModel.get('symbolSize');
- var symbolType = effectModel.get('symbol');
- if (!zrUtil.isArray(size)) {
- size = [size, size];
- }
- var color = effectModel.get('color') || lineData.getItemVisual(idx, 'color');
- var symbol = this.childAt(1);
- var period = effectModel.get('period') * 1000;
- if (this._symbolType !== symbolType || period !== this._period) {
- symbol = symbolUtil.createSymbol(
- symbolType, -0.5, -0.5, 1, 1, color
- );
- symbol.ignore = true;
- symbol.z2 = 100;
- this._symbolType = symbolType;
- this._period = period;
-
- this.add(symbol);
-
- symbol.__t = 0;
- symbol.animate('', true)
- .when(period, {
- __t: 1
- })
- .delay(idx / lineData.count() * period / 2)
- .during(zrUtil.bind(updateSymbolPosition, symbol))
- .start();
- }
- // Shadow color is same with color in default
- symbol.setStyle('shadowColor', color);
- symbol.setStyle(effectModel.getItemStyle(['color']));
-
- symbol.attr('scale', size);
- var points = lineData.getItemLayout(idx);
- setAnimationPoints(symbol, points);
-
- symbol.setColor(color);
- symbol.attr('scale', size);
- };
-
- effectLineProto.updateData = function (lineData, fromData, toData, idx) {
- this.childAt(0).updateData(lineData, fromData, toData, idx);
- this._updateEffectSymbol(lineData, idx);
- };
-
- effectLineProto.updateLayout = function (lineData, fromData, toData, idx) {
- this.childAt(0).updateLayout(lineData, fromData, toData, idx);
- var symbol = this.childAt(1);
- var points = lineData.getItemLayout(idx);
- setAnimationPoints(symbol, points);
- };
-
- zrUtil.inherits(EffectLine, graphic.Group);
-
- module.exports = EffectLine;
-
-
-/***/ },
-/* 257 */
-/***/ function(module, exports) {
-
-
-
- module.exports = function (ecModel) {
- ecModel.eachSeriesByType('lines', function (seriesModel) {
- var coordSys = seriesModel.coordinateSystem;
- var fromData = seriesModel.fromData;
- var toData = seriesModel.toData;
- var lineData = seriesModel.getData();
-
- var dims = coordSys.dimensions;
- fromData.each(dims, function (x, y, idx) {
- fromData.setItemLayout(idx, coordSys.dataToPoint([x, y]));
- });
- toData.each(dims, function (x, y, idx) {
- toData.setItemLayout(idx, coordSys.dataToPoint([x, y]));
- });
- lineData.each(function (idx) {
- var p1 = fromData.getItemLayout(idx);
- var p2 = toData.getItemLayout(idx);
- var curveness = lineData.getItemModel(idx).get('lineStyle.normal.curveness');
- var cp1;
- if (curveness > 0) {
- cp1 = [
- (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness,
- (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness
- ];
- }
- lineData.setItemLayout(idx, [p1, p2, cp1]);
- });
- });
- };
-
-
-/***/ },
-/* 258 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- __webpack_require__(259);
- __webpack_require__(260);
-
-
-/***/ },
-/* 259 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var SeriesModel = __webpack_require__(27);
- var createListFromArray = __webpack_require__(93);
-
- module.exports = SeriesModel.extend({
- type: 'series.heatmap',
-
- getInitialData: function (option, ecModel) {
- return createListFromArray(option.data, this, ecModel);
- },
-
- defaultOption: {
-
- // Cartesian2D or geo
- coordinateSystem: 'cartesian2d',
-
- zlevel: 0,
-
- z: 2,
-
- // Cartesian coordinate system
- xAxisIndex: 0,
- yAxisIndex: 0,
-
- // Geo coordinate system
- geoIndex: 0,
-
- blurSize: 30,
-
- pointSize: 20,
-
- maxOpacity: 1,
-
- minOpacity: 0
- }
- });
-
-
-/***/ },
-/* 260 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var graphic = __webpack_require__(42);
- var HeatmapLayer = __webpack_require__(261);
- var zrUtil = __webpack_require__(3);
-
- function getIsInPiecewiseRange(dataExtent, pieceList, selected) {
- var dataSpan = dataExtent[1] - dataExtent[0];
- pieceList = zrUtil.map(pieceList, function (piece) {
- return {
- interval: [
- (piece.interval[0] - dataExtent[0]) / dataSpan,
- (piece.interval[1] - dataExtent[0]) / dataSpan
- ]
- };
- });
- var len = pieceList.length;
- var lastIndex = 0;
- return function (val) {
- // Try to find in the location of the last found
- for (var i = lastIndex; i < len; i++) {
- var interval = pieceList[i].interval;
- if (interval[0] <= val && val <= interval[1]) {
- lastIndex = i;
- break;
- }
- }
- if (i === len) { // Not found, back interation
- for (var i = lastIndex - 1; i >= 0; i--) {
- var interval = pieceList[i].interval;
- if (interval[0] <= val && val <= interval[1]) {
- lastIndex = i;
- break;
- }
- }
- }
- return i >= 0 && i < len && selected[i];
- };
- }
-
- function getIsInContinuousRange(dataExtent, range) {
- var dataSpan = dataExtent[1] - dataExtent[0];
- range = [
- (range[0] - dataExtent[0]) / dataSpan,
- (range[1] - dataExtent[0]) / dataSpan
- ];
- return function (val) {
- return val >= range[0] && val <= range[1];
- };
- }
-
- function isGeoCoordSys(coordSys) {
- var dimensions = coordSys.dimensions;
- // Not use coorSys.type === 'geo' because coordSys maybe extended
- return dimensions[0] === 'lng' && dimensions[1] === 'lat';
- }
-
- module.exports = __webpack_require__(1).extendChartView({
-
- type: 'heatmap',
-
- render: function (seriesModel, ecModel, api) {
- var visualMapOfThisSeries;
- ecModel.eachComponent('visualMap', function (visualMap) {
- visualMap.eachTargetSeries(function (targetSeries) {
- if (targetSeries === seriesModel) {
- visualMapOfThisSeries = visualMap;
- }
- });
- });
-
- if (!visualMapOfThisSeries) {
- throw new Error('Heatmap must use with visualMap');
- }
-
- this.group.removeAll();
- var coordSys = seriesModel.coordinateSystem;
- if (coordSys.type === 'cartesian2d') {
- this._renderOnCartesian(coordSys, seriesModel, api);
- }
- else if (isGeoCoordSys(coordSys)) {
- this._renderOnGeo(
- coordSys, seriesModel, visualMapOfThisSeries, api
- );
- }
- },
-
- _renderOnCartesian: function (cartesian, seriesModel, api) {
- var xAxis = cartesian.getAxis('x');
- var yAxis = cartesian.getAxis('y');
- var group = this.group;
-
- if (!(xAxis.type === 'category' && yAxis.type === 'category')) {
- throw new Error('Heatmap on cartesian must have two category axes');
- }
- if (!(xAxis.onBand && yAxis.onBand)) {
- throw new Error('Heatmap on cartesian must have two axes with boundaryGap true');
- }
- var width = xAxis.getBandWidth();
- var height = yAxis.getBandWidth();
-
- var data = seriesModel.getData();
- data.each(['x', 'y', 'z'], function (x, y, z, idx) {
- var itemModel = data.getItemModel(idx);
- var point = cartesian.dataToPoint([x, y]);
- // Ignore empty data
- if (isNaN(z)) {
- return;
- }
- var rect = new graphic.Rect({
- shape: {
- x: point[0] - width / 2,
- y: point[1] - height / 2,
- width: width,
- height: height
- },
- style: {
- fill: data.getItemVisual(idx, 'color')
- }
- });
- var style = itemModel.getModel('itemStyle.normal').getItemStyle(['color']);
- var hoverStl = itemModel.getModel('itemStyle.emphasis').getItemStyle();
- var labelModel = itemModel.getModel('label.normal');
- var hoverLabelModel = itemModel.getModel('label.emphasis');
-
- var rawValue = seriesModel.getRawValue(idx);
- var defaultText = '-';
- if (rawValue && rawValue[2] != null) {
- defaultText = rawValue[2];
- }
- if (labelModel.get('show')) {
- graphic.setText(style, labelModel);
- style.text = seriesModel.getFormattedLabel(idx, 'normal') || defaultText;
- }
- if (hoverLabelModel.get('show')) {
- graphic.setText(hoverStl, hoverLabelModel);
- hoverStl.text = seriesModel.getFormattedLabel(idx, 'emphasis') || defaultText;
- }
-
- rect.setStyle(style);
-
- graphic.setHoverStyle(rect, hoverStl);
-
- group.add(rect);
- data.setItemGraphicEl(idx, rect);
- });
- },
-
- _renderOnGeo: function (geo, seriesModel, visualMapModel, api) {
- var inRangeVisuals = visualMapModel.targetVisuals.inRange;
- var outOfRangeVisuals = visualMapModel.targetVisuals.outOfRange;
- // if (!visualMapping) {
- // throw new Error('Data range must have color visuals');
- // }
-
- var data = seriesModel.getData();
- var hmLayer = this._hmLayer || (this._hmLayer || new HeatmapLayer());
- hmLayer.blurSize = seriesModel.get('blurSize');
- hmLayer.pointSize = seriesModel.get('pointSize');
- hmLayer.minOpacity = seriesModel.get('minOpacity');
- hmLayer.maxOpacity = seriesModel.get('maxOpacity');
-
- var rect = geo.getViewRect().clone();
- var roamTransform = geo.getRoamTransform();
- rect.applyTransform(roamTransform);
-
- // Clamp on viewport
- var x = Math.max(rect.x, 0);
- var y = Math.max(rect.y, 0);
- var x2 = Math.min(rect.width + rect.x, api.getWidth());
- var y2 = Math.min(rect.height + rect.y, api.getHeight());
- var width = x2 - x;
- var height = y2 - y;
-
- var points = data.mapArray(['lng', 'lat', 'value'], function (lng, lat, value) {
- var pt = geo.dataToPoint([lng, lat]);
- pt[0] -= x;
- pt[1] -= y;
- pt.push(value);
- return pt;
- });
-
- var dataExtent = visualMapModel.getExtent();
- var isInRange = visualMapModel.type === 'visualMap.continuous'
- ? getIsInContinuousRange(dataExtent, visualMapModel.option.range)
- : getIsInPiecewiseRange(
- dataExtent, visualMapModel.getPieceList(), visualMapModel.option.selected
- );
-
- hmLayer.update(
- points, width, height,
- inRangeVisuals.color.getNormalizer(),
- {
- inRange: inRangeVisuals.color.getColorMapper(),
- outOfRange: outOfRangeVisuals.color.getColorMapper()
- },
- isInRange
- );
- var img = new graphic.Image({
- style: {
- width: width,
- height: height,
- x: x,
- y: y,
- image: hmLayer.canvas
- },
- silent: true
- });
- this.group.add(img);
- }
- });
-
-
-/***/ },
-/* 261 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file defines echarts Heatmap Chart
- * @author Ovilia (me@zhangwenli.com)
- * Inspired by https://github.com/mourner/simpleheat
- *
- * @module
- */
-
-
- var GRADIENT_LEVELS = 256;
- var zrUtil = __webpack_require__(3);
-
- /**
- * Heatmap Chart
- *
- * @class
- */
- function Heatmap() {
- var canvas = zrUtil.createCanvas();
- this.canvas = canvas;
-
- this.blurSize = 30;
- this.pointSize = 20;
-
- this.maxOpacity = 1;
- this.minOpacity = 0;
-
- this._gradientPixels = {};
- }
-
- Heatmap.prototype = {
- /**
- * Renders Heatmap and returns the rendered canvas
- * @param {Array} data array of data, each has x, y, value
- * @param {number} width canvas width
- * @param {number} height canvas height
- */
- update: function(data, width, height, normalize, colorFunc, isInRange) {
- var brush = this._getBrush();
- var gradientInRange = this._getGradient(data, colorFunc, 'inRange');
- var gradientOutOfRange = this._getGradient(data, colorFunc, 'outOfRange');
- var r = this.pointSize + this.blurSize;
-
- var canvas = this.canvas;
- var ctx = canvas.getContext('2d');
- var len = data.length;
- canvas.width = width;
- canvas.height = height;
- for (var i = 0; i < len; ++i) {
- var p = data[i];
- var x = p[0];
- var y = p[1];
- var value = p[2];
-
- // calculate alpha using value
- var alpha = normalize(value);
-
- // draw with the circle brush with alpha
- ctx.globalAlpha = alpha;
- ctx.drawImage(brush, x - r, y - r);
- }
-
- // colorize the canvas using alpha value and set with gradient
- var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
- var pixels = imageData.data;
- var offset = 0;
- var pixelLen = pixels.length;
- var minOpacity = this.minOpacity;
- var maxOpacity = this.maxOpacity;
- var diffOpacity = maxOpacity - minOpacity;
-
- while(offset < pixelLen) {
- var alpha = pixels[offset + 3] / 256;
- var gradientOffset = Math.floor(alpha * (GRADIENT_LEVELS - 1)) * 4;
- // Simple optimize to ignore the empty data
- if (alpha > 0) {
- var gradient = isInRange(alpha) ? gradientInRange : gradientOutOfRange;
- // Any alpha > 0 will be mapped to [minOpacity, maxOpacity]
- alpha > 0 && (alpha = alpha * diffOpacity + minOpacity);
- pixels[offset++] = gradient[gradientOffset];
- pixels[offset++] = gradient[gradientOffset + 1];
- pixels[offset++] = gradient[gradientOffset + 2];
- pixels[offset++] = gradient[gradientOffset + 3] * alpha * 256;
- }
- else {
- offset += 4;
- }
- }
- ctx.putImageData(imageData, 0, 0);
-
- return canvas;
- },
-
- /**
- * get canvas of a black circle brush used for canvas to draw later
- * @private
- * @returns {Object} circle brush canvas
- */
- _getBrush: function() {
- var brushCanvas = this._brushCanvas || (this._brushCanvas = zrUtil.createCanvas());
- // set brush size
- var r = this.pointSize + this.blurSize;
- var d = r * 2;
- brushCanvas.width = d;
- brushCanvas.height = d;
-
- var ctx = brushCanvas.getContext('2d');
- ctx.clearRect(0, 0, d, d);
-
- // in order to render shadow without the distinct circle,
- // draw the distinct circle in an invisible place,
- // and use shadowOffset to draw shadow in the center of the canvas
- ctx.shadowOffsetX = d;
- ctx.shadowBlur = this.blurSize;
- // draw the shadow in black, and use alpha and shadow blur to generate
- // color in color map
- ctx.shadowColor = '#000';
-
- // draw circle in the left to the canvas
- ctx.beginPath();
- ctx.arc(-r, r, this.pointSize, 0, Math.PI * 2, true);
- ctx.closePath();
- ctx.fill();
- return brushCanvas;
- },
-
- /**
- * get gradient color map
- * @private
- */
- _getGradient: function (data, colorFunc, state) {
- var gradientPixels = this._gradientPixels;
- var pixelsSingleState = gradientPixels[state] || (gradientPixels[state] = new Uint8ClampedArray(256 * 4));
- var color = [];
- var off = 0;
- for (var i = 0; i < 256; i++) {
- colorFunc[state](i / 255, true, color);
- pixelsSingleState[off++] = color[0];
- pixelsSingleState[off++] = color[1];
- pixelsSingleState[off++] = color[2];
- pixelsSingleState[off++] = color[3];
- }
- return pixelsSingleState;
- }
- };
-
- module.exports = Heatmap;
-
-
-
-/***/ },
-/* 262 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * Legend component entry file8
- */
-
-
- __webpack_require__(263);
- __webpack_require__(264);
- __webpack_require__(265);
-
- var echarts = __webpack_require__(1);
- // Series Filter
- echarts.registerProcessor('filter', __webpack_require__(267));
-
-
-/***/ },
-/* 263 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
- var Model = __webpack_require__(8);
-
- var LegendModel = __webpack_require__(1).extendComponentModel({
-
- type: 'legend',
-
- dependencies: ['series'],
-
- layoutMode: {
- type: 'box',
- ignoreSize: true
- },
-
- init: function (option, parentModel, ecModel) {
- this.mergeDefaultAndTheme(option, ecModel);
-
- option.selected = option.selected || {};
-
- this._updateData(ecModel);
-
- var legendData = this._data;
- // If has any selected in option.selected
- var selectedMap = this.option.selected;
- // If selectedMode is single, try to select one
- if (legendData[0] && this.get('selectedMode') === 'single') {
- var hasSelected = false;
- for (var name in selectedMap) {
- if (selectedMap[name]) {
- this.select(name);
- hasSelected = true;
- }
- }
- // Try select the first if selectedMode is single
- !hasSelected && this.select(legendData[0].get('name'));
- }
- },
-
- mergeOption: function (option) {
- LegendModel.superCall(this, 'mergeOption', option);
-
- this._updateData(this.ecModel);
- },
-
- _updateData: function (ecModel) {
- var legendData = zrUtil.map(this.get('data') || [], function (dataItem) {
- if (typeof dataItem === 'string') {
- dataItem = {
- name: dataItem
- };
- }
- return new Model(dataItem, this, this.ecModel);
- }, this);
- this._data = legendData;
-
- var availableNames = zrUtil.map(ecModel.getSeries(), function (series) {
- return series.name;
- });
- ecModel.eachSeries(function (seriesModel) {
- if (seriesModel.legendDataProvider) {
- var data = seriesModel.legendDataProvider();
- availableNames = availableNames.concat(data.mapArray(data.getName));
- }
- });
- /**
- * @type {Array.<string>}
- * @private
- */
- this._availableNames = availableNames;
- },
-
- /**
- * @return {Array.<module:echarts/model/Model>}
- */
- getData: function () {
- return this._data;
- },
-
- /**
- * @param {string} name
- */
- select: function (name) {
- var selected = this.option.selected;
- var selectedMode = this.get('selectedMode');
- if (selectedMode === 'single') {
- var data = this._data;
- zrUtil.each(data, function (dataItem) {
- selected[dataItem.get('name')] = false;
- });
- }
- selected[name] = true;
- },
-
- /**
- * @param {string} name
- */
- unSelect: function (name) {
- if (this.get('selectedMode') !== 'single') {
- this.option.selected[name] = false;
- }
- },
-
- /**
- * @param {string} name
- */
- toggleSelected: function (name) {
- var selected = this.option.selected;
- // Default is true
- if (!(name in selected)) {
- selected[name] = true;
- }
- this[selected[name] ? 'unSelect' : 'select'](name);
- },
-
- /**
- * @param {string} name
- */
- isSelected: function (name) {
- var selected = this.option.selected;
- return !((name in selected) && !selected[name])
- && zrUtil.indexOf(this._availableNames, name) >= 0;
- },
-
- defaultOption: {
- // 一级层叠
- zlevel: 0,
- // 二级层叠
- z: 4,
- show: true,
-
- // 布局方式,默认为水平布局,可选为:
- // 'horizontal' | 'vertical'
- orient: 'horizontal',
-
- left: 'center',
- // right: 'center',
-
- top: 'top',
- // bottom: 'top',
-
- // 水平对齐
- // 'auto' | 'left' | 'right'
- // 默认为 'auto', 根据 x 的位置判断是左对齐还是右对齐
- align: 'auto',
-
- backgroundColor: 'rgba(0,0,0,0)',
- // 图例边框颜色
- borderColor: '#ccc',
- // 图例边框线宽,单位px,默认为0(无边框)
- borderWidth: 0,
- // 图例内边距,单位px,默认各方向内边距为5,
- // 接受数组分别设定上右下左边距,同css
- padding: 5,
- // 各个item之间的间隔,单位px,默认为10,
- // 横向布局时为水平间隔,纵向布局时为纵向间隔
- itemGap: 10,
- // 图例图形宽度
- itemWidth: 25,
- // 图例图形高度
- itemHeight: 14,
- textStyle: {
- // 图例文字颜色
- color: '#333'
- },
- // formatter: '',
- // 选择模式,默认开启图例开关
- selectedMode: true
- // 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入
- // selected: null,
- // 图例内容(详见legend.data,数组中每一项代表一个item
- // data: [],
- }
- });
-
- module.exports = LegendModel;
-
-
-/***/ },
-/* 264 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Legend action
- */
-
-
- var echarts = __webpack_require__(1);
- var zrUtil = __webpack_require__(3);
-
- function legendSelectActionHandler(methodName, payload, ecModel) {
- var selectedMap = {};
- var isToggleSelect = methodName === 'toggleSelected';
- var isSelected;
- // Update all legend components
- ecModel.eachComponent('legend', function (legendModel) {
- if (isToggleSelect && isSelected != null) {
- // Force other legend has same selected status
- // Or the first is toggled to true and other are toggled to false
- // In the case one legend has some item unSelected in option. And if other legend
- // doesn't has the item, they will assume it is selected.
- legendModel[isSelected ? 'select' : 'unSelect'](payload.name);
- }
- else {
- legendModel[methodName](payload.name);
- isSelected = legendModel.isSelected(payload.name);
- }
- var legendData = legendModel.getData();
- zrUtil.each(legendData, function (model) {
- var name = model.get('name');
- // Wrap element
- if (name === '\n' || name === '') {
- return;
- }
- var isItemSelected = legendModel.isSelected(name);
- if (name in selectedMap) {
- // Unselected if any legend is unselected
- selectedMap[name] = selectedMap[name] && isItemSelected;
- }
- else {
- selectedMap[name] = isItemSelected;
- }
- });
- });
- // Return the event explicitly
- return {
- name: payload.name,
- selected: selectedMap
- };
- }
- /**
- * @event legendToggleSelect
- * @type {Object}
- * @property {string} type 'legendToggleSelect'
- * @property {string} [from]
- * @property {string} name Series name or data item name
- */
- echarts.registerAction(
- 'legendToggleSelect', 'legendselectchanged',
- zrUtil.curry(legendSelectActionHandler, 'toggleSelected')
- );
-
- /**
- * @event legendSelect
- * @type {Object}
- * @property {string} type 'legendSelect'
- * @property {string} name Series name or data item name
- */
- echarts.registerAction(
- 'legendSelect', 'legendselected',
- zrUtil.curry(legendSelectActionHandler, 'select')
- );
-
- /**
- * @event legendUnSelect
- * @type {Object}
- * @property {string} type 'legendUnSelect'
- * @property {string} name Series name or data item name
- */
- echarts.registerAction(
- 'legendUnSelect', 'legendunselected',
- zrUtil.curry(legendSelectActionHandler, 'unSelect')
- );
-
-
-/***/ },
-/* 265 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var symbolCreator = __webpack_require__(100);
- var graphic = __webpack_require__(42);
- var listComponentHelper = __webpack_require__(266);
-
- var curry = zrUtil.curry;
-
- var LEGEND_DISABLE_COLOR = '#ccc';
-
- function dispatchSelectAction(name, api) {
- api.dispatchAction({
- type: 'legendToggleSelect',
- name: name
- });
- }
-
- function dispatchHighlightAction(seriesModel, dataName, api) {
- seriesModel.get('legendHoverLink') && api.dispatchAction({
- type: 'highlight',
- seriesName: seriesModel.name,
- name: dataName
- });
- }
-
- function dispatchDownplayAction(seriesModel, dataName, api) {
- seriesModel.get('legendHoverLink') && api.dispatchAction({
- type: 'downplay',
- seriesName: seriesModel.name,
- name: dataName
- });
- }
-
- module.exports = __webpack_require__(1).extendComponentView({
-
- type: 'legend',
-
- init: function () {
- this._symbolTypeStore = {};
- },
-
- render: function (legendModel, ecModel, api) {
- var group = this.group;
- group.removeAll();
-
- if (!legendModel.get('show')) {
- return;
- }
-
- var selectMode = legendModel.get('selectedMode');
- var itemAlign = legendModel.get('align');
-
- if (itemAlign === 'auto') {
- itemAlign = (legendModel.get('left') === 'right'
- && legendModel.get('orient') === 'vertical')
- ? 'right' : 'left';
- }
-
- var legendItemMap = {};
- var legendDrawedMap = {};
- zrUtil.each(legendModel.getData(), function (itemModel) {
- var seriesName = itemModel.get('name');
- // Use empty string or \n as a newline string
- if (seriesName === '' || seriesName === '\n') {
- group.add(new graphic.Group({
- newline: true
- }));
- }
-
- var seriesModel = ecModel.getSeriesByName(seriesName)[0];
-
- legendItemMap[seriesName] = itemModel;
-
- if (!seriesModel || legendDrawedMap[seriesName]) {
- // Series not exists
- return;
- }
-
- var data = seriesModel.getData();
- var color = data.getVisual('color');
-
- // If color is a callback function
- if (typeof color === 'function') {
- // Use the first data
- color = color(seriesModel.getDataParams(0));
- }
-
- // Using rect symbol defaultly
- var legendSymbolType = data.getVisual('legendSymbol') || 'roundRect';
- var symbolType = data.getVisual('symbol');
-
- var itemGroup = this._createItem(
- seriesName, itemModel, legendModel,
- legendSymbolType, symbolType,
- itemAlign, color,
- selectMode
- );
-
- itemGroup.on('click', curry(dispatchSelectAction, seriesName, api))
- .on('mouseover', curry(dispatchHighlightAction, seriesModel, '', api))
- .on('mouseout', curry(dispatchDownplayAction, seriesModel, '', api));
-
- legendDrawedMap[seriesName] = true;
- }, this);
-
- ecModel.eachRawSeries(function (seriesModel) {
- if (seriesModel.legendDataProvider) {
- var data = seriesModel.legendDataProvider();
- data.each(function (idx) {
- var name = data.getName(idx);
-
- // Avoid mutiple series use the same data name
- if (!legendItemMap[name] || legendDrawedMap[name]) {
- return;
- }
-
- var color = data.getItemVisual(idx, 'color');
-
- var legendSymbolType = 'roundRect';
-
- var itemGroup = this._createItem(
- name, legendItemMap[name], legendModel,
- legendSymbolType, null,
- itemAlign, color,
- selectMode
- );
-
- itemGroup.on('click', curry(dispatchSelectAction, name, api))
- // FIXME Should not specify the series name
- .on('mouseover', curry(dispatchHighlightAction, seriesModel, name, api))
- .on('mouseout', curry(dispatchDownplayAction, seriesModel, name, api));
-
- legendDrawedMap[name] = true;
- }, false, this);
- }
- }, this);
-
- listComponentHelper.layout(group, legendModel, api);
- // Render background after group is layout
- // FIXME
- listComponentHelper.addBackground(group, legendModel);
- },
-
- _createItem: function (
- name, itemModel, legendModel,
- legendSymbolType, symbolType,
- itemAlign, color, selectMode
- ) {
- var itemWidth = legendModel.get('itemWidth');
- var itemHeight = legendModel.get('itemHeight');
-
- var isSelected = legendModel.isSelected(name);
- var itemGroup = new graphic.Group();
-
- var textStyleModel = itemModel.getModel('textStyle');
-
- var itemIcon = itemModel.get('icon');
-
- // Use user given icon first
- legendSymbolType = itemIcon || legendSymbolType;
- itemGroup.add(symbolCreator.createSymbol(
- legendSymbolType, 0, 0, itemWidth, itemHeight, isSelected ? color : LEGEND_DISABLE_COLOR
- ));
-
- // Compose symbols
- // PENDING
- if (!itemIcon && symbolType
- // At least show one symbol, can't be all none
- && ((symbolType !== legendSymbolType) || symbolType == 'none')
- ) {
- var size = itemHeight * 0.8;
- if (symbolType === 'none') {
- symbolType = 'circle';
- }
- // Put symbol in the center
- itemGroup.add(symbolCreator.createSymbol(
- symbolType, (itemWidth - size) / 2, (itemHeight - size) / 2, size, size,
- isSelected ? color : LEGEND_DISABLE_COLOR
- ));
- }
-
- // Text
- var textX = itemAlign === 'left' ? itemWidth + 5 : -5;
- var textAlign = itemAlign;
-
- var formatter = legendModel.get('formatter');
- if (typeof formatter === 'string' && formatter) {
- name = formatter.replace('{name}', name);
- }
- else if (typeof formatter === 'function') {
- name = formatter(name);
- }
-
- var text = new graphic.Text({
- style: {
- text: name,
- x: textX,
- y: itemHeight / 2,
- fill: isSelected ? textStyleModel.getTextColor() : LEGEND_DISABLE_COLOR,
- textFont: textStyleModel.getFont(),
- textAlign: textAlign,
- textVerticalAlign: 'middle'
- }
- });
- itemGroup.add(text);
-
- // Add a invisible rect to increase the area of mouse hover
- itemGroup.add(new graphic.Rect({
- shape: itemGroup.getBoundingRect(),
- invisible: true
- }));
-
- itemGroup.eachChild(function (child) {
- child.silent = !selectMode;
- });
-
- this.group.add(itemGroup);
-
- graphic.setHoverStyle(itemGroup);
-
- return itemGroup;
- }
- });
-
-
-/***/ },
-/* 266 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- // List layout
- var layout = __webpack_require__(21);
- var formatUtil = __webpack_require__(6);
- var graphic = __webpack_require__(42);
-
- function positionGroup(group, model, api) {
- layout.positionGroup(
- group, model.getBoxLayoutParams(),
- {
- width: api.getWidth(),
- height: api.getHeight()
- },
- model.get('padding')
- );
- }
-
- module.exports = {
- /**
- * Layout list like component.
- * It will box layout each items in group of component and then position the whole group in the viewport
- * @param {module:zrender/group/Group} group
- * @param {module:echarts/model/Component} componentModel
- * @param {module:echarts/ExtensionAPI}
- */
- layout: function (group, componentModel, api) {
- var rect = layout.getLayoutRect(componentModel.getBoxLayoutParams(), {
- width: api.getWidth(),
- height: api.getHeight()
- }, componentModel.get('padding'));
- layout.box(
- componentModel.get('orient'),
- group,
- componentModel.get('itemGap'),
- rect.width,
- rect.height
- );
-
- positionGroup(group, componentModel, api);
- },
-
- addBackground: function (group, componentModel) {
- var padding = formatUtil.normalizeCssArray(
- componentModel.get('padding')
- );
- var boundingRect = group.getBoundingRect();
- var style = componentModel.getItemStyle(['color', 'opacity']);
- style.fill = componentModel.get('backgroundColor');
- var rect = new graphic.Rect({
- shape: {
- x: boundingRect.x - padding[3],
- y: boundingRect.y - padding[0],
- width: boundingRect.width + padding[1] + padding[3],
- height: boundingRect.height + padding[0] + padding[2]
- },
- style: style,
- silent: true,
- z2: -1
- });
- graphic.subPixelOptimizeRect(rect);
-
- group.add(rect);
- }
- };
-
-
-/***/ },
-/* 267 */
-/***/ function(module, exports) {
-
-
- module.exports = function (ecModel) {
- var legendModels = ecModel.findComponents({
- mainType: 'legend'
- });
- if (legendModels && legendModels.length) {
- ecModel.filterSeries(function (series) {
- // If in any legend component the status is not selected.
- // Because in legend series is assumed selected when it is not in the legend data.
- for (var i = 0; i < legendModels.length; i++) {
- if (!legendModels[i].isSelected(series.name)) {
- return false;
- }
- }
- return true;
- });
- }
- };
-
-
-/***/ },
-/* 268 */
-/***/ function(module, exports, __webpack_require__) {
-
- // FIXME Better way to pack data in graphic element
-
-
- __webpack_require__(269);
-
- __webpack_require__(270);
-
- // Show tip action
- /**
- * @action
- * @property {string} type
- * @property {number} seriesIndex
- * @property {number} dataIndex
- * @property {number} [x]
- * @property {number} [y]
- */
- __webpack_require__(1).registerAction(
- {
- type: 'showTip',
- event: 'showTip',
- update: 'none'
- },
- // noop
- function () {}
- );
- // Hide tip action
- __webpack_require__(1).registerAction(
- {
- type: 'hideTip',
- event: 'hideTip',
- update: 'none'
- },
- // noop
- function () {}
- );
-
-
-/***/ },
-/* 269 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- __webpack_require__(1).extendComponentModel({
-
- type: 'tooltip',
-
- defaultOption: {
- zlevel: 0,
-
- z: 8,
-
- show: true,
-
- // tooltip主体内容
- showContent: true,
-
- // 触发类型,默认数据触发,见下图,可选为:'item' ¦ 'axis'
- trigger: 'item',
-
- // 触发条件,支持 'click' | 'mousemove'
- triggerOn: 'mousemove',
-
- // 是否永远显示 content
- alwaysShowContent: false,
-
- // 位置 {Array} | {Function}
- // position: null
-
- // 内容格式器:{string}(Template) ¦ {Function}
- // formatter: null
-
- // 隐藏延迟,单位ms
- hideDelay: 100,
-
- // 动画变换时间,单位s
- transitionDuration: 0.4,
-
- enterable: false,
-
- // 提示背景颜色,默认为透明度为0.7的黑色
- backgroundColor: 'rgba(50,50,50,0.7)',
-
- // 提示边框颜色
- borderColor: '#333',
-
- // 提示边框圆角,单位px,默认为4
- borderRadius: 4,
-
- // 提示边框线宽,单位px,默认为0(无边框)
- borderWidth: 0,
-
- // 提示内边距,单位px,默认各方向内边距为5,
- // 接受数组分别设定上右下左边距,同css
- padding: 5,
-
- // Extra css text
- extraCssText: '',
-
- // 坐标轴指示器,坐标轴触发有效
- axisPointer: {
- // 默认为直线
- // 可选为:'line' | 'shadow' | 'cross'
- type: 'line',
-
- // type 为 line 的时候有效,指定 tooltip line 所在的轴,可选
- // 可选 'x' | 'y' | 'angle' | 'radius' | 'auto'
- // 默认 'auto',会选择类型为 cateogry 的轴,对于双数值轴,笛卡尔坐标系会默认选择 x 轴
- // 极坐标系会默认选择 angle 轴
- axis: 'auto',
-
- animation: true,
- animationDurationUpdate: 200,
- animationEasingUpdate: 'exponentialOut',
-
- // 直线指示器样式设置
- lineStyle: {
- color: '#555',
- width: 1,
- type: 'solid'
- },
-
- crossStyle: {
- color: '#555',
- width: 1,
- type: 'dashed',
-
- // TODO formatter
- textStyle: {}
- },
-
- // 阴影指示器样式设置
- shadowStyle: {
- color: 'rgba(150,150,150,0.3)'
- }
- },
- textStyle: {
- color: '#fff',
- fontSize: 14
- }
- }
- });
-
-
-/***/ },
-/* 270 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var TooltipContent = __webpack_require__(271);
- var graphic = __webpack_require__(42);
- var zrUtil = __webpack_require__(3);
- var formatUtil = __webpack_require__(6);
- var numberUtil = __webpack_require__(7);
- var parsePercent = numberUtil.parsePercent;
- var env = __webpack_require__(78);
-
- function dataEqual(a, b) {
- if (!a || !b) {
- return false;
- }
- var round = numberUtil.round;
- return round(a[0]) === round(b[0])
- && round(a[1]) === round(b[1]);
- }
- /**
- * @inner
- */
- function makeLineShape(x1, y1, x2, y2) {
- return {
- x1: x1,
- y1: y1,
- x2: x2,
- y2: y2
- };
- }
-
- /**
- * @inner
- */
- function makeRectShape(x, y, width, height) {
- return {
- x: x,
- y: y,
- width: width,
- height: height
- };
- }
-
- /**
- * @inner
- */
- function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) {
- return {
- cx: cx,
- cy: cy,
- r0: r0,
- r: r,
- startAngle: startAngle,
- endAngle: endAngle,
- clockwise: true
- };
- }
-
- function refixTooltipPosition(x, y, el, viewWidth, viewHeight) {
- var width = el.clientWidth;
- var height = el.clientHeight;
- var gap = 20;
-
- if (x + width + gap > viewWidth) {
- x -= width + gap;
- }
- else {
- x += gap;
- }
- if (y + height + gap > viewHeight) {
- y -= height + gap;
- }
- else {
- y += gap;
- }
- return [x, y];
- }
-
- function calcTooltipPosition(position, rect, dom) {
- var domWidth = dom.clientWidth;
- var domHeight = dom.clientHeight;
- var gap = 5;
- var x = 0;
- var y = 0;
- var rectWidth = rect.width;
- var rectHeight = rect.height;
- switch (position) {
- case 'inside':
- x = rect.x + rectWidth / 2 - domWidth / 2;
- y = rect.y + rectHeight / 2 - domHeight / 2;
- break;
- case 'top':
- x = rect.x + rectWidth / 2 - domWidth / 2;
- y = rect.y - domHeight - gap;
- break;
- case 'bottom':
- x = rect.x + rectWidth / 2 - domWidth / 2;
- y = rect.y + rectHeight + gap;
- break;
- case 'left':
- x = rect.x - domWidth - gap;
- y = rect.y + rectHeight / 2 - domHeight / 2;
- break;
- case 'right':
- x = rect.x + rectWidth + gap;
- y = rect.y + rectHeight / 2 - domHeight / 2;
- }
- return [x, y];
- }
-
- /**
- * @param {string|Function|Array.<number>} positionExpr
- * @param {number} x Mouse x
- * @param {number} y Mouse y
- * @param {module:echarts/component/tooltip/TooltipContent} content
- * @param {Object|<Array.<Object>} params
- * @param {module:zrender/Element} el target element
- * @param {module:echarts/ExtensionAPI} api
- * @return {Array.<number>}
- */
- function updatePosition(positionExpr, x, y, content, params, el, api) {
- var viewWidth = api.getWidth();
- var viewHeight = api.getHeight();
-
- var rect = el && el.getBoundingRect().clone();
- el && rect.applyTransform(el.transform);
- if (typeof positionExpr === 'function') {
- // Callback of position can be an array or a string specify the positiont
- positionExpr = positionExpr([x, y], params, rect);
- }
-
- if (zrUtil.isArray(positionExpr)) {
- x = parsePercent(positionExpr[0], viewWidth);
- y = parsePercent(positionExpr[1], viewHeight);
- }
- // Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element
- else if (typeof positionExpr === 'string' && el) {
- var pos = calcTooltipPosition(
- positionExpr, rect, content.el
- );
- x = pos[0];
- y = pos[1];
- }
- else {
- var pos = refixTooltipPosition(
- x, y, content.el, viewWidth, viewHeight
- );
- x = pos[0];
- y = pos[1];
- }
-
- content.moveTo(x, y);
- }
-
- function ifSeriesSupportAxisTrigger(seriesModel) {
- var coordSys = seriesModel.coordinateSystem;
- var trigger = seriesModel.get('tooltip.trigger', true);
- // Ignore series use item tooltip trigger and series coordinate system is not cartesian or
- return !(!coordSys
- || (coordSys.type !== 'cartesian2d' && coordSys.type !== 'polar' && coordSys.type !== 'single')
- || trigger === 'item');
- }
-
- __webpack_require__(1).extendComponentView({
-
- type: 'tooltip',
-
- _axisPointers: {},
-
- init: function (ecModel, api) {
- if (env.node) {
- return;
- }
- var tooltipContent = new TooltipContent(api.getDom(), api);
- this._tooltipContent = tooltipContent;
-
- api.on('showTip', this._manuallyShowTip, this);
- api.on('hideTip', this._manuallyHideTip, this);
- },
-
- render: function (tooltipModel, ecModel, api) {
- if (env.node) {
- return;
- }
-
- // Reset
- this.group.removeAll();
-
- /**
- * @type {Object}
- * @private
- */
- this._axisPointers = {};
-
- /**
- * @private
- * @type {module:echarts/component/tooltip/TooltipModel}
- */
- this._tooltipModel = tooltipModel;
-
- /**
- * @private
- * @type {module:echarts/model/Global}
- */
- this._ecModel = ecModel;
-
- /**
- * @private
- * @type {module:echarts/ExtensionAPI}
- */
- this._api = api;
-
- /**
- * @type {Object}
- * @private
- */
- this._lastHover = {
- // data
- // payloadBatch
- };
-
- var tooltipContent = this._tooltipContent;
- tooltipContent.update();
- tooltipContent.enterable = tooltipModel.get('enterable');
- this._alwaysShowContent = tooltipModel.get('alwaysShowContent');
-
- /**
- * @type {Object.<string, Array>}
- */
- this._seriesGroupByAxis = this._prepareAxisTriggerData(
- tooltipModel, ecModel
- );
-
- var crossText = this._crossText;
- if (crossText) {
- this.group.add(crossText);
- }
-
- // Try to keep the tooltip show when refreshing
- if (this._lastX != null && this._lastY != null) {
- var self = this;
- clearTimeout(this._refreshUpdateTimeout);
- this._refreshUpdateTimeout = setTimeout(function () {
- // Show tip next tick after other charts are rendered
- // In case highlight action has wrong result
- // FIXME
- self._manuallyShowTip({
- x: self._lastX,
- y: self._lastY
- });
- });
- }
-
- var zr = this._api.getZr();
- var tryShow = this._tryShow;
- zr.off('click', tryShow);
- zr.off('mousemove', tryShow);
- zr.off('mouseout', this._hide);
- if (tooltipModel.get('triggerOn') === 'click') {
- zr.on('click', tryShow, this);
- }
- else {
- zr.on('mousemove', tryShow, this);
- zr.on('mouseout', this._hide, this);
- }
-
- },
-
- /**
- * Show tip manually by
- * dispatchAction({
- * type: 'showTip',
- * x: 10,
- * y: 10
- * });
- * Or
- * dispatchAction({
- * type: 'showTip',
- * seriesIndex: 0,
- * dataIndex: 1
- * });
- *
- * TODO Batch
- */
- _manuallyShowTip: function (event) {
- // From self
- if (event.from === this.uid) {
- return;
- }
-
- var ecModel = this._ecModel;
- var seriesIndex = event.seriesIndex;
- var dataIndex = event.dataIndex;
- var seriesModel = ecModel.getSeriesByIndex(seriesIndex);
- var api = this._api;
-
- if (event.x == null || event.y == null) {
- if (!seriesModel) {
- // Find the first series can use axis trigger
- ecModel.eachSeries(function (_series) {
- if (ifSeriesSupportAxisTrigger(_series) && !seriesModel) {
- seriesModel = _series;
- }
- });
- }
- if (seriesModel) {
- var data = seriesModel.getData();
- if (dataIndex == null) {
- dataIndex = data.indexOfName(event.name);
- }
- var el = data.getItemGraphicEl(dataIndex);
- var cx, cy;
- // Try to get the point in coordinate system
- var coordSys = seriesModel.coordinateSystem;
- if (coordSys && coordSys.dataToPoint) {
- var point = coordSys.dataToPoint(
- data.getValues(coordSys.dimensions, dataIndex, true)
- );
- cx = point && point[0];
- cy = point && point[1];
- }
- else if (el) {
- // Use graphic bounding rect
- var rect = el.getBoundingRect().clone();
- rect.applyTransform(el.transform);
- cx = rect.x + rect.width / 2;
- cy = rect.y + rect.height / 2;
- }
- if (cx != null && cy != null) {
- this._tryShow({
- offsetX: cx,
- offsetY: cy,
- target: el,
- event: {}
- });
- }
- }
- }
- else {
- var el = api.getZr().handler.findHover(event.x, event.y);
- this._tryShow({
- offsetX: event.x,
- offsetY: event.y,
- target: el,
- event: {}
- });
- }
- },
-
- _manuallyHideTip: function (e) {
- if (e.from === this.uid) {
- return;
- }
-
- this._hide();
- },
-
- _prepareAxisTriggerData: function (tooltipModel, ecModel) {
- // Prepare data for axis trigger
- var seriesGroupByAxis = {};
- ecModel.eachSeries(function (seriesModel) {
- if (ifSeriesSupportAxisTrigger(seriesModel)) {
- var coordSys = seriesModel.coordinateSystem;
- var baseAxis;
- var key;
-
- // Only cartesian2d, polar and single support axis trigger
- if (coordSys.type === 'cartesian2d') {
- // FIXME `axisPointer.axis` is not baseAxis
- baseAxis = coordSys.getBaseAxis();
- key = baseAxis.dim + baseAxis.index;
- }
- else if (coordSys.type === 'single') {
- baseAxis = coordSys.getAxis();
- key = baseAxis.dim + baseAxis.type;
- }
- else {
- baseAxis = coordSys.getBaseAxis();
- key = baseAxis.dim + coordSys.name;
- }
-
- seriesGroupByAxis[key] = seriesGroupByAxis[key] || {
- coordSys: [],
- series: []
- };
- seriesGroupByAxis[key].coordSys.push(coordSys);
- seriesGroupByAxis[key].series.push(seriesModel);
- }
- }, this);
-
- return seriesGroupByAxis;
- },
-
- /**
- * mousemove handler
- * @param {Object} e
- * @private
- */
- _tryShow: function (e) {
- var el = e.target;
- var tooltipModel = this._tooltipModel;
- var globalTrigger = tooltipModel.get('trigger');
- var ecModel = this._ecModel;
- var api = this._api;
-
- if (!tooltipModel) {
- return;
- }
-
- // Save mouse x, mouse y. So we can try to keep showing the tip if chart is refreshed
- this._lastX = e.offsetX;
- this._lastY = e.offsetY;
-
- // Always show item tooltip if mouse is on the element with dataIndex
- if (el && el.dataIndex != null) {
- // Use dataModel in element if possible
- // Used when mouseover on a element like markPoint or edge
- // In which case, the data is not main data in series.
- var dataModel = el.dataModel || ecModel.getSeriesByIndex(el.seriesIndex);
- var dataIndex = el.dataIndex;
- var itemModel = dataModel.getData().getItemModel(dataIndex);
- // Series or single data may use item trigger when global is axis trigger
- if ((itemModel.get('tooltip.trigger') || globalTrigger) === 'axis') {
- this._showAxisTooltip(tooltipModel, ecModel, e);
- }
- else {
- // Reset ticket
- this._ticket = '';
- // If either single data or series use item trigger
- this._hideAxisPointer();
- // Reset last hover and dispatch downplay action
- this._resetLastHover();
-
- this._showItemTooltipContent(dataModel, dataIndex, e);
- }
-
- api.dispatchAction({
- type: 'showTip',
- from: this.uid,
- dataIndex: el.dataIndex,
- seriesIndex: el.seriesIndex
- });
- }
- else {
- if (globalTrigger === 'item') {
- this._hide();
- }
- else {
- // Try show axis tooltip
- this._showAxisTooltip(tooltipModel, ecModel, e);
- }
-
- // Action of cross pointer
- // other pointer types will trigger action in _dispatchAndShowSeriesTooltipContent method
- if (tooltipModel.get('axisPointer.type') === 'cross') {
- api.dispatchAction({
- type: 'showTip',
- from: this.uid,
- x: e.offsetX,
- y: e.offsetY
- });
- }
- }
- },
-
- /**
- * Show tooltip on axis
- * @param {module:echarts/component/tooltip/TooltipModel} tooltipModel
- * @param {module:echarts/model/Global} ecModel
- * @param {Object} e
- * @private
- */
- _showAxisTooltip: function (tooltipModel, ecModel, e) {
- var axisPointerModel = tooltipModel.getModel('axisPointer');
- var axisPointerType = axisPointerModel.get('type');
-
- if (axisPointerType === 'cross') {
- var el = e.target;
- if (el && el.dataIndex != null) {
- var seriesModel = ecModel.getSeriesByIndex(el.seriesIndex);
- var dataIndex = el.dataIndex;
- this._showItemTooltipContent(seriesModel, dataIndex, e);
- }
- }
-
- this._showAxisPointer();
- var allNotShow = true;
- zrUtil.each(this._seriesGroupByAxis, function (seriesCoordSysSameAxis) {
- // Try show the axis pointer
- var allCoordSys = seriesCoordSysSameAxis.coordSys;
- var coordSys = allCoordSys[0];
-
- // If mouse position is not in the grid or polar
- var point = [e.offsetX, e.offsetY];
-
- if (!coordSys.containPoint(point)) {
- // Hide axis pointer
- this._hideAxisPointer(coordSys.name);
- return;
- }
-
- allNotShow = false;
- // Make sure point is discrete on cateogry axis
- var dimensions = coordSys.dimensions;
- var value = coordSys.pointToData(point, true);
- point = coordSys.dataToPoint(value);
- var baseAxis = coordSys.getBaseAxis();
- var axisType = axisPointerModel.get('axis');
- if (axisType === 'auto') {
- axisType = baseAxis.dim;
- }
-
- var contentNotChange = false;
- var lastHover = this._lastHover;
- if (axisPointerType === 'cross') {
- // If hover data not changed
- // Possible when two axes are all category
- if (dataEqual(lastHover.data, value)) {
- contentNotChange = true;
- }
- lastHover.data = value;
- }
- else {
- var valIndex = zrUtil.indexOf(dimensions, axisType);
-
- // If hover data not changed on the axis dimension
- if (lastHover.data === value[valIndex]) {
- contentNotChange = true;
- }
- lastHover.data = value[valIndex];
- }
-
- if (coordSys.type === 'cartesian2d' && !contentNotChange) {
- this._showCartesianPointer(
- axisPointerModel, coordSys, axisType, point
- );
- }
- else if (coordSys.type === 'polar' && !contentNotChange) {
- this._showPolarPointer(
- axisPointerModel, coordSys, axisType, point
- );
- }
- else if (coordSys.type === 'single' && !contentNotChange) {
- this._showSinglePointer(
- axisPointerModel, coordSys, axisType, point
- );
- }
-
- if (axisPointerType !== 'cross') {
- this._dispatchAndShowSeriesTooltipContent(
- coordSys, seriesCoordSysSameAxis.series, point, value, contentNotChange
- );
- }
- }, this);
-
- if (allNotShow) {
- this._hide();
- }
- },
-
- /**
- * Show tooltip on axis of cartesian coordinate
- * @param {module:echarts/model/Model} axisPointerModel
- * @param {module:echarts/coord/cartesian/Cartesian2D} cartesians
- * @param {string} axisType
- * @param {Array.<number>} point
- * @private
- */
- _showCartesianPointer: function (axisPointerModel, cartesian, axisType, point) {
- var self = this;
-
- var axisPointerType = axisPointerModel.get('type');
- var moveAnimation = axisPointerType !== 'cross';
-
- if (axisPointerType === 'cross') {
- moveGridLine('x', point, cartesian.getAxis('y').getGlobalExtent());
- moveGridLine('y', point, cartesian.getAxis('x').getGlobalExtent());
-
- this._updateCrossText(cartesian, point, axisPointerModel);
- }
- else {
- var otherAxis = cartesian.getAxis(axisType === 'x' ? 'y' : 'x');
- var otherExtent = otherAxis.getGlobalExtent();
-
- if (cartesian.type === 'cartesian2d') {
- (axisPointerType === 'line' ? moveGridLine : moveGridShadow)(
- axisType, point, otherExtent
- );
- }
- }
-
- /**
- * @inner
- */
- function moveGridLine(axisType, point, otherExtent) {
- var targetShape = axisType === 'x'
- ? makeLineShape(point[0], otherExtent[0], point[0], otherExtent[1])
- : makeLineShape(otherExtent[0], point[1], otherExtent[1], point[1]);
-
- var pointerEl = self._getPointerElement(
- cartesian, axisPointerModel, axisType, targetShape
- );
- moveAnimation
- ? graphic.updateProps(pointerEl, {
- shape: targetShape
- }, axisPointerModel)
- : pointerEl.attr({
- shape: targetShape
- });
- }
-
- /**
- * @inner
- */
- function moveGridShadow(axisType, point, otherExtent) {
- var axis = cartesian.getAxis(axisType);
- var bandWidth = axis.getBandWidth();
- var span = otherExtent[1] - otherExtent[0];
- var targetShape = axisType === 'x'
- ? makeRectShape(point[0] - bandWidth / 2, otherExtent[0], bandWidth, span)
- : makeRectShape(otherExtent[0], point[1] - bandWidth / 2, span, bandWidth);
-
- var pointerEl = self._getPointerElement(
- cartesian, axisPointerModel, axisType, targetShape
- );
- moveAnimation
- ? graphic.updateProps(pointerEl, {
- shape: targetShape
- }, axisPointerModel)
- : pointerEl.attr({
- shape: targetShape
- });
- }
- },
-
- _showSinglePointer: function (axisPointerModel, single, axisType, point) {
- var self = this;
- var axisPointerType = axisPointerModel.get('type');
- var moveAnimation = axisPointerType !== 'cross';
- var rect = single.getRect();
- var otherExtent = [rect.y, rect.y + rect.height];
-
- moveSingleLine(axisType, point, otherExtent);
-
- /**
- * @inner
- */
- function moveSingleLine(axisType, point, otherExtent) {
- var axis = single.getAxis();
- var orient = axis.orient;
-
- var targetShape = orient === 'horizontal'
- ? makeLineShape(point[0], otherExtent[0], point[0], otherExtent[1])
- : makeLineShape(otherExtent[0], point[1], otherExtent[1], point[1]);
-
- var pointerEl = self._getPointerElement(
- single, axisPointerModel, axisType, targetShape
- );
- moveAnimation
- ? graphic.updateProps(pointerEl, {
- shape: targetShape
- }, axisPointerModel)
- : pointerEl.attr({
- shape: targetShape
- });
- }
-
- },
-
- /**
- * Show tooltip on axis of polar coordinate
- * @param {module:echarts/model/Model} axisPointerModel
- * @param {Array.<module:echarts/coord/polar/Polar>} polar
- * @param {string} axisType
- * @param {Array.<number>} point
- */
- _showPolarPointer: function (axisPointerModel, polar, axisType, point) {
- var self = this;
-
- var axisPointerType = axisPointerModel.get('type');
-
- var angleAxis = polar.getAngleAxis();
- var radiusAxis = polar.getRadiusAxis();
-
- var moveAnimation = axisPointerType !== 'cross';
-
- if (axisPointerType === 'cross') {
- movePolarLine('angle', point, radiusAxis.getExtent());
- movePolarLine('radius', point, angleAxis.getExtent());
-
- this._updateCrossText(polar, point, axisPointerModel);
- }
- else {
- var otherAxis = polar.getAxis(axisType === 'radius' ? 'angle' : 'radius');
- var otherExtent = otherAxis.getExtent();
-
- (axisPointerType === 'line' ? movePolarLine : movePolarShadow)(
- axisType, point, otherExtent
- );
- }
- /**
- * @inner
- */
- function movePolarLine(axisType, point, otherExtent) {
- var mouseCoord = polar.pointToCoord(point);
-
- var targetShape;
-
- if (axisType === 'angle') {
- var p1 = polar.coordToPoint([otherExtent[0], mouseCoord[1]]);
- var p2 = polar.coordToPoint([otherExtent[1], mouseCoord[1]]);
- targetShape = makeLineShape(p1[0], p1[1], p2[0], p2[1]);
- }
- else {
- targetShape = {
- cx: polar.cx,
- cy: polar.cy,
- r: mouseCoord[0]
- };
- }
-
- var pointerEl = self._getPointerElement(
- polar, axisPointerModel, axisType, targetShape
- );
-
- moveAnimation
- ? graphic.updateProps(pointerEl, {
- shape: targetShape
- }, axisPointerModel)
- : pointerEl.attr({
- shape: targetShape
- });
- }
-
- /**
- * @inner
- */
- function movePolarShadow(axisType, point, otherExtent) {
- var axis = polar.getAxis(axisType);
- var bandWidth = axis.getBandWidth();
-
- var mouseCoord = polar.pointToCoord(point);
-
- var targetShape;
-
- var radian = Math.PI / 180;
-
- if (axisType === 'angle') {
- targetShape = makeSectorShape(
- polar.cx, polar.cy,
- otherExtent[0], otherExtent[1],
- // In ECharts y is negative if angle is positive
- (-mouseCoord[1] - bandWidth / 2) * radian,
- (-mouseCoord[1] + bandWidth / 2) * radian
- );
- }
- else {
- targetShape = makeSectorShape(
- polar.cx, polar.cy,
- mouseCoord[0] - bandWidth / 2,
- mouseCoord[0] + bandWidth / 2,
- 0, Math.PI * 2
- );
- }
-
- var pointerEl = self._getPointerElement(
- polar, axisPointerModel, axisType, targetShape
- );
- moveAnimation
- ? graphic.updateProps(pointerEl, {
- shape: targetShape
- }, axisPointerModel)
- : pointerEl.attr({
- shape: targetShape
- });
- }
- },
-
- _updateCrossText: function (coordSys, point, axisPointerModel) {
- var crossStyleModel = axisPointerModel.getModel('crossStyle');
- var textStyleModel = crossStyleModel.getModel('textStyle');
-
- var tooltipModel = this._tooltipModel;
-
- var text = this._crossText;
- if (!text) {
- text = this._crossText = new graphic.Text({
- style: {
- textAlign: 'left',
- textVerticalAlign: 'bottom'
- }
- });
- this.group.add(text);
- }
-
- var value = coordSys.pointToData(point);
-
- var dims = coordSys.dimensions;
- value = zrUtil.map(value, function (val, idx) {
- var axis = coordSys.getAxis(dims[idx]);
- if (axis.type === 'category' || axis.type === 'time') {
- val = axis.scale.getLabel(val);
- }
- else {
- val = formatUtil.addCommas(
- val.toFixed(axis.getPixelPrecision())
- );
- }
- return val;
- });
-
- text.setStyle({
- fill: textStyleModel.getTextColor() || crossStyleModel.get('color'),
- textFont: textStyleModel.getFont(),
- text: value.join(', '),
- x: point[0] + 5,
- y: point[1] - 5
- });
- text.z = tooltipModel.get('z');
- text.zlevel = tooltipModel.get('zlevel');
- },
-
- _getPointerElement: function (coordSys, pointerModel, axisType, initShape) {
- var tooltipModel = this._tooltipModel;
- var z = tooltipModel.get('z');
- var zlevel = tooltipModel.get('zlevel');
- var axisPointers = this._axisPointers;
- var coordSysName = coordSys.name;
- axisPointers[coordSysName] = axisPointers[coordSysName] || {};
- if (axisPointers[coordSysName][axisType]) {
- return axisPointers[coordSysName][axisType];
- }
-
- // Create if not exists
- var pointerType = pointerModel.get('type');
- var styleModel = pointerModel.getModel(pointerType + 'Style');
- var isShadow = pointerType === 'shadow';
- var style = styleModel[isShadow ? 'getAreaStyle' : 'getLineStyle']();
-
- var elementType = coordSys.type === 'polar'
- ? (isShadow ? 'Sector' : (axisType === 'radius' ? 'Circle' : 'Line'))
- : (isShadow ? 'Rect' : 'Line');
-
- isShadow ? (style.stroke = null) : (style.fill = null);
-
- var el = axisPointers[coordSysName][axisType] = new graphic[elementType]({
- style: style,
- z: z,
- zlevel: zlevel,
- silent: true,
- shape: initShape
- });
-
- this.group.add(el);
- return el;
- },
-
- /**
- * Dispatch actions and show tooltip on series
- * @param {Array.<module:echarts/model/Series>} seriesList
- * @param {Array.<number>} point
- * @param {Array.<number>} value
- * @param {boolean} contentNotChange
- * @param {Object} e
- */
- _dispatchAndShowSeriesTooltipContent: function (
- coordSys, seriesList, point, value, contentNotChange
- ) {
-
- var rootTooltipModel = this._tooltipModel;
- var tooltipContent = this._tooltipContent;
-
- var baseAxis = coordSys.getBaseAxis();
-
- var payloadBatch = zrUtil.map(seriesList, function (series) {
- return {
- seriesIndex: series.seriesIndex,
- dataIndex: series.getAxisTooltipDataIndex
- ? series.getAxisTooltipDataIndex(series.coordDimToDataDim(baseAxis.dim), value, baseAxis)
- : series.getData().indexOfNearest(
- series.coordDimToDataDim(baseAxis.dim)[0],
- value[baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1]
- )
- };
- });
-
- var lastHover = this._lastHover;
- var api = this._api;
- // Dispatch downplay action
- if (lastHover.payloadBatch && !contentNotChange) {
- api.dispatchAction({
- type: 'downplay',
- batch: lastHover.payloadBatch
- });
- }
- // Dispatch highlight action
- if (!contentNotChange) {
- api.dispatchAction({
- type: 'highlight',
- batch: payloadBatch
- });
- lastHover.payloadBatch = payloadBatch;
- }
- // Dispatch showTip action
- api.dispatchAction({
- type: 'showTip',
- dataIndex: payloadBatch[0].dataIndex,
- seriesIndex: payloadBatch[0].seriesIndex,
- from: this.uid
- });
-
- if (baseAxis && rootTooltipModel.get('showContent')) {
-
- var formatter = rootTooltipModel.get('formatter');
- var positionExpr = rootTooltipModel.get('position');
- var html;
-
- var paramsList = zrUtil.map(seriesList, function (series, index) {
- return series.getDataParams(payloadBatch[index].dataIndex);
- });
- // If only one series
- // FIXME
- // if (paramsList.length === 1) {
- // paramsList = paramsList[0];
- // }
-
- tooltipContent.show(rootTooltipModel);
-
- // Update html content
- var firstDataIndex = payloadBatch[0].dataIndex;
- if (!contentNotChange) {
- // Reset ticket
- this._ticket = '';
- if (!formatter) {
- // Default tooltip content
- // FIXME
- // (1) shold be the first data which has name?
- // (2) themeRiver, firstDataIndex is array, and first line is unnecessary.
- var firstLine = seriesList[0].getData().getName(firstDataIndex);
- html = (firstLine ? firstLine + '<br />' : '')
- + zrUtil.map(seriesList, function (series, index) {
- return series.formatTooltip(payloadBatch[index].dataIndex, true);
- }).join('<br />');
- }
- else {
- if (typeof formatter === 'string') {
- html = formatUtil.formatTpl(formatter, paramsList);
- }
- else if (typeof formatter === 'function') {
- var self = this;
- var ticket = 'axis_' + coordSys.name + '_' + firstDataIndex;
- var callback = function (cbTicket, html) {
- if (cbTicket === self._ticket) {
- tooltipContent.setContent(html);
-
- updatePosition(
- positionExpr, point[0], point[1],
- tooltipContent, paramsList, null, api
- );
- }
- };
- self._ticket = ticket;
- html = formatter(paramsList, ticket, callback);
- }
- }
-
- tooltipContent.setContent(html);
- }
-
- updatePosition(
- positionExpr, point[0], point[1],
- tooltipContent, paramsList, null, api
- );
- }
- },
-
- /**
- * Show tooltip on item
- * @param {module:echarts/model/Series} seriesModel
- * @param {number} dataIndex
- * @param {Object} e
- */
- _showItemTooltipContent: function (seriesModel, dataIndex, e) {
- // FIXME Graph data
- var api = this._api;
- var data = seriesModel.getData();
- var itemModel = data.getItemModel(dataIndex);
-
- var rootTooltipModel = this._tooltipModel;
-
- var tooltipContent = this._tooltipContent;
-
- var tooltipModel = itemModel.getModel('tooltip');
-
- // If series model
- if (tooltipModel.parentModel) {
- tooltipModel.parentModel.parentModel = rootTooltipModel;
- }
- else {
- tooltipModel.parentModel = this._tooltipModel;
- }
-
- if (tooltipModel.get('showContent')) {
- var formatter = tooltipModel.get('formatter');
- var positionExpr = tooltipModel.get('position');
- var params = seriesModel.getDataParams(dataIndex);
- var html;
- if (!formatter) {
- html = seriesModel.formatTooltip(dataIndex);
- }
- else {
- if (typeof formatter === 'string') {
- html = formatUtil.formatTpl(formatter, params);
- }
- else if (typeof formatter === 'function') {
- var self = this;
- var ticket = 'item_' + seriesModel.name + '_' + dataIndex;
- var callback = function (cbTicket, html) {
- if (cbTicket === self._ticket) {
- tooltipContent.setContent(html);
-
- updatePosition(
- positionExpr, e.offsetX, e.offsetY,
- tooltipContent, params, e.target, api
- );
- }
- };
- self._ticket = ticket;
- html = formatter(params, ticket, callback);
- }
- }
-
- tooltipContent.show(tooltipModel);
- tooltipContent.setContent(html);
-
- updatePosition(
- positionExpr, e.offsetX, e.offsetY,
- tooltipContent, params, e.target, api
- );
- }
- },
-
- /**
- * Show axis pointer
- * @param {string} [coordSysName]
- */
- _showAxisPointer: function (coordSysName) {
- if (coordSysName) {
- var axisPointers = this._axisPointers[coordSysName];
- axisPointers && zrUtil.each(axisPointers, function (el) {
- el.show();
- });
- }
- else {
- this.group.eachChild(function (child) {
- child.show();
- });
- this.group.show();
- }
- },
-
- _resetLastHover: function () {
- var lastHover = this._lastHover;
- if (lastHover.payloadBatch) {
- this._api.dispatchAction({
- type: 'downplay',
- batch: lastHover.payloadBatch
- });
- }
- // Reset lastHover
- this._lastHover = {};
- },
- /**
- * Hide axis pointer
- * @param {string} [coordSysName]
- */
- _hideAxisPointer: function (coordSysName) {
- if (coordSysName) {
- var axisPointers = this._axisPointers[coordSysName];
- axisPointers && zrUtil.each(axisPointers, function (el) {
- el.hide();
- });
- }
- else {
- this.group.hide();
- }
- },
-
- _hide: function () {
- this._hideAxisPointer();
- this._resetLastHover();
- if (!this._alwaysShowContent) {
- this._tooltipContent.hideLater(this._tooltipModel.get('hideDelay'));
- }
-
- this._api.dispatchAction({
- type: 'hideTip',
- from: this.uid
- });
- },
-
- dispose: function (ecModel, api) {
- if (env.node) {
- return;
- }
- var zr = api.getZr();
- this._tooltipContent.hide();
-
- zr.off('click', this._tryShow);
- zr.off('mousemove', this._tryShow);
- zr.off('mouseout', this._hide);
-
- api.off('showTip', this._manuallyShowTip);
- api.off('hideTip', this._manuallyHideTip);
- }
- });
-
-
-/***/ },
-/* 271 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @module echarts/component/tooltip/TooltipContent
- */
-
-
- var zrUtil = __webpack_require__(3);
- var zrColor = __webpack_require__(38);
- var eventUtil = __webpack_require__(80);
- var formatUtil = __webpack_require__(6);
- var each = zrUtil.each;
- var toCamelCase = formatUtil.toCamelCase;
-
- var vendors = ['', '-webkit-', '-moz-', '-o-'];
-
- var gCssText = 'position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;';
-
- /**
- * @param {number} duration
- * @return {string}
- * @inner
- */
- function assembleTransition(duration) {
- var transitionCurve = 'cubic-bezier(0.23, 1, 0.32, 1)';
- var transitionText = 'left ' + duration + 's ' + transitionCurve + ','
- + 'top ' + duration + 's ' + transitionCurve;
- return zrUtil.map(vendors, function (vendorPrefix) {
- return vendorPrefix + 'transition:' + transitionText;
- }).join(';');
- }
-
- /**
- * @param {Object} textStyle
- * @return {string}
- * @inner
- */
- function assembleFont(textStyleModel) {
- var cssText = [];
-
- var fontSize = textStyleModel.get('fontSize');
- var color = textStyleModel.getTextColor();
-
- color && cssText.push('color:' + color);
-
- cssText.push('font:' + textStyleModel.getFont());
-
- fontSize &&
- cssText.push('line-height:' + Math.round(fontSize * 3 / 2) + 'px');
-
- each(['decoration', 'align'], function (name) {
- var val = textStyleModel.get(name);
- val && cssText.push('text-' + name + ':' + val);
- });
-
- return cssText.join(';');
- }
-
- /**
- * @param {Object} tooltipModel
- * @return {string}
- * @inner
- */
- function assembleCssText(tooltipModel) {
-
- tooltipModel = tooltipModel;
-
- var cssText = [];
-
- var transitionDuration = tooltipModel.get('transitionDuration');
- var backgroundColor = tooltipModel.get('backgroundColor');
- var textStyleModel = tooltipModel.getModel('textStyle');
- var padding = tooltipModel.get('padding');
-
- // Animation transition
- transitionDuration &&
- cssText.push(assembleTransition(transitionDuration));
-
- if (backgroundColor) {
- // for ie
- cssText.push(
- 'background-Color:' + zrColor.toHex(backgroundColor)
- );
- cssText.push('filter:alpha(opacity=70)');
- cssText.push('background-Color:' + backgroundColor);
- }
-
- // Border style
- each(['width', 'color', 'radius'], function (name) {
- var borderName = 'border-' + name;
- var camelCase = toCamelCase(borderName);
- var val = tooltipModel.get(camelCase);
- val != null &&
- cssText.push(borderName + ':' + val + (name === 'color' ? '' : 'px'));
- });
-
- // Text style
- cssText.push(assembleFont(textStyleModel));
-
- // Padding
- if (padding != null) {
- cssText.push('padding:' + formatUtil.normalizeCssArray(padding).join('px ') + 'px');
- }
-
- return cssText.join(';') + ';';
- }
-
- /**
- * @alias module:echarts/component/tooltip/TooltipContent
- * @constructor
- */
- function TooltipContent(container, api) {
- var el = document.createElement('div');
- var zr = api.getZr();
-
- this.el = el;
-
- this._x = api.getWidth() / 2;
- this._y = api.getHeight() / 2;
-
- container.appendChild(el);
-
- this._container = container;
-
- this._show = false;
-
- /**
- * @private
- */
- this._hideTimeout;
-
- var self = this;
- el.onmouseenter = function () {
- // clear the timeout in hideLater and keep showing tooltip
- if (self.enterable) {
- clearTimeout(self._hideTimeout);
- self._show = true;
- }
- self._inContent = true;
- };
- el.onmousemove = function (e) {
- if (!self.enterable) {
- // Try trigger zrender event to avoid mouse
- // in and out shape too frequently
- var handler = zr.handler;
- eventUtil.normalizeEvent(container, e);
- handler.dispatch('mousemove', e);
- }
- };
- el.onmouseleave = function () {
- if (self.enterable) {
- if (self._show) {
- self.hideLater(self._hideDelay);
- }
- }
- self._inContent = false;
- };
-
- compromiseMobile(el, container);
- }
-
- function compromiseMobile(tooltipContentEl, container) {
- // Prevent default behavior on mobile. For example,
- // defuault pinch gesture will cause browser zoom.
- // We do not preventing event on tooltip contnet el,
- // because user may need customization in tooltip el.
- eventUtil.addEventListener(container, 'touchstart', preventDefault);
- eventUtil.addEventListener(container, 'touchmove', preventDefault);
- eventUtil.addEventListener(container, 'touchend', preventDefault);
-
- function preventDefault(e) {
- if (contains(e.target)) {
- e.preventDefault();
- }
- }
-
- function contains(targetEl) {
- while (targetEl && targetEl !== container) {
- if (targetEl === tooltipContentEl) {
- return true;
- }
- targetEl = targetEl.parentNode;
- }
- }
- }
-
- TooltipContent.prototype = {
-
- constructor: TooltipContent,
-
- enterable: true,
-
- /**
- * Update when tooltip is rendered
- */
- update: function () {
- var container = this._container;
- var stl = container.currentStyle
- || document.defaultView.getComputedStyle(container);
- var domStyle = container.style;
- if (domStyle.position !== 'absolute' && stl.position !== 'absolute') {
- domStyle.position = 'relative';
- }
- // Hide the tooltip
- // PENDING
- // this.hide();
- },
-
- show: function (tooltipModel) {
- clearTimeout(this._hideTimeout);
-
- this.el.style.cssText = gCssText + assembleCssText(tooltipModel)
- // http://stackoverflow.com/questions/21125587/css3-transition-not-working-in-chrome-anymore
- + ';left:' + this._x + 'px;top:' + this._y + 'px;'
- + (tooltipModel.get('extraCssText') || '');
-
- this._show = true;
- },
-
- setContent: function (content) {
- var el = this.el;
- el.innerHTML = content;
- el.style.display = content ? 'block' : 'none';
- },
-
- moveTo: function (x, y) {
- var style = this.el.style;
- style.left = x + 'px';
- style.top = y + 'px';
-
- this._x = x;
- this._y = y;
- },
-
- hide: function () {
- this.el.style.display = 'none';
- this._show = false;
- },
-
- // showLater: function ()
-
- hideLater: function (time) {
- if (this._show && !(this._inContent && this.enterable)) {
- if (time) {
- this._hideDelay = time;
- // Set show false to avoid invoke hideLater mutiple times
- this._show = false;
- this._hideTimeout = setTimeout(zrUtil.bind(this.hide, this), time);
- }
- else {
- this.hide();
- }
- }
- },
-
- isShow: function () {
- return this._show;
- }
- };
-
- module.exports = TooltipContent;
-
-
-/***/ },
-/* 272 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- __webpack_require__(273);
- __webpack_require__(279);
- __webpack_require__(281);
-
- // Polar view
- __webpack_require__(1).extendComponentView({
- type: 'polar'
- });
-
-
-/***/ },
-/* 273 */
-/***/ function(module, exports, __webpack_require__) {
-
- // TODO Axis scale
-
-
- var Polar = __webpack_require__(274);
- var numberUtil = __webpack_require__(7);
-
- var axisHelper = __webpack_require__(108);
- var niceScaleExtent = axisHelper.niceScaleExtent;
-
- // 依赖 PolarModel 做预处理
- __webpack_require__(277);
-
- /**
- * Resize method bound to the polar
- * @param {module:echarts/coord/polar/PolarModel} polarModel
- * @param {module:echarts/ExtensionAPI} api
- */
- function resizePolar(polarModel, api) {
- var center = polarModel.get('center');
- var radius = polarModel.get('radius');
- var width = api.getWidth();
- var height = api.getHeight();
- var parsePercent = numberUtil.parsePercent;
-
- this.cx = parsePercent(center[0], width);
- this.cy = parsePercent(center[1], height);
-
- var radiusAxis = this.getRadiusAxis();
- var size = Math.min(width, height) / 2;
- // var idx = radiusAxis.inverse ? 1 : 0;
- radiusAxis.setExtent(0, parsePercent(radius, size));
- }
-
- /**
- * Update polar
- */
- function updatePolarScale(ecModel, api) {
- var polar = this;
- var angleAxis = polar.getAngleAxis();
- var radiusAxis = polar.getRadiusAxis();
- // Reset scale
- angleAxis.scale.setExtent(Infinity, -Infinity);
- radiusAxis.scale.setExtent(Infinity, -Infinity);
-
- ecModel.eachSeries(function (seriesModel) {
- if (seriesModel.coordinateSystem === polar) {
- var data = seriesModel.getData();
- radiusAxis.scale.unionExtent(
- data.getDataExtent('radius', radiusAxis.type !== 'category')
- );
- angleAxis.scale.unionExtent(
- data.getDataExtent('angle', angleAxis.type !== 'category')
- );
- }
- });
-
- niceScaleExtent(angleAxis, angleAxis.model);
- niceScaleExtent(radiusAxis, radiusAxis.model);
-
- // Fix extent of category angle axis
- if (angleAxis.type === 'category' && !angleAxis.onBand) {
- var extent = angleAxis.getExtent();
- var diff = 360 / angleAxis.scale.count();
- angleAxis.inverse ? (extent[1] += diff) : (extent[1] -= diff);
- angleAxis.setExtent(extent[0], extent[1]);
- }
- }
-
- /**
- * Set common axis properties
- * @param {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis}
- * @param {module:echarts/coord/polar/AxisModel}
- * @inner
- */
- function setAxis(axis, axisModel) {
- axis.type = axisModel.get('type');
- axis.scale = axisHelper.createScaleByModel(axisModel);
- axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category';
-
- // FIXME Radius axis not support inverse axis
- if (axisModel.mainType === 'angleAxis') {
- var startAngle = axisModel.get('startAngle');
- axis.inverse = axisModel.get('inverse') ^ axisModel.get('clockwise');
- axis.setExtent(startAngle, startAngle + (axis.inverse ? -360 : 360));
- }
-
- // Inject axis instance
- axisModel.axis = axis;
- axis.model = axisModel;
- }
-
-
- var polarCreator = {
-
- dimensions: Polar.prototype.dimensions,
-
- create: function (ecModel, api) {
- var polarList = [];
- ecModel.eachComponent('polar', function (polarModel, idx) {
- var polar = new Polar(idx);
- // Inject resize and update method
- polar.resize = resizePolar;
- polar.update = updatePolarScale;
-
- var radiusAxis = polar.getRadiusAxis();
- var angleAxis = polar.getAngleAxis();
-
- var radiusAxisModel = polarModel.findAxisModel('radiusAxis');
- var angleAxisModel = polarModel.findAxisModel('angleAxis');
-
- setAxis(radiusAxis, radiusAxisModel);
- setAxis(angleAxis, angleAxisModel);
-
- polar.resize(polarModel, api);
- polarList.push(polar);
-
- polarModel.coordinateSystem = polar;
- });
- // Inject coordinateSystem to series
- ecModel.eachSeries(function (seriesModel) {
- if (seriesModel.get('coordinateSystem') === 'polar') {
- seriesModel.coordinateSystem = polarList[seriesModel.get('polarIndex')];
- }
- });
-
- return polarList;
- }
- };
-
- __webpack_require__(25).register('polar', polarCreator);
-
-
-/***/ },
-/* 274 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
- /**
- * @module echarts/coord/polar/Polar
- */
-
-
- var RadiusAxis = __webpack_require__(275);
- var AngleAxis = __webpack_require__(276);
-
- /**
- * @alias {module:echarts/coord/polar/Polar}
- * @constructor
- * @param {string} name
- */
- var Polar = function (name) {
-
- /**
- * @type {string}
- */
- this.name = name || '';
-
- /**
- * x of polar center
- * @type {number}
- */
- this.cx = 0;
-
- /**
- * y of polar center
- * @type {number}
- */
- this.cy = 0;
-
- /**
- * @type {module:echarts/coord/polar/RadiusAxis}
- * @private
- */
- this._radiusAxis = new RadiusAxis();
-
- /**
- * @type {module:echarts/coord/polar/AngleAxis}
- * @private
- */
- this._angleAxis = new AngleAxis();
- };
-
- Polar.prototype = {
-
- constructor: Polar,
-
- type: 'polar',
-
- /**
- * @param {Array.<string>}
- * @readOnly
- */
- dimensions: ['radius', 'angle'],
-
- /**
- * If contain coord
- * @param {Array.<number>} point
- * @return {boolean}
- */
- containPoint: function (point) {
- var coord = this.pointToCoord(point);
- return this._radiusAxis.contain(coord[0])
- && this._angleAxis.contain(coord[1]);
- },
-
- /**
- * If contain data
- * @param {Array.<number>} data
- * @return {boolean}
- */
- containData: function (data) {
- return this._radiusAxis.containData(data[0])
- && this._angleAxis.containData(data[1]);
- },
-
- /**
- * @param {string} axisType
- * @return {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis}
- */
- getAxis: function (axisType) {
- return this['_' + axisType + 'Axis'];
- },
-
- /**
- * Get axes by type of scale
- * @param {string} scaleType
- * @return {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis}
- */
- getAxesByScale: function (scaleType) {
- var axes = [];
- var angleAxis = this._angleAxis;
- var radiusAxis = this._radiusAxis;
- angleAxis.scale.type === scaleType && axes.push(angleAxis);
- radiusAxis.scale.type === scaleType && axes.push(radiusAxis);
-
- return axes;
- },
-
- /**
- * @return {module:echarts/coord/polar/AngleAxis}
- */
- getAngleAxis: function () {
- return this._angleAxis;
- },
-
- /**
- * @return {module:echarts/coord/polar/RadiusAxis}
- */
- getRadiusAxis: function () {
- return this._radiusAxis;
- },
-
- /**
- * @param {module:echarts/coord/polar/Axis}
- * @return {module:echarts/coord/polar/Axis}
- */
- getOtherAxis: function (axis) {
- var angleAxis = this._angleAxis;
- return axis === angleAxis ? this._radiusAxis : angleAxis;
- },
-
- /**
- * Base axis will be used on stacking.
- *
- * @return {module:echarts/coord/polar/Axis}
- */
- getBaseAxis: function () {
- return this.getAxesByScale('ordinal')[0]
- || this.getAxesByScale('time')[0]
- || this.getAngleAxis();
- },
-
- /**
- * Convert series data to a list of (x, y) points
- * @param {module:echarts/data/List} data
- * @return {Array}
- * Return list of coordinates. For example:
- * `[[10, 10], [20, 20], [30, 30]]`
- */
- dataToPoints: function (data) {
- return data.mapArray(this.dimensions, function (radius, angle) {
- return this.dataToPoint([radius, angle]);
- }, this);
- },
-
- /**
- * Convert a single data item to (x, y) point.
- * Parameter data is an array which the first element is radius and the second is angle
- * @param {Array.<number>} data
- * @param {boolean} [clamp=false]
- * @return {Array.<number>}
- */
- dataToPoint: function (data, clamp) {
- return this.coordToPoint([
- this._radiusAxis.dataToRadius(data[0], clamp),
- this._angleAxis.dataToAngle(data[1], clamp)
- ]);
- },
-
- /**
- * Convert a (x, y) point to data
- * @param {Array.<number>} point
- * @param {boolean} [clamp=false]
- * @return {Array.<number>}
- */
- pointToData: function (point, clamp) {
- var coord = this.pointToCoord(point);
- return [
- this._radiusAxis.radiusToData(coord[0], clamp),
- this._angleAxis.angleToData(coord[1], clamp)
- ];
- },
-
- /**
- * Convert a (x, y) point to (radius, angle) coord
- * @param {Array.<number>} point
- * @return {Array.<number>}
- */
- pointToCoord: function (point) {
- var dx = point[0] - this.cx;
- var dy = point[1] - this.cy;
- var angleAxis = this.getAngleAxis();
- var extent = angleAxis.getExtent();
- var minAngle = Math.min(extent[0], extent[1]);
- var maxAngle = Math.max(extent[0], extent[1]);
- // Fix fixed extent in polarCreator
- // FIXME
- angleAxis.inverse
- ? (minAngle = maxAngle - 360)
- : (maxAngle = minAngle + 360);
-
- var radius = Math.sqrt(dx * dx + dy * dy);
- dx /= radius;
- dy /= radius;
-
- var radian = Math.atan2(-dy, dx) / Math.PI * 180;
-
- // move to angleExtent
- var dir = radian < minAngle ? 1 : -1;
- while (radian < minAngle || radian > maxAngle) {
- radian += dir * 360;
- }
-
- return [radius, radian];
- },
-
- /**
- * Convert a (radius, angle) coord to (x, y) point
- * @param {Array.<number>} coord
- * @return {Array.<number>}
- */
- coordToPoint: function (coord) {
- var radius = coord[0];
- var radian = coord[1] / 180 * Math.PI;
- var x = Math.cos(radian) * radius + this.cx;
- // Inverse the y
- var y = -Math.sin(radian) * radius + this.cy;
-
- return [x, y];
- }
- };
-
- module.exports = Polar;
-
-
-/***/ },
-/* 275 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
- var Axis = __webpack_require__(117);
-
- function RadiusAxis(scale, radiusExtent) {
-
- Axis.call(this, 'radius', scale, radiusExtent);
-
- /**
- * Axis type
- * - 'category'
- * - 'value'
- * - 'time'
- * - 'log'
- * @type {string}
- */
- this.type = 'category';
- }
-
- RadiusAxis.prototype = {
-
- constructor: RadiusAxis,
-
- dataToRadius: Axis.prototype.dataToCoord,
-
- radiusToData: Axis.prototype.coordToData
- };
-
- zrUtil.inherits(RadiusAxis, Axis);
-
- module.exports = RadiusAxis;
-
-
-/***/ },
-/* 276 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
- var Axis = __webpack_require__(117);
-
- function AngleAxis(scale, angleExtent) {
-
- angleExtent = angleExtent || [0, 360];
-
- Axis.call(this, 'angle', scale, angleExtent);
-
- /**
- * Axis type
- * - 'category'
- * - 'value'
- * - 'time'
- * - 'log'
- * @type {string}
- */
- this.type = 'category';
- }
-
- AngleAxis.prototype = {
-
- constructor: AngleAxis,
-
- dataToAngle: Axis.prototype.dataToCoord,
-
- angleToData: Axis.prototype.coordToData
- };
-
- zrUtil.inherits(AngleAxis, Axis);
-
- module.exports = AngleAxis;
-
-
-/***/ },
-/* 277 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- __webpack_require__(278);
-
- __webpack_require__(1).extendComponentModel({
-
- type: 'polar',
-
- dependencies: ['polarAxis', 'angleAxis'],
-
- /**
- * @type {module:echarts/coord/polar/Polar}
- */
- coordinateSystem: null,
-
- /**
- * @param {string} axisType
- * @return {module:echarts/coord/polar/AxisModel}
- */
- findAxisModel: function (axisType) {
- var angleAxisModel;
- var ecModel = this.ecModel;
- ecModel.eachComponent(axisType, function (axisModel) {
- if (ecModel.getComponent(
- 'polar', axisModel.getShallow('polarIndex')
- ) === this) {
- angleAxisModel = axisModel;
- }
- }, this);
- return angleAxisModel;
- },
-
- defaultOption: {
-
- zlevel: 0,
-
- z: 0,
-
- center: ['50%', '50%'],
-
- radius: '80%'
- }
- });
-
-
-/***/ },
-/* 278 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
- var ComponentModel = __webpack_require__(19);
- var axisModelCreator = __webpack_require__(121);
-
- var PolarAxisModel = ComponentModel.extend({
- type: 'polarAxis',
- /**
- * @type {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis}
- */
- axis: null
- });
-
- zrUtil.merge(PolarAxisModel.prototype, __webpack_require__(123));
-
- var polarAxisDefaultExtendedOption = {
- angle: {
- polarIndex: 0,
-
- startAngle: 90,
-
- clockwise: true,
-
- splitNumber: 12,
-
- axisLabel: {
- rotate: false
- }
- },
- radius: {
- polarIndex: 0,
-
- splitNumber: 5
- }
- };
-
- function getAxisType(axisDim, option) {
- // Default axis with data is category axis
- return option.type || (option.data ? 'category' : 'value');
- }
-
- axisModelCreator('angle', PolarAxisModel, getAxisType, polarAxisDefaultExtendedOption.angle);
- axisModelCreator('radius', PolarAxisModel, getAxisType, polarAxisDefaultExtendedOption.radius);
-
-
-
-/***/ },
-/* 279 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- __webpack_require__(273);
-
- __webpack_require__(280);
-
-
-/***/ },
-/* 280 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
- var graphic = __webpack_require__(42);
- var Model = __webpack_require__(8);
-
- var elementList = ['axisLine', 'axisLabel', 'axisTick', 'splitLine', 'splitArea'];
-
- function getAxisLineShape(polar, r0, r, angle) {
- var start = polar.coordToPoint([r0, angle]);
- var end = polar.coordToPoint([r, angle]);
-
- return {
- x1: start[0],
- y1: start[1],
- x2: end[0],
- y2: end[1]
- };
- }
- __webpack_require__(1).extendComponentView({
-
- type: 'angleAxis',
-
- render: function (angleAxisModel, ecModel) {
- this.group.removeAll();
- if (!angleAxisModel.get('show')) {
- return;
- }
-
- var polarModel = ecModel.getComponent('polar', angleAxisModel.get('polarIndex'));
- var angleAxis = angleAxisModel.axis;
- var polar = polarModel.coordinateSystem;
- var radiusExtent = polar.getRadiusAxis().getExtent();
- var ticksAngles = angleAxis.getTicksCoords();
-
- if (angleAxis.type !== 'category') {
- // Remove the last tick which will overlap the first tick
- ticksAngles.pop();
- }
-
- zrUtil.each(elementList, function (name) {
- if (angleAxisModel.get(name +'.show')) {
- this['_' + name](angleAxisModel, polar, ticksAngles, radiusExtent);
- }
- }, this);
- },
-
- /**
- * @private
- */
- _axisLine: function (angleAxisModel, polar, ticksAngles, radiusExtent) {
- var lineStyleModel = angleAxisModel.getModel('axisLine.lineStyle');
-
- var circle = new graphic.Circle({
- shape: {
- cx: polar.cx,
- cy: polar.cy,
- r: radiusExtent[1]
- },
- style: lineStyleModel.getLineStyle(),
- z2: 1,
- silent: true
- });
- circle.style.fill = null;
-
- this.group.add(circle);
- },
-
- /**
- * @private
- */
- _axisTick: function (angleAxisModel, polar, ticksAngles, radiusExtent) {
- var tickModel = angleAxisModel.getModel('axisTick');
-
- var tickLen = (tickModel.get('inside') ? -1 : 1) * tickModel.get('length');
-
- var lines = zrUtil.map(ticksAngles, function (tickAngle) {
- return new graphic.Line({
- shape: getAxisLineShape(polar, radiusExtent[1], radiusExtent[1] + tickLen, tickAngle)
- });
- });
- this.group.add(graphic.mergePath(
- lines, {
- style: tickModel.getModel('lineStyle').getLineStyle()
- }
- ));
- },
-
- /**
- * @private
- */
- _axisLabel: function (angleAxisModel, polar, ticksAngles, radiusExtent) {
- var axis = angleAxisModel.axis;
-
- var categoryData = angleAxisModel.get('data');
-
- var labelModel = angleAxisModel.getModel('axisLabel');
- var axisTextStyleModel = labelModel.getModel('textStyle');
-
- var labels = angleAxisModel.getFormattedLabels();
-
- var labelMargin = labelModel.get('margin');
- var labelsAngles = axis.getLabelsCoords();
-
- // Use length of ticksAngles because it may remove the last tick to avoid overlapping
- for (var i = 0; i < ticksAngles.length; i++) {
- var r = radiusExtent[1];
- var p = polar.coordToPoint([r + labelMargin, labelsAngles[i]]);
- var cx = polar.cx;
- var cy = polar.cy;
-
- var labelTextAlign = Math.abs(p[0] - cx) / r < 0.3
- ? 'center' : (p[0] > cx ? 'left' : 'right');
- var labelTextBaseline = Math.abs(p[1] - cy) / r < 0.3
- ? 'middle' : (p[1] > cy ? 'top' : 'bottom');
-
- var textStyleModel = axisTextStyleModel;
- if (categoryData && categoryData[i] && categoryData[i].textStyle) {
- textStyleModel = new Model(
- categoryData[i].textStyle, axisTextStyleModel
- );
- }
- this.group.add(new graphic.Text({
- style: {
- x: p[0],
- y: p[1],
- fill: textStyleModel.getTextColor(),
- text: labels[i],
- textAlign: labelTextAlign,
- textVerticalAlign: labelTextBaseline,
- textFont: textStyleModel.getFont()
- },
- silent: true
- }));
- }
- },
-
- /**
- * @private
- */
- _splitLine: function (angleAxisModel, polar, ticksAngles, radiusExtent) {
- var splitLineModel = angleAxisModel.getModel('splitLine');
- var lineStyleModel = splitLineModel.getModel('lineStyle');
- var lineColors = lineStyleModel.get('color');
- var lineCount = 0;
-
- lineColors = lineColors instanceof Array ? lineColors : [lineColors];
-
- var splitLines = [];
-
- for (var i = 0; i < ticksAngles.length; i++) {
- var colorIndex = (lineCount++) % lineColors.length;
- splitLines[colorIndex] = splitLines[colorIndex] || [];
- splitLines[colorIndex].push(new graphic.Line({
- shape: getAxisLineShape(polar, radiusExtent[0], radiusExtent[1], ticksAngles[i])
- }));
- }
-
- // Simple optimization
- // Batching the lines if color are the same
- for (var i = 0; i < splitLines.length; i++) {
- this.group.add(graphic.mergePath(splitLines[i], {
- style: zrUtil.defaults({
- stroke: lineColors[i % lineColors.length]
- }, lineStyleModel.getLineStyle()),
- silent: true,
- z: angleAxisModel.get('z')
- }));
- }
- },
-
- /**
- * @private
- */
- _splitArea: function (angleAxisModel, polar, ticksAngles, radiusExtent) {
-
- var splitAreaModel = angleAxisModel.getModel('splitArea');
- var areaStyleModel = splitAreaModel.getModel('areaStyle');
- var areaColors = areaStyleModel.get('color');
- var lineCount = 0;
-
- areaColors = areaColors instanceof Array ? areaColors : [areaColors];
-
- var splitAreas = [];
-
- var RADIAN = Math.PI / 180;
- var prevAngle = -ticksAngles[0] * RADIAN;
- var r0 = Math.min(radiusExtent[0], radiusExtent[1]);
- var r1 = Math.max(radiusExtent[0], radiusExtent[1]);
-
- var clockwise = angleAxisModel.get('clockwise');
-
- for (var i = 1; i < ticksAngles.length; i++) {
- var colorIndex = (lineCount++) % areaColors.length;
- splitAreas[colorIndex] = splitAreas[colorIndex] || [];
- splitAreas[colorIndex].push(new graphic.Sector({
- shape: {
- cx: polar.cx,
- cy: polar.cy,
- r0: r0,
- r: r1,
- startAngle: prevAngle,
- endAngle: -ticksAngles[i] * RADIAN,
- clockwise: clockwise
- },
- silent: true
- }));
- prevAngle = -ticksAngles[i] * RADIAN;
- }
-
- // Simple optimization
- // Batching the lines if color are the same
- for (var i = 0; i < splitAreas.length; i++) {
- this.group.add(graphic.mergePath(splitAreas[i], {
- style: zrUtil.defaults({
- fill: areaColors[i % areaColors.length]
- }, areaStyleModel.getAreaStyle()),
- silent: true
- }));
- }
- }
- });
-
-
-/***/ },
-/* 281 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- __webpack_require__(273);
-
- __webpack_require__(282);
-
-
-/***/ },
-/* 282 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
- var graphic = __webpack_require__(42);
- var AxisBuilder = __webpack_require__(126);
-
- var axisBuilderAttrs = [
- 'axisLine', 'axisLabel', 'axisTick', 'axisName'
- ];
- var selfBuilderAttrs = [
- 'splitLine', 'splitArea'
- ];
-
- __webpack_require__(1).extendComponentView({
-
- type: 'radiusAxis',
-
- render: function (radiusAxisModel, ecModel) {
- this.group.removeAll();
- if (!radiusAxisModel.get('show')) {
- return;
- }
- var polarModel = ecModel.getComponent('polar', radiusAxisModel.get('polarIndex'));
- var angleAxis = polarModel.coordinateSystem.getAngleAxis();
- var radiusAxis = radiusAxisModel.axis;
- var polar = polarModel.coordinateSystem;
- var ticksCoords = radiusAxis.getTicksCoords();
- var axisAngle = angleAxis.getExtent()[0];
- var radiusExtent = radiusAxis.getExtent();
-
- var layout = layoutAxis(polar, radiusAxisModel, axisAngle);
- var axisBuilder = new AxisBuilder(radiusAxisModel, layout);
- zrUtil.each(axisBuilderAttrs, axisBuilder.add, axisBuilder);
- this.group.add(axisBuilder.getGroup());
-
- zrUtil.each(selfBuilderAttrs, function (name) {
- if (radiusAxisModel.get(name +'.show')) {
- this['_' + name](radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords);
- }
- }, this);
- },
-
- /**
- * @private
- */
- _splitLine: function (radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {
- var splitLineModel = radiusAxisModel.getModel('splitLine');
- var lineStyleModel = splitLineModel.getModel('lineStyle');
- var lineColors = lineStyleModel.get('color');
- var lineCount = 0;
-
- lineColors = lineColors instanceof Array ? lineColors : [lineColors];
-
- var splitLines = [];
-
- for (var i = 0; i < ticksCoords.length; i++) {
- var colorIndex = (lineCount++) % lineColors.length;
- splitLines[colorIndex] = splitLines[colorIndex] || [];
- splitLines[colorIndex].push(new graphic.Circle({
- shape: {
- cx: polar.cx,
- cy: polar.cy,
- r: ticksCoords[i]
- },
- silent: true
- }));
- }
-
- // Simple optimization
- // Batching the lines if color are the same
- for (var i = 0; i < splitLines.length; i++) {
- this.group.add(graphic.mergePath(splitLines[i], {
- style: zrUtil.defaults({
- stroke: lineColors[i % lineColors.length],
- fill: null
- }, lineStyleModel.getLineStyle()),
- silent: true
- }));
- }
- },
-
- /**
- * @private
- */
- _splitArea: function (radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) {
-
- var splitAreaModel = radiusAxisModel.getModel('splitArea');
- var areaStyleModel = splitAreaModel.getModel('areaStyle');
- var areaColors = areaStyleModel.get('color');
- var lineCount = 0;
-
- areaColors = areaColors instanceof Array ? areaColors : [areaColors];
-
- var splitAreas = [];
-
- var prevRadius = ticksCoords[0];
- for (var i = 1; i < ticksCoords.length; i++) {
- var colorIndex = (lineCount++) % areaColors.length;
- splitAreas[colorIndex] = splitAreas[colorIndex] || [];
- splitAreas[colorIndex].push(new graphic.Sector({
- shape: {
- cx: polar.cx,
- cy: polar.cy,
- r0: prevRadius,
- r: ticksCoords[i],
- startAngle: 0,
- endAngle: Math.PI * 2
- },
- silent: true
- }));
- prevRadius = ticksCoords[i];
- }
-
- // Simple optimization
- // Batching the lines if color are the same
- for (var i = 0; i < splitAreas.length; i++) {
- this.group.add(graphic.mergePath(splitAreas[i], {
- style: zrUtil.defaults({
- fill: areaColors[i % areaColors.length]
- }, areaStyleModel.getAreaStyle()),
- silent: true
- }));
- }
- }
- });
-
- /**
- * @inner
- */
- function layoutAxis(polar, radiusAxisModel, axisAngle) {
- return {
- position: [polar.cx, polar.cy],
- rotation: axisAngle / 180 * Math.PI,
- labelDirection: -1,
- tickDirection: -1,
- nameDirection: 1,
- labelRotation: radiusAxisModel.getModel('axisLabel').get('rotate'),
- // Over splitLine and splitArea
- z2: 1
- };
- }
-
-
-/***/ },
-/* 283 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- __webpack_require__(163);
-
- __webpack_require__(284);
-
- __webpack_require__(161);
-
-
-/***/ },
-/* 284 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var MapDraw = __webpack_require__(158);
-
- module.exports = __webpack_require__(1).extendComponentView({
-
- type: 'geo',
-
- init: function (ecModel, api) {
- var mapDraw = new MapDraw(api, true);
- this._mapDraw = mapDraw;
-
- this.group.add(mapDraw.group);
- },
-
- render: function (geoModel, ecModel, api) {
- geoModel.get('show') &&
- this._mapDraw.draw(geoModel, ecModel, api);
- }
- });
-
-
-/***/ },
-/* 285 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var echarts = __webpack_require__(1);
- var graphic = __webpack_require__(42);
- var layout = __webpack_require__(21);
-
- // Model
- echarts.extendComponentModel({
-
- type: 'title',
-
- layoutMode: {type: 'box', ignoreSize: true},
-
- defaultOption: {
- // 一级层叠
- zlevel: 0,
- // 二级层叠
- z: 6,
- show: true,
-
- text: '',
- // 超链接跳转
- // link: null,
- // 仅支持self | blank
- target: 'blank',
- subtext: '',
-
- // 超链接跳转
- // sublink: null,
- // 仅支持self | blank
- subtarget: 'blank',
-
- // 'center' ¦ 'left' ¦ 'right'
- // ¦ {number}(x坐标,单位px)
- left: 0,
- // 'top' ¦ 'bottom' ¦ 'center'
- // ¦ {number}(y坐标,单位px)
- top: 0,
-
- // 水平对齐
- // 'auto' | 'left' | 'right'
- // 默认根据 x 的位置判断是左对齐还是右对齐
- //textAlign: null
-
- backgroundColor: 'rgba(0,0,0,0)',
-
- // 标题边框颜色
- borderColor: '#ccc',
-
- // 标题边框线宽,单位px,默认为0(无边框)
- borderWidth: 0,
-
- // 标题内边距,单位px,默认各方向内边距为5,
- // 接受数组分别设定上右下左边距,同css
- padding: 5,
-
- // 主副标题纵向间隔,单位px,默认为10,
- itemGap: 10,
- textStyle: {
- fontSize: 18,
- fontWeight: 'bolder',
- // 主标题文字颜色
- color: '#333'
- },
- subtextStyle: {
- // 副标题文字颜色
- color: '#aaa'
- }
- }
- });
-
- // View
- echarts.extendComponentView({
-
- type: 'title',
-
- render: function (titleModel, ecModel, api) {
- this.group.removeAll();
-
- if (!titleModel.get('show')) {
- return;
- }
-
- var group = this.group;
-
- var textStyleModel = titleModel.getModel('textStyle');
- var subtextStyleModel = titleModel.getModel('subtextStyle');
-
- var textAlign = titleModel.get('textAlign');
-
- var textEl = new graphic.Text({
- style: {
- text: titleModel.get('text'),
- textFont: textStyleModel.getFont(),
- fill: textStyleModel.getTextColor(),
- textBaseline: 'top'
- },
- z2: 10
- });
-
- var textRect = textEl.getBoundingRect();
-
- var subText = titleModel.get('subtext');
- var subTextEl = new graphic.Text({
- style: {
- text: subText,
- textFont: subtextStyleModel.getFont(),
- fill: subtextStyleModel.getTextColor(),
- y: textRect.height + titleModel.get('itemGap'),
- textBaseline: 'top'
- },
- z2: 10
- });
-
- var link = titleModel.get('link');
- var sublink = titleModel.get('sublink');
-
- textEl.silent = !link;
- subTextEl.silent = !sublink;
-
- if (link) {
- textEl.on('click', function () {
- window.open(link, titleModel.get('target'));
- });
- }
- if (sublink) {
- subTextEl.on('click', function () {
- window.open(sublink, titleModel.get('subtarget'));
- });
- }
-
- group.add(textEl);
- subText && group.add(subTextEl);
- // If no subText, but add subTextEl, there will be an empty line.
-
- var groupRect = group.getBoundingRect();
- var layoutOption = titleModel.getBoxLayoutParams();
- layoutOption.width = groupRect.width;
- layoutOption.height = groupRect.height;
- var layoutRect = layout.getLayoutRect(
- layoutOption, {
- width: api.getWidth(),
- height: api.getHeight()
- }, titleModel.get('padding')
- );
- // Adjust text align based on position
- if (!textAlign) {
- // Align left if title is on the left. center and right is same
- textAlign = titleModel.get('left') || titleModel.get('right');
- if (textAlign === 'middle') {
- textAlign = 'center';
- }
- // Adjust layout by text align
- if (textAlign === 'right') {
- layoutRect.x += layoutRect.width;
- }
- else if (textAlign === 'center') {
- layoutRect.x += layoutRect.width / 2;
- }
- }
- group.position = [layoutRect.x, layoutRect.y];
- textEl.setStyle('textAlign', textAlign);
- subTextEl.setStyle('textAlign', textAlign);
-
- // Render background
- // Get groupRect again because textAlign has been changed
- groupRect = group.getBoundingRect();
- var padding = layoutRect.margin;
- var style = titleModel.getItemStyle(['color', 'opacity']);
- style.fill = titleModel.get('backgroundColor');
- var rect = new graphic.Rect({
- shape: {
- x: groupRect.x - padding[3],
- y: groupRect.y - padding[0],
- width: groupRect.width + padding[1] + padding[3],
- height: groupRect.height + padding[0] + padding[2]
- },
- style: style,
- silent: true
- });
- graphic.subPixelOptimizeRect(rect);
-
- group.add(rect);
- }
- });
-
-
-/***/ },
-/* 286 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * DataZoom component entry
- */
-
-
- __webpack_require__(287);
-
- __webpack_require__(288);
- __webpack_require__(290);
-
- __webpack_require__(291);
- __webpack_require__(292);
-
- __webpack_require__(295);
- __webpack_require__(296);
-
- __webpack_require__(298);
- __webpack_require__(299);
-
-
-
-/***/ },
-/* 287 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- __webpack_require__(19).registerSubTypeDefaulter('dataZoom', function (option) {
- // Default 'slider' when no type specified.
- return 'slider';
- });
-
-
-
-/***/ },
-/* 288 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Data zoom model
- */
-
-
- var zrUtil = __webpack_require__(3);
- var env = __webpack_require__(78);
- var echarts = __webpack_require__(1);
- var modelUtil = __webpack_require__(5);
- var AxisProxy = __webpack_require__(289);
- var each = zrUtil.each;
- var eachAxisDim = modelUtil.eachAxisDim;
-
- var DataZoomModel = echarts.extendComponentModel({
-
- type: 'dataZoom',
-
- dependencies: [
- 'xAxis', 'yAxis', 'zAxis', 'radiusAxis', 'angleAxis', 'series'
- ],
-
- /**
- * @protected
- */
- defaultOption: {
- zlevel: 0,
- z: 4, // Higher than normal component (z: 2).
- orient: null, // Default auto by axisIndex. Possible value: 'horizontal', 'vertical'.
- xAxisIndex: null, // Default all horizontal category axis.
- yAxisIndex: null, // Default all vertical category axis.
- angleAxisIndex: null,
- radiusAxisIndex: null,
- filterMode: 'filter', // Possible values: 'filter' or 'empty'.
- // 'filter': data items which are out of window will be removed.
- // This option is applicable when filtering outliers.
- // 'empty': data items which are out of window will be set to empty.
- // This option is applicable when user should not neglect
- // that there are some data items out of window.
- // Taking line chart as an example, line will be broken in
- // the filtered points when filterModel is set to 'empty', but
- // be connected when set to 'filter'.
-
- throttle: 100, // Dispatch action by the fixed rate, avoid frequency.
- // default 100. Do not throttle when use null/undefined.
- start: 0, // Start percent. 0 ~ 100
- end: 100, // End percent. 0 ~ 100
- startValue: null, // Start value. If startValue specified, start is ignored.
- endValue: null // End value. If endValue specified, end is ignored.
- },
-
- /**
- * @override
- */
- init: function (option, parentModel, ecModel) {
-
- /**
- * key like x_0, y_1
- * @private
- * @type {Object}
- */
- this._dataIntervalByAxis = {};
-
- /**
- * @private
- */
- this._dataInfo = {};
-
- /**
- * key like x_0, y_1
- * @private
- */
- this._axisProxies = {};
-
- /**
- * @readOnly
- */
- this.textStyleModel;
-
- var rawOption = retrieveRaw(option);
-
- this.mergeDefaultAndTheme(option, ecModel);
-
- this.doInit(rawOption);
- },
-
- /**
- * @override
- */
- mergeOption: function (newOption) {
- var rawOption = retrieveRaw(newOption);
-
- //FIX #2591
- zrUtil.merge(this.option, newOption, true);
-
- this.doInit(rawOption);
- },
-
- /**
- * @protected
- */
- doInit: function (rawOption) {
- var thisOption = this.option;
-
- // Disable realtime view update if canvas is not supported.
- if (!env.canvasSupported) {
- thisOption.realtime = false;
- }
-
- processRangeProp('start', 'startValue', rawOption, thisOption);
- processRangeProp('end', 'endValue', rawOption, thisOption);
-
- this.textStyleModel = this.getModel('textStyle');
-
- this._resetTarget();
-
- this._giveAxisProxies();
- },
-
- /**
- * @private
- */
- _giveAxisProxies: function () {
- var axisProxies = this._axisProxies;
-
- this.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel, ecModel) {
- var axisModel = this.dependentModels[dimNames.axis][axisIndex];
-
- // If exists, share axisProxy with other dataZoomModels.
- var axisProxy = axisModel.__dzAxisProxy || (
- // Use the first dataZoomModel as the main model of axisProxy.
- axisModel.__dzAxisProxy = new AxisProxy(
- dimNames.name, axisIndex, this, ecModel
- )
- );
- // FIXME
- // dispose __dzAxisProxy
-
- axisProxies[dimNames.name + '_' + axisIndex] = axisProxy;
- }, this);
- },
-
- /**
- * @private
- */
- _resetTarget: function () {
- var thisOption = this.option;
-
- var autoMode = this._judgeAutoMode();
-
- eachAxisDim(function (dimNames) {
- var axisIndexName = dimNames.axisIndex;
- thisOption[axisIndexName] = modelUtil.normalizeToArray(
- thisOption[axisIndexName]
- );
- }, this);
-
- if (autoMode === 'axisIndex') {
- this._autoSetAxisIndex();
- }
- else if (autoMode === 'orient') {
- this._autoSetOrient();
- }
- },
-
- /**
- * @private
- */
- _judgeAutoMode: function () {
- // Auto set only works for setOption at the first time.
- // The following is user's reponsibility. So using merged
- // option is OK.
- var thisOption = this.option;
-
- var hasIndexSpecified = false;
- eachAxisDim(function (dimNames) {
- // When user set axisIndex as a empty array, we think that user specify axisIndex
- // but do not want use auto mode. Because empty array may be encountered when
- // some error occured.
- if (thisOption[dimNames.axisIndex] != null) {
- hasIndexSpecified = true;
- }
- }, this);
-
- var orient = thisOption.orient;
-
- if (orient == null && hasIndexSpecified) {
- return 'orient';
- }
- else if (!hasIndexSpecified) {
- if (orient == null) {
- thisOption.orient = 'horizontal';
- }
- return 'axisIndex';
- }
- },
-
- /**
- * @private
- */
- _autoSetAxisIndex: function () {
- var autoAxisIndex = true;
- var orient = this.get('orient', true);
- var thisOption = this.option;
-
- if (autoAxisIndex) {
- // Find axis that parallel to dataZoom as default.
- var dimNames = orient === 'vertical'
- ? {dim: 'y', axisIndex: 'yAxisIndex', axis: 'yAxis'}
- : {dim: 'x', axisIndex: 'xAxisIndex', axis: 'xAxis'};
-
- if (this.dependentModels[dimNames.axis].length) {
- thisOption[dimNames.axisIndex] = [0];
- autoAxisIndex = false;
- }
- }
-
- if (autoAxisIndex) {
- // Find the first category axis as default. (consider polar)
- eachAxisDim(function (dimNames) {
- if (!autoAxisIndex) {
- return;
- }
- var axisIndices = [];
- var axisModels = this.dependentModels[dimNames.axis];
- if (axisModels.length && !axisIndices.length) {
- for (var i = 0, len = axisModels.length; i < len; i++) {
- if (axisModels[i].get('type') === 'category') {
- axisIndices.push(i);
- }
- }
- }
- thisOption[dimNames.axisIndex] = axisIndices;
- if (axisIndices.length) {
- autoAxisIndex = false;
- }
- }, this);
- }
-
- if (autoAxisIndex) {
- // FIXME
- // 这里是兼容ec2的写法(没指定xAxisIndex和yAxisIndex时把scatter和双数值轴折柱纳入dataZoom控制),
- // 但是实际是否需要Grid.js#getScaleByOption来判断(考虑time,log等axis type)?
-
- // If both dataZoom.xAxisIndex and dataZoom.yAxisIndex is not specified,
- // dataZoom component auto adopts series that reference to
- // both xAxis and yAxis which type is 'value'.
- this.ecModel.eachSeries(function (seriesModel) {
- if (this._isSeriesHasAllAxesTypeOf(seriesModel, 'value')) {
- eachAxisDim(function (dimNames) {
- var axisIndices = thisOption[dimNames.axisIndex];
- var axisIndex = seriesModel.get(dimNames.axisIndex);
- if (zrUtil.indexOf(axisIndices, axisIndex) < 0) {
- axisIndices.push(axisIndex);
- }
- });
- }
- }, this);
- }
- },
-
- /**
- * @private
- */
- _autoSetOrient: function () {
- var dim;
-
- // Find the first axis
- this.eachTargetAxis(function (dimNames) {
- !dim && (dim = dimNames.name);
- }, this);
-
- this.option.orient = dim === 'y' ? 'vertical' : 'horizontal';
- },
-
- /**
- * @private
- */
- _isSeriesHasAllAxesTypeOf: function (seriesModel, axisType) {
- // FIXME
- // 需要series的xAxisIndex和yAxisIndex都首先自动设置上。
- // 例如series.type === scatter时。
-
- var is = true;
- eachAxisDim(function (dimNames) {
- var seriesAxisIndex = seriesModel.get(dimNames.axisIndex);
- var axisModel = this.dependentModels[dimNames.axis][seriesAxisIndex];
-
- if (!axisModel || axisModel.get('type') !== axisType) {
- is = false;
- }
- }, this);
- return is;
- },
-
- /**
- * @public
- */
- getFirstTargetAxisModel: function () {
- var firstAxisModel;
- eachAxisDim(function (dimNames) {
- if (firstAxisModel == null) {
- var indices = this.get(dimNames.axisIndex);
- if (indices.length) {
- firstAxisModel = this.dependentModels[dimNames.axis][indices[0]];
- }
- }
- }, this);
-
- return firstAxisModel;
- },
-
- /**
- * @public
- * @param {Function} callback param: axisModel, dimNames, axisIndex, dataZoomModel, ecModel
- */
- eachTargetAxis: function (callback, context) {
- var ecModel = this.ecModel;
- eachAxisDim(function (dimNames) {
- each(
- this.get(dimNames.axisIndex),
- function (axisIndex) {
- callback.call(context, dimNames, axisIndex, this, ecModel);
- },
- this
- );
- }, this);
- },
-
- getAxisProxy: function (dimName, axisIndex) {
- return this._axisProxies[dimName + '_' + axisIndex];
- },
-
- /**
- * If not specified, set to undefined.
- *
- * @public
- * @param {Object} opt
- * @param {number} [opt.start]
- * @param {number} [opt.end]
- * @param {number} [opt.startValue]
- * @param {number} [opt.endValue]
- */
- setRawRange: function (opt) {
- each(['start', 'end', 'startValue', 'endValue'], function (name) {
- // If any of those prop is null/undefined, we should alos set
- // them, because only one pair between start/end and
- // startValue/endValue can work.
- this.option[name] = opt[name];
- }, this);
- },
-
- /**
- * @public
- * @return {Array.<number>} [startPercent, endPercent]
- */
- getPercentRange: function () {
- var axisProxy = this.findRepresentativeAxisProxy();
- if (axisProxy) {
- return axisProxy.getDataPercentWindow();
- }
- },
-
- /**
- * @public
- * For example, chart.getModel().getComponent('dataZoom').getValueRange('y', 0);
- *
- * @param {string} [axisDimName]
- * @param {number} [axisIndex]
- * @return {Array.<number>} [startValue, endValue]
- */
- getValueRange: function (axisDimName, axisIndex) {
- if (axisDimName == null && axisIndex == null) {
- var axisProxy = this.findRepresentativeAxisProxy();
- if (axisProxy) {
- return axisProxy.getDataValueWindow();
- }
- }
- else {
- return this.getAxisProxy(axisDimName, axisIndex).getDataValueWindow();
- }
- },
-
- /**
- * @public
- * @return {module:echarts/component/dataZoom/AxisProxy}
- */
- findRepresentativeAxisProxy: function () {
- // Find the first hosted axisProxy
- var axisProxies = this._axisProxies;
- for (var key in axisProxies) {
- if (axisProxies.hasOwnProperty(key) && axisProxies[key].hostedBy(this)) {
- return axisProxies[key];
- }
- }
-
- // If no hosted axis find not hosted axisProxy.
- // Consider this case: dataZoomModel1 and dataZoomModel2 control the same axis,
- // and the option.start or option.end settings are different. The percentRange
- // should follow axisProxy.
- // (We encounter this problem in toolbox data zoom.)
- for (var key in axisProxies) {
- if (axisProxies.hasOwnProperty(key) && !axisProxies[key].hostedBy(this)) {
- return axisProxies[key];
- }
- }
- }
-
- });
-
- function retrieveRaw(option) {
- var ret = {};
- each(
- ['start', 'end', 'startValue', 'endValue'],
- function (name) {
- ret[name] = option[name];
- }
- );
- return ret;
- }
-
- function processRangeProp(percentProp, valueProp, rawOption, thisOption) {
- // start/end has higher priority over startValue/endValue,
- // but we should make chart.setOption({endValue: 1000}) effective,
- // rather than chart.setOption({endValue: 1000, end: null}).
- if (rawOption[valueProp] != null && rawOption[percentProp] == null) {
- thisOption[percentProp] = null;
- }
- // Otherwise do nothing and use the merge result.
- }
-
- module.exports = DataZoomModel;
-
-
-
-/***/ },
-/* 289 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Axis operator
- */
-
-
- var zrUtil = __webpack_require__(3);
- var numberUtil = __webpack_require__(7);
- var each = zrUtil.each;
- var asc = numberUtil.asc;
-
- /**
- * Operate single axis.
- * One axis can only operated by one axis operator.
- * Different dataZoomModels may be defined to operate the same axis.
- * (i.e. 'inside' data zoom and 'slider' data zoom components)
- * So dataZoomModels share one axisProxy in that case.
- *
- * @class
- */
- var AxisProxy = function (dimName, axisIndex, dataZoomModel, ecModel) {
-
- /**
- * @private
- * @type {string}
- */
- this._dimName = dimName;
-
- /**
- * @private
- */
- this._axisIndex = axisIndex;
-
- /**
- * @private
- * @type {Array.<number>}
- */
- this._valueWindow;
-
- /**
- * @private
- * @type {Array.<number>}
- */
- this._percentWindow;
-
- /**
- * @private
- * @type {Array.<number>}
- */
- this._dataExtent;
-
- /**
- * @readOnly
- * @type {module: echarts/model/Global}
- */
- this.ecModel = ecModel;
-
- /**
- * @private
- * @type {module: echarts/component/dataZoom/DataZoomModel}
- */
- this._dataZoomModel = dataZoomModel;
- };
-
- AxisProxy.prototype = {
-
- constructor: AxisProxy,
-
- /**
- * Whether the axisProxy is hosted by dataZoomModel.
- *
- * @public
- * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel
- * @return {boolean}
- */
- hostedBy: function (dataZoomModel) {
- return this._dataZoomModel === dataZoomModel;
- },
-
- /**
- * @return {Array.<number>}
- */
- getDataExtent: function () {
- return this._dataExtent.slice();
- },
-
- /**
- * @return {Array.<number>}
- */
- getDataValueWindow: function () {
- return this._valueWindow.slice();
- },
-
- /**
- * @return {Array.<number>}
- */
- getDataPercentWindow: function () {
- return this._percentWindow.slice();
- },
-
- /**
- * @public
- * @param {number} axisIndex
- * @return {Array} seriesModels
- */
- getTargetSeriesModels: function () {
- var seriesModels = [];
-
- this.ecModel.eachSeries(function (seriesModel) {
- if (this._axisIndex === seriesModel.get(this._dimName + 'AxisIndex')) {
- seriesModels.push(seriesModel);
- }
- }, this);
-
- return seriesModels;
- },
-
- getAxisModel: function () {
- return this.ecModel.getComponent(this._dimName + 'Axis', this._axisIndex);
- },
-
- getOtherAxisModel: function () {
- var axisDim = this._dimName;
- var ecModel = this.ecModel;
- var axisModel = this.getAxisModel();
- var isCartesian = axisDim === 'x' || axisDim === 'y';
- var otherAxisDim;
- var coordSysIndexName;
- if (isCartesian) {
- coordSysIndexName = 'gridIndex';
- otherAxisDim = axisDim === 'x' ? 'y' : 'x';
- }
- else {
- coordSysIndexName = 'polarIndex';
- otherAxisDim = axisDim === 'angle' ? 'radius' : 'angle';
- }
- var foundOtherAxisModel;
- ecModel.eachComponent(otherAxisDim + 'Axis', function (otherAxisModel) {
- if ((otherAxisModel.get(coordSysIndexName) || 0)
- === (axisModel.get(coordSysIndexName) || 0)) {
- foundOtherAxisModel = otherAxisModel;
- }
- });
- return foundOtherAxisModel;
- },
-
- /**
- * Notice: reset should not be called before series.restoreData() called,
- * so it is recommanded to be called in "process stage" but not "model init
- * stage".
- *
- * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel
- */
- reset: function (dataZoomModel) {
- if (dataZoomModel !== this._dataZoomModel) {
- return;
- }
-
- // Culculate data window and data extent, and record them.
- var dataExtent = this._dataExtent = calculateDataExtent(
- this._dimName, this.getTargetSeriesModels()
- );
- var dataWindow = calculateDataWindow(
- dataZoomModel.option, dataExtent, this
- );
- this._valueWindow = dataWindow.valueWindow;
- this._percentWindow = dataWindow.percentWindow;
-
- // Update axis setting then.
- setAxisModel(this);
- },
-
- /**
- * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel
- */
- restore: function (dataZoomModel) {
- if (dataZoomModel !== this._dataZoomModel) {
- return;
- }
-
- this._valueWindow = this._percentWindow = null;
- setAxisModel(this, true);
- },
-
- /**
- * @param {module: echarts/component/dataZoom/DataZoomModel} dataZoomModel
- */
- filterData: function (dataZoomModel) {
- if (dataZoomModel !== this._dataZoomModel) {
- return;
- }
-
- var axisDim = this._dimName;
- var seriesModels = this.getTargetSeriesModels();
- var filterMode = dataZoomModel.get('filterMode');
- var valueWindow = this._valueWindow;
-
- // FIXME
- // Toolbox may has dataZoom injected. And if there are stacked bar chart
- // with NaN data. NaN will be filtered and stack will be wrong.
- // So we need to force the mode to be set empty
- var otherAxisModel = this.getOtherAxisModel();
- if (dataZoomModel.get('$fromToolbox')
- && otherAxisModel && otherAxisModel.get('type') === 'category') {
- filterMode = 'empty';
- }
- // Process series data
- each(seriesModels, function (seriesModel) {
- var seriesData = seriesModel.getData();
- if (!seriesData) {
- return;
- }
-
- each(seriesModel.coordDimToDataDim(axisDim), function (dim) {
- if (filterMode === 'empty') {
- seriesModel.setData(
- seriesData.map(dim, function (value) {
- return !isInWindow(value) ? NaN : value;
- })
- );
- }
- else {
- seriesData.filterSelf(dim, isInWindow);
- }
- });
- });
-
- function isInWindow(value) {
- return value >= valueWindow[0] && value <= valueWindow[1];
- }
- }
- };
-
- function calculateDataExtent(axisDim, seriesModels) {
- var dataExtent = [Infinity, -Infinity];
-
- each(seriesModels, function (seriesModel) {
- var seriesData = seriesModel.getData();
- if (seriesData) {
- each(seriesModel.coordDimToDataDim(axisDim), function (dim) {
- var seriesExtent = seriesData.getDataExtent(dim);
- seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]);
- seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]);
- });
- }
- }, this);
-
- return dataExtent;
- }
-
- function calculateDataWindow(opt, dataExtent, axisProxy) {
- var axisModel = axisProxy.getAxisModel();
- var scale = axisModel.axis.scale;
- var percentExtent = [0, 100];
- var percentWindow = [
- opt.start,
- opt.end
- ];
- var valueWindow = [];
-
- // In percent range is used and axis min/max/scale is set,
- // window should be based on min/max/0, but should not be
- // based on the extent of filtered data.
- dataExtent = dataExtent.slice();
- fixExtendByAxis(dataExtent, axisModel, scale);
-
- each(['startValue', 'endValue'], function (prop) {
- valueWindow.push(
- opt[prop] != null
- ? scale.parse(opt[prop])
- : null
- );
- });
-
- // Normalize bound.
- each([0, 1], function (idx) {
- var boundValue = valueWindow[idx];
- var boundPercent = percentWindow[idx];
-
- // start/end has higher priority over startValue/endValue,
- // because start/end can be consistent among different type
- // of axis but startValue/endValue not.
-
- if (boundPercent != null || boundValue == null) {
- if (boundPercent == null) {
- boundPercent = percentExtent[idx];
- }
- // Use scale.parse to math round for category or time axis.
- boundValue = scale.parse(numberUtil.linearMap(
- boundPercent, percentExtent, dataExtent, true
- ));
- }
- else { // boundPercent == null && boundValue != null
- boundPercent = numberUtil.linearMap(
- boundValue, dataExtent, percentExtent, true
- );
- }
- // Avoid rounding error
- valueWindow[idx] = numberUtil.round(boundValue);
- percentWindow[idx] = numberUtil.round(boundPercent);
- });
-
- return {
- valueWindow: asc(valueWindow),
- percentWindow: asc(percentWindow)
- };
- }
-
- function fixExtendByAxis(dataExtent, axisModel, scale) {
- each(['min', 'max'], function (minMax, index) {
- var axisMax = axisModel.get(minMax, true);
- // Consider 'dataMin', 'dataMax'
- if (axisMax != null && (axisMax + '').toLowerCase() !== 'data' + minMax) {
- dataExtent[index] = scale.parse(axisMax);
- }
- });
-
- if (!axisModel.get('scale', true)) {
- dataExtent[0] > 0 && (dataExtent[0] = 0);
- dataExtent[1] < 0 && (dataExtent[1] = 0);
- }
-
- return dataExtent;
- }
-
- function setAxisModel(axisProxy, isRestore) {
- var axisModel = axisProxy.getAxisModel();
-
- var percentWindow = axisProxy._percentWindow;
- var valueWindow = axisProxy._valueWindow;
-
- if (!percentWindow) {
- return;
- }
-
- var isFull = isRestore || (percentWindow[0] === 0 && percentWindow[1] === 100);
- // [0, 500]: arbitrary value, guess axis extent.
- var precision = !isRestore && numberUtil.getPixelPrecision(valueWindow, [0, 500]);
- // toFixed() digits argument must be between 0 and 20
- var invalidPrecision = !isRestore && !(precision < 20 && precision >= 0);
-
- var useOrigin = isRestore || isFull || invalidPrecision;
-
- axisModel.setRange && axisModel.setRange(
- useOrigin ? null : +valueWindow[0].toFixed(precision),
- useOrigin ? null : +valueWindow[1].toFixed(precision)
- );
- }
-
- module.exports = AxisProxy;
-
-
-
-/***/ },
-/* 290 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var ComponentView = __webpack_require__(28);
-
- module.exports = ComponentView.extend({
-
- type: 'dataZoom',
-
- render: function (dataZoomModel, ecModel, api, payload) {
- this.dataZoomModel = dataZoomModel;
- this.ecModel = ecModel;
- this.api = api;
- },
-
- /**
- * Find the first target coordinate system.
- *
- * @protected
- * @return {Object} {
- * cartesians: [
- * {model: coord0, axisModels: [axis1, axis3], coordIndex: 1},
- * {model: coord1, axisModels: [axis0, axis2], coordIndex: 0},
- * ...
- * ], // cartesians must not be null/undefined.
- * polars: [
- * {model: coord0, axisModels: [axis4], coordIndex: 0},
- * ...
- * ], // polars must not be null/undefined.
- * axisModels: [axis0, axis1, axis2, axis3, axis4]
- * // axisModels must not be null/undefined.
- * }
- */
- getTargetInfo: function () {
- var dataZoomModel = this.dataZoomModel;
- var ecModel = this.ecModel;
- var cartesians = [];
- var polars = [];
- var axisModels = [];
-
- dataZoomModel.eachTargetAxis(function (dimNames, axisIndex) {
- var axisModel = ecModel.getComponent(dimNames.axis, axisIndex);
- if (axisModel) {
- axisModels.push(axisModel);
-
- var gridIndex = axisModel.get('gridIndex');
- var polarIndex = axisModel.get('polarIndex');
-
- if (gridIndex != null) {
- var coordModel = ecModel.getComponent('grid', gridIndex);
- save(coordModel, axisModel, cartesians, gridIndex);
- }
- else if (polarIndex != null) {
- var coordModel = ecModel.getComponent('polar', polarIndex);
- save(coordModel, axisModel, polars, polarIndex);
- }
- }
- }, this);
-
- function save(coordModel, axisModel, store, coordIndex) {
- var item;
- for (var i = 0; i < store.length; i++) {
- if (store[i].model === coordModel) {
- item = store[i];
- break;
- }
- }
- if (!item) {
- store.push(item = {
- model: coordModel, axisModels: [], coordIndex: coordIndex
- });
- }
- item.axisModels.push(axisModel);
- }
-
- return {
- cartesians: cartesians,
- polars: polars,
- axisModels: axisModels
- };
- }
-
- });
-
-
-
-/***/ },
-/* 291 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Data zoom model
- */
-
-
- var DataZoomModel = __webpack_require__(288);
- var layout = __webpack_require__(21);
- var zrUtil = __webpack_require__(3);
-
- var SliderZoomModel = DataZoomModel.extend({
-
- type: 'dataZoom.slider',
-
- layoutMode: 'box',
-
- /**
- * @protected
- */
- defaultOption: {
- show: true,
-
- // ph => placeholder. Using placehoder here because
- // deault value can only be drived in view stage.
- right: 'ph', // Default align to grid rect.
- top: 'ph', // Default align to grid rect.
- width: 'ph', // Default align to grid rect.
- height: 'ph', // Default align to grid rect.
- left: null, // Default align to grid rect.
- bottom: null, // Default align to grid rect.
-
- backgroundColor: 'rgba(47,69,84,0)', // Background of slider zoom component.
- dataBackgroundColor: '#ddd', // Background of data shadow.
- fillerColor: 'rgba(47,69,84,0.15)', // Color of selected area.
- handleColor: 'rgba(148,164,165,0.95)', // Color of handle.
- handleSize: 10,
-
- labelPrecision: null,
- labelFormatter: null,
- showDetail: true,
- showDataShadow: 'auto', // Default auto decision.
- realtime: true,
- zoomLock: false, // Whether disable zoom.
- textStyle: {
- color: '#333'
- }
- },
-
- /**
- * @override
- */
- mergeOption: function (option) {
- SliderZoomModel.superApply(this, 'mergeOption', arguments);
- }
-
- });
-
- module.exports = SliderZoomModel;
-
-
-
-/***/ },
-/* 292 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var graphic = __webpack_require__(42);
- var throttle = __webpack_require__(293);
- var DataZoomView = __webpack_require__(290);
- var Rect = graphic.Rect;
- var numberUtil = __webpack_require__(7);
- var linearMap = numberUtil.linearMap;
- var layout = __webpack_require__(21);
- var sliderMove = __webpack_require__(294);
- var asc = numberUtil.asc;
- var bind = zrUtil.bind;
- var mathRound = Math.round;
- var mathMax = Math.max;
- var each = zrUtil.each;
-
- // Constants
- var DEFAULT_LOCATION_EDGE_GAP = 7;
- var DEFAULT_FRAME_BORDER_WIDTH = 1;
- var DEFAULT_FILLER_SIZE = 30;
- var HORIZONTAL = 'horizontal';
- var VERTICAL = 'vertical';
- var LABEL_GAP = 5;
- var SHOW_DATA_SHADOW_SERIES_TYPE = ['line', 'bar', 'candlestick', 'scatter'];
-
- var SliderZoomView = DataZoomView.extend({
-
- type: 'dataZoom.slider',
-
- init: function (ecModel, api) {
-
- /**
- * @private
- * @type {Object}
- */
- this._displayables = {};
-
- /**
- * @private
- * @type {string}
- */
- this._orient;
-
- /**
- * [0, 100]
- * @private
- */
- this._range;
-
- /**
- * [coord of the first handle, coord of the second handle]
- * @private
- */
- this._handleEnds;
-
- /**
- * [length, thick]
- * @private
- * @type {Array.<number>}
- */
- this._size;
-
- /**
- * @private
- * @type {number}
- */
- this._halfHandleSize;
-
- /**
- * @private
- */
- this._location;
-
- /**
- * @private
- */
- this._dragging;
-
- /**
- * @private
- */
- this._dataShadowInfo;
-
- this.api = api;
- },
-
- /**
- * @override
- */
- render: function (dataZoomModel, ecModel, api, payload) {
- SliderZoomView.superApply(this, 'render', arguments);
-
- throttle.createOrUpdate(
- this,
- '_dispatchZoomAction',
- this.dataZoomModel.get('throttle'),
- 'fixRate'
- );
-
- this._orient = dataZoomModel.get('orient');
- this._halfHandleSize = mathRound(dataZoomModel.get('handleSize') / 2);
-
- if (this.dataZoomModel.get('show') === false) {
- this.group.removeAll();
- return;
- }
-
- // Notice: this._resetInterval() should not be executed when payload.type
- // is 'dataZoom', origin this._range should be maintained, otherwise 'pan'
- // or 'zoom' info will be missed because of 'throttle' of this.dispatchAction,
- if (!payload || payload.type !== 'dataZoom' || payload.from !== this.uid) {
- this._buildView();
- }
-
- this._updateView();
- },
-
- /**
- * @override
- */
- remove: function () {
- SliderZoomView.superApply(this, 'remove', arguments);
- throttle.clear(this, '_dispatchZoomAction');
- },
-
- /**
- * @override
- */
- dispose: function () {
- SliderZoomView.superApply(this, 'dispose', arguments);
- throttle.clear(this, '_dispatchZoomAction');
- },
-
- _buildView: function () {
- var thisGroup = this.group;
-
- thisGroup.removeAll();
-
- this._resetLocation();
- this._resetInterval();
-
- var barGroup = this._displayables.barGroup = new graphic.Group();
-
- this._renderBackground();
- this._renderDataShadow();
- this._renderHandle();
-
- thisGroup.add(barGroup);
-
- this._positionGroup();
- },
-
- /**
- * @private
- */
- _resetLocation: function () {
- var dataZoomModel = this.dataZoomModel;
- var api = this.api;
-
- // If some of x/y/width/height are not specified,
- // auto-adapt according to target grid.
- var coordRect = this._findCoordRect();
- var ecSize = {width: api.getWidth(), height: api.getHeight()};
- // Default align by coordinate system rect.
- var positionInfo = this._orient === HORIZONTAL
- ? {
- // Why using 'right', because right should be used in vertical,
- // and it is better to be consistent for dealing with position param merge.
- right: ecSize.width - coordRect.x - coordRect.width,
- top: (ecSize.height - DEFAULT_FILLER_SIZE - DEFAULT_LOCATION_EDGE_GAP),
- width: coordRect.width,
- height: DEFAULT_FILLER_SIZE
- }
- : { // vertical
- right: DEFAULT_LOCATION_EDGE_GAP,
- top: coordRect.y,
- width: DEFAULT_FILLER_SIZE,
- height: coordRect.height
- };
-
- // Do not write back to option and replace value 'ph', because
- // the 'ph' value should be recalculated when resize.
- var layoutParams = layout.getLayoutParams(dataZoomModel.option);
-
- // Replace the placeholder value.
- zrUtil.each(['right', 'top', 'width', 'height'], function (name) {
- if (layoutParams[name] === 'ph') {
- layoutParams[name] = positionInfo[name];
- }
- });
-
- var layoutRect = layout.getLayoutRect(
- layoutParams,
- ecSize,
- dataZoomModel.padding
- );
-
- this._location = {x: layoutRect.x, y: layoutRect.y};
- this._size = [layoutRect.width, layoutRect.height];
- this._orient === VERTICAL && this._size.reverse();
- },
-
- /**
- * @private
- */
- _positionGroup: function () {
- var thisGroup = this.group;
- var location = this._location;
- var orient = this._orient;
-
- // Just use the first axis to determine mapping.
- var targetAxisModel = this.dataZoomModel.getFirstTargetAxisModel();
- var inverse = targetAxisModel && targetAxisModel.get('inverse');
-
- var barGroup = this._displayables.barGroup;
- var otherAxisInverse = (this._dataShadowInfo || {}).otherAxisInverse;
-
- // Transform barGroup.
- barGroup.attr(
- (orient === HORIZONTAL && !inverse)
- ? {scale: otherAxisInverse ? [1, 1] : [1, -1]}
- : (orient === HORIZONTAL && inverse)
- ? {scale: otherAxisInverse ? [-1, 1] : [-1, -1]}
- : (orient === VERTICAL && !inverse)
- ? {scale: otherAxisInverse ? [1, -1] : [1, 1], rotation: Math.PI / 2}
- // Dont use Math.PI, considering shadow direction.
- : {scale: otherAxisInverse ? [-1, -1] : [-1, 1], rotation: Math.PI / 2}
- );
-
- // Position barGroup
- var rect = thisGroup.getBoundingRect([barGroup]);
- thisGroup.position[0] = location.x - rect.x;
- thisGroup.position[1] = location.y - rect.y;
- },
-
- /**
- * @private
- */
- _getViewExtent: function () {
- // View total length.
- var halfHandleSize = this._halfHandleSize;
- var totalLength = mathMax(this._size[0], halfHandleSize * 4);
- var extent = [halfHandleSize, totalLength - halfHandleSize];
-
- return extent;
- },
-
- _renderBackground : function () {
- var dataZoomModel = this.dataZoomModel;
- var size = this._size;
-
- this._displayables.barGroup.add(new Rect({
- silent: true,
- shape: {
- x: 0, y: 0, width: size[0], height: size[1]
- },
- style: {
- fill: dataZoomModel.get('backgroundColor')
- }
- }));
- },
-
- _renderDataShadow: function () {
- var info = this._dataShadowInfo = this._prepareDataShadowInfo();
-
- if (!info) {
- return;
- }
-
- var size = this._size;
- var seriesModel = info.series;
- var data = seriesModel.getRawData();
- var otherDim = seriesModel.getShadowDim
- ? seriesModel.getShadowDim() // @see candlestick
- : info.otherDim;
-
- var otherDataExtent = data.getDataExtent(otherDim);
- // Nice extent.
- var otherOffset = (otherDataExtent[1] - otherDataExtent[0]) * 0.3;
- otherDataExtent = [
- otherDataExtent[0] - otherOffset,
- otherDataExtent[1] + otherOffset
- ];
- var otherShadowExtent = [0, size[1]];
-
- var thisShadowExtent = [0, size[0]];
-
- var points = [[size[0], 0], [0, 0]];
- var step = thisShadowExtent[1] / (data.count() - 1);
- var thisCoord = 0;
-
- // Optimize for large data shadow
- var stride = Math.round(data.count() / size[0]);
- data.each([otherDim], function (value, index) {
- if (stride > 0 && (index % stride)) {
- thisCoord += step;
- return;
- }
- // FIXME
- // 应该使用统计的空判断?还是在list里进行空判断?
- var otherCoord = (value == null || isNaN(value) || value === '')
- ? null
- : linearMap(value, otherDataExtent, otherShadowExtent, true);
- otherCoord != null && points.push([thisCoord, otherCoord]);
-
- thisCoord += step;
- });
-
- this._displayables.barGroup.add(new graphic.Polyline({
- shape: {points: points},
- style: {fill: this.dataZoomModel.get('dataBackgroundColor'), lineWidth: 0},
- silent: true,
- z2: -20
- }));
- },
-
- _prepareDataShadowInfo: function () {
- var dataZoomModel = this.dataZoomModel;
- var showDataShadow = dataZoomModel.get('showDataShadow');
-
- if (showDataShadow === false) {
- return;
- }
-
- // Find a representative series.
- var result;
- var ecModel = this.ecModel;
-
- dataZoomModel.eachTargetAxis(function (dimNames, axisIndex) {
- var seriesModels = dataZoomModel
- .getAxisProxy(dimNames.name, axisIndex)
- .getTargetSeriesModels();
-
- zrUtil.each(seriesModels, function (seriesModel) {
- if (result) {
- return;
- }
-
- if (showDataShadow !== true && zrUtil.indexOf(
- SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type')
- ) < 0
- ) {
- return;
- }
-
- var otherDim = getOtherDim(dimNames.name);
-
- var thisAxis = ecModel.getComponent(dimNames.axis, axisIndex).axis;
-
- result = {
- thisAxis: thisAxis,
- series: seriesModel,
- thisDim: dimNames.name,
- otherDim: otherDim,
- otherAxisInverse: seriesModel
- .coordinateSystem.getOtherAxis(thisAxis).inverse
- };
-
- }, this);
-
- }, this);
-
- return result;
- },
-
- _renderHandle: function () {
- var displaybles = this._displayables;
- var handles = displaybles.handles = [];
- var handleLabels = displaybles.handleLabels = [];
- var barGroup = this._displayables.barGroup;
- var size = this._size;
-
- barGroup.add(displaybles.filler = new Rect({
- draggable: true,
- cursor: 'move',
- drift: bind(this._onDragMove, this, 'all'),
- ondragend: bind(this._onDragEnd, this),
- onmouseover: bind(this._showDataInfo, this, true),
- onmouseout: bind(this._showDataInfo, this, false),
- style: {
- fill: this.dataZoomModel.get('fillerColor'),
- // text: ':::',
- textPosition : 'inside'
- }
- }));
-
- // Frame border.
- barGroup.add(new Rect(graphic.subPixelOptimizeRect({
- silent: true,
- shape: {
- x: 0,
- y: 0,
- width: size[0],
- height: size[1]
- },
- style: {
- stroke: this.dataZoomModel.get('dataBackgroundColor'),
- lineWidth: DEFAULT_FRAME_BORDER_WIDTH,
- fill: 'rgba(0,0,0,0)'
- }
- })));
-
- each([0, 1], function (handleIndex) {
-
- barGroup.add(handles[handleIndex] = new Rect({
- style: {
- fill: this.dataZoomModel.get('handleColor')
- },
- cursor: 'move',
- draggable: true,
- drift: bind(this._onDragMove, this, handleIndex),
- ondragend: bind(this._onDragEnd, this),
- onmouseover: bind(this._showDataInfo, this, true),
- onmouseout: bind(this._showDataInfo, this, false)
- }));
-
- var textStyleModel = this.dataZoomModel.textStyleModel;
-
- this.group.add(
- handleLabels[handleIndex] = new graphic.Text({
- silent: true,
- invisible: true,
- style: {
- x: 0, y: 0, text: '',
- textVerticalAlign: 'middle',
- textAlign: 'center',
- fill: textStyleModel.getTextColor(),
- textFont: textStyleModel.getFont()
- }
- }));
-
- }, this);
- },
-
- /**
- * @private
- */
- _resetInterval: function () {
- var range = this._range = this.dataZoomModel.getPercentRange();
- var viewExtent = this._getViewExtent();
-
- this._handleEnds = [
- linearMap(range[0], [0, 100], viewExtent, true),
- linearMap(range[1], [0, 100], viewExtent, true)
- ];
- },
-
- /**
- * @private
- * @param {(number|string)} handleIndex 0 or 1 or 'all'
- * @param {number} dx
- * @param {number} dy
- */
- _updateInterval: function (handleIndex, delta) {
- var handleEnds = this._handleEnds;
- var viewExtend = this._getViewExtent();
-
- sliderMove(
- delta,
- handleEnds,
- viewExtend,
- (handleIndex === 'all' || this.dataZoomModel.get('zoomLock'))
- ? 'rigid' : 'cross',
- handleIndex
- );
-
- this._range = asc([
- linearMap(handleEnds[0], viewExtend, [0, 100], true),
- linearMap(handleEnds[1], viewExtend, [0, 100], true)
- ]);
- },
-
- /**
- * @private
- */
- _updateView: function () {
- var displaybles = this._displayables;
- var handleEnds = this._handleEnds;
- var handleInterval = asc(handleEnds.slice());
- var size = this._size;
- var halfHandleSize = this._halfHandleSize;
-
- each([0, 1], function (handleIndex) {
-
- // Handles
- var handle = displaybles.handles[handleIndex];
- handle.setShape({
- x: handleEnds[handleIndex] - halfHandleSize,
- y: -1,
- width: halfHandleSize * 2,
- height: size[1] + 2,
- r: 1
- });
-
- }, this);
-
- // Filler
- displaybles.filler.setShape({
- x: handleInterval[0],
- y: 0,
- width: handleInterval[1] - handleInterval[0],
- height: this._size[1]
- });
-
- this._updateDataInfo();
- },
-
- /**
- * @private
- */
- _updateDataInfo: function () {
- var dataZoomModel = this.dataZoomModel;
- var displaybles = this._displayables;
- var handleLabels = displaybles.handleLabels;
- var orient = this._orient;
- var labelTexts = ['', ''];
-
- // FIXME
- // date型,支持formatter,autoformatter(ec2 date.getAutoFormatter)
- if (dataZoomModel.get('showDetail')) {
- var dataInterval;
- var axis;
- dataZoomModel.eachTargetAxis(function (dimNames, axisIndex) {
- // Using dataInterval of the first axis.
- if (!dataInterval) {
- dataInterval = dataZoomModel
- .getAxisProxy(dimNames.name, axisIndex)
- .getDataValueWindow();
- axis = this.ecModel.getComponent(dimNames.axis, axisIndex).axis;
- }
- }, this);
-
- if (dataInterval) {
- labelTexts = [
- this._formatLabel(dataInterval[0], axis),
- this._formatLabel(dataInterval[1], axis)
- ];
- }
- }
-
- var orderedHandleEnds = asc(this._handleEnds.slice());
-
- setLabel.call(this, 0);
- setLabel.call(this, 1);
-
- function setLabel(handleIndex) {
- // Label
- // Text should not transform by barGroup.
- var barTransform = graphic.getTransform(
- displaybles.handles[handleIndex], this.group
- );
- var direction = graphic.transformDirection(
- handleIndex === 0 ? 'right' : 'left', barTransform
- );
- var offset = this._halfHandleSize + LABEL_GAP;
- var textPoint = graphic.applyTransform(
- [
- orderedHandleEnds[handleIndex] + (handleIndex === 0 ? -offset : offset),
- this._size[1] / 2
- ],
- barTransform
- );
- handleLabels[handleIndex].setStyle({
- x: textPoint[0],
- y: textPoint[1],
- textVerticalAlign: orient === HORIZONTAL ? 'middle' : direction,
- textAlign: orient === HORIZONTAL ? direction : 'center',
- text: labelTexts[handleIndex]
- });
- }
- },
-
- /**
- * @private
- */
- _formatLabel: function (value, axis) {
- var dataZoomModel = this.dataZoomModel;
- var labelFormatter = dataZoomModel.get('labelFormatter');
- if (zrUtil.isFunction(labelFormatter)) {
- return labelFormatter(value);
- }
-
- var labelPrecision = dataZoomModel.get('labelPrecision');
- if (labelPrecision == null || labelPrecision === 'auto') {
- labelPrecision = axis.getPixelPrecision();
- }
-
- value = (value == null && isNaN(value))
- ? ''
- // FIXME Glue code
- : (axis.type === 'category' || axis.type === 'time')
- ? axis.scale.getLabel(Math.round(value))
- // param of toFixed should less then 20.
- : value.toFixed(Math.min(labelPrecision, 20));
-
- if (zrUtil.isString(labelFormatter)) {
- value = labelFormatter.replace('{value}', value);
- }
-
- return value;
- },
-
- /**
- * @private
- * @param {boolean} showOrHide true: show, false: hide
- */
- _showDataInfo: function (showOrHide) {
- // Always show when drgging.
- showOrHide = this._dragging || showOrHide;
-
- var handleLabels = this._displayables.handleLabels;
- handleLabels[0].attr('invisible', !showOrHide);
- handleLabels[1].attr('invisible', !showOrHide);
- },
-
- _onDragMove: function (handleIndex, dx, dy) {
- this._dragging = true;
-
- // Transform dx, dy to bar coordination.
- var vertex = this._applyBarTransform([dx, dy], true);
-
- this._updateInterval(handleIndex, vertex[0]);
- this._updateView();
-
- if (this.dataZoomModel.get('realtime')) {
- this._dispatchZoomAction();
- }
- },
-
- _onDragEnd: function () {
- this._dragging = false;
- this._showDataInfo(false);
- this._dispatchZoomAction();
- },
-
- /**
- * This action will be throttled.
- * @private
- */
- _dispatchZoomAction: function () {
- var range = this._range;
-
- this.api.dispatchAction({
- type: 'dataZoom',
- from: this.uid,
- dataZoomId: this.dataZoomModel.id,
- start: range[0],
- end: range[1]
- });
- },
-
- /**
- * @private
- */
- _applyBarTransform: function (vertex, inverse) {
- var barTransform = this._displayables.barGroup.getLocalTransform();
- return graphic.applyTransform(vertex, barTransform, inverse);
- },
-
- /**
- * @private
- */
- _findCoordRect: function () {
- // Find the grid coresponding to the first axis referred by dataZoom.
- var targetInfo = this.getTargetInfo();
-
- // FIXME
- // 判断是catesian还是polar
- var rect;
- if (targetInfo.cartesians.length) {
- rect = targetInfo.cartesians[0].model.coordinateSystem.getRect();
- }
- else { // Polar
- // FIXME
- // 暂时随便写的
- var width = this.api.getWidth();
- var height = this.api.getHeight();
- rect = {
- x: width * 0.2,
- y: height * 0.2,
- width: width * 0.6,
- height: height * 0.6
- };
- }
-
- return rect;
- }
-
- });
-
- function getOtherDim(thisDim) {
- // FIXME
- // 这个逻辑和getOtherAxis里一致,但是写在这里是否不好
- return thisDim === 'x' ? 'y' : 'x';
- }
-
- module.exports = SliderZoomView;
-
-
-
-/***/ },
-/* 293 */
-/***/ function(module, exports) {
-
-
-
- var lib = {};
-
- var ORIGIN_METHOD = '\0__throttleOriginMethod';
- var RATE = '\0__throttleRate';
-
- /**
- * 频率控制 返回函数连续调用时,fn 执行频率限定为每多少时间执行一次
- * 例如常见效果:
- * notifyWhenChangesStop
- * 频繁调用时,只保证最后一次执行
- * 配成:trailing:true;debounce:true 即可
- * notifyAtFixRate
- * 频繁调用时,按规律心跳执行
- * 配成:trailing:true;debounce:false 即可
- * 注意:
- * 根据model更新view的时候,可以使用throttle,
- * 但是根据view更新model的时候,避免使用这种延迟更新的方式。
- * 因为这可能导致model和server同步出现问题。
- *
- * @public
- * @param {(Function|Array.<Function>)} fn 需要调用的函数
- * 如果fn为array,则表示可以对多个函数进行throttle。
- * 他们共享同一个timer。
- * @param {number} delay 延迟时间,单位毫秒
- * @param {bool} trailing 是否保证最后一次触发的执行
- * true:表示保证最后一次调用会触发执行。
- * 但任何调用后不可能立即执行,总会delay。
- * false:表示不保证最后一次调用会触发执行。
- * 但只要间隔大于delay,调用就会立即执行。
- * @param {bool} debounce 节流
- * true:表示:频繁调用(间隔小于delay)时,根本不执行
- * false:表示:频繁调用(间隔小于delay)时,按规律心跳执行
- * @return {(Function|Array.<Function>)} 实际调用函数。
- * 当输入的fn为array时,返回值也为array。
- * 每项是Function。
- */
- lib.throttle = function (fn, delay, trailing, debounce) {
-
- var currCall = (new Date()).getTime();
- var lastCall = 0;
- var lastExec = 0;
- var timer = null;
- var diff;
- var scope;
- var args;
- var isSingle = typeof fn === 'function';
- delay = delay || 0;
-
- if (isSingle) {
- return createCallback();
- }
- else {
- var ret = [];
- for (var i = 0; i < fn.length; i++) {
- ret[i] = createCallback(i);
- }
- return ret;
- }
-
- function createCallback(index) {
-
- function exec() {
- lastExec = (new Date()).getTime();
- timer = null;
- (isSingle ? fn : fn[index]).apply(scope, args || []);
- }
-
- var cb = function () {
- currCall = (new Date()).getTime();
- scope = this;
- args = arguments;
- diff = currCall - (debounce ? lastCall : lastExec) - delay;
-
- clearTimeout(timer);
-
- if (debounce) {
- if (trailing) {
- timer = setTimeout(exec, delay);
- }
- else if (diff >= 0) {
- exec();
- }
- }
- else {
- if (diff >= 0) {
- exec();
- }
- else if (trailing) {
- timer = setTimeout(exec, -diff);
- }
- }
-
- lastCall = currCall;
- };
-
- /**
- * Clear throttle.
- * @public
- */
- cb.clear = function () {
- if (timer) {
- clearTimeout(timer);
- timer = null;
- }
- };
-
- return cb;
- }
- };
-
- /**
- * 按一定频率执行,最后一次调用总归会执行
- *
- * @public
- */
- lib.fixRate = function (fn, delay) {
- return delay != null
- ? lib.throttle(fn, delay, true, false)
- : fn;
- };
-
- /**
- * 直到不频繁调用了才会执行,最后一次调用总归会执行
- *
- * @public
- */
- lib.debounce = function (fn, delay) {
- return delay != null
- ? lib.throttle(fn, delay, true, true)
- : fn;
- };
-
-
- /**
- * Create throttle method or update throttle rate.
- *
- * @example
- * ComponentView.prototype.render = function () {
- * ...
- * throttle.createOrUpdate(
- * this,
- * '_dispatchAction',
- * this.model.get('throttle'),
- * 'fixRate'
- * );
- * };
- * ComponentView.prototype.remove = function () {
- * throttle.clear(this, '_dispatchAction');
- * };
- * ComponentView.prototype.dispose = function () {
- * throttle.clear(this, '_dispatchAction');
- * };
- *
- * @public
- * @param {Object} obj
- * @param {string} fnAttr
- * @param {number} rate
- * @param {string} throttleType 'fixRate' or 'debounce'
- */
- lib.createOrUpdate = function (obj, fnAttr, rate, throttleType) {
- var fn = obj[fnAttr];
-
- if (!fn || rate == null || !throttleType) {
- return;
- }
-
- var originFn = fn[ORIGIN_METHOD] || fn;
- var lastRate = fn[RATE];
-
- if (lastRate !== rate) {
- fn = obj[fnAttr] = lib[throttleType](originFn, rate);
- fn[ORIGIN_METHOD] = originFn;
- fn[RATE] = rate;
- }
- };
-
- /**
- * Clear throttle. Example see throttle.createOrUpdate.
- *
- * @public
- * @param {Object} obj
- * @param {string} fnAttr
- */
- lib.clear = function (obj, fnAttr) {
- var fn = obj[fnAttr];
- if (fn && fn[ORIGIN_METHOD]) {
- obj[fnAttr] = fn[ORIGIN_METHOD];
- }
- };
-
- module.exports = lib;
-
-
-
-/***/ },
-/* 294 */
-/***/ function(module, exports) {
-
-
-
- /**
- * Calculate slider move result.
- *
- * @param {number} delta Move length.
- * @param {Array.<number>} handleEnds handleEnds[0] and be bigger then handleEnds[1].
- * handleEnds will be modified in this method.
- * @param {Array.<number>} extent handleEnds is restricted by extent.
- * extent[0] should less or equals than extent[1].
- * @param {string} mode 'rigid': Math.abs(handleEnds[0] - handleEnds[1]) remain unchanged,
- * 'cross' handleEnds[0] can be bigger then handleEnds[1],
- * 'push' handleEnds[0] can not be bigger then handleEnds[1],
- * when they touch, one push other.
- * @param {number} handleIndex If mode is 'rigid', handleIndex is not required.
- * @param {Array.<number>} The input handleEnds.
- */
- module.exports = function (delta, handleEnds, extent, mode, handleIndex) {
- if (!delta) {
- return handleEnds;
- }
-
- if (mode === 'rigid') {
- delta = getRealDelta(delta, handleEnds, extent);
- handleEnds[0] += delta;
- handleEnds[1] += delta;
- }
- else {
- delta = getRealDelta(delta, handleEnds[handleIndex], extent);
- handleEnds[handleIndex] += delta;
-
- if (mode === 'push' && handleEnds[0] > handleEnds[1]) {
- handleEnds[1 - handleIndex] = handleEnds[handleIndex];
- }
- }
-
- return handleEnds;
-
- function getRealDelta(delta, handleEnds, extent) {
- var handleMinMax = !handleEnds.length
- ? [handleEnds, handleEnds]
- : handleEnds.slice();
- handleEnds[0] > handleEnds[1] && handleMinMax.reverse();
-
- if (delta < 0 && handleMinMax[0] + delta < extent[0]) {
- delta = extent[0] - handleMinMax[0];
- }
- if (delta > 0 && handleMinMax[1] + delta > extent[1]) {
- delta = extent[1] - handleMinMax[1];
- }
- return delta;
- }
- };
-
-
-/***/ },
-/* 295 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Data zoom model
- */
-
-
- module.exports = __webpack_require__(288).extend({
-
- type: 'dataZoom.inside',
-
- /**
- * @protected
- */
- defaultOption: {
- zoomLock: false // Whether disable zoom but only pan.
- }
- });
-
-
-/***/ },
-/* 296 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var DataZoomView = __webpack_require__(290);
- var zrUtil = __webpack_require__(3);
- var sliderMove = __webpack_require__(294);
- var roams = __webpack_require__(297);
- var bind = zrUtil.bind;
-
- var InsideZoomView = DataZoomView.extend({
-
- type: 'dataZoom.inside',
-
- /**
- * @override
- */
- init: function (ecModel, api) {
- /**
- * 'throttle' is used in this.dispatchAction, so we save range
- * to avoid missing some 'pan' info.
- * @private
- * @type {Array.<number>}
- */
- this._range;
- },
-
- /**
- * @override
- */
- render: function (dataZoomModel, ecModel, api, payload) {
- InsideZoomView.superApply(this, 'render', arguments);
-
- // Notice: origin this._range should be maintained, and should not be re-fetched
- // from dataZoomModel when payload.type is 'dataZoom', otherwise 'pan' or 'zoom'
- // info will be missed because of 'throttle' of this.dispatchAction.
- if (roams.shouldRecordRange(payload, dataZoomModel.id)) {
- this._range = dataZoomModel.getPercentRange();
- }
-
- // Reset controllers.
- var coordInfoList = this.getTargetInfo().cartesians;
- var allCoordIds = zrUtil.map(coordInfoList, function (coordInfo) {
- return roams.generateCoordId(coordInfo.model);
- });
- zrUtil.each(coordInfoList, function (coordInfo) {
- var coordModel = coordInfo.model;
- roams.register(
- api,
- {
- coordId: roams.generateCoordId(coordModel),
- allCoordIds: allCoordIds,
- coordinateSystem: coordModel.coordinateSystem,
- dataZoomId: dataZoomModel.id,
- throttleRage: dataZoomModel.get('throttle', true),
- panGetRange: bind(this._onPan, this, coordInfo),
- zoomGetRange: bind(this._onZoom, this, coordInfo)
- }
- );
- }, this);
-
- // TODO
- // polar支持
- },
-
- /**
- * @override
- */
- remove: function () {
- roams.unregister(this.api, this.dataZoomModel.id);
- InsideZoomView.superApply(this, 'remove', arguments);
- this._range = null;
- },
-
- /**
- * @override
- */
- dispose: function () {
- roams.unregister(this.api, this.dataZoomModel.id);
- InsideZoomView.superApply(this, 'dispose', arguments);
- this._range = null;
- },
-
- /**
- * @private
- */
- _onPan: function (coordInfo, controller, dx, dy) {
- return (
- this._range = panCartesian(
- [dx, dy], this._range, controller, coordInfo
- )
- );
- },
-
- /**
- * @private
- */
- _onZoom: function (coordInfo, controller, scale, mouseX, mouseY) {
- var dataZoomModel = this.dataZoomModel;
-
- if (dataZoomModel.option.zoomLock) {
- return this._range;
- }
-
- return (
- this._range = scaleCartesian(
- 1 / scale, [mouseX, mouseY], this._range,
- controller, coordInfo, dataZoomModel
- )
- );
- }
-
- });
-
- function panCartesian(pixelDeltas, range, controller, coordInfo) {
- range = range.slice();
-
- // Calculate transform by the first axis.
- var axisModel = coordInfo.axisModels[0];
- if (!axisModel) {
- return;
- }
-
- var directionInfo = getDirectionInfo(pixelDeltas, axisModel, controller);
-
- var percentDelta = directionInfo.signal
- * (range[1] - range[0])
- * directionInfo.pixel / directionInfo.pixelLength;
-
- sliderMove(
- percentDelta,
- range,
- [0, 100],
- 'rigid'
- );
-
- return range;
- }
-
- function scaleCartesian(scale, mousePoint, range, controller, coordInfo, dataZoomModel) {
- range = range.slice();
-
- // Calculate transform by the first axis.
- var axisModel = coordInfo.axisModels[0];
- if (!axisModel) {
- return;
- }
-
- var directionInfo = getDirectionInfo(mousePoint, axisModel, controller);
-
- var mouse = directionInfo.pixel - directionInfo.pixelStart;
- var percentPoint = mouse / directionInfo.pixelLength * (range[1] - range[0]) + range[0];
-
- scale = Math.max(scale, 0);
- range[0] = (range[0] - percentPoint) * scale + percentPoint;
- range[1] = (range[1] - percentPoint) * scale + percentPoint;
-
- return fixRange(range);
- }
-
- function getDirectionInfo(xy, axisModel, controller) {
- var axis = axisModel.axis;
- var rect = controller.rect;
- var ret = {};
-
- if (axis.dim === 'x') {
- ret.pixel = xy[0];
- ret.pixelLength = rect.width;
- ret.pixelStart = rect.x;
- ret.signal = axis.inverse ? 1 : -1;
- }
- else { // axis.dim === 'y'
- ret.pixel = xy[1];
- ret.pixelLength = rect.height;
- ret.pixelStart = rect.y;
- ret.signal = axis.inverse ? -1 : 1;
- }
-
- return ret;
- }
-
- function fixRange(range) {
- // Clamp, using !(<= or >=) to handle NaN.
- // jshint ignore:start
- var bound = [0, 100];
- !(range[0] <= bound[1]) && (range[0] = bound[1]);
- !(range[1] <= bound[1]) && (range[1] = bound[1]);
- !(range[0] >= bound[0]) && (range[0] = bound[0]);
- !(range[1] >= bound[0]) && (range[1] = bound[0]);
- // jshint ignore:end
-
- return range;
- }
-
- module.exports = InsideZoomView;
-
-
-/***/ },
-/* 297 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Roam controller manager.
- */
-
-
- // Only create one roam controller for each coordinate system.
- // one roam controller might be refered by two inside data zoom
- // components (for example, one for x and one for y). When user
- // pan or zoom, only dispatch one action for those data zoom
- // components.
-
- var zrUtil = __webpack_require__(3);
- var RoamController = __webpack_require__(159);
- var throttle = __webpack_require__(293);
- var curry = zrUtil.curry;
-
- var ATTR = '\0_ec_dataZoom_roams';
-
- var roams = {
-
- /**
- * @public
- * @param {module:echarts/ExtensionAPI} api
- * @param {Object} dataZoomInfo
- * @param {string} dataZoomInfo.coordId
- * @param {Object} dataZoomInfo.coordinateSystem
- * @param {Array.<string>} dataZoomInfo.allCoordIds
- * @param {string} dataZoomInfo.dataZoomId
- * @param {number} dataZoomInfo.throttleRate
- * @param {Function} dataZoomInfo.panGetRange
- * @param {Function} dataZoomInfo.zoomGetRange
- */
- register: function (api, dataZoomInfo) {
- var store = giveStore(api);
- var theDataZoomId = dataZoomInfo.dataZoomId;
- var theCoordId = dataZoomInfo.coordId;
-
- // Do clean when a dataZoom changes its target coordnate system.
- zrUtil.each(store, function (record, coordId) {
- var dataZoomInfos = record.dataZoomInfos;
- if (dataZoomInfos[theDataZoomId]
- && zrUtil.indexOf(dataZoomInfo.allCoordIds, theCoordId) < 0
- ) {
- delete dataZoomInfos[theDataZoomId];
- record.count--;
- }
- });
-
- cleanStore(store);
-
- var record = store[theCoordId];
-
- // Create if needed.
- if (!record) {
- record = store[theCoordId] = {
- coordId: theCoordId,
- dataZoomInfos: {},
- count: 0
- };
- record.controller = createController(api, dataZoomInfo, record);
- record.dispatchAction = zrUtil.curry(dispatchAction, api);
- }
-
- // Consider resize, area should be always updated.
- record.controller.rect = dataZoomInfo.coordinateSystem.getRect().clone();
-
- // Update throttle.
- throttle.createOrUpdate(
- record,
- 'dispatchAction',
- dataZoomInfo.throttleRate,
- 'fixRate'
- );
-
- // Update reference of dataZoom.
- !(record.dataZoomInfos[theDataZoomId]) && record.count++;
- record.dataZoomInfos[theDataZoomId] = dataZoomInfo;
- },
-
- /**
- * @public
- * @param {module:echarts/ExtensionAPI} api
- * @param {string} dataZoomId
- */
- unregister: function (api, dataZoomId) {
- var store = giveStore(api);
-
- zrUtil.each(store, function (record) {
- var dataZoomInfos = record.dataZoomInfos;
- if (dataZoomInfos[dataZoomId]) {
- delete dataZoomInfos[dataZoomId];
- record.count--;
- }
- });
-
- cleanStore(store);
- },
-
- /**
- * @public
- */
- shouldRecordRange: function (payload, dataZoomId) {
- if (payload && payload.type === 'dataZoom' && payload.batch) {
- for (var i = 0, len = payload.batch.length; i < len; i++) {
- if (payload.batch[i].dataZoomId === dataZoomId) {
- return false;
- }
- }
- }
- return true;
- },
-
- /**
- * @public
- */
- generateCoordId: function (coordModel) {
- return coordModel.type + '\0_' + coordModel.id;
- }
- };
-
- /**
- * Key: coordId, value: {dataZoomInfos: [], count, controller}
- * @type {Array.<Object>}
- */
- function giveStore(api) {
- // Mount store on zrender instance, so that we do not
- // need to worry about dispose.
- var zr = api.getZr();
- return zr[ATTR] || (zr[ATTR] = {});
- }
-
- function createController(api, dataZoomInfo, newRecord) {
- var controller = new RoamController(api.getZr());
- controller.enable();
- controller.on('pan', curry(onPan, newRecord));
- controller.on('zoom', curry(onZoom, newRecord));
-
- return controller;
- }
-
- function cleanStore(store) {
- zrUtil.each(store, function (record, coordId) {
- if (!record.count) {
- record.controller.off('pan').off('zoom');
- delete store[coordId];
- }
- });
- }
-
- function onPan(record, dx, dy) {
- wrapAndDispatch(record, function (info) {
- return info.panGetRange(record.controller, dx, dy);
- });
- }
-
- function onZoom(record, scale, mouseX, mouseY) {
- wrapAndDispatch(record, function (info) {
- return info.zoomGetRange(record.controller, scale, mouseX, mouseY);
- });
- }
-
- function wrapAndDispatch(record, getRange) {
- var batch = [];
-
- zrUtil.each(record.dataZoomInfos, function (info) {
- var range = getRange(info);
- range && batch.push({
- dataZoomId: info.dataZoomId,
- start: range[0],
- end: range[1]
- });
- });
-
- record.dispatchAction(batch);
- }
-
- /**
- * This action will be throttled.
- */
- function dispatchAction(api, batch) {
- api.dispatchAction({
- type: 'dataZoom',
- batch: batch
- });
- }
-
- module.exports = roams;
-
-
-
-/***/ },
-/* 298 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Data zoom processor
- */
-
-
- var echarts = __webpack_require__(1);
-
- echarts.registerProcessor('filter', function (ecModel, api) {
-
- ecModel.eachComponent('dataZoom', function (dataZoomModel) {
- // We calculate window and reset axis here but not in model
- // init stage and not after action dispatch handler, because
- // reset should be called after seriesData.restoreData.
- dataZoomModel.eachTargetAxis(resetSingleAxis);
-
- // Caution: data zoom filtering is order sensitive when using
- // percent range and no min/max/scale set on axis.
- // For example, we have dataZoom definition:
- // [
- // {xAxisIndex: 0, start: 30, end: 70},
- // {yAxisIndex: 0, start: 20, end: 80}
- // ]
- // In this case, [20, 80] of y-dataZoom should be based on data
- // that have filtered by x-dataZoom using range of [30, 70],
- // but should not be based on full raw data. Thus sliding
- // x-dataZoom will change both ranges of xAxis and yAxis,
- // while sliding y-dataZoom will only change the range of yAxis.
- // So we should filter x-axis after reset x-axis immediately,
- // and then reset y-axis and filter y-axis.
- dataZoomModel.eachTargetAxis(filterSingleAxis);
- });
-
- ecModel.eachComponent('dataZoom', function (dataZoomModel) {
- // Fullfill all of the range props so that user
- // is able to get them from chart.getOption().
- var axisProxy = dataZoomModel.findRepresentativeAxisProxy();
- var percentRange = axisProxy.getDataPercentWindow();
- var valueRange = axisProxy.getDataValueWindow();
- dataZoomModel.setRawRange({
- start: percentRange[0],
- end: percentRange[1],
- startValue: valueRange[0],
- endValue: valueRange[1]
- });
- });
- });
-
- function resetSingleAxis(dimNames, axisIndex, dataZoomModel) {
- dataZoomModel.getAxisProxy(dimNames.name, axisIndex).reset(dataZoomModel);
- }
-
- function filterSingleAxis(dimNames, axisIndex, dataZoomModel) {
- dataZoomModel.getAxisProxy(dimNames.name, axisIndex).filterData(dataZoomModel);
- }
-
-
-
-
-/***/ },
-/* 299 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Data zoom action
- */
-
-
- var zrUtil = __webpack_require__(3);
- var modelUtil = __webpack_require__(5);
- var echarts = __webpack_require__(1);
-
-
- echarts.registerAction('dataZoom', function (payload, ecModel) {
-
- var linkedNodesFinder = modelUtil.createLinkedNodesFinder(
- zrUtil.bind(ecModel.eachComponent, ecModel, 'dataZoom'),
- modelUtil.eachAxisDim,
- function (model, dimNames) {
- return model.get(dimNames.axisIndex);
- }
- );
-
- var effectedModels = [];
-
- ecModel.eachComponent(
- {mainType: 'dataZoom', query: payload},
- function (model, index) {
- effectedModels.push.apply(
- effectedModels, linkedNodesFinder(model).nodes
- );
- }
- );
-
- zrUtil.each(effectedModels, function (dataZoomModel, index) {
- dataZoomModel.setRawRange({
- start: payload.start,
- end: payload.end,
- startValue: payload.startValue,
- endValue: payload.endValue
- });
- });
-
- });
-
-
-
-/***/ },
-/* 300 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * visualMap component entry
- */
-
-
- __webpack_require__(301);
- __webpack_require__(312);
-
-
-
-/***/ },
-/* 301 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * DataZoom component entry
- */
-
-
- __webpack_require__(1).registerPreprocessor(
- __webpack_require__(302)
- );
-
- __webpack_require__(303);
- __webpack_require__(304);
- __webpack_require__(305);
- __webpack_require__(308);
- __webpack_require__(311);
-
-
-
-/***/ },
-/* 302 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file VisualMap preprocessor
- */
-
-
- var zrUtil = __webpack_require__(3);
- var each = zrUtil.each;
-
- module.exports = function (option) {
- var visualMap = option && option.visualMap;
-
- if (!zrUtil.isArray(visualMap)) {
- visualMap = visualMap ? [visualMap] : [];
- }
-
- each(visualMap, function (opt) {
- if (!opt) {
- return;
- }
-
- // rename splitList to pieces
- if (has(opt, 'splitList') && !has(opt, 'pieces')) {
- opt.pieces = opt.splitList;
- delete opt.splitList;
- }
-
- var pieces = opt.pieces;
- if (pieces && zrUtil.isArray(pieces)) {
- each(pieces, function (piece) {
- if (zrUtil.isObject(piece)) {
- if (has(piece, 'start') && !has(piece, 'min')) {
- piece.min = piece.start;
- }
- if (has(piece, 'end') && !has(piece, 'max')) {
- piece.max = piece.end;
- }
- }
- });
- }
- });
- };
-
- function has(obj, name) {
- return obj && obj.hasOwnProperty && obj.hasOwnProperty(name);
- }
-
-
-
-/***/ },
-/* 303 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- __webpack_require__(19).registerSubTypeDefaulter('visualMap', function (option) {
- // Compatible with ec2, when splitNumber === 0, continuous visualMap will be used.
- return (
- !option.categories
- && (
- !(
- option.pieces
- ? option.pieces.length > 0
- : option.splitNumber > 0
- )
- || option.calculable
- )
- )
- ? 'continuous' : 'piecewise';
- });
-
-
-
-/***/ },
-/* 304 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Data range visual coding.
- */
-
-
- var echarts = __webpack_require__(1);
- var VisualMapping = __webpack_require__(187);
- var zrUtil = __webpack_require__(3);
-
- echarts.registerVisualCoding('component', function (ecModel) {
- ecModel.eachComponent('visualMap', function (visualMapModel) {
- processSingleVisualMap(visualMapModel, ecModel);
- });
- });
-
- function processSingleVisualMap(visualMapModel, ecModel) {
- var visualMappings = visualMapModel.targetVisuals;
- var visualTypesMap = {};
- zrUtil.each(['inRange', 'outOfRange'], function (state) {
- var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]);
- visualTypesMap[state] = visualTypes;
- });
-
- visualMapModel.eachTargetSeries(function (seriesModel) {
- var data = seriesModel.getData();
- var dimension = visualMapModel.getDataDimension(data);
- var dataIndex;
-
- function getVisual(key) {
- return data.getItemVisual(dataIndex, key);
- }
-
- function setVisual(key, value) {
- data.setItemVisual(dataIndex, key, value);
- }
-
- data.each([dimension], function (value, index) {
- // For performance consideration, do not use curry.
- dataIndex = index;
- var valueState = visualMapModel.getValueState(value);
- var mappings = visualMappings[valueState];
- var visualTypes = visualTypesMap[valueState];
- for (var i = 0, len = visualTypes.length; i < len; i++) {
- var type = visualTypes[i];
- mappings[type] && mappings[type].applyVisual(value, getVisual, setVisual);
- }
- });
- });
- }
-
-
-
-
-/***/ },
-/* 305 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- /**
- * @file Data zoom model
- */
-
-
- var VisualMapModel = __webpack_require__(306);
- var zrUtil = __webpack_require__(3);
- var numberUtil = __webpack_require__(7);
-
- // Constant
- var DEFAULT_BAR_BOUND = [20, 140];
-
- var ContinuousModel = VisualMapModel.extend({
-
- type: 'visualMap.continuous',
-
- /**
- * @protected
- */
- defaultOption: {
- handlePosition: 'auto', // 'auto', 'left', 'right', 'top', 'bottom'
- calculable: false, // 是否值域漫游,启用后无视splitNumber和pieces,线性渐变
- range: [-Infinity, Infinity], // 当前选中范围
- hoverLink: true,
- realtime: true,
- itemWidth: null, // 值域图形宽度
- itemHeight: null // 值域图形高度
- },
-
- /**
- * @override
- */
- doMergeOption: function (newOption, isInit) {
- ContinuousModel.superApply(this, 'doMergeOption', arguments);
-
- this.resetTargetSeries(newOption, isInit);
- this.resetExtent();
-
- this.resetVisual(function (mappingOption) {
- mappingOption.mappingMethod = 'linear';
- });
-
- this._resetRange();
- },
-
- /**
- * @protected
- * @override
- */
- resetItemSize: function () {
- VisualMapModel.prototype.resetItemSize.apply(this, arguments);
-
- var itemSize = this.itemSize;
-
- this._orient === 'horizontal' && itemSize.reverse();
-
- (itemSize[0] == null || isNaN(itemSize[0])) && (itemSize[0] = DEFAULT_BAR_BOUND[0]);
- (itemSize[1] == null || isNaN(itemSize[1])) && (itemSize[1] = DEFAULT_BAR_BOUND[1]);
- },
-
- /**
- * @private
- */
- _resetRange: function () {
- var dataExtent = this.getExtent();
- var range = this.option.range;
- if (range[0] > range[1]) {
- range.reverse();
- }
- range[0] = Math.max(range[0], dataExtent[0]);
- range[1] = Math.min(range[1], dataExtent[1]);
- },
-
- /**
- * @protected
- * @override
- */
- completeVisualOption: function () {
- VisualMapModel.prototype.completeVisualOption.apply(this, arguments);
-
- zrUtil.each(this.stateList, function (state) {
- var symbolSize = this.option.controller[state].symbolSize;
- if (symbolSize && symbolSize[0] !== symbolSize[1]) {
- symbolSize[0] = 0; // For good looking.
- }
- }, this);
- },
-
- /**
- * @public
- * @override
- */
- setSelected: function (selected) {
- this.option.range = selected.slice();
- this._resetRange();
- },
-
- /**
- * @public
- */
- getSelected: function () {
- var dataExtent = this.getExtent();
-
- var dataInterval = numberUtil.asc(
- (this.get('range') || []).slice()
- );
-
- // Clamp
- dataInterval[0] > dataExtent[1] && (dataInterval[0] = dataExtent[1]);
- dataInterval[1] > dataExtent[1] && (dataInterval[1] = dataExtent[1]);
- dataInterval[0] < dataExtent[0] && (dataInterval[0] = dataExtent[0]);
- dataInterval[1] < dataExtent[0] && (dataInterval[1] = dataExtent[0]);
-
- return dataInterval;
- },
-
- /**
- * @public
- * @override
- */
- getValueState: function (value) {
- var range = this.option.range;
- var dataExtent = this.getExtent();
-
- // When range[0] === dataExtent[0], any value larger than dataExtent[0] maps to 'inRange'.
- // range[1] is processed likewise.
- return (
- (range[0] <= dataExtent[0] || range[0] <= value)
- && (range[1] >= dataExtent[1] || value <= range[1])
- ) ? 'inRange' : 'outOfRange';
- }
-
- });
-
- module.exports = ContinuousModel;
-
-
-
-/***/ },
-/* 306 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Data zoom model
- */
-
-
- var zrUtil = __webpack_require__(3);
- var env = __webpack_require__(78);
- var echarts = __webpack_require__(1);
- var modelUtil = __webpack_require__(5);
- var visualDefault = __webpack_require__(307);
- var VisualMapping = __webpack_require__(187);
- var mapVisual = VisualMapping.mapVisual;
- var eachVisual = VisualMapping.eachVisual;
- var numberUtil = __webpack_require__(7);
- var isArray = zrUtil.isArray;
- var each = zrUtil.each;
- var asc = numberUtil.asc;
- var linearMap = numberUtil.linearMap;
-
- var VisualMapModel = echarts.extendComponentModel({
-
- type: 'visualMap',
-
- dependencies: ['series'],
-
- /**
- * [lowerBound, upperBound]
- *
- * @readOnly
- * @type {Array.<number>}
- */
- dataBound: [-Infinity, Infinity],
-
- /**
- * @readOnly
- * @type {Array.<string>}
- */
- stateList: ['inRange', 'outOfRange'],
-
- /**
- * @readOnly
- * @type {string|Object}
- */
- layoutMode: {type: 'box', ignoreSize: true},
-
- /**
- * @protected
- */
- defaultOption: {
- show: true,
-
- zlevel: 0,
- z: 4,
-
- // set min: 0, max: 200, only for campatible with ec2.
- // In fact min max should not have default value.
- min: 0, // min value, must specified if pieces is not specified.
- max: 200, // max value, must specified if pieces is not specified.
-
- dimension: null,
- inRange: null, // 'color', 'colorHue', 'colorSaturation', 'colorLightness', 'colorAlpha',
- // 'symbol', 'symbolSize'
- outOfRange: null, // 'color', 'colorHue', 'colorSaturation',
- // 'colorLightness', 'colorAlpha',
- // 'symbol', 'symbolSize'
-
- left: 0, // 'center' ¦ 'left' ¦ 'right' ¦ {number} (px)
- right: null, // The same as left.
- top: null, // 'top' ¦ 'bottom' ¦ 'center' ¦ {number} (px)
- bottom: 0, // The same as top.
-
- itemWidth: null,
- itemHeight: null,
- inverse: false,
- orient: 'vertical', // 'horizontal' ¦ 'vertical'
-
- seriesIndex: null, // 所控制的series indices,默认所有有value的series.
- backgroundColor: 'rgba(0,0,0,0)',
- borderColor: '#ccc', // 值域边框颜色
- contentColor: '#5793f3',
- inactiveColor: '#aaa',
- borderWidth: 0, // 值域边框线宽,单位px,默认为0(无边框)
- padding: 5, // 值域内边距,单位px,默认各方向内边距为5,
- // 接受数组分别设定上右下左边距,同css
- textGap: 10, //
- precision: 0, // 小数精度,默认为0,无小数点
- color: ['#bf444c', '#d88273', '#f6efa6'], //颜色(deprecated,兼容ec2,顺序同pieces,不同于inRange/outOfRange)
-
- formatter: null,
- text: null, // 文本,如['高', '低'],兼容ec2,text[0]对应高值,text[1]对应低值
- textStyle: {
- color: '#333' // 值域文字颜色
- }
- },
-
- /**
- * @protected
- */
- init: function (option, parentModel, ecModel) {
- /**
- * @private
- * @type {boolean}
- */
- this._autoSeriesIndex = false;
-
- /**
- * @private
- * @type {Array.<number>}
- */
- this._dataExtent;
-
- /**
- * @readOnly
- */
- this.controllerVisuals = {};
-
- /**
- * @readOnly
- */
- this.targetVisuals = {};
-
- /**
- * @readOnly
- */
- this.textStyleModel;
-
- /**
- * [width, height]
- * @readOnly
- * @type {Array.<number>}
- */
- this.itemSize;
-
- this.mergeDefaultAndTheme(option, ecModel);
-
- this.doMergeOption({}, true);
- },
-
- /**
- * @public
- */
- mergeOption: function (option) {
- VisualMapModel.superApply(this, 'mergeOption', arguments);
- this.doMergeOption(option, false);
- },
-
- /**
- * @protected
- */
- doMergeOption: function (newOption, isInit) {
- var thisOption = this.option;
-
- // Visual attributes merge is not supported, otherwise it
- // brings overcomplicated merge logic. See #2853.
- !isInit && replaceVisualOption(thisOption, newOption);
-
- // FIXME
- // necessary?
- // Disable realtime view update if canvas is not supported.
- if (!env.canvasSupported) {
- thisOption.realtime = false;
- }
-
- this.textStyleModel = this.getModel('textStyle');
-
- this.resetItemSize();
-
- this.completeVisualOption();
- },
-
- /**
- * @example
- * this.formatValueText(someVal); // format single numeric value to text.
- * this.formatValueText(someVal, true); // format single category value to text.
- * this.formatValueText([min, max]); // format numeric min-max to text.
- * this.formatValueText([this.dataBound[0], max]); // using data lower bound.
- * this.formatValueText([min, this.dataBound[1]]); // using data upper bound.
- *
- * @param {number|Array.<number>} value Real value, or this.dataBound[0 or 1].
- * @param {boolean} [isCategory=false] Only available when value is number.
- * @return {string}
- * @protected
- */
- formatValueText: function(value, isCategory) {
- var option = this.option;
- var precision = option.precision;
- var dataBound = this.dataBound;
- var formatter = option.formatter;
- var isMinMax;
- var textValue;
-
- if (zrUtil.isArray(value)) {
- value = value.slice();
- isMinMax = true;
- }
-
- textValue = isCategory
- ? value
- : (isMinMax
- ? [toFixed(value[0]), toFixed(value[1])]
- : toFixed(value)
- );
-
- if (zrUtil.isString(formatter)) {
- return formatter
- .replace('{value}', isMinMax ? textValue[0] : textValue)
- .replace('{value2}', isMinMax ? textValue[1] : textValue);
- }
- else if (zrUtil.isFunction(formatter)) {
- return isMinMax
- ? formatter(value[0], value[1])
- : formatter(value);
- }
-
- if (isMinMax) {
- if (value[0] === dataBound[0]) {
- return '< ' + textValue[1];
- }
- else if (value[1] === dataBound[1]) {
- return '> ' + textValue[0];
- }
- else {
- return textValue[0] + ' - ' + textValue[1];
- }
- }
- else { // Format single value (includes category case).
- return textValue;
- }
-
- function toFixed(val) {
- return val === dataBound[0]
- ? 'min'
- : val === dataBound[1]
- ? 'max'
- : (+val).toFixed(precision);
- }
- },
-
- /**
- * @protected
- */
- resetTargetSeries: function (newOption, isInit) {
- var thisOption = this.option;
- var autoSeriesIndex = this._autoSeriesIndex =
- (isInit ? thisOption : newOption).seriesIndex == null;
- thisOption.seriesIndex = autoSeriesIndex
- ? [] : modelUtil.normalizeToArray(thisOption.seriesIndex);
-
- autoSeriesIndex && this.ecModel.eachSeries(function (seriesModel, index) {
- var data = seriesModel.getData();
- // FIXME
- // 只考虑了list,还没有考虑map等。
-
- // FIXME
- // 这里可能应该这么判断:data.dimensions中有超出其所属coordSystem的量。
- if (data.type === 'list') {
- thisOption.seriesIndex.push(index);
- }
- });
- },
-
- /**
- * @protected
- */
- resetExtent: function () {
- var thisOption = this.option;
-
- // Can not calculate data extent by data here.
- // Because series and data may be modified in processing stage.
- // So we do not support the feature "auto min/max".
-
- var extent = asc([thisOption.min, thisOption.max]);
-
- this._dataExtent = extent;
- },
-
- /**
- * @protected
- */
- getDataDimension: function (list) {
- var optDim = this.option.dimension;
- return optDim != null
- ? optDim : list.dimensions.length - 1;
- },
-
- /**
- * @public
- * @override
- */
- getExtent: function () {
- return this._dataExtent.slice();
- },
-
- /**
- * @protected
- */
- resetVisual: function (fillVisualOption) {
- var dataExtent = this.getExtent();
-
- doReset.call(this, 'controller', this.controllerVisuals);
- doReset.call(this, 'target', this.targetVisuals);
-
- function doReset(baseAttr, visualMappings) {
- each(this.stateList, function (state) {
- var mappings = visualMappings[state] || (visualMappings[state] = {});
- var visaulOption = this.option[baseAttr][state] || {};
- each(visaulOption, function (visualData, visualType) {
- if (!VisualMapping.isValidType(visualType)) {
- return;
- }
- var mappingOption = {
- type: visualType,
- dataExtent: dataExtent,
- visual: visualData
- };
- fillVisualOption && fillVisualOption.call(this, mappingOption, state);
- mappings[visualType] = new VisualMapping(mappingOption);
- }, this);
- }, this);
- }
- },
-
- /**
- * @protected
- */
- completeVisualOption: function () {
- var thisOption = this.option;
- var base = {inRange: thisOption.inRange, outOfRange: thisOption.outOfRange};
-
- var target = thisOption.target || (thisOption.target = {});
- var controller = thisOption.controller || (thisOption.controller = {});
-
- zrUtil.merge(target, base); // Do not override
- zrUtil.merge(controller, base); // Do not override
-
- var isCategory = this.isCategory();
-
- completeSingle.call(this, target);
- completeSingle.call(this, controller);
- completeInactive.call(this, target, 'inRange', 'outOfRange');
- completeInactive.call(this, target, 'outOfRange', 'inRange');
- completeController.call(this, controller);
-
- function completeSingle(base) {
- // Compatible with ec2 dataRange.color.
- // The mapping order of dataRange.color is: [high value, ..., low value]
- // whereas inRange.color and outOfRange.color is [low value, ..., high value]
- // Notice: ec2 has no inverse.
- if (isArray(thisOption.color)
- // If there has been inRange: {symbol: ...}, adding color is a mistake.
- // So adding color only when no inRange defined.
- && !base.inRange
- ) {
- base.inRange = {color: thisOption.color.slice().reverse()};
- }
-
- // If using shortcut like: {inRange: 'symbol'}, complete default value.
- each(this.stateList, function (state) {
- var visualType = base[state];
-
- if (zrUtil.isString(visualType)) {
- var defa = visualDefault.get(visualType, 'active', isCategory);
- if (defa) {
- base[state] = {};
- base[state][visualType] = defa;
- }
- else {
- // Mark as not specified.
- delete base[state];
- }
- }
- }, this);
- }
-
- function completeInactive(base, stateExist, stateAbsent) {
- var optExist = base[stateExist];
- var optAbsent = base[stateAbsent];
-
- if (optExist && !optAbsent) {
- optAbsent = base[stateAbsent] = {};
- each(optExist, function (visualData, visualType) {
- var defa = visualDefault.get(visualType, 'inactive', isCategory);
- if (VisualMapping.isValidType(visualType) && defa) {
- optAbsent[visualType] = defa;
- }
- });
- }
- }
-
- function completeController(controller) {
- var symbolExists = (controller.inRange || {}).symbol
- || (controller.outOfRange || {}).symbol;
- var symbolSizeExists = (controller.inRange || {}).symbolSize
- || (controller.outOfRange || {}).symbolSize;
- var inactiveColor = this.get('inactiveColor');
-
- each(this.stateList, function (state) {
-
- var itemSize = this.itemSize;
- var visuals = controller[state];
-
- // Set inactive color for controller if no other color attr (like colorAlpha) specified.
- if (!visuals) {
- visuals = controller[state] = {
- color: isCategory ? inactiveColor : [inactiveColor]
- };
- }
-
- // Consistent symbol and symbolSize if not specified.
- if (!visuals.symbol) {
- visuals.symbol = symbolExists
- && zrUtil.clone(symbolExists)
- || (isCategory ? 'roundRect' : ['roundRect']);
- }
- if (!visuals.symbolSize) {
- visuals.symbolSize = symbolSizeExists
- && zrUtil.clone(symbolSizeExists)
- || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]);
- }
-
- // Filter square and none.
- visuals.symbol = mapVisual(visuals.symbol, function (symbol) {
- return (symbol === 'none' || symbol === 'square') ? 'roundRect' : symbol;
- });
-
- // Normalize symbolSize
- var symbolSize = visuals.symbolSize;
-
- if (symbolSize) {
- var max = -Infinity;
- // symbolSize can be object when categories defined.
- eachVisual(symbolSize, function (value) {
- value > max && (max = value);
- });
- visuals.symbolSize = mapVisual(symbolSize, function (value) {
- return linearMap(value, [0, max], [0, itemSize[0]], true);
- });
- }
-
- }, this);
- }
- },
-
- /**
- * @public
- */
- eachTargetSeries: function (callback, context) {
- zrUtil.each(this.option.seriesIndex, function (seriesIndex) {
- callback.call(context, this.ecModel.getSeriesByIndex(seriesIndex));
- }, this);
- },
-
- /**
- * @public
- */
- isCategory: function () {
- return !!this.option.categories;
- },
-
- /**
- * @protected
- */
- resetItemSize: function () {
- this.itemSize = [
- parseFloat(this.get('itemWidth')),
- parseFloat(this.get('itemHeight'))
- ];
- },
-
- /**
- * @public
- * @abstract
- */
- setSelected: zrUtil.noop,
-
- /**
- * @public
- * @abstract
- */
- getValueState: zrUtil.noop
-
- });
-
- function replaceVisualOption(targetOption, sourceOption) {
- zrUtil.each(
- ['inRange', 'outOfRange', 'target', 'controller', 'color'],
- function (key) {
- if (sourceOption.hasOwnProperty(key)) {
- targetOption[key] = zrUtil.clone(sourceOption[key]);
- }
- else {
- delete targetOption[key];
- }
- }
- );
- }
-
- module.exports = VisualMapModel;
-
-
-
-/***/ },
-/* 307 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Visual mapping.
- */
-
-
- var zrUtil = __webpack_require__(3);
-
- var visualDefault = {
-
- /**
- * @public
- */
- get: function (visualType, key, isCategory) {
- var value = zrUtil.clone(
- (defaultOption[visualType] || {})[key]
- );
-
- return isCategory
- ? (zrUtil.isArray(value) ? value[value.length - 1] : value)
- : value;
- }
-
- };
-
- var defaultOption = {
-
- color: {
- active: ['#006edd', '#e0ffff'],
- inactive: ['rgba(0,0,0,0)']
- },
-
- colorHue: {
- active: [0, 360],
- inactive: [0, 0]
- },
-
- colorSaturation: {
- active: [0.3, 1],
- inactive: [0, 0]
- },
-
- colorLightness: {
- active: [0.9, 0.5],
- inactive: [0, 0]
- },
-
- colorAlpha: {
- active: [0.3, 1],
- inactive: [0, 0]
- },
-
- symbol: {
- active: ['circle', 'roundRect', 'diamond'],
- inactive: ['none']
- },
-
- symbolSize: {
- active: [10, 50],
- inactive: [0, 0]
- }
- };
-
- module.exports = visualDefault;
-
-
-
-
-/***/ },
-/* 308 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var VisualMapView = __webpack_require__(309);
- var graphic = __webpack_require__(42);
- var zrUtil = __webpack_require__(3);
- var numberUtil = __webpack_require__(7);
- var sliderMove = __webpack_require__(294);
- var linearMap = numberUtil.linearMap;
- var LinearGradient = __webpack_require__(75);
- var helper = __webpack_require__(310);
- var each = zrUtil.each;
-
- // Notice:
- // Any "interval" should be by the order of [low, high].
- // "handle0" (handleIndex === 0) maps to
- // low data value: this._dataInterval[0] and has low coord.
- // "handle1" (handleIndex === 1) maps to
- // high data value: this._dataInterval[1] and has high coord.
- // The logic of transform is implemented in this._createBarGroup.
-
- var ContinuousVisualMapView = VisualMapView.extend({
-
- type: 'visualMap.continuous',
-
- /**
- * @override
- */
- init: function () {
-
- VisualMapView.prototype.init.apply(this, arguments);
-
- /**
- * @private
- */
- this._shapes = {};
-
- /**
- * @private
- */
- this._dataInterval = [];
-
- /**
- * @private
- */
- this._handleEnds = [];
-
- /**
- * @private
- */
- this._orient;
-
- /**
- * @private
- */
- this._useHandle;
- },
-
- /**
- * @protected
- * @override
- */
- doRender: function (visualMapModel, ecModel, api, payload) {
- if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) {
- this._buildView();
- }
- else {
- this._updateView();
- }
- },
-
- /**
- * @private
- */
- _buildView: function () {
- this.group.removeAll();
-
- var visualMapModel = this.visualMapModel;
- var thisGroup = this.group;
-
- this._orient = visualMapModel.get('orient');
- this._useHandle = visualMapModel.get('calculable');
-
- this._resetInterval();
-
- this._renderBar(thisGroup);
-
- var dataRangeText = visualMapModel.get('text');
- this._renderEndsText(thisGroup, dataRangeText, 0);
- this._renderEndsText(thisGroup, dataRangeText, 1);
-
- // Do this for background size calculation.
- this._updateView(true);
-
- // After updating view, inner shapes is built completely,
- // and then background can be rendered.
- this.renderBackground(thisGroup);
-
- // Real update view
- this._updateView();
-
- this.positionGroup(thisGroup);
- },
-
- /**
- * @private
- */
- _renderEndsText: function (group, dataRangeText, endsIndex) {
- if (!dataRangeText) {
- return;
- }
-
- // Compatible with ec2, text[0] map to high value, text[1] map low value.
- var text = dataRangeText[1 - endsIndex];
- text = text != null ? text + '' : '';
-
- var visualMapModel = this.visualMapModel;
- var textGap = visualMapModel.get('textGap');
- var itemSize = visualMapModel.itemSize;
-
- var barGroup = this._shapes.barGroup;
- var position = this._applyTransform(
- [
- itemSize[0] / 2,
- endsIndex === 0 ? -textGap : itemSize[1] + textGap
- ],
- barGroup
- );
- var align = this._applyTransform(
- endsIndex === 0 ? 'bottom' : 'top',
- barGroup
- );
- var orient = this._orient;
- var textStyleModel = this.visualMapModel.textStyleModel;
-
- this.group.add(new graphic.Text({
- style: {
- x: position[0],
- y: position[1],
- textVerticalAlign: orient === 'horizontal' ? 'middle' : align,
- textAlign: orient === 'horizontal' ? align : 'center',
- text: text,
- textFont: textStyleModel.getFont(),
- fill: textStyleModel.getTextColor()
- }
- }));
- },
-
- /**
- * @private
- */
- _renderBar: function (targetGroup) {
- var visualMapModel = this.visualMapModel;
- var shapes = this._shapes;
- var itemSize = visualMapModel.itemSize;
- var orient = this._orient;
- var useHandle = this._useHandle;
- var itemAlign = helper.getItemAlign(visualMapModel, this.api, itemSize);
- var barGroup = shapes.barGroup = this._createBarGroup(itemAlign);
-
- // Bar
- barGroup.add(shapes.outOfRange = createPolygon());
- barGroup.add(shapes.inRange = createPolygon(
- null,
- zrUtil.bind(this._modifyHandle, this, 'all'),
- useHandle ? 'move' : null
- ));
-
- var textRect = visualMapModel.textStyleModel.getTextRect('国');
- var textSize = Math.max(textRect.width, textRect.height);
-
- // Handle
- if (useHandle) {
- shapes.handleGroups = [];
- shapes.handleThumbs = [];
- shapes.handleLabels = [];
- shapes.handleLabelPoints = [];
-
- this._createHandle(barGroup, 0, itemSize, textSize, orient, itemAlign);
- this._createHandle(barGroup, 1, itemSize, textSize, orient, itemAlign);
- }
-
- // Indicator
- // FIXME
-
- targetGroup.add(barGroup);
- },
-
- /**
- * @private
- */
- _createHandle: function (barGroup, handleIndex, itemSize, textSize, orient) {
- var handleGroup = new graphic.Group({position: [itemSize[0], 0]});
- var handleThumb = createPolygon(
- createHandlePoints(handleIndex, textSize),
- zrUtil.bind(this._modifyHandle, this, handleIndex),
- 'move'
- );
- handleGroup.add(handleThumb);
-
- // For text locating. Text is always horizontal layout
- // but should not be effected by transform.
- var handleLabelPoint = {
- x: orient === 'horizontal'
- ? textSize / 2
- : textSize * 1.5,
- y: orient === 'horizontal'
- ? (handleIndex === 0 ? -(textSize * 1.5) : (textSize * 1.5))
- : (handleIndex === 0 ? -textSize / 2 : textSize / 2)
- };
-
- var textStyleModel = this.visualMapModel.textStyleModel;
- var handleLabel = new graphic.Text({
- silent: true,
- style: {
- x: 0, y: 0, text: '',
- textVerticalAlign: 'middle',
- textFont: textStyleModel.getFont(),
- fill: textStyleModel.getTextColor()
- }
- });
-
- this.group.add(handleLabel); // Text do not transform
-
- var shapes = this._shapes;
- shapes.handleThumbs[handleIndex] = handleThumb;
- shapes.handleGroups[handleIndex] = handleGroup;
- shapes.handleLabelPoints[handleIndex] = handleLabelPoint;
- shapes.handleLabels[handleIndex] = handleLabel;
-
- barGroup.add(handleGroup);
- },
-
- /**
- * @private
- */
- _modifyHandle: function (handleIndex, dx, dy) {
- if (!this._useHandle) {
- return;
- }
-
- // Transform dx, dy to bar coordination.
- var vertex = this._applyTransform([dx, dy], this._shapes.barGroup, true);
- this._updateInterval(handleIndex, vertex[1]);
-
- this.api.dispatchAction({
- type: 'selectDataRange',
- from: this.uid,
- visualMapId: this.visualMapModel.id,
- selected: this._dataInterval.slice()
- });
- },
-
- /**
- * @private
- */
- _resetInterval: function () {
- var visualMapModel = this.visualMapModel;
-
- var dataInterval = this._dataInterval = visualMapModel.getSelected();
- var dataExtent = visualMapModel.getExtent();
- var sizeExtent = [0, visualMapModel.itemSize[1]];
-
- this._handleEnds = [
- linearMap(dataInterval[0], dataExtent, sizeExtent,true),
- linearMap(dataInterval[1], dataExtent, sizeExtent,true)
- ];
- },
-
- /**
- * @private
- * @param {(number|string)} handleIndex 0 or 1 or 'all'
- * @param {number} dx
- * @param {number} dy
- */
- _updateInterval: function (handleIndex, delta) {
- delta = delta || 0;
- var visualMapModel = this.visualMapModel;
- var handleEnds = this._handleEnds;
-
- sliderMove(
- delta,
- handleEnds,
- [0, visualMapModel.itemSize[1]],
- handleIndex === 'all' ? 'rigid' : 'push',
- handleIndex
- );
- var dataExtent = visualMapModel.getExtent();
- var sizeExtent = [0, visualMapModel.itemSize[1]];
- // Update data interval.
- this._dataInterval = [
- linearMap(handleEnds[0], sizeExtent, dataExtent, true),
- linearMap(handleEnds[1], sizeExtent, dataExtent, true)
- ];
- },
-
- /**
- * @private
- */
- _updateView: function (forSketch) {
- var visualMapModel = this.visualMapModel;
- var dataExtent = visualMapModel.getExtent();
- var shapes = this._shapes;
- var dataInterval = this._dataInterval;
-
- var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]];
- var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds;
-
- var visualInRange = this._createBarVisual(
- dataInterval, dataExtent, inRangeHandleEnds, 'inRange'
- );
- var visualOutOfRange = this._createBarVisual(
- dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange'
- );
-
- shapes.inRange
- .setStyle('fill', visualInRange.barColor)
- .setShape('points', visualInRange.barPoints);
- shapes.outOfRange
- .setStyle('fill', visualOutOfRange.barColor)
- .setShape('points', visualOutOfRange.barPoints);
-
- this._useHandle && each([0, 1], function (handleIndex) {
-
- shapes.handleThumbs[handleIndex].setStyle(
- 'fill', visualInRange.handlesColor[handleIndex]
- );
-
- shapes.handleLabels[handleIndex].setStyle({
- text: visualMapModel.formatValueText(dataInterval[handleIndex]),
- textAlign: this._applyTransform(
- this._orient === 'horizontal'
- ? (handleIndex === 0 ? 'bottom' : 'top')
- : 'left',
- shapes.barGroup
- )
- });
-
- }, this);
-
- this._updateHandlePosition(inRangeHandleEnds);
- },
-
- /**
- * @private
- */
- _createBarVisual: function (dataInterval, dataExtent, handleEnds, forceState) {
- var colorStops = this.getControllerVisual(dataInterval, forceState, 'color').color;
-
- var symbolSizes = [
- this.getControllerVisual(dataInterval[0], forceState, 'symbolSize').symbolSize,
- this.getControllerVisual(dataInterval[1], forceState, 'symbolSize').symbolSize
- ];
- var barPoints = this._createBarPoints(handleEnds, symbolSizes);
-
- return {
- barColor: new LinearGradient(0, 0, 1, 1, colorStops),
- barPoints: barPoints,
- handlesColor: [
- colorStops[0].color,
- colorStops[colorStops.length - 1].color
- ]
- };
- },
-
- /**
- * @private
- */
- _createBarPoints: function (handleEnds, symbolSizes) {
- var itemSize = this.visualMapModel.itemSize;
-
- return [
- [itemSize[0] - symbolSizes[0], handleEnds[0]],
- [itemSize[0], handleEnds[0]],
- [itemSize[0], handleEnds[1]],
- [itemSize[0] - symbolSizes[1], handleEnds[1]]
- ];
- },
-
- /**
- * @private
- */
- _createBarGroup: function (itemAlign) {
- var orient = this._orient;
- var inverse = this.visualMapModel.get('inverse');
-
- return new graphic.Group(
- (orient === 'horizontal' && !inverse)
- ? {scale: itemAlign === 'bottom' ? [1, 1] : [-1, 1], rotation: Math.PI / 2}
- : (orient === 'horizontal' && inverse)
- ? {scale: itemAlign === 'bottom' ? [-1, 1] : [1, 1], rotation: -Math.PI / 2}
- : (orient === 'vertical' && !inverse)
- ? {scale: itemAlign === 'left' ? [1, -1] : [-1, -1]}
- : {scale: itemAlign === 'left' ? [1, 1] : [-1, 1]}
- );
- },
-
- /**
- * @private
- */
- _updateHandlePosition: function (handleEnds) {
- if (!this._useHandle) {
- return;
- }
-
- var shapes = this._shapes;
-
- each([0, 1], function (handleIndex) {
- var handleGroup = shapes.handleGroups[handleIndex];
- handleGroup.position[1] = handleEnds[handleIndex];
-
- // Update handle label position.
- var labelPoint = shapes.handleLabelPoints[handleIndex];
- var textPoint = graphic.applyTransform(
- [labelPoint.x, labelPoint.y],
- graphic.getTransform(handleGroup, this.group)
- );
-
- shapes.handleLabels[handleIndex].setStyle({
- x: textPoint[0], y: textPoint[1]
- });
- }, this);
- },
-
- /**
- * @private
- */
- _applyTransform: function (vertex, element, inverse) {
- var transform = graphic.getTransform(element, this.group);
-
- return graphic[
- zrUtil.isArray(vertex)
- ? 'applyTransform' : 'transformDirection'
- ](vertex, transform, inverse);
- }
-
- });
-
- function createPolygon(points, onDrift, cursor) {
- return new graphic.Polygon({
- shape: {points: points},
- draggable: !!onDrift,
- cursor: cursor,
- drift: onDrift
- });
- }
-
- function createHandlePoints(handleIndex, textSize) {
- return handleIndex === 0
- ? [[0, 0], [textSize, 0], [textSize, -textSize]]
- : [[0, 0], [textSize, 0], [textSize, textSize]];
- }
-
- module.exports = ContinuousVisualMapView;
-
-
-
-/***/ },
-/* 309 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var echarts = __webpack_require__(1);
- var zrUtil = __webpack_require__(3);
- var graphic = __webpack_require__(42);
- var formatUtil = __webpack_require__(6);
- var layout = __webpack_require__(21);
- var VisualMapping = __webpack_require__(187);
-
- module.exports = echarts.extendComponentView({
-
- type: 'visualMap',
-
- /**
- * @readOnly
- * @type {Object}
- */
- autoPositionValues: {left: 1, right: 1, top: 1, bottom: 1},
-
- init: function (ecModel, api) {
- /**
- * @readOnly
- * @type {module:echarts/model/Global}
- */
- this.ecModel = ecModel;
-
- /**
- * @readOnly
- * @type {module:echarts/ExtensionAPI}
- */
- this.api = api;
-
- /**
- * @readOnly
- * @type {module:echarts/component/visualMap/visualMapModel}
- */
- this.visualMapModel;
-
- /**
- * @private
- * @type {Object}
- */
- this._updatableShapes = {};
- },
-
- /**
- * @protected
- */
- render: function (visualMapModel, ecModel, api, payload) {
- this.visualMapModel = visualMapModel;
-
- if (visualMapModel.get('show') === false) {
- this.group.removeAll();
- return;
- }
-
- this.doRender.apply(this, arguments);
- },
-
- /**
- * @protected
- */
- renderBackground: function (group) {
- var visualMapModel = this.visualMapModel;
- var padding = formatUtil.normalizeCssArray(visualMapModel.get('padding') || 0);
- var rect = group.getBoundingRect();
-
- group.add(new graphic.Rect({
- z2: -1, // Lay background rect on the lowest layer.
- silent: true,
- shape: {
- x: rect.x - padding[3],
- y: rect.y - padding[0],
- width: rect.width + padding[3] + padding[1],
- height: rect.height + padding[0] + padding[2]
- },
- style: {
- fill: visualMapModel.get('backgroundColor'),
- stroke: visualMapModel.get('borderColor'),
- lineWidth: visualMapModel.get('borderWidth')
- }
- }));
- },
-
- /**
- * @protected
- * @param {(number|Array)} targetValue
- * @param {string=} forceState Specify state, instead of using getValueState method.
- * @param {string=} visualCluster Specify visual type, defualt all available visualClusters.
- */
- getControllerVisual: function (targetValue, forceState, visualCluster) {
- var visualMapModel = this.visualMapModel;
- var targetIsArray = zrUtil.isArray(targetValue);
-
- // targetValue is array when caculate gradient color,
- // where forceState is required.
- if (targetIsArray && (!forceState || visualCluster !== 'color')) {
- throw new Error(targetValue);
- }
-
- var mappings = visualMapModel.controllerVisuals[
- forceState || visualMapModel.getValueState(targetValue)
- ];
- var defaultColor = visualMapModel.get('contentColor');
- var visualObj = {
- symbol: visualMapModel.get('itemSymbol'),
- color: targetIsArray
- ? [{color: defaultColor, offset: 0}, {color: defaultColor, offset: 1}]
- : defaultColor
- };
-
- function getter(key) {
- return visualObj[key];
- }
-
- function setter(key, value) {
- visualObj[key] = value;
- }
-
- var visualTypes = VisualMapping.prepareVisualTypes(mappings);
-
- zrUtil.each(visualTypes, function (type) {
- var visualMapping = mappings[type];
- if (!visualCluster || VisualMapping.isInVisualCluster(type, visualCluster)) {
- visualMapping && visualMapping.applyVisual(targetValue, getter, setter);
- }
- });
-
- return visualObj;
- },
-
- /**
- * @protected
- */
- positionGroup: function (group) {
- var model = this.visualMapModel;
- var api = this.api;
-
- layout.positionGroup(
- group,
- model.getBoxLayoutParams(),
- {width: api.getWidth(), height: api.getHeight()}
- );
- },
-
- /**
- * @protected
- * @abstract
- */
- doRender: zrUtil.noop
-
- });
-
-
-/***/ },
-/* 310 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var layout = __webpack_require__(21);
-
- var helper = {
-
- /**
- * @param {module:echarts/component/visualMap/VisualMapModel} visualMapModel\
- * @param {module:echarts/ExtensionAPI} api
- * @param {Array.<number>} itemSize always [short, long]
- * @return {string} 'left' or 'right' or 'top' or 'bottom'
- */
- getItemAlign: function (visualMapModel, api, itemSize) {
- var modelOption = visualMapModel.option;
- var itemAlign = modelOption.align;
-
- if (itemAlign != null && itemAlign !== 'auto') {
- return itemAlign;
- }
-
- // Auto decision align.
- var ecSize = {width: api.getWidth(), height: api.getHeight()};
- var realIndex = modelOption.orient === 'horizontal' ? 1 : 0;
-
- var paramsSet = [
- ['left', 'right', 'width'],
- ['top', 'bottom', 'height']
- ];
- var reals = paramsSet[realIndex];
- var fakeValue = [0, null, 10];
-
- var layoutInput = {};
- for (var i = 0; i < 3; i++) {
- layoutInput[paramsSet[1 - realIndex][i]] = fakeValue[i];
- layoutInput[reals[i]] = i === 2 ? itemSize[0] : modelOption[reals[i]];
- }
-
- var rParam = [['x', 'width', 3], ['y', 'height', 0]][realIndex];
- var rect = layout.getLayoutRect(layoutInput, ecSize, modelOption.padding);
-
- return reals[
- (rect.margin[rParam[2]] || 0) + rect[rParam[0]] + rect[rParam[1]] * 0.5
- < ecSize[rParam[1]] * 0.5 ? 0 : 1
- ];
- }
- };
-
- module.exports = helper;
-
-
-
-/***/ },
-/* 311 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Data range action
- */
-
-
- var echarts = __webpack_require__(1);
-
- var actionInfo = {
- type: 'selectDataRange',
- event: 'dataRangeSelected',
- // FIXME use updateView appears wrong
- update: 'update'
- };
-
- echarts.registerAction(actionInfo, function (payload, ecModel) {
-
- ecModel.eachComponent({mainType: 'visualMap', query: payload}, function (model) {
- model.setSelected(payload.selected);
- });
-
- });
-
-
-
-/***/ },
-/* 312 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * DataZoom component entry
- */
-
-
- __webpack_require__(1).registerPreprocessor(
- __webpack_require__(302)
- );
-
- __webpack_require__(303);
- __webpack_require__(304);
- __webpack_require__(313);
- __webpack_require__(314);
- __webpack_require__(311);
-
-
-
-/***/ },
-/* 313 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var VisualMapModel = __webpack_require__(306);
- var zrUtil = __webpack_require__(3);
- var VisualMapping = __webpack_require__(187);
-
- var PiecewiseModel = VisualMapModel.extend({
-
- type: 'visualMap.piecewise',
-
- /**
- * Order Rule:
- *
- * option.categories / option.pieces / option.text / option.selected:
- * If !option.inverse,
- * Order when vertical: ['top', ..., 'bottom'].
- * Order when horizontal: ['left', ..., 'right'].
- * If option.inverse, the meaning of
- * the order should be reversed.
- *
- * this._pieceList:
- * The order is always [low, ..., high].
- *
- * Mapping from location to low-high:
- * If !option.inverse
- * When vertical, top is high.
- * When horizontal, right is high.
- * If option.inverse, reverse.
- */
-
- /**
- * @protected
- */
- defaultOption: {
- selected: null, // Object. If not specified, means selected.
- // When pieces and splitNumber: {'0': true, '5': true}
- // When categories: {'cate1': false, 'cate3': true}
- // When selected === false, means all unselected.
- align: 'auto', // 'auto', 'left', 'right'
- itemWidth: 20, // 值域图形宽度
- itemHeight: 14, // 值域图形高度
- itemSymbol: 'roundRect',
- pieceList: null, // 值顺序:由高到低, item can be:
- // {min, max, value, color, colorSaturation, colorAlpha, symbol, symbolSize}
- categories: null, // 描述 category 数据。如:['some1', 'some2', 'some3'],设置后,min max失效。
- splitNumber: 5, // 分割段数,默认为5,为0时为线性渐变 (continous)
- selectedMode: 'multiple',
- itemGap: 10 // 各个item之间的间隔,单位px,默认为10,
- // 横向布局时为水平间隔,纵向布局时为纵向间隔
- },
-
- /**
- * @override
- */
- doMergeOption: function (newOption, isInit) {
- PiecewiseModel.superApply(this, 'doMergeOption', arguments);
-
- /**
- * The order is always [low, ..., high].
- * [{text: string, interval: Array.<number>}, ...]
- * @private
- * @type {Array.<Object>}
- */
- this._pieceList = [];
-
- this.resetTargetSeries(newOption, isInit);
- this.resetExtent();
-
- /**
- * 'pieces', 'categories', 'splitNumber'
- * @type {string}
- */
- var mode = this._mode = this._decideMode();
-
- resetMethods[this._mode].call(this);
-
- this._resetSelected(newOption, isInit);
-
- var categories = this.option.categories;
- this.resetVisual(function (mappingOption, state) {
- if (mode === 'categories') {
- mappingOption.mappingMethod = 'category';
- mappingOption.categories = zrUtil.clone(categories);
- }
- else {
- mappingOption.mappingMethod = 'piecewise';
- mappingOption.pieceList = zrUtil.map(this._pieceList, function (piece) {
- var piece = zrUtil.clone(piece);
- if (state !== 'inRange') {
- piece.visual = null;
- }
- return piece;
- });
- }
- });
- },
-
- _resetSelected: function (newOption, isInit) {
- var thisOption = this.option;
- var pieceList = this._pieceList;
-
- // Selected do not merge but all override.
- var selected = (isInit ? thisOption : newOption).selected || {};
- thisOption.selected = selected;
-
- // Consider 'not specified' means true.
- zrUtil.each(pieceList, function (piece, index) {
- var key = this.getSelectedMapKey(piece);
- if (!(key in selected)) {
- selected[key] = true;
- }
- }, this);
-
- if (thisOption.selectedMode === 'single') {
- // Ensure there is only one selected.
- var hasSel = false;
-
- zrUtil.each(pieceList, function (piece, index) {
- var key = this.getSelectedMapKey(piece);
- if (selected[key]) {
- hasSel
- ? (selected[key] = false)
- : (hasSel = true);
- }
- }, this);
- }
- // thisOption.selectedMode === 'multiple', default: all selected.
- },
-
- /**
- * @public
- */
- getSelectedMapKey: function (piece) {
- return this._mode === 'categories'
- ? piece.value + '' : piece.index + '';
- },
-
- /**
- * @public
- */
- getPieceList: function () {
- return this._pieceList;
- },
-
- /**
- * @private
- * @return {string}
- */
- _decideMode: function () {
- var option = this.option;
-
- return option.pieces && option.pieces.length > 0
- ? 'pieces'
- : this.option.categories
- ? 'categories'
- : 'splitNumber';
- },
-
- /**
- * @public
- * @override
- */
- setSelected: function (selected) {
- this.option.selected = zrUtil.clone(selected);
- },
-
- /**
- * @public
- * @override
- */
- getValueState: function (value) {
- var pieceList = this._pieceList;
- var index = VisualMapping.findPieceIndex(value, pieceList);
-
- return index != null
- ? (this.option.selected[this.getSelectedMapKey(pieceList[index])]
- ? 'inRange' : 'outOfRange'
- )
- : 'outOfRange';
- }
-
- });
-
- /**
- * Key is this._mode
- * @type {Object}
- * @this {module:echarts/component/viusalMap/PiecewiseMode}
- */
- var resetMethods = {
-
- splitNumber: function () {
- var thisOption = this.option;
- var precision = thisOption.precision;
- var dataExtent = this.getExtent();
- var splitNumber = thisOption.splitNumber;
- splitNumber = Math.max(parseInt(splitNumber, 10), 1);
- thisOption.splitNumber = splitNumber;
-
- var splitStep = (dataExtent[1] - dataExtent[0]) / splitNumber;
- // Precision auto-adaption
- while (+splitStep.toFixed(precision) !== splitStep && precision < 5) {
- precision++;
- }
- thisOption.precision = precision;
- splitStep = +splitStep.toFixed(precision);
-
- for (var i = 0, curr = dataExtent[0]; i < splitNumber; i++, curr += splitStep) {
- var max = i === splitNumber - 1 ? dataExtent[1] : (curr + splitStep);
-
- this._pieceList.push({
- text: this.formatValueText([curr, max]),
- index: i,
- interval: [curr, max]
- });
- }
- },
-
- categories: function () {
- var thisOption = this.option;
- zrUtil.each(thisOption.categories, function (cate) {
- // FIXME category模式也使用pieceList,但在visualMapping中不是使用pieceList。
- // 是否改一致。
- this._pieceList.push({
- text: this.formatValueText(cate, true),
- value: cate
- });
- }, this);
-
- // See "Order Rule".
- normalizeReverse(thisOption, this._pieceList);
- },
-
- pieces: function () {
- var thisOption = this.option;
- zrUtil.each(thisOption.pieces, function (pieceListItem, index) {
-
- if (!zrUtil.isObject(pieceListItem)) {
- pieceListItem = {value: pieceListItem};
- }
-
- var item = {text: '', index: index};
- var hasLabel;
-
- if (pieceListItem.label != null) {
- item.text = pieceListItem.label;
- hasLabel = true;
- }
-
- if (pieceListItem.hasOwnProperty('value')) {
- item.value = pieceListItem.value;
-
- if (!hasLabel) {
- item.text = this.formatValueText(item.value);
- }
- }
- else {
- var min = pieceListItem.min;
- var max = pieceListItem.max;
- min == null && (min = -Infinity);
- max == null && (max = Infinity);
- if (min === max) {
- // Consider: [{min: 5, max: 5, visual: {...}}, {min: 0, max: 5}],
- // we use value to lift the priority when min === max
- item.value = min;
- }
- item.interval = [min, max];
-
- if (!hasLabel) {
- item.text = this.formatValueText([min, max]);
- }
- }
-
- item.visual = VisualMapping.retrieveVisuals(pieceListItem);
-
- this._pieceList.push(item);
-
- }, this);
-
- // See "Order Rule".
- normalizeReverse(thisOption, this._pieceList);
- }
- };
-
- function normalizeReverse(thisOption, arr) {
- var inverse = thisOption.inverse;
- if (thisOption.orient === 'vertical' ? !inverse : inverse) {
- arr.reverse();
- }
- }
-
- module.exports = PiecewiseModel;
-
-
-
-/***/ },
-/* 314 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var VisualMapView = __webpack_require__(309);
- var zrUtil = __webpack_require__(3);
- var graphic = __webpack_require__(42);
- var symbolCreators = __webpack_require__(100);
- var layout = __webpack_require__(21);
- var helper = __webpack_require__(310);
-
- var PiecewiseVisualMapView = VisualMapView.extend({
-
- type: 'visualMap.piecewise',
-
- /**
- * @protected
- * @override
- */
- doRender: function () {
- var thisGroup = this.group;
-
- thisGroup.removeAll();
-
- var visualMapModel = this.visualMapModel;
- var textGap = visualMapModel.get('textGap');
- var textStyleModel = visualMapModel.textStyleModel;
- var textFont = textStyleModel.getFont();
- var textFill = textStyleModel.getTextColor();
- var itemAlign = this._getItemAlign();
- var itemSize = visualMapModel.itemSize;
-
- var viewData = this._getViewData();
- var showLabel = !viewData.endsText;
- var showEndsText = !showLabel;
-
- showEndsText && this._renderEndsText(thisGroup, viewData.endsText[0], itemSize);
-
- zrUtil.each(viewData.pieceList, renderItem, this);
-
- showEndsText && this._renderEndsText(thisGroup, viewData.endsText[1], itemSize);
-
- layout.box(
- visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap')
- );
-
- this.renderBackground(thisGroup);
-
- this.positionGroup(thisGroup);
-
- function renderItem(item) {
- var itemGroup = new graphic.Group();
- itemGroup.onclick = zrUtil.bind(this._onItemClick, this, item.piece);
-
- this._createItemSymbol(itemGroup, item.piece, [0, 0, itemSize[0], itemSize[1]]);
-
- if (showLabel) {
- itemGroup.add(new graphic.Text({
- style: {
- x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap,
- y: itemSize[1] / 2,
- text: item.piece.text,
- textVerticalAlign: 'middle',
- textAlign: itemAlign,
- textFont: textFont,
- fill: textFill
- }
- }));
- }
-
- thisGroup.add(itemGroup);
- }
- },
-
- /**
- * @private
- */
- _getItemAlign: function () {
- var visualMapModel = this.visualMapModel;
- var modelOption = visualMapModel.option;
- if (modelOption.orient === 'vertical') {
- return helper.getItemAlign(
- visualMapModel, this.api, visualMapModel.itemSize
- );
- }
- else { // horizontal, most case left unless specifying right.
- var align = modelOption.align;
- if (!align || align === 'auto') {
- align = 'left';
- }
- return align;
- }
- },
-
- /**
- * @private
- */
- _renderEndsText: function (group, text, itemSize) {
- if (!text) {
- return;
- }
- var itemGroup = new graphic.Group();
- var textStyleModel = this.visualMapModel.textStyleModel;
- itemGroup.add(new graphic.Text({
- style: {
- x: itemSize[0] / 2,
- y: itemSize[1] / 2,
- textVerticalAlign: 'middle',
- textAlign: 'center',
- text: text,
- textFont: textStyleModel.getFont(),
- fill: textStyleModel.getTextColor()
- }
- }));
-
- group.add(itemGroup);
- },
-
- /**
- * @private
- * @return {Object} {peiceList, endsText} The order is the same as screen pixel order.
- */
- _getViewData: function () {
- var visualMapModel = this.visualMapModel;
-
- var pieceList = zrUtil.map(visualMapModel.getPieceList(), function (piece, index) {
- return {piece: piece, index: index};
- });
- var endsText = visualMapModel.get('text');
-
- // Consider orient and inverse.
- var orient = visualMapModel.get('orient');
- var inverse = visualMapModel.get('inverse');
-
- // Order of pieceList is always [low, ..., high]
- if (orient === 'horizontal' ? inverse : !inverse) {
- pieceList.reverse();
- }
- // Origin order of endsText is [high, low]
- else if (endsText) {
- endsText = endsText.slice().reverse();
- }
-
- return {pieceList: pieceList, endsText: endsText};
- },
-
- /**
- * @private
- */
- _createItemSymbol: function (group, piece, shapeParam) {
- var representValue;
- if (this.visualMapModel.isCategory()) {
- representValue = piece.value;
- }
- else {
- if (piece.value != null) {
- representValue = piece.value;
- }
- else {
- var pieceInterval = piece.interval || [];
- representValue = (pieceInterval[0] + pieceInterval[1]) / 2;
- }
- }
-
- var visualObj = this.getControllerVisual(representValue);
-
- group.add(symbolCreators.createSymbol(
- visualObj.symbol,
- shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3],
- visualObj.color
- ));
- },
-
- /**
- * @private
- */
- _onItemClick: function (piece) {
- var visualMapModel = this.visualMapModel;
- var option = visualMapModel.option;
- var selected = zrUtil.clone(option.selected);
- var newKey = visualMapModel.getSelectedMapKey(piece);
-
- if (option.selectedMode === 'single') {
- selected[newKey] = true;
- zrUtil.each(selected, function (o, key) {
- selected[key] = key === newKey;
- });
- }
- else {
- selected[newKey] = !selected[newKey];
- }
-
- this.api.dispatchAction({
- type: 'selectDataRange',
- from: this.uid,
- visualMapId: this.visualMapModel.id,
- selected: selected
- });
- }
- });
-
- module.exports = PiecewiseVisualMapView;
-
-
-
-/***/ },
-/* 315 */
-/***/ function(module, exports, __webpack_require__) {
-
- // HINT Markpoint can't be used too much
-
-
- __webpack_require__(316);
- __webpack_require__(317);
-
- __webpack_require__(1).registerPreprocessor(function (opt) {
- // Make sure markPoint component is enabled
- opt.markPoint = opt.markPoint || {};
- });
-
-
-/***/ },
-/* 316 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- // Default enable markPoint
- // var globalDefault = require('../../model/globalDefault');
- var modelUtil = __webpack_require__(5);
- // // Force to load markPoint component
- // globalDefault.markPoint = {};
-
- var MarkPointModel = __webpack_require__(1).extendComponentModel({
-
- type: 'markPoint',
-
- dependencies: ['series', 'grid', 'polar'],
- /**
- * @overrite
- */
- init: function (option, parentModel, ecModel, extraOpt) {
- this.mergeDefaultAndTheme(option, ecModel);
- this.mergeOption(option, ecModel, extraOpt.createdBySelf, true);
- },
-
- mergeOption: function (newOpt, ecModel, createdBySelf, isInit) {
- if (!createdBySelf) {
- ecModel.eachSeries(function (seriesModel) {
- var markPointOpt = seriesModel.get('markPoint');
- var mpModel = seriesModel.markPointModel;
- if (!markPointOpt || !markPointOpt.data) {
- seriesModel.markPointModel = null;
- return;
- }
- if (!mpModel) {
- if (isInit) {
- // Default label emphasis `position` and `show`
- modelUtil.defaultEmphasis(
- markPointOpt.label,
- ['position', 'show', 'textStyle', 'distance', 'formatter']
- );
- }
- var opt = {
- // Use the same series index and name
- seriesIndex: seriesModel.seriesIndex,
- name: seriesModel.name,
- createdBySelf: true
- };
- mpModel = new MarkPointModel(
- markPointOpt, this, ecModel, opt
- );
- }
- else {
- mpModel.mergeOption(markPointOpt, ecModel, true);
- }
- seriesModel.markPointModel = mpModel;
- }, this);
- }
- },
-
- defaultOption: {
- zlevel: 0,
- z: 5,
- symbol: 'pin', // 标注类型
- symbolSize: 50, // 标注大小
- // symbolRotate: null, // 标注旋转控制
- tooltip: {
- trigger: 'item'
- },
- label: {
- normal: {
- show: true,
- // 标签文本格式器,同Tooltip.formatter,不支持回调
- // formatter: null,
- // 可选为'left'|'right'|'top'|'bottom'
- position: 'inside'
- // 默认使用全局文本样式,详见TEXTSTYLE
- // textStyle: null
- },
- emphasis: {
- show: true
- // 标签文本格式器,同Tooltip.formatter,不支持回调
- // formatter: null,
- // position: 'inside' // 'left'|'right'|'top'|'bottom'
- // textStyle: null // 默认使用全局文本样式,详见TEXTSTYLE
- }
- },
- itemStyle: {
- normal: {
- // color: 各异,
- // 标注边线颜色,优先于color
- // borderColor: 各异,
- // 标注边线线宽,单位px,默认为1
- borderWidth: 2
- },
- emphasis: {
- // color: 各异
- }
- }
- }
- });
-
- module.exports = MarkPointModel;
-
-
-/***/ },
-/* 317 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var SymbolDraw = __webpack_require__(98);
- var zrUtil = __webpack_require__(3);
- var formatUtil = __webpack_require__(6);
- var modelUtil = __webpack_require__(5);
- var numberUtil = __webpack_require__(7);
-
- var addCommas = formatUtil.addCommas;
- var encodeHTML = formatUtil.encodeHTML;
-
- var List = __webpack_require__(94);
-
- var markerHelper = __webpack_require__(318);
-
- function updateMarkerLayout(mpData, seriesModel, api) {
- var coordSys = seriesModel.coordinateSystem;
- mpData.each(function (idx) {
- var itemModel = mpData.getItemModel(idx);
- var point;
- var xPx = itemModel.getShallow('x');
- var yPx = itemModel.getShallow('y');
- if (xPx != null && yPx != null) {
- point = [
- numberUtil.parsePercent(xPx, api.getWidth()),
- numberUtil.parsePercent(yPx, api.getHeight())
- ];
- }
- // Chart like bar may have there own marker positioning logic
- else if (seriesModel.getMarkerPosition) {
- // Use the getMarkerPoisition
- point = seriesModel.getMarkerPosition(
- mpData.getValues(mpData.dimensions, idx)
- );
- }
- else if (coordSys) {
- var x = mpData.get(coordSys.dimensions[0], idx);
- var y = mpData.get(coordSys.dimensions[1], idx);
- point = coordSys.dataToPoint([x, y]);
- }
-
- mpData.setItemLayout(idx, point);
- });
- }
-
- // FIXME
- var markPointFormatMixin = {
- getRawDataArray: function () {
- return this.option.data;
- },
-
- formatTooltip: function (dataIndex) {
- var data = this.getData();
- var value = this.getRawValue(dataIndex);
- var formattedValue = zrUtil.isArray(value)
- ? zrUtil.map(value, addCommas).join(', ') : addCommas(value);
- var name = data.getName(dataIndex);
- return this.name + '<br />'
- + ((name ? encodeHTML(name) + ' : ' : '') + formattedValue);
- },
-
- getData: function () {
- return this._data;
- },
-
- setData: function (data) {
- this._data = data;
- }
- };
-
- zrUtil.defaults(markPointFormatMixin, modelUtil.dataFormatMixin);
-
- __webpack_require__(1).extendComponentView({
-
- type: 'markPoint',
-
- init: function () {
- this._symbolDrawMap = {};
- },
-
- render: function (markPointModel, ecModel, api) {
- var symbolDrawMap = this._symbolDrawMap;
- for (var name in symbolDrawMap) {
- symbolDrawMap[name].__keep = false;
- }
-
- ecModel.eachSeries(function (seriesModel) {
- var mpModel = seriesModel.markPointModel;
- mpModel && this._renderSeriesMP(seriesModel, mpModel, api);
- }, this);
-
- for (var name in symbolDrawMap) {
- if (!symbolDrawMap[name].__keep) {
- symbolDrawMap[name].remove();
- this.group.remove(symbolDrawMap[name].group);
- }
- }
- },
-
- updateLayout: function (markPointModel, ecModel, api) {
- ecModel.eachSeries(function (seriesModel) {
- var mpModel = seriesModel.markPointModel;
- if (mpModel) {
- updateMarkerLayout(mpModel.getData(), seriesModel, api);
- this._symbolDrawMap[seriesModel.name].updateLayout(mpModel);
- }
- }, this);
- },
-
- _renderSeriesMP: function (seriesModel, mpModel, api) {
- var coordSys = seriesModel.coordinateSystem;
- var seriesName = seriesModel.name;
- var seriesData = seriesModel.getData();
-
- var symbolDrawMap = this._symbolDrawMap;
- var symbolDraw = symbolDrawMap[seriesName];
- if (!symbolDraw) {
- symbolDraw = symbolDrawMap[seriesName] = new SymbolDraw();
- }
-
- var mpData = createList(coordSys, seriesModel, mpModel);
-
- // FIXME
- zrUtil.mixin(mpModel, markPointFormatMixin);
- mpModel.setData(mpData);
-
- updateMarkerLayout(mpModel.getData(), seriesModel, api);
-
- mpData.each(function (idx) {
- var itemModel = mpData.getItemModel(idx);
- var symbolSize = itemModel.getShallow('symbolSize');
- if (typeof symbolSize === 'function') {
- // FIXME 这里不兼容 ECharts 2.x,2.x 貌似参数是整个数据?
- symbolSize = symbolSize(
- mpModel.getRawValue(idx), mpModel.getDataParams(idx)
- );
- }
- mpData.setItemVisual(idx, {
- symbolSize: symbolSize,
- color: itemModel.get('itemStyle.normal.color')
- || seriesData.getVisual('color'),
- symbol: itemModel.getShallow('symbol')
- });
- });
-
- // TODO Text are wrong
- symbolDraw.updateData(mpData);
- this.group.add(symbolDraw.group);
-
- // Set host model for tooltip
- // FIXME
- mpData.eachItemGraphicEl(function (el) {
- el.traverse(function (child) {
- child.dataModel = mpModel;
- });
- });
-
- symbolDraw.__keep = true;
- }
- });
-
- /**
- * @inner
- * @param {module:echarts/coord/*} [coordSys]
- * @param {module:echarts/model/Series} seriesModel
- * @param {module:echarts/model/Model} mpModel
- */
- function createList(coordSys, seriesModel, mpModel) {
- var coordDimsInfos;
- if (coordSys) {
- coordDimsInfos = zrUtil.map(coordSys && coordSys.dimensions, function (coordDim) {
- var info = seriesModel.getData().getDimensionInfo(
- seriesModel.coordDimToDataDim(coordDim)[0]
- ) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys
- info.name = coordDim;
- return info;
- });
- }
- else {
- coordDimsInfos =[{
- name: 'value',
- type: 'float'
- }];
- }
-
- var mpData = new List(coordDimsInfos, mpModel);
- var dataOpt = zrUtil.map(mpModel.get('data'), zrUtil.curry(
- markerHelper.dataTransform, seriesModel
- ));
- if (coordSys) {
- dataOpt = zrUtil.filter(
- dataOpt, zrUtil.curry(markerHelper.dataFilter, coordSys)
- );
- }
-
- mpData.initData(dataOpt, null,
- coordSys ? markerHelper.dimValueGetter : function (item) {
- return item.value;
- }
- );
- return mpData;
- }
-
-
-
-/***/ },
-/* 318 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var numberUtil = __webpack_require__(7);
- var indexOf = zrUtil.indexOf;
-
- function getPrecision(data, valueAxisDim, dataIndex) {
- var precision = -1;
- do {
- precision = Math.max(
- numberUtil.getPrecision(data.get(
- valueAxisDim, dataIndex
- )),
- precision
- );
- data = data.stackedOn;
- } while (data);
-
- return precision;
- }
-
- function markerTypeCalculatorWithExtent(
- mlType, data, baseDataDim, valueDataDim, baseCoordIndex, valueCoordIndex
- ) {
- var coordArr = [];
- var value = numCalculate(data, valueDataDim, mlType);
-
- var dataIndex = data.indexOfNearest(valueDataDim, value, true);
- coordArr[baseCoordIndex] = data.get(baseDataDim, dataIndex, true);
- coordArr[valueCoordIndex] = data.get(valueDataDim, dataIndex, true);
-
- var precision = getPrecision(data, valueDataDim, dataIndex);
- if (precision >= 0) {
- coordArr[valueCoordIndex] = +coordArr[valueCoordIndex].toFixed(precision);
- }
-
- return coordArr;
- }
-
- var curry = zrUtil.curry;
- // TODO Specified percent
- var markerTypeCalculator = {
- /**
- * @method
- * @param {module:echarts/data/List} data
- * @param {string} baseAxisDim
- * @param {string} valueAxisDim
- */
- min: curry(markerTypeCalculatorWithExtent, 'min'),
- /**
- * @method
- * @param {module:echarts/data/List} data
- * @param {string} baseAxisDim
- * @param {string} valueAxisDim
- */
- max: curry(markerTypeCalculatorWithExtent, 'max'),
- /**
- * @method
- * @param {module:echarts/data/List} data
- * @param {string} baseAxisDim
- * @param {string} valueAxisDim
- */
- average: curry(markerTypeCalculatorWithExtent, 'average')
- };
-
- /**
- * Transform markPoint data item to format used in List by do the following
- * 1. Calculate statistic like `max`, `min`, `average`
- * 2. Convert `item.xAxis`, `item.yAxis` to `item.coord` array
- * @param {module:echarts/model/Series} seriesModel
- * @param {module:echarts/coord/*} [coordSys]
- * @param {Object} item
- * @return {Object}
- */
- var dataTransform = function (seriesModel, item) {
- var data = seriesModel.getData();
- var coordSys = seriesModel.coordinateSystem;
-
- // 1. If not specify the position with pixel directly
- // 2. If `coord` is not a data array. Which uses `xAxis`,
- // `yAxis` to specify the coord on each dimension
- if ((isNaN(item.x) || isNaN(item.y))
- && !zrUtil.isArray(item.coord)
- && coordSys
- ) {
- var axisInfo = getAxisInfo(item, data, coordSys, seriesModel);
-
- // Clone the option
- // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value
- item = zrUtil.clone(item);
-
- if (item.type
- && markerTypeCalculator[item.type]
- && axisInfo.baseAxis && axisInfo.valueAxis
- ) {
- var dims = coordSys.dimensions;
- var baseCoordIndex = indexOf(dims, axisInfo.baseAxis.dim);
- var valueCoordIndex = indexOf(dims, axisInfo.valueAxis.dim);
-
- item.coord = markerTypeCalculator[item.type](
- data, axisInfo.baseDataDim, axisInfo.valueDataDim,
- baseCoordIndex, valueCoordIndex
- );
- // Force to use the value of calculated value.
- item.value = item.coord[valueCoordIndex];
- }
- else {
- // FIXME Only has one of xAxis and yAxis.
- item.coord = [
- item.xAxis != null ? item.xAxis : item.radiusAxis,
- item.yAxis != null ? item.yAxis : item.angleAxis
- ];
- }
- }
- return item;
- };
-
- var getAxisInfo = function (item, data, coordSys, seriesModel) {
- var ret = {};
-
- if (item.valueIndex != null || item.valueDim != null) {
- ret.valueDataDim = item.valueIndex != null
- ? data.getDimension(item.valueIndex) : item.valueDim;
- ret.valueAxis = coordSys.getAxis(seriesModel.dataDimToCoordDim(ret.valueDataDim));
- ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis);
- ret.baseDataDim = seriesModel.coordDimToDataDim(ret.baseAxis.dim)[0];
- }
- else {
- ret.baseAxis = seriesModel.getBaseAxis();
- ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis);
- ret.baseDataDim = seriesModel.coordDimToDataDim(ret.baseAxis.dim)[0];
- ret.valueDataDim = seriesModel.coordDimToDataDim(ret.valueAxis.dim)[0];
- }
-
- return ret;
- };
-
- /**
- * Filter data which is out of coordinateSystem range
- * [dataFilter description]
- * @param {module:echarts/coord/*} [coordSys]
- * @param {Object} item
- * @return {boolean}
- */
- var dataFilter = function (coordSys, item) {
- // Alwalys return true if there is no coordSys
- return (coordSys && coordSys.containData && item.coord && (item.x == null || item.y == null))
- ? coordSys.containData(item.coord) : true;
- };
-
- var dimValueGetter = function (item, dimName, dataIndex, dimIndex) {
- // x, y, radius, angle
- if (dimIndex < 2) {
- return item.coord && item.coord[dimIndex];
- }
- else {
- return item.value;
- }
- };
-
- var numCalculate = function (data, valueDataDim, mlType) {
- return mlType === 'average'
- ? data.getSum(valueDataDim, true) / data.count()
- : data.getDataExtent(valueDataDim, true)[mlType === 'max' ? 1 : 0];
- };
-
- module.exports = {
- dataTransform: dataTransform,
- dataFilter: dataFilter,
- dimValueGetter: dimValueGetter,
- getAxisInfo: getAxisInfo,
- numCalculate: numCalculate
- };
-
-
-/***/ },
-/* 319 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- __webpack_require__(320);
- __webpack_require__(321);
-
- __webpack_require__(1).registerPreprocessor(function (opt) {
- // Make sure markLine component is enabled
- opt.markLine = opt.markLine || {};
- });
-
-
-/***/ },
-/* 320 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- // Default enable markLine
- // var globalDefault = require('../../model/globalDefault');
- var modelUtil = __webpack_require__(5);
-
- // // Force to load markLine component
- // globalDefault.markLine = {};
-
- var MarkLineModel = __webpack_require__(1).extendComponentModel({
-
- type: 'markLine',
-
- dependencies: ['series', 'grid', 'polar'],
- /**
- * @overrite
- */
- init: function (option, parentModel, ecModel, extraOpt) {
- this.mergeDefaultAndTheme(option, ecModel);
- this.mergeOption(option, ecModel, extraOpt.createdBySelf, true);
- },
-
- mergeOption: function (newOpt, ecModel, createdBySelf, isInit) {
- if (!createdBySelf) {
- ecModel.eachSeries(function (seriesModel) {
- var markLineOpt = seriesModel.get('markLine');
- var mlModel = seriesModel.markLineModel;
- if (!markLineOpt || !markLineOpt.data) {
- seriesModel.markLineModel = null;
- return;
- }
- if (!mlModel) {
- if (isInit) {
- // Default label emphasis `position` and `show`
- modelUtil.defaultEmphasis(
- markLineOpt.label,
- ['position', 'show', 'textStyle', 'distance', 'formatter']
- );
- }
- var opt = {
- // Use the same series index and name
- seriesIndex: seriesModel.seriesIndex,
- name: seriesModel.name,
- createdBySelf: true
- };
- mlModel = new MarkLineModel(
- markLineOpt, this, ecModel, opt
- );
- }
- else {
- mlModel.mergeOption(markLineOpt, ecModel, true);
- }
- seriesModel.markLineModel = mlModel;
- }, this);
- }
- },
-
- defaultOption: {
- zlevel: 0,
- z: 5,
- // 标线起始和结束的symbol介绍类型,如果都一样,可以直接传string
- symbol: ['circle', 'arrow'],
- // 标线起始和结束的symbol大小,半宽(半径)参数,当图形为方向或菱形则总宽度为symbolSize * 2
- symbolSize: [8, 16],
- // 标线起始和结束的symbol旋转控制
- //symbolRotate: null,
- //smooth: false,
- precision: 2,
- tooltip: {
- trigger: 'item'
- },
- label: {
- normal: {
- show: true,
- // 标签文本格式器,同Tooltip.formatter,不支持回调
- // formatter: null,
- // 可选为 'start'|'end'|'left'|'right'|'top'|'bottom'
- position: 'end'
- // 默认使用全局文本样式,详见TEXTSTYLE
- // textStyle: null
- },
- emphasis: {
- show: true
- }
- },
- lineStyle: {
- normal: {
- // color
- // width
- type: 'dashed'
- // shadowColor: 'rgba(0,0,0,0)',
- // shadowBlur: 0,
- // shadowOffsetX: 0,
- // shadowOffsetY: 0
- },
- emphasis: {
- width: 3
- }
- },
- animationEasing: 'linear'
- }
- });
-
- module.exports = MarkLineModel;
-
-
-/***/ },
-/* 321 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var List = __webpack_require__(94);
- var formatUtil = __webpack_require__(6);
- var modelUtil = __webpack_require__(5);
- var numberUtil = __webpack_require__(7);
-
- var addCommas = formatUtil.addCommas;
- var encodeHTML = formatUtil.encodeHTML;
-
- var markerHelper = __webpack_require__(318);
-
- var LineDraw = __webpack_require__(194);
-
- var markLineTransform = function (seriesModel, coordSys, mlModel, item) {
- var data = seriesModel.getData();
- // Special type markLine like 'min', 'max', 'average'
- var mlType = item.type;
-
- if (!zrUtil.isArray(item)
- && (mlType === 'min' || mlType === 'max' || mlType === 'average')
- ) {
- var axisInfo = markerHelper.getAxisInfo(item, data, coordSys, seriesModel);
-
- var baseAxisKey = axisInfo.baseAxis.dim + 'Axis';
- var valueAxisKey = axisInfo.valueAxis.dim + 'Axis';
- var baseScaleExtent = axisInfo.baseAxis.scale.getExtent();
-
- var mlFrom = zrUtil.clone(item);
- var mlTo = {};
-
- mlFrom.type = null;
-
- // FIXME Polar should use circle
- mlFrom[baseAxisKey] = baseScaleExtent[0];
- mlTo[baseAxisKey] = baseScaleExtent[1];
-
- var value = markerHelper.numCalculate(data, axisInfo.valueDataDim, mlType);
-
- // Round if axis is cateogry
- value = axisInfo.valueAxis.coordToData(axisInfo.valueAxis.dataToCoord(value));
-
- var precision = mlModel.get('precision');
- if (precision >= 0) {
- value = +value.toFixed(precision);
- }
-
- mlFrom[valueAxisKey] = mlTo[valueAxisKey] = value;
-
- item = [mlFrom, mlTo, { // Extra option for tooltip and label
- type: mlType,
- valueIndex: item.valueIndex,
- // Force to use the value of calculated value.
- value: value
- }];
- }
-
- item = [
- markerHelper.dataTransform(seriesModel, item[0]),
- markerHelper.dataTransform(seriesModel, item[1]),
- zrUtil.extend({}, item[2])
- ];
-
- // Avoid line data type is extended by from(to) data type
- item[2].type = item[2].type || '';
-
- // Merge from option and to option into line option
- zrUtil.merge(item[2], item[0]);
- zrUtil.merge(item[2], item[1]);
-
- return item;
- };
-
- function markLineFilter(coordSys, item) {
- return markerHelper.dataFilter(coordSys, item[0])
- && markerHelper.dataFilter(coordSys, item[1]);
- }
-
- function updateSingleMarkerEndLayout(
- data, idx, isFrom, mlType, valueIndex, seriesModel, api
- ) {
- var coordSys = seriesModel.coordinateSystem;
- var itemModel = data.getItemModel(idx);
-
- var point;
- var xPx = itemModel.get('x');
- var yPx = itemModel.get('y');
- if (xPx != null && yPx != null) {
- point = [
- numberUtil.parsePercent(xPx, api.getWidth()),
- numberUtil.parsePercent(yPx, api.getHeight())
- ];
- }
- else {
- // Chart like bar may have there own marker positioning logic
- if (seriesModel.getMarkerPosition) {
- // Use the getMarkerPoisition
- point = seriesModel.getMarkerPosition(
- data.getValues(data.dimensions, idx)
- );
- }
- else {
- var dims = coordSys.dimensions;
- var x = data.get(dims[0], idx);
- var y = data.get(dims[1], idx);
- point = coordSys.dataToPoint([x, y]);
- }
- // Expand min, max, average line to the edge of grid
- // FIXME Glue code
- if (mlType && coordSys.type === 'cartesian2d') {
- var mlOnAxis = valueIndex != null
- ? coordSys.getAxis(valueIndex === 1 ? 'x' : 'y')
- : coordSys.getAxesByScale('ordinal')[0];
- if (mlOnAxis && mlOnAxis.onBand) {
- point[mlOnAxis.dim === 'x' ? 0 : 1] =
- mlOnAxis.toGlobalCoord(mlOnAxis.getExtent()[isFrom ? 0 : 1]);
- }
- }
- }
-
- data.setItemLayout(idx, point);
- }
-
- var markLineFormatMixin = {
- formatTooltip: function (dataIndex) {
- var data = this._data;
- var value = this.getRawValue(dataIndex);
- var formattedValue = zrUtil.isArray(value)
- ? zrUtil.map(value, addCommas).join(', ') : addCommas(value);
- var name = data.getName(dataIndex);
- return this.name + '<br />'
- + ((name ? encodeHTML(name) + ' : ' : '') + formattedValue);
- },
-
- getRawDataArray: function () {
- return this.option.data;
- },
-
- getData: function () {
- return this._data;
- },
-
- setData: function (data) {
- this._data = data;
- }
- };
-
- zrUtil.defaults(markLineFormatMixin, modelUtil.dataFormatMixin);
-
- __webpack_require__(1).extendComponentView({
-
- type: 'markLine',
-
- init: function () {
- /**
- * Markline grouped by series
- * @private
- * @type {Object}
- */
- this._markLineMap = {};
- },
-
- render: function (markLineModel, ecModel, api) {
- var lineDrawMap = this._markLineMap;
- for (var name in lineDrawMap) {
- lineDrawMap[name].__keep = false;
- }
-
- ecModel.eachSeries(function (seriesModel) {
- var mlModel = seriesModel.markLineModel;
- mlModel && this._renderSeriesML(seriesModel, mlModel, ecModel, api);
- }, this);
-
- for (var name in lineDrawMap) {
- if (!lineDrawMap[name].__keep) {
- this.group.remove(lineDrawMap[name].group);
- }
- }
- },
-
- updateLayout: function (markLineModel, ecModel, api) {
- ecModel.eachSeries(function (seriesModel) {
- var mlModel = seriesModel.markLineModel;
- if (mlModel) {
- var mlData = mlModel.getData();
- var fromData = mlModel.__from;
- var toData = mlModel.__to;
- // Update visual and layout of from symbol and to symbol
- fromData.each(function (idx) {
- var lineModel = mlData.getItemModel(idx);
- var mlType = lineModel.get('type');
- var valueIndex = lineModel.get('valueIndex');
- updateSingleMarkerEndLayout(fromData, idx, true, mlType, valueIndex, seriesModel, api);
- updateSingleMarkerEndLayout(toData, idx, false, mlType, valueIndex, seriesModel, api);
- });
- // Update layout of line
- mlData.each(function (idx) {
- mlData.setItemLayout(idx, [
- fromData.getItemLayout(idx),
- toData.getItemLayout(idx)
- ]);
- });
-
- this._markLineMap[seriesModel.name].updateLayout();
- }
- }, this);
- },
-
- _renderSeriesML: function (seriesModel, mlModel, ecModel, api) {
- var coordSys = seriesModel.coordinateSystem;
- var seriesName = seriesModel.name;
- var seriesData = seriesModel.getData();
-
- var lineDrawMap = this._markLineMap;
- var lineDraw = lineDrawMap[seriesName];
- if (!lineDraw) {
- lineDraw = lineDrawMap[seriesName] = new LineDraw();
- }
- this.group.add(lineDraw.group);
-
- var mlData = createList(coordSys, seriesModel, mlModel);
-
- var fromData = mlData.from;
- var toData = mlData.to;
- var lineData = mlData.line;
-
- mlModel.__from = fromData;
- mlModel.__to = toData;
- // Line data for tooltip and formatter
- zrUtil.extend(mlModel, markLineFormatMixin);
- mlModel.setData(lineData);
-
- var symbolType = mlModel.get('symbol');
- var symbolSize = mlModel.get('symbolSize');
- if (!zrUtil.isArray(symbolType)) {
- symbolType = [symbolType, symbolType];
- }
- if (typeof symbolSize === 'number') {
- symbolSize = [symbolSize, symbolSize];
- }
-
- // Update visual and layout of from symbol and to symbol
- mlData.from.each(function (idx) {
- var lineModel = lineData.getItemModel(idx);
- var mlType = lineModel.get('type');
- var valueIndex = lineModel.get('valueIndex');
- updateDataVisualAndLayout(fromData, idx, true, mlType, valueIndex);
- updateDataVisualAndLayout(toData, idx, false, mlType, valueIndex);
- });
-
- // Update visual and layout of line
- lineData.each(function (idx) {
- var lineColor = lineData.getItemModel(idx).get('lineStyle.normal.color');
- lineData.setItemVisual(idx, {
- color: lineColor || fromData.getItemVisual(idx, 'color')
- });
- lineData.setItemLayout(idx, [
- fromData.getItemLayout(idx),
- toData.getItemLayout(idx)
- ]);
- });
-
- lineDraw.updateData(lineData, fromData, toData);
-
- // Set host model for tooltip
- // FIXME
- mlData.line.eachItemGraphicEl(function (el, idx) {
- el.traverse(function (child) {
- child.dataModel = mlModel;
- });
- });
-
- function updateDataVisualAndLayout(data, idx, isFrom, mlType, valueIndex) {
- var itemModel = data.getItemModel(idx);
-
- updateSingleMarkerEndLayout(
- data, idx, isFrom, mlType, valueIndex, seriesModel, api
- );
-
- data.setItemVisual(idx, {
- symbolSize: itemModel.get('symbolSize')
- || symbolSize[isFrom ? 0 : 1],
- symbol: itemModel.get('symbol', true)
- || symbolType[isFrom ? 0 : 1],
- color: itemModel.get('itemStyle.normal.color')
- || seriesData.getVisual('color')
- });
- }
-
- lineDraw.__keep = true;
- }
- });
-
- /**
- * @inner
- * @param {module:echarts/coord/*} coordSys
- * @param {module:echarts/model/Series} seriesModel
- * @param {module:echarts/model/Model} mpModel
- */
- function createList(coordSys, seriesModel, mlModel) {
-
- var coordDimsInfos;
- if (coordSys) {
- coordDimsInfos = zrUtil.map(coordSys && coordSys.dimensions, function (coordDim) {
- var info = seriesModel.getData().getDimensionInfo(
- seriesModel.coordDimToDataDim(coordDim)[0]
- ) || {}; // In map series data don't have lng and lat dimension. Fallback to same with coordSys
- info.name = coordDim;
- return info;
- });
- }
- else {
- coordDimsInfos =[{
- name: 'value',
- type: 'float'
- }];
- }
-
- var fromData = new List(coordDimsInfos, mlModel);
- var toData = new List(coordDimsInfos, mlModel);
- // No dimensions
- var lineData = new List([], mlModel);
-
- var optData = zrUtil.map(mlModel.get('data'), zrUtil.curry(
- markLineTransform, seriesModel, coordSys, mlModel
- ));
- if (coordSys) {
- optData = zrUtil.filter(
- optData, zrUtil.curry(markLineFilter, coordSys)
- );
- }
- var dimValueGetter = coordSys ? markerHelper.dimValueGetter : function (item) {
- return item.value;
- };
- fromData.initData(
- zrUtil.map(optData, function (item) { return item[0]; }),
- null, dimValueGetter
- );
- toData.initData(
- zrUtil.map(optData, function (item) { return item[1]; }),
- null, dimValueGetter
- );
- lineData.initData(
- zrUtil.map(optData, function (item) { return item[2]; })
- );
- return {
- from: fromData,
- to: toData,
- line: lineData
- };
- }
-
-
-/***/ },
-/* 322 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * DataZoom component entry
- */
-
-
- var echarts = __webpack_require__(1);
-
- echarts.registerPreprocessor(__webpack_require__(323));
-
- __webpack_require__(324);
- __webpack_require__(325);
- __webpack_require__(326);
- __webpack_require__(328);
-
-
-
-/***/ },
-/* 323 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Timeline preprocessor
- */
-
-
- var zrUtil = __webpack_require__(3);
-
- module.exports = function (option) {
- var timelineOpt = option && option.timeline;
-
- if (!zrUtil.isArray(timelineOpt)) {
- timelineOpt = timelineOpt ? [timelineOpt] : [];
- }
-
- zrUtil.each(timelineOpt, function (opt) {
- if (!opt) {
- return;
- }
-
- compatibleEC2(opt);
- });
- };
-
- function compatibleEC2(opt) {
- var type = opt.type;
-
- var ec2Types = {'number': 'value', 'time': 'time'};
-
- // Compatible with ec2
- if (ec2Types[type]) {
- opt.axisType = ec2Types[type];
- delete opt.type;
- }
-
- transferItem(opt);
-
- if (has(opt, 'controlPosition')) {
- var controlStyle = opt.controlStyle || (opt.controlStyle = {});
- if (!has(controlStyle, 'position')) {
- controlStyle.position = opt.controlPosition;
- }
- if (controlStyle.position === 'none' && !has(controlStyle, 'show')) {
- controlStyle.show = false;
- delete controlStyle.position;
- }
- delete opt.controlPosition;
- }
-
- zrUtil.each(opt.data || [], function (dataItem) {
- if (zrUtil.isObject(dataItem) && !zrUtil.isArray(dataItem)) {
- if (!has(dataItem, 'value') && has(dataItem, 'name')) {
- // In ec2, using name as value.
- dataItem.value = dataItem.name;
- }
- transferItem(dataItem);
- }
- });
- }
-
- function transferItem(opt) {
- var itemStyle = opt.itemStyle || (opt.itemStyle = {});
-
- var itemStyleEmphasis = itemStyle.emphasis || (itemStyle.emphasis = {});
-
- // Transfer label out
- var label = opt.label || (opt.label || {});
- var labelNormal = label.normal || (label.normal = {});
- var excludeLabelAttr = {normal: 1, emphasis: 1};
-
- zrUtil.each(label, function (value, name) {
- if (!excludeLabelAttr[name] && !has(labelNormal, name)) {
- labelNormal[name] = value;
- }
- });
-
- if (itemStyleEmphasis.label && !has(label, 'emphasis')) {
- label.emphasis = itemStyleEmphasis.label;
- delete itemStyleEmphasis.label;
- }
- }
-
- function has(obj, attr) {
- return obj.hasOwnProperty(attr);
- }
-
-
-
-/***/ },
-/* 324 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- __webpack_require__(19).registerSubTypeDefaulter('timeline', function () {
- // Only slider now.
- return 'slider';
- });
-
-
-
-/***/ },
-/* 325 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Timeilne action
- */
-
-
- var echarts = __webpack_require__(1);
-
- echarts.registerAction(
-
- {type: 'timelineChange', event: 'timelineChanged', update: 'prepareAndUpdate'},
-
- function (payload, ecModel) {
-
- var timelineModel = ecModel.getComponent('timeline');
- if (timelineModel && payload.currentIndex != null) {
- timelineModel.setCurrentIndex(payload.currentIndex);
-
- if (!timelineModel.get('loop', true) && timelineModel.isIndexMax()) {
- timelineModel.setPlayState(false);
- }
- }
-
- ecModel.resetOption('timeline');
- }
- );
-
- echarts.registerAction(
-
- {type: 'timelinePlayChange', event: 'timelinePlayChanged', update: 'update'},
-
- function (payload, ecModel) {
- var timelineModel = ecModel.getComponent('timeline');
- if (timelineModel && payload.playState != null) {
- timelineModel.setPlayState(payload.playState);
- }
- }
- );
-
-
-
-/***/ },
-/* 326 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Silder timeline model
- */
-
-
- var TimelineModel = __webpack_require__(327);
-
- module.exports = TimelineModel.extend({
-
- type: 'timeline.slider',
-
- /**
- * @protected
- */
- defaultOption: {
-
- backgroundColor: 'rgba(0,0,0,0)', // 时间轴背景颜色
- borderColor: '#ccc', // 时间轴边框颜色
- borderWidth: 0, // 时间轴边框线宽,单位px,默认为0(无边框)
-
- orient: 'horizontal', // 'vertical'
- inverse: false,
-
- tooltip: { // boolean or Object
- trigger: 'item' // data item may also have tootip attr.
- },
-
- symbol: 'emptyCircle',
- symbolSize: 10,
-
- lineStyle: {
- show: true,
- width: 2,
- color: '#304654'
- },
- label: { // 文本标签
- position: 'auto', // auto left right top bottom
- // When using number, label position is not
- // restricted by viewRect.
- // positive: right/bottom, negative: left/top
- normal: {
- show: true,
- interval: 'auto',
- rotate: 0,
- // formatter: null,
- textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
- color: '#304654'
- }
- },
- emphasis: {
- show: true,
- textStyle: { // 其余属性默认使用全局文本样式,详见TEXTSTYLE
- color: '#c23531'
- }
- }
- },
- itemStyle: {
- normal: {
- color: '#304654',
- borderWidth: 1
- },
- emphasis: {
- color: '#c23531'
- }
- },
-
- checkpointStyle: {
- symbol: 'circle',
- symbolSize: 13,
- color: '#c23531',
- borderWidth: 5,
- borderColor: 'rgba(194,53,49, 0.5)',
- animation: true,
- animationDuration: 300,
- animationEasing: 'quinticInOut'
- },
-
- controlStyle: {
- show: true,
- showPlayBtn: true,
- showPrevBtn: true,
- showNextBtn: true,
- itemSize: 22,
- itemGap: 12,
- position: 'left', // 'left' 'right' 'top' 'bottom'
- playIcon: 'path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z', // jshint ignore:line
- stopIcon: 'path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z', // jshint ignore:line
- nextIcon: 'path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z', // jshint ignore:line
- prevIcon: 'path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z', // jshint ignore:line
- normal: {
- color: '#304654',
- borderColor: '#304654',
- borderWidth: 1
- },
- emphasis: {
- color: '#c23531',
- borderColor: '#c23531',
- borderWidth: 2
- }
- },
- data: []
- }
-
- });
-
-
-
-/***/ },
-/* 327 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Timeline model
- */
-
-
- var ComponentModel = __webpack_require__(19);
- var List = __webpack_require__(94);
- var zrUtil = __webpack_require__(3);
- var modelUtil = __webpack_require__(5);
-
- var TimelineModel = ComponentModel.extend({
-
- type: 'timeline',
-
- layoutMode: 'box',
-
- /**
- * @protected
- */
- defaultOption: {
-
- zlevel: 0, // 一级层叠
- z: 4, // 二级层叠
- show: true,
-
- axisType: 'time', // 模式是时间类型,支持 value, category
-
- realtime: true,
-
- left: '20%',
- top: null,
- right: '20%',
- bottom: 0,
- width: null,
- height: 40,
- padding: 5,
-
- controlPosition: 'left', // 'left' 'right' 'top' 'bottom' 'none'
- autoPlay: false,
- rewind: false, // 反向播放
- loop: true,
- playInterval: 2000, // 播放时间间隔,单位ms
-
- currentIndex: 0,
-
- itemStyle: {
- normal: {},
- emphasis: {}
- },
- label: {
- normal: {
- textStyle: {
- color: '#000'
- }
- },
- emphasis: {}
- },
-
- data: []
- },
-
- /**
- * @override
- */
- init: function (option, parentModel, ecModel) {
-
- /**
- * @private
- * @type {module:echarts/data/List}
- */
- this._data;
-
- /**
- * @private
- * @type {Array.<string>}
- */
- this._names;
-
- this.mergeDefaultAndTheme(option, ecModel);
- this._initData();
- },
-
- /**
- * @override
- */
- mergeOption: function (option) {
- TimelineModel.superApply(this, 'mergeOption', arguments);
- this._initData();
- },
-
- /**
- * @param {number} [currentIndex]
- */
- setCurrentIndex: function (currentIndex) {
- if (currentIndex == null) {
- currentIndex = this.option.currentIndex;
- }
- var count = this._data.count();
-
- if (this.option.loop) {
- currentIndex = (currentIndex % count + count) % count;
- }
- else {
- currentIndex >= count && (currentIndex = count - 1);
- currentIndex < 0 && (currentIndex = 0);
- }
-
- this.option.currentIndex = currentIndex;
- },
-
- /**
- * @return {number} currentIndex
- */
- getCurrentIndex: function () {
- return this.option.currentIndex;
- },
-
- /**
- * @return {boolean}
- */
- isIndexMax: function () {
- return this.getCurrentIndex() >= this._data.count() - 1;
- },
-
- /**
- * @param {boolean} state true: play, false: stop
- */
- setPlayState: function (state) {
- this.option.autoPlay = !!state;
- },
-
- /**
- * @return {boolean} true: play, false: stop
- */
- getPlayState: function () {
- return !!this.option.autoPlay;
- },
-
- /**
- * @private
- */
- _initData: function () {
- var thisOption = this.option;
- var dataArr = thisOption.data || [];
- var axisType = thisOption.axisType;
- var names = this._names = [];
-
- if (axisType === 'category') {
- var idxArr = [];
- zrUtil.each(dataArr, function (item, index) {
- var value = modelUtil.getDataItemValue(item);
- var newItem;
-
- if (zrUtil.isObject(item)) {
- newItem = zrUtil.clone(item);
- newItem.value = index;
- }
- else {
- newItem = index;
- }
-
- idxArr.push(newItem);
-
- if (!zrUtil.isString(value) && (value == null || isNaN(value))) {
- value = '';
- }
-
- names.push(value + '');
- });
- dataArr = idxArr;
- }
-
- var dimType = ({category: 'ordinal', time: 'time'})[axisType] || 'number';
-
- var data = this._data = new List([{name: 'value', type: dimType}], this);
-
- data.initData(dataArr, names);
- },
-
- getData: function () {
- return this._data;
- },
-
- /**
- * @public
- * @return {Array.<string>} categoreis
- */
- getCategories: function () {
- if (this.get('axisType') === 'category') {
- return this._names.slice();
- }
- }
-
- });
-
- module.exports = TimelineModel;
-
-
-/***/ },
-/* 328 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Silder timeline view
- */
-
-
- var zrUtil = __webpack_require__(3);
- var graphic = __webpack_require__(42);
- var layout = __webpack_require__(21);
- var TimelineView = __webpack_require__(329);
- var TimelineAxis = __webpack_require__(330);
- var symbolUtil = __webpack_require__(100);
- var axisHelper = __webpack_require__(108);
- var BoundingRect = __webpack_require__(15);
- var matrix = __webpack_require__(17);
- var numberUtil = __webpack_require__(7);
- var modelUtil = __webpack_require__(5);
- var formatUtil = __webpack_require__(6);
- var encodeHTML = formatUtil.encodeHTML;
-
- var bind = zrUtil.bind;
- var each = zrUtil.each;
-
- var PI = Math.PI;
-
- module.exports = TimelineView.extend({
-
- type: 'timeline.slider',
-
- init: function (ecModel, api) {
-
- this.api = api;
-
- /**
- * @private
- * @type {module:echarts/component/timeline/TimelineAxis}
- */
- this._axis;
-
- /**
- * @private
- * @type {module:zrender/core/BoundingRect}
- */
- this._viewRect;
-
- /**
- * @type {number}
- */
- this._timer;
-
- /**
- * @type {module:zrende/Element}
- */
- this._currentPointer;
-
- /**
- * @type {module:zrender/container/Group}
- */
- this._mainGroup;
-
- /**
- * @type {module:zrender/container/Group}
- */
- this._labelGroup;
- },
-
- /**
- * @override
- */
- render: function (timelineModel, ecModel, api, payload) {
- this.model = timelineModel;
- this.api = api;
- this.ecModel = ecModel;
-
- this.group.removeAll();
-
- if (timelineModel.get('show', true)) {
-
- var layoutInfo = this._layout(timelineModel, api);
- var mainGroup = this._createGroup('mainGroup');
- var labelGroup = this._createGroup('labelGroup');
-
- /**
- * @private
- * @type {module:echarts/component/timeline/TimelineAxis}
- */
- var axis = this._axis = this._createAxis(layoutInfo, timelineModel);
-
- each(
- ['AxisLine', 'AxisTick', 'Control', 'CurrentPointer'],
- function (name) {
- this['_render' + name](layoutInfo, mainGroup, axis, timelineModel);
- },
- this
- );
-
- this._renderAxisLabel(layoutInfo, labelGroup, axis, timelineModel);
-
- this._position(layoutInfo, timelineModel);
- }
-
- this._doPlayStop();
- },
-
- /**
- * @override
- */
- remove: function () {
- this._clearTimer();
- this.group.removeAll();
- },
-
- /**
- * @override
- */
- dispose: function () {
- this._clearTimer();
- },
-
- _layout: function (timelineModel, api) {
- var labelPosOpt = timelineModel.get('label.normal.position');
- var orient = timelineModel.get('orient');
- var viewRect = getViewRect(timelineModel, api);
- // Auto label offset.
- if (labelPosOpt == null || labelPosOpt === 'auto') {
- labelPosOpt = orient === 'horizontal'
- ? ((viewRect.y + viewRect.height / 2) < api.getHeight() / 2 ? '-' : '+')
- : ((viewRect.x + viewRect.width / 2) < api.getWidth() / 2 ? '+' : '-');
- }
- else if (isNaN(labelPosOpt)) {
- labelPosOpt = ({
- horizontal: {top: '-', bottom: '+'},
- vertical: {left: '-', right: '+'}
- })[orient][labelPosOpt];
- }
-
- // FIXME
- // 暂没有实现用户传入
- // var labelAlign = timelineModel.get('label.normal.textStyle.align');
- // var labelBaseline = timelineModel.get('label.normal.textStyle.baseline');
- var labelAlignMap = {
- horizontal: 'center',
- vertical: (labelPosOpt >= 0 || labelPosOpt === '+') ? 'left' : 'right'
- };
-
- var labelBaselineMap = {
- horizontal: (labelPosOpt >= 0 || labelPosOpt === '+') ? 'top' : 'bottom',
- vertical: 'middle'
- };
- var rotationMap = {
- horizontal: 0,
- vertical: PI / 2
- };
-
- // Position
- var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width;
-
- var controlModel = timelineModel.getModel('controlStyle');
- var showControl = controlModel.get('show');
- var controlSize = showControl ? controlModel.get('itemSize') : 0;
- var controlGap = showControl ? controlModel.get('itemGap') : 0;
- var sizePlusGap = controlSize + controlGap;
-
- // Special label rotate.
- var labelRotation = timelineModel.get('label.normal.rotate') || 0;
- labelRotation = labelRotation * PI / 180; // To radian.
-
- var playPosition;
- var prevBtnPosition;
- var nextBtnPosition;
- var axisExtent;
- var controlPosition = controlModel.get('position', true);
- var showControl = controlModel.get('show', true);
- var showPlayBtn = showControl && controlModel.get('showPlayBtn', true);
- var showPrevBtn = showControl && controlModel.get('showPrevBtn', true);
- var showNextBtn = showControl && controlModel.get('showNextBtn', true);
- var xLeft = 0;
- var xRight = mainLength;
-
- // position[0] means left, position[1] means middle.
- if (controlPosition === 'left' || controlPosition === 'bottom') {
- showPlayBtn && (playPosition = [0, 0], xLeft += sizePlusGap);
- showPrevBtn && (prevBtnPosition = [xLeft, 0], xLeft += sizePlusGap);
- showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);
- }
- else { // 'top' 'right'
- showPlayBtn && (playPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);
- showPrevBtn && (prevBtnPosition = [0, 0], xLeft += sizePlusGap);
- showNextBtn && (nextBtnPosition = [xRight - controlSize, 0], xRight -= sizePlusGap);
- }
- axisExtent = [xLeft, xRight];
-
- if (timelineModel.get('inverse')) {
- axisExtent.reverse();
- }
-
- return {
- viewRect: viewRect,
- mainLength: mainLength,
- orient: orient,
-
- rotation: rotationMap[orient],
- labelRotation: labelRotation,
- labelPosOpt: labelPosOpt,
- labelAlign: labelAlignMap[orient],
- labelBaseline: labelBaselineMap[orient],
-
- // Based on mainGroup.
- playPosition: playPosition,
- prevBtnPosition: prevBtnPosition,
- nextBtnPosition: nextBtnPosition,
- axisExtent: axisExtent,
-
- controlSize: controlSize,
- controlGap: controlGap
- };
- },
-
- _position: function (layoutInfo, timelineModel) {
- // Position is be called finally, because bounding rect is needed for
- // adapt content to fill viewRect (auto adapt offset).
-
- // Timeline may be not all in the viewRect when 'offset' is specified
- // as a number, because it is more appropriate that label aligns at
- // 'offset' but not the other edge defined by viewRect.
-
- var mainGroup = this._mainGroup;
- var labelGroup = this._labelGroup;
-
- var viewRect = layoutInfo.viewRect;
- if (layoutInfo.orient === 'vertical') {
- // transfrom to horizontal, inverse rotate by left-top point.
- var m = matrix.create();
- var rotateOriginX = viewRect.x;
- var rotateOriginY = viewRect.y + viewRect.height;
- matrix.translate(m, m, [-rotateOriginX, -rotateOriginY]);
- matrix.rotate(m, m, -PI / 2);
- matrix.translate(m, m, [rotateOriginX, rotateOriginY]);
- viewRect = viewRect.clone();
- viewRect.applyTransform(m);
- }
-
- var viewBound = getBound(viewRect);
- var mainBound = getBound(mainGroup.getBoundingRect());
- var labelBound = getBound(labelGroup.getBoundingRect());
-
- var mainPosition = mainGroup.position;
- var labelsPosition = labelGroup.position;
-
- labelsPosition[0] = mainPosition[0] = viewBound[0][0];
-
- var labelPosOpt = layoutInfo.labelPosOpt;
-
- if (isNaN(labelPosOpt)) { // '+' or '-'
- var mainBoundIdx = labelPosOpt === '+' ? 0 : 1;
- toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);
- toBound(labelsPosition, labelBound, viewBound, 1, 1 - mainBoundIdx);
- }
- else {
- var mainBoundIdx = labelPosOpt >= 0 ? 0 : 1;
- toBound(mainPosition, mainBound, viewBound, 1, mainBoundIdx);
- labelsPosition[1] = mainPosition[1] + labelPosOpt;
- }
-
- mainGroup.position = mainPosition;
- labelGroup.position = labelsPosition;
- mainGroup.rotation = labelGroup.rotation = layoutInfo.rotation;
-
- setOrigin(mainGroup);
- setOrigin(labelGroup);
-
- function setOrigin(targetGroup) {
- var pos = targetGroup.position;
- targetGroup.origin = [
- viewBound[0][0] - pos[0],
- viewBound[1][0] - pos[1]
- ];
- }
-
- function getBound(rect) {
- // [[xmin, xmax], [ymin, ymax]]
- return [
- [rect.x, rect.x + rect.width],
- [rect.y, rect.y + rect.height]
- ];
- }
-
- function toBound(fromPos, from, to, dimIdx, boundIdx) {
- fromPos[dimIdx] += to[dimIdx][boundIdx] - from[dimIdx][boundIdx];
- }
- },
-
- _createAxis: function (layoutInfo, timelineModel) {
- var data = timelineModel.getData();
- var axisType = timelineModel.get('axisType');
-
- var scale = axisHelper.createScaleByModel(timelineModel, axisType);
- var dataExtent = data.getDataExtent('value');
- scale.setExtent(dataExtent[0], dataExtent[1]);
- this._customizeScale(scale, data);
- scale.niceTicks();
-
- var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType);
- axis.model = timelineModel;
-
- return axis;
- },
-
- _customizeScale: function (scale, data) {
-
- scale.getTicks = function () {
- return data.mapArray(['value'], function (value) {
- return value;
- });
- };
-
- scale.getTicksLabels = function () {
- return zrUtil.map(this.getTicks(), scale.getLabel, scale);
- };
- },
-
- _createGroup: function (name) {
- var newGroup = this['_' + name] = new graphic.Group();
- this.group.add(newGroup);
- return newGroup;
- },
-
- _renderAxisLine: function (layoutInfo, group, axis, timelineModel) {
- var axisExtent = axis.getExtent();
-
- if (!timelineModel.get('lineStyle.show')) {
- return;
- }
-
- group.add(new graphic.Line({
- shape: {
- x1: axisExtent[0], y1: 0,
- x2: axisExtent[1], y2: 0
- },
- style: zrUtil.extend(
- {lineCap: 'round'},
- timelineModel.getModel('lineStyle').getLineStyle()
- ),
- silent: true,
- z2: 1
- }));
- },
-
- /**
- * @private
- */
- _renderAxisTick: function (layoutInfo, group, axis, timelineModel) {
- var data = timelineModel.getData();
- var ticks = axis.scale.getTicks();
- var tooltipHostModel = this._prepareTooltipHostModel(data, timelineModel);
-
- each(ticks, function (value, dataIndex) {
-
- var tickCoord = axis.dataToCoord(value);
- var itemModel = data.getItemModel(dataIndex);
- var itemStyleModel = itemModel.getModel('itemStyle.normal');
- var hoverStyleModel = itemModel.getModel('itemStyle.emphasis');
- var symbolOpt = {
- position: [tickCoord, 0],
- onclick: bind(this._changeTimeline, this, dataIndex)
- };
- var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt);
- graphic.setHoverStyle(el, hoverStyleModel.getItemStyle());
-
- if (itemModel.get('tooltip')) {
- el.dataIndex = dataIndex;
- el.dataModel = tooltipHostModel;
- }
- else {
- el.dataIndex = el.dataModel = null;
- }
-
- }, this);
- },
-
- /**
- * @private
- */
- _prepareTooltipHostModel: function (data, timelineModel) {
- var tooltipHostModel = modelUtil.createDataFormatModel(
- {}, data, timelineModel.get('data')
- );
- var me = this;
-
- tooltipHostModel.formatTooltip = function (dataIndex) {
- return encodeHTML(me._axis.scale.getLabel(dataIndex));
- };
-
- return tooltipHostModel;
- },
-
- /**
- * @private
- */
- _renderAxisLabel: function (layoutInfo, group, axis, timelineModel) {
- var labelModel = timelineModel.getModel('label.normal');
-
- if (!labelModel.get('show')) {
- return;
- }
-
- var data = timelineModel.getData();
- var ticks = axis.scale.getTicks();
- var labels = axisHelper.getFormattedLabels(
- axis, labelModel.get('formatter')
- );
- var labelInterval = axis.getLabelInterval();
-
- each(ticks, function (tick, dataIndex) {
- if (axis.isLabelIgnored(dataIndex, labelInterval)) {
- return;
- }
-
- var itemModel = data.getItemModel(dataIndex);
- var itemTextStyleModel = itemModel.getModel('label.normal.textStyle');
- var hoverTextStyleModel = itemModel.getModel('label.emphasis.textStyle');
- var tickCoord = axis.dataToCoord(tick);
- var textEl = new graphic.Text({
- style: {
- text: labels[dataIndex],
- textAlign: layoutInfo.labelAlign,
- textVerticalAlign: layoutInfo.labelBaseline,
- textFont: itemTextStyleModel.getFont(),
- fill: itemTextStyleModel.getTextColor()
- },
- position: [tickCoord, 0],
- rotation: layoutInfo.labelRotation - layoutInfo.rotation,
- onclick: bind(this._changeTimeline, this, dataIndex),
- silent: false
- });
-
- group.add(textEl);
- graphic.setHoverStyle(textEl, hoverTextStyleModel.getItemStyle());
-
- }, this);
- },
-
- /**
- * @private
- */
- _renderControl: function (layoutInfo, group, axis, timelineModel) {
- var controlSize = layoutInfo.controlSize;
- var rotation = layoutInfo.rotation;
-
- var itemStyle = timelineModel.getModel('controlStyle.normal').getItemStyle();
- var hoverStyle = timelineModel.getModel('controlStyle.emphasis').getItemStyle();
- var rect = [0, -controlSize / 2, controlSize, controlSize];
- var playState = timelineModel.getPlayState();
- var inverse = timelineModel.get('inverse', true);
-
- makeBtn(
- layoutInfo.nextBtnPosition,
- 'controlStyle.nextIcon',
- bind(this._changeTimeline, this, inverse ? '-' : '+')
- );
- makeBtn(
- layoutInfo.prevBtnPosition,
- 'controlStyle.prevIcon',
- bind(this._changeTimeline, this, inverse ? '+' : '-')
- );
- makeBtn(
- layoutInfo.playPosition,
- 'controlStyle.' + (playState ? 'stopIcon' : 'playIcon'),
- bind(this._handlePlayClick, this, !playState),
- true
- );
-
- function makeBtn(position, iconPath, onclick, willRotate) {
- if (!position) {
- return;
- }
- var opt = {
- position: position,
- origin: [controlSize / 2, 0],
- rotation: willRotate ? -rotation : 0,
- rectHover: true,
- style: itemStyle,
- onclick: onclick
- };
- var btn = makeIcon(timelineModel, iconPath, rect, opt);
- group.add(btn);
- graphic.setHoverStyle(btn, hoverStyle);
- }
- },
-
- _renderCurrentPointer: function (layoutInfo, group, axis, timelineModel) {
- var data = timelineModel.getData();
- var currentIndex = timelineModel.getCurrentIndex();
- var pointerModel = data.getItemModel(currentIndex).getModel('checkpointStyle');
- var me = this;
-
- var callback = {
- onCreate: function (pointer) {
- pointer.draggable = true;
- pointer.drift = bind(me._handlePointerDrag, me);
- pointer.ondragend = bind(me._handlePointerDragend, me);
- pointerMoveTo(pointer, currentIndex, axis, timelineModel, true);
- },
- onUpdate: function (pointer) {
- pointerMoveTo(pointer, currentIndex, axis, timelineModel);
- }
- };
-
- // Reuse when exists, for animation and drag.
- this._currentPointer = giveSymbol(
- pointerModel, pointerModel, this._mainGroup, {}, this._currentPointer, callback
- );
- },
-
- _handlePlayClick: function (nextState) {
- this._clearTimer();
- this.api.dispatchAction({
- type: 'timelinePlayChange',
- playState: nextState,
- from: this.uid
- });
- },
-
- _handlePointerDrag: function (dx, dy, e) {
- this._clearTimer();
- this._pointerChangeTimeline([e.offsetX, e.offsetY]);
- },
-
- _handlePointerDragend: function (e) {
- this._pointerChangeTimeline([e.offsetX, e.offsetY], true);
- },
-
- _pointerChangeTimeline: function (mousePos, trigger) {
- var toCoord = this._toAxisCoord(mousePos)[0];
-
- var axis = this._axis;
- var axisExtent = numberUtil.asc(axis.getExtent().slice());
-
- toCoord > axisExtent[1] && (toCoord = axisExtent[1]);
- toCoord < axisExtent[0] && (toCoord = axisExtent[0]);
-
- this._currentPointer.position[0] = toCoord;
- this._currentPointer.dirty();
-
- var targetDataIndex = this._findNearestTick(toCoord);
- var timelineModel = this.model;
-
- if (trigger || (
- targetDataIndex !== timelineModel.getCurrentIndex()
- && timelineModel.get('realtime')
- )) {
- this._changeTimeline(targetDataIndex);
- }
- },
-
- _doPlayStop: function () {
- this._clearTimer();
-
- if (this.model.getPlayState()) {
- this._timer = setTimeout(
- bind(handleFrame, this),
- this.model.get('playInterval')
- );
- }
-
- function handleFrame() {
- // Do not cache
- var timelineModel = this.model;
- this._changeTimeline(
- timelineModel.getCurrentIndex()
- + (timelineModel.get('rewind', true) ? -1 : 1)
- );
- }
- },
-
- _toAxisCoord: function (vertex) {
- var trans = this._mainGroup.getLocalTransform();
- return graphic.applyTransform(vertex, trans, true);
- },
-
- _findNearestTick: function (axisCoord) {
- var data = this.model.getData();
- var dist = Infinity;
- var targetDataIndex;
- var axis = this._axis;
-
- data.each(['value'], function (value, dataIndex) {
- var coord = axis.dataToCoord(value);
- var d = Math.abs(coord - axisCoord);
- if (d < dist) {
- dist = d;
- targetDataIndex = dataIndex;
- }
- });
-
- return targetDataIndex;
- },
-
- _clearTimer: function () {
- if (this._timer) {
- clearTimeout(this._timer);
- this._timer = null;
- }
- },
-
- _changeTimeline: function (nextIndex) {
- var currentIndex = this.model.getCurrentIndex();
-
- if (nextIndex === '+') {
- nextIndex = currentIndex + 1;
- }
- else if (nextIndex === '-') {
- nextIndex = currentIndex - 1;
- }
-
- this.api.dispatchAction({
- type: 'timelineChange',
- currentIndex: nextIndex,
- from: this.uid
- });
- }
-
- });
-
- function getViewRect(model, api) {
- return layout.getLayoutRect(
- model.getBoxLayoutParams(),
- {
- width: api.getWidth(),
- height: api.getHeight()
- },
- model.get('padding')
- );
- }
-
- function makeIcon(timelineModel, objPath, rect, opts) {
- var icon = graphic.makePath(
- timelineModel.get(objPath).replace(/^path:\/\//, ''),
- zrUtil.clone(opts || {}),
- new BoundingRect(rect[0], rect[1], rect[2], rect[3]),
- 'center'
- );
-
- return icon;
- }
-
- /**
- * Create symbol or update symbol
- */
- function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) {
- var symbolType = hostModel.get('symbol');
- var color = itemStyleModel.get('color');
- var symbolSize = hostModel.get('symbolSize');
- var halfSymbolSize = symbolSize / 2;
- var itemStyle = itemStyleModel.getItemStyle(['color', 'symbol', 'symbolSize']);
-
- if (!symbol) {
- symbol = symbolUtil.createSymbol(
- symbolType, -halfSymbolSize, -halfSymbolSize, symbolSize, symbolSize, color
- );
- group.add(symbol);
- callback && callback.onCreate(symbol);
- }
- else {
- symbol.setStyle(itemStyle);
- symbol.setColor(color);
- group.add(symbol); // Group may be new, also need to add.
- callback && callback.onUpdate(symbol);
- }
-
- opt = zrUtil.merge({
- rectHover: true,
- style: itemStyle,
- z2: 100
- }, opt, true);
-
- symbol.attr(opt);
-
- return symbol;
- }
-
- function pointerMoveTo(pointer, dataIndex, axis, timelineModel, noAnimation) {
- if (pointer.dragging) {
- return;
- }
-
- var pointerModel = timelineModel.getModel('checkpointStyle');
- var toCoord = axis.dataToCoord(timelineModel.getData().get(['value'], dataIndex));
-
- if (noAnimation || !pointerModel.get('animation', true)) {
- pointer.attr({position: [toCoord, 0]});
- }
- else {
- pointer.stopAnimation(true);
- pointer.animateTo(
- {position: [toCoord, 0]},
- pointerModel.get('animationDuration', true),
- pointerModel.get('animationEasing', true)
- );
- }
- }
-
-
-
-/***/ },
-/* 329 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Timeline view
- */
-
-
- // var zrUtil = require('zrender/lib/core/util');
- // var graphic = require('../../util/graphic');
- var ComponentView = __webpack_require__(28);
-
- module.exports = ComponentView.extend({
-
- type: 'timeline'
- });
-
-
-
-/***/ },
-/* 330 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var zrUtil = __webpack_require__(3);
- var Axis = __webpack_require__(117);
- var axisHelper = __webpack_require__(108);
-
- /**
- * Extend axis 2d
- * @constructor module:echarts/coord/cartesian/Axis2D
- * @extends {module:echarts/coord/cartesian/Axis}
- * @param {string} dim
- * @param {*} scale
- * @param {Array.<number>} coordExtent
- * @param {string} axisType
- * @param {string} position
- */
- var TimelineAxis = function (dim, scale, coordExtent, axisType) {
-
- Axis.call(this, dim, scale, coordExtent);
-
- /**
- * Axis type
- * - 'category'
- * - 'value'
- * - 'time'
- * - 'log'
- * @type {string}
- */
- this.type = axisType || 'value';
-
- /**
- * @private
- * @type {number}
- */
- this._autoLabelInterval;
-
- /**
- * Axis model
- * @param {module:echarts/component/TimelineModel}
- */
- this.model = null;
- };
-
- TimelineAxis.prototype = {
-
- constructor: TimelineAxis,
-
- /**
- * @public
- * @return {number}
- */
- getLabelInterval: function () {
- var timelineModel = this.model;
- var labelModel = timelineModel.getModel('label.normal');
- var labelInterval = labelModel.get('interval');
-
- if (labelInterval != null && labelInterval != 'auto') {
- return labelInterval;
- }
-
- var labelInterval = this._autoLabelInterval;
-
- if (!labelInterval) {
- labelInterval = this._autoLabelInterval = axisHelper.getAxisLabelInterval(
- zrUtil.map(this.scale.getTicks(), this.dataToCoord, this),
- axisHelper.getFormattedLabels(this, labelModel.get('formatter')),
- labelModel.getModel('textStyle').getFont(),
- timelineModel.get('orient') === 'horizontal'
- );
- }
-
- return labelInterval;
- },
-
- /**
- * If label is ignored.
- * Automatically used when axis is category and label can not be all shown
- * @public
- * @param {number} idx
- * @return {boolean}
- */
- isLabelIgnored: function (idx) {
- if (this.type === 'category') {
- var labelInterval = this.getLabelInterval();
- return ((typeof labelInterval === 'function')
- && !labelInterval(idx, this.scale.getLabel(idx)))
- || idx % (labelInterval + 1);
- }
- }
-
- };
-
- zrUtil.inherits(TimelineAxis, Axis);
-
- module.exports = TimelineAxis;
-
-
-/***/ },
-/* 331 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- __webpack_require__(332);
- __webpack_require__(334);
-
- __webpack_require__(336);
- __webpack_require__(337);
- __webpack_require__(338);
- __webpack_require__(339);
- __webpack_require__(344);
-
-
-/***/ },
-/* 332 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var featureManager = __webpack_require__(333);
- var zrUtil = __webpack_require__(3);
-
- var ToolboxModel = __webpack_require__(1).extendComponentModel({
-
- type: 'toolbox',
-
- layoutMode: {
- type: 'box',
- ignoreSize: true
- },
-
- mergeDefaultAndTheme: function (option) {
- ToolboxModel.superApply(this, 'mergeDefaultAndTheme', arguments);
-
- zrUtil.each(this.option.feature, function (featureOpt, featureName) {
- var Feature = featureManager.get(featureName);
- Feature && zrUtil.merge(featureOpt, Feature.defaultOption);
- });
- },
-
- defaultOption: {
-
- show: true,
-
- z: 6,
-
- zlevel: 0,
-
- orient: 'horizontal',
-
- left: 'right',
-
- top: 'top',
-
- // right
- // bottom
-
- backgroundColor: 'transparent',
-
- borderColor: '#ccc',
-
- borderWidth: 0,
-
- padding: 5,
-
- itemSize: 15,
-
- itemGap: 8,
-
- showTitle: true,
-
- iconStyle: {
- normal: {
- borderColor: '#666',
- color: 'none'
- },
- emphasis: {
- borderColor: '#3E98C5'
- }
- }
- // textStyle: {},
-
- // feature
- }
- });
-
- module.exports = ToolboxModel;
-
-
-/***/ },
-/* 333 */
-/***/ function(module, exports) {
-
- 'use strict';
-
-
- var features = {};
-
- module.exports = {
- register: function (name, ctor) {
- features[name] = ctor;
- },
-
- get: function (name) {
- return features[name];
- }
- };
-
-
-/***/ },
-/* 334 */
-/***/ function(module, exports, __webpack_require__) {
-
- /* WEBPACK VAR INJECTION */(function(process) {
-
- var featureManager = __webpack_require__(333);
- var zrUtil = __webpack_require__(3);
- var graphic = __webpack_require__(42);
- var Model = __webpack_require__(8);
- var DataDiffer = __webpack_require__(95);
- var listComponentHelper = __webpack_require__(266);
- var textContain = __webpack_require__(14);
-
- module.exports = __webpack_require__(1).extendComponentView({
-
- type: 'toolbox',
-
- render: function (toolboxModel, ecModel, api) {
- var group = this.group;
- group.removeAll();
-
- if (!toolboxModel.get('show')) {
- return;
- }
-
- var itemSize = +toolboxModel.get('itemSize');
- var featureOpts = toolboxModel.get('feature') || {};
- var features = this._features || (this._features = {});
-
- var featureNames = [];
- zrUtil.each(featureOpts, function (opt, name) {
- featureNames.push(name);
- });
-
- (new DataDiffer(this._featureNames || [], featureNames))
- .add(process)
- .update(process)
- .remove(zrUtil.curry(process, null))
- .execute();
-
- // Keep for diff.
- this._featureNames = featureNames;
-
- function process(newIndex, oldIndex) {
- var featureName = featureNames[newIndex];
- var oldName = featureNames[oldIndex];
- var featureOpt = featureOpts[featureName];
- var featureModel = new Model(featureOpt, toolboxModel, toolboxModel.ecModel);
- var feature;
-
- if (featureName && !oldName) { // Create
- if (isUserFeatureName(featureName)) {
- feature = {
- model: featureModel,
- onclick: featureModel.option.onclick,
- featureName: featureName
- };
- }
- else {
- var Feature = featureManager.get(featureName);
- if (!Feature) {
- return;
- }
- feature = new Feature(featureModel);
- }
- features[featureName] = feature;
- }
- else {
- feature = features[oldName];
- // If feature does not exsit.
- if (!feature) {
- return;
- }
- feature.model = featureModel;
- }
-
- if (!featureName && oldName) {
- feature.dispose && feature.dispose(ecModel, api);
- return;
- }
-
- if (!featureModel.get('show') || feature.unusable) {
- feature.remove && feature.remove(ecModel, api);
- return;
- }
-
- createIconPaths(featureModel, feature, featureName);
-
- featureModel.setIconStatus = function (iconName, status) {
- var option = this.option;
- var iconPaths = this.iconPaths;
- option.iconStatus = option.iconStatus || {};
- option.iconStatus[iconName] = status;
- // FIXME
- iconPaths[iconName] && iconPaths[iconName].trigger(status);
- };
-
- if (feature.render) {
- feature.render(featureModel, ecModel, api);
- }
- }
-
- function createIconPaths(featureModel, feature, featureName) {
- var iconStyleModel = featureModel.getModel('iconStyle');
-
- // If one feature has mutiple icon. they are orginaized as
- // {
- // icon: {
- // foo: '',
- // bar: ''
- // },
- // title: {
- // foo: '',
- // bar: ''
- // }
- // }
- var icons = feature.getIcons ? feature.getIcons() : featureModel.get('icon');
- var titles = featureModel.get('title') || {};
- if (typeof icons === 'string') {
- var icon = icons;
- var title = titles;
- icons = {};
- titles = {};
- icons[featureName] = icon;
- titles[featureName] = title;
- }
- var iconPaths = featureModel.iconPaths = {};
- zrUtil.each(icons, function (icon, iconName) {
- var normalStyle = iconStyleModel.getModel('normal').getItemStyle();
- var hoverStyle = iconStyleModel.getModel('emphasis').getItemStyle();
-
- var style = {
- x: -itemSize / 2,
- y: -itemSize / 2,
- width: itemSize,
- height: itemSize
- };
- var path = icon.indexOf('image://') === 0
- ? (
- style.image = icon.slice(8),
- new graphic.Image({style: style})
- )
- : graphic.makePath(
- icon.replace('path://', ''),
- {
- style: normalStyle,
- hoverStyle: hoverStyle,
- rectHover: true
- },
- style,
- 'center'
- );
-
- graphic.setHoverStyle(path);
-
- if (toolboxModel.get('showTitle')) {
- path.__title = titles[iconName];
- path.on('mouseover', function () {
- path.setStyle({
- text: titles[iconName],
- textPosition: hoverStyle.textPosition || 'bottom',
- textFill: hoverStyle.fill || hoverStyle.stroke || '#000',
- textAlign: hoverStyle.textAlign || 'center'
- });
- })
- .on('mouseout', function () {
- path.setStyle({
- textFill: null
- });
- });
- }
- path.trigger(featureModel.get('iconStatus.' + iconName) || 'normal');
-
- group.add(path);
- path.on('click', zrUtil.bind(
- feature.onclick, feature, ecModel, api, iconName
- ));
-
- iconPaths[iconName] = path;
- });
- }
-
- listComponentHelper.layout(group, toolboxModel, api);
- // Render background after group is layout
- // FIXME
- listComponentHelper.addBackground(group, toolboxModel);
-
- // Adjust icon title positions to avoid them out of screen
- group.eachChild(function (icon) {
- var titleText = icon.__title;
- var hoverStyle = icon.hoverStyle;
- // May be background element
- if (hoverStyle && titleText) {
- var rect = textContain.getBoundingRect(
- titleText, hoverStyle.font
- );
- var offsetX = icon.position[0] + group.position[0];
- var offsetY = icon.position[1] + group.position[1] + itemSize;
-
- var needPutOnTop = false;
- if (offsetY + rect.height > api.getHeight()) {
- hoverStyle.textPosition = 'top';
- needPutOnTop = true;
- }
- var topOffset = needPutOnTop ? (-5 - rect.height) : (itemSize + 8);
- if (offsetX + rect.width / 2 > api.getWidth()) {
- hoverStyle.textPosition = ['100%', topOffset];
- hoverStyle.textAlign = 'right';
- }
- else if (offsetX - rect.width / 2 < 0) {
- hoverStyle.textPosition = [0, topOffset];
- hoverStyle.textAlign = 'left';
- }
- }
- });
- },
-
- remove: function (ecModel, api) {
- zrUtil.each(this._features, function (feature) {
- feature.remove && feature.remove(ecModel, api);
- });
- this.group.removeAll();
- },
-
- dispose: function (ecModel, api) {
- zrUtil.each(this._features, function (feature) {
- feature.dispose && feature.dispose(ecModel, api);
- });
- }
- });
-
- function isUserFeatureName(featureName) {
- return featureName.indexOf('my') === 0;
- }
-
-
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(335)))
-
-/***/ },
-/* 335 */
-/***/ function(module, exports) {
-
- // shim for using process in browser
-
- var process = module.exports = {};
- var queue = [];
- var draining = false;
- var currentQueue;
- var queueIndex = -1;
-
- function cleanUpNextTick() {
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
- }
-
- function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = setTimeout(cleanUpNextTick);
- draining = true;
-
- var len = queue.length;
- while(len) {
- currentQueue = queue;
- queue = [];
- while (++queueIndex < len) {
- if (currentQueue) {
- currentQueue[queueIndex].run();
- }
- }
- queueIndex = -1;
- len = queue.length;
- }
- currentQueue = null;
- draining = false;
- clearTimeout(timeout);
- }
-
- process.nextTick = function (fun) {
- var args = new Array(arguments.length - 1);
- if (arguments.length > 1) {
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
- }
- queue.push(new Item(fun, args));
- if (queue.length === 1 && !draining) {
- setTimeout(drainQueue, 0);
- }
- };
-
- // v8 likes predictible objects
- function Item(fun, array) {
- this.fun = fun;
- this.array = array;
- }
- Item.prototype.run = function () {
- this.fun.apply(null, this.array);
- };
- process.title = 'browser';
- process.browser = true;
- process.env = {};
- process.argv = [];
- process.version = ''; // empty string to avoid regexp issues
- process.versions = {};
-
- function noop() {}
-
- process.on = noop;
- process.addListener = noop;
- process.once = noop;
- process.off = noop;
- process.removeListener = noop;
- process.removeAllListeners = noop;
- process.emit = noop;
-
- process.binding = function (name) {
- throw new Error('process.binding is not supported');
- };
-
- process.cwd = function () { return '/' };
- process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
- };
- process.umask = function() { return 0; };
-
-
-/***/ },
-/* 336 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- var env = __webpack_require__(78);
-
- function SaveAsImage (model) {
- this.model = model;
- }
-
- SaveAsImage.defaultOption = {
- show: true,
- icon: 'M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0',
- title: '保存为图片',
- type: 'png',
- // Default use option.backgroundColor
- // backgroundColor: '#fff',
- name: '',
- excludeComponents: ['toolbox'],
- pixelRatio: 1,
- lang: ['右键另存为图片']
- };
-
- SaveAsImage.prototype.unusable = !env.canvasSupported;
-
- var proto = SaveAsImage.prototype;
-
- proto.onclick = function (ecModel, api) {
- var model = this.model;
- var title = model.get('name') || ecModel.get('title.0.text') || 'echarts';
- var $a = document.createElement('a');
- var type = model.get('type', true) || 'png';
- $a.download = title + '.' + type;
- $a.target = '_blank';
- var url = api.getConnectedDataURL({
- type: type,
- backgroundColor: model.get('backgroundColor', true)
- || ecModel.get('backgroundColor') || '#fff',
- excludeComponents: model.get('excludeComponents'),
- pixelRatio: model.get('pixelRatio')
- });
- $a.href = url;
- // Chrome and Firefox
- if (typeof MouseEvent === 'function') {
- var evt = new MouseEvent('click', {
- view: window,
- bubbles: true,
- cancelable: false
- });
- $a.dispatchEvent(evt);
- }
- // IE
- else {
- var lang = model.get('lang');
- var html = ''
- + '<body style="margin:0;">'
- + '<img src="' + url + '" style="max-width:100%;" title="' + ((lang && lang[0]) || '') + '" />'
- + '</body>';
- var tab = window.open();
- tab.document.write(html);
- }
- };
-
- __webpack_require__(333).register(
- 'saveAsImage', SaveAsImage
- );
-
- module.exports = SaveAsImage;
-
-
-/***/ },
-/* 337 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
-
- function MagicType(model) {
- this.model = model;
- }
-
- MagicType.defaultOption = {
- show: true,
- type: [],
- // Icon group
- icon: {
- line: 'M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4',
- bar: 'M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7',
- stack: 'M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z', // jshint ignore:line
- tiled: 'M2.3,2.2h22.8V25H2.3V2.2z M35,2.2h22.8V25H35V2.2zM2.3,35h22.8v22.8H2.3V35z M35,35h22.8v22.8H35V35z'
- },
- title: {
- line: '切换为折线图',
- bar: '切换为柱状图',
- stack: '切换为堆叠',
- tiled: '切换为平铺'
- },
- option: {},
- seriesIndex: {}
- };
-
- var proto = MagicType.prototype;
-
- proto.getIcons = function () {
- var model = this.model;
- var availableIcons = model.get('icon');
- var icons = {};
- zrUtil.each(model.get('type'), function (type) {
- if (availableIcons[type]) {
- icons[type] = availableIcons[type];
- }
- });
- return icons;
- };
-
- var seriesOptGenreator = {
- 'line': function (seriesType, seriesId, seriesModel, model) {
- if (seriesType === 'bar') {
- return zrUtil.merge({
- id: seriesId,
- type: 'line',
- // Preserve data related option
- data: seriesModel.get('data'),
- stack: seriesModel.get('stack'),
- markPoint: seriesModel.get('markPoint'),
- markLine: seriesModel.get('markLine')
- }, model.get('option.line') || {}, true);
- }
- },
- 'bar': function (seriesType, seriesId, seriesModel, model) {
- if (seriesType === 'line') {
- return zrUtil.merge({
- id: seriesId,
- type: 'bar',
- // Preserve data related option
- data: seriesModel.get('data'),
- stack: seriesModel.get('stack'),
- markPoint: seriesModel.get('markPoint'),
- markLine: seriesModel.get('markLine')
- }, model.get('option.bar') || {}, true);
- }
- },
- 'stack': function (seriesType, seriesId, seriesModel, model) {
- if (seriesType === 'line' || seriesType === 'bar') {
- return zrUtil.merge({
- id: seriesId,
- stack: '__ec_magicType_stack__'
- }, model.get('option.stack') || {}, true);
- }
- },
- 'tiled': function (seriesType, seriesId, seriesModel, model) {
- if (seriesType === 'line' || seriesType === 'bar') {
- return zrUtil.merge({
- id: seriesId,
- stack: ''
- }, model.get('option.tiled') || {}, true);
- }
- }
- };
-
- var radioTypes = [
- ['line', 'bar'],
- ['stack', 'tiled']
- ];
-
- proto.onclick = function (ecModel, api, type) {
- var model = this.model;
- var seriesIndex = model.get('seriesIndex.' + type);
- // Not supported magicType
- if (!seriesOptGenreator[type]) {
- return;
- }
- var newOption = {
- series: []
- };
- var generateNewSeriesTypes = function (seriesModel) {
- var seriesType = seriesModel.subType;
- var seriesId = seriesModel.id;
- var newSeriesOpt = seriesOptGenreator[type](
- seriesType, seriesId, seriesModel, model
- );
- if (newSeriesOpt) {
- // PENDING If merge original option?
- zrUtil.defaults(newSeriesOpt, seriesModel.option);
- newOption.series.push(newSeriesOpt);
- }
- // Modify boundaryGap
- var coordSys = seriesModel.coordinateSystem;
- if (coordSys.type === 'cartesian2d') {
- var categoryAxis = coordSys.getAxesByScale('ordinal')[0];
- if (categoryAxis) {
- var axisDim = categoryAxis.dim;
- var axisIndex = seriesModel.get(axisDim + 'AxisIndex');
- var axisKey = axisDim + 'Axis';
- newOption[axisKey] = newOption[axisKey] || [];
- for (var i = 0; i <= axisIndex; i++) {
- newOption[axisKey][axisIndex] = newOption[axisKey][axisIndex] || {};
- }
- newOption[axisKey][axisIndex].boundaryGap = type === 'bar' ? true : false;
- }
- }
- };
-
- zrUtil.each(radioTypes, function (radio) {
- if (zrUtil.indexOf(radio, type) >= 0) {
- zrUtil.each(radio, function (item) {
- model.setIconStatus(item, 'normal');
- });
- }
- });
-
- model.setIconStatus(type, 'emphasis');
-
- ecModel.eachComponent(
- {
- mainType: 'series',
- query: seriesIndex == null ? null : {
- seriesIndex: seriesIndex
- }
- }, generateNewSeriesTypes
- );
- api.dispatchAction({
- type: 'changeMagicType',
- currentType: type,
- newOption: newOption
- });
- };
-
- var echarts = __webpack_require__(1);
- echarts.registerAction({
- type: 'changeMagicType',
- event: 'magicTypeChanged',
- update: 'prepareAndUpdate'
- }, function (payload, ecModel) {
- ecModel.mergeOption(payload.newOption);
- });
-
- __webpack_require__(333).register('magicType', MagicType);
-
- module.exports = MagicType;
-
-
-/***/ },
-/* 338 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @module echarts/component/toolbox/feature/DataView
- */
-
-
-
- var zrUtil = __webpack_require__(3);
- var eventTool = __webpack_require__(80);
-
-
- var BLOCK_SPLITER = new Array(60).join('-');
- var ITEM_SPLITER = '\t';
- /**
- * Group series into two types
- * 1. on category axis, like line, bar
- * 2. others, like scatter, pie
- * @param {module:echarts/model/Global} ecModel
- * @return {Object}
- * @inner
- */
- function groupSeries(ecModel) {
- var seriesGroupByCategoryAxis = {};
- var otherSeries = [];
- var meta = [];
- ecModel.eachRawSeries(function (seriesModel) {
- var coordSys = seriesModel.coordinateSystem;
-
- if (coordSys && (coordSys.type === 'cartesian2d' || coordSys.type === 'polar')) {
- var baseAxis = coordSys.getBaseAxis();
- if (baseAxis.type === 'category') {
- var key = baseAxis.dim + '_' + baseAxis.index;
- if (!seriesGroupByCategoryAxis[key]) {
- seriesGroupByCategoryAxis[key] = {
- categoryAxis: baseAxis,
- valueAxis: coordSys.getOtherAxis(baseAxis),
- series: []
- };
- meta.push({
- axisDim: baseAxis.dim,
- axisIndex: baseAxis.index
- });
- }
- seriesGroupByCategoryAxis[key].series.push(seriesModel);
- }
- else {
- otherSeries.push(seriesModel);
- }
- }
- else {
- otherSeries.push(seriesModel);
- }
- });
-
- return {
- seriesGroupByCategoryAxis: seriesGroupByCategoryAxis,
- other: otherSeries,
- meta: meta
- };
- }
-
- /**
- * Assemble content of series on cateogory axis
- * @param {Array.<module:echarts/model/Series>} series
- * @return {string}
- * @inner
- */
- function assembleSeriesWithCategoryAxis(series) {
- var tables = [];
- zrUtil.each(series, function (group, key) {
- var categoryAxis = group.categoryAxis;
- var valueAxis = group.valueAxis;
- var valueAxisDim = valueAxis.dim;
-
- var headers = [' '].concat(zrUtil.map(group.series, function (series) {
- return series.name;
- }));
- var columns = [categoryAxis.model.getCategories()];
- zrUtil.each(group.series, function (series) {
- columns.push(series.getRawData().mapArray(valueAxisDim, function (val) {
- return val;
- }));
- });
- // Assemble table content
- var lines = [headers.join(ITEM_SPLITER)];
- for (var i = 0; i < columns[0].length; i++) {
- var items = [];
- for (var j = 0; j < columns.length; j++) {
- items.push(columns[j][i]);
- }
- lines.push(items.join(ITEM_SPLITER));
- }
- tables.push(lines.join('\n'));
- });
- return tables.join('\n\n' + BLOCK_SPLITER + '\n\n');
- }
-
- /**
- * Assemble content of other series
- * @param {Array.<module:echarts/model/Series>} series
- * @return {string}
- * @inner
- */
- function assembleOtherSeries(series) {
- return zrUtil.map(series, function (series) {
- var data = series.getRawData();
- var lines = [series.name];
- var vals = [];
- data.each(data.dimensions, function () {
- var argLen = arguments.length;
- var dataIndex = arguments[argLen - 1];
- var name = data.getName(dataIndex);
- for (var i = 0; i < argLen - 1; i++) {
- vals[i] = arguments[i];
- }
- lines.push((name ? (name + ITEM_SPLITER) : '') + vals.join(ITEM_SPLITER));
- });
- return lines.join('\n');
- }).join('\n\n' + BLOCK_SPLITER + '\n\n');
- }
-
- /**
- * @param {module:echarts/model/Global}
- * @return {string}
- * @inner
- */
- function getContentFromModel(ecModel) {
-
- var result = groupSeries(ecModel);
-
- return {
- value: zrUtil.filter([
- assembleSeriesWithCategoryAxis(result.seriesGroupByCategoryAxis),
- assembleOtherSeries(result.other)
- ], function (str) {
- return str.replace(/[\n\t\s]/g, '');
- }).join('\n\n' + BLOCK_SPLITER + '\n\n'),
-
- meta: result.meta
- };
- }
-
-
- function trim(str) {
- return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
- }
- /**
- * If a block is tsv format
- */
- function isTSVFormat(block) {
- // Simple method to find out if a block is tsv format
- var firstLine = block.slice(0, block.indexOf('\n'));
- if (firstLine.indexOf(ITEM_SPLITER) >= 0) {
- return true;
- }
- }
-
- var itemSplitRegex = new RegExp('[' + ITEM_SPLITER + ']+', 'g');
- /**
- * @param {string} tsv
- * @return {Array.<Object>}
- */
- function parseTSVContents(tsv) {
- var tsvLines = tsv.split(/\n+/g);
- var headers = trim(tsvLines.shift()).split(itemSplitRegex);
-
- var categories = [];
- var series = zrUtil.map(headers, function (header) {
- return {
- name: header,
- data: []
- };
- });
- for (var i = 0; i < tsvLines.length; i++) {
- var items = trim(tsvLines[i]).split(itemSplitRegex);
- categories.push(items.shift());
- for (var j = 0; j < items.length; j++) {
- series[j] && (series[j].data[i] = items[j]);
- }
- }
- return {
- series: series,
- categories: categories
- };
- }
-
- /**
- * @param {string} str
- * @return {Array.<Object>}
- * @inner
- */
- function parseListContents(str) {
- var lines = str.split(/\n+/g);
- var seriesName = trim(lines.shift());
-
- var data = [];
- for (var i = 0; i < lines.length; i++) {
- var items = trim(lines[i]).split(itemSplitRegex);
- var name = '';
- var value;
- var hasName = false;
- if (isNaN(items[0])) { // First item is name
- hasName = true;
- name = items[0];
- items = items.slice(1);
- data[i] = {
- name: name,
- value: []
- };
- value = data[i].value;
- }
- else {
- value = data[i] = [];
- }
- for (var j = 0; j < items.length; j++) {
- value.push(+items[j]);
- }
- if (value.length === 1) {
- hasName ? (data[i].value = value[0]) : (data[i] = value[0]);
- }
- }
-
- return {
- name: seriesName,
- data: data
- };
- }
-
- /**
- * @param {string} str
- * @param {Array.<Object>} blockMetaList
- * @return {Object}
- * @inner
- */
- function parseContents(str, blockMetaList) {
- var blocks = str.split(new RegExp('\n*' + BLOCK_SPLITER + '\n*', 'g'));
- var newOption = {
- series: []
- };
- zrUtil.each(blocks, function (block, idx) {
- if (isTSVFormat(block)) {
- var result = parseTSVContents(block);
- var blockMeta = blockMetaList[idx];
- var axisKey = blockMeta.axisDim + 'Axis';
-
- if (blockMeta) {
- newOption[axisKey] = newOption[axisKey] || [];
- newOption[axisKey][blockMeta.axisIndex] = {
- data: result.categories
- };
- newOption.series = newOption.series.concat(result.series);
- }
- }
- else {
- var result = parseListContents(block);
- newOption.series.push(result);
- }
- });
- return newOption;
- }
-
- /**
- * @alias {module:echarts/component/toolbox/feature/DataView}
- * @constructor
- * @param {module:echarts/model/Model} model
- */
- function DataView(model) {
-
- this._dom = null;
-
- this.model = model;
- }
-
- DataView.defaultOption = {
- show: true,
- readOnly: false,
- optionToContent: null,
- contentToOption: null,
-
- icon: 'M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28',
- title: '数据视图',
- lang: ['数据视图', '关闭', '刷新'],
- backgroundColor: '#fff',
- textColor: '#000',
- textareaColor: '#fff',
- textareaBorderColor: '#333',
- buttonColor: '#c23531',
- buttonTextColor: '#fff'
- };
-
- DataView.prototype.onclick = function (ecModel, api) {
- var container = api.getDom();
- var model = this.model;
- if (this._dom) {
- container.removeChild(this._dom);
- }
- var root = document.createElement('div');
- root.style.cssText = 'position:absolute;left:5px;top:5px;bottom:5px;right:5px;';
- root.style.backgroundColor = model.get('backgroundColor') || '#fff';
-
- // Create elements
- var header = document.createElement('h4');
- var lang = model.get('lang') || [];
- header.innerHTML = lang[0] || model.get('title');
- header.style.cssText = 'margin: 10px 20px;';
- header.style.color = model.get('textColor');
-
- var viewMain = document.createElement('div');
- var textarea = document.createElement('textarea');
- viewMain.style.cssText = 'display:block;width:100%;overflow:hidden;';
-
- var optionToContent = model.get('optionToContent');
- var contentToOption = model.get('contentToOption');
- var result = getContentFromModel(ecModel);
- if (typeof optionToContent === 'function') {
- var htmlOrDom = optionToContent(api.getOption());
- if (typeof htmlOrDom === 'string') {
- viewMain.innerHTML = htmlOrDom;
- }
- else if (zrUtil.isDom(htmlOrDom)) {
- viewMain.appendChild(htmlOrDom);
- }
- }
- else {
- // Use default textarea
- viewMain.appendChild(textarea);
- textarea.readOnly = model.get('readOnly');
- textarea.style.cssText = 'width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;';
- textarea.style.color = model.get('textColor');
- textarea.style.borderColor = model.get('textareaBorderColor');
- textarea.style.backgroundColor = model.get('textareaColor');
- textarea.value = result.value;
- }
-
- var blockMetaList = result.meta;
-
- var buttonContainer = document.createElement('div');
- buttonContainer.style.cssText = 'position:absolute;bottom:0;left:0;right:0;';
-
- var buttonStyle = 'float:right;margin-right:20px;border:none;'
- + 'cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px';
- var closeButton = document.createElement('div');
- var refreshButton = document.createElement('div');
-
- buttonStyle += ';background-color:' + model.get('buttonColor');
- buttonStyle += ';color:' + model.get('buttonTextColor');
-
- var self = this;
-
- function close() {
- container.removeChild(root);
- self._dom = null;
- }
- eventTool.addEventListener(closeButton, 'click', close);
-
- eventTool.addEventListener(refreshButton, 'click', function () {
- var newOption;
- try {
- if (typeof contentToOption === 'function') {
- newOption = contentToOption(viewMain, api.getOption());
- }
- else {
- newOption = parseContents(textarea.value, blockMetaList);
- }
- }
- catch (e) {
- close();
- throw new Error('Data view format error ' + e);
- }
- if (newOption) {
- api.dispatchAction({
- type: 'changeDataView',
- newOption: newOption
- });
- }
-
- close();
- });
-
- closeButton.innerHTML = lang[1];
- refreshButton.innerHTML = lang[2];
- refreshButton.style.cssText = buttonStyle;
- closeButton.style.cssText = buttonStyle;
-
- !model.get('readOnly') && buttonContainer.appendChild(refreshButton);
- buttonContainer.appendChild(closeButton);
-
- // http://stackoverflow.com/questions/6637341/use-tab-to-indent-in-textarea
- eventTool.addEventListener(textarea, 'keydown', function (e) {
- if ((e.keyCode || e.which) === 9) {
- // get caret position/selection
- var val = this.value;
- var start = this.selectionStart;
- var end = this.selectionEnd;
-
- // set textarea value to: text before caret + tab + text after caret
- this.value = val.substring(0, start) + ITEM_SPLITER + val.substring(end);
-
- // put caret at right position again
- this.selectionStart = this.selectionEnd = start + 1;
-
- // prevent the focus lose
- eventTool.stop(e);
- }
- });
-
- root.appendChild(header);
- root.appendChild(viewMain);
- root.appendChild(buttonContainer);
-
- viewMain.style.height = (container.clientHeight - 80) + 'px';
-
- container.appendChild(root);
- this._dom = root;
- };
-
- DataView.prototype.remove = function (ecModel, api) {
- this._dom && api.getDom().removeChild(this._dom);
- };
-
- DataView.prototype.dispose = function (ecModel, api) {
- this.remove(ecModel, api);
- };
-
- /**
- * @inner
- */
- function tryMergeDataOption(newData, originalData) {
- return zrUtil.map(newData, function (newVal, idx) {
- var original = originalData && originalData[idx];
- if (zrUtil.isObject(original) && !zrUtil.isArray(original)) {
- if (zrUtil.isObject(newVal) && !zrUtil.isArray(newVal)) {
- newVal = newVal.value;
- }
- // Original data has option
- return zrUtil.defaults({
- value: newVal
- }, original);
- }
- else {
- return newVal;
- }
- });
- }
-
- __webpack_require__(333).register('dataView', DataView);
-
- __webpack_require__(1).registerAction({
- type: 'changeDataView',
- event: 'dataViewChanged',
- update: 'prepareAndUpdate'
- }, function (payload, ecModel) {
- var newSeriesOptList = [];
- zrUtil.each(payload.newOption.series, function (seriesOpt) {
- var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0];
- if (!seriesModel) {
- // New created series
- // Geuss the series type
- newSeriesOptList.push(zrUtil.extend({
- // Default is scatter
- type: 'scatter'
- }, seriesOpt));
- }
- else {
- var originalData = seriesModel.get('data');
- newSeriesOptList.push({
- name: seriesOpt.name,
- data: tryMergeDataOption(seriesOpt.data, originalData)
- });
- }
- });
-
- ecModel.mergeOption(zrUtil.defaults({
- series: newSeriesOptList
- }, payload.newOption));
- });
-
- module.exports = DataView;
-
-
-/***/ },
-/* 339 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var zrUtil = __webpack_require__(3);
- var numberUtil = __webpack_require__(7);
- var SelectController = __webpack_require__(225);
- var BoundingRect = __webpack_require__(15);
- var Group = __webpack_require__(29);
- var history = __webpack_require__(340);
- var interactionMutex = __webpack_require__(160);
-
- var each = zrUtil.each;
- var asc = numberUtil.asc;
-
- // Use dataZoomSelect
- __webpack_require__(341);
-
- // Spectial component id start with \0ec\0, see echarts/model/Global.js~hasInnerId
- var DATA_ZOOM_ID_BASE = '\0_ec_\0toolbox-dataZoom_';
-
- function DataZoom(model) {
- this.model = model;
-
- /**
- * @private
- * @type {module:zrender/container/Group}
- */
- this._controllerGroup;
-
- /**
- * @private
- * @type {module:echarts/component/helper/SelectController}
- */
- this._controller;
-
- /**
- * Is zoom active.
- * @private
- * @type {Object}
- */
- this._isZoomActive;
- }
-
- DataZoom.defaultOption = {
- show: true,
- // Icon group
- icon: {
- zoom: 'M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1',
- back: 'M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26'
- },
- title: {
- zoom: '区域缩放',
- back: '区域缩放还原'
- }
- };
-
- var proto = DataZoom.prototype;
-
- proto.render = function (featureModel, ecModel, api) {
- updateBackBtnStatus(featureModel, ecModel);
- };
-
- proto.onclick = function (ecModel, api, type) {
- var controllerGroup = this._controllerGroup;
- if (!this._controllerGroup) {
- controllerGroup = this._controllerGroup = new Group();
- api.getZr().add(controllerGroup);
- }
-
- handlers[type].call(this, controllerGroup, this.model, ecModel, api);
- };
-
- proto.remove = function (ecModel, api) {
- this._disposeController();
- interactionMutex.release('globalPan', api.getZr());
- };
-
- proto.dispose = function (ecModel, api) {
- var zr = api.getZr();
- interactionMutex.release('globalPan', zr);
- this._disposeController();
- this._controllerGroup && zr.remove(this._controllerGroup);
- };
-
- /**
- * @private
- */
- var handlers = {
-
- zoom: function (controllerGroup, featureModel, ecModel, api) {
- var isZoomActive = this._isZoomActive = !this._isZoomActive;
- var zr = api.getZr();
-
- interactionMutex[isZoomActive ? 'take' : 'release']('globalPan', zr);
-
- featureModel.setIconStatus('zoom', isZoomActive ? 'emphasis' : 'normal');
-
- if (isZoomActive) {
- zr.setDefaultCursorStyle('crosshair');
-
- this._createController(
- controllerGroup, featureModel, ecModel, api
- );
- }
- else {
- zr.setDefaultCursorStyle('default');
- this._disposeController();
- }
- },
-
- back: function (controllerGroup, featureModel, ecModel, api) {
- this._dispatchAction(history.pop(ecModel), api);
- }
- };
-
- /**
- * @private
- */
- proto._createController = function (
- controllerGroup, featureModel, ecModel, api
- ) {
- var controller = this._controller = new SelectController(
- 'rect',
- api.getZr(),
- {
- // FIXME
- lineWidth: 3,
- stroke: '#333',
- fill: 'rgba(0,0,0,0.2)'
- }
- );
- controller.on(
- 'selectEnd',
- zrUtil.bind(
- this._onSelected, this, controller,
- featureModel, ecModel, api
- )
- );
- controller.enable(controllerGroup, false);
- };
-
- proto._disposeController = function () {
- var controller = this._controller;
- if (controller) {
- controller.off('selected');
- controller.dispose();
- }
- };
-
- function prepareCoordInfo(grid, ecModel) {
- // Default use the first axis.
- // FIXME
- var coordInfo = [
- {axisModel: grid.getAxis('x').model, axisIndex: 0}, // x
- {axisModel: grid.getAxis('y').model, axisIndex: 0} // y
- ];
- coordInfo.grid = grid;
-
- ecModel.eachComponent(
- {mainType: 'dataZoom', subType: 'select'},
- function (dzModel, dataZoomIndex) {
- if (isTheAxis('xAxis', coordInfo[0].axisModel, dzModel, ecModel)) {
- coordInfo[0].dataZoomModel = dzModel;
- }
- if (isTheAxis('yAxis', coordInfo[1].axisModel, dzModel, ecModel)) {
- coordInfo[1].dataZoomModel = dzModel;
- }
- }
- );
-
- return coordInfo;
- }
-
- function isTheAxis(axisName, axisModel, dataZoomModel, ecModel) {
- var axisIndex = dataZoomModel.get(axisName + 'Index');
- return axisIndex != null
- && ecModel.getComponent(axisName, axisIndex) === axisModel;
- }
-
- /**
- * @private
- */
- proto._onSelected = function (controller, featureModel, ecModel, api, selRanges) {
- if (!selRanges.length) {
- return;
- }
- var selRange = selRanges[0];
-
- controller.update(); // remove cover
-
- var snapshot = {};
-
- // FIXME
- // polar
-
- ecModel.eachComponent('grid', function (gridModel, gridIndex) {
- var grid = gridModel.coordinateSystem;
- var coordInfo = prepareCoordInfo(grid, ecModel);
- var selDataRange = pointToDataInCartesian(selRange, coordInfo);
-
- if (selDataRange) {
- var xBatchItem = scaleCartesianAxis(selDataRange, coordInfo, 0, 'x');
- var yBatchItem = scaleCartesianAxis(selDataRange, coordInfo, 1, 'y');
-
- xBatchItem && (snapshot[xBatchItem.dataZoomId] = xBatchItem);
- yBatchItem && (snapshot[yBatchItem.dataZoomId] = yBatchItem);
- }
- }, this);
-
- history.push(ecModel, snapshot);
-
- this._dispatchAction(snapshot, api);
- };
-
- function pointToDataInCartesian(selRange, coordInfo) {
- var grid = coordInfo.grid;
-
- var selRect = new BoundingRect(
- selRange[0][0],
- selRange[1][0],
- selRange[0][1] - selRange[0][0],
- selRange[1][1] - selRange[1][0]
- );
- if (!selRect.intersect(grid.getRect())) {
- return;
- }
- var cartesian = grid.getCartesian(coordInfo[0].axisIndex, coordInfo[1].axisIndex);
- var dataLeftTop = cartesian.pointToData([selRange[0][0], selRange[1][0]], true);
- var dataRightBottom = cartesian.pointToData([selRange[0][1], selRange[1][1]], true);
-
- return [
- asc([dataLeftTop[0], dataRightBottom[0]]), // x, using asc to handle inverse
- asc([dataLeftTop[1], dataRightBottom[1]]) // y, using asc to handle inverse
- ];
- }
-
- function scaleCartesianAxis(selDataRange, coordInfo, dimIdx, dimName) {
- var dimCoordInfo = coordInfo[dimIdx];
- var dataZoomModel = dimCoordInfo.dataZoomModel;
-
- if (dataZoomModel) {
- return {
- dataZoomId: dataZoomModel.id,
- startValue: selDataRange[dimIdx][0],
- endValue: selDataRange[dimIdx][1]
- };
- }
- }
-
- /**
- * @private
- */
- proto._dispatchAction = function (snapshot, api) {
- var batch = [];
-
- each(snapshot, function (batchItem) {
- batch.push(batchItem);
- });
-
- batch.length && api.dispatchAction({
- type: 'dataZoom',
- from: this.uid,
- batch: zrUtil.clone(batch, true)
- });
- };
-
- function updateBackBtnStatus(featureModel, ecModel) {
- featureModel.setIconStatus(
- 'back',
- history.count(ecModel) > 1 ? 'emphasis' : 'normal'
- );
- }
-
-
- __webpack_require__(333).register('dataZoom', DataZoom);
-
-
- // Create special dataZoom option for select
- __webpack_require__(1).registerPreprocessor(function (option) {
- if (!option) {
- return;
- }
-
- var dataZoomOpts = option.dataZoom || (option.dataZoom = []);
- if (!zrUtil.isArray(dataZoomOpts)) {
- dataZoomOpts = [dataZoomOpts];
- }
-
- var toolboxOpt = option.toolbox;
- if (toolboxOpt) {
- // Assume there is only one toolbox
- if (zrUtil.isArray(toolboxOpt)) {
- toolboxOpt = toolboxOpt[0];
- }
-
- if (toolboxOpt && toolboxOpt.feature) {
- var dataZoomOpt = toolboxOpt.feature.dataZoom;
- addForAxis('xAxis', dataZoomOpt);
- addForAxis('yAxis', dataZoomOpt);
- }
- }
-
- function addForAxis(axisName, dataZoomOpt) {
- if (!dataZoomOpt) {
- return;
- }
-
- var axisIndicesName = axisName + 'Index';
- var givenAxisIndices = dataZoomOpt[axisIndicesName];
- if (givenAxisIndices != null && !zrUtil.isArray(givenAxisIndices)) {
- givenAxisIndices = givenAxisIndices === false ? [] : [givenAxisIndices];
- }
-
- forEachComponent(axisName, function (axisOpt, axisIndex) {
- if (givenAxisIndices != null
- && zrUtil.indexOf(givenAxisIndices, axisIndex) === -1
- ) {
- return;
- }
- var newOpt = {
- type: 'select',
- $fromToolbox: true,
- // Id for merge mapping.
- id: DATA_ZOOM_ID_BASE + axisName + axisIndex
- };
- // FIXME
- // Only support one axis now.
- newOpt[axisIndicesName] = axisIndex;
- dataZoomOpts.push(newOpt);
- });
- }
-
- function forEachComponent(mainType, cb) {
- var opts = option[mainType];
- if (!zrUtil.isArray(opts)) {
- opts = opts ? [opts] : [];
- }
- each(opts, cb);
- }
- });
-
- module.exports = DataZoom;
-
-
-/***/ },
-/* 340 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file History manager.
- */
-
-
- var zrUtil = __webpack_require__(3);
- var each = zrUtil.each;
-
- var ATTR = '\0_ec_hist_store';
-
- var history = {
-
- /**
- * @public
- * @param {module:echarts/model/Global} ecModel
- * @param {Object} newSnapshot {dataZoomId, batch: [payloadInfo, ...]}
- */
- push: function (ecModel, newSnapshot) {
- var store = giveStore(ecModel);
-
- // If previous dataZoom can not be found,
- // complete an range with current range.
- each(newSnapshot, function (batchItem, dataZoomId) {
- var i = store.length - 1;
- for (; i >= 0; i--) {
- var snapshot = store[i];
- if (snapshot[dataZoomId]) {
- break;
- }
- }
- if (i < 0) {
- // No origin range set, create one by current range.
- var dataZoomModel = ecModel.queryComponents(
- {mainType: 'dataZoom', subType: 'select', id: dataZoomId}
- )[0];
- if (dataZoomModel) {
- var percentRange = dataZoomModel.getPercentRange();
- store[0][dataZoomId] = {
- dataZoomId: dataZoomId,
- start: percentRange[0],
- end: percentRange[1]
- };
- }
- }
- });
-
- store.push(newSnapshot);
- },
-
- /**
- * @public
- * @param {module:echarts/model/Global} ecModel
- * @return {Object} snapshot
- */
- pop: function (ecModel) {
- var store = giveStore(ecModel);
- var head = store[store.length - 1];
- store.length > 1 && store.pop();
-
- // Find top for all dataZoom.
- var snapshot = {};
- each(head, function (batchItem, dataZoomId) {
- for (var i = store.length - 1; i >= 0; i--) {
- var batchItem = store[i][dataZoomId];
- if (batchItem) {
- snapshot[dataZoomId] = batchItem;
- break;
- }
- }
- });
-
- return snapshot;
- },
-
- /**
- * @public
- */
- clear: function (ecModel) {
- ecModel[ATTR] = null;
- },
-
- /**
- * @public
- * @param {module:echarts/model/Global} ecModel
- * @return {number} records. always >= 1.
- */
- count: function (ecModel) {
- return giveStore(ecModel).length;
- }
-
- };
-
- /**
- * [{key: dataZoomId, value: {dataZoomId, range}}, ...]
- * History length of each dataZoom may be different.
- * this._history[0] is used to store origin range.
- * @type {Array.<Object>}
- */
- function giveStore(ecModel) {
- var store = ecModel[ATTR];
- if (!store) {
- store = ecModel[ATTR] = [{}];
- }
- return store;
- }
-
- module.exports = history;
-
-
-
-/***/ },
-/* 341 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * DataZoom component entry
- */
-
-
- __webpack_require__(287);
-
- __webpack_require__(288);
- __webpack_require__(290);
-
- __webpack_require__(342);
- __webpack_require__(343);
-
- __webpack_require__(298);
- __webpack_require__(299);
-
-
-
-/***/ },
-/* 342 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * @file Data zoom model
- */
-
-
- var DataZoomModel = __webpack_require__(288);
-
- module.exports = DataZoomModel.extend({
-
- type: 'dataZoom.select'
-
- });
-
-
-
-/***/ },
-/* 343 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- module.exports = __webpack_require__(290).extend({
-
- type: 'dataZoom.select'
-
- });
-
-
-
-/***/ },
-/* 344 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
-
- var history = __webpack_require__(340);
-
- function Restore(model) {
- this.model = model;
- }
-
- Restore.defaultOption = {
- show: true,
- icon: 'M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5',
- title: '还原'
- };
-
- var proto = Restore.prototype;
-
- proto.onclick = function (ecModel, api, type) {
- history.clear(ecModel);
-
- api.dispatchAction({
- type: 'restore',
- from: this.uid
- });
- };
-
-
- __webpack_require__(333).register('restore', Restore);
-
-
- __webpack_require__(1).registerAction(
- {type: 'restore', event: 'restore', update: 'prepareAndUpdate'},
- function (payload, ecModel) {
- ecModel.resetOption('recreate');
- }
- );
-
- module.exports = Restore;
-
-
-/***/ },
-/* 345 */
-/***/ function(module, exports, __webpack_require__) {
-
-
- __webpack_require__(346);
- __webpack_require__(77).registerPainter('vml', __webpack_require__(348));
-
-
-/***/ },
-/* 346 */
-/***/ function(module, exports, __webpack_require__) {
-
- // http://www.w3.org/TR/NOTE-VML
- // TODO Use proxy like svg instead of overwrite brush methods
-
-
- if (!__webpack_require__(78).canvasSupported) {
- var vec2 = __webpack_require__(16);
- var BoundingRect = __webpack_require__(15);
- var CMD = __webpack_require__(48).CMD;
- var colorTool = __webpack_require__(38);
- var textContain = __webpack_require__(14);
- var RectText = __webpack_require__(47);
- var Displayable = __webpack_require__(45);
- var ZImage = __webpack_require__(59);
- var Text = __webpack_require__(62);
- var Path = __webpack_require__(44);
-
- var Gradient = __webpack_require__(4);
-
- var vmlCore = __webpack_require__(347);
-
- var round = Math.round;
- var sqrt = Math.sqrt;
- var abs = Math.abs;
- var cos = Math.cos;
- var sin = Math.sin;
- var mathMax = Math.max;
-
- var applyTransform = vec2.applyTransform;
-
- var comma = ',';
- var imageTransformPrefix = 'progid:DXImageTransform.Microsoft';
-
- var Z = 21600;
- var Z2 = Z / 2;
-
- var ZLEVEL_BASE = 100000;
- var Z_BASE = 1000;
-
- var initRootElStyle = function (el) {
- el.style.cssText = 'position:absolute;left:0;top:0;width:1px;height:1px;';
- el.coordsize = Z + ',' + Z;
- el.coordorigin = '0,0';
- };
-
- var encodeHtmlAttribute = function (s) {
- return String(s).replace(/&/g, '&amp;').replace(/"/g, '&quot;');
- };
-
- var rgb2Str = function (r, g, b) {
- return 'rgb(' + [r, g, b].join(',') + ')';
- };
-
- var append = function (parent, child) {
- if (child && parent && child.parentNode !== parent) {
- parent.appendChild(child);
- }
- };
-
- var remove = function (parent, child) {
- if (child && parent && child.parentNode === parent) {
- parent.removeChild(child);
- }
- };
-
- var getZIndex = function (zlevel, z, z2) {
- // z 的取值范围为 [0, 1000]
- return (parseFloat(zlevel) || 0) * ZLEVEL_BASE + (parseFloat(z) || 0) * Z_BASE + z2;
- };
-
- var parsePercent = function (value, maxValue) {
- if (typeof value === 'string') {
- if (value.lastIndexOf('%') >= 0) {
- return parseFloat(value) / 100 * maxValue;
- }
- return parseFloat(value);
- }
- return value;
- };
-
- /***************************************************
- * PATH
- **************************************************/
-
- var setColorAndOpacity = function (el, color, opacity) {
- var colorArr = colorTool.parse(color);
- opacity = +opacity;
- if (isNaN(opacity)) {
- opacity = 1;
- }
- if (colorArr) {
- el.color = rgb2Str(colorArr[0], colorArr[1], colorArr[2]);
- el.opacity = opacity * colorArr[3];
- }
- };
-
- var getColorAndAlpha = function (color) {
- var colorArr = colorTool.parse(color);
- return [
- rgb2Str(colorArr[0], colorArr[1], colorArr[2]),
- colorArr[3]
- ];
- };
-
- var updateFillNode = function (el, style, zrEl) {
- // TODO pattern
- var fill = style.fill;
- if (fill != null) {
- // Modified from excanvas
- if (fill instanceof Gradient) {
- var gradientType;
- var angle = 0;
- var focus = [0, 0];
- // additional offset
- var shift = 0;
- // scale factor for offset
- var expansion = 1;
- var rect = zrEl.getBoundingRect();
- var rectWidth = rect.width;
- var rectHeight = rect.height;
- if (fill.type === 'linear') {
- gradientType = 'gradient';
- var transform = zrEl.transform;
- var p0 = [fill.x * rectWidth, fill.y * rectHeight];
- var p1 = [fill.x2 * rectWidth, fill.y2 * rectHeight];
- if (transform) {
- applyTransform(p0, p0, transform);
- applyTransform(p1, p1, transform);
- }
- var dx = p1[0] - p0[0];
- var dy = p1[1] - p0[1];
- angle = Math.atan2(dx, dy) * 180 / Math.PI;
- // The angle should be a non-negative number.
- if (angle < 0) {
- angle += 360;
- }
-
- // Very small angles produce an unexpected result because they are
- // converted to a scientific notation string.
- if (angle < 1e-6) {
- angle = 0;
- }
- }
- else {
- gradientType = 'gradientradial';
- var p0 = [fill.x * rectWidth, fill.y * rectHeight];
- var transform = zrEl.transform;
- var scale = zrEl.scale;
- var width = rectWidth;
- var height = rectHeight;
- focus = [
- // Percent in bounding rect
- (p0[0] - rect.x) / width,
- (p0[1] - rect.y) / height
- ];
- if (transform) {
- applyTransform(p0, p0, transform);
- }
-
- width /= scale[0] * Z;
- height /= scale[1] * Z;
- var dimension = mathMax(width, height);
- shift = 2 * 0 / dimension;
- expansion = 2 * fill.r / dimension - shift;
- }
-
- // We need to sort the color stops in ascending order by offset,
- // otherwise IE won't interpret it correctly.
- var stops = fill.colorStops.slice();
- stops.sort(function(cs1, cs2) {
- return cs1.offset - cs2.offset;
- });
-
- var length = stops.length;
- // Color and alpha list of first and last stop
- var colorAndAlphaList = [];
- var colors = [];
- for (var i = 0; i < length; i++) {
- var stop = stops[i];
- var colorAndAlpha = getColorAndAlpha(stop.color);
- colors.push(stop.offset * expansion + shift + ' ' + colorAndAlpha[0]);
- if (i === 0 || i === length - 1) {
- colorAndAlphaList.push(colorAndAlpha);
- }
- }
-
- if (length >= 2) {
- var color1 = colorAndAlphaList[0][0];
- var color2 = colorAndAlphaList[1][0];
- var opacity1 = colorAndAlphaList[0][1] * style.opacity;
- var opacity2 = colorAndAlphaList[1][1] * style.opacity;
-
- el.type = gradientType;
- el.method = 'none';
- el.focus = '100%';
- el.angle = angle;
- el.color = color1;
- el.color2 = color2;
- el.colors = colors.join(',');
- // When colors attribute is used, the meanings of opacity and o:opacity2
- // are reversed.
- el.opacity = opacity2;
- // FIXME g_o_:opacity ?
- el.opacity2 = opacity1;
- }
- if (gradientType === 'radial') {
- el.focusposition = focus.join(',');
- }
- }
- else {
- // FIXME Change from Gradient fill to color fill
- setColorAndOpacity(el, fill, style.opacity);
- }
- }
- };
-
- var updateStrokeNode = function (el, style) {
- if (style.lineJoin != null) {
- el.joinstyle = style.lineJoin;
- }
- if (style.miterLimit != null) {
- el.miterlimit = style.miterLimit * Z;
- }
- if (style.lineCap != null) {
- el.endcap = style.lineCap;
- }
- if (style.lineDash != null) {
- el.dashstyle = style.lineDash.join(' ');
- }
- if (style.stroke != null && !(style.stroke instanceof Gradient)) {
- setColorAndOpacity(el, style.stroke, style.opacity);
- }
- };
-
- var updateFillAndStroke = function (vmlEl, type, style, zrEl) {
- var isFill = type == 'fill';
- var el = vmlEl.getElementsByTagName(type)[0];
- // Stroke must have lineWidth
- if (style[type] != null && style[type] !== 'none' && (isFill || (!isFill && style.lineWidth))) {
- vmlEl[isFill ? 'filled' : 'stroked'] = 'true';
- // FIXME Remove before updating, or set `colors` will throw error
- if (style[type] instanceof Gradient) {
- remove(vmlEl, el);
- }
- if (!el) {
- el = vmlCore.createNode(type);
- }
-
- isFill ? updateFillNode(el, style, zrEl) : updateStrokeNode(el, style);
- append(vmlEl, el);
- }
- else {
- vmlEl[isFill ? 'filled' : 'stroked'] = 'false';
- remove(vmlEl, el);
- }
- };
-
- var points = [[], [], []];
- var pathDataToString = function (data, m) {
- var M = CMD.M;
- var C = CMD.C;
- var L = CMD.L;
- var A = CMD.A;
- var Q = CMD.Q;
-
- var str = [];
- var nPoint;
- var cmdStr;
- var cmd;
- var i;
- var xi;
- var yi;
- for (i = 0; i < data.length;) {
- cmd = data[i++];
- cmdStr = '';
- nPoint = 0;
- switch (cmd) {
- case M:
- cmdStr = ' m ';
- nPoint = 1;
- xi = data[i++];
- yi = data[i++];
- points[0][0] = xi;
- points[0][1] = yi;
- break;
- case L:
- cmdStr = ' l ';
- nPoint = 1;
- xi = data[i++];
- yi = data[i++];
- points[0][0] = xi;
- points[0][1] = yi;
- break;
- case Q:
- case C:
- cmdStr = ' c ';
- nPoint = 3;
- var x1 = data[i++];
- var y1 = data[i++];
- var x2 = data[i++];
- var y2 = data[i++];
- var x3;
- var y3;
- if (cmd === Q) {
- // Convert quadratic to cubic using degree elevation
- x3 = x2;
- y3 = y2;
- x2 = (x2 + 2 * x1) / 3;
- y2 = (y2 + 2 * y1) / 3;
- x1 = (xi + 2 * x1) / 3;
- y1 = (yi + 2 * y1) / 3;
- }
- else {
- x3 = data[i++];
- y3 = data[i++];
- }
- points[0][0] = x1;
- points[0][1] = y1;
- points[1][0] = x2;
- points[1][1] = y2;
- points[2][0] = x3;
- points[2][1] = y3;
-
- xi = x3;
- yi = y3;
- break;
- case A:
- var x = 0;
- var y = 0;
- var sx = 1;
- var sy = 1;
- var angle = 0;
- if (m) {
- // Extract SRT from matrix
- x = m[4];
- y = m[5];
- sx = sqrt(m[0] * m[0] + m[1] * m[1]);
- sy = sqrt(m[2] * m[2] + m[3] * m[3]);
- angle = Math.atan2(-m[1] / sy, m[0] / sx);
- }
-
- var cx = data[i++];
- var cy = data[i++];
- var rx = data[i++];
- var ry = data[i++];
- var startAngle = data[i++] + angle;
- var endAngle = data[i++] + startAngle + angle;
- // FIXME
- // var psi = data[i++];
- i++;
- var clockwise = data[i++];
-
- var x0 = cx + cos(startAngle) * rx;
- var y0 = cy + sin(startAngle) * ry;
-
- var x1 = cx + cos(endAngle) * rx;
- var y1 = cy + sin(endAngle) * ry;
-
- var type = clockwise ? ' wa ' : ' at ';
-
- str.push(
- type,
- round(((cx - rx) * sx + x) * Z - Z2), comma,
- round(((cy - ry) * sy + y) * Z - Z2), comma,
- round(((cx + rx) * sx + x) * Z - Z2), comma,
- round(((cy + ry) * sy + y) * Z - Z2), comma,
- round((x0 * sx + x) * Z - Z2), comma,
- round((y0 * sy + y) * Z - Z2), comma,
- round((x1 * sx + x) * Z - Z2), comma,
- round((y1 * sy + y) * Z - Z2)
- );
-
- xi = x1;
- yi = y1;
- break;
- case CMD.R:
- var p0 = points[0];
- var p1 = points[1];
- // x0, y0
- p0[0] = data[i++];
- p0[1] = data[i++];
- // x1, y1
- p1[0] = p0[0] + data[i++];
- p1[1] = p0[1] + data[i++];
-
- if (m) {
- applyTransform(p0, p0, m);
- applyTransform(p1, p1, m);
- }
-
- p0[0] = round(p0[0] * Z - Z2);
- p1[0] = round(p1[0] * Z - Z2);
- p0[1] = round(p0[1] * Z - Z2);
- p1[1] = round(p1[1] * Z - Z2);
- str.push(
- // x0, y0
- ' m ', p0[0], comma, p0[1],
- // x1, y0
- ' l ', p1[0], comma, p0[1],
- // x1, y1
- ' l ', p1[0], comma, p1[1],
- // x0, y1
- ' l ', p0[0], comma, p1[1]
- );
- break;
- case CMD.Z:
- // FIXME Update xi, yi
- str.push(' x ');
- }
-
- if (nPoint > 0) {
- str.push(cmdStr);
- for (var k = 0; k < nPoint; k++) {
- var p = points[k];
-
- m && applyTransform(p, p, m);
- // 不 round 会非常慢
- str.push(
- round(p[0] * Z - Z2), comma, round(p[1] * Z - Z2),
- k < nPoint - 1 ? comma : ''
- );
- }
- }
- }
- return str.join('');
- };
-
- // Rewrite the original path method
- Path.prototype.brushVML = function (vmlRoot) {
- var style = this.style;
-
- var vmlEl = this._vmlEl;
- if (!vmlEl) {
- vmlEl = vmlCore.createNode('shape');
- initRootElStyle(vmlEl);
-
- this._vmlEl = vmlEl;
- }
-
- updateFillAndStroke(vmlEl, 'fill', style, this);
- updateFillAndStroke(vmlEl, 'stroke', style, this);
-
- var m = this.transform;
- var needTransform = m != null;
- var strokeEl = vmlEl.getElementsByTagName('stroke')[0];
- if (strokeEl) {
- var lineWidth = style.lineWidth;
- // Get the line scale.
- // Determinant of this.m_ means how much the area is enlarged by the
- // transformation. So its square root can be used as a scale factor
- // for width.
- if (needTransform && !style.strokeNoScale) {
- var det = m[0] * m[3] - m[1] * m[2];
- lineWidth *= sqrt(abs(det));
- }
- strokeEl.weight = lineWidth + 'px';
- }
-
- var path = this.path;
- if (this.__dirtyPath) {
- path.beginPath();
- this.buildPath(path, this.shape);
- this.__dirtyPath = false;
- }
-
- vmlEl.path = pathDataToString(path.data, this.transform);
-
- vmlEl.style.zIndex = getZIndex(this.zlevel, this.z, this.z2);
-
- // Append to root
- append(vmlRoot, vmlEl);
-
- // Text
- if (style.text) {
- this.drawRectText(vmlRoot, this.getBoundingRect());
- }
- };
-
- Path.prototype.onRemove = function (vmlRoot) {
- remove(vmlRoot, this._vmlEl);
- this.removeRectText(vmlRoot);
- };
-
- Path.prototype.onAdd = function (vmlRoot) {
- append(vmlRoot, this._vmlEl);
- this.appendRectText(vmlRoot);
- };
-
- /***************************************************
- * IMAGE
- **************************************************/
- var isImage = function (img) {
- // FIXME img instanceof Image 如果 img 是一个字符串的时候,IE8 下会报错
- return (typeof img === 'object') && img.tagName && img.tagName.toUpperCase() === 'IMG';
- // return img instanceof Image;
- };
-
- // Rewrite the original path method
- ZImage.prototype.brushVML = function (vmlRoot) {
- var style = this.style;
- var image = style.image;
-
- // Image original width, height
- var ow;
- var oh;
-
- if (isImage(image)) {
- var src = image.src;
- if (src === this._imageSrc) {
- ow = this._imageWidth;
- oh = this._imageHeight;
- }
- else {
- var imageRuntimeStyle = image.runtimeStyle;
- var oldRuntimeWidth = imageRuntimeStyle.width;
- var oldRuntimeHeight = imageRuntimeStyle.height;
- imageRuntimeStyle.width = 'auto';
- imageRuntimeStyle.height = 'auto';
-
- // get the original size
- ow = image.width;
- oh = image.height;
-
- // and remove overides
- imageRuntimeStyle.width = oldRuntimeWidth;
- imageRuntimeStyle.height = oldRuntimeHeight;
-
- // Caching image original width, height and src
- this._imageSrc = src;
- this._imageWidth = ow;
- this._imageHeight = oh;
- }
- image = src;
- }
- else {
- if (image === this._imageSrc) {
- ow = this._imageWidth;
- oh = this._imageHeight;
- }
- }
- if (!image) {
- return;
- }
-
- var x = style.x || 0;
- var y = style.y || 0;
-
- var dw = style.width;
- var dh = style.height;
-
- var sw = style.sWidth;
- var sh = style.sHeight;
- var sx = style.sx || 0;
- var sy = style.sy || 0;
-
- var hasCrop = sw && sh;
-
- var vmlEl = this._vmlEl;
- if (!vmlEl) {
- // FIXME 使用 group 在 left, top 都不是 0 的时候就无法显示了。
- // vmlEl = vmlCore.createNode('group');
- vmlEl = vmlCore.doc.createElement('div');
- initRootElStyle(vmlEl);
-
- this._vmlEl = vmlEl;
- }
-
- var vmlElStyle = vmlEl.style;
- var hasRotation = false;
- var m;
- var scaleX = 1;
- var scaleY = 1;
- if (this.transform) {
- m = this.transform;
- scaleX = sqrt(m[0] * m[0] + m[1] * m[1]);
- scaleY = sqrt(m[2] * m[2] + m[3] * m[3]);
-
- hasRotation = m[1] || m[2];
- }
- if (hasRotation) {
- // If filters are necessary (rotation exists), create them
- // filters are bog-slow, so only create them if abbsolutely necessary
- // The following check doesn't account for skews (which don't exist
- // in the canvas spec (yet) anyway.
- // From excanvas
- var p0 = [x, y];
- var p1 = [x + dw, y];
- var p2 = [x, y + dh];
- var p3 = [x + dw, y + dh];
- applyTransform(p0, p0, m);
- applyTransform(p1, p1, m);
- applyTransform(p2, p2, m);
- applyTransform(p3, p3, m);
-
- var maxX = mathMax(p0[0], p1[0], p2[0], p3[0]);
- var maxY = mathMax(p0[1], p1[1], p2[1], p3[1]);
-
- var transformFilter = [];
- transformFilter.push('M11=', m[0] / scaleX, comma,
- 'M12=', m[2] / scaleY, comma,
- 'M21=', m[1] / scaleX, comma,
- 'M22=', m[3] / scaleY, comma,
- 'Dx=', round(x * scaleX + m[4]), comma,
- 'Dy=', round(y * scaleY + m[5]));
-
- vmlElStyle.padding = '0 ' + round(maxX) + 'px ' + round(maxY) + 'px 0';
- // FIXME DXImageTransform 在 IE11 的兼容模式下不起作用
- vmlElStyle.filter = imageTransformPrefix + '.Matrix('
- + transformFilter.join('') + ', SizingMethod=clip)';
-
- }
- else {
- if (m) {
- x = x * scaleX + m[4];
- y = y * scaleY + m[5];
- }
- vmlElStyle.filter = '';
- vmlElStyle.left = round(x) + 'px';
- vmlElStyle.top = round(y) + 'px';
- }
-
- var imageEl = this._imageEl;
- var cropEl = this._cropEl;
-
- if (! imageEl) {
- imageEl = vmlCore.doc.createElement('div');
- this._imageEl = imageEl;
- }
- var imageELStyle = imageEl.style;
- if (hasCrop) {
- // Needs know image original width and height
- if (! (ow && oh)) {
- var tmpImage = new Image();
- var self = this;
- tmpImage.onload = function () {
- tmpImage.onload = null;
- ow = tmpImage.width;
- oh = tmpImage.height;
- // Adjust image width and height to fit the ratio destinationSize / sourceSize
- imageELStyle.width = round(scaleX * ow * dw / sw) + 'px';
- imageELStyle.height = round(scaleY * oh * dh / sh) + 'px';
-
- // Caching image original width, height and src
- self._imageWidth = ow;
- self._imageHeight = oh;
- self._imageSrc = image;
- };
- tmpImage.src = image;
- }
- else {
- imageELStyle.width = round(scaleX * ow * dw / sw) + 'px';
- imageELStyle.height = round(scaleY * oh * dh / sh) + 'px';
- }
-
- if (! cropEl) {
- cropEl = vmlCore.doc.createElement('div');
- cropEl.style.overflow = 'hidden';
- this._cropEl = cropEl;
- }
- var cropElStyle = cropEl.style;
- cropElStyle.width = round((dw + sx * dw / sw) * scaleX);
- cropElStyle.height = round((dh + sy * dh / sh) * scaleY);
- cropElStyle.filter = imageTransformPrefix + '.Matrix(Dx='
- + (-sx * dw / sw * scaleX) + ',Dy=' + (-sy * dh / sh * scaleY) + ')';
-
- if (! cropEl.parentNode) {
- vmlEl.appendChild(cropEl);
- }
- if (imageEl.parentNode != cropEl) {
- cropEl.appendChild(imageEl);
- }
- }
- else {
- imageELStyle.width = round(scaleX * dw) + 'px';
- imageELStyle.height = round(scaleY * dh) + 'px';
-
- vmlEl.appendChild(imageEl);
-
- if (cropEl && cropEl.parentNode) {
- vmlEl.removeChild(cropEl);
- this._cropEl = null;
- }
- }
-
- var filterStr = '';
- var alpha = style.opacity;
- if (alpha < 1) {
- filterStr += '.Alpha(opacity=' + round(alpha * 100) + ') ';
- }
- filterStr += imageTransformPrefix + '.AlphaImageLoader(src=' + image + ', SizingMethod=scale)';
-
- imageELStyle.filter = filterStr;
-
- vmlEl.style.zIndex = getZIndex(this.zlevel, this.z, this.z2);
-
- // Append to root
- append(vmlRoot, vmlEl);
-
- // Text
- if (style.text) {
- this.drawRectText(vmlRoot, this.getBoundingRect());
- }
- };
-
- ZImage.prototype.onRemove = function (vmlRoot) {
- remove(vmlRoot, this._vmlEl);
-
- this._vmlEl = null;
- this._cropEl = null;
- this._imageEl = null;
-
- this.removeRectText(vmlRoot);
- };
-
- ZImage.prototype.onAdd = function (vmlRoot) {
- append(vmlRoot, this._vmlEl);
- this.appendRectText(vmlRoot);
- };
-
-
- /***************************************************
- * TEXT
- **************************************************/
-
- var DEFAULT_STYLE_NORMAL = 'normal';
-
- var fontStyleCache = {};
- var fontStyleCacheCount = 0;
- var MAX_FONT_CACHE_SIZE = 100;
- var fontEl = document.createElement('div');
-
- var getFontStyle = function (fontString) {
- var fontStyle = fontStyleCache[fontString];
- if (!fontStyle) {
- // Clear cache
- if (fontStyleCacheCount > MAX_FONT_CACHE_SIZE) {
- fontStyleCacheCount = 0;
- fontStyleCache = {};
- }
-
- var style = fontEl.style;
- var fontFamily;
- try {
- style.font = fontString;
- fontFamily = style.fontFamily.split(',')[0];
- }
- catch (e) {
- }
-
- fontStyle = {
- style: style.fontStyle || DEFAULT_STYLE_NORMAL,
- variant: style.fontVariant || DEFAULT_STYLE_NORMAL,
- weight: style.fontWeight || DEFAULT_STYLE_NORMAL,
- size: parseFloat(style.fontSize || 12) | 0,
- family: fontFamily || 'Microsoft YaHei'
- };
-
- fontStyleCache[fontString] = fontStyle;
- fontStyleCacheCount++;
- }
- return fontStyle;
- };
-
- var textMeasureEl;
- // Overwrite measure text method
- textContain.measureText = function (text, textFont) {
- var doc = vmlCore.doc;
- if (!textMeasureEl) {
- textMeasureEl = doc.createElement('div');
- textMeasureEl.style.cssText = 'position:absolute;top:-20000px;left:0;'
- + 'padding:0;margin:0;border:none;white-space:pre;';
- vmlCore.doc.body.appendChild(textMeasureEl);
- }
-
- try {
- textMeasureEl.style.font = textFont;
- } catch (ex) {
- // Ignore failures to set to invalid font.
- }
- textMeasureEl.innerHTML = '';
- // Don't use innerHTML or innerText because they allow markup/whitespace.
- textMeasureEl.appendChild(doc.createTextNode(text));
- return {
- width: textMeasureEl.offsetWidth
- };
- };
-
- var tmpRect = new BoundingRect();
-
- var drawRectText = function (vmlRoot, rect, textRect, fromTextEl) {
-
- var style = this.style;
- var text = style.text;
- if (!text) {
- return;
- }
-
- var x;
- var y;
- var align = style.textAlign;
- var fontStyle = getFontStyle(style.textFont);
- // FIXME encodeHtmlAttribute ?
- var font = fontStyle.style + ' ' + fontStyle.variant + ' ' + fontStyle.weight + ' '
- + fontStyle.size + 'px "' + fontStyle.family + '"';
- var baseline = style.textBaseline;
- var verticalAlign = style.textVerticalAlign;
-
- textRect = textRect || textContain.getBoundingRect(text, font, align, baseline);
-
- // Transform rect to view space
- var m = this.transform;
- // Ignore transform for text in other element
- if (m && !fromTextEl) {
- tmpRect.copy(rect);
- tmpRect.applyTransform(m);
- rect = tmpRect;
- }
-
- if (!fromTextEl) {
- var textPosition = style.textPosition;
- var distance = style.textDistance;
- // Text position represented by coord
- if (textPosition instanceof Array) {
- x = rect.x + parsePercent(textPosition[0], rect.width);
- y = rect.y + parsePercent(textPosition[1], rect.height);
-
- align = align || 'left';
- baseline = baseline || 'top';
- }
- else {
- var res = textContain.adjustTextPositionOnRect(
- textPosition, rect, textRect, distance
- );
- x = res.x;
- y = res.y;
-
- // Default align and baseline when has textPosition
- align = align || res.textAlign;
- baseline = baseline || res.textBaseline;
- }
- }
- else {
- x = rect.x;
- y = rect.y;
- }
- if (verticalAlign) {
- switch (verticalAlign) {
- case 'middle':
- y -= textRect.height / 2;
- break;
- case 'bottom':
- y -= textRect.height;
- break;
- // 'top'
- }
- // Ignore baseline
- baseline = 'top';
- }
-
- var fontSize = fontStyle.size;
- // 1.75 is an arbitrary number, as there is no info about the text baseline
- switch (baseline) {
- case 'hanging':
- case 'top':
- y += fontSize / 1.75;
- break;
- case 'middle':
- break;
- default:
- // case null:
- // case 'alphabetic':
- // case 'ideographic':
- // case 'bottom':
- y -= fontSize / 2.25;
- break;
- }
- switch (align) {
- case 'left':
- break;
- case 'center':
- x -= textRect.width / 2;
- break;
- case 'right':
- x -= textRect.width;
- break;
- // case 'end':
- // align = elementStyle.direction == 'ltr' ? 'right' : 'left';
- // break;
- // case 'start':
- // align = elementStyle.direction == 'rtl' ? 'right' : 'left';
- // break;
- // default:
- // align = 'left';
- }
-
- var createNode = vmlCore.createNode;
-
- var textVmlEl = this._textVmlEl;
- var pathEl;
- var textPathEl;
- var skewEl;
- if (!textVmlEl) {
- textVmlEl = createNode('line');
- pathEl = createNode('path');
- textPathEl = createNode('textpath');
- skewEl = createNode('skew');
-
- // FIXME Why here is not cammel case
- // Align 'center' seems wrong
- textPathEl.style['v-text-align'] = 'left';
-
- initRootElStyle(textVmlEl);
-
- pathEl.textpathok = true;
- textPathEl.on = true;
-
- textVmlEl.from = '0 0';
- textVmlEl.to = '1000 0.05';
-
- append(textVmlEl, skewEl);
- append(textVmlEl, pathEl);
- append(textVmlEl, textPathEl);
-
- this._textVmlEl = textVmlEl;
- }
- else {
- // 这里是在前面 appendChild 保证顺序的前提下
- skewEl = textVmlEl.firstChild;
- pathEl = skewEl.nextSibling;
- textPathEl = pathEl.nextSibling;
- }
-
- var coords = [x, y];
- var textVmlElStyle = textVmlEl.style;
- // Ignore transform for text in other element
- if (m && fromTextEl) {
- applyTransform(coords, coords, m);
-
- skewEl.on = true;
-
- skewEl.matrix = m[0].toFixed(3) + comma + m[2].toFixed(3) + comma +
- m[1].toFixed(3) + comma + m[3].toFixed(3) + ',0,0';
-
- // Text position
- skewEl.offset = (round(coords[0]) || 0) + ',' + (round(coords[1]) || 0);
- // Left top point as origin
- skewEl.origin = '0 0';
-
- textVmlElStyle.left = '0px';
- textVmlElStyle.top = '0px';
- }
- else {
- skewEl.on = false;
- textVmlElStyle.left = round(x) + 'px';
- textVmlElStyle.top = round(y) + 'px';
- }
-
- textPathEl.string = encodeHtmlAttribute(text);
- // TODO
- try {
- textPathEl.style.font = font;
- }
- // Error font format
- catch (e) {}
-
- updateFillAndStroke(textVmlEl, 'fill', {
- fill: fromTextEl ? style.fill : style.textFill,
- opacity: style.opacity
- }, this);
- updateFillAndStroke(textVmlEl, 'stroke', {
- stroke: fromTextEl ? style.stroke : style.textStroke,
- opacity: style.opacity,
- lineDash: style.lineDash
- }, this);
-
- textVmlEl.style.zIndex = getZIndex(this.zlevel, this.z, this.z2);
-
- // Attached to root
- append(vmlRoot, textVmlEl);
- };
-
- var removeRectText = function (vmlRoot) {
- remove(vmlRoot, this._textVmlEl);
- this._textVmlEl = null;
- };
-
- var appendRectText = function (vmlRoot) {
- append(vmlRoot, this._textVmlEl);
- };
-
- var list = [RectText, Displayable, ZImage, Path, Text];
-
- // In case Displayable has been mixed in RectText
- for (var i = 0; i < list.length; i++) {
- var proto = list[i].prototype;
- proto.drawRectText = drawRectText;
- proto.removeRectText = removeRectText;
- proto.appendRectText = appendRectText;
- }
-
- Text.prototype.brushVML = function (root) {
- var style = this.style;
- if (style.text) {
- this.drawRectText(root, {
- x: style.x || 0, y: style.y || 0,
- width: 0, height: 0
- }, this.getBoundingRect(), true);
- }
- };
-
- Text.prototype.onRemove = function (vmlRoot) {
- this.removeRectText(vmlRoot);
- };
-
- Text.prototype.onAdd = function (vmlRoot) {
- this.appendRectText(vmlRoot);
- };
- }
-
-
-/***/ },
-/* 347 */
-/***/ function(module, exports, __webpack_require__) {
-
-
-
- if (!__webpack_require__(78).canvasSupported) {
- var urn = 'urn:schemas-microsoft-com:vml';
-
- var createNode;
- var win = window;
- var doc = win.document;
-
- var vmlInited = false;
-
- try {
- !doc.namespaces.zrvml && doc.namespaces.add('zrvml', urn);
- createNode = function (tagName) {
- return doc.createElement('<zrvml:' + tagName + ' class="zrvml">');
- };
- }
- catch (e) {
- createNode = function (tagName) {
- return doc.createElement('<' + tagName + ' xmlns="' + urn + '" class="zrvml">');
- };
- }
-
- // From raphael
- var initVML = function () {
- if (vmlInited) {
- return;
- }
- vmlInited = true;
-
- var styleSheets = doc.styleSheets;
- if (styleSheets.length < 31) {
- doc.createStyleSheet().addRule('.zrvml', 'behavior:url(#default#VML)');
- }
- else {
- // http://msdn.microsoft.com/en-us/library/ms531194%28VS.85%29.aspx
- styleSheets[0].addRule('.zrvml', 'behavior:url(#default#VML)');
- }
- };
-
- // Not useing return to avoid error when converting to CommonJS module
- module.exports = {
- doc: doc,
- initVML: initVML,
- createNode: createNode
- };
- }
-
-
-/***/ },
-/* 348 */
-/***/ function(module, exports, __webpack_require__) {
-
- /**
- * VML Painter.
- *
- * @module zrender/vml/Painter
- */
-
-
-
- var zrLog = __webpack_require__(39);
- var vmlCore = __webpack_require__(347);
-
- function parseInt10(val) {
- return parseInt(val, 10);
- }
-
- /**
- * @alias module:zrender/vml/Painter
- */
- function VMLPainter(root, storage) {
-
- vmlCore.initVML();
-
- this.root = root;
-
- this.storage = storage;
-
- var vmlViewport = document.createElement('div');
-
- var vmlRoot = document.createElement('div');
-
- vmlViewport.style.cssText = 'display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;';
-
- vmlRoot.style.cssText = 'position:absolute;left:0;top:0;';
-
- root.appendChild(vmlViewport);
-
- this._vmlRoot = vmlRoot;
- this._vmlViewport = vmlViewport;
-
- this.resize();
-
- // Modify storage
- var oldDelFromMap = storage.delFromMap;
- var oldAddToMap = storage.addToMap;
- storage.delFromMap = function (elId) {
- var el = storage.get(elId);
-
- oldDelFromMap.call(storage, elId);
-
- if (el) {
- el.onRemove && el.onRemove(vmlRoot);
- }
- };
-
- storage.addToMap = function (el) {
- // Displayable already has a vml node
- el.onAdd && el.onAdd(vmlRoot);
-
- oldAddToMap.call(storage, el);
- };
-
- this._firstPaint = true;
- }
-
- VMLPainter.prototype = {
-
- constructor: VMLPainter,
-
- /**
- * @return {HTMLDivElement}
- */
- getViewportRoot: function () {
- return this._vmlViewport;
- },
-
- /**
- * 刷新
- */
- refresh: function () {
-
- var list = this.storage.getDisplayList(true, true);
-
- this._paintList(list);
- },
-
- _paintList: function (list) {
- var vmlRoot = this._vmlRoot;
- for (var i = 0; i < list.length; i++) {
- var el = list[i];
- if (el.invisible || el.ignore) {
- if (!el.__alreadyNotVisible) {
- el.onRemove(vmlRoot);
- }
- // Set as already invisible
- el.__alreadyNotVisible = true;
- }
- else {
- if (el.__alreadyNotVisible) {
- el.onAdd(vmlRoot);
- }
- el.__alreadyNotVisible = false;
- if (el.__dirty) {
- el.beforeBrush && el.beforeBrush();
- (el.brushVML || el.brush).call(el, vmlRoot);
- el.afterBrush && el.afterBrush();
- }
- }
- el.__dirty = false;
- }
-
- if (this._firstPaint) {
- // Detached from document at first time
- // to avoid page refreshing too many times
-
- // FIXME 如果每次都先 removeChild 可能会导致一些填充和描边的效果改变
- this._vmlViewport.appendChild(vmlRoot);
- this._firstPaint = false;
- }
- },
-
- resize: function () {
- var width = this._getWidth();
- var height = this._getHeight();
-
- if (this._width != width && this._height != height) {
- this._width = width;
- this._height = height;
-
- var vmlViewportStyle = this._vmlViewport.style;
- vmlViewportStyle.width = width + 'px';
- vmlViewportStyle.height = height + 'px';
- }
- },
-
- dispose: function () {
- this.root.innerHTML = '';
-
- this._vmlRoot =
- this._vmlViewport =
- this.storage = null;
- },
-
- getWidth: function () {
- return this._width;
- },
-
- getHeight: function () {
- return this._height;
- },
-
- _getWidth: function () {
- var root = this.root;
- var stl = root.currentStyle;
-
- return ((root.clientWidth || parseInt10(stl.width))
- - parseInt10(stl.paddingLeft)
- - parseInt10(stl.paddingRight)) | 0;
- },
-
- _getHeight: function () {
- var root = this.root;
- var stl = root.currentStyle;
-
- return ((root.clientHeight || parseInt10(stl.height))
- - parseInt10(stl.paddingTop)
- - parseInt10(stl.paddingBottom)) | 0;
- }
- };
-
- // Not supported methods
- function createMethodNotSupport(method) {
- return function () {
- zrLog('In IE8.0 VML mode painter not support method "' + method + '"');
- };
- }
-
- var notSupportedMethods = [
- 'getLayer', 'insertLayer', 'eachLayer', 'eachBuildinLayer', 'eachOtherLayer', 'getLayers',
- 'modLayer', 'delLayer', 'clearLayer', 'toDataURL', 'pathToImage'
- ];
-
- for (var i = 0; i < notSupportedMethods.length; i++) {
- var name = notSupportedMethods[i];
- VMLPainter.prototype[name] = createMethodNotSupport(name);
- }
-
- module.exports = VMLPainter;
-
-
-/***/ }
-/******/ ])
-});
-; \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/js/meatask/meataskQueryController.js b/umc-iui/src/main/resources/webroot/umc-pm/js/meatask/meataskQueryController.js
deleted file mode 100644
index 70927351..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/js/meatask/meataskQueryController.js
+++ /dev/null
@@ -1,843 +0,0 @@
-var pm = {};
-pm.query = {};
-pm.query.vmPmQuery = avalon.define({
- $id: "pmQueryController",
- tableTitle:'',
- pmDataVisable:true,
- pmChartVisable:false,
- tableIconVisable:false,
- chartIconVisable:false,
- queryRuleVisable:false,
- boxVisible:true,
- pmQueries:[],
-
- $postData:{},
-
- beginTime: "",
- endTime: "",
- granularity:"",
-
- granularities: [
- {id: '5', name: $.i18n.prop('com_zte_ums_ict_pm_query_5'), value: true},
- {id: '15', name: $.i18n.prop('com_zte_ums_ict_pm_query_15'), value: false},
- {id: '60', name: $.i18n.prop('com_zte_ums_ict_pm_query_60'), value: false}
- ],
-
- granularityClicked: function(modelItem, item){
- if(modelItem.id =="5"){
- pm.query.vmPmQuery.granularity = "5*60";
- pm.query.vmPmQuery.granularities[0].value = true;
- pm.query.vmPmQuery.granularities[1].value = false;
- pm.query.vmPmQuery.granularities[2].value = false;
- }else if(modelItem.id =="15"){
- pm.query.vmPmQuery.granularity = "15*60";
- pm.query.vmPmQuery.granularities[0].value = false;
- pm.query.vmPmQuery.granularities[1].value = true;
- pm.query.vmPmQuery.granularities[2].value = false;
- }else{
- pm.query.vmPmQuery.granularity = "60*60";
- pm.query.vmPmQuery.granularities[0].value = false;
- pm.query.vmPmQuery.granularities[1].value = false;
- pm.query.vmPmQuery.granularities[2].value = true;
- }
- },
-
- resources: [
- /* {id: 'vnfInstance', name: $.i18n.prop('ngict-pm-iui-name-vnfInstance'), value: "SSS"},
- {id: 'host', name: $.i18n.prop('ngict-pm-iui-name-host'), value: ""} */
- ],
-
- resourcesMap:{},
-
- resourceSlected:[],
-
- resourceSlectedObjs:[],
-
- rmSelectedResource: function(modelItem, elem){
- $(elem).parent().remove();
- pm.query.vmPmQuery.resourceSlected.splice(pm.query.vmPmQuery.resourceSlected.indexOf(modelItem.id), 1);
- },
-
- initResources: function(resourceTypeId){
- var that = this;
- $.ajax({
- async: false,
- "dataType": 'json',
- "type": "GET",
- //"url": "/api/umcpm/v1/resources/" + resourceTypeId,
- "url": "/api/umcpm/v1/resources/",
- "contentType": 'application/json; charset=utf-8',
- "success": function (res, textStatus, jqXHR) {
- //var nodes = res.content;
- var nodes = res;
- that.resources = [];
- for (var i = 0; i < nodes.length; i++) {
- var resource = {
- id: nodes[i].id,
- name: nodes[i].name,
- resType: nodes[i].resType
- };
- that.resources.push(resource);
- //保存id和resource的映射关系
- var resourceCopy = {
- id: nodes[i].id,
- name: nodes[i].name,
- resType: nodes[i].resType
- };
- that.resourcesMap[nodes[i].id] = resourceCopy;
- }
- //过滤框注册
- $("input[id=resourcesToFilter]").keyup(function(){
- $("table#resources tbody tr").hide().filter(":contains('"+( $(this).val() )+"')").show();
- });
- },
- "error": function () {
- }
- });
- },
-
- resTypeArray : [],
- selectedResourceType : "",
- selectedResourceTypeId : "",
-
- moTypeArray:[],
- selectedMoType:"",
- selectedMoTypeId:"",
-
- counterArray:[],
- selectedCounter:[],
-
- resTypeSelectAction:function(){
- var resourceTypeId = getIdFromName(pm.query.vmPmQuery.selectedResourceType,pm.query.vmPmQuery.resTypeArray);
- pm.query.vmPmQuery.selectedResourceTypeId = resourceTypeId;
- getMoTypeArray(resourceTypeId);
- pm.query.vmPmQuery.counterArray=[];
- pm.query.vmPmQuery.initResources(resourceTypeId);
- },
- moTypeSelectAction:function(obj){
- var resourceTypeId=getIdFromName(pm.query.vmPmQuery.selectedResourceType,pm.query.vmPmQuery.resTypeArray);
- //var moTypeId=$(obj).val();
- var moTypeId = getIdFromName(pm.query.vmPmQuery.selectedMoType, pm.query.vmPmQuery.moTypeArray);
- pm.query.vmPmQuery.selectedMoTypeId = moTypeId;
- getCounterArray(resourceTypeId,moTypeId);
- },
- /* counterSelectAction:function(obj){
- var counterId=$(obj).val();
- pm.query.vmPmQuery.selectedCounter=counterId;
- pm.query.vmPmQuery.indexDescription+=pm.query.vmPmQuery.selectedCounter;
- }, */
- returnQueryPage: function(){
- pm.query.vmPmQuery.pmDataVisable=true;
- pm.query.vmPmQuery.pmChartVisable=false;
- pm.query.vmPmQuery.tableIconVisable=false;
- pm.query.vmPmQuery.chartIconVisable=true;
- pm.query.vmPmQuery.queryRuleVisable=false;
- pm.query.vmPmQuery.clickDisplayGraphAlink();
- },
-
- queryRuleView: function(event, el){
- event.stopPropagation();
-
- pm.query.vmPmQuery.tableTitle=$.i18n.prop('com_zte_ums_ict_pm_query_edit');
-
- //取得测量任务详情
- var elem = {};
- $.ajax({
- async: false,
- "dataType": 'json',
- "type": "GET",
- "url": "/api/umcpm/v1/meatasks/" + el.id,
- "data": null,
- "contentType": 'application/json; charset=utf-8',
- "success": function (res, textStatus, jqXHR) {
- elem = res;
- },
- "error": function () {
- }
- });
-
- pm.query.vmPmQuery.pmDataVisable=false;
- pm.query.vmPmQuery.pmChartVisable=false;
- pm.query.vmPmQuery.tableIconVisable=false;
- pm.query.vmPmQuery.chartIconVisable=false;
- pm.query.vmPmQuery.queryRuleVisable=true;
-
- pm.query.vmPmQuery.beginTime = elem.beginTime;
- pm.query.vmPmQuery.endTime = elem.endTime;
-
- var timetext = pmUtil.formatTime(pm.query.vmPmQuery.beginTime) + " - " + pmUtil.formatTime(pm.query.vmPmQuery.endTime);
- $("#queryTimeRange").val(timetext);
-
- //选择粒度
- pm.query.vmPmQuery.granularity = elem.granularity;
- var granularity = pm.query.vmPmQuery.granularity / 60;
- var granularities = pm.query.vmPmQuery.granularities;
- for(var i=0;i<granularities.length;i++){
- if(granularity == granularities[i].id){
- granularities[i].value = true;
- }else{
- granularities[i].value = false;
- }
- }
-
- //展开相关资源类型
- pm.query.vmPmQuery.resTypeArray.push(elem.resourceType);
- pm.query.vmPmQuery.selectedResourceTypeId = elem.resourceType.id;
- pm.query.vmPmQuery.selectedResourceType = elem.resourceType.name;
- //pm.query.vmPmQuery.resTypeSelectAction();
- pm.query.vmPmQuery.moTypeArray.push(elem.moType);
- pm.query.vmPmQuery.selectedMoTypeId = elem.moType.id;
- pm.query.vmPmQuery.selectedMoType = elem.moType.name;
- //pm.query.vmPmQuery.moTypeSelectAction();
- getCounterArray(elem.moType.id);
- pm.query.vmPmQuery.initResources(elem.resourceType.id);
-
- $("select#resourceTypes").attr("disabled", true);
- $("select#moTypes").attr("disabled", true);
-
- //选中对象
- pm.query.vmPmQuery.resourceSlected = [];
- for(var j=0;j<elem.resources.length;j++){
- pm.query.vmPmQuery.resourceSlected.push(elem.resources[j].id);
- //pm.query.vmPmQuery.resourceSlected.push(elem.resources[j]);
- }
-
- //$("a#upArrow").click();
- pm.query.vmPmQuery.clickDisplayGraphAlink();
-
- $('.indexesAll').unbind().bind("change", function () {
- var table = $("table#indexes");
- var set = $('tbody > tr > td:nth-child(1) input[type="checkbox"]', table);
- var checked = $(this).is(":checked");
- $(set).each(function () {
- //$(this).attr("checked", checked);
- if(checked){
- if(!$(this).is(":checked")){
- $(this).click();
- }
- }else{
- if($(this).is(":checked")){
- $(this).click();
- }
- }
- });
- });
-
- $('.resourceAll').unbind().bind("change", function () {
- var table = $("table#resources");
- var set = $('tbody > tr > td:nth-child(1) input[type="checkbox"]', table);
- var checked = $(this).is(":checked");
- $(set).each(function () {
- //$(this).attr("checked", checked);
- if(checked){
- if(!$(this).is(":checked")){
- $(this).click();
- }
- }else{
- if($(this).is(":checked")){
- $(this).click();
- }
- }
- });
- });
- //国际化
- var i18nItems = $("[name_i18n=com_zte_ums_ict_pm_query]");
- for(var i=0;i<i18nItems.length;i++){
- var $item = $(i18nItems.eq(i));
- var itemId = $item.attr('id');
- var itemValue = $.i18n.prop(itemId);
- if(typeof($item.attr("title"))!="undefined"){
- $item.attr("title", itemValue);
- }else if(typeof($item.attr("placeholder"))!="undefined"){
- $item.attr("placeholder", itemValue);
- }else{
- $item.text(itemValue);
- }
- }
- },
-
- queryRuleChanged: function(){
-
- pm.query.vmPmQuery.pmDataVisable=true;
- pm.query.vmPmQuery.pmChartVisable=false;
- pm.query.vmPmQuery.tableIconVisable=false;
- pm.query.vmPmQuery.chartIconVisable=true;
- pm.query.vmPmQuery.queryRuleVisable=false;
- pm.query.vmPmQuery.clickDisplayGraphAlink();
-
- var resourcesToPut = [];
- for(var i=0;i<pm.query.vmPmQuery.resourceSlected.length;i++){
- for(var j=0;j<pm.query.vmPmQuery.resources.length;j++){
- if(pm.query.vmPmQuery.resourceSlected[i] == pm.query.vmPmQuery.resources[j].id){
- resourcesToPut.push(pm.query.vmPmQuery.resources[j]);
- break;
- }
- }
- }
-
- var postData = {
- "resourceTypeId": pm.query.vmPmQuery.selectedResourceTypeId,
- "moTypeId": pm.query.vmPmQuery.selectedMoTypeId,
- //"resources": pm.query.vmPmQuery.resourceSlected,
- "resources": resourcesToPut,
- "counterOrIndexId": pm.query.vmPmQuery.selectedCounter,
- "granularity": pm.query.vmPmQuery.granularity,
- "beginTime": pm.query.vmPmQuery.beginTime,
- "endTime": pm.query.vmPmQuery.endTime,
- "pageNo": 0,
- "pageSize": 10
- }
- pm.query.vmPmQuery.$postData = postData;
- $.ajax({
- //async:false,
- "type": 'post',
- "url": "/api/umcpm/v1/historydataqueries",
- "dataType": "json",
- "data": JSON.stringify(postData),
- "contentType": 'application/json; charset=utf-8',
- "success": function (resp) {
- //if(resp.content[0]){
- if(resp.data[0]){
- //var datas = resp.content[0].datas;
- var datas = resp.data[0].datas;
- //pm.query.vmPmQuery.$queryDataTableFields = pm.query.vmPmQuery.$queryDataTableFieldsBackup;
- collectDataFields(datas);
- //pm.query.vmPmQuery.postData = postData;
- pm.query.vmPmQuery.$initTable();
- }else{
- collectDataFields([]);
- pm.query.vmPmQuery.$initTable();
- }
- },
- "error":function(resp){
-
- }
- });
- },
-
- queryTabClicked: function (el, item) {
-
- //取得测量任务详情
- var modelItem = {};
- $.ajax({
- async: false,
- "dataType": 'json',
- "type": "GET",
- "url": "/api/umcpm/v1/meatasks/" + el.id,
- "data": null,
- "contentType": 'application/json; charset=utf-8',
- "success": function (res, textStatus, jqXHR) {
- modelItem = res;
- },
- "error": function () {
- }
- });
-
- pm.query.vmPmQuery.pmDataVisable=true;
- pm.query.vmPmQuery.pmChartVisable=false;
- pm.query.vmPmQuery.tableIconVisable=false;
- pm.query.vmPmQuery.chartIconVisable=true;
- pm.query.vmPmQuery.queryRuleVisable=false;
- //vmPmQuery.boxVisible= false;
- pm.query.vmPmQuery.tableTitle=modelItem.name + " " + $.i18n.prop('com_zte_ums_ict_pm_query_result');
-
- //取得指标
- var getData = [];
- getData.push({
- name: "resourceTypeId",
- value: modelItem.resourceType.id
- });
- getData.push({
- name: "moTypeId",
- value: modelItem.moType.id
- });
- var counterOrIndexId = [];
- var MoTypeId = modelItem.moType.id;
- /* $.ajax({
- async: false,
- "dataType": 'json',
- "type": "GET",
- //"url": "/api/umcpm/v1/motypes/indexes",
- "url": "/api/umcpm/v1/indexes",
- "data": getData,
- "contentType": 'application/json; charset=utf-8',
- "success": function (res, textStatus, jqXHR) {
- for(var i=0;i<res.length;i++){
- counterOrIndexId.push(res[i].id);
- }
- },
- "error": function () {
- }
- }); */
- var url="/api/umcpm/v1/motypes/" + MoTypeId + "/counters";
- var data={};
- data.moTypeId=MoTypeId;
- $.ajax({
- "type": 'get',
- "url": url,
- "dataType": "json",
- data:data,
- "async": false,
- "success": function (res) {
- for(var i=0;i<res.length;i++){
- counterOrIndexId.push(res[i].id);
- }
- },
- "error":function(res){
- counterOrIndexId=[];
- }
- });
-
- var resources=[];
- for(var i=0;i<modelItem.resources.length;i++){
- var resource = {};
- resource.id = modelItem.resources[i].id;
- resource.name = modelItem.resources[i].name;
- resource.resType = modelItem.resources[i].resType;
- resources.push(resource);
- }
- var postData = {
- "resourceTypeId": modelItem.resourceType.id,
- "moTypeId": modelItem.moType.id,
- "resources": resources,
- "counterOrIndexId": counterOrIndexId,
- "granularity": modelItem.granularity,
- "beginTime": modelItem.beginTime,
- "endTime": modelItem.endTime,
- "pageNo": 0,
- "pageSize": 10
- }
- pm.query.vmPmQuery.$postData = postData;
- $.ajax({
- //async:false,
- "type": 'post',
- "url": "/api/umcpm/v1/historydataqueries",
- "dataType": "json",
- "data": JSON.stringify(postData),
- "contentType": 'application/json; charset=utf-8',
- "success": function (resp) {
- //if(resp.content[0]){
- if(resp.data[0]){
- //var datas = resp.content[0].datas;
- var datas = resp.data[0].datas;
- //pm.query.vmPmQuery.$queryDataTableFields = pm.query.vmPmQuery.$queryDataTableFieldsBackup;
- collectDataFields(datas);
- pm.query.vmPmQuery.$initTable();
- }else{
- collectDataFields([]);
- pm.query.vmPmQuery.$initTable();
- }
- },
- "error":function(resp){
-
- }
- });
- },
- clickSelectedCommonCond: function () {
- //显示统计图;
- },
- clickDisplayGraphAlink: function () {
- pm.query.vmPmQuery.boxVisible = !pm.query.vmPmQuery.boxVisible;
- },
- showPerformanceChart: function () {
- drawPerformanceChart();
- pm.query.vmPmQuery.pmDataVisable=false;
- pm.query.vmPmQuery.pmChartVisable=true;
- pm.query.vmPmQuery.tableIconVisable=true;
- pm.query.vmPmQuery.chartIconVisable=false;
- },
- showPerformanceTable: function () {
- pm.query.vmPmQuery.pmDataVisable=true;
- pm.query.vmPmQuery.pmChartVisable=false;
- pm.query.vmPmQuery.tableIconVisable=false;
- pm.query.vmPmQuery.chartIconVisable=true;
- },
- $queryDataTableFields: [
- {
- "mData": "beginTime",
- sWidth: "10%",
- name: $.i18n.prop('com_zte_ums_ict_pm_query_start_time'),
- "fnRender": pmUtil.timeRender
- },
- {
- "mData": "endTime",
- sWidth: "10%",
- name: $.i18n.prop('com_zte_ums_ict_pm_query_end_time'),
- "fnRender": pmUtil.timeRender
- },
- {
- "mData": "granularity",
- sWidth: "10%",
- name: $.i18n.prop('com_zte_ums_ict_pm_query_granularity')
- },
- {
- "mData": "resourceType.name",
- sWidth: "15%",
- name: $.i18n.prop('com_zte_ums_ict_pm_query_resource_type')
- },
- {
- "mData": "resource.name",
- sWidth: "15%",
- name: $.i18n.prop('com_zte_ums_ict_pm_query_resource_name')
- }
- ] ,
- $language: {
- "sProcessing": "<img src='../../../component/thirdparty/data-tables/images/loading-spinner-grey.gif'/><span>&nbsp;&nbsp;处理中...</span>",
- "sLengthMenu": $.i18n.prop("ngict-log-iui-table-sLengthMenu"),
- "sZeroRecords": $.i18n.prop("ngict-log-iui-table-sZeroRecords"),
- "sInfo": "<span class='seperator'> </span>" + $.i18n.prop("ngict-log-iui-table-sInfo"),
- "sInfoEmpty": $.i18n.prop("ngict-log-iui-table-sInfoEmpty"),
- "sGroupActions": $.i18n.prop("ngict-log-iui-table-sGroupActions"),
- "sAjaxRequestGeneralError":$.i18n.prop("ngict-log-iui-table-sAjaxRequestGeneralError"),
- "sEmptyTable": $.i18n.prop("ngict-log-iui-table-sEmptyTable"),
- "oPaginate": {
- "sPrevious": $.i18n.prop("ngict-log-iui-table-sPrevious"),
- "sNext": $.i18n.prop("ngict-log-iui-table-sNext"),
- "sPage": $.i18n.prop("ngict-log-iui-table-sPage"),
- "sPageOf": $.i18n.prop("ngict-log-iui-table-sPageOf")
- }
- },
- $initTable: function () {
- var setting = {};
- setting.language = this.$language;
- setting.columns = this.$queryDataTableFields;
- setting.pageHtml="r<'table-scrollable't><'row page-info-bottom'<'col-md-12 col-sm-12'lip>>>";
- //setting.restUrl ="/api/umcpm/v1/indexes";
- //setting.restUrl ="../../json/thresholdList.json";
- setting.restUrl = "/api/umcpm/v1/historydataqueries";
- setting.tableId = "ict_pm_data";
- serverPageTable.initDataTable(setting, 'ict_pm_data_div' );
- }
-});
-
-pm.query.vmPmQuery.resourceSlected.$watch("length", function(newValue, oldValue){
- var resourceSlected = pm.query.vmPmQuery.resourceSlected;
- //pm.query.vmPmQuery.resourceSlectedObjs = [];
- var resourceSlectedObjs = [];
- for(var i=0;i<resourceSlected.length;i++){
- //var obj = getObjById(resourceSlected[i], pm.query.vmPmQuery.resources);
- var obj = $.extend(true, {}, pm.query.vmPmQuery.resourcesMap[resourceSlected[i]]);
- //pm.query.vmPmQuery.resourceSlectedObjs.push(obj);
- resourceSlectedObjs.push(obj);
- }
- //给绑定变量一次性赋值,否则非常慢
- //pm.query.vmPmQuery.resourceSlectedObjs = $.extend(true, [], resourceSlectedObjs);
- pm.query.vmPmQuery.resourceSlectedObjs=[];
- for(var j=0;j<resourceSlectedObjs.length;j++){
- pm.query.vmPmQuery.resourceSlectedObjs.push(resourceSlectedObjs[j]);
- }
-});
-
-function getObjById(id,array){
- for(var i=0;i<array.length;i++){
- if(array[i].id==id){
- return array[i];
- }
- }
-}
-
-avalon.scan();
-
-//取得任务列表
-var queryViewData;
-$.ajax({
- async: false,
- "dataType": 'json',
- "type": "GET",
- "url": "/api/umcpm/v1/meatasks",
- //"url": "../../js/meatask/testList.json",
- "data": null,
- "contentType": 'application/json; charset=utf-8',
- "success": function (res, textStatus, jqXHR) {
- //queryViewData = res.content;
- queryViewData = res;
- },
- "error": function () {
- }
-});
-
-pm.query.vmPmQuery.pmQueries = transformQueryViewData(queryViewData, 8);
-
-/* var postData = {
- "resourceTypeId": "vnf.cn.cscf",
- "moTypeId": "vnf.cn.cscf.metrictype",
- "resources": [
- {
- "id": "vnf.cn.cscf.001",
- "name": "cscf001",
- "resType": "vnf.cn.cscf"
- }
- ],
- "counterOrIndexId": [
- "001"
- ],
- "granularity": 900,
- "beginTime": 1449023738672,
- "endTime": 1449023738672
-} */
-
-var queryDataTableFieldsBackup = [
- {
- "mData": "beginTime",
- sWidth: "10%",
- name: $.i18n.prop('com_zte_ums_ict_pm_query_start_time'),
- "fnRender": pmUtil.timeRender
- },
- {
- "mData": "endTime",
- sWidth: "10%",
- name: $.i18n.prop('com_zte_ums_ict_pm_query_end_time'),
- "fnRender": pmUtil.timeRender
- },
- {
- "mData": "granularity",
- sWidth: "10%",
- name: $.i18n.prop('com_zte_ums_ict_pm_query_granularity')
- },
- {
- "mData": "resourceType.name",
- sWidth: "15%",
- name: $.i18n.prop('com_zte_ums_ict_pm_query_resource_type')
- },
- {
- "mData": "resource.name",
- sWidth: "15%",
- name: $.i18n.prop('com_zte_ums_ict_pm_query_resource_name')
- }
-];
-
-//pm.query.vmPmQuery.$initTable();
-function fnServerData(sSource, aoData, fnCallback, oSettings) {
-
- var oPaging = oSettings.oInstance.fnPagingInfo();
- var pageLength = oPaging.iLength;
- var curPageNo = oPaging.iPage;
-
- pm.query.vmPmQuery.$postData.pageNo = curPageNo;
- pm.query.vmPmQuery.$postData.pageSize = pageLength;
-
- oSettings.jqXHR = $.ajax({
- "type": 'post',
- //"type": 'get',
- "url": sSource,
- //"url": "../../js/meatask/testMulti1.json",
- "dataType": "json",
- "data": JSON.stringify(pm.query.vmPmQuery.$postData),
- "contentType": 'application/json; charset=utf-8',
- "success": function (resp) {
- oSettings.iDraw = oSettings.iDraw + 1;
- var data = {};
- //添加动态列
- //for(var i=0;i<resp.content.length;i++){
- for(var i=0;i<resp.data.length;i++){
- //var row = resp.content[i];
- var row = resp.data[i];
- for(var j=0;j<row.datas.length;j++){
- row["counterOrIndex" + row.datas[j].counterOrIndexId] = row.datas[j].value;
- }
- }
- /* data.aaData = resp.content;
- data.iTotalRecords = resp.content.length;
- data.iTotalDisplayRecords = resp.content.length; */
- data.aaData = resp.data;
- data.iTotalRecords = resp.totalCout;
- data.iTotalDisplayRecords = resp.totalCout;
- data.sEcho = oSettings;
- fnCallback(data);
- },
- "error":function(resp){
-
- }
- });
-}
-
-/* var tableFieldsMap = {
- beginTime: "开始时间",
- endTime: "结束时间"
-}; */
-
-function collectDataFields(datas){
- pm.query.vmPmQuery.$queryDataTableFields = [];
- for(var i=0;i<queryDataTableFieldsBackup.length;i++){
- pm.query.vmPmQuery.$queryDataTableFields.push(queryDataTableFieldsBackup[i]);
- }
- for(var i=0;i<datas.length;i++){
- if(!datas[i].name){
- datas[i].name="测试列"
- }
- pm.query.vmPmQuery.$queryDataTableFields.push({
- //"mData": "datas["+ i +"].value",
- //"mData": "datas.value",
- //"mData": "datas",
- "mData": "counterOrIndex" + datas[i].counterOrIndexId,
- sWidth: "10%",
- name: datas[i].counterOrIndexName
- //,fnRender: pmUtil.indexValue
- });
- }
-}
-
-/* function tranverseObjFields(obj){
- for(var p in obj){
- if(typeof(obj[p])!="function" && tableFieldsMap[p]){
- if(obj[p]){
-
- }
- pm.query.vmPmQuery.$queryDataTableFields.push({
- "mData": p,
- sWidth: "10%",
- name: tableFieldsMap[p]
- })
- }
- }
-} */
-
-function transformQueryViewData(queryViewData, pageSize) {
- var newData = [];
- var pageNo = Math.floor(queryViewData.length / pageSize) + 1;
- if(queryViewData.length % pageSize == 0){
- pageNo--;
- }
- for (var i = 0; i < pageNo; i++) {
- newData.push({array: []});
- }
- for (var j = 0; j < queryViewData.length; j++) {
- newData[Math.floor(j / pageSize)].array.push(queryViewData[j]);
- }
- return newData;
-}
-
-setTimeout(function(){
- $($(".item", $(".carousel-inner"))[0]).addClass("active");
- pmUtil.setDateRange("queryTimeRange");
-}, 100);
-
-newIndexWizard = function (idx,action) {
- //获取资源类型
- //getResTypeArray();
- var resourceTypeId;
- var moTypeId;
-
- //默认取资源第一个的测量类型
- /* if(pm.query.vmPmQuery.resTypeArray && pm.query.vmPmQuery.resTypeArray.length>0){
- pm.query.vmPmQuery.selectedResourceType=pm.query.vmPmQuery.resTypeArray[0].name;
- resourceTypeId=pm.query.vmPmQuery.resTypeArray[0].id;
- pm.query.vmPmQuery.selectedDataType=pm.query.vmPmQuery.dataTypeArray[0].name;
- getMoTypeArray( pm.query.vmPmQuery.resTypeArray[0].id);
- getCounterArray(resourceTypeId,moTypeId);
- } */
-}();
-
-function getResTypeArray(){
- var url="/api/umcpm/v1/resourcetypes";
- $.ajax({
- "type": 'get',
- "url": url,
- "dataType": "json",
- "async": false,
- "success": function (resp) {
- //pm.query.vmPmQuery.resTypeArray= resp.content;
- pm.query.vmPmQuery.resTypeArray= resp;
- },
- "error":function(resp){
- // pm.index.vm.ResTypeArray=resp;
- }
- });
-}
-
-function getMoTypeArray(resourceTypeId){
- if(resourceTypeId){
- //获取测量类型
- var url="/api/umcpm/v1/motypes";
- var data={};
- data.resourceTypeId=resourceTypeId;
- $.ajax({
- "type": 'get',
- "url": url,
- data:data,
- "dataType": "json",
- "async": false,
- "success": function (resp) {
- //pm.query.vmPmQuery.moTypeArray= resp.content;
- pm.query.vmPmQuery.moTypeArray= resp;
- },
- "error":function(resp){
- pm.query.vmPmQuery.moTypeArray=[];
- //for test
- /* var res = {"message":null,"content":[{"name":"性能KPI-1","id":"ns.cn.ims.metrictype"},{"name":"性能KPI-2","id":"ns.cn.ims.metrictype1"},{"name":"性能KPI-3","id":"ns.cn.ims.metrictype2"},{"name":"性能KPI-4","id":"ns.cn.ims.metrictype3"},{"name":"性能KPI-5","id":"ns.cn.ims.metrictype4"}],"status":0};
- pm.query.vmPmQuery.moTypeArray = res.content; */
- }
- });
- }
-}
-
-function getCounterArray(MoTypeId){
- if(MoTypeId){
- var url="/api/umcpm/v1/motypes/"+MoTypeId+"/counters";
- var data={};
- data.moTypeId=MoTypeId;
- $.ajax({
- "type": 'get',
- "url": url,
- "dataType": "json",
- data:data,
- "async": false,
- "success": function (resp) {
- //pm.query.vmPmQuery.counterArray= resp.content;
- pm.query.vmPmQuery.counterArray= resp;
- //默认全选
- pm.query.vmPmQuery.selectedCounter = [];
- for(var i=0;i<resp.length;i++){
- pm.query.vmPmQuery.selectedCounter.push(resp[i].id);
- }
- },
- "error":function(resp){
- pm.query.vmPmQuery.counterArray=[];
- //for test
- /* var res = {"message":null,"content":[{"dataType":null,"name":"总用户数","id":"ns.cn.epc.businesskpi.totalUsers"},{"dataType":null,"name":"总用户数","id":"ns.cn.ims.businesskpi.totalUsers"},{"dataType":null,"name":"平均CPU使用率%","id":"vnf.runtimeInfo.averageCpuUsage"},{"dataType":null,"name":"平均内存使用率%","id":"vnf.runtimeInfo.averageMemoryUsage"},{"dataType":null,"name":"总用户数","id":"vnf.cn.cscf.businesskpi.totalUsers"}],"status":0};
- pm.query.vmPmQuery.counterArray = res.content; */
- }
- });
- }
-}
-
-function getIdFromName(name,array){
- for(var i=0;i<array.length;i++){
- if(array[i].name==name){
- return array[i].id;
- }
- }
-}
-function getNameFromId(id,array){
- for(var i=0;i<array.length;i++){
- if(array[i].id==id){
- return array[i].name;
- }
- }
-}
-function getObjFromId(id,array){
- for(var i=0;i<array.length;i++){
- if(array[i].id==id){
- return array[i];
- }
- }
- return "";
-}
-function getObjFromName(name,array){
- for(var i=0;i<array.length;i++){
- if(array[i].name==name){
- return array[i];
- }
- }
-}
-
-/* function allCheckbox(obj) {
- var isChecked = obj.checked;
- var tableId = $(obj).parents(".table").attr("id");
- $('td.checkBoxInFirstCol', $("#" + tableId)).each(function() {
- var temp = $(this).children('input');
- temp[0].checked = isChecked;
- });
-} */
-
-
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/js/meatask/performanceChart.js b/umc-iui/src/main/resources/webroot/umc-pm/js/meatask/performanceChart.js
deleted file mode 100644
index dc7a8eaf..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/js/meatask/performanceChart.js
+++ /dev/null
@@ -1,181 +0,0 @@
-// draw the chart by performance datas
-function drawPerformanceChart() {
- var chartType = "";
- var titleText = document.getElementById("tableTitleText").innerHTML;
- var subTitleText = "subTitleText";
- var chartDataList = [];
- var resourceNameList = [];
- var timeList = [];
-
- // get table datas
- var tableObj = document.getElementById("ict_pm_data");
- if (tableObj == null || tableObj.rows.length < 1) {
- return;
- }
-
- // distinguish between chart types
- var ratioType = tableObj.rows[0].cells[5].innerText;
- if (ratioType.indexOf("CPU") > -1) {
- chartType = "CPU";
- subTitleText = "CPU USE RATIO";
- } else if (ratioType.indexOf("RAM") > -1) {
- chartType = "RAM";
- subTitleText = "RAM USE RATIO";
- } else if (ratioType.indexOf("VOLUME") > -1) {
- chartType = "FILESYSTEM";
- subTitleText = "LOGIC VOLUME FILESYSTEM USE RATIO";
- } else if (ratioType.indexOf("NIC") > -1) {
- chartType = "NIC";
- subTitleText = "ERROR PACKET RATIO BY ONE COLLECT-PERIOD (SEND AND RECEIVED)";
- } else {
- return;
- }
-
- // collect datas for chart horizontal axis
- for (var i = 1; i < tableObj.rows.length; i++) {
- var strTime = tableObj.rows[i].cells[0].innerText;
-
- if (timeList.length == 0) {
- // push the first start time into the x-axis
- timeList.push(strTime);
- } else {
- // push the start times into the x-axis and sort them
- for (var j = 0; j < timeList.length; j++) {
- if (timeList[j] == strTime) {
- break;
- } else if (timeList[j] > strTime) {
- timeList.splice(j, 0, strTime);
- break;
- } else if (j + 1 == timeList.length && timeList[j] < strTime) {
- timeList.push(strTime);
- break;
- }
- }
- }
- }
-
- // create chart resources
- for (var i = 1; i < tableObj.rows.length; i++) {
- var strTime = tableObj.rows[i].cells[0].innerText;
- var ratioIndex = getListIndex(timeList, strTime);
- var strName = "";
- var strRatio = "";
-
- if (chartType == "CPU" || chartType == "RAM") {
- strName = tableObj.rows[i].cells[4].innerText;
- strRatio = tableObj.rows[i].cells[5].innerText;
- } else if (chartType == "FILESYSTEM") {
- strName = tableObj.rows[i].cells[4].innerText + "(" + tableObj.rows[i].cells[6].innerText + ")";
- strRatio = tableObj.rows[i].cells[9].innerText;
- } else if (chartType == "NIC") {
- strName = tableObj.rows[i].cells[4].innerText + "(" + tableObj.rows[i].cells[5].innerText + ")";
- strRatio = parseFloat(tableObj.rows[i].cells[10].innerText) + parseFloat(tableObj.rows[i].cells[11].innerText);
- }
-
- if (chartDataList.length == 0) {
- // create the first chart resource and push it into the chartlist
- insertChartDataList(chartDataList, strName, strRatio, ratioIndex);
- } else {
- // update the chart resources which exist in chartlist
- var existFlg = false;
- for (var j = 0; j < chartDataList.length; j++) {
- if (chartDataList[j].name == strName) {
- chartDataList[j].data[ratioIndex] = strRatio;
- existFlg = true;
- break;
- }
- }
-
- // create a new chart resource and push it into the chartlist
- if (!existFlg) {
- insertChartDataList(chartDataList, strName, strRatio, ratioIndex);
- }
- }
- }
-
- for (var i = 0; i < chartDataList.length; i++) {
- // complete length of datalist for each chart resource
- if (chartDataList[i].data.length < timeList.length) {
- chartDataList[i].data[timeList.length - 1] = "";
- }
-
- // create the name list of chart resources
- resourceNameList.push(chartDataList[i].name);
- }
-
- // initialize the chart
- var dom = document.getElementById("chartCanvasDiv");
- var myChart = echarts.init(dom);
- option = null;
-
- // set the chart by collected chart resources
- option = {
- title: {
- text: titleText,
- subtext: subTitleText,
- x: 'center'
- },
- tooltip: {
- trigger: 'axis'
- },
- legend: {
- data:resourceNameList,
- top: '10%'
- },
- grid: {
- top: '20%'
- },
- toolbox: {
- show: true,
- feature: {
- magicType: {type: ['line', 'bar']},
- restore: {},
- saveAsImage: {}
- }
- },
- xAxis: {
- type: 'category',
- boundaryGap: false,
- data : timeList.map(function (str) {
- return str.replace(' ', '\n')
- })
- },
- yAxis: {
- name : 'percentage(%)',
- type: 'value'
- },
- series: chartDataList
- };
-
- // draw the performance chart of all resources
- if (option && typeof option === "object") {
- myChart.setOption(option, true);
- };
-};
-
-// define the struct of chart resource
-function chartData() {
- this.name = "";
- this.type = "line";
- this.smooth = true;
- this.data = [];
-};
-
-// create a new chart resource and push it into the chartlist
-function insertChartDataList(chartDataList, name, data, dataIndex) {
- var cd = new chartData();
- cd.name = name;
- cd.data[dataIndex] = data;
- chartDataList.push(cd);
-};
-
-// return the index of the specified element in the list
-function getListIndex(list, data) {
- var dataIndex = 0;
- for (var i = 0; i < list.length; i++) {
- if (list[i] == data) {
- return i;
- }
- }
- return dataIndex;
-};
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/js/pmUtil.js b/umc-iui/src/main/resources/webroot/umc-pm/js/pmUtil.js
deleted file mode 100644
index 2102e452..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/js/pmUtil.js
+++ /dev/null
@@ -1,458 +0,0 @@
-var pmUtil = {};
-function html_encode(str) {
- vars = "";
- if (str.length == 0)return "";
- s = str.replace(/&/g, "&amp;"); //1
- s = s.replace(/</g, "&lt;");
- s = s.replace(/>/g, "&gt;");
- s = s.replace(/ /g, "&nbsp;");
- s = s.replace(/\'/g, "&#39;");
- s = s.replace(/\"/g, "&quot;");
- s = s.replace(/\n/g, "<br>");
- return s;
-};
-pmUtil.indexOperate = function (obj) {
-
- var aIndex={};
- aIndex.id=obj.aData.id;
- aIndex.name=obj.aData.indexName;
- aIndex.dataType=obj.aData.indexDataType;
- aIndex.indexDes=obj.aData.indexDes;
- aIndex.strExpression=obj.aData.strExpression;
- aIndex.resourceType=obj.aData.resourceType;
- aIndex.moType=obj.aData.moType;
- var index = html_encode(JSON.stringify(aIndex));
- var indexId = obj.aData.id;
- var innerHtml = "<div class='table-btn'><span class='modify_user'><a class=\"btn-xs grey btn-editable\" href='#' onclick=\"pmUtil.modifyIndex('"+index+"')\"><i class=\"ict-modify\"></i>" + $.i18n.prop('com_zte_ums_ict_pm_action_modify') +
- "</a></span><span><a href='#' class=\"btn-xs grey btn-editable\" onclick=\"pmUtil.deleteIndex('" +
- indexId + "','"+obj.aData.moType.id+"')\"><i class=\"ict-delete\"></i>" + $.i18n.prop('com_zte_ums_ict_pm_action_delete') + "</a></span></div>";
-
- return innerHtml;
-};
-pmUtil.dataTypeRender = function (obj) {
- var record = obj.aData;
- obj.aData.indexDataType=obj.aData.dataType;
- var innerHtml = "<span>"+$.i18n.prop(record.dataType)+"</span>"
- return innerHtml;
-};
-pmUtil.indexNameLink = function (obj) {
- var index = html_encode(JSON.stringify(obj.aData));
- obj.aData.indexName=obj.aData.name;
- return "<a id='indexName' href='#' onclick=\"pmUtil.queryIndex('"+index+"')\">" + obj.aData.name + "</a>";
-};
-pmUtil.queryIndex=function(index){
-
- newIndexWizard(commonUtil.strToJson(index),"query");
- pm.index.vm.title="查看指标";
- $(".form-group").attr("disabled",true);
- pm.index.vm.viewVisible=false;
- pm.index.vm.rtnVisible=true;
- pm.index.vm.indexVisible=true;
-};
-pmUtil.addIndex=function(){
-
- newIndexWizard();
- pm.index.vm.title="新建指标";
- pm.index.vm.viewVisible=false;
- pm.index.vm. indexVisible=true;
-};
-pmUtil.modifyIndex=function(index){
-
- newIndexWizard(commonUtil.strToJson(index));
- pm.index.vm.title="修改指标";
- pm.index.vm.viewVisible=false;
- pm.index.vm.indexVisible=true;
-};
-pmUtil.deleteIndex=function(indexId,moTypeId){
- bootbox.confirm($.i18n.prop('com_zte_ums_ict_sm_confirmToDeleteIndex'), function (result) {
- if (result) {
- var ids=[];
- var del={};
- ids.push(indexId);
- del.ids=ids;
- $.ajax({
- "dataType": 'json',
- "type": "DELETE",
- "url": "/api/umcpm/v1/motype/"+moTypeId+"/indexes",
- "data" : JSON.stringify(del),
- "contentType": 'application/json; charset=utf-8',
- "success": function (res, textStatus, jqXHR) {
- window.location.href="./indexView.html";
- },
- "error": function () {
- }
- });
- }
- });
-}
-
-pmUtil.idLink = function (obj) {
- var record = obj.aData;
- var thresholdId = new String(record.id);
- return "<a href='#' onclick=\"pm.threshold.vm.queryThreshold('" + thresholdId + "')\">" + thresholdId + "</a>";
-}
-
-pmUtil.congfirmDel = function (obj) {
- bootbox.confirm($.i18n.prop('com_zte_ums_ict_sm_confirmToDeleteThreshold'), function (result) {
- if (result) {
- pm.threshold.vm.deleteThreshold(obj);
- }
- });
-}
-
-pmUtil.allOperate = function (obj) {
-
- var record = obj.aData;
- var thresholdId = record.id;
- //此时的id字段已经被渲染成html片段,如<a href="#" onclick="pm.threshold.vm.queryThreshold('10001')">10001</a>需要提取id
- thresholdId = thresholdId.substring(thresholdId.indexOf("('") + 2, thresholdId.indexOf("')"));
-
- var innerHtml = "";
-
- innerHtml = "<div class='table-btn'><span class='modify_user'><a class=\"btn-xs grey btn-editable\" href='#' onclick=\"pm.threshold.vm.modifyThreshold('" +
- thresholdId + "')\"><i class=\"ict-modify\"></i>" + $.i18n.prop('com_zte_ums_ict_pm_action_modify') +
- "</a></span><span><a href='#' class=\"btn-xs grey btn-editable\" onclick=\"pmUtil.congfirmDel('" +
- thresholdId + "')\"><i class=\"ict-delete\"></i>" + $.i18n.prop('com_zte_ums_ict_pm_action_delete') + "</a></span></div>";
-
- return innerHtml;
-}
-
-//获取QueryId
-pmUtil.getUrlParam=function(name){
- var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
- var search =decodeURIComponent(location.search.substring(1)); //decodeURIComponent() 函数可对 encodeURIComponent() 函数编码的 URI 进行解码。
- var r =search.match(reg); //匹配目标参数
- if (r != null) return unescape(r[2]); //unescape() 函数可对通过 escape() 编码的字符串进行解码。
- return null; //返回参数值
-}
-
-
-pmUtil.addMeatask = function() {
- newMeataskWizard();
- pm.meatask.vm.pageTitle="新建任务";
- pm.meatask.vm.viewVisible=false;
- pm.meatask.vm.createMeataskVisible=true;
- pm.meatask.vm.queryMeataskVisible=false;
-}
-
-pmUtil.meataskOperate = function (obj) {
- var record = obj.aData;
- var meataskId = record.id;
- //此时的id字段已经被渲染成html片段,如<a href="#" onclick="pm.threshold.vm.queryThreshold('10001')">10001</a>需要提取id
- meataskId = meataskId.substring(meataskId.indexOf("('") + 2, meataskId.indexOf("')"));
-
- var innerHtml = "";
-
- innerHtml =
- [
- "<div class=\"table-btn\">",
- "<span class=\"modify_user\">",
- "<a class=\"btn-xs grey btn-editable\" href=\"#\" onclick=\"pmUtil.queryMeatask('" + meataskId +
- "')\"><i class=\"ict-Magnifier\"></i>",
- $.i18n.prop('com_zte_ums_ict_pm_action_query'),
- "</a>",
- "</span>",
- "<span class=\"modify_user\">",
- "<a class=\"btn-xs grey btn-editable\" href=\"#\" onclick=\"pmUtil.modifyMeatask('" + meataskId + "'," + obj.iDataRow +
- ")\"><i class=\"ict-modify\"></i>",
- $.i18n.prop('com_zte_ums_ict_pm_action_modify'),
- "</a>",
- "</span>",
- "<span>",
- "<a href=\"#\" class=\"btn-xs grey btn-editable\" onclick=\"pmUtil.deleteMeatask('" + meataskId + "'," + obj.iDataRow +
- ")\"><i class=\"ict-delete\"></i>",
- $.i18n.prop('com_zte_ums_ict_pm_action_delete'),
- "</a>",
- "</span>",
- "</div>"
- ].join("\n");
- return innerHtml;
-}
-
-pmUtil.getActiveStatus = function(obj) {
- var meataskId = obj.aData.id;
- meataskId = meataskId.substring(meataskId.indexOf("('") + 2, meataskId.indexOf("')"));
- var activeStatus = obj.aData.activeStatus;
-
- var prefixStr = "";
- var suffixStr = "";
- if(activeStatus == 0){
- prefixStr = "<a href='#' class=\"label label-sm label-danger\" onclick=\"pm.meatask.vm.changeActiveStatus('";
- suffixStr = ")\">暂停</a>";
- }else{
- prefixStr = "<a href='#' class=\"label label-sm label-info\" onclick = \"pm.meatask.vm.changeActiveStatus('";
- suffixStr = ")\">激活</a>";
- }
-
- var innerHtml = prefixStr + meataskId + "'," + activeStatus + "," + obj.iDataRow + suffixStr;
-
- return innerHtml;
-}
-
-pmUtil.granularityRender = function(obj) {
- var data = obj.aData;
- switch(data.granularity){
- case (300):
- return "5分钟";
- case (900):
- return "15分钟";
- case (3600):
- return "1小时";
- }
- return "5分钟";
-}
-
-pmUtil.queryMeatask = function(meataskId) {
- queryMeataskWizard("queryID");
- pm.meatask.vm.pageTitle="查询任务";
- pm.meatask.vm.viewVisible=false;
- pm.meatask.vm.createMeataskVisible=false;
- pm.meatask.vm.queryMeataskVisible=true;
-
- $("#queryMeataskSubmit").click(function() {
- pm.meatask.vm.$showResultTable();
- });
-}
-
-pmUtil.meataskIdLink = function(obj) {
- var meatskId = obj.aData.id;
- return "<a href='#' onclick=\"pmUtil.viewMeataskById('" + meatskId + "')\">" + meatskId + "</a>";
-}
-
-pmUtil.viewMeataskById = function(meatskId) {
- newMeataskWizard(meatskId);
- pm.meatask.vm.pageTitle="查看任务";
- pm.meatask.vm.viewVisible=false;
- pm.meatask.vm.createMeataskVisible=true;
- pm.meatask.vm.queryMeataskVisible=false;
-}
-
-pmUtil.timeRender = function( obj ){
- var time=obj.aData[obj.mDataProp];
- if(time!="0"){
- var date = new Date(obj.aData[obj.mDataProp]);
- return commonUtil.parseDate(date , 'yyyy-MM-dd hh:mm:ss');
- }
-};
-
-pmUtil.deleteMeatask=function(meataskId, row){
- bootbox.confirm("确认删除此任务吗?", function (result) {
- if (result) {
- $("#ict_meatask_table_div tr:eq("+(row+1)+")").attr('style', 'display:none;');
- }
- });
-}
-
-pmUtil.modifyMeatask = function(meataskId, row) {
- modifyMeataskWizard("modifyID");
- pm.meatask.vm.pageTitle="修改任务";
- pm.meatask.vm.viewVisible=false;
- pm.meatask.vm.createMeataskVisible=true;
- pm.meatask.vm.queryMeataskVisible=false;
-}
-
-pmUtil.randomCPU = function() {
- var percent = Math.random()*100;
- percent = Math.round(percent);
- return percent + "%";
-}
-
-pmUtil.calculateTime = function(obj) {
- var data = obj.aData;
- var time = data.beginTime + data.granularity;
-
- if(time!="0"){
- var date = new Date(data.granularity * 1000 + obj.aData[obj.mDataProp]);
- return commonUtil.parseDate(date , 'yyyy-MM-dd hh:mm:ss');
- }
-}
-
-pmUtil.queryMeatask = function(meataskId) {
- pm.meatask.vm.pageTitle="查询任务";
- pm.meatask.vm.viewVisible=false;
- pm.meatask.vm.createMeataskVisible=false;
- pm.meatask.vm.queryMeataskVisible=true;
-}
-
-pmUtil.setDateRange = function (dataRangeId, vm) {
-
- var open = 'right';
-
- //var month = $.i18n.prop('ngict-iui-dateRange-month');
-
- var optionSet1 = {
-
- //startDate: moment().subtract(179, 'days'),
-
- //endDate: moment(),
-
- startDate : "2015-12-31",
-
- endDate : "2016-12-31",
-
- //format: 'YYYY-MM-DD',
- format : 'YYYY-MM-DD h:mm A',
-
- dateLimit : {
- days : 180
- },
-
- showWeekNumbers : false,
-
- timePicker : true,
- timePickerIncrement : 5,
-
- opens : open,
-
- separator : ' - ',
-
- locale : {
-
- applyLabel : $.i18n.prop('ngict-iui-dateRange-applyLabel'),
-
- cancelLabel : $.i18n.prop('ngict-iui-dateRange-cancelLabel'),
-
- fromLabel : $.i18n.prop('ngict-iui-dateRange-fromLabel'),
-
- toLabel : $.i18n.prop('ngict-iui-dateRange-toLabel'),
-
- customRangeLabel : $.i18n.prop('ngict-iui-dateRange-customRangeLabel'),
-
- daysOfWeek : [
-
- $.i18n.prop('ngict-iui-dateRange-Sunday'),
-
- $.i18n.prop('ngict-iui-dateRange-Monday'),
-
- $.i18n.prop('ngict-iui-dateRange-Tuesday'),
-
- $.i18n.prop('ngict-iui-dateRange-Wednesday'),
-
- $.i18n.prop('ngict-iui-dateRange-Thursday'),
-
- $.i18n.prop('ngict-iui-dateRange-Friday'),
-
- $.i18n.prop('ngict-iui-dateRange-Saturday')],
-
- //monthNames : ['1' + month, '2' + month, '3' + month, '4' + month, '5' + month, '6' + month, '7' + month, '8' + month, '9' + month, '10' + month, '11' + month, '12' + month],
-
- //months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
-
- monthNames: [$.i18n.prop('ngict-iui-dateRange-Jan'),
- $.i18n.prop('ngict-iui-dateRange-Feb'),
- $.i18n.prop('ngict-iui-dateRange-Mar'),
- $.i18n.prop('ngict-iui-dateRange-Apr'),
- $.i18n.prop('ngict-iui-dateRange-May'),
- $.i18n.prop('ngict-iui-dateRange-Jun'),
- $.i18n.prop('ngict-iui-dateRange-Jul'),
- $.i18n.prop('ngict-iui-dateRange-Aug'),
- $.i18n.prop('ngict-iui-dateRange-Sep'),
- $.i18n.prop('ngict-iui-dateRange-Oct'),
- $.i18n.prop('ngict-iui-dateRange-Nov'),
- $.i18n.prop('ngict-iui-dateRange-Dec')],
-
- firstDay : 1
-
- }
-
- };
-
- //datarangepicker确认
- $('input[id="' + dataRangeId + '"]').bind('apply.daterangepicker', function () {
-
- //获取时间范围,查询
-
- // 都设置为0点
-
- pmUtil.setTime($(this));
-
- // 更新tooltip内容
- //$(this).attr("data-original-title", $(this).val());
-
- });
-
- $('input[id="' + dataRangeId + '"]').daterangepicker(optionSet1);
-
-};
-
-//daterangepicker设置时间
-pmUtil.setTime = function setTime($obj) {
-
- //var title = $obj.attr('dtitle');
-
- var arr = $obj.val().split(' - ');
-
- //排除日历组件空字符串的情况。
-
- if (arr[0] != '') {
-
- var beginTime = new Date(arr[0].replace(/-/g, "/")).getTime();
-
- var endTime = new Date(arr[1].replace(/-/g, "/")).getTime();
-
- pm.query.vmPmQuery.beginTime = beginTime;
-
- pm.query.vmPmQuery.endTime = endTime;
-
- }
-
-}
-
-pmUtil.formatTime = function formatTime(ms) {
- var date = new Date(ms);
- return date.format("yyyy-MM-dd hh:mm:ss");
-}
-
-/*格式化日期*/
-
-Date.prototype.format = function (format) {
-
- /*
-
- * format="yyyy-MM-dd hh:mm:ss";
-
- */
-
- var o = {
-
- "M+" : this.getMonth() + 1,
-
- "d+" : this.getDate(),
-
- "h+" : this.getHours(),
-
- "m+" : this.getMinutes(),
-
- "s+" : this.getSeconds(),
-
- "q+" : Math.floor((this.getMonth() + 3) / 3),
-
- "S" : this.getMilliseconds()
-
- }
-
- if (/(y+)/.test(format)) {
-
- format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4
-
- - RegExp.$1.length));
-
- }
-
- for (var k in o) {
-
- if (new RegExp("(" + k + ")").test(format)) {
-
- format = format.replace(RegExp.$1, RegExp.$1.length == 1
-
- ? o[k]
-
- : ("00" + o[k]).substr(("" + o[k]).length));
-
- }
-
- }
-
- return format;
-
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/json/counters.json b/umc-iui/src/main/resources/webroot/umc-pm/json/counters.json
deleted file mode 100644
index 5fd15914..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/json/counters.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "status": 0,
- "content": [
- {
- "id": "CruntimeInfo.averageCpuUsage",
- "name": "平均CPU使用率%"
- },
- {
- "id": "CruntimeInfo.averageMemoryUsage",
- "name": "平均内存使用率%"
- },
- {
- "id": "Cn.cscf.businesskpi.totalUsers",
- "name": "总用户数"
- },
- {
- "id": "Cn.ims.businesskpi.totalUsers",
- "name": "总用户数"
- },
- {
- "id": "C12001789",
- "name": "总用户数"
- }
- ]
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/json/index.json b/umc-iui/src/main/resources/webroot/umc-pm/json/index.json
deleted file mode 100644
index c6a3f1a9..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/json/index.json
+++ /dev/null
@@ -1,18 +0,0 @@
-[
- {
- "id": "10000",
- "name": "指标一",
- "indexDes": "具体信息",
- "strExpression": "a+b",
- "resourceType":
- {
- "id": "vnf.cn.cscf",
- "name": "CSCF"
- },
- "moType": {
- "id": "ns.cn.epc.metrictype",
- "name": "性能KPI"
- },
- "dataType": "0"
- }
-] \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/json/indexes.json b/umc-iui/src/main/resources/webroot/umc-pm/json/indexes.json
deleted file mode 100644
index 332cced7..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/json/indexes.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "status": 0,
- "content": [
- {
- "id": "001",
- "name": "test指标1",
- "indexDes": "这是一个测试指标1",
- "strExpresstion": "vnf.runtimeInfo.averageCpuUsage+1",
- "dataType": "STRING",
- "resourceType": {
- "id": "vnf.cn.cscf",
- "name": "CSCF"
- },
- "moType": {
- "id": "vnf.cn.cscf.metrictype",
- "name": "性能KPI-3"
- }
- },
- {
- "id": "002",
- "name": "test指标2",
- "indexDes": "这是一个测试指标2",
- "strExpresstion": "vnf.runtimeInfo.averageCpuUsage+2",
- "dataType": "STRING",
- "resourceType": {
- "id": "vnf.cn.cscf",
- "name": "CSCF"
- },
- "moType": {
- "id": "vnf.cn.cscf.metrictype",
- "name": "性能KPI-3"
- }
- },
- {
- "id": "003",
- "name": "test指标3",
- "indexDes": "这是一个测试指标3",
- "strExpresstion": "vnf.runtimeInfo.averageCpuUsage+3",
- "dataType": "STRING",
- "resourceType": {
- "id": "vnf.cn.cscf",
- "name": "CSCF"
- },
- "moType": {
- "id": "vnf.cn.cscf.metrictype",
- "name": "性能KPI-3"
- }
- }
- ]
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/meatasks_content.json b/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/meatasks_content.json
deleted file mode 100644
index aff1b08c..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/meatasks_content.json
+++ /dev/null
@@ -1,97 +0,0 @@
-{
- "status": 0,
- "content": [
- {
- "id": "10001",
- "name": "CSCF性能任务",
- "resourceType": {
- "id": "",
- "name": "vnf.cn.cscf"
- },
- "moType": {
- "id": "vnf.cn.cscf.metrictype",
- "name": "性能KPI"
- },
- "resources": [
- {
- "id": "vnf.cn.cscf.001",
- "name": "cscf001",
- "resType": "vnf.cn.cscf"
- }
- ],
- "activeStatus": 0,
- "granularity": 900,
- "beginTime": 1447980721729,
- "endTime": 1448067121729
- },
- {
- "id": "10002",
- "name": "CSCF性能任务",
- "resourceType": {
- "id": "",
- "name": "vnf.cn.cscf"
- },
- "moType": {
- "id": "vnf.cn.cscf.metrictype",
- "name": "性能KPI"
- },
- "resources": [
- {
- "id": "vnf.cn.cscf.002",
- "name": "cscf002",
- "resType": "vnf.cn.cscf"
- }
- ],
- "activeStatus": 1,
- "granularity": 300,
- "beginTime": 1447980721729,
- "endTime": 1448067121729
- },
- {
- "id": "003",
- "name": "IMS性能任务",
- "resourceType": {
- "id": "",
- "name": ""
- },
- "moType": {
- "id": "ns.cn.ims.metrictype",
- "name": "性能KPI"
- },
- "resources": [
- {
- "id": "ns.cn.ims.001",
- "name": "ims001",
- "resType": "ns.cn.ims"
- }
- ],
- "activeStatus": 0,
- "granularity": 300,
- "beginTime": 1447980721729,
- "endTime": 1448067121729
- },
- {
- "id": "004",
- "name": "EPC性能任务",
- "resourceType": {
- "id": "",
- "name": ""
- },
- "moType": {
- "id": "ns.cn.epc.metrictype",
- "name": "性能KPI"
- },
- "resources": [
- {
- "id": "ns.cn.epc.002",
- "name": "epc002",
- "resType": "ns.cn.epc"
- }
- ],
- "activeStatus": 1,
- "granularity": 900,
- "beginTime": 1447980721729,
- "endTime": 1448067121729
- }
- ]
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/moType.json b/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/moType.json
deleted file mode 100644
index f1c71218..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/moType.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "status": 0,
- "content": [
- {
- "id": "ns.cn.ims.metrictype",
- "name": "性能KPI-1"
- },
- {
- "id": "ns.cn.ims.metrictype1",
- "name": "性能KPI-2"
- },
- {
- "id": "ns.cn.ims.metrictype2",
- "name": "性能KPI-3"
- },
- {
- "id": "ns.cn.ims.metrictype3",
- "name": "性能KPI-4"
- },
- {
- "id": "ns.cn.ims.metrictype4",
- "name": "性能KPI-5"
- }
- ]
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/moType1.json b/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/moType1.json
deleted file mode 100644
index ef3c88bc..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/moType1.json
+++ /dev/null
@@ -1,9 +0,0 @@
-{
- "status": 0,
- "content": [
- {
- "id": "nfv.cn.metrictype.none",
- "name": "开发中"
- }
- ]
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/resourceType.json b/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/resourceType.json
deleted file mode 100644
index 97276268..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/resourceType.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "status": 0,
- "content": [
- {
- "id": "ns.cn.ims",
- "name": "IMS"
- },
- {
- "id": "vnf.cn.hss",
- "name": "HSS"
- },
- {
- "id": "vnf.cn.xgw",
- "name": "xGW"
- },
- {
- "id": "vnf.cn.sss",
- "name": "SSS"
- },
- {
- "id": "vnf.cn.cscf",
- "name": "CSCF"
- },
- {
- "id": "ns.cn.epc",
- "name": "EPC"
- }
- ]
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/resources.json b/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/resources.json
deleted file mode 100644
index 0cfee218..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/resources.json
+++ /dev/null
@@ -1,115 +0,0 @@
-{
- "status": 0,
- "content": [
- {
- "id": "ns.cn.ims.000",
- "name": "ims000",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.001",
- "name": "ims001",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.002",
- "name": "ims002",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.003",
- "name": "ims003",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.004",
- "name": "ims004",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.005",
- "name": "ims005",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.006",
- "name": "ims006",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.007",
- "name": "ims007",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.008",
- "name": "ims008",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.009",
- "name": "ims009",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.010",
- "name": "ims010",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.011",
- "name": "ims011",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.012",
- "name": "ims012",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.013",
- "name": "ims013",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.014",
- "name": "ims014",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.015",
- "name": "ims015",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.016",
- "name": "ims016",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.017",
- "name": "ims017",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.018",
- "name": "ims018",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.019",
- "name": "ims019",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.020",
- "name": "ims020",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.021",
- "name": "ims021",
- "resType": "ns.cn.ims"
- }
- ]
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/resources1.json b/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/resources1.json
deleted file mode 100644
index cb059d1c..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/resources1.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "status": 0,
- "content": [
- {
- "id": "ns.cn.ims.000",
- "name": "ims000",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.001",
- "name": "ims001",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.002",
- "name": "ims002",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.003",
- "name": "ims003",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.004",
- "name": "ims004",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.005",
- "name": "ims005",
- "resType": "ns.cn.ims"
- }
- ]
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/resources2.json b/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/resources2.json
deleted file mode 100644
index c04d4b2f..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/json/meatask/resources2.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
- "status": 0,
- "content": [
- {
- "id": "ns.cn.ims.006",
- "name": "ims006",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.007",
- "name": "ims007",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.008",
- "name": "ims008",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.009",
- "name": "ims009",
- "resType": "ns.cn.ims"
- },
- {
- "id": "ns.cn.ims.010",
- "name": "ims010",
- "resType": "ns.cn.ims"
- }
- ]
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/json/meatasks.json b/umc-iui/src/main/resources/webroot/umc-pm/json/meatasks.json
deleted file mode 100644
index 30b9e367..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/json/meatasks.json
+++ /dev/null
@@ -1,97 +0,0 @@
-{
- "status": 0,
- "content": [
- {
- "id": "10001",
- "name": "CSCF性能任务",
- "resourceType": {
- "id": "",
- "name": ""
- },
- "moType": {
- "id": "vnf.cn.cscf.metrictype",
- "name": "性能KPI"
- },
- "resources": [
- {
- "id": "vnf.cn.cscf.001",
- "name": "cscf001",
- "resType": "vnf.cn.cscf"
- }
- ],
- "activeStatus": 0,
- "granularity": 900,
- "beginTime": 1447980721729,
- "endTime": 1447980721729
- },
- {
- "id": "10002",
- "name": "CSCF性能任务",
- "resourceType": {
- "id": "",
- "name": ""
- },
- "moType": {
- "id": "vnf.cn.cscf.metrictype",
- "name": "性能KPI"
- },
- "resources": [
- {
- "id": "vnf.cn.cscf.002",
- "name": "cscf002",
- "resType": "vnf.cn.cscf"
- }
- ],
- "activeStatus": 0,
- "granularity": 300,
- "beginTime": 1447980721729,
- "endTime": 1447980721729
- },
- {
- "id": "003",
- "name": "IMS性能任务",
- "resourceType": {
- "id": "",
- "name": ""
- },
- "moType": {
- "id": "ns.cn.ims.metrictype",
- "name": "性能KPI"
- },
- "resources": [
- {
- "id": "ns.cn.ims.001",
- "name": "ims001",
- "resType": "ns.cn.ims"
- }
- ],
- "activeStatus": 0,
- "granularity": 300,
- "beginTime": 1447980721729,
- "endTime": 1447980721729
- },
- {
- "id": "004",
- "name": "EPC性能任务",
- "resourceType": {
- "id": "",
- "name": ""
- },
- "moType": {
- "id": "ns.cn.epc.metrictype",
- "name": "性能KPI"
- },
- "resources": [
- {
- "id": "ns.cn.epc.002",
- "name": "epc002",
- "resType": "ns.cn.epc"
- }
- ],
- "activeStatus": 0,
- "granularity": 900,
- "beginTime": 1447980721729,
- "endTime": 1447980721729
- }
- ]
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/json/meatasks_content.json b/umc-iui/src/main/resources/webroot/umc-pm/json/meatasks_content.json
deleted file mode 100644
index e34073e0..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/json/meatasks_content.json
+++ /dev/null
@@ -1,94 +0,0 @@
-[
- {
- "id": "10001",
- "name": "CSCF性能任务",
- "resourceType": {
- "id": "",
- "name": "vnf.cn.cscf"
- },
- "moType": {
- "id": "vnf.cn.cscf.metrictype",
- "name": "性能KPI"
- },
- "resources": [
- {
- "id": "vnf.cn.cscf.001",
- "name": "cscf001",
- "resType": "vnf.cn.cscf"
- }
- ],
- "activeStatus": 0,
- "granularity": 900,
- "beginTime": 1447980721729,
- "endTime": 1447980721729
- },
- {
- "id": "10002",
- "name": "CSCF性能任务",
- "resourceType": {
- "id": "",
- "name": "vnf.cn.cscf"
- },
- "moType": {
- "id": "vnf.cn.cscf.metrictype",
- "name": "性能KPI"
- },
- "resources": [
- {
- "id": "vnf.cn.cscf.002",
- "name": "cscf002",
- "resType": "vnf.cn.cscf"
- }
- ],
- "activeStatus": 1,
- "granularity": 300,
- "beginTime": 1447980721729,
- "endTime": 1447980721729
- },
- {
- "id": "003",
- "name": "IMS性能任务",
- "resourceType": {
- "id": "",
- "name": ""
- },
- "moType": {
- "id": "ns.cn.ims.metrictype",
- "name": "性能KPI"
- },
- "resources": [
- {
- "id": "ns.cn.ims.001",
- "name": "ims001",
- "resType": "ns.cn.ims"
- }
- ],
- "activeStatus": 0,
- "granularity": 300,
- "beginTime": 1447980721729,
- "endTime": 1447980721729
- },
- {
- "id": "004",
- "name": "EPC性能任务",
- "resourceType": {
- "id": "",
- "name": ""
- },
- "moType": {
- "id": "ns.cn.epc.metrictype",
- "name": "性能KPI"
- },
- "resources": [
- {
- "id": "ns.cn.epc.002",
- "name": "epc002",
- "resType": "ns.cn.epc"
- }
- ],
- "activeStatus": 1,
- "granularity": 900,
- "beginTime": 1447980721729,
- "endTime": 1447980721729
- }
-] \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/json/resourceType.json b/umc-iui/src/main/resources/webroot/umc-pm/json/resourceType.json
deleted file mode 100644
index a22c72ad..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/json/resourceType.json
+++ /dev/null
@@ -1,8 +0,0 @@
-[
-{"id":"vnf.cn.cscf","name":"CSCF"},
-{"id":"ns.cn.epc","name":"EPC"},
-{"id":"vnf.cn.cscf1","name":"CSCF1"},
-{"id":"ns.cn.epc2","name":"EPC1"},
-{"id":"vnf.cn.cscf23","name":"CSCF2"},
-{"id":"ns.cn.epcf","name":"EPC2"}
-]
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/json/test.json b/umc-iui/src/main/resources/webroot/umc-pm/json/test.json
deleted file mode 100644
index 715fe80c..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/json/test.json
+++ /dev/null
@@ -1,152 +0,0 @@
-{
- "10001":{
- "id": "10001",
- "name": "测试门限任务1",
- "resourceType": {
- "id": "vnf.cn.cscf",
- "name": "CSCF"
- },
- "moType": {
- "id": "vnf.cn.cscf.metrictype",
- "name": "性能KPI"
- },
- "threshholdValue": {
- "indexOrCounterId": "vnf.runtimeInfo.averageMemoryUsage",
- "indexOrCounterName": "测试指标1",
- "criticalValue": {
- "value": "10",
- "delta": "1"
- },
- "majorValue": {
- "value": "20",
- "delta": "2"
- },
- "minorValue": {
- "value": "30",
- "delta": "3"
- },
- "warnValue": {
- "value": "40",
- "delta": "4"
- },
- "alarmType": "0"
- },
- "resources": [
- {
- "id": "vnf.cn.cscf.001",
- "name": "cscf001",
- "value": "SSS"
- },
- {
- "id": "vnf.cn.cscf.002",
- "name": "cscf002",
- "value": "TTT"
- },
- {
- "id": "vnf.cn.cscf.003",
- "name": "cscf003",
- "value": "ZZZ"
- },
- {
- "id": "vnf.cn.cscf.004",
- "name": "cscf004",
- "value": "SSS"
- },
- {
- "id": "vnf.cn.cscf.005",
- "name": "cscf005",
- "value": "TTT"
- },
- {
- "id": "vnf.cn.cscf.006",
- "name": "cscf006",
- "value": "ZZZ"
- },
- {
- "id": "vnf.cn.cscf.007",
- "name": "cscf007",
- "value": "SSS"
- },
- {
- "id": "vnf.cn.cscf.008",
- "name": "cscf008",
- "value": "TTT"
- },
- {
- "id": "vnf.cn.cscf.009",
- "name": "cscf009",
- "value": "ZZZ"
- },
- {
- "id": "vnf.cn.cscf.010",
- "name": "cscf010",
- "value": "SSS"
- },
- {
- "id": "vnf.cn.cscf.011",
- "name": "cscf011",
- "value": "TTT"
- },
- {
- "id": "vnf.cn.cscf.012",
- "name": "cscf012",
- "value": "ZZZ"
- },
- {
- "id": "vnf.cn.cscf.013",
- "name": "cscf013",
- "value": "SSS"
- },
- {
- "id": "vnf.cn.cscf.014",
- "name": "cscf014",
- "value": "TTT"
- },
- {
- "id": "vnf.cn.cscf.015",
- "name": "cscf015",
- "value": "ZZZ"
- }
- ]
- },
- "10002": {
- "id": "10002",
- "name": "这是一个测试门限任务2",
- "resourceType": {
- "id": "vnf.cn.cscf",
- "name": "CSCF"
- },
- "moType": {
- "id": "vnf.cn.cscf.metrictype",
- "name": "性能KPI"
- },
- "threshholdValue": {
- "indexOrCounterId": "8000",
- "indexOrCounterName": "测试指标2",
- "criticalValue": {
- "value": "10",
- "delta": "1"
- },
- "majorValue": {
- "value": "20",
- "delta": "2"
- },
- "minorValue": {
- "value": "30",
- "delta": "3"
- },
- "warnValue": {
- "value": "40",
- "delta": "4"
- },
- "alarmType": "0"
- },
- "resources": [
- {
- "id": "vnf.cn.cscf.002",
- "name": "cscf002",
- "value": "YYY"
- }
- ]
- }
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-pm/json/thresholdList.json b/umc-iui/src/main/resources/webroot/umc-pm/json/thresholdList.json
deleted file mode 100644
index e2cb1cd5..00000000
--- a/umc-iui/src/main/resources/webroot/umc-pm/json/thresholdList.json
+++ /dev/null
@@ -1,116 +0,0 @@
-[
- {
- "id": "10000",
- "name": "EPC性能任务",
- "resources": [
- {
- "id": "ns.cn.epc.001",
- "name": "epc001",
- "resType": "ns.cn.epc"
- }
- ],
- "threshholdValue": {
- "direction": "up",
- "warning": {
- "threshold": "20",
- "delta": "5"
- },
- "minor": {
- "threshold": "20",
- "delta": "5"
- },
- "major": {
- "threshold": "20",
- "delta": "5"
- },
- "critical": {
- "threshold": "20",
- "delta": "5"
- }
- },
- "metricType": {
- "id": "ns.cn.epc.metrictype",
- "name": "性能KPI"
- },
- "status": 0,
- "granularity": 900,
- "beginTime": 1441036800000,
- "endTime": 1577808000000
- },
- {
- "id": "10001",
- "name": "001",
- "resources": [
- {
- "id": "ns.cn.ims.001",
- "name": "ims001",
- "resType": "ns.cn.ims"
- }
- ],
- "threshholdValue": {
- "direction": "up",
- "warning": {
- "threshold": "20",
- "delta": "5"
- },
- "minor": {
- "threshold": "20",
- "delta": "5"
- },
- "major": {
- "threshold": "20",
- "delta": "5"
- },
- "critical": {
- "threshold": "20",
- "delta": "5"
- }
- },
- "metricType": {
- "id": "ns.cn.ims.metrictype",
- "name": "性能KPI"
- },
- "status": 0,
- "granularity": 900,
- "beginTime": 1441036800000,
- "endTime": 1577808000000
- },
- {
- "id": "10002",
- "name": "123",
- "resources": [
- {
- "id": "vnf.cn.cscf.001",
- "name": "cscf001",
- "resType": "vnf.cn.cscf"
- }
- ],
- "threshholdValue": {
- "direction": "up",
- "warning": {
- "threshold": "20",
- "delta": "5"
- },
- "minor": {
- "threshold": "20",
- "delta": "5"
- },
- "major": {
- "threshold": "20",
- "delta": "5"
- },
- "critical": {
- "threshold": "20",
- "delta": "5"
- }
- },
- "metricType": {
- "id": "vnf.cn.cscf.metrictype",
- "name": "性能KPI"
- },
- "status": 0,
- "granularity": 900,
- "beginTime": 1441036800000,
- "endTime": 1577808000000
- }
-] \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/css/main.css b/umc-iui/src/main/resources/webroot/umc-topo/css/main.css
deleted file mode 100644
index 4475f86d..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/css/main.css
+++ /dev/null
@@ -1,161 +0,0 @@
-@CHARSET "UTF-8";
-
-.popupContent {
- position: absolute;
- visibility: hidden;
- overflow: hidden;
- background-color: #F9F9F9;
- padding: 0px;
- border: 1px solid #cccccc;
- -moz-border-radius: 10px;
- -webkit-box-shadow: 0 0 10px #ccc;
- box-shadow: 0 0 10px #ccc;
- margin: 20px auto;
- background-image: -moz-linear-gradient(top, #ffffff, #f2f2f2);
- background-image: -webkit-gradient(linear, left top, bottom, from(#ffffff),
- to(#f2f2f2) );
- z-index: 50;
-}
-
-.dialogTab {
- width: 100%;
- height: auto;
-}
-
-.menu {
- /* visibility: hidden; */
- font-family: arial, sans-serif;
- margin: 0;
- z-index: 50;
-}
-/* remove the bullets and set the margin and padding to zero for the unordered list */
-.menu ul {
- padding: 0;
- margin: 0;
- list-style-type: none;
-}
-/* float the list so that the items are in a line and their position relative so that the drop down list will appear in the right place underneath each list item */
-.menu ul li {
- position: relative;
-}
-/* style the links to be 104px wide by 30px high with a top and right border 1px solid white. Set the background color and the font size. */
-.menu ul li a {
- display: block;
- text-align: center;
- text-decoration: none;
- width: 104px;
- height: 30px;
- color: #000;
- border: 1px solid #fff;
- border-width: 1px 1px 0 0;
- background: #65BBF9;
- line-height: 30px;
- font-size: 11px;
-}
-/* make the dropdown ul invisible */
-.menu ul li ul {
- display: none;
-}
-
-/* specific to non IE browsers */
-/* set the background and foreground color of the main menu li on hover */
-.menu ul li:hover a {
- /* color: #fff; */
- background: #65BBF9;
-}
-/* make the sub menu ul visible and position it beneath the main menu list item */
-.menu ul li:hover ul {
- display: block;
- position: absolute;
- top: 0px;
- left: 104px;
- width: 105px;
-}
-/* style the background and foreground color of the submenu links */
-.menu ul li:hover ul li a {
- display: block;
- background: #faeec7;
- color: #000;
-}
-/* style the background and forground colors of the links on hover */
-.menu ul li:hover ul li a:hover {
- background: #dfc184;
- color: #000;
-}
-
-li {
- list-style-type: none;
-}
-
-#NS {
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- position: absolute;
-}
-
-#VIM {
- top: 0;
- bottom: 0;
- left: 0;
- right: 0;
- position: absolute;
-}
-
-.sigma-edge {
- stroke: #14191C;
-}
-
-.sigma-node {
- fill: green;
- stroke: #14191C;
- stroke-width: 2px;
-}
-
-.infoDialog {
- font-family: arial, sans-serif;
- margin: 0;
- z-index: 50;
- width: auto;
- height: auto;
- position: absolute;
- background-color: #F9F9F9;
- padding: 0px;
- border: 1px solid #cccccc;
-}
-
-.infoDialog table{
- display: table;
- border-collapse: collapse;
- border-spacing: 0px!important;
- border-color: grey;
- border: 1px solid #cccccc;
-}
-
-.infoDialog table td{
- border: 1px solid #cccccc;
- padding: 0px;
-}
-
-/* style the links to be 104px wide by 30px high with a top and right border 1px solid white. Set the background color and the font size. */
-.infoDialog table tr td a {
- display: block;
- text-align: center;
- text-decoration: none;
- width: auto;
- height: 30px;
- color: #000;
- border: 1px solid #fff;
- border-width: 0px 0px 0 0;
- background: #65BBF9;
- line-height: 30px;
- font-size: 11px;
-}
-
-/* specific to non IE browsers */
-/* set the background and foreground color of the main menu li on hover */
-.infoDialog table tr td:hover a {
- /* color: #fff; */
- /* background: #35A7F9; */
-} \ No newline at end of file
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/NS.png b/umc-iui/src/main/resources/webroot/umc-topo/images/NS.png
deleted file mode 100644
index a0798361..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/NS.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/NS1.png b/umc-iui/src/main/resources/webroot/umc-topo/images/NS1.png
deleted file mode 100644
index c83f615c..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/NS1.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/VDU.png b/umc-iui/src/main/resources/webroot/umc-topo/images/VDU.png
deleted file mode 100644
index 94511271..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/VDU.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/VDU1.png b/umc-iui/src/main/resources/webroot/umc-topo/images/VDU1.png
deleted file mode 100644
index 1332f43c..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/VDU1.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/VNF.png b/umc-iui/src/main/resources/webroot/umc-topo/images/VNF.png
deleted file mode 100644
index b326297d..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/VNF.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/VNF1.png b/umc-iui/src/main/resources/webroot/umc-topo/images/VNF1.png
deleted file mode 100644
index cb3f33ce..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/VNF1.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/VNFC.png b/umc-iui/src/main/resources/webroot/umc-topo/images/VNFC.png
deleted file mode 100644
index 4781a0b6..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/VNFC.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/VNFC1 .png b/umc-iui/src/main/resources/webroot/umc-topo/images/VNFC1 .png
deleted file mode 100644
index ee5b2ce0..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/VNFC1 .png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/off/Bridge.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/off/Bridge.gif
deleted file mode 100644
index 6b320f43..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/off/Bridge.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/off/Computer.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/off/Computer.gif
deleted file mode 100644
index a2cf7b5a..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/off/Computer.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/off/Hub.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/off/Hub.gif
deleted file mode 100644
index 0b0bc599..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/off/Hub.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/off/InternetServer.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/off/InternetServer.gif
deleted file mode 100644
index 2a72fc30..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/off/InternetServer.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/off/MiniComputer.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/off/MiniComputer.gif
deleted file mode 100644
index b92c1054..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/off/MiniComputer.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/off/Multiplexer.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/off/Multiplexer.gif
deleted file mode 100644
index 3229cd52..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/off/Multiplexer.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/off/Router.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/off/Router.gif
deleted file mode 100644
index c7909258..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/off/Router.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/off/Server.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/off/Server.gif
deleted file mode 100644
index eba1b081..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/off/Server.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/off/Switch.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/off/Switch.gif
deleted file mode 100644
index 1dcfdb6c..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/off/Switch.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/off/TerminalServer.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/off/TerminalServer.gif
deleted file mode 100644
index dd5d3deb..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/off/TerminalServer.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/off/vim.png b/umc-iui/src/main/resources/webroot/umc-topo/images/off/vim.png
deleted file mode 100644
index e71d8082..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/off/vim.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/Bridge.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/on/Bridge.gif
deleted file mode 100644
index 37e9aab3..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/Bridge.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/BridgeMinus.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/on/BridgeMinus.gif
deleted file mode 100644
index 4e6f29fe..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/BridgeMinus.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/BridgePlus.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/on/BridgePlus.gif
deleted file mode 100644
index 5d5b995a..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/BridgePlus.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/Computer.png b/umc-iui/src/main/resources/webroot/umc-topo/images/on/Computer.png
deleted file mode 100644
index 615ba5e2..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/Computer.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/ComputerMinusbak.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/on/ComputerMinusbak.gif
deleted file mode 100644
index 709ab58a..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/ComputerMinusbak.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/ComputerPlusbak.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/on/ComputerPlusbak.gif
deleted file mode 100644
index c6468837..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/ComputerPlusbak.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/Computerbak.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/on/Computerbak.gif
deleted file mode 100644
index f90b0512..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/Computerbak.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/Hub.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/on/Hub.gif
deleted file mode 100644
index bc856db6..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/Hub.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/HubPlus.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/on/HubPlus.gif
deleted file mode 100644
index 84dfb231..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/HubPlus.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/InternetServer.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/on/InternetServer.gif
deleted file mode 100644
index 1fbf5e60..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/InternetServer.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/MiniComputer.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/on/MiniComputer.gif
deleted file mode 100644
index 7b94af1e..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/MiniComputer.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/Multiplexer.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/on/Multiplexer.gif
deleted file mode 100644
index 3786cffc..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/Multiplexer.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/Router.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/on/Router.gif
deleted file mode 100644
index 10024363..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/Router.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/Server.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/on/Server.gif
deleted file mode 100644
index 8bcec384..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/Server.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/Switch.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/on/Switch.gif
deleted file mode 100644
index 4630cb95..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/Switch.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/TerminalServer.gif b/umc-iui/src/main/resources/webroot/umc-topo/images/on/TerminalServer.gif
deleted file mode 100644
index 233f2bec..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/TerminalServer.gif
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/hostMinus.png b/umc-iui/src/main/resources/webroot/umc-topo/images/on/hostMinus.png
deleted file mode 100644
index a66ada2c..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/hostMinus.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/hostPlus.png b/umc-iui/src/main/resources/webroot/umc-topo/images/on/hostPlus.png
deleted file mode 100644
index 01be1df8..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/hostPlus.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/vdu.png b/umc-iui/src/main/resources/webroot/umc-topo/images/on/vdu.png
deleted file mode 100644
index 88c3e737..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/vdu.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/vimMinus.png b/umc-iui/src/main/resources/webroot/umc-topo/images/on/vimMinus.png
deleted file mode 100644
index 5a08daad..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/vimMinus.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/vimMinusbak.png b/umc-iui/src/main/resources/webroot/umc-topo/images/on/vimMinusbak.png
deleted file mode 100644
index 136e6498..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/vimMinusbak.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/vimPlus.png b/umc-iui/src/main/resources/webroot/umc-topo/images/on/vimPlus.png
deleted file mode 100644
index 61da475f..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/vimPlus.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/on/vimPlusbak.png b/umc-iui/src/main/resources/webroot/umc-topo/images/on/vimPlusbak.png
deleted file mode 100644
index 4a36c30c..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/on/vimPlusbak.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/images/vim.png b/umc-iui/src/main/resources/webroot/umc-topo/images/vim.png
deleted file mode 100644
index 322fd515..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/images/vim.png
+++ /dev/null
Binary files differ
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/js/physicalTopology.js b/umc-iui/src/main/resources/webroot/umc-topo/js/physicalTopology.js
deleted file mode 100644
index 7ff7d54a..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/js/physicalTopology.js
+++ /dev/null
@@ -1,356 +0,0 @@
-
-// definition node image resource
-var imgPlus =
-[
-
- './images/on/vdu.png', // VDU
- './images/on/hostPlus.png', // HOST
- './images/on/vimPlus.png' //VIM
-],
-imgMinus =
-[
- './images/on/vdu.png', // VDU
- './images/on/hostMinus.png', // HOST
- './images/on/vimMinus.png' //VIM
-];
-
-
-// definition node data global variable
-var VIMData, HOSTData, VDUData;
-
-// link count
-var edgeID = 0;
-
-function jumpToService()
-{
- //window.navigate("html/serviceTopology.html");
- self.location='./serviceTopology.html';
-}
-
-
-// ready
-$(document).ready(function()
-{
- // definition resource interface url
- var vimUrl = "../../api/roc/v1/resource/vims";
- var hostUrl = "../../api/roc/v1/resource/hosts";
- var vduUrl = "../../api/roc/v1/resource/vdus";
-
- $.ajaxSettings.async = false; // set ajax get json was synchronization
-
- // get vim
- $.ajax({
- "type": 'get',
- "url": vimUrl,
- "dataType": "json",
- "success": function (resp) {
- if(resp.operationResult == "SUCCESS")
- {
- VIMData = resp;
- }
- else{
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- }
-
- });
-
- // get host
- $.ajax({
- "type": 'get',
- "url": hostUrl,
- "dataType": "json",
- "success": function (resp) {
- if(resp.operationResult == "SUCCESS")
- {
- HOSTData = resp;
- }
- else{
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- }
-
- });
-
- // get vdu
- $.ajax({
- "type": 'get',
- "url": vduUrl,
- "dataType": "json",
- "success": function (resp) {
- if(resp.operationResult == "SUCCESS")
- {
- VDUData = resp;
- }
- else{
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- }
-
- });
-
-
- /*$.getJSON('../data/ns.json', function(data){
- NSData = data;
- });
-
- $.getJSON('../data/vnfc.json', function(data){
- VNFCData = data;
- });
-
- $.getJSON('../data/vdu.json', function(data){
- VDUData = data;
- });
-
- $.getJSON('../data/vnf.json', function(data){
- VNFData = data;
- });
-
- $.getJSON('../data/host.json', function(data){
- HOSTData = data;
- });*/
-
- var Topo = new oTopo();
- var settings=
- {
- minNodeSize : 30,
- maxNodeSize : 60,
- minEdgeSize: 2,
- maxEdgeSize: 6,
- nodesPowRatio: 1,
- edgesPowRatio: 1,
- doubleClickZoomingRatio : 0,
- mouseZoomDuration : 1000,
- };
- Topo.canvas('VIM', settings);
-
- // set the nodes can be drag and drop
- Topo.setDrag(true);
-
- // Disable the right mouse button for browser
- Topo.noright(document.body);
-
- // custom parameter
- var custData = new Array();
- var VIMSize = VIMData.data.length;
-
- if(0 < VIMSize)
- {
- for ( var i = 0; i < VIMSize; i++)
- {
- custData.image = imgPlus[2];
- Topo.addNode(creatNodeByJSON("VIM", VIMData.data[i], custData, i + 1));
- }
- }
-
-
- // When a node is clicked, we check for each node
- // if it is a neighbor of the clicked one. If not,
- // we set its color as grey, and else, it takes its
- // original color.
- // We do the same for the edges, and we only keep
- // edges that have both extremities colored.
- Topo.mouseBind('doubleClickNode', function(e)
- {
- var n = e.data.node;
- var custdata = new Array();
-
- if ('VIM' == n.nodeType)
- {
- if(false == n.clickOpen)
- {
- // get hostNode count
- var HOSTSize = HOSTData.data.length;
-
- if(0 < HOSTSize)
- {
- for ( var i = 0; i < HOSTSize; i++)
- {
- // created host node
- if (n.id == HOSTData.data[i].vimId)
- {
- custdata.x = i;
- custdata.y = n.y + 0.5;
-
- var VDUSize = VDUData.data.length;
- if(0 < VDUSize)
- {
- var puls = false;
- for ( var j = 0; j < VDUSize; j++)
- {
- // Whether contains VDU node
- if(HOSTData.data[i].oid == VDUData.data[j].hostId)
- {
- puls = true;
- }
- }
-
- if(puls)
- {
- custdata.image = imgPlus[1];
- }
- else
- {
- custdata.image = undefined;
- }
- }
-
- Topo.addNode(creatNodeByJSON("HOST", HOSTData.data[i], custdata, i + 1));
- n.childrens.push(HOSTData.data[i].oid);
- n.image.url = imgMinus[2];
-
- // created link
- Topo.addLink(creatEdge(n.id,HOSTData.data[i].oid));
- }
- }
- }
-
- n.clickOpen = true;
- }
- else
- {
- // delete children node
- var childSize = n.childrens.length;
- for ( var i = 0; i < childSize; i++)
- {
- delNode(n.childrens[i]);
- }
-
- // reset link count
- edgeID = 0;
-
- if (0 < childSize)
- {
- n.image.url = imgPlus[2];
- }
- n.clickOpen = false;
- }
- }
-
-
- if ('HOST' == n.nodeType)
- {
- if(false == n.clickOpen)
- {
- var VDUSize = VDUData.data.length;
- if(0 < VDUSize)
- {
- for ( var i = 0; i < VDUSize; i++)
- {
- // created vdu node
- if(n.id == VDUData.data[i].hostId)
- {
- custdata.x = i;
- custdata.y = n.y + 1;
- custdata.image = imgPlus[0];
- Topo.addNode(creatNodeByJSON("VDU", VDUData.data[i], custdata, i + 1));
- n.childrens.push(VDUData.data[i].oid);
- n.image.url = imgMinus[1];
-
- // created link
- Topo.addLink(creatEdge(n.id,VDUData.data[i].oid));
- }
- }
- }
-
- n.clickOpen = true;
- }
- else
- {
- // delete VNFC node
- var childSize = n.childrens.length;
- for ( var i = 0; i < childSize; i++)
- {
- delNode(n.childrens[i]);
- }
-
- if(0 < childSize)
- {
- n.image.url = imgPlus[1];
- }
- n.clickOpen = false;
- }
- }
-
- // Since the data has been modified, we need to
- // call the refresh method to make the colors
- // update effective.
- Topo.refresh();
- });
-
-
-
- // Binding the event of mouse rightClickNode
- Topo.mouseBind('rightClickNode', function(e)
- {
- /*if('VIM' == e.data.node.nodeType)
- {
- var menu = '<ul>';
- menu += '<li><a style="cursor:pointer;" onclick="jumpToService();">业务拓扑</a></li>';
- menu += '</ul>';
- infoDialogAddview(menu,'menu');
- infoDialogshow();
- return;
- }*/
- });
-
-
- // Binding the event of mouse overNode
- Topo.mouseBind('overNode', function(e)
- {
- infoDialogAddview(createNodeinfo(e.data.node));
- infoDialogshow();
- });
-
- // Binding the event of mouse outNode
- Topo.mouseBind('outNode', function(e)
- {
- //e.data.node.borderColor = "";
- //Topo.refresh();
- infoDialoghide();
- });
-
- // When the stage is clicked, we just color each
- // node and edge with its original color.
- Topo.mouseBind('clickStage', function(e)
- {
- // Same as in the previous event:
- Topo.refresh();
-
- // close infoDialog
- infoDialoghide();
- });
-
- Topo.refresh();
-
- /**
- * <Delete the specified node>
- * @param type
- * @param id
- * @see []
- */
- function delNode(nodeId)
- {
- Topo.allNodes().forEach(function(n)
- {
- if (nodeId == n.id)
- {
- var chlidSize = n.childrens.length;
- if (0 < chlidSize)
- {
- for ( var i = 0; i < chlidSize; i++)
- {
- delNode(n.childrens[i]);
- }
- }
- Topo.dropNode(n.id);
- }
-
- });
- }
-
-});
-
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/js/serviceTopology.js b/umc-iui/src/main/resources/webroot/umc-topo/js/serviceTopology.js
deleted file mode 100644
index 0aca8681..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/js/serviceTopology.js
+++ /dev/null
@@ -1,503 +0,0 @@
-// generate a random graph
-var images = [
- './images/NS.png',
- './images/NS1.png',
- './images/VNF.png',
- './images/VNF1.png',
- './images/VDU.png',
- './images/VDU1.png',
- './images/VNFC.png',
- './images/VNFC1.png'
-];
-
-// definition node data global variable
-var NSData , VNFCData, VDUData, VNFData;
-
-// all link count
-var edgeID = 0;
-
-// ready
-$(document).ready(function()
-{
- // definition resource interface url
- var nsUrl = "../../api/roc/v1/resource/nsrs";
- var vnfUrl = "../../api/roc/v1/resource/vnfs";
- var vduUrl = "../../api/roc/v1/resource/vdus";
- var vnfcUrl = "../../api/roc/v1/resource/vnfcs";
-
- // get JSON data
- $.ajaxSettings.async = false; // set ajax get json was synchronization
-
- // get ns
- $.ajax({
- "type": 'get',
- "url": nsUrl,
- "dataType": "json",
- "success": function (resp) {
- if(resp.operationResult == "SUCCESS")
- {
- NSData = resp;
- }
- else{
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- }
-
- });
-
- // get vnf
- $.ajax({
- "type": 'get',
- "url": vnfUrl,
- "dataType": "json",
- "success": function (resp) {
- if(resp.operationResult == "SUCCESS")
- {
- VNFData = resp;
- }
- else{
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- }
-
- });
-
- // get vdu
- $.ajax({
- "type": 'get',
- "url": vduUrl,
- "dataType": "json",
- "success": function (resp) {
- if(resp.operationResult == "SUCCESS")
- {
- VDUData = resp;
- }
- else{
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- }
-
- });
-
- // get vnfc
- $.ajax({
- "type": 'get',
- "url": vnfcUrl,
- "dataType": "json",
- "success": function (resp) {
- if(resp.operationResult == "SUCCESS")
- {
- VNFCData = resp;
- }
- else{
- }
- },
- error: function(XMLHttpRequest, textStatus, errorThrown) {
- }
-
- });
-
-
- /*$.getJSON('../data/ns.json', function(data){
- NSData = data;
- });
-
- $.getJSON('../data/vnfc.json', function(data){
- VNFCData = data;
- });
-
- $.getJSON('../data/vdu.json', function(data){
- VDUData = data;
- });
-
- $.getJSON('../data/vnf.json', function(data){
- VNFData = data;
- });
-
- $.getJSON('../data/host.json', function(data){
- HOSTData = data;
- });*/
-
-
- var Topo = new oTopo();
- var settings=
- {
- minNodeSize : 30,
- maxNodeSize : 40,
- minEdgeSize: 1,
- maxEdgeSize: 1,
- doubleClickZoomingRatio : 0,
- mouseZoomDuration : 1000,
- };
- Topo.canvas('NS', settings);
-
- // set the nodes can be drag and drop
- Topo.setDrag(true);
-
- // Disable the right mouse button for browser
- Topo.noright(document.body);
-
-
- // created NS node
- var NSSize = NSData.data.length;
- var VNFSize = VNFData.data.length;
- var vnfNum = 0;
- if(0 < NSSize)
- {
- for ( var i = 0; i < NSSize; i++)
- {
- var userPara = new Array();
- userPara.x = 0;
- userPara.y = 1;
-
- for (var j = 0; j < VNFSize; j++) {
- var relation = VNFData.data[j].relations;
-
- for (var k = 0; k < relation.length; k++) {
- if('belongTo' == relation[k].relationType && NSData.data[i].oid == relation[k].relatedId)
- {
- vnfNum ++;
- }
- }
-
- }
- if(0 < vnfNum)
- {
- userPara.image = images[1];
- }
- else
- {
- userPara.image = images[0];
- }
- Topo.addNode(creatNodeByJSON("NS", NSData.data[i], userPara, i + 1));
- }
- }
- else
- {
- var VDUSize = VDUData.data.length;
- var vduNum = 0;
- for ( var i = 0; i < VNFSize; i++)
- {
- var userPara = new Array();
- userPara.x = 0;
- userPara.y = 1;
-
- for (var j = 0; j < VDUSize; j++) {
- var relation = VDUData.data[j].relations;
-
- for (var k = 0; k < relation.length; k++) {
- if('belongTo' == relation[k].relationType && VNFData.data[i].oid == relation[k].relatedId)
- {
- vduNum ++;
- }
- }
-
- }
- if(0 < vduNum)
- {
- userPara.image = images[3];
- }
- else
- {
- userPara.image = images[2];
- }
- Topo.addNode(creatNodeByJSON("VNF", VNFData.data[i], userPara, i + 1));
- }
- }
-
-
- // When a node is clicked, we check for each node
- // if it is a neighbor of the clicked one. If not,
- // we set its color as grey, and else, it takes its
- // original color.
- // We do the same for the edges, and we only keep
- // edges that have both extremities colored.
- Topo.mouseBind('doubleClickNode', function(e)
- {
- var n = e.data.node;
- var userPara = new Array();
-
- if ('NS' == n.nodeType)
- {
- if(false == n.clickOpen)
- {
- // created VNF node
- var VNFSize = VNFData.data.length;
-
- if(0 < VNFSize)
- {
- for (var i = 0; i < VNFSize; i++)
- {
- var relation = VNFData.data[i].relations;
-
- for (var j = 0; j < relation.length; j++) {
- if('belongTo' == relation[j].relationType && n.oid == relation[j].relatedId)
- {
- userPara.x = i;
- userPara.y = n.y+0.5;
-
- // get vdu node count
- var vduNum = VDUData.data.length;
- var puls = false;
- for ( var k = 0; k < vduNum; k++)
- {
- var vduRelation = VDUData.data[k].relations;
- for (var l = 0; l < vduRelation.length; l++) {
- if('belongTo' == vduRelation[l].relationType && VNFData.data[i].oid == vduRelation[l].relatedId)
- {
- puls = true;
- }
- }
- }
-
- if(puls)
- {
- userPara.image = images[3];
- }
- else
- {
- userPara.image = images[2];
- }
-
- Topo.addNode(creatNodeByJSON("VNF", VNFData.data[i], userPara, i + 1));
- n.childrens.push(VNFData.data[i].vnfd);
-
- // add link
- Topo.addLink(creatEdge(n.id,VNFData.data[i].vnfd));
- }
- }
- }
- }
-
- n.image.url = images[0];
- n.clickOpen = true;
- }
- else
- {
- // deleted children nodes
- var childSize = n.childrens.length;
- for ( var i = 0; i < childSize; i++)
- {
- delNode(n.childrens[i]);
- }
-
- edgeID = 0;
- if (0 < childSize) {
- n.image.url = images[1];
- }
-
- n.clickOpen = false;
- }
- }
-
- if('VNF' == n.nodeType)
- {
- if(false == n.clickOpen)
- {
- // created VDU node
- var VDUSize = VDUData.data.length;
-
- if(0 < VDUSize)
- {
- for (var i = 0; i < VDUSize; i++)
- {
- var relation = VDUData.data[i].relations;
-
- for (var j = 0; j < relation.length; j++) {
- if('belongTo' == relation[j].relationType && n.oid == relation[j].relatedId)
- {
- userPara.x = i;
- userPara.y = n.y+0.5;
-
- // get vnfc node count
- var vnfcNum = VNFCData.data.length;
- var puls = false;
- for ( var k = 0; k < vnfcNum; k++)
- {
- var vnfcRelation = VNFCData.data[k].relations;
- for (var l = 0; l < vnfcRelation.length; l++) {
- if('deployedOn' == vnfcRelation[l].relationType && VDUData.data[i].oid == vnfcRelation[l].relatedId)
- {
- puls = true;
- }
- }
- }
-
- if(puls)
- {
- userPara.image = images[5];
- }
- else
- {
- userPara.image = images[4];
- }
-
- Topo.addNode(creatNodeByJSON("VDU", VDUData.data[i], userPara, i + 1));
- n.childrens.push(VDUData.data[i].oid);
-
- // add link
- Topo.addLink(creatEdge(n.id,VDUData.data[i].oid));
- }
- }
- }
- }
-
- n.image.url = images[2];
- n.clickOpen = true;
- }
- else
- {
- // delete children node
- var childSize = n.childrens.length;
- for ( var i = 0; i < childSize; i++)
- {
- delNode(n.childrens[i]);
- }
-
- if (0 < childSize) {
- n.image.url = images[3];
- }
-
- n.clickOpen = false;
- }
- }
-
-
- if('VDU' == n.nodeType)
- {
- if(false == n.clickOpen)
- {
- // created VNFC node
- var VNFCSize = VNFCData.data.length;
- if(0 < VNFCSize)
- {
- for ( var i = 0; i < VNFCSize; i++)
- {
- var relation = VNFCData.data[i].relations;
- for (var j = 0; j < relation.length; j++) {
- if('deployedOn' == relation[j].relationType && n.oid == relation[j].relatedId)
- {
- userPara.x = i;
- userPara.y = n.y+0.5;
- userPara.image = images[6];
-
- Topo.addNode(creatNodeByJSON("VNFC", VNFCData.data[i], userPara, i + 1));
- n.childrens.push(VNFCData.data[i].oid);
-
- // add link
- Topo.addLink(creatEdge(n.id,VNFCData.data[i].oid));
- }
- }
- }
- }
-
- n.image.url = images[4];
- n.clickOpen = true;
- }
- else
- {
- // deleted children node
- var childSize = n.childrens.length;
- for ( var i = 0; i < childSize; i++)
- {
- delNode(n.childrens[i]);
- }
-
- if (0 < childSize) {
- n.image.url = images[5];
- }
-
- n.clickOpen = false;
- }
- }
-
-
- if('VNFC' == n.nodeType)
- {
- return;
- if(false == n.clickOpen)
- {
- var VDUSize = VDUData.data.length;
- //console.log("VDUSize:"+VDUSize);
- if(0 < VDUSize)
- {
- for ( var i = 0; i < VDUSize; i++)
- {
- Topo.addNode(creatNodeByJSON("VDU", VDUData.data[i], i + 1));
- n.childrens.push(VDUData.data[i].oid);
-
- Topo.addLink(creatEdge(n.id,VDUData.data[i].oid));
- }
- }
-
- n.clickOpen = true;
- }
- else
- {
- for ( var i = 0; i < n.childrens.length; i++)
- {
- delNode(n.childrens[i]);
- }
-
- n.clickOpen = false;
- }
- }
-
- Topo.refresh();
- });
-
- // Binding the event of mouse overNode
- Topo.mouseBind('overNode', function(e) {
- infoDialogAddview(createNodeinfo(e.data.node));
- infoDialogshow();
- });
-
- // Binding the event of mouse outNode
- Topo.mouseBind('outNode', function(e) {
- infoDialoghide();
- });
-
- // When the stage is clicked, we just color each
- // node and edge with its original color.
- Topo.mouseBind('clickStage', function(e)
- {
- // Same as in the previous event:
- Topo.refresh();
-
- // close infoDialog
- infoDialoghide();
- });
-
- Topo.refresh();
-
-
- /**
- * <Delete the specified node>
- * @param type
- * @param id
- * @see []
- */
- function delNode(nodeId)
- {
- Topo.allNodes().forEach(function(n)
- {
- if (nodeId == n.id)
- {
- var chlidSize = n.childrens.length;
- if (0 < chlidSize)
- {
- for ( var i = 0; i < chlidSize; i++)
- {
- delNode(n.childrens[i]);
- }
- }
- Topo.dropNode(n.id);
- }
-
- });
- }
-});
-
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/js/topoDialog.js b/umc-iui/src/main/resources/webroot/umc-topo/js/topoDialog.js
deleted file mode 100644
index 2de252f1..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/js/topoDialog.js
+++ /dev/null
@@ -1,165 +0,0 @@
-/**
- * created node info dialog
- */
-function createDiv()
-{
- var Div=$('<div></div>'); // created parent DIV
- return Div;
-}
-
-// dialog div object
-var infoDialog;
-
-var infoDialogAddview = function(node,dialogClass)
-{
- infoDialog = createDiv();
- //set div property
- infoDialog.attr('id','infodialog');
- infoDialog.css('display','none');
- infoDialog.addClass((undefined == dialogClass)?'infoDialog':dialogClass); // add CSS style
- infoDialog.css({'left':window.event.clientX + 2 + "px",'top':window.event.clientY + 2 + "px"});
- infoDialog.css('position','absolute');// must set this property,
- infoDialog.css('width','auto');
- infoDialog.css('height','auto');
-
- // add a new node
- infoDialog.append(node);
-};
-
-// display dialog
-var infoDialogshow = function()
-{
- // if the dialog display,remove it
- if ( $("#infodialog").length > 0 ) {
- infoDialoghide();
- }
-
- $(document.body).append(infoDialog);
-
-/* var wHeight = window.document.body.offsetHeight;
- var wWidth = window.document.body.offsetWidth;
-
- var top = infoDialog.css('left');
- var left = infoDialog.css('left');
- var dHeight = infoDialog.height();
- var dWidth = infoDialog.width();
-
- console.log("infoDialogshow wHeight:"+wHeight+",wWidth:"+wWidth);
- console.log("infoDialog top:"+top+",left:"+left);
- console.log("infoDialog Height:"+dHeight+",Width:"+dWidth);*/
-
- infoDialog.css('display','');
-
- // binding mouse leave event
- $("#infodialog").mouseleave(function(){
- //$(this).remove();
- });
-};
-
-
-// remove info dialog
-var infoDialoghide = function()
-{
- $("#infodialog").remove();
-};
-
-/**
- * <display node info >
- * @param node
- * @returns
- * @see []
- */
-var createNodeinfo = function(node)
-{
- var nsInfoHTMLStr = "";
-
- nsInfoHTMLStr += '<table style="width: 350px">';
-
-
- if('NS' == node.nodeType)
- {
- nsInfoHTMLStr += '<tr><td style="width: 21%"><a>nsd</a></td><td><a>'+node.nsd+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>status</a></td><td><a>'+node.status+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>name</a></td><td><a>'+node.name+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>vendor</a></td><td><a>'+node.vendor+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>version</a></td><td><a>'+node.version+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>type</a></td><td><a>'+node.nstype+'</a></td></tr>';
- }
- else if('VNFC' == node.nodeType)
- {
- nsInfoHTMLStr += '<tr><td style="width: 21%"><a>name</a></td><td><a>'+node.name+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>ipAddress</a></td><td><a>'+node.ipAddress+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>vendor</a></td><td><a>'+node.vendor+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>version</a></td><td><a>'+node.version+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>type</a></td><td><a>'+node.vnfctype+'</a></td></tr>';
- }
- else if('VDU' == node.nodeType)
- {
- nsInfoHTMLStr += '<tr><td style="width: 21%"><a>vduImage</a></td><td><a>'+node.vduImage+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>mocName</a></td><td><a>'+node.mocName+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>name</a></td><td><a>'+node.name+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>ipAddress</a></td><td><a>'+node.ipAddress+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>vendor</a></td><td><a>'+node.vendor+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>version</a></td><td><a>'+node.version+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>type</a></td><td><a>'+node.vdutype+'</a></td></tr>';
- }
- else if('VNF' == node.nodeType)
- {
- nsInfoHTMLStr += '<tr><td style="width: 21%"><a>status</a></td><td><a>'+node.status+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>name</a></td><td><a>'+node.name+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>ipAddress</a></td><td><a>'+node.ipAddress+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>vendor</a></td><td><a>'+node.vendor+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>version</a></td><td><a>'+node.version+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>type</a></td><td><a>'+node.vnftype+'</a></td></tr>';
- }
- else if('HOST' == node.nodeType)
- {
- nsInfoHTMLStr += '<tr><td style="width: 21%"><a>mocName</a></td><td><a>'+node.mocName+'</a></td></tr>';
- /*nsInfoHTMLStr += '<tr><td><a>protocol</a></td><td><a>'+node.protocol+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>port</a></td><td><a>'+node.port+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>cpuNum</a></td><td><a>'+node.cpuNum+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>cpuRate</a></td><td><a>'+node.cpuRate+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>memorySize</a></td><td><a>'+node.memorySize+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>storageSize</a></td><td><a>'+node.storageSize+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>moc</a></td><td><a>'+node.moc+'</a></td></tr>';*/
- nsInfoHTMLStr += '<tr><td><a>name</a></td><td><a>'+node.name+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>ipAddress</a></td><td><a>'+node.ipAddress+'</a></td></tr>';
- }
- else if('VIM' == node.nodeType)
- {
- nsInfoHTMLStr += '<tr><td style="width: 21%"><a>user</a></td><td><a>'+node.user+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>url</a></td><td><a>'+node.url+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>status</a></td><td><a>'+node.status+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>userName</a></td><td><a>'+node.userName+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>checkTime</a></td><td><a>'+node.checkTime+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>name</a></td><td><a>'+node.name+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>ipAddress</a></td><td><a>'+node.ipAddress+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>vendor</a></td><td><a>'+node.vendor+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>type</a></td><td><a>'+node.vimtype+'</a></td></tr>';
- }
-
- nsInfoHTMLStr += '</table>';
-
- return nsInfoHTMLStr;
-};
-
-var createServiceNodeinfo = function(node)
-{
- var nsInfoHTMLStr = "";
- nsInfoHTMLStr += '<table style="width: 250px">';
- nsInfoHTMLStr += '<tr><td style="width: 21%"><a>Name</a></td><td><a>'+node.mocName+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>status</a></td><td><a>'+node.status+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>vendor</a></td><td><a>'+node.vendor+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>version</a></td><td><a>'+node.version+'</a></td></tr>';
- nsInfoHTMLStr += '<tr><td><a>ipAddress</a></td><td><a>'+node.ipAddress+'</a></td></tr>';
- nsInfoHTMLStr += '</table>';
-
- return nsInfoHTMLStr;
-};
-
-
-// ready
-$(document).ready(function()
-{
-
-});
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/js/topoTool.js b/umc-iui/src/main/resources/webroot/umc-topo/js/topoTool.js
deleted file mode 100644
index 7b22cb5c..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/js/topoTool.js
+++ /dev/null
@@ -1,344 +0,0 @@
-/**openo tools**/
-// generate a random graph
-var imgOn =
-[
- // node image resource
- './images/on/InternetServer.gif', //NS
- './images/on/Multiplexer.gif', // VNFC
- './images/on/Hub.gif', // VDU
- './images/on/Bridge.gif', // VNF
- './images/on/Computer.png', // HOST
- './images/on/vim.png' //VIM
-], imgOff =
-[
- // node image resource
- './images/off/InternetServer.gif', //NS
- './images/off/Multiplexer.gif', // VNFC
- './images/off/Hub.gif', // VDU
- './images/off/Bridge.gif', // VNF
- './images/off/Computer.gif', // HOST
- './images/off/vim.png' //VIM
-], colors =
-[
- // node background color
- '#617db4',
- '#668f3c',
- '#c6583e',
- '#b956af'
-],
-step = 0;
-
-
-/**
- * <Data generated topology node based on rest interface >
- * @param nodeType node type
- * @param jsonData json from rest
- * @param customPara user data
- * @param index node index
- * @see []
- */
-function creatNodeByJSON(nodeType,jsonData,customPara,index)
-{
- var node = {};
-
- console.log("creatNodeByJSON nodeType:"+nodeType);
- console.log("creatNodeByJSON customPara:"+customPara.length);
- console.log("creatNodeByJSON customPara:"+customPara.image);
-
- // created node
- if('NS' == nodeType)
- {
- // Generate a random graph, going through the different shapes
- node =
- {
- id : jsonData.nsd,
- label : jsonData.name,
- // note the ShapeLibrary.enumerate() returns the names of all
- // supported renderers
- type : "square",
- x : (undefined != customPara.x)?customPara.x:jsonData.positionX,//1*index,
- y : (undefined != customPara.y)?customPara.y:jsonData.positionY,//1,
- size : (undefined != customPara.size)?customPara.size:8,
- color : (undefined != customPara.color)?customPara.color:"transparent",
-
- // custom parameter
- nodeType: nodeType,
- nsd: jsonData.nsd,
- autoScalePolicy: jsonData.autoScalePolicy,
- monitoringParameter: jsonData.monitoringParameter,
- flavour: jsonData.flavour,
- status: jsonData.status,
- customPara: jsonData.customPara,
- oid: jsonData.oid,
- moc: jsonData.moc,
- mocName: jsonData.mocName,
- name: jsonData.name,
- vendor: jsonData.vendor,
- version: jsonData.version,
- nstype: jsonData.type,
- relations: jsonData.relations,
- clickOpen: false,
- childrens: []
- };
-
- node.image =
- {
- url : (undefined != customPara.image)?customPara.image:imgOn[0],
- // scale/clip are ratio values applied on top of 'size'
- scale : 1,
- clip : 0,
- };
- }
- else if('VNFC' == nodeType)
- {
- // Generate a random graph, going through the different shapes
- node =
- {
- id : jsonData.oid,
- label : jsonData.name,
- // note the ShapeLibrary.enumerate() returns the names of all
- // supported renderers
- type : "square",
- x : (undefined != customPara.x)?customPara.x:jsonData.positionX,//1*index,
- y : (undefined != customPara.y)?customPara.y:jsonData.positionY,//2,
- size : (undefined != customPara.size)?customPara.size:8,
- color : (undefined != customPara.color)?customPara.color:"transparent",
-
- // custom parameter
- nodeType: nodeType,
- vduId: jsonData.vduId,
- vnfId: jsonData.vnfId,
- status: "active",
- createTime: jsonData.createTime,
- oid: jsonData.oid,
- moc: jsonData.moc,
- name: jsonData.name,
- ipAddress: jsonData.ipAddress,
- vendor: jsonData.vendor,
- version: jsonData.version,
- vnfctype: jsonData.type,
- relations: jsonData.relations,
- clickOpen: false,
- childrens: []
- };
-
- node.image =
- {
- url : (undefined != customPara.image)?customPara.image:imgOn[1],
- // scale/clip are ratio values applied on top of 'size'
- scale : 1,
- clip : 0,
- };
- }
- else if('VDU' == nodeType)
- {
- // Generate a random graph, going through the different shapes
- node =
- {
- id : jsonData.oid,
- label : jsonData.name,
- // note the ShapeLibrary.enumerate() returns the names of all
- // supported renderers
- type : "square",
- x : (undefined != customPara.x)?customPara.x:jsonData.positionX,//1*index,
- y : (undefined != customPara.y)?customPara.y:jsonData.positionY,//3,
- size : (undefined != customPara.size)?customPara.size:8,
- color : (undefined != customPara.color)?customPara.color:"transparent",
-
- // custom parameter
- nodeType: nodeType,
- vduImage: jsonData.vduImage,
- vnfId: jsonData.vnfId,
- vimId: jsonData.vimId,
- hostId: jsonData.hostId,
- createTime: jsonData.createTime,
- customPara: jsonData.customPara,
- status: "active",//jsonData.status,
- lanInfo: jsonData.lanInfo,
- flavourId: jsonData.flavourId,
- floatIpInfo: jsonData.floatIpInfo,
- oid: jsonData.oid,
- moc: jsonData.moc,
- mocName: jsonData.mocName,
- name: jsonData.name,
- ipAddress: jsonData.ipAddress,
- vendor: jsonData.vendor,
- version: jsonData.version,
- vdutype: jsonData.type,
- relations: jsonData.relations,
- clickOpen: false,
- childrens: []
- };
-
- node.image =
- {
- url : (undefined != customPara.image)?customPara.image:imgOn[2],
- // scale/clip are ratio values applied on top of 'size'
- scale : 1,
- clip : 0,
- };
- }
- else if('VNF' == nodeType)
- {
- // Generate a random graph, going through the different shapes
- node =
- {
- id : jsonData.vnfd,
- label : jsonData.name,
- // note the ShapeLibrary.enumerate() returns the names of all
- // supported renderers
- type : "square",
- x : (undefined != customPara.x)?customPara.x:jsonData.positionX,//1*index,
- y : (undefined != customPara.y)?customPara.y:jsonData.positionY,//4,
- size : (undefined != customPara.size)?customPara.size:8,
- color : (undefined != customPara.color)?customPara.color:"transparent",
-
- // custom parameter
- nodeType: nodeType,
- vnfd: jsonData.vnfd,
- autoScalePolicy: jsonData.autoScalePolicy,
- flavourId: jsonData.flavourId,
- localization: jsonData.localization,
- monitoringParameter: jsonData.monitoringParameter,
- status: jsonData.status,
- customPara: jsonData.customPara,
- createTime: jsonData.createTime,
- vimId: jsonData.vimId,
- oid: jsonData.oid,
- moc: jsonData.moc,
- name: jsonData.name,
- ipAddress: jsonData.ipAddress,
- vendor: jsonData.vendor,
- version: jsonData.version,
- vnftype: jsonData.type,
- relations: jsonData.relations,
- clickOpen: false,
- childrens: []
- };
-
- node.image =
- {
- url : (undefined != customPara.image)?customPara.image:imgOn[3],
- // scale/clip are ratio values applied on top of 'size'
- scale : 1,
- clip : 0,
- };
- }
- else if('HOST' == nodeType)
- {
- // Generate a random graph, going through the different shapes
- node =
- {
- id : jsonData.oid,
- label : jsonData.name,
- // note the ShapeLibrary.enumerate() returns the names of all
- // supported renderers
- type : "square",
- x : (undefined != customPara.x)?customPara.x:jsonData.positionX,//1*index,
- y : (undefined != customPara.y)?customPara.y:jsonData.positionY,//2,
- size : (undefined != customPara.size)?customPara.size:8,
- color : (undefined != customPara.color)?customPara.color:"transparent",
-
- // custom parameter
- nodeType: nodeType,
- vimId: jsonData.vimId,
- port: jsonData.port,
- customPara: jsonData.customPara,
- cpuNum: jsonData.cpuNum,
- memorySize: jsonData.memorySize,
- storageSize: jsonData.storageSize,
- status: "active",//jsonData.status,
- oid: jsonData.oid,
- moc: jsonData.moc,
- mocName: jsonData.mocName,
- name: jsonData.name,
- ipAddress: jsonData.ipAddress,
- relations: jsonData.relations,
- clickOpen: false,
- childrens: []
- };
-
- node.image =
- {
- url : (undefined != customPara.image)?customPara.image:imgOn[4],
- // scale/clip are ratio values applied on top of 'size'
- scale : 1,
- clip : 0,
- };
- }
- else if('VIM' == nodeType)
- {
- // Generate a random graph, going through the different shapes
- node =
- {
- id : jsonData.oid,
- label : jsonData.name,
- // note the ShapeLibrary.enumerate() returns the names of all
- // supported renderers
- type : "square",
- x : (undefined != customPara.x)?customPara.x:1*index,
- y : (undefined != customPara.y)?customPara.y:1,
- size : (undefined != customPara.size)?customPara.size:8,
- color : (undefined != customPara.color)?customPara.color:"transparent",
-
- // custom parameter
- nodeType: nodeType,
- user: jsonData.user,
- url: jsonData.url,
- hostName: jsonData.hostName,
- status: jsonData.status,
- errorInfo: jsonData.errorInfo,
- userName: jsonData.userName,
- password: jsonData.password,
- checkTime: jsonData.checkTime,
- createTime: jsonData.createTime,
- oid: jsonData.oid,
- moc: jsonData.moc,
- mocName: jsonData.mocName,
- name: jsonData.name,
- ipAddress: jsonData.ipAddress,
- vendor: jsonData.vendor,
- vimtype: jsonData.type,
- relations: jsonData.relations,
- clickOpen: false,
- childrens: []
- };
-
- node.image =
- {
- url : (undefined != customPara.image)?customPara.image:imgOn[5],
- // scale/clip are ratio values applied on top of 'size'
- scale : 1,
- clip : 0,
- };
- }
- //console.log(node.id);
- //console.log(node.label);
- //console.log(node.image);
-
- return node;
-}
-
-
-/**
- * <Data generated link based on rest interface>
- * @param noteSource
- * @param noteTarget
- * @see []
- */
-function creatEdge(noteSource,noteTarget)
-{
- //console.log("creatEdge noteSource:"+noteSource+",noteTarget:"+noteTarget);
- var edge=
- {
- id : 'RT' + Math.random(),
- source : noteSource,
- target : noteTarget,
- size : 1,
- color: '#1C86EE'
- };
-
- edgeID ++;
-
- return edge;
-}
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/physicalTopology.html b/umc-iui/src/main/resources/webroot/umc-topo/physicalTopology.html
deleted file mode 100644
index 1a1eb4e6..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/physicalTopology.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>openotopo</title>
-
-<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
-<meta http-equiv="description" content="this is my page">
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-
-<link rel="stylesheet" type="text/css" href="./css/main.css">
-<script type="text/javascript" src="../component/thirdparty/jquery/jquery-2.1.3.min.js"></script>
-<script type="text/javascript" src="../component/openotopo/openotopo.min.js"></script>
-<script type="text/javascript" src="./js/topoTool.js"></script>
-<script type="text/javascript" src="./js/topoDialog.js"></script>
-<script type="text/javascript" src="./js/physicalTopology.js"></script>
-
-
-</head>
-<body>
- <div id="container">
- <div id="VIM"></div>
- </div>
-</body>
-</html>
diff --git a/umc-iui/src/main/resources/webroot/umc-topo/serviceTopology.html b/umc-iui/src/main/resources/webroot/umc-topo/serviceTopology.html
deleted file mode 100644
index ffffc2f9..00000000
--- a/umc-iui/src/main/resources/webroot/umc-topo/serviceTopology.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>openotopo</title>
-
-<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
-<meta http-equiv="description" content="this is my page">
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-
-<link rel="stylesheet" type="text/css" href="./css/main.css">
-<script type="text/javascript" src="../component/thirdparty/jquery/jquery-2.1.3.min.js"></script>
-<script type="text/javascript" src="../component/openotopo/openotopo.min.js"></script>
-<script type="text/javascript" src="./js/topoTool.js"></script>
-<script type="text/javascript" src="./js/topoDialog.js"></script>
-<script type="text/javascript" src="./js/serviceTopology.js"></script>
-
-
-</head>
-<body>
- <div id="container">
- <div id="NS"></div>
- </div>
-</body>
-</html>